@fungi.computer/shiitake 0.6.0 → 0.8.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 (67) hide show
  1. package/README.md +59 -21
  2. package/dist/agent-control.d.ts +1 -1
  3. package/dist/agent-control.js +40 -21
  4. package/dist/client-visitor.d.ts +2 -0
  5. package/dist/client-visitor.js +6 -1
  6. package/dist/client-wire.d.ts +4 -0
  7. package/dist/client-wire.js +26 -15
  8. package/dist/client.d.ts +23 -11
  9. package/dist/client.js +22 -0
  10. package/dist/cloudflare.d.ts +20 -0
  11. package/dist/cloudflare.js +4 -1
  12. package/dist/delegation.d.ts +5 -0
  13. package/dist/delegation.js +24 -8
  14. package/dist/effect.d.ts +1 -1
  15. package/dist/errors.d.ts +2 -2
  16. package/dist/errors.js +2 -0
  17. package/dist/extensions.d.ts +1 -1
  18. package/dist/fleet.d.ts +14 -2
  19. package/dist/fleet.js +81 -19
  20. package/dist/http-routes.d.ts +12 -16
  21. package/dist/http.d.ts +1 -0
  22. package/dist/http.js +1 -0
  23. package/dist/index.d.ts +1 -1
  24. package/dist/internal/admission-door.d.ts +1 -1
  25. package/dist/internal/admission-door.js +8 -4
  26. package/dist/internal/contracts.d.ts +5 -0
  27. package/dist/internal/coordinator.js +107 -50
  28. package/dist/internal/effect-contracts.d.ts +5 -0
  29. package/dist/internal/extension-runtime.js +5 -3
  30. package/dist/internal/observation-kernel.js +12 -3
  31. package/dist/internal/promise-facade.js +2 -0
  32. package/dist/internal/run-scope.d.ts +1 -0
  33. package/dist/internal/run-scope.js +29 -7
  34. package/dist/internal/runtime-coordinator.d.ts +14 -0
  35. package/dist/internal/runtime-coordinator.js +57 -10
  36. package/dist/internal/runtime-core.d.ts +3 -0
  37. package/dist/internal/runtime-core.js +1 -0
  38. package/dist/internal/runtime-reconciliation.js +4 -1
  39. package/dist/internal/session-context.d.ts +5 -5
  40. package/dist/internal/session-context.js +80 -83
  41. package/dist/internal/session-status.d.ts +4 -2
  42. package/dist/internal/session-status.js +22 -4
  43. package/dist/internal/woodstock/client-projection.js +5 -11
  44. package/dist/internal/woodstock/fleet-store.d.ts +3 -2
  45. package/dist/internal/woodstock/fleet-store.js +24 -4
  46. package/dist/internal/woodstock/index.d.ts +3 -3
  47. package/dist/internal/woodstock/index.js +18 -7
  48. package/dist/internal/woodstock/progress.d.ts +13 -1
  49. package/dist/internal/woodstock/progress.js +130 -24
  50. package/dist/internal/woodstock/session-delegator.d.ts +2 -1
  51. package/dist/internal/woodstock/session-store.d.ts +14 -2
  52. package/dist/internal/woodstock/session-store.js +329 -66
  53. package/dist/node.js +11 -2
  54. package/dist/server-visitor-stream.js +33 -24
  55. package/dist/testing.d.ts +2 -0
  56. package/dist/testing.js +2 -0
  57. package/docs/api/agent-control.md +3 -2
  58. package/docs/api/client.md +79 -19
  59. package/docs/api/cloudflare.md +16 -0
  60. package/docs/api/delegation.md +84 -50
  61. package/docs/api/effect.md +85 -7
  62. package/docs/api/extensions.md +8 -8
  63. package/docs/api/fleet.md +118 -29
  64. package/docs/api/http.md +28 -0
  65. package/docs/api/index.md +39 -15
  66. package/docs/api/testing.md +20 -7
  67. package/package.json +5 -5
package/docs/api/index.md CHANGED
@@ -36,13 +36,13 @@ Construct a sanitized boundary failure.
36
36
 
37
37
  ###### Parameters
38
38
 
