@fungi.computer/shiitake 0.0.0-stage → 0.1.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 (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +454 -2
  3. package/dist/agar-extension.d.ts +9 -0
  4. package/dist/agar-extension.js +38 -0
  5. package/dist/agent-control.d.ts +77 -0
  6. package/dist/agent-control.js +434 -0
  7. package/dist/client-entry.d.ts +211 -0
  8. package/dist/client-entry.js +101 -0
  9. package/dist/client-wire.d.ts +199 -0
  10. package/dist/client-wire.js +271 -0
  11. package/dist/client.d.ts +439 -0
  12. package/dist/client.js +4 -0
  13. package/dist/cloudflare.d.ts +220 -0
  14. package/dist/cloudflare.js +531 -0
  15. package/dist/effect.d.ts +42 -0
  16. package/dist/effect.js +20 -0
  17. package/dist/errors.d.ts +50 -0
  18. package/dist/errors.js +81 -0
  19. package/dist/extension-client.d.ts +38 -0
  20. package/dist/extension-client.js +56 -0
  21. package/dist/extension-contract.d.ts +73 -0
  22. package/dist/extension-contract.js +11 -0
  23. package/dist/extensions.d.ts +589 -0
  24. package/dist/extensions.js +263 -0
  25. package/dist/fleet.d.ts +313 -0
  26. package/dist/fleet.js +540 -0
  27. package/dist/hosted.d.ts +133 -0
  28. package/dist/hosted.js +265 -0
  29. package/dist/http-routes.d.ts +772 -0
  30. package/dist/http-routes.js +242 -0
  31. package/dist/http.d.ts +1 -0
  32. package/dist/http.js +1 -0
  33. package/dist/index.d.ts +35 -0
  34. package/dist/index.js +13 -0
  35. package/dist/internal/accepted-run-executor.d.ts +23 -0
  36. package/dist/internal/accepted-run-executor.js +129 -0
  37. package/dist/internal/admission-door.d.ts +75 -0
  38. package/dist/internal/admission-door.js +105 -0
  39. package/dist/internal/agent-close.d.ts +4 -0
  40. package/dist/internal/agent-close.js +42 -0
  41. package/dist/internal/browser-sessions.d.ts +31 -0
  42. package/dist/internal/browser-sessions.js +173 -0
  43. package/dist/internal/client-boundary.d.ts +262 -0
  44. package/dist/internal/client-boundary.js +202 -0
  45. package/dist/internal/compaction/compaction.d.ts +54 -0
  46. package/dist/internal/compaction/compaction.js +291 -0
  47. package/dist/internal/compaction/session-compaction.d.ts +69 -0
  48. package/dist/internal/compaction/session-compaction.js +330 -0
  49. package/dist/internal/compaction/settings.d.ts +11 -0
  50. package/dist/internal/compaction/settings.js +40 -0
  51. package/dist/internal/compaction/utils.d.ts +45 -0
  52. package/dist/internal/compaction/utils.js +319 -0
  53. package/dist/internal/contracts.d.ts +235 -0
  54. package/dist/internal/contracts.js +1 -0
  55. package/dist/internal/coordinator.d.ts +18 -0
  56. package/dist/internal/coordinator.js +362 -0
  57. package/dist/internal/document-codec.d.ts +11 -0
  58. package/dist/internal/document-codec.js +39 -0
  59. package/dist/internal/effect-client.d.ts +13 -0
  60. package/dist/internal/effect-client.js +102 -0
  61. package/dist/internal/effect-contracts.d.ts +236 -0
  62. package/dist/internal/effect-contracts.js +2 -0
  63. package/dist/internal/extension-command-registry.d.ts +11 -0
  64. package/dist/internal/extension-command-registry.js +29 -0
  65. package/dist/internal/extension-command-tools.d.ts +17 -0
  66. package/dist/internal/extension-command-tools.js +50 -0
  67. package/dist/internal/extension-context.d.ts +25 -0
  68. package/dist/internal/extension-context.js +35 -0
  69. package/dist/internal/extension-definitions.d.ts +5 -0
  70. package/dist/internal/extension-definitions.js +6 -0
  71. package/dist/internal/extension-hook.d.ts +25 -0
  72. package/dist/internal/extension-hook.js +46 -0
  73. package/dist/internal/extension-roster.d.ts +23 -0
  74. package/dist/internal/extension-roster.js +228 -0
  75. package/dist/internal/extension-runtime.d.ts +63 -0
  76. package/dist/internal/extension-runtime.js +1004 -0
  77. package/dist/internal/failure.d.ts +2 -0
  78. package/dist/internal/failure.js +9 -0
  79. package/dist/internal/host-meta.d.ts +41 -0
  80. package/dist/internal/host-meta.js +39 -0
  81. package/dist/internal/json-value.d.ts +4 -0
  82. package/dist/internal/json-value.js +3 -0
  83. package/dist/internal/model-acquisition.d.ts +21 -0
  84. package/dist/internal/model-acquisition.js +98 -0
  85. package/dist/internal/model-preference.d.ts +21 -0
  86. package/dist/internal/model-preference.js +20 -0
  87. package/dist/internal/observation-kernel.d.ts +28 -0
  88. package/dist/internal/observation-kernel.js +169 -0
  89. package/dist/internal/promise-facade.d.ts +18 -0
  90. package/dist/internal/promise-facade.js +172 -0
  91. package/dist/internal/run-scope.d.ts +27 -0
  92. package/dist/internal/run-scope.js +214 -0
  93. package/dist/internal/runtime-coordinator.d.ts +34 -0
  94. package/dist/internal/runtime-coordinator.js +233 -0
  95. package/dist/internal/runtime-core.d.ts +19 -0
  96. package/dist/internal/runtime-core.js +39 -0
  97. package/dist/internal/runtime-reconciliation.d.ts +18 -0
  98. package/dist/internal/runtime-reconciliation.js +162 -0
  99. package/dist/internal/session-context.d.ts +11 -0
  100. package/dist/internal/session-context.js +67 -0
  101. package/dist/internal/session-status.d.ts +10 -0
  102. package/dist/internal/session-status.js +52 -0
  103. package/dist/internal/woodstock/agent-reply.d.ts +25 -0
  104. package/dist/internal/woodstock/agent-reply.js +67 -0
  105. package/dist/internal/woodstock/client-projection.d.ts +29 -0
  106. package/dist/internal/woodstock/client-projection.js +512 -0
  107. package/dist/internal/woodstock/compaction-activity.d.ts +17 -0
  108. package/dist/internal/woodstock/compaction-activity.js +32 -0
  109. package/dist/internal/woodstock/cursor.d.ts +9 -0
  110. package/dist/internal/woodstock/cursor.js +44 -0
  111. package/dist/internal/woodstock/extension-store.d.ts +72 -0
  112. package/dist/internal/woodstock/extension-store.js +262 -0
  113. package/dist/internal/woodstock/fleet-store.d.ts +36 -0
  114. package/dist/internal/woodstock/fleet-store.js +100 -0
  115. package/dist/internal/woodstock/identities.d.ts +6 -0
  116. package/dist/internal/woodstock/identities.js +11 -0
  117. package/dist/internal/woodstock/index.d.ts +170 -0
  118. package/dist/internal/woodstock/index.js +546 -0
  119. package/dist/internal/woodstock/progress.d.ts +32 -0
  120. package/dist/internal/woodstock/progress.js +89 -0
  121. package/dist/internal/woodstock/run-recovery.d.ts +8 -0
  122. package/dist/internal/woodstock/run-recovery.js +95 -0
  123. package/dist/internal/woodstock/session-attention.d.ts +16 -0
  124. package/dist/internal/woodstock/session-attention.js +88 -0
  125. package/dist/internal/woodstock/session-documents.d.ts +18 -0
  126. package/dist/internal/woodstock/session-documents.js +51 -0
  127. package/dist/internal/woodstock/session-entry.d.ts +478 -0
  128. package/dist/internal/woodstock/session-entry.js +484 -0
  129. package/dist/internal/woodstock/session-grants.d.ts +24 -0
  130. package/dist/internal/woodstock/session-grants.js +84 -0
  131. package/dist/internal/woodstock/session-inbox.d.ts +56 -0
  132. package/dist/internal/woodstock/session-inbox.js +307 -0
  133. package/dist/internal/woodstock/session-store.d.ts +432 -0
  134. package/dist/internal/woodstock/session-store.js +2006 -0
  135. package/dist/internal/woodstock/storage-admission.d.ts +14 -0
  136. package/dist/internal/woodstock/storage-admission.js +44 -0
  137. package/dist/model-preference.d.ts +20 -0
  138. package/dist/model-preference.js +30 -0
  139. package/dist/node.d.ts +64 -0
  140. package/dist/node.js +256 -0
  141. package/dist/remote-client.d.ts +11 -0
  142. package/dist/remote-client.js +298 -0
  143. package/dist/session-attention.d.ts +35 -0
  144. package/dist/session-attention.js +22 -0
  145. package/dist/session-documents.d.ts +28 -0
  146. package/dist/session-documents.js +1 -0
  147. package/dist/testing.d.ts +54 -0
  148. package/dist/testing.js +215 -0
  149. package/docs/api/README.md +26 -0
  150. package/docs/api/agar-extension.md +40 -0
  151. package/docs/api/agent-control.md +151 -0
  152. package/docs/api/client-entry.md +344 -0
  153. package/docs/api/client.md +1112 -0
  154. package/docs/api/cloudflare.md +500 -0
  155. package/docs/api/effect.md +884 -0
  156. package/docs/api/extensions.md +2003 -0
  157. package/docs/api/fleet.md +734 -0
  158. package/docs/api/hosted.md +382 -0
  159. package/docs/api/http.md +111 -0
  160. package/docs/api/index.md +1116 -0
  161. package/docs/api/model-preference.md +151 -0
  162. package/docs/api/node.md +142 -0
  163. package/docs/api/testing.md +250 -0
  164. package/package.json +130 -3
@@ -0,0 +1,884 @@
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) / effect
8
+
9
+ # effect
10
+
11
+ ## Type Aliases
12
+
13
+ ### ShiitakeEffectHost
14
+
15
+ ```ts
16
+ type ShiitakeEffectHost = Readonly<{
17
+ readSettlement: (
18
+ sessionId,
19
+ commandId,
20
+ ) => Effect.Effect<CommandSettlement | undefined, ShiitakeError>;
21
+ agent: ShiitakeEffectOwner;
22
+ acceptMail: (mail, meta?, reply?) => Effect.Effect<Accepted, ShiitakeError>;
23
+ }>;
24
+ ```
25
+
26
+ Effect-native host composition with addressed mail kept off Session.
27
+
28
+ ---
29
+
30
+ ### ModelAcquisitionEffect
31
+
32
+ ```ts
33
+ type ModelAcquisitionEffect = Readonly<{
34
+ model: Model<Api>;
35
+ stream?: MuleStreamFunction;
36
+ retryAfterMs?: (message) => number | undefined;
37
+ release: Effect.Effect<void, ShiitakeError>;
38
+ }>;
39
+ ```
40
+
41
+ Effect-native acquired Pi model and finalizer.
42
+
43
+ ---
44
+
45
+ ### ModelSourceEffect
46
+
47
+ ```ts
48
+ type ModelSourceEffect = Readonly<{
49
+ acquire: (input) => Effect.Effect<ModelAcquisitionEffect, ShiitakeError>;
50
+ describe?: (input) => Effect.Effect<ModelDescription, ShiitakeError>;
51
+ }>;
52
+ ```
53
+
54
+ Effect-native model acquisition owner.
55
+
56
+ ---
57
+
58
+ ### InstructionSourceEffect
59
+
60
+ ```ts
61
+ type InstructionSourceEffect = Readonly<{
62
+ load: (
63
+ input,
64
+ ) => Effect.Effect<InstructionSnapshot, ShiitakeError, Scope.Scope>;
65
+ }>;
66
+ ```
67
+
68
+ Effect-native instruction snapshot owner.
69
+
70
+ ---
71
+
72
+ ### ToolSourceEffect
73
+
74
+ ```ts
75
+ type ToolSourceEffect = Readonly<{
76
+ execution?: ExecutionOptions;
77
+ modules: readonly ModuleRegistration[];
78
+ sources: readonly CapabilitySource[];
79
+ sandbox: Sandbox;
80
+ access?: ToolAccess;
81
+ }>;
82
+ ```
83
+
84
+ Effect-native Mycelium construction inputs.
85
+
86
+ ---
87
+
88
+ ### RuntimeHostEffect
89
+
90
+ ```ts
91
+ type RuntimeHostEffect = Readonly<{
92
+ bind: (input) => Effect.Effect<
93
+ Readonly<{
94
+ commit: <A>(mutation) => Effect.Effect<A, ShiitakeError>;
95
+ requestWake: Effect.Effect<void, ShiitakeError>;
96
+ close: Effect.Effect<void, ShiitakeError>;
97
+ }>,
98
+ ShiitakeError
99
+ >;
100
+ }>;
101
+ ```
102
+
103
+ Effect-native owner for scheduling the opaque durable reconciler.
104
+
105
+ ---
106
+
107
+ ### ShiitakeEffectOptions
108
+
109
+ ```ts
110
+ type ShiitakeEffectOptions = Readonly<{
111
+ meta?: HostMetaOptions;
112
+ store: SqliteOwner;
113
+ storageBudget?: StorageBudget;
114
+ compaction?: CompactionOptions;
115
+ hostJobs?: Readonly<{
116
+ lane: string;
117
+ open: (runtime) => Readonly<{
118
+ execute: (job) => Effect.Effect<WatchdogExecutionDecision, WatchdogError>;
119
+ }>;
120
+ }>;
121
+ model: ModelSourceEffect;
122
+ instructions: InstructionSourceEffect;
123
+ tools?: ToolSourceEffect;
124
+ runtime: RuntimeHostEffect;
125
+ extensions: ExtensionRosterV0;
126
+ retry?: RetryPolicy;
127
+ modelStreamIdleTimeoutMs?: number;
128
+ }>;
129
+ ```
130
+
131
+ Validated construction bag for owned Effect composition.
132
+
133
+ ---
134
+
135
+ ### ShiitakeEffectWatch
136
+
137
+ ```ts
138
+ type ShiitakeEffectWatch = Readonly<{
139
+ snapshot: SessionSnapshot;
140
+ changes: Stream.Stream<SessionFrame, ShiitakeError>;
141
+ close: Effect.Effect<void, ShiitakeError>;
142
+ }>;
143
+ ```
144
+
145
+ Effect-native race-safe watch result.
146
+
147
+ ---
148
+
149
+ ### ShiitakeEffectCommandHandler
150
+
151
+ ```ts
152
+ type ShiitakeEffectCommandHandler = {
153
+ (input): Effect<
154
+ Readonly<{
155
+ status: "accepted";
156
+ commandId: string;
157
+ }>,
158
+ ShiitakeError
159
+ >;
160
+ (input): Effect<CancelResult, ShiitakeError>;
161
+ (input): Effect<undefined, ShiitakeError>;
162
+ (input): Effect<
163
+ Readonly<{
164
+ sessionId: string;
165
+ }>,
166
+ ShiitakeError
167
+ >;
168
+ (input): Effect<
169
+ | CancelResult
170
+ | Readonly<{
171
+ sessionId: string;
172
+ }>
173
+ | undefined,
174
+ ShiitakeError
175
+ >;
176
+ };
177
+ ```
178
+
179
+ Effect-native addressable Session handle.
180
+
181
+ #### Call Signature
182
+
183
+ ```ts
184
+ (input): Effect<Readonly<{
185
+ status: "accepted";
186
+ commandId: string;
187
+ }>, ShiitakeError>;
188
+ ```
189
+
190
+ Accept one durable prompt command.
191
+
192
+ ##### Parameters
193
+
194
+ | Parameter | Type |
195
+ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196
+ | `input` | \| \{ `delivery`: `"followUp"` \| `"steer"`; `requestId`: `string`; `type`: `"prompt"`; `text`: `string`; `images?`: readonly `object`[]; \} \| \{ `type`: `"compact"`; `requestId`: `string`; `instructions?`: `string`; \} |
197
+
198
+ ##### Returns
199
+
200
+ `Effect`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>,
201
+ [`ShiitakeError`](index.md#shiitakeerror)\>
202
+
203
+ #### Call Signature
204
+
205
+ ```ts
206
+ (input): Effect<CancelResult, ShiitakeError>;
207
+ ```
208
+
209
+ Cancel one accepted command, or report that it is too late.
210
+
211
+ ##### Parameters
212
+
213
+ | Parameter | Type |
214
+ | ---------------------- | ----------------------------------------------------------------------------- |
215
+ | `input` | \{ `commandId`: `string`; `onlyIfPending?`: `boolean`; `type`: `"cancel"`; \} |
216
+ | `input.commandId` | `string` |
217
+ | `input.onlyIfPending?` | `boolean` |
218
+ | `input.type` | `"cancel"` |
219
+
220
+ ##### Returns
221
+
222
+ `Effect`\<[`CancelResult`](client.md#cancelresult),
223
+ [`ShiitakeError`](index.md#shiitakeerror)\>
224
+
225
+ #### Call Signature
226
+
227
+ ```ts
228
+ (input): Effect<undefined, ShiitakeError>;
229
+ ```
230
+
231
+ Abort the active run, select a lineage leaf, or record an operator line.
232
+
233
+ ##### Parameters
234
+
235
+ | Parameter | Type |
236
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
+ | `input` | \| \{ `type`: `"abort"`; \} \| \{ `type`: `"branch"`; `entryId`: `string`; \} \| \{ `type`: `"operator"`; `requestId`: `string`; `author`: `"operator"` \| `"party"`; `text`: `string`; \} \| \{ `type`: `"title"`; `title`: `string` \| `null`; \} |
238
+
239
+ ##### Returns
240
+
241
+ `Effect`\<`undefined`, [`ShiitakeError`](index.md#shiitakeerror)\>
242
+
243
+ #### Call Signature
244
+
245
+ ```ts
246
+ (input): Effect<Readonly<{
247
+ sessionId: string;
248
+ }>, ShiitakeError>;
249
+ ```
250
+
251
+ Fork one complete entry lineage into a new Session.
252
+
253
+ ##### Parameters
254
+
255
+ | Parameter | Type |
256
+ | --------------- | -------------------------------------------- |
257
+ | `input` | \{ `type`: `"fork"`; `entryId`: `string`; \} |
258
+ | `input.type` | `"fork"` |
259
+ | `input.entryId` | `string` |
260
+
261
+ ##### Returns
262
+
263
+ `Effect`\<`Readonly`\<\{ `sessionId`: `string`; \}\>,
264
+ [`ShiitakeError`](index.md#shiitakeerror)\>
265
+
266
+ #### Call Signature
267
+
268
+ ```ts
269
+ (input): Effect<
270
+ | CancelResult
271
+ | Readonly<{
272
+ sessionId: string;
273
+ }>
274
+ | undefined, ShiitakeError>;
275
+ ```
276
+
277
+ Execute an already-decoded command union.
278
+
279
+ ##### Parameters
280
+
281
+ | Parameter | Type |
282
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
283
+ | `input` | \| \{ `delivery`: `"followUp"` \| `"steer"`; `requestId`: `string`; `type`: `"prompt"`; `text`: `string`; `images?`: readonly `object`[]; \} \| \{ `type`: `"abort"`; \} \| \{ `commandId`: `string`; `onlyIfPending?`: `boolean`; `type`: `"cancel"`; \} \| \{ `type`: `"branch"`; `entryId`: `string`; \} \| \{ `type`: `"fork"`; `entryId`: `string`; \} \| \{ `type`: `"operator"`; `requestId`: `string`; `author`: `"operator"` \| `"party"`; `text`: `string`; \} \| \{ `type`: `"compact"`; `requestId`: `string`; `instructions?`: `string`; \} \| \{ `type`: `"title"`; `title`: `string` \| `null`; \} |
284
+
285
+ ##### Returns
286
+
287
+ `Effect`\< \| [`CancelResult`](client.md#cancelresult) \| `Readonly`\<\{
288
+ `sessionId`: `string`; \}\> \| `undefined`,
289
+ [`ShiitakeError`](index.md#shiitakeerror)\>
290
+
291
+ ---
292
+
293
+ ### ShiitakeEffectSendOptions
294
+
295
+ ```ts
296
+ type ShiitakeEffectSendOptions = Readonly<{
297
+ images?: PromptCommand["images"];
298
+ delivery?: PromptDelivery;
299
+ requestId?: string;
300
+ }>;
301
+ ```
302
+
303
+ Delivery intent and an optional private retry key for Effect-native sending.
304
+
305
+ ---
306
+
307
+ ### ShiitakeEffectSession
308
+
309
+ ```ts
310
+ type ShiitakeEffectSession = Readonly<{
311
+ command: ShiitakeEffectCommandHandler;
312
+ abort: Effect.Effect<void, ShiitakeError>;
313
+ send: (text, options?) => Effect.Effect<Accepted, ShiitakeError>;
314
+ cancel: (input) => Effect.Effect<CancelResult, ShiitakeError>;
315
+ extension: (extensionId) => ShiitakeEffectSessionExtension;
316
+ modelPreference: Readonly<{
317
+ read: Effect.Effect<ModelPreference | null, ShiitakeError>;
318
+ set: (preference) => Effect.Effect<void, ShiitakeError>;
319
+ }>;
320
+ read: (input?) => Effect.Effect<SessionSnapshot, ShiitakeError>;
321
+ subscribe: (input) => Stream.Stream<SessionFrame, ShiitakeError>;
322
+ watch: (input?) => Effect.Effect<ShiitakeEffectWatch, ShiitakeError>;
323
+ }>;
324
+ ```
325
+
326
+ Effect-native addressable Session handle.
327
+
328
+ ---
329
+
330
+ ### ShiitakeEffectSessionExtension
331
+
332
+ ```ts
333
+ type ShiitakeEffectSessionExtension = Readonly<{
334
+ call: (command, input) => Effect.Effect<Json, ShiitakeError>;
335
+ }>;
336
+ ```
337
+
338
+ Effect-native Session-scope extension commands.
339
+
340
+ ---
341
+
342
+ ### ShiitakeEffectAgentExtensions
343
+
344
+ ```ts
345
+ type ShiitakeEffectAgentExtensions = Readonly<{
346
+ list: Effect.Effect<readonly ExtensionStatusV0[], ShiitakeError>;
347
+ resume: (extensionId) => Effect.Effect<ExtensionStatusV0, ShiitakeError>;
348
+ call: (extensionId, command, input) => Effect.Effect<Json, ShiitakeError>;
349
+ }>;
350
+ ```
351
+
352
+ Effect-native Agent-scope extension controls.
353
+
354
+ ---
355
+
356
+ ### ShiitakeEffectAgent
357
+
358
+ ```ts
359
+ type ShiitakeEffectAgent = Readonly<{
360
+ createSession: (requestId) => Effect.Effect<string, ShiitakeError>;
361
+ deleteSession: (sessionId) => Effect.Effect<boolean, ShiitakeError>;
362
+ listSessions: (after?) => Effect.Effect<SessionSummaryPage, ShiitakeError>;
363
+ extensions: ShiitakeEffectAgentExtensions;
364
+ session: (sessionId) => ShiitakeEffectSession;
365
+ close: Effect.Effect<void, ShiitakeError>;
366
+ }>;
367
+ ```
368
+
369
+ Effect-native durable harness.
370
+
371
+ ---
372
+
373
+ ### ShiitakeEffectOwner
374
+
375
+ ```ts
376
+ type ShiitakeEffectOwner = ShiitakeEffectAgent &
377
+ Readonly<{
378
+ grants: Readonly<{
379
+ deliver: (
380
+ sessionId,
381
+ delivery,
382
+ ) => Effect.Effect<GrantsDeliveryResult, ShiitakeError>;
383
+ read: (sessionId) => Effect.Effect<GrantsDelivery | null, ShiitakeError>;
384
+ }>;
385
+ withMeta: (meta) => ShiitakeEffectAgent;
386
+ }>;
387
+ ```
388
+
389
+ The in-process owner of a durable harness. Only the host holds it, so only the
390
+ host can write a Session's grants or attach metadata; no HTTP or remote client
391
+ can.
392
+
393
+ ---
394
+
395
+ ### StoredSessionSummary
396
+
397
+ ```ts
398
+ type StoredSessionSummary = Readonly<{
399
+ createdAt: number;
400
+ updatedAt: number;
401
+ title: string;
402
+ }>;
403
+ ```
404
+
405
+ Persisted conversation facts; run status belongs to the Session's owner.
406
+
407
+ ---
408
+
409
+ ### StoredSessionSummaryRow
410
+
411
+ ```ts
412
+ type StoredSessionSummaryRow =
413
+ | (StoredSessionSummary &
414
+ Readonly<{
415
+ kind: "session";
416
+ sessionId: string;
417
+ }>)
418
+ | Readonly<{
419
+ kind: "unavailable";
420
+ sessionId: string;
421
+ }>;
422
+ ```
423
+
424
+ One persisted conversation's stored facts, or a row that could not be read.
425
+
426
+ ---
427
+
428
+ ### StoredSessionSummaryPage
429
+
430
+ ```ts
431
+ type StoredSessionSummaryPage = Readonly<{
432
+ sessions: readonly StoredSessionSummaryRow[];
433
+ next: string | undefined;
434
+ }>;
435
+ ```
436
+
437
+ One page of stored conversation facts, in stable Session identity order.
438
+
439
+ ## Functions
440
+
441
+ ### make()
442
+
443
+ ```ts
444
+ function make(options): Effect<ShiitakeEffectOwner, ShiitakeError>;
445
+ ```
446
+
447
+ Construct the canonical Effect-native Shiitake scaffold.
448
+
449
+ #### Parameters
450
+
451
+ | Parameter | Type |
452
+ | --------- | ------------------------------------------------- |
453
+ | `options` | [`ShiitakeEffectOptions`](#shiitakeeffectoptions) |
454
+
455
+ #### Returns
456
+
457
+ `Effect`\<[`ShiitakeEffectOwner`](#shiitakeeffectowner),
458
+ [`ShiitakeError`](index.md#shiitakeerror)\>
459
+
460
+ ---
461
+
462
+ ### openHost()
463
+
464
+ ```ts
465
+ function openHost(options, mailRoom): Effect<Readonly<{
466
+ readSettlement: (sessionId, commandId) => Effect<
467
+ | Readonly<{
468
+ terminal: SessionTerminal;
469
+ content: string;
470
+ usage: readonly Pick<AssistantMessage, ... | ... | ...>[];
471
+ toolCalls: number;
472
+ }>
473
+ | undefined, ShiitakeError>;
474
+ agent: ShiitakeEffectOwner;
475
+ acceptMail: (mail, meta?, reply?) => Effect<Readonly<{
476
+ status: "accepted";
477
+ commandId: string;
478
+ }>, ShiitakeError>;
479
+ }>, ShiitakeError>;
480
+ ```
481
+
482
+ Open the Effect-native host composition with addressed mail.
483
+
484
+ #### Parameters
485
+
486
+ | Parameter | Type |
487
+ | ---------- | ------------------------------------------------- |
488
+ | `options` | [`ShiitakeEffectOptions`](#shiitakeeffectoptions) |
489
+ | `mailRoom` | `BirdDogEffect` |
490
+
491
+ #### Returns
492
+
493
+ `Effect`\<`Readonly`\<\{ `readSettlement`: (`sessionId`, `commandId`) =>
494
+ `Effect`\< \| `Readonly`\<\{ `terminal`:
495
+ [`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`:
496
+ readonly `Pick`\<`AssistantMessage`, ... \| ... \| ...\>[]; `toolCalls`:
497
+ `number`; \}\> \| `undefined`, [`ShiitakeError`](index.md#shiitakeerror)\>;
498
+ `agent`: [`ShiitakeEffectOwner`](#shiitakeeffectowner); `acceptMail`: (`mail`,
499
+ `meta?`, `reply?`) => `Effect`\<`Readonly`\<\{ `status`: `"accepted"`;
500
+ `commandId`: `string`; \}\>, [`ShiitakeError`](index.md#shiitakeerror)\>; \}\>,
501
+ [`ShiitakeError`](index.md#shiitakeerror)\>
502
+
503
+ ---
504
+
505
+ ### readSessionSummaries()
506
+
507
+ ```ts
508
+ function readSessionSummaries(
509
+ owner,
510
+ after?,
511
+ ): Effect<
512
+ Readonly<{
513
+ sessions: readonly StoredSessionSummaryRow[];
514
+ next: string | undefined;
515
+ }>,
516
+ ShiitakeError,
517
+ never
518
+ >;
519
+ ```
520
+
521
+ Enumerate saved conversations' stored facts in bounded pages, for readers that
522
+ hold only the store. Run status is not stored; use the Agent's `listSessions`
523
+ for it. An unreadable Session is its own `unavailable` row.
524
+
525
+ #### Parameters
526
+
527
+ | Parameter | Type |
528
+ | --------- | ------------------------------------- |
529
+ | `owner` | [`SqliteOwner`](index.md#sqliteowner) |
530
+ | `after?` | `string` |
531
+
532
+ #### Returns
533
+
534
+ `Effect`\<`Readonly`\<\{ `sessions`: readonly
535
+ [`StoredSessionSummaryRow`](#storedsessionsummaryrow)[]; `next`: `string` \|
536
+ `undefined`; \}\>, [`ShiitakeError`](index.md#shiitakeerror), `never`\>
537
+
538
+ ## References
539
+
540
+ ### AbortCommand
541
+
542
+ Re-exports [AbortCommand](index.md#abortcommand)
543
+
544
+ ---
545
+
546
+ ### BranchCommand
547
+
548
+ Re-exports [BranchCommand](index.md#branchcommand)
549
+
550
+ ---
551
+
552
+ ### CompactCommand
553
+
554
+ Re-exports [CompactCommand](index.md#compactcommand)
555
+
556
+ ---
557
+
558
+ ### CancelCommand
559
+
560
+ Re-exports [CancelCommand](index.md#cancelcommand)
561
+
562
+ ---
563
+
564
+ ### CancelResult
565
+
566
+ Re-exports [CancelResult](client.md#cancelresult)
567
+
568
+ ---
569
+
570
+ ### Accepted
571
+
572
+ Re-exports [Accepted](client.md#accepted)
573
+
574
+ ---
575
+
576
+ ### ForkCommand
577
+
578
+ Re-exports [ForkCommand](index.md#forkcommand)
579
+
580
+ ---
581
+
582
+ ### ForkedSession
583
+
584
+ Re-exports [ForkedSession](client.md#forkedsession)
585
+
586
+ ---
587
+
588
+ ### PromptCommand
589
+
590
+ Re-exports [PromptCommand](index.md#promptcommand)
591
+
592
+ ---
593
+
594
+ ### PromptDelivery
595
+
596
+ Re-exports [PromptDelivery](index.md#promptdelivery)
597
+
598
+ ---
599
+
600
+ ### ReadOptions
601
+
602
+ Re-exports [ReadOptions](client.md#readoptions)
603
+
604
+ ---
605
+
606
+ ### SessionCommand
607
+
608
+ Re-exports [SessionCommand](index.md#sessioncommand)
609
+
610
+ ---
611
+
612
+ ### SessionCommandHandler
613
+
614
+ Re-exports [SessionCommandHandler](client.md#sessioncommandhandler)
615
+
616
+ ---
617
+
618
+ ### SessionFrame
619
+
620
+ Re-exports [SessionFrame](client.md#sessionframe)
621
+
622
+ ---
623
+
624
+ ### SessionMessage
625
+
626
+ Re-exports [SessionMessage](client.md#sessionmessage)
627
+
628
+ ---
629
+
630
+ ### SessionProgress
631
+
632
+ Re-exports [SessionProgress](client.md#sessionprogress)
633
+
634
+ ---
635
+
636
+ ### SessionSnapshot
637
+
638
+ Re-exports [SessionSnapshot](client.md#sessionsnapshot)
639
+
640
+ ---
641
+
642
+ ### SessionActivity
643
+
644
+ Re-exports [SessionActivity](client.md#sessionactivity)
645
+
646
+ ---
647
+
648
+ ### AgentRunningWork
649
+
650
+ Re-exports [AgentRunningWork](client.md#agentrunningwork)
651
+
652
+ ---
653
+
654
+ ### SubscribeOptions
655
+
656
+ Re-exports [SubscribeOptions](client.md#subscribeoptions)
657
+
658
+ ---
659
+
660
+ ### TooLate
661
+
662
+ Re-exports [TooLate](client.md#toolate)
663
+
664
+ ---
665
+
666
+ ### WatchOptions
667
+
668
+ Re-exports [WatchOptions](client.md#watchoptions)
669
+
670
+ ---
671
+
672
+ ### InstructionSnapshot
673
+
674
+ Re-exports [InstructionSnapshot](index.md#instructionsnapshot)
675
+
676
+ ---
677
+
678
+ ### InstructionSource
679
+
680
+ Re-exports [InstructionSource](index.md#instructionsource)
681
+
682
+ ---
683
+
684
+ ### ModelAcquisition
685
+
686
+ Re-exports [ModelAcquisition](index.md#modelacquisition)
687
+
688
+ ---
689
+
690
+ ### ModelDescription
691
+
692
+ Re-exports [ModelDescription](index.md#modeldescription)
693
+
694
+ ---
695
+
696
+ ### ModelSource
697
+
698
+ Re-exports [ModelSource](index.md#modelsource)
699
+
700
+ ---
701
+
702
+ ### RuntimeHost
703
+
704
+ Re-exports [RuntimeHost](index.md#runtimehost)
705
+
706
+ ---
707
+
708
+ ### RuntimePendingWork
709
+
710
+ Re-exports [RuntimePendingWork](index.md#runtimependingwork)
711
+
712
+ ---
713
+
714
+ ### SqliteCursor
715
+
716
+ Re-exports [SqliteCursor](index.md#sqlitecursor)
717
+
718
+ ---
719
+
720
+ ### SqliteOwner
721
+
722
+ Re-exports [SqliteOwner](index.md#sqliteowner)
723
+
724
+ ---
725
+
726
+ ### SqliteValue
727
+
728
+ Re-exports [SqliteValue](index.md#sqlitevalue)
729
+
730
+ ---
731
+
732
+ ### SqliteRow
733
+
734
+ Re-exports [SqliteRow](index.md#sqliterow)
735
+
736
+ ---
737
+
738
+ ### GrantsDelivery
739
+
740
+ Re-exports [GrantsDelivery](index.md#grantsdelivery)
741
+
742
+ ---
743
+
744
+ ### GrantsDeliveryResult
745
+
746
+ Re-exports [GrantsDeliveryResult](index.md#grantsdeliveryresult)
747
+
748
+ ---
749
+
750
+ ### ShiitakeOptions
751
+
752
+ Re-exports [ShiitakeOptions](index.md#shiitakeoptions)
753
+
754
+ ---
755
+
756
+ ### ToolAccess
757
+
758
+ Re-exports [ToolAccess](index.md#toolaccess)
759
+
760
+ ---
761
+
762
+ ### HostMetaOptions
763
+
764
+ Re-exports [HostMetaOptions](index.md#hostmetaoptions)
765
+
766
+ ---
767
+
768
+ ### StandardHostMetaResult
769
+
770
+ Re-exports [StandardHostMetaResult](index.md#standardhostmetaresult)
771
+
772
+ ---
773
+
774
+ ### StandardHostMetaSchema
775
+
776
+ Re-exports [StandardHostMetaSchema](index.md#standardhostmetaschema)
777
+
778
+ ---
779
+
780
+ ### ToolSource
781
+
782
+ Re-exports [ToolSource](index.md#toolsource)
783
+
784
+ ---
785
+
786
+ ### SessionSummary
787
+
788
+ Re-exports [SessionSummary](client.md#sessionsummary)
789
+
790
+ ---
791
+
792
+ ### BorrowedCompactionViewV0
793
+
794
+ Re-exports [BorrowedCompactionViewV0](extensions.md#borrowedcompactionviewv0)
795
+
796
+ ---
797
+
798
+ ### CompactionHandoffErrorV0
799
+
800
+ Re-exports [CompactionHandoffErrorV0](extensions.md#compactionhandofferrorv0)
801
+
802
+ ---
803
+
804
+ ### CompactionHandoffResultV0
805
+
806
+ Re-exports [CompactionHandoffResultV0](extensions.md#compactionhandoffresultv0)
807
+
808
+ ---
809
+
810
+ ### CompactionHandoffV0
811
+
812
+ Re-exports [CompactionHandoffV0](extensions.md#compactionhandoffv0)
813
+
814
+ ---
815
+
816
+ ### ExtensionCapabilityV0
817
+
818
+ Re-exports [ExtensionCapabilityV0](index.md#extensioncapabilityv0)
819
+
820
+ ---
821
+
822
+ ### ExtensionGrantV0
823
+
824
+ Re-exports [ExtensionGrantV0](extensions.md#extensiongrantv0)
825
+
826
+ ---
827
+
828
+ ### ExtensionRosterV0
829
+
830
+ Re-exports [ExtensionRosterV0](extensions.md#extensionrosterv0)
831
+
832
+ ---
833
+
834
+ ### ExtensionSlotV0
835
+
836
+ Re-exports [ExtensionSlotV0](extensions.md#extensionslotv0)
837
+
838
+ ---
839
+
840
+ ### ExtensionStatusV0
841
+
842
+ Re-exports [ExtensionStatusV0](extensions.md#extensionstatusv0)
843
+
844
+ ---
845
+
846
+ ### RosteredExtensionV0
847
+
848
+ Re-exports [RosteredExtensionV0](extensions.md#rosteredextensionv0)
849
+
850
+ ---
851
+
852
+ ### ShiitakeError
853
+
854
+ Re-exports [ShiitakeError](index.md#shiitakeerror)
855
+
856
+ ---
857
+
858
+ ### ModelPreference
859
+
860
+ Re-exports [ModelPreference](index.md#modelpreference)
861
+
862
+ ---
863
+
864
+ ### SessionSummaryPage
865
+
866
+ Re-exports [SessionSummaryPage](client.md#sessionsummarypage)
867
+
868
+ ---
869
+
870
+ ### SessionSummaryRow
871
+
872
+ Re-exports [SessionSummaryRow](client.md#sessionsummaryrow)
873
+
874
+ ---
875
+
876
+ ### sqliteRowSchema
877
+
878
+ Re-exports [sqliteRowSchema](index.md#sqliterowschema)
879
+
880
+ ---
881
+
882
+ ### CommandSettlement
883
+
884
+ Re-exports [CommandSettlement](index.md#commandsettlement)