agentfootprint 18.0.0 → 18.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (572) hide show
  1. package/CAPABILITIES.md +2 -1
  2. package/dist/adapters/llm/BedrockProvider/client.js +93 -0
  3. package/dist/adapters/llm/BedrockProvider/client.js.map +1 -0
  4. package/dist/adapters/llm/BedrockProvider/guardedStream.js +150 -0
  5. package/dist/adapters/llm/BedrockProvider/guardedStream.js.map +1 -0
  6. package/dist/adapters/llm/BedrockProvider/guardedStreamBuffer.js +109 -0
  7. package/dist/adapters/llm/BedrockProvider/guardedStreamBuffer.js.map +1 -0
  8. package/dist/adapters/llm/BedrockProvider/guardrailClassify.js +189 -0
  9. package/dist/adapters/llm/BedrockProvider/guardrailClassify.js.map +1 -0
  10. package/dist/adapters/llm/BedrockProvider/guardrailConfig.js +79 -0
  11. package/dist/adapters/llm/BedrockProvider/guardrailConfig.js.map +1 -0
  12. package/dist/adapters/llm/BedrockProvider/guardrailRead.js +101 -0
  13. package/dist/adapters/llm/BedrockProvider/guardrailRead.js.map +1 -0
  14. package/dist/adapters/llm/BedrockProvider/guardrailResponse.js +81 -0
  15. package/dist/adapters/llm/BedrockProvider/guardrailResponse.js.map +1 -0
  16. package/dist/adapters/llm/BedrockProvider/guardrailSchemas.js +95 -0
  17. package/dist/adapters/llm/BedrockProvider/guardrailSchemas.js.map +1 -0
  18. package/dist/adapters/llm/BedrockProvider/request.js +119 -0
  19. package/dist/adapters/llm/BedrockProvider/request.js.map +1 -0
  20. package/dist/adapters/llm/BedrockProvider/response.js +107 -0
  21. package/dist/adapters/llm/BedrockProvider/response.js.map +1 -0
  22. package/dist/adapters/llm/BedrockProvider/stream.js +109 -0
  23. package/dist/adapters/llm/BedrockProvider/stream.js.map +1 -0
  24. package/dist/adapters/llm/BedrockProvider/types.js +3 -0
  25. package/dist/adapters/llm/BedrockProvider/types.js.map +1 -0
  26. package/dist/adapters/llm/BedrockProvider.js +48 -381
  27. package/dist/adapters/llm/BedrockProvider.js.map +1 -1
  28. package/dist/adapters/llm/MockProvider.js +1 -0
  29. package/dist/adapters/llm/MockProvider.js.map +1 -1
  30. package/dist/ag-ui/serializer/settle.js +110 -0
  31. package/dist/ag-ui/serializer/settle.js.map +1 -0
  32. package/dist/ag-ui/serializer/translate.js +310 -0
  33. package/dist/ag-ui/serializer/translate.js.map +1 -0
  34. package/dist/ag-ui/serializer/types.js +3 -0
  35. package/dist/ag-ui/serializer/types.js.map +1 -0
  36. package/dist/ag-ui/serializer/values.js +72 -0
  37. package/dist/ag-ui/serializer/values.js.map +1 -0
  38. package/dist/ag-ui/serializer.js +110 -543
  39. package/dist/ag-ui/serializer.js.map +1 -1
  40. package/dist/core/LLMCall/chart.js +294 -0
  41. package/dist/core/LLMCall/chart.js.map +1 -0
  42. package/dist/core/LLMCall.js +30 -314
  43. package/dist/core/LLMCall.js.map +1 -1
  44. package/dist/core/agent/buildAgentMessageApiChart.js +10 -5
  45. package/dist/core/agent/buildAgentMessageApiChart.js.map +1 -1
  46. package/dist/core/agent/buildDynamicAgentChart/boundary.js +148 -0
  47. package/dist/core/agent/buildDynamicAgentChart/boundary.js.map +1 -0
  48. package/dist/core/agent/buildDynamicAgentChart/engineBoundary.js +122 -0
  49. package/dist/core/agent/buildDynamicAgentChart/engineBoundary.js.map +1 -0
  50. package/dist/core/agent/buildDynamicAgentChart/finalBranch.js +26 -0
  51. package/dist/core/agent/buildDynamicAgentChart/finalBranch.js.map +1 -0
  52. package/dist/core/agent/buildDynamicAgentChart.js +14 -263
  53. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  54. package/dist/core/agent/buildMessageApiChart.js +11 -6
  55. package/dist/core/agent/buildMessageApiChart.js.map +1 -1
  56. package/dist/core/agent/composeRequest.js +1 -1
  57. package/dist/core/agent/dynamicTurnSeed.js +2 -0
  58. package/dist/core/agent/dynamicTurnSeed.js.map +1 -1
  59. package/dist/core/agent/findings/answerText.js +1 -1
  60. package/dist/core/agent/receipt/receipt.js +2 -2
  61. package/dist/core/agent/runtime/admission/owner.js +1 -1
  62. package/dist/core/agent/runtime/admission/owner.js.map +1 -1
  63. package/dist/core/agent/runtime/terminal/verdicts.js +4 -0
  64. package/dist/core/agent/runtime/terminal/verdicts.js.map +1 -1
  65. package/dist/core/agent/stagedRefs.js +1 -1
  66. package/dist/core/agent/stagedRefs.js.map +1 -1
  67. package/dist/core/agent/stages/callLLM/acceptResponse.js +226 -0
  68. package/dist/core/agent/stages/callLLM/acceptResponse.js.map +1 -0
  69. package/dist/core/agent/stages/callLLM/executeCall.js +254 -0
  70. package/dist/core/agent/stages/callLLM/executeCall.js.map +1 -0
  71. package/dist/core/agent/stages/callLLM/prepareCall.js +467 -0
  72. package/dist/core/agent/stages/callLLM/prepareCall.js.map +1 -0
  73. package/dist/core/agent/stages/callLLM/responseAccounting.js +34 -0
  74. package/dist/core/agent/stages/callLLM/responseAccounting.js.map +1 -0
  75. package/dist/core/agent/stages/callLLM.js +34 -852
  76. package/dist/core/agent/stages/callLLM.js.map +1 -1
  77. package/dist/core/agent/stages/reliabilityExecution/contracts.js +28 -0
  78. package/dist/core/agent/stages/reliabilityExecution/contracts.js.map +1 -0
  79. package/dist/core/agent/stages/reliabilityExecution/feedback.js +40 -0
  80. package/dist/core/agent/stages/reliabilityExecution/feedback.js.map +1 -0
  81. package/dist/core/agent/stages/reliabilityExecution/stuckLoop.js +48 -0
  82. package/dist/core/agent/stages/reliabilityExecution/stuckLoop.js.map +1 -0
  83. package/dist/core/agent/stages/reliabilityExecution.js +18 -156
  84. package/dist/core/agent/stages/reliabilityExecution.js.map +1 -1
  85. package/dist/core/agent/toolChoice/record.js +1 -1
  86. package/dist/core/agent/window/toolNames.js +1 -1
  87. package/dist/core/providerIntervention.js +115 -0
  88. package/dist/core/providerIntervention.js.map +1 -0
  89. package/dist/core/slots/buildMessagesSlot.js +1 -1
  90. package/dist/core/terminalVerdict.js +3 -0
  91. package/dist/core/terminalVerdict.js.map +1 -1
  92. package/dist/core-flow/Graph.js +1 -1
  93. package/dist/core-flow/Parallel/builder.js +101 -0
  94. package/dist/core-flow/Parallel/builder.js.map +1 -0
  95. package/dist/core-flow/Parallel/chart.js +221 -0
  96. package/dist/core-flow/Parallel/chart.js.map +1 -0
  97. package/dist/core-flow/Parallel/mapper.js +41 -0
  98. package/dist/core-flow/Parallel/mapper.js.map +1 -0
  99. package/dist/core-flow/Parallel/merge.js +63 -0
  100. package/dist/core-flow/Parallel/merge.js.map +1 -0
  101. package/dist/core-flow/Parallel/types.js +3 -0
  102. package/dist/core-flow/Parallel/types.js.map +1 -0
  103. package/dist/core-flow/Parallel.js +19 -395
  104. package/dist/core-flow/Parallel.js.map +1 -1
  105. package/dist/esm/adapters/llm/BedrockProvider/client.d.ts +11 -0
  106. package/dist/esm/adapters/llm/BedrockProvider/client.js +87 -0
  107. package/dist/esm/adapters/llm/BedrockProvider/client.js.map +1 -0
  108. package/dist/esm/adapters/llm/BedrockProvider/guardedStream.d.ts +7 -0
  109. package/dist/esm/adapters/llm/BedrockProvider/guardedStream.js +145 -0
  110. package/dist/esm/adapters/llm/BedrockProvider/guardedStream.js.map +1 -0
  111. package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts +21 -0
  112. package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.js +105 -0
  113. package/dist/esm/adapters/llm/BedrockProvider/guardedStreamBuffer.js.map +1 -0
  114. package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.d.ts +8 -0
  115. package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.js +183 -0
  116. package/dist/esm/adapters/llm/BedrockProvider/guardrailClassify.js.map +1 -0
  117. package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.d.ts +30 -0
  118. package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.js +74 -0
  119. package/dist/esm/adapters/llm/BedrockProvider/guardrailConfig.js.map +1 -0
  120. package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.d.ts +19 -0
  121. package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.js +96 -0
  122. package/dist/esm/adapters/llm/BedrockProvider/guardrailRead.js.map +1 -0
  123. package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.d.ts +13 -0
  124. package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.js +74 -0
  125. package/dist/esm/adapters/llm/BedrockProvider/guardrailResponse.js.map +1 -0
  126. package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.d.ts +13 -0
  127. package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.js +92 -0
  128. package/dist/esm/adapters/llm/BedrockProvider/guardrailSchemas.js.map +1 -0
  129. package/dist/esm/adapters/llm/BedrockProvider/request.d.ts +4 -0
  130. package/dist/esm/adapters/llm/BedrockProvider/request.js +115 -0
  131. package/dist/esm/adapters/llm/BedrockProvider/request.js.map +1 -0
  132. package/dist/esm/adapters/llm/BedrockProvider/response.d.ts +32 -0
  133. package/dist/esm/adapters/llm/BedrockProvider/response.js +100 -0
  134. package/dist/esm/adapters/llm/BedrockProvider/response.js.map +1 -0
  135. package/dist/esm/adapters/llm/BedrockProvider/stream.d.ts +4 -0
  136. package/dist/esm/adapters/llm/BedrockProvider/stream.js +105 -0
  137. package/dist/esm/adapters/llm/BedrockProvider/stream.js.map +1 -0
  138. package/dist/esm/adapters/llm/BedrockProvider/types.d.ts +174 -0
  139. package/dist/esm/adapters/llm/BedrockProvider/types.js +2 -0
  140. package/dist/esm/adapters/llm/BedrockProvider/types.js.map +1 -0
  141. package/dist/esm/adapters/llm/BedrockProvider.d.ts +5 -148
  142. package/dist/esm/adapters/llm/BedrockProvider.js +44 -377
  143. package/dist/esm/adapters/llm/BedrockProvider.js.map +1 -1
  144. package/dist/esm/adapters/llm/MockProvider.js +1 -0
  145. package/dist/esm/adapters/llm/MockProvider.js.map +1 -1
  146. package/dist/esm/ag-ui/serializer/settle.d.ts +28 -0
  147. package/dist/esm/ag-ui/serializer/settle.js +106 -0
  148. package/dist/esm/ag-ui/serializer/settle.js.map +1 -0
  149. package/dist/esm/ag-ui/serializer/translate.d.ts +39 -0
  150. package/dist/esm/ag-ui/serializer/translate.js +306 -0
  151. package/dist/esm/ag-ui/serializer/translate.js.map +1 -0
  152. package/dist/esm/ag-ui/serializer/types.d.ts +66 -0
  153. package/dist/esm/ag-ui/serializer/types.js +2 -0
  154. package/dist/esm/ag-ui/serializer/types.js.map +1 -0
  155. package/dist/esm/ag-ui/serializer/values.d.ts +39 -0
  156. package/dist/esm/ag-ui/serializer/values.js +59 -0
  157. package/dist/esm/ag-ui/serializer/values.js.map +1 -0
  158. package/dist/esm/ag-ui/serializer.d.ts +3 -146
  159. package/dist/esm/ag-ui/serializer.js +85 -522
  160. package/dist/esm/ag-ui/serializer.js.map +1 -1
  161. package/dist/esm/core/LLMCall/chart.d.ts +21 -0
  162. package/dist/esm/core/LLMCall/chart.js +290 -0
  163. package/dist/esm/core/LLMCall/chart.js.map +1 -0
  164. package/dist/esm/core/LLMCall.d.ts +3 -0
  165. package/dist/esm/core/LLMCall.js +31 -315
  166. package/dist/esm/core/LLMCall.js.map +1 -1
  167. package/dist/esm/core/agent/buildAgentMessageApiChart.js +10 -5
  168. package/dist/esm/core/agent/buildAgentMessageApiChart.js.map +1 -1
  169. package/dist/esm/core/agent/buildDynamicAgentChart/boundary.d.ts +100 -0
  170. package/dist/esm/core/agent/buildDynamicAgentChart/boundary.js +144 -0
  171. package/dist/esm/core/agent/buildDynamicAgentChart/boundary.js.map +1 -0
  172. package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.d.ts +51 -0
  173. package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.js +118 -0
  174. package/dist/esm/core/agent/buildDynamicAgentChart/engineBoundary.js.map +1 -0
  175. package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.d.ts +3 -0
  176. package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.js +22 -0
  177. package/dist/esm/core/agent/buildDynamicAgentChart/finalBranch.js.map +1 -0
  178. package/dist/esm/core/agent/buildDynamicAgentChart.d.ts +0 -50
  179. package/dist/esm/core/agent/buildDynamicAgentChart.js +14 -263
  180. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  181. package/dist/esm/core/agent/buildMessageApiChart.js +11 -6
  182. package/dist/esm/core/agent/buildMessageApiChart.js.map +1 -1
  183. package/dist/esm/core/agent/composeRequest.d.ts +1 -1
  184. package/dist/esm/core/agent/composeRequest.js +1 -1
  185. package/dist/esm/core/agent/dynamicTurnSeed.js +2 -0
  186. package/dist/esm/core/agent/dynamicTurnSeed.js.map +1 -1
  187. package/dist/esm/core/agent/findings/answerText.d.ts +1 -1
  188. package/dist/esm/core/agent/findings/answerText.js +1 -1
  189. package/dist/esm/core/agent/receipt/receipt.d.ts +2 -2
  190. package/dist/esm/core/agent/receipt/receipt.js +2 -2
  191. package/dist/esm/core/agent/runtime/admission/owner.js +1 -1
  192. package/dist/esm/core/agent/runtime/admission/owner.js.map +1 -1
  193. package/dist/esm/core/agent/runtime/terminal/verdicts.js +4 -0
  194. package/dist/esm/core/agent/runtime/terminal/verdicts.js.map +1 -1
  195. package/dist/esm/core/agent/stagedRefs.js +1 -1
  196. package/dist/esm/core/agent/stagedRefs.js.map +1 -1
  197. package/dist/esm/core/agent/stages/callLLM/acceptResponse.d.ts +6 -0
  198. package/dist/esm/core/agent/stages/callLLM/acceptResponse.js +199 -0
  199. package/dist/esm/core/agent/stages/callLLM/acceptResponse.js.map +1 -0
  200. package/dist/esm/core/agent/stages/callLLM/executeCall.d.ts +26 -0
  201. package/dist/esm/core/agent/stages/callLLM/executeCall.js +250 -0
  202. package/dist/esm/core/agent/stages/callLLM/executeCall.js.map +1 -0
  203. package/dist/esm/core/agent/stages/callLLM/prepareCall.d.ts +88 -0
  204. package/dist/esm/core/agent/stages/callLLM/prepareCall.js +440 -0
  205. package/dist/esm/core/agent/stages/callLLM/prepareCall.js.map +1 -0
  206. package/dist/esm/core/agent/stages/callLLM/responseAccounting.d.ts +10 -0
  207. package/dist/esm/core/agent/stages/callLLM/responseAccounting.js +29 -0
  208. package/dist/esm/core/agent/stages/callLLM/responseAccounting.js.map +1 -0
  209. package/dist/esm/core/agent/stages/callLLM.d.ts +1 -1
  210. package/dist/esm/core/agent/stages/callLLM.js +34 -829
  211. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  212. package/dist/esm/core/agent/stages/reliabilityExecution/contracts.d.ts +53 -0
  213. package/dist/esm/core/agent/stages/reliabilityExecution/contracts.js +24 -0
  214. package/dist/esm/core/agent/stages/reliabilityExecution/contracts.js.map +1 -0
  215. package/dist/esm/core/agent/stages/reliabilityExecution/feedback.d.ts +19 -0
  216. package/dist/esm/core/agent/stages/reliabilityExecution/feedback.js +36 -0
  217. package/dist/esm/core/agent/stages/reliabilityExecution/feedback.js.map +1 -0
  218. package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.d.ts +29 -0
  219. package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.js +44 -0
  220. package/dist/esm/core/agent/stages/reliabilityExecution/stuckLoop.js.map +1 -0
  221. package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +4 -81
  222. package/dist/esm/core/agent/stages/reliabilityExecution.js +7 -147
  223. package/dist/esm/core/agent/stages/reliabilityExecution.js.map +1 -1
  224. package/dist/esm/core/agent/toolChoice/record.d.ts +1 -1
  225. package/dist/esm/core/agent/toolChoice/record.js +1 -1
  226. package/dist/esm/core/agent/window/toolNames.d.ts +1 -1
  227. package/dist/esm/core/agent/window/toolNames.js +1 -1
  228. package/dist/esm/core/providerIntervention.d.ts +25 -0
  229. package/dist/esm/core/providerIntervention.js +106 -0
  230. package/dist/esm/core/providerIntervention.js.map +1 -0
  231. package/dist/esm/core/slots/buildMessagesSlot.d.ts +1 -1
  232. package/dist/esm/core/slots/buildMessagesSlot.js +1 -1
  233. package/dist/esm/core/terminalVerdict.d.ts +4 -0
  234. package/dist/esm/core/terminalVerdict.js +3 -0
  235. package/dist/esm/core/terminalVerdict.js.map +1 -1
  236. package/dist/esm/core-flow/Graph.d.ts +1 -1
  237. package/dist/esm/core-flow/Graph.js +1 -1
  238. package/dist/esm/core-flow/Parallel/builder.d.ts +39 -0
  239. package/dist/esm/core-flow/Parallel/builder.js +97 -0
  240. package/dist/esm/core-flow/Parallel/builder.js.map +1 -0
  241. package/dist/esm/core-flow/Parallel/chart.d.ts +15 -0
  242. package/dist/esm/core-flow/Parallel/chart.js +217 -0
  243. package/dist/esm/core-flow/Parallel/chart.js.map +1 -0
  244. package/dist/esm/core-flow/Parallel/mapper.d.ts +21 -0
  245. package/dist/esm/core-flow/Parallel/mapper.js +37 -0
  246. package/dist/esm/core-flow/Parallel/mapper.js.map +1 -0
  247. package/dist/esm/core-flow/Parallel/merge.d.ts +4 -0
  248. package/dist/esm/core-flow/Parallel/merge.js +58 -0
  249. package/dist/esm/core-flow/Parallel/merge.js.map +1 -0
  250. package/dist/esm/core-flow/Parallel/types.d.ts +179 -0
  251. package/dist/esm/core-flow/Parallel/types.js +2 -0
  252. package/dist/esm/core-flow/Parallel/types.js.map +1 -0
  253. package/dist/esm/core-flow/Parallel.d.ts +7 -233
  254. package/dist/esm/core-flow/Parallel.js +18 -394
  255. package/dist/esm/core-flow/Parallel.js.map +1 -1
  256. package/dist/esm/hosting/failedSettlement.d.ts +9 -0
  257. package/dist/esm/hosting/failedSettlement.js +15 -0
  258. package/dist/esm/hosting/failedSettlement.js.map +1 -0
  259. package/dist/esm/hosting/headers.d.ts +8 -0
  260. package/dist/esm/hosting/headers.js +18 -0
  261. package/dist/esm/hosting/headers.js.map +1 -1
  262. package/dist/esm/hosting/httpHost.js +5 -20
  263. package/dist/esm/hosting/httpHost.js.map +1 -1
  264. package/dist/esm/hosting/httpStreaming.d.ts +5 -2
  265. package/dist/esm/hosting/protocolRoute.js +9 -2
  266. package/dist/esm/hosting/protocolRoute.js.map +1 -1
  267. package/dist/esm/hosting/refusalStatus.d.ts +3 -0
  268. package/dist/esm/hosting/refusalStatus.js +5 -0
  269. package/dist/esm/hosting/refusalStatus.js.map +1 -1
  270. package/dist/esm/hosting/streamHandler/conversation.d.ts +17 -0
  271. package/dist/esm/hosting/streamHandler/conversation.js +32 -0
  272. package/dist/esm/hosting/streamHandler/conversation.js.map +1 -0
  273. package/dist/esm/hosting/streamHandler/request.d.ts +12 -0
  274. package/dist/esm/hosting/streamHandler/request.js +84 -0
  275. package/dist/esm/hosting/streamHandler/request.js.map +1 -0
  276. package/dist/esm/hosting/streamHandler/types.d.ts +106 -0
  277. package/dist/esm/hosting/streamHandler/types.js +5 -0
  278. package/dist/esm/hosting/streamHandler/types.js.map +1 -0
  279. package/dist/esm/hosting/streamHandler.d.ts +3 -133
  280. package/dist/esm/hosting/streamHandler.js +10 -119
  281. package/dist/esm/hosting/streamHandler.js.map +1 -1
  282. package/dist/esm/hosting/unstreamedText.d.ts +1 -1
  283. package/dist/esm/hosting/unstreamedText.js +1 -1
  284. package/dist/esm/lib/iterationBudget.js +1 -1
  285. package/dist/esm/lib/iterationBudget.js.map +1 -1
  286. package/dist/esm/lib/toolBytes.d.ts +1 -1
  287. package/dist/esm/lib/toolBytes.js +2 -2
  288. package/dist/esm/lib/toolBytes.js.map +1 -1
  289. package/dist/esm/ontology/serve.d.ts +2 -2
  290. package/dist/esm/ontology/serve.js +2 -2
  291. package/dist/esm/provider-contract/intervention.d.ts +56 -0
  292. package/dist/esm/provider-contract/intervention.js +112 -0
  293. package/dist/esm/provider-contract/intervention.js.map +1 -0
  294. package/dist/esm/provider-contract/replaySafety.d.ts +4 -0
  295. package/dist/esm/provider-contract/replaySafety.js +25 -0
  296. package/dist/esm/provider-contract/replaySafety.js.map +1 -0
  297. package/dist/esm/provider-contract/requestRefusal.js +3 -1
  298. package/dist/esm/provider-contract/requestRefusal.js.map +1 -1
  299. package/dist/esm/provider-contract/responseAdmission.d.ts +10 -0
  300. package/dist/esm/provider-contract/responseAdmission.js +91 -0
  301. package/dist/esm/provider-contract/responseAdmission.js.map +1 -0
  302. package/dist/esm/provider-contract/types/code.d.ts +434 -0
  303. package/dist/esm/provider-contract/types/code.js +27 -0
  304. package/dist/esm/provider-contract/types/code.js.map +1 -0
  305. package/dist/esm/provider-contract/types/message.d.ts +226 -0
  306. package/dist/esm/provider-contract/types/message.js +2 -0
  307. package/dist/esm/provider-contract/types/message.js.map +1 -0
  308. package/dist/esm/provider-contract/types/provider.d.ts +261 -0
  309. package/dist/esm/provider-contract/types/provider.js +2 -0
  310. package/dist/esm/provider-contract/types/provider.js.map +1 -0
  311. package/dist/esm/provider-contract/types/request.d.ts +93 -0
  312. package/dist/esm/provider-contract/types/request.js +2 -0
  313. package/dist/esm/provider-contract/types/request.js.map +1 -0
  314. package/dist/esm/provider-contract/types/response.d.ts +142 -0
  315. package/dist/esm/provider-contract/types/response.js +2 -0
  316. package/dist/esm/provider-contract/types/response.js.map +1 -0
  317. package/dist/esm/provider-contract/types.d.ts +7 -1149
  318. package/dist/esm/provider-contract/types.js +1 -25
  319. package/dist/esm/provider-contract/types.js.map +1 -1
  320. package/dist/esm/providers.d.ts +2 -1
  321. package/dist/esm/providers.js +1 -0
  322. package/dist/esm/providers.js.map +1 -1
  323. package/dist/esm/recorders/core/ErrorBridge.d.ts +3 -1
  324. package/dist/esm/recorders/core/ErrorBridge.js +14 -0
  325. package/dist/esm/recorders/core/ErrorBridge.js.map +1 -1
  326. package/dist/esm/recorders/core/ResilienceRecorder.d.ts +4 -4
  327. package/dist/esm/recorders/core/ResilienceRecorder.js +4 -4
  328. package/dist/esm/reliability/buildReliabilityGateChart.d.ts +1 -1
  329. package/dist/esm/reliability/buildReliabilityGateChart.js +2 -2
  330. package/dist/esm/reliability/buildReliabilityGateChart.js.map +1 -1
  331. package/dist/esm/resilience/replayAttempt.d.ts +1 -1
  332. package/dist/esm/resilience/replayAttempt.js +18 -6
  333. package/dist/esm/resilience/replayAttempt.js.map +1 -1
  334. package/dist/esm/resilience/withCircuitBreaker.js +29 -13
  335. package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
  336. package/dist/esm/resilience/withFallback.js +22 -7
  337. package/dist/esm/resilience/withFallback.js.map +1 -1
  338. package/dist/esm/resilience/withRetry.js +35 -11
  339. package/dist/esm/resilience/withRetry.js.map +1 -1
  340. package/dist/esm/time/convert/bounds.js +18 -2
  341. package/dist/esm/time/convert/bounds.js.map +1 -1
  342. package/dist/esm/time/convert/exact.js +26 -1
  343. package/dist/esm/time/convert/exact.js.map +1 -1
  344. package/dist/esm/time/convert.d.ts +2 -2
  345. package/dist/esm/time/convert.js +2 -2
  346. package/dist/esm/time-travel/servedView/findings.js +2 -2
  347. package/dist/esm/time-travel/servedView/findings.js.map +1 -1
  348. package/dist/esm/time-travel/servedView/gaps.js +1 -1
  349. package/dist/esm/time-travel/servedView/gaps.js.map +1 -1
  350. package/dist/esm/time-travel/servedView/ontology.js +1 -1
  351. package/dist/esm/time-travel/servedView.d.ts +2 -2
  352. package/dist/esm/time-travel/servedView.js +2 -2
  353. package/dist/hosting/failedSettlement.js +19 -0
  354. package/dist/hosting/failedSettlement.js.map +1 -0
  355. package/dist/hosting/headers.js +20 -1
  356. package/dist/hosting/headers.js.map +1 -1
  357. package/dist/hosting/httpHost.js +5 -20
  358. package/dist/hosting/httpHost.js.map +1 -1
  359. package/dist/hosting/protocolRoute.js +9 -2
  360. package/dist/hosting/protocolRoute.js.map +1 -1
  361. package/dist/hosting/refusalStatus.js +5 -0
  362. package/dist/hosting/refusalStatus.js.map +1 -1
  363. package/dist/hosting/streamHandler/conversation.js +37 -0
  364. package/dist/hosting/streamHandler/conversation.js.map +1 -0
  365. package/dist/hosting/streamHandler/request.js +93 -0
  366. package/dist/hosting/streamHandler/request.js.map +1 -0
  367. package/dist/hosting/streamHandler/types.js +8 -0
  368. package/dist/hosting/streamHandler/types.js.map +1 -0
  369. package/dist/hosting/streamHandler.js +25 -132
  370. package/dist/hosting/streamHandler.js.map +1 -1
  371. package/dist/hosting/unstreamedText.js +1 -1
  372. package/dist/lib/iterationBudget.js +1 -1
  373. package/dist/lib/iterationBudget.js.map +1 -1
  374. package/dist/lib/toolBytes.js +2 -2
  375. package/dist/lib/toolBytes.js.map +1 -1
  376. package/dist/ontology/serve.js +2 -2
  377. package/dist/provider-contract/intervention.js +122 -0
  378. package/dist/provider-contract/intervention.js.map +1 -0
  379. package/dist/provider-contract/replaySafety.js +30 -0
  380. package/dist/provider-contract/replaySafety.js.map +1 -0
  381. package/dist/provider-contract/requestRefusal.js +3 -1
  382. package/dist/provider-contract/requestRefusal.js.map +1 -1
  383. package/dist/provider-contract/responseAdmission.js +96 -0
  384. package/dist/provider-contract/responseAdmission.js.map +1 -0
  385. package/dist/provider-contract/types/code.js +33 -0
  386. package/dist/provider-contract/types/code.js.map +1 -0
  387. package/dist/provider-contract/types/message.js +3 -0
  388. package/dist/provider-contract/types/message.js.map +1 -0
  389. package/dist/provider-contract/types/provider.js +3 -0
  390. package/dist/provider-contract/types/provider.js.map +1 -0
  391. package/dist/provider-contract/types/request.js +3 -0
  392. package/dist/provider-contract/types/request.js.map +1 -0
  393. package/dist/provider-contract/types/response.js +3 -0
  394. package/dist/provider-contract/types/response.js.map +1 -0
  395. package/dist/provider-contract/types.js +6 -29
  396. package/dist/provider-contract/types.js.map +1 -1
  397. package/dist/providers.js +5 -1
  398. package/dist/providers.js.map +1 -1
  399. package/dist/recorders/core/ErrorBridge.js +14 -0
  400. package/dist/recorders/core/ErrorBridge.js.map +1 -1
  401. package/dist/recorders/core/ResilienceRecorder.js +4 -4
  402. package/dist/reliability/buildReliabilityGateChart.js +2 -2
  403. package/dist/reliability/buildReliabilityGateChart.js.map +1 -1
  404. package/dist/resilience/replayAttempt.js +18 -6
  405. package/dist/resilience/replayAttempt.js.map +1 -1
  406. package/dist/resilience/withCircuitBreaker.js +29 -13
  407. package/dist/resilience/withCircuitBreaker.js.map +1 -1
  408. package/dist/resilience/withFallback.js +22 -7
  409. package/dist/resilience/withFallback.js.map +1 -1
  410. package/dist/resilience/withRetry.js +35 -11
  411. package/dist/resilience/withRetry.js.map +1 -1
  412. package/dist/time/convert/bounds.js +18 -2
  413. package/dist/time/convert/bounds.js.map +1 -1
  414. package/dist/time/convert/exact.js +26 -1
  415. package/dist/time/convert/exact.js.map +1 -1
  416. package/dist/time/convert.js +2 -2
  417. package/dist/time-travel/servedView/findings.js +2 -2
  418. package/dist/time-travel/servedView/findings.js.map +1 -1
  419. package/dist/time-travel/servedView/gaps.js +1 -1
  420. package/dist/time-travel/servedView/gaps.js.map +1 -1
  421. package/dist/time-travel/servedView/ontology.js +1 -1
  422. package/dist/time-travel/servedView.js +2 -2
  423. package/dist/types/adapters/llm/BedrockProvider/client.d.ts +12 -0
  424. package/dist/types/adapters/llm/BedrockProvider/client.d.ts.map +1 -0
  425. package/dist/types/adapters/llm/BedrockProvider/guardedStream.d.ts +8 -0
  426. package/dist/types/adapters/llm/BedrockProvider/guardedStream.d.ts.map +1 -0
  427. package/dist/types/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts +22 -0
  428. package/dist/types/adapters/llm/BedrockProvider/guardedStreamBuffer.d.ts.map +1 -0
  429. package/dist/types/adapters/llm/BedrockProvider/guardrailClassify.d.ts +9 -0
  430. package/dist/types/adapters/llm/BedrockProvider/guardrailClassify.d.ts.map +1 -0
  431. package/dist/types/adapters/llm/BedrockProvider/guardrailConfig.d.ts +31 -0
  432. package/dist/types/adapters/llm/BedrockProvider/guardrailConfig.d.ts.map +1 -0
  433. package/dist/types/adapters/llm/BedrockProvider/guardrailRead.d.ts +20 -0
  434. package/dist/types/adapters/llm/BedrockProvider/guardrailRead.d.ts.map +1 -0
  435. package/dist/types/adapters/llm/BedrockProvider/guardrailResponse.d.ts +14 -0
  436. package/dist/types/adapters/llm/BedrockProvider/guardrailResponse.d.ts.map +1 -0
  437. package/dist/types/adapters/llm/BedrockProvider/guardrailSchemas.d.ts +14 -0
  438. package/dist/types/adapters/llm/BedrockProvider/guardrailSchemas.d.ts.map +1 -0
  439. package/dist/types/adapters/llm/BedrockProvider/request.d.ts +5 -0
  440. package/dist/types/adapters/llm/BedrockProvider/request.d.ts.map +1 -0
  441. package/dist/types/adapters/llm/BedrockProvider/response.d.ts +33 -0
  442. package/dist/types/adapters/llm/BedrockProvider/response.d.ts.map +1 -0
  443. package/dist/types/adapters/llm/BedrockProvider/stream.d.ts +5 -0
  444. package/dist/types/adapters/llm/BedrockProvider/stream.d.ts.map +1 -0
  445. package/dist/types/adapters/llm/BedrockProvider/types.d.ts +175 -0
  446. package/dist/types/adapters/llm/BedrockProvider/types.d.ts.map +1 -0
  447. package/dist/types/adapters/llm/BedrockProvider.d.ts +5 -148
  448. package/dist/types/adapters/llm/BedrockProvider.d.ts.map +1 -1
  449. package/dist/types/adapters/llm/MockProvider.d.ts.map +1 -1
  450. package/dist/types/ag-ui/serializer/settle.d.ts +29 -0
  451. package/dist/types/ag-ui/serializer/settle.d.ts.map +1 -0
  452. package/dist/types/ag-ui/serializer/translate.d.ts +40 -0
  453. package/dist/types/ag-ui/serializer/translate.d.ts.map +1 -0
  454. package/dist/types/ag-ui/serializer/types.d.ts +67 -0
  455. package/dist/types/ag-ui/serializer/types.d.ts.map +1 -0
  456. package/dist/types/ag-ui/serializer/values.d.ts +40 -0
  457. package/dist/types/ag-ui/serializer/values.d.ts.map +1 -0
  458. package/dist/types/ag-ui/serializer.d.ts +3 -146
  459. package/dist/types/ag-ui/serializer.d.ts.map +1 -1
  460. package/dist/types/core/LLMCall/chart.d.ts +22 -0
  461. package/dist/types/core/LLMCall/chart.d.ts.map +1 -0
  462. package/dist/types/core/LLMCall.d.ts +3 -0
  463. package/dist/types/core/LLMCall.d.ts.map +1 -1
  464. package/dist/types/core/agent/buildAgentMessageApiChart.d.ts.map +1 -1
  465. package/dist/types/core/agent/buildDynamicAgentChart/boundary.d.ts +101 -0
  466. package/dist/types/core/agent/buildDynamicAgentChart/boundary.d.ts.map +1 -0
  467. package/dist/types/core/agent/buildDynamicAgentChart/engineBoundary.d.ts +52 -0
  468. package/dist/types/core/agent/buildDynamicAgentChart/engineBoundary.d.ts.map +1 -0
  469. package/dist/types/core/agent/buildDynamicAgentChart/finalBranch.d.ts +4 -0
  470. package/dist/types/core/agent/buildDynamicAgentChart/finalBranch.d.ts.map +1 -0
  471. package/dist/types/core/agent/buildDynamicAgentChart.d.ts +0 -50
  472. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  473. package/dist/types/core/agent/buildMessageApiChart.d.ts.map +1 -1
  474. package/dist/types/core/agent/composeRequest.d.ts +1 -1
  475. package/dist/types/core/agent/dynamicTurnSeed.d.ts.map +1 -1
  476. package/dist/types/core/agent/findings/answerText.d.ts +1 -1
  477. package/dist/types/core/agent/receipt/receipt.d.ts +2 -2
  478. package/dist/types/core/agent/runtime/terminal/verdicts.d.ts.map +1 -1
  479. package/dist/types/core/agent/stages/callLLM/acceptResponse.d.ts +7 -0
  480. package/dist/types/core/agent/stages/callLLM/acceptResponse.d.ts.map +1 -0
  481. package/dist/types/core/agent/stages/callLLM/executeCall.d.ts +27 -0
  482. package/dist/types/core/agent/stages/callLLM/executeCall.d.ts.map +1 -0
  483. package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts +89 -0
  484. package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts.map +1 -0
  485. package/dist/types/core/agent/stages/callLLM/responseAccounting.d.ts +11 -0
  486. package/dist/types/core/agent/stages/callLLM/responseAccounting.d.ts.map +1 -0
  487. package/dist/types/core/agent/stages/callLLM.d.ts +1 -1
  488. package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
  489. package/dist/types/core/agent/stages/reliabilityExecution/contracts.d.ts +54 -0
  490. package/dist/types/core/agent/stages/reliabilityExecution/contracts.d.ts.map +1 -0
  491. package/dist/types/core/agent/stages/reliabilityExecution/feedback.d.ts +20 -0
  492. package/dist/types/core/agent/stages/reliabilityExecution/feedback.d.ts.map +1 -0
  493. package/dist/types/core/agent/stages/reliabilityExecution/stuckLoop.d.ts +30 -0
  494. package/dist/types/core/agent/stages/reliabilityExecution/stuckLoop.d.ts.map +1 -0
  495. package/dist/types/core/agent/stages/reliabilityExecution.d.ts +4 -81
  496. package/dist/types/core/agent/stages/reliabilityExecution.d.ts.map +1 -1
  497. package/dist/types/core/agent/toolChoice/record.d.ts +1 -1
  498. package/dist/types/core/agent/window/toolNames.d.ts +1 -1
  499. package/dist/types/core/providerIntervention.d.ts +26 -0
  500. package/dist/types/core/providerIntervention.d.ts.map +1 -0
  501. package/dist/types/core/slots/buildMessagesSlot.d.ts +1 -1
  502. package/dist/types/core/terminalVerdict.d.ts +4 -0
  503. package/dist/types/core/terminalVerdict.d.ts.map +1 -1
  504. package/dist/types/core-flow/Graph.d.ts +1 -1
  505. package/dist/types/core-flow/Parallel/builder.d.ts +40 -0
  506. package/dist/types/core-flow/Parallel/builder.d.ts.map +1 -0
  507. package/dist/types/core-flow/Parallel/chart.d.ts +16 -0
  508. package/dist/types/core-flow/Parallel/chart.d.ts.map +1 -0
  509. package/dist/types/core-flow/Parallel/mapper.d.ts +22 -0
  510. package/dist/types/core-flow/Parallel/mapper.d.ts.map +1 -0
  511. package/dist/types/core-flow/Parallel/merge.d.ts +5 -0
  512. package/dist/types/core-flow/Parallel/merge.d.ts.map +1 -0
  513. package/dist/types/core-flow/Parallel/types.d.ts +180 -0
  514. package/dist/types/core-flow/Parallel/types.d.ts.map +1 -0
  515. package/dist/types/core-flow/Parallel.d.ts +7 -233
  516. package/dist/types/core-flow/Parallel.d.ts.map +1 -1
  517. package/dist/types/hosting/failedSettlement.d.ts +10 -0
  518. package/dist/types/hosting/failedSettlement.d.ts.map +1 -0
  519. package/dist/types/hosting/headers.d.ts +8 -0
  520. package/dist/types/hosting/headers.d.ts.map +1 -1
  521. package/dist/types/hosting/httpHost.d.ts.map +1 -1
  522. package/dist/types/hosting/httpStreaming.d.ts +5 -2
  523. package/dist/types/hosting/httpStreaming.d.ts.map +1 -1
  524. package/dist/types/hosting/protocolRoute.d.ts.map +1 -1
  525. package/dist/types/hosting/refusalStatus.d.ts +3 -0
  526. package/dist/types/hosting/refusalStatus.d.ts.map +1 -1
  527. package/dist/types/hosting/streamHandler/conversation.d.ts +18 -0
  528. package/dist/types/hosting/streamHandler/conversation.d.ts.map +1 -0
  529. package/dist/types/hosting/streamHandler/request.d.ts +13 -0
  530. package/dist/types/hosting/streamHandler/request.d.ts.map +1 -0
  531. package/dist/types/hosting/streamHandler/types.d.ts +107 -0
  532. package/dist/types/hosting/streamHandler/types.d.ts.map +1 -0
  533. package/dist/types/hosting/streamHandler.d.ts +3 -133
  534. package/dist/types/hosting/streamHandler.d.ts.map +1 -1
  535. package/dist/types/hosting/unstreamedText.d.ts +1 -1
  536. package/dist/types/lib/toolBytes.d.ts +1 -1
  537. package/dist/types/ontology/serve.d.ts +2 -2
  538. package/dist/types/provider-contract/intervention.d.ts +57 -0
  539. package/dist/types/provider-contract/intervention.d.ts.map +1 -0
  540. package/dist/types/provider-contract/replaySafety.d.ts +5 -0
  541. package/dist/types/provider-contract/replaySafety.d.ts.map +1 -0
  542. package/dist/types/provider-contract/requestRefusal.d.ts.map +1 -1
  543. package/dist/types/provider-contract/responseAdmission.d.ts +11 -0
  544. package/dist/types/provider-contract/responseAdmission.d.ts.map +1 -0
  545. package/dist/types/provider-contract/types/code.d.ts +435 -0
  546. package/dist/types/provider-contract/types/code.d.ts.map +1 -0
  547. package/dist/types/provider-contract/types/message.d.ts +227 -0
  548. package/dist/types/provider-contract/types/message.d.ts.map +1 -0
  549. package/dist/types/provider-contract/types/provider.d.ts +262 -0
  550. package/dist/types/provider-contract/types/provider.d.ts.map +1 -0
  551. package/dist/types/provider-contract/types/request.d.ts +94 -0
  552. package/dist/types/provider-contract/types/request.d.ts.map +1 -0
  553. package/dist/types/provider-contract/types/response.d.ts +143 -0
  554. package/dist/types/provider-contract/types/response.d.ts.map +1 -0
  555. package/dist/types/provider-contract/types.d.ts +7 -1149
  556. package/dist/types/provider-contract/types.d.ts.map +1 -1
  557. package/dist/types/providers.d.ts +2 -1
  558. package/dist/types/providers.d.ts.map +1 -1
  559. package/dist/types/recorders/core/ErrorBridge.d.ts +3 -1
  560. package/dist/types/recorders/core/ErrorBridge.d.ts.map +1 -1
  561. package/dist/types/recorders/core/ResilienceRecorder.d.ts +4 -4
  562. package/dist/types/reliability/buildReliabilityGateChart.d.ts +1 -1
  563. package/dist/types/resilience/replayAttempt.d.ts +1 -1
  564. package/dist/types/resilience/replayAttempt.d.ts.map +1 -1
  565. package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
  566. package/dist/types/resilience/withFallback.d.ts.map +1 -1
  567. package/dist/types/resilience/withRetry.d.ts.map +1 -1
  568. package/dist/types/time/convert/bounds.d.ts.map +1 -1
  569. package/dist/types/time/convert/exact.d.ts.map +1 -1
  570. package/dist/types/time/convert.d.ts +2 -2
  571. package/dist/types/time-travel/servedView.d.ts +2 -2
  572. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ import type { CallLLMStageDeps } from './types.js';
