@aiready/cli 0.10.3 → 0.10.6
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 +8 -8
- package/.turbo/turbo-test.log +3 -3
- package/dist/chunk-R3O7QPKD.mjs +419 -0
- package/dist/chunk-VQCWYJYJ.mjs +438 -0
- package/dist/cli.js +188 -98
- package/dist/cli.mjs +106 -33
- package/dist/index.js +105 -85
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260306-191804.json +8281 -0
- package/src/.aiready/aiready-report-20260306-191824.json +8281 -0
- package/src/.aiready/aiready-report-20260306-191838.json +8281 -0
- package/src/.aiready/aiready-report-20260306-192002.json +15942 -0
- package/src/.aiready/aiready-report-20260306-192102.json +15048 -0
- package/src/.aiready/aiready-report-20260306-202328.json +19961 -0
- package/src/.aiready/aiready-report-20260306-213155.json +24657 -0
- package/src/.aiready/aiready-report-20260306-213925.json +24657 -0
- package/src/commands/scan.ts +144 -32
- package/src/index.ts +139 -106
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__require,
|
|
4
4
|
analyzeUnified,
|
|
5
5
|
scoreUnified
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VQCWYJYJ.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { Command } from "commander";
|
|
@@ -28,7 +28,10 @@ import {
|
|
|
28
28
|
getModelPreset,
|
|
29
29
|
getRating,
|
|
30
30
|
getRatingDisplay,
|
|
31
|
-
getRepoMetadata
|
|
31
|
+
getRepoMetadata,
|
|
32
|
+
Severity,
|
|
33
|
+
IssueType,
|
|
34
|
+
ToolName
|
|
32
35
|
} from "@aiready/core";
|
|
33
36
|
|
|
34
37
|
// src/utils/helpers.ts
|
|
@@ -533,18 +536,18 @@ async function scanAction(directory, options) {
|
|
|
533
536
|
topFiles.forEach(([file, issues], idx) => {
|
|
534
537
|
const counts = issues.reduce(
|
|
535
538
|
(acc, it) => {
|
|
536
|
-
const s = (it.severity ||
|
|
539
|
+
const s = (it.severity || Severity.Info).toLowerCase();
|
|
537
540
|
acc[s] = (acc[s] || 0) + 1;
|
|
538
541
|
return acc;
|
|
539
542
|
},
|
|
540
543
|
{}
|
|
541
544
|
);
|
|
542
545
|
const sample = issues.find(
|
|
543
|
-
(it) => it.severity ===
|
|
546
|
+
(it) => it.severity === Severity.Critical || it.severity === Severity.Major
|
|
544
547
|
) || issues[0];
|
|
545
548
|
const sampleMsg = sample ? ` \u2014 ${sample.message}` : "";
|
|
546
549
|
console.log(
|
|
547
|
-
` ${idx + 1}. ${file} \u2014 ${issues.length} issue(s) (critical:${counts.
|
|
550
|
+
` ${idx + 1}. ${file} \u2014 ${issues.length} issue(s) (critical:${counts[Severity.Critical] || 0} major:${counts[Severity.Major] || 0} minor:${counts[Severity.Minor] || 0} info:${counts[Severity.Info] || 0})${sampleMsg}`
|
|
548
551
|
);
|
|
549
552
|
});
|
|
550
553
|
const remaining = files.length - topFiles.length;
|
|
@@ -619,25 +622,25 @@ async function scanAction(directory, options) {
|
|
|
619
622
|
console.log(
|
|
620
623
|
` Total issues (all tools): ${chalk3.bold(String(results.summary.totalIssues || 0))}`
|
|
621
624
|
);
|
|
622
|
-
if (results.
|
|
625
|
+
if (results[ToolName.PatternDetect]) {
|
|
623
626
|
console.log(
|
|
624
|
-
` Duplicate patterns found: ${chalk3.bold(String(results.
|
|
627
|
+
` Duplicate patterns found: ${chalk3.bold(String(results[ToolName.PatternDetect].duplicates?.length || 0))}`
|
|
625
628
|
);
|
|
626
629
|
console.log(
|
|
627
|
-
` Pattern files with issues: ${chalk3.bold(String(results.
|
|
630
|
+
` Pattern files with issues: ${chalk3.bold(String(results[ToolName.PatternDetect].results.length || 0))}`
|
|
628
631
|
);
|
|
629
632
|
}
|
|
630
|
-
if (results.
|
|
633
|
+
if (results[ToolName.ContextAnalyzer])
|
|
631
634
|
console.log(
|
|
632
|
-
` Context issues: ${chalk3.bold(String(results.
|
|
635
|
+
` Context issues: ${chalk3.bold(String(results[ToolName.ContextAnalyzer].results.length || 0))}`
|
|
633
636
|
);
|
|
634
|
-
if (results.
|
|
637
|
+
if (results[ToolName.NamingConsistency])
|
|
635
638
|
console.log(
|
|
636
|
-
` Consistency issues: ${chalk3.bold(String(results.
|
|
639
|
+
` Consistency issues: ${chalk3.bold(String(results[ToolName.NamingConsistency].summary?.totalIssues || 0))}`
|
|
637
640
|
);
|
|
638
|
-
if (results.
|
|
641
|
+
if (results[ToolName.ChangeAmplification])
|
|
639
642
|
console.log(
|
|
640
|
-
` Change amplification: ${chalk3.bold(String(results.
|
|
643
|
+
` Change amplification: ${chalk3.bold(String(results[ToolName.ChangeAmplification].summary?.score || 0))}/100`
|
|
641
644
|
);
|
|
642
645
|
console.log(chalk3.cyan("===========================\n"));
|
|
643
646
|
const elapsedTime = getElapsedTime(startTime);
|
|
@@ -777,6 +780,78 @@ async function scanAction(directory, options) {
|
|
|
777
780
|
}
|
|
778
781
|
}
|
|
779
782
|
}
|
|
783
|
+
const mapToUnifiedReport = (res, scoring) => {
|
|
784
|
+
const allResults = [];
|
|
785
|
+
let totalFilesSet = /* @__PURE__ */ new Set();
|
|
786
|
+
let criticalCount = 0;
|
|
787
|
+
let majorCount = 0;
|
|
788
|
+
const collect = (spokeRes, defaultType = IssueType.AiSignalClarity) => {
|
|
789
|
+
if (!spokeRes || !spokeRes.results) return;
|
|
790
|
+
spokeRes.results.forEach((r) => {
|
|
791
|
+
const fileName = r.fileName || r.file || "unknown";
|
|
792
|
+
totalFilesSet.add(fileName);
|
|
793
|
+
const normalizedResult = {
|
|
794
|
+
fileName,
|
|
795
|
+
issues: [],
|
|
796
|
+
metrics: r.metrics || { tokenCost: r.tokenCost || 0 }
|
|
797
|
+
};
|
|
798
|
+
if (r.issues && Array.isArray(r.issues)) {
|
|
799
|
+
r.issues.forEach((i) => {
|
|
800
|
+
const normalizedIssue = typeof i === "string" ? {
|
|
801
|
+
type: defaultType,
|
|
802
|
+
severity: r.severity || Severity.Info,
|
|
803
|
+
message: i,
|
|
804
|
+
location: { file: fileName, line: 1 }
|
|
805
|
+
} : {
|
|
806
|
+
type: i.type || defaultType,
|
|
807
|
+
severity: i.severity || r.severity || Severity.Info,
|
|
808
|
+
message: i.message || String(i),
|
|
809
|
+
location: i.location || { file: fileName, line: 1 },
|
|
810
|
+
suggestion: i.suggestion
|
|
811
|
+
};
|
|
812
|
+
if (normalizedIssue.severity === Severity.Critical || normalizedIssue.severity === "critical")
|
|
813
|
+
criticalCount++;
|
|
814
|
+
if (normalizedIssue.severity === Severity.Major || normalizedIssue.severity === "major")
|
|
815
|
+
majorCount++;
|
|
816
|
+
normalizedResult.issues.push(normalizedIssue);
|
|
817
|
+
});
|
|
818
|
+
} else if (r.severity) {
|
|
819
|
+
const normalizedIssue = {
|
|
820
|
+
type: defaultType,
|
|
821
|
+
severity: r.severity,
|
|
822
|
+
message: r.message || "General issue",
|
|
823
|
+
location: { file: fileName, line: 1 }
|
|
824
|
+
};
|
|
825
|
+
if (normalizedIssue.severity === Severity.Critical || normalizedIssue.severity === "critical")
|
|
826
|
+
criticalCount++;
|
|
827
|
+
if (normalizedIssue.severity === Severity.Major || normalizedIssue.severity === "major")
|
|
828
|
+
majorCount++;
|
|
829
|
+
normalizedResult.issues.push(normalizedIssue);
|
|
830
|
+
}
|
|
831
|
+
allResults.push(normalizedResult);
|
|
832
|
+
});
|
|
833
|
+
};
|
|
834
|
+
collect(res[ToolName.PatternDetect], IssueType.DuplicatePattern);
|
|
835
|
+
collect(res[ToolName.ContextAnalyzer], IssueType.ContextFragmentation);
|
|
836
|
+
collect(res[ToolName.NamingConsistency], IssueType.NamingInconsistency);
|
|
837
|
+
collect(res[ToolName.DocDrift], IssueType.DocDrift);
|
|
838
|
+
collect(res[ToolName.DependencyHealth], IssueType.DependencyHealth);
|
|
839
|
+
collect(res[ToolName.AiSignalClarity], IssueType.AiSignalClarity);
|
|
840
|
+
collect(res[ToolName.AgentGrounding], IssueType.AgentNavigationFailure);
|
|
841
|
+
collect(res[ToolName.TestabilityIndex], IssueType.LowTestability);
|
|
842
|
+
collect(res[ToolName.ChangeAmplification], IssueType.ChangeAmplification);
|
|
843
|
+
return {
|
|
844
|
+
...res,
|
|
845
|
+
results: allResults,
|
|
846
|
+
summary: {
|
|
847
|
+
...res.summary,
|
|
848
|
+
totalFiles: totalFilesSet.size,
|
|
849
|
+
criticalIssues: criticalCount,
|
|
850
|
+
majorIssues: majorCount
|
|
851
|
+
},
|
|
852
|
+
scoring
|
|
853
|
+
};
|
|
854
|
+
};
|
|
780
855
|
const outputFormat = options.output || finalOptions.output?.format || "console";
|
|
781
856
|
const userOutputFile = options.outputFile || finalOptions.output?.file;
|
|
782
857
|
if (outputFormat === "json") {
|
|
@@ -788,8 +863,7 @@ async function scanAction(directory, options) {
|
|
|
788
863
|
resolvedDir
|
|
789
864
|
);
|
|
790
865
|
const outputData = {
|
|
791
|
-
...results,
|
|
792
|
-
scoring: scoringResult,
|
|
866
|
+
...mapToUnifiedReport(results, scoringResult),
|
|
793
867
|
repository: repoMetadata
|
|
794
868
|
};
|
|
795
869
|
handleJSONOutput(
|
|
@@ -814,8 +888,7 @@ async function scanAction(directory, options) {
|
|
|
814
888
|
resolvedDir
|
|
815
889
|
);
|
|
816
890
|
const outputData = {
|
|
817
|
-
...results,
|
|
818
|
-
scoring: scoringResult,
|
|
891
|
+
...mapToUnifiedReport(results, scoringResult),
|
|
819
892
|
repository: repoMetadata
|
|
820
893
|
};
|
|
821
894
|
try {
|
|
@@ -856,9 +929,9 @@ async function scanAction(directory, options) {
|
|
|
856
929
|
`::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
|
|
857
930
|
);
|
|
858
931
|
}
|
|
859
|
-
if (results.
|
|
860
|
-
const criticalPatterns = results.
|
|
861
|
-
(p) => p.issues.filter((i) => i.severity ===
|
|
932
|
+
if (results[ToolName.PatternDetect]) {
|
|
933
|
+
const criticalPatterns = results[ToolName.PatternDetect].results.flatMap(
|
|
934
|
+
(p) => p.issues.filter((i) => i.severity === Severity.Critical)
|
|
862
935
|
);
|
|
863
936
|
criticalPatterns.slice(0, 10).forEach((issue) => {
|
|
864
937
|
console.log(
|
|
@@ -878,25 +951,25 @@ async function scanAction(directory, options) {
|
|
|
878
951
|
const minSeverity = severityLevels[failOnLevel] || 4;
|
|
879
952
|
let criticalCount = 0;
|
|
880
953
|
let majorCount = 0;
|
|
881
|
-
if (results.
|
|
882
|
-
results.
|
|
954
|
+
if (results[ToolName.PatternDetect]) {
|
|
955
|
+
results[ToolName.PatternDetect].results.forEach((p) => {
|
|
883
956
|
p.issues.forEach((i) => {
|
|
884
|
-
if (i.severity ===
|
|
885
|
-
if (i.severity ===
|
|
957
|
+
if (i.severity === Severity.Critical) criticalCount++;
|
|
958
|
+
if (i.severity === Severity.Major) majorCount++;
|
|
886
959
|
});
|
|
887
960
|
});
|
|
888
961
|
}
|
|
889
|
-
if (results.
|
|
890
|
-
results.
|
|
891
|
-
if (c.severity ===
|
|
892
|
-
if (c.severity ===
|
|
962
|
+
if (results[ToolName.ContextAnalyzer]) {
|
|
963
|
+
results[ToolName.ContextAnalyzer].results.forEach((c) => {
|
|
964
|
+
if (c.severity === Severity.Critical) criticalCount++;
|
|
965
|
+
if (c.severity === Severity.Major) majorCount++;
|
|
893
966
|
});
|
|
894
967
|
}
|
|
895
|
-
if (results.
|
|
896
|
-
results.
|
|
968
|
+
if (results[ToolName.NamingConsistency]) {
|
|
969
|
+
results[ToolName.NamingConsistency].results.forEach((r) => {
|
|
897
970
|
r.issues?.forEach((i) => {
|
|
898
|
-
if (i.severity ===
|
|
899
|
-
if (i.severity ===
|
|
971
|
+
if (i.severity === Severity.Critical) criticalCount++;
|
|
972
|
+
if (i.severity === Severity.Major) majorCount++;
|
|
900
973
|
});
|
|
901
974
|
});
|
|
902
975
|
}
|
package/dist/index.js
CHANGED
|
@@ -86,11 +86,13 @@ async function analyzeUnified(options) {
|
|
|
86
86
|
if (options.progressCallback) {
|
|
87
87
|
options.progressCallback({ tool: "patterns", data: patternResult });
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
const output = {
|
|
90
90
|
results: sortBySeverity(patternResult.results),
|
|
91
91
|
summary: patternResult.summary || {},
|
|
92
92
|
duplicates: patternResult.duplicates || []
|
|
93
93
|
};
|
|
94
|
+
result[import_core.ToolName.PatternDetect] = output;
|
|
95
|
+
result.patternDetect = output;
|
|
94
96
|
result.summary.totalIssues += patternResult.results.reduce(
|
|
95
97
|
(sum, file) => sum + file.issues.length,
|
|
96
98
|
0
|
|
@@ -108,10 +110,12 @@ async function analyzeUnified(options) {
|
|
|
108
110
|
return b.fragmentationScore - a.fragmentationScore;
|
|
109
111
|
});
|
|
110
112
|
const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
|
|
111
|
-
|
|
113
|
+
const output = {
|
|
112
114
|
results: sorted,
|
|
113
115
|
summary: genContextSummary(sorted)
|
|
114
116
|
};
|
|
117
|
+
result[import_core.ToolName.ContextAnalyzer] = output;
|
|
118
|
+
result.contextAnalyzer = output;
|
|
115
119
|
result.summary.totalIssues += sorted.length;
|
|
116
120
|
}
|
|
117
121
|
if (tools.includes("consistency")) {
|
|
@@ -125,7 +129,7 @@ async function analyzeUnified(options) {
|
|
|
125
129
|
if (options.progressCallback) {
|
|
126
130
|
options.progressCallback({ tool: "consistency", data: report });
|
|
127
131
|
}
|
|
128
|
-
result.
|
|
132
|
+
result[import_core.ToolName.NamingConsistency] = {
|
|
129
133
|
results: report.results ? sortBySeverity(report.results) : [],
|
|
130
134
|
summary: report.summary
|
|
131
135
|
};
|
|
@@ -142,11 +146,12 @@ async function analyzeUnified(options) {
|
|
|
142
146
|
if (options.progressCallback) {
|
|
143
147
|
options.progressCallback({ tool: "doc-drift", data: report });
|
|
144
148
|
}
|
|
145
|
-
result.
|
|
146
|
-
results: report.results || [],
|
|
149
|
+
result[import_core.ToolName.DocDrift] = {
|
|
150
|
+
results: report.results || report.issues || [],
|
|
147
151
|
summary: report.summary || {}
|
|
148
152
|
};
|
|
149
|
-
|
|
153
|
+
const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
|
|
154
|
+
result.summary.totalIssues += issueCount;
|
|
150
155
|
}
|
|
151
156
|
if (tools.includes("deps-health")) {
|
|
152
157
|
const { analyzeDeps } = await import("@aiready/deps");
|
|
@@ -159,11 +164,12 @@ async function analyzeUnified(options) {
|
|
|
159
164
|
if (options.progressCallback) {
|
|
160
165
|
options.progressCallback({ tool: "deps-health", data: report });
|
|
161
166
|
}
|
|
162
|
-
result.
|
|
163
|
-
results: report.results || [],
|
|
167
|
+
result[import_core.ToolName.DependencyHealth] = {
|
|
168
|
+
results: report.results || report.issues || [],
|
|
164
169
|
summary: report.summary || {}
|
|
165
170
|
};
|
|
166
|
-
|
|
171
|
+
const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
|
|
172
|
+
result.summary.totalIssues += issueCount;
|
|
167
173
|
}
|
|
168
174
|
if (tools.includes("ai-signal-clarity")) {
|
|
169
175
|
const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
|
|
@@ -176,13 +182,13 @@ async function analyzeUnified(options) {
|
|
|
176
182
|
if (options.progressCallback) {
|
|
177
183
|
options.progressCallback({ tool: "ai-signal-clarity", data: report });
|
|
178
184
|
}
|
|
179
|
-
result.
|
|
185
|
+
result[import_core.ToolName.AiSignalClarity] = {
|
|
180
186
|
...report,
|
|
181
|
-
results: report.results || [],
|
|
187
|
+
results: report.results || report.issues || [],
|
|
182
188
|
summary: report.summary || {}
|
|
183
189
|
};
|
|
184
|
-
result.summary.totalIssues += report.results?.reduce(
|
|
185
|
-
(sum, r) => sum + (r.issues?.length ||
|
|
190
|
+
result.summary.totalIssues += (report.results || report.issues)?.reduce(
|
|
191
|
+
(sum, r) => sum + (r.issues?.length || 1),
|
|
186
192
|
0
|
|
187
193
|
) || 0;
|
|
188
194
|
}
|
|
@@ -197,12 +203,12 @@ async function analyzeUnified(options) {
|
|
|
197
203
|
if (options.progressCallback) {
|
|
198
204
|
options.progressCallback({ tool: "agent-grounding", data: report });
|
|
199
205
|
}
|
|
200
|
-
result.
|
|
206
|
+
result[import_core.ToolName.AgentGrounding] = {
|
|
201
207
|
...report,
|
|
202
|
-
results: report.results || [],
|
|
208
|
+
results: report.results || report.issues || [],
|
|
203
209
|
summary: report.summary || {}
|
|
204
210
|
};
|
|
205
|
-
result.summary.totalIssues += report.issues
|
|
211
|
+
result.summary.totalIssues += (report.issues || report.results || []).length;
|
|
206
212
|
}
|
|
207
213
|
if (tools.includes("testability")) {
|
|
208
214
|
const { analyzeTestability } = await import("@aiready/testability");
|
|
@@ -215,12 +221,12 @@ async function analyzeUnified(options) {
|
|
|
215
221
|
if (options.progressCallback) {
|
|
216
222
|
options.progressCallback({ tool: "testability", data: report });
|
|
217
223
|
}
|
|
218
|
-
result.
|
|
224
|
+
result[import_core.ToolName.TestabilityIndex] = {
|
|
219
225
|
...report,
|
|
220
|
-
results: report.results || [],
|
|
226
|
+
results: report.results || report.issues || [],
|
|
221
227
|
summary: report.summary || {}
|
|
222
228
|
};
|
|
223
|
-
result.summary.totalIssues += report.issues
|
|
229
|
+
result.summary.totalIssues += (report.issues || report.results || []).length;
|
|
224
230
|
}
|
|
225
231
|
if (tools.includes("change-amplification")) {
|
|
226
232
|
const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
|
|
@@ -233,7 +239,7 @@ async function analyzeUnified(options) {
|
|
|
233
239
|
if (options.progressCallback) {
|
|
234
240
|
options.progressCallback({ tool: "change-amplification", data: report });
|
|
235
241
|
}
|
|
236
|
-
result.
|
|
242
|
+
result[import_core.ToolName.ChangeAmplification] = {
|
|
237
243
|
results: report.results || [],
|
|
238
244
|
summary: report.summary || {}
|
|
239
245
|
};
|
|
@@ -244,14 +250,15 @@ async function analyzeUnified(options) {
|
|
|
244
250
|
}
|
|
245
251
|
async function scoreUnified(results, options) {
|
|
246
252
|
const toolScores = /* @__PURE__ */ new Map();
|
|
247
|
-
if (results.
|
|
253
|
+
if (results[import_core.ToolName.PatternDetect]) {
|
|
254
|
+
const data = results[import_core.ToolName.PatternDetect];
|
|
248
255
|
const { calculatePatternScore } = await import("@aiready/pattern-detect");
|
|
249
256
|
try {
|
|
250
257
|
const patternScore = calculatePatternScore(
|
|
251
|
-
|
|
252
|
-
|
|
258
|
+
data.duplicates,
|
|
259
|
+
data.results?.length || 0
|
|
253
260
|
);
|
|
254
|
-
const wastedTokens =
|
|
261
|
+
const wastedTokens = data.duplicates.reduce(
|
|
255
262
|
(sum, d) => sum + (d.tokenCost || 0),
|
|
256
263
|
0
|
|
257
264
|
);
|
|
@@ -264,15 +271,16 @@ async function scoreUnified(results, options) {
|
|
|
264
271
|
chattiness: 0
|
|
265
272
|
}
|
|
266
273
|
});
|
|
267
|
-
toolScores.set(
|
|
274
|
+
toolScores.set(import_core.ToolName.PatternDetect, patternScore);
|
|
268
275
|
} catch (err) {
|
|
269
276
|
void err;
|
|
270
277
|
}
|
|
271
278
|
}
|
|
272
|
-
if (results.
|
|
279
|
+
if (results[import_core.ToolName.ContextAnalyzer]) {
|
|
280
|
+
const data = results[import_core.ToolName.ContextAnalyzer];
|
|
273
281
|
const { calculateContextScore } = await import("@aiready/context-analyzer");
|
|
274
282
|
try {
|
|
275
|
-
const ctxSummary =
|
|
283
|
+
const ctxSummary = data.summary;
|
|
276
284
|
const contextScore = calculateContextScore(ctxSummary);
|
|
277
285
|
contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
278
286
|
totalContextTokens: ctxSummary.totalTokens,
|
|
@@ -282,56 +290,62 @@ async function scoreUnified(results, options) {
|
|
|
282
290
|
chattiness: 0
|
|
283
291
|
}
|
|
284
292
|
});
|
|
285
|
-
toolScores.set(
|
|
293
|
+
toolScores.set(import_core.ToolName.ContextAnalyzer, contextScore);
|
|
286
294
|
} catch (err) {
|
|
287
295
|
void err;
|
|
288
296
|
}
|
|
289
297
|
}
|
|
290
|
-
if (results.
|
|
298
|
+
if (results[import_core.ToolName.NamingConsistency]) {
|
|
299
|
+
const data = results[import_core.ToolName.NamingConsistency];
|
|
291
300
|
const { calculateConsistencyScore } = await import("@aiready/consistency");
|
|
292
301
|
try {
|
|
293
|
-
const issues =
|
|
294
|
-
const totalFiles =
|
|
302
|
+
const issues = data.results?.flatMap((r) => r.issues) || [];
|
|
303
|
+
const totalFiles = data.summary?.filesAnalyzed || 0;
|
|
295
304
|
const consistencyScore = calculateConsistencyScore(issues, totalFiles);
|
|
296
|
-
toolScores.set(
|
|
305
|
+
toolScores.set(import_core.ToolName.NamingConsistency, consistencyScore);
|
|
297
306
|
} catch (err) {
|
|
298
307
|
void err;
|
|
299
308
|
}
|
|
300
309
|
}
|
|
301
|
-
if (results.
|
|
310
|
+
if (results[import_core.ToolName.AiSignalClarity]) {
|
|
302
311
|
const { calculateAiSignalClarityScore } = await import("@aiready/ai-signal-clarity");
|
|
303
312
|
try {
|
|
304
|
-
const hrScore = calculateAiSignalClarityScore(
|
|
305
|
-
|
|
313
|
+
const hrScore = calculateAiSignalClarityScore(
|
|
314
|
+
results[import_core.ToolName.AiSignalClarity]
|
|
315
|
+
);
|
|
316
|
+
toolScores.set(import_core.ToolName.AiSignalClarity, hrScore);
|
|
306
317
|
} catch (err) {
|
|
307
318
|
void err;
|
|
308
319
|
}
|
|
309
320
|
}
|
|
310
|
-
if (results.
|
|
321
|
+
if (results[import_core.ToolName.AgentGrounding]) {
|
|
311
322
|
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
312
323
|
try {
|
|
313
|
-
const agScore = calculateGroundingScore(results.
|
|
314
|
-
toolScores.set(
|
|
324
|
+
const agScore = calculateGroundingScore(results[import_core.ToolName.AgentGrounding]);
|
|
325
|
+
toolScores.set(import_core.ToolName.AgentGrounding, agScore);
|
|
315
326
|
} catch (err) {
|
|
316
327
|
void err;
|
|
317
328
|
}
|
|
318
329
|
}
|
|
319
|
-
if (results.
|
|
330
|
+
if (results[import_core.ToolName.TestabilityIndex]) {
|
|
320
331
|
const { calculateTestabilityScore } = await import("@aiready/testability");
|
|
321
332
|
try {
|
|
322
|
-
const tbScore = calculateTestabilityScore(
|
|
323
|
-
|
|
333
|
+
const tbScore = calculateTestabilityScore(
|
|
334
|
+
results[import_core.ToolName.TestabilityIndex]
|
|
335
|
+
);
|
|
336
|
+
toolScores.set(import_core.ToolName.TestabilityIndex, tbScore);
|
|
324
337
|
} catch (err) {
|
|
325
338
|
void err;
|
|
326
339
|
}
|
|
327
340
|
}
|
|
328
|
-
if (results.
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
341
|
+
if (results[import_core.ToolName.DocDrift]) {
|
|
342
|
+
const data = results[import_core.ToolName.DocDrift];
|
|
343
|
+
toolScores.set(import_core.ToolName.DocDrift, {
|
|
344
|
+
toolName: import_core.ToolName.DocDrift,
|
|
345
|
+
score: data.summary.score || data.summary.totalScore || 0,
|
|
346
|
+
rawMetrics: data.summary,
|
|
333
347
|
factors: [],
|
|
334
|
-
recommendations: (
|
|
348
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
335
349
|
(action) => ({
|
|
336
350
|
action,
|
|
337
351
|
estimatedImpact: 5,
|
|
@@ -340,30 +354,36 @@ async function scoreUnified(results, options) {
|
|
|
340
354
|
)
|
|
341
355
|
});
|
|
342
356
|
}
|
|
343
|
-
if (results.
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
if (results[import_core.ToolName.DependencyHealth]) {
|
|
358
|
+
const data = results[import_core.ToolName.DependencyHealth];
|
|
359
|
+
toolScores.set(import_core.ToolName.DependencyHealth, {
|
|
360
|
+
toolName: import_core.ToolName.DependencyHealth,
|
|
361
|
+
score: data.summary.score || 0,
|
|
362
|
+
rawMetrics: data.summary,
|
|
348
363
|
factors: [],
|
|
349
|
-
recommendations: (
|
|
350
|
-
action
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
364
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
365
|
+
(action) => ({
|
|
366
|
+
action,
|
|
367
|
+
estimatedImpact: 5,
|
|
368
|
+
priority: "medium"
|
|
369
|
+
})
|
|
370
|
+
)
|
|
354
371
|
});
|
|
355
372
|
}
|
|
356
|
-
if (results.
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
373
|
+
if (results[import_core.ToolName.ChangeAmplification]) {
|
|
374
|
+
const data = results[import_core.ToolName.ChangeAmplification];
|
|
375
|
+
toolScores.set(import_core.ToolName.ChangeAmplification, {
|
|
376
|
+
toolName: import_core.ToolName.ChangeAmplification,
|
|
377
|
+
score: data.summary.score || 0,
|
|
378
|
+
rawMetrics: data.summary,
|
|
361
379
|
factors: [],
|
|
362
|
-
recommendations: (
|
|
363
|
-
action
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
380
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
381
|
+
(action) => ({
|
|
382
|
+
action,
|
|
383
|
+
estimatedImpact: 5,
|
|
384
|
+
priority: "medium"
|
|
385
|
+
})
|
|
386
|
+
)
|
|
367
387
|
});
|
|
368
388
|
}
|
|
369
389
|
if (toolScores.size === 0) {
|
|
@@ -396,40 +416,40 @@ function generateUnifiedSummary(result) {
|
|
|
396
416
|
output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
|
|
397
417
|
|
|
398
418
|
`;
|
|
399
|
-
if (result.
|
|
400
|
-
output += `\u{1F50D} Pattern Analysis: ${result.
|
|
419
|
+
if (result[import_core.ToolName.PatternDetect]) {
|
|
420
|
+
output += `\u{1F50D} Pattern Analysis: ${result[import_core.ToolName.PatternDetect].results.length} issues
|
|
401
421
|
`;
|
|
402
422
|
}
|
|
403
|
-
if (result.
|
|
404
|
-
output += `\u{1F9E0} Context Analysis: ${result.
|
|
423
|
+
if (result[import_core.ToolName.ContextAnalyzer]) {
|
|
424
|
+
output += `\u{1F9E0} Context Analysis: ${result[import_core.ToolName.ContextAnalyzer].results.length} issues
|
|
405
425
|
`;
|
|
406
426
|
}
|
|
407
|
-
if (result.
|
|
408
|
-
output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.
|
|
427
|
+
if (result[import_core.ToolName.NamingConsistency]) {
|
|
428
|
+
output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result[import_core.ToolName.NamingConsistency].summary.totalIssues} issues
|
|
409
429
|
`;
|
|
410
430
|
}
|
|
411
|
-
if (result.
|
|
412
|
-
output += `\u{1F4DD} Doc Drift Analysis: ${result.
|
|
431
|
+
if (result[import_core.ToolName.DocDrift]) {
|
|
432
|
+
output += `\u{1F4DD} Doc Drift Analysis: ${result[import_core.ToolName.DocDrift].results?.length || 0} issues
|
|
413
433
|
`;
|
|
414
434
|
}
|
|
415
|
-
if (result.
|
|
416
|
-
output += `\u{1F4E6} Dependency Health: ${result.
|
|
435
|
+
if (result[import_core.ToolName.DependencyHealth]) {
|
|
436
|
+
output += `\u{1F4E6} Dependency Health: ${result[import_core.ToolName.DependencyHealth].results?.length || 0} issues
|
|
417
437
|
`;
|
|
418
438
|
}
|
|
419
|
-
if (result.
|
|
420
|
-
output += `\u{1F9E0} AI Signal Clarity: ${result.
|
|
439
|
+
if (result[import_core.ToolName.AiSignalClarity]) {
|
|
440
|
+
output += `\u{1F9E0} AI Signal Clarity: ${result[import_core.ToolName.AiSignalClarity].summary?.totalSignals || 0} signals
|
|
421
441
|
`;
|
|
422
442
|
}
|
|
423
|
-
if (result.
|
|
424
|
-
output += `\u{1F9ED} Agent Grounding: ${result.
|
|
443
|
+
if (result[import_core.ToolName.AgentGrounding]) {
|
|
444
|
+
output += `\u{1F9ED} Agent Grounding: ${result[import_core.ToolName.AgentGrounding].results?.length || 0} issues
|
|
425
445
|
`;
|
|
426
446
|
}
|
|
427
|
-
if (result.
|
|
428
|
-
output += `\u{1F9EA} Testability Index: ${result.
|
|
447
|
+
if (result[import_core.ToolName.TestabilityIndex]) {
|
|
448
|
+
output += `\u{1F9EA} Testability Index: ${result[import_core.ToolName.TestabilityIndex].results?.length || 0} issues
|
|
429
449
|
`;
|
|
430
450
|
}
|
|
431
|
-
if (result.
|
|
432
|
-
output += `\u{1F4A5} Change Amplification: ${result.
|
|
451
|
+
if (result[import_core.ToolName.ChangeAmplification]) {
|
|
452
|
+
output += `\u{1F4A5} Change Amplification: ${result[import_core.ToolName.ChangeAmplification].summary?.totalIssues || 0} cascading risks
|
|
433
453
|
`;
|
|
434
454
|
}
|
|
435
455
|
return output;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
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/
|
|
15
|
-
"@aiready/
|
|
16
|
-
"@aiready/
|
|
17
|
-
"@aiready/
|
|
18
|
-
"@aiready/
|
|
19
|
-
"@aiready/
|
|
20
|
-
"@aiready/
|
|
21
|
-
"@aiready/
|
|
22
|
-
"@aiready/
|
|
23
|
-
"@aiready/
|
|
24
|
-
"@aiready/
|
|
14
|
+
"@aiready/core": "0.19.5",
|
|
15
|
+
"@aiready/agent-grounding": "0.9.5",
|
|
16
|
+
"@aiready/consistency": "0.16.5",
|
|
17
|
+
"@aiready/context-analyzer": "0.17.5",
|
|
18
|
+
"@aiready/deps": "0.9.5",
|
|
19
|
+
"@aiready/ai-signal-clarity": "0.9.5",
|
|
20
|
+
"@aiready/change-amplification": "0.9.5",
|
|
21
|
+
"@aiready/visualizer": "0.2.6",
|
|
22
|
+
"@aiready/doc-drift": "0.9.5",
|
|
23
|
+
"@aiready/pattern-detect": "0.12.5",
|
|
24
|
+
"@aiready/testability": "0.2.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24.0.0",
|