@fungi.computer/oyster 0.5.0 → 0.7.0

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 (185) hide show
  1. package/README.md +155 -63
  2. package/dist/agent-archive-projection.d.ts +8 -0
  3. package/dist/agent-archive-projection.js +49 -0
  4. package/dist/agent-schedules.d.ts +50 -0
  5. package/dist/agent-schedules.js +17 -0
  6. package/dist/agents.d.ts +35 -14
  7. package/dist/agents.js +97 -144
  8. package/dist/app-builds.d.ts +7 -2
  9. package/dist/app-builds.js +19 -2
  10. package/dist/approval-capability.d.ts +1 -1
  11. package/dist/approval-capability.js +11 -16
  12. package/dist/approval-home.d.ts +2 -1
  13. package/dist/approval-home.js +5 -3
  14. package/dist/apps/catalog.js +1 -1
  15. package/dist/apps/gate.d.ts +4 -7
  16. package/dist/apps/gate.js +14 -29
  17. package/dist/apps/index.d.ts +1 -1
  18. package/dist/apps/installation.d.ts +4 -42
  19. package/dist/apps/installation.js +7 -75
  20. package/dist/apps/operations.js +0 -10
  21. package/dist/apps/permissions.d.ts +18 -8
  22. package/dist/apps/permissions.js +7 -1
  23. package/dist/auth.js +9 -1
  24. package/dist/authorization.d.ts +307 -0
  25. package/dist/authorization.js +542 -0
  26. package/dist/boot-host-script.js +1 -1
  27. package/dist/build/build-jobs.d.ts +2 -2
  28. package/dist/build/candidate-builder.d.ts +2 -0
  29. package/dist/build/candidate-builder.js +5 -1
  30. package/dist/build/candidate-cli.js +3 -0
  31. package/dist/build/candidate-cli.mjs +67 -22
  32. package/dist/build/job-log.d.ts +23 -0
  33. package/dist/build/job-log.js +88 -0
  34. package/dist/build/local-build.d.ts +2 -0
  35. package/dist/build/local-build.js +11 -9
  36. package/dist/channels/binding.d.ts +8 -1
  37. package/dist/channels/binding.js +12 -0
  38. package/dist/channels/conversations.d.ts +16 -5
  39. package/dist/channels/visitor-channel.d.ts +53 -0
  40. package/dist/channels/visitor-channel.js +124 -0
  41. package/dist/channels/visitor-edge.d.ts +115 -0
  42. package/dist/channels/visitor-edge.js +582 -0
  43. package/dist/channels/visitor-request.d.ts +7 -0
  44. package/dist/channels/visitor-request.js +17 -0
  45. package/dist/channels/visitor-stream-slots.d.ts +2 -0
  46. package/dist/channels/visitor-stream-slots.js +33 -0
  47. package/dist/channels/visitors.d.ts +47 -0
  48. package/dist/channels/visitors.js +181 -0
  49. package/dist/cloudflare.d.ts +11 -2
  50. package/dist/cloudflare.js +27 -1
  51. package/dist/{page/computer-target.d.ts → computer-target.d.ts} +2 -0
  52. package/dist/{page/computer-target.js → computer-target.js} +3 -1
  53. package/dist/files.js +9 -8
  54. package/dist/git-admission.d.ts +3 -3
  55. package/dist/git-admission.js +4 -6
  56. package/dist/git-door.d.ts +8 -7
  57. package/dist/git-door.js +18 -17
  58. package/dist/git.d.ts +1 -1
  59. package/dist/host.d.ts +38 -42
  60. package/dist/host.js +182 -239
  61. package/dist/installation-execution.js +10 -5
  62. package/dist/installation-operations.d.ts +4 -180
  63. package/dist/installation-operations.js +1 -5
  64. package/dist/installation-store-generation.d.ts +4 -1
  65. package/dist/installation-store-generation.js +59 -6
  66. package/dist/internal/delivery.js +0 -1
  67. package/dist/internal/host-gate.d.ts +9 -6
  68. package/dist/internal/host-gate.js +19 -25
  69. package/dist/internal/invocation-timing.d.ts +16 -0
  70. package/dist/internal/invocation-timing.js +23 -0
  71. package/dist/internal/registry-installations.js +1 -0
  72. package/dist/invocation.d.ts +19 -11
  73. package/dist/invocation.js +171 -96
  74. package/dist/keys.d.ts +2 -19
  75. package/dist/keys.js +1 -37
  76. package/dist/mcp.d.ts +15 -27
  77. package/dist/mcp.js +105 -155
  78. package/dist/page/agent-browser.d.ts +15 -0
  79. package/dist/page/agent-browser.js +162 -0
  80. package/dist/page/app-permissions-port.d.ts +3 -0
  81. package/dist/page/app-permissions-port.js +43 -0
  82. package/dist/page/app-permissions.d.ts +11 -0
  83. package/dist/page/app-permissions.js +296 -0
  84. package/dist/page/capabilities.js +1 -1
  85. package/dist/page/child-selection.d.ts +27 -0
  86. package/dist/page/child-selection.js +38 -0
  87. package/dist/page/isolated-page-theme.d.ts +2 -0
  88. package/dist/page/isolated-page-theme.js +11 -0
  89. package/dist/page/mount.d.ts +2 -13
  90. package/dist/page/mount.js +8 -94
  91. package/dist/page-script.d.ts +0 -3
  92. package/dist/page-script.js +3 -4
  93. package/dist/release.d.ts +13 -0
  94. package/dist/release.js +10 -0
  95. package/dist/request-origin.d.ts +4 -0
  96. package/dist/request-origin.js +10 -0
  97. package/dist/standalone/agent-archive-owner.d.ts +42 -0
  98. package/dist/standalone/agent-archive-owner.js +116 -0
  99. package/dist/standalone/agent-archive-schedules.d.ts +6 -0
  100. package/dist/standalone/agent-archive-schedules.js +76 -0
  101. package/dist/standalone/agent-archive.d.ts +31 -0
  102. package/dist/standalone/agent-archive.js +67 -0
  103. package/dist/standalone/agent-computers.d.ts +7 -6
  104. package/dist/standalone/agent-computers.js +4 -7
  105. package/dist/standalone/agent-mail.d.ts +2 -2
  106. package/dist/standalone/agents.d.ts +157 -20
  107. package/dist/standalone/agents.js +242 -38
  108. package/dist/standalone/app-builds-binding.js +1 -1
  109. package/dist/standalone/app-set.js +2 -54
  110. package/dist/standalone/app-source.d.ts +3 -4
  111. package/dist/standalone/app-source.js +12 -9
  112. package/dist/standalone/builds.d.ts +2 -14
  113. package/dist/standalone/builds.js +15 -13
  114. package/dist/standalone/computer-fleet.d.ts +4 -4
  115. package/dist/standalone/computer-fleet.js +20 -43
  116. package/dist/standalone/computer.d.ts +4 -3
  117. package/dist/standalone/computer.js +52 -53
  118. package/dist/standalone/dashboard-approval.d.ts +10 -0
  119. package/dist/standalone/dashboard-approval.js +66 -0
  120. package/dist/standalone/machine-link.d.ts +4 -221
  121. package/dist/standalone/machine-link.js +21 -15
  122. package/dist/standalone/media.d.ts +1 -0
  123. package/dist/standalone/media.js +20 -14
  124. package/dist/standalone/owner-routes.d.ts +16 -0
  125. package/dist/standalone/owner-routes.js +21 -0
  126. package/dist/standalone/permission-resources.d.ts +5 -0
  127. package/dist/standalone/permission-resources.js +31 -0
  128. package/dist/standalone/registry.d.ts +7 -0
  129. package/dist/standalone/registry.js +3 -0
  130. package/dist/standalone/tenancy.js +3 -1
  131. package/dist/standalone/worker-routes.d.ts +19 -0
  132. package/dist/standalone/worker-routes.js +9 -0
  133. package/dist/standalone/worker.d.ts +1 -1
  134. package/dist/standalone/worker.js +27 -35
  135. package/dist/standalone/workflow-binding.d.ts +8 -3
  136. package/dist/standalone/workflow-binding.js +14 -5
  137. package/dist/standalone/workflow-git-capture.js +2 -1
  138. package/dist/standalone/workflow-host.d.ts +8 -103
  139. package/dist/standalone/workflow-host.js +1 -1
  140. package/dist/standalone/workflow-node-capture.js +2 -2
  141. package/dist/standalone/workflow-root-authority.d.ts +1 -1
  142. package/dist/standalone/workflow-root-authority.js +1 -1
  143. package/dist/standalone/workflow-schedules.d.ts +14 -5
  144. package/dist/standalone/workflow-schedules.js +11 -5
  145. package/dist/standalone/workflow-webhooks.d.ts +4 -18
  146. package/dist/standalone/workflow-webhooks.js +5 -5
  147. package/dist/standalone/workflows.d.ts +36 -28
  148. package/dist/standalone/workflows.js +6 -3
  149. package/dist/storage-frame.d.ts +6 -6
  150. package/dist/testing/capabilities.d.ts +7 -6
  151. package/dist/testing/capabilities.js +3 -6
  152. package/dist/testing/installation.d.ts +0 -1
  153. package/dist/testing/installation.js +2 -5
  154. package/dist/turnstile.d.ts +27 -0
  155. package/dist/turnstile.js +51 -0
  156. package/dist/workers-git.d.ts +12 -4
  157. package/dist/workers-git.js +58 -36
  158. package/dist/workers.d.ts +9 -1
  159. package/dist/workers.js +59 -20
  160. package/dist/workflows.d.ts +2 -0
  161. package/dist/workflows.js +1 -0
  162. package/docs/api/README.md +7 -0
  163. package/docs/api/agent-schedules.md +175 -0
  164. package/docs/api/agents.md +34 -13
  165. package/docs/api/app-storage.md +1 -1
  166. package/docs/api/apps.md +323 -225
  167. package/docs/api/authorization.md +1300 -0
  168. package/docs/api/build-contract.md +2 -2
  169. package/docs/api/build.md +40 -37
  170. package/docs/api/cloudflare.md +27 -2
  171. package/docs/api/git.md +20 -11
  172. package/docs/api/host.md +80 -199
  173. package/docs/api/index.md +1 -1
  174. package/docs/api/invocation.md +15 -11
  175. package/docs/api/keys.md +1 -98
  176. package/docs/api/mcp.md +43 -40
  177. package/docs/api/modules.md +2 -0
  178. package/docs/api/page/mount.md +16 -19
  179. package/docs/api/workers-git.md +46 -12
  180. package/docs/api/workers.md +125 -235
  181. package/docs/site/agent-quickstart.mdx +6 -2
  182. package/examples/standalone/wrangler.celld.jsonc +66 -0
  183. package/package.json +64 -21
  184. package/dist/standalone/channel-session-door.d.ts +0 -4
  185. package/dist/standalone/channel-session-door.js +0 -42
