@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
@@ -0,0 +1,485 @@
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) / delegation
8
+
9
+ # delegation
10
+
11
+ ## Classes
12
+
13
+ ### AgentDelegation
14
+
15
+ Host-owned identity and admission around BirdDog's ordinary envelope.
16
+
17
+ #### Constructors
18
+
19
+ ##### Constructor
20
+
21
+ ```ts
22
+ new AgentDelegation(deps): AgentDelegation;
23
+ ```
24
+
25
+ ###### Parameters
26
+
27
+ | Parameter | Type |
28
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `expiresAt`: () => `number`; `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `directory`: () => [`AgentControlDirectory`](agent-control.md#agentcontroldirectory); `deliver`: (`mail`) => `Promise`\<[`Accepted`](client.md#accepted)\>; `prepare`: (`mail`) => `Promise`\<`void`\>; `accept`: (`mail`, `reply?`) => `Promise`\<[`Accepted`](client.md#accepted)\>; \}\> |
30
+
31
+ ###### Returns
32
+
33
+ [`AgentDelegation`](#agentdelegation)
34
+
35
+ #### Methods
36
+
37
+ ##### settlement()
38
+
39
+ ```ts
40
+ settlement(
41
+ sender,
42
+ sessionId,
43
+ commandId,
44
+ host
45
+ ): Promise<
46
+ | Readonly<{
47
+ acceptedSender: string | null;
48
+ terminal: SessionTerminal;
49
+ content: string;
50
+ usage: readonly Pick<AssistantMessage, "model" | "provider" | "usage">[];
51
+ toolCalls: number;
52
+ }>
53
+ | undefined>;
54
+ ```
55
+
56
+ Recipient-local disclosure through the public host, never another Agent's RPC.
57
+
58
+ ###### Parameters
59
+
60
+ | Parameter | Type |
61
+ | ----------- | --------------------------------------------------------------------- |
62
+ | `sender` | [`DelegationIdentity`](#delegationidentity) |
63
+ | `sessionId` | `string` |
64
+ | `commandId` | `string` |
65
+ | `host` | `Pick`\<[`ShiitakeHost`](index.md#shiitakehost), `"readSettlement"`\> |
66
+
67
+ ###### Returns
68
+
69
+ `Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `terminal`:
70
+ [`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`:
71
+ readonly `Pick`\<`AssistantMessage`, `"model"` \| `"provider"` \| `"usage"`\>[];
72
+ `toolCalls`: `number`; \}\> \| `undefined`\>
73
+
74
+ ##### send()
75
+
76
+ ```ts
77
+ send(
78
+ input,
79
+ sourceSessionId,
80
+ signal,
81
+ invocation?
82
+ ): Promise<Readonly<{
83
+ status: "accepted";
84
+ commandId: string;
85
+ }>>;
86
+ ```
87
+
88
+ Delegate work to an in-scope Agent: steer its Session, or start fleet
89
+ correspondence.
90
+
91
+ ###### Parameters
92
+
93
+ | Parameter | Type |
94
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
95
+ | `input` | [`AgentDelegationInput`](agent-control.md#agentdelegationinput) |
96
+ | `sourceSessionId` | `string` |
97
+ | `signal` | `AbortSignal` |
98
+ | `invocation?` | `Readonly`\<\{ `toolCallId`: `string`; `sendIndex`: `number`; `commandId?`: `string`; `meta?`: `Json`; `toolCallCode?`: `string`; \}\> |
99
+
100
+ ###### Returns
101
+
102
+ `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\>
103
+
104
+ ##### recall()
105
+
106
+ ```ts
107
+ recall(
108
+ input,
109
+ sourceSessionId,
110
+ signal
111
+ ): Promise<CancelResult>;
112
+ ```
113
+
114
+ Resolve this sender's exact request, then let the recipient guard pending work.
115
+
116
+ ###### Parameters
117
+
118
+ | Parameter | Type |
119
+ | ----------------- | ------------------------------------------------------- |
120
+ | `input` | [`AgentRecallInput`](agent-control.md#agentrecallinput) |
121
+ | `sourceSessionId` | `string` |
122
+ | `signal` | `AbortSignal` |
123
+
124
+ ###### Returns
125
+
126
+ `Promise`\<[`CancelResult`](client.md#cancelresult)\>
127
+
128
+ ##### receive()
129
+
130
+ ```ts
131
+ receive(raw): Promise<PostDeliveryResult>;
132
+ ```
133
+
134
+ Admit one addressed Agent mail for this Agent, or refuse it.
135
+
136
+ ###### Parameters
137
+
138
+ | Parameter | Type |
139
+ | ------------- | ---------------------------------------------------------------------------------- |
140
+ | `raw` | \{ `key`: `string`; `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \} |
141
+ | `raw.key` | `string` |
142
+ | `raw.kind` | `string` |
143
+ | `raw.address` | `unknown` |
144
+ | `raw.event` | `unknown` |
145
+
146
+ ###### Returns
147
+
148
+ `Promise`\<`PostDeliveryResult`\>
149
+
150
+ ---
151
+
152
+ ### AgentDisclosureRefused
153
+
154
+ A current correspondent no longer has disclosure authority.
155
+
156
+ #### Extends
157
+
158
+ - `Error`
159
+
160
+ #### Constructors
161
+
162
+ ##### Constructor
163
+
164
+ ```ts
165
+ new AgentDisclosureRefused(): AgentDisclosureRefused;
166
+ ```
167
+
168
+ ###### Returns
169
+
170
+ [`AgentDisclosureRefused`](#agentdisclosurerefused)
171
+
172
+ ###### Overrides
173
+
174
+ ```ts
175
+ Error.constructor;
176
+ ```
177
+
178
+ ---
179
+
180
+ ### AgentMail
181
+
182
+ Recipient-owned replies and receipt-bearing submissions over the host's one Post
183
+ lane.
184
+
185
+ #### Constructors
186
+
187
+ ##### Constructor
188
+
189
+ ```ts
190
+ new AgentMail(deps): AgentMail;
191
+ ```
192
+
193
+ ###### Parameters
194
+
195
+ | Parameter | Type |
196
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197
+ | `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `post`: () => [`AgentMailPost`](#agentmailpost); `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `replySettlement`: [`AgentReplySettlement`](#agentreplysettlement); `drain`: () => `Promise`\<`void`\>; `wake`: () => `Promise`\<`void`\>; \}\> |
198
+
199
+ ###### Returns
200
+
201
+ [`AgentMail`](#agentmail)
202
+
203
+ #### Methods
204
+
205
+ ##### send()
206
+
207
+ ```ts
208
+ send(mail): Promise<Readonly<{
209
+ status: "accepted";
210
+ commandId: string;
211
+ }>>;
212
+ ```
213
+
214
+ Submit one mail and return the recipient's Accepted receipt.
215
+
216
+ ###### Parameters
217
+
218
+ | Parameter | Type |
219
+ | --------- | ------------- |
220
+ | `mail` | `BirdDogMail` |
221
+
222
+ ###### Returns
223
+
224
+ `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\>
225
+
226
+ ##### mailRoom()
227
+
228
+ ```ts
229
+ mailRoom(): BirdDogEffect;
230
+ ```
231
+
232
+ BirdDog's mail room: disclosed settlement replies fan out over Post.
233
+
234
+ ###### Returns
235
+
236
+ `BirdDogEffect`
237
+
238
+ ## Type Aliases
239
+
240
+ ### DelegationIdentity
241
+
242
+ ```ts
243
+ type DelegationIdentity = Readonly<{
244
+ scopeId: string;
245
+ agentId: string;
246
+ }>;
247
+ ```
248
+
249
+ Shiitake host-pack identity; core consumes OysterAgents, never this engine.
250
+
251
+ ---
252
+
253
+ ### AgentReplySettlement
254
+
255
+ ```ts
256
+ type AgentReplySettlement = (mail) => Promise<CommandSettlement | undefined>;
257
+ ```
258
+
259
+ Undefined is an explicit disclosure refusal; missing facts and read errors must
260
+ fail.
261
+
262
+ #### Parameters
263
+
264
+ | Parameter | Type |
265
+ | --------- | ------------- |
266
+ | `mail` | `BirdDogMail` |
267
+
268
+ #### Returns
269
+
270
+ `Promise`\<[`CommandSettlement`](index.md#commandsettlement) \| `undefined`\>
271
+
272
+ ---
273
+
274
+ ### AgentMailPost
275
+
276
+ ```ts
277
+ type AgentMailPost = Pick<
278
+ PostRuntime<{
279
+ agentMail: ReturnType<typeof agentMailRoute>;
280
+ }>,
281
+ "send" | "read" | "nextWake"
282
+ >;
283
+ ```
284
+
285
+ The host's one Post lane, as Agent mail borrows it.
286
+
287
+ ## Variables
288
+
289
+ ### machineAgentCodecs
290
+
291
+ ```ts
292
+ const machineAgentCodecs: object;
293
+ ```
294
+
295
+ The Agent wire decoders a host lends Oyster's machine-link client, so the device
296
+ link routes Agent work without owning Shiitake's grammar.
297
+
298
+ #### Type Declaration
299
+
300
+ | Name | Type | Description |
301
+ | ------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
302
+ | `sessionCreation()` | (`body`) => \| `Readonly`\<\{ `requestId`: `string`; \}\> \| `null` | The Session-creation intent, or null when the body is not one. |
303
+ | `settlement()` | (`encoded`) => [`CommandSettlement`](index.md#commandsettlement) | One serialized settlement from a hosted or machine-homed Agent. |
304
+ | `accepted()` | (`receipt`) => `void` | Throws unless an acknowledgment carries a well-formed Accepted receipt. |
305
+
306
+ ## Functions
307
+
308
+ ### agentMailRoute()
309
+
310
+ ```ts
311
+ function agentMailRoute(namespace, replySettlement): PostRoute<AgentMailAddress, {
312
+ key: string;
313
+ to: {
314
+ kind: "agent";
315
+ agentId: string;
316
+ sessionId: string;
317
+ };
318
+ from: {
319
+ kind: "agent";
320
+ agentId: string;
321
+ sessionId: string;
322
+ };
323
+ replyTo: readonly object[];
324
+ content: string;
325
+ createdAt: number;
326
+ meta?: Json | undefined;
327
+ reply?: {
328
+ commandId: string;
329
+ outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
330
+ diagnostic?: string;
331
+ };
332
+ }, {
333
+ key: string;
334
+ to: {
335
+ kind: "agent";
336
+ agentId: string;
337
+ sessionId: string;
338
+ };
339
+ from: {
340
+ kind: "agent";
341
+ agentId: string;
342
+ sessionId: string;
343
+ };
344
+ replyTo: readonly object[];
345
+ content: string;
346
+ createdAt: number;
347
+ meta?: Json | undefined;
348
+ reply?: {
349
+ commandId: string;
350
+ outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
351
+ diagnostic?: string;
352
+ };
353
+ }, AgentMailAddress, {
354
+ key: string;
355
+ to: {
356
+ kind: "agent";
357
+ agentId: string;
358
+ sessionId: string;
359
+ };
360
+ from: {
361
+ kind: "agent";
362
+ agentId: string;
363
+ sessionId: string;
364
+ };
365
+ replyTo: readonly object[];
366
+ content: string;
367
+ createdAt: number;
368
+ meta?: Json | undefined;
369
+ reply?: {
370
+ commandId: string;
371
+ outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
372
+ diagnostic?: string;
373
+ };
374
+ }, {
375
+ key: string;
376
+ to: {
377
+ kind: "agent";
378
+ agentId: string;
379
+ sessionId: string;
380
+ };
381
+ from: {
382
+ kind: "agent";
383
+ agentId: string;
384
+ sessionId: string;
385
+ };
386
+ replyTo: readonly object[];
387
+ content: string;
388
+ createdAt: number;
389
+ meta?: Json | undefined;
390
+ reply?: {
391
+ commandId: string;
392
+ outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
393
+ diagnostic?: string;
394
+ };
395
+ }> & Omit<Readonly<{
396
+ addressKind: string;
397
+ address: Codec<unknown, unknown>;
398
+ event: Codec<unknown, unknown>;
399
+ encodeEnvelope: (envelope) => object;
400
+ parseDelivery: (envelope) => object;
401
+ prepareEnvelope?: (envelope, signal) => Promise<{
402
+ key: string;
403
+ kind: string;
404
+ address: unknown;
405
+ event: unknown;
406
+ }>;
407
+ recordDelivered?: (envelope) => void;
408
+ nameOf: (envelope) => string;
409
+ namespace: Readonly<{
410
+ getByName: (name) => Readonly<{
411
+ deliver: (envelope) => Promise<...>;
412
+ }>;
413
+ }>;
414
+ recordCursor?: (envelope, cursor) => void;
415
+ recordRefused?: (envelope) => void;
416
+ }>, "event" | "address">;
417
+ ```
418
+
419
+ Current disclosure admission runs at every transport attempt, including frozen
420
+ retries.
421
+
422
+ #### Parameters
423
+
424
+ | Parameter | Type |
425
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
426
+ | `namespace` | `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<`PostDeliveryResult`\>; \}\>; \}\> |
427
+ | `replySettlement` | [`AgentReplySettlement`](#agentreplysettlement) |
428
+
429
+ #### Returns
430
+
431
+ `PostRoute`\<`AgentMailAddress`, \{ `key`: `string`; `to`: \{ `kind`: `"agent"`;
432
+ `agentId`: `string`; `sessionId`: `string`; \}; `from`: \{ `kind`: `"agent"`;
433
+ `agentId`: `string`; `sessionId`: `string`; \}; `replyTo`: readonly `object`[];
434
+ `content`: `string`; `createdAt`: `number`; `meta?`: Json \| undefined;
435
+ `reply?`: \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \|
436
+ `"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`:
437
+ `string`; \}; \}, \{ `key`: `string`; `to`: \{ `kind`: `"agent"`; `agentId`:
438
+ `string`; `sessionId`: `string`; \}; `from`: \{ `kind`: `"agent"`; `agentId`:
439
+ `string`; `sessionId`: `string`; \}; `replyTo`: readonly `object`[]; `content`:
440
+ `string`; `createdAt`: `number`; `meta?`: Json \| undefined; `reply?`: \{
441
+ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"`
442
+ \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; \}; \},
443
+ `AgentMailAddress`, \{ `key`: `string`; `to`: \{ `kind`: `"agent"`; `agentId`:
444
+ `string`; `sessionId`: `string`; \}; `from`: \{ `kind`: `"agent"`; `agentId`:
445
+ `string`; `sessionId`: `string`; \}; `replyTo`: readonly `object`[]; `content`:
446
+ `string`; `createdAt`: `number`; `meta?`: Json \| undefined; `reply?`: \{
447
+ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"`
448
+ \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; \}; \}, \{
449
+ `key`: `string`; `to`: \{ `kind`: `"agent"`; `agentId`: `string`; `sessionId`:
450
+ `string`; \}; `from`: \{ `kind`: `"agent"`; `agentId`: `string`; `sessionId`:
451
+ `string`; \}; `replyTo`: readonly `object`[]; `content`: `string`; `createdAt`:
452
+ `number`; `meta?`: Json \| undefined; `reply?`: \{ `commandId`: `string`;
453
+ `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \|
454
+ `"outcome_unknown"`; `diagnostic?`: `string`; \}; \}\> & `Omit`\<`Readonly`\<\{
455
+ `addressKind`: `string`; `address`: `Codec`\<`unknown`, `unknown`\>; `event`:
456
+ `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`: (`envelope`) => `object`;
457
+ `parseDelivery`: (`envelope`) => `object`; `prepareEnvelope?`: (`envelope`,
458
+ `signal`) => `Promise`\<\{ `key`: `string`; `kind`: `string`; `address`:
459
+ `unknown`; `event`: `unknown`; \}\>; `recordDelivered?`: (`envelope`) => `void`;
460
+ `nameOf`: (`envelope`) => `string`; `namespace`: `Readonly`\<\{ `getByName`:
461
+ (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<...\>; \}\>;
462
+ \}\>; `recordCursor?`: (`envelope`, `cursor`) => `void`; `recordRefused?`:
463
+ (`envelope`) => `void`; \}\>, `"event"` \| `"address"`\>
464
+
465
+ ---
466
+
467
+ ### machineAgentReservations()
468
+
469
+ ```ts
470
+ function machineAgentReservations(sql): (reservation) => object;
471
+ ```
472
+
473
+ Machine-homed Agent identities in the ordinary directory over the enrollment's
474
+ own store: one Team identity per enrollment receipt, reserved without opening a
475
+ hosted Agent. The enrolling member is the grant actor.
476
+
477
+ #### Parameters
478
+
479
+ | Parameter | Type |
480
+ | --------- | ----------------------------------------------------------------------------------- |
481
+ | `sql` | `Readonly`\<\{ `exec`: (`statement`, ...`bindings`) => `WatchdogSqliteCursor`; \}\> |
482
+
483
+ #### Returns
484
+
485
+ (`reservation`) => `object`
@@ -34,6 +34,8 @@ type ModelAcquisitionEffect = Readonly<{
34
34
  model: Model<Api>;
35
35
  stream?: MuleStreamFunction;
36
36
  retryAfterMs?: (message) => number | undefined;
37
+ retryable: (message) => boolean;
38
+ failureReason?: (message) => string | undefined;
37
39
  release: Effect.Effect<void, ShiitakeError>;
38
40
  }>;
39
41
  ```
@@ -110,7 +112,7 @@ Effect-native owner for scheduling the opaque durable reconciler.
110
112
  type ShiitakeEffectOptions = Readonly<{
111
113
  meta?: HostMetaOptions;
112
114
  store: SqliteOwner;
113
- storageBudget?: StorageBudget;
115
+ storagePressure?: StoragePressureCheck;
114
116
  compaction?: CompactionOptions;
115
117
  hostJobs?: Readonly<{
116
118
  lane: string;
@@ -309,9 +311,11 @@ Delivery intent and an optional private retry key for Effect-native sending.
309
311
  ```ts
310
312
  type ShiitakeEffectSession = Readonly<{
311
313
  command: ShiitakeEffectCommandHandler;
314
+ withdraw: (requestId) => Effect.Effect<WithdrawResult, ShiitakeError>;
312
315
  abort: Effect.Effect<void, ShiitakeError>;
313
316
  send: (text, options?) => Effect.Effect<Accepted, ShiitakeError>;
314
317
  cancel: (input) => Effect.Effect<CancelResult, ShiitakeError>;
318
+ latestPending: Effect.Effect<SessionPendingPrompt | null, ShiitakeError>;
315
319
  extension: (extensionId) => ShiitakeEffectSessionExtension;
316
320
  modelPreference: Readonly<{
317
321
  read: Effect.Effect<ModelPreference | null, ShiitakeError>;
@@ -375,6 +379,13 @@ Effect-native durable harness.
375
379
  ```ts
376
380
  type ShiitakeEffectOwner = ShiitakeEffectAgent &
377
381
  Readonly<{
382
+ prepareConfiguration: (configuration) => Effect.Effect<
383
+ Readonly<{
384
+ commit: Effect.Effect<void, ShiitakeError>;
385
+ discard: Effect.Effect<void>;
386
+ }>,
387
+ ShiitakeError
388
+ >;
378
389
  grants: Readonly<{
379
390
  deliver: (
380
391
  sessionId,
@@ -465,6 +476,7 @@ Construct the canonical Effect-native Shiitake scaffold.
465
476
  function openHost(options, mailRoom): Effect<Readonly<{
466
477
  readSettlement: (sessionId, commandId) => Effect<
467
478
  | Readonly<{
479
+ acceptedSender: string | null;
468
480
  terminal: SessionTerminal;
469
481
  content: string;
470
482
  usage: readonly Pick<AssistantMessage, ... | ... | ...>[];
@@ -491,7 +503,7 @@ Open the Effect-native host composition with addressed mail.
491
503
  #### Returns
492
504
 
493
505
  `Effect`\<`Readonly`\<\{ `readSettlement`: (`sessionId`, `commandId`) =>
494
- `Effect`\< \| `Readonly`\<\{ `terminal`:
506
+ `Effect`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `terminal`:
495
507
  [`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`:
496
508
  readonly `Pick`\<`AssistantMessage`, ... \| ... \| ...\>[]; `toolCalls`:
497
509
  `number`; \}\> \| `undefined`, [`ShiitakeError`](index.md#shiitakeerror)\>;
@@ -633,6 +645,12 @@ Re-exports [SessionProgress](client.md#sessionprogress)
633
645
 
634
646
  ---
635
647
 
648
+ ### SessionToolOutput
649
+
650
+ Re-exports [SessionToolOutput](client.md#sessiontooloutput)
651
+
652
+ ---
653
+
636
654
  ### SessionSnapshot
637
655
 
638
656
  Re-exports [SessionSnapshot](client.md#sessionsnapshot)
@@ -93,8 +93,8 @@ Durable record failure: stored or supplied values broke their schema or bounds.
93
93
  #### Extends
94
94
 
95
95
  - `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `reason`:
96
- `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"`; `message`: `string`;
97
- \}\>
96
+ `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"` \|
97
+ `"session_absent"`; `message`: `string`; \}\>
98
98
 
99
99
  #### Constructors
100
100
 
@@ -106,11 +106,11 @@ new ExtensionStateError(args): ExtensionStateError;
106
106
 
107
107
  ###### Parameters
108
108
 
109
- | Parameter | Type |
110
- | -------------- | ---------------------------------------------------------------------------------------------- |
111
- | `args` | \{ `reason`: `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"`; `message`: `string`; \} |
112
- | `args.reason` | `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"` |
113
- | `args.message` | `string` |
109
+ | Parameter | Type |
110
+ | -------------- | -------------------------------------------------------------------------------------------------------------------- |
111
+ | `args` | \{ `reason`: `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"` \| `"session_absent"`; `message`: `string`; \} |
112
+ | `args.reason` | `"unavailable"` \| `"decode"` \| `"encode"` \| `"bound"` \| `"session_absent"` |
113
+ | `args.message` | `string` |
114
114
 
115
115
  ###### Returns
116
116
 
@@ -122,7 +122,7 @@ new ExtensionStateError(args): ExtensionStateError;
122
122
  Data.TaggedError(
123
123
  "ExtensionStateError",
124
124
  )<{
125
- reason: "decode" | "encode" | "bound" | "unavailable";
125
+ reason: "decode" | "encode" | "bound" | "unavailable" | "session_absent";
126
126
  message: string;
127
127
  }>.constructor
128
128
  ```
@@ -132,7 +132,7 @@ Data.TaggedError(
132
132
  ##### reason
133
133
 
134
134
  ```ts
135
- readonly reason: "unavailable" | "decode" | "encode" | "bound";
135
+ readonly reason: "unavailable" | "decode" | "encode" | "bound" | "session_absent";
136
136
  ```
137
137
 
138
138
  ###### Inherited from
@@ -1221,6 +1221,9 @@ type ExtensionContextV0<S, Config, D> = Readonly<{
1221
1221
  send: (input) => Effect.Effect<SendResultV0, AdmissionError, ExtensionTx>;
1222
1222
  timers: TimersV0;
1223
1223
  attention: AttentionV0;
1224
+ sessionPosition: (
1225
+ sessionId,
1226
+ ) => Effect.Effect<number, ExtensionStateError, ExtensionRead>;
1224
1227
  hasPendingSteer: (
1225
1228
  run,
1226
1229
  ) => Effect.Effect<boolean, ExtensionStateError, ExtensionRead>;
@@ -1632,6 +1635,7 @@ One extension's encoded slot in a Session snapshot or frame.
1632
1635
 
1633
1636
  ```ts
1634
1637
  type BorrowedCompactionViewV0 = Readonly<{
1638
+ sessionId: string;
1635
1639
  messagesToSummarize: readonly Message[];
1636
1640
  turnPrefixMessages: readonly Message[];
1637
1641
  result: Readonly<{
@@ -1899,10 +1903,12 @@ const AttentionItemSchema: Struct<{
1899
1903
  summary: NonEmptyString;
1900
1904
  since: Int;
1901
1905
  expiresAt: optional<Int>;
1906
+ inbox: optional<Literal<false>>;
1902
1907
  }>;
1903
1908
  ```
1904
1909
 
1905
1910
  An extension-owned request for human attention; expiry is owned by its timer.
1911
+ Items marked `inbox: false` remain visible without changing the inbox state.
1906
1912
 
1907
1913
  ## Functions
1908
1914
 
@@ -1992,6 +1998,12 @@ Re-exports [SessionAttention](client.md#sessionattention)
1992
1998
 
1993
1999
  ---
1994
2000
 
2001
+ ### ClientActivityStateV0
2002
+
2003
+ Re-exports [ClientActivityStateV0](client-entry.md#clientactivitystatev0)
2004
+
2005
+ ---
2006
+
1995
2007
  ### ClientActivityV0
1996
2008
 
1997
2009
  Re-exports [ClientActivityV0](client-entry.md#clientactivityv0)