@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.
- package/LICENSE +21 -0
- package/README.md +454 -2
- package/dist/agar-extension.d.ts +9 -0
- package/dist/agar-extension.js +38 -0
- package/dist/agent-control.d.ts +72 -0
- package/dist/agent-control.js +431 -0
- package/dist/client-entry.d.ts +211 -0
- package/dist/client-entry.js +101 -0
- package/dist/client-wire.d.ts +199 -0
- package/dist/client-wire.js +271 -0
- package/dist/client.d.ts +439 -0
- package/dist/client.js +4 -0
- package/dist/cloudflare.d.ts +220 -0
- package/dist/cloudflare.js +531 -0
- package/dist/effect.d.ts +42 -0
- package/dist/effect.js +20 -0
- package/dist/errors.d.ts +50 -0
- package/dist/errors.js +81 -0
- package/dist/extension-client.d.ts +38 -0
- package/dist/extension-client.js +56 -0
- package/dist/extension-contract.d.ts +73 -0
- package/dist/extension-contract.js +11 -0
- package/dist/extensions.d.ts +589 -0
- package/dist/extensions.js +263 -0
- package/dist/fleet.d.ts +297 -0
- package/dist/fleet.js +515 -0
- package/dist/hosted.d.ts +133 -0
- package/dist/hosted.js +265 -0
- package/dist/http-routes.d.ts +772 -0
- package/dist/http-routes.js +242 -0
- package/dist/http.d.ts +1 -0
- package/dist/http.js +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +13 -0
- package/dist/internal/accepted-run-executor.d.ts +23 -0
- package/dist/internal/accepted-run-executor.js +129 -0
- package/dist/internal/admission-door.d.ts +75 -0
- package/dist/internal/admission-door.js +105 -0
- package/dist/internal/agent-close.d.ts +4 -0
- package/dist/internal/agent-close.js +42 -0
- package/dist/internal/browser-sessions.d.ts +31 -0
- package/dist/internal/browser-sessions.js +173 -0
- package/dist/internal/client-boundary.d.ts +262 -0
- package/dist/internal/client-boundary.js +202 -0
- package/dist/internal/compaction/compaction.d.ts +54 -0
- package/dist/internal/compaction/compaction.js +292 -0
- package/dist/internal/compaction/session-compaction.d.ts +69 -0
- package/dist/internal/compaction/session-compaction.js +330 -0
- package/dist/internal/compaction/settings.d.ts +11 -0
- package/dist/internal/compaction/settings.js +40 -0
- package/dist/internal/compaction/utils.d.ts +45 -0
- package/dist/internal/compaction/utils.js +319 -0
- package/dist/internal/contracts.d.ts +235 -0
- package/dist/internal/contracts.js +1 -0
- package/dist/internal/coordinator.d.ts +18 -0
- package/dist/internal/coordinator.js +362 -0
- package/dist/internal/document-codec.d.ts +11 -0
- package/dist/internal/document-codec.js +39 -0
- package/dist/internal/effect-client.d.ts +13 -0
- package/dist/internal/effect-client.js +102 -0
- package/dist/internal/effect-contracts.d.ts +236 -0
- package/dist/internal/effect-contracts.js +2 -0
- package/dist/internal/extension-command-registry.d.ts +11 -0
- package/dist/internal/extension-command-registry.js +29 -0
- package/dist/internal/extension-command-tools.d.ts +17 -0
- package/dist/internal/extension-command-tools.js +50 -0
- package/dist/internal/extension-context.d.ts +25 -0
- package/dist/internal/extension-context.js +35 -0
- package/dist/internal/extension-definitions.d.ts +5 -0
- package/dist/internal/extension-definitions.js +6 -0
- package/dist/internal/extension-hook.d.ts +25 -0
- package/dist/internal/extension-hook.js +46 -0
- package/dist/internal/extension-roster.d.ts +23 -0
- package/dist/internal/extension-roster.js +228 -0
- package/dist/internal/extension-runtime.d.ts +63 -0
- package/dist/internal/extension-runtime.js +1004 -0
- package/dist/internal/failure.d.ts +2 -0
- package/dist/internal/failure.js +9 -0
- package/dist/internal/host-meta.d.ts +41 -0
- package/dist/internal/host-meta.js +39 -0
- package/dist/internal/json-value.d.ts +4 -0
- package/dist/internal/json-value.js +3 -0
- package/dist/internal/model-acquisition.d.ts +21 -0
- package/dist/internal/model-acquisition.js +98 -0
- package/dist/internal/model-preference.d.ts +21 -0
- package/dist/internal/model-preference.js +20 -0
- package/dist/internal/observation-kernel.d.ts +28 -0
- package/dist/internal/observation-kernel.js +169 -0
- package/dist/internal/promise-facade.d.ts +18 -0
- package/dist/internal/promise-facade.js +172 -0
- package/dist/internal/run-scope.d.ts +27 -0
- package/dist/internal/run-scope.js +214 -0
- package/dist/internal/runtime-coordinator.d.ts +34 -0
- package/dist/internal/runtime-coordinator.js +233 -0
- package/dist/internal/runtime-core.d.ts +19 -0
- package/dist/internal/runtime-core.js +39 -0
- package/dist/internal/runtime-reconciliation.d.ts +18 -0
- package/dist/internal/runtime-reconciliation.js +162 -0
- package/dist/internal/session-context.d.ts +11 -0
- package/dist/internal/session-context.js +67 -0
- package/dist/internal/session-status.d.ts +10 -0
- package/dist/internal/session-status.js +52 -0
- package/dist/internal/woodstock/agent-reply.d.ts +25 -0
- package/dist/internal/woodstock/agent-reply.js +67 -0
- package/dist/internal/woodstock/client-projection.d.ts +29 -0
- package/dist/internal/woodstock/client-projection.js +512 -0
- package/dist/internal/woodstock/compaction-activity.d.ts +17 -0
- package/dist/internal/woodstock/compaction-activity.js +32 -0
- package/dist/internal/woodstock/cursor.d.ts +9 -0
- package/dist/internal/woodstock/cursor.js +44 -0
- package/dist/internal/woodstock/extension-store.d.ts +72 -0
- package/dist/internal/woodstock/extension-store.js +262 -0
- package/dist/internal/woodstock/fleet-store.d.ts +32 -0
- package/dist/internal/woodstock/fleet-store.js +93 -0
- package/dist/internal/woodstock/identities.d.ts +6 -0
- package/dist/internal/woodstock/identities.js +11 -0
- package/dist/internal/woodstock/index.d.ts +170 -0
- package/dist/internal/woodstock/index.js +546 -0
- package/dist/internal/woodstock/progress.d.ts +32 -0
- package/dist/internal/woodstock/progress.js +89 -0
- package/dist/internal/woodstock/run-recovery.d.ts +8 -0
- package/dist/internal/woodstock/run-recovery.js +95 -0
- package/dist/internal/woodstock/session-attention.d.ts +16 -0
- package/dist/internal/woodstock/session-attention.js +88 -0
- package/dist/internal/woodstock/session-documents.d.ts +18 -0
- package/dist/internal/woodstock/session-documents.js +51 -0
- package/dist/internal/woodstock/session-entry.d.ts +478 -0
- package/dist/internal/woodstock/session-entry.js +484 -0
- package/dist/internal/woodstock/session-grants.d.ts +24 -0
- package/dist/internal/woodstock/session-grants.js +84 -0
- package/dist/internal/woodstock/session-inbox.d.ts +56 -0
- package/dist/internal/woodstock/session-inbox.js +307 -0
- package/dist/internal/woodstock/session-store.d.ts +432 -0
- package/dist/internal/woodstock/session-store.js +2006 -0
- package/dist/internal/woodstock/storage-admission.d.ts +14 -0
- package/dist/internal/woodstock/storage-admission.js +44 -0
- package/dist/model-preference.d.ts +20 -0
- package/dist/model-preference.js +30 -0
- package/dist/node.d.ts +64 -0
- package/dist/node.js +256 -0
- package/dist/remote-client.d.ts +11 -0
- package/dist/remote-client.js +298 -0
- package/dist/session-attention.d.ts +35 -0
- package/dist/session-attention.js +22 -0
- package/dist/session-documents.d.ts +28 -0
- package/dist/session-documents.js +1 -0
- package/dist/testing.d.ts +54 -0
- package/dist/testing.js +215 -0
- package/docs/api/README.md +26 -0
- package/docs/api/agar-extension.md +40 -0
- package/docs/api/agent-control.md +151 -0
- package/docs/api/client-entry.md +344 -0
- package/docs/api/client.md +1112 -0
- package/docs/api/cloudflare.md +500 -0
- package/docs/api/effect.md +904 -0
- package/docs/api/extensions.md +2003 -0
- package/docs/api/fleet.md +706 -0
- package/docs/api/hosted.md +382 -0
- package/docs/api/http.md +111 -0
- package/docs/api/index.md +1116 -0
- package/docs/api/model-preference.md +151 -0
- package/docs/api/node.md +142 -0
- package/docs/api/testing.md +250 -0
- package/package.json +130 -3
|
@@ -0,0 +1,500 @@
|
|
|
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) / cloudflare
|
|
8
|
+
|
|
9
|
+
# cloudflare
|
|
10
|
+
|
|
11
|
+
## Classes
|
|
12
|
+
|
|
13
|
+
### `abstract` ShiitakeOwner
|
|
14
|
+
|
|
15
|
+
Owns runtime opening, HTTP/ACP transport, inbox observation and alarm recovery.
|
|
16
|
+
|
|
17
|
+
#### Type Parameters
|
|
18
|
+
|
|
19
|
+
| Type Parameter | Default type |
|
|
20
|
+
| ----------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
21
|
+
| `Env` | - |
|
|
22
|
+
| `State` _extends_ [`CloudflareShiitakeState`](#cloudflareshiitakestate) | [`CloudflareShiitakeState`](#cloudflareshiitakestate) |
|
|
23
|
+
|
|
24
|
+
#### Constructors
|
|
25
|
+
|
|
26
|
+
##### Constructor
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
new ShiitakeOwner<Env, State>(ctx, env): ShiitakeOwner<Env, State>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
###### Parameters
|
|
33
|
+
|
|
34
|
+
| Parameter | Type |
|
|
35
|
+
| --------- | ------- |
|
|
36
|
+
| `ctx` | `State` |
|
|
37
|
+
| `env` | `Env` |
|
|
38
|
+
|
|
39
|
+
###### Returns
|
|
40
|
+
|
|
41
|
+
[`ShiitakeOwner`](#abstract-shiitakeowner)\<`Env`, `State`\>
|
|
42
|
+
|
|
43
|
+
#### Methods
|
|
44
|
+
|
|
45
|
+
##### shiitake()
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
shiitake(): Promise<CloudflareShiitake>;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Borrow this owner's runtime directly; only the host owns its lifetime.
|
|
52
|
+
|
|
53
|
+
###### Returns
|
|
54
|
+
|
|
55
|
+
`Promise`\<[`CloudflareShiitake`](#cloudflareshiitake)\>
|
|
56
|
+
|
|
57
|
+
##### abortActiveSessions()
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
abortActiveSessions(): Promise<void>;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Stop live execution without constructing a cold owner's runtime.
|
|
64
|
+
|
|
65
|
+
###### Returns
|
|
66
|
+
|
|
67
|
+
`Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
##### closeShiitake()
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
closeShiitake(): Promise<void>;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Close owned resources before storage erasure; a cold owner has none.
|
|
76
|
+
|
|
77
|
+
###### Returns
|
|
78
|
+
|
|
79
|
+
`Promise`\<`void`\>
|
|
80
|
+
|
|
81
|
+
##### readInboxChanges()
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
readInboxChanges(after, limit): Promise<Readonly<{
|
|
85
|
+
rows: readonly (
|
|
86
|
+
| SessionSummaryRow
|
|
87
|
+
| Readonly<{
|
|
88
|
+
sessionId: string;
|
|
89
|
+
deleted: true;
|
|
90
|
+
}>)[];
|
|
91
|
+
through: number;
|
|
92
|
+
latest: number;
|
|
93
|
+
}>>;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Bounded strict-after read of this Agent's changed inbox rows.
|
|
97
|
+
|
|
98
|
+
###### Parameters
|
|
99
|
+
|
|
100
|
+
| Parameter | Type |
|
|
101
|
+
| --------- | -------- |
|
|
102
|
+
| `after` | `number` |
|
|
103
|
+
| `limit` | `number` |
|
|
104
|
+
|
|
105
|
+
###### Returns
|
|
106
|
+
|
|
107
|
+
`Promise`\<`Readonly`\<\{ `rows`: readonly ( \|
|
|
108
|
+
[`SessionSummaryRow`](client.md#sessionsummaryrow) \| `Readonly`\<\{
|
|
109
|
+
`sessionId`: `string`; `deleted`: `true`; \}\>)[]; `through`: `number`;
|
|
110
|
+
`latest`: `number`; \}\>\>
|
|
111
|
+
|
|
112
|
+
##### readInboxRevision()
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
readInboxRevision(): number;
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Latest inbox revision; read only after the owner has opened.
|
|
119
|
+
|
|
120
|
+
###### Returns
|
|
121
|
+
|
|
122
|
+
`number`
|
|
123
|
+
|
|
124
|
+
##### pruneInboxTombstones()
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
pruneInboxTombstones(through): void;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Prune deletion deltas after every current member inbox has acknowledged them.
|
|
131
|
+
|
|
132
|
+
###### Parameters
|
|
133
|
+
|
|
134
|
+
| Parameter | Type |
|
|
135
|
+
| --------- | -------- |
|
|
136
|
+
| `through` | `number` |
|
|
137
|
+
|
|
138
|
+
###### Returns
|
|
139
|
+
|
|
140
|
+
`void`
|
|
141
|
+
|
|
142
|
+
##### wakeRuntime()
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
wakeRuntime(): Promise<void>;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Persist a wake and run one reconciliation pass, including host work.
|
|
149
|
+
|
|
150
|
+
###### Returns
|
|
151
|
+
|
|
152
|
+
`Promise`\<`void`\>
|
|
153
|
+
|
|
154
|
+
##### alarm()
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
alarm(): Promise<void>;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Native alarms reconstruct the owner without an incoming user request. A
|
|
161
|
+
construction or wake failure must not strand the claimed work on platform alarm
|
|
162
|
+
retries: it is caught, logged, and explicitly re-armed with bounded backoff
|
|
163
|
+
instead.
|
|
164
|
+
|
|
165
|
+
###### Returns
|
|
166
|
+
|
|
167
|
+
`Promise`\<`void`\>
|
|
168
|
+
|
|
169
|
+
##### fetch()
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
fetch(request): Promise<Response>;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Serve one request through Shiitake's whole HTTP surface.
|
|
176
|
+
|
|
177
|
+
###### Parameters
|
|
178
|
+
|
|
179
|
+
| Parameter | Type |
|
|
180
|
+
| --------- | --------- |
|
|
181
|
+
| `request` | `Request` |
|
|
182
|
+
|
|
183
|
+
###### Returns
|
|
184
|
+
|
|
185
|
+
`Promise`\<`Response`\>
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### `abstract` ShiitakeDO
|
|
190
|
+
|
|
191
|
+
Native Cloudflare entry points; all runtime lifetime belongs to the owner.
|
|
192
|
+
|
|
193
|
+
#### Extends
|
|
194
|
+
|
|
195
|
+
- `DurableObject`\<`Env`\>
|
|
196
|
+
|
|
197
|
+
#### Type Parameters
|
|
198
|
+
|
|
199
|
+
| Type Parameter |
|
|
200
|
+
| -------------- |
|
|
201
|
+
| `Env` |
|
|
202
|
+
|
|
203
|
+
#### Constructors
|
|
204
|
+
|
|
205
|
+
##### Constructor
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
new ShiitakeDO<Env>(ctx, env): ShiitakeDO<Env>;
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
###### Parameters
|
|
212
|
+
|
|
213
|
+
| Parameter | Type |
|
|
214
|
+
| --------- | -------------------- |
|
|
215
|
+
| `ctx` | `DurableObjectState` |
|
|
216
|
+
| `env` | `Env` |
|
|
217
|
+
|
|
218
|
+
###### Returns
|
|
219
|
+
|
|
220
|
+
[`ShiitakeDO`](#abstract-shiitakedo)\<`Env`\>
|
|
221
|
+
|
|
222
|
+
###### Inherited from
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
DurableObject<Env>.constructor
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### Methods
|
|
229
|
+
|
|
230
|
+
##### alarm()
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
alarm(): Promise<void>;
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Reconcile due runtime and host work through the owner.
|
|
237
|
+
|
|
238
|
+
###### Returns
|
|
239
|
+
|
|
240
|
+
`Promise`\<`void`\>
|
|
241
|
+
|
|
242
|
+
###### Overrides
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
DurableObject.alarm;
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
##### fetch()
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
fetch(request): Promise<Response>;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Route an authenticated client request through the owner.
|
|
255
|
+
|
|
256
|
+
###### Parameters
|
|
257
|
+
|
|
258
|
+
| Parameter | Type |
|
|
259
|
+
| --------- | --------- |
|
|
260
|
+
| `request` | `Request` |
|
|
261
|
+
|
|
262
|
+
###### Returns
|
|
263
|
+
|
|
264
|
+
`Promise`\<`Response`\>
|
|
265
|
+
|
|
266
|
+
###### Overrides
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
DurableObject.fetch;
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Type Aliases
|
|
273
|
+
|
|
274
|
+
### CloudflareShiitakeState
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
type CloudflareShiitakeState = Readonly<{
|
|
278
|
+
storage: SqliteOwner &
|
|
279
|
+
Pick<DurableObjectStorage, "getAlarm" | "setAlarm" | "deleteAlarm"> &
|
|
280
|
+
object;
|
|
281
|
+
waitUntil: (task) => void;
|
|
282
|
+
}>;
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Native Durable Object capabilities used by the Cloudflare adapter.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
### CloudflareShiitakeTools
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
type CloudflareShiitakeTools = Readonly<{
|
|
293
|
+
modules?: readonly ModuleRegistration[];
|
|
294
|
+
sources?: readonly CapabilitySource[];
|
|
295
|
+
sandbox: Sandbox;
|
|
296
|
+
access?: ToolAccess;
|
|
297
|
+
}>;
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Non-empty Mycelium capabilities supplied by a Cloudflare host.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### CloudflareHostWork
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
type CloudflareHostWork = Readonly<{
|
|
308
|
+
pending: () => Readonly<{
|
|
309
|
+
due: boolean;
|
|
310
|
+
nextWakeAt: number | null;
|
|
311
|
+
}>;
|
|
312
|
+
run: () => Promise<void>;
|
|
313
|
+
}>;
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Durable host work that shares Shiitake's one native alarm, such as a host-owned
|
|
317
|
+
delivery outbox. Shiitake never interprets it.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### CloudflareHostJobs
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
type CloudflareHostJobs = Readonly<{
|
|
325
|
+
lane: string;
|
|
326
|
+
open: (runtime) => Readonly<{
|
|
327
|
+
execute: (job) => Promise<WatchdogExecutionDecision>;
|
|
328
|
+
}>;
|
|
329
|
+
}>;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Host jobs use a separate slot in Shiitake's one Watchdog and native alarm.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### CloudflareShiitakeAcpServer
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
type CloudflareShiitakeAcpServer = Readonly<{
|
|
340
|
+
handleRequest: (request, meta) => Promise<Response>;
|
|
341
|
+
}>;
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
ACP's maintained transport, supplied by the host without a package cycle.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### CloudflareShiitakeOptions
|
|
349
|
+
|
|
350
|
+
```ts
|
|
351
|
+
type CloudflareShiitakeOptions = Readonly<{
|
|
352
|
+
meta?: HostMetaOptions;
|
|
353
|
+
model: ModelSource;
|
|
354
|
+
instructions: InstructionSource;
|
|
355
|
+
tools?: readonly [] | CloudflareShiitakeTools;
|
|
356
|
+
storageBudget?: StorageBudget;
|
|
357
|
+
compaction?: CompactionOptions;
|
|
358
|
+
extensions: ExtensionRosterV0;
|
|
359
|
+
initialize?: (agent) => Promise<void>;
|
|
360
|
+
hostWork?: readonly CloudflareHostWork[];
|
|
361
|
+
hostJobs?: CloudflareHostJobs;
|
|
362
|
+
mailRoom?: BirdDogEffect;
|
|
363
|
+
browser?: (sessionId) => BrowserHost;
|
|
364
|
+
acp?: (agent) => Promise<CloudflareShiitakeAcpServer>;
|
|
365
|
+
}>;
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Cloudflare host inputs; the model owner resolves one frozen run selection.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
### CloudflareShiitake
|
|
373
|
+
|
|
374
|
+
```ts
|
|
375
|
+
type CloudflareShiitake = ShiitakeOwnerAgent &
|
|
376
|
+
Readonly<{
|
|
377
|
+
readSettlement: (
|
|
378
|
+
sessionId,
|
|
379
|
+
commandId,
|
|
380
|
+
) => Promise<CommandSettlement | undefined>;
|
|
381
|
+
acceptMail: (mail, meta?, reply?) => Promise<Accepted>;
|
|
382
|
+
alarm: () => Promise<void>;
|
|
383
|
+
activeSessions: () => Promise<readonly string[]>;
|
|
384
|
+
abortActive: () => Promise<void>;
|
|
385
|
+
browser: Readonly<{
|
|
386
|
+
fetch: (request) => Promise<Response>;
|
|
387
|
+
clear: () => Promise<void>;
|
|
388
|
+
}>;
|
|
389
|
+
}>;
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Cloudflare host lifecycle; alarm forwarding stays outside the neutral client.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### BrowserHost
|
|
397
|
+
|
|
398
|
+
```ts
|
|
399
|
+
type BrowserHost = Readonly<{
|
|
400
|
+
modules: readonly ModuleRegistration[];
|
|
401
|
+
fetch: (request) => Promise<Response>;
|
|
402
|
+
}>;
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
The maintained browser transport and its Session-bound tool descriptors.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
### SessionInboxChanges
|
|
410
|
+
|
|
411
|
+
```ts
|
|
412
|
+
type SessionInboxChanges = Readonly<{
|
|
413
|
+
rows: readonly (
|
|
414
|
+
| SessionSummaryRow
|
|
415
|
+
| Readonly<{
|
|
416
|
+
sessionId: string;
|
|
417
|
+
deleted: true;
|
|
418
|
+
}>
|
|
419
|
+
)[];
|
|
420
|
+
through: number;
|
|
421
|
+
latest: number;
|
|
422
|
+
}>;
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Revisioned Session inbox changes after one owner revision, oldest first.
|
|
426
|
+
|
|
427
|
+
## Functions
|
|
428
|
+
|
|
429
|
+
### deliverSessionGrantsToStorage()
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
function deliverSessionGrantsToStorage(
|
|
433
|
+
storage,
|
|
434
|
+
sessionId,
|
|
435
|
+
delivery,
|
|
436
|
+
): GrantsDeliveryResult;
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Deliver one Session's grants into a Cloudflare owner's own storage,
|
|
440
|
+
synchronously, whether or not its runtime is open; the very next tool call reads
|
|
441
|
+
it. A plain function, not a Durable Object method, so no other Durable Object
|
|
442
|
+
can call it over RPC: only code running inside the owner, holding its storage,
|
|
443
|
+
delivers grants.
|
|
444
|
+
|
|
445
|
+
#### Parameters
|
|
446
|
+
|
|
447
|
+
| Parameter | Type |
|
|
448
|
+
| ----------- | ------------------------------------------- |
|
|
449
|
+
| `storage` | [`SqliteOwner`](index.md#sqliteowner) |
|
|
450
|
+
| `sessionId` | `string` |
|
|
451
|
+
| `delivery` | [`GrantsDelivery`](index.md#grantsdelivery) |
|
|
452
|
+
|
|
453
|
+
#### Returns
|
|
454
|
+
|
|
455
|
+
[`GrantsDeliveryResult`](index.md#grantsdeliveryresult)
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
### makeCloudflareShiitake()
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
function makeCloudflareShiitake(state, options): Promise<CloudflareShiitake>;
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Construct Shiitake over one Durable Object's SQLite and lifetime.
|
|
466
|
+
|
|
467
|
+
#### Parameters
|
|
468
|
+
|
|
469
|
+
| Parameter | Type |
|
|
470
|
+
| --------- | --------------------------------------------------------- |
|
|
471
|
+
| `state` | [`CloudflareShiitakeState`](#cloudflareshiitakestate) |
|
|
472
|
+
| `options` | [`CloudflareShiitakeOptions`](#cloudflareshiitakeoptions) |
|
|
473
|
+
|
|
474
|
+
#### Returns
|
|
475
|
+
|
|
476
|
+
`Promise`\<[`CloudflareShiitake`](#cloudflareshiitake)\>
|
|
477
|
+
|
|
478
|
+
## References
|
|
479
|
+
|
|
480
|
+
### GrantsDelivery
|
|
481
|
+
|
|
482
|
+
Re-exports [GrantsDelivery](index.md#grantsdelivery)
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
### GrantsDeliveryResult
|
|
487
|
+
|
|
488
|
+
Re-exports [GrantsDeliveryResult](index.md#grantsdeliveryresult)
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
### ShiitakeOwnerAgent
|
|
493
|
+
|
|
494
|
+
Re-exports [ShiitakeOwnerAgent](index.md#shiitakeowneragent)
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
### ToolAccess
|
|
499
|
+
|
|
500
|
+
Re-exports [ToolAccess](index.md#toolaccess)
|