2
+ import type { TypedScope } from 'footprintjs';
3
+ import type { LLMMessage, LLMToolSchema } from '../../../../provider-contract/types.js';
4
+ import type { CacheMarker } from '../../../../cache/types.js';
5
+ import type { InjectionRecord } from '../../../../recorders/core/types.js';
6
+ import type { OntologyPiece } from '../../../../ontology/serve.js';
7
+ import type { AgentState } from '../../types.js';
8
+ export declare function prepareCall(scope: TypedScope<AgentState>, deps: CallLLMStageDeps): Promise<{
9
+ citations: {
10
+ attach(hooks: import("../../../../provider-contract/types.js").LLMCallHooks): import("../../../../provider-contract/types.js").LLMCallHooks;
11
+ accepted: (response: import("../../../../provider-contract/types.js").LLMResponse) => import("../../../../provider-contract/citationResponse.js").SubmittedCitationOffer | undefined;
12
+ } | undefined;
13
+ baseRequest: import("../../../../provider-contract/types.js").LLMRequest;
14
+ peel: typeof import("../../findings/peel.js") | undefined;
15
+ systemPromptInjections: readonly InjectionRecord[];
16
+ systemPieces: readonly (InjectionRecord | {
17
+ rawContent: string;
18
+ slot: "system-prompt";
19
+ source: "evidence-recovery";
20
+ } | OntologyPiece)[];
21
+ iteration: number;
22
+ provider: import("../../../../provider-contract/types.js").LLMProvider;
23
+ model: string;
24
+ recoveryPiece: {
25
+ rawContent: string;
26
+ slot: "system-prompt";
27
+ source: "evidence-recovery";
28
+ } | undefined;
29
+ committed: readonly LLMMessage[];
30
+ history: readonly LLMMessage[];
31
+ systemRecovery: {
32
+ rawContent: string;
33
+ slot: "system-prompt";
34
+ source: "evidence-recovery";
35
+ } | undefined;
36
+ systemPrompt: string;
37
+ trustedSystemPrompt: string;
38
+ activeToolSchemas: readonly LLMToolSchema[];
39
+ tail: readonly import("../../requestTurn/replayPrefix.js").RequestOnlyMessage[];
40
+ continuing: import("../../requestTurn/replayPrefix.js").ReplayPrefixProjection | undefined;
41
+ wireMessages: readonly LLMMessage[];
42
+ replayFrames: readonly import("../../requestTurn/replayPrefix.js").ReplayPrefixFrame[] | undefined;
43
+ detached: {
44
+ request: {
45
+ tools?: readonly LLMToolSchema[] | undefined;
46
+ messages: LLMMessage[];
47
+ systemPrompt?: string | undefined;
48
+ model: string;
49
+ temperature?: number | undefined;
50
+ maxTokens?: number | undefined;
51
+ stop?: readonly string[] | undefined;
52
+ signal?: AbortSignal | undefined;
53
+ cacheMarkers?: readonly CacheMarker[] | undefined;
54
+ thinking?: {
55
+ readonly budget: number;
56
+ } | undefined;
57
+ toolChoice?: {
58
+ readonly type: "tool";
59
+ readonly name: string;
60
+ } | undefined;
61
+ outputFormat?: {
62
+ readonly type: "json_schema";
63
+ readonly schema: Readonly<Record<string, unknown>>;
64
+ } | undefined;
65
+ };
66
+ markers: CacheMarker[];
67
+ outputFormat: {
68
+ readonly type: "json_schema";
69
+ readonly schema: Readonly<Record<string, unknown>>;
70
+ } | undefined;
71
+ };
72
+ selection: {
73
+ attempt(): {
74
+ observe(request: import("../../../../provider-contract/types.js").LLMRequest): void;
75
+ finish(response: import("../../../../provider-contract/types.js").LLMResponse): void;
76
+ };
77
+ accept(response: import("../../../../provider-contract/types.js").LLMResponse): import("../../../slots/commitServedTools.js").AcceptedToolSelection | undefined;
78
+ } | undefined;
79
+ serving: {
80
+ discard: () => void;
81
+ consumerFor(runId: string | undefined): import("../../types/state/records.js").SourceLinkConsumer | undefined;
82
+ beforeRequest(request: import("../../../../provider-contract/types.js").LLMRequest): void;
83
+ } | undefined;
84
+ llmRequest: import("../../../../provider-contract/types.js").LLMRequest;
85
+ startMs: number;
86
+ messages: readonly LLMMessage[];
87
+ }>;
88
+ export type PreparedCall = Awaited<ReturnType<typeof prepareCall>>;
89
+ //# sourceMappingURL=prepareCall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareCall.d.ts","sourceRoot":"","sources":["../../../../../../src/core/agent/stages/callLLM/prepareCall.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAiB9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,wBAAsB,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2etF;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Existing response accounting, including completed responses whose content is withheld. */
2
+ import type { TypedScope } from 'footprintjs';
3
+ import type { AgentState } from '../../types.js';
4
+ import type { LLMResponse } from '../../../../provider-contract/types.js';
5
+ import type { CallLLMStageDeps } from './types.js';
6
+ import type { PreparedCall } from './prepareCall.js';
7
+ import type { ExecutedCall } from './executeCall.js';
8
+ export declare function recordResponseTokens(scope: TypedScope<AgentState>, response: LLMResponse): void;
9
+ /** A completed assessment still reports usage; this is not delivery of an answer. */
10
+ export declare function recordTerminalResponse(scope: TypedScope<AgentState>, deps: CallLLMStageDeps, prepared: PreparedCall, executed: ExecutedCall): void;
11
+ //# sourceMappingURL=responseAccounting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responseAccounting.d.ts","sourceRoot":"","sources":["../../../../../../src/core/agent/stages/callLLM/responseAccounting.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAS/F;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,EAC7B,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,GACrB,IAAI,CAcN"}
@@ -1,4 +1,3 @@
1
- import type { CallLLMStageDeps } from './callLLM/types.js';
2
1
  /**
3
2
  * callLLM — the LLM-invocation stage of the agent's chart.
4
3
  *
@@ -21,6 +20,7 @@ import type { CallLLMStageDeps } from './callLLM/types.js';
21
20
  */
