@byok-sdk/protocol 0.23.0 → 0.25.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,16 +16,6 @@ export declare const ProtocolVersionNumberSchema: z.ZodNumber;
16
16
  * end-to-end — older daemons omit `capabilities` entirely — and every field
17
17
  * inside it is itself optional, since detection can be partial.
18
18
  *
19
- * Per-tool allow/deny lists are deliberately NOT included here (noise).
20
- * `permissionModes` mirrors `PERMISSION_MODES` (`permission.ts`) but is kept
21
- * as a bare `string[]` rather than `z.enum(PERMISSION_MODES)`: this is a
22
- * runtime's self-reported observability data, not a control/security field,
23
- * so — per the freeze rule (tolerate unknown for observability, fail closed
24
- * for control/security; see `agent-event.ts`'s unknown-variant tolerance for
25
- * the same asymmetry applied to `task.progress` events) — it stays tolerant
26
- * of a mode string a newer runtime might report that this schema doesn't
27
- * enumerate yet, rather than rejecting the whole `conn.hello`.
28
- *
29
19
  * Unrecognized keys inside `capabilities` itself, by contrast, are silently
30
20
  * stripped (zod's default object behavior — same as every other payload
31
21
  * schema in this file) rather than passed through: this is a closed, typed
@@ -37,7 +27,6 @@ export declare const RuntimeCapabilitiesSchema: z.ZodObject<{
37
27
  resume: z.ZodOptional<z.ZodBoolean>;
38
28
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
39
29
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
40
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
30
  }, z.core.$strip>;
42
31
  export type RuntimeCapabilities = z.infer<typeof RuntimeCapabilitiesSchema>;
43
32
  /**
@@ -58,7 +47,6 @@ export declare const RuntimeInfoSchema: z.ZodObject<{
58
47
  resume: z.ZodOptional<z.ZodBoolean>;
59
48
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
60
49
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
61
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
50
  }, z.core.$strip>>;
63
51
  }, z.core.$strip>;
64
52
  export type RuntimeInfo = z.infer<typeof RuntimeInfoSchema>;
@@ -73,7 +61,6 @@ export declare const HarnessInfoSchema: z.ZodObject<{
73
61
  resume: z.ZodOptional<z.ZodBoolean>;
74
62
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
75
63
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
76
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
64
  }, z.core.$strip>;
78
65
  }, z.core.$strip>;
79
66
  export type HarnessInfo = z.infer<typeof HarnessInfoSchema>;
@@ -85,7 +72,6 @@ export declare const HarnessInventorySchema: z.ZodArray<z.ZodObject<{
85
72
  resume: z.ZodOptional<z.ZodBoolean>;
86
73
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
87
74
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
88
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
75
  }, z.core.$strip>;
90
76
  }, z.core.$strip>>;
91
77
  /** Maximum logical toolsets one daemon may advertise as locally configured. */
@@ -140,7 +126,6 @@ export declare const ConnHelloPayloadSchema: z.ZodObject<{
140
126
  resume: z.ZodOptional<z.ZodBoolean>;
141
127
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
142
128
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
143
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
129
  }, z.core.$strip>>;
145
130
  }, z.core.$strip>>>;
146
131
  harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -151,7 +136,6 @@ export declare const ConnHelloPayloadSchema: z.ZodObject<{
151
136
  resume: z.ZodOptional<z.ZodBoolean>;
152
137
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
153
138
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
154
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
155
139
  }, z.core.$strip>;
156
140
  }, z.core.$strip>>>;
157
141
  configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -215,18 +199,6 @@ export declare const TaskOfferPayloadSchema: z.ZodObject<{
215
199
  url: z.ZodOptional<z.ZodString>;
216
200
  }, z.core.$strip>;
217
201
  }, z.core.$strict>]>;
218
- policy: z.ZodObject<{
219
- mode: z.ZodEnum<{
220
- auto: "auto";
221
- confirm: "confirm";
222
- plan: "plan";
223
- readonly: "readonly";
224
- }>;
225
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
227
- workspaceRoot: z.ZodOptional<z.ZodString>;
228
- network: z.ZodOptional<z.ZodBoolean>;
229
- }, z.core.$strict>;
230
202
  runtime: z.ZodOptional<z.ZodEnum<{
231
203
  claude: "claude";
232
204
  codex: "codex";
@@ -288,18 +260,6 @@ export declare const TaskOfferWithToolsetsPayloadSchema: z.ZodObject<{
288
260
  url: z.ZodOptional<z.ZodString>;
289
261
  }, z.core.$strip>;
290
262
  }, z.core.$strict>]>;
