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