@linnlabs/linnkit 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cli.cjs +1 -6
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +1 -6
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +2 -7
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +2 -7
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/agentSpec.d.cts +7 -7
  11. package/dist/contracts/agentSpec.d.ts +7 -7
  12. package/dist/contracts/contextPolicy.d.cts +9 -9
  13. package/dist/contracts/contextPolicy.d.ts +9 -9
  14. package/dist/contracts/messages.d.cts +10 -10
  15. package/dist/contracts/messages.d.ts +10 -10
  16. package/dist/contracts.cjs +1 -6
  17. package/dist/contracts.cjs.map +1 -1
  18. package/dist/contracts.js +1 -6
  19. package/dist/contracts.js.map +1 -1
  20. package/dist/index.cjs +1 -6
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.js +1 -6
  23. package/dist/index.js.map +1 -1
  24. package/dist/quickstart.cjs +1 -6
  25. package/dist/quickstart.cjs.map +1 -1
  26. package/dist/quickstart.js +1 -6
  27. package/dist/quickstart.js.map +1 -1
  28. package/dist/runtime-kernel/events.cjs +1 -6
  29. package/dist/runtime-kernel/events.cjs.map +1 -1
  30. package/dist/runtime-kernel/events.js +1 -6
  31. package/dist/runtime-kernel/events.js.map +1 -1
  32. package/dist/runtime-kernel.cjs +1 -6
  33. package/dist/runtime-kernel.cjs.map +1 -1
  34. package/dist/runtime-kernel.js +1 -6
  35. package/dist/runtime-kernel.js.map +1 -1
  36. package/dist/testkit.cjs +1 -6
  37. package/dist/testkit.cjs.map +1 -1
  38. package/dist/testkit.js +1 -6
  39. package/dist/testkit.js.map +1 -1
  40. package/docs/integration/constraints-and-pitfalls.md +4 -4
  41. package/docs/integration/context-engineering.md +1 -1
  42. package/docs/integration/context-fences.md +12 -2
  43. package/package.json +2 -2
@@ -160,7 +160,7 @@ declare const AgentSpec: z.ZodObject<{
160
160
  maxCompactionsPerRun?: number | undefined;
161
161
  }>>;
