@aiready/cli 0.10.6 → 0.12.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/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-lint.log +9 -1
- package/.turbo/turbo-test.log +16 -4
- package/dist/chunk-N56YAZVN.mjs +194 -0
- package/dist/chunk-YBZKPKW3.mjs +161 -0
- package/dist/cli.js +198 -910
- package/dist/cli.mjs +86 -582
- package/dist/index.js +116 -371
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260307-092852.json +50609 -0
- package/src/.aiready/aiready-report-20260307-094301.json +50609 -0
- package/src/__tests__/cli.test.ts +55 -29
- package/src/commands/scan.ts +107 -699
- package/src/index.ts +154 -455
- package/dist/chunk-EQ2HQSTJ.mjs +0 -414
- package/dist/chunk-R3O7QPKD.mjs +0 -419
- package/dist/chunk-VQCWYJYJ.mjs +0 -438
- package/dist/chunk-VUCNUYI7.mjs +0 -417
package/dist/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -35,357 +25,137 @@ __export(index_exports, {
|
|
|
35
25
|
scoreUnified: () => scoreUnified
|
|
36
26
|
});
|
|
37
27
|
module.exports = __toCommonJS(index_exports);
|
|
38
|
-
var import_pattern_detect = require("@aiready/pattern-detect");
|
|
39
|
-
var import_context_analyzer = require("@aiready/context-analyzer");
|
|
40
|
-
var import_consistency = require("@aiready/consistency");
|
|
41
28
|
var import_core = require("@aiready/core");
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
var TOOL_PACKAGE_MAP = {
|
|
30
|
+
[import_core.ToolName.PatternDetect]: "@aiready/pattern-detect",
|
|
31
|
+
[import_core.ToolName.ContextAnalyzer]: "@aiready/context-analyzer",
|
|
32
|
+
[import_core.ToolName.NamingConsistency]: "@aiready/consistency",
|
|
33
|
+
[import_core.ToolName.AiSignalClarity]: "@aiready/ai-signal-clarity",
|
|
34
|
+
[import_core.ToolName.AgentGrounding]: "@aiready/agent-grounding",
|
|
35
|
+
[import_core.ToolName.TestabilityIndex]: "@aiready/testability",
|
|
36
|
+
[import_core.ToolName.DocDrift]: "@aiready/doc-drift",
|
|
37
|
+
[import_core.ToolName.DependencyHealth]: "@aiready/deps",
|
|
38
|
+
[import_core.ToolName.ChangeAmplification]: "@aiready/change-amplification",
|
|
39
|
+
// Aliases handled by registry
|
|
40
|
+
patterns: "@aiready/pattern-detect",
|
|
41
|
+
context: "@aiready/context-analyzer",
|
|
42
|
+
consistency: "@aiready/consistency"
|
|
47
43
|
};
|
|
48
|
-
function sortBySeverity(results) {
|
|
49
|
-
return results.map((file) => {
|
|
50
|
-
const sortedIssues = [...file.issues].sort((a, b) => {
|
|
51
|
-
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
52
|
-
if (severityDiff !== 0) return severityDiff;
|
|
53
|
-
return (a.location?.line || 0) - (b.location?.line || 0);
|
|
54
|
-
});
|
|
55
|
-
return { ...file, issues: sortedIssues };
|
|
56
|
-
}).sort((a, b) => {
|
|
57
|
-
const aMaxSeverity = Math.max(
|
|
58
|
-
...a.issues.map((i) => severityOrder[i.severity] || 0),
|
|
59
|
-
0
|
|
60
|
-
);
|
|
61
|
-
const bMaxSeverity = Math.max(
|
|
62
|
-
...b.issues.map((i) => severityOrder[i.severity] || 0),
|
|
63
|
-
0
|
|
64
|
-
);
|
|
65
|
-
if (aMaxSeverity !== bMaxSeverity) {
|
|
66
|
-
return bMaxSeverity - aMaxSeverity;
|
|
67
|
-
}
|
|
68
|
-
if (a.issues.length !== b.issues.length) {
|
|
69
|
-
return b.issues.length - a.issues.length;
|
|
70
|
-
}
|
|
71
|
-
return a.fileName.localeCompare(b.fileName);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
44
|
async function analyzeUnified(options) {
|
|
75
45
|
const startTime = Date.now();
|
|
76
|
-
const
|
|
46
|
+
const requestedTools = options.tools || [
|
|
47
|
+
"patterns",
|
|
48
|
+
"context",
|
|
49
|
+
"consistency"
|
|
50
|
+
];
|
|
77
51
|
const result = {
|
|
78
52
|
summary: {
|
|
79
53
|
totalIssues: 0,
|
|
80
|
-
toolsRun:
|
|
54
|
+
toolsRun: [],
|
|
81
55
|
executionTime: 0
|
|
82
56
|
}
|
|
83
57
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const sorted = contextResults.sort((a, b) => {
|
|
107
|
-
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
108
|
-
if (severityDiff !== 0) return severityDiff;
|
|
109
|
-
if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
|
|
110
|
-
return b.fragmentationScore - a.fragmentationScore;
|
|
111
|
-
});
|
|
112
|
-
const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
|
|
113
|
-
const output = {
|
|
114
|
-
results: sorted,
|
|
115
|
-
summary: genContextSummary(sorted)
|
|
116
|
-
};
|
|
117
|
-
result[import_core.ToolName.ContextAnalyzer] = output;
|
|
118
|
-
result.contextAnalyzer = output;
|
|
119
|
-
result.summary.totalIssues += sorted.length;
|
|
120
|
-
}
|
|
121
|
-
if (tools.includes("consistency")) {
|
|
122
|
-
const consistencyOptions = {
|
|
123
|
-
rootDir: options.rootDir,
|
|
124
|
-
include: options.include,
|
|
125
|
-
exclude: options.exclude,
|
|
126
|
-
...options.consistency || {}
|
|
127
|
-
};
|
|
128
|
-
const report = await (0, import_consistency.analyzeConsistency)(consistencyOptions);
|
|
129
|
-
if (options.progressCallback) {
|
|
130
|
-
options.progressCallback({ tool: "consistency", data: report });
|
|
131
|
-
}
|
|
132
|
-
result[import_core.ToolName.NamingConsistency] = {
|
|
133
|
-
results: report.results ? sortBySeverity(report.results) : [],
|
|
134
|
-
summary: report.summary
|
|
135
|
-
};
|
|
136
|
-
result.summary.totalIssues += report.summary.totalIssues;
|
|
137
|
-
}
|
|
138
|
-
if (tools.includes("doc-drift")) {
|
|
139
|
-
const { analyzeDocDrift } = await import("@aiready/doc-drift");
|
|
140
|
-
const report = await analyzeDocDrift({
|
|
141
|
-
rootDir: options.rootDir,
|
|
142
|
-
include: options.include,
|
|
143
|
-
exclude: options.exclude,
|
|
144
|
-
onProgress: options.onProgress
|
|
145
|
-
});
|
|
146
|
-
if (options.progressCallback) {
|
|
147
|
-
options.progressCallback({ tool: "doc-drift", data: report });
|
|
148
|
-
}
|
|
149
|
-
result[import_core.ToolName.DocDrift] = {
|
|
150
|
-
results: report.results || report.issues || [],
|
|
151
|
-
summary: report.summary || {}
|
|
152
|
-
};
|
|
153
|
-
const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
|
|
154
|
-
result.summary.totalIssues += issueCount;
|
|
155
|
-
}
|
|
156
|
-
if (tools.includes("deps-health")) {
|
|
157
|
-
const { analyzeDeps } = await import("@aiready/deps");
|
|
158
|
-
const report = await analyzeDeps({
|
|
159
|
-
rootDir: options.rootDir,
|
|
160
|
-
include: options.include,
|
|
161
|
-
exclude: options.exclude,
|
|
162
|
-
onProgress: options.onProgress
|
|
163
|
-
});
|
|
164
|
-
if (options.progressCallback) {
|
|
165
|
-
options.progressCallback({ tool: "deps-health", data: report });
|
|
166
|
-
}
|
|
167
|
-
result[import_core.ToolName.DependencyHealth] = {
|
|
168
|
-
results: report.results || report.issues || [],
|
|
169
|
-
summary: report.summary || {}
|
|
170
|
-
};
|
|
171
|
-
const issueCount = report.issues?.length || (report.results ? report.results.length : 0);
|
|
172
|
-
result.summary.totalIssues += issueCount;
|
|
173
|
-
}
|
|
174
|
-
if (tools.includes("ai-signal-clarity")) {
|
|
175
|
-
const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
|
|
176
|
-
const report = await analyzeAiSignalClarity({
|
|
177
|
-
rootDir: options.rootDir,
|
|
178
|
-
include: options.include,
|
|
179
|
-
exclude: options.exclude,
|
|
180
|
-
onProgress: options.onProgress
|
|
181
|
-
});
|
|
182
|
-
if (options.progressCallback) {
|
|
183
|
-
options.progressCallback({ tool: "ai-signal-clarity", data: report });
|
|
184
|
-
}
|
|
185
|
-
result[import_core.ToolName.AiSignalClarity] = {
|
|
186
|
-
...report,
|
|
187
|
-
results: report.results || report.issues || [],
|
|
188
|
-
summary: report.summary || {}
|
|
189
|
-
};
|
|
190
|
-
result.summary.totalIssues += (report.results || report.issues)?.reduce(
|
|
191
|
-
(sum, r) => sum + (r.issues?.length || 1),
|
|
192
|
-
0
|
|
193
|
-
) || 0;
|
|
194
|
-
}
|
|
195
|
-
if (tools.includes("agent-grounding")) {
|
|
196
|
-
const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
|
|
197
|
-
const report = await analyzeAgentGrounding({
|
|
198
|
-
rootDir: options.rootDir,
|
|
199
|
-
include: options.include,
|
|
200
|
-
exclude: options.exclude,
|
|
201
|
-
onProgress: options.onProgress
|
|
202
|
-
});
|
|
203
|
-
if (options.progressCallback) {
|
|
204
|
-
options.progressCallback({ tool: "agent-grounding", data: report });
|
|
205
|
-
}
|
|
206
|
-
result[import_core.ToolName.AgentGrounding] = {
|
|
207
|
-
...report,
|
|
208
|
-
results: report.results || report.issues || [],
|
|
209
|
-
summary: report.summary || {}
|
|
210
|
-
};
|
|
211
|
-
result.summary.totalIssues += (report.issues || report.results || []).length;
|
|
212
|
-
}
|
|
213
|
-
if (tools.includes("testability")) {
|
|
214
|
-
const { analyzeTestability } = await import("@aiready/testability");
|
|
215
|
-
const report = await analyzeTestability({
|
|
216
|
-
rootDir: options.rootDir,
|
|
217
|
-
include: options.include,
|
|
218
|
-
exclude: options.exclude,
|
|
219
|
-
onProgress: options.onProgress
|
|
220
|
-
});
|
|
221
|
-
if (options.progressCallback) {
|
|
222
|
-
options.progressCallback({ tool: "testability", data: report });
|
|
58
|
+
for (const toolName of requestedTools) {
|
|
59
|
+
let provider = import_core.ToolRegistry.find(toolName);
|
|
60
|
+
if (!provider) {
|
|
61
|
+
const packageName = TOOL_PACKAGE_MAP[toolName] || (toolName.startsWith("@aiready/") ? toolName : `@aiready/${toolName}`);
|
|
62
|
+
try {
|
|
63
|
+
await import(packageName);
|
|
64
|
+
provider = import_core.ToolRegistry.find(toolName);
|
|
65
|
+
if (provider) {
|
|
66
|
+
console.log(
|
|
67
|
+
`\u2705 Successfully loaded tool provider: ${toolName} from ${packageName}`
|
|
68
|
+
);
|
|
69
|
+
} else {
|
|
70
|
+
console.log(
|
|
71
|
+
`\u26A0\uFE0F Loaded ${packageName} but provider ${toolName} still not found in registry.`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
console.log(
|
|
76
|
+
`\u274C Failed to dynamically load tool ${toolName} (${packageName}):`,
|
|
77
|
+
err.message
|
|
78
|
+
);
|
|
79
|
+
}
|
|
223
80
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
result.summary.totalIssues += (report.issues || report.results || []).length;
|
|
230
|
-
}
|
|
231
|
-
if (tools.includes("change-amplification")) {
|
|
232
|
-
const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
|
|
233
|
-
const report = await analyzeChangeAmplification({
|
|
234
|
-
rootDir: options.rootDir,
|
|
235
|
-
include: options.include,
|
|
236
|
-
exclude: options.exclude,
|
|
237
|
-
onProgress: options.onProgress
|
|
238
|
-
});
|
|
239
|
-
if (options.progressCallback) {
|
|
240
|
-
options.progressCallback({ tool: "change-amplification", data: report });
|
|
81
|
+
if (!provider) {
|
|
82
|
+
console.warn(
|
|
83
|
+
`\u26A0\uFE0F Warning: Tool provider for '${toolName}' not found. Skipping.`
|
|
84
|
+
);
|
|
85
|
+
continue;
|
|
241
86
|
}
|
|
242
|
-
result[import_core.ToolName.ChangeAmplification] = {
|
|
243
|
-
results: report.results || [],
|
|
244
|
-
summary: report.summary || {}
|
|
245
|
-
};
|
|
246
|
-
result.summary.totalIssues += report.summary?.totalIssues || 0;
|
|
247
|
-
}
|
|
248
|
-
result.summary.executionTime = Date.now() - startTime;
|
|
249
|
-
return result;
|
|
250
|
-
}
|
|
251
|
-
async function scoreUnified(results, options) {
|
|
252
|
-
const toolScores = /* @__PURE__ */ new Map();
|
|
253
|
-
if (results[import_core.ToolName.PatternDetect]) {
|
|
254
|
-
const data = results[import_core.ToolName.PatternDetect];
|
|
255
|
-
const { calculatePatternScore } = await import("@aiready/pattern-detect");
|
|
256
87
|
try {
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
88
|
+
const output = await provider.analyze(options);
|
|
89
|
+
if (options.progressCallback) {
|
|
90
|
+
options.progressCallback({ tool: provider.id, data: output });
|
|
91
|
+
}
|
|
92
|
+
result[provider.id] = output;
|
|
93
|
+
result.summary.toolsRun.push(provider.id);
|
|
94
|
+
const issueCount = output.results.reduce(
|
|
95
|
+
(sum, file) => sum + (file.issues?.length || 0),
|
|
263
96
|
0
|
|
264
97
|
);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
chattiness: 0
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
toolScores.set(import_core.ToolName.PatternDetect, patternScore);
|
|
275
|
-
} catch (err) {
|
|
276
|
-
void err;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
if (results[import_core.ToolName.ContextAnalyzer]) {
|
|
280
|
-
const data = results[import_core.ToolName.ContextAnalyzer];
|
|
281
|
-
const { calculateContextScore } = await import("@aiready/context-analyzer");
|
|
282
|
-
try {
|
|
283
|
-
const ctxSummary = data.summary;
|
|
284
|
-
const contextScore = calculateContextScore(ctxSummary);
|
|
285
|
-
contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
286
|
-
totalContextTokens: ctxSummary.totalTokens,
|
|
287
|
-
wastedTokens: {
|
|
288
|
-
duplication: 0,
|
|
289
|
-
fragmentation: ctxSummary.totalPotentialSavings || 0,
|
|
290
|
-
chattiness: 0
|
|
98
|
+
result.summary.totalIssues += issueCount;
|
|
99
|
+
if (provider.alias && Array.isArray(provider.alias)) {
|
|
100
|
+
for (const alias of provider.alias) {
|
|
101
|
+
if (!result[alias]) {
|
|
102
|
+
result[alias] = output;
|
|
103
|
+
}
|
|
291
104
|
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (results[import_core.ToolName.NamingConsistency]) {
|
|
299
|
-
const data = results[import_core.ToolName.NamingConsistency];
|
|
300
|
-
const { calculateConsistencyScore } = await import("@aiready/consistency");
|
|
301
|
-
try {
|
|
302
|
-
const issues = data.results?.flatMap((r) => r.issues) || [];
|
|
303
|
-
const totalFiles = data.summary?.filesAnalyzed || 0;
|
|
304
|
-
const consistencyScore = calculateConsistencyScore(issues, totalFiles);
|
|
305
|
-
toolScores.set(import_core.ToolName.NamingConsistency, consistencyScore);
|
|
306
|
-
} catch (err) {
|
|
307
|
-
void err;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
if (results[import_core.ToolName.AiSignalClarity]) {
|
|
311
|
-
const { calculateAiSignalClarityScore } = await import("@aiready/ai-signal-clarity");
|
|
312
|
-
try {
|
|
313
|
-
const hrScore = calculateAiSignalClarityScore(
|
|
314
|
-
results[import_core.ToolName.AiSignalClarity]
|
|
105
|
+
}
|
|
106
|
+
const camelCaseId = provider.id.replace(
|
|
107
|
+
/-([a-z])/g,
|
|
108
|
+
(g) => g[1].toUpperCase()
|
|
315
109
|
);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
if (results[import_core.ToolName.AgentGrounding]) {
|
|
322
|
-
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
323
|
-
try {
|
|
324
|
-
const agScore = calculateGroundingScore(results[import_core.ToolName.AgentGrounding]);
|
|
325
|
-
toolScores.set(import_core.ToolName.AgentGrounding, agScore);
|
|
110
|
+
if (camelCaseId !== provider.id && !result[camelCaseId]) {
|
|
111
|
+
result[camelCaseId] = output;
|
|
112
|
+
}
|
|
326
113
|
} catch (err) {
|
|
327
|
-
|
|
114
|
+
console.error(`\u274C Error running tool '${provider.id}':`, err);
|
|
328
115
|
}
|
|
329
116
|
}
|
|
330
|
-
|
|
331
|
-
|
|
117
|
+
result.summary.executionTime = Date.now() - startTime;
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
async function scoreUnified(results, options) {
|
|
121
|
+
const toolScores = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const toolId of results.summary.toolsRun) {
|
|
123
|
+
const provider = import_core.ToolRegistry.get(toolId);
|
|
124
|
+
if (!provider) continue;
|
|
125
|
+
const output = results[toolId];
|
|
126
|
+
if (!output) continue;
|
|
332
127
|
try {
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
128
|
+
const toolScore = provider.score(output, options);
|
|
129
|
+
if (!toolScore.tokenBudget) {
|
|
130
|
+
if (toolId === import_core.ToolName.PatternDetect && output.duplicates) {
|
|
131
|
+
const wastedTokens = output.duplicates.reduce(
|
|
132
|
+
(sum, d) => sum + (d.tokenCost || 0),
|
|
133
|
+
0
|
|
134
|
+
);
|
|
135
|
+
toolScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
136
|
+
totalContextTokens: wastedTokens * 2,
|
|
137
|
+
wastedTokens: {
|
|
138
|
+
duplication: wastedTokens,
|
|
139
|
+
fragmentation: 0,
|
|
140
|
+
chattiness: 0
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
} else if (toolId === import_core.ToolName.ContextAnalyzer && output.summary) {
|
|
144
|
+
toolScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
145
|
+
totalContextTokens: output.summary.totalTokens,
|
|
146
|
+
wastedTokens: {
|
|
147
|
+
duplication: 0,
|
|
148
|
+
fragmentation: output.summary.totalPotentialSavings || 0,
|
|
149
|
+
chattiness: 0
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
toolScores.set(toolId, toolScore);
|
|
337
155
|
} catch (err) {
|
|
338
|
-
|
|
156
|
+
console.error(`\u274C Error scoring tool '${toolId}':`, err);
|
|
339
157
|
}
|
|
340
158
|
}
|
|
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,
|
|
347
|
-
factors: [],
|
|
348
|
-
recommendations: (data.summary.recommendations || []).map(
|
|
349
|
-
(action) => ({
|
|
350
|
-
action,
|
|
351
|
-
estimatedImpact: 5,
|
|
352
|
-
priority: "medium"
|
|
353
|
-
})
|
|
354
|
-
)
|
|
355
|
-
});
|
|
356
|
-
}
|
|
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,
|
|
363
|
-
factors: [],
|
|
364
|
-
recommendations: (data.summary.recommendations || []).map(
|
|
365
|
-
(action) => ({
|
|
366
|
-
action,
|
|
367
|
-
estimatedImpact: 5,
|
|
368
|
-
priority: "medium"
|
|
369
|
-
})
|
|
370
|
-
)
|
|
371
|
-
});
|
|
372
|
-
}
|
|
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,
|
|
379
|
-
factors: [],
|
|
380
|
-
recommendations: (data.summary.recommendations || []).map(
|
|
381
|
-
(action) => ({
|
|
382
|
-
action,
|
|
383
|
-
estimatedImpact: 5,
|
|
384
|
-
priority: "medium"
|
|
385
|
-
})
|
|
386
|
-
)
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
159
|
if (toolScores.size === 0) {
|
|
390
160
|
return {
|
|
391
161
|
overall: 0,
|
|
@@ -416,41 +186,16 @@ function generateUnifiedSummary(result) {
|
|
|
416
186
|
output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
|
|
417
187
|
|
|
418
188
|
`;
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (result[import_core.ToolName.NamingConsistency]) {
|
|
428
|
-
output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result[import_core.ToolName.NamingConsistency].summary.totalIssues} issues
|
|
429
|
-
`;
|
|
430
|
-
}
|
|
431
|
-
if (result[import_core.ToolName.DocDrift]) {
|
|
432
|
-
output += `\u{1F4DD} Doc Drift Analysis: ${result[import_core.ToolName.DocDrift].results?.length || 0} issues
|
|
433
|
-
`;
|
|
434
|
-
}
|
|
435
|
-
if (result[import_core.ToolName.DependencyHealth]) {
|
|
436
|
-
output += `\u{1F4E6} Dependency Health: ${result[import_core.ToolName.DependencyHealth].results?.length || 0} issues
|
|
437
|
-
`;
|
|
438
|
-
}
|
|
439
|
-
if (result[import_core.ToolName.AiSignalClarity]) {
|
|
440
|
-
output += `\u{1F9E0} AI Signal Clarity: ${result[import_core.ToolName.AiSignalClarity].summary?.totalSignals || 0} signals
|
|
441
|
-
`;
|
|
442
|
-
}
|
|
443
|
-
if (result[import_core.ToolName.AgentGrounding]) {
|
|
444
|
-
output += `\u{1F9ED} Agent Grounding: ${result[import_core.ToolName.AgentGrounding].results?.length || 0} issues
|
|
445
|
-
`;
|
|
446
|
-
}
|
|
447
|
-
if (result[import_core.ToolName.TestabilityIndex]) {
|
|
448
|
-
output += `\u{1F9EA} Testability Index: ${result[import_core.ToolName.TestabilityIndex].results?.length || 0} issues
|
|
449
|
-
`;
|
|
450
|
-
}
|
|
451
|
-
if (result[import_core.ToolName.ChangeAmplification]) {
|
|
452
|
-
output += `\u{1F4A5} Change Amplification: ${result[import_core.ToolName.ChangeAmplification].summary?.totalIssues || 0} cascading risks
|
|
189
|
+
for (const provider of import_core.ToolRegistry.getAll()) {
|
|
190
|
+
const toolResult = result[provider.id];
|
|
191
|
+
if (toolResult) {
|
|
192
|
+
const issueCount = toolResult.results.reduce(
|
|
193
|
+
(sum, r) => sum + (r.issues?.length || 0),
|
|
194
|
+
0
|
|
195
|
+
);
|
|
196
|
+
output += `\u2022 ${provider.id}: ${issueCount} issues
|
|
453
197
|
`;
|
|
198
|
+
}
|
|
454
199
|
}
|
|
455
200
|
return output;
|
|
456
201
|
}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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/agent-grounding": "0.11.0",
|
|
15
|
+
"@aiready/context-analyzer": "0.19.0",
|
|
16
|
+
"@aiready/doc-drift": "0.11.0",
|
|
17
|
+
"@aiready/consistency": "0.18.0",
|
|
18
|
+
"@aiready/core": "0.21.0",
|
|
19
|
+
"@aiready/change-amplification": "0.11.0",
|
|
20
|
+
"@aiready/pattern-detect": "0.14.0",
|
|
21
|
+
"@aiready/ai-signal-clarity": "0.11.0",
|
|
22
|
+
"@aiready/testability": "0.4.0",
|
|
23
|
+
"@aiready/deps": "0.11.0",
|
|
24
|
+
"@aiready/visualizer": "0.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24.0.0",
|