@fungi.computer/shiitake 0.1.0 → 0.3.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 (112) hide show
  1. package/README.md +155 -34
  2. package/dist/agent-control.d.ts +78 -11
  3. package/dist/agent-control.js +273 -70
  4. package/dist/client-entry.d.ts +15 -8
  5. package/dist/client-entry.js +7 -5
  6. package/dist/client-wire.d.ts +24 -8
  7. package/dist/client-wire.js +53 -11
  8. package/dist/client.d.ts +56 -11
  9. package/dist/client.js +1 -1
  10. package/dist/cloudflare.d.ts +42 -23
  11. package/dist/cloudflare.js +76 -54
  12. package/dist/cold-sessions.d.ts +28 -0
  13. package/dist/cold-sessions.js +1 -0
  14. package/dist/delegation.d.ts +214 -0
  15. package/dist/delegation.js +319 -0
  16. package/dist/effect.d.ts +1 -1
  17. package/dist/errors.d.ts +2 -2
  18. package/dist/errors.js +2 -2
  19. package/dist/extension-contract.d.ts +10 -2
  20. package/dist/extensions.d.ts +6 -2
  21. package/dist/fleet.d.ts +52 -34
  22. package/dist/fleet.js +101 -63
  23. package/dist/hosted.js +1 -0
  24. package/dist/http-routes.d.ts +106 -22
  25. package/dist/http-routes.js +18 -1
  26. package/dist/index.d.ts +3 -2
  27. package/dist/internal/accepted-run-executor.d.ts +5 -0
  28. package/dist/internal/accepted-run-executor.js +10 -4
  29. package/dist/internal/admission-door.d.ts +3 -0
  30. package/dist/internal/admission-door.js +12 -2
  31. package/dist/internal/client-boundary.js +7 -1
  32. package/dist/internal/compaction/compaction-slot.d.ts +36 -0
  33. package/dist/internal/compaction/compaction-slot.js +41 -0
  34. package/dist/internal/compaction/compaction.d.ts +7 -4
  35. package/dist/internal/compaction/compaction.js +59 -30
  36. package/dist/internal/compaction/session-compaction.d.ts +8 -16
  37. package/dist/internal/compaction/session-compaction.js +358 -119
  38. package/dist/internal/compaction/settings.js +5 -0
  39. package/dist/internal/compaction/utils.d.ts +19 -16
  40. package/dist/internal/compaction/utils.js +30 -84
  41. package/dist/internal/contracts.d.ts +40 -13
  42. package/dist/internal/coordinator.js +28 -10
  43. package/dist/internal/effect-client.d.ts +4 -2
  44. package/dist/internal/effect-client.js +29 -0
  45. package/dist/internal/effect-contracts.d.ts +17 -4
  46. package/dist/internal/extension-runtime.d.ts +5 -0
  47. package/dist/internal/extension-runtime.js +184 -89
  48. package/dist/internal/host-meta.d.ts +7 -0
  49. package/dist/internal/model-acquisition.js +7 -1
  50. package/dist/internal/model-preference.d.ts +2 -0
  51. package/dist/internal/model-preference.js +2 -1
  52. package/dist/internal/promise-facade.js +4 -16
  53. package/dist/internal/run-failure-reason.d.ts +10 -0
  54. package/dist/internal/run-failure-reason.js +19 -0
  55. package/dist/internal/run-scope.d.ts +4 -1
  56. package/dist/internal/run-scope.js +38 -5
  57. package/dist/internal/runtime-coordinator.d.ts +2 -1
  58. package/dist/internal/runtime-coordinator.js +65 -4
  59. package/dist/internal/runtime-core.js +1 -0
  60. package/dist/internal/runtime-reconciliation.js +42 -6
  61. package/dist/internal/session-context.d.ts +1 -2
  62. package/dist/internal/session-context.js +8 -30
  63. package/dist/internal/session-status.d.ts +2 -1
  64. package/dist/internal/session-status.js +4 -1
  65. package/dist/internal/woodstock/client-projection.d.ts +6 -5
  66. package/dist/internal/woodstock/client-projection.js +79 -53
  67. package/dist/internal/woodstock/cold-sessions.d.ts +4 -0
  68. package/dist/internal/woodstock/cold-sessions.js +90 -0
  69. package/dist/internal/woodstock/extension-store.d.ts +2 -0
  70. package/dist/internal/woodstock/extension-store.js +4 -0
  71. package/dist/internal/woodstock/fleet-store.d.ts +3 -3
  72. package/dist/internal/woodstock/fleet-store.js +16 -11
  73. package/dist/internal/woodstock/index.d.ts +11 -3
  74. package/dist/internal/woodstock/index.js +33 -14
  75. package/dist/internal/woodstock/progress.d.ts +14 -1
  76. package/dist/internal/woodstock/progress.js +97 -19
  77. package/dist/internal/woodstock/run-recovery.js +6 -4
  78. package/dist/internal/woodstock/session-attention.d.ts +1 -1
  79. package/dist/internal/woodstock/session-attention.js +2 -2
  80. package/dist/internal/woodstock/session-entry.d.ts +109 -42
  81. package/dist/internal/woodstock/session-entry.js +63 -20
  82. package/dist/internal/woodstock/session-inbox.js +2 -0
  83. package/dist/internal/woodstock/session-store.d.ts +104 -24
  84. package/dist/internal/woodstock/session-store.js +937 -246
  85. package/dist/internal/woodstock/storage-admission.d.ts +8 -8
  86. package/dist/internal/woodstock/storage-admission.js +8 -34
  87. package/dist/internal/woodstock/storage-conformance.d.ts +15 -0
  88. package/dist/internal/woodstock/storage-conformance.js +489 -0
  89. package/dist/model-preference.d.ts +2 -2
  90. package/dist/model-preference.js +2 -2
  91. package/dist/node.js +1 -1
  92. package/dist/remote-client.js +8 -1
  93. package/dist/session-attention.d.ts +8 -1
  94. package/dist/session-attention.js +6 -1
  95. package/dist/testing.js +1 -0
  96. package/docs/api/README.md +18 -16
  97. package/docs/api/agent-control.md +172 -2
  98. package/docs/api/client-entry.md +26 -10
  99. package/docs/api/client.md +153 -37
  100. package/docs/api/cloudflare.md +76 -23
  101. package/docs/api/delegation.md +485 -0
  102. package/docs/api/effect.md +20 -2
  103. package/docs/api/extensions.md +21 -9
  104. package/docs/api/fleet.md +149 -122
  105. package/docs/api/http.md +4 -1
  106. package/docs/api/index.md +116 -20
  107. package/docs/api/internal/woodstock/storage-conformance.md +81 -0
  108. package/docs/api/model-preference.md +17 -0
  109. package/docs/api/testing.md +16 -4
  110. package/package.json +26 -14
  111. package/dist/internal/browser-sessions.d.ts +0 -31
  112. package/dist/internal/browser-sessions.js +0 -173
