@fungi.computer/oyster 0.2.0 → 0.3.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 (291) hide show
  1. package/README.md +396 -72
  2. package/dist/agents.d.ts +3 -2
  3. package/dist/agents.js +4 -2
  4. package/dist/app-builds.d.ts +81 -8
  5. package/dist/app-builds.js +213 -60
  6. package/dist/app-storage.d.ts +3 -3
  7. package/dist/approval-capability.d.ts +5 -0
  8. package/dist/approval-capability.js +46 -0
  9. package/dist/approval-home.d.ts +51 -0
  10. package/dist/approval-home.js +226 -0
  11. package/dist/apps/catalog.d.ts +335 -0
  12. package/dist/apps/catalog.js +46 -0
  13. package/dist/apps/gate.d.ts +20 -6
  14. package/dist/apps/gate.js +42 -16
  15. package/dist/apps/index.d.ts +3 -1
  16. package/dist/apps/index.js +3 -1
  17. package/dist/apps/installation.d.ts +132 -51
  18. package/dist/apps/installation.js +176 -70
  19. package/dist/apps/permissions.d.ts +247 -0
  20. package/dist/apps/permissions.js +255 -0
  21. package/dist/boot-capability-route.d.ts +15 -0
  22. package/dist/boot-capability-route.js +196 -0
  23. package/dist/boot-capability.d.ts +103 -0
  24. package/dist/boot-capability.js +141 -0
  25. package/dist/boot-construction.d.ts +12 -0
  26. package/dist/boot-construction.js +175 -0
  27. package/dist/boot-gate.d.ts +267 -0
  28. package/dist/boot-gate.js +236 -0
  29. package/dist/boot-host-script.d.ts +2 -0
  30. package/dist/boot-host-script.js +1 -0
  31. package/dist/boot-mount.d.ts +21 -0
  32. package/dist/boot-mount.js +65 -0
  33. package/dist/browser/boot.d.ts +73 -0
  34. package/dist/browser/boot.js +502 -0
  35. package/dist/browser/browser.d.ts +104 -0
  36. package/dist/browser/browser.js +374 -0
  37. package/dist/browser/capability-source.d.ts +76 -0
  38. package/dist/browser/capability-source.js +338 -0
  39. package/dist/browser/cdp-client.d.ts +56 -0
  40. package/dist/browser/cdp-client.js +184 -0
  41. package/dist/browser/errors.d.ts +79 -0
  42. package/dist/browser/errors.js +32 -0
  43. package/dist/browser/index.d.ts +16 -0
  44. package/dist/browser/index.js +14 -0
  45. package/dist/browser/lease-registry.d.ts +61 -0
  46. package/dist/browser/lease-registry.js +101 -0
  47. package/dist/browser/operations.d.ts +225 -0
  48. package/dist/browser/operations.js +137 -0
  49. package/dist/browser/page.d.ts +25 -0
  50. package/dist/browser/page.js +172 -0
  51. package/dist/browser/quick-reads.d.ts +29 -0
  52. package/dist/browser/quick-reads.js +160 -0
  53. package/dist/browser/sessions.d.ts +52 -0
  54. package/dist/browser/sessions.js +118 -0
  55. package/dist/browser/url-policy.d.ts +18 -0
  56. package/dist/browser/url-policy.js +58 -0
  57. package/dist/build/app-imports.d.ts +12 -0
  58. package/dist/build/app-imports.js +105 -0
  59. package/dist/build/build-policy.d.ts +5 -3
  60. package/dist/build/build-policy.js +5 -3
  61. package/dist/build/candidate-builder.d.ts +1 -1
  62. package/dist/build/candidate-cli.mjs +8375 -334
  63. package/dist/build/local-build.d.ts +2 -0
  64. package/dist/build/local-build.js +28 -6
  65. package/dist/build/snapshot-package-store.d.ts +1 -1
  66. package/dist/build/snapshot-package-store.js +7 -2
  67. package/dist/build/workspace-build.d.ts +92 -5
  68. package/dist/build/workspace-build.js +93 -19
  69. package/dist/build.d.ts +1 -1
  70. package/dist/build.js +1 -1
  71. package/dist/catalog-frame.js +1 -1
  72. package/dist/cloudflare.d.ts +13 -3
  73. package/dist/cloudflare.js +102 -4
  74. package/dist/frame-binding-wire-script.js +1 -1
  75. package/dist/frame-binding-wire.js +4 -2
  76. package/dist/git-auth.d.ts +0 -2
  77. package/dist/git-auth.js +0 -2
  78. package/dist/git.d.ts +0 -1
  79. package/dist/git.js +0 -2
  80. package/dist/host.d.ts +39 -13
  81. package/dist/host.js +268 -142
  82. package/dist/index.d.ts +25 -15
  83. package/dist/index.js +39 -16
  84. package/dist/install-release-cli.d.ts +2 -0
  85. package/dist/install-release-cli.js +46 -0
  86. package/dist/installation-client.d.ts +43 -0
  87. package/dist/installation-client.js +178 -0
  88. package/dist/installation-execution.d.ts +11 -0
  89. package/dist/installation-execution.js +184 -0
  90. package/dist/installation-operations.d.ts +1437 -0
  91. package/dist/installation-operations.js +664 -0
  92. package/dist/installation-store-generation.d.ts +3 -0
  93. package/dist/installation-store-generation.js +16 -0
  94. package/dist/instance-id.d.ts +10 -0
  95. package/dist/instance-id.js +10 -0
  96. package/dist/instance-refusal.d.ts +11 -0
  97. package/dist/instance-refusal.js +21 -0
  98. package/dist/internal/delivery.js +4 -2
  99. package/dist/internal/host-gate.js +7 -1
  100. package/dist/internal/registry-installations.js +4 -4
  101. package/dist/keys.d.ts +5 -1
  102. package/dist/keys.js +10 -2
  103. package/dist/machine-link/authority.d.ts +89 -0
  104. package/dist/machine-link/authority.js +37 -0
  105. package/dist/machine-link/client.d.ts +66 -0
  106. package/dist/machine-link/client.js +94 -0
  107. package/dist/machine-link/delivery.d.ts +18 -0
  108. package/dist/machine-link/delivery.js +55 -0
  109. package/dist/machine-link/enrollment.d.ts +111 -0
  110. package/dist/machine-link/enrollment.js +286 -0
  111. package/dist/machine-link/fences.d.ts +37 -0
  112. package/dist/machine-link/fences.js +166 -0
  113. package/dist/machine-link/home.d.ts +20 -0
  114. package/dist/machine-link/home.js +24 -0
  115. package/dist/machine-link/host.d.ts +43 -0
  116. package/dist/machine-link/host.js +189 -0
  117. package/dist/machine-link/index.d.ts +15 -0
  118. package/dist/machine-link/index.js +15 -0
  119. package/dist/machine-link/link.d.ts +48 -0
  120. package/dist/machine-link/link.js +223 -0
  121. package/dist/machine-link/presence.d.ts +10 -0
  122. package/dist/machine-link/presence.js +25 -0
  123. package/dist/machine-link/workers.d.ts +6 -0
  124. package/dist/machine-link/workers.js +6 -0
  125. package/dist/mcp-owner.d.ts +2 -2
  126. package/dist/mcp-owner.js +41 -33
  127. package/dist/mcp.d.ts +15 -3
  128. package/dist/mcp.js +146 -25
  129. package/dist/older-oyster-store-refusal.d.ts +4 -0
  130. package/dist/older-oyster-store-refusal.js +18 -0
  131. package/dist/older-oyster-store.d.ts +21 -0
  132. package/dist/older-oyster-store.js +43 -0
  133. package/dist/pack.d.ts +14 -3
  134. package/dist/pack.js +44 -19
  135. package/dist/page/app-access.d.ts +7 -0
  136. package/dist/page/app-access.js +75 -0
  137. package/dist/page/boot-host.js +57 -0
  138. package/dist/page/capabilities.d.ts +3 -3
  139. package/dist/page/capabilities.js +16 -12
  140. package/dist/page/computer-handles.d.ts +3 -3
  141. package/dist/page/computer-target.d.ts +3 -0
  142. package/dist/page/computer-target.js +9 -0
  143. package/dist/page/mount.d.ts +23 -3
  144. package/dist/page/mount.js +152 -16
  145. package/dist/page-assets.d.ts +22 -0
  146. package/dist/page-assets.js +28 -0
  147. package/dist/page-script.d.ts +3 -0
  148. package/dist/page-script.js +5 -4
  149. package/dist/release.d.ts +13 -6
  150. package/dist/release.js +10 -7
  151. package/dist/root-data.d.ts +16 -6
  152. package/dist/root-data.js +2 -2
  153. package/dist/source/index.d.ts +1 -1
  154. package/dist/source/team-source.d.ts +20 -8
  155. package/dist/source/team-source.js +39 -10
  156. package/dist/source/template-seed.d.ts +2 -2
  157. package/dist/standalone/agent-mail.d.ts +24 -0
  158. package/dist/standalone/agent-mail.js +62 -0
  159. package/dist/standalone/agent-store.d.ts +9 -0
  160. package/dist/standalone/agent-store.js +30 -0
  161. package/dist/standalone/agents.d.ts +68 -9
  162. package/dist/standalone/agents.js +428 -56
  163. package/dist/standalone/app-builds-binding.d.ts +20 -2
  164. package/dist/standalone/app-builds-binding.js +147 -23
  165. package/dist/standalone/app-set.d.ts +5 -2
  166. package/dist/standalone/app-set.js +186 -144
  167. package/dist/standalone/browser.d.ts +11 -0
  168. package/dist/standalone/browser.js +72 -0
  169. package/dist/standalone/builds.d.ts +13 -4
  170. package/dist/standalone/builds.js +28 -44
  171. package/dist/standalone/computer-egress.d.ts +2 -0
  172. package/dist/standalone/computer-egress.js +13 -4
  173. package/dist/standalone/computer-fleet.d.ts +43 -0
  174. package/dist/standalone/computer-fleet.js +200 -0
  175. package/dist/standalone/computer.d.ts +44 -9
  176. package/dist/standalone/computer.js +129 -22
  177. package/dist/standalone/install-apps-cli.js +43 -6
  178. package/dist/standalone/instance.d.ts +2 -2
  179. package/dist/standalone/instance.js +8 -11
  180. package/dist/standalone/machine-link.d.ts +354 -0
  181. package/dist/standalone/machine-link.js +368 -0
  182. package/dist/standalone/media.d.ts +2 -2
  183. package/dist/standalone/media.js +19 -16
  184. package/dist/standalone/preview.d.ts +2 -2
  185. package/dist/standalone/preview.js +37 -10
  186. package/dist/standalone/registry.d.ts +151 -9
  187. package/dist/standalone/registry.js +305 -8
  188. package/dist/standalone/worker.d.ts +19 -5
  189. package/dist/standalone/worker.js +90 -54
  190. package/dist/standalone/workflow-binding.d.ts +18 -22
  191. package/dist/standalone/workflow-binding.js +18 -18
  192. package/dist/standalone/workflow-control.d.ts +4 -0
  193. package/dist/standalone/workflow-control.js +40 -0
  194. package/dist/standalone/workflow-events.d.ts +2 -2
  195. package/dist/standalone/workflow-events.js +9 -10
  196. package/dist/standalone/workflow-git-capture.js +4 -3
  197. package/dist/standalone/workflow-host.d.ts +162 -161
  198. package/dist/standalone/workflow-host.js +101 -21
  199. package/dist/standalone/workflow-node-capture.js +11 -4
  200. package/dist/standalone/workflow-schedules.d.ts +5 -2
  201. package/dist/standalone/workflow-schedules.js +9 -10
  202. package/dist/standalone/workflow-trigger-host.d.ts +65 -5
  203. package/dist/standalone/workflow-trigger-host.js +2 -2
  204. package/dist/standalone/workflow-webhooks.d.ts +22 -0
  205. package/dist/standalone/workflow-webhooks.js +39 -0
  206. package/dist/standalone/workflows.d.ts +140 -43
  207. package/dist/standalone/workflows.js +198 -39
  208. package/dist/storage-frame.d.ts +6 -6
  209. package/dist/testing/capabilities.js +14 -3
  210. package/dist/testing/installation.js +26 -2
  211. package/dist/testing/worker.js +1 -1
  212. package/dist/testing/workers-runtime.d.ts +8 -2
  213. package/dist/testing/workers-runtime.js +20 -2
  214. package/dist/webhook-abuse.d.ts +25 -0
  215. package/dist/webhook-abuse.js +54 -0
  216. package/dist/webhook-custody.d.ts +144 -0
  217. package/dist/webhook-custody.js +222 -0
  218. package/dist/webhook-ingress.d.ts +36 -0
  219. package/dist/webhook-ingress.js +146 -0
  220. package/dist/webhooks.d.ts +111 -0
  221. package/dist/webhooks.js +189 -0
  222. package/dist/workers-git.d.ts +12 -17
  223. package/dist/workers-git.js +64 -52
  224. package/dist/workers.d.ts +226 -13
  225. package/dist/workers.js +363 -51
  226. package/dist/workflow-agent-authority.d.ts +8 -0
  227. package/dist/workflow-agent-authority.js +42 -0
  228. package/dist/workflows.d.ts +66 -0
  229. package/dist/workflows.js +97 -0
  230. package/docs/api/README.md +63 -37
  231. package/docs/api/agents.md +17 -0
  232. package/docs/api/app-storage.md +1 -1
  233. package/docs/api/apps.md +1394 -543
  234. package/docs/api/browser/boot.md +132 -0
  235. package/docs/api/browser.md +1440 -0
  236. package/docs/api/build-contract.md +38 -25
  237. package/docs/api/build.md +263 -84
  238. package/docs/api/cloudflare.md +93 -7
  239. package/docs/api/git.md +3 -13
  240. package/docs/api/host.md +944 -118
  241. package/docs/api/index.md +320 -18
  242. package/docs/api/keys.md +24 -1
  243. package/docs/api/mcp.md +59 -12
  244. package/docs/api/modules.md +33 -40
  245. package/docs/api/pack.md +57 -8
  246. package/docs/api/page/mount.md +92 -4
  247. package/docs/api/workers-git.md +103 -24
  248. package/docs/api/workers.md +1594 -244
  249. package/docs/site/agent-quickstart.mdx +28 -14
  250. package/examples/standalone/worker.ts +3 -1
  251. package/examples/standalone/wrangler.jsonc +2 -0
  252. package/package.json +73 -71
  253. package/dist/installation-consent.d.ts +0 -81
  254. package/dist/installation-consent.js +0 -84
  255. package/dist/shell/app-directory.d.ts +0 -542
  256. package/dist/shell/app-directory.js +0 -196
  257. package/dist/shell/browser-actions.d.ts +0 -7
  258. package/dist/shell/browser-actions.js +0 -56
  259. package/dist/shell/command-host.d.ts +0 -112
  260. package/dist/shell/command-host.js +0 -502
  261. package/dist/shell/commands.d.ts +0 -25
  262. package/dist/shell/commands.js +0 -78
  263. package/dist/shell/index.d.ts +0 -8
  264. package/dist/shell/index.js +0 -8
  265. package/dist/shell/keys.d.ts +0 -41
  266. package/dist/shell/keys.js +0 -134
  267. package/dist/shell/shell-module.d.ts +0 -55
  268. package/dist/shell/shell-module.js +0 -86
  269. package/dist/shell/window-manager.d.ts +0 -128
  270. package/dist/shell/window-manager.js +0 -730
  271. package/dist/shell/workbench-contract.d.ts +0 -68
  272. package/dist/shell/workbench-directory.d.ts +0 -332
  273. package/dist/shell/workbench-directory.js +0 -35
  274. package/dist/shell/workbench-host-types.d.ts +0 -96
  275. package/dist/shell/workbench-host-types.js +0 -1
  276. package/dist/shell/workbench-host.d.ts +0 -34
  277. package/dist/shell/workbench-host.js +0 -352
  278. package/dist/shell/workbench-model.d.ts +0 -194
  279. package/dist/shell/workbench-model.js +0 -53
  280. package/dist/shell/workbench.d.ts +0 -4
  281. package/dist/shell/workbench.js +0 -2
  282. package/docs/api/shell/app-directory.md +0 -599
  283. package/docs/api/shell/command-host.md +0 -224
  284. package/docs/api/shell/commands.md +0 -197
  285. package/docs/api/shell/keys.md +0 -183
  286. package/docs/api/shell/shell-module.md +0 -204
  287. package/docs/api/shell/window-manager.md +0 -267
  288. package/docs/api/shell/workbench-directory.md +0 -119
  289. package/docs/api/shell/workbench.md +0 -205
  290. package/docs/api/shell.md +0 -1915
  291. /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
