@fungi.computer/shiitake 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -21
- package/dist/agent-control.d.ts +94 -2
- package/dist/agent-control.js +147 -26
- package/dist/client-entry.d.ts +20 -0
- package/dist/client-entry.js +5 -0
- package/dist/client-visitor.d.ts +33 -0
- package/dist/client-visitor.js +231 -0
- package/dist/client-wire.d.ts +9 -0
- package/dist/client-wire.js +24 -3
- package/dist/client.d.ts +27 -6
- package/dist/client.js +23 -0
- package/dist/cloudflare.d.ts +20 -0
- package/dist/cloudflare.js +4 -1
- package/dist/delegation.d.ts +79 -53
- package/dist/delegation.js +26 -21
- package/dist/effect.d.ts +26 -1
- package/dist/effect.js +14 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -0
- package/dist/extensions.d.ts +22 -3
- package/dist/extensions.js +1 -1
- package/dist/fleet.d.ts +25 -2
- package/dist/fleet.js +108 -24
- package/dist/hosted.js +3 -0
- package/dist/http-routes.d.ts +23 -9
- package/dist/http.d.ts +1 -0
- package/dist/http.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/internal/accepted-run-executor.js +2 -1
- package/dist/internal/admission-door.d.ts +6 -1
- package/dist/internal/admission-door.js +33 -3
- package/dist/internal/contracts.d.ts +19 -1
- package/dist/internal/coordinator.js +115 -52
- package/dist/internal/effect-client.js +1 -1
- package/dist/internal/effect-contracts.d.ts +9 -2
- package/dist/internal/extension-command-registry.d.ts +2 -1
- package/dist/internal/extension-command-registry.js +3 -1
- package/dist/internal/extension-runtime.d.ts +3 -1
- package/dist/internal/extension-runtime.js +18 -8
- package/dist/internal/model-acquisition.js +2 -0
- package/dist/internal/observation-kernel.d.ts +2 -0
- package/dist/internal/observation-kernel.js +17 -6
- package/dist/internal/promise-facade.js +2 -0
- package/dist/internal/run-scope.d.ts +14 -0
- package/dist/internal/run-scope.js +58 -15
- package/dist/internal/runtime-coordinator.d.ts +14 -0
- package/dist/internal/runtime-coordinator.js +60 -11
- package/dist/internal/runtime-core.d.ts +3 -0
- package/dist/internal/runtime-core.js +1 -0
- package/dist/internal/runtime-reconciliation.js +123 -25
- package/dist/internal/session-context.d.ts +5 -5
- package/dist/internal/session-context.js +80 -83
- package/dist/internal/session-status.d.ts +2 -2
- package/dist/internal/session-status.js +5 -3
- package/dist/internal/woodstock/agent-reply.d.ts +5 -0
- package/dist/internal/woodstock/agent-reply.js +3 -0
- package/dist/internal/woodstock/client-projection.js +13 -11
- package/dist/internal/woodstock/fleet-store.d.ts +3 -2
- package/dist/internal/woodstock/fleet-store.js +24 -4
- package/dist/internal/woodstock/index.d.ts +7 -3
- package/dist/internal/woodstock/index.js +23 -6
- package/dist/internal/woodstock/progress.d.ts +11 -1
- package/dist/internal/woodstock/progress.js +126 -25
- package/dist/internal/woodstock/session-delegator.d.ts +13 -0
- package/dist/internal/woodstock/session-delegator.js +44 -0
- package/dist/internal/woodstock/session-entry.d.ts +12 -2
- package/dist/internal/woodstock/session-store.d.ts +16 -2
- package/dist/internal/woodstock/session-store.js +349 -66
- package/dist/internal/woodstock/work-senders.d.ts +32 -0
- package/dist/internal/woodstock/work-senders.js +70 -0
- package/dist/node.js +11 -2
- package/dist/remote-client.js +7 -2
- package/dist/server-visitor-stream.d.ts +13 -0
- package/dist/server-visitor-stream.js +124 -0
- package/dist/session-attention.d.ts +30 -0
- package/dist/session-attention.js +14 -0
- package/docs/api/agent-control.md +212 -15
- package/docs/api/client-entry.md +3 -0
- package/docs/api/client.md +209 -5
- package/docs/api/cloudflare.md +23 -1
- package/docs/api/delegation.md +284 -77
- package/docs/api/effect.md +100 -12
- package/docs/api/extensions.md +73 -12
- package/docs/api/fleet.md +138 -25
- package/docs/api/http.md +28 -0
- package/docs/api/index.md +43 -17
- package/docs/api/testing.md +9 -7
- package/package.json +10 -6
package/docs/api/delegation.md
CHANGED
|
@@ -24,9 +24,9 @@ new AgentDelegation(deps): AgentDelegation;
|
|
|
24
24
|
|
|
25
25
|
###### Parameters
|
|
26
26
|
|
|
27
|
-
| Parameter | Type
|
|
28
|
-
| --------- |
|
|
29
|
-
| `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `expiresAt`: () => `number`; `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `directory`: () => [`AgentControlDirectory`](agent-control.md#agentcontroldirectory); `deliver`: (`mail`) => `Promise`\<[`DelegationReceipt`](client.md#delegationreceipt)\>; `prepare`: (`mail`) => `Promise`\<`void`\>; `accept`: (`mail`, `reply
|
|
27
|
+
| Parameter | Type |
|
|
28
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `expiresAt`: () => `number`; `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `directory`: () => [`AgentControlDirectory`](agent-control.md#agentcontroldirectory); `deliver`: (`mail`) => `Promise`\<[`DelegationReceipt`](client.md#delegationreceipt)\>; `prepare`: (`mail`) => `Promise`\<`void`\>; `stageAcceptedNotice`: (`mail`, `scopeId`) => `void`; `accept`: (`mail`, `reply`, `stageAcceptedNotice`) => `Promise`\<[`Accepted`](client.md#accepted)\>; \}\> |
|
|
30
30
|
|
|
31
31
|
###### Returns
|
|
32
32
|
|
|
@@ -34,6 +34,26 @@ new AgentDelegation(deps): AgentDelegation;
|
|
|
34
34
|
|
|
35
35
|
#### Methods
|
|
36
36
|
|
|
37
|
+
##### refreshOutstanding()
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
refreshOutstanding(readSettlement): Promise<void>;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Best-effort remote refresh before an owner-local archive transaction. Confirmed
|
|
44
|
+
settlements are recorded by Shiitake; unreadable targets leave their local
|
|
45
|
+
accepted receipt outstanding for busySync to refuse.
|
|
46
|
+
|
|
47
|
+
###### Parameters
|
|
48
|
+
|
|
49
|
+
| Parameter | Type |
|
|
50
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `readSettlement` | (`agentId`, `sessionId`, `commandId`) => `Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `delegator`: `string` \| `null`; `terminal`: [`SessionTerminal`](client.md#sessionterminal); `content`: `string`; `usage`: readonly `Pick`\<`AssistantMessage`, `"model"` \| `"provider"` \| `"usage"`\>[]; `toolCalls`: `number`; `waitingOnYou`: readonly `Readonly`\<\{ `itemId`: `string`; `kind`: `string`; `summary`: `string`; \}\>[]; \}\> \| `undefined`\> |
|
|
52
|
+
|
|
53
|
+
###### Returns
|
|
54
|
+
|
|
55
|
+
`Promise`\<`void`\>
|
|
56
|
+
|
|
37
57
|
##### settlement()
|
|
38
58
|
|
|
39
59
|
```ts
|
|
@@ -45,10 +65,16 @@ settlement(
|
|
|
45
65
|
): Promise<
|
|
46
66
|
| Readonly<{
|
|
47
67
|
acceptedSender: string | null;
|
|
68
|
+
delegator: string | null;
|
|
48
69
|
terminal: SessionTerminal;
|
|
49
70
|
content: string;
|
|
50
71
|
usage: readonly Pick<AssistantMessage, "model" | "provider" | "usage">[];
|
|
51
72
|
toolCalls: number;
|
|
73
|
+
waitingOnYou: readonly Readonly<{
|
|
74
|
+
itemId: string;
|
|
75
|
+
kind: string;
|
|
76
|
+
summary: string;
|
|
77
|
+
}>[];
|
|
52
78
|
}>
|
|
53
79
|
| undefined>;
|
|
54
80
|
```
|
|
@@ -66,10 +92,12 @@ Recipient-local disclosure through the public host, never another Agent's RPC.
|
|
|
66
92
|
|
|
67
93
|
###### Returns
|
|
68
94
|
|
|
69
|
-
`Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `
|
|
70
|
-
[`SessionTerminal`](client.md#sessionterminal);
|
|
71
|
-
readonly `Pick`\<`AssistantMessage`, `"model"` \|
|
|
72
|
-
`toolCalls`: `number`;
|
|
95
|
+
`Promise`\< \| `Readonly`\<\{ `acceptedSender`: `string` \| `null`; `delegator`:
|
|
96
|
+
`string` \| `null`; `terminal`: [`SessionTerminal`](client.md#sessionterminal);
|
|
97
|
+
`content`: `string`; `usage`: readonly `Pick`\<`AssistantMessage`, `"model"` \|
|
|
98
|
+
`"provider"` \| `"usage"`\>[]; `toolCalls`: `number`; `waitingOnYou`: readonly
|
|
99
|
+
`Readonly`\<\{ `itemId`: `string`; `kind`: `string`; `summary`: `string`;
|
|
100
|
+
\}\>[]; \}\> \| `undefined`\>
|
|
73
101
|
|
|
74
102
|
##### send()
|
|
75
103
|
|
|
@@ -82,8 +110,8 @@ send(
|
|
|
82
110
|
): Promise<DelegationReceipt>;
|
|
83
111
|
```
|
|
84
112
|
|
|
85
|
-
Delegate work to an in-scope Agent
|
|
86
|
-
|
|
113
|
+
Delegate work to an in-scope Agent through fleet correspondence; a steer rides
|
|
114
|
+
the mail.
|
|
87
115
|
|
|
88
116
|
###### Parameters
|
|
89
117
|
|
|
@@ -144,6 +172,24 @@ Admit one addressed Agent mail for this Agent, or refuse it.
|
|
|
144
172
|
|
|
145
173
|
`Promise`\<`PostDeliveryResult`\>
|
|
146
174
|
|
|
175
|
+
##### localUndeliverable()
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
localUndeliverable(original): Promise<PostDeliveryResult>;
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Admit local outbox exhaustion through the same Fleet/system reply gate.
|
|
182
|
+
|
|
183
|
+
###### Parameters
|
|
184
|
+
|
|
185
|
+
| Parameter | Type |
|
|
186
|
+
| ---------- | ------------- |
|
|
187
|
+
| `original` | `BirdDogMail` |
|
|
188
|
+
|
|
189
|
+
###### Returns
|
|
190
|
+
|
|
191
|
+
`Promise`\<`PostDeliveryResult`\>
|
|
192
|
+
|
|
147
193
|
---
|
|
148
194
|
|
|
149
195
|
### AgentDisclosureRefused
|
|
@@ -189,9 +235,9 @@ new AgentMail(deps): AgentMail;
|
|
|
189
235
|
|
|
190
236
|
###### Parameters
|
|
191
237
|
|
|
192
|
-
| Parameter | Type
|
|
193
|
-
| --------- |
|
|
194
|
-
| `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `post`: () => [`AgentMailPost`](#agentmailpost); `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `replySettlement`: [`AgentReplySettlement`](#agentreplysettlement); `drain`: () => `Promise`\<`void`\>; `wake`: () => `Promise`\<`void`\>; \}\> |
|
|
238
|
+
| Parameter | Type |
|
|
239
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
240
|
+
| `deps` | `Readonly`\<\{ `storage`: `WatchdogSqliteOwner`; `post`: () => [`AgentMailPost`](#agentmailpost); `identity`: () => \| [`DelegationIdentity`](#delegationidentity) \| `null` \| `Promise`\<[`DelegationIdentity`](#delegationidentity) \| `null`\>; `replySettlement`: [`AgentReplySettlement`](#agentreplysettlement); `onUndeliverable`: (`original`, `reply`) => `Promise`\<`PostDeliveryResult`\>; `drain`: () => `Promise`\<`void`\>; `wake`: () => `Promise`\<`void`\>; \}\> |
|
|
195
241
|
|
|
196
242
|
###### Returns
|
|
197
243
|
|
|
@@ -217,18 +263,53 @@ Submit one mail and return recipient acceptance or relay-held custody.
|
|
|
217
263
|
|
|
218
264
|
`Promise`\<[`DelegationReceipt`](client.md#delegationreceipt)\>
|
|
219
265
|
|
|
266
|
+
##### stageUndeliverableReplies()
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
stageUndeliverableReplies(): Promise<void>;
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Reconcile exhausted original outbox mail into one local system reply.
|
|
273
|
+
|
|
274
|
+
###### Returns
|
|
275
|
+
|
|
276
|
+
`Promise`\<`void`\>
|
|
277
|
+
|
|
278
|
+
##### stageAcceptedNotice()
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
stageAcceptedNotice(mail, scopeId): void;
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Stage the acceptance reply through this Post owner without leaving the
|
|
285
|
+
transaction.
|
|
286
|
+
|
|
287
|
+
###### Parameters
|
|
288
|
+
|
|
289
|
+
| Parameter | Type |
|
|
290
|
+
| --------- | ------------- |
|
|
291
|
+
| `mail` | `BirdDogMail` |
|
|
292
|
+
| `scopeId` | `string` |
|
|
293
|
+
|
|
294
|
+
###### Returns
|
|
295
|
+
|
|
296
|
+
`void`
|
|
297
|
+
|
|
220
298
|
##### mailRoom()
|
|
221
299
|
|
|
222
300
|
```ts
|
|
223
|
-
mailRoom():
|
|
301
|
+
mailRoom(): Readonly<{
|
|
302
|
+
fanOut: (settlement) => Effect<void, BirdDogError>;
|
|
303
|
+
postMail?: (mail) => Effect<void, BirdDogError>;
|
|
304
|
+
drainOutbox: () => Effect<void, BirdDogError>;
|
|
305
|
+
nextWakeAt: () => Effect<number | undefined, BirdDogError>;
|
|
306
|
+
}> & object;
|
|
224
307
|
```
|
|
225
308
|
|
|
226
309
|
BirdDog's mail room: disclosed settlement replies fan out over Post.
|
|
227
310
|
|
|
228
311
|
###### Returns
|
|
229
312
|
|
|
230
|
-
`BirdDogEffect`
|
|
231
|
-
|
|
232
313
|
## Type Aliases
|
|
233
314
|
|
|
234
315
|
### DelegationIdentity
|
|
@@ -272,7 +353,7 @@ type AgentMailPost = Pick<
|
|
|
272
353
|
PostRuntime<{
|
|
273
354
|
agentMail: ReturnType<typeof agentMailRoute>;
|
|
274
355
|
}>,
|
|
275
|
-
"send" | "read" | "nextWake"
|
|
356
|
+
"send" | "read" | "nextWake" | "deadLetters"
|
|
276
357
|
>;
|
|
277
358
|
```
|
|
278
359
|
|
|
@@ -302,106 +383,210 @@ link routes Agent work without owning Shiitake's grammar.
|
|
|
302
383
|
### agentMailRoute()
|
|
303
384
|
|
|
304
385
|
```ts
|
|
305
|
-
function agentMailRoute(namespace, replySettlement): PostRoute<AgentMailAddress,
|
|
306
|
-
|
|
307
|
-
to: {
|
|
308
|
-
kind: "agent";
|
|
309
|
-
agentId: string;
|
|
310
|
-
sessionId: string;
|
|
311
|
-
};
|
|
386
|
+
function agentMailRoute(namespace, replySettlement): PostRoute<AgentMailAddress,
|
|
387
|
+
| {
|
|
312
388
|
from: {
|
|
313
389
|
kind: "agent";
|
|
314
390
|
agentId: string;
|
|
315
391
|
sessionId: string;
|
|
316
392
|
};
|
|
317
|
-
replyTo: readonly object[];
|
|
318
|
-
content: string;
|
|
319
|
-
createdAt: number;
|
|
320
|
-
meta?: Json | undefined;
|
|
321
393
|
reply?: | {
|
|
322
394
|
commandId: string;
|
|
323
395
|
outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
|
|
324
396
|
diagnostic?: string;
|
|
397
|
+
waitingOnYou?: readonly object[];
|
|
398
|
+
}
|
|
399
|
+
| {
|
|
400
|
+
outcome: "accepted";
|
|
401
|
+
commandId: string;
|
|
325
402
|
}
|
|
326
403
|
| {
|
|
327
404
|
outcome: "undeliverable";
|
|
328
|
-
reason: "
|
|
405
|
+
reason: "recipient_left";
|
|
329
406
|
};
|
|
330
|
-
}, {
|
|
331
407
|
key: string;
|
|
332
408
|
to: {
|
|
333
409
|
kind: "agent";
|
|
334
410
|
agentId: string;
|
|
335
|
-
sessionId
|
|
411
|
+
sessionId?: string;
|
|
336
412
|
};
|
|
413
|
+
replyTo: readonly object[];
|
|
414
|
+
content: string;
|
|
415
|
+
createdAt: number;
|
|
416
|
+
meta?: Json | undefined;
|
|
417
|
+
}
|
|
418
|
+
| {
|
|
337
419
|
from: {
|
|
420
|
+
kind: "system";
|
|
421
|
+
systemId: "hub";
|
|
422
|
+
};
|
|
423
|
+
reply: {
|
|
424
|
+
outcome: "undeliverable";
|
|
425
|
+
reason: "recipient_offline";
|
|
426
|
+
};
|
|
427
|
+
key: string;
|
|
428
|
+
to: {
|
|
338
429
|
kind: "agent";
|
|
339
430
|
agentId: string;
|
|
340
|
-
sessionId
|
|
431
|
+
sessionId?: string;
|
|
341
432
|
};
|
|
342
433
|
replyTo: readonly object[];
|
|
343
434
|
content: string;
|
|
344
435
|
createdAt: number;
|
|
345
436
|
meta?: Json | undefined;
|
|
437
|
+
},
|
|
438
|
+
| {
|
|
439
|
+
from: {
|
|
440
|
+
kind: "agent";
|
|
441
|
+
agentId: string;
|
|
442
|
+
sessionId: string;
|
|
443
|
+
};
|
|
346
444
|
reply?: | {
|
|
347
445
|
commandId: string;
|
|
348
446
|
outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
|
|
349
447
|
diagnostic?: string;
|
|
448
|
+
waitingOnYou?: readonly object[];
|
|
449
|
+
}
|
|
450
|
+
| {
|
|
451
|
+
outcome: "accepted";
|
|
452
|
+
commandId: string;
|
|
350
453
|
}
|
|
351
454
|
| {
|
|
352
455
|
outcome: "undeliverable";
|
|
353
|
-
reason: "
|
|
456
|
+
reason: "recipient_left";
|
|
354
457
|
};
|
|
355
|
-
}, AgentMailAddress, {
|
|
356
458
|
key: string;
|
|
357
459
|
to: {
|
|
358
460
|
kind: "agent";
|
|
359
461
|
agentId: string;
|
|
360
|
-
sessionId
|
|
462
|
+
sessionId?: string;
|
|
361
463
|
};
|
|
464
|
+
replyTo: readonly object[];
|
|
465
|
+
content: string;
|
|
466
|
+
createdAt: number;
|
|
467
|
+
meta?: Json | undefined;
|
|
468
|
+
}
|
|
469
|
+
| {
|
|
362
470
|
from: {
|
|
471
|
+
kind: "system";
|
|
472
|
+
systemId: "hub";
|
|
473
|
+
};
|
|
474
|
+
reply: {
|
|
475
|
+
outcome: "undeliverable";
|
|
476
|
+
reason: "recipient_offline";
|
|
477
|
+
};
|
|
478
|
+
key: string;
|
|
479
|
+
to: {
|
|
363
480
|
kind: "agent";
|
|
364
481
|
agentId: string;
|
|
365
|
-
sessionId
|
|
482
|
+
sessionId?: string;
|
|
366
483
|
};
|
|
367
484
|
replyTo: readonly object[];
|
|
368
485
|
content: string;
|
|
369
486
|
createdAt: number;
|
|
370
487
|
meta?: Json | undefined;
|
|
488
|
+
}, AgentMailAddress,
|
|
489
|
+
| {
|
|
490
|
+
from: {
|
|
491
|
+
kind: "agent";
|
|
492
|
+
agentId: string;
|
|
493
|
+
sessionId: string;
|
|
494
|
+
};
|
|
371
495
|
reply?: | {
|
|
372
496
|
commandId: string;
|
|
373
497
|
outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
|
|
374
498
|
diagnostic?: string;
|
|
499
|
+
waitingOnYou?: readonly object[];
|
|
500
|
+
}
|
|
501
|
+
| {
|
|
502
|
+
outcome: "accepted";
|
|
503
|
+
commandId: string;
|
|
375
504
|
}
|
|
376
505
|
| {
|
|
377
506
|
outcome: "undeliverable";
|
|
378
|
-
reason: "
|
|
507
|
+
reason: "recipient_left";
|
|
379
508
|
};
|
|
380
|
-
}, {
|
|
381
509
|
key: string;
|
|
382
510
|
to: {
|
|
383
511
|
kind: "agent";
|
|
384
512
|
agentId: string;
|
|
385
|
-
sessionId
|
|
513
|
+
sessionId?: string;
|
|
386
514
|
};
|
|
515
|
+
replyTo: readonly object[];
|
|
516
|
+
content: string;
|
|
517
|
+
createdAt: number;
|
|
518
|
+
meta?: Json | undefined;
|
|
519
|
+
}
|
|
520
|
+
| {
|
|
387
521
|
from: {
|
|
522
|
+
kind: "system";
|
|
523
|
+
systemId: "hub";
|
|
524
|
+
};
|
|
525
|
+
reply: {
|
|
526
|
+
outcome: "undeliverable";
|
|
527
|
+
reason: "recipient_offline";
|
|
528
|
+
};
|
|
529
|
+
key: string;
|
|
530
|
+
to: {
|
|
388
531
|
kind: "agent";
|
|
389
532
|
agentId: string;
|
|
390
|
-
sessionId
|
|
533
|
+
sessionId?: string;
|
|
391
534
|
};
|
|
392
535
|
replyTo: readonly object[];
|
|
393
536
|
content: string;
|
|
394
537
|
createdAt: number;
|
|
395
538
|
meta?: Json | undefined;
|
|
539
|
+
},
|
|
540
|
+
| {
|
|
541
|
+
from: {
|
|
542
|
+
kind: "agent";
|
|
543
|
+
agentId: string;
|
|
544
|
+
sessionId: string;
|
|
545
|
+
};
|
|
396
546
|
reply?: | {
|
|
397
547
|
commandId: string;
|
|
398
548
|
outcome: "completed" | "failed" | "cancelled" | "interrupted" | "outcome_unknown";
|
|
399
549
|
diagnostic?: string;
|
|
550
|
+
waitingOnYou?: readonly object[];
|
|
551
|
+
}
|
|
552
|
+
| {
|
|
553
|
+
outcome: "accepted";
|
|
554
|
+
commandId: string;
|
|
400
555
|
}
|
|
401
556
|
| {
|
|
402
557
|
outcome: "undeliverable";
|
|
403
|
-
reason: "
|
|
558
|
+
reason: "recipient_left";
|
|
404
559
|
};
|
|
560
|
+
key: string;
|
|
561
|
+
to: {
|
|
562
|
+
kind: "agent";
|
|
563
|
+
agentId: string;
|
|
564
|
+
sessionId?: string;
|
|
565
|
+
};
|
|
566
|
+
replyTo: readonly object[];
|
|
567
|
+
content: string;
|
|
568
|
+
createdAt: number;
|
|
569
|
+
meta?: Json | undefined;
|
|
570
|
+
}
|
|
571
|
+
| {
|
|
572
|
+
from: {
|
|
573
|
+
kind: "system";
|
|
574
|
+
systemId: "hub";
|
|
575
|
+
};
|
|
576
|
+
reply: {
|
|
577
|
+
outcome: "undeliverable";
|
|
578
|
+
reason: "recipient_offline";
|
|
579
|
+
};
|
|
580
|
+
key: string;
|
|
581
|
+
to: {
|
|
582
|
+
kind: "agent";
|
|
583
|
+
agentId: string;
|
|
584
|
+
sessionId?: string;
|
|
585
|
+
};
|
|
586
|
+
replyTo: readonly object[];
|
|
587
|
+
content: string;
|
|
588
|
+
createdAt: number;
|
|
589
|
+
meta?: Json | undefined;
|
|
405
590
|
}> & Omit<Readonly<{
|
|
406
591
|
addressKind: string;
|
|
407
592
|
deadlineMs?: number;
|
|
@@ -439,45 +624,67 @@ retries.
|
|
|
439
624
|
|
|
440
625
|
#### Returns
|
|
441
626
|
|
|
442
|
-
`PostRoute`\<`AgentMailAddress`, \{ `
|
|
443
|
-
`
|
|
444
|
-
`
|
|
445
|
-
`
|
|
446
|
-
`
|
|
447
|
-
`
|
|
448
|
-
`
|
|
449
|
-
|
|
450
|
-
`
|
|
451
|
-
`
|
|
452
|
-
`
|
|
627
|
+
`PostRoute`\<`AgentMailAddress`, \| \{ `from`: \{ `kind`: `"agent"`; `agentId`:
|
|
628
|
+
`string`; `sessionId`: `string`; \}; `reply?`: \| \{ `commandId`: `string`;
|
|
629
|
+
`outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \|
|
|
630
|
+
`"outcome_unknown"`; `diagnostic?`: `string`; `waitingOnYou?`: readonly
|
|
631
|
+
`object`[]; \} \| \{ `outcome`: `"accepted"`; `commandId`: `string`; \} \| \{
|
|
632
|
+
`outcome`: `"undeliverable"`; `reason`: `"recipient_left"`; \}; `key`: `string`;
|
|
633
|
+
`to`: \{ `kind`: `"agent"`; `agentId`: `string`; `sessionId?`: `string`; \};
|
|
634
|
+
`replyTo`: readonly `object`[]; `content`: `string`; `createdAt`: `number`;
|
|
635
|
+
`meta?`: Json \| undefined; \} \| \{ `from`: \{ `kind`: `"system"`; `systemId`:
|
|
636
|
+
`"hub"`; \}; `reply`: \{ `outcome`: `"undeliverable"`; `reason`:
|
|
637
|
+
`"recipient_offline"`; \}; `key`: `string`; `to`: \{ `kind`: `"agent"`;
|
|
638
|
+
`agentId`: `string`; `sessionId?`: `string`; \}; `replyTo`: readonly `object`[];
|
|
639
|
+
`content`: `string`; `createdAt`: `number`; `meta?`: Json \| undefined; \}, \|
|
|
640
|
+
\{ `from`: \{ `kind`: `"agent"`; `agentId`: `string`; `sessionId`: `string`; \};
|
|
453
641
|
`reply?`: \| \{ `commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \|
|
|
454
642
|
`"cancelled"` \| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`:
|
|
455
|
-
`string`; \} \| \{ `outcome`:
|
|
456
|
-
|
|
457
|
-
`
|
|
458
|
-
`
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
`"
|
|
462
|
-
|
|
463
|
-
`
|
|
464
|
-
|
|
465
|
-
`
|
|
466
|
-
|
|
467
|
-
\|
|
|
468
|
-
`
|
|
469
|
-
`
|
|
470
|
-
`"
|
|
471
|
-
`
|
|
472
|
-
`
|
|
473
|
-
|
|
474
|
-
`
|
|
475
|
-
`kind`: `
|
|
476
|
-
`
|
|
477
|
-
`
|
|
478
|
-
|
|
479
|
-
`
|
|
480
|
-
|
|
643
|
+
`string`; `waitingOnYou?`: readonly `object`[]; \} \| \{ `outcome`:
|
|
644
|
+
`"accepted"`; `commandId`: `string`; \} \| \{ `outcome`: `"undeliverable"`;
|
|
645
|
+
`reason`: `"recipient_left"`; \}; `key`: `string`; `to`: \{ `kind`: `"agent"`;
|
|
646
|
+
`agentId`: `string`; `sessionId?`: `string`; \}; `replyTo`: readonly `object`[];
|
|
647
|
+
`content`: `string`; `createdAt`: `number`; `meta?`: Json \| undefined; \} \| \{
|
|
648
|
+
`from`: \{ `kind`: `"system"`; `systemId`: `"hub"`; \}; `reply`: \{ `outcome`:
|
|
649
|
+
`"undeliverable"`; `reason`: `"recipient_offline"`; \}; `key`: `string`; `to`:
|
|
650
|
+
\{ `kind`: `"agent"`; `agentId`: `string`; `sessionId?`: `string`; \};
|
|
651
|
+
`replyTo`: readonly `object`[]; `content`: `string`; `createdAt`: `number`;
|
|
652
|
+
`meta?`: Json \| undefined; \}, `AgentMailAddress`, \| \{ `from`: \{ `kind`:
|
|
653
|
+
`"agent"`; `agentId`: `string`; `sessionId`: `string`; \}; `reply?`: \| \{
|
|
654
|
+
`commandId`: `string`; `outcome`: `"completed"` \| `"failed"` \| `"cancelled"`
|
|
655
|
+
\| `"interrupted"` \| `"outcome_unknown"`; `diagnostic?`: `string`;
|
|
656
|
+
`waitingOnYou?`: readonly `object`[]; \} \| \{ `outcome`: `"accepted"`;
|
|
657
|
+
`commandId`: `string`; \} \| \{ `outcome`: `"undeliverable"`; `reason`:
|
|
658
|
+
`"recipient_left"`; \}; `key`: `string`; `to`: \{ `kind`: `"agent"`; `agentId`:
|
|
659
|
+
`string`; `sessionId?`: `string`; \}; `replyTo`: readonly `object`[]; `content`:
|
|
660
|
+
`string`; `createdAt`: `number`; `meta?`: Json \| undefined; \} \| \{ `from`: \{
|
|
661
|
+
`kind`: `"system"`; `systemId`: `"hub"`; \}; `reply`: \{ `outcome`:
|
|
662
|
+
`"undeliverable"`; `reason`: `"recipient_offline"`; \}; `key`: `string`; `to`:
|
|
663
|
+
\{ `kind`: `"agent"`; `agentId`: `string`; `sessionId?`: `string`; \};
|
|
664
|
+
`replyTo`: readonly `object`[]; `content`: `string`; `createdAt`: `number`;
|
|
665
|
+
`meta?`: Json \| undefined; \}, \| \{ `from`: \{ `kind`: `"agent"`; `agentId`:
|
|
666
|
+
`string`; `sessionId`: `string`; \}; `reply?`: \| \{ `commandId`: `string`;
|
|
667
|
+
`outcome`: `"completed"` \| `"failed"` \| `"cancelled"` \| `"interrupted"` \|
|
|
668
|
+
`"outcome_unknown"`; `diagnostic?`: `string`; `waitingOnYou?`: readonly
|
|
669
|
+
`object`[]; \} \| \{ `outcome`: `"accepted"`; `commandId`: `string`; \} \| \{
|
|
670
|
+
`outcome`: `"undeliverable"`; `reason`: `"recipient_left"`; \}; `key`: `string`;
|
|
671
|
+
`to`: \{ `kind`: `"agent"`; `agentId`: `string`; `sessionId?`: `string`; \};
|
|
672
|
+
`replyTo`: readonly `object`[]; `content`: `string`; `createdAt`: `number`;
|
|
673
|
+
`meta?`: Json \| undefined; \} \| \{ `from`: \{ `kind`: `"system"`; `systemId`:
|
|
674
|
+
`"hub"`; \}; `reply`: \{ `outcome`: `"undeliverable"`; `reason`:
|
|
675
|
+
`"recipient_offline"`; \}; `key`: `string`; `to`: \{ `kind`: `"agent"`;
|
|
676
|
+
`agentId`: `string`; `sessionId?`: `string`; \}; `replyTo`: readonly `object`[];
|
|
677
|
+
`content`: `string`; `createdAt`: `number`; `meta?`: Json \| undefined; \}\> &
|
|
678
|
+
`Omit`\<`Readonly`\<\{ `addressKind`: `string`; `deadlineMs?`: `number`;
|
|
679
|
+
`address`: `Codec`\<`unknown`, `unknown`\>; `event`: `Codec`\<`unknown`,
|
|
680
|
+
`unknown`\>; `encodeEnvelope`: (`envelope`) => `object`; `parseDelivery`:
|
|
681
|
+
(`envelope`) => `object`; `prepareEnvelope?`: (`envelope`, `signal`) =>
|
|
682
|
+
`Promise`\<\{ `key`: `string`; `kind`: `string`; `address`: `unknown`; `event`:
|
|
683
|
+
`unknown`; \}\>; `recordDelivered?`: (`envelope`) => `void`; `nameOf`:
|
|
684
|
+
(`envelope`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) =>
|
|
685
|
+
`Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<...\>; \}\>; \}\>;
|
|
686
|
+
`recordCursor?`: (`envelope`, `cursor`) => `void`; `recordRefused?`:
|
|
687
|
+
(`envelope`) => `void`; \}\>, `"event"` \| `"address"`\>
|
|
481
688
|
|
|
482
689
|
---
|
|
483
690
|
|