@@ -31,6 +31,7 @@ type FrameBindingMethod<Result> = Readonly<{
31
31
  decodeArgs: (raw) => readonly unknown[];
32
32
  decodeResult: z.ZodType<Result>["parse"];
33
33
  requiredOperations: (args) => readonly string[];
34
+ requestedResource?: (args) => ResourceRef;
34
35
  }>;
35
36
  ```
36
37
 
@@ -305,6 +306,30 @@ frame or guestEnv factory is accepted.
305
306
 
306
307
  ---
307
308
 
309
+ ### edgeVerifiedObjectCache()
310
+
311
+ ```ts
312
+ function edgeVerifiedObjectCache(cache, origin): VerifiedObjectCache;
313
+ ```
314
+
315
+ The zone's edge cache as a [VerifiedObjectCache](host.md#verifiedobjectcache):
316
+ each verified object under a digest-named key on `origin` that no route serves.
317
+ A failed write is logged and answers `unstored`; the next reader verifies from
318
+ the store again.
319
+
320
+ #### Parameters
321
+
322
+ | Parameter | Type |
323
+ | --------- | --------------------------------------- |
324
+ | `cache` | `Pick`\<`Cache`, `"match"` \| `"put"`\> |
325
+ | `origin` | `string` |
326
+
327
+ #### Returns
328
+
329
+ [`VerifiedObjectCache`](host.md#verifiedobjectcache)
330
+
331
+ ---
332
+
308
333
  ### r2ArtifactStore()
309
334
 
310
335
  ```ts
