@prowi/deskcheck 0.1.0 → 0.3.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 (181) hide show
  1. package/README.md +67 -12
  2. package/build/cli.js +112 -24
  3. package/build/cli.js.map +1 -1
  4. package/build/{core/config.d.ts → config/loader.d.ts} +9 -1
  5. package/build/config/loader.d.ts.map +1 -0
  6. package/build/{core/config.js → config/loader.js} +4 -2
  7. package/build/config/loader.js.map +1 -0
  8. package/build/config/types.d.ts +45 -0
  9. package/build/config/types.d.ts.map +1 -0
  10. package/build/config/types.js +2 -0
  11. package/build/config/types.js.map +1 -0
  12. package/build/mcp/tools.d.ts +1 -1
  13. package/build/mcp/tools.d.ts.map +1 -1
  14. package/build/mcp/tools.js +35 -25
  15. package/build/mcp/tools.js.map +1 -1
  16. package/build/mcp-server.js +1 -1
  17. package/build/mcp-server.js.map +1 -1
  18. package/build/{agents/executor-prompt.d.ts → prompts/ExecutorPrompt.d.ts} +6 -2
  19. package/build/prompts/ExecutorPrompt.d.ts.map +1 -0
  20. package/build/prompts/ExecutorPrompt.js +111 -0
  21. package/build/prompts/ExecutorPrompt.js.map +1 -0
  22. package/build/prompts/JudgePrompt.d.ts +16 -0
  23. package/build/prompts/JudgePrompt.d.ts.map +1 -0
  24. package/build/prompts/JudgePrompt.js +57 -0
  25. package/build/prompts/JudgePrompt.js.map +1 -0
  26. package/build/prompts/PlannerPrompt.d.ts +12 -0
  27. package/build/prompts/PlannerPrompt.d.ts.map +1 -0
  28. package/build/prompts/PlannerPrompt.js +34 -0
  29. package/build/prompts/PlannerPrompt.js.map +1 -0
  30. package/build/renderers/{json.d.ts → review/JsonRenderer.d.ts} +2 -2
  31. package/build/renderers/review/JsonRenderer.d.ts.map +1 -0
  32. package/build/renderers/{json.js → review/JsonRenderer.js} +1 -1
  33. package/build/renderers/review/JsonRenderer.js.map +1 -0
  34. package/build/renderers/{markdown.d.ts → review/MarkdownRenderer.d.ts} +2 -2
  35. package/build/renderers/review/MarkdownRenderer.d.ts.map +1 -0
  36. package/build/renderers/review/MarkdownRenderer.js +52 -0
  37. package/build/renderers/review/MarkdownRenderer.js.map +1 -0
  38. package/build/renderers/{terminal.d.ts → review/TerminalRenderer.d.ts} +2 -2
  39. package/build/renderers/review/TerminalRenderer.d.ts.map +1 -0
  40. package/build/renderers/{terminal.js → review/TerminalRenderer.js} +36 -14
  41. package/build/renderers/review/TerminalRenderer.js.map +1 -0
  42. package/build/renderers/{watch.d.ts → review/WatchRenderer.d.ts} +2 -2
  43. package/build/renderers/review/WatchRenderer.d.ts.map +1 -0
  44. package/build/renderers/{watch.js → review/WatchRenderer.js} +3 -3
  45. package/build/renderers/review/WatchRenderer.js.map +1 -0
  46. package/build/renderers/shared.d.ts +11 -11
  47. package/build/renderers/shared.d.ts.map +1 -1
  48. package/build/renderers/shared.js +15 -15
  49. package/build/renderers/shared.js.map +1 -1
  50. package/build/renderers/test/TerminalRenderer.d.ts +14 -0
  51. package/build/renderers/test/TerminalRenderer.d.ts.map +1 -0
  52. package/build/renderers/test/TerminalRenderer.js +233 -0
  53. package/build/renderers/test/TerminalRenderer.js.map +1 -0
  54. package/build/server/controllers/ReviewController.d.ts +23 -0
  55. package/build/server/controllers/ReviewController.d.ts.map +1 -0
  56. package/build/server/controllers/ReviewController.js +90 -0
  57. package/build/server/controllers/ReviewController.js.map +1 -0
  58. package/build/server/controllers/TestController.d.ts +2 -0
  59. package/build/server/controllers/TestController.d.ts.map +1 -0
  60. package/build/server/controllers/TestController.js +3 -0
  61. package/build/server/controllers/TestController.js.map +1 -0
  62. package/build/server/middleware/cors.d.ts +9 -0
  63. package/build/server/middleware/cors.d.ts.map +1 -0
  64. package/build/server/middleware/cors.js +18 -0
  65. package/build/server/middleware/cors.js.map +1 -0
  66. package/build/{serve.d.ts → server/server.d.ts} +2 -2
  67. package/build/server/server.d.ts.map +1 -0
  68. package/build/server/server.js +102 -0
  69. package/build/server/server.js.map +1 -0
  70. package/build/server/sse/FileWatcherSSE.d.ts +10 -0
  71. package/build/server/sse/FileWatcherSSE.d.ts.map +1 -0
  72. package/build/server/sse/FileWatcherSSE.js +89 -0
  73. package/build/server/sse/FileWatcherSSE.js.map +1 -0
  74. package/build/services/ExecutorService.d.ts +51 -0
  75. package/build/services/ExecutorService.d.ts.map +1 -0
  76. package/build/services/ExecutorService.js +133 -0
  77. package/build/services/ExecutorService.js.map +1 -0
  78. package/build/services/FindingsParserService.d.ts +18 -0
  79. package/build/services/FindingsParserService.d.ts.map +1 -0
  80. package/build/services/FindingsParserService.js +119 -0
  81. package/build/services/FindingsParserService.js.map +1 -0
  82. package/build/services/criteria/CriteriaService.d.ts +10 -0
  83. package/build/services/criteria/CriteriaService.d.ts.map +1 -0
  84. package/build/services/criteria/CriteriaService.js +10 -0
  85. package/build/services/criteria/CriteriaService.js.map +1 -0
  86. package/build/{core → services/criteria}/glob-matcher.d.ts +1 -1
  87. package/build/services/criteria/glob-matcher.d.ts.map +1 -0
  88. package/build/services/criteria/glob-matcher.js.map +1 -0
  89. package/build/{core → services/criteria}/module-parser.d.ts +13 -1
  90. package/build/services/criteria/module-parser.d.ts.map +1 -0
  91. package/build/{core → services/criteria}/module-parser.js +38 -0
  92. package/build/services/criteria/module-parser.js.map +1 -0
  93. package/build/{core/context-extractor.d.ts → services/review/ReviewContextExtractorService.d.ts} +2 -2
  94. package/build/services/review/ReviewContextExtractorService.d.ts.map +1 -0
  95. package/build/{core/context-extractor.js → services/review/ReviewContextExtractorService.js} +1 -1
  96. package/build/services/review/ReviewContextExtractorService.js.map +1 -0
  97. package/build/{agents/orchestrator.d.ts → services/review/ReviewOrchestratorService.d.ts} +7 -5
  98. package/build/services/review/ReviewOrchestratorService.d.ts.map +1 -0
  99. package/build/services/review/ReviewOrchestratorService.js +187 -0
  100. package/build/services/review/ReviewOrchestratorService.js.map +1 -0
  101. package/build/{core/plan-builder.d.ts → services/review/ReviewPlanBuilderService.d.ts} +5 -4
  102. package/build/services/review/ReviewPlanBuilderService.d.ts.map +1 -0
  103. package/build/{core/plan-builder.js → services/review/ReviewPlanBuilderService.js} +2 -2
  104. package/build/services/review/ReviewPlanBuilderService.js.map +1 -0
  105. package/build/{agents/planner.d.ts → services/review/ReviewPlannerService.d.ts} +5 -4
  106. package/build/services/review/ReviewPlannerService.d.ts.map +1 -0
  107. package/build/{agents/planner.js → services/review/ReviewPlannerService.js} +13 -29
  108. package/build/services/review/ReviewPlannerService.js.map +1 -0
  109. package/build/{core/storage.d.ts → services/review/ReviewStorageService.d.ts} +4 -4
  110. package/build/services/review/ReviewStorageService.d.ts.map +1 -0
  111. package/build/{core/storage.js → services/review/ReviewStorageService.js} +42 -27
  112. package/build/services/review/ReviewStorageService.js.map +1 -0
  113. package/build/services/testing/JudgeService.d.ts +30 -0
  114. package/build/services/testing/JudgeService.d.ts.map +1 -0
  115. package/build/services/testing/JudgeService.js +95 -0
  116. package/build/services/testing/JudgeService.js.map +1 -0
  117. package/build/services/testing/TestDiscoveryService.d.ts +16 -0
  118. package/build/services/testing/TestDiscoveryService.d.ts.map +1 -0
  119. package/build/services/testing/TestDiscoveryService.js +66 -0
  120. package/build/services/testing/TestDiscoveryService.js.map +1 -0
  121. package/build/services/testing/TestRunnerService.d.ts +35 -0
  122. package/build/services/testing/TestRunnerService.d.ts.map +1 -0
  123. package/build/services/testing/TestRunnerService.js +140 -0
  124. package/build/services/testing/TestRunnerService.js.map +1 -0
  125. package/build/services/testing/TestScorerService.d.ts +9 -0
  126. package/build/services/testing/TestScorerService.d.ts.map +1 -0
  127. package/build/services/testing/TestScorerService.js +35 -0
  128. package/build/services/testing/TestScorerService.js.map +1 -0
  129. package/build/services/testing/TestStorageService.d.ts +39 -0
  130. package/build/services/testing/TestStorageService.d.ts.map +1 -0
  131. package/build/services/testing/TestStorageService.js +144 -0
  132. package/build/services/testing/TestStorageService.js.map +1 -0
  133. package/build/types/criteria.d.ts +24 -0
  134. package/build/types/criteria.d.ts.map +1 -0
  135. package/build/{core/types.js → types/criteria.js} +2 -2
  136. package/build/types/criteria.js.map +1 -0
  137. package/build/{core/types.d.ts → types/review.d.ts} +54 -88
  138. package/build/types/review.d.ts.map +1 -0
  139. package/build/types/review.js +2 -0
  140. package/build/types/review.js.map +1 -0
  141. package/build/types/testing.d.ts +109 -0
  142. package/build/types/testing.d.ts.map +1 -0
  143. package/build/types/testing.js +2 -0
  144. package/build/types/testing.js.map +1 -0
  145. package/package.json +1 -1
  146. package/ui/dist/index.html +34 -34
  147. package/build/agents/executor-prompt.d.ts.map +0 -1
  148. package/build/agents/executor-prompt.js +0 -65
  149. package/build/agents/executor-prompt.js.map +0 -1
  150. package/build/agents/orchestrator.d.ts.map +0 -1
  151. package/build/agents/orchestrator.js +0 -343
  152. package/build/agents/orchestrator.js.map +0 -1
  153. package/build/agents/planner.d.ts.map +0 -1
  154. package/build/agents/planner.js.map +0 -1
  155. package/build/core/config.d.ts.map +0 -1
  156. package/build/core/config.js.map +0 -1
  157. package/build/core/context-extractor.d.ts.map +0 -1
  158. package/build/core/context-extractor.js.map +0 -1
  159. package/build/core/glob-matcher.d.ts.map +0 -1
  160. package/build/core/glob-matcher.js.map +0 -1
  161. package/build/core/module-parser.d.ts.map +0 -1
  162. package/build/core/module-parser.js.map +0 -1
  163. package/build/core/plan-builder.d.ts.map +0 -1
  164. package/build/core/plan-builder.js.map +0 -1
  165. package/build/core/storage.d.ts.map +0 -1
  166. package/build/core/storage.js.map +0 -1
  167. package/build/core/types.d.ts.map +0 -1
  168. package/build/core/types.js.map +0 -1
  169. package/build/renderers/json.d.ts.map +0 -1
  170. package/build/renderers/json.js.map +0 -1
  171. package/build/renderers/markdown.d.ts.map +0 -1
  172. package/build/renderers/markdown.js +0 -36
  173. package/build/renderers/markdown.js.map +0 -1
  174. package/build/renderers/terminal.d.ts.map +0 -1
  175. package/build/renderers/terminal.js.map +0 -1
  176. package/build/renderers/watch.d.ts.map +0 -1
  177. package/build/renderers/watch.js.map +0 -1
  178. package/build/serve.d.ts.map +0 -1
  179. package/build/serve.js +0 -249
  180. package/build/serve.js.map +0 -1
  181. /package/build/{core → services/criteria}/glob-matcher.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-parser.d.ts","sourceRoot":"","sources":["../../../src/services/criteria/module-parser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA8B,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkBxF;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAkE5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,EAAE,CAqBlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CA+BzF"}