package/docs/api/index.md CHANGED
@@ -28,10 +28,10 @@ new AppInstanceError(code, options?): AppInstanceError;
28
28
 
29
29
  ###### Parameters
30
30
 
31
- | Parameter | Type |
32
- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
- | `code` | \| `"stale_authority"` \| `"invalid_owner_state"` \| `"invalid_invocation_facts"` \| `"revoked"` \| `"binding_not_granted"` \| `"binding_unavailable"` \| `"expired"` \| `"reentrant"` \| `"instance_identity_mismatch"` \| `"instance_owner_mismatch"` \| `"conflicting_owner_state"` \| `"instance_deleted"` \| `"release_app_mismatch"` \| `"state_schema_migration_unsupported"` \| `"instance_inactive"` \| `"instance_authority_version_mismatch"` \| `"release_no_longer_matches_instance"` \| `"instance_release_mismatch"` \| `"installation_tenant_mismatch"` |
34
- | `options?` | `ErrorOptions` |
31
+ | Parameter | Type |
32
+ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `code` | \| `"disabled"` \| `"stale_authority"` \| `"invalid_owner_state"` \| `"invalid_invocation_facts"` \| `"revoked"` \| `"binding_not_granted"` \| `"binding_unavailable"` \| `"expired"` \| `"reentrant"` \| `"instance_identity_mismatch"` \| `"instance_owner_mismatch"` \| `"conflicting_owner_state"` \| `"instance_deleted"` \| `"release_app_mismatch"` \| `"state_schema_migration_unsupported"` \| `"instance_inactive"` \| `"instance_authority_version_mismatch"` \| `"release_no_longer_matches_instance"` \| `"instance_release_mismatch"` \| `"installation_tenant_mismatch"` \| `"backend_load_failed"` \| `"backend_construction_failed"` \| `"ui_mount_failed"` \| `"boot_runner_unavailable"` \| `"boot_browser_binding_missing"` \| `"boot_clone_unavailable"` \| `"boot_timeout"` \| `"boot_cleanup_failed"` |
34
+ | `options?` | `ErrorOptions` |
35
35
 