@@ -435,7 +460,7 @@ function createCloudflareInvocationGate<Host, FacetClass>(
435
460
  ): InvocationGate<Host>;
436
461
  ```
437
462
 
438
- End the native App facet before shared frame admission releases its permit.
463
+ Stop the shared native App facet at cohort drain or revocation.
439
464
 
440
465
  #### Type Parameters
441
466
 
@@ -492,7 +517,7 @@ Guest code gets only host gatekeeper bindings and no ambient outbound access.
492
517
  | `loader` | \| `Readonly`\<\{ `get`: (`id`, `configure`) => `Readonly`\<\{ `getDurableObjectClass`: (`exportName`) => `FacetClass`; \}\>; \}\> \| `undefined` | The Worker Loader binding; without it backend execution is unavailable. |
493
518
  | `resolve` | (`release`, `scope`) => `Effect`\<`Readonly`\<\{ `release`: `Release`; `digest`: `Sha256Digest`; `backend`: `DurableBackend`; \}\>, `Error`\> | Resolves a Release ID to its verified durable backend. |
494
519
  | `guestEnv` | (`frame`) => `object` | Mints loopbacks bound to the captured invocation frame. |
495
- | `bootUi` | (`release`) => `Promise`\< \| \{ `kind`: `"passed"`; \} \| \{ `kind`: `"failed"`; `code`: `"ui_mount_failed"`; `diagnostics?`: \{ `failedPredicate`: \| `"unexpected_candidate_request"` \| `"response_status"` \| `"request_failed"` \| `"page_error"` \| `"candidate_not_mounted"`; `errorName?`: \| `"TypeError"` \| `"RangeError"` \| `"SyntaxError"` \| `"AbortError"` \| `"TimeoutError"` \| `"Other"` \| `"Error"`; `finalUrlPath`: `string`; `consoleErrors`: `string`[]; `pageErrors`: `string`[]; `failedRequests`: `object`[]; `droppedCount`: `number`; \}; \} \| \{ `kind`: `"not_checked"`; `code`: \| `"boot_runner_unavailable"` \| `"boot_browser_binding_missing"` \| `"boot_clone_unavailable"` \| `"boot_timeout"` \| `"boot_cleanup_failed"` \| `"ui_check_not_run_on_host"`; \} \| `null`\> | Host-owned UI check, or `null` when this executor deliberately skips it (for example, after the signed host already checked). |
520
+ | `bootUi` | (`release`) => `Promise`\< \| \{ `kind`: `"passed"`; \} \| \{ `kind`: `"failed"`; `code`: `"ui_mount_failed"`; `diagnostics?`: \{ `failedPredicate`: \| `"unexpected_candidate_request"` \| `"response_status"` \| `"request_failed"` \| `"page_error"` \| `"candidate_not_mounted"`; `errorName?`: \| `"Error"` \| `"TypeError"` \| `"RangeError"` \| `"SyntaxError"` \| `"AbortError"` \| `"TimeoutError"` \| `"Other"`; `finalUrlPath`: `string`; `consoleErrors`: `string`[]; `pageErrors`: `string`[]; `failedRequests`: `object`[]; `droppedCount`: `number`; \}; \} \| \{ `kind`: `"not_checked"`; `code`: \| `"boot_runner_unavailable"` \| `"boot_browser_binding_missing"` \| `"boot_clone_unavailable"` \| `"boot_timeout"` \| `"boot_cleanup_failed"` \| `"ui_check_not_run_on_host"`; \} \| `null`\> | Host-owned UI check, or `null` when this executor deliberately skips it (for example, after the signed host already checked). |
496
521
  | `limits?` | `Partial`\<`Readonly`\<\{ `cpuMs`: `number`; `subRequests`: `number`; \}\>\> | Guest CPU and subrequest budgets; omitted fields use safe defaults. |
497
522
  | `onAbort?` | (`reason`) => `Promise`\<`void`\> | Close the host's existing invocation frame after its state is fenced. |
498
523
 
package/docs/api/git.md CHANGED
@@ -29,8 +29,7 @@ type GitGrants = Readonly<{
29
29
  }>;
30
30
  ```
