@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.
Files changed (54) 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/cli.js +102 -75
  5. package/dist/cli.mjs +30 -25
  6. package/dist/index.js +83 -61
  7. package/dist/index.mjs +1 -1
  8. package/package.json +12 -12
  9. package/src/.aiready/aiready-report-20260304-234659.json +8288 -0
  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/__tests__/cli.test.ts +6 -6
  16. package/src/commands/scan.ts +27 -22
  17. package/src/commands/visualize.ts +3 -3
  18. package/src/index.ts +108 -92
  19. package/dist/__tests__/cli.test.d.ts +0 -2
  20. package/dist/__tests__/cli.test.d.ts.map +0 -1
  21. package/dist/__tests__/cli.test.js +0 -52
  22. package/dist/__tests__/cli.test.js.map +0 -1
  23. package/dist/agent-grounding-DAOSU4MF.mjs +0 -7
  24. package/dist/chunk-2LXCBVPN.mjs +0 -109
  25. package/dist/chunk-3SG2GLFJ.mjs +0 -118
  26. package/dist/chunk-5GZDRZ3T.mjs +0 -126
  27. package/dist/chunk-DEZVFBPS.mjs +0 -111
  28. package/dist/chunk-G6SDH7ZS.mjs +0 -126
  29. package/dist/chunk-HLBKROD3.mjs +0 -237
  30. package/dist/chunk-JQG7ZATX.mjs +0 -211
  31. package/dist/chunk-LLJMKNBI.mjs +0 -243
  32. package/dist/chunk-M7O2MEM5.mjs +0 -211
  33. package/dist/chunk-MEXEG3IJ.mjs +0 -389
  34. package/dist/chunk-N4SLON5K.mjs +0 -152
  35. package/dist/chunk-OVELUOM6.mjs +0 -112
  36. package/dist/chunk-P3XAXCTK.mjs +0 -110
  37. package/dist/chunk-PDOONNSK.mjs +0 -228
  38. package/dist/chunk-QXQP6BMO.mjs +0 -109
  39. package/dist/chunk-RBWLQRKR.mjs +0 -39
  40. package/dist/chunk-XAF2EW5H.mjs +0 -46
  41. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  42. package/dist/chunk-YIS6WTY5.mjs +0 -35
  43. package/dist/cli.d.mts +0 -1
  44. package/dist/cli.d.ts +0 -3
  45. package/dist/cli.d.ts.map +0 -1
  46. package/dist/cli.js.map +0 -1
  47. package/dist/deps-health-UWVYJ7FZ.mjs +0 -47
  48. package/dist/doc-drift-G7MGAZAE.mjs +0 -47
  49. package/dist/hallucination-risk-XU6E7IGN.mjs +0 -7
  50. package/dist/index.d.mts +0 -33
  51. package/dist/index.d.ts +0 -32
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/testability-VDZJZ4MF.mjs +0 -7
@@ -1,152 +0,0 @@
1
- // src/index.ts
2
- import { analyzePatterns } from "@aiready/pattern-detect";
3
- import { analyzeContext } from "@aiready/context-analyzer";
4
- import { analyzeConsistency } from "@aiready/consistency";
5
- var severityOrder = {
6
- critical: 4,
7
- major: 3,
8
- minor: 2,
9
- info: 1
10
- };
11
- function sortBySeverity(results) {
12
- return results.map((file) => {
13
- const sortedIssues = [...file.issues].sort((a, b) => {
14
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
15
- if (severityDiff !== 0) return severityDiff;
16
- return (a.location?.line || 0) - (b.location?.line || 0);
17
- });
18
- return { ...file, issues: sortedIssues };
19
- }).sort((a, b) => {
20
- const aMaxSeverity = Math.max(...a.issues.map((i) => severityOrder[i.severity] || 0), 0);
21
- const bMaxSeverity = Math.max(...b.issues.map((i) => severityOrder[i.severity] || 0), 0);
22
- if (aMaxSeverity !== bMaxSeverity) {
23
- return bMaxSeverity - aMaxSeverity;
24
- }
25
- if (a.issues.length !== b.issues.length) {
26
- return b.issues.length - a.issues.length;
27
- }
28
- return a.fileName.localeCompare(b.fileName);
29
- });
30
- }
31
- async function analyzeUnified(options) {
32
- const startTime = Date.now();
33
- const tools = options.tools || ["patterns", "context", "consistency"];
34
- const result = {
35
- summary: {
36
- totalIssues: 0,
37
- toolsRun: tools,
38
- executionTime: 0
39
- }
40
- };
41
- if (tools.includes("patterns")) {
42
- const patternResult = await analyzePatterns(options);
43
- if (options.progressCallback) {
44
- options.progressCallback({ tool: "patterns", data: patternResult });
45
- }
46
- result.patterns = sortBySeverity(patternResult.results);
47
- result.duplicates = patternResult.duplicates;
48
- result.summary.totalIssues += patternResult.results.reduce(
49
- (sum, file) => sum + file.issues.length,
50
- 0
51
- );
52
- }
53
- if (tools.includes("context")) {
54
- const contextResults = await analyzeContext(options);
55
- if (options.progressCallback) {
56
- options.progressCallback({ tool: "context", data: contextResults });
57
- }
58
- result.context = contextResults.sort((a, b) => {
59
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
60
- if (severityDiff !== 0) return severityDiff;
61
- if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
62
- return b.fragmentationScore - a.fragmentationScore;
63
- });
64
- result.summary.totalIssues += result.context?.length || 0;
65
- }
66
- if (tools.includes("consistency")) {
67
- const consistencyOptions = {
68
- rootDir: options.rootDir,
69
- include: options.include,
70
- exclude: options.exclude,
71
- ...options.consistency || {}
72
- };
73
- const report = await analyzeConsistency(consistencyOptions);
74
- if (options.progressCallback) {
75
- options.progressCallback({ tool: "consistency", data: report });
76
- }
77
- if (report.results) {
78
- report.results = sortBySeverity(report.results);
79
- }
80
- result.consistency = report;
81
- result.summary.totalIssues += report.summary.totalIssues;
82
- }
83
- if (tools.includes("doc-drift")) {
84
- const { analyzeDocDrift } = await import("@aiready/doc-drift");
85
- const report = await analyzeDocDrift({
86
- rootDir: options.rootDir,
87
- include: options.include,
88
- exclude: options.exclude
89
- });
90
- if (options.progressCallback) {
91
- options.progressCallback({ tool: "doc-drift", data: report });
92
- }
93
- result.docDrift = report;
94
- result.summary.totalIssues += report.issues?.length || 0;
95
- }
96
- if (tools.includes("deps-health")) {
97
- const { analyzeDeps } = await import("@aiready/deps");
98
- const report = await analyzeDeps({
99
- rootDir: options.rootDir,
100
- include: options.include,
101
- exclude: options.exclude
102
- });
103
- if (options.progressCallback) {
104
- options.progressCallback({ tool: "deps-health", data: report });
105
- }
106
- result.deps = report;
107
- result.summary.totalIssues += report.issues?.length || 0;
108
- }
109
- result.summary.executionTime = Date.now() - startTime;
110
- return result;
111
- }
112
- function generateUnifiedSummary(result) {
113
- const { summary } = result;
114
- let output = `\u{1F680} AIReady Analysis Complete
115
-
116
- `;
117
- output += `\u{1F4CA} Summary:
118
- `;
119
- output += ` Tools run: ${summary.toolsRun.join(", ")}
120
- `;
121
- output += ` Total issues found: ${summary.totalIssues}
122
- `;
123
- output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
124
-
125
- `;
126
- if (result.patterns) {
127
- output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
128
- `;
129
- }
130
- if (result.context) {
131
- output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
132
- `;
133
- }
134
- if (result.consistency) {
135
- output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.consistency.summary.totalIssues} issues
136
- `;
137
- }
138
- if (result.docDrift) {
139
- output += `\u{1F4DD} Doc Drift Analysis: ${result.docDrift.issues?.length || 0} issues
140
- `;
141
- }
142
- if (result.deps) {
143
- output += `\u{1F4E6} Dependency Health: ${result.deps.issues?.length || 0} issues
144
- `;
145
- }
146
- return output;
147
- }
148
-
149
- export {
150
- analyzeUnified,
151
- generateUnifiedSummary
152
- };
@@ -1,112 +0,0 @@
1
- // src/index.ts
2
- import { analyzePatterns } from "@aiready/pattern-detect";
3
- import { analyzeContext } from "@aiready/context-analyzer";
4
- import { analyzeConsistency } from "@aiready/consistency";
5
- var severityOrder = {
6
- critical: 4,
7
- major: 3,
8
- minor: 2,
9
- info: 1
10
- };
11
- function sortBySeverity(results) {
12
- return results.map((file) => {
13
- const sortedIssues = [...file.issues].sort((a, b) => {
14
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
15
- if (severityDiff !== 0) return severityDiff;
16
- return (a.location?.line || 0) - (b.location?.line || 0);
17
- });
18
- return { ...file, issues: sortedIssues };
19
- }).sort((a, b) => {
20
- const aMaxSeverity = Math.max(...a.issues.map((i) => severityOrder[i.severity] || 0), 0);
21
- const bMaxSeverity = Math.max(...b.issues.map((i) => severityOrder[i.severity] || 0), 0);
22
- if (aMaxSeverity !== bMaxSeverity) {
23
- return bMaxSeverity - aMaxSeverity;
24
- }
25
- if (a.issues.length !== b.issues.length) {
26
- return b.issues.length - a.issues.length;
27
- }
28
- return a.fileName.localeCompare(b.fileName);
29
- });
30
- }
31
- async function analyzeUnified(options) {
32
- const startTime = Date.now();
33
- const tools = options.tools || ["patterns", "context", "consistency"];
34
- console.log("[DEBUG] analyzeUnified invoked. tools=", tools, "options=", JSON.stringify(options));
35
- const result = {
36
- summary: {
37
- totalIssues: 0,
38
- toolsRun: tools,
39
- executionTime: 0
40
- }
41
- };
42
- if (tools.includes("patterns")) {
43
- const patternResult = await analyzePatterns(options);
44
- result.patterns = sortBySeverity(patternResult.results);
45
- result.duplicates = patternResult.duplicates;
46
- result.summary.totalIssues += patternResult.results.reduce(
47
- (sum, file) => sum + file.issues.length,
48
- 0
49
- );
50
- }
51
- if (tools.includes("context")) {
52
- const contextResults = await analyzeContext(options);
53
- result.context = contextResults.sort((a, b) => {
54
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
55
- if (severityDiff !== 0) return severityDiff;
56
- if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
57
- return b.fragmentationScore - a.fragmentationScore;
58
- });
59
- result.summary.totalIssues += result.context?.length || 0;
60
- }
61
- if (tools.includes("consistency")) {
62
- const consistencyOptions = {
63
- rootDir: options.rootDir,
64
- include: options.include,
65
- exclude: options.exclude,
66
- ...options.consistency || {}
67
- };
68
- console.log("[DEBUG] Running consistency analysis with options:", consistencyOptions);
69
- const report = await analyzeConsistency(consistencyOptions);
70
- console.log("[DEBUG] Consistency report:", JSON.stringify(report, null, 2));
71
- if (report.results) {
72
- report.results = sortBySeverity(report.results);
73
- }
74
- result.consistency = report;
75
- result.summary.totalIssues += report.summary.totalIssues;
76
- }
77
- result.summary.executionTime = Date.now() - startTime;
78
- return result;
79
- }
80
- function generateUnifiedSummary(result) {
81
- const { summary } = result;
82
- let output = `\u{1F680} AIReady Analysis Complete
83
-
84
- `;
85
- output += `\u{1F4CA} Summary:
86
- `;
87
- output += ` Tools run: ${summary.toolsRun.join(", ")}
88
- `;
89
- output += ` Total issues found: ${summary.totalIssues}
90
- `;
91
- output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
92
-
93
- `;
94
- if (result.patterns) {
95
- output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
96
- `;
97
- }
98
- if (result.context) {
99
- output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
100
- `;
101
- }
102
- if (result.consistency) {
103
- output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.consistency.summary.totalIssues} issues
104
- `;
105
- }
106
- return output;
107
- }
108
-
109
- export {
110
- analyzeUnified,
111
- generateUnifiedSummary
112
- };
@@ -1,110 +0,0 @@
1
- // src/index.ts
2
- import { analyzePatterns } from "@aiready/pattern-detect";
3
- import { analyzeContext } from "@aiready/context-analyzer";
4
- import { analyzeConsistency } from "@aiready/consistency";
5
- var severityOrder = {
6
- critical: 4,
7
- major: 3,
8
- minor: 2,
9
- info: 1
10
- };
11
- function sortBySeverity(results) {
12
- return results.map((file) => {
13
- const sortedIssues = [...file.issues].sort((a, b) => {
14
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
15
- if (severityDiff !== 0) return severityDiff;
16
- return (a.location?.line || 0) - (b.location?.line || 0);
17
- });
18
- return { ...file, issues: sortedIssues };
19
- }).sort((a, b) => {
20
- const aMaxSeverity = Math.max(...a.issues.map((i) => severityOrder[i.severity] || 0), 0);
21
- const bMaxSeverity = Math.max(...b.issues.map((i) => severityOrder[i.severity] || 0), 0);
22
- if (aMaxSeverity !== bMaxSeverity) {
23
- return bMaxSeverity - aMaxSeverity;
24
- }
25
- if (a.issues.length !== b.issues.length) {
26
- return b.issues.length - a.issues.length;
27
- }
28
- return a.fileName.localeCompare(b.fileName);
29
- });
30
- }
31
- async function analyzeUnified(options) {
32
- const startTime = Date.now();
33
- const tools = options.tools || ["patterns", "context", "consistency"];
34
- const result = {
35
- summary: {
36
- totalIssues: 0,
37
- toolsRun: tools,
38
- executionTime: 0
39
- }
40
- };
41
- if (tools.includes("patterns")) {
42
- const patternResult = await analyzePatterns(options);
43
- result.patterns = sortBySeverity(patternResult.results);
44
- result.duplicates = patternResult.duplicates;
45
- result.summary.totalIssues += patternResult.results.reduce(
46
- (sum, file) => sum + file.issues.length,
47
- 0
48
- );
49
- }
50
- if (tools.includes("context")) {
51
- const contextResults = await analyzeContext(options);
52
- result.context = contextResults.sort((a, b) => {
53
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
54
- if (severityDiff !== 0) return severityDiff;
55
- if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
56
- return b.fragmentationScore - a.fragmentationScore;
57
- });
58
- result.summary.totalIssues += result.context?.length || 0;
59
- }
60
- if (tools.includes("consistency")) {
61
- const report = await analyzeConsistency({
62
- rootDir: options.rootDir,
63
- include: options.include,
64
- exclude: options.exclude,
65
- checkNaming: true,
66
- checkPatterns: true,
67
- minSeverity: "info"
68
- });
69
- if (report.results) {
70
- report.results = sortBySeverity(report.results);
71
- }
72
- result.consistency = report;
73
- result.summary.totalIssues += report.summary.totalIssues;
74
- }
75
- result.summary.executionTime = Date.now() - startTime;
76
- return result;
77
- }
78
- function generateUnifiedSummary(result) {
79
- const { summary } = result;
80
- let output = `\u{1F680} AIReady Analysis Complete
81
-
82
- `;
83
- output += `\u{1F4CA} Summary:
84
- `;
85
- output += ` Tools run: ${summary.toolsRun.join(", ")}
86
- `;
87
- output += ` Total issues found: ${summary.totalIssues}
88
- `;
89
- output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
90
-
91
- `;
92
- if (result.patterns?.length) {
93
- output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
94
- `;
95
- }
96
- if (result.context?.length) {
97
- output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
98
- `;
99
- }
100
- if (result.consistency) {
101
- output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.consistency.summary.totalIssues} issues
102
- `;
103
- }
104
- return output;
105
- }
106
-
107
- export {
108
- analyzeUnified,
109
- generateUnifiedSummary
110
- };
@@ -1,228 +0,0 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
- // src/index.ts
9
- import { analyzePatterns } from "@aiready/pattern-detect";
10
- import { analyzeContext } from "@aiready/context-analyzer";
11
- import { analyzeConsistency } from "@aiready/consistency";
12
- var severityOrder = {
13
- critical: 4,
14
- major: 3,
15
- minor: 2,
16
- info: 1
17
- };
18
- function sortBySeverity(results) {
19
- return results.map((file) => {
20
- const sortedIssues = [...file.issues].sort((a, b) => {
21
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
22
- if (severityDiff !== 0) return severityDiff;
23
- return (a.location?.line || 0) - (b.location?.line || 0);
24
- });
25
- return { ...file, issues: sortedIssues };
26
- }).sort((a, b) => {
27
- const aMaxSeverity = Math.max(...a.issues.map((i) => severityOrder[i.severity] || 0), 0);
28
- const bMaxSeverity = Math.max(...b.issues.map((i) => severityOrder[i.severity] || 0), 0);
29
- if (aMaxSeverity !== bMaxSeverity) {
30
- return bMaxSeverity - aMaxSeverity;
31
- }
32
- if (a.issues.length !== b.issues.length) {
33
- return b.issues.length - a.issues.length;
34
- }
35
- return a.fileName.localeCompare(b.fileName);
36
- });
37
- }
38
- async function analyzeUnified(options) {
39
- const startTime = Date.now();
40
- const tools = options.tools || ["patterns", "context", "consistency"];
41
- const result = {
42
- summary: {
43
- totalIssues: 0,
44
- toolsRun: tools,
45
- executionTime: 0
46
- }
47
- };
48
- if (tools.includes("patterns")) {
49
- const patternResult = await analyzePatterns(options);
50
- if (options.progressCallback) {
51
- options.progressCallback({ tool: "patterns", data: patternResult });
52
- }
53
- result.patterns = sortBySeverity(patternResult.results);
54
- result.duplicates = patternResult.duplicates;
55
- result.summary.totalIssues += patternResult.results.reduce(
56
- (sum, file) => sum + file.issues.length,
57
- 0
58
- );
59
- }
60
- if (tools.includes("context")) {
61
- const contextResults = await analyzeContext(options);
62
- if (options.progressCallback) {
63
- options.progressCallback({ tool: "context", data: contextResults });
64
- }
65
- result.context = contextResults.sort((a, b) => {
66
- const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
67
- if (severityDiff !== 0) return severityDiff;
68
- if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
69
- return b.fragmentationScore - a.fragmentationScore;
70
- });
71
- result.summary.totalIssues += result.context?.length || 0;
72
- }
73
- if (tools.includes("consistency")) {
74
- const consistencyOptions = {
75
- rootDir: options.rootDir,
76
- include: options.include,
77
- exclude: options.exclude,
78
- ...options.consistency || {}
79
- };
80
- const report = await analyzeConsistency(consistencyOptions);
81
- if (options.progressCallback) {
82
- options.progressCallback({ tool: "consistency", data: report });
83
- }
84
- if (report.results) {
85
- report.results = sortBySeverity(report.results);
86
- }
87
- result.consistency = report;
88
- result.summary.totalIssues += report.summary.totalIssues;
89
- }
90
- if (tools.includes("doc-drift")) {
91
- const { analyzeDocDrift } = await import("@aiready/doc-drift");
92
- const report = await analyzeDocDrift({
93
- rootDir: options.rootDir,
94
- include: options.include,
95
- exclude: options.exclude
96
- });
97
- if (options.progressCallback) {
98
- options.progressCallback({ tool: "doc-drift", data: report });
99
- }
100
- result.docDrift = report;
101
- result.summary.totalIssues += report.issues?.length || 0;
102
- }
103
- if (tools.includes("deps-health")) {
104
- const { analyzeDeps } = await import("@aiready/deps");
105
- const report = await analyzeDeps({
106
- rootDir: options.rootDir,
107
- include: options.include,
108
- exclude: options.exclude
109
- });
110
- if (options.progressCallback) {
111
- options.progressCallback({ tool: "deps-health", data: report });
112
- }
113
- result.deps = report;
114
- result.summary.totalIssues += report.issues?.length || 0;
115
- }
116
- if (tools.includes("aiSignalClarity")) {
117
- const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
118
- const report = await analyzeAiSignalClarity({
119
- rootDir: options.rootDir,
120
- include: options.include,
121
- exclude: options.exclude
122
- });
123
- if (options.progressCallback) {
124
- options.progressCallback({ tool: "aiSignalClarity", data: report });
125
- }
126
- result.aiSignalClarity = report;
127
- result.summary.totalIssues += report.results?.reduce((sum, r) => sum + (r.issues?.length || 0), 0) || 0;
128
- }
129
- if (tools.includes("grounding")) {
130
- const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
131
- const report = await analyzeAgentGrounding({
132
- rootDir: options.rootDir,
133
- include: options.include,
134
- exclude: options.exclude
135
- });
136
- if (options.progressCallback) {
137
- options.progressCallback({ tool: "grounding", data: report });
138
- }
139
- result.grounding = report;
140
- result.summary.totalIssues += report.issues?.length || 0;
141
- }
142
- if (tools.includes("testability")) {
143
- const { analyzeTestability } = await import("@aiready/testability");
144
- const report = await analyzeTestability({
145
- rootDir: options.rootDir,
146
- include: options.include,
147
- exclude: options.exclude
148
- });
149
- if (options.progressCallback) {
150
- options.progressCallback({ tool: "testability", data: report });
151
- }
152
- result.testability = report;
153
- result.summary.totalIssues += report.issues?.length || 0;
154
- }
155
- if (tools.includes("changeAmplification")) {
156
- const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
157
- const report = await analyzeChangeAmplification({
158
- rootDir: options.rootDir,
159
- include: options.include,
160
- exclude: options.exclude
161
- });
162
- if (options.progressCallback) {
163
- options.progressCallback({ tool: "changeAmplification", data: report });
164
- }
165
- result.changeAmplification = report;
166
- result.summary.totalIssues += report.summary?.totalIssues || 0;
167
- }
168
- result.summary.executionTime = Date.now() - startTime;
169
- return result;
170
- }
171
- function generateUnifiedSummary(result) {
172
- const { summary } = result;
173
- let output = `\u{1F680} AIReady Analysis Complete
174
-
175
- `;
176
- output += `\u{1F4CA} Summary:
177
- `;
178
- output += ` Tools run: ${summary.toolsRun.join(", ")}
179
- `;
180
- output += ` Total issues found: ${summary.totalIssues}
181
- `;
182
- output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
183
-
184
- `;
185
- if (result.patterns) {
186
- output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
187
- `;
188
- }
189
- if (result.context) {
190
- output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
191
- `;
192
- }
193
- if (result.consistency) {
194
- output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.consistency.summary.totalIssues} issues
195
- `;
196
- }
197
- if (result.docDrift) {
198
- output += `\u{1F4DD} Doc Drift Analysis: ${result.docDrift.issues?.length || 0} issues
199
- `;
200
- }
201
- if (result.deps) {
202
- output += `\u{1F4E6} Dependency Health: ${result.deps.issues?.length || 0} issues
203
- `;
204
- }
205
- if (result.aiSignalClarity) {
206
- output += `\u{1F9E0} AI Signal Clarity: ${result.aiSignalClarity.summary?.totalSignals || 0} signals
207
- `;
208
- }
209
- if (result.grounding) {
210
- output += `\u{1F9ED} Agent Grounding: ${result.grounding.issues?.length || 0} issues
211
- `;
212
- }
213
- if (result.testability) {
214
- output += `\u{1F9EA} Testability Index: ${result.testability.issues?.length || 0} issues
215
- `;
216
- }
217
- if (result.changeAmplification) {
218
- output += `\u{1F4A5} Change Amplification: ${result.changeAmplification.summary?.totalIssues || 0} cascading risks
219
- `;
220
- }
221
- return output;
222
- }
223
-
224
- export {
225
- __require,
226
- analyzeUnified,
227
- generateUnifiedSummary
228
- };