package/docs/api/fleet.md CHANGED
@@ -176,6 +176,7 @@ Input to [createAgentDirectory](#createagentdirectory)'s `rename`.
176
176
  ```ts
177
177
  type DirectoryAgent = Readonly<{
178
178
  agentId: AgentId;
179
+ createdBy: string | null;
179
180
  name: string;
180
181
  createdAt: number;
181
182
  updatedAt: number;
@@ -263,7 +264,7 @@ The host metadata a delegated send carries, as JSON.
263
264
  ##### author
264
265
 
265
266
  ```ts
266
- author: FungiAuthor;
267
+ author: AuthorMeta["author"];
267
268
  ```
268
269
 
269
270
  ##### delegation?
@@ -290,7 +291,7 @@ maxDepth: number;
290
291
 
291
292
  ```ts
292
293
  type DelegationReplyMeta = Readonly<{
293
- author: FungiAuthor;
294
+ author: AuthorMeta["author"];
294
295
  delegation: Readonly<{
295
296
  ancestors: readonly string[];
296
297
  maxDepth: number;
@@ -303,30 +304,19 @@ The host metadata on one authenticated reply line, as JSON.
303
304
 
304
305
  ---
305
306
 
306
- ### FleetRecipient
307
+ ### OutstandingDelegation
307
308
 
308
309
  ```ts
309
- type FleetRecipient = Readonly<{
310
+ type OutstandingDelegation = Readonly<{
310
311
  agentId: string;
311
312
  sessionId: string;
312
- sentAt: number;
313
+ commandId: string;
314
+ unreadable?: string;
313
315
  }>;
314
316
  ```
315
317
 
316
- One Agent a Session sent work to: its latest addressed conversation.
317
-
318
- ---
319
-
320
- ### FleetRecipients
321
-
322
- ```ts
323
- type FleetRecipients = Readonly<{
324
- recipients: readonly FleetRecipient[];
325
- more: number;
326
- }>;
327
- ```
328
-
329
- A bounded page of recipients and how many more exist past it.
318
+ Delegated work an owner still waits on; `unreadable` says why its state could
319
+ not be read, when it could not.
330
320
 
331
321
  ---
332
322
 
@@ -393,22 +383,24 @@ Operations explicitly admitted by the host.
393
383
  ### agentProvenanceSchema
394
384
 
395
385
  ```ts
396
- const agentProvenanceSchema: ZodObject<
397
- {
398
- actor: ZodString;
399
- workflowRunId: ZodOptional<ZodString>;
400
- toolCallInputDigest: ZodOptional<ZodString>;
401
- session: ZodOptional<
402
- ZodObject<
403
- {
404
- agentId: ZodString;
405
- sessionId: ZodString;
406
- },
407
- $strict
408
- >
409
- >;
410
- },
411
- $strict
386
+ const agentProvenanceSchema: ZodLazy<
387
+ ZodObject<
388
+ {
389
+ actor: ZodString;
390
+ workflowRunId: ZodOptional<ZodString>;
391
+ toolCallInputDigest: ZodOptional<ZodString>;
392
+ session: ZodOptional<
393
+ ZodObject<
394
+ {
395
+ agentId: ZodString;
396
+ sessionId: ZodString;
397
+ },
398
+ $strict
399
+ >
400
+ >;
401
+ },
402
+ $strict
403
+ >
412
404
  >;
413
405
  ```
414
406
 
@@ -419,40 +411,44 @@ Attribution supplied by the admitting host, without Team semantics.
419
411
  ### agentGrantSchema
420
412
 
421
413
  ```ts
422
- const agentGrantSchema: ZodObject<
423
- {
424
- agents: ZodUnion<readonly [ZodLiteral<"all">, ZodArray<ZodString>]>;
425
- actions: ZodArray<
426
- ZodEnum<{
427
- send: "send";
428
- read: "read";
429
- create: "create";
430
- manage: "manage";
431
- delegate: "delegate";
432
- }>
433
- >;
434
- expiresAt: ZodNumber;
435
- provenance: ZodObject<
436
- {
437
- actor: ZodString;
438
- workflowRunId: ZodOptional<ZodString>;
439
- toolCallInputDigest: ZodOptional<ZodString>;
440
- session: ZodOptional<
441
- ZodObject<
442
- {
443
- agentId: ZodString;
444
- sessionId: ZodString;
445
- },
446
- $strict
447
- >
448
- >;
449
- },
450
- $strict
451
- >;
452
- meta: ZodOptional<ZodJSONSchema>;
453
- maxDepth: ZodOptional<ZodNumber>;
454
- },
455
- $strict
414
+ const agentGrantSchema: ZodLazy<
415
+ ZodObject<
416
+ {
417
+ agents: ZodUnion<readonly [ZodLiteral<"all">, ZodArray<ZodString>]>;
418
+ actions: ZodArray<
419
+ ZodEnum<{
420
+ send: "send";
421
+ read: "read";
422
+ create: "create";
423
+ manage: "manage";
424
+ delegate: "delegate";
425
+ }>
426
+ >;
427
+ expiresAt: ZodNumber;
428
+ provenance: ZodLazy<
429
+ ZodObject<
430
+ {
431
+ actor: ZodString;
432
+ workflowRunId: ZodOptional<ZodString>;
433
+ toolCallInputDigest: ZodOptional<ZodString>;
434
+ session: ZodOptional<
435
+ ZodObject<
436
+ {
437
+ agentId: ZodString;
438
+ sessionId: ZodString;
439
+ },
440
+ $strict
441
+ >
442
+ >;
443
+ },
444
+ $strict
445
+ >
446
+ >;
447
+ meta: ZodOptional<ZodJSONSchema>;
448
+ maxDepth: ZodOptional<ZodNumber>;
449
+ },
450
+ $strict
451
+ >
456
452
  >;
457
453
  ```
458
454
 
@@ -475,13 +471,16 @@ Stable Agent identities, retained across host compositions.
475
471
  ### agentCreationSchema
476
472
 
477
473
  ```ts
478
- const agentCreationSchema: ZodObject<
479
- {
480
- name: ZodString;
481
- requestId: ZodString;
482
- configuration: ZodString;
483
- },
484
- $strict
474
+ const agentCreationSchema: ZodLazy<
475
+ ZodObject<
476
+ {
477
+ name: ZodString;
478
+ requestId: ZodString;
479
+ configuration: ZodString;
480
+ createdBy: ZodOptional<ZodNullable<ZodString>>;
481
+ },
482
+ $strict
483
+ >
485
484
  >;
486
485
  ```
487
486
 
@@ -492,11 +491,13 @@ Stable replay input; configuration is an opaque host creation choice.
492
491
  ### agentRenameSchema
493
492
 
494
493
  ```ts
495
- const agentRenameSchema: ZodObject<
496
- {
497
- name: ZodString;
498
- },
499
- $strict
494
+ const agentRenameSchema: ZodLazy<
495
+ ZodObject<
496
+ {
497
+ name: ZodString;
498
+ },
499
+ $strict
500
+ >
500
501
  >;
501
502
  ```
502
503
 
@@ -507,14 +508,16 @@ Owner-only rename input: an Agent's new display name.
507
508
  ### agentDelegationTaskSchema
508
509
 
509
510
  ```ts
510
- const agentDelegationTaskSchema: ZodObject<
511
- {
512
- requestId: ZodString;
513
- agentId: ZodString;
514
- sessionId: ZodOptional<ZodString>;
515
- text: ZodString;
516
- },
517
- $strict
511
+ const agentDelegationTaskSchema: ZodLazy<
512
+ ZodObject<
513
+ {
514
+ requestId: ZodString;
515
+ agentId: ZodString;
516
+ sessionId: ZodOptional<ZodString>;
517
+ text: ZodString;
518
+ },
519
+ $strict
520
+ >
518
521
  >;
519
522
  ```
520
523
 
@@ -584,17 +587,17 @@ together. Physical table names retain the existing Hub store layout.
584
587
 
585
588
  #### Returns
586
589
 
587
- | Name | Type | Default value | Description |
588
- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
589
- | `readCreation()` | (`grant`, `raw`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Resolve a matching creation receipt before host admission of a new reservation. |
590
- | `create()` | (`grant`, `raw`) => \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: `null`; \} \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: \{ `kind`: `"created"`; `agentId`: `CairnId`\<`"agent"`, `"agent"`, `1`\>; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}; \} | - | Reserve an Agent once and return its committed lifecycle fact. |
591
- | `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Read one admitted Agent identity. |
592
- | `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[] | - | List only identities covered by the supplied grant. |
593
- | `remove()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `kind`: `"deleted"` \| `"created"`; `agentId`: `string`; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}\> \| `null` | - | Remove an identity while retaining its erasure address. |
594
- | `rename()` | (`grant`, `agentId`, `raw`) => [`DirectoryAgent`](#directoryagent) | - | Rename an existing Agent; refuses a name already held by another one. Owner-only rename; refuses a name already held by another Agent. |
595
- | `readCreator()` | (`grant`, `agentId`) => `string` \| `null` | - | Read the host actor recorded at creation. The user who created an Agent; that user's own credentials follow it. |
596
- | `listErasureIds()` | () => readonly `string`[] | `store.listErasureIds` | Enumerate retained addresses for host erasure. |
597
- | `erasureRosterComplete()` | () => `boolean` | `store.erasureRosterComplete` | Whether the retained erasure roster covers this store. |
590
+ | Name | Type | Default value | Description |
591
+ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
592
+ | `readCreation()` | (`grant`, `raw`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Resolve a matching creation receipt before host admission of a new reservation. |
593
+ | `create()` | (`grant`, `raw`) => \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: `null`; \} \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: \{ `kind`: `"created"`; `agentId`: `CairnId`\<`"agent"`, `"agent"`, `1`\>; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}; \} | - | Reserve an Agent once and return its committed lifecycle fact. |
594
+ | `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Read one admitted Agent identity. |
595
+ | `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[] | - | List only identities covered by the supplied grant. |
596
+ | `remove()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `kind`: `"deleted"` \| `"created"`; `agentId`: `string`; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}\> \| `null` | - | Remove an identity while retaining its erasure address. |
597
+ | `rename()` | (`grant`, `agentId`, `raw`) => [`DirectoryAgent`](#directoryagent) | - | Rename an existing Agent; refuses a name already held by another one. Owner-only rename; refuses a name already held by another Agent. |
598
+ | `readCreator()` | (`grant`, `agentId`) => `string` \| `null` | - | Read the host actor recorded at creation. The user who created an Agent; that user's own credentials follow it. |
599
+ | `listErasureIds()` | () => readonly `string`[] | `store.listErasureIds` | Enumerate retained addresses for host erasure. |
600
+ | `erasureRosterComplete()` | () => `boolean` | `store.erasureRosterComplete` | Whether the retained erasure roster covers this store. |
598
601
 
599
602
  ---
600
603
 
@@ -646,12 +649,10 @@ that reply's own line and never travel onward.
646
649
 
647
650
  #### Parameters
648
651
 
649
- | Parameter | Type |
650
- | ----------------- | --------------------------------------- |
651
- | `sender` | \{ `id`: `string`; `name`: `string`; \} |
652
- | `sender.id` | `string` |
653
- | `sender.name?` | `string` |
654
- | `invocationMeta?` | [`Json`](extensions.md#json) |
652
+ | Parameter | Type |
653
+ | ----------------- | ----------------------------------------------------- |
654
+ | `sender` | `Readonly`\<\{ `id`: `string`; `name`: `string`; \}\> |
655
+ | `invocationMeta?` | [`Json`](extensions.md#json) |
655
656
 
656
657
  #### Returns
657
658
 
@@ -681,30 +682,56 @@ author, and the verified reply rides beside the caller's own path.
681
682
 
682
683
  ---
683
684
 
684
- ### createFleetDelegation()
685
+ ### createFleetCorrespondence()
685
686
 
686
687
  ```ts
687
- function createFleetDelegation(options): object;
688
+ function createFleetCorrespondence(options): object;
688
689
  ```
689
690
 
690
- Hosted BirdDog submission and Pending observation. The durable row freezes
691
+ BirdDog submission and reply authentication. The durable row freezes
691
692
  correspondence before transport; an ambiguous delivery reuses that exact mail.
692
693
  Shiitake owns work deduplication, execution and settlement; Post owns replies.
693
694
 
694
695
  #### Parameters
695
696
 
697
+ | Parameter | Type |
698
+ | --------- | --------------------------------------------------------------------------------- |
699
+ | `options` | `Omit`\<[`FleetDelegationOptions`](#fleetdelegationoptions), `"readSettlement"`\> |
700
+
701
+ #### Returns
702
+
703
+ | Name | Type | Description |
704
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
705
+ | `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit frozen mail or reuse its recorded Session admission receipt. |
706
+ | `authenticateReply()` | (`mail`) => \| `Readonly`\<\{ `ancestors`: readonly `string`[]; `maxDepth`: `number`; `reply`: \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; `agentId`: `string`; `sessionId`: `string`; \}; \}\> \| `undefined` | Match a reply to frozen mail and restore the caller's delegation path. Authenticate one arriving reply against the frozen mail this owner sent. It must be BirdDog's single reply key for that mail, mirror its sender and recipient exactly, carry BirdDog's settlement facts and, once the send's receipt is recorded, name that receipt's `commandId`. The result restores the caller's own delegation path and the verified reply; it never reads the reply's text or any settlement metadata. |
707
+ | `receipt()` | (`requestId`) => \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\> \| `undefined` | Read an existing acceptance receipt without reserving or delivering mail. Read only the existing acceptance receipt; do not reserve or deliver mail. |
708
+
709
+ ---
710
+
711
+ ### createFleetDelegation()
712
+
713
+ ```ts
714
+ function createFleetDelegation(options): object;
715
+ ```
716
+
717
+ Local hosts may observe exact work directly; remote correspondence never pulls
718
+ it.
719
+
720
+ #### Parameters
721
+
696
722
  | Parameter | Type |
697
723
  | --------- | --------------------------------------------------- |
698
724
  | `options` | [`FleetDelegationOptions`](#fleetdelegationoptions) |
699
725
 
700
726
  #### Returns
701
727
 
702
- | Name | Type | Description |
703
- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
704
- | `authenticateReply()` | (`mail`) => \| `Readonly`\<\{ `ancestors`: readonly `string`[]; `maxDepth`: `number`; `reply`: \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; `agentId`: `string`; `sessionId`: `string`; \}; \}\> \| `undefined` | Authenticate a reply against its frozen mail and restore the caller's path. Authenticate one arriving reply against the frozen mail this owner sent. It must be BirdDog's single reply key for that mail, mirror its sender and recipient exactly, carry BirdDog's settlement facts and, once the send's receipt is recorded, name that receipt's `commandId`. The result restores the caller's own delegation path and the verified reply; it never reads the reply's text or any settlement metadata. |
705
- | `recipients()` | (`parent`, `limit`) => [`FleetRecipients`](#fleetrecipients) | One grouped read of the Agents a parent Session sent work to. The distinct Agents one parent Session sent work to, newest send first, with how many more exist past `limit`. Read-only over the frozen mail. |
706
- | `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit once and return the existing Shiitake admission receipt. |
707
- | `delegate()` | (`grant`, `task`) => `Promise`\< \| `Readonly`\<\{ `kind`: `"pending"`; `retryAfterMs`: `number`; \}\> \| [`AgentDelegationOutcome`](#agentdelegationoutcome)\> | Submit or poll the exact turn, yielding Agar Pending until settled. |
728
+ | Name | Type | Description |
729
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
730
+ | `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit frozen mail or reuse its recorded Session admission receipt. |
731
+ | `authenticateReply()` | (`mail`) => \| `Readonly`\<\{ `ancestors`: readonly `string`[]; `maxDepth`: `number`; `reply`: \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; `agentId`: `string`; `sessionId`: `string`; \}; \}\> \| `undefined` | Match a reply to frozen mail and restore the caller's delegation path. Authenticate one arriving reply against the frozen mail this owner sent. It must be BirdDog's single reply key for that mail, mirror its sender and recipient exactly, carry BirdDog's settlement facts and, once the send's receipt is recorded, name that receipt's `commandId`. The result restores the caller's own delegation path and the verified reply; it never reads the reply's text or any settlement metadata. |
732
+ | `receipt()` | (`requestId`) => \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\> \| `undefined` | Read an existing acceptance receipt without reserving or delivering mail. Read only the existing acceptance receipt; do not reserve or deliver mail. |
733
+ | `outstanding()` | () => `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `sessionId`: `string`; `commandId`: `string`; `unreadable?`: `string`; \}\> \| `undefined`\> | The delegated work this owner still waits on, if any. The newest delegation this owner sent whose work has not settled at its target, so the owner is still waiting for a reply; undefined when none. |
734
+ | `delegate()` | (`grant`, `task`) => `Promise`\< \| `Readonly`\<\{ `kind`: `"pending"`; `retryAfterMs`: `number`; \}\> \| [`AgentDelegationOutcome`](#agentdelegationoutcome)\> | Submit or poll the exact turn, yielding Agar Pending until settled. |
708
735
 
709
736
  ---
710
737
 
@@ -725,10 +752,10 @@ checks a fresh supplied grant and releases its transport without stopping work.
725
752
 
726
753
  #### Returns
727
754
 
728
- | Name | Type | Description |
729
- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
730
- | `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> | Enumerate existing Sessions through the owner's bounded cursor. |
731
- | `read()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly `Readonly`\<\{ `meta?`: [`Json`](extensions.md#json); `origin?`: `Readonly`\<\{ `extensionId`: ...; `correlation`: ...; \}\>; `id`: `string`; `sequence`: `number`; `commandId`: `string` \| `null`; `value`: `Message`; \}\>[]; `terminals`: readonly `Readonly`\<\{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"`; `sequence`: `number`; `diagnostic`: `string` \| `null`; `meta?`: [`Json`](extensions.md#json); \}\>[]; `compactions?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `tokensBefore`: `number`; `tokensAfter`: `number` \| `null`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger) \| `null`; \}\>[]; `compactionNotices?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger); `result`: `"failed"` \| `"nothing_to_compact"`; `diagnostic`: `string` \| `null`; \}\>[]; `sandboxFailures?`: readonly `object`[]; `pending`: [`SessionPendingPrompts`](client.md#sessionpendingprompts); `activity`: [`SessionActivity`](client.md#sessionactivity); `progress`: \| `Readonly`\<\{ `messageId`: `string`; `revision`: `number`; `text`: `string`; `thinking`: `string`; `textTruncated`: `boolean`; `thinkingTruncated`: `boolean`; \}\> \| `null`; `extensions`: [`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`: readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`: `number` \| `null`; \}\>; \}\>\> | Open the exact saved conversation without creating work. |
732
- | `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\> | Create a Session once under the caller's replay identity. |
733
- | `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\> | Remove a Session through its runtime owner. |
734
- | `send()` | (`grant`, `agentId`, `sessionId`, `message`) => `Promise`\<\{ `status`: `"accepted"`; `commandId`: `string`; `sessionId`: `string`; \}\> | Send once; an omitted Session is created under the same replay identity. |
755
+ | Name | Type | Description |
756
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
757
+ | `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> | Enumerate existing Sessions through the owner's bounded cursor. |
758
+ | `read()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly `Readonly`\<\{ `requestId?`: `string`; `meta?`: [`Json`](extensions.md#json); `data?`: [`Json`](extensions.md#json); `origin?`: `Readonly`\<\{ `extensionId`: ...; `correlation`: ...; \}\>; `id`: `string`; `sequence`: `number`; `commandId`: `string` \| `null`; `value`: [`ModelMessage`](client.md#modelmessage); \}\>[]; `terminals`: readonly `Readonly`\<\{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"`; `sequence`: `number`; `diagnostic`: `string` \| `null`; `meta?`: [`Json`](extensions.md#json); \}\>[]; `compactions?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `tokensBefore`: `number`; `tokensAfter`: `number` \| `null`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger) \| `null`; \}\>[]; `compactionNotices?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger); `result`: `"failed"` \| `"nothing_to_compact"` \| `"stale"` \| `"insufficient"`; `diagnostic`: `string` \| `null`; \}\>[]; `sandboxFailures?`: readonly `object`[]; `pending`: [`SessionPendingPrompts`](client.md#sessionpendingprompts); `activity`: [`SessionActivity`](client.md#sessionactivity); `progress`: \| `Readonly`\<\{ `messageId`: `string`; `revision`: `number`; `text`: `string`; `thinking`: `string`; `textTruncated`: `boolean`; `thinkingTruncated`: `boolean`; \}\> \| `null`; `toolOutput`: readonly `Readonly`\<\{ `toolCallId`: `string`; `revision`: `number`; `tail`: `string`; `droppedBytes`: `number`; `totalBytes`: `number`; \}\>[]; `extensions`: [`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`: readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`: `number` \| `null`; \}\>; \}\>\> | Open the exact saved conversation without creating work. |
759
+ | `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\> | Create a Session once under the caller's replay identity. |
760
+ | `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\> | Remove a Session through its runtime owner. |
761
+ | `send()` | (`grant`, `agentId`, `sessionId`, `message`) => `Promise`\<\{ `status`: `"accepted"`; `commandId`: `string`; `sessionId`: `string`; \}\> | Send once; an omitted Session is created under the same replay identity. |
package/docs/api/http.md CHANGED
@@ -86,6 +86,8 @@ function createShiitakeHttpRoutes(
86
86
  object &
87
87
  object &
88
88
  object &
89
+ object &
90
+ object &
89
91
  object,
90
92
  "/",
91
93
  "/sessions/:sessionId/events"
@@ -108,4 +110,5 @@ Build Shiitake's typed HTTP routes around an existing Session owner.
108
110
 
109
111
  `Hono`\<[`ShiitakeHttpEnv`](#shiitakehttpenv), `object` & `object` & `object` &
110
112
  `object` & `object` & `object` & `object` & `object` & `object` & `object` &
111
- `object` & `object`, `"/"`, `"/sessions/:sessionId/events"`\>
113
+ `object` & `object` & `object` & `object`, `"/"`,
114
+ `"/sessions/:sessionId/events"`\>