291
- policy: z.ZodObject<{
292
- mode: z.ZodEnum<{
293
- auto: "auto";
294
- confirm: "confirm";
295
- plan: "plan";
296
- readonly: "readonly";
297
- }>;
298
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
299
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
300
- workspaceRoot: z.ZodOptional<z.ZodString>;
301
- network: z.ZodOptional<z.ZodBoolean>;
302
- }, z.core.$strict>;
303
263
  runtime: z.ZodOptional<z.ZodEnum<{
304
264
  claude: "claude";
305
265
  codex: "codex";
@@ -356,18 +316,6 @@ export declare const TaskOfferForAgentPayloadSchema: z.ZodObject<{
356
316
  url: z.ZodOptional<z.ZodString>;
357
317
  }, z.core.$strip>;
358
318
  }, z.core.$strict>]>;
359
- policy: z.ZodObject<{
360
- mode: z.ZodEnum<{
361
- auto: "auto";
362
- confirm: "confirm";
363
- plan: "plan";
364
- readonly: "readonly";
365
- }>;
366
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
367
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
368
- workspaceRoot: z.ZodOptional<z.ZodString>;
369
- network: z.ZodOptional<z.ZodBoolean>;
370
- }, z.core.$strict>;
371
319
  agentRef: z.ZodObject<{
372
320
  agentId: z.ZodString;
373
321
  profileRevision: z.ZodString;
@@ -433,18 +381,6 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
433
381
  url: z.ZodOptional<z.ZodString>;
434
382
  }, z.core.$strip>;
435
383
  }, z.core.$strict>]>;
436
- policy: z.ZodObject<{
437
- mode: z.ZodEnum<{
438
- auto: "auto";
439
- confirm: "confirm";
440
- plan: "plan";
441
- readonly: "readonly";
442
- }>;
443
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
444
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
445
- workspaceRoot: z.ZodOptional<z.ZodString>;
446
- network: z.ZodOptional<z.ZodBoolean>;
447
- }, z.core.$strict>;
448
384
  agentRef: z.ZodObject<{
449
385
  agentId: z.ZodString;
450
386
  profileRevision: z.ZodString;
@@ -495,15 +431,11 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
495
431
  sessionRef: z.ZodString;
496
432
  egressPolicy: z.ZodObject<{
497
433
  policyRevision: z.ZodString;
498
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
499
- mode: z.ZodLiteral<"metadata-status">;
500
- delivery: z.ZodLiteral<"latest-value">;
501
- }, z.core.$strict>, z.ZodObject<{
502
- mode: z.ZodLiteral<"contentful-trajectory">;
434
+ activity: z.ZodObject<{
503
435
  delivery: z.ZodLiteral<"latest-value">;
504
436
  maxCoalesceMs: z.ZodNumber;
505
437
  maxEventBytes: z.ZodNumber;
506
- }, z.core.$strict>], "mode">;
438
+ }, z.core.$strict>;
507
439
  reliable: z.ZodObject<{
508
440
  maxPendingEventsPerAgent: z.ZodNumber;
509
441
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -551,18 +483,6 @@ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<
551
483
  url: z.ZodOptional<z.ZodString>;
552
484
  }, z.core.$strip>;
553
485
  }, z.core.$strict>]>;
554
- policy: z.ZodObject<{
555
- mode: z.ZodEnum<{
556
- auto: "auto";
557
- confirm: "confirm";
558
- plan: "plan";
559
- readonly: "readonly";
560
- }>;
561
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
562
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
563
- workspaceRoot: z.ZodOptional<z.ZodString>;
564
- network: z.ZodOptional<z.ZodBoolean>;
565
- }, z.core.$strict>;
566
486
  agentRef: z.ZodObject<{
567
487
  agentId: z.ZodString;
568
488
  profileRevision: z.ZodString;
@@ -612,15 +532,11 @@ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<
612
532
  }, z.core.$strip>>;