22
21
  import type { TypedScope } from 'footprintjs';
23
22
  import type { AgentState } from '../types.js';
23
+ import type { CallLLMStageDeps } from './callLLM/types.js';
24
24
  /**
25
25
  * Build the callLLM stage function. Captures the LLM provider + model
26
26
  * config + cache strategy via the deps object; everything per-iteration
@@ -1 +1 @@
1
- {"version":3,"file":"callLLM.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/callLLM.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS3D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiB9C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,GACrB,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAg7BlD;AAED,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"callLLM.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/callLLM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAmB3D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,GACrB,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAalD;AAED,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { LLMCallHooks, LLMProvider, LLMRequest, LLMResponse } from '../../../../provider-contract/types.js';
2
+ /** A single-shot LLM call function. Built once by `callLLM/executeCall.ts` and
3
+ * passed into this helper; we invoke it once per loop iteration. */
4
+ export type LLMCallFn = (request: LLMRequest, hooks: {
5
+ /** The actual selected transport; omitted on the direct, non-reliability path. */
6
+ provider?: LLMProvider;
7
+ /** Index in an explicit provider list, for response-side thinking dispatch. */
8
+ providerIndex?: number;
9
+ /** The per-call persistence/report channel, retained across attempts. */
10
+ providerHooks?: LLMCallHooks;
11
+ /** Called the first time a streaming chunk yields content. After
12
+ * this fires, mid-stream errors will escalate retry/fallback to
13
+ * fail-fast. */
14
+ onFirstChunk?: () => void;
15
+ }) => Promise<LLMResponse>;
16
+ /**
17
+ * v2.13 — Output-schema validation hook. Called by the reliability loop
18
+ * AFTER a successful LLM response, BEFORE the response is committed.
19
+ * Throw to signal validation failure — the gate treats the throw as a
20
+ * `'schema-fail'` errorKind and routes via PostDecide rules (which can
21
+ * `retry` with `feedbackForLLM` for Instructor-style schema retry).
22
+ *
23
+ * Sentinel error type — the loop unwraps `ValidationFailure` instances
24
+ * to extract `message` / `path` / `rawOutput` for the
25
+ * `agentfootprint.agent.output_schema_validation_failed` event payload.
26
+ *
27
+ * MUST-FIX #1 from the v2.13 7-panel review: the hook fires ONLY when
28
+ * `response.toolCalls.length === 0` (final-answer turn). Tool-call
29
+ * turns aren't terminal output and validation would be premature.
30
+ * Caller is responsible for the guard; this helper just runs whatever
31
+ * the caller passes.
32
+ */
33
+ export type OutputSchemaValidator = (response: LLMResponse) => void;
34
+ /**
35
+ * Sentinel error class thrown by an `OutputSchemaValidator` to signal
36
+ * a validation failure. Distinct subclass so the reliability loop can
37
+ * `instanceof` check and route to the schema-fail branch instead of
38
+ * treating it as a generic provider error.
39
+ */
40
+ export declare class ValidationFailure extends Error {
41
+ readonly stage: 'json-parse' | 'schema-validate';
42
+ readonly path?: string;
43
+ readonly rawOutput?: string;
44
+ constructor(opts: {
45
+ message: string;
46
+ stage: 'json-parse' | 'schema-validate';
47
+ path?: string;
48
+ rawOutput?: string;
49
+ });
50
+ }
51
+ /** Sentinel kind written to scope on a mid-stream failure that the
52
+ * rules wanted to retry. Surfaces in `ReliabilityFailFastError.kind`. */
53
+ export declare const MID_STREAM_KIND = "mid-stream-not-retryable";
54
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../../../src/core/agent/stages/reliabilityExecution/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,wCAAwC,CAAC;AAEhD;qEACqE;AACrE,MAAM,MAAM,SAAS,GAAG,CACtB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE;IACL,kFAAkF;IAClF,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;qBAEiB;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,KACE,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;AAEpE;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAChB,IAAI,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC;QACxC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CAOF;AAED;0EAC0E;AAC1E,eAAO,MAAM,eAAe,6BAA6B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { LLMRequest } from '../../../../provider-contract/types.js';
2
+ import type { ReliabilityScope } from '../../../../reliability/types.js';
3
+ /**
4
+ * v2.13 — apply a `feedbackForLLM` value to the next request by
5
+ * appending an ephemeral user message. Resolves the value to a string
6
+ * (sync or async); returns a NEW LLMRequest with the appended message.
7
+ *
8
+ * The new message is marked `ephemeral: true` so:
9
+ * • LLM sees it (counts toward this turn's context window)
10
+ * • observability (recorders / narrative / typed events) sees it
11
+ * • scope.history / memory writes do NOT persist it long-term
12
+ *
13
+ * Errors thrown by a function-form `feedbackForLLM` are caught and
14
+ * swallowed (with a fallback to a generic message) — a buggy
15
+ * feedback callback MUST NOT abort the agent run that the gate is
16
+ * already retrying. This is the v2.13 7-panel review's
17
+ * "callback-throw safety" requirement (OpenAI reviewer).
18
+ */
19
+ export declare function applyFeedback(request: LLMRequest, feedback: string | ((scope: ReliabilityScope) => string | Promise<string>), scope: ReliabilityScope): Promise<LLMRequest>;
20
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../../../../../src/core/agent/stages/reliabilityExecution/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAC1E,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,UAAU,CAAC,CAgBrB"}
@@ -0,0 +1,30 @@
1
+ import type { ReliabilityScope, ReliabilityRule } from '../../../../reliability/types.js';
2
+ /**
3
+ * v2.13 — stuck-loop detection helper. Returns `true` when the last
4
+ * `n` validation errors are IDENTICAL — a hallucinating model that
5
+ * keeps making the same mistake won't make progress on more retries.
6
+ *
7
+ * Default rule template — spread into your `postDecide` to short-circuit
8
+ * stuck loops:
9
+ *
10
+ * ```ts
11
+ * postDecide: [
12
+ * defaultStuckLoopRule, // ← spread first; fail-fast on stuck
13
+ * { when: (s) => s.validationError !== undefined && s.attempt < 3, then: 'retry', ... },
14
+ * ]
15
+ * ```
16
+ *
17
+ * @param scope The reliability scope view passed to rule predicates.
18
+ * @param n How many trailing identical errors trigger detection. Default 2.
19
+ */
20
+ export declare function lastNValidationErrorsMatch(scope: ReliabilityScope, n?: number): boolean;
21
+ /**
22
+ * v2.13 — drop-in PostDecide rule that fail-fasts when the last 2
23
+ * validation errors match. Spread into `postDecide` BEFORE retry
24
+ * rules so it short-circuits before another wasted attempt.
25
+ *
26
+ * The matched-rule kind `'schema-stuck-loop'` surfaces on
27
+ * `ReliabilityFailFastError.kind` for caller branching.
28
+ */
29
+ export declare const defaultStuckLoopRule: ReliabilityRule;
30
+ //# sourceMappingURL=stuckLoop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stuckLoop.d.ts","sourceRoot":"","sources":["../../../../../../src/core/agent/stages/reliabilityExecution/stuckLoop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAE1F;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC,SAAI,GAAG,OAAO,CAQlF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAKlC,CAAC"}
@@ -1,3 +1,6 @@
1
+ import { type LLMCallFn, type OutputSchemaValidator } from './reliabilityExecution/contracts.js';
2
+ export { ValidationFailure, MID_STREAM_KIND, type LLMCallFn, type OutputSchemaValidator, } from './reliabilityExecution/contracts.js';
3
+ export { lastNValidationErrorsMatch, defaultStuckLoopRule, } from './reliabilityExecution/stuckLoop.js';
1
4
  /**
2
5
  * reliabilityExecution — the retry-loop helper invoked by `callLLM`
3
6
  * when `Agent.create(...).reliability(config)` is configured.
@@ -44,60 +47,8 @@
44
47
  */
