@fungi.computer/shiitake 0.1.0 → 0.3.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 +155 -34
- package/dist/agent-control.d.ts +78 -11
- package/dist/agent-control.js +273 -70
- package/dist/client-entry.d.ts +15 -8
- package/dist/client-entry.js +7 -5
- package/dist/client-wire.d.ts +24 -8
- package/dist/client-wire.js +53 -11
- package/dist/client.d.ts +56 -11
- package/dist/client.js +1 -1
- package/dist/cloudflare.d.ts +42 -23
- package/dist/cloudflare.js +76 -54
- package/dist/cold-sessions.d.ts +28 -0
- package/dist/cold-sessions.js +1 -0
- package/dist/delegation.d.ts +214 -0
- package/dist/delegation.js +319 -0
- package/dist/effect.d.ts +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -2
- package/dist/extension-contract.d.ts +10 -2
- package/dist/extensions.d.ts +6 -2
- package/dist/fleet.d.ts +52 -34
- package/dist/fleet.js +101 -63
- package/dist/hosted.js +1 -0
- package/dist/http-routes.d.ts +106 -22
- package/dist/http-routes.js +18 -1
- package/dist/index.d.ts +3 -2
- package/dist/internal/accepted-run-executor.d.ts +5 -0
- package/dist/internal/accepted-run-executor.js +10 -4
- package/dist/internal/admission-door.d.ts +3 -0
- package/dist/internal/admission-door.js +12 -2
- package/dist/internal/client-boundary.js +7 -1
- package/dist/internal/compaction/compaction-slot.d.ts +36 -0
- package/dist/internal/compaction/compaction-slot.js +41 -0
- package/dist/internal/compaction/compaction.d.ts +7 -4
- package/dist/internal/compaction/compaction.js +59 -30
- package/dist/internal/compaction/session-compaction.d.ts +8 -16
- package/dist/internal/compaction/session-compaction.js +358 -119
- package/dist/internal/compaction/settings.js +5 -0
- package/dist/internal/compaction/utils.d.ts +19 -16
- package/dist/internal/compaction/utils.js +30 -84
- package/dist/internal/contracts.d.ts +40 -13
- package/dist/internal/coordinator.js +28 -10
- package/dist/internal/effect-client.d.ts +4 -2
- package/dist/internal/effect-client.js +29 -0
- package/dist/internal/effect-contracts.d.ts +17 -4
- package/dist/internal/extension-runtime.d.ts +5 -0
- package/dist/internal/extension-runtime.js +184 -89
- package/dist/internal/host-meta.d.ts +7 -0
- package/dist/internal/model-acquisition.js +7 -1
- package/dist/internal/model-preference.d.ts +2 -0
- package/dist/internal/model-preference.js +2 -1
- package/dist/internal/promise-facade.js +4 -16
- package/dist/internal/run-failure-reason.d.ts +10 -0
- package/dist/internal/run-failure-reason.js +19 -0
- package/dist/internal/run-scope.d.ts +4 -1
- package/dist/internal/run-scope.js +38 -5
- package/dist/internal/runtime-coordinator.d.ts +2 -1
- package/dist/internal/runtime-coordinator.js +65 -4
- package/dist/internal/runtime-core.js +1 -0
- package/dist/internal/runtime-reconciliation.js +42 -6
- package/dist/internal/session-context.d.ts +1 -2
- package/dist/internal/session-context.js +8 -30
- package/dist/internal/session-status.d.ts +2 -1
- package/dist/internal/session-status.js +4 -1
- package/dist/internal/woodstock/client-projection.d.ts +6 -5
- package/dist/internal/woodstock/client-projection.js +79 -53
- package/dist/internal/woodstock/cold-sessions.d.ts +4 -0
- package/dist/internal/woodstock/cold-sessions.js +90 -0
- package/dist/internal/woodstock/extension-store.d.ts +2 -0
- package/dist/internal/woodstock/extension-store.js +4 -0
- package/dist/internal/woodstock/fleet-store.d.ts +3 -3
- package/dist/internal/woodstock/fleet-store.js +16 -11
- package/dist/internal/woodstock/index.d.ts +11 -3
- package/dist/internal/woodstock/index.js +33 -14
- package/dist/internal/woodstock/progress.d.ts +14 -1
- package/dist/internal/woodstock/progress.js +97 -19
- package/dist/internal/woodstock/run-recovery.js +6 -4
- package/dist/internal/woodstock/session-attention.d.ts +1 -1
- package/dist/internal/woodstock/session-attention.js +2 -2
- package/dist/internal/woodstock/session-entry.d.ts +109 -42
- package/dist/internal/woodstock/session-entry.js +63 -20
- package/dist/internal/woodstock/session-inbox.js +2 -0
- package/dist/internal/woodstock/session-store.d.ts +104 -24
- package/dist/internal/woodstock/session-store.js +937 -246
- package/dist/internal/woodstock/storage-admission.d.ts +8 -8
- package/dist/internal/woodstock/storage-admission.js +8 -34
- package/dist/internal/woodstock/storage-conformance.d.ts +15 -0
- package/dist/internal/woodstock/storage-conformance.js +489 -0
- package/dist/model-preference.d.ts +2 -2
- package/dist/model-preference.js +2 -2
- package/dist/node.js +1 -1
- package/dist/remote-client.js +8 -1
- package/dist/session-attention.d.ts +8 -1
- package/dist/session-attention.js +6 -1
- package/dist/testing.js +1 -0
- package/docs/api/README.md +18 -16
- package/docs/api/agent-control.md +172 -2
- package/docs/api/client-entry.md +26 -10
- package/docs/api/client.md +153 -37
- package/docs/api/cloudflare.md +76 -23
- package/docs/api/delegation.md +485 -0
- package/docs/api/effect.md +20 -2
- package/docs/api/extensions.md +21 -9
- package/docs/api/fleet.md +149 -122
- package/docs/api/http.md +4 -1
- package/docs/api/index.md +116 -20
- package/docs/api/internal/woodstock/storage-conformance.md +81 -0
- package/docs/api/model-preference.md +17 -0
- package/docs/api/testing.md +16 -4
- package/package.json +26 -14
- package/dist/internal/browser-sessions.d.ts +0 -31
- package/dist/internal/browser-sessions.js +0 -173
package/docs/api/fleet.md
CHANGED
|
@@ -176,6 +176,7 @@ Input to [createAgentDirectory](#createagentdirectory)'s `rename`.
|
|
|
176
176
|
```ts
|
|
177
177
|
type DirectoryAgent = Readonly<{
|
|
178
178
|
agentId: AgentId;
|
|
179
|
+
createdBy: string | null;
|
|
179
180
|
name: string;
|
|
180
181
|
createdAt: number;
|
|
181
182
|
updatedAt: number;
|
|
@@ -263,7 +264,7 @@ The host metadata a delegated send carries, as JSON.
|
|
|
263
264
|
##### author
|
|
264
265
|
|
|
265
266
|
```ts
|
|
266
|
-
author:
|
|
267
|
+
author: AuthorMeta["author"];
|
|
267
268
|
```
|
|
268
269
|
|
|
269
270
|
##### delegation?
|
|
@@ -290,7 +291,7 @@ maxDepth: number;
|
|
|
290
291
|
|
|
291
292
|
```ts
|
|
292
293
|
type DelegationReplyMeta = Readonly<{
|
|
293
|
-
author:
|
|
294
|
+
author: AuthorMeta["author"];
|
|
294
295
|
delegation: Readonly<{
|
|
295
296
|
ancestors: readonly string[];
|
|
296
297
|
maxDepth: number;
|
|
@@ -303,30 +304,19 @@ The host metadata on one authenticated reply line, as JSON.
|
|
|
303
304
|
|
|
304
305
|
---
|
|
305
306
|
|
|
306
|
-
###
|
|
307
|
+
### OutstandingDelegation
|
|
307
308
|
|
|
308
309
|
```ts
|
|
309
|
-
type
|
|
310
|
+
type OutstandingDelegation = Readonly<{
|
|
310
311
|
agentId: string;
|
|
311
312
|
sessionId: string;
|
|
312
|
-
|
|
313
|
+
commandId: string;
|
|
314
|
+
unreadable?: string;
|
|
313
315
|
}>;
|
|
314
316
|
```
|
|
315
317
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
### FleetRecipients
|
|
321
|
-
|
|
322
|
-
```ts
|
|
323
|
-
type FleetRecipients = Readonly<{
|
|
324
|
-
recipients: readonly FleetRecipient[];
|
|
325
|
-
more: number;
|
|
326
|
-
}>;
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
A bounded page of recipients and how many more exist past it.
|
|
318
|
+
Delegated work an owner still waits on; `unreadable` says why its state could
|
|
319
|
+
not be read, when it could not.
|
|
330
320
|
|
|
331
321
|
---
|
|
332
322
|
|
|
@@ -393,22 +383,24 @@ Operations explicitly admitted by the host.
|
|
|
393
383
|
### agentProvenanceSchema
|
|
394
384
|
|
|
395
385
|
```ts
|
|
396
|
-
const agentProvenanceSchema:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
386
|
+
const agentProvenanceSchema: ZodLazy<
|
|
387
|
+
ZodObject<
|
|
388
|
+
{
|
|
389
|
+
actor: ZodString;
|
|
390
|
+
workflowRunId: ZodOptional<ZodString>;
|
|
391
|
+
toolCallInputDigest: ZodOptional<ZodString>;
|
|
392
|
+
session: ZodOptional<
|
|
393
|
+
ZodObject<
|
|
394
|
+
{
|
|
395
|
+
agentId: ZodString;
|
|
396
|
+
sessionId: ZodString;
|
|
397
|
+
},
|
|
398
|
+
$strict
|
|
399
|
+
>
|
|
400
|
+
>;
|
|
401
|
+
},
|
|
402
|
+
$strict
|
|
403
|
+
>
|
|
412
404
|
>;
|
|
413
405
|
```
|
|
414
406
|
|
|
@@ -419,40 +411,44 @@ Attribution supplied by the admitting host, without Team semantics.
|
|
|
419
411
|
### agentGrantSchema
|
|
420
412
|
|
|
421
413
|
```ts
|
|
422
|
-
const agentGrantSchema:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
414
|
+
const agentGrantSchema: ZodLazy<
|
|
415
|
+
ZodObject<
|
|
416
|
+
{
|
|
417
|
+
agents: ZodUnion<readonly [ZodLiteral<"all">, ZodArray<ZodString>]>;
|
|
418
|
+
actions: ZodArray<
|
|
419
|
+
ZodEnum<{
|
|
420
|
+
send: "send";
|
|
421
|
+
read: "read";
|
|
422
|
+
create: "create";
|
|
423
|
+
manage: "manage";
|
|
424
|
+
delegate: "delegate";
|
|
425
|
+
}>
|
|
426
|
+
>;
|
|
427
|
+
expiresAt: ZodNumber;
|
|
428
|
+
provenance: ZodLazy<
|
|
429
|
+
ZodObject<
|
|
430
|
+
{
|
|
431
|
+
actor: ZodString;
|
|
432
|
+
workflowRunId: ZodOptional<ZodString>;
|
|
433
|
+
toolCallInputDigest: ZodOptional<ZodString>;
|
|
434
|
+
session: ZodOptional<
|
|
435
|
+
ZodObject<
|
|
436
|
+
{
|
|
437
|
+
agentId: ZodString;
|
|
438
|
+
sessionId: ZodString;
|
|
439
|
+
},
|
|
440
|
+
$strict
|
|
441
|
+
>
|
|
442
|
+
>;
|
|
443
|
+
},
|
|
444
|
+
$strict
|
|
445
|
+
>
|
|
446
|
+
>;
|
|
447
|
+
meta: ZodOptional<ZodJSONSchema>;
|
|
448
|
+
maxDepth: ZodOptional<ZodNumber>;
|
|
449
|
+
},
|
|
450
|
+
$strict
|
|
451
|
+
>
|
|
456
452
|
>;
|
|
457
453
|
```
|
|
458
454
|
|
|
@@ -475,13 +471,16 @@ Stable Agent identities, retained across host compositions.
|
|
|
475
471
|
### agentCreationSchema
|
|
476
472
|
|
|
477
473
|
```ts
|
|
478
|
-
const agentCreationSchema:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
474
|
+
const agentCreationSchema: ZodLazy<
|
|
475
|
+
ZodObject<
|
|
476
|
+
{
|
|
477
|
+
name: ZodString;
|
|
478
|
+
requestId: ZodString;
|
|
479
|
+
configuration: ZodString;
|
|
480
|
+
createdBy: ZodOptional<ZodNullable<ZodString>>;
|
|
481
|
+
},
|
|
482
|
+
$strict
|
|
483
|
+
>
|
|
485
484
|
>;
|
|
486
485
|
```
|
|
487
486
|
|
|
@@ -492,11 +491,13 @@ Stable replay input; configuration is an opaque host creation choice.
|
|
|
492
491
|
### agentRenameSchema
|
|
493
492
|
|
|
494
493
|
```ts
|
|
495
|
-
const agentRenameSchema:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
494
|
+
const agentRenameSchema: ZodLazy<
|
|
495
|
+
ZodObject<
|
|
496
|
+
{
|
|
497
|
+
name: ZodString;
|
|
498
|
+
},
|
|
499
|
+
$strict
|
|
500
|
+
>
|
|
500
501
|
>;
|
|
501
502
|
```
|
|
502
503
|
|
|
@@ -507,14 +508,16 @@ Owner-only rename input: an Agent's new display name.
|
|
|
507
508
|
### agentDelegationTaskSchema
|
|
508
509
|
|
|
509
510
|
```ts
|
|
510
|
-
const agentDelegationTaskSchema:
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
511
|
+
const agentDelegationTaskSchema: ZodLazy<
|
|
512
|
+
ZodObject<
|
|
513
|
+
{
|
|
514
|
+
requestId: ZodString;
|
|
515
|
+
agentId: ZodString;
|
|
516
|
+
sessionId: ZodOptional<ZodString>;
|
|
517
|
+
text: ZodString;
|
|
518
|
+
},
|
|
519
|
+
$strict
|
|
520
|
+
>
|
|
518
521
|
>;
|
|
519
522
|
```
|
|
520
523
|
|
|
@@ -584,17 +587,17 @@ together. Physical table names retain the existing Hub store layout.
|
|
|
584
587
|
|
|
585
588
|
#### Returns
|
|
586
589
|
|
|
587
|
-
| Name | Type
|
|
588
|
-
| ------------------------- |
|
|
589
|
-
| `readCreation()` | (`grant`, `raw`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null`
|
|
590
|
-
| `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. |
|
|
591
|
-
| `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null`
|
|
592
|
-
| `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[]
|
|
593
|
-
| `remove()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `kind`: `"deleted"` \| `"created"`; `agentId`: `string`; `provenance`: \{ `actor`: `string`; `workflowRunId?`: `string`; `toolCallInputDigest?`: `string`; `session?`: \{ `agentId`: `string`; `sessionId`: `string`; \}; \}; \}\> \| `null`
|
|
594
|
-
| `rename()` | (`grant`, `agentId`, `raw`) => [`DirectoryAgent`](#directoryagent)
|
|
595
|
-
| `readCreator()` | (`grant`, `agentId`) => `string` \| `null`
|
|
596
|
-
| `listErasureIds()` | () => readonly `string`[]
|
|
597
|
-
| `erasureRosterComplete()` | () => `boolean`
|
|
590
|
+
| Name | Type | Default value | Description |
|
|
591
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
592
|
+
| `readCreation()` | (`grant`, `raw`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Resolve a matching creation receipt before host admission of a new reservation. |
|
|
593
|
+
| `create()` | (`grant`, `raw`) => \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>; `fact`: `null`; \} \| \{ `agent`: `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `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. |
|
|
594
|
+
| `read()` | (`grant`, `agentId`) => \| `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\> \| `null` | - | Read one admitted Agent identity. |
|
|
595
|
+
| `list()` | (`grant`) => readonly `Readonly`\<\{ `agentId`: [`AgentId`](#agentid); `createdBy`: `string` \| `null`; `name`: `string`; `createdAt`: `number`; `updatedAt`: `number`; \}\>[] | - | List only identities covered by the supplied grant. |
|
|
596
|
+
| `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. |
|
|
597
|
+
| `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. |
|
|
598
|
+
| `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. |
|
|
599
|
+
| `listErasureIds()` | () => readonly `string`[] | `store.listErasureIds` | Enumerate retained addresses for host erasure. |
|
|
600
|
+
| `erasureRosterComplete()` | () => `boolean` | `store.erasureRosterComplete` | Whether the retained erasure roster covers this store. |
|
|
598
601
|
|
|
599
602
|
---
|
|
600
603
|
|
|
@@ -646,12 +649,10 @@ that reply's own line and never travel onward.
|
|
|
646
649
|
|
|
647
650
|
#### Parameters
|
|
648
651
|
|
|
649
|
-
| Parameter | Type
|
|
650
|
-
| ----------------- |
|
|
651
|
-
| `sender` |
|
|
652
|
-
| `
|
|
653
|
-
| `sender.name?` | `string` |
|
|
654
|
-
| `invocationMeta?` | [`Json`](extensions.md#json) |
|
|
652
|
+
| Parameter | Type |
|
|
653
|
+
| ----------------- | ----------------------------------------------------- |
|
|
654
|
+
| `sender` | `Readonly`\<\{ `id`: `string`; `name`: `string`; \}\> |
|
|
655
|
+
| `invocationMeta?` | [`Json`](extensions.md#json) |
|
|
655
656
|
|
|
656
657
|
#### Returns
|
|
657
658
|
|
|
@@ -681,30 +682,56 @@ author, and the verified reply rides beside the caller's own path.
|
|
|
681
682
|
|
|
682
683
|
---
|
|
683
684
|
|
|
684
|
-
###
|
|
685
|
+
### createFleetCorrespondence()
|
|
685
686
|
|
|
686
687
|
```ts
|
|
687
|
-
function
|
|
688
|
+
function createFleetCorrespondence(options): object;
|
|
688
689
|
```
|
|
689
690
|
|
|
690
|
-
|
|
691
|
+
BirdDog submission and reply authentication. The durable row freezes
|
|
691
692
|
correspondence before transport; an ambiguous delivery reuses that exact mail.
|
|
692
693
|
Shiitake owns work deduplication, execution and settlement; Post owns replies.
|
|
693
694
|
|
|
694
695
|
#### Parameters
|
|
695
696
|
|
|
697
|
+
| Parameter | Type |
|
|
698
|
+
| --------- | --------------------------------------------------------------------------------- |
|
|
699
|
+
| `options` | `Omit`\<[`FleetDelegationOptions`](#fleetdelegationoptions), `"readSettlement"`\> |
|
|
700
|
+
|
|
701
|
+
#### Returns
|
|
702
|
+
|
|
703
|
+
| Name | Type | Description |
|
|
704
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
705
|
+
| `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit frozen mail or reuse its recorded Session admission receipt. |
|
|
706
|
+
| `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` | Match a reply to frozen mail and restore the caller's delegation 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. |
|
|
707
|
+
| `receipt()` | (`requestId`) => \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\> \| `undefined` | Read an existing acceptance receipt without reserving or delivering mail. Read only the existing acceptance receipt; do not reserve or deliver mail. |
|
|
708
|
+
|
|
709
|
+
---
|
|
710
|
+
|
|
711
|
+
### createFleetDelegation()
|
|
712
|
+
|
|
713
|
+
```ts
|
|
714
|
+
function createFleetDelegation(options): object;
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
Local hosts may observe exact work directly; remote correspondence never pulls
|
|
718
|
+
it.
|
|
719
|
+
|
|
720
|
+
#### Parameters
|
|
721
|
+
|
|
696
722
|
| Parameter | Type |
|
|
697
723
|
| --------- | --------------------------------------------------- |
|
|
698
724
|
| `options` | [`FleetDelegationOptions`](#fleetdelegationoptions) |
|
|
699
725
|
|
|
700
726
|
#### Returns
|
|
701
727
|
|
|
702
|
-
| Name | Type | Description
|
|
703
|
-
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
704
|
-
| `
|
|
705
|
-
| `
|
|
706
|
-
| `
|
|
707
|
-
| `
|
|
728
|
+
| Name | Type | Description |
|
|
729
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
730
|
+
| `start()` | (`grant`, `raw`) => `Promise`\<`Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\>\> | Submit frozen mail or reuse its recorded Session admission receipt. |
|
|
731
|
+
| `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` | Match a reply to frozen mail and restore the caller's delegation 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. |
|
|
732
|
+
| `receipt()` | (`requestId`) => \| `Readonly`\<\{ `status`: `"accepted"`; `commandId`: `string`; \}\> \| `undefined` | Read an existing acceptance receipt without reserving or delivering mail. Read only the existing acceptance receipt; do not reserve or deliver mail. |
|
|
733
|
+
| `outstanding()` | () => `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `sessionId`: `string`; `commandId`: `string`; `unreadable?`: `string`; \}\> \| `undefined`\> | The delegated work this owner still waits on, if any. The newest delegation this owner sent whose work has not settled at its target, so the owner is still waiting for a reply; undefined when none. |
|
|
734
|
+
| `delegate()` | (`grant`, `task`) => `Promise`\< \| `Readonly`\<\{ `kind`: `"pending"`; `retryAfterMs`: `number`; \}\> \| [`AgentDelegationOutcome`](#agentdelegationoutcome)\> | Submit or poll the exact turn, yielding Agar Pending until settled. |
|
|
708
735
|
|
|
709
736
|
---
|
|
710
737
|
|
|
@@ -725,10 +752,10 @@ checks a fresh supplied grant and releases its transport without stopping work.
|
|
|
725
752
|
|
|
726
753
|
#### Returns
|
|
727
754
|
|
|
728
|
-
| Name | Type
|
|
729
|
-
| ---------- |
|
|
730
|
-
| `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\>
|
|
731
|
-
| `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`: `
|
|
732
|
-
| `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\>
|
|
733
|
-
| `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\>
|
|
734
|
-
| `send()` | (`grant`, `agentId`, `sessionId`, `message`) => `Promise`\<\{ `status`: `"accepted"`; `commandId`: `string`; `sessionId`: `string`; \}\>
|
|
755
|
+
| Name | Type | Description |
|
|
756
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
757
|
+
| `list()` | (`grant`, `agentId`, `after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> | Enumerate existing Sessions through the owner's bounded cursor. |
|
|
758
|
+
| `read()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`Readonly`\<\{ `sessionId`: `string`; `cursor`: `string` \| `null`; `hasMore`: `boolean`; `oldestCursor?`: `string` \| `null`; `messages`: readonly `Readonly`\<\{ `requestId?`: `string`; `meta?`: [`Json`](extensions.md#json); `data?`: [`Json`](extensions.md#json); `origin?`: `Readonly`\<\{ `extensionId`: ...; `correlation`: ...; \}\>; `id`: `string`; `sequence`: `number`; `commandId`: `string` \| `null`; `value`: [`ModelMessage`](client.md#modelmessage); \}\>[]; `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"` \| `"stale"` \| `"insufficient"`; `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`; `toolOutput`: readonly `Readonly`\<\{ `toolCallId`: `string`; `revision`: `number`; `tail`: `string`; `droppedBytes`: `number`; `totalBytes`: `number`; \}\>[]; `extensions`: [`SessionExtensionSlots`](client.md#sessionextensionslots); `attention`: readonly `object`[]; `context?`: `Readonly`\<\{ `tokens`: `number`; `window`: `number` \| `null`; \}\>; \}\>\> | Open the exact saved conversation without creating work. |
|
|
759
|
+
| `create()` | (`grant`, `agentId`, `requestId`) => `Promise`\<`string`\> | Create a Session once under the caller's replay identity. |
|
|
760
|
+
| `remove()` | (`grant`, `agentId`, `sessionId`) => `Promise`\<`boolean`\> | Remove a Session through its runtime owner. |
|
|
761
|
+
| `send()` | (`grant`, `agentId`, `sessionId`, `message`) => `Promise`\<\{ `status`: `"accepted"`; `commandId`: `string`; `sessionId`: `string`; \}\> | Send once; an omitted Session is created under the same replay identity. |
|
package/docs/api/http.md
CHANGED
|
@@ -86,6 +86,8 @@ function createShiitakeHttpRoutes(
|
|
|
86
86
|
object &
|
|
87
87
|
object &
|
|
88
88
|
object &
|
|
89
|
+
object &
|
|
90
|
+
object &
|
|
89
91
|
object,
|
|
90
92
|
"/",
|
|
91
93
|
"/sessions/:sessionId/events"
|
|
@@ -108,4 +110,5 @@ Build Shiitake's typed HTTP routes around an existing Session owner.
|
|
|
108
110
|
|
|
109
111
|
`Hono`\<[`ShiitakeHttpEnv`](#shiitakehttpenv), `object` & `object` & `object` &
|
|
110
112
|
`object` & `object` & `object` & `object` & `object` & `object` & `object` &
|
|
111
|
-
`object` & `object
|
|
113
|
+
`object` & `object` & `object` & `object`, `"/"`,
|
|
114
|
+
`"/sessions/:sessionId/events"`\>
|