@fungi.computer/oyster 0.2.0 → 0.3.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 (287) hide show
  1. package/README.md +376 -72
  2. package/dist/agents.d.ts +3 -2
  3. package/dist/agents.js +4 -2
  4. package/dist/app-builds.d.ts +81 -8
  5. package/dist/app-builds.js +210 -60
  6. package/dist/app-storage.d.ts +3 -3
  7. package/dist/approval-capability.d.ts +5 -0
  8. package/dist/approval-capability.js +46 -0
  9. package/dist/approval-home.d.ts +51 -0
  10. package/dist/approval-home.js +226 -0
  11. package/dist/apps/catalog.d.ts +335 -0
  12. package/dist/apps/catalog.js +46 -0
  13. package/dist/apps/gate.d.ts +20 -6
  14. package/dist/apps/gate.js +42 -16
  15. package/dist/apps/index.d.ts +3 -1
  16. package/dist/apps/index.js +3 -1
  17. package/dist/apps/installation.d.ts +132 -51
  18. package/dist/apps/installation.js +176 -70
  19. package/dist/apps/permissions.d.ts +247 -0
  20. package/dist/apps/permissions.js +255 -0
  21. package/dist/boot-capability-route.d.ts +15 -0
  22. package/dist/boot-capability-route.js +196 -0
  23. package/dist/boot-capability.d.ts +103 -0
  24. package/dist/boot-capability.js +141 -0
  25. package/dist/boot-construction.d.ts +12 -0
  26. package/dist/boot-construction.js +175 -0
  27. package/dist/boot-gate.d.ts +267 -0
  28. package/dist/boot-gate.js +236 -0
  29. package/dist/boot-host-script.d.ts +2 -0
  30. package/dist/boot-host-script.js +1 -0
  31. package/dist/boot-mount.d.ts +21 -0
  32. package/dist/boot-mount.js +65 -0
  33. package/dist/browser/boot.d.ts +73 -0
  34. package/dist/browser/boot.js +502 -0
  35. package/dist/browser/browser.d.ts +104 -0
  36. package/dist/browser/browser.js +374 -0
  37. package/dist/browser/capability-source.d.ts +76 -0
  38. package/dist/browser/capability-source.js +338 -0
  39. package/dist/browser/cdp-client.d.ts +56 -0
  40. package/dist/browser/cdp-client.js +184 -0
  41. package/dist/browser/errors.d.ts +79 -0
  42. package/dist/browser/errors.js +32 -0
  43. package/dist/browser/index.d.ts +16 -0
  44. package/dist/browser/index.js +14 -0
  45. package/dist/browser/lease-registry.d.ts +61 -0
  46. package/dist/browser/lease-registry.js +101 -0
  47. package/dist/browser/operations.d.ts +225 -0
  48. package/dist/browser/operations.js +137 -0
  49. package/dist/browser/page.d.ts +25 -0
  50. package/dist/browser/page.js +172 -0
  51. package/dist/browser/quick-reads.d.ts +29 -0
  52. package/dist/browser/quick-reads.js +160 -0
  53. package/dist/browser/sessions.d.ts +52 -0
  54. package/dist/browser/sessions.js +118 -0
  55. package/dist/browser/url-policy.d.ts +18 -0
  56. package/dist/browser/url-policy.js +58 -0
  57. package/dist/build/app-imports.d.ts +12 -0
  58. package/dist/build/app-imports.js +105 -0
  59. package/dist/build/build-policy.d.ts +5 -3
  60. package/dist/build/build-policy.js +5 -3
  61. package/dist/build/candidate-builder.d.ts +1 -1
  62. package/dist/build/candidate-cli.mjs +8375 -334
  63. package/dist/build/local-build.d.ts +2 -0
  64. package/dist/build/local-build.js +28 -6
  65. package/dist/build/snapshot-package-store.d.ts +1 -1
  66. package/dist/build/snapshot-package-store.js +7 -2
  67. package/dist/build/workspace-build.d.ts +92 -5
  68. package/dist/build/workspace-build.js +93 -19
  69. package/dist/build.d.ts +1 -1
  70. package/dist/build.js +1 -1
  71. package/dist/catalog-frame.js +1 -1
  72. package/dist/cloudflare.d.ts +13 -3
  73. package/dist/cloudflare.js +102 -4
  74. package/dist/frame-binding-wire-script.js +1 -1
  75. package/dist/frame-binding-wire.js +4 -2
  76. package/dist/git-auth.d.ts +0 -2
  77. package/dist/git-auth.js +0 -2
  78. package/dist/git.d.ts +0 -1
  79. package/dist/git.js +0 -2
  80. package/dist/host.d.ts +39 -13
  81. package/dist/host.js +268 -142
  82. package/dist/index.d.ts +25 -15
  83. package/dist/index.js +39 -16
  84. package/dist/install-release-cli.d.ts +2 -0
  85. package/dist/install-release-cli.js +46 -0
  86. package/dist/installation-client.d.ts +43 -0
  87. package/dist/installation-client.js +178 -0
  88. package/dist/installation-execution.d.ts +11 -0
  89. package/dist/installation-execution.js +184 -0
  90. package/dist/installation-operations.d.ts +1437 -0
  91. package/dist/installation-operations.js +664 -0
  92. package/dist/installation-store-generation.d.ts +3 -0
  93. package/dist/installation-store-generation.js +16 -0
  94. package/dist/instance-id.d.ts +10 -0
  95. package/dist/instance-id.js +10 -0
  96. package/dist/instance-refusal.d.ts +11 -0
  97. package/dist/instance-refusal.js +21 -0
  98. package/dist/internal/delivery.js +4 -2
  99. package/dist/internal/host-gate.js +7 -1
  100. package/dist/internal/registry-installations.js +4 -4
  101. package/dist/keys.d.ts +5 -1
  102. package/dist/keys.js +10 -2
  103. package/dist/machine-link/authority.d.ts +89 -0
  104. package/dist/machine-link/authority.js +37 -0
  105. package/dist/machine-link/client.d.ts +66 -0
  106. package/dist/machine-link/client.js +94 -0
  107. package/dist/machine-link/delivery.d.ts +18 -0
  108. package/dist/machine-link/delivery.js +55 -0
  109. package/dist/machine-link/enrollment.d.ts +111 -0
  110. package/dist/machine-link/enrollment.js +286 -0
  111. package/dist/machine-link/fences.d.ts +37 -0
  112. package/dist/machine-link/fences.js +166 -0
  113. package/dist/machine-link/home.d.ts +20 -0
  114. package/dist/machine-link/home.js +24 -0
  115. package/dist/machine-link/host.d.ts +43 -0
  116. package/dist/machine-link/host.js +189 -0
  117. package/dist/machine-link/index.d.ts +15 -0
  118. package/dist/machine-link/index.js +15 -0
  119. package/dist/machine-link/link.d.ts +48 -0
  120. package/dist/machine-link/link.js +223 -0
  121. package/dist/machine-link/presence.d.ts +10 -0
  122. package/dist/machine-link/presence.js +25 -0
  123. package/dist/machine-link/workers.d.ts +6 -0
  124. package/dist/machine-link/workers.js +6 -0
  125. package/dist/mcp-owner.d.ts +2 -2
  126. package/dist/mcp-owner.js +41 -33
  127. package/dist/mcp.d.ts +15 -3
  128. package/dist/mcp.js +146 -25
  129. package/dist/pack.d.ts +14 -3
  130. package/dist/pack.js +44 -19
  131. package/dist/page/app-access.d.ts +7 -0
  132. package/dist/page/app-access.js +75 -0
  133. package/dist/page/boot-host.js +57 -0
  134. package/dist/page/capabilities.d.ts +3 -3
  135. package/dist/page/capabilities.js +16 -12
  136. package/dist/page/computer-handles.d.ts +3 -3
  137. package/dist/page/computer-target.d.ts +3 -0
  138. package/dist/page/computer-target.js +9 -0
  139. package/dist/page/mount.d.ts +23 -3
  140. package/dist/page/mount.js +152 -16
  141. package/dist/page-assets.d.ts +22 -0
  142. package/dist/page-assets.js +28 -0
  143. package/dist/page-script.d.ts +3 -0
  144. package/dist/page-script.js +5 -4
  145. package/dist/release.d.ts +13 -6
  146. package/dist/release.js +10 -7
  147. package/dist/root-data.d.ts +16 -6
  148. package/dist/root-data.js +2 -2
  149. package/dist/source/index.d.ts +1 -1
  150. package/dist/source/team-source.d.ts +20 -8
  151. package/dist/source/team-source.js +39 -10
  152. package/dist/source/template-seed.d.ts +2 -2
  153. package/dist/standalone/agent-mail.d.ts +24 -0
  154. package/dist/standalone/agent-mail.js +62 -0
  155. package/dist/standalone/agent-store.d.ts +9 -0
  156. package/dist/standalone/agent-store.js +30 -0
  157. package/dist/standalone/agents.d.ts +68 -9
  158. package/dist/standalone/agents.js +428 -56
  159. package/dist/standalone/app-builds-binding.d.ts +20 -2
  160. package/dist/standalone/app-builds-binding.js +147 -23
  161. package/dist/standalone/app-set.d.ts +5 -2
  162. package/dist/standalone/app-set.js +174 -143
  163. package/dist/standalone/browser.d.ts +11 -0
  164. package/dist/standalone/browser.js +72 -0
  165. package/dist/standalone/builds.d.ts +13 -4
  166. package/dist/standalone/builds.js +28 -44
  167. package/dist/standalone/computer-egress.d.ts +2 -0
  168. package/dist/standalone/computer-egress.js +13 -4
  169. package/dist/standalone/computer-fleet.d.ts +43 -0
  170. package/dist/standalone/computer-fleet.js +200 -0
  171. package/dist/standalone/computer.d.ts +44 -9
  172. package/dist/standalone/computer.js +129 -22
  173. package/dist/standalone/install-apps-cli.js +43 -6
  174. package/dist/standalone/instance.d.ts +2 -2
  175. package/dist/standalone/instance.js +8 -11
  176. package/dist/standalone/machine-link.d.ts +354 -0
  177. package/dist/standalone/machine-link.js +368 -0
  178. package/dist/standalone/media.d.ts +2 -2
  179. package/dist/standalone/media.js +19 -16
  180. package/dist/standalone/preview.d.ts +2 -2
  181. package/dist/standalone/preview.js +37 -10
  182. package/dist/standalone/registry.d.ts +149 -9
  183. package/dist/standalone/registry.js +299 -8
  184. package/dist/standalone/worker.d.ts +19 -5
  185. package/dist/standalone/worker.js +90 -54
  186. package/dist/standalone/workflow-binding.d.ts +18 -22
  187. package/dist/standalone/workflow-binding.js +18 -18
  188. package/dist/standalone/workflow-control.d.ts +4 -0
  189. package/dist/standalone/workflow-control.js +40 -0
  190. package/dist/standalone/workflow-events.d.ts +2 -2
  191. package/dist/standalone/workflow-events.js +9 -10
  192. package/dist/standalone/workflow-git-capture.js +4 -3
  193. package/dist/standalone/workflow-host.d.ts +162 -161
  194. package/dist/standalone/workflow-host.js +101 -21
  195. package/dist/standalone/workflow-node-capture.js +11 -4
  196. package/dist/standalone/workflow-schedules.d.ts +5 -2
  197. package/dist/standalone/workflow-schedules.js +9 -10
  198. package/dist/standalone/workflow-trigger-host.d.ts +65 -5
  199. package/dist/standalone/workflow-trigger-host.js +2 -2
  200. package/dist/standalone/workflow-webhooks.d.ts +22 -0
  201. package/dist/standalone/workflow-webhooks.js +39 -0
  202. package/dist/standalone/workflows.d.ts +140 -43
  203. package/dist/standalone/workflows.js +198 -39
  204. package/dist/storage-frame.d.ts +6 -6
  205. package/dist/testing/capabilities.js +14 -3
  206. package/dist/testing/installation.js +26 -2
  207. package/dist/testing/worker.js +1 -1
  208. package/dist/testing/workers-runtime.d.ts +8 -2
  209. package/dist/testing/workers-runtime.js +20 -2
  210. package/dist/webhook-abuse.d.ts +25 -0
  211. package/dist/webhook-abuse.js +54 -0
  212. package/dist/webhook-custody.d.ts +144 -0
  213. package/dist/webhook-custody.js +222 -0
  214. package/dist/webhook-ingress.d.ts +36 -0
  215. package/dist/webhook-ingress.js +146 -0
  216. package/dist/webhooks.d.ts +111 -0
  217. package/dist/webhooks.js +189 -0
  218. package/dist/workers-git.d.ts +12 -17
  219. package/dist/workers-git.js +60 -52
  220. package/dist/workers.d.ts +224 -13
  221. package/dist/workers.js +351 -51
  222. package/dist/workflow-agent-authority.d.ts +8 -0
  223. package/dist/workflow-agent-authority.js +42 -0
  224. package/dist/workflows.d.ts +66 -0
  225. package/dist/workflows.js +97 -0
  226. package/docs/api/README.md +63 -37
  227. package/docs/api/agents.md +17 -0
  228. package/docs/api/app-storage.md +1 -1
  229. package/docs/api/apps.md +1394 -543
  230. package/docs/api/browser/boot.md +132 -0
  231. package/docs/api/browser.md +1440 -0
  232. package/docs/api/build-contract.md +38 -25
  233. package/docs/api/build.md +263 -84
  234. package/docs/api/cloudflare.md +93 -7
  235. package/docs/api/git.md +3 -13
  236. package/docs/api/host.md +944 -118
  237. package/docs/api/index.md +320 -18
  238. package/docs/api/keys.md +24 -1
  239. package/docs/api/mcp.md +59 -12
  240. package/docs/api/modules.md +33 -40
  241. package/docs/api/pack.md +57 -8
  242. package/docs/api/page/mount.md +92 -4
  243. package/docs/api/workers-git.md +103 -24
  244. package/docs/api/workers.md +1581 -244
  245. package/docs/site/agent-quickstart.mdx +28 -14
  246. package/examples/standalone/worker.ts +3 -1
  247. package/examples/standalone/wrangler.jsonc +2 -0
  248. package/package.json +73 -71
  249. package/dist/installation-consent.d.ts +0 -81
  250. package/dist/installation-consent.js +0 -84
  251. package/dist/shell/app-directory.d.ts +0 -542
  252. package/dist/shell/app-directory.js +0 -196
  253. package/dist/shell/browser-actions.d.ts +0 -7
  254. package/dist/shell/browser-actions.js +0 -56
  255. package/dist/shell/command-host.d.ts +0 -112
  256. package/dist/shell/command-host.js +0 -502
  257. package/dist/shell/commands.d.ts +0 -25
  258. package/dist/shell/commands.js +0 -78
  259. package/dist/shell/index.d.ts +0 -8
  260. package/dist/shell/index.js +0 -8
  261. package/dist/shell/keys.d.ts +0 -41
  262. package/dist/shell/keys.js +0 -134
  263. package/dist/shell/shell-module.d.ts +0 -55
  264. package/dist/shell/shell-module.js +0 -86
  265. package/dist/shell/window-manager.d.ts +0 -128
  266. package/dist/shell/window-manager.js +0 -730
  267. package/dist/shell/workbench-contract.d.ts +0 -68
  268. package/dist/shell/workbench-directory.d.ts +0 -332
  269. package/dist/shell/workbench-directory.js +0 -35
  270. package/dist/shell/workbench-host-types.d.ts +0 -96
  271. package/dist/shell/workbench-host-types.js +0 -1
  272. package/dist/shell/workbench-host.d.ts +0 -34
  273. package/dist/shell/workbench-host.js +0 -352
  274. package/dist/shell/workbench-model.d.ts +0 -194
  275. package/dist/shell/workbench-model.js +0 -53
  276. package/dist/shell/workbench.d.ts +0 -4
  277. package/dist/shell/workbench.js +0 -2
  278. package/docs/api/shell/app-directory.md +0 -599
  279. package/docs/api/shell/command-host.md +0 -224
  280. package/docs/api/shell/commands.md +0 -197
  281. package/docs/api/shell/keys.md +0 -183
  282. package/docs/api/shell/shell-module.md +0 -204
  283. package/docs/api/shell/window-manager.md +0 -267
  284. package/docs/api/shell/workbench-directory.md +0 -119
  285. package/docs/api/shell/workbench.md +0 -205
  286. package/docs/api/shell.md +0 -1915
  287. /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
