@aiready/cli 0.9.46 → 0.10.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-test.log +6 -7
- package/dist/{chunk-6FOVC2OE.mjs → chunk-EQ2HQSTJ.mjs} +83 -61
- package/dist/cli.js +102 -75
- package/dist/cli.mjs +30 -25
- package/dist/index.js +83 -61
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260304-234659.json +8288 -0
- package/src/.aiready/aiready-report-20260305-153847.json +8015 -0
- package/src/.aiready/aiready-report-20260305-154121.json +8015 -0
- package/src/.aiready/aiready-report-20260305-160026.json +8015 -0
- package/src/.aiready/aiready-report-20260305-160752.json +8015 -0
- package/src/.aiready/aiready-report-20260305-163858.json +8015 -0
- package/src/__tests__/cli.test.ts +6 -6
- package/src/commands/scan.ts +27 -22
- package/src/commands/visualize.ts +3 -3
- package/src/index.ts +108 -92
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.js +0 -52
- package/dist/__tests__/cli.test.js.map +0 -1
- package/dist/agent-grounding-DAOSU4MF.mjs +0 -7
- package/dist/chunk-2LXCBVPN.mjs +0 -109
- package/dist/chunk-3SG2GLFJ.mjs +0 -118
- package/dist/chunk-5GZDRZ3T.mjs +0 -126
- package/dist/chunk-DEZVFBPS.mjs +0 -111
- package/dist/chunk-G6SDH7ZS.mjs +0 -126
- package/dist/chunk-HLBKROD3.mjs +0 -237
- package/dist/chunk-JQG7ZATX.mjs +0 -211
- package/dist/chunk-LLJMKNBI.mjs +0 -243
- package/dist/chunk-M7O2MEM5.mjs +0 -211
- package/dist/chunk-MEXEG3IJ.mjs +0 -389
- package/dist/chunk-N4SLON5K.mjs +0 -152
- package/dist/chunk-OVELUOM6.mjs +0 -112
- package/dist/chunk-P3XAXCTK.mjs +0 -110
- package/dist/chunk-PDOONNSK.mjs +0 -228
- package/dist/chunk-QXQP6BMO.mjs +0 -109
- package/dist/chunk-RBWLQRKR.mjs +0 -39
- package/dist/chunk-XAF2EW5H.mjs +0 -46
- package/dist/chunk-Y6FXYEAI.mjs +0 -10
- package/dist/chunk-YIS6WTY5.mjs +0 -35
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/deps-health-UWVYJ7FZ.mjs +0 -47
- package/dist/doc-drift-G7MGAZAE.mjs +0 -47
- package/dist/hallucination-risk-XU6E7IGN.mjs +0 -7
- package/dist/index.d.mts +0 -33
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/testability-VDZJZ4MF.mjs +0 -7
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.47 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
|
+
[90m[[90m4:11:53 PM[90m][39m [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]
|
|
14
14
|
|
|
15
15
|
src/cli.ts:25:31:
|
|
16
16
|
[37m 25 │ return dirname(fileURLToPath([32mimport.meta[37m.url));
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m89.07 KB[39m
|
|
24
|
-
[32mCJS[39m [1mdist/index.js [22m[32m13.89 KB[39m
|
|
25
|
-
[32mCJS[39m ⚡️ Build success in 32ms
|
|
26
23
|
[32mESM[39m [1mdist/index.mjs [22m[32m170.00 B[39m
|
|
27
|
-
[32mESM[39m [1mdist/chunk-
|
|
28
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m73.
|
|
29
|
-
[32mESM[39m ⚡️ Build success in
|
|
24
|
+
[32mESM[39m [1mdist/chunk-EQ2HQSTJ.mjs [22m[32m13.39 KB[39m
|
|
25
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m73.88 KB[39m
|
|
26
|
+
[32mESM[39m ⚡️ Build success in 29ms
|
|
27
|
+
[32mCJS[39m [1mdist/index.js [22m[32m14.79 KB[39m
|
|
28
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m90.07 KB[39m
|
|
29
|
+
[32mCJS[39m ⚡️ Build success in 29ms
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.47 test /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/cli[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m
|
|
10
|
-
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
11
10
|
|
|
12
|
-
[2m Test Files [22m [1m[
|
|
13
|
-
[2m Tests [22m [1m[
|
|
14
|
-
[2m Start at [22m 12:
|
|
15
|
-
[2m Duration [22m
|
|
11
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
|
+
[2m Tests [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
13
|
+
[2m Start at [22m 16:12:25
|
|
14
|
+
[2m Duration [22m 327ms[2m (transform 78ms, setup 0ms, import 243ms, tests 2ms, environment 0ms)[22m
|
|
16
15
|
|
|
17
16
|
[?25h
|
|
@@ -60,8 +60,11 @@ async function analyzeUnified(options) {
|
|
|
60
60
|
if (options.progressCallback) {
|
|
61
61
|
options.progressCallback({ tool: "patterns", data: patternResult });
|
|
62
62
|
}
|
|
63
|
-
result.
|
|
64
|
-
|
|
63
|
+
result.patternDetect = {
|
|
64
|
+
results: sortBySeverity(patternResult.results),
|
|
65
|
+
summary: patternResult.summary || {},
|
|
66
|
+
duplicates: patternResult.duplicates || []
|
|
67
|
+
};
|
|
65
68
|
result.summary.totalIssues += patternResult.results.reduce(
|
|
66
69
|
(sum, file) => sum + file.issues.length,
|
|
67
70
|
0
|
|
@@ -72,13 +75,18 @@ async function analyzeUnified(options) {
|
|
|
72
75
|
if (options.progressCallback) {
|
|
73
76
|
options.progressCallback({ tool: "context", data: contextResults });
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
const sorted = contextResults.sort((a, b) => {
|
|
76
79
|
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
77
80
|
if (severityDiff !== 0) return severityDiff;
|
|
78
81
|
if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
|
|
79
82
|
return b.fragmentationScore - a.fragmentationScore;
|
|
80
83
|
});
|
|
81
|
-
|
|
84
|
+
const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
|
|
85
|
+
result.contextAnalyzer = {
|
|
86
|
+
results: sorted,
|
|
87
|
+
summary: genContextSummary(sorted)
|
|
88
|
+
};
|
|
89
|
+
result.summary.totalIssues += sorted.length;
|
|
82
90
|
}
|
|
83
91
|
if (tools.includes("consistency")) {
|
|
84
92
|
const consistencyOptions = {
|
|
@@ -91,10 +99,10 @@ async function analyzeUnified(options) {
|
|
|
91
99
|
if (options.progressCallback) {
|
|
92
100
|
options.progressCallback({ tool: "consistency", data: report });
|
|
93
101
|
}
|
|
94
|
-
|
|
95
|
-
report.results
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
result.consistency = {
|
|
103
|
+
results: report.results ? sortBySeverity(report.results) : [],
|
|
104
|
+
summary: report.summary
|
|
105
|
+
};
|
|
98
106
|
result.summary.totalIssues += report.summary.totalIssues;
|
|
99
107
|
}
|
|
100
108
|
if (tools.includes("doc-drift")) {
|
|
@@ -108,7 +116,10 @@ async function analyzeUnified(options) {
|
|
|
108
116
|
if (options.progressCallback) {
|
|
109
117
|
options.progressCallback({ tool: "doc-drift", data: report });
|
|
110
118
|
}
|
|
111
|
-
result.docDrift =
|
|
119
|
+
result.docDrift = {
|
|
120
|
+
results: report.results || [],
|
|
121
|
+
summary: report.summary || {}
|
|
122
|
+
};
|
|
112
123
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
113
124
|
}
|
|
114
125
|
if (tools.includes("deps-health")) {
|
|
@@ -122,10 +133,13 @@ async function analyzeUnified(options) {
|
|
|
122
133
|
if (options.progressCallback) {
|
|
123
134
|
options.progressCallback({ tool: "deps-health", data: report });
|
|
124
135
|
}
|
|
125
|
-
result.
|
|
136
|
+
result.dependencyHealth = {
|
|
137
|
+
results: report.results || [],
|
|
138
|
+
summary: report.summary || {}
|
|
139
|
+
};
|
|
126
140
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
127
141
|
}
|
|
128
|
-
if (tools.includes("
|
|
142
|
+
if (tools.includes("ai-signal-clarity")) {
|
|
129
143
|
const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
|
|
130
144
|
const report = await analyzeAiSignalClarity({
|
|
131
145
|
rootDir: options.rootDir,
|
|
@@ -134,15 +148,18 @@ async function analyzeUnified(options) {
|
|
|
134
148
|
onProgress: options.onProgress
|
|
135
149
|
});
|
|
136
150
|
if (options.progressCallback) {
|
|
137
|
-
options.progressCallback({ tool: "
|
|
151
|
+
options.progressCallback({ tool: "ai-signal-clarity", data: report });
|
|
138
152
|
}
|
|
139
|
-
result.aiSignalClarity =
|
|
153
|
+
result.aiSignalClarity = {
|
|
154
|
+
results: report.results || [],
|
|
155
|
+
summary: report.summary || {}
|
|
156
|
+
};
|
|
140
157
|
result.summary.totalIssues += report.results?.reduce(
|
|
141
158
|
(sum, r) => sum + (r.issues?.length || 0),
|
|
142
159
|
0
|
|
143
160
|
) || 0;
|
|
144
161
|
}
|
|
145
|
-
if (tools.includes("grounding")) {
|
|
162
|
+
if (tools.includes("agent-grounding")) {
|
|
146
163
|
const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
|
|
147
164
|
const report = await analyzeAgentGrounding({
|
|
148
165
|
rootDir: options.rootDir,
|
|
@@ -151,9 +168,12 @@ async function analyzeUnified(options) {
|
|
|
151
168
|
onProgress: options.onProgress
|
|
152
169
|
});
|
|
153
170
|
if (options.progressCallback) {
|
|
154
|
-
options.progressCallback({ tool: "grounding", data: report });
|
|
171
|
+
options.progressCallback({ tool: "agent-grounding", data: report });
|
|
155
172
|
}
|
|
156
|
-
result.
|
|
173
|
+
result.agentGrounding = {
|
|
174
|
+
results: report.results || [],
|
|
175
|
+
summary: report.summary || {}
|
|
176
|
+
};
|
|
157
177
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
158
178
|
}
|
|
159
179
|
if (tools.includes("testability")) {
|
|
@@ -167,10 +187,13 @@ async function analyzeUnified(options) {
|
|
|
167
187
|
if (options.progressCallback) {
|
|
168
188
|
options.progressCallback({ tool: "testability", data: report });
|
|
169
189
|
}
|
|
170
|
-
result.testability =
|
|
190
|
+
result.testability = {
|
|
191
|
+
results: report.results || [],
|
|
192
|
+
summary: report.summary || {}
|
|
193
|
+
};
|
|
171
194
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
172
195
|
}
|
|
173
|
-
if (tools.includes("
|
|
196
|
+
if (tools.includes("change-amplification")) {
|
|
174
197
|
const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
|
|
175
198
|
const report = await analyzeChangeAmplification({
|
|
176
199
|
rootDir: options.rootDir,
|
|
@@ -179,9 +202,12 @@ async function analyzeUnified(options) {
|
|
|
179
202
|
onProgress: options.onProgress
|
|
180
203
|
});
|
|
181
204
|
if (options.progressCallback) {
|
|
182
|
-
options.progressCallback({ tool: "
|
|
205
|
+
options.progressCallback({ tool: "change-amplification", data: report });
|
|
183
206
|
}
|
|
184
|
-
result.changeAmplification =
|
|
207
|
+
result.changeAmplification = {
|
|
208
|
+
results: report.results || [],
|
|
209
|
+
summary: report.summary || {}
|
|
210
|
+
};
|
|
185
211
|
result.summary.totalIssues += report.summary?.totalIssues || 0;
|
|
186
212
|
}
|
|
187
213
|
result.summary.executionTime = Date.now() - startTime;
|
|
@@ -189,14 +215,14 @@ async function analyzeUnified(options) {
|
|
|
189
215
|
}
|
|
190
216
|
async function scoreUnified(results, options) {
|
|
191
217
|
const toolScores = /* @__PURE__ */ new Map();
|
|
192
|
-
if (results.
|
|
218
|
+
if (results.patternDetect) {
|
|
193
219
|
const { calculatePatternScore } = await import("@aiready/pattern-detect");
|
|
194
220
|
try {
|
|
195
221
|
const patternScore = calculatePatternScore(
|
|
196
|
-
results.duplicates,
|
|
197
|
-
results.
|
|
222
|
+
results.patternDetect.duplicates,
|
|
223
|
+
results.patternDetect.results?.length || 0
|
|
198
224
|
);
|
|
199
|
-
const wastedTokens = results.duplicates.reduce(
|
|
225
|
+
const wastedTokens = results.patternDetect.duplicates.reduce(
|
|
200
226
|
(sum, d) => sum + (d.tokenCost || 0),
|
|
201
227
|
0
|
|
202
228
|
);
|
|
@@ -214,10 +240,10 @@ async function scoreUnified(results, options) {
|
|
|
214
240
|
void err;
|
|
215
241
|
}
|
|
216
242
|
}
|
|
217
|
-
if (results.
|
|
218
|
-
const {
|
|
243
|
+
if (results.contextAnalyzer) {
|
|
244
|
+
const { calculateContextScore } = await import("@aiready/context-analyzer");
|
|
219
245
|
try {
|
|
220
|
-
const ctxSummary =
|
|
246
|
+
const ctxSummary = results.contextAnalyzer.summary;
|
|
221
247
|
const contextScore = calculateContextScore(ctxSummary);
|
|
222
248
|
contextScore.tokenBudget = calculateTokenBudget({
|
|
223
249
|
totalContextTokens: ctxSummary.totalTokens,
|
|
@@ -252,10 +278,10 @@ async function scoreUnified(results, options) {
|
|
|
252
278
|
void err;
|
|
253
279
|
}
|
|
254
280
|
}
|
|
255
|
-
if (results.
|
|
281
|
+
if (results.agentGrounding) {
|
|
256
282
|
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
257
283
|
try {
|
|
258
|
-
const agScore = calculateGroundingScore(results.
|
|
284
|
+
const agScore = calculateGroundingScore(results.agentGrounding);
|
|
259
285
|
toolScores.set("agent-grounding", agScore);
|
|
260
286
|
} catch (err) {
|
|
261
287
|
void err;
|
|
@@ -273,10 +299,10 @@ async function scoreUnified(results, options) {
|
|
|
273
299
|
if (results.docDrift) {
|
|
274
300
|
toolScores.set("doc-drift", {
|
|
275
301
|
toolName: "doc-drift",
|
|
276
|
-
score: results.docDrift.summary.score,
|
|
277
|
-
rawMetrics: results.docDrift.
|
|
302
|
+
score: results.docDrift.summary.score || results.docDrift.summary.totalScore || 0,
|
|
303
|
+
rawMetrics: results.docDrift.summary,
|
|
278
304
|
factors: [],
|
|
279
|
-
recommendations: (results.docDrift.recommendations || []).map(
|
|
305
|
+
recommendations: (results.docDrift.summary.recommendations || []).map(
|
|
280
306
|
(action) => ({
|
|
281
307
|
action,
|
|
282
308
|
estimatedImpact: 5,
|
|
@@ -285,34 +311,30 @@ async function scoreUnified(results, options) {
|
|
|
285
311
|
)
|
|
286
312
|
});
|
|
287
313
|
}
|
|
288
|
-
if (results.
|
|
314
|
+
if (results.dependencyHealth) {
|
|
289
315
|
toolScores.set("dependency-health", {
|
|
290
316
|
toolName: "dependency-health",
|
|
291
|
-
score: results.
|
|
292
|
-
rawMetrics: results.
|
|
317
|
+
score: results.dependencyHealth.summary.score || 0,
|
|
318
|
+
rawMetrics: results.dependencyHealth.summary,
|
|
293
319
|
factors: [],
|
|
294
|
-
recommendations: (results.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
})
|
|
300
|
-
)
|
|
320
|
+
recommendations: (results.dependencyHealth.summary.recommendations || []).map((action) => ({
|
|
321
|
+
action,
|
|
322
|
+
estimatedImpact: 5,
|
|
323
|
+
priority: "medium"
|
|
324
|
+
}))
|
|
301
325
|
});
|
|
302
326
|
}
|
|
303
327
|
if (results.changeAmplification) {
|
|
304
328
|
toolScores.set("change-amplification", {
|
|
305
329
|
toolName: "change-amplification",
|
|
306
|
-
score: results.changeAmplification.summary.score,
|
|
307
|
-
rawMetrics: results.changeAmplification.
|
|
330
|
+
score: results.changeAmplification.summary.score || 0,
|
|
331
|
+
rawMetrics: results.changeAmplification.summary,
|
|
308
332
|
factors: [],
|
|
309
|
-
recommendations: (results.changeAmplification.recommendations || []).map(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
})
|
|
315
|
-
)
|
|
333
|
+
recommendations: (results.changeAmplification.summary.recommendations || []).map((action) => ({
|
|
334
|
+
action,
|
|
335
|
+
estimatedImpact: 5,
|
|
336
|
+
priority: "medium"
|
|
337
|
+
}))
|
|
316
338
|
});
|
|
317
339
|
}
|
|
318
340
|
if (toolScores.size === 0) {
|
|
@@ -345,12 +367,12 @@ function generateUnifiedSummary(result) {
|
|
|
345
367
|
output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
|
|
346
368
|
|
|
347
369
|
`;
|
|
348
|
-
if (result.
|
|
349
|
-
output += `\u{1F50D} Pattern Analysis: ${result.
|
|
370
|
+
if (result.patternDetect) {
|
|
371
|
+
output += `\u{1F50D} Pattern Analysis: ${result.patternDetect.results.length} issues
|
|
350
372
|
`;
|
|
351
373
|
}
|
|
352
|
-
if (result.
|
|
353
|
-
output += `\u{1F9E0} Context Analysis: ${result.
|
|
374
|
+
if (result.contextAnalyzer) {
|
|
375
|
+
output += `\u{1F9E0} Context Analysis: ${result.contextAnalyzer.results.length} issues
|
|
354
376
|
`;
|
|
355
377
|
}
|
|
356
378
|
if (result.consistency) {
|
|
@@ -358,23 +380,23 @@ function generateUnifiedSummary(result) {
|
|
|
358
380
|
`;
|
|
359
381
|
}
|
|
360
382
|
if (result.docDrift) {
|
|
361
|
-
output += `\u{1F4DD} Doc Drift Analysis: ${result.docDrift.
|
|
383
|
+
output += `\u{1F4DD} Doc Drift Analysis: ${result.docDrift.results?.length || 0} issues
|
|
362
384
|
`;
|
|
363
385
|
}
|
|
364
|
-
if (result.
|
|
365
|
-
output += `\u{1F4E6} Dependency Health: ${result.
|
|
386
|
+
if (result.dependencyHealth) {
|
|
387
|
+
output += `\u{1F4E6} Dependency Health: ${result.dependencyHealth.results?.length || 0} issues
|
|
366
388
|
`;
|
|
367
389
|
}
|
|
368
390
|
if (result.aiSignalClarity) {
|
|
369
391
|
output += `\u{1F9E0} AI Signal Clarity: ${result.aiSignalClarity.summary?.totalSignals || 0} signals
|
|
370
392
|
`;
|
|
371
393
|
}
|
|
372
|
-
if (result.
|
|
373
|
-
output += `\u{1F9ED} Agent Grounding: ${result.
|
|
394
|
+
if (result.agentGrounding) {
|
|
395
|
+
output += `\u{1F9ED} Agent Grounding: ${result.agentGrounding.results?.length || 0} issues
|
|
374
396
|
`;
|
|
375
397
|
}
|
|
376
398
|
if (result.testability) {
|
|
377
|
-
output += `\u{1F9EA} Testability Index: ${result.testability.
|
|
399
|
+
output += `\u{1F9EA} Testability Index: ${result.testability.results?.length || 0} issues
|
|
378
400
|
`;
|
|
379
401
|
}
|
|
380
402
|
if (result.changeAmplification) {
|