agentfootprint 13.0.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2280) hide show
  1. package/AGENTS.md +1 -1
  2. package/CAPABILITIES.md +2 -2
  3. package/README.md +7 -3
  4. package/ai-instructions/claude-code/SKILL.md +1 -1
  5. package/ai-instructions/setup.sh +0 -0
  6. package/bin/agentfootprint-index.mjs +0 -0
  7. package/bin/agentfootprint-lint-tools.mjs +0 -0
  8. package/dist/adapters/observability/auditShapes.js +9 -31
  9. package/dist/adapters/observability/auditShapes.js.map +1 -1
  10. package/dist/bridge/eventMeta.js +1 -1
  11. package/dist/bridge/eventMeta.js.map +1 -1
  12. package/dist/context-bisect/ablation.js +1 -1
  13. package/dist/context-bisect/ablation.js.map +1 -1
  14. package/dist/context-bisect/arms/probe.js +1 -1
  15. package/dist/context-bisect/arms/probe.js.map +1 -1
  16. package/dist/context-bisect/restoration.js +1 -1
  17. package/dist/context-bisect/restoration.js.map +1 -1
  18. package/dist/core/Agent.js +799 -1144
  19. package/dist/core/Agent.js.map +1 -1
  20. package/dist/core/LLMCall.js +47 -86
  21. package/dist/core/LLMCall.js.map +1 -1
  22. package/dist/core/RunnerBase.js +139 -213
  23. package/dist/core/RunnerBase.js.map +1 -1
  24. package/dist/core/agent/arguments/answerRows.js +85 -0
  25. package/dist/core/agent/arguments/answerRows.js.map +1 -0
  26. package/dist/core/agent/arguments/ask.js +28 -91
  27. package/dist/core/agent/arguments/ask.js.map +1 -1
  28. package/dist/core/agent/arguments/dispatch.js +26 -9
  29. package/dist/core/agent/arguments/dispatch.js.map +1 -1
  30. package/dist/core/agent/arguments/kept.js +1 -1
  31. package/dist/core/agent/arguments/partialWindow.js +1 -1
  32. package/dist/core/agent/arguments/partialWindow.js.map +1 -1
  33. package/dist/core/agent/arguments/pendingPrivateAsk.js +123 -0
  34. package/dist/core/agent/arguments/pendingPrivateAsk.js.map +1 -0
  35. package/dist/core/agent/arguments/privateAnswers.js +213 -0
  36. package/dist/core/agent/arguments/privateAnswers.js.map +1 -0
  37. package/dist/core/agent/arguments/resolutionRows.js +175 -0
  38. package/dist/core/agent/arguments/resolutionRows.js.map +1 -0
  39. package/dist/core/agent/arguments/resolve.js +8 -144
  40. package/dist/core/agent/arguments/resolve.js.map +1 -1
  41. package/dist/core/agent/arguments/serve.js +3 -13
  42. package/dist/core/agent/arguments/serve.js.map +1 -1
  43. package/dist/core/agent/arguments/subflow.js +7 -1
  44. package/dist/core/agent/arguments/subflow.js.map +1 -1
  45. package/dist/core/agent/buildAgentChart.js.map +1 -1
  46. package/dist/core/agent/buildToolRegistry.js +1 -1
  47. package/dist/core/agent/callerIdentity.js +21 -106
  48. package/dist/core/agent/callerIdentity.js.map +1 -1
  49. package/dist/core/agent/chartContract.js +4 -0
  50. package/dist/core/agent/chartContract.js.map +1 -0
  51. package/dist/core/agent/checkpointDomain.js +59 -0
  52. package/dist/core/agent/checkpointDomain.js.map +1 -0
  53. package/dist/core/agent/componentObservers.js +134 -0
  54. package/dist/core/agent/componentObservers.js.map +1 -0
  55. package/dist/core/agent/componentResources.js +114 -0
  56. package/dist/core/agent/componentResources.js.map +1 -0
  57. package/dist/core/agent/evidence/evidenceIndex.js +1 -1
  58. package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
  59. package/dist/core/agent/evidence/frames.js +2 -1
  60. package/dist/core/agent/evidence/frames.js.map +1 -1
  61. package/dist/core/agent/evidence/servedJson.js +1 -1
  62. package/dist/core/agent/findings/contingent.js +1 -1
  63. package/dist/core/agent/findings/judge.js +1 -1
  64. package/dist/core/agent/findings/unsettled.js +3 -3
  65. package/dist/core/agent/honesty/inputsMountContract.js +3 -0
  66. package/dist/core/agent/honesty/inputsMountContract.js.map +1 -0
  67. package/dist/core/agent/honesty/mounts.js +42 -30
  68. package/dist/core/agent/honesty/mounts.js.map +1 -1
  69. package/dist/core/agent/hostTurn.js +40 -0
  70. package/dist/core/agent/hostTurn.js.map +1 -0
  71. package/dist/core/agent/pauseOwnership.js +105 -0
  72. package/dist/core/agent/pauseOwnership.js.map +1 -0
  73. package/dist/core/agent/presentTool.js +1 -1
  74. package/dist/core/agent/resultCeiling.js +1 -1
  75. package/dist/core/agent/resumeAnswer.js +49 -0
  76. package/dist/core/agent/resumeAnswer.js.map +1 -0
  77. package/dist/core/agent/resumeCheckpoint.js +40 -0
  78. package/dist/core/agent/resumeCheckpoint.js.map +1 -0
  79. package/dist/core/agent/resumeError.js +15 -0
  80. package/dist/core/agent/resumeError.js.map +1 -0
  81. package/dist/core/agent/run/clocks.js +88 -0
  82. package/dist/core/agent/run/clocks.js.map +1 -0
  83. package/dist/core/agent/run/commitRunRedaction.js +16 -0
  84. package/dist/core/agent/run/commitRunRedaction.js.map +1 -0
  85. package/dist/core/agent/run/eventStageIds.js +44 -0
  86. package/dist/core/agent/run/eventStageIds.js.map +1 -0
  87. package/dist/core/agent/run/injectionDelivery.js +30 -0
  88. package/dist/core/agent/run/injectionDelivery.js.map +1 -0
  89. package/dist/core/agent/run/ledgerFacts.js +36 -0
  90. package/dist/core/agent/run/ledgerFacts.js.map +1 -0
  91. package/dist/core/agent/run/resumeRedaction.js +41 -0
  92. package/dist/core/agent/run/resumeRedaction.js.map +1 -0
  93. package/dist/core/agent/run/withoutTime.js +17 -0
  94. package/dist/core/agent/run/withoutTime.js.map +1 -0
  95. package/dist/core/agent/runValues.js +18 -0
  96. package/dist/core/agent/runValues.js.map +1 -0
  97. package/dist/core/agent/scripts/rows.js +1 -1
  98. package/dist/core/agent/selfCallNotice.js +1 -1
  99. package/dist/core/agent/selfCallNotice.js.map +1 -1
  100. package/dist/core/agent/stages/argumentAsk.js +39 -10
  101. package/dist/core/agent/stages/argumentAsk.js.map +1 -1
  102. package/dist/core/agent/stages/argumentParties.js +54 -0
  103. package/dist/core/agent/stages/argumentParties.js.map +1 -0
  104. package/dist/core/agent/stages/batchParties.js +88 -0
  105. package/dist/core/agent/stages/batchParties.js.map +1 -0
  106. package/dist/core/agent/stages/callLLM.js +3 -3
  107. package/dist/core/agent/stages/callLLM.js.map +1 -1
  108. package/dist/core/agent/stages/finalStageContract.js +4 -0
  109. package/dist/core/agent/stages/finalStageContract.js.map +1 -0
  110. package/dist/core/agent/stages/prepareFinal.js +10 -1
  111. package/dist/core/agent/stages/prepareFinal.js.map +1 -1
  112. package/dist/core/agent/stages/searchCoverage.js +1 -1
  113. package/dist/core/agent/stages/seed.js +16 -32
  114. package/dist/core/agent/stages/seed.js.map +1 -1
  115. package/dist/core/agent/stages/servedParties.js +220 -0
  116. package/dist/core/agent/stages/servedParties.js.map +1 -0
  117. package/dist/core/agent/stages/timeLayer.js +2 -2
  118. package/dist/core/agent/stages/toolCallShape.js +22 -0
  119. package/dist/core/agent/stages/toolCallShape.js.map +1 -0
  120. package/dist/core/agent/stages/toolCalls/access/argumentGate.js +48 -0
  121. package/dist/core/agent/stages/toolCalls/access/argumentGate.js.map +1 -0
  122. package/dist/core/agent/stages/toolCalls/access/argumentValidation.js +33 -0
  123. package/dist/core/agent/stages/toolCalls/access/argumentValidation.js.map +1 -0
  124. package/dist/core/agent/stages/toolCalls/access/bindings.js +98 -0
  125. package/dist/core/agent/stages/toolCalls/access/bindings.js.map +1 -0
  126. package/dist/core/agent/stages/toolCalls/access/callState.js +79 -0
  127. package/dist/core/agent/stages/toolCalls/access/callState.js.map +1 -0
  128. package/dist/core/agent/stages/toolCalls/access/capabilityQuestion.js +81 -0
  129. package/dist/core/agent/stages/toolCalls/access/capabilityQuestion.js.map +1 -0
  130. package/dist/core/agent/stages/toolCalls/access/checkInAdmission.js +144 -0
  131. package/dist/core/agent/stages/toolCalls/access/checkInAdmission.js.map +1 -0
  132. package/dist/core/agent/stages/toolCalls/access/heldAnswer.js +39 -0
  133. package/dist/core/agent/stages/toolCalls/access/heldAnswer.js.map +1 -0
  134. package/dist/core/agent/stages/toolCalls/access/middlewareAdmission.js +141 -0
  135. package/dist/core/agent/stages/toolCalls/access/middlewareAdmission.js.map +1 -0
  136. package/dist/core/agent/stages/toolCalls/access/toolPermission.js +103 -0
  137. package/dist/core/agent/stages/toolCalls/access/toolPermission.js.map +1 -0
  138. package/dist/core/agent/stages/toolCalls/batch/completion.js +28 -0
  139. package/dist/core/agent/stages/toolCalls/batch/completion.js.map +1 -0
  140. package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js +137 -0
  141. package/dist/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -0
  142. package/dist/core/agent/stages/toolCalls/batch/execute.js +181 -0
  143. package/dist/core/agent/stages/toolCalls/batch/execute.js.map +1 -0
  144. package/dist/core/agent/stages/toolCalls/batch/findingsAdmission.js +52 -0
  145. package/dist/core/agent/stages/toolCalls/batch/findingsAdmission.js.map +1 -0
  146. package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js +22 -0
  147. package/dist/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -0
  148. package/dist/core/agent/stages/toolCalls/batch/paused.js +93 -0
  149. package/dist/core/agent/stages/toolCalls/batch/paused.js.map +1 -0
  150. package/dist/core/agent/stages/toolCalls/batch/refusal.js +36 -0
  151. package/dist/core/agent/stages/toolCalls/batch/refusal.js.map +1 -0
  152. package/dist/core/agent/stages/toolCalls/batch/settle.js +69 -0
  153. package/dist/core/agent/stages/toolCalls/batch/settle.js.map +1 -0
  154. package/dist/core/agent/stages/toolCalls/batch/settlementOperations.js +107 -0
  155. package/dist/core/agent/stages/toolCalls/batch/settlementOperations.js.map +1 -0
  156. package/dist/core/agent/stages/toolCalls/compose.js +353 -0
  157. package/dist/core/agent/stages/toolCalls/compose.js.map +1 -0
  158. package/dist/core/agent/stages/toolCalls/contracts/access.js +3 -0
  159. package/dist/core/agent/stages/toolCalls/contracts/access.js.map +1 -0
  160. package/dist/core/agent/stages/toolCalls/contracts/artifacts.js +3 -0
  161. package/dist/core/agent/stages/toolCalls/contracts/artifacts.js.map +1 -0
  162. package/dist/core/agent/stages/toolCalls/contracts/batchCall.js +3 -0
  163. package/dist/core/agent/stages/toolCalls/contracts/batchCall.js.map +1 -0
  164. package/dist/core/agent/stages/toolCalls/contracts/callCells.js +3 -0
  165. package/dist/core/agent/stages/toolCalls/contracts/callCells.js.map +1 -0
  166. package/dist/core/agent/stages/toolCalls/contracts/callFacts.js +3 -0
  167. package/dist/core/agent/stages/toolCalls/contracts/callFacts.js.map +1 -0
  168. package/dist/core/agent/stages/toolCalls/contracts/catalog.js +3 -0
  169. package/dist/core/agent/stages/toolCalls/contracts/catalog.js.map +1 -0
  170. package/dist/core/agent/stages/toolCalls/contracts/dispatchBatch.js +3 -0
  171. package/dist/core/agent/stages/toolCalls/contracts/dispatchBatch.js.map +1 -0
  172. package/dist/core/agent/stages/toolCalls/contracts/dispatchCall.js +3 -0
  173. package/dist/core/agent/stages/toolCalls/contracts/dispatchCall.js.map +1 -0
  174. package/dist/core/agent/stages/toolCalls/contracts/evidence.js +3 -0
  175. package/dist/core/agent/stages/toolCalls/contracts/evidence.js.map +1 -0
  176. package/dist/core/agent/stages/toolCalls/contracts/handlerDeps.js +3 -0
  177. package/dist/core/agent/stages/toolCalls/contracts/handlerDeps.js.map +1 -0
  178. package/dist/core/agent/stages/toolCalls/contracts/inputsDispatch.js +10 -0
  179. package/dist/core/agent/stages/toolCalls/contracts/inputsDispatch.js.map +1 -0
  180. package/dist/core/agent/stages/toolCalls/contracts/invocationInputs.js +3 -0
  181. package/dist/core/agent/stages/toolCalls/contracts/invocationInputs.js.map +1 -0
  182. package/dist/core/agent/stages/toolCalls/contracts/observation.js +3 -0
  183. package/dist/core/agent/stages/toolCalls/contracts/observation.js.map +1 -0
  184. package/dist/core/agent/stages/toolCalls/contracts/operations/artifacts.js +3 -0
  185. package/dist/core/agent/stages/toolCalls/contracts/operations/artifacts.js.map +1 -0
  186. package/dist/core/agent/stages/toolCalls/contracts/operations/catalog.js +3 -0
  187. package/dist/core/agent/stages/toolCalls/contracts/operations/catalog.js.map +1 -0
  188. package/dist/core/agent/stages/toolCalls/contracts/operations/context.js +3 -0
  189. package/dist/core/agent/stages/toolCalls/contracts/operations/context.js.map +1 -0
  190. package/dist/core/agent/stages/toolCalls/contracts/operations/coverage.js +3 -0
  191. package/dist/core/agent/stages/toolCalls/contracts/operations/coverage.js.map +1 -0
  192. package/dist/core/agent/stages/toolCalls/contracts/operations/credentials.js +3 -0
  193. package/dist/core/agent/stages/toolCalls/contracts/operations/credentials.js.map +1 -0
  194. package/dist/core/agent/stages/toolCalls/contracts/operations/effects.js +3 -0
  195. package/dist/core/agent/stages/toolCalls/contracts/operations/effects.js.map +1 -0
  196. package/dist/core/agent/stages/toolCalls/contracts/operations/integrity.js +3 -0
  197. package/dist/core/agent/stages/toolCalls/contracts/operations/integrity.js.map +1 -0
  198. package/dist/core/agent/stages/toolCalls/contracts/operations/limits.js +3 -0
  199. package/dist/core/agent/stages/toolCalls/contracts/operations/limits.js.map +1 -0
  200. package/dist/core/agent/stages/toolCalls/contracts/operations/middleware.js +3 -0
  201. package/dist/core/agent/stages/toolCalls/contracts/operations/middleware.js.map +1 -0
  202. package/dist/core/agent/stages/toolCalls/contracts/operations/observations.js +3 -0
  203. package/dist/core/agent/stages/toolCalls/contracts/operations/observations.js.map +1 -0
  204. package/dist/core/agent/stages/toolCalls/contracts/operations/progress.js +3 -0
  205. package/dist/core/agent/stages/toolCalls/contracts/operations/progress.js.map +1 -0
  206. package/dist/core/agent/stages/toolCalls/contracts/operations/resources.js +3 -0
  207. package/dist/core/agent/stages/toolCalls/contracts/operations/resources.js.map +1 -0
  208. package/dist/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js +3 -0
  209. package/dist/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js.map +1 -0
  210. package/dist/core/agent/stages/toolCalls/contracts/operations/scripts.js +3 -0
  211. package/dist/core/agent/stages/toolCalls/contracts/operations/scripts.js.map +1 -0
  212. package/dist/core/agent/stages/toolCalls/contracts/operations/semantics.js +3 -0
  213. package/dist/core/agent/stages/toolCalls/contracts/operations/semantics.js.map +1 -0
  214. package/dist/core/agent/stages/toolCalls/contracts/operations/settlement.js +3 -0
  215. package/dist/core/agent/stages/toolCalls/contracts/operations/settlement.js.map +1 -0
  216. package/dist/core/agent/stages/toolCalls/contracts/operations/steps.js +3 -0
  217. package/dist/core/agent/stages/toolCalls/contracts/operations/steps.js.map +1 -0
  218. package/dist/core/agent/stages/toolCalls/contracts/resources.js +3 -0
  219. package/dist/core/agent/stages/toolCalls/contracts/resources.js.map +1 -0
  220. package/dist/core/agent/stages/toolCalls/contracts/results.js +3 -0
  221. package/dist/core/agent/stages/toolCalls/contracts/results.js.map +1 -0
  222. package/dist/core/agent/stages/toolCalls/contracts/resumeFrames.js +3 -0
  223. package/dist/core/agent/stages/toolCalls/contracts/resumeFrames.js.map +1 -0
  224. package/dist/core/agent/stages/toolCalls/contracts/routing.js +3 -0
  225. package/dist/core/agent/stages/toolCalls/contracts/routing.js.map +1 -0
  226. package/dist/core/agent/stages/toolCalls/decorators/limitsOperations.js +84 -0
  227. package/dist/core/agent/stages/toolCalls/decorators/limitsOperations.js.map +1 -0
  228. package/dist/core/agent/stages/toolCalls/decorators/middlewareOperations.js +87 -0
  229. package/dist/core/agent/stages/toolCalls/decorators/middlewareOperations.js.map +1 -0
  230. package/dist/core/agent/stages/toolCalls/decorators/reportingCredentials.js +53 -0
  231. package/dist/core/agent/stages/toolCalls/decorators/reportingCredentials.js.map +1 -0
  232. package/dist/core/agent/stages/toolCalls/evidence/coverageOperations.js +236 -0
  233. package/dist/core/agent/stages/toolCalls/evidence/coverageOperations.js.map +1 -0
  234. package/dist/core/agent/stages/toolCalls/evidence/integrityOperations.js +141 -0
  235. package/dist/core/agent/stages/toolCalls/evidence/integrityOperations.js.map +1 -0
  236. package/dist/core/agent/stages/toolCalls/evidence/judgeLanded.js +59 -0
  237. package/dist/core/agent/stages/toolCalls/evidence/judgeLanded.js.map +1 -0
  238. package/dist/core/agent/stages/toolCalls/evidence/madeInRun.js +7 -0
  239. package/dist/core/agent/stages/toolCalls/evidence/madeInRun.js.map +1 -0
  240. package/dist/core/agent/stages/toolCalls/evidence/producerCorpus.js +38 -0
  241. package/dist/core/agent/stages/toolCalls/evidence/producerCorpus.js.map +1 -0
  242. package/dist/core/agent/stages/toolCalls/evidence/scriptsOperations.js +160 -0
  243. package/dist/core/agent/stages/toolCalls/evidence/scriptsOperations.js.map +1 -0
  244. package/dist/core/agent/stages/toolCalls/evidence/semanticsOperations.js +94 -0
  245. package/dist/core/agent/stages/toolCalls/evidence/semanticsOperations.js.map +1 -0
  246. package/dist/core/agent/stages/toolCalls/evidence/sourceClock.js +22 -0
  247. package/dist/core/agent/stages/toolCalls/evidence/sourceClock.js.map +1 -0
  248. package/dist/core/agent/stages/toolCalls/evidence/towers.js +42 -0
  249. package/dist/core/agent/stages/toolCalls/evidence/towers.js.map +1 -0
  250. package/dist/core/agent/stages/toolCalls/execution/artifactsOperations.js +265 -0
  251. package/dist/core/agent/stages/toolCalls/execution/artifactsOperations.js.map +1 -0
  252. package/dist/core/agent/stages/toolCalls/execution/callStart.js +107 -0
  253. package/dist/core/agent/stages/toolCalls/execution/callStart.js.map +1 -0
  254. package/dist/core/agent/stages/toolCalls/execution/catalogOperations.js +200 -0
  255. package/dist/core/agent/stages/toolCalls/execution/catalogOperations.js.map +1 -0
  256. package/dist/core/agent/stages/toolCalls/execution/contextOperations.js +190 -0
  257. package/dist/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -0
  258. package/dist/core/agent/stages/toolCalls/execution/credentialAdmission.js +128 -0
  259. package/dist/core/agent/stages/toolCalls/execution/credentialAdmission.js.map +1 -0
  260. package/dist/core/agent/stages/toolCalls/execution/credentialsOperations.js +15 -0
  261. package/dist/core/agent/stages/toolCalls/execution/credentialsOperations.js.map +1 -0
  262. package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js +172 -0
  263. package/dist/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -0
  264. package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js +515 -0
  265. package/dist/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -0
  266. package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js +368 -0
  267. package/dist/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -0
  268. package/dist/core/agent/stages/toolCalls/execution/resourcesOperations.js +90 -0
  269. package/dist/core/agent/stages/toolCalls/execution/resourcesOperations.js.map +1 -0
  270. package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js +429 -0
  271. package/dist/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -0
  272. package/dist/core/agent/stages/toolCalls/execution/wantedArguments.js +18 -0
  273. package/dist/core/agent/stages/toolCalls/execution/wantedArguments.js.map +1 -0
  274. package/dist/core/agent/stages/toolCalls/helpers/dedupeIds.js +10 -0
  275. package/dist/core/agent/stages/toolCalls/helpers/dedupeIds.js.map +1 -0
  276. package/dist/core/agent/stages/toolCalls/helpers/dispatchRefusals.js +83 -0
  277. package/dist/core/agent/stages/toolCalls/helpers/dispatchRefusals.js.map +1 -0
  278. package/dist/core/agent/stages/toolCalls/helpers/mountedCursor.js +46 -0
  279. package/dist/core/agent/stages/toolCalls/helpers/mountedCursor.js.map +1 -0
  280. package/dist/core/agent/stages/toolCalls/helpers/periodWarnings.js +60 -0
  281. package/dist/core/agent/stages/toolCalls/helpers/periodWarnings.js.map +1 -0
  282. package/dist/core/agent/stages/toolCalls/helpers/readSkillRefusal.js +141 -0
  283. package/dist/core/agent/stages/toolCalls/helpers/readSkillRefusal.js.map +1 -0
  284. package/dist/core/agent/stages/toolCalls/helpers/sourceNote.js +10 -0
  285. package/dist/core/agent/stages/toolCalls/helpers/sourceNote.js.map +1 -0
  286. package/dist/core/agent/stages/toolCalls/helpers/unscopedRun.js +15 -0
  287. package/dist/core/agent/stages/toolCalls/helpers/unscopedRun.js.map +1 -0
  288. package/dist/core/agent/stages/toolCalls/index.js +33 -0
  289. package/dist/core/agent/stages/toolCalls/index.js.map +1 -0
  290. package/dist/core/agent/stages/toolCalls/observation/callSettlement.js +48 -0
  291. package/dist/core/agent/stages/toolCalls/observation/callSettlement.js.map +1 -0
  292. package/dist/core/agent/stages/toolCalls/observation/observationsOperations.js +61 -0
  293. package/dist/core/agent/stages/toolCalls/observation/observationsOperations.js.map +1 -0
  294. package/dist/core/agent/stages/toolCalls/observation/progressOperations.js +32 -0
  295. package/dist/core/agent/stages/toolCalls/observation/progressOperations.js.map +1 -0
  296. package/dist/core/agent/stages/toolCalls/resume/ask.js +427 -0
  297. package/dist/core/agent/stages/toolCalls/resume/ask.js.map +1 -0
  298. package/dist/core/agent/stages/toolCalls/resume/checkIn.js +193 -0
  299. package/dist/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -0
  300. package/dist/core/agent/stages/toolCalls/resume/credential.js +139 -0
  301. package/dist/core/agent/stages/toolCalls/resume/credential.js.map +1 -0
  302. package/dist/core/agent/stages/toolCalls/resume/handler.js +175 -0
  303. package/dist/core/agent/stages/toolCalls/resume/handler.js.map +1 -0
  304. package/dist/core/agent/stages/toolCalls/resume/plain.js +144 -0
  305. package/dist/core/agent/stages/toolCalls/resume/plain.js.map +1 -0
  306. package/dist/core/agent/stages/toolCalls/routing/effectsOperations.js +264 -0
  307. package/dist/core/agent/stages/toolCalls/routing/effectsOperations.js.map +1 -0
  308. package/dist/core/agent/stages/toolCalls/routing/policyHalt.js +40 -0
  309. package/dist/core/agent/stages/toolCalls/routing/policyHalt.js.map +1 -0
  310. package/dist/core/agent/stages/toolCalls/routing/readSkillRoute.js +238 -0
  311. package/dist/core/agent/stages/toolCalls/routing/readSkillRoute.js.map +1 -0
  312. package/dist/core/agent/stages/toolCalls/routing/skillActivation.js +52 -0
  313. package/dist/core/agent/stages/toolCalls/routing/skillActivation.js.map +1 -0
  314. package/dist/core/agent/stages/toolCalls/routing/stepsOperations.js +149 -0
  315. package/dist/core/agent/stages/toolCalls/routing/stepsOperations.js.map +1 -0
  316. package/dist/core/agent/stages/toolResolver.js +84 -38
  317. package/dist/core/agent/stages/toolResolver.js.map +1 -1
  318. package/dist/core/agent/toolChoice/pick.js +1 -1
  319. package/dist/core/agent/toolResultCap.js +0 -0
  320. package/dist/core/agent/types.js +0 -3
  321. package/dist/core/agent/types.js.map +1 -1
  322. package/dist/core/agent/window/toolNames.js +3 -3
  323. package/dist/core/answerConsumption.js +16 -0
  324. package/dist/core/answerConsumption.js.map +1 -0
  325. package/dist/core/checkin.js +1 -1
  326. package/dist/core/codeRunnerTool.js +1 -1
  327. package/dist/core/consentLedger.js +124 -0
  328. package/dist/core/consentLedger.js.map +1 -0
  329. package/dist/core/consentRequest.js +38 -156
  330. package/dist/core/consentRequest.js.map +1 -1
  331. package/dist/core/conversation.js +15 -48
  332. package/dist/core/conversation.js.map +1 -1
  333. package/dist/core/memberRun.js +2 -1
  334. package/dist/core/memberRun.js.map +1 -1
  335. package/dist/core/pause.js +5 -5
  336. package/dist/core/pauseRecord.js +23 -0
  337. package/dist/core/pauseRecord.js.map +1 -0
  338. package/dist/core/runEntry.js +30 -0
  339. package/dist/core/runEntry.js.map +1 -0
  340. package/dist/core/runnerCoreValues.js +3 -0
  341. package/dist/core/runnerCoreValues.js.map +1 -0
  342. package/dist/core/runnerExecution.js +175 -0
  343. package/dist/core/runnerExecution.js.map +1 -0
  344. package/dist/core/runnerLive.js.map +1 -1
  345. package/dist/core/slots/buildThinkingSubflow.js +2 -2
  346. package/dist/core/slots/buildThinkingSubflow.js.map +1 -1
  347. package/dist/core/slots/buildToolsSlot.js +25 -102
  348. package/dist/core/slots/buildToolsSlot.js.map +1 -1
  349. package/dist/core/slots/discoverTools.js +99 -0
  350. package/dist/core/slots/discoverTools.js.map +1 -0
  351. package/dist/core-flow/Conditional.js +25 -72
  352. package/dist/core-flow/Conditional.js.map +1 -1
  353. package/dist/core-flow/Graph.js +63 -120
  354. package/dist/core-flow/Graph.js.map +1 -1
  355. package/dist/core-flow/Loop.js +28 -82
  356. package/dist/core-flow/Loop.js.map +1 -1
  357. package/dist/core-flow/Parallel.js +58 -148
  358. package/dist/core-flow/Parallel.js.map +1 -1
  359. package/dist/core-flow/Sequence.js +25 -73
  360. package/dist/core-flow/Sequence.js.map +1 -1
  361. package/dist/core-flow/Workflow.js +24 -72
  362. package/dist/core-flow/Workflow.js.map +1 -1
  363. package/dist/esm/adapters/observability/auditShapes.d.ts +5 -31
  364. package/dist/esm/adapters/observability/auditShapes.js +9 -31
  365. package/dist/esm/adapters/observability/auditShapes.js.map +1 -1
  366. package/dist/esm/adapters/observability/otel.d.ts +1 -1
  367. package/dist/esm/bridge/eventMeta.d.ts +2 -0
  368. package/dist/esm/bridge/eventMeta.js +1 -1
  369. package/dist/esm/bridge/eventMeta.js.map +1 -1
  370. package/dist/esm/context-bisect/ablation.js +1 -1
  371. package/dist/esm/context-bisect/ablation.js.map +1 -1
  372. package/dist/esm/context-bisect/arms/probe.js +1 -1
  373. package/dist/esm/context-bisect/arms/probe.js.map +1 -1
  374. package/dist/esm/context-bisect/restoration.js +1 -1
  375. package/dist/esm/context-bisect/restoration.js.map +1 -1
  376. package/dist/esm/core/Agent.d.ts +18 -121
  377. package/dist/esm/core/Agent.js +800 -1145
  378. package/dist/esm/core/Agent.js.map +1 -1
  379. package/dist/esm/core/LLMCall.d.ts +1 -4
  380. package/dist/esm/core/LLMCall.js +49 -88
  381. package/dist/esm/core/LLMCall.js.map +1 -1
  382. package/dist/esm/core/RunnerBase.d.ts +42 -114
  383. package/dist/esm/core/RunnerBase.js +140 -210
  384. package/dist/esm/core/RunnerBase.js.map +1 -1
  385. package/dist/esm/core/agent/arguments/answerRows.d.ts +26 -0
  386. package/dist/esm/core/agent/arguments/answerRows.js +78 -0
  387. package/dist/esm/core/agent/arguments/answerRows.js.map +1 -0
  388. package/dist/esm/core/agent/arguments/ask.d.ts +5 -11
  389. package/dist/esm/core/agent/arguments/ask.js +24 -87
  390. package/dist/esm/core/agent/arguments/ask.js.map +1 -1
  391. package/dist/esm/core/agent/arguments/dispatch.d.ts +4 -4
  392. package/dist/esm/core/agent/arguments/dispatch.js +27 -10
  393. package/dist/esm/core/agent/arguments/dispatch.js.map +1 -1
  394. package/dist/esm/core/agent/arguments/kept.d.ts +1 -1
  395. package/dist/esm/core/agent/arguments/kept.js +1 -1
  396. package/dist/esm/core/agent/arguments/partialWindow.d.ts +2 -1
  397. package/dist/esm/core/agent/arguments/partialWindow.js +1 -1
  398. package/dist/esm/core/agent/arguments/partialWindow.js.map +1 -1
  399. package/dist/esm/core/agent/arguments/pendingPrivateAsk.d.ts +37 -0
  400. package/dist/esm/core/agent/arguments/pendingPrivateAsk.js +114 -0
  401. package/dist/esm/core/agent/arguments/pendingPrivateAsk.js.map +1 -0
  402. package/dist/esm/core/agent/arguments/privateAnswers.d.ts +46 -0
  403. package/dist/esm/core/agent/arguments/privateAnswers.js +198 -0
  404. package/dist/esm/core/agent/arguments/privateAnswers.js.map +1 -0
  405. package/dist/esm/core/agent/arguments/resolutionRows.d.ts +29 -0
  406. package/dist/esm/core/agent/arguments/resolutionRows.js +171 -0
  407. package/dist/esm/core/agent/arguments/resolutionRows.js.map +1 -0
  408. package/dist/esm/core/agent/arguments/resolve.d.ts +2 -13
  409. package/dist/esm/core/agent/arguments/resolve.js +8 -144
  410. package/dist/esm/core/agent/arguments/resolve.js.map +1 -1
  411. package/dist/esm/core/agent/arguments/serve.d.ts +0 -5
  412. package/dist/esm/core/agent/arguments/serve.js +3 -12
  413. package/dist/esm/core/agent/arguments/serve.js.map +1 -1
  414. package/dist/esm/core/agent/arguments/subflow.js +7 -1
  415. package/dist/esm/core/agent/arguments/subflow.js.map +1 -1
  416. package/dist/esm/core/agent/buildAgentChart.d.ts +3 -326
  417. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  418. package/dist/esm/core/agent/buildToolRegistry.d.ts +1 -1
  419. package/dist/esm/core/agent/buildToolRegistry.js +1 -1
  420. package/dist/esm/core/agent/callerIdentity.d.ts +9 -64
  421. package/dist/esm/core/agent/callerIdentity.js +21 -106
  422. package/dist/esm/core/agent/callerIdentity.js.map +1 -1
  423. package/dist/esm/core/agent/chartContract.d.ts +327 -0
  424. package/dist/esm/core/agent/chartContract.js +3 -0
  425. package/dist/esm/core/agent/chartContract.js.map +1 -0
  426. package/dist/esm/core/agent/checkpointDomain.d.ts +11 -0
  427. package/dist/esm/core/agent/checkpointDomain.js +53 -0
  428. package/dist/esm/core/agent/checkpointDomain.js.map +1 -0
  429. package/dist/esm/core/agent/componentObservers.d.ts +14 -0
  430. package/dist/esm/core/agent/componentObservers.js +129 -0
  431. package/dist/esm/core/agent/componentObservers.js.map +1 -0
  432. package/dist/esm/core/agent/componentResources.d.ts +39 -0
  433. package/dist/esm/core/agent/componentResources.js +110 -0
  434. package/dist/esm/core/agent/componentResources.js.map +1 -0
  435. package/dist/esm/core/agent/evidence/evidenceIndex.js +1 -1
  436. package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
  437. package/dist/esm/core/agent/evidence/frames.js +3 -2
  438. package/dist/esm/core/agent/evidence/frames.js.map +1 -1
  439. package/dist/esm/core/agent/evidence/servedJson.d.ts +1 -1
  440. package/dist/esm/core/agent/evidence/servedJson.js +1 -1
  441. package/dist/esm/core/agent/findings/contingent.d.ts +1 -1
  442. package/dist/esm/core/agent/findings/contingent.js +1 -1
  443. package/dist/esm/core/agent/findings/judge.d.ts +1 -1
  444. package/dist/esm/core/agent/findings/judge.js +1 -1
  445. package/dist/esm/core/agent/findings/types.d.ts +1 -1
  446. package/dist/esm/core/agent/findings/unsettled.d.ts +3 -3
  447. package/dist/esm/core/agent/findings/unsettled.js +3 -3
  448. package/dist/esm/core/agent/honesty/inputsMountContract.d.ts +66 -0
  449. package/dist/esm/core/agent/honesty/inputsMountContract.js +2 -0
  450. package/dist/esm/core/agent/honesty/inputsMountContract.js.map +1 -0
  451. package/dist/esm/core/agent/honesty/mounts.d.ts +4 -66
  452. package/dist/esm/core/agent/honesty/mounts.js +42 -30
  453. package/dist/esm/core/agent/honesty/mounts.js.map +1 -1
  454. package/dist/esm/core/agent/hostTurn.d.ts +17 -0
  455. package/dist/esm/core/agent/hostTurn.js +36 -0
  456. package/dist/esm/core/agent/hostTurn.js.map +1 -0
  457. package/dist/esm/core/agent/pauseOwnership.d.ts +24 -0
  458. package/dist/esm/core/agent/pauseOwnership.js +97 -0
  459. package/dist/esm/core/agent/pauseOwnership.js.map +1 -0
  460. package/dist/esm/core/agent/presentTool.d.ts +1 -1
  461. package/dist/esm/core/agent/presentTool.js +1 -1
  462. package/dist/esm/core/agent/resultCeiling.d.ts +1 -1
  463. package/dist/esm/core/agent/resultCeiling.js +1 -1
  464. package/dist/esm/core/agent/resumeAnswer.d.ts +10 -0
  465. package/dist/esm/core/agent/resumeAnswer.js +43 -0
  466. package/dist/esm/core/agent/resumeAnswer.js.map +1 -0
  467. package/dist/esm/core/agent/resumeCheckpoint.d.ts +12 -0
  468. package/dist/esm/core/agent/resumeCheckpoint.js +34 -0
  469. package/dist/esm/core/agent/resumeCheckpoint.js.map +1 -0
  470. package/dist/esm/core/agent/resumeError.d.ts +8 -0
  471. package/dist/esm/core/agent/resumeError.js +11 -0
  472. package/dist/esm/core/agent/resumeError.js.map +1 -0
  473. package/dist/esm/core/agent/run/clocks.d.ts +44 -0
  474. package/dist/esm/core/agent/run/clocks.js +81 -0
  475. package/dist/esm/core/agent/run/clocks.js.map +1 -0
  476. package/dist/esm/core/agent/run/commitRunRedaction.d.ts +4 -0
  477. package/dist/esm/core/agent/run/commitRunRedaction.js +12 -0
  478. package/dist/esm/core/agent/run/commitRunRedaction.js.map +1 -0
  479. package/dist/esm/core/agent/run/eventStageIds.d.ts +40 -0
  480. package/dist/esm/core/agent/run/eventStageIds.js +41 -0
  481. package/dist/esm/core/agent/run/eventStageIds.js.map +1 -0
  482. package/dist/esm/core/agent/run/injectionDelivery.d.ts +4 -0
  483. package/dist/esm/core/agent/run/injectionDelivery.js +26 -0
  484. package/dist/esm/core/agent/run/injectionDelivery.js.map +1 -0
  485. package/dist/esm/core/agent/run/ledgerFacts.d.ts +8 -0
  486. package/dist/esm/core/agent/run/ledgerFacts.js +31 -0
  487. package/dist/esm/core/agent/run/ledgerFacts.js.map +1 -0
  488. package/dist/esm/core/agent/run/resumeRedaction.d.ts +6 -0
  489. package/dist/esm/core/agent/run/resumeRedaction.js +36 -0
  490. package/dist/esm/core/agent/run/resumeRedaction.js.map +1 -0
  491. package/dist/esm/core/agent/run/withoutTime.d.ts +8 -0
  492. package/dist/esm/core/agent/run/withoutTime.js +13 -0
  493. package/dist/esm/core/agent/run/withoutTime.js.map +1 -0
  494. package/dist/esm/core/agent/runValues.d.ts +71 -0
  495. package/dist/esm/core/agent/runValues.js +14 -0
  496. package/dist/esm/core/agent/runValues.js.map +1 -0
  497. package/dist/esm/core/agent/scripts/rows.d.ts +1 -1
  498. package/dist/esm/core/agent/scripts/rows.js +1 -1
  499. package/dist/esm/core/agent/scripts/types.d.ts +1 -1
  500. package/dist/esm/core/agent/selfCallNotice.js +1 -1
  501. package/dist/esm/core/agent/selfCallNotice.js.map +1 -1
  502. package/dist/esm/core/agent/stages/argumentAsk.d.ts +7 -1
  503. package/dist/esm/core/agent/stages/argumentAsk.js +39 -10
  504. package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
  505. package/dist/esm/core/agent/stages/argumentParties.d.ts +3 -0
  506. package/dist/esm/core/agent/stages/argumentParties.js +50 -0
  507. package/dist/esm/core/agent/stages/argumentParties.js.map +1 -0
  508. package/dist/esm/core/agent/stages/batchParties.d.ts +21 -0
  509. package/dist/esm/core/agent/stages/batchParties.js +81 -0
  510. package/dist/esm/core/agent/stages/batchParties.js.map +1 -0
  511. package/dist/esm/core/agent/stages/callLLM.js +3 -3
  512. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  513. package/dist/esm/core/agent/stages/finalStageContract.d.ts +45 -0
  514. package/dist/esm/core/agent/stages/finalStageContract.js +3 -0
  515. package/dist/esm/core/agent/stages/finalStageContract.js.map +1 -0
  516. package/dist/esm/core/agent/stages/prepareFinal.d.ts +2 -45
  517. package/dist/esm/core/agent/stages/prepareFinal.js +9 -0
  518. package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
  519. package/dist/esm/core/agent/stages/searchCoverage.d.ts +1 -1
  520. package/dist/esm/core/agent/stages/searchCoverage.js +1 -1
  521. package/dist/esm/core/agent/stages/seed.js +15 -31
  522. package/dist/esm/core/agent/stages/seed.js.map +1 -1
  523. package/dist/esm/core/agent/stages/servedParties.d.ts +39 -0
  524. package/dist/esm/core/agent/stages/servedParties.js +214 -0
  525. package/dist/esm/core/agent/stages/servedParties.js.map +1 -0
  526. package/dist/esm/core/agent/stages/timeLayer.d.ts +3 -3
  527. package/dist/esm/core/agent/stages/timeLayer.js +2 -2
  528. package/dist/esm/core/agent/stages/toolCallShape.d.ts +7 -0
  529. package/dist/esm/core/agent/stages/toolCallShape.js +18 -0
  530. package/dist/esm/core/agent/stages/toolCallShape.js.map +1 -0
  531. package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.d.ts +21 -0
  532. package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.js +44 -0
  533. package/dist/esm/core/agent/stages/toolCalls/access/argumentGate.js.map +1 -0
  534. package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.d.ts +10 -0
  535. package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.js +29 -0
  536. package/dist/esm/core/agent/stages/toolCalls/access/argumentValidation.js.map +1 -0
  537. package/dist/esm/core/agent/stages/toolCalls/access/bindings.d.ts +61 -0
  538. package/dist/esm/core/agent/stages/toolCalls/access/bindings.js +88 -0
  539. package/dist/esm/core/agent/stages/toolCalls/access/bindings.js.map +1 -0
  540. package/dist/esm/core/agent/stages/toolCalls/access/callState.d.ts +14 -0
  541. package/dist/esm/core/agent/stages/toolCalls/access/callState.js +75 -0
  542. package/dist/esm/core/agent/stages/toolCalls/access/callState.js.map +1 -0
  543. package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts +28 -0
  544. package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.js +77 -0
  545. package/dist/esm/core/agent/stages/toolCalls/access/capabilityQuestion.js.map +1 -0
  546. package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.d.ts +44 -0
  547. package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.js +140 -0
  548. package/dist/esm/core/agent/stages/toolCalls/access/checkInAdmission.js.map +1 -0
  549. package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.d.ts +8 -0
  550. package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.js +35 -0
  551. package/dist/esm/core/agent/stages/toolCalls/access/heldAnswer.js.map +1 -0
  552. package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts +50 -0
  553. package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.js +137 -0
  554. package/dist/esm/core/agent/stages/toolCalls/access/middlewareAdmission.js.map +1 -0
  555. package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.d.ts +24 -0
  556. package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.js +99 -0
  557. package/dist/esm/core/agent/stages/toolCalls/access/toolPermission.js.map +1 -0
  558. package/dist/esm/core/agent/stages/toolCalls/batch/completion.d.ts +18 -0
  559. package/dist/esm/core/agent/stages/toolCalls/batch/completion.js +24 -0
  560. package/dist/esm/core/agent/stages/toolCalls/batch/completion.js.map +1 -0
  561. package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.d.ts +36 -0
  562. package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js +133 -0
  563. package/dist/esm/core/agent/stages/toolCalls/batch/dispatchContext.js.map +1 -0
  564. package/dist/esm/core/agent/stages/toolCalls/batch/execute.d.ts +7 -0
  565. package/dist/esm/core/agent/stages/toolCalls/batch/execute.js +154 -0
  566. package/dist/esm/core/agent/stages/toolCalls/batch/execute.js.map +1 -0
  567. package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts +18 -0
  568. package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.js +48 -0
  569. package/dist/esm/core/agent/stages/toolCalls/batch/findingsAdmission.js.map +1 -0
  570. package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +6 -0
  571. package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js +18 -0
  572. package/dist/esm/core/agent/stages/toolCalls/batch/inputResolutions.js.map +1 -0
  573. package/dist/esm/core/agent/stages/toolCalls/batch/paused.d.ts +65 -0
  574. package/dist/esm/core/agent/stages/toolCalls/batch/paused.js +88 -0
  575. package/dist/esm/core/agent/stages/toolCalls/batch/paused.js.map +1 -0
  576. package/dist/esm/core/agent/stages/toolCalls/batch/refusal.d.ts +5 -0
  577. package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js +32 -0
  578. package/dist/esm/core/agent/stages/toolCalls/batch/refusal.js.map +1 -0
  579. package/dist/esm/core/agent/stages/toolCalls/batch/settle.d.ts +66 -0
  580. package/dist/esm/core/agent/stages/toolCalls/batch/settle.js +63 -0
  581. package/dist/esm/core/agent/stages/toolCalls/batch/settle.js.map +1 -0
  582. package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.d.ts +17 -0
  583. package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.js +103 -0
  584. package/dist/esm/core/agent/stages/toolCalls/batch/settlementOperations.js.map +1 -0
  585. package/dist/esm/core/agent/stages/toolCalls/compose.d.ts +239 -0
  586. package/dist/esm/core/agent/stages/toolCalls/compose.js +349 -0
  587. package/dist/esm/core/agent/stages/toolCalls/compose.js.map +1 -0
  588. package/dist/esm/core/agent/stages/toolCalls/contracts/access.d.ts +110 -0
  589. package/dist/esm/core/agent/stages/toolCalls/contracts/access.js +2 -0
  590. package/dist/esm/core/agent/stages/toolCalls/contracts/access.js.map +1 -0
  591. package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.d.ts +26 -0
  592. package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.js +2 -0
  593. package/dist/esm/core/agent/stages/toolCalls/contracts/artifacts.js.map +1 -0
  594. package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.d.ts +8 -0
  595. package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.js +2 -0
  596. package/dist/esm/core/agent/stages/toolCalls/contracts/batchCall.js.map +1 -0
  597. package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.d.ts +43 -0
  598. package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.js +2 -0
  599. package/dist/esm/core/agent/stages/toolCalls/contracts/callCells.js.map +1 -0
  600. package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.d.ts +50 -0
  601. package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.js +2 -0
  602. package/dist/esm/core/agent/stages/toolCalls/contracts/callFacts.js.map +1 -0
  603. package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.d.ts +56 -0
  604. package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.js +2 -0
  605. package/dist/esm/core/agent/stages/toolCalls/contracts/catalog.js.map +1 -0
  606. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts +17 -0
  607. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.js +2 -0
  608. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchBatch.js.map +1 -0
  609. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts +14 -0
  610. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.js +2 -0
  611. package/dist/esm/core/agent/stages/toolCalls/contracts/dispatchCall.js.map +1 -0
  612. package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.d.ts +211 -0
  613. package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.js +2 -0
  614. package/dist/esm/core/agent/stages/toolCalls/contracts/evidence.js.map +1 -0
  615. package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts +11 -0
  616. package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.js +2 -0
  617. package/dist/esm/core/agent/stages/toolCalls/contracts/handlerDeps.js.map +1 -0
  618. package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts +2 -0
  619. package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.js +9 -0
  620. package/dist/esm/core/agent/stages/toolCalls/contracts/inputsDispatch.js.map +1 -0
  621. package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts +11 -0
  622. package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.js +2 -0
  623. package/dist/esm/core/agent/stages/toolCalls/contracts/invocationInputs.js.map +1 -0
  624. package/dist/esm/core/agent/stages/toolCalls/contracts/observation.d.ts +24 -0
  625. package/dist/esm/core/agent/stages/toolCalls/contracts/observation.js +2 -0
  626. package/dist/esm/core/agent/stages/toolCalls/contracts/observation.js.map +1 -0
  627. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts +37 -0
  628. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.js +2 -0
  629. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/artifacts.js.map +1 -0
  630. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts +31 -0
  631. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.js +2 -0
  632. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/catalog.js.map +1 -0
  633. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.d.ts +14 -0
  634. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.js +2 -0
  635. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/context.js.map +1 -0
  636. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts +23 -0
  637. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.js +2 -0
  638. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/coverage.js.map +1 -0
  639. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts +5 -0
  640. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.js +2 -0
  641. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/credentials.js.map +1 -0
  642. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.d.ts +14 -0
  643. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.js +2 -0
  644. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/effects.js.map +1 -0
  645. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts +16 -0
  646. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.js +2 -0
  647. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/integrity.js.map +1 -0
  648. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.d.ts +19 -0
  649. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.js +2 -0
  650. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/limits.js.map +1 -0
  651. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts +25 -0
  652. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.js +2 -0
  653. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/middleware.js.map +1 -0
  654. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.d.ts +8 -0
  655. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.js +2 -0
  656. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/observations.js.map +1 -0
  657. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.d.ts +11 -0
  658. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.js +2 -0
  659. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/progress.js.map +1 -0
  660. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.d.ts +12 -0
  661. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.js +2 -0
  662. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resources.js.map +1 -0
  663. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts +30 -0
  664. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js +2 -0
  665. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.js.map +1 -0
  666. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts +40 -0
  667. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.js +2 -0
  668. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/scripts.js.map +1 -0
  669. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts +10 -0
  670. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.js +2 -0
  671. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/semantics.js.map +1 -0
  672. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts +13 -0
  673. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.js +2 -0
  674. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/settlement.js.map +1 -0
  675. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.d.ts +26 -0
  676. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.js +2 -0
  677. package/dist/esm/core/agent/stages/toolCalls/contracts/operations/steps.js.map +1 -0
  678. package/dist/esm/core/agent/stages/toolCalls/contracts/resources.d.ts +67 -0
  679. package/dist/esm/core/agent/stages/toolCalls/contracts/resources.js +2 -0
  680. package/dist/esm/core/agent/stages/toolCalls/contracts/resources.js.map +1 -0
  681. package/dist/esm/core/agent/stages/toolCalls/contracts/results.d.ts +26 -0
  682. package/dist/esm/core/agent/stages/toolCalls/contracts/results.js +2 -0
  683. package/dist/esm/core/agent/stages/toolCalls/contracts/results.js.map +1 -0
  684. package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts +14 -0
  685. package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.js +2 -0
  686. package/dist/esm/core/agent/stages/toolCalls/contracts/resumeFrames.js.map +1 -0
  687. package/dist/esm/core/agent/stages/toolCalls/contracts/routing.d.ts +114 -0
  688. package/dist/esm/core/agent/stages/toolCalls/contracts/routing.js +2 -0
  689. package/dist/esm/core/agent/stages/toolCalls/contracts/routing.js.map +1 -0
  690. package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts +4 -0
  691. package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.js +80 -0
  692. package/dist/esm/core/agent/stages/toolCalls/decorators/limitsOperations.js.map +1 -0
  693. package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts +4 -0
  694. package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.js +83 -0
  695. package/dist/esm/core/agent/stages/toolCalls/decorators/middlewareOperations.js.map +1 -0
  696. package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts +29 -0
  697. package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.js +48 -0
  698. package/dist/esm/core/agent/stages/toolCalls/decorators/reportingCredentials.js.map +1 -0
  699. package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts +9 -0
  700. package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.js +232 -0
  701. package/dist/esm/core/agent/stages/toolCalls/evidence/coverageOperations.js.map +1 -0
  702. package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts +4 -0
  703. package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.js +137 -0
  704. package/dist/esm/core/agent/stages/toolCalls/evidence/integrityOperations.js.map +1 -0
  705. package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts +29 -0
  706. package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.js +32 -0
  707. package/dist/esm/core/agent/stages/toolCalls/evidence/judgeLanded.js.map +1 -0
  708. package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.d.ts +6 -0
  709. package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.js +3 -0
  710. package/dist/esm/core/agent/stages/toolCalls/evidence/madeInRun.js.map +1 -0
  711. package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts +22 -0
  712. package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.js +34 -0
  713. package/dist/esm/core/agent/stages/toolCalls/evidence/producerCorpus.js.map +1 -0
  714. package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts +11 -0
  715. package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.js +156 -0
  716. package/dist/esm/core/agent/stages/toolCalls/evidence/scriptsOperations.js.map +1 -0
  717. package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts +4 -0
  718. package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.js +90 -0
  719. package/dist/esm/core/agent/stages/toolCalls/evidence/semanticsOperations.js.map +1 -0
  720. package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.d.ts +11 -0
  721. package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.js +18 -0
  722. package/dist/esm/core/agent/stages/toolCalls/evidence/sourceClock.js.map +1 -0
  723. package/dist/esm/core/agent/stages/toolCalls/evidence/towers.d.ts +18 -0
  724. package/dist/esm/core/agent/stages/toolCalls/evidence/towers.js +38 -0
  725. package/dist/esm/core/agent/stages/toolCalls/evidence/towers.js.map +1 -0
  726. package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts +12 -0
  727. package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.js +261 -0
  728. package/dist/esm/core/agent/stages/toolCalls/execution/artifactsOperations.js.map +1 -0
  729. package/dist/esm/core/agent/stages/toolCalls/execution/callStart.d.ts +35 -0
  730. package/dist/esm/core/agent/stages/toolCalls/execution/callStart.js +103 -0
  731. package/dist/esm/core/agent/stages/toolCalls/execution/callStart.js.map +1 -0
  732. package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.d.ts +17 -0
  733. package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.js +173 -0
  734. package/dist/esm/core/agent/stages/toolCalls/execution/catalogOperations.js.map +1 -0
  735. package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.d.ts +15 -0
  736. package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js +186 -0
  737. package/dist/esm/core/agent/stages/toolCalls/execution/contextOperations.js.map +1 -0
  738. package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts +48 -0
  739. package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.js +124 -0
  740. package/dist/esm/core/agent/stages/toolCalls/execution/credentialAdmission.js.map +1 -0
  741. package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts +9 -0
  742. package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.js +11 -0
  743. package/dist/esm/core/agent/stages/toolCalls/execution/credentialsOperations.js.map +1 -0
  744. package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.d.ts +40 -0
  745. package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js +168 -0
  746. package/dist/esm/core/agent/stages/toolCalls/execution/deliveredResult.js.map +1 -0
  747. package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.d.ts +5 -0
  748. package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js +511 -0
  749. package/dist/esm/core/agent/stages/toolCalls/execution/dispatchCall.js.map +1 -0
  750. package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.d.ts +70 -0
  751. package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js +341 -0
  752. package/dist/esm/core/agent/stages/toolCalls/execution/initialInvocation.js.map +1 -0
  753. package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts +9 -0
  754. package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.js +86 -0
  755. package/dist/esm/core/agent/stages/toolCalls/execution/resourcesOperations.js.map +1 -0
  756. package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +42 -0
  757. package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js +402 -0
  758. package/dist/esm/core/agent/stages/toolCalls/execution/resumedInvocation.js.map +1 -0
  759. package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.d.ts +19 -0
  760. package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.js +14 -0
  761. package/dist/esm/core/agent/stages/toolCalls/execution/wantedArguments.js.map +1 -0
  762. package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts +3 -0
  763. package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.js +6 -0
  764. package/dist/esm/core/agent/stages/toolCalls/helpers/dedupeIds.js.map +1 -0
  765. package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts +61 -0
  766. package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.js +78 -0
  767. package/dist/esm/core/agent/stages/toolCalls/helpers/dispatchRefusals.js.map +1 -0
  768. package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts +41 -0
  769. package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.js +42 -0
  770. package/dist/esm/core/agent/stages/toolCalls/helpers/mountedCursor.js.map +1 -0
  771. package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts +23 -0
  772. package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.js +54 -0
  773. package/dist/esm/core/agent/stages/toolCalls/helpers/periodWarnings.js.map +1 -0
  774. package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts +87 -0
  775. package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.js +137 -0
  776. package/dist/esm/core/agent/stages/toolCalls/helpers/readSkillRefusal.js.map +1 -0
  777. package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +8 -0
  778. package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.js +7 -0
  779. package/dist/esm/core/agent/stages/toolCalls/helpers/sourceNote.js.map +1 -0
  780. package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts +11 -0
  781. package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.js +12 -0
  782. package/dist/esm/core/agent/stages/toolCalls/helpers/unscopedRun.js.map +1 -0
  783. package/dist/esm/core/agent/stages/toolCalls/index.d.ts +14 -0
  784. package/dist/esm/core/agent/stages/toolCalls/index.js +21 -0
  785. package/dist/esm/core/agent/stages/toolCalls/index.js.map +1 -0
  786. package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.d.ts +29 -0
  787. package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.js +44 -0
  788. package/dist/esm/core/agent/stages/toolCalls/observation/callSettlement.js.map +1 -0
  789. package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.d.ts +4 -0
  790. package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.js +57 -0
  791. package/dist/esm/core/agent/stages/toolCalls/observation/observationsOperations.js.map +1 -0
  792. package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.d.ts +7 -0
  793. package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.js +28 -0
  794. package/dist/esm/core/agent/stages/toolCalls/observation/progressOperations.js.map +1 -0
  795. package/dist/esm/core/agent/stages/toolCalls/resume/ask.d.ts +44 -0
  796. package/dist/esm/core/agent/stages/toolCalls/resume/ask.js +400 -0
  797. package/dist/esm/core/agent/stages/toolCalls/resume/ask.js.map +1 -0
  798. package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.d.ts +39 -0
  799. package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js +189 -0
  800. package/dist/esm/core/agent/stages/toolCalls/resume/checkIn.js.map +1 -0
  801. package/dist/esm/core/agent/stages/toolCalls/resume/credential.d.ts +37 -0
  802. package/dist/esm/core/agent/stages/toolCalls/resume/credential.js +135 -0
  803. package/dist/esm/core/agent/stages/toolCalls/resume/credential.js.map +1 -0
  804. package/dist/esm/core/agent/stages/toolCalls/resume/handler.d.ts +6 -0
  805. package/dist/esm/core/agent/stages/toolCalls/resume/handler.js +148 -0
  806. package/dist/esm/core/agent/stages/toolCalls/resume/handler.js.map +1 -0
  807. package/dist/esm/core/agent/stages/toolCalls/resume/plain.d.ts +32 -0
  808. package/dist/esm/core/agent/stages/toolCalls/resume/plain.js +140 -0
  809. package/dist/esm/core/agent/stages/toolCalls/resume/plain.js.map +1 -0
  810. package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.d.ts +4 -0
  811. package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.js +260 -0
  812. package/dist/esm/core/agent/stages/toolCalls/routing/effectsOperations.js.map +1 -0
  813. package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.d.ts +17 -0
  814. package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.js +36 -0
  815. package/dist/esm/core/agent/stages/toolCalls/routing/policyHalt.js.map +1 -0
  816. package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts +20 -0
  817. package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.js +234 -0
  818. package/dist/esm/core/agent/stages/toolCalls/routing/readSkillRoute.js.map +1 -0
  819. package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.d.ts +15 -0
  820. package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.js +48 -0
  821. package/dist/esm/core/agent/stages/toolCalls/routing/skillActivation.js.map +1 -0
  822. package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.d.ts +4 -0
  823. package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.js +145 -0
  824. package/dist/esm/core/agent/stages/toolCalls/routing/stepsOperations.js.map +1 -0
  825. package/dist/esm/core/agent/stages/toolResolver.d.ts +3 -2
  826. package/dist/esm/core/agent/stages/toolResolver.js +84 -38
  827. package/dist/esm/core/agent/stages/toolResolver.js.map +1 -1
  828. package/dist/esm/core/agent/toolChoice/pick.d.ts +1 -1
  829. package/dist/esm/core/agent/toolChoice/pick.js +1 -1
  830. package/dist/esm/core/agent/toolResultCap.d.ts +1 -1
  831. package/dist/esm/core/agent/toolResultCap.js +0 -0
  832. package/dist/esm/core/agent/types.d.ts +16 -27
  833. package/dist/esm/core/agent/types.js +0 -3
  834. package/dist/esm/core/agent/types.js.map +1 -1
  835. package/dist/esm/core/agent/window/toolNames.d.ts +3 -3
  836. package/dist/esm/core/agent/window/toolNames.js +3 -3
  837. package/dist/esm/core/answerConsumption.d.ts +7 -0
  838. package/dist/esm/core/answerConsumption.js +12 -0
  839. package/dist/esm/core/answerConsumption.js.map +1 -0
  840. package/dist/esm/core/checkin.d.ts +1 -1
  841. package/dist/esm/core/checkin.js +1 -1
  842. package/dist/esm/core/codeRunnerTool.d.ts +1 -1
  843. package/dist/esm/core/codeRunnerTool.js +1 -1
  844. package/dist/esm/core/consentLedger.d.ts +21 -0
  845. package/dist/esm/core/consentLedger.js +116 -0
  846. package/dist/esm/core/consentLedger.js.map +1 -0
  847. package/dist/esm/core/consentRequest.d.ts +35 -54
  848. package/dist/esm/core/consentRequest.js +34 -153
  849. package/dist/esm/core/consentRequest.js.map +1 -1
  850. package/dist/esm/core/conversation.d.ts +8 -29
  851. package/dist/esm/core/conversation.js +14 -47
  852. package/dist/esm/core/conversation.js.map +1 -1
  853. package/dist/esm/core/memberRun.d.ts +1 -0
  854. package/dist/esm/core/memberRun.js +1 -1
  855. package/dist/esm/core/memberRun.js.map +1 -1
  856. package/dist/esm/core/pause.d.ts +5 -5
  857. package/dist/esm/core/pause.js +5 -5
  858. package/dist/esm/core/pauseRecord.d.ts +13 -0
  859. package/dist/esm/core/pauseRecord.js +19 -0
  860. package/dist/esm/core/pauseRecord.js.map +1 -0
  861. package/dist/esm/core/runEntry.d.ts +8 -0
  862. package/dist/esm/core/runEntry.js +26 -0
  863. package/dist/esm/core/runEntry.js.map +1 -0
  864. package/dist/esm/core/runnerCoreValues.d.ts +16 -0
  865. package/dist/esm/core/runnerCoreValues.js +2 -0
  866. package/dist/esm/core/runnerCoreValues.js.map +1 -0
  867. package/dist/esm/core/runnerExecution.d.ts +71 -0
  868. package/dist/esm/core/runnerExecution.js +170 -0
  869. package/dist/esm/core/runnerExecution.js.map +1 -0
  870. package/dist/esm/core/runnerLive.d.ts +32 -1
  871. package/dist/esm/core/runnerLive.js.map +1 -1
  872. package/dist/esm/core/slots/buildThinkingSubflow.d.ts +1 -1
  873. package/dist/esm/core/slots/buildThinkingSubflow.js +2 -2
  874. package/dist/esm/core/slots/buildThinkingSubflow.js.map +1 -1
  875. package/dist/esm/core/slots/buildToolsSlot.d.ts +27 -56
  876. package/dist/esm/core/slots/buildToolsSlot.js +25 -102
  877. package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
  878. package/dist/esm/core/slots/discoverTools.d.ts +21 -0
  879. package/dist/esm/core/slots/discoverTools.js +94 -0
  880. package/dist/esm/core/slots/discoverTools.js.map +1 -0
  881. package/dist/esm/core-flow/Conditional.d.ts +0 -2
  882. package/dist/esm/core-flow/Conditional.js +28 -75
  883. package/dist/esm/core-flow/Conditional.js.map +1 -1
  884. package/dist/esm/core-flow/Graph.d.ts +18 -23
  885. package/dist/esm/core-flow/Graph.js +66 -123
  886. package/dist/esm/core-flow/Graph.js.map +1 -1
  887. package/dist/esm/core-flow/Loop.d.ts +0 -2
  888. package/dist/esm/core-flow/Loop.js +29 -83
  889. package/dist/esm/core-flow/Loop.js.map +1 -1
  890. package/dist/esm/core-flow/Parallel.d.ts +11 -40
  891. package/dist/esm/core-flow/Parallel.js +61 -151
  892. package/dist/esm/core-flow/Parallel.js.map +1 -1
  893. package/dist/esm/core-flow/Sequence.d.ts +0 -2
  894. package/dist/esm/core-flow/Sequence.js +28 -76
  895. package/dist/esm/core-flow/Sequence.js.map +1 -1
  896. package/dist/esm/core-flow/Workflow.d.ts +0 -2
  897. package/dist/esm/core-flow/Workflow.js +27 -75
  898. package/dist/esm/core-flow/Workflow.js.map +1 -1
  899. package/dist/esm/events/dispatcher.d.ts +2 -2
  900. package/dist/esm/events/dispatcher.js +2 -2
  901. package/dist/esm/events/payloads/access.d.ts +88 -0
  902. package/dist/esm/events/payloads/access.js +2 -0
  903. package/dist/esm/events/payloads/access.js.map +1 -0
  904. package/dist/esm/events/payloads/agent.d.ts +241 -0
  905. package/dist/esm/events/payloads/agent.js +2 -0
  906. package/dist/esm/events/payloads/agent.js.map +1 -0
  907. package/dist/esm/events/payloads/answer.d.ts +95 -0
  908. package/dist/esm/events/payloads/answer.js +2 -0
  909. package/dist/esm/events/payloads/answer.js.map +1 -0
  910. package/dist/esm/events/payloads/artifacts.d.ts +139 -0
  911. package/dist/esm/events/payloads/artifacts.js +2 -0
  912. package/dist/esm/events/payloads/artifacts.js.map +1 -0
  913. package/dist/esm/events/payloads/consent.d.ts +86 -0
  914. package/dist/esm/events/payloads/consent.js +2 -0
  915. package/dist/esm/events/payloads/consent.js.map +1 -0
  916. package/dist/esm/events/payloads/context.d.ts +276 -0
  917. package/dist/esm/events/payloads/context.js +2 -0
  918. package/dist/esm/events/payloads/context.js.map +1 -0
  919. package/dist/esm/events/payloads/cost.d.ts +40 -0
  920. package/dist/esm/events/payloads/cost.js +2 -0
  921. package/dist/esm/events/payloads/cost.js.map +1 -0
  922. package/dist/esm/events/payloads/dependencyTypes.d.ts +18 -0
  923. package/dist/esm/events/payloads/dependencyTypes.js +2 -0
  924. package/dist/esm/events/payloads/dependencyTypes.js.map +1 -0
  925. package/dist/esm/events/payloads/evaluation.d.ts +297 -0
  926. package/dist/esm/events/payloads/evaluation.js +2 -0
  927. package/dist/esm/events/payloads/evaluation.js.map +1 -0
  928. package/dist/esm/events/payloads/fallback.d.ts +6 -0
  929. package/dist/esm/events/payloads/fallback.js +2 -0
  930. package/dist/esm/events/payloads/fallback.js.map +1 -0
  931. package/dist/esm/events/payloads/findings.d.ts +243 -0
  932. package/dist/esm/events/payloads/findings.js +2 -0
  933. package/dist/esm/events/payloads/findings.js.map +1 -0
  934. package/dist/esm/events/payloads/flow.d.ts +68 -0
  935. package/dist/esm/events/payloads/flow.js +2 -0
  936. package/dist/esm/events/payloads/flow.js.map +1 -0
  937. package/dist/esm/events/payloads/integrity.d.ts +48 -0
  938. package/dist/esm/events/payloads/integrity.js +3 -0
  939. package/dist/esm/events/payloads/integrity.js.map +1 -0
  940. package/dist/esm/events/payloads/maps.d.ts +47 -0
  941. package/dist/esm/events/payloads/maps.js +3 -0
  942. package/dist/esm/events/payloads/maps.js.map +1 -0
  943. package/dist/esm/events/payloads/mcpRequests.d.ts +327 -0
  944. package/dist/esm/events/payloads/mcpRequests.js +3 -0
  945. package/dist/esm/events/payloads/mcpRequests.js.map +1 -0
  946. package/dist/esm/events/payloads/memory.d.ts +117 -0
  947. package/dist/esm/events/payloads/memory.js +3 -0
  948. package/dist/esm/events/payloads/memory.js.map +1 -0
  949. package/dist/esm/events/payloads/reliability.d.ts +149 -0
  950. package/dist/esm/events/payloads/reliability.js +2 -0
  951. package/dist/esm/events/payloads/reliability.js.map +1 -0
  952. package/dist/esm/events/payloads/runConfiguration.d.ts +224 -0
  953. package/dist/esm/events/payloads/runConfiguration.js +2 -0
  954. package/dist/esm/events/payloads/runConfiguration.js.map +1 -0
  955. package/dist/esm/events/payloads/skills.d.ts +359 -0
  956. package/dist/esm/events/payloads/skills.js +2 -0
  957. package/dist/esm/events/payloads/skills.js.map +1 -0
  958. package/dist/esm/events/payloads/stream.d.ts +230 -0
  959. package/dist/esm/events/payloads/stream.js +2 -0
  960. package/dist/esm/events/payloads/stream.js.map +1 -0
  961. package/dist/esm/events/payloads/thinking.d.ts +118 -0
  962. package/dist/esm/events/payloads/thinking.js +2 -0
  963. package/dist/esm/events/payloads/thinking.js.map +1 -0
  964. package/dist/esm/events/payloads/toolCatalog.d.ts +157 -0
  965. package/dist/esm/events/payloads/toolCatalog.js +2 -0
  966. package/dist/esm/events/payloads/toolCatalog.js.map +1 -0
  967. package/dist/esm/events/payloads/toolChoice.d.ts +65 -0
  968. package/dist/esm/events/payloads/toolChoice.js +2 -0
  969. package/dist/esm/events/payloads/toolChoice.js.map +1 -0
  970. package/dist/esm/events/payloads/toolEffects.d.ts +329 -0
  971. package/dist/esm/events/payloads/toolEffects.js +2 -0
  972. package/dist/esm/events/payloads/toolEffects.js.map +1 -0
  973. package/dist/esm/events/payloads/toolSemantics.d.ts +68 -0
  974. package/dist/esm/events/payloads/toolSemantics.js +2 -0
  975. package/dist/esm/events/payloads/toolSemantics.js.map +1 -0
  976. package/dist/esm/events/payloads/toolSessionPayloads.d.ts +50 -0
  977. package/dist/esm/events/payloads/toolSessionPayloads.js +17 -0
  978. package/dist/esm/events/payloads/toolSessionPayloads.js.map +1 -0
  979. package/dist/esm/events/payloads/validation.d.ts +29 -0
  980. package/dist/esm/events/payloads/validation.js +2 -0
  981. package/dist/esm/events/payloads/validation.js.map +1 -0
  982. package/dist/esm/events/payloads.d.ts +26 -3888
  983. package/dist/esm/events/registry.d.ts +8 -15
  984. package/dist/esm/events/registry.js +5 -15
  985. package/dist/esm/events/registry.js.map +1 -1
  986. package/dist/esm/hosting/answeredPause.d.ts +9 -23
  987. package/dist/esm/hosting/answeredPause.js +15 -27
  988. package/dist/esm/hosting/answeredPause.js.map +1 -1
  989. package/dist/esm/hosting/durability.d.ts +10 -7
  990. package/dist/esm/hosting/durability.js +10 -8
  991. package/dist/esm/hosting/durability.js.map +1 -1
  992. package/dist/esm/hosting/standingAgent.d.ts +4 -14
  993. package/dist/esm/hosting/standingAgent.js +73 -109
  994. package/dist/esm/hosting/standingAgent.js.map +1 -1
  995. package/dist/esm/hosting/stream.d.ts +3 -3
  996. package/dist/esm/hosting/stream.js +2 -5
  997. package/dist/esm/hosting/stream.js.map +1 -1
  998. package/dist/esm/hosting/streamHandler.js +5 -5
  999. package/dist/esm/hosting/streamHandler.js.map +1 -1
  1000. package/dist/esm/index.d.ts +2 -1
  1001. package/dist/esm/index.js +2 -4
  1002. package/dist/esm/index.js.map +1 -1
  1003. package/dist/esm/influence-core/attribute.js +1 -1
  1004. package/dist/esm/influence-core/attribute.js.map +1 -1
  1005. package/dist/esm/influence-core/contrastive.js +1 -1
  1006. package/dist/esm/influence-core/contrastive.js.map +1 -1
  1007. package/dist/esm/influence-core/margin.js +1 -1
  1008. package/dist/esm/influence-core/margin.js.map +1 -1
  1009. package/dist/esm/influence-core/signals.js +1 -1
  1010. package/dist/esm/influence-core/signals.js.map +1 -1
  1011. package/dist/esm/influence-core/similarity.js +1 -1
  1012. package/dist/esm/influence-core/similarity.js.map +1 -1
  1013. package/dist/esm/injection-engine/buildInjectionEngineSubflow.js +1 -1
  1014. package/dist/esm/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  1015. package/dist/esm/injection-engine/devWarn.d.ts +3 -2
  1016. package/dist/esm/injection-engine/devWarn.js +3 -2
  1017. package/dist/esm/injection-engine/devWarn.js.map +1 -1
  1018. package/dist/esm/injection-engine/entryScorer.js +1 -1
  1019. package/dist/esm/injection-engine/entryScorer.js.map +1 -1
  1020. package/dist/esm/injection-engine/hostContract.d.ts +3 -3
  1021. package/dist/esm/injection-engine/skillExamples.d.ts +1 -1
  1022. package/dist/esm/injection-engine/skillGraph/cursorEvidence.d.ts +48 -0
  1023. package/dist/esm/injection-engine/skillGraph/cursorEvidence.js +54 -0
  1024. package/dist/esm/injection-engine/skillGraph/cursorEvidence.js.map +1 -0
  1025. package/dist/esm/injection-engine/skillGraph/cursorResolution.d.ts +4 -0
  1026. package/dist/esm/injection-engine/skillGraph/cursorResolution.js +241 -0
  1027. package/dist/esm/injection-engine/skillGraph/cursorResolution.js.map +1 -0
  1028. package/dist/esm/injection-engine/skillGraph/decision.d.ts +21 -0
  1029. package/dist/esm/injection-engine/skillGraph/decision.js +10 -0
  1030. package/dist/esm/injection-engine/skillGraph/decision.js.map +1 -0
  1031. package/dist/esm/injection-engine/skillGraph/entryScores.d.ts +14 -0
  1032. package/dist/esm/injection-engine/skillGraph/entryScores.js +30 -0
  1033. package/dist/esm/injection-engine/skillGraph/entryScores.js.map +1 -0
  1034. package/dist/esm/injection-engine/skillGraph/entrySuppression.d.ts +23 -0
  1035. package/dist/esm/injection-engine/skillGraph/entrySuppression.js +46 -0
  1036. package/dist/esm/injection-engine/skillGraph/entrySuppression.js.map +1 -0
  1037. package/dist/esm/injection-engine/skillGraph/graphConfig.d.ts +39 -0
  1038. package/dist/esm/injection-engine/skillGraph/graphConfig.js +2 -0
  1039. package/dist/esm/injection-engine/skillGraph/graphConfig.js.map +1 -0
  1040. package/dist/esm/injection-engine/skillGraph/graphContracts.d.ts +479 -0
  1041. package/dist/esm/injection-engine/skillGraph/graphContracts.js +14 -0
  1042. package/dist/esm/injection-engine/skillGraph/graphContracts.js.map +1 -0
  1043. package/dist/esm/injection-engine/skillGraph/graphCursor.d.ts +125 -0
  1044. package/dist/esm/injection-engine/skillGraph/graphCursor.js +2 -0
  1045. package/dist/esm/injection-engine/skillGraph/graphCursor.js.map +1 -0
  1046. package/dist/esm/injection-engine/skillGraph/graphDrawing.d.ts +2 -0
  1047. package/dist/esm/injection-engine/skillGraph/graphDrawing.js +31 -0
  1048. package/dist/esm/injection-engine/skillGraph/graphDrawing.js.map +1 -0
  1049. package/dist/esm/injection-engine/skillGraph/graphRoutes.d.ts +269 -0
  1050. package/dist/esm/injection-engine/skillGraph/graphRoutes.js +2 -0
  1051. package/dist/esm/injection-engine/skillGraph/graphRoutes.js.map +1 -0
  1052. package/dist/esm/injection-engine/skillGraph/passMemo.d.ts +24 -0
  1053. package/dist/esm/injection-engine/skillGraph/passMemo.js +37 -0
  1054. package/dist/esm/injection-engine/skillGraph/passMemo.js.map +1 -0
  1055. package/dist/esm/injection-engine/skillGraph/reachability.d.ts +71 -0
  1056. package/dist/esm/injection-engine/skillGraph/reachability.js +62 -0
  1057. package/dist/esm/injection-engine/skillGraph/reachability.js.map +1 -0
  1058. package/dist/esm/injection-engine/skillGraph/routePredicates.d.ts +36 -0
  1059. package/dist/esm/injection-engine/skillGraph/routePredicates.js +57 -0
  1060. package/dist/esm/injection-engine/skillGraph/routePredicates.js.map +1 -0
  1061. package/dist/esm/injection-engine/skillGraph/routingView.d.ts +3 -0
  1062. package/dist/esm/injection-engine/skillGraph/routingView.js +24 -0
  1063. package/dist/esm/injection-engine/skillGraph/routingView.js.map +1 -0
  1064. package/dist/esm/injection-engine/skillGraph/treeCompilation.d.ts +38 -0
  1065. package/dist/esm/injection-engine/skillGraph/treeCompilation.js +153 -0
  1066. package/dist/esm/injection-engine/skillGraph/treeCompilation.js.map +1 -0
  1067. package/dist/esm/injection-engine/skillGraph/triggerCompilation.d.ts +16 -0
  1068. package/dist/esm/injection-engine/skillGraph/triggerCompilation.js +75 -0
  1069. package/dist/esm/injection-engine/skillGraph/triggerCompilation.js.map +1 -0
  1070. package/dist/esm/injection-engine/skillGraph.d.ts +12 -948
  1071. package/dist/esm/injection-engine/skillGraph.js +22 -816
  1072. package/dist/esm/injection-engine/skillGraph.js.map +1 -1
  1073. package/dist/esm/injection-engine/skillIntent.d.ts +1 -1
  1074. package/dist/esm/injection-engine/skillMatch.d.ts +2 -1
  1075. package/dist/esm/injection-engine/skillMatch.js +2 -1
  1076. package/dist/esm/injection-engine/skillMatch.js.map +1 -1
  1077. package/dist/esm/injection-engine/skillToolDescriptors.js +2 -2
  1078. package/dist/esm/injection-engine/skillToolDescriptors.js.map +1 -1
  1079. package/dist/esm/injection-engine/startRuleClaim.d.ts +1 -1
  1080. package/dist/esm/injection-engine/types.d.ts +1 -1
  1081. package/dist/esm/lib/cosine.js.map +1 -0
  1082. package/dist/esm/lib/iterationBudget.d.ts +3 -0
  1083. package/dist/esm/lib/iterationBudget.js +7 -0
  1084. package/dist/esm/lib/iterationBudget.js.map +1 -1
  1085. package/dist/esm/lib/saidByPerson.d.ts +1 -0
  1086. package/dist/esm/lib/saidByPerson.js +2 -0
  1087. package/dist/esm/lib/saidByPerson.js.map +1 -1
  1088. package/dist/esm/lib/spokenIds.js +2 -2
  1089. package/dist/esm/lib/spokenIds.js.map +1 -1
  1090. package/dist/esm/lib/toolBytes.d.ts +1 -1
  1091. package/dist/esm/lib/toolBytes.js +2 -2
  1092. package/dist/esm/lib/toolBytes.js.map +1 -1
  1093. package/dist/esm/maps/engagement/lease.js +1 -1
  1094. package/dist/esm/maps/engagement/lease.js.map +1 -1
  1095. package/dist/esm/memory/causal/evidenceRecorder.d.ts +8 -56
  1096. package/dist/esm/memory/causal/evidenceRecorder.js +221 -213
  1097. package/dist/esm/memory/causal/evidenceRecorder.js.map +1 -1
  1098. package/dist/esm/memory/causal/loadSnapshot.js +16 -59
  1099. package/dist/esm/memory/causal/loadSnapshot.js.map +1 -1
  1100. package/dist/esm/memory/causal/observation.d.ts +72 -0
  1101. package/dist/esm/memory/causal/observation.js +13 -0
  1102. package/dist/esm/memory/causal/observation.js.map +1 -0
  1103. package/dist/esm/memory/causal/snapshotProjection.d.ts +5 -0
  1104. package/dist/esm/memory/causal/snapshotProjection.js +61 -0
  1105. package/dist/esm/memory/causal/snapshotProjection.js.map +1 -0
  1106. package/dist/esm/memory/causal/snapshotSchema.d.ts +8 -0
  1107. package/dist/esm/memory/causal/snapshotSchema.js +168 -0
  1108. package/dist/esm/memory/causal/snapshotSchema.js.map +1 -0
  1109. package/dist/esm/memory/causal/types.d.ts +5 -82
  1110. package/dist/esm/memory/causal/types.js +0 -18
  1111. package/dist/esm/memory/causal/types.js.map +1 -1
  1112. package/dist/esm/memory/causal/writeSnapshot.js +17 -14
  1113. package/dist/esm/memory/causal/writeSnapshot.js.map +1 -1
  1114. package/dist/esm/memory/embedding/index.d.ts +1 -1
  1115. package/dist/esm/memory/embedding/index.js +1 -1
  1116. package/dist/esm/memory/embedding/index.js.map +1 -1
  1117. package/dist/esm/memory/stages/types.d.ts +1 -1
  1118. package/dist/esm/memory/store/InMemoryStore.js +1 -1
  1119. package/dist/esm/memory/store/InMemoryStore.js.map +1 -1
  1120. package/dist/esm/memory/store/staticVectorStore.js +1 -1
  1121. package/dist/esm/memory/store/staticVectorStore.js.map +1 -1
  1122. package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +7 -7
  1123. package/dist/esm/memory/wire/mountMemoryPipeline.js +8 -2
  1124. package/dist/esm/memory/wire/mountMemoryPipeline.js.map +1 -1
  1125. package/dist/esm/patterns/LlmRouter.d.ts +11 -149
  1126. package/dist/esm/patterns/LlmRouter.js +51 -179
  1127. package/dist/esm/patterns/LlmRouter.js.map +1 -1
  1128. package/dist/esm/patterns/LlmSwarm.d.ts +5 -49
  1129. package/dist/esm/patterns/LlmSwarm.js +7 -70
  1130. package/dist/esm/patterns/LlmSwarm.js.map +1 -1
  1131. package/dist/esm/patterns/MapReduce.js +33 -23
  1132. package/dist/esm/patterns/MapReduce.js.map +1 -1
  1133. package/dist/esm/patterns/Swarm.d.ts +14 -45
  1134. package/dist/esm/patterns/Swarm.js +230 -76
  1135. package/dist/esm/patterns/Swarm.js.map +1 -1
  1136. package/dist/esm/patterns/index.d.ts +1 -1
  1137. package/dist/esm/patterns/index.js.map +1 -1
  1138. package/dist/esm/patterns/routing.d.ts +15 -0
  1139. package/dist/esm/patterns/routing.js +18 -0
  1140. package/dist/esm/patterns/routing.js.map +1 -0
  1141. package/dist/esm/provider-contract/types.d.ts +5 -5
  1142. package/dist/esm/recorders/core/CompactionMeter.d.ts +1 -1
  1143. package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +13 -427
  1144. package/dist/esm/recorders/observability/BoundaryRecorder.js +7 -283
  1145. package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
  1146. package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.d.ts +13 -0
  1147. package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.js +58 -0
  1148. package/dist/esm/recorders/observability/boundaryRecorder/agentInternal.js.map +1 -0
  1149. package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.d.ts +210 -0
  1150. package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.js +2 -0
  1151. package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.js.map +1 -0
  1152. package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.d.ts +11 -0
  1153. package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.js +77 -0
  1154. package/dist/esm/recorders/observability/boundaryRecorder/eventBuilders.js.map +1 -0
  1155. package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.d.ts +12 -0
  1156. package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.js +2 -0
  1157. package/dist/esm/recorders/observability/boundaryRecorder/flowEvents.js.map +1 -0
  1158. package/dist/esm/recorders/observability/boundaryRecorder/leanContent.d.ts +52 -0
  1159. package/dist/esm/recorders/observability/boundaryRecorder/leanContent.js +52 -0
  1160. package/dist/esm/recorders/observability/boundaryRecorder/leanContent.js.map +1 -0
  1161. package/dist/esm/recorders/observability/boundaryRecorder/options.d.ts +95 -0
  1162. package/dist/esm/recorders/observability/boundaryRecorder/options.js +2 -0
  1163. package/dist/esm/recorders/observability/boundaryRecorder/options.js.map +1 -0
  1164. package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.d.ts +33 -0
  1165. package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.js +39 -0
  1166. package/dist/esm/recorders/observability/boundaryRecorder/rangeLabels.js.map +1 -0
  1167. package/dist/esm/recorders/observability/boundaryRecorder/rollups.d.ts +53 -0
  1168. package/dist/esm/recorders/observability/boundaryRecorder/rollups.js +69 -0
  1169. package/dist/esm/recorders/observability/boundaryRecorder/rollups.js.map +1 -0
  1170. package/dist/esm/recorders/observability/fileRecordingSink.d.ts +2 -4
  1171. package/dist/esm/recorders/observability/fileRecordingSink.js +2 -4
  1172. package/dist/esm/recorders/observability/fileRecordingSink.js.map +1 -1
  1173. package/dist/esm/recorders/observability/recordingEnvelope.d.ts +6 -10
  1174. package/dist/esm/recorders/observability/recordingEnvelope.js +6 -10
  1175. package/dist/esm/recorders/observability/recordingEnvelope.js.map +1 -1
  1176. package/dist/esm/redaction/coverage.d.ts +5 -3
  1177. package/dist/esm/redaction/coverage.js +5 -3
  1178. package/dist/esm/redaction/coverage.js.map +1 -1
  1179. package/dist/esm/redaction/declared.d.ts +4 -0
  1180. package/dist/esm/redaction/declared.js +15 -2
  1181. package/dist/esm/redaction/declared.js.map +1 -1
  1182. package/dist/esm/redaction/knownStrings.d.ts +5 -34
  1183. package/dist/esm/redaction/knownStrings.js +10 -34
  1184. package/dist/esm/redaction/knownStrings.js.map +1 -1
  1185. package/dist/esm/redaction/marker.d.ts +1 -1
  1186. package/dist/esm/redaction/marker.js +1 -1
  1187. package/dist/esm/redaction/privateCaller.d.ts +43 -0
  1188. package/dist/esm/redaction/privateCaller.js +74 -0
  1189. package/dist/esm/redaction/privateCaller.js.map +1 -0
  1190. package/dist/esm/redaction/privateCheckpoint.d.ts +22 -0
  1191. package/dist/esm/redaction/privateCheckpoint.js +89 -0
  1192. package/dist/esm/redaction/privateCheckpoint.js.map +1 -0
  1193. package/dist/esm/redaction/privateFields.d.ts +28 -0
  1194. package/dist/esm/redaction/privateFields.js +152 -0
  1195. package/dist/esm/redaction/privateFields.js.map +1 -0
  1196. package/dist/esm/redaction/privateRun.d.ts +32 -0
  1197. package/dist/esm/redaction/privateRun.js +105 -0
  1198. package/dist/esm/redaction/privateRun.js.map +1 -0
  1199. package/dist/esm/redaction/runRedaction.d.ts +47 -41
  1200. package/dist/esm/redaction/runRedaction.js +134 -91
  1201. package/dist/esm/redaction/runRedaction.js.map +1 -1
  1202. package/dist/esm/redaction/served.d.ts +10 -4
  1203. package/dist/esm/redaction/served.js +28 -7
  1204. package/dist/esm/redaction/served.js.map +1 -1
  1205. package/dist/esm/resilience/withCircuitBreaker.d.ts +1 -1
  1206. package/dist/esm/resilience/withCircuitBreaker.js +1 -1
  1207. package/dist/esm/security/extractSequence.js +1 -1
  1208. package/dist/esm/semantics/coverage/answer.js +1 -1
  1209. package/dist/esm/semantics/coverage/answer.js.map +1 -1
  1210. package/dist/esm/semantics/coverage/composedCoverage.d.ts +1 -1
  1211. package/dist/esm/semantics/coverage/composedCoverage.js +1 -1
  1212. package/dist/esm/semantics/coverage/items.d.ts +1 -1
  1213. package/dist/esm/semantics/coverage/items.js +1 -1
  1214. package/dist/esm/semantics/coverage/read.d.ts +3 -3
  1215. package/dist/esm/semantics/coverage/read.js +3 -3
  1216. package/dist/esm/semantics/types.d.ts +1 -1
  1217. package/dist/esm/semantics/types.js +1 -1
  1218. package/dist/esm/time/drift.d.ts +1 -1
  1219. package/dist/esm/time/drift.js +1 -1
  1220. package/dist/esm/time-travel/servedView/assembly.d.ts +4 -0
  1221. package/dist/esm/time-travel/servedView/assembly.js +44 -0
  1222. package/dist/esm/time-travel/servedView/assembly.js.map +1 -0
  1223. package/dist/esm/time-travel/servedView/conversation.d.ts +8 -0
  1224. package/dist/esm/time-travel/servedView/conversation.js +30 -0
  1225. package/dist/esm/time-travel/servedView/conversation.js.map +1 -0
  1226. package/dist/esm/time-travel/servedView/findings.d.ts +11 -0
  1227. package/dist/esm/time-travel/servedView/findings.js +68 -0
  1228. package/dist/esm/time-travel/servedView/findings.js.map +1 -0
  1229. package/dist/esm/time-travel/servedView/gaps.d.ts +76 -0
  1230. package/dist/esm/time-travel/servedView/gaps.js +476 -0
  1231. package/dist/esm/time-travel/servedView/gaps.js.map +1 -0
  1232. package/dist/esm/time-travel/servedView/ontology.d.ts +4 -0
  1233. package/dist/esm/time-travel/servedView/ontology.js +60 -0
  1234. package/dist/esm/time-travel/servedView/ontology.js.map +1 -0
  1235. package/dist/esm/time-travel/servedView/recordReads.d.ts +44 -0
  1236. package/dist/esm/time-travel/servedView/recordReads.js +73 -0
  1237. package/dist/esm/time-travel/servedView/recordReads.js.map +1 -0
  1238. package/dist/esm/time-travel/servedView/requestOnly.d.ts +6 -0
  1239. package/dist/esm/time-travel/servedView/requestOnly.js +67 -0
  1240. package/dist/esm/time-travel/servedView/requestOnly.js.map +1 -0
  1241. package/dist/esm/time-travel/servedView/system.d.ts +15 -0
  1242. package/dist/esm/time-travel/servedView/system.js +36 -0
  1243. package/dist/esm/time-travel/servedView/system.js.map +1 -0
  1244. package/dist/esm/time-travel/servedView/tools.d.ts +9 -0
  1245. package/dist/esm/time-travel/servedView/tools.js +36 -0
  1246. package/dist/esm/time-travel/servedView/tools.js.map +1 -0
  1247. package/dist/esm/time-travel/servedView/value.d.ts +38 -0
  1248. package/dist/esm/time-travel/servedView/value.js +57 -0
  1249. package/dist/esm/time-travel/servedView/value.js.map +1 -0
  1250. package/dist/esm/time-travel/servedView.d.ts +5 -65
  1251. package/dist/esm/time-travel/servedView.js +155 -877
  1252. package/dist/esm/time-travel/servedView.js.map +1 -1
  1253. package/dist/esm/tools/displayName.d.ts +6 -0
  1254. package/dist/esm/tools/displayName.js +15 -0
  1255. package/dist/esm/tools/displayName.js.map +1 -0
  1256. package/dist/esm/tools/finiteLabel.d.ts +16 -0
  1257. package/dist/esm/tools/finiteLabel.js +28 -0
  1258. package/dist/esm/tools/finiteLabel.js.map +1 -0
  1259. package/dist/esm/tools/inputRequest.d.ts +1 -1
  1260. package/dist/esm/tools/inputRequest.js +2 -2
  1261. package/dist/esm/tools/toolParty.d.ts +17 -0
  1262. package/dist/esm/tools/toolParty.js +40 -0
  1263. package/dist/esm/tools/toolParty.js.map +1 -0
  1264. package/dist/esm/tools/toolProvider.d.ts +1 -0
  1265. package/dist/esm/tools/toolResourceOwner.d.ts +27 -0
  1266. package/dist/esm/tools/toolResourceOwner.js +79 -0
  1267. package/dist/esm/tools/toolResourceOwner.js.map +1 -0
  1268. package/dist/esm/tools/toolSessions/contracts.d.ts +130 -0
  1269. package/dist/esm/tools/toolSessions/contracts.js +7 -0
  1270. package/dist/esm/tools/toolSessions/contracts.js.map +1 -0
  1271. package/dist/esm/tools/toolSessions/keys.d.ts +53 -0
  1272. package/dist/esm/tools/toolSessions/keys.js +113 -0
  1273. package/dist/esm/tools/toolSessions/keys.js.map +1 -0
  1274. package/dist/esm/tools/toolSessions/localStatus.d.ts +7 -0
  1275. package/dist/esm/tools/toolSessions/localStatus.js +9 -0
  1276. package/dist/esm/tools/toolSessions/localStatus.js.map +1 -0
  1277. package/dist/esm/tools/toolSessions.d.ts +30 -178
  1278. package/dist/esm/tools/toolSessions.js +138 -119
  1279. package/dist/esm/tools/toolSessions.js.map +1 -1
  1280. package/dist/esm/tools/tools.d.ts +6 -8
  1281. package/dist/esm/tools/tools.js +5 -15
  1282. package/dist/esm/tools/tools.js.map +1 -1
  1283. package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.d.ts +15 -0
  1284. package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.js +14 -0
  1285. package/dist/esm/trace-toolpack/traceToolpack/artifactFacts.js.map +1 -0
  1286. package/dist/esm/trace-toolpack/traceToolpack/backtrackView.d.ts +17 -0
  1287. package/dist/esm/trace-toolpack/traceToolpack/backtrackView.js +117 -0
  1288. package/dist/esm/trace-toolpack/traceToolpack/backtrackView.js.map +1 -0
  1289. package/dist/esm/trace-toolpack/traceToolpack/contextErrors.d.ts +43 -0
  1290. package/dist/esm/trace-toolpack/traceToolpack/contextErrors.js +354 -0
  1291. package/dist/esm/trace-toolpack/traceToolpack/contextErrors.js.map +1 -0
  1292. package/dist/esm/trace-toolpack/traceToolpack/findInTrace.d.ts +26 -0
  1293. package/dist/esm/trace-toolpack/traceToolpack/findInTrace.js +178 -0
  1294. package/dist/esm/trace-toolpack/traceToolpack/findInTrace.js.map +1 -0
  1295. package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.d.ts +73 -0
  1296. package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.js +176 -0
  1297. package/dist/esm/trace-toolpack/traceToolpack/findingEvidence.js.map +1 -0
  1298. package/dist/esm/trace-toolpack/traceToolpack/innerRecords.d.ts +11 -0
  1299. package/dist/esm/trace-toolpack/traceToolpack/innerRecords.js +88 -0
  1300. package/dist/esm/trace-toolpack/traceToolpack/innerRecords.js.map +1 -0
  1301. package/dist/esm/trace-toolpack/traceToolpack/narrativeView.d.ts +3 -0
  1302. package/dist/esm/trace-toolpack/traceToolpack/narrativeView.js +44 -0
  1303. package/dist/esm/trace-toolpack/traceToolpack/narrativeView.js.map +1 -0
  1304. package/dist/esm/trace-toolpack/traceToolpack/navigationHints.d.ts +6 -0
  1305. package/dist/esm/trace-toolpack/traceToolpack/navigationHints.js +42 -0
  1306. package/dist/esm/trace-toolpack/traceToolpack/navigationHints.js.map +1 -0
  1307. package/dist/esm/trace-toolpack/traceToolpack/nodeView.d.ts +5 -0
  1308. package/dist/esm/trace-toolpack/traceToolpack/nodeView.js +130 -0
  1309. package/dist/esm/trace-toolpack/traceToolpack/nodeView.js.map +1 -0
  1310. package/dist/esm/trace-toolpack/traceToolpack/packIndex.d.ts +69 -0
  1311. package/dist/esm/trace-toolpack/traceToolpack/packIndex.js +155 -0
  1312. package/dist/esm/trace-toolpack/traceToolpack/packIndex.js.map +1 -0
  1313. package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.d.ts +10 -0
  1314. package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.js +36 -0
  1315. package/dist/esm/trace-toolpack/traceToolpack/parameterSchemas.js.map +1 -0
  1316. package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.d.ts +40 -0
  1317. package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.js +392 -0
  1318. package/dist/esm/trace-toolpack/traceToolpack/recursiveFactory.js.map +1 -0
  1319. package/dist/esm/trace-toolpack/traceToolpack/runOverview.d.ts +5 -0
  1320. package/dist/esm/trace-toolpack/traceToolpack/runOverview.js +114 -0
  1321. package/dist/esm/trace-toolpack/traceToolpack/runOverview.js.map +1 -0
  1322. package/dist/esm/trace-toolpack/traceToolpack/sliceView.d.ts +5 -0
  1323. package/dist/esm/trace-toolpack/traceToolpack/sliceView.js +87 -0
  1324. package/dist/esm/trace-toolpack/traceToolpack/sliceView.js.map +1 -0
  1325. package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.d.ts +41 -0
  1326. package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.js +44 -0
  1327. package/dist/esm/trace-toolpack/traceToolpack/structuralLimits.js.map +1 -0
  1328. package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.d.ts +105 -0
  1329. package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.js +384 -0
  1330. package/dist/esm/trace-toolpack/traceToolpack/toolCallJournal.js.map +1 -0
  1331. package/dist/esm/trace-toolpack/traceToolpack/valueLines.d.ts +29 -0
  1332. package/dist/esm/trace-toolpack/traceToolpack/valueLines.js +52 -0
  1333. package/dist/esm/trace-toolpack/traceToolpack/valueLines.js.map +1 -0
  1334. package/dist/esm/trace-toolpack/traceToolpack/valueQueries.d.ts +6 -0
  1335. package/dist/esm/trace-toolpack/traceToolpack/valueQueries.js +122 -0
  1336. package/dist/esm/trace-toolpack/traceToolpack/valueQueries.js.map +1 -0
  1337. package/dist/esm/trace-toolpack/traceToolpack/writerHints.d.ts +13 -0
  1338. package/dist/esm/trace-toolpack/traceToolpack/writerHints.js +43 -0
  1339. package/dist/esm/trace-toolpack/traceToolpack/writerHints.js.map +1 -0
  1340. package/dist/esm/trace-toolpack/traceToolpack.d.ts +15 -40
  1341. package/dist/esm/trace-toolpack/traceToolpack.js +15 -2452
  1342. package/dist/esm/trace-toolpack/traceToolpack.js.map +1 -1
  1343. package/dist/events/dispatcher.js +2 -2
  1344. package/dist/events/payloads/access.js +3 -0
  1345. package/dist/events/payloads/access.js.map +1 -0
  1346. package/dist/events/payloads/agent.js +3 -0
  1347. package/dist/events/payloads/agent.js.map +1 -0
  1348. package/dist/events/payloads/answer.js +3 -0
  1349. package/dist/events/payloads/answer.js.map +1 -0
  1350. package/dist/events/payloads/artifacts.js +3 -0
  1351. package/dist/events/payloads/artifacts.js.map +1 -0
  1352. package/dist/events/payloads/consent.js +3 -0
  1353. package/dist/events/payloads/consent.js.map +1 -0
  1354. package/dist/events/payloads/context.js +3 -0
  1355. package/dist/events/payloads/context.js.map +1 -0
  1356. package/dist/events/payloads/cost.js +3 -0
  1357. package/dist/events/payloads/cost.js.map +1 -0
  1358. package/dist/events/payloads/dependencyTypes.js +3 -0
  1359. package/dist/events/payloads/dependencyTypes.js.map +1 -0
  1360. package/dist/events/payloads/evaluation.js +3 -0
  1361. package/dist/events/payloads/evaluation.js.map +1 -0
  1362. package/dist/events/payloads/fallback.js +3 -0
  1363. package/dist/events/payloads/fallback.js.map +1 -0
  1364. package/dist/events/payloads/findings.js +3 -0
  1365. package/dist/events/payloads/findings.js.map +1 -0
  1366. package/dist/events/payloads/flow.js +3 -0
  1367. package/dist/events/payloads/flow.js.map +1 -0
  1368. package/dist/events/payloads/integrity.js +4 -0
  1369. package/dist/events/payloads/integrity.js.map +1 -0
  1370. package/dist/events/payloads/maps.js +4 -0
  1371. package/dist/events/payloads/maps.js.map +1 -0
  1372. package/dist/events/payloads/mcpRequests.js +4 -0
  1373. package/dist/events/payloads/mcpRequests.js.map +1 -0
  1374. package/dist/events/payloads/memory.js +4 -0
  1375. package/dist/events/payloads/memory.js.map +1 -0
  1376. package/dist/events/payloads/reliability.js +3 -0
  1377. package/dist/events/payloads/reliability.js.map +1 -0
  1378. package/dist/events/payloads/runConfiguration.js +3 -0
  1379. package/dist/events/payloads/runConfiguration.js.map +1 -0
  1380. package/dist/events/payloads/skills.js +3 -0
  1381. package/dist/events/payloads/skills.js.map +1 -0
  1382. package/dist/events/payloads/stream.js +3 -0
  1383. package/dist/events/payloads/stream.js.map +1 -0
  1384. package/dist/events/payloads/thinking.js +3 -0
  1385. package/dist/events/payloads/thinking.js.map +1 -0
  1386. package/dist/events/payloads/toolCatalog.js +3 -0
  1387. package/dist/events/payloads/toolCatalog.js.map +1 -0
  1388. package/dist/events/payloads/toolChoice.js +3 -0
  1389. package/dist/events/payloads/toolChoice.js.map +1 -0
  1390. package/dist/events/payloads/toolEffects.js +3 -0
  1391. package/dist/events/payloads/toolEffects.js.map +1 -0
  1392. package/dist/events/payloads/toolSemantics.js +3 -0
  1393. package/dist/events/payloads/toolSemantics.js.map +1 -0
  1394. package/dist/events/payloads/toolSessionPayloads.js +18 -0
  1395. package/dist/events/payloads/toolSessionPayloads.js.map +1 -0
  1396. package/dist/events/payloads/validation.js +3 -0
  1397. package/dist/events/payloads/validation.js.map +1 -0
  1398. package/dist/events/registry.js +5 -15
  1399. package/dist/events/registry.js.map +1 -1
  1400. package/dist/hosting/answeredPause.js +16 -28
  1401. package/dist/hosting/answeredPause.js.map +1 -1
  1402. package/dist/hosting/durability.js +10 -8
  1403. package/dist/hosting/durability.js.map +1 -1
  1404. package/dist/hosting/standingAgent.js +72 -108
  1405. package/dist/hosting/standingAgent.js.map +1 -1
  1406. package/dist/hosting/stream.js +2 -5
  1407. package/dist/hosting/stream.js.map +1 -1
  1408. package/dist/hosting/streamHandler.js +5 -5
  1409. package/dist/hosting/streamHandler.js.map +1 -1
  1410. package/dist/index.js +7 -10
  1411. package/dist/index.js.map +1 -1
  1412. package/dist/influence-core/attribute.js +1 -1
  1413. package/dist/influence-core/attribute.js.map +1 -1
  1414. package/dist/influence-core/contrastive.js +1 -1
  1415. package/dist/influence-core/contrastive.js.map +1 -1
  1416. package/dist/influence-core/margin.js +1 -1
  1417. package/dist/influence-core/margin.js.map +1 -1
  1418. package/dist/influence-core/signals.js +1 -1
  1419. package/dist/influence-core/signals.js.map +1 -1
  1420. package/dist/influence-core/similarity.js +1 -1
  1421. package/dist/influence-core/similarity.js.map +1 -1
  1422. package/dist/injection-engine/buildInjectionEngineSubflow.js +1 -1
  1423. package/dist/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  1424. package/dist/injection-engine/devWarn.js +3 -2
  1425. package/dist/injection-engine/devWarn.js.map +1 -1
  1426. package/dist/injection-engine/entryScorer.js +1 -1
  1427. package/dist/injection-engine/entryScorer.js.map +1 -1
  1428. package/dist/injection-engine/skillGraph/cursorEvidence.js +58 -0
  1429. package/dist/injection-engine/skillGraph/cursorEvidence.js.map +1 -0
  1430. package/dist/injection-engine/skillGraph/cursorResolution.js +245 -0
  1431. package/dist/injection-engine/skillGraph/cursorResolution.js.map +1 -0
  1432. package/dist/injection-engine/skillGraph/decision.js +15 -0
  1433. package/dist/injection-engine/skillGraph/decision.js.map +1 -0
  1434. package/dist/injection-engine/skillGraph/entryScores.js +34 -0
  1435. package/dist/injection-engine/skillGraph/entryScores.js.map +1 -0
  1436. package/dist/injection-engine/skillGraph/entrySuppression.js +50 -0
  1437. package/dist/injection-engine/skillGraph/entrySuppression.js.map +1 -0
  1438. package/dist/injection-engine/skillGraph/graphConfig.js +3 -0
  1439. package/dist/injection-engine/skillGraph/graphConfig.js.map +1 -0
  1440. package/dist/injection-engine/skillGraph/graphContracts.js +17 -0
  1441. package/dist/injection-engine/skillGraph/graphContracts.js.map +1 -0
  1442. package/dist/injection-engine/skillGraph/graphCursor.js +3 -0
  1443. package/dist/injection-engine/skillGraph/graphCursor.js.map +1 -0
  1444. package/dist/injection-engine/skillGraph/graphDrawing.js +35 -0
  1445. package/dist/injection-engine/skillGraph/graphDrawing.js.map +1 -0
  1446. package/dist/injection-engine/skillGraph/graphRoutes.js +3 -0
  1447. package/dist/injection-engine/skillGraph/graphRoutes.js.map +1 -0
  1448. package/dist/injection-engine/skillGraph/passMemo.js +42 -0
  1449. package/dist/injection-engine/skillGraph/passMemo.js.map +1 -0
  1450. package/dist/injection-engine/skillGraph/reachability.js +67 -0
  1451. package/dist/injection-engine/skillGraph/reachability.js.map +1 -0
  1452. package/dist/injection-engine/skillGraph/routePredicates.js +66 -0
  1453. package/dist/injection-engine/skillGraph/routePredicates.js.map +1 -0
  1454. package/dist/injection-engine/skillGraph/routingView.js +28 -0
  1455. package/dist/injection-engine/skillGraph/routingView.js.map +1 -0
  1456. package/dist/injection-engine/skillGraph/treeCompilation.js +158 -0
  1457. package/dist/injection-engine/skillGraph/treeCompilation.js.map +1 -0
  1458. package/dist/injection-engine/skillGraph/triggerCompilation.js +79 -0
  1459. package/dist/injection-engine/skillGraph/triggerCompilation.js.map +1 -0
  1460. package/dist/injection-engine/skillGraph.js +40 -832
  1461. package/dist/injection-engine/skillGraph.js.map +1 -1
  1462. package/dist/injection-engine/skillMatch.js +2 -1
  1463. package/dist/injection-engine/skillMatch.js.map +1 -1
  1464. package/dist/injection-engine/skillToolDescriptors.js +2 -2
  1465. package/dist/injection-engine/skillToolDescriptors.js.map +1 -1
  1466. package/dist/lib/cosine.js.map +1 -0
  1467. package/dist/lib/iterationBudget.js +9 -1
  1468. package/dist/lib/iterationBudget.js.map +1 -1
  1469. package/dist/lib/saidByPerson.js +3 -1
  1470. package/dist/lib/saidByPerson.js.map +1 -1
  1471. package/dist/lib/spokenIds.js +2 -2
  1472. package/dist/lib/spokenIds.js.map +1 -1
  1473. package/dist/lib/toolBytes.js +2 -2
  1474. package/dist/lib/toolBytes.js.map +1 -1
  1475. package/dist/maps/engagement/lease.js +1 -1
  1476. package/dist/maps/engagement/lease.js.map +1 -1
  1477. package/dist/memory/causal/evidenceRecorder.js +221 -213
  1478. package/dist/memory/causal/evidenceRecorder.js.map +1 -1
  1479. package/dist/memory/causal/loadSnapshot.js +16 -59
  1480. package/dist/memory/causal/loadSnapshot.js.map +1 -1
  1481. package/dist/memory/causal/observation.js +16 -0
  1482. package/dist/memory/causal/observation.js.map +1 -0
  1483. package/dist/memory/causal/snapshotProjection.js +65 -0
  1484. package/dist/memory/causal/snapshotProjection.js.map +1 -0
  1485. package/dist/memory/causal/snapshotSchema.js +172 -0
  1486. package/dist/memory/causal/snapshotSchema.js.map +1 -0
  1487. package/dist/memory/causal/types.js +0 -18
  1488. package/dist/memory/causal/types.js.map +1 -1
  1489. package/dist/memory/causal/writeSnapshot.js +17 -14
  1490. package/dist/memory/causal/writeSnapshot.js.map +1 -1
  1491. package/dist/memory/embedding/index.js +1 -1
  1492. package/dist/memory/embedding/index.js.map +1 -1
  1493. package/dist/memory/store/InMemoryStore.js +1 -1
  1494. package/dist/memory/store/InMemoryStore.js.map +1 -1
  1495. package/dist/memory/store/staticVectorStore.js +1 -1
  1496. package/dist/memory/store/staticVectorStore.js.map +1 -1
  1497. package/dist/memory/wire/mountMemoryPipeline.js +8 -2
  1498. package/dist/memory/wire/mountMemoryPipeline.js.map +1 -1
  1499. package/dist/patterns/LlmRouter.js +49 -177
  1500. package/dist/patterns/LlmRouter.js.map +1 -1
  1501. package/dist/patterns/LlmSwarm.js +7 -70
  1502. package/dist/patterns/LlmSwarm.js.map +1 -1
  1503. package/dist/patterns/MapReduce.js +30 -20
  1504. package/dist/patterns/MapReduce.js.map +1 -1
  1505. package/dist/patterns/Swarm.js +233 -79
  1506. package/dist/patterns/Swarm.js.map +1 -1
  1507. package/dist/patterns/index.js.map +1 -1
  1508. package/dist/patterns/routing.js +22 -0
  1509. package/dist/patterns/routing.js.map +1 -0
  1510. package/dist/recorders/observability/BoundaryRecorder.js +23 -299
  1511. package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
  1512. package/dist/recorders/observability/boundaryRecorder/agentInternal.js +61 -0
  1513. package/dist/recorders/observability/boundaryRecorder/agentInternal.js.map +1 -0
  1514. package/dist/recorders/observability/boundaryRecorder/domainEvents.js +3 -0
  1515. package/dist/recorders/observability/boundaryRecorder/domainEvents.js.map +1 -0
  1516. package/dist/recorders/observability/boundaryRecorder/eventBuilders.js +84 -0
  1517. package/dist/recorders/observability/boundaryRecorder/eventBuilders.js.map +1 -0
  1518. package/dist/recorders/observability/boundaryRecorder/flowEvents.js +3 -0
  1519. package/dist/recorders/observability/boundaryRecorder/flowEvents.js.map +1 -0
  1520. package/dist/recorders/observability/boundaryRecorder/leanContent.js +55 -0
  1521. package/dist/recorders/observability/boundaryRecorder/leanContent.js.map +1 -0
  1522. package/dist/recorders/observability/boundaryRecorder/options.js +3 -0
  1523. package/dist/recorders/observability/boundaryRecorder/options.js.map +1 -0
  1524. package/dist/recorders/observability/boundaryRecorder/rangeLabels.js +43 -0
  1525. package/dist/recorders/observability/boundaryRecorder/rangeLabels.js.map +1 -0
  1526. package/dist/recorders/observability/boundaryRecorder/rollups.js +72 -0
  1527. package/dist/recorders/observability/boundaryRecorder/rollups.js.map +1 -0
  1528. package/dist/recorders/observability/fileRecordingSink.js +2 -4
  1529. package/dist/recorders/observability/fileRecordingSink.js.map +1 -1
  1530. package/dist/recorders/observability/recordingEnvelope.js +6 -10
  1531. package/dist/recorders/observability/recordingEnvelope.js.map +1 -1
  1532. package/dist/redaction/coverage.js +5 -3
  1533. package/dist/redaction/coverage.js.map +1 -1
  1534. package/dist/redaction/declared.js +18 -3
  1535. package/dist/redaction/declared.js.map +1 -1
  1536. package/dist/redaction/knownStrings.js +10 -34
  1537. package/dist/redaction/knownStrings.js.map +1 -1
  1538. package/dist/redaction/marker.js +1 -1
  1539. package/dist/redaction/privateCaller.js +84 -0
  1540. package/dist/redaction/privateCaller.js.map +1 -0
  1541. package/dist/redaction/privateCheckpoint.js +99 -0
  1542. package/dist/redaction/privateCheckpoint.js.map +1 -0
  1543. package/dist/redaction/privateFields.js +159 -0
  1544. package/dist/redaction/privateFields.js.map +1 -0
  1545. package/dist/redaction/privateRun.js +112 -0
  1546. package/dist/redaction/privateRun.js.map +1 -0
  1547. package/dist/redaction/runRedaction.js +141 -93
  1548. package/dist/redaction/runRedaction.js.map +1 -1
  1549. package/dist/redaction/served.js +28 -7
  1550. package/dist/redaction/served.js.map +1 -1
  1551. package/dist/resilience/withCircuitBreaker.js +1 -1
  1552. package/dist/security/extractSequence.js +1 -1
  1553. package/dist/semantics/coverage/answer.js +1 -1
  1554. package/dist/semantics/coverage/answer.js.map +1 -1
  1555. package/dist/semantics/coverage/composedCoverage.js +1 -1
  1556. package/dist/semantics/coverage/items.js +1 -1
  1557. package/dist/semantics/coverage/read.js +3 -3
  1558. package/dist/semantics/types.js +1 -1
  1559. package/dist/time/drift.js +1 -1
  1560. package/dist/time-travel/servedView/assembly.js +48 -0
  1561. package/dist/time-travel/servedView/assembly.js.map +1 -0
  1562. package/dist/time-travel/servedView/conversation.js +34 -0
  1563. package/dist/time-travel/servedView/conversation.js.map +1 -0
  1564. package/dist/time-travel/servedView/findings.js +72 -0
  1565. package/dist/time-travel/servedView/findings.js.map +1 -0
  1566. package/dist/time-travel/servedView/gaps.js +480 -0
  1567. package/dist/time-travel/servedView/gaps.js.map +1 -0
  1568. package/dist/time-travel/servedView/ontology.js +64 -0
  1569. package/dist/time-travel/servedView/ontology.js.map +1 -0
  1570. package/dist/time-travel/servedView/recordReads.js +79 -0
  1571. package/dist/time-travel/servedView/recordReads.js.map +1 -0
  1572. package/dist/time-travel/servedView/requestOnly.js +71 -0
  1573. package/dist/time-travel/servedView/requestOnly.js.map +1 -0
  1574. package/dist/time-travel/servedView/system.js +41 -0
  1575. package/dist/time-travel/servedView/system.js.map +1 -0
  1576. package/dist/time-travel/servedView/tools.js +40 -0
  1577. package/dist/time-travel/servedView/tools.js.map +1 -0
  1578. package/dist/time-travel/servedView/value.js +62 -0
  1579. package/dist/time-travel/servedView/value.js.map +1 -0
  1580. package/dist/time-travel/servedView.js +161 -882
  1581. package/dist/time-travel/servedView.js.map +1 -1
  1582. package/dist/tools/displayName.js +19 -0
  1583. package/dist/tools/displayName.js.map +1 -0
  1584. package/dist/tools/finiteLabel.js +36 -0
  1585. package/dist/tools/finiteLabel.js.map +1 -0
  1586. package/dist/tools/inputRequest.js +2 -2
  1587. package/dist/tools/toolParty.js +45 -0
  1588. package/dist/tools/toolParty.js.map +1 -0
  1589. package/dist/tools/toolResourceOwner.js +87 -0
  1590. package/dist/tools/toolResourceOwner.js.map +1 -0
  1591. package/dist/tools/toolSessions/contracts.js +10 -0
  1592. package/dist/tools/toolSessions/contracts.js.map +1 -0
  1593. package/dist/tools/toolSessions/keys.js +120 -0
  1594. package/dist/tools/toolSessions/keys.js.map +1 -0
  1595. package/dist/tools/toolSessions/localStatus.js +13 -0
  1596. package/dist/tools/toolSessions/localStatus.js.map +1 -0
  1597. package/dist/tools/toolSessions.js +151 -127
  1598. package/dist/tools/toolSessions.js.map +1 -1
  1599. package/dist/tools/tools.js +18 -17
  1600. package/dist/tools/tools.js.map +1 -1
  1601. package/dist/trace-toolpack/traceToolpack/artifactFacts.js +18 -0
  1602. package/dist/trace-toolpack/traceToolpack/artifactFacts.js.map +1 -0
  1603. package/dist/trace-toolpack/traceToolpack/backtrackView.js +120 -0
  1604. package/dist/trace-toolpack/traceToolpack/backtrackView.js.map +1 -0
  1605. package/dist/trace-toolpack/traceToolpack/contextErrors.js +357 -0
  1606. package/dist/trace-toolpack/traceToolpack/contextErrors.js.map +1 -0
  1607. package/dist/trace-toolpack/traceToolpack/findInTrace.js +181 -0
  1608. package/dist/trace-toolpack/traceToolpack/findInTrace.js.map +1 -0
  1609. package/dist/trace-toolpack/traceToolpack/findingEvidence.js +189 -0
  1610. package/dist/trace-toolpack/traceToolpack/findingEvidence.js.map +1 -0
  1611. package/dist/trace-toolpack/traceToolpack/innerRecords.js +94 -0
  1612. package/dist/trace-toolpack/traceToolpack/innerRecords.js.map +1 -0
  1613. package/dist/trace-toolpack/traceToolpack/narrativeView.js +47 -0
  1614. package/dist/trace-toolpack/traceToolpack/narrativeView.js.map +1 -0
  1615. package/dist/trace-toolpack/traceToolpack/navigationHints.js +47 -0
  1616. package/dist/trace-toolpack/traceToolpack/navigationHints.js.map +1 -0
  1617. package/dist/trace-toolpack/traceToolpack/nodeView.js +133 -0
  1618. package/dist/trace-toolpack/traceToolpack/nodeView.js.map +1 -0
  1619. package/dist/trace-toolpack/traceToolpack/packIndex.js +160 -0
  1620. package/dist/trace-toolpack/traceToolpack/packIndex.js.map +1 -0
  1621. package/dist/trace-toolpack/traceToolpack/parameterSchemas.js +40 -0
  1622. package/dist/trace-toolpack/traceToolpack/parameterSchemas.js.map +1 -0
  1623. package/dist/trace-toolpack/traceToolpack/recursiveFactory.js +397 -0
  1624. package/dist/trace-toolpack/traceToolpack/recursiveFactory.js.map +1 -0
  1625. package/dist/trace-toolpack/traceToolpack/runOverview.js +117 -0
  1626. package/dist/trace-toolpack/traceToolpack/runOverview.js.map +1 -0
  1627. package/dist/trace-toolpack/traceToolpack/sliceView.js +90 -0
  1628. package/dist/trace-toolpack/traceToolpack/sliceView.js.map +1 -0
  1629. package/dist/trace-toolpack/traceToolpack/structuralLimits.js +71 -0
  1630. package/dist/trace-toolpack/traceToolpack/structuralLimits.js.map +1 -0
  1631. package/dist/trace-toolpack/traceToolpack/toolCallJournal.js +388 -0
  1632. package/dist/trace-toolpack/traceToolpack/toolCallJournal.js.map +1 -0
  1633. package/dist/trace-toolpack/traceToolpack/valueLines.js +60 -0
  1634. package/dist/trace-toolpack/traceToolpack/valueLines.js.map +1 -0
  1635. package/dist/trace-toolpack/traceToolpack/valueQueries.js +126 -0
  1636. package/dist/trace-toolpack/traceToolpack/valueQueries.js.map +1 -0
  1637. package/dist/trace-toolpack/traceToolpack/writerHints.js +47 -0
  1638. package/dist/trace-toolpack/traceToolpack/writerHints.js.map +1 -0
  1639. package/dist/trace-toolpack/traceToolpack.js +18 -2455
  1640. package/dist/trace-toolpack/traceToolpack.js.map +1 -1
  1641. package/dist/types/adapters/observability/auditShapes.d.ts +5 -31
  1642. package/dist/types/adapters/observability/auditShapes.d.ts.map +1 -1
  1643. package/dist/types/adapters/observability/otel.d.ts +1 -1
  1644. package/dist/types/bridge/eventMeta.d.ts +2 -0
  1645. package/dist/types/bridge/eventMeta.d.ts.map +1 -1
  1646. package/dist/types/core/Agent.d.ts +18 -121
  1647. package/dist/types/core/Agent.d.ts.map +1 -1
  1648. package/dist/types/core/LLMCall.d.ts +1 -4
  1649. package/dist/types/core/LLMCall.d.ts.map +1 -1
  1650. package/dist/types/core/RunnerBase.d.ts +42 -114
  1651. package/dist/types/core/RunnerBase.d.ts.map +1 -1
  1652. package/dist/types/core/agent/arguments/answerRows.d.ts +27 -0
  1653. package/dist/types/core/agent/arguments/answerRows.d.ts.map +1 -0
  1654. package/dist/types/core/agent/arguments/ask.d.ts +5 -11
  1655. package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
  1656. package/dist/types/core/agent/arguments/dispatch.d.ts +4 -4
  1657. package/dist/types/core/agent/arguments/dispatch.d.ts.map +1 -1
  1658. package/dist/types/core/agent/arguments/kept.d.ts +1 -1
  1659. package/dist/types/core/agent/arguments/partialWindow.d.ts +2 -1
  1660. package/dist/types/core/agent/arguments/partialWindow.d.ts.map +1 -1
  1661. package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts +38 -0
  1662. package/dist/types/core/agent/arguments/pendingPrivateAsk.d.ts.map +1 -0
  1663. package/dist/types/core/agent/arguments/privateAnswers.d.ts +47 -0
  1664. package/dist/types/core/agent/arguments/privateAnswers.d.ts.map +1 -0
  1665. package/dist/types/core/agent/arguments/resolutionRows.d.ts +30 -0
  1666. package/dist/types/core/agent/arguments/resolutionRows.d.ts.map +1 -0
  1667. package/dist/types/core/agent/arguments/resolve.d.ts +2 -13
  1668. package/dist/types/core/agent/arguments/resolve.d.ts.map +1 -1
  1669. package/dist/types/core/agent/arguments/serve.d.ts +0 -5
  1670. package/dist/types/core/agent/arguments/serve.d.ts.map +1 -1
  1671. package/dist/types/core/agent/arguments/subflow.d.ts.map +1 -1
  1672. package/dist/types/core/agent/buildAgentChart.d.ts +3 -326
  1673. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  1674. package/dist/types/core/agent/buildToolRegistry.d.ts +1 -1
  1675. package/dist/types/core/agent/callerIdentity.d.ts +9 -64
  1676. package/dist/types/core/agent/callerIdentity.d.ts.map +1 -1
  1677. package/dist/types/core/agent/chartContract.d.ts +328 -0
  1678. package/dist/types/core/agent/chartContract.d.ts.map +1 -0
  1679. package/dist/types/core/agent/checkpointDomain.d.ts +12 -0
  1680. package/dist/types/core/agent/checkpointDomain.d.ts.map +1 -0
  1681. package/dist/types/core/agent/componentObservers.d.ts +15 -0
  1682. package/dist/types/core/agent/componentObservers.d.ts.map +1 -0
  1683. package/dist/types/core/agent/componentResources.d.ts +40 -0
  1684. package/dist/types/core/agent/componentResources.d.ts.map +1 -0
  1685. package/dist/types/core/agent/evidence/frames.d.ts.map +1 -1
  1686. package/dist/types/core/agent/evidence/servedJson.d.ts +1 -1
  1687. package/dist/types/core/agent/findings/contingent.d.ts +1 -1
  1688. package/dist/types/core/agent/findings/judge.d.ts +1 -1
  1689. package/dist/types/core/agent/findings/types.d.ts +1 -1
  1690. package/dist/types/core/agent/findings/unsettled.d.ts +3 -3
  1691. package/dist/types/core/agent/honesty/inputsMountContract.d.ts +67 -0
  1692. package/dist/types/core/agent/honesty/inputsMountContract.d.ts.map +1 -0
  1693. package/dist/types/core/agent/honesty/mounts.d.ts +4 -66
  1694. package/dist/types/core/agent/honesty/mounts.d.ts.map +1 -1
  1695. package/dist/types/core/agent/hostTurn.d.ts +18 -0
  1696. package/dist/types/core/agent/hostTurn.d.ts.map +1 -0
  1697. package/dist/types/core/agent/pauseOwnership.d.ts +25 -0
  1698. package/dist/types/core/agent/pauseOwnership.d.ts.map +1 -0
  1699. package/dist/types/core/agent/presentTool.d.ts +1 -1
  1700. package/dist/types/core/agent/resultCeiling.d.ts +1 -1
  1701. package/dist/types/core/agent/resumeAnswer.d.ts +11 -0
  1702. package/dist/types/core/agent/resumeAnswer.d.ts.map +1 -0
  1703. package/dist/types/core/agent/resumeCheckpoint.d.ts +13 -0
  1704. package/dist/types/core/agent/resumeCheckpoint.d.ts.map +1 -0
  1705. package/dist/types/core/agent/resumeError.d.ts +9 -0
  1706. package/dist/types/core/agent/resumeError.d.ts.map +1 -0
  1707. package/dist/types/core/agent/run/clocks.d.ts +45 -0
  1708. package/dist/types/core/agent/run/clocks.d.ts.map +1 -0
  1709. package/dist/types/core/agent/run/commitRunRedaction.d.ts +5 -0
  1710. package/dist/types/core/agent/run/commitRunRedaction.d.ts.map +1 -0
  1711. package/dist/types/core/agent/run/eventStageIds.d.ts +41 -0
  1712. package/dist/types/core/agent/run/eventStageIds.d.ts.map +1 -0
  1713. package/dist/types/core/agent/run/injectionDelivery.d.ts +5 -0
  1714. package/dist/types/core/agent/run/injectionDelivery.d.ts.map +1 -0
  1715. package/dist/types/core/agent/run/ledgerFacts.d.ts +9 -0
  1716. package/dist/types/core/agent/run/ledgerFacts.d.ts.map +1 -0
  1717. package/dist/types/core/agent/run/resumeRedaction.d.ts +7 -0
  1718. package/dist/types/core/agent/run/resumeRedaction.d.ts.map +1 -0
  1719. package/dist/types/core/agent/run/withoutTime.d.ts +9 -0
  1720. package/dist/types/core/agent/run/withoutTime.d.ts.map +1 -0
  1721. package/dist/types/core/agent/runValues.d.ts +72 -0
  1722. package/dist/types/core/agent/runValues.d.ts.map +1 -0
  1723. package/dist/types/core/agent/scripts/rows.d.ts +1 -1
  1724. package/dist/types/core/agent/scripts/types.d.ts +1 -1
  1725. package/dist/types/core/agent/stages/argumentAsk.d.ts +7 -1
  1726. package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
  1727. package/dist/types/core/agent/stages/argumentParties.d.ts +4 -0
  1728. package/dist/types/core/agent/stages/argumentParties.d.ts.map +1 -0
  1729. package/dist/types/core/agent/stages/batchParties.d.ts +22 -0
  1730. package/dist/types/core/agent/stages/batchParties.d.ts.map +1 -0
  1731. package/dist/types/core/agent/stages/finalStageContract.d.ts +46 -0
  1732. package/dist/types/core/agent/stages/finalStageContract.d.ts.map +1 -0
  1733. package/dist/types/core/agent/stages/prepareFinal.d.ts +2 -45
  1734. package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
  1735. package/dist/types/core/agent/stages/searchCoverage.d.ts +1 -1
  1736. package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
  1737. package/dist/types/core/agent/stages/servedParties.d.ts +40 -0
  1738. package/dist/types/core/agent/stages/servedParties.d.ts.map +1 -0
  1739. package/dist/types/core/agent/stages/timeLayer.d.ts +3 -3
  1740. package/dist/types/core/agent/stages/timeLayer.d.ts.map +1 -1
  1741. package/dist/types/core/agent/stages/toolCallShape.d.ts +8 -0
  1742. package/dist/types/core/agent/stages/toolCallShape.d.ts.map +1 -0
  1743. package/dist/types/core/agent/stages/toolCalls/access/argumentGate.d.ts +22 -0
  1744. package/dist/types/core/agent/stages/toolCalls/access/argumentGate.d.ts.map +1 -0
  1745. package/dist/types/core/agent/stages/toolCalls/access/argumentValidation.d.ts +11 -0
  1746. package/dist/types/core/agent/stages/toolCalls/access/argumentValidation.d.ts.map +1 -0
  1747. package/dist/types/core/agent/stages/toolCalls/access/bindings.d.ts +62 -0
  1748. package/dist/types/core/agent/stages/toolCalls/access/bindings.d.ts.map +1 -0
  1749. package/dist/types/core/agent/stages/toolCalls/access/callState.d.ts +15 -0
  1750. package/dist/types/core/agent/stages/toolCalls/access/callState.d.ts.map +1 -0
  1751. package/dist/types/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts +29 -0
  1752. package/dist/types/core/agent/stages/toolCalls/access/capabilityQuestion.d.ts.map +1 -0
  1753. package/dist/types/core/agent/stages/toolCalls/access/checkInAdmission.d.ts +45 -0
  1754. package/dist/types/core/agent/stages/toolCalls/access/checkInAdmission.d.ts.map +1 -0
  1755. package/dist/types/core/agent/stages/toolCalls/access/heldAnswer.d.ts +9 -0
  1756. package/dist/types/core/agent/stages/toolCalls/access/heldAnswer.d.ts.map +1 -0
  1757. package/dist/types/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts +51 -0
  1758. package/dist/types/core/agent/stages/toolCalls/access/middlewareAdmission.d.ts.map +1 -0
  1759. package/dist/types/core/agent/stages/toolCalls/access/toolPermission.d.ts +25 -0
  1760. package/dist/types/core/agent/stages/toolCalls/access/toolPermission.d.ts.map +1 -0
  1761. package/dist/types/core/agent/stages/toolCalls/batch/completion.d.ts +19 -0
  1762. package/dist/types/core/agent/stages/toolCalls/batch/completion.d.ts.map +1 -0
  1763. package/dist/types/core/agent/stages/toolCalls/batch/dispatchContext.d.ts +37 -0
  1764. package/dist/types/core/agent/stages/toolCalls/batch/dispatchContext.d.ts.map +1 -0
  1765. package/dist/types/core/agent/stages/toolCalls/batch/execute.d.ts +8 -0
  1766. package/dist/types/core/agent/stages/toolCalls/batch/execute.d.ts.map +1 -0
  1767. package/dist/types/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts +19 -0
  1768. package/dist/types/core/agent/stages/toolCalls/batch/findingsAdmission.d.ts.map +1 -0
  1769. package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts +7 -0
  1770. package/dist/types/core/agent/stages/toolCalls/batch/inputResolutions.d.ts.map +1 -0
  1771. package/dist/types/core/agent/stages/toolCalls/batch/paused.d.ts +66 -0
  1772. package/dist/types/core/agent/stages/toolCalls/batch/paused.d.ts.map +1 -0
  1773. package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts +6 -0
  1774. package/dist/types/core/agent/stages/toolCalls/batch/refusal.d.ts.map +1 -0
  1775. package/dist/types/core/agent/stages/toolCalls/batch/settle.d.ts +67 -0
  1776. package/dist/types/core/agent/stages/toolCalls/batch/settle.d.ts.map +1 -0
  1777. package/dist/types/core/agent/stages/toolCalls/batch/settlementOperations.d.ts +18 -0
  1778. package/dist/types/core/agent/stages/toolCalls/batch/settlementOperations.d.ts.map +1 -0
  1779. package/dist/types/core/agent/stages/toolCalls/compose.d.ts +240 -0
  1780. package/dist/types/core/agent/stages/toolCalls/compose.d.ts.map +1 -0
  1781. package/dist/types/core/agent/stages/toolCalls/contracts/access.d.ts +111 -0
  1782. package/dist/types/core/agent/stages/toolCalls/contracts/access.d.ts.map +1 -0
  1783. package/dist/types/core/agent/stages/toolCalls/contracts/artifacts.d.ts +27 -0
  1784. package/dist/types/core/agent/stages/toolCalls/contracts/artifacts.d.ts.map +1 -0
  1785. package/dist/types/core/agent/stages/toolCalls/contracts/batchCall.d.ts +9 -0
  1786. package/dist/types/core/agent/stages/toolCalls/contracts/batchCall.d.ts.map +1 -0
  1787. package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts +44 -0
  1788. package/dist/types/core/agent/stages/toolCalls/contracts/callCells.d.ts.map +1 -0
  1789. package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts +51 -0
  1790. package/dist/types/core/agent/stages/toolCalls/contracts/callFacts.d.ts.map +1 -0
  1791. package/dist/types/core/agent/stages/toolCalls/contracts/catalog.d.ts +57 -0
  1792. package/dist/types/core/agent/stages/toolCalls/contracts/catalog.d.ts.map +1 -0
  1793. package/dist/types/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts +18 -0
  1794. package/dist/types/core/agent/stages/toolCalls/contracts/dispatchBatch.d.ts.map +1 -0
  1795. package/dist/types/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts +15 -0
  1796. package/dist/types/core/agent/stages/toolCalls/contracts/dispatchCall.d.ts.map +1 -0
  1797. package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts +212 -0
  1798. package/dist/types/core/agent/stages/toolCalls/contracts/evidence.d.ts.map +1 -0
  1799. package/dist/types/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts +12 -0
  1800. package/dist/types/core/agent/stages/toolCalls/contracts/handlerDeps.d.ts.map +1 -0
  1801. package/dist/types/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts +3 -0
  1802. package/dist/types/core/agent/stages/toolCalls/contracts/inputsDispatch.d.ts.map +1 -0
  1803. package/dist/types/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts +12 -0
  1804. package/dist/types/core/agent/stages/toolCalls/contracts/invocationInputs.d.ts.map +1 -0
  1805. package/dist/types/core/agent/stages/toolCalls/contracts/observation.d.ts +25 -0
  1806. package/dist/types/core/agent/stages/toolCalls/contracts/observation.d.ts.map +1 -0
  1807. package/dist/types/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts +38 -0
  1808. package/dist/types/core/agent/stages/toolCalls/contracts/operations/artifacts.d.ts.map +1 -0
  1809. package/dist/types/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts +32 -0
  1810. package/dist/types/core/agent/stages/toolCalls/contracts/operations/catalog.d.ts.map +1 -0
  1811. package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts +15 -0
  1812. package/dist/types/core/agent/stages/toolCalls/contracts/operations/context.d.ts.map +1 -0
  1813. package/dist/types/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts +24 -0
  1814. package/dist/types/core/agent/stages/toolCalls/contracts/operations/coverage.d.ts.map +1 -0
  1815. package/dist/types/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts +6 -0
  1816. package/dist/types/core/agent/stages/toolCalls/contracts/operations/credentials.d.ts.map +1 -0
  1817. package/dist/types/core/agent/stages/toolCalls/contracts/operations/effects.d.ts +15 -0
  1818. package/dist/types/core/agent/stages/toolCalls/contracts/operations/effects.d.ts.map +1 -0
  1819. package/dist/types/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts +17 -0
  1820. package/dist/types/core/agent/stages/toolCalls/contracts/operations/integrity.d.ts.map +1 -0
  1821. package/dist/types/core/agent/stages/toolCalls/contracts/operations/limits.d.ts +20 -0
  1822. package/dist/types/core/agent/stages/toolCalls/contracts/operations/limits.d.ts.map +1 -0
  1823. package/dist/types/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts +26 -0
  1824. package/dist/types/core/agent/stages/toolCalls/contracts/operations/middleware.d.ts.map +1 -0
  1825. package/dist/types/core/agent/stages/toolCalls/contracts/operations/observations.d.ts +9 -0
  1826. package/dist/types/core/agent/stages/toolCalls/contracts/operations/observations.d.ts.map +1 -0
  1827. package/dist/types/core/agent/stages/toolCalls/contracts/operations/progress.d.ts +12 -0
  1828. package/dist/types/core/agent/stages/toolCalls/contracts/operations/progress.d.ts.map +1 -0
  1829. package/dist/types/core/agent/stages/toolCalls/contracts/operations/resources.d.ts +13 -0
  1830. package/dist/types/core/agent/stages/toolCalls/contracts/operations/resources.d.ts.map +1 -0
  1831. package/dist/types/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts +31 -0
  1832. package/dist/types/core/agent/stages/toolCalls/contracts/operations/resumedInvocation.d.ts.map +1 -0
  1833. package/dist/types/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts +41 -0
  1834. package/dist/types/core/agent/stages/toolCalls/contracts/operations/scripts.d.ts.map +1 -0
  1835. package/dist/types/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts +11 -0
  1836. package/dist/types/core/agent/stages/toolCalls/contracts/operations/semantics.d.ts.map +1 -0
  1837. package/dist/types/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts +14 -0
  1838. package/dist/types/core/agent/stages/toolCalls/contracts/operations/settlement.d.ts.map +1 -0
  1839. package/dist/types/core/agent/stages/toolCalls/contracts/operations/steps.d.ts +27 -0
  1840. package/dist/types/core/agent/stages/toolCalls/contracts/operations/steps.d.ts.map +1 -0
  1841. package/dist/types/core/agent/stages/toolCalls/contracts/resources.d.ts +68 -0
  1842. package/dist/types/core/agent/stages/toolCalls/contracts/resources.d.ts.map +1 -0
  1843. package/dist/types/core/agent/stages/toolCalls/contracts/results.d.ts +27 -0
  1844. package/dist/types/core/agent/stages/toolCalls/contracts/results.d.ts.map +1 -0
  1845. package/dist/types/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts +15 -0
  1846. package/dist/types/core/agent/stages/toolCalls/contracts/resumeFrames.d.ts.map +1 -0
  1847. package/dist/types/core/agent/stages/toolCalls/contracts/routing.d.ts +115 -0
  1848. package/dist/types/core/agent/stages/toolCalls/contracts/routing.d.ts.map +1 -0
  1849. package/dist/types/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts +5 -0
  1850. package/dist/types/core/agent/stages/toolCalls/decorators/limitsOperations.d.ts.map +1 -0
  1851. package/dist/types/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts +5 -0
  1852. package/dist/types/core/agent/stages/toolCalls/decorators/middlewareOperations.d.ts.map +1 -0
  1853. package/dist/types/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts +30 -0
  1854. package/dist/types/core/agent/stages/toolCalls/decorators/reportingCredentials.d.ts.map +1 -0
  1855. package/dist/types/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts +10 -0
  1856. package/dist/types/core/agent/stages/toolCalls/evidence/coverageOperations.d.ts.map +1 -0
  1857. package/dist/types/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts +5 -0
  1858. package/dist/types/core/agent/stages/toolCalls/evidence/integrityOperations.d.ts.map +1 -0
  1859. package/dist/types/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts +30 -0
  1860. package/dist/types/core/agent/stages/toolCalls/evidence/judgeLanded.d.ts.map +1 -0
  1861. package/dist/types/core/agent/stages/toolCalls/evidence/madeInRun.d.ts +7 -0
  1862. package/dist/types/core/agent/stages/toolCalls/evidence/madeInRun.d.ts.map +1 -0
  1863. package/dist/types/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts +23 -0
  1864. package/dist/types/core/agent/stages/toolCalls/evidence/producerCorpus.d.ts.map +1 -0
  1865. package/dist/types/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts +12 -0
  1866. package/dist/types/core/agent/stages/toolCalls/evidence/scriptsOperations.d.ts.map +1 -0
  1867. package/dist/types/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts +5 -0
  1868. package/dist/types/core/agent/stages/toolCalls/evidence/semanticsOperations.d.ts.map +1 -0
  1869. package/dist/types/core/agent/stages/toolCalls/evidence/sourceClock.d.ts +12 -0
  1870. package/dist/types/core/agent/stages/toolCalls/evidence/sourceClock.d.ts.map +1 -0
  1871. package/dist/types/core/agent/stages/toolCalls/evidence/towers.d.ts +19 -0
  1872. package/dist/types/core/agent/stages/toolCalls/evidence/towers.d.ts.map +1 -0
  1873. package/dist/types/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts +13 -0
  1874. package/dist/types/core/agent/stages/toolCalls/execution/artifactsOperations.d.ts.map +1 -0
  1875. package/dist/types/core/agent/stages/toolCalls/execution/callStart.d.ts +36 -0
  1876. package/dist/types/core/agent/stages/toolCalls/execution/callStart.d.ts.map +1 -0
  1877. package/dist/types/core/agent/stages/toolCalls/execution/catalogOperations.d.ts +18 -0
  1878. package/dist/types/core/agent/stages/toolCalls/execution/catalogOperations.d.ts.map +1 -0
  1879. package/dist/types/core/agent/stages/toolCalls/execution/contextOperations.d.ts +16 -0
  1880. package/dist/types/core/agent/stages/toolCalls/execution/contextOperations.d.ts.map +1 -0
  1881. package/dist/types/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts +49 -0
  1882. package/dist/types/core/agent/stages/toolCalls/execution/credentialAdmission.d.ts.map +1 -0
  1883. package/dist/types/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts +10 -0
  1884. package/dist/types/core/agent/stages/toolCalls/execution/credentialsOperations.d.ts.map +1 -0
  1885. package/dist/types/core/agent/stages/toolCalls/execution/deliveredResult.d.ts +41 -0
  1886. package/dist/types/core/agent/stages/toolCalls/execution/deliveredResult.d.ts.map +1 -0
  1887. package/dist/types/core/agent/stages/toolCalls/execution/dispatchCall.d.ts +6 -0
  1888. package/dist/types/core/agent/stages/toolCalls/execution/dispatchCall.d.ts.map +1 -0
  1889. package/dist/types/core/agent/stages/toolCalls/execution/initialInvocation.d.ts +71 -0
  1890. package/dist/types/core/agent/stages/toolCalls/execution/initialInvocation.d.ts.map +1 -0
  1891. package/dist/types/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts +10 -0
  1892. package/dist/types/core/agent/stages/toolCalls/execution/resourcesOperations.d.ts.map +1 -0
  1893. package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts +43 -0
  1894. package/dist/types/core/agent/stages/toolCalls/execution/resumedInvocation.d.ts.map +1 -0
  1895. package/dist/types/core/agent/stages/toolCalls/execution/wantedArguments.d.ts +20 -0
  1896. package/dist/types/core/agent/stages/toolCalls/execution/wantedArguments.d.ts.map +1 -0
  1897. package/dist/types/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts +4 -0
  1898. package/dist/types/core/agent/stages/toolCalls/helpers/dedupeIds.d.ts.map +1 -0
  1899. package/dist/types/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts +62 -0
  1900. package/dist/types/core/agent/stages/toolCalls/helpers/dispatchRefusals.d.ts.map +1 -0
  1901. package/dist/types/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts +42 -0
  1902. package/dist/types/core/agent/stages/toolCalls/helpers/mountedCursor.d.ts.map +1 -0
  1903. package/dist/types/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts +24 -0
  1904. package/dist/types/core/agent/stages/toolCalls/helpers/periodWarnings.d.ts.map +1 -0
  1905. package/dist/types/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts +88 -0
  1906. package/dist/types/core/agent/stages/toolCalls/helpers/readSkillRefusal.d.ts.map +1 -0
  1907. package/dist/types/core/agent/stages/toolCalls/helpers/sourceNote.d.ts +9 -0
  1908. package/dist/types/core/agent/stages/toolCalls/helpers/sourceNote.d.ts.map +1 -0
  1909. package/dist/types/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts +12 -0
  1910. package/dist/types/core/agent/stages/toolCalls/helpers/unscopedRun.d.ts.map +1 -0
  1911. package/dist/types/core/agent/stages/toolCalls/index.d.ts +15 -0
  1912. package/dist/types/core/agent/stages/toolCalls/index.d.ts.map +1 -0
  1913. package/dist/types/core/agent/stages/toolCalls/observation/callSettlement.d.ts +30 -0
  1914. package/dist/types/core/agent/stages/toolCalls/observation/callSettlement.d.ts.map +1 -0
  1915. package/dist/types/core/agent/stages/toolCalls/observation/observationsOperations.d.ts +5 -0
  1916. package/dist/types/core/agent/stages/toolCalls/observation/observationsOperations.d.ts.map +1 -0
  1917. package/dist/types/core/agent/stages/toolCalls/observation/progressOperations.d.ts +8 -0
  1918. package/dist/types/core/agent/stages/toolCalls/observation/progressOperations.d.ts.map +1 -0
  1919. package/dist/types/core/agent/stages/toolCalls/resume/ask.d.ts +45 -0
  1920. package/dist/types/core/agent/stages/toolCalls/resume/ask.d.ts.map +1 -0
  1921. package/dist/types/core/agent/stages/toolCalls/resume/checkIn.d.ts +40 -0
  1922. package/dist/types/core/agent/stages/toolCalls/resume/checkIn.d.ts.map +1 -0
  1923. package/dist/types/core/agent/stages/toolCalls/resume/credential.d.ts +38 -0
  1924. package/dist/types/core/agent/stages/toolCalls/resume/credential.d.ts.map +1 -0
  1925. package/dist/types/core/agent/stages/toolCalls/resume/handler.d.ts +7 -0
  1926. package/dist/types/core/agent/stages/toolCalls/resume/handler.d.ts.map +1 -0
  1927. package/dist/types/core/agent/stages/toolCalls/resume/plain.d.ts +33 -0
  1928. package/dist/types/core/agent/stages/toolCalls/resume/plain.d.ts.map +1 -0
  1929. package/dist/types/core/agent/stages/toolCalls/routing/effectsOperations.d.ts +5 -0
  1930. package/dist/types/core/agent/stages/toolCalls/routing/effectsOperations.d.ts.map +1 -0
  1931. package/dist/types/core/agent/stages/toolCalls/routing/policyHalt.d.ts +18 -0
  1932. package/dist/types/core/agent/stages/toolCalls/routing/policyHalt.d.ts.map +1 -0
  1933. package/dist/types/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts +21 -0
  1934. package/dist/types/core/agent/stages/toolCalls/routing/readSkillRoute.d.ts.map +1 -0
  1935. package/dist/types/core/agent/stages/toolCalls/routing/skillActivation.d.ts +16 -0
  1936. package/dist/types/core/agent/stages/toolCalls/routing/skillActivation.d.ts.map +1 -0
  1937. package/dist/types/core/agent/stages/toolCalls/routing/stepsOperations.d.ts +5 -0
  1938. package/dist/types/core/agent/stages/toolCalls/routing/stepsOperations.d.ts.map +1 -0
  1939. package/dist/types/core/agent/stages/toolResolver.d.ts +3 -2
  1940. package/dist/types/core/agent/stages/toolResolver.d.ts.map +1 -1
  1941. package/dist/types/core/agent/toolChoice/pick.d.ts +1 -1
  1942. package/dist/types/core/agent/toolResultCap.d.ts +1 -1
  1943. package/dist/types/core/agent/types.d.ts +16 -27
  1944. package/dist/types/core/agent/types.d.ts.map +1 -1
  1945. package/dist/types/core/agent/window/toolNames.d.ts +3 -3
  1946. package/dist/types/core/answerConsumption.d.ts +8 -0
  1947. package/dist/types/core/answerConsumption.d.ts.map +1 -0
  1948. package/dist/types/core/checkin.d.ts +1 -1
  1949. package/dist/types/core/codeRunnerTool.d.ts +1 -1
  1950. package/dist/types/core/consentLedger.d.ts +22 -0
  1951. package/dist/types/core/consentLedger.d.ts.map +1 -0
  1952. package/dist/types/core/consentRequest.d.ts +35 -54
  1953. package/dist/types/core/consentRequest.d.ts.map +1 -1
  1954. package/dist/types/core/conversation.d.ts +8 -29
  1955. package/dist/types/core/conversation.d.ts.map +1 -1
  1956. package/dist/types/core/memberRun.d.ts +1 -0
  1957. package/dist/types/core/memberRun.d.ts.map +1 -1
  1958. package/dist/types/core/pause.d.ts +5 -5
  1959. package/dist/types/core/pauseRecord.d.ts +14 -0
  1960. package/dist/types/core/pauseRecord.d.ts.map +1 -0
  1961. package/dist/types/core/runEntry.d.ts +9 -0
  1962. package/dist/types/core/runEntry.d.ts.map +1 -0
  1963. package/dist/types/core/runnerCoreValues.d.ts +17 -0
  1964. package/dist/types/core/runnerCoreValues.d.ts.map +1 -0
  1965. package/dist/types/core/runnerExecution.d.ts +72 -0
  1966. package/dist/types/core/runnerExecution.d.ts.map +1 -0
  1967. package/dist/types/core/runnerLive.d.ts +32 -1
  1968. package/dist/types/core/runnerLive.d.ts.map +1 -1
  1969. package/dist/types/core/slots/buildThinkingSubflow.d.ts +1 -1
  1970. package/dist/types/core/slots/buildToolsSlot.d.ts +27 -56
  1971. package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
  1972. package/dist/types/core/slots/discoverTools.d.ts +22 -0
  1973. package/dist/types/core/slots/discoverTools.d.ts.map +1 -0
  1974. package/dist/types/core-flow/Conditional.d.ts +0 -2
  1975. package/dist/types/core-flow/Conditional.d.ts.map +1 -1
  1976. package/dist/types/core-flow/Graph.d.ts +18 -23
  1977. package/dist/types/core-flow/Graph.d.ts.map +1 -1
  1978. package/dist/types/core-flow/Loop.d.ts +0 -2
  1979. package/dist/types/core-flow/Loop.d.ts.map +1 -1
  1980. package/dist/types/core-flow/Parallel.d.ts +11 -40
  1981. package/dist/types/core-flow/Parallel.d.ts.map +1 -1
  1982. package/dist/types/core-flow/Sequence.d.ts +0 -2
  1983. package/dist/types/core-flow/Sequence.d.ts.map +1 -1
  1984. package/dist/types/core-flow/Workflow.d.ts +0 -2
  1985. package/dist/types/core-flow/Workflow.d.ts.map +1 -1
  1986. package/dist/types/events/dispatcher.d.ts +2 -2
  1987. package/dist/types/events/payloads/access.d.ts +89 -0
  1988. package/dist/types/events/payloads/access.d.ts.map +1 -0
  1989. package/dist/types/events/payloads/agent.d.ts +242 -0
  1990. package/dist/types/events/payloads/agent.d.ts.map +1 -0
  1991. package/dist/types/events/payloads/answer.d.ts +96 -0
  1992. package/dist/types/events/payloads/answer.d.ts.map +1 -0
  1993. package/dist/types/events/payloads/artifacts.d.ts +140 -0
  1994. package/dist/types/events/payloads/artifacts.d.ts.map +1 -0
  1995. package/dist/types/events/payloads/consent.d.ts +87 -0
  1996. package/dist/types/events/payloads/consent.d.ts.map +1 -0
  1997. package/dist/types/events/payloads/context.d.ts +277 -0
  1998. package/dist/types/events/payloads/context.d.ts.map +1 -0
  1999. package/dist/types/events/payloads/cost.d.ts +41 -0
  2000. package/dist/types/events/payloads/cost.d.ts.map +1 -0
  2001. package/dist/types/events/payloads/dependencyTypes.d.ts +19 -0
  2002. package/dist/types/events/payloads/dependencyTypes.d.ts.map +1 -0
  2003. package/dist/types/events/payloads/evaluation.d.ts +298 -0
  2004. package/dist/types/events/payloads/evaluation.d.ts.map +1 -0
  2005. package/dist/types/events/payloads/fallback.d.ts +7 -0
  2006. package/dist/types/events/payloads/fallback.d.ts.map +1 -0
  2007. package/dist/types/events/payloads/findings.d.ts +244 -0
  2008. package/dist/types/events/payloads/findings.d.ts.map +1 -0
  2009. package/dist/types/events/payloads/flow.d.ts +69 -0
  2010. package/dist/types/events/payloads/flow.d.ts.map +1 -0
  2011. package/dist/types/events/payloads/integrity.d.ts +49 -0
  2012. package/dist/types/events/payloads/integrity.d.ts.map +1 -0
  2013. package/dist/types/events/payloads/maps.d.ts +48 -0
  2014. package/dist/types/events/payloads/maps.d.ts.map +1 -0
  2015. package/dist/types/events/payloads/mcpRequests.d.ts +328 -0
  2016. package/dist/types/events/payloads/mcpRequests.d.ts.map +1 -0
  2017. package/dist/types/events/payloads/memory.d.ts +118 -0
  2018. package/dist/types/events/payloads/memory.d.ts.map +1 -0
  2019. package/dist/types/events/payloads/reliability.d.ts +150 -0
  2020. package/dist/types/events/payloads/reliability.d.ts.map +1 -0
  2021. package/dist/types/events/payloads/runConfiguration.d.ts +225 -0
  2022. package/dist/types/events/payloads/runConfiguration.d.ts.map +1 -0
  2023. package/dist/types/events/payloads/skills.d.ts +360 -0
  2024. package/dist/types/events/payloads/skills.d.ts.map +1 -0
  2025. package/dist/types/events/payloads/stream.d.ts +231 -0
  2026. package/dist/types/events/payloads/stream.d.ts.map +1 -0
  2027. package/dist/types/events/payloads/thinking.d.ts +119 -0
  2028. package/dist/types/events/payloads/thinking.d.ts.map +1 -0
  2029. package/dist/types/events/payloads/toolCatalog.d.ts +158 -0
  2030. package/dist/types/events/payloads/toolCatalog.d.ts.map +1 -0
  2031. package/dist/types/events/payloads/toolChoice.d.ts +66 -0
  2032. package/dist/types/events/payloads/toolChoice.d.ts.map +1 -0
  2033. package/dist/types/events/payloads/toolEffects.d.ts +330 -0
  2034. package/dist/types/events/payloads/toolEffects.d.ts.map +1 -0
  2035. package/dist/types/events/payloads/toolSemantics.d.ts +69 -0
  2036. package/dist/types/events/payloads/toolSemantics.d.ts.map +1 -0
  2037. package/dist/types/events/payloads/toolSessionPayloads.d.ts +51 -0
  2038. package/dist/types/events/payloads/toolSessionPayloads.d.ts.map +1 -0
  2039. package/dist/types/events/payloads/validation.d.ts +30 -0
  2040. package/dist/types/events/payloads/validation.d.ts.map +1 -0
  2041. package/dist/types/events/payloads.d.ts +26 -3888
  2042. package/dist/types/events/payloads.d.ts.map +1 -1
  2043. package/dist/types/events/registry.d.ts +8 -15
  2044. package/dist/types/events/registry.d.ts.map +1 -1
  2045. package/dist/types/hosting/answeredPause.d.ts +9 -23
  2046. package/dist/types/hosting/answeredPause.d.ts.map +1 -1
  2047. package/dist/types/hosting/durability.d.ts +10 -7
  2048. package/dist/types/hosting/durability.d.ts.map +1 -1
  2049. package/dist/types/hosting/standingAgent.d.ts +4 -14
  2050. package/dist/types/hosting/standingAgent.d.ts.map +1 -1
  2051. package/dist/types/hosting/stream.d.ts +3 -3
  2052. package/dist/types/hosting/stream.d.ts.map +1 -1
  2053. package/dist/types/hosting/streamHandler.d.ts.map +1 -1
  2054. package/dist/types/index.d.ts +2 -1
  2055. package/dist/types/index.d.ts.map +1 -1
  2056. package/dist/types/injection-engine/devWarn.d.ts +3 -2
  2057. package/dist/types/injection-engine/devWarn.d.ts.map +1 -1
  2058. package/dist/types/injection-engine/hostContract.d.ts +3 -3
  2059. package/dist/types/injection-engine/skillExamples.d.ts +1 -1
  2060. package/dist/types/injection-engine/skillGraph/cursorEvidence.d.ts +49 -0
  2061. package/dist/types/injection-engine/skillGraph/cursorEvidence.d.ts.map +1 -0
  2062. package/dist/types/injection-engine/skillGraph/cursorResolution.d.ts +5 -0
  2063. package/dist/types/injection-engine/skillGraph/cursorResolution.d.ts.map +1 -0
  2064. package/dist/types/injection-engine/skillGraph/decision.d.ts +22 -0
  2065. package/dist/types/injection-engine/skillGraph/decision.d.ts.map +1 -0
  2066. package/dist/types/injection-engine/skillGraph/entryScores.d.ts +15 -0
  2067. package/dist/types/injection-engine/skillGraph/entryScores.d.ts.map +1 -0
  2068. package/dist/types/injection-engine/skillGraph/entrySuppression.d.ts +24 -0
  2069. package/dist/types/injection-engine/skillGraph/entrySuppression.d.ts.map +1 -0
  2070. package/dist/types/injection-engine/skillGraph/graphConfig.d.ts +40 -0
  2071. package/dist/types/injection-engine/skillGraph/graphConfig.d.ts.map +1 -0
  2072. package/dist/types/injection-engine/skillGraph/graphContracts.d.ts +480 -0
  2073. package/dist/types/injection-engine/skillGraph/graphContracts.d.ts.map +1 -0
  2074. package/dist/types/injection-engine/skillGraph/graphCursor.d.ts +126 -0
  2075. package/dist/types/injection-engine/skillGraph/graphCursor.d.ts.map +1 -0
  2076. package/dist/types/injection-engine/skillGraph/graphDrawing.d.ts +3 -0
  2077. package/dist/types/injection-engine/skillGraph/graphDrawing.d.ts.map +1 -0
  2078. package/dist/types/injection-engine/skillGraph/graphRoutes.d.ts +270 -0
  2079. package/dist/types/injection-engine/skillGraph/graphRoutes.d.ts.map +1 -0
  2080. package/dist/types/injection-engine/skillGraph/passMemo.d.ts +25 -0
  2081. package/dist/types/injection-engine/skillGraph/passMemo.d.ts.map +1 -0
  2082. package/dist/types/injection-engine/skillGraph/reachability.d.ts +72 -0
  2083. package/dist/types/injection-engine/skillGraph/reachability.d.ts.map +1 -0
  2084. package/dist/types/injection-engine/skillGraph/routePredicates.d.ts +37 -0
  2085. package/dist/types/injection-engine/skillGraph/routePredicates.d.ts.map +1 -0
  2086. package/dist/types/injection-engine/skillGraph/routingView.d.ts +4 -0
  2087. package/dist/types/injection-engine/skillGraph/routingView.d.ts.map +1 -0
  2088. package/dist/types/injection-engine/skillGraph/treeCompilation.d.ts +39 -0
  2089. package/dist/types/injection-engine/skillGraph/treeCompilation.d.ts.map +1 -0
  2090. package/dist/types/injection-engine/skillGraph/triggerCompilation.d.ts +17 -0
  2091. package/dist/types/injection-engine/skillGraph/triggerCompilation.d.ts.map +1 -0
  2092. package/dist/types/injection-engine/skillGraph.d.ts +12 -948
  2093. package/dist/types/injection-engine/skillGraph.d.ts.map +1 -1
  2094. package/dist/types/injection-engine/skillIntent.d.ts +1 -1
  2095. package/dist/types/injection-engine/skillIntent.d.ts.map +1 -1
  2096. package/dist/types/injection-engine/skillMatch.d.ts +2 -1
  2097. package/dist/types/injection-engine/skillMatch.d.ts.map +1 -1
  2098. package/dist/types/injection-engine/startRuleClaim.d.ts +1 -1
  2099. package/dist/types/injection-engine/types.d.ts +1 -1
  2100. package/dist/types/lib/cosine.d.ts.map +1 -0
  2101. package/dist/types/lib/iterationBudget.d.ts +3 -0
  2102. package/dist/types/lib/iterationBudget.d.ts.map +1 -1
  2103. package/dist/types/lib/saidByPerson.d.ts +1 -0
  2104. package/dist/types/lib/saidByPerson.d.ts.map +1 -1
  2105. package/dist/types/lib/toolBytes.d.ts +1 -1
  2106. package/dist/types/memory/causal/evidenceRecorder.d.ts +8 -56
  2107. package/dist/types/memory/causal/evidenceRecorder.d.ts.map +1 -1
  2108. package/dist/types/memory/causal/loadSnapshot.d.ts.map +1 -1
  2109. package/dist/types/memory/causal/observation.d.ts +73 -0
  2110. package/dist/types/memory/causal/observation.d.ts.map +1 -0
  2111. package/dist/types/memory/causal/snapshotProjection.d.ts +6 -0
  2112. package/dist/types/memory/causal/snapshotProjection.d.ts.map +1 -0
  2113. package/dist/types/memory/causal/snapshotSchema.d.ts +9 -0
  2114. package/dist/types/memory/causal/snapshotSchema.d.ts.map +1 -0
  2115. package/dist/types/memory/causal/types.d.ts +5 -82
  2116. package/dist/types/memory/causal/types.d.ts.map +1 -1
  2117. package/dist/types/memory/causal/writeSnapshot.d.ts.map +1 -1
  2118. package/dist/types/memory/embedding/index.d.ts +1 -1
  2119. package/dist/types/memory/embedding/index.d.ts.map +1 -1
  2120. package/dist/types/memory/stages/types.d.ts +1 -1
  2121. package/dist/types/memory/wire/mountMemoryPipeline.d.ts +7 -7
  2122. package/dist/types/memory/wire/mountMemoryPipeline.d.ts.map +1 -1
  2123. package/dist/types/patterns/LlmRouter.d.ts +11 -149
  2124. package/dist/types/patterns/LlmRouter.d.ts.map +1 -1
  2125. package/dist/types/patterns/LlmSwarm.d.ts +5 -49
  2126. package/dist/types/patterns/LlmSwarm.d.ts.map +1 -1
  2127. package/dist/types/patterns/MapReduce.d.ts.map +1 -1
  2128. package/dist/types/patterns/Swarm.d.ts +14 -45
  2129. package/dist/types/patterns/Swarm.d.ts.map +1 -1
  2130. package/dist/types/patterns/index.d.ts +1 -1
  2131. package/dist/types/patterns/index.d.ts.map +1 -1
  2132. package/dist/types/patterns/routing.d.ts +16 -0
  2133. package/dist/types/patterns/routing.d.ts.map +1 -0
  2134. package/dist/types/provider-contract/types.d.ts +5 -5
  2135. package/dist/types/recorders/core/CompactionMeter.d.ts +1 -1
  2136. package/dist/types/recorders/observability/BoundaryRecorder.d.ts +13 -427
  2137. package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
  2138. package/dist/types/recorders/observability/boundaryRecorder/agentInternal.d.ts +14 -0
  2139. package/dist/types/recorders/observability/boundaryRecorder/agentInternal.d.ts.map +1 -0
  2140. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts +211 -0
  2141. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts.map +1 -0
  2142. package/dist/types/recorders/observability/boundaryRecorder/eventBuilders.d.ts +12 -0
  2143. package/dist/types/recorders/observability/boundaryRecorder/eventBuilders.d.ts.map +1 -0
  2144. package/dist/types/recorders/observability/boundaryRecorder/flowEvents.d.ts +13 -0
  2145. package/dist/types/recorders/observability/boundaryRecorder/flowEvents.d.ts.map +1 -0
  2146. package/dist/types/recorders/observability/boundaryRecorder/leanContent.d.ts +53 -0
  2147. package/dist/types/recorders/observability/boundaryRecorder/leanContent.d.ts.map +1 -0
  2148. package/dist/types/recorders/observability/boundaryRecorder/options.d.ts +96 -0
  2149. package/dist/types/recorders/observability/boundaryRecorder/options.d.ts.map +1 -0
  2150. package/dist/types/recorders/observability/boundaryRecorder/rangeLabels.d.ts +34 -0
  2151. package/dist/types/recorders/observability/boundaryRecorder/rangeLabels.d.ts.map +1 -0
  2152. package/dist/types/recorders/observability/boundaryRecorder/rollups.d.ts +54 -0
  2153. package/dist/types/recorders/observability/boundaryRecorder/rollups.d.ts.map +1 -0
  2154. package/dist/types/recorders/observability/fileRecordingSink.d.ts +2 -4
  2155. package/dist/types/recorders/observability/fileRecordingSink.d.ts.map +1 -1
  2156. package/dist/types/recorders/observability/recordingEnvelope.d.ts +6 -10
  2157. package/dist/types/recorders/observability/recordingEnvelope.d.ts.map +1 -1
  2158. package/dist/types/redaction/coverage.d.ts +5 -3
  2159. package/dist/types/redaction/coverage.d.ts.map +1 -1
  2160. package/dist/types/redaction/declared.d.ts +4 -0
  2161. package/dist/types/redaction/declared.d.ts.map +1 -1
  2162. package/dist/types/redaction/knownStrings.d.ts +5 -34
  2163. package/dist/types/redaction/knownStrings.d.ts.map +1 -1
  2164. package/dist/types/redaction/marker.d.ts +1 -1
  2165. package/dist/types/redaction/privateCaller.d.ts +44 -0
  2166. package/dist/types/redaction/privateCaller.d.ts.map +1 -0
  2167. package/dist/types/redaction/privateCheckpoint.d.ts +23 -0
  2168. package/dist/types/redaction/privateCheckpoint.d.ts.map +1 -0
  2169. package/dist/types/redaction/privateFields.d.ts +29 -0
  2170. package/dist/types/redaction/privateFields.d.ts.map +1 -0
  2171. package/dist/types/redaction/privateRun.d.ts +33 -0
  2172. package/dist/types/redaction/privateRun.d.ts.map +1 -0
  2173. package/dist/types/redaction/runRedaction.d.ts +47 -41
  2174. package/dist/types/redaction/runRedaction.d.ts.map +1 -1
  2175. package/dist/types/redaction/served.d.ts +10 -4
  2176. package/dist/types/redaction/served.d.ts.map +1 -1
  2177. package/dist/types/resilience/withCircuitBreaker.d.ts +1 -1
  2178. package/dist/types/semantics/coverage/composedCoverage.d.ts +1 -1
  2179. package/dist/types/semantics/coverage/items.d.ts +1 -1
  2180. package/dist/types/semantics/coverage/read.d.ts +3 -3
  2181. package/dist/types/semantics/types.d.ts +1 -1
  2182. package/dist/types/time/drift.d.ts +1 -1
  2183. package/dist/types/time-travel/servedView/assembly.d.ts +5 -0
  2184. package/dist/types/time-travel/servedView/assembly.d.ts.map +1 -0
  2185. package/dist/types/time-travel/servedView/conversation.d.ts +9 -0
  2186. package/dist/types/time-travel/servedView/conversation.d.ts.map +1 -0
  2187. package/dist/types/time-travel/servedView/findings.d.ts +12 -0
  2188. package/dist/types/time-travel/servedView/findings.d.ts.map +1 -0
  2189. package/dist/types/time-travel/servedView/gaps.d.ts +77 -0
  2190. package/dist/types/time-travel/servedView/gaps.d.ts.map +1 -0
  2191. package/dist/types/time-travel/servedView/ontology.d.ts +5 -0
  2192. package/dist/types/time-travel/servedView/ontology.d.ts.map +1 -0
  2193. package/dist/types/time-travel/servedView/recordReads.d.ts +45 -0
  2194. package/dist/types/time-travel/servedView/recordReads.d.ts.map +1 -0
  2195. package/dist/types/time-travel/servedView/requestOnly.d.ts +7 -0
  2196. package/dist/types/time-travel/servedView/requestOnly.d.ts.map +1 -0
  2197. package/dist/types/time-travel/servedView/system.d.ts +16 -0
  2198. package/dist/types/time-travel/servedView/system.d.ts.map +1 -0
  2199. package/dist/types/time-travel/servedView/tools.d.ts +10 -0
  2200. package/dist/types/time-travel/servedView/tools.d.ts.map +1 -0
  2201. package/dist/types/time-travel/servedView/value.d.ts +39 -0
  2202. package/dist/types/time-travel/servedView/value.d.ts.map +1 -0
  2203. package/dist/types/time-travel/servedView.d.ts +5 -65
  2204. package/dist/types/time-travel/servedView.d.ts.map +1 -1
  2205. package/dist/types/tools/displayName.d.ts +7 -0
  2206. package/dist/types/tools/displayName.d.ts.map +1 -0
  2207. package/dist/types/tools/finiteLabel.d.ts +17 -0
  2208. package/dist/types/tools/finiteLabel.d.ts.map +1 -0
  2209. package/dist/types/tools/inputRequest.d.ts +1 -1
  2210. package/dist/types/tools/toolParty.d.ts +18 -0
  2211. package/dist/types/tools/toolParty.d.ts.map +1 -0
  2212. package/dist/types/tools/toolProvider.d.ts +1 -0
  2213. package/dist/types/tools/toolProvider.d.ts.map +1 -1
  2214. package/dist/types/tools/toolResourceOwner.d.ts +28 -0
  2215. package/dist/types/tools/toolResourceOwner.d.ts.map +1 -0
  2216. package/dist/types/tools/toolSessions/contracts.d.ts +131 -0
  2217. package/dist/types/tools/toolSessions/contracts.d.ts.map +1 -0
  2218. package/dist/types/tools/toolSessions/keys.d.ts +54 -0
  2219. package/dist/types/tools/toolSessions/keys.d.ts.map +1 -0
  2220. package/dist/types/tools/toolSessions/localStatus.d.ts +8 -0
  2221. package/dist/types/tools/toolSessions/localStatus.d.ts.map +1 -0
  2222. package/dist/types/tools/toolSessions.d.ts +30 -178
  2223. package/dist/types/tools/toolSessions.d.ts.map +1 -1
  2224. package/dist/types/tools/tools.d.ts +6 -8
  2225. package/dist/types/tools/tools.d.ts.map +1 -1
  2226. package/dist/types/trace-toolpack/traceToolpack/artifactFacts.d.ts +16 -0
  2227. package/dist/types/trace-toolpack/traceToolpack/artifactFacts.d.ts.map +1 -0
  2228. package/dist/types/trace-toolpack/traceToolpack/backtrackView.d.ts +18 -0
  2229. package/dist/types/trace-toolpack/traceToolpack/backtrackView.d.ts.map +1 -0
  2230. package/dist/types/trace-toolpack/traceToolpack/contextErrors.d.ts +44 -0
  2231. package/dist/types/trace-toolpack/traceToolpack/contextErrors.d.ts.map +1 -0
  2232. package/dist/types/trace-toolpack/traceToolpack/findInTrace.d.ts +27 -0
  2233. package/dist/types/trace-toolpack/traceToolpack/findInTrace.d.ts.map +1 -0
  2234. package/dist/types/trace-toolpack/traceToolpack/findingEvidence.d.ts +74 -0
  2235. package/dist/types/trace-toolpack/traceToolpack/findingEvidence.d.ts.map +1 -0
  2236. package/dist/types/trace-toolpack/traceToolpack/innerRecords.d.ts +12 -0
  2237. package/dist/types/trace-toolpack/traceToolpack/innerRecords.d.ts.map +1 -0
  2238. package/dist/types/trace-toolpack/traceToolpack/narrativeView.d.ts +4 -0
  2239. package/dist/types/trace-toolpack/traceToolpack/narrativeView.d.ts.map +1 -0
  2240. package/dist/types/trace-toolpack/traceToolpack/navigationHints.d.ts +7 -0
  2241. package/dist/types/trace-toolpack/traceToolpack/navigationHints.d.ts.map +1 -0
  2242. package/dist/types/trace-toolpack/traceToolpack/nodeView.d.ts +6 -0
  2243. package/dist/types/trace-toolpack/traceToolpack/nodeView.d.ts.map +1 -0
  2244. package/dist/types/trace-toolpack/traceToolpack/packIndex.d.ts +70 -0
  2245. package/dist/types/trace-toolpack/traceToolpack/packIndex.d.ts.map +1 -0
  2246. package/dist/types/trace-toolpack/traceToolpack/parameterSchemas.d.ts +11 -0
  2247. package/dist/types/trace-toolpack/traceToolpack/parameterSchemas.d.ts.map +1 -0
  2248. package/dist/types/trace-toolpack/traceToolpack/recursiveFactory.d.ts +41 -0
  2249. package/dist/types/trace-toolpack/traceToolpack/recursiveFactory.d.ts.map +1 -0
  2250. package/dist/types/trace-toolpack/traceToolpack/runOverview.d.ts +6 -0
  2251. package/dist/types/trace-toolpack/traceToolpack/runOverview.d.ts.map +1 -0
  2252. package/dist/types/trace-toolpack/traceToolpack/sliceView.d.ts +6 -0
  2253. package/dist/types/trace-toolpack/traceToolpack/sliceView.d.ts.map +1 -0
  2254. package/dist/types/trace-toolpack/traceToolpack/structuralLimits.d.ts +42 -0
  2255. package/dist/types/trace-toolpack/traceToolpack/structuralLimits.d.ts.map +1 -0
  2256. package/dist/types/trace-toolpack/traceToolpack/toolCallJournal.d.ts +106 -0
  2257. package/dist/types/trace-toolpack/traceToolpack/toolCallJournal.d.ts.map +1 -0
  2258. package/dist/types/trace-toolpack/traceToolpack/valueLines.d.ts +30 -0
  2259. package/dist/types/trace-toolpack/traceToolpack/valueLines.d.ts.map +1 -0
  2260. package/dist/types/trace-toolpack/traceToolpack/valueQueries.d.ts +7 -0
  2261. package/dist/types/trace-toolpack/traceToolpack/valueQueries.d.ts.map +1 -0
  2262. package/dist/types/trace-toolpack/traceToolpack/writerHints.d.ts +14 -0
  2263. package/dist/types/trace-toolpack/traceToolpack/writerHints.d.ts.map +1 -0
  2264. package/dist/types/trace-toolpack/traceToolpack.d.ts +15 -40
  2265. package/dist/types/trace-toolpack/traceToolpack.d.ts.map +1 -1
  2266. package/package.json +7 -6
  2267. package/dist/core/agent/stages/toolCalls.js +0 -6194
  2268. package/dist/core/agent/stages/toolCalls.js.map +0 -1
  2269. package/dist/esm/core/agent/stages/toolCalls.d.ts +0 -895
  2270. package/dist/esm/core/agent/stages/toolCalls.js +0 -6159
  2271. package/dist/esm/core/agent/stages/toolCalls.js.map +0 -1
  2272. package/dist/esm/memory/embedding/cosine.js.map +0 -1
  2273. package/dist/memory/embedding/cosine.js.map +0 -1
  2274. package/dist/types/core/agent/stages/toolCalls.d.ts +0 -896
  2275. package/dist/types/core/agent/stages/toolCalls.d.ts.map +0 -1
  2276. package/dist/types/memory/embedding/cosine.d.ts.map +0 -1
  2277. /package/dist/esm/{memory/embedding → lib}/cosine.d.ts +0 -0
  2278. /package/dist/esm/{memory/embedding → lib}/cosine.js +0 -0
  2279. /package/dist/{memory/embedding → lib}/cosine.js +0 -0
  2280. /package/dist/types/{memory/embedding → lib}/cosine.d.ts +0 -0
@@ -24,23 +24,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Agent = exports.AgentBuilder = void 0;
27
+ const resumeAnswer_js_1 = require("./agent/resumeAnswer.js");
28
+ const hostTurn_js_1 = require("./agent/hostTurn.js");
29
+ const componentResources_js_1 = require("./agent/componentResources.js");
30
+ const resumeCheckpoint_js_1 = require("./agent/resumeCheckpoint.js");
31
+ const pauseOwnership_js_1 = require("./agent/pauseOwnership.js");
32
+ const runnerLive_js_1 = require("./runnerLive.js");
33
+ const componentObservers_js_1 = require("./agent/componentObservers.js");
34
+ const runRedaction_js_1 = require("../redaction/runRedaction.js");
35
+ const runValues_js_1 = require("./agent/runValues.js");
36
+ const runnerExecution_js_1 = require("./runnerExecution.js");
27
37
  const context_js_1 = require("./agent/findings/context.js");
28
- /**
29
- * Agent — ReAct primitive (LLM + tools + iteration loop).
30
- *
31
- * Pattern: Builder (GoF) → produces a Runner backed by a footprintjs FlowChart.
32
- * Role: Layer-5 primitive (core/). Assembles the 3-slot context
33
- * pipeline + callLLM + route decider + tool-calls subflow +
34
- * loopTo. Composition nestable anywhere that accepts a Runner.
35
- * Emits: Via internal recorders:
36
- * agentfootprint.agent.turn_start / turn_end
37
- * agentfootprint.agent.iteration_start / iteration_end
38
- * agentfootprint.agent.route_decided
39
- * agentfootprint.stream.llm_start / llm_end
40
- * agentfootprint.stream.tool_start / tool_end
41
- * agentfootprint.context.* (via ContextRecorder)
42
- */
43
- const footprintjs_1 = require("footprintjs");
44
38
  const types_js_1 = require("../reliability/types.js");
45
39
  const extractSequence_js_1 = require("../security/extractSequence.js");
46
40
  const PolicyHaltError_js_1 = require("../security/PolicyHaltError.js");
@@ -80,15 +74,12 @@ const ToolsRecorder_js_1 = require("../recorders/core/ToolsRecorder.js");
80
74
  const ReliabilityRecorder_js_1 = require("../recorders/core/ReliabilityRecorder.js");
81
75
  const ResilienceRecorder_js_1 = require("../recorders/core/ResilienceRecorder.js");
82
76
  const CheckInRecorder_js_1 = require("../recorders/core/CheckInRecorder.js");
83
- const CompactionMeter_js_1 = require("../recorders/core/CompactionMeter.js");
84
77
  const policy_js_1 = require("../redaction/policy.js");
85
- const runRedaction_js_1 = require("../redaction/runRedaction.js");
86
78
  const coverage_js_1 = require("../redaction/coverage.js");
87
79
  const conversation_js_1 = require("./conversation.js");
80
+ const privateCheckpoint_js_1 = require("../redaction/privateCheckpoint.js");
88
81
  const declared_js_1 = require("../redaction/declared.js");
89
82
  const conversation_js_2 = require("../redaction/conversation.js");
90
- const evictedTurns_js_1 = require("./agent/window/evictedTurns.js");
91
- const receiptDigests_js_1 = require("./agent/receipt/receiptDigests.js");
92
83
  const recordingPack_js_1 = require("../recorders/observability/recordingPack.js");
93
84
  const durabilityBarrier_js_1 = require("./durabilityBarrier.js");
94
85
  const toolSessions_js_1 = require("../tools/toolSessions.js");
@@ -97,60 +88,20 @@ const callerIdentity_js_1 = require("./agent/callerIdentity.js");
97
88
  const servingConversation_js_1 = require("./agent/servingConversation.js");
98
89
  const runManifest_js_1 = require("./agent/runManifest.js");
99
90
  const lifecycle_js_1 = require("../integrity/disposition/lifecycle.js");
100
- /**
101
- * The pseudo-stage a tool-teardown event is stamped with.
102
- *
103
- * `session_closed` and `session_close_failed` fire after the run's last stage
104
- * has committed — there is no runtimeStageId to inherit, and inventing one that
105
- * looked like a real stage would put a fictitious node in every consumer's step
106
- * strip. This says plainly where it came from, the way `'<stageId>#paused'`
107
- * does at the pause boundary. Their two siblings, `session_started` and
108
- * `session_reused`, happen inside a real stage and carry its real id.
109
- */
110
- const TOOL_TEARDOWN_STAGE_ID = 'tool-teardown#0';
111
- /**
112
- * The pseudo-stage a LATE artifact fact is stamped with — one that lands after
113
- * the run its binding was made in had ended (a tool's floating upload). Its
114
- * stage is long gone; like the teardown events it says plainly where it came
115
- * from, and carries the run it belongs to rather than the one that is live.
116
- */
117
- const LATE_ARTIFACT_FACT_STAGE_ID = 'artifact-late#0';
118
- /**
119
- * The pseudo-stage the run-configuration manifest is stamped with (9.41.0).
120
- *
121
- * Same reasoning as the teardown id above, at the other end of the run: the
122
- * manifest is dispatched before the chart starts, so there is no stage to
123
- * inherit and inventing a plausible one would put a node in every step strip
124
- * that no traversal ever visited. This says plainly where it came from.
125
- */
126
- const RUN_MANIFEST_STAGE_ID = 'run-configured#0';
127
- /**
128
- * Pseudo-stage for `agentfootprint.integrity.disposition` (9.60.0) — the
129
- * ledger is filed at the run boundary, after the last stage committed, so it
130
- * states where it came from exactly as the teardown id above does.
131
- */
132
- const INTEGRITY_DISPOSITION_STAGE_ID = 'integrity-disposition#0';
133
- /**
134
- * Pseudo-stage for `agentfootprint.skill.graph_declared` (9.50.0) — same
135
- * reasoning as the manifest id directly above: dispatched before the chart
136
- * starts, so it states where it came from instead of inheriting a stage no
137
- * traversal visited.
138
- */
139
- const GRAPH_DECLARED_STAGE_ID = 'graph-declared#0';
140
91
  const EmitBridge_js_1 = require("../recorders/core/EmitBridge.js");
141
92
  const window_js_1 = require("./agent/stages/window.js");
142
93
  const options_js_1 = require("./agent/window/options.js");
143
94
  const deliver_js_1 = require("./agent/stages/deliver.js");
144
95
  const providerTargets_js_1 = require("./agent/providerTargets.js");
145
- const messagesSlotRefusal_js_1 = require("../injection-engine/messagesSlotRefusal.js");
96
+ const injectionDelivery_js_1 = require("./agent/run/injectionDelivery.js");
146
97
  const errors_js_1 = require("./agent/window/errors.js");
147
98
  const checkin_js_1 = require("./checkin.js");
148
99
  const cost_js_1 = require("./cost.js");
149
- const evidenceRecorder_js_1 = require("../memory/causal/evidenceRecorder.js");
150
100
  const buildSystemPromptSlot_js_1 = require("./slots/buildSystemPromptSlot.js");
151
101
  const buildMessagesSlot_js_1 = require("./slots/buildMessagesSlot.js");
152
102
  const buildToolsSlot_js_1 = require("./slots/buildToolsSlot.js");
153
- const footprintjs_2 = require("footprintjs");
103
+ const discoverTools_js_1 = require("./slots/discoverTools.js");
104
+ const footprintjs_1 = require("footprintjs");
154
105
  const skillTools_js_1 = require("../injection-engine/skillTools.js");
155
106
  const skillSteps_js_1 = require("../injection-engine/skillSteps.js");
156
107
  const stepNudge_js_1 = require("./agent/stages/stepNudge.js");
@@ -174,7 +125,7 @@ const conversation_js_3 = require("./conversation.js");
174
125
  const inputRequest_js_1 = require("../tools/inputRequest.js");
175
126
  const outputSchema_js_1 = require("../answer-validation/outputSchema.js");
176
127
  const runInput_js_1 = require("./runInput.js");
177
- const rows_js_1 = require("../time/rows.js");
128
+ require("../time/rows.js");
178
129
  const clock_js_1 = require("../time/clock.js");
179
130
  const outputRetry_js_1 = require("./agent/stages/outputRetry.js");
180
131
  const RunnerBase_js_1 = require("./RunnerBase.js");
@@ -189,7 +140,7 @@ const answerCoverage_js_1 = require("./agent/stages/answerCoverage.js");
189
140
  const index_js_1 = require("../answer-validation/index.js");
190
141
  const seed_js_1 = require("./agent/stages/seed.js");
191
142
  const callLLM_js_1 = require("./agent/stages/callLLM.js");
192
- const toolCalls_js_1 = require("./agent/stages/toolCalls.js");
143
+ const index_js_2 = require("./agent/stages/toolCalls/index.js");
193
144
  const toolResolver_js_1 = require("./agent/stages/toolResolver.js");
194
145
  const route_js_2 = require("./agent/stages/route.js");
195
146
  const declare_js_1 = require("../tools/declare.js");
@@ -207,39 +158,14 @@ const AgentBuilder_js_1 = require("./agent/AgentBuilder.js");
207
158
  Object.defineProperty(exports, "AgentBuilder", { enumerable: true, get: function () { return AgentBuilder_js_1.AgentBuilder; } });
208
159
  const buildThinkingSubflow_js_1 = require("./slots/buildThinkingSubflow.js");
209
160
  const dispatch_js_1 = require("../thinking/dispatch.js");
161
+ const eventStageIds_js_1 = require("./agent/run/eventStageIds.js");
162
+ const ledgerFacts_js_1 = require("./agent/run/ledgerFacts.js");
163
+ const withoutTime_js_1 = require("./agent/run/withoutTime.js");
164
+ const resumeRedaction_js_1 = require("./agent/run/resumeRedaction.js");
165
+ const clocks_js_1 = require("./agent/run/clocks.js");
210
166
  // Public types (AgentOptions, AgentInput, AgentOutput) extracted to
211
167
  // ./agent/types.ts and re-exported above (v2.11.1).
212
168
  // AgentState extracted to ./agent/types.ts (v2.11.1).
213
- /**
214
- * The ledger-fact hold's default ceiling (9.102.0): how many fact turns the
215
- * window holds beyond `keepRecentTurns` when `.findings()` and a window
216
- * strategy are both configured and nobody named a number. Resolved in the
217
- * constructor, ONCE, and threaded to `buildWindowStage` as a plain number —
218
- * the stage applies no default of its own (absent = unarmed = no hold), so a
219
- * reader has one place to look. `window/options.ts ·
220
- * DEFAULT_KEEP_LAST_TOOL_RESULTS` is the pin's twin of this constant.
221
- */
222
- const DEFAULT_KEEP_LEDGER_FACTS = 4;
223
- /**
224
- * Validate the `keepLedgerFacts` dial — `window/options.ts ·
225
- * requireKeepLastToolResults`'s twin: the same rule, the same moment.
226
- * Refused at construction, never mid-run.
227
- */
228
- function requireKeepLedgerFacts(value, label) {
229
- if (value === false)
230
- return;
231
- if (!Number.isInteger(value) || value < 0) {
232
- throw new Error(`${label}: keepLedgerFacts must be a whole number >= 0, or false, got ` +
233
- `${String(value)}. It is how many fact turns the window holds beyond ` +
234
- `keepRecentTurns under .findings(); 0 and false both switch the hold off.`);
235
- }
236
- }
237
- /** `false` → `0`; a number as named; nothing named → the default. */
238
- function resolveKeepLedgerFacts(named) {
239
- if (named === false)
240
- return 0;
241
- return named ?? DEFAULT_KEEP_LEDGER_FACTS;
242
- }
243
169
  class Agent extends RunnerBase_js_1.RunnerBase {
244
170
  name;
245
171
  id;
@@ -342,7 +268,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
342
268
  skillGraphCascade;
343
269
  /** Side channel for the conversation's inherited skill cursor (SG-C) —
344
270
  * stashed by `applyContinuation`, consumed-and-cleared by seed. */
345
- pendingResumeSkillCursor;
346
271
  pricingTable;
347
272
  /** Normalized at construction: a bare number is `{ usd, onExceed: 'warn' }`. */
348
273
  costBudget;
@@ -409,18 +334,15 @@ class Agent extends RunnerBase_js_1.RunnerBase {
409
334
  * cleared when `run()` ends, so a later turn this agent did not start (its
410
335
  * chart mounted in a composition) never stamps a clock nobody declared for
411
336
  * it (`seedClockDraft`). */
412
- runClockDraft;
413
337
  /** The incoming request each of this agent's OWN scopes serves — recorded
414
338
  * by the executor that made the scope (`createExecutor`), so a scope keeps
415
339
  * ITS run's request for as long as it lives: a stage still running after
416
340
  * its run was aborted can never be served the next run's request. A stage
417
341
  * mounted in another runner's executor reads its run's request by link
418
342
  * (`memberRun.ts`). Never written to scope. */
419
- scopeRequests = new WeakMap();
420
343
  /** The `time` the CURRENT resume passed, as read — TAKEN once by the first
421
344
  * ToolCalls pass of the resumed leg (`ToolCallsHandlerDeps.time`), and
422
345
  * cleared when `run()` or `resume()` ends. */
423
- resumePassedTime;
424
346
  /** Tool choice by classifier (9.105.0, `.toolChoice()`): the classifier,
425
347
  * the serve dial and the app's own doors. Threaded to the tools slot (the
426
348
  * pick and the narrowing), to call-llm (`toolChoice: true`, the outcome
@@ -464,13 +386,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
464
386
  /** The message chain (`.messageMiddleware()`), in declaration order. Empty
465
387
  * keeps seed synchronous and prepare-final untouched. */
466
388
  messageMiddleware;
467
- /** The instrument the window stage reads mid-run (adapter-reported usage +
468
- * per-message provenance). Only ever created alongside a strategy. */
469
- compactionMeterHandle;
470
- /** The window stage's seam to the receipt (9.93.0): what left the window at
471
- * this iteration's head, read by the call-llm mint in the same iteration.
472
- * Only ever created alongside a strategy, like the meter. */
473
- evictedTurnsHandle;
474
389
  /** Snapshot read-tracking policy (#18/#14) — forwarded to the internal
475
390
  * executor. Agent default is `'summary'` (cheap markers), NOT
476
391
  * footprintjs's `'full'`. See AgentOptions.readTracking. */
@@ -520,9 +435,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
520
435
  * plumbing, never scope state). `run()` resets it; the run boundary
521
436
  * files its report and clears it.
522
437
  */
523
- integrityLedgerHolder = {
524
- current: undefined,
525
- };
526
438
  /** Set at chart build: whether any tool in the FULL declared catalog
527
439
  * (static registry + skill-carried tools) declared `argumentsFrom`. */
528
440
  integrityDanglingPresent = false;
@@ -557,9 +469,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
557
469
  * every `run()` / `resume()` so one run can never raise on another's block,
558
470
  * and cleared per service the moment that credential is issued.
559
471
  */
560
- consentOutstanding = new Map();
561
- /** Evidence bridge (#5) — present iff a CAUSAL memory is mounted. */
562
- causalEvidence;
563
472
  /** Observer delivery tier (RFC-001 Block 10). `'inline'` (default) is
564
473
  * byte-identical to pre-10 releases; `'deferred'` routes the bridge
565
474
  * recorders + consumer attachments through footprintjs's bounded
@@ -578,11 +487,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
578
487
  appName;
579
488
  commentaryTemplates;
580
489
  thinkingTemplates;
581
- currentRunContext = {
582
- runStartMs: 0,
583
- runId: 'pending',
584
- compositionPath: [],
585
- };
586
490
  /**
587
491
  * The typed ask the CURRENT run's resume answered — set by
588
492
  * `resume()` when a person's answer completed an `awaitingInput`, cleared
@@ -591,8 +495,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
591
495
  * `ToolCallsHandlerDeps.answeredAsk`. The count crosses checkpoints on the
592
496
  * awaiting-input shape itself (`repeat.count`), not here.
593
497
  */
594
- answeredAsk;
595
- // `lastExecutor` is now inherited as a protected field from RunnerBase
596
498
  // (single canonical source for footprintjs snapshot access across all
597
499
  // runners). Agent's `getLastSnapshot()` delegates to the inherited
598
500
  // implementation but is kept here for the JSDoc + clearer return type.
@@ -636,28 +538,21 @@ class Agent extends RunnerBase_js_1.RunnerBase {
636
538
  * instead of starting fresh, and appends this turn's user entry when
637
539
  * `appendsUserTurn` says so. Cleared on first read so subsequent runs
638
540
  * start clean. */
639
- pendingResumeHistory;
640
541
  /** Retried request's repair state; never inherited by a new human turn. */
641
- pendingEvidenceRecovery;
642
542
  /** Its sibling for the folded spans. A restored conversation that dropped
643
543
  * them would carry summaries nobody could unpack — the evidence would be
644
544
  * destroyed by the act of continuing, which is the one thing retention
645
545
  * exists to prevent. Cleared on first read, exactly like the history. */
646
- pendingResumeFolded;
647
546
  /** Its sibling for the findings ledger (9.101.0) — the model's standings
648
547
  * on results this process never saw, carried by the checkpoint and
649
548
  * restored as a stored record. Cleared on first read, like the history. */
650
- pendingResumeFindingsLedger;
651
549
  /** The last completed run's final answer — see `checkpoint()` for why it is
652
550
  * kept here rather than read back from the recording. Undefined after a run
653
551
  * that failed or paused. */
654
- lastRunAnswer;
655
552
  /** Last run's checkpoint owner, including explicit replay edits from a failed child stage. */
656
- checkpointTracker;
657
553
  /** Whether any run on this instance got past input admission — so a
658
554
  * refused FIRST turn is reported as 'never-run', never as "continue from
659
555
  * your earlier accepted checkpoint" when there is none. */
660
- hadAdmittedRun = false;
661
556
  /** The id the CONSUMER chose, or undefined when they took the default.
662
557
  * `this.id` cannot answer that question — it is `'agent'` either way — and
663
558
  * the stored-conversation fingerprint refuses only on ids somebody picked
@@ -673,28 +568,22 @@ class Agent extends RunnerBase_js_1.RunnerBase {
673
568
  * paused run's own record (`agent/callerIdentity.ts · callerIdentityOf`).
674
569
  * A resume that inherited it instead stored another person's identity on
675
570
  * a shared agent and none on a rebuilt pooled one. */
676
- lastRunIdentity;
677
571
  /** Run ids this instance minted, most recent last (bounded) — evidence that a
678
572
  * checkpoint's `{ conversationId: '<runId>' }` is the per-run default
679
573
  * (`agent/callerIdentity.ts`). */
680
- mintedRunIds = new Set();
681
574
  /** The self-explain evidence key of the run in flight (or served last):
682
575
  * its session, else a host's per-request key, else undefined
683
576
  * (`agent/servingConversation.ts`). */
684
- servingConversation;
685
577
  /** How long ONE tool teardown may take before the runner stops waiting.
686
578
  * See `AgentOptions.toolTeardownTimeoutMs`. */
687
579
  toolTeardownTimeoutMs;
688
580
  /** The run in flight, by id — the whole of the one-turn-at-a-time guard.
689
581
  * Set before the executor is built and cleared in `finally`, so a run that
690
582
  * throws does not leave the agent permanently refusing. */
691
- inFlightRunId;
692
583
  /** The scopes this agent's OWN executors made — see the `isOwnRun` seed dep. */
693
- ownScopes = new WeakSet();
694
584
  /** The question a person still owes this agent an answer to. Set when a run
695
585
  * ends paused, cleared by `resume()`, `abandonPause()`, or a run that
696
586
  * completes. Read by the `run()` guard — see `PendingQuestionError`. */
697
- pendingQuestion;
698
587
  /** The `.selfExplain()` binding, when the builder mounted one. Held so
699
588
  * `canExplain()` can answer the same question the trace tools answer, from
700
589
  * the same fact. Undefined on every agent that never called `.selfExplain()`. */
@@ -767,9 +656,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
767
656
  /** `AgentOptions.recordReceipt` (9.88.0) — ON by default. `false` declines
768
657
  * the mint at `callLLM`; nothing else about the run changes. */
769
658
  recordReceiptValue = true;
770
- /** The receipt memo every call of a run mints through — one per agent,
771
- * rebinding itself to each run id (`core/agent/receipt/receiptDigests.ts`). */
772
- receiptDigests = (0, receiptDigests_js_1.createReceiptDigests)();
773
659
  answerValidationConfig;
774
660
  negativeClaimsConfig;
775
661
  typedNegativeClaimsConfig;
@@ -779,11 +665,15 @@ class Agent extends RunnerBase_js_1.RunnerBase {
779
665
  // Which conversation this instance's self-explain evidence belongs to —
780
666
  // held in a module registry, not on the class, so it is not public API
781
667
  // (`agent/servingConversation.ts`).
782
- (0, servingConversation_js_1.registerServingConversation)(this, () => ({
783
- conversation: this.servingConversation,
784
- runId: this.currentRunContext.runId,
785
- ...(this.servingConversation?.startsWith('hosted:') === true && { oneShot: true }),
786
- }));
668
+ (0, servingConversation_js_1.registerServingConversation)(this, () => {
669
+ const selected = this.runExecution().selected();
670
+ const conversation = selected?.value.servingConversation;
671
+ return {
672
+ conversation,
673
+ runId: selected?.context.runId ?? 'pending',
674
+ ...(conversation?.startsWith('hosted:') === true && { oneShot: true }),
675
+ };
676
+ });
787
677
  this.negativeClaimsConfig = negativeClaimsConfig;
788
678
  this.typedNegativeClaimsConfig =
789
679
  negativeClaimsConfig?.mode === 'typed' ? negativeClaimsConfig : undefined;
@@ -876,20 +766,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
876
766
  // Eager validation: memory ids must be unique so per-id scope keys
877
767
  // (`memoryInjection_${id}`) don't collide.
878
768
  (0, validators_js_1.validateMemoryIdUniqueness)(memories);
879
- // Evidence bridge (#5): a CAUSAL memory gets a run-scoped harvest recorder
880
- // (decisions/toolCalls/iterations/duration/tokens). Attached per run below;
881
- // its `collect` is threaded into the write mount via chartDeps.
882
- if (memories.some((m) => m.type === 'causal')) {
883
- const evidence = (0, evidenceRecorder_js_1.causalEvidenceRecorder)();
884
- this.causalEvidence = evidence;
885
- // A causal memory is working state: its store keeps what a later run
886
- // replays to the MODEL, so its tool calls are read on the real-value
887
- // path, never off the served events — a policy keeps a run's records
888
- // clean, never what the agent will compute on (`src/redaction/`). The
889
- // decisions it keeps come from footprintjs's flow channel, which serves
890
- // them under the policy (a named limit in `src/redaction/README.md`).
891
- this.dispatcher.onRealEvent((event) => evidence.onEmit({ name: event.type, payload: event.payload }));
892
- }
893
769
  // A dial without its switch — refused rather than run as a no-op (8.13.0).
894
770
  // Same policy as `observerDeliveryOptions` below; the message and the check
895
771
  // are shared with LLMCall, which takes the identical pair.
@@ -984,20 +860,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
984
860
  // (attached per run, cleared between runs like every other recorder)
985
861
  // because the window stage closes over it at chart-build time — and the
986
862
  // chart is built once.
987
- if (windowStrategy !== undefined) {
863
+ if (windowStrategy !== undefined)
988
864
  this.windowStrategy = windowStrategy;
989
- const meter = (0, CompactionMeter_js_1.compactionMeter)();
990
- this.compactionMeterHandle = meter;
991
- this.evictedTurnsHandle = (0, evictedTurns_js_1.createEvictedTurnsHandle)();
992
- // The provider's token count is a MEASUREMENT the window decides on, so
993
- // the meter reads it on the real-value path, never off the served event:
994
- // a redaction pattern that happens to match `input` must not switch
995
- // compaction off (`src/redaction/runRedaction.ts`).
996
- this.dispatcher.onRealEvent((event) => {
997
- if (event.type === 'agentfootprint.stream.llm_end')
998
- meter.noteLlmEnd(event.payload);
999
- });
1000
- }
1001
865
  // The two governance chains. Empty arrays (not undefined) so every read
1002
866
  // site is a plain `.length > 0` test rather than an optional dance.
1003
867
  this.toolMiddleware = toolMiddleware ?? [];
@@ -1067,14 +931,14 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1067
931
  // accepted and does nothing — the keepLastToolResults-without-a-window
1068
932
  // precedent.
1069
933
  if (opts.keepLedgerFacts !== undefined)
1070
- requireKeepLedgerFacts(opts.keepLedgerFacts, 'Agent');
934
+ (0, ledgerFacts_js_1.requireKeepLedgerFacts)(opts.keepLedgerFacts, 'Agent');
1071
935
  if (this.findingsOptions !== undefined) {
1072
936
  // Keep the supported findings execution modes explicit. This change
1073
937
  // restores prefix caching; it does not add findings support to classic.
1074
938
  if (this.reactMode === 'classic') {
1075
939
  throw new Error("Agent: .findings() is supported in 'dynamic' and 'dynamic-grouped' modes only; reactMode 'classic' is not supported.");
1076
940
  }
1077
- this.keepLedgerFacts = resolveKeepLedgerFacts(this.findingsOptions.keepLedgerFacts ?? opts.keepLedgerFacts);
941
+ this.keepLedgerFacts = (0, ledgerFacts_js_1.resolveKeepLedgerFacts)(this.findingsOptions.keepLedgerFacts ?? opts.keepLedgerFacts);
1078
942
  }
1079
943
  // Tool choice by classifier (9.105.0) needs the same per-call recomposition
1080
944
  // the ledger does — the pick is made where the served list is built, and
@@ -1226,20 +1090,60 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1226
1090
  this.appName = voice.appName;
1227
1091
  this.commentaryTemplates = voice.commentaryTemplates;
1228
1092
  this.thinkingTemplates = voice.thinkingTemplates;
1229
- // Eager chart construction — see `RunnerBase.initChart` JSDoc.
1230
- // Note re Agent specifics (footprintjs inventor's review):
1231
- // - `providerToolCache: { current: Tool[] }` is closed over by the
1232
- // chart's Discover + dispatch stages. It's shared across
1233
- // sequential runs of this Agent instance, but the Discover stage
1234
- // overwrites `current` at the start of every iteration (line 158
1235
- // of `buildToolsSlot.ts`), so stale data never reaches a tool
1236
- // call. Concurrent runs on the SAME Agent instance already share
1237
- // `currentRunContext` and the recorder dispatcher — eager build
1238
- // doesn't change that constraint.
1239
- // - `currentRunContext` is read by the per-stage `getRunCtx`
1240
- // lambda at execution time (not at chart-build time), so a fresh
1241
- // value per run still flows through correctly.
1242
- this.initChart(() => this.buildChart());
1093
+ // Build the chart once. Private executable tool catalogs and their domain
1094
+ // handlers are initialized in the actual native component, shared with
1095
+ // its internal charts and isolated from other mounts and admissions.
1096
+ this.initChart(() => this.buildChart(), {
1097
+ runnerId: this.id,
1098
+ compositionPath: [`Agent:${this.id}`],
1099
+ initialize: () => {
1100
+ const values = (0, runValues_js_1.createAgentRunValues)({ window: this.windowStrategy !== undefined });
1101
+ this.beginIntegrityLedger(values);
1102
+ return values;
1103
+ },
1104
+ options: {
1105
+ readTracking: this.readTracking,
1106
+ commitValues: this.commitValues,
1107
+ writeProvenance: this.writeProvenance,
1108
+ },
1109
+ componentSetup: (component, value, entry) => {
1110
+ value.resources = (0, componentResources_js_1.componentResources)(component, () => this.toolSessions());
1111
+ if (entry?.kind === 'resume')
1112
+ value.resources.expectAnswer();
1113
+ const observers = (0, componentObservers_js_1.agentComponentObservers)(component, value, entry, {
1114
+ causal: this.memories.some((memory) => memory.type === 'causal'),
1115
+ window: this.windowStrategy !== undefined,
1116
+ });
1117
+ return {
1118
+ recorder: observers.recorder,
1119
+ bindScope: (scope) => {
1120
+ const run = this.runExecution().forScope(scope);
1121
+ value.resources?.bindReporter((status) => (0, runRedaction_js_1.captureLateEmitter)(scope, eventStageIds_js_1.TOOL_TEARDOWN_STAGE_ID)?.('agentfootprint.tools.resource_restore', status));
1122
+ (0, runRedaction_js_1.bindScopeComputation)(scope, {
1123
+ owner: component,
1124
+ retired: () => run.retired,
1125
+ emit: observers.emit,
1126
+ });
1127
+ },
1128
+ };
1129
+ },
1130
+ });
1131
+ const live = (0, runnerLive_js_1.runnerLive)(this);
1132
+ if (live === undefined)
1133
+ throw new TypeError('Agent live taps were not initialized');
1134
+ (0, runnerLive_js_1.registerRunnerLive)(this, {
1135
+ ...live,
1136
+ turn: (0, hostTurn_js_1.hostedTurns)(this.runExecution(), {
1137
+ run: (run, input, options) => this.runOwned(run, input, options),
1138
+ resume: (run, checkpoint, input, options) => this.resumeOwned(run, checkpoint, input, options),
1139
+ prepareResume: (checkpoint) => this.noteResumeTakenUp(checkpoint),
1140
+ checkpoint: (run) => this.checkpointFor(run),
1141
+ }),
1142
+ pause: {
1143
+ capture: (outcome) => (0, pauseOwnership_js_1.capturePauseOwnership)(this.runExecution().selected()?.value, outcome),
1144
+ abandon: (checkpoint) => this.runExecution().withRun(() => (0, pauseOwnership_js_1.abandonStoredPause)(checkpoint, () => this.toolSessions())),
1145
+ },
1146
+ });
1243
1147
  }
1244
1148
  static create(opts) {
1245
1149
  return new AgentBuilder_js_1.AgentBuilder(opts);
@@ -1285,13 +1189,26 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1285
1189
  * The one difference is the timeline's filter: a recording filed FOR a
1286
1190
  * person keeps only the events of that person's run.
1287
1191
  */
1288
- startRunRecording() {
1192
+ startRunRecording(invocation) {
1289
1193
  if (this.artifactRecordings === undefined || this.artifactStore === undefined)
1290
1194
  return undefined;
1291
1195
  // Only THIS run's events: on an instance serving several sessions, the
1292
1196
  // hosting door emits facts for other sessions while this run is in flight,
1293
1197
  // and a recording is redeemable by the person it was filed for.
1294
- return (0, recordRun_js_1.recordRunWhere)(this, (event) => this.ownsEvent(event));
1198
+ const recording = (0, recordRun_js_1.recordRunWhere)(this, (event) => invocation.run.origin !== undefined && (0, eventMeta_js_1.eventBelongsToRun)(event.meta, invocation.context()));
1199
+ let outcome;
1200
+ // Registered before component setup. Native reverse finalization joins
1201
+ // resource cleanup first, then files this recording, then detaches it.
1202
+ invocation.run.onFinalize(() => recording.stop());
1203
+ invocation.run.onFinalize(async () => {
1204
+ if (outcome !== undefined)
1205
+ await this.fileRunRecording(invocation, recording, outcome);
1206
+ });
1207
+ return {
1208
+ complete(value) {
1209
+ outcome = value;
1210
+ },
1211
+ };
1295
1212
  }
1296
1213
  /**
1297
1214
  * Does `event` belong to the run this agent is serving (or served last)? The
@@ -1302,13 +1219,14 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1302
1219
  * @internal
1303
1220
  */
1304
1221
  ownsEvent(event) {
1305
- return (0, eventMeta_js_1.eventBelongsToRun)(event.meta, this.currentRunContext);
1222
+ const selected = this.runExecution().selected();
1223
+ return selected !== undefined && (0, eventMeta_js_1.eventBelongsToRun)(event.meta, selected.context);
1306
1224
  }
1307
1225
  /**
1308
1226
  * File the finished recording into the artifact store.
1309
1227
  *
1310
1228
  * ── When ────────────────────────────────────────────────────────────────
1311
- * After the answer is composed, and only for a run that COMPLETED. A pause
1229
+ * After the answer and joined component resource cleanup, only for a run that COMPLETED. A pause
1312
1230
  * is not a finished run (the turn continues, and the resume mints its own);
1313
1231
  * a throw never reaches here at all.
1314
1232
  *
@@ -1332,14 +1250,14 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1332
1250
  * The recording is FROZEN before the mint, so it can never contain the
1333
1251
  * `artifacts.minted` event describing itself.
1334
1252
  */
1335
- async fileRunRecording(recorder, outcome) {
1253
+ async fileRunRecording(invocation, recorder, outcome) {
1336
1254
  const store = this.artifactStore;
1337
1255
  if (recorder === undefined || store === undefined || this.artifactRecordings === undefined) {
1338
1256
  return;
1339
1257
  }
1340
1258
  if ((0, pause_js_1.isPaused)(outcome))
1341
1259
  return;
1342
- const runId = this.currentRunContext?.runId;
1260
+ const runId = invocation.context().runId;
1343
1261
  let input;
1344
1262
  try {
1345
1263
  const recording = recorder.toRecording();
@@ -1355,7 +1273,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1355
1273
  return;
1356
1274
  }
1357
1275
  try {
1358
- const result = await store.put(this.runArtifactScope(), input);
1276
+ const result = await store.put(this.runArtifactScope(invocation), input);
1359
1277
  // Sweeps ride the put result, so retention that evicted an older
1360
1278
  // recording to make room says so on the record — the same law a tool's
1361
1279
  // own mint follows.
@@ -1399,14 +1317,14 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1399
1317
  * the one the run's tools used, and a recording filed in a different scope
1400
1318
  * from the artifacts it describes is a recording nobody can find.
1401
1319
  */
1402
- runArtifactScope() {
1403
- const identity = this.liveSnapshot()?.sharedState
1320
+ runArtifactScope(invocation) {
1321
+ const identity = invocation.view.snapshot()?.sharedState
1404
1322
  ?.runIdentity;
1405
1323
  if (identity === undefined) {
1406
1324
  // No state to read means no run happened, which this path cannot reach —
1407
1325
  // but a scope is required and inventing a tenant would be worse than a
1408
1326
  // conversation id that names the run itself.
1409
- return { conversationId: this.currentRunContext?.runId ?? 'unknown' };
1327
+ return { conversationId: invocation.context().runId };
1410
1328
  }
1411
1329
  return {
1412
1330
  conversationId: identity.conversationId,
@@ -1452,14 +1370,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1452
1370
  * read or write of a selected key reads `[REDACTED]`, and an `[emit]` line
1453
1371
  * shows the event's served payload (`src/redaction/runRedaction.ts`).
1454
1372
  */
1373
+ /** Empty during preparation before native origin; capture prior entries before the next call. */
1455
1374
  getLastNarrativeEntries() {
1456
- if (this.lastExecutor === undefined)
1457
- return [];
1458
- // The snapshot's terms: an executor no run of this agent opened serves
1459
- // nothing — its narrative was written under no rule anyone knows.
1460
- if ((0, runRedaction_js_1.coverageOfExecutor)(this.lastExecutor).state === 'unknown')
1375
+ const selected = this.runExecution().selected();
1376
+ const coverage = selected?.value.redaction?.coverage;
1377
+ if (selected === undefined || coverage === undefined || coverage.state === 'unknown')
1461
1378
  return [];
1462
- return this.lastExecutor.getNarrativeEntries();
1379
+ return selected.view.getNarrativeEntries();
1463
1380
  }
1464
1381
  /**
1465
1382
  * The FlowChart compiled for the most recent run (or a freshly-built
@@ -1544,7 +1461,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1544
1461
  * `OutputSchemaError` — hand it to the 3-tier fallback. The one settle for
1545
1462
  * `parseOutputAsync`'s parse failure and `runTyped`'s native stop failure.
1546
1463
  */
1547
- async settleTypedFailure(raw, err) {
1464
+ async settleTypedFailure(raw, err, invocation) {
1548
1465
  const parser = this.outputSchemaParser;
1549
1466
  if (!this.outputFallbackCfg || !(err instanceof outputSchema_js_1.OutputSchemaError))
1550
1467
  throw err;
@@ -1560,13 +1477,16 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1560
1477
  type: eventType,
1561
1478
  timestamp: Date.now(),
1562
1479
  payload,
1480
+ ...(invocation !== undefined && {
1481
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: '__typed_output__' }, invocation.context()),
1482
+ }),
1563
1483
  });
1564
1484
  }
1565
1485
  catch {
1566
1486
  /* observability errors must not poison the fallback path */
1567
1487
  }
1568
1488
  };
1569
- return (0, outputFallback_js_1.applyOutputFallback)(raw, parser, this.outputFallbackCfg, emit, err, this.lastRunRetriesSpent());
1489
+ return (0, outputFallback_js_1.applyOutputFallback)(raw, parser, this.outputFallbackCfg, emit, err, invocation === undefined ? undefined : this.retriesSpent(invocation));
1570
1490
  }
1571
1491
  /**
1572
1492
  * Corrective re-asks the agent's LAST run paid for, read off its own ledger.
@@ -1575,8 +1495,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1575
1495
  * any string, including one that never came from this agent, and reporting
1576
1496
  * `0` for "I do not know" would be an invented fact in an event payload.
1577
1497
  */
1578
- lastRunRetriesSpent() {
1579
- const state = this.liveSnapshot()?.sharedState;
1498
+ retriesSpent(invocation) {
1499
+ const state = invocation.view.snapshot()?.sharedState;
1580
1500
  if (state === undefined)
1581
1501
  return undefined;
1582
1502
  return Math.max(0, (state.outputAttempts?.length ?? 1) - 1);
@@ -1597,36 +1517,43 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1597
1517
  * `agent.answerCoverage()`.
1598
1518
  */
1599
1519
  async runTyped(input, options) {
1600
- if (!this.outputSchemaParser) {
1601
- throw new Error(`Agent.runTyped: this agent has no outputSchema. Use ` +
1602
- `Agent.create({...}).outputSchema(parser).build() to enable typed output.`);
1603
- }
1604
- const out = await this.run(input, options);
1605
- if (typeof out !== 'string') {
1606
- throw new Error('Agent.runTyped: run paused — typed mode does not support pauses. ' +
1607
- 'Use agent.run() + agent.parseOutput(...) after resume.');
1608
- }
1609
- // `strategy: 'native'`: an answer whose last attempt failed on a refusal
1610
- // or truncation stop is refused here even when its text parses — the
1611
- // format did not hold for it (outputEnforcement.ts · nativeStopFailure).
1612
- // FIRST, before any delivery path. It takes the same path a parse failure
1613
- // takes, `.outputFallback()` included.
1614
- const stopped = this.outputEnforcement?.outputFormat !== undefined ? this.outputContractUnmet() : undefined;
1615
- if (stopped?.stopReason !== undefined) {
1616
- return this.settleTypedFailure(out, new outputSchema_js_1.OutputSchemaError(stopped.error, { rawOutput: out, stage: stopped.stage }));
1617
- }
1618
- if (this.answerValidationConfig !== undefined) {
1619
- // The validator judged the schema's JSON output. Do not run a transforming
1620
- // or stateful parser again and hand back a value the validator never saw.
1621
- if (this.answerValidation()?.schemaAccepted !== true) {
1622
- throw new outputSchema_js_1.OutputSchemaError('Answer validation could not establish a JSON schema result.', {
1623
- rawOutput: out,
1624
- stage: 'schema-validate',
1625
- });
1520
+ return this.runExecution().withRun(async (invocation) => {
1521
+ if (!this.outputSchemaParser) {
1522
+ throw new Error(`Agent.runTyped: this agent has no outputSchema. Use ` +
1523
+ `Agent.create({...}).outputSchema(parser).build() to enable typed output.`);
1626
1524
  }
1627
- return (0, outputSchema_js_1.applyOutputSchema)(out, { parse: (value) => value });
1628
- }
1629
- return this.parseOutputAsync(out);
1525
+ const out = await this.runOwned(invocation, input, options);
1526
+ if (typeof out !== 'string') {
1527
+ throw new Error('Agent.runTyped: run paused — typed mode does not support pauses. ' +
1528
+ 'Use agent.run() + agent.parseOutput(...) after resume.');
1529
+ }
1530
+ // `strategy: 'native'`: an answer whose last attempt failed on a refusal
1531
+ // or truncation stop is refused here even when its text parses — the
1532
+ // format did not hold for it (outputEnforcement.ts · nativeStopFailure).
1533
+ // FIRST, before any delivery path. It takes the same path a parse failure
1534
+ // takes, `.outputFallback()` included.
1535
+ const stopped = this.outputEnforcement?.outputFormat !== undefined ? this.outputContractUnmet() : undefined;
1536
+ if (stopped?.stopReason !== undefined) {
1537
+ return this.settleTypedFailure(out, new outputSchema_js_1.OutputSchemaError(stopped.error, { rawOutput: out, stage: stopped.stage }), invocation);
1538
+ }
1539
+ if (this.answerValidationConfig !== undefined) {
1540
+ // The validator judged the schema's JSON output. Do not run a transforming
1541
+ // or stateful parser again and hand back a value the validator never saw.
1542
+ if (this.answerValidation()?.schemaAccepted !== true) {
1543
+ throw new outputSchema_js_1.OutputSchemaError('Answer validation could not establish a JSON schema result.', {
1544
+ rawOutput: out,
1545
+ stage: 'schema-validate',
1546
+ });
1547
+ }
1548
+ return (0, outputSchema_js_1.applyOutputSchema)(out, { parse: (value) => value });
1549
+ }
1550
+ try {
1551
+ return (0, outputSchema_js_1.applyOutputSchema)(out, this.outputSchemaParser);
1552
+ }
1553
+ catch (error) {
1554
+ return this.settleTypedFailure(out, error, invocation);
1555
+ }
1556
+ });
1630
1557
  }
1631
1558
  /**
1632
1559
  * Answer one turn.
@@ -1666,6 +1593,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1666
1593
  * ```
1667
1594
  */
1668
1595
  async run(input, options) {
1596
+ return this.runExecution().withRun((invocation) => this.runOwned(invocation, input, options));
1597
+ }
1598
+ async runOwned(invocation, input, options) {
1599
+ invocation.value.hadAdmitted = invocation.previous?.value.hadAdmitted === true;
1669
1600
  // Normalize or refuse BEFORE anything is created. A bare string is the
1670
1601
  // message; anything that is not a message is named and refused here
1671
1602
  // rather than becoming `content: undefined` inside the messages slot.
@@ -1695,13 +1626,12 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1695
1626
  // never on the server's zone.
1696
1627
  const clockDraft = this.clockDraftFor(runInput.time ?? options?.time, 'Agent.run');
1697
1628
  // The engine's options; the run's signal (and its deadline) is armed just
1698
- // before the run starts and released in its `finally` (`runSignalOf`).
1699
- const engineOptions = withoutTime(options);
1629
+ // before native execution, whose lifecycle releases it.
1630
+ const engineOptions = (0, withoutTime_js_1.withoutTime)(options);
1700
1631
  // Timing next, and before the executor exists: both of these refuse a call
1701
1632
  // that would have SUCCEEDED into corrupted per-instance state or an
1702
1633
  // orphaned human question. See ./conversation.ts for why they are throws.
1703
- this.assertNotRunning('Agent.run');
1704
- this.assertNoPendingQuestion('Agent.run');
1634
+ this.assertNoPendingQuestion('Agent.run', invocation.previous?.value);
1705
1635
  // A conversation handed in continues through the same side channel
1706
1636
  // `resumeOnError` uses — one restoration path, so the two doors cannot
1707
1637
  // drift about what "continue" means. This turn's message IS appended:
@@ -1710,97 +1640,98 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1710
1640
  let continued;
1711
1641
  if (runInput.continueFrom !== undefined) {
1712
1642
  continued = (0, runCheckpoint_js_1.validateCheckpoint)(runInput.continueFrom);
1713
- this.applyContinuation(continued, 'Agent.run({ continueFrom })', true);
1643
+ this.applyContinuation(invocation.value, continued, 'Agent.run({ continueFrom })', true);
1714
1644
  }
1715
1645
  // Only an EXPLICIT identity is remembered for `checkpoint()`; see the
1716
1646
  // field's note. `input.identity` wins over `options.identity` because the
1717
1647
  // input bag is where a caller looks first, and both win over the stored
1718
1648
  // conversation's — but the conversation's is used when neither was given,
1719
1649
  // so a continued turn stays in the namespace it started in.
1720
- this.lastRunIdentity =
1650
+ invocation.value.identity =
1721
1651
  runInput.identity ?? options?.identity ?? (continued ? continued.identity : undefined);
1722
1652
  // Recordings-as-artifacts (9.26.0). BEFORE `createExecutor`, because
1723
1653
  // `attach()` collects recorders for the executor that has not been built
1724
1654
  // yet — a recording started one line later would be missing its
1725
1655
  // boundaries, which is the failure mode `recordRun` exists to prevent.
1726
1656
  // Returns `undefined` (and touches nothing) unless the dial is on.
1727
- const recording = this.startRunRecording();
1657
+ const recording = this.startRunRecording(invocation);
1728
1658
  // (helper used in the catch block below — module-private function
1729
1659
  // declared at file end via hoisting)
1730
- this.answeredAsk = undefined;
1731
- this.resumePassedTime = undefined;
1732
- const executor = this.createExecutor(engineOptions, runRequest);
1733
- this.inFlightRunId = this.currentRunContext.runId;
1660
+ invocation.value.answeredAsk = undefined;
1661
+ invocation.value.resumePassedTime = undefined;
1662
+ const prepared = this.prepareAgentRun(invocation, engineOptions, runRequest);
1734
1663
  // One disposition ledger per run (9.60.0) — registration mirrors what
1735
1664
  // this agent's configuration makes applicable; dev posture runs the
1736
1665
  // canaries here, BEFORE any real work, so a dead check is named first.
1737
- this.beginIntegrityLedger();
1738
1666
  // Auto-checkpoint at iteration boundaries — captures the latest
1739
1667
  // conversation history into a per-run tracker. On error, we
1740
1668
  // wrap the underlying error in `RunCheckpointError` carrying
1741
1669
  // this checkpoint so `agent.resumeOnError(checkpoint)` can
1742
1670
  // continue from the last good iteration.
1743
1671
  const tracker = {
1744
- runId: this.currentRunContext?.runId ?? 'unknown',
1672
+ get runId() {
1673
+ return invocation.context().runId;
1674
+ },
1745
1675
  originalInput: { message: runInput.message },
1746
1676
  history: [],
1747
1677
  lastCompletedIteration: 0,
1748
1678
  };
1749
- this.checkpointTracker = tracker;
1750
- const stopTracking = this.installCheckpointTracker(tracker);
1679
+ invocation.value.checkpointTracker = tracker;
1751
1680
  // The answer this run produces is the only place the final assistant turn
1752
1681
  // exists (nothing writes it back into `scope.history`), so `checkpoint()`
1753
1682
  // keeps it. Cleared here so a failed or paused run cannot hand back the
1754
1683
  // previous run's answer.
1755
- this.lastRunAnswer = undefined;
1684
+ invocation.value.answer = undefined;
1756
1685
  // One run can never raise on another run's consent block.
1757
- this.consentOutstanding.clear();
1686
+ invocation.value.consentOutstanding.clear();
1758
1687
  // Set here, beside the `try` whose `finally` clears it, so no exit path
1759
1688
  // can leave it behind for a turn this `run()` did not start.
1760
- this.runClockDraft = clockDraft;
1689
+ invocation.value.clockDraft = clockDraft;
1761
1690
  // Armed here, beside the `try` whose `finally` releases it: no refused
1762
1691
  // call above can leave a deadline running.
1763
- const runSignal = (0, RunnerBase_js_1.runSignalOf)(engineOptions);
1764
1692
  try {
1765
- const result = await executor.run({
1766
- input: {
1767
- message: runInput.message,
1768
- ...(this.lastRunIdentity !== undefined && { identity: this.lastRunIdentity }),
1769
- // A composed message reaches seed only on an agent that reads it
1770
- // (declared sources, or the time layer's reader) — every other run's
1771
- // input is the bytes it was.
1772
- ...(messageFrom === 'composed' &&
1773
- (this.argumentSourcesArmed === true || this.timeOptions?.reader !== undefined) && {
1774
- messageFrom: 'composed',
1775
- }),
1693
+ const result = await invocation.execute({
1694
+ kind: 'run',
1695
+ options: {
1696
+ input: {
1697
+ message: runInput.message,
1698
+ ...(invocation.value.identity !== undefined && {
1699
+ identity: invocation.value.identity,
1700
+ }),
1701
+ // A composed message reaches seed only on an agent that reads it
1702
+ // (declared sources, or the time layer's reader) — every other run's
1703
+ // input is the bytes it was.
1704
+ ...(messageFrom === 'composed' &&
1705
+ (this.argumentSourcesArmed === true || this.timeOptions?.reader !== undefined) && {
1706
+ messageFrom: 'composed',
1707
+ }),
1708
+ },
1709
+ // Co-engineered boundary (#16): the engine's loop-iteration limit
1710
+ // (footprintjs 9 default 1000) must never fire BELOW the agent's own
1711
+ // budget — give it headroom (×2 + 10 covers double-hop loop shapes).
1712
+ // Consumer-provided options win.
1713
+ maxIterations: this.maxIterations * 2 + 10,
1714
+ ...(engineOptions ?? {}),
1776
1715
  },
1777
- // Co-engineered boundary (#16): the engine's loop-iteration limit
1778
- // (footprintjs 9 default 1000) must never fire BELOW the agent's own
1779
- // budget — give it headroom (×2 + 10 covers double-hop loop shapes).
1780
- // Consumer-provided options win.
1781
- maxIterations: this.maxIterations * 2 + 10,
1782
- ...(runSignal.options ?? {}),
1783
- });
1784
- const finalized = this.finalizeResult(executor, result);
1716
+ }, prepared.setup, prepared.binding);
1717
+ const finalized = this.finalizeResult(invocation, result);
1785
1718
  if (typeof finalized === 'string')
1786
- this.lastRunAnswer = finalized;
1787
- this.recordPendingQuestion(finalized);
1788
- await this.endRunToolSessions(finalized);
1719
+ invocation.value.answer = finalized;
1720
+ this.recordPendingQuestion(invocation.value, finalized);
1789
1721
  // The answer is FINISHED before this line and cannot be changed by it.
1790
1722
  // The liveness theorems (9.60.0, dev posture only) — a run that would
1791
1723
  // return green while its registered checkers demonstrably never ran
1792
1724
  // fails HERE instead, before the recording is filed. A finished run is
1793
1725
  // itself the proof work existed: the loop cannot finish without at
1794
1726
  // least one model call.
1795
- this.assertIntegrityAlive();
1727
+ this.assertIntegrityAlive(invocation);
1796
1728
  // See `fileRunRecording` for why the write is awaited rather than left
1797
1729
  // in flight, and why it can never fail the run.
1798
- await this.fileRunRecording(recording, finalized);
1730
+ recording?.complete(finalized);
1799
1731
  return finalized;
1800
1732
  }
1801
1733
  catch (cause) {
1802
1734
  // A THROWN pause is still a pause — see `endRunToolSessions`.
1803
- await this.endRunToolSessions(cause);
1804
1735
  // Wrap recoverable errors with the last-known-good checkpoint.
1805
1736
  // Don't wrap intentional terminal signals — let them propagate as
1806
1737
  // their typed shapes so callers can `instanceof` them:
@@ -1839,7 +1770,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1839
1770
  // 9.60.0 — a dead checker is a WIRING verdict on this build, not a
1840
1771
  // recoverable run state: resuming would run the same dead wiring.
1841
1772
  cause.name === 'CheckerDeadError');
1842
- if (cause instanceof Error && !isTerminalTypedError && tracker.history.length > 0) {
1773
+ if (cause instanceof Error &&
1774
+ !isTerminalTypedError &&
1775
+ !invocation.value.checkpointObservationFailed &&
1776
+ tracker.history.length > 0) {
1843
1777
  // Observation beats the heuristic: if a bracket was open, it says
1844
1778
  // exactly what the run was doing. `classifyFailurePhase` only decides
1845
1779
  // when nothing was — a failure between brackets, where the error's own
@@ -1861,7 +1795,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1861
1795
  // resuming after a crash would be the one path that still lost the
1862
1796
  // identity, and the memory written after the recovery would land
1863
1797
  // where nothing could read it.
1864
- this.conversationOwner(),
1798
+ this.conversationOwner(invocation.value),
1865
1799
  // …and the same graph cursor (SG-C), from the same snapshot reader —
1866
1800
  // one reader, two carriers, so neither can lose what the other keeps.
1867
1801
  this.continuityCursorOf(this.liveSnapshot()?.sharedState), this.evidenceRecoveryOf(this.liveSnapshot()?.sharedState),
@@ -1878,32 +1812,28 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1878
1812
  throw cause;
1879
1813
  }
1880
1814
  finally {
1881
- // The run's deadline and signal links end with the run (`runSignalOf`).
1882
- runSignal.release();
1815
+ // Native admission owns deadlines, signal links and final joining.
1883
1816
  // The time layer's per-run inputs end with the run: a stale draft would
1884
1817
  // be stamped by the next seed this agent did not start (a composition
1885
1818
  // mounting its chart) as if the app had declared it.
1886
- this.runClockDraft = undefined;
1887
- this.resumePassedTime = undefined;
1819
+ invocation.value.clockDraft = undefined;
1820
+ invocation.value.resumePassedTime = undefined;
1888
1821
  // The run's disposition rows, on EVERY path — success, failure, pause —
1889
1822
  // and BEFORE the recording stops, so a recording carries its run's
1890
1823
  // checker accounting (9.60.0).
1891
- this.fileIntegrityDisposition();
1824
+ this.fileIntegrityDisposition(invocation);
1892
1825
  // Always released: a recording left subscribed would keep listening
1893
1826
  // through the next run and grow a tail nobody reads.
1894
- this.noteAdmittedRun();
1895
- recording?.stop();
1896
- stopTracking();
1897
- this.inFlightRunId = undefined;
1827
+ this.noteAdmittedRun(invocation);
1898
1828
  // `seed` consumes the restored conversation on its way past. A run that
1899
1829
  // died BEFORE seed never did, and a history left armed here would be
1900
1830
  // picked up by the next run — which would then continue a conversation
1901
1831
  // nobody asked it to. One run, one continuation.
1902
- this.pendingResumeHistory = undefined;
1903
- this.pendingResumeFolded = undefined;
1904
- this.pendingResumeFindingsLedger = undefined;
1905
- this.pendingResumeSkillCursor = undefined;
1906
- this.pendingEvidenceRecovery = undefined;
1832
+ invocation.value.pendingResumeHistory = undefined;
1833
+ invocation.value.pendingResumeFolded = undefined;
1834
+ invocation.value.pendingResumeFindingsLedger = undefined;
1835
+ invocation.value.pendingResumeSkillCursor = undefined;
1836
+ invocation.value.pendingEvidenceRecovery = undefined;
1907
1837
  }
1908
1838
  }
1909
1839
  /**
@@ -1939,17 +1869,24 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1939
1869
  * ```
1940
1870
  */
1941
1871
  async followUp(message, options) {
1942
- // Refuse BEFORE the timing guards, so "there is nothing to follow up on"
1943
- // is never reported as "a run is in flight" for an agent that has simply
1944
- // not run yet.
1945
- if (this.liveSnapshot() === undefined || (this.lastInputRefused() && !this.hadAdmittedRun)) {
1946
- throw new conversation_js_3.NoConversationError('Agent.followUp', 'never-run');
1947
- }
1948
- const conversation = this.checkpoint();
1949
- if (conversation === undefined || conversation.history.length === 0) {
1950
- throw new conversation_js_3.NoConversationError('Agent.followUp', this.lastInputRefused() ? 'last-input-refused' : 'last-run-unfinished');
1951
- }
1952
- return this.run({ message, continueFrom: conversation }, options);
1872
+ return this.runExecution().withRun(async (invocation) => {
1873
+ (0, callerIdentity_js_1.assertIdentityShape)(options?.identity, 'Agent.followUp');
1874
+ // A continuation must exist before any history can be selected.
1875
+ if (invocation.previous?.view.snapshot() === undefined ||
1876
+ (this.lastInputRefused(invocation.previous?.view) &&
1877
+ !invocation.previous?.value.hadAdmitted)) {
1878
+ throw new conversation_js_3.NoConversationError('Agent.followUp', 'never-run');
1879
+ }
1880
+ const conversation = this.checkpointFor(invocation.previous);
1881
+ if (conversation === undefined || conversation.history.length === 0) {
1882
+ throw new conversation_js_3.NoConversationError('Agent.followUp', this.lastInputRefused(invocation.previous?.view)
1883
+ ? 'last-input-refused'
1884
+ : 'last-run-unfinished');
1885
+ }
1886
+ if (conversation.identity !== undefined)
1887
+ (0, resumeAnswer_js_1.refuseFollowUpIdentity)(options?.identity, conversation.identity);
1888
+ return this.runOwned(invocation, { message, continueFrom: conversation }, options);
1889
+ });
1953
1890
  }
1954
1891
  /**
1955
1892
  * Drop the question this agent's last run paused to ask, on the record.
@@ -1966,10 +1903,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
1966
1903
  * does not touch the paused run's checkpoint: if you still hold that, it
1967
1904
  * remains resumable.
1968
1905
  */
1969
- abandonPause() {
1970
- const dropped = this.pendingQuestion;
1971
- this.pendingQuestion = undefined;
1972
- return dropped;
1906
+ async abandonPause() {
1907
+ return this.runExecution().withRun((invocation) => (0, pauseOwnership_js_1.abandonPendingQuestion)(invocation.previous?.value));
1973
1908
  }
1974
1909
  /**
1975
1910
  * Whether {@link Agent.selfExplain}'s why-questions have a run to answer
@@ -2037,32 +1972,33 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2037
1972
  * ```
2038
1973
  */
2039
1974
  async resumeOnError(checkpoint, options) {
2040
- const cp = (0, runCheckpoint_js_1.validateCheckpoint)(checkpoint);
2041
- // The timing guards run HERE, not only inside `run()`, because the line
2042
- // below writes the side channel: a refusal after that write would leave a
2043
- // restored history armed and the NEXT run would silently continue somebody
2044
- // else's conversation.
2045
- this.assertNotRunning('Agent.resumeOnError');
2046
- this.assertNoPendingQuestion('Agent.resumeOnError');
2047
- // A request `run()` would refuse is refused HERE, before the side channel
2048
- // below is armed — a refusal after it would leave the restored history for
2049
- // the next, unrelated run.
2050
- (0, requestOfRun_js_1.requestOf)(options, 'Agent.resumeOnError');
2051
- // Stash the checkpointed history on the side channel; the seed function
2052
- // reads + clears it before scope.history initializes. No message is
2053
- // appended — the failing run's message is already the last user turn in
2054
- // that history, and adding it again would ask twice.
2055
- this.applyContinuation(cp, 'Agent.resumeOnError', false);
2056
- return this.run({
2057
- message: cp.originalInput.message,
2058
- // The conversation's own identity, unless this call named one. Until
2059
- // 9.2.0 there was no way to pass either, so a recovered run silently
2060
- // re-namespaced its memory under a fresh runId and wrote turn two
2061
- // where turn three could not read it.
2062
- ...(this.identityFor(options, cp) !== undefined && {
2063
- identity: this.identityFor(options, cp),
2064
- }),
2065
- }, options);
1975
+ return this.runExecution().withRun(async (invocation) => {
1976
+ const cp = (0, runCheckpoint_js_1.validateCheckpoint)(checkpoint);
1977
+ // The timing guards run HERE, not only inside `run()`, because the line
1978
+ // below writes the side channel: a refusal after that write would leave a
1979
+ // restored history armed and the NEXT run would silently continue somebody
1980
+ // else's conversation.
1981
+ this.assertNoPendingQuestion('Agent.resumeOnError', invocation.previous?.value);
1982
+ // A request `run()` would refuse is refused HERE, before the side channel
1983
+ // below is armed — a refusal after it would leave the restored history for
1984
+ // the next, unrelated run.
1985
+ (0, requestOfRun_js_1.requestOf)(options, 'Agent.resumeOnError');
1986
+ // Stash the checkpointed history on the side channel; the seed function
1987
+ // reads + clears it before scope.history initializes. No message is
1988
+ // appended — the failing run's message is already the last user turn in
1989
+ // that history, and adding it again would ask twice.
1990
+ this.applyContinuation(invocation.value, cp, 'Agent.resumeOnError', false);
1991
+ return this.runOwned(invocation, {
1992
+ message: cp.originalInput.message,
1993
+ // The conversation's own identity, unless this call named one. Until
1994
+ // 9.2.0 there was no way to pass either, so a recovered run silently
1995
+ // re-namespaced its memory under a fresh runId and wrote turn two
1996
+ // where turn three could not read it.
1997
+ ...(this.identityFor(options, cp) !== undefined && {
1998
+ identity: this.identityFor(options, cp),
1999
+ }),
2000
+ }, options);
2001
+ });
2066
2002
  }
2067
2003
  /**
2068
2004
  * Which identity a continued turn runs under: the caller's if they named
@@ -2073,141 +2009,21 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2073
2009
  identityFor(options, cp) {
2074
2010
  return options?.identity ?? cp.identity;
2075
2011
  }
2076
- /**
2077
- * A run's `time`, read into the turn's clock draft (the time layer) — or
2078
- * refused, before the turn starts: `time` on an agent without `.time()` or
2079
- * a malformed value. No zone anywhere (the run's, else the builder's) is no
2080
- * refusal: the zone is UNKNOWN (`zoneSource: 'unknown'`, G15) — never the
2081
- * server's, never guessed; the person is asked it before any time they
2082
- * wrote is read. `undefined` on an agent without the layer.
2083
- *
2084
- * @internal
2085
- */
2086
2012
  clockDraftFor(time, runner) {
2087
- const passed = this.passedTimeFor(time, runner);
2088
- if (this.timeOptions === undefined)
2089
- return undefined;
2090
- return (0, clock_js_1.draftClock)(passed, this.timeOptions);
2013
+ return (0, clocks_js_1.draftAgentClock)(time, runner, this.timeOptions);
2091
2014
  }
2092
- /**
2093
- * The clock draft seed stamps (the time layer): the one `run()` read — or,
2094
- * for a turn this agent's `run()` did not start (its chart mounted in a
2095
- * composition, which passes no `time`), the builder's fallback zone with
2096
- * the turn's start as `now` (`zoneSource: 'builder'`, `nowSource:
2097
- * 'default'` — the same record a `run()` with no `time` files). With no
2098
- * fallback zone that turn's zone is unknown, as a `run()`'s is (G15): the
2099
- * server's zone is never used.
2100
- *
2101
- * @internal
2102
- */
2103
- seedClockDraft() {
2104
- if (this.runClockDraft !== undefined)
2105
- return this.runClockDraft;
2106
- return (0, clock_js_1.draftClock)(undefined, this.timeOptions ?? {});
2015
+ seedClockDraft(values) {
2016
+ return (0, clocks_js_1.clockForSeed)(values, this.timeOptions);
2107
2017
  }
2108
- /**
2109
- * A `time` passed to a run or a resume, read — or refused by name: passed to
2110
- * an agent without `.time()` (a door that ignored it would look configured
2111
- * and do nothing), or malformed.
2112
- *
2113
- * @internal
2114
- */
2115
2018
  passedTimeFor(time, runner) {
2116
- if (time === undefined)
2117
- return undefined;
2118
- if (this.timeOptions === undefined) {
2119
- throw new runInput_js_1.InvalidRunInputError({
2120
- runner,
2121
- received: 'time',
2122
- hint: 'this agent reads no clock — arm the time layer with .time() to pass time',
2123
- });
2124
- }
2125
- const read = (0, clock_js_1.readRunTime)(time);
2126
- if ('problem' in read) {
2127
- throw new runInput_js_1.InvalidRunInputError({ runner, received: 'a malformed time', hint: read.problem });
2128
- }
2129
- return read.value;
2130
- }
2131
- /**
2132
- * Install a per-run checkpoint tracker. Listens for the agent's own
2133
- * iteration and stream brackets and snapshots the conversation history into
2134
- * the tracker. Returns a stop function.
2135
- *
2136
- * It listens on the REAL-value path (`EventDispatcher · onRealEvent`), never
2137
- * on the served one: the crash checkpoint it builds is what
2138
- * `resumeOnError` replays to the model, and a resume checkpoint keeps real
2139
- * values — a redaction policy that names `history` must not turn the
2140
- * conversation a crash resumes into placeholders (`src/redaction/`).
2141
- *
2142
- * @internal
2143
- */
2144
- installCheckpointTracker(tracker) {
2145
- return this.dispatcher.onRealEvent((event) => {
2146
- switch (event.type) {
2147
- case 'agentfootprint.agent.iteration_start': {
2148
- const p = event.payload;
2149
- if (typeof p?.iterIndex === 'number')
2150
- tracker.inFlightIteration = p.iterIndex;
2151
- return;
2152
- }
2153
- // Phase OBSERVATION (8.14.0) — the run's own stream brackets. A crash
2154
- // inside one of these is attributable without asking the error to
2155
- // describe itself. `'call-llm'` is a literal and `toolName` is a name
2156
- // the app declared: no URL, no credential, no payload ever reaches the
2157
- // checkpoint.
2158
- case 'agentfootprint.stream.llm_start':
2159
- tracker.inFlightPhase = { phase: 'llm', stage: 'call-llm' };
2160
- return;
2161
- case 'agentfootprint.stream.llm_end':
2162
- tracker.inFlightPhase = undefined;
2163
- return;
2164
- // A bracket carrying `notDispatched` (9.113.0) is a call a paused batch
2165
- // never dispatched: nothing of it was ever in flight, so it neither
2166
- // opens nor clears the phase. Nothing observable depends on this today
2167
- // — the settlement emits both halves back to back with no await between
2168
- // them (`toolCalls.ts` · `bracketSettled`), so a crash can never land
2169
- // inside one — it keeps the phase true to the marker should that ever
2170
- // change.
2171
- case 'agentfootprint.stream.tool_start': {
2172
- const p = event.payload;
2173
- if (p?.notDispatched !== undefined)
2174
- return;
2175
- const name = p?.toolName;
2176
- tracker.inFlightPhase = {
2177
- phase: 'tool',
2178
- stage: typeof name === 'string' ? name : 'tool',
2179
- };
2180
- return;
2181
- }
2182
- case 'agentfootprint.stream.tool_end': {
2183
- const p = event.payload;
2184
- if (p?.notDispatched !== undefined)
2185
- return;
2186
- tracker.inFlightPhase = undefined;
2187
- return;
2188
- }
2189
- case 'agentfootprint.agent.iteration_end': {
2190
- const p = event.payload;
2191
- if (typeof p?.iterIndex === 'number')
2192
- tracker.lastCompletedIteration = p.iterIndex;
2193
- if (Array.isArray(p?.history)) {
2194
- tracker.history = p.history;
2195
- }
2196
- tracker.inFlightIteration = undefined;
2197
- tracker.inFlightPhase = undefined;
2198
- return;
2199
- }
2200
- default:
2201
- return;
2202
- }
2203
- });
2019
+ return (0, clocks_js_1.readAgentTime)(time, runner, this.timeOptions);
2204
2020
  }
2205
2021
  /**
2206
2022
  * Continue a run that paused to ask a person something, with their answer.
2207
2023
  *
2208
2024
  * WHO the resumed run is for is the paused run's caller, read off the
2209
2025
  * checkpoint (`agent/callerIdentity.ts`) — never whatever this instance ran
2210
- * last; which SESSION, the call's `sessionId`, else the paused run's. A
2026
+ * last; the session is the paused run's. A supplied `sessionId` must match. A
2211
2027
  * checkpoint names who it is for; it is not proof: a host that lets
2212
2028
  * checkpoints leave its trust boundary signs them or keeps them
2213
2029
  * server-side, and passes the identity it verified as `options.identity`.
@@ -2230,11 +2046,15 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2230
2046
  * ```
2231
2047
  */
2232
2048
  async resume(checkpoint, input, options) {
2049
+ this.noteResumeTakenUp(checkpoint);
2050
+ return this.runExecution().withRun((invocation) => (0, pauseOwnership_js_1.preservePendingQuestion)(invocation.previous?.value, () => invocation.value.resources?.answer.consumed === true, () => this.resumeOwned(invocation, checkpoint, input, options)));
2051
+ }
2052
+ async resumeOwned(invocation, checkpoint, input, options) {
2233
2053
  // Taken up, before anything can refuse: from here every use of a consent
2234
2054
  // decision passes through the one spend a door watching this pause sees
2235
2055
  // (`consentRequest.ts` · `watchDecisionUse`) — so a resume that fails
2236
2056
  // without reaching it, refused or aborted, used nothing.
2237
- (0, consentRequest_js_1.noteDecisionTakenUp)((0, consentRequest_js_1.pausedRequestIdOf)(checkpoint));
2057
+ (0, resumeCheckpoint_js_1.resumeStateOf)(checkpoint);
2238
2058
  // ── A consent gate is answered with a DECISION (8.13.0) ─────────────
2239
2059
  // Refused HERE, before the engine is handed the checkpoint, so nothing
2240
2060
  // executes and the checkpoint is unchanged — the caller can answer the same
@@ -2252,8 +2072,6 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2252
2072
  // The incoming request is the RESUMING caller's — never the paused one's:
2253
2073
  // a checkpoint carries no request, and a resume without one serves none.
2254
2074
  const resumeRequest = (0, requestOfRun_js_1.requestOf)(options, 'Agent.resume');
2255
- // Native guard lands with the new checkpoint protocol, before its runtime
2256
- // opt-in is mounted. Until then no Agent is armed to consume this carrier.
2257
2075
  (0, verificationCheckpoint_js_1.requireVerificationOnResume)(checkpoint.sharedState ?? {}, false);
2258
2076
  if (this.negativeClaimsConfig !== undefined) {
2259
2077
  const prior = (0, checkpoint_js_1.negativeCheckpointOf)(checkpoint.sharedState ?? {});
@@ -2266,16 +2084,17 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2266
2084
  // The policy the paused run was covered by, carried in its own state
2267
2085
  // (`runRedaction`) — it covers this leg too, joined with any the caller
2268
2086
  // adds now. Read, or refused, before anything moves (`resumeRedactionOf`).
2269
- const carriedRedaction = resumeRedactionOf(checkpoint, [
2087
+ const carriedRedaction = (0, resumeRedaction_js_1.resumeRedactionOf)(checkpoint, [
2270
2088
  (0, declared_js_1.redactionDeclaredBy)(this),
2271
2089
  options?.redact,
2272
2090
  (0, conversation_js_2.conversationRedaction)(),
2273
2091
  ]);
2092
+ Object.assign(invocation.value, (0, privateCheckpoint_js_1.privateResumeOf)(checkpoint));
2274
2093
  // A resume's `time` (the time layer) is read or refused before anything
2275
2094
  // moves; it is never applied — the paused turn's clock is kept, and a
2276
2095
  // differing value is recorded by the ToolCalls resume door.
2277
2096
  const passedTime = this.passedTimeFor(options?.time, 'Agent.resume');
2278
- options = withoutTime(options);
2097
+ options = (0, withoutTime_js_1.withoutTime)(options);
2279
2098
  // One run, one identity — refused before anything moves, and before the
2280
2099
  // answer is read at all: a caller this run is not for learns nothing about
2281
2100
  // what it is waiting on (its gate, its tool, its request). The paused run's
@@ -2285,10 +2104,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2285
2104
  // principal and stored ownership. A checkpoint names who it is for; it is
2286
2105
  // not proof — a host that lets checkpoints leave its trust boundary signs
2287
2106
  // them or keeps them server-side, and passes the identity it verified here.
2288
- const pausedFor = (0, callerIdentity_js_1.callerIdentityOf)(checkpoint.sharedState, {
2289
- ...(this.lastRunIdentity !== undefined && { named: this.lastRunIdentity }),
2290
- minted: this.mintedRunIds,
2291
- });
2107
+ const pausedFor = (0, callerIdentity_js_1.callerIdentityOf)(checkpoint.sharedState);
2292
2108
  // The identity the run's memory namespace and credentials are restored
2293
2109
  // from, WHATEVER its source (a caller's, the session rung, the per-run
2294
2110
  // default). One run, one identity: a call that names an identity must
@@ -2301,6 +2117,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2301
2117
  (restored === undefined || !(0, callerIdentity_js_1.sameIdentity)(options.identity, restored)))) {
2302
2118
  throw new conversation_js_3.ResumeIdentityConflictError();
2303
2119
  }
2120
+ const sessionId = (0, resumeCheckpoint_js_1.resumeSessionOf)(checkpoint);
2121
+ if (options?.sessionId !== undefined && options.sessionId !== sessionId)
2122
+ throw new conversation_js_3.ResumeIdentityConflictError('session');
2304
2123
  // …and the decision must be for THIS request and this exact call
2305
2124
  // (`core/consentRequest.ts`): refused here, before anything moves, when it
2306
2125
  // names no request, another request, a call the checkpoint no longer
@@ -2313,11 +2132,12 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2313
2132
  // A request minted under a ledger that can prove is spent only there.
2314
2133
  this.decisionLedger ?? (0, consentRequest_js_1.processDecisionLedger)());
2315
2134
  }
2135
+ if (gate !== undefined)
2136
+ await (0, resumeAnswer_js_1.refuseKnownSpentAnswer)(this.decisionLedger ?? (0, consentRequest_js_1.processDecisionLedger)(), input, gate, options?.signal, options?.env?.signal);
2316
2137
  // Typed data collection is not consent. Validate before changing any run state.
2317
2138
  const awaitingInput = gate === undefined ? (0, inputRequest_js_1.readAwaitingInput)(checkpoint.pauseData) : undefined;
2318
2139
  let answeredAsk;
2319
2140
  if (awaitingInput !== undefined) {
2320
- this.assertNotRunning('Agent.resume');
2321
2141
  const answered = (0, inputRequest_js_1.applyInputResponse)(awaitingInput, input, this.timeAnswerContextOf(checkpoint.sharedState));
2322
2142
  if ('cancel' in answered) {
2323
2143
  throw new TypeError('[input request] Cancel a hosted request through its host, or abandonPause() before starting another run.');
@@ -2334,7 +2154,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2334
2154
  pauseData,
2335
2155
  awaitingInput: answered,
2336
2156
  };
2337
- this.recordPendingQuestion(outcome);
2157
+ this.recordPendingQuestion(invocation.value, outcome);
2338
2158
  return outcome;
2339
2159
  }
2340
2160
  answeredAsk = {
@@ -2355,77 +2175,62 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2355
2175
  // the same door and before any state moves, because a resume that has begun
2356
2176
  // is a resume that has already used the value.
2357
2177
  (0, pause_js_1.assertDecisionIsNotStale)(checkpoint.pauseData, input);
2358
- // The same one-turn-at-a-time guard `run()` carries: a resume writes the
2359
- // same per-instance state a run does. Answering the question is what this
2360
- // door is FOR, so it never checks `pendingQuestion` — it clears it.
2361
- this.assertNotRunning('Agent.resume');
2362
- // Settled the moment the answer is handed over, not when the resumed run
2363
- // finishes: a resume that then FAILS must not leave the agent refusing
2364
- // every later message on behalf of a question that has been answered.
2365
- // Kept to put back when the run refuses the answer itself (a replay of a
2366
- // request already answered): that resume answered nothing.
2367
- const questionBefore = this.pendingQuestion;
2368
- this.pendingQuestion = undefined;
2369
- // WHO this resumed run is for — set BEFORE the executor exists, because the
2370
- // run context's principal (every event's `EventMeta.principal`), a tool's
2371
- // `ctx.identity` and `checkpoint()` all read it: the identity the PAUSED
2372
- // run's caller named (a named `options.identity` was checked equal to the
2373
- // restored one at the top of this method) — never the identity of whatever
2374
- // this instance ran last, which on a shared or pooled agent is another
2375
- // person's, or nobody's (`callerIdentity.ts`).
2376
- this.lastRunIdentity = options?.identity ?? pausedFor;
2377
- // …and WHICH session: the call's, else the one the paused run recorded in
2378
- // its own state (`runSessionId`, or the session rung's) — one source, no
2379
- // instance memory — so a host that resumes without repeating the session
2380
- // does not file the resumed turn (its tool teardown, its events, its
2381
- // self-explain evidence) as sessionless.
2382
- const sessionId = options?.sessionId ?? (0, callerIdentity_js_1.pausedSessionOf)(checkpoint.sharedState);
2178
+ if (gate === undefined && awaitingInput === undefined)
2179
+ (0, resumeAnswer_js_1.refuseMissingPlainAnswer)(checkpoint, input);
2180
+ // A native-admitted answer settles the old question even if its leg fails.
2181
+ // The outer pause-ownership boundary restores pre-origin refusals; named
2182
+ // unanswered refusals after origin are restored below.
2183
+ const questionBefore = invocation.previous?.value.pendingQuestion;
2184
+ // Capture this paused conversation's identity before native origin; selected readers
2185
+ // on a shared instance can belong to another conversation (`callerIdentity.ts`).
2186
+ invocation.value.identity = options?.identity ?? pausedFor;
2187
+ // Resume retains the paused transport session; an override was checked equal above.
2383
2188
  const sessionResumeOptions = sessionId !== undefined && options?.sessionId === undefined
2384
2189
  ? { ...options, sessionId }
2385
2190
  : options;
2386
2191
  // The leg's policy — the carried one, the caller's, and the paused leg's
2387
2192
  // marks — comes back from the emitter and goes to THIS leg's executor
2388
- // (`createExecutor` → `openRunRedaction`); nothing per-run is held on the instance.
2193
+ // (native setup → `prepareRunRedaction`); nothing per-run is held on the instance.
2389
2194
  const resumeLeg = this.emitPauseResume(checkpoint, input, (0, policy_js_1.unionRedactionPolicies)(carriedRedaction, sessionResumeOptions?.redact));
2390
2195
  const resumeOptions = resumeLeg === sessionResumeOptions?.redact
2391
2196
  ? sessionResumeOptions
2392
2197
  : { ...sessionResumeOptions, redact: resumeLeg };
2393
- // Fresh executor — footprintjs 4.17.0+ seeds the runtime from
2394
- // `checkpoint.sharedState` (and nested subflow states) automatically
2395
- // on a fresh executor's `resume()`. No need to retain a paused
2396
- // executor between run/resume.
2397
- // Recorded on the same terms a fresh run is (9.26.0) — and the recording
2398
- // covers the RESUMED run, which is what the recorder saw. A turn that
2399
- // paused and resumed is two runs, and each mints its own recording when
2400
- // (and only when) it completes.
2401
- const recording = this.startRunRecording();
2402
- this.answeredAsk = answeredAsk;
2403
- const executor = this.createExecutor(resumeOptions, resumeRequest);
2198
+ // Fresh native execution restores its checkpoint; no paused executor is retained.
2199
+ // Each resumed native leg files its own recording when it completes.
2200
+ const recording = this.startRunRecording(invocation);
2201
+ invocation.value.answeredAsk = answeredAsk;
2202
+ const prepared = this.prepareAgentRun(invocation, resumeOptions, resumeRequest);
2404
2203
  // The leg's WHOLE policy rides its own state too (`runRedaction`), so a
2405
2204
  // later pause carries what this leg was covered by — names the resume
2406
2205
  // added included — and a third leg is never less covered than this one.
2407
2206
  // `createExecutor` opened this executor's run; one it did not is refused
2408
2207
  // before anything is held or runs — a leg whose policy nothing knows must
2409
2208
  // not start.
2410
- const legCoverage = (0, runRedaction_js_1.coverageOfExecutor)(executor);
2209
+ const legCoverage = invocation.value.redaction?.coverage;
2210
+ if (legCoverage === undefined)
2211
+ throw new conversation_js_1.ResumeRedactionError('unreadable');
2411
2212
  if (legCoverage.state === 'unknown')
2412
2213
  throw new conversation_js_1.ResumeRedactionError('unreadable');
2413
2214
  const leg = { policy: (0, coverage_js_1.policyOfCoverage)(legCoverage) };
2414
- this.inFlightRunId = this.currentRunContext.runId;
2415
2215
  // A resumed turn is two runs, and each keeps its own ledger — exactly
2416
2216
  // the recording's terms one comment up.
2417
- this.beginIntegrityLedger();
2418
- this.lastRunAnswer = undefined;
2419
- this.checkpointTracker = {
2420
- runId: this.currentRunContext.runId,
2421
- originalInput: { message: '' },
2422
- history: [],
2423
- lastCompletedIteration: 0,
2424
- };
2217
+ invocation.value.answer = undefined;
2218
+ const resumedMessage = checkpoint.sharedState.userMessage;
2219
+ invocation.value.checkpointTracker =
2220
+ typeof resumedMessage === 'string'
2221
+ ? {
2222
+ get runId() {
2223
+ return invocation.context().runId;
2224
+ },
2225
+ originalInput: { message: resumedMessage },
2226
+ history: [],
2227
+ lastCompletedIteration: 0,
2228
+ }
2229
+ : undefined;
2425
2230
  // One run can never raise on another run's consent block.
2426
- this.consentOutstanding.clear();
2231
+ invocation.value.consentOutstanding.clear();
2427
2232
  // Beside the `try` whose `finally` clears it (the fresh-run path's terms).
2428
- this.resumePassedTime = passedTime;
2233
+ invocation.value.resumePassedTime = passedTime;
2429
2234
  const legCheckpoint = leg.policy === undefined
2430
2235
  ? checkpoint
2431
2236
  : {
@@ -2435,81 +2240,38 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2435
2240
  runRedaction: (0, conversation_js_2.carriedRunPolicy)(leg.policy),
2436
2241
  },
2437
2242
  };
2438
- // A resume arms its own run signal and deadline (`runSignalOf`), released in
2439
- // the `finally` below.
2440
- const runSignal = (0, RunnerBase_js_1.runSignalOf)(resumeOptions);
2243
+ // The native resumed leg owns its signal and deadline.
2441
2244
  try {
2442
- const result = await executor.resume(legCheckpoint, input, runSignal.options);
2443
- const finalized = this.finalizeResult(executor, result);
2245
+ const result = await invocation.execute({ kind: 'resume', mode: 'fresh', checkpoint: legCheckpoint, input, options: resumeOptions }, prepared.setup, prepared.binding);
2246
+ const finalized = this.finalizeResult(invocation, result);
2444
2247
  if (typeof finalized === 'string')
2445
- this.lastRunAnswer = finalized;
2248
+ invocation.value.answer = finalized;
2446
2249
  // The question this resume answered is settled; a resume that paused
2447
2250
  // AGAIN has asked a new one, and that one is outstanding from here.
2448
- this.recordPendingQuestion(finalized);
2449
- await this.endRunToolSessions(finalized);
2251
+ this.recordPendingQuestion(invocation.value, finalized);
2450
2252
  // Same liveness gate the fresh-run path applies (9.60.0).
2451
- this.assertIntegrityAlive();
2452
- await this.fileRunRecording(recording, finalized);
2253
+ this.assertIntegrityAlive(invocation);
2254
+ recording?.complete(finalized);
2453
2255
  return finalized;
2454
2256
  }
2455
- catch (cause) {
2456
- // An answer the run refused ran nothing and answered nothing: the
2457
- // question this agent was waiting on (if any) is still outstanding, and
2458
- // no tool session ended — a replayed decision must not tear down the
2459
- // sandbox a live pause is holding.
2460
- if (cause instanceof pause_js_1.ResumeDecisionError || cause instanceof pause_js_1.DecisionRequiredError) {
2461
- this.pendingQuestion = questionBefore;
2462
- throw cause;
2463
- }
2464
- await this.endRunToolSessions(cause);
2465
- throw cause;
2466
- }
2467
2257
  finally {
2468
- runSignal.release();
2258
+ if (invocation.value.resources?.answer.consumed === true) {
2259
+ if (invocation.previous !== undefined)
2260
+ invocation.previous.value.pendingQuestion = undefined;
2261
+ }
2262
+ else {
2263
+ invocation.value.pendingQuestion = questionBefore;
2264
+ if (invocation.previous !== undefined)
2265
+ invocation.previous.value.pendingQuestion = questionBefore;
2266
+ }
2469
2267
  // A resume's passed `time` ends with the resume (the fresh-run path's terms).
2470
- this.resumePassedTime = undefined;
2268
+ invocation.value.resumePassedTime = undefined;
2471
2269
  // Same terms as the fresh-run path: rows on every exit, before the
2472
2270
  // recording stops (9.60.0).
2473
- this.fileIntegrityDisposition();
2474
- this.noteAdmittedRun();
2475
- recording?.stop();
2476
- this.inFlightRunId = undefined;
2271
+ this.fileIntegrityDisposition(invocation);
2272
+ this.noteAdmittedRun(invocation);
2477
2273
  }
2478
2274
  }
2479
- /**
2480
- * Fire `'run'`-scoped tool teardown — IF this run really ended.
2481
- *
2482
- * **Not on `finally`, and that is the whole point.** `finally` runs on every
2483
- * exit including a pause, and a pause exits TWO ways: a returned
2484
- * `RunnerPauseOutcome` and a thrown `PauseSignal`. A check-in on a
2485
- * code-interpreter call pauses the run so a person can approve the code —
2486
- * tearing the sandbox down there destroys the exact state the resume needs,
2487
- * and it fails QUIETLY, as a resumed run that "just re-ran everything".
2488
- * Both shapes are discriminated here and both are skipped.
2489
- *
2490
- * An error IS a terminal: the run is over, nobody is coming back, and a
2491
- * sandbox held by a run that crashed is the clearest kind of leak. Only a
2492
- * pause survives.
2493
- *
2494
- * Fired for the TURN, not for `currentRunContext.runId` — `resume()` mints a
2495
- * fresh run id, so a pause and its resume are one turn across two runs, and
2496
- * filtering on the id would leave everything a paused turn opened alive
2497
- * forever. Hosted turns are scoped to their session, preserving other pauses. See `ToolSessionTier.fireRun`.
2498
- *
2499
- * @param outcome what `run()`/`resume()` is about to return, or about to throw.
2500
- */
2501
- async endRunToolSessions(outcome) {
2502
- if (!this.toolSessionTier)
2503
- return;
2504
- if ((0, pause_js_1.isPaused)(outcome))
2505
- return;
2506
- if (outcome instanceof Error && outcome.name === 'PauseSignal')
2507
- return;
2508
- if (this.currentRunContext.sessionId !== undefined)
2509
- await this.toolSessionTier.fireSessionRuns(this.currentRunContext.sessionId);
2510
- else
2511
- await this.toolSessionTier.fireRun();
2512
- }
2513
2275
  /**
2514
2276
  * The conversation this agent's LAST completed run leaves behind, packed as
2515
2277
  * the same `AgentRunCheckpoint` that `resumeOnError(...)` accepts. Store it,
@@ -2564,35 +2326,39 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2564
2326
  * // it does not rewrite entries manually appended to that history.
2565
2327
  * ```
2566
2328
  */
2329
+ /** During preparation before native origin this is undefined; capture before the next call. */
2567
2330
  checkpoint() {
2568
- const snapshot = this.liveSnapshot();
2331
+ return this.checkpointFor(this.runExecution().selected());
2332
+ }
2333
+ checkpointFor(selected) {
2334
+ const snapshot = selected?.view.snapshot();
2569
2335
  if (!snapshot)
2570
2336
  return undefined;
2571
2337
  const state = snapshot.sharedState;
2572
2338
  // Admission is decided by seed, before any conversation state is written.
2573
2339
  // Do not manufacture a blank replay carrier for an unadmitted attempt.
2574
- if (this.lastInputRefused())
2340
+ if (this.lastInputRefused(selected?.view))
2575
2341
  return undefined;
2576
2342
  const recorded = (state?.history ?? []);
2577
2343
  const history = [...recorded];
2578
- if (this.lastRunAnswer !== undefined &&
2579
- (this.lastRunAnswer.length > 0 || state?.llmLatestReplay !== undefined)) {
2344
+ if (selected.value.answer !== undefined &&
2345
+ (selected.value.answer.length > 0 || state?.llmLatestReplay !== undefined)) {
2580
2346
  history.push({
2581
2347
  role: 'assistant',
2582
- content: this.lastRunAnswer,
2348
+ content: selected.value.answer,
2583
2349
  ...(0, assistantReplay_js_1.assistantReplayFields)(state ?? {}),
2584
2350
  });
2585
2351
  }
2586
2352
  const folded = this.foldedSpansOf(state);
2587
- const owner = this.conversationOwner();
2353
+ const owner = this.conversationOwner(selected.value);
2588
2354
  const skillCursor = this.continuityCursorOf(state);
2589
2355
  const evidenceRecovery = this.evidenceRecoveryOf(state);
2590
2356
  const findingsLedger = this.findingsLedgerOf(state);
2591
2357
  const turnNumber = this.turnNumberOf(state);
2592
2358
  return {
2593
2359
  version: 1,
2594
- runId: this.currentRunContext.runId,
2595
- history: structuredClone((0, runCheckpoint_js_1.checkpointReplayHistory)(history, this.checkpointTracker)),
2360
+ runId: selected.context.runId,
2361
+ history: structuredClone((0, runCheckpoint_js_1.checkpointReplayHistory)(history, selected.value.checkpointTracker)),
2596
2362
  lastCompletedIteration: typeof state?.iteration === 'number' ? state.iteration : 0,
2597
2363
  originalInput: { message: typeof state?.userMessage === 'string' ? state.userMessage : '' },
2598
2364
  checkpointedAt: Date.now(),
@@ -2620,9 +2386,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2620
2386
  };
2621
2387
  }
2622
2388
  /** Called as each run/resume ends: remember a run that got past input admission. */
2623
- noteAdmittedRun() {
2624
- if (this.liveSnapshot() !== undefined && !this.lastInputRefused()) {
2625
- this.hadAdmittedRun = true;
2389
+ noteAdmittedRun(invocation) {
2390
+ if (invocation.view.snapshot() !== undefined && !this.lastInputRefused(invocation.view)) {
2391
+ invocation.value.hadAdmitted = true;
2626
2392
  }
2627
2393
  }
2628
2394
  /**
@@ -2636,8 +2402,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2636
2402
  this.evidenceGate?.toolsOffAfterRevision === true);
2637
2403
  }
2638
2404
  /** Whether input middleware refused the last run's message — the one reading both doors ask. */
2639
- lastInputRefused() {
2640
- const state = this.liveSnapshot()?.sharedState;
2405
+ lastInputRefused(view) {
2406
+ const state = view?.snapshot()?.sharedState;
2641
2407
  return state?.messageDeniedPhase === 'input';
2642
2408
  }
2643
2409
  /** Both checkpoint doors keep the repair budget separately from conversation text. */
@@ -2694,27 +2460,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2694
2460
  return undefined;
2695
2461
  return structuredClone(spans);
2696
2462
  }
2697
- /**
2698
- * What the resume door checks a time field's answer with (the time design
2699
- * § 6.2, step T4): the paused turn's clock zone — the kept `clock` row, so
2700
- * a resume that passes another `time` changes nothing — and the app's
2701
- * catalog overrides. `undefined` without `.time()`: a `format` field is
2702
- * then judged for shape, order and offset only, in the default words.
2703
- *
2704
- * @internal
2705
- */
2706
2463
  timeAnswerContextOf(state) {
2707
- if (this.timeOptions === undefined)
2708
- return undefined;
2709
- const ledger = state?.findingsLedger;
2710
- const clock = (0, rows_js_1.clockOf)(Array.isArray(ledger) ? ledger : undefined);
2711
- // An unknown zone (G15) judges no wall time: `zone` is then only the UTC spelling.
2712
- const zone = clock?.zoneSource === 'unknown' ? undefined : clock?.zone;
2713
- const messages = this.timeOptions.messages;
2714
- return {
2715
- ...(zone !== undefined && { zone }),
2716
- ...(messages !== undefined && { messages }),
2717
- };
2464
+ return (0, clocks_js_1.agentTimeAnswerContext)(state, this.timeOptions);
2718
2465
  }
2719
2466
  /**
2720
2467
  * The findings ledger for a checkpoint (9.101.0) — `foldedSpansOf`'s twin:
@@ -2758,9 +2505,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2758
2505
  *
2759
2506
  * @internal
2760
2507
  */
2761
- conversationOwner() {
2508
+ conversationOwner(values) {
2762
2509
  return {
2763
- ...(this.lastRunIdentity !== undefined && { identity: this.lastRunIdentity }),
2510
+ ...(values.identity !== undefined && { identity: values.identity }),
2764
2511
  ...(this.explicitId !== undefined && { agentId: this.explicitId }),
2765
2512
  };
2766
2513
  }
@@ -2787,12 +2534,12 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2787
2534
  *
2788
2535
  * @internal
2789
2536
  */
2790
- applyContinuation(cp, door, appendsUserTurn) {
2537
+ applyContinuation(values, cp, door, appendsUserTurn) {
2791
2538
  (0, runCheckpoint_js_1.assertContinuable)(cp, this.explicitId, door);
2792
2539
  (0, verificationCheckpoint_js_1.requireVerificationOnResume)(cp, false);
2793
2540
  if (this.negativeClaimsConfig === undefined && (0, checkpoint_js_1.negativeCheckpointOf)(cp) !== undefined)
2794
2541
  throw new TypeError('Continuation requires the negative-claims setting used by the recording agent.');
2795
- this.pendingResumeHistory = {
2542
+ values.pendingResumeHistory = {
2796
2543
  history: cp.history,
2797
2544
  appendsUserTurn,
2798
2545
  // The turn the stored history ends on (honesty layers) — seed continues
@@ -2803,36 +2550,30 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2803
2550
  // The folded spans beside it. A conversation stored before 8.2 has none,
2804
2551
  // and `undefined` is the right answer there — it means "this conversation
2805
2552
  // recorded no folds", which is exactly true.
2806
- this.pendingResumeFolded = cp.folded;
2553
+ values.pendingResumeFolded = cp.folded;
2807
2554
  // The findings ledger beside it (9.101.0). Stashed whether or not THIS
2808
2555
  // agent is armed: seed restores it only under `.findings()` (the deps
2809
2556
  // gate), and an unarmed continuation consumes and ignores it — exactly
2810
2557
  // like a `folded` field on an agent that never folds.
2811
- this.pendingResumeFindingsLedger = cp.findingsLedger;
2558
+ values.pendingResumeFindingsLedger = cp.findingsLedger;
2812
2559
  // The conversation's skill cursor (SG-C). Stashed unconditionally —
2813
2560
  // whether it is HONORED is seed's `restoreSkillCursor` gate, which reads
2814
2561
  // the mounted graph's `continuity` declaration; a checkpoint written by a
2815
2562
  // continuity graph and continued on a `'turn'` one is consumed and
2816
2563
  // ignored, exactly like a `folded` field on an agent that never folds.
2817
- this.pendingResumeSkillCursor = cp.skillCursor;
2564
+ values.pendingResumeSkillCursor = cp.skillCursor;
2818
2565
  // Same failed request retains its single repair budget. A new user turn
2819
2566
  // receives neither the rejected draft nor a spent retry allowance.
2820
- this.pendingEvidenceRecovery =
2567
+ values.pendingEvidenceRecovery =
2821
2568
  !appendsUserTurn && cp.evidenceRecovery !== undefined
2822
2569
  ? structuredClone(cp.evidenceRecovery)
2823
2570
  : undefined;
2824
2571
  }
2825
- /** One turn at a time — see `RunInFlightError`. @internal */
2826
- assertNotRunning(door) {
2827
- if (this.inFlightRunId !== undefined) {
2828
- throw new conversation_js_3.RunInFlightError(door, this.id, this.inFlightRunId);
2829
- }
2830
- }
2831
2572
  /** A person's unanswered question outranks a new message — see
2832
2573
  * `PendingQuestionError`. @internal */
2833
- assertNoPendingQuestion(door) {
2834
- if (this.pendingQuestion !== undefined) {
2835
- throw new conversation_js_3.PendingQuestionError(door, this.pendingQuestion);
2574
+ assertNoPendingQuestion(door, values) {
2575
+ if (values?.pendingQuestion !== undefined) {
2576
+ throw new conversation_js_3.PendingQuestionError(door, values.pendingQuestion);
2836
2577
  }
2837
2578
  }
2838
2579
  /**
@@ -2845,17 +2586,14 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2845
2586
  *
2846
2587
  * @internal
2847
2588
  */
2848
- recordPendingQuestion(outcome) {
2589
+ recordPendingQuestion(values, outcome) {
2849
2590
  if (typeof outcome === 'string') {
2850
- this.pendingQuestion = undefined;
2591
+ values.pauseOutcome = undefined;
2592
+ values.pendingQuestion = undefined;
2851
2593
  return;
2852
2594
  }
2853
- const data = outcome.pauseData;
2854
- this.pendingQuestion = {
2855
- ...(typeof data?.toolName === 'string' && { toolName: data.toolName }),
2856
- ...(typeof data?.toolCallId === 'string' && { toolCallId: data.toolCallId }),
2857
- ...(typeof data?.question === 'string' && { question: data.question }),
2858
- };
2595
+ values.pauseOutcome = outcome;
2596
+ values.pendingQuestion = (0, pauseOwnership_js_1.pendingQuestionOf)(outcome.pauseData);
2859
2597
  }
2860
2598
  /**
2861
2599
  * Hand the `.selfExplain()` binding to the agent that owns it.
@@ -2923,21 +2661,21 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2923
2661
  * is withheld here for that reason — `sessionId` beside it is the fact the
2924
2662
  * transport really delivered.
2925
2663
  */
2926
- toolRunFacts() {
2664
+ toolRunFacts(run) {
2927
2665
  return {
2928
- runContext: { ...this.currentRunContext },
2929
- runId: this.currentRunContext.runId,
2930
- ...(this.currentRunContext.sessionId !== undefined && {
2931
- sessionId: this.currentRunContext.sessionId,
2666
+ runContext: { ...run.context },
2667
+ runId: run.context.runId,
2668
+ ...(run.context.sessionId !== undefined && {
2669
+ sessionId: run.context.sessionId,
2932
2670
  }),
2933
- ...(this.lastRunIdentity !== undefined && { identity: this.lastRunIdentity }),
2671
+ ...(run.value.identity !== undefined && { identity: run.value.identity }),
2934
2672
  };
2935
2673
  }
2936
2674
  /**
2937
- * The teardown tier, built on FIRST registration.
2675
+ * The existing teardown tier, built on first component resource admission.
2938
2676
  *
2939
- * An agent whose tools never hold a session never allocates one, and its
2940
- * terminals stay a single `undefined` check.
2677
+ * Admission precedes tool resource effects so restored owners cannot be
2678
+ * borrowed concurrently. Components without tool admission do not allocate it.
2941
2679
  */
2942
2680
  toolSessions() {
2943
2681
  if (!this.toolSessionTier) {
@@ -2972,21 +2710,25 @@ class Agent extends RunnerBase_js_1.RunnerBase {
2972
2710
  dispatcher.dispatch({
2973
2711
  type,
2974
2712
  payload,
2975
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: LATE_ARTIFACT_FACT_STAGE_ID }, runContext),
2713
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: eventStageIds_js_1.LATE_ARTIFACT_FACT_STAGE_ID }, runContext),
2976
2714
  });
2977
2715
  }
2978
2716
  emitToolSessionReport(report, origin) {
2979
2717
  const type = report.kind === 'closed'
2980
2718
  ? 'agentfootprint.tools.session_closed'
2981
2719
  : 'agentfootprint.tools.session_close_failed';
2720
+ const { kind: _kind, ...payload } = report;
2721
+ if (origin.emit !== undefined) {
2722
+ origin.emit(type, payload);
2723
+ return;
2724
+ }
2982
2725
  const dispatcher = this.getDispatcher();
2983
2726
  if (!dispatcher.hasListenersFor(type))
2984
2727
  return;
2985
- const { kind: _kind, ...payload } = report;
2986
2728
  dispatcher.dispatch({
2987
2729
  type,
2988
2730
  payload,
2989
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: TOOL_TEARDOWN_STAGE_ID }, origin.runContext ?? this.currentRunContext),
2731
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: eventStageIds_js_1.TOOL_TEARDOWN_STAGE_ID }, origin.runContext ?? { runId: 'consumer-scope', runStartMs: 0, compositionPath: [] }),
2990
2732
  });
2991
2733
  }
2992
2734
  openSkillIds() {
@@ -3036,7 +2778,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3036
2778
  return undefined;
3037
2779
  let graphMenu = this.skillGraphReachable;
3038
2780
  if (graphMenu && this.reactMode === 'classic') {
3039
- if ((0, footprintjs_2.isDevMode)()) {
2781
+ if ((0, footprintjs_1.isDevMode)()) {
3040
2782
  // eslint-disable-next-line no-console
3041
2783
  console.warn("agentfootprint Agent: read_skill's menu is built at turn 1 under " +
3042
2784
  "reactMode: 'classic', which caches the tools slot — so it lists every " +
@@ -3117,7 +2859,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3117
2859
  return async (scope) => {
3118
2860
  // The caller of THIS run: the instance's caller on its own run, the
3119
2861
  // member's run (never the instance's last caller) on a mount.
3120
- const identity = this.ownScopes.has(scope) ? this.lastRunIdentity : (0, memberRun_js_1.memberIdentityIn)(scope);
2862
+ const run = this.runExecution().forScope(scope);
2863
+ const identity = run.own ? run.value.identity : (0, memberRun_js_1.memberIdentityIn)(scope);
3121
2864
  const hidden = [];
3122
2865
  for (const id of skillIds) {
3123
2866
  let allowed = false;
@@ -3144,27 +2887,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3144
2887
  };
3145
2888
  }
3146
2889
  assertDeliverableRoles() {
3147
- const providers = (0, providerTargets_js_1.providerTargets)(this.provider, this.model, this.reliabilityConfig?.providers).map((target) => target.provider);
3148
- for (const inj of this.injections) {
3149
- for (const msg of inj.inject?.messages ?? []) {
3150
- (0, deliver_js_1.assertDeliverableRole)(providers, msg.role, `Agent injection '${inj.id}'`);
3151
- // Content, judged at the same funnel as role (8.18.0). The named
3152
- // factories refuse empty content; a hand-built Injection reached the
3153
- // delivery stage unchecked and put a contentless turn on the wire.
3154
- const content = msg.content;
3155
- if (typeof content !== 'string' || content.trim() === '') {
3156
- throw new Error((0, messagesSlotRefusal_js_1.messagesContentRefusal)({
3157
- site: `Agent injection '${inj.id}'`,
3158
- role: msg.role,
3159
- received: typeof content !== 'string'
3160
- ? content === undefined
3161
- ? 'missing'
3162
- : `a ${content === null ? 'null' : typeof content}`
3163
- : 'empty',
3164
- }));
3165
- }
3166
- }
3167
- }
2890
+ (0, injectionDelivery_js_1.assertInjectionDelivery)(this.injections, (0, providerTargets_js_1.providerTargets)(this.provider, this.model, this.reliabilityConfig?.providers).map((target) => target.provider));
3168
2891
  }
3169
2892
  /**
3170
2893
  * Refuse, at run start, a `'tool-forced'` output strategy on a provider
@@ -3232,7 +2955,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3232
2955
  `not in this release. Use { strategy: 'instruct', retries: N } on this provider — it ` +
3233
2956
  `works on every wire — or run the native strategy on a provider that declares it.`);
3234
2957
  }
3235
- createExecutor(runOptions, request) {
2958
+ prepareAgentRun(invocation, runOptions, request) {
3236
2959
  this.assertDeliverableRoles();
3237
2960
  this.assertForcedToolChoiceSupported();
3238
2961
  this.assertNativeOutputSchemaSupported();
@@ -3254,71 +2977,33 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3254
2977
  // is exactly the string an auditor must not read as "who did this".
3255
2978
  // `conversationId` is deliberately not carried: it is a thread, not a
3256
2979
  // person, and `sessionId` beside it is the fact the transport delivered.
3257
- const actor = runOptions?.identity ?? this.lastRunIdentity;
2980
+ const actor = runOptions?.identity ?? invocation.value.identity;
2981
+ invocation.value.request = request;
3258
2982
  // A fresh run starts with no evictions filed — the previous run's last
3259
2983
  // visit must not be read as this run's (`window/evictedTurns.ts`).
3260
- this.evictedTurnsHandle?.clear();
3261
- const runId = (0, RunnerBase_js_1.makeRunId)();
3262
- this.mintedRunIds.add(runId);
3263
- boundInsertionOrder(this.mintedRunIds, MAX_REMEMBERED_RUNS);
3264
2984
  const hosted = (0, servingConversation_js_1.hostedConversationOf)(runOptions);
3265
- this.servingConversation =
2985
+ invocation.value.servingConversation =
3266
2986
  sessionId !== undefined
3267
2987
  ? (0, servingConversation_js_1.sessionConversationKey)(sessionId)
3268
2988
  : hosted !== undefined
3269
2989
  ? (0, servingConversation_js_1.hostedConversationKey)(hosted)
3270
2990
  : undefined;
3271
- this.currentRunContext = {
3272
- runStartMs: Date.now(),
3273
- runId,
2991
+ const metadata = {
3274
2992
  compositionPath: [`Agent:${this.id}`],
3275
2993
  ...(correlationId !== undefined && { correlationId }),
3276
2994
  ...(traceId !== undefined && { traceId }),
3277
- // Session identity rides beside runId, not instead of it: one session
3278
- // produces many runs, and an event needs to say which of each it is.
3279
2995
  ...(sessionId !== undefined && { sessionId }),
3280
2996
  ...(actor?.principal !== undefined && { principal: actor.principal }),
3281
2997
  ...(actor?.tenant !== undefined && { tenant: actor.tenant }),
3282
2998
  };
3283
- const getRunCtx = () => this.currentRunContext;
2999
+ const getRunCtx = () => invocation.context();
3284
3000
  // The run's redaction (`src/redaction/`): this agent's `redact` joined
3285
3001
  // with any policy the caller handed down for this run (a tool's
3286
3002
  // `ctx.redact`). Opened for EVERY run — with no policy the serving is the
3287
3003
  // identity, but the stages' scopes still feed the real-value path the
3288
3004
  // crash checkpoint and the window's meter read.
3289
- const redaction = this.openRunRedaction(runOptions?.redact, getRunCtx);
3290
- // Reuse the cached chart built at constructor time.
3291
- // The Agent's executor dials: readTracking (#18/#14, snapshot stageReads),
3292
- // commitValues (#13c-B, commit-log value encoding) and writeProvenance
3293
- // (#P1, per-write read provenance — the exact-dataflow debugging dial).
3294
- const spec = this.getSpec();
3295
- // Every scope THIS executor makes is marked as the agent's own, so a stage
3296
- // can tell its own run from a mount in another runner's executor
3297
- // (`memberRun.ts`) — per scope, never by instance state.
3298
- const scopeFactory = redaction.scopeFactoryFor(spec);
3299
- const ownScopes = this.ownScopes;
3300
- const scopeRequests = this.scopeRequests;
3301
- const executor = new footprintjs_1.FlowChartExecutor(spec, {
3302
- readTracking: this.readTracking,
3303
- commitValues: this.commitValues,
3304
- writeProvenance: this.writeProvenance,
3305
- scopeFactory: (...args) => {
3306
- const scope = scopeFactory(...args);
3307
- if (scope !== null && typeof scope === 'object') {
3308
- ownScopes.add(scope);
3309
- // THIS executor's request, bound to the scope for its whole life.
3310
- if (request !== undefined)
3311
- scopeRequests.set(scope, request);
3312
- }
3313
- return scope;
3314
- },
3315
- });
3316
- redaction.applyTo(executor);
3317
- // Enable structured narrative so `getLastNarrativeEntries()` can
3318
- // hand a populated array to consumer Trace views (ExplainableShell).
3319
- // Cheap when no consumer reads it; the recorder accumulates only.
3320
- executor.enableNarrative();
3321
- this.lastExecutor = executor;
3005
+ const redaction = this.prepareRunRedaction(invocation, runOptions?.redact);
3006
+ const attachments = redaction.recorders.map((recorder) => ({ recorder }));
3322
3007
  const dispatcher = this.getDispatcher();
3323
3008
  // RFC-001 Block 10 — observer delivery tier. With 'deferred', every
3324
3009
  // bridge below is attached onto footprintjs's bounded capture queue
@@ -3330,35 +3015,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3330
3015
  ? { delivery: 'deferred', ...this.observerDeliveryOptions }
3331
3016
  : undefined;
3332
3017
  const attachObserver = (rec) => {
3333
- if (deferredOpts)
3334
- executor.attachCombinedRecorder(rec, deferredOpts);
3335
- else
3336
- executor.attachCombinedRecorder(rec);
3018
+ attachments.push({ recorder: rec, ...(deferredOpts && { options: deferredOpts }) });
3337
3019
  };
3338
3020
  attachObserver(new ContextRecorder_js_1.ContextRecorder({ dispatcher, getRunContext: getRunCtx, realWrites: redaction }));
3339
- // Evidence bridge (#5): harvest decisions/toolCalls/tokens for causal snapshots.
3340
- // ALWAYS INLINE — never routed through the deferred queue: the memory
3341
- // write stage consumes its accumulators MID-run (`collect()` via
3342
- // `evidenceSource`, mountMemoryPipeline). Deferred delivery would run
3343
- // `collect()` before the queue flushed the turn's tool/token/decision
3344
- // events, persisting an incomplete causal snapshot.
3345
- if (this.causalEvidence) {
3346
- // Its emits arrive on the real-value path (constructor); the executor
3347
- // feeds it the flow channel's decisions and the per-run reset only.
3348
- const evidence = this.causalEvidence;
3349
- executor.attachCombinedRecorder({
3350
- id: evidence.id,
3351
- onDecision: (event) => evidence.onDecision(event),
3352
- onSelected: (event) => evidence.onSelected(event),
3353
- clear: () => evidence.clear(),
3354
- });
3355
- }
3356
- // Compaction's instrument. ALWAYS INLINE, for the same reason the evidence
3357
- // bridge is: the compaction stage reads it MID-run, at the loop head, to
3358
- // decide whether this iteration's window is over budget. A measurement
3359
- // delivered one beat behind would be a measurement of the wrong window.
3360
- if (this.compactionMeterHandle) {
3361
- executor.attachCombinedRecorder(this.compactionMeterHandle);
3021
+ // Computational observers belong to native component setup, always inline.
3022
+ if (this.windowStrategy !== undefined) {
3362
3023
  // Folds speak the context vocabulary consumers already subscribe to
3363
3024
  // (`context.evicted` / `context.budget_pressure`) — no new event types.
3364
3025
  // ContextRecorder only dispatches those from writes INSIDE a slot
@@ -3515,17 +3176,30 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3515
3176
  // `{ id, delivery: 'inline', ...hooks }` stays inline under an
3516
3177
  // observerDelivery: 'deferred' agent, and vice versa.
3517
3178
  if (r.delivery !== undefined)
3518
- executor.attachCombinedRecorder(r);
3179
+ attachments.push({ recorder: r });
3519
3180
  else
3520
3181
  attachObserver(r);
3521
3182
  }
3522
- // LAST, so the manifest describes a fully-wired run — and so it is the
3523
- // first event of this runId that any listener sees.
3524
- this.emitRunManifest();
3525
- // …then the declared skill map (9.50.0), so a recording opens with the
3526
- // arm's configuration and the author's topology before any stage event.
3527
- this.emitSkillGraphDeclared();
3528
- return executor;
3183
+ return {
3184
+ setup: {
3185
+ redaction: redaction.recordPolicy,
3186
+ narrative: {},
3187
+ attachments,
3188
+ onOrigin: () => {
3189
+ // Native is the only ID/clock authority. Remaining domain consumers
3190
+ // still migrate to captured component values; no private ID is minted.
3191
+ this.bindRunServing(invocation);
3192
+ this.emitRunManifest(invocation.context());
3193
+ this.emitSkillGraphDeclared(invocation.context());
3194
+ },
3195
+ },
3196
+ binding: {
3197
+ metadata,
3198
+ bindScope: (scope, context) => {
3199
+ redaction.bindScope(scope, context);
3200
+ },
3201
+ },
3202
+ };
3529
3203
  }
3530
3204
  /**
3531
3205
  * File the run-configuration manifest (9.41.0) — which adapters and
@@ -3553,8 +3227,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3553
3227
  * with `'*'` before the run starts, so every recording carries one.
3554
3228
  */
3555
3229
  /** Fresh per-run ledger — see AgentOptions.integrityPosture (9.60.0). */
3556
- beginIntegrityLedger() {
3557
- this.integrityLedgerHolder.current = (0, lifecycle_js_1.beginIntegrityRun)({
3230
+ beginIntegrityLedger(values) {
3231
+ values.integrityLedger.current = (0, lifecycle_js_1.beginIntegrityRun)({
3558
3232
  wire: true,
3559
3233
  composeInvariant: this.mapsPlan !== undefined,
3560
3234
  dangling: this.integrityDanglingPresent,
@@ -3580,11 +3254,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3580
3254
  * uncaught. Called on the SUCCESS path before the recording files, so the
3581
3255
  * failure is the run's result, never a masked afterthought.
3582
3256
  */
3583
- assertIntegrityAlive() {
3257
+ assertIntegrityAlive(invocation) {
3584
3258
  if (this.integrityPosture !== 'dev')
3585
3259
  return;
3586
- this.integrityLedgerHolder.current?.assertAlive({
3587
- workExisted: this.integrityWorkExisted(),
3260
+ invocation.value.integrityLedger.current?.assertAlive({
3261
+ workExisted: this.integrityWorkExisted(invocation),
3588
3262
  });
3589
3263
  }
3590
3264
  /**
@@ -3599,8 +3273,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3599
3273
  * circular: an unhooked check would report "no work existed" and silence
3600
3274
  * the very alarm it should be tripping.
3601
3275
  */
3602
- integrityWorkExisted() {
3603
- const state = this.liveSnapshot()?.sharedState;
3276
+ integrityWorkExisted(invocation) {
3277
+ const state = invocation.view.snapshot()?.sharedState;
3604
3278
  return state !== undefined && state.llmLatestContent !== undefined;
3605
3279
  }
3606
3280
  /**
@@ -3609,9 +3283,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3609
3283
  * before the recording stops. Listener-gated like every typed event, and
3610
3284
  * deliberately throw-proof: accounting must never change a run's outcome.
3611
3285
  */
3612
- fileIntegrityDisposition() {
3613
- const ledger = this.integrityLedgerHolder.current;
3614
- this.integrityLedgerHolder.current = undefined;
3286
+ fileIntegrityDisposition(invocation) {
3287
+ const ledger = invocation.value.integrityLedger.current;
3288
+ invocation.value.integrityLedger.current = undefined;
3615
3289
  if (ledger === undefined)
3616
3290
  return;
3617
3291
  try {
@@ -3623,17 +3297,17 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3623
3297
  type,
3624
3298
  payload: {
3625
3299
  posture: this.integrityPosture,
3626
- workExisted: this.integrityWorkExisted(),
3300
+ workExisted: this.integrityWorkExisted(invocation),
3627
3301
  rows: ledger.report(),
3628
3302
  },
3629
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: INTEGRITY_DISPOSITION_STAGE_ID }, this.currentRunContext),
3303
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: eventStageIds_js_1.INTEGRITY_DISPOSITION_STAGE_ID }, invocation.context()),
3630
3304
  });
3631
3305
  }
3632
3306
  catch {
3633
3307
  // Recorder/dispatcher failures never abort a run — the house rule.
3634
3308
  }
3635
3309
  }
3636
- emitRunManifest() {
3310
+ emitRunManifest(context) {
3637
3311
  const type = 'agentfootprint.agent.run_configured';
3638
3312
  const dispatcher = this.getDispatcher();
3639
3313
  if (!dispatcher.hasListenersFor(type))
@@ -3684,7 +3358,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3684
3358
  },
3685
3359
  }),
3686
3360
  }),
3687
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: RUN_MANIFEST_STAGE_ID }, this.currentRunContext),
3361
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: eventStageIds_js_1.RUN_MANIFEST_STAGE_ID }, context),
3688
3362
  });
3689
3363
  }
3690
3364
  /**
@@ -3703,7 +3377,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3703
3377
  * No graph, or a graph that could not state its map ⇒ no event — absent,
3704
3378
  * never guessed.
3705
3379
  */
3706
- emitSkillGraphDeclared() {
3380
+ emitSkillGraphDeclared(context) {
3707
3381
  if (this.skillGraphDeclared === undefined)
3708
3382
  return;
3709
3383
  const type = 'agentfootprint.skill.graph_declared';
@@ -3713,7 +3387,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3713
3387
  dispatcher.dispatch({
3714
3388
  type,
3715
3389
  payload: this.skillGraphDeclared,
3716
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: GRAPH_DECLARED_STAGE_ID }, this.currentRunContext),
3390
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: eventStageIds_js_1.GRAPH_DECLARED_STAGE_ID }, context),
3717
3391
  });
3718
3392
  }
3719
3393
  /**
@@ -3737,9 +3411,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3737
3411
  * ```
3738
3412
  */
3739
3413
  drainObservers(opts) {
3740
- if (!this.lastExecutor)
3414
+ const view = this.runExecution().view();
3415
+ if (view === undefined)
3741
3416
  return Promise.resolve({ done: 0, failed: 0, pending: 0 });
3742
- return this.lastExecutor.drainObservers(opts);
3417
+ return view.drainObservers(opts);
3743
3418
  }
3744
3419
  /**
3745
3420
  * Did the last turn stop because a LIMIT cut it short — and if so, which?
@@ -3985,15 +3660,16 @@ class Agent extends RunnerBase_js_1.RunnerBase {
3985
3660
  * ```
3986
3661
  */
3987
3662
  async assessment(declarations) {
3988
- const snapshot = this.liveSnapshot();
3663
+ const selected = this.runExecution().selected();
3664
+ const snapshot = selected?.view.snapshot();
3989
3665
  if (snapshot === undefined)
3990
3666
  return undefined;
3991
3667
  // Settled before the fold, which cannot tell a crash from its committed state: an answer
3992
3668
  // this run RETURNED (`lastRunAnswer`, cleared at every run's start), or a pause — the fold
3993
3669
  // reads that one from the committed state itself. Read BEFORE the import resolves, so a
3994
3670
  // run started meanwhile cannot change which run is assessed.
3995
- const paused = this.lastExecutor?.isPaused() === true;
3996
- if (!paused && this.lastRunAnswer === undefined)
3671
+ const paused = selected?.view.isPaused() === true;
3672
+ if (!paused && selected?.value.answer === undefined)
3997
3673
  return undefined;
3998
3674
  // Loaded on first use, off the default graph (the findings/peel.ts precedent).
3999
3675
  // The live state, read as values — never as a served record (`assess.ts` · `assessLive`).
@@ -4128,11 +3804,13 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4128
3804
  }
4129
3805
  return undefined;
4130
3806
  }
4131
- finalizeResult(executor, result) {
4132
- const paused = this.detectPause(executor, result);
3807
+ finalizeResult(invocation, result) {
3808
+ const paused = this.detectPause(invocation, result);
4133
3809
  if (paused)
4134
3810
  return paused;
4135
- const snap = executor.getSnapshot();
3811
+ const snap = invocation.view.snapshot();
3812
+ if (snap === undefined)
3813
+ throw new TypeError('The native execution has no ready snapshot');
4136
3814
  const state = snap.sharedState;
4137
3815
  const refusal = this.refusalVerdictOf(state);
4138
3816
  if (refusal !== undefined) {
@@ -4148,7 +3826,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4148
3826
  stage: '__output_admission__',
4149
3827
  scope: 'run',
4150
3828
  },
4151
- meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: '__output_admission__' }, this.currentRunContext),
3829
+ meta: (0, eventMeta_js_1.buildEventMeta)({ runtimeStageId: '__output_admission__' }, invocation.context()),
4152
3830
  });
4153
3831
  }
4154
3832
  // The verdict was decoded from the LIVE state above; the snapshot a
@@ -4169,10 +3847,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4169
3847
  // `'pause'` this is unreachable for the first block (the run pauses and
4170
3848
  // `detectPause` returned above); it still fires if a RESUME found consent
4171
3849
  // ungranted and the model then finished the turn on its own.
4172
- if (this.consentOutstanding.size > 0) {
4173
- const [record] = [...this.consentOutstanding.values()];
3850
+ if (invocation.value.consentOutstanding.size > 0) {
3851
+ const [record] = [...invocation.value.consentOutstanding.values()];
4174
3852
  if (record) {
4175
- this.consentOutstanding.clear();
3853
+ invocation.value.consentOutstanding.clear();
4176
3854
  throw new CredentialConsentRequiredError_js_1.CredentialConsentRequiredError(record);
4177
3855
  }
4178
3856
  }
@@ -4253,163 +3931,177 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4253
3931
  // keep them. Negative-claim observations also persist independently of those
4254
3932
  // layers. Still value-conditional inside seed (only when rows exist).
4255
3933
  let ledgerRestoreArmed = this.findingsOptions !== undefined || this.negativeClaimsConfig !== undefined;
4256
- const consumeResumeLedger = () => {
4257
- const l = this.pendingResumeFindingsLedger;
4258
- this.pendingResumeFindingsLedger = undefined;
4259
- return l;
4260
- };
4261
- const seed = (0, seed_js_1.buildSeedStage)({
4262
- maxIterations,
4263
- // The forced-output tool's name (9.88.0) — a build-time constant, put on
4264
- // the record once so a rebuild can name it without reading a receipt.
4265
- ...(this.outputEnforcement?.schemaTool !== undefined && {
4266
- forcedOutputToolName: this.outputEnforcement.schemaTool.name,
4267
- }),
4268
- cachingDisabled,
4269
- ...(costBudget !== undefined && { costBudgetOnExceed: costBudget.onExceed }),
4270
- get toolSchemas() {
4271
- return toolSchemasResolved;
4272
- },
4273
- get toolWantsByName() {
4274
- return seededToolWants;
4275
- },
4276
- get ruledTools() {
4277
- return seededRuledTools;
4278
- },
4279
- get honestyLayers() {
4280
- return seededHonestyLayers;
4281
- },
4282
- // The time layer's clock: the draft `run()` read (refusing a run with no
4283
- // zone), stamped by seed as the turn's one `clock` row. Absent → the
4284
- // deps object seed always had.
4285
- // The caller's clock belongs to the agent's OWN run: a member (another
4286
- // runner's executor) gets the builder's fallback, never a concurrent
4287
- // direct caller's `time` (`memberRun.ts`).
4288
- ...(this.timeOptions !== undefined && {
4289
- timeClock: (scope) => this.ownScopes.has(scope)
4290
- ? this.seedClockDraft()
4291
- : (0, clock_js_1.draftClock)(undefined, this.timeOptions ?? {}),
4292
- }),
4293
- // The time layer's reader: seed reads the person's words once per turn,
4294
- // after the clock. Absent → nothing is read.
4295
- ...(this.timeOptions?.reader !== undefined &&
4296
- this.timeOptions.policy !== undefined && {
4297
- timeReader: { reader: this.timeOptions.reader, policy: this.timeOptions.policy },
4298
- }),
4299
- // Declared sources (honesty layer 2): the seed twin plants `_findings.from`
4300
- // on ruled tools, and the run's `messageFrom` constant is written — only
4301
- // under the arm (refused at build without the inputs layer).
4302
- ...(this.argumentSourcesArmed === true && { argumentSources: true }),
4303
- // The answer check's tool-call ledger — value-conditional, so an agent
4304
- // without answer validation or negative claims keeps its prior shape.
4305
- ...((this.answerValidationConfig !== undefined ||
4306
- this.negativeClaimsConfig !== undefined) && { toolCallLedger: true }),
4307
- ...(this.negativeClaimsConfig !== undefined && { negativeClaimsArmed: true }),
4308
- get consumePendingResumeFindingsLedger() {
4309
- return ledgerRestoreArmed ? consumeResumeLedger : undefined;
4310
- },
4311
- consumePendingResumeHistory: () => {
4312
- const h = this.pendingResumeHistory;
4313
- this.pendingResumeHistory = undefined;
4314
- return h;
4315
- },
4316
- ...(this.evidenceGate !== undefined &&
4317
- this.evidenceGate.posture !== 'assist' && {
4318
- consumePendingEvidenceRecovery: () => {
4319
- const recovery = this.pendingEvidenceRecovery;
4320
- this.pendingEvidenceRecovery = undefined;
4321
- return recovery;
3934
+ const seedFor = (run) => {
3935
+ const consumeResumeLedger = () => {
3936
+ const l = run.value.pendingResumeFindingsLedger;
3937
+ run.value.pendingResumeFindingsLedger = undefined;
3938
+ return l;
3939
+ };
3940
+ return (0, seed_js_1.buildSeedStage)({
3941
+ maxIterations,
3942
+ // The forced-output tool's name (9.88.0) — a build-time constant, put on
3943
+ // the record once so a rebuild can name it without reading a receipt.
3944
+ ...(this.outputEnforcement?.schemaTool !== undefined && {
3945
+ forcedOutputToolName: this.outputEnforcement.schemaTool.name,
3946
+ }),
3947
+ cachingDisabled,
3948
+ ...(costBudget !== undefined && { costBudgetOnExceed: costBudget.onExceed }),
3949
+ get toolSchemas() {
3950
+ return toolSchemasResolved;
4322
3951
  },
4323
- }),
4324
- consumePendingResumeFolded: () => {
4325
- const f = this.pendingResumeFolded;
4326
- this.pendingResumeFolded = undefined;
4327
- return f;
4328
- },
4329
- // The findings ledger (9.101.0): the arm, the serve mode it puts on the
4330
- // record (the `forcedOutputToolName` precedent — a build-time constant
4331
- // the rebuild reads instead of the receipt), and the continued
4332
- // conversation's rows, all under the one gate — an unarmed agent hands
4333
- // seed exactly the deps object it always did.
4334
- ...(this.findingsOptions !== undefined && {
4335
- findings: true,
4336
- findingsServe: this.findingsOptions.serve ?? 'ledger-and-facts',
4337
- findingsContextBytes: this.findingsOptions.maxContextBytes,
4338
- // The answer-turn ask (9.103.0): VALUE-conditional inside the arm —
4339
- // the default `'none'` threads nothing and writes no key.
4340
- ...(this.findingsOptions.answerAsk === 'quote-facts' && {
4341
- findingsAnswerAsk: 'quote-facts',
3952
+ get toolWantsByName() {
3953
+ return seededToolWants;
3954
+ },
3955
+ get ruledTools() {
3956
+ return seededRuledTools;
3957
+ },
3958
+ get honestyLayers() {
3959
+ return seededHonestyLayers;
3960
+ },
3961
+ // The time layer's clock: the draft `run()` read (refusing a run with no
3962
+ // zone), stamped by seed as the turn's one `clock` row. Absent → the
3963
+ // deps object seed always had.
3964
+ // The caller's clock belongs to the agent's OWN run: a member (another
3965
+ // runner's executor) gets the builder's fallback, never a concurrent
3966
+ // direct caller's `time` (`memberRun.ts`).
3967
+ ...(this.timeOptions !== undefined && {
3968
+ timeClock: () => run.own
3969
+ ? this.seedClockDraft(run.value)
3970
+ : (0, clock_js_1.draftClock)(undefined, this.timeOptions ?? {}),
4342
3971
  }),
4343
- }),
4344
- // The declared ontology (9.106.0): the whole frozen map, which seed
4345
- // writes ONCE as the run constant `ontology` — the `findingsServe`
4346
- // precedent, a build-time fact the rebuild reads from the RECORD. An
4347
- // unarmed agent hands seed exactly the deps object it always did.
4348
- ...(this.ontology !== undefined && {
4349
- ontology: this.ontology,
4350
- ontologyTools: () => this.ontologyTools,
4351
- }),
4352
- // The conversation's inherited skill cursor (SG-C). Consumed (cleared)
4353
- // on every run; HONORED only when the mounted graph declared
4354
- // `continuity: 'conversation'` — the same one-option-one-behavior gate
4355
- // the write side (`checkpoint()`) applies.
4356
- consumePendingResumeSkillCursor: () => {
4357
- const c = this.pendingResumeSkillCursor;
4358
- this.pendingResumeSkillCursor = undefined;
4359
- return c;
4360
- },
4361
- restoreSkillCursor: this.skillGraphCascade?.continuity === 'conversation',
4362
- // Steps (9.18.0): gate the per-run stepPointer/stepNudgeSpent reset on
4363
- // the feature, so every other agent seeds exactly the keys it always did.
4364
- ...(stepPlanFor !== undefined && { hasSteps: true }),
4365
- // Escalation (9.19.0): same gate discipline — the per-run counter/flip
4366
- // reset exists only when the policy does (de-escalation IS the seed).
4367
- ...(this.skillBrains?.escalation !== undefined && { hasEscalation: true }),
4368
- // The evidence gate's one bounded revision (9.35.0) — a per-turn budget,
4369
- // reset here. Only a posture that can revise writes the key.
4370
- ...((this.typedNegativeClaimsConfig !== undefined ||
4371
- (this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
4372
- hasEvidenceRevision: true,
4373
- }),
4374
- // Under an enforcing answer validation the tools stay off for a run
4375
- // resumed after its revision was asked (`toolsOffAfterRevision`).
4376
- ...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
4377
- getCurrentRunId: () => this.currentRunContext?.runId,
4378
- // WHO this run is for, when the caller named nobody (9.10.0). Seed uses
4379
- // it for exactly one rung of the identity ladder — see `seedFrom` — and
4380
- // an explicit identity outranks it there. Read through an accessor for
4381
- // the same reason the runId is: the chart is built once, and this
4382
- // changes every run.
4383
- getCurrentSessionId: () => this.currentRunContext?.sessionId,
4384
- // Whether this stage runs in THIS agent's own executor, or inside another
4385
- // runner's (a composition, a chart a caller built) — where the accessors
4386
- // above describe some other run (`memberRun.ts`). Asked per scope.
4387
- isOwnRun: (scope) => this.ownScopes.has(scope),
4388
- // WHICH TURN THIS IS (9.6.0). Only memories that WRITE the conversation
4389
- // are consulted: they are the ones whose entry ids are turn-stamped, and
4390
- // a corpus (`.rag(...)`, which reads under its own namespace) has no
4391
- // turns at all. Empty list → seed stays synchronous and makes no store
4392
- // call, so an agent without memory is unchanged.
4393
- ...(conversationStores.length > 0 && { conversationStores }),
4394
- // The `'input'` half of the message chain, run BEFORE `userMessage` and
4395
- // `history` are committed — see SeedStageDeps.messageMiddleware.
4396
- ...(this.messageMiddleware.length > 0 && { messageMiddleware: this.messageMiddleware }),
4397
- // `.configure()` — seed is where run-level facts are decided and
4398
- // committed, so the resolver rides that commit. The closure supplies
4399
- // the build-time defaults so a resolver can decide RELATIVE to them
4400
- // ("upgrade the model when the message is long") instead of having to
4401
- // restate them.
4402
- ...(this.runConfigFn && {
4403
- resolveRunConfig: (input) => {
4404
- const ctx = {
4405
- message: input.message,
4406
- ...(input.identity !== undefined && { identity: input.identity }),
4407
- runId: this.currentRunContext?.runId ?? 'unknown',
4408
- defaults: { model, instructions: systemPromptValue },
4409
- };
4410
- return this.runConfigFn?.(ctx);
3972
+ // The time layer's reader: seed reads the person's words once per turn,
3973
+ // after the clock. Absent → nothing is read.
3974
+ ...(this.timeOptions?.reader !== undefined &&
3975
+ this.timeOptions.policy !== undefined && {
3976
+ timeReader: { reader: this.timeOptions.reader, policy: this.timeOptions.policy },
3977
+ }),
3978
+ // Declared sources (honesty layer 2): the seed twin plants `_findings.from`
3979
+ // on ruled tools, and the run's `messageFrom` constant is written — only
3980
+ // under the arm (refused at build without the inputs layer).
3981
+ ...(this.argumentSourcesArmed === true && { argumentSources: true }),
3982
+ // The answer check's tool-call ledger — value-conditional, so an agent
3983
+ // without answer validation or negative claims keeps its prior shape.
3984
+ ...((this.answerValidationConfig !== undefined ||
3985
+ this.negativeClaimsConfig !== undefined) && { toolCallLedger: true }),
3986
+ ...(this.negativeClaimsConfig !== undefined && { negativeClaimsArmed: true }),
3987
+ get consumePendingResumeFindingsLedger() {
3988
+ return ledgerRestoreArmed ? consumeResumeLedger : undefined;
4411
3989
  },
4412
- }),
3990
+ consumePendingResumeHistory: () => {
3991
+ const h = run.value.pendingResumeHistory;
3992
+ run.value.pendingResumeHistory = undefined;
3993
+ return h;
3994
+ },
3995
+ ...(this.evidenceGate !== undefined &&
3996
+ this.evidenceGate.posture !== 'assist' && {
3997
+ consumePendingEvidenceRecovery: () => {
3998
+ const recovery = run.value.pendingEvidenceRecovery;
3999
+ run.value.pendingEvidenceRecovery = undefined;
4000
+ return recovery;
4001
+ },
4002
+ }),
4003
+ consumePendingResumeFolded: () => {
4004
+ const f = run.value.pendingResumeFolded;
4005
+ run.value.pendingResumeFolded = undefined;
4006
+ return f;
4007
+ },
4008
+ // The findings ledger (9.101.0): the arm, the serve mode it puts on the
4009
+ // record (the `forcedOutputToolName` precedent — a build-time constant
4010
+ // the rebuild reads instead of the receipt), and the continued
4011
+ // conversation's rows, all under the one gate — an unarmed agent hands
4012
+ // seed exactly the deps object it always did.
4013
+ ...(this.findingsOptions !== undefined && {
4014
+ findings: true,
4015
+ findingsServe: this.findingsOptions.serve ?? 'ledger-and-facts',
4016
+ findingsContextBytes: this.findingsOptions.maxContextBytes,
4017
+ // The answer-turn ask (9.103.0): VALUE-conditional inside the arm —
4018
+ // the default `'none'` threads nothing and writes no key.
4019
+ ...(this.findingsOptions.answerAsk === 'quote-facts' && {
4020
+ findingsAnswerAsk: 'quote-facts',
4021
+ }),
4022
+ }),
4023
+ // The declared ontology (9.106.0): the whole frozen map, which seed
4024
+ // writes ONCE as the run constant `ontology` — the `findingsServe`
4025
+ // precedent, a build-time fact the rebuild reads from the RECORD. An
4026
+ // unarmed agent hands seed exactly the deps object it always did.
4027
+ ...(this.ontology !== undefined && {
4028
+ ontology: this.ontology,
4029
+ ontologyTools: () => this.ontologyTools,
4030
+ }),
4031
+ // The conversation's inherited skill cursor (SG-C). Consumed (cleared)
4032
+ // on every run; HONORED only when the mounted graph declared
4033
+ // `continuity: 'conversation'` — the same one-option-one-behavior gate
4034
+ // the write side (`checkpoint()`) applies.
4035
+ consumePendingResumeSkillCursor: () => {
4036
+ const c = run.value.pendingResumeSkillCursor;
4037
+ run.value.pendingResumeSkillCursor = undefined;
4038
+ return c;
4039
+ },
4040
+ restoreSkillCursor: this.skillGraphCascade?.continuity === 'conversation',
4041
+ // Steps (9.18.0): gate the per-run stepPointer/stepNudgeSpent reset on
4042
+ // the feature, so every other agent seeds exactly the keys it always did.
4043
+ ...(stepPlanFor !== undefined && { hasSteps: true }),
4044
+ // Escalation (9.19.0): same gate discipline — the per-run counter/flip
4045
+ // reset exists only when the policy does (de-escalation IS the seed).
4046
+ ...(this.skillBrains?.escalation !== undefined && { hasEscalation: true }),
4047
+ // The evidence gate's one bounded revision (9.35.0) — a per-turn budget,
4048
+ // reset here. Only a posture that can revise writes the key.
4049
+ ...((this.typedNegativeClaimsConfig !== undefined ||
4050
+ (this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
4051
+ hasEvidenceRevision: true,
4052
+ }),
4053
+ // Under an enforcing answer validation the tools stay off for a run
4054
+ // resumed after its revision was asked (`toolsOffAfterRevision`).
4055
+ ...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
4056
+ getCurrentRunId: () => run.context.runId,
4057
+ // WHO this run is for, when the caller named nobody (9.10.0). Seed uses
4058
+ // it for exactly one rung of the identity ladder — see `seedFrom` — and
4059
+ // an explicit identity outranks it there. Read through an accessor for
4060
+ // the same reason the runId is: the chart is built once, and this
4061
+ // changes every run.
4062
+ getCurrentSessionId: () => run.context.sessionId,
4063
+ // Whether this stage runs in THIS agent's own executor, or inside another
4064
+ // runner's (a composition, a chart a caller built) — where the accessors
4065
+ // above describe some other run (`memberRun.ts`). Asked per scope.
4066
+ isOwnRun: () => run.own,
4067
+ // WHICH TURN THIS IS (9.6.0). Only memories that WRITE the conversation
4068
+ // are consulted: they are the ones whose entry ids are turn-stamped, and
4069
+ // a corpus (`.rag(...)`, which reads under its own namespace) has no
4070
+ // turns at all. Empty list → seed stays synchronous and makes no store
4071
+ // call, so an agent without memory is unchanged.
4072
+ ...(conversationStores.length > 0 && { conversationStores }),
4073
+ // The `'input'` half of the message chain, run BEFORE `userMessage` and
4074
+ // `history` are committed — see SeedStageDeps.messageMiddleware.
4075
+ ...(this.messageMiddleware.length > 0 && { messageMiddleware: this.messageMiddleware }),
4076
+ // `.configure()` — seed is where run-level facts are decided and
4077
+ // committed, so the resolver rides that commit. The closure supplies
4078
+ // the build-time defaults so a resolver can decide RELATIVE to them
4079
+ // ("upgrade the model when the message is long") instead of having to
4080
+ // restate them.
4081
+ ...(this.runConfigFn && {
4082
+ resolveRunConfig: (input) => {
4083
+ const ctx = {
4084
+ message: input.message,
4085
+ ...(input.identity !== undefined && { identity: input.identity }),
4086
+ runId: run.context.runId ?? 'unknown',
4087
+ defaults: { model, instructions: systemPromptValue },
4088
+ };
4089
+ return this.runConfigFn?.(ctx);
4090
+ },
4091
+ }),
4092
+ });
4093
+ };
4094
+ const seed = (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (scope) => {
4095
+ run.value.resources?.seed(scope);
4096
+ // Mounted runs have no Agent.run() admission. Seed's actual input is
4097
+ // their original message; never read another run's selected values.
4098
+ run.value.checkpointTracker ??= {
4099
+ runId: run.context.runId,
4100
+ originalInput: { message: scope.$getArgs().message },
4101
+ history: [],
4102
+ lastCompletedIteration: 0,
4103
+ };
4104
+ return (run.value.seed ??= seedFor(run))(scope);
4413
4105
  });
4414
4106
  // Tool registry composition extracted to ./agent/buildToolRegistry.ts.
4415
4107
  // Composes static .tool() registry + auto-attached read_skill (+ the
@@ -4425,6 +4117,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4425
4117
  // plants `_findings.from` on it and its sentences name that argument.
4426
4118
  ...(this.argumentSourcesArmed === true && { argumentSources: true }),
4427
4119
  });
4120
+ if ([...registryByName.values()].some(toolShownArgs_js_1.carriesArgumentView))
4121
+ (0, declared_js_1.declarePrivateFields)(this);
4428
4122
  // The declared ontology's tool edges (9.106.0): every name a node's `via`
4429
4123
  // names must be a tool this registry can dispatch — the static registry,
4430
4124
  // the framework's doors and every skill's tools, `registryByName` being
@@ -4496,7 +4190,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4496
4190
  if (registryByName.has(ingredient))
4497
4191
  continue;
4498
4192
  if (this.externalToolProvider !== undefined) {
4499
- if ((0, footprintjs_2.isDevMode)()) {
4193
+ if ((0, footprintjs_1.isDevMode)()) {
4500
4194
  // eslint-disable-next-line no-console
4501
4195
  console.warn(`[agentfootprint] tool '${composedName}' declares composedOf ingredient ` +
4502
4196
  `'${ingredient}', which is not in the static catalog. A ToolProvider is ` +
@@ -4672,44 +4366,22 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4672
4366
  const messagesSubflow = (0, buildMessagesSlot_js_1.buildMessagesSlot)({
4673
4367
  ...(budget?.messages !== undefined && { budgetCap: budget.messages }),
4674
4368
  });
4675
- // Cache shared between buildToolsSlot (writer, each iteration) and
4676
- // buildToolCallsHandler (reader, same iteration). Holds the resolved
4677
- // Tool[] from `provider.list(ctx)` so dispatch doesn't re-invoke `list()`
4678
- // — vital for async network providers.
4679
- //
4680
- // LIFETIME, stated correctly (9.92.0): the chart is built ONCE, at
4681
- // construction (`initChart`), and reused by every `run()` and `resume()`
4682
- // of this Agent — so this cache and the record below outlive a run. They
4683
- // are safe because one Agent runs one turn at a time and the slot
4684
- // overwrites them every iteration before dispatch reads them. What that
4685
- // does NOT cover is a resume in a FRESH instance, whose closure is empty
4686
- // and whose Compose never re-runs before the resumed dispatch — which is
4687
- // why the pause paths carry `pausedToolParty` on the checkpoint.
4688
- const providerToolCache = { current: [] };
4689
- // Who put each name on the wire (9.92.0) — the same closure-shared shape,
4690
- // written by the tools slot's merge and read by dispatch so the party
4691
- // whose contract the model read is the party that answers. `lastServed`
4692
- // is the run's memory of the same fact, for a name that left the wire.
4693
- const servedTools = { current: new Map(), lastServed: new Map() };
4694
- // THE ONE DISPATCH RESOLVER, for the inputs layer (honesty layer 2): built
4695
- // from the SAME deps objects the dispatch handler builds its own from, so
4696
- // the layer reads a call's rules off the implementation that will answer.
4697
- const resolveForLayer = (0, toolResolver_js_1.buildToolResolver)({
4369
+ // Every reader binds the same native component's private catalog.
4370
+ const resolverForValues = (values) => (0, toolResolver_js_1.buildToolResolver)({
4698
4371
  registryByName,
4699
4372
  ...(this.externalToolProvider && { externalToolProvider: this.externalToolProvider }),
4700
- ...(this.externalToolProvider && { providerToolCache }),
4701
- servedTools,
4373
+ ...(this.externalToolProvider && { providerToolCache: values.providerToolCache }),
4374
+ servedTools: values.servedTools,
4702
4375
  toolClaimants,
4703
- notServed: toolCalls_js_1.notServedResult,
4376
+ notServed: index_js_2.notServedResult,
4704
4377
  });
4705
- // A tool's `displayName` — the app's words for a call, read by a person — read
4706
- // through the same resolver, so a ToolProvider's tool is read as well, and through
4707
- // the one rule (`lib/displayName.ts` · `readDisplayName`), so a value nobody vetted
4708
- // is never printed. Wired only where a tool can declare one: on every other agent
4709
- // the final branch is the one it always was.
4710
- const displayNameOf = this.externalToolProvider !== undefined ||
4378
+ const resolveForLayer = (scope) => resolverForValues(this.runExecution().forScope(scope).value);
4379
+ const displayNameOfFor = this.externalToolProvider !== undefined ||
4711
4380
  [...registryByName.values()].some((tool) => tool.displayName !== undefined)
4712
- ? (toolName) => (0, displayName_js_1.readDisplayName)(resolveForLayer(toolName).tool?.displayName)
4381
+ ? (scope) => {
4382
+ const resolve = resolveForLayer(scope);
4383
+ return (toolName) => (0, displayName_js_1.readDisplayName)(resolve(toolName).tool?.displayName);
4384
+ }
4713
4385
  : undefined;
4714
4386
  const readSkillFor = this.readSkillOfferFor();
4715
4387
  // Per-role skill visibility. The Injection Engine resolves the ids once per
@@ -4718,9 +4390,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4718
4390
  // mount. Since 9.86.0 the description is NOT the only reader — the read_skill gate's refusals, the
4719
4391
  // `skill.rejected` payload, the propose-transition refusal and the dispatch
4720
4392
  // roster all filter through that published set
4721
- // (`stages/toolCalls.ts` · "── Skill-graph read_skill GATE" the gate, `toolCalls.ts` ·
4393
+ // (`stages/toolCalls/routing/readSkillRoute.ts` · `applyReadSkillRoute` the gate, `toolCalls/routing/effectsOperations.ts` ·
4722
4394
  // "── THE REFUSAL SPEAKS WITH THE FILTERED SETS" the propose-transition refusal,
4723
- // `toolCalls.ts` · `dispatchRoster`). Nothing is cached here: an
4395
+ // `toolCalls/execution/catalogOperations.ts` · `dispatchRoster`). Nothing is cached here: an
4724
4396
  // earlier draft of 9.84.0 cached the resolved ids so the gate could filter
4725
4397
  // the self-call notice's move offer through them; the notice no longer names
4726
4398
  // a destination at all (see `selfCallNotice`), so there is nothing left to
@@ -4788,17 +4460,20 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4788
4460
  ...(this.mapsPlan !== undefined && {
4789
4461
  mountedMaps: this.mapsPlan.maps.map((m) => ({ id: m.id, toolNames: m.toolNames })),
4790
4462
  }),
4791
- integrityLedger: this.integrityLedgerHolder,
4463
+ runtime: (scope) => {
4464
+ const value = this.runExecution().forScope(scope).value;
4465
+ return { ...value, integrityLedger: value.integrityLedger };
4466
+ },
4792
4467
  ...(this.externalToolProvider && { toolProvider: this.externalToolProvider }),
4793
- ...(this.externalToolProvider && { providerToolCache }),
4794
4468
  // The caller of THIS run, for `ToolDispatchContext.callerIdentity`: the
4795
4469
  // instance's caller on its own run, the member's run on a mount — never a
4796
4470
  // derived identity (the `hiddenSkillIdsNow` precedent).
4797
4471
  ...(this.externalToolProvider && {
4798
- callerIdentity: (scope) => this.ownScopes.has(scope) ? this.lastRunIdentity : (0, memberRun_js_1.memberIdentityIn)(scope),
4472
+ callerIdentity: (scope) => this.runExecution().forScope(scope).own
4473
+ ? this.runExecution().forScope(scope).value.identity
4474
+ : (0, memberRun_js_1.memberIdentityIn)(scope),
4799
4475
  }),
4800
4476
  toolClaimants,
4801
- servedTools,
4802
4477
  ...(readSkillFor && { readSkillFor }),
4803
4478
  ...(budget?.tools !== undefined && { budgetCap: budget.tools }),
4804
4479
  // Steps (9.18.0): per-step narrowing + banner + the skip_step offer.
@@ -4841,11 +4516,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4841
4516
  });
4842
4517
  // callLLM extracted to ./agent/stages/callLLM.ts (v2.11.2). Same
4843
4518
  // late-binding pattern as seed for toolSchemas (computed below).
4844
- const callLLM = (0, callLLM_js_1.buildCallLLMStage)({
4519
+ const callLLMFor = (run) => (0, callLLM_js_1.buildCallLLMStage)({
4845
4520
  onReplayPrepared: (preparation) => {
4846
- if (this.checkpointTracker !== undefined &&
4847
- this.inFlightRunId === this.checkpointTracker.runId)
4848
- (0, runCheckpoint_js_1.retainReplayRetirements)(this.checkpointTracker, preparation);
4521
+ if (run.value.checkpointTracker !== undefined &&
4522
+ run.context.runId === run.value.checkpointTracker.runId)
4523
+ (0, runCheckpoint_js_1.retainReplayRetirements)(run.value.checkpointTracker, preparation);
4849
4524
  },
4850
4525
  ...((this.typedNegativeClaimsConfig !== undefined ||
4851
4526
  (this.evidenceGate !== undefined && this.evidenceGate.posture !== 'assist')) && {
@@ -4891,17 +4566,19 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4891
4566
  // layer). Step T8: the same line carries the turn's time limits.
4892
4567
  ...(this.timeOptions !== undefined && { timeLine: true }),
4893
4568
  // The receipt's salt (9.88.0) — read per call, like seed's own accessor.
4894
- getRunId: () => this.currentRunContext?.runId,
4569
+ getRunId: () => run.context.runId,
4895
4570
  // …and its off switch. Value-conditional, so an agent on the default
4896
4571
  // hands `callLLM` exactly the dep bag it always did.
4897
4572
  ...(this.recordReceiptValue === false && { recordReceipt: false }),
4898
4573
  // …and the window's evictions for `omittedForAttention` (9.93.0) — only
4899
4574
  // an agent with a window strategy has any, and only it hands the seam.
4900
- ...(this.evictedTurnsHandle !== undefined && { evictedTurns: this.evictedTurnsHandle }),
4575
+ ...(run.value.evictedTurnsHandle !== undefined && {
4576
+ evictedTurns: run.value.evictedTurnsHandle,
4577
+ }),
4901
4578
  // …and the receipt memo, so a run hashes each message once rather than
4902
4579
  // once per call (`core/agent/receipt/receiptDigests.ts`). Only where a
4903
4580
  // receipt is minted at all.
4904
- ...(this.recordReceiptValue !== false && { receiptDigests: this.receiptDigests }),
4581
+ ...(this.recordReceiptValue !== false && { receiptDigests: run.value.receiptDigests }),
4905
4582
  provider,
4906
4583
  model,
4907
4584
  ...(temperature !== undefined && { temperature }),
@@ -4934,7 +4611,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4934
4611
  // was called this response" not-applicable notes.
4935
4612
  ...(this.checkColumnTypes !== 'off' &&
4936
4613
  toolColumns.size > 0 && { columnDeclaringTools: new Set(toolColumns.keys()) }),
4937
- integrityLedger: this.integrityLedgerHolder,
4614
+ integrityLedger: run.value.integrityLedger,
4938
4615
  ...(this.reliabilityConfig !== undefined && { reliability: this.reliabilityConfig }),
4939
4616
  ...(this.outputSchemaParser !== undefined && {
4940
4617
  outputSchemaParser: this.outputSchemaParser,
@@ -4981,18 +4658,20 @@ class Agent extends RunnerBase_js_1.RunnerBase {
4981
4658
  // it becomes the ReAct loop target (see the chart builders), so it runs
4982
4659
  // once per iteration boundary with the previous call's adapter-reported
4983
4660
  // usage already measured by the meter.
4984
- const windowStage = this.windowStrategy && this.compactionMeterHandle
4661
+ const callLLM = (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (run.value.callLLM ??= callLLMFor(run)));
4662
+ const configuredWindow = this.windowStrategy;
4663
+ const windowStage = configuredWindow
4985
4664
  ? {
4986
4665
  strategyName: this.windowStrategy.name,
4987
- run: (0, window_js_1.buildWindowStage)({
4988
- strategy: this.windowStrategy,
4989
- meter: this.compactionMeterHandle,
4990
- ...(this.evictedTurnsHandle !== undefined && {
4991
- evictedTurns: this.evictedTurnsHandle,
4666
+ run: (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (run.value.window ??= (0, window_js_1.buildWindowStage)({
4667
+ strategy: configuredWindow,
4668
+ meter: run.value.compactionMeter,
4669
+ ...(run.value.evictedTurnsHandle !== undefined && {
4670
+ evictedTurns: run.value.evictedTurnsHandle,
4992
4671
  }),
4993
4672
  agentModel: model,
4994
4673
  providerName: provider.name,
4995
- getRunId: () => this.currentRunContext?.runId,
4674
+ getRunId: () => run.context.runId,
4996
4675
  // Value-conditional (the `repeatedCallNudge` precedent): an
4997
4676
  // agent on the default hands the stage exactly the deps object
4998
4677
  // it always did.
@@ -5011,7 +4690,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5011
4690
  }),
5012
4691
  ...(pricingTable !== undefined && { pricingTable }),
5013
4692
  ...(costBudget !== undefined && { costBudget }),
5014
- }),
4693
+ }))),
5015
4694
  }
5016
4695
  : undefined;
5017
4696
  // routeDecider extracted to ./agent/stages/route.ts (v2.11.2).
@@ -5042,82 +4721,87 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5042
4721
  // question a build-time mount can answer.
5043
4722
  const canCallTools = registryByName.size > 0 || this.externalToolProvider !== undefined;
5044
4723
  const hasWrapUp = canCallTools && this.wrapUpAtMaxIterations !== false;
5045
- const baseRouteDecider = (0, route_js_1.buildRouteDeciderStage)(this.messageMiddleware, this.outputEnforcement, stepPlanFor, this.evidenceGate, hasWrapUp, this.claimContract, this.integrityLedgerHolder,
5046
- // THE CLAIM SEAM'S RECENCY READ (9.83.0). Value-conditional on both
5047
- // halves, so an agent that armed neither hands the decider builder
5048
- // exactly the arguments it always did — and `buildRouteDeciderStage`'s
5049
- // no-judge fast path still returns the very function reference every
5050
- // pre-9.83.0 chart was given.
5051
- this.noticePriorTurnEvidence && this.evidenceGate !== undefined ? true : undefined,
5052
- // THE ANSWER TURN'S STANDINGS (9.101.0) — the same value-conditional
5053
- // trailing positional, for the same reason: an unarmed agent hands the
5054
- // builder exactly the arguments it always did.
5055
- this.findingsOptions !== undefined ? true : undefined,
5056
- // THE INPUTS LAYER (honesty layer 2) — the same value-conditional
5057
- // trailing positional: the rows this decider files carry the turn
5058
- // stamp, and with the evidence gate armed too, the gate's exempt corpus
5059
- // gains this turn's assumed values, read from the tools' declarations,
5060
- // and the values the person gave the layer's batch ask (step 4). The
5061
- // results layer (step 7b) arms the stamp alone — "while any layer is
5062
- // armed, the one writer stamps the turn" — and nothing else.
5063
- inputsArmed || resultsArmed
5064
- ? {
5065
- ...(inputsArmed &&
5066
- this.evidenceGate !== undefined && {
5067
- declaredDefaults: (0, route_js_2.declaredDefaultsFrom)((toolName, argument) => {
5068
- const rules = (0, declare_js_1.rulesOf)(resolveForLayer(toolName).tool);
5069
- if (rules === undefined || (0, declare_js_1.isRefused)(rules))
5070
- return undefined;
5071
- return rules.ruled.find((r) => r.argument === argument)?.assume;
5072
- }),
5073
- answeredValues: route_js_2.answeredValuesOf,
5074
- // Under `.time()` (step T7): the turn's time spellings by
5075
- // lineage — said ones exempt, derived ones filed, not flagged.
5076
- ...(this.timeOptions !== undefined && { timeLineage: true }),
5077
- }),
5078
- }
5079
- : undefined,
5080
- // THE ANSWER LAYER (honesty layer 4) — the same value-conditional
5081
- // trailing positional: the judges file the answer's witness rows, and
5082
- // every row this decider files carries the turn stamp.
5083
- answerArmed ? true : undefined);
5084
- const validatedRouteDecider = this.answerValidationConfig === undefined
5085
- ? baseRouteDecider
5086
- : (0, answerValidation_js_1.withAnswerValidation)(baseRouteDecider, this.answerValidationConfig, this.outputSchemaParser, artifactStore, () => this.consentOutstanding.size > 0, this.outputEnforcement?.outputFormat !== undefined,
5087
- // Read only when `agentChecks` lists 'claims' (the agent's own rows).
5088
- this.claimContract, this.typedNegativeClaimsConfig === undefined
5089
- ? undefined
5090
- : {
5091
- config: this.typedNegativeClaimsConfig,
5092
- phrases: this.typedNegativeClaimsConfig.phrases,
5093
- applicationValidation: this.applicationAnswerValidation,
5094
- runId: () => this.currentRunContext.runId,
5095
- });
5096
- const routeDecider = this.negativeClaimsConfig?.mode === 'prose'
5097
- ? (0, observe_js_1.withNegativeProse)(validatedRouteDecider, {
5098
- runId: () => this.currentRunContext.runId,
5099
- hasOutstandingConsent: () => this.consentOutstanding.size > 0,
5100
- structured: this.outputSchemaParser !== undefined,
5101
- phrases: this.negativeClaimsConfig.phrases,
5102
- })
5103
- : validatedRouteDecider;
5104
- // `.limitsTravelWithTheAnswer()` on a TYPED answer — decided once, here.
5105
- // An output schema makes the answer JSON, and the appended block would
5106
- // make it JSON followed by prose, which `runTyped()` cannot parse. So the
5107
- // limits travel as DATA: the Route decider's terminal decision commits the
5108
- // fold (`withAnswerCoverage`) and the Final branch projects it onto
5109
- // `turn_end`. A prose answer keeps the block; an agent that asked for
5110
- // neither is handed the decider it always had.
5111
4724
  const limitsAsData = this.limitsTravelWithTheAnswerValue && this.outputSchemaParser !== undefined;
5112
- // With the inputs layer armed, the typed answer's limits carry this
5113
- // turn's assumed values too — the same rows the prose "Assumed" block
5114
- // prints (`withAnswerCoverage`'s second argument); a rewrite by a
5115
- // before-tool chain is read only when the agent has one.
5116
- const terminalRouteDecider = limitsAsData
5117
- ? (0, answerCoverage_js_1.withAnswerCoverage)(routeDecider, inputsArmed ? { rewrites: this.toolMiddleware.length > 0 } : undefined)
5118
- : routeDecider;
5119
- // toolCallsHandler extracted to ./agent/stages/toolCalls.ts (v2.11.2).
5120
- const toolCallsHandler = (0, toolCalls_js_1.buildToolCallsHandler)({
4725
+ const routeFor = (run) => {
4726
+ const resolve = resolverForValues(run.value);
4727
+ const baseRouteDecider = (0, route_js_1.buildRouteDeciderStage)(this.messageMiddleware, this.outputEnforcement, stepPlanFor, this.evidenceGate, hasWrapUp, this.claimContract, run.value.integrityLedger,
4728
+ // THE CLAIM SEAM'S RECENCY READ (9.83.0). Value-conditional on both
4729
+ // halves, so an agent that armed neither hands the decider builder
4730
+ // exactly the arguments it always did — and `buildRouteDeciderStage`'s
4731
+ // no-judge fast path still returns the very function reference every
4732
+ // pre-9.83.0 chart was given.
4733
+ this.noticePriorTurnEvidence && this.evidenceGate !== undefined ? true : undefined,
4734
+ // THE ANSWER TURN'S STANDINGS (9.101.0) — the same value-conditional
4735
+ // trailing positional, for the same reason: an unarmed agent hands the
4736
+ // builder exactly the arguments it always did.
4737
+ this.findingsOptions !== undefined ? true : undefined,
4738
+ // THE INPUTS LAYER (honesty layer 2) — the same value-conditional
4739
+ // trailing positional: the rows this decider files carry the turn
4740
+ // stamp, and with the evidence gate armed too, the gate's exempt corpus
4741
+ // gains this turn's assumed values, read from the tools' declarations,
4742
+ // and the values the person gave the layer's batch ask (step 4). The
4743
+ // results layer (step 7b) arms the stamp alone — "while any layer is
4744
+ // armed, the one writer stamps the turn" — and nothing else.
4745
+ inputsArmed || resultsArmed
4746
+ ? {
4747
+ ...(inputsArmed &&
4748
+ this.evidenceGate !== undefined && {
4749
+ declaredDefaults: (0, route_js_2.declaredDefaultsFrom)((toolName, argument) => {
4750
+ const rules = (0, declare_js_1.rulesOf)(resolve(toolName).tool);
4751
+ if (rules === undefined || (0, declare_js_1.isRefused)(rules))
4752
+ return undefined;
4753
+ return rules.ruled.find((r) => r.argument === argument)?.assume;
4754
+ }),
4755
+ answeredValues: route_js_2.answeredValuesOf,
4756
+ // Under `.time()` (step T7): the turn's time spellings by
4757
+ // lineage — said ones exempt, derived ones filed, not flagged.
4758
+ ...(this.timeOptions !== undefined && { timeLineage: true }),
4759
+ }),
4760
+ }
4761
+ : undefined,
4762
+ // THE ANSWER LAYER (honesty layer 4) — the same value-conditional
4763
+ // trailing positional: the judges file the answer's witness rows, and
4764
+ // every row this decider files carries the turn stamp.
4765
+ answerArmed ? true : undefined);
4766
+ const validatedRouteDecider = this.answerValidationConfig === undefined
4767
+ ? baseRouteDecider
4768
+ : (0, answerValidation_js_1.withAnswerValidation)(baseRouteDecider, this.answerValidationConfig, this.outputSchemaParser, artifactStore, () => run.value.consentOutstanding.size > 0, this.outputEnforcement?.outputFormat !== undefined,
4769
+ // Read only when `agentChecks` lists 'claims' (the agent's own rows).
4770
+ this.claimContract, this.typedNegativeClaimsConfig === undefined
4771
+ ? undefined
4772
+ : {
4773
+ config: this.typedNegativeClaimsConfig,
4774
+ phrases: this.typedNegativeClaimsConfig.phrases,
4775
+ applicationValidation: this.applicationAnswerValidation,
4776
+ runId: () => run.context.runId,
4777
+ });
4778
+ const routeDecider = this.negativeClaimsConfig?.mode === 'prose'
4779
+ ? (0, observe_js_1.withNegativeProse)(validatedRouteDecider, {
4780
+ runId: () => run.context.runId,
4781
+ hasOutstandingConsent: () => run.value.consentOutstanding.size > 0,
4782
+ structured: this.outputSchemaParser !== undefined,
4783
+ phrases: this.negativeClaimsConfig.phrases,
4784
+ })
4785
+ : validatedRouteDecider;
4786
+ // `.limitsTravelWithTheAnswer()` on a TYPED answer — decided once, here.
4787
+ // An output schema makes the answer JSON, and the appended block would
4788
+ // make it JSON followed by prose, which `runTyped()` cannot parse. So the
4789
+ // limits travel as DATA: the Route decider's terminal decision commits the
4790
+ // fold (`withAnswerCoverage`) and the Final branch projects it onto
4791
+ // `turn_end`. A prose answer keeps the block; an agent that asked for
4792
+ // neither is handed the decider it always had.
4793
+ // With the inputs layer armed, the typed answer's limits carry this
4794
+ // turn's assumed values too — the same rows the prose "Assumed" block
4795
+ // prints (`withAnswerCoverage`'s second argument); a rewrite by a
4796
+ // before-tool chain is read only when the agent has one.
4797
+ const terminalRouteDecider = limitsAsData
4798
+ ? (0, answerCoverage_js_1.withAnswerCoverage)(routeDecider, inputsArmed ? { rewrites: this.toolMiddleware.length > 0 } : undefined)
4799
+ : routeDecider;
4800
+ // toolCallsHandler extracted to ./agent/stages/toolCalls/index.ts (v2.11.2).
4801
+ return terminalRouteDecider;
4802
+ };
4803
+ const terminalRouteDecider = (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (run.value.route ??= routeFor(run)));
4804
+ const toolCallsFor = (run) => (0, index_js_2.buildToolCallsHandler)({
5121
4805
  registryByName,
5122
4806
  // WHICH SKILLS DECLARE EACH TOOL NAME (9.86.0) — read by the unknown-tool
5123
4807
  // roster so a role that may not see a skill is not told the names of the
@@ -5172,7 +4856,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5172
4856
  ...(this.noticeEmptyLookups &&
5173
4857
  toolGrounding.size > 0 && {
5174
4858
  emptyLookupGrounding: toolGrounding,
5175
- integrityLedger: this.integrityLedgerHolder,
4859
+ integrityLedger: run.value.integrityLedger,
5176
4860
  }),
5177
4861
  // THE WRITE SEAM'S other check (9.78.0) — the column-type contract.
5178
4862
  // Value-conditional on both halves for the same reason, so an agent
@@ -5182,11 +4866,21 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5182
4866
  toolColumns.size > 0 && {
5183
4867
  columnDeclarations: toolColumns,
5184
4868
  columnCheckMode: this.checkColumnTypes,
5185
- integrityLedger: this.integrityLedgerHolder,
4869
+ integrityLedger: run.value.integrityLedger,
5186
4870
  }),
5187
4871
  ...(this.externalToolProvider && { externalToolProvider: this.externalToolProvider }),
5188
- ...(this.externalToolProvider && { providerToolCache }),
5189
- servedTools,
4872
+ ...(this.externalToolProvider && {
4873
+ providerToolCache: run.value.providerToolCache,
4874
+ prepareProviderTools: (scope) => (0, discoverTools_js_1.ensureDiscoveredTools)(scope, {
4875
+ provider: this.externalToolProvider,
4876
+ cache: run.value.providerToolCache,
4877
+ callerIdentity: run.own ? run.value.identity : (0, memberRun_js_1.memberIdentityIn)(scope),
4878
+ get iteration() {
4879
+ return scope.iteration ?? 1;
4880
+ },
4881
+ }),
4882
+ }),
4883
+ servedTools: run.value.servedTools,
5190
4884
  toolClaimants,
5191
4885
  ...(permissionChecker && { permissionChecker }),
5192
4886
  ...(credentialProvider && { credentialProvider }),
@@ -5194,7 +4888,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5194
4888
  // or — on a mount — the run its link names (`memberRun.ts`). An accessor,
5195
4889
  // because the chart is built once and the request is per run.
5196
4890
  ...(credentialProvider && {
5197
- currentRequest: (scope) => this.ownScopes.has(scope) ? this.scopeRequests.get(scope) : (0, memberRun_js_1.memberRequestIn)(scope),
4891
+ currentRequest: (scope) => (run.own ? run.value.request : (0, memberRun_js_1.memberRequestIn)(scope)),
5198
4892
  }),
5199
4893
  // The claim-check store (9.21.0). Absent → not one new line runs in
5200
4894
  // dispatch: `ctx.artifacts` is the fail-closed teacher and no artifact
@@ -5268,7 +4962,8 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5268
4962
  // injections exist; nothing runs until a tool returns an effect.
5269
4963
  ...(this.injections.length > 0 && {
5270
4964
  leaseTargets: new Map(this.injections.map((inj) => {
5271
- const surfaceMode = inj.metadata?.surfaceMode;
4965
+ const surfaceMode = inj.metadata
4966
+ ?.surfaceMode;
5272
4967
  return [inj.id, { ...(surfaceMode !== undefined && { surfaceMode }) }];
5273
4968
  })),
5274
4969
  }),
@@ -5291,19 +4986,20 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5291
4986
  // at construction, and a captured value would be run #1's forever. The
5292
4987
  // tier one is lazy on top of that — an agent whose tools hold no sessions
5293
4988
  // never allocates it.
5294
- currentRun: () => this.toolRunFacts(),
5295
- isOwnRun: (scope) => this.ownScopes.has(scope),
5296
- answeredAsk: () => this.answeredAsk,
4989
+ currentRun: () => this.toolRunFacts(run),
4990
+ isRunRetired: () => run.retired,
4991
+ isOwnRun: () => run.own,
4992
+ answeredAsk: () => run.value.answeredAsk,
5297
4993
  // The time layer: each dispatched call files its `call` row, and the
5298
4994
  // resume door compares a resume's passed `time` with the kept clock.
5299
4995
  ...(this.timeOptions !== undefined && {
5300
4996
  time: {
5301
- takePassedOnResume: (scope) => {
4997
+ takePassedOnResume: () => {
5302
4998
  // Only the agent's own resumed leg takes it — never a member's.
5303
- if (!this.ownScopes.has(scope))
4999
+ if (!run.own)
5304
5000
  return undefined;
5305
- const passed = this.resumePassedTime;
5306
- this.resumePassedTime = undefined;
5001
+ const passed = run.value.resumePassedTime;
5002
+ run.value.resumePassedTime = undefined;
5307
5003
  return passed;
5308
5004
  },
5309
5005
  ...(this.timeOptions.zone !== undefined && { appZone: this.timeOptions.zone }),
@@ -5320,7 +5016,7 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5320
5016
  },
5321
5017
  }),
5322
5018
  emitForRun: (type, payload, runContext) => this.emitLateFact(type, payload, runContext),
5323
- toolSessions: () => this.toolSessions(),
5019
+ resources: run.value.resources,
5324
5020
  // 8.6.0 — what a run does when a declared credential needs 3LO consent.
5325
5021
  onAuthorizationRequired: this.onAuthorizationRequired,
5326
5022
  // The `'tell-model'` consent record travels OFF tracked state (a tracked
@@ -5328,10 +5024,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5328
5024
  // these two callbacks are its whole route to the caller. Cleared at the
5329
5025
  // top of every run; read in `finalizeResult`.
5330
5026
  reportConsentOutstanding: (record) => {
5331
- this.consentOutstanding.set(record.service, record);
5027
+ run.value.consentOutstanding.set(record.service, record);
5332
5028
  },
5333
5029
  clearConsentOutstanding: (service) => {
5334
- this.consentOutstanding.delete(service);
5030
+ run.value.consentOutstanding.delete(service);
5335
5031
  },
5336
5032
  });
5337
5033
  // v2.14 — Build the NormalizeThinking sub-subflow only when a
@@ -5339,6 +5035,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5339
5035
  // explicitly set via .thinkingHandler()). Conditional mount ensures
5340
5036
  // zero overhead for non-thinking agents — the chart has zero extra
5341
5037
  // stages when undefined.
5038
+ const handlerFor = (run) => (run.value.toolCalls ??= toolCallsFor(run));
5039
+ const toolCallsHandler = {
5040
+ execute: (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (scope) => handlerFor(run).execute(scope)),
5041
+ resume: (0, runnerExecution_js_1.bindRunnerStage)((scope) => this.runExecution().forScope(scope), (run) => (scope, input) => handlerFor(run).resume(scope, input)),
5042
+ };
5342
5043
  const thinkingSubflow = this.thinkingHandler
5343
5044
  ? (0, buildThinkingSubflow_js_1.buildThinkingSubflow)(this.thinkingHandler, this.provider.name)
5344
5045
  : undefined;
@@ -5348,7 +5049,9 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5348
5049
  const chartDeps = {
5349
5050
  memories: this.memories,
5350
5051
  // Evidence bridge (#5): closure hand-off to the CAUSAL write mounts.
5351
- ...(this.causalEvidence && { causalEvidenceSource: this.causalEvidence.collect }),
5052
+ ...(this.memories.some((memory) => memory.type === 'causal') && {
5053
+ causalEvidenceSource: (binding) => (0, componentObservers_js_1.componentEvidence)(this.runExecution().forScope(binding).value, binding),
5054
+ }),
5352
5055
  systemPromptCachePolicy,
5353
5056
  maxIterations,
5354
5057
  seed,
@@ -5412,7 +5115,10 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5412
5115
  // Route's sixth dispatch value, read only by an agent whose revision
5413
5116
  // turns the tools off (an enforcing answer validation).
5414
5117
  ...(this.revisionWithholdsTools() && { toolsOffAfterRevision: true }),
5415
- toolOf: (toolName) => resolveForLayer(toolName).tool,
5118
+ toolOfFor: (scope) => {
5119
+ const resolve = resolveForLayer(scope);
5120
+ return (toolName) => resolve(toolName).tool;
5121
+ },
5416
5122
  ...(this.toolMiddleware.length > 0 && { rewrites: true }),
5417
5123
  // The time layer (step T5a): a tool whose period declares forms is filled from the
5418
5124
  // turn's one window, bound to the person's window, or recorded as the model's.
@@ -5450,7 +5156,12 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5450
5156
  // head, in both builders through one helper, reading each call's
5451
5157
  // `ToolPeriod` off the implementation that answered it; absent → untouched.
5452
5158
  ...(resultsArmed && {
5453
- resultsLayer: { toolOf: (toolName) => resolveForLayer(toolName).tool },
5159
+ resultsLayer: {
5160
+ toolOfFor: (scope) => {
5161
+ const resolve = resolveForLayer(scope);
5162
+ return (toolName) => resolve(toolName).tool;
5163
+ },
5164
+ },
5454
5165
  }),
5455
5166
  // The answer layer (honesty layer 4): its stage heads the final branch
5456
5167
  // in both builders through one helper, reading only the committed keys
@@ -5468,11 +5179,11 @@ class Agent extends RunnerBase_js_1.RunnerBase {
5468
5179
  standingLine: this.answerLayerOption.standingLine,
5469
5180
  }),
5470
5181
  ...(this.answerValidationConfig !== undefined && { validated: true }),
5471
- ...(displayNameOf !== undefined && { displayNameOf }),
5182
+ ...(displayNameOfFor !== undefined && { displayNameOfFor }),
5472
5183
  },
5473
5184
  }),
5474
5185
  // The prose limits block names an item's calls in the app's words — under the same wiring.
5475
- ...(displayNameOf !== undefined && { displayNameOf }),
5186
+ ...(displayNameOfFor !== undefined && { displayNameOfFor }),
5476
5187
  // Tool choice by classifier (9.105.0): the mount args on the Tools
5477
5188
  // branch and the key across the sf-llm-call boundary, under the arm.
5478
5189
  ...(this.toolChoiceOptions !== undefined && { hasToolChoice: true }),
@@ -5563,60 +5274,4 @@ exports.Agent = Agent;
5563
5274
  // AgentBuilder extracted to ./agent/AgentBuilder.ts (v2.11.2).
5564
5275
  // Re-export so the 28+ existing import sites continue to work unchanged.
5565
5276
  // Validators + helpers extracted to ./agent/validators.ts (v2.11.1).
5566
- /** How many run ids one instance remembers. */
5567
- const MAX_REMEMBERED_RUNS = 256;
5568
- /** Drop the oldest entries of an insertion-ordered Set or Map past `max`. */
5569
- function boundInsertionOrder(held, max) {
5570
- while (held.size > max) {
5571
- const oldest = held.keys().next();
5572
- if (oldest.done === true)
5573
- return;
5574
- held.delete(oldest.value);
5575
- }
5576
- }
5577
- /**
5578
- * The run options without the time layer's `time` — what the engine is handed.
5579
- * The SAME object when it carries no `time` key, so a run that passed none
5580
- * hands the executor exactly the options it always did.
5581
- */
5582
- function withoutTime(options) {
5583
- if (options === undefined || !('time' in options))
5584
- return options;
5585
- const { time: _time, ...rest } = options;
5586
- void _time;
5587
- return rest;
5588
- }
5589
- /**
5590
- * The policy a paused agent run was covered by, read off its own checkpoint
5591
- * (`AgentState.runRedaction`, committed by seed and by every resumed leg) —
5592
- * FAIL CLOSED: a value this library did not write, or a checkpoint whose run
5593
- * kept names out of its records (`redactionMarks`) but carries no policy,
5594
- * refuses the resume (`ResumeRedactionError`) before anything moves. A leg its
5595
- * policy could not keep covered must never start.
5596
- */
5597
- function resumeRedactionOf(checkpoint, trusted) {
5598
- const state = checkpoint.sharedState;
5599
- let carried;
5600
- try {
5601
- // A carried pattern is a reference to one the resuming side holds — never
5602
- // compiled from the checkpoint (`redaction/policy.ts` · `policyFromCarried`).
5603
- carried = (0, policy_js_1.policyFromCarried)(state?.runRedaction, 'Agent.resume', trusted);
5604
- // A policy built under ANOTHER vocabulary version is joined with the
5605
- // current list — the leg is never covered by an older list alone.
5606
- carried = (0, conversation_js_2.withCurrentVocabulary)(carried, (0, policy_js_1.carriedVocabularyOf)(state?.runRedaction));
5607
- }
5608
- catch (refusal) {
5609
- throw new conversation_js_1.ResumeRedactionError(refusal instanceof policy_js_1.CarriedPolicyError && refusal.refusal === 'unknown-pattern'
5610
- ? 'unknown-pattern'
5611
- : 'unreadable');
5612
- }
5613
- // Every leg of a covered run writes its policy into its checkpoint's state
5614
- // (seed, and `resume` for a resumed leg), so a checkpoint whose run kept
5615
- // names out but carries none was altered — refused even when the resume
5616
- // names a policy, which cannot stand in for the one the run was covered by.
5617
- if (carried === undefined && (0, policy_js_1.policyOfMarks)(checkpoint.redactionMarks) !== undefined) {
5618
- throw new conversation_js_1.ResumeRedactionError('missing');
5619
- }
5620
- return carried;
5621
- }
5622
5277
  //# sourceMappingURL=Agent.js.map