@immediately-run/sdk 0.72.0 → 0.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/dnd.cjs +2 -5
  2. package/dist/dnd.cjs.map +1 -1
  3. package/dist/dnd.d.cts +8 -1
  4. package/dist/dnd.d.ts +8 -1
  5. package/dist/dnd.js +2 -5
  6. package/dist/dnd.js.map +1 -1
  7. package/dist/editor.cjs +2 -5
  8. package/dist/editor.cjs.map +1 -1
  9. package/dist/editor.d.cts +34 -5
  10. package/dist/editor.d.ts +34 -5
  11. package/dist/editor.js +2 -5
  12. package/dist/editor.js.map +1 -1
  13. package/dist/generated/spaces.cjs +40 -0
  14. package/dist/generated/spaces.cjs.map +1 -1
  15. package/dist/generated/spaces.d.cts +96 -1
  16. package/dist/generated/spaces.d.ts +96 -1
  17. package/dist/generated/spaces.js +35 -0
  18. package/dist/generated/spaces.js.map +1 -1
  19. package/dist/index.cjs +2 -0
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +2 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +1 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/ipc.cjs +3 -10
  26. package/dist/ipc.cjs.map +1 -1
  27. package/dist/ipc.js +3 -10
  28. package/dist/ipc.js.map +1 -1
  29. package/dist/llm.cjs.map +1 -1
  30. package/dist/llm.d.cts +14 -0
  31. package/dist/llm.d.ts +14 -0
  32. package/dist/llm.js.map +1 -1
  33. package/dist/mounts.cjs +14 -15
  34. package/dist/mounts.cjs.map +1 -1
  35. package/dist/mounts.d.cts +9 -2
  36. package/dist/mounts.d.ts +9 -2
  37. package/dist/mounts.js +15 -16
  38. package/dist/mounts.js.map +1 -1
  39. package/dist/openExternal.cjs +2 -7
  40. package/dist/openExternal.cjs.map +1 -1
  41. package/dist/openExternal.d.cts +7 -1
  42. package/dist/openExternal.d.ts +7 -1
  43. package/dist/openExternal.js +2 -7
  44. package/dist/openExternal.js.map +1 -1
  45. package/dist/openRepository.cjs +2 -7
  46. package/dist/openRepository.cjs.map +1 -1
  47. package/dist/openRepository.d.cts +7 -1
  48. package/dist/openRepository.d.ts +7 -1
  49. package/dist/openRepository.js +2 -7
  50. package/dist/openRepository.js.map +1 -1
  51. package/dist/protocolRefusal.cjs +35 -0
  52. package/dist/protocolRefusal.cjs.map +1 -0
  53. package/dist/protocolRefusal.d.cts +54 -0
  54. package/dist/protocolRefusal.d.ts +54 -0
  55. package/dist/protocolRefusal.js +12 -0
  56. package/dist/protocolRefusal.js.map +1 -0
  57. package/dist/protocolSchemes.cjs +1 -0
  58. package/dist/protocolSchemes.cjs.map +1 -1
  59. package/dist/protocolSchemes.d.cts +1 -0
  60. package/dist/protocolSchemes.d.ts +1 -0
  61. package/dist/protocolSchemes.js +2 -0
  62. package/dist/protocolSchemes.js.map +1 -1
  63. package/dist/secrets.cjs +2 -5
  64. package/dist/secrets.cjs.map +1 -1
  65. package/dist/secrets.d.cts +8 -1
  66. package/dist/secrets.d.ts +8 -1
  67. package/dist/secrets.js +2 -5
  68. package/dist/secrets.js.map +1 -1
  69. package/dist/spacesMode.cjs +101 -0
  70. package/dist/spacesMode.cjs.map +1 -0
  71. package/dist/spacesMode.d.cts +149 -0
  72. package/dist/spacesMode.d.ts +149 -0
  73. package/dist/spacesMode.js +75 -0
  74. package/dist/spacesMode.js.map +1 -0
  75. package/dist/vcs.cjs +2 -5
  76. package/dist/vcs.cjs.map +1 -1
  77. package/dist/vcs.d.cts +8 -1
  78. package/dist/vcs.d.ts +8 -1
  79. package/dist/vcs.js +2 -5
  80. package/dist/vcs.js.map +1 -1
  81. package/dist/version.cjs +1 -1
  82. package/dist/version.cjs.map +1 -1
  83. package/dist/version.d.cts +1 -1
  84. package/dist/version.d.ts +1 -1
  85. package/dist/version.js +1 -1
  86. package/dist/version.js.map +1 -1
  87. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generated/spaces.ts"],"sourcesContent":["// GENERATED by scripts/codegen-prototype/generate.mjs — DO NOT EDIT.\n// Source of truth: descriptors.spaces.mjs\n// Family: spaces — Space management (the space-manager app) — UI_AS_APPS_SPEC §5.\n\nimport { invoke } from '../catalog';\n\nconst withTry = <Args extends unknown[], R, E extends string>(\n fn: (...args: Args) => Promise<R>,\n fallback: E,\n): ((...args: Args) => Promise<R>) & { try: (...args: Args) => Promise<{ ok: true; value: R } | { ok: false; code: E }> } =>\n Object.assign(fn, {\n try: async (...args: Args) => {\n try {\n return { ok: true as const, value: await fn(...args) };\n } catch (e) {\n return { ok: false as const, code: (e as { code?: E }).code ?? fallback };\n }\n },\n });\n\n/** A collaborator's role on a shared space: full `owner`, read-write `writer`, or read-only `reader`. */\nexport type Role =\n | 'owner'\n | 'writer'\n | 'reader';\n\n/** Summary of a space, as returned by {@link listSpaces}. */\nexport interface SpaceInfo {\n spaceId: string;\n role?: Role;\n owner?: string;\n name?: string;\n}\n\n/** A member of a space (for the share/manage UI). */\nexport interface Member {\n /** The **grantee** — `user:{uid}` | `group:{gid}`. This is the canonical name (core_concepts §4: \"principal\" is reserved for the authority context; a space member is a *grantee*). The host populates this on every member row. */\n grantee: string;\n /** @deprecated Use {@link Member.grantee}. Kept as an alias (same value) for back-compat during the `principal`→`grantee` migration; will be removed in a future major. The host still populates both. */\n principal: string;\n role: Role;\n login?: string;\n avatarUrl?: string;\n}\n\n/** A handle resolved to a principal (handle → who). */\nexport interface ResolvedUser {\n uid: string;\n login: string;\n avatarUrl?: string;\n}\n\n/** One durable grant an app holds, for the §8.11 capability audit view. */\nexport interface GrantRecord {\n /** The app's provider-qualified **program** identity (AA-01 `appKey`). The DEFAULT program keys to the bare `provider__namespace__repository`; a NAMED mini-app appends a fourth `enc()`-escaped component (`provider__namespace__repository__name`) so its grants isolate from the repo's other programs. Host-supplied — the app never builds this key. */\n appKey: string;\n spaceId: string;\n /** Universal mount id (§3.5). */\n mountId: string;\n subtree?: string;\n mode: 'ro' | 'rw';\n name?: string;\n}\n\n/** A pending invitation to a space (pull-based sharing, FILE_SHARING_SPEC §6.4). It grants NO access until accepted — the recipient accepts it from their inbox ({@link listMyInvites} → {@link acceptInvite}), materializing membership. The display fields (`name`/`login`/`avatarUrl`) are untrusted for rendering. */\nexport interface Invite {\n spaceId: string;\n /** The invitee's uid — carried so the owner's pending list can {@link revokeInvite}(spaceId, uid). */\n uid: string;\n role: Role;\n owner: string;\n name?: string;\n invitedBy: string;\n /** epoch ms (server-stamped); absent until the write settles. */\n invitedAt?: number;\n login?: string;\n avatarUrl?: string;\n}\n\nexport type ListSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * List spaces you can access — all of them, or just those bound to this app.\n *\n * Capability: `spaces:app`. Catalog name: `spaces:list`.\n * @throws `Error & { code: ListSpacesError }` on host refusal.\n */\nexport const listSpaces = withTry<[opts?: { app?: boolean }], SpaceInfo[], ListSpacesError>(\n (opts: { app?: boolean } = {}): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:list\", opts),\n 'unknown',\n);\n\nexport type ListAllSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate ALL the user's spaces (not just this app's).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listAll`.\n * @throws `Error & { code: ListAllSpacesError }` on host refusal.\n */\nexport const listAllSpaces = withTry<[], SpaceInfo[], ListAllSpacesError>(\n (): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:listAll\", {}),\n 'unknown',\n);\n\nexport type GetSpaceMembersError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Read a space's members one-shot.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:members`.\n * @throws `Error & { code: GetSpaceMembersError }` on host refusal.\n */\nexport const getSpaceMembers = withTry<[string], Member[], GetSpaceMembersError>(\n (spaceId: string): Promise<Member[]> =>\n invoke<Member[]>(\"spaces:members\", { spaceId }),\n 'unknown',\n);\n\nexport type InviteToSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'quota-exceeded';\n\n/**\n * Invite a user (by provider handle) to a space at a role. The host resolves\n * the handle, so the app never sees other users' uids except the one it\n * invited. Pull-based (FILE_SHARING_SPEC §6.4): this writes an INVITATION,\n * not membership — the recipient must {@link acceptInvite}. Re-inviting an\n * already-invited/member user is idempotent.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:invite`.\n * @throws `Error & { code: InviteToSpaceError }` on host refusal.\n */\nexport const inviteToSpace = withTry<[string, string, Role], void, InviteToSpaceError>(\n async (spaceId: string, login: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:invite\", { spaceId, login, role }); },\n 'unknown',\n);\n\nexport type UnshareSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Remove a member from a space. Refused if it would orphan the space\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:unshare`.\n * @throws `Error & { code: UnshareSpaceError }` on host refusal.\n */\nexport const unshareSpace = withTry<[string, string], void, UnshareSpaceError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:unshare\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type SetSpaceRoleError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Change a member's role. Refused if it would drop the sole owner\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:setRole`.\n * @throws `Error & { code: SetSpaceRoleError }` on host refusal.\n */\nexport const setSpaceRole = withTry<[string, string, Role], void, SetSpaceRoleError>(\n async (spaceId: string, uid: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:setRole\", { spaceId, uid, role }); },\n 'unknown',\n);\n\nexport type LookupUserError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Resolve a provider handle to a principal (for the invite flow).\n * Rate-limited host-side.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:lookupUser`.\n * @throws `Error & { code: LookupUserError }` on host refusal.\n */\nexport const lookupUser = withTry<[string], ResolvedUser, LookupUserError>(\n (login: string): Promise<ResolvedUser> =>\n invoke<ResolvedUser>(\"spaces:lookupUser\", { login }),\n 'unknown',\n);\n\nexport type ListGrantsError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate every (app, mount) grant the user holds — the audit view\n * (§8.11). Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:grants`.\n * @throws `Error & { code: ListGrantsError }` on host refusal.\n */\nexport const listGrants = withTry<[], GrantRecord[], ListGrantsError>(\n (): Promise<GrantRecord[]> =>\n invoke<GrantRecord[]>(\"spaces:grants\", {}),\n 'unknown',\n);\n\nexport type RevokeGrantError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Revoke one app's grant on a space — durable (the app can't re-mount) plus\n * a best-effort live teardown. Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeGrant`.\n * @throws `Error & { code: RevokeGrantError }` on host refusal.\n */\nexport const revokeGrant = withTry<[string, string], void, RevokeGrantError>(\n async (appKey: string, spaceId: string): Promise<void> => { await invoke<void>(\"spaces:revokeGrant\", { appKey, spaceId }); },\n 'unknown',\n);\n\nexport type ListPendingInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The owner's outstanding invitations for a space.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:pendingInvites`.\n * @throws `Error & { code: ListPendingInvitesError }` on host refusal.\n */\nexport const listPendingInvites = withTry<[string], Invite[], ListPendingInvitesError>(\n (spaceId: string): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:pendingInvites\", { spaceId }),\n 'unknown',\n);\n\nexport type RevokeInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Withdraw a pending invitation (distinct from {@link unshareSpace}, which\n * removes an ACCEPTED member).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeInvite`.\n * @throws `Error & { code: RevokeInviteError }` on host refusal.\n */\nexport const revokeInvite = withTry<[string, string], void, RevokeInviteError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:revokeInvite\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type ListMyInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The caller's OWN invitation inbox.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listInvites`.\n * @throws `Error & { code: ListMyInvitesError }` on host refusal.\n */\nexport const listMyInvites = withTry<[], Invite[], ListMyInvitesError>(\n (): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:listInvites\", {}),\n 'unknown',\n);\n\nexport type AcceptInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Accept an invitation: materialize your membership at the invited role and\n * clear the invite. An invitation the caller doesn't hold rejects with\n * `forbidden` (indistinguishable from a nonexistent space; no existence\n * oracle).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:acceptInvite`.\n * @throws `Error & { code: AcceptInviteError }` on host refusal.\n */\nexport const acceptInvite = withTry<[string], void, AcceptInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:acceptInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeclineInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Decline (dismiss) an invitation from your inbox; writes no membership.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:declineInvite`.\n * @throws `Error & { code: DeclineInviteError }` on host refusal.\n */\nexport const declineInvite = withTry<[string], void, DeclineInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:declineInvite\", { spaceId }); },\n 'unknown',\n);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAAuB;AAEvB,MAAM,UAAU,CACd,IACA,aAEA,OAAO,OAAO,IAAI;AAAA,EAChB,KAAK,UAAU,SAAe;AAC5B,QAAI;AACF,aAAO,EAAE,IAAI,MAAe,OAAO,MAAM,GAAG,GAAG,IAAI,EAAE;AAAA,IACvD,SAAS,GAAG;AACV,aAAO,EAAE,IAAI,OAAgB,MAAO,EAAmB,QAAQ,SAAS;AAAA,IAC1E;AAAA,EACF;AACF,CAAC;AAsEI,MAAM,aAAa;AAAA,EACxB,CAAC,OAA0B,CAAC,UAC1B,uBAAoB,eAAe,IAAI;AAAA,EACzC;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,UACE,uBAAoB,kBAAkB,CAAC,CAAC;AAAA,EAC1C;AACF;AAWO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,gBACC,uBAAiB,kBAAkB,EAAE,QAAQ,CAAC;AAAA,EAChD;AACF;AAeO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,SAAiB,OAAe,SAA8B;AAAE,cAAM,uBAAa,iBAAiB,EAAE,SAAS,OAAO,KAAK,CAAC;AAAA,EAAG;AAAA,EACtI;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,cAAM,uBAAa,kBAAkB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACjH;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,KAAa,SAA8B;AAAE,cAAM,uBAAa,kBAAkB,EAAE,SAAS,KAAK,KAAK,CAAC;AAAA,EAAG;AAAA,EACnI;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,CAAC,cACC,uBAAqB,qBAAqB,EAAE,MAAM,CAAC;AAAA,EACrD;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,UACE,uBAAsB,iBAAiB,CAAC,CAAC;AAAA,EAC3C;AACF;AAYO,MAAM,cAAc;AAAA,EACzB,OAAO,QAAgB,YAAmC;AAAE,cAAM,uBAAa,sBAAsB,EAAE,QAAQ,QAAQ,CAAC;AAAA,EAAG;AAAA,EAC3H;AACF;AAWO,MAAM,qBAAqB;AAAA,EAChC,CAAC,gBACC,uBAAiB,yBAAyB,EAAE,QAAQ,CAAC;AAAA,EACvD;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,cAAM,uBAAa,uBAAuB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,UACE,uBAAiB,sBAAsB,CAAC,CAAC;AAAA,EAC3C;AACF;AAcO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,cAAM,uBAAa,uBAAuB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACpG;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,YAAmC;AAAE,cAAM,uBAAa,wBAAwB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACrG;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/generated/spaces.ts"],"sourcesContent":["// GENERATED by scripts/codegen-prototype/generate.mjs — DO NOT EDIT.\n// Source of truth: descriptors.spaces.mjs\n// Family: spaces — Space management (the space-manager app) — UI_AS_APPS_SPEC §5.\n\nimport { invoke } from '../catalog';\n\nconst withTry = <Args extends unknown[], R, E extends string>(\n fn: (...args: Args) => Promise<R>,\n fallback: E,\n): ((...args: Args) => Promise<R>) & { try: (...args: Args) => Promise<{ ok: true; value: R } | { ok: false; code: E }> } =>\n Object.assign(fn, {\n try: async (...args: Args) => {\n try {\n return { ok: true as const, value: await fn(...args) };\n } catch (e) {\n return { ok: false as const, code: (e as { code?: E }).code ?? fallback };\n }\n },\n });\n\n/** A collaborator's role on a shared space: full `owner`, read-write `writer`, or read-only `reader`. */\nexport type Role =\n | 'owner'\n | 'writer'\n | 'reader';\n\n/** Summary of a space, as returned by {@link listSpaces}. */\nexport interface SpaceInfo {\n spaceId: string;\n role?: Role;\n owner?: string;\n name?: string;\n}\n\n/** A member of a space (for the share/manage UI). */\nexport interface Member {\n /** The **grantee** — `user:{uid}` | `group:{gid}`. This is the canonical name (core_concepts §4: \"principal\" is reserved for the authority context; a space member is a *grantee*). The host populates this on every member row. */\n grantee: string;\n /** @deprecated Use {@link Member.grantee}. Kept as an alias (same value) for back-compat during the `principal`→`grantee` migration; will be removed in a future major. The host still populates both. */\n principal: string;\n role: Role;\n login?: string;\n avatarUrl?: string;\n}\n\n/** A handle resolved to a principal (handle → who). */\nexport interface ResolvedUser {\n uid: string;\n login: string;\n avatarUrl?: string;\n}\n\n/** One durable grant an app holds, for the §8.11 capability audit view. */\nexport interface GrantRecord {\n /** The app's provider-qualified **program** identity (AA-01 `appKey`). The DEFAULT program keys to the bare `provider__namespace__repository`; a NAMED mini-app appends a fourth `enc()`-escaped component (`provider__namespace__repository__name`) so its grants isolate from the repo's other programs. Host-supplied — the app never builds this key. */\n appKey: string;\n spaceId: string;\n /** Universal mount id (§3.5). */\n mountId: string;\n subtree?: string;\n mode: 'ro' | 'rw';\n name?: string;\n}\n\n/** A pending invitation to a space (pull-based sharing, FILE_SHARING_SPEC §6.4). It grants NO access until accepted — the recipient accepts it from their inbox ({@link listMyInvites} → {@link acceptInvite}), materializing membership. The display fields (`name`/`login`/`avatarUrl`) are untrusted for rendering. */\nexport interface Invite {\n spaceId: string;\n /** The invitee's uid — carried so the owner's pending list can {@link revokeInvite}(spaceId, uid). */\n uid: string;\n role: Role;\n owner: string;\n name?: string;\n invitedBy: string;\n /** epoch ms (server-stamped); absent until the write settles. */\n invitedAt?: number;\n login?: string;\n avatarUrl?: string;\n}\n\nexport type ListSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * List spaces you can access — all of them, or just those bound to this app.\n *\n * Capability: `spaces:app`. Catalog name: `spaces:list`.\n * @throws `Error & { code: ListSpacesError }` on host refusal.\n */\nexport const listSpaces = withTry<[opts?: { app?: boolean }], SpaceInfo[], ListSpacesError>(\n (opts: { app?: boolean } = {}): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:list\", opts),\n 'unknown',\n);\n\nexport type ListAllSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate ALL the user's spaces (not just this app's).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listAll`.\n * @throws `Error & { code: ListAllSpacesError }` on host refusal.\n */\nexport const listAllSpaces = withTry<[], SpaceInfo[], ListAllSpacesError>(\n (): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:listAll\", {}),\n 'unknown',\n);\n\nexport type GetSpaceMembersError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Read a space's members one-shot.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:members`.\n * @throws `Error & { code: GetSpaceMembersError }` on host refusal.\n */\nexport const getSpaceMembers = withTry<[string], Member[], GetSpaceMembersError>(\n (spaceId: string): Promise<Member[]> =>\n invoke<Member[]>(\"spaces:members\", { spaceId }),\n 'unknown',\n);\n\nexport type InviteToSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'quota-exceeded';\n\n/**\n * Invite a user (by provider handle) to a space at a role. The host resolves\n * the handle, so the app never sees other users' uids except the one it\n * invited. Pull-based (FILE_SHARING_SPEC §6.4): this writes an INVITATION,\n * not membership — the recipient must {@link acceptInvite}. Re-inviting an\n * already-invited/member user is idempotent.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:invite`.\n * @throws `Error & { code: InviteToSpaceError }` on host refusal.\n */\nexport const inviteToSpace = withTry<[string, string, Role], void, InviteToSpaceError>(\n async (spaceId: string, login: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:invite\", { spaceId, login, role }); },\n 'unknown',\n);\n\nexport type UnshareSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Remove a member from a space. Refused if it would orphan the space\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:unshare`.\n * @throws `Error & { code: UnshareSpaceError }` on host refusal.\n */\nexport const unshareSpace = withTry<[string, string], void, UnshareSpaceError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:unshare\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type SetSpaceRoleError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Change a member's role. Refused if it would drop the sole owner\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:setRole`.\n * @throws `Error & { code: SetSpaceRoleError }` on host refusal.\n */\nexport const setSpaceRole = withTry<[string, string, Role], void, SetSpaceRoleError>(\n async (spaceId: string, uid: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:setRole\", { spaceId, uid, role }); },\n 'unknown',\n);\n\nexport type LookupUserError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Resolve a provider handle to a principal (for the invite flow).\n * Rate-limited host-side.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:lookupUser`.\n * @throws `Error & { code: LookupUserError }` on host refusal.\n */\nexport const lookupUser = withTry<[string], ResolvedUser, LookupUserError>(\n (login: string): Promise<ResolvedUser> =>\n invoke<ResolvedUser>(\"spaces:lookupUser\", { login }),\n 'unknown',\n);\n\nexport type ListGrantsError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate every (app, mount) grant the user holds — the audit view\n * (§8.11). Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:grants`.\n * @throws `Error & { code: ListGrantsError }` on host refusal.\n */\nexport const listGrants = withTry<[], GrantRecord[], ListGrantsError>(\n (): Promise<GrantRecord[]> =>\n invoke<GrantRecord[]>(\"spaces:grants\", {}),\n 'unknown',\n);\n\nexport type RevokeGrantError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Revoke one app's grant on a space — durable (the app can't re-mount) plus\n * a best-effort live teardown. Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeGrant`.\n * @throws `Error & { code: RevokeGrantError }` on host refusal.\n */\nexport const revokeGrant = withTry<[string, string], void, RevokeGrantError>(\n async (appKey: string, spaceId: string): Promise<void> => { await invoke<void>(\"spaces:revokeGrant\", { appKey, spaceId }); },\n 'unknown',\n);\n\nexport type ListPendingInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The owner's outstanding invitations for a space.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:pendingInvites`.\n * @throws `Error & { code: ListPendingInvitesError }` on host refusal.\n */\nexport const listPendingInvites = withTry<[string], Invite[], ListPendingInvitesError>(\n (spaceId: string): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:pendingInvites\", { spaceId }),\n 'unknown',\n);\n\nexport type RevokeInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Withdraw a pending invitation (distinct from {@link unshareSpace}, which\n * removes an ACCEPTED member).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeInvite`.\n * @throws `Error & { code: RevokeInviteError }` on host refusal.\n */\nexport const revokeInvite = withTry<[string, string], void, RevokeInviteError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:revokeInvite\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type ListMyInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The caller's OWN invitation inbox.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listInvites`.\n * @throws `Error & { code: ListMyInvitesError }` on host refusal.\n */\nexport const listMyInvites = withTry<[], Invite[], ListMyInvitesError>(\n (): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:listInvites\", {}),\n 'unknown',\n);\n\nexport type AcceptInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Accept an invitation: materialize your membership at the invited role and\n * clear the invite. An invitation the caller doesn't hold rejects with\n * `forbidden` (indistinguishable from a nonexistent space; no existence\n * oracle).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:acceptInvite`.\n * @throws `Error & { code: AcceptInviteError }` on host refusal.\n */\nexport const acceptInvite = withTry<[string], void, AcceptInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:acceptInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeclineInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Decline (dismiss) an invitation from your inbox; writes no membership.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:declineInvite`.\n * @throws `Error & { code: DeclineInviteError }` on host refusal.\n */\nexport const declineInvite = withTry<[string], void, DeclineInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:declineInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeleteSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Soft-delete a space you own (FILE_SHARING_SPEC §6.2): sets the tombstone,\n * so every member’s live mount falls within one snapshot and the space lists\n * nowhere. Membership is retained — undo it with {@link restoreSpace} from\n * the surface that just deleted (there is no \"recently deleted\" list). Not a\n * hard delete: the space’s content is not destroyed by this call.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:delete`.\n * @throws `Error & { code: DeleteSpaceError }` on host refusal.\n */\nexport const deleteSpace = withTry<[string], void, DeleteSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:delete\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type RestoreSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Undo a {@link deleteSpace}: clears the §6.2 tombstone, and every retained\n * member’s access returns with no re-share fan-out. Reachable only while you\n * still hold the space id — the deleting surface does.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:restore`.\n * @throws `Error & { code: RestoreSpaceError }` on host refusal.\n */\nexport const restoreSpace = withTry<[string], void, RestoreSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:restore\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type LeaveSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'owner-lockout';\n\n/**\n * Remove YOURSELF from a space (FILE_SHARING_SPEC §9.7): your membership and\n * flattened access go in one batch, and live mounts fall through the same\n * watch as an unshare. The anchor owner cannot leave — they {@link\n * deleteSpace} instead — and a leave that would drop the last owner is\n * refused; both surface as `owner-lockout`.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:leave`.\n * @throws `Error & { code: LeaveSpaceError }` on host refusal.\n */\nexport const leaveSpace = withTry<[string], void, LeaveSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:leave\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type RenameSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'invalid-params';\n\n/**\n * Rename a space you own (FILE_SHARING_SPEC §9.7). The name is trimmed\n * host-side and bounded (non-empty, at most the platform\n * MAX_SPACE_NAME_LENGTH); an over-long or empty name fails validation with\n * `invalid-params` before any write.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:rename`.\n * @throws `Error & { code: RenameSpaceError }` on host refusal.\n */\nexport const renameSpace = withTry<[string, string], void, RenameSpaceError>(\n async (spaceId: string, name: string): Promise<void> => { await invoke<void>(\"spaces:rename\", { spaceId, name }); },\n 'unknown',\n);\n\nexport type ConvertSpaceToSharedError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Convert a personal space to shared (R3-259) — the deliberate, ONE-WAY\n * conversion. Only the owner may call it; the irreversibility disclosure is\n * host-drawn chrome. Converting an already-shared space is a no-op.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:convertToShared`.\n * @throws `Error & { code: ConvertSpaceToSharedError }` on host refusal.\n */\nexport const convertSpaceToShared = withTry<[string], void, ConvertSpaceToSharedError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:convertToShared\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAAuB;AAEvB,MAAM,UAAU,CACd,IACA,aAEA,OAAO,OAAO,IAAI;AAAA,EAChB,KAAK,UAAU,SAAe;AAC5B,QAAI;AACF,aAAO,EAAE,IAAI,MAAe,OAAO,MAAM,GAAG,GAAG,IAAI,EAAE;AAAA,IACvD,SAAS,GAAG;AACV,aAAO,EAAE,IAAI,OAAgB,MAAO,EAAmB,QAAQ,SAAS;AAAA,IAC1E;AAAA,EACF;AACF,CAAC;AAsEI,MAAM,aAAa;AAAA,EACxB,CAAC,OAA0B,CAAC,UAC1B,uBAAoB,eAAe,IAAI;AAAA,EACzC;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,UACE,uBAAoB,kBAAkB,CAAC,CAAC;AAAA,EAC1C;AACF;AAWO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,gBACC,uBAAiB,kBAAkB,EAAE,QAAQ,CAAC;AAAA,EAChD;AACF;AAeO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,SAAiB,OAAe,SAA8B;AAAE,cAAM,uBAAa,iBAAiB,EAAE,SAAS,OAAO,KAAK,CAAC;AAAA,EAAG;AAAA,EACtI;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,cAAM,uBAAa,kBAAkB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACjH;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,KAAa,SAA8B;AAAE,cAAM,uBAAa,kBAAkB,EAAE,SAAS,KAAK,KAAK,CAAC;AAAA,EAAG;AAAA,EACnI;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,CAAC,cACC,uBAAqB,qBAAqB,EAAE,MAAM,CAAC;AAAA,EACrD;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,UACE,uBAAsB,iBAAiB,CAAC,CAAC;AAAA,EAC3C;AACF;AAYO,MAAM,cAAc;AAAA,EACzB,OAAO,QAAgB,YAAmC;AAAE,cAAM,uBAAa,sBAAsB,EAAE,QAAQ,QAAQ,CAAC;AAAA,EAAG;AAAA,EAC3H;AACF;AAWO,MAAM,qBAAqB;AAAA,EAChC,CAAC,gBACC,uBAAiB,yBAAyB,EAAE,QAAQ,CAAC;AAAA,EACvD;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,cAAM,uBAAa,uBAAuB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,UACE,uBAAiB,sBAAsB,CAAC,CAAC;AAAA,EAC3C;AACF;AAcO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,cAAM,uBAAa,uBAAuB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACpG;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,YAAmC;AAAE,cAAM,uBAAa,wBAAwB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACrG;AACF;AAeO,MAAM,cAAc;AAAA,EACzB,OAAO,YAAmC;AAAE,cAAM,uBAAa,iBAAiB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC7G;AACF;AAaO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,cAAM,uBAAa,kBAAkB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC9G;AACF;AAeO,MAAM,aAAa;AAAA,EACxB,OAAO,YAAmC;AAAE,cAAM,uBAAa,gBAAgB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC5G;AACF;AAcO,MAAM,cAAc;AAAA,EACzB,OAAO,SAAiB,SAAgC;AAAE,cAAM,uBAAa,iBAAiB,EAAE,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAClH;AACF;AAaO,MAAM,uBAAuB;AAAA,EAClC,OAAO,YAAmC;AAAE,cAAM,uBAAa,0BAA0B,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;","names":[]}
