@fungi.computer/shiitake 0.2.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 +77 -5
  3. package/dist/agent-control.js +271 -65
  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 +43 -9
  22. package/dist/fleet.js +88 -25
  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 +5 -1
  72. package/dist/internal/woodstock/fleet-store.js +17 -5
  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 +171 -1
  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 +159 -104
  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,6 +304,22 @@ The host metadata on one authenticated reply line, as JSON.
303
304
 
304
305
  ---
305
306
 
307
+ ### OutstandingDelegation
308
+
309
+ ```ts
310
+ type OutstandingDelegation = Readonly<{
311
+ agentId: string;
312
+ sessionId: string;
313
+ commandId: string;
314
+ unreadable?: string;
315
+ }>;
316
+ ```
317
+
318
+ Delegated work an owner still waits on; `unreadable` says why its state could
319
+ not be read, when it could not.
320
+
321
+ ---
322
+
306
323
  ### FleetAgentAccess
307
324
 
308
325
  ```ts
@@ -366,22 +383,24 @@ Operations explicitly admitted by the host.
366
383
  ### agentProvenanceSchema
367
384
 
368
385
  ```ts
369
- const agentProvenanceSchema: ZodObject<
370
- {
371
- actor: ZodString;
372
- workflowRunId: ZodOptional<ZodString>;
373
- toolCallInputDigest: ZodOptional<ZodString>;
374
- session: ZodOptional<
375
- ZodObject<
376
- {
377
- agentId: ZodString;
378
- sessionId: ZodString;
379
- },
380
- $strict
381
- >
382
- >;
383
- },
384
- $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
+ >
385
404
  >;
386
405
  ```
387
406
 
@@ -392,40 +411,44 @@ Attribution supplied by the admitting host, without Team semantics.
392
411
  ### agentGrantSchema
393
412
 
394
413
  ```ts
395
- const agentGrantSchema: ZodObject<
396
- {
397
- agents: ZodUnion<readonly [ZodLiteral<"all">, ZodArray<ZodString>]>;
398
- actions: ZodArray<
399
- ZodEnum<{
400
- send: "send";
401
- read: "read";
402
- create: "create";
403
- manage: "manage";
404
- delegate: "delegate";
405
- }>
406
- >;
407
- expiresAt: ZodNumber;
408
- provenance: ZodObject<
409
- {
410
- actor: ZodString;
411
- workflowRunId: ZodOptional<ZodString>;
412
- toolCallInputDigest: ZodOptional<ZodString>;
413
- session: ZodOptional<
414
- ZodObject<
415
- {
416
- agentId: ZodString;
417
- sessionId: ZodString;
418
- },
419
- $strict
420
- >
421
- >;
422
- },
423
- $strict
424
- >;
425
- meta: ZodOptional<ZodJSONSchema>;
426
- maxDepth: ZodOptional<ZodNumber>;
427
- },
428
- $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
+ >
429
452
  >;
430
453
  ```
431
454
 
@@ -448,13 +471,16 @@ Stable Agent identities, retained across host compositions.
448
471
  ### agentCreationSchema
449
472
 
450
473
  ```ts
451
- const agentCreationSchema: ZodObject<
452
- {
453
- name: ZodString;
454
- requestId: ZodString;
455
- configuration: ZodString;
456
- },
457
- $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
+ >
458
484
  >;
459
485
  ```
460
486
 
@@ -465,11 +491,13 @@ Stable replay input; configuration is an opaque host creation choice.
465
491
  ### agentRenameSchema
466
492
 
467
493
  ```ts
468
- const agentRenameSchema: ZodObject<
469
- {
470
- name: ZodString;
471
- },
472
- $strict
494
+ const agentRenameSchema: ZodLazy<
495
+ ZodObject<
496
+ {
497
+ name: ZodString;
498
+ },
499
+ $strict
500
+ >
473
501
  >;
474
502
  ```
475
503
 
@@ -480,14 +508,16 @@ Owner-only rename input: an Agent's new display name.
480
508
  ### agentDelegationTaskSchema
481
509
 
482
510
  ```ts
483
- const agentDelegationTaskSchema: ZodObject<
484
- {
485
- requestId: ZodString;
486
- agentId: ZodString;
487
- sessionId: ZodOptional<ZodString>;
488
- text: ZodString;
489
- },
490
- $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
+ >
491
521
  >;
492
522
  ```
493
523
 
@@ -557,17 +587,17 @@ together. Physical table names retain the existing Hub store layout.
557
587
 
558
588
  #### Returns
559
589
 
560
- | Name | Type | Default value | Description |
561
- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
562
- | `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. |
563
- | `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. |
564
- | `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Read one admitted Agent identity. |
565
- | `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[] | - | List only identities covered by the supplied grant. |
566
- | `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. |
567
- | `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. |
568
- | `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. |
569
- | `listErasureIds()` | () => readonly `string`[] | `store.listErasureIds` | Enumerate retained addresses for host erasure. |
570
- | `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. |
571
601
 
572
602
  ---
573
603
 
@@ -619,12 +649,10 @@ that reply's own line and never travel onward.
619
649
 
620
650
  #### Parameters
621
651
 
622
- | Parameter | Type |
623
- | ----------------- | --------------------------------------- |
624
- | `sender` | \{ `id`: `string`; `name`: `string`; \} |
625
- | `sender.id` | `string` |
626
- | `sender.name?` | `string` |
627
- | `invocationMeta?` | [`Json`](extensions.md#json) |
652
+ | Parameter | Type |
653
+ | ----------------- | ----------------------------------------------------- |
654
+ | `sender` | `Readonly`\<\{ `id`: `string`; `name`: `string`; \}\> |
655
+ | `invocationMeta?` | [`Json`](extensions.md#json) |
628
656
 
629
657
  #### Returns
630
658
 
@@ -654,29 +682,56 @@ author, and the verified reply rides beside the caller's own path.
654
682
 
655
683
  ---
656
684
 
657
- ### createFleetDelegation()
685
+ ### createFleetCorrespondence()
658
686
 
659
687
  ```ts
660
- function createFleetDelegation(options): object;
688
+ function createFleetCorrespondence(options): object;
661
689
  ```
662
690
 
663
- Hosted BirdDog submission and Pending observation. The durable row freezes
691
+ BirdDog submission and reply authentication. The durable row freezes
664
692
  correspondence before transport; an ambiguous delivery reuses that exact mail.
665
693
  Shiitake owns work deduplication, execution and settlement; Post owns replies.
666
694
 
667
695
  #### Parameters
668
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
+
669
722
  | Parameter | Type |
670
723
  | --------- | --------------------------------------------------- |
671
724
  | `options` | [`FleetDelegationOptions`](#fleetdelegationoptions) |
672
725
 
673
726
  #### Returns
674
727
 
675
- | Name | Type | Description |
676
- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
677
- | `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. |
678
- | `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit once and return the existing Shiitake admission receipt. |
679
- | `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. |
680
735
 
681
736
  ---
682
737
 
@@ -697,10 +752,10 @@ checks a fresh supplied grant and releases its transport without stopping work.
697
752
 
698
753
  #### Returns
699
754
 
700
- | Name | Type | Description |
701
- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
702
- | `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> | Enumerate existing Sessions through the owner's bounded cursor. |
703
- | `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. |
704
- | `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\> | Create a Session once under the caller's replay identity. |
705
- | `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\> | Remove a Session through its runtime owner. |
706
- | `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"`\>