@fungi.computer/oyster 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/README.md +228 -176
  2. package/dist/agent-avatars.d.ts +103 -0
  3. package/dist/agent-avatars.js +66 -0
  4. package/dist/agents.d.ts +12 -2
  5. package/dist/agents.js +39 -2
  6. package/dist/app-builds.d.ts +76 -17
  7. package/dist/app-builds.js +207 -63
  8. package/dist/app-sources.d.ts +7 -22
  9. package/dist/app-sources.js +49 -14
  10. package/dist/apps/gate.d.ts +7 -7
  11. package/dist/apps/gate.js +6 -6
  12. package/dist/apps/installation.d.ts +35 -35
  13. package/dist/apps/installation.js +20 -19
  14. package/dist/build/artifact-writer.d.ts +40 -0
  15. package/dist/build/artifact-writer.js +181 -0
  16. package/dist/build/build-jobs.js +7 -1
  17. package/dist/build/build-policy.d.ts +10 -0
  18. package/dist/build/build-policy.js +10 -0
  19. package/dist/build/build-step.d.ts +12 -1
  20. package/dist/build/build-step.js +9 -1
  21. package/dist/build/candidate-builder.d.ts +68 -0
  22. package/dist/build/candidate-builder.js +91 -0
  23. package/dist/build/candidate-cli.d.ts +1 -0
  24. package/dist/build/candidate-cli.js +119 -0
  25. package/dist/build/candidate-cli.mjs +28220 -0
  26. package/dist/build/content-objects.d.ts +37 -0
  27. package/dist/build/content-objects.js +53 -0
  28. package/dist/build/effect.d.ts +18 -0
  29. package/dist/build/effect.js +52 -12
  30. package/dist/build/git-environment.d.ts +3 -0
  31. package/dist/build/git-environment.js +21 -9
  32. package/dist/build/local-build.d.ts +13 -3
  33. package/dist/build/local-build.js +149 -99
  34. package/dist/build/snapshot-package-store.d.ts +10 -0
  35. package/dist/build/snapshot-package-store.js +15 -0
  36. package/dist/build/snapshot-program-scripts.js +1 -1
  37. package/dist/build/snapshot-programs/snapshot-path.d.ts +2 -0
  38. package/dist/build/snapshot-programs/snapshot-path.js +6 -0
  39. package/dist/build/submission-contract.d.ts +461 -17
  40. package/dist/build/submission-contract.js +136 -26
  41. package/dist/build/workspace-build.d.ts +7 -2
  42. package/dist/build/workspace-build.js +55 -11
  43. package/dist/build-contract.d.ts +3 -0
  44. package/dist/build-contract.js +3 -0
  45. package/dist/build-egress.d.ts +62 -0
  46. package/dist/build-egress.js +148 -0
  47. package/dist/build.d.ts +1 -0
  48. package/dist/build.js +1 -0
  49. package/dist/cloudflare.js +4 -4
  50. package/dist/frame-binding-wire-script.js +1 -1
  51. package/dist/frame-binding-wire.d.ts +1 -1
  52. package/dist/frame-binding-wire.js +1 -1
  53. package/dist/git-journal.js +4 -4
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +1 -0
  56. package/dist/installation-consent.d.ts +3 -1
  57. package/dist/installation-consent.js +2 -0
  58. package/dist/mcp-owner.js +20 -8
  59. package/dist/pack.d.ts +6 -3
  60. package/dist/pack.js +28 -11
  61. package/dist/page/gill-observation.d.ts +4 -0
  62. package/dist/page/gill-observation.js +31 -0
  63. package/dist/page/mount.d.ts +4 -8
  64. package/dist/page/window-launch.d.ts +18 -0
  65. package/dist/page/window-launch.js +11 -0
  66. package/dist/page-script.js +4 -4
  67. package/dist/release.d.ts +11 -0
  68. package/dist/release.js +4 -1
  69. package/dist/shell/app-directory.d.ts +50 -45
  70. package/dist/shell/app-directory.js +19 -18
  71. package/dist/shell/shell-module.d.ts +26 -2
  72. package/dist/shell/shell-module.js +51 -2
  73. package/dist/shell/window-manager.d.ts +5 -1
  74. package/dist/shell/window-manager.js +21 -2
  75. package/dist/shell/workbench-directory.d.ts +332 -0
  76. package/dist/shell/workbench-directory.js +35 -0
  77. package/dist/shell/workbench-host-types.d.ts +1 -1
  78. package/dist/shell/workbench-host.js +5 -0
  79. package/dist/shell/workbench-model.d.ts +3 -1
  80. package/dist/source/index.d.ts +6 -7
  81. package/dist/source/index.js +6 -7
  82. package/dist/source/template-push.d.ts +33 -0
  83. package/dist/source/template-push.js +223 -0
  84. package/dist/source/template-repository.d.ts +2 -0
  85. package/dist/source/template-repository.js +13 -0
  86. package/dist/source/{template-write.d.ts → template-seed.d.ts} +19 -20
  87. package/dist/source/template-seed.js +80 -0
  88. package/dist/standalone/agent-directory.d.ts +4 -0
  89. package/dist/standalone/agent-directory.js +4 -0
  90. package/dist/standalone/agents.d.ts +227 -0
  91. package/dist/standalone/agents.js +834 -0
  92. package/dist/standalone/app-builds-binding.d.ts +36 -0
  93. package/dist/standalone/app-builds-binding.js +119 -0
  94. package/dist/standalone/app-set.d.ts +91 -0
  95. package/dist/standalone/app-set.js +395 -0
  96. package/dist/standalone/app-source.d.ts +41 -0
  97. package/dist/standalone/app-source.js +59 -0
  98. package/dist/standalone/builds.d.ts +18 -0
  99. package/dist/standalone/builds.js +101 -0
  100. package/dist/standalone/computer-egress.d.ts +37 -0
  101. package/dist/standalone/computer-egress.js +111 -0
  102. package/dist/standalone/computer.d.ts +122 -0
  103. package/dist/standalone/computer.js +714 -0
  104. package/dist/standalone/install-apps-cli.d.ts +2 -0
  105. package/dist/standalone/install-apps-cli.js +126 -0
  106. package/dist/standalone/instance.d.ts +35 -0
  107. package/dist/standalone/instance.js +74 -0
  108. package/dist/standalone/media.d.ts +76 -0
  109. package/dist/standalone/media.js +227 -0
  110. package/dist/standalone/preview.d.ts +51 -0
  111. package/dist/standalone/preview.js +167 -0
  112. package/dist/standalone/registry.d.ts +102 -0
  113. package/dist/standalone/registry.js +193 -0
  114. package/dist/standalone/tenancy.d.ts +42 -0
  115. package/dist/standalone/tenancy.js +241 -0
  116. package/dist/standalone/worker.d.ts +55 -0
  117. package/dist/standalone/worker.js +147 -0
  118. package/dist/standalone/workflow-authority-readers.d.ts +16 -0
  119. package/dist/standalone/workflow-authority-readers.js +35 -0
  120. package/dist/standalone/workflow-binding.d.ts +216 -0
  121. package/dist/standalone/workflow-binding.js +217 -0
  122. package/dist/standalone/workflow-events.d.ts +46 -0
  123. package/dist/standalone/workflow-events.js +39 -0
  124. package/dist/standalone/workflow-git-capture.d.ts +7 -0
  125. package/dist/standalone/workflow-git-capture.js +62 -0
  126. package/dist/standalone/workflow-host.d.ts +955 -0
  127. package/dist/standalone/workflow-host.js +778 -0
  128. package/dist/standalone/workflow-node-capture.d.ts +13 -0
  129. package/dist/standalone/workflow-node-capture.js +72 -0
  130. package/dist/standalone/workflow-root-authority.d.ts +27 -0
  131. package/dist/standalone/workflow-root-authority.js +87 -0
  132. package/dist/standalone/workflow-schedules.d.ts +52 -0
  133. package/dist/standalone/workflow-schedules.js +40 -0
  134. package/dist/standalone/workflow-trigger-host.d.ts +1716 -0
  135. package/dist/standalone/workflow-trigger-host.js +52 -0
  136. package/dist/standalone/workflows.d.ts +713 -0
  137. package/dist/standalone/workflows.js +554 -0
  138. package/dist/tenancy/auth0.d.ts +64 -0
  139. package/dist/tenancy/auth0.js +198 -0
  140. package/dist/tenancy/cloudflare/rate-limit.d.ts +8 -0
  141. package/dist/tenancy/cloudflare/rate-limit.js +19 -0
  142. package/dist/tenancy/cloudflare/registry.d.ts +50 -0
  143. package/dist/tenancy/cloudflare/registry.js +301 -0
  144. package/dist/tenancy/cloudflare.d.ts +2 -0
  145. package/dist/tenancy/cloudflare.js +2 -0
  146. package/dist/tenancy/cold-directory.d.ts +13 -0
  147. package/dist/tenancy/cold-directory.js +43 -0
  148. package/dist/tenancy/contracts.d.ts +195 -0
  149. package/dist/tenancy/contracts.js +1 -0
  150. package/dist/tenancy/index.d.ts +19 -0
  151. package/dist/tenancy/index.js +156 -0
  152. package/dist/tenancy/owner-key.d.ts +26 -0
  153. package/dist/tenancy/owner-key.js +63 -0
  154. package/dist/tenancy/oyster.d.ts +4 -0
  155. package/dist/tenancy/oyster.js +25 -0
  156. package/dist/tenancy/registry-record.d.ts +7 -0
  157. package/dist/tenancy/registry-record.js +44 -0
  158. package/dist/tenancy/registry.d.ts +27 -0
  159. package/dist/tenancy/registry.js +138 -0
  160. package/dist/tenancy/resolve.d.ts +7 -0
  161. package/dist/tenancy/resolve.js +64 -0
  162. package/dist/workers-git.js +1 -4
  163. package/dist/workers.d.ts +2 -2
  164. package/dist/workers.js +3 -1
  165. package/docs/api/build-contract.md +829 -32
  166. package/docs/api/build.md +253 -17
  167. package/docs/api/modules.md +40 -32
  168. package/docs/api/pack.md +6 -3
  169. package/docs/api/shell/app-directory.md +267 -0
  170. package/docs/api/shell/shell-module.md +64 -3
  171. package/docs/api/shell/workbench-directory.md +119 -0
  172. package/docs/api/shell/workbench.md +19 -0
  173. package/docs/api/shell.md +127 -0
  174. package/docs/api/tenancy/auth0.md +110 -0
  175. package/docs/api/tenancy/cloudflare.md +221 -0
  176. package/docs/api/tenancy/cold-directory.md +46 -0
  177. package/docs/api/tenancy/owner-key.md +63 -0
  178. package/docs/api/tenancy/registry.md +77 -0
  179. package/docs/api/tenancy/resolve.md +69 -0
  180. package/docs/api/tenancy.md +430 -0
  181. package/docs/api/workers-git.md +140 -21
  182. package/docs/api/workers.md +15 -2
  183. package/docs/site/agent-quickstart.mdx +52 -55
  184. package/examples/standalone/worker.ts +7 -14
  185. package/examples/standalone/wrangler.jsonc +67 -6
  186. package/package.json +78 -25
  187. package/dist/build/r2-artifact-writer.d.ts +0 -31
  188. package/dist/build/r2-artifact-writer.js +0 -179
  189. package/dist/source/template-write.js +0 -344
  190. package/docs/media/architecture.mmd +0 -32
  191. package/docs/media/architecture.png +0 -0
  192. package/docs/media/bonsai-network.png +0 -0
  193. package/docs/media/bonsai-repository.png +0 -0
  194. package/examples/git/worker.ts +0 -39
  195. package/examples/git/wrangler.jsonc +0 -32
