@aiready/cli 0.9.36 → 0.9.38
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 +9 -16
- package/.turbo/turbo-test.log +4 -4
- package/dist/chunk-JQG7ZATX.mjs +211 -0
- package/dist/cli.js +263 -365
- package/dist/cli.mjs +27 -20
- package/dist/index.js +51 -0
- package/dist/index.mjs +1 -2
- package/package.json +11 -11
- package/src/commands/scan.ts +15 -15
- package/src/index.ts +61 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
__require,
|
|
3
4
|
analyzeUnified
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-RBWLQRKR.mjs";
|
|
6
|
-
import "./chunk-YIS6WTY5.mjs";
|
|
7
|
-
import "./chunk-XAF2EW5H.mjs";
|
|
8
|
-
import {
|
|
9
|
-
__require
|
|
10
|
-
} from "./chunk-Y6FXYEAI.mjs";
|
|
5
|
+
} from "./chunk-JQG7ZATX.mjs";
|
|
11
6
|
|
|
12
7
|
// src/cli.ts
|
|
13
8
|
import { Command } from "commander";
|
|
@@ -59,7 +54,7 @@ function findLatestScanReport(dirPath) {
|
|
|
59
54
|
}
|
|
60
55
|
function warnIfGraphCapExceeded(report, dirPath) {
|
|
61
56
|
try {
|
|
62
|
-
const { loadConfig } = __require("@aiready/core");
|
|
57
|
+
const { loadConfig: loadConfig4 } = __require("@aiready/core");
|
|
63
58
|
let graphConfig = { maxNodes: 400, maxEdges: 600 };
|
|
64
59
|
const configPath = resolvePath(dirPath, "aiready.json");
|
|
65
60
|
if (existsSync(configPath)) {
|
|
@@ -365,27 +360,27 @@ async function scanAction(directory, options) {
|
|
|
365
360
|
} catch (err) {
|
|
366
361
|
}
|
|
367
362
|
}
|
|
368
|
-
if (
|
|
363
|
+
if (results.hallucination) {
|
|
364
|
+
const { calculateHallucinationScore } = await import("@aiready/hallucination-risk");
|
|
369
365
|
try {
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
if (hrScore) toolScores.set("hallucination-risk", hrScore);
|
|
366
|
+
const hrScore = calculateHallucinationScore(results.hallucination);
|
|
367
|
+
toolScores.set("hallucination-risk", hrScore);
|
|
373
368
|
} catch (err) {
|
|
374
369
|
}
|
|
375
370
|
}
|
|
376
|
-
if (
|
|
371
|
+
if (results.grounding) {
|
|
372
|
+
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
377
373
|
try {
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
if (agScore) toolScores.set("agent-grounding", agScore);
|
|
374
|
+
const agScore = calculateGroundingScore(results.grounding);
|
|
375
|
+
toolScores.set("agent-grounding", agScore);
|
|
381
376
|
} catch (err) {
|
|
382
377
|
}
|
|
383
378
|
}
|
|
384
|
-
if (
|
|
379
|
+
if (results.testability) {
|
|
380
|
+
const { calculateTestabilityScore } = await import("@aiready/testability");
|
|
385
381
|
try {
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
if (tbScore) toolScores.set("testability", tbScore);
|
|
382
|
+
const tbScore = calculateTestabilityScore(results.testability);
|
|
383
|
+
toolScores.set("testability", tbScore);
|
|
389
384
|
} catch (err) {
|
|
390
385
|
}
|
|
391
386
|
}
|
|
@@ -1225,6 +1220,18 @@ NOTES:
|
|
|
1225
1220
|
- Same options as 'visualize'. Use --serve to host the static HTML, or --dev for live reload.
|
|
1226
1221
|
`;
|
|
1227
1222
|
|
|
1223
|
+
// src/commands/hallucination-risk.ts
|
|
1224
|
+
import chalk7 from "chalk";
|
|
1225
|
+
import { loadConfig, mergeConfigWithDefaults } from "@aiready/core";
|
|
1226
|
+
|
|
1227
|
+
// src/commands/agent-grounding.ts
|
|
1228
|
+
import chalk8 from "chalk";
|
|
1229
|
+
import { loadConfig as loadConfig2, mergeConfigWithDefaults as mergeConfigWithDefaults2 } from "@aiready/core";
|
|
1230
|
+
|
|
1231
|
+
// src/commands/testability.ts
|
|
1232
|
+
import chalk9 from "chalk";
|
|
1233
|
+
import { loadConfig as loadConfig3, mergeConfigWithDefaults as mergeConfigWithDefaults3 } from "@aiready/core";
|
|
1234
|
+
|
|
1228
1235
|
// src/cli.ts
|
|
1229
1236
|
var getDirname = () => {
|
|
1230
1237
|
if (typeof __dirname !== "undefined") return __dirname;
|
package/dist/index.js
CHANGED
|
@@ -141,6 +141,45 @@ async function analyzeUnified(options) {
|
|
|
141
141
|
result.deps = report;
|
|
142
142
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
143
143
|
}
|
|
144
|
+
if (tools.includes("hallucination")) {
|
|
145
|
+
const { analyzeHallucinationRisk } = await import("@aiready/hallucination-risk");
|
|
146
|
+
const report = await analyzeHallucinationRisk({
|
|
147
|
+
rootDir: options.rootDir,
|
|
148
|
+
include: options.include,
|
|
149
|
+
exclude: options.exclude
|
|
150
|
+
});
|
|
151
|
+
if (options.progressCallback) {
|
|
152
|
+
options.progressCallback({ tool: "hallucination", data: report });
|
|
153
|
+
}
|
|
154
|
+
result.hallucination = report;
|
|
155
|
+
result.summary.totalIssues += report.results?.reduce((sum, r) => sum + (r.issues?.length || 0), 0) || 0;
|
|
156
|
+
}
|
|
157
|
+
if (tools.includes("grounding")) {
|
|
158
|
+
const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
|
|
159
|
+
const report = await analyzeAgentGrounding({
|
|
160
|
+
rootDir: options.rootDir,
|
|
161
|
+
include: options.include,
|
|
162
|
+
exclude: options.exclude
|
|
163
|
+
});
|
|
164
|
+
if (options.progressCallback) {
|
|
165
|
+
options.progressCallback({ tool: "grounding", data: report });
|
|
166
|
+
}
|
|
167
|
+
result.grounding = report;
|
|
168
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
169
|
+
}
|
|
170
|
+
if (tools.includes("testability")) {
|
|
171
|
+
const { analyzeTestability } = await import("@aiready/testability");
|
|
172
|
+
const report = await analyzeTestability({
|
|
173
|
+
rootDir: options.rootDir,
|
|
174
|
+
include: options.include,
|
|
175
|
+
exclude: options.exclude
|
|
176
|
+
});
|
|
177
|
+
if (options.progressCallback) {
|
|
178
|
+
options.progressCallback({ tool: "testability", data: report });
|
|
179
|
+
}
|
|
180
|
+
result.testability = report;
|
|
181
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
182
|
+
}
|
|
144
183
|
result.summary.executionTime = Date.now() - startTime;
|
|
145
184
|
return result;
|
|
146
185
|
}
|
|
@@ -176,6 +215,18 @@ function generateUnifiedSummary(result) {
|
|
|
176
215
|
}
|
|
177
216
|
if (result.deps) {
|
|
178
217
|
output += `\u{1F4E6} Dependency Health: ${result.deps.issues?.length || 0} issues
|
|
218
|
+
`;
|
|
219
|
+
}
|
|
220
|
+
if (result.hallucination) {
|
|
221
|
+
output += `\u{1F9E0} Hallucination Risk: ${result.hallucination.summary?.totalSignals || 0} signals
|
|
222
|
+
`;
|
|
223
|
+
}
|
|
224
|
+
if (result.grounding) {
|
|
225
|
+
output += `\u{1F9ED} Agent Grounding: ${result.grounding.issues?.length || 0} issues
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
if (result.testability) {
|
|
229
|
+
output += `\u{1F9EA} Testability Index: ${result.testability.issues?.length || 0} issues
|
|
179
230
|
`;
|
|
180
231
|
}
|
|
181
232
|
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.9.
|
|
3
|
+
"version": "0.9.38",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
13
|
"commander": "^14.0.0",
|
|
14
|
-
"@aiready/
|
|
15
|
-
"@aiready/context-analyzer": "0.9.
|
|
16
|
-
"@aiready/
|
|
17
|
-
"@aiready/
|
|
18
|
-
"@aiready/
|
|
19
|
-
"@aiready/
|
|
20
|
-
"@aiready/
|
|
21
|
-
"@aiready/
|
|
22
|
-
"@aiready/
|
|
23
|
-
"@aiready/
|
|
14
|
+
"@aiready/core": "0.9.30",
|
|
15
|
+
"@aiready/context-analyzer": "0.9.33",
|
|
16
|
+
"@aiready/deps": "0.1.3",
|
|
17
|
+
"@aiready/agent-grounding": "0.1.3",
|
|
18
|
+
"@aiready/consistency": "0.8.29",
|
|
19
|
+
"@aiready/visualizer": "0.1.35",
|
|
20
|
+
"@aiready/testability": "0.1.3",
|
|
21
|
+
"@aiready/pattern-detect": "0.11.29",
|
|
22
|
+
"@aiready/hallucination-risk": "0.1.3",
|
|
23
|
+
"@aiready/doc-drift": "0.1.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^24.0.0",
|
package/src/commands/scan.ts
CHANGED
|
@@ -319,35 +319,35 @@ export async function scanAction(directory: string, options: ScanOptions) {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
// Hallucination risk score
|
|
322
|
-
if (
|
|
322
|
+
if (results.hallucination) {
|
|
323
|
+
const { calculateHallucinationScore } = await import('@aiready/hallucination-risk');
|
|
323
324
|
try {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
if (hrScore) toolScores.set('hallucination-risk', hrScore);
|
|
325
|
+
const hrScore = calculateHallucinationScore(results.hallucination);
|
|
326
|
+
toolScores.set('hallucination-risk', hrScore);
|
|
327
327
|
} catch (err) {
|
|
328
|
-
// ignore
|
|
328
|
+
// ignore
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
// Agent grounding score
|
|
333
|
-
if (
|
|
333
|
+
if (results.grounding) {
|
|
334
|
+
const { calculateGroundingScore } = await import('@aiready/agent-grounding');
|
|
334
335
|
try {
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
if (agScore) toolScores.set('agent-grounding', agScore);
|
|
336
|
+
const agScore = calculateGroundingScore(results.grounding);
|
|
337
|
+
toolScores.set('agent-grounding', agScore);
|
|
338
338
|
} catch (err) {
|
|
339
|
-
// ignore
|
|
339
|
+
// ignore
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
// Testability score
|
|
344
|
-
if (
|
|
344
|
+
if (results.testability) {
|
|
345
|
+
const { calculateTestabilityScore } = await import('@aiready/testability');
|
|
345
346
|
try {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
if (tbScore) toolScores.set('testability', tbScore);
|
|
347
|
+
const tbScore = calculateTestabilityScore(results.testability);
|
|
348
|
+
toolScores.set('testability', tbScore);
|
|
349
349
|
} catch (err) {
|
|
350
|
-
// ignore
|
|
350
|
+
// ignore
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { ConsistencyReport } from '@aiready/consistency';
|
|
|
9
9
|
import type { ConsistencyOptions } from '@aiready/consistency';
|
|
10
10
|
|
|
11
11
|
export interface UnifiedAnalysisOptions extends ScanOptions {
|
|
12
|
-
tools?: ('patterns' | 'context' | 'consistency' | 'doc-drift' | 'deps-health')[];
|
|
12
|
+
tools?: ('patterns' | 'context' | 'consistency' | 'doc-drift' | 'deps-health' | 'hallucination' | 'grounding' | 'testability')[];
|
|
13
13
|
minSimilarity?: number;
|
|
14
14
|
minLines?: number;
|
|
15
15
|
maxCandidatesPerBlock?: number;
|
|
@@ -26,6 +26,9 @@ export interface UnifiedAnalysisResult {
|
|
|
26
26
|
consistency?: ConsistencyReport;
|
|
27
27
|
docDrift?: any;
|
|
28
28
|
deps?: any;
|
|
29
|
+
hallucination?: any;
|
|
30
|
+
grounding?: any;
|
|
31
|
+
testability?: any;
|
|
29
32
|
summary: {
|
|
30
33
|
totalIssues: number;
|
|
31
34
|
toolsRun: string[];
|
|
@@ -170,6 +173,51 @@ export async function analyzeUnified(
|
|
|
170
173
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
171
174
|
}
|
|
172
175
|
|
|
176
|
+
// Run Hallucination Risk analysis
|
|
177
|
+
if (tools.includes('hallucination')) {
|
|
178
|
+
const { analyzeHallucinationRisk } = await import('@aiready/hallucination-risk');
|
|
179
|
+
const report = await analyzeHallucinationRisk({
|
|
180
|
+
rootDir: options.rootDir,
|
|
181
|
+
include: options.include,
|
|
182
|
+
exclude: options.exclude,
|
|
183
|
+
});
|
|
184
|
+
if (options.progressCallback) {
|
|
185
|
+
options.progressCallback({ tool: 'hallucination', data: report });
|
|
186
|
+
}
|
|
187
|
+
result.hallucination = report;
|
|
188
|
+
result.summary.totalIssues += report.results?.reduce((sum: number, r: any) => sum + (r.issues?.length || 0), 0) || 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Run Agent Grounding analysis
|
|
192
|
+
if (tools.includes('grounding')) {
|
|
193
|
+
const { analyzeAgentGrounding } = await import('@aiready/agent-grounding');
|
|
194
|
+
const report = await analyzeAgentGrounding({
|
|
195
|
+
rootDir: options.rootDir,
|
|
196
|
+
include: options.include,
|
|
197
|
+
exclude: options.exclude,
|
|
198
|
+
});
|
|
199
|
+
if (options.progressCallback) {
|
|
200
|
+
options.progressCallback({ tool: 'grounding', data: report });
|
|
201
|
+
}
|
|
202
|
+
result.grounding = report;
|
|
203
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Run Testability analysis
|
|
207
|
+
if (tools.includes('testability')) {
|
|
208
|
+
const { analyzeTestability } = await import('@aiready/testability');
|
|
209
|
+
const report = await analyzeTestability({
|
|
210
|
+
rootDir: options.rootDir,
|
|
211
|
+
include: options.include,
|
|
212
|
+
exclude: options.exclude,
|
|
213
|
+
});
|
|
214
|
+
if (options.progressCallback) {
|
|
215
|
+
options.progressCallback({ tool: 'testability', data: report });
|
|
216
|
+
}
|
|
217
|
+
result.testability = report;
|
|
218
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
173
221
|
result.summary.executionTime = Date.now() - startTime;
|
|
174
222
|
return result;
|
|
175
223
|
}
|
|
@@ -202,5 +250,17 @@ export function generateUnifiedSummary(result: UnifiedAnalysisResult): string {
|
|
|
202
250
|
output += `📦 Dependency Health: ${result.deps.issues?.length || 0} issues\n`;
|
|
203
251
|
}
|
|
204
252
|
|
|
253
|
+
if (result.hallucination) {
|
|
254
|
+
output += `🧠 Hallucination Risk: ${result.hallucination.summary?.totalSignals || 0} signals\n`;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (result.grounding) {
|
|
258
|
+
output += `🧭 Agent Grounding: ${result.grounding.issues?.length || 0} issues\n`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (result.testability) {
|
|
262
|
+
output += `🧪 Testability Index: ${result.testability.issues?.length || 0} issues\n`;
|
|
263
|
+
}
|
|
264
|
+
|
|
205
265
|
return output;
|
|
206
266
|
}
|