@linnlabs/linnkit 0.8.0 → 0.10.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 (83) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/README.zh-CN.md +1 -1
  4. package/bin/linnkit.cjs +7 -0
  5. package/dist/{agentSpec-EkmviZjy.d.cts → agentSpec-Du4Iye0q.d.cts} +16 -1
  6. package/dist/{agentSpec-EkmviZjy.d.ts → agentSpec-Du4Iye0q.d.ts} +16 -1
  7. package/dist/cli.cjs +234 -91
  8. package/dist/cli.cjs.map +1 -1
  9. package/dist/cli.js +234 -91
  10. package/dist/cli.js.map +1 -1
  11. package/dist/context-manager.cjs +230 -32
  12. package/dist/context-manager.cjs.map +1 -1
  13. package/dist/context-manager.d.cts +52 -15
  14. package/dist/context-manager.d.ts +52 -15
  15. package/dist/context-manager.js +230 -33
  16. package/dist/context-manager.js.map +1 -1
  17. package/dist/{context-trace-HE2qY5Q-.d.cts → context-trace-BHKDS-eq.d.cts} +2 -2
  18. package/dist/{context-trace-DRi5M4lX.d.ts → context-trace-CHbqHmyE.d.ts} +2 -2
  19. package/dist/contracts.cjs +3 -1
  20. package/dist/contracts.cjs.map +1 -1
  21. package/dist/contracts.d.cts +3 -3
  22. package/dist/contracts.d.ts +3 -3
  23. package/dist/contracts.js +3 -1
  24. package/dist/contracts.js.map +1 -1
  25. package/dist/{defaultGraphExecutor-BBswR8wn.d.ts → defaultGraphExecutor-B29_qTHy.d.ts} +16 -15
  26. package/dist/{defaultGraphExecutor-BIjJj7WF.d.cts → defaultGraphExecutor-C2E59v_R.d.cts} +16 -15
  27. package/dist/{index-Cm-JbzTH.d.cts → index-BAaUP9yU.d.cts} +38 -15
  28. package/dist/{index-DRBWi1fy.d.ts → index-BaVpVNi2.d.ts} +38 -15
  29. package/dist/{index-DO4dQgf2.d.cts → index-BnYCS8Zg.d.cts} +2 -2
  30. package/dist/{index-CJeWHopy.d.ts → index-C0DAjsdX.d.ts} +2 -2
  31. package/dist/{index-Dl5PLgAv.d.cts → index-CKQzzZ5Y.d.cts} +2 -2
  32. package/dist/{index-CHqwkvGp.d.ts → index-D0mKxTR5.d.ts} +2 -2
  33. package/dist/index.cjs +327 -110
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +10 -10
  36. package/dist/index.d.ts +10 -10
  37. package/dist/index.js +327 -110
  38. package/dist/index.js.map +1 -1
  39. package/dist/{ports-DnLuKfpE.d.ts → ports-DpPTFhSd.d.ts} +2 -2
  40. package/dist/{ports-DaatKJXp.d.cts → ports-s-tSp3sB.d.cts} +2 -2
  41. package/dist/quickstart.cjs +232 -88
  42. package/dist/quickstart.cjs.map +1 -1
  43. package/dist/quickstart.d.cts +7 -7
  44. package/dist/quickstart.d.ts +7 -7
  45. package/dist/quickstart.js +232 -88
  46. package/dist/quickstart.js.map +1 -1
  47. package/dist/{runAgent-CPj_9e58.d.ts → runAgent-C6F-399C.d.ts} +5 -5
  48. package/dist/{runAgent-HYKlXbVr.d.cts → runAgent-ilEj66Ik.d.cts} +5 -5
  49. package/dist/{runHandle-D3gPsD7B.d.cts → runHandle-BNOqS-Bl.d.cts} +3 -3
  50. package/dist/{runHandle-CyXvzgzk.d.ts → runHandle-BdLXOFqF.d.ts} +3 -3
  51. package/dist/runtime-kernel/events.cjs +1 -0
  52. package/dist/runtime-kernel/events.cjs.map +1 -1
  53. package/dist/runtime-kernel/events.d.cts +4 -4
  54. package/dist/runtime-kernel/events.d.ts +4 -4
  55. package/dist/runtime-kernel/events.js +1 -0
  56. package/dist/runtime-kernel/events.js.map +1 -1
  57. package/dist/runtime-kernel.cjs +318 -103
  58. package/dist/runtime-kernel.cjs.map +1 -1
  59. package/dist/runtime-kernel.d.cts +8 -8
  60. package/dist/runtime-kernel.d.ts +8 -8
  61. package/dist/runtime-kernel.js +315 -104
  62. package/dist/runtime-kernel.js.map +1 -1
  63. package/dist/testkit.cjs +331 -116
  64. package/dist/testkit.cjs.map +1 -1
  65. package/dist/testkit.d.cts +8 -8
  66. package/dist/testkit.d.ts +8 -8
  67. package/dist/testkit.js +331 -116
  68. package/dist/testkit.js.map +1 -1
  69. package/dist/{todo-B1PmDlp3.d.cts → todo-Ca8llpRQ.d.cts} +1 -1
  70. package/dist/{todo-B1PmDlp3.d.ts → todo-Ca8llpRQ.d.ts} +1 -1
  71. package/dist/{toolContracts-CLkQmhTG.d.cts → toolContracts-Bm3EZ1UM.d.cts} +13 -2
  72. package/dist/{toolContracts-Blll0241.d.ts → toolContracts-f8lzZBNa.d.ts} +13 -2
  73. package/docs/integration/README.md +1 -1
  74. package/docs/integration/agent-registration-guide.md +1 -1
  75. package/docs/integration/child-runs.md +4 -1
  76. package/docs/integration/context-engineering.md +30 -15
  77. package/docs/integration/context-fences.md +32 -3
  78. package/docs/integration/llm-provider.md +1 -1
  79. package/docs/integration/persistence.md +1 -0
  80. package/docs/integration/run-supervisor.md +3 -0
  81. package/docs/integration/tool-development-guide.md +7 -5
  82. package/docs/integration/tool-history.md +43 -17
  83. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -14,6 +14,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.10.0] - 2026-06-15