@@ -0,0 +1,332 @@
1
+ import * as z from "zod";
2
+ /** Desktop metadata shared by hosts; hosted administration stays in Settings. */
3
+ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
4
+ apps: z.ZodArray<z.ZodObject<{
5
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
6
+ kind: z.ZodLiteral<"default">;
7
+ appId: z.ZodString;
8
+ }, z.core.$strict>, z.ZodObject<{
9
+ kind: z.ZodLiteral<"installation">;
10
+ installationId: z.ZodString;
11
+ }, z.core.$strict>]>>;
12
+ installationId: z.ZodNullable<z.ZodString>;
13
+ surfaceId: z.ZodString;
14
+ appId: z.ZodString;
15
+ displayName: z.ZodOptional<z.ZodString>;
16
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ releaseId: z.ZodNullable<z.ZodString>;
18
+ authorityVersion: z.ZodNumber;
19
+ enforcement: z.ZodNullable<z.ZodLazy<z.ZodObject<{
20
+ requestId: z.ZodString;
21
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
22
+ kind: z.ZodLiteral<"default">;
23
+ appId: z.ZodString;
24
+ }, z.core.$strict>, z.ZodObject<{
25
+ kind: z.ZodLiteral<"installation">;
26
+ installationId: z.ZodString;
27
+ }, z.core.$strict>]>>;
28
+ authorityVersion: z.ZodNumber;
29
+ state: z.ZodEnum<{
30
+ unaffected: "unaffected";
31
+ pending: "pending";
32
+ applied: "applied";
33
+ expired: "expired";
34
+ }>;
35
+ outstanding: z.ZodNumber;
36
+ }, z.core.$strict>>>;
37
+ handlers: z.ZodArray<z.ZodLiteral<"file.open">>;
38
+ roles: z.ZodArray<z.ZodString>;
39
+ declaredCapabilities: z.ZodArray<z.ZodString>;
40
+ calls: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodTransform<readonly {
41
+ readonly appId: string;
42
+ readonly methods: readonly string[];
43
+ }[], unknown>>>;
44
+ commands: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<Readonly<{
45
+ id: string;
46
+ title: string;
47
+ category: string;
48
+ description?: string | undefined;
49
+ sigil?: string | undefined;
50
+ projections?: Readonly<{
51
+ bindings?: (Readonly<{
52
+ order?: number | undefined;
53
+ }> & Readonly<{
54
+ values: readonly string[];
55
+ }>) | undefined;
56
+ agent?: (Readonly<{
57
+ order?: number | undefined;
58
+ }> & Readonly<{
59
+ keybind?: string | undefined;
60
+ }>) | undefined;
61
+ help?: Readonly<{
62
+ order?: number | undefined;
63
+ }> | undefined;
64
+ menu?: Readonly<{
65
+ order?: number | undefined;
66
+ }> | undefined;
67
+ palette?: Readonly<{
68
+ order?: number | undefined;
69
+ }> | undefined;
70
+ slash?: (Readonly<{
71
+ order?: number | undefined;
72
+ }> & Readonly<{
73
+ aliases: readonly string[];
74
+ }>) | undefined;
75
+ }> | undefined;
76
+ }>[], unknown[]>>;
77
+ gills: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<import("./app-directory.js").AppDirectoryGill[], unknown[]>>;
78
+ availability: z.ZodEnum<{
79
+ available: "available";
80
+ unavailable: "unavailable";
81
+ }>;
82
+ surface: z.ZodNullable<z.ZodObject<{
83
+ stableRoute: z.ZodString;
84
+ }, z.core.$strict>>;
85
+ surfacePath: z.ZodString;
86
+ computer: z.ZodOptional<z.ZodObject<{
87
+ computerId: z.ZodString;
88
+ name: z.ZodString;
89
+ }, z.core.$strip>>;
90
+ computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
91
+ kind: z.ZodLiteral<"selected-computers">;
92
+ computers: z.ZodArray<z.ZodObject<{
93
+ computerId: z.ZodString;
94
+ operations: z.ZodArray<z.ZodEnum<{
95
+ "computer.list": "computer.list";
96
+ "computer.readFile": "computer.readFile";
97
+ "computer.writeFile": "computer.writeFile";
98
+ "computer.execute": "computer.execute";
99
+ }>>;
100
+ }, z.core.$strict>>;
101
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
102
+ kind: z.ZodLiteral<"all-team-computers">;
103
+ operations: z.ZodArray<z.ZodEnum<{
104
+ "computer.list": "computer.list";
105
+ "computer.readFile": "computer.readFile";
106
+ "computer.writeFile": "computer.writeFile";
107
+ "computer.execute": "computer.execute";
108
+ }>>;
109
+ }, z.core.$strict>>], "kind">>>;
110
+ }, z.core.$strip>>;
111
+ computer: z.ZodOptional<z.ZodObject<{
112
+ computerId: z.ZodString;
113
+ name: z.ZodString;
114
+ }, z.core.$strip>>;
115
+ roles: z.ZodRecord<z.ZodString, z.ZodObject<{
116
+ surfaceId: z.ZodNullable<z.ZodString>;
117
+ chosen: z.ZodBoolean;
118
+ }, z.core.$strict>>;
119
+ needsUpdate: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
+ installationId: z.ZodNullable<z.ZodString>;
121
+ appId: z.ZodNullable<z.ZodString>;
122
+ displayName: z.ZodString;
123
+ }, z.core.$strict>>>;
124
+ }, z.core.$strip>, z.ZodTransform<{
125
+ apps: {
126
+ address: {
127
+ kind: "default";
128
+ appId: string;
129
+ } | {
130
+ kind: "installation";
131
+ installationId: string;
132
+ };
133
+ installationId: string | null;
134
+ surfaceId: string;
135
+ appId: string;
136
+ releaseId: string | null;
137
+ authorityVersion: number;
138
+ enforcement: {
139
+ requestId: string;
140
+ address: {
141
+ kind: "default";
142
+ appId: string;
143
+ } | {
144
+ kind: "installation";
145
+ installationId: string;
146
+ };
147
+ authorityVersion: number;
148
+ state: "unaffected" | "pending" | "applied" | "expired";
149
+ outstanding: number;
150
+ } | null;
151
+ handlers: "file.open"[];
152
+ roles: string[];
153
+ declaredCapabilities: string[];
154
+ commands: Readonly<{
155
+ id: string;
156
+ title: string;
157
+ category: string;
158
+ description?: string | undefined;
159
+ sigil?: string | undefined;
160
+ projections?: Readonly<{
161
+ bindings?: (Readonly<{
162
+ order?: number | undefined;
163
+ }> & Readonly<{
164
+ values: readonly string[];
165
+ }>) | undefined;
166
+ agent?: (Readonly<{
167
+ order?: number | undefined;
168
+ }> & Readonly<{
169
+ keybind?: string | undefined;
170
+ }>) | undefined;
171
+ help?: Readonly<{
172
+ order?: number | undefined;
173
+ }> | undefined;
174
+ menu?: Readonly<{
175
+ order?: number | undefined;
176
+ }> | undefined;
177
+ palette?: Readonly<{
178
+ order?: number | undefined;
179
+ }> | undefined;
180
+ slash?: (Readonly<{
181
+ order?: number | undefined;
182
+ }> & Readonly<{
183
+ aliases: readonly string[];
184
+ }>) | undefined;
185
+ }> | undefined;
186
+ }>[];
187
+ gills: import("./app-directory.js").AppDirectoryGill[];
188
+ availability: "available" | "unavailable";
189
+ surface: {
190
+ stableRoute: string;
191
+ } | null;
192
+ surfacePath: string;
193
+ displayName?: string | undefined;
194
+ icon?: string | null | undefined;
195
+ calls?: readonly {
196
+ readonly appId: string;
197
+ readonly methods: readonly string[];
198
+ }[] | undefined;
199
+ computer?: {
200
+ computerId: string;
201
+ name: string;
202
+ } | undefined;
203
+ computerPermission?: {
204
+ kind: "selected-computers";
205
+ computers: {
206
+ computerId: string;
207
+ operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
208
+ }[];
209
+ } | {
210
+ kind: "all-team-computers";
211
+ operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
212
+ } | null | undefined;
213
+ }[];
214
+ roles: Record<string, {
215
+ surfaceId: string | null;
216
+ chosen: boolean;
217
+ }>;
218
+ computer?: {
219
+ computerId: string;
220
+ name: string;
221
+ } | undefined;
222
+ needsUpdate?: {
223
+ installationId: string | null;
224
+ appId: string | null;
225
+ displayName: string;
226
+ }[] | undefined;
227
+ }, {
228
+ apps: {
229
+ address: {
230
+ kind: "default";
231
+ appId: string;
232
+ } | {
233
+ kind: "installation";
234
+ installationId: string;
235
+ };
236
+ installationId: string | null;
237
+ surfaceId: string;
238
+ appId: string;
239
+ releaseId: string | null;
240
+ authorityVersion: number;
241
+ enforcement: {
242
+ requestId: string;
243
+ address: {
244
+ kind: "default";
245
+ appId: string;
246
+ } | {
247
+ kind: "installation";
248
+ installationId: string;
249
+ };
250
+ authorityVersion: number;
251
+ state: "unaffected" | "pending" | "applied" | "expired";
252
+ outstanding: number;
253
+ } | null;
254
+ handlers: "file.open"[];
255
+ roles: string[];
256
+ declaredCapabilities: string[];
257
+ commands: Readonly<{
258
+ id: string;
259
+ title: string;
260
+ category: string;
261
+ description?: string | undefined;
262
+ sigil?: string | undefined;
263
+ projections?: Readonly<{
264
+ bindings?: (Readonly<{
265
+ order?: number | undefined;
266
+ }> & Readonly<{
267
+ values: readonly string[];
268
+ }>) | undefined;
269
+ agent?: (Readonly<{
270
+ order?: number | undefined;
271
+ }> & Readonly<{
272
+ keybind?: string | undefined;
273
+ }>) | undefined;
274
+ help?: Readonly<{
275
+ order?: number | undefined;
276
+ }> | undefined;
277
+ menu?: Readonly<{
278
+ order?: number | undefined;
279
+ }> | undefined;
280
+ palette?: Readonly<{
281
+ order?: number | undefined;
282
+ }> | undefined;
283
+ slash?: (Readonly<{
284
+ order?: number | undefined;
285
+ }> & Readonly<{
286
+ aliases: readonly string[];
287
+ }>) | undefined;
288
+ }> | undefined;
289
+ }>[];
290
+ gills: import("./app-directory.js").AppDirectoryGill[];
291
+ availability: "available" | "unavailable";
292
+ surface: {
293
+ stableRoute: string;
294
+ } | null;
295
+ surfacePath: string;
296
+ displayName?: string | undefined;
297
+ icon?: string | null | undefined;
298
+ calls?: readonly {
299
+ readonly appId: string;
300
+ readonly methods: readonly string[];
301
+ }[] | undefined;
302
+ computer?: {
303
+ computerId: string;
304
+ name: string;
305
+ } | undefined;
306
+ computerPermission?: {
307
+ kind: "selected-computers";
308
+ computers: {
309
+ computerId: string;
310
+ operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
311
+ }[];
312
+ } | {
313
+ kind: "all-team-computers";
314
+ operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
315
+ } | null | undefined;
316
+ }[];
317
+ roles: Record<string, {
318
+ surfaceId: string | null;
319
+ chosen: boolean;
320
+ }>;
321
+ computer?: {
322
+ computerId: string;
323
+ name: string;
324
+ } | undefined;
325
+ needsUpdate?: {
326
+ installationId: string | null;
327
+ appId: string | null;
328
+ displayName: string;
329
+ }[] | undefined;
330
+ }>>;
331
+ /** One host's current desktop rows and actual role selections. */
332
+ export type WorkbenchDirectory = z.output<typeof workbenchDirectorySchema>;
@@ -0,0 +1,35 @@
1
+ import * as z from "zod";
2
+ import { appDirectoryEntrySchema, appRoleSelectionSchema, appComputerPermissionSchema, } from "./app-directory.js";
3
+ import { teamComputerSchema } from "./workbench-model.js";
4
+ const computerChoiceSchema = teamComputerSchema
5
+ .pick({ computerId: true, name: true })
6
+ .strip();
7
+ /** Desktop metadata shared by hosts; hosted administration stays in Settings. */
8
+ export const workbenchDirectorySchema = z
9
+ .object({
10
+ apps: z.array(appDirectoryEntrySchema
11
+ .extend({
12
+ computer: computerChoiceSchema.optional(),
13
+ computerPermission: appComputerPermissionSchema.nullable().optional(),
14
+ })
15
+ .strip()),
16
+ /** Fixed standalone context, not a Team Computer permission or capability grant. */
17
+ computer: computerChoiceSchema.optional(),
18
+ roles: z.record(z.string().min(1), appRoleSelectionSchema),
19
+ needsUpdate: z
20
+ .array(z.strictObject({
21
+ installationId: z.string().min(1).nullable(),
22
+ appId: z.string().min(1).nullable(),
23
+ displayName: z.string().min(1),
24
+ }))
25
+ .optional(),
26
+ })
27
+ .transform((directory) => directory.computer === undefined
28
+ ? directory
29
+ : {
30
+ ...directory,
31
+ apps: directory.apps.map((app) => ({
32
+ ...app,
33
+ computer: directory.computer,
34
+ })),
35
+ });
@@ -9,7 +9,7 @@ export type WorkbenchResolvedChild = Readonly<{
9
9
  title?: string;
10
10
  }>;
