@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,1375 @@
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) / apps
8
+
9
+ # apps
10
+
11
+ ## Type Aliases
12
+
13
+ ### HostPrincipal
14
+
15
+ ```ts
16
+ type HostPrincipal = Readonly<{
17
+ actor:
18
+ | HostActor
19
+ | Readonly<{
20
+ kind: "visitor";
21
+ }>;
22
+ role: "owner" | "member" | null;
23
+ }>;
24
+ ```
25
+
26
+ Attested by the host, never authenticated by decoding request JSON.
27
+
28
+ ---
29
+
30
+ ### GateRequest
31
+
32
+ ```ts
33
+ type GateRequest = z.output<typeof gateRequestSchema>;
34
+ ```
35
+
36
+ One decoded method, route, binding or catalog admission request.
37
+
38
+ ---
39
+
40
+ ### GateFacts
41
+
42
+ ```ts
43
+ type GateFacts = Readonly<{
44
+ principal: HostPrincipal;
45
+ installation: Installation;
46
+ declaration: AppDeclaration;
47
+ declaredOperations: DeclaredOperations;
48
+ api: AppApi | null;
49
+ access: AppToolAccess | null;
50
+ pins?: Readonly<{
51
+ authorityVersion: number;
52
+ artifactDigest: string;
53
+ }>;
54
+ }>;
55
+ ```
56
+
57
+ Immutable values the host already read; resource/grantor freshness remains
58
+ host-owned.
59
+
60
+ ---
61
+
62
+ ### InvocationGrants
63
+
64
+ ```ts
65
+ type InvocationGrants = z.output<typeof invocationGrantsSchema>;
66
+ ```
67
+
68
+ The explicit binding ceiling passed to an invocation frame.
69
+
70
+ ---
71
+
72
+ ### AppMethodDeclaration
73
+
74
+ ```ts
75
+ type AppMethodDeclaration = AppApi["methods"][string];
76
+ ```
77
+
78
+ A declared method from the canonical Puffball API grammar.
79
+
80
+ ---
81
+
82
+ ### GateDecision
83
+
84
+ ```ts
85
+ type GateDecision =
86
+ | Readonly<{
87
+ kind: "admitted";
88
+ grants: InvocationGrants;
89
+ method?: AppMethodDeclaration;
90
+ }>
91
+ | z.output<typeof gateRefusalSchema>;
92
+ ```
93
+
94
+ Either an admitted scoped ceiling or one closed refusal code.
95
+
96
+ ---
97
+
98
+ ### AppMethodMetadataDecision
99
+
100
+ ```ts
101
+ type AppMethodMetadataDecision =
102
+ | Readonly<{
103
+ kind: "admitted";
104
+ method: AppMethodDeclaration;
105
+ }>
106
+ | z.output<typeof gateRefusalSchema>;
107
+ ```
108
+
109
+ Permission metadata only: this is neither an invocation grant nor input
110
+ admission.
111
+
112
+ ---
113
+
114
+ ### ResourceRef
115
+
116
+ ```ts
117
+ type ResourceRef = Exclude<ApprovedGrant["resources"], "tenant-scope">[number];
118
+ ```
119
+
120
+ Installation records and pure admission rules; tenant state and commits stay
121
+ host-owned.
122
+
123
+ ---
124
+
125
+ ### ApprovedGrant
126
+
127
+ ```ts
128
+ type ApprovedGrant = Readonly<z.output<typeof approvedGrantSchema>>;
129
+ ```
130
+
131
+ Installation records and pure admission rules; tenant state and commits stay
132
+ host-owned.
133
+
134
+ ---
135
+
136
+ ### GrantRequest
137
+
138
+ ```ts
139
+ type GrantRequest = Extract<
140
+ InstallationCommand,
141
+ {
142
+ kind: "install";
143
+ }
144
+ >["grants"];
145
+ ```
146
+
147
+ Installation records and pure admission rules; tenant state and commits stay
148
+ host-owned.
149
+
150
+ ---
151
+
152
+ ### Approval
153
+
154
+ ```ts
155
+ type Approval = NonNullable<Installation["approval"]>;
156
+ ```
157
+
158
+ Installation records and pure admission rules; tenant state and commits stay
159
+ host-owned.
160
+
161
+ ---
162
+
163
+ ### DeclaredOperations
164
+
165
+ ```ts
166
+ type DeclaredOperations = Readonly<z.output<typeof declaredOperationsSchema>>;
167
+ ```
168
+
169
+ Installation records and pure admission rules; tenant state and commits stay
170
+ host-owned.
171
+
172
+ ---
173
+
174
+ ### CapabilityOperationDescriptor
175
+
176
+ ```ts
177
+ type CapabilityOperationDescriptor = Pick<
178
+ CapabilityDescriptor,
179
+ "id" | "methods"
180
+ > &
181
+ Readonly<{
182
+ permission: ApprovedGrant["capability"];
183
+ }>;
184
+ ```
185
+
186
+ Use the existing adapter's permission and methods; hosts author no operation
187
+ lists.
188
+
189
+ ---
190
+
191
+ ### Installation
192
+
193
+ ```ts
194
+ type Installation = Readonly<z.output<typeof installationSchema>>;
195
+ ```
196
+
197
+ Installation records and pure admission rules; tenant state and commits stay
198
+ host-owned.
199
+
200
+ ---
201
+
202
+ ### InstallationCommand
203
+
204
+ ```ts
205
+ type InstallationCommand = z.output<typeof installationCommandSchema>;
206
+ ```
207
+
208
+ Installation records and pure admission rules; tenant state and commits stay
209
+ host-owned.
210
+
211
+ ---
212
+
213
+ ### InstallationContext
214
+
215
+ ```ts
216
+ type InstallationContext = Readonly<{
217
+ by: HostActor;
218
+ role: "owner" | "member" | null;
219
+ expectedVersion: number | null;
220
+ declaration: AppDeclaration;
221
+ declaredOperations: DeclaredOperations;
222
+ now: number;
223
+ identity: Pick<Installation, "installationId" | "instanceId">;
224
+ anonymousConsent?: Readonly<{
225
+ memberId: string;
226
+ }>;
227
+ }>;
228
+ ```
229
+
230
+ Values captured by the host; identities and time are never generated by the
231
+ reducer.
232
+
233
+ ---
234
+
235
+ ### InstallationRefusal
236
+
237
+ ```ts
238
+ type InstallationRefusal = z.output<typeof installationRefusalSchema>;
239
+ ```
240
+
241
+ Installation records and pure admission rules; tenant state and commits stay
242
+ host-owned.
243
+
244
+ ---
245
+
246
+ ### InstallationUpdate
247
+
248
+ ```ts
249
+ type InstallationUpdate = Readonly<{
250
+ next: Installation;
251
+ authorityChanged: boolean;
252
+ }>;
253
+ ```
254
+
255
+ Installation records and pure admission rules; tenant state and commits stay
256
+ host-owned.
257
+
258
+ ---
259
+
260
+ ### InstallationReader
261
+
262
+ ```ts
263
+ type InstallationReader = Readonly<{
264
+ list: Promise<readonly Readonly<{
265
+ installationId: string;
266
+ instanceId: InstanceId | null;
267
+ appId: AppId;
268
+ release: {
269
+ releaseId: Schema.refine<ReleaseId, Schema.String>;
270
+ appId: Schema.refine<AppId, Schema.String>;
271
+ artifact: Schema.Struct<{
272
+ artifactRef: Schema.refine<ArtifactRef, Schema.String>;
273
+ artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
274
+ provenance: Schema.Struct<{
275
+ sourceRevision: ...;
276
+ sourceTreeDigest: ...;
277
+ buildRecipeDigest: ...;
278
+ }>;
279
+ }>;
280
+ };
281
+ releasePin: "pinned" | "floating";
282
+ authorityVersion: number;
283
+ status: "enabled" | "disabled" | "deleted";
284
+ visibility: "private" | "public";
285
+ declaredOperationsDigest: Sha256Digest;
286
+ approvedGrants: readonly Readonly<{
287
+ capability: | "agent.list"
288
+ | "agent.manage"
289
+ | "agent.rename"
290
+ | "agent.toolPolicy"
291
+ | "agent.read"
292
+ | "agent.send"
293
+ | "computer.list"
294
+ | "computer.readFile"
295
+ | "computer.writeFile"
296
+ | "computer.execute"
297
+ | "llm.generation"
298
+ | "media.generation"
299
+ | "games:servers"
300
+ | "git.repository"
301
+ | "apps.open"
302
+ | "apps.call"
303
+ | "app.storage"
304
+ | "app.events.emit"
305
+ | "team.workbenchHost"
306
+ | "marketplace.browse"
307
+ | "marketplace.purchase"
308
+ | "workflow.run"
309
+ | "workflow.publish"
310
+ | "workflow.arm"
311
+ | "world"
312
+ | "channels.read"
313
+ | "channels.personal.manage";
314
+ capabilityApproved: true;
315
+ operations: readonly string[];
316
+ resources: "tenant-scope" | readonly ...[];
317
+ }>[];
318
+ approval: | Readonly<{
319
+ by: | {
320
+ kind: ...;
321
+ memberId: ...;
322
+ }
323
+ | {
324
+ kind: ...;
325
+ agentId: ...;
326
+ }
327
+ | {
328
+ kind: ...;
329
+ keyId: ...;
330
+ };
331
+ at: number;
332
+ authorityVersion: number;
333
+ }>
334
+ | null;
335
+ approvedAnonymousMethods: readonly Readonly<{
336
+ name: string;
337
+ digest: Sha256Digest;
338
+ }>[];
339
+ anonymousApproval: | Readonly<{
340
+ by: | {
341
+ kind: ...;
342
+ memberId: ...;
343
+ }
344
+ | {
345
+ kind: ...;
346
+ agentId: ...;
347
+ }
348
+ | {
349
+ kind: ...;
350
+ keyId: ...;
351
+ };
352
+ at: number;
353
+ authorityVersion: number;
354
+ }>
355
+ | null;
356
+ }>[]>;
357
+ get: Promise<
358
+ | Readonly<{
359
+ installationId: string;
360
+ instanceId: InstanceId | null;
361
+ appId: AppId;
362
+ release: {
363
+ releaseId: Schema.refine<ReleaseId, Schema.String>;
364
+ appId: Schema.refine<AppId, Schema.String>;
365
+ artifact: Schema.Struct<{
366
+ artifactRef: Schema.refine<ArtifactRef, Schema.String>;
367
+ artifactDigest: Schema.refine<Sha256Digest, Schema.String>;
368
+ provenance: Schema.Struct<{
369
+ sourceRevision: ...;
370
+ sourceTreeDigest: ...;
371
+ buildRecipeDigest: ...;
372
+ }>;
373
+ }>;
374
+ };
375
+ releasePin: "pinned" | "floating";
376
+ authorityVersion: number;
377
+ status: "enabled" | "disabled" | "deleted";
378
+ visibility: "private" | "public";
379
+ declaredOperationsDigest: Sha256Digest;
380
+ approvedGrants: readonly Readonly<{
381
+ capability: | "agent.list"
382
+ | "agent.manage"
383
+ | "agent.rename"
384
+ | "agent.toolPolicy"
385
+ | "agent.read"
386
+ | "agent.send"
387
+ | "computer.list"
388
+ | "computer.readFile"
389
+ | "computer.writeFile"
390
+ | "computer.execute"
391
+ | "llm.generation"
392
+ | "media.generation"
393
+ | "games:servers"
394
+ | "git.repository"
395
+ | "apps.open"
396
+ | "apps.call"
397
+ | "app.storage"
398
+ | "app.events.emit"
399
+ | "team.workbenchHost"
400
+ | "marketplace.browse"
401
+ | "marketplace.purchase"
402
+ | "workflow.run"
403
+ | "workflow.publish"
404
+ | "workflow.arm"
405
+ | "world"
406
+ | "channels.read"
407
+ | "channels.personal.manage";
408
+ capabilityApproved: true;
409
+ operations: readonly string[];
410
+ resources: "tenant-scope" | readonly ...[];
411
+ }>[];
412
+ approval: | Readonly<{
413
+ by: | {
414
+ kind: ...;
415
+ memberId: ...;
416
+ }
417
+ | {
418
+ kind: ...;
419
+ agentId: ...;
420
+ }
421
+ | {
422
+ kind: ...;
423
+ keyId: ...;
424
+ };
425
+ at: number;
426
+ authorityVersion: number;
427
+ }>
428
+ | null;
429
+ approvedAnonymousMethods: readonly Readonly<{
430
+ name: string;
431
+ digest: Sha256Digest;
432
+ }>[];
433
+ anonymousApproval: | Readonly<{
434
+ by: | {
435
+ kind: ...;
436
+ memberId: ...;
437
+ }
438
+ | {
439
+ kind: ...;
440
+ agentId: ...;
441
+ }
442
+ | {
443
+ kind: ...;
444
+ keyId: ...;
445
+ };
446
+ at: number;
447
+ authorityVersion: number;
448
+ }>
449
+ | null;
450
+ }>
451
+ | null>;
452
+ }>;
453
+ ```
454
+
455
+ Read port for one host tenant; commits, receipts and revocation stay with that
456
+ host.
457
+
458
+ ---
459
+
460
+ ### AppToolPolicy
461
+
462
+ ```ts
463
+ type AppToolPolicy = typeof appToolPolicySchema.Type;
464
+ ```
465
+
466
+ The authenticated attaching member is recorded when this policy is approved.
467
+
468
+ ---
469
+
470
+ ### AppToolAccess
471
+
472
+ ```ts
473
+ type AppToolAccess = typeof appToolAccessSchema.Type;
474
+ ```
475
+
476
+ One installation binding constrained by an authenticated tool-policy approval.
477
+
478
+ ---
479
+
480
+ ### AppToolEntry
481
+
482
+ ```ts
483
+ type AppToolEntry = Readonly<{
484
+ installation: Installation;
485
+ declaration: AppDeclaration;
486
+ declaredOperations: DeclaredOperations;
487
+ api: AppApi | null;
488
+ access: AppToolAccess | null;
489
+ }>;
490
+ ```
491
+
492
+ Pre-read entries: the catalog never resolves installations or calls back into a
493
+ host.
494
+
495
+ ## Variables
496
+
497
+ ### gateRequestSchema
498
+
499
+ ```ts
500
+ const gateRequestSchema: ZodDiscriminatedUnion<
501
+ [
502
+ ZodObject<
503
+ {
504
+ kind: ZodLiteral<"method">;
505
+ name: ZodString;
506
+ input: ZodUnknown;
507
+ via: ZodEnum<{
508
+ ui: "ui";
509
+ agent: "agent";
510
+ mcp: "mcp";
511
+ workflow: "workflow";
512
+ }>;
513
+ },
514
+ $strict
515
+ >,
516
+ ZodObject<
517
+ {
518
+ kind: ZodLiteral<"capability-route">;
519
+ capability: ZodPipe<
520
+ ZodUnknown,
521
+ ZodTransform<
522
+ | "agent.list"
523
+ | "agent.manage"
524
+ | "agent.rename"
525
+ | "agent.toolPolicy"
526
+ | "agent.read"
527
+ | "agent.send"
528
+ | "computer.list"
529
+ | "computer.readFile"
530
+ | "computer.writeFile"
531
+ | "computer.execute"
532
+ | "llm.generation"
533
+ | "media.generation"
534
+ | "games:servers"
535
+ | "git.repository"
536
+ | "apps.open"
537
+ | "apps.call"
538
+ | "app.storage"
539
+ | "app.events.emit"
540
+ | "team.workbenchHost"
541
+ | "marketplace.browse"
542
+ | "marketplace.purchase"
543
+ | "workflow.run"
544
+ | "workflow.publish"
545
+ | "workflow.arm"
546
+ | "world"
547
+ | "channels.read"
548
+ | "channels.personal.manage",
549
+ unknown
550
+ >
551
+ >;
552
+ operation: ZodString;
553
+ },
554
+ $strict
555
+ >,
556
+ ZodObject<
557
+ {
558
+ kind: ZodLiteral<"binding">;
559
+ binding: ZodPipe<
560
+ ZodUnknown,
561
+ ZodTransform<
562
+ | "BACKGROUND"
563
+ | "GIT"
564
+ | "EVENTS"
565
+ | "APPS"
566
+ | "WORKFLOWS"
567
+ | "APP_STORAGE"
568
+ | "MEDIA"
569
+ | "COMPUTER"
570
+ | "INBOX"
571
+ | "AGENTS",
572
+ unknown
573
+ >
574
+ >;
575
+ operation: ZodString;
576
+ },
577
+ $strict
578
+ >,
579
+ ZodObject<
580
+ {
581
+ kind: ZodLiteral<"list-tools">;
582
+ },
583
+ $strict
584
+ >,
585
+ ZodObject<
586
+ {
587
+ kind: ZodLiteral<"backend">;
588
+ },
589
+ $strict
590
+ >,
591
+ ],
592
+ "kind"
593
+ >;
594
+ ```
595
+
596
+ Requests select existing SDK methods, opaque backend calls and derived operation
597
+ identities.
598
+
599
+ ---
600
+
601
+ ### invocationGrantsSchema
602
+
603
+ ```ts
604
+ const invocationGrantsSchema: ZodReadonly<
605
+ ZodArray<
606
+ ZodObject<
607
+ {
608
+ binding: ZodPipe<
609
+ ZodUnknown,
610
+ ZodTransform<
611
+ | "BACKGROUND"
612
+ | "GIT"
613
+ | "EVENTS"
614
+ | "APPS"
615
+ | "WORKFLOWS"
616
+ | "APP_STORAGE"
617
+ | "MEDIA"
618
+ | "COMPUTER"
619
+ | "INBOX"
620
+ | "AGENTS",
621
+ unknown
622
+ >
623
+ >;
624
+ operations: ZodReadonly<ZodArray<ZodString>>;
625
+ },
626
+ $strict
627
+ >
628
+ >
629
+ >;
630
+ ```
631
+
632
+ Binding grants have the exact S2 InvocationFacts shape and its maintained
633
+ registry grammar.
634
+
635
+ ---
636
+
637
+ ### gateRefusalSchema
638
+
639
+ ```ts
640
+ const gateRefusalSchema: ZodObject<
641
+ {
642
+ kind: ZodLiteral<"refused">;
643
+ code: ZodEnum<{
644
+ unavailable: "unavailable";
645
+ stale_authority: "stale_authority";
646
+ not_declared: "not_declared";
647
+ not_approved: "not_approved";
648
+ level_too_low: "level_too_low";
649
+ approval_required: "approval_required";
650
+ requires_not_granted: "requires_not_granted";
651
+ invalid_input: "invalid_input";
652
+ visitor_read_only: "visitor_read_only";
653
+ }>;
654
+ },
655
+ $strict
656
+ >;
657
+ ```
658
+
659
+ Ordered, closed refusal vocabulary; external methods always require approval.
660
+
661
+ ---
662
+
663
+ ### installationIdSchema
664
+
665
+ ```ts
666
+ const installationIdSchema: ZodString;
667
+ ```
668
+
669
+ Installation names cannot contain the tenant separator.
670
+
671
+ ---
672
+
673
+ ### approvedGrantSchema
674
+
675
+ ```ts
676
+ const approvedGrantSchema: ZodReadonly<
677
+ ZodObject<
678
+ {
679
+ capability: ZodPipe<
680
+ ZodUnknown,
681
+ ZodTransform<
682
+ | "agent.list"
683
+ | "agent.manage"
684
+ | "agent.rename"
685
+ | "agent.toolPolicy"
686
+ | "agent.read"
687
+ | "agent.send"
688
+ | "computer.list"
689
+ | "computer.readFile"
690
+ | "computer.writeFile"
691
+ | "computer.execute"
692
+ | "llm.generation"
693
+ | "media.generation"
694
+ | "games:servers"
695
+ | "git.repository"
696
+ | "apps.open"
697
+ | "apps.call"
698
+ | "app.storage"
699
+ | "app.events.emit"
700
+ | "team.workbenchHost"
701
+ | "marketplace.browse"
702
+ | "marketplace.purchase"
703
+ | "workflow.run"
704
+ | "workflow.publish"
705
+ | "workflow.arm"
706
+ | "world"
707
+ | "channels.read"
708
+ | "channels.personal.manage",
709
+ unknown
710
+ >
711
+ >;
712
+ capabilityApproved: ZodLiteral<true>;
713
+ operations: ZodReadonly<ZodArray<ZodString>>;
714
+ resources: ZodUnion<
715
+ readonly [
716
+ ZodLiteral<"tenant-scope">,
717
+ ZodReadonly<
718
+ ZodArray<
719
+ ZodReadonly<
720
+ ZodObject<
721
+ {
722
+ kind: ZodString;
723
+ id: ZodString;
724
+ },
725
+ $strict
726
+ >
727
+ >
728
+ >
729
+ >,
730
+ ]
731
+ >;
732
+ },
733
+ $strict
734
+ >
735
+ >;
736
+ ```
737
+
738
+ Consent approves capabilities, with explicit operation and resource ceilings. A
739
+ Release adding a method that requires an already-approved capability needs no
740
+ new consent; a new capability does. Release selection intersects stored
741
+ operations instead of adding approvals. Each Worker call is still restricted to
742
+ that method's declared requires, never the App's complete capability set. Only
743
+ an approved install or set-grants command mints capabilityApproved. Empty
744
+ operation rows retain that consent; removing the capability revokes it.
745
+ route:app.methods rows record approval detail, not a method allowlist: narrowing
746
+ them in set-grants does not restrict methods using an approved capability. Exact
747
+ operation rows are enforced for capability routes and backend bindings.
748
+
749
+ ---
750
+
751
+ ### declaredOperationsSchema
752
+
753
+ ```ts
754
+ const declaredOperationsSchema: ZodObject<
755
+ {
756
+ artifactDigest: ZodPipe<ZodUnknown, ZodTransform<Sha256Digest, unknown>>;
757
+ digest: ZodPipe<ZodUnknown, ZodTransform<Sha256Digest, unknown>>;
758
+ anonymousMethods: ZodReadonly<
759
+ ZodArray<
760
+ ZodReadonly<
761
+ ZodObject<
762
+ {
763
+ name: ZodPipe<ZodUnknown, ZodTransform<string, unknown>>;
764
+ digest: ZodPipe<ZodUnknown, ZodTransform<Sha256Digest, unknown>>;
765
+ },
766
+ $strict
767
+ >
768
+ >
769
+ >
770
+ >;
771
+ capabilities: ZodReadonly<
772
+ ZodArray<
773
+ ZodReadonly<
774
+ ZodObject<
775
+ {
776
+ capability: ZodPipe<
777
+ ZodUnknown,
778
+ ZodTransform<
779
+ | "agent.list"
780
+ | "agent.manage"
781
+ | "agent.rename"
782
+ | "agent.toolPolicy"
783
+ | "agent.read"
784
+ | "agent.send"
785
+ | "computer.list"
786
+ | "computer.readFile"
787
+ | "computer.writeFile"
788
+ | "computer.execute"
789
+ | "llm.generation"
790
+ | "media.generation"
791
+ | "games:servers"
792
+ | "git.repository"
793
+ | "apps.open"
794
+ | "apps.call"
795
+ | "app.storage"
796
+ | "app.events.emit"
797
+ | "team.workbenchHost"
798
+ | "marketplace.browse"
799
+ | "marketplace.purchase"
800
+ | "workflow.run"
801
+ | "workflow.publish"
802
+ | "workflow.arm"
803
+ | "world"
804
+ | "channels.read"
805
+ | "channels.personal.manage",
806
+ unknown
807
+ >
808
+ >;
809
+ operations: ZodReadonly<ZodArray<ZodString>>;
810
+ },
811
+ $strict
812
+ >
813
+ >
814
+ >
815
+ >;
816
+ },
817
+ $strict
818
+ >;
819
+ ```
820
+
821
+ Immutable operation facts derived from descriptor methods and the binding
822
+ registry.
823
+
824
+ ---
825
+
826
+ ### installationSchema
827
+
828
+ ```ts
829
+ const installationSchema: ZodObject<{
830
+ installationId: ZodString;
831
+ instanceId: ZodNullable<ZodPipe<ZodUnknown, ZodTransform<InstanceId, unknown>>>;
832
+ appId: ZodPipe<ZodUnknown, ZodTransform<AppId, unknown>>;
833
+ release: ZodPipe<ZodUnknown, ZodTransform<{
834
+ releaseId: ReleaseId;
835
+ appId: AppId;
836
+ artifact: {
837
+ artifactRef: ArtifactRef;
838
+ artifactDigest: Sha256Digest;
839
+ provenance: {
840
+ sourceRevision: SourceRevision;
841
+ sourceTreeDigest: Sha256Digest;
842
+ buildRecipeDigest: Sha256Digest;
843
+ };
844
+ };
845
+ }, unknown>>;
846
+ releasePin: ZodEnum<{
847
+ pinned: "pinned";
848
+ floating: "floating";
849
+ }>;
850
+ authorityVersion: ZodNumber;
851
+ status: ZodEnum<{
852
+ enabled: "enabled";
853
+ disabled: "disabled";
854
+ deleted: "deleted";
855
+ }>;
856
+ visibility: ZodEnum<{
857
+ private: "private";
858
+ public: "public";
859
+ }>;
860
+ declaredOperationsDigest: ZodPipe<ZodUnknown, ZodTransform<Sha256Digest, unknown>>;
861
+ approvedGrants: ZodReadonly<ZodArray<ZodReadonly<ZodObject<{
862
+ capability: ZodPipe<ZodUnknown, ZodTransform<
863
+ | "agent.list"
864
+ | "agent.manage"
865
+ | "agent.rename"
866
+ | "agent.toolPolicy"
867
+ | "agent.read"
868
+ | "agent.send"
869
+ | "computer.list"
870
+ | "computer.readFile"
871
+ | "computer.writeFile"
872
+ | "computer.execute"
873
+ | "llm.generation"
874
+ | "media.generation"
875
+ | "games:servers"
876
+ | "git.repository"
877
+ | "apps.open"
878
+ | "apps.call"
879
+ | "app.storage"
880
+ | "app.events.emit"
881
+ | "team.workbenchHost"
882
+ | "marketplace.browse"
883
+ | "marketplace.purchase"
884
+ | "workflow.run"
885
+ | "workflow.publish"
886
+ | "workflow.arm"
887
+ | "world"
888
+ | "channels.read"
889
+ | "channels.personal.manage", unknown>>;
890
+ capabilityApproved: ZodLiteral<true>;
891
+ operations: ZodReadonly<ZodArray<ZodString>>;
892
+ resources: ZodUnion<readonly [ZodLiteral<"tenant-scope">, ZodReadonly<ZodArray<...>>]>;
893
+ }, $strict>>>>;
894
+ approval: ZodNullable<ZodReadonly<ZodObject<{
895
+ by: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
896
+ kind: ZodMiniLiteral<...>;
897
+ memberId: ZodMiniString<...>;
898
+ }, $strip>, ZodMiniObject<{
899
+ kind: ZodMiniLiteral<...>;
900
+ agentId: ZodMiniString<...>;
901
+ }, $strip>, ZodMiniObject<{
902
+ kind: ZodMiniLiteral<...>;
903
+ keyId: ZodMiniString<...>;
904
+ }, $strip>], "kind">;
905
+ at: ZodNumber;
906
+ authorityVersion: ZodNumber;
907
+ }, $strict>>>;
908
+ approvedAnonymousMethods: ZodReadonly<ZodArray<ZodReadonly<ZodObject<{
909
+ name: ZodPipe<ZodUnknown, ZodTransform<string, unknown>>;
910
+ digest: ZodPipe<ZodUnknown, ZodTransform<Sha256Digest, unknown>>;
911
+ }, $strict>>>>;
912
+ anonymousApproval: ZodNullable<ZodReadonly<ZodObject<{
913
+ by: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
914
+ kind: ZodMiniLiteral<...>;
915
+ memberId: ZodMiniString<...>;
916
+ }, $strip>, ZodMiniObject<{
917
+ kind: ZodMiniLiteral<...>;
918
+ agentId: ZodMiniString<...>;
919
+ }, $strip>, ZodMiniObject<{
920
+ kind: ZodMiniLiteral<...>;
921
+ keyId: ZodMiniString<...>;
922
+ }, $strip>], "kind">;
923
+ at: ZodNumber;
924
+ authorityVersion: ZodNumber;
925
+ }, $strict>>>;
926
+ }, $strict>;
927
+ ```
928
+
929
+ Resolved immutable Release plus host-owned installation and approval state.
930
+
931
+ ---
932
+
933
+ ### installationCommandSchema
934
+
935
+ ```ts
936
+ const installationCommandSchema: ZodDiscriminatedUnion<[ZodObject<{
937
+ release: ZodPipe<ZodUnknown, ZodTransform<{
938
+ releaseId: ReleaseId;
939
+ appId: AppId;
940
+ artifact: {
941
+ artifactRef: ArtifactRef;
942
+ artifactDigest: Sha256Digest;
943
+ provenance: {
944
+ sourceRevision: SourceRevision;
945
+ sourceTreeDigest: Sha256Digest;
946
+ buildRecipeDigest: Sha256Digest;
947
+ };
948
+ };
949
+ }, unknown>>;
950
+ releasePin: ZodEnum<{
951
+ pinned: "pinned";
952
+ floating: "floating";
953
+ }>;
954
+ kind: ZodLiteral<"install">;
955
+ grants: ZodUnion<readonly [ZodLiteral<"none">, ZodLiteral<"declared">, ZodReadonly<ZodArray<ZodReadonly<ZodObject<{
956
+ capability: ...;
957
+ operations: ...;
958
+ resources: ...;
959
+ }, $strict>>>>]>;
960
+ }, $strict>, ZodObject<{
961
+ release: ZodPipe<ZodUnknown, ZodTransform<{
962
+ releaseId: ReleaseId;
963
+ appId: AppId;
964
+ artifact: {
965
+ artifactRef: ArtifactRef;
966
+ artifactDigest: Sha256Digest;
967
+ provenance: {
968
+ sourceRevision: SourceRevision;
969
+ sourceTreeDigest: Sha256Digest;
970
+ buildRecipeDigest: Sha256Digest;
971
+ };
972
+ };
973
+ }, unknown>>;
974
+ releasePin: ZodEnum<{
975
+ pinned: "pinned";
976
+ floating: "floating";
977
+ }>;
978
+ kind: ZodLiteral<"select-release">;
979
+ }, $strict>, ZodObject<{
980
+ kind: ZodLiteral<"set-status">;
981
+ status: ZodEnum<{
982
+ enabled: "enabled";
983
+ disabled: "disabled";
984
+ deleted: "deleted";
985
+ }>;
986
+ }, $strict>], "kind">;
987
+ ```
988
+
989
+ Host commands; floating targets have already been resolved to immutable
990
+ Releases.
991
+
992
+ ---
993
+
994
+ ### installationRefusalSchema
995
+
996
+ ```ts
997
+ const installationRefusalSchema: ZodObject<
998
+ {
999
+ kind: ZodLiteral<"refused">;
1000
+ code: ZodEnum<{
1001
+ unavailable: "unavailable";
1002
+ stale_authority: "stale_authority";
1003
+ not_declared: "not_declared";
1004
+ release_app_mismatch: "release_app_mismatch";
1005
+ not_owner: "not_owner";
1006
+ invalid_command: "invalid_command";
1007
+ }>;
1008
+ },
1009
+ $strict
1010
+ >;
1011
+ ```
1012
+
1013
+ Closed refusals: failed commands produce no installation update.
1014
+
1015
+ ---
1016
+
1017
+ ### appToolPolicySchema
1018
+
1019
+ ```ts
1020
+ const appToolPolicySchema: Struct<{
1021
+ level: Literals<readonly ["read", "write"]>;
1022
+ revision: NonEmptyString;
1023
+ grantedBy: NonEmptyString;
1024
+ }>;
1025
+ ```
1026
+
1027
+ One App-tool access level, with its own freshness pin. An Agent's comes from the
1028
+ owner's stored direct approval; a key's is computed fresh from its own Ear Tag
1029
+ grants (`keyAppAccess`), never stored as this shape -- only read through it, for
1030
+ one call or one installation at a time.
1031
+
1032
+ ## Functions
1033
+
1034
+ ### grantsFor()
1035
+
1036
+ ```ts
1037
+ function grantsFor(
1038
+ installation,
1039
+ declaration,
1040
+ snapshot,
1041
+ capability,
1042
+ ): Readonly<
1043
+ Readonly<{
1044
+ capability:
1045
+ | "agent.list"
1046
+ | "agent.manage"
1047
+ | "agent.rename"
1048
+ | "agent.toolPolicy"
1049
+ | "agent.read"
1050
+ | "agent.send"
1051
+ | "computer.list"
1052
+ | "computer.readFile"
1053
+ | "computer.writeFile"
1054
+ | "computer.execute"
1055
+ | "llm.generation"
1056
+ | "media.generation"
1057
+ | "games:servers"
1058
+ | "git.repository"
1059
+ | "apps.open"
1060
+ | "apps.call"
1061
+ | "app.storage"
1062
+ | "app.events.emit"
1063
+ | "team.workbenchHost"
1064
+ | "marketplace.browse"
1065
+ | "marketplace.purchase"
1066
+ | "workflow.run"
1067
+ | "workflow.publish"
1068
+ | "workflow.arm"
1069
+ | "world"
1070
+ | "channels.read"
1071
+ | "channels.personal.manage";
1072
+ capabilityApproved: true;
1073
+ operations: readonly string[];
1074
+ resources:
1075
+ | "tenant-scope"
1076
+ | readonly Readonly<{
1077
+ kind: string;
1078
+ id: string;
1079
+ }>[];
1080
+ }>
1081
+ > | null;
1082
+ ```
1083
+
1084
+ Intersect stored approvals with the current verified Release without widening
1085
+ resource selectors.
1086
+
1087
+ #### Parameters
1088
+
1089
+ | Parameter | Type |
1090
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1091
+ | `installation` | [`Installation`](#installation) |
1092
+ | `declaration` | `AppDeclaration` |
1093
+ | `snapshot` | [`DeclaredOperations`](#declaredoperations) |
1094
+ | `capability` | \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"` |
1095
+
1096
+ #### Returns
1097
+
1098
+ \| `Readonly`\<`Readonly`\<\{ `capability`: \| `"agent.list"` \|
1099
+ `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"`
1100
+ \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \|
1101
+ `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \|
1102
+ `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"`
1103
+ \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \|
1104
+ `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \|
1105
+ `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \|
1106
+ `"channels.read"` \| `"channels.personal.manage"`; `capabilityApproved`: `true`;
1107
+ `operations`: readonly `string`[]; `resources`: \| `"tenant-scope"` \| readonly
1108
+ `Readonly`\<\{ `kind`: `string`; `id`: `string`; \}\>[]; \}\>\> \| `null`
1109
+
1110
+ ---
1111
+
1112
+ ### approvedBindingGrants()
1113
+
1114
+ ```ts
1115
+ function approvedBindingGrants(installation, declaration): readonly object[];
1116
+ ```
1117
+
1118
+ Approved binding operations from an already verified declaration. Hosts still
1119
+ pin the selection/version/artifact and compare running frame grants as a subset.
1120
+
1121
+ #### Parameters
1122
+
1123
+ | Parameter | Type |
1124
+ | -------------- | ------------------------------- |
1125
+ | `installation` | [`Installation`](#installation) |
1126
+ | `declaration` | `AppDeclaration` |
1127
+
1128
+ #### Returns
1129
+
1130
+ readonly `object`[]
1131
+
1132
+ ---
1133
+
1134
+ ### scopedBindings()
1135
+
1136
+ ```ts
1137
+ function scopedBindings(captured, method?, ceiling?): readonly object[];
1138
+ ```
1139
+
1140
+ Narrow captured binding operations to the method's verified requirements and
1141
+ effect. The captured set is the ceiling; this never adds an operation or
1142
+ resource authority.
1143
+
1144
+ #### Parameters
1145
+
1146
+ | Parameter | Type | Default value |
1147
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
1148
+ | `captured` | readonly `object`[] | `undefined` |
1149
+ | `method?` | `Readonly`\<\{ `description`: `string`; `input`: `object`; `output`: `object`; `effect`: `"read"` \| `"write"` \| `"external"`; `requires`: readonly ( \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`)[]; `pending?`: `true`; `hidden?`: `true`; `anonymous?`: `true`; \}\> | `undefined` |
1150
+ | `ceiling?` | `"read"` \| `"write"` | `"write"` |
1151
+
1152
+ #### Returns
1153
+
1154
+ readonly `object`[]
1155
+
1156
+ ---
1157
+
1158
+ ### appInvocationCeiling()
1159
+
1160
+ ```ts
1161
+ function appInvocationCeiling(facts): "read" | "write";
1162
+ ```
1163
+
1164
+ Principal ceiling for invocation and metadata capture. Captures must pass this
1165
+ to scopedBindings; its default write ceiling does not encode caller access.
1166
+
1167
+ #### Parameters
1168
+
1169
+ | Parameter | Type |
1170
+ | --------- | ---------------------------------------------------------------- |
1171
+ | `facts` | `Pick`\<[`GateFacts`](#gatefacts), `"principal"` \| `"access"`\> |
1172
+
1173
+ #### Returns
1174
+
1175
+ `"read"` \| `"write"`
1176
+
1177
+ ---
1178
+
1179
+ ### admitMethodMetadata()
1180
+
1181
+ ```ts
1182
+ function admitMethodMetadata(facts, name): AppMethodMetadataDecision;
1183
+ ```
1184
+
1185
+ Check a verified method's Release, principal, effect and real capability
1186
+ consent. Captures have no mapped runtime input yet. This result cannot authorize
1187
+ execution: dispatch must still use admits, including its ordinary input
1188
+ validation. Input schemas are not compiled here; execution may still refuse
1189
+ invalid_input. Project captured bindings with appInvocationCeiling(facts).
1190
+
1191
+ #### Parameters
1192
+
1193
+ | Parameter | Type |
1194
+ | --------- | ------------------------- |
1195
+ | `facts` | [`GateFacts`](#gatefacts) |
1196
+ | `name` | `string` |
1197
+
1198
+ #### Returns
1199
+
1200
+ [`AppMethodMetadataDecision`](#appmethodmetadatadecision)
1201
+
1202
+ ---
1203
+
1204
+ ### admits()
1205
+
1206
+ ```ts
1207
+ function admits(facts, rawRequest): GateDecision;
1208
+ ```
1209
+
1210
+ Ordered admission only. Host freshness/resource admission and effect execution
1211
+ stay outside this pure gate.
1212
+
1213
+ #### Parameters
1214
+
1215
+ | Parameter | Type |
1216
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1217
+ | `facts` | [`GateFacts`](#gatefacts) |
1218
+ | `rawRequest` | \| \{ `kind`: `"method"`; `name`: `string`; `input`: `unknown`; `via`: `"ui"` \| `"agent"` \| `"mcp"` \| `"workflow"`; \} \| \{ `kind`: `"capability-route"`; `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`; `operation`: `string`; \} \| \{ `kind`: `"binding"`; `binding`: \| `"BACKGROUND"` \| `"GIT"` \| `"EVENTS"` \| `"APPS"` \| `"WORKFLOWS"` \| `"APP_STORAGE"` \| `"MEDIA"` \| `"COMPUTER"` \| `"INBOX"` \| `"AGENTS"`; `operation`: `string`; \} \| \{ `kind`: `"list-tools"`; \} \| \{ `kind`: `"backend"`; \} |
1219
+
1220
+ #### Returns
1221
+
1222
+ [`GateDecision`](#gatedecision)
1223
+
1224
+ ---
1225
+
1226
+ ### applyInstallationCommand()
1227
+
1228
+ ```ts
1229
+ function applyInstallationCommand(
1230
+ current,
1231
+ rawCommand,
1232
+ context,
1233
+ ): Result<
1234
+ Readonly<{
1235
+ next: Installation;
1236
+ authorityChanged: boolean;
1237
+ }>,
1238
+ {
1239
+ kind: "refused";
1240
+ code:
1241
+ | "unavailable"
1242
+ | "stale_authority"
1243
+ | "not_declared"
1244
+ | "release_app_mismatch"
1245
+ | "not_owner"
1246
+ | "invalid_command";
1247
+ }
1248
+ >;
1249
+ ```
1250
+
1251
+ Pure transition; hosts retain transactions, receipts, epochs and delivery.
1252
+
1253
+ #### Parameters
1254
+
1255
+ | Parameter | Type |
1256
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1257
+ | `current` | \| `Readonly`\<\{ `installationId`: `string`; `instanceId`: [`InstanceId`](index.md#instanceid) \| `null`; `appId`: `AppId`; `release`: \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \}; \}; `releasePin`: `"pinned"` \| `"floating"`; `authorityVersion`: `number`; `status`: `"enabled"` \| `"disabled"` \| `"deleted"`; `visibility`: `"private"` \| `"public"`; `declaredOperationsDigest`: `Sha256Digest`; `approvedGrants`: readonly `Readonly`\<\{ `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`; `capabilityApproved`: `true`; `operations`: readonly `string`[]; `resources`: \| `"tenant-scope"` \| readonly `Readonly`\<\{ `kind`: `string`; `id`: `string`; \}\>[]; \}\>[]; `approval`: \| `Readonly`\<\{ `by`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; `approvedAnonymousMethods`: readonly `Readonly`\<\{ `name`: `string`; `digest`: `Sha256Digest`; \}\>[]; `anonymousApproval`: \| `Readonly`\<\{ `by`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \}\> \| `null` |
1258
+ | `rawCommand` | \| \{ `release`: \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \}; \}; `releasePin`: `"pinned"` \| `"floating"`; `kind`: `"install"`; `grants`: \| `"none"` \| `"declared"` \| readonly `Readonly`\<\{ `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`; `operations`: readonly `string`[]; `resources`: \| `"tenant-scope"` \| readonly `Readonly`\<\{ `kind`: `string`; `id`: `string`; \}\>[]; \}\>[]; \} \| \{ `release`: \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \}; \}; `releasePin`: `"pinned"` \| `"floating"`; `kind`: `"select-release"`; \} \| \{ `kind`: `"set-status"`; `status`: `"enabled"` \| `"disabled"` \| `"deleted"`; \} \| \{ `kind`: `"set-visibility"`; `visibility`: `"private"` \| `"public"`; \} \| \{ `kind`: `"set-grants"`; `grants`: \| `"none"` \| `"declared"` \| readonly `Readonly`\<\{ `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`; `operations`: readonly `string`[]; `resources`: \| `"tenant-scope"` \| readonly `Readonly`\<\{ `kind`: `string`; `id`: `string`; \}\>[]; \}\>[]; \} \| \{ `kind`: `"approve-anonymous"`; `methods`: readonly `Readonly`\<\{ `name`: `string`; `digest`: `Sha256Digest`; \}\>[]; \} |
1259
+ | `context` | [`InstallationContext`](#installationcontext) |
1260
+
1261
+ #### Returns
1262
+
1263
+ `Result`\<`Readonly`\<\{ `next`: [`Installation`](#installation);
1264
+ `authorityChanged`: `boolean`; \}\>, \{ `kind`: `"refused"`; `code`: \|
1265
+ `"unavailable"` \| `"stale_authority"` \| `"not_declared"` \|
1266
+ `"release_app_mismatch"` \| `"not_owner"` \| `"invalid_command"`; \}\>
1267
+
1268
+ ---
1269
+
1270
+ ### appCallOperation()
1271
+
1272
+ ```ts
1273
+ function appCallOperation(appId, method): string;
1274
+ ```
1275
+
1276
+ Approval identity for one UI-side target method; upgrades intersect these exact
1277
+ pairs.
1278
+
1279
+ #### Parameters
1280
+
1281
+ | Parameter | Type |
1282
+ | --------- | -------- |
1283
+ | `appId` | `string` |
1284
+ | `method` | `string` |
1285
+
1286
+ #### Returns
1287
+
1288
+ `string`
1289
+
1290
+ ---
1291
+
1292
+ ### deriveDeclaredOperations()
1293
+
1294
+ ```ts
1295
+ function deriveDeclaredOperations(
1296
+ release,
1297
+ declaration,
1298
+ descriptors,
1299
+ ): Promise<
1300
+ Readonly<{
1301
+ artifactDigest: Sha256Digest;
1302
+ digest: Sha256Digest;
1303
+ anonymousMethods: readonly Readonly<{
1304
+ name: string;
1305
+ digest: Sha256Digest;
1306
+ }>[];
1307
+ capabilities: readonly Readonly<{
1308
+ capability:
1309
+ | "agent.list"
1310
+ | "agent.manage"
1311
+ | "agent.rename"
1312
+ | "agent.toolPolicy"
1313
+ | "agent.read"
1314
+ | "agent.send"
1315
+ | "computer.list"
1316
+ | "computer.readFile"
1317
+ | "computer.writeFile"
1318
+ | "computer.execute"
1319
+ | "llm.generation"
1320
+ | "media.generation"
1321
+ | "games:servers"
1322
+ | "git.repository"
1323
+ | "apps.open"
1324
+ | "apps.call"
1325
+ | "app.storage"
1326
+ | "app.events.emit"
1327
+ | "team.workbenchHost"
1328
+ | "marketplace.browse"
1329
+ | "marketplace.purchase"
1330
+ | "workflow.run"
1331
+ | "workflow.publish"
1332
+ | "workflow.arm"
1333
+ | "world"
1334
+ | "channels.read"
1335
+ | "channels.personal.manage";
1336
+ operations: readonly string[];
1337
+ }>[];
1338
+ }>
1339
+ >;
1340
+ ```
1341
+
1342
+ Sole derivation owner. Inputs are the verified Release declaration and existing
1343
+ host adapters.
1344
+
1345
+ #### Parameters
1346
+
1347
+ | Parameter | Type |
1348
+ | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1349
+ | `release` | \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \}; \} |
1350
+ | `release.releaseId` | `ReleaseId` |
1351
+ | `release.appId` | `AppId` |
1352
+ | `release.artifact` | \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \} |
1353
+ | `release.artifact.artifactRef` | `ArtifactRef` |
1354
+ | `release.artifact.artifactDigest` | `Sha256Digest` |
1355
+ | `release.artifact.provenance` | \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \} |
1356
+ | `release.artifact.provenance.sourceRevision` | `SourceRevision` |
1357
+ | `release.artifact.provenance.sourceTreeDigest` | `Sha256Digest` |
1358
+ | `release.artifact.provenance.buildRecipeDigest` | `Sha256Digest` |
1359
+ | `declaration` | `AppDeclaration` |
1360
+ | `descriptors` | readonly [`CapabilityOperationDescriptor`](#capabilityoperationdescriptor)[] |
1361
+
1362
+ #### Returns
1363
+
1364
+ `Promise`\<`Readonly`\<\{ `artifactDigest`: `Sha256Digest`; `digest`:
1365
+ `Sha256Digest`; `anonymousMethods`: readonly `Readonly`\<\{ `name`: `string`;
1366
+ `digest`: `Sha256Digest`; \}\>[]; `capabilities`: readonly `Readonly`\<\{
1367
+ `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \|
1368
+ `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \|
1369
+ `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \|
1370
+ `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \|
1371
+ `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \|
1372
+ `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \|
1373
+ `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \|
1374
+ `"workflow.arm"` \| `"world"` \| `"channels.read"` \|
1375
+ `"channels.personal.manage"`; `operations`: readonly `string`[]; \}\>[]; \}\>\>