package/dist/workers.d.ts CHANGED
@@ -1,4 +1,12 @@
1
+ import type { ApprovalListInput, ApprovalAnswerInput, AutoApproveInput } from "@fungi.computer/approvals";
2
+ import type { HostActor } from "@fungi.computer/puffball/app";
3
+ import { type OysterApprovalCall } from "./approval-home.js";
4
+ import { type BootCapabilityGrant, type BootCapabilityLease } from "./boot-capability.js";
1
5
  import { type Installation } from "./apps/installation.js";
6
+ import { type BrowserBinding } from "./browser/sessions.js";
7
+ import { type InstallationOperationRequest, type InstallationOperationReply } from "./installation-operations.js";
8
+ import { installationWorkerEntrypoint } from "./installation-execution.js";
9
+ export { installationWorkerEntrypoint };
2
10
  import { type BackgroundSyncRefusal } from "@fungi.computer/puffball/background-replay";
3
11
  import { type TenantScope, type TenantId } from "./tenant.js";
4
12
  import { type GillCall, type GillReply } from "@fungi.computer/gills";
@@ -13,16 +21,15 @@ import { DurableObject, type WorkerEntrypoint } from "cloudflare:workers";
13
21
  import * as Schema from "effect/Schema";
14
22
  import type { Release } from "@fungi.computer/puffball";