@@ -289,5 +289,100 @@ declare const declineInvite: ((args_0: string) => Promise<void>) & {
289
289
  code: DeclineInviteError;
290
290
  }>;
291
291
  };
292
+ type DeleteSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
293
+ /**
294
+ * Soft-delete a space you own (FILE_SHARING_SPEC §6.2): sets the tombstone,
295
+ * so every member’s live mount falls within one snapshot and the space lists
296
+ * nowhere. Membership is retained — undo it with {@link restoreSpace} from
297
+ * the surface that just deleted (there is no "recently deleted" list). Not a
298
+ * hard delete: the space’s content is not destroyed by this call.
299
+ *
300
+ * Capability: `spaces:admin`. Catalog name: `spaces:delete`.
301
+ * @throws `Error & { code: DeleteSpaceError }` on host refusal.
302
+ */
303
+ declare const deleteSpace: ((args_0: string) => Promise<void>) & {
304
+ try: (args_0: string) => Promise<{
305
+ ok: true;
306
+ value: void;
307
+ } | {
308
+ ok: false;
309
+ code: DeleteSpaceError;
310
+ }>;
311
+ };
312
+ type RestoreSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
313
+ /**
314
+ * Undo a {@link deleteSpace}: clears the §6.2 tombstone, and every retained
315
+ * member’s access returns with no re-share fan-out. Reachable only while you
316
+ * still hold the space id — the deleting surface does.
317
+ *
318
+ * Capability: `spaces:admin`. Catalog name: `spaces:restore`.
319
+ * @throws `Error & { code: RestoreSpaceError }` on host refusal.
320
+ */
321
+ declare const restoreSpace: ((args_0: string) => Promise<void>) & {
322
+ try: (args_0: string) => Promise<{
323
+ ok: true;
324
+ value: void;
325
+ } | {
326
+ ok: false;
327
+ code: RestoreSpaceError;
328
+ }>;
329
+ };
330
+ type LeaveSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'owner-lockout';
331
+ /**
332
+ * Remove YOURSELF from a space (FILE_SHARING_SPEC §9.7): your membership and
333
+ * flattened access go in one batch, and live mounts fall through the same
334
+ * watch as an unshare. The anchor owner cannot leave — they {@link
335
+ * deleteSpace} instead — and a leave that would drop the last owner is
336
+ * refused; both surface as `owner-lockout`.
337
+ *
338
+ * Capability: `spaces:user`. Catalog name: `spaces:leave`.
339
+ * @throws `Error & { code: LeaveSpaceError }` on host refusal.
340
+ */
341
+ declare const leaveSpace: ((args_0: string) => Promise<void>) & {
342
+ try: (args_0: string) => Promise<{
343
+ ok: true;
344
+ value: void;
345
+ } | {
346
+ ok: false;
347
+ code: LeaveSpaceError;
348
+ }>;
349
+ };
350
+ type RenameSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'invalid-params';
351
+ /**
352
+ * Rename a space you own (FILE_SHARING_SPEC §9.7). The name is trimmed
353
+ * host-side and bounded (non-empty, at most the platform
354
+ * MAX_SPACE_NAME_LENGTH); an over-long or empty name fails validation with
355
+ * `invalid-params` before any write.
356
+ *
357
+ * Capability: `spaces:admin`. Catalog name: `spaces:rename`.
358
+ * @throws `Error & { code: RenameSpaceError }` on host refusal.
359
+ */
360
+ declare const renameSpace: ((args_0: string, args_1: string) => Promise<void>) & {
361
+ try: (args_0: string, args_1: string) => Promise<{
362
+ ok: true;
363
+ value: void;
364
+ } | {
365
+ ok: false;
366
+ code: RenameSpaceError;
367
+ }>;
368
+ };
369
+ type ConvertSpaceToSharedError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
370
+ /**
371
+ * Convert a personal space to shared (R3-259) — the deliberate, ONE-WAY
372
+ * conversion. Only the owner may call it; the irreversibility disclosure is
373
+ * host-drawn chrome. Converting an already-shared space is a no-op.
374
+ *
375
+ * Capability: `spaces:admin`. Catalog name: `spaces:convertToShared`.
376
+ * @throws `Error & { code: ConvertSpaceToSharedError }` on host refusal.
377
+ */
378
+ declare const convertSpaceToShared: ((args_0: string) => Promise<void>) & {
379
+ try: (args_0: string) => Promise<{
380
+ ok: true;
381
+ value: void;
382
+ } | {
383
+ ok: false;
384
+ code: ConvertSpaceToSharedError;
385
+ }>;
386
+ };
292
387
 
