# 1.3 — Rig sharing & the `.shoegaze` document type Goal: a single registered file type for sharing rigs and boards, migrate export/import onto it, and add an OS share sheet to the rig library and board-version menu. Local only — no backend, no accounts. ## File type - **Extension:** `.shoegaze`. **UTType:** `net.realizedsound.shoegaze`, conforms to `public.json` (stays text-readable). `UTType.shoeGaze` lives in `LyrebirdShoeGazeUI`. - Declared by all four demo apps and both CLI scaffolder templates (`CFBundleDocumentTypes` Editor/Owner + `UTExportedTypeDeclarations`) so the system associates the type with the app for Open and Share. ## Document model — `LyrebirdShoeGaze` `ShoeGazeDocument` — versioned envelope (`shoeGazeDocumentFormatVersion = 1`) around one payload: - `.rigs(RigArchive)` — one or many rigs (a single shared rig is a one-rig archive). - `.board(BoardVersion)` — a single board snapshot. `data()` encodes pretty-printed JSON (`secondsSince1970` dates). `decoded(from:legacyRigName:)` is tolerant: tries the envelope, then a bare `RigArchive`, then a bare `ShoeGazeState` (normalised to a one-rig document). On-disk JSON carries an explicit `kind` discriminator. ## Migration - `RigLibraryStore.exportDocumentData()` writes the library as a `.shoegaze` document; the prior `exportArchiveData()` (bare `RigArchive`) is retained for callers/tests. - `importArchive(from:)` now decodes via `ShoeGazeDocument.decoded` — accepts `.shoegaze`, bare archive, and legacy single-rig files. A board document contributes no rigs. - `RigFileDocument` writes `.shoeGaze`, reads `[.shoeGaze, .json]`. The Builder's `fileExporter` uses `.shoeGaze`; the `fileImporter` accepts `[.shoeGaze, .json]`. - **Internal** per-rig library files and board-version files stay plain `.json` (app-private; no churn). `.shoegaze` is the share/export surface only. ## Share UI — `LyrebirdShoeGazeUI` - `RigShareItem` / `BoardShareItem` — `Transferable` wrappers holding pre-encoded `.shoegaze` bytes (value-type payload keeps them `Sendable`). Suggested filename `.shoegaze`. - Rig library sidebar: `Share…` per rig (context menu). Board editor Versions menu: `Share…` per version. Both via SwiftUI `ShareLink` → AirDrop / Mail / Messages / Files. ## Tests - `ShoeGazeDocumentTests` — rig/board round-trip, legacy archive + bare-state decode, garbage rejection, `kind` discriminator on disk. - `RigLibraryStoreTests` — `.shoegaze` export→import round-trip; board document imports zero rigs. - Lyrebird `ProjectScaffolderTests` — generated macOS/iOS `Info.plist` registers the document type.