15
23
  import { type Backend, type Instance, type OwnerState } from "./index.js";
16
- import { type FrameBindingReply, type FrameBindingMethod, type FrameBindingProps } from "./cloudflare.js";
24
+ import { r2ArtifactStore, type FrameBindingReply, type FrameBindingMethod, type FrameBindingProps } from "./cloudflare.js";
17
25
  import { type BackgroundFrameState, type InvocationFacts, type InvocationFrame } from "./invocation.js";
18
26
  import { type InstallationCommit, type InstanceResult, type OysterAuth, type OysterHost, type OysterJson } from "./host.js";
19
27
  import { type AppStorageResult, type AppStorageWrite, type AppStorageReset, type ResolvedAppStorage } from "@fungi.computer/agar/storage";
20
28
  import { type OysterRootDirectory } from "./root-data.js";
21
- import { type ArtifactHeads, type ArtifactStore } from "./release.js";
22
29
  import type { AppApi } from "@fungi.computer/puffball";
23
30
  import type { AppDeclaration } from "@fungi.computer/puffball/app";
24
31
  import { createOysterAppSourceReceipts, createOysterAppRegistrations, createOysterArtifactsRepositoryMetadataStore } from "./app-sources.js";
25
- export { r2FileSource, ownerKeyAuth };
32
+ export { r2ArtifactStore, r2FileSource, ownerKeyAuth };
26
33
  /** Native values returned by the standalone Git, event and JSON binding owners. */
