@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,706 @@
|
|
|
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) / fleet
|
|
8
|
+
|
|
9
|
+
# fleet
|
|
10
|
+
|
|
11
|
+
## Classes
|
|
12
|
+
|
|
13
|
+
### AgentGrantError
|
|
14
|
+
|
|
15
|
+
Refusal of supplied authority; no host policy lookup is performed.
|
|
16
|
+
|
|
17
|
+
#### Extends
|
|
18
|
+
|
|
19
|
+
- `Error`
|
|
20
|
+
|
|
21
|
+
#### Constructors
|
|
22
|
+
|
|
23
|
+
##### Constructor
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
new AgentGrantError(reason): AgentGrantError;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
###### Parameters
|
|
30
|
+
|
|
31
|
+
| Parameter | Type |
|
|
32
|
+
| --------- | ------------------------------------------------------------------------------------- |
|
|
33
|
+
| `reason` | `"agent"` \| `"action"` \| `"expired"` \| `"delegation_loop"` \| `"delegation_depth"` |
|
|
34
|
+
|
|
35
|
+
###### Returns
|
|
36
|
+
|
|
37
|
+
[`AgentGrantError`](#agentgranterror)
|
|
38
|
+
|
|
39
|
+
###### Overrides
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
Error.constructor;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Properties
|
|
46
|
+
|
|
47
|
+
##### reason
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
readonly reason: "agent" | "action" | "expired" | "delegation_loop" | "delegation_depth";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### DirectoryError
|
|
56
|
+
|
|
57
|
+
Directory input, replay or storage refusal.
|
|
58
|
+
|
|
59
|
+
#### Extends
|
|
60
|
+
|
|
61
|
+
- `Error`
|
|
62
|
+
|
|
63
|
+
#### Constructors
|
|
64
|
+
|
|
65
|
+
##### Constructor
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
new DirectoryError(status, code): DirectoryError;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
###### Parameters
|
|
72
|
+
|
|
73
|
+
| Parameter | Type |
|
|
74
|
+
| --------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `status` | `400` \| `403` \| `404` \| `409` \| `503` |
|
|
76
|
+
| `code` | \| `"not_found"` \| `"invalid_input"` \| `"name_taken"` \| `"request_conflict"` \| `"computer_team_conflict"` \| `"partial_init"` |
|
|
77
|
+
|
|
78
|
+
###### Returns
|
|
79
|
+
|
|
80
|
+
[`DirectoryError`](#directoryerror)
|
|
81
|
+
|
|
82
|
+
###### Overrides
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
Error.constructor;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### Properties
|
|
89
|
+
|
|
90
|
+
##### status
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
readonly status: 400 | 403 | 404 | 409 | 503;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
##### code
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
readonly code:
|
|
100
|
+
| "not_found"
|
|
101
|
+
| "invalid_input"
|
|
102
|
+
| "name_taken"
|
|
103
|
+
| "request_conflict"
|
|
104
|
+
| "computer_team_conflict"
|
|
105
|
+
| "partial_init";
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Type Aliases
|
|
109
|
+
|
|
110
|
+
### AgentAction
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
type AgentAction = z.infer<typeof agentActionSchema>;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
One host-admitted fleet operation.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### AgentGrant
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
type AgentGrant = z.infer<typeof agentGrantSchema>;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A trusted host's bounded, addressed authority for fleet operations.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### AgentLifecycleFact
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
type AgentLifecycleFact = Readonly<{
|
|
134
|
+
kind: "created" | "deleted";
|
|
135
|
+
agentId: string;
|
|
136
|
+
provenance: AgentGrant["provenance"];
|
|
137
|
+
}>;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
A committed directory transition, returned in the host's transaction.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### AgentId
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
type AgentId = CairnId<"agent", "agent">;
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
An ordinary Agent directory identity.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### AgentCreation
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
type AgentCreation = z.infer<typeof agentCreationSchema>;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
One idempotent directory reservation.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### AgentRename
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
type AgentRename = z.infer<typeof agentRenameSchema>;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Input to [createAgentDirectory](#createagentdirectory)'s `rename`.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### DirectoryAgent
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
type DirectoryAgent = Readonly<{
|
|
178
|
+
agentId: AgentId;
|
|
179
|
+
name: string;
|
|
180
|
+
createdAt: number;
|
|
181
|
+
updatedAt: number;
|
|
182
|
+
}>;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
One durable Agent directory record.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### AgentDelegationTask
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
type AgentDelegationTask = z.infer<typeof agentDelegationTaskSchema>;
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
A caller reuses this task unchanged while polling Pending.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### AgentDelegationOutcome
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
type AgentDelegationOutcome = Readonly<{
|
|
203
|
+
kind: "settled";
|
|
204
|
+
agentId: string;
|
|
205
|
+
sessionId: string;
|
|
206
|
+
}> &
|
|
207
|
+
CommandSettlement;
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Exact settled Session facts, including Pi usage and tool-call records.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### FleetDelegationOptions
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
type FleetDelegationOptions = Readonly<{
|
|
218
|
+
storage: WatchdogSqliteOwner;
|
|
219
|
+
deliver: (mail) => Promise<Accepted>;
|
|
220
|
+
readSettlement: (
|
|
221
|
+
agentId,
|
|
222
|
+
sessionId,
|
|
223
|
+
commandId,
|
|
224
|
+
) => Promise<CommandSettlement | undefined>;
|
|
225
|
+
open: (agentId) => Promise<
|
|
226
|
+
Readonly<{
|
|
227
|
+
agent: ShiitakeAgent;
|
|
228
|
+
release: () => Promise<void>;
|
|
229
|
+
}>
|
|
230
|
+
>;
|
|
231
|
+
}>;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Ordinary runtime and mail transports; these ports do not decide host policy.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### AuthenticatedDelegationReply
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
type AuthenticatedDelegationReply = Readonly<{
|
|
242
|
+
ancestors: readonly string[];
|
|
243
|
+
maxDepth: number;
|
|
244
|
+
reply: VerifiedAgentReply;
|
|
245
|
+
}>;
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The delegation meta the host attaches to an authenticated reply: the caller's
|
|
249
|
+
own path plus the verified reply, whose `agentId` is the reply's author.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### DelegationSendMeta
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
type DelegationSendMeta = object;
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The host metadata a delegated send carries, as JSON.
|
|
260
|
+
|
|
261
|
+
#### Properties
|
|
262
|
+
|
|
263
|
+
##### author
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
author: FungiAuthor;
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
##### delegation?
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
optional delegation?: object;
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
###### ancestors
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
ancestors: string[];
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
###### maxDepth
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
maxDepth: number;
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
### DelegationReplyMeta
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
type DelegationReplyMeta = Readonly<{
|
|
293
|
+
author: FungiAuthor;
|
|
294
|
+
delegation: Readonly<{
|
|
295
|
+
ancestors: readonly string[];
|
|
296
|
+
maxDepth: number;
|
|
297
|
+
reply: VerifiedAgentReply;
|
|
298
|
+
}>;
|
|
299
|
+
}>;
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The host metadata on one authenticated reply line, as JSON.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
### FleetAgentAccess
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
type FleetAgentAccess = (
|
|
310
|
+
agentId,
|
|
311
|
+
meta?,
|
|
312
|
+
) => Promise<
|
|
313
|
+
Readonly<{
|
|
314
|
+
agent: ShiitakeAgent;
|
|
315
|
+
release: () => Promise<void>;
|
|
316
|
+
}>
|
|
317
|
+
>;
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Acquire ordinary Session access; an in-process host applies meta with withMeta.
|
|
321
|
+
|
|
322
|
+
#### Parameters
|
|
323
|
+
|
|
324
|
+
| Parameter | Type |
|
|
325
|
+
| --------- | ---------------------------- |
|
|
326
|
+
| `agentId` | `string` |
|
|
327
|
+
| `meta?` | [`Json`](extensions.md#json) |
|
|
328
|
+
|
|
329
|
+
#### Returns
|
|
330
|
+
|
|
331
|
+
`Promise`\<`Readonly`\<\{ `agent`: [`ShiitakeAgent`](client.md#shiitakeagent);
|
|
332
|
+
`release`: () => `Promise`\<`void`\>; \}\>\>
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### FleetMessage
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
type FleetMessage = Readonly<{
|
|
340
|
+
requestId: string;
|
|
341
|
+
text: string;
|
|
342
|
+
delivery?: "steer" | "followUp";
|
|
343
|
+
}>;
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
One idempotent prompt, using the Session owner's existing delivery grammar.
|
|
347
|
+
|
|
348
|
+
## Variables
|
|
349
|
+
|
|
350
|
+
### agentActionSchema
|
|
351
|
+
|
|
352
|
+
```ts
|
|
353
|
+
const agentActionSchema: ZodEnum<{
|
|
354
|
+
send: "send";
|
|
355
|
+
read: "read";
|
|
356
|
+
create: "create";
|
|
357
|
+
manage: "manage";
|
|
358
|
+
delegate: "delegate";
|
|
359
|
+
}>;
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Operations explicitly admitted by the host.
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
### agentProvenanceSchema
|
|
367
|
+
|
|
368
|
+
```ts
|
|
369
|
+
const agentProvenanceSchema: ZodObject<
|
|
370
|
+
{
|
|
371
|
+
actor: ZodString;
|
|
372
|
+
workflowRunId: ZodOptional<ZodString>;
|
|
373
|
+
toolCallInputDigest: ZodOptional<ZodString>;
|
|
374
|
+
session: ZodOptional<
|
|
375
|
+
ZodObject<
|
|
376
|
+
{
|
|
377
|
+
agentId: ZodString;
|
|
378
|
+
sessionId: ZodString;
|
|
379
|
+
},
|
|
380
|
+
$strict
|
|
381
|
+
>
|
|
382
|
+
>;
|
|
383
|
+
},
|
|
384
|
+
$strict
|
|
385
|
+
>;
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Attribution supplied by the admitting host, without Team semantics.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
### agentGrantSchema
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
const agentGrantSchema: ZodObject<
|
|
396
|
+
{
|
|
397
|
+
agents: ZodUnion<readonly [ZodLiteral<"all">, ZodArray<ZodString>]>;
|
|
398
|
+
actions: ZodArray<
|
|
399
|
+
ZodEnum<{
|
|
400
|
+
send: "send";
|
|
401
|
+
read: "read";
|
|
402
|
+
create: "create";
|
|
403
|
+
manage: "manage";
|
|
404
|
+
delegate: "delegate";
|
|
405
|
+
}>
|
|
406
|
+
>;
|
|
407
|
+
expiresAt: ZodNumber;
|
|
408
|
+
provenance: ZodObject<
|
|
409
|
+
{
|
|
410
|
+
actor: ZodString;
|
|
411
|
+
workflowRunId: ZodOptional<ZodString>;
|
|
412
|
+
toolCallInputDigest: ZodOptional<ZodString>;
|
|
413
|
+
session: ZodOptional<
|
|
414
|
+
ZodObject<
|
|
415
|
+
{
|
|
416
|
+
agentId: ZodString;
|
|
417
|
+
sessionId: ZodString;
|
|
418
|
+
},
|
|
419
|
+
$strict
|
|
420
|
+
>
|
|
421
|
+
>;
|
|
422
|
+
},
|
|
423
|
+
$strict
|
|
424
|
+
>;
|
|
425
|
+
meta: ZodOptional<ZodJSONSchema>;
|
|
426
|
+
maxDepth: ZodOptional<ZodNumber>;
|
|
427
|
+
},
|
|
428
|
+
$strict
|
|
429
|
+
>;
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Fleet authority is supplied, never looked up in host policy.
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### agentIds
|
|
437
|
+
|
|
438
|
+
```ts
|
|
439
|
+
const agentIds: Readonly<{
|
|
440
|
+
agent: IdCodec<"agent", "agent", 1>;
|
|
441
|
+
}>;
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Stable Agent identities, retained across host compositions.
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
### agentCreationSchema
|
|
449
|
+
|
|
450
|
+
```ts
|
|
451
|
+
const agentCreationSchema: ZodObject<
|
|
452
|
+
{
|
|
453
|
+
name: ZodString;
|
|
454
|
+
requestId: ZodString;
|
|
455
|
+
configuration: ZodString;
|
|
456
|
+
},
|
|
457
|
+
$strict
|
|
458
|
+
>;
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Stable replay input; configuration is an opaque host creation choice.
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
### agentRenameSchema
|
|
466
|
+
|
|
467
|
+
```ts
|
|
468
|
+
const agentRenameSchema: ZodObject<
|
|
469
|
+
{
|
|
470
|
+
name: ZodString;
|
|
471
|
+
},
|
|
472
|
+
$strict
|
|
473
|
+
>;
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Owner-only rename input: an Agent's new display name.
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
### agentDelegationTaskSchema
|
|
481
|
+
|
|
482
|
+
```ts
|
|
483
|
+
const agentDelegationTaskSchema: ZodObject<
|
|
484
|
+
{
|
|
485
|
+
requestId: ZodString;
|
|
486
|
+
agentId: ZodString;
|
|
487
|
+
sessionId: ZodOptional<ZodString>;
|
|
488
|
+
text: ZodString;
|
|
489
|
+
},
|
|
490
|
+
$strict
|
|
491
|
+
>;
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
Replay identity and work, with the parent supplied exclusively by the grant.
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
### commandSettlementSchema
|
|
499
|
+
|
|
500
|
+
```ts
|
|
501
|
+
const commandSettlementSchema: Schema.Codec<CommandSettlement>;
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Exact host facts encoded over internal transports, without transcript content.
|
|
505
|
+
|
|
506
|
+
## Functions
|
|
507
|
+
|
|
508
|
+
### assertAgentGrant()
|
|
509
|
+
|
|
510
|
+
```ts
|
|
511
|
+
function assertAgentGrant(grant, action, agentId?): void;
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
Check every operation against its explicit authority.
|
|
515
|
+
|
|
516
|
+
#### Parameters
|
|
517
|
+
|
|
518
|
+
| Parameter | Type | Description |
|
|
519
|
+
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
520
|
+
| `grant` | \{ `agents`: `string`[] \| `"all"`; `actions`: (`"send"` \| `"read"` \| `"create"` \| `"manage"` \| `"delegate"`)[]; `expiresAt`: `number`; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; `meta?`: `JSONType`; `maxDepth?`: `number`; \} | - |
|
|
521
|
+
| `grant.agents` | `string`[] \| `"all"` | - |
|
|
522
|
+
| `grant.actions` | (`"send"` \| `"read"` \| `"create"` \| `"manage"` \| `"delegate"`)[] | - |
|
|
523
|
+
| `grant.expiresAt?` | `number` | - |
|
|
524
|
+
| `grant.provenance?` | \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \} | - |
|
|
525
|
+
| `grant.provenance.actor?` | `string` | - |
|
|
526
|
+
| `grant.provenance.workflowRunId?` | `string` | - |
|
|
527
|
+
| `grant.provenance.toolCallInputDigest?` | `string` | Host fingerprint of the enclosing model program, frozen with replay input. |
|
|
528
|
+
| `grant.provenance.session?` | \{ `agentId`: `string`; `sessionId`: `string`; \} | - |
|
|
529
|
+
| `grant.provenance.session.agentId?` | `string` | - |
|
|
530
|
+
| `grant.provenance.session.sessionId?` | `string` | - |
|
|
531
|
+
| `grant.meta?` | `JSONType` | - |
|
|
532
|
+
| `grant.maxDepth?` | `number` | Delegation abuse bound; inherited paths may only narrow it. |
|
|
533
|
+
| `action?` | `"send"` \| `"read"` \| `"create"` \| `"manage"` \| `"delegate"` | - |
|
|
534
|
+
| `agentId?` | `string` | - |
|
|
535
|
+
|
|
536
|
+
#### Returns
|
|
537
|
+
|
|
538
|
+
`void`
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
### createAgentDirectory()
|
|
543
|
+
|
|
544
|
+
```ts
|
|
545
|
+
function createAgentDirectory(sql): object;
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Agent identities, replay receipts and erasure roster. Mutations belong inside
|
|
549
|
+
the caller's storage transaction, so lifecycle facts and host projections commit
|
|
550
|
+
together. Physical table names retain the existing Hub store layout.
|
|
551
|
+
|
|
552
|
+
#### Parameters
|
|
553
|
+
|
|
554
|
+
| Parameter | Type |
|
|
555
|
+
| --------- | ----------------------------------------------------------------------------------- |
|
|
556
|
+
| `sql` | `Readonly`\<\{ `exec`: (`statement`, ...`bindings`) => `WatchdogSqliteCursor`; \}\> |
|
|
557
|
+
|
|
558
|
+
#### Returns
|
|
559
|
+
|
|
560
|
+
| Name | Type | Default value | Description |
|
|
561
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
562
|
+
| `readCreation()` | (`grant`, `raw`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Resolve a matching creation receipt before host admission of a new reservation. |
|
|
563
|
+
| `create()` | (`grant`, `raw`) => \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: `null`; \} \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: \{ `kind`: `"created"`; `agentId`: `CairnId`\<`"agent"`, `"agent"`, `1`\>; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}; \} | - | Reserve an Agent once and return its committed lifecycle fact. |
|
|
564
|
+
| `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Read one admitted Agent identity. |
|
|
565
|
+
| `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[] | - | List only identities covered by the supplied grant. |
|
|
566
|
+
| `remove()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `kind`: `"deleted"` \| `"created"`; `agentId`: `string`; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}\> \| `null` | - | Remove an identity while retaining its erasure address. |
|
|
567
|
+
| `rename()` | (`grant`, `agentId`, `raw`) => [`DirectoryAgent`](#directoryagent) | - | Rename an existing Agent; refuses a name already held by another one. Owner-only rename; refuses a name already held by another Agent. |
|
|
568
|
+
| `readCreator()` | (`grant`, `agentId`) => `string` \| `null` | - | Read the host actor recorded at creation. The user who created an Agent; that user's own credentials follow it. |
|
|
569
|
+
| `listErasureIds()` | () => readonly `string`[] | `store.listErasureIds` | Enumerate retained addresses for host erasure. |
|
|
570
|
+
| `erasureRosterComplete()` | () => `boolean` | `store.erasureRosterComplete` | Whether the retained erasure roster covers this store. |
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
### delegationProvenance()
|
|
575
|
+
|
|
576
|
+
```ts
|
|
577
|
+
function delegationProvenance(
|
|
578
|
+
session,
|
|
579
|
+
toolCallCode?,
|
|
580
|
+
): Promise<{
|
|
581
|
+
actor: string;
|
|
582
|
+
workflowRunId?: string;
|
|
583
|
+
toolCallInputDigest?: string;
|
|
584
|
+
session?: {
|
|
585
|
+
agentId: string;
|
|
586
|
+
sessionId: string;
|
|
587
|
+
};
|
|
588
|
+
}>;
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
Provenance for one delegated send from the invoking Agent's Session. The model
|
|
592
|
+
program's digest is frozen with the replay input, so a retried tool call that
|
|
593
|
+
changed its code conflicts instead of replaying.
|
|
594
|
+
|
|
595
|
+
#### Parameters
|
|
596
|
+
|
|
597
|
+
| Parameter | Type |
|
|
598
|
+
| --------------- | --------------------------------------------------------------- |
|
|
599
|
+
| `session` | `Readonly`\<\{ `agentId`: `string`; `sessionId`: `string`; \}\> |
|
|
600
|
+
| `toolCallCode?` | `string` |
|
|
601
|
+
|
|
602
|
+
#### Returns
|
|
603
|
+
|
|
604
|
+
`Promise`\<\{ `actor`: `string`; `workflowRunId?`: `string`;
|
|
605
|
+
`toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`;
|
|
606
|
+
`sessionId`: `string`; \}; \}\>
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
### delegationSendMeta()
|
|
611
|
+
|
|
612
|
+
```ts
|
|
613
|
+
function delegationSendMeta(sender, invocationMeta?): DelegationSendMeta;
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
The host metadata one delegated send carries: the sending Agent as author and
|
|
617
|
+
only the path inherited from the invoking line. A reply's verified facts stay on
|
|
618
|
+
that reply's own line and never travel onward.
|
|
619
|
+
|
|
620
|
+
#### Parameters
|
|
621
|
+
|
|
622
|
+
| Parameter | Type |
|
|
623
|
+
| ----------------- | --------------------------------------- |
|
|
624
|
+
| `sender` | \{ `id`: `string`; `name`: `string`; \} |
|
|
625
|
+
| `sender.id` | `string` |
|
|
626
|
+
| `sender.name?` | `string` |
|
|
627
|
+
| `invocationMeta?` | [`Json`](extensions.md#json) |
|
|
628
|
+
|
|
629
|
+
#### Returns
|
|
630
|
+
|
|
631
|
+
[`DelegationSendMeta`](#delegationsendmeta)
|
|
632
|
+
|
|
633
|
+
---
|
|
634
|
+
|
|
635
|
+
### delegationReplyMeta()
|
|
636
|
+
|
|
637
|
+
```ts
|
|
638
|
+
function delegationReplyMeta(delegation, replierName): DelegationReplyMeta;
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
The host metadata for one authenticated reply line: the replying Agent is its
|
|
642
|
+
author, and the verified reply rides beside the caller's own path.
|
|
643
|
+
|
|
644
|
+
#### Parameters
|
|
645
|
+
|
|
646
|
+
| Parameter | Type |
|
|
647
|
+
| ------------- | --------------------------------------------------------------- |
|
|
648
|
+
| `delegation` | [`AuthenticatedDelegationReply`](#authenticateddelegationreply) |
|
|
649
|
+
| `replierName` | `string` |
|
|
650
|
+
|
|
651
|
+
#### Returns
|
|
652
|
+
|
|
653
|
+
[`DelegationReplyMeta`](#delegationreplymeta)
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
### createFleetDelegation()
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
function createFleetDelegation(options): object;
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
Hosted BirdDog submission and Pending observation. The durable row freezes
|
|
664
|
+
correspondence before transport; an ambiguous delivery reuses that exact mail.
|
|
665
|
+
Shiitake owns work deduplication, execution and settlement; Post owns replies.
|
|
666
|
+
|
|
667
|
+
#### Parameters
|
|
668
|
+
|
|
669
|
+
| Parameter | Type |
|
|
670
|
+
| --------- | --------------------------------------------------- |
|
|
671
|
+
| `options` | [`FleetDelegationOptions`](#fleetdelegationoptions) |
|
|
672
|
+
|
|
673
|
+
#### Returns
|
|
674
|
+
|
|
675
|
+
| Name | Type | Description |
|
|
676
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
677
|
+
| `authenticateReply()` | (`mail`) => \| `Readonly`\<\{ `ancestors`: readonly `string`[]; `maxDepth`: `number`; `reply`: \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`; `agentId`: `string`; `sessionId`: `string`; \}; \}\> \| `undefined` | Authenticate a reply against its frozen mail and restore the caller's path. Authenticate one arriving reply against the frozen mail this owner sent. It must be BirdDog's single reply key for that mail, mirror its sender and recipient exactly, carry BirdDog's settlement facts and, once the send's receipt is recorded, name that receipt's `commandId`. The result restores the caller's own delegation path and the verified reply; it never reads the reply's text or any settlement metadata. |
|
|
678
|
+
| `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit once and return the existing Shiitake admission receipt. |
|
|
679
|
+
| `delegate()` | (`grant`, `task`) => `Promise`\< \| `Readonly`\<\{ `kind`: `"pending"`; `retryAfterMs`: `number`; \}\> \| [`AgentDelegationOutcome`](#agentdelegationoutcome)\> | Submit or poll the exact turn, yielding Agar Pending until settled. |
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
### createFleetSessions()
|
|
684
|
+
|
|
685
|
+
```ts
|
|
686
|
+
function createFleetSessions(open): object;
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Addressed Session operations over the existing Shiitake client. Each operation
|
|
690
|
+
checks a fresh supplied grant and releases its transport without stopping work.
|
|
691
|
+
|
|
692
|
+
#### Parameters
|
|
693
|
+
|
|
694
|
+
| Parameter | Type |
|
|
695
|
+
| --------- | --------------------------------------- |
|
|
696
|
+
| `open` | [`FleetAgentAccess`](#fleetagentaccess) |
|
|
697
|
+
|
|
698
|
+
#### Returns
|
|
699
|
+
|
|
700
|
+
| Name | Type | Description |
|
|
701
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
702
|
+
| `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> | Enumerate existing Sessions through the owner's bounded cursor. |
|
|
703
|
+
| `read()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly `Readonly`\<\{ `meta?`: [`Json`](extensions.md#json); `origin?`: `Readonly`\<\{ `extensionId`: ...; `correlation`: ...; \}\>; `id`: `string`; `sequence`: `number`; `commandId`: `string` \| `null`; `value`: `Message`; \}\>[]; `terminals`: readonly `Readonly`\<\{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"`; `sequence`: `number`; `diagnostic`: `string` \| `null`; `meta?`: [`Json`](extensions.md#json); \}\>[]; `compactions?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `tokensBefore`: `number`; `tokensAfter`: `number` \| `null`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger) \| `null`; \}\>[]; `compactionNotices?`: readonly `Readonly`\<\{ `id`: `string`; `sequence`: `number`; `at`: `number`; `trigger`: [`SessionCompactionTrigger`](client.md#sessioncompactiontrigger); `result`: `"failed"` \| `"nothing_to_compact"`; `diagnostic`: `string` \| `null`; \}\>[]; `sandboxFailures?`: readonly `object`[]; `pending`: [`SessionPendingPrompts`](client.md#sessionpendingprompts); `activity`: [`SessionActivity`](client.md#sessionactivity); `progress`: \| `Readonly`\<\{ `messageId`: `string`; `revision`: `number`; `text`: `string`; `thinking`: `string`; `textTruncated`: `boolean`; `thinkingTruncated`: `boolean`; \}\> \| `null`; `extensions`: [`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`: readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`: `number` \| `null`; \}\>; \}\>\> | Open the exact saved conversation without creating work. |
|
|
704
|
+
| `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\> | Create a Session once under the caller's replay identity. |
|
|
705
|
+
| `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\> | Remove a Session through its runtime owner. |
|
|
706
|
+
| `send()` | (`grant`, `agentId`, `sessionId`, `message`) => `Promise`\<\{ `status`: `"accepted"`; `commandId`: `string`; `sessionId`: `string`; \}\> | Send once; an omitted Session is created under the same replay identity. |
|