@fungi.computer/oyster 0.32.0 → 0.34.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 (77) hide show
  1. package/README.md +59 -0
  2. package/dist/app-sandbox.d.ts +2 -2
  3. package/dist/app-sandbox.js +2 -2
  4. package/dist/app-test-copies.d.ts +87 -0
  5. package/dist/app-test-copies.js +170 -0
  6. package/dist/app-test-copy-page.d.ts +4 -0
  7. package/dist/app-test-copy-page.js +89 -0
  8. package/dist/approval-deadline.d.ts +2 -0
  9. package/dist/approval-deadline.js +7 -0
  10. package/dist/approval-home.d.ts +26 -3
  11. package/dist/approval-home.js +148 -18
  12. package/dist/apps/index.d.ts +1 -1
  13. package/dist/apps/index.js +1 -1
  14. package/dist/browser/operations.d.ts +1 -1
  15. package/dist/cloudflare.d.ts +68 -3
  16. package/dist/cloudflare.js +214 -3
  17. package/dist/embed-metafiles.js +2 -2
  18. package/dist/embed-scripts.js +1 -1
  19. package/dist/host.d.ts +20 -4
  20. package/dist/host.js +314 -3
  21. package/dist/installation-operations.d.ts +247 -8
  22. package/dist/installation-operations.js +145 -7
  23. package/dist/installation-recovery-page.d.ts +24 -0
  24. package/dist/installation-recovery-page.js +168 -0
  25. package/dist/mcp.js +42 -13
  26. package/dist/older-oyster-store.d.ts +1 -1
  27. package/dist/older-oyster-store.js +2 -4
  28. package/dist/page/app-permissions.js +8 -7
  29. package/dist/page/computer-handles.d.ts +0 -1
  30. package/dist/page/mount.d.ts +2 -101
  31. package/dist/page/mount.js +1 -22
  32. package/dist/page-config.d.ts +102 -0
  33. package/dist/page-config.js +24 -0
  34. package/dist/page-script.js +2 -2
  35. package/dist/platform-skills.generated.d.ts +5 -2
  36. package/dist/platform-skills.generated.js +6 -2
  37. package/dist/recovery-style.d.ts +5 -0
  38. package/dist/recovery-style.js +32 -0
  39. package/dist/standalone/agents.d.ts +1 -1
  40. package/dist/standalone/agents.js +43 -7
  41. package/dist/standalone/computer-fleet.js +3 -0
  42. package/dist/standalone/computer.d.ts +6 -2
  43. package/dist/standalone/computer.js +27 -14
  44. package/dist/standalone/media.js +7 -2
  45. package/dist/standalone/preview.d.ts +21 -20
  46. package/dist/standalone/preview.js +147 -151
  47. package/dist/standalone/registry.d.ts +14 -21
  48. package/dist/standalone/registry.js +74 -28
  49. package/dist/standalone/worker.js +6 -3
  50. package/dist/starter-agent.d.ts +6 -2
  51. package/dist/starter-agent.js +25 -4
  52. package/dist/upgrade/old-worker-http.d.ts +2 -0
  53. package/dist/upgrade/old-worker-http.js +22 -0
  54. package/dist/upgrade/old-worker-readonly.d.ts +14 -0
  55. package/dist/upgrade/old-worker-readonly.js +22 -0
  56. package/dist/upgrade/old-worker-sql.d.ts +10 -0
  57. package/dist/upgrade/old-worker-sql.js +68 -0
  58. package/dist/upgrade/old-worker-stream.d.ts +12 -0
  59. package/dist/upgrade/old-worker-stream.js +54 -0
  60. package/dist/upgrade/private-stage.d.ts +23 -0
  61. package/dist/upgrade/private-stage.js +109 -0
  62. package/dist/upgrade/standalone-001.d.ts +16 -0
  63. package/dist/upgrade/standalone-001.js +31 -0
  64. package/dist/upgrade/standalone-01.d.ts +37 -0
  65. package/dist/upgrade/standalone-01.js +55 -0
  66. package/dist/upgrade/standalone-02.d.ts +37 -0
  67. package/dist/upgrade/standalone-02.js +55 -0
  68. package/dist/workers.d.ts +45 -14
  69. package/dist/workers.js +198 -21
  70. package/docs/api/README.md +8 -3
  71. package/docs/api/apps.md +21 -0
  72. package/docs/api/cloudflare.md +57 -0
  73. package/docs/api/host.md +263 -25
  74. package/docs/api/page/mount.md +13 -81
  75. package/docs/api/workers-git.md +246 -1
  76. package/docs/api/workers.md +518 -95
  77. package/package.json +38 -24
