@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
@@ -1,46 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const CONTEXT_COMPACTION_FAILED_ERROR_CODE: "llm.context.compaction_failed";
4
- declare const CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE: "llm.context.compaction_insufficient";
5
- type ContextCompactionErrorCode = typeof CONTEXT_COMPACTION_FAILED_ERROR_CODE | typeof CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE;
6
- /**
7
- * Context Manager 生成的纯压缩计划。
8
- *
9
- * 中文备注:计划只描述“摘要提交后替换哪些正式消息”以及本次完整 Prompt 的来源身份,
10
- * 不携带另一份模型输入、LLM、Provider 或事件发布能力。Graph 只消费该计划,
11
- * 压缩模型始终读取当前 tick 已完成 Reminder 注入的完整 Prompt。
12
- */
13
- interface ContextCompactionPlan {
14
- readonly fingerprint: string;
15
- readonly sourceMessageIds: readonly string[];
16
- readonly replacedMessageIds: readonly string[];
17
- readonly originalMessageCount: number;
18
- readonly includedOldSummary: boolean;
19
- readonly nextSummarySeq: number;
20
- readonly sourceTokenEstimate: number;
21
- readonly replacedTokenEstimate: number;
22
- readonly replacedToolGroupCount: number;
23
- readonly keptToolGroupCount: number;
24
- /** 当前连续可替换区段是否已全部选入;用于区分目标不可达与计划选小。 */
25
- readonly replaceableRangeExhausted: boolean;
26
- }
27
- /** Context Manager 交给 Graph 的短生命周期压缩计划。 */
28
- interface ContextCompactionCandidate {
29
- readonly plan: ContextCompactionPlan;
30
- readonly policy: ResolvedContextCompactionPolicy;
31
- readonly reminder: string;
32
- }
33
- /** 第一版统一的完整策略;AgentSpec optional 字段必须先解析成该形状再执行。 */
34
- interface ResolvedContextCompactionPolicy {
35
- readonly enabled: boolean;
36
- readonly triggerRatio: number;
37
- readonly targetRatio: number;
38
- readonly keepLatestToolGroups: number;
39
- readonly maxOutputTokens: number;
40
- readonly maxCompactionsPerRun: number;
41
- }
42
- declare const DEFAULT_CONTEXT_COMPACTION_POLICY: ResolvedContextCompactionPolicy;
43
-
44
3
  /**
45
4
  * 上下文预算校准样本。
46
5
  *
@@ -344,4 +303,4 @@ declare const ContextBuildTokenEstimate: z.ZodObject<{
344
303
  }>;
345
304
  type ContextBuildTokenEstimate = z.infer<typeof ContextBuildTokenEstimate>;
346
305
 
347
- export { ContextBuildTokenEstimate as C, DEFAULT_CONTEXT_COMPACTION_POLICY as D, type ResolvedContextCompactionPolicy as R, TokenUsageCalibrationTrace as T, TokenUsageCalibrationSample as a, type ContextCompactionCandidate as b, type ContextCompactionPlan as c, CONTEXT_COMPACTION_FAILED_ERROR_CODE as d, CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE as e, type ContextCompactionErrorCode as f };
306
+ export { ContextBuildTokenEstimate, TokenUsageCalibrationSample, TokenUsageCalibrationTrace };
@@ -1,46 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const CONTEXT_COMPACTION_FAILED_ERROR_CODE: "llm.context.compaction_failed";
4
- declare const CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE: "llm.context.compaction_insufficient";
5
- type ContextCompactionErrorCode = typeof CONTEXT_COMPACTION_FAILED_ERROR_CODE | typeof CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE;
6
- /**
7
- * Context Manager 生成的纯压缩计划。
8
- *
9
- * 中文备注:计划只描述“摘要提交后替换哪些正式消息”以及本次完整 Prompt 的来源身份,
10
- * 不携带另一份模型输入、LLM、Provider 或事件发布能力。Graph 只消费该计划,
11
- * 压缩模型始终读取当前 tick 已完成 Reminder 注入的完整 Prompt。
12
- */
13
- interface ContextCompactionPlan {
14
- readonly fingerprint: string;
15
- readonly sourceMessageIds: readonly string[];
16
- readonly replacedMessageIds: readonly string[];
17
- readonly originalMessageCount: number;
18
- readonly includedOldSummary: boolean;
19
- readonly nextSummarySeq: number;
20
- readonly sourceTokenEstimate: number;
21
- readonly replacedTokenEstimate: number;
22
- readonly replacedToolGroupCount: number;
23
- readonly keptToolGroupCount: number;
24
- /** 当前连续可替换区段是否已全部选入;用于区分目标不可达与计划选小。 */
25
- readonly replaceableRangeExhausted: boolean;
26
- }
27
- /** Context Manager 交给 Graph 的短生命周期压缩计划。 */
28
- interface ContextCompactionCandidate {
29
- readonly plan: ContextCompactionPlan;
30
- readonly policy: ResolvedContextCompactionPolicy;
31
- readonly reminder: string;
32
- }
33
- /** 第一版统一的完整策略;AgentSpec optional 字段必须先解析成该形状再执行。 */
34
- interface ResolvedContextCompactionPolicy {
35
- readonly enabled: boolean;
36
- readonly triggerRatio: number;
37
- readonly targetRatio: number;
38
- readonly keepLatestToolGroups: number;
39
- readonly maxOutputTokens: number;
40
- readonly maxCompactionsPerRun: number;
41
- }
42
- declare const DEFAULT_CONTEXT_COMPACTION_POLICY: ResolvedContextCompactionPolicy;
43
-
44
3
  /**
45
4
  * 上下文预算校准样本。
46
5
  *
@@ -344,4 +303,4 @@ declare const ContextBuildTokenEstimate: z.ZodObject<{
344
303
  }>;
345
304
  type ContextBuildTokenEstimate = z.infer<typeof ContextBuildTokenEstimate>;
346
305
 
347
- export { ContextBuildTokenEstimate as C, DEFAULT_CONTEXT_COMPACTION_POLICY as D, type ResolvedContextCompactionPolicy as R, TokenUsageCalibrationTrace as T, TokenUsageCalibrationSample as a, type ContextCompactionCandidate as b, type ContextCompactionPlan as c, CONTEXT_COMPACTION_FAILED_ERROR_CODE as d, CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE as e, type ContextCompactionErrorCode as f };
306
+ export { ContextBuildTokenEstimate, TokenUsageCalibrationSample, TokenUsageCalibrationTrace };
@@ -102,10 +102,10 @@ declare const CanonicalLlmUsage: z.ZodObject<{
102
102
  confidence: z.ZodEnum<["estimate", "provider-estimate", "actual"]>;
103
103
  rawUsage: z.ZodOptional<z.ZodUnknown>;
104
104
  }, "strip", z.ZodTypeAny, {
105
- inputTokens: number;
106
- outputTokens: number;
107
105
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
108
106
  confidence: "estimate" | "provider-estimate" | "actual";
107
+ inputTokens: number;
108
+ outputTokens: number;
109
109
  imageInputTokens?: number | undefined;
110
110
  reasoningTokens?: number | undefined;
111
111
  cacheReadTokens?: number | undefined;
@@ -113,10 +113,10 @@ declare const CanonicalLlmUsage: z.ZodObject<{
113
113
  totalTokens?: number | undefined;
114
114
  rawUsage?: unknown;
115
115
  }, {
116
- inputTokens: number;
117
- outputTokens: number;
118
116
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
119
117
  confidence: "estimate" | "provider-estimate" | "actual";
118
+ inputTokens: number;
119
+ outputTokens: number;
120
120
  imageInputTokens?: number | undefined;
121
121
  reasoningTokens?: number | undefined;
122
122
  cacheReadTokens?: number | undefined;
@@ -153,7 +153,6 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
153
153
  measured_at: z.ZodNumber;
154
154
  }, "strict", z.ZodTypeAny, {
155
155
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
156
- confidence: "estimate" | "provider-estimate" | "actual";
157
156
  basis: "last_completed_llm_prompt";
158
157
  budget_model_id: string;
159
158
  used_tokens: number;
@@ -166,11 +165,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
166
165
  input_budget_tokens: number;
167
166
  remaining_tokens: number;
168
167
  output_limit_tokens: number;
168
+ confidence: "estimate" | "provider-estimate" | "actual";
169
169
  measured_at: number;
170
170
  served_model_id?: string | undefined;
171
171
  }, {
172
172
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
173
- confidence: "estimate" | "provider-estimate" | "actual";
174
173
  basis: "last_completed_llm_prompt";
175
174
  budget_model_id: string;
176
175
  used_tokens: number;
@@ -183,11 +182,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
183
182
  input_budget_tokens: number;
184
183
  remaining_tokens: number;
185
184
  output_limit_tokens: number;
185
+ confidence: "estimate" | "provider-estimate" | "actual";
186
186
  measured_at: number;
187
187
  served_model_id?: string | undefined;
188
188
  }>, {
189
189
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
190
- confidence: "estimate" | "provider-estimate" | "actual";
191
190
  basis: "last_completed_llm_prompt";
192
191
  budget_model_id: string;
193
192
  used_tokens: number;
@@ -200,11 +199,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
200
199
  input_budget_tokens: number;
201
200
  remaining_tokens: number;
202
201
  output_limit_tokens: number;
202
+ confidence: "estimate" | "provider-estimate" | "actual";
203
203
  measured_at: number;
204
204
  served_model_id?: string | undefined;
205
205
  }, {
206
206
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
207
- confidence: "estimate" | "provider-estimate" | "actual";
208
207
  basis: "last_completed_llm_prompt";
209
208
  budget_model_id: string;
210
209
  used_tokens: number;
@@ -217,6 +216,7 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
217
216
  input_budget_tokens: number;
218
217
  remaining_tokens: number;
219
218
  output_limit_tokens: number;
219
+ confidence: "estimate" | "provider-estimate" | "actual";
220
220
  measured_at: number;
221
221
  served_model_id?: string | undefined;
222
222
  }>;
@@ -305,79 +305,4 @@ declare const PromptUsageMeasurementPolicy: z.ZodObject<{
305
305
  }>;
306
306
  type PromptUsageMeasurementPolicy = z.infer<typeof PromptUsageMeasurementPolicy>;
307
307
 
308
- /**
309
- * @file packages/linnkit/src/contracts/reasoning.ts
310
- *
311
- * @description
312
- * 思考努力程度(Reasoning Effort)的统一用户语义、模型能力契约与降级纯函数。
313
- *
314
- * 为什么放在 contracts 而非 runtime-kernel:
315
- * - `ReasoningEffort` 是基础枚举,需要被 `ports/llm-call.ts` 的 `LlmCallOptions`
316
- * 和 `runtime-kernel` 的 `ModelReasoningConfig` / `resolveEffectiveEffort` 共同使用;
317
- * - ports 不能 import runtime-kernel(会形成 ports ⇄ runtime-kernel 循环依赖),
318
- * 而 contracts 是 ports 与 runtime-kernel 都依赖的最底层共享类型层;
319
- * - 浏览器 consumer 应只 import `linnkit/contracts`,不能拖入 runtime-kernel 整包
320
- * (会间接拉到 `node:async_hooks` 等 Node-only 模块)。
321
- *
322
- * 语义从弱到强:off < minimal < low < medium < high < xhigh。
323
- * - `off`:关闭思考,由 adapter 决定如何表达(不发字段 / 发原生 disable)。
324
- * - 不含 `adaptive`:本合同只表达离散的努力强度;provider 的动态思考策略由 adapter 解释。
325
- *
326
- * 设计要点:
327
- * - 一处真源,供 host 模型注册表、runtime-kernel、provider adapter 和 UI consumer 共用。
328
- * - 降级规则单点维护:前端展示与后端 adapter 翻译都调用 `resolveEffectiveEffort`,避免规则漂移。
329
- */
330
- /**
331
- * 统一用户语义:思考努力程度档位。
332
- *
333
- * 语义从弱到强:off < minimal < low < medium < high < xhigh。
334
- */
335
- type ReasoningEffort = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
336
- /**
337
- * 运行时枚举真源:所有合法的 ReasoningEffort 值,按从弱到强排序。
338
- *
339
- * 用途:`processModelConfig` 等校验方用它判断「用户配置的档位字符串是否合法」,
340
- * 避免各处手写 6 个字面量集合导致枚举漂移。
341
- */
342
- declare const REASONING_EFFORTS: readonly ReasoningEffort[];
343
- /**
344
- * 判断字符串是否为合法的 ReasoningEffort 枚举值。
345
- *
346
- * 供 host 配置校验方解析原始输入时使用,避免非法档位进入模型注册表。
347
- */
348
- declare function isValidReasoningEffort(value: unknown): value is ReasoningEffort;
349
- /**
350
- * 模型能力契约:该模型支持哪些思考档位。
351
- *
352
- * 可放入 host 的模型配置并透出给需要展示模型能力的 consumer。
353
- *
354
- * 字段说明:
355
- * - `supported_efforts`:该模型支持的档位列表(含是否支持 `off`)。**约定从弱到强排序**,
356
- * 降级兜底会取首项(最弱档),排序保证兜底行为可预测。
357
- * - `default_effort`:用户没选时用哪个;不填则取 `medium`(若在 supported 中)或列表首项。
358
- *
359
- * 模型是否「支持 reasoning」由 `supported_efforts.length > 0` 推导,不单独加布尔。
360
- * Provider 的 summary、token budget 和 wire 字段不属于 Linnkit 通用能力契约。
361
- */
362
- interface ModelReasoningConfig {
363
- /** 该模型支持哪些档位(含是否支持 off)。约定从弱到强排序。 */
364
- supported_efforts: ReasoningEffort[];
365
- /** 用户没选时用哪个;不填则取 medium(若在 supported 中)或列表首项。 */
366
- default_effort?: ReasoningEffort;
367
- }
368
- /**
369
- * 把用户请求的档位降级到模型实际支持的档位。
370
- *
371
- * 规则:
372
- * 1. 模型无 `reasoning` 契约(或 supported 为空)→ 返回 null,调用方不发任何字段。
373
- * 2. `requested` 为空 → 取 `default_effort` ??(`medium` 若在 supported 中,否则 supported 首项)。
374
- * 3. `requested` 在 `supported_efforts` 中 → 原样返回。
375
- * 4. 不在 → 按 `xhigh→high→medium→首项`、`minimal→low→medium→首项` 降级;其他档位走 `medium→首项`。
376
- *
377
- * @param requested 用户请求的档位(null/undefined 表示用户没选)
378
- * @param config 模型的 reasoning 能力契约(undefined 表示模型无该契约)
379
- * @returns 已降级的最终档位;null 表示该模型不支持 reasoning,调用方不发任何字段
380
- */
381
- declare function resolveEffectiveEffort(requested: ReasoningEffort | null | undefined, config: ModelReasoningConfig | undefined): ReasoningEffort | null;
382
-
383
- export { CanonicalLlmUsage as C, type ModelReasoningConfig as M, PromptUsageMeasurementPolicy as P, REASONING_EFFORTS as R, TokenRoute as T, TokenCountSource as a, TokenCountConfidence as b, ContextUsageSnapshot as c, type ReasoningEffort as d, TokenRouteCapabilities as e, isValidReasoningEffort as i, resolveEffectiveEffort as r };
308
+ export { CanonicalLlmUsage, ContextUsageSnapshot, PromptUsageMeasurementPolicy, TokenCountConfidence, TokenCountSource, TokenRoute, TokenRouteCapabilities };
@@ -102,10 +102,10 @@ declare const CanonicalLlmUsage: z.ZodObject<{
102
102
  confidence: z.ZodEnum<["estimate", "provider-estimate", "actual"]>;
103
103
  rawUsage: z.ZodOptional<z.ZodUnknown>;
104
104
  }, "strip", z.ZodTypeAny, {
105
- inputTokens: number;
106
- outputTokens: number;
107
105
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
108
106
  confidence: "estimate" | "provider-estimate" | "actual";
107
+ inputTokens: number;
108
+ outputTokens: number;
109
109
  imageInputTokens?: number | undefined;
110
110
  reasoningTokens?: number | undefined;
111
111
  cacheReadTokens?: number | undefined;
@@ -113,10 +113,10 @@ declare const CanonicalLlmUsage: z.ZodObject<{
113
113
  totalTokens?: number | undefined;
114
114
  rawUsage?: unknown;
115
115
  }, {
116
- inputTokens: number;
117
- outputTokens: number;
118
116
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
119
117
  confidence: "estimate" | "provider-estimate" | "actual";
118
+ inputTokens: number;
119
+ outputTokens: number;
120
120
  imageInputTokens?: number | undefined;
121
121
  reasoningTokens?: number | undefined;
122
122
  cacheReadTokens?: number | undefined;
@@ -153,7 +153,6 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
153
153
  measured_at: z.ZodNumber;
154
154
  }, "strict", z.ZodTypeAny, {
155
155
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
156
- confidence: "estimate" | "provider-estimate" | "actual";
157
156
  basis: "last_completed_llm_prompt";
158
157
  budget_model_id: string;
159
158
  used_tokens: number;
@@ -166,11 +165,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
166
165
  input_budget_tokens: number;
167
166
  remaining_tokens: number;
168
167
  output_limit_tokens: number;
168
+ confidence: "estimate" | "provider-estimate" | "actual";
169
169
  measured_at: number;
170
170
  served_model_id?: string | undefined;
171
171
  }, {
172
172
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
173
- confidence: "estimate" | "provider-estimate" | "actual";
174
173
  basis: "last_completed_llm_prompt";
175
174
  budget_model_id: string;
176
175
  used_tokens: number;
@@ -183,11 +182,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
183
182
  input_budget_tokens: number;
184
183
  remaining_tokens: number;
185
184
  output_limit_tokens: number;
185
+ confidence: "estimate" | "provider-estimate" | "actual";
186
186
  measured_at: number;
187
187
  served_model_id?: string | undefined;
188
188
  }>, {
189
189
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
190
- confidence: "estimate" | "provider-estimate" | "actual";
191
190
  basis: "last_completed_llm_prompt";
192
191
  budget_model_id: string;
193
192
  used_tokens: number;
@@ -200,11 +199,11 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
200
199
  input_budget_tokens: number;
201
200
  remaining_tokens: number;
202
201
  output_limit_tokens: number;
202
+ confidence: "estimate" | "provider-estimate" | "actual";
203
203
  measured_at: number;
204
204
  served_model_id?: string | undefined;
205
205
  }, {
206
206
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
207
- confidence: "estimate" | "provider-estimate" | "actual";
208
207
  basis: "last_completed_llm_prompt";
209
208
  budget_model_id: string;
210
209
  used_tokens: number;
@@ -217,6 +216,7 @@ declare const ContextUsageSnapshot: z.ZodEffects<z.ZodObject<{
217
216
  input_budget_tokens: number;
218
217
  remaining_tokens: number;
219
218
  output_limit_tokens: number;
219
+ confidence: "estimate" | "provider-estimate" | "actual";
220
220
  measured_at: number;
221
221
  served_model_id?: string | undefined;
222
222
  }>;
@@ -305,79 +305,4 @@ declare const PromptUsageMeasurementPolicy: z.ZodObject<{
305
305
  }>;
306
306
  type PromptUsageMeasurementPolicy = z.infer<typeof PromptUsageMeasurementPolicy>;
307
307
 
308
- /**
309
- * @file packages/linnkit/src/contracts/reasoning.ts
310
- *
311
- * @description
312
- * 思考努力程度(Reasoning Effort)的统一用户语义、模型能力契约与降级纯函数。
313
- *
314
- * 为什么放在 contracts 而非 runtime-kernel:
315
- * - `ReasoningEffort` 是基础枚举,需要被 `ports/llm-call.ts` 的 `LlmCallOptions`
316
- * 和 `runtime-kernel` 的 `ModelReasoningConfig` / `resolveEffectiveEffort` 共同使用;
317
- * - ports 不能 import runtime-kernel(会形成 ports ⇄ runtime-kernel 循环依赖),
318
- * 而 contracts 是 ports 与 runtime-kernel 都依赖的最底层共享类型层;
319
- * - 浏览器 consumer 应只 import `linnkit/contracts`,不能拖入 runtime-kernel 整包
320
- * (会间接拉到 `node:async_hooks` 等 Node-only 模块)。
321
- *
322
- * 语义从弱到强:off < minimal < low < medium < high < xhigh。
323
- * - `off`:关闭思考,由 adapter 决定如何表达(不发字段 / 发原生 disable)。
324
- * - 不含 `adaptive`:本合同只表达离散的努力强度;provider 的动态思考策略由 adapter 解释。
325
- *
326
- * 设计要点:
327
- * - 一处真源,供 host 模型注册表、runtime-kernel、provider adapter 和 UI consumer 共用。
328
- * - 降级规则单点维护:前端展示与后端 adapter 翻译都调用 `resolveEffectiveEffort`,避免规则漂移。
329
- */
330
- /**
331
- * 统一用户语义:思考努力程度档位。
332
- *
333
- * 语义从弱到强:off < minimal < low < medium < high < xhigh。
334
- */
335
- type ReasoningEffort = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
336
- /**
337
- * 运行时枚举真源:所有合法的 ReasoningEffort 值,按从弱到强排序。
338
- *
339
- * 用途:`processModelConfig` 等校验方用它判断「用户配置的档位字符串是否合法」,
340
- * 避免各处手写 6 个字面量集合导致枚举漂移。
341
- */
342
- declare const REASONING_EFFORTS: readonly ReasoningEffort[];
343
- /**
344
- * 判断字符串是否为合法的 ReasoningEffort 枚举值。
345
- *
346
- * 供 host 配置校验方解析原始输入时使用,避免非法档位进入模型注册表。
347
- */
348
- declare function isValidReasoningEffort(value: unknown): value is ReasoningEffort;
349
- /**
350
- * 模型能力契约:该模型支持哪些思考档位。
351
- *
352
- * 可放入 host 的模型配置并透出给需要展示模型能力的 consumer。
353
- *
354
- * 字段说明:
355
- * - `supported_efforts`:该模型支持的档位列表(含是否支持 `off`)。**约定从弱到强排序**,
356
- * 降级兜底会取首项(最弱档),排序保证兜底行为可预测。
357
- * - `default_effort`:用户没选时用哪个;不填则取 `medium`(若在 supported 中)或列表首项。
358
- *
359
- * 模型是否「支持 reasoning」由 `supported_efforts.length > 0` 推导,不单独加布尔。
360
- * Provider 的 summary、token budget 和 wire 字段不属于 Linnkit 通用能力契约。
361
- */
362
- interface ModelReasoningConfig {
363
- /** 该模型支持哪些档位(含是否支持 off)。约定从弱到强排序。 */
364
- supported_efforts: ReasoningEffort[];
365
- /** 用户没选时用哪个;不填则取 medium(若在 supported 中)或列表首项。 */
366
- default_effort?: ReasoningEffort;
367
- }
368
- /**
369
- * 把用户请求的档位降级到模型实际支持的档位。
370
- *
371
- * 规则:
372
- * 1. 模型无 `reasoning` 契约(或 supported 为空)→ 返回 null,调用方不发任何字段。
373
- * 2. `requested` 为空 → 取 `default_effort` ??(`medium` 若在 supported 中,否则 supported 首项)。
374
- * 3. `requested` 在 `supported_efforts` 中 → 原样返回。
375
- * 4. 不在 → 按 `xhigh→high→medium→首项`、`minimal→low→medium→首项` 降级;其他档位走 `medium→首项`。
376
- *
377
- * @param requested 用户请求的档位(null/undefined 表示用户没选)
378
- * @param config 模型的 reasoning 能力契约(undefined 表示模型无该契约)
379
- * @returns 已降级的最终档位;null 表示该模型不支持 reasoning,调用方不发任何字段
380
- */
381
- declare function resolveEffectiveEffort(requested: ReasoningEffort | null | undefined, config: ModelReasoningConfig | undefined): ReasoningEffort | null;
382
-
383
- export { CanonicalLlmUsage as C, type ModelReasoningConfig as M, PromptUsageMeasurementPolicy as P, REASONING_EFFORTS as R, TokenRoute as T, TokenCountSource as a, TokenCountConfidence as b, ContextUsageSnapshot as c, type ReasoningEffort as d, TokenRouteCapabilities as e, isValidReasoningEffort as i, resolveEffectiveEffort as r };
308
+ export { CanonicalLlmUsage, ContextUsageSnapshot, PromptUsageMeasurementPolicy, TokenCountConfidence, TokenCountSource, TokenRoute, TokenRouteCapabilities };
@@ -1,10 +1,24 @@
1
- export { A as AiMessage, i as AiMessageId, j as AiMessageIdSchema, f as AnswerSegmentId, k as AnswerSegmentIdSchema, b as AssistantMessage, a as AssistantReplayPart, l as AssistantReplayParts, m as AuditEnvelopeId, n as AuditEnvelopeIdSchema, C as ContextLedgerEntryId, o as ContextLedgerEntryIdSchema, p as ControlTargetReferenceId, q as ControlTargetReferenceIdSchema, r as ConversationId, s as ConversationIdSchema, E as ExecutionId, t as ExecutionIdSchema, H as HistoryMessageReferenceId, u as HistoryMessageReferenceIdSchema, v as HistorySummaryMeta, I as InteractionId, w as InteractionIdSchema, O as ObservationTruncationMeta, x as PersistentMetadata, P as ProviderContinuation, y as ProviderContinuationProducer, z as ProviderContinuations, B as ResumeToken, D as ResumeTokenSchema, c as RunId, F as RunIdSchema, G as RunResumeClaimId, J as RunResumeClaimIdSchema, e as RuntimeEventId, K as RuntimeEventIdSchema, R as RuntimeResourceRef, L as RuntimeResourceRefs, M as SerializableJsonRecord, g as SerializableJsonValue, N as SourceEventId, Q as SourceEventIdSchema, S as SubrunId, U as SubrunIdSchema, V as SystemMessage, W as TaskTrackingMeta, h as ThoughtMessageId, X as ThoughtMessageIdSchema, T as ToolCallId, Y as ToolCallIdSchema, Z as ToolCallWire, _ as ToolCallsMeta, $ as ToolMessage, a0 as ToolOutputMeta, a1 as TraceId, a2 as TraceIdSchema, d as TurnId, a3 as TurnIdSchema, a4 as UserMessage, a5 as createAssistantMessage, a6 as createHistorySummaryMessage, a7 as createSystemMessage, a8 as createToolMessage, a9 as createUserMessage, aa as hasToolCalls, ab as isAssistantMessage, ac as isHistorySummaryMessage, ad as isSystemMessage, ae as isToolMessage, af as isUserMessage, ag as toSerializableJsonRecord, ah as toSerializableJsonValue, ai as validateAiMessage, aj as validateHistorySummaryMeta } from './provider-continuation-CTZdCB--.cjs';
2
- export { g as AgentCapability, c as AgentSpec, h as AgentSpecAuditConfig, i as AgentSpecBudgetPolicy, j as AgentSpecContextCompactionPolicy, d as AgentSpecContextPolicy, e as AgentSpecContextPolicyInput, a as AgentSpecContextTracePolicy, k as AgentSpecMessageType, l as AgentSpecMustKeepPolicy, m as AgentSpecMustKeepTruncationRule, n as AgentSpecSystemReminderExtraRule, b as AgentSpecSystemReminderPolicy, o as AgentSpecSystemReminderTrigger, f as AgentSpecTokenEstimationPolicy, p as AgentSpecToolHistoryPolicy, q as AgentSpecToolObservationGovernancePolicy, A as AgentSpecToolOutputPolicy, r as AgentSpecWorkingMemoryPolicy, s as ContextComponentTokenLedgerEntry, C as ContextTokenComponent, t as ContextTokenComponentKind, u as CostBreakdown, L as LlmUsageTokenLedgerEntry, R as RunTokenUsageAggregate, S as SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS, v as SubRunTraceKind, w as SubRunTracePayload, x as SubRunTraceToolCallDecision, T as TokenCostComponent, y as TokenLedgerAggregate, z as TokenLedgerEntry, B as TokenLedgerEntryKind, D as TokenPricing, E as TokenUsageTotals, F as ToolBindingSpec, G as defineContextPolicy, H as validateSubRunTracePayloadSemantics } from './token-accounting-19cXG7hM.cjs';
3
- export { d as CONTEXT_COMPACTION_FAILED_ERROR_CODE, e as CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE, C as ContextBuildTokenEstimate, b as ContextCompactionCandidate, f as ContextCompactionErrorCode, c as ContextCompactionPlan, D as DEFAULT_CONTEXT_COMPACTION_POLICY, R as ResolvedContextCompactionPolicy, a as TokenUsageCalibrationSample, T as TokenUsageCalibrationTrace } from './token-calibration-GtFyMJtM.cjs';
4
- export { A as AUDIT_ACTIONS, a as AUDIT_DECISION_OUTCOMES, b as AuditActor, c as AuditCostDelta, d as AuditDecision, e as AuditEnvelope, f as AuditEvidence, g as AuditScope } from './audit-XsNMTt0-.cjs';
5
- export { A as AuditEnvelopeEvent, B as BaseEvent, C as ContextUsageSnapshotEvent, a as ControlEvent, E as ErrorEvent, F as FinalAnswerChunkEvent, b as FinalAnswerCompletionReason, c as FinalAnswerEvent, d as FinalAnswerResetEvent, H as HistorySummaryEvent, e as RequiresUserInteractionEvent, f as RoutedRuntimeEvent, g as RunExecutionMetricsEvent, h as RunExecutionOutcome, R as RuntimeEvent, i as RuntimeEventInput, j as RuntimeEventRoutingIdentity, k as RuntimeEventVisibility, l as RuntimeRunLane, m as RuntimeRunStatus, S as SubRunTraceEvent, n as ThoughtEvent, o as ToolCallDecisionEvent, p as ToolCallDecisionPayload, q as ToolOutputEvent, T as ToolOutputEventResult, r as ToolProcessEvent, U as UserInputEvent, s as createAuditEnvelopeEvent, t as createContextUsageSnapshotEvent, u as createErrorEvent, v as createFinalAnswerChunkEvent, w as createFinalAnswerEvent, x as createFinalAnswerResetEvent, y as createHistorySummaryEvent, z as createRequiresUserInteractionEvent, D as createRunExecutionMetricsEvent, G as createSubRunTraceEvent, I as createThoughtEvent, J as createToolCallDecisionEvent, K as createToolOutputEvent, L as createToolProcessEvent, M as createUserInputEvent, N as isRoutedRuntimeEvent, O as parseRoutedRuntimeEvent, P as parseRuntimeEventRoutingIdentity, Q as parseRuntimeEvents, V as routeRuntimeEvent, W as validateRuntimeEvent, X as validateRuntimeEvents } from './final-answer-B0_kx5_U.cjs';
6
- export { B as BaseSSEEvent, D as DEFAULT_MAX_STEPS, S as SSEContextUsageSnapshotEvent, c as SSEErrorEvent, d as SSEEvent, e as SSEEventInput, f as SSEExecutionScope, h as SSEFinalAnswerChunkEvent, j as SSEFinalAnswerEvent, k as SSEFinalAnswerResetEvent, l as SSEHistorySummaryEvent, m as SSEMarkdownChunkEvent, n as SSERequiresUserInteractionEvent, o as SSERunExecutionMetricsEvent, p as SSERunStatusEvent, q as SSESubRunTraceEvent, r as SSESummarizationEndEvent, s as SSESummarizationErrorEvent, t as SSESummarizationStartEvent, u as SSEThoughtEvent, v as SSEToolCallDecisionEvent, w as SSEToolOutputEvent, x as SSEToolProcessEvent, y as SSETransportEndEvent, z as SSETransportErrorEvent, A as ServerSentEventFrame, C as ServerSentEventFrameParser, E as Status, T as ToolCallPhase, F as assertCanonicalFinalAnswerIdentity, G as assertDistinctAnswerChunkIdentity, H as createSSEErrorEvent, I as createSSEFinalAnswerChunkEvent, J as createSSEFinalAnswerEvent, K as createSSEHistorySummaryEvent, L as createSSEMarkdownChunkEvent, M as createSSERequiresUserInteractionEvent, N as createSSERunStatusEvent, O as createSSESubRunTraceEvent, P as createSSEThoughtEvent, Q as createSSEToolCallDecisionEvent, R as createSSEToolOutputEvent, U as createSSEToolProcessEvent, V as createSSETransportEndEvent, W as createSSETransportErrorEvent, X as createServerSentEventFrameParser, Y as generateAiMessageId, Z as generateAnswerSegmentId, g as generateAuditEnvelopeId, _ as generateContextLedgerEntryId, $ as generateConversationId, a0 as generateExecutionId, a1 as generateInferenceAttemptId, a2 as generateInteractionId, a3 as generateResumeToken, a as generateRunId, a4 as generateRunResumeClaimId, b as generateRuntimeEventId, a5 as generateSubrunId, a6 as generateThoughtMessageId, a7 as generateToolCallId, a8 as generateTraceId, a9 as generateTurnId, aa as parseSSEExecutionScope, ab as runIdFromSubrunId, ac as runIdFromTurnId, ad as runtimeEventToSSEEvent, ae as serializeServerSentEventFrame, af as validateSSEEvent } from './index-JYf6n2Ik.cjs';
7
- export { E as EventEnvelope, a as ExecutionTraceContext } from './execution-B7e01ZjW.cjs';
8
- export { C as CanonicalLlmUsage, c as ContextUsageSnapshot, M as ModelReasoningConfig, P as PromptUsageMeasurementPolicy, R as REASONING_EFFORTS, d as ReasoningEffort, b as TokenCountConfidence, a as TokenCountSource, T as TokenRoute, e as TokenRouteCapabilities, i as isValidReasoningEffort, r as resolveEffectiveEffort } from './reasoning-bffu9R2B.cjs';
9
- export { S as SummarizationCallbacks } from './summarization-kLeweZ5-.cjs';
10
- import 'zod';
1
+ export { AiMessage, AssistantMessage, HistorySummaryMeta, ObservationTruncationMeta, PersistentMetadata, SystemMessage, TaskTrackingMeta, ToolCallWire, ToolCallsMeta, ToolMessage, ToolOutputMeta, UserMessage, createAssistantMessage, createHistorySummaryMessage, createSystemMessage, createToolMessage, createUserMessage, hasToolCalls, isAssistantMessage, isHistorySummaryMessage, isSystemMessage, isToolMessage, isUserMessage, validateAiMessage, validateHistorySummaryMeta } from './contracts/messages.cjs';
2
+ export { RuntimeResourceRef, RuntimeResourceRefs } from './contracts/resource-ref.cjs';
3
+ export { SerializableJsonRecord, SerializableJsonValue, toSerializableJsonRecord, toSerializableJsonValue } from './contracts/json.cjs';
4
+ export { AgentSpecBudgetPolicy, AgentSpecContextCompactionPolicy, AgentSpecContextPolicy, AgentSpecContextPolicyInput, AgentSpecContextTracePolicy, AgentSpecMessageType, AgentSpecMustKeepPolicy, AgentSpecMustKeepTruncationRule, AgentSpecSystemReminderExtraRule, AgentSpecSystemReminderPolicy, AgentSpecSystemReminderTrigger, AgentSpecTokenEstimationPolicy, AgentSpecToolHistoryPolicy, AgentSpecToolObservationGovernancePolicy, AgentSpecToolOutputPolicy, AgentSpecWorkingMemoryPolicy, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS, defineContextPolicy } from './contracts/contextPolicy.cjs';
5
+ export { CONTEXT_COMPACTION_FAILED_ERROR_CODE, CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE, ContextCompactionCandidate, ContextCompactionErrorCode, ContextCompactionPlan, DEFAULT_CONTEXT_COMPACTION_POLICY, ResolvedContextCompactionPolicy } from './contracts/contextCompaction.cjs';
6
+ export { AgentCapability, AgentSpec, AgentSpecAuditConfig, ToolBindingSpec } from './contracts/agentSpec.cjs';
7
+ export { AUDIT_ACTIONS, AUDIT_DECISION_OUTCOMES, AuditActor, AuditCostDelta, AuditDecision, AuditEnvelope, AuditEvidence, AuditScope } from './contracts/audit.cjs';
8
+ export { AuditEnvelopeEvent, BaseEvent, ContextUsageSnapshotEvent, ControlEvent, ErrorEvent, FinalAnswerChunkEvent, FinalAnswerEvent, FinalAnswerResetEvent, HistorySummaryEvent, RequiresUserInteractionEvent, RoutedRuntimeEvent, RunExecutionMetricsEvent, RunExecutionOutcome, RuntimeEvent, RuntimeEventInput, RuntimeEventRoutingIdentity, RuntimeEventVisibility, RuntimeRunLane, RuntimeRunStatus, SubRunTraceEvent, ThoughtEvent, ToolCallDecisionEvent, ToolCallDecisionPayload, ToolOutputEvent, ToolOutputEventResult, ToolProcessEvent, UserInputEvent, createAuditEnvelopeEvent, createContextUsageSnapshotEvent, createErrorEvent, createFinalAnswerChunkEvent, createFinalAnswerEvent, createFinalAnswerResetEvent, createHistorySummaryEvent, createRequiresUserInteractionEvent, createRunExecutionMetricsEvent, createSubRunTraceEvent, createThoughtEvent, createToolCallDecisionEvent, createToolOutputEvent, createToolProcessEvent, createUserInputEvent, isRoutedRuntimeEvent, parseRoutedRuntimeEvent, parseRuntimeEventRoutingIdentity, parseRuntimeEvents, routeRuntimeEvent, validateRuntimeEvent, validateRuntimeEvents } from './contracts/events.cjs';
9
+ export { SubRunTraceKind, SubRunTracePayload, SubRunTraceToolCallDecision, validateSubRunTracePayloadSemantics } from './contracts/sub-run-trace-payload.cjs';
10
+ export { DEFAULT_MAX_STEPS } from './contracts/constants.cjs';
11
+ export { EventEnvelope, ExecutionTraceContext } from './contracts/execution.cjs';
12
+ export { FinalAnswerCompletionReason } from './contracts/final-answer.cjs';
13
+ export { AiMessageId, AiMessageIdSchema, AnswerSegmentId, AnswerSegmentIdSchema, AuditEnvelopeId, AuditEnvelopeIdSchema, ContextLedgerEntryId, ContextLedgerEntryIdSchema, ControlTargetReferenceId, ControlTargetReferenceIdSchema, ConversationId, ConversationIdSchema, ExecutionId, ExecutionIdSchema, HistoryMessageReferenceId, HistoryMessageReferenceIdSchema, InteractionId, InteractionIdSchema, ResumeToken, ResumeTokenSchema, RunId, RunIdSchema, RunResumeClaimId, RunResumeClaimIdSchema, RuntimeEventId, RuntimeEventIdSchema, SourceEventId, SourceEventIdSchema, SubrunId, SubrunIdSchema, ThoughtMessageId, ThoughtMessageIdSchema, ToolCallId, ToolCallIdSchema, TraceId, TraceIdSchema, TurnId, TurnIdSchema } from './contracts/identity/definitions.cjs';
14
+ export { generateAiMessageId, generateAnswerSegmentId, generateAuditEnvelopeId, generateContextLedgerEntryId, generateConversationId, generateExecutionId, generateInferenceAttemptId, generateInteractionId, generateResumeToken, generateRunId, generateRunResumeClaimId, generateRuntimeEventId, generateSubrunId, generateThoughtMessageId, generateToolCallId, generateTraceId, generateTurnId, runIdFromSubrunId, runIdFromTurnId } from './contracts/identity/generators.cjs';
15
+ export { assertCanonicalFinalAnswerIdentity, assertDistinctAnswerChunkIdentity } from './contracts/identity/invariants.cjs';
16
+ export { BaseSSEEvent, SSEContextUsageSnapshotEvent, SSEErrorEvent, SSEEvent, SSEEventInput, SSEExecutionScope, SSEFinalAnswerChunkEvent, SSEFinalAnswerEvent, SSEFinalAnswerResetEvent, SSEHistorySummaryEvent, SSEMarkdownChunkEvent, SSERequiresUserInteractionEvent, SSERunExecutionMetricsEvent, SSERunStatusEvent, SSESubRunTraceEvent, SSESummarizationEndEvent, SSESummarizationErrorEvent, SSESummarizationStartEvent, SSEThoughtEvent, SSEToolCallDecisionEvent, SSEToolOutputEvent, SSEToolProcessEvent, SSETransportEndEvent, SSETransportErrorEvent, createSSEErrorEvent, createSSEFinalAnswerChunkEvent, createSSEFinalAnswerEvent, createSSEHistorySummaryEvent, createSSEMarkdownChunkEvent, createSSERequiresUserInteractionEvent, createSSERunStatusEvent, createSSESubRunTraceEvent, createSSEThoughtEvent, createSSEToolCallDecisionEvent, createSSEToolOutputEvent, createSSEToolProcessEvent, createSSETransportEndEvent, createSSETransportErrorEvent, parseSSEExecutionScope, runtimeEventToSSEEvent, validateSSEEvent } from './contracts/sse.cjs';
17
+ export { ServerSentEventFrame, ServerSentEventFrameParser, createServerSentEventFrameParser, serializeServerSentEventFrame } from './contracts/sse-framing.cjs';
18
+ export { CanonicalLlmUsage, ContextUsageSnapshot, PromptUsageMeasurementPolicy, TokenCountConfidence, TokenCountSource, TokenRoute, TokenRouteCapabilities } from './contracts/token-usage.cjs';
19
+ export { ContextComponentTokenLedgerEntry, ContextTokenComponent, ContextTokenComponentKind, CostBreakdown, LlmUsageTokenLedgerEntry, RunTokenUsageAggregate, TokenCostComponent, TokenLedgerAggregate, TokenLedgerEntry, TokenLedgerEntryKind, TokenPricing, TokenUsageTotals } from './contracts/token-accounting.cjs';
20
+ export { ContextBuildTokenEstimate, TokenUsageCalibrationSample, TokenUsageCalibrationTrace } from './contracts/token-calibration.cjs';
21
+ export { ModelReasoningConfig, REASONING_EFFORTS, ReasoningEffort, isValidReasoningEffort, resolveEffectiveEffort } from './contracts/reasoning.cjs';
22
+ export { AssistantReplayPart, AssistantReplayParts, ProviderContinuation, ProviderContinuationProducer, ProviderContinuations } from './contracts/provider-continuation.cjs';
23
+ export { SummarizationCallbacks } from './contracts/summarization.cjs';
24
+ export { Status, ToolCallPhase } from './contracts/runtime-status.cjs';
@@ -1,10 +1,24 @@
1
- export { A as AiMessage, i as AiMessageId, j as AiMessageIdSchema, f as AnswerSegmentId, k as AnswerSegmentIdSchema, b as AssistantMessage, a as AssistantReplayPart, l as AssistantReplayParts, m as AuditEnvelopeId, n as AuditEnvelopeIdSchema, C as ContextLedgerEntryId, o as ContextLedgerEntryIdSchema, p as ControlTargetReferenceId, q as ControlTargetReferenceIdSchema, r as ConversationId, s as ConversationIdSchema, E as ExecutionId, t as ExecutionIdSchema, H as HistoryMessageReferenceId, u as HistoryMessageReferenceIdSchema, v as HistorySummaryMeta, I as InteractionId, w as InteractionIdSchema, O as ObservationTruncationMeta, x as PersistentMetadata, P as ProviderContinuation, y as ProviderContinuationProducer, z as ProviderContinuations, B as ResumeToken, D as ResumeTokenSchema, c as RunId, F as RunIdSchema, G as RunResumeClaimId, J as RunResumeClaimIdSchema, e as RuntimeEventId, K as RuntimeEventIdSchema, R as RuntimeResourceRef, L as RuntimeResourceRefs, M as SerializableJsonRecord, g as SerializableJsonValue, N as SourceEventId, Q as SourceEventIdSchema, S as SubrunId, U as SubrunIdSchema, V as SystemMessage, W as TaskTrackingMeta, h as ThoughtMessageId, X as ThoughtMessageIdSchema, T as ToolCallId, Y as ToolCallIdSchema, Z as ToolCallWire, _ as ToolCallsMeta, $ as ToolMessage, a0 as ToolOutputMeta, a1 as TraceId, a2 as TraceIdSchema, d as TurnId, a3 as TurnIdSchema, a4 as UserMessage, a5 as createAssistantMessage, a6 as createHistorySummaryMessage, a7 as createSystemMessage, a8 as createToolMessage, a9 as createUserMessage, aa as hasToolCalls, ab as isAssistantMessage, ac as isHistorySummaryMessage, ad as isSystemMessage, ae as isToolMessage, af as isUserMessage, ag as toSerializableJsonRecord, ah as toSerializableJsonValue, ai as validateAiMessage, aj as validateHistorySummaryMeta } from './provider-continuation-CTZdCB--.js';
2
- export { g as AgentCapability, c as AgentSpec, h as AgentSpecAuditConfig, i as AgentSpecBudgetPolicy, j as AgentSpecContextCompactionPolicy, d as AgentSpecContextPolicy, e as AgentSpecContextPolicyInput, a as AgentSpecContextTracePolicy, k as AgentSpecMessageType, l as AgentSpecMustKeepPolicy, m as AgentSpecMustKeepTruncationRule, n as AgentSpecSystemReminderExtraRule, b as AgentSpecSystemReminderPolicy, o as AgentSpecSystemReminderTrigger, f as AgentSpecTokenEstimationPolicy, p as AgentSpecToolHistoryPolicy, q as AgentSpecToolObservationGovernancePolicy, A as AgentSpecToolOutputPolicy, r as AgentSpecWorkingMemoryPolicy, s as ContextComponentTokenLedgerEntry, C as ContextTokenComponent, t as ContextTokenComponentKind, u as CostBreakdown, L as LlmUsageTokenLedgerEntry, R as RunTokenUsageAggregate, S as SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS, v as SubRunTraceKind, w as SubRunTracePayload, x as SubRunTraceToolCallDecision, T as TokenCostComponent, y as TokenLedgerAggregate, z as TokenLedgerEntry, B as TokenLedgerEntryKind, D as TokenPricing, E as TokenUsageTotals, F as ToolBindingSpec, G as defineContextPolicy, H as validateSubRunTracePayloadSemantics } from './token-accounting-CVW37Uri.js';
3
- export { d as CONTEXT_COMPACTION_FAILED_ERROR_CODE, e as CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE, C as ContextBuildTokenEstimate, b as ContextCompactionCandidate, f as ContextCompactionErrorCode, c as ContextCompactionPlan, D as DEFAULT_CONTEXT_COMPACTION_POLICY, R as ResolvedContextCompactionPolicy, a as TokenUsageCalibrationSample, T as TokenUsageCalibrationTrace } from './token-calibration-GtFyMJtM.js';
4
- export { A as AUDIT_ACTIONS, a as AUDIT_DECISION_OUTCOMES, b as AuditActor, c as AuditCostDelta, d as AuditDecision, e as AuditEnvelope, f as AuditEvidence, g as AuditScope } from './audit-XsNMTt0-.js';
5
- export { A as AuditEnvelopeEvent, B as BaseEvent, C as ContextUsageSnapshotEvent, a as ControlEvent, E as ErrorEvent, F as FinalAnswerChunkEvent, b as FinalAnswerCompletionReason, c as FinalAnswerEvent, d as FinalAnswerResetEvent, H as HistorySummaryEvent, e as RequiresUserInteractionEvent, f as RoutedRuntimeEvent, g as RunExecutionMetricsEvent, h as RunExecutionOutcome, R as RuntimeEvent, i as RuntimeEventInput, j as RuntimeEventRoutingIdentity, k as RuntimeEventVisibility, l as RuntimeRunLane, m as RuntimeRunStatus, S as SubRunTraceEvent, n as ThoughtEvent, o as ToolCallDecisionEvent, p as ToolCallDecisionPayload, q as ToolOutputEvent, T as ToolOutputEventResult, r as ToolProcessEvent, U as UserInputEvent, s as createAuditEnvelopeEvent, t as createContextUsageSnapshotEvent, u as createErrorEvent, v as createFinalAnswerChunkEvent, w as createFinalAnswerEvent, x as createFinalAnswerResetEvent, y as createHistorySummaryEvent, z as createRequiresUserInteractionEvent, D as createRunExecutionMetricsEvent, G as createSubRunTraceEvent, I as createThoughtEvent, J as createToolCallDecisionEvent, K as createToolOutputEvent, L as createToolProcessEvent, M as createUserInputEvent, N as isRoutedRuntimeEvent, O as parseRoutedRuntimeEvent, P as parseRuntimeEventRoutingIdentity, Q as parseRuntimeEvents, V as routeRuntimeEvent, W as validateRuntimeEvent, X as validateRuntimeEvents } from './final-answer-oOQ_7nPt.js';
6
- export { B as BaseSSEEvent, D as DEFAULT_MAX_STEPS, S as SSEContextUsageSnapshotEvent, c as SSEErrorEvent, d as SSEEvent, e as SSEEventInput, f as SSEExecutionScope, h as SSEFinalAnswerChunkEvent, j as SSEFinalAnswerEvent, k as SSEFinalAnswerResetEvent, l as SSEHistorySummaryEvent, m as SSEMarkdownChunkEvent, n as SSERequiresUserInteractionEvent, o as SSERunExecutionMetricsEvent, p as SSERunStatusEvent, q as SSESubRunTraceEvent, r as SSESummarizationEndEvent, s as SSESummarizationErrorEvent, t as SSESummarizationStartEvent, u as SSEThoughtEvent, v as SSEToolCallDecisionEvent, w as SSEToolOutputEvent, x as SSEToolProcessEvent, y as SSETransportEndEvent, z as SSETransportErrorEvent, A as ServerSentEventFrame, C as ServerSentEventFrameParser, E as Status, T as ToolCallPhase, F as assertCanonicalFinalAnswerIdentity, G as assertDistinctAnswerChunkIdentity, H as createSSEErrorEvent, I as createSSEFinalAnswerChunkEvent, J as createSSEFinalAnswerEvent, K as createSSEHistorySummaryEvent, L as createSSEMarkdownChunkEvent, M as createSSERequiresUserInteractionEvent, N as createSSERunStatusEvent, O as createSSESubRunTraceEvent, P as createSSEThoughtEvent, Q as createSSEToolCallDecisionEvent, R as createSSEToolOutputEvent, U as createSSEToolProcessEvent, V as createSSETransportEndEvent, W as createSSETransportErrorEvent, X as createServerSentEventFrameParser, Y as generateAiMessageId, Z as generateAnswerSegmentId, g as generateAuditEnvelopeId, _ as generateContextLedgerEntryId, $ as generateConversationId, a0 as generateExecutionId, a1 as generateInferenceAttemptId, a2 as generateInteractionId, a3 as generateResumeToken, a as generateRunId, a4 as generateRunResumeClaimId, b as generateRuntimeEventId, a5 as generateSubrunId, a6 as generateThoughtMessageId, a7 as generateToolCallId, a8 as generateTraceId, a9 as generateTurnId, aa as parseSSEExecutionScope, ab as runIdFromSubrunId, ac as runIdFromTurnId, ad as runtimeEventToSSEEvent, ae as serializeServerSentEventFrame, af as validateSSEEvent } from './index-Cp1_oUj0.js';
7
- export { E as EventEnvelope, a as ExecutionTraceContext } from './execution-B7e01ZjW.js';
8
- export { C as CanonicalLlmUsage, c as ContextUsageSnapshot, M as ModelReasoningConfig, P as PromptUsageMeasurementPolicy, R as REASONING_EFFORTS, d as ReasoningEffort, b as TokenCountConfidence, a as TokenCountSource, T as TokenRoute, e as TokenRouteCapabilities, i as isValidReasoningEffort, r as resolveEffectiveEffort } from './reasoning-bffu9R2B.js';
9
- export { S as SummarizationCallbacks } from './summarization-CMMLhaCe.js';
10
- import 'zod';
1
+ export { AiMessage, AssistantMessage, HistorySummaryMeta, ObservationTruncationMeta, PersistentMetadata, SystemMessage, TaskTrackingMeta, ToolCallWire, ToolCallsMeta, ToolMessage, ToolOutputMeta, UserMessage, createAssistantMessage, createHistorySummaryMessage, createSystemMessage, createToolMessage, createUserMessage, hasToolCalls, isAssistantMessage, isHistorySummaryMessage, isSystemMessage, isToolMessage, isUserMessage, validateAiMessage, validateHistorySummaryMeta } from './contracts/messages.js';
2
+ export { RuntimeResourceRef, RuntimeResourceRefs } from './contracts/resource-ref.js';
3
+ export { SerializableJsonRecord, SerializableJsonValue, toSerializableJsonRecord, toSerializableJsonValue } from './contracts/json.js';
4
+ export { AgentSpecBudgetPolicy, AgentSpecContextCompactionPolicy, AgentSpecContextPolicy, AgentSpecContextPolicyInput, AgentSpecContextTracePolicy, AgentSpecMessageType, AgentSpecMustKeepPolicy, AgentSpecMustKeepTruncationRule, AgentSpecSystemReminderExtraRule, AgentSpecSystemReminderPolicy, AgentSpecSystemReminderTrigger, AgentSpecTokenEstimationPolicy, AgentSpecToolHistoryPolicy, AgentSpecToolObservationGovernancePolicy, AgentSpecToolOutputPolicy, AgentSpecWorkingMemoryPolicy, SYSTEM_REMINDER_BUILTIN_TRIGGER_KINDS, defineContextPolicy } from './contracts/contextPolicy.js';
5
+ export { CONTEXT_COMPACTION_FAILED_ERROR_CODE, CONTEXT_COMPACTION_INSUFFICIENT_ERROR_CODE, ContextCompactionCandidate, ContextCompactionErrorCode, ContextCompactionPlan, DEFAULT_CONTEXT_COMPACTION_POLICY, ResolvedContextCompactionPolicy } from './contracts/contextCompaction.js';
6
+ export { AgentCapability, AgentSpec, AgentSpecAuditConfig, ToolBindingSpec } from './contracts/agentSpec.js';
7
+ export { AUDIT_ACTIONS, AUDIT_DECISION_OUTCOMES, AuditActor, AuditCostDelta, AuditDecision, AuditEnvelope, AuditEvidence, AuditScope } from './contracts/audit.js';
8
+ export { AuditEnvelopeEvent, BaseEvent, ContextUsageSnapshotEvent, ControlEvent, ErrorEvent, FinalAnswerChunkEvent, FinalAnswerEvent, FinalAnswerResetEvent, HistorySummaryEvent, RequiresUserInteractionEvent, RoutedRuntimeEvent, RunExecutionMetricsEvent, RunExecutionOutcome, RuntimeEvent, RuntimeEventInput, RuntimeEventRoutingIdentity, RuntimeEventVisibility, RuntimeRunLane, RuntimeRunStatus, SubRunTraceEvent, ThoughtEvent, ToolCallDecisionEvent, ToolCallDecisionPayload, ToolOutputEvent, ToolOutputEventResult, ToolProcessEvent, UserInputEvent, createAuditEnvelopeEvent, createContextUsageSnapshotEvent, createErrorEvent, createFinalAnswerChunkEvent, createFinalAnswerEvent, createFinalAnswerResetEvent, createHistorySummaryEvent, createRequiresUserInteractionEvent, createRunExecutionMetricsEvent, createSubRunTraceEvent, createThoughtEvent, createToolCallDecisionEvent, createToolOutputEvent, createToolProcessEvent, createUserInputEvent, isRoutedRuntimeEvent, parseRoutedRuntimeEvent, parseRuntimeEventRoutingIdentity, parseRuntimeEvents, routeRuntimeEvent, validateRuntimeEvent, validateRuntimeEvents } from './contracts/events.js';
9
+ export { SubRunTraceKind, SubRunTracePayload, SubRunTraceToolCallDecision, validateSubRunTracePayloadSemantics } from './contracts/sub-run-trace-payload.js';
10
+ export { DEFAULT_MAX_STEPS } from './contracts/constants.js';
11
+ export { EventEnvelope, ExecutionTraceContext } from './contracts/execution.js';
12
+ export { FinalAnswerCompletionReason } from './contracts/final-answer.js';
13
+ export { AiMessageId, AiMessageIdSchema, AnswerSegmentId, AnswerSegmentIdSchema, AuditEnvelopeId, AuditEnvelopeIdSchema, ContextLedgerEntryId, ContextLedgerEntryIdSchema, ControlTargetReferenceId, ControlTargetReferenceIdSchema, ConversationId, ConversationIdSchema, ExecutionId, ExecutionIdSchema, HistoryMessageReferenceId, HistoryMessageReferenceIdSchema, InteractionId, InteractionIdSchema, ResumeToken, ResumeTokenSchema, RunId, RunIdSchema, RunResumeClaimId, RunResumeClaimIdSchema, RuntimeEventId, RuntimeEventIdSchema, SourceEventId, SourceEventIdSchema, SubrunId, SubrunIdSchema, ThoughtMessageId, ThoughtMessageIdSchema, ToolCallId, ToolCallIdSchema, TraceId, TraceIdSchema, TurnId, TurnIdSchema } from './contracts/identity/definitions.js';
14
+ export { generateAiMessageId, generateAnswerSegmentId, generateAuditEnvelopeId, generateContextLedgerEntryId, generateConversationId, generateExecutionId, generateInferenceAttemptId, generateInteractionId, generateResumeToken, generateRunId, generateRunResumeClaimId, generateRuntimeEventId, generateSubrunId, generateThoughtMessageId, generateToolCallId, generateTraceId, generateTurnId, runIdFromSubrunId, runIdFromTurnId } from './contracts/identity/generators.js';
15
+ export { assertCanonicalFinalAnswerIdentity, assertDistinctAnswerChunkIdentity } from './contracts/identity/invariants.js';
16
+ export { BaseSSEEvent, SSEContextUsageSnapshotEvent, SSEErrorEvent, SSEEvent, SSEEventInput, SSEExecutionScope, SSEFinalAnswerChunkEvent, SSEFinalAnswerEvent, SSEFinalAnswerResetEvent, SSEHistorySummaryEvent, SSEMarkdownChunkEvent, SSERequiresUserInteractionEvent, SSERunExecutionMetricsEvent, SSERunStatusEvent, SSESubRunTraceEvent, SSESummarizationEndEvent, SSESummarizationErrorEvent, SSESummarizationStartEvent, SSEThoughtEvent, SSEToolCallDecisionEvent, SSEToolOutputEvent, SSEToolProcessEvent, SSETransportEndEvent, SSETransportErrorEvent, createSSEErrorEvent, createSSEFinalAnswerChunkEvent, createSSEFinalAnswerEvent, createSSEHistorySummaryEvent, createSSEMarkdownChunkEvent, createSSERequiresUserInteractionEvent, createSSERunStatusEvent, createSSESubRunTraceEvent, createSSEThoughtEvent, createSSEToolCallDecisionEvent, createSSEToolOutputEvent, createSSEToolProcessEvent, createSSETransportEndEvent, createSSETransportErrorEvent, parseSSEExecutionScope, runtimeEventToSSEEvent, validateSSEEvent } from './contracts/sse.js';
17
+ export { ServerSentEventFrame, ServerSentEventFrameParser, createServerSentEventFrameParser, serializeServerSentEventFrame } from './contracts/sse-framing.js';
18
+ export { CanonicalLlmUsage, ContextUsageSnapshot, PromptUsageMeasurementPolicy, TokenCountConfidence, TokenCountSource, TokenRoute, TokenRouteCapabilities } from './contracts/token-usage.js';
19
+ export { ContextComponentTokenLedgerEntry, ContextTokenComponent, ContextTokenComponentKind, CostBreakdown, LlmUsageTokenLedgerEntry, RunTokenUsageAggregate, TokenCostComponent, TokenLedgerAggregate, TokenLedgerEntry, TokenLedgerEntryKind, TokenPricing, TokenUsageTotals } from './contracts/token-accounting.js';
20
+ export { ContextBuildTokenEstimate, TokenUsageCalibrationSample, TokenUsageCalibrationTrace } from './contracts/token-calibration.js';
21
+ export { ModelReasoningConfig, REASONING_EFFORTS, ReasoningEffort, isValidReasoningEffort, resolveEffectiveEffort } from './contracts/reasoning.js';
22
+ export { AssistantReplayPart, AssistantReplayParts, ProviderContinuation, ProviderContinuationProducer, ProviderContinuations } from './contracts/provider-continuation.js';
23
+ export { SummarizationCallbacks } from './contracts/summarization.js';
24
+ export { Status, ToolCallPhase } from './contracts/runtime-status.js';
package/dist/index.cjs CHANGED
@@ -9890,6 +9890,15 @@ var ToolNode = class {
9890
9890
  });
9891
9891
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9892
9892
  }
9893
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9894
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
9895
+ toolName: context.toolName,
9896
+ toolCallId: context.toolCallId,
9897
+ conversationId: context.conversationId,
9898
+ turnId: context.turnId
9899
+ });
9900
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9901
+ }
9893
9902
  return {
9894
9903
  kind: "route",
9895
9904
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -9972,6 +9981,9 @@ var ToolNode = class {
9972
9981
  if (fuse.shouldFuse && remainingCalls.length === 0) {
9973
9982
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
9974
9983
  }
9984
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9985
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9986
+ }
9975
9987
  return {
9976
9988
  kind: "route",
9977
9989
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -10496,7 +10508,8 @@ function createHostToolCallBootstrap(input) {
10496
10508
  conversationId,
10497
10509
  turnId,
10498
10510
  history: [...input.history ?? [], decisionEvent],
10499
- pendingToolCalls: [toolCall]
10511
+ pendingToolCalls: [toolCall],
10512
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
10500
10513
  }
10501
10514
  };
10502
10515
  }