AttachPayload
Defined in: packages/client/src/worker/protocol.ts:164
tab → worker: the attach handshake. The first attach boots the engine; later attaches join it.
Properties
Section titled “Properties”config?
Section titled “config?”
optionalconfig?:object
Defined in: packages/client/src/worker/protocol.ts:206
Serializable per-attach config overrides (kept minimal; the urls are baked into the worker). role
selects which baked registry the worker boots (ADR-0032 S3): the spare is minted role-agnostic, so
the role is only known at claim/attach — a single worker file bakes BOTH registries and picks here.
freshStore is the fresh-store prefetch-overlap hint (ADR-0032 S4): the tab’s claim path knows a
claimed spare is schemaless (fresh) while a mapped/returning store never is, and forwards that here so
the worker’s createSyncClient can overlap the shape catch-up with the local boot phases.
freshStore?
Section titled “freshStore?”
optionalfreshStore?:boolean
optionalrole?:string
syncEnabled?
Section titled “syncEnabled?”
optionalsyncEnabled?:boolean
executionLimit?
Section titled “executionLimit?”
optionalexecutionLimit?:object
Defined in: packages/client/src/worker/protocol.ts:179
ADR-0049 D5: the tab’s engine-construction limit, checked by the host before it acknowledges attach.
maxDispatchMs?
Section titled “maxDispatchMs?”
optionalmaxDispatchMs?:number
restore?
Section titled “restore?”
optionalrestore?:RestoreArtefactWire
Defined in: packages/client/src/worker/protocol.ts:188
Restore the store from a backup on THIS attach (ADR-0035 decision 6) — the worker-mode carrier of
createSyncClient’s restoreFrom. Restore rides the FIRST attach (the boot attach): a File/Blob
cannot cross postMessage as a transferable, so the tab decomposes it into a transferred ArrayBuffer
plus its name/mime — the ExportArtefactWire pattern in reverse — and the worker recomposes it
into a Blob and hands it to createSyncClient. Absent on every ordinary attach. An attach that carries
this AFTER the engine has already booted is REFUSED (you cannot restore into a running store).
storage?
Section titled “storage?”
optionalstorage?:SyncStorageDeclaration
Defined in: packages/client/src/worker/protocol.ts:195
The tab’s WIRE storage declaration (ADR-0050) — repeated from the pre-placement declaration message so
the ENGINE binds it (durability included) wherever it runs, the elected dedicated engine included (whose
scope never saw the SharedWorker’s declaration message). First payload binds; a later explicit
disagreement with the bound resolution is refused typed (StorageDeclarationRefusedError).
storeId?
Section titled “storeId?”
optionalstoreId?:string
Defined in: packages/client/src/worker/protocol.ts:166
The bound store id (SharedWorker naming resolves it tab-side before attach — ADR-0032 decision 5).
storePath?
Section titled “storePath?”
optionalstorePath?:string
Defined in: packages/client/src/worker/protocol.ts:171
Explicit plain store PATH (ADR-0036) if the worker should create its own store — a name, not a storage
URL; the worker derives the backend. When omitted, storeId/the worker default is used.
token:
AuthTokenSnapshot|null
Defined in: packages/client/src/worker/protocol.ts:197
The tab’s current auth token at attach time, or null when unauthenticated.