@fungi.computer/oyster 0.1.0 → 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 (43) hide show
  1. package/dist/agent-avatars.d.ts +103 -0
  2. package/dist/agent-avatars.js +66 -0
  3. package/dist/agents.d.ts +12 -2
  4. package/dist/agents.js +39 -2
  5. package/dist/apps/gate.d.ts +7 -7
  6. package/dist/apps/gate.js +6 -6
  7. package/dist/apps/installation.d.ts +35 -35
  8. package/dist/apps/installation.js +20 -19
  9. package/dist/build/candidate-cli.mjs +55 -5
  10. package/dist/build-egress.js +4 -4
  11. package/dist/cloudflare.js +4 -4
  12. package/dist/frame-binding-wire-script.js +1 -1
  13. package/dist/frame-binding-wire.d.ts +1 -1
  14. package/dist/frame-binding-wire.js +1 -1
  15. package/dist/git-journal.js +4 -4
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +1 -0
  18. package/dist/installation-consent.d.ts +3 -1
  19. package/dist/installation-consent.js +2 -0
  20. package/dist/page/mount.d.ts +4 -8
  21. package/dist/page-script.js +4 -4
  22. package/dist/shell/app-directory.d.ts +37 -37
  23. package/dist/shell/app-directory.js +15 -18
  24. package/dist/shell/window-manager.d.ts +5 -1
  25. package/dist/shell/window-manager.js +21 -2
  26. package/dist/shell/workbench-directory.d.ts +9 -9
  27. package/dist/shell/workbench-host-types.d.ts +1 -1
  28. package/dist/shell/workbench-host.js +5 -0
  29. package/dist/shell/workbench-model.d.ts +3 -1
  30. package/dist/standalone/agents.d.ts +11 -4
  31. package/dist/standalone/agents.js +44 -5
  32. package/dist/standalone/app-builds-binding.js +6 -6
  33. package/dist/standalone/computer.js +3 -3
  34. package/dist/standalone/preview.js +2 -2
  35. package/dist/standalone/worker.js +2 -2
  36. package/dist/standalone/workflow-binding.d.ts +10 -10
  37. package/dist/standalone/workflow-binding.js +2 -2
  38. package/dist/standalone/workflow-host.d.ts +37 -13
  39. package/dist/standalone/workflow-host.js +36 -9
  40. package/dist/standalone/workflow-trigger-host.d.ts +24 -2
  41. package/dist/standalone/workflows.d.ts +67 -11
  42. package/dist/workers-git.js +1 -4
  43. package/package.json +19 -17
@@ -2,23 +2,23 @@ import * as Schema from "effect/Schema";
2
2
  import { appDeclaredGillSchema } from "@fungi.computer/gills";
3
3
  import * as z from "zod";
4
4
  /** An App address selects a host default or a specific installation. */
5
- export declare const appAddressSchema: z.ZodUnion<readonly [z.ZodObject<{
5
+ export declare const appAddressSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
6
6
  kind: z.ZodLiteral<"default">;
7
7
  appId: z.ZodString;
8
8
  }, z.core.$strict>, z.ZodObject<{
9
9
  kind: z.ZodLiteral<"installation">;
10
10
  installationId: z.ZodString;
11
- }, z.core.$strict>]>;
11
+ }, z.core.$strict>]>>;
12
12
  /** Host-reported progress of applying a revised App authority version. */
13
- export declare const appAuthorityEnforcementSchema: z.ZodObject<{
13
+ export declare const appAuthorityEnforcementSchema: z.ZodLazy<z.ZodObject<{
14
14
  requestId: z.ZodString;
15
- address: z.ZodUnion<readonly [z.ZodObject<{
15
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
16
16
  kind: z.ZodLiteral<"default">;
17
17
  appId: z.ZodString;
18
18
  }, z.core.$strict>, z.ZodObject<{
19
19
  kind: z.ZodLiteral<"installation">;
20
20
  installationId: z.ZodString;
21
- }, z.core.$strict>]>;
21
+ }, z.core.$strict>]>>;
22
22
  authorityVersion: z.ZodNumber;
23
23
  state: z.ZodEnum<{
24
24
  unaffected: "unaffected";
@@ -27,7 +27,7 @@ export declare const appAuthorityEnforcementSchema: z.ZodObject<{
27
27
  expired: "expired";
28
28
  }>;
29
29
  outstanding: z.ZodNumber;
30
- }, z.core.$strict>;
30
+ }, z.core.$strict>>;
31
31
  /** Decoded address of a default App or an installation. */
