codehere 0.4.0 → 0.5.0-alpha

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 (324) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +113 -30
  3. package/dist/application/agents/execution-agent.js +2 -2
  4. package/dist/application/agents/execution-agent.js.map +1 -1
  5. package/dist/application/agents/multi-agent-orchestrator.d.ts +1 -0
  6. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  7. package/dist/application/agents/multi-agent-orchestrator.js +10 -3
  8. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  9. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  10. package/dist/application/agents/planning-agent.js +22 -10
  11. package/dist/application/agents/planning-agent.js.map +1 -1
  12. package/dist/application/agents/validation-agent.js +2 -2
  13. package/dist/application/agents/validation-agent.js.map +1 -1
  14. package/dist/application/reasoning/multi-model-planning-strategy.d.ts +21 -0
  15. package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
  16. package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
  17. package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
  18. package/dist/application/reasoning/reasoning-config.d.ts +15 -0
  19. package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
  20. package/dist/application/reasoning/reasoning-config.js +50 -0
  21. package/dist/application/reasoning/reasoning-config.js.map +1 -0
  22. package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
  23. package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
  24. package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
  25. package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
  26. package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
  27. package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
  28. package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
  29. package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
  30. package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
  31. package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
  32. package/dist/application/reasoning/role-provider-resolver.js +74 -0
  33. package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
  34. package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
  35. package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
  36. package/dist/application/reasoning/simple-planning-strategy.js +217 -0
  37. package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
  38. package/dist/application/reasoning/types.d.ts +65 -0
  39. package/dist/application/reasoning/types.d.ts.map +1 -0
  40. package/dist/application/reasoning/types.js +6 -0
  41. package/dist/application/reasoning/types.js.map +1 -0
  42. package/dist/application/reasoning/validator-strategy.d.ts +56 -0
  43. package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
  44. package/dist/application/reasoning/validator-strategy.js +103 -0
  45. package/dist/application/reasoning/validator-strategy.js.map +1 -0
  46. package/dist/application/services/dependency-container.d.ts +30 -6
  47. package/dist/application/services/dependency-container.d.ts.map +1 -1
  48. package/dist/application/services/dependency-container.js +96 -44
  49. package/dist/application/services/dependency-container.js.map +1 -1
  50. package/dist/application/services/intelligent-router.d.ts +6 -0
  51. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  52. package/dist/application/services/intelligent-router.js +98 -9
  53. package/dist/application/services/intelligent-router.js.map +1 -1
  54. package/dist/application/use-cases/ask-question-use-case.d.ts +1 -0
  55. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  56. package/dist/application/use-cases/ask-question-use-case.js +4 -3
  57. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  58. package/dist/application/use-cases/planning-use-case.d.ts +14 -1
  59. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  60. package/dist/application/use-cases/planning-use-case.js +109 -2
  61. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  62. package/dist/domain/entities/memory.d.ts.map +1 -1
  63. package/dist/domain/entities/task.d.ts +1 -1
  64. package/dist/domain/entities/task.d.ts.map +1 -1
  65. package/dist/domain/entities/task.js +2 -2
  66. package/dist/domain/entities/task.js.map +1 -1
  67. package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
  68. package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
  69. package/dist/domain/errors/embeddings-not-found-error.js +13 -0
  70. package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
  71. package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
  72. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
  73. package/dist/domain/services/environment-mode-manager.d.ts +4 -10
  74. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
  75. package/dist/domain/services/environment-mode-manager.js +7 -22
  76. package/dist/domain/services/environment-mode-manager.js.map +1 -1
  77. package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
  78. package/dist/domain/services/query-intent-classifier.js +20 -1
  79. package/dist/domain/services/query-intent-classifier.js.map +1 -1
  80. package/dist/domain/services/risk-tier-detector.d.ts +8 -9
  81. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
  82. package/dist/domain/services/risk-tier-detector.js +53 -40
  83. package/dist/domain/services/risk-tier-detector.js.map +1 -1
  84. package/dist/embed.d.ts.map +1 -1
  85. package/dist/embed.js +18 -8
  86. package/dist/embed.js.map +1 -1
  87. package/dist/index.js +405 -52
  88. package/dist/index.js.map +1 -1
  89. package/dist/infrastructure/ai/cohere-ai-service.js +4 -4
  90. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  91. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
  92. package/dist/infrastructure/ai/provider-ai-service.js +7 -7
  93. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
  94. package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
  95. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
  96. package/dist/infrastructure/cache/query-result-cache.js +40 -112
  97. package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
  98. package/dist/infrastructure/cache/response-cache.d.ts +10 -78
  99. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
  100. package/dist/infrastructure/cache/response-cache.js +22 -198
  101. package/dist/infrastructure/cache/response-cache.js.map +1 -1
  102. package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
  103. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
  104. package/dist/infrastructure/cache/security-scan-cache.js +25 -102
  105. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
  106. package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
  107. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
  108. package/dist/infrastructure/completion/bash-completion.js +11 -87
  109. package/dist/infrastructure/completion/bash-completion.js.map +1 -1
  110. package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
  111. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
  112. package/dist/infrastructure/completion/fish-completion.js +15 -58
  113. package/dist/infrastructure/completion/fish-completion.js.map +1 -1
  114. package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
  115. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
  116. package/dist/infrastructure/completion/zsh-completion.js +18 -73
  117. package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
  118. package/dist/infrastructure/config/config-manager.d.ts +10 -0
  119. package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
  120. package/dist/infrastructure/config/config-manager.js +13 -2
  121. package/dist/infrastructure/config/config-manager.js.map +1 -1
  122. package/dist/infrastructure/context/conversation-context.d.ts +27 -31
  123. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
  124. package/dist/infrastructure/context/conversation-context.js +95 -136
  125. package/dist/infrastructure/context/conversation-context.js.map +1 -1
  126. package/dist/infrastructure/context/session-manager.d.ts +27 -11
  127. package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
  128. package/dist/infrastructure/context/session-manager.js +69 -73
  129. package/dist/infrastructure/context/session-manager.js.map +1 -1
  130. package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
  131. package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
  132. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
  133. package/dist/infrastructure/providers/cohere-provider.js +102 -17
  134. package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
  135. package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
  136. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
  137. package/dist/infrastructure/providers/openrouter-provider.js +401 -0
  138. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
  139. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -1
  140. package/dist/infrastructure/providers/operation-provider-resolver.js +33 -7
  141. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -1
  142. package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
  143. package/dist/infrastructure/security/input-validator.js +19 -6
  144. package/dist/infrastructure/security/input-validator.js.map +1 -1
  145. package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
  146. package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
  147. package/dist/infrastructure/serialization/toon-serializer.js +119 -0
  148. package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
  149. package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
  150. package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
  151. package/dist/infrastructure/storage/embeddings-path.js +37 -0
  152. package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
  153. package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
  154. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
  155. package/dist/infrastructure/storage/plan-repository.js +36 -73
  156. package/dist/infrastructure/storage/plan-repository.js.map +1 -1
  157. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
  158. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  159. package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
  160. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  161. package/dist/infrastructure/storage/task-helpers.d.ts +12 -1
  162. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
  163. package/dist/infrastructure/storage/task-helpers.js +48 -8
  164. package/dist/infrastructure/storage/task-helpers.js.map +1 -1
  165. package/dist/infrastructure/storage/task-repository.d.ts +2 -1
  166. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
  167. package/dist/infrastructure/storage/task-repository.js +14 -3
  168. package/dist/infrastructure/storage/task-repository.js.map +1 -1
  169. package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
  170. package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
  171. package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
  172. package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
  173. package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
  174. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
  175. package/dist/infrastructure/ux/capability-boundaries.js +23 -148
  176. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
  177. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
  178. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
  179. package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
  180. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
  181. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
  182. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
  183. package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
  184. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
  185. package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
  186. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
  187. package/dist/infrastructure/ux/feature-discovery.js +5 -181
  188. package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
  189. package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
  190. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
  191. package/dist/infrastructure/ux/feedback-prompt.js +30 -166
  192. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
  193. package/dist/infrastructure/ux/progress-indicator.d.ts +4 -6
  194. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  195. package/dist/infrastructure/ux/progress-indicator.js +35 -50
  196. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  197. package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
  198. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
  199. package/dist/infrastructure/ux/review-checkpoint.js +33 -80
  200. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
  201. package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
  202. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
  203. package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
  204. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
  205. package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
  206. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
  207. package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
  208. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
  209. package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
  210. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
  211. package/dist/infrastructure/validation/agent-feedback.js +32 -204
  212. package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
  213. package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
  214. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
  215. package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
  216. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
  217. package/dist/infrastructure/validation/review-handler.d.ts +13 -41
  218. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
  219. package/dist/infrastructure/validation/review-handler.js +23 -189
  220. package/dist/infrastructure/validation/review-handler.js.map +1 -1
  221. package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
  222. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
  223. package/dist/infrastructure/validation/summary-aggregator.js +47 -133
  224. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
  225. package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
  226. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
  227. package/dist/infrastructure/validation/summary-extractor.js +32 -89
  228. package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
  229. package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
  230. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
  231. package/dist/infrastructure/validation/trace-summary.js +37 -356
  232. package/dist/infrastructure/validation/trace-summary.js.map +1 -1
  233. package/dist/monitoring.d.ts +1 -1
  234. package/dist/monitoring.d.ts.map +1 -1
  235. package/dist/monitoring.js +12 -9
  236. package/dist/monitoring.js.map +1 -1
  237. package/dist/parallel-processor.d.ts.map +1 -1
  238. package/dist/parallel-processor.js +124 -45
  239. package/dist/parallel-processor.js.map +1 -1
  240. package/dist/presentation/cli/commands/ask-command.d.ts +2 -0
  241. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  242. package/dist/presentation/cli/commands/ask-command.js +316 -129
  243. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  244. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  245. package/dist/presentation/cli/commands/config-command.js +22 -8
  246. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  247. package/dist/presentation/cli/commands/decision-command.js +23 -6
  248. package/dist/presentation/cli/commands/decision-command.js.map +1 -1
  249. package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
  250. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
  251. package/dist/presentation/cli/commands/docs-command.js +13 -184
  252. package/dist/presentation/cli/commands/docs-command.js.map +1 -1
  253. package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
  254. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
  255. package/dist/presentation/cli/commands/fix-command.js +61 -276
  256. package/dist/presentation/cli/commands/fix-command.js.map +1 -1
  257. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  258. package/dist/presentation/cli/commands/help-command.js +21 -1
  259. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  260. package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
  261. package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
  262. package/dist/presentation/cli/commands/memory-command.js +252 -0
  263. package/dist/presentation/cli/commands/memory-command.js.map +1 -0
  264. package/dist/presentation/cli/commands/models-command.d.ts +13 -0
  265. package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
  266. package/dist/presentation/cli/commands/models-command.js +194 -0
  267. package/dist/presentation/cli/commands/models-command.js.map +1 -0
  268. package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
  269. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  270. package/dist/presentation/cli/commands/orchestrate-command.js +129 -14
  271. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  272. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  273. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  274. package/dist/presentation/cli/commands/plan-command.js +134 -25
  275. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  276. package/dist/presentation/cli/commands/product-command.d.ts +6 -4
  277. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
  278. package/dist/presentation/cli/commands/product-command.js +12 -178
  279. package/dist/presentation/cli/commands/product-command.js.map +1 -1
  280. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  281. package/dist/presentation/cli/commands/react-command.js +5 -1
  282. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  283. package/dist/presentation/cli/commands/review-command.d.ts +7 -7
  284. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
  285. package/dist/presentation/cli/commands/review-command.js +167 -16
  286. package/dist/presentation/cli/commands/review-command.js.map +1 -1
  287. package/dist/presentation/cli/commands/run-command.d.ts +6 -8
  288. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
  289. package/dist/presentation/cli/commands/run-command.js +182 -23
  290. package/dist/presentation/cli/commands/run-command.js.map +1 -1
  291. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  292. package/dist/presentation/cli/commands/setup-command.js +15 -0
  293. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  294. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  295. package/dist/presentation/cli/commands/smart-command.js +74 -6
  296. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  297. package/dist/presentation/cli/commands/status-command.d.ts +3 -0
  298. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
  299. package/dist/presentation/cli/commands/status-command.js +151 -156
  300. package/dist/presentation/cli/commands/status-command.js.map +1 -1
  301. package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
  302. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
  303. package/dist/presentation/cli/commands/suggest-command.js +132 -19
  304. package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
  305. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  306. package/dist/presentation/cli/error-display.js +75 -17
  307. package/dist/presentation/cli/error-display.js.map +1 -1
  308. package/dist/search.d.ts.map +1 -1
  309. package/dist/search.js +6 -1
  310. package/dist/search.js.map +1 -1
  311. package/dist/session.d.ts +1 -0
  312. package/dist/session.d.ts.map +1 -1
  313. package/dist/session.js +55 -7
  314. package/dist/session.js.map +1 -1
  315. package/dist/tools/bash.d.ts.map +1 -1
  316. package/dist/tools/bash.js +3 -0
  317. package/dist/tools/bash.js.map +1 -1
  318. package/dist/tools/git-tool.js +7 -7
  319. package/dist/tools/git-tool.js.map +1 -1
  320. package/dist/ui.d.ts +11 -0
  321. package/dist/ui.d.ts.map +1 -1
  322. package/dist/ui.js +54 -1
  323. package/dist/ui.js.map +1 -1
  324. package/package.json +14 -4
