@prowi/deskcheck 0.1.0 → 0.2.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 (176) hide show
  1. package/README.md +67 -12
  2. package/build/cli.js +110 -22
  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 +5 -5
  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 +80 -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/{markdown.js → review/MarkdownRenderer.js} +2 -2
  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} +2 -2
  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} +1 -1
  45. package/build/renderers/review/WatchRenderer.js.map +1 -0
  46. package/build/renderers/shared.d.ts +1 -1
  47. package/build/renderers/shared.d.ts.map +1 -1
  48. package/build/renderers/test/TerminalRenderer.d.ts +14 -0
  49. package/build/renderers/test/TerminalRenderer.d.ts.map +1 -0
  50. package/build/renderers/test/TerminalRenderer.js +233 -0
  51. package/build/renderers/test/TerminalRenderer.js.map +1 -0
  52. package/build/server/controllers/ReviewController.d.ts +23 -0
  53. package/build/server/controllers/ReviewController.d.ts.map +1 -0
  54. package/build/server/controllers/ReviewController.js +90 -0
  55. package/build/server/controllers/ReviewController.js.map +1 -0
  56. package/build/server/controllers/TestController.d.ts +2 -0
  57. package/build/server/controllers/TestController.d.ts.map +1 -0
  58. package/build/server/controllers/TestController.js +3 -0
  59. package/build/server/controllers/TestController.js.map +1 -0
  60. package/build/server/middleware/cors.d.ts +9 -0
  61. package/build/server/middleware/cors.d.ts.map +1 -0
  62. package/build/server/middleware/cors.js +18 -0
  63. package/build/server/middleware/cors.js.map +1 -0
  64. package/build/{serve.d.ts → server/server.d.ts} +2 -2
  65. package/build/server/server.d.ts.map +1 -0
  66. package/build/server/server.js +102 -0
  67. package/build/server/server.js.map +1 -0
  68. package/build/server/sse/FileWatcherSSE.d.ts +10 -0
  69. package/build/server/sse/FileWatcherSSE.d.ts.map +1 -0
  70. package/build/server/sse/FileWatcherSSE.js +89 -0
  71. package/build/server/sse/FileWatcherSSE.js.map +1 -0
  72. package/build/services/ExecutorService.d.ts +51 -0
  73. package/build/services/ExecutorService.d.ts.map +1 -0
  74. package/build/services/ExecutorService.js +133 -0
  75. package/build/services/ExecutorService.js.map +1 -0
  76. package/build/services/FindingsParserService.d.ts +10 -0
  77. package/build/services/FindingsParserService.d.ts.map +1 -0
  78. package/build/services/FindingsParserService.js +64 -0
  79. package/build/services/FindingsParserService.js.map +1 -0
  80. package/build/services/criteria/CriteriaService.d.ts +10 -0
  81. package/build/services/criteria/CriteriaService.d.ts.map +1 -0
  82. package/build/services/criteria/CriteriaService.js +10 -0
  83. package/build/services/criteria/CriteriaService.js.map +1 -0
  84. package/build/{core → services/criteria}/glob-matcher.d.ts +1 -1
  85. package/build/services/criteria/glob-matcher.d.ts.map +1 -0
  86. package/build/services/criteria/glob-matcher.js.map +1 -0
  87. package/build/{core → services/criteria}/module-parser.d.ts +13 -1
  88. package/build/services/criteria/module-parser.d.ts.map +1 -0
  89. package/build/{core → services/criteria}/module-parser.js +38 -0
  90. package/build/services/criteria/module-parser.js.map +1 -0
  91. package/build/{core/context-extractor.d.ts → services/review/ReviewContextExtractorService.d.ts} +2 -2
  92. package/build/services/review/ReviewContextExtractorService.d.ts.map +1 -0
  93. package/build/{core/context-extractor.js → services/review/ReviewContextExtractorService.js} +1 -1
  94. package/build/services/review/ReviewContextExtractorService.js.map +1 -0
  95. package/build/{agents/orchestrator.d.ts → services/review/ReviewOrchestratorService.d.ts} +5 -3
  96. package/build/services/review/ReviewOrchestratorService.d.ts.map +1 -0
  97. package/build/{agents/orchestrator.js → services/review/ReviewOrchestratorService.js} +15 -171
  98. package/build/services/review/ReviewOrchestratorService.js.map +1 -0
  99. package/build/{core/plan-builder.d.ts → services/review/ReviewPlanBuilderService.d.ts} +5 -4
  100. package/build/services/review/ReviewPlanBuilderService.d.ts.map +1 -0
  101. package/build/{core/plan-builder.js → services/review/ReviewPlanBuilderService.js} +2 -2
  102. package/build/services/review/ReviewPlanBuilderService.js.map +1 -0
  103. package/build/{agents/planner.d.ts → services/review/ReviewPlannerService.d.ts} +5 -4
  104. package/build/services/review/ReviewPlannerService.d.ts.map +1 -0
  105. package/build/{agents/planner.js → services/review/ReviewPlannerService.js} +13 -29
  106. package/build/services/review/ReviewPlannerService.js.map +1 -0
  107. package/build/{core/storage.d.ts → services/review/ReviewStorageService.d.ts} +3 -3
  108. package/build/services/review/ReviewStorageService.d.ts.map +1 -0
  109. package/build/{core/storage.js → services/review/ReviewStorageService.js} +6 -6
  110. package/build/services/review/ReviewStorageService.js.map +1 -0
  111. package/build/services/testing/JudgeService.d.ts +30 -0
  112. package/build/services/testing/JudgeService.d.ts.map +1 -0
  113. package/build/services/testing/JudgeService.js +95 -0
  114. package/build/services/testing/JudgeService.js.map +1 -0
  115. package/build/services/testing/TestDiscoveryService.d.ts +16 -0
  116. package/build/services/testing/TestDiscoveryService.d.ts.map +1 -0
  117. package/build/services/testing/TestDiscoveryService.js +66 -0
  118. package/build/services/testing/TestDiscoveryService.js.map +1 -0
  119. package/build/services/testing/TestRunnerService.d.ts +35 -0
  120. package/build/services/testing/TestRunnerService.d.ts.map +1 -0
  121. package/build/services/testing/TestRunnerService.js +140 -0
  122. package/build/services/testing/TestRunnerService.js.map +1 -0
  123. package/build/services/testing/TestScorerService.d.ts +9 -0
  124. package/build/services/testing/TestScorerService.d.ts.map +1 -0
  125. package/build/services/testing/TestScorerService.js +35 -0
  126. package/build/services/testing/TestScorerService.js.map +1 -0
  127. package/build/services/testing/TestStorageService.d.ts +39 -0
  128. package/build/services/testing/TestStorageService.d.ts.map +1 -0
  129. package/build/services/testing/TestStorageService.js +144 -0
  130. package/build/services/testing/TestStorageService.js.map +1 -0
  131. package/build/types/criteria.d.ts +24 -0
  132. package/build/types/criteria.d.ts.map +1 -0
  133. package/build/{core/types.js → types/criteria.js} +2 -2
  134. package/build/types/criteria.js.map +1 -0
  135. package/build/{core/types.d.ts → types/review.d.ts} +2 -64
  136. package/build/types/review.d.ts.map +1 -0
  137. package/build/types/review.js +2 -0
  138. package/build/types/review.js.map +1 -0
  139. package/build/types/testing.d.ts +109 -0
  140. package/build/types/testing.d.ts.map +1 -0
  141. package/build/types/testing.js +2 -0
  142. package/build/types/testing.js.map +1 -0
  143. package/package.json +1 -1
  144. package/build/agents/executor-prompt.d.ts.map +0 -1
  145. package/build/agents/executor-prompt.js +0 -65
  146. package/build/agents/executor-prompt.js.map +0 -1
  147. package/build/agents/orchestrator.d.ts.map +0 -1
  148. package/build/agents/orchestrator.js.map +0 -1
  149. package/build/agents/planner.d.ts.map +0 -1
  150. package/build/agents/planner.js.map +0 -1
  151. package/build/core/config.d.ts.map +0 -1
  152. package/build/core/config.js.map +0 -1
  153. package/build/core/context-extractor.d.ts.map +0 -1
  154. package/build/core/context-extractor.js.map +0 -1
  155. package/build/core/glob-matcher.d.ts.map +0 -1
  156. package/build/core/glob-matcher.js.map +0 -1
  157. package/build/core/module-parser.d.ts.map +0 -1
  158. package/build/core/module-parser.js.map +0 -1
  159. package/build/core/plan-builder.d.ts.map +0 -1
  160. package/build/core/plan-builder.js.map +0 -1
  161. package/build/core/storage.d.ts.map +0 -1
  162. package/build/core/storage.js.map +0 -1
  163. package/build/core/types.d.ts.map +0 -1
  164. package/build/core/types.js.map +0 -1
  165. package/build/renderers/json.d.ts.map +0 -1
  166. package/build/renderers/json.js.map +0 -1
  167. package/build/renderers/markdown.d.ts.map +0 -1
  168. package/build/renderers/markdown.js.map +0 -1
  169. package/build/renderers/terminal.d.ts.map +0 -1
  170. package/build/renderers/terminal.js.map +0 -1
  171. package/build/renderers/watch.d.ts.map +0 -1
  172. package/build/renderers/watch.js.map +0 -1
  173. package/build/serve.d.ts.map +0 -1
  174. package/build/serve.js +0 -249
  175. package/build/serve.js.map +0 -1
  176. /package/build/{core → services/criteria}/glob-matcher.js +0 -0