11
11
  /** The host's real mounted App; selection and lease replacement stay with it. */
12
- export type WorkbenchChildSurface = Pick<WorkbenchChildHandle, "setVisibility" | "requestClose" | "requestBack" | "activateStatus"> & {
12
+ export type WorkbenchChildSurface = Pick<WorkbenchChildHandle, "setVisibility" | "requestClose" | "requestBack" | "activateStatus" | "activateNavigation"> & {
13
13
  /** Release the mounted child or host-owned observations. */
14
14
  dispose(): void;
15
15
  /** Replace the host-admitted selection while retaining the child document. */
@@ -109,6 +109,11 @@ class MountedChildHandle {
109
109
  // The shell relays the person's click; parse it at the host's edge.
110
110
  return this.surface.activateStatus(parseAppStatusAction(action));
111
111
  }
112
+ async activateNavigation(activation) {
113
+ if (this.#disposed)
114
+ return false;
115
+ return this.surface.activateNavigation(activation);
116
+ }
112
117
  async invokeCommand(commandId, input) {
113
118
  const invoke = this.commands.invoke;
114
119
  if (this.#disposed || invoke === undefined)
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod";
2
2
  import * as Schema from "effect/Schema";
3
- import type { AppCommand, AppOpenRequest, FileNavigationInput, AppNavigationState, AppStatusAction, AppStatusItem } from "@fungi.computer/agar";
3
+ import type { AppCommand, AppOpenRequest, FileNavigationInput, AppNavigationActivation, AppNavigationState, AppStatusAction, AppStatusItem } from "@fungi.computer/agar";
4
4
  import type { AppOpenInput, AppRoleChoice } from "@fungi.computer/agar/apps";
5
5
  import type { WhistleExecutionOrigin, WhistleJsonValue } from "@fungi.computer/whistle";
6
6
  /** A request to resolve and mount one child App, by its own identity. */
@@ -68,6 +68,8 @@ export type WorkbenchChildHandle = {
68
68
  requestBack(): Promise<boolean>;
69
69
  /** Deliver the person's use of a child's status item; `true` when it acted. */
70
70
  activateStatus(action: AppStatusAction): Promise<boolean>;
71
+ /** Deliver the person's use of a child's crumb or header command; `true` when it acted. */
72
+ activateNavigation(activation: AppNavigationActivation): Promise<boolean>;
71
73
  /** Run one of the child's currently presented commands. */
72
74
  invokeCommand(commandId: string, input: WorkbenchCommandInvocation): Promise<WhistleJsonValue | undefined>;
73
75
  /** Release the child mount and its resources. */
@@ -1,11 +1,10 @@
1
- /** App source seed receipts and the fork algorithm, owned generically here;
2
- * the Publisher supplies D1 adapters and the retained Git admission
3
- * transport. The Node-only template writer (`memfs` + `isomorphic-git`) is
4
- * deliberately not re-exported here: it would drag that dependency into
5
- * every Worker bundle that only needs the fork/provenance reads below (team
6
- * rail's RPC surface has no use for it). Import it from
7
- * `@fungi.computer/oyster/source/template-write` instead. */
1
+ /** App source seed receipts, seed claims and the fork algorithm, owned
2
+ * generically here; the Publisher supplies D1 adapters and the retained Git
3
+ * admission transport. The operator's Node-only template push (it runs the
4
+ * `git` executable) is deliberately not re-exported here, so Worker bundles
5
+ * never import it: use `@fungi.computer/oyster/source/template-push`. */
8
6
  export { templateRepositoryForApp } from "./template-repository.js";
9
7
  export { seedReceiptInputSchema, sameReceipt, type PublisherTemplateSeedReceipt, type PublisherTemplateSeedReceipts, } from "./seed-receipt.js";
10
8
  export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, } from "./team-source.js";
9
+ export { parseTemplateSeedClaim, recordTemplateSeed, templateSeedClaimSchema, TEMPLATE_SEED_CLAIM_MAX_BYTES, type TemplateSeedClaim, } from "./template-seed.js";
11
10
  export { forkAppSource, type AppSourceForkResult } from "./fork.js";
@@ -1,11 +1,10 @@
1
- /** App source seed receipts and the fork algorithm, owned generically here;
2
- * the Publisher supplies D1 adapters and the retained Git admission
3
- * transport. The Node-only template writer (`memfs` + `isomorphic-git`) is
4
- * deliberately not re-exported here: it would drag that dependency into
5
- * every Worker bundle that only needs the fork/provenance reads below (team
6
- * rail's RPC surface has no use for it). Import it from
7
- * `@fungi.computer/oyster/source/template-write` instead. */
1
+ /** App source seed receipts, seed claims and the fork algorithm, owned
2
+ * generically here; the Publisher supplies D1 adapters and the retained Git
3
+ * admission transport. The operator's Node-only template push (it runs the
4
+ * `git` executable) is deliberately not re-exported here, so Worker bundles
5
+ * never import it: use `@fungi.computer/oyster/source/template-push`. */
8
6
  export { templateRepositoryForApp } from "./template-repository.js";
9
7
  export { seedReceiptInputSchema, sameReceipt, } from "./seed-receipt.js";
10
8
  export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, } from "./team-source.js";
9
+ export { parseTemplateSeedClaim, recordTemplateSeed, templateSeedClaimSchema, TEMPLATE_SEED_CLAIM_MAX_BYTES, } from "./template-seed.js";
11
10
  export { forkAppSource } from "./fork.js";
@@ -0,0 +1,33 @@
1
+ import { type SourceRevision } from "@fungi.computer/puffball";
2
+ /** One projected source tree, as `createFirstPartyAppSourceDistribution` returns it. */
3
+ export type TemplateSourceFiles = readonly Readonly<{
4
+ path: string;
5
+ contents: Uint8Array;
6
+ }>[];
7
+ /** What one template push did: the template's `main` now names `seedRevision`. */
8
+ export type TemplatePushResult = Readonly<{
9
+ seedRevision: SourceRevision;
10
+ /** False when `main` already held this exact tree (an exact retry). */
11
+ pushed: boolean;
12
+ }>;
13
+ /**
14
+ * Commit one projected App source tree onto its template repository's `main`
15
+ * with ordinary Git, and push it there over smart HTTP.
16
+ *
17
+ * The tree holds exactly the given bytes (no attributes or filters), each a
18
+ * regular non-executable file. The first seed is a parentless commit; a later
19
+ * different tree is an ordinary fast-forward on the current head; an exact
20
+ * retry pushes nothing and answers the current head. Nothing is forced. The
21
+ * `headers` authenticate every request and reach Git only through its config
22
+ * environment.
23
+ */
24
+ export declare function pushTemplateSource(input: Readonly<{
25
+ appId: string;
26
+ /** The upstream commit the tree was projected from (`git:<sha>`). */
27
+ sourceRevision: string;
28
+ files: TemplateSourceFiles;
29
+ /** The template repository's smart-HTTP URL, without credentials. */
30
+ remote: string;
31
+ headers: Readonly<Record<string, string>>;
32
+ signal?: AbortSignal;
33
+ }>): Promise<TemplatePushResult>;