162
162
  mustKeep: z.ZodOptional<z.ZodObject<{
163
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
163
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
164
164
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
165
165
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
166
  fenceKind: z.ZodString;
@@ -176,7 +176,7 @@ declare const AgentSpec: z.ZodObject<{
176
176
  strategyName: string;
177
177
  }>, "many">>;
178
178
  }, "strip", z.ZodTypeAny, {
179
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
179
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
180
180
  alwaysKeepFenceKinds?: string[] | undefined;
181
181
  truncationRules?: {
182
182
  fenceKind: string;
@@ -184,7 +184,7 @@ declare const AgentSpec: z.ZodObject<{
184
184
  strategyName: string;
185
185
  }[] | undefined;
186
186
  }, {
187
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
187
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
188
188
  alwaysKeepFenceKinds?: string[] | undefined;
189
189
  truncationRules?: {
190
190
  fenceKind: string;
@@ -484,7 +484,7 @@ declare const AgentSpec: z.ZodObject<{
484
484
  maxCompactionsPerRun?: number | undefined;
485
485
  } | undefined;
486
486
  mustKeep?: {
487
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
487
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
488
488
  alwaysKeepFenceKinds?: string[] | undefined;
489
489
  truncationRules?: {
490
490
  fenceKind: string;
@@ -574,7 +574,7 @@ declare const AgentSpec: z.ZodObject<{
574
574
  maxCompactionsPerRun?: number | undefined;
575
575
  } | undefined;
576
576
  mustKeep?: {
577
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
577
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
578
578
  alwaysKeepFenceKinds?: string[] | undefined;
579
579
  truncationRules?: {
580
580
  fenceKind: string;
@@ -687,7 +687,7 @@ declare const AgentSpec: z.ZodObject<{
687
687
  maxCompactionsPerRun?: number | undefined;
688
688
  } | undefined;
689
689
  mustKeep?: {
690
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
690
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
691
691
  alwaysKeepFenceKinds?: string[] | undefined;
692
692
  truncationRules?: {
693
693
  fenceKind: string;
@@ -796,7 +796,7 @@ declare const AgentSpec: z.ZodObject<{
796
796
  maxCompactionsPerRun?: number | undefined;
797
797
  } | undefined;
798
798
  mustKeep?: {
799
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
799
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
800
800
  alwaysKeepFenceKinds?: string[] | undefined;
801
801
  truncationRules?: {
802
802
  fenceKind: string;
@@ -160,7 +160,7 @@ declare const AgentSpec: z.ZodObject<{
160
160
  maxCompactionsPerRun?: number | undefined;
161
161
  }>>;
162
162
  mustKeep: z.ZodOptional<z.ZodObject<{
163
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
163
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
164
164
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
165
165
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
166
  fenceKind: z.ZodString;
@@ -176,7 +176,7 @@ declare const AgentSpec: z.ZodObject<{
176
176
  strategyName: string;
177
177
  }>, "many">>;
178
178
  }, "strip", z.ZodTypeAny, {
179
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
179
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
180
180
  alwaysKeepFenceKinds?: string[] | undefined;
181
181
  truncationRules?: {
182
182
  fenceKind: string;
@@ -184,7 +184,7 @@ declare const AgentSpec: z.ZodObject<{
184
184
  strategyName: string;
185
185
  }[] | undefined;
186
186
  }, {
187
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
187
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
188
188
  alwaysKeepFenceKinds?: string[] | undefined;
189
189
  truncationRules?: {
190
190
  fenceKind: string;
@@ -484,7 +484,7 @@ declare const AgentSpec: z.ZodObject<{
484
484
  maxCompactionsPerRun?: number | undefined;
485
485
  } | undefined;
486
486
  mustKeep?: {
487
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
487
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
488
488
  alwaysKeepFenceKinds?: string[] | undefined;
489
489
  truncationRules?: {
490
490
  fenceKind: string;
@@ -574,7 +574,7 @@ declare const AgentSpec: z.ZodObject<{
574
574
  maxCompactionsPerRun?: number | undefined;
575
575
  } | undefined;
576
576
  mustKeep?: {
577
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
577
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
578
578
  alwaysKeepFenceKinds?: string[] | undefined;
579
579
  truncationRules?: {
580
580
  fenceKind: string;
@@ -687,7 +687,7 @@ declare const AgentSpec: z.ZodObject<{
687
687
  maxCompactionsPerRun?: number | undefined;
688
688
  } | undefined;
689
689
  mustKeep?: {
690
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
690
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
691
691
  alwaysKeepFenceKinds?: string[] | undefined;
692
692
  truncationRules?: {
693
693
  fenceKind: string;
@@ -796,7 +796,7 @@ declare const AgentSpec: z.ZodObject<{
796
796
  maxCompactionsPerRun?: number | undefined;
797
797
  } | undefined;
798
798
  mustKeep?: {
799
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
799
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
800
800
  alwaysKeepFenceKinds?: string[] | undefined;
801
801
  truncationRules?: {
802
802
  fenceKind: string;
@@ -1,7 +1,7 @@
1
1
  import { SerializableJsonValue } from './json.cjs';
2
2
  import { z } from 'zod';
3
3
 
4
- declare const AgentSpecMessageType: z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>;
4
+ declare const AgentSpecMessageType: z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>;
5
5
  type AgentSpecMessageType = z.infer<typeof AgentSpecMessageType>;
6
6
  declare const AgentSpecBudgetPolicy: z.ZodObject<{
7
7
  maxTokens: z.ZodOptional<z.ZodNumber>;
@@ -135,7 +135,7 @@ declare const AgentSpecMustKeepTruncationRule: z.ZodObject<{
135
135
  }>;
136
136
  type AgentSpecMustKeepTruncationRule = z.infer<typeof AgentSpecMustKeepTruncationRule>;
137
137
  declare const AgentSpecMustKeepPolicy: z.ZodObject<{
138
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
138
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
139
139
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
140
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
141
141
  fenceKind: z.ZodString;
@@ -151,7 +151,7 @@ declare const AgentSpecMustKeepPolicy: z.ZodObject<{
151
151
  strategyName: string;
152
152
  }>, "many">>;
153
153
  }, "strip", z.ZodTypeAny, {
154
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
154
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
155
155
  alwaysKeepFenceKinds?: string[] | undefined;
156
156
  truncationRules?: {
157
157
  fenceKind: string;
@@ -159,7 +159,7 @@ declare const AgentSpecMustKeepPolicy: z.ZodObject<{
159
159
  strategyName: string;
160
160
  }[] | undefined;
161
161
  }, {
162
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
162
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
163
163
  alwaysKeepFenceKinds?: string[] | undefined;
164
164
  truncationRules?: {
165
165
  fenceKind: string;
@@ -628,7 +628,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
628
628
  maxCompactionsPerRun?: number | undefined;
629
629
  }>>;
630
630
  mustKeep: z.ZodOptional<z.ZodObject<{
631
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
631
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
632
632
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
633
633
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
634
634
  fenceKind: z.ZodString;
@@ -644,7 +644,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
644
644
  strategyName: string;
645
645
  }>, "many">>;
646
646
  }, "strip", z.ZodTypeAny, {
647
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
647
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
648
648
  alwaysKeepFenceKinds?: string[] | undefined;
649
649
  truncationRules?: {
650
650
  fenceKind: string;
@@ -652,7 +652,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
652
652
  strategyName: string;
653
653
  }[] | undefined;
654
654
  }, {
655
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
655
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
656
656
  alwaysKeepFenceKinds?: string[] | undefined;
657
657
  truncationRules?: {
658
658
  fenceKind: string;
@@ -954,7 +954,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
954
954
  maxCompactionsPerRun?: number | undefined;
955
955
  } | undefined;
956
956
  mustKeep?: {
957
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
957
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
958
958
  alwaysKeepFenceKinds?: string[] | undefined;
959
959
  truncationRules?: {
960
960
  fenceKind: string;
@@ -1044,7 +1044,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
1044
1044
  maxCompactionsPerRun?: number | undefined;
1045
1045
  } | undefined;
1046
1046
  mustKeep?: {
1047
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
1047
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
1048
1048
  alwaysKeepFenceKinds?: string[] | undefined;
1049
1049
  truncationRules?: {
1050
1050
  fenceKind: string;
@@ -1,7 +1,7 @@
1
1
  import { SerializableJsonValue } from './json.js';
2
2
  import { z } from 'zod';
3
3
 
4
- declare const AgentSpecMessageType: z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>;
4
+ declare const AgentSpecMessageType: z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>;
5
5
  type AgentSpecMessageType = z.infer<typeof AgentSpecMessageType>;
6
6
  declare const AgentSpecBudgetPolicy: z.ZodObject<{
7
7
  maxTokens: z.ZodOptional<z.ZodNumber>;
@@ -135,7 +135,7 @@ declare const AgentSpecMustKeepTruncationRule: z.ZodObject<{
135
135
  }>;
136
136
  type AgentSpecMustKeepTruncationRule = z.infer<typeof AgentSpecMustKeepTruncationRule>;
137
137
  declare const AgentSpecMustKeepPolicy: z.ZodObject<{
138
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
138
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
139
139
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
140
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
141
141
  fenceKind: z.ZodString;
@@ -151,7 +151,7 @@ declare const AgentSpecMustKeepPolicy: z.ZodObject<{
151
151
  strategyName: string;
152
152
  }>, "many">>;
153
153
  }, "strip", z.ZodTypeAny, {
154
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
154
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
155
155
  alwaysKeepFenceKinds?: string[] | undefined;
156
156
  truncationRules?: {
157
157
  fenceKind: string;
@@ -159,7 +159,7 @@ declare const AgentSpecMustKeepPolicy: z.ZodObject<{
159
159
  strategyName: string;
160
160
  }[] | undefined;
161
161
  }, {
162
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
162
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
163
163
  alwaysKeepFenceKinds?: string[] | undefined;
164
164
  truncationRules?: {
165
165
  fenceKind: string;
@@ -628,7 +628,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
628
628
  maxCompactionsPerRun?: number | undefined;
629
629
  }>>;
630
630
  mustKeep: z.ZodOptional<z.ZodObject<{
631
- alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "context_before", "context_after", "document_fragment", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
631
+ alwaysKeepTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["system_prompt", "history_summary", "context_injection", "user_input", "task_request", "final_answer", "tool_code", "tool_calls", "task_completion", "tool_output"]>, "many">>;
632
632
  alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
633
633
  truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
634
634
  fenceKind: z.ZodString;
@@ -644,7 +644,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
644
644
  strategyName: string;
645
645
  }>, "many">>;
646
646
  }, "strip", z.ZodTypeAny, {
647
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
647
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
648
648
  alwaysKeepFenceKinds?: string[] | undefined;
649
649
  truncationRules?: {
650
650
  fenceKind: string;
@@ -652,7 +652,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
652
652
  strategyName: string;
653
653
  }[] | undefined;
654
654
  }, {
655
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
655
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
656
656
  alwaysKeepFenceKinds?: string[] | undefined;
657
657
  truncationRules?: {
658
658
  fenceKind: string;
@@ -954,7 +954,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
954
954
  maxCompactionsPerRun?: number | undefined;
955
955
  } | undefined;
956
956
  mustKeep?: {
957
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
957
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
958
958
  alwaysKeepFenceKinds?: string[] | undefined;
959
959
  truncationRules?: {
960
960
  fenceKind: string;
@@ -1044,7 +1044,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
1044
1044
  maxCompactionsPerRun?: number | undefined;
1045
1045
  } | undefined;
1046
1046
  mustKeep?: {
1047
- alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request" | "tool_code" | "task_completion")[] | undefined;
1047
+ alwaysKeepTypes?: ("user_input" | "tool_calls" | "tool_output" | "final_answer" | "history_summary" | "system_prompt" | "context_injection" | "task_request" | "tool_code" | "task_completion")[] | undefined;
1048
1048
  alwaysKeepFenceKinds?: string[] | undefined;
1049
1049
  truncationRules?: {
1050
1050
  fenceKind: string;
@@ -6622,9 +6622,9 @@ declare const UserMessage: z.ZodUnion<[z.ZodObject<{
6622
6622
  }, z.ZodTypeAny, "passthrough">>>;
6623
6623
  } & {
6624
6624
  role: z.ZodLiteral<"user">;
6625
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
6625
+ type: z.ZodEnum<["context_injection", "task_request"]>;
6626
6626
  }, "strip", z.ZodTypeAny, {
6627
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
6627
+ type: "context_injection" | "task_request";
6628
6628
  id: string;
6629
6629
  timestamp: number;
6630
6630
  content: string;
@@ -7001,7 +7001,7 @@ declare const UserMessage: z.ZodUnion<[z.ZodObject<{
7001
7001
  fencePlacement: z.ZodOptional<z.ZodString>;
7002
7002
  }, z.ZodTypeAny, "passthrough"> | undefined;
7003
7003
  }, {
7004
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
7004
+ type: "context_injection" | "task_request";
7005
7005
  id: string;
7006
7006
  timestamp: number;
7007
7007
  content: string;
@@ -16104,9 +16104,9 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
16104
16104
  }, z.ZodTypeAny, "passthrough">>>;
16105
16105
  } & {
16106
16106
  role: z.ZodLiteral<"user">;
16107
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
16107
+ type: z.ZodEnum<["context_injection", "task_request"]>;
16108
16108
  }, "strip", z.ZodTypeAny, {
16109
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
16109
+ type: "context_injection" | "task_request";
16110
16110
  id: string;
16111
16111
  timestamp: number;
16112
16112
  content: string;
@@ -16483,7 +16483,7 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
16483
16483
  fencePlacement: z.ZodOptional<z.ZodString>;
16484
16484
  }, z.ZodTypeAny, "passthrough"> | undefined;
16485
16485
  }, {
16486
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
16486
+ type: "context_injection" | "task_request";
16487
16487
  id: string;
16488
16488
  timestamp: number;
16489
16489
  content: string;
@@ -21428,7 +21428,7 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
21428
21428
  label?: string | undefined;
21429
21429
  }[] | undefined;
21430
21430
  } | {
21431
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
21431
+ type: "context_injection" | "task_request";
21432
21432
  id: string;
21433
21433
  timestamp: number;
21434
21434
  content: string;
@@ -25625,9 +25625,9 @@ declare const UserContextMessage: z.ZodObject<{
25625
25625
  }, z.ZodTypeAny, "passthrough">>>;
25626
25626
  } & {
25627
25627
  role: z.ZodLiteral<"user">;
25628
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
25628
+ type: z.ZodEnum<["context_injection", "task_request"]>;
25629
25629
  }, "strip", z.ZodTypeAny, {
25630
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
25630
+ type: "context_injection" | "task_request";
25631
25631
  id: string;
25632
25632
  timestamp: number;
25633
25633
  content: string;
@@ -26004,7 +26004,7 @@ declare const UserContextMessage: z.ZodObject<{
26004
26004
  fencePlacement: z.ZodOptional<z.ZodString>;
26005
26005
  }, z.ZodTypeAny, "passthrough"> | undefined;
26006
26006
  }, {
26007
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
26007
+ type: "context_injection" | "task_request";
26008
26008
  id: string;
26009
26009
  timestamp: number;
26010
26010
  content: string;
@@ -6622,9 +6622,9 @@ declare const UserMessage: z.ZodUnion<[z.ZodObject<{
6622
6622
  }, z.ZodTypeAny, "passthrough">>>;
6623
6623
  } & {
6624
6624
  role: z.ZodLiteral<"user">;
6625
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
6625
+ type: z.ZodEnum<["context_injection", "task_request"]>;
6626
6626
  }, "strip", z.ZodTypeAny, {
6627
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
6627
+ type: "context_injection" | "task_request";
6628
6628
  id: string;
6629
6629
  timestamp: number;
6630
6630
  content: string;
@@ -7001,7 +7001,7 @@ declare const UserMessage: z.ZodUnion<[z.ZodObject<{
7001
7001
  fencePlacement: z.ZodOptional<z.ZodString>;
7002
7002
  }, z.ZodTypeAny, "passthrough"> | undefined;
7003
7003
  }, {
7004
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
7004
+ type: "context_injection" | "task_request";
7005
7005
  id: string;
7006
7006
  timestamp: number;
7007
7007
  content: string;
@@ -16104,9 +16104,9 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
16104
16104
  }, z.ZodTypeAny, "passthrough">>>;
16105
16105
  } & {
16106
16106
  role: z.ZodLiteral<"user">;
16107
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
16107
+ type: z.ZodEnum<["context_injection", "task_request"]>;
16108
16108
  }, "strip", z.ZodTypeAny, {
16109
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
16109
+ type: "context_injection" | "task_request";
16110
16110
  id: string;
16111
16111
  timestamp: number;
16112
16112
  content: string;
@@ -16483,7 +16483,7 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
16483
16483
  fencePlacement: z.ZodOptional<z.ZodString>;
16484
16484
  }, z.ZodTypeAny, "passthrough"> | undefined;
16485
16485
  }, {
16486
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
16486
+ type: "context_injection" | "task_request";
16487
16487
  id: string;
16488
16488
  timestamp: number;
16489
16489
  content: string;
@@ -21428,7 +21428,7 @@ declare const AiMessage: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown, u
21428
21428
  label?: string | undefined;
21429
21429
  }[] | undefined;
21430
21430
  } | {
21431
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
21431
+ type: "context_injection" | "task_request";
21432
21432
  id: string;
21433
21433
  timestamp: number;
21434
21434
  content: string;
@@ -25625,9 +25625,9 @@ declare const UserContextMessage: z.ZodObject<{
25625
25625
  }, z.ZodTypeAny, "passthrough">>>;
25626
25626
  } & {
25627
25627
  role: z.ZodLiteral<"user">;
25628
- type: z.ZodEnum<["context_injection", "context_before", "context_after", "document_fragment", "task_request"]>;
25628
+ type: z.ZodEnum<["context_injection", "task_request"]>;
25629
25629
  }, "strip", z.ZodTypeAny, {
25630
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
25630
+ type: "context_injection" | "task_request";
25631
25631
  id: string;
25632
25632
  timestamp: number;
25633
25633
  content: string;
@@ -26004,7 +26004,7 @@ declare const UserContextMessage: z.ZodObject<{
26004
26004
  fencePlacement: z.ZodOptional<z.ZodString>;
26005
26005
  }, z.ZodTypeAny, "passthrough"> | undefined;
26006
26006
  }, {
26007
- type: "context_injection" | "context_before" | "context_after" | "document_fragment" | "task_request";
26007
+ type: "context_injection" | "task_request";
26008
26008
  id: string;
26009
26009
  timestamp: number;
26010
26010
  content: string;
@@ -314,11 +314,9 @@ var UserInputMessage = BaseMessage.extend({
314
314
  });
315
315
  var UserContextMessage = BaseMessage.extend({
316
316
  role: zod.z.literal("user"),
317
+ // 产品上下文种类由 Host fence metadata 表达,不进入框架消息枚举。
317
318
  type: zod.z.enum([
318
319
  "context_injection",
319
- "context_before",
320
- "context_after",
321
- "document_fragment",
322
320
  "task_request"
323
321
  ])
324
322
  });
@@ -474,9 +472,6 @@ var AgentSpecMessageType = zod.z.enum([
474
472
  "history_summary",
475
473
  "context_injection",
476
474
  "user_input",
477
- "context_before",
478
- "context_after",
479
- "document_fragment",
480
475
  "task_request",
481
476
  "final_answer",
482
477
  "tool_code",