@effect-agent/storage-cloudflare 0.1.0-beta.114 → 0.1.0-beta.116

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.
@@ -4,7 +4,7 @@ import { CanonicalRecordEnvelope } from "effect-agent/records";
4
4
  import { AppendConflict, AppendResult, FenceRejected, FencedAppendRequest, ThreadExport, ThreadExportRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadStoreError, ThreadTail, ThreadTailRequest } from "effect-agent/thread-store";
5
5
  import { AbortCommand, AbortIntent, AdmissionConflict, AdmissionPolicyError, AdmissionRequest, AdmissionResult, ChildSettledNotification, JoinedToHost, LedgerError, MarkReadyRequest, SettlementConflict, SubmissionLookupByKey, SubmissionSnapshot } from "effect-agent/submission-ledger";
6
6
  declare namespace PortProtocol_d_exports {
7
- export { LedgerAdmitCall, LedgerAdmitResult, LedgerLookupCall, LedgerLookupResult, LedgerMarkReadyCall, LedgerMarkReadyResult, LedgerRecordChildSettledCall, LedgerRecordChildSettledResult, LedgerRequestAbortCall, LedgerRequestAbortResult, LedgerResolveAdmissionCall, LedgerResolveAdmissionResult, MAX_PORT_DIAGNOSTIC_LENGTH, MessageDeliveryListCall, MessageDeliveryListResult, PortFailed, PortFailure, PortProtocolError, PortRequest, PortRequestEnvelope, PortResponse, PortResponseEnvelope, PortResult, PortSucceeded, StoreAppendCall, StoreAppendResult, StoreCountPeerMessagesCall, StoreCountPeerMessagesResult, StoreExportCall, StoreExportResult, StoreInspectTailCall, StoreInspectTailResult, StoreMaterializeCall, StoreMaterializeResult, StoreReadPageCall, StoreReadPageResult, boundPortDiagnostic, decodePortRequest, decodePortResponse, encodePortRequest, encodePortResponse };
7
+ export { LedgerAdmitCall, LedgerAdmitResult, LedgerInspectWorkerCall, LedgerInspectWorkerResult, LedgerLookupCall, LedgerLookupResult, LedgerMarkReadyCall, LedgerMarkReadyResult, LedgerRecordChildSettledCall, LedgerRecordChildSettledResult, LedgerRequestAbortCall, LedgerRequestAbortResult, LedgerResolveAdmissionCall, LedgerResolveAdmissionResult, LedgerStopWorkerCall, LedgerStopWorkerResult, MAX_PORT_DIAGNOSTIC_LENGTH, MessageDeliveryListCall, MessageDeliveryListResult, PortFailed, PortFailure, PortProtocolError, PortRequest, PortRequestEnvelope, PortResponse, PortResponseEnvelope, PortResult, PortSucceeded, StoreAppendCall, StoreAppendResult, StoreCountPeerMessagesCall, StoreCountPeerMessagesResult, StoreExportCall, StoreExportResult, StoreInspectTailCall, StoreInspectTailResult, StoreMaterializeCall, StoreMaterializeResult, StoreReadPageCall, StoreReadPageResult, boundPortDiagnostic, decodePortRequest, decodePortResponse, encodePortRequest, encodePortResponse };
8
8
  }
9
9
  /**
10
10
  * The cross-Durable-Object port protocol (plan §1.3, D-P6-3): Schema request/response/error
@@ -67,6 +67,32 @@ declare const LedgerResolveAdmissionCall_base: Schema.Class<LedgerResolveAdmissi
67
67
  }>, {}>;
68
68
  /** Routed `SubmissionLedger.resolveAdmission` — the SUB-031 tri-state authority call. */
69
69
  export declare class LedgerResolveAdmissionCall extends LedgerResolveAdmissionCall_base {}
70
+ declare const LedgerInspectWorkerCall_base: Schema.Class<LedgerInspectWorkerCall, Schema.TaggedStruct<"LedgerInspectWorker", {
71
+ readonly request: Schema.Struct<{
72
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
73
+ }>;
74
+ }>, {}>;
75
+ export declare class LedgerInspectWorkerCall extends LedgerInspectWorkerCall_base {}
76
+ declare const LedgerInspectWorkerResult_base: Schema.Class<LedgerInspectWorkerResult, Schema.TaggedStruct<"LedgerInspectWorkerResult", {
77
+ readonly state: Schema.Struct<{
78
+ readonly latest: Schema.NullOr<typeof SubmissionSnapshot>;
79
+ readonly active: Schema.NullOr<typeof SubmissionSnapshot>;
80
+ readonly stopped: Schema.Boolean;
81
+ readonly terminal: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "cancelled"]>>;
82
+ }>;
83
+ }>, {}>;
84
+ export declare class LedgerInspectWorkerResult extends LedgerInspectWorkerResult_base {}
85
+ declare const LedgerStopWorkerCall_base: Schema.Class<LedgerStopWorkerCall, Schema.TaggedStruct<"LedgerStopWorker", {
86
+ readonly request: Schema.Struct<{
87
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
88
+ readonly author: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
89
+ }>;
90
+ }>, {}>;
91
+ export declare class LedgerStopWorkerCall extends LedgerStopWorkerCall_base {}
92
+ declare const LedgerStopWorkerResult_base: Schema.Class<LedgerStopWorkerResult, Schema.TaggedStruct<"LedgerStopWorkerResult", {
93
+ readonly owned: Schema.Natural;
94
+ }>, {}>;
95
+ export declare class LedgerStopWorkerResult extends LedgerStopWorkerResult_base {}
70
96
  declare const LedgerRequestAbortCall_base: Schema.Class<LedgerRequestAbortCall, Schema.TaggedStruct<"LedgerRequestAbort", {
71
97
  readonly request: typeof AbortCommand;
72
98
  }>, {}>;
@@ -100,6 +126,10 @@ declare const StoreReadPageCall_base: Schema.Class<StoreReadPageCall, Schema.Tag
100
126
  readonly _tag: Schema.Literal<"Outstanding">;
101
127
  readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
102
128
  readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
