@fungi.computer/oyster 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1082 -2
  3. package/dist/agents.d.ts +114 -0
  4. package/dist/agents.js +322 -0
  5. package/dist/app-builds.d.ts +151 -0
  6. package/dist/app-builds.js +355 -0
  7. package/dist/app-sandbox.d.ts +2 -0
  8. package/dist/app-sandbox.js +2 -0
  9. package/dist/app-sources.d.ts +46 -0
  10. package/dist/app-sources.js +335 -0
  11. package/dist/app-storage.d.ts +141 -0
  12. package/dist/app-storage.js +281 -0
  13. package/dist/apps/gate.d.ts +105 -0
  14. package/dist/apps/gate.js +273 -0
  15. package/dist/apps/index.d.ts +5 -0
  16. package/dist/apps/index.js +5 -0
  17. package/dist/apps/installation.d.ts +248 -0
  18. package/dist/apps/installation.js +307 -0
  19. package/dist/apps/operations.d.ts +8 -0
  20. package/dist/apps/operations.js +98 -0
  21. package/dist/apps/tools.d.ts +33 -0
  22. package/dist/apps/tools.js +17 -0
  23. package/dist/auth.d.ts +11 -0
  24. package/dist/auth.js +93 -0
  25. package/dist/backend-request.d.ts +3 -0
  26. package/dist/backend-request.js +53 -0
  27. package/dist/build/build-jobs.d.ts +128 -0
  28. package/dist/build/build-jobs.js +197 -0
  29. package/dist/build/build-step.d.ts +26 -0
  30. package/dist/build/build-step.js +20 -0
  31. package/dist/build/bundled-html.d.ts +7 -0
  32. package/dist/build/bundled-html.js +64 -0
  33. package/dist/build/definition-emission.d.ts +34 -0
  34. package/dist/build/definition-emission.js +201 -0
  35. package/dist/build/effect.d.ts +231 -0
  36. package/dist/build/effect.js +396 -0
  37. package/dist/build/git-environment.d.ts +6 -0
  38. package/dist/build/git-environment.js +48 -0
  39. package/dist/build/html-recipe.d.ts +20 -0
  40. package/dist/build/html-recipe.js +51 -0
  41. package/dist/build/local-build.d.ts +57 -0
  42. package/dist/build/local-build.js +1078 -0
  43. package/dist/build/r2-artifact-writer.d.ts +31 -0
  44. package/dist/build/r2-artifact-writer.js +179 -0
  45. package/dist/build/snapshot-package-store.d.ts +2 -0
  46. package/dist/build/snapshot-package-store.js +21 -0
  47. package/dist/build/snapshot-program-scripts.d.ts +6 -0
  48. package/dist/build/snapshot-program-scripts.js +2 -0
  49. package/dist/build/submission-contract.d.ts +384 -0
  50. package/dist/build/submission-contract.js +70 -0
  51. package/dist/build/workspace-build.d.ts +50 -0
  52. package/dist/build/workspace-build.js +156 -0
  53. package/dist/build-contract.d.ts +4 -0
  54. package/dist/build-contract.js +4 -0
  55. package/dist/build-jobs.d.ts +2 -0
  56. package/dist/build-jobs.js +2 -0
  57. package/dist/build.d.ts +11 -0
  58. package/dist/build.js +13 -0
  59. package/dist/capability-descriptor.d.ts +46 -0
  60. package/dist/capability-descriptor.js +51 -0
  61. package/dist/catalog-frame.d.ts +39 -0
  62. package/dist/catalog-frame.js +72 -0
  63. package/dist/cause-class.d.ts +19 -0
  64. package/dist/cause-class.js +54 -0
  65. package/dist/cloudflare.d.ts +123 -0
  66. package/dist/cloudflare.js +391 -0
  67. package/dist/computer-terminal.d.ts +38 -0
  68. package/dist/computer-terminal.js +410 -0
  69. package/dist/computer.d.ts +60 -0
  70. package/dist/computer.js +33 -0
  71. package/dist/event-recipients.d.ts +57 -0
  72. package/dist/event-recipients.js +144 -0
  73. package/dist/facet-invocation.d.ts +4 -0
  74. package/dist/facet-invocation.js +45 -0
  75. package/dist/files.d.ts +42 -0
  76. package/dist/files.js +123 -0
  77. package/dist/frame-binding-wire-script.d.ts +2 -0
  78. package/dist/frame-binding-wire-script.js +1 -0
  79. package/dist/frame-binding-wire.d.ts +28 -0
  80. package/dist/frame-binding-wire.js +54 -0
  81. package/dist/git-admission.d.ts +52 -0
  82. package/dist/git-admission.js +188 -0
  83. package/dist/git-auth.d.ts +11 -0
  84. package/dist/git-auth.js +27 -0
  85. package/dist/git-door.d.ts +35 -0
  86. package/dist/git-door.js +108 -0
  87. package/dist/git-journal.d.ts +31 -0
  88. package/dist/git-journal.js +188 -0
  89. package/dist/git.d.ts +31 -0
  90. package/dist/git.js +64 -0
  91. package/dist/guest-policy.d.ts +9 -0
  92. package/dist/guest-policy.js +13 -0
  93. package/dist/host.d.ts +244 -0
  94. package/dist/host.js +1043 -0
  95. package/dist/index.d.ts +166 -0
  96. package/dist/index.js +320 -0
  97. package/dist/installation-consent.d.ts +79 -0
  98. package/dist/installation-consent.js +82 -0
  99. package/dist/internal/background-origins.d.ts +3 -0
  100. package/dist/internal/background-origins.js +8 -0
  101. package/dist/internal/delivery.d.ts +12 -0
  102. package/dist/internal/delivery.js +167 -0
  103. package/dist/internal/host-gate.d.ts +14 -0
  104. package/dist/internal/host-gate.js +62 -0
  105. package/dist/internal/registry-installations.d.ts +6 -0
  106. package/dist/internal/registry-installations.js +12 -0
  107. package/dist/invocation.d.ts +251 -0
  108. package/dist/invocation.js +377 -0
  109. package/dist/keys.d.ts +48 -0
  110. package/dist/keys.js +52 -0
  111. package/dist/mcp-owner.d.ts +27 -0
  112. package/dist/mcp-owner.js +143 -0
  113. package/dist/mcp.d.ts +89 -0
  114. package/dist/mcp.js +429 -0
  115. package/dist/media.d.ts +23 -0
  116. package/dist/media.js +12 -0
  117. package/dist/pack.d.ts +76 -0
  118. package/dist/pack.js +134 -0
  119. package/dist/page/capabilities.d.ts +23 -0
  120. package/dist/page/capabilities.js +256 -0
  121. package/dist/page/computer-handles.d.ts +79 -0
  122. package/dist/page/computer-handles.js +44 -0
  123. package/dist/page/lifetime.d.ts +6 -0
  124. package/dist/page/lifetime.js +19 -0
  125. package/dist/page/mount.d.ts +163 -0
  126. package/dist/page/mount.js +390 -0
  127. package/dist/page/storage.d.ts +3 -0
  128. package/dist/page/storage.js +82 -0
  129. package/dist/page/terminal.d.ts +5 -0
  130. package/dist/page/terminal.js +7 -0
  131. package/dist/page-script.d.ts +14 -0
  132. package/dist/page-script.js +5 -0
  133. package/dist/r2-files.d.ts +3 -0
  134. package/dist/r2-files.js +79 -0
  135. package/dist/release.d.ts +72 -0
  136. package/dist/release.js +164 -0
  137. package/dist/root-data.d.ts +86 -0
  138. package/dist/root-data.js +69 -0
  139. package/dist/shell/app-directory.d.ts +537 -0
  140. package/dist/shell/app-directory.js +195 -0
  141. package/dist/shell/browser-actions.d.ts +7 -0
  142. package/dist/shell/browser-actions.js +56 -0
  143. package/dist/shell/command-host.d.ts +112 -0
  144. package/dist/shell/command-host.js +502 -0
  145. package/dist/shell/commands.d.ts +25 -0
  146. package/dist/shell/commands.js +78 -0
  147. package/dist/shell/index.d.ts +8 -0
  148. package/dist/shell/index.js +8 -0
  149. package/dist/shell/keys.d.ts +41 -0
  150. package/dist/shell/keys.js +134 -0
  151. package/dist/shell/shell-module.d.ts +31 -0
  152. package/dist/shell/shell-module.js +37 -0
  153. package/dist/shell/window-manager.d.ts +124 -0
  154. package/dist/shell/window-manager.js +711 -0
  155. package/dist/shell/workbench-contract.d.ts +68 -0
  156. package/dist/shell/workbench-contract.js +1 -0
  157. package/dist/shell/workbench-host-types.d.ts +96 -0
  158. package/dist/shell/workbench-host-types.js +1 -0
  159. package/dist/shell/workbench-host.d.ts +34 -0
  160. package/dist/shell/workbench-host.js +347 -0
  161. package/dist/shell/workbench-model.d.ts +192 -0
  162. package/dist/shell/workbench-model.js +53 -0
  163. package/dist/shell/workbench.d.ts +4 -0
  164. package/dist/shell/workbench.js +2 -0
  165. package/dist/source/fork.d.ts +27 -0
  166. package/dist/source/fork.js +46 -0
  167. package/dist/source/index.d.ts +11 -0
  168. package/dist/source/index.js +11 -0
  169. package/dist/source/seed-receipt.d.ts +53 -0
  170. package/dist/source/seed-receipt.js +18 -0
  171. package/dist/source/team-source.d.ts +32 -0
  172. package/dist/source/team-source.js +42 -0
  173. package/dist/source/template-repository.d.ts +2 -0
  174. package/dist/source/template-repository.js +8 -0
  175. package/dist/source/template-write.d.ts +69 -0
  176. package/dist/source/template-write.js +344 -0
  177. package/dist/storage-frame.d.ts +64 -0
  178. package/dist/storage-frame.js +28 -0
  179. package/dist/tenant.d.ts +81 -0
  180. package/dist/tenant.js +71 -0
  181. package/dist/testing/capabilities.d.ts +29 -0
  182. package/dist/testing/capabilities.js +130 -0
  183. package/dist/testing/catalog.d.ts +3 -0
  184. package/dist/testing/catalog.js +53 -0
  185. package/dist/testing/index.d.ts +10 -0
  186. package/dist/testing/index.js +10 -0
  187. package/dist/testing/installation.d.ts +11 -0
  188. package/dist/testing/installation.js +25 -0
  189. package/dist/testing/native-worker.d.ts +21 -0
  190. package/dist/testing/native-worker.js +106 -0
  191. package/dist/testing/worker.d.ts +18 -0
  192. package/dist/testing/worker.js +67 -0
  193. package/dist/testing/workers-runtime.d.ts +24 -0
  194. package/dist/testing/workers-runtime.js +33 -0
  195. package/dist/webhook-delivery.d.ts +14 -0
  196. package/dist/webhook-delivery.js +17 -0
  197. package/dist/workers-git.d.ts +285 -0
  198. package/dist/workers-git.js +1174 -0
  199. package/dist/workers.d.ts +352 -0
  200. package/dist/workers.js +866 -0
  201. package/docs/api/README.md +82 -0
  202. package/docs/api/agents.md +332 -0
  203. package/docs/api/app-storage.md +209 -0
  204. package/docs/api/apps.md +1375 -0
  205. package/docs/api/auth.md +63 -0
  206. package/docs/api/build-contract.md +507 -0
  207. package/docs/api/build.md +1476 -0
  208. package/docs/api/cloudflare.md +421 -0
  209. package/docs/api/computer.md +203 -0
  210. package/docs/api/files.md +117 -0
  211. package/docs/api/git.md +470 -0
  212. package/docs/api/host.md +1328 -0
  213. package/docs/api/index.md +430 -0
  214. package/docs/api/invocation.md +738 -0
  215. package/docs/api/keys.md +175 -0
  216. package/docs/api/mcp.md +301 -0
  217. package/docs/api/media.md +40 -0
  218. package/docs/api/modules.md +42 -0
  219. package/docs/api/pack.md +138 -0
  220. package/docs/api/page/mount.md +298 -0
  221. package/docs/api/root-data.md +111 -0
  222. package/docs/api/shell/app-directory.md +332 -0
  223. package/docs/api/shell/command-host.md +224 -0
  224. package/docs/api/shell/commands.md +197 -0
  225. package/docs/api/shell/keys.md +183 -0
  226. package/docs/api/shell/shell-module.md +143 -0
  227. package/docs/api/shell/window-manager.md +267 -0
  228. package/docs/api/shell/workbench.md +186 -0
  229. package/docs/api/shell.md +1788 -0
  230. package/docs/api/tenant.md +194 -0
  231. package/docs/api/workers-git.md +1527 -0
  232. package/docs/api/workers.md +1678 -0
  233. package/docs/media/architecture.mmd +32 -0
  234. package/docs/media/architecture.png +0 -0
  235. package/docs/media/bonsai-network.png +0 -0
  236. package/docs/media/bonsai-repository.png +0 -0
  237. package/docs/site/agent-quickstart.mdx +349 -0
  238. package/examples/git/worker.ts +39 -0
  239. package/examples/git/wrangler.jsonc +32 -0
  240. package/examples/standalone/worker.ts +14 -0
  241. package/examples/standalone/wrangler.jsonc +21 -0
  242. package/package.json +249 -3
