codehere 0.4.0 → 0.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +7 -0
  2. package/dist/application/agents/execution-agent.js +2 -2
  3. package/dist/application/agents/execution-agent.js.map +1 -1
  4. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  5. package/dist/application/agents/planning-agent.js +16 -8
  6. package/dist/application/agents/planning-agent.js.map +1 -1
  7. package/dist/application/agents/validation-agent.js +2 -2
  8. package/dist/application/agents/validation-agent.js.map +1 -1
  9. package/dist/application/services/dependency-container.d.ts +30 -6
  10. package/dist/application/services/dependency-container.d.ts.map +1 -1
  11. package/dist/application/services/dependency-container.js +75 -43
  12. package/dist/application/services/dependency-container.js.map +1 -1
  13. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  14. package/dist/application/services/intelligent-router.js +6 -3
  15. package/dist/application/services/intelligent-router.js.map +1 -1
  16. package/dist/domain/entities/task.d.ts.map +1 -1
  17. package/dist/domain/entities/task.js +1 -1
  18. package/dist/domain/entities/task.js.map +1 -1
  19. package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
  20. package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
  21. package/dist/domain/errors/embeddings-not-found-error.js +13 -0
  22. package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
  23. package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
  24. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
  25. package/dist/domain/services/environment-mode-manager.d.ts +4 -10
  26. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
  27. package/dist/domain/services/environment-mode-manager.js +7 -22
  28. package/dist/domain/services/environment-mode-manager.js.map +1 -1
  29. package/dist/domain/services/risk-tier-detector.d.ts +8 -9
  30. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
  31. package/dist/domain/services/risk-tier-detector.js +53 -40
  32. package/dist/domain/services/risk-tier-detector.js.map +1 -1
  33. package/dist/embed.d.ts.map +1 -1
  34. package/dist/embed.js +18 -8
  35. package/dist/embed.js.map +1 -1
  36. package/dist/index.js +308 -48
  37. package/dist/index.js.map +1 -1
  38. package/dist/infrastructure/ai/cohere-ai-service.js +3 -3
  39. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  40. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
  41. package/dist/infrastructure/ai/provider-ai-service.js +6 -6
  42. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
  43. package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
  44. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
  45. package/dist/infrastructure/cache/query-result-cache.js +40 -112
  46. package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
  47. package/dist/infrastructure/cache/response-cache.d.ts +10 -78
  48. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
  49. package/dist/infrastructure/cache/response-cache.js +22 -198
  50. package/dist/infrastructure/cache/response-cache.js.map +1 -1
  51. package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
  52. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
  53. package/dist/infrastructure/cache/security-scan-cache.js +25 -102
  54. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
  55. package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
  56. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
  57. package/dist/infrastructure/completion/bash-completion.js +11 -87
  58. package/dist/infrastructure/completion/bash-completion.js.map +1 -1
  59. package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
  60. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
  61. package/dist/infrastructure/completion/fish-completion.js +15 -58
  62. package/dist/infrastructure/completion/fish-completion.js.map +1 -1
  63. package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
  64. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
  65. package/dist/infrastructure/completion/zsh-completion.js +18 -73
  66. package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
  67. package/dist/infrastructure/config/config-manager.js +2 -2
  68. package/dist/infrastructure/config/config-manager.js.map +1 -1
  69. package/dist/infrastructure/context/conversation-context.d.ts +27 -31
  70. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
  71. package/dist/infrastructure/context/conversation-context.js +94 -136
  72. package/dist/infrastructure/context/conversation-context.js.map +1 -1
  73. package/dist/infrastructure/context/session-manager.d.ts +27 -11
  74. package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
  75. package/dist/infrastructure/context/session-manager.js +69 -73
  76. package/dist/infrastructure/context/session-manager.js.map +1 -1
  77. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
  78. package/dist/infrastructure/providers/cohere-provider.js +102 -17
  79. package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
  80. package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
  81. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
  82. package/dist/infrastructure/providers/openrouter-provider.js +399 -0
  83. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
  84. package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
  85. package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
  86. package/dist/infrastructure/serialization/toon-serializer.js +119 -0
  87. package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
  88. package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
  89. package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
  90. package/dist/infrastructure/storage/embeddings-path.js +37 -0
  91. package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
  92. package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
  93. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
  94. package/dist/infrastructure/storage/plan-repository.js +36 -73
  95. package/dist/infrastructure/storage/plan-repository.js.map +1 -1
  96. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
  97. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  98. package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
  99. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  100. package/dist/infrastructure/storage/task-helpers.d.ts +11 -0
  101. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
  102. package/dist/infrastructure/storage/task-helpers.js +47 -7
  103. package/dist/infrastructure/storage/task-helpers.js.map +1 -1
  104. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
  105. package/dist/infrastructure/storage/task-repository.js.map +1 -1
  106. package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
  107. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
  108. package/dist/infrastructure/ux/capability-boundaries.js +23 -148
  109. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
  110. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
  111. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
  112. package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
  113. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
  114. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
  115. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
  116. package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
  117. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
  118. package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
  119. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
  120. package/dist/infrastructure/ux/feature-discovery.js +5 -181
  121. package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
  122. package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
  123. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
  124. package/dist/infrastructure/ux/feedback-prompt.js +30 -166
  125. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
  126. package/dist/infrastructure/ux/progress-indicator.d.ts +3 -5
  127. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  128. package/dist/infrastructure/ux/progress-indicator.js +34 -49
  129. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  130. package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
  131. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
  132. package/dist/infrastructure/ux/review-checkpoint.js +33 -80
  133. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
  134. package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
  135. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
  136. package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
  137. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
  138. package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
  139. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
  140. package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
  141. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
  142. package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
  143. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
  144. package/dist/infrastructure/validation/agent-feedback.js +32 -204
  145. package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
  146. package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
  147. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
  148. package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
  149. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
  150. package/dist/infrastructure/validation/review-handler.d.ts +13 -41
  151. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
  152. package/dist/infrastructure/validation/review-handler.js +23 -189
  153. package/dist/infrastructure/validation/review-handler.js.map +1 -1
  154. package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
  155. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
  156. package/dist/infrastructure/validation/summary-aggregator.js +47 -133
  157. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
  158. package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
  159. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
  160. package/dist/infrastructure/validation/summary-extractor.js +32 -89
  161. package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
  162. package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
  163. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
  164. package/dist/infrastructure/validation/trace-summary.js +37 -356
  165. package/dist/infrastructure/validation/trace-summary.js.map +1 -1
  166. package/dist/monitoring.d.ts +1 -1
  167. package/dist/monitoring.d.ts.map +1 -1
  168. package/dist/monitoring.js +12 -9
  169. package/dist/monitoring.js.map +1 -1
  170. package/dist/parallel-processor.d.ts.map +1 -1
  171. package/dist/parallel-processor.js +124 -45
  172. package/dist/parallel-processor.js.map +1 -1
  173. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  174. package/dist/presentation/cli/commands/ask-command.js +185 -128
  175. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  176. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  177. package/dist/presentation/cli/commands/config-command.js +8 -6
  178. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  179. package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
  180. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
  181. package/dist/presentation/cli/commands/docs-command.js +13 -184
  182. package/dist/presentation/cli/commands/docs-command.js.map +1 -1
  183. package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
  184. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
  185. package/dist/presentation/cli/commands/fix-command.js +25 -281
  186. package/dist/presentation/cli/commands/fix-command.js.map +1 -1
  187. package/dist/presentation/cli/commands/models-command.d.ts +13 -0
  188. package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
  189. package/dist/presentation/cli/commands/models-command.js +194 -0
  190. package/dist/presentation/cli/commands/models-command.js.map +1 -0
  191. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  192. package/dist/presentation/cli/commands/orchestrate-command.js +15 -7
  193. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  194. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  195. package/dist/presentation/cli/commands/plan-command.js +9 -6
  196. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  197. package/dist/presentation/cli/commands/product-command.d.ts +6 -4
  198. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
  199. package/dist/presentation/cli/commands/product-command.js +12 -178
  200. package/dist/presentation/cli/commands/product-command.js.map +1 -1
  201. package/dist/presentation/cli/commands/review-command.d.ts +7 -7
  202. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
  203. package/dist/presentation/cli/commands/review-command.js +148 -16
  204. package/dist/presentation/cli/commands/review-command.js.map +1 -1
  205. package/dist/presentation/cli/commands/run-command.d.ts +6 -8
  206. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
  207. package/dist/presentation/cli/commands/run-command.js +182 -23
  208. package/dist/presentation/cli/commands/run-command.js.map +1 -1
  209. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  210. package/dist/presentation/cli/commands/setup-command.js +15 -0
  211. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  212. package/dist/presentation/cli/commands/smart-command.js +1 -1
  213. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  214. package/dist/presentation/cli/commands/status-command.d.ts +3 -0
  215. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
  216. package/dist/presentation/cli/commands/status-command.js +147 -156
  217. package/dist/presentation/cli/commands/status-command.js.map +1 -1
  218. package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
  219. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
  220. package/dist/presentation/cli/commands/suggest-command.js +132 -19
  221. package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
  222. package/dist/search.d.ts.map +1 -1
  223. package/dist/search.js +6 -1
  224. package/dist/search.js.map +1 -1
  225. package/dist/session.js +1 -1
  226. package/dist/session.js.map +1 -1
  227. package/dist/ui.d.ts +6 -0
  228. package/dist/ui.d.ts.map +1 -1
  229. package/dist/ui.js +35 -1
  230. package/dist/ui.js.map +1 -1
  231. package/package.json +8 -3
