codehere 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of codehere might be problematic. Click here for more details.

Files changed (297) hide show
  1. package/README.md +223 -42
  2. package/dist/application/agents/documentation-agent.d.ts +24 -0
  3. package/dist/application/agents/documentation-agent.d.ts.map +1 -0
  4. package/dist/application/agents/documentation-agent.js +399 -0
  5. package/dist/application/agents/documentation-agent.js.map +1 -0
  6. package/dist/application/agents/execution-agent.d.ts +11 -0
  7. package/dist/application/agents/execution-agent.d.ts.map +1 -1
  8. package/dist/application/agents/execution-agent.js +289 -80
  9. package/dist/application/agents/execution-agent.js.map +1 -1
  10. package/dist/application/agents/multi-agent-orchestrator.d.ts +3 -0
  11. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  12. package/dist/application/agents/multi-agent-orchestrator.js +86 -0
  13. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  14. package/dist/application/agents/planning-agent.d.ts +3 -0
  15. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  16. package/dist/application/agents/planning-agent.js +132 -64
  17. package/dist/application/agents/planning-agent.js.map +1 -1
  18. package/dist/application/agents/product-requirements-agent.d.ts +21 -0
  19. package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
  20. package/dist/application/agents/product-requirements-agent.js +247 -0
  21. package/dist/application/agents/product-requirements-agent.js.map +1 -0
  22. package/dist/application/agents/validation-agent.d.ts +5 -1
  23. package/dist/application/agents/validation-agent.d.ts.map +1 -1
  24. package/dist/application/agents/validation-agent.js +156 -21
  25. package/dist/application/agents/validation-agent.js.map +1 -1
  26. package/dist/application/services/dependency-container.d.ts +22 -2
  27. package/dist/application/services/dependency-container.d.ts.map +1 -1
  28. package/dist/application/services/dependency-container.js +144 -6
  29. package/dist/application/services/dependency-container.js.map +1 -1
  30. package/dist/application/services/intelligent-router.d.ts +13 -0
  31. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  32. package/dist/application/services/intelligent-router.js +300 -87
  33. package/dist/application/services/intelligent-router.js.map +1 -1
  34. package/dist/application/use-cases/ask-question-use-case.d.ts +19 -0
  35. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  36. package/dist/application/use-cases/ask-question-use-case.js +125 -46
  37. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  38. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
  39. package/dist/application/use-cases/edit-file-use-case.js +16 -1
  40. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  41. package/dist/domain/entities/documentation.d.ts +35 -0
  42. package/dist/domain/entities/documentation.d.ts.map +1 -0
  43. package/dist/domain/entities/documentation.js +6 -0
  44. package/dist/domain/entities/documentation.js.map +1 -0
  45. package/dist/domain/entities/product-requirements.d.ts +50 -0
  46. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  47. package/dist/domain/entities/product-requirements.js +6 -0
  48. package/dist/domain/entities/product-requirements.js.map +1 -0
  49. package/dist/domain/entities/task.d.ts +152 -0
  50. package/dist/domain/entities/task.d.ts.map +1 -0
  51. package/dist/domain/entities/task.js +61 -0
  52. package/dist/domain/entities/task.js.map +1 -0
  53. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  54. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  55. package/dist/domain/interfaces/agent.interface.js +6 -0
  56. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  57. package/dist/domain/services/environment-mode-manager.d.ts +18 -0
  58. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  59. package/dist/domain/services/environment-mode-manager.js +37 -0
  60. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  61. package/dist/domain/services/risk-tier-detector.d.ts +18 -0
  62. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  63. package/dist/domain/services/risk-tier-detector.js +65 -0
  64. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  65. package/dist/formatter.d.ts.map +1 -1
  66. package/dist/formatter.js +10 -3
  67. package/dist/formatter.js.map +1 -1
  68. package/dist/index.js +103 -129
  69. package/dist/index.js.map +1 -1
  70. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  71. package/dist/infrastructure/ai/cohere-ai-service.js +15 -2
  72. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  73. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  74. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  75. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  76. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  77. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  78. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  79. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  80. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  81. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  82. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  83. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  84. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  85. package/dist/infrastructure/cache/response-cache.d.ts +86 -0
  86. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  87. package/dist/infrastructure/cache/response-cache.js +224 -0
  88. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  89. package/dist/infrastructure/context/conversation-context.d.ts +58 -0
  90. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  91. package/dist/infrastructure/context/conversation-context.js +170 -0
  92. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  93. package/dist/infrastructure/context/session-manager.d.ts +26 -0
  94. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  95. package/dist/infrastructure/context/session-manager.js +98 -0
  96. package/dist/infrastructure/context/session-manager.js.map +1 -0
  97. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  98. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  99. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  100. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  101. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  102. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  103. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  104. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  105. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  106. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  107. package/dist/infrastructure/governance/policy-as-code.js +6 -8
  108. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  109. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  110. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  111. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  112. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  113. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  114. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  115. package/dist/infrastructure/providers/cohere-provider.js +359 -0
  116. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  117. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  118. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  119. package/dist/infrastructure/providers/fake-provider.js +130 -0
  120. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  121. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  122. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  123. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  124. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  125. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  126. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  127. package/dist/infrastructure/providers/model-config.types.js +9 -0
  128. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  129. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  130. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  131. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  132. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  133. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  134. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  135. package/dist/infrastructure/providers/openai-provider.js +413 -0
  136. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  137. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  138. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  139. package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
  140. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  141. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  142. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  143. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  144. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  145. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  146. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  147. package/dist/infrastructure/providers/provider-registry.js +88 -0
  148. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  149. package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
  150. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  151. package/dist/infrastructure/storage/task-helpers.js +157 -0
  152. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  153. package/dist/infrastructure/storage/task-repository.d.ts +67 -0
  154. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  155. package/dist/infrastructure/storage/task-repository.js +205 -0
  156. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  157. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  158. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  159. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  160. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  161. package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
  162. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  163. package/dist/infrastructure/ux/capability-boundaries.js +167 -0
  164. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  165. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
  166. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  167. package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
  168. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  169. package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
  170. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  171. package/dist/infrastructure/ux/feedback-prompt.js +181 -0
  172. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  173. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
  174. package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
  175. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
  176. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  177. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  178. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  179. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  180. package/dist/infrastructure/ux/progress-indicator.d.ts +2 -1
  181. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  182. package/dist/infrastructure/ux/progress-indicator.js +13 -3
  183. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  184. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  185. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  186. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  187. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  188. package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
  189. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  190. package/dist/infrastructure/validation/agent-feedback.js +227 -0
  191. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  192. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  193. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  194. package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
  195. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  196. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  197. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  198. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  199. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  200. package/dist/infrastructure/validation/review-handler.d.ts +54 -0
  201. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  202. package/dist/infrastructure/validation/review-handler.js +206 -0
  203. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  204. package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
  205. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  206. package/dist/infrastructure/validation/summary-aggregator.js +156 -0
  207. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  208. package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
  209. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  210. package/dist/infrastructure/validation/summary-extractor.js +102 -0
  211. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  212. package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
  213. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  214. package/dist/infrastructure/validation/trace-summary.js +371 -0
  215. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  216. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  217. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  218. package/dist/infrastructure/validation/trust-config.js +113 -0
  219. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  220. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  221. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  222. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  223. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  224. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -9
  225. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  226. package/dist/infrastructure/xai/cot-visualizer.js +6 -9
  227. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  228. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  229. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  230. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  231. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  232. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  233. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  234. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  235. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  236. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  237. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  238. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  239. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  240. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  241. package/dist/presentation/cli/commands/ask-command.js +84 -2
  242. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  243. package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
  244. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  245. package/dist/presentation/cli/commands/docs-command.js +196 -0
  246. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  247. package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
  248. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  249. package/dist/presentation/cli/commands/fix-command.js +309 -0
  250. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  251. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  252. package/dist/presentation/cli/commands/help-command.js +2 -0
  253. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  254. package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
  255. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  256. package/dist/presentation/cli/commands/orchestrate-command.js +53 -0
  257. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  258. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  259. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  260. package/dist/presentation/cli/commands/plan-command.js +80 -3
  261. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  262. package/dist/presentation/cli/commands/product-command.d.ts +12 -0
  263. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  264. package/dist/presentation/cli/commands/product-command.js +188 -0
  265. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  266. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  267. package/dist/presentation/cli/commands/react-command.js +3 -1
  268. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  269. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  270. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  271. package/dist/presentation/cli/commands/review-command.js +22 -0
  272. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  273. package/dist/presentation/cli/commands/run-command.d.ts +15 -0
  274. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  275. package/dist/presentation/cli/commands/run-command.js +29 -0
  276. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  277. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  278. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  279. package/dist/presentation/cli/commands/smart-command.js +92 -6
  280. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  281. package/dist/presentation/cli/commands/status-command.d.ts +11 -0
  282. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  283. package/dist/presentation/cli/commands/status-command.js +176 -0
  284. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  285. package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
  286. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  287. package/dist/presentation/cli/commands/suggest-command.js +25 -0
  288. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  289. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  290. package/dist/presentation/cli/error-display.js +43 -0
  291. package/dist/presentation/cli/error-display.js.map +1 -1
  292. package/dist/session.js +19 -2
  293. package/dist/session.js.map +1 -1
  294. package/dist/ui.d.ts.map +1 -1
  295. package/dist/ui.js +8 -5
  296. package/dist/ui.js.map +1 -1
  297. package/package.json +10 -2
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Infrastructure: Review Handler
3
+ * Handles --review flag behavior: pause, display summary, ask yes/no
4
+ */
5
+ import * as readline from 'readline';
6
+ import { colors, newline, separator } from '../../ui.js';
7
+ import { traceSummaryFormatter } from './trace-summary.js';
8
+ /**
9
+ * Review Handler
10
+ * Manages the review flow when --review flag is enabled
11
+ */
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
+ }
72
+ /**
73
+ * Prompt user for approval (yes/no)
74
+ */
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
+ }
131
+ /**
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'
171
+ */
172
+ async getReviewDecision(summary, reviewRequested) {
173
+ // Case 1: Review not requested → not_required
174
+ if (!reviewRequested) {
175
+ return {
176
+ approved: true,
177
+ proceed: true,
178
+ userAction: 'not_required',
179
+ };
180
+ }
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();
206
+ //# sourceMappingURL=review-handler.js.map
@@ -0,0 +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;;O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,EAAE,IAAI;gBACd,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,cAAc;aAC3B,CAAC;QACJ,CAAC;QAED,qEAAqE;QACrE,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAEvD,IAAI,YAAY,EAAE,CAAC;YACjB,6EAA6E;YAC7E,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,wEAAwE;YACxE,wDAAwD;YACxD,8FAA8F;YAC9F,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM;gBAC7C,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,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"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Infrastructure: Summary Aggregator
3
+ * Merges multiple TraceSummaries into a composite summary
4
+ * Used by MultiAgentOrchestrator to aggregate agent summaries
5
+ */
6
+ import type { TraceSummary } from './trace-summary.js';
7
+ export interface CompositeSummary {
8
+ runId: string;
9
+ 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<{
22
+ agent: string;
23
+ runId: string;
24
+ summary: TraceSummary;
25
+ }>;
26
+ phaseOrder: string[];
27
+ }
28
+ /**
29
+ * Aggregate multiple agent summaries into a composite summary
30
+ */
31
+ export declare class SummaryAggregator {
32
+ /**
33
+ * Merge multiple summaries into a composite summary
34
+ */
35
+ mergeSummaries(summaries: Array<{
36
+ agent: string;
37
+ summary: TraceSummary;
38
+ runId?: string;
39
+ }>, unifiedRunId: string, operation: string): CompositeSummary;
40
+ }
41
+ export declare const summaryAggregator: SummaryAggregator;
42
+ //# sourceMappingURL=summary-aggregator.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Infrastructure: Summary Aggregator
3
+ * Merges multiple TraceSummaries into a composite summary
4
+ * Used by MultiAgentOrchestrator to aggregate agent summaries
5
+ */
6
+ /**
7
+ * Aggregate multiple agent summaries into a composite summary
8
+ */
9
+ export class SummaryAggregator {
10
+ /**
11
+ * Merge multiple summaries into a composite summary
12
+ */
13
+ mergeSummaries(summaries, unifiedRunId, operation) {
14
+ if (summaries.length === 0) {
15
+ // Return empty summary structure
16
+ return {
17
+ runId: unifiedRunId,
18
+ operation,
19
+ agentName: 'multi-agent-orchestrator',
20
+ filesChanged: [],
21
+ filesCreated: [],
22
+ filesDeleted: [],
23
+ reasoningSteps: [],
24
+ validationChecks: [],
25
+ metrics: {
26
+ duration: 0,
27
+ operationsCount: 0,
28
+ },
29
+ reviewNeeded: {
30
+ required: false,
31
+ reasons: [],
32
+ },
33
+ outcome: 'success',
34
+ agentSummaries: [],
35
+ phaseOrder: [],
36
+ };
37
+ }
38
+ // Aggregate files
39
+ const allFilesChanged = new Set();
40
+ const allFilesCreated = new Set();
41
+ const allFilesDeleted = new Set();
42
+ // Aggregate reasoning steps
43
+ const allReasoningSteps = [];
44
+ // Aggregate validation checks
45
+ const allValidationChecks = [];
46
+ // Aggregate metrics
47
+ let totalTokens = 0;
48
+ let totalDuration = 0;
49
+ let totalOperations = 0;
50
+ let totalFilesAnalyzed = 0;
51
+ // Aggregate errors and warnings
52
+ const allErrors = [];
53
+ const allWarnings = [];
54
+ // Track review needs
55
+ const reviewReasons = [];
56
+ let highestRiskLevel = 'low';
57
+ // Determine overall outcome
58
+ let hasFailures = false;
59
+ let hasPartialSuccess = false;
60
+ let needsReview = false;
61
+ const phaseOrder = [];
62
+ for (const { agent, summary, runId } of summaries) {
63
+ if (!summary)
64
+ continue;
65
+ phaseOrder.push(agent);
66
+ // Aggregate files
67
+ summary.filesChanged.forEach(f => allFilesChanged.add(f));
68
+ summary.filesCreated.forEach(f => allFilesCreated.add(f));
69
+ summary.filesDeleted.forEach(f => allFilesDeleted.add(f));
70
+ // Aggregate reasoning steps (limit to key steps per agent)
71
+ allReasoningSteps.push(...summary.reasoningSteps.slice(0, 3));
72
+ // Aggregate validation checks
73
+ allValidationChecks.push(...summary.validationChecks);
74
+ // Aggregate metrics
75
+ if (summary.metrics.tokensUsed) {
76
+ totalTokens += summary.metrics.tokensUsed;
77
+ }
78
+ totalDuration += summary.metrics.duration;
79
+ totalOperations += summary.metrics.operationsCount;
80
+ if (summary.metrics.filesAnalyzed) {
81
+ totalFilesAnalyzed += summary.metrics.filesAnalyzed;
82
+ }
83
+ // Aggregate errors and warnings
84
+ if (summary.errors) {
85
+ allErrors.push(...summary.errors);
86
+ }
87
+ if (summary.warnings) {
88
+ allWarnings.push(...summary.warnings);
89
+ }
90
+ // Track review needs
91
+ if (summary.reviewNeeded.required) {
92
+ needsReview = true;
93
+ reviewReasons.push(...summary.reviewNeeded.reasons.map(r => `${agent}: ${r}`));
94
+ // Determine highest risk level
95
+ const riskLevel = summary.reviewNeeded.riskLevel || 'medium';
96
+ const riskOrder = { low: 1, medium: 2, high: 3, critical: 4 };
97
+ if (riskOrder[riskLevel] > riskOrder[highestRiskLevel]) {
98
+ highestRiskLevel = riskLevel;
99
+ }
100
+ }
101
+ // Track outcomes
102
+ if (summary.outcome === 'failure') {
103
+ hasFailures = true;
104
+ }
105
+ else if (summary.outcome === 'partial_success') {
106
+ hasPartialSuccess = true;
107
+ }
108
+ }
109
+ // Determine overall outcome
110
+ let overallOutcome = 'success';
111
+ if (hasFailures) {
112
+ overallOutcome = 'failure';
113
+ }
114
+ else if (hasPartialSuccess || needsReview) {
115
+ overallOutcome = needsReview ? 'needs_review' : 'partial_success';
116
+ }
117
+ // Deduplicate errors and warnings
118
+ const uniqueErrors = Array.from(new Set(allErrors));
119
+ const uniqueWarnings = Array.from(new Set(allWarnings));
120
+ return {
121
+ runId: unifiedRunId,
122
+ operation,
123
+ agentName: 'multi-agent-orchestrator',
124
+ filesChanged: Array.from(allFilesChanged),
125
+ filesCreated: Array.from(allFilesCreated),
126
+ filesDeleted: Array.from(allFilesDeleted),
127
+ reasoningSteps: allReasoningSteps.slice(0, 10), // Limit to top 10 steps
128
+ validationChecks: allValidationChecks,
129
+ metrics: {
130
+ tokensUsed: totalTokens > 0 ? totalTokens : undefined,
131
+ duration: totalDuration,
132
+ operationsCount: totalOperations,
133
+ filesAnalyzed: totalFilesAnalyzed > 0 ? totalFilesAnalyzed : undefined,
134
+ },
135
+ reviewNeeded: {
136
+ required: needsReview,
137
+ reasons: reviewReasons,
138
+ riskLevel: highestRiskLevel,
139
+ },
140
+ outcome: overallOutcome,
141
+ errors: uniqueErrors.length > 0 ? uniqueErrors : undefined,
142
+ warnings: uniqueWarnings.length > 0 ? uniqueWarnings : undefined,
143
+ agentSummaries: summaries
144
+ .filter(s => s.summary)
145
+ .map(s => ({
146
+ agent: s.agent,
147
+ runId: s.runId || s.summary.runId,
148
+ summary: s.summary,
149
+ })),
150
+ phaseOrder,
151
+ };
152
+ }
153
+ }
154
+ // Singleton instance
155
+ export const summaryAggregator = new SummaryAggregator();
156
+ //# sourceMappingURL=summary-aggregator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary-aggregator.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH;;GAEG;AACH,MAAM,OAAO,iBA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,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;YAChE,cAAc,EAAE,SAAS;iBACtB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;iBACtB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACT,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAQ,CAAC,KAAK;gBAClC,OAAO,EAAE,CAAC,CAAC,OAAQ;aACpB,CAAC,CAAC;YACL,UAAU;SACX,CAAC;IACJ,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Infrastructure: Summary Extractor
3
+ * Extracts summaries from different response types for review flow
4
+ * Priority: compositeSummary > validationSummary > routingDecision
5
+ */
6
+ import type { TraceSummary } from './trace-summary.js';
7
+ import type { CompositeSummary } from './summary-aggregator.js';
8
+ export interface SummarySource {
9
+ summary: TraceSummary | CompositeSummary;
10
+ source: 'composite' | 'validation' | 'routing';
11
+ }
12
+ /**
13
+ * Extract summary from various response types
14
+ * Priority order: compositeSummary > validationSummary > routingDecision.summary
15
+ */
16
+ export declare class SummaryExtractor {
17
+ /**
18
+ * Extract summary from orchestration response
19
+ */
20
+ extractFromOrchestration(result: {
21
+ compositeSummary?: CompositeSummary;
22
+ validation?: {
23
+ validationSummary?: TraceSummary;
24
+ } | any;
25
+ execution?: {
26
+ validationSummary?: TraceSummary;
27
+ } | any;
28
+ plan?: {
29
+ validationSummary?: TraceSummary;
30
+ } | any;
31
+ [key: string]: any;
32
+ }): SummarySource | null;
33
+ /**
34
+ * Extract summary from planning response
35
+ */
36
+ extractFromPlanning(result: {
37
+ validationSummary?: TraceSummary;
38
+ }): SummarySource | null;
39
+ /**
40
+ * Extract summary from routing response
41
+ */
42
+ extractFromRouting(result: {
43
+ routingDecision?: {
44
+ summary?: TraceSummary;
45
+ selectedAgent?: string;
46
+ confidence?: number;
47
+ selectionReason?: string;
48
+ };
49
+ result?: {
50
+ validationSummary?: TraceSummary;
51
+ };
52
+ }): SummarySource | null;
53
+ /**
54
+ * Convert CompositeSummary to TraceSummary format
55
+ */
56
+ private compositeToTraceSummary;
57
+ }
58
+ export declare const summaryExtractor: SummaryExtractor;
59
+ //# sourceMappingURL=summary-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary-extractor.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,GAAG,gBAAgB,CAAC;IACzC,MAAM,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;CAChD;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,wBAAwB,CAAC,MAAM,EAAE;QAC/B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,UAAU,CAAC,EAAE;YAAE,iBAAiB,CAAC,EAAE,YAAY,CAAA;SAAE,GAAG,GAAG,CAAC;QACxD,SAAS,CAAC,EAAE;YAAE,iBAAiB,CAAC,EAAE,YAAY,CAAA;SAAE,GAAG,GAAG,CAAC;QACvD,IAAI,CAAC,EAAE;YAAE,iBAAiB,CAAC,EAAE,YAAY,CAAA;SAAE,GAAG,GAAG,CAAC;QAClD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,GAAG,aAAa,GAAG,IAAI;IAsCxB;;OAEG;IACH,mBAAmB,CAAC,MAAM,EAAE;QAC1B,iBAAiB,CAAC,EAAE,YAAY,CAAC;KAClC,GAAG,aAAa,GAAG,IAAI;IAUxB;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE;QACzB,eAAe,CAAC,EAAE;YAChB,OAAO,CAAC,EAAE,YAAY,CAAC;YACvB,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;QACF,MAAM,CAAC,EAAE;YACP,iBAAiB,CAAC,EAAE,YAAY,CAAC;SAClC,CAAC;KACH,GAAG,aAAa,GAAG,IAAI;IAoBxB;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAiBhC;AAGD,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Infrastructure: Summary Extractor
3
+ * Extracts summaries from different response types for review flow
4
+ * Priority: compositeSummary > validationSummary > routingDecision
5
+ */
6
+ /**
7
+ * Extract summary from various response types
8
+ * Priority order: compositeSummary > validationSummary > routingDecision.summary
9
+ */
10
+ export class SummaryExtractor {
11
+ /**
12
+ * Extract summary from orchestration response
13
+ */
14
+ extractFromOrchestration(result) {
15
+ // Priority 1: Composite summary (aggregated from all agents)
16
+ if (result.compositeSummary) {
17
+ // Convert CompositeSummary to TraceSummary format for review handler
18
+ const traceSummary = this.compositeToTraceSummary(result.compositeSummary);
19
+ return {
20
+ summary: traceSummary,
21
+ source: 'composite',
22
+ };
23
+ }
24
+ // Priority 2: Validation summary
25
+ if (result.validation?.validationSummary) {
26
+ return {
27
+ summary: result.validation.validationSummary,
28
+ source: 'validation',
29
+ };
30
+ }
31
+ // Priority 3: Execution summary
32
+ if (result.execution?.validationSummary) {
33
+ return {
34
+ summary: result.execution.validationSummary,
35
+ source: 'validation',
36
+ };
37
+ }
38
+ // Priority 4: Planning summary
39
+ if (result.plan?.validationSummary) {
40
+ return {
41
+ summary: result.plan.validationSummary,
42
+ source: 'validation',
43
+ };
44
+ }
45
+ return null;
46
+ }
47
+ /**
48
+ * Extract summary from planning response
49
+ */
50
+ extractFromPlanning(result) {
51
+ if (result.validationSummary) {
52
+ return {
53
+ summary: result.validationSummary,
54
+ source: 'validation',
55
+ };
56
+ }
57
+ return null;
58
+ }
59
+ /**
60
+ * Extract summary from routing response
61
+ */
62
+ extractFromRouting(result) {
63
+ // Priority 1: Validation summary from executed agent
64
+ if (result.result?.validationSummary) {
65
+ return {
66
+ summary: result.result.validationSummary,
67
+ source: 'validation',
68
+ };
69
+ }
70
+ // Priority 2: Routing decision summary (if available)
71
+ if (result.routingDecision?.summary) {
72
+ return {
73
+ summary: result.routingDecision.summary,
74
+ source: 'routing',
75
+ };
76
+ }
77
+ return null;
78
+ }
79
+ /**
80
+ * Convert CompositeSummary to TraceSummary format
81
+ */
82
+ compositeToTraceSummary(composite) {
83
+ return {
84
+ runId: composite.runId,
85
+ operation: composite.operation,
86
+ agentName: composite.agentName,
87
+ filesChanged: composite.filesChanged,
88
+ filesCreated: composite.filesCreated,
89
+ filesDeleted: composite.filesDeleted,
90
+ reasoningSteps: composite.reasoningSteps,
91
+ validationChecks: composite.validationChecks,
92
+ metrics: composite.metrics,
93
+ reviewNeeded: composite.reviewNeeded,
94
+ outcome: composite.outcome,
95
+ errors: composite.errors,
96
+ warnings: composite.warnings,
97
+ };
98
+ }
99
+ }
100
+ // Singleton instance
101
+ export const summaryExtractor = new SummaryExtractor();
102
+ //# sourceMappingURL=summary-extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary-extractor.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IACH,wBAAwB,CAAC,MAMxB;QACC,6DAA6D;QAC7D,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC5B,qEAAqE;YACrE,MAAM,YAAY,GAAG,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;Y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