package/docs/api/host.md CHANGED
@@ -74,6 +74,65 @@ readonly code:
74
74
 
75
75
  ## Type Aliases
76
76
 
77
+ ### AppTestCopyAuthority
78
+
79
+ ```ts
80
+ type AppTestCopyAuthority = z.output<typeof appTestCopyAuthoritySchema>;
81
+ ```
82
+
83
+ Exact source selection and store incarnation observed by the owner.
84
+
85
+ ---
86
+
87
+ ### AppTestCopy
88
+
89
+ ```ts
90
+ type AppTestCopy = z.output<typeof appTestCopySchema>;
91
+ ```
92
+
93
+ Observed sibling identity and nonrenewing deadline, never live host grants.
94
+
95
+ ---
96
+
97
+ ### OysterApprovalResult
98
+
99
+ ```ts
100
+ type OysterApprovalResult =
101
+ | Exclude<
102
+ ApprovalApplyResult,
103
+ {
104
+ kind: "refused";
105
+ }
106
+ >
107
+ | Readonly<{
108
+ kind: "denied";
109
+ by: string;
110
+ note?: string;
111
+ message: string;
112
+ }>
113
+ | Readonly<{
114
+ kind: "refused";
115
+ reason:
116
+ | Exclude<
117
+ Extract<
118
+ ApprovalApplyResult,
119
+ {
120
+ kind: "refused";
121
+ }
122
+ >["reason"],
123
+ "expired"
124
+ >
125
+ | "approval_expired"
126
+ | "cancelled";
127
+ denialNote?: string;
128
+ }>;
129
+ ```
130
+
131
+ The originating call receives the output or this terminal decision, never a
132
+ pending notice.
133
+
134
+ ---
135
+
77
136
  ### CapabilityMethodKind
78
137
 
79
138
  ```ts
@@ -214,6 +273,19 @@ The result of one Instance operation; refusals carry Oyster's error code.
214
273
 
215
274
  ```ts
