@aiready/cli 0.14.8 → 0.14.9
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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-test.log +32 -32
- package/dist/cli.js +7 -5
- package/dist/cli.mjs +7 -5
- package/package.json +12 -12
- package/src/cli.ts +7 -5
- package/src/commands/report-formatter.ts +17 -4
- package/src/index.ts +14 -3
- package/src/utils/helpers.ts +30 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.14.
|
|
3
|
+
> @aiready/cli@0.14.9 build /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
|
|
13
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta] [
|
|
13
|
+
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta] [90m10:14:43 am[39m
|
|
14
14
|
|
|
15
15
|
src/cli.ts:29:31:
|
|
16
16
|
[37m 29 │ return dirname(fileURLToPath([32mimport.meta[37m.url));
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m84.50 KB[39m
|
|
24
|
-
[32mCJS[39m [1mdist/index.js [22m[32m10.62 KB[39m
|
|
25
|
-
[32mCJS[39m ⚡️ Build success in 152ms
|
|
26
23
|
[32mESM[39m [1mdist/index.mjs [22m[32m170.00 B[39m
|
|
27
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m70.
|
|
24
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m70.91 KB[39m
|
|
28
25
|
[32mESM[39m [1mdist/chunk-VOKP7FGM.mjs [22m[32m9.52 KB[39m
|
|
29
|
-
[32mESM[39m ⚡️ Build success in
|
|
26
|
+
[32mESM[39m ⚡️ Build success in 36ms
|
|
27
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m84.70 KB[39m
|
|
28
|
+
[32mCJS[39m [1mdist/index.js [22m[32m10.62 KB[39m
|
|
29
|
+
[32mCJS[39m ⚡️ Build success in 36ms
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.14.
|
|
3
|
+
> @aiready/cli@0.14.8 test /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
@@ -9,23 +9,7 @@
|
|
|
9
9
|
[90mstdout[2m | src/commands/__tests__/visualize.test.ts[2m > [22m[2mVisualize CLI Action[2m > [22m[2mshould generate HTML from specified report
|
|
10
10
|
[22m[39mBuilding graph from report...
|
|
11
11
|
|
|
12
|
-
[
|
|
13
|
-
[22m[39m Set AIREADY_API_KEY environment variable or use --api-key flag.
|
|
14
|
-
Get an API key from https://platform.getaiready.dev/dashboard
|
|
15
|
-
🚀 Uploading report to https://dev.platform.getaiready.dev...
|
|
16
|
-
Reading report from /Users/pengcao/projects/aiready/packages/cli/report.json...
|
|
17
|
-
Successfully parsed report JSON.
|
|
18
|
-
|
|
19
|
-
[90mstdout[2m | src/commands/__tests__/upload.test.ts[2m > [22m[2mUpload CLI Action[2m > [22m[2mshould fail if API key is missing
|
|
20
|
-
[22m[39m
|
|
21
|
-
✅ Upload successful! (0.00s)
|
|
22
|
-
View results: https://dev.platform.getaiready.dev/dashboard
|
|
23
|
-
Analysis ID: 123
|
|
24
|
-
Score: 80/100
|
|
25
|
-
|
|
26
|
-
[32m✓[39m src/commands/__tests__/upload.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
27
|
-
[32m✓[39m src/commands/__tests__/testability.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
28
|
-
[32m✓[39m src/commands/__tests__/agent-grounding.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
12
|
+
[32m✓[39m src/commands/__tests__/testability.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
29
13
|
[90mstdout[2m | src/commands/__tests__/visualize.test.ts[2m > [22m[2mVisualize CLI Action[2m > [22m[2mshould generate HTML from specified report
|
|
30
14
|
[22m[39mGenerating HTML...
|
|
31
15
|
✅ Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
|
|
@@ -53,24 +37,40 @@ Or specify a custom report:
|
|
|
53
37
|
[22m[39mGenerating HTML...
|
|
54
38
|
✅ Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
|
|
55
39
|
|
|
56
|
-
[32m✓[39m src/commands/__tests__/visualize.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
57
|
-
[32m✓[39m src/commands/__tests__/
|
|
58
|
-
[32m✓[39m src/commands/__tests__/doc-drift.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
59
|
-
[32m✓[39m src/commands/__tests__/
|
|
60
|
-
[32m✓[39m src/
|
|
61
|
-
|
|
40
|
+
[32m✓[39m src/commands/__tests__/visualize.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 59[2mms[22m[39m
|
|
41
|
+
[32m✓[39m src/commands/__tests__/deps-health.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 63[2mms[22m[39m
|
|
42
|
+
[32m✓[39m src/commands/__tests__/doc-drift.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 60[2mms[22m[39m
|
|
43
|
+
[32m✓[39m src/commands/__tests__/ai-signal-clarity.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 58[2mms[22m[39m
|
|
44
|
+
[32m✓[39m src/commands/__tests__/agent-grounding.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 57[2mms[22m[39m
|
|
45
|
+
[90mstdout[2m | src/commands/__tests__/upload.test.ts[2m > [22m[2mUpload CLI Action[2m > [22m[2mshould fail if API key is missing
|
|
46
|
+
[22m[39m Set AIREADY_API_KEY environment variable or use --api-key flag.
|
|
47
|
+
Get an API key from https://platform.getaiready.dev/dashboard
|
|
48
|
+
🚀 Uploading report to https://dev.platform.getaiready.dev...
|
|
49
|
+
Reading report from /Users/pengcao/projects/aiready/packages/cli/report.json...
|
|
50
|
+
Successfully parsed report JSON.
|
|
51
|
+
|
|
52
|
+
[90mstdout[2m | src/commands/__tests__/upload.test.ts[2m > [22m[2mUpload CLI Action[2m > [22m[2mshould fail if API key is missing
|
|
53
|
+
[22m[39m
|
|
54
|
+
✅ Upload successful! (0.00s)
|
|
55
|
+
View results: https://dev.platform.getaiready.dev/dashboard
|
|
56
|
+
Analysis ID: 123
|
|
57
|
+
Score: 80/100
|
|
58
|
+
|
|
59
|
+
[32m✓[39m src/commands/__tests__/upload.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
60
|
+
[32m✓[39m src/commands/__tests__/init.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
62
61
|
[32m✓[39m src/commands/__tests__/consistency.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
63
|
-
[32m✓[39m src/
|
|
64
|
-
[32m✓[39m src/commands/__tests__/
|
|
62
|
+
[32m✓[39m src/utils/__tests__/helpers.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
63
|
+
[32m✓[39m src/commands/__tests__/scan.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
64
|
+
[32m✓[39m src/commands/__tests__/extra-commands.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 113[2mms[22m[39m
|
|
65
65
|
[32m✓[39m src/__tests__/unified.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
66
|
-
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m
|
|
67
|
-
[33m[2m✓[22m[39m should run unified analysis with both tools [33m
|
|
68
|
-
[32m✓[39m src/__tests__/config-shape.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m
|
|
69
|
-
[33m[2m✓[22m[39m should generate a strictly portable AIReadyConfig in summary [33m
|
|
66
|
+
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 3798[2mms[22m[39m
|
|
67
|
+
[33m[2m✓[22m[39m should run unified analysis with both tools [33m 3797[2mms[22m[39m
|
|
68
|
+
[32m✓[39m src/__tests__/config-shape.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 3799[2mms[22m[39m
|
|
69
|
+
[33m[2m✓[22m[39m should generate a strictly portable AIReadyConfig in summary [33m 3798[2mms[22m[39m
|
|
70
70
|
|
|
71
71
|
[2m Test Files [22m [1m[32m15 passed[39m[22m[90m (15)[39m
|
|
72
72
|
[2m Tests [22m [1m[32m46 passed[39m[22m[90m (46)[39m
|
|
73
|
-
[2m Start at [22m 10:
|
|
74
|
-
[2m Duration [22m
|
|
73
|
+
[2m Start at [22m 10:12:44
|
|
74
|
+
[2m Duration [22m 5.54s[2m (transform 3.64s, setup 0ms, import 10.00s, tests 8.15s, environment 2ms)[22m
|
|
75
75
|
|
|
76
76
|
[?25h
|
package/dist/cli.js
CHANGED
|
@@ -1958,15 +1958,17 @@ AI READINESS SCORING:
|
|
|
1958
1958
|
EXAMPLES:
|
|
1959
1959
|
$ aiready scan # Comprehensive analysis with AI Readiness Score
|
|
1960
1960
|
$ aiready scan --no-score # Run scan without score calculation
|
|
1961
|
-
$ aiready
|
|
1961
|
+
$ aiready init # Create a default aiready.json configuration
|
|
1962
|
+
$ aiready init --full # Create configuration with ALL available options
|
|
1962
1963
|
$ npx @aiready/cli scan # Industry standard way to run standard scan
|
|
1963
1964
|
$ aiready scan --output json # Output raw JSON for piping
|
|
1964
1965
|
|
|
1965
1966
|
GETTING STARTED:
|
|
1966
|
-
1. Run 'aiready
|
|
1967
|
-
2.
|
|
1968
|
-
3.
|
|
1969
|
-
4.
|
|
1967
|
+
1. Run 'aiready init' to create a persistent 'aiready.json' config file
|
|
1968
|
+
2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
|
|
1969
|
+
3. Use 'aiready init --full' to see every fine-tuning parameter available
|
|
1970
|
+
4. Use '--profile agentic' for agent-focused analysis
|
|
1971
|
+
5. Set up CI/CD with '--threshold' for quality gates
|
|
1970
1972
|
|
|
1971
1973
|
CONFIGURATION:
|
|
1972
1974
|
Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
|
package/dist/cli.mjs
CHANGED
|
@@ -1719,15 +1719,17 @@ AI READINESS SCORING:
|
|
|
1719
1719
|
EXAMPLES:
|
|
1720
1720
|
$ aiready scan # Comprehensive analysis with AI Readiness Score
|
|
1721
1721
|
$ aiready scan --no-score # Run scan without score calculation
|
|
1722
|
-
$ aiready
|
|
1722
|
+
$ aiready init # Create a default aiready.json configuration
|
|
1723
|
+
$ aiready init --full # Create configuration with ALL available options
|
|
1723
1724
|
$ npx @aiready/cli scan # Industry standard way to run standard scan
|
|
1724
1725
|
$ aiready scan --output json # Output raw JSON for piping
|
|
1725
1726
|
|
|
1726
1727
|
GETTING STARTED:
|
|
1727
|
-
1. Run 'aiready
|
|
1728
|
-
2.
|
|
1729
|
-
3.
|
|
1730
|
-
4.
|
|
1728
|
+
1. Run 'aiready init' to create a persistent 'aiready.json' config file
|
|
1729
|
+
2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
|
|
1730
|
+
3. Use 'aiready init --full' to see every fine-tuning parameter available
|
|
1731
|
+
4. Use '--profile agentic' for agent-focused analysis
|
|
1732
|
+
5. Set up CI/CD with '--threshold' for quality gates
|
|
1731
1733
|
|
|
1732
1734
|
CONFIGURATION:
|
|
1733
1735
|
Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.9",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
13
|
"commander": "^14.0.0",
|
|
14
|
-
"@aiready/agent-grounding": "0.13.
|
|
15
|
-
"@aiready/consistency": "0.20.
|
|
16
|
-
"@aiready/context-analyzer": "0.21.
|
|
17
|
-
"@aiready/core": "0.23.
|
|
18
|
-
"@aiready/deps": "0.13.
|
|
19
|
-
"@aiready/
|
|
20
|
-
"@aiready/
|
|
21
|
-
"@aiready/ai-signal-clarity": "0.13.
|
|
22
|
-
"@aiready/
|
|
23
|
-
"@aiready/
|
|
24
|
-
"@aiready/
|
|
14
|
+
"@aiready/agent-grounding": "0.13.6",
|
|
15
|
+
"@aiready/consistency": "0.20.6",
|
|
16
|
+
"@aiready/context-analyzer": "0.21.10",
|
|
17
|
+
"@aiready/core": "0.23.7",
|
|
18
|
+
"@aiready/deps": "0.13.6",
|
|
19
|
+
"@aiready/change-amplification": "0.13.6",
|
|
20
|
+
"@aiready/visualizer": "0.6.6",
|
|
21
|
+
"@aiready/ai-signal-clarity": "0.13.7",
|
|
22
|
+
"@aiready/pattern-detect": "0.16.6",
|
|
23
|
+
"@aiready/testability": "0.6.6",
|
|
24
|
+
"@aiready/doc-drift": "0.13.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24.0.0",
|
package/src/cli.ts
CHANGED
|
@@ -49,15 +49,17 @@ AI READINESS SCORING:
|
|
|
49
49
|
EXAMPLES:
|
|
50
50
|
$ aiready scan # Comprehensive analysis with AI Readiness Score
|
|
51
51
|
$ aiready scan --no-score # Run scan without score calculation
|
|
52
|
-
$ aiready
|
|
52
|
+
$ aiready init # Create a default aiready.json configuration
|
|
53
|
+
$ aiready init --full # Create configuration with ALL available options
|
|
53
54
|
$ npx @aiready/cli scan # Industry standard way to run standard scan
|
|
54
55
|
$ aiready scan --output json # Output raw JSON for piping
|
|
55
56
|
|
|
56
57
|
GETTING STARTED:
|
|
57
|
-
1. Run 'aiready
|
|
58
|
-
2.
|
|
59
|
-
3.
|
|
60
|
-
4.
|
|
58
|
+
1. Run 'aiready init' to create a persistent 'aiready.json' config file
|
|
59
|
+
2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
|
|
60
|
+
3. Use 'aiready init --full' to see every fine-tuning parameter available
|
|
61
|
+
4. Use '--profile agentic' for agent-focused analysis
|
|
62
|
+
5. Set up CI/CD with '--threshold' for quality gates
|
|
61
63
|
|
|
62
64
|
CONFIGURATION:
|
|
63
65
|
Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
} from '@aiready/core';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Handle console output for the scan results
|
|
11
|
+
* Handle console output for the scan results.
|
|
12
|
+
*
|
|
13
|
+
* @param results - The combined results from all tools.
|
|
14
|
+
* @param startTime - The timestamp when the scan started.
|
|
12
15
|
*/
|
|
13
16
|
export function printScanSummary(results: any, startTime: number) {
|
|
14
17
|
console.log(chalk.cyan('\n=== AIReady Run Summary ==='));
|
|
@@ -21,7 +24,10 @@ export function printScanSummary(results: any, startTime: number) {
|
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
|
-
* Print business impact analysis
|
|
27
|
+
* Print business impact analysis based on ROI and budget metrics.
|
|
28
|
+
*
|
|
29
|
+
* @param roi - Calculated Return on Investment metrics.
|
|
30
|
+
* @param unifiedBudget - Consolidated context budget metrics.
|
|
25
31
|
*/
|
|
26
32
|
export function printBusinessImpact(roi: any, unifiedBudget: any) {
|
|
27
33
|
console.log(chalk.bold('\n💰 Business Impact Analysis (Monthly)'));
|
|
@@ -40,7 +46,10 @@ export function printBusinessImpact(roi: any, unifiedBudget: any) {
|
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/**
|
|
43
|
-
* Print detailed scoring breakdown
|
|
49
|
+
* Print detailed scoring breakdown by tool.
|
|
50
|
+
*
|
|
51
|
+
* @param scoringResult - The overall scoring result.
|
|
52
|
+
* @param scoringProfile - The name of the scoring profile used.
|
|
44
53
|
*/
|
|
45
54
|
export function printScoring(
|
|
46
55
|
scoringResult: ScoringResult,
|
|
@@ -87,7 +96,11 @@ export function printScoring(
|
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
/**
|
|
90
|
-
* Normalize
|
|
99
|
+
* Normalize and map tool-specific results to a unified report structure.
|
|
100
|
+
*
|
|
101
|
+
* @param res - Raw unified results object.
|
|
102
|
+
* @param scoring - Optional scoring result to include.
|
|
103
|
+
* @returns Enhanced report with totals and scoring.
|
|
91
104
|
*/
|
|
92
105
|
export function mapToUnifiedReport(
|
|
93
106
|
res: any,
|
package/src/index.ts
CHANGED
|
@@ -147,8 +147,12 @@ function sanitizeToolConfig(config: any): any {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* AIReady Unified Analysis
|
|
150
|
+
* AIReady Unified Analysis.
|
|
151
151
|
* Orchestrates all registered tools via the ToolRegistry.
|
|
152
|
+
*
|
|
153
|
+
* @param options - Unified analysis configuration including tools and rootDir.
|
|
154
|
+
* @returns Promise resolving to the consolidated analysis result.
|
|
155
|
+
* @lastUpdated 2026-03-18
|
|
152
156
|
*/
|
|
153
157
|
export async function analyzeUnified(
|
|
154
158
|
options: UnifiedAnalysisOptions
|
|
@@ -347,8 +351,12 @@ export async function analyzeUnified(
|
|
|
347
351
|
}
|
|
348
352
|
|
|
349
353
|
/**
|
|
350
|
-
* AIReady Unified Scoring
|
|
354
|
+
* AIReady Unified Scoring.
|
|
351
355
|
* Calculates scores for all analyzed tools.
|
|
356
|
+
*
|
|
357
|
+
* @param results - The consolidated results from a unified analysis.
|
|
358
|
+
* @param options - Analysis options for weighting and budget calculation.
|
|
359
|
+
* @returns Promise resolving to the final scoring result.
|
|
352
360
|
*/
|
|
353
361
|
export async function scoreUnified(
|
|
354
362
|
results: UnifiedAnalysisResult,
|
|
@@ -419,7 +427,10 @@ export async function scoreUnified(
|
|
|
419
427
|
}
|
|
420
428
|
|
|
421
429
|
/**
|
|
422
|
-
* Generate human-readable summary of unified results
|
|
430
|
+
* Generate human-readable summary of unified results.
|
|
431
|
+
*
|
|
432
|
+
* @param result - The consolidated analysis result object.
|
|
433
|
+
* @returns Formatted summary string.
|
|
423
434
|
*/
|
|
424
435
|
export function generateUnifiedSummary(result: UnifiedAnalysisResult): string {
|
|
425
436
|
const { summary } = result;
|
package/src/utils/helpers.ts
CHANGED
|
@@ -22,7 +22,10 @@ export function getReportTimestamp(): string {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Warn if graph caps may be exceeded
|
|
25
|
+
* Warn if graph caps may be exceeded for visualization.
|
|
26
|
+
*
|
|
27
|
+
* @param report - The combined analysis report.
|
|
28
|
+
* @param dirPath - Root directory to look for configuration.
|
|
26
29
|
*/
|
|
27
30
|
export async function warnIfGraphCapExceeded(report: any, dirPath: string) {
|
|
28
31
|
try {
|
|
@@ -90,7 +93,11 @@ export async function warnIfGraphCapExceeded(report: any, dirPath: string) {
|
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
/**
|
|
93
|
-
* Generate markdown report for consistency command
|
|
96
|
+
* Generate markdown report for consistency command.
|
|
97
|
+
*
|
|
98
|
+
* @param report - The consistency report object.
|
|
99
|
+
* @param elapsedTime - Time taken for analysis in seconds.
|
|
100
|
+
* @returns Formatted markdown string.
|
|
94
101
|
*/
|
|
95
102
|
export function generateMarkdownReport(
|
|
96
103
|
report: any,
|
|
@@ -117,7 +124,11 @@ export function generateMarkdownReport(
|
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
/**
|
|
120
|
-
* Truncate array for display (show first N items with "... +N more")
|
|
127
|
+
* Truncate array for display (show first N items with "... +N more").
|
|
128
|
+
*
|
|
129
|
+
* @param arr - The array to truncate.
|
|
130
|
+
* @param cap - Maximum number of items to show before truncating.
|
|
131
|
+
* @returns Formatted string for display.
|
|
121
132
|
*/
|
|
122
133
|
export function truncateArray(arr: any[] | undefined, cap = 8): string {
|
|
123
134
|
if (!Array.isArray(arr)) return '';
|
|
@@ -128,6 +139,10 @@ export function truncateArray(arr: any[] | undefined, cap = 8): string {
|
|
|
128
139
|
|
|
129
140
|
/**
|
|
130
141
|
* Build a common ToolScoringOutput payload from a tool report.
|
|
142
|
+
*
|
|
143
|
+
* @param toolName - Identifier for the tool.
|
|
144
|
+
* @param report - Minimal report structure containing score and recommendations.
|
|
145
|
+
* @returns Standardized scoring output.
|
|
131
146
|
*/
|
|
132
147
|
export function buildToolScoringOutput(
|
|
133
148
|
toolName: string,
|
|
@@ -152,6 +167,10 @@ export function buildToolScoringOutput(
|
|
|
152
167
|
|
|
153
168
|
/**
|
|
154
169
|
* Load config and apply tool-level defaults.
|
|
170
|
+
*
|
|
171
|
+
* @param directory - Directory to search for config.
|
|
172
|
+
* @param defaults - Tool-specific default values.
|
|
173
|
+
* @returns Merged configuration with tool defaults.
|
|
155
174
|
*/
|
|
156
175
|
export async function loadMergedToolConfig<T extends Record<string, unknown>>(
|
|
157
176
|
directory: string,
|
|
@@ -164,6 +183,11 @@ export async function loadMergedToolConfig<T extends Record<string, unknown>>(
|
|
|
164
183
|
|
|
165
184
|
/**
|
|
166
185
|
* Shared base scan options used by CLI tool commands.
|
|
186
|
+
*
|
|
187
|
+
* @param directory - Root directory for scanning.
|
|
188
|
+
* @param options - CLI commander options object.
|
|
189
|
+
* @param extras - Additional tool-specific options.
|
|
190
|
+
* @returns Combined scan options for the analyzer.
|
|
167
191
|
*/
|
|
168
192
|
export function buildCommonScanOptions(
|
|
169
193
|
directory: string,
|
|
@@ -180,6 +204,9 @@ export function buildCommonScanOptions(
|
|
|
180
204
|
|
|
181
205
|
/**
|
|
182
206
|
* Execute a config-driven tool command with shared CLI plumbing.
|
|
207
|
+
*
|
|
208
|
+
* @param params - Execution parameters including analyze and score callbacks.
|
|
209
|
+
* @returns Promise resolving to the tool report and its scoring output.
|
|
183
210
|
*/
|
|
184
211
|
export async function runConfiguredToolCommand<TReport, TScoring>(params: {
|
|
185
212
|
directory: string;
|