18
+
19
+ ### Changed
20
+
21
+ - `GraphExecutor` / `Checkpointer` now name engine-state snapshot keys as `checkpointKey`, and graph telemetry reads the runtime `conversationId` from graph local state instead of treating the checkpoint key as a host conversation.
22
+ - Synchronous child runs can now receive an explicit host `conversationId` while still using an internal checkpoint key for GraphExecutor state isolation. This keeps RuntimeEvent / Audit / Telemetry scope aligned with the child run registered by the host and prevents EventStore-backed audit writes from mixing a child `runId` with an internal conversation key.
23
+ - `copyToolContextRuntimeCapability` is now exported from `@linnlabs/linnkit/runtime-kernel` so child-run tool contexts can preserve the parent tool runtime binding without manually copying reserved fields.
24
+ - Detached runs now execute against the `AgentSpec`, request, and metadata snapshots captured during `spawnDetached()` registration, so later caller-side object mutations cannot change the background run context.
25
+
26
+ ### Compatibility
27
+
28
+ - Minor bump because `Checkpointer` / `CheckpointMeta` host adapter contracts now use `checkpointKey` for graph persistence identity. Host adapters that previously treated the graph checkpoint key as a user conversation id should pass host `conversationId` explicitly and reserve `checkpointKey` for engine snapshots.
29
+
30
+ ---
31
+
32
+ ## [0.9.0] - 2026-05-22
33
+
34
+ ### Added
35
+
36
+ - `appendStreamingProviderReasoningDetails` / `compactProviderReasoningDetails` / `compactReasoningDetailsInValue` in `@linnlabs/linnkit/runtime-kernel` — provider-agnostic helpers for merging adjacent streaming `reasoning_content` fragments.
37
+
38
+ ### Fixed
39
+
40
+ - Streaming `reasoning_details` now merges adjacent pure text reasoning fragments before returning the final LLM result and before emitting provider sidecar updates, preventing audit records from storing token-by-token reasoning fragments.
41
+ - `ToolNode` now drains every pending `assistant.tool_calls` item in the current batch before returning to the LLM, even when an earlier tool call fails. This preserves the protocol invariant that each tool call receives a corresponding tool output and avoids incomplete tool-call groups being dropped by downstream context assembly.
42
+ - Tool protocol fuse handling now waits until the current batch has been fully consumed before throwing, so one repeated protocol error cannot strand later tool calls in the same assistant message.
43
+
44
+ ### Compatibility
45
+
46
+ - Minor bump because `@linnlabs/linnkit/runtime-kernel` has new public exports and ToolNode batch execution behavior is stricter.
47
+
17
48
  ---