36
36
  ###### Returns
37
37
 
@@ -61,6 +61,7 @@ Error.name;
61
61
 
62
62
  ```ts
63
63
  readonly code:
64
+ | "disabled"
64
65
  | "stale_authority"
65
66
  | "invalid_owner_state"
66
67
  | "invalid_invocation_facts"
@@ -79,18 +80,63 @@ readonly code:
79
80
  | "instance_authority_version_mismatch"
80
81
  | "release_no_longer_matches_instance"
81
82
  | "instance_release_mismatch"
82
- | "installation_tenant_mismatch";
83
+ | "installation_tenant_mismatch"
84
+ | "backend_load_failed"
85
+ | "backend_construction_failed"
86
+ | "ui_mount_failed"
87
+ | "boot_runner_unavailable"
88
+ | "boot_browser_binding_missing"
89
+ | "boot_clone_unavailable"
90
+ | "boot_timeout"
91
+ | "boot_cleanup_failed";
83
92
  ```
84
93
 
85
94
  ## Type Aliases
86
95
 
87
- ### InstanceId
96
+ ### AgentAvatarStore
88
97
 
89
98
  ```ts
90
- type InstanceId = CairnId<"app-instance", "instance">;
99
+ type AgentAvatarStore = Readonly<{
100
+ read: {
101
+ v: z.ZodLiteral<1>;
102
+ character: z.ZodEnum<{
103
+ mushroom: "mushroom";
104
+ cat: "cat";
105
+ burger: "burger";
106
+ }>;
107
+ appearance: z.ZodRecord<
108
+ z.ZodString,
109
+ z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>
110
+ >;
111
+ expression: z.ZodString;
112
+ renderStyle: z.ZodEnum<{
113
+ plain: "plain";
114
+ pencil: "pencil";
115
+ manga: "manga";
116
+ riso: "riso";
117
+ halftone: "halftone";
118
+ blueprint: "blueprint";
119
+ crt: "crt";
120
+ watercolor: "watercolor";
121
+ }>;
122
+ };
123
+ write: void;
124
+ remove: void;
125
+ }>;
91
126
  ```