@@ -0,0 +1,233 @@
1
+ // =============================================================================
2
+ // ANSI helpers
3
+ // =============================================================================
4
+ const RESET = "\x1b[0m";
5
+ const BOLD = "\x1b[1m";
6
+ const DIM = "\x1b[2m";
7
+ const RED = "\x1b[31m";
8
+ const GREEN = "\x1b[32m";
9
+ const YELLOW = "\x1b[33m";
10
+ // =============================================================================
11
+ // Score color helpers
12
+ // =============================================================================
13
+ /** Color a percentage score: green >= 80%, yellow >= 50%, red < 50%. */
14
+ function colorScore(value) {
15
+ const pct = Math.round(value * 100);
16
+ const str = `${pct}%`;
17
+ if (pct >= 80)
18
+ return `${GREEN}${str}${RESET}`;
19
+ if (pct >= 50)
20
+ return `${YELLOW}${str}${RESET}`;
21
+ return `${RED}${str}${RESET}`;
22
+ }
23
+ /** Pad a string to a fixed visible width (ignoring ANSI escape codes). */
24
+ function padScore(colored, width) {
25
+ // Strip ANSI to measure visible length
26
+ const visible = colored.replace(/\x1b\[[0-9;]*m/g, "");
27
+ const padding = Math.max(0, width - visible.length);
28
+ return colored + " ".repeat(padding);
29
+ }
30
+ // =============================================================================
31
+ // Status icon helpers
32
+ // =============================================================================
33
+ /** Get the status icon for a test case based on its status and scores. */
34
+ function statusIcon(status, scores) {
35
+ if (status === "error")
36
+ return `${RED}\u2717${RESET}`;
37
+ if (status === "pending")
38
+ return `${DIM}\u25CB${RESET}`;
39
+ if (status === "executing" || status === "judging")
40
+ return `${DIM}\u27F3${RESET}`;
41
+ // status === "complete"
42
+ if (scores && scores.recall >= 0.8 && scores.precision >= 0.8 && scores.scope_compliance >= 0.8) {
43
+ return `${GREEN}\u2713${RESET}`;
44
+ }
45
+ return `${YELLOW}\u25B2${RESET}`;
46
+ }
47
+ /** Check if a completed test case passed (all scores >= 80%). */
48
+ function isPassing(scores) {
49
+ if (!scores)
50
+ return false;
51
+ return scores.recall >= 0.8 && scores.precision >= 0.8 && scores.scope_compliance >= 0.8;
52
+ }
53
+ // =============================================================================
54
+ // Progress renderer (live updates during execution)
55
+ // =============================================================================
56
+ /**
57
+ * Render the current state of a test run for live progress updates.
58
+ *
59
+ * Shows one line per test case with its current status and scores (if complete).
60
+ */
61
+ export function renderTestProgress(run) {
62
+ const lines = [];
63
+ let totalTests = 0;
64
+ let completedTests = 0;
65
+ for (const [criterionId, suite] of Object.entries(run.suites)) {
66
+ lines.push("");
67
+ lines.push(` ${BOLD}${criterionId}${RESET}`);
68
+ lines.push("");
69
+ for (const [testName, testCase] of Object.entries(suite.tests)) {
70
+ totalTests++;
71
+ const icon = statusIcon(testCase.status, testCase.scores);
72
+ if (testCase.status === "complete" && testCase.scores) {
73
+ completedTests++;
74
+ const recall = padScore(colorScore(testCase.scores.recall), 6);
75
+ const precision = padScore(colorScore(testCase.scores.precision), 6);
76
+ const scope = padScore(colorScore(testCase.scores.scope_compliance), 6);
77
+ lines.push(` ${icon} ${testName} recall: ${recall}precision: ${precision}scope: ${scope}`);
78
+ // Summary line
79
+ const parts = [];
80
+ if (testCase.scores.expectations_found > 0 || testCase.scores.total_expectations > 0) {
81
+ parts.push(`${testCase.scores.expectations_found}/${testCase.scores.total_expectations} expected found`);
82
+ }
83
+ if (testCase.scores.out_of_scope > 0) {
84
+ parts.push(`${testCase.scores.out_of_scope} out-of-scope finding${testCase.scores.out_of_scope !== 1 ? "s" : ""}`);
85
+ }
86
+ if (parts.length > 0) {
87
+ lines.push(` ${DIM}${parts.join(". ")}.${RESET}`);
88
+ }
89
+ }
90
+ else if (testCase.status === "error") {
91
+ completedTests++;
92
+ lines.push(` ${icon} ${testName} ${RED}error${RESET}`);
93
+ if (testCase.error) {
94
+ lines.push(` ${DIM}${testCase.error}${RESET}`);
95
+ }
96
+ }
97
+ else if (testCase.status === "executing") {
98
+ lines.push(` ${icon} ${testName} ${DIM}executing...${RESET}`);
99
+ }
100
+ else if (testCase.status === "judging") {
101
+ lines.push(` ${icon} ${testName} ${DIM}judging...${RESET}`);
102
+ }
103
+ else {
104
+ // pending
105
+ lines.push(` ${icon} ${testName} ${DIM}pending${RESET}`);
106
+ }
107
+ }
108
+ }
109
+ lines.push("");
110
+ lines.push(` ${completedTests}/${totalTests} complete`);
111
+ return lines.join("\n");
112
+ }
113
+ // =============================================================================
114
+ // Results renderer (final detailed output)
115
+ // =============================================================================
116
+ /**
117
+ * Render the final detailed results after all tests complete.
118
+ *
119
+ * For imperfect or failed tests, shows per-finding and per-expectation detail.
120
+ */
121
+ export function renderTestResults(run) {
122
+ const lines = [];
123
+ let totalSuites = 0;
124
+ let passedSuites = 0;
125
+ let imperfectSuites = 0;
126
+ let totalCost = 0;
127
+ let totalDuration = 0;
128
+ for (const [criterionId, suite] of Object.entries(run.suites)) {
129
+ totalSuites++;
130
+ lines.push("");
131
+ lines.push(` ${BOLD}${criterionId}${RESET}`);
132
+ lines.push("");
133
+ let suiteAllPassing = true;
134
+ for (const [testName, testCase] of Object.entries(suite.tests)) {
135
+ // Accumulate cost and duration
136
+ totalCost += accumulateCost(testCase);
137
+ totalDuration += accumulateDuration(testCase);
138
+ const icon = statusIcon(testCase.status, testCase.scores);
139
+ if (testCase.status === "complete" && testCase.scores) {
140
+ const passing = isPassing(testCase.scores);
141
+ if (!passing)
142
+ suiteAllPassing = false;
143
+ const recall = padScore(colorScore(testCase.scores.recall), 6);
144
+ const precision = padScore(colorScore(testCase.scores.precision), 6);
145
+ const scope = padScore(colorScore(testCase.scores.scope_compliance), 6);
146
+ lines.push(` ${icon} ${testName} recall: ${recall}precision: ${precision}scope: ${scope}`);
147
+ // Show detail for imperfect tests
148
+ if (!passing && testCase.judge) {
149
+ lines.push("");
150
+ // Findings detail
151
+ if (testCase.judge.findings_review.length > 0) {
152
+ lines.push(` ${BOLD}Findings:${RESET}`);
153
+ for (const fr of testCase.judge.findings_review) {
154
+ if (fr.verdict === "correct") {
155
+ const check = fr.criterion_check ? ` ${DIM}(${fr.criterion_check})${RESET}` : "";
156
+ lines.push(` ${GREEN}\u2713${RESET} ${fr.finding} ${DIM}correct${RESET}${check}`);
157
+ }
158
+ else if (fr.verdict === "out_of_scope") {
159
+ lines.push(` ${RED}\u2717${RESET} ${fr.finding} ${YELLOW}out of scope${RESET}`);
160
+ }
161
+ else {
162
+ lines.push(` ${RED}\u2717${RESET} ${fr.finding} ${RED}incorrect severity${RESET}`);
163
+ }
164
+ }
165
+ lines.push("");
166
+ }
167
+ // Expectations detail
168
+ if (testCase.judge.expectations_review.length > 0) {
169
+ lines.push(` ${BOLD}Expectations:${RESET}`);
170
+ for (const er of testCase.judge.expectations_review) {
171
+ if (er.verdict === "found") {
172
+ lines.push(` ${GREEN}\u2713${RESET} ${er.expectation} ${DIM}found${RESET}`);
173
+ }
174
+ else {
175
+ lines.push(` ${RED}\u2717${RESET} ${er.expectation} ${RED}missed${RESET}`);
176
+ }
177
+ }
178
+ }
179
+ lines.push("");
180
+ }
181
+ }
182
+ else if (testCase.status === "error") {
183
+ suiteAllPassing = false;
184
+ lines.push(` ${icon} ${testName} ${RED}error: ${testCase.error ?? "unknown"}${RESET}`);
185
+ lines.push("");
186
+ }
187
+ else {
188
+ suiteAllPassing = false;
189
+ lines.push(` ${icon} ${testName} ${DIM}${testCase.status}${RESET}`);
190
+ }
191
+ }
192
+ if (suiteAllPassing) {
193
+ passedSuites++;
194
+ }
195
+ else {
196
+ imperfectSuites++;
197
+ }
198
+ }
199
+ // Summary line
200
+ lines.push("");
201
+ const summaryParts = [];
202
+ if (passedSuites > 0)
203
+ summaryParts.push(`${GREEN}${passedSuites} passed${RESET}`);
204
+ if (imperfectSuites > 0)
205
+ summaryParts.push(`${YELLOW}${imperfectSuites} imperfect${RESET}`);
206
+ lines.push(` Results: ${summaryParts.join(", ")} (${totalSuites} total)`);
207
+ // Cost and duration
208
+ const costStr = totalCost > 0 ? `$${totalCost.toFixed(2)}` : "$0.00";
209
+ const durationStr = `${Math.round(totalDuration / 1000)}s`;
210
+ lines.push(` ${DIM}Cost: ${costStr} \u2502 Duration: ${durationStr}${RESET}`);
211
+ lines.push("");
212
+ return lines.join("\n");
213
+ }
214
+ // =============================================================================
215
+ // Usage accumulation helpers
216
+ // =============================================================================
217
+ function accumulateCost(testCase) {
218
+ let cost = 0;
219
+ if (testCase.executor_usage)
220
+ cost += testCase.executor_usage.cost_usd;
221
+ if (testCase.judge_usage)
222
+ cost += testCase.judge_usage.cost_usd;
223
+ return cost;
224
+ }
225
+ function accumulateDuration(testCase) {
226
+ let duration = 0;
227
+ if (testCase.executor_usage)
228
+ duration += testCase.executor_usage.duration_ms;
229
+ if (testCase.judge_usage)
230
+ duration += testCase.judge_usage.duration_ms;
231
+ return duration;
232
+ }
233
+ //# sourceMappingURL=TerminalRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerminalRenderer.js","sourceRoot":"","sources":["../../../src/renderers/test/TerminalRenderer.ts"],"names":[],"mappings":"AAOA,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,GAAG,GAAG,UAAU,CAAC;AACvB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAEhF,wEAAwE;AACxE,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACtB,IAAI,GAAG,IAAI,EAAE;QAAE,OAAO,GAAG,KAAK,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAC/C,IAAI,GAAG,IAAI,EAAE;QAAE,OAAO,GAAG,MAAM,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;IAChD,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,EAAE,CAAC;AAChC,CAAC;AAED,0EAA0E;AAC1E,SAAS,Q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AAC"}
@@ -0,0 +1,23 @@
1
+ import type http from "node:http";
2
+ import type { ReviewStorageService } from "../../services/review/ReviewStorageService.js";
3
+ import type { ReviewResults } from "../../types/review.js";
4
+ /** A run summary returned by GET /api/runs. */
5
+ export interface RunSummary {
6
+ planId: string;
7
+ name: string;
8
+ status: string;
9
+ createdAt: string;
10
+ sourceType: string | null;
11
+ sourceTarget: string | null;
12
+ taskCount: number;
13
+ moduleCount: number;
14
+ moduleNames: string[];
15
+ matchedFiles: number;
16
+ unmatchedFiles: number;
17
+ summary: ReviewResults["summary"] | null;
18
+ completion: ReviewResults["completion"] | null;
19
+ }
20
+ export declare function handleGetRuns(storage: ReviewStorageService, res: http.ServerResponse): void;
21
+ export declare function handleGetPlan(storage: ReviewStorageService, res: http.ServerResponse, planId: string): void;
22
+ export declare function handleGetResults(storage: ReviewStorageService, res: http.ServerResponse, planId: string): void;
23
+ //# sourceMappingURL=ReviewController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewController.d.ts","sourceRoot":"","sources":["../../../src/server/controllers/ReviewController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACzC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CAChD;AAwBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAsD3F;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAO3G;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAO9G"}
@@ -0,0 +1,90 @@
1
+ // =============================================================================
2
+ // Response helpers (used by controller handlers)
3
+ // =============================================================================
4
+ function sendJson(res, data, status = 200) {
5
+ const body = JSON.stringify(data);
6
+ res.writeHead(status, {
7
+ "Content-Type": "application/json",
8
+ "Access-Control-Allow-Origin": "*",
9
+ "Cache-Control": "no-cache",
10
+ });
11
+ res.end(body);
12
+ }
13
+ function sendError(res, status, message) {
14
+ sendJson(res, { error: message }, status);
15
+ }
16
+ // =============================================================================
17
+ // Route handlers
18
+ // =============================================================================
19
+ export function handleGetRuns(storage, res) {
20
+ const plans = storage.listPlans();
21
+ const runs = plans.map((planSummary) => {
22
+ let summary = null;
23
+ let completion = null;
24
+ // Enrich with results data if available
25
+ try {
26
+ const results = storage.getResults(planSummary.planId);
27
+ summary = results.summary;
28
+ completion = results.completion;
29
+ }
30
+ catch {
31
+ // No results file yet
32
+ }
33
+ // Enrich with plan data (tasks, modules, coverage)
34
+ let taskCount = 0;
35
+ let moduleCount = 0;
36
+ let moduleNames = [];
37
+ let matchedFiles = 0;
38
+ let unmatchedFiles = 0;
39
+ let sourceType = null;
40
+ let sourceTarget = null;
41
+ try {
42
+ const plan = storage.getPlan(planSummary.planId);
43
+ taskCount = Object.keys(plan.tasks).length;
44
+ moduleCount = Object.keys(plan.modules).length;
45
+ moduleNames = Object.keys(plan.modules).map((id) => id.split("/").pop() ?? id);
46
+ matchedFiles = plan.matched_files?.length ?? 0;
47
+ unmatchedFiles = plan.unmatched_files?.length ?? 0;
48
+ sourceType = plan.source?.type ?? null;
49
+ sourceTarget = plan.source?.target ?? null;
50
+ }
51
+ catch {
52
+ // Plan read error
53
+ }
54
+ return {
55
+ planId: planSummary.planId,
56
+ name: planSummary.name,
57
+ status: planSummary.status,
58
+ createdAt: planSummary.createdAt,
59
+ sourceType,
60
+ sourceTarget,
61
+ taskCount,
62
+ moduleCount,
63
+ moduleNames,
64
+ matchedFiles,
65
+ unmatchedFiles,
66
+ summary,
67
+ completion,
68
+ };
69
+ });
70
+ sendJson(res, runs);
71
+ }
72
+ export function handleGetPlan(storage, res, planId) {
73
+ try {
74
+ const plan = storage.getPlan(planId);
75
+ sendJson(res, plan);
76
+ }
77
+ catch {
78
+ sendError(res, 404, `Plan not found: ${planId}`);
79
+ }
80
+ }
81
+ export function handleGetResults(storage, res, planId) {
82
+ try {
83
+ const results = storage.getResults(planId);
84
+ sendJson(res, results);
85
+ }
86
+ catch {
87
+ sendError(res, 404, `Results not found for plan: ${planId}`);
88
+ }
89
+ }
90
+ //# sourceMappingURL=ReviewController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewController.js","sourceRoot":"","sources":["../../../src/server/controllers/ReviewController.ts"],"names":[],"mappings":"AAyBA,gFAAgF;AAChF,iDAAiD;AACjD,gFAAgF;AAEhF,SAAS,QAAQ,CAAC,GAAwB,EAAE,IAAa,EAAE,MAAM,GAAG,GAAG;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE;QACpB,cAAc,EAAE,kBAAkB;QAClC,6BAA6B,EAAE,GAAG;QAClC,eAAe,E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AmB,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAA6B,EAAE,GAAwB,EAAE,MAAc;IACtG,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC3C,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,+BAA+B,MAAM,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TestController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestController.d.ts","sourceRoot":"","sources":["../../../src/server/controllers/TestController.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export {};
2
+ // Test run API endpoints — to be implemented
3
+ //# sourceMappingURL=TestController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestController.js","sourceRoot":"","sources":["../../../src/server/controllers/TestController.ts"],"names":[],"mappings":";AAAA,6CAA6C"}
@@ -0,0 +1,9 @@
1
+ import type http from "node:http";
2
+ /**
3
+ * Handle CORS preflight (OPTIONS) requests.
4
+ *
5
+ * Returns `true` if the request was an OPTIONS preflight and has been
6
+ * fully handled (caller should stop processing). Returns `false` otherwise.
7
+ */
8
+ export declare function handleCors(req: http.IncomingMessage, res: http.ServerResponse): boolean;
9
+ //# sourceMappingURL=cors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAUvF"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Handle CORS preflight (OPTIONS) requests.
3
+ *
4
+ * Returns `true` if the request was an OPTIONS preflight and has been
5
+ * fully handled (caller should stop processing). Returns `false` otherwise.
6
+ */
7
+ export function handleCors(req, res) {
8
+ if (req.method !== "OPTIONS")
9
+ return false;
10
+ res.writeHead(204, {
11
+ "Access-Control-Allow-Origin": "*",
12
+ "Access-Control-Allow-Methods": "GET, OPTIONS",
13
+ "Access-Control-Allow-Headers": "Content-Type",
14
+ });
15
+ res.end();
16
+ return true;
17
+ }
18
+ //# sourceMappingURL=cors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.js","sourceRoot":"","sources":["../../../src/server/middleware/cors.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAyB,EAAE,GAAwB;IAC5E,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAE3C,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,6BAA6B,EAAE,GAAG;QAClC,8BAA8B,EAAE,cAAc;QAC9C,8BAA8B,EAAE,cAAc;KAC/C,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,EAAE,CAAC;IACV,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReviewConfig } from "./core/types.js";
1
+ import type { ReviewConfig } from "../config/types.js";
2
2
  /**
3
3
  * Start the deskcheck web UI server.
4
4
  *
@@ -6,4 +6,4 @@ import type { ReviewConfig } from "./core/types.js";
6
6
  * and SSE streams for live updates during execution.
7
7
  */
8
8
  export declare function startServer(config: ReviewConfig, projectRoot: string, port: number): void;
9
- //# sourceMappingURL=serve.d.ts.map
9
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAyCvD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAkEzF"}
@@ -0,0 +1,102 @@
1
+ import http from "node:http";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { URL } from "node:url";
5
+ import { ReviewStorageService } from "../services/review/ReviewStorageService.js";
6
+ import { handleCors } from "./middleware/cors.js";
7
+ import { handleGetRuns, handleGetPlan, handleGetResults } from "./controllers/ReviewController.js";
8
+ import { handleSSE } from "./sse/FileWatcherSSE.js";
9
+ // =============================================================================
10
+ // Response helpers
11
+ // =============================================================================
12
+ function sendJson(res, data, status = 200) {
13
+ const body = JSON.stringify(data);
14
+ res.writeHead(status, {
15
+ "Content-Type": "application/json",
16
+ "Access-Control-Allow-Origin": "*",
17
+ "Cache-Control": "no-cache",
18
+ });
19
+ res.end(body);
20
+ }
21
+ function sendHtml(res, html) {
22
+ res.writeHead(200, {
23
+ "Content-Type": "text/html; charset=utf-8",
24
+ "Access-Control-Allow-Origin": "*",
25
+ });
26
+ res.end(html);
27
+ }
28
+ function sendError(res, status, message) {
29
+ sendJson(res, { error: message }, status);
30
+ }
31
+ // =============================================================================
32
+ // URL parsing
33
+ // =============================================================================
34
+ /** Parse a URL path into segments, e.g. "/api/runs/abc/plan" -> ["api", "runs", "abc", "plan"]. */
35
+ function parseSegments(pathname) {
36
+ return pathname.split("/").filter((s) => s.length > 0);
37
+ }
38
+ // =============================================================================
39
+ // Server
40
+ // =============================================================================
41
+ /**
42
+ * Start the deskcheck web UI server.
43
+ *
44
+ * Serves a self-contained HTML dashboard at the root, a JSON API for run data,
45
+ * and SSE streams for live updates during execution.
46
+ */
47
+ export function startServer(config, projectRoot, port) {
48
+ const storageDir = path.join(projectRoot, config.storage_dir);
49
+ const storage = new ReviewStorageService(storageDir);
50
+ const uiHtmlPath = path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../ui/dist/index.html");
51
+ const server = http.createServer((req, res) => {
52
+ // Handle CORS preflight
53
+ if (handleCors(req, res))
54
+ return;
55
+ if (req.method !== "GET") {
56
+ sendError(res, 405, "Method not allowed");
57
+ return;
58
+ }
59
+ const parsedUrl = new URL(req.url ?? "/", `http://localhost:${port}`);
60
+ const segments = parseSegments(parsedUrl.pathname);
61
+ // GET / -> dashboard HTML (re-read on each request so UI rebuilds are picked up without restart)
62
+ if (segments.length === 0) {
63
+ if (!fs.existsSync(uiHtmlPath)) {
64
+ sendHtml(res, "<html><body><p>UI not built yet. Run <code>cd ui &amp;&amp; npm run build</code>, or use the Vite dev server at <code>http://localhost:5173</code>.</p></body></html>");
65
+ return;
66
+ }
67
+ const dashboardHtml = fs.readFileSync(uiHtmlPath, "utf-8");
68
+ sendHtml(res, dashboardHtml);
69
+ return;
70
+ }
71
+ // API routes all start with "api"
72
+ if (segments[0] !== "api") {
73
+ sendError(res, 404, "Not found");
74
+ return;
75
+ }
76
+ // GET /api/runs
77
+ if (segments.length === 2 && segments[1] === "runs") {
78
+ handleGetRuns(storage, res);
79
+ return;
80
+ }
81
+ // GET /api/runs/:id/plan
82
+ if (segments.length === 4 && segments[1] === "runs" && segments[3] === "plan") {
83
+ handleGetPlan(storage, res, decodeURIComponent(segments[2]));
84
+ return;
85
+ }
86
+ // GET /api/runs/:id/results
87
+ if (segments.length === 4 && segments[1] === "runs" && segments[3] === "results") {
88
+ handleGetResults(storage, res, decodeURIComponent(segments[2]));
89
+ return;
90
+ }
91
+ // GET /api/events/:id -> SSE stream
92
+ if (segments.length === 3 && segments[1] === "events") {
93
+ handleSSE(res, storageDir, decodeURIComponent(segments[2]));
94
+ return;
95
+ }
96
+ sendError(res, 404, "Not found");
97
+ });
98
+ server.listen(port, () => {
99
+ console.log(`Deskcheck UI: http://localhost:${port}`);
100
+ });
101
+ }
102
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.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,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YACtD,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,OAAO;QACT,CAAC;QAED,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type http from "node:http";
2
+ /**
3
+ * Stream SSE events when JSON files change in a watched directory.
4
+ *
5
+ * Watches the given directory for changes to `.json` files and emits
6
+ * `data: {"type":"update"}` events to the connected client. Falls back
7
+ * to polling if `fs.watch` is unavailable.
8
+ */
9
+ export declare function handleSSE(res: http.ServerResponse, storageDir: string, planId: string): void;
10
+ //# sourceMappingURL=FileWatcherSSE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileWatcherSSE.d.ts","sourceRoot":"","sources":["../../../src/server/sse/FileWatcherSSE.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,IAAI,CAiFN"}