32
32
  export type AppAddress = z.output<typeof appAddressSchema>;
33
33
  /** Stable identity of one App address across directory and settings views. */
@@ -43,13 +43,13 @@ export type AppDirectoryGill = {
43
43
  };
44
44
  /** Reusable App metadata supplied by an embedding host; it conveys no permissions. */
45
45
  export declare const appDirectoryEntrySchema: z.ZodObject<{
46
- address: z.ZodUnion<readonly [z.ZodObject<{
46
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
47
47
  kind: z.ZodLiteral<"default">;
48
48
  appId: z.ZodString;
49
49
  }, z.core.$strict>, z.ZodObject<{
50
50
  kind: z.ZodLiteral<"installation">;
51
51
  installationId: z.ZodString;
52
- }, z.core.$strict>]>;
52
+ }, z.core.$strict>]>>;
53
53
  installationId: z.ZodNullable<z.ZodString>;
54
54
  surfaceId: z.ZodString;
55
55
  appId: z.ZodString;
@@ -57,15 +57,15 @@ export declare const appDirectoryEntrySchema: z.ZodObject<{
57
57
  icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
58
58
  releaseId: z.ZodNullable<z.ZodString>;
59
59
  authorityVersion: z.ZodNumber;
60
- enforcement: z.ZodNullable<z.ZodObject<{
60
+ enforcement: z.ZodNullable<z.ZodLazy<z.ZodObject<{
61
61
  requestId: z.ZodString;
62
- address: z.ZodUnion<readonly [z.ZodObject<{
62
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
63
63
  kind: z.ZodLiteral<"default">;
64
64
  appId: z.ZodString;
65
65
  }, z.core.$strict>, z.ZodObject<{
66
66
  kind: z.ZodLiteral<"installation">;
67
67
  installationId: z.ZodString;
68
- }, z.core.$strict>]>;
68
+ }, z.core.$strict>]>>;
69
69
  authorityVersion: z.ZodNumber;
70
70
  state: z.ZodEnum<{
71
71
  unaffected: "unaffected";
@@ -74,7 +74,7 @@ export declare const appDirectoryEntrySchema: z.ZodObject<{
74
74
  expired: "expired";
75
75
  }>;
76
76
  outstanding: z.ZodNumber;
77
- }, z.core.$strict>>;
77
+ }, z.core.$strict>>>;
78
78
  handlers: z.ZodArray<z.ZodLiteral<"file.open">>;
79
79
  roles: z.ZodArray<z.ZodString>;
80
80
  declaredCapabilities: z.ZodArray<z.ZodString>;
@@ -133,7 +133,7 @@ export declare const appRoleSelectionSchema: z.ZodObject<{
133
133
  chosen: z.ZodBoolean;
134
134
  }, z.core.$strict>;
135
135
  /** App Computer permissions limited to selected Computers or the Team's Computers. */
136
- export declare const appComputerPermissionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
+ export declare const appComputerPermissionSchema: z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
137
137
  kind: z.ZodLiteral<"selected-computers">;
138
138
  computers: z.ZodArray<z.ZodObject<{
139
139
  computerId: z.ZodString;
@@ -144,7 +144,7 @@ export declare const appComputerPermissionSchema: z.ZodDiscriminatedUnion<[z.Zod
144
144
  "computer.execute": "computer.execute";
145
145
  }>>;
146
146
  }, z.core.$strict>>;
147
- }, z.core.$strict>, z.ZodObject<{
147
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
148
148
  kind: z.ZodLiteral<"all-team-computers">;
149
149
  operations: z.ZodArray<z.ZodEnum<{
150
150
  "computer.list": "computer.list";
@@ -152,7 +152,7 @@ export declare const appComputerPermissionSchema: z.ZodDiscriminatedUnion<[z.Zod
152
152
  "computer.writeFile": "computer.writeFile";
153
153
  "computer.execute": "computer.execute";
154
154
  }>>;
155
- }, z.core.$strict>], "kind">;
155
+ }, z.core.$strict>>], "kind">;
156
156
  /** One operation an App may request for a Computer. */
