@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.
- package/README.md +155 -63
- package/dist/agent-archive-projection.d.ts +8 -0
- package/dist/agent-archive-projection.js +49 -0
- package/dist/agent-schedules.d.ts +50 -0
- package/dist/agent-schedules.js +17 -0
- package/dist/agents.d.ts +35 -14
- package/dist/agents.js +97 -144
- package/dist/app-builds.d.ts +7 -2
- package/dist/app-builds.js +19 -2
- package/dist/approval-capability.d.ts +1 -1
- package/dist/approval-capability.js +11 -16
- package/dist/approval-home.d.ts +2 -1
- package/dist/approval-home.js +5 -3
- package/dist/apps/catalog.js +1 -1
- package/dist/apps/gate.d.ts +4 -7
- package/dist/apps/gate.js +14 -29
- package/dist/apps/index.d.ts +1 -1
- package/dist/apps/installation.d.ts +4 -42
- package/dist/apps/installation.js +7 -75
- package/dist/apps/operations.js +0 -10
- package/dist/apps/permissions.d.ts +18 -8
- package/dist/apps/permissions.js +7 -1
- package/dist/auth.js +9 -1
- package/dist/authorization.d.ts +307 -0
- package/dist/authorization.js +542 -0
- package/dist/boot-host-script.js +1 -1
- package/dist/build/build-jobs.d.ts +2 -2
- package/dist/build/candidate-builder.d.ts +2 -0
- package/dist/build/candidate-builder.js +5 -1
- package/dist/build/candidate-cli.js +3 -0
- package/dist/build/candidate-cli.mjs +67 -22
- package/dist/build/job-log.d.ts +23 -0
- package/dist/build/job-log.js +88 -0
- package/dist/build/local-build.d.ts +2 -0
- package/dist/build/local-build.js +11 -9
- package/dist/channels/binding.d.ts +8 -1
- package/dist/channels/binding.js +12 -0
- package/dist/channels/conversations.d.ts +16 -5
- package/dist/channels/visitor-channel.d.ts +53 -0
- package/dist/channels/visitor-channel.js +124 -0
- package/dist/channels/visitor-edge.d.ts +115 -0
- package/dist/channels/visitor-edge.js +582 -0
- package/dist/channels/visitor-request.d.ts +7 -0
- package/dist/channels/visitor-request.js +17 -0
- package/dist/channels/visitor-stream-slots.d.ts +2 -0
- package/dist/channels/visitor-stream-slots.js +33 -0
- package/dist/channels/visitors.d.ts +47 -0
- package/dist/channels/visitors.js +181 -0
- package/dist/cloudflare.d.ts +11 -2
- package/dist/cloudflare.js +27 -1
- package/dist/{page/computer-target.d.ts → computer-target.d.ts} +2 -0
- package/dist/{page/computer-target.js → computer-target.js} +3 -1
- package/dist/files.js +9 -8
- package/dist/git-admission.d.ts +3 -3
- package/dist/git-admission.js +4 -6
- package/dist/git-door.d.ts +8 -7
- package/dist/git-door.js +18 -17
- package/dist/git.d.ts +1 -1
- package/dist/host.d.ts +38 -42
- package/dist/host.js +182 -239
- package/dist/installation-execution.js +10 -5
- package/dist/installation-operations.d.ts +4 -180
- package/dist/installation-operations.js +1 -5
- package/dist/installation-store-generation.d.ts +4 -1
- package/dist/installation-store-generation.js +59 -6
- package/dist/internal/delivery.js +0 -1
- package/dist/internal/host-gate.d.ts +9 -6
- package/dist/internal/host-gate.js +19 -25
- package/dist/internal/invocation-timing.d.ts +16 -0
- package/dist/internal/invocation-timing.js +23 -0
- package/dist/internal/registry-installations.js +1 -0
- package/dist/invocation.d.ts +19 -11
- package/dist/invocation.js +171 -96
- package/dist/keys.d.ts +2 -19
- package/dist/keys.js +1 -37
- package/dist/mcp.d.ts +15 -27
- package/dist/mcp.js +105 -155
- package/dist/page/agent-browser.d.ts +15 -0
- package/dist/page/agent-browser.js +162 -0
- package/dist/page/app-permissions-port.d.ts +3 -0
- package/dist/page/app-permissions-port.js +43 -0
- package/dist/page/app-permissions.d.ts +11 -0
- package/dist/page/app-permissions.js +296 -0
- package/dist/page/capabilities.js +1 -1
- package/dist/page/child-selection.d.ts +27 -0
- package/dist/page/child-selection.js +38 -0
- package/dist/page/isolated-page-theme.d.ts +2 -0
- package/dist/page/isolated-page-theme.js +11 -0
- package/dist/page/mount.d.ts +2 -13
- package/dist/page/mount.js +8 -94
- package/dist/page-script.d.ts +0 -3
- package/dist/page-script.js +3 -4
- package/dist/release.d.ts +13 -0
- package/dist/release.js +10 -0
- package/dist/request-origin.d.ts +4 -0
- package/dist/request-origin.js +10 -0
- package/dist/standalone/agent-archive-owner.d.ts +42 -0
- package/dist/standalone/agent-archive-owner.js +116 -0
- package/dist/standalone/agent-archive-schedules.d.ts +6 -0
- package/dist/standalone/agent-archive-schedules.js +76 -0
- package/dist/standalone/agent-archive.d.ts +31 -0
- package/dist/standalone/agent-archive.js +67 -0
- package/dist/standalone/agent-computers.d.ts +7 -6
- package/dist/standalone/agent-computers.js +4 -7
- package/dist/standalone/agent-mail.d.ts +2 -2
- package/dist/standalone/agents.d.ts +157 -20
- package/dist/standalone/agents.js +242 -38
- package/dist/standalone/app-builds-binding.js +1 -1
- package/dist/standalone/app-set.js +2 -54
- package/dist/standalone/app-source.d.ts +3 -4
- package/dist/standalone/app-source.js +12 -9
- package/dist/standalone/builds.d.ts +2 -14
- package/dist/standalone/builds.js +15 -13
- package/dist/standalone/computer-fleet.d.ts +4 -4
- package/dist/standalone/computer-fleet.js +20 -43
- package/dist/standalone/computer.d.ts +4 -3
- package/dist/standalone/computer.js +52 -53
- package/dist/standalone/dashboard-approval.d.ts +10 -0
- package/dist/standalone/dashboard-approval.js +66 -0
- package/dist/standalone/machine-link.d.ts +4 -221
- package/dist/standalone/machine-link.js +21 -15
- package/dist/standalone/media.d.ts +1 -0
- package/dist/standalone/media.js +20 -14
- package/dist/standalone/owner-routes.d.ts +16 -0
- package/dist/standalone/owner-routes.js +21 -0
- package/dist/standalone/permission-resources.d.ts +5 -0
- package/dist/standalone/permission-resources.js +31 -0
- package/dist/standalone/registry.d.ts +7 -0
- package/dist/standalone/registry.js +3 -0
- package/dist/standalone/tenancy.js +3 -1
- package/dist/standalone/worker-routes.d.ts +19 -0
- package/dist/standalone/worker-routes.js +9 -0
- package/dist/standalone/worker.d.ts +1 -1
- package/dist/standalone/worker.js +27 -35
- package/dist/standalone/workflow-binding.d.ts +8 -3
- package/dist/standalone/workflow-binding.js +14 -5
- package/dist/standalone/workflow-git-capture.js +2 -1
- package/dist/standalone/workflow-host.d.ts +8 -103
- package/dist/standalone/workflow-host.js +1 -1
- package/dist/standalone/workflow-node-capture.js +2 -2
- package/dist/standalone/workflow-root-authority.d.ts +1 -1
- package/dist/standalone/workflow-root-authority.js +1 -1
- package/dist/standalone/workflow-schedules.d.ts +14 -5
- package/dist/standalone/workflow-schedules.js +11 -5
- package/dist/standalone/workflow-webhooks.d.ts +4 -18
- package/dist/standalone/workflow-webhooks.js +5 -5
- package/dist/standalone/workflows.d.ts +36 -28
- package/dist/standalone/workflows.js +6 -3
- package/dist/storage-frame.d.ts +6 -6
- package/dist/testing/capabilities.d.ts +7 -6
- package/dist/testing/capabilities.js +3 -6
- package/dist/testing/installation.d.ts +0 -1
- package/dist/testing/installation.js +2 -5
- package/dist/turnstile.d.ts +27 -0
- package/dist/turnstile.js +51 -0
- package/dist/workers-git.d.ts +12 -4
- package/dist/workers-git.js +58 -36
- package/dist/workers.d.ts +9 -1
- package/dist/workers.js +59 -20
- package/dist/workflows.d.ts +2 -0
- package/dist/workflows.js +1 -0
- package/docs/api/README.md +7 -0
- package/docs/api/agent-schedules.md +175 -0
- package/docs/api/agents.md +34 -13
- package/docs/api/app-storage.md +1 -1
- package/docs/api/apps.md +323 -225
- package/docs/api/authorization.md +1300 -0
- package/docs/api/build-contract.md +2 -2
- package/docs/api/build.md +40 -37
- package/docs/api/cloudflare.md +27 -2
- package/docs/api/git.md +20 -11
- package/docs/api/host.md +80 -199
- package/docs/api/index.md +1 -1
- package/docs/api/invocation.md +15 -11
- package/docs/api/keys.md +1 -98
- package/docs/api/mcp.md +43 -40
- package/docs/api/modules.md +2 -0
- package/docs/api/page/mount.md +16 -19
- package/docs/api/workers-git.md +46 -12
- package/docs/api/workers.md +125 -235
- package/docs/site/agent-quickstart.mdx +6 -2
- package/examples/standalone/wrangler.celld.jsonc +66 -0
- package/package.json +64 -21
- package/dist/standalone/channel-session-door.d.ts +0 -4
- package/dist/standalone/channel-session-door.js +0 -42
package/docs/api/cloudflare.md
CHANGED
|
@@ -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
|
-
|
|
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?`: \| `"
|
|
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.
|
|
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"`;
|
|
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`
|
|
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):
|
|
341
|
+
function createGitDoor(host): GitDoor;
|
|
332
342
|
```
|
|
333
343
|
|
|
334
|
-
|
|
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
|
-
`
|
|
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
|
-
|
|
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:
|
|
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?:
|
|
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?: | "
|
|
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?: | "
|
|
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` | [`
|
|
1372
|
+
| `principal` | [`TenantPrincipal`](tenant.md#tenantprincipal) |
|
|
1516
1373
|
| `intent` | `"install-or-select"` \| `"install-or-remint"` \| `"create-only"` |
|
|
1517
|
-
| `origin` | `"workflow"` \| `"
|
|
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):
|
|
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
|
-
|
|
1534
|
-
|
|
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
|
-
|
|
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:
|
|
1794
|
-
|
|
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`:
|
|
1994
|
-
`
|
|
1995
|
-
`
|
|
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>>;
|