18
49
 
19
50
  ## [0.8.0] - 2026-05-13
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # linnkit
2
2
 
3
- **A fine-grained context engineering framework for Agent applications — control every token sent to the model, with clear run lifecycle, audit records, and testable protocol boundaries.**
3
+ **A fine-grained context engineering framework for Agent applications — control every token sent to the model, with clear run lifecycle, audit records, and testable protocol boundaries.** It gives a small, auditable runtime for controlling the messages, tool results, summaries, and policies that shape every LLM call.
4
4
 
5
5
  [中文文档](./README.zh-CN.md) · [Integration Guide](./docs/integration/README.md) · [Changelog](./CHANGELOG.md)
6
6
 
package/README.zh-CN.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # linnkit
2
2
 
3
- **linnkit 是一个可以方便地精细化管理上下文的 Agent 框架,追求控制发给LLM的每一个 token,同时保留清晰的运行生命周期、审计记录和测试边界。**
3
+ **linnkit 是一个可以方便地精细化管理上下文的 Agent 框架,追求控制发给LLM的每一个 token,同时保留清晰的运行生命周期、审计记录和测试边界。** 它提供了一种小巧、可审计的运行时环境,可对消息、工具结果、摘要及策略进行管控,而正是这些要素决定了每一次大语言模型调用的行为。
4
4
 
5
5
  [English](./README.md) · [接入文档](./docs/integration/README.md) · [更新日志](./CHANGELOG.md)
6
6
 
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { runCli } = require('../dist/cli.cjs');
4
+
5
+ void runCli(process.argv.slice(2)).then((exitCode) => {
6
+ process.exitCode = exitCode;
7
+ });
@@ -21,6 +21,7 @@ declare const AgentSpecBudgetPolicy: z.ZodObject<{
21
21
  type AgentSpecBudgetPolicy = z.infer<typeof AgentSpecBudgetPolicy>;
22
22
  declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
23
23
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
24
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
24
25
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
25
26
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
26
27
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -29,6 +30,7 @@ declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
29
30
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
30
31
  }, "strip", z.ZodTypeAny, {
31
32
  strategy?: "per-pair" | "per-run" | "none" | undefined;
33
+ retentionMode?: "drop" | "compress" | undefined;
32
34
  keepLatestToolPairs?: number | undefined;
33
35
  keepLatestRuns?: number | undefined;
34
36
  maxInteractionGroups?: number | undefined;
@@ -37,6 +39,7 @@ declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
37
39
  maxOutputSummaryTokens?: number | undefined;
38
40
  }, {
39
41
  strategy?: "per-pair" | "per-run" | "none" | undefined;
42
+ retentionMode?: "drop" | "compress" | undefined;
40
43
  keepLatestToolPairs?: number | undefined;
41
44
  keepLatestRuns?: number | undefined;
42
45
  maxInteractionGroups?: number | undefined;
@@ -537,6 +540,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
537
540
  }>>;
