@ginkoai/cli 1.6.2 → 1.7.1
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/dist/commands/agent/agent-client.d.ts +150 -0
- package/dist/commands/agent/agent-client.d.ts.map +1 -0
- package/dist/commands/agent/agent-client.js +170 -0
- package/dist/commands/agent/agent-client.js.map +1 -0
- package/dist/commands/agent/index.d.ts +22 -0
- package/dist/commands/agent/index.d.ts.map +1 -0
- package/dist/commands/agent/index.js +121 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/agent/list.d.ts +22 -0
- package/dist/commands/agent/list.d.ts.map +1 -0
- package/dist/commands/agent/list.js +119 -0
- package/dist/commands/agent/list.js.map +1 -0
- package/dist/commands/agent/register.d.ts +21 -0
- package/dist/commands/agent/register.d.ts.map +1 -0
- package/dist/commands/agent/register.js +97 -0
- package/dist/commands/agent/register.js.map +1 -0
- package/dist/commands/agent/status.d.ts +19 -0
- package/dist/commands/agent/status.d.ts.map +1 -0
- package/dist/commands/agent/status.js +271 -0
- package/dist/commands/agent/status.js.map +1 -0
- package/dist/commands/agent/work.d.ts +22 -0
- package/dist/commands/agent/work.d.ts.map +1 -0
- package/dist/commands/agent/work.js +459 -0
- package/dist/commands/agent/work.js.map +1 -0
- package/dist/commands/checkpoint/create.d.ts +27 -0
- package/dist/commands/checkpoint/create.d.ts.map +1 -0
- package/dist/commands/checkpoint/create.js +82 -0
- package/dist/commands/checkpoint/create.js.map +1 -0
- package/dist/commands/checkpoint/index.d.ts +23 -0
- package/dist/commands/checkpoint/index.d.ts.map +1 -0
- package/dist/commands/checkpoint/index.js +91 -0
- package/dist/commands/checkpoint/index.js.map +1 -0
- package/dist/commands/checkpoint/list.d.ts +27 -0
- package/dist/commands/checkpoint/list.d.ts.map +1 -0
- package/dist/commands/checkpoint/list.js +115 -0
- package/dist/commands/checkpoint/list.js.map +1 -0
- package/dist/commands/checkpoint/show.d.ts +23 -0
- package/dist/commands/checkpoint/show.d.ts.map +1 -0
- package/dist/commands/checkpoint/show.js +102 -0
- package/dist/commands/checkpoint/show.js.map +1 -0
- package/dist/commands/dlq.d.ts +24 -0
- package/dist/commands/dlq.d.ts.map +1 -0
- package/dist/commands/dlq.js +172 -0
- package/dist/commands/dlq.js.map +1 -0
- package/dist/commands/escalation/create.d.ts +22 -0
- package/dist/commands/escalation/create.d.ts.map +1 -0
- package/dist/commands/escalation/create.js +122 -0
- package/dist/commands/escalation/create.js.map +1 -0
- package/dist/commands/escalation/escalation-client.d.ts +101 -0
- package/dist/commands/escalation/escalation-client.d.ts.map +1 -0
- package/dist/commands/escalation/escalation-client.js +129 -0
- package/dist/commands/escalation/escalation-client.js.map +1 -0
- package/dist/commands/escalation/index.d.ts +22 -0
- package/dist/commands/escalation/index.d.ts.map +1 -0
- package/dist/commands/escalation/index.js +94 -0
- package/dist/commands/escalation/index.js.map +1 -0
- package/dist/commands/escalation/list.d.ts +24 -0
- package/dist/commands/escalation/list.d.ts.map +1 -0
- package/dist/commands/escalation/list.js +170 -0
- package/dist/commands/escalation/list.js.map +1 -0
- package/dist/commands/escalation/resolve.d.ts +20 -0
- package/dist/commands/escalation/resolve.d.ts.map +1 -0
- package/dist/commands/escalation/resolve.js +102 -0
- package/dist/commands/escalation/resolve.js.map +1 -0
- package/dist/commands/graph/api-client.d.ts +21 -1
- package/dist/commands/graph/api-client.d.ts.map +1 -1
- package/dist/commands/graph/api-client.js +23 -0
- package/dist/commands/graph/api-client.js.map +1 -1
- package/dist/commands/handoff.d.ts.map +1 -1
- package/dist/commands/handoff.js +9 -1
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/log.d.ts +3 -0
- package/dist/commands/log.d.ts.map +1 -1
- package/dist/commands/log.js +73 -14
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/notifications/history.d.ts +21 -0
- package/dist/commands/notifications/history.d.ts.map +1 -0
- package/dist/commands/notifications/history.js +160 -0
- package/dist/commands/notifications/history.js.map +1 -0
- package/dist/commands/notifications/index.d.ts +22 -0
- package/dist/commands/notifications/index.d.ts.map +1 -0
- package/dist/commands/notifications/index.js +87 -0
- package/dist/commands/notifications/index.js.map +1 -0
- package/dist/commands/notifications/list.d.ts +19 -0
- package/dist/commands/notifications/list.d.ts.map +1 -0
- package/dist/commands/notifications/list.js +132 -0
- package/dist/commands/notifications/list.js.map +1 -0
- package/dist/commands/notifications/test.d.ts +19 -0
- package/dist/commands/notifications/test.d.ts.map +1 -0
- package/dist/commands/notifications/test.js +217 -0
- package/dist/commands/notifications/test.js.map +1 -0
- package/dist/commands/orchestrate.d.ts +25 -0
- package/dist/commands/orchestrate.d.ts.map +1 -0
- package/dist/commands/orchestrate.js +858 -0
- package/dist/commands/orchestrate.js.map +1 -0
- package/dist/commands/sprint/deps.d.ts +29 -0
- package/dist/commands/sprint/deps.d.ts.map +1 -0
- package/dist/commands/sprint/deps.js +269 -0
- package/dist/commands/sprint/deps.js.map +1 -0
- package/dist/commands/sprint/index.d.ts +10 -5
- package/dist/commands/sprint/index.d.ts.map +1 -1
- package/dist/commands/sprint/index.js +26 -5
- package/dist/commands/sprint/index.js.map +1 -1
- package/dist/commands/start/index.d.ts.map +1 -1
- package/dist/commands/start/index.js +6 -0
- package/dist/commands/start/index.js.map +1 -1
- package/dist/commands/start/start-reflection.d.ts.map +1 -1
- package/dist/commands/start/start-reflection.js +8 -0
- package/dist/commands/start/start-reflection.js.map +1 -1
- package/dist/commands/verify.d.ts +17 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +232 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/core/session-log-manager.d.ts +1 -1
- package/dist/core/session-log-manager.d.ts.map +1 -1
- package/dist/index.js +78 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/__tests__/task-timeout.test.d.ts +12 -0
- package/dist/lib/__tests__/task-timeout.test.d.ts.map +1 -0
- package/dist/lib/__tests__/task-timeout.test.js +278 -0
- package/dist/lib/__tests__/task-timeout.test.js.map +1 -0
- package/dist/lib/agent-heartbeat.d.ts +68 -0
- package/dist/lib/agent-heartbeat.d.ts.map +1 -0
- package/dist/lib/agent-heartbeat.js +117 -0
- package/dist/lib/agent-heartbeat.js.map +1 -0
- package/dist/lib/checkpoint.d.ts +85 -0
- package/dist/lib/checkpoint.d.ts.map +1 -0
- package/dist/lib/checkpoint.js +323 -0
- package/dist/lib/checkpoint.js.map +1 -0
- package/dist/lib/context-metrics.d.ts +230 -0
- package/dist/lib/context-metrics.d.ts.map +1 -0
- package/dist/lib/context-metrics.js +372 -0
- package/dist/lib/context-metrics.js.map +1 -0
- package/dist/lib/dead-letter-queue.d.ts +108 -0
- package/dist/lib/dead-letter-queue.d.ts.map +1 -0
- package/dist/lib/dead-letter-queue.js +378 -0
- package/dist/lib/dead-letter-queue.js.map +1 -0
- package/dist/lib/event-logger.d.ts +9 -1
- package/dist/lib/event-logger.d.ts.map +1 -1
- package/dist/lib/event-logger.js +45 -3
- package/dist/lib/event-logger.js.map +1 -1
- package/dist/lib/event-queue.d.ts.map +1 -1
- package/dist/lib/event-queue.js +13 -2
- package/dist/lib/event-queue.js.map +1 -1
- package/dist/lib/examples/timeout-demo.d.ts +13 -0
- package/dist/lib/examples/timeout-demo.d.ts.map +1 -0
- package/dist/lib/examples/timeout-demo.js +102 -0
- package/dist/lib/examples/timeout-demo.js.map +1 -0
- package/dist/lib/examples/timeout-integration-example.d.ts +17 -0
- package/dist/lib/examples/timeout-integration-example.d.ts.map +1 -0
- package/dist/lib/examples/timeout-integration-example.js +223 -0
- package/dist/lib/examples/timeout-integration-example.js.map +1 -0
- package/dist/lib/notification-hooks.d.ts +103 -0
- package/dist/lib/notification-hooks.d.ts.map +1 -0
- package/dist/lib/notification-hooks.js +223 -0
- package/dist/lib/notification-hooks.js.map +1 -0
- package/dist/lib/notifications/discord.d.ts +20 -0
- package/dist/lib/notifications/discord.d.ts.map +1 -0
- package/dist/lib/notifications/discord.js +140 -0
- package/dist/lib/notifications/discord.js.map +1 -0
- package/dist/lib/notifications/index.d.ts +66 -0
- package/dist/lib/notifications/index.d.ts.map +1 -0
- package/dist/lib/notifications/index.js +120 -0
- package/dist/lib/notifications/index.js.map +1 -0
- package/dist/lib/notifications/slack.d.ts +20 -0
- package/dist/lib/notifications/slack.d.ts.map +1 -0
- package/dist/lib/notifications/slack.js +186 -0
- package/dist/lib/notifications/slack.js.map +1 -0
- package/dist/lib/notifications/teams.d.ts +20 -0
- package/dist/lib/notifications/teams.d.ts.map +1 -0
- package/dist/lib/notifications/teams.js +146 -0
- package/dist/lib/notifications/teams.js.map +1 -0
- package/dist/lib/notifications/webhook.d.ts +23 -0
- package/dist/lib/notifications/webhook.d.ts.map +1 -0
- package/dist/lib/notifications/webhook.js +65 -0
- package/dist/lib/notifications/webhook.js.map +1 -0
- package/dist/lib/orchestrator-state.d.ts +194 -0
- package/dist/lib/orchestrator-state.d.ts.map +1 -0
- package/dist/lib/orchestrator-state.js +332 -0
- package/dist/lib/orchestrator-state.js.map +1 -0
- package/dist/lib/realtime-cursor.d.ts +107 -0
- package/dist/lib/realtime-cursor.d.ts.map +1 -0
- package/dist/lib/realtime-cursor.js +260 -0
- package/dist/lib/realtime-cursor.js.map +1 -0
- package/dist/lib/rollback.d.ts +86 -0
- package/dist/lib/rollback.d.ts.map +1 -0
- package/dist/lib/rollback.js +405 -0
- package/dist/lib/rollback.js.map +1 -0
- package/dist/lib/sprint-loader.d.ts +39 -2
- package/dist/lib/sprint-loader.d.ts.map +1 -1
- package/dist/lib/sprint-loader.js +269 -5
- package/dist/lib/sprint-loader.js.map +1 -1
- package/dist/lib/stale-agent-detector.d.ts +102 -0
- package/dist/lib/stale-agent-detector.d.ts.map +1 -0
- package/dist/lib/stale-agent-detector.js +156 -0
- package/dist/lib/stale-agent-detector.js.map +1 -0
- package/dist/lib/task-dependencies.d.ts +143 -0
- package/dist/lib/task-dependencies.d.ts.map +1 -0
- package/dist/lib/task-dependencies.js +357 -0
- package/dist/lib/task-dependencies.js.map +1 -0
- package/dist/lib/task-timeout.d.ts +153 -0
- package/dist/lib/task-timeout.d.ts.map +1 -0
- package/dist/lib/task-timeout.js +505 -0
- package/dist/lib/task-timeout.js.map +1 -0
- package/dist/lib/verification/build-check.d.ts +55 -0
- package/dist/lib/verification/build-check.d.ts.map +1 -0
- package/dist/lib/verification/build-check.js +111 -0
- package/dist/lib/verification/build-check.js.map +1 -0
- package/dist/lib/verification/index.d.ts +19 -0
- package/dist/lib/verification/index.d.ts.map +1 -0
- package/dist/lib/verification/index.js +17 -0
- package/dist/lib/verification/index.js.map +1 -0
- package/dist/lib/verification/lint-check.d.ts +34 -0
- package/dist/lib/verification/lint-check.d.ts.map +1 -0
- package/dist/lib/verification/lint-check.js +215 -0
- package/dist/lib/verification/lint-check.js.map +1 -0
- package/dist/lib/verification/test-runner.d.ts +50 -0
- package/dist/lib/verification/test-runner.d.ts.map +1 -0
- package/dist/lib/verification/test-runner.js +225 -0
- package/dist/lib/verification/test-runner.js.map +1 -0
- package/dist/utils/command-helpers.d.ts.map +1 -1
- package/dist/utils/command-helpers.js +7 -0
- package/dist/utils/command-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: verification, build, health-check, CI
|
|
6
|
+
* @related: packages/cli/src/lib/verification/test-check.ts
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: fs-extra, child_process
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Result of running a build verification
|
|
13
|
+
*/
|
|
14
|
+
export interface BuildResult {
|
|
15
|
+
passed: boolean;
|
|
16
|
+
output: string;
|
|
17
|
+
errorOutput?: string;
|
|
18
|
+
duration_ms: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Options for build verification
|
|
22
|
+
*/
|
|
23
|
+
export interface BuildCheckOptions {
|
|
24
|
+
/** Maximum time to wait for build in milliseconds (default: 600000 = 10 min) */
|
|
25
|
+
timeout?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Runs build verification for a project
|
|
29
|
+
*
|
|
30
|
+
* Automatically detects build command and executes it, capturing output.
|
|
31
|
+
* Handles errors gracefully and returns structured results.
|
|
32
|
+
*
|
|
33
|
+
* @param projectRoot - Absolute path to project root
|
|
34
|
+
* @param options - Build check options
|
|
35
|
+
* @returns Build result with success status, output, and duration
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const result = await runBuild('/path/to/project');
|
|
40
|
+
* if (result.passed) {
|
|
41
|
+
* console.log('Build successful in', result.duration_ms, 'ms');
|
|
42
|
+
* } else {
|
|
43
|
+
* console.error('Build failed:', result.errorOutput);
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function runBuild(projectRoot: string, options?: BuildCheckOptions): Promise<BuildResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Checks if a project has a buildable configuration
|
|
50
|
+
*
|
|
51
|
+
* @param projectRoot - Absolute path to project root
|
|
52
|
+
* @returns True if project has package.json or tsconfig.json
|
|
53
|
+
*/
|
|
54
|
+
export declare function isBuildable(projectRoot: string): Promise<boolean>;
|
|
55
|
+
//# sourceMappingURL=build-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-check.d.ts","sourceRoot":"","sources":["../../../src/lib/verification/build-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAqCD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,WAAW,CAAC,CAkCtB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: verification, build, health-check, CI
|
|
6
|
+
* @related: packages/cli/src/lib/verification/test-check.ts
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: fs-extra, child_process
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from 'fs-extra';
|
|
12
|
+
import { exec } from 'child_process';
|
|
13
|
+
import { promisify } from 'util';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
const execAsync = promisify(exec);
|
|
16
|
+
/**
|
|
17
|
+
* Detects the appropriate build command for a project
|
|
18
|
+
*
|
|
19
|
+
* Detection order:
|
|
20
|
+
* 1. package.json "build" script
|
|
21
|
+
* 2. tsconfig.json → npx tsc --noEmit
|
|
22
|
+
* 3. Fallback to npm run build
|
|
23
|
+
*
|
|
24
|
+
* @param projectRoot - Absolute path to project root
|
|
25
|
+
* @returns Build command to execute
|
|
26
|
+
*/
|
|
27
|
+
async function detectBuildCommand(projectRoot) {
|
|
28
|
+
// Check for package.json with build script
|
|
29
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
30
|
+
if (await fs.pathExists(packageJsonPath)) {
|
|
31
|
+
try {
|
|
32
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
33
|
+
if (packageJson.scripts?.build) {
|
|
34
|
+
return 'npm run build';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// Invalid package.json, continue to next detection
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Check for tsconfig.json → use TypeScript compiler
|
|
42
|
+
const tsconfigPath = path.join(projectRoot, 'tsconfig.json');
|
|
43
|
+
if (await fs.pathExists(tsconfigPath)) {
|
|
44
|
+
return 'npx tsc --noEmit';
|
|
45
|
+
}
|
|
46
|
+
// Default fallback
|
|
47
|
+
return 'npm run build';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Runs build verification for a project
|
|
51
|
+
*
|
|
52
|
+
* Automatically detects build command and executes it, capturing output.
|
|
53
|
+
* Handles errors gracefully and returns structured results.
|
|
54
|
+
*
|
|
55
|
+
* @param projectRoot - Absolute path to project root
|
|
56
|
+
* @param options - Build check options
|
|
57
|
+
* @returns Build result with success status, output, and duration
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const result = await runBuild('/path/to/project');
|
|
62
|
+
* if (result.passed) {
|
|
63
|
+
* console.log('Build successful in', result.duration_ms, 'ms');
|
|
64
|
+
* } else {
|
|
65
|
+
* console.error('Build failed:', result.errorOutput);
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export async function runBuild(projectRoot, options) {
|
|
70
|
+
const startTime = Date.now();
|
|
71
|
+
const timeout = options?.timeout ?? 600000; // 10 minutes default
|
|
72
|
+
try {
|
|
73
|
+
// Detect appropriate build command
|
|
74
|
+
const buildCommand = await detectBuildCommand(projectRoot);
|
|
75
|
+
// Execute build with timeout
|
|
76
|
+
const { stdout, stderr } = await execAsync(buildCommand, {
|
|
77
|
+
cwd: projectRoot,
|
|
78
|
+
timeout,
|
|
79
|
+
maxBuffer: 10 * 1024 * 1024, // 10MB buffer for large build outputs
|
|
80
|
+
});
|
|
81
|
+
const duration_ms = Date.now() - startTime;
|
|
82
|
+
// Build succeeded
|
|
83
|
+
return {
|
|
84
|
+
passed: true,
|
|
85
|
+
output: stdout || stderr || 'Build completed successfully (no output)',
|
|
86
|
+
duration_ms,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const duration_ms = Date.now() - startTime;
|
|
91
|
+
// Build failed or timed out
|
|
92
|
+
return {
|
|
93
|
+
passed: false,
|
|
94
|
+
output: error.stdout || '',
|
|
95
|
+
errorOutput: error.stderr || error.message || 'Build failed with unknown error',
|
|
96
|
+
duration_ms,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Checks if a project has a buildable configuration
|
|
102
|
+
*
|
|
103
|
+
* @param projectRoot - Absolute path to project root
|
|
104
|
+
* @returns True if project has package.json or tsconfig.json
|
|
105
|
+
*/
|
|
106
|
+
export async function isBuildable(projectRoot) {
|
|
107
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
108
|
+
const tsconfigPath = path.join(projectRoot, 'tsconfig.json');
|
|
109
|
+
return ((await fs.pathExists(packageJsonPath)) || (await fs.pathExists(tsconfigPath)));
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=build-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-check.js","sourceRoot":"","sources":["../../../src/lib/verification/build-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAoBlC;;;;;;;;;;GAUG;AACH,KAAK,UAAU,kBAAkB,CAAC,WAAmB;IACnD,2CAA2C;IAC3C,MAAM,eAA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,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAE3C,kBAAkB;QAClB,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,MAAM,IAAI,MAAM,IAAI,0CAA0C;YACtE,WAAW;SACZ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAE3C,4BAA4B;QAC5B,OAAO;YACL,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;YAC1B,WAAW,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,iCAAiC;YAC/E,WAAW;SACZ,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAmB;IACnD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAE7D,OAAO,CACL,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAC9E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: [verification, barrel-export, epic-004, sprint-3]
|
|
6
|
+
* @related: [test-runner.ts, build-check.ts, lint-check.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: low
|
|
9
|
+
* @dependencies: []
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Verification utilities for task acceptance criteria
|
|
13
|
+
* EPIC-004 Sprint 3: Verification & Quality
|
|
14
|
+
*/
|
|
15
|
+
export { runTests } from './test-runner.js';
|
|
16
|
+
export type { TestResult, TestOptions } from './test-runner.js';
|
|
17
|
+
export { runLint } from './lint-check.js';
|
|
18
|
+
export type { LintResult, LintOptions } from './lint-check.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/verification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: [verification, barrel-export, epic-004, sprint-3]
|
|
6
|
+
* @related: [test-runner.ts, build-check.ts, lint-check.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: low
|
|
9
|
+
* @dependencies: []
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Verification utilities for task acceptance criteria
|
|
13
|
+
* EPIC-004 Sprint 3: Verification & Quality
|
|
14
|
+
*/
|
|
15
|
+
export { runTests } from './test-runner.js';
|
|
16
|
+
export { runLint } from './lint-check.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/verification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: [verification, lint, quality, epic-004-s3]
|
|
6
|
+
* @related: [test-runner.ts, build-check.ts, ../commands/verify.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [fs, child_process]
|
|
10
|
+
*/
|
|
11
|
+
export interface LintResult {
|
|
12
|
+
passed: boolean;
|
|
13
|
+
errorCount: number;
|
|
14
|
+
warningCount: number;
|
|
15
|
+
output: string;
|
|
16
|
+
duration_ms: number;
|
|
17
|
+
}
|
|
18
|
+
export interface LintOptions {
|
|
19
|
+
/** Timeout in milliseconds (default: 120000 = 2 minutes) */
|
|
20
|
+
timeout?: number;
|
|
21
|
+
/** Baseline error count - only fail if errors exceed this number */
|
|
22
|
+
baseline?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run lint command and return structured result
|
|
26
|
+
*
|
|
27
|
+
* @param projectRoot - Absolute path to project root directory
|
|
28
|
+
* @param options - Optional configuration (timeout, baseline)
|
|
29
|
+
* @returns LintResult with pass/fail status and details
|
|
30
|
+
*
|
|
31
|
+
* @throws Error if projectRoot doesn't exist or lint command fails to execute
|
|
32
|
+
*/
|
|
33
|
+
export declare function runLint(projectRoot: string, options?: LintOptions): Promise<LintResult>;
|
|
34
|
+
//# sourceMappingURL=lint-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-check.d.ts","sourceRoot":"","sources":["../../../src/lib/verification/lint-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA+CH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAgGD;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CAgFrB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: [verification, lint, quality, epic-004-s3]
|
|
6
|
+
* @related: [test-runner.ts, build-check.ts, ../commands/verify.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [fs, child_process]
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Lint Verification Utility
|
|
13
|
+
*
|
|
14
|
+
* Detects and runs lint commands to verify code quality standards.
|
|
15
|
+
*
|
|
16
|
+
* Pattern:
|
|
17
|
+
* - Auto-detects lint command from package.json scripts
|
|
18
|
+
* - Checks for common lint config files (.eslintrc, eslint.config.js, etc.)
|
|
19
|
+
* - Parses lint output to extract error/warning counts
|
|
20
|
+
* - Supports baseline comparison to detect new errors
|
|
21
|
+
* - Returns structured result with pass/fail status
|
|
22
|
+
*
|
|
23
|
+
* Detection Logic:
|
|
24
|
+
* 1. Check package.json for "lint" script
|
|
25
|
+
* 2. Check for lint config files
|
|
26
|
+
* 3. Default to `npm run lint` if both exist
|
|
27
|
+
*
|
|
28
|
+
* Parsing:
|
|
29
|
+
* - ESLint format: "✖ N problems (X errors, Y warnings)"
|
|
30
|
+
* - Alternative formats: Look for "error(s)" and "warning(s)" patterns
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const { runLint } = require('./lint-check');
|
|
35
|
+
*
|
|
36
|
+
* // Basic usage
|
|
37
|
+
* const result = await runLint('/path/to/project');
|
|
38
|
+
* console.log(`Passed: ${result.passed}, Errors: ${result.errorCount}`);
|
|
39
|
+
*
|
|
40
|
+
* // With baseline comparison
|
|
41
|
+
* const result = await runLint('/path/to/project', { baseline: 5 });
|
|
42
|
+
* // Only fails if error count > 5 (new errors introduced)
|
|
43
|
+
*
|
|
44
|
+
* // With timeout
|
|
45
|
+
* const result = await runLint('/path/to/project', { timeout: 60000 });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
import { promises as fs } from 'fs';
|
|
49
|
+
import { exec } from 'child_process';
|
|
50
|
+
import { promisify } from 'util';
|
|
51
|
+
import * as path from 'path';
|
|
52
|
+
const execAsync = promisify(exec);
|
|
53
|
+
/**
|
|
54
|
+
* Detect lint command from project configuration
|
|
55
|
+
*/
|
|
56
|
+
async function detectLintCommand(projectRoot) {
|
|
57
|
+
try {
|
|
58
|
+
// Check package.json for lint script
|
|
59
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
60
|
+
const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8');
|
|
61
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
62
|
+
if (packageJson.scripts?.lint) {
|
|
63
|
+
return 'npm run lint';
|
|
64
|
+
}
|
|
65
|
+
// Check for common lint config files
|
|
66
|
+
const lintConfigFiles = [
|
|
67
|
+
'.eslintrc',
|
|
68
|
+
'.eslintrc.js',
|
|
69
|
+
'.eslintrc.json',
|
|
70
|
+
'.eslintrc.yaml',
|
|
71
|
+
'.eslintrc.yml',
|
|
72
|
+
'eslint.config.js',
|
|
73
|
+
'eslint.config.mjs',
|
|
74
|
+
'.prettierrc',
|
|
75
|
+
'.prettierrc.js',
|
|
76
|
+
'.prettierrc.json',
|
|
77
|
+
];
|
|
78
|
+
for (const configFile of lintConfigFiles) {
|
|
79
|
+
const configPath = path.join(projectRoot, configFile);
|
|
80
|
+
try {
|
|
81
|
+
await fs.access(configPath);
|
|
82
|
+
// Config exists, assume eslint is available
|
|
83
|
+
return 'npx eslint .';
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// Config doesn't exist, try next
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse lint output to extract error and warning counts
|
|
97
|
+
*/
|
|
98
|
+
function parseLintOutput(output) {
|
|
99
|
+
let errorCount = 0;
|
|
100
|
+
let warningCount = 0;
|
|
101
|
+
// ESLint format: "✖ 42 problems (23 errors, 19 warnings)"
|
|
102
|
+
const eslintMatch = output.match(/(\d+)\s+problems?\s+\((\d+)\s+errors?,\s+(\d+)\s+warnings?\)/i);
|
|
103
|
+
if (eslintMatch) {
|
|
104
|
+
errorCount = parseInt(eslintMatch[2], 10);
|
|
105
|
+
warningCount = parseInt(eslintMatch[3], 10);
|
|
106
|
+
return { errorCount, warningCount };
|
|
107
|
+
}
|
|
108
|
+
// Alternative ESLint format: "✖ 23 errors, 19 warnings"
|
|
109
|
+
const eslintAltMatch = output.match(/(\d+)\s+errors?,\s+(\d+)\s+warnings?/i);
|
|
110
|
+
if (eslintAltMatch) {
|
|
111
|
+
errorCount = parseInt(eslintAltMatch[1], 10);
|
|
112
|
+
warningCount = parseInt(eslintAltMatch[2], 10);
|
|
113
|
+
return { errorCount, warningCount };
|
|
114
|
+
}
|
|
115
|
+
// Generic error pattern
|
|
116
|
+
const errorMatch = output.match(/(\d+)\s+errors?/i);
|
|
117
|
+
if (errorMatch) {
|
|
118
|
+
errorCount = parseInt(errorMatch[1], 10);
|
|
119
|
+
}
|
|
120
|
+
// Generic warning pattern
|
|
121
|
+
const warningMatch = output.match(/(\d+)\s+warnings?/i);
|
|
122
|
+
if (warningMatch) {
|
|
123
|
+
warningCount = parseInt(warningMatch[1], 10);
|
|
124
|
+
}
|
|
125
|
+
// If no counts found, check for "no problems" or similar success messages
|
|
126
|
+
if (errorCount === 0 && warningCount === 0) {
|
|
127
|
+
if (output.includes('no problems') ||
|
|
128
|
+
output.includes('0 errors') ||
|
|
129
|
+
output.includes('All matched files use Prettier code style')) {
|
|
130
|
+
return { errorCount: 0, warningCount: 0 };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return { errorCount, warningCount };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Run lint command and return structured result
|
|
137
|
+
*
|
|
138
|
+
* @param projectRoot - Absolute path to project root directory
|
|
139
|
+
* @param options - Optional configuration (timeout, baseline)
|
|
140
|
+
* @returns LintResult with pass/fail status and details
|
|
141
|
+
*
|
|
142
|
+
* @throws Error if projectRoot doesn't exist or lint command fails to execute
|
|
143
|
+
*/
|
|
144
|
+
export async function runLint(projectRoot, options = {}) {
|
|
145
|
+
const { timeout = 120000, baseline } = options;
|
|
146
|
+
const startTime = Date.now();
|
|
147
|
+
try {
|
|
148
|
+
// Verify project root exists
|
|
149
|
+
await fs.access(projectRoot);
|
|
150
|
+
// Detect lint command
|
|
151
|
+
const lintCommand = await detectLintCommand(projectRoot);
|
|
152
|
+
if (!lintCommand) {
|
|
153
|
+
return {
|
|
154
|
+
passed: true,
|
|
155
|
+
errorCount: 0,
|
|
156
|
+
warningCount: 0,
|
|
157
|
+
output: 'No lint command detected. Skipping lint verification.',
|
|
158
|
+
duration_ms: Date.now() - startTime,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// Run lint command
|
|
162
|
+
let output = '';
|
|
163
|
+
let errorCount = 0;
|
|
164
|
+
let warningCount = 0;
|
|
165
|
+
try {
|
|
166
|
+
const { stdout, stderr } = await execAsync(lintCommand, {
|
|
167
|
+
cwd: projectRoot,
|
|
168
|
+
timeout,
|
|
169
|
+
maxBuffer: 1024 * 1024 * 10, // 10MB buffer
|
|
170
|
+
});
|
|
171
|
+
output = stdout + stderr;
|
|
172
|
+
const counts = parseLintOutput(output);
|
|
173
|
+
errorCount = counts.errorCount;
|
|
174
|
+
warningCount = counts.warningCount;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
// Lint commands typically exit with non-zero on errors
|
|
178
|
+
// Capture output even on failure
|
|
179
|
+
output = (error.stdout || '') + (error.stderr || '');
|
|
180
|
+
const counts = parseLintOutput(output);
|
|
181
|
+
errorCount = counts.errorCount;
|
|
182
|
+
warningCount = counts.warningCount;
|
|
183
|
+
// If parsing found no errors but command failed, it's likely a real error
|
|
184
|
+
if (errorCount === 0 && error.code !== 0) {
|
|
185
|
+
throw error;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const duration_ms = Date.now() - startTime;
|
|
189
|
+
// Determine pass/fail
|
|
190
|
+
let passed = errorCount === 0;
|
|
191
|
+
// Apply baseline comparison if provided
|
|
192
|
+
if (baseline !== undefined) {
|
|
193
|
+
passed = errorCount <= baseline;
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
passed,
|
|
197
|
+
errorCount,
|
|
198
|
+
warningCount,
|
|
199
|
+
output: output.trim(),
|
|
200
|
+
duration_ms,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
const duration_ms = Date.now() - startTime;
|
|
205
|
+
// Handle execution errors gracefully
|
|
206
|
+
return {
|
|
207
|
+
passed: false,
|
|
208
|
+
errorCount: -1,
|
|
209
|
+
warningCount: -1,
|
|
210
|
+
output: `Lint execution failed: ${error.message}\n${error.stdout || ''}\n${error.stderr || ''}`,
|
|
211
|
+
duration_ms,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=lint-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-check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;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAE3C,qCAAqC;QACrC,OAAO;YACL,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,CAAC,CAAC;YACd,YAAY,EAAE,CAAC,CAAC;YAChB,MAAM,EAAE,0BAA0B,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM,IAAI,EAAE,KAAK,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE;YAC/F,WAAW;SACZ,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-12-05
|
|
5
|
+
* @tags: [verification, testing, task-validation, epic-004, sprint-3]
|
|
6
|
+
* @related: [build-check.ts, lint-check.ts, ../sprint-loader.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [child_process, fs, path]
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Result from running project tests
|
|
13
|
+
* EPIC-004 Sprint 3 TASK-3: Test Runner Integration
|
|
14
|
+
*/
|
|
15
|
+
export interface TestResult {
|
|
16
|
+
passed: boolean;
|
|
17
|
+
passCount: number;
|
|
18
|
+
failCount: number;
|
|
19
|
+
coverage?: number;
|
|
20
|
+
output: string;
|
|
21
|
+
duration_ms: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for test execution
|
|
25
|
+
*/
|
|
26
|
+
export interface TestOptions {
|
|
27
|
+
timeout?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run tests and capture results
|
|
31
|
+
*
|
|
32
|
+
* Detects test framework from package.json scripts or config files.
|
|
33
|
+
* Runs tests with timeout, captures output, parses pass/fail counts.
|
|
34
|
+
*
|
|
35
|
+
* @param projectRoot - Path to project root directory
|
|
36
|
+
* @param options - Test execution options (timeout)
|
|
37
|
+
* @returns Structured test result with pass/fail counts
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const result = await runTests('/path/to/project');
|
|
42
|
+
* if (result.passed) {
|
|
43
|
+
* console.log(`✓ All tests passed (${result.passCount})`);
|
|
44
|
+
* } else {
|
|
45
|
+
* console.log(`✗ ${result.failCount} tests failed`);
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function runTests(projectRoot: string, options?: TestOptions): Promise<TestResult>;
|
|
50
|
+
//# sourceMappingURL=test-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/verification/test-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8ID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CAwFrB"}
|