@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.
- package/README.md +67 -12
- package/build/cli.js +110 -22
- package/build/cli.js.map +1 -1
- package/build/{core/config.d.ts → config/loader.d.ts} +9 -1
- package/build/config/loader.d.ts.map +1 -0
- package/build/{core/config.js → config/loader.js} +4 -2
- package/build/config/loader.js.map +1 -0
- package/build/config/types.d.ts +45 -0
- package/build/config/types.d.ts.map +1 -0
- package/build/config/types.js +2 -0
- package/build/config/types.js.map +1 -0
- package/build/mcp/tools.d.ts +1 -1
- package/build/mcp/tools.d.ts.map +1 -1
- package/build/mcp/tools.js +5 -5
- package/build/mcp/tools.js.map +1 -1
- package/build/mcp-server.js +1 -1
- package/build/mcp-server.js.map +1 -1
- package/build/{agents/executor-prompt.d.ts → prompts/ExecutorPrompt.d.ts} +6 -2
- package/build/prompts/ExecutorPrompt.d.ts.map +1 -0
- package/build/prompts/ExecutorPrompt.js +80 -0
- package/build/prompts/ExecutorPrompt.js.map +1 -0
- package/build/prompts/JudgePrompt.d.ts +16 -0
- package/build/prompts/JudgePrompt.d.ts.map +1 -0
- package/build/prompts/JudgePrompt.js +57 -0
- package/build/prompts/JudgePrompt.js.map +1 -0
- package/build/prompts/PlannerPrompt.d.ts +12 -0
- package/build/prompts/PlannerPrompt.d.ts.map +1 -0
- package/build/prompts/PlannerPrompt.js +34 -0
- package/build/prompts/PlannerPrompt.js.map +1 -0
- package/build/renderers/{json.d.ts → review/JsonRenderer.d.ts} +2 -2
- package/build/renderers/review/JsonRenderer.d.ts.map +1 -0
- package/build/renderers/{json.js → review/JsonRenderer.js} +1 -1
- package/build/renderers/review/JsonRenderer.js.map +1 -0
- package/build/renderers/{markdown.d.ts → review/MarkdownRenderer.d.ts} +2 -2
- package/build/renderers/review/MarkdownRenderer.d.ts.map +1 -0
- package/build/renderers/{markdown.js → review/MarkdownRenderer.js} +2 -2
- package/build/renderers/review/MarkdownRenderer.js.map +1 -0
- package/build/renderers/{terminal.d.ts → review/TerminalRenderer.d.ts} +2 -2
- package/build/renderers/review/TerminalRenderer.d.ts.map +1 -0
- package/build/renderers/{terminal.js → review/TerminalRenderer.js} +2 -2
- package/build/renderers/review/TerminalRenderer.js.map +1 -0
- package/build/renderers/{watch.d.ts → review/WatchRenderer.d.ts} +2 -2
- package/build/renderers/review/WatchRenderer.d.ts.map +1 -0
- package/build/renderers/{watch.js → review/WatchRenderer.js} +1 -1
- package/build/renderers/review/WatchRenderer.js.map +1 -0
- package/build/renderers/shared.d.ts +1 -1
- package/build/renderers/shared.d.ts.map +1 -1
- package/build/renderers/test/TerminalRenderer.d.ts +14 -0
- package/build/renderers/test/TerminalRenderer.d.ts.map +1 -0
- package/build/renderers/test/TerminalRenderer.js +233 -0
- package/build/renderers/test/TerminalRenderer.js.map +1 -0
- package/build/server/controllers/ReviewController.d.ts +23 -0
- package/build/server/controllers/ReviewController.d.ts.map +1 -0
- package/build/server/controllers/ReviewController.js +90 -0
- package/build/server/controllers/ReviewController.js.map +1 -0
- package/build/server/controllers/TestController.d.ts +2 -0
- package/build/server/controllers/TestController.d.ts.map +1 -0
- package/build/server/controllers/TestController.js +3 -0
- package/build/server/controllers/TestController.js.map +1 -0
- package/build/server/middleware/cors.d.ts +9 -0
- package/build/server/middleware/cors.d.ts.map +1 -0
- package/build/server/middleware/cors.js +18 -0
- package/build/server/middleware/cors.js.map +1 -0
- package/build/{serve.d.ts → server/server.d.ts} +2 -2
- package/build/server/server.d.ts.map +1 -0
- package/build/server/server.js +102 -0
- package/build/server/server.js.map +1 -0
- package/build/server/sse/FileWatcherSSE.d.ts +10 -0
- package/build/server/sse/FileWatcherSSE.d.ts.map +1 -0
- package/build/server/sse/FileWatcherSSE.js +89 -0
- package/build/server/sse/FileWatcherSSE.js.map +1 -0
- package/build/services/ExecutorService.d.ts +51 -0
- package/build/services/ExecutorService.d.ts.map +1 -0
- package/build/services/ExecutorService.js +133 -0
- package/build/services/ExecutorService.js.map +1 -0
- package/build/services/FindingsParserService.d.ts +10 -0
- package/build/services/FindingsParserService.d.ts.map +1 -0
- package/build/services/FindingsParserService.js +64 -0
- package/build/services/FindingsParserService.js.map +1 -0
- package/build/services/criteria/CriteriaService.d.ts +10 -0
- package/build/services/criteria/CriteriaService.d.ts.map +1 -0
- package/build/services/criteria/CriteriaService.js +10 -0
- package/build/services/criteria/CriteriaService.js.map +1 -0
- package/build/{core → services/criteria}/glob-matcher.d.ts +1 -1
- package/build/services/criteria/glob-matcher.d.ts.map +1 -0
- package/build/services/criteria/glob-matcher.js.map +1 -0
- package/build/{core → services/criteria}/module-parser.d.ts +13 -1
- package/build/services/criteria/module-parser.d.ts.map +1 -0
- package/build/{core → services/criteria}/module-parser.js +38 -0
- package/build/services/criteria/module-parser.js.map +1 -0
- package/build/{core/context-extractor.d.ts → services/review/ReviewContextExtractorService.d.ts} +2 -2
- package/build/services/review/ReviewContextExtractorService.d.ts.map +1 -0
- package/build/{core/context-extractor.js → services/review/ReviewContextExtractorService.js} +1 -1
- package/build/services/review/ReviewContextExtractorService.js.map +1 -0
- package/build/{agents/orchestrator.d.ts → services/review/ReviewOrchestratorService.d.ts} +5 -3
- package/build/services/review/ReviewOrchestratorService.d.ts.map +1 -0
- package/build/{agents/orchestrator.js → services/review/ReviewOrchestratorService.js} +15 -171
- package/build/services/review/ReviewOrchestratorService.js.map +1 -0
- package/build/{core/plan-builder.d.ts → services/review/ReviewPlanBuilderService.d.ts} +5 -4
- package/build/services/review/ReviewPlanBuilderService.d.ts.map +1 -0
- package/build/{core/plan-builder.js → services/review/ReviewPlanBuilderService.js} +2 -2
- package/build/services/review/ReviewPlanBuilderService.js.map +1 -0
- package/build/{agents/planner.d.ts → services/review/ReviewPlannerService.d.ts} +5 -4
- package/build/services/review/ReviewPlannerService.d.ts.map +1 -0
- package/build/{agents/planner.js → services/review/ReviewPlannerService.js} +13 -29
- package/build/services/review/ReviewPlannerService.js.map +1 -0
- package/build/{core/storage.d.ts → services/review/ReviewStorageService.d.ts} +3 -3
- package/build/services/review/ReviewStorageService.d.ts.map +1 -0
- package/build/{core/storage.js → services/review/ReviewStorageService.js} +6 -6
- package/build/services/review/ReviewStorageService.js.map +1 -0
- package/build/services/testing/JudgeService.d.ts +30 -0
- package/build/services/testing/JudgeService.d.ts.map +1 -0
- package/build/services/testing/JudgeService.js +95 -0
- package/build/services/testing/JudgeService.js.map +1 -0
- package/build/services/testing/TestDiscoveryService.d.ts +16 -0
- package/build/services/testing/TestDiscoveryService.d.ts.map +1 -0
- package/build/services/testing/TestDiscoveryService.js +66 -0
- package/build/services/testing/TestDiscoveryService.js.map +1 -0
- package/build/services/testing/TestRunnerService.d.ts +35 -0
- package/build/services/testing/TestRunnerService.d.ts.map +1 -0
- package/build/services/testing/TestRunnerService.js +140 -0
- package/build/services/testing/TestRunnerService.js.map +1 -0
- package/build/services/testing/TestScorerService.d.ts +9 -0
- package/build/services/testing/TestScorerService.d.ts.map +1 -0
- package/build/services/testing/TestScorerService.js +35 -0
- package/build/services/testing/TestScorerService.js.map +1 -0
- package/build/services/testing/TestStorageService.d.ts +39 -0
- package/build/services/testing/TestStorageService.d.ts.map +1 -0
- package/build/services/testing/TestStorageService.js +144 -0
- package/build/services/testing/TestStorageService.js.map +1 -0
- package/build/types/criteria.d.ts +24 -0
- package/build/types/criteria.d.ts.map +1 -0
- package/build/{core/types.js → types/criteria.js} +2 -2
- package/build/types/criteria.js.map +1 -0
- package/build/{core/types.d.ts → types/review.d.ts} +2 -64
- package/build/types/review.d.ts.map +1 -0
- package/build/types/review.js +2 -0
- package/build/types/review.js.map +1 -0
- package/build/types/testing.d.ts +109 -0
- package/build/types/testing.d.ts.map +1 -0
- package/build/types/testing.js +2 -0
- package/build/types/testing.js.map +1 -0
- package/package.json +1 -1
- package/build/agents/executor-prompt.d.ts.map +0 -1
- package/build/agents/executor-prompt.js +0 -65
- package/build/agents/executor-prompt.js.map +0 -1
- package/build/agents/orchestrator.d.ts.map +0 -1
- package/build/agents/orchestrator.js.map +0 -1
- package/build/agents/planner.d.ts.map +0 -1
- package/build/agents/planner.js.map +0 -1
- package/build/core/config.d.ts.map +0 -1
- package/build/core/config.js.map +0 -1
- package/build/core/context-extractor.d.ts.map +0 -1
- package/build/core/context-extractor.js.map +0 -1
- package/build/core/glob-matcher.d.ts.map +0 -1
- package/build/core/glob-matcher.js.map +0 -1
- package/build/core/module-parser.d.ts.map +0 -1
- package/build/core/module-parser.js.map +0 -1
- package/build/core/plan-builder.d.ts.map +0 -1
- package/build/core/plan-builder.js.map +0 -1
- package/build/core/storage.d.ts.map +0 -1
- package/build/core/storage.js.map +0 -1
- package/build/core/types.d.ts.map +0 -1
- package/build/core/types.js.map +0 -1
- package/build/renderers/json.d.ts.map +0 -1
- package/build/renderers/json.js.map +0 -1
- package/build/renderers/markdown.d.ts.map +0 -1
- package/build/renderers/markdown.js.map +0 -1
- package/build/renderers/terminal.d.ts.map +0 -1
- package/build/renderers/terminal.js.map +0 -1
- package/build/renderers/watch.d.ts.map +0 -1
- package/build/renderers/watch.js.map +0 -1
- package/build/serve.d.ts.map +0 -1
- package/build/serve.js +0 -249
- package/build/serve.js.map +0 -1
- /package/build/{core → services/criteria}/glob-matcher.js +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Stream SSE events when JSON files change in a watched directory.
|
|
5
|
+
*
|
|
6
|
+
* Watches the given directory for changes to `.json` files and emits
|
|
7
|
+
* `data: {"type":"update"}` events to the connected client. Falls back
|
|
8
|
+
* to polling if `fs.watch` is unavailable.
|
|
9
|
+
*/
|
|
10
|
+
export function handleSSE(res, storageDir, planId) {
|
|
11
|
+
const planDir = path.join(storageDir, planId);
|
|
12
|
+
if (!fs.existsSync(planDir)) {
|
|
13
|
+
const body = JSON.stringify({ error: `Plan not found: ${planId}` });
|
|
14
|
+
res.writeHead(404, {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
"Access-Control-Allow-Origin": "*",
|
|
17
|
+
"Cache-Control": "no-cache",
|
|
18
|
+
});
|
|
19
|
+
res.end(body);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
res.writeHead(200, {
|
|
23
|
+
"Content-Type": "text/event-stream",
|
|
24
|
+
"Access-Control-Allow-Origin": "*",
|
|
25
|
+
"Cache-Control": "no-cache",
|
|
26
|
+
"Connection": "keep-alive",
|
|
27
|
+
});
|
|
28
|
+
// Send initial keepalive
|
|
29
|
+
res.write(": connected\n\n");
|
|
30
|
+
// Watch the plan directory for changes to plan.json or results.json
|
|
31
|
+
let debounceTimer = null;
|
|
32
|
+
let watcher = null;
|
|
33
|
+
try {
|
|
34
|
+
watcher = fs.watch(planDir, (_eventType, filename) => {
|
|
35
|
+
if (filename !== "plan.json" && filename !== "results.json")
|
|
36
|
+
return;
|
|
37
|
+
// Debounce: plan.json and results.json often update in quick succession
|
|
38
|
+
if (debounceTimer)
|
|
39
|
+
clearTimeout(debounceTimer);
|
|
40
|
+
debounceTimer = setTimeout(() => {
|
|
41
|
+
try {
|
|
42
|
+
res.write('data: {"type":"update"}\n\n');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Client disconnected
|
|
46
|
+
cleanup();
|
|
47
|
+
}
|
|
48
|
+
}, 100);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// If fs.watch fails, fall back to polling
|
|
53
|
+
const pollInterval = setInterval(() => {
|
|
54
|
+
try {
|
|
55
|
+
res.write('data: {"type":"update"}\n\n');
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
clearInterval(pollInterval);
|
|
59
|
+
}
|
|
60
|
+
}, 2000);
|
|
61
|
+
res.on("close", () => {
|
|
62
|
+
clearInterval(pollInterval);
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
function cleanup() {
|
|
67
|
+
if (debounceTimer)
|
|
68
|
+
clearTimeout(debounceTimer);
|
|
69
|
+
if (watcher) {
|
|
70
|
+
watcher.close();
|
|
71
|
+
watcher = null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Keep-alive every 30s to prevent proxy timeouts
|
|
75
|
+
const keepalive = setInterval(() => {
|
|
76
|
+
try {
|
|
77
|
+
res.write(": keepalive\n\n");
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
cleanup();
|
|
81
|
+
clearInterval(keepalive);
|
|
82
|
+
}
|
|
83
|
+
}, 30_000);
|
|
84
|
+
res.on("close", () => {
|
|
85
|
+
cleanup();
|
|
86
|
+
clearInterval(keepalive);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=FileWatcherSSE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileWatcherSSE.js","sourceRoot":"","sources":["../../../src/server/sse/FileWatcherSSE.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,GAAwB,EACxB,UAAkB,EAClB,MAAc;IAEd,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAE9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,mBAAmB,MAAM,EAAE,EAAE,CAAC,CAAC;QACpE,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACjB,cAAc,EAAE,kBAAkB;YAClC,6BAA6B,EAAE,GAAG;YAClC,eAAe,EAAE,UAAU;SAC5B,CAAC,CAAC;QACH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACd,OAAO;IAC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AO;IACT,CAAC;IAED,SAAS,OAAO;QACd,IAAI,aAAa;YAAE,YAAY,CAAC,aAAa,CAAC,CAAC;QAC/C,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IAED,iDAAiD;IACjD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,IAAI,CAAC;YACH,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;YACV,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,EAAE,MAAM,CAAC,CAAC;IAEX,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,OAAO,EAAE,CAAC;QACV,aAAa,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { McpServerConfig as SdkMcpServerConfig, PermissionMode } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import type { ReviewConfig } from "../config/types.js";
|
|
3
|
+
import type { AgentModel } from "../types/criteria.js";
|
|
4
|
+
import type { TaskUsage } from "../types/review.js";
|
|
5
|
+
/** The result returned by ExecutorService.execute(). */
|
|
6
|
+
export interface ExecutorResult {
|
|
7
|
+
resultText: string;
|
|
8
|
+
usage: TaskUsage | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build the merged MCP servers map for an executor agent.
|
|
12
|
+
*
|
|
13
|
+
* Combines shared MCP servers from config with any additional servers
|
|
14
|
+
* defined for the executor role.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildMcpServers(config: ReviewConfig): Record<string, SdkMcpServerConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* Build the merged allowed tools list for an executor agent.
|
|
19
|
+
*
|
|
20
|
+
* Combines shared tools from config with any additional tools defined
|
|
21
|
+
* for the executor role.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildAllowedTools(config: ReviewConfig): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Spawns a single executor agent via the Claude Agent SDK and returns
|
|
26
|
+
* the result text and usage data.
|
|
27
|
+
*
|
|
28
|
+
* Encapsulates the query() call, AbortController timeout, MCP server
|
|
29
|
+
* merging, and tool merging so callers don't need to know these details.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ExecutorService {
|
|
32
|
+
private readonly config;
|
|
33
|
+
private readonly projectRoot;
|
|
34
|
+
constructor(config: ReviewConfig, projectRoot: string);
|
|
35
|
+
/**
|
|
36
|
+
* Execute an agent with the given prompt and model.
|
|
37
|
+
*
|
|
38
|
+
* @param prompt - The system prompt for the executor agent.
|
|
39
|
+
* @param model - The Claude model tier to use.
|
|
40
|
+
* @param options - Optional overrides for tools, MCP servers, max turns, timeout, and permission mode.
|
|
41
|
+
* @returns The result text and usage data from the agent run.
|
|
42
|
+
*/
|
|
43
|
+
execute(prompt: string, model: AgentModel, options?: {
|
|
44
|
+
maxTurns?: number;
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
tools?: string[];
|
|
47
|
+
mcpServers?: Record<string, SdkMcpServerConfig>;
|
|
48
|
+
permissionMode?: PermissionMode;
|
|
49
|
+
}): Promise<ExecutorResult>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=ExecutorService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutorService.d.ts","sourceRoot":"","sources":["../../src/services/ExecutorService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC5G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMpD,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAMD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CA2BxF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAahE;AAMD;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM;IAKrD;;;;;;;OAOG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAChD,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,GAAG,OAAO,CAAC,cAAc,CAAC;CAwD5B"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Helpers
|
|
4
|
+
// =============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Build the merged MCP servers map for an executor agent.
|
|
7
|
+
*
|
|
8
|
+
* Combines shared MCP servers from config with any additional servers
|
|
9
|
+
* defined for the executor role.
|
|
10
|
+
*/
|
|
11
|
+
export function buildMcpServers(config) {
|
|
12
|
+
const servers = {};
|
|
13
|
+
// Add shared servers
|
|
14
|
+
for (const [name, serverConfig] of Object.entries(config.shared.mcp_servers)) {
|
|
15
|
+
servers[name] = {
|
|
16
|
+
type: "stdio",
|
|
17
|
+
command: serverConfig.command,
|
|
18
|
+
args: serverConfig.args,
|
|
19
|
+
env: serverConfig.env,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// Add executor-specific additional servers
|
|
23
|
+
const executorServers = config.agents.executor.additional_mcp_servers;
|
|
24
|
+
if (executorServers) {
|
|
25
|
+
for (const [name, serverConfig] of Object.entries(executorServers)) {
|
|
26
|
+
servers[name] = {
|
|
27
|
+
type: "stdio",
|
|
28
|
+
command: serverConfig.command,
|
|
29
|
+
args: serverConfig.args,
|
|
30
|
+
env: serverConfig.env,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return servers;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build the merged allowed tools list for an executor agent.
|
|
38
|
+
*
|
|
39
|
+
* Combines shared tools from config with any additional tools defined
|
|
40
|
+
* for the executor role.
|
|
41
|
+
*/
|
|
42
|
+
export function buildAllowedTools(config) {
|
|
43
|
+
const tools = [...config.shared.allowed_tools];
|
|
44
|
+
const executorTools = config.agents.executor.additional_tools;
|
|
45
|
+
if (executorTools) {
|
|
46
|
+
for (const tool of executorTools) {
|
|
47
|
+
if (!tools.includes(tool)) {
|
|
48
|
+
tools.push(tool);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return tools;
|
|
53
|
+
}
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// ExecutorService
|
|
56
|
+
// =============================================================================
|
|
57
|
+
/**
|
|
58
|
+
* Spawns a single executor agent via the Claude Agent SDK and returns
|
|
59
|
+
* the result text and usage data.
|
|
60
|
+
*
|
|
61
|
+
* Encapsulates the query() call, AbortController timeout, MCP server
|
|
62
|
+
* merging, and tool merging so callers don't need to know these details.
|
|
63
|
+
*/
|
|
64
|
+
export class ExecutorService {
|
|
65
|
+
config;
|
|
66
|
+
projectRoot;
|
|
67
|
+
constructor(config, projectRoot) {
|
|
68
|
+
this.config = config;
|
|
69
|
+
this.projectRoot = projectRoot;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Execute an agent with the given prompt and model.
|
|
73
|
+
*
|
|
74
|
+
* @param prompt - The system prompt for the executor agent.
|
|
75
|
+
* @param model - The Claude model tier to use.
|
|
76
|
+
* @param options - Optional overrides for tools, MCP servers, max turns, timeout, and permission mode.
|
|
77
|
+
* @returns The result text and usage data from the agent run.
|
|
78
|
+
*/
|
|
79
|
+
async execute(prompt, model, options) {
|
|
80
|
+
const allowedTools = options?.tools ?? buildAllowedTools(this.config);
|
|
81
|
+
const mcpServers = options?.mcpServers ?? buildMcpServers(this.config);
|
|
82
|
+
const maxTurns = options?.maxTurns ?? 25;
|
|
83
|
+
const timeoutMs = options?.timeoutMs ?? 5 * 60 * 1000;
|
|
84
|
+
const permissionMode = options?.permissionMode ?? "dontAsk";
|
|
85
|
+
const abortController = new AbortController();
|
|
86
|
+
const timeout = setTimeout(() => abortController.abort(), timeoutMs);
|
|
87
|
+
let resultText = "";
|
|
88
|
+
let taskUsage = null;
|
|
89
|
+
try {
|
|
90
|
+
for await (const message of query({
|
|
91
|
+
prompt,
|
|
92
|
+
options: {
|
|
93
|
+
model,
|
|
94
|
+
tools: allowedTools,
|
|
95
|
+
permissionMode,
|
|
96
|
+
maxTurns,
|
|
97
|
+
cwd: this.projectRoot,
|
|
98
|
+
persistSession: false,
|
|
99
|
+
abortController,
|
|
100
|
+
...(Object.keys(mcpServers).length > 0 ? { mcpServers } : {}),
|
|
101
|
+
},
|
|
102
|
+
})) {
|
|
103
|
+
if (message.type === "result") {
|
|
104
|
+
// Capture usage data from result (available on both success and error)
|
|
105
|
+
const msg = message;
|
|
106
|
+
const usage = msg.usage;
|
|
107
|
+
taskUsage = {
|
|
108
|
+
input_tokens: usage?.input_tokens ?? 0,
|
|
109
|
+
output_tokens: usage?.output_tokens ?? 0,
|
|
110
|
+
cache_read_tokens: usage?.cache_read_input_tokens ?? 0,
|
|
111
|
+
cache_creation_tokens: usage?.cache_creation_input_tokens ?? 0,
|
|
112
|
+
cost_usd: msg.total_cost_usd ?? 0,
|
|
113
|
+
duration_ms: msg.duration_ms ?? 0,
|
|
114
|
+
duration_api_ms: msg.duration_api_ms ?? 0,
|
|
115
|
+
num_turns: msg.num_turns ?? 0,
|
|
116
|
+
model,
|
|
117
|
+
};
|
|
118
|
+
if (message.subtype === "success") {
|
|
119
|
+
resultText = message.result;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
throw new Error(`Executor failed: ${message.errors.join(", ")}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
clearTimeout(timeout);
|
|
129
|
+
}
|
|
130
|
+
return { resultText, usage: taskUsage };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=ExecutorService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutorService.js","sourceRoot":"","sources":["../../src/services/ExecutorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAgBvD,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,MAAM,OAAO,GAAuC,EAAE,CAAC;IAEvD,qBAAqB;IACrB,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,GAAG;YACd,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,YAAY,CAAC,OAAO;YAC7B,IAAI,EAAE,YAAY,C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G,OAAkC,CAAC;oBAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,KAA2C,CAAC;oBAC9D,SAAS,GAAG;wBACV,YAAY,EAAE,KAAK,EAAE,YAAY,IAAI,CAAC;wBACtC,aAAa,EAAE,KAAK,EAAE,aAAa,IAAI,CAAC;wBACxC,iBAAiB,EAAE,KAAK,EAAE,uBAAuB,IAAI,CAAC;wBACtD,qBAAqB,EAAE,KAAK,EAAE,2BAA2B,IAAI,CAAC;wBAC9D,QAAQ,EAAG,GAAG,CAAC,cAAyB,IAAI,CAAC;wBAC7C,WAAW,EAAG,GAAG,CAAC,WAAsB,IAAI,CAAC;wBAC7C,eAAe,EAAG,GAAG,CAAC,eAA0B,IAAI,CAAC;wBACrD,SAAS,EAAG,GAAG,CAAC,SAAoB,IAAI,CAAC;wBACzC,KAAK;qBACN,CAAC;oBAEF,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;wBAClC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;oBAC9B,CAAC;yBAAM,CAAC;wBACN,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QAED,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Finding } from "../types/review.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse executor output into a validated array of findings.
|
|
4
|
+
*
|
|
5
|
+
* The executor is instructed to output only a JSON array. This function
|
|
6
|
+
* extracts the JSON from the response text, handles cases where the agent
|
|
7
|
+
* wraps it in markdown fences, and validates each finding's structure.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseFindings(output: string): Finding[];
|
|
10
|
+
//# sourceMappingURL=FindingsParserService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindingsParserService.d.ts","sourceRoot":"","sources":["../../src/services/FindingsParserService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,oBAAoB,CAAC;AAQnE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,CA0DvD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const VALID_SEVERITIES = new Set([
|
|
2
|
+
"critical",
|
|
3
|
+
"warning",
|
|
4
|
+
"info",
|
|
5
|
+
]);
|
|
6
|
+
/**
|
|
7
|
+
* Parse executor output into a validated array of findings.
|
|
8
|
+
*
|
|
9
|
+
* The executor is instructed to output only a JSON array. This function
|
|
10
|
+
* extracts the JSON from the response text, handles cases where the agent
|
|
11
|
+
* wraps it in markdown fences, and validates each finding's structure.
|
|
12
|
+
*/
|
|
13
|
+
export function parseFindings(output) {
|
|
14
|
+
// Try to extract JSON array from the output
|
|
15
|
+
let jsonText = output.trim();
|
|
16
|
+
// Strip markdown code fences if present
|
|
17
|
+
const fencedMatch = jsonText.match(/```(?:json)?\s*\n?([\s\S]*?)\n?\s*```/);
|
|
18
|
+
if (fencedMatch) {
|
|
19
|
+
jsonText = fencedMatch[1].trim();
|
|
20
|
+
}
|
|
21
|
+
// Find the JSON array boundaries
|
|
22
|
+
const startIdx = jsonText.indexOf("[");
|
|
23
|
+
const endIdx = jsonText.lastIndexOf("]");
|
|
24
|
+
if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) {
|
|
25
|
+
console.error(`[deskcheck] Warning: executor output did not contain a JSON array. Output: ${output.slice(0, 200)}`);
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
jsonText = jsonText.slice(startIdx, endIdx + 1);
|
|
29
|
+
let parsed;
|
|
30
|
+
try {
|
|
31
|
+
parsed = JSON.parse(jsonText);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error(`[deskcheck] Warning: failed to parse executor JSON output: ${error instanceof Error ? error.message : String(error)}. Output: ${jsonText.slice(0, 200)}`);
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
if (!Array.isArray(parsed)) {
|
|
38
|
+
console.error(`[deskcheck] Warning: executor output parsed but was not an array. Type: ${typeof parsed}`);
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
// Validate and normalize each finding
|
|
42
|
+
const findings = [];
|
|
43
|
+
for (const item of parsed) {
|
|
44
|
+
if (typeof item !== "object" || item === null) {
|
|
45
|
+
console.error(`[deskcheck] Warning: skipping invalid finding (not an object): ${JSON.stringify(item).slice(0, 100)}`);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const record = item;
|
|
49
|
+
const severity = String(record.severity ?? "info");
|
|
50
|
+
if (!VALID_SEVERITIES.has(severity)) {
|
|
51
|
+
console.error(`[deskcheck] Warning: skipping finding with invalid severity "${severity}"`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
findings.push({
|
|
55
|
+
severity: severity,
|
|
56
|
+
file: String(record.file ?? ""),
|
|
57
|
+
line: typeof record.line === "number" ? record.line : null,
|
|
58
|
+
description: String(record.description ?? ""),
|
|
59
|
+
suggestion: typeof record.suggestion === "string" ? record.suggestion : null,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return findings;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=FindingsParserService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FindingsParserService.js","sourceRoot":"","sources":["../../src/services/FindingsParserService.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAkB;IACrE,UAAU;IACV,SAAS;IACT,MAAM;CACP,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAA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
|
2
|
+
* Facade for criteria discovery and file matching.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports functions from module-parser and glob-matcher so consumers
|
|
5
|
+
* can import from a single location. The underlying implementations stay
|
|
6
|
+
* in their current files for now.
|
|
7
|
+
*/
|
|
8
|
+
export { discoverModules as discoverCriteria, filterModules as filterCriteria, parseModule as parseCriterion, } from "./module-parser.js";
|
|
9
|
+
export { findMatchingModules as matchFiles, fileMatchesGlobs, } from "./glob-matcher.js";
|
|
10
|
+
//# sourceMappingURL=CriteriaService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CriteriaService.d.ts","sourceRoot":"","sources":["../../../src/services/criteria/CriteriaService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,IAAI,gBAAgB,EACnC,aAAa,IAAI,cAAc,EAC/B,WAAW,IAAI,cAAc,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,IAAI,UAAU,EACjC,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Facade for criteria discovery and file matching.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports functions from module-parser and glob-matcher so consumers
|
|
5
|
+
* can import from a single location. The underlying implementations stay
|
|
6
|
+
* in their current files for now.
|
|
7
|
+
*/
|
|
8
|
+
export { discoverModules as discoverCriteria, filterModules as filterCriteria, parseModule as parseCriterion, } from "./module-parser.js";
|
|
9
|
+
export { findMatchingModules as matchFiles, fileMatchesGlobs, } from "./glob-matcher.js";
|
|
10
|
+
//# sourceMappingURL=CriteriaService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CriteriaService.js","sourceRoot":"","sources":["../../../src/services/criteria/CriteriaService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,IAAI,gBAAgB,EACnC,aAAa,IAAI,cAAc,EAC/B,WAAW,IAAI,cAAc,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,IAAI,UAAU,EACjC,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob-matcher.d.ts","sourceRoot":"","sources":["../../../src/services/criteria/glob-matcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,qEAAqE;IACrE,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAyB3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,YAAY,EAAE,GACtB,WAAW,EAAE,CAcf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob-matcher.js","sourceRoot":"","sources":["../../../src/services/criteria/glob-matcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAWtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,KAAe;IAChE,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACrD,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7B,CAAC;IAEF,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACvD,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7B,CAAC;IAEF,OAAO,CAAC,gBAAgB,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAsB,EACtB,OAAuB;IAEvB,MAAM,OAAO,GAAkB,EAAE,CAAC;IAElC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAChD,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CACrC,CAAC;QAEF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReviewModule } from "
|
|
1
|
+
import type { ReviewModule } from "../../types/criteria.js";
|
|
2
2
|
/**
|
|
3
3
|
* Parse a single criterion markdown file into a ReviewModule object.
|
|
4
4
|
*
|
|
@@ -23,4 +23,16 @@ export declare function parseModule(filePath: string, basePath: string): ReviewM
|
|
|
23
23
|
* @throws {Error} If the directory does not exist or any criterion file has invalid frontmatter.
|
|
24
24
|
*/
|
|
25
25
|
export declare function discoverModules(modulesDir: string): ReviewModule[];
|
|
26
|
+
/**
|
|
27
|
+
* Filter modules by criteria name patterns.
|
|
28
|
+
*
|
|
29
|
+
* Each pattern is matched against the module ID. A match occurs if the
|
|
30
|
+
* pattern equals the full ID or the final segment (filename without path).
|
|
31
|
+
* For example, "dto-enforcement" matches "architecture/dto-enforcement".
|
|
32
|
+
*
|
|
33
|
+
* @param modules - All discovered modules.
|
|
34
|
+
* @param patterns - Criteria name patterns to include (e.g., ["dto-enforcement", "backend/controller-conventions"]).
|
|
35
|
+
* @returns Filtered modules. Throws if any pattern matched nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare function filterModules(modules: ReviewModule[], patterns: string[]): ReviewModule[];
|
|
26
38
|
//# sourceMappingURL=module-parser.d.ts.map
|
|
@@ -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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AAI,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"}
|
package/build/{core/context-extractor.d.ts → services/review/ReviewContextExtractorService.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextType } from "
|
|
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=
|
|
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"}
|
|
@@ -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,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACjD,MAAM;QACR;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,UAAU,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO;QACL,WAAW,EAAE,UAAU;QACvB,OAAO;QACP,MAAM,EAAE,MAAM,IAAI,IAAI;KACvB,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,SAAS,kBAAkB,CACzB,MAAc,EACd,KAAe,EACf,WAAmB;IAEnB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,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C,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ReviewConfig
|
|
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";
|
|
@@ -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
|
|
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=
|
|
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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