@@ -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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AAiB,CACrB,OAAqB,EACrB,eAAwB;QAExB,8CAA8C;QAC9C,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO;gBACL,QAAQ,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"}
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"}
@@ -1,156 +1,70 @@
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
  /**
7
- * Aggregate multiple agent summaries into a composite summary
8
+ * Summary aggregator instance
8
9
  */
9
- export class SummaryAggregator {
10
+ class SummaryAggregatorImpl {
10
11
  /**
11
- * Merge multiple summaries into a composite summary
12
+ * Merge multiple trace summaries into a composite summary
12
13
  */
13
- mergeSummaries(summaries, unifiedRunId, operation) {
14
- if (summaries.length === 0) {
15
- // Return empty summary structure
14
+ mergeSummaries(agentSummaries, unifiedRunId, operation) {
15
+ if (agentSummaries.length === 0) {
16
16
  return {
17
17
  runId: unifiedRunId,
18
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: [],
19
+ agents: [],
20
+ totalDuration: 0,
21
+ success: true,
22
+ summaries: [],
23
+ filesAffected: [],
24
+ errors: [],
25
+ startTime: Date.now(),
36
26
  };
37
27
  }
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;
28
+ // Collect all data
29
+ const agents = [];
30
+ const filesAffected = new Set();
31
+ const errors = [];
32
+ let minStartTime = Infinity;
33
+ let maxEndTime = 0;
34
+ let allSuccess = true;
35
+ for (const { agent, summary } of agentSummaries) {
36
+ agents.push(agent);
37
+ const data = summary.data;
38
+ if (!data.success) {
39
+ allSuccess = false;
77
40
  }
78
- totalDuration += summary.metrics.duration;
79
- totalOperations += summary.metrics.operationsCount;
80
- if (summary.metrics.filesAnalyzed) {
81
- totalFilesAnalyzed += summary.metrics.filesAnalyzed;
41
+ if (data.startTime < minStartTime) {
42
+ minStartTime = data.startTime;
82
43
  }
83
- // Aggregate errors and warnings
84
- if (summary.errors) {
85
- allErrors.push(...summary.errors);
44
+ if (data.endTime && data.endTime > maxEndTime) {
45
+ maxEndTime = data.endTime;
86
46
  }
87
- if (summary.warnings) {
88
- allWarnings.push(...summary.warnings);
47
+ if (data.filesAffected) {
48
+ data.filesAffected.forEach(f => filesAffected.add(f));
89
49
  }
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
- }
50
+ if (data.error) {
51
+ errors.push(`${agent}: ${data.error}`);
100
52
  }
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
53
  }
117
- // Deduplicate errors and warnings
118
- const uniqueErrors = Array.from(new Set(allErrors));
119
- const uniqueWarnings = Array.from(new Set(allWarnings));
120
- return {
54
+ const compositeSummary = {
121
55
  runId: unifiedRunId,
122
56
  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,
57
+ agents,
58
+ totalDuration: maxEndTime > 0 ? maxEndTime - minStartTime : 0,
59
+ success: allSuccess,
60
+ summaries: agentSummaries,
61
+ filesAffected: Array.from(filesAffected),
62
+ errors,
63
+ startTime: minStartTime !== Infinity ? minStartTime : Date.now(),
64
+ endTime: maxEndTime > 0 ? maxEndTime : undefined,
151
65
  };
66
+ return compositeSummary;
152
67
  }
153
68
  }
154
- // Singleton instance
155
- export const summaryAggregator = new SummaryAggregator();
69
+ export const summaryAggregator = new SummaryAggregatorImpl();
156
70
  //# sourceMappingURL=summary-aggregator.js.map
@@ -1 +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,iBAAiB;IAC5B;;OAEG;IACH,cAAc,CACZ,SAA0E,EAC1E,YAAoB,EACpB,SAAiB;QAEjB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,iCAAiC;YACjC,OAAO;gBACL,KAAK,EAAE,YAAY;gBACnB,SAAS;gBACT,SAAS,EAAE,0BAA0B;gBACrC,YAAY,EAAE,EAAE;gBAChB,YAAY,EAAE,EAAE;gBAChB,YAAY,EA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C,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"}
1
+ {"version":3,"file":"summary-aggregator.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/summary-aggregator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2BH;;GAEG;AACH,MAAM,qBAAqB;IACzB;;OAEG;IACH,cAAc,CACZ,cAA+E,EAC/E,YAAoB,EACpB,SAAiB;QAEjB,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO;gBACL,KAAK,EAAE,YAAY;gBACnB,SAAS;gBACT,MAAM,EAAE,EAAE;gBACV,aAAa,EAAE,CAAC;gBAChB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,EAAE;gBACb,aAAa,EAAE,EAAE;gBACjB,MAAM,EAAE,EAAE;gBACV,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC;QACJ,CAAC;QAED,mBAAmB;QACnB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QACxC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,YAAY,GAAG,QAAQ,CAAC;QAC5B,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,IAAI,CAAC;QAEtB,KAAK,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE,CAAC;YAChD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC;YA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