@llm-dev-ops/agentics-cli 1.4.59 → 1.4.68

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 (451) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/agents.d.ts.map +1 -1
  3. package/dist/commands/agents.js +167 -0
  4. package/dist/commands/agents.js.map +1 -1
  5. package/dist/pipeline/auto-chain.d.ts +1 -0
  6. package/dist/pipeline/auto-chain.d.ts.map +1 -1
  7. package/dist/pipeline/auto-chain.js +124 -37
  8. package/dist/pipeline/auto-chain.js.map +1 -1
  9. package/dist/pipeline/execution-context.d.ts.map +1 -1
  10. package/dist/pipeline/execution-context.js +12 -37
  11. package/dist/pipeline/execution-context.js.map +1 -1
  12. package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
  13. package/dist/pipeline/phase2/phases/adr-generator.js +160 -1
  14. package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
  15. package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
  16. package/dist/pipeline/phase2/phases/ddd-generator.js +400 -3
  17. package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
  18. package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts +43 -0
  19. package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts.map +1 -0
  20. package/dist/pipeline/phase2/phases/ddd-quality-gate.js +413 -0
  21. package/dist/pipeline/phase2/phases/ddd-quality-gate.js.map +1 -0
  22. package/dist/pipeline/phase2/phases/research-dossier.d.ts +0 -13
  23. package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
  24. package/dist/pipeline/phase2/phases/research-dossier.js +114 -1
  25. package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
  26. package/dist/pipeline/phase2/phases/research-quality-gate.d.ts +48 -0
  27. package/dist/pipeline/phase2/phases/research-quality-gate.d.ts.map +1 -0
  28. package/dist/pipeline/phase2/phases/research-quality-gate.js +322 -0
  29. package/dist/pipeline/phase2/phases/research-quality-gate.js.map +1 -0
  30. package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts +41 -0
  31. package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts.map +1 -0
  32. package/dist/pipeline/phase2/phases/sparc-quality-gate.js +350 -0
  33. package/dist/pipeline/phase2/phases/sparc-quality-gate.js.map +1 -0
  34. package/dist/pipeline/phase2/phases/sparc-specification.d.ts +14 -0
  35. package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
  36. package/dist/pipeline/phase2/phases/sparc-specification.js +500 -10
  37. package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
  38. package/dist/pipeline/phase2/phases/tdd-plan-generator.js +1 -1
  39. package/dist/pipeline/phase2/phases/tdd-plan-generator.js.map +1 -1
  40. package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts +72 -0
  41. package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts.map +1 -0
  42. package/dist/pipeline/phase2/phases/tech-stack-detector.js +332 -0
  43. package/dist/pipeline/phase2/phases/tech-stack-detector.js.map +1 -0
  44. package/dist/pipeline/phase2/types.d.ts +2 -0
  45. package/dist/pipeline/phase2/types.d.ts.map +1 -1
  46. package/dist/pipeline/phase3/phases/domain-codegen.d.ts.map +1 -1
  47. package/dist/pipeline/phase3/phases/domain-codegen.js +169 -4
  48. package/dist/pipeline/phase3/phases/domain-codegen.js.map +1 -1
  49. package/dist/pipeline/phase3/phases/test-generator.d.ts.map +1 -1
  50. package/dist/pipeline/phase3/phases/test-generator.js +12 -2
  51. package/dist/pipeline/phase3/phases/test-generator.js.map +1 -1
  52. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.d.ts.map +1 -1
  53. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js +99 -1
  54. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js.map +1 -1
  55. package/dist/pipeline/phase4/phases/deployment-generator.d.ts +17 -4
  56. package/dist/pipeline/phase4/phases/deployment-generator.d.ts.map +1 -1
  57. package/dist/pipeline/phase4/phases/deployment-generator.js +364 -44
  58. package/dist/pipeline/phase4/phases/deployment-generator.js.map +1 -1
  59. package/dist/pipeline/phase4/phases/erp-client-generator.d.ts.map +1 -1
  60. package/dist/pipeline/phase4/phases/erp-client-generator.js +27 -15
  61. package/dist/pipeline/phase4/phases/erp-client-generator.js.map +1 -1
  62. package/dist/pipeline/phase4/phases/erp-target-resolver.d.ts.map +1 -1
  63. package/dist/pipeline/phase4/phases/erp-target-resolver.js +49 -2
  64. package/dist/pipeline/phase4/phases/erp-target-resolver.js.map +1 -1
  65. package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
  66. package/dist/pipeline/phase4/phases/http-server-generator.js +263 -3
  67. package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
  68. package/dist/pipeline/phase4/phases/infra-adapter-generator.d.ts.map +1 -1
  69. package/dist/pipeline/phase4/phases/infra-adapter-generator.js +335 -37
  70. package/dist/pipeline/phase4/phases/infra-adapter-generator.js.map +1 -1
  71. package/dist/pipeline/phase4/types.d.ts +3 -1
  72. package/dist/pipeline/phase4/types.d.ts.map +1 -1
  73. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
  74. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +211 -2
  75. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
  76. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts +54 -0
  77. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts.map +1 -0
  78. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js +417 -0
  79. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js.map +1 -0
  80. package/dist/pipeline/phases/prompt-generator.js +1 -1
  81. package/dist/pipeline/phases/prompt-generator.js.map +1 -1
  82. package/dist/pipeline/ruflo-phase-executor.d.ts +116 -1
  83. package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
  84. package/dist/pipeline/ruflo-phase-executor.js +666 -159
  85. package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
  86. package/dist/pipeline/swarm-orchestrator.d.ts.map +1 -1
  87. package/dist/pipeline/swarm-orchestrator.js +62 -6
  88. package/dist/pipeline/swarm-orchestrator.js.map +1 -1
  89. package/dist/routing/capability-classifier.d.ts +43 -0
  90. package/dist/routing/capability-classifier.d.ts.map +1 -0
  91. package/dist/routing/capability-classifier.js +157 -0
  92. package/dist/routing/capability-classifier.js.map +1 -0
  93. package/dist/routing/composition-engine.d.ts +77 -0
  94. package/dist/routing/composition-engine.d.ts.map +1 -0
  95. package/dist/routing/composition-engine.js +249 -0
  96. package/dist/routing/composition-engine.js.map +1 -0
  97. package/dist/routing/graph-federation.d.ts +71 -0
  98. package/dist/routing/graph-federation.d.ts.map +1 -0
  99. package/dist/routing/graph-federation.js +210 -0
  100. package/dist/routing/graph-federation.js.map +1 -0
  101. package/dist/routing/graph-loader.d.ts +74 -0
  102. package/dist/routing/graph-loader.d.ts.map +1 -0
  103. package/dist/routing/graph-loader.js +383 -0
  104. package/dist/routing/graph-loader.js.map +1 -0
  105. package/dist/routing/graph-router.d.ts +103 -0
  106. package/dist/routing/graph-router.d.ts.map +1 -0
  107. package/dist/routing/graph-router.js +415 -0
  108. package/dist/routing/graph-router.js.map +1 -0
  109. package/dist/routing/graph-validator.d.ts +44 -0
  110. package/dist/routing/graph-validator.d.ts.map +1 -0
  111. package/dist/routing/graph-validator.js +329 -0
  112. package/dist/routing/graph-validator.js.map +1 -0
  113. package/dist/routing/index.d.ts +52 -0
  114. package/dist/routing/index.d.ts.map +1 -0
  115. package/dist/routing/index.js +68 -0
  116. package/dist/routing/index.js.map +1 -0
  117. package/dist/routing/outcome-recorder.d.ts +71 -0
  118. package/dist/routing/outcome-recorder.d.ts.map +1 -0
  119. package/dist/routing/outcome-recorder.js +133 -0
  120. package/dist/routing/outcome-recorder.js.map +1 -0
  121. package/dist/routing/weight-adjuster.d.ts +59 -0
  122. package/dist/routing/weight-adjuster.d.ts.map +1 -0
  123. package/dist/routing/weight-adjuster.js +167 -0
  124. package/dist/routing/weight-adjuster.js.map +1 -0
  125. package/dist/routing/weighted-resolver.d.ts +55 -0
  126. package/dist/routing/weighted-resolver.d.ts.map +1 -0
  127. package/dist/routing/weighted-resolver.js +133 -0
  128. package/dist/routing/weighted-resolver.js.map +1 -0
  129. package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
  130. package/dist/synthesis/ask-artifact-writer.js +8 -0
  131. package/dist/synthesis/ask-artifact-writer.js.map +1 -1
  132. package/dist/synthesis/simulation-artifact-generator.d.ts +14 -0
  133. package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
  134. package/dist/synthesis/simulation-artifact-generator.js +224 -1
  135. package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
  136. package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
  137. package/dist/synthesis/simulation-renderers.js +211 -40
  138. package/dist/synthesis/simulation-renderers.js.map +1 -1
  139. package/package.json +1 -1
  140. package/dist/bundled-agents/connector-hub-agents/package-lock.json +0 -11697
  141. package/dist/bundled-agents/connector-hub-agents/package.json +0 -75
  142. package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +0 -22
  143. package/dist/bundled-agents/connector-hub-agents/tsconfig.json +0 -57
  144. package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +0 -17
  145. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +0 -14
  146. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +0 -35
  147. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +0 -1
  148. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +0 -55
  149. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +0 -40
  150. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +0 -1
  151. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +0 -22
  152. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +0 -38
  153. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +0 -1
  154. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +0 -34
  155. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +0 -186
  156. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +0 -1
  157. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +0 -36
  158. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +0 -121
  159. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +0 -1
  160. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  161. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +0 -948
  162. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +0 -1
  163. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +0 -9
  164. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +0 -27
  165. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +0 -1
  166. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  167. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +0 -50
  168. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  169. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +0 -214
  170. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +0 -91
  171. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +0 -1
  172. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +0 -1166
  173. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +0 -308
  174. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +0 -1
  175. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +0 -59
  176. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +0 -62
  177. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +0 -1
  178. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +0 -400
  179. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +0 -113
  180. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +0 -1
  181. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +0 -250
  182. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +0 -169
  183. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +0 -1
  184. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +0 -17
  185. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +0 -97
  186. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +0 -1
  187. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  188. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +0 -246
  189. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +0 -1
  190. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1085
  191. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +0 -218
  192. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  193. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -949
  194. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +0 -253
  195. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  196. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -657
  197. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +0 -205
  198. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  199. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +0 -285
  200. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +0 -106
  201. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +0 -1
  202. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +0 -581
  203. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +0 -136
  204. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +0 -1
  205. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +0 -791
  206. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +0 -225
  207. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +0 -1
  208. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +0 -120
  209. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +0 -535
  210. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +0 -1
  211. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +0 -9
  212. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +0 -18
  213. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +0 -1
  214. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +0 -4
  215. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +0 -9
  216. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +0 -1
  217. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  218. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  219. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  220. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +0 -10
  221. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +0 -25
  222. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +0 -1
  223. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  224. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  225. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  226. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  227. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +0 -25
  228. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +0 -1
  229. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +0 -6
  230. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +0 -15
  231. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +0 -1
  232. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  233. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  234. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  235. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  236. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  237. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  238. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  239. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +0 -192
  240. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +0 -1
  241. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +0 -11
  242. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +0 -25
  243. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +0 -1
  244. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +0 -127
  245. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +0 -483
  246. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +0 -1
  247. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +0 -49
  248. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +0 -125
  249. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +0 -1
  250. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +0 -73
  251. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +0 -192
  252. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +0 -1
  253. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +0 -11
  254. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +0 -27
  255. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +0 -1
  256. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +0 -122
  257. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +0 -645
  258. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +0 -1
  259. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  260. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +0 -156
  261. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +0 -1
  262. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +0 -88
  263. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +0 -246
  264. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +0 -1
  265. package/dist/bundled-agents/copilot-agents/functions/index.js +0 -4
  266. package/dist/bundled-agents/copilot-agents/functions/jest.config.js +0 -29
  267. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +0 -14
  268. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +0 -35
  269. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +0 -1
  270. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +0 -27
  271. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +0 -21
  272. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +0 -1
  273. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +0 -22
  274. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +0 -38
  275. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +0 -1
  276. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +0 -34
  277. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +0 -174
  278. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +0 -1
  279. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +0 -27
  280. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +0 -107
  281. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +0 -1
  282. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  283. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +0 -941
  284. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +0 -1
  285. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +0 -9
  286. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +0 -27
  287. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +0 -1
  288. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  289. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +0 -50
  290. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  291. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +0 -185
  292. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +0 -86
  293. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +0 -1
  294. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +0 -1081
  295. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +0 -305
  296. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +0 -1
  297. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +0 -59
  298. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +0 -62
  299. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +0 -1
  300. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +0 -315
  301. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +0 -110
  302. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +0 -1
  303. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +0 -250
  304. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +0 -169
  305. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +0 -1
  306. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +0 -16
  307. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +0 -88
  308. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +0 -1
  309. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  310. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +0 -246
  311. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +0 -1
  312. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1000
  313. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +0 -215
  314. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  315. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -864
  316. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +0 -250
  317. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  318. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -572
  319. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +0 -202
  320. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  321. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +0 -496
  322. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +0 -133
  323. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +0 -1
  324. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +0 -706
  325. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +0 -222
  326. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +0 -1
  327. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +0 -107
  328. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +0 -360
  329. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +0 -1
  330. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +0 -9
  331. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +0 -18
  332. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +0 -1
  333. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +0 -4
  334. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +0 -9
  335. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +0 -1
  336. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  337. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  338. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  339. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +0 -10
  340. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +0 -25
  341. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +0 -1
  342. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  343. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  344. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  345. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  346. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +0 -25
  347. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +0 -1
  348. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +0 -6
  349. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +0 -15
  350. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +0 -1
  351. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  352. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  353. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  354. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  355. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  356. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  357. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  358. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +0 -192
  359. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +0 -1
  360. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +0 -11
  361. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +0 -25
  362. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +0 -1
  363. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +0 -119
  364. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +0 -421
  365. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +0 -1
  366. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +0 -49
  367. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +0 -125
  368. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +0 -1
  369. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +0 -73
  370. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +0 -192
  371. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +0 -1
  372. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +0 -11
  373. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +0 -27
  374. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +0 -1
  375. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +0 -122
  376. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +0 -645
  377. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +0 -1
  378. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  379. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +0 -156
  380. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +0 -1
  381. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +0 -88
  382. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +0 -246
  383. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +0 -1
  384. package/dist/bundled-agents/copilot-agents/functions/package-lock.json +0 -5473
  385. package/dist/bundled-agents/copilot-agents/functions/package.json +0 -40
  386. package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +0 -71
  387. package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +0 -36
  388. package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +0 -77
  389. package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +0 -340
  390. package/dist/bundled-agents/copilot-agents/functions/src/health.ts +0 -53
  391. package/dist/bundled-agents/copilot-agents/functions/src/index.ts +0 -201
  392. package/dist/bundled-agents/copilot-agents/functions/src/router.ts +0 -148
  393. package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +0 -31
  394. package/dist/bundled-agents/copilot-agents/package-lock.json +0 -11825
  395. package/dist/bundled-agents/copilot-agents/package.json +0 -5
  396. package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +0 -8282
  397. package/dist/bundled-agents/governance-dashboard-agents/package.json +0 -13
  398. package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +0 -590
  399. package/dist/bundled-agents/orchestrator-agents/functions/index.js +0 -442
  400. package/dist/bundled-agents/orchestrator-agents/functions/test.js +0 -325
  401. package/dist/bundled-agents/orchestrator-agents/index.js +0 -6
  402. package/dist/bundled-agents/orchestrator-agents/package-lock.json +0 -13254
  403. package/dist/bundled-agents/orchestrator-agents/package.json +0 -20
  404. package/dist/bundled-agents/platform-agents/package-lock.json +0 -1723
  405. package/dist/bundled-agents/platform-agents/package.json +0 -22
  406. package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +0 -463
  407. package/dist/bundled-agents/platform-agents/src/agents/decision.ts +0 -234
  408. package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +0 -229
  409. package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +0 -327
  410. package/dist/bundled-agents/platform-agents/src/claude.ts +0 -71
  411. package/dist/bundled-agents/platform-agents/src/cors.ts +0 -24
  412. package/dist/bundled-agents/platform-agents/src/envelope.ts +0 -37
  413. package/dist/bundled-agents/platform-agents/src/health.ts +0 -20
  414. package/dist/bundled-agents/platform-agents/src/index.ts +0 -171
  415. package/dist/bundled-agents/platform-agents/src/router.ts +0 -38
  416. package/dist/bundled-agents/platform-agents/src/text-analysis.ts +0 -238
  417. package/dist/bundled-agents/platform-agents/tsconfig.json +0 -19
  418. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +0 -3
  419. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +0 -1
  420. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +0 -43
  421. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +0 -1
  422. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +0 -3
  423. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +0 -1
  424. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +0 -30
  425. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +0 -1
  426. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +0 -3
  427. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +0 -1
  428. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +0 -53
  429. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +0 -1
  430. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +0 -3
  431. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +0 -1
  432. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +0 -51
  433. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +0 -1
  434. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +0 -3
  435. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +0 -1
  436. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +0 -36
  437. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +0 -1
  438. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +0 -2
  439. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +0 -1
  440. package/dist/bundled-agents/sentinel-agents/lib/index.js +0 -70
  441. package/dist/bundled-agents/sentinel-agents/lib/index.js.map +0 -1
  442. package/dist/bundled-agents/sentinel-agents/package-lock.json +0 -12591
  443. package/dist/bundled-agents/sentinel-agents/package.json +0 -62
  444. package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +0 -46
  445. package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +0 -33
  446. package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +0 -56
  447. package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +0 -54
  448. package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +0 -38
  449. package/dist/bundled-agents/sentinel-agents/src/claude.ts +0 -71
  450. package/dist/bundled-agents/sentinel-agents/src/index.ts +0 -77
  451. package/dist/bundled-agents/sentinel-agents/tsconfig.json +0 -20