@@ -1,88 +1,137 @@
1
1
  /**
2
- * Infrastructure: Agent Validation Helper
3
- * Shared utilities for integrating Validation Layer into agents
2
+ * Agent Validation Helper
3
+ * Validates agent outputs and checks trust scores
4
4
  *
5
- * Provides:
6
- * - Automatic TraceSummary generation
7
- * - AgentFeedback recording
8
- * - Run context tracking
5
+ * Phase 1: v0.5.0-alpha.0
9
6
  */
7
+ import { TraceSummary } from './trace-summary.js';
10
8
  import { executionTracer } from '../observability/execution-tracer.js';
11
- import { agentFeedbackManager } from './agent-feedback.js';
12
- import { traceSummaryFormatter } from './trace-summary.js';
9
+ import { randomUUID } from 'crypto';
13
10
  /**
14
- * Helper class for agent validation integration
11
+ * Agent validation helper
15
12
  */
16
- export class AgentValidationHelper {
13
+ export const agentValidationHelper = {
17
14
  /**
18
- * Start validation context for an agent operation
15
+ * Start an agent operation and return validation context
19
16
  */
20
- startAgentOperation(agentName, operation, context) {
21
- const runId = executionTracer.startRun(`${agentName}:${operation}`, {
22
- query: context?.query,
23
- codebaseId: context?.codebaseId,
24
- });
17
+ startAgentOperation(agentName, operation, metadata) {
25
18
  return {
26
- runId,
27
19
  agentName,
28
20
  operation,
29
21
  startTime: Date.now(),
22
+ metadata,
30
23
  };
31
- }
24
+ },
32
25
  /**
33
- * Complete agent operation and generate validation artifacts
26
+ * Complete an agent operation and return validation result
34
27
  */
35
- async completeAgentOperation(validationContext, result, metadata) {
36
- // End trace to finalize run context
37
- executionTracer.endRun();
38
- // Small delay to ensure file is written
39
- await new Promise(resolve => setTimeout(resolve, 100));
40
- // Get finalized run context
41
- const run = executionTracer.getRun(validationContext.runId);
42
- const duration = Date.now() - validationContext.startTime;
43
- // Note: Feedback recording is handled by CLI commands with proper userAction from review decision
44
- // This helper only creates the validation summary, not the feedback record
45
- const feedbackId = 'pending-cli-feedback';
46
- // Create trace summary
47
- const summary = traceSummaryFormatter.createSummary(run || {
48
- runId: validationContext.runId,
49
- startTime: validationContext.startTime,
50
- endTime: Date.now(),
51
- operation: validationContext.operation,
52
- query: metadata.additionalContext?.query,
53
- codebaseId: metadata.additionalContext?.codebaseId,
54
- traces: [],
55
- }, agentFeedbackManager.getFeedbackForRun(validationContext.runId) || undefined, validationContext.agentName);
56
- // Update summary with metadata if available
57
- if (metadata.filesChanged) {
58
- summary.filesChanged = metadata.filesChanged;
28
+ async completeAgentOperation(context, result, options) {
29
+ const endTime = Date.now();
30
+ const duration = endTime - context.startTime;
31
+ const opts = options || {};
32
+ // Basic validation
33
+ const issues = [];
34
+ const warnings = [];
35
+ // Check validation checks
36
+ if (opts.validationChecks) {
37
+ for (const check of opts.validationChecks) {
38
+ if (!check.passed) {
39
+ issues.push(check.message || check.check);
40
+ }
41
+ }
59
42
  }
60
- if (metadata.filesCreated) {
61
- summary.filesCreated = metadata.filesCreated;
43
+ // Check errors
44
+ if (opts.errors && opts.errors.length > 0) {
45
+ issues.push(...opts.errors.map((e) => typeof e === 'string' ? e : e.message || String(e)));
62
46
  }
63
- if (metadata.filesDeleted) {
64
- summary.filesDeleted = metadata.filesDeleted;
47
+ // Check warnings
48
+ if (opts.warnings && opts.warnings.length > 0) {
49
+ warnings.push(...opts.warnings.map((w) => typeof w === 'string' ? w : w.message || String(w)));
65
50
  }
66
- if (metadata.errors) {
67
- summary.errors = metadata.errors;
51
+ // Check outcome
52
+ if (opts.outcome === 'failure') {
53
+ issues.push('Operation failed');
68
54
  }
69
- if (metadata.warnings) {
70
- summary.warnings = metadata.warnings;
55
+ else if (opts.outcome === 'partial_success') {
56
+ warnings.push('Operation partially succeeded');
71
57
  }
58
+ // Check overallSuccess in result
59
+ if (result && result.overallSuccess === false) {
60
+ issues.push('Overall operation was not successful');
61
+ }
62
+ // Get runId from execution tracer
63
+ const runId = executionTracer.getCurrentRunId();
64
+ // Generate feedbackId
65
+ const feedbackId = randomUUID();
66
+ // Collect files affected
67
+ const filesAffected = [];
68
+ if (opts.filesChanged)
69
+ filesAffected.push(...opts.filesChanged);
70
+ if (opts.filesCreated)
71
+ filesAffected.push(...opts.filesCreated);
72
+ if (opts.filesDeleted)
73
+ filesAffected.push(...opts.filesDeleted);
74
+ // Create trace summary
75
+ const summaryData = {
76
+ runId: runId || `run-${Date.now()}`,
77
+ agentName: context.agentName,
78
+ operation: context.operation,
79
+ startTime: context.startTime,
80
+ endTime,
81
+ success: issues.length === 0,
82
+ filesAffected: filesAffected.length > 0 ? filesAffected : undefined,
83
+ error: issues.length > 0 ? issues.join('; ') : undefined,
84
+ metadata: {
85
+ ...context.metadata,
86
+ duration,
87
+ validationChecks: opts.validationChecks?.length || 0,
88
+ },
89
+ };
90
+ const summary = new TraceSummary(summaryData);
72
91
  return {
73
- result,
92
+ passed: issues.length === 0,
93
+ issues: issues.length > 0 ? issues : undefined,
94
+ warnings: warnings.length > 0 ? warnings : undefined,
95
+ score: issues.length === 0 ? 1.0 : Math.max(0, 1.0 - (issues.length * 0.2)),
74
96
  summary,
75
97
  feedbackId,
76
- runId: validationContext.runId,
98
+ runId,
77
99
  };
78
- }
100
+ },
101
+ /**
102
+ * Trace an operation step
103
+ */
104
+ trace(data) {
105
+ // In alpha, tracing is a no-op
106
+ // Can be enhanced later to log to execution tracer
107
+ },
79
108
  /**
80
- * Record a trace during agent operation
109
+ * Validate agent output
81
110
  */
82
- trace(operation) {
83
- return executionTracer.trace(operation);
84
- }
85
- }
86
- // Singleton instance
87
- export const agentValidationHelper = new AgentValidationHelper();
111
+ validate(output, context) {
112
+ // Basic validation - can be enhanced later
113
+ if (!output) {
114
+ return {
115
+ passed: false,
116
+ issues: ['Output is empty'],
117
+ };
118
+ }
119
+ return {
120
+ passed: true,
121
+ score: 1.0,
122
+ };
123
+ },
124
+ /**
125
+ * Check trust score for an agent
126
+ */
127
+ checkTrust(agentName, operation) {
128
+ // In alpha, default to passing
129
+ // Can be enhanced later with actual trust score tracking
130
+ return {
131
+ passed: true,
132
+ trustScore: 1.0,
133
+ threshold: 0.7,
134
+ };
135
+ },
136
+ };
88
137
  //# sourceMappingURL=agent-validation-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-validation-helper.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAmB3D;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAChC;;OAEG;IACH,mBAAmB,CACjB,SAAiB,EACjB,SAAiB,EACjB,OAGC;QAED,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE,EAAE;YAClE,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,UAAU,EAAE,OAAO,EAAE,UAAU;SAChC,CAAC,CAAC;QAEH,OAAO;YACL,KAAK;YACL,SAAS;YACT,SAAS;YACT,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,iBAAyC,EACzC,MAAS,EACT,QAsBC;QAED,oCAAoC;QACpC,eAAe,CAAC,MAAM,EAAE,CAAC;QAEzB,wCAAwC;QACxC,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAEvD,4BAA4B;QAC5B,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB,CAAC,SAAS,CAAC;QAE1D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OAEG;IACH,KAAK,CAAC,SAQL;QACC,OAAO,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"agent-validation-helper.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAmCpC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;;OAEG;IACH,mBAAmB,CACjB,SAAiB,EACjB,SAAiB,EACjB,QAA8B;QAE9B,OAAO;YACL,SAAS;YACT,SAAS;YACT,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,QAAQ;SACT,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAA0B,EAC1B,MAAkC,EAClC,OAaC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;QAC7C,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC;QAE3B,mBAAmB;QACnB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,0BAA0B;QAC1B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAC1C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;oBAClB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IA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C,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACpD,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;YAC3E,OAAO;YACP,UAAU;YACV,KAAK;SACN,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAe;QACnB,+BAA+B;QAC/B,mDAAmD;IACrD,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,MAAW,EAAE,OAAa;QACjC,2CAA2C;QAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;gBACL,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,CAAC,iBAAiB,CAAC;aAC5B,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,GAAG;SACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,SAAiB,EAAE,SAAiB;QAC7C,+BAA+B;QAC/B,yDAAyD;QACzD,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,GAAG;YACf,SAAS,EAAE,GAAG;SACf,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1,54 +1,26 @@
1
1
  /**
2
- * Infrastructure: Review Handler
3
- * Handles --review flag behavior: pause, display summary, ask yes/no
2
+ * Review Handler
3
+ * Handles review requests and decisions
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
4
6
  */
5
- import type { TraceSummary } from './trace-summary.js';
6
7
  export interface ReviewDecision {
7
8
  approved: boolean;
8
9
  proceed: boolean;
9
- reason?: string;
10
- userAction: 'approved' | 'rejected' | 'not_required';
10
+ userAction: 'approved' | 'rejected' | 'not_required' | 'cancelled';
11
+ comment?: string;
11
12
  }
12
13
  /**
13
- * Review Handler
14
- * Manages the review flow when --review flag is enabled
14
+ * Review handler instance
15
15
  */
16
- export declare class ReviewHandler {
17
- /**
18
- * Request user review before proceeding
19
- */
20
- requestReview(summary: TraceSummary, options?: {
21
- timeout?: number;
22
- defaultAction?: 'approve' | 'reject';
23
- }): Promise<ReviewDecision>;
16
+ export declare const reviewHandler: {
24
17
  /**
25
- * Prompt user for approval (yes/no)
18
+ * Request review from user
26
19
  */
27
- private promptApproval;
20
+ requestReview(summary: string): Promise<ReviewDecision>;
28
21
  /**
29
- * Check if review should be required based on summary
22
+ * Get review decision (with optional review requested flag)
30
23
  */
31
- shouldRequireReview(summary: TraceSummary): boolean;
32
- /**
33
- * Get review decision - single source of truth for userAction
34
- *
35
- * This method is the ONLY place where userAction is determined.
36
- * All CLI commands must use this method and trust its userAction value.
37
- *
38
- * Logic:
39
- * 1. If reviewRequested === false:
40
- * → userAction = 'not_required'
41
- *
42
- * 2. If reviewRequested === true and shouldReview === false:
43
- * → userAction = 'approved' (user explicitly requested review, treat as approved)
44
- *
45
- * 3. If reviewRequested === true and shouldReview === true:
46
- * → Call requestReview() which handles:
47
- * - Interactive mode: prompt user, return 'approved' or 'rejected'
48
- * - Non-interactive + auto-approve: return 'approved'
49
- * - Non-interactive + no auto-approve: return 'rejected'
50
- */
51
- getReviewDecision(summary: TraceSummary, reviewRequested: boolean): Promise<ReviewDecision>;
52
- }
53
- export declare const reviewHandler: ReviewHandler;
24
+ getReviewDecision(summary: string, reviewRequested: boolean): Promise<ReviewDecision>;
25
+ };
54
26
  //# sourceMappingURL=review-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-handler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;CACtD;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;KACjC,GACL,OAAO,CAAC,cAAc,CAAC;IAkE1B;;OAEG;YACW,cAAc;IAmE5B;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IAwBnD;;;;;;;;;;;;;;;;;;OAkBG;IACG,iBAAiB,CACrB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,OAAO,GACvB,OAAO,CAAC,cAAc,CAAC;CAiC3B;AAGD,eAAO,MAAM,aAAa,eAAsB,CAAC"}
1
+ {"version":3,"file":"review-handler.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;2BAC0B,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAc7D;;OAEG;+BAEQ,MAAM,mBACE,OAAO,GACvB,OAAO,CAAC,cAAc,CAAC;CAW3B,CAAC"}
@@ -1,176 +1,32 @@
1
1
  /**
2
- * Infrastructure: Review Handler
3
- * Handles --review flag behavior: pause, display summary, ask yes/no
2
+ * Review Handler
3
+ * Handles review requests and decisions
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
4
6
  */
5
- import * as readline from 'readline';
6
- import { colors, newline, separator } from '../../ui.js';
7
- import { traceSummaryFormatter } from './trace-summary.js';
8
7
  /**
9
- * Review Handler
10
- * Manages the review flow when --review flag is enabled
8
+ * Review handler instance
11
9
  */
12
- export class ReviewHandler {
13
- /**
14
- * Request user review before proceeding
15
- */
16
- async requestReview(summary, options = {}) {
17
- // TODO: Update task review metadata
18
- // When review is requested: set task.reviewStatus = PENDING
19
- // When review is completed: set task.reviewStatus, task.reviewedAt, task.reviewComments
20
- // Update task.status: NEEDS_REVIEW → APPROVED/REJECTED
21
- // See: docs/ARCHITECTURE/TASK_MODEL.md
22
- // Display summary
23
- const summaryText = traceSummaryFormatter.formatSummary(summary);
24
- console.log('\n' + summaryText);
25
- newline();
26
- // Check if we should skip review in non-interactive mode
27
- if (!process.stdin.isTTY) {
28
- const autoApprove = process.env.CODEHERE_AUTO_APPROVE === 'true' ||
29
- process.env.CODEHERE_REVIEW_SKIP === 'true';
30
- if (autoApprove) {
31
- console.log(colors.yellow('⚠️ Non-interactive mode: Auto-approving changes (CODEHERE_AUTO_APPROVE=true)'));
32
- return {
33
- approved: true,
34
- proceed: true,
35
- reason: 'auto-approved (non-interactive mode)',
36
- userAction: 'approved',
37
- };
38
- }
39
- console.log(colors.red('❌ Non-interactive mode: Review required but cannot prompt for input.'));
40
- console.log(colors.yellow(' Set CODEHERE_AUTO_APPROVE=true to auto-approve, or run in interactive mode.'));
41
- return {
42
- approved: false,
43
- proceed: false,
44
- reason: 'non-interactive mode, review required',
45
- userAction: 'rejected',
46
- };
47
- }
48
- // Prompt for approval
49
- console.log(separator('─', 80));
50
- console.log(colors.bold('Review Required'));
51
- console.log(separator('─', 80));
52
- if (summary.reviewNeeded.riskLevel) {
53
- const riskColor = {
54
- low: colors.cyan,
55
- medium: colors.yellow,
56
- high: colors.red,
57
- critical: colors.red.bold,
58
- }[summary.reviewNeeded.riskLevel];
59
- console.log(riskColor(`Risk Level: ${summary.reviewNeeded.riskLevel.toUpperCase()}`));
60
- newline();
61
- }
62
- const decision = await this.promptApproval(options.timeout || 0, options.defaultAction);
63
- newline();
64
- if (decision.approved) {
65
- console.log(colors.green('✓ Changes approved. Proceeding...'));
66
- }
67
- else {
68
- console.log(colors.red('✗ Changes rejected. Cancelling operation.'));
69
- }
70
- return decision;
71
- }
10
+ export const reviewHandler = {
72
11
  /**
73
- * Prompt user for approval (yes/no)
12
+ * Request review from user
74
13
  */
75
- async promptApproval(timeout = 0, defaultAction) {
76
- return new Promise((resolve) => {
77
- const rl = readline.createInterface({
78
- input: process.stdin,
79
- output: process.stdout,
80
- });
81
- const prompt = () => {
82
- rl.question(colors.bold('Proceed with these changes? (yes/no): '), (answer) => {
83
- rl.close();
84
- const normalized = answer.trim().toLowerCase();
85
- if (normalized === 'yes' || normalized === 'y') {
86
- resolve({
87
- approved: true,
88
- proceed: true,
89
- userAction: 'approved',
90
- });
91
- }
92
- else if (normalized === 'no' || normalized === 'n') {
93
- resolve({
94
- approved: false,
95
- proceed: false,
96
- reason: 'user rejected',
97
- userAction: 'rejected',
98
- });
99
- }
100
- else {
101
- // Invalid input, ask again
102
- console.log(colors.yellow('Please enter "yes" or "no"'));
103
- prompt();
104
- }
105
- });
106
- };
107
- // Handle timeout
108
- if (timeout > 0) {
109
- setTimeout(() => {
110
- if (rl) {
111
- rl.close();
112
- }
113
- const action = defaultAction || 'reject';
114
- resolve({
115
- approved: action === 'approve',
116
- proceed: action === 'approve',
117
- reason: `timeout (default: ${action})`,
118
- userAction: action === 'approve' ? 'approved' : 'rejected',
119
- });
120
- if (action === 'approve') {
121
- console.log(colors.yellow(`\n⏱ Timeout: Auto-approving (default action: ${action})`));
122
- }
123
- else {
124
- console.log(colors.yellow(`\n⏱ Timeout: Auto-rejecting (default action: ${action})`));
125
- }
126
- }, timeout);
127
- }
128
- prompt();
129
- });
130
- }
14
+ async requestReview(summary) {
15
+ // In alpha, auto-approve for non-interactive mode
16
+ // Can be enhanced later with interactive prompts
17
+ console.log('\n📋 Review Request:');
18
+ console.log(summary);
19
+ console.log('\n[Auto-approved in alpha mode]');
20
+ return {
21
+ approved: true,
22
+ proceed: true,
23
+ userAction: 'approved',
24
+ };
25
+ },
131
26
  /**
132
- * Check if review should be required based on summary
133
- */
134
- shouldRequireReview(summary) {
135
- // Always require review if explicitly flagged
136
- if (summary.reviewNeeded.required) {
137
- return true;
138
- }
139
- // Require review for high/critical risk
140
- if (summary.reviewNeeded.riskLevel === 'high' || summary.reviewNeeded.riskLevel === 'critical') {
141
- return true;
142
- }
143
- // Require review if files changed
144
- if (summary.filesChanged.length > 0 || summary.filesCreated.length > 0) {
145
- return true;
146
- }
147
- // Require review if errors occurred
148
- if (summary.errors && summary.errors.length > 0) {
149
- return true;
150
- }
151
- return false;
152
- }
153
- /**
154
- * Get review decision - single source of truth for userAction
155
- *
156
- * This method is the ONLY place where userAction is determined.
157
- * All CLI commands must use this method and trust its userAction value.
158
- *
159
- * Logic:
160
- * 1. If reviewRequested === false:
161
- * → userAction = 'not_required'
162
- *
163
- * 2. If reviewRequested === true and shouldReview === false:
164
- * → userAction = 'approved' (user explicitly requested review, treat as approved)
165
- *
166
- * 3. If reviewRequested === true and shouldReview === true:
167
- * → Call requestReview() which handles:
168
- * - Interactive mode: prompt user, return 'approved' or 'rejected'
169
- * - Non-interactive + auto-approve: return 'approved'
170
- * - Non-interactive + no auto-approve: return 'rejected'
27
+ * Get review decision (with optional review requested flag)
171
28
  */
172
29
  async getReviewDecision(summary, reviewRequested) {
173
- // Case 1: Review not requested → not_required
174
30
  if (!reviewRequested) {
175
31
  return {
176
32
  approved: true,
@@ -178,29 +34,7 @@ export class ReviewHandler {
178
34
  userAction: 'not_required',
179
35
  };
180
36
  }
181
- // Case 2 & 3: Review was requested - check if it's actually required
182
- const shouldReview = this.shouldRequireReview(summary);
183
- if (shouldReview) {
184
- // Case 3: Review is required - call requestReview which handles auto-approve
185
- return await this.requestReview(summary);
186
- }
187
- else {
188
- // Case 2: Review was requested but not required (e.g., no file changes)
189
- // User explicitly passed --review, so treat as approved
190
- // Note: autoApprove is checked here for logging purposes, but userAction is always 'approved'
191
- const autoApprove = process.env.CODEHERE_AUTO_APPROVE === 'true' ||
192
- process.env.CODEHERE_REVIEW_SKIP === 'true';
193
- return {
194
- approved: true,
195
- proceed: true,
196
- reason: autoApprove
197
- ? 'review requested but not required, auto-approved'
198
- : 'review requested but not required',
199
- userAction: 'approved',
200
- };
201
- }
202
- }
203
- }
204
- // Singleton instance
205
- export const reviewHandler = new ReviewHandler();
37
+ return this.requestReview(summary);
38
+ },
39
+ };
206
40
  //# sourceMappingURL=review-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-handler.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAS3D;;;GAGG;AACH,MAAM,OAAO,aAAa;IACxB;;OAEG;IACH,KAAK,CAAC,aAAa,CACjB,OAAqB,EACrB,UAGI,EAAE;QAEN,oCAAoC;QACpC,4DAA4D;QAC5D,wFAAwF;QACxF,uDAAuD;QACvD,uCAAuC;QACvC,kBAAkB;QAClB,MAAM,WAAW,GAAG,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC;QAChC,OAAO,EAAE,CAAC;QAEV,yDAAyD;QACzD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACzB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM;gBAC7C,OAAO,CA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MAAM,CAAC;YAE/D,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,WAAW;oBACjB,CAAC,CAAC,kDAAkD;oBACpD,CAAC,CAAC,mCAAmC;gBACvC,UAAU,EAAE,UAAU;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"review-handler.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/review-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,kDAAkD;QAClD,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAE/C,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,UAAU;SACvB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAe,EACf,eAAwB;QAExB,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,cAAc;aAC3B,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
@@ -1,42 +1,45 @@
1
1
  /**
2
- * Infrastructure: Summary Aggregator
3
- * Merges multiple TraceSummaries into a composite summary
4
- * Used by MultiAgentOrchestrator to aggregate agent summaries
2
+ * Summary Aggregator
3
+ * Merges multiple trace summaries into a composite summary
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
5
6
  */
6
7
  import type { TraceSummary } from './trace-summary.js';
7
8
  export interface CompositeSummary {
8
9
  runId: string;
9
10
  operation: string;
10
- agentName: string;
11
- filesChanged: string[];
12
- filesCreated: string[];
13
- filesDeleted: string[];
14
- reasoningSteps: TraceSummary['reasoningSteps'];
15
- validationChecks: TraceSummary['validationChecks'];
16
- metrics: TraceSummary['metrics'];
17
- reviewNeeded: TraceSummary['reviewNeeded'];
18
- outcome: TraceSummary['outcome'];
19
- errors?: string[];
20
- warnings?: string[];
21
- agentSummaries: Array<{
11
+ agents: string[];
12
+ totalDuration: number;
13
+ success: boolean;
14
+ summaries: Array<{
22
15
  agent: string;
23
- runId: string;
24
16
  summary: TraceSummary;
17
+ runId?: string;
25
18
  }>;
26
- phaseOrder: string[];
19
+ filesAffected: string[];
20
+ filesChanged?: string[];
21
+ filesCreated?: string[];
22
+ filesDeleted?: string[];
23
+ errors: string[];
24
+ warnings?: string[];
25
+ validationChecks?: any[];
26
+ metrics?: Record<string, any>;
27
+ startTime: number;
28
+ endTime?: number;
27
29
  }
28
30
  /**
29
- * Aggregate multiple agent summaries into a composite summary
31
+ * Summary aggregator instance
30
32
  */
31
- export declare class SummaryAggregator {
33
+ declare class SummaryAggregatorImpl {
32
34
  /**
33
- * Merge multiple summaries into a composite summary
35
+ * Merge multiple trace summaries into a composite summary
34
36
  */
35
- mergeSummaries(summaries: Array<{
37
+ mergeSummaries(agentSummaries: Array<{
36
38
  agent: string;
37
39
  summary: TraceSummary;
38
40
  runId?: string;
39
41
  }>, unifiedRunId: string, operation: string): CompositeSummary;
40
42
  }
41
- export declare const summaryAggregator: SummaryAggregator;
43
+ export declare const summaryAggregator: SummaryAggregatorImpl;
44
+ export {};
42
45
  //# sourceMappingURL=summary-aggregator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summary-aggregator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC/C,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACnD,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,EAAE,KAAK,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,YAAY,CAAC;KACvB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,cAAc,CACZ,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC1E,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,gBAAgB;CA8JpB;AAGD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
1
+ {"version":3,"file":"summary-aggregator.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,YAAY,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,cAAM,qBAAqB;IACzB;;OAEG;IACH,cAAc,CACZ,cAAc,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC/E,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,gBAAgB;CA+DpB;AAED,eAAO,MAAM,iBAAiB,uBAA8B,CAAC"}