agentfootprint 6.44.0 → 7.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 (442) hide show
  1. package/AGENTS.md +4 -0
  2. package/CLAUDE.md +4 -0
  3. package/README.md +141 -167
  4. package/ai-instructions/claude-code/SKILL.md +11 -0
  5. package/ai-instructions/setup.sh +0 -0
  6. package/dist/adapters/llm/BrowserOpenAIProvider.js +1 -1
  7. package/dist/adapters/llm/MockProvider.js +2 -1
  8. package/dist/adapters/llm/MockProvider.js.map +1 -1
  9. package/dist/core/agent/buildAgentChart.js +2 -1
  10. package/dist/core/agent/buildAgentChart.js.map +1 -1
  11. package/dist/core/agent/buildDynamicAgentChart.js +3 -1
  12. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  13. package/dist/core/agent/stages/pickEntry.js +3 -1
  14. package/dist/core/agent/stages/pickEntry.js.map +1 -1
  15. package/dist/debug/finders.js +29 -0
  16. package/dist/debug/finders.js.map +1 -0
  17. package/dist/debug.js +134 -0
  18. package/dist/debug.js.map +1 -0
  19. package/dist/esm/adapters/identity/agentcore.d.ts +100 -0
  20. package/dist/esm/adapters/llm/AnthropicProvider.d.ts +130 -0
  21. package/dist/esm/adapters/llm/BedrockProvider.d.ts +100 -0
  22. package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +41 -0
  23. package/dist/esm/adapters/llm/BrowserOpenAIProvider.d.ts +95 -0
  24. package/dist/esm/adapters/llm/BrowserOpenAIProvider.js +1 -1
  25. package/dist/esm/adapters/llm/MockProvider.d.ts +154 -0
  26. package/dist/esm/adapters/llm/MockProvider.js +2 -1
  27. package/dist/esm/adapters/llm/MockProvider.js.map +1 -1
  28. package/dist/esm/adapters/llm/OpenAIProvider.d.ts +220 -0
  29. package/dist/esm/adapters/llm/createProvider.d.ts +85 -0
  30. package/dist/esm/adapters/memory/agentcore.d.ts +146 -0
  31. package/dist/esm/adapters/memory/bedrockAgentMemory.d.ts +95 -0
  32. package/dist/esm/adapters/memory/redis.d.ts +127 -0
  33. package/dist/esm/adapters/observability/agentcore.d.ts +67 -0
  34. package/dist/esm/adapters/observability/audit.d.ts +254 -0
  35. package/dist/esm/adapters/observability/cloudwatch.d.ts +96 -0
  36. package/dist/esm/adapters/observability/otel.d.ts +237 -0
  37. package/dist/esm/adapters/observability/xray.d.ts +88 -0
  38. package/dist/esm/adapters/types.d.ts +378 -0
  39. package/dist/esm/bridge/eventMeta.d.ts +59 -0
  40. package/dist/esm/cache/CacheDecisionSubflow.d.ts +85 -0
  41. package/dist/esm/cache/CacheGateDecider.d.ts +127 -0
  42. package/dist/esm/cache/applyCachePolicy.d.ts +37 -0
  43. package/dist/esm/cache/cacheRecorder.d.ts +85 -0
  44. package/dist/esm/cache/index.d.ts +33 -0
  45. package/dist/esm/cache/strategies/AnthropicCacheStrategy.d.ts +38 -0
  46. package/dist/esm/cache/strategies/BedrockCacheStrategy.d.ts +33 -0
  47. package/dist/esm/cache/strategies/NoOpCacheStrategy.d.ts +29 -0
  48. package/dist/esm/cache/strategies/OpenAICacheStrategy.d.ts +36 -0
  49. package/dist/esm/cache/strategyRegistry.d.ts +45 -0
  50. package/dist/esm/cache/types.d.ts +243 -0
  51. package/dist/esm/conventions.d.ts +203 -0
  52. package/dist/esm/core/Agent.d.ts +355 -0
  53. package/dist/esm/core/LLMCall.d.ts +139 -0
  54. package/dist/esm/core/RunnerBase.d.ts +267 -0
  55. package/dist/esm/core/agent/AgentBuilder.d.ts +565 -0
  56. package/dist/esm/core/agent/buildAgentChart.d.ts +109 -0
  57. package/dist/esm/core/agent/buildAgentChart.js +2 -1
  58. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  59. package/dist/esm/core/agent/buildAgentMessageApiChart.d.ts +40 -0
  60. package/dist/esm/core/agent/buildCacheSubflow.d.ts +35 -0
  61. package/dist/esm/core/agent/buildDynamicAgentChart.d.ts +56 -0
  62. package/dist/esm/core/agent/buildDynamicAgentChart.js +3 -1
  63. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  64. package/dist/esm/core/agent/buildMessageApiChart.d.ts +47 -0
  65. package/dist/esm/core/agent/buildToolRegistry.d.ts +61 -0
  66. package/dist/esm/core/agent/memoryRecallInjections.d.ts +8 -0
  67. package/dist/esm/core/agent/stages/breakFinal.d.ts +22 -0
  68. package/dist/esm/core/agent/stages/callLLM.d.ts +74 -0
  69. package/dist/esm/core/agent/stages/pickEntry.d.ts +19 -0
  70. package/dist/esm/core/agent/stages/pickEntry.js +3 -1
  71. package/dist/esm/core/agent/stages/pickEntry.js.map +1 -1
  72. package/dist/esm/core/agent/stages/prepareFinal.d.ts +19 -0
  73. package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +135 -0
  74. package/dist/esm/core/agent/stages/route.d.ts +18 -0
  75. package/dist/esm/core/agent/stages/seed.d.ts +53 -0
  76. package/dist/esm/core/agent/stages/toolCalls.d.ts +76 -0
  77. package/dist/esm/core/agent/toolArgsValidation.d.ts +62 -0
  78. package/dist/esm/core/agent/types.d.ts +382 -0
  79. package/dist/esm/core/agent/validators.d.ts +52 -0
  80. package/dist/esm/core/cost.d.ts +38 -0
  81. package/dist/esm/core/flowchartAsTool.d.ts +200 -0
  82. package/dist/esm/core/humanizeLLMError.d.ts +23 -0
  83. package/dist/esm/core/outputFallback.d.ts +139 -0
  84. package/dist/esm/core/outputSchema.d.ts +127 -0
  85. package/dist/esm/core/pause.d.ts +74 -0
  86. package/dist/esm/core/runCheckpoint.d.ts +179 -0
  87. package/dist/esm/core/runner.d.ts +203 -0
  88. package/dist/esm/core/slots/buildMessagesSlot.d.ts +40 -0
  89. package/dist/esm/core/slots/buildSystemPromptSlot.d.ts +41 -0
  90. package/dist/esm/core/slots/buildThinkingSubflow.d.ts +40 -0
  91. package/dist/esm/core/slots/buildToolsSlot.d.ts +60 -0
  92. package/dist/esm/core/slots/helpers.d.ts +27 -0
  93. package/dist/esm/core/toolContract.d.ts +43 -0
  94. package/dist/esm/core/tools.d.ts +90 -0
  95. package/dist/esm/core/translator.d.ts +94 -0
  96. package/dist/esm/core-flow/Conditional.d.ts +119 -0
  97. package/dist/esm/core-flow/Loop.d.ts +160 -0
  98. package/dist/esm/core-flow/Parallel.d.ts +360 -0
  99. package/dist/esm/core-flow/Sequence.d.ts +133 -0
  100. package/dist/esm/debug/finders.d.ts +12 -0
  101. package/dist/esm/debug/finders.js +13 -0
  102. package/dist/esm/debug/finders.js.map +1 -0
  103. package/dist/esm/debug.d.ts +25 -0
  104. package/dist/esm/debug.js +54 -0
  105. package/dist/esm/debug.js.map +1 -0
  106. package/dist/esm/events/dispatcher.d.ts +134 -0
  107. package/dist/esm/events/payloads.d.ts +761 -0
  108. package/dist/esm/events/registry.d.ts +198 -0
  109. package/dist/esm/events/types.d.ts +70 -0
  110. package/dist/esm/events.d.ts +18 -0
  111. package/dist/esm/events.js +22 -0
  112. package/dist/esm/events.js.map +1 -0
  113. package/dist/esm/identity/kinds.d.ts +36 -0
  114. package/dist/esm/identity/staticTokens.d.ts +28 -0
  115. package/dist/esm/identity/types.d.ts +113 -0
  116. package/dist/esm/identity/withCredentialRetry.d.ts +64 -0
  117. package/dist/esm/identity.d.ts +31 -0
  118. package/dist/esm/index.d.ts +44 -0
  119. package/dist/esm/index.js +7 -52
  120. package/dist/esm/index.js.map +1 -1
  121. package/dist/esm/injection-engine.d.ts +4 -0
  122. package/dist/esm/lib/canonicalJson.d.ts +56 -0
  123. package/dist/esm/lib/context-bisect/ablation.d.ts +109 -0
  124. package/dist/esm/lib/context-bisect/bisect.d.ts +75 -0
  125. package/dist/esm/lib/context-bisect/cost.d.ts +37 -0
  126. package/dist/esm/lib/context-bisect/index.d.ts +31 -0
  127. package/dist/esm/lib/context-bisect/index.js +3 -0
  128. package/dist/esm/lib/context-bisect/index.js.map +1 -1
  129. package/dist/esm/lib/context-bisect/llmEdgeWeigher.d.ts +124 -0
  130. package/dist/esm/lib/context-bisect/localize.d.ts +152 -0
  131. package/dist/esm/lib/context-bisect/localize.js +2 -0
  132. package/dist/esm/lib/context-bisect/localize.js.map +1 -1
  133. package/dist/esm/lib/context-bisect/loop-recall.d.ts +97 -0
  134. package/dist/esm/lib/context-bisect/missingContext.d.ts +71 -0
  135. package/dist/esm/lib/context-bisect/restoration.d.ts +39 -0
  136. package/dist/esm/lib/context-bisect/toBacktrackTrace.d.ts +138 -0
  137. package/dist/esm/lib/context-bisect/trajectory.d.ts +168 -0
  138. package/dist/esm/lib/context-bisect/types.d.ts +448 -0
  139. package/dist/esm/lib/context-bisect/walk-to-root.d.ts +103 -0
  140. package/dist/esm/lib/influence-core/attributability.d.ts +72 -0
  141. package/dist/esm/lib/influence-core/cache.d.ts +94 -0
  142. package/dist/esm/lib/influence-core/contrastive.d.ts +26 -0
  143. package/dist/esm/lib/influence-core/index.d.ts +34 -0
  144. package/dist/esm/lib/influence-core/margin.d.ts +33 -0
  145. package/dist/esm/lib/influence-core/signals.d.ts +128 -0
  146. package/dist/esm/lib/influence-core/similarity.d.ts +25 -0
  147. package/dist/esm/lib/influence-core/types.d.ts +252 -0
  148. package/dist/esm/lib/injection-engine/SkillRegistry.d.ts +147 -0
  149. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.d.ts +110 -0
  150. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
  151. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  152. package/dist/esm/lib/injection-engine/entryScorer.d.ts +93 -0
  153. package/dist/esm/lib/injection-engine/entryScorer.js +172 -0
  154. package/dist/esm/lib/injection-engine/entryScorer.js.map +1 -0
  155. package/dist/esm/lib/injection-engine/evaluator.d.ts +24 -0
  156. package/dist/esm/lib/injection-engine/factories/defineFact.d.ts +60 -0
  157. package/dist/esm/lib/injection-engine/factories/defineInjection.d.ts +41 -0
  158. package/dist/esm/lib/injection-engine/factories/defineInstruction.d.ts +78 -0
  159. package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.d.ts +26 -0
  160. package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +160 -0
  161. package/dist/esm/lib/injection-engine/factories/defineSteering.d.ts +39 -0
  162. package/dist/esm/lib/injection-engine/index.d.ts +22 -0
  163. package/dist/esm/lib/injection-engine/index.js +2 -1
  164. package/dist/esm/lib/injection-engine/index.js.map +1 -1
  165. package/dist/esm/lib/injection-engine/skillContract.d.ts +29 -0
  166. package/dist/esm/lib/injection-engine/skillGraph.d.ts +290 -0
  167. package/dist/esm/lib/injection-engine/skillGraph.js +38 -43
  168. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  169. package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +49 -0
  170. package/dist/esm/lib/injection-engine/skillTools.d.ts +72 -0
  171. package/dist/esm/lib/injection-engine/softmax.d.ts +11 -0
  172. package/dist/esm/lib/injection-engine/types.d.ts +229 -0
  173. package/dist/esm/lib/injection-engine/types.js.map +1 -1
  174. package/dist/esm/lib/lazyRequire.d.ts +29 -0
  175. package/dist/esm/lib/mcp/index.d.ts +9 -0
  176. package/dist/esm/lib/mcp/mcpClient.d.ts +46 -0
  177. package/dist/esm/lib/mcp/mockMcpClient.d.ts +65 -0
  178. package/dist/esm/lib/mcp/types.d.ts +133 -0
  179. package/dist/esm/lib/rag/defineRAG.d.ts +139 -0
  180. package/dist/esm/lib/rag/defineRAG.js +3 -3
  181. package/dist/esm/lib/rag/index.d.ts +7 -0
  182. package/dist/esm/lib/rag/indexDocuments.d.ts +106 -0
  183. package/dist/esm/lib/rag/indexDocuments.js +2 -1
  184. package/dist/esm/lib/rag/indexDocuments.js.map +1 -1
  185. package/dist/esm/lib/tool-lint/analyze.d.ts +83 -0
  186. package/dist/esm/lib/tool-lint/cli.d.ts +43 -0
  187. package/dist/esm/lib/tool-lint/format.d.ts +18 -0
  188. package/dist/esm/lib/tool-lint/index.d.ts +23 -0
  189. package/dist/esm/lib/tool-lint/rules.d.ts +85 -0
  190. package/dist/esm/lib/tool-lint/types.d.ts +155 -0
  191. package/dist/esm/lib/trace-toolpack/bounded.d.ts +47 -0
  192. package/dist/esm/lib/trace-toolpack/debugPrompt.d.ts +19 -0
  193. package/dist/esm/lib/trace-toolpack/index.d.ts +20 -0
  194. package/dist/esm/lib/trace-toolpack/lazyToolpack.d.ts +35 -0
  195. package/dist/esm/lib/trace-toolpack/selfExplain.d.ts +100 -0
  196. package/dist/esm/lib/trace-toolpack/traceDebugAgent.d.ts +42 -0
  197. package/dist/esm/lib/trace-toolpack/traceToolpack.d.ts +69 -0
  198. package/dist/esm/lib/trace-toolpack/types.d.ts +59 -0
  199. package/dist/esm/llm-providers.d.ts +26 -0
  200. package/dist/esm/locales/index.d.ts +141 -0
  201. package/dist/esm/locales/index.js +7 -0
  202. package/dist/esm/locales/index.js.map +1 -1
  203. package/dist/esm/memory/beats/extractBeats.d.ts +61 -0
  204. package/dist/esm/memory/beats/extractor.d.ts +47 -0
  205. package/dist/esm/memory/beats/formatAsNarrative.d.ts +62 -0
  206. package/dist/esm/memory/beats/heuristicExtractor.d.ts +37 -0
  207. package/dist/esm/memory/beats/index.d.ts +12 -0
  208. package/dist/esm/memory/beats/llmExtractor.d.ts +56 -0
  209. package/dist/esm/memory/beats/types.d.ts +60 -0
  210. package/dist/esm/memory/beats/writeBeats.d.ts +22 -0
  211. package/dist/esm/memory/causal/evidenceRecorder.d.ts +66 -0
  212. package/dist/esm/memory/causal/index.d.ts +6 -0
  213. package/dist/esm/memory/causal/loadSnapshot.d.ts +51 -0
  214. package/dist/esm/memory/causal/snapshotPipeline.d.ts +35 -0
  215. package/dist/esm/memory/causal/types.d.ts +134 -0
  216. package/dist/esm/memory/causal/types.js.map +1 -1
  217. package/dist/esm/memory/causal/writeSnapshot.d.ts +73 -0
  218. package/dist/esm/memory/define.d.ts +63 -0
  219. package/dist/esm/memory/define.types.d.ts +278 -0
  220. package/dist/esm/memory/define.types.js +6 -4
  221. package/dist/esm/memory/define.types.js.map +1 -1
  222. package/dist/esm/memory/embedding/cosine.d.ts +18 -0
  223. package/dist/esm/memory/embedding/embedMessages.d.ts +58 -0
  224. package/dist/esm/memory/embedding/index.d.ts +8 -0
  225. package/dist/esm/memory/embedding/loadRelevant.d.ts +51 -0
  226. package/dist/esm/memory/embedding/mockEmbedder.d.ts +22 -0
  227. package/dist/esm/memory/embedding/types.d.ts +46 -0
  228. package/dist/esm/memory/entry/decay.d.ts +36 -0
  229. package/dist/esm/memory/entry/index.d.ts +2 -0
  230. package/dist/esm/memory/entry/types.d.ts +140 -0
  231. package/dist/esm/memory/facts/extractFacts.d.ts +50 -0
  232. package/dist/esm/memory/facts/extractor.d.ts +33 -0
  233. package/dist/esm/memory/facts/formatFacts.d.ts +60 -0
  234. package/dist/esm/memory/facts/index.d.ts +14 -0
  235. package/dist/esm/memory/facts/llmFactExtractor.d.ts +64 -0
  236. package/dist/esm/memory/facts/loadFacts.d.ts +43 -0
  237. package/dist/esm/memory/facts/patternFactExtractor.d.ts +2 -0
  238. package/dist/esm/memory/facts/types.d.ts +68 -0
  239. package/dist/esm/memory/facts/writeFacts.d.ts +19 -0
  240. package/dist/esm/memory/identity/index.d.ts +2 -0
  241. package/dist/esm/memory/identity/types.d.ts +49 -0
  242. package/dist/esm/memory/index.d.ts +19 -0
  243. package/dist/esm/memory/pipeline/auto.d.ts +59 -0
  244. package/dist/esm/memory/pipeline/default.d.ts +49 -0
  245. package/dist/esm/memory/pipeline/ephemeral.d.ts +28 -0
  246. package/dist/esm/memory/pipeline/fact.d.ts +26 -0
  247. package/dist/esm/memory/pipeline/index.d.ts +13 -0
  248. package/dist/esm/memory/pipeline/narrative.d.ts +35 -0
  249. package/dist/esm/memory/pipeline/semantic.d.ts +37 -0
  250. package/dist/esm/memory/pipeline/types.d.ts +31 -0
  251. package/dist/esm/memory/stages/formatDefault.d.ts +64 -0
  252. package/dist/esm/memory/stages/index.d.ts +13 -0
  253. package/dist/esm/memory/stages/loadRecent.d.ts +49 -0
  254. package/dist/esm/memory/stages/pickByBudget.d.ts +63 -0
  255. package/dist/esm/memory/stages/summarize.d.ts +87 -0
  256. package/dist/esm/memory/stages/tokenize.d.ts +43 -0
  257. package/dist/esm/memory/stages/types.d.ts +75 -0
  258. package/dist/esm/memory/stages/writeMessages.d.ts +71 -0
  259. package/dist/esm/memory/store/InMemoryStore.d.ts +62 -0
  260. package/dist/esm/memory/store/index.d.ts +2 -0
  261. package/dist/esm/memory/store/types.d.ts +223 -0
  262. package/dist/esm/memory/wire/index.d.ts +2 -0
  263. package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +108 -0
  264. package/dist/esm/memory-providers.d.ts +37 -0
  265. package/dist/esm/observability/contextError/finders/compareFinders.d.ts +19 -0
  266. package/dist/esm/observability/contextError/finders/index.d.ts +22 -0
  267. package/dist/esm/observability/contextError/finders/rankSuspects.d.ts +2 -0
  268. package/dist/esm/observability/contextError/finders/removeAndRetry.d.ts +11 -0
  269. package/dist/esm/observability/contextError/finders/shrinkToCause.d.ts +11 -0
  270. package/dist/esm/observability/contextError/finders/testManyCombos.d.ts +11 -0
  271. package/dist/esm/observability/contextError/finders/traceSteps.d.ts +2 -0
  272. package/dist/esm/observability/contextError/finders/types.d.ts +88 -0
  273. package/dist/esm/observability-providers.d.ts +46 -0
  274. package/dist/esm/observe.d.ts +57 -0
  275. package/dist/esm/observe.js +7 -36
  276. package/dist/esm/observe.js.map +1 -1
  277. package/dist/esm/patterns/Debate.d.ts +39 -0
  278. package/dist/esm/patterns/MapReduce.d.ts +66 -0
  279. package/dist/esm/patterns/Reflection.d.ts +51 -0
  280. package/dist/esm/patterns/SelfConsistency.d.ts +43 -0
  281. package/dist/esm/patterns/Swarm.d.ts +60 -0
  282. package/dist/esm/patterns/ToT.d.ts +53 -0
  283. package/dist/esm/patterns/index.d.ts +22 -0
  284. package/dist/esm/providers.d.ts +33 -0
  285. package/dist/esm/providers.js +1 -1
  286. package/dist/esm/providers.js.map +1 -1
  287. package/dist/esm/recorders/core/AgentRecorder.d.ts +15 -0
  288. package/dist/esm/recorders/core/CompositionRecorder.d.ts +17 -0
  289. package/dist/esm/recorders/core/ContextEvaluatedRecorder.d.ts +23 -0
  290. package/dist/esm/recorders/core/ContextRecorder.d.ts +47 -0
  291. package/dist/esm/recorders/core/CostRecorder.d.ts +14 -0
  292. package/dist/esm/recorders/core/EmitBridge.d.ts +30 -0
  293. package/dist/esm/recorders/core/ErrorBridge.d.ts +38 -0
  294. package/dist/esm/recorders/core/EvalRecorder.d.ts +16 -0
  295. package/dist/esm/recorders/core/MemoryRecorder.d.ts +17 -0
  296. package/dist/esm/recorders/core/PermissionRecorder.d.ts +16 -0
  297. package/dist/esm/recorders/core/ReliabilityRecorder.d.ts +24 -0
  298. package/dist/esm/recorders/core/SkillRecorder.d.ts +14 -0
  299. package/dist/esm/recorders/core/StreamRecorder.d.ts +15 -0
  300. package/dist/esm/recorders/core/ToolsRecorder.d.ts +18 -0
  301. package/dist/esm/recorders/core/ValidationRecorder.d.ts +16 -0
  302. package/dist/esm/recorders/core/contextEngineering.d.ts +136 -0
  303. package/dist/esm/recorders/core/typedEmit.d.ts +34 -0
  304. package/dist/esm/recorders/core/types.d.ts +97 -0
  305. package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.d.ts +117 -0
  306. package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +546 -0
  307. package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +220 -0
  308. package/dist/esm/recorders/observability/LiveStateRecorder.d.ts +250 -0
  309. package/dist/esm/recorders/observability/LoggingRecorder.d.ts +91 -0
  310. package/dist/esm/recorders/observability/RouteRecorder.d.ts +83 -0
  311. package/dist/esm/recorders/observability/RunStepRecorder.d.ts +231 -0
  312. package/dist/esm/recorders/observability/StatusRecorder.d.ts +36 -0
  313. package/dist/esm/recorders/observability/ToolChoiceRecorder.d.ts +164 -0
  314. package/dist/esm/recorders/observability/ToolLineageRecorder.d.ts +71 -0
  315. package/dist/esm/recorders/observability/commentary/commentaryTemplates.d.ts +105 -0
  316. package/dist/esm/recorders/observability/internal/ActorArrowClassifier.d.ts +25 -0
  317. package/dist/esm/recorders/observability/internal/CandidateAnswerBuffer.d.ts +28 -0
  318. package/dist/esm/recorders/observability/internal/ForkTracker.d.ts +60 -0
  319. package/dist/esm/recorders/observability/internal/RootInferrer.d.ts +51 -0
  320. package/dist/esm/recorders/observability/internal/SequenceSiblingTracker.d.ts +24 -0
  321. package/dist/esm/recorders/observability/localObservability.d.ts +48 -0
  322. package/dist/esm/recorders/observability/observeRunId.d.ts +36 -0
  323. package/dist/esm/recorders/observability/status/statusTemplates.d.ts +106 -0
  324. package/dist/esm/recorders/observability/trace.d.ts +119 -0
  325. package/dist/esm/reliability/CircuitBreaker.d.ts +75 -0
  326. package/dist/esm/reliability/buildReliabilityGateChart.d.ts +53 -0
  327. package/dist/esm/reliability/classifyError.d.ts +28 -0
  328. package/dist/esm/reliability/index.d.ts +35 -0
  329. package/dist/esm/reliability/types.d.ts +327 -0
  330. package/dist/esm/resilience/fallbackProvider.d.ts +33 -0
  331. package/dist/esm/resilience/index.d.ts +21 -0
  332. package/dist/esm/resilience/withCircuitBreaker.d.ts +129 -0
  333. package/dist/esm/resilience/withFallback.d.ts +45 -0
  334. package/dist/esm/resilience/withRetry.d.ts +71 -0
  335. package/dist/esm/security/PermissionPolicy.d.ts +124 -0
  336. package/dist/esm/security/PolicyHaltError.d.ts +72 -0
  337. package/dist/esm/security/extractSequence.d.ts +46 -0
  338. package/dist/esm/security/index.d.ts +44 -0
  339. package/dist/esm/security/thinkingRedaction.d.ts +50 -0
  340. package/dist/esm/status.d.ts +54 -0
  341. package/dist/esm/status.js +13 -4
  342. package/dist/esm/status.js.map +1 -1
  343. package/dist/esm/strategies/attach.d.ts +47 -0
  344. package/dist/esm/strategies/compose.d.ts +48 -0
  345. package/dist/esm/strategies/defaults/chatBubbleLiveStatus.d.ts +36 -0
  346. package/dist/esm/strategies/defaults/consoleObservability.d.ts +42 -0
  347. package/dist/esm/strategies/defaults/inMemorySinkCost.d.ts +50 -0
  348. package/dist/esm/strategies/defaults/index.d.ts +30 -0
  349. package/dist/esm/strategies/defaults/noopLens.d.ts +28 -0
  350. package/dist/esm/strategies/index.d.ts +36 -0
  351. package/dist/esm/strategies/registry.d.ts +70 -0
  352. package/dist/esm/strategies/types.d.ts +303 -0
  353. package/dist/esm/stream.d.ts +82 -0
  354. package/dist/esm/thinking/AnthropicThinkingHandler.d.ts +42 -0
  355. package/dist/esm/thinking/MockThinkingHandler.d.ts +50 -0
  356. package/dist/esm/thinking/OpenAIThinkingHandler.d.ts +37 -0
  357. package/dist/esm/thinking/index.d.ts +51 -0
  358. package/dist/esm/thinking/registry.d.ts +33 -0
  359. package/dist/esm/thinking/types.d.ts +162 -0
  360. package/dist/esm/tool-providers/gatedTools.d.ts +36 -0
  361. package/dist/esm/tool-providers/index.d.ts +41 -0
  362. package/dist/esm/tool-providers/skillScopedTools.d.ts +45 -0
  363. package/dist/esm/tool-providers/staticTools.d.ts +21 -0
  364. package/dist/esm/tool-providers/types.d.ts +138 -0
  365. package/dist/events.js +42 -0
  366. package/dist/events.js.map +1 -0
  367. package/dist/index.js +7 -117
  368. package/dist/index.js.map +1 -1
  369. package/dist/lib/context-bisect/index.js +3 -0
  370. package/dist/lib/context-bisect/index.js.map +1 -1
  371. package/dist/lib/context-bisect/localize.js +2 -0
  372. package/dist/lib/context-bisect/localize.js.map +1 -1
  373. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
  374. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  375. package/dist/lib/injection-engine/entryScorer.js +178 -0
  376. package/dist/lib/injection-engine/entryScorer.js.map +1 -0
  377. package/dist/lib/injection-engine/index.js +6 -2
  378. package/dist/lib/injection-engine/index.js.map +1 -1
  379. package/dist/lib/injection-engine/skillGraph.js +40 -45
  380. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  381. package/dist/lib/injection-engine/types.js.map +1 -1
  382. package/dist/lib/rag/defineRAG.js +3 -3
  383. package/dist/lib/rag/indexDocuments.js +2 -1
  384. package/dist/lib/rag/indexDocuments.js.map +1 -1
  385. package/dist/locales/index.js +2 -1
  386. package/dist/locales/index.js.map +1 -1
  387. package/dist/memory/causal/types.js.map +1 -1
  388. package/dist/memory/define.types.js +6 -4
  389. package/dist/memory/define.types.js.map +1 -1
  390. package/dist/observe.js +22 -115
  391. package/dist/observe.js.map +1 -1
  392. package/dist/providers.js +3 -1
  393. package/dist/providers.js.map +1 -1
  394. package/dist/status.js +13 -5
  395. package/dist/status.js.map +1 -1
  396. package/dist/types/adapters/llm/BrowserOpenAIProvider.d.ts +1 -1
  397. package/dist/types/adapters/llm/MockProvider.d.ts +2 -1
  398. package/dist/types/adapters/llm/MockProvider.d.ts.map +1 -1
  399. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  400. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  401. package/dist/types/core/agent/stages/pickEntry.d.ts.map +1 -1
  402. package/dist/types/core/agent/types.d.ts +8 -4
  403. package/dist/types/core/agent/types.d.ts.map +1 -1
  404. package/dist/types/debug/finders.d.ts +13 -0
  405. package/dist/types/debug/finders.d.ts.map +1 -0
  406. package/dist/types/debug.d.ts +26 -0
  407. package/dist/types/debug.d.ts.map +1 -0
  408. package/dist/types/events.d.ts +19 -0
  409. package/dist/types/events.d.ts.map +1 -0
  410. package/dist/types/index.d.ts +4 -24
  411. package/dist/types/index.d.ts.map +1 -1
  412. package/dist/types/lib/context-bisect/index.d.ts +3 -0
  413. package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
  414. package/dist/types/lib/context-bisect/localize.d.ts +2 -0
  415. package/dist/types/lib/context-bisect/localize.d.ts.map +1 -1
  416. package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
  417. package/dist/types/lib/injection-engine/entryScorer.d.ts +94 -0
  418. package/dist/types/lib/injection-engine/entryScorer.d.ts.map +1 -0
  419. package/dist/types/lib/injection-engine/index.d.ts +2 -1
  420. package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
  421. package/dist/types/lib/injection-engine/skillGraph.d.ts +24 -26
  422. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  423. package/dist/types/lib/injection-engine/types.d.ts +9 -4
  424. package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
  425. package/dist/types/lib/rag/defineRAG.d.ts +3 -3
  426. package/dist/types/lib/rag/indexDocuments.d.ts +2 -1
  427. package/dist/types/lib/rag/indexDocuments.d.ts.map +1 -1
  428. package/dist/types/locales/index.d.ts +9 -0
  429. package/dist/types/locales/index.d.ts.map +1 -1
  430. package/dist/types/memory/causal/types.d.ts +13 -9
  431. package/dist/types/memory/causal/types.d.ts.map +1 -1
  432. package/dist/types/memory/define.types.d.ts +6 -4
  433. package/dist/types/memory/define.types.d.ts.map +1 -1
  434. package/dist/types/observe.d.ts +1 -6
  435. package/dist/types/observe.d.ts.map +1 -1
  436. package/dist/types/providers.d.ts +2 -2
  437. package/dist/types/providers.d.ts.map +1 -1
  438. package/dist/types/status.d.ts +10 -4
  439. package/dist/types/status.d.ts.map +1 -1
  440. package/dist/types/tool-providers/index.d.ts +1 -1
  441. package/dist/types/tool-providers/index.d.ts.map +1 -1
  442. package/package.json +261 -57