613
533
  egressPolicy: z.ZodObject<{
614
534
  policyRevision: z.ZodString;
615
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
616
- mode: z.ZodLiteral<"metadata-status">;
617
- delivery: z.ZodLiteral<"latest-value">;
618
- }, z.core.$strict>, z.ZodObject<{
619
- mode: z.ZodLiteral<"contentful-trajectory">;
535
+ activity: z.ZodObject<{
620
536
  delivery: z.ZodLiteral<"latest-value">;
621
537
  maxCoalesceMs: z.ZodNumber;
622
538
  maxEventBytes: z.ZodNumber;
623
- }, z.core.$strict>], "mode">;
539
+ }, z.core.$strict>;
624
540
  reliable: z.ZodObject<{
625
541
  maxPendingEventsPerAgent: z.ZodNumber;
626
542
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -673,18 +589,6 @@ export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferFo
673
589
  * and declines non-retryably on any difference; nothing here is authority.
674
590
  */
675
591
  export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
676
- policy: z.ZodObject<{
677
- mode: z.ZodEnum<{
678
- auto: "auto";
679
- confirm: "confirm";
680
- plan: "plan";
681
- readonly: "readonly";
682
- }>;
683
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
684
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
685
- workspaceRoot: z.ZodOptional<z.ZodString>;
686
- network: z.ZodOptional<z.ZodBoolean>;
687
- }, z.core.$strict>;
688
592
  agentRef: z.ZodObject<{
689
593
  agentId: z.ZodString;
690
594
  profileRevision: z.ZodString;
@@ -744,15 +648,11 @@ export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
744
648
  }>;
745
649
  egressPolicy: z.ZodObject<{
746
650
  policyRevision: z.ZodString;
747
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
748
- mode: z.ZodLiteral<"metadata-status">;
749
- delivery: z.ZodLiteral<"latest-value">;
750
- }, z.core.$strict>, z.ZodObject<{
751
- mode: z.ZodLiteral<"contentful-trajectory">;
651
+ activity: z.ZodObject<{
752
652
  delivery: z.ZodLiteral<"latest-value">;
753
653
  maxCoalesceMs: z.ZodNumber;
754
654
  maxEventBytes: z.ZodNumber;
755
- }, z.core.$strict>], "mode">;
655
+ }, z.core.$strict>;
756
656
  reliable: z.ZodObject<{
757
657
  maxPendingEventsPerAgent: z.ZodNumber;
758
658
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -784,7 +684,7 @@ export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
784
684
  }, z.core.$strict>>;
785
685
  }, z.core.$strict>;
786
686
  export type TaskOfferPreparedPayload = z.infer<typeof TaskOfferPreparedPayloadSchema>;
