@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.
- package/README.md +155 -34
- package/dist/agent-control.d.ts +77 -5
- package/dist/agent-control.js +271 -65
- package/dist/client-entry.d.ts +15 -8
- package/dist/client-entry.js +7 -5
- package/dist/client-wire.d.ts +24 -8
- package/dist/client-wire.js +53 -11
- package/dist/client.d.ts +56 -11
- package/dist/client.js +1 -1
- package/dist/cloudflare.d.ts +42 -23
- package/dist/cloudflare.js +76 -54
- package/dist/cold-sessions.d.ts +28 -0
- package/dist/cold-sessions.js +1 -0
- package/dist/delegation.d.ts +214 -0
- package/dist/delegation.js +319 -0
- package/dist/effect.d.ts +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -2
- package/dist/extension-contract.d.ts +10 -2
- package/dist/extensions.d.ts +6 -2
- package/dist/fleet.d.ts +43 -9
- package/dist/fleet.js +88 -25
- package/dist/hosted.js +1 -0
- package/dist/http-routes.d.ts +106 -22
- package/dist/http-routes.js +18 -1
- package/dist/index.d.ts +3 -2
- package/dist/internal/accepted-run-executor.d.ts +5 -0
- package/dist/internal/accepted-run-executor.js +10 -4
- package/dist/internal/admission-door.d.ts +3 -0
- package/dist/internal/admission-door.js +12 -2
- package/dist/internal/client-boundary.js +7 -1
- package/dist/internal/compaction/compaction-slot.d.ts +36 -0
- package/dist/internal/compaction/compaction-slot.js +41 -0
- package/dist/internal/compaction/compaction.d.ts +7 -4
- package/dist/internal/compaction/compaction.js +59 -30
- package/dist/internal/compaction/session-compaction.d.ts +8 -16
- package/dist/internal/compaction/session-compaction.js +358 -119
- package/dist/internal/compaction/settings.js +5 -0
- package/dist/internal/compaction/utils.d.ts +19 -16
- package/dist/internal/compaction/utils.js +30 -84
- package/dist/internal/contracts.d.ts +40 -13
- package/dist/internal/coordinator.js +28 -10
- package/dist/internal/effect-client.d.ts +4 -2
- package/dist/internal/effect-client.js +29 -0
- package/dist/internal/effect-contracts.d.ts +17 -4
- package/dist/internal/extension-runtime.d.ts +5 -0
- package/dist/internal/extension-runtime.js +184 -89
- package/dist/internal/host-meta.d.ts +7 -0
- package/dist/internal/model-acquisition.js +7 -1
- package/dist/internal/model-preference.d.ts +2 -0
- package/dist/internal/model-preference.js +2 -1
- package/dist/internal/promise-facade.js +4 -16
- package/dist/internal/run-failure-reason.d.ts +10 -0
- package/dist/internal/run-failure-reason.js +19 -0
- package/dist/internal/run-scope.d.ts +4 -1
- package/dist/internal/run-scope.js +38 -5
- package/dist/internal/runtime-coordinator.d.ts +2 -1
- package/dist/internal/runtime-coordinator.js +65 -4
- package/dist/internal/runtime-core.js +1 -0
- package/dist/internal/runtime-reconciliation.js +42 -6
- package/dist/internal/session-context.d.ts +1 -2
- package/dist/internal/session-context.js +8 -30
- package/dist/internal/session-status.d.ts +2 -1
- package/dist/internal/session-status.js +4 -1
- package/dist/internal/woodstock/client-projection.d.ts +6 -5
- package/dist/internal/woodstock/client-projection.js +79 -53
- package/dist/internal/woodstock/cold-sessions.d.ts +4 -0
- package/dist/internal/woodstock/cold-sessions.js +90 -0
- package/dist/internal/woodstock/extension-store.d.ts +2 -0
- package/dist/internal/woodstock/extension-store.js +4 -0
- package/dist/internal/woodstock/fleet-store.d.ts +5 -1
- package/dist/internal/woodstock/fleet-store.js +17 -5
- package/dist/internal/woodstock/index.d.ts +11 -3
- package/dist/internal/woodstock/index.js +33 -14
- package/dist/internal/woodstock/progress.d.ts +14 -1
- package/dist/internal/woodstock/progress.js +97 -19
- package/dist/internal/woodstock/run-recovery.js +6 -4
- package/dist/internal/woodstock/session-attention.d.ts +1 -1
- package/dist/internal/woodstock/session-attention.js +2 -2
- package/dist/internal/woodstock/session-entry.d.ts +109 -42
- package/dist/internal/woodstock/session-entry.js +63 -20
- package/dist/internal/woodstock/session-inbox.js +2 -0
- package/dist/internal/woodstock/session-store.d.ts +104 -24
- package/dist/internal/woodstock/session-store.js +937 -246
- package/dist/internal/woodstock/storage-admission.d.ts +8 -8
- package/dist/internal/woodstock/storage-admission.js +8 -34
- package/dist/internal/woodstock/storage-conformance.d.ts +15 -0
- package/dist/internal/woodstock/storage-conformance.js +489 -0
- package/dist/model-preference.d.ts +2 -2
- package/dist/model-preference.js +2 -2
- package/dist/node.js +1 -1
- package/dist/remote-client.js +8 -1
- package/dist/session-attention.d.ts +8 -1
- package/dist/session-attention.js +6 -1
- package/dist/testing.js +1 -0
- package/docs/api/README.md +18 -16
- package/docs/api/agent-control.md +171 -1
- package/docs/api/client-entry.md +26 -10
- package/docs/api/client.md +153 -37
- package/docs/api/cloudflare.md +76 -23
- package/docs/api/delegation.md +485 -0
- package/docs/api/effect.md +20 -2
- package/docs/api/extensions.md +21 -9
- package/docs/api/fleet.md +159 -104
- package/docs/api/http.md +4 -1
- package/docs/api/index.md +116 -20
- package/docs/api/internal/woodstock/storage-conformance.md +81 -0
- package/docs/api/model-preference.md +17 -0
- package/docs/api/testing.md +16 -4
- package/package.json +26 -14
- package/dist/internal/browser-sessions.d.ts +0 -31
- package/dist/internal/browser-sessions.js +0 -173
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
|
|
40
|
-
| ------------ |
|
|
41
|
-
| `boundary` | \| `"contract"` \| `"extensions"` \| `"instructions"` \| `"model"` \| `"runtime"` \| `"store"` \| `"tools"`
|
|
42
|
-
| `category` | \| `"closed"` \| `"conflict"` \| `"incompatible"` \| `"invalid"` \| `"rejected"` \| `"unavailable"` \| `"
|
|
43
|
-
| `message` | `string`
|
|
44
|
-
| `requestId?` | `string`
|
|
45
|
-
| `cause?` | `unknown`
|
|
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. |
|
|
46
46
|
|
|
47
47
|
###### Returns
|
|
48
48
|
|
|
@@ -74,8 +74,8 @@ readonly cause:
|
|
|
74
74
|
| "invalid"
|
|
75
75
|
| "rejected"
|
|
76
76
|
| "unavailable"
|
|
77
|
-
| "
|
|
78
|
-
| "
|
|
77
|
+
| "state_reset_required"
|
|
78
|
+
| "storage_pressure";
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
Safe category describing why it was rejected.
|
|
@@ -119,6 +119,47 @@ Request identity recoverable when a send may have reached the owner.
|
|
|
119
119
|
|
|
120
120
|
## Type Aliases
|
|
121
121
|
|
|
122
|
+
### ColdSessionRow
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
type ColdSessionRow = Readonly<{
|
|
126
|
+
sessionId: string;
|
|
127
|
+
bytes: number;
|
|
128
|
+
lastActivityAt: number;
|
|
129
|
+
idle: boolean;
|
|
130
|
+
}>;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
One Session as the store keeper sees it: what it holds and how cold it is.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### ColdSessionPage
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
type ColdSessionPage = Readonly<{
|
|
141
|
+
sessions: readonly ColdSessionRow[];
|
|
142
|
+
next?: string;
|
|
143
|
+
}>;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
One bounded page of Sessions, coldest first.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### ColdSessionPageRequest
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
type ColdSessionPageRequest = Readonly<{
|
|
154
|
+
limit?: number;
|
|
155
|
+
after?: string;
|
|
156
|
+
}>;
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
A page request: `limit` is a whole number from 1 to 200 (default 50).
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
122
163
|
### ShiitakeErrorBoundary
|
|
123
164
|
|
|
124
165
|
```ts
|
|
@@ -256,6 +297,21 @@ Public command that selects one complete entry as the active lineage leaf.
|
|
|
256
297
|
|
|
257
298
|
---
|
|
258
299
|
|
|
300
|
+
### OperatorCommand
|
|
301
|
+
|
|
302
|
+
```ts
|
|
303
|
+
type OperatorCommand = Extract<
|
|
304
|
+
SessionCommand,
|
|
305
|
+
Readonly<{
|
|
306
|
+
type: "operator";
|
|
307
|
+
}>
|
|
308
|
+
>;
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Public command that records one operator or party line without a run.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
259
315
|
### CompactCommand
|
|
260
316
|
|
|
261
317
|
```ts
|
|
@@ -271,6 +327,21 @@ Public command that compacts the Session's context as queued work.
|
|
|
271
327
|
|
|
272
328
|
---
|
|
273
329
|
|
|
330
|
+
### TitleCommand
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
type TitleCommand = Extract<
|
|
334
|
+
SessionCommand,
|
|
335
|
+
Readonly<{
|
|
336
|
+
type: "title";
|
|
337
|
+
}>
|
|
338
|
+
>;
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Public command that sets or clears the user's Session title.
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
274
345
|
### ForkCommand
|
|
275
346
|
|
|
276
347
|
```ts
|
|
@@ -327,6 +398,7 @@ type SqliteOwner = Omit<WatchdogSqliteOwner, "sql"> &
|
|
|
327
398
|
sql: Readonly<{
|
|
328
399
|
exec: (statement, ...bindings) => SqliteCursor;
|
|
329
400
|
}>;
|
|
401
|
+
storeName?: string;
|
|
330
402
|
}>;
|
|
331
403
|
```
|
|
332
404
|
|
|
@@ -340,7 +412,9 @@ Synchronous SQL and transactions held by the surrounding runtime.
|
|
|
340
412
|
type ModelAcquisition = Readonly<{
|
|
341
413
|
model: Model<Api>;
|
|
342
414
|
stream?: MuleStreamFunction;
|
|
415
|
+
retryable: (message) => boolean;
|
|
343
416
|
retryAfterMs?: (message) => number | undefined;
|
|
417
|
+
failureReason?: (message) => string | undefined;
|
|
344
418
|
release: () => Promise<void>;
|
|
345
419
|
}>;
|
|
346
420
|
```
|
|
@@ -448,18 +522,18 @@ Promise host for scheduling the opaque durable reconciler.
|
|
|
448
522
|
|
|
449
523
|
---
|
|
450
524
|
|
|
451
|
-
###
|
|
525
|
+
### StoragePressureCheck
|
|
452
526
|
|
|
453
527
|
```ts
|
|
454
|
-
type
|
|
455
|
-
|
|
456
|
-
budgetBytes: number;
|
|
528
|
+
type StoragePressureCheck = Readonly<{
|
|
529
|
+
underPressure: () => boolean;
|
|
457
530
|
}>;
|
|
458
531
|
```
|
|
459
532
|
|
|
460
|
-
A host's
|
|
461
|
-
|
|
462
|
-
|
|
533
|
+
A host's storage-pressure check. Shiitake owns the refusal door and the typed
|
|
534
|
+
`storage_pressure` error; the host owns the numbers behind it, such as
|
|
535
|
+
Zookeeper's budget and thresholds. While the check reports pressure, new
|
|
536
|
+
Sessions and new prompts are refused and admitted work finishes.
|
|
463
537
|
|
|
464
538
|
---
|
|
465
539
|
|
|
@@ -469,6 +543,7 @@ Near the budget, Shiitake refuses new Sessions and new prompts with a typed
|
|
|
469
543
|
type CompactionBudget = Readonly<{
|
|
470
544
|
reserveTokens?: number;
|
|
471
545
|
keepRecentTokens?: number;
|
|
546
|
+
backgroundTokens?: number;
|
|
472
547
|
}>;
|
|
473
548
|
```
|
|
474
549
|
|
|
@@ -488,8 +563,8 @@ type CompactionOptions = CompactionBudget &
|
|
|
488
563
|
|
|
489
564
|
Pi's compaction settings. Each budget resolves through the exact
|
|
490
565
|
`provider/modelId` override, then the ordinary value, then Pi's default (16384
|
|
491
|
-
reserve, 20000 kept). `enabled` is global and governs
|
|
492
|
-
a manual compaction always runs.
|
|
566
|
+
reserve, 20000 kept, 32768 background). `enabled` is global and governs
|
|
567
|
+
automatic compaction only; a manual compaction always runs.
|
|
493
568
|
|
|
494
569
|
---
|
|
495
570
|
|
|
@@ -499,7 +574,7 @@ a manual compaction always runs.
|
|
|
499
574
|
type ShiitakeOptions = Readonly<{
|
|
500
575
|
meta?: HostMetaOptions;
|
|
501
576
|
store: SqliteOwner;
|
|
502
|
-
|
|
577
|
+
storagePressure?: StoragePressureCheck;
|
|
503
578
|
compaction?: CompactionOptions;
|
|
504
579
|
runtime: RuntimeHost;
|
|
505
580
|
model: ModelSource;
|
|
@@ -533,6 +608,12 @@ full access, so a first-time host writes no permission code.
|
|
|
533
608
|
```ts
|
|
534
609
|
type ShiitakeOwnerAgent = ShiitakeAgent &
|
|
535
610
|
Readonly<{
|
|
611
|
+
prepareConfiguration: (configuration) => Promise<
|
|
612
|
+
Readonly<{
|
|
613
|
+
commit: () => void;
|
|
614
|
+
discard: () => Promise<void>;
|
|
615
|
+
}>
|
|
616
|
+
>;
|
|
536
617
|
grants: Readonly<{
|
|
537
618
|
deliver: (sessionId, delivery) => GrantsDeliveryResult;
|
|
538
619
|
read: (sessionId) => GrantsDelivery | null;
|
|
@@ -551,6 +632,7 @@ can.
|
|
|
551
632
|
|
|
552
633
|
```ts
|
|
553
634
|
type CommandSettlement = Readonly<{
|
|
635
|
+
acceptedSender: string | null;
|
|
554
636
|
terminal: SessionTerminal;
|
|
555
637
|
content: string;
|
|
556
638
|
usage: readonly Pick<AssistantMessage, "provider" | "model" | "usage">[];
|
|
@@ -602,6 +684,7 @@ One Standard Schema validation outcome; only acceptance matters here.
|
|
|
602
684
|
```ts
|
|
603
685
|
type HostMetaOptions = Readonly<{
|
|
604
686
|
schema: Schema.Codec<unknown, Json> | StandardHostMetaSchema;
|
|
687
|
+
identityPath?: string;
|
|
605
688
|
}>;
|
|
606
689
|
```
|
|
607
690
|
|
|
@@ -840,6 +923,7 @@ Parse one serialized frame using Shiitake's public client grammar.
|
|
|
840
923
|
function makeHost(options, mailRoom): Promise<Readonly<{
|
|
841
924
|
readSettlement: (sessionId, commandId) => Promise<
|
|
842
925
|
| Readonly<{
|
|
926
|
+
acceptedSender: string | null;
|
|
843
927
|
terminal: SessionTerminal;
|
|
844
928
|
content: string;
|
|
845
929
|
usage: readonly Pick<AssistantMessage, ... | ... | ...>[];
|
|
@@ -866,7 +950,7 @@ Construct the host-only Promise facade over the canonical Effect program.
|
|
|
866
950
|
#### Returns
|
|
867
951
|
|
|
868
952
|
`Promise`\<`Readonly`\<\{ `readSettlement`: (`sessionId`, `commandId`) =>
|
|
869
|
-
`Promise`\< \| `Readonly`\<\{ `terminal`:
|
|
953
|
+
`Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `terminal`:
|
|
870
954
|
[`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`:
|
|
871
955
|
readonly `Pick`\<`AssistantMessage`, ... \| ... \| ...\>[]; `toolCalls`:
|
|
872
956
|
`number`; \}\> \| `undefined`\>; `agent`:
|
|
@@ -948,6 +1032,12 @@ Re-exports [SessionProgress](client.md#sessionprogress)
|
|
|
948
1032
|
|
|
949
1033
|
---
|
|
950
1034
|
|
|
1035
|
+
### SessionToolOutput
|
|
1036
|
+
|
|
1037
|
+
Re-exports [SessionToolOutput](client.md#sessiontooloutput)
|
|
1038
|
+
|
|
1039
|
+
---
|
|
1040
|
+
|
|
951
1041
|
### SessionContext
|
|
952
1042
|
|
|
953
1043
|
Re-exports [SessionContext](client.md#sessioncontext)
|
|
@@ -1057,6 +1147,12 @@ Re-exports [TooLate](client.md#toolate)
|
|
|
1057
1147
|
|
|
1058
1148
|
---
|
|
1059
1149
|
|
|
1150
|
+
### UnknownRequest
|
|
1151
|
+
|
|
1152
|
+
Re-exports [UnknownRequest](client.md#unknownrequest)
|
|
1153
|
+
|
|
1154
|
+
---
|
|
1155
|
+
|
|
1060
1156
|
### WatchOptions
|
|
1061
1157
|
|
|
1062
1158
|
Re-exports [WatchOptions](client.md#watchoptions)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/shiitake**](../../README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/shiitake](../../README.md) /
|
|
8
|
+
internal/woodstock/storage-conformance
|
|
9
|
+
|
|
10
|
+
# internal/woodstock/storage-conformance
|
|
11
|
+
|
|
12
|
+
Runner-independent conformance cases for one Woodstock Session storage host.
|
|
13
|
+
|
|
14
|
+
Adapted from Pi Durable's `src/testing/storage-conformance.ts`
|
|
15
|
+
(`earendil-works/pi` at 8efd314f): every host that backs Woodstock with a
|
|
16
|
+
[SqliteOwner](../../index.md#sqliteowner) — the local `node:sqlite` owner and
|
|
17
|
+
the Durable Object's `ctx.storage` — runs the same cases through Woodstock's own
|
|
18
|
+
writers and readers. Fungi delta: Pi's suite checks a generic record store (ID
|
|
19
|
+
minting, task and document tables); Woodstock's store is the parent-pointer
|
|
20
|
+
Session tree, so these cases check atomic admission, request-ID replay, bounded
|
|
21
|
+
lineage reads, branch, fork, placeholder completion, deletion and the inbox. The
|
|
22
|
+
cases import no test runner, only `node:assert`, so they run inside a Worker
|
|
23
|
+
with `nodejs_compat` too.
|
|
24
|
+
|
|
25
|
+
## Type Aliases
|
|
26
|
+
|
|
27
|
+
### WoodstockStorageProvider
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
type WoodstockStorageProvider = (use) => Promise<void>;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Calls `use` exactly once with an empty, writable owner of the host under test,
|
|
34
|
+
then releases the owner. It resolves after `use` returns.
|
|
35
|
+
|
|
36
|
+
#### Parameters
|
|
37
|
+
|
|
38
|
+
| Parameter | Type |
|
|
39
|
+
| --------- | ------------------- |
|
|
40
|
+
| `use` | (`owner`) => `void` |
|
|
41
|
+
|
|
42
|
+
#### Returns
|
|
43
|
+
|
|
44
|
+
`Promise`\<`void`\>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### WoodstockConformanceCase
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
type WoodstockConformanceCase = Readonly<{
|
|
52
|
+
name: string;
|
|
53
|
+
run: () => Promise<void>;
|
|
54
|
+
}>;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
One named case.
|
|
58
|
+
|
|
59
|
+
## Functions
|
|
60
|
+
|
|
61
|
+
### createWoodstockStorageConformance()
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
function createWoodstockStorageConformance(withOwner): readonly Readonly<{
|
|
65
|
+
name: string;
|
|
66
|
+
run: () => Promise<void>;
|
|
67
|
+
}>[];
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Create the runner-independent cases for one Woodstock storage host.
|
|
71
|
+
|
|
72
|
+
#### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type |
|
|
75
|
+
| ----------- | ------------------------------------------------------- |
|
|
76
|
+
| `withOwner` | [`WoodstockStorageProvider`](#woodstockstorageprovider) |
|
|
77
|
+
|
|
78
|
+
#### Returns
|
|
79
|
+
|
|
80
|
+
readonly `Readonly`\<\{ `name`: `string`; `run`: () => `Promise`\<`void`\>;
|
|
81
|
+
\}\>[]
|
|
@@ -10,6 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
## Variables
|
|
12
12
|
|
|
13
|
+
### modelReasoningLevels
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const modelReasoningLevels: readonly [
|
|
17
|
+
"minimal",
|
|
18
|
+
"low",
|
|
19
|
+
"medium",
|
|
20
|
+
"high",
|
|
21
|
+
"xhigh",
|
|
22
|
+
"max",
|
|
23
|
+
];
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The thinking levels a model choice may name, shared by every model path.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
13
30
|
### ModelPreferenceSchema
|
|
14
31
|
|
|
15
32
|
```ts
|
package/docs/api/testing.md
CHANGED
|
@@ -160,12 +160,14 @@ function memoryHost(options?): Promise<Readonly<{
|
|
|
160
160
|
hasMore: boolean;
|
|
161
161
|
oldestCursor?: string | null;
|
|
162
162
|
messages: readonly Readonly<{
|
|
163
|
+
requestId?: ... | ...;
|
|
163
164
|
meta?: ... | ...;
|
|
165
|
+
data?: ... | ...;
|
|
164
166
|
origin?: ... | ...;
|
|
165
167
|
id: string;
|
|
166
168
|
sequence: number;
|
|
167
169
|
commandId: ... | ...;
|
|
168
|
-
value:
|
|
170
|
+
value: ModelMessage;
|
|
169
171
|
}>[];
|
|
170
172
|
terminals: readonly Readonly<{
|
|
171
173
|
commandId: string;
|
|
@@ -202,6 +204,13 @@ function memoryHost(options?): Promise<Readonly<{
|
|
|
202
204
|
thinkingTruncated: boolean;
|
|
203
205
|
}>
|
|
204
206
|
| null;
|
|
207
|
+
toolOutput: readonly Readonly<{
|
|
208
|
+
toolCallId: string;
|
|
209
|
+
revision: number;
|
|
210
|
+
tail: string;
|
|
211
|
+
droppedBytes: number;
|
|
212
|
+
totalBytes: number;
|
|
213
|
+
}>[];
|
|
205
214
|
extensions: SessionExtensionSlots;
|
|
206
215
|
attention: readonly object[];
|
|
207
216
|
context?: Readonly<{
|
|
@@ -231,8 +240,9 @@ privileges. No submitted JavaScript is evaluated by this helper.
|
|
|
231
240
|
`Promise`\<`void`\>; `settle`: (`sessionId`, `maxTicks?`) =>
|
|
232
241
|
`Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`;
|
|
233
242
|
`hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly
|
|
234
|
-
`Readonly`\<\{ `
|
|
235
|
-
|
|
243
|
+
`Readonly`\<\{ `requestId?`: ... \| ...; `meta?`: ... \| ...; `data?`: ... \|
|
|
244
|
+
...; `origin?`: ... \| ...; `id`: `string`; `sequence`: `number`; `commandId`:
|
|
245
|
+
... \| ...; `value`: [`ModelMessage`](client.md#modelmessage); \}\>[];
|
|
236
246
|
`terminals`: readonly `Readonly`\<\{ `commandId`: `string`; `outcome`: ... \|
|
|
237
247
|
... \| ... \| ...; `sequence`: `number`; `diagnostic`: ... \| ...; `meta?`: ...
|
|
238
248
|
\| ...; \}\>[]; `compactions?`: readonly `Readonly`\<\{ `id`: ...; `sequence`:
|
|
@@ -244,7 +254,9 @@ privileges. No submitted JavaScript is evaluated by this helper.
|
|
|
244
254
|
[`SessionActivity`](client.md#sessionactivity); `progress`: \| `Readonly`\<\{
|
|
245
255
|
`messageId`: `string`; `revision`: `number`; `text`: `string`; `thinking`:
|
|
246
256
|
`string`; `textTruncated`: `boolean`; `thinkingTruncated`: `boolean`; \}\> \|
|
|
247
|
-
`null`; `
|
|
257
|
+
`null`; `toolOutput`: readonly `Readonly`\<\{ `toolCallId`: `string`;
|
|
258
|
+
`revision`: `number`; `tail`: `string`; `droppedBytes`: `number`; `totalBytes`:
|
|
259
|
+
`number`; \}\>[]; `extensions`:
|
|
248
260
|
[`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`:
|
|
249
261
|
readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`:
|
|
250
262
|
... \| ...; \}\>; \}\>\>; `close`: () => `Promise`\<`void`\>; \}\>\>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/shiitake",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Effect-native durable Session acceptance and bounded run orchestration",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"types": "./dist/testing.d.ts",
|
|
52
52
|
"import": "./dist/testing.js"
|
|
53
53
|
},
|
|
54
|
+
"./storage-conformance": {
|
|
55
|
+
"types": "./dist/internal/woodstock/storage-conformance.d.ts",
|
|
56
|
+
"import": "./dist/internal/woodstock/storage-conformance.js"
|
|
57
|
+
},
|
|
54
58
|
"./node": {
|
|
55
59
|
"types": "./dist/node.d.ts",
|
|
56
60
|
"import": "./dist/node.js"
|
|
@@ -62,6 +66,10 @@
|
|
|
62
66
|
"./fleet": {
|
|
63
67
|
"types": "./dist/fleet.d.ts",
|
|
64
68
|
"import": "./dist/fleet.js"
|
|
69
|
+
},
|
|
70
|
+
"./delegation": {
|
|
71
|
+
"types": "./dist/delegation.d.ts",
|
|
72
|
+
"import": "./dist/delegation.js"
|
|
65
73
|
}
|
|
66
74
|
},
|
|
67
75
|
"files": [
|
|
@@ -74,26 +82,27 @@
|
|
|
74
82
|
"node": ">=22.13"
|
|
75
83
|
},
|
|
76
84
|
"dependencies": {
|
|
77
|
-
"@fungi.computer/bird-dog": "0.0
|
|
78
|
-
"@fungi.computer/cairn": "0.0
|
|
79
|
-
"@fungi.computer/
|
|
80
|
-
"@fungi.computer/
|
|
81
|
-
"@fungi.computer/
|
|
82
|
-
"@fungi.computer/
|
|
85
|
+
"@fungi.computer/bird-dog": "0.1.0",
|
|
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",
|
|
92
|
+
"@fungi.computer/watchdog": "0.1.0",
|
|
83
93
|
"effect": "4.0.2",
|
|
84
|
-
"hono": "4.13.5",
|
|
85
94
|
"zod": "4.4.3",
|
|
86
|
-
"@earendil-works/pi-ai": "
|
|
87
|
-
"@fungi.computer/gills": "0.
|
|
88
|
-
"@fungi.computer/agar": "0.
|
|
95
|
+
"@earendil-works/pi-ai": "1.3.0",
|
|
96
|
+
"@fungi.computer/gills": "0.2.0",
|
|
97
|
+
"@fungi.computer/agar": "0.3.0"
|
|
89
98
|
},
|
|
90
99
|
"devDependencies": {
|
|
91
100
|
"@cloudflare/workers-types": "5.20260828.1",
|
|
92
101
|
"@types/node": "24.13.3",
|
|
93
102
|
"typescript": "5.9.3",
|
|
94
103
|
"vitest": "4.1.11",
|
|
95
|
-
"@
|
|
96
|
-
"
|
|
104
|
+
"@astrojs/starlight": "0.42.4",
|
|
105
|
+
"hono": "4.13.5"
|
|
97
106
|
},
|
|
98
107
|
"botanical": {
|
|
99
108
|
"role": "package",
|
|
@@ -113,6 +122,9 @@
|
|
|
113
122
|
"type": "git",
|
|
114
123
|
"url": "git+https://github.com/fungi-computer/shiitake.git"
|
|
115
124
|
},
|
|
125
|
+
"peerDependencies": {
|
|
126
|
+
"hono": "^4.13.5"
|
|
127
|
+
},
|
|
116
128
|
"scripts": {
|
|
117
129
|
"lint": "eslint src test examples --max-warnings=0 && ../../node_modules/.bin/oxlint --config ../../oxlint.config.ts --deny-warnings src test examples",
|
|
118
130
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
@@ -120,7 +132,7 @@
|
|
|
120
132
|
"clean": "node --input-type=module --eval \"import { rm } from 'node:fs/promises'; await rm('dist', { recursive: true, force: true });\"",
|
|
121
133
|
"test": "pnpm run test:unit && pnpm run test:merge",
|
|
122
134
|
"test:unit": "vitest run",
|
|
123
|
-
"test:merge": "node test/cloudflare-durable-wake.native.mjs && pnpm run test:docs",
|
|
135
|
+
"test:merge": "node test/cloudflare-durable-wake.native.mjs && node test/woodstock-storage-conformance.native.mjs && pnpm run test:docs",
|
|
124
136
|
"test:docs": "node --import tsx --test examples/bookmarks/checks.ts",
|
|
125
137
|
"docs": "tsx ../../tooling/repository/src/docs/cli.ts check --root ../..",
|
|
126
138
|
"docs:write": "tsx ../../tooling/repository/src/docs/cli.ts write --root ../..",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ModuleRegistration } from "@fungi.computer/mycelium";
|
|
2
|
-
/** The maintained browser transport and its Session-bound tool descriptors. */
|
|
3
|
-
export type BrowserHost = Readonly<{
|
|
4
|
-
/** Mycelium tools bound to this host's Session and call-time gates. */
|
|
5
|
-
modules: readonly ModuleRegistration[];
|
|
6
|
-
/** Forward one browser events, claims or results request to the maintained host. */
|
|
7
|
-
fetch: (request: Request) => Promise<Response>;
|
|
8
|
-
}>;
|
|
9
|
-
export type BrowserLease = Readonly<{
|
|
10
|
-
host: BrowserHost;
|
|
11
|
-
release: () => void;
|
|
12
|
-
}>;
|
|
13
|
-
/** One ephemeral browser host per Session, borrowed by run and SSE scopes. */
|
|
14
|
-
export declare class BrowserSessions {
|
|
15
|
-
private readonly open;
|
|
16
|
-
private readonly hasSession;
|
|
17
|
-
private generation;
|
|
18
|
-
private closed;
|
|
19
|
-
private readonly hosts;
|
|
20
|
-
constructor(open: (sessionId: string) => BrowserHost, hasSession: (sessionId: string) => Promise<boolean>);
|
|
21
|
-
clear(): Promise<void>;
|
|
22
|
-
close(): Promise<void>;
|
|
23
|
-
fetch(request: Request): Promise<Response>;
|
|
24
|
-
/** Own the async transport opening until its stream joins the connection scope. */
|
|
25
|
-
private openEvents;
|
|
26
|
-
private createHost;
|
|
27
|
-
acquire(sessionId: string): BrowserLease;
|
|
28
|
-
private releaseBrowserConnection;
|
|
29
|
-
private releaseIdleHost;
|
|
30
|
-
private trackBrowserConnection;
|
|
31
|
-
}
|