@@ -0,0 +1,138 @@
1
+ /**
2
+ * toBacktrackTrace — serialize a ContextBugReport into the BacktrackTrace
3
+ * shape that agentThinkingUI's <BacktrackView>/<BacktrackOverlay> renders
4
+ * (the "why?" board: suspects → influence meters → ablation stamps →
5
+ * chain-of-custody rewind).
6
+ *
7
+ * Pure mapping, no UI dependency — the BacktrackTrace interfaces below
8
+ * MIRROR agentthinkingui's `types/index.d.ts` contract; both sides are
9
+ * framework-agnostic JSON. The report carries everything except two
10
+ * things only the caller knows:
11
+ *
12
+ * - `answer` (REQUIRED): the report localizes a decision but does not
13
+ * hold the decision's output text — pass what the agent said/chose.
14
+ * - `custody` (optional): the rewind player replays RECORDED STATE
15
+ * (the assembled prompt, the mutating commit). That content lives in
16
+ * the caller's artifacts (snapshot/events), not in the report — pass
17
+ * a callback to enrich confirmed suspects with evidence panes.
18
+ *
19
+ * Honesty is preserved, not added: ranks are TRUE report positions even
20
+ * when the cards are a subset (`rank`), path-only scores carry
21
+ * `upperBound` (hatched meter + starred value in the UI), honesty flags
22
+ * map verbatim, and the claims-discipline lines ride along. The mapper
23
+ * never invents a causal claim: `verdict` exists only where the report's
24
+ * ablation produced one ('inconclusive' maps to NO stamp, not a verdict).
25
+ */
26
+ import type { ContextBugReport, Suspect } from './types.js';
27
+ export interface BacktrackCustodyHop {
28
+ readonly step: string;
29
+ readonly detail: string;
30
+ readonly at?: string;
31
+ readonly variable?: string;
32
+ /** recorded state at this hop — prompt text, commit payload, code, rule operands */
33
+ readonly content?: string;
34
+ /** exact substring of `content` highlighted as the culprit span */
35
+ readonly highlight?: string;
36
+ }
37
+ export interface BacktrackHop {
38
+ readonly key: string;
39
+ readonly kind?: 'data' | 'control';
40
+ readonly via?: string;
41
+ }
42
+ export interface BacktrackSuspectCard {
43
+ readonly kind: string;
44
+ readonly flavor?: string;
45
+ readonly name: string;
46
+ readonly text?: string;
47
+ readonly score: number;
48
+ /** true position in the report's ranking (cards may be a subset) */
49
+ readonly rank: number;
50
+ /** score is a path-only upper bound — no content signal */
51
+ readonly upperBound?: boolean;
52
+ /** the hop adjacent to the suspect (what fed the decision side) */
53
+ readonly edge?: {
54
+ readonly key?: string;
55
+ readonly weight?: number;
56
+ readonly kind?: 'data' | 'control';
57
+ };
58
+ /** the full hop chain, decision → suspect (multi-hop paths only) */
59
+ readonly path?: readonly BacktrackHop[];
60
+ readonly bornAt?: {
61
+ readonly id: string;
62
+ readonly label?: string;
63
+ readonly via?: string;
64
+ };
65
+ readonly custody?: readonly BacktrackCustodyHop[];
66
+ readonly verdict?: {
67
+ readonly kind: 'confirmed' | 'not-confirmed';
68
+ readonly flips?: number;
69
+ readonly samples?: number;
70
+ readonly claim?: string;
71
+ };
72
+ }
73
+ export interface BacktrackTrail {
74
+ readonly title?: string;
75
+ readonly custody?: readonly BacktrackCustodyHop[];
76
+ readonly claim?: string;
77
+ }
78
+ export interface BacktrackTrace {
79
+ readonly claim: string;
80
+ readonly mode: 'causal' | 'correlational';
81
+ readonly modeLabel?: string;
82
+ readonly agent?: string;
83
+ readonly model?: string;
84
+ readonly answer: {
85
+ readonly text: string;
86
+ readonly label?: string;
87
+ readonly tone?: 'error' | 'question';
88
+ };
89
+ readonly decidedAt: {
90
+ readonly id: string;
91
+ readonly label?: string;
92
+ readonly kind?: 'llm' | 'rule';
93
+ };
94
+ readonly suspects: readonly BacktrackSuspectCard[];
95
+ readonly trail?: BacktrackTrail;
96
+ readonly folded?: string;
97
+ readonly scoreNote?: string;
98
+ readonly baseline?: string;
99
+ readonly honesty?: readonly string[];
100
+ }
101
+ export interface ToBacktrackTraceOptions {
102
+ /** The decision's output text — the report doesn't hold it. */
103
+ readonly answer: {
104
+ readonly text: string;
105
+ readonly label?: string;
106
+ readonly tone?: 'error' | 'question';
107
+ };
108
+ /** Headline question. Default: derived from the trigger step. */
109
+ readonly claim?: string;
110
+ /** 'rule' renders the decision diamond instead of the brain. Default 'llm'. */
111
+ readonly decidedAtKind?: 'llm' | 'rule';
112
+ /** Override the mode chip (e.g. "exact chain · proxy ranking"). */
113
+ readonly modeLabel?: string;
114
+ readonly agent?: string;
115
+ readonly model?: string;
116
+ /** Max suspect cards. Default 6. The rest fold into one disclosed line. */
117
+ readonly maxSuspects?: number;
118
+ /**
119
+ * Card selection when the report has more suspects than `maxSuspects`.
120
+ * Default TRUE: content-evidence suspects fill the cards first (they are
121
+ * what a human can act on), structural path-only hops fold — but every
122
+ * card keeps its TRUE report rank, and the folded line discloses what
123
+ * was left out and that it ranked where it ranked. FALSE: strictly the
124
+ * report's top-N.
125
+ */
126
+ readonly preferContentEvidence?: boolean;
127
+ /** Enrich a suspect's chain of custody with recorded-state panes. */
128
+ readonly custody?: (suspect: Suspect, trueRank: number) => readonly BacktrackCustodyHop[] | undefined;
129
+ /** Exact recorded hops for deterministic decisions (no ablation verdict). */
130
+ readonly trail?: BacktrackTrail;
131
+ /** Override the auto score note (top-2 margin tie warning). */
132
+ readonly scoreNote?: string;
133
+ }
134
+ /**
135
+ * Serialize a localizer report for agentThinkingUI's BacktrackView.
136
+ * See module doc — `answer` is required; `custody` enriches the rewind.
137
+ */
138
+ export declare function toBacktrackTrace(report: ContextBugReport, opts: ToBacktrackTraceOptions): BacktrackTrace;
@@ -0,0 +1,168 @@
1
+ /**
2
+ * trajectory — the per-loop trajectory assembler (proposal 005).
3
+ *
4
+ * Slices a recorded ReAct run's commit log into ordered LoopFrames — one per
5
+ * iteration — so the two-score localizer (L2), the recall scorer (L3), and the
6
+ * backtracking debugger (L4) read the same per-loop substrate instead of one
7
+ * flattened bag. PURE + read-only (NOT a recorder, Convention 1): the loop-level
8
+ * peer of `causalChain` / `commitValueAt` / `stepOutputText`.
9
+ *
10
+ * Pieces:
11
+ * - `bucketByAnchors` — the domain-agnostic HEAD-range partition (pure, total);
12
+ * - `findLoopHeads` — the flat-chart loop-head detector (one head per injection-engine entry);
13
+ * - `assembleTrajectory` — the agent-flavored projection (call-llm pointer + intermediate
14
+ * text + live contextSources via findLastWriter/commitValueAt).
15
+ *
16
+ * Handles BOTH chart shapes:
17
+ * - FLAT (`buildAgentChart`, default `reactMode: 'dynamic'`): `call-llm` is a parent-level
18
+ * stage; frames are bucketed over the RUN commit log by injection-engine loop heads.
19
+ * - GROUPED (`buildDynamicAgentChart`, `reactMode: 'dynamic-grouped'`): the LLM turn runs in
20
+ * an `sf-llm-call` subflow whose inner commits live in `subflowResults['sf-llm-call#k']`,
21
+ * retained PER-ITERATION by footprintjs subflow-commit-visibility (≥ d458898). Each loop is
22
+ * projected PER-SCOPE over its own inner commit log — no cross-scope merge, so the slice
23
+ * primitives run correctly over the isolated log. Such frames carry `subflowScope`.
24
+ */
25
+ import type { CommitBundle } from 'footprintjs/advanced';
26
+ import type { UntrackedSource } from 'footprintjs/trace';
27
+ import type { EvidenceInput } from '../influence-core/index.js';
28
+ import { type ContextBugArtifacts, type HonestyFlag } from './types.js';
29
+ /** One source the loop's `call-llm` read, traced back to its live writer for THAT loop. */
30
+ export interface ContextSource {
31
+ /** The state key call-llm#k read (e.g. 'systemPromptInjections'). */
32
+ readonly key: string;
33
+ /** runtimeStageId of the live writer (findLastWriter); undefined when never committed before. */
34
+ readonly writerId: string | undefined;
35
+ /** The writer's commitLog ARRAY position — NOT the optional CommitBundle.idx. */
36
+ readonly writerArrayIdx: number | undefined;
37
+ /** Materialized live value (commitValueAt); undefined under the pre-run-initial blind spot. */
38
+ readonly value: unknown;
39
+ /** The bridge handed to scorers: { id, text, ancestorTexts }. */
40
+ readonly evidence: EvidenceInput;
41
+ }
42
+ /** One ReAct iteration — bounded by the loop HEAD, pointing at the call-llm inside it. */
43
+ export interface LoopFrame {
44
+ /** Anchor ordinal 0,1,2… DERIVED from the commit log (NOT TraversalContext.loopIteration). */
45
+ readonly loopIndex: number;
46
+ /** The call-llm#k runtimeStageId — the LLM-step pointer WITHIN the frame. */
47
+ readonly llmCallId: string | undefined;
48
+ /** call-llm#k's commitLog array index — the EXCLUSIVE beforeIdx for findLastWriter. */
49
+ readonly llmCallArrayIdx: number | undefined;
50
+ /** The loop-HEAD commit's array index — the body's lower bound. */
51
+ readonly headArrayIdx: number;
52
+ /** Every runtimeStageId in [head[k], head[k+1]) — the full multi-stage body of round k, in commit order. */
53
+ readonly bodyIds: readonly string[];
54
+ /** stepOutputText over the call-llm commit (assistant content + tool-call intents). */
55
+ readonly intermediateText: string | undefined;
56
+ /** One per key call-llm#k read. */
57
+ readonly contextSources: readonly ContextSource[];
58
+ /**
59
+ * WALK-ONLY (proposal 008): the proximate tool result for this loop — the most recent
60
+ * `lastToolResult` committed before this loop's call-llm, with the PRODUCING loop's tool-calls
61
+ * stage as its `writerId` (the cross-loop provenance edge L4's `walkToRoot` descends along). NOT
62
+ * in `contextSources` — L3's narrow never scores it. Absent on loop 0 / grouped frames.
63
+ */
64
+ readonly proximateToolSource?: ProximateToolSource;
65
+ /**
66
+ * GROUPED chart only: the `sf-llm-call` mount runtimeStageId this frame was projected from.
67
+ * When set, ALL array indices on this frame (`headArrayIdx`, `llmCallArrayIdx`,
68
+ * `bodyIds`, each `contextSource.writerArrayIdx`) are relative to that subflow's OWN inner
69
+ * commit log (`subflowResults[subflowScope].treeContext.history`), NOT the run commit log.
70
+ * Absent for FLAT-chart frames (indices are run-commit-log relative).
71
+ */
72
+ readonly subflowScope?: string;
73
+ /** Pass-through of the call-llm bundle's untrackedSources ('args'|'env'|'silent'). */
74
+ readonly incompleteSources?: ReadonlyArray<UntrackedSource>;
75
+ /** True when incompleteSources is non-empty — "this step read untracked; slice may be
76
+ * incomplete here". NOT a model-internalized claim (that is undetectable — see Trajectory). */
77
+ readonly untrackedReadsPresent: boolean;
78
+ }
79
+ /** The proximate tool result a loop's decision was conditioned on — L4's cross-loop hop edge (proposal 008). */
80
+ export interface ProximateToolSource {
81
+ /** The committed `{ toolName, result }` (redaction-scrubbed, via commitValueAt). */
82
+ readonly value: unknown;
83
+ /** The producing loop's tool-calls stage runtimeStageId — resolves to an EARLIER frame. */
84
+ readonly writerId: string | undefined;
85
+ /** Honesty: the call-llm read `history`, NOT this key — an INFERRED proximate, not a direct read. */
86
+ readonly proximate: true;
87
+ }
88
+ /** The run input, re-injected as a synthetic node — a PROXY (args is untracked), never a recorded edge. */
89
+ export interface SyntheticQuestionNode {
90
+ readonly text: string;
91
+ readonly incompleteSources: readonly ['args'];
92
+ readonly injected: true;
93
+ }
94
+ export interface Trajectory {
95
+ readonly frames: readonly LoopFrame[];
96
+ /** Commits BEFORE the first head (seed, memory-read) — run setup, not a loop body. */
97
+ readonly prelude: readonly string[];
98
+ /** Only populated when the contrastive path is wired (proposal 005 L2 note). */
99
+ readonly question?: SyntheticQuestionNode;
100
+ /** Degrade-never-throw. STANDING caveat on EVERY trajectory: contextSources show only
101
+ * sources re-committed to tracked state; context the model retained internally (carried
102
+ * in its own reasoning, never re-committed) leaves no read→write edge and is NOT here. */
103
+ readonly honestyFlags: readonly HonestyFlag[];
104
+ /** Set only when maxFrames cut the run. */
105
+ readonly truncated?: {
106
+ readonly byFrames: boolean;
107
+ };
108
+ }
109
+ /** One frame's raw partition: the head's array index + the runtimeStageIds in its half-open range. */
110
+ export interface AnchorBucket {
111
+ readonly headArrayIdx: number;
112
+ readonly bodyIds: readonly string[];
113
+ }
114
+ /**
115
+ * Partition a commit log by a list of HEAD runtimeStageIds (taken as data — no agent
116
+ * knowledge). Each frame is the half-open range `[head[k], head[k+1])`; commits before
117
+ * the first head are the `prelude`. TOTAL: every commit lands in exactly one frame OR
118
+ * the prelude. Heads not found in the log are ignored; ordering follows the log, not the
119
+ * input list (an out-of-order or duplicate head list cannot reorder/duplicate commits).
120
+ *
121
+ * A head is anchored at the FIRST commit bearing its runtimeStageId — a single stage
122
+ * execution can flush MORE THAN ONE commit bundle under one runtimeStageId (parallel
123
+ * fork merges, multi-flush stages), and those repeats stay INSIDE the frame they open
124
+ * rather than each spawning a spurious one-commit frame.
125
+ */
126
+ export declare function bucketByAnchors(commitLog: readonly CommitBundle[], headRuntimeStageIds: readonly string[]): {
127
+ frames: AnchorBucket[];
128
+ prelude: string[];
129
+ };
130
+ /**
131
+ * The flat-chart loop heads: the FIRST commit of each injection-engine ENTRY (one per
132
+ * ReAct iteration, since the loop is branch-sourced back to the injection engine). A head
133
+ * is a commit that is in the injection engine while the previous commit was not — so a
134
+ * multi-commit injection-engine body yields exactly one head per loop.
135
+ *
136
+ * Returns the runtimeStageIds to feed `bucketByAnchors`. Empty when the run never enters
137
+ * the injection engine (e.g. the grouped chart, where the loop lives in sf-llm-call —
138
+ * the caller degrades with an honesty flag).
139
+ */
140
+ export declare function findLoopHeads(commitLog: readonly CommitBundle[]): string[];
141
+ export interface AssembleTrajectoryOptions {
142
+ /** Chars of each source value / intermediate text embedded. Default 2000. */
143
+ readonly maxTextChars?: number;
144
+ /** Keep only the first N frames (honesty-flagged via `truncated`). */
145
+ readonly maxFrames?: number;
146
+ }
147
+ /**
148
+ * Slice a recorded agent run into a {@link Trajectory} — one {@link LoopFrame} per ReAct
149
+ * iteration, each carrying its `call-llm` pointer, the call's output text, and the live
150
+ * {@link ContextSource}s that fed it (traced via `findLastWriter` + `commitValueAt` from the
151
+ * SAME commit log — zero new capture).
152
+ *
153
+ * Takes the SAME `ContextBugArtifacts` bag the localizer takes — adopter call is just
154
+ * `assembleTrajectory(artifacts)`.
155
+ *
156
+ * Handles BOTH chart shapes:
157
+ * - FLAT (`reactMode: 'dynamic'`, default): `call-llm` is a parent-level stage; frames are
158
+ * bucketed over the run commit log by the `sf-injection-engine` loop heads.
159
+ * - GROUPED (`reactMode: 'dynamic-grouped'`): the LLM turn runs in an `sf-llm-call` subflow;
160
+ * each loop is projected PER-SCOPE over its own inner commit log (retained per-iteration by
161
+ * footprintjs subflow-commit-visibility). Such frames carry `subflowScope` and their array
162
+ * indices are inner-log-relative.
163
+ *
164
+ * Standing caveat on every result: contextSources show only sources re-committed to tracked
165
+ * state; context the model retained internally (carried in its own reasoning, never
166
+ * re-committed) leaves no read→write edge and is NOT represented.
167
+ */
168
+ export declare function assembleTrajectory(artifacts: ContextBugArtifacts, opts?: AssembleTrajectoryOptions): Trajectory;