@@ -95,4 +95,42 @@ export function discoverModules(modulesDir) {
95
95
  }
96
96
  return modules.sort((a, b) => a.id.localeCompare(b.id));
97
97
  }
98
+ /**
99
+ * Filter modules by criteria name patterns.
100
+ *
101
+ * Each pattern is matched against the module ID. A match occurs if the
102
+ * pattern equals the full ID or the final segment (filename without path).
103
+ * For example, "dto-enforcement" matches "architecture/dto-enforcement".
104
+ *
105
+ * @param modules - All discovered modules.
106
+ * @param patterns - Criteria name patterns to include (e.g., ["dto-enforcement", "backend/controller-conventions"]).
107
+ * @returns Filtered modules. Throws if any pattern matched nothing.
108
+ */
109
+ export function filterModules(modules, patterns) {
110
+ const filtered = [];
111
+ const unmatchedPatterns = [];
112
+ for (const pattern of patterns) {
113
+ const normalized = pattern.trim().toLowerCase();
114
+ const matches = modules.filter((m) => {
115
+ const id = m.id.toLowerCase();
116
+ const lastSegment = id.split("/").pop() ?? id;
117
+ return id === normalized || lastSegment === normalized;
118
+ });
119
+ if (matches.length === 0) {
120
+ unmatchedPatterns.push(pattern);
121
+ }
122
+ else {
123
+ for (const match of matches) {
124
+ if (!filtered.some((f) => f.id === match.id)) {
125
+ filtered.push(match);
126
+ }
127
+ }
128
+ }
129
+ }
130
+ if (unmatchedPatterns.length > 0) {
131
+ const available = modules.map((m) => m.id).join(", ");
132
+ throw new Error(`No criteria matched: ${unmatchedPatterns.join(", ")}. Available: ${available}`);
133
+ }
134
+ return filtered.sort((a, b) => a.id.localeCompare(b.id));
135
+ }
98
136
  //# sourceMappingURL=module-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-parser.js","sourceRoot":"","sources":["../../../src/services/criteria/module-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAiB;IACpE,UAAU;IACV,MAAM;IACN,QAAQ;IACR,KAAK;CACN,CAAC,CAAC;AAEH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAa;IAC5D,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAC1D,MAAM,aAAa,GAAe,OAAO,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,QAAgB;IAC5D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAEnD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY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,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;oBAC7C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,wBAAwB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,EAAE,CAChF,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ContextType } from "./types.js";
