@linnlabs/linnkit 0.31.1 → 0.32.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.
Files changed (489) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cli.cjs +14 -1
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +14 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.cts +3 -0
  7. package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.ts +3 -0
  8. package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.cts +22 -0
  9. package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.ts +22 -0
  10. package/dist/context-manager/profiles/agent/config.d.cts +33 -0
  11. package/dist/context-manager/profiles/agent/config.d.ts +33 -0
  12. package/dist/context-manager/profiles/agent/context/AgentContextManager.d.cts +132 -0
  13. package/dist/context-manager/profiles/agent/context/AgentContextManager.d.ts +132 -0
  14. package/dist/context-manager/profiles/agent/context/ConversationSession.d.cts +131 -0
  15. package/dist/context-manager/profiles/agent/context/ConversationSession.d.ts +131 -0
  16. package/dist/context-manager/profiles/agent/context/config.d.cts +191 -0
  17. package/dist/context-manager/profiles/agent/context/config.d.ts +191 -0
  18. package/dist/context-manager/profiles/agent/context/index.d.cts +8 -0
  19. package/dist/context-manager/profiles/agent/context/index.d.ts +8 -0
  20. package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.cts +52 -0
  21. package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.ts +52 -0
  22. package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.cts +50 -0
  23. package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.ts +50 -0
  24. package/dist/context-manager/profiles/agent/context/providers/base.d.cts +11 -0
  25. package/dist/context-manager/profiles/agent/context/providers/base.d.ts +11 -0
  26. package/dist/context-manager/profiles/agent/context/providers/index.d.cts +12 -0
  27. package/dist/context-manager/profiles/agent/context/providers/index.d.ts +12 -0
  28. package/dist/context-manager/profiles/agent/contracts.d.cts +27 -0
  29. package/dist/context-manager/profiles/agent/contracts.d.ts +27 -0
  30. package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.cts +140 -0
  31. package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.ts +140 -0
  32. package/dist/context-manager/profiles/agent/orchestration/index.d.cts +1 -0
  33. package/dist/context-manager/profiles/agent/orchestration/index.d.ts +1 -0
  34. package/dist/context-manager/profiles/agent/preprocessors/base.d.cts +17 -0
  35. package/dist/context-manager/profiles/agent/preprocessors/base.d.ts +17 -0
  36. package/dist/context-manager/profiles/agent/preprocessors/index.d.cts +117 -0
  37. package/dist/context-manager/profiles/agent/preprocessors/index.d.ts +117 -0
  38. package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.cts +47 -0
  39. package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.ts +47 -0
  40. package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.cts +27 -0
  41. package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.ts +27 -0
  42. package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.cts +43 -0
  43. package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.ts +43 -0
  44. package/dist/context-manager/profiles/agent/tasks/base.d.cts +18 -0
  45. package/dist/context-manager/profiles/agent/tasks/base.d.ts +18 -0
  46. package/dist/context-manager/profiles/agent/tasks/index.d.cts +2 -0
  47. package/dist/context-manager/profiles/agent/tasks/index.d.ts +2 -0
  48. package/dist/context-manager/profiles/agent/tools/ToolManager.d.cts +27 -0
  49. package/dist/context-manager/profiles/agent/tools/ToolManager.d.ts +27 -0
  50. package/dist/context-manager/profiles/agent/tools/index.d.cts +1 -0
  51. package/dist/context-manager/profiles/agent/tools/index.d.ts +1 -0
  52. package/dist/context-manager/profiles/agent/utils/eventConverter.d.cts +15 -0
  53. package/dist/context-manager/profiles/agent/utils/eventConverter.d.ts +15 -0
  54. package/dist/context-manager/profiles/agent/utils/index.d.cts +2 -0
  55. package/dist/context-manager/profiles/agent/utils/index.d.ts +2 -0
  56. package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.cts +26 -0
  57. package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.ts +26 -0
  58. package/dist/context-manager/shared/MessageFormatter.d.cts +55 -0
  59. package/dist/context-manager/shared/MessageFormatter.d.ts +55 -0
  60. package/dist/context-manager/shared/agentSpecAdapter.d.cts +63 -0
  61. package/dist/context-manager/shared/agentSpecAdapter.d.ts +63 -0
  62. package/dist/context-manager/shared/context-manager-base.d.cts +102 -0
  63. package/dist/context-manager/shared/context-manager-base.d.ts +102 -0
  64. package/dist/context-manager/shared/context-pipeline.d.cts +42 -0
  65. package/dist/context-manager/shared/context-pipeline.d.ts +42 -0
  66. package/dist/context-manager/shared/context-trace.d.cts +102 -0
  67. package/dist/context-manager/shared/context-trace.d.ts +102 -0
  68. package/dist/context-manager/shared/contextPolicyMerge.d.cts +19 -0
  69. package/dist/context-manager/shared/contextPolicyMerge.d.ts +19 -0
  70. package/dist/context-manager/shared/contracts/chatLineMessage.d.cts +15 -0
  71. package/dist/context-manager/shared/contracts/chatLineMessage.d.ts +15 -0
  72. package/dist/context-manager/shared/fences/FenceRegistry.d.cts +24 -0
  73. package/dist/context-manager/shared/fences/FenceRegistry.d.ts +24 -0
  74. package/dist/context-manager/shared/image-input-estimation.d.cts +16 -0
  75. package/dist/context-manager/shared/image-input-estimation.d.ts +16 -0
  76. package/dist/context-manager/shared/policies/MustKeepPolicy.d.cts +19 -0
  77. package/dist/context-manager/shared/policies/MustKeepPolicy.d.ts +19 -0
  78. package/dist/context-manager/shared/preprocessors/base.d.cts +43 -0
  79. package/dist/context-manager/shared/preprocessors/base.d.ts +43 -0
  80. package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.cts +26 -0
  81. package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.ts +26 -0
  82. package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.cts +18 -0
  83. package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.ts +18 -0
  84. package/dist/context-manager/shared/preprocessors/historyPurification.d.cts +19 -0
  85. package/dist/context-manager/shared/preprocessors/historyPurification.d.ts +19 -0
  86. package/dist/context-manager/shared/preprocessors/priority.d.cts +17 -0
  87. package/dist/context-manager/shared/preprocessors/priority.d.ts +17 -0
  88. package/dist/context-manager/shared/providers/base.d.cts +106 -0
  89. package/dist/context-manager/shared/providers/base.d.ts +106 -0
  90. package/dist/context-manager/shared/providers/registry.d.cts +11 -0
  91. package/dist/context-manager/shared/providers/registry.d.ts +11 -0
  92. package/dist/context-manager/shared/token-calibration.d.cts +25 -0
  93. package/dist/context-manager/shared/token-calibration.d.ts +25 -0
  94. package/dist/context-manager.d.cts +34 -1559
  95. package/dist/context-manager.d.ts +34 -1559
  96. package/dist/contracts/agentSpec.d.cts +869 -0
  97. package/dist/contracts/agentSpec.d.ts +869 -0
  98. package/dist/{audit-XsNMTt0-.d.cts → contracts/audit.d.cts} +33 -33
  99. package/dist/{audit-XsNMTt0-.d.ts → contracts/audit.d.ts} +33 -33
  100. package/dist/contracts/constants.d.cts +3 -0
  101. package/dist/contracts/constants.d.ts +3 -0
  102. package/dist/contracts/contextCompaction.d.cts +43 -0
  103. package/dist/contracts/contextCompaction.d.ts +43 -0
  104. package/dist/contracts/contextPolicy.d.cts +1121 -0
  105. package/dist/contracts/contextPolicy.d.ts +1121 -0
  106. package/dist/{final-answer-oOQ_7nPt.d.ts → contracts/events.d.cts} +1219 -1222
  107. package/dist/{final-answer-B0_kx5_U.d.cts → contracts/events.d.ts} +1219 -1222
  108. package/dist/{execution-B7e01ZjW.d.cts → contracts/execution.d.cts} +21 -21
  109. package/dist/{execution-B7e01ZjW.d.ts → contracts/execution.d.ts} +21 -21
  110. package/dist/contracts/final-answer.d.cts +7 -0
  111. package/dist/contracts/final-answer.d.ts +7 -0
  112. package/dist/contracts/identity/definitions.d.cts +70 -0
  113. package/dist/contracts/identity/definitions.d.ts +70 -0
  114. package/dist/contracts/identity/generators.d.cts +33 -0
  115. package/dist/contracts/identity/generators.d.ts +33 -0
  116. package/dist/contracts/identity/invariants.d.cts +24 -0
  117. package/dist/contracts/identity/invariants.d.ts +24 -0
  118. package/dist/contracts/json.d.cts +12 -0
  119. package/dist/contracts/json.d.ts +12 -0
  120. package/dist/{provider-continuation-CTZdCB--.d.cts → contracts/messages.d.cts} +210 -957
  121. package/dist/{provider-continuation-CTZdCB--.d.ts → contracts/messages.d.ts} +210 -957
  122. package/dist/contracts/provider-continuation.d.cts +609 -0
  123. package/dist/contracts/provider-continuation.d.ts +609 -0
  124. package/dist/contracts/reasoning.d.cts +77 -0
  125. package/dist/contracts/reasoning.d.ts +77 -0
  126. package/dist/contracts/resource-ref.d.cts +73 -0
  127. package/dist/contracts/resource-ref.d.ts +73 -0
  128. package/dist/contracts/runtime-status.d.cts +8 -0
  129. package/dist/contracts/runtime-status.d.ts +8 -0
  130. package/dist/contracts/sse-framing.d.cts +28 -0
  131. package/dist/contracts/sse-framing.d.ts +28 -0
  132. package/dist/{index-Cp1_oUj0.d.ts → contracts/sse.d.cts} +1218 -1574
  133. package/dist/{index-JYf6n2Ik.d.cts → contracts/sse.d.ts} +1218 -1574
  134. package/dist/contracts/sub-run-trace-payload.d.cts +187 -0
  135. package/dist/contracts/sub-run-trace-payload.d.ts +187 -0
  136. package/dist/{summarization-CMMLhaCe.d.ts → contracts/summarization.d.cts} +2 -2
  137. package/dist/{summarization-kLeweZ5-.d.cts → contracts/summarization.d.ts} +2 -2
  138. package/dist/contracts/token-accounting.d.cts +1177 -0
  139. package/dist/contracts/token-accounting.d.ts +1177 -0
  140. package/dist/{token-calibration-GtFyMJtM.d.cts → contracts/token-calibration.d.cts} +1 -42
  141. package/dist/{token-calibration-GtFyMJtM.d.ts → contracts/token-calibration.d.ts} +1 -42
  142. package/dist/{reasoning-bffu9R2B.d.cts → contracts/token-usage.d.cts} +9 -84
  143. package/dist/{reasoning-bffu9R2B.d.ts → contracts/token-usage.d.ts} +9 -84
  144. package/dist/contracts.d.cts +24 -10
  145. package/dist/contracts.d.ts +24 -10
  146. package/dist/index.cjs +14 -1
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.d.cts +14 -77
  149. package/dist/index.d.ts +14 -77
  150. package/dist/index.js +14 -1
  151. package/dist/index.js.map +1 -1
  152. package/dist/ports/agent-invocation.d.cts +42 -0
  153. package/dist/ports/agent-invocation.d.ts +42 -0
  154. package/dist/{audit-DnuOSwWE.d.ts → ports/audit.d.cts} +2 -2
  155. package/dist/{audit-C9LPbPib.d.cts → ports/audit.d.ts} +2 -2
  156. package/dist/ports/canonical-inference.d.cts +135 -0
  157. package/dist/ports/canonical-inference.d.ts +135 -0
  158. package/dist/ports/llm-call.d.cts +109 -0
  159. package/dist/ports/llm-call.d.ts +109 -0
  160. package/dist/ports/llm-input-materialization.d.cts +69 -0
  161. package/dist/ports/llm-input-materialization.d.ts +69 -0
  162. package/dist/{token-counter-BjiHQEJ-.d.ts → ports/token-counter.d.cts} +3 -3
  163. package/dist/{token-counter-DiGIoaq2.d.cts → ports/token-counter.d.ts} +3 -3
  164. package/dist/{tokenizer-yIFTTc-W.d.ts → ports/tokenizer.d.cts} +2 -2
  165. package/dist/{tokenizer-Dz5Y3KT0.d.cts → ports/tokenizer.d.ts} +2 -2
  166. package/dist/ports/tool-schema.d.cts +30 -0
  167. package/dist/ports/tool-schema.d.ts +30 -0
  168. package/dist/ports/usage-normalizer.d.cts +16 -0
  169. package/dist/ports/usage-normalizer.d.ts +16 -0
  170. package/dist/ports.d.cts +10 -9
  171. package/dist/ports.d.ts +10 -9
  172. package/dist/quickstart/defineAgent.d.cts +12 -0
  173. package/dist/quickstart/defineAgent.d.ts +12 -0
  174. package/dist/quickstart/defineConfig.d.cts +7 -0
  175. package/dist/quickstart/defineConfig.d.ts +7 -0
  176. package/dist/quickstart/runAgent.d.cts +12 -0
  177. package/dist/quickstart/runAgent.d.ts +12 -0
  178. package/dist/quickstart/toolRuntime.d.cts +14 -0
  179. package/dist/quickstart/toolRuntime.d.ts +14 -0
  180. package/dist/{runAgent-jxZ0uNto.d.ts → quickstart/types.d.cts} +10 -28
  181. package/dist/{runAgent-QiBiFXHR.d.cts → quickstart/types.d.ts} +10 -28
  182. package/dist/quickstart.cjs +14 -1
  183. package/dist/quickstart.cjs.map +1 -1
  184. package/dist/quickstart.d.cts +5 -23
  185. package/dist/quickstart.d.ts +5 -23
  186. package/dist/quickstart.js +14 -1
  187. package/dist/quickstart.js.map +1 -1
  188. package/dist/runtime-kernel/audit/compositeAudit.d.cts +23 -0
  189. package/dist/runtime-kernel/audit/compositeAudit.d.ts +23 -0
  190. package/dist/runtime-kernel/audit/consoleAudit.d.cts +10 -0
  191. package/dist/runtime-kernel/audit/consoleAudit.d.ts +10 -0
  192. package/dist/runtime-kernel/audit/emitAudit.d.cts +31 -0
  193. package/dist/runtime-kernel/audit/emitAudit.d.ts +31 -0
  194. package/dist/runtime-kernel/audit/eventStoreAudit.d.cts +27 -0
  195. package/dist/runtime-kernel/audit/eventStoreAudit.d.ts +27 -0
  196. package/dist/runtime-kernel/audit/fileAudit.d.cts +22 -0
  197. package/dist/runtime-kernel/audit/fileAudit.d.ts +22 -0
  198. package/dist/runtime-kernel/audit/index.d.cts +6 -0
  199. package/dist/runtime-kernel/audit/index.d.ts +6 -0
  200. package/dist/runtime-kernel/audit/noopAudit.d.cts +5 -0
  201. package/dist/runtime-kernel/audit/noopAudit.d.ts +5 -0
  202. package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.cts +26 -0
  203. package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.ts +26 -0
  204. package/dist/runtime-kernel/child-run-trace/index.d.cts +4 -0
  205. package/dist/runtime-kernel/child-run-trace/index.d.ts +4 -0
  206. package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.cts +10 -0
  207. package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.ts +10 -0
  208. package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.cts +47 -0
  209. package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.ts +47 -0
  210. package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.cts +81 -0
  211. package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.ts +81 -0
  212. package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +101 -0
  213. package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +101 -0
  214. package/dist/runtime-kernel/child-runs/historyPolicy.d.cts +9 -0
  215. package/dist/runtime-kernel/child-runs/historyPolicy.d.ts +9 -0
  216. package/dist/runtime-kernel/child-runs/index.d.cts +3 -0
  217. package/dist/runtime-kernel/child-runs/index.d.ts +3 -0
  218. package/dist/runtime-kernel/child-runs/types.d.cts +82 -0
  219. package/dist/runtime-kernel/child-runs/types.d.ts +82 -0
  220. package/dist/runtime-kernel/enrichment/index.d.cts +2 -0
  221. package/dist/runtime-kernel/enrichment/index.d.ts +2 -0
  222. package/dist/runtime-kernel/enrichment/registry.d.cts +25 -0
  223. package/dist/runtime-kernel/enrichment/registry.d.ts +25 -0
  224. package/dist/runtime-kernel/enrichment/types.d.cts +83 -0
  225. package/dist/runtime-kernel/enrichment/types.d.ts +83 -0
  226. package/dist/runtime-kernel/events/agent-to-runtime.d.cts +6 -0
  227. package/dist/runtime-kernel/events/agent-to-runtime.d.ts +6 -0
  228. package/dist/{agentEvents-yvamy9xt.d.cts → runtime-kernel/events/agentEvents.d.cts} +127 -126
  229. package/dist/{agentEvents-DhXdKeXD.d.ts → runtime-kernel/events/agentEvents.d.ts} +127 -126
  230. package/dist/runtime-kernel/events/eventGovernance.d.cts +47 -0
  231. package/dist/runtime-kernel/events/eventGovernance.d.ts +47 -0
  232. package/dist/runtime-kernel/events/eventMappers.d.cts +41 -0
  233. package/dist/runtime-kernel/events/eventMappers.d.ts +41 -0
  234. package/dist/runtime-kernel/events/finalAnswerAssembler.d.cts +27 -0
  235. package/dist/runtime-kernel/events/finalAnswerAssembler.d.ts +27 -0
  236. package/dist/runtime-kernel/events/finalAnswerCompletion.d.cts +6 -0
  237. package/dist/runtime-kernel/events/finalAnswerCompletion.d.ts +6 -0
  238. package/dist/runtime-kernel/events/provider-sidecar.d.cts +33 -0
  239. package/dist/runtime-kernel/events/provider-sidecar.d.ts +33 -0
  240. package/dist/runtime-kernel/events/runtime-to-ai-message.d.cts +14 -0
  241. package/dist/runtime-kernel/events/runtime-to-ai-message.d.ts +14 -0
  242. package/dist/runtime-kernel/events.d.cts +7 -5
  243. package/dist/runtime-kernel/events.d.ts +7 -5
  244. package/dist/runtime-kernel/execution/event-bus.d.cts +52 -0
  245. package/dist/runtime-kernel/execution/event-bus.d.ts +52 -0
  246. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +40 -0
  247. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +40 -0
  248. package/dist/runtime-kernel/execution/index.d.cts +5 -0
  249. package/dist/runtime-kernel/execution/index.d.ts +5 -0
  250. package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.cts +46 -0
  251. package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.ts +46 -0
  252. package/dist/runtime-kernel/execution/runtimeEventPublisher.d.cts +34 -0
  253. package/dist/runtime-kernel/execution/runtimeEventPublisher.d.ts +34 -0
  254. package/dist/runtime-kernel/execution/sequencer.d.cts +69 -0
  255. package/dist/runtime-kernel/execution/sequencer.d.ts +69 -0
  256. package/dist/runtime-kernel/graph-engine/checkpointer/base.d.cts +59 -0
  257. package/dist/runtime-kernel/graph-engine/checkpointer/base.d.ts +59 -0
  258. package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.cts +14 -0
  259. package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.ts +14 -0
  260. package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.cts +22 -0
  261. package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.ts +22 -0
  262. package/dist/runtime-kernel/graph-engine/engine.d.cts +64 -0
  263. package/dist/runtime-kernel/graph-engine/engine.d.ts +64 -0
  264. package/dist/runtime-kernel/graph-engine/event-store/base.d.cts +26 -0
  265. package/dist/runtime-kernel/graph-engine/event-store/base.d.ts +26 -0
  266. package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.cts +14 -0
  267. package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.ts +14 -0
  268. package/dist/runtime-kernel/graph-engine/executor.d.cts +59 -0
  269. package/dist/runtime-kernel/graph-engine/executor.d.ts +59 -0
  270. package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.cts +104 -0
  271. package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.ts +104 -0
  272. package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.cts +41 -0
  273. package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.ts +41 -0
  274. package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.cts +23 -0
  275. package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.ts +23 -0
  276. package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.cts +15 -0
  277. package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.ts +15 -0
  278. package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.cts +7 -0
  279. package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.ts +7 -0
  280. package/dist/runtime-kernel/graph-engine/index.d.cts +18 -0
  281. package/dist/runtime-kernel/graph-engine/index.d.ts +18 -0
  282. package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.cts +26 -0
  283. package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.ts +26 -0
  284. package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.cts +6 -0
  285. package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.ts +6 -0
  286. package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.cts +44 -0
  287. package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.ts +44 -0
  288. package/dist/runtime-kernel/graph-engine/nodes/userNode.d.cts +8 -0
  289. package/dist/runtime-kernel/graph-engine/nodes/userNode.d.ts +8 -0
  290. package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.cts +15 -0
  291. package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.ts +15 -0
  292. package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.cts +57 -0
  293. package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.ts +57 -0
  294. package/dist/runtime-kernel/graph-engine/types.d.cts +143 -0
  295. package/dist/runtime-kernel/graph-engine/types.d.ts +143 -0
  296. package/dist/runtime-kernel/llm/caller.d.cts +50 -0
  297. package/dist/runtime-kernel/llm/caller.d.ts +50 -0
  298. package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.cts +28 -0
  299. package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.ts +28 -0
  300. package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.cts +6 -0
  301. package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.ts +6 -0
  302. package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.cts +6 -0
  303. package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.ts +6 -0
  304. package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.cts +29 -0
  305. package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.ts +29 -0
  306. package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.cts +26 -0
  307. package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.ts +26 -0
  308. package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.cts +9 -0
  309. package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.ts +9 -0
  310. package/dist/runtime-kernel/llm/index.d.cts +22 -0
  311. package/dist/runtime-kernel/llm/index.d.ts +22 -0
  312. package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.cts +24 -0
  313. package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.ts +24 -0
  314. package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.cts +31 -0
  315. package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.ts +31 -0
  316. package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.cts +13 -0
  317. package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.ts +13 -0
  318. package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.cts +6 -0
  319. package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.ts +6 -0
  320. package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.cts +7 -0
  321. package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.ts +7 -0
  322. package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.cts +10 -0
  323. package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.ts +10 -0
  324. package/dist/runtime-kernel/llm/modelCatalog.d.cts +62 -0
  325. package/dist/runtime-kernel/llm/modelCatalog.d.ts +62 -0
  326. package/dist/runtime-kernel/llm/modelResolver.d.cts +40 -0
  327. package/dist/runtime-kernel/llm/modelResolver.d.ts +40 -0
  328. package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.cts +15 -0
  329. package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.ts +15 -0
  330. package/dist/runtime-kernel/llm/policies/policyEngine.d.cts +18 -0
  331. package/dist/runtime-kernel/llm/policies/policyEngine.d.ts +18 -0
  332. package/dist/runtime-kernel/llm/policies/types.d.cts +27 -0
  333. package/dist/runtime-kernel/llm/policies/types.d.ts +27 -0
  334. package/dist/runtime-kernel/llm/request-builder.d.cts +22 -0
  335. package/dist/runtime-kernel/llm/request-builder.d.ts +22 -0
  336. package/dist/runtime-kernel/llm/usage-telemetry.d.cts +17 -0
  337. package/dist/runtime-kernel/llm/usage-telemetry.d.ts +17 -0
  338. package/dist/runtime-kernel/run-context/index.d.cts +1 -0
  339. package/dist/runtime-kernel/run-context/index.d.ts +1 -0
  340. package/dist/runtime-kernel/run-context/types.d.cts +44 -0
  341. package/dist/runtime-kernel/run-context/types.d.ts +44 -0
  342. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +131 -0
  343. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +131 -0
  344. package/dist/runtime-kernel/run-supervisor/index.d.cts +6 -0
  345. package/dist/runtime-kernel/run-supervisor/index.d.ts +6 -0
  346. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +15 -0
  347. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +15 -0
  348. package/dist/runtime-kernel/run-supervisor/runErrors.d.cts +24 -0
  349. package/dist/runtime-kernel/run-supervisor/runErrors.d.ts +24 -0
  350. package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +155 -0
  351. package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +155 -0
  352. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +47 -0
  353. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +47 -0
  354. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +57 -0
  355. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +57 -0
  356. package/dist/runtime-kernel/system-reminder/apply.d.cts +38 -0
  357. package/dist/runtime-kernel/system-reminder/apply.d.ts +38 -0
  358. package/dist/runtime-kernel/system-reminder/helpers.d.cts +11 -0
  359. package/dist/runtime-kernel/system-reminder/helpers.d.ts +11 -0
  360. package/dist/runtime-kernel/system-reminder/index.d.cts +7 -0
  361. package/dist/runtime-kernel/system-reminder/index.d.ts +7 -0
  362. package/dist/runtime-kernel/system-reminder/registry.d.cts +17 -0
  363. package/dist/runtime-kernel/system-reminder/registry.d.ts +17 -0
  364. package/dist/runtime-kernel/system-reminder/rules.d.cts +20 -0
  365. package/dist/runtime-kernel/system-reminder/rules.d.ts +20 -0
  366. package/dist/runtime-kernel/system-reminder/templates.d.cts +10 -0
  367. package/dist/runtime-kernel/system-reminder/templates.d.ts +10 -0
  368. package/dist/runtime-kernel/system-reminder/triggers.d.cts +10 -0
  369. package/dist/runtime-kernel/system-reminder/triggers.d.ts +10 -0
  370. package/dist/runtime-kernel/system-reminder/types.d.cts +46 -0
  371. package/dist/runtime-kernel/system-reminder/types.d.ts +46 -0
  372. package/dist/runtime-kernel/telemetry/index.d.cts +3 -0
  373. package/dist/runtime-kernel/telemetry/index.d.ts +3 -0
  374. package/dist/runtime-kernel/telemetry/noopTelemetry.d.cts +5 -0
  375. package/dist/runtime-kernel/telemetry/noopTelemetry.d.ts +5 -0
  376. package/dist/runtime-kernel/telemetry/telemetryEvents.d.cts +5 -0
  377. package/dist/runtime-kernel/telemetry/telemetryEvents.d.ts +5 -0
  378. package/dist/runtime-kernel/telemetry/telemetryPort.d.cts +95 -0
  379. package/dist/runtime-kernel/telemetry/telemetryPort.d.ts +95 -0
  380. package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.cts +23 -0
  381. package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.ts +23 -0
  382. package/dist/runtime-kernel/testkit/graphLoopHarness.d.cts +49 -0
  383. package/dist/runtime-kernel/testkit/graphLoopHarness.d.ts +49 -0
  384. package/dist/runtime-kernel/token-accounting/functions.d.cts +27 -0
  385. package/dist/runtime-kernel/token-accounting/functions.d.ts +27 -0
  386. package/dist/runtime-kernel/token-accounting/index.d.cts +1 -0
  387. package/dist/runtime-kernel/token-accounting/index.d.ts +1 -0
  388. package/dist/runtime-kernel/tools/argNormalizer.d.cts +10 -0
  389. package/dist/runtime-kernel/tools/argNormalizer.d.ts +10 -0
  390. package/dist/runtime-kernel/tools/conversationView.d.cts +22 -0
  391. package/dist/runtime-kernel/tools/conversationView.d.ts +22 -0
  392. package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.cts +25 -0
  393. package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.ts +25 -0
  394. package/dist/runtime-kernel/tools/index.d.cts +15 -0
  395. package/dist/runtime-kernel/tools/index.d.ts +15 -0
  396. package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.cts +51 -0
  397. package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.ts +51 -0
  398. package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.cts +17 -0
  399. package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.ts +17 -0
  400. package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.cts +17 -0
  401. package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.ts +17 -0
  402. package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.cts +16 -0
  403. package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.ts +16 -0
  404. package/dist/runtime-kernel/tools/ports.d.cts +119 -0
  405. package/dist/runtime-kernel/tools/ports.d.ts +119 -0
  406. package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.cts +15 -0
  407. package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.ts +15 -0
  408. package/dist/runtime-kernel/tools/toolContextPatch.d.cts +14 -0
  409. package/dist/runtime-kernel/tools/toolContextPatch.d.ts +14 -0
  410. package/dist/runtime-kernel/tools/toolContextRuntime.d.cts +37 -0
  411. package/dist/runtime-kernel/tools/toolContextRuntime.d.ts +37 -0
  412. package/dist/runtime-kernel/tools/toolContracts.d.cts +109 -0
  413. package/dist/runtime-kernel/tools/toolContracts.d.ts +109 -0
  414. package/dist/runtime-kernel/tools/toolExecutionContext.d.cts +104 -0
  415. package/dist/runtime-kernel/tools/toolExecutionContext.d.ts +104 -0
  416. package/dist/runtime-kernel/tools/ui-types.d.cts +72 -0
  417. package/dist/runtime-kernel/tools/ui-types.d.ts +72 -0
  418. package/dist/runtime-kernel.cjs +14 -1
  419. package/dist/runtime-kernel.cjs.map +1 -1
  420. package/dist/runtime-kernel.d.cts +106 -20
  421. package/dist/runtime-kernel.d.ts +106 -20
  422. package/dist/runtime-kernel.js +14 -1
  423. package/dist/runtime-kernel.js.map +1 -1
  424. package/dist/shared/defaultTokenizerPort.d.cts +29 -0
  425. package/dist/shared/defaultTokenizerPort.d.ts +29 -0
  426. package/dist/shared/errorClassifier.d.cts +42 -0
  427. package/dist/shared/errorClassifier.d.ts +42 -0
  428. package/dist/shared/llmAuditProjection.d.cts +11 -0
  429. package/dist/shared/llmAuditProjection.d.ts +11 -0
  430. package/dist/shared/llmAuditRecorder.d.cts +44 -0
  431. package/dist/shared/llmAuditRecorder.d.ts +44 -0
  432. package/dist/shared/llmImageInputError.d.cts +34 -0
  433. package/dist/shared/llmImageInputError.d.ts +34 -0
  434. package/dist/shared/llmTelemetryContext.d.cts +52 -0
  435. package/dist/shared/llmTelemetryContext.d.ts +52 -0
  436. package/dist/shared/logger.d.cts +12 -0
  437. package/dist/shared/logger.d.ts +12 -0
  438. package/dist/{prompt-budget-yciFkC9U.d.cts → shared/prompt-budget.d.cts} +2 -1
  439. package/dist/{prompt-budget-yciFkC9U.d.ts → shared/prompt-budget.d.ts} +2 -1
  440. package/dist/testkit/agent-harness/assertions.d.cts +10 -0
  441. package/dist/testkit/agent-harness/assertions.d.ts +10 -0
  442. package/dist/testkit/agent-harness/scriptedInferenceHarness.d.cts +52 -0
  443. package/dist/testkit/agent-harness/scriptedInferenceHarness.d.ts +52 -0
  444. package/dist/testkit/context-harness/invariants/index.d.cts +7 -0
  445. package/dist/testkit/context-harness/invariants/index.d.ts +7 -0
  446. package/dist/testkit/context-harness/invariants/types.d.cts +32 -0
  447. package/dist/testkit/context-harness/invariants/types.d.ts +32 -0
  448. package/dist/testkit/context-harness/replayHarness.d.cts +18 -0
  449. package/dist/testkit/context-harness/replayHarness.d.ts +18 -0
  450. package/dist/testkit/mocks/tokenizerPort.d.cts +17 -0
  451. package/dist/testkit/mocks/tokenizerPort.d.ts +17 -0
  452. package/dist/testkit/run-harness/collectingAuditPort.d.cts +21 -0
  453. package/dist/testkit/run-harness/collectingAuditPort.d.ts +21 -0
  454. package/dist/testkit/run-harness/invariants/index.d.cts +7 -0
  455. package/dist/testkit/run-harness/invariants/index.d.ts +7 -0
  456. package/dist/testkit/run-harness/invariants/types.d.cts +48 -0
  457. package/dist/testkit/run-harness/invariants/types.d.ts +48 -0
  458. package/dist/testkit/run-harness/mockTelemetryPort.d.cts +35 -0
  459. package/dist/testkit/run-harness/mockTelemetryPort.d.ts +35 -0
  460. package/dist/testkit/run-harness/runSupervisorHarness.d.cts +60 -0
  461. package/dist/testkit/run-harness/runSupervisorHarness.d.ts +60 -0
  462. package/dist/testkit/tool-fixtures/toolContext.d.cts +19 -0
  463. package/dist/testkit/tool-fixtures/toolContext.d.ts +19 -0
  464. package/dist/testkit.cjs +14 -1
  465. package/dist/testkit.cjs.map +1 -1
  466. package/dist/testkit.d.cts +17 -277
  467. package/dist/testkit.d.ts +17 -277
  468. package/dist/testkit.js +14 -1
  469. package/dist/testkit.js.map +1 -1
  470. package/docs/integration/host-originated-tools.md +9 -0
  471. package/package.json +6 -4
  472. package/dist/base-DRRrRhxS.d.cts +0 -216
  473. package/dist/base-DVyQIl_d.d.ts +0 -216
  474. package/dist/defaultGraphExecutor-B2kGX0iA.d.ts +0 -905
  475. package/dist/defaultGraphExecutor-CO3ztZdG.d.cts +0 -905
  476. package/dist/index-1pE6gSpV.d.cts +0 -172
  477. package/dist/index-CMUnmxhM.d.ts +0 -1966
  478. package/dist/index-CZtZq3T1.d.cts +0 -1966
  479. package/dist/index-D_csW7Zl.d.ts +0 -172
  480. package/dist/index-DpSWZ1L6.d.ts +0 -67
  481. package/dist/index-oCM3XEu2.d.cts +0 -67
  482. package/dist/llm-input-materialization-Vce5Swvc.d.ts +0 -366
  483. package/dist/llm-input-materialization-r-V3n9U-.d.cts +0 -366
  484. package/dist/runHandle--l0kE205.d.cts +0 -490
  485. package/dist/runHandle-ouLd6Tgp.d.ts +0 -490
  486. package/dist/token-accounting-19cXG7hM.d.cts +0 -3342
  487. package/dist/token-accounting-CVW37Uri.d.ts +0 -3342
  488. package/dist/toolContracts--KrHHNCY.d.cts +0 -424
  489. package/dist/toolContracts-BQ4kIso_.d.ts +0 -424