216
275
  type InstanceHandle = Readonly<{
276
+ testCopies?: Readonly<{
277
+ open: (authority, requestId) => Promise<InstanceResult<AppTestCopy>>;
278
+ inspect: (authority) => Promise<InstanceResult<AppTestCopy | null>>;
279
+ discard: (authority, copyId) => Promise<InstanceResult<boolean>>;
280
+ fetch: (authority, copyId, request) => Promise<Response>;
281
+ call: (
282
+ authority,
283
+ copyId,
284
+ name,
285
+ input,
286
+ caller,
287
+ ) => Promise<InstanceResult<AppMethodReply>>;
288
+ }>;
217
289
  prepare: (
218
290
  state,
219
291
  release,
@@ -372,17 +444,7 @@ Variables: TimingVariables;
372
444
  ```ts
373
445
  type OysterHost = Readonly<{
374
446
  approvals?: Readonly<{
375
- submit: Promise<
376
- | {
377
- kind: Schema.Literal<"pending_approval">;
378
- recordId: Schema.String;
379
- description: Schema.Struct<{
380
- title: Schema.String;
381
- inputBytes: Schema.Int;
382
- inputSha256: Schema.String;
383
- }>;
384
- }
385
- | ApprovalApplyResult>;
447
+ submit: Promise<OysterApprovalResult>;
386
448
  }>;
387
449
  workflows?: (principal) => Promise<
388
450
  | {
@@ -500,6 +562,60 @@ One host's declared routes and the one way to serve them.
500
562
 
501
563
  ```ts
502
564
  type InstallationOperations = Readonly<{
565
+ recovery: Promise<
566
+ | {
567
+ authorityVersion: number;
568
+ storeGeneration: string;
569
+ release: {
570
+ releaseId: Schema.refine<ReleaseId, Schema.String>;
571
+ appId: Schema.refine<AppId, Schema.String>;
572
+ artifact: Schema.Struct<{
573
+ artifactRef: Schema.refine<ArtifactRef, Schema.String>;
574
+ artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
575
+ provenance: Schema.Struct<{
576
+ sourceRevision: Schema.refine<..., ...>;
577
+ sourceTreeDigest: Schema.refine<..., ...>;
578
+ buildRecipeDigest: Schema.refine<..., ...>;
579
+ }>;
580
+ }>;
581
+ };
582
+ uiCheck: | {
583
+ kind: "passed";
584
+ }
585
+ | {
586
+ kind: "failed";
587
+ code: "ui_mount_failed";
588
+ diagnostics?: {
589
+ failedPredicate: | "unexpected_candidate_request"
590
+ | "response_status"
591
+ | "request_failed"
592
+ | "page_error"
593
+ | "candidate_not_mounted";
594
+ errorName?: | "Error"
595
+ | "TypeError"
596
+ | "RangeError"
597
+ | "SyntaxError"
598
+ | "AbortError"
599
+ | "TimeoutError"
600
+ | "Other";
601
+ finalUrlPath: string;
602
+ consoleErrors: string[];
603
+ pageErrors: string[];
604
+ failedRequests: object[];
605
+ droppedCount: number;
606
+ };
607
+ }
608
+ | {
609
+ kind: "not_checked";
610
+ code: | "boot_runner_unavailable"
611
+ | "boot_browser_binding_missing"
612
+ | "boot_clone_unavailable"
613
+ | "boot_timeout"
614
+ | "boot_cleanup_failed"
615
+ | "ui_check_not_run_on_host";
616
+ };
617
+ }
618
+ | null>;
503
619
  admit: Promise<
504
620
  | {
505
621
  requestId: string;
@@ -975,20 +1091,16 @@ type InstallationOperations = Readonly<{
975
1091
  | null>;
976
1092
  load: Promise<
977
1093
  | {
978
- admission: {
1094
+ admission: | {
979
1095
  requestId: string;
980
1096
  installationId: string;
981
1097
  release: {
982
1098
  releaseId: Schema.refine<ReleaseId, Schema.String>;
983
1099
  appId: Schema.refine<AppId, Schema.String>;
984
1100
  artifact: Schema.Struct<{
985
- artifactRef: Schema.refine<ArtifactRef, Schema.String>;
986
- artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
987
- provenance: Schema.Struct<{
988
- sourceRevision: ...;
989
- sourceTreeDigest: ...;
990
- buildRecipeDigest: ...;
991
- }>;
1101
+ artifactRef: Schema.refine<..., ...>;
1102
+ artifactDigest: Schema.refine<..., ...>;
1103
+ provenance: Schema.Struct<...>;
992
1104
  }>;
993
1105
  };
994
1106
  actor: | {
@@ -1005,7 +1117,36 @@ type InstallationOperations = Readonly<{
1005
1117
  };
1006
1118
  intent: "install-or-select" | "install-or-remint" | "create-only";
1007
1119
  origin: "workflow" | "owner-direct";
1008
- };
1120
+ }
1121
+ | {
1122
+ authorityVersion: number;
1123
+ storeGeneration: string;
1124
+ requestId: string;
1125
+ installationId: string;
1126
+ actor: | {
1127
+ kind: z.ZodMiniLiteral<"member">;
1128
+ memberId: z.ZodMiniString<string>;
1129
+ }
1130
+ | {
1131
+ kind: z.ZodMiniLiteral<"agent">;
1132
+ agentId: z.ZodMiniString<string>;
1133
+ }
1134
+ | {
1135
+ kind: z.ZodMiniLiteral<"team-key">;
1136
+ keyId: z.ZodMiniString<string>;
1137
+ };
1138
+ intent: "rollback";
1139
+ origin: "owner-direct";
1140
+ release: {
1141
+ releaseId: Schema.refine<ReleaseId, Schema.String>;
1142
+ appId: Schema.refine<AppId, Schema.String>;
1143
+ artifact: Schema.Struct<{
1144
+ artifactRef: Schema.refine<..., ...>;
1145
+ artifactDigest: Schema.refine<..., ...>;
1146
+ provenance: Schema.Struct<...>;
1147
+ }>;
1148
+ };
1149
+ };
1009
1150
  scope: {
1010
1151
  tenantId: string & Brand<"OysterTenantId">;
1011
1152
  origin: string;
@@ -1124,7 +1265,7 @@ type InstallationOperations = Readonly<{
1124
1265
  }
1125
1266
  | null>;
1126
1267
  plan: Promise<{
1127
- admission: {
1268
+ admission: | {
1128
1269
  requestId: string;
1129
1270
  installationId: string;
1130
1271
  release: {
@@ -1134,9 +1275,9 @@ type InstallationOperations = Readonly<{
1134
1275
  artifactRef: Schema.refine<ArtifactRef, Schema.String>;
1135
1276
  artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
1136
1277
  provenance: Schema.Struct<{
1137
- sourceRevision: Schema.refine<..., ...>;
1138
- sourceTreeDigest: Schema.refine<..., ...>;
1139
- buildRecipeDigest: Schema.refine<..., ...>;
1278
+ sourceRevision: ...;
1279
+ sourceTreeDigest: ...;
1280
+ buildRecipeDigest: ...;
1140
1281
  }>;
1141
1282
  }>;
1142
1283
  };
@@ -1154,7 +1295,40 @@ type InstallationOperations = Readonly<{
1154
1295
  };
1155
1296
  intent: "install-or-select" | "install-or-remint" | "create-only";
1156
1297
  origin: "workflow" | "owner-direct";
1157
- };
1298
+ }
1299
+ | {
1300
+ authorityVersion: number;
1301
+ storeGeneration: string;
1302
+ requestId: string;
1303
+ installationId: string;
1304
+ actor: | {
1305
+ kind: z.ZodMiniLiteral<"member">;
1306
+ memberId: z.ZodMiniString<string>;
1307
+ }
1308
+ | {
1309
+ kind: z.ZodMiniLiteral<"agent">;
1310
+ agentId: z.ZodMiniString<string>;
1311
+ }
1312
+ | {
1313
+ kind: z.ZodMiniLiteral<"team-key">;
1314
+ keyId: z.ZodMiniString<string>;
1315
+ };
1316
+ intent: "rollback";
1317
+ origin: "owner-direct";
1318
+ release: {
1319
+ releaseId: Schema.refine<ReleaseId, Schema.String>;
1320
+ appId: Schema.refine<AppId, Schema.String>;
1321
+ artifact: Schema.Struct<{
1322
+ artifactRef: Schema.refine<ArtifactRef, Schema.String>;
1323
+ artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
1324
+ provenance: Schema.Struct<{
1325
+ sourceRevision: ...;
1326
+ sourceTreeDigest: ...;
1327
+ buildRecipeDigest: ...;
1328
+ }>;
1329
+ }>;
1330
+ };
1331
+ };
1158
1332
  scope: {
1159
1333
  tenantId: string & Brand<"OysterTenantId">;
1160
1334
  origin: string;
@@ -1382,6 +1556,70 @@ another store read or hash.
1382
1556
 
1383
1557
  ## Variables
1384
1558
 
1559
+ ### appTestCopyAuthoritySchema
1560
+
1561
+ ```ts
1562
+ const appTestCopyAuthoritySchema: ZodObject<
1563
+ {
1564
+ selection: ZodPipe<
1565
+ ZodUnknown,
1566
+ ZodTransform<
1567
+ {
1568
+ instanceId: InstanceId;
1569
+ owner: {
1570
+ kind: "installation" | "deployment";
1571
+ id: string;
1572
+ };
1573
+ appId: AppId;
1574
+ releaseId: ReleaseId;
1575
+ authorityVersion: number;
1576
+ },
1577
+ unknown
1578
+ >
1579
+ >;
1580
+ storeGeneration: ZodString;
1581
+ },
1582
+ $strict
1583
+ >;
1584
+ ```
1585
+
1586
+ A test copy is fenced to the same store and owner selection as its source.
1587
+
1588
+ ---
1589
+
1590
+ ### appTestCopySchema
1591
+
1592
+ ```ts
1593
+ const appTestCopySchema: ZodObject<
1594
+ {
1595
+ selection: ZodPipe<
1596
+ ZodUnknown,
1597
+ ZodTransform<
1598
+ {
1599
+ instanceId: InstanceId;
1600
+ owner: {
1601
+ kind: "installation" | "deployment";
1602
+ id: string;
1603
+ };
1604
+ appId: AppId;
1605
+ releaseId: ReleaseId;
1606
+ authorityVersion: number;
1607
+ },
1608
+ unknown
1609
+ >
1610
+ >;
1611
+ storeGeneration: ZodString;
1612
+ copyId: ZodString;
1613
+ expiresAt: ZodNumber;
1614
+ },
1615
+ $strict
1616
+ >;
1617
+ ```
1618
+
1619
+ Host-owned identity and fixed deadline of one disposable App-data sibling.
1620
+
1621
+ ---
1622
+
1385
1623
  ### capabilityMethodKindSchema
1386
1624
 
1387
1625
  ```ts
@@ -92,6 +92,16 @@ Admit the selected Agent through the reporting App's existing write door.
92
92
 
93
93
  ## Type Aliases
94
94
 
95
+ ### OysterAppConfig
96
+
97
+ ```ts
98
+ type OysterAppConfig = typeof oysterAppConfigSchema.Type;
99
+ ```
100
+
101
+ Host-authored configuration for the ordinary sandboxed App mount.
102
+
103
+ ---
104
+
95
105
  ### OysterAppOpenRouting
96
106
 
97
107
  ```ts
@@ -108,16 +118,6 @@ surface.
108
118
 
109
119
  ---
110
120
 
111
- ### OysterAppConfig
112
-
113
- ```ts
114
- type OysterAppConfig = typeof oysterAppConfigSchema.Type;
115
- ```
116
-
117
- The host-admitted App configuration served by Oyster.
118
-
119
- ---
120
-
121
121
  ### OysterAppConnectionOptions
122
122
 
123
123
  ```ts
@@ -146,79 +146,11 @@ One isolated App connection, with the slots this host admitted for it.
146
146
  ### appSandbox
147
147
 
148
148
  ```ts
149
- const appSandbox: "allow-scripts allow-modals allow-popups allow-forms" =
150
- "allow-scripts allow-modals allow-popups allow-forms";
151
- ```
152
-
153
- The sandbox every installed App frame runs in, shell-mounted or not.
154
-
155
- ---
156
-
157
- ### oysterAppConfigSchema
158
-
159
- ```ts
160
- const oysterAppConfigSchema: Struct<{
161
- workbench: Boolean;
162
- shellModuleUrl: NullOr<String>;
163
- storage: Boolean;
164
- appsOpen: Boolean;
165
- computerId: NullOr<String>;
166
- authorityVersion: Int;
167
- commands: $Array<Codec<Readonly<{
168
- id: string;
169
- title: string;
170
- category: string;
171
- description?: string;
172
- sigil?: string;
173
- projections?: Readonly<{
174
- bindings?: ... & ...;
175
- agent?: ... & ...;
176
- help?: Readonly<...>;
177
- menu?: Readonly<...>;
178
- palette?: Readonly<...>;
179
- slash?: ... & ...;
180
- }>;
181
- }>, Readonly<{
182
- id: string;
183
- title: string;
184
- category: string;
185
- description?: string;
186
- sigil?: string;
187
- projections?: Readonly<{
188
- bindings?: ... & ...;
189
- agent?: ... & ...;
190
- help?: Readonly<...>;
191
- menu?: Readonly<...>;
192
- palette?: Readonly<...>;
193
- slash?: ... & ...;
194
- }>;
195
- }>, never, never>>;
196
- icon: NullOr<String>;
197
- roles: $Array<String>;
198
- installationId: String;
199
- appId: String;
200
- releaseId: String;
201
- uiUrl: String;
202
- backendUrl: String;
203
- methodsUrl: String;
204
- capabilities: $Array<Struct<{
205
- id: String;
206
- version: Number;
207
- base: String;
208
- methods: $Record<String, Union<readonly [Struct<{
209
- kind: Literal<...>;
210
- method: Literals<...>;
211
- path: String;
212
- }>, Struct<{
213
- kind: Literals<...>;
214
- method: Literals<...>;
215
- path: String;
216
- }>]>>;
217
- }>>;
218
- }>;
149
+ const appSandbox: "allow-scripts allow-modals allow-popups allow-popups-to-escape-sandbox allow-forms" =
150
+ "allow-scripts allow-modals allow-popups allow-popups-to-escape-sandbox allow-forms";
219
151
  ```
220
152
 
221
- Current server-admitted configuration for one installed App page.
153
+ Apps stay opaque; external tabs need their own origin for preview cookies.
222
154
 
223
155
  ## Functions
224
156