@aiready/cli 0.9.47 → 0.10.2

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