Skip to content

Latest commit

 

History

History
74 lines (60 loc) · 4.6 KB

raycast-import.md

File metadata and controls

74 lines (60 loc) · 4.6 KB

Raycast import

Tinycast reads the .rayconfig written by Raycast v2.x: a RAYCFG3 container holding an AES-256-GCM payload under a scrypt-derived key. It is the only format read; the v1.x export and the Raycast X beta between them are both gone, deleted rather than carried, as of v0.10.5.

Invariants

  • RaycastDecoder stays platform-UI-free and returns the payload's own bytes. RaycastImportReader, not the decoder, validates them against PopToRootTimeout / EmojiSkinTone / HyperKeyPhysicalKey / KeyShortcut.
  • Recognition is the container signature and nothing else. RaycastDecoder.isExport needs no passphrase, so the Backup pane runs it the moment a file is chosen and a wrong passphrase reports a wrong passphrase instead of "not a Raycast export".
  • Never commit a real .rayconfig as a fixture. RaycastTests seals its own in-process.
  • Every scrypt derive costs about 11 s in the unoptimized Debug suite. RaycastTests' fixture carries its key, derived offline, so only the decrypt and wrong-passphrase cases pay it, in parallel; anything testing the container's framing is written to fail before it.
  • The payload gunzip cap is a memory bound, not a zip-bomb guard. AES-GCM has already authenticated those bytes. The unauthenticated header stays at 1 MB. A clipboard-heavy export decompresses past 64 MB, so the payload cap is 512 MB.

Wire format

file = "RAYCFG3\n" ‖ UInt32LE(header.count) ‖ gzip(header JSON) ‖ ciphertext ‖ tag(16)
body = AES-256-GCM(gzip(payload JSON))
key  = scrypt(passphrase, salt, N=16384, r=8, p=1, dkLen=32)

The header carries schemaVersion, iv and salt, hex-encoded, 16 bytes each. schemaVersion is Raycast's own container number and is 3; anything else is rejected. The payload is category-keyed JSON: settings, clipboardHistory, a top-level snippets whose entries name themselves title, and a quicklinks object holding quicklinks plus openWithPlatforms.

Raycast always encrypts. Raycast 2.x asks for a passphrase (at least 8 characters) on the first run of its Export Settings & Data command; it is changed in Raycast → Settings → Advanced → Export. Tinycast never reads the keychain; the user supplies the passphrase.

Mapping

An applications command hides the launched app's path after ::=:: in its id, resolved through Bundle to a bundle ID, the same resolution the hotkey, favorite and alias mappers all use. Hotkeys are LayoutIndependent key codes with named modifiers, and always import as a .combo: Raycast has no double-tap binding. A clipboard record's representations are nested and its timestamps carry fractional seconds; only an image/* representation whose file still exists becomes an image clip, and the rest are counted as missing rather than dropped silently. Quicklinks land through QuicklinkArchive.merge, so they add to the library and never replace it. {Query} is rewritten to {argument}; an openWith app path (or a platform id in openWithPlatforms) resolves to a bundle ID the same way application hotkeys do. Raycast's ULID is discarded; each imported row gets a fresh UUID, as a JSON quicklink import already does. Importing at least one quicklink turns quicklinksEnabled on: opening a link grants no permission class.

Clipboard entries with the Boolean pinned: true remain pinned, for both text and existing images, so they are exempt from Tinycast's retention pruning even when their original createdAt is old. The pin flag has no timestamp or order in the observed v2.x clipboard payload; pinnedAt uses createdAt as a deterministic fallback, so imported pins sort by creation date, oldest first. Missing, false or malformed pin flags leave an entry unpinned and subject to the configured retention.

Script commands are not in a .rayconfig (they are files in a folder Raycast points at), so they have their own importer, described in custom-commands.md.

Layout

RaycastDecoder unwraps the container and returns Raycast's own values; RaycastImportReader turns those into Tinycast's domain types. That is the same pure-layer / platform-layer split Features/WindowManagement/ uses: the reader needs AppKit, so it lives in Service/ and is covered by the app build. RaycastClipboardImport holds the clipboard mapping with an injected clock and file existence check; RaycastTests runs it into the real ClipboardStore to cover pin metadata and import-time retention.

RaycastImport is only the data: Result, selecting(_:) and RaycastImportOptions. BackupActions.importRaycast runs the reader off the main actor.