@fungi.computer/shiitake 0.3.0 → 0.4.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 (68) hide show
  1. package/README.md +18 -8
  2. package/dist/agent-control.d.ts +19 -15
  3. package/dist/agent-control.js +66 -126
  4. package/dist/client-wire.d.ts +12 -3
  5. package/dist/client-wire.js +33 -8
  6. package/dist/client.d.ts +34 -3
  7. package/dist/client.js +1 -1
  8. package/dist/cloudflare.d.ts +3 -1
  9. package/dist/cloudflare.js +2 -2
  10. package/dist/delegation.d.ts +145 -13
  11. package/dist/delegation.js +109 -37
  12. package/dist/effect.d.ts +1 -1
  13. package/dist/fleet.d.ts +30 -8
  14. package/dist/fleet.js +142 -38
  15. package/dist/http-routes.d.ts +91 -19
  16. package/dist/http-routes.js +15 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/internal/admission-door.d.ts +2 -0
  19. package/dist/internal/admission-door.js +2 -0
  20. package/dist/internal/client-boundary.d.ts +10 -0
  21. package/dist/internal/client-boundary.js +10 -0
  22. package/dist/internal/compaction/compaction.d.ts +5 -5
  23. package/dist/internal/compaction/compaction.js +4 -5
  24. package/dist/internal/compaction/settings.d.ts +1 -1
  25. package/dist/internal/compaction/utils.d.ts +1 -1
  26. package/dist/internal/contracts.d.ts +2 -0
  27. package/dist/internal/coordinator.d.ts +3 -1
  28. package/dist/internal/coordinator.js +98 -13
  29. package/dist/internal/effect-client.d.ts +3 -1
  30. package/dist/internal/effect-client.js +3 -2
  31. package/dist/internal/effect-contracts.d.ts +6 -2
  32. package/dist/internal/model-acquisition.js +2 -0
  33. package/dist/internal/model-preference.d.ts +2 -2
  34. package/dist/internal/observation-kernel.d.ts +8 -4
  35. package/dist/internal/observation-kernel.js +44 -9
  36. package/dist/internal/promise-facade.d.ts +1 -1
  37. package/dist/internal/promise-facade.js +1 -1
  38. package/dist/internal/run-scope.js +37 -8
  39. package/dist/internal/runtime-coordinator.d.ts +5 -0
  40. package/dist/internal/runtime-coordinator.js +8 -4
  41. package/dist/internal/runtime-core.d.ts +2 -1
  42. package/dist/internal/runtime-core.js +6 -1
  43. package/dist/internal/session-context.d.ts +1 -1
  44. package/dist/internal/session-context.js +84 -13
  45. package/dist/internal/woodstock/agent-reply.d.ts +7 -2
  46. package/dist/internal/woodstock/agent-reply.js +22 -13
  47. package/dist/internal/woodstock/fleet-store.d.ts +3 -2
  48. package/dist/internal/woodstock/fleet-store.js +43 -6
  49. package/dist/internal/woodstock/index.d.ts +2 -0
  50. package/dist/internal/woodstock/index.js +11 -5
  51. package/dist/internal/woodstock/run-recovery.js +4 -1
  52. package/dist/internal/woodstock/session-entry.d.ts +14 -4
  53. package/dist/internal/woodstock/session-entry.js +1 -0
  54. package/dist/internal/woodstock/session-store.d.ts +4 -0
  55. package/dist/internal/woodstock/session-store.js +26 -19
  56. package/dist/remote-client.js +5 -1
  57. package/dist/testing.d.ts +6 -3
  58. package/dist/testing.js +4 -2
  59. package/docs/api/agent-control.md +18 -12
  60. package/docs/api/client.md +78 -0
  61. package/docs/api/delegation.md +72 -55
  62. package/docs/api/effect.md +5 -0
  63. package/docs/api/fleet.md +23 -23
  64. package/docs/api/http.md +2 -1
  65. package/docs/api/index.md +13 -0
  66. package/docs/api/model-preference.md +10 -10
  67. package/docs/api/testing.md +3 -3
  68. package/package.json +9 -8
@@ -52,7 +52,7 @@ const parseModelPreference: (
52
52
  ) => {
53
53
  providerId: string;
54
54
  modelId: string;
55
- reasoning?: "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
55
+ reasoning?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh";
56
56
  } | null;
57
57
  ```
58
58
 
@@ -67,8 +67,8 @@ Decode the bounded client preference; availability remains model-owner policy.
67
67
 
68
68
  #### Returns
69
69
 
70
- \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"minimal"` \|
71
- `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"`; \} \| `null`
70
+ \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"high"` \|
71
+ `"low"` \| `"max"` \| `"medium"` \| `"minimal"` \| `"xhigh"`; \} \| `null`
72
72
 
73
73
  ---
74
74
 
@@ -81,7 +81,7 @@ const parseModelPreferenceJson: (
81
81
  ) => {
82
82
  providerId: string;
83
83
  modelId: string;
84
- reasoning?: "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
84
+ reasoning?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh";
85
85
  } | null;
86
86
  ```
87
87
 
@@ -96,8 +96,8 @@ Decode the serialized preference with the same maintained schema.
96
96
 
97
97
  #### Returns
98
98
 