45
48
  import type { TypedScope } from 'footprintjs';
46
49
  import type { LLMCallHooks, LLMProvider, LLMRequest, LLMResponse } from '../../../provider-contract/types.js';
47
- import type { ReliabilityConfig, ReliabilityRule, ReliabilityScope } from '../../../reliability/types.js';
50
+ import type { ReliabilityConfig } from '../../../reliability/types.js';
48
51
  import type { AgentState } from '../types.js';
49
- /** A single-shot LLM call function. Built once by `callLLM.ts` and
50
- * passed into this helper; we invoke it once per loop iteration. */
51
- export type LLMCallFn = (request: LLMRequest, hooks: {
52
- /** The actual selected transport; omitted on the direct, non-reliability path. */
53
- provider?: LLMProvider;
54
- /** Index in an explicit provider list, for response-side thinking dispatch. */
55
- providerIndex?: number;
56
- /** The per-call persistence/report channel, retained across attempts. */
57
- providerHooks?: LLMCallHooks;
58
- /** Called the first time a streaming chunk yields content. After
59
- * this fires, mid-stream errors will escalate retry/fallback to
60
- * fail-fast. */
61
- onFirstChunk?: () => void;
62
- }) => Promise<LLMResponse>;
63
- /**
64
- * v2.13 — Output-schema validation hook. Called by the reliability loop
65
- * AFTER a successful LLM response, BEFORE the response is committed.
66
- * Throw to signal validation failure — the gate treats the throw as a
67
- * `'schema-fail'` errorKind and routes via PostDecide rules (which can
68
- * `retry` with `feedbackForLLM` for Instructor-style schema retry).
69
- *
70
- * Sentinel error type — the loop unwraps `ValidationFailure` instances
71
- * to extract `message` / `path` / `rawOutput` for the
72
- * `agentfootprint.agent.output_schema_validation_failed` event payload.
73
- *
74
- * MUST-FIX #1 from the v2.13 7-panel review: the hook fires ONLY when
75
- * `response.toolCalls.length === 0` (final-answer turn). Tool-call
76
- * turns aren't terminal output and validation would be premature.
77
- * Caller is responsible for the guard; this helper just runs whatever
78
- * the caller passes.
79
- */
80
- export type OutputSchemaValidator = (response: LLMResponse) => void;
81
- /**
82
- * Sentinel error class thrown by an `OutputSchemaValidator` to signal
83
- * a validation failure. Distinct subclass so the reliability loop can
84
- * `instanceof` check and route to the schema-fail branch instead of
85
- * treating it as a generic provider error.
86
- */
87
- export declare class ValidationFailure extends Error {
88
- readonly stage: 'json-parse' | 'schema-validate';
89
- readonly path?: string;
90
- readonly rawOutput?: string;
91
- constructor(opts: {
92
- message: string;
93
- stage: 'json-parse' | 'schema-validate';
94
- path?: string;
95
- rawOutput?: string;
96
- });
97
- }
98
- /** Sentinel kind written to scope on a mid-stream failure that the
99
- * rules wanted to retry. Surfaces in `ReliabilityFailFastError.kind`. */
100
- export declare const MID_STREAM_KIND = "mid-stream-not-retryable";
101
52
  /**
102
53
  * Run the reliability retry loop. Returns the committed `LLMResponse`
103
54
  * on success; calls `scope.$break(reason)` and returns `undefined` on
@@ -124,32 +75,4 @@ options?: {
124
75
  * before a parser or retry rule can turn it into a corrective call. */