538
541
  toolHistory: z.ZodOptional<z.ZodObject<{
539
542
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
543
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
540
544
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
541
545
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
542
546
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -545,6 +549,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
545
549
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
546
550
  }, "strip", z.ZodTypeAny, {
547
551
  strategy?: "per-pair" | "per-run" | "none" | undefined;
552
+ retentionMode?: "drop" | "compress" | undefined;
548
553
  keepLatestToolPairs?: number | undefined;
549
554
  keepLatestRuns?: number | undefined;
550
555
  maxInteractionGroups?: number | undefined;
@@ -553,6 +558,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
553
558
  maxOutputSummaryTokens?: number | undefined;
554
559
  }, {
555
560
  strategy?: "per-pair" | "per-run" | "none" | undefined;
561
+ retentionMode?: "drop" | "compress" | undefined;
556
562
  keepLatestToolPairs?: number | undefined;
557
563
  keepLatestRuns?: number | undefined;
558
564
  maxInteractionGroups?: number | undefined;
@@ -906,6 +912,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
906
912
  } | undefined;
907
913
  toolHistory?: {
908
914
  strategy?: "per-pair" | "per-run" | "none" | undefined;
915
+ retentionMode?: "drop" | "compress" | undefined;
909
916
  keepLatestToolPairs?: number | undefined;
910
917
  keepLatestRuns?: number | undefined;
911
918
  maxInteractionGroups?: number | undefined;
@@ -999,6 +1006,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
999
1006
  } | undefined;
