@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,332 @@
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) / shell/app-directory
8
+
9
+ # shell/app-directory
10
+
11
+ ## Type Aliases
12
+
13
+ ### AppAddress
14
+
15
+ ```ts
16
+ type AppAddress = z.output<typeof appAddressSchema>;
17
+ ```
18
+
19
+ Decoded address of a default App or an installation.
20
+
21
+ ---
22
+
23
+ ### AppAuthorityEnforcement
24
+
25
+ ```ts
26
+ type AppAuthorityEnforcement = z.output<typeof appAuthorityEnforcementSchema>;
27
+ ```
28
+
29
+ A host-reported authority change and its remaining work.
30
+
31
+ ---
32
+
33
+ ### AppDirectoryGill
34
+
35
+ ```ts
36
+ type AppDirectoryGill = {
37
+ [
38
+ Field in keyof Schema.Schema.Type<typeof appDeclaredGillSchema>
39
+ ]: Schema.Schema.Type<typeof appDeclaredGillSchema>[Field];
40
+ };
41
+ ```
42
+
43
+ A Release-declared Gill carried by the host's App directory. The named mapped
44
+ type keeps consumer declarations attached to this public contract.
45
+
46
+ ---
47
+
48
+ ### AppDirectoryEntry
49
+
50
+ ```ts
51
+ type AppDirectoryEntry = z.output<typeof appDirectoryEntrySchema>;
52
+ ```
53
+
54
+ An App directory row before host-specific permissions are attached.
55
+
56
+ ---
57
+
58
+ ### AppCatalog
59
+
60
+ ```ts
61
+ type AppCatalog = z.output<typeof appCatalogResponseSchema>;
62
+ ```
63
+
64
+ Parsed metadata returned by the read-only APPS.catalog binding.
65
+
66
+ ## Variables
67
+
68
+ ### appAddressSchema
69
+
70
+ ```ts
71
+ const appAddressSchema: ZodUnion<
72
+ readonly [
73
+ ZodObject<
74
+ {
75
+ kind: ZodLiteral<"default">;
76
+ appId: ZodString;
77
+ },
78
+ $strict
79
+ >,
80
+ ZodObject<
81
+ {
82
+ kind: ZodLiteral<"installation">;
83
+ installationId: ZodString;
84
+ },
85
+ $strict
86
+ >,
87
+ ]
88
+ >;
89
+ ```
90
+
91
+ An App address selects a host default or a specific installation.
92
+
93
+ ---
94
+
95
+ ### appAuthorityEnforcementSchema
96
+
97
+ ```ts
98
+ const appAuthorityEnforcementSchema: ZodObject<
99
+ {
100
+ requestId: ZodString;
101
+ address: ZodUnion<
102
+ readonly [
103
+ ZodObject<
104
+ {
105
+ kind: ZodLiteral<"default">;
106
+ appId: ZodString;
107
+ },
108
+ $strict
109
+ >,
110
+ ZodObject<
111
+ {
112
+ kind: ZodLiteral<"installation">;
113
+ installationId: ZodString;
114
+ },
115
+ $strict
116
+ >,
117
+ ]
118
+ >;
119
+ authorityVersion: ZodNumber;
120
+ state: ZodEnum<{
121
+ pending: "pending";
122
+ expired: "expired";
123
+ unaffected: "unaffected";
124
+ applied: "applied";
125
+ }>;
126
+ outstanding: ZodNumber;
127
+ },
128
+ $strict
129
+ >;
130
+ ```
131
+
132
+ Host-reported progress of applying a revised App authority version.
133
+
134
+ ---
135
+
136
+ ### appDirectoryEntrySchema
137
+
138
+ ```ts
139
+ const appDirectoryEntrySchema: ZodObject<{
140
+ address: ZodUnion<readonly [ZodObject<{
141
+ kind: ZodLiteral<"default">;
142
+ appId: ZodString;
143
+ }, $strict>, ZodObject<{
144
+ kind: ZodLiteral<"installation">;
145
+ installationId: ZodString;
146
+ }, $strict>]>;
147
+ installationId: ZodNullable<ZodString>;
148
+ surfaceId: ZodString;
149
+ appId: ZodString;
150
+ displayName: ZodOptional<ZodString>;
151
+ icon: ZodOptional<ZodNullable<ZodString>>;
152
+ releaseId: ZodNullable<ZodString>;
153
+ authorityVersion: ZodNumber;
154
+ enforcement: ZodNullable<ZodObject<{
155
+ requestId: ZodString;
156
+ address: ZodUnion<readonly [ZodObject<{
157
+ kind: ZodLiteral<"default">;
158
+ appId: ZodString;
159
+ }, $strict>, ZodObject<{
160
+ kind: ZodLiteral<"installation">;
161
+ installationId: ZodString;
162
+ }, $strict>]>;
163
+ authorityVersion: ZodNumber;
164
+ state: ZodEnum<{
165
+ pending: "pending";
166
+ expired: "expired";
167
+ unaffected: "unaffected";
168
+ applied: "applied";
169
+ }>;
170
+ outstanding: ZodNumber;
171
+ }, $strict>>;
172
+ handlers: ZodArray<ZodLiteral<"file.open">>;
173
+ roles: ZodArray<ZodString>;
174
+ declaredCapabilities: ZodArray<ZodString>;
175
+ calls: ZodOptional<ZodPipe<ZodUnknown, ZodTransform<readonly object[], unknown>>>;
176
+ commands: ZodPipe<ZodArray<ZodUnknown>, ZodTransform<Readonly<{
177
+ id: string;
178
+ title: string;
179
+ category: string;
180
+ description?: string;
181
+ sigil?: string;
182
+ projections?: Readonly<{
183
+ bindings?: ... | ...;
184
+ agent?: ... | ...;
185
+ help?: ... | ...;
186
+ menu?: ... | ...;
187
+ palette?: ... | ...;
188
+ slash?: ... | ...;
189
+ }>;
190
+ }>[], unknown[]>>;
191
+ gills: ZodPipe<ZodArray<ZodUnknown>, ZodTransform<AppDirectoryGill[], unknown[]>>;
192
+ availability: ZodEnum<{
193
+ unavailable: "unavailable";
194
+ available: "available";
195
+ }>;
196
+ surface: ZodNullable<ZodObject<{
197
+ stableRoute: ZodString;
198
+ }, $strict>>;
199
+ surfacePath: ZodString;
200
+ }, $strict>;
201
+ ```
202
+
203
+ Reusable App metadata supplied by an embedding host; it conveys no permissions.
204
+
205
+ ---
206
+
207
+ ### appRoleSelectionSchema
208
+
209
+ ```ts
210
+ const appRoleSelectionSchema: ZodObject<
211
+ {
212
+ surfaceId: ZodNullable<ZodString>;
213
+ chosen: ZodBoolean;
214
+ },
215
+ $strict
216
+ >;
217
+ ```
218
+
219
+ A host-resolved role selection; a surface address is not launch authority.
220
+
221
+ ---
222
+
223
+ ### appCatalogEntrySchema
224
+
225
+ ```ts
226
+ const appCatalogEntrySchema: ZodObject<{
227
+ surfaceId: ZodString;
228
+ appId: ZodString;
229
+ displayName: ZodOptional<ZodString>;
230
+ gills: ZodArray<ZodObject<{
231
+ id: ZodString;
232
+ title: ZodString;
233
+ params: ZodOptional<ZodArray<ZodObject<{
234
+ key: ZodString;
235
+ label: ZodString;
236
+ kind: ZodEnum<...>;
237
+ required: ZodBoolean;
238
+ options: ZodOptional<...>;
239
+ }, $strict>> & ZodType<readonly object[], object[], $ZodTypeInternals<readonly object[], object[]>>>;
240
+ desktop: ZodOptional<ZodObject<{
241
+ sizes: ZodArray<ZodEnum<{
242
+ S: ...;
243
+ M: ...;
244
+ L: ...;
245
+ }>>;
246
+ }, $strict>>;
247
+ }, $strict>>;
248
+ }, $strict>;
249
+ ```
250
+
251
+ Read-only catalog metadata for one App, without host-specific role policy.
252
+
253
+ ---
254
+
255
+ ### appCatalogResponseSchema
256
+
257
+ ```ts
258
+ const appCatalogResponseSchema: ZodObject<{
259
+ apps: ZodArray<ZodObject<{
260
+ surfaceId: ZodString;
261
+ appId: ZodString;
262
+ displayName: ZodOptional<ZodString>;
263
+ gills: ZodArray<ZodObject<{
264
+ id: ZodString;
265
+ title: ZodString;
266
+ params: ZodOptional<ZodArray<...> & ZodType<..., ..., ...>>;
267
+ desktop: ZodOptional<ZodObject<{
268
+ sizes: ...;
269
+ }, $strict>>;
270
+ }, $strict>>;
271
+ }, $strict>>;
272
+ roles: ZodObject<{
273
+ inbox: ZodOptional<ZodObject<{
274
+ surfaceId: ZodNullable<ZodString>;
275
+ chosen: ZodBoolean;
276
+ }, $strict>>;
277
+ }, $strict>;
278
+ }, $strict>;
279
+ ```
280
+
281
+ Read-only desktop metadata; identities are surface addresses, never launch
282
+ authority.
283
+
284
+ ---
285
+
286
+ ### appCatalogBrokerResultSchema
287
+
288
+ ```ts
289
+ const appCatalogBrokerResultSchema: ZodUnion<readonly [ZodObject<{
290
+ apps: ZodArray<ZodObject<{
291
+ surfaceId: ZodString;
292
+ appId: ZodString;
293
+ displayName: ZodOptional<ZodString>;
294
+ gills: ZodArray<ZodObject<{
295
+ id: ZodString;
296
+ title: ZodString;
297
+ params: ZodOptional<...>;
298
+ desktop: ZodOptional<...>;
299
+ }, $strict>>;
300
+ }, $strict>>;
301
+ roles: ZodObject<{
302
+ inbox: ZodOptional<ZodObject<{
303
+ surfaceId: ZodNullable<ZodString>;
304
+ chosen: ZodBoolean;
305
+ }, $strict>>;
306
+ }, $strict>;
307
+ }, $strict>, ZodObject<{
308
+ error: ZodString;
309
+ }, $strict>]>;
310
+ ```
311
+
312
+ Complete APPS.catalog reply, including broker admission failures.
313
+
314
+ ## Functions
315
+
316
+ ### addressKey()
317
+
318
+ ```ts
319
+ function addressKey(address): string;
320
+ ```
321
+
322
+ Stable identity of one App address across directory and settings views.
323
+
324
+ #### Parameters
325
+
326
+ | Parameter | Type |
327
+ | --------- | --------------------------------------------------------------------------------------------------------------- |
328
+ | `address` | \| \{ `kind`: `"default"`; `appId`: `string`; \} \| \{ `kind`: `"installation"`; `installationId`: `string`; \} |
329
+
330
+ #### Returns
331
+
332
+ `string`
@@ -0,0 +1,224 @@
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) / shell/command-host
8
+
9
+ # shell/command-host
10
+
11
+ ## Type Aliases
12
+
13
+ ### AppCommandOptional
14
+
15
+ ```ts
16
+ type AppCommandOptional<T> = T | undefined;
17
+ ```
18
+
19
+ An optional field a declaration may carry as explicitly undefined.
20
+
21
+ #### Type Parameters
22
+
23
+ | Type Parameter |
24
+ | -------------- |
25
+ | `T` |
26
+
27
+ ---
28
+
29
+ ### AppCommandDeclaration
30
+
31
+ ```ts
32
+ type AppCommandDeclaration = Readonly<{
33
+ id: string;
34
+ title: string;
35
+ category: string;
36
+ description?: AppCommandOptional<string>;
37
+ projections?: AppCommandOptional<
38
+ Readonly<{
39
+ bindings?: AppCommandOptional<
40
+ Readonly<{
41
+ order?: AppCommandOptional<number>;
42
+ values: readonly string[];
43
+ }>
44
+ >;
45
+ agent?: AppCommandOptional<
46
+ Readonly<{
47
+ order?: AppCommandOptional<number>;
48
+ keybind?: AppCommandOptional<string>;
49
+ }>
50
+ >;
51
+ help?: AppCommandOptional<
52
+ Readonly<{
53
+ order?: AppCommandOptional<number>;
54
+ }>
55
+ >;
56
+ menu?: AppCommandOptional<
57
+ Readonly<{
58
+ order?: AppCommandOptional<number>;
59
+ }>
60
+ >;
61
+ palette?: AppCommandOptional<
62
+ Readonly<{
63
+ order?: AppCommandOptional<number>;
64
+ }>
65
+ >;
66
+ slash?: AppCommandOptional<
67
+ Readonly<{
68
+ order?: AppCommandOptional<number>;
69
+ aliases: readonly string[];
70
+ }>
71
+ >;
72
+ }>
73
+ >;
74
+ }>;
75
+ ```
76
+
77
+ The digest-covered command rows a mounted App's Release declares, as the host
78
+ receives them. Oyster compares and projects them; the Release declaration
79
+ grammar stays with its owner, which hands rows of this shape.
80
+
81
+ ---
82
+
83
+ ### AppSurfaceCommandMount
84
+
85
+ ```ts
86
+ type AppSurfaceCommandMount = Readonly<{
87
+ handlers: Pick<AppHostHandlers, "registerCommands" | "invokeReservedChord">;
88
+ dispose: () => void;
89
+ }>;
90
+ ```
91
+
92
+ The command side of one mounted App's host handlers.
93
+
94
+ ---
95
+
96
+ ### PaneCommands
97
+
98
+ ```ts
99
+ type PaneCommands = Readonly<{
100
+ commandId: (id) => string;
101
+ contribute: (commands) => WhistleContributionLease;
102
+ execute: WhistleRuntime["execute"];
103
+ snapshot: WhistleRuntime["snapshot"];
104
+ subscribe: WhistleRuntime["subscribe"];
105
+ present: WhistleRuntime["present"];
106
+ }>;
107
+ ```
108
+
109
+ Commands owned by one pane, projected to globals plus its focus scope.
110
+
111
+ ---
112
+
113
+ ### PaneCommandMount
114
+
115
+ ```ts
116
+ type PaneCommandMount = PaneCommands &
117
+ Readonly<{
118
+ dispose: () => void;
119
+ }>;
120
+ ```
121
+
122
+ Closing a pane withdraws all its leases, presenters and subscriptions.
123
+
124
+ ---
125
+
126
+ ### AppSurfaceCommandHost
127
+
128
+ ```ts
129
+ type AppSurfaceCommandHost = Readonly<{
130
+ mountPane: (paneId) => PaneCommandMount;
131
+ mount: (mountId, declarations) => AppSurfaceCommandMount;
132
+ focus: (mountId) => void;
133
+ registerShellCommands: (commands) => () => void;
134
+ registerDirectoryCommands: (commands, run) => () => void;
135
+ menu: () => readonly WhistleMenuProjection[];
136
+ active: () => WhistleSnapshot;
137
+ execute: (commandId, input) => Promise<WhistleExecutionOutcome>;
138
+ snapshot: () => WhistleSnapshot;
139
+ subscribe: (listener) => () => void;
140
+ dispose: () => void;
141
+ }>;
142
+ ```
143
+
144
+ The shell-owned Whistle graph and its focused menu projection.
145
+
146
+ ## Variables
147
+
148
+ ### appDirectorySourceId
149
+
150
+ ```ts
151
+ const appDirectorySourceId: "app-directory" = "app-directory";
152
+ ```
153
+
154
+ Whistle source of Release-advertised rows for Apps not yet mounted.
155
+
156
+ ## Functions
157
+
158
+ ### commandPaletteReservedChordForPlatform()
159
+
160
+ ```ts
161
+ function commandPaletteReservedChordForPlatform(mac): AppHostReservedChord;
162
+ ```
163
+
164
+ Select the shell command-palette chord for a Mac or non-Mac keyboard.
165
+
166
+ #### Parameters
167
+
168
+ | Parameter | Type |
169
+ | --------- | --------- |
170
+ | `mac` | `boolean` |
171
+
172
+ #### Returns
173
+
174
+ `AppHostReservedChord`
175
+
176
+ ---
177
+
178
+ ### commandPaletteReservedChordForUserAgent()
179
+
180
+ ```ts
181
+ function commandPaletteReservedChordForUserAgent(
182
+ userAgent,
183
+ ): AppHostReservedChord;
184
+ ```
185
+
186
+ Select the shell command-palette chord from the embedding browser user agent.
187
+
188
+ #### Parameters
189
+
190
+ | Parameter | Type |
191
+ | ----------- | -------- |
192
+ | `userAgent` | `string` |
193
+
194
+ #### Returns
195
+
196
+ `AppHostReservedChord`
197
+
198
+ ---
199
+
200
+ ### createAppSurfaceCommandHost()
201
+
202
+ ```ts
203
+ function createAppSurfaceCommandHost(whistle?): AppSurfaceCommandHost;
204
+ ```
205
+
206
+ Own one shell's Whistle runtime for mounted Apps and local panes. The embedding
207
+ host supplies verified Release declarations and decides which App or pane has
208
+ focus.
209
+
210
+ Agar invokes `registerCommands` once for the aggregate command set of a mount.
211
+ The adapter keeps that aggregate as one Whistle generation, so an Agar update
212
+ replaces the generation atomically and disposal releases only that App. Command
213
+ handlers remain the App's callback; the shell only adds the Whistle identity and
214
+ routes focused menu execution to it.
215
+
216
+ #### Parameters
217
+
218
+ | Parameter | Type |
219
+ | --------- | ---------------- |
220
+ | `whistle` | `WhistleRuntime` |
221
+
222
+ #### Returns
223
+
224
+ [`AppSurfaceCommandHost`](#appsurfacecommandhost)