129
+ }>, Schema.Struct<{
130
+ readonly _tag: Schema.Literal<"WorkerExecution">;
131
+ readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
132
+ readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
103
133
  }>, Schema.Struct<{
104
134
  readonly _tag: Schema.Literal<"WorkerState">;
105
135
  readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
@@ -137,11 +167,16 @@ declare const MessageDeliveryListCall_base: Schema.Class<MessageDeliveryListCall
137
167
  readonly limit: Schema.Int;
138
168
  readonly after: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">>;
139
169
  readonly pendingOnly: Schema.optionalKey<Schema.Boolean>;
170
+ readonly workerStarts: Schema.optionalKey<Schema.Struct<{
171
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
172
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
173
+ }>>;
174
+ readonly pendingWorker: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">>;
140
175
  }>;
141
176
  }>, {}>;
142
177
  export declare class MessageDeliveryListCall extends MessageDeliveryListCall_base {}
143
178
  /** Every request that may cross a Durable Object boundary — the CLOSED route-capable subset. */
144
- export declare const PortRequest: Schema.Union<readonly [typeof MessageDeliveryListCall, typeof LedgerAdmitCall, typeof LedgerMarkReadyCall, typeof LedgerLookupCall, typeof LedgerResolveAdmissionCall, typeof LedgerRequestAbortCall, typeof LedgerRecordChildSettledCall, typeof StoreMaterializeCall, typeof StoreAppendCall, typeof StoreReadPageCall, typeof StoreInspectTailCall, typeof StoreExportCall, typeof StoreCountPeerMessagesCall]>;
179
+ export declare const PortRequest: Schema.Union<readonly [typeof MessageDeliveryListCall, typeof LedgerAdmitCall, typeof LedgerMarkReadyCall, typeof LedgerLookupCall, typeof LedgerResolveAdmissionCall, typeof LedgerRequestAbortCall, typeof LedgerStopWorkerCall, typeof LedgerInspectWorkerCall, typeof LedgerRecordChildSettledCall, typeof StoreMaterializeCall, typeof StoreAppendCall, typeof StoreReadPageCall, typeof StoreInspectTailCall, typeof StoreExportCall, typeof StoreCountPeerMessagesCall]>;
145
180
  export type PortRequest = typeof PortRequest.Type;
146
181
  /** The wire form of one port request (what a transport actually carries). */
147
182
  export type PortRequestEnvelope = typeof PortRequest.Encoded;
@@ -238,6 +273,7 @@ declare const MessageDeliveryListResult_base: Schema.Class<MessageDeliveryListRe
238
273
  readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
239
274
  }>]>;
240
275
  readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
276
+ readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
241
277
  readonly targetDigests: typeof import("effect-agent/records").DefinitionDigests;
242
278
  readonly policy: Schema.toCodecJson<typeof import("effect-agent/agent-policy").AgentPolicy>;
243
279
  readonly budget: Schema.Struct<{
@@ -369,7 +405,7 @@ declare const MessageDeliveryListResult_base: Schema.Class<MessageDeliveryListRe
369
405
  }>, {}>;
370
406
  export declare class MessageDeliveryListResult extends MessageDeliveryListResult_base {}
371
407
  /** Every successful routed result. Callers narrow by the tag their request implies. */
372
- export declare const PortResult: Schema.Union<readonly [typeof MessageDeliveryListResult, typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult, typeof StoreCountPeerMessagesResult]>;
408
+ export declare const PortResult: Schema.Union<readonly [typeof MessageDeliveryListResult, typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerStopWorkerResult, typeof LedgerInspectWorkerResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult, typeof StoreCountPeerMessagesResult]>;
373
409
  export type PortResult = typeof PortResult.Type;
374
410
  /**
375
411
  * Every typed failure a route-capable operation can produce on its owning Object, plus the
@@ -379,7 +415,7 @@ export type PortResult = typeof PortResult.Type;
379
415
  export declare const PortFailure: Schema.Union<readonly [typeof MessageDeliveryError, typeof AdmissionConflict, typeof AdmissionPolicyError, typeof SettlementConflict, typeof JoinedToHost, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof PortProtocolError]>;
380
416
  export type PortFailure = typeof PortFailure.Type;
381
417
  declare const PortSucceeded_base: Schema.Class<PortSucceeded, Schema.TaggedStruct<"PortSucceeded", {
382
- readonly result: Schema.Union<readonly [typeof MessageDeliveryListResult, typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult, typeof StoreCountPeerMessagesResult]>;
418
+ readonly result: Schema.Union<readonly [typeof MessageDeliveryListResult, typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerStopWorkerResult, typeof LedgerInspectWorkerResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult, typeof StoreCountPeerMessagesResult]>;
383
419
  }>, {}>;
384
420
  /** The routed operation succeeded on its owning Object. */
385
421
  export declare class PortSucceeded extends PortSucceeded_base {}