1000
1007
  toolHistory?: {
1001
1008
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1009
+ retentionMode?: "drop" | "compress" | undefined;
1002
1010
  keepLatestToolPairs?: number | undefined;
1003
1011
  keepLatestRuns?: number | undefined;
1004
1012
  maxInteractionGroups?: number | undefined;
@@ -1186,6 +1194,7 @@ declare const AgentSpec: z.ZodObject<{
1186
1194
  }>>;
1187
1195
  toolHistory: z.ZodOptional<z.ZodObject<{
1188
1196
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
1197
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
1189
1198
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
1190
1199
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
1191
1200
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -1194,6 +1203,7 @@ declare const AgentSpec: z.ZodObject<{
1194
1203
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
1195
1204
  }, "strip", z.ZodTypeAny, {
1196
1205
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1206
+ retentionMode?: "drop" | "compress" | undefined;
1197
1207
  keepLatestToolPairs?: number | undefined;
1198
1208
  keepLatestRuns?: number | undefined;
1199
1209
  maxInteractionGroups?: number | undefined;
@@ -1202,6 +1212,7 @@ declare const AgentSpec: z.ZodObject<{
1202
1212
  maxOutputSummaryTokens?: number | undefined;
1203
1213
  }, {
1204
1214
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1215
+ retentionMode?: "drop" | "compress" | undefined;
1205
1216
  keepLatestToolPairs?: number | undefined;
1206
1217
  keepLatestRuns?: number | undefined;
1207
1218
  maxInteractionGroups?: number | undefined;
@@ -1987,6 +1998,7 @@ declare const AgentSpec: z.ZodObject<{
1987
1998
  } | undefined;
1988
1999
  toolHistory?: {
1989
2000
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2001
+ retentionMode?: "drop" | "compress" | undefined;
1990
2002
  keepLatestToolPairs?: number | undefined;
1991
2003
  keepLatestRuns?: number | undefined;
1992
2004
  maxInteractionGroups?: number | undefined;
@@ -2128,6 +2140,7 @@ declare const AgentSpec: z.ZodObject<{
2128
2140
  } | undefined;
2129
2141
  toolHistory?: {
2130
2142
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2143
+ retentionMode?: "drop" | "compress" | undefined;
2131
2144
  keepLatestToolPairs?: number | undefined;
2132
2145
  keepLatestRuns?: number | undefined;
2133
2146
  maxInteractionGroups?: number | undefined;
@@ -2305,6 +2318,7 @@ declare const AgentSpec: z.ZodObject<{
2305
2318
  } | undefined;
2306
2319
  toolHistory?: {
2307
2320
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2321
+ retentionMode?: "drop" | "compress" | undefined;
2308
2322
  keepLatestToolPairs?: number | undefined;
2309
2323
  keepLatestRuns?: number | undefined;
2310
2324
  maxInteractionGroups?: number | undefined;
@@ -2470,6 +2484,7 @@ declare const AgentSpec: z.ZodObject<{
2470
2484
  } | undefined;
2471
2485
  toolHistory?: {
2472
2486
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2487
+ retentionMode?: "drop" | "compress" | undefined;
2473
2488
  keepLatestToolPairs?: number | undefined;
2474
2489
  keepLatestRuns?: number | undefined;
2475
2490
  maxInteractionGroups?: number | undefined;
@@ -2618,4 +2633,4 @@ declare const AgentSpec: z.ZodObject<{
2618
2633
  }>;
2619
2634
  type AgentSpec = z.infer<typeof AgentSpec>;
2620
2635
 
2621
- export { AgentCapability as A, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS as S, ToolBindingSpec as T, AgentSpec as a, AgentSpecAuditConfig as b, AgentSpecBudgetPolicy as c, AgentSpecCheckpointPolicy as d, AgentSpecContextPolicy as e, type AgentSpecContextPolicyInput as f, AgentSpecContextTracePolicy as g, AgentSpecMessageType as h, AgentSpecModelHints as i, AgentSpecMustKeepPolicy as j, AgentSpecMustKeepTruncationRule as k, AgentSpecProviderReplayPolicy as l, AgentSpecReasoningRetentionPolicy as m, AgentSpecSummarizationPolicy as n, AgentSpecSystemReminderExtraRule as o, AgentSpecSystemReminderPolicy as p, AgentSpecSystemReminderTrigger as q, AgentSpecTokenEstimationPolicy as r, AgentSpecToolHistoryPolicy as s, AgentSpecToolObservationGovernancePolicy as t, AgentSpecToolOutputPolicy as u, AgentSpecWorkingMemoryPolicy as v, defineContextPolicy as w };
2636
+ export { AgentSpecToolOutputPolicy as A, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS as S, ToolBindingSpec as T, AgentSpecProviderReplayPolicy as a, AgentSpecCheckpointPolicy as b, AgentSpecSummarizationPolicy as c, AgentSpecContextTracePolicy as d, AgentSpecSystemReminderPolicy as e, AgentSpec as f, AgentSpecContextPolicy as g, type AgentSpecContextPolicyInput as h, AgentCapability as i, AgentSpecAuditConfig as j, AgentSpecBudgetPolicy as k, AgentSpecMessageType as l, AgentSpecModelHints as m, AgentSpecMustKeepPolicy as n, AgentSpecMustKeepTruncationRule as o, AgentSpecReasoningRetentionPolicy as p, AgentSpecSystemReminderExtraRule as q, AgentSpecSystemReminderTrigger as r, AgentSpecTokenEstimationPolicy as s, AgentSpecToolHistoryPolicy as t, AgentSpecToolObservationGovernancePolicy as u, AgentSpecWorkingMemoryPolicy as v, defineContextPolicy as w };
@@ -21,6 +21,7 @@ declare const AgentSpecBudgetPolicy: z.ZodObject<{
21
21
  type AgentSpecBudgetPolicy = z.infer<typeof AgentSpecBudgetPolicy>;
22
22
  declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
23
23
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
24
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
24
25
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
25
26
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
26
27
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -29,6 +30,7 @@ declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
29
30
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
30
31
  }, "strip", z.ZodTypeAny, {
31
32
  strategy?: "per-pair" | "per-run" | "none" | undefined;
33
+ retentionMode?: "drop" | "compress" | undefined;
32
34
  keepLatestToolPairs?: number | undefined;
33
35
  keepLatestRuns?: number | undefined;
34
36
  maxInteractionGroups?: number | undefined;
@@ -37,6 +39,7 @@ declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
37
39
  maxOutputSummaryTokens?: number | undefined;
38
40
  }, {
39
41
  strategy?: "per-pair" | "per-run" | "none" | undefined;
42
+ retentionMode?: "drop" | "compress" | undefined;
40
43
  keepLatestToolPairs?: number | undefined;
41
44
  keepLatestRuns?: number | undefined;
42
45
  maxInteractionGroups?: number | undefined;
@@ -537,6 +540,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
537
540
  }>>;
538
541
  toolHistory: z.ZodOptional<z.ZodObject<{
539
542
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
543
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
540
544
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
541
545
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
542
546
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -545,6 +549,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
545
549
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
546
550
  }, "strip", z.ZodTypeAny, {
547
551
  strategy?: "per-pair" | "per-run" | "none" | undefined;
552
+ retentionMode?: "drop" | "compress" | undefined;
548
553
  keepLatestToolPairs?: number | undefined;
549
554
  keepLatestRuns?: number | undefined;
550
555
  maxInteractionGroups?: number | undefined;
@@ -553,6 +558,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
553
558
  maxOutputSummaryTokens?: number | undefined;
554
559
  }, {
555
560
  strategy?: "per-pair" | "per-run" | "none" | undefined;
561
+ retentionMode?: "drop" | "compress" | undefined;
556
562
  keepLatestToolPairs?: number | undefined;
557
563
  keepLatestRuns?: number | undefined;
558
564
  maxInteractionGroups?: number | undefined;
@@ -906,6 +912,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
906
912
  } | undefined;
907
913
  toolHistory?: {
908
914
  strategy?: "per-pair" | "per-run" | "none" | undefined;
915
+ retentionMode?: "drop" | "compress" | undefined;
909
916
  keepLatestToolPairs?: number | undefined;
910
917
  keepLatestRuns?: number | undefined;
911
918
  maxInteractionGroups?: number | undefined;
@@ -999,6 +1006,7 @@ declare const AgentSpecContextPolicy: z.ZodObject<{
999
1006
  } | undefined;
1000
1007
  toolHistory?: {
1001
1008
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1009
+ retentionMode?: "drop" | "compress" | undefined;
1002
1010
  keepLatestToolPairs?: number | undefined;
1003
1011
  keepLatestRuns?: number | undefined;
1004
1012
  maxInteractionGroups?: number | undefined;
@@ -1186,6 +1194,7 @@ declare const AgentSpec: z.ZodObject<{
1186
1194
  }>>;
1187
1195
  toolHistory: z.ZodOptional<z.ZodObject<{
1188
1196
  strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
1197
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
1189
1198
  keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
1190
1199
  keepLatestRuns: z.ZodOptional<z.ZodNumber>;
1191
1200
  maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
@@ -1194,6 +1203,7 @@ declare const AgentSpec: z.ZodObject<{
1194
1203
  maxOutputSummaryTokens: z.ZodOptional<z.ZodNumber>;
1195
1204
  }, "strip", z.ZodTypeAny, {
1196
1205
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1206
+ retentionMode?: "drop" | "compress" | undefined;
1197
1207
  keepLatestToolPairs?: number | undefined;
1198
1208
  keepLatestRuns?: number | undefined;
1199
1209
  maxInteractionGroups?: number | undefined;
@@ -1202,6 +1212,7 @@ declare const AgentSpec: z.ZodObject<{
1202
1212
  maxOutputSummaryTokens?: number | undefined;
1203
1213
  }, {
1204
1214
  strategy?: "per-pair" | "per-run" | "none" | undefined;
1215
+ retentionMode?: "drop" | "compress" | undefined;
1205
1216
  keepLatestToolPairs?: number | undefined;
1206
1217
  keepLatestRuns?: number | undefined;
1207
1218
  maxInteractionGroups?: number | undefined;
@@ -1987,6 +1998,7 @@ declare const AgentSpec: z.ZodObject<{
1987
1998
  } | undefined;
1988
1999
  toolHistory?: {
1989
2000
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2001
+ retentionMode?: "drop" | "compress" | undefined;
1990
2002
  keepLatestToolPairs?: number | undefined;
1991
2003
  keepLatestRuns?: number | undefined;
1992
2004
  maxInteractionGroups?: number | undefined;
@@ -2128,6 +2140,7 @@ declare const AgentSpec: z.ZodObject<{
2128
2140
  } | undefined;
2129
2141
  toolHistory?: {
2130
2142
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2143
+ retentionMode?: "drop" | "compress" | undefined;
2131
2144
  keepLatestToolPairs?: number | undefined;
2132
2145
  keepLatestRuns?: number | undefined;
2133
2146
  maxInteractionGroups?: number | undefined;
@@ -2305,6 +2318,7 @@ declare const AgentSpec: z.ZodObject<{
2305
2318
  } | undefined;
2306
2319
  toolHistory?: {
2307
2320
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2321
+ retentionMode?: "drop" | "compress" | undefined;
2308
2322
  keepLatestToolPairs?: number | undefined;
2309
2323
  keepLatestRuns?: number | undefined;
2310
2324
  maxInteractionGroups?: number | undefined;
@@ -2470,6 +2484,7 @@ declare const AgentSpec: z.ZodObject<{
2470
2484
  } | undefined;
2471
2485
  toolHistory?: {
2472
2486
  strategy?: "per-pair" | "per-run" | "none" | undefined;
2487
+ retentionMode?: "drop" | "compress" | undefined;
2473
2488
  keepLatestToolPairs?: number | undefined;
2474
2489
  keepLatestRuns?: number | undefined;
2475
2490
  maxInteractionGroups?: number | undefined;
@@ -2618,4 +2633,4 @@ declare const AgentSpec: z.ZodObject<{
2618
2633
  }>;
2619
2634
  type AgentSpec = z.infer<typeof AgentSpec>;
2620
2635
 
2621
- export { AgentCapability as A, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS as S, ToolBindingSpec as T, AgentSpec as a, AgentSpecAuditConfig as b, AgentSpecBudgetPolicy as c, AgentSpecCheckpointPolicy as d, AgentSpecContextPolicy as e, type AgentSpecContextPolicyInput as f, AgentSpecContextTracePolicy as g, AgentSpecMessageType as h, AgentSpecModelHints as i, AgentSpecMustKeepPolicy as j, AgentSpecMustKeepTruncationRule as k, AgentSpecProviderReplayPolicy as l, AgentSpecReasoningRetentionPolicy as m, AgentSpecSummarizationPolicy as n, AgentSpecSystemReminderExtraRule as o, AgentSpecSystemReminderPolicy as p, AgentSpecSystemReminderTrigger as q, AgentSpecTokenEstimationPolicy as r, AgentSpecToolHistoryPolicy as s, AgentSpecToolObservationGovernancePolicy as t, AgentSpecToolOutputPolicy as u, AgentSpecWorkingMemoryPolicy as v, defineContextPolicy as w };
2636
+ export { AgentSpecToolOutputPolicy as A, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS as S, ToolBindingSpec as T, AgentSpecProviderReplayPolicy as a, AgentSpecCheckpointPolicy as b, AgentSpecSummarizationPolicy as c, AgentSpecContextTracePolicy as d, AgentSpecSystemReminderPolicy as e, AgentSpec as f, AgentSpecContextPolicy as g, type AgentSpecContextPolicyInput as h, AgentCapability as i, AgentSpecAuditConfig as j, AgentSpecBudgetPolicy as k, AgentSpecMessageType as l, AgentSpecModelHints as m, AgentSpecMustKeepPolicy as n, AgentSpecMustKeepTruncationRule as o, AgentSpecReasoningRetentionPolicy as p, AgentSpecSystemReminderExtraRule as q, AgentSpecSystemReminderTrigger as r, AgentSpecTokenEstimationPolicy as s, AgentSpecToolHistoryPolicy as t, AgentSpecToolObservationGovernancePolicy as u, AgentSpecWorkingMemoryPolicy as v, defineContextPolicy as w };