157
157
  export type AppComputerOperation = Extract<z.output<typeof appComputerPermissionSchema>, {
158
158
  kind: "all-team-computers";
@@ -205,7 +205,7 @@ export type AppMarketplacePermissions = z.output<typeof appMarketplacePermission
205
205
  * A host's Team App directory with its permission projection, parsed strictly
206
206
  * by every consumer: an unknown field is a contract change both sides make.
207
207
  */
208
- export declare const appDirectoryResponseSchema: z.ZodObject<{
208
+ export declare const appDirectoryResponseSchema: z.ZodLazy<z.ZodObject<{
209
209
  actorIsTeamOwner: z.ZodBoolean;
210
210
  needsUpdate: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
211
  installationId: z.ZodNullable<z.ZodString>;
@@ -213,13 +213,13 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
213
213
  displayName: z.ZodString;
214
214
  }, z.core.$strict>>>;
215
215
  apps: z.ZodArray<z.ZodObject<{
216
- address: z.ZodUnion<readonly [z.ZodObject<{
216
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
217
217
  kind: z.ZodLiteral<"default">;
218
218
  appId: z.ZodString;
219
219
  }, z.core.$strict>, z.ZodObject<{
220
220
  kind: z.ZodLiteral<"installation">;
221
221
  installationId: z.ZodString;
222
- }, z.core.$strict>]>;
222
+ }, z.core.$strict>]>>;
223
223
  installationId: z.ZodNullable<z.ZodString>;
224
224
  surfaceId: z.ZodString;
225
225
  appId: z.ZodString;
@@ -227,15 +227,15 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
227
227
  icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
228
  releaseId: z.ZodNullable<z.ZodString>;
229
229
  authorityVersion: z.ZodNumber;
230
- enforcement: z.ZodNullable<z.ZodObject<{
230
+ enforcement: z.ZodNullable<z.ZodLazy<z.ZodObject<{
231
231
  requestId: z.ZodString;
232
- address: z.ZodUnion<readonly [z.ZodObject<{
232
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
233
233
  kind: z.ZodLiteral<"default">;
234
234
  appId: z.ZodString;
235
235
  }, z.core.$strict>, z.ZodObject<{
236
236
  kind: z.ZodLiteral<"installation">;
237
237
  installationId: z.ZodString;
238
- }, z.core.$strict>]>;
238
+ }, z.core.$strict>]>>;
239
239
  authorityVersion: z.ZodNumber;
240
240
  state: z.ZodEnum<{
241
241
  unaffected: "unaffected";
@@ -244,7 +244,7 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
244
244
  expired: "expired";
245
245
  }>;
246
246
  outstanding: z.ZodNumber;
247
- }, z.core.$strict>>;
247
+ }, z.core.$strict>>>;
248
248
  handlers: z.ZodArray<z.ZodLiteral<"file.open">>;
249
249
  roles: z.ZodArray<z.ZodString>;
250
250
  declaredCapabilities: z.ZodArray<z.ZodString>;
@@ -303,7 +303,7 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
303
303
  operation: z.ZodString;
304
304
  resourceId: z.ZodString;
305
305
  }, z.core.$strict>>;
306
- computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
306
+ computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
307
307
  kind: z.ZodLiteral<"selected-computers">;
308
308
  computers: z.ZodArray<z.ZodObject<{
309
309
  computerId: z.ZodString;
@@ -314,7 +314,7 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
314
314
  "computer.execute": "computer.execute";
315
315
  }>>;
316
316
  }, z.core.$strict>>;
317
- }, z.core.$strict>, z.ZodObject<{
317
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
318
318
  kind: z.ZodLiteral<"all-team-computers">;
319
319
  operations: z.ZodArray<z.ZodEnum<{
320
320
  "computer.list": "computer.list";
@@ -322,7 +322,7 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
322
322
  "computer.writeFile": "computer.writeFile";
323
323
  "computer.execute": "computer.execute";
324
324
  }>>;
325
- }, z.core.$strict>], "kind">>>;
325
+ }, z.core.$strict>>], "kind">>>;
326
326
  generationPermissions: z.ZodObject<{
327
327
  llm: z.ZodBoolean;
328
328
  media: z.ZodBoolean;
@@ -361,7 +361,7 @@ export declare const appDirectoryResponseSchema: z.ZodObject<{
361
361
  surfaceId: z.ZodNullable<z.ZodString>;
362
362
  chosen: z.ZodBoolean;
363
363
  }, z.core.$strict>>;
364
- }, z.core.$strict>;
364
+ }, z.core.$strict>>;
365
365
  /** The host-resolved Team App directory and its permission projections. */
366
366
  export type AppDirectory = z.output<typeof appDirectoryResponseSchema>;