31
31
 
32
- Live host authority, reopened before every provider call. Null is an anonymous
33
- reader.
32
+ Live host authority, reopened before every provider call.
34
33
 
35
34
  ---
36
35
 
@@ -129,7 +128,6 @@ type GitDoorHost = Readonly<{
129
128
  workflow?: WorkflowAttestation & object;
130
129
  }>
131
130
  | null>;
132
- isPublic: Promise<boolean>;
133
131
  git: Promise<
134
132
  | Readonly<{
135
133
  push: Promise<Readonly<{
@@ -152,6 +150,18 @@ Identity and selected installation come only from host-held ports.
152
150
 
153
151
  ---
154
152
 
153
+ ### GitDoor
154
+
155
+ ```ts
156
+ type GitDoor = Readonly<{
157
+ fetch: (request) => Promise<Response>;
158
+ }>;
159
+ ```
160
+
161
+ One smart-HTTP exchange's answer; the host declares the route it serves at.
162
+
163
+ ---
164
+
155
165
  ### GitPushJournalPorts
156
166
 
157
167
  ```ts
@@ -207,9 +217,9 @@ storage.
207
217
 
208
218
  #### Parameters
209
219
 
210
- | Parameter | Type |
211
- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
212
- | `ports` | `Readonly`\<\{ `currentInstallation`: `Promise`\< \| `Readonly`\<\{ `installationId`: `string`; `instanceId`: [`InstanceId`](index.md#instanceid) \| `null`; `appId`: `AppId`; `release`: \{ `releaseId`: `Schema.refine`\<`ReleaseId`, `Schema.String`\>; `appId`: `Schema.refine`\<`AppId`, `Schema.String`\>; `artifact`: `Schema.Struct`\<\{ `artifactRef`: `Schema.refine`\<`ArtifactRef`, `Schema.String`\>; `artifactDigest`: `Schema.refine`\<`Sha256Digest`, `Schema.String`\>; `provenance`: `Schema.Struct`\<\{ `sourceRevision`: ...; `sourceTreeDigest`: ...; `buildRecipeDigest`: ...; \}\>; \}\>; \}; `releasePin`: `"pinned"` \| `"floating"`; `authority`: \{ `authorityVersion`: `number`; `declaredOperationsDigest`: `Sha256Digest`; `approvedGrants`: readonly `Readonly`\<\{ `capability`: \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ...; `capabilityApproved`: `true`; `operations`: readonly ...[]; `resources`: ... \| ...; \}\>[]; `approval`: \| `Readonly`\<\{ `by`: ... \| ... \| ...; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \}; `status`: `"enabled"` \| `"disabled"` \| `"deleted"`; `visibility`: `"private"` \| `"public"`; `approvedAnonymousMethods`: readonly `Readonly`\<\{ `name`: `string`; `digest`: `Sha256Digest`; \}\>[]; `anonymousApproval`: \| `Readonly`\<\{ `by`: \| \{ `kind`: ...; `memberId`: ...; \} \| \{ `kind`: ...; `agentId`: ...; \} \| \{ `kind`: ...; `keyId`: ...; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \}\> \| `null`\>; `declaration`: `Promise`\< \| `Readonly`\<\{ `api?`: `AppApi`; `displayName?`: `string`; `capabilities`: readonly `AppCapabilityId`[]; `calls?`: readonly `Readonly`\<\{ `appId`: ...; `methods`: ...; \}\>[]; `guidance?`: `string`; `handlers`: readonly `AppHandler`[]; `receives?`: readonly `"git.push"`[]; `icon?`: `string`; `roles`: readonly `AppRole`[]; `storage?`: readonly `AppStorageKey`[]; `commands?`: readonly `AppDeclaredCommand`[]; `gills?`: readonly `AppDeclaredGill`[]; `backend?`: `Readonly`\<\{ `bindings`: readonly ...[]; `sync?`: `Readonly`\<\{ `method`: ...; \}\>; \}\>; \}\> \| `null`\>; \}\> |
220
+ | Parameter | Type |
221
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
222
+ | `ports` | `Readonly`\<\{ `currentInstallation`: `Promise`\< \| `Readonly`\<\{ `installationId`: `string`; `instanceId`: [`InstanceId`](index.md#instanceid) \| `null`; `appId`: `AppId`; `release`: \{ `releaseId`: `Schema.refine`\<`ReleaseId`, `Schema.String`\>; `appId`: `Schema.refine`\<`AppId`, `Schema.String`\>; `artifact`: `Schema.Struct`\<\{ `artifactRef`: `Schema.refine`\<`ArtifactRef`, `Schema.String`\>; `artifactDigest`: `Schema.refine`\<`Sha256Digest`, `Schema.String`\>; `provenance`: `Schema.Struct`\<\{ `sourceRevision`: ...; `sourceTreeDigest`: ...; `buildRecipeDigest`: ...; \}\>; \}\>; \}; `releasePin`: `"pinned"` \| `"floating"`; `authority`: \{ `authorityVersion`: `number`; `declaredOperationsDigest`: `Sha256Digest`; `approvedGrants`: readonly `Readonly`\<\{ `capability`: \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ... \| ...; `capabilityApproved`: `true`; `operations`: readonly ...[]; `resources`: ... \| ...; \}\>[]; `approval`: \| `Readonly`\<\{ `by`: ... \| ... \| ...; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \}; `status`: `"enabled"` \| `"disabled"` \| `"deleted"`; \}\> \| `null`\>; `declaration`: `Promise`\< \| `Readonly`\<\{ `api?`: `AppApi`; `displayName?`: `string`; `capabilities`: readonly `AppCapabilityId`[]; `calls?`: readonly `Readonly`\<\{ `appId`: ...; `methods`: ...; \}\>[]; `guidance?`: `string`; `handlers`: readonly `AppHandler`[]; `receives?`: readonly `"git.push"`[]; `icon?`: `string`; `roles`: readonly `AppRole`[]; `storage?`: readonly `AppStorageKey`[]; `commands?`: readonly `AppDeclaredCommand`[]; `gills?`: readonly `AppDeclaredGill`[]; `backend?`: `Readonly`\<\{ `bindings`: readonly ...[]; `sync?`: `Readonly`\<\{ `method`: ...; \}\>; \}\>; \}\> \| `null`\>; \}\> |
213
223
 
214
224
  #### Returns
215
225
 
@@ -227,7 +237,7 @@ Reopen the host authority for this repository and requested scope.
227
237
 
228
238
  | Parameter | Type |
229
239
  | ------------ | --------------------- |
230
- | `writer` | `GitWriter` \| `null` |
240
+ | `writer` | `GitWriter` |
231
241
  | `repository` | `string` |
232
242
  | `scope` | `"read"` \| `"write"` |
233
243
 
@@ -328,11 +338,10 @@ null when it is not an exact Oyster Git exchange.
328
338
  ### createGitDoor()
329
339
 
330
340
  ```ts
331
- function createGitDoor(host): Hono;
341
+ function createGitDoor(host): GitDoor;
332
342
  ```
333
343
 
334
- Mount one smart-HTTP door with no provider credentials or alternate write
335
- branch.
344
+ One smart-HTTP door with no provider credentials or alternate write branch.
336
345
 
337
346
  #### Parameters
338
347
 
@@ -342,7 +351,7 @@ branch.
342
351
 
343
352
  #### Returns
344
353
 
345
- `Hono`
354
+ [`GitDoor`](#gitdoor)
346
355
 
347
356
  ---
348
357
 
package/docs/api/host.md CHANGED
@@ -98,32 +98,6 @@ A page descriptor carries routing, never the authority to use a capability.
98
98
 
99
99
  ---
100
100
 
101
- ### OysterVisitor
102
-
103
- ```ts
104
- type OysterVisitor = Readonly<{
105
- actor: Readonly<{
106
- kind: "visitor";
107
- }>;
108
- }>;
109
- ```
110
-
111
- The anonymous reader of a public installation. The host admits it only when
112
- authentication refuses; it reaches that App's page and its `read` methods.
113
-
114
- ---
115
-
116
- ### OysterPrincipal
117
-
118
- ```ts
119
- type OysterPrincipal = TenantPrincipal | OysterVisitor;
120
- ```
121
-
122
- Who an admitted request acts for: an authenticated tenant principal or the
123
- visitor.
124
-
125
- ---
126
-
127
101
  ### OysterAuthResult
128
102
 
129
103
  ```ts
@@ -181,6 +155,7 @@ type InstallationStore = InstallationReader &
181
155
  Readonly<{
182
156
  operations?: InstallationOperations;
183
157
  generation: () => Promise<string>;
158
+ resetAt?: () => Promise<number | null>;
184
159
  compareAndPut: (
185
160
  installation,
186
161
  expectedAuthorityVersion,
@@ -372,44 +347,21 @@ A capability adapter whose routes require live installation admission.
372
347
 
373
348
  ---
374
349
 
375
- ### OysterVariables
376
-
377
- ```ts
378
- type OysterVariables = object;
379
- ```
380
-
381
- What the host stamps once per request; inner routes read it with `c.get`.
382
-
383
- #### Properties
384
-
385
- ##### principal
386
-
387
- ```ts
388
- principal: OysterPrincipal;
389
- ```
390
-
391
- ##### installation?
392
-
393
- ```ts
394
- optional installation?: Installation;
395
- ```
396
-
397
- ---
398
-
399
350
  ### OysterEnv
400
351
 
401
352
  ```ts
402
353
  type OysterEnv = object;
403
354
  ```
404
355
 
405
- Owner routes run after the host's owner guard and read `c.get("principal")`.
356
+ The host table's Hono env; every route receives its principal from its declared
357
+ requirement.
406
358
 
407
359
  #### Properties
408
360
 
409
361
  ##### Variables
410
362
 
411
363
  ```ts
412
- Variables: OysterVariables;
364
+ Variables: TimingVariables;
413
365
  ```
414
366
 
415
367
  ---
@@ -470,9 +422,11 @@ type OysterHost = Readonly<{
470
422
  }
471
423
  | null>;
472
424
  computerControl?: (principal) => ComputerControlPort | null;
425
+ permissionResources?: (principal) => Promise<readonly ResourceOption[]>;
473
426
  auth: OysterAuth;
474
427
  backgroundOriginKey?: () => Promise<CryptoKey>;
475
428
  artifacts: ArtifactStore;
429
+ uiCache?: VerifiedObjectCache;
476
430
  installations: InstallationStore;
477
431
  instances: InstanceDirectory;
478
432
  bootUi: (release) => Promise<UiBootCheckOutcome>;
@@ -495,7 +449,7 @@ type OysterHost = Readonly<{
495
449
  guestLimits?: Partial<GuestLimits>;
496
450
  mcp?: OysterMcp;
497
451
  git?: OysterGitHost;
498
- ownerRoutes?: Hono<OysterEnv>;
452
+ ownerRoutes?: Routes<OysterEnv>;
499
453
  capabilities?: readonly OysterCapability[];
500
454
  workbench?: Readonly<{
501
455
  directory: Promise<Readonly<{
@@ -514,7 +468,6 @@ type OysterHost = Readonly<{
514
468
  pageScript?: string;
515
469
  pageAssets?: () => Promise<{
516
470
  pageScript: string;
517
- publicHomeScript: string;
518
471
  fontStyles: string;
519
472
  loginFontStyles: string;
520
473
  shellStyles: string;
@@ -528,6 +481,19 @@ Everything a host supplies to run Oyster.
528
481
 
529
482
  ---
530
483
 
484
+ ### OysterRouteTable
485
+
486
+ ```ts
487
+ type OysterRouteTable = Readonly<{
488
+ declarations: () => readonly RouteDeclaration[];
489
+ serve: () => ServedTable<OysterEnv>;
490
+ }>;
491
+ ```
492
+
493
+ One host's declared routes and the one way to serve them.
494
+
495
+ ---
496
+
531
497
  ### InstallationOperations
532
498
 
533
499
  ```ts
@@ -611,13 +577,13 @@ type InstallationOperations = Readonly<{
611
577
  | "request_failed"
612
578
  | "page_error"
613
579
  | "candidate_not_mounted";
614
- errorName?: | "TypeError"
580
+ errorName?: | "Error"
581
+ | "TypeError"
615
582
  | "RangeError"
616
583
  | "SyntaxError"
617
584
  | "AbortError"
618
585
  | "TimeoutError"
619
- | "Other"
620
- | "Error";
586
+ | "Other";
621
587
  finalUrlPath: string;
622
588
  consoleErrors: string[];
623
589
  pageErrors: string[];
@@ -666,17 +632,6 @@ type InstallationOperations = Readonly<{
666
632
  | null;
667
633
  };
668
634
  status: "enabled" | "disabled" | "deleted";
669
- visibility: "private" | "public";
670
- approvedAnonymousMethods: readonly Readonly<{
671
- name: string;
672
- digest: Sha256Digest;
673
- }>[];
674
- anonymousApproval: | Readonly<{
675
- by: ... | ... | ...;
676
- at: number;
677
- authorityVersion: number;
678
- }>
679
- | null;
680
635
  }
681
636
  | null;
682
637
  }
@@ -778,13 +733,13 @@ type InstallationOperations = Readonly<{
778
733
  | "request_failed"
779
734
  | "page_error"
780
735
  | "candidate_not_mounted";
781
- errorName?: | "TypeError"
736
+ errorName?: | "Error"
737
+ | "TypeError"
782
738
  | "RangeError"
783
739
  | "SyntaxError"
784
740
  | "AbortError"
785
741
  | "TimeoutError"
786
- | "Other"
787
- | "Error";
742
+ | "Other";
788
743
  finalUrlPath: string;
789
744
  consoleErrors: string[];
790
745
  pageErrors: string[];
@@ -833,17 +788,6 @@ type InstallationOperations = Readonly<{
833
788
  | null;
834
789
  };
835
790
  status: "enabled" | "disabled" | "deleted";
836
- visibility: "private" | "public";
837
- approvedAnonymousMethods: readonly Readonly<{
838
- name: string;
839
- digest: Sha256Digest;
840
- }>[];
841
- anonymousApproval: | Readonly<{
842
- by: ... | ... | ...;
843
- at: number;
844
- authorityVersion: number;
845
- }>
846
- | null;
847
791
  }
848
792
  | null;
849
793
  }
@@ -938,17 +882,6 @@ type InstallationOperations = Readonly<{
938
882
  | null;
939
883
  };
940
884
  status: "enabled" | "disabled" | "deleted";
941
- visibility: "private" | "public";
942
- approvedAnonymousMethods: readonly Readonly<{
943
- name: string;
944
- digest: Sha256Digest;
945
- }>[];
946
- anonymousApproval: | Readonly<{
947
- by: ... | ... | ...;
948
- at: number;
949
- authorityVersion: number;
950
- }>
951
- | null;
952
885
  }
953
886
  | null;
954
887
  acceptedAt: number;
@@ -975,17 +908,6 @@ type InstallationOperations = Readonly<{
975
908
  approval: Readonly<...> | null;
976
909
  };
977
910
  status: "enabled" | "disabled" | "deleted";
978
- visibility: "private" | "public";
979
- approvedAnonymousMethods: readonly Readonly<{
980
- name: ...;
981
- digest: ...;
982
- }>[];
983
- anonymousApproval: | Readonly<{
984
- by: ...;
985
- at: ...;
986
- authorityVersion: ...;
987
- }>
988
- | null;
989
911
  };
990
912
  hasBackend: boolean;
991
913
  prepared: boolean;
@@ -1140,28 +1062,6 @@ type InstallationOperations = Readonly<{
1140
1062
  | null;
1141
1063
  };
1142
1064
  status: "enabled" | "disabled" | "deleted";
1143
- visibility: "private" | "public";
1144
- approvedAnonymousMethods: readonly Readonly<{
1145
- name: string;
1146
- digest: Sha256Digest;
1147
- }>[];
1148
- anonymousApproval: | Readonly<{
1149
- by: | {
1150
- kind: ...;
1151
- memberId: ...;
1152
- }
1153
- | {
1154
- kind: ...;
1155
- agentId: ...;
1156
- }
1157
- | {
1158
- kind: ...;
1159
- keyId: ...;
1160
- };
1161
- at: number;
1162
- authorityVersion: number;
1163
- }>
1164
- | null;
1165
1065
  }
1166
1066
  | null;
1167
1067
  acceptedAt: number;
@@ -1198,17 +1098,6 @@ type InstallationOperations = Readonly<{
1198
1098
  | null;
1199
1099
  };
1200
1100
  status: "enabled" | "disabled" | "deleted";
1201
- visibility: "private" | "public";
1202
- approvedAnonymousMethods: readonly Readonly<{
1203
- name: string;
1204
- digest: Sha256Digest;
1205
- }>[];
1206
- anonymousApproval: | Readonly<{
1207
- by: ... | ... | ...;
1208
- at: number;
1209
- authorityVersion: number;
1210
- }>
1211
- | null;
1212
1101
  };
1213
1102
  hasBackend: boolean;
1214
1103
  prepared: boolean;
@@ -1309,6 +1198,21 @@ type VerifiedRelease = Readonly<{
1309
1198
 
1310
1199
  A Release whose root, UI and backend artifacts were read and verified.
1311
1200
 
1201
+ ---
1202
+
1203
+ ### VerifiedObjectCache
1204
+
1205
+ ```ts
1206
+ type VerifiedObjectCache = Readonly<{
1207
+ match: (digest) => Promise<ReadableStream<Uint8Array> | null>;
1208
+ put: (digest, bytes) => Promise<"stored" | "unstored">;
1209
+ }>;
1210
+ ```
1211
+
1212
+ Copies of verified artifacts near the reader, keyed by content digest. An entry
1213
+ holds only bytes that already matched its digest, so a hit is served without
1214
+ another store read or hash.
1215
+
1312
1216
  ## Variables
1313
1217
 
1314
1218
  ### capabilityMethodKindSchema
@@ -1421,53 +1325,6 @@ Default bounds for an App's UI asset build.
1421
1325
 
1422
1326
  ## Functions
1423
1327
 
1424
- ### oysterPrincipalIsVisitor()
1425
-
1426
- ```ts
1427
- function oysterPrincipalIsVisitor(
1428
- principal,
1429
- ): principal is Readonly<{ actor: Readonly<{ kind: "visitor" }> }>;
1430
- ```
1431
-
1432
- Narrow an admitted principal to the anonymous public reader.
1433
-
1434
- #### Parameters
1435
-
1436
- | Parameter | Type |
1437
- | ----------- | ------------------------------------- |
1438
- | `principal` | [`OysterPrincipal`](#oysterprincipal) |
1439
-
1440
- #### Returns
1441
-
1442
- `principal is Readonly<{ actor: Readonly<{ kind: "visitor" }> }>`
1443
-
1444
- ---
1445
-
1446
- ### oysterPrincipalIsOwner()
1447
-
1448
- ```ts
1449
- function oysterPrincipalIsOwner(
1450
- principal,
1451
- ): principal is Readonly<{
1452
- actor: { kind: "member"; memberId: string };
1453
- role: "owner";
1454
- }>;
1455
- ```
1456
-
1457
- True only for a member admitted with the owner role.
1458
-
1459
- #### Parameters
1460
-
1461
- | Parameter | Type |
1462
- | ----------- | ------------------------------------- |
1463
- | `principal` | [`OysterPrincipal`](#oysterprincipal) |
1464
-
1465
- #### Returns
1466
-
1467
- `principal is Readonly<{ actor: { kind: "member"; memberId: string }; role: "owner" }>`
1468
-
1469
- ---
1470
-
1471
1328
  ### oysterPrincipalId()
1472
1329
 
1473
1330
  ```ts
@@ -1512,9 +1369,9 @@ Completed selection, without re-deriving or executing outside Watchdog.
1512
1369
  | `host` | [`OysterHost`](#oysterhost) |
1513
1370
  | `installationId` | `string` |
1514
1371
  | `release` | `Release` |
1515
- | `principal` | [`OysterPrincipal`](#oysterprincipal) |
1372
+ | `principal` | [`TenantPrincipal`](tenant.md#tenantprincipal) |
1516
1373
  | `intent` | `"install-or-select"` \| `"install-or-remint"` \| `"create-only"` |
1517
- | `origin` | `"workflow"` \| `"owner-direct"` \| `"app"` |
1374
+ | `origin` | `"workflow"` \| `"app"` \| `"owner-direct"` |
1518
1375
  | `requestId` | `string` |
1519
1376
  | `signal` | `AbortSignal` |
1520
1377
 
@@ -1527,13 +1384,34 @@ Completed selection, without re-deriving or executing outside Watchdog.
1527
1384
  ### createOyster()
1528
1385
 
1529
1386
  ```ts
1530
- function createOyster(host): Hono<OysterEnv>;
1387
+ function createOyster(host): ServedTable<OysterEnv>;
1388
+ ```
1389
+
1390
+ Create the Oyster App server: a served route table that installs App Releases,
1391
+ serves their UI, forwards their backend requests and methods to their Instances,
1392
+ and mounts the host's MCP endpoint. The host's adapters decide where state lives
1393
+ and who may sign in.
1394
+
1395
+ #### Parameters
1396
+
1397
+ | Parameter | Type |
1398
+ | --------- | --------------------------- |
1399
+ | `host` | [`OysterHost`](#oysterhost) |
1400
+
1401
+ #### Returns
1402
+
1403
+ [`ServedTable`](authorization.md#servedtable)\<[`OysterEnv`](#oysterenv)\>
1404
+
1405
+ ---
1406
+
1407
+ ### oysterRouteTable()
1408
+
1409
+ ```ts
1410
+ function oysterRouteTable(host): OysterRouteTable;
1531
1411
  ```
1532
1412
 
1533
- Create the Oyster App server: a Hono app that installs App Releases, serves
1534
- their UI, forwards their backend requests and methods to their Instances, and
1535
- mounts the host's MCP endpoint. The host's adapters decide where state lives and
1536
- who may sign in.
1413
+ The Oyster host's declared route table: every route names its requirement
1414
+ (`authorization.ts`), so an undeclared route is never served.
1537
1415
 
1538
1416
  #### Parameters
1539
1417
 
@@ -1543,7 +1421,7 @@ who may sign in.
1543
1421
 
1544
1422
  #### Returns
1545
1423
 
1546
- `Hono`\<[`OysterEnv`](#oysterenv)\>
1424
+ [`OysterRouteTable`](#oysterroutetable)
1547
1425
 
1548
1426
  ---
1549
1427
 
@@ -1790,13 +1668,16 @@ function verifyRelease(
1790
1668
  api: | Readonly<{
1791
1669
  methods: Readonly<Record<string, Readonly<{
1792
1670
  description: string;
1793
- input: object;
1794
- output: object;
1671
+ input: {
1672
+ [key: ...]: ...;
1673
+ };
1674
+ output: {
1675
+ [key: ...]: ...;
1676
+ };
1795
1677
  effect: ... | ... | ...;
1796
1678
  requires: readonly ...;
1797
1679
  pending?: ... | ...;
1798
1680
  hidden?: ... | ...;
1799
- anonymous?: ... | ...;
1800
1681
  present?: ... | ...;
1801
1682
  }>>>;
1802
1683
  toolFamily?: Readonly<{
@@ -1990,10 +1871,10 @@ readonly `"git.push"`[]; `icon?`: `string`; `roles`: readonly (`"files"` \|
1990
1871
  `"application/vnd.fungi.app-backend+json"`; `artifactRef`: `ArtifactRef`;
1991
1872
  `digest`: `Sha256Digest`; `version`: `string`; `byteLength`: `number`; \}; \};
1992
1873
  `api`: \| `Readonly`\<\{ `methods`: `Readonly`\<`Record`\<`string`,
1993
- `Readonly`\<\{ `description`: `string`; `input`: `object`; `output`: `object`;
1994
- `effect`: ... \| ... \| ...; `requires`: readonly ...; `pending?`: ... \| ...;
1995
- `hidden?`: ... \| ...; `anonymous?`: ... \| ...; `present?`: ... \| ...;
1996
- \}\>\>\>; `toolFamily?`: `Readonly`\<\{ `name`: `string`; `list`: `string`;
1874
+ `Readonly`\<\{ `description`: `string`; `input`: \{ \[`key`: ...\]: ...; \};
1875
+ `output`: \{ \[`key`: ...\]: ...; \}; `effect`: ... \| ... \| ...; `requires`:
1876
+ readonly ...; `pending?`: ... \| ...; `hidden?`: ... \| ...; `present?`: ... \|
1877
+ ...; \}\>\>\>; `toolFamily?`: `Readonly`\<\{ `name`: `string`; `list`: `string`;
1997
1878
  `call`: `string`; \}\>; `events?`: `Readonly`\<`Record`\<`string`,
1998
1879
  `Readonly`\<\{ `description`: ...; `payload`: ...; \}\>\>\>; \}\> \| `null`;
1999
1880
  `declaration`: \| `Readonly`\<\{ `api?`: `Readonly`\<\{ `methods`:
package/docs/api/index.md CHANGED
@@ -448,13 +448,13 @@ const uiBootCheckOutcomeSchema: ZodDiscriminatedUnion<[ZodObject<{
448
448
  candidate_not_mounted: "candidate_not_mounted";
449
449
  }>;
450
450
  errorName: ZodOptional<ZodEnum<{
451
+ Error: "Error";
451
452
  TypeError: "TypeError";
452
453
  RangeError: "RangeError";
453
454
  SyntaxError: "SyntaxError";
454
455
  AbortError: "AbortError";
455
456
  TimeoutError: "TimeoutError";
456
457
  Other: "Other";
457
- Error: "Error";
458
458
  }>>;
459
459
  finalUrlPath: ZodString;
460
460
  consoleErrors: ZodArray<ZodPipe<ZodPipe<ZodString, ZodTransform<..., ...>>, ZodString>>;