1
+ import type { ContextType } from "../../types/review.js";
2
2
  /** The result of extracting review context for a task. */
3
3
  export interface ExtractedContext {
4
4
  contextType: ContextType;
@@ -14,4 +14,4 @@ export interface ExtractedContext {
14
14
  * is left to the executor agent which has Read/Grep tools)
15
15
  */
16
16
  export declare function extractContext(sourceType: ContextType, sourceTarget: string, files: string[], projectRoot: string, symbol?: string): ExtractedContext;
17
- //# sourceMappingURL=context-extractor.d.ts.map
17
+ //# sourceMappingURL=ReviewContextExtractorService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewContextExtractorService.d.ts","sourceRoot":"","sources":["../../../src/services/review/ReviewContextExtractorService.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,WAAW,EACvB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,gBAAgB,CAsBlB"}
@@ -66,4 +66,4 @@ function extractFileContext(files, projectRoot) {
66
66
  }
67
67
  return parts.join("\n\n");
68
68
  }
69
- //# sourceMappingURL=context-extractor.js.map
69
+ //# sourceMappingURL=ReviewContextExtractorService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewContextExtractorService.js","sourceRoot":"","sources":["../../../src/services/review/ReviewContextExtractorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,UAAuB,EACvB,YAAoB,EACpB,KAAe,EACf,WAAmB,EACnB,MAAe;IAEf,IAAI,OAAe,CAAC;IAEpB,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,GAAG,kBAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;YAC/D,MAAM;QACR,KAAK,MAAM;YACT,OAAO,GAAG,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACjD,MAAM;QACR,KAAK,QAAQ;YACX,OAAO,GAAG,kBAAkB,CAA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B,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACrD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CACX,2BAA2B,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC7F,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { ReviewConfig, TaskUsage } from "../core/types.js";
1
+ import type { ReviewConfig } from "../../config/types.js";
2
+ import type { TaskUsage } from "../../types/review.js";
2
3
  /** Events yielded by the orchestrator's execute() async generator. */
