agentfootprint 6.43.0 → 6.45.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 (397) hide show
  1. package/ai-instructions/setup.sh +0 -0
  2. package/dist/core/RunnerBase.js +7 -0
  3. package/dist/core/RunnerBase.js.map +1 -1
  4. package/dist/core/agent/buildAgentChart.js +2 -1
  5. package/dist/core/agent/buildAgentChart.js.map +1 -1
  6. package/dist/core/agent/buildDynamicAgentChart.js +3 -1
  7. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  8. package/dist/core/agent/stages/pickEntry.js +3 -1
  9. package/dist/core/agent/stages/pickEntry.js.map +1 -1
  10. package/dist/esm/adapters/identity/agentcore.d.ts +100 -0
  11. package/dist/esm/adapters/llm/AnthropicProvider.d.ts +130 -0
  12. package/dist/esm/adapters/llm/BedrockProvider.d.ts +100 -0
  13. package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +41 -0
  14. package/dist/esm/adapters/llm/BrowserOpenAIProvider.d.ts +95 -0
  15. package/dist/esm/adapters/llm/MockProvider.d.ts +153 -0
  16. package/dist/esm/adapters/llm/OpenAIProvider.d.ts +220 -0
  17. package/dist/esm/adapters/llm/createProvider.d.ts +85 -0
  18. package/dist/esm/adapters/memory/agentcore.d.ts +146 -0
  19. package/dist/esm/adapters/memory/bedrockAgentMemory.d.ts +95 -0
  20. package/dist/esm/adapters/memory/redis.d.ts +127 -0
  21. package/dist/esm/adapters/observability/agentcore.d.ts +67 -0
  22. package/dist/esm/adapters/observability/audit.d.ts +254 -0
  23. package/dist/esm/adapters/observability/cloudwatch.d.ts +96 -0
  24. package/dist/esm/adapters/observability/otel.d.ts +237 -0
  25. package/dist/esm/adapters/observability/xray.d.ts +88 -0
  26. package/dist/esm/adapters/types.d.ts +378 -0
  27. package/dist/esm/bridge/eventMeta.d.ts +59 -0
  28. package/dist/esm/cache/CacheDecisionSubflow.d.ts +85 -0
  29. package/dist/esm/cache/CacheGateDecider.d.ts +127 -0
  30. package/dist/esm/cache/applyCachePolicy.d.ts +37 -0
  31. package/dist/esm/cache/cacheRecorder.d.ts +85 -0
  32. package/dist/esm/cache/index.d.ts +33 -0
  33. package/dist/esm/cache/strategies/AnthropicCacheStrategy.d.ts +38 -0
  34. package/dist/esm/cache/strategies/BedrockCacheStrategy.d.ts +33 -0
  35. package/dist/esm/cache/strategies/NoOpCacheStrategy.d.ts +29 -0
  36. package/dist/esm/cache/strategies/OpenAICacheStrategy.d.ts +36 -0
  37. package/dist/esm/cache/strategyRegistry.d.ts +45 -0
  38. package/dist/esm/cache/types.d.ts +243 -0
  39. package/dist/esm/conventions.d.ts +203 -0
  40. package/dist/esm/core/Agent.d.ts +355 -0
  41. package/dist/esm/core/LLMCall.d.ts +139 -0
  42. package/dist/esm/core/RunnerBase.d.ts +267 -0
  43. package/dist/esm/core/RunnerBase.js +7 -0
  44. package/dist/esm/core/RunnerBase.js.map +1 -1
  45. package/dist/esm/core/agent/AgentBuilder.d.ts +565 -0
  46. package/dist/esm/core/agent/buildAgentChart.d.ts +109 -0
  47. package/dist/esm/core/agent/buildAgentChart.js +2 -1
  48. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  49. package/dist/esm/core/agent/buildAgentMessageApiChart.d.ts +40 -0
  50. package/dist/esm/core/agent/buildCacheSubflow.d.ts +35 -0
  51. package/dist/esm/core/agent/buildDynamicAgentChart.d.ts +56 -0
  52. package/dist/esm/core/agent/buildDynamicAgentChart.js +3 -1
  53. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  54. package/dist/esm/core/agent/buildMessageApiChart.d.ts +47 -0
  55. package/dist/esm/core/agent/buildToolRegistry.d.ts +61 -0
  56. package/dist/esm/core/agent/memoryRecallInjections.d.ts +8 -0
  57. package/dist/esm/core/agent/stages/breakFinal.d.ts +22 -0
  58. package/dist/esm/core/agent/stages/callLLM.d.ts +74 -0
  59. package/dist/esm/core/agent/stages/pickEntry.d.ts +19 -0
  60. package/dist/esm/core/agent/stages/pickEntry.js +3 -1
  61. package/dist/esm/core/agent/stages/pickEntry.js.map +1 -1
  62. package/dist/esm/core/agent/stages/prepareFinal.d.ts +19 -0
  63. package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +135 -0
  64. package/dist/esm/core/agent/stages/route.d.ts +18 -0
  65. package/dist/esm/core/agent/stages/seed.d.ts +53 -0
  66. package/dist/esm/core/agent/stages/toolCalls.d.ts +76 -0
  67. package/dist/esm/core/agent/toolArgsValidation.d.ts +62 -0
  68. package/dist/esm/core/agent/types.d.ts +382 -0
  69. package/dist/esm/core/agent/validators.d.ts +52 -0
  70. package/dist/esm/core/cost.d.ts +38 -0
  71. package/dist/esm/core/flowchartAsTool.d.ts +200 -0
  72. package/dist/esm/core/humanizeLLMError.d.ts +23 -0
  73. package/dist/esm/core/outputFallback.d.ts +139 -0
  74. package/dist/esm/core/outputSchema.d.ts +127 -0
  75. package/dist/esm/core/pause.d.ts +74 -0
  76. package/dist/esm/core/runCheckpoint.d.ts +179 -0
  77. package/dist/esm/core/runner.d.ts +203 -0
  78. package/dist/esm/core/slots/buildMessagesSlot.d.ts +40 -0
  79. package/dist/esm/core/slots/buildSystemPromptSlot.d.ts +41 -0
  80. package/dist/esm/core/slots/buildThinkingSubflow.d.ts +40 -0
  81. package/dist/esm/core/slots/buildToolsSlot.d.ts +60 -0
  82. package/dist/esm/core/slots/helpers.d.ts +27 -0
  83. package/dist/esm/core/toolContract.d.ts +43 -0
  84. package/dist/esm/core/tools.d.ts +90 -0
  85. package/dist/esm/core/translator.d.ts +94 -0
  86. package/dist/esm/core-flow/Conditional.d.ts +119 -0
  87. package/dist/esm/core-flow/Loop.d.ts +160 -0
  88. package/dist/esm/core-flow/Parallel.d.ts +360 -0
  89. package/dist/esm/core-flow/Sequence.d.ts +133 -0
  90. package/dist/esm/events/dispatcher.d.ts +134 -0
  91. package/dist/esm/events/payloads.d.ts +761 -0
  92. package/dist/esm/events/registry.d.ts +198 -0
  93. package/dist/esm/events/types.d.ts +70 -0
  94. package/dist/esm/identity/kinds.d.ts +36 -0
  95. package/dist/esm/identity/staticTokens.d.ts +28 -0
  96. package/dist/esm/identity/types.d.ts +113 -0
  97. package/dist/esm/identity/withCredentialRetry.d.ts +64 -0
  98. package/dist/esm/identity.d.ts +31 -0
  99. package/dist/esm/index.d.ts +64 -0
  100. package/dist/esm/index.js +2 -0
  101. package/dist/esm/index.js.map +1 -1
  102. package/dist/esm/injection-engine.d.ts +4 -0
  103. package/dist/esm/lib/canonicalJson.d.ts +56 -0
  104. package/dist/esm/lib/context-bisect/ablation.d.ts +109 -0
  105. package/dist/esm/lib/context-bisect/bisect.d.ts +75 -0
  106. package/dist/esm/lib/context-bisect/cost.d.ts +37 -0
  107. package/dist/esm/lib/context-bisect/index.d.ts +31 -0
  108. package/dist/esm/lib/context-bisect/index.js +3 -0
  109. package/dist/esm/lib/context-bisect/index.js.map +1 -1
  110. package/dist/esm/lib/context-bisect/llmEdgeWeigher.d.ts +124 -0
  111. package/dist/esm/lib/context-bisect/localize.d.ts +152 -0
  112. package/dist/esm/lib/context-bisect/localize.js +2 -0
  113. package/dist/esm/lib/context-bisect/localize.js.map +1 -1
  114. package/dist/esm/lib/context-bisect/loop-recall.d.ts +97 -0
  115. package/dist/esm/lib/context-bisect/missingContext.d.ts +71 -0
  116. package/dist/esm/lib/context-bisect/restoration.d.ts +39 -0
  117. package/dist/esm/lib/context-bisect/toBacktrackTrace.d.ts +138 -0
  118. package/dist/esm/lib/context-bisect/trajectory.d.ts +168 -0
  119. package/dist/esm/lib/context-bisect/types.d.ts +448 -0
  120. package/dist/esm/lib/context-bisect/walk-to-root.d.ts +103 -0
  121. package/dist/esm/lib/influence-core/attributability.d.ts +72 -0
  122. package/dist/esm/lib/influence-core/cache.d.ts +94 -0
  123. package/dist/esm/lib/influence-core/contrastive.d.ts +26 -0
  124. package/dist/esm/lib/influence-core/index.d.ts +34 -0
  125. package/dist/esm/lib/influence-core/margin.d.ts +33 -0
  126. package/dist/esm/lib/influence-core/signals.d.ts +128 -0
  127. package/dist/esm/lib/influence-core/similarity.d.ts +25 -0
  128. package/dist/esm/lib/influence-core/types.d.ts +252 -0
  129. package/dist/esm/lib/injection-engine/SkillRegistry.d.ts +147 -0
  130. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.d.ts +110 -0
  131. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
  132. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  133. package/dist/esm/lib/injection-engine/entryScorer.d.ts +93 -0
  134. package/dist/esm/lib/injection-engine/entryScorer.js +172 -0
  135. package/dist/esm/lib/injection-engine/entryScorer.js.map +1 -0
  136. package/dist/esm/lib/injection-engine/evaluator.d.ts +24 -0
  137. package/dist/esm/lib/injection-engine/factories/defineFact.d.ts +60 -0
  138. package/dist/esm/lib/injection-engine/factories/defineInjection.d.ts +41 -0
  139. package/dist/esm/lib/injection-engine/factories/defineInstruction.d.ts +78 -0
  140. package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.d.ts +26 -0
  141. package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +160 -0
  142. package/dist/esm/lib/injection-engine/factories/defineSteering.d.ts +39 -0
  143. package/dist/esm/lib/injection-engine/index.d.ts +22 -0
  144. package/dist/esm/lib/injection-engine/index.js +1 -0
  145. package/dist/esm/lib/injection-engine/index.js.map +1 -1
  146. package/dist/esm/lib/injection-engine/skillContract.d.ts +29 -0
  147. package/dist/esm/lib/injection-engine/skillGraph.d.ts +289 -0
  148. package/dist/esm/lib/injection-engine/skillGraph.js +35 -41
  149. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  150. package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +49 -0
  151. package/dist/esm/lib/injection-engine/skillTools.d.ts +72 -0
  152. package/dist/esm/lib/injection-engine/softmax.d.ts +11 -0
  153. package/dist/esm/lib/injection-engine/types.d.ts +229 -0
  154. package/dist/esm/lib/injection-engine/types.js.map +1 -1
  155. package/dist/esm/lib/lazyRequire.d.ts +29 -0
  156. package/dist/esm/lib/mcp/index.d.ts +9 -0
  157. package/dist/esm/lib/mcp/mcpClient.d.ts +46 -0
  158. package/dist/esm/lib/mcp/mockMcpClient.d.ts +65 -0
  159. package/dist/esm/lib/mcp/types.d.ts +133 -0
  160. package/dist/esm/lib/rag/defineRAG.d.ts +139 -0
  161. package/dist/esm/lib/rag/index.d.ts +7 -0
  162. package/dist/esm/lib/rag/indexDocuments.d.ts +105 -0
  163. package/dist/esm/lib/tool-lint/analyze.d.ts +83 -0
  164. package/dist/esm/lib/tool-lint/cli.d.ts +43 -0
  165. package/dist/esm/lib/tool-lint/format.d.ts +18 -0
  166. package/dist/esm/lib/tool-lint/index.d.ts +23 -0
  167. package/dist/esm/lib/tool-lint/rules.d.ts +85 -0
  168. package/dist/esm/lib/tool-lint/types.d.ts +155 -0
  169. package/dist/esm/lib/trace-toolpack/bounded.d.ts +47 -0
  170. package/dist/esm/lib/trace-toolpack/debugPrompt.d.ts +19 -0
  171. package/dist/esm/lib/trace-toolpack/index.d.ts +20 -0
  172. package/dist/esm/lib/trace-toolpack/lazyToolpack.d.ts +35 -0
  173. package/dist/esm/lib/trace-toolpack/selfExplain.d.ts +100 -0
  174. package/dist/esm/lib/trace-toolpack/traceDebugAgent.d.ts +42 -0
  175. package/dist/esm/lib/trace-toolpack/traceToolpack.d.ts +69 -0
  176. package/dist/esm/lib/trace-toolpack/types.d.ts +59 -0
  177. package/dist/esm/llm-providers.d.ts +26 -0
  178. package/dist/esm/locales/index.d.ts +132 -0
  179. package/dist/esm/memory/beats/extractBeats.d.ts +61 -0
  180. package/dist/esm/memory/beats/extractor.d.ts +47 -0
  181. package/dist/esm/memory/beats/formatAsNarrative.d.ts +62 -0
  182. package/dist/esm/memory/beats/heuristicExtractor.d.ts +37 -0
  183. package/dist/esm/memory/beats/index.d.ts +12 -0
  184. package/dist/esm/memory/beats/llmExtractor.d.ts +56 -0
  185. package/dist/esm/memory/beats/types.d.ts +60 -0
  186. package/dist/esm/memory/beats/writeBeats.d.ts +22 -0
  187. package/dist/esm/memory/causal/evidenceRecorder.d.ts +66 -0
  188. package/dist/esm/memory/causal/index.d.ts +6 -0
  189. package/dist/esm/memory/causal/loadSnapshot.d.ts +51 -0
  190. package/dist/esm/memory/causal/snapshotPipeline.d.ts +35 -0
  191. package/dist/esm/memory/causal/types.d.ts +130 -0
  192. package/dist/esm/memory/causal/writeSnapshot.d.ts +73 -0
  193. package/dist/esm/memory/define.d.ts +63 -0
  194. package/dist/esm/memory/define.types.d.ts +276 -0
  195. package/dist/esm/memory/define.types.js +1 -1
  196. package/dist/esm/memory/embedding/cosine.d.ts +18 -0
  197. package/dist/esm/memory/embedding/embedMessages.d.ts +58 -0
  198. package/dist/esm/memory/embedding/index.d.ts +8 -0
  199. package/dist/esm/memory/embedding/loadRelevant.d.ts +51 -0
  200. package/dist/esm/memory/embedding/mockEmbedder.d.ts +22 -0
  201. package/dist/esm/memory/embedding/types.d.ts +46 -0
  202. package/dist/esm/memory/entry/decay.d.ts +36 -0
  203. package/dist/esm/memory/entry/index.d.ts +2 -0
  204. package/dist/esm/memory/entry/types.d.ts +140 -0
  205. package/dist/esm/memory/facts/extractFacts.d.ts +50 -0
  206. package/dist/esm/memory/facts/extractor.d.ts +33 -0
  207. package/dist/esm/memory/facts/formatFacts.d.ts +60 -0
  208. package/dist/esm/memory/facts/index.d.ts +14 -0
  209. package/dist/esm/memory/facts/llmFactExtractor.d.ts +64 -0
  210. package/dist/esm/memory/facts/loadFacts.d.ts +43 -0
  211. package/dist/esm/memory/facts/patternFactExtractor.d.ts +2 -0
  212. package/dist/esm/memory/facts/types.d.ts +68 -0
  213. package/dist/esm/memory/facts/writeFacts.d.ts +19 -0
  214. package/dist/esm/memory/identity/index.d.ts +2 -0
  215. package/dist/esm/memory/identity/types.d.ts +49 -0
  216. package/dist/esm/memory/index.d.ts +19 -0
  217. package/dist/esm/memory/pipeline/auto.d.ts +59 -0
  218. package/dist/esm/memory/pipeline/default.d.ts +49 -0
  219. package/dist/esm/memory/pipeline/ephemeral.d.ts +28 -0
  220. package/dist/esm/memory/pipeline/fact.d.ts +26 -0
  221. package/dist/esm/memory/pipeline/index.d.ts +13 -0
  222. package/dist/esm/memory/pipeline/narrative.d.ts +35 -0
  223. package/dist/esm/memory/pipeline/semantic.d.ts +37 -0
  224. package/dist/esm/memory/pipeline/types.d.ts +31 -0
  225. package/dist/esm/memory/stages/formatDefault.d.ts +64 -0
  226. package/dist/esm/memory/stages/index.d.ts +13 -0
  227. package/dist/esm/memory/stages/loadRecent.d.ts +49 -0
  228. package/dist/esm/memory/stages/pickByBudget.d.ts +63 -0
  229. package/dist/esm/memory/stages/summarize.d.ts +87 -0
  230. package/dist/esm/memory/stages/tokenize.d.ts +43 -0
  231. package/dist/esm/memory/stages/types.d.ts +75 -0
  232. package/dist/esm/memory/stages/writeMessages.d.ts +71 -0
  233. package/dist/esm/memory/store/InMemoryStore.d.ts +62 -0
  234. package/dist/esm/memory/store/index.d.ts +2 -0
  235. package/dist/esm/memory/store/types.d.ts +223 -0
  236. package/dist/esm/memory/wire/index.d.ts +2 -0
  237. package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +108 -0
  238. package/dist/esm/memory-providers.d.ts +37 -0
  239. package/dist/esm/observability/contextError/finders/compareFinders.d.ts +19 -0
  240. package/dist/esm/observability/contextError/finders/index.d.ts +22 -0
  241. package/dist/esm/observability/contextError/finders/rankSuspects.d.ts +2 -0
  242. package/dist/esm/observability/contextError/finders/removeAndRetry.d.ts +11 -0
  243. package/dist/esm/observability/contextError/finders/shrinkToCause.d.ts +11 -0
  244. package/dist/esm/observability/contextError/finders/testManyCombos.d.ts +11 -0
  245. package/dist/esm/observability/contextError/finders/traceSteps.d.ts +2 -0
  246. package/dist/esm/observability/contextError/finders/types.d.ts +88 -0
  247. package/dist/esm/observability-providers.d.ts +46 -0
  248. package/dist/esm/observe.d.ts +62 -0
  249. package/dist/esm/observe.js +7 -1
  250. package/dist/esm/observe.js.map +1 -1
  251. package/dist/esm/patterns/Debate.d.ts +39 -0
  252. package/dist/esm/patterns/MapReduce.d.ts +66 -0
  253. package/dist/esm/patterns/Reflection.d.ts +51 -0
  254. package/dist/esm/patterns/SelfConsistency.d.ts +43 -0
  255. package/dist/esm/patterns/Swarm.d.ts +60 -0
  256. package/dist/esm/patterns/ToT.d.ts +53 -0
  257. package/dist/esm/patterns/index.d.ts +22 -0
  258. package/dist/esm/providers.d.ts +33 -0
  259. package/dist/esm/recorders/core/AgentRecorder.d.ts +15 -0
  260. package/dist/esm/recorders/core/CompositionRecorder.d.ts +17 -0
  261. package/dist/esm/recorders/core/ContextEvaluatedRecorder.d.ts +23 -0
  262. package/dist/esm/recorders/core/ContextRecorder.d.ts +47 -0
  263. package/dist/esm/recorders/core/CostRecorder.d.ts +14 -0
  264. package/dist/esm/recorders/core/EmitBridge.d.ts +30 -0
  265. package/dist/esm/recorders/core/ErrorBridge.d.ts +38 -0
  266. package/dist/esm/recorders/core/EvalRecorder.d.ts +16 -0
  267. package/dist/esm/recorders/core/MemoryRecorder.d.ts +17 -0
  268. package/dist/esm/recorders/core/PermissionRecorder.d.ts +16 -0
  269. package/dist/esm/recorders/core/ReliabilityRecorder.d.ts +24 -0
  270. package/dist/esm/recorders/core/SkillRecorder.d.ts +14 -0
  271. package/dist/esm/recorders/core/StreamRecorder.d.ts +15 -0
  272. package/dist/esm/recorders/core/ToolsRecorder.d.ts +18 -0
  273. package/dist/esm/recorders/core/ValidationRecorder.d.ts +16 -0
  274. package/dist/esm/recorders/core/contextEngineering.d.ts +136 -0
  275. package/dist/esm/recorders/core/typedEmit.d.ts +34 -0
  276. package/dist/esm/recorders/core/types.d.ts +97 -0
  277. package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.d.ts +117 -0
  278. package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +546 -0
  279. package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +220 -0
  280. package/dist/esm/recorders/observability/FlowchartRecorder.js +10 -2
  281. package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
  282. package/dist/esm/recorders/observability/LiveStateRecorder.d.ts +250 -0
  283. package/dist/esm/recorders/observability/LoggingRecorder.d.ts +91 -0
  284. package/dist/esm/recorders/observability/RouteRecorder.d.ts +83 -0
  285. package/dist/esm/recorders/observability/RunStepRecorder.d.ts +231 -0
  286. package/dist/esm/recorders/observability/StatusRecorder.d.ts +36 -0
  287. package/dist/esm/recorders/observability/ToolChoiceRecorder.d.ts +164 -0
  288. package/dist/esm/recorders/observability/ToolLineageRecorder.d.ts +71 -0
  289. package/dist/esm/recorders/observability/commentary/commentaryTemplates.d.ts +105 -0
  290. package/dist/esm/recorders/observability/internal/ActorArrowClassifier.d.ts +25 -0
  291. package/dist/esm/recorders/observability/internal/CandidateAnswerBuffer.d.ts +28 -0
  292. package/dist/esm/recorders/observability/internal/ForkTracker.d.ts +60 -0
  293. package/dist/esm/recorders/observability/internal/RootInferrer.d.ts +51 -0
  294. package/dist/esm/recorders/observability/internal/SequenceSiblingTracker.d.ts +24 -0
  295. package/dist/esm/recorders/observability/localObservability.d.ts +48 -0
  296. package/dist/esm/recorders/observability/localObservability.js +54 -0
  297. package/dist/esm/recorders/observability/localObservability.js.map +1 -0
  298. package/dist/esm/recorders/observability/observeRunId.d.ts +36 -0
  299. package/dist/esm/recorders/observability/status/statusTemplates.d.ts +106 -0
  300. package/dist/esm/recorders/observability/trace.d.ts +119 -0
  301. package/dist/esm/recorders/observability/trace.js +99 -0
  302. package/dist/esm/recorders/observability/trace.js.map +1 -0
  303. package/dist/esm/reliability/CircuitBreaker.d.ts +75 -0
  304. package/dist/esm/reliability/buildReliabilityGateChart.d.ts +53 -0
  305. package/dist/esm/reliability/classifyError.d.ts +28 -0
  306. package/dist/esm/reliability/index.d.ts +35 -0
  307. package/dist/esm/reliability/types.d.ts +327 -0
  308. package/dist/esm/resilience/fallbackProvider.d.ts +33 -0
  309. package/dist/esm/resilience/index.d.ts +21 -0
  310. package/dist/esm/resilience/withCircuitBreaker.d.ts +129 -0
  311. package/dist/esm/resilience/withFallback.d.ts +45 -0
  312. package/dist/esm/resilience/withRetry.d.ts +71 -0
  313. package/dist/esm/security/PermissionPolicy.d.ts +124 -0
  314. package/dist/esm/security/PolicyHaltError.d.ts +72 -0
  315. package/dist/esm/security/extractSequence.d.ts +46 -0
  316. package/dist/esm/security/index.d.ts +44 -0
  317. package/dist/esm/security/thinkingRedaction.d.ts +50 -0
  318. package/dist/esm/status.d.ts +48 -0
  319. package/dist/esm/strategies/attach.d.ts +47 -0
  320. package/dist/esm/strategies/compose.d.ts +48 -0
  321. package/dist/esm/strategies/defaults/chatBubbleLiveStatus.d.ts +36 -0
  322. package/dist/esm/strategies/defaults/consoleObservability.d.ts +42 -0
  323. package/dist/esm/strategies/defaults/inMemorySinkCost.d.ts +50 -0
  324. package/dist/esm/strategies/defaults/index.d.ts +30 -0
  325. package/dist/esm/strategies/defaults/noopLens.d.ts +28 -0
  326. package/dist/esm/strategies/index.d.ts +36 -0
  327. package/dist/esm/strategies/registry.d.ts +70 -0
  328. package/dist/esm/strategies/types.d.ts +303 -0
  329. package/dist/esm/stream.d.ts +82 -0
  330. package/dist/esm/thinking/AnthropicThinkingHandler.d.ts +42 -0
  331. package/dist/esm/thinking/MockThinkingHandler.d.ts +50 -0
  332. package/dist/esm/thinking/OpenAIThinkingHandler.d.ts +37 -0
  333. package/dist/esm/thinking/index.d.ts +51 -0
  334. package/dist/esm/thinking/registry.d.ts +33 -0
  335. package/dist/esm/thinking/types.d.ts +162 -0
  336. package/dist/esm/tool-providers/gatedTools.d.ts +36 -0
  337. package/dist/esm/tool-providers/index.d.ts +41 -0
  338. package/dist/esm/tool-providers/skillScopedTools.d.ts +45 -0
  339. package/dist/esm/tool-providers/staticTools.d.ts +21 -0
  340. package/dist/esm/tool-providers/types.d.ts +138 -0
  341. package/dist/index.js +6 -2
  342. package/dist/index.js.map +1 -1
  343. package/dist/lib/context-bisect/index.js +3 -0
  344. package/dist/lib/context-bisect/index.js.map +1 -1
  345. package/dist/lib/context-bisect/localize.js +2 -0
  346. package/dist/lib/context-bisect/localize.js.map +1 -1
  347. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
  348. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  349. package/dist/lib/injection-engine/entryScorer.js +178 -0
  350. package/dist/lib/injection-engine/entryScorer.js.map +1 -0
  351. package/dist/lib/injection-engine/index.js +5 -1
  352. package/dist/lib/injection-engine/index.js.map +1 -1
  353. package/dist/lib/injection-engine/skillGraph.js +35 -41
  354. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  355. package/dist/lib/injection-engine/types.js.map +1 -1
  356. package/dist/memory/define.types.js +1 -1
  357. package/dist/observe.js +14 -3
  358. package/dist/observe.js.map +1 -1
  359. package/dist/recorders/observability/FlowchartRecorder.js +12 -3
  360. package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
  361. package/dist/recorders/observability/localObservability.js +58 -0
  362. package/dist/recorders/observability/localObservability.js.map +1 -0
  363. package/dist/recorders/observability/trace.js +105 -0
  364. package/dist/recorders/observability/trace.js.map +1 -0
  365. package/dist/types/core/RunnerBase.d.ts.map +1 -1
  366. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  367. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  368. package/dist/types/core/agent/stages/pickEntry.d.ts.map +1 -1
  369. package/dist/types/core/agent/types.d.ts +8 -4
  370. package/dist/types/core/agent/types.d.ts.map +1 -1
  371. package/dist/types/core/runner.d.ts +12 -0
  372. package/dist/types/core/runner.d.ts.map +1 -1
  373. package/dist/types/index.d.ts +1 -1
  374. package/dist/types/index.d.ts.map +1 -1
  375. package/dist/types/lib/context-bisect/index.d.ts +3 -0
  376. package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
  377. package/dist/types/lib/context-bisect/localize.d.ts +2 -0
  378. package/dist/types/lib/context-bisect/localize.d.ts.map +1 -1
  379. package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
  380. package/dist/types/lib/injection-engine/entryScorer.d.ts +94 -0
  381. package/dist/types/lib/injection-engine/entryScorer.d.ts.map +1 -0
  382. package/dist/types/lib/injection-engine/index.d.ts +1 -0
  383. package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
  384. package/dist/types/lib/injection-engine/skillGraph.d.ts +21 -24
  385. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  386. package/dist/types/lib/injection-engine/types.d.ts +9 -4
  387. package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
  388. package/dist/types/memory/define.types.d.ts +1 -1
  389. package/dist/types/observe.d.ts +3 -1
  390. package/dist/types/observe.d.ts.map +1 -1
  391. package/dist/types/recorders/observability/FlowchartRecorder.d.ts +8 -1
  392. package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
  393. package/dist/types/recorders/observability/localObservability.d.ts +49 -0
  394. package/dist/types/recorders/observability/localObservability.d.ts.map +1 -0
  395. package/dist/types/recorders/observability/trace.d.ts +120 -0
  396. package/dist/types/recorders/observability/trace.d.ts.map +1 -0
  397. package/package.json +203 -56