293
- export { type AcceptInviteError, type DeclineInviteError, type GetSpaceMembersError, type GrantRecord, type Invite, type InviteToSpaceError, type ListAllSpacesError, type ListGrantsError, type ListMyInvitesError, type ListPendingInvitesError, type ListSpacesError, type LookupUserError, type Member, type ResolvedUser, type RevokeGrantError, type RevokeInviteError, type Role, type SetSpaceRoleError, type SpaceInfo, type UnshareSpaceError, acceptInvite, declineInvite, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, revokeGrant, revokeInvite, setSpaceRole, unshareSpace };
388
+ export { type AcceptInviteError, type ConvertSpaceToSharedError, type DeclineInviteError, type DeleteSpaceError, type GetSpaceMembersError, type GrantRecord, type Invite, type InviteToSpaceError, type LeaveSpaceError, type ListAllSpacesError, type ListGrantsError, type ListMyInvitesError, type ListPendingInvitesError, type ListSpacesError, type LookupUserError, type Member, type RenameSpaceError, type ResolvedUser, type RestoreSpaceError, type RevokeGrantError, type RevokeInviteError, type Role, type SetSpaceRoleError, type SpaceInfo, type UnshareSpaceError, acceptInvite, convertSpaceToShared, declineInvite, deleteSpace, getSpaceMembers, inviteToSpace, leaveSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, renameSpace, restoreSpace, revokeGrant, revokeInvite, setSpaceRole, unshareSpace };
@@ -289,5 +289,100 @@ declare const declineInvite: ((args_0: string) => Promise<void>) & {
289
289
  code: DeclineInviteError;
290
290
  }>;
291
291
  };