3
4
  export type OrchestratorEvent = {
4
5
  type: "task_started";
@@ -11,7 +12,7 @@ export type OrchestratorEvent = {
11
12
  taskId: string;
12
13
  reviewId: string;
13
14
  files: string[];
14
- findingCount: number;
15
+ issueCount: number;
15
16
  usage: TaskUsage | null;
16
17
  } | {
17
18
  type: "task_error";
@@ -25,7 +26,7 @@ export type OrchestratorEvent = {
25
26
  total: number;
26
27
  } | {
27
28
  type: "complete";
28
- totalFindings: number;
29
+ totalIssues: number;
29
30
  };
30
31
  /**
31
32
  * Executes a review plan by dispatching tasks to executor agents via the
@@ -34,9 +35,10 @@ export type OrchestratorEvent = {
34
35
  * Uses an async generator to yield progress events, allowing callers to
35
36
  * react to task starts, completions, errors, and overall progress in real time.
36
37
  */
37
- export declare class ReviewOrchestrator {
38
+ export declare class ReviewOrchestratorService {
38
39
  private readonly config;
39
40
  private readonly projectRoot;
41
+ private readonly executorService;
40
42
  constructor(config: ReviewConfig, projectRoot: string);
41
43
  /**
42
44
  * Execute all pending tasks in a plan.
@@ -49,4 +51,4 @@ export declare class ReviewOrchestrator {
49
51
  maxConcurrent?: number;
50
52
  }): AsyncGenerator<OrchestratorEvent>;
51
53
  }
52
- //# sourceMappingURL=orchestrator.d.ts.map
54
+ //# sourceMappingURL=ReviewOrchestratorService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewOrchestratorService.d.ts","sourceRoot":"","sources":["../../../src/services/review/ReviewOrchestratorService.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAEV,SAAS,EACV,MAAM,uBAAuB,CAAC;AAM/B,sEAAsE;AACtE,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1F;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,GAC1H;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxF;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAM9C;;;;;;GAMG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;gBAEtC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM;IAMrD;;;;;;OAMG;IACI,OAAO,CACZ,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACnC,cAAc,CAAC,iBAAiB,CAAC;CAwLrC"}
@@ -0,0 +1,187 @@
1
+ import path from "node:path";
2
+ import { ReviewStorageService } from "./ReviewStorageService.js";
3
+ import { extractContext } from "./ReviewContextExtractorService.js";
4
+ import { buildExecutorPrompt } from "../../prompts/ExecutorPrompt.js";
5
+ import { parseIssues } from "../FindingsParserService.js";
6
+ import { ExecutorService } from "../ExecutorService.js";
7
+ // =============================================================================
8
+ // ReviewOrchestratorService
9
+ // =============================================================================
10
+ /**
11
+ * Executes a review plan by dispatching tasks to executor agents via the
12
+ * Claude Agent SDK and collecting their findings.
13
+ *
14
+ * Uses an async generator to yield progress events, allowing callers to
15
+ * react to task starts, completions, errors, and overall progress in real time.
16
+ */
17
+ export class ReviewOrchestratorService {
18
+ config;
19
+ projectRoot;
20
+ executorService;
21
+ constructor(config, projectRoot) {
22
+ this.config = config;
23
+ this.projectRoot = projectRoot;
24
+ this.executorService = new ExecutorService(config, projectRoot);
25
+ }
26
+ /**
27
+ * Execute all pending tasks in a plan.
28
+ *
29
+ * Runs up to `maxConcurrent` executor agents at a time using a concurrency
30
+ * pool. Each executor receives a system prompt built from the task, uses
31
+ * the Claude Agent SDK to analyze the code, and outputs findings as JSON.
32
+ */
33
+ async *execute(planId, options) {
34
+ const maxConcurrent = options?.maxConcurrent ?? 5;
35
+ const storageDir = path.resolve(this.projectRoot, this.config.storage_dir);
36
+ const storage = new ReviewStorageService(storageDir);
37
+ const plan = storage.getPlan(planId);
38
+ const pendingTasks = storage.getPendingTasks(planId);
39
+ if (pendingTasks.length === 0) {
40
+ yield { type: "complete", totalIssues: 0 };
41
+ return;
42
+ }
43
+ let completedCount = 0;
44
+ let totalIssues = 0;
45
+ const total = pendingTasks.length;
46
+ // Event queue: executor promises push events here, generator yields them
47
+ const eventQueue = [];
48
+ let resolveWaiting = null;
49
+ function pushEvent(event) {
50
+ eventQueue.push(event);
51
+ if (resolveWaiting) {
52
+ resolveWaiting();
53
+ resolveWaiting = null;
54
+ }
55
+ }
56
+ /** Run a single executor agent for a task. */
57
+ const runExecutor = async (task) => {
58
+ const modelId = task.model;
59
+ pushEvent({
60
+ type: "task_started",
61
+ taskId: task.task_id,
62
+ reviewId: task.review_id,
63
+ model: modelId,
64
+ files: task.files,
65
+ });
66
+ let taskUsage = null;
67
+ try {
68
+ // Extract context and claim the task
69
+ const extracted = extractContext(plan.source.type, plan.source.target, task.files, this.projectRoot, task.symbol ?? undefined);
70
+ // Read the criterion prompt from the module file
71
+ const modulePrompt = task.prompt ?? plan.modules[task.review_id]?.description ?? "";
72
+ // Claim the task in storage (sets status to in_progress, fills context)
73
+ storage.claimTask(planId, task.task_id, {
74
+ contextType: extracted.contextType,
75
+ content: extracted.content,
76
+ symbol: extracted.symbol ?? undefined,
77
+ prompt: modulePrompt,
78
+ });
79
+ // Re-read the task with filled context for prompt building
80
+ const claimedPlan = storage.getPlan(planId);
81
+ const claimedTask = claimedPlan.tasks[task.task_id];
82
+ // Build the executor prompt
83
+ const executorPrompt = buildExecutorPrompt(claimedTask);
84
+ // Spawn executor agent via ExecutorService
85
+ const result = await this.executorService.execute(executorPrompt, modelId);
86
+ taskUsage = result.usage;
87
+ // Parse issues from executor output
88
+ const issues = parseIssues(result.resultText);
89
+ // Complete the task in storage
90
+ storage.completeTask(planId, task.task_id, issues, taskUsage);
91
+ completedCount++;
92
+ totalIssues += issues.length;
93
+ pushEvent({
94
+ type: "task_completed",
95
+ taskId: task.task_id,
96
+ reviewId: task.review_id,
97
+ files: task.files,
98
+ issueCount: issues.length,
99
+ usage: taskUsage,
100
+ });
101
+ pushEvent({
102
+ type: "batch_progress",
103
+ completed: completedCount,
104
+ total,
105
+ });
106
+ }
107
+ catch (error) {
108
+ completedCount++;
109
+ // Mark the task as errored (preserves the distinction from "complete with 0 findings")
110
+ try {
111
+ storage.errorTask(planId, task.task_id, error instanceof Error ? error.message : String(error), taskUsage);
112
+ }
113
+ catch {
114
+ // Storage error on top of executor error — just report
115
+ }
116
+ pushEvent({
117
+ type: "task_error",
118
+ taskId: task.task_id,
119
+ reviewId: task.review_id,
120
+ files: task.files,
121
+ error: error instanceof Error ? error.message : String(error),
122
+ });
123
+ pushEvent({
124
+ type: "batch_progress",
125
+ completed: completedCount,
126
+ total,
127
+ });
128
+ }
129
+ };
130
+ // Concurrency pool
131
+ const pool = [];
132
+ let taskIndex = 0;
133
+ // Start initial batch
134
+ while (taskIndex < pendingTasks.length && pool.length < maxConcurrent) {
135
+ const task = pendingTasks[taskIndex];
136
+ taskIndex++;
137
+ const p = runExecutor(task).then(() => {
138
+ pool.splice(pool.indexOf(p), 1);
139
+ });
140
+ pool.push(p);
141
+ }
142
+ // Process events and spawn new tasks as slots free up
143
+ while (completedCount < total) {
144
+ // Yield any queued events
145
+ while (eventQueue.length > 0) {
146
+ yield eventQueue.shift();
147
+ }
148
+ // If still tasks to process, wait for a slot to free up
149
+ if (pool.length > 0) {
150
+ await new Promise((resolve) => {
151
+ resolveWaiting = resolve;
152
+ // Also resolve when a pool item completes (in case no events are pushed)
153
+ if (eventQueue.length > 0) {
154
+ resolve();
155
+ resolveWaiting = null;
156
+ }
157
+ else {
158
+ // Set a timeout to check periodically (prevents deadlock)
159
+ const interval = setInterval(() => {
160
+ if (eventQueue.length > 0 || completedCount >= total) {
161
+ clearInterval(interval);
162
+ resolve();
163
+ resolveWaiting = null;
164
+ }
165
+ }, 100);
166
+ }
167
+ });
168
+ // Spawn more tasks if slots available
169
+ while (taskIndex < pendingTasks.length && pool.length < maxConcurrent) {
170
+ const task = pendingTasks[taskIndex];
171
+ taskIndex++;
172
+ const p = runExecutor(task).then(() => {
173
+ pool.splice(pool.indexOf(p), 1);
174
+ });
175
+ pool.push(p);
176
+ }
177
+ }
178
+ }
179
+ // Yield any remaining events
180
+ while (eventQueue.length > 0) {
181
+ yield eventQueue.shift();
182
+ }
183
+ // Final completion event
184
+ yield { type: "complete", totalIssues };
185
+ }
186
+ }
187
+ //# sourceMappingURL=ReviewOrchestratorService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewOrchestratorService.js","sourceRoot":"","sources":["../../../src/services/review/ReviewOrchestratorService.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAmBxD,gFAAgF;AAChF,4BAA4B;AAC5B,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IACnB,MAAM,CAAe;IACrB,WAAW,CAAS;IACpB,eAAe,CAAkB;IAElD,YAAY,MAAoB,EAAE,WAAmB;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,OAAO,CACZ,MAAc,EACd,OAAoC;QAEpC,MAAM,aAAa,GAAG,OAA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wBACH,CAAC,EAAE,GAAG,CAAC,CAAC;oBACV,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,sCAAsC;gBACtC,OAAO,SAAS,GAAG,YAAY,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC;oBACtE,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAE,CAAC;oBACtC,SAAS,EAAE,CAAC;oBACZ,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAClC,CAAC,CAAC,CAAC;oBACH,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,6BAA6B;QAC7B,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,UAAU,CAAC,KAAK,EAAG,CAAC;QAC5B,CAAC;QAED,yBAAyB;QACzB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1C,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
- import { ReviewStorage } from "./storage.js";
2
- import type { ReviewModule, ReviewPlan, ReviewSource } from "./types.js";
1
+ import { ReviewStorageService } from "./ReviewStorageService.js";
2
+ import type { ReviewModule } from "../../types/criteria.js";
3
+ import type { ReviewPlan, ReviewSource } from "../../types/review.js";
3
4
  /**
4
5
  * Build a complete review plan: create the plan, match files to modules,
5
6
  * generate tasks, and finalize.
@@ -8,5 +9,5 @@ import type { ReviewModule, ReviewPlan, ReviewSource } from "./types.js";
8
9
  * shared by both the planner agent's in-process MCP tool and any other
9
10
  * entry point that needs to create a plan from a file list.
10
11
  */
11
- export declare function buildPlanWithTasks(storage: ReviewStorage, name: string, source: ReviewSource, files: string[], modules: ReviewModule[]): ReviewPlan;
12
- //# sourceMappingURL=plan-builder.d.ts.map
12
+ export declare function buildPlanWithTasks(storage: ReviewStorageService, name: string, source: ReviewSource, files: string[], modules: ReviewModule[]): ReviewPlan;
13
+ //# sourceMappingURL=ReviewPlanBuilderService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewPlanBuilderService.d.ts","sourceRoot":"","sources":["../../../src/services/review/ReviewPlanBuilderService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAEV,UAAU,EACV,YAAY,EACb,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,YAAY,EAAE,GACtB,UAAU,CA6DZ"}
@@ -1,4 +1,4 @@
1
- import { findMatchingModules } from "./glob-matcher.js";
1
+ import { findMatchingModules } from "../criteria/glob-matcher.js";
2
2
  /**
3
3
  * Build a complete review plan: create the plan, match files to modules,
4
4
  * generate tasks, and finalize.
@@ -63,4 +63,4 @@ export function buildPlanWithTasks(storage, name, source, files, modules) {
63
63
  // Finalize the plan (sets status to "ready", recounts tasks per module)
64
64
  return storage.finalizePlan(plan.plan_id);
65
65
  }
66
- //# sourceMappingURL=plan-builder.js.map
66
+ //# sourceMappingURL=ReviewPlanBuilderService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewPlanBuilderService.js","sourceRoot":"","sources":["../../../src/services/review/ReviewPlanBuilderService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AASlE;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAA6B,EAC7B,IAAY,EAC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,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAElD,oCAAoC;IACpC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,SAAS,GACb,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;YACnD,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAExD,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE;gBAC5B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;gBAC1B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;gBAC9B,KAAK,EAAE,KAAK,CAAC,YAAY;gBACzB,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;aAC1B,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACtC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE;oBAC5B,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;oBAC1B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;oBAC9B,KAAK,EAAE,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;iBAC1B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,wEAAwE;IACxE,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { ReviewConfig, ReviewPlan } from "../core/types.js";
1
+ import type { ReviewConfig } from "../../config/types.js";
2
+ import type { ReviewPlan } from "../../types/review.js";
2
3
  /**
3
4
  * Plans review tasks by delegating intent detection to an Agent SDK agent.
4
5
  *
@@ -7,7 +8,7 @@ import type { ReviewConfig, ReviewPlan } from "../core/types.js";
7
8
  * tools. The agent interprets what the user wants to review and creates the
8
9
  * plan accordingly.
9
10
  */
10
- export declare class ReviewPlanner {
11
+ export declare class ReviewPlannerService {
11
12
  private readonly config;
12
13
  private readonly projectRoot;
13
14
  constructor(config: ReviewConfig, projectRoot: string);
@@ -23,6 +24,6 @@ export declare class ReviewPlanner {
23
24
  * for creating plans and tasks, plus standard git/read tools for
24
25
  * discovering what to review.
25
26
  */
26
- plan(input: string): Promise<ReviewPlan>;
27
+ plan(input: string, criteriaFilter?: string[]): Promise<ReviewPlan>;
27
28
  }
28
- //# sourceMappingURL=planner.d.ts.map
29
+ //# sourceMappingURL=ReviewPlannerService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewPlannerService.d.ts","sourceRoot":"","sources":["../../../src/services/review/ReviewPlannerService.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;GAOG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM;IAKrD;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;CAwG1E"}
@@ -2,9 +2,10 @@ import path from "node:path";
2
2
  import { query } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { z } from "zod";
4
4
  import { createSdkMcpServer, tool } from "@anthropic-ai/claude-agent-sdk";
5
- import { discoverModules } from "../core/module-parser.js";
6
- import { buildPlanWithTasks } from "../core/plan-builder.js";
7
- import { ReviewStorage } from "../core/storage.js";
5
+ import { discoverModules, filterModules } from "../criteria/module-parser.js";
6
+ import { buildPlanWithTasks } from "./ReviewPlanBuilderService.js";
7
+ import { ReviewStorageService } from "./ReviewStorageService.js";
8
+ import { buildPlannerPrompt } from "../../prompts/PlannerPrompt.js";
8
9
  /**
9
10
  * Plans review tasks by delegating intent detection to an Agent SDK agent.
10
11
  *
@@ -13,7 +14,7 @@ import { ReviewStorage } from "../core/storage.js";
13
14
  * tools. The agent interprets what the user wants to review and creates the
14
15
  * plan accordingly.
15
16
  */
16
- export class ReviewPlanner {
17
+ export class ReviewPlannerService {
17
18
  config;
18
19
  projectRoot;
19
20
  constructor(config, projectRoot) {
@@ -32,11 +33,14 @@ export class ReviewPlanner {
32
33
  * for creating plans and tasks, plus standard git/read tools for
33
34
  * discovering what to review.
34
35
  */
35
- async plan(input) {
36
+ async plan(input, criteriaFilter) {
36
37
  const storageDir = path.resolve(this.projectRoot, this.config.storage_dir);
37
- const storage = new ReviewStorage(storageDir);
38
+ const storage = new ReviewStorageService(storageDir);
38
39
  const modulesDir = path.resolve(this.projectRoot, this.config.modules_dir);
39
- const modules = discoverModules(modulesDir);
40
+ let modules = discoverModules(modulesDir);
41
+ if (criteriaFilter && criteriaFilter.length > 0) {
42
+ modules = filterModules(modules, criteriaFilter);
43
+ }
40
44
  // Build the module summary for the agent's context
41
45
  const moduleDescriptions = modules.map((m) => `- ${m.id} (severity: ${m.severity}, model: ${m.model})\n Globs: ${m.globs.join(", ")}\n Mode: ${m.mode}`).join("\n");
42
46
  // Track the plan ID created by the agent
@@ -74,27 +78,7 @@ export class ReviewPlanner {
74
78
  // Build planner model — use short names (haiku/sonnet/opus)
75
79
  // The Agent SDK resolves these to full model IDs internally
76
80
  const plannerModel = this.config.agents.planner.model ?? "haiku";
77
- const systemPrompt = `You are a deskcheck planner. The user will tell you what they want to check. Your job is to figure out which files are involved and call the create_plan tool.
78
-
79
- ## Available Criteria
80
-
81
- ${moduleDescriptions}
82
-
83
- ## How to Determine Files
84
-
85
- - If the user mentions a **directory** (e.g., "everything in app/Services/"): use Bash to list all files recursively: \`find <path> -type f -name "*.php" -o -name "*.ts" -o -name "*.vue"\` or similar. Then pass ALL those file paths to create_plan.
86
- - If the user mentions a **branch** or "changes" or "diff": run \`git diff <branch> --name-only\` to get changed files.
87
- - If the user mentions a **specific file**: use that file path directly.
88
- - If the user mentions a **function/method name** and a file: use the file path, set source_type to "symbol".
89
- - If the user is vague: use Bash to explore the filesystem and figure out what files are relevant.
90
-
91
- ## What to Do
92
-
93
- 1. Figure out which files to check (use Bash to run commands like find, ls, git diff)
94
- 2. Call the create_plan tool with the file list and appropriate source type (use "file" for directory/file reviews, "diff" for branch comparisons)
95
- 3. Report what you created
96
-
97
- You MUST call the create_plan tool. Do NOT review code yourself. Your only job is to determine the file list and call create_plan.`;
81
+ const systemPrompt = buildPlannerPrompt(moduleDescriptions);
98
82
  // Spawn the planner agent with a 5-minute timeout
99
83
  const abortController = new AbortController();
100
84
  const timeout = setTimeout(() => abortController.abort(), 5 * 60 * 1000);
@@ -135,4 +119,4 @@ You MUST call the create_plan tool. Do NOT review code yourself. Your only job i
135
119
  return storage.getPlan(createdPlanId);
136
120
  }
137
121
  }
138
- //# sourceMappingURL=planner.js.map
122
+ //# sourceMappingURL=ReviewPlannerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewPlannerService.js","sourceRoot":"","sources":["../../../src/services/review/ReviewPlannerService.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CA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CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAC/D,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACtE,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;QAClG,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import type { ContextType, Finding, ModuleSummary, ReviewPlan, ReviewResults, ReviewSource, ReviewTask, TaskUsage } from "./types.js";
1
+ import type { ContextType, Issue, ModuleSummary, ReviewPlan, ReviewResults, ReviewSource, ReviewTask, TaskUsage } from "../../types/review.js";
2
2
  /**
3
3
  * Manages the two-file storage format (plan.json + results.json) for deskcheck runs.
4
4
  *
@@ -6,7 +6,7 @@ import type { ContextType, Finding, ModuleSummary, ReviewPlan, ReviewResults, Re
6
6
  * directory. The plan file tracks tasks and coverage; the results file tracks
7
7
  * findings and aggregations.
8
8
  */
9
- export declare class ReviewStorage {
9
+ export declare class ReviewStorageService {
10
10
  private readonly storageDir;
11
11
  /** Tracks active lock file paths so they can be cleaned up on process exit. */
12
12
  private static activeLocks;
@@ -81,7 +81,7 @@ export declare class ReviewStorage {
81
81
  * results.json, and recomputes all aggregations (by_file, by_module,
82
82
  * summary, completion).
83
83
  */
84
- completeTask(planId: string, taskId: string, findings: Finding[], usage?: TaskUsage | null): void;
84
+ completeTask(planId: string, taskId: string, issues: Issue[], usage?: TaskUsage | null): void;
85
85
  /**
86
86
  * Mark a task as errored.
87
87
  *
@@ -115,4 +115,4 @@ export declare class ReviewStorage {
115
115
  */
116
116
  private recomputeAggregations;
117
117
  }
118
- //# sourceMappingURL=storage.d.ts.map
118
+ //# sourceMappingURL=ReviewStorageService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewStorageService.d.ts","sourceRoot":"","sources":["../../../src/services/review/ReviewStorageService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,KAAK,EAGL,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EAEV,SAAS,EAEV,MAAM,uBAAuB,CAAC;AAsC/B;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC,+EAA+E;IAC/E,OAAO,CAAC,MAAM,CAAC,WAAW,CAAqB;gBAanC,UAAU,EAAE,MAAM;IAI9B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ;IAoDhB,yCAAyC;IACzC,OAAO,CAAC,OAAO;IAQf;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,UAAU;IA0B1D,8CAA8C;IAC9C,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;IAMnC;;;OAGG;IACH,eAAe,IAAI,MAAM,GAAG,IAAI;IAsBhC,0CAA0C;IAC1C,SAAS,IAAI,KAAK,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAqCF;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;IAsBxC;;;;;;OAMG;IACH,OAAO,CACL,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,CACR,UAAU,EACR,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,SAAS,GACT,cAAc,GACd,QAAQ,GACR,QAAQ,CACX,GACA,UAAU;IAkCb;;;;;OAKG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