367
367
  /** Read-only catalog metadata for one App, without host-specific role policy. */
@@ -372,7 +372,7 @@ export declare const appCatalogEntrySchema: z.ZodObject<{
372
372
  gills: z.ZodArray<z.ZodObject<{
373
373
  id: z.ZodString;
374
374
  title: z.ZodString;
375
- params: z.ZodOptional<z.ZodArray<z.ZodObject<{
375
+ params: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
376
376
  key: z.ZodString;
377
377
  label: z.ZodString;
378
378
  kind: z.ZodEnum<{
@@ -406,7 +406,7 @@ export declare const appCatalogEntrySchema: z.ZodObject<{
406
406
  kind: "computer" | "repository" | "branch";
407
407
  required: boolean;
408
408
  options?: string | undefined;
409
- }[]>>>;
409
+ }[]>>>>;
410
410
  desktop: z.ZodOptional<z.ZodObject<{
411
411
  sizes: z.ZodArray<z.ZodEnum<{
412
412
  S: "S";
@@ -417,7 +417,7 @@ export declare const appCatalogEntrySchema: z.ZodObject<{
417
417
  }, z.core.$strict>>;
418
418
  }, z.core.$strict>;
419
419
  /** Read-only desktop metadata; identities are surface addresses, never launch authority. */
420
- export declare const appCatalogResponseSchema: z.ZodObject<{
420
+ export declare const appCatalogResponseSchema: z.ZodLazy<z.ZodObject<{
421
421
  apps: z.ZodArray<z.ZodObject<{
422
422
  appId: z.ZodString;
423
423
  surfaceId: z.ZodString;
@@ -425,7 +425,7 @@ export declare const appCatalogResponseSchema: z.ZodObject<{
425
425
  gills: z.ZodArray<z.ZodObject<{
426
426
  id: z.ZodString;
427
427
  title: z.ZodString;
428
- params: z.ZodOptional<z.ZodArray<z.ZodObject<{
428
+ params: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
429
429
  key: z.ZodString;
430
430
  label: z.ZodString;
431
431
  kind: z.ZodEnum<{
@@ -459,7 +459,7 @@ export declare const appCatalogResponseSchema: z.ZodObject<{
459
459
  kind: "computer" | "repository" | "branch";
460
460
  required: boolean;
461
461
  options?: string | undefined;
462
- }[]>>>;
462
+ }[]>>>>;
463
463
  desktop: z.ZodOptional<z.ZodObject<{
464
464
  sizes: z.ZodArray<z.ZodEnum<{
465
465
  S: "S";
@@ -475,11 +475,11 @@ export declare const appCatalogResponseSchema: z.ZodObject<{
475
475
  chosen: z.ZodBoolean;
476
476
  }, z.core.$strict>>;
477
477
  }, z.core.$strict>;
478
- }, z.core.$strict>;
478
+ }, z.core.$strict>>;
479
479
  /** Parsed metadata returned by the read-only APPS.catalog binding. */
480
480
  export type AppCatalog = z.output<typeof appCatalogResponseSchema>;
481
481
  /** Complete APPS.catalog reply, including broker admission failures. */
482
- export declare const appCatalogBrokerResultSchema: z.ZodUnion<readonly [z.ZodObject<{
482
+ export declare const appCatalogBrokerResultSchema: z.ZodLazy<z.ZodUnion<readonly [z.ZodLazy<z.ZodObject<{
483
483
  apps: z.ZodArray<z.ZodObject<{
484
484
  appId: z.ZodString;
485
485
  surfaceId: z.ZodString;
@@ -487,7 +487,7 @@ export declare const appCatalogBrokerResultSchema: z.ZodUnion<readonly [z.ZodObj
487
487
  gills: z.ZodArray<z.ZodObject<{
488
488
  id: z.ZodString;
489
489
  title: z.ZodString;
490
- params: z.ZodOptional<z.ZodArray<z.ZodObject<{
490
+ params: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
491
491
  key: z.ZodString;
492
492
  label: z.ZodString;
493
493
  kind: z.ZodEnum<{
@@ -521,7 +521,7 @@ export declare const appCatalogBrokerResultSchema: z.ZodUnion<readonly [z.ZodObj
521
521
  kind: "computer" | "repository" | "branch";
522
522
  required: boolean;
523
523
  options?: string | undefined;
524
- }[]>>>;
524
+ }[]>>>>;
525
525
  desktop: z.ZodOptional<z.ZodObject<{
526
526
  sizes: z.ZodArray<z.ZodEnum<{
527
527
  S: "S";
@@ -537,6 +537,6 @@ export declare const appCatalogBrokerResultSchema: z.ZodUnion<readonly [z.ZodObj
537
537
  chosen: z.ZodBoolean;
538
538
  }, z.core.$strict>>;
539
539
  }, z.core.$strict>;
540
- }, z.core.$strict>, z.ZodObject<{
540
+ }, z.core.$strict>>, z.ZodObject<{
541
541
  error: z.ZodString;
542
- }, z.core.$strict>]>;
542
+ }, z.core.$strict>]>>;
@@ -3,7 +3,7 @@ import { appDeclaredCommandSchema, appCallsSchema, } from "@fungi.computer/puffb
3
3
  import { appDeclaredGillSchema, appGillParamsSchema, } from "@fungi.computer/gills";
4
4
  import * as z from "zod";
5
5
  /** An App address selects a host default or a specific installation. */
6
- export const appAddressSchema = z.union([
6
+ export const appAddressSchema = z.lazy(() => z.union([
7
7
  z.strictObject({
8
8
  kind: z.literal("default"),
9
9
  appId: z.string().min(1),
@@ -12,15 +12,15 @@ export const appAddressSchema = z.union([
12
12
  kind: z.literal("installation"),
13
13
  installationId: z.string().min(1),
14
14
  }),
15
- ]);
15
+ ]));
16
16
  /** Host-reported progress of applying a revised App authority version. */
17
- export const appAuthorityEnforcementSchema = z.strictObject({
17
+ export const appAuthorityEnforcementSchema = z.lazy(() => z.strictObject({
18
18
  requestId: z.string().min(1),
19
19
  address: appAddressSchema,
20
20
  authorityVersion: z.number().int().positive(),
21
21
  state: z.enum(["unaffected", "pending", "applied", "expired"]),
22
22
  outstanding: z.number().int().nonnegative(),
23
- });
23
+ }));
24
24
  /** Stable identity of one App address across directory and settings views. */
25
25
  export const addressKey = (address) => address.kind === "default"
26
26
  ? `default:${address.appId}`
@@ -69,17 +69,17 @@ const appComputerOperationSchema = z.enum([
69
69
  "computer.writeFile",
70
70
  "computer.execute",
71
71
  ]);
72
- const selectedComputerPermissionSchema = z.strictObject({
72
+ const selectedComputerPermissionSchema = z.lazy(() => z.strictObject({
73
73
  kind: z.literal("selected-computers"),
74
74
  computers: z.array(z.strictObject({
75
75
  computerId: z.string().min(1),
76
76
  operations: z.array(appComputerOperationSchema),
77
77
  })),
78
- });
79
- const allTeamComputersPermissionSchema = z.strictObject({
78
+ }));
79
+ const allTeamComputersPermissionSchema = z.lazy(() => z.strictObject({
80
80
  kind: z.literal("all-team-computers"),
81
81
  operations: z.array(appComputerOperationSchema),
82
- });
82
+ }));
83
83
  /** App Computer permissions limited to selected Computers or the Team's Computers. */
84
84
  export const appComputerPermissionSchema = z.discriminatedUnion("kind", [
85
85
  selectedComputerPermissionSchema,
@@ -122,7 +122,7 @@ export const appMarketplacePermissionsSchema = z.strictObject({
122
122
  * A host's Team App directory with its permission projection, parsed strictly
123
123
  * by every consumer: an unknown field is a contract change both sides make.
124
124
  */
125
- export const appDirectoryResponseSchema = z.strictObject({
125
+ export const appDirectoryResponseSchema = z.lazy(() => z.strictObject({
126
126
  actorIsTeamOwner: z.boolean(),
127
127
  needsUpdate: z
128
128
  .array(z.strictObject({
@@ -150,9 +150,9 @@ export const appDirectoryResponseSchema = z.strictObject({
150
150
  })),
151
151
  /** The Team's effective App per role, owned and resolved by the host. */
152
152
  roles: z.record(z.string().min(1), appRoleSelectionSchema),
153
- });
153
+ }));
154
154
  /** Desktop metadata is a method result, distinct from the full Release Gill declaration. */
155
- const catalogGillParamsSchema = z
155
+ const catalogGillParamsSchema = z.lazy(() => z
156
156
  .array(z.strictObject({
157
157
  key: z.string().max(64),
158
158
  label: z.string().max(256),
@@ -162,7 +162,7 @@ const catalogGillParamsSchema = z
162
162
  }))
163
163
  .max(4)
164
164
  // The wire shape is representable; Gill owns its domain refinements.
165
- .refine(Schema.is(appGillParamsSchema), "Invalid Gill placement parameters");
165
+ .refine(Schema.is(appGillParamsSchema), "Invalid Gill placement parameters"));
166
166
  const catalogGillSchema = z.strictObject({
167
167
  id: z.string().trim().min(1).max(256),
168
168
  title: z.string().trim().min(1).max(256),
@@ -186,14 +186,11 @@ export const appCatalogEntrySchema = appDirectoryEntrySchema
186
186
  })
187
187
  .extend({ gills: z.array(catalogGillSchema).max(16) });
188
188
  /** Read-only desktop metadata; identities are surface addresses, never launch authority. */
189
- export const appCatalogResponseSchema = z.strictObject({
189
+ export const appCatalogResponseSchema = z.lazy(() => z.strictObject({
190
190
  apps: z.array(appCatalogEntrySchema).max(50),
191
191
  roles: z.strictObject({
192
192
  inbox: appRoleSelectionSchema.optional(),
193
193
  }),
194
- });
194
+ }));
195
195
  /** Complete APPS.catalog reply, including broker admission failures. */
196
- export const appCatalogBrokerResultSchema = z.union([
197
- appCatalogResponseSchema,
198
- z.strictObject({ error: z.string() }),
199
- ]);
196
+ export const appCatalogBrokerResultSchema = z.lazy(() => z.union([appCatalogResponseSchema, z.strictObject({ error: z.string() })]));
@@ -1,4 +1,4 @@
1
- import { type AppNavigationState, type AppStatusAction, type AppStatusItem } from "@fungi.computer/agar";
1
+ import { type AppNavigationActivation, type AppNavigationState, type AppStatusAction, type AppStatusItem } from "@fungi.computer/agar";
2
2
  /** Minimum identity required to own a window across mount generations. */
3
3
  export type WindowLaunch = Readonly<{
4
4
  windowId: string;
@@ -15,6 +15,8 @@ export type WindowHost<Launch extends WindowLaunch> = Readonly<{
15
15
  requestClose?: () => boolean | Promise<boolean>;
16
16
  /** Ask the mounted App to go back in its own history; `true` when it did. */
17
17
  requestBack?: () => boolean | Promise<boolean>;
18
+ /** Deliver the person's use of a crumb or header command; `true` when the App acted. */
19
+ activateNavigation?: (activation: AppNavigationActivation) => boolean | Promise<boolean>;
18
20
  /** Deliver the person's use of a status item; `true` when the App acted. */
19
21
  activateStatus?: (action: AppStatusAction) => boolean | Promise<boolean>;
20
22
  /** Release the current mount and its host resources. */
@@ -79,6 +81,8 @@ export type WindowManager<Launch extends WindowLaunch, Container> = Readonly<{
79
81
  replace: (windowId: string, launch: Launch) => Promise<void>;
80
82
  /** Ask a ready window's App to go back; `false` when it cannot. */
81
83
  back: (windowId: string) => Promise<boolean>;
84
+ /** Deliver a crumb or header command to a ready window's App; `false` when it cannot. */
85
+ activateNavigation: (windowId: string, activation: AppNavigationActivation) => Promise<boolean>;
82
86
  /** Deliver a status item action to a ready window's App; `false` when it cannot. */
83
87
  activateStatus: (windowId: string, action: AppStatusAction) => Promise<boolean>;
84
88
  /** Register the current window generation's host-owned picker. */
@@ -1,5 +1,5 @@
1
1
  import * as Redacted from "effect/Redacted";
2
- import { AppError, statusActionAllowed, } from "@fungi.computer/agar";
2
+ import { AppError, navigationActivationAllowed, statusActionAllowed, } from "@fungi.computer/agar";
3
3
  /**
4
4
  * Shared window lifetime owner for browser and terminal shells.
5
5
  *
@@ -18,7 +18,14 @@ function sameStatusItems(current, next) {
18
18
  function sameNavigation(current, next) {
19
19
  if (current === null || next === null)
20
20
  return current === next;
21
- return current.canGoBack === next.canGoBack && current.title === next.title;
21
+ return (current.canGoBack === next.canGoBack &&
22
+ current.title === next.title &&
23
+ JSON.stringify([
24
+ current.crumbs,
25
+ current.primary,
26
+ current.menu,
27
+ current.status,
28
+ ]) === JSON.stringify([next.crumbs, next.primary, next.menu, next.status]));
22
29
  }
23
30
  /** Whether any projected App window is still visible in the workspace. */
24
31
  export function hasVisibleWindows(projection) {
@@ -626,6 +633,17 @@ export function createWindowManager(options) {
626
633
  const requestBack = record.host?.requestBack;
627
634
  return requestBack ? await requestBack() : false;
628
635
  };
636
+ const activateNavigation = async (windowId, activation) => {
637
+ const record = records.get(windowId);
638
+ if (!record || !isActive(record) || record.status !== "ready")
639
+ return false;
640
+ // Only a crumb or enabled command the App currently publishes.
641
+ if (record.navigation === null ||
642
+ !navigationActivationAllowed(record.navigation, activation))
643
+ return false;
644
+ const deliver = record.host?.activateNavigation;
645
+ return deliver ? await deliver(activation) : false;
646
+ };
629
647
  const activateStatus = async (windowId, action) => {
630
648
  const record = records.get(windowId);
631
649
  if (!record || !isActive(record) || record.status !== "ready")
@@ -697,6 +715,7 @@ export function createWindowManager(options) {
697
715
  close,
698
716
  reconfigure,
699
717
  update,
718
+ activateNavigation,
700
719
  activateStatus,
701
720
  registerComputerChoice,
702
721
  replace,
@@ -2,13 +2,13 @@ import * as z from "zod";
2
2
  /** Desktop metadata shared by hosts; hosted administration stays in Settings. */
3
3
  export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
4
4
  apps: z.ZodArray<z.ZodObject<{
5
- address: z.ZodUnion<readonly [z.ZodObject<{
5
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
6
6
  kind: z.ZodLiteral<"default">;
7
7
  appId: z.ZodString;
8
8
  }, z.core.$strict>, z.ZodObject<{
9
9
  kind: z.ZodLiteral<"installation">;
10
10
  installationId: z.ZodString;
11
- }, z.core.$strict>]>;
11
+ }, z.core.$strict>]>>;
12
12
  installationId: z.ZodNullable<z.ZodString>;
13
13
  surfaceId: z.ZodString;
14
14
  appId: z.ZodString;
@@ -16,15 +16,15 @@ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
16
16
  icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
17
  releaseId: z.ZodNullable<z.ZodString>;
18
18
  authorityVersion: z.ZodNumber;
19
- enforcement: z.ZodNullable<z.ZodObject<{
19
+ enforcement: z.ZodNullable<z.ZodLazy<z.ZodObject<{
20
20
  requestId: z.ZodString;
21
- address: z.ZodUnion<readonly [z.ZodObject<{
21
+ address: z.ZodLazy<z.ZodUnion<readonly [z.ZodObject<{
22
22
  kind: z.ZodLiteral<"default">;
23
23
  appId: z.ZodString;
24
24
  }, z.core.$strict>, z.ZodObject<{
25
25
  kind: z.ZodLiteral<"installation">;
26
26
  installationId: z.ZodString;
27
- }, z.core.$strict>]>;
27
+ }, z.core.$strict>]>>;
28
28
  authorityVersion: z.ZodNumber;
29
29
  state: z.ZodEnum<{
30
30
  unaffected: "unaffected";
@@ -33,7 +33,7 @@ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
33
33
  expired: "expired";
34
34
  }>;
35
35
  outstanding: z.ZodNumber;
36
- }, z.core.$strict>>;
36
+ }, z.core.$strict>>>;
37
37
  handlers: z.ZodArray<z.ZodLiteral<"file.open">>;
38
38
  roles: z.ZodArray<z.ZodString>;
39
39
  declaredCapabilities: z.ZodArray<z.ZodString>;
@@ -87,7 +87,7 @@ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
87
87
  computerId: z.ZodString;
88
88
  name: z.ZodString;
89
89
  }, z.core.$strip>>;
90
- computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodLazy<z.ZodObject<{
91
91
  kind: z.ZodLiteral<"selected-computers">;
92
92
  computers: z.ZodArray<z.ZodObject<{
93
93
  computerId: z.ZodString;
@@ -98,7 +98,7 @@ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
98
98
  "computer.execute": "computer.execute";
99
99
  }>>;
100
100
  }, z.core.$strict>>;
101
- }, z.core.$strict>, z.ZodObject<{
101
+ }, z.core.$strict>>, z.ZodLazy<z.ZodObject<{
102
102
  kind: z.ZodLiteral<"all-team-computers">;
103
103
  operations: z.ZodArray<z.ZodEnum<{
104
104
  "computer.list": "computer.list";
@@ -106,7 +106,7 @@ export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
106
106
  "computer.writeFile": "computer.writeFile";
107
107
  "computer.execute": "computer.execute";
108
108
  }>>;
109
- }, z.core.$strict>], "kind">>>;
109
+ }, z.core.$strict>>], "kind">>>;
110
110
  }, z.core.$strip>>;
111
111
  computer: z.ZodOptional<z.ZodObject<{
112
112
  computerId: z.ZodString;
@@ -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. */
@@ -6,6 +6,7 @@ import type { CloudflareShiitakeOptions } from "@fungi.computer/shiitake/cloudfl
6
6
  import { type AiBinding } from "@earendil-works/pi-ai/api/cloudflare-ai-binding";
7
7
  import * as Schema from "effect/Schema";
8
8
  import { type FrameBindingProps } from "../cloudflare.js";
9
+ import type { Avatar } from "@fungi.computer/sprite/avatar";
9
10
  import type { InvocationFrame } from "../invocation.js";
10
11
  import type { OysterJson } from "../host.js";
11
12
  import { type FleetMessage } from "@fungi.computer/shiitake/fleet";
@@ -19,10 +20,11 @@ import { type AgentMcpServer, type AgentMcpServerInput, type AgentMcpServerRefus
19
20
  import type { AgentPolicyActor, OysterAgents, OysterSessionRow } from "../agents.js";
20
21
  /** The model door an agent runs on; Shiitake's own contract. */
21
22
  export type StandaloneModelSource = CloudflareShiitakeOptions["model"];
22
- /** One directory entry: an agent's id and display name. */
23
+ /** One directory entry: an agent's id, display name and own avatar. */
23
24
  export type AgentEntry = Readonly<{
24
25
  agentId: string;
25
26
  name: string;
27
+ avatar: Avatar;
26
28
  }>;
27
29
  /** Bindings the agent host reads. */
28
30
  export type StandaloneAgentsEnv = Readonly<{
@@ -100,6 +102,7 @@ export declare abstract class StandaloneAgentBase<Env extends StandaloneAgentEnv
100
102
  /** Names this Oyster's agents and remembers which Sessions the member opened. */
101
103
  export declare class AgentDirectory extends DurableObject<StandaloneAgentEnv> {
102
104
  private readonly directory;
105
+ private readonly avatars;
103
106
  private composedTenancy;
104
107
  private grant;
105
108
  constructor(ctx: DurableObjectState, env: StandaloneAgentEnv);
@@ -111,7 +114,11 @@ export declare class AgentDirectory extends DurableObject<StandaloneAgentEnv> {
111
114
  rename(agentId: string, name: string, principal: OysterPrincipal): AgentEntry | Readonly<{
112
115
  error: "not_found" | "name_taken" | "not_granted";
113
116
  }>;
114
- create(name: string, requestId: string, principal: OysterPrincipal, actor: AgentPolicyActor): AgentEntry & {
117
+ /** Owner-only avatar change; the Agent wears it in every App and list. */
118
+ setAvatar(agentId: string, avatar: Avatar, principal: OysterPrincipal): AgentEntry | Readonly<{
119
+ error: "not_found" | "not_granted";
120
+ }>;
121
+ create(name: string, requestId: string, principal: OysterPrincipal, actor: AgentPolicyActor, avatar?: Avatar): AgentEntry & {
115
122
  policyRevision: string | null;
116
123
  };
117
124
  private writePolicy;
@@ -166,13 +173,13 @@ export declare const agentFrameMethods: {
166
173
  readonly sessionId: string;
167
174
  readonly state: "unavailable";
168
175
  } | {
169
- readonly kind: "workflow-review";
170
- readonly installationId: string;
171
176
  readonly key: {
172
177
  readonly runId: string;
173
178
  readonly nodeId: string;
174
179
  readonly iteration: string;
175
180
  };
181
+ readonly kind: "workflow-review";
182
+ readonly installationId: string;
176
183
  readonly state: "pending" | "delivered" | "answered" | "timed_out" | "closed";
177
184
  readonly workflowId: string | null;
178
185
  readonly workflowTitle: string;