@@ -0,0 +1,1121 @@
1
+ import { SerializableJsonValue } from './json.cjs';
2
+ import { z } from 'zod';
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"]>;
5
+ type AgentSpecMessageType = z.infer<typeof AgentSpecMessageType>;
6
+ declare const AgentSpecBudgetPolicy: z.ZodObject<{
7
+ maxTokens: z.ZodOptional<z.ZodNumber>;
8
+ reservedForResponse: z.ZodOptional<z.ZodNumber>;
9
+ workingMemoryBudgetPercentage: z.ZodOptional<z.ZodNumber>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ maxTokens?: number | undefined;
12
+ reservedForResponse?: number | undefined;
13
+ workingMemoryBudgetPercentage?: number | undefined;
14
+ }, {
15
+ maxTokens?: number | undefined;
16
+ reservedForResponse?: number | undefined;
17
+ workingMemoryBudgetPercentage?: number | undefined;
18
+ }>;
19
+ type AgentSpecBudgetPolicy = z.infer<typeof AgentSpecBudgetPolicy>;
20
+ declare const AgentSpecToolHistoryPolicy: z.ZodObject<{
21
+ strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
22
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
23
+ keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
24
+ keepLatestRuns: z.ZodOptional<z.ZodNumber>;
25
+ maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
26
+ overflowStrategy: z.ZodOptional<z.ZodEnum<["keep-latest", "fail-fast"]>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
29
+ retentionMode?: "drop" | "compress" | undefined;
30
+ keepLatestToolPairs?: number | undefined;
31
+ keepLatestRuns?: number | undefined;
32
+ maxInteractionGroups?: number | undefined;
33
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
34
+ }, {
35
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
36
+ retentionMode?: "drop" | "compress" | undefined;
37
+ keepLatestToolPairs?: number | undefined;
38
+ keepLatestRuns?: number | undefined;
39
+ maxInteractionGroups?: number | undefined;
40
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
41
+ }>;
42
+ type AgentSpecToolHistoryPolicy = z.infer<typeof AgentSpecToolHistoryPolicy>;
43
+ declare const AgentSpecToolObservationGovernancePolicy: z.ZodObject<{
44
+ enabled: z.ZodOptional<z.ZodBoolean>;
45
+ maxChars: z.ZodOptional<z.ZodNumber>;
46
+ maxLines: z.ZodOptional<z.ZodNumber>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ enabled?: boolean | undefined;
49
+ maxChars?: number | undefined;
50
+ maxLines?: number | undefined;
51
+ }, {
52
+ enabled?: boolean | undefined;
53
+ maxChars?: number | undefined;
54
+ maxLines?: number | undefined;
55
+ }>;
56
+ type AgentSpecToolObservationGovernancePolicy = z.infer<typeof AgentSpecToolObservationGovernancePolicy>;
57
+ declare const AgentSpecToolOutputPolicy: z.ZodObject<{
58
+ observationGovernance: z.ZodOptional<z.ZodObject<{
59
+ enabled: z.ZodOptional<z.ZodBoolean>;
60
+ maxChars: z.ZodOptional<z.ZodNumber>;
61
+ maxLines: z.ZodOptional<z.ZodNumber>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ enabled?: boolean | undefined;
64
+ maxChars?: number | undefined;
65
+ maxLines?: number | undefined;
66
+ }, {
67
+ enabled?: boolean | undefined;
68
+ maxChars?: number | undefined;
69
+ maxLines?: number | undefined;
70
+ }>>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ observationGovernance?: {
73
+ enabled?: boolean | undefined;
74
+ maxChars?: number | undefined;
75
+ maxLines?: number | undefined;
76
+ } | undefined;
77
+ }, {
78
+ observationGovernance?: {
79
+ enabled?: boolean | undefined;
80
+ maxChars?: number | undefined;
81
+ maxLines?: number | undefined;
82
+ } | undefined;
83
+ }>;
84
+ type AgentSpecToolOutputPolicy = z.infer<typeof AgentSpecToolOutputPolicy>;
85
+ /** Graph 在主模型调用前执行的统一上下文压缩策略。 */
86
+ declare const AgentSpecContextCompactionPolicy: z.ZodEffects<z.ZodObject<{
87
+ enabled: z.ZodOptional<z.ZodBoolean>;
88
+ triggerRatio: z.ZodOptional<z.ZodNumber>;
89
+ targetRatio: z.ZodOptional<z.ZodNumber>;
90
+ keepLatestToolGroups: z.ZodOptional<z.ZodNumber>;
91
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
92
+ maxCompactionsPerRun: z.ZodOptional<z.ZodNumber>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ enabled?: boolean | undefined;
95
+ triggerRatio?: number | undefined;
96
+ targetRatio?: number | undefined;
97
+ keepLatestToolGroups?: number | undefined;
98
+ maxOutputTokens?: number | undefined;
99
+ maxCompactionsPerRun?: number | undefined;
100
+ }, {
101
+ enabled?: boolean | undefined;
102
+ triggerRatio?: number | undefined;
103
+ targetRatio?: number | undefined;
104
+ keepLatestToolGroups?: number | undefined;
105
+ maxOutputTokens?: number | undefined;
106
+ maxCompactionsPerRun?: number | undefined;
107
+ }>, {
108
+ enabled?: boolean | undefined;
109
+ triggerRatio?: number | undefined;
110
+ targetRatio?: number | undefined;
111
+ keepLatestToolGroups?: number | undefined;
112
+ maxOutputTokens?: number | undefined;
113
+ maxCompactionsPerRun?: number | undefined;
114
+ }, {
115
+ enabled?: boolean | undefined;
116
+ triggerRatio?: number | undefined;
117
+ targetRatio?: number | undefined;
118
+ keepLatestToolGroups?: number | undefined;
119
+ maxOutputTokens?: number | undefined;
120
+ maxCompactionsPerRun?: number | undefined;
121
+ }>;
122
+ type AgentSpecContextCompactionPolicy = z.infer<typeof AgentSpecContextCompactionPolicy>;
123
+ declare const AgentSpecMustKeepTruncationRule: z.ZodObject<{
124
+ fenceKind: z.ZodString;
125
+ maxBudgetFraction: z.ZodNumber;
126
+ strategyName: z.ZodString;
127
+ }, "strip", z.ZodTypeAny, {
128
+ fenceKind: string;
129
+ maxBudgetFraction: number;
130
+ strategyName: string;
131
+ }, {
132
+ fenceKind: string;
133
+ maxBudgetFraction: number;
134
+ strategyName: string;
135
+ }>;
136
+ type AgentSpecMustKeepTruncationRule = z.infer<typeof AgentSpecMustKeepTruncationRule>;
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">>;
139
+ alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
+ truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
141
+ fenceKind: z.ZodString;
142
+ maxBudgetFraction: z.ZodNumber;
143
+ strategyName: z.ZodString;
144
+ }, "strip", z.ZodTypeAny, {
145
+ fenceKind: string;
146
+ maxBudgetFraction: number;
147
+ strategyName: string;
148
+ }, {
149
+ fenceKind: string;
150
+ maxBudgetFraction: number;
151
+ strategyName: string;
152
+ }>, "many">>;
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;
155
+ alwaysKeepFenceKinds?: string[] | undefined;
156
+ truncationRules?: {
157
+ fenceKind: string;
158
+ maxBudgetFraction: number;
159
+ strategyName: string;
160
+ }[] | undefined;
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;
163
+ alwaysKeepFenceKinds?: string[] | undefined;
164
+ truncationRules?: {
165
+ fenceKind: string;
166
+ maxBudgetFraction: number;
167
+ strategyName: string;
168
+ }[] | undefined;
169
+ }>;
170
+ type AgentSpecMustKeepPolicy = z.infer<typeof AgentSpecMustKeepPolicy>;
171
+ declare const AgentSpecWorkingMemoryPolicy: z.ZodObject<{
172
+ maxRecentToolRuns: z.ZodOptional<z.ZodNumber>;
173
+ /** @deprecated Use maxRecentToolRuns. Kept as a compatibility alias for older AgentSpec configs. */
174
+ maxRecentToolInteractions: z.ZodOptional<z.ZodNumber>;
175
+ minToolInteractionsToKeep: z.ZodOptional<z.ZodNumber>;
176
+ toolPairingSearchRange: z.ZodOptional<z.ZodNumber>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ maxRecentToolRuns?: number | undefined;
179
+ maxRecentToolInteractions?: number | undefined;
180
+ minToolInteractionsToKeep?: number | undefined;
181
+ toolPairingSearchRange?: number | undefined;
182
+ }, {
183
+ maxRecentToolRuns?: number | undefined;
184
+ maxRecentToolInteractions?: number | undefined;
185
+ minToolInteractionsToKeep?: number | undefined;
186
+ toolPairingSearchRange?: number | undefined;
187
+ }>;
188
+ type AgentSpecWorkingMemoryPolicy = z.infer<typeof AgentSpecWorkingMemoryPolicy>;
189
+ declare const AgentSpecTokenEstimationPolicy: z.ZodObject<{
190
+ encoding: z.ZodOptional<z.ZodString>;
191
+ avgCharsPerToken: z.ZodOptional<z.ZodNumber>;
192
+ toolCallOverhead: z.ZodOptional<z.ZodNumber>;
193
+ calibration: z.ZodOptional<z.ZodObject<{
194
+ enabled: z.ZodOptional<z.ZodBoolean>;
195
+ minSamples: z.ZodOptional<z.ZodNumber>;
196
+ minCoefficient: z.ZodOptional<z.ZodNumber>;
197
+ maxCoefficient: z.ZodOptional<z.ZodNumber>;
198
+ }, "strip", z.ZodTypeAny, {
199
+ enabled?: boolean | undefined;
200
+ minSamples?: number | undefined;
201
+ minCoefficient?: number | undefined;
202
+ maxCoefficient?: number | undefined;
203
+ }, {
204
+ enabled?: boolean | undefined;
205
+ minSamples?: number | undefined;
206
+ minCoefficient?: number | undefined;
207
+ maxCoefficient?: number | undefined;
208
+ }>>;
209
+ remoteCount: z.ZodOptional<z.ZodObject<{
210
+ enabled: z.ZodOptional<z.ZodBoolean>;
211
+ failureBehavior: z.ZodOptional<z.ZodEnum<["use-local-estimate", "fail-fast"]>>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ enabled?: boolean | undefined;
214
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
215
+ }, {
216
+ enabled?: boolean | undefined;
217
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
218
+ }>>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ encoding?: string | undefined;
221
+ avgCharsPerToken?: number | undefined;
222
+ toolCallOverhead?: number | undefined;
223
+ calibration?: {
224
+ enabled?: boolean | undefined;
225
+ minSamples?: number | undefined;
226
+ minCoefficient?: number | undefined;
227
+ maxCoefficient?: number | undefined;
228
+ } | undefined;
229
+ remoteCount?: {
230
+ enabled?: boolean | undefined;
231
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
232
+ } | undefined;
233
+ }, {
234
+ encoding?: string | undefined;
235
+ avgCharsPerToken?: number | undefined;
236
+ toolCallOverhead?: number | undefined;
237
+ calibration?: {
238
+ enabled?: boolean | undefined;
239
+ minSamples?: number | undefined;
240
+ minCoefficient?: number | undefined;
241
+ maxCoefficient?: number | undefined;
242
+ } | undefined;
243
+ remoteCount?: {
244
+ enabled?: boolean | undefined;
245
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
246
+ } | undefined;
247
+ }>;
248
+ type AgentSpecTokenEstimationPolicy = z.infer<typeof AgentSpecTokenEstimationPolicy>;
249
+ declare const SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS: readonly ["phase-equals", "remaining-steps-leq", "step-count-modulo", "tool-call-streak", "agent-has-tool"];
250
+ declare const AgentSpecSystemReminderTrigger: z.ZodObject<{
251
+ kind: z.ZodString;
252
+ threshold: z.ZodOptional<z.ZodNumber>;
253
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
254
+ moduloStep: z.ZodOptional<z.ZodBoolean>;
255
+ toolName: z.ZodOptional<z.ZodString>;
256
+ period: z.ZodOptional<z.ZodNumber>;
257
+ minStep: z.ZodOptional<z.ZodNumber>;
258
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ kind: string;
261
+ value?: string | number | boolean | undefined;
262
+ toolName?: string | undefined;
263
+ threshold?: number | undefined;
264
+ moduloStep?: boolean | undefined;
265
+ period?: number | undefined;
266
+ minStep?: number | undefined;
267
+ config?: Record<string, SerializableJsonValue> | undefined;
268
+ }, {
269
+ kind: string;
270
+ value?: string | number | boolean | undefined;
271
+ toolName?: string | undefined;
272
+ threshold?: number | undefined;
273
+ moduloStep?: boolean | undefined;
274
+ period?: number | undefined;
275
+ minStep?: number | undefined;
276
+ config?: Record<string, SerializableJsonValue> | undefined;
277
+ }>;
278
+ type AgentSpecSystemReminderTrigger = z.infer<typeof AgentSpecSystemReminderTrigger>;
279
+ declare const AgentSpecSystemReminderExtraRule: z.ZodObject<{
280
+ id: z.ZodString;
281
+ trigger: z.ZodObject<{
282
+ kind: z.ZodString;
283
+ threshold: z.ZodOptional<z.ZodNumber>;
284
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
285
+ moduloStep: z.ZodOptional<z.ZodBoolean>;
286
+ toolName: z.ZodOptional<z.ZodString>;
287
+ period: z.ZodOptional<z.ZodNumber>;
288
+ minStep: z.ZodOptional<z.ZodNumber>;
289
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ kind: string;
292
+ value?: string | number | boolean | undefined;
293
+ toolName?: string | undefined;
294
+ threshold?: number | undefined;
295
+ moduloStep?: boolean | undefined;
296
+ period?: number | undefined;
297
+ minStep?: number | undefined;
298
+ config?: Record<string, SerializableJsonValue> | undefined;
299
+ }, {
300
+ kind: string;
301
+ value?: string | number | boolean | undefined;
302
+ toolName?: string | undefined;
303
+ threshold?: number | undefined;
304
+ moduloStep?: boolean | undefined;
305
+ period?: number | undefined;
306
+ minStep?: number | undefined;
307
+ config?: Record<string, SerializableJsonValue> | undefined;
308
+ }>;
309
+ contentTemplate: z.ZodString;
310
+ contentArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ id: string;
313
+ trigger: {
314
+ kind: string;
315
+ value?: string | number | boolean | undefined;
316
+ toolName?: string | undefined;
317
+ threshold?: number | undefined;
318
+ moduloStep?: boolean | undefined;
319
+ period?: number | undefined;
320
+ minStep?: number | undefined;
321
+ config?: Record<string, SerializableJsonValue> | undefined;
322
+ };
323
+ contentTemplate: string;
324
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
325
+ }, {
326
+ id: string;
327
+ trigger: {
328
+ kind: string;
329
+ value?: string | number | boolean | undefined;
330
+ toolName?: string | undefined;
331
+ threshold?: number | undefined;
332
+ moduloStep?: boolean | undefined;
333
+ period?: number | undefined;
334
+ minStep?: number | undefined;
335
+ config?: Record<string, SerializableJsonValue> | undefined;
336
+ };
337
+ contentTemplate: string;
338
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
339
+ }>;
340
+ type AgentSpecSystemReminderExtraRule = z.infer<typeof AgentSpecSystemReminderExtraRule>;
341
+ declare const AgentSpecSystemReminderPolicy: z.ZodEffects<z.ZodObject<{
342
+ enabledRuleIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
343
+ disabledRuleIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
344
+ thresholds: z.ZodOptional<z.ZodObject<{
345
+ toolCallStreak: z.ZodOptional<z.ZodNumber>;
346
+ periodicReflectionPeriod: z.ZodOptional<z.ZodNumber>;
347
+ lastStepsHintThreshold: z.ZodOptional<z.ZodNumber>;
348
+ }, "strip", z.ZodTypeAny, {
349
+ toolCallStreak?: number | undefined;
350
+ periodicReflectionPeriod?: number | undefined;
351
+ lastStepsHintThreshold?: number | undefined;
352
+ }, {
353
+ toolCallStreak?: number | undefined;
354
+ periodicReflectionPeriod?: number | undefined;
355
+ lastStepsHintThreshold?: number | undefined;
356
+ }>>;
357
+ extraRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
358
+ id: z.ZodString;
359
+ trigger: z.ZodObject<{
360
+ kind: z.ZodString;
361
+ threshold: z.ZodOptional<z.ZodNumber>;
362
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
363
+ moduloStep: z.ZodOptional<z.ZodBoolean>;
364
+ toolName: z.ZodOptional<z.ZodString>;
365
+ period: z.ZodOptional<z.ZodNumber>;
366
+ minStep: z.ZodOptional<z.ZodNumber>;
367
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
368
+ }, "strip", z.ZodTypeAny, {
369
+ kind: string;
370
+ value?: string | number | boolean | undefined;
371
+ toolName?: string | undefined;
372
+ threshold?: number | undefined;
373
+ moduloStep?: boolean | undefined;
374
+ period?: number | undefined;
375
+ minStep?: number | undefined;
376
+ config?: Record<string, SerializableJsonValue> | undefined;
377
+ }, {
378
+ kind: string;
379
+ value?: string | number | boolean | undefined;
380
+ toolName?: string | undefined;
381
+ threshold?: number | undefined;
382
+ moduloStep?: boolean | undefined;
383
+ period?: number | undefined;
384
+ minStep?: number | undefined;
385
+ config?: Record<string, SerializableJsonValue> | undefined;
386
+ }>;
387
+ contentTemplate: z.ZodString;
388
+ contentArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ id: string;
391
+ trigger: {
392
+ kind: string;
393
+ value?: string | number | boolean | undefined;
394
+ toolName?: string | undefined;
395
+ threshold?: number | undefined;
396
+ moduloStep?: boolean | undefined;
397
+ period?: number | undefined;
398
+ minStep?: number | undefined;
399
+ config?: Record<string, SerializableJsonValue> | undefined;
400
+ };
401
+ contentTemplate: string;
402
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
403
+ }, {
404
+ id: string;
405
+ trigger: {
406
+ kind: string;
407
+ value?: string | number | boolean | undefined;
408
+ toolName?: string | undefined;
409
+ threshold?: number | undefined;
410
+ moduloStep?: boolean | undefined;
411
+ period?: number | undefined;
412
+ minStep?: number | undefined;
413
+ config?: Record<string, SerializableJsonValue> | undefined;
414
+ };
415
+ contentTemplate: string;
416
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
417
+ }>, "many">>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ enabledRuleIds?: string[] | null | undefined;
420
+ disabledRuleIds?: string[] | undefined;
421
+ thresholds?: {
422
+ toolCallStreak?: number | undefined;
423
+ periodicReflectionPeriod?: number | undefined;
424
+ lastStepsHintThreshold?: number | undefined;
425
+ } | undefined;
426
+ extraRules?: {
427
+ id: string;
428
+ trigger: {
429
+ kind: string;
430
+ value?: string | number | boolean | undefined;
431
+ toolName?: string | undefined;
432
+ threshold?: number | undefined;
433
+ moduloStep?: boolean | undefined;
434
+ period?: number | undefined;
435
+ minStep?: number | undefined;
436
+ config?: Record<string, SerializableJsonValue> | undefined;
437
+ };
438
+ contentTemplate: string;
439
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
440
+ }[] | undefined;
441
+ }, {
442
+ enabledRuleIds?: string[] | null | undefined;
443
+ disabledRuleIds?: string[] | undefined;
444
+ thresholds?: {
445
+ toolCallStreak?: number | undefined;
446
+ periodicReflectionPeriod?: number | undefined;
447
+ lastStepsHintThreshold?: number | undefined;
448
+ } | undefined;
449
+ extraRules?: {
450
+ id: string;
451
+ trigger: {
452
+ kind: string;
453
+ value?: string | number | boolean | undefined;
454
+ toolName?: string | undefined;
455
+ threshold?: number | undefined;
456
+ moduloStep?: boolean | undefined;
457
+ period?: number | undefined;
458
+ minStep?: number | undefined;
459
+ config?: Record<string, SerializableJsonValue> | undefined;
460
+ };
461
+ contentTemplate: string;
462
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
463
+ }[] | undefined;
464
+ }>, {
465
+ enabledRuleIds?: string[] | null | undefined;
466
+ disabledRuleIds?: string[] | undefined;
467
+ thresholds?: {
468
+ toolCallStreak?: number | undefined;
469
+ periodicReflectionPeriod?: number | undefined;
470
+ lastStepsHintThreshold?: number | undefined;
471
+ } | undefined;
472
+ extraRules?: {
473
+ id: string;
474
+ trigger: {
475
+ kind: string;
476
+ value?: string | number | boolean | undefined;
477
+ toolName?: string | undefined;
478
+ threshold?: number | undefined;
479
+ moduloStep?: boolean | undefined;
480
+ period?: number | undefined;
481
+ minStep?: number | undefined;
482
+ config?: Record<string, SerializableJsonValue> | undefined;
483
+ };
484
+ contentTemplate: string;
485
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
486
+ }[] | undefined;
487
+ }, {
488
+ enabledRuleIds?: string[] | null | undefined;
489
+ disabledRuleIds?: string[] | undefined;
490
+ thresholds?: {
491
+ toolCallStreak?: number | undefined;
492
+ periodicReflectionPeriod?: number | undefined;
493
+ lastStepsHintThreshold?: number | undefined;
494
+ } | undefined;
495
+ extraRules?: {
496
+ id: string;
497
+ trigger: {
498
+ kind: string;
499
+ value?: string | number | boolean | undefined;
500
+ toolName?: string | undefined;
501
+ threshold?: number | undefined;
502
+ moduloStep?: boolean | undefined;
503
+ period?: number | undefined;
504
+ minStep?: number | undefined;
505
+ config?: Record<string, SerializableJsonValue> | undefined;
506
+ };
507
+ contentTemplate: string;
508
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
509
+ }[] | undefined;
510
+ }>;
511
+ type AgentSpecSystemReminderPolicy = z.infer<typeof AgentSpecSystemReminderPolicy>;
512
+ declare const AgentSpecContextTracePolicy: z.ZodObject<{
513
+ enabled: z.ZodOptional<z.ZodBoolean>;
514
+ includeMessageIds: z.ZodOptional<z.ZodBoolean>;
515
+ includeTokenBreakdown: z.ZodOptional<z.ZodBoolean>;
516
+ maxTraceEvents: z.ZodOptional<z.ZodNumber>;
517
+ }, "strip", z.ZodTypeAny, {
518
+ enabled?: boolean | undefined;
519
+ includeMessageIds?: boolean | undefined;
520
+ includeTokenBreakdown?: boolean | undefined;
521
+ maxTraceEvents?: number | undefined;
522
+ }, {
523
+ enabled?: boolean | undefined;
524
+ includeMessageIds?: boolean | undefined;
525
+ includeTokenBreakdown?: boolean | undefined;
526
+ maxTraceEvents?: number | undefined;
527
+ }>;
528
+ type AgentSpecContextTracePolicy = z.infer<typeof AgentSpecContextTracePolicy>;
529
+ declare const AgentSpecContextPolicy: z.ZodObject<{
530
+ profileId: z.ZodString;
531
+ budget: z.ZodOptional<z.ZodObject<{
532
+ maxTokens: z.ZodOptional<z.ZodNumber>;
533
+ reservedForResponse: z.ZodOptional<z.ZodNumber>;
534
+ workingMemoryBudgetPercentage: z.ZodOptional<z.ZodNumber>;
535
+ }, "strip", z.ZodTypeAny, {
536
+ maxTokens?: number | undefined;
537
+ reservedForResponse?: number | undefined;
538
+ workingMemoryBudgetPercentage?: number | undefined;
539
+ }, {
540
+ maxTokens?: number | undefined;
541
+ reservedForResponse?: number | undefined;
542
+ workingMemoryBudgetPercentage?: number | undefined;
543
+ }>>;
544
+ toolHistory: z.ZodOptional<z.ZodObject<{
545
+ strategy: z.ZodOptional<z.ZodEnum<["per-pair", "per-run", "none"]>>;
546
+ retentionMode: z.ZodOptional<z.ZodEnum<["drop", "compress"]>>;
547
+ keepLatestToolPairs: z.ZodOptional<z.ZodNumber>;
548
+ keepLatestRuns: z.ZodOptional<z.ZodNumber>;
549
+ maxInteractionGroups: z.ZodOptional<z.ZodNumber>;
550
+ overflowStrategy: z.ZodOptional<z.ZodEnum<["keep-latest", "fail-fast"]>>;
551
+ }, "strip", z.ZodTypeAny, {
552
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
553
+ retentionMode?: "drop" | "compress" | undefined;
554
+ keepLatestToolPairs?: number | undefined;
555
+ keepLatestRuns?: number | undefined;
556
+ maxInteractionGroups?: number | undefined;
557
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
558
+ }, {
559
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
560
+ retentionMode?: "drop" | "compress" | undefined;
561
+ keepLatestToolPairs?: number | undefined;
562
+ keepLatestRuns?: number | undefined;
563
+ maxInteractionGroups?: number | undefined;
564
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
565
+ }>>;
566
+ toolOutput: z.ZodOptional<z.ZodObject<{
567
+ observationGovernance: z.ZodOptional<z.ZodObject<{
568
+ enabled: z.ZodOptional<z.ZodBoolean>;
569
+ maxChars: z.ZodOptional<z.ZodNumber>;
570
+ maxLines: z.ZodOptional<z.ZodNumber>;
571
+ }, "strip", z.ZodTypeAny, {
572
+ enabled?: boolean | undefined;
573
+ maxChars?: number | undefined;
574
+ maxLines?: number | undefined;
575
+ }, {
576
+ enabled?: boolean | undefined;
577
+ maxChars?: number | undefined;
578
+ maxLines?: number | undefined;
579
+ }>>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ observationGovernance?: {
582
+ enabled?: boolean | undefined;
583
+ maxChars?: number | undefined;
584
+ maxLines?: number | undefined;
585
+ } | undefined;
586
+ }, {
587
+ observationGovernance?: {
588
+ enabled?: boolean | undefined;
589
+ maxChars?: number | undefined;
590
+ maxLines?: number | undefined;
591
+ } | undefined;
592
+ }>>;
593
+ compaction: z.ZodOptional<z.ZodEffects<z.ZodObject<{
594
+ enabled: z.ZodOptional<z.ZodBoolean>;
595
+ triggerRatio: z.ZodOptional<z.ZodNumber>;
596
+ targetRatio: z.ZodOptional<z.ZodNumber>;
597
+ keepLatestToolGroups: z.ZodOptional<z.ZodNumber>;
598
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
599
+ maxCompactionsPerRun: z.ZodOptional<z.ZodNumber>;
600
+ }, "strip", z.ZodTypeAny, {
601
+ enabled?: boolean | undefined;
602
+ triggerRatio?: number | undefined;
603
+ targetRatio?: number | undefined;
604
+ keepLatestToolGroups?: number | undefined;
605
+ maxOutputTokens?: number | undefined;
606
+ maxCompactionsPerRun?: number | undefined;
607
+ }, {
608
+ enabled?: boolean | undefined;
609
+ triggerRatio?: number | undefined;
610
+ targetRatio?: number | undefined;
611
+ keepLatestToolGroups?: number | undefined;
612
+ maxOutputTokens?: number | undefined;
613
+ maxCompactionsPerRun?: number | undefined;
614
+ }>, {
615
+ enabled?: boolean | undefined;
616
+ triggerRatio?: number | undefined;
617
+ targetRatio?: number | undefined;
618
+ keepLatestToolGroups?: number | undefined;
619
+ maxOutputTokens?: number | undefined;
620
+ maxCompactionsPerRun?: number | undefined;
621
+ }, {
622
+ enabled?: boolean | undefined;
623
+ triggerRatio?: number | undefined;
624
+ targetRatio?: number | undefined;
625
+ keepLatestToolGroups?: number | undefined;
626
+ maxOutputTokens?: number | undefined;
627
+ maxCompactionsPerRun?: number | undefined;
628
+ }>>;
629
+ mustKeep: z.ZodOptional<z.ZodObject<{
630
+ 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
+ alwaysKeepFenceKinds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
632
+ truncationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
633
+ fenceKind: z.ZodString;
634
+ maxBudgetFraction: z.ZodNumber;
635
+ strategyName: z.ZodString;
636
+ }, "strip", z.ZodTypeAny, {
637
+ fenceKind: string;
638
+ maxBudgetFraction: number;
639
+ strategyName: string;
640
+ }, {
641
+ fenceKind: string;
642
+ maxBudgetFraction: number;
643
+ strategyName: string;
644
+ }>, "many">>;
645
+ }, "strip", z.ZodTypeAny, {
646
+ 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
+ alwaysKeepFenceKinds?: string[] | undefined;
648
+ truncationRules?: {
649
+ fenceKind: string;
650
+ maxBudgetFraction: number;
651
+ strategyName: string;
652
+ }[] | undefined;
653
+ }, {
654
+ 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
+ alwaysKeepFenceKinds?: string[] | undefined;
656
+ truncationRules?: {
657
+ fenceKind: string;
658
+ maxBudgetFraction: number;
659
+ strategyName: string;
660
+ }[] | undefined;
661
+ }>>;
662
+ workingMemory: z.ZodOptional<z.ZodObject<{
663
+ maxRecentToolRuns: z.ZodOptional<z.ZodNumber>;
664
+ /** @deprecated Use maxRecentToolRuns. Kept as a compatibility alias for older AgentSpec configs. */
665
+ maxRecentToolInteractions: z.ZodOptional<z.ZodNumber>;
666
+ minToolInteractionsToKeep: z.ZodOptional<z.ZodNumber>;
667
+ toolPairingSearchRange: z.ZodOptional<z.ZodNumber>;
668
+ }, "strip", z.ZodTypeAny, {
669
+ maxRecentToolRuns?: number | undefined;
670
+ maxRecentToolInteractions?: number | undefined;
671
+ minToolInteractionsToKeep?: number | undefined;
672
+ toolPairingSearchRange?: number | undefined;
673
+ }, {
674
+ maxRecentToolRuns?: number | undefined;
675
+ maxRecentToolInteractions?: number | undefined;
676
+ minToolInteractionsToKeep?: number | undefined;
677
+ toolPairingSearchRange?: number | undefined;
678
+ }>>;
679
+ tokenEstimation: z.ZodOptional<z.ZodObject<{
680
+ encoding: z.ZodOptional<z.ZodString>;
681
+ avgCharsPerToken: z.ZodOptional<z.ZodNumber>;
682
+ toolCallOverhead: z.ZodOptional<z.ZodNumber>;
683
+ calibration: z.ZodOptional<z.ZodObject<{
684
+ enabled: z.ZodOptional<z.ZodBoolean>;
685
+ minSamples: z.ZodOptional<z.ZodNumber>;
686
+ minCoefficient: z.ZodOptional<z.ZodNumber>;
687
+ maxCoefficient: z.ZodOptional<z.ZodNumber>;
688
+ }, "strip", z.ZodTypeAny, {
689
+ enabled?: boolean | undefined;
690
+ minSamples?: number | undefined;
691
+ minCoefficient?: number | undefined;
692
+ maxCoefficient?: number | undefined;
693
+ }, {
694
+ enabled?: boolean | undefined;
695
+ minSamples?: number | undefined;
696
+ minCoefficient?: number | undefined;
697
+ maxCoefficient?: number | undefined;
698
+ }>>;
699
+ remoteCount: z.ZodOptional<z.ZodObject<{
700
+ enabled: z.ZodOptional<z.ZodBoolean>;
701
+ failureBehavior: z.ZodOptional<z.ZodEnum<["use-local-estimate", "fail-fast"]>>;
702
+ }, "strip", z.ZodTypeAny, {
703
+ enabled?: boolean | undefined;
704
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
705
+ }, {
706
+ enabled?: boolean | undefined;
707
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
708
+ }>>;
709
+ }, "strip", z.ZodTypeAny, {
710
+ encoding?: string | undefined;
711
+ avgCharsPerToken?: number | undefined;
712
+ toolCallOverhead?: number | undefined;
713
+ calibration?: {
714
+ enabled?: boolean | undefined;
715
+ minSamples?: number | undefined;
716
+ minCoefficient?: number | undefined;
717
+ maxCoefficient?: number | undefined;
718
+ } | undefined;
719
+ remoteCount?: {
720
+ enabled?: boolean | undefined;
721
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
722
+ } | undefined;
723
+ }, {
724
+ encoding?: string | undefined;
725
+ avgCharsPerToken?: number | undefined;
726
+ toolCallOverhead?: number | undefined;
727
+ calibration?: {
728
+ enabled?: boolean | undefined;
729
+ minSamples?: number | undefined;
730
+ minCoefficient?: number | undefined;
731
+ maxCoefficient?: number | undefined;
732
+ } | undefined;
733
+ remoteCount?: {
734
+ enabled?: boolean | undefined;
735
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
736
+ } | undefined;
737
+ }>>;
738
+ systemReminder: z.ZodOptional<z.ZodEffects<z.ZodObject<{
739
+ enabledRuleIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
740
+ disabledRuleIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
741
+ thresholds: z.ZodOptional<z.ZodObject<{
742
+ toolCallStreak: z.ZodOptional<z.ZodNumber>;
743
+ periodicReflectionPeriod: z.ZodOptional<z.ZodNumber>;
744
+ lastStepsHintThreshold: z.ZodOptional<z.ZodNumber>;
745
+ }, "strip", z.ZodTypeAny, {
746
+ toolCallStreak?: number | undefined;
747
+ periodicReflectionPeriod?: number | undefined;
748
+ lastStepsHintThreshold?: number | undefined;
749
+ }, {
750
+ toolCallStreak?: number | undefined;
751
+ periodicReflectionPeriod?: number | undefined;
752
+ lastStepsHintThreshold?: number | undefined;
753
+ }>>;
754
+ extraRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
755
+ id: z.ZodString;
756
+ trigger: z.ZodObject<{
757
+ kind: z.ZodString;
758
+ threshold: z.ZodOptional<z.ZodNumber>;
759
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
760
+ moduloStep: z.ZodOptional<z.ZodBoolean>;
761
+ toolName: z.ZodOptional<z.ZodString>;
762
+ period: z.ZodOptional<z.ZodNumber>;
763
+ minStep: z.ZodOptional<z.ZodNumber>;
764
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
765
+ }, "strip", z.ZodTypeAny, {
766
+ kind: string;
767
+ value?: string | number | boolean | undefined;
768
+ toolName?: string | undefined;
769
+ threshold?: number | undefined;
770
+ moduloStep?: boolean | undefined;
771
+ period?: number | undefined;
772
+ minStep?: number | undefined;
773
+ config?: Record<string, SerializableJsonValue> | undefined;
774
+ }, {
775
+ kind: string;
776
+ value?: string | number | boolean | undefined;
777
+ toolName?: string | undefined;
778
+ threshold?: number | undefined;
779
+ moduloStep?: boolean | undefined;
780
+ period?: number | undefined;
781
+ minStep?: number | undefined;
782
+ config?: Record<string, SerializableJsonValue> | undefined;
783
+ }>;
784
+ contentTemplate: z.ZodString;
785
+ contentArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ id: string;
788
+ trigger: {
789
+ kind: string;
790
+ value?: string | number | boolean | undefined;
791
+ toolName?: string | undefined;
792
+ threshold?: number | undefined;
793
+ moduloStep?: boolean | undefined;
794
+ period?: number | undefined;
795
+ minStep?: number | undefined;
796
+ config?: Record<string, SerializableJsonValue> | undefined;
797
+ };
798
+ contentTemplate: string;
799
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
800
+ }, {
801
+ id: string;
802
+ trigger: {
803
+ kind: string;
804
+ value?: string | number | boolean | undefined;
805
+ toolName?: string | undefined;
806
+ threshold?: number | undefined;
807
+ moduloStep?: boolean | undefined;
808
+ period?: number | undefined;
809
+ minStep?: number | undefined;
810
+ config?: Record<string, SerializableJsonValue> | undefined;
811
+ };
812
+ contentTemplate: string;
813
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
814
+ }>, "many">>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ enabledRuleIds?: string[] | null | undefined;
817
+ disabledRuleIds?: string[] | undefined;
818
+ thresholds?: {
819
+ toolCallStreak?: number | undefined;
820
+ periodicReflectionPeriod?: number | undefined;
821
+ lastStepsHintThreshold?: number | undefined;
822
+ } | undefined;
823
+ extraRules?: {
824
+ id: string;
825
+ trigger: {
826
+ kind: string;
827
+ value?: string | number | boolean | undefined;
828
+ toolName?: string | undefined;
829
+ threshold?: number | undefined;
830
+ moduloStep?: boolean | undefined;
831
+ period?: number | undefined;
832
+ minStep?: number | undefined;
833
+ config?: Record<string, SerializableJsonValue> | undefined;
834
+ };
835
+ contentTemplate: string;
836
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
837
+ }[] | undefined;
838
+ }, {
839
+ enabledRuleIds?: string[] | null | undefined;
840
+ disabledRuleIds?: string[] | undefined;
841
+ thresholds?: {
842
+ toolCallStreak?: number | undefined;
843
+ periodicReflectionPeriod?: number | undefined;
844
+ lastStepsHintThreshold?: number | undefined;
845
+ } | undefined;
846
+ extraRules?: {
847
+ id: string;
848
+ trigger: {
849
+ kind: string;
850
+ value?: string | number | boolean | undefined;
851
+ toolName?: string | undefined;
852
+ threshold?: number | undefined;
853
+ moduloStep?: boolean | undefined;
854
+ period?: number | undefined;
855
+ minStep?: number | undefined;
856
+ config?: Record<string, SerializableJsonValue> | undefined;
857
+ };
858
+ contentTemplate: string;
859
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
860
+ }[] | undefined;
861
+ }>, {
862
+ enabledRuleIds?: string[] | null | undefined;
863
+ disabledRuleIds?: string[] | undefined;
864
+ thresholds?: {
865
+ toolCallStreak?: number | undefined;
866
+ periodicReflectionPeriod?: number | undefined;
867
+ lastStepsHintThreshold?: number | undefined;
868
+ } | undefined;
869
+ extraRules?: {
870
+ id: string;
871
+ trigger: {
872
+ kind: string;
873
+ value?: string | number | boolean | undefined;
874
+ toolName?: string | undefined;
875
+ threshold?: number | undefined;
876
+ moduloStep?: boolean | undefined;
877
+ period?: number | undefined;
878
+ minStep?: number | undefined;
879
+ config?: Record<string, SerializableJsonValue> | undefined;
880
+ };
881
+ contentTemplate: string;
882
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
883
+ }[] | undefined;
884
+ }, {
885
+ enabledRuleIds?: string[] | null | undefined;
886
+ disabledRuleIds?: string[] | undefined;
887
+ thresholds?: {
888
+ toolCallStreak?: number | undefined;
889
+ periodicReflectionPeriod?: number | undefined;
890
+ lastStepsHintThreshold?: number | undefined;
891
+ } | undefined;
892
+ extraRules?: {
893
+ id: string;
894
+ trigger: {
895
+ kind: string;
896
+ value?: string | number | boolean | undefined;
897
+ toolName?: string | undefined;
898
+ threshold?: number | undefined;
899
+ moduloStep?: boolean | undefined;
900
+ period?: number | undefined;
901
+ minStep?: number | undefined;
902
+ config?: Record<string, SerializableJsonValue> | undefined;
903
+ };
904
+ contentTemplate: string;
905
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
906
+ }[] | undefined;
907
+ }>>;
908
+ contextTrace: z.ZodOptional<z.ZodObject<{
909
+ enabled: z.ZodOptional<z.ZodBoolean>;
910
+ includeMessageIds: z.ZodOptional<z.ZodBoolean>;
911
+ includeTokenBreakdown: z.ZodOptional<z.ZodBoolean>;
912
+ maxTraceEvents: z.ZodOptional<z.ZodNumber>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ enabled?: boolean | undefined;
915
+ includeMessageIds?: boolean | undefined;
916
+ includeTokenBreakdown?: boolean | undefined;
917
+ maxTraceEvents?: number | undefined;
918
+ }, {
919
+ enabled?: boolean | undefined;
920
+ includeMessageIds?: boolean | undefined;
921
+ includeTokenBreakdown?: boolean | undefined;
922
+ maxTraceEvents?: number | undefined;
923
+ }>>;
924
+ }, "strict", z.ZodTypeAny, {
925
+ profileId: string;
926
+ budget?: {
927
+ maxTokens?: number | undefined;
928
+ reservedForResponse?: number | undefined;
929
+ workingMemoryBudgetPercentage?: number | undefined;
930
+ } | undefined;
931
+ toolHistory?: {
932
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
933
+ retentionMode?: "drop" | "compress" | undefined;
934
+ keepLatestToolPairs?: number | undefined;
935
+ keepLatestRuns?: number | undefined;
936
+ maxInteractionGroups?: number | undefined;
937
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
938
+ } | undefined;
939
+ toolOutput?: {
940
+ observationGovernance?: {
941
+ enabled?: boolean | undefined;
942
+ maxChars?: number | undefined;
943
+ maxLines?: number | undefined;
944
+ } | undefined;
945
+ } | undefined;
946
+ compaction?: {
947
+ enabled?: boolean | undefined;
948
+ triggerRatio?: number | undefined;
949
+ targetRatio?: number | undefined;
950
+ keepLatestToolGroups?: number | undefined;
951
+ maxOutputTokens?: number | undefined;
952
+ maxCompactionsPerRun?: number | undefined;
953
+ } | undefined;
954
+ mustKeep?: {
955
+ 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;
956
+ alwaysKeepFenceKinds?: string[] | undefined;
957
+ truncationRules?: {
958
+ fenceKind: string;
959
+ maxBudgetFraction: number;
960
+ strategyName: string;
961
+ }[] | undefined;
962
+ } | undefined;
963
+ workingMemory?: {
964
+ maxRecentToolRuns?: number | undefined;
965
+ maxRecentToolInteractions?: number | undefined;
966
+ minToolInteractionsToKeep?: number | undefined;
967
+ toolPairingSearchRange?: number | undefined;
968
+ } | undefined;
969
+ tokenEstimation?: {
970
+ encoding?: string | undefined;
971
+ avgCharsPerToken?: number | undefined;
972
+ toolCallOverhead?: number | undefined;
973
+ calibration?: {
974
+ enabled?: boolean | undefined;
975
+ minSamples?: number | undefined;
976
+ minCoefficient?: number | undefined;
977
+ maxCoefficient?: number | undefined;
978
+ } | undefined;
979
+ remoteCount?: {
980
+ enabled?: boolean | undefined;
981
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
982
+ } | undefined;
983
+ } | undefined;
984
+ systemReminder?: {
985
+ enabledRuleIds?: string[] | null | undefined;
986
+ disabledRuleIds?: string[] | undefined;
987
+ thresholds?: {
988
+ toolCallStreak?: number | undefined;
989
+ periodicReflectionPeriod?: number | undefined;
990
+ lastStepsHintThreshold?: number | undefined;
991
+ } | undefined;
992
+ extraRules?: {
993
+ id: string;
994
+ trigger: {
995
+ kind: string;
996
+ value?: string | number | boolean | undefined;
997
+ toolName?: string | undefined;
998
+ threshold?: number | undefined;
999
+ moduloStep?: boolean | undefined;
1000
+ period?: number | undefined;
1001
+ minStep?: number | undefined;
1002
+ config?: Record<string, SerializableJsonValue> | undefined;
1003
+ };
1004
+ contentTemplate: string;
1005
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
1006
+ }[] | undefined;
1007
+ } | undefined;
1008
+ contextTrace?: {
1009
+ enabled?: boolean | undefined;
1010
+ includeMessageIds?: boolean | undefined;
1011
+ includeTokenBreakdown?: boolean | undefined;
1012
+ maxTraceEvents?: number | undefined;
1013
+ } | undefined;
1014
+ }, {
1015
+ profileId: string;
1016
+ budget?: {
1017
+ maxTokens?: number | undefined;
1018
+ reservedForResponse?: number | undefined;
1019
+ workingMemoryBudgetPercentage?: number | undefined;
1020
+ } | undefined;
1021
+ toolHistory?: {
1022
+ strategy?: "none" | "per-pair" | "per-run" | undefined;
1023
+ retentionMode?: "drop" | "compress" | undefined;
1024
+ keepLatestToolPairs?: number | undefined;
1025
+ keepLatestRuns?: number | undefined;
1026
+ maxInteractionGroups?: number | undefined;
1027
+ overflowStrategy?: "keep-latest" | "fail-fast" | undefined;
1028
+ } | undefined;
1029
+ toolOutput?: {
1030
+ observationGovernance?: {
1031
+ enabled?: boolean | undefined;
1032
+ maxChars?: number | undefined;
1033
+ maxLines?: number | undefined;
1034
+ } | undefined;
1035
+ } | undefined;
1036
+ compaction?: {
1037
+ enabled?: boolean | undefined;
1038
+ triggerRatio?: number | undefined;
1039
+ targetRatio?: number | undefined;
1040
+ keepLatestToolGroups?: number | undefined;
1041
+ maxOutputTokens?: number | undefined;
1042
+ maxCompactionsPerRun?: number | undefined;
1043
+ } | undefined;
1044
+ mustKeep?: {
1045
+ 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;
1046
+ alwaysKeepFenceKinds?: string[] | undefined;
1047
+ truncationRules?: {
1048
+ fenceKind: string;
1049
+ maxBudgetFraction: number;
1050
+ strategyName: string;
1051
+ }[] | undefined;
1052
+ } | undefined;
1053
+ workingMemory?: {
1054
+ maxRecentToolRuns?: number | undefined;
1055
+ maxRecentToolInteractions?: number | undefined;
1056
+ minToolInteractionsToKeep?: number | undefined;
1057
+ toolPairingSearchRange?: number | undefined;
1058
+ } | undefined;
1059
+ tokenEstimation?: {
1060
+ encoding?: string | undefined;
1061
+ avgCharsPerToken?: number | undefined;
1062
+ toolCallOverhead?: number | undefined;
1063
+ calibration?: {
1064
+ enabled?: boolean | undefined;
1065
+ minSamples?: number | undefined;
1066
+ minCoefficient?: number | undefined;
1067
+ maxCoefficient?: number | undefined;
1068
+ } | undefined;
1069
+ remoteCount?: {
1070
+ enabled?: boolean | undefined;
1071
+ failureBehavior?: "fail-fast" | "use-local-estimate" | undefined;
1072
+ } | undefined;
1073
+ } | undefined;
1074
+ systemReminder?: {
1075
+ enabledRuleIds?: string[] | null | undefined;
1076
+ disabledRuleIds?: string[] | undefined;
1077
+ thresholds?: {
1078
+ toolCallStreak?: number | undefined;
1079
+ periodicReflectionPeriod?: number | undefined;
1080
+ lastStepsHintThreshold?: number | undefined;
1081
+ } | undefined;
1082
+ extraRules?: {
1083
+ id: string;
1084
+ trigger: {
1085
+ kind: string;
1086
+ value?: string | number | boolean | undefined;
1087
+ toolName?: string | undefined;
1088
+ threshold?: number | undefined;
1089
+ moduloStep?: boolean | undefined;
1090
+ period?: number | undefined;
1091
+ minStep?: number | undefined;
1092
+ config?: Record<string, SerializableJsonValue> | undefined;
1093
+ };
1094
+ contentTemplate: string;
1095
+ contentArgs?: Record<string, SerializableJsonValue> | undefined;
1096
+ }[] | undefined;
1097
+ } | undefined;
1098
+ contextTrace?: {
1099
+ enabled?: boolean | undefined;
1100
+ includeMessageIds?: boolean | undefined;
1101
+ includeTokenBreakdown?: boolean | undefined;
1102
+ maxTraceEvents?: number | undefined;
1103
+ } | undefined;
1104
+ }>;
1105
+ type AgentSpecContextPolicy = z.infer<typeof AgentSpecContextPolicy>;
1106
+ type AgentSpecContextPolicyInput = Omit<z.input<typeof AgentSpecContextPolicy>, 'profileId'> & {
1107
+ profileId?: string;
1108
+ };
1109
+ /**
1110
+ * 创建完整 contextPolicy。
1111
+ *
1112
+ * 中文备注:
1113
+ * - schema 保持 optional,避免现有 host 的 `{ profileId: 'agent' }` 类型大面积变红;
1114
+ * - 框架拥有的行为策略在这里补齐;
1115
+ * - `budget.maxTokens` 与 `budget.reservedForResponse` 是 Agent 显式容量上限,
1116
+ * 未声明时必须保持缺失,让 orchestration 使用模型 route 能力。
1117
+ */
1118
+ declare function defineContextPolicy(input?: AgentSpecContextPolicyInput): AgentSpecContextPolicy;
1119
+
1120
+ export { AgentSpecBudgetPolicy, AgentSpecContextCompactionPolicy, AgentSpecContextPolicy, AgentSpecContextTracePolicy, AgentSpecMessageType, AgentSpecMustKeepPolicy, AgentSpecMustKeepTruncationRule, AgentSpecSystemReminderExtraRule, AgentSpecSystemReminderPolicy, AgentSpecSystemReminderTrigger, AgentSpecTokenEstimationPolicy, AgentSpecToolHistoryPolicy, AgentSpecToolObservationGovernancePolicy, AgentSpecToolOutputPolicy, AgentSpecWorkingMemoryPolicy, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS, defineContextPolicy };
1121
+ export type { AgentSpecContextPolicyInput };