39
- | Parameter | Type | Description |
40
- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
41
- | `boundary` | \| `"contract"` \| `"extensions"` \| `"instructions"` \| `"model"` \| `"runtime"` \| `"store"` \| `"tools"` | Boundary that rejected the operation. |
42
- | `category` | \| `"closed"` \| `"conflict"` \| `"incompatible"` \| `"invalid"` \| `"rejected"` \| `"unavailable"` \| `"state_reset_required"` \| `"storage_pressure"` | Safe category describing why it was rejected. |
43
- | `message` | `string` | Human-readable message safe for callers to display. |
44
- | `requestId?` | `string` | Request identity recoverable when a send may have reached the owner. |
45
- | `cause?` | `unknown` | The original thrown value, kept for server-side diagnosis only. It is never serialized: the wire encoder copies named fields only. |
39
+ | Parameter | Type | Description |
40
+ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
41
+ | `boundary` | \| `"contract"` \| `"extensions"` \| `"instructions"` \| `"model"` \| `"runtime"` \| `"store"` \| `"tools"` | Boundary that rejected the operation. |
42
+ | `category` | \| `"closed"` \| `"conflict"` \| `"incompatible"` \| `"invalid"` \| `"rejected"` \| `"unavailable"` \| `"state_reset_required"` \| `"storage_pressure"` \| `"archived"` | Safe category describing why it was rejected. |
43
+ | `message` | `string` | Human-readable message safe for callers to display. |
44
+ | `requestId?` | `string` | Request identity recoverable when a send may have reached the owner. |
45
+ | `cause?` | `unknown` | The original thrown value, kept for server-side diagnosis only. It is never serialized: the wire encoder copies named fields only. |
46
46
 
47
47
  ###### Returns
48
48
 
@@ -75,7 +75,8 @@ readonly cause:
75
75
  | "rejected"
76
76
  | "unavailable"
77
77
  | "state_reset_required"
78
- | "storage_pressure";
78
+ | "storage_pressure"
79
+ | "archived";
79
80
  ```
80
81
 
81
82
  Safe category describing why it was rejected.
@@ -577,6 +578,9 @@ type ShiitakeOptions = Readonly<{
577
578
  meta?: HostMetaOptions;
578
579
  store: SqliteOwner;
579
580
  storagePressure?: StoragePressureCheck;
581
+ admission?: Readonly<{
582
+ assertOpen: () => void;
583
+ }>;
580
584
  compaction?: CompactionOptions;
581
585
  runtime: RuntimeHost;
582
586
  model: ModelSource;
@@ -635,10 +639,16 @@ can.
635
639
  ```ts
636
640
  type CommandSettlement = Readonly<{
637
641
  acceptedSender: string | null;
642
+ delegator: string | null;
638
643
  terminal: SessionTerminal;
639
644
  content: string;
640
645
  usage: readonly Pick<AssistantMessage, "provider" | "model" | "usage">[];
641
646
  toolCalls: number;
647
+ waitingOnYou: readonly Readonly<{
648
+ itemId: string;
649
+ kind: string;
650
+ summary: string;
651
+ }>[];
642
652
  }>;
