@aiready/cli 0.14.6 → 0.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -6
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260318-002110.json +28782 -0
- package/dist/chunk-2QOU5KKW.mjs +0 -301
- package/dist/chunk-55ZUD52M.mjs +0 -290
- package/dist/chunk-7K3CNS6C.mjs +0 -234
- package/dist/chunk-7MDDDPX6.mjs +0 -273
- package/dist/chunk-BD7XZYET.mjs +0 -302
- package/dist/chunk-CZBMZD6J.mjs +0 -282
- package/dist/chunk-DWSC3FOY.mjs +0 -241
- package/dist/chunk-EPASFL7Y.mjs +0 -281
- package/dist/chunk-HWO2J4GA.mjs +0 -250
- package/dist/chunk-L4MJHD72.mjs +0 -239
- package/dist/chunk-LTUQDJPO.mjs +0 -229
- package/dist/chunk-MVEYWWJM.mjs +0 -1894
- package/dist/chunk-N56YAZVN.mjs +0 -194
- package/dist/chunk-OOQTTRPG.mjs +0 -280
- package/dist/chunk-XUNVVWID.mjs +0 -272
- package/dist/chunk-YBZKPKW3.mjs +0 -161
- package/dist/chunk-YNGTO2UX.mjs +0 -277
- package/dist/commands-QT3SFOMU.mjs +0 -43
package/dist/chunk-LTUQDJPO.mjs
DELETED
|
@@ -1,229 +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 {
|
|
10
|
-
ToolRegistry,
|
|
11
|
-
ToolName,
|
|
12
|
-
calculateOverallScore,
|
|
13
|
-
calculateTokenBudget
|
|
14
|
-
} from "@aiready/core";
|
|
15
|
-
import "@aiready/pattern-detect";
|
|
16
|
-
import "@aiready/context-analyzer";
|
|
17
|
-
import "@aiready/consistency";
|
|
18
|
-
import "@aiready/ai-signal-clarity";
|
|
19
|
-
import "@aiready/agent-grounding";
|
|
20
|
-
import "@aiready/testability";
|
|
21
|
-
import "@aiready/doc-drift";
|
|
22
|
-
import "@aiready/deps";
|
|
23
|
-
import "@aiready/change-amplification";
|
|
24
|
-
var TOOL_PACKAGE_MAP = {
|
|
25
|
-
[ToolName.PatternDetect]: "@aiready/pattern-detect",
|
|
26
|
-
[ToolName.ContextAnalyzer]: "@aiready/context-analyzer",
|
|
27
|
-
[ToolName.NamingConsistency]: "@aiready/consistency",
|
|
28
|
-
[ToolName.AiSignalClarity]: "@aiready/ai-signal-clarity",
|
|
29
|
-
[ToolName.AgentGrounding]: "@aiready/agent-grounding",
|
|
30
|
-
[ToolName.TestabilityIndex]: "@aiready/testability",
|
|
31
|
-
[ToolName.DocDrift]: "@aiready/doc-drift",
|
|
32
|
-
[ToolName.DependencyHealth]: "@aiready/deps",
|
|
33
|
-
[ToolName.ChangeAmplification]: "@aiready/change-amplification",
|
|
34
|
-
// Aliases handled by registry
|
|
35
|
-
patterns: "@aiready/pattern-detect",
|
|
36
|
-
duplicates: "@aiready/pattern-detect",
|
|
37
|
-
context: "@aiready/context-analyzer",
|
|
38
|
-
fragmentation: "@aiready/context-analyzer",
|
|
39
|
-
consistency: "@aiready/consistency",
|
|
40
|
-
"naming-consistency": "@aiready/consistency",
|
|
41
|
-
"ai-signal": "@aiready/ai-signal-clarity",
|
|
42
|
-
"ai-signal-clarity": "@aiready/ai-signal-clarity",
|
|
43
|
-
grounding: "@aiready/agent-grounding",
|
|
44
|
-
"agent-grounding": "@aiready/agent-grounding",
|
|
45
|
-
testability: "@aiready/testability",
|
|
46
|
-
"testability-index": "@aiready/testability",
|
|
47
|
-
"doc-drift": "@aiready/doc-drift",
|
|
48
|
-
"deps-health": "@aiready/deps",
|
|
49
|
-
"dependency-health": "@aiready/deps",
|
|
50
|
-
"change-amp": "@aiready/change-amplification",
|
|
51
|
-
"change-amplification": "@aiready/change-amplification"
|
|
52
|
-
};
|
|
53
|
-
async function analyzeUnified(options) {
|
|
54
|
-
const startTime = Date.now();
|
|
55
|
-
const requestedTools = options.tools || [
|
|
56
|
-
"patterns",
|
|
57
|
-
"context",
|
|
58
|
-
"consistency"
|
|
59
|
-
];
|
|
60
|
-
const result = {
|
|
61
|
-
summary: {
|
|
62
|
-
totalIssues: 0,
|
|
63
|
-
toolsRun: [],
|
|
64
|
-
executionTime: 0
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
for (const toolName of requestedTools) {
|
|
68
|
-
let provider = ToolRegistry.find(toolName);
|
|
69
|
-
if (!provider) {
|
|
70
|
-
const packageName = TOOL_PACKAGE_MAP[toolName] || (toolName.startsWith("@aiready/") ? toolName : `@aiready/${toolName}`);
|
|
71
|
-
try {
|
|
72
|
-
await import(packageName);
|
|
73
|
-
provider = ToolRegistry.find(toolName);
|
|
74
|
-
if (provider) {
|
|
75
|
-
console.log(
|
|
76
|
-
`\u2705 Successfully loaded tool provider: ${toolName} from ${packageName}`
|
|
77
|
-
);
|
|
78
|
-
} else {
|
|
79
|
-
console.log(
|
|
80
|
-
`\u26A0\uFE0F Loaded ${packageName} but provider ${toolName} still not found in registry.`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
} catch (err) {
|
|
84
|
-
console.log(
|
|
85
|
-
`\u274C Failed to dynamically load tool ${toolName} (${packageName}):`,
|
|
86
|
-
err.message
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (!provider) {
|
|
91
|
-
console.warn(
|
|
92
|
-
`\u26A0\uFE0F Warning: Tool provider for '${toolName}' not found. Skipping.`
|
|
93
|
-
);
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
const output = await provider.analyze({
|
|
98
|
-
...options,
|
|
99
|
-
onProgress: (processed, total, message) => {
|
|
100
|
-
if (options.progressCallback) {
|
|
101
|
-
options.progressCallback({
|
|
102
|
-
tool: provider.id,
|
|
103
|
-
processed,
|
|
104
|
-
total,
|
|
105
|
-
message
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
if (options.progressCallback) {
|
|
111
|
-
options.progressCallback({ tool: provider.id, data: output });
|
|
112
|
-
}
|
|
113
|
-
result[provider.id] = output;
|
|
114
|
-
result.summary.toolsRun.push(provider.id);
|
|
115
|
-
const issueCount = output.results.reduce(
|
|
116
|
-
(sum, file) => sum + (file.issues?.length || 0),
|
|
117
|
-
0
|
|
118
|
-
);
|
|
119
|
-
result.summary.totalIssues += issueCount;
|
|
120
|
-
if (provider.alias && Array.isArray(provider.alias)) {
|
|
121
|
-
for (const alias of provider.alias) {
|
|
122
|
-
if (!result[alias]) {
|
|
123
|
-
result[alias] = output;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const camelCaseId = provider.id.replace(
|
|
128
|
-
/-([a-z])/g,
|
|
129
|
-
(g) => g[1].toUpperCase()
|
|
130
|
-
);
|
|
131
|
-
if (camelCaseId !== provider.id && !result[camelCaseId]) {
|
|
132
|
-
result[camelCaseId] = output;
|
|
133
|
-
}
|
|
134
|
-
} catch (err) {
|
|
135
|
-
console.error(`\u274C Error running tool '${provider.id}':`, err);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
result.summary.executionTime = Date.now() - startTime;
|
|
139
|
-
return result;
|
|
140
|
-
}
|
|
141
|
-
async function scoreUnified(results, options) {
|
|
142
|
-
const toolScores = /* @__PURE__ */ new Map();
|
|
143
|
-
for (const toolId of results.summary.toolsRun) {
|
|
144
|
-
const provider = ToolRegistry.get(toolId);
|
|
145
|
-
if (!provider) continue;
|
|
146
|
-
const output = results[toolId];
|
|
147
|
-
if (!output) continue;
|
|
148
|
-
try {
|
|
149
|
-
const toolScore = provider.score(output, options);
|
|
150
|
-
if (!toolScore.tokenBudget) {
|
|
151
|
-
if (toolId === ToolName.PatternDetect && output.duplicates) {
|
|
152
|
-
const wastedTokens = output.duplicates.reduce(
|
|
153
|
-
(sum, d) => sum + (d.tokenCost || 0),
|
|
154
|
-
0
|
|
155
|
-
);
|
|
156
|
-
toolScore.tokenBudget = calculateTokenBudget({
|
|
157
|
-
totalContextTokens: wastedTokens * 2,
|
|
158
|
-
wastedTokens: {
|
|
159
|
-
duplication: wastedTokens,
|
|
160
|
-
fragmentation: 0,
|
|
161
|
-
chattiness: 0
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
} else if (toolId === ToolName.ContextAnalyzer && output.summary) {
|
|
165
|
-
toolScore.tokenBudget = calculateTokenBudget({
|
|
166
|
-
totalContextTokens: output.summary.totalTokens,
|
|
167
|
-
wastedTokens: {
|
|
168
|
-
duplication: 0,
|
|
169
|
-
fragmentation: output.summary.totalPotentialSavings || 0,
|
|
170
|
-
chattiness: 0
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
toolScores.set(toolId, toolScore);
|
|
176
|
-
} catch (err) {
|
|
177
|
-
console.error(`\u274C Error scoring tool '${toolId}':`, err);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (toolScores.size === 0) {
|
|
181
|
-
return {
|
|
182
|
-
overall: 0,
|
|
183
|
-
rating: "Critical",
|
|
184
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
185
|
-
toolsUsed: [],
|
|
186
|
-
breakdown: [],
|
|
187
|
-
calculation: {
|
|
188
|
-
formula: "0 / 0 = 0",
|
|
189
|
-
weights: {},
|
|
190
|
-
normalized: "0 / 0 = 0"
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
return calculateOverallScore(toolScores, options, void 0);
|
|
195
|
-
}
|
|
196
|
-
function generateUnifiedSummary(result) {
|
|
197
|
-
const { summary } = result;
|
|
198
|
-
let output = `\u{1F680} AIReady Analysis Complete
|
|
199
|
-
|
|
200
|
-
`;
|
|
201
|
-
output += `\u{1F4CA} Summary:
|
|
202
|
-
`;
|
|
203
|
-
output += ` Tools run: ${summary.toolsRun.join(", ")}
|
|
204
|
-
`;
|
|
205
|
-
output += ` Total issues found: ${summary.totalIssues}
|
|
206
|
-
`;
|
|
207
|
-
output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
|
|
208
|
-
|
|
209
|
-
`;
|
|
210
|
-
for (const provider of ToolRegistry.getAll()) {
|
|
211
|
-
const toolResult = result[provider.id];
|
|
212
|
-
if (toolResult) {
|
|
213
|
-
const issueCount = toolResult.results.reduce(
|
|
214
|
-
(sum, r) => sum + (r.issues?.length || 0),
|
|
215
|
-
0
|
|
216
|
-
);
|
|
217
|
-
output += `\u2022 ${provider.id}: ${issueCount} issues
|
|
218
|
-
`;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return output;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export {
|
|
225
|
-
__require,
|
|
226
|
-
analyzeUnified,
|
|
227
|
-
scoreUnified,
|
|
228
|
-
generateUnifiedSummary
|
|
229
|
-
};
|