@winmatrix/protocol 1.0.5 → 1.0.6

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.
@@ -438,6 +438,29 @@ export declare const PreparedRunRecordSchema: z.ZodObject<{
438
438
  preparedAt: string;
439
439
  }>;
440
440
  export type PreparedRunRecord = z.infer<typeof PreparedRunRecordSchema>;
441
+ export declare const ContextCompressionModeSchema: z.ZodEnum<["none", "truncate_head", "truncate_tail"]>;
442
+ export declare const ContextBudgetSchema: z.ZodObject<{
443
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
444
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
445
+ /** systemPrompt 的最大字符数。 */
446
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
447
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
448
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
449
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
450
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
451
+ }, "strip", z.ZodTypeAny, {
452
+ maxInputChars?: number | undefined;
453
+ maxSystemChars?: number | undefined;
454
+ maxContextChars?: number | undefined;
455
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
456
+ }, {
457
+ maxInputChars?: number | undefined;
458
+ maxSystemChars?: number | undefined;
459
+ maxContextChars?: number | undefined;
460
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
461
+ }>;
462
+ export type ContextCompressionMode = z.infer<typeof ContextCompressionModeSchema>;
463
+ export type ContextBudget = z.infer<typeof ContextBudgetSchema>;
441
464
  /**
442
465
  * V2 调用计划:结构化 blocks、model、permission、engineOptions 与 Session binding。
443
466
  * 公共请求 DTO,MUST NOT 包含 Hook 字段、callback 或 secret。
@@ -678,6 +701,27 @@ export declare const EngineInvocationPlanV2Schema: z.ZodObject<{
678
701
  mode: "fork";
679
702
  }>]>>;
680
703
  artifactPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
704
+ /** 当前 turn 上下文预算;adapter 在入口对 input + systemPrompt 做 last-mile 截断。 */
705
+ contextBudget: z.ZodOptional<z.ZodObject<{
706
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
707
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
708
+ /** systemPrompt 的最大字符数。 */
709
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
710
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
711
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
712
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
713
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
714
+ }, "strip", z.ZodTypeAny, {
715
+ maxInputChars?: number | undefined;
716
+ maxSystemChars?: number | undefined;
717
+ maxContextChars?: number | undefined;
718
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
719
+ }, {
720
+ maxInputChars?: number | undefined;
721
+ maxSystemChars?: number | undefined;
722
+ maxContextChars?: number | undefined;
723
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
724
+ }>>;
681
725
  }, "strip", z.ZodTypeAny, {
682
726
  taskId: string;
683
727
  input: {
@@ -705,6 +749,12 @@ export declare const EngineInvocationPlanV2Schema: z.ZodObject<{
705
749
  schemaVersion: 2;
706
750
  allowedTools?: string[] | undefined;
707
751
  systemPrompt?: string | undefined;
752
+ contextBudget?: {
753
+ maxInputChars?: number | undefined;
754
+ maxSystemChars?: number | undefined;
755
+ maxContextChars?: number | undefined;
756
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
757
+ } | undefined;
708
758
  timeoutMs?: number | undefined;
709
759
  hostProfile?: string | undefined;
710
760
  session?: {
@@ -771,6 +821,12 @@ export declare const EngineInvocationPlanV2Schema: z.ZodObject<{
771
821
  schemaVersion: 2;
772
822
  allowedTools?: string[] | undefined;
773
823
  systemPrompt?: string | undefined;
824
+ contextBudget?: {
825
+ maxInputChars?: number | undefined;
826
+ maxSystemChars?: number | undefined;
827
+ maxContextChars?: number | undefined;
828
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
829
+ } | undefined;
774
830
  timeoutMs?: number | undefined;
775
831
  hostProfile?: string | undefined;
776
832
  session?: {
@@ -1049,6 +1105,27 @@ export declare const EngineInvocationPlanSchema: z.ZodUnion<[z.ZodObject<{
1049
1105
  mode: "fork";
1050
1106
  }>]>>;
1051
1107
  artifactPolicy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1108
+ /** 当前 turn 上下文预算;adapter 在入口对 input + systemPrompt 做 last-mile 截断。 */
1109
+ contextBudget: z.ZodOptional<z.ZodObject<{
1110
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
1111
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
1112
+ /** systemPrompt 的最大字符数。 */
1113
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
1114
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
1115
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
1116
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
1117
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
1118
+ }, "strip", z.ZodTypeAny, {
1119
+ maxInputChars?: number | undefined;
1120
+ maxSystemChars?: number | undefined;
1121
+ maxContextChars?: number | undefined;
1122
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1123
+ }, {
1124
+ maxInputChars?: number | undefined;
1125
+ maxSystemChars?: number | undefined;
1126
+ maxContextChars?: number | undefined;
1127
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1128
+ }>>;
1052
1129
  }, "strip", z.ZodTypeAny, {
1053
1130
  taskId: string;
1054
1131
  input: {
@@ -1076,6 +1153,12 @@ export declare const EngineInvocationPlanSchema: z.ZodUnion<[z.ZodObject<{
1076
1153
  schemaVersion: 2;
1077
1154
  allowedTools?: string[] | undefined;
1078
1155
  systemPrompt?: string | undefined;
1156
+ contextBudget?: {
1157
+ maxInputChars?: number | undefined;
1158
+ maxSystemChars?: number | undefined;
1159
+ maxContextChars?: number | undefined;
1160
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1161
+ } | undefined;
1079
1162
  timeoutMs?: number | undefined;
1080
1163
  hostProfile?: string | undefined;
1081
1164
  session?: {
@@ -1142,6 +1225,12 @@ export declare const EngineInvocationPlanSchema: z.ZodUnion<[z.ZodObject<{
1142
1225
  schemaVersion: 2;
1143
1226
  allowedTools?: string[] | undefined;
1144
1227
  systemPrompt?: string | undefined;
1228
+ contextBudget?: {
1229
+ maxInputChars?: number | undefined;
1230
+ maxSystemChars?: number | undefined;
1231
+ maxContextChars?: number | undefined;
1232
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1233
+ } | undefined;
1145
1234
  timeoutMs?: number | undefined;
1146
1235
  hostProfile?: string | undefined;
1147
1236
  session?: {
@@ -1487,6 +1576,27 @@ export declare const EngineLaunchSpecSchema: z.ZodObject<{
1487
1576
  }>, "many">;
1488
1577
  nonSensitiveEnv: z.ZodRecord<z.ZodString, z.ZodString>;
1489
1578
  artifactPolicy: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1579
+ /** 当前 turn 上下文预算;参与 fingerprint,fingerprint 后不得修改。 */
1580
+ contextBudget: z.ZodOptional<z.ZodObject<{
1581
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
1582
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
1583
+ /** systemPrompt 的最大字符数。 */
1584
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
1585
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
1586
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
1587
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
1588
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
1589
+ }, "strip", z.ZodTypeAny, {
1590
+ maxInputChars?: number | undefined;
1591
+ maxSystemChars?: number | undefined;
1592
+ maxContextChars?: number | undefined;
1593
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1594
+ }, {
1595
+ maxInputChars?: number | undefined;
1596
+ maxSystemChars?: number | undefined;
1597
+ maxContextChars?: number | undefined;
1598
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1599
+ }>>;
1490
1600
  }, "strip", z.ZodTypeAny, {
1491
1601
  allowedTools: string[];
1492
1602
  input: {
@@ -1545,6 +1655,12 @@ export declare const EngineLaunchSpecSchema: z.ZodObject<{
1545
1655
  }[];
1546
1656
  nonSensitiveEnv: Record<string, string>;
1547
1657
  systemPrompt?: string | undefined;
1658
+ contextBudget?: {
1659
+ maxInputChars?: number | undefined;
1660
+ maxSystemChars?: number | undefined;
1661
+ maxContextChars?: number | undefined;
1662
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1663
+ } | undefined;
1548
1664
  workDir?: string | undefined;
1549
1665
  model?: {
1550
1666
  modelId: string;
@@ -1613,6 +1729,12 @@ export declare const EngineLaunchSpecSchema: z.ZodObject<{
1613
1729
  }[];
1614
1730
  nonSensitiveEnv: Record<string, string>;
1615
1731
  systemPrompt?: string | undefined;
1732
+ contextBudget?: {
1733
+ maxInputChars?: number | undefined;
1734
+ maxSystemChars?: number | undefined;
1735
+ maxContextChars?: number | undefined;
1736
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
1737
+ } | undefined;
1616
1738
  workDir?: string | undefined;
1617
1739
  model?: {
1618
1740
  modelId: string;
@@ -1894,6 +2016,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
1894
2016
  hostProfile: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["coding", "sre"]>, z.ZodString]>>;
1895
2017
  } & {
1896
2018
  type: z.ZodLiteral<"tool_call">;
2019
+ callId: z.ZodOptional<z.ZodString>;
1897
2020
  name: z.ZodString;
1898
2021
  input: z.ZodOptional<z.ZodUnknown>;
1899
2022
  }, "strip", z.ZodTypeAny, {
@@ -1903,6 +2026,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
1903
2026
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
1904
2027
  hostKind?: "workstation" | "external_computer" | undefined;
1905
2028
  hostProfile?: string | undefined;
2029
+ callId?: string | undefined;
1906
2030
  }, {
1907
2031
  type: "tool_call";
1908
2032
  name: string;
@@ -1910,12 +2034,14 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
1910
2034
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
1911
2035
  hostKind?: "workstation" | "external_computer" | undefined;
1912
2036
  hostProfile?: string | undefined;
2037
+ callId?: string | undefined;
1913
2038
  }>, z.ZodObject<{
1914
2039
  engineId: z.ZodOptional<z.ZodEnum<["claude-code", "codex", "hermes", "openclaw", "custom"]>>;
1915
2040
  hostKind: z.ZodOptional<z.ZodEnum<["workstation", "external_computer"]>>;
1916
2041
  hostProfile: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["coding", "sre"]>, z.ZodString]>>;
1917
2042
  } & {
1918
2043
  type: z.ZodLiteral<"tool_result_delta">;
2044
+ callId: z.ZodOptional<z.ZodString>;
1919
2045
  name: z.ZodOptional<z.ZodString>;
1920
2046
  text: z.ZodString;
1921
2047
  }, "strip", z.ZodTypeAny, {
@@ -1925,6 +2051,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
1925
2051
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
1926
2052
  hostKind?: "workstation" | "external_computer" | undefined;
1927
2053
  hostProfile?: string | undefined;
2054
+ callId?: string | undefined;
1928
2055
  }, {
1929
2056
  type: "tool_result_delta";
1930
2057
  text: string;
@@ -1932,6 +2059,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
1932
2059
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
1933
2060
  hostKind?: "workstation" | "external_computer" | undefined;
1934
2061
  hostProfile?: string | undefined;
2062
+ callId?: string | undefined;
1935
2063
  }>, z.ZodObject<{
1936
2064
  engineId: z.ZodOptional<z.ZodEnum<["claude-code", "codex", "hermes", "openclaw", "custom"]>>;
1937
2065
  hostKind: z.ZodOptional<z.ZodEnum<["workstation", "external_computer"]>>;
@@ -2260,6 +2388,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
2260
2388
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
2261
2389
  hostKind?: "workstation" | "external_computer" | undefined;
2262
2390
  hostProfile?: string | undefined;
2391
+ callId?: string | undefined;
2263
2392
  } | {
2264
2393
  type: "tool_result_delta";
2265
2394
  text: string;
@@ -2267,6 +2396,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
2267
2396
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
2268
2397
  hostKind?: "workstation" | "external_computer" | undefined;
2269
2398
  hostProfile?: string | undefined;
2399
+ callId?: string | undefined;
2270
2400
  } | {
2271
2401
  type: "stderr_delta";
2272
2402
  text: string;
@@ -2375,6 +2505,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
2375
2505
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
2376
2506
  hostKind?: "workstation" | "external_computer" | undefined;
2377
2507
  hostProfile?: string | undefined;
2508
+ callId?: string | undefined;
2378
2509
  } | {
2379
2510
  type: "tool_result_delta";
2380
2511
  text: string;
@@ -2382,6 +2513,7 @@ export declare const EngineEventEnvelopeSchema: z.ZodObject<{
2382
2513
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
2383
2514
  hostKind?: "workstation" | "external_computer" | undefined;
2384
2515
  hostProfile?: string | undefined;
2516
+ callId?: string | undefined;
2385
2517
  } | {
2386
2518
  type: "stderr_delta";
2387
2519
  text: string;
@@ -3444,6 +3576,14 @@ export declare const EngineSessionHistoryQuerySchema: z.ZodObject<{
3444
3576
  */
3445
3577
  includeSystem: z.ZodOptional<z.ZodBoolean>;
3446
3578
  noTruncate: z.ZodOptional<z.ZodBoolean>;
3579
+ /** 是否只返回 session 元数据,跳过消息体(用于初始详情加载,避免大 payload 触发 sandbox stdout 截断)。 */
3580
+ noMessages: z.ZodOptional<z.ZodBoolean>;
3581
+ /**
3582
+ * 是否返回拼接文本格式的消息(user/assistant 交替文本),替代结构化 messages[]。
3583
+ * 体积远小于结构化 messages[],可避免大会话触发 sandbox stdout 截断,
3584
+ * 同时前端仍能获得完整对话文本。
3585
+ */
3586
+ joinedMessages: z.ZodOptional<z.ZodBoolean>;
3447
3587
  }, "strip", z.ZodTypeAny, {
3448
3588
  limit: number;
3449
3589
  includeRawMessages?: boolean | undefined;
@@ -3454,6 +3594,8 @@ export declare const EngineSessionHistoryQuerySchema: z.ZodObject<{
3454
3594
  } | undefined;
3455
3595
  includeSystem?: boolean | undefined;
3456
3596
  noTruncate?: boolean | undefined;
3597
+ noMessages?: boolean | undefined;
3598
+ joinedMessages?: boolean | undefined;
3457
3599
  }, {
3458
3600
  limit: number;
3459
3601
  includeRawMessages?: boolean | undefined;
@@ -3464,6 +3606,8 @@ export declare const EngineSessionHistoryQuerySchema: z.ZodObject<{
3464
3606
  } | undefined;
3465
3607
  includeSystem?: boolean | undefined;
3466
3608
  noTruncate?: boolean | undefined;
3609
+ noMessages?: boolean | undefined;
3610
+ joinedMessages?: boolean | undefined;
3467
3611
  }>;
3468
3612
  export declare const EngineSessionSearchQuerySchema: z.ZodObject<{
3469
3613
  text: z.ZodString;
@@ -3946,6 +4090,12 @@ export declare const EngineSessionDetailSchema: z.ZodObject<{
3946
4090
  timestamp?: string | undefined;
3947
4091
  messageId?: string | undefined;
3948
4092
  }>, "many">;
4093
+ /**
4094
+ * 拼接文本格式的消息正文(user/assistant 交替文本)。
4095
+ * 仅当 history query 的 joinedMessages=true 时由 Pod CLI 返回,
4096
+ * 此时 messages 为空数组(schema 必填),正文走本字段以规避 stdout 截断。
4097
+ */
4098
+ joinedMessages: z.ZodOptional<z.ZodString>;
3949
4099
  nextCursor: z.ZodOptional<z.ZodString>;
3950
4100
  rawMessagesIncluded: z.ZodBoolean;
3951
4101
  }, "strip", z.ZodTypeAny, {
@@ -3991,6 +4141,7 @@ export declare const EngineSessionDetailSchema: z.ZodObject<{
3991
4141
  }[];
3992
4142
  rawMessagesIncluded: boolean;
3993
4143
  nextCursor?: string | undefined;
4144
+ joinedMessages?: string | undefined;
3994
4145
  }, {
3995
4146
  session: {
3996
4147
  ref: {
@@ -4034,6 +4185,7 @@ export declare const EngineSessionDetailSchema: z.ZodObject<{
4034
4185
  }[];
4035
4186
  rawMessagesIncluded: boolean;
4036
4187
  nextCursor?: string | undefined;
4188
+ joinedMessages?: string | undefined;
4037
4189
  }>;
4038
4190
  export declare const EngineSessionSearchHitSchema: z.ZodObject<{
4039
4191
  session: z.ZodObject<{
@@ -5215,6 +5367,27 @@ export declare const HostLaunchRequestSchema: z.ZodObject<{
5215
5367
  }>, "many">;
5216
5368
  nonSensitiveEnv: z.ZodRecord<z.ZodString, z.ZodString>;
5217
5369
  artifactPolicy: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5370
+ /** 当前 turn 上下文预算;参与 fingerprint,fingerprint 后不得修改。 */
5371
+ contextBudget: z.ZodOptional<z.ZodObject<{
5372
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
5373
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
5374
+ /** systemPrompt 的最大字符数。 */
5375
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
5376
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
5377
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
5378
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
5379
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
5380
+ }, "strip", z.ZodTypeAny, {
5381
+ maxInputChars?: number | undefined;
5382
+ maxSystemChars?: number | undefined;
5383
+ maxContextChars?: number | undefined;
5384
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5385
+ }, {
5386
+ maxInputChars?: number | undefined;
5387
+ maxSystemChars?: number | undefined;
5388
+ maxContextChars?: number | undefined;
5389
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5390
+ }>>;
5218
5391
  }, "strip", z.ZodTypeAny, {
5219
5392
  allowedTools: string[];
5220
5393
  input: {
@@ -5273,6 +5446,12 @@ export declare const HostLaunchRequestSchema: z.ZodObject<{
5273
5446
  }[];
5274
5447
  nonSensitiveEnv: Record<string, string>;
5275
5448
  systemPrompt?: string | undefined;
5449
+ contextBudget?: {
5450
+ maxInputChars?: number | undefined;
5451
+ maxSystemChars?: number | undefined;
5452
+ maxContextChars?: number | undefined;
5453
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5454
+ } | undefined;
5276
5455
  workDir?: string | undefined;
5277
5456
  model?: {
5278
5457
  modelId: string;
@@ -5341,6 +5520,12 @@ export declare const HostLaunchRequestSchema: z.ZodObject<{
5341
5520
  }[];
5342
5521
  nonSensitiveEnv: Record<string, string>;
5343
5522
  systemPrompt?: string | undefined;
5523
+ contextBudget?: {
5524
+ maxInputChars?: number | undefined;
5525
+ maxSystemChars?: number | undefined;
5526
+ maxContextChars?: number | undefined;
5527
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5528
+ } | undefined;
5344
5529
  workDir?: string | undefined;
5345
5530
  model?: {
5346
5531
  modelId: string;
@@ -5465,6 +5650,12 @@ export declare const HostLaunchRequestSchema: z.ZodObject<{
5465
5650
  }[];
5466
5651
  nonSensitiveEnv: Record<string, string>;
5467
5652
  systemPrompt?: string | undefined;
5653
+ contextBudget?: {
5654
+ maxInputChars?: number | undefined;
5655
+ maxSystemChars?: number | undefined;
5656
+ maxContextChars?: number | undefined;
5657
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5658
+ } | undefined;
5468
5659
  workDir?: string | undefined;
5469
5660
  model?: {
5470
5661
  modelId: string;
@@ -5551,6 +5742,12 @@ export declare const HostLaunchRequestSchema: z.ZodObject<{
5551
5742
  }[];
5552
5743
  nonSensitiveEnv: Record<string, string>;
5553
5744
  systemPrompt?: string | undefined;
5745
+ contextBudget?: {
5746
+ maxInputChars?: number | undefined;
5747
+ maxSystemChars?: number | undefined;
5748
+ maxContextChars?: number | undefined;
5749
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5750
+ } | undefined;
5554
5751
  workDir?: string | undefined;
5555
5752
  model?: {
5556
5753
  modelId: string;
@@ -5633,6 +5830,22 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
5633
5830
  mcpToken: z.ZodOptional<z.ZodString>;
5634
5831
  sessionId: z.ZodOptional<z.ZodString>;
5635
5832
  resumeSession: z.ZodOptional<z.ZodBoolean>;
5833
+ contextBudget: z.ZodOptional<z.ZodObject<{
5834
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
5835
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
5836
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
5837
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
5838
+ }, "strip", z.ZodTypeAny, {
5839
+ maxInputChars?: number | undefined;
5840
+ maxSystemChars?: number | undefined;
5841
+ maxContextChars?: number | undefined;
5842
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5843
+ }, {
5844
+ maxInputChars?: number | undefined;
5845
+ maxSystemChars?: number | undefined;
5846
+ maxContextChars?: number | undefined;
5847
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
5848
+ }>>;
5636
5849
  } & {
5637
5850
  runKey: z.ZodOptional<z.ZodString>;
5638
5851
  invocationFingerprint: z.ZodOptional<z.ZodString>;
@@ -5882,6 +6095,27 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
5882
6095
  }>, "many">;
5883
6096
  nonSensitiveEnv: z.ZodRecord<z.ZodString, z.ZodString>;
5884
6097
  artifactPolicy: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6098
+ /** 当前 turn 上下文预算;参与 fingerprint,fingerprint 后不得修改。 */
6099
+ contextBudget: z.ZodOptional<z.ZodObject<{
6100
+ /** 当前 turn 输入文本的最大字符数(不含 systemPrompt)。 */
6101
+ maxInputChars: z.ZodOptional<z.ZodNumber>;
6102
+ /** systemPrompt 的最大字符数。 */
6103
+ maxSystemChars: z.ZodOptional<z.ZodNumber>;
6104
+ /** input + systemPrompt 的总字符数上限;优先压缩 input,必要时再压缩 systemPrompt。 */
6105
+ maxContextChars: z.ZodOptional<z.ZodNumber>;
6106
+ /** 压缩/截断模式;缺省由 adapter 按 'truncate_head' 处理(body-first)。 */
6107
+ compression: z.ZodOptional<z.ZodEnum<["none", "truncate_head", "truncate_tail"]>>;
6108
+ }, "strip", z.ZodTypeAny, {
6109
+ maxInputChars?: number | undefined;
6110
+ maxSystemChars?: number | undefined;
6111
+ maxContextChars?: number | undefined;
6112
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6113
+ }, {
6114
+ maxInputChars?: number | undefined;
6115
+ maxSystemChars?: number | undefined;
6116
+ maxContextChars?: number | undefined;
6117
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6118
+ }>>;
5885
6119
  }, "strip", z.ZodTypeAny, {
5886
6120
  allowedTools: string[];
5887
6121
  input: {
@@ -5940,6 +6174,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
5940
6174
  }[];
5941
6175
  nonSensitiveEnv: Record<string, string>;
5942
6176
  systemPrompt?: string | undefined;
6177
+ contextBudget?: {
6178
+ maxInputChars?: number | undefined;
6179
+ maxSystemChars?: number | undefined;
6180
+ maxContextChars?: number | undefined;
6181
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6182
+ } | undefined;
5943
6183
  workDir?: string | undefined;
5944
6184
  model?: {
5945
6185
  modelId: string;
@@ -6008,6 +6248,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
6008
6248
  }[];
6009
6249
  nonSensitiveEnv: Record<string, string>;
6010
6250
  systemPrompt?: string | undefined;
6251
+ contextBudget?: {
6252
+ maxInputChars?: number | undefined;
6253
+ maxSystemChars?: number | undefined;
6254
+ maxContextChars?: number | undefined;
6255
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6256
+ } | undefined;
6011
6257
  workDir?: string | undefined;
6012
6258
  model?: {
6013
6259
  modelId: string;
@@ -6052,6 +6298,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
6052
6298
  mcpToken?: string | undefined;
6053
6299
  sessionId?: string | undefined;
6054
6300
  resumeSession?: boolean | undefined;
6301
+ contextBudget?: {
6302
+ maxInputChars?: number | undefined;
6303
+ maxSystemChars?: number | undefined;
6304
+ maxContextChars?: number | undefined;
6305
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6306
+ } | undefined;
6055
6307
  runKey?: string | undefined;
6056
6308
  invocationFingerprint?: string | undefined;
6057
6309
  launchSpec?: {
@@ -6112,6 +6364,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
6112
6364
  }[];
6113
6365
  nonSensitiveEnv: Record<string, string>;
6114
6366
  systemPrompt?: string | undefined;
6367
+ contextBudget?: {
6368
+ maxInputChars?: number | undefined;
6369
+ maxSystemChars?: number | undefined;
6370
+ maxContextChars?: number | undefined;
6371
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6372
+ } | undefined;
6115
6373
  workDir?: string | undefined;
6116
6374
  model?: {
6117
6375
  modelId: string;
@@ -6149,6 +6407,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
6149
6407
  mcpToken?: string | undefined;
6150
6408
  sessionId?: string | undefined;
6151
6409
  resumeSession?: boolean | undefined;
6410
+ contextBudget?: {
6411
+ maxInputChars?: number | undefined;
6412
+ maxSystemChars?: number | undefined;
6413
+ maxContextChars?: number | undefined;
6414
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6415
+ } | undefined;
6152
6416
  runKey?: string | undefined;
6153
6417
  invocationFingerprint?: string | undefined;
6154
6418
  launchSpec?: {
@@ -6209,6 +6473,12 @@ export declare const TaskAssignParamsV2Schema: z.ZodObject<{
6209
6473
  }[];
6210
6474
  nonSensitiveEnv: Record<string, string>;
6211
6475
  systemPrompt?: string | undefined;
6476
+ contextBudget?: {
6477
+ maxInputChars?: number | undefined;
6478
+ maxSystemChars?: number | undefined;
6479
+ maxContextChars?: number | undefined;
6480
+ compression?: "none" | "truncate_head" | "truncate_tail" | undefined;
6481
+ } | undefined;
6212
6482
  workDir?: string | undefined;
6213
6483
  model?: {
6214
6484
  modelId: string;
@@ -6724,6 +6994,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
6724
6994
  hostProfile: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["coding", "sre"]>, z.ZodString]>>;
6725
6995
  } & {
6726
6996
  type: z.ZodLiteral<"tool_call">;
6997
+ callId: z.ZodOptional<z.ZodString>;
6727
6998
  name: z.ZodString;
6728
6999
  input: z.ZodOptional<z.ZodUnknown>;
6729
7000
  }, "strip", z.ZodTypeAny, {
@@ -6733,6 +7004,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
6733
7004
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
6734
7005
  hostKind?: "workstation" | "external_computer" | undefined;
6735
7006
  hostProfile?: string | undefined;
7007
+ callId?: string | undefined;
6736
7008
  }, {
6737
7009
  type: "tool_call";
6738
7010
  name: string;
@@ -6740,12 +7012,14 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
6740
7012
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
6741
7013
  hostKind?: "workstation" | "external_computer" | undefined;
6742
7014
  hostProfile?: string | undefined;
7015
+ callId?: string | undefined;
6743
7016
  }>, z.ZodObject<{
6744
7017
  engineId: z.ZodOptional<z.ZodEnum<["claude-code", "codex", "hermes", "openclaw", "custom"]>>;
6745
7018
  hostKind: z.ZodOptional<z.ZodEnum<["workstation", "external_computer"]>>;
6746
7019
  hostProfile: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["coding", "sre"]>, z.ZodString]>>;
6747
7020
  } & {
6748
7021
  type: z.ZodLiteral<"tool_result_delta">;
7022
+ callId: z.ZodOptional<z.ZodString>;
6749
7023
  name: z.ZodOptional<z.ZodString>;
6750
7024
  text: z.ZodString;
6751
7025
  }, "strip", z.ZodTypeAny, {
@@ -6755,6 +7029,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
6755
7029
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
6756
7030
  hostKind?: "workstation" | "external_computer" | undefined;
6757
7031
  hostProfile?: string | undefined;
7032
+ callId?: string | undefined;
6758
7033
  }, {
6759
7034
  type: "tool_result_delta";
6760
7035
  text: string;
@@ -6762,6 +7037,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
6762
7037
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
6763
7038
  hostKind?: "workstation" | "external_computer" | undefined;
6764
7039
  hostProfile?: string | undefined;
7040
+ callId?: string | undefined;
6765
7041
  }>, z.ZodObject<{
6766
7042
  engineId: z.ZodOptional<z.ZodEnum<["claude-code", "codex", "hermes", "openclaw", "custom"]>>;
6767
7043
  hostKind: z.ZodOptional<z.ZodEnum<["workstation", "external_computer"]>>;
@@ -7090,6 +7366,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
7090
7366
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
7091
7367
  hostKind?: "workstation" | "external_computer" | undefined;
7092
7368
  hostProfile?: string | undefined;
7369
+ callId?: string | undefined;
7093
7370
  } | {
7094
7371
  type: "tool_result_delta";
7095
7372
  text: string;
@@ -7097,6 +7374,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
7097
7374
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
7098
7375
  hostKind?: "workstation" | "external_computer" | undefined;
7099
7376
  hostProfile?: string | undefined;
7377
+ callId?: string | undefined;
7100
7378
  } | {
7101
7379
  type: "stderr_delta";
7102
7380
  text: string;
@@ -7205,6 +7483,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
7205
7483
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
7206
7484
  hostKind?: "workstation" | "external_computer" | undefined;
7207
7485
  hostProfile?: string | undefined;
7486
+ callId?: string | undefined;
7208
7487
  } | {
7209
7488
  type: "tool_result_delta";
7210
7489
  text: string;
@@ -7212,6 +7491,7 @@ export declare const TaskEventPayloadSchema: z.ZodObject<{
7212
7491
  engineId?: "custom" | "claude-code" | "codex" | "hermes" | "openclaw" | undefined;
7213
7492
  hostKind?: "workstation" | "external_computer" | undefined;
7214
7493
  hostProfile?: string | undefined;
7494
+ callId?: string | undefined;
7215
7495
  } | {
7216
7496
  type: "stderr_delta";
7217
7497
  text: string;