643
653
  ```
644
654
 
@@ -926,10 +936,16 @@ function makeHost(options, mailRoom): Promise<Readonly<{
926
936
  readSettlement: (sessionId, commandId) => Promise<
927
937
  | Readonly<{
928
938
  acceptedSender: string | null;
939
+ delegator: string | null;
929
940
  terminal: SessionTerminal;
930
941
  content: string;
931
942
  usage: readonly Pick<AssistantMessage, ... | ... | ...>[];
932
943
  toolCalls: number;
944
+ waitingOnYou: readonly Readonly<{
945
+ itemId: ...;
946
+ kind: ...;
947
+ summary: ...;
948
+ }>[];
933
949
  }>
934
950
  | undefined>;
935
951
  agent: ShiitakeOwnerAgent;
@@ -953,13 +969,15 @@ Construct the host-only Promise facade over the canonical Effect program.
953
969
  #### Returns
954
970
 
955
971
  `Promise`\<`Readonly`\<\{ `readSettlement`: (`sessionId`, `commandId`) =>
956
- `Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `terminal`:
957
- [`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`:
958
- readonly `Pick`\<`AssistantMessage`, ... \| ... \| ...\>[]; `toolCalls`:
959
- `number`; \}\> \| `undefined`\>; `agent`:
960
- [`ShiitakeOwnerAgent`](#shiitakeowneragent); `acceptMail`: (`mail`, `meta?`,
961
- `reply?`, `stageAcceptedNotice?`) => `Promise`\<`Readonly`\<\{ `status`:
962
- `"accepted"`; `commandId`: `string`; `sessionId?`: `string`; \}\>\>; \}\>\>
972
+ `Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `delegator`:
973
+ `string` \| `null`; `terminal`: [`SessionTerminal`](client.md#sessionterminal);
974
+ `content`: `string`; `usage`: readonly `Pick`\<`AssistantMessage`, ... \| ... \|
975
+ ...\>[]; `toolCalls`: `number`; `waitingOnYou`: readonly `Readonly`\<\{
976
+ `itemId`: ...; `kind`: ...; `summary`: ...; \}\>[]; \}\> \| `undefined`\>;
977
+ `agent`: [`ShiitakeOwnerAgent`](#shiitakeowneragent); `acceptMail`: (`mail`,
978
+ `meta?`, `reply?`, `stageAcceptedNotice?`) => `Promise`\<`Readonly`\<\{
979
+ `status`: `"accepted"`; `commandId`: `string`; `sessionId?`: `string`; \}\>\>;
980
+ \}\>\>
963
981
 
964
982
  ## References
965
983
 
@@ -1047,6 +1065,12 @@ Re-exports [SessionProgress](client.md#sessionprogress)
1047
1065
 
1048
1066
  ---
1049
1067
 
1068
+ ### SessionProgressDelta
1069
+
1070
+ Re-exports [SessionProgressDelta](client.md#sessionprogressdelta)
1071
+
1072
+ ---
1073
+
1050
1074
  ### SessionToolOutput
1051
1075
 
1052
1076
  Re-exports [SessionToolOutput](client.md#sessiontooloutput)
@@ -91,6 +91,17 @@ type MemoryHost = Readonly<{
91
91
 
92
92
  Explicitly driven in-process host for trusted tests and runnable examples.
93
93
 
94
+ ## Variables
95
+
96
+ ### runFinalizerGraceMs
97
+
98
+ ```ts
99
+ const runFinalizerGraceMs: 1000 = 1_000;
100
+ ```
101
+
102
+ Product finalizer grace, exposed for tests that wait for durable queue
103
+ settlement.
104
+
94
105
  ## Functions
95
106
 
96
107
  ### fauxModelSource()
@@ -200,6 +211,8 @@ function memoryHost(options?): Promise<Readonly<{
200
211
  revision: number;
201
212
  text: string;
202
213
  thinking: string;
214
+ textOffset: number;
215
+ thinkingOffset: number;
203
216
  textTruncated: boolean;
204
217
  thinkingTruncated: boolean;
205
218
  }>
@@ -253,10 +266,10 @@ privileges. No submitted JavaScript is evaluated by this helper.
253
266
  [`SessionPendingPrompts`](client.md#sessionpendingprompts); `activity`:
254
267
  [`SessionActivity`](client.md#sessionactivity); `progress`: \| `Readonly`\<\{
255
268
  `messageId`: `string`; `revision`: `number`; `text`: `string`; `thinking`:
256
- `string`; `textTruncated`: `boolean`; `thinkingTruncated`: `boolean`; \}\> \|
257
- `null`; `toolOutput`: readonly `Readonly`\<\{ `toolCallId`: `string`;
258
- `revision`: `number`; `tail`: `string`; `droppedBytes`: `number`; `totalBytes`:
259
- `number`; \}\>[]; `extensions`:
260
- [`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`:
261
- readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`:
262
- ... \| ...; \}\>; \}\>\>; `close`: () => `Promise`\<`void`\>; \}\>\>
269
+ `string`; `textOffset`: `number`; `thinkingOffset`: `number`; `textTruncated`:
270
+ `boolean`; `thinkingTruncated`: `boolean`; \}\> \| `null`; `toolOutput`:
271
+ readonly `Readonly`\<\{ `toolCallId`: `string`; `revision`: `number`; `tail`:
272
+ `string`; `droppedBytes`: `number`; `totalBytes`: `number`; \}\>[];
273
+ `extensions`: [`SessionExtensionSlots`](client.md#sessionextensionslots);
274
+ `attention`: readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`;
275
+ `window`: ... \| ...; \}\>; \}\>\>; `close`: () => `Promise`\<`void`\>; \}\>\>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/shiitake",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Effect-native durable Session acceptance and bounded run orchestration",
6
6
  "type": "module",
@@ -86,19 +86,19 @@
86
86
  "node": ">=22.13"
87
87
  },
88
88
  "dependencies": {
89
- "@fungi.computer/bird-dog": "0.3.0",
89
+ "@fungi.computer/bird-dog": "0.3.1",
90
90
  "@fungi.computer/cairn": "0.1.0",
91
91
  "@fungi.computer/carrier": "0.2.0",
92
- "@fungi.computer/knapsack": "0.4.0",
92
+ "@fungi.computer/knapsack": "0.4.2",
93
93
  "@fungi.computer/mule": "0.2.1",
94
- "@fungi.computer/mycelium": "0.2.3",
94
+ "@fungi.computer/mycelium": "0.3.1",
95
95
  "@fungi.computer/seam": "0.2.0",
96
96
  "@fungi.computer/watchdog": "0.1.0",
97
97
  "effect": "4.0.2",
98
98
  "zod": "4.4.3",
99
99
  "@earendil-works/pi-ai": "1.3.0",
100
100
  "@fungi.computer/gills": "0.2.0",
101
- "@fungi.computer/agar": "0.5.0"
101
+ "@fungi.computer/agar": "0.6.1"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@cloudflare/workers-types": "5.20260828.1",