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

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 (452) 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 +3 -1
  140. package/scripts/postinstall.sh +25 -0
  141. package/dist/bundled-agents/connector-hub-agents/package-lock.json +0 -11697
  142. package/dist/bundled-agents/connector-hub-agents/package.json +0 -75
  143. package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +0 -22
  144. package/dist/bundled-agents/connector-hub-agents/tsconfig.json +0 -57
  145. package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +0 -17
  146. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +0 -14
  147. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +0 -35
  148. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +0 -1
  149. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +0 -55
  150. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +0 -40
  151. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +0 -1
  152. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +0 -22
  153. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +0 -38
  154. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +0 -1
  155. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +0 -34
  156. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +0 -186
  157. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +0 -1
  158. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +0 -36
  159. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +0 -121
  160. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +0 -1
  161. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  162. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +0 -948
  163. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +0 -1
  164. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +0 -9
  165. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +0 -27
  166. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +0 -1
  167. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  168. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +0 -50
  169. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  170. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +0 -214
  171. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +0 -91
  172. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +0 -1
  173. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +0 -1166
  174. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +0 -308
  175. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +0 -1
  176. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +0 -59
  177. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +0 -62
  178. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +0 -1
  179. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +0 -400
  180. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +0 -113
  181. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +0 -1
  182. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +0 -250
  183. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +0 -169
  184. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +0 -1
  185. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +0 -17
  186. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +0 -97
  187. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +0 -1
  188. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  189. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +0 -246
  190. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +0 -1
  191. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1085
  192. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +0 -218
  193. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  194. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -949
  195. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +0 -253
  196. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  197. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -657
  198. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +0 -205
  199. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  200. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +0 -285
  201. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +0 -106
  202. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +0 -1
  203. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +0 -581
  204. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +0 -136
  205. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +0 -1
  206. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +0 -791
  207. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +0 -225
  208. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +0 -1
  209. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +0 -120
  210. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +0 -535
  211. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +0 -1
  212. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +0 -9
  213. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +0 -18
  214. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +0 -1
  215. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +0 -4
  216. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +0 -9
  217. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +0 -1
  218. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  219. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  220. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  221. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +0 -10
  222. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +0 -25
  223. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +0 -1
  224. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  225. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  226. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  227. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  228. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +0 -25
  229. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +0 -1
  230. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +0 -6
  231. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +0 -15
  232. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +0 -1
  233. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  234. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  235. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  236. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  237. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  238. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  239. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  240. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +0 -192
  241. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +0 -1
  242. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +0 -11
  243. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +0 -25
  244. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +0 -1
  245. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +0 -127
  246. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +0 -483
  247. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +0 -1
  248. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +0 -49
  249. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +0 -125
  250. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +0 -1
  251. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +0 -73
  252. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +0 -192
  253. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +0 -1
  254. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +0 -11
  255. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +0 -27
  256. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +0 -1
  257. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +0 -122
  258. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +0 -645
  259. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +0 -1
  260. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  261. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +0 -156
  262. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +0 -1
  263. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +0 -88
  264. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +0 -246
  265. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +0 -1
  266. package/dist/bundled-agents/copilot-agents/functions/index.js +0 -4
  267. package/dist/bundled-agents/copilot-agents/functions/jest.config.js +0 -29
  268. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +0 -14
  269. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +0 -35
  270. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +0 -1
  271. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +0 -27
  272. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +0 -21
  273. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +0 -1
  274. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +0 -22
  275. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +0 -38
  276. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +0 -1
  277. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +0 -34
  278. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +0 -174
  279. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +0 -1
  280. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +0 -27
  281. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +0 -107
  282. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +0 -1
  283. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  284. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +0 -941
  285. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +0 -1
  286. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +0 -9
  287. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +0 -27
  288. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +0 -1
  289. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  290. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +0 -50
  291. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  292. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +0 -185
  293. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +0 -86
  294. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +0 -1
  295. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +0 -1081
  296. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +0 -305
  297. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +0 -1
  298. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +0 -59
  299. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +0 -62
  300. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +0 -1
  301. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +0 -315
  302. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +0 -110
  303. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +0 -1
  304. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +0 -250
  305. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +0 -169
  306. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +0 -1
  307. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +0 -16
  308. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +0 -88
  309. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +0 -1
  310. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  311. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +0 -246
  312. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +0 -1
  313. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1000
  314. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +0 -215
  315. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  316. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -864
  317. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +0 -250
  318. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  319. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -572
  320. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +0 -202
  321. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  322. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +0 -496
  323. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +0 -133
  324. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +0 -1
  325. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +0 -706
  326. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +0 -222
  327. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +0 -1
  328. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +0 -107
  329. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +0 -360
  330. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +0 -1
  331. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +0 -9
  332. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +0 -18
  333. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +0 -1
  334. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +0 -4
  335. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +0 -9
  336. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +0 -1
  337. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  338. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  339. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  340. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +0 -10
  341. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +0 -25
  342. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +0 -1
  343. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  344. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  345. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  346. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  347. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +0 -25
  348. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +0 -1
  349. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +0 -6
  350. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +0 -15
  351. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +0 -1
  352. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  353. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  354. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  355. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  356. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  357. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  358. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  359. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +0 -192
  360. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +0 -1
  361. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +0 -11
  362. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +0 -25
  363. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +0 -1
  364. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +0 -119
  365. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +0 -421
  366. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +0 -1
  367. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +0 -49
  368. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +0 -125
  369. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +0 -1
  370. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +0 -73
  371. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +0 -192
  372. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +0 -1
  373. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +0 -11
  374. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +0 -27
  375. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +0 -1
  376. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +0 -122
  377. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +0 -645
  378. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +0 -1
  379. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  380. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +0 -156
  381. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +0 -1
  382. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +0 -88
  383. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +0 -246
  384. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +0 -1
  385. package/dist/bundled-agents/copilot-agents/functions/package-lock.json +0 -5473
  386. package/dist/bundled-agents/copilot-agents/functions/package.json +0 -40
  387. package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +0 -71
  388. package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +0 -36
  389. package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +0 -77
  390. package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +0 -340
  391. package/dist/bundled-agents/copilot-agents/functions/src/health.ts +0 -53
  392. package/dist/bundled-agents/copilot-agents/functions/src/index.ts +0 -201
  393. package/dist/bundled-agents/copilot-agents/functions/src/router.ts +0 -148
  394. package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +0 -31
  395. package/dist/bundled-agents/copilot-agents/package-lock.json +0 -11825
  396. package/dist/bundled-agents/copilot-agents/package.json +0 -5
  397. package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +0 -8282
  398. package/dist/bundled-agents/governance-dashboard-agents/package.json +0 -13
  399. package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +0 -590
  400. package/dist/bundled-agents/orchestrator-agents/functions/index.js +0 -442
  401. package/dist/bundled-agents/orchestrator-agents/functions/test.js +0 -325
  402. package/dist/bundled-agents/orchestrator-agents/index.js +0 -6
  403. package/dist/bundled-agents/orchestrator-agents/package-lock.json +0 -13254
  404. package/dist/bundled-agents/orchestrator-agents/package.json +0 -20
  405. package/dist/bundled-agents/platform-agents/package-lock.json +0 -1723
  406. package/dist/bundled-agents/platform-agents/package.json +0 -22
  407. package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +0 -463
  408. package/dist/bundled-agents/platform-agents/src/agents/decision.ts +0 -234
  409. package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +0 -229
  410. package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +0 -327
  411. package/dist/bundled-agents/platform-agents/src/claude.ts +0 -71
  412. package/dist/bundled-agents/platform-agents/src/cors.ts +0 -24
  413. package/dist/bundled-agents/platform-agents/src/envelope.ts +0 -37
  414. package/dist/bundled-agents/platform-agents/src/health.ts +0 -20
  415. package/dist/bundled-agents/platform-agents/src/index.ts +0 -171
  416. package/dist/bundled-agents/platform-agents/src/router.ts +0 -38
  417. package/dist/bundled-agents/platform-agents/src/text-analysis.ts +0 -238
  418. package/dist/bundled-agents/platform-agents/tsconfig.json +0 -19
  419. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +0 -3
  420. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +0 -1
  421. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +0 -43
  422. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +0 -1
  423. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +0 -3
  424. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +0 -1
  425. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +0 -30
  426. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +0 -1
  427. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +0 -3
  428. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +0 -1
  429. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +0 -53
  430. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +0 -1
  431. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +0 -3
  432. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +0 -1
  433. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +0 -51
  434. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +0 -1
  435. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +0 -3
  436. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +0 -1
  437. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +0 -36
  438. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +0 -1
  439. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +0 -2
  440. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +0 -1
  441. package/dist/bundled-agents/sentinel-agents/lib/index.js +0 -70
  442. package/dist/bundled-agents/sentinel-agents/lib/index.js.map +0 -1
  443. package/dist/bundled-agents/sentinel-agents/package-lock.json +0 -12591
  444. package/dist/bundled-agents/sentinel-agents/package.json +0 -62
  445. package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +0 -46
  446. package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +0 -33
  447. package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +0 -56
  448. package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +0 -54
  449. package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +0 -38
  450. package/dist/bundled-agents/sentinel-agents/src/claude.ts +0 -71
  451. package/dist/bundled-agents/sentinel-agents/src/index.ts +0 -77
  452. package/dist/bundled-agents/sentinel-agents/tsconfig.json +0 -20