99
- \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"minimal"` \|
100
- `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"`; \} \| `null`
99
+ \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"high"` \|
100
+ `"low"` \| `"max"` \| `"medium"` \| `"minimal"` \| `"xhigh"`; \} \| `null`
101
101
 
102
102
  ---
103
103
 
@@ -133,7 +133,7 @@ Parse the footer's provider/model spelling; model ids may contain slashes.
133
133
  | ------------ | ------------------------------------------------------------------------ | ------------- |
134
134
  | `providerId` | `string` | `identifier` |
135
135
  | `modelId` | `string` | `identifier` |
136
- | `reasoning?` | `"minimal"` \| `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | - |
136
+ | `reasoning?` | `"high"` \| `"low"` \| `"max"` \| `"medium"` \| `"minimal"` \| `"xhigh"` | - |
137
137
 
138
138
  ---
139
139
 
@@ -143,7 +143,7 @@ Parse the footer's provider/model spelling; model ids may contain slashes.
143
143
  function resolveModelPreference(layers): {
144
144
  providerId: string;
145
145
  modelId: string;
146
- reasoning?: "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
146
+ reasoning?: "high" | "low" | "max" | "medium" | "minimal" | "xhigh";
147
147
  } | null;
148
148
  ```
149
149
 
@@ -158,8 +158,8 @@ availability; an explicit choice never silently falls through on auth failure.
158
158
 
159
159
  #### Returns
160
160
 
161
- \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"minimal"` \|
162
- `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"`; \} \| `null`
161
+ \| \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"high"` \|
162
+ `"low"` \| `"max"` \| `"medium"` \| `"minimal"` \| `"xhigh"`; \} \| `null`
163
163
 
164
164
  ## References
165
165
 
@@ -84,7 +84,7 @@ Optional canonical Agent inputs and a borrowed owner; defaults are in-memory.
84
84
  type MemoryHost = Readonly<{
85
85
  agent: ShiitakeOwnerAgent;
86
86
  reconcile: () => Promise<void>;
87
- settle: (sessionId, maxTicks?) => Promise<SessionSnapshot>;
87
+ settle: (sessionId, maxTicks?, beforeRead?) => Promise<SessionSnapshot>;
88
88
  close: () => Promise<void>;
89
89
  }>;
90
90
  ```
@@ -154,7 +154,7 @@ Script one model turn that replies with the system prompt it received.
154
154
  function memoryHost(options?): Promise<Readonly<{
155
155
  agent: ShiitakeOwnerAgent;
156
156
  reconcile: () => Promise<void>;
157
- settle: (sessionId, maxTicks?) => Promise<Readonly<{
157
+ settle: (sessionId, maxTicks?, beforeRead?) => Promise<Readonly<{
158
158
  sessionId: string;
159
159
  cursor: string | null;
160
160
  hasMore: boolean;
@@ -237,7 +237,7 @@ privileges. No submitted JavaScript is evaluated by this helper.
237
237
 
238
238
  `Promise`\<`Readonly`\<\{ `agent`:
239
239
  [`ShiitakeOwnerAgent`](index.md#shiitakeowneragent); `reconcile`: () =>
240
- `Promise`\<`void`\>; `settle`: (`sessionId`, `maxTicks?`) =>
240
+ `Promise`\<`void`\>; `settle`: (`sessionId`, `maxTicks?`, `beforeRead?`) =>
241
241
  `Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`;
242
242
  `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly
243
243
  `Readonly`\<\{ `requestId?`: ... \| ...; `meta?`: ... \| ...; `data?`: ... \|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/shiitake",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Effect-native durable Session acceptance and bounded run orchestration",
6
6
  "type": "module",
@@ -82,19 +82,19 @@
82
82
  "node": ">=22.13"
83
83
  },
84
84
  "dependencies": {
85
- "@fungi.computer/bird-dog": "0.1.0",
85
+ "@fungi.computer/bird-dog": "0.2.0",
86
86
  "@fungi.computer/cairn": "0.1.0",
87
- "@fungi.computer/carrier": "0.1.0",
88
- "@fungi.computer/knapsack": "0.2.0",
89
- "@fungi.computer/mule": "0.1.0",
90
- "@fungi.computer/mycelium": "0.2.0",
91
- "@fungi.computer/seam": "0.1.0",
87
+ "@fungi.computer/carrier": "0.2.0",
88
+ "@fungi.computer/knapsack": "0.3.0",
89
+ "@fungi.computer/mule": "0.2.0",
90
+ "@fungi.computer/mycelium": "0.2.2",
91
+ "@fungi.computer/seam": "0.2.0",
92
92
  "@fungi.computer/watchdog": "0.1.0",
93
93
  "effect": "4.0.2",
94
94
  "zod": "4.4.3",
95
95
  "@earendil-works/pi-ai": "1.3.0",
96
96
  "@fungi.computer/gills": "0.2.0",
97
- "@fungi.computer/agar": "0.3.0"
97
+ "@fungi.computer/agar": "0.3.1"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@cloudflare/workers-types": "5.20260828.1",
@@ -132,6 +132,7 @@
132
132
  "clean": "node --input-type=module --eval \"import { rm } from 'node:fs/promises'; await rm('dist', { recursive: true, force: true });\"",
133
133
  "test": "pnpm run test:unit && pnpm run test:merge",
134
134
  "test:unit": "vitest run",
135
+ "test:load": "vitest run --config vitest.load.config.ts",
135
136
  "test:merge": "node test/cloudflare-durable-wake.native.mjs && node test/woodstock-storage-conformance.native.mjs && pnpm run test:docs",
136
137
  "test:docs": "node --import tsx --test examples/bookmarks/checks.ts",
137
138
  "docs": "tsx ../../tooling/repository/src/docs/cli.ts check --root ../..",