@@ -0,0 +1,41 @@
1
+ /**
2
+ * defineInjection — the unified injection factory (one factory, a `type`
3
+ * discriminant for the flavor).
4
+ *
5
+ * The named factories (`defineInstruction`, `defineSkill`, `defineSteering`,
6
+ * `defineFact`) are self-documenting sugar — prefer them when you know the
7
+ * flavor at author time. `defineInjection` is for the cases where the flavor is
8
+ * chosen *programmatically* (config-driven pipelines, a UI that lets users add
9
+ * any flavor, table-driven tests) — pass `type` and the same options the named
10
+ * factory takes:
11
+ *
12
+ * @example
13
+ * // these two are equivalent
14
+ * defineInstruction({ id: 'calm', prompt: '…', activeWhen });
15
+ * defineInjection({ type: 'instruction', id: 'calm', prompt: '…', activeWhen });
16
+ *
17
+ * @example // flavor decided at runtime
18
+ * const inj = defineInjection({ type: cfg.flavor, id: cfg.id, ...cfg.opts });
19
+ *
20
+ * All four flavors return the same `Injection` primitive — `type` simply routes
21
+ * to the matching named factory. RAG and Memory are NOT covered here: they are
22
+ * separate subsystems (retrieval + stores), not plain Injections.
23
+ */
24
+ import type { Injection } from '../types.js';
25
+ import { type DefineFactOptions } from './defineFact.js';
26
+ import { type DefineInstructionOptions } from './defineInstruction.js';
27
+ import { type DefineSkillOptions } from './defineSkill.js';
28
+ import { type DefineSteeringOptions } from './defineSteering.js';
29
+ /** Discriminated union — `type` picks the flavor; the rest are that flavor's options. */
30
+ export type DefineInjectionOptions = ({
31
+ type: 'instruction';
32
+ } & DefineInstructionOptions) | ({
33
+ type: 'skill';
34
+ } & DefineSkillOptions) | ({
35
+ type: 'steering';
36
+ } & DefineSteeringOptions) | ({
37
+ type: 'fact';
38
+ } & DefineFactOptions);
39
+ /** The flavor discriminants `defineInjection` accepts. */
40
+ export type InjectionFlavor = DefineInjectionOptions['type'];
41
+ export declare function defineInjection(opts: DefineInjectionOptions): Injection;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * defineInstruction — sugar for rule-based system-prompt Injections.
3
+ *
4
+ * The most flexible Instruction-style flavor: a predicate decides
5
+ * activation each iteration. Use for "if condition X is true, give
6
+ * the LLM this guidance". Compared to:
7
+ * - Steering (always-on, no predicate)
8
+ * - Skill (LLM-activated via `read_skill`)
9
+ * - on-tool-return (specific tool just ran — Dynamic ReAct)
10
+ *
11
+ * Produces an `Injection` with:
12
+ * - flavor: `'instructions'`
13
+ * - trigger: `{ kind: 'rule', activeWhen }` (or `'always'` if omitted)
14
+ * - inject: `{ systemPrompt: prompt }`
15
+ *
16
+ * @example
17
+ * const calmTone = defineInstruction({
18
+ * id: 'calm-tone',
19
+ * description: 'Use a calm, empathetic tone with frustrated users.',
20
+ * activeWhen: (ctx) => /upset|angry|frustrated/.test(ctx.userMessage),
21
+ * prompt: 'Acknowledge feelings before facts. Avoid corporate jargon.',
22
+ * });
23
+ *
24
+ * const piiAfterRedact = defineInstruction({
25
+ * id: 'pii-after-redact',
26
+ * activeWhen: (ctx) => ctx.lastToolResult?.toolName === 'redact_pii',
27
+ * prompt: 'PII has been redacted. Do not include emails or phone numbers.',
28
+ * });
29
+ */
30
+ import type { ContextRole } from '../../../events/types.js';
31
+ import type { Injection, InjectionContext } from '../types.js';
32
+ import type { CachePolicy } from '../../../cache/types.js';
33
+ export interface DefineInstructionOptions {
34
+ readonly id: string;
35
+ readonly description?: string;
36
+ /**
37
+ * Predicate to decide activation. Synchronous; side-effect free.
38
+ * If omitted, the instruction is always active (effectively a
39
+ * Steering doc, but tagged with `'instructions'` flavor for
40
+ * narrative semantics — use `defineSteering` for clearer intent).
41
+ * Predicates that throw are skipped (fail-open) and reported via
42
+ * `agentfootprint.context.evaluated`.
43
+ */
44
+ readonly activeWhen?: (ctx: InjectionContext) => boolean;
45
+ /** Instruction text. Lands in the slot specified by `slot` (default system-prompt). */
46
+ readonly prompt: string;
47
+ /**
48
+ * Where the instruction lands.
49
+ *
50
+ * - `'system-prompt'` (default) — appended to the system prompt.
51
+ * Lower attention than recent messages but always available.
52
+ * - `'messages'` — appended as a recent message. **Higher attention
53
+ * weight** — the LLM reads recent messages more carefully than
54
+ * system-prompt text. Use this for guidance that MUST be salient
55
+ * on this turn (post-tool-result reminders, urgent corrections).
56
+ *
57
+ * Same instruction object can target both slots in different agents
58
+ * — the trigger semantics don't change.
59
+ */
60
+ readonly slot?: 'system-prompt' | 'messages';
61
+ /**
62
+ * When `slot: 'messages'`, the role to use. Default `'system'`.
63
+ * `'user'` is also valid; `'assistant'` and `'tool'` work in
64
+ * principle but rarely make pedagogical sense.
65
+ */
66
+ readonly role?: ContextRole;
67
+ /**
68
+ * Cache policy for this instruction. Defaults to `'never'` —
69
+ * instructions are typically rule-based (volatile per-iter
70
+ * `activeWhen` predicates, on-tool-return reminders). Override to
71
+ * `'always'` only for instructions you know are stable per-turn
72
+ * (e.g., a static safety rule wrapped as `defineInstruction` for
73
+ * narrative tagging — though `defineSteering` is the cleaner choice
74
+ * for that case).
75
+ */
76
+ readonly cache?: CachePolicy;
77
+ }
78
+ export declare function defineInstruction(opts: DefineInstructionOptions): Injection;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * defineRelevanceHint — an advisory system-prompt note for an ambiguous entry.
3
+ *
4
+ * When `entryByRelevance()` picks the starting skill but the top candidates are a
5
+ * NEAR-TIE under the relevance scorer, this injection drops a NON-BINDING note into
6
+ * the system prompt for that turn: "an offline scorer found these close; it can't
7
+ * see the conversation — use your own judgment." A hint, not an order.
8
+ *
9
+ * Anti-anchoring is the point (the proxy is a rough keyword match, not the model's
10
+ * own reasoning), so the note is framed as advisory and only fires on a real tie.
11
+ * It rides the normal injection path (`context.evaluated`) — no new event. Reads
12
+ * `ctx.entryScores` (set by the PickEntry stage), so it needs `.entryByRelevance()`.
13
+ *
14
+ * Add it explicitly: `Agent.create(...).skillGraph(graph).injection(defineRelevanceHint())`.
15
+ */
16
+ import type { Injection } from '../types.js';
17
+ export interface RelevanceHintOptions {
18
+ /** Injection id (default `'relevance-hint'`). */
19
+ readonly id?: string;
20
+ /**
21
+ * Near-tie threshold: the hint fires when (top relevance − 2nd relevance) is
22
+ * below this. Default `0.15` (relevances are softmax shares summing to 1).
23
+ */
24
+ readonly threshold?: number;
25
+ }
26
+ export declare function defineRelevanceHint(options?: RelevanceHintOptions): Injection;
@@ -0,0 +1,160 @@
1
+ /**
2
+ * defineSkill — sugar for LLM-activated Injections that target both
3
+ * system-prompt + tools.
4
+ *
5
+ * A Skill is a bundle of (1) a body of guidance and (2) optionally
6
+ * unlocked tools. The LLM decides when a Skill is needed by calling
7
+ * a designated activation tool — by default `read_skill(<id>)`.
8
+ *
9
+ * Produces an `Injection` with:
10
+ * - flavor: `'skill'`
11
+ * - trigger: `{ kind: 'llm-activated', viaToolName: 'read_skill' }`
12
+ * - inject: `{ systemPrompt: body, tools }`
13
+ *
14
+ * The Agent integration auto-attaches the `read_skill` tool when one
15
+ * or more Skills are present. When the LLM calls
16
+ * `read_skill('billing')`, the engine adds `'billing'` to
17
+ * `ctx.activatedInjectionIds`; the next iteration's evaluator
18
+ * matches this Skill's `id`, activates it, and the body + tools land
19
+ * in the slot subflows.
20
+ *
21
+ * @example
22
+ * const billingSkill = defineSkill({
23
+ * id: 'billing',
24
+ * description: 'Use for refunds, charges, billing questions.',
25
+ * body: 'When handling billing: confirm identity first, then…',
26
+ * tools: [refundTool, chargeHistoryTool],
27
+ * });
28
+ */
29
+ import type { Injection } from '../types.js';
30
+ import type { Tool } from '../../../core/tools.js';
31
+ import type { CachePolicy } from '../../../cache/types.js';
32
+ /**
33
+ * Where the Skill's body lands when activated.
34
+ *
35
+ * - `'system-prompt'` — body appended to the system slot on the
36
+ * iteration after activation. Best on Claude ≥ 3.5 (training-time
37
+ * adherence to system-prompt instructions is strong).
38
+ * - `'tool-only'` — body delivered ONLY via the `read_skill` tool's
39
+ * result. Recency-first by protocol; doesn't rely on the model's
40
+ * training to honor system-prompt anchoring. Default for every
41
+ * non-Claude provider.
42
+ * - `'both'` — body lands in both the system slot AND the tool result.
43
+ * Belt-and-suspenders for high-stakes Skills on long-context runs.
44
+ * - `'auto'` — the library picks per provider via `resolveSurfaceMode`.
45
+ * `'both'` on Claude ≥ 3.5; `'tool-only'` everywhere else.
46
+ *
47
+ * **v2.5 runtime dispatch (Block C):** modes now route differently:
48
+ * - `'system-prompt'` → body in system slot, tool result is confirmation
49
+ * - `'tool-only'` → body SUPPRESSED from system slot, tool result IS the body
50
+ * - `'both'` → body in system slot AND in tool result
51
+ * - `'auto'` → keeps v2.4 behavior (body in system slot, tool result is confirmation)
52
+ * The Block A4 cascade resolves `'auto'` against provider/model context
53
+ * at a future runtime layer (Claude ≥ 3.5 → `'both'`; else `'tool-only'`).
54
+ */
55
+ export type SurfaceMode = 'auto' | 'system-prompt' | 'tool-only' | 'both';
56
+ /**
57
+ * When (if ever) to re-deliver a Skill's body in long-running runs.
58
+ *
59
+ * Even on providers with strong system-prompt adherence, attention to
60
+ * the system slot decays past long contexts. `refreshPolicy` re-injects
61
+ * the body via tool result past a token threshold so the LLM sees it
62
+ * fresh again.
63
+ *
64
+ * **v2.4 status:** the field is reserved + typed; the runtime hook
65
+ * lands in v2.5 as part of the long-context attention work. Specifying
66
+ * `refreshPolicy` today is non-breaking — the engine ignores it until
67
+ * the hook is implemented.
68
+ */
69
+ export interface RefreshPolicy {
70
+ /**
71
+ * Re-inject the Skill body once the run has consumed this many input
72
+ * tokens since the Skill was last surfaced. Recommended: 50_000 for
73
+ * 200k-context models; 20_000 for 32k-context models.
74
+ */
75
+ readonly afterTokens: number;
76
+ /**
77
+ * How to re-inject. `'tool-result'` synthesizes a fresh tool result
78
+ * carrying the body text (recency-first). Other modes reserved.
79
+ */
80
+ readonly via: 'tool-result';
81
+ }
82
+ export interface DefineSkillOptions {
83
+ readonly id: string;
84
+ /** Visible to the LLM via the activation tool's description. */
85
+ readonly description: string;
86
+ /** Body appended to the system-prompt slot once activated. */
87
+ readonly body: string;
88
+ /** Optional unlocked tools, added to the tools slot once activated. */
89
+ readonly tools?: readonly Tool[];
90
+ /**
91
+ * Override the activation tool name. Defaults to `'read_skill'`.
92
+ * Multiple Skills sharing one activation tool is the common pattern;
93
+ * the LLM picks WHICH skill via the tool's argument.
94
+ */
95
+ readonly viaToolName?: string;
96
+ /**
97
+ * Where the body lands when activated. See `SurfaceMode`. Default
98
+ * `'auto'` — the library resolves per provider via `resolveSurfaceMode`.
99
+ */
100
+ readonly surfaceMode?: SurfaceMode;
101
+ /**
102
+ * Re-deliver the body past a token threshold to defend against
103
+ * long-context attention decay. Default: undefined (no refresh).
104
+ */
105
+ readonly refreshPolicy?: RefreshPolicy;
106
+ /**
107
+ * Per-skill tool gating intent. Block A5 / v2.5.
108
+ *
109
+ * - `'currentSkill'` — when this Skill is the only active one, the
110
+ * agent's tool list should narrow to this Skill's `tools` (plus
111
+ * the consumer-composed baseline). Used with
112
+ * `skillScopedTools(id, tools)` from `agentfootprint/tool-providers`
113
+ * to materialize the gate. Block C wires this into the runtime
114
+ * automatically.
115
+ * - `undefined` (default) — current additive behavior: this Skill's
116
+ * tools are added to the agent's registry on activation, alongside
117
+ * every other tool already registered.
118
+ *
119
+ * The field is a forward-compat marker today: the metadata stores
120
+ * it; consumers can read `skill.metadata.autoActivate` to drive
121
+ * their own ToolProvider composition. v2.5 runtime wiring builds
122
+ * on this contract without API change.
123
+ */
124
+ readonly autoActivate?: AutoActivateMode;
125
+ /**
126
+ * Cache policy for this skill's body. Defaults to `'while-active'` —
127
+ * the body caches while the skill is in `activeInjections[]` (i.e.,
128
+ * while it's the most-recently-activated skill); invalidates the
129
+ * moment it deactivates.
130
+ *
131
+ * For skills with stable, frequently-accessed bodies, consider
132
+ * `'always'` to keep the body cached even when temporarily inactive.
133
+ * For skills with bodies that depend on per-iter state, use
134
+ * `'never'` or `{ until: ... }`.
135
+ *
136
+ * See `CachePolicy` in `agentfootprint/src/cache/types.ts`.
137
+ */
138
+ readonly cache?: CachePolicy;
139
+ }
140
+ /**
141
+ * Per-skill tool gating mode. See `DefineSkillOptions.autoActivate`.
142
+ *
143
+ * Reserved future values: `'always'` (always show this Skill's tools
144
+ * regardless of activation), `'group'` (gate by a named skill group).
145
+ */
146
+ export type AutoActivateMode = 'currentSkill';
147
+ /**
148
+ * Resolve `surfaceMode: 'auto'` to a concrete mode based on provider
149
+ * + model. The defaults match the per-provider attention profile
150
+ * documented in the Skills, explained essay:
151
+ *
152
+ * - Claude >= 3.5 → 'both' (cheap to cache, high adherence)
153
+ * - Claude pre-3.5 → 'tool-only' (recency-first more reliable)
154
+ * - OpenAI / Bedrock / Ollama / Mock / unknown → 'tool-only'
155
+ *
156
+ * Pure function — no side effects. Consumers can call directly to
157
+ * inspect what `'auto'` will resolve to in their stack.
158
+ */
159
+ export declare function resolveSurfaceMode(provider: string, model?: string): SurfaceMode;
160
+ export declare function defineSkill(opts: DefineSkillOptions): Injection;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * defineSteering — sugar for always-on system-prompt Injections.
3
+ *
4
+ * Steering docs are the simplest form of context engineering: a fixed
5
+ * piece of guidance the LLM should follow on every iteration. Style
6
+ * guides, output format rules, persona statements, safety policies.
7
+ *
8
+ * Produces an `Injection` with:
9
+ * - flavor: `'steering'`
10
+ * - trigger: `{ kind: 'always' }`
11
+ * - inject: `{ systemPrompt: prompt }`
12
+ *
13
+ * @example
14
+ * const jsonOnly = defineSteering({
15
+ * id: 'json-only',
16
+ * description: 'Always respond with valid JSON.',
17
+ * prompt: 'Respond with JSON only. No prose. No markdown.',
18
+ * });
19
+ */
20
+ import type { Injection } from '../types.js';
21
+ import type { CachePolicy } from '../../../cache/types.js';
22
+ export interface DefineSteeringOptions {
23
+ readonly id: string;
24
+ readonly description?: string;
25
+ /** Always-on text appended to the system-prompt slot. */
26
+ readonly prompt: string;
27
+ /**
28
+ * Cache policy for this steering injection. Defaults to `'always'`
29
+ * — steering is by definition always-on stable content, ideal for
30
+ * provider-side caching. Override with `'never'` if the prompt
31
+ * contains volatile content (timestamps, per-request IDs).
32
+ *
33
+ * See `CachePolicy` in `agentfootprint/src/cache/types.ts` for all
34
+ * variants. The CacheDecision subflow reads this from
35
+ * `injection.metadata.cache` each iteration.
36
+ */
37
+ readonly cache?: CachePolicy;
38
+ }
39
+ export declare function defineSteering(opts: DefineSteeringOptions): Injection;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * agentfootprint Injection Engine — public barrel.
3
+ *
4
+ * The unifying primitive of agentfootprint context engineering.
5
+ * One `Injection` type. One `InjectionEngine` subflow. N typed sugar
6
+ * factories. See `README.md` in this folder for the full concept.
7
+ */
8
+ export type { Injection, InjectionTrigger, InjectionContent, InjectionContext, InjectionEvaluation, ActiveInjection, } from './types.js';
9
+ export { projectActiveInjection } from './types.js';
10
+ export { evaluateInjections } from './evaluator.js';
11
+ export { buildInjectionEngineSubflow, type InjectionEngineConfig, } from './buildInjectionEngineSubflow.js';
12
+ export { defineInstruction, type DefineInstructionOptions } from './factories/defineInstruction.js';
13
+ export { defineRelevanceHint, type RelevanceHintOptions } from './factories/defineRelevanceHint.js';
14
+ export { defineSkill, resolveSurfaceMode, type DefineSkillOptions, type SurfaceMode, type RefreshPolicy, type AutoActivateMode, } from './factories/defineSkill.js';
15
+ export { SkillRegistry, type SkillRegistryOptions } from './SkillRegistry.js';
16
+ export { buildListSkillsTool, buildReadSkillTool, type SkillToolPair } from './skillTools.js';
17
+ export { defineSteering, type DefineSteeringOptions } from './factories/defineSteering.js';
18
+ export { defineFact, type DefineFactOptions } from './factories/defineFact.js';
19
+ export { defineInjection, type DefineInjectionOptions, type InjectionFlavor, } from './factories/defineInjection.js';
20
+ export { skillGraph, decide, SKILL_GRAPH_METADATA_KEY, type SkillGraph, type SkillGraphBuilder, type SkillRouteOptions, type SkillEntryOptions, type TreeOptions, type SkillEdge, type SkillEdgeKind, type SkillNode, type DecisionNode, type SkillRouting, type SkillRoutingStep, type EntryScore, type EntryScoring, type SkillGraphConfig, type BuildOptions, type GraphCheckMode, type GraphCheckup, type GraphProblem, type GraphProblemCode, } from './skillGraph.js';
21
+ export { keywordScorer, embeddingScorer, rankEntries, type EntryScorer, type EntryScorerInput, type EntryCandidate, } from './entryScorer.js';
22
+ export { checkSkillContract, checkSkillContracts, skillToolNames } from './skillContract.js';
@@ -29,5 +29,6 @@ export { defineInjection, } from './factories/defineInjection.js';
29
29
  // Declarative skill graph (proposal 002) — declare skills + routing edges →