@@ -0,0 +1,329 @@
1
+ /**
2
+ * Graph Validator (ADR-031 Phase 5)
3
+ *
4
+ * Tiered validation engine for the ecosystem capability graph.
5
+ *
6
+ * Tier 1 (Offline): Schema, uniqueness, weights, compositions, cycles
7
+ * Tier 2 (Online): Repository existence, agent name consistency (requires API)
8
+ * Tier 3 (Telemetry): Orphan detection (requires outcome data)
9
+ */
10
+ import * as fs from 'node:fs';
11
+ import * as path from 'node:path';
12
+ import { loadEcosystemGraph, resolveGraphPath } from './graph-loader.js';
13
+ import { isWeightedAgent } from './weighted-resolver.js';
14
+ import { validateCompositionRules, detectCompositionCycles } from './composition-engine.js';
15
+ import { loadOutcomes } from './outcome-recorder.js';
16
+ // ============================================================================
17
+ // Tier 1: Offline Validation
18
+ // ============================================================================
19
+ /**
20
+ * Run Tier 1 offline validation rules.
21
+ * No network required. Validates structural correctness.
22
+ */
23
+ export function validateTier1(graphPath) {
24
+ const resolvedPath = graphPath ?? resolveGraphPath();
25
+ const results = [];
26
+ // Rule 1: Schema validation (load will throw on invalid schema)
27
+ let graph = null;
28
+ try {
29
+ graph = loadEcosystemGraph({ graphPath: resolvedPath, forceReload: true });
30
+ results.push({
31
+ rule: 'Schema validation',
32
+ severity: 'error',
33
+ passed: true,
34
+ message: `${graph.capabilities.length} capabilities valid`,
35
+ });
36
+ }
37
+ catch (err) {
38
+ results.push({
39
+ rule: 'Schema validation',
40
+ severity: 'error',
41
+ passed: false,
42
+ message: err.message,
43
+ });
44
+ return buildReport('offline', results);
45
+ }
46
+ // Rule 2: Unique capability names (already checked by loader, but explicit)
47
+ const capNames = graph.capabilities.map(c => c.name);
48
+ const uniqueNames = new Set(capNames);
49
+ results.push({
50
+ rule: 'Unique capability names',
51
+ severity: 'error',
52
+ passed: capNames.length === uniqueNames.size,
53
+ message: capNames.length === uniqueNames.size
54
+ ? 'no duplicates'
55
+ : `${capNames.length - uniqueNames.size} duplicate(s) found`,
56
+ });
57
+ // Rule 3: Non-empty agents
58
+ const emptyAgents = graph.capabilities.filter(c => c.agents.length === 0);
59
+ results.push({
60
+ rule: 'Non-empty agents',
61
+ severity: 'error',
62
+ passed: emptyAgents.length === 0,
63
+ message: emptyAgents.length === 0
64
+ ? 'all capabilities have agents'
65
+ : `${emptyAgents.length} capability(s) missing agents: ${emptyAgents.map(c => c.name).join(', ')}`,
66
+ });
67
+ // Rule 4: Non-empty repos
68
+ const emptyRepos = graph.capabilities.filter(c => c.repos.length === 0);
69
+ results.push({
70
+ rule: 'Non-empty repos',
71
+ severity: 'error',
72
+ passed: emptyRepos.length === 0,
73
+ message: emptyRepos.length === 0
74
+ ? 'all capabilities have repos'
75
+ : `${emptyRepos.length} capability(s) missing repos: ${emptyRepos.map(c => c.name).join(', ')}`,
76
+ });
77
+ // Rule 5: Valid stage references
78
+ const stageSet = new Set(graph.stages);
79
+ const invalidStages = graph.capabilities.filter(c => c.stage && !stageSet.has(c.stage));
80
+ results.push({
81
+ rule: 'Valid stage references',
82
+ severity: 'error',
83
+ passed: invalidStages.length === 0,
84
+ message: invalidStages.length === 0
85
+ ? 'all stages exist'
86
+ : `invalid stages in: ${invalidStages.map(c => `${c.name}(${c.stage})`).join(', ')}`,
87
+ });
88
+ // Rule 6: No circular dependencies (already checked by loader)
89
+ results.push({
90
+ rule: 'No circular dependencies',
91
+ severity: 'error',
92
+ passed: true,
93
+ message: 'topological sort succeeded',
94
+ });
95
+ // Rule 9: Weight bounds
96
+ const weightErrors = [];
97
+ for (const cap of graph.capabilities) {
98
+ for (const agent of cap.agents) {
99
+ if (isWeightedAgent(agent)) {
100
+ if (agent.weight < 0 || agent.weight > 1) {
101
+ weightErrors.push(`${cap.name}/${agent.name}: weight ${agent.weight}`);
102
+ }
103
+ }
104
+ }
105
+ }
106
+ results.push({
107
+ rule: 'Weight bounds',
108
+ severity: 'error',
109
+ passed: weightErrors.length === 0,
110
+ message: weightErrors.length === 0
111
+ ? 'all weights in [0.0, 1.0]'
112
+ : `${weightErrors.length} weight(s) out of range`,
113
+ details: weightErrors.length > 0 ? weightErrors : undefined,
114
+ });
115
+ // Rules 10-11: Composition validation
116
+ const compositions = loadCompositionsFromGraph(resolvedPath);
117
+ if (compositions.length > 0) {
118
+ const validCaps = new Set(capNames);
119
+ const compErrors = validateCompositionRules(compositions, validCaps);
120
+ results.push({
121
+ rule: 'Composition rule validity',
122
+ severity: 'error',
123
+ passed: compErrors.length === 0,
124
+ message: compErrors.length === 0
125
+ ? 'all referenced capabilities exist'
126
+ : `${compErrors.length} error(s)`,
127
+ details: compErrors.length > 0 ? compErrors : undefined,
128
+ });
129
+ const cycles = detectCompositionCycles(compositions);
130
+ results.push({
131
+ rule: 'Composition cycle detection',
132
+ severity: 'error',
133
+ passed: !cycles.hasCycle,
134
+ message: cycles.hasCycle
135
+ ? `cycle detected among: ${cycles.cycleNodes.join(', ')}`
136
+ : 'no cycles',
137
+ });
138
+ }
139
+ else {
140
+ results.push({
141
+ rule: 'Composition rule validity',
142
+ severity: 'error',
143
+ passed: true,
144
+ message: 'no composition rules defined',
145
+ });
146
+ results.push({
147
+ rule: 'Composition cycle detection',
148
+ severity: 'error',
149
+ passed: true,
150
+ message: 'no composition rules defined',
151
+ });
152
+ }
153
+ // Rule 12: Fragment owner field (only relevant for federated graphs)
154
+ const fragmentsDir = getFragmentsDir(resolvedPath);
155
+ if (fragmentsDir && fs.existsSync(fragmentsDir)) {
156
+ const missingOwners = checkFragmentOwners(fragmentsDir);
157
+ results.push({
158
+ rule: 'Fragment owner field',
159
+ severity: 'warning',
160
+ passed: missingOwners.length === 0,
161
+ message: missingOwners.length === 0
162
+ ? 'all fragments have owners'
163
+ : `${missingOwners.length} fragments missing owner`,
164
+ details: missingOwners.length > 0 ? missingOwners : undefined,
165
+ });
166
+ }
167
+ return buildReport('offline', results);
168
+ }
169
+ // ============================================================================
170
+ // Tier 3: Telemetry Validation
171
+ // ============================================================================
172
+ /**
173
+ * Run Tier 3 telemetry validation rules.
174
+ * Requires outcome data from Phase 2.
175
+ */
176
+ export function validateTier3(graphPath, options) {
177
+ const resolvedPath = graphPath ?? resolveGraphPath();
178
+ const results = [];
179
+ let graph;
180
+ try {
181
+ graph = loadEcosystemGraph({ graphPath: resolvedPath, forceReload: true });
182
+ }
183
+ catch (err) {
184
+ results.push({
185
+ rule: 'Graph load',
186
+ severity: 'error',
187
+ passed: false,
188
+ message: err.message,
189
+ });
190
+ return buildReport('telemetry', results);
191
+ }
192
+ // Rule 13: Orphan detection
193
+ const outcomes = loadOutcomes({ basePath: options?.basePath });
194
+ const orphanDays = options?.orphanDays ?? 30;
195
+ const cutoff = new Date(Date.now() - orphanDays * 24 * 60 * 60 * 1000).toISOString();
196
+ const recentOutcomes = outcomes.filter(o => o.timestamp >= cutoff);
197
+ const usedCapabilities = new Set();
198
+ for (const o of recentOutcomes) {
199
+ for (const cap of o.capabilities_used) {
200
+ usedCapabilities.add(cap);
201
+ }
202
+ }
203
+ // Find capabilities with no inbound depends_on and no recent usage
204
+ const referencedCaps = new Set();
205
+ for (const cap of graph.capabilities) {
206
+ if (cap.depends_on) {
207
+ for (const dep of cap.depends_on) {
208
+ referencedCaps.add(dep);
209
+ }
210
+ }
211
+ }
212
+ const orphans = graph.capabilities
213
+ .filter(c => !referencedCaps.has(c.name) && !usedCapabilities.has(c.name))
214
+ .map(c => c.name);
215
+ if (recentOutcomes.length > 0) {
216
+ results.push({
217
+ rule: 'Orphan detection',
218
+ severity: 'warning',
219
+ passed: orphans.length === 0,
220
+ message: orphans.length === 0
221
+ ? `all capabilities used or referenced in last ${orphanDays} days`
222
+ : `${orphans.length} orphan(s) detected (no usage or references in ${orphanDays} days)`,
223
+ details: orphans.length > 0 ? orphans : undefined,
224
+ });
225
+ }
226
+ else {
227
+ results.push({
228
+ rule: 'Orphan detection',
229
+ severity: 'info',
230
+ passed: true,
231
+ message: 'no telemetry data available — skipping orphan detection',
232
+ });
233
+ }
234
+ return buildReport('telemetry', results);
235
+ }
236
+ // ============================================================================
237
+ // Report Building
238
+ // ============================================================================
239
+ function buildReport(tier, results) {
240
+ return {
241
+ tier,
242
+ results,
243
+ passed: results.filter(r => r.passed).length,
244
+ failed: results.filter(r => !r.passed && r.severity === 'error').length,
245
+ warnings: results.filter(r => !r.passed && r.severity === 'warning').length,
246
+ timestamp: new Date().toISOString(),
247
+ };
248
+ }
249
+ /**
250
+ * Format a validation report as human-readable output.
251
+ */
252
+ export function formatValidationReport(report) {
253
+ const tierLabel = report.tier === 'offline'
254
+ ? 'Tier 1: Offline'
255
+ : report.tier === 'online'
256
+ ? 'Tier 2: Online'
257
+ : 'Tier 3: Telemetry';
258
+ const lines = [
259
+ `Capability Graph Validation (${tierLabel})`,
260
+ '='.repeat(50),
261
+ '',
262
+ ];
263
+ for (const result of report.results) {
264
+ const icon = result.passed
265
+ ? '[PASS]'
266
+ : result.severity === 'warning'
267
+ ? '[WARN]'
268
+ : result.severity === 'info'
269
+ ? '[INFO]'
270
+ : '[FAIL]';
271
+ lines.push(`${icon} ${result.rule}: ${result.message}`);
272
+ if (result.details && result.details.length > 0) {
273
+ for (const detail of result.details) {
274
+ lines.push(` - ${detail}`);
275
+ }
276
+ }
277
+ }
278
+ lines.push('');
279
+ lines.push(`Result: ${report.passed} passed, ${report.failed} failed, ${report.warnings} warning(s)`);
280
+ return lines.join('\n');
281
+ }
282
+ // ============================================================================
283
+ // Helpers
284
+ // ============================================================================
285
+ function loadCompositionsFromGraph(graphPath) {
286
+ try {
287
+ const raw = fs.readFileSync(graphPath, 'utf-8');
288
+ const data = JSON.parse(raw);
289
+ if (Array.isArray(data['compositions'])) {
290
+ return data['compositions'];
291
+ }
292
+ }
293
+ catch {
294
+ // Ignore
295
+ }
296
+ return [];
297
+ }
298
+ function getFragmentsDir(graphPath) {
299
+ try {
300
+ const raw = fs.readFileSync(graphPath, 'utf-8');
301
+ const data = JSON.parse(raw);
302
+ if (typeof data['fragments_dir'] === 'string') {
303
+ return path.resolve(path.dirname(graphPath), data['fragments_dir']);
304
+ }
305
+ }
306
+ catch {
307
+ // Ignore
308
+ }
309
+ return null;
310
+ }
311
+ function checkFragmentOwners(fragmentsDir) {
312
+ const missing = [];
313
+ try {
314
+ const files = fs.readdirSync(fragmentsDir).filter(f => f.endsWith('.graph.json'));
315
+ for (const file of files) {
316
+ const filePath = path.join(fragmentsDir, file);
317
+ const raw = fs.readFileSync(filePath, 'utf-8');
318
+ const data = JSON.parse(raw);
319
+ if (!data['owner'] || (typeof data['owner'] === 'string' && data['owner'].length === 0)) {
320
+ missing.push(file);
321
+ }
322
+ }
323
+ }
324
+ catch {
325
+ // Best effort
326
+ }
327
+ return missing;
328
+ }
329
+ //# sourceMappingURL=graph-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-validator.js","sourceRoot":"","sources":["../../src/routing/graph-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,wBAA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jB,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Ecosystem Capability Graph Routing (ADR-030 + ADR-031)
3
+ *
4
+ * Barrel export for the routing subsystem.
5
+ *
6
+ * Usage:
7
+ * import { routeQuery } from '../routing/index.js';
8
+ * const result = routeQuery(userPrompt);
9
+ */
10
+ export { loadEcosystemGraph, clearGraphCache, resolveGraphPath, getCapabilityByName, getCapabilitiesByTag, getCapabilitiesByStage, resolveDependencies, } from './graph-loader.js';
11
+ export type { EcosystemGraph, CapabilityEntry, StageName, GraphValidationError, } from './graph-loader.js';
12
+ export { classifyCapabilities, extractCapabilityNames, } from './capability-classifier.js';
13
+ export type { ClassifiedCapability, ClassificationResult, } from './capability-classifier.js';
14
+ export { routeCapabilities, resolveAgentRef, toDomainAgentList, } from './graph-router.js';
15
+ export type { RoutedAgent, StageGroup, RoutingResult, AgentBudget, DomainAgentRef, } from './graph-router.js';
16
+ export { normalizeAgent, normalizeAgents, getAgentName, selectWeightedAgents, validateAgentInput, isWeightedAgent, } from './weighted-resolver.js';
17
+ export type { WeightedAgent, AgentInput, AgentRole, WeightedSelectionOptions, } from './weighted-resolver.js';
18
+ export { recordOutcome, buildOutcomeRecord, loadOutcomes, loadRecentOutcomes, rotateOutcomes, getOutcomesFilePath, } from './outcome-recorder.js';
19
+ export type { OutcomeRecord, OutcomeStatus, AgentContribution, } from './outcome-recorder.js';
20
+ export { calculateAdjustedWeights, writeWeightOverlay, loadWeightOverlay, applyWeightOverlay, formatAdjustmentReport, } from './weight-adjuster.js';
21
+ export type { WeightOverlay, WeightAdjustment, } from './weight-adjuster.js';
22
+ export { applyCompositions, validateCompositionRules, detectCompositionCycles, formatCompositionExplanation, } from './composition-engine.js';
23
+ export type { CompositionRule, CompositionOperator, CompositionPriority, CompositionResult, CompositionOptions, FiredRule, } from './composition-engine.js';
24
+ export { isFederatedGraph, loadFragments, federateGraph, fragmentToCapabilityEntry, } from './graph-federation.js';
25
+ export type { CapabilityFragment, FederatedRootGraph, FragmentOverride, FederationResult, } from './graph-federation.js';
26
+ export { validateTier1, validateTier3, formatValidationReport, } from './graph-validator.js';
27
+ export type { ValidationTier, ValidationSeverity, ValidationResult, ValidationReport, } from './graph-validator.js';
28
+ import type { RoutingResult, DomainAgentRef } from './graph-router.js';
29
+ export interface RouteQueryResult {
30
+ /** Full routing result with classification, pipeline, and explanation. */
31
+ readonly routing: RoutingResult;
32
+ /** Flat list of domain/agent refs ready for dispatch. */
33
+ readonly agents: readonly DomainAgentRef[];
34
+ /** Whether any capabilities were matched. If false, caller should fall back. */
35
+ readonly matched: boolean;
36
+ }
37
+ /**
38
+ * Route a natural language query through the ecosystem capability graph.
39
+ *
40
+ * This is the primary entry point for graph-based routing. It:
41
+ * 1. Loads the graph (cached after first load)
42
+ * 2. Classifies the prompt into capabilities
43
+ * 3. Applies composition rules (ADR-031 Phase 3)
44
+ * 4. Resolves dependencies
45
+ * 5. Builds a stage-ordered agent pipeline with weighted selection (ADR-031 Phase 1)
46
+ * 6. Returns domain/agent refs for dispatch
47
+ *
48
+ * If no capabilities match, returns { matched: false } so the caller
49
+ * can fall back to full-fleet dispatch.
50
+ */
51
+ export declare function routeQuery(prompt: string, graphPath?: string): RouteQueryResult;
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,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YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAW/E"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Ecosystem Capability Graph Routing (ADR-030 + ADR-031)
3
+ *
4
+ * Barrel export for the routing subsystem.
5
+ *
6
+ * Usage:
7
+ * import { routeQuery } from '../routing/index.js';
8
+ * const result = routeQuery(userPrompt);
9
+ */
10
+ // ============================================================================
11
+ // ADR-030: Core Graph Routing
12
+ // ============================================================================
13
+ export { loadEcosystemGraph, clearGraphCache, resolveGraphPath, getCapabilityByName, getCapabilitiesByTag, getCapabilitiesByStage, resolveDependencies, } from './graph-loader.js';
14
+ export { classifyCapabilities, extractCapabilityNames, } from './capability-classifier.js';
15
+ export { routeCapabilities, resolveAgentRef, toDomainAgentList, } from './graph-router.js';
16
+ // ============================================================================
17
+ // ADR-031 Phase 1: Weighted Edges
18
+ // ============================================================================
19
+ export { normalizeAgent, normalizeAgents, getAgentName, selectWeightedAgents, validateAgentInput, isWeightedAgent, } from './weighted-resolver.js';
20
+ // ============================================================================
21
+ // ADR-031 Phase 2: Telemetry Feedback
22
+ // ============================================================================
23
+ export { recordOutcome, buildOutcomeRecord, loadOutcomes, loadRecentOutcomes, rotateOutcomes, getOutcomesFilePath, } from './outcome-recorder.js';
24
+ export { calculateAdjustedWeights, writeWeightOverlay, loadWeightOverlay, applyWeightOverlay, formatAdjustmentReport, } from './weight-adjuster.js';
25
+ // ============================================================================
26
+ // ADR-031 Phase 3: Composition Rules
27
+ // ============================================================================
28
+ export { applyCompositions, validateCompositionRules, detectCompositionCycles, formatCompositionExplanation, } from './composition-engine.js';
29
+ // ============================================================================
30
+ // ADR-031 Phase 4: Multi-Graph Federation
31
+ // ============================================================================
32
+ export { isFederatedGraph, loadFragments, federateGraph, fragmentToCapabilityEntry, } from './graph-federation.js';
33
+ // ============================================================================
34
+ // ADR-031 Phase 5: CI Validation
35
+ // ============================================================================
36
+ export { validateTier1, validateTier3, formatValidationReport, } from './graph-validator.js';
37
+ // ============================================================================
38
+ // Convenience: one-call routing
39
+ // ============================================================================
40
+ import { loadEcosystemGraph } from './graph-loader.js';
41
+ import { classifyCapabilities } from './capability-classifier.js';
42
+ import { routeCapabilities, toDomainAgentList } from './graph-router.js';
43
+ /**
44
+ * Route a natural language query through the ecosystem capability graph.
45
+ *
46
+ * This is the primary entry point for graph-based routing. It:
47
+ * 1. Loads the graph (cached after first load)
48
+ * 2. Classifies the prompt into capabilities
49
+ * 3. Applies composition rules (ADR-031 Phase 3)
50
+ * 4. Resolves dependencies
51
+ * 5. Builds a stage-ordered agent pipeline with weighted selection (ADR-031 Phase 1)
52
+ * 6. Returns domain/agent refs for dispatch
53
+ *
54
+ * If no capabilities match, returns { matched: false } so the caller
55
+ * can fall back to full-fleet dispatch.
56
+ */
57
+ export function routeQuery(prompt, graphPath) {
58
+ const graph = loadEcosystemGraph({ graphPath });
59
+ const classification = classifyCapabilities(prompt, graph);
60
+ const routing = routeCapabilities(classification, graph);
61
+ const agents = toDomainAgentList(routing);
62
+ return {
63
+ routing,
64
+ agents,
65
+ matched: routing.totalAgents > 0,
66
+ };
67
+ }
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routing/index.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,+EAA+E;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAYzE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,SAAkB;IAC3D,MAAM,KAAK,GAAG,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,iBAAiB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE1C,OAAO;QACL,OAAO;QACP,MAAM;QACN,OAAO,EAAE,OAAO,CAAC,WAAW,GAAG,CAAC;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Outcome Recorder (ADR-031 Phase 2)
3
+ *
4
+ * Records execution outcomes to a local JSONL file for telemetry feedback.
5
+ * Outcomes are used by the weight adjuster to improve routing precision.
6
+ *
7
+ * Storage: .agentics/telemetry/outcomes.jsonl (append-only)
8
+ * Format: One JSON object per line (JSONL)
9
+ */
10
+ export interface AgentContribution {
11
+ readonly produced_output: boolean;
12
+ readonly output_used: boolean;
13
+ }
14
+ export type OutcomeStatus = 'success' | 'failure' | 'partial' | 'timeout';
15
+ export interface OutcomeRecord {
16
+ readonly timestamp: string;
17
+ readonly prompt_hash: string;
18
+ readonly capabilities_used: readonly string[];
19
+ readonly agents_selected: readonly string[];
20
+ readonly outcome: OutcomeStatus;
21
+ readonly user_rating: number | null;
22
+ readonly execution_time_ms: number;
23
+ readonly agent_contributions: Readonly<Record<string, AgentContribution>>;
24
+ }
25
+ /**
26
+ * Record an execution outcome to the telemetry JSONL file.
27
+ * Creates the telemetry directory if it doesn't exist.
28
+ */
29
+ export declare function recordOutcome(record: OutcomeRecord, options?: {
30
+ basePath?: string;
31
+ }): void;
32
+ /**
33
+ * Build an outcome record from execution data.
34
+ */
35
+ export declare function buildOutcomeRecord(params: {
36
+ prompt: string;
37
+ capabilities: readonly string[];
38
+ agents: readonly string[];
39
+ outcome: OutcomeStatus;
40
+ executionTimeMs: number;
41
+ userRating?: number | null;
42
+ contributions?: Record<string, AgentContribution>;
43
+ }): OutcomeRecord;
44
+ /**
45
+ * Load all outcome records from the telemetry file.
46
+ * Returns empty array if file doesn't exist.
47
+ */
48
+ export declare function loadOutcomes(options?: {
49
+ basePath?: string;
50
+ }): OutcomeRecord[];
51
+ /**
52
+ * Load the most recent N outcome records.
53
+ */
54
+ export declare function loadRecentOutcomes(count: number, options?: {
55
+ basePath?: string;
56
+ }): OutcomeRecord[];
57
+ /**
58
+ * Rotate the outcomes file, keeping only the most recent records.
59
+ * This prevents unbounded file growth.
60
+ */
61
+ export declare function rotateOutcomes(maxRecords?: number, options?: {
62
+ basePath?: string;
63
+ }): {
64
+ kept: number;
65
+ removed: number;
66
+ };
67
+ /**
68
+ * Get the path to the outcomes file.
69
+ */
70
+ export declare function getOutcomesFilePath(basePath?: string): string;
71
+ //# sourceMappingURL=outcome-recorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome-recorder.d.ts","sourceRoot":"","sources":["../../src/routing/outcome-recorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW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