@prowi/deskcheck 0.1.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.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/build/agents/executor-prompt.d.ts +10 -0
- package/build/agents/executor-prompt.d.ts.map +1 -0
- package/build/agents/executor-prompt.js +65 -0
- package/build/agents/executor-prompt.js.map +1 -0
- package/build/agents/orchestrator.d.ts +52 -0
- package/build/agents/orchestrator.d.ts.map +1 -0
- package/build/agents/orchestrator.js +343 -0
- package/build/agents/orchestrator.js.map +1 -0
- package/build/agents/planner.d.ts +28 -0
- package/build/agents/planner.d.ts.map +1 -0
- package/build/agents/planner.js +138 -0
- package/build/agents/planner.js.map +1 -0
- package/build/cli.d.ts +3 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +467 -0
- package/build/cli.js.map +1 -0
- package/build/core/config.d.ts +16 -0
- package/build/core/config.d.ts.map +1 -0
- package/build/core/config.js +81 -0
- package/build/core/config.js.map +1 -0
- package/build/core/context-extractor.d.ts +17 -0
- package/build/core/context-extractor.d.ts.map +1 -0
- package/build/core/context-extractor.js +69 -0
- package/build/core/context-extractor.js.map +1 -0
- package/build/core/glob-matcher.d.ts +32 -0
- package/build/core/glob-matcher.d.ts.map +1 -0
- package/build/core/glob-matcher.js +51 -0
- package/build/core/glob-matcher.js.map +1 -0
- package/build/core/module-parser.d.ts +26 -0
- package/build/core/module-parser.d.ts.map +1 -0
- package/build/core/module-parser.js +98 -0
- package/build/core/module-parser.js.map +1 -0
- package/build/core/plan-builder.d.ts +12 -0
- package/build/core/plan-builder.d.ts.map +1 -0
- package/build/core/plan-builder.js +66 -0
- package/build/core/plan-builder.js.map +1 -0
- package/build/core/storage.d.ts +118 -0
- package/build/core/storage.d.ts.map +1 -0
- package/build/core/storage.js +590 -0
- package/build/core/storage.js.map +1 -0
- package/build/core/types.d.ts +268 -0
- package/build/core/types.d.ts.map +1 -0
- package/build/core/types.js +5 -0
- package/build/core/types.js.map +1 -0
- package/build/mcp/tools.d.ts +10 -0
- package/build/mcp/tools.d.ts.map +1 -0
- package/build/mcp/tools.js +354 -0
- package/build/mcp/tools.js.map +1 -0
- package/build/mcp-server.d.ts +3 -0
- package/build/mcp-server.d.ts.map +1 -0
- package/build/mcp-server.js +15 -0
- package/build/mcp-server.js.map +1 -0
- package/build/renderers/json.d.ts +4 -0
- package/build/renderers/json.d.ts.map +1 -0
- package/build/renderers/json.js +5 -0
- package/build/renderers/json.js.map +1 -0
- package/build/renderers/markdown.d.ts +4 -0
- package/build/renderers/markdown.d.ts.map +1 -0
- package/build/renderers/markdown.js +36 -0
- package/build/renderers/markdown.js.map +1 -0
- package/build/renderers/shared.d.ts +23 -0
- package/build/renderers/shared.d.ts.map +1 -0
- package/build/renderers/shared.js +30 -0
- package/build/renderers/shared.js.map +1 -0
- package/build/renderers/terminal.d.ts +4 -0
- package/build/renderers/terminal.d.ts.map +1 -0
- package/build/renderers/terminal.js +88 -0
- package/build/renderers/terminal.js.map +1 -0
- package/build/renderers/watch.d.ts +4 -0
- package/build/renderers/watch.d.ts.map +1 -0
- package/build/renderers/watch.js +119 -0
- package/build/renderers/watch.js.map +1 -0
- package/build/serve.d.ts +9 -0
- package/build/serve.d.ts.map +1 -0
- package/build/serve.js +249 -0
- package/build/serve.js.map +1 -0
- package/package.json +41 -0
- package/ui/dist/index.html +92 -0
package/build/cli.js
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import { loadConfig, DEFAULT_CONFIG } from "./core/config.js";
|
|
7
|
+
import { ReviewStorage } from "./core/storage.js";
|
|
8
|
+
import { discoverModules } from "./core/module-parser.js";
|
|
9
|
+
import { buildPlanWithTasks } from "./core/plan-builder.js";
|
|
10
|
+
import { ReviewPlanner } from "./agents/planner.js";
|
|
11
|
+
import { ReviewOrchestrator } from "./agents/orchestrator.js";
|
|
12
|
+
import { renderTerminal } from "./renderers/terminal.js";
|
|
13
|
+
import { renderMarkdown } from "./renderers/markdown.js";
|
|
14
|
+
import { renderJson } from "./renderers/json.js";
|
|
15
|
+
import { renderWatch } from "./renderers/watch.js";
|
|
16
|
+
import { startServer } from "./serve.js";
|
|
17
|
+
// =============================================================================
|
|
18
|
+
// ANSI helpers
|
|
19
|
+
// =============================================================================
|
|
20
|
+
const DIM = "\x1b[2m";
|
|
21
|
+
const BOLD = "\x1b[1m";
|
|
22
|
+
const GREEN = "\x1b[32m";
|
|
23
|
+
const YELLOW = "\x1b[33m";
|
|
24
|
+
const RED = "\x1b[31m";
|
|
25
|
+
const RESET = "\x1b[0m";
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// Helpers
|
|
28
|
+
// =============================================================================
|
|
29
|
+
function resolveProjectRoot() {
|
|
30
|
+
return process.cwd();
|
|
31
|
+
}
|
|
32
|
+
function formatFindingsSummary(results) {
|
|
33
|
+
const { critical, warning, info, total } = results.summary;
|
|
34
|
+
if (total === 0)
|
|
35
|
+
return "0";
|
|
36
|
+
const parts = [];
|
|
37
|
+
if (critical > 0)
|
|
38
|
+
parts.push(`${critical}C`);
|
|
39
|
+
if (warning > 0)
|
|
40
|
+
parts.push(`${warning}W`);
|
|
41
|
+
if (info > 0)
|
|
42
|
+
parts.push(`${info}I`);
|
|
43
|
+
return `${total} (${parts.join(" ")})`;
|
|
44
|
+
}
|
|
45
|
+
function padEnd(str, width) {
|
|
46
|
+
return str.length >= width ? str : str + " ".repeat(width - str.length);
|
|
47
|
+
}
|
|
48
|
+
/** Check if findings exceed the --fail-on threshold. Returns the exit code. */
|
|
49
|
+
function checkFailOn(results, failOn) {
|
|
50
|
+
if (!failOn)
|
|
51
|
+
return 0;
|
|
52
|
+
const severities = failOn.split(",").map((s) => s.trim().toLowerCase());
|
|
53
|
+
for (const severity of severities) {
|
|
54
|
+
if (severity === "critical" && results.summary.critical > 0)
|
|
55
|
+
return 1;
|
|
56
|
+
if (severity === "warning" && (results.summary.critical > 0 || results.summary.warning > 0))
|
|
57
|
+
return 1;
|
|
58
|
+
if (severity === "info" && results.summary.total > 0)
|
|
59
|
+
return 1;
|
|
60
|
+
}
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
/** Render results in the requested format. */
|
|
64
|
+
function renderOutput(results, plan, format) {
|
|
65
|
+
switch (format) {
|
|
66
|
+
case "terminal":
|
|
67
|
+
return renderTerminal(results, plan);
|
|
68
|
+
case "markdown":
|
|
69
|
+
return renderMarkdown(results, plan);
|
|
70
|
+
case "json":
|
|
71
|
+
return renderJson(results);
|
|
72
|
+
default:
|
|
73
|
+
return renderTerminal(results, plan);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Print execution progress from orchestrator events. */
|
|
77
|
+
async function executeAndPrint(orchestrator, planId) {
|
|
78
|
+
console.log(`${DIM} Checking...${RESET}`);
|
|
79
|
+
console.log("");
|
|
80
|
+
for await (const event of orchestrator.execute(planId)) {
|
|
81
|
+
switch (event.type) {
|
|
82
|
+
case "task_started":
|
|
83
|
+
break;
|
|
84
|
+
case "task_completed": {
|
|
85
|
+
const moduleName = event.reviewId.split("/").pop() ?? event.reviewId;
|
|
86
|
+
const fileName = event.files.map((f) => f.split("/").pop()).join(", ");
|
|
87
|
+
if (event.findingCount > 0) {
|
|
88
|
+
console.log(`${YELLOW} ▲ ${moduleName}${RESET} ${DIM}→${RESET} ${fileName} ${DIM}(${event.findingCount} findings)${RESET}`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.log(`${GREEN} ✓ ${moduleName}${RESET} ${DIM}→${RESET} ${fileName} ${DIM}(clean)${RESET}`);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case "task_error": {
|
|
96
|
+
const errModuleName = event.reviewId.split("/").pop() ?? event.reviewId;
|
|
97
|
+
const errFileName = event.files.map((f) => f.split("/").pop()).join(", ");
|
|
98
|
+
console.log(`${RED} ✗ ${errModuleName}${RESET} ${DIM}→${RESET} ${errFileName} ${DIM}(error)${RESET}`);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "batch_progress":
|
|
102
|
+
if (event.total > 10) {
|
|
103
|
+
console.log(`${DIM} [${event.completed}/${event.total}]${RESET}`);
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case "complete":
|
|
107
|
+
console.log("");
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Print the plan summary after planning. */
|
|
113
|
+
function printPlanSummary(plan) {
|
|
114
|
+
const taskCount = Object.keys(plan.tasks).length;
|
|
115
|
+
const moduleNames = Object.keys(plan.modules).map((id) => id.split("/").pop()).join(", ");
|
|
116
|
+
console.log("");
|
|
117
|
+
console.log(`${BOLD} ${plan.name}${RESET}`);
|
|
118
|
+
console.log(`${DIM} ${taskCount} tasks │ modules: ${moduleNames}${RESET}`);
|
|
119
|
+
if (plan.unmatched_files.length > 0) {
|
|
120
|
+
console.log(`${DIM} ${plan.unmatched_files.length} files not covered by any criterion${RESET}`);
|
|
121
|
+
}
|
|
122
|
+
console.log("");
|
|
123
|
+
}
|
|
124
|
+
// =============================================================================
|
|
125
|
+
// Commands
|
|
126
|
+
// =============================================================================
|
|
127
|
+
/** `deskcheck init` */
|
|
128
|
+
function initCommand() {
|
|
129
|
+
const projectRoot = resolveProjectRoot();
|
|
130
|
+
const deskchecDir = path.join(projectRoot, ".deskcheck");
|
|
131
|
+
const configPath = path.join(deskchecDir, "config.json");
|
|
132
|
+
const modulesDir = path.join(projectRoot, "deskcheck", "criteria");
|
|
133
|
+
let created = false;
|
|
134
|
+
if (!fs.existsSync(deskchecDir)) {
|
|
135
|
+
fs.mkdirSync(deskchecDir, { recursive: true });
|
|
136
|
+
console.log(`Created ${deskchecDir}/`);
|
|
137
|
+
created = true;
|
|
138
|
+
}
|
|
139
|
+
if (!fs.existsSync(configPath)) {
|
|
140
|
+
fs.writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2) + "\n");
|
|
141
|
+
console.log(`Created ${configPath}`);
|
|
142
|
+
created = true;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.log(`Config already exists: ${configPath}`);
|
|
146
|
+
}
|
|
147
|
+
if (!fs.existsSync(modulesDir)) {
|
|
148
|
+
fs.mkdirSync(modulesDir, { recursive: true });
|
|
149
|
+
console.log(`Created ${modulesDir}/`);
|
|
150
|
+
created = true;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
console.log(`Criteria directory already exists: ${modulesDir}/`);
|
|
154
|
+
}
|
|
155
|
+
if (!created) {
|
|
156
|
+
console.log("Already initialized — nothing to do.");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** `deskcheck list` */
|
|
160
|
+
function listCommand() {
|
|
161
|
+
const projectRoot = resolveProjectRoot();
|
|
162
|
+
const config = loadConfig(projectRoot);
|
|
163
|
+
const storage = new ReviewStorage(path.join(projectRoot, config.storage_dir));
|
|
164
|
+
const plans = storage.listPlans();
|
|
165
|
+
if (plans.length === 0) {
|
|
166
|
+
console.log("No deskcheck runs found.");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
console.log(`${padEnd("ID", 22)}${padEnd("Name", 40)}${padEnd("Status", 12)}Findings`);
|
|
170
|
+
for (const plan of plans) {
|
|
171
|
+
let findingsStr = "-";
|
|
172
|
+
try {
|
|
173
|
+
const results = storage.getResults(plan.planId);
|
|
174
|
+
if (results.summary.total > 0 || plan.status === "complete") {
|
|
175
|
+
findingsStr = formatFindingsSummary(results);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
// No results file yet
|
|
180
|
+
}
|
|
181
|
+
console.log(`${padEnd(plan.planId, 22)}${padEnd(plan.name, 40)}${padEnd(plan.status, 12)}${findingsStr}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** `deskcheck show [id]` */
|
|
185
|
+
function showCommand(id, options) {
|
|
186
|
+
const projectRoot = resolveProjectRoot();
|
|
187
|
+
const config = loadConfig(projectRoot);
|
|
188
|
+
const storage = new ReviewStorage(path.join(projectRoot, config.storage_dir));
|
|
189
|
+
const planId = id ?? storage.getLatestPlanId();
|
|
190
|
+
if (!planId) {
|
|
191
|
+
console.error("No deskcheck runs found.");
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
let plan;
|
|
195
|
+
let results;
|
|
196
|
+
try {
|
|
197
|
+
plan = storage.getPlan(planId);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
console.error(`Plan not found: ${planId}`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
results = storage.getResults(planId);
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
console.error(`Results not found for plan: ${planId}`);
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
console.log(renderOutput(results, plan, options.format));
|
|
211
|
+
process.exit(checkFailOn(results, options.failOn));
|
|
212
|
+
}
|
|
213
|
+
/** `deskcheck diff [...git-args]` — deterministic, no LLM planner. */
|
|
214
|
+
async function diffCommand(gitArgs, options) {
|
|
215
|
+
const projectRoot = resolveProjectRoot();
|
|
216
|
+
const config = loadConfig(projectRoot);
|
|
217
|
+
const storageDir = path.join(projectRoot, config.storage_dir);
|
|
218
|
+
const storage = new ReviewStorage(storageDir);
|
|
219
|
+
// Get changed files via git diff
|
|
220
|
+
// Insert --name-only right after "diff" so it comes before any -- path separators
|
|
221
|
+
const gitDiffArgs = ["diff", "--name-only", ...gitArgs];
|
|
222
|
+
let fileOutput;
|
|
223
|
+
try {
|
|
224
|
+
fileOutput = execFileSync("git", gitDiffArgs, {
|
|
225
|
+
cwd: projectRoot,
|
|
226
|
+
encoding: "utf-8",
|
|
227
|
+
timeout: 30_000,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
console.error(`${RED}Failed to run: git ${gitDiffArgs.join(" ")}${RESET}`);
|
|
232
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
233
|
+
process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
const files = fileOutput.split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
236
|
+
if (files.length === 0) {
|
|
237
|
+
console.log("No changed files found.");
|
|
238
|
+
process.exit(0);
|
|
239
|
+
}
|
|
240
|
+
// Discover modules and build plan
|
|
241
|
+
const modulesDir = path.resolve(projectRoot, config.modules_dir);
|
|
242
|
+
const modules = discoverModules(modulesDir);
|
|
243
|
+
// Build a human-readable name from git args
|
|
244
|
+
const diffTarget = gitArgs.filter((a) => !a.startsWith("--")).join(" ") || "working tree";
|
|
245
|
+
const planName = `diff: ${diffTarget}`;
|
|
246
|
+
const sourceTarget = gitArgs[0] ?? "HEAD";
|
|
247
|
+
const source = { type: "diff", target: sourceTarget };
|
|
248
|
+
const plan = buildPlanWithTasks(storage, planName, source, files, modules);
|
|
249
|
+
printPlanSummary(plan);
|
|
250
|
+
if (options.dryRun) {
|
|
251
|
+
console.log(`${DIM} Dry run — plan created but not executed.${RESET}`);
|
|
252
|
+
console.log(`${DIM} Plan ID: ${plan.plan_id}${RESET}`);
|
|
253
|
+
process.exit(0);
|
|
254
|
+
}
|
|
255
|
+
if (Object.keys(plan.tasks).length === 0) {
|
|
256
|
+
console.log(`${DIM} No criteria matched the changed files.${RESET}`);
|
|
257
|
+
process.exit(0);
|
|
258
|
+
}
|
|
259
|
+
// Execute
|
|
260
|
+
const orchestrator = new ReviewOrchestrator(config, projectRoot);
|
|
261
|
+
await executeAndPrint(orchestrator, plan.plan_id);
|
|
262
|
+
// Render results
|
|
263
|
+
const finalPlan = storage.getPlan(plan.plan_id);
|
|
264
|
+
const results = storage.getResults(plan.plan_id);
|
|
265
|
+
console.log(renderOutput(results, finalPlan, options.format));
|
|
266
|
+
process.exit(checkFailOn(results, options.failOn));
|
|
267
|
+
}
|
|
268
|
+
/** Default command — natural language deskcheck via LLM planner. */
|
|
269
|
+
async function deskchecCommand(prompt, options) {
|
|
270
|
+
const projectRoot = resolveProjectRoot();
|
|
271
|
+
const config = loadConfig(projectRoot);
|
|
272
|
+
const storageDir = path.join(projectRoot, config.storage_dir);
|
|
273
|
+
console.log(`${DIM}Planning...${RESET}`);
|
|
274
|
+
const planner = new ReviewPlanner(config, projectRoot);
|
|
275
|
+
const plan = await planner.plan(prompt);
|
|
276
|
+
printPlanSummary(plan);
|
|
277
|
+
// Execute
|
|
278
|
+
const orchestrator = new ReviewOrchestrator(config, projectRoot);
|
|
279
|
+
await executeAndPrint(orchestrator, plan.plan_id);
|
|
280
|
+
// Render results
|
|
281
|
+
const storage = new ReviewStorage(storageDir);
|
|
282
|
+
const finalPlan = storage.getPlan(plan.plan_id);
|
|
283
|
+
const results = storage.getResults(plan.plan_id);
|
|
284
|
+
console.log(renderTerminal(results, finalPlan));
|
|
285
|
+
process.exit(checkFailOn(results, options.failOn));
|
|
286
|
+
}
|
|
287
|
+
/** `deskcheck watch [plan-id]` */
|
|
288
|
+
async function watchCommand(planId) {
|
|
289
|
+
const projectRoot = resolveProjectRoot();
|
|
290
|
+
const config = loadConfig(projectRoot);
|
|
291
|
+
const storage = new ReviewStorage(path.join(projectRoot, config.storage_dir));
|
|
292
|
+
const resolvedId = planId ?? storage.getLatestPlanId();
|
|
293
|
+
if (!resolvedId) {
|
|
294
|
+
console.error("No deskcheck runs found. Start a deskcheck first.");
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
let lastPlanMtime = 0;
|
|
298
|
+
let lastResultsMtime = 0;
|
|
299
|
+
const planPath = path.join(projectRoot, config.storage_dir, resolvedId, "plan.json");
|
|
300
|
+
const resultsPath = path.join(projectRoot, config.storage_dir, resolvedId, "results.json");
|
|
301
|
+
const render = () => {
|
|
302
|
+
try {
|
|
303
|
+
const planMtime = fs.statSync(planPath).mtimeMs;
|
|
304
|
+
const resultsMtime = fs.existsSync(resultsPath) ? fs.statSync(resultsPath).mtimeMs : 0;
|
|
305
|
+
if (planMtime === lastPlanMtime && resultsMtime === lastResultsMtime)
|
|
306
|
+
return;
|
|
307
|
+
lastPlanMtime = planMtime;
|
|
308
|
+
lastResultsMtime = resultsMtime;
|
|
309
|
+
const plan = storage.getPlan(resolvedId);
|
|
310
|
+
let results = null;
|
|
311
|
+
try {
|
|
312
|
+
results = storage.getResults(resolvedId);
|
|
313
|
+
}
|
|
314
|
+
catch { /* no results yet */ }
|
|
315
|
+
// Clear screen and render
|
|
316
|
+
process.stdout.write("\x1b[2J\x1b[H");
|
|
317
|
+
process.stdout.write(renderWatch(plan, results));
|
|
318
|
+
// Auto-exit when complete
|
|
319
|
+
if (plan.status === "complete") {
|
|
320
|
+
clearInterval(interval);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// JSON parse error during mid-write — skip this tick, retry next
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
// Initial render
|
|
328
|
+
render();
|
|
329
|
+
// Poll every second
|
|
330
|
+
const interval = setInterval(render, 1000);
|
|
331
|
+
// Graceful Ctrl+C
|
|
332
|
+
process.on("SIGINT", () => {
|
|
333
|
+
clearInterval(interval);
|
|
334
|
+
console.log("");
|
|
335
|
+
process.exit(0);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
// =============================================================================
|
|
339
|
+
// Program
|
|
340
|
+
// =============================================================================
|
|
341
|
+
const program = new Command();
|
|
342
|
+
program
|
|
343
|
+
.name("deskcheck")
|
|
344
|
+
.description("Modular code deskcheck tool powered by Claude")
|
|
345
|
+
.version("0.1.0");
|
|
346
|
+
// Default command: natural language deskcheck
|
|
347
|
+
program
|
|
348
|
+
.argument("[prompt]", "What to check (natural language)")
|
|
349
|
+
.option("--fail-on <severities>", "Exit non-zero if findings match: critical, warning, info (comma-separated)")
|
|
350
|
+
.action(async (prompt, options) => {
|
|
351
|
+
if (!prompt) {
|
|
352
|
+
program.help();
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
await deskchecCommand(prompt, options);
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
360
|
+
process.exit(1);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
// Subcommand: diff — deterministic, no LLM
|
|
364
|
+
program
|
|
365
|
+
.command("diff")
|
|
366
|
+
.description("Check git diff changes (no LLM planner — deterministic)")
|
|
367
|
+
.argument("[git-args...]", "Arguments passed to git diff (e.g., develop, --staged, HEAD~3)")
|
|
368
|
+
.option("--format <format>", "Output format: terminal, markdown, json", "terminal")
|
|
369
|
+
.option("--fail-on <severities>", "Exit non-zero if findings match: critical, warning, info")
|
|
370
|
+
.option("--dry-run", "Show the plan without executing", false)
|
|
371
|
+
.option("--concurrency <n>", "Max concurrent executor agents", "5")
|
|
372
|
+
.addHelpText("after", `
|
|
373
|
+
Examples:
|
|
374
|
+
deskcheck diff develop Check changes vs develop branch
|
|
375
|
+
deskcheck diff --staged Check staged changes
|
|
376
|
+
deskcheck diff HEAD~3 Check last 3 commits
|
|
377
|
+
deskcheck diff main -- app/ Check changes in app/ vs main
|
|
378
|
+
deskcheck diff develop --dry-run Show plan without executing
|
|
379
|
+
deskcheck diff develop --fail-on=critical Exit non-zero on critical findings
|
|
380
|
+
`)
|
|
381
|
+
.action(async (gitArgs, options) => {
|
|
382
|
+
try {
|
|
383
|
+
await diffCommand(gitArgs, {
|
|
384
|
+
...options,
|
|
385
|
+
concurrency: parseInt(options.concurrency, 10) || 5,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
390
|
+
process.exit(1);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
// Subcommand: init
|
|
394
|
+
program
|
|
395
|
+
.command("init")
|
|
396
|
+
.description("Initialize deskcheck configuration and directories")
|
|
397
|
+
.action(() => {
|
|
398
|
+
try {
|
|
399
|
+
initCommand();
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
403
|
+
process.exit(1);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
// Subcommand: list
|
|
407
|
+
program
|
|
408
|
+
.command("list")
|
|
409
|
+
.description("List all deskcheck runs")
|
|
410
|
+
.action(() => {
|
|
411
|
+
try {
|
|
412
|
+
listCommand();
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
// Subcommand: show
|
|
420
|
+
program
|
|
421
|
+
.command("show")
|
|
422
|
+
.argument("[id]", "Plan ID (defaults to latest)")
|
|
423
|
+
.option("--format <format>", "Output format: terminal, markdown, json", "terminal")
|
|
424
|
+
.option("--fail-on <severities>", "Exit non-zero if findings match: critical, warning, info")
|
|
425
|
+
.description("Show results for a deskcheck run")
|
|
426
|
+
.action((id, options) => {
|
|
427
|
+
try {
|
|
428
|
+
showCommand(id, options);
|
|
429
|
+
}
|
|
430
|
+
catch (error) {
|
|
431
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
432
|
+
process.exit(1);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
// Subcommand: watch
|
|
436
|
+
program
|
|
437
|
+
.command("watch")
|
|
438
|
+
.argument("[plan-id]", "Plan ID to watch (defaults to latest)")
|
|
439
|
+
.description("Watch a deskcheck in progress — live tree view")
|
|
440
|
+
.action(async (planId) => {
|
|
441
|
+
try {
|
|
442
|
+
await watchCommand(planId);
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
446
|
+
process.exit(1);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
// Subcommand: serve
|
|
450
|
+
program
|
|
451
|
+
.command("serve")
|
|
452
|
+
.description("Start web UI for viewing deskcheck runs")
|
|
453
|
+
.option("--port <port>", "Port number (overrides config serve_port)")
|
|
454
|
+
.action((options) => {
|
|
455
|
+
try {
|
|
456
|
+
const projectRoot = resolveProjectRoot();
|
|
457
|
+
const config = loadConfig(projectRoot);
|
|
458
|
+
const port = options.port ? parseInt(options.port, 10) : config.serve_port;
|
|
459
|
+
startServer(config, projectRoot, port);
|
|
460
|
+
}
|
|
461
|
+
catch (error) {
|
|
462
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
463
|
+
process.exit(1);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
program.parse();
|
|
467
|
+
//# sourceMappingURL=cli.js.map
|
package/build/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC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AC,WAAW,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;QAC3E,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReviewConfig } from "./types.js";
|
|
2
|
+
/** Default configuration applied when no .deskcheck/config.json exists or fields are missing. */
|
|
3
|
+
export declare const DEFAULT_CONFIG: ReviewConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Load and validate the deskcheck tool configuration.
|
|
6
|
+
*
|
|
7
|
+
* Reads `.deskcheck/config.json` from the given project root. If the file exists,
|
|
8
|
+
* parses it and deep-merges with defaults so missing fields get default values.
|
|
9
|
+
* If the file does not exist, returns the full default configuration.
|
|
10
|
+
*
|
|
11
|
+
* @param projectRoot - Absolute path to the project root directory.
|
|
12
|
+
* @returns Fully populated ReviewConfig.
|
|
13
|
+
* @throws {Error} If the config file exists but contains invalid JSON.
|
|
14
|
+
*/
|
|
15
|
+
export declare function loadConfig(projectRoot: string): ReviewConfig;
|
|
16
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,iGAAiG;AACjG,eAAO,MAAM,cAAc,EAAE,YAa5B,CAAC;AA6CF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAyB5D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/** Default configuration applied when no .deskcheck/config.json exists or fields are missing. */
|
|
4
|
+
export const DEFAULT_CONFIG = {
|
|
5
|
+
modules_dir: "deskcheck/criteria",
|
|
6
|
+
storage_dir: ".deskcheck/runs",
|
|
7
|
+
serve_port: 3000,
|
|
8
|
+
shared: {
|
|
9
|
+
allowed_tools: ["Read", "Glob", "Grep"],
|
|
10
|
+
mcp_servers: {},
|
|
11
|
+
},
|
|
12
|
+
agents: {
|
|
13
|
+
planner: { model: "haiku" },
|
|
14
|
+
executor: {},
|
|
15
|
+
evaluator: { model: "haiku" },
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Deep-merge a partial user config on top of defaults.
|
|
20
|
+
*
|
|
21
|
+
* For plain objects, recursively merges keys so that user-supplied values
|
|
22
|
+
* override defaults while missing nested fields retain their defaults.
|
|
23
|
+
* For all other types (strings, arrays, primitives), the user value wins outright.
|
|
24
|
+
*/
|
|
25
|
+
function deepMerge(defaults, overrides) {
|
|
26
|
+
if (typeof defaults !== "object" ||
|
|
27
|
+
defaults === null ||
|
|
28
|
+
Array.isArray(defaults)) {
|
|
29
|
+
return (overrides ?? defaults);
|
|
30
|
+
}
|
|
31
|
+
const result = { ...defaults };
|
|
32
|
+
for (const key of Object.keys(overrides)) {
|
|
33
|
+
const defaultVal = defaults[key];
|
|
34
|
+
const overrideVal = overrides[key];
|
|
35
|
+
if (overrideVal === undefined) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (typeof defaultVal === "object" &&
|
|
39
|
+
defaultVal !== null &&
|
|
40
|
+
!Array.isArray(defaultVal) &&
|
|
41
|
+
typeof overrideVal === "object" &&
|
|
42
|
+
overrideVal !== null &&
|
|
43
|
+
!Array.isArray(overrideVal)) {
|
|
44
|
+
result[key] = deepMerge(defaultVal, overrideVal);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
result[key] = overrideVal;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Load and validate the deskcheck tool configuration.
|
|
54
|
+
*
|
|
55
|
+
* Reads `.deskcheck/config.json` from the given project root. If the file exists,
|
|
56
|
+
* parses it and deep-merges with defaults so missing fields get default values.
|
|
57
|
+
* If the file does not exist, returns the full default configuration.
|
|
58
|
+
*
|
|
59
|
+
* @param projectRoot - Absolute path to the project root directory.
|
|
60
|
+
* @returns Fully populated ReviewConfig.
|
|
61
|
+
* @throws {Error} If the config file exists but contains invalid JSON.
|
|
62
|
+
*/
|
|
63
|
+
export function loadConfig(projectRoot) {
|
|
64
|
+
const configPath = path.join(projectRoot, ".deskcheck", "config.json");
|
|
65
|
+
if (!fs.existsSync(configPath)) {
|
|
66
|
+
return structuredClone(DEFAULT_CONFIG);
|
|
67
|
+
}
|
|
68
|
+
const raw = fs.readFileSync(configPath, "utf-8");
|
|
69
|
+
let parsed;
|
|
70
|
+
try {
|
|
71
|
+
parsed = JSON.parse(raw);
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
throw new Error(`Invalid JSON in ${configPath}: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
75
|
+
}
|
|
76
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
77
|
+
throw new Error(`Invalid config in ${configPath}: expected a JSON object, got ${Array.isArray(parsed) ? "array" : typeof parsed}`);
|
|
78
|
+
}
|
|
79
|
+
return deepMerge(DEFAULT_CONFIG, parsed);
|
|
80
|
+
}
|
|
81
|
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AC,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM,EAAE,CAClH,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,cAAc,EAAE,MAA+B,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ContextType } from "./types.js";
|
|
2
|
+
/** The result of extracting review context for a task. */
|
|
3
|
+
export interface ExtractedContext {
|
|
4
|
+
contextType: ContextType;
|
|
5
|
+
content: string;
|
|
6
|
+
symbol: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Extract review context based on the source type.
|
|
10
|
+
*
|
|
11
|
+
* - diff: runs `git diff` for the given files against the source target
|
|
12
|
+
* - file: reads each file's content from disk
|
|
13
|
+
* - symbol: reads the file containing the symbol (symbol identification
|
|
14
|
+
* is left to the executor agent which has Read/Grep tools)
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractContext(sourceType: ContextType, sourceTarget: string, files: string[], projectRoot: string, symbol?: string): ExtractedContext;
|
|
17
|
+
//# sourceMappingURL=context-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-extractor.d.ts","sourceRoot":"","sources":["../../src/core/context-extractor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,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"}
|