30
30
  // graph-derived triggers + a drawable topology. Sugar over the trigger model.
31
31
  export { skillGraph, decide, SKILL_GRAPH_METADATA_KEY, } from './skillGraph.js';
32
+ export { keywordScorer, embeddingScorer, rankEntries, } from './entryScorer.js';
32
33
  export { checkSkillContract, checkSkillContracts, skillToolNames } from './skillContract.js';
33
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,+DAA+D;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,GAE5B,MAAM,kCAAkC,CAAC;AAE1C,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAiC,MAAM,kCAAkC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAA6B,MAAM,oCAAoC,CAAC;AAEpG,OAAO,EACL,WAAW,EACX,kBAAkB,GAKnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAE9E,wEAAwE;AACxE,sEAAsE;AACtE,iEAAiE;AACjE,+BAA+B;AAC/B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAsB,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAA8B,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,UAAU,EAA0B,MAAM,2BAA2B,CAAC;AAE/E,6EAA6E;AAC7E,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,eAAe,GAGhB,MAAM,gCAAgC,CAAC;AAExC,4EAA4E;AAC5E,8EAA8E;AAC9E,OAAO,EACL,UAAU,EACV,MAAM,EACN,wBAAwB,GAoBzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,+DAA+D;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,GAE5B,MAAM,kCAAkC,CAAC;AAE1C,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAiC,MAAM,kCAAkC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAA6B,MAAM,oCAAoC,CAAC;AAEpG,OAAO,EACL,WAAW,EACX,kBAAkB,GAKnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAE9E,wEAAwE;AACxE,sEAAsE;AACtE,iEAAiE;AACjE,+BAA+B;AAC/B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAsB,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAA8B,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,UAAU,EAA0B,MAAM,2BAA2B,CAAC;AAE/E,6EAA6E;AAC7E,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,eAAe,GAGhB,MAAM,gCAAgC,CAAC;AAExC,4EAA4E;AAC5E,8EAA8E;AAC9E,OAAO,EACL,UAAU,EACV,MAAM,EACN,wBAAwB,GAoBzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,eAAe,EACf,WAAW,GAIZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Skill-body ↔ tool-contract consistency check (Proposal 009, Tier 1).
3
+ *
4
+ * A skill's `body` (prose injected into the system prompt) can quietly contradict
5
+ * the tools it actually unlocks, and the model then **refuses a tool that is right
6
+ * there** — or is told about one it can't call. The library already knows each
7
+ * skill's real tool set (`inject.tools`), so it can flag the mismatch at authoring
8
+ * time instead of at run time.
9
+ *
10
+ * Tier 1 is DETERMINISTIC (no LLM): pure string + schema checks. The semantic
11
+ * contradictions it can't see — e.g. "the body calls an OPTIONAL arg required" —
12
+ * are Tier 2 (LLM-advisory, opt-in). Both checks here are WARNINGS, never errors:
13
+ * a body naming a foreign tool is often an intentional `read_skill` handoff hint.
14
+ */
15
+ import type { Injection } from './types.js';
16
+ import type { GraphProblem } from './skillGraphCheckup.js';
17
+ /** The tool names a skill unlocks (`inject.tools[].schema.name`). */
18
+ export declare function skillToolNames(skill: Injection): readonly string[];
19
+ /**
20
+ * Check ONE skill's body against its tool contract. Pure + side-effect-free.
21
+ *
22
+ * @param skill the skill to check
23
+ * @param knownToolNames every tool name reachable in the wider graph/agent (lets
24
+ * the check tell a cross-skill HANDOFF from a typo). Omit to
25
+ * check a skill in isolation (only its own tools are "known").
26
+ */
27
+ export declare function checkSkillContract(skill: Injection, knownToolNames?: ReadonlySet<string>): GraphProblem[];
28
+ /** Run the contract check across many skills with a shared known-tool set. Pure. */
29
+ export declare function checkSkillContracts(skills: readonly Injection[]): GraphProblem[];