27
34
  export type OysterBindingResult = Awaited<ReturnType<GitBinding[keyof GitBinding]>> | Schema.Json | undefined;
28
35
  /** Verified backend custody is captured in the frame, never in a current-context field. */
@@ -44,6 +51,8 @@ export type OysterStorageAgentDirectory = Readonly<{
44
51
  }>;
45
52
  /** Bindings a standalone Oyster Worker declares in its Wrangler config. */
46
53
  export type OysterWorkerEnv = Readonly<{
54
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
55
+ BROWSER?: BrowserBinding;
47
56
  /** The owner's sign-in key, at least 24 characters (a secret). */
48
57
  OYSTER_OWNER_KEY: string;
49
58
  /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
@@ -63,18 +72,120 @@ export type OysterWorkerEnv = Readonly<{
63
72
  /** Worker Loader that runs App backends. */
64
73
  LOADER: WorkerLoader;
65
74
  }>;
66
- /** Store Release artifacts in an R2 bucket. */
67
- export declare function r2ArtifactStore(bucket: R2Bucket): ArtifactStore & ArtifactHeads;
68
75
  /** The installation registry: one SQLite-backed Durable Object per Oyster. */
69
- export declare class OysterRegistry extends DurableObject<OysterWorkerEnv> {
76
+ export declare class OysterRegistry<Env extends OysterWorkerEnv = OysterWorkerEnv> extends DurableObject<Env> {
70
77
  #private;
78
+ /** The plain root has the same single owner-key host as OysterInstance. */
79
+ protected hostFor(scope: TenantScope): Promise<OysterHost>;
80
+ /** Trusted host RPC; an operation input cannot select actor, namespace or tenant. */
81
+ approvalSubmit(pin: Readonly<{
82
+ tenantId: string;
83
+ origin: string;
84
+ }>, call: OysterApprovalCall): Promise<{
85
+ readonly kind: "pending_approval";
86
+ readonly recordId: string;
87
+ readonly description: {
88
+ readonly title: string;
89
+ readonly inputBytes: number;
90
+ readonly inputSha256: string;
91
+ };
92
+ } | import("@fungi.computer/approvals").ApprovalApplyResult>;
93
+ private approvalHome;
94
+ /** Recover approved work from the durable home, not a last-request memory pin. */
95
+ private approvalAlarm;
96
+ /** Read a bounded page for the current member of the pinned native home. */
97
+ approvalList(pin: Readonly<{
98
+ tenantId: string;
99
+ origin: string;
100
+ }>, actor: HostActor, input: ApprovalListInput): Promise<Readonly<{
101
+ items: readonly import("@fungi.computer/approvals").ApprovalView[];
102
+ nextCursor: string | null;
103
+ }>>;
104
+ /** Read one member-scoped view; the native home resolves membership again. */
105
+ approvalGet(pin: Readonly<{
106
+ tenantId: string;
107
+ origin: string;
108
+ }>, actor: HostActor, input: Readonly<{
109
+ recordId: string;
110
+ }>): Promise<{
111
+ readonly record: {
112
+ readonly revision: number;
113
+ readonly by: {
114
+ readonly kind: "human";
115
+ readonly memberId: string;
116
+ } | {
117
+ readonly kind: "policy";
118
+ } | null;
119
+ readonly description: {
120
+ readonly title: string;
121
+ readonly inputBytes: number;
122
+ readonly inputSha256: string;
123
+ };
124
+ readonly operation: string;
125
+ readonly access: "write" | "external";
126
+ readonly expiresAt: number;
127
+ readonly reason: "pending" | "expired" | "not-found" | "not-eligible" | "already-answered" | "stale-revision" | "declined" | "fenced" | "not-granted" | "read-only" | "in-flight" | "outcome-unknown" | "identity-conflict" | null;
128
+ readonly updatedAt: number;
129
+ readonly module: string;
130
+ readonly recordId: string;
131
+ readonly authorityFence: string;
132
+ readonly requester: {
133
+ readonly principalId: string;
134
+ readonly agentId: string | null;
135
+ readonly sessionId: string | null;
136
+ readonly displayName: string;
137
+ };
138
+ readonly reversibility: "reversible" | "irreversible-external";
139
+ readonly state: "pending" | "expired" | "denied" | "applied" | "requested" | "approved" | "claimed" | "outcome_unknown";
140
+ readonly requestedAt: number;
141
+ readonly evidence?: readonly {
142
+ readonly kind: "artifact";
143
+ readonly ref: string;
144
+ readonly mediaType: "image/png";
145
+ readonly bytes: number;
146
+ }[] | undefined;
147
+ };
148
+ readonly canAnswer: boolean;
149
+ readonly canSetAutoApprove: boolean;
150
+ } | null>;
151
+ /** Persist an eligible answer and attempt its native decision work once. */
152
+ approvalAnswer(pin: Readonly<{
153
+ tenantId: string;
154
+ origin: string;
155
+ }>, actor: HostActor, input: ApprovalAnswerInput): Promise<Readonly<{
156
+ kind: "refused";
157
+ reason: "pending" | "expired" | "not-found" | "not-eligible" | "already-answered" | "stale-revision" | "declined" | "fenced" | "not-granted" | "read-only" | "in-flight" | "outcome-unknown" | "identity-conflict";
158
+ }> | Readonly<{
159
+ kind: "answered";
160
+ view: import("@fungi.computer/approvals").ApprovalView;
161
+ }>>;
162
+ /** Policy never grants operation authority; only the live Oyster owner may change it. */
163
+ approvalSetAutoApprove(pin: Readonly<{
164
+ tenantId: string;
165
+ origin: string;
166
+ }>, actor: HostActor, input: AutoApproveInput): Promise<Readonly<{
167
+ kind: "refused";
168
+ reason: "pending" | "expired" | "not-found" | "not-eligible" | "already-answered" | "stale-revision" | "declined" | "fenced" | "not-granted" | "read-only" | "in-flight" | "outcome-unknown" | "identity-conflict";
169
+ }> | Readonly<{
170
+ kind: "updated";
171
+ rule: AutoApproveInput;
172
+ }>>;
71
173
  /** Append-only App source seed receipts; a Git-capable subclass forks over these. */
72
174
  protected readonly appSourceReceipts: ReturnType<typeof createOysterAppSourceReceipts>;
73
175
  /** Team-owned fork registrations, one App publisher record per App. */
74
176
  protected readonly appRegistrations: ReturnType<typeof createOysterAppRegistrations>;
75
177
  /** Durable Artifacts repository provenance for this Oyster's own fork compositions. */
76
178
  protected readonly artifactsRepositories: ReturnType<typeof createOysterArtifactsRepositoryMetadataStore>;
77
- constructor(ctx: DurableObjectState, env: OysterWorkerEnv);
179
+ constructor(ctx: DurableObjectState, env: Env);
180
+ /** The installation owner's RPC: admit, read, load, plan or commit one
181
+ * retained command for the caller's tenant scope. */
182
+ installationOperation(input: InstallationOperationRequest): Promise<InstallationOperationReply>;
183
+ /**
184
+ * One Registry wake serves both owners: installation work, then the native
185
+ * approval home. Each re-arms only an earlier wake, so neither postpones the
186
+ * other, and one owner's failure never skips the other's quantum.
187
+ */
188
+ alarm(): Promise<void>;
78
189
  /** Current desktop metadata; roles are the ADR's derived default, never Hub's stored choice. */
79
190
  directory(): Promise<OysterRootDirectory>;
80
191
  /** Read one key for the authenticated root owner, under fresh App admission. */
@@ -104,12 +215,24 @@ export declare class OysterRegistry extends DurableObject<OysterWorkerEnv> {
104
215
  list(): Installation[];
105
216
  /** One installation record, or `null`. */
106
217
  get(installationId: string): Installation | null;
107
- /** Create or replace one installation record. */
108
- put(installation: Installation, tenantId?: TenantId): Promise<void>;
218
+ /** Durable store identity, regenerated only when the store itself is replaced. */
219
+ generation(): string;
109
220
  /** Native RPC returns a closed result; callers never classify a transported Error. */
110
- compareAndPut(installation: Installation, expectedAuthorityVersion: number, tenantId?: TenantId): Promise<InstallationCommit>;
221
+ compareAndPut(installation: Installation, expectedAuthorityVersion: number, expectedGeneration: string, tenantId?: TenantId): Promise<InstallationCommit>;
111
222
  private writeInstallation;
112
223
  private decode;
224
+ /** Issue, resolve, or revoke one bounded capability without storing its token. */
225
+ bootCapability(input: Readonly<{
226
+ kind: "issue";
227
+ grant: BootCapabilityGrant;
228
+ }> | Readonly<{
229
+ kind: "resolve";
230
+ tokenDigest: string;
231
+ now: number;
232
+ }> | Readonly<{
233
+ kind: "revoke";
234
+ id: string;
235
+ }>): BootCapabilityLease | null | undefined;
113
236
  }
114
237
  /** What a binding row may read from the Instance that owns the frame. */
115
238
  export type OysterBindingContext<Env> = Readonly<{
@@ -153,6 +276,10 @@ export declare function oysterBindingEntrypoint<Env extends OysterWorkerEnv>(tab
153
276
  /** The plain Oyster host's bindings: App storage, the read-only catalog and replay admission. */
154
277
  export declare const oysterBindings: OysterBindingTable<OysterWorkerEnv>;
155
278
  declare const OysterBinding_base: abstract new (ctx: ExecutionContext, env: Readonly<{
279
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
280
+ BROWSER?: Readonly<{
281
+ fetch: import("./browser/cdp-client.js").HttpFetch;
282
+ }>;
156
283
  /** The owner's sign-in key, at least 24 characters (a secret). */
157
284
  OYSTER_OWNER_KEY: string;
158
285
  /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
@@ -178,6 +305,10 @@ declare const OysterBinding_base: abstract new (ctx: ExecutionContext, env: Read
178
305
  /** Worker Loader that runs App backends. */
179
306
  LOADER: WorkerLoader;
180
307
  }>) => WorkerEntrypoint<Readonly<{
308
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
309
+ BROWSER?: Readonly<{
310
+ fetch: import("./browser/cdp-client.js").HttpFetch;
311
+ }>;
181
312
  /** The owner's sign-in key, at least 24 characters (a secret). */
182
313
  OYSTER_OWNER_KEY: string;
183
314
  /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
@@ -234,7 +365,7 @@ export declare class OysterInstance<Env extends OysterWorkerEnv = OysterWorkerEn
234
365
  private readonly gitJournal;
235
366
  constructor(ctx: DurableObjectState, env: Env);
236
367
  /** The deployable root's host for one pinned tenant; this plain root is the single owner key. */
237
- protected hostFor(scope: TenantScope): OysterHost;
368
+ protected hostFor(scope: TenantScope): Promise<OysterHost>;
238
369
  /** Reconstruct current host admission for each wake; non-default tenants get no wakes. */
239
370
  protected backgroundHost(): Promise<OysterHost | null>;
240
371
  private localInstance;
@@ -263,7 +394,10 @@ export declare class OysterInstance<Env extends OysterWorkerEnv = OysterWorkerEn
263
394
  private assertCurrent;
264
395
  private withFrame;
265
396
  private release;
266
- /** Remember `release`, then apply the owner state under the host's tenant pin. */
397
+ private rememberRelease;
398
+ /** Reuse lifecycle preflight without changing the active runtime or its budgets. */
399
+ prepare(state: OwnerState, release: Release, limits?: GuestLimits, tenant?: Pick<TenantScope, "tenantId" | "origin">): Promise<InstanceResult<import("./boot-gate.js").UiBootCheckOutcome | null>>;
400
+ /** Activate the exact committed selection under the host's tenant pin. */
267
401
  apply(state: OwnerState, release: Release, limits: GuestLimits | undefined, tenant: Pick<TenantScope, "tenantId" | "origin">): Promise<InstanceResult<Instance>>;
268
402
  /** Forward an admitted HTTP request to the App backend. */
269
403
  backend(facts: InvocationFacts, request: Request, limits?: GuestLimits, tenantId?: TenantId): Promise<Response>;
@@ -286,12 +420,21 @@ export type OysterWorkspace = Readonly<{
286
420
  /** Caller-scoped Computer calls; file-only workspaces omit it. */
287
421
  computer?: OysterHost["computer"];
288
422
  }>;
289
- /** Host adapters for a standalone Oyster Worker over its own bindings. */
423
+ /** Resolve a scoped boot URL through the registry-backed HTTPS asset route. */
424
+ export declare function serveOysterBootCapability(request: Request, env: OysterWorkerEnv, scope: TenantScope): Promise<Response | null>;
425
+ /**
426
+ * Create an Oyster host backed by this Worker environment's registry,
427
+ * artifacts, Instances, and boot-check service.
428
+ */
290
429
  export declare function oysterWorkerHost(env: OysterWorkerEnv, auth: OysterAuth, options?: Pick<OysterHost, "guestLimits" | "appToolPolicy"> & Readonly<{
291
430
  workspace?: OysterWorkspace;
292
431
  scope?: TenantScope;
293
432
  }>): OysterHost;
294
433
  declare const OysterMcp_base: new (ctx: DurableObjectState, env: Readonly<{
434
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
435
+ BROWSER?: Readonly<{
436
+ fetch: import("./browser/cdp-client.js").HttpFetch;
437
+ }>;
295
438
  /** The owner's sign-in key, at least 24 characters (a secret). */
296
439
  OYSTER_OWNER_KEY: string;
297
440
  /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
@@ -317,6 +460,10 @@ declare const OysterMcp_base: new (ctx: DurableObjectState, env: Readonly<{
317
460
  /** Worker Loader that runs App backends. */
318
461
  LOADER: WorkerLoader;
319
462
  }>) => OysterMcpOwner<Readonly<{
463
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
464
+ BROWSER?: Readonly<{
465
+ fetch: import("./browser/cdp-client.js").HttpFetch;
466
+ }>;
320
467
  /** The owner's sign-in key, at least 24 characters (a secret). */
321
468
  OYSTER_OWNER_KEY: string;
322
469
  /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
@@ -345,6 +492,70 @@ declare const OysterMcp_base: new (ctx: DurableObjectState, env: Readonly<{
345
492
  /** The non-git standalone root's MCP owner. */
346
493
  export declare class OysterMcp extends OysterMcp_base {
347
494
  }
495
+ declare const OysterInstallationExecutor_base: new (ctx: ExecutionContext, env: Readonly<{
496
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
497
+ BROWSER?: Readonly<{
498
+ fetch: import("./browser/cdp-client.js").HttpFetch;
499
+ }>;
500
+ /** The owner's sign-in key, at least 24 characters (a secret). */
501
+ OYSTER_OWNER_KEY: string;
502
+ /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
503
+ OYSTER_OWNER_NAME?: string;
504
+ /** Optional existing fleet owner; absence grants no Agent storage authority. */
505
+ AGENT_DIRECTORY?: Readonly<{
506
+ /** Resolve the host-owned fleet directory by its existing durable name. */
507
+ getByName(name: string): Readonly<{
508
+ /** Return the recorded creator, or null when the Agent has no owner record. */
509
+ readCreator(agentId: string): Promise<string | null>;
510
+ }>;
511
+ }>;
512
+ /** Canonical configured origin; requests cannot choose the owner tenant. */
513
+ OYSTER_ORIGIN: string;
514
+ /** One tenant-scoped MCP session owner. Required when serving /mcp. */
515
+ MCP: DurableObjectNamespace<OysterMcpOwner>;
516
+ /** Release artifacts, keyed by artifact reference. */
517
+ RELEASES: R2Bucket;
518
+ /** The installation registry. */
519
+ REGISTRY: DurableObjectNamespace<OysterRegistry>;
520
+ /** One Durable Object per App Instance. */
521
+ INSTANCES: DurableObjectNamespace<OysterInstance>;
522
+ /** Worker Loader that runs App backends. */
523
+ LOADER: WorkerLoader;
524
+ }>) => WorkerEntrypoint<Readonly<{
525
+ /** Cloudflare Browser Run binding for the UI boot check and the agent browser. */
526
+ BROWSER?: Readonly<{
527
+ fetch: import("./browser/cdp-client.js").HttpFetch;
528
+ }>;
529
+ /** The owner's sign-in key, at least 24 characters (a secret). */
530
+ OYSTER_OWNER_KEY: string;
531
+ /** The single-tenant owner's identity, also recorded by the existing fleet creator. */
532
+ OYSTER_OWNER_NAME?: string;
533
+ /** Optional existing fleet owner; absence grants no Agent storage authority. */
534
+ AGENT_DIRECTORY?: Readonly<{
535
+ /** Resolve the host-owned fleet directory by its existing durable name. */
536
+ getByName(name: string): Readonly<{
537
+ /** Return the recorded creator, or null when the Agent has no owner record. */
538
+ readCreator(agentId: string): Promise<string | null>;
539
+ }>;
540
+ }>;
541
+ /** Canonical configured origin; requests cannot choose the owner tenant. */
542
+ OYSTER_ORIGIN: string;
543
+ /** One tenant-scoped MCP session owner. Required when serving /mcp. */
544
+ MCP: DurableObjectNamespace<OysterMcpOwner>;
545
+ /** Release artifacts, keyed by artifact reference. */
546
+ RELEASES: R2Bucket;
547
+ /** The installation registry. */
548
+ REGISTRY: DurableObjectNamespace<OysterRegistry>;
549
+ /** One Durable Object per App Instance. */
550
+ INSTANCES: DurableObjectNamespace<OysterInstance>;
551
+ /** Worker Loader that runs App backends. */
552
+ LOADER: WorkerLoader;
553
+ }>, unknown> & {
554
+ run(): Promise<import("./installation-operations.js").InstallationOutcome>;
555
+ };
556
+ /** Ordinary Worker execution; REGISTRY receives references and receipts only. */
557
+ export declare class OysterInstallationExecutor extends OysterInstallationExecutor_base {
558
+ }
348
559
  /**
349
560
  * The standalone Worker's `fetch` handler; frontend hosts are cached per env.
350
561
  * MCP transports belong to the tenant Durable Object, independent of that cache.