@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/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-N4SLON5K.mjs";
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 (finalOptions.tools.includes("hallucination") || finalOptions.tools.includes("hallucination-risk")) {
363
+ if (results.hallucination) {
364
+ const { calculateHallucinationScore } = await import("@aiready/hallucination-risk");
369
365
  try {
370
- const { hallucinationRiskAction: hallucinationRiskAction2 } = await import("./hallucination-risk-XU6E7IGN.mjs");
371
- const hrScore = await hallucinationRiskAction2(resolvedDir, { ...finalOptions, output: "json" });
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 (finalOptions.tools.includes("grounding") || finalOptions.tools.includes("agent-grounding")) {
371
+ if (results.grounding) {
372
+ const { calculateGroundingScore } = await import("@aiready/agent-grounding");
377
373
  try {
378
- const { agentGroundingAction: agentGroundingAction2 } = await import("./agent-grounding-DAOSU4MF.mjs");
379
- const agScore = await agentGroundingAction2(resolvedDir, { ...finalOptions, output: "json" });
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 (finalOptions.tools.includes("testability")) {
379
+ if (results.testability) {
380
+ const { calculateTestabilityScore } = await import("@aiready/testability");
385
381
  try {
386
- const { testabilityAction: testabilityAction2 } = await import("./testability-VDZJZ4MF.mjs");
387
- const tbScore = await testabilityAction2(resolvedDir, { ...finalOptions, output: "json" });
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
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  analyzeUnified,
3
3
  generateUnifiedSummary
4
- } from "./chunk-N4SLON5K.mjs";
5
- import "./chunk-Y6FXYEAI.mjs";
4
+ } from "./chunk-JQG7ZATX.mjs";
6
5
  export {
7
6
  analyzeUnified,
8
7
  generateUnifiedSummary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.9.36",
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/consistency": "0.8.27",
15
- "@aiready/context-analyzer": "0.9.31",
16
- "@aiready/core": "0.9.28",
17
- "@aiready/deps": "0.1.1",
18
- "@aiready/agent-grounding": "0.1.1",
19
- "@aiready/doc-drift": "0.1.1",
20
- "@aiready/pattern-detect": "0.11.27",
21
- "@aiready/testability": "0.1.1",
22
- "@aiready/visualizer": "0.1.33",
23
- "@aiready/hallucination-risk": "0.1.1"
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",
@@ -319,35 +319,35 @@ export async function scanAction(directory: string, options: ScanOptions) {
319
319
  }
320
320
 
321
321
  // Hallucination risk score
322
- if (finalOptions.tools.includes('hallucination') || finalOptions.tools.includes('hallucination-risk')) {
322
+ if (results.hallucination) {
323
+ const { calculateHallucinationScore } = await import('@aiready/hallucination-risk');
323
324
  try {
324
- const { hallucinationRiskAction } = await import('./hallucination-risk');
325
- const hrScore = await hallucinationRiskAction(resolvedDir, { ...finalOptions, output: 'json' });
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 if spoke not installed yet
328
+ // ignore
329
329
  }
330
330
  }
331
331
 
332
332
  // Agent grounding score
333
- if (finalOptions.tools.includes('grounding') || finalOptions.tools.includes('agent-grounding')) {
333
+ if (results.grounding) {
334
+ const { calculateGroundingScore } = await import('@aiready/agent-grounding');
334
335
  try {
335
- const { agentGroundingAction } = await import('./agent-grounding');
336
- const agScore = await agentGroundingAction(resolvedDir, { ...finalOptions, output: 'json' });
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 if spoke not installed yet
339
+ // ignore
340
340
  }
341
341
  }
342
342
 
343
343
  // Testability score
344
- if (finalOptions.tools.includes('testability')) {
344
+ if (results.testability) {
345
+ const { calculateTestabilityScore } = await import('@aiready/testability');
345
346
  try {
346
- const { testabilityAction } = await import('./testability');
347
- const tbScore = await testabilityAction(resolvedDir, { ...finalOptions, output: 'json' });
348
- if (tbScore) toolScores.set('testability', tbScore);
347
+ const tbScore = calculateTestabilityScore(results.testability);
348
+ toolScores.set('testability', tbScore);
349
349
  } catch (err) {
350
- // ignore if spoke not installed yet
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
  }