@fungi.computer/shiitake 0.0.0-stage → 0.0.1

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 +72 -0
  6. package/dist/agent-control.js +431 -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 +297 -0
  26. package/dist/fleet.js +515 -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 +292 -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 +32 -0
  114. package/dist/internal/woodstock/fleet-store.js +93 -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 +904 -0
  156. package/docs/api/extensions.md +2003 -0
  157. package/docs/api/fleet.md +706 -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,904 @@
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
+ ---
539
+
540
+ ### inspectWoodstockStoreProtocol()
541
+
542
+ ```ts
543
+ function inspectWoodstockStoreProtocol(owner): "fresh" | "v0" | "unmarked";
544
+ ```
545
+
546
+ Inspect one unopened store before the file-backed host takes custody.
547
+
548
+ #### Parameters
549
+
550
+ | Parameter | Type |
551
+ | --------- | ------------------------------------- |
552
+ | `owner` | [`SqliteOwner`](index.md#sqliteowner) |
553
+
554
+ #### Returns
555
+
556
+ `"fresh"` \| `"v0"` \| `"unmarked"`
557
+
558
+ ## References
559
+
560
+ ### AbortCommand
561
+
562
+ Re-exports [AbortCommand](index.md#abortcommand)
563
+
564
+ ---
565
+
566
+ ### BranchCommand
567
+
568
+ Re-exports [BranchCommand](index.md#branchcommand)
569
+
570
+ ---
571
+
572
+ ### CompactCommand
573
+
574
+ Re-exports [CompactCommand](index.md#compactcommand)
575
+
576
+ ---
577
+
578
+ ### CancelCommand
579
+
580
+ Re-exports [CancelCommand](index.md#cancelcommand)
581
+
582
+ ---
583
+
584
+ ### CancelResult
585
+
586
+ Re-exports [CancelResult](client.md#cancelresult)
587
+
588
+ ---
589
+
590
+ ### Accepted
591
+
592
+ Re-exports [Accepted](client.md#accepted)
593
+
594
+ ---
595
+
596
+ ### ForkCommand
597
+
598
+ Re-exports [ForkCommand](index.md#forkcommand)
599
+
600
+ ---
601
+
602
+ ### ForkedSession
603
+
604
+ Re-exports [ForkedSession](client.md#forkedsession)
605
+
606
+ ---
607
+
608
+ ### PromptCommand
609
+
610
+ Re-exports [PromptCommand](index.md#promptcommand)
611
+
612
+ ---
613
+
614
+ ### PromptDelivery
615
+
616
+ Re-exports [PromptDelivery](index.md#promptdelivery)
617
+
618
+ ---
619
+
620
+ ### ReadOptions
621
+
622
+ Re-exports [ReadOptions](client.md#readoptions)
623
+
624
+ ---
625
+
626
+ ### SessionCommand
627
+
628
+ Re-exports [SessionCommand](index.md#sessioncommand)
629
+
630
+ ---
631
+
632
+ ### SessionCommandHandler
633
+
634
+ Re-exports [SessionCommandHandler](client.md#sessioncommandhandler)
635
+
636
+ ---
637
+
638
+ ### SessionFrame
639
+
640
+ Re-exports [SessionFrame](client.md#sessionframe)
641
+
642
+ ---
643
+
644
+ ### SessionMessage
645
+
646
+ Re-exports [SessionMessage](client.md#sessionmessage)
647
+
648
+ ---
649
+
650
+ ### SessionProgress
651
+
652
+ Re-exports [SessionProgress](client.md#sessionprogress)
653
+
654
+ ---
655
+
656
+ ### SessionSnapshot
657
+
658
+ Re-exports [SessionSnapshot](client.md#sessionsnapshot)
659
+
660
+ ---
661
+
662
+ ### SessionActivity
663
+
664
+ Re-exports [SessionActivity](client.md#sessionactivity)
665
+
666
+ ---
667
+
668
+ ### AgentRunningWork
669
+
670
+ Re-exports [AgentRunningWork](client.md#agentrunningwork)
671
+
672
+ ---
673
+
674
+ ### SubscribeOptions
675
+
676
+ Re-exports [SubscribeOptions](client.md#subscribeoptions)
677
+
678
+ ---
679
+
680
+ ### TooLate
681
+
682
+ Re-exports [TooLate](client.md#toolate)
683
+
684
+ ---
685
+
686
+ ### WatchOptions
687
+
688
+ Re-exports [WatchOptions](client.md#watchoptions)
689
+
690
+ ---
691
+
692
+ ### InstructionSnapshot
693
+
694
+ Re-exports [InstructionSnapshot](index.md#instructionsnapshot)
695
+
696
+ ---
697
+
698
+ ### InstructionSource
699
+
700
+ Re-exports [InstructionSource](index.md#instructionsource)
701
+
702
+ ---
703
+
704
+ ### ModelAcquisition
705
+
706
+ Re-exports [ModelAcquisition](index.md#modelacquisition)
707
+
708
+ ---
709
+
710
+ ### ModelDescription
711
+
712
+ Re-exports [ModelDescription](index.md#modeldescription)
713
+
714
+ ---
715
+
716
+ ### ModelSource
717
+
718
+ Re-exports [ModelSource](index.md#modelsource)
719
+
720
+ ---
721
+
722
+ ### RuntimeHost
723
+
724
+ Re-exports [RuntimeHost](index.md#runtimehost)
725
+
726
+ ---
727
+
728
+ ### RuntimePendingWork
729
+
730
+ Re-exports [RuntimePendingWork](index.md#runtimependingwork)
731
+
732
+ ---
733
+
734
+ ### SqliteCursor
735
+
736
+ Re-exports [SqliteCursor](index.md#sqlitecursor)
737
+
738
+ ---
739
+
740
+ ### SqliteOwner
741
+
742
+ Re-exports [SqliteOwner](index.md#sqliteowner)
743
+
744
+ ---
745
+
746
+ ### SqliteValue
747
+
748
+ Re-exports [SqliteValue](index.md#sqlitevalue)
749
+
750
+ ---
751
+
752
+ ### SqliteRow
753
+
754
+ Re-exports [SqliteRow](index.md#sqliterow)
755
+
756
+ ---
757
+
758
+ ### GrantsDelivery
759
+
760
+ Re-exports [GrantsDelivery](index.md#grantsdelivery)
761
+
762
+ ---
763
+
764
+ ### GrantsDeliveryResult
765
+
766
+ Re-exports [GrantsDeliveryResult](index.md#grantsdeliveryresult)
767
+
768
+ ---
769
+
770
+ ### ShiitakeOptions
771
+
772
+ Re-exports [ShiitakeOptions](index.md#shiitakeoptions)
773
+
774
+ ---
775
+
776
+ ### ToolAccess
777
+
778
+ Re-exports [ToolAccess](index.md#toolaccess)
779
+
780
+ ---
781
+
782
+ ### HostMetaOptions
783
+
784
+ Re-exports [HostMetaOptions](index.md#hostmetaoptions)
785
+
786
+ ---
787
+
788
+ ### StandardHostMetaResult
789
+
790
+ Re-exports [StandardHostMetaResult](index.md#standardhostmetaresult)
791
+
792
+ ---
793
+
794
+ ### StandardHostMetaSchema
795
+
796
+ Re-exports [StandardHostMetaSchema](index.md#standardhostmetaschema)
797
+
798
+ ---
799
+
800
+ ### ToolSource
801
+
802
+ Re-exports [ToolSource](index.md#toolsource)
803
+
804
+ ---
805
+
806
+ ### SessionSummary
807
+
808
+ Re-exports [SessionSummary](client.md#sessionsummary)
809
+
810
+ ---
811
+
812
+ ### BorrowedCompactionViewV0
813
+
814
+ Re-exports [BorrowedCompactionViewV0](extensions.md#borrowedcompactionviewv0)
815
+
816
+ ---
817
+
818
+ ### CompactionHandoffErrorV0
819
+
820
+ Re-exports [CompactionHandoffErrorV0](extensions.md#compactionhandofferrorv0)
821
+
822
+ ---
823
+
824
+ ### CompactionHandoffResultV0
825
+
826
+ Re-exports [CompactionHandoffResultV0](extensions.md#compactionhandoffresultv0)
827
+
828
+ ---
829
+
830
+ ### CompactionHandoffV0
831
+
832
+ Re-exports [CompactionHandoffV0](extensions.md#compactionhandoffv0)
833
+
834
+ ---
835
+
836
+ ### ExtensionCapabilityV0
837
+
838
+ Re-exports [ExtensionCapabilityV0](index.md#extensioncapabilityv0)
839
+
840
+ ---
841
+
842
+ ### ExtensionGrantV0
843
+
844
+ Re-exports [ExtensionGrantV0](extensions.md#extensiongrantv0)
845
+
846
+ ---
847
+
848
+ ### ExtensionRosterV0
849
+
850
+ Re-exports [ExtensionRosterV0](extensions.md#extensionrosterv0)
851
+
852
+ ---
853
+
854
+ ### ExtensionSlotV0
855
+
856
+ Re-exports [ExtensionSlotV0](extensions.md#extensionslotv0)
857
+
858
+ ---
859
+
860
+ ### ExtensionStatusV0
861
+
862
+ Re-exports [ExtensionStatusV0](extensions.md#extensionstatusv0)
863
+
864
+ ---
865
+
866
+ ### RosteredExtensionV0
867
+
868
+ Re-exports [RosteredExtensionV0](extensions.md#rosteredextensionv0)
869
+
870
+ ---
871
+
872
+ ### ShiitakeError
873
+
874
+ Re-exports [ShiitakeError](index.md#shiitakeerror)
875
+
876
+ ---
877
+
878
+ ### ModelPreference
879
+
880
+ Re-exports [ModelPreference](index.md#modelpreference)
881
+
882
+ ---
883
+
884
+ ### SessionSummaryPage
885
+
886
+ Re-exports [SessionSummaryPage](client.md#sessionsummarypage)
887
+
888
+ ---
889
+
890
+ ### SessionSummaryRow
891
+
892
+ Re-exports [SessionSummaryRow](client.md#sessionsummaryrow)
893
+
894
+ ---
895
+
896
+ ### sqliteRowSchema
897
+
898
+ Re-exports [sqliteRowSchema](index.md#sqliterowschema)
899
+
900
+ ---
901
+
902
+ ### CommandSettlement
903
+
904
+ Re-exports [CommandSettlement](index.md#commandsettlement)