92
127
 
93
- A stable App Instance ID minted by [instanceIds](#instanceids).
128
+ One owner-local store of chosen Agent avatars.
129
+
130
+ ---
131
+
132
+ ### UiBootCheckOutcome
133
+
134
+ ```ts
135
+ type UiBootCheckOutcome = z.output<typeof uiBootCheckOutcomeSchema>;
136
+ ```
137
+
138
+ A UI check result recorded on an installation operation, never installation
139
+ authority.
94
140
 
95
141
  ---
96
142
 
@@ -182,7 +228,12 @@ type InstancePorts<Host> = Readonly<{
182
228
  read: () => Effect.Effect<Instance | null, Error>;
183
229
  write: (instance) => Effect.Effect<void, Error>;
184
230
  resolve: (release, scope) => Effect.Effect<Backend, Error>;
185
- abort: () => Effect.Effect<void, Error>;
231
+ boot: (
232
+ backend,
233
+ priorStateSchema,
234
+ uiCheck,
235
+ ) => Effect.Effect<UiBootCheckOutcome | null, Error>;
236
+ abort: (reason) => Effect.Effect<void, Error>;
186
237
  purge: () => Effect.Effect<void, Error>;
187
238
  connect: (backend, frame) => Effect.Effect<AppBackendConnection, Error>;
188
239
  }>;
@@ -220,6 +271,7 @@ One admitted connection to a running App backend.
220
271
  ```ts
221
272
  type AppInstance<Host> = Readonly<{
222
273
  apply: (input) => Effect.Effect<Instance, Error>;
274
+ prepare: (input) => Effect.Effect<UiBootCheckOutcome | null, Error>;
223
275
  fetch: (frame, request) => Effect.Effect<Response, Error>;
224
276
  call: (frame, api, name, input) => Effect.Effect<AppMethodReply, Error>;
225
277
  gill: (frame, api, source, input) => Effect.Effect<GillReply, Error>;
@@ -238,28 +290,196 @@ The lifecycle and admission operations of one App Instance.
238
290
  | -------------- |
239
291
  | `Host` |
240
292
 
293
+ ---
294
+
295
+ ### InstanceId
296
+
297
+ ```ts
298
+ type InstanceId = CairnId<"app-instance", "instance">;
299
+ ```
300
+
301
+ A stable App Instance ID minted by [instanceIds](#instanceids).
302
+
241
303
  ## Variables
242
304
 
243
- ### instanceIds
305
+ ### agentAvatarSchema
244
306
 
245
307
  ```ts
246
- const instanceIds: Readonly<{
247
- instance: IdCodec<"app-instance", "instance", 1>;
248
- }>;
308
+ const agentAvatarSchema: ZodObject<
309
+ {
310
+ v: ZodLiteral<1>;
311
+ character: ZodEnum<{
312
+ mushroom: "mushroom";
313
+ cat: "cat";
314
+ burger: "burger";
315
+ }>;
316
+ appearance: ZodRecord<
317
+ ZodString,
318
+ ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>
319
+ >;
320
+ expression: ZodString;
321
+ renderStyle: ZodEnum<{
322
+ plain: "plain";
323
+ pencil: "pencil";
324
+ manga: "manga";
325
+ riso: "riso";
326
+ halftone: "halftone";
327
+ blueprint: "blueprint";
328
+ crt: "crt";
329
+ watercolor: "watercolor";
330
+ }>;
331
+ },
332
+ $strict
333
+ > = avatarSchema;
249
334
  ```
250
335
 
251
- The Cairn ID family that mints and recognizes App Instance IDs (`instance_…`).
336
+ The catalog-valid avatar an owner may choose for an Agent.
252
337
 
253
338
  ---
254
339
 
255
- ### instanceIdSchema
340
+ ### agentAvatarProjectionSchema
256
341
 
257
342
  ```ts
258
- const instanceIdSchema: Schema.Codec<InstanceId, string>;
343
+ const agentAvatarProjectionSchema: ZodDiscriminatedUnion<
344
+ [
345
+ ZodObject<
346
+ {
347
+ v: ZodLiteral<1>;
348
+ character: ZodLiteral<"mushroom">;
349
+ appearance: ZodObject<
350
+ {
351
+ [key: string]: ZodOptional<
352
+ ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>
353
+ >;
354
+ },
355
+ $strict
356
+ >;
357
+ expression: ZodString;
358
+ renderStyle: ZodEnum<{
359
+ plain: "plain";
360
+ pencil: "pencil";
361
+ manga: "manga";
362
+ riso: "riso";
363
+ halftone: "halftone";
364
+ blueprint: "blueprint";
365
+ crt: "crt";
366
+ watercolor: "watercolor";
367
+ }>;
368
+ },
369
+ $strict
370
+ >,
371
+ ZodObject<
372
+ {
373
+ v: ZodLiteral<1>;
374
+ character: ZodLiteral<"cat">;
375
+ appearance: ZodObject<
376
+ {
377
+ [key: string]: ZodOptional<
378
+ ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>
379
+ >;
380
+ },
381
+ $strict
382
+ >;
383
+ expression: ZodString;
384
+ renderStyle: ZodEnum<{
385
+ plain: "plain";
386
+ pencil: "pencil";
387
+ manga: "manga";
388
+ riso: "riso";
389
+ halftone: "halftone";
390
+ blueprint: "blueprint";
391
+ crt: "crt";
392
+ watercolor: "watercolor";
393
+ }>;
394
+ },
395
+ $strict
396
+ >,
397
+ ZodObject<
398
+ {
399
+ v: ZodLiteral<1>;
400
+ character: ZodLiteral<"burger">;
401
+ appearance: ZodObject<
402
+ {
403
+ [key: string]: ZodOptional<
404
+ ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>
405
+ >;
406
+ },
407
+ $strict
408
+ >;
409
+ expression: ZodString;
410
+ renderStyle: ZodEnum<{
411
+ plain: "plain";
412
+ pencil: "pencil";
413
+ manga: "manga";
414
+ riso: "riso";
415
+ halftone: "halftone";
416
+ blueprint: "blueprint";
417
+ crt: "crt";
418
+ watercolor: "watercolor";
419
+ }>;
420
+ },
421
+ $strict
422
+ >,
423
+ ],
424
+ "character"
425
+ >;
259
426
  ```
260
427
 
261
- Decodes a string into an [InstanceId](#instanceid), rejecting any other ID
262
- family.
428
+ The avatar as a closed record, for contracts that refuse open maps (Hub
429
+ projections): each character's appearance names only its own controls, then the
430
+ catalog refines it exactly as `agentAvatarSchema` does.
431
+
432
+ ---
433
+
434
+ ### uiBootCheckOutcomeSchema
435
+
436
+ ```ts
437
+ const uiBootCheckOutcomeSchema: ZodDiscriminatedUnion<[ZodObject<{
438
+ kind: ZodLiteral<"passed">;
439
+ }, $strict>, ZodObject<{
440
+ kind: ZodLiteral<"failed">;
441
+ code: ZodLiteral<"ui_mount_failed">;
442
+ diagnostics: ZodOptional<ZodObject<{
443
+ failedPredicate: ZodEnum<{
444
+ unexpected_candidate_request: "unexpected_candidate_request";
445
+ response_status: "response_status";
446
+ request_failed: "request_failed";
447
+ page_error: "page_error";
448
+ candidate_not_mounted: "candidate_not_mounted";
449
+ }>;
450
+ errorName: ZodOptional<ZodEnum<{
451
+ TypeError: "TypeError";
452
+ RangeError: "RangeError";
453
+ SyntaxError: "SyntaxError";
454
+ AbortError: "AbortError";
455
+ TimeoutError: "TimeoutError";
456
+ Other: "Other";
457
+ Error: "Error";
458
+ }>>;
459
+ finalUrlPath: ZodString;
460
+ consoleErrors: ZodArray<ZodPipe<ZodPipe<ZodString, ZodTransform<..., ...>>, ZodString>>;
461
+ pageErrors: ZodArray<ZodPipe<ZodPipe<ZodString, ZodTransform<..., ...>>, ZodString>>;
462
+ failedRequests: ZodArray<ZodObject<{
463
+ path: ZodString;
464
+ status: ZodOptional<...>;
465
+ failureKind: ZodOptional<...>;
466
+ }, $strict>>;
467
+ droppedCount: ZodNumber;
468
+ }, $strict>>;
469
+ }, $strict>, ZodObject<{
470
+ kind: ZodLiteral<"not_checked">;
471
+ code: ZodEnum<{
472
+ boot_runner_unavailable: "boot_runner_unavailable";
473
+ boot_browser_binding_missing: "boot_browser_binding_missing";
474
+ boot_clone_unavailable: "boot_clone_unavailable";
475
+ boot_timeout: "boot_timeout";
476
+ boot_cleanup_failed: "boot_cleanup_failed";
477
+ ui_check_not_run_on_host: "ui_check_not_run_on_host";
478
+ }>;
479
+ }, $strict>], "kind">;
480
+ ```
481
+
482
+ A UI check recorded on an installation operation, never installation authority.
263
483
 
264
484
  ---
265
485
 
@@ -349,6 +569,7 @@ const appInstanceErrorCodeSchema: Literals<
349
569
  "invalid_owner_state",
350
570
  "invalid_invocation_facts",
351
571
  "revoked",
572
+ "disabled",
352
573
  "binding_not_granted",
353
574
  "binding_unavailable",
354
575
  "expired",
@@ -365,14 +586,95 @@ const appInstanceErrorCodeSchema: Literals<
365
586
  "release_no_longer_matches_instance",
366
587
  "instance_release_mismatch",
367
588
  "installation_tenant_mismatch",
589
+ (
590
+ | "backend_load_failed"
591
+ | "backend_construction_failed"
592
+ | "ui_mount_failed"
593
+ | "boot_runner_unavailable"
594
+ | "boot_browser_binding_missing"
595
+ | "boot_clone_unavailable"
596
+ | "boot_timeout"
597
+ | "boot_cleanup_failed"
598
+ ),
368
599
  ]
369
600
  >;
370
601
  ```
371
602
 
372
603
  The runtime owns the bounded rejection grammar, including across RPC.
373
604
 
605
+ ---
606
+
607
+ ### instanceIds
608
+
609
+ ```ts
610
+ const instanceIds: Readonly<{
611
+ instance: IdCodec<"app-instance", "instance", 1>;
612
+ }>;
613
+ ```
614
+
615
+ The Cairn ID family that mints and recognizes App Instance IDs (`instance_…`).
616
+
617
+ ---
618
+
619
+ ### instanceIdSchema
620
+
621
+ ```ts
622
+ const instanceIdSchema: Schema.Codec<InstanceId, string>;
623
+ ```
624
+
625
+ Decodes a string into an [InstanceId](#instanceid), rejecting any other ID
626
+ family.
627
+
374
628
  ## Functions
375
629
 
630
+ ### avatarFromProjection()
631
+
632
+ ```ts
633
+ function avatarFromProjection(projected): object;
634
+ ```
635
+
636
+ A projected avatar as the Avatar descriptor Sprite draws.
637
+
638
+ #### Parameters
639
+
640
+ | Parameter | Type |
641
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
642
+ | `projected` | \| \{ `v`: `1`; `character`: `"mushroom"`; `appearance`: `Record`\<`string`, `string` \| `number` \| `boolean` \| `undefined`\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \} \| \{ `v`: `1`; `character`: `"cat"`; `appearance`: `Record`\<`string`, `string` \| `number` \| `boolean` \| `undefined`\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \} \| \{ `v`: `1`; `character`: `"burger"`; `appearance`: `Record`\<`string`, `string` \| `number` \| `boolean` \| `undefined`\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \} |
643
+
644
+ #### Returns
645
+
646
+ `object`
647
+
648
+ | Name | Type |
649
+ | ------------- | ----------------------------------------------------------------------------------------------------------------- |
650
+ | `v` | `1` |
651
+ | `character` | `"mushroom"` \| `"cat"` \| `"burger"` |
652
+ | `appearance` | `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly \[`z.ZodString`, `z.ZodNumber`, `z.ZodBoolean`\]\>\> |
653
+ | `expression` | `string` |
654
+ | `renderStyle` | \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"` |
655
+
656
+ ---
657
+
658
+ ### createAgentAvatarStore()
659
+
660
+ ```ts
661
+ function createAgentAvatarStore(sql): AgentAvatarStore;
662
+ ```
663
+
664
+ Open the chosen-avatar table in the Agent directory's own SQLite.
665
+
666
+ #### Parameters
667
+
668
+ | Parameter | Type |
669
+ | --------- | ----------------------------------------------------------------------------------- |
670
+ | `sql` | `Readonly`\<\{ `exec`: (`statement`, ...`bindings`) => `WatchdogSqliteCursor`; \}\> |
671
+
672
+ #### Returns
673
+
674
+ [`AgentAvatarStore`](#agentavatarstore)
675
+
676
+ ---
677
+
376
678
  ### selectionOf()
377
679
 
378
680
  ```ts
package/docs/api/keys.md CHANGED
@@ -13,7 +13,8 @@
13
13
  ### OysterKeyCapability
14
14
 
15
15
  ```ts
16
- type OysterKeyCapability = "apps.read" | "apps.use" | "computer.use";
16
+ type OysterKeyCapability =
17
+ "apps.read" | "apps.use" | "computer.use" | "machine.enroll";
17
18
  ```
18
19
 
19
20
  Every capability an Oyster key may carry.
@@ -87,6 +88,8 @@ const oysterKeyVocabulary: GrantVocabulary<OysterKeyCapability>;
87
88
  `apps.use` also reaches `apps.read` (one level, per `defineGrants`'s own
88
89
  `implies`): a key that may change an App's data may also read it. `computer.use`
89
90
  has no narrower capability under it; the Computer is on or off, host-wide.
91
+ `machine.enroll` admits enrollment only; it implies no App or Computer access.
92
+ The enrollment owner, not this vocabulary, owns one-use consumption.
90
93
 
91
94
  ---
92
95
 
@@ -173,3 +176,23 @@ Whether a live key's own grants turn its Computer access on. Off by default.
173
176
  #### Returns
174
177
 
175
178
  `boolean`
179
+
180
+ ---
181
+
182
+ ### keyAllowsMachineEnroll()
183
+
184
+ ```ts
185
+ function keyAllowsMachineEnroll(key): boolean;
186
+ ```
187
+
188
+ Whether a live key's grants permit a one-use device enrollment.
189
+
190
+ #### Parameters
191
+
192
+ | Parameter | Type |
193
+ | --------- | --------------------------------- |
194
+ | `key` | [`LiveOysterKey`](#liveoysterkey) |
195
+
196
+ #### Returns
197
+
198
+ `boolean`