787
- /** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
687
+ /** Daemon -> cloud: one durable reliable-lane item, forwarded as the Agent produced it. */
788
688
  export declare const AgentEgressReliablePayloadSchema: z.ZodObject<{
789
689
  agentRef: z.ZodObject<{
790
690
  agentId: z.ZodString;
@@ -1013,6 +913,24 @@ export declare const AgentHomeProjectionPayloadSchema: z.ZodObject<{
1013
913
  projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
1014
914
  }, z.core.$strict>;
1015
915
  export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPayloadSchema>;
916
+ /**
917
+ * Server -> daemon: a Host-approved Agent memory intent is waiting for this
918
+ * device (capability `agent-memory-intent.v1`, see `agent-memory-intent.ts`).
919
+ *
920
+ * `.strict()` and exactly two fields. There is deliberately no path, operation,
921
+ * revision or content: the device fetches the immutable intent from the Host
922
+ * under its own device authentication, so a mailbox row or journal line never
923
+ * holds memory content. `agentRef` routes the home lease and the local ledger
924
+ * and must equal the fetched intent's `agentRef`.
925
+ */
926
+ export declare const AgentMemoryIntentAvailablePayloadSchema: z.ZodObject<{
927
+ intentId: z.ZodUUID;
928
+ agentRef: z.ZodObject<{
929
+ agentId: z.ZodString;
930
+ profileRevision: z.ZodString;
931
+ }, z.core.$strict>;
932
+ }, z.core.$strict>;
933
+ export type AgentMemoryIntentAvailablePayload = z.infer<typeof AgentMemoryIntentAvailablePayloadSchema>;
1016
934
  /**
1017
935
  * Server -> daemon: one task-free, exact-device remote input preparation.
1018
936
  *
@@ -1033,14 +951,6 @@ export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPaylo
1033
951
  * `deadlineAt` may only ever be TIGHTENED locally: the device clamps to
1034
952
  * `min(deadlineAt - now, limits.preparationDeadlineMs)`, so a generous Host
1035
953
  * deadline cannot enlarge a configured local bound.
1036
- *
1037
- * `permissionMode` is DECLARED by the requester and validated by the device;
1038
- * the device never infers it. A preparation counts tokens for one concrete
1039
- * tool manifest, and that manifest is the policy-filtered set for exactly one
1040
- * mode (`mcp/projection.ts`'s `filterMcpObservationForPolicy`) — so a
1041
- * preparation whose mode is unstated is a count of a manifest nobody named.
1042
- * The device applies the declared mode to its own observation and records it
1043
- * in the artifact binding; it is not a grant, and it authorizes nothing.
1044
954
  */
1045
955
  export declare const AgentInputPreparationPayloadSchema: z.ZodObject<{
1046
956
  agentMemory: z.ZodEnum<{
@@ -1149,12 +1059,6 @@ export declare const AgentInputPreparationPayloadSchema: z.ZodObject<{
1149
1059
  contentHash: z.ZodString;
1150
1060
  }, z.core.$strict>]>;
1151
1061
  requiredToolsets: z.ZodArray<z.ZodString>;
1152
- permissionMode: z.ZodEnum<{
1153
- auto: "auto";
1154
- confirm: "confirm";
1155
- plan: "plan";
1156
- readonly: "readonly";
1157
- }>;
1158
1062
  accountingPolicyRef: z.ZodOptional<z.ZodObject<{
1159
1063
  revision: z.ZodString;
1160
1064
  ruledRuntime: z.ZodString;
@@ -1282,7 +1186,6 @@ export declare const TaskClaimPayloadSchema: z.ZodObject<{
1282
1186
  resume: z.ZodOptional<z.ZodBoolean>;
1283
1187
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
1284
1188
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
1285
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1286
1189
  }, z.core.$strip>>;
1287
1190
  }, z.core.$strip>;
1288
1191
  export type TaskClaimPayload = z.infer<typeof TaskClaimPayloadSchema>;
@@ -1295,8 +1198,7 @@ export declare const TaskStartedPayloadSchema: z.ZodObject<{}, z.core.$strip>;
1295
1198
  export type TaskStartedPayload = z.infer<typeof TaskStartedPayloadSchema>;
1296
1199
  /**
1297
1200
  * daemon -> server: decline an offer *before* claiming it (M1 gap #5) — e.g.
1298
- * no compatible/available runtime, or the offered policy exceeds this
1299
- * device's ceiling. Fail-closed rejections must use this instead of silently
1201
+ * no compatible/available runtime. Fail-closed rejections must use this instead of silently
1300
1202
  * dropping the offer.
1301
1203
  *
1302
1204
  * Decision (see docs/protocol.md "Declined vs. Failed" for the full
@@ -1398,6 +1300,12 @@ export declare const TaskProgressPayloadSchema: z.ZodObject<{
1398
1300
  outputTokens: z.ZodOptional<z.ZodNumber>;
1399
1301
  reasoningTokens: z.ZodOptional<z.ZodNumber>;
1400
1302
  totalTokens: z.ZodOptional<z.ZodNumber>;
1303
+ contextTokens: z.ZodOptional<z.ZodNumber>;
1304
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1305
+ contextSource: z.ZodOptional<z.ZodEnum<{
1306
+ estimate: "estimate";
1307
+ provider: "provider";
1308
+ }>>;
1401
1309
  }, z.core.$strip>], "type">, z.ZodObject<{
1402
1310
  type: z.ZodString;
1403
1311
  }, z.core.$loose>]>>;
@@ -1787,18 +1695,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
1787
1695
  url: z.ZodOptional<z.ZodString>;
1788
1696
  }, z.core.$strip>;
1789
1697
  }, z.core.$strict>]>;
1790
- policy: z.ZodObject<{
1791
- mode: z.ZodEnum<{
1792
- auto: "auto";
1793
- confirm: "confirm";
1794
- plan: "plan";
1795
- readonly: "readonly";
1796
- }>;
1797
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1798
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1799
- workspaceRoot: z.ZodOptional<z.ZodString>;
1800
- network: z.ZodOptional<z.ZodBoolean>;
1801
- }, z.core.$strict>;
1802
1698
  runtime: z.ZodOptional<z.ZodEnum<{
1803
1699
  claude: "claude";
1804
1700
  codex: "codex";
@@ -1848,18 +1744,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
1848
1744
  url: z.ZodOptional<z.ZodString>;
1849
1745
  }, z.core.$strip>;
1850
1746
  }, z.core.$strict>]>;
1851
- policy: z.ZodObject<{
1852
- mode: z.ZodEnum<{
1853
- auto: "auto";
1854
- confirm: "confirm";
1855
- plan: "plan";
1856
- readonly: "readonly";
1857
- }>;
1858
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1859
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1860
- workspaceRoot: z.ZodOptional<z.ZodString>;
1861
- network: z.ZodOptional<z.ZodBoolean>;
1862
- }, z.core.$strict>;
1863
1747
  runtime: z.ZodOptional<z.ZodEnum<{
1864
1748
  claude: "claude";
1865
1749
  codex: "codex";
@@ -1910,18 +1794,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
1910
1794
  url: z.ZodOptional<z.ZodString>;
1911
1795
  }, z.core.$strip>;
1912
1796
  }, z.core.$strict>]>;
1913
- policy: z.ZodObject<{
1914
- mode: z.ZodEnum<{
1915
- auto: "auto";
1916
- confirm: "confirm";
1917
- plan: "plan";
1918
- readonly: "readonly";
1919
- }>;
1920
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1921
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1922
- workspaceRoot: z.ZodOptional<z.ZodString>;
1923
- network: z.ZodOptional<z.ZodBoolean>;
1924
- }, z.core.$strict>;
1925
1797
  agentRef: z.ZodObject<{
1926
1798
  agentId: z.ZodString;
1927
1799
  profileRevision: z.ZodString;
@@ -1981,18 +1853,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
1981
1853
  url: z.ZodOptional<z.ZodString>;
1982
1854
  }, z.core.$strip>;
1983
1855
  }, z.core.$strict>]>;
1984
- policy: z.ZodObject<{
1985
- mode: z.ZodEnum<{
1986
- auto: "auto";
1987
- confirm: "confirm";
1988
- plan: "plan";
1989
- readonly: "readonly";
1990
- }>;
1991
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1992
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1993
- workspaceRoot: z.ZodOptional<z.ZodString>;
1994
- network: z.ZodOptional<z.ZodBoolean>;
1995
- }, z.core.$strict>;
1996
1856
  agentRef: z.ZodObject<{
1997
1857
  agentId: z.ZodString;
1998
1858
  profileRevision: z.ZodString;
@@ -2043,15 +1903,11 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2043
1903
  sessionRef: z.ZodString;
2044
1904
  egressPolicy: z.ZodObject<{
2045
1905
  policyRevision: z.ZodString;
2046
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2047
- mode: z.ZodLiteral<"metadata-status">;
2048
- delivery: z.ZodLiteral<"latest-value">;
2049
- }, z.core.$strict>, z.ZodObject<{
2050
- mode: z.ZodLiteral<"contentful-trajectory">;
1906
+ activity: z.ZodObject<{
2051
1907
  delivery: z.ZodLiteral<"latest-value">;
2052
1908
  maxCoalesceMs: z.ZodNumber;
2053
1909
  maxEventBytes: z.ZodNumber;
2054
- }, z.core.$strict>], "mode">;
1910
+ }, z.core.$strict>;
2055
1911
  reliable: z.ZodObject<{
2056
1912
  maxPendingEventsPerAgent: z.ZodNumber;
2057
1913
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2092,18 +1948,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2092
1948
  url: z.ZodOptional<z.ZodString>;
2093
1949
  }, z.core.$strip>;
2094
1950
  }, z.core.$strict>]>;
2095
- policy: z.ZodObject<{
2096
- mode: z.ZodEnum<{
2097
- auto: "auto";
2098
- confirm: "confirm";
2099
- plan: "plan";
2100
- readonly: "readonly";
2101
- }>;
2102
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2103
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2104
- workspaceRoot: z.ZodOptional<z.ZodString>;
2105
- network: z.ZodOptional<z.ZodBoolean>;
2106
- }, z.core.$strict>;
2107
1951
  agentRef: z.ZodObject<{
2108
1952
  agentId: z.ZodString;
2109
1953
  profileRevision: z.ZodString;
@@ -2153,15 +1997,11 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2153
1997
  }, z.core.$strip>>;
2154
1998
  egressPolicy: z.ZodObject<{
2155
1999
  policyRevision: z.ZodString;
2156
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2157
- mode: z.ZodLiteral<"metadata-status">;
2158
- delivery: z.ZodLiteral<"latest-value">;
2159
- }, z.core.$strict>, z.ZodObject<{
2160
- mode: z.ZodLiteral<"contentful-trajectory">;
2000
+ activity: z.ZodObject<{
2161
2001
  delivery: z.ZodLiteral<"latest-value">;
2162
2002
  maxCoalesceMs: z.ZodNumber;
2163
2003
  maxEventBytes: z.ZodNumber;
2164
- }, z.core.$strict>], "mode">;
2004
+ }, z.core.$strict>;
2165
2005
  reliable: z.ZodObject<{
2166
2006
  maxPendingEventsPerAgent: z.ZodNumber;
2167
2007
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2193,18 +2033,6 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2193
2033
  }, z.core.$strict>>;
2194
2034
  }, z.core.$strict>;
2195
2035
  readonly 'task.offer_prepared': z.ZodObject<{
2196
- policy: z.ZodObject<{
2197
- mode: z.ZodEnum<{
2198
- auto: "auto";
2199
- confirm: "confirm";
2200
- plan: "plan";
2201
- readonly: "readonly";
2202
- }>;
2203
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2204
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2205
- workspaceRoot: z.ZodOptional<z.ZodString>;
2206
- network: z.ZodOptional<z.ZodBoolean>;
2207
- }, z.core.$strict>;
2208
2036
  agentRef: z.ZodObject<{
2209
2037
  agentId: z.ZodString;
2210
2038
  profileRevision: z.ZodString;
@@ -2264,15 +2092,11 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2264
2092
  }>;
2265
2093
  egressPolicy: z.ZodObject<{
2266
2094
  policyRevision: z.ZodString;
2267
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2268
- mode: z.ZodLiteral<"metadata-status">;
2269
- delivery: z.ZodLiteral<"latest-value">;
2270
- }, z.core.$strict>, z.ZodObject<{
2271
- mode: z.ZodLiteral<"contentful-trajectory">;
2095
+ activity: z.ZodObject<{
2272
2096
  delivery: z.ZodLiteral<"latest-value">;
2273
2097
  maxCoalesceMs: z.ZodNumber;
2274
2098
  maxEventBytes: z.ZodNumber;
2275
- }, z.core.$strict>], "mode">;
2099
+ }, z.core.$strict>;
2276
2100
  reliable: z.ZodObject<{
2277
2101
  maxPendingEventsPerAgent: z.ZodNumber;
2278
2102
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2319,18 +2143,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2319
2143
  url: z.ZodOptional<z.ZodString>;
2320
2144
  }, z.core.$strip>;
2321
2145
  }, z.core.$strict>]>;
2322
- policy: z.ZodObject<{
2323
- mode: z.ZodEnum<{
2324
- auto: "auto";
2325
- confirm: "confirm";
2326
- plan: "plan";
2327
- readonly: "readonly";
2328
- }>;
2329
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2330
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2331
- workspaceRoot: z.ZodOptional<z.ZodString>;
2332
- network: z.ZodOptional<z.ZodBoolean>;
2333
- }, z.core.$strict>;
2334
2146
  runtime: z.ZodOptional<z.ZodEnum<{
2335
2147
  claude: "claude";
2336
2148
  codex: "codex";
@@ -2380,18 +2192,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2380
2192
  url: z.ZodOptional<z.ZodString>;
2381
2193
  }, z.core.$strip>;
2382
2194
  }, z.core.$strict>]>;
2383
- policy: z.ZodObject<{
2384
- mode: z.ZodEnum<{
2385
- auto: "auto";
2386
- confirm: "confirm";
2387
- plan: "plan";
2388
- readonly: "readonly";
2389
- }>;
2390
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2391
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2392
- workspaceRoot: z.ZodOptional<z.ZodString>;
2393
- network: z.ZodOptional<z.ZodBoolean>;
2394
- }, z.core.$strict>;
2395
2195
  runtime: z.ZodOptional<z.ZodEnum<{
2396
2196
  claude: "claude";
2397
2197
  codex: "codex";
@@ -2442,18 +2242,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2442
2242
  url: z.ZodOptional<z.ZodString>;
2443
2243
  }, z.core.$strip>;
2444
2244
  }, z.core.$strict>]>;
2445
- policy: z.ZodObject<{
2446
- mode: z.ZodEnum<{
2447
- auto: "auto";
2448
- confirm: "confirm";
2449
- plan: "plan";
2450
- readonly: "readonly";
2451
- }>;
2452
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2453
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2454
- workspaceRoot: z.ZodOptional<z.ZodString>;
2455
- network: z.ZodOptional<z.ZodBoolean>;
2456
- }, z.core.$strict>;
2457
2245
  agentRef: z.ZodObject<{
2458
2246
  agentId: z.ZodString;
2459
2247
  profileRevision: z.ZodString;
@@ -2513,18 +2301,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2513
2301
  url: z.ZodOptional<z.ZodString>;
2514
2302
  }, z.core.$strip>;
2515
2303
  }, z.core.$strict>]>;
2516
- policy: z.ZodObject<{
2517
- mode: z.ZodEnum<{
2518
- auto: "auto";
2519
- confirm: "confirm";
2520
- plan: "plan";
2521
- readonly: "readonly";
2522
- }>;
2523
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2524
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2525
- workspaceRoot: z.ZodOptional<z.ZodString>;
2526
- network: z.ZodOptional<z.ZodBoolean>;
2527
- }, z.core.$strict>;
2528
2304
  agentRef: z.ZodObject<{
2529
2305
  agentId: z.ZodString;
2530
2306
  profileRevision: z.ZodString;
@@ -2575,15 +2351,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2575
2351
  sessionRef: z.ZodString;
2576
2352
  egressPolicy: z.ZodObject<{
2577
2353
  policyRevision: z.ZodString;
2578
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2579
- mode: z.ZodLiteral<"metadata-status">;
2580
- delivery: z.ZodLiteral<"latest-value">;
2581
- }, z.core.$strict>, z.ZodObject<{
2582
- mode: z.ZodLiteral<"contentful-trajectory">;
2354
+ activity: z.ZodObject<{
2583
2355
  delivery: z.ZodLiteral<"latest-value">;
2584
2356
  maxCoalesceMs: z.ZodNumber;
2585
2357
  maxEventBytes: z.ZodNumber;
2586
- }, z.core.$strict>], "mode">;
2358
+ }, z.core.$strict>;
2587
2359
  reliable: z.ZodObject<{
2588
2360
  maxPendingEventsPerAgent: z.ZodNumber;
2589
2361
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2624,18 +2396,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2624
2396
  url: z.ZodOptional<z.ZodString>;
2625
2397
  }, z.core.$strip>;
2626
2398
  }, z.core.$strict>]>;
2627
- policy: z.ZodObject<{
2628
- mode: z.ZodEnum<{
2629
- auto: "auto";
2630
- confirm: "confirm";
2631
- plan: "plan";
2632
- readonly: "readonly";
2633
- }>;
2634
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2635
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2636
- workspaceRoot: z.ZodOptional<z.ZodString>;
2637
- network: z.ZodOptional<z.ZodBoolean>;
2638
- }, z.core.$strict>;
2639
2399
  agentRef: z.ZodObject<{
2640
2400
  agentId: z.ZodString;
2641
2401
  profileRevision: z.ZodString;
@@ -2685,15 +2445,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2685
2445
  }, z.core.$strip>>;
2686
2446
  egressPolicy: z.ZodObject<{
2687
2447
  policyRevision: z.ZodString;
2688
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2689
- mode: z.ZodLiteral<"metadata-status">;
2690
- delivery: z.ZodLiteral<"latest-value">;
2691
- }, z.core.$strict>, z.ZodObject<{
2692
- mode: z.ZodLiteral<"contentful-trajectory">;
2448
+ activity: z.ZodObject<{
2693
2449
  delivery: z.ZodLiteral<"latest-value">;
2694
2450
  maxCoalesceMs: z.ZodNumber;
2695
2451
  maxEventBytes: z.ZodNumber;
2696
- }, z.core.$strict>], "mode">;
2452
+ }, z.core.$strict>;
2697
2453
  reliable: z.ZodObject<{
2698
2454
  maxPendingEventsPerAgent: z.ZodNumber;
2699
2455
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2725,18 +2481,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2725
2481
  }, z.core.$strict>>;
2726
2482
  }, z.core.$strict>;
2727
2483
  readonly 'task.offer_prepared': z.ZodObject<{
2728
- policy: z.ZodObject<{
2729
- mode: z.ZodEnum<{
2730
- auto: "auto";
2731
- confirm: "confirm";
2732
- plan: "plan";
2733
- readonly: "readonly";
2734
- }>;
2735
- allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2736
- denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2737
- workspaceRoot: z.ZodOptional<z.ZodString>;
2738
- network: z.ZodOptional<z.ZodBoolean>;
2739
- }, z.core.$strict>;
2740
2484
  agentRef: z.ZodObject<{
2741
2485
  agentId: z.ZodString;
2742
2486
  profileRevision: z.ZodString;
@@ -2796,15 +2540,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2796
2540
  }>;
2797
2541
  egressPolicy: z.ZodObject<{
2798
2542
  policyRevision: z.ZodString;
2799
- activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2800
- mode: z.ZodLiteral<"metadata-status">;
2801
- delivery: z.ZodLiteral<"latest-value">;
2802
- }, z.core.$strict>, z.ZodObject<{
2803
- mode: z.ZodLiteral<"contentful-trajectory">;
2543
+ activity: z.ZodObject<{
2804
2544
  delivery: z.ZodLiteral<"latest-value">;
2805
2545
  maxCoalesceMs: z.ZodNumber;
2806
2546
  maxEventBytes: z.ZodNumber;
2807
- }, z.core.$strict>], "mode">;
2547
+ }, z.core.$strict>;
2808
2548
  reliable: z.ZodObject<{
2809
2549
  maxPendingEventsPerAgent: z.ZodNumber;
2810
2550
  maxPendingBytesPerAgent: z.ZodNumber;
@@ -2854,7 +2594,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2854
2594
  resume: z.ZodOptional<z.ZodBoolean>;
2855
2595
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
2856
2596
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
2857
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2858
2597
  }, z.core.$strip>>;
2859
2598
  }, z.core.$strip>>>;
2860
2599
  harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2865,7 +2604,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2865
2604
  resume: z.ZodOptional<z.ZodBoolean>;
2866
2605
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
2867
2606
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
2868
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2869
2607
  }, z.core.$strip>;
2870
2608
  }, z.core.$strip>>>;
2871
2609
  configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -3193,12 +2931,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3193
2931
  contentHash: z.ZodString;
3194
2932
  }, z.core.$strict>]>;
3195
2933
  requiredToolsets: z.ZodArray<z.ZodString>;
3196
- permissionMode: z.ZodEnum<{
3197
- auto: "auto";
3198
- confirm: "confirm";
3199
- plan: "plan";
3200
- readonly: "readonly";
3201
- }>;
3202
2934
  accountingPolicyRef: z.ZodOptional<z.ZodObject<{
3203
2935
  revision: z.ZodString;
3204
2936
  ruledRuntime: z.ZodString;
@@ -3212,6 +2944,13 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3212
2944
  readonly 'provider.provisioning.available': z.ZodObject<{
3213
2945
  requestId: z.ZodUUID;
3214
2946
  }, z.core.$strict>;
2947
+ readonly 'agent.memory.intent.available': z.ZodObject<{
2948
+ intentId: z.ZodUUID;
2949
+ agentRef: z.ZodObject<{
2950
+ agentId: z.ZodString;
2951
+ profileRevision: z.ZodString;
2952
+ }, z.core.$strict>;
2953
+ }, z.core.$strict>;
3215
2954
  readonly 'task.approve': z.ZodObject<{
3216
2955
  approvalId: z.ZodOptional<z.ZodString>;
3217
2956
  }, z.core.$strip>;
@@ -3243,7 +2982,6 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3243
2982
  resume: z.ZodOptional<z.ZodBoolean>;
3244
2983
  approvalInteractive: z.ZodOptional<z.ZodBoolean>;
3245
2984
  mcpToolsets: z.ZodOptional<z.ZodBoolean>;
3246
- permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
3247
2985
  }, z.core.$strip>>;
3248
2986
  }, z.core.$strip>;
3249
2987
  readonly 'task.started': z.ZodObject<{}, z.core.$strip>;
@@ -3324,6 +3062,12 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3324
3062
  outputTokens: z.ZodOptional<z.ZodNumber>;
3325
3063
  reasoningTokens: z.ZodOptional<z.ZodNumber>;
3326
3064
  totalTokens: z.ZodOptional<z.ZodNumber>;
3065
+ contextTokens: z.ZodOptional<z.ZodNumber>;
3066
+ contextWindow: z.ZodOptional<z.ZodNumber>;
3067
+ contextSource: z.ZodOptional<z.ZodEnum<{
3068
+ estimate: "estimate";
3069
+ provider: "provider";
3070
+ }>>;
3327
3071
  }, z.core.$strip>], "type">, z.ZodObject<{
3328
3072
  type: z.ZodString;
3329
3073
  }, z.core.$loose>]>>;
@@ -3453,7 +3197,7 @@ export declare const MESSAGE_TYPES: MessageType[];
3453
3197
  * (`envelope.ts`) to decide which branches require envelope `seq` (M1
3454
3198
  * redelivery cursor).
3455
3199
  */
3456
- export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.offer_for_agent", "task.offer_for_agent_with_egress", "task.offer_for_agent_with_egress_fresh", "task.offer_prepared", "agent.egress.ack", "agent.message.disposition", "agent.content.read", "agent.home.projection", "agent.input.preparation", "provider.provisioning.available", "task.approve", "task.reject", "task.cancel", "task.steer"];
3200
+ export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.offer_for_agent", "task.offer_for_agent_with_egress", "task.offer_for_agent_with_egress_fresh", "task.offer_prepared", "agent.egress.ack", "agent.message.disposition", "agent.content.read", "agent.home.projection", "agent.input.preparation", "provider.provisioning.available", "agent.memory.intent.available", "task.approve", "task.reject", "task.cancel", "task.steer"];
3457
3201
  /**
3458
3202
  * Message types the daemon sends to the server — the flip side of
3459
3203
  * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's