@@ -1,645 +0,0 @@
1
- "use strict";
2
- /**
3
- * Reflection Agent
4
- *
5
- * Purpose: Analyze DecisionEvents to extract learning and quality signals
6
- * Classification: POST_EXECUTION_ANALYSIS, QUALITY_ASSESSMENT
7
- * decision_type: reflection_analysis
8
- *
9
- * Scope:
10
- * - Evaluate outcomes
11
- * - Identify gaps and inefficiencies
12
- * - Produce improvement insights
13
- *
14
- * CONSTITUTION COMPLIANCE:
15
- * ✓ Stateless at runtime
16
- * ✓ Emits exactly ONE DecisionEvent per invocation
17
- * ✓ Persists ONLY via ruvector-service
18
- * ✓ NEVER connects directly to databases
19
- * ✓ NEVER executes SQL
20
- * ✓ NEVER modifies runtime behavior
21
- * ✓ NEVER orchestrates other agents
22
- * ✓ NEVER enforces policy
23
- * ✓ NEVER intercepts execution paths
24
- *
25
- * Must Never:
26
- * - Modify behavior
27
- * - Trigger retries
28
- * - Apply optimizations
29
- */
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.ReflectionAgent = void 0;
32
- const uuid_1 = require("uuid");
33
- const contracts_1 = require("../contracts");
34
- const AGENT_ID = 'reflection-agent';
35
- const AGENT_VERSION = '1.0.0';
36
- const DECISION_TYPE = 'reflection_analysis';
37
- /**
38
- * Reflection Agent Implementation
39
- *
40
- * This agent analyzes DecisionEvents and produces quality/learning signals.
41
- * It is purely analytical - it NEVER modifies behavior, triggers retries, or applies optimizations.
42
- */
43
- class ReflectionAgent {
44
- metadata = {
45
- id: AGENT_ID,
46
- name: 'Reflection Agent',
47
- version: AGENT_VERSION,
48
- classifications: [
49
- contracts_1.AgentClassification.POST_EXECUTION_ANALYSIS,
50
- contracts_1.AgentClassification.QUALITY_ASSESSMENT,
51
- ],
52
- decision_type: DECISION_TYPE,
53
- description: 'Analyzes DecisionEvents to extract learning and quality signals for continuous improvement insights.',
54
- };
55
- persistence;
56
- telemetry;
57
- constructor(persistence, telemetry) {
58
- this.persistence = persistence;
59
- this.telemetry = telemetry;
60
- }
61
- /**
62
- * Validate input against ReflectionInputSchema
63
- */
64
- validateInput(input) {
65
- return contracts_1.ReflectionInputSchema.parse(input);
66
- }
67
- /**
68
- * Invoke the reflection agent
69
- *
70
- * DETERMINISTIC: Same input always produces same output structure
71
- * STATELESS: No internal state modified
72
- * NON-BLOCKING: Fully async
73
- */
74
- async invoke(input, executionRef) {
75
- const startTime = Date.now();
76
- try {
77
- // Emit telemetry start
78
- this.telemetry.recordStart(AGENT_ID, executionRef, input);
79
- // Perform reflection analysis (pure analysis, no side effects)
80
- const output = this.analyzeDecisionEvents(input);
81
- // Validate output
82
- const validatedOutput = contracts_1.ReflectionOutputSchema.parse(output);
83
- // Calculate confidence based on analysis quality
84
- const confidence = this.calculateConfidence(validatedOutput, input);
85
- // Constraints applied during reflection
86
- const constraintsApplied = this.getAppliedConstraints(input);
87
- // Create the DecisionEvent
88
- const event = (0, contracts_1.createDecisionEvent)(AGENT_ID, AGENT_VERSION, DECISION_TYPE, input, validatedOutput, confidence, constraintsApplied, executionRef);
89
- // Persist via ruvector-service (best-effort, non-blocking)
90
- let persistence_status;
91
- try {
92
- await this.persistence.store(event);
93
- persistence_status = { status: 'persisted' };
94
- }
95
- catch (persistError) {
96
- const persistMessage = persistError instanceof Error ? persistError.message : 'Unknown persistence error';
97
- console.error(`[${AGENT_ID}] RuVector persistence failed (non-blocking): ${persistMessage}`);
98
- persistence_status = { status: 'skipped', error: persistMessage };
99
- }
100
- // Emit telemetry success
101
- this.telemetry.recordSuccess(AGENT_ID, executionRef, Date.now() - startTime);
102
- return {
103
- status: 'success',
104
- event,
105
- persistence_status,
106
- };
107
- }
108
- catch (error) {
109
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
110
- const errorCode = this.classifyError(error);
111
- // Emit telemetry failure
112
- this.telemetry.recordFailure(AGENT_ID, executionRef, errorCode, errorMessage);
113
- return (0, contracts_1.createErrorResult)(errorCode, errorMessage, executionRef);
114
- }
115
- }
116
- /**
117
- * Analyze DecisionEvents and produce reflection output
118
- *
119
- * This is the core reflection logic - purely analytical.
120
- * NEVER modifies behavior, triggers retries, or applies optimizations.
121
- */
122
- analyzeDecisionEvents(input) {
123
- const reflectionId = (0, uuid_1.v4)();
124
- const events = input.decision_events;
125
- const focusAreas = input.context?.focus_areas || ['all'];
126
- const preferences = input.preferences;
127
- const minConfidence = preferences?.min_confidence ?? 0.5;
128
- const maxSignalsPerCategory = preferences?.max_signals_per_category ?? 10;
129
- // Extract unique agents analyzed
130
- const agentsAnalyzed = [...new Set(events.map(e => e.agent_id))];
131
- // Determine time range
132
- const timestamps = events.map(e => new Date(e.timestamp).getTime());
133
- const analysisTimeRange = {
134
- earliest: new Date(Math.min(...timestamps)).toISOString(),
135
- latest: new Date(Math.max(...timestamps)).toISOString(),
136
- };
137
- // Perform analysis based on focus areas
138
- const includeAll = focusAreas.includes('all');
139
- const outcomeEvaluations = (includeAll || focusAreas.includes('outcomes'))
140
- ? this.evaluateOutcomes(events)
141
- : [];
142
- const qualitySignals = (includeAll || focusAreas.includes('quality'))
143
- ? this.extractQualitySignals(events, minConfidence).slice(0, maxSignalsPerCategory)
144
- : [];
145
- const learningSignals = (includeAll || focusAreas.includes('learning'))
146
- ? this.extractLearningSignals(events, minConfidence).slice(0, maxSignalsPerCategory)
147
- : [];
148
- const gapAnalysis = (includeAll || focusAreas.includes('gaps'))
149
- ? this.identifyGaps(events, outcomeEvaluations).slice(0, maxSignalsPerCategory)
150
- : [];
151
- // Find correlations if enabled
152
- const correlations = (preferences?.correlate_events ?? true)
153
- ? this.findCorrelations(events)
154
- : [];
155
- // Generate summary
156
- const summary = this.generateSummary(outcomeEvaluations, qualitySignals, learningSignals, gapAnalysis);
157
- return {
158
- reflection_id: reflectionId,
159
- events_analyzed: events.length,
160
- agents_analyzed: agentsAnalyzed,
161
- analysis_time_range: analysisTimeRange,
162
- outcome_evaluations: outcomeEvaluations,
163
- quality_signals: qualitySignals,
164
- learning_signals: learningSignals,
165
- gap_analysis: gapAnalysis,
166
- correlations,
167
- summary,
168
- version: '1.0.0',
169
- };
170
- }
171
- /**
172
- * Evaluate outcomes for each decision event
173
- */
174
- evaluateOutcomes(events) {
175
- return events.map(event => {
176
- const dimensions = this.assessDimensions(event);
177
- const outcomeScore = dimensions.reduce((sum, d) => sum + d.score, 0) / dimensions.length;
178
- const metExpectations = outcomeScore >= 0.7 && event.confidence >= 0.6;
179
- return {
180
- decision_ref: event.execution_ref,
181
- agent_id: event.agent_id,
182
- decision_type: event.decision_type,
183
- outcome_score: Math.round(outcomeScore * 100) / 100,
184
- summary: this.generateOutcomeSummary(event, outcomeScore),
185
- dimensions,
186
- met_expectations: metExpectations,
187
- deviation_notes: metExpectations
188
- ? undefined
189
- : this.generateDeviationNotes(event, outcomeScore),
190
- };
191
- });
192
- }
193
- /**
194
- * Assess quality dimensions for a decision event
195
- */
196
- assessDimensions(event) {
197
- const dimensions = [];
198
- // Confidence dimension
199
- dimensions.push({
200
- name: 'confidence',
201
- score: event.confidence,
202
- notes: event.confidence < 0.5 ? 'Low confidence indicates uncertainty' : undefined,
203
- });
204
- // Completeness dimension (based on constraints applied)
205
- const completenessScore = Math.min(1, event.constraints_applied.length / 5);
206
- dimensions.push({
207
- name: 'completeness',
208
- score: completenessScore,
209
- notes: completenessScore < 0.5 ? 'Few constraints applied' : undefined,
210
- });
211
- // Determinism dimension (based on inputs_hash presence and validity)
212
- const determinismScore = event.inputs_hash.length === 64 ? 1.0 : 0.5;
213
- dimensions.push({
214
- name: 'determinism',
215
- score: determinismScore,
216
- notes: determinismScore < 1 ? 'Input hashing may be incomplete' : undefined,
217
- });
218
- // Output quality dimension (analyze output structure)
219
- const outputScore = this.assessOutputQuality(event.outputs);
220
- dimensions.push({
221
- name: 'output_quality',
222
- score: outputScore,
223
- notes: outputScore < 0.6 ? 'Output structure may be incomplete' : undefined,
224
- });
225
- return dimensions;
226
- }
227
- /**
228
- * Assess quality of event outputs
229
- */
230
- assessOutputQuality(outputs) {
231
- if (!outputs)
232
- return 0.3;
233
- if (typeof outputs !== 'object')
234
- return 0.5;
235
- const obj = outputs;
236
- const keys = Object.keys(obj);
237
- // More structured outputs get higher scores
238
- if (keys.length === 0)
239
- return 0.4;
240
- if (keys.length < 3)
241
- return 0.6;
242
- if (keys.length < 6)
243
- return 0.8;
244
- return 0.9;
245
- }
246
- /**
247
- * Generate outcome summary
248
- */
249
- generateOutcomeSummary(event, score) {
250
- const quality = score >= 0.8 ? 'high' : score >= 0.6 ? 'acceptable' : 'needs improvement';
251
- return `${event.decision_type} from ${event.agent_id} produced ${quality} quality output with ${(event.confidence * 100).toFixed(0)}% confidence`;
252
- }
253
- /**
254
- * Generate deviation notes
255
- */
256
- generateDeviationNotes(event, score) {
257
- const issues = [];
258
- if (event.confidence < 0.6)
259
- issues.push('low confidence');
260
- if (score < 0.7)
261
- issues.push('suboptimal outcome score');
262
- return `Decision deviated from expectations due to: ${issues.join(', ')}`;
263
- }
264
- /**
265
- * Extract quality signals from events
266
- */
267
- extractQualitySignals(events, minConfidence) {
268
- const signals = [];
269
- let signalCounter = 0;
270
- // Aggregate confidence analysis
271
- const avgConfidence = events.reduce((sum, e) => sum + e.confidence, 0) / events.length;
272
- if (avgConfidence >= minConfidence) {
273
- signals.push({
274
- signal_id: `qs-${++signalCounter}`,
275
- type: 'accuracy',
276
- value: avgConfidence,
277
- description: `Average decision confidence across ${events.length} events`,
278
- evidence: [`Calculated from ${events.length} DecisionEvents`],
279
- severity: avgConfidence < 0.5 ? 'warning' : undefined,
280
- });
281
- }
282
- // Performance signal based on constraint coverage
283
- const avgConstraints = events.reduce((sum, e) => sum + e.constraints_applied.length, 0) / events.length;
284
- const constraintScore = Math.min(1, avgConstraints / 6);
285
- if (constraintScore >= minConfidence) {
286
- signals.push({
287
- signal_id: `qs-${++signalCounter}`,
288
- type: 'completeness',
289
- value: constraintScore,
290
- description: `Average constraint coverage across decisions`,
291
- evidence: [`Average ${avgConstraints.toFixed(1)} constraints per decision`],
292
- });
293
- }
294
- // Consistency signal - check for similar decision types
295
- const decisionTypeCounts = new Map();
296
- events.forEach(e => {
297
- decisionTypeCounts.set(e.decision_type, (decisionTypeCounts.get(e.decision_type) || 0) + 1);
298
- });
299
- const consistencyScore = Math.min(1, 1 / decisionTypeCounts.size);
300
- signals.push({
301
- signal_id: `qs-${++signalCounter}`,
302
- type: 'consistency',
303
- value: consistencyScore,
304
- description: `Decision type consistency across analyzed events`,
305
- evidence: [`${decisionTypeCounts.size} unique decision types found`],
306
- });
307
- // Reliability signal based on agent version consistency
308
- const agentVersions = new Set(events.map(e => `${e.agent_id}@${e.agent_version}`));
309
- const reliabilityScore = events.length / agentVersions.size / events.length;
310
- signals.push({
311
- signal_id: `qs-${++signalCounter}`,
312
- type: 'reliability',
313
- value: Math.min(1, reliabilityScore),
314
- description: `Agent version stability across decisions`,
315
- evidence: [`${agentVersions.size} unique agent versions`],
316
- });
317
- return signals;
318
- }
319
- /**
320
- * Extract learning signals from events
321
- */
322
- extractLearningSignals(events, minConfidence) {
323
- const signals = [];
324
- let learningCounter = 0;
325
- // Pattern: High-confidence decisions
326
- const highConfidenceEvents = events.filter(e => e.confidence >= 0.8);
327
- if (highConfidenceEvents.length > 0) {
328
- signals.push({
329
- learning_id: `ls-${++learningCounter}`,
330
- category: 'pattern',
331
- title: 'High-Confidence Decision Pattern',
332
- description: `${highConfidenceEvents.length} decisions achieved high confidence (>=0.8)`,
333
- confidence: highConfidenceEvents.length / events.length,
334
- affected_agents: [...new Set(highConfidenceEvents.map(e => e.agent_id))],
335
- recommendations: [
336
- 'Study common characteristics of high-confidence decisions',
337
- 'Identify input patterns that lead to confident outputs',
338
- ],
339
- });
340
- }
341
- // Anti-pattern: Low-confidence decisions
342
- const lowConfidenceEvents = events.filter(e => e.confidence < 0.5);
343
- if (lowConfidenceEvents.length > 0 && lowConfidenceEvents.length / events.length >= minConfidence * 0.5) {
344
- signals.push({
345
- learning_id: `ls-${++learningCounter}`,
346
- category: 'anti_pattern',
347
- title: 'Low-Confidence Decision Pattern',
348
- description: `${lowConfidenceEvents.length} decisions had low confidence (<0.5)`,
349
- confidence: Math.min(1, lowConfidenceEvents.length / events.length + 0.3),
350
- affected_agents: [...new Set(lowConfidenceEvents.map(e => e.agent_id))],
351
- recommendations: [
352
- 'Investigate causes of low confidence',
353
- 'Review input quality for affected decisions',
354
- ],
355
- });
356
- }
357
- // Optimization: Constraint utilization
358
- const constraintPatterns = this.analyzeConstraintPatterns(events);
359
- if (constraintPatterns.underutilized.length > 0) {
360
- signals.push({
361
- learning_id: `ls-${++learningCounter}`,
362
- category: 'optimization',
363
- title: 'Constraint Utilization Opportunity',
364
- description: `Some decisions apply fewer constraints than optimal`,
365
- confidence: 0.7,
366
- affected_agents: constraintPatterns.underutilized,
367
- recommendations: [
368
- 'Review constraint application consistency',
369
- 'Ensure all relevant constraints are considered',
370
- ],
371
- });
372
- }
373
- // Edge case detection
374
- const outlierEvents = this.detectOutliers(events);
375
- if (outlierEvents.length > 0) {
376
- signals.push({
377
- learning_id: `ls-${++learningCounter}`,
378
- category: 'edge_case',
379
- title: 'Outlier Decision Detection',
380
- description: `${outlierEvents.length} decisions exhibited unusual characteristics`,
381
- confidence: 0.65,
382
- affected_agents: [...new Set(outlierEvents.map(e => e.agent_id))],
383
- recommendations: [
384
- 'Review outlier decisions for edge cases',
385
- 'Consider adding handling for unusual input patterns',
386
- ],
387
- });
388
- }
389
- return signals;
390
- }
391
- /**
392
- * Analyze constraint usage patterns
393
- */
394
- analyzeConstraintPatterns(events) {
395
- const agentConstraintCounts = new Map();
396
- events.forEach(e => {
397
- const counts = agentConstraintCounts.get(e.agent_id) || [];
398
- counts.push(e.constraints_applied.length);
399
- agentConstraintCounts.set(e.agent_id, counts);
400
- });
401
- const underutilized = [];
402
- agentConstraintCounts.forEach((counts, agentId) => {
403
- const avg = counts.reduce((a, b) => a + b, 0) / counts.length;
404
- if (avg < 3)
405
- underutilized.push(agentId);
406
- });
407
- return { underutilized };
408
- }
409
- /**
410
- * Detect outlier events
411
- */
412
- detectOutliers(events) {
413
- if (events.length < 3)
414
- return [];
415
- const confidences = events.map(e => e.confidence);
416
- const mean = confidences.reduce((a, b) => a + b, 0) / confidences.length;
417
- const stdDev = Math.sqrt(confidences.reduce((sum, c) => sum + Math.pow(c - mean, 2), 0) / confidences.length);
418
- // Outliers are more than 2 standard deviations from mean
419
- return events.filter(e => Math.abs(e.confidence - mean) > 2 * stdDev);
420
- }
421
- /**
422
- * Identify gaps in the analyzed events
423
- */
424
- identifyGaps(events, outcomes) {
425
- const gaps = [];
426
- let gapCounter = 0;
427
- // Check for coverage gaps - decision types that should exist
428
- const decisionTypes = new Set(events.map(e => e.decision_type));
429
- if (decisionTypes.size === 1 && events.length > 5) {
430
- gaps.push({
431
- gap_id: `gap-${++gapCounter}`,
432
- type: 'coverage',
433
- title: 'Limited Decision Type Coverage',
434
- description: 'Only one decision type analyzed, limiting cross-functional insights',
435
- impact: 'medium',
436
- affected_steps: [],
437
- evidence: [`Single decision type: ${[...decisionTypes][0]}`],
438
- });
439
- }
440
- // Check for process gaps - low outcome scores
441
- const lowOutcomes = outcomes.filter(o => o.outcome_score < 0.6);
442
- if (lowOutcomes.length > outcomes.length * 0.3) {
443
- gaps.push({
444
- gap_id: `gap-${++gapCounter}`,
445
- type: 'process',
446
- title: 'High Rate of Suboptimal Outcomes',
447
- description: `${lowOutcomes.length} of ${outcomes.length} decisions had low outcome scores`,
448
- impact: 'high',
449
- affected_steps: lowOutcomes.map(o => o.decision_ref),
450
- evidence: [`${((lowOutcomes.length / outcomes.length) * 100).toFixed(0)}% suboptimal rate`],
451
- });
452
- }
453
- // Check for data gaps - missing or incomplete outputs
454
- const incompleteEvents = events.filter(e => !e.outputs || Object.keys(e.outputs).length < 2);
455
- if (incompleteEvents.length > 0) {
456
- gaps.push({
457
- gap_id: `gap-${++gapCounter}`,
458
- type: 'data',
459
- title: 'Incomplete Decision Outputs',
460
- description: `${incompleteEvents.length} decisions have minimal or missing outputs`,
461
- impact: incompleteEvents.length > events.length * 0.5 ? 'high' : 'medium',
462
- affected_steps: incompleteEvents.map(e => e.execution_ref),
463
- evidence: [`${incompleteEvents.length} events with sparse outputs`],
464
- });
465
- }
466
- // Check for expectations gap
467
- const unmetExpectations = outcomes.filter(o => !o.met_expectations);
468
- if (unmetExpectations.length > outcomes.length * 0.2) {
469
- gaps.push({
470
- gap_id: `gap-${++gapCounter}`,
471
- type: 'capability',
472
- title: 'Expectations Gap',
473
- description: 'Significant portion of decisions did not meet expectations',
474
- impact: 'high',
475
- affected_steps: unmetExpectations.map(o => o.decision_ref),
476
- evidence: [`${unmetExpectations.length} decisions below expectations`],
477
- });
478
- }
479
- return gaps;
480
- }
481
- /**
482
- * Find correlations between events
483
- */
484
- findCorrelations(events) {
485
- const correlations = [];
486
- let corrCounter = 0;
487
- if (events.length < 2)
488
- return correlations;
489
- // Temporal correlation - events close in time
490
- const sortedByTime = [...events].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
491
- for (let i = 0; i < sortedByTime.length - 1; i++) {
492
- const timeDiff = new Date(sortedByTime[i + 1].timestamp).getTime() -
493
- new Date(sortedByTime[i].timestamp).getTime();
494
- // If events are within 1 minute, they may be related
495
- if (timeDiff < 60000 && sortedByTime[i].agent_id !== sortedByTime[i + 1].agent_id) {
496
- correlations.push({
497
- correlation_id: `corr-${++corrCounter}`,
498
- type: 'temporal',
499
- event_refs: [sortedByTime[i].execution_ref, sortedByTime[i + 1].execution_ref],
500
- description: `Sequential decisions by different agents within ${(timeDiff / 1000).toFixed(0)}s`,
501
- strength: Math.min(1, 1 - (timeDiff / 60000)),
502
- });
503
- }
504
- }
505
- // Similarity correlation - same decision type, similar confidence
506
- const byDecisionType = new Map();
507
- events.forEach(e => {
508
- const existing = byDecisionType.get(e.decision_type) || [];
509
- existing.push(e);
510
- byDecisionType.set(e.decision_type, existing);
511
- });
512
- byDecisionType.forEach((typeEvents, decisionType) => {
513
- if (typeEvents.length >= 2) {
514
- const confidences = typeEvents.map(e => e.confidence);
515
- const avgConfidence = confidences.reduce((a, b) => a + b, 0) / confidences.length;
516
- const variance = confidences.reduce((sum, c) => sum + Math.pow(c - avgConfidence, 2), 0) / confidences.length;
517
- // Low variance indicates similarity
518
- if (variance < 0.05) {
519
- correlations.push({
520
- correlation_id: `corr-${++corrCounter}`,
521
- type: 'similarity',
522
- event_refs: typeEvents.map(e => e.execution_ref),
523
- description: `${typeEvents.length} ${decisionType} decisions with consistent confidence patterns`,
524
- strength: 1 - Math.sqrt(variance),
525
- });
526
- }
527
- }
528
- });
529
- return correlations.slice(0, 10); // Limit to top 10 correlations
530
- }
531
- /**
532
- * Generate summary statistics
533
- */
534
- generateSummary(outcomes, qualitySignals, learningSignals, gaps) {
535
- const outcomeScores = outcomes.map(o => o.outcome_score);
536
- const overallQuality = outcomeScores.length > 0
537
- ? outcomeScores.reduce((a, b) => a + b, 0) / outcomeScores.length
538
- : 0.5;
539
- const expectationsMetCount = outcomes.filter(o => o.met_expectations).length;
540
- const expectationsMetRate = outcomes.length > 0
541
- ? expectationsMetCount / outcomes.length
542
- : 0;
543
- const keyFindings = [];
544
- const improvementSuggestions = [];
545
- // Generate key findings
546
- if (overallQuality >= 0.8) {
547
- keyFindings.push('Overall decision quality is high');
548
- }
549
- else if (overallQuality < 0.6) {
550
- keyFindings.push('Decision quality needs attention');
551
- improvementSuggestions.push('Review low-scoring decisions for common issues');
552
- }
553
- if (expectationsMetRate >= 0.9) {
554
- keyFindings.push('Decisions consistently meet expectations');
555
- }
556
- else if (expectationsMetRate < 0.7) {
557
- keyFindings.push('Expectations gap detected in decision outcomes');
558
- improvementSuggestions.push('Calibrate expectation thresholds or improve decision confidence');
559
- }
560
- // Add findings from signals
561
- const highValuePatterns = learningSignals.filter(s => s.category === 'pattern' && s.confidence >= 0.7);
562
- if (highValuePatterns.length > 0) {
563
- keyFindings.push(`${highValuePatterns.length} high-value patterns identified for replication`);
564
- }
565
- const criticalGaps = gaps.filter(g => g.impact === 'critical' || g.impact === 'high');
566
- if (criticalGaps.length > 0) {
567
- keyFindings.push(`${criticalGaps.length} high-impact gaps require attention`);
568
- criticalGaps.forEach(g => {
569
- improvementSuggestions.push(`Address ${g.type} gap: ${g.title}`);
570
- });
571
- }
572
- return {
573
- overall_quality_score: Math.round(overallQuality * 100) / 100,
574
- total_quality_signals: qualitySignals.length,
575
- total_learning_signals: learningSignals.length,
576
- total_gaps: gaps.length,
577
- expectations_met_rate: Math.round(expectationsMetRate * 100) / 100,
578
- key_findings: keyFindings,
579
- improvement_suggestions: improvementSuggestions,
580
- };
581
- }
582
- /**
583
- * Calculate confidence score for reflection analysis
584
- */
585
- calculateConfidence(output, input) {
586
- let confidence = 0.6; // Base confidence
587
- // More events analyzed = more confident in patterns
588
- if (output.events_analyzed >= 10)
589
- confidence += 0.1;
590
- if (output.events_analyzed >= 50)
591
- confidence += 0.05;
592
- // Multiple agents analyzed = broader perspective
593
- if (output.agents_analyzed.length > 1)
594
- confidence += 0.05;
595
- // Found signals = meaningful analysis
596
- if (output.quality_signals.length > 0)
597
- confidence += 0.05;
598
- if (output.learning_signals.length > 0)
599
- confidence += 0.05;
600
- // Found correlations = deeper insights
601
- if (output.correlations.length > 0)
602
- confidence += 0.05;
603
- // Reduce for too few events
604
- if (output.events_analyzed < 3)
605
- confidence -= 0.1;
606
- return Math.min(1.0, Math.max(0.0, confidence));
607
- }
608
- /**
609
- * Get constraints applied during reflection
610
- */
611
- getAppliedConstraints(input) {
612
- const constraints = [
613
- 'read_only_analysis',
614
- 'no_behavior_modification',
615
- 'no_retry_triggering',
616
- 'no_optimization_application',
617
- 'informational_output_only',
618
- 'deterministic_analysis',
619
- ];
620
- // Add context-specific constraints
621
- if (input.context?.focus_areas) {
622
- constraints.push(`focus_areas:${input.context.focus_areas.join(',')}`);
623
- }
624
- if (input.preferences?.min_confidence) {
625
- constraints.push(`min_confidence:${input.preferences.min_confidence}`);
626
- }
627
- return constraints;
628
- }
629
- /**
630
- * Classify error for proper error code
631
- */
632
- classifyError(error) {
633
- if (error instanceof Error) {
634
- if (error.name === 'ZodError') {
635
- return contracts_1.AgentErrorCodes.VALIDATION_FAILED;
636
- }
637
- if (error.message.includes('persistence') || error.message.includes('ruvector')) {
638
- return contracts_1.AgentErrorCodes.PERSISTENCE_ERROR;
639
- }
640
- }
641
- return contracts_1.AgentErrorCodes.PROCESSING_ERROR;
642
- }
643
- }
644
- exports.ReflectionAgent = ReflectionAgent;
645
- //# sourceMappingURL=reflection-agent.js.map