292
+ type DeleteSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
293
+ /**
294
+ * Soft-delete a space you own (FILE_SHARING_SPEC §6.2): sets the tombstone,
295
+ * so every member’s live mount falls within one snapshot and the space lists
296
+ * nowhere. Membership is retained — undo it with {@link restoreSpace} from
297
+ * the surface that just deleted (there is no "recently deleted" list). Not a
298
+ * hard delete: the space’s content is not destroyed by this call.
299
+ *
300
+ * Capability: `spaces:admin`. Catalog name: `spaces:delete`.
301
+ * @throws `Error & { code: DeleteSpaceError }` on host refusal.
302
+ */
303
+ declare const deleteSpace: ((args_0: string) => Promise<void>) & {
304
+ try: (args_0: string) => Promise<{
305
+ ok: true;
306
+ value: void;
307
+ } | {
308
+ ok: false;
309
+ code: DeleteSpaceError;
310
+ }>;
311
+ };
312
+ type RestoreSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
313
+ /**
314
+ * Undo a {@link deleteSpace}: clears the §6.2 tombstone, and every retained
315
+ * member’s access returns with no re-share fan-out. Reachable only while you
316
+ * still hold the space id — the deleting surface does.
317
+ *
318
+ * Capability: `spaces:admin`. Catalog name: `spaces:restore`.
319
+ * @throws `Error & { code: RestoreSpaceError }` on host refusal.
320
+ */
321
+ declare const restoreSpace: ((args_0: string) => Promise<void>) & {
322
+ try: (args_0: string) => Promise<{
323
+ ok: true;
324
+ value: void;
325
+ } | {
326
+ ok: false;
327
+ code: RestoreSpaceError;
328
+ }>;
329
+ };
330
+ type LeaveSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'owner-lockout';
331
+ /**
332
+ * Remove YOURSELF from a space (FILE_SHARING_SPEC §9.7): your membership and
333
+ * flattened access go in one batch, and live mounts fall through the same
334
+ * watch as an unshare. The anchor owner cannot leave — they {@link
335
+ * deleteSpace} instead — and a leave that would drop the last owner is
336
+ * refused; both surface as `owner-lockout`.
337
+ *
338
+ * Capability: `spaces:user`. Catalog name: `spaces:leave`.
339
+ * @throws `Error & { code: LeaveSpaceError }` on host refusal.
340
+ */
341
+ declare const leaveSpace: ((args_0: string) => Promise<void>) & {
342
+ try: (args_0: string) => Promise<{
343
+ ok: true;
344
+ value: void;
345
+ } | {
346
+ ok: false;
347
+ code: LeaveSpaceError;
348
+ }>;
349
+ };
350
+ type RenameSpaceError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'invalid-params';
351
+ /**
352
+ * Rename a space you own (FILE_SHARING_SPEC §9.7). The name is trimmed
353
+ * host-side and bounded (non-empty, at most the platform
354
+ * MAX_SPACE_NAME_LENGTH); an over-long or empty name fails validation with
355
+ * `invalid-params` before any write.
356
+ *
357
+ * Capability: `spaces:admin`. Catalog name: `spaces:rename`.
358
+ * @throws `Error & { code: RenameSpaceError }` on host refusal.
359
+ */
360
+ declare const renameSpace: ((args_0: string, args_1: string) => Promise<void>) & {
361
+ try: (args_0: string, args_1: string) => Promise<{
362
+ ok: true;
363
+ value: void;
364
+ } | {
365
+ ok: false;
366
+ code: RenameSpaceError;
367
+ }>;
368
+ };
369
+ type ConvertSpaceToSharedError = 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';
370
+ /**
371
+ * Convert a personal space to shared (R3-259) — the deliberate, ONE-WAY
372
+ * conversion. Only the owner may call it; the irreversibility disclosure is
373
+ * host-drawn chrome. Converting an already-shared space is a no-op.
374
+ *
375
+ * Capability: `spaces:admin`. Catalog name: `spaces:convertToShared`.
376
+ * @throws `Error & { code: ConvertSpaceToSharedError }` on host refusal.
377
+ */
378
+ declare const convertSpaceToShared: ((args_0: string) => Promise<void>) & {
379
+ try: (args_0: string) => Promise<{
380
+ ok: true;
381
+ value: void;
382
+ } | {
383
+ ok: false;
384
+ code: ConvertSpaceToSharedError;
385
+ }>;
386
+ };
292
387
 
293
- export { type AcceptInviteError, type DeclineInviteError, type GetSpaceMembersError, type GrantRecord, type Invite, type InviteToSpaceError, type ListAllSpacesError, type ListGrantsError, type ListMyInvitesError, type ListPendingInvitesError, type ListSpacesError, type LookupUserError, type Member, type ResolvedUser, type RevokeGrantError, type RevokeInviteError, type Role, type SetSpaceRoleError, type SpaceInfo, type UnshareSpaceError, acceptInvite, declineInvite, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, revokeGrant, revokeInvite, setSpaceRole, unshareSpace };
388
+ export { type AcceptInviteError, type ConvertSpaceToSharedError, type DeclineInviteError, type DeleteSpaceError, type GetSpaceMembersError, type GrantRecord, type Invite, type InviteToSpaceError, type LeaveSpaceError, type ListAllSpacesError, type ListGrantsError, type ListMyInvitesError, type ListPendingInvitesError, type ListSpacesError, type LookupUserError, type Member, type RenameSpaceError, type ResolvedUser, type RestoreSpaceError, type RevokeGrantError, type RevokeInviteError, type Role, type SetSpaceRoleError, type SpaceInfo, type UnshareSpaceError, acceptInvite, convertSpaceToShared, declineInvite, deleteSpace, getSpaceMembers, inviteToSpace, leaveSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, renameSpace, restoreSpace, revokeGrant, revokeInvite, setSpaceRole, unshareSpace };
@@ -79,17 +79,52 @@ const declineInvite = withTry(
79
79
  },
80
80
  "unknown"
81
81
  );