125
76
  readonly isTerminalRefusal?: (response: LLMResponse) => boolean;
126
77
  }): Promise<LLMResponse | undefined>;
127
- /**
128
- * v2.13 — stuck-loop detection helper. Returns `true` when the last
129
- * `n` validation errors are IDENTICAL — a hallucinating model that
130
- * keeps making the same mistake won't make progress on more retries.
131
- *
132
- * Default rule template — spread into your `postDecide` to short-circuit
133
- * stuck loops:
134
- *
135
- * ```ts
136
- * postDecide: [
137
- * defaultStuckLoopRule, // ← spread first; fail-fast on stuck
138
- * { when: (s) => s.validationError !== undefined && s.attempt < 3, then: 'retry', ... },
139
- * ]
140
- * ```
141
- *
142
- * @param scope The reliability scope view passed to rule predicates.
143
- * @param n How many trailing identical errors trigger detection. Default 2.
144
- */
145
- export declare function lastNValidationErrorsMatch(scope: ReliabilityScope, n?: number): boolean;
146
- /**
147
- * v2.13 — drop-in PostDecide rule that fail-fasts when the last 2
148
- * validation errors match. Spread into `postDecide` BEFORE retry
149
- * rules so it short-circuits before another wasted attempt.
150
- *
151
- * The matched-rule kind `'schema-stuck-loop'` surfaces on
152
- * `ReliabilityFailFastError.kind` for caller branching.
153
- */
154
- export declare const defaultStuckLoopRule: ReliabilityRule;
155
78
  //# sourceMappingURL=reliabilityExecution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reliabilityExecution.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/reliabilityExecution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,qCAAqC,CAAC;AAa7C,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;qEACqE;AACrE,MAAM,MAAM,SAAS,GAAG,CACtB,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE;IACL,kFAAkF;IAClF,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;qBAEiB;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,KACE,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;AAEpE;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAChB,IAAI,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC;QACxC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CAOF;AAED;0EAC0E;AAC1E,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAM1D;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,EAC7B,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,iBAAiB,EACzB,eAAe,EAAE,WAAW,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS;AACjB;;;;;iEAKiE;AACjE,YAAY,CAAC,EAAE,qBAAqB;AACpC;;;8DAG8D;AAC9D,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACtC,uFAAuF;IACvF,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,IAAI,CAAC;IAC/D;2EACuE;IACvE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,OAAO,CAAC;CACjE,GACA,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAsclC;AAwCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC,SAAI,GAAG,OAAO,CAQlF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAKlC,CAAC"}
