@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,285 @@
1
+ import { type OysterTenancy, type ResolvedTenant, type TenantScope } from "./tenant.js";
2
+ /**
3
+ * Cloudflare adapters for git Apps on a standalone Oyster: the GIT binding
4
+ * over Artifacts, named keys for agents, and signed webhook delivery for App
5
+ * events. Every credential and secret stays in these host objects.
6
+ */
7
+ import { DurableObject } from "cloudflare:workers";
8
+ import { type InvocationFrame } from "./invocation.js";
9
+ import { Hono } from "hono";
10
+ import { type GitBinding } from "@fungi.computer/agar/git";
11
+ import { type GitDoorTarget, type StandardWebhookPayload } from "./git.js";
12
+ import { type KeyStore } from "@fungi.computer/ear-tag/keys";
13
+ import type { Grant } from "@fungi.computer/ear-tag/grants";
14
+ import { type LiveOysterKey, type OysterKeyCapability } from "./keys.js";
15
+ import { type OysterAgents } from "./agents.js";
16
+ import { type ArtifactsNamespace } from "@fungi.computer/burrow";
17
+ import { type HostEventSource, type HostRecipientEvent, type RecipientDelivery } from "./event-recipients.js";
18
+ export type { HostEventSource, HostRecipientEvent, RecipientDelivery, } from "./event-recipients.js";
19
+ import { type OysterCapability, type OysterEnv, type OysterGitHost, type OysterHost } from "./host.js";
20
+ import type { GitWriter } from "@fungi.computer/agar/git";
21
+ import { OysterInstance, type OysterBindingContext, type OysterBindingRow, type OysterBindingTable, type OysterWorkspace, type OysterWorkerEnv, type OysterInvocationHost } from "./workers.js";
22
+ /** The GIT binding plus the credential only the host's git door may use. */
23
+ export type ArtifactsGit = Omit<GitBinding, "cloneUrl"> & Readonly<{
24
+ /** The provider remote and a credential; never given to the App. */
25
+ credential(name: string, scope: "read" | "write"): Promise<Readonly<{
26
+ remote: string;
27
+ token: string;
28
+ }>>;
29
+ }>;
30
+ /** The GIT binding over Artifacts for one installation (`prefix` scopes its names).
31
+ * Credentials remain host-held and are reused until thirty seconds before the
32
+ * provider expiry or eight minutes, whichever comes first. Every operation still
33
+ * checks its captured grant. Provider 401/403 discards the credential for remint.
34
+ */
35
+ export declare function createArtifactsGit(binding: ArtifactsNamespace, prefix: string, grant: Readonly<{
36
+ operations: readonly string[];
37
+ /** Recheck the captured host invocation immediately before provider work. */
38
+ beforeProvider?: () => void;
39
+ }>): ArtifactsGit;
40
+ /**
41
+ * Named keys an owner issues directly: an Ear Tag key store scoped to this
42
+ * tenant. A key's id is the name the owner chose for it, so forks and other
43
+ * name-derived identities (`service.ts:95`) stay stable across a reissue.
44
+ * Plaintext keys are never stored.
45
+ */
46
+ export declare class OysterKeys extends DurableObject<OysterKeysEnv> {
47
+ #private;
48
+ constructor(ctx: DurableObjectState, env: OysterKeysEnv);
49
+ /**
50
+ * Issue a key named `name`, its id too. Refuses `conflict` once a name has
51
+ * been used, including by a now-revoked key: a name is never reused.
52
+ */
53
+ issue(owner: string, input: Readonly<{
54
+ name: string;
55
+ grants: readonly Grant<OysterKeyCapability>[];
56
+ expiresAt?: number;
57
+ }>): ReturnType<KeyStore<OysterKeyCapability>["issue"]>;
58
+ /** Revoke a key by id; idempotent on repeat. */
59
+ revoke(owner: string, requestId: string, keyId: string): ReturnType<KeyStore<OysterKeyCapability>["revoke"]>;
60
+ /** Every key this tenant has issued, newest first. */
61
+ list(owner: string): ReturnType<KeyStore<OysterKeyCapability>["list"]>;
62
+ /** Verify a bearer secret and return its current principal. */
63
+ verify(secret: string): ReturnType<KeyStore<OysterKeyCapability>["verify"]>;
64
+ /** The live facts behind one key id, for the host's `keys.live` port; `null` for an unknown, revoked, expired or suspended key. */
65
+ live(keyId: string): Promise<LiveOysterKey | null>;
66
+ }
67
+ /** Bindings the keys and webhook objects need: none of their own. */
68
+ export type OysterKeysEnv = Readonly<Record<never, never>>;
69
+ /** One webhook subscription for an installation's events. */
70
+ export type WebhookSubscription = Readonly<{
71
+ id: string;
72
+ installationId: string;
73
+ url: string;
74
+ /** Event types delivered; empty means every type. */
75
+ types: readonly string[];
76
+ createdAt: number;
77
+ }>;
78
+ /** A new subscription and its signing secret, shown once. */
79
+ export type SubscriptionCreated = Readonly<{
80
+ subscription: WebhookSubscription;
81
+ secret: string;
82
+ }>;
83
+ /** One delivery attempt record. */
84
+ export type WebhookDelivery = Readonly<{
85
+ id: string;
86
+ subscription: string;
87
+ type: string;
88
+ state: "pending" | "delivered" | "failed";
89
+ attempts: number;
90
+ lastStatus: number | null;
91
+ updatedAt: number;
92
+ }>;
93
+ /**
94
+ * The tenant's App event delivery owner: webhook subscriptions with signed,
95
+ * retried deliveries, and host recipients with durable per-recipient records.
96
+ * An emit commits here and returns; every delivery happens on the alarm.
97
+ */
98
+ export declare class OysterWebhooks<Env extends OysterKeysEnv = OysterKeysEnv> extends DurableObject<Env> {
99
+ #private;
100
+ constructor(ctx: DurableObjectState, env: Env);
101
+ /**
102
+ * A root that names host recipients delivers to them here. This host has
103
+ * none, so a row that names one fails rather than claiming delivery.
104
+ */
105
+ protected deliverToRecipient(delivery: Readonly<{
106
+ recipient: string;
107
+ event: HostRecipientEvent;
108
+ }>): Promise<void>;
109
+ /** Arm the one alarm no later than `at`; webhooks and recipients share it. */
110
+ private wakeBy;
111
+ /** Recent deliveries to one host recipient, newest first. */
112
+ recipientDeliveries(recipient: string): RecipientDelivery[];
113
+ /** Subscribe `url` to an installation's events; returns the secret once. */
114
+ subscribe(input: {
115
+ installationId: string;
116
+ url: string;
117
+ types: readonly string[];
118
+ secret?: string | undefined;
119
+ }): SubscriptionCreated;
120
+ /** Every subscription. */
121
+ subscriptions(): WebhookSubscription[];
122
+ /** Remove a subscription and its deliveries. */
123
+ unsubscribe(id: string): boolean;
124
+ /** Recent deliveries for one subscription, newest first. */
125
+ deliveries(subscription: string): WebhookDelivery[];
126
+ /**
127
+ * Accept an emitted event: queue it for every matching subscription and
128
+ * every named host recipient (idempotent per event id). Nothing is delivered
129
+ * before this returns, so no recipient can fail the emitter's write.
130
+ */
131
+ enqueue(source: HostEventSource, payload: StandardWebhookPayload, eventId: string, recipients: readonly string[]): Promise<number>;
132
+ /** Deliver due webhooks and recipient rows, then schedule the next retry. */
133
+ alarm(): Promise<void>;
134
+ }
135
+ /** Bindings the git adapters read from a standalone Oyster Worker. */
136
+ export type OysterGitEnv = Readonly<{
137
+ /** The Artifacts Workers binding, where the runtime has one (Cloudflare). */
138
+ ARTIFACTS?: ArtifactsNamespace;
139
+ /**
140
+ * Otherwise Artifacts is reached over its REST API (celld, Node): the
141
+ * account, the namespace, and an API token secret with Artifacts access.
142
+ */
143
+ ARTIFACTS_ACCOUNT_ID?: string;
144
+ ARTIFACTS_NAMESPACE?: string;
145
+ ARTIFACTS_API_TOKEN?: string;
146
+ KEYS: DurableObjectNamespace<OysterKeys>;
147
+ WEBHOOKS: DurableObjectNamespace<OysterWebhooks>;
148
+ }>;
149
+ /** The Artifacts namespace: the binding when present, else the REST API. */
150
+ export declare function artifactsOf(env: OysterGitEnv): ArtifactsNamespace;
151
+ /**
152
+ * EVENTS: commit the emit to this tenant's delivery owner and return. Webhook
153
+ * subscribers and the host recipients a root names are delivered afterwards,
154
+ * so a subscriber outage never fails the emitting App's write.
155
+ */
156
+ export declare function eventsBindingFor<Env extends OysterGitWorkerEnv>(recipients: (context: OysterBindingContext<Env>, frame: InvocationFrame<OysterInvocationHost>) => Promise<readonly string[]>): OysterBindingRow<Env>;
157
+ /** EVENTS for a host with webhook subscribers only. */
158
+ export declare const eventsBinding: OysterBindingRow<OysterGitWorkerEnv>;
159
+ /** The plain host's bindings plus native GIT over Artifacts and signed EVENTS. */
160
+ export declare const gitBindings: OysterBindingTable<OysterGitWorkerEnv>;
161
+ declare const OysterBinding_base: abstract new (ctx: ExecutionContext, env: OysterGitWorkerEnv) => CloudflareWorkersModule.WorkerEntrypoint<OysterGitWorkerEnv, Readonly<{
162
+ instanceId: string;
163
+ binding: import("@fungi.computer/puffball/app").AppBackendBindingName;
164
+ frameId: string;
165
+ }>>;
166
+ /** A git Worker's one guest binding entrypoint, over `gitBindings`. */
167
+ export declare class OysterBinding extends OysterBinding_base {
168
+ }
169
+ /** One listed or issued key's owner-facing summary; never its secret or owner id. */
170
+ export type OysterKeySummary = Readonly<{
171
+ keyId: string;
172
+ name: string;
173
+ grants: readonly Grant<OysterKeyCapability>[];
174
+ expiresAt: number | null;
175
+ createdAt: number;
176
+ lastUsedAt: number | null;
177
+ revokedAt: number | null;
178
+ }>;
179
+ /** Owner routes for keys and webhooks; `createOyster` mounts them owner-only. */
180
+ export declare function gitAdminRoutes(env: OysterGitEnv, scope: TenantScope): Hono<OysterEnv>;
181
+ /** A standalone Oyster Worker that also hosts git Apps. */
182
+ export type OysterGitWorkerEnv = OysterWorkerEnv & OysterGitEnv & Readonly<{
183
+ /** This Oyster's public origin, for clone URLs (e.g. https://oyster.example). */
184
+ OYSTER_ORIGIN: string;
185
+ /** The owner's display name, used as their actor id (default "owner"). */
186
+ OYSTER_OWNER_NAME?: string;
187
+ }>;
188
+ /**
189
+ * An App Instance whose backend may also receive declared Git and Events
190
+ * bindings. Background wakes readmit members through the deployable root's
191
+ * `hostFor`, the same composition HTTP and MCP use.
192
+ */
193
+ export declare abstract class OysterGitInstance<Env extends OysterGitWorkerEnv = OysterGitWorkerEnv> extends OysterInstance<Env> {
194
+ protected readonly bindings: OysterBindingTable<Env>;
195
+ /** The deployable root's host for one pinned tenant: `root.hostFor(this.env, scope)`. */
196
+ protected abstract hostFor(scope: TenantScope): OysterHost;
197
+ }
198
+ /**
199
+ * One deployable Git root's options. Every door (HTTP, MCP, Agents, Workflows,
200
+ * background wakes) composes its tenant host from this one value through
201
+ * `oysterGitRoot(options).hostFor`.
202
+ */
203
+ export type OysterGitWorkerOptions<Env extends OysterGitWorkerEnv> = Readonly<{
204
+ /** Resolve one host-selected tenant before authentication; unknown origins refuse.
205
+ * A single-owner root passes `ownerOrKeyTenancy`. */
206
+ tenancy: (env: Env) => OysterTenancy;
207
+ /** Select the installed home App in the deployable root, independently of core. */
208
+ homeInstallationId?: (env: Env) => string;
209
+ /** Host browser composition; core imports no dashboard App. */
210
+ pageScript?: string;
211
+ /** Connect this Worker’s Agent directory and transports. */
212
+ agents?: (env: Env, scope: TenantScope) => OysterAgents;
213
+ /**
214
+ * Select this host's workspace once, before constructing its HTTP and MCP
215
+ * host. `keysLive` is the same owner-checked port `host.keys.live` uses
216
+ * below: a key's own `computer.use`-style grant check belongs to the
217
+ * workspace, but whether that key's owner is still this tenant's live
218
+ * owner is this one port's job, never reimplemented against `env.KEYS`.
219
+ */
220
+ workspace?: (env: Env, keysLive: OysterKeysLivePort) => OysterWorkspace;
221
+ /** Additional capabilities share the exact workspace selected for the base host. */
222
+ capabilities?: (env: Env, workspace: OysterWorkspace, keysLive: OysterKeysLivePort) => readonly OysterCapability[];
223
+ /** Admit a host-minted Workflow Git pass for one repository and scope;
224
+ * omit when this host mints no Workflow Git passes. */
225
+ workflowGitPass?: (env: Env, scope: TenantScope, pass: string, target: GitDoorTarget) => Promise<Extract<GitWriter, {
226
+ kind: "actor";
227
+ }> | null>;
228
+ /** Admit a host-minted build job clone pass; omit when this host builds no Apps. */
229
+ buildGitPass?: (env: Env, scope: TenantScope, pass: string, target: GitDoorTarget) => Promise<Extract<GitWriter, {
230
+ kind: "actor";
231
+ }> | null>;
232
+ /** Further owner-only routes this host serves, after the owner guard. */
233
+ ownerRoutes?: (env: Env, scope: TenantScope) => Hono<OysterEnv>;
234
+ }>;
235
+ /** A tenant's whole Git host: the App server, `host.git` and the owner routes. */
236
+ export type OysterGitWorkerHost = OysterHost & Readonly<{
237
+ git: OysterGitHost;
238
+ }>;
239
+ /**
240
+ * `host.keys.live`'s own shape: the live facts behind a key id, re-checked
241
+ * against the tenant's current owner on every read; null for an unknown,
242
+ * revoked, expired, suspended key, or one a since-reassigned tenant's
243
+ * former owner held. The one path every caller -- the HTTP/MCP host, a
244
+ * workspace's own Computer admission -- reaches a key's liveness through.
245
+ */
246
+ export type OysterKeysLivePort = (keyId: string) => Promise<LiveOysterKey | null>;
247
+ /** The one composition root of a Git Worker; build it once from its options. */
248
+ export type OysterGitRoot<Env extends OysterGitWorkerEnv> = Readonly<{
249
+ /** Select a request's tenant once; `hostFor` reuses that admission for the same request. */
250
+ admit(env: Env, request: Request): Promise<ResolvedTenant | null>;
251
+ /** One pinned tenant's host. HTTP, MCP, Agents, Workflows and background wakes all reach it here. */
252
+ hostFor(env: Env, scope: TenantScope): OysterGitWorkerHost;
253
+ }>;
254
+ /** Compose a Git Worker's root from its one options value. */
255
+ export declare function oysterGitRoot<Env extends OysterGitWorkerEnv>(options: OysterGitWorkerOptions<Env>): OysterGitRoot<Env>;
256
+ /** The single-owner root's tenancy: the owner key or a named key, at the configured origin only. */
257
+ export declare function ownerOrKeyTenancy(env: OysterGitWorkerEnv): OysterTenancy;
258
+ /** The standalone Worker's `fetch` handler with the git door and owner routes. */
259
+ export declare function createOysterGitWorker<Env extends OysterGitWorkerEnv>(root: OysterGitRoot<Env>): ExportedHandler<Env>;
260
+ /** What `oysterWorkerGit` needs beyond the Worker's bindings. */
261
+ export type OysterWorkerGitOptions<Env extends OysterGitWorkerEnv> = Pick<OysterGitWorkerOptions<Env>, "workflowGitPass" | "buildGitPass"> & Readonly<{
262
+ /** The tenant whose registry and repositories Git reaches. */
263
+ scope: TenantScope;
264
+ }>;
265
+ /** One live guest frame's Git custody; never a guest argument. */
266
+ export type OysterGitFrame = Readonly<{
267
+ /** Verified backend custody of the host's live frame; its abort stops provider work. */
268
+ invocation: InvocationFrame<OysterInvocationHost>;
269
+ /** Host-owned physical adapter for this frame; admission stays packet-local. */
270
+ store?: ArtifactsGit;
271
+ }>;
272
+ /**
273
+ * `host.git` for an Oyster Worker: the git door's writer projection and the
274
+ * admitted, installation-scoped Artifacts path with the App's push policy and
275
+ * the Instance journal. Set it on your own `createOyster` host; the full
276
+ * standalone composition (`oysterGitWorkerHost`) uses this same builder.
277
+ */
278
+ export declare function oysterWorkerGit<Env extends OysterGitWorkerEnv>(env: Env, options: OysterWorkerGitOptions<Env>, frame?: OysterGitFrame): OysterGitHost;
279
+ /**
280
+ * One selected tenant's whole host from a root's options. Roots reach it through
281
+ * `oysterGitRoot(options).hostFor`; a cold directory passes its own resolved tenant.
282
+ */
283
+ export declare function oysterGitWorkerHost<Env extends OysterGitWorkerEnv>(env: Env, options: OysterGitWorkerOptions<Env>, selected: ResolvedTenant): OysterGitWorkerHost;
284
+ /** Deploy the MCP owner from the same root as createOysterGitWorker. */
285
+ export declare function createOysterGitMcpOwner<Env extends OysterGitWorkerEnv>(root: OysterGitRoot<Env>): new (ctx: DurableObjectState, env: Env) => import("./mcp-owner.js").OysterMcpOwner<Env>;