82
+ const deleteSpace = withTry(
83
+ async (spaceId) => {
84
+ await invoke("spaces:delete", { spaceId, confirm: true });
85
+ },
86
+ "unknown"
87
+ );
88
+ const restoreSpace = withTry(
89
+ async (spaceId) => {
90
+ await invoke("spaces:restore", { spaceId, confirm: true });
91
+ },
92
+ "unknown"
93
+ );
94
+ const leaveSpace = withTry(
95
+ async (spaceId) => {
96
+ await invoke("spaces:leave", { spaceId, confirm: true });
97
+ },
98
+ "unknown"
99
+ );
100
+ const renameSpace = withTry(
101
+ async (spaceId, name) => {
102
+ await invoke("spaces:rename", { spaceId, name });
103
+ },
104
+ "unknown"
105
+ );
106
+ const convertSpaceToShared = withTry(
107
+ async (spaceId) => {
108
+ await invoke("spaces:convertToShared", { spaceId, confirm: true });
109
+ },
110
+ "unknown"
111
+ );
82
112
  export {
83
113
  acceptInvite,
114
+ convertSpaceToShared,
84
115
  declineInvite,
116
+ deleteSpace,
85
117
  getSpaceMembers,
86
118
  inviteToSpace,
119
+ leaveSpace,
87
120
  listAllSpaces,
88
121
  listGrants,
89
122
  listMyInvites,
90
123
  listPendingInvites,
91
124
  listSpaces,
92
125
  lookupUser,
126
+ renameSpace,
127
+ restoreSpace,
93
128
  revokeGrant,
94
129
  revokeInvite,
95
130
  setSpaceRole,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generated/spaces.ts"],"sourcesContent":["// GENERATED by scripts/codegen-prototype/generate.mjs — DO NOT EDIT.\n// Source of truth: descriptors.spaces.mjs\n// Family: spaces — Space management (the space-manager app) — UI_AS_APPS_SPEC §5.\n\nimport { invoke } from '../catalog';\n\nconst withTry = <Args extends unknown[], R, E extends string>(\n fn: (...args: Args) => Promise<R>,\n fallback: E,\n): ((...args: Args) => Promise<R>) & { try: (...args: Args) => Promise<{ ok: true; value: R } | { ok: false; code: E }> } =>\n Object.assign(fn, {\n try: async (...args: Args) => {\n try {\n return { ok: true as const, value: await fn(...args) };\n } catch (e) {\n return { ok: false as const, code: (e as { code?: E }).code ?? fallback };\n }\n },\n });\n\n/** A collaborator's role on a shared space: full `owner`, read-write `writer`, or read-only `reader`. */\nexport type Role =\n | 'owner'\n | 'writer'\n | 'reader';\n\n/** Summary of a space, as returned by {@link listSpaces}. */\nexport interface SpaceInfo {\n spaceId: string;\n role?: Role;\n owner?: string;\n name?: string;\n}\n\n/** A member of a space (for the share/manage UI). */\nexport interface Member {\n /** The **grantee** — `user:{uid}` | `group:{gid}`. This is the canonical name (core_concepts §4: \"principal\" is reserved for the authority context; a space member is a *grantee*). The host populates this on every member row. */\n grantee: string;\n /** @deprecated Use {@link Member.grantee}. Kept as an alias (same value) for back-compat during the `principal`→`grantee` migration; will be removed in a future major. The host still populates both. */\n principal: string;\n role: Role;\n login?: string;\n avatarUrl?: string;\n}\n\n/** A handle resolved to a principal (handle → who). */\nexport interface ResolvedUser {\n uid: string;\n login: string;\n avatarUrl?: string;\n}\n\n/** One durable grant an app holds, for the §8.11 capability audit view. */\nexport interface GrantRecord {\n /** The app's provider-qualified **program** identity (AA-01 `appKey`). The DEFAULT program keys to the bare `provider__namespace__repository`; a NAMED mini-app appends a fourth `enc()`-escaped component (`provider__namespace__repository__name`) so its grants isolate from the repo's other programs. Host-supplied — the app never builds this key. */\n appKey: string;\n spaceId: string;\n /** Universal mount id (§3.5). */\n mountId: string;\n subtree?: string;\n mode: 'ro' | 'rw';\n name?: string;\n}\n\n/** A pending invitation to a space (pull-based sharing, FILE_SHARING_SPEC §6.4). It grants NO access until accepted — the recipient accepts it from their inbox ({@link listMyInvites} → {@link acceptInvite}), materializing membership. The display fields (`name`/`login`/`avatarUrl`) are untrusted for rendering. */\nexport interface Invite {\n spaceId: string;\n /** The invitee's uid — carried so the owner's pending list can {@link revokeInvite}(spaceId, uid). */\n uid: string;\n role: Role;\n owner: string;\n name?: string;\n invitedBy: string;\n /** epoch ms (server-stamped); absent until the write settles. */\n invitedAt?: number;\n login?: string;\n avatarUrl?: string;\n}\n\nexport type ListSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * List spaces you can access — all of them, or just those bound to this app.\n *\n * Capability: `spaces:app`. Catalog name: `spaces:list`.\n * @throws `Error & { code: ListSpacesError }` on host refusal.\n */\nexport const listSpaces = withTry<[opts?: { app?: boolean }], SpaceInfo[], ListSpacesError>(\n (opts: { app?: boolean } = {}): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:list\", opts),\n 'unknown',\n);\n\nexport type ListAllSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate ALL the user's spaces (not just this app's).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listAll`.\n * @throws `Error & { code: ListAllSpacesError }` on host refusal.\n */\nexport const listAllSpaces = withTry<[], SpaceInfo[], ListAllSpacesError>(\n (): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:listAll\", {}),\n 'unknown',\n);\n\nexport type GetSpaceMembersError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Read a space's members one-shot.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:members`.\n * @throws `Error & { code: GetSpaceMembersError }` on host refusal.\n */\nexport const getSpaceMembers = withTry<[string], Member[], GetSpaceMembersError>(\n (spaceId: string): Promise<Member[]> =>\n invoke<Member[]>(\"spaces:members\", { spaceId }),\n 'unknown',\n);\n\nexport type InviteToSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'quota-exceeded';\n\n/**\n * Invite a user (by provider handle) to a space at a role. The host resolves\n * the handle, so the app never sees other users' uids except the one it\n * invited. Pull-based (FILE_SHARING_SPEC §6.4): this writes an INVITATION,\n * not membership — the recipient must {@link acceptInvite}. Re-inviting an\n * already-invited/member user is idempotent.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:invite`.\n * @throws `Error & { code: InviteToSpaceError }` on host refusal.\n */\nexport const inviteToSpace = withTry<[string, string, Role], void, InviteToSpaceError>(\n async (spaceId: string, login: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:invite\", { spaceId, login, role }); },\n 'unknown',\n);\n\nexport type UnshareSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Remove a member from a space. Refused if it would orphan the space\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:unshare`.\n * @throws `Error & { code: UnshareSpaceError }` on host refusal.\n */\nexport const unshareSpace = withTry<[string, string], void, UnshareSpaceError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:unshare\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type SetSpaceRoleError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Change a member's role. Refused if it would drop the sole owner\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:setRole`.\n * @throws `Error & { code: SetSpaceRoleError }` on host refusal.\n */\nexport const setSpaceRole = withTry<[string, string, Role], void, SetSpaceRoleError>(\n async (spaceId: string, uid: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:setRole\", { spaceId, uid, role }); },\n 'unknown',\n);\n\nexport type LookupUserError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Resolve a provider handle to a principal (for the invite flow).\n * Rate-limited host-side.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:lookupUser`.\n * @throws `Error & { code: LookupUserError }` on host refusal.\n */\nexport const lookupUser = withTry<[string], ResolvedUser, LookupUserError>(\n (login: string): Promise<ResolvedUser> =>\n invoke<ResolvedUser>(\"spaces:lookupUser\", { login }),\n 'unknown',\n);\n\nexport type ListGrantsError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate every (app, mount) grant the user holds — the audit view\n * (§8.11). Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:grants`.\n * @throws `Error & { code: ListGrantsError }` on host refusal.\n */\nexport const listGrants = withTry<[], GrantRecord[], ListGrantsError>(\n (): Promise<GrantRecord[]> =>\n invoke<GrantRecord[]>(\"spaces:grants\", {}),\n 'unknown',\n);\n\nexport type RevokeGrantError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Revoke one app's grant on a space — durable (the app can't re-mount) plus\n * a best-effort live teardown. Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeGrant`.\n * @throws `Error & { code: RevokeGrantError }` on host refusal.\n */\nexport const revokeGrant = withTry<[string, string], void, RevokeGrantError>(\n async (appKey: string, spaceId: string): Promise<void> => { await invoke<void>(\"spaces:revokeGrant\", { appKey, spaceId }); },\n 'unknown',\n);\n\nexport type ListPendingInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The owner's outstanding invitations for a space.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:pendingInvites`.\n * @throws `Error & { code: ListPendingInvitesError }` on host refusal.\n */\nexport const listPendingInvites = withTry<[string], Invite[], ListPendingInvitesError>(\n (spaceId: string): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:pendingInvites\", { spaceId }),\n 'unknown',\n);\n\nexport type RevokeInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Withdraw a pending invitation (distinct from {@link unshareSpace}, which\n * removes an ACCEPTED member).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeInvite`.\n * @throws `Error & { code: RevokeInviteError }` on host refusal.\n */\nexport const revokeInvite = withTry<[string, string], void, RevokeInviteError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:revokeInvite\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type ListMyInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The caller's OWN invitation inbox.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listInvites`.\n * @throws `Error & { code: ListMyInvitesError }` on host refusal.\n */\nexport const listMyInvites = withTry<[], Invite[], ListMyInvitesError>(\n (): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:listInvites\", {}),\n 'unknown',\n);\n\nexport type AcceptInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Accept an invitation: materialize your membership at the invited role and\n * clear the invite. An invitation the caller doesn't hold rejects with\n * `forbidden` (indistinguishable from a nonexistent space; no existence\n * oracle).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:acceptInvite`.\n * @throws `Error & { code: AcceptInviteError }` on host refusal.\n */\nexport const acceptInvite = withTry<[string], void, AcceptInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:acceptInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeclineInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Decline (dismiss) an invitation from your inbox; writes no membership.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:declineInvite`.\n * @throws `Error & { code: DeclineInviteError }` on host refusal.\n */\nexport const declineInvite = withTry<[string], void, DeclineInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:declineInvite\", { spaceId }); },\n 'unknown',\n);\n\n"],"mappings":";AAIA,SAAS,cAAc;AAEvB,MAAM,UAAU,CACd,IACA,aAEA,OAAO,OAAO,IAAI;AAAA,EAChB,KAAK,UAAU,SAAe;AAC5B,QAAI;AACF,aAAO,EAAE,IAAI,MAAe,OAAO,MAAM,GAAG,GAAG,IAAI,EAAE;AAAA,IACvD,SAAS,GAAG;AACV,aAAO,EAAE,IAAI,OAAgB,MAAO,EAAmB,QAAQ,SAAS;AAAA,IAC1E;AAAA,EACF;AACF,CAAC;AAsEI,MAAM,aAAa;AAAA,EACxB,CAAC,OAA0B,CAAC,MAC1B,OAAoB,eAAe,IAAI;AAAA,EACzC;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,MACE,OAAoB,kBAAkB,CAAC,CAAC;AAAA,EAC1C;AACF;AAWO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,YACC,OAAiB,kBAAkB,EAAE,QAAQ,CAAC;AAAA,EAChD;AACF;AAeO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,SAAiB,OAAe,SAA8B;AAAE,UAAM,OAAa,iBAAiB,EAAE,SAAS,OAAO,KAAK,CAAC;AAAA,EAAG;AAAA,EACtI;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,UAAM,OAAa,kBAAkB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACjH;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,KAAa,SAA8B;AAAE,UAAM,OAAa,kBAAkB,EAAE,SAAS,KAAK,KAAK,CAAC;AAAA,EAAG;AAAA,EACnI;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,CAAC,UACC,OAAqB,qBAAqB,EAAE,MAAM,CAAC;AAAA,EACrD;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,MACE,OAAsB,iBAAiB,CAAC,CAAC;AAAA,EAC3C;AACF;AAYO,MAAM,cAAc;AAAA,EACzB,OAAO,QAAgB,YAAmC;AAAE,UAAM,OAAa,sBAAsB,EAAE,QAAQ,QAAQ,CAAC;AAAA,EAAG;AAAA,EAC3H;AACF;AAWO,MAAM,qBAAqB;AAAA,EAChC,CAAC,YACC,OAAiB,yBAAyB,EAAE,QAAQ,CAAC;AAAA,EACvD;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,UAAM,OAAa,uBAAuB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,MACE,OAAiB,sBAAsB,CAAC,CAAC;AAAA,EAC3C;AACF;AAcO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,UAAM,OAAa,uBAAuB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACpG;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,YAAmC;AAAE,UAAM,OAAa,wBAAwB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACrG;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/generated/spaces.ts"],"sourcesContent":["// GENERATED by scripts/codegen-prototype/generate.mjs — DO NOT EDIT.\n// Source of truth: descriptors.spaces.mjs\n// Family: spaces — Space management (the space-manager app) — UI_AS_APPS_SPEC §5.\n\nimport { invoke } from '../catalog';\n\nconst withTry = <Args extends unknown[], R, E extends string>(\n fn: (...args: Args) => Promise<R>,\n fallback: E,\n): ((...args: Args) => Promise<R>) & { try: (...args: Args) => Promise<{ ok: true; value: R } | { ok: false; code: E }> } =>\n Object.assign(fn, {\n try: async (...args: Args) => {\n try {\n return { ok: true as const, value: await fn(...args) };\n } catch (e) {\n return { ok: false as const, code: (e as { code?: E }).code ?? fallback };\n }\n },\n });\n\n/** A collaborator's role on a shared space: full `owner`, read-write `writer`, or read-only `reader`. */\nexport type Role =\n | 'owner'\n | 'writer'\n | 'reader';\n\n/** Summary of a space, as returned by {@link listSpaces}. */\nexport interface SpaceInfo {\n spaceId: string;\n role?: Role;\n owner?: string;\n name?: string;\n}\n\n/** A member of a space (for the share/manage UI). */\nexport interface Member {\n /** The **grantee** — `user:{uid}` | `group:{gid}`. This is the canonical name (core_concepts §4: \"principal\" is reserved for the authority context; a space member is a *grantee*). The host populates this on every member row. */\n grantee: string;\n /** @deprecated Use {@link Member.grantee}. Kept as an alias (same value) for back-compat during the `principal`→`grantee` migration; will be removed in a future major. The host still populates both. */\n principal: string;\n role: Role;\n login?: string;\n avatarUrl?: string;\n}\n\n/** A handle resolved to a principal (handle → who). */\nexport interface ResolvedUser {\n uid: string;\n login: string;\n avatarUrl?: string;\n}\n\n/** One durable grant an app holds, for the §8.11 capability audit view. */\nexport interface GrantRecord {\n /** The app's provider-qualified **program** identity (AA-01 `appKey`). The DEFAULT program keys to the bare `provider__namespace__repository`; a NAMED mini-app appends a fourth `enc()`-escaped component (`provider__namespace__repository__name`) so its grants isolate from the repo's other programs. Host-supplied — the app never builds this key. */\n appKey: string;\n spaceId: string;\n /** Universal mount id (§3.5). */\n mountId: string;\n subtree?: string;\n mode: 'ro' | 'rw';\n name?: string;\n}\n\n/** A pending invitation to a space (pull-based sharing, FILE_SHARING_SPEC §6.4). It grants NO access until accepted — the recipient accepts it from their inbox ({@link listMyInvites} → {@link acceptInvite}), materializing membership. The display fields (`name`/`login`/`avatarUrl`) are untrusted for rendering. */\nexport interface Invite {\n spaceId: string;\n /** The invitee's uid — carried so the owner's pending list can {@link revokeInvite}(spaceId, uid). */\n uid: string;\n role: Role;\n owner: string;\n name?: string;\n invitedBy: string;\n /** epoch ms (server-stamped); absent until the write settles. */\n invitedAt?: number;\n login?: string;\n avatarUrl?: string;\n}\n\nexport type ListSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * List spaces you can access — all of them, or just those bound to this app.\n *\n * Capability: `spaces:app`. Catalog name: `spaces:list`.\n * @throws `Error & { code: ListSpacesError }` on host refusal.\n */\nexport const listSpaces = withTry<[opts?: { app?: boolean }], SpaceInfo[], ListSpacesError>(\n (opts: { app?: boolean } = {}): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:list\", opts),\n 'unknown',\n);\n\nexport type ListAllSpacesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate ALL the user's spaces (not just this app's).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listAll`.\n * @throws `Error & { code: ListAllSpacesError }` on host refusal.\n */\nexport const listAllSpaces = withTry<[], SpaceInfo[], ListAllSpacesError>(\n (): Promise<SpaceInfo[]> =>\n invoke<SpaceInfo[]>(\"spaces:listAll\", {}),\n 'unknown',\n);\n\nexport type GetSpaceMembersError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Read a space's members one-shot.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:members`.\n * @throws `Error & { code: GetSpaceMembersError }` on host refusal.\n */\nexport const getSpaceMembers = withTry<[string], Member[], GetSpaceMembersError>(\n (spaceId: string): Promise<Member[]> =>\n invoke<Member[]>(\"spaces:members\", { spaceId }),\n 'unknown',\n);\n\nexport type InviteToSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'quota-exceeded';\n\n/**\n * Invite a user (by provider handle) to a space at a role. The host resolves\n * the handle, so the app never sees other users' uids except the one it\n * invited. Pull-based (FILE_SHARING_SPEC §6.4): this writes an INVITATION,\n * not membership — the recipient must {@link acceptInvite}. Re-inviting an\n * already-invited/member user is idempotent.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:invite`.\n * @throws `Error & { code: InviteToSpaceError }` on host refusal.\n */\nexport const inviteToSpace = withTry<[string, string, Role], void, InviteToSpaceError>(\n async (spaceId: string, login: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:invite\", { spaceId, login, role }); },\n 'unknown',\n);\n\nexport type UnshareSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Remove a member from a space. Refused if it would orphan the space\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:unshare`.\n * @throws `Error & { code: UnshareSpaceError }` on host refusal.\n */\nexport const unshareSpace = withTry<[string, string], void, UnshareSpaceError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:unshare\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type SetSpaceRoleError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'conflict';\n\n/**\n * Change a member's role. Refused if it would drop the sole owner\n * (owner-lockout, T41).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:setRole`.\n * @throws `Error & { code: SetSpaceRoleError }` on host refusal.\n */\nexport const setSpaceRole = withTry<[string, string, Role], void, SetSpaceRoleError>(\n async (spaceId: string, uid: string, role: Role): Promise<void> => { await invoke<void>(\"spaces:setRole\", { spaceId, uid, role }); },\n 'unknown',\n);\n\nexport type LookupUserError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Resolve a provider handle to a principal (for the invite flow).\n * Rate-limited host-side.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:lookupUser`.\n * @throws `Error & { code: LookupUserError }` on host refusal.\n */\nexport const lookupUser = withTry<[string], ResolvedUser, LookupUserError>(\n (login: string): Promise<ResolvedUser> =>\n invoke<ResolvedUser>(\"spaces:lookupUser\", { login }),\n 'unknown',\n);\n\nexport type ListGrantsError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Enumerate every (app, mount) grant the user holds — the audit view\n * (§8.11). Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:grants`.\n * @throws `Error & { code: ListGrantsError }` on host refusal.\n */\nexport const listGrants = withTry<[], GrantRecord[], ListGrantsError>(\n (): Promise<GrantRecord[]> =>\n invoke<GrantRecord[]>(\"spaces:grants\", {}),\n 'unknown',\n);\n\nexport type RevokeGrantError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Revoke one app's grant on a space — durable (the app can't re-mount) plus\n * a best-effort live teardown. Elevated.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeGrant`.\n * @throws `Error & { code: RevokeGrantError }` on host refusal.\n */\nexport const revokeGrant = withTry<[string, string], void, RevokeGrantError>(\n async (appKey: string, spaceId: string): Promise<void> => { await invoke<void>(\"spaces:revokeGrant\", { appKey, spaceId }); },\n 'unknown',\n);\n\nexport type ListPendingInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The owner's outstanding invitations for a space.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:pendingInvites`.\n * @throws `Error & { code: ListPendingInvitesError }` on host refusal.\n */\nexport const listPendingInvites = withTry<[string], Invite[], ListPendingInvitesError>(\n (spaceId: string): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:pendingInvites\", { spaceId }),\n 'unknown',\n);\n\nexport type RevokeInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Withdraw a pending invitation (distinct from {@link unshareSpace}, which\n * removes an ACCEPTED member).\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:revokeInvite`.\n * @throws `Error & { code: RevokeInviteError }` on host refusal.\n */\nexport const revokeInvite = withTry<[string, string], void, RevokeInviteError>(\n async (spaceId: string, uid: string): Promise<void> => { await invoke<void>(\"spaces:revokeInvite\", { spaceId, uid }); },\n 'unknown',\n);\n\nexport type ListMyInvitesError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * The caller's OWN invitation inbox.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:listInvites`.\n * @throws `Error & { code: ListMyInvitesError }` on host refusal.\n */\nexport const listMyInvites = withTry<[], Invite[], ListMyInvitesError>(\n (): Promise<Invite[]> =>\n invoke<Invite[]>(\"spaces:listInvites\", {}),\n 'unknown',\n);\n\nexport type AcceptInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Accept an invitation: materialize your membership at the invited role and\n * clear the invite. An invitation the caller doesn't hold rejects with\n * `forbidden` (indistinguishable from a nonexistent space; no existence\n * oracle).\n *\n * Capability: `spaces:user`. Catalog name: `spaces:acceptInvite`.\n * @throws `Error & { code: AcceptInviteError }` on host refusal.\n */\nexport const acceptInvite = withTry<[string], void, AcceptInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:acceptInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeclineInviteError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Decline (dismiss) an invitation from your inbox; writes no membership.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:declineInvite`.\n * @throws `Error & { code: DeclineInviteError }` on host refusal.\n */\nexport const declineInvite = withTry<[string], void, DeclineInviteError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:declineInvite\", { spaceId }); },\n 'unknown',\n);\n\nexport type DeleteSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Soft-delete a space you own (FILE_SHARING_SPEC §6.2): sets the tombstone,\n * so every member’s live mount falls within one snapshot and the space lists\n * nowhere. Membership is retained — undo it with {@link restoreSpace} from\n * the surface that just deleted (there is no \"recently deleted\" list). Not a\n * hard delete: the space’s content is not destroyed by this call.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:delete`.\n * @throws `Error & { code: DeleteSpaceError }` on host refusal.\n */\nexport const deleteSpace = withTry<[string], void, DeleteSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:delete\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type RestoreSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Undo a {@link deleteSpace}: clears the §6.2 tombstone, and every retained\n * member’s access returns with no re-share fan-out. Reachable only while you\n * still hold the space id — the deleting surface does.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:restore`.\n * @throws `Error & { code: RestoreSpaceError }` on host refusal.\n */\nexport const restoreSpace = withTry<[string], void, RestoreSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:restore\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type LeaveSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'owner-lockout';\n\n/**\n * Remove YOURSELF from a space (FILE_SHARING_SPEC §9.7): your membership and\n * flattened access go in one batch, and live mounts fall through the same\n * watch as an unshare. The anchor owner cannot leave — they {@link\n * deleteSpace} instead — and a leave that would drop the last owner is\n * refused; both surface as `owner-lockout`.\n *\n * Capability: `spaces:user`. Catalog name: `spaces:leave`.\n * @throws `Error & { code: LeaveSpaceError }` on host refusal.\n */\nexport const leaveSpace = withTry<[string], void, LeaveSpaceError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:leave\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\nexport type RenameSpaceError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown' | 'invalid-params';\n\n/**\n * Rename a space you own (FILE_SHARING_SPEC §9.7). The name is trimmed\n * host-side and bounded (non-empty, at most the platform\n * MAX_SPACE_NAME_LENGTH); an over-long or empty name fails validation with\n * `invalid-params` before any write.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:rename`.\n * @throws `Error & { code: RenameSpaceError }` on host refusal.\n */\nexport const renameSpace = withTry<[string, string], void, RenameSpaceError>(\n async (spaceId: string, name: string): Promise<void> => { await invoke<void>(\"spaces:rename\", { spaceId, name }); },\n 'unknown',\n);\n\nexport type ConvertSpaceToSharedError =\n 'auth-required' | 'cancelled' | 'forbidden' | 'not-found' | 'unsupported-scheme' | 'unknown';\n\n/**\n * Convert a personal space to shared (R3-259) — the deliberate, ONE-WAY\n * conversion. Only the owner may call it; the irreversibility disclosure is\n * host-drawn chrome. Converting an already-shared space is a no-op.\n *\n * Capability: `spaces:admin`. Catalog name: `spaces:convertToShared`.\n * @throws `Error & { code: ConvertSpaceToSharedError }` on host refusal.\n */\nexport const convertSpaceToShared = withTry<[string], void, ConvertSpaceToSharedError>(\n async (spaceId: string): Promise<void> => { await invoke<void>(\"spaces:convertToShared\", { spaceId, confirm: true }); },\n 'unknown',\n);\n\n"],"mappings":";AAIA,SAAS,cAAc;AAEvB,MAAM,UAAU,CACd,IACA,aAEA,OAAO,OAAO,IAAI;AAAA,EAChB,KAAK,UAAU,SAAe;AAC5B,QAAI;AACF,aAAO,EAAE,IAAI,MAAe,OAAO,MAAM,GAAG,GAAG,IAAI,EAAE;AAAA,IACvD,SAAS,GAAG;AACV,aAAO,EAAE,IAAI,OAAgB,MAAO,EAAmB,QAAQ,SAAS;AAAA,IAC1E;AAAA,EACF;AACF,CAAC;AAsEI,MAAM,aAAa;AAAA,EACxB,CAAC,OAA0B,CAAC,MAC1B,OAAoB,eAAe,IAAI;AAAA,EACzC;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,MACE,OAAoB,kBAAkB,CAAC,CAAC;AAAA,EAC1C;AACF;AAWO,MAAM,kBAAkB;AAAA,EAC7B,CAAC,YACC,OAAiB,kBAAkB,EAAE,QAAQ,CAAC;AAAA,EAChD;AACF;AAeO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,SAAiB,OAAe,SAA8B;AAAE,UAAM,OAAa,iBAAiB,EAAE,SAAS,OAAO,KAAK,CAAC;AAAA,EAAG;AAAA,EACtI;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,UAAM,OAAa,kBAAkB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACjH;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,KAAa,SAA8B;AAAE,UAAM,OAAa,kBAAkB,EAAE,SAAS,KAAK,KAAK,CAAC;AAAA,EAAG;AAAA,EACnI;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,CAAC,UACC,OAAqB,qBAAqB,EAAE,MAAM,CAAC;AAAA,EACrD;AACF;AAYO,MAAM,aAAa;AAAA,EACxB,MACE,OAAsB,iBAAiB,CAAC,CAAC;AAAA,EAC3C;AACF;AAYO,MAAM,cAAc;AAAA,EACzB,OAAO,QAAgB,YAAmC;AAAE,UAAM,OAAa,sBAAsB,EAAE,QAAQ,QAAQ,CAAC;AAAA,EAAG;AAAA,EAC3H;AACF;AAWO,MAAM,qBAAqB;AAAA,EAChC,CAAC,YACC,OAAiB,yBAAyB,EAAE,QAAQ,CAAC;AAAA,EACvD;AACF;AAYO,MAAM,eAAe;AAAA,EAC1B,OAAO,SAAiB,QAA+B;AAAE,UAAM,OAAa,uBAAuB,EAAE,SAAS,IAAI,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,MACE,OAAiB,sBAAsB,CAAC,CAAC;AAAA,EAC3C;AACF;AAcO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,UAAM,OAAa,uBAAuB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACpG;AACF;AAWO,MAAM,gBAAgB;AAAA,EAC3B,OAAO,YAAmC;AAAE,UAAM,OAAa,wBAAwB,EAAE,QAAQ,CAAC;AAAA,EAAG;AAAA,EACrG;AACF;AAeO,MAAM,cAAc;AAAA,EACzB,OAAO,YAAmC;AAAE,UAAM,OAAa,iBAAiB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC7G;AACF;AAaO,MAAM,eAAe;AAAA,EAC1B,OAAO,YAAmC;AAAE,UAAM,OAAa,kBAAkB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC9G;AACF;AAeO,MAAM,aAAa;AAAA,EACxB,OAAO,YAAmC;AAAE,UAAM,OAAa,gBAAgB,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAC5G;AACF;AAcO,MAAM,cAAc;AAAA,EACzB,OAAO,SAAiB,SAAgC;AAAE,UAAM,OAAa,iBAAiB,EAAE,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EAClH;AACF;AAaO,MAAM,uBAAuB;AAAA,EAClC,OAAO,YAAmC;AAAE,UAAM,OAAa,0BAA0B,EAAE,SAAS,SAAS,KAAK,CAAC;AAAA,EAAG;AAAA,EACtH;AACF;","names":[]}
package/dist/index.cjs CHANGED
@@ -49,6 +49,7 @@ __reExport(index_exports, require("./chromeState"), module.exports);
49
49
  __reExport(index_exports, require("./workspace"), module.exports);
50
50
  __reExport(index_exports, require("./hostAttention"), module.exports);
51
51
  __reExport(index_exports, require("./region"), module.exports);
52
+ __reExport(index_exports, require("./spacesMode"), module.exports);
52
53
  __reExport(index_exports, require("./mounts"), module.exports);
53
54
  __reExport(index_exports, require("./analytics"), module.exports);
54
55
  __reExport(index_exports, require("./contribute"), module.exports);
@@ -120,6 +121,7 @@ var import_ScrollRestoration = require("./components/ScrollRestoration");
120
121
  ...require("./workspace"),
121
122
  ...require("./hostAttention"),
122
123
  ...require("./region"),
124
+ ...require("./spacesMode"),
123
125
  ...require("./mounts"),
124
126
  ...require("./analytics"),
125
127
  ...require("./contribute"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './openRepository'; // R3-476: host-mediated open-in-a-new-tab (route:read)\nexport * from './openExternal'; // R3-619: host-brokered outward-link open (link:open)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './dialog';\nexport * from './status';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentPause';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\nexport * from './platformLink';\n// R3-627: the per-history-entry scratch, and the scroll restoration built on it —\n// Back lands where the reader left, for however many entries deep they go.\nexport * from './entryState';\nexport * from './useEntryState';\nexport * from './scrollRestore';\nexport { ScrollRestoration, type ScrollRestorationProps } from './components/ScrollRestoration';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAQA,yBAA4B;AAC5B,0BAAc,0BATd;AAUA,0BAAc,uCAVd;AAWA,0BAAc,wBAXd;AAYA,0BAAc,qBAZd;AAcA,0BAAc,qBAdd;AAeA,0BAAc,oCAfd;AAgBA,0BAAc,gCAhBd;AAiBA,0BAAc,oBAjBd;AAoBA,0BAAc,6BApBd;AAuBA,6BAAwE;AACxE,0BAAc,mBAxBd;AAyBA,0BAAc,oBAzBd;AA0BA,0BAAc,4BA1Bd;AA2BA,0BAAc,qBA3Bd;AA4BA,0BAAc,yBA5Bd;AA6BA,0BAAc,0BA7Bd;AA8BA,0BAAc,wBA9Bd;AA+BA,0BAAc,4BA/Bd;AAgCA,0BAAc,qBAhCd;AAiCA,0BAAc,qBAjCd;AAkCA,0BAAc,wBAlCd;AAmCA,0BAAc,yBAnCd;AAoCA,0BAAc,sBApCd;AAqCA,0BAAc,kBArCd;AAsCA,0BAAc,kBAtCd;AAuCA,0BAAc,uBAvCd;AAwCA,0BAAc,mBAxCd;AAyCA,0BAAc,sBAzCd;AA0CA,0BAAc,sBA1Cd;AA2CA,0BAAc,6BA3Cd;AA4CA,0BAAc,2BA5Cd;AA6CA,0BAAc,kBA7Cd;AA8CA,0BAAc,0BA9Cd;AA+CA,0BAAc,kBA/Cd;AAgDA,0BAAc,yBAhDd;AAiDA,0BAAc,iBAjDd;AAkDA,0BAAc,oBAlDd;AAmDA,0BAAc,oBAnDd;AAoDA,0BAAc,qBApDd;AAqDA,0BAAc,sBArDd;AAsDA,0BAAc,wBAtDd;AAuDA,0BAAc,oBAvDd;AAwDA,0BAAc,sBAxDd;AAyDA,0BAAc,qBAzDd;AA0DA,0BAAc,qBA1Dd;AA2DA,0BAAc,6BA3Dd;AA4DA,0BAAc,+BA5Dd;AA6DA,0BAAc,2BA7Dd;AA8DA,0BAAc,0BA9Dd;AAmEA,0BAAc,wBAnEd;AAoEA,0BAAc,4BApEd;AAqEA,0BAAc,yBArEd;AAsEA,0BAAc,8BAtEd;AAuEA,0BAAc,gCAvEd;AAwEA,0BAAc,8BAxEd;AAyEA,0BAAc,2BAzEd;AA0EA,0BAAc,oBA1Ed;AA2EA,0BAAc,2BA3Ed;AA8EA,0BAAc,yBA9Ed;AA+EA,0BAAc,4BA/Ed;AAgFA,0BAAc,4BAhFd;AAiFA,+BAA+D;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\n// R3-708 — the spaces mode's route channel and its one navigation verb.\nexport * from './spacesMode';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './openRepository'; // R3-476: host-mediated open-in-a-new-tab (route:read)\nexport * from './openExternal'; // R3-619: host-brokered outward-link open (link:open)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './dialog';\nexport * from './status';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentPause';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\nexport * from './platformLink';\n// R3-627: the per-history-entry scratch, and the scroll restoration built on it —\n// Back lands where the reader left, for however many entries deep they go.\nexport * from './entryState';\nexport * from './useEntryState';\nexport * from './scrollRestore';\nexport { ScrollRestoration, type ScrollRestorationProps } from './components/ScrollRestoration';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAQA,yBAA4B;AAC5B,0BAAc,0BATd;AAUA,0BAAc,uCAVd;AAWA,0BAAc,wBAXd;AAYA,0BAAc,qBAZd;AAcA,0BAAc,qBAdd;AAeA,0BAAc,oCAfd;AAgBA,0BAAc,gCAhBd;AAiBA,0BAAc,oBAjBd;AAoBA,0BAAc,6BApBd;AAuBA,6BAAwE;AACxE,0BAAc,mBAxBd;AAyBA,0BAAc,oBAzBd;AA0BA,0BAAc,4BA1Bd;AA2BA,0BAAc,qBA3Bd;AA4BA,0BAAc,yBA5Bd;AA6BA,0BAAc,0BA7Bd;AA8BA,0BAAc,wBA9Bd;AA+BA,0BAAc,4BA/Bd;AAgCA,0BAAc,qBAhCd;AAkCA,0BAAc,yBAlCd;AAmCA,0BAAc,qBAnCd;AAoCA,0BAAc,wBApCd;AAqCA,0BAAc,yBArCd;AAsCA,0BAAc,sBAtCd;AAuCA,0BAAc,kBAvCd;AAwCA,0BAAc,kBAxCd;AAyCA,0BAAc,uBAzCd;AA0CA,0BAAc,mBA1Cd;AA2CA,0BAAc,sBA3Cd;AA4CA,0BAAc,sBA5Cd;AA6CA,0BAAc,6BA7Cd;AA8CA,0BAAc,2BA9Cd;AA+CA,0BAAc,kBA/Cd;AAgDA,0BAAc,0BAhDd;AAiDA,0BAAc,kBAjDd;AAkDA,0BAAc,yBAlDd;AAmDA,0BAAc,iBAnDd;AAoDA,0BAAc,oBApDd;AAqDA,0BAAc,oBArDd;AAsDA,0BAAc,qBAtDd;AAuDA,0BAAc,sBAvDd;AAwDA,0BAAc,wBAxDd;AAyDA,0BAAc,oBAzDd;AA0DA,0BAAc,sBA1Dd;AA2DA,0BAAc,qBA3Dd;AA4DA,0BAAc,qBA5Dd;AA6DA,0BAAc,6BA7Dd;AA8DA,0BAAc,+BA9Dd;AA+DA,0BAAc,2BA/Dd;AAgEA,0BAAc,0BAhEd;AAqEA,0BAAc,wBArEd;AAsEA,0BAAc,4BAtEd;AAuEA,0BAAc,yBAvEd;AAwEA,0BAAc,8BAxEd;AAyEA,0BAAc,gCAzEd;AA0EA,0BAAc,8BA1Ed;AA2EA,0BAAc,2BA3Ed;AA4EA,0BAAc,oBA5Ed;AA6EA,0BAAc,2BA7Ed;AAgFA,0BAAc,yBAhFd;AAiFA,0BAAc,4BAjFd;AAkFA,0BAAc,4BAlFd;AAmFA,+BAA+D;","names":[]}
package/dist/index.d.cts CHANGED
@@ -21,6 +21,7 @@ export { ChromeState, getChromeState, onChromeStateChange, useChromeState } from
21
21
  export { Workspace, getWorkspace, onWorkspaceChange, useWorkspace } from './workspace.cjs';
22
22
  export { HostAttention, HostAttentionKind, NO_HOST_ATTENTION, getHostAttention, onHostAttentionChange, useHostAttention } from './hostAttention.cjs';
23
23
  export { getRegion, isRegionHidden, onRegionVisibilityChange, useRegion, useRegionHidden } from './region.cjs';
24
+ export { NavigateSpacesError, NavigateSpacesErrorCode, SpacesActivity, SpacesModeSpace, SpacesModeState, SpacesRoute, SpacesTarget, getSpacesMode, navigateSpaces, onSpacesModeChange, useSpacesMode } from './spacesMode.cjs';
24
25
  export { MountQuery, MountRemoveReason, MountRule, RemovedMount, SandboxMount, SandboxMountBundle, SessionMount, SpaceError, awaitMatchingMount, createSpace, findMount, getAppMountPath, getInvites, getMounts, getSessionMounts, importSettingsFromParent, listSettingsApps, makeContentRef, mount, mountSpace, onInvitesChange, onMountsChange, onSessionMountsChange, openLocalStore, openSettings, openSettingsOf, requestMount, requestSpace, resolveContentRef, resolveContentRefs, unmountSpace, useInvites, useMounts, useSessionMounts, waitForMount } from './mounts.cjs';
25
26
  export { AnalyticsAck, AnalyticsPropValue, emitAnalyticsEvent, recordRoute, track, trackRoute } from './analytics.cjs';
26
27
  export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.cjs';
@@ -66,7 +67,7 @@ export { RESTORE_DEADLINE_MS, RESTORE_EPSILON_PX, RestoreAction, RestoreSample,
66
67
  export { ScrollRestoration, ScrollRestorationProps } from './components/ScrollRestoration.cjs';
67
68
  export { Admonition, AdmonitionType } from './components/Admonition.cjs';
68
69
  export { BundleLayout, FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
69
- export { GrantRecord, Invite, Member, ResolvedUser, Role, SpaceInfo, acceptInvite, declineInvite, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, revokeGrant, revokeInvite, setSpaceRole, unshareSpace } from './generated/spaces.cjs';
70
+ export { ConvertSpaceToSharedError, DeleteSpaceError, GrantRecord, Invite, LeaveSpaceError, Member, RenameSpaceError, ResolvedUser, RestoreSpaceError, Role, SpaceInfo, acceptInvite, convertSpaceToShared, declineInvite, deleteSpace, getSpaceMembers, inviteToSpace, leaveSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, renameSpace, restoreSpace, revokeGrant, revokeInvite, setSpaceRole, unshareSpace } from './generated/spaces.cjs';
70
71
  export { HeadingAnchor } from './components/HeadingAnchor.cjs';
71
72
  export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.cjs';
72
73
  export { IncludeMode, IncludeModeContext, RenderExportedComponentContext, RenderFileContextType } from './components/includeContexts.cjs';
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export { ChromeState, getChromeState, onChromeStateChange, useChromeState } from
21
21
  export { Workspace, getWorkspace, onWorkspaceChange, useWorkspace } from './workspace.js';
22
22
  export { HostAttention, HostAttentionKind, NO_HOST_ATTENTION, getHostAttention, onHostAttentionChange, useHostAttention } from './hostAttention.js';
23
23
  export { getRegion, isRegionHidden, onRegionVisibilityChange, useRegion, useRegionHidden } from './region.js';
24
+ export { NavigateSpacesError, NavigateSpacesErrorCode, SpacesActivity, SpacesModeSpace, SpacesModeState, SpacesRoute, SpacesTarget, getSpacesMode, navigateSpaces, onSpacesModeChange, useSpacesMode } from './spacesMode.js';
24
25
  export { MountQuery, MountRemoveReason, MountRule, RemovedMount, SandboxMount, SandboxMountBundle, SessionMount, SpaceError, awaitMatchingMount, createSpace, findMount, getAppMountPath, getInvites, getMounts, getSessionMounts, importSettingsFromParent, listSettingsApps, makeContentRef, mount, mountSpace, onInvitesChange, onMountsChange, onSessionMountsChange, openLocalStore, openSettings, openSettingsOf, requestMount, requestSpace, resolveContentRef, resolveContentRefs, unmountSpace, useInvites, useMounts, useSessionMounts, waitForMount } from './mounts.js';
25
26
  export { AnalyticsAck, AnalyticsPropValue, emitAnalyticsEvent, recordRoute, track, trackRoute } from './analytics.js';
26
27
  export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.js';
@@ -66,7 +67,7 @@ export { RESTORE_DEADLINE_MS, RESTORE_EPSILON_PX, RestoreAction, RestoreSample,
66
67
  export { ScrollRestoration, ScrollRestorationProps } from './components/ScrollRestoration.js';
67
68
  export { Admonition, AdmonitionType } from './components/Admonition.js';
68
69
  export { BundleLayout, FS_PREFIX, LinkSpace, ResolvedLinkTarget, normalizeAbsolute, resolveLinkTarget } from '@immediately-run/mdx-plugins';
69
- export { GrantRecord, Invite, Member, ResolvedUser, Role, SpaceInfo, acceptInvite, declineInvite, getSpaceMembers, inviteToSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, revokeGrant, revokeInvite, setSpaceRole, unshareSpace } from './generated/spaces.js';
70
+ export { ConvertSpaceToSharedError, DeleteSpaceError, GrantRecord, Invite, LeaveSpaceError, Member, RenameSpaceError, ResolvedUser, RestoreSpaceError, Role, SpaceInfo, acceptInvite, convertSpaceToShared, declineInvite, deleteSpace, getSpaceMembers, inviteToSpace, leaveSpace, listAllSpaces, listGrants, listMyInvites, listPendingInvites, listSpaces, lookupUser, renameSpace, restoreSpace, revokeGrant, revokeInvite, setSpaceRole, unshareSpace } from './generated/spaces.js';
70
71
  export { HeadingAnchor } from './components/HeadingAnchor.js';
71
72
  export { ImmediatelyRunGlobal, getHostRuntime } from './hostRuntime.js';
72
73
  export { IncludeMode, IncludeModeContext, RenderExportedComponentContext, RenderFileContextType } from './components/includeContexts.js';
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export * from "./chromeState.js";
23
23
  export * from "./workspace.js";
24
24
  export * from "./hostAttention.js";
25
25
  export * from "./region.js";
26
+ export * from "./spacesMode.js";
26
27
  export * from "./mounts.js";
27
28
  export * from "./analytics.js";
28
29
  export * from "./contribute.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './openRepository'; // R3-476: host-mediated open-in-a-new-tab (route:read)\nexport * from './openExternal'; // R3-619: host-brokered outward-link open (link:open)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './dialog';\nexport * from './status';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentPause';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\nexport * from './platformLink';\n// R3-627: the per-history-entry scratch, and the scroll restoration built on it —\n// Back lands where the reader left, for however many entries deep they go.\nexport * from './entryState';\nexport * from './useEntryState';\nexport * from './scrollRestore';\nexport { ScrollRestoration, type ScrollRestorationProps } from './components/ScrollRestoration';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,SAAS,mBAAmB;AAC5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,4BAA4B,mCAAmC;AACxE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,yBAAsD;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\n// R3-708 — the spaces mode's route channel and its one navigation verb.\nexport * from './spacesMode';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './openRepository'; // R3-476: host-mediated open-in-a-new-tab (route:read)\nexport * from './openExternal'; // R3-619: host-brokered outward-link open (link:open)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './dialog';\nexport * from './status';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentPause';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\nexport * from './platformLink';\n// R3-627: the per-history-entry scratch, and the scroll restoration built on it —\n// Back lands where the reader left, for however many entries deep they go.\nexport * from './entryState';\nexport * from './useEntryState';\nexport * from './scrollRestore';\nexport { ScrollRestoration, type ScrollRestorationProps } from './components/ScrollRestoration';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,SAAS,mBAAmB;AAC5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,4BAA4B,mCAAmC;AACxE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,yBAAsD;","names":[]}
package/dist/ipc.cjs CHANGED
@@ -25,24 +25,17 @@ __export(ipc_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(ipc_exports);
27
27
  var import_react = require("react");
28
+ var import_protocolRefusal = require("./protocolRefusal");
28
29
  var import_sandboxUtils = require("./sandboxUtils");
29
30
  var import_protocol = require("./generated/protocol");
30
31
  var import_protocolSchemes = require("./protocolSchemes");
31
32
  const postToRegion = async (region, data) => {
32
33
  const res = await (0, import_sandboxUtils.protocolRequest)(import_protocolSchemes.SCHEMES[import_protocol.PROTOCOL_IPC], "post", [{ to: region, msg: data }]);
33
- if (!res || res.ok !== true) {
34
- const err = new Error(res?.message ?? "ipc post failed");
35
- err.code = res?.code ?? "unknown";
36
- throw err;
37
- }
34
+ (0, import_protocolRefusal.throwOnRefusal)(res, "ipc post failed");
38
35
  };
39
36
  const revealRegion = async (region) => {
40
37
  const res = await (0, import_sandboxUtils.protocolRequest)(import_protocolSchemes.SCHEMES[import_protocol.PROTOCOL_IPC], "reveal", [{ to: region }]);
41
- if (!res || res.ok !== true) {
42
- const err = new Error(res?.message ?? "ipc reveal failed");
43
- err.code = res?.code ?? "unknown";
44
- throw err;
45
- }
38
+ (0, import_protocolRefusal.throwOnRefusal)(res, "ipc reveal failed");
46
39
  };
47
40
  const onRegionMessage = (listener) => (0, import_sandboxUtils.addListener)(import_protocol.REGION_MESSAGE, (m) => listener({ from: m.from, data: m.data }));
48
41
  const useRegionMessage = () => {
package/dist/ipc.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ipc.ts"],"sourcesContent":["// Inter-app messaging (UI_AS_APPS_SPEC §5.6) — L2: chrome panels/regions talk to\n// each other across an edge BOTH sides declared in their bindings (sender `ipc.to`\n// + the `ipc` capability; receiver `ipc.accepts`). The host enforces both halves\n// and attaches an unspoofable `from`; you still treat the payload as untrusted.\nimport { useEffect, useState } from 'react';\nimport { protocolRequest, addListener } from './sandboxUtils';\nimport { PROTOCOL_IPC, REGION_MESSAGE } from './generated/protocol';\nimport { SCHEMES } from './protocolSchemes';\n\n/** A message delivered to this region. `from` is the SENDER's region, attached by\n * the host (unspoofable, T19); `data` is the sender-provided payload. */\nexport interface RegionMessage {\n from: string;\n data: unknown;\n}\n\n/**\n * Send a message to another region. Resolves when delivered; rejects (`forbidden`)\n * if the edge isn't two-sided-consented, the target isn't mounted, or this app\n * lacks the `ipc` capability.\n */\nexport const postToRegion = async (region: string, data: unknown): Promise<void> => {\n const res = (await protocolRequest(SCHEMES[PROTOCOL_IPC], 'post', [{ to: region, msg: data }])) as\n | { ok: true }\n | { ok: false; code?: string; message?: string }\n | undefined;\n if (!res || res.ok !== true) {\n const err = new Error(res?.message ?? 'ipc post failed') as Error & { code?: string };\n err.code = res?.code ?? 'unknown';\n throw err;\n }\n};\n\n/**\n * Ask the host to bring the user to `region` — the `reveal`-class method of\n * UI_AS_APPS_SPEC §4.1's focus model (R3-243). On mobile that is the column\n * transition (the panel's carousel advances to the main pane); on desktop a focus\n * move. Use it when a tap in your panel produces something to look at in another\n * column, right after the `postToRegion` that sends it there:\n *\n * ```ts\n * onClick={() => { // a REAL user gesture\n * void postToRegion('stage.conversation', { type: 'select-conversation', id });\n * void revealRegion('stage.conversation');\n * }}\n * ```\n *\n * **Call it synchronously inside a user-gesture handler.** The host reads its own\n * transient user activation and refuses without one — an app flipping columns on a\n * timer is the attention-steal primitive §4.1 is written against. It reaches only\n * regions you already have a two-sided IPC edge to, and only within the active\n * activity, so it can neither jump the user into an unrelated surface nor pull\n * focus back to the caller's own column.\n *\n * Resolves once the host has *considered* the request — deliberately NOT reporting\n * whether focus actually moved. Whether the user is moved is the host's call\n * (activation, rate limit, already-there), and an app that could observe the\n * refusal would be tempted to retry, which is the behaviour the gate exists to\n * stop. Rejects only on a genuine authorization failure (`forbidden`): no `ipc`\n * capability, or no declared edge to `region`.\n */\nexport const revealRegion = async (region: string): Promise<void> => {\n const res = (await protocolRequest(SCHEMES[PROTOCOL_IPC], 'reveal', [{ to: region }])) as\n | { ok: true }\n | { ok: false; code?: string; message?: string }\n | undefined;\n if (!res || res.ok !== true) {\n const err = new Error(res?.message ?? 'ipc reveal failed') as Error & { code?: string };\n err.code = res?.code ?? 'unknown';\n throw err;\n }\n};\n\n/** Subscribe to inbound region messages. Returns an unsubscribe fn. */\nexport const onRegionMessage = (listener: (msg: RegionMessage) => void): (() => void) =>\n addListener(REGION_MESSAGE, (m: { from: string; data: unknown }) => listener({ from: m.from, data: m.data }));\n\n/** React hook: the most recent inbound region message (or `null`). */\nexport const useRegionMessage = (): RegionMessage | null => {\n const [msg, setMsg] = useState<RegionMessage | null>(null);\n useEffect(() => onRegionMessage(setMsg), []);\n return msg;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAoC;AACpC,0BAA6C;AAC7C,sBAA6C;AAC7C,6BAAwB;AAcjB,MAAM,eAAe,OAAO,QAAgB,SAAiC;AAClF,QAAM,MAAO,UAAM,qCAAgB,+BAAQ,4BAAY,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,KAAK,KAAK,CAAC,CAAC;AAI7F,MAAI,CAAC,OAAO,IAAI,OAAO,MAAM;AAC3B,UAAM,MAAM,IAAI,MAAM,KAAK,WAAW,iBAAiB;AACvD,QAAI,OAAO,KAAK,QAAQ;AACxB,UAAM;AAAA,EACR;AACF;AA8BO,MAAM,eAAe,OAAO,WAAkC;AACnE,QAAM,MAAO,UAAM,qCAAgB,+BAAQ,4BAAY,GAAG,UAAU,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC;AAIpF,MAAI,CAAC,OAAO,IAAI,OAAO,MAAM;AAC3B,UAAM,MAAM,IAAI,MAAM,KAAK,WAAW,mBAAmB;AACzD,QAAI,OAAO,KAAK,QAAQ;AACxB,UAAM;AAAA,EACR;AACF;AAGO,MAAM,kBAAkB,CAAC,iBAC9B,iCAAY,gCAAgB,CAAC,MAAuC,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,EAAE,KAAK,CAAC,CAAC;AAGvG,MAAM,mBAAmB,MAA4B;AAC1D,QAAM,CAAC,KAAK,MAAM,QAAI,uBAA+B,IAAI;AACzD,8BAAU,MAAM,gBAAgB,MAAM,GAAG,CAAC,CAAC;AAC3C,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/ipc.ts"],"sourcesContent":["// Inter-app messaging (UI_AS_APPS_SPEC §5.6) — L2: chrome panels/regions talk to\n// each other across an edge BOTH sides declared in their bindings (sender `ipc.to`\n// + the `ipc` capability; receiver `ipc.accepts`). The host enforces both halves\n// and attaches an unspoofable `from`; you still treat the payload as untrusted.\nimport { useEffect, useState } from 'react';\nimport { throwOnRefusal } from './protocolRefusal';\nimport { protocolRequest, addListener } from './sandboxUtils';\nimport { PROTOCOL_IPC, REGION_MESSAGE } from './generated/protocol';\nimport { SCHEMES } from './protocolSchemes';\n\n/** A message delivered to this region. `from` is the SENDER's region, attached by\n * the host (unspoofable, T19); `data` is the sender-provided payload. */\nexport interface RegionMessage {\n from: string;\n data: unknown;\n}\n\n/**\n * Send a message to another region. Resolves when delivered; rejects (`forbidden`)\n * if the edge isn't two-sided-consented, the target isn't mounted, or this app\n * lacks the `ipc` capability.\n */\nexport const postToRegion = async (region: string, data: unknown): Promise<void> => {\n const res = (await protocolRequest(SCHEMES[PROTOCOL_IPC], 'post', [{ to: region, msg: data }])) as\n | { ok: true }\n | { ok: false; code?: string; message?: string }\n | undefined;\n throwOnRefusal(res, 'ipc post failed');\n};\n\n/**\n * Ask the host to bring the user to `region` — the `reveal`-class method of\n * UI_AS_APPS_SPEC §4.1's focus model (R3-243). On mobile that is the column\n * transition (the panel's carousel advances to the main pane); on desktop a focus\n * move. Use it when a tap in your panel produces something to look at in another\n * column, right after the `postToRegion` that sends it there:\n *\n * ```ts\n * onClick={() => { // a REAL user gesture\n * void postToRegion('stage.conversation', { type: 'select-conversation', id });\n * void revealRegion('stage.conversation');\n * }}\n * ```\n *\n * **Call it synchronously inside a user-gesture handler.** The host reads its own\n * transient user activation and refuses without one — an app flipping columns on a\n * timer is the attention-steal primitive §4.1 is written against. It reaches only\n * regions you already have a two-sided IPC edge to, and only within the active\n * activity, so it can neither jump the user into an unrelated surface nor pull\n * focus back to the caller's own column.\n *\n * Resolves once the host has *considered* the request — deliberately NOT reporting\n * whether focus actually moved. Whether the user is moved is the host's call\n * (activation, rate limit, already-there), and an app that could observe the\n * refusal would be tempted to retry, which is the behaviour the gate exists to\n * stop. Rejects only on a genuine authorization failure (`forbidden`): no `ipc`\n * capability, or no declared edge to `region`.\n */\nexport const revealRegion = async (region: string): Promise<void> => {\n const res = (await protocolRequest(SCHEMES[PROTOCOL_IPC], 'reveal', [{ to: region }])) as\n | { ok: true }\n | { ok: false; code?: string; message?: string }\n | undefined;\n throwOnRefusal(res, 'ipc reveal failed');\n};\n\n/** Subscribe to inbound region messages. Returns an unsubscribe fn. */\nexport const onRegionMessage = (listener: (msg: RegionMessage) => void): (() => void) =>\n addListener(REGION_MESSAGE, (m: { from: string; data: unknown }) => listener({ from: m.from, data: m.data }));\n\n/** React hook: the most recent inbound region message (or `null`). */\nexport const useRegionMessage = (): RegionMessage | null => {\n const [msg, setMsg] = useState<RegionMessage | null>(null);\n useEffect(() => onRegionMessage(setMsg), []);\n return msg;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAoC;AACpC,6BAA+B;AAC/B,0BAA6C;AAC7C,sBAA6C;AAC7C,6BAAwB;AAcjB,MAAM,eAAe,OAAO,QAAgB,SAAiC;AAClF,QAAM,MAAO,UAAM,qCAAgB,+BAAQ,4BAAY,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,KAAK,KAAK,CAAC,CAAC;AAI7F,6CAAe,KAAK,iBAAiB;AACvC;AA8BO,MAAM,eAAe,OAAO,WAAkC;AACnE,QAAM,MAAO,UAAM,qCAAgB,+BAAQ,4BAAY,GAAG,UAAU,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC;AAIpF,6CAAe,KAAK,mBAAmB;AACzC;AAGO,MAAM,kBAAkB,CAAC,iBAC9B,iCAAY,gCAAgB,CAAC,MAAuC,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,EAAE,KAAK,CAAC,CAAC;AAGvG,MAAM,mBAAmB,MAA4B;AAC1D,QAAM,CAAC,KAAK,MAAM,QAAI,uBAA+B,IAAI;AACzD,8BAAU,MAAM,gBAAgB,MAAM,GAAG,CAAC,CAAC;AAC3C,SAAO;AACT;","names":[]}