@@ -0,0 +1,421 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](modules.md) / cloudflare
8
+
9
+ # cloudflare
10
+
11
+ ## Type Aliases
12
+
13
+ ### FrameBindingProps
14
+
15
+ ```ts
16
+ type FrameBindingProps = Readonly<{
17
+ instanceId: string;
18
+ binding: AppBackendBindingName;
19
+ frameId: string;
20
+ }>;
21
+ ```
22
+
23
+ Host-minted caller-frame routing props; never supplied by the App.
24
+
25
+ ---
26
+
27
+ ### FrameBindingMethod
28
+
29
+ ```ts
30
+ type FrameBindingMethod<Result> = Readonly<{
31
+ decodeArgs: (raw) => readonly unknown[];
32
+ decodeResult: z.ZodType<Result>["parse"];
33
+ requiredOperations: (args) => readonly string[];
34
+ }>;
35
+ ```
36
+
37
+ The host's maintained positional argument/result codecs and operation policy.
38
+
39
+ #### Type Parameters
40
+
41
+ | Type Parameter |
42
+ | -------------- |
43
+ | `Result` |
44
+
45
+ ---
46
+
47
+ ### FrameBindingMethods
48
+
49
+ ```ts
50
+ type FrameBindingMethods<Result> = Readonly<
51
+ Partial<
52
+ Record<
53
+ AppBackendBindingName,
54
+ Readonly<Record<string, FrameBindingMethod<Result>>>
55
+ >
56
+ >
57
+ >;
58
+ ```
59
+
60
+ Method descriptors for the closed App binding vocabulary.
61
+
62
+ #### Type Parameters
63
+
64
+ | Type Parameter |
65
+ | -------------- |
66
+ | `Result` |
67
+
68
+ ---
69
+
70
+ ### AppFacetStub
71
+
72
+ ```ts
73
+ type AppFacetStub = Readonly<{
74
+ fetch: (request) => Promise<Response>;
75
+ }>;
76
+ ```
77
+
78
+ Native facet handle; method RPCs are decoded at the invocation boundary.
79
+
80
+ ---
81
+
82
+ ### AppInstanceContext
83
+
84
+ ```ts
85
+ type AppInstanceContext<FacetClass> = Readonly<{
86
+ id: Readonly<{
87
+ name?: string;
88
+ }>;
89
+ storage: WatchdogSqliteOwner;
90
+ facets: Readonly<{
91
+ get: (name, prepare) => AppFacetStub;
92
+ abort: (name, reason) => void;
93
+ delete: (name) => void;
94
+ }>;
95
+ }>;
96
+ ```
97
+
98
+ Only the native storage and facet capabilities used by an App Instance.
99
+ `FacetClass` is the host's Durable Object class type (`DurableObjectClass` on
100
+ workerd, celld and Cloudflare); Oyster passes it through unopened.
101
+
102
+ #### Type Parameters
103
+
104
+ | Type Parameter |
105
+ | -------------- |
106
+ | `FacetClass` |
107
+
108
+ ---
109
+
110
+ ### AppWorkerCode
111
+
112
+ ```ts
113
+ type AppWorkerCode = Readonly<{
114
+ compatibilityDate: string;
115
+ mainModule: string;
116
+ modules: Readonly<Record<string, string>>;
117
+ env: object;
118
+ globalOutbound: null;
119
+ limits: GuestLimits;
120
+ }>;
121
+ ```
122
+
123
+ The module set the Worker Loader runs for one App backend.
124
+
125
+ ---
126
+
127
+ ### AppInstanceLoader
128
+
129
+ ```ts
130
+ type AppInstanceLoader<FacetClass> = Readonly<{
131
+ get: (
132
+ id,
133
+ configure,
134
+ ) => Readonly<{
135
+ getDurableObjectClass: (exportName) => FacetClass;
136
+ }>;
137
+ }>;
138
+ ```
139
+
140
+ Loader memoization and class lookup; entrypoint access is not required.
141
+
142
+ #### Type Parameters
143
+
144
+ | Type Parameter |
145
+ | -------------- |
146
+ | `FacetClass` |
147
+
148
+ ---
149
+
150
+ ### FrameBindingReply
151
+
152
+ ```ts
153
+ type FrameBindingReply<Value> =
154
+ | Readonly<{
155
+ kind: "result";
156
+ value: Value;
157
+ }>
158
+ | Readonly<{
159
+ kind: "local_refusal";
160
+ code: AppInstanceErrorCode;
161
+ }>;
162
+ ```
163
+
164
+ Private RPC envelope. Domain results, including domain refusals, stay inside
165
+ value.
166
+
167
+ #### Type Parameters
168
+
169
+ | Type Parameter |
170
+ | -------------- |
171
+ | `Value` |
172
+
173
+ ---
174
+
175
+ ### FrameBindingWire
176
+
177
+ ```ts
178
+ type FrameBindingWire<Methods> = {
179
+ [Name in keyof Methods]: Methods[Name] extends (
180
+ args: infer Args,
181
+ ) => Promise<infer Value>
182
+ ? (args: Args) => Promise<FrameBindingReply<Value>>
183
+ : never;
184
+ };
185
+ ```
186
+
187
+ Native entrypoint methods carry the envelope; guest interfaces are restored by
188
+ wrap.
189
+
190
+ #### Type Parameters
191
+
192
+ | Type Parameter |
193
+ | -------------- |
194
+ | `Methods` |
195
+
196
+ ---
197
+
198
+ ### GuestLimits
199
+
200
+ ```ts
201
+ type GuestLimits = Readonly<{
202
+ cpuMs: number;
203
+ subRequests: number;
204
+ }>;
205
+ ```
206
+
207
+ Per-invocation budgets enforced by the guest Worker Loader, including facets.
208
+
209
+ ## Variables
210
+
211
+ ### MAX\_APP\_REPLY\_BYTES
212
+
213
+ ```ts
214
+ const MAX_APP_REPLY_BYTES: number;
215
+ ```
216
+
217
+ Retained shard reply ceiling; replies settle before the frame aborts its facet.
218
+
219
+ ---
220
+
221
+ ### backgroundFrameMethods
222
+
223
+ ```ts
224
+ const backgroundFrameMethods: object;
225
+ ```
226
+
227
+ Shared replay-only port codecs. Origin input is verified by the host and fails
228
+ with a typed refusal.
229
+
230
+ #### Type Declaration
231
+
232
+ | Name | Type | Description |
233
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
234
+ | <a id="property-background"></a> `BACKGROUND` | `object` | - |
235
+ | `BACKGROUND.admit` | `object` | - |
236
+ | `BACKGROUND.admit.decodeArgs()` | (`raw`) => \[`unknown`\] \| `undefined`[] | Malformed arity supplies invalid origin evidence for the host's typed refusal. |
237
+ | `BACKGROUND.admit.decodeResult()` | (`raw`) => \| \{ `kind`: `"admitted"`; \} \| \{ `kind`: `"refused"`; `code`: `"access_changed"`; \} | Preserve the host's closed admitted/refused result. |
238
+ | `BACKGROUND.admit.requiredOperations()` | () => `string`[] | Only the host-minted replay grant supplies this operation. |
239
+
240
+ ---
241
+
242
+ ### frameBindingPropsSchema
243
+
244
+ ```ts
245
+ const frameBindingPropsSchema: Struct<{
246
+ instanceId: Codec<InstanceId, string, never, never>;
247
+ frameId: String;
248
+ binding: refine<
249
+ | "BACKGROUND"
250
+ | "GIT"
251
+ | "EVENTS"
252
+ | "APPS"
253
+ | "WORKFLOWS"
254
+ | "APP_STORAGE"
255
+ | "MEDIA"
256
+ | "COMPUTER"
257
+ | "INBOX"
258
+ | "AGENTS",
259
+ String
260
+ >;
261
+ }>;
262
+ ```
263
+
264
+ The shared RPC boundary decoder for host-minted invocation binding props.
265
+
266
+ ## Functions
267
+
268
+ ### captureFrameBindingReply()
269
+
270
+ ```ts
271
+ function captureFrameBindingReply<Value>(
272
+ run,
273
+ ): Promise<FrameBindingReply<Value>>;
274
+ ```
275
+
276
+ Encode supervisor refusals before native RPC can discard Error properties.
277
+
278
+ #### Type Parameters
279
+
280
+ | Type Parameter |
281
+ | -------------- |
282
+ | `Value` |
283
+
284
+ #### Parameters
285
+
286
+ | Parameter | Type |
287
+ | --------- | -------------------------- |
288
+ | `run` | () => `Promise`\<`Value`\> |
289
+
290
+ #### Returns
291
+
292
+ `Promise`\<[`FrameBindingReply`](#framebindingreply)\<`Value`\>\>
293
+
294
+ ---
295
+
296
+ ### decodeFrameBindingProps()
297
+
298
+ ```ts
299
+ function decodeFrameBindingProps(raw): FrameBindingProps;
300
+ ```
301
+
302
+ Decode a host routing packet or refuse it before any Instance lookup.
303
+
304
+ #### Parameters
305
+
306
+ | Parameter | Type |
307
+ | --------- | --------- |
308
+ | `raw` | `unknown` |
309
+
310
+ #### Returns
311
+
312
+ [`FrameBindingProps`](#framebindingprops)
313
+
314
+ ---
315
+
316
+ ### frameBindingEntrypoint()
317
+
318
+ ```ts
319
+ function frameBindingEntrypoint<Env, Result>(
320
+ methods,
321
+ dispatch,
322
+ ): typeof WorkerEntrypoint;
323
+ ```
324
+
325
+ One native binding factory for both Hub and standalone, preserving RPC values.
326
+
327
+ #### Type Parameters
328
+
329
+ | Type Parameter |
330
+ | -------------- |
331
+ | `Env` |
332
+ | `Result` |
333
+
334
+ #### Parameters
335
+
336
+ | Parameter | Type |
337
+ | ---------- | --------------------------------------------------------------------------------------------------------- |
338
+ | `methods` | [`FrameBindingMethods`](#framebindingmethods)\<`Result`\> |
339
+ | `dispatch` | (`env`, `props`, `method`, `args`) => `Promise`\<[`FrameBindingReply`](#framebindingreply)\<`unknown`\>\> |
340
+
341
+ #### Returns
342
+
343
+ _typeof_ `WorkerEntrypoint`
344
+
345
+ ---
346
+
347
+ ### createCloudflareInvocationGate()
348
+
349
+ ```ts
350
+ function createCloudflareInvocationGate<Host, FacetClass>(
351
+ ctx,
352
+ close,
353
+ ): InvocationGate<Host>;
354
+ ```
355
+
356
+ End the native App facet before shared frame admission releases its permit.
357
+
358
+ #### Type Parameters
359
+
360
+ | Type Parameter |
361
+ | -------------- |
362
+ | `Host` |
363
+ | `FacetClass` |
364
+
365
+ #### Parameters
366
+
367
+ | Parameter | Type |
368
+ | --------- | --------------------------------------------------------------------------------- |
369
+ | `ctx` | `Pick`\<[`AppInstanceContext`](#appinstancecontext)\<`FacetClass`\>, `"facets"`\> |
370
+ | `close` | (`frame`) => `Promise`\<`void`\> |
371
+
372
+ #### Returns
373
+
374
+ [`InvocationGate`](invocation.md#invocationgate)\<`Host`\>
375
+
376
+ ---
377
+
378
+ ### createCloudflareAppInstance()
379
+
380
+ ```ts
381
+ function createCloudflareAppInstance<FacetClass, Host>(
382
+ ctx,
383
+ loader,
384
+ resolve,
385
+ guestEnv,
386
+ limits?,
387
+ ): AppInstance<Host>;
388
+ ```
389
+
390
+ Run an App Instance inside a SQLite-backed Durable Object on workerd, celld or
391
+ Cloudflare. Supervisor state lives in the Durable Object's own SQLite; the App
392
+ backend runs in a named `app` facet loaded through the Worker Loader, so its
393
+ database survives Release replacement and stays separate from the supervisor.
394
+ Guest code gets only host gatekeeper bindings and no ambient outbound access.
395
+
396
+ #### Type Parameters
397
+
398
+ | Type Parameter |
399
+ | -------------- |
400
+ | `FacetClass` |
401
+ | `Host` |
402
+
403
+ #### Parameters
404
+
405
+ | Parameter | Type | Description |
406
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
407
+ | `ctx` | [`AppInstanceContext`](#appinstancecontext)\<`FacetClass`\> | The Durable Object's name, storage and facets. |
408
+ | `loader` | \| `Readonly`\<\{ `get`: (`id`, `configure`) => `Readonly`\<\{ `getDurableObjectClass`: (`exportName`) => `FacetClass`; \}\>; \}\> \| `undefined` | The Worker Loader binding; without it backend execution is unavailable. |
409
+ | `resolve` | (`release`, `scope`) => `Effect`\<`Readonly`\<\{ `release`: `Release`; `digest`: `Sha256Digest`; `backend`: `DurableBackend`; \}\>, `Error`\> | Resolves a Release ID to its verified durable backend. |
410
+ | `guestEnv` | (`frame`) => `object` | Mints loopbacks bound to the captured invocation frame. |
411
+ | `limits?` | `Partial`\<`Readonly`\<\{ `cpuMs`: `number`; `subRequests`: `number`; \}\>\> | Guest CPU and subrequest budgets; omitted fields use safe defaults. |
412
+
413
+ #### Returns
414
+
415
+ [`AppInstance`](index.md#appinstance)\<`Host`\>
416
+
417
+ ## References
418
+
419
+ ### BackgroundFrameState
420
+
421
+ Re-exports [BackgroundFrameState](invocation.md#backgroundframestate)
@@ -0,0 +1,203 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](modules.md) / computer
8
+
9
+ # computer
10
+
11
+ ## Type Aliases
12
+
13
+ ### ComputerTerminalSelection
14
+
15
+ ```ts
16
+ type ComputerTerminalSelection = Readonly<{
17
+ computerId: string | null;
18
+ terminalUrl: string | null;
19
+ }>;
20
+ ```
21
+
22
+ Current host admission for the Computer captured when the terminal opened.
23
+
24
+ ---
25
+
26
+ ### ComputerTerminalAccess
27
+
28
+ ```ts
29
+ type ComputerTerminalAccess = (
30
+ signal,
31
+ ) => Promise<ComputerTerminalSelection> & object;
32
+ ```
33
+
34
+ Host admission on connection and lease renewal; unleased input rechecks it.
35
+
36
+ #### Type Declaration
37
+
38
+ | Name | Type | Description |
39
+ | ------------------- | ------------------------ | --------------------------------------------------------------- |
40
+ | `leaseExpiresAt()?` | () => `number` \| `null` | Current admission deadline, when the host uses expiring leases. |
41
+
42
+ ---
43
+
44
+ ### ComputerTerminalConnect
45
+
46
+ ```ts
47
+ type ComputerTerminalConnect = (terminalUrl, input) => WebSocket;
48
+ ```
49
+
50
+ Host transport construction; the shared protocol owns PTY session identity.
51
+
52
+ #### Parameters
53
+
54
+ | Parameter | Type |
55
+ | ------------- | ----------------------------------------------------------------- |
56
+ | `terminalUrl` | `string` |
57
+ | `input` | `ComputerTerminalSize` & `Readonly`\<\{ `session`: `string`; \}\> |
58
+
59
+ #### Returns
60
+
61
+ `WebSocket`
62
+
63
+ ---
64
+
65
+ ### ComputerTerminalHostOptions
66
+
67
+ ```ts
68
+ type ComputerTerminalHostOptions = Readonly<{
69
+ terminalUrl: string;
70
+ computerId: string | null;
71
+ hostWindow: Readonly<{
72
+ setTimeout: (callback, delayMs) => number;
73
+ clearTimeout: (timer) => void;
74
+ }>;
75
+ ensureAccess: ComputerTerminalAccess;
76
+ connect: ComputerTerminalConnect;
77
+ mountSignal: AbortSignal | undefined;
78
+ }>;
79
+ ```
80
+
81
+ Host policy and browser lifetime surrounding the retained PTY protocol.
82
+
83
+ ---
84
+
85
+ ### ComputerTerminalHost
86
+
87
+ ```ts
88
+ type ComputerTerminalHost = object;
89
+ ```
90
+
91
+ Terminal operations and lifetime for one admitted App window.
92
+
93
+ #### Methods
94
+
95
+ ##### open()
96
+
97
+ ```ts
98
+ open(size): Promise<AppComputerTerminal>;
99
+ ```
100
+
101
+ Open an admitted PTY and retain its session across transport reconnects.
102
+
103
+ ###### Parameters
104
+
105
+ | Parameter | Type |
106
+ | --------- | ---------------------- |
107
+ | `size` | `ComputerTerminalSize` |
108
+
109
+ ###### Returns
110
+
111
+ `Promise`\<`AppComputerTerminal`\>
112
+
113
+ ##### \[dispose\]()
114
+
115
+ ```ts
116
+ dispose: void;
117
+ ```
118
+
119
+ Close every terminal when the App window's host lifetime ends.
120
+
121
+ ###### Returns
122
+
123
+ `void`
124
+
125
+ ## Variables
126
+
127
+ ### ComputerTerminalHost
128
+
129
+ ```ts
130
+ ComputerTerminalHost: (options) => ComputerTerminalHost;
131
+ ```
132
+
133
+ Construct the shared terminal owner with host policy and transport edges.
134
+
135
+ Construct the shared terminal owner with host policy and transport edges.
136
+
137
+ #### Parameters
138
+
139
+ | Parameter | Type |
140
+ | --------- | ------------------------------------------------------------- |
141
+ | `options` | [`ComputerTerminalHostOptions`](#computerterminalhostoptions) |
142
+
143
+ #### Returns
144
+
145
+ [`ComputerTerminalHost`](#computerterminalhost-1)
146
+
147
+ ---
148
+
149
+ ### computerSlots
150
+
151
+ ```ts
152
+ const computerSlots: object;
153
+ ```
154
+
155
+ Computer routes supplied by the host; execution stays in the Computer runtime.
156
+
157
+ #### Type Declaration
158
+
159
+ | Name | Type | Default value |
160
+ | ------------------------------------------- | ------------------- | --------------------------- |
161
+ | <a id="property-ports"></a> `ports` | `object` | - |
162
+ | `ports.id` | `string` | `computerPorts.id` |
163
+ | `ports.version` | `number` | `computerPorts.version` |
164
+ | `ports.base` | `"/computer/"` | `"/computer/"` |
165
+ | `ports.methods` | `object` | - |
166
+ | `ports.methods.list` | `object` | - |
167
+ | `ports.methods.list.kind` | `"json"` | `"json"` |
168
+ | `ports.methods.list.method` | `"GET"` | `"GET"` |
169
+ | `ports.methods.list.path` | `"ports"` | `"ports"` |
170
+ | `ports.methods.expose` | `object` | - |
171
+ | `ports.methods.expose.kind` | `"json"` | `"json"` |
172
+ | `ports.methods.expose.method` | `"POST"` | `"POST"` |
173
+ | `ports.methods.expose.path` | `"ports/expose"` | `"ports/expose"` |
174
+ | `ports.methods.unexpose` | `object` | - |
175
+ | `ports.methods.unexpose.kind` | `"json"` | `"json"` |
176
+ | `ports.methods.unexpose.method` | `"POST"` | `"POST"` |
177
+ | `ports.methods.unexpose.path` | `"ports/unexpose"` | `"ports/unexpose"` |
178
+ | <a id="property-processes"></a> `processes` | `object` | - |
179
+ | `processes.id` | `string` | `computerProcesses.id` |
180
+ | `processes.version` | `number` | `computerProcesses.version` |
181
+ | `processes.base` | `"/computer/"` | `"/computer/"` |
182
+ | `processes.methods` | `object` | - |
183
+ | `processes.methods.start` | `object` | - |
184
+ | `processes.methods.start.kind` | `"json"` | `"json"` |
185
+ | `processes.methods.start.method` | `"POST"` | `"POST"` |
186
+ | `processes.methods.start.path` | `"processes/start"` | `"processes/start"` |
187
+ | `processes.methods.list` | `object` | - |
188
+ | `processes.methods.list.kind` | `"json"` | `"json"` |
189
+ | `processes.methods.list.method` | `"GET"` | `"GET"` |
190
+ | `processes.methods.list.path` | `"processes"` | `"processes"` |
191
+ | `processes.methods.kill` | `object` | - |
192
+ | `processes.methods.kill.kind` | `"json"` | `"json"` |
193
+ | `processes.methods.kill.method` | `"POST"` | `"POST"` |
194
+ | `processes.methods.kill.path` | `"processes/kill"` | `"processes/kill"` |
195
+ | <a id="property-terminal"></a> `terminal` | `object` | - |
196
+ | `terminal.id` | `string` | `computerTerminal.id` |
197
+ | `terminal.version` | `number` | `computerTerminal.version` |
198
+ | `terminal.base` | `"/computer/"` | `"/computer/"` |
199
+ | `terminal.methods` | `object` | - |
200
+ | `terminal.methods.open` | `object` | - |
201
+ | `terminal.methods.open.kind` | `"transport"` | `"transport"` |
202
+ | `terminal.methods.open.method` | `"GET"` | `"GET"` |
203
+ | `terminal.methods.open.path` | `"terminal"` | `"terminal"` |