1
+ {"version":3,"file":"reliabilityExecution.d.ts","sourceRoot":"","sources":["../../../../../src/core/agent/stages/reliabilityExecution.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,SAAS,EACd,KAAK,qBAAqB,GAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,qCAAqC,CAAC;AAa7C,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM9C;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,EAC7B,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,iBAAiB,EACzB,eAAe,EAAE,WAAW,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS;AACjB;;;;;iEAKiE;AACjE,YAAY,CAAC,EAAE,qBAAqB;AACpC;;;8DAG8D;AAC9D,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACtC,uFAAuF;IACvF,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,IAAI,CAAC;IAC/D;2EACuE;IACvE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,OAAO,CAAC;CACjE,GACA,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAuclC"}
@@ -5,7 +5,7 @@
5
5
  * recordFindings`, `middleware/ledger.ts · recordDecisions`).
6
6
  * Role: core/ layer leaf. Two call sites, one writer: the tools slot
7
7
  * files the `pick` / `pick-error` row before the model call
8
- * (`slots/buildToolsSlot.ts · composeStage`), `stages/callLLM.ts`
8
+ * (`slots/buildToolsSlot.ts · composeStage`), `stages/callLLM/acceptResponse.ts`
9
9
  * files the `outcome` row after the reply. Both go through
10
10
  * `recordToolChoice`, so the key is appended one way and the
11
11
  * matching event fires once per row.
@@ -40,7 +40,7 @@
40
40
  * `'last-tool-result'` pin (`lastToolResult.ts` · `toolResultPinsOf`) is not
41
41
  * moved off a tool's real result onto the sentence, the drop notice and
42
42
  * `WindowRecord.droppedObservations` do not report a result that never
43
- * existed, and the closure check (`../stages/callLLM.ts`) does not count the
43
+ * existed, and the closure check (`../stages/callLLM/prepareCall.ts`) does not count the
44
44
  * sentence as a re-fetched ground.
45
45
  */
46
46
  import type { LLMMessage } from '../../../provider-contract/types.js';
@@ -0,0 +1,26 @@
1
+ /** Native accepted-response admission, shared by model-calling charts. */
2
+ import { type TypedScope } from 'footprintjs';
3
+ import { type ProviderIntervention } from '../provider-contract/intervention.js';
4
+ export interface ProviderInterventionState {
5
+ /** The accepted response's sole safe intervention fact; never raw assessment data. */
6
+ providerIntervention?: readonly [] | readonly [ProviderIntervention];
7
+ }
8
+ /** A fresh grouped turn must explicitly clear a fact its parent carried before it. */
9
+ export declare function seedProviderIntervention<T extends object>(scope: TypedScope<T>, args: object): void;
10
+ /** Grouped/native mounts carry only a fact the accepted-response stage wrote. */
11
+ export declare function interventionRecordOf(state: Readonly<Record<string, unknown>>): ProviderInterventionState;
12
+ export declare function interventionVerdictOf(state: Readonly<Record<string, unknown>>): {
13
+ readonly kind: 'provider-intervention';
14
+ readonly intervention: ProviderIntervention;
15
+ } | undefined;
16
+ /**
17
+ * This invocation owns the accepted response, before its tools or text.
18
+ * No intervention means no new scope read or write. Only masked output continues.
19
+ * The decision reads the admitted fact, rather than inferring it from stop prose.
20
+ */
21
+ export declare function admitProviderIntervention<T extends object>(scope: TypedScope<T>, response: unknown, beforeBreak?: () => void): boolean;
22
+ /** Formatter failure keeps its original cause outside serializable scope state. */
23
+ export declare function admitInterventionError<T extends object>(scope: TypedScope<T>, error: unknown): never;
24
+ /** Direct-call boundaries with no terminal-state mapper raise the same typed error. */
25
+ export declare function requireUsableProviderResponse<T extends object>(scope: TypedScope<T>, response: unknown, beforeRefusal?: () => void): void;
26
+ //# sourceMappingURL=providerIntervention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providerIntervention.d.ts","sourceRoot":"","sources":["../../../src/core/providerIntervention.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,yBAAyB;IACxC,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC;CACtE;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,EACvD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,MAAM,GACX,IAAI,CAGN;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvC,yBAAyB,CAQ3B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAEtC;IAAE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;CAAE,GACvF,SAAS,CAKZ;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EACxD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,QAAQ,EAAE,OAAO,EACjB,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,OAAO,CA+CT;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EACrD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,OAAO,GACb,KAAK,CAOP;AAED,uFAAuF;AACvF,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,MAAM,EAC5D,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,QAAQ,EAAE,OAAO,EACjB,aAAa,CAAC,EAAE,MAAM,IAAI,GACzB,IAAI,CAgBN"}
@@ -13,7 +13,7 @@
13
13
  * InjectionRecord per message, with the source, reason, role and
14
14
  * position a consumer needs to see what the turn was made of. It is not
15
15
  * the wire. The request's message list comes from `scope.history`
16
- * directly (`stages/callLLM.ts`), because the projection flattens away
16
+ * directly (`stages/callLLM/prepareCall.ts`), because the projection flattens away
17
17
  * the LLM-protocol shape a provider needs — an assistant turn's
18
18
  * `toolCalls[]`, a tool turn's `toolCallId`.
19
19
  *
@@ -19,8 +19,12 @@ import { type ReliabilityFailRecord } from '../reliability/failFastRecord.js';
19
19
  import { type PolicyHaltContext } from '../security/PolicyHaltError.js';
20
20
  import { type UnsupportedValuesContext } from './agent/evidence/errors.js';
21
21
  import { type MessageDeniedContext } from './agent/middleware/errors.js';
22
+ import { type ProviderIntervention } from '../provider-contract/intervention.js';
22
23
  /** Each verdict keeps exactly what its error is built from. */
23
24
  export type TerminalVerdict = {
25
+ readonly kind: 'provider-intervention';
26
+ readonly intervention: ProviderIntervention;
27
+ } | {
24
28
  readonly kind: 'reliability-fail-fast';
25
29
  readonly record: ReliabilityFailRecord;
26
30
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"terminalVerdict.d.ts","sourceRoot":"","sources":["../../../src/core/terminalVerdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAA0B,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAE7F,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAClF;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAClE;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;CAAE,GACnF;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAEpF,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAanF;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AAEhG,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,YAAY,CAAC;CAC5C;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAMhF"}
1
+ {"version":3,"file":"terminalVerdict.d.ts","sourceRoot":"","sources":["../../../src/core/terminalVerdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAmB,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAA0B,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,sCAAsC,CAAC;AAE9C,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;CAAE,GACvF;IAAE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAClF;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAClE;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;CAAE,GACnF;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAEpF,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAenF;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AAEhG,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,YAAY,CAAC;CAC5C;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAMhF"}
@@ -38,7 +38,7 @@
38
38
  * `workflow()` (v7.10.0) exists precisely because of this.
39
39
  * 2. `Parallel` has the SAME limit one layer down: its branch type is
40
40
  * `Runner<{ message: string }, string>` and its branch `outputMapper`
41
- * coerces a non-string branch output to `''` (`Parallel.ts`, the
41
+ * coerces a non-string branch output to `''` (`Parallel/chart.ts`, the
42
42
  * `typeof sfOutput === 'string' ? sfOutput : ''` mapper). So a
43
43
  * Parallel level cannot carry a structured value either.
44
44
  *
@@ -0,0 +1,40 @@
1
+ import { Parallel } from '../Parallel.js';
2
+ import type { ParallelOptions, ParallelBranchOptions, BranchChild, MergeFn, MergeOutcomesFn, MergeWithLLMOptions } from './types.js';
3
+ /** Fluent builder. Requires at least 2 branches + one merge strategy. */
4
+ export declare class ParallelBuilder {
5
+ private readonly opts;
6
+ private readonly branches;
7
+ private merge;
8
+ private readonly seenIds;
9
+ constructor(opts: ParallelOptions);
10
+ /**
11
+ * Add a branch. All branches run concurrently with the same input.
12
+ *
13
+ * Third arg accepts EITHER a legacy bare `name` string (back-compat
14
+ * with pre-L1c callers) OR a `ParallelBranchOptions` bag containing
15
+ * `name` and/or a per-method `groupTranslator` override. The
16
+ * override applies ONLY to this branch's `member.uiGroup` and does
17
+ * not affect any other branch or the runner's own translator.
18
+ */
19
+ branch(id: string, runner: BranchChild, nameOrOpts?: string | ParallelBranchOptions): this;
20
+ /**
21
+ * Merge branch results via a pure function.
22
+ * `fn` receives `{ [branchId]: string }` and returns the merged string.
23
+ */
24
+ mergeWithFn(fn: MergeFn): this;
25
+ /** Merge branch results by feeding them to an LLM for synthesis. */
26
+ mergeWithLLM(opts: MergeWithLLMOptions): this;
27
+ /**
28
+ * Tolerant merge — receives `{ [branchId]: BranchOutcome }` including
29
+ * both successes (`{ ok: true, value }`) and failures (`{ ok: false, error }`).
30
+ * Parallel does NOT throw on partial failure when this merge variant is
31
+ * used; the consumer's `fn` decides how to handle it (fall back, surface
32
+ * a warning, retry at a higher level, etc.).
33
+ *
34
+ * Use the default `mergeWithFn` / `mergeWithLLM` variants when you want
35
+ * a single failing branch to abort the whole Parallel loudly.
36
+ */
37
+ mergeOutcomesWithFn(fn: MergeOutcomesFn): this;
38
+ build(): Parallel;
39
+ }
40
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../src/core-flow/Parallel/builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACrB,WAAW,EAGX,OAAO,EACP,eAAe,EACf,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,yEAAyE;AACzE,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;gBAEjC,IAAI,EAAE,eAAe;IAIjC;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI;IAqC1F;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IAQ9B,oEAAoE;IACpE,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAQ7C;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI;IAQ9C,KAAK,IAAI,QAAQ;CAQlB"}
@@ -0,0 +1,16 @@
1
+ import { type FlowChart, type StructureRecorder, type TypedScope } from 'footprintjs';
2
+ import type { BranchEntry, BranchErrorRecord, MergeStrategy, ParallelState, ParallelInput } from './types.js';
3
+ export interface ParallelChartContext {
4
+ readonly branches: readonly BranchEntry[];
5
+ readonly merge: MergeStrategy;
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly structureRecorders?: readonly StructureRecorder[];
9
+ readonly requiredIds: ReadonlySet<string>;
10
+ readonly failFastEngaged: boolean;
11
+ readonly enterComposition: (scope: TypedScope<ParallelState>, args: ParallelInput) => void;
12
+ readonly errorsFor: (scope: unknown) => Map<string, BranchErrorRecord>;
13
+ readonly runStartFor: (scope: unknown) => number;
14
+ }
15
+ export declare function buildParallelChart(context: ParallelChartContext): FlowChart;
16
+ //# sourceMappingURL=chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../../src/core-flow/Parallel/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAOjG,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EAEjB,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3F,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACvE,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CAClD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CA8N3E"}
@@ -0,0 +1,22 @@
1
+ import type { BranchErrorRecord } from './types.js';
2
+ /**
3
+ * Wrap a branch's `outputMapper` so a mapper throw is ATTRIBUTED to its
4
+ * branch before footprintjs swallows it.
5
+ *
6
+ * footprintjs's `SubflowExecutor` catches outputMapper errors into
7
+ * `parentContext.addError('outputMapperError', ...)` WITHOUT firing
8
+ * `FlowRecorder.onError` — so Parallel's internal `parallel-branch-errors`
9
+ * recorder never sees them, and the Merge stage would fall back to
10
+ * `'unknown error'` for the missing branch id. Recording into the
11
+ * branch-error map here (first error per branch wins, mirroring the
12
+ * recorder's semantics) closes that attribution gap. The error is then
13
+ * RETHROWN so footprintjs's existing bookkeeping stays untouched: the
14
+ * `outputMapperError` debug entry is still written and the branch id is
15
+ * still absent from `branchResults` (which is how the Merge stage detects
16
+ * the failure).
17
+ *
18
+ * @internal Exported for direct unit testing — not part of the public API
19
+ * (not re-exported from the package barrel).
20
+ */
21
+ export declare function wrapBranchOutputMapper(branchId: string, errorsFor: (binding: unknown) => Map<string, BranchErrorRecord>, inner: (sfOutput: unknown) => Record<string, unknown>): (sfOutput: unknown, parent?: unknown, binding?: unknown) => Record<string, unknown>;
22
+ //# sourceMappingURL=mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/core-flow/Parallel/mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC/D,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpD,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAerF"}
@@ -0,0 +1,5 @@
1
+ import type { TypedScope } from 'footprintjs';
2
+ import type { ParallelState, MergeWithLLMOptions } from './types.js';
3
+ export declare function mergeWithLLM(scope: TypedScope<ParallelState>, opts: MergeWithLLMOptions, results: Readonly<Record<string, string>>): Promise<string>;
4
+ export declare function truncate(s: string, n: number): string;
5
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../src/core-flow/Parallel/merge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQrE,wBAAsB,YAAY,CAChC,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,EAChC,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,OAAO,CAAC,MAAM,CAAC,CAkDjB;AAMD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD"}