@@ -393,7 +429,7 @@ export declare const PortResponse: Schema.Union<readonly [typeof PortSucceeded,
393
429
  export type PortResponse = typeof PortResponse.Type;
394
430
  /** The wire form of one port response (what a transport actually carries). */
395
431
  export type PortResponseEnvelope = typeof PortResponse.Encoded;
396
- export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | MessageDeliveryListCall | StoreAppendCall | StoreCountPeerMessagesCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
432
+ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerInspectWorkerCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | LedgerStopWorkerCall | MessageDeliveryListCall | StoreAppendCall | StoreCountPeerMessagesCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
397
433
  readonly _tag: "LedgerAdmit";
398
434
  readonly request: {
399
435
  readonly threadId: string;
@@ -439,6 +475,7 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
439
475
  readonly threadId: string;
440
476
  };
441
477
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
478
+ readonly lifecycle?: "assignment" | undefined;
442
479
  readonly targetDigests: {
443
480
  readonly agent: string;
444
481
  readonly model: string;
@@ -641,6 +678,17 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
641
678
  readonly principal: string;
642
679
  readonly idempotencyKey: string;
643
680
  };
681
+ } | {
682
+ readonly _tag: "LedgerInspectWorker";
683
+ readonly request: {
684
+ readonly threadId: string;
685
+ };
686
+ } | {
687
+ readonly _tag: "LedgerStopWorker";
688
+ readonly request: {
689
+ readonly threadId: string;
690
+ readonly author: string;
691
+ };
644
692
  } | {
645
693
  readonly _tag: "LedgerRequestAbort";
646
694
  readonly request: {
@@ -1205,6 +1253,7 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
1205
1253
  readonly threadId: string;
1206
1254
  };
1207
1255
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
1256
+ readonly lifecycle?: "assignment" | undefined;
1208
1257
  readonly targetDigests: {
1209
1258
  readonly agent: string;
1210
1259
  readonly model: string;
@@ -1288,6 +1337,17 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
1288
1337
  readonly reportKind?: "update" | undefined;
1289
1338
  };
1290
1339
  readonly inputDigest: string;
1340
+ } | {
1341
+ readonly _tag: "WorkerStopRequested";
1342
+ readonly command: {
1343
+ readonly worker: {
1344
+ readonly schemaVersion: 1;
1345
+ readonly delegationId: string;
1346
+ readonly targetAgentId: string;
1347
+ readonly threadId: string;
1348
+ };
1349
+ readonly idempotencyKey: string;
1350
+ };
1291
1351
  } | {
1292
1352
  readonly _tag: "WorkerOriginRecorded";
1293
1353
  readonly origin: {
@@ -1309,6 +1369,7 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
1309
1369
  readonly threadId: string;
1310
1370
  };
1311
1371
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
1372
+ readonly lifecycle?: "assignment" | undefined;
1312
1373
  readonly targetDigests: {
1313
1374
  readonly agent: string;
1314
1375
  readonly model: string;
@@ -2022,6 +2083,7 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
2022
2083
  readonly threadId: string;
2023
2084
  };
2024
2085
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2086
+ readonly lifecycle?: "assignment" | undefined;
2025
2087
  readonly targetDigests: {
2026
2088
  readonly agent: string;
2027
2089
  readonly model: string;
@@ -2105,6 +2167,17 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
2105
2167
  readonly reportKind?: "update" | undefined;
2106
2168
  };
2107
2169
  readonly inputDigest: string;
2170
+ } | {
2171
+ readonly _tag: "WorkerStopRequested";
2172
+ readonly command: {
2173
+ readonly worker: {
2174
+ readonly schemaVersion: 1;
2175
+ readonly delegationId: string;
2176
+ readonly targetAgentId: string;
2177
+ readonly threadId: string;
2178
+ };
2179
+ readonly idempotencyKey: string;
2180
+ };
2108
2181
  } | {
2109
2182
  readonly _tag: "WorkerOriginRecorded";
2110
2183
  readonly origin: {
@@ -2126,6 +2199,7 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
2126
2199
  readonly threadId: string;
2127
2200
  };
2128
2201
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2202
+ readonly lifecycle?: "assignment" | undefined;
2129
2203
  readonly targetDigests: {
2130
2204
  readonly agent: string;
2131
2205
  readonly model: string;
@@ -2325,6 +2399,10 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
2325
2399
  readonly _tag: "Outstanding";
2326
2400
  readonly expectedTailSequence: number;
2327
2401
  readonly expectedTailDigest: string;
2402
+ } | {
2403
+ readonly _tag: "WorkerExecution";
2404
+ readonly expectedTailSequence: number;
2405
+ readonly expectedTailDigest: string;
2328
2406
  } | {
2329
2407
  readonly _tag: "WorkerState";
2330
2408
  readonly expectedTailSequence: number;
@@ -2359,130 +2437,78 @@ export declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCa
2359
2437
  readonly limit: number;
2360
2438
  readonly after?: string | undefined;
2361
2439
  readonly pendingOnly?: boolean | undefined;
2440
+ readonly workerStarts?: {
2441
+ readonly delegationId: string;
2442
+ readonly targetAgentId: string;
2443
+ } | undefined;
2444
+ readonly pendingWorker?: string | undefined;
2362
2445
  };
2363
2446
  }, Schema.SchemaError, never>;
2364
- export declare const decodePortRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<LedgerAdmitCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | MessageDeliveryListCall | StoreAppendCall | StoreCountPeerMessagesCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, Schema.SchemaError, never>;
2447
+ export declare const decodePortRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<LedgerAdmitCall | LedgerInspectWorkerCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | LedgerStopWorkerCall | MessageDeliveryListCall | StoreAppendCall | StoreCountPeerMessagesCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, Schema.SchemaError, never>;
2365
2448
  export declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
2366
2449
  readonly _tag: "PortSucceeded";
2367
2450
  readonly result: {
2368
- readonly _tag: "LedgerAdmitResult";
2369
- readonly result: {
2370
- readonly submissionId: string;
2371
- readonly receiptId: string;
2372
- readonly queueSequence: number;
2373
- readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2374
- readonly replayed: boolean;
2375
- };
2376
- } | {
2377
- readonly _tag: "LedgerMarkReadyResult";
2378
- } | {
2379
- readonly _tag: "LedgerLookupResult";
2380
- readonly submission?: {
2381
- readonly submissionId: string;
2382
- readonly threadId: string;
2383
- readonly queueSequence: number;
2384
- readonly principal: string;
2385
- readonly idempotencyKey: string;
2386
- readonly deploymentId: string;
2387
- readonly receiptId: string;
2388
- readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2389
- readonly agentId: string;
2390
- readonly agentDigests: {
2391
- readonly agent: string;
2392
- readonly model: string;
2393
- readonly tools: string;
2394
- readonly replay?: {
2451
+ readonly _tag: "LedgerInspectWorkerResult";
2452
+ readonly state: {
2453
+ readonly latest: {
2454
+ readonly submissionId: string;
2455
+ readonly threadId: string;
2456
+ readonly queueSequence: number;
2457
+ readonly principal: string;
2458
+ readonly idempotencyKey: string;
2459
+ readonly deploymentId: string;
2460
+ readonly receiptId: string;
2461
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2462
+ readonly agentId: string;
2463
+ readonly agentDigests: {
2395
2464
  readonly agent: string;
2396
- readonly agentBehavior?: string | undefined;
2397
- readonly tools: {
2398
- readonly [x: string]: string;
2399
- };
2400
- } | undefined;
2401
- };
2402
- readonly inputPayload: Schema.Json;
2403
- readonly inputDigest: string;
2404
- readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
2405
- readonly createdAt: string;
2406
- readonly readyAt?: string | undefined;
2407
- readonly admissionGroup?: string | undefined;
2408
- readonly admissionFence?: {
2409
- readonly policyId: string;
2410
- readonly key: string;
2411
- readonly revision: string;
2412
- } | undefined;
2413
- readonly parentLinkage?: {
2414
- readonly parentSubmissionId: string;
2415
- readonly parentToolCallId: string;
2416
- } | undefined;
2417
- readonly workerAdmission?: {
2418
- readonly origin: {
2419
- readonly worker: {
2420
- readonly schemaVersion: 1;
2421
- readonly delegationId: string;
2422
- readonly targetAgentId: string;
2423
- readonly threadId: string;
2424
- };
2425
- readonly source: {
2426
- readonly _tag: "tool";
2427
- readonly agentId: string;
2428
- readonly threadId: string;
2429
- readonly runId: string;
2430
- readonly toolCallId: string;
2431
- } | {
2432
- readonly _tag: "programmatic";
2433
- readonly agentId: string;
2434
- readonly threadId: string;
2435
- };
2436
- readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2437
- readonly targetDigests: {
2465
+ readonly model: string;
2466
+ readonly tools: string;
2467
+ readonly replay?: {
2438
2468
  readonly agent: string;
2439
- readonly model: string;
2440
- readonly tools: string;
2441
- readonly replay?: {
2442
- readonly agent: string;
2443
- readonly agentBehavior?: string | undefined;
2444
- readonly tools: {
2445
- readonly [x: string]: string;
2446
- };
2447
- } | undefined;
2448
- };
2449
- readonly policy: Schema.Json;
2450
- readonly budget: {
2451
- readonly caps: {
2452
- readonly maxTotalChildInvocations?: number | undefined;
2453
- readonly maxConcurrentChildren?: number | undefined;
2454
- readonly maxTurns?: number | undefined;
2455
- readonly maxToolCalls?: number | undefined;
2456
- readonly maxDurationMillis?: number | undefined;
2457
- readonly maxInputTokens?: number | undefined;
2458
- readonly maxOutputTokens?: number | undefined;
2459
- readonly maxCostMicrousd?: number | undefined;
2460
- readonly maxResultBytes?: number | undefined;
2469
+ readonly agentBehavior?: string | undefined;
2470
+ readonly tools: {
2471
+ readonly [x: string]: string;
2461
2472
  };
2462
- readonly allocation: {
2463
- readonly turns: number;
2464
- readonly toolCalls: number;
2465
- readonly durationMillis: number;
2466
- readonly inputTokens: number;
2467
- readonly outputTokens: number;
2468
- readonly costMicrousd: number;
2469
- readonly resultBytes: number;
2473
+ } | undefined;
2474
+ };
2475
+ readonly inputPayload: Schema.Json;
2476
+ readonly inputDigest: string;
2477
+ readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
2478
+ readonly createdAt: string;
2479
+ readonly readyAt?: string | undefined;
2480
+ readonly admissionGroup?: string | undefined;
2481
+ readonly admissionFence?: {
2482
+ readonly policyId: string;
2483
+ readonly key: string;
2484
+ readonly revision: string;
2485
+ } | undefined;
2486
+ readonly parentLinkage?: {
2487
+ readonly parentSubmissionId: string;
2488
+ readonly parentToolCallId: string;
2489
+ } | undefined;
2490
+ readonly workerAdmission?: {
2491
+ readonly origin: {
2492
+ readonly worker: {
2493
+ readonly schemaVersion: 1;
2494
+ readonly delegationId: string;
2495
+ readonly targetAgentId: string;
2496
+ readonly threadId: string;
2470
2497
  };
2471
- readonly descendantInvocations?: number | undefined;
2472
- };
2473
- readonly grant: {
2474
- readonly allowedToolNames: readonly string[];
2475
- readonly maxDepth: number;
2476
- readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2477
- };
2478
- readonly depth: number;
2479
- readonly toolCallAllowance?: number | undefined;
2480
- readonly firstMessageId: string;
2481
- readonly createdAtMillis: number;
2482
- readonly expiresAtMillis: number;
2483
- readonly reporting?: {
2484
- readonly mode?: "standard" | undefined;
2485
- readonly sourceDigests: {
2498
+ readonly source: {
2499
+ readonly _tag: "tool";
2500
+ readonly agentId: string;
2501
+ readonly threadId: string;
2502
+ readonly runId: string;
2503
+ readonly toolCallId: string;
2504
+ } | {
2505
+ readonly _tag: "programmatic";
2506
+ readonly agentId: string;
2507
+ readonly threadId: string;
2508
+ };
2509
+ readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2510
+ readonly lifecycle?: "assignment" | undefined;
2511
+ readonly targetDigests: {
2486
2512
  readonly agent: string;
2487
2513
  readonly model: string;
2488
2514
  readonly tools: string;
@@ -2494,51 +2520,578 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
2494
2520
  };
2495
2521
  } | undefined;
2496
2522
  };
2497
- readonly destinationDelegationId?: string | undefined;
2498
- readonly returnAddress?: {
2499
- readonly input: Schema.Json;
2500
- readonly principal: string;
2501
- readonly policy: Schema.Json;
2502
- readonly depth: number;
2503
- readonly grant?: {
2504
- readonly allowedToolNames: readonly string[];
2505
- readonly maxDepth: number;
2506
- readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2507
- } | undefined;
2508
- readonly workerAdmission?: Schema.Json | undefined;
2509
- } | undefined;
2510
- } | undefined;
2511
- };
2512
- readonly messageId: string;
2513
- readonly parameters: Schema.Json;
2514
- readonly createdAtMillis: number;
2515
- readonly sourceSubmissionId?: string | undefined;
2516
- readonly deliveryPrincipal?: string | undefined;
2517
- readonly reportKind?: "update" | undefined;
2518
- } | undefined;
2519
- readonly messageAdmission?: {
2520
- readonly schemaVersion: 1;
2521
- readonly message: {
2522
- readonly ownerThreadId: string;
2523
- readonly messageId: string;
2524
- };
2525
- readonly peerName: string;
2526
- readonly sender: {
2527
- readonly threadId: string;
2528
- readonly agentId: string;
2529
- };
2530
- readonly returnAddress: {
2531
- readonly threadId: string;
2532
- readonly agentId: string;
2533
- };
2534
- readonly inReplyTo?: {
2535
- readonly ownerThreadId: string;
2536
- readonly messageId: string;
2537
- } | undefined;
2538
- } | {
2539
- readonly _tag: "WorkerCompletion";
2540
- readonly budgetExhausted: boolean;
2541
- readonly schemaVersion: 1;
2523
+ readonly policy: Schema.Json;
2524
+ readonly budget: {
2525
+ readonly caps: {
2526
+ readonly maxTotalChildInvocations?: number | undefined;
2527
+ readonly maxConcurrentChildren?: number | undefined;
2528
+ readonly maxTurns?: number | undefined;
2529
+ readonly maxToolCalls?: number | undefined;
2530
+ readonly maxDurationMillis?: number | undefined;
2531
+ readonly maxInputTokens?: number | undefined;
2532
+ readonly maxOutputTokens?: number | undefined;
2533
+ readonly maxCostMicrousd?: number | undefined;
2534
+ readonly maxResultBytes?: number | undefined;
2535
+ };
2536
+ readonly allocation: {
2537
+ readonly turns: number;
2538
+ readonly toolCalls: number;
2539
+ readonly durationMillis: number;
2540
+ readonly inputTokens: number;
2541
+ readonly outputTokens: number;
2542
+ readonly costMicrousd: number;
2543
+ readonly resultBytes: number;
2544
+ };
2545
+ readonly descendantInvocations?: number | undefined;
2546
+ };
2547
+ readonly grant: {
2548
+ readonly allowedToolNames: readonly string[];
2549
+ readonly maxDepth: number;
2550
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2551
+ };
2552
+ readonly depth: number;
2553
+ readonly toolCallAllowance?: number | undefined;
2554
+ readonly firstMessageId: string;
2555
+ readonly createdAtMillis: number;
2556
+ readonly expiresAtMillis: number;
2557
+ readonly reporting?: {
2558
+ readonly mode?: "standard" | undefined;
2559
+ readonly sourceDigests: {
2560
+ readonly agent: string;
2561
+ readonly model: string;
2562
+ readonly tools: string;
2563
+ readonly replay?: {
2564
+ readonly agent: string;
2565
+ readonly agentBehavior?: string | undefined;
2566
+ readonly tools: {
2567
+ readonly [x: string]: string;
2568
+ };
2569
+ } | undefined;
2570
+ };
2571
+ readonly destinationDelegationId?: string | undefined;
2572
+ readonly returnAddress?: {
2573
+ readonly input: Schema.Json;
2574
+ readonly principal: string;
2575
+ readonly policy: Schema.Json;
2576
+ readonly depth: number;
2577
+ readonly grant?: {
2578
+ readonly allowedToolNames: readonly string[];
2579
+ readonly maxDepth: number;
2580
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2581
+ } | undefined;
2582
+ readonly workerAdmission?: Schema.Json | undefined;
2583
+ } | undefined;
2584
+ } | undefined;
2585
+ };
2586
+ readonly messageId: string;
2587
+ readonly parameters: Schema.Json;
2588
+ readonly createdAtMillis: number;
2589
+ readonly sourceSubmissionId?: string | undefined;
2590
+ readonly deliveryPrincipal?: string | undefined;
2591
+ readonly reportKind?: "update" | undefined;
2592
+ } | undefined;
2593
+ readonly messageAdmission?: {
2594
+ readonly schemaVersion: 1;
2595
+ readonly message: {
2596
+ readonly ownerThreadId: string;
2597
+ readonly messageId: string;
2598
+ };
2599
+ readonly peerName: string;
2600
+ readonly sender: {
2601
+ readonly threadId: string;
2602
+ readonly agentId: string;
2603
+ };
2604
+ readonly returnAddress: {
2605
+ readonly threadId: string;
2606
+ readonly agentId: string;
2607
+ };
2608
+ readonly inReplyTo?: {
2609
+ readonly ownerThreadId: string;
2610
+ readonly messageId: string;
2611
+ } | undefined;
2612
+ } | {
2613
+ readonly _tag: "WorkerCompletion";
2614
+ readonly budgetExhausted: boolean;
2615
+ readonly schemaVersion: 1;
2616
+ readonly report: {
2617
+ readonly _tag: "Settled";
2618
+ readonly worker: {
2619
+ readonly schemaVersion: 1;
2620
+ readonly delegationId: string;
2621
+ readonly targetAgentId: string;
2622
+ readonly threadId: string;
2623
+ };
2624
+ readonly receipt: {
2625
+ readonly receiptId: string;
2626
+ readonly submissionId: string;
2627
+ readonly threadId: string;
2628
+ readonly queueSequence: number;
2629
+ };
2630
+ readonly runId: string;
2631
+ readonly settlementId: string;
2632
+ readonly outcome: "completed";
2633
+ readonly result: Schema.Json;
2634
+ } | {
2635
+ readonly _tag: "Settled";
2636
+ readonly worker: {
2637
+ readonly schemaVersion: 1;
2638
+ readonly delegationId: string;
2639
+ readonly targetAgentId: string;
2640
+ readonly threadId: string;
2641
+ };
2642
+ readonly receipt: {
2643
+ readonly receiptId: string;
2644
+ readonly submissionId: string;
2645
+ readonly threadId: string;
2646
+ readonly queueSequence: number;
2647
+ };
2648
+ readonly runId: string;
2649
+ readonly settlementId: string;
2650
+ readonly outcome: "aborted" | "failed";
2651
+ readonly failure: {
2652
+ readonly _tag: "SubagentExecutionFailure";
2653
+ readonly delegationId: string;
2654
+ readonly targetAgentId: string;
2655
+ readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
2656
+ readonly childThreadId?: string | undefined;
2657
+ readonly childSubmissionId?: string | undefined;
2658
+ readonly childRunId?: string | undefined;
2659
+ readonly errorTag: string;
2660
+ readonly message: string;
2661
+ };
2662
+ };
2663
+ } | {
2664
+ readonly _tag: "WorkerUpdate";
2665
+ readonly schemaVersion: 1;
2666
+ readonly worker: {
2667
+ readonly schemaVersion: 1;
2668
+ readonly delegationId: string;
2669
+ readonly targetAgentId: string;
2670
+ readonly threadId: string;
2671
+ };
2672
+ readonly update: {
2673
+ readonly schemaVersion: 1;
2674
+ readonly agentId: string;
2675
+ readonly threadId: string;
2676
+ readonly runId: string;
2677
+ readonly updateId: string;
2678
+ readonly sequence: number;
2679
+ readonly value: Schema.Json;
2680
+ };
2681
+ } | undefined;
2682
+ } | null;
2683
+ readonly active: {
2684
+ readonly submissionId: string;
2685
+ readonly threadId: string;
2686
+ readonly queueSequence: number;
2687
+ readonly principal: string;
2688
+ readonly idempotencyKey: string;
2689
+ readonly deploymentId: string;
2690
+ readonly receiptId: string;
2691
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2692
+ readonly agentId: string;
2693
+ readonly agentDigests: {
2694
+ readonly agent: string;
2695
+ readonly model: string;
2696
+ readonly tools: string;
2697
+ readonly replay?: {
2698
+ readonly agent: string;
2699
+ readonly agentBehavior?: string | undefined;
2700
+ readonly tools: {
2701
+ readonly [x: string]: string;
2702
+ };
2703
+ } | undefined;
2704
+ };
2705
+ readonly inputPayload: Schema.Json;
2706
+ readonly inputDigest: string;
2707
+ readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
2708
+ readonly createdAt: string;
2709
+ readonly readyAt?: string | undefined;
2710
+ readonly admissionGroup?: string | undefined;
2711
+ readonly admissionFence?: {
2712
+ readonly policyId: string;
2713
+ readonly key: string;
2714
+ readonly revision: string;
2715
+ } | undefined;
2716
+ readonly parentLinkage?: {
2717
+ readonly parentSubmissionId: string;
2718
+ readonly parentToolCallId: string;
2719
+ } | undefined;
2720
+ readonly workerAdmission?: {
2721
+ readonly origin: {
2722
+ readonly worker: {
2723
+ readonly schemaVersion: 1;
2724
+ readonly delegationId: string;
2725
+ readonly targetAgentId: string;
2726
+ readonly threadId: string;
2727
+ };
2728
+ readonly source: {
2729
+ readonly _tag: "tool";
2730
+ readonly agentId: string;
2731
+ readonly threadId: string;
2732
+ readonly runId: string;
2733
+ readonly toolCallId: string;
2734
+ } | {
2735
+ readonly _tag: "programmatic";
2736
+ readonly agentId: string;
2737
+ readonly threadId: string;
2738
+ };
2739
+ readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2740
+ readonly lifecycle?: "assignment" | undefined;
2741
+ readonly targetDigests: {
2742
+ readonly agent: string;
2743
+ readonly model: string;
2744
+ readonly tools: string;
2745
+ readonly replay?: {
2746
+ readonly agent: string;
2747
+ readonly agentBehavior?: string | undefined;
2748
+ readonly tools: {
2749
+ readonly [x: string]: string;
2750
+ };
2751
+ } | undefined;
2752
+ };
2753
+ readonly policy: Schema.Json;
2754
+ readonly budget: {
2755
+ readonly caps: {
2756
+ readonly maxTotalChildInvocations?: number | undefined;
2757
+ readonly maxConcurrentChildren?: number | undefined;
2758
+ readonly maxTurns?: number | undefined;
2759
+ readonly maxToolCalls?: number | undefined;
2760
+ readonly maxDurationMillis?: number | undefined;
2761
+ readonly maxInputTokens?: number | undefined;
2762
+ readonly maxOutputTokens?: number | undefined;
2763
+ readonly maxCostMicrousd?: number | undefined;
2764
+ readonly maxResultBytes?: number | undefined;
2765
+ };
2766
+ readonly allocation: {
2767
+ readonly turns: number;
2768
+ readonly toolCalls: number;
2769
+ readonly durationMillis: number;
2770
+ readonly inputTokens: number;
2771
+ readonly outputTokens: number;
2772
+ readonly costMicrousd: number;
2773
+ readonly resultBytes: number;
2774
+ };
2775
+ readonly descendantInvocations?: number | undefined;
2776
+ };
2777
+ readonly grant: {
2778
+ readonly allowedToolNames: readonly string[];
2779
+ readonly maxDepth: number;
2780
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2781
+ };
2782
+ readonly depth: number;
2783
+ readonly toolCallAllowance?: number | undefined;
2784
+ readonly firstMessageId: string;
2785
+ readonly createdAtMillis: number;
2786
+ readonly expiresAtMillis: number;
2787
+ readonly reporting?: {
2788
+ readonly mode?: "standard" | undefined;
2789
+ readonly sourceDigests: {
2790
+ readonly agent: string;
2791
+ readonly model: string;
2792
+ readonly tools: string;
2793
+ readonly replay?: {
2794
+ readonly agent: string;
2795
+ readonly agentBehavior?: string | undefined;
2796
+ readonly tools: {
2797
+ readonly [x: string]: string;
2798
+ };
2799
+ } | undefined;
2800
+ };
2801
+ readonly destinationDelegationId?: string | undefined;
2802
+ readonly returnAddress?: {
2803
+ readonly input: Schema.Json;
2804
+ readonly principal: string;
2805
+ readonly policy: Schema.Json;
2806
+ readonly depth: number;
2807
+ readonly grant?: {
2808
+ readonly allowedToolNames: readonly string[];
2809
+ readonly maxDepth: number;
2810
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
2811
+ } | undefined;
2812
+ readonly workerAdmission?: Schema.Json | undefined;
2813
+ } | undefined;
2814
+ } | undefined;
2815
+ };
2816
+ readonly messageId: string;
2817
+ readonly parameters: Schema.Json;
2818
+ readonly createdAtMillis: number;
2819
+ readonly sourceSubmissionId?: string | undefined;
2820
+ readonly deliveryPrincipal?: string | undefined;
2821
+ readonly reportKind?: "update" | undefined;
2822
+ } | undefined;
2823
+ readonly messageAdmission?: {
2824
+ readonly schemaVersion: 1;
2825
+ readonly message: {
2826
+ readonly ownerThreadId: string;
2827
+ readonly messageId: string;
2828
+ };
2829
+ readonly peerName: string;
2830
+ readonly sender: {
2831
+ readonly threadId: string;
2832
+ readonly agentId: string;
2833
+ };
2834
+ readonly returnAddress: {
2835
+ readonly threadId: string;
2836
+ readonly agentId: string;
2837
+ };
2838
+ readonly inReplyTo?: {
2839
+ readonly ownerThreadId: string;
2840
+ readonly messageId: string;
2841
+ } | undefined;
2842
+ } | {
2843
+ readonly _tag: "WorkerCompletion";
2844
+ readonly budgetExhausted: boolean;
2845
+ readonly schemaVersion: 1;
2846
+ readonly report: {
2847
+ readonly _tag: "Settled";
2848
+ readonly worker: {
2849
+ readonly schemaVersion: 1;
2850
+ readonly delegationId: string;
2851
+ readonly targetAgentId: string;
2852
+ readonly threadId: string;
2853
+ };
2854
+ readonly receipt: {
2855
+ readonly receiptId: string;
2856
+ readonly submissionId: string;
2857
+ readonly threadId: string;
2858
+ readonly queueSequence: number;
2859
+ };
2860
+ readonly runId: string;
2861
+ readonly settlementId: string;
2862
+ readonly outcome: "completed";
2863
+ readonly result: Schema.Json;
2864
+ } | {
2865
+ readonly _tag: "Settled";
2866
+ readonly worker: {
2867
+ readonly schemaVersion: 1;
2868
+ readonly delegationId: string;
2869
+ readonly targetAgentId: string;
2870
+ readonly threadId: string;
2871
+ };
2872
+ readonly receipt: {
2873
+ readonly receiptId: string;
2874
+ readonly submissionId: string;
2875
+ readonly threadId: string;
2876
+ readonly queueSequence: number;
2877
+ };
2878
+ readonly runId: string;
2879
+ readonly settlementId: string;
2880
+ readonly outcome: "aborted" | "failed";
2881
+ readonly failure: {
2882
+ readonly _tag: "SubagentExecutionFailure";
2883
+ readonly delegationId: string;
2884
+ readonly targetAgentId: string;
2885
+ readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
2886
+ readonly childThreadId?: string | undefined;
2887
+ readonly childSubmissionId?: string | undefined;
2888
+ readonly childRunId?: string | undefined;
2889
+ readonly errorTag: string;
2890
+ readonly message: string;
2891
+ };
2892
+ };
2893
+ } | {
2894
+ readonly _tag: "WorkerUpdate";
2895
+ readonly schemaVersion: 1;
2896
+ readonly worker: {
2897
+ readonly schemaVersion: 1;
2898
+ readonly delegationId: string;
2899
+ readonly targetAgentId: string;
2900
+ readonly threadId: string;
2901
+ };
2902
+ readonly update: {
2903
+ readonly schemaVersion: 1;
2904
+ readonly agentId: string;
2905
+ readonly threadId: string;
2906
+ readonly runId: string;
2907
+ readonly updateId: string;
2908
+ readonly sequence: number;
2909
+ readonly value: Schema.Json;
2910
+ };
2911
+ } | undefined;
2912
+ } | null;
2913
+ readonly stopped: boolean;
2914
+ readonly terminal?: "cancelled" | "completed" | "failed" | undefined;
2915
+ };
2916
+ } | {
2917
+ readonly _tag: "LedgerStopWorkerResult";
2918
+ readonly owned: number;
2919
+ } | {
2920
+ readonly _tag: "LedgerAdmitResult";
2921
+ readonly result: {
2922
+ readonly submissionId: string;
2923
+ readonly receiptId: string;
2924
+ readonly queueSequence: number;
2925
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2926
+ readonly replayed: boolean;
2927
+ };
2928
+ } | {
2929
+ readonly _tag: "LedgerMarkReadyResult";
2930
+ } | {
2931
+ readonly _tag: "LedgerLookupResult";
2932
+ readonly submission?: {
2933
+ readonly submissionId: string;
2934
+ readonly threadId: string;
2935
+ readonly queueSequence: number;
2936
+ readonly principal: string;
2937
+ readonly idempotencyKey: string;
2938
+ readonly deploymentId: string;
2939
+ readonly receiptId: string;
2940
+ readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
2941
+ readonly agentId: string;
2942
+ readonly agentDigests: {
2943
+ readonly agent: string;
2944
+ readonly model: string;
2945
+ readonly tools: string;
2946
+ readonly replay?: {
2947
+ readonly agent: string;
2948
+ readonly agentBehavior?: string | undefined;
2949
+ readonly tools: {
2950
+ readonly [x: string]: string;
2951
+ };
2952
+ } | undefined;
2953
+ };
2954
+ readonly inputPayload: Schema.Json;
2955
+ readonly inputDigest: string;
2956
+ readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
2957
+ readonly createdAt: string;
2958
+ readonly readyAt?: string | undefined;
2959
+ readonly admissionGroup?: string | undefined;
2960
+ readonly admissionFence?: {
2961
+ readonly policyId: string;
2962
+ readonly key: string;
2963
+ readonly revision: string;
2964
+ } | undefined;
2965
+ readonly parentLinkage?: {
2966
+ readonly parentSubmissionId: string;
2967
+ readonly parentToolCallId: string;
2968
+ } | undefined;
2969
+ readonly workerAdmission?: {
2970
+ readonly origin: {
2971
+ readonly worker: {
2972
+ readonly schemaVersion: 1;
2973
+ readonly delegationId: string;
2974
+ readonly targetAgentId: string;
2975
+ readonly threadId: string;
2976
+ };
2977
+ readonly source: {
2978
+ readonly _tag: "tool";
2979
+ readonly agentId: string;
2980
+ readonly threadId: string;
2981
+ readonly runId: string;
2982
+ readonly toolCallId: string;
2983
+ } | {
2984
+ readonly _tag: "programmatic";
2985
+ readonly agentId: string;
2986
+ readonly threadId: string;
2987
+ };
2988
+ readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
2989
+ readonly lifecycle?: "assignment" | undefined;
2990
+ readonly targetDigests: {
2991
+ readonly agent: string;
2992
+ readonly model: string;
2993
+ readonly tools: string;
2994
+ readonly replay?: {
2995
+ readonly agent: string;
2996
+ readonly agentBehavior?: string | undefined;
2997
+ readonly tools: {
2998
+ readonly [x: string]: string;
2999
+ };
3000
+ } | undefined;
3001
+ };
3002
+ readonly policy: Schema.Json;
3003
+ readonly budget: {
3004
+ readonly caps: {
3005
+ readonly maxTotalChildInvocations?: number | undefined;
3006
+ readonly maxConcurrentChildren?: number | undefined;
3007
+ readonly maxTurns?: number | undefined;
3008
+ readonly maxToolCalls?: number | undefined;
3009
+ readonly maxDurationMillis?: number | undefined;
3010
+ readonly maxInputTokens?: number | undefined;
3011
+ readonly maxOutputTokens?: number | undefined;
3012
+ readonly maxCostMicrousd?: number | undefined;
3013
+ readonly maxResultBytes?: number | undefined;
3014
+ };
3015
+ readonly allocation: {
3016
+ readonly turns: number;
3017
+ readonly toolCalls: number;
3018
+ readonly durationMillis: number;
3019
+ readonly inputTokens: number;
3020
+ readonly outputTokens: number;
3021
+ readonly costMicrousd: number;
3022
+ readonly resultBytes: number;
3023
+ };
3024
+ readonly descendantInvocations?: number | undefined;
3025
+ };
3026
+ readonly grant: {
3027
+ readonly allowedToolNames: readonly string[];
3028
+ readonly maxDepth: number;
3029
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
3030
+ };
3031
+ readonly depth: number;
3032
+ readonly toolCallAllowance?: number | undefined;
3033
+ readonly firstMessageId: string;
3034
+ readonly createdAtMillis: number;
3035
+ readonly expiresAtMillis: number;
3036
+ readonly reporting?: {
3037
+ readonly mode?: "standard" | undefined;
3038
+ readonly sourceDigests: {
3039
+ readonly agent: string;
3040
+ readonly model: string;
3041
+ readonly tools: string;
3042
+ readonly replay?: {
3043
+ readonly agent: string;
3044
+ readonly agentBehavior?: string | undefined;
3045
+ readonly tools: {
3046
+ readonly [x: string]: string;
3047
+ };
3048
+ } | undefined;
3049
+ };
3050
+ readonly destinationDelegationId?: string | undefined;
3051
+ readonly returnAddress?: {
3052
+ readonly input: Schema.Json;
3053
+ readonly principal: string;
3054
+ readonly policy: Schema.Json;
3055
+ readonly depth: number;
3056
+ readonly grant?: {
3057
+ readonly allowedToolNames: readonly string[];
3058
+ readonly maxDepth: number;
3059
+ readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
3060
+ } | undefined;
3061
+ readonly workerAdmission?: Schema.Json | undefined;
3062
+ } | undefined;
3063
+ } | undefined;
3064
+ };
3065
+ readonly messageId: string;
3066
+ readonly parameters: Schema.Json;
3067
+ readonly createdAtMillis: number;
3068
+ readonly sourceSubmissionId?: string | undefined;
3069
+ readonly deliveryPrincipal?: string | undefined;
3070
+ readonly reportKind?: "update" | undefined;
3071
+ } | undefined;
3072
+ readonly messageAdmission?: {
3073
+ readonly schemaVersion: 1;
3074
+ readonly message: {
3075
+ readonly ownerThreadId: string;
3076
+ readonly messageId: string;
3077
+ };
3078
+ readonly peerName: string;
3079
+ readonly sender: {
3080
+ readonly threadId: string;
3081
+ readonly agentId: string;
3082
+ };
3083
+ readonly returnAddress: {
3084
+ readonly threadId: string;
3085
+ readonly agentId: string;
3086
+ };
3087
+ readonly inReplyTo?: {
3088
+ readonly ownerThreadId: string;
3089
+ readonly messageId: string;
3090
+ } | undefined;
3091
+ } | {
3092
+ readonly _tag: "WorkerCompletion";
3093
+ readonly budgetExhausted: boolean;
3094
+ readonly schemaVersion: 1;
2542
3095
  readonly report: {
2543
3096
  readonly _tag: "Settled";
2544
3097
  readonly worker: {
@@ -2669,6 +3222,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
2669
3222
  readonly threadId: string;
2670
3223
  };
2671
3224
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
3225
+ readonly lifecycle?: "assignment" | undefined;
2672
3226
  readonly targetDigests: {
2673
3227
  readonly agent: string;
2674
3228
  readonly model: string;
@@ -3412,6 +3966,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
3412
3966
  readonly threadId: string;
3413
3967
  };
3414
3968
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
3969
+ readonly lifecycle?: "assignment" | undefined;
3415
3970
  readonly targetDigests: {
3416
3971
  readonly agent: string;
3417
3972
  readonly model: string;
@@ -3495,6 +4050,17 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
3495
4050
  readonly reportKind?: "update" | undefined;
3496
4051
  };
3497
4052
  readonly inputDigest: string;
4053
+ } | {
4054
+ readonly _tag: "WorkerStopRequested";
4055
+ readonly command: {
4056
+ readonly worker: {
4057
+ readonly schemaVersion: 1;
4058
+ readonly delegationId: string;
4059
+ readonly targetAgentId: string;
4060
+ readonly threadId: string;
4061
+ };
4062
+ readonly idempotencyKey: string;
4063
+ };
3498
4064
  } | {
3499
4065
  readonly _tag: "WorkerOriginRecorded";
3500
4066
  readonly origin: {
@@ -3516,6 +4082,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
3516
4082
  readonly threadId: string;
3517
4083
  };
3518
4084
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
4085
+ readonly lifecycle?: "assignment" | undefined;
3519
4086
  readonly targetDigests: {
3520
4087
  readonly agent: string;
3521
4088
  readonly model: string;
@@ -4251,6 +4818,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
4251
4818
  readonly threadId: string;
4252
4819
  };
4253
4820
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
4821
+ readonly lifecycle?: "assignment" | undefined;
4254
4822
  readonly targetDigests: {
4255
4823
  readonly agent: string;
4256
4824
  readonly model: string;
@@ -4334,6 +4902,17 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
4334
4902
  readonly reportKind?: "update" | undefined;
4335
4903
  };
4336
4904
  readonly inputDigest: string;
4905
+ } | {
4906
+ readonly _tag: "WorkerStopRequested";
4907
+ readonly command: {
4908
+ readonly worker: {
4909
+ readonly schemaVersion: 1;
4910
+ readonly delegationId: string;
4911
+ readonly targetAgentId: string;
4912
+ readonly threadId: string;
4913
+ };
4914
+ readonly idempotencyKey: string;
4915
+ };
4337
4916
  } | {
4338
4917
  readonly _tag: "WorkerOriginRecorded";
4339
4918
  readonly origin: {
@@ -4355,6 +4934,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
4355
4934
  readonly threadId: string;
4356
4935
  };
4357
4936
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
4937
+ readonly lifecycle?: "assignment" | undefined;
4358
4938
  readonly targetDigests: {
4359
4939
  readonly agent: string;
4360
4940
  readonly model: string;
@@ -4595,6 +5175,7 @@ export declare const encodePortResponse: (input: PortFailed | PortSucceeded, opt
4595
5175
  readonly threadId: string;
4596
5176
  };
4597
5177
  readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
5178
+ readonly lifecycle?: "assignment" | undefined;
4598
5179
  readonly targetDigests: {
4599
5180
  readonly agent: string;
4600
5181
  readonly model: string;