@aiready/cli 0.12.8 → 0.12.10

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.
@@ -0,0 +1,272 @@
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
+ "ai-signal": "@aiready/ai-signal-clarity",
41
+ grounding: "@aiready/agent-grounding",
42
+ testability: "@aiready/testability",
43
+ "deps-health": "@aiready/deps",
44
+ "change-amp": "@aiready/change-amplification"
45
+ };
46
+ var GLOBAL_SCAN_OPTIONS = [
47
+ "rootDir",
48
+ "tools",
49
+ "toolConfigs",
50
+ "include",
51
+ "exclude",
52
+ "onProgress",
53
+ "progressCallback",
54
+ "includeTests",
55
+ "useSmartDefaults",
56
+ "maxDepth",
57
+ "streamResults",
58
+ "batchSize"
59
+ ];
60
+ function sanitizeToolConfig(config) {
61
+ if (!config || typeof config !== "object") return config;
62
+ const sanitized = { ...config };
63
+ GLOBAL_SCAN_OPTIONS.forEach((key) => {
64
+ delete sanitized[key];
65
+ });
66
+ return sanitized;
67
+ }
68
+ async function analyzeUnified(options) {
69
+ const startTime = Date.now();
70
+ const requestedTools = options.tools || [
71
+ "patterns",
72
+ "context",
73
+ "consistency"
74
+ ];
75
+ const result = {
76
+ summary: {
77
+ totalIssues: 0,
78
+ criticalIssues: 0,
79
+ // Added as per instruction
80
+ majorIssues: 0,
81
+ // Added as per instruction
82
+ totalFiles: 0,
83
+ toolsRun: [],
84
+ executionTime: 0,
85
+ config: options,
86
+ toolConfigs: {}
87
+ }
88
+ };
89
+ for (const toolName of requestedTools) {
90
+ let provider = ToolRegistry.find(toolName);
91
+ if (!provider) {
92
+ const packageName = TOOL_PACKAGE_MAP[toolName] || (toolName.startsWith("@aiready/") ? toolName : `@aiready/${toolName}`);
93
+ try {
94
+ await import(packageName);
95
+ provider = ToolRegistry.find(toolName);
96
+ if (provider) {
97
+ console.log(
98
+ `\u2705 Successfully loaded tool provider: ${toolName} from ${packageName}`
99
+ );
100
+ } else {
101
+ console.log(
102
+ `\u26A0\uFE0F Loaded ${packageName} but provider ${toolName} still not found in registry.`
103
+ );
104
+ }
105
+ } catch (err) {
106
+ console.log(
107
+ `\u274C Failed to dynamically load tool ${toolName} (${packageName}):`,
108
+ err.message
109
+ );
110
+ }
111
+ }
112
+ if (!provider) {
113
+ console.warn(
114
+ `\u26A0\uFE0F Warning: Tool provider for '${toolName}' not found. Skipping.`
115
+ );
116
+ continue;
117
+ }
118
+ try {
119
+ const sanitizedConfig = { ...options };
120
+ delete sanitizedConfig.onProgress;
121
+ delete sanitizedConfig.progressCallback;
122
+ const toolOptions = {
123
+ ...options,
124
+ ...options.toolConfigs?.[provider.id] || {},
125
+ onProgress: (processed, total, message) => {
126
+ if (options.progressCallback) {
127
+ options.progressCallback({
128
+ tool: provider.id,
129
+ processed,
130
+ total,
131
+ message
132
+ });
133
+ }
134
+ }
135
+ };
136
+ const output = await provider.analyze(toolOptions);
137
+ if (output.metadata) {
138
+ output.metadata.config = sanitizedConfig;
139
+ }
140
+ if (options.progressCallback) {
141
+ options.progressCallback({ tool: provider.id, data: output });
142
+ }
143
+ result[provider.id] = output;
144
+ result.summary.toolsRun.push(provider.id);
145
+ if (output.summary?.config) {
146
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(output.summary.config);
147
+ } else if (output.metadata?.config) {
148
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(output.metadata.config);
149
+ }
150
+ const toolFiles = output.summary?.totalFiles || output.summary?.filesAnalyzed || 0;
151
+ if (toolFiles > result.summary.totalFiles) {
152
+ result.summary.totalFiles = toolFiles;
153
+ }
154
+ const issueCount = output.results.reduce(
155
+ (sum, file) => sum + (file.issues?.length || 0),
156
+ 0
157
+ );
158
+ result.summary.totalIssues += issueCount;
159
+ if (provider.alias && Array.isArray(provider.alias)) {
160
+ for (const alias of provider.alias) {
161
+ if (!result[alias]) {
162
+ result[alias] = output;
163
+ }
164
+ }
165
+ }
166
+ const camelCaseId = provider.id.replace(
167
+ /-([a-z])/g,
168
+ (g) => g[1].toUpperCase()
169
+ );
170
+ if (camelCaseId !== provider.id && !result[camelCaseId]) {
171
+ result[camelCaseId] = output;
172
+ }
173
+ } catch (err) {
174
+ console.error(`\u274C Error running tool '${provider.id}':`, err);
175
+ }
176
+ }
177
+ result.summary.config = {
178
+ ...options,
179
+ toolConfigs: result.summary.toolConfigs
180
+ };
181
+ result.summary.executionTime = Date.now() - startTime;
182
+ return result;
183
+ }
184
+ async function scoreUnified(results, options) {
185
+ const toolScores = /* @__PURE__ */ new Map();
186
+ for (const toolId of results.summary.toolsRun) {
187
+ const provider = ToolRegistry.get(toolId);
188
+ if (!provider) continue;
189
+ const output = results[toolId];
190
+ if (!output) continue;
191
+ try {
192
+ const toolScore = provider.score(output, options);
193
+ if (!toolScore.tokenBudget) {
194
+ if (toolId === ToolName.PatternDetect && output.duplicates) {
195
+ const wastedTokens = output.duplicates.reduce(
196
+ (sum, d) => sum + (d.tokenCost || 0),
197
+ 0
198
+ );
199
+ toolScore.tokenBudget = calculateTokenBudget({
200
+ totalContextTokens: wastedTokens * 2,
201
+ wastedTokens: {
202
+ duplication: wastedTokens,
203
+ fragmentation: 0,
204
+ chattiness: 0
205
+ }
206
+ });
207
+ } else if (toolId === ToolName.ContextAnalyzer && output.summary) {
208
+ toolScore.tokenBudget = calculateTokenBudget({
209
+ totalContextTokens: output.summary.totalTokens,
210
+ wastedTokens: {
211
+ duplication: 0,
212
+ fragmentation: output.summary.totalPotentialSavings || 0,
213
+ chattiness: 0
214
+ }
215
+ });
216
+ }
217
+ }
218
+ toolScores.set(toolId, toolScore);
219
+ } catch (err) {
220
+ console.error(`\u274C Error scoring tool '${toolId}':`, err);
221
+ }
222
+ }
223
+ if (toolScores.size === 0) {
224
+ return {
225
+ overall: 0,
226
+ rating: "Critical",
227
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
228
+ toolsUsed: [],
229
+ breakdown: [],
230
+ calculation: {
231
+ formula: "0 / 0 = 0",
232
+ weights: {},
233
+ normalized: "0 / 0 = 0"
234
+ }
235
+ };
236
+ }
237
+ return calculateOverallScore(toolScores, options, void 0);
238
+ }
239
+ function generateUnifiedSummary(result) {
240
+ const { summary } = result;
241
+ let output = `\u{1F680} AIReady Analysis Complete
242
+
243
+ `;
244
+ output += `\u{1F4CA} Summary:
245
+ `;
246
+ output += ` Tools run: ${summary.toolsRun.join(", ")}
247
+ `;
248
+ output += ` Total issues found: ${summary.totalIssues}
249
+ `;
250
+ output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
251
+
252
+ `;
253
+ for (const provider of ToolRegistry.getAll()) {
254
+ const toolResult = result[provider.id];
255
+ if (toolResult) {
256
+ const issueCount = toolResult.results.reduce(
257
+ (sum, r) => sum + (r.issues?.length || 0),
258
+ 0
259
+ );
260
+ output += `\u2022 ${provider.id}: ${issueCount} issues
261
+ `;
262
+ }
263
+ }
264
+ return output;
265
+ }
266
+
267
+ export {
268
+ __require,
269
+ analyzeUnified,
270
+ scoreUnified,
271
+ generateUnifiedSummary
272
+ };
@@ -0,0 +1,277 @@
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
+ GLOBAL_SCAN_OPTIONS
15
+ } from "@aiready/core";
16
+ import "@aiready/pattern-detect";
17
+ import "@aiready/context-analyzer";
18
+ import "@aiready/consistency";
19
+ import "@aiready/ai-signal-clarity";
20
+ import "@aiready/agent-grounding";
21
+ import "@aiready/testability";
22
+ import "@aiready/doc-drift";
23
+ import "@aiready/deps";
24
+ import "@aiready/change-amplification";
25
+ var TOOL_PACKAGE_MAP = {
26
+ [ToolName.PatternDetect]: "@aiready/pattern-detect",
27
+ [ToolName.ContextAnalyzer]: "@aiready/context-analyzer",
28
+ [ToolName.NamingConsistency]: "@aiready/consistency",
29
+ [ToolName.AiSignalClarity]: "@aiready/ai-signal-clarity",
30
+ [ToolName.AgentGrounding]: "@aiready/agent-grounding",
31
+ [ToolName.TestabilityIndex]: "@aiready/testability",
32
+ [ToolName.DocDrift]: "@aiready/doc-drift",
33
+ [ToolName.DependencyHealth]: "@aiready/deps",
34
+ [ToolName.ChangeAmplification]: "@aiready/change-amplification",
35
+ // Aliases handled by registry
36
+ patterns: "@aiready/pattern-detect",
37
+ duplicates: "@aiready/pattern-detect",
38
+ context: "@aiready/context-analyzer",
39
+ fragmentation: "@aiready/context-analyzer",
40
+ consistency: "@aiready/consistency",
41
+ "ai-signal": "@aiready/ai-signal-clarity",
42
+ grounding: "@aiready/agent-grounding",
43
+ testability: "@aiready/testability",
44
+ "deps-health": "@aiready/deps",
45
+ "change-amp": "@aiready/change-amplification"
46
+ };
47
+ function sanitizeToolConfig(config) {
48
+ if (!config || typeof config !== "object") return config;
49
+ const sanitized = { ...config };
50
+ GLOBAL_SCAN_OPTIONS.forEach((key) => {
51
+ if (key !== "rootDir") {
52
+ delete sanitized[key];
53
+ }
54
+ });
55
+ return sanitized;
56
+ }
57
+ async function analyzeUnified(options) {
58
+ const startTime = Date.now();
59
+ const requestedTools = options.tools || [
60
+ "patterns",
61
+ "context",
62
+ "consistency"
63
+ ];
64
+ const result = {
65
+ summary: {
66
+ totalIssues: 0,
67
+ criticalIssues: 0,
68
+ // Added as per instruction
69
+ majorIssues: 0,
70
+ // Added as per instruction
71
+ totalFiles: 0,
72
+ toolsRun: [],
73
+ executionTime: 0,
74
+ config: options,
75
+ toolConfigs: {}
76
+ }
77
+ };
78
+ for (const toolName of requestedTools) {
79
+ let provider = ToolRegistry.find(toolName);
80
+ if (!provider) {
81
+ const packageName = TOOL_PACKAGE_MAP[toolName] || (toolName.startsWith("@aiready/") ? toolName : `@aiready/${toolName}`);
82
+ try {
83
+ await import(packageName);
84
+ provider = ToolRegistry.find(toolName);
85
+ if (provider) {
86
+ console.log(
87
+ `\u2705 Successfully loaded tool provider: ${toolName} from ${packageName}`
88
+ );
89
+ } else {
90
+ console.log(
91
+ `\u26A0\uFE0F Loaded ${packageName} but provider ${toolName} still not found in registry.`
92
+ );
93
+ }
94
+ } catch (err) {
95
+ console.log(
96
+ `\u274C Failed to dynamically load tool ${toolName} (${packageName}):`,
97
+ err.message
98
+ );
99
+ }
100
+ }
101
+ if (!provider) {
102
+ console.warn(
103
+ `\u26A0\uFE0F Warning: Tool provider for '${toolName}' not found. Skipping.`
104
+ );
105
+ continue;
106
+ }
107
+ try {
108
+ const sanitizedConfig = { ...options };
109
+ delete sanitizedConfig.onProgress;
110
+ delete sanitizedConfig.progressCallback;
111
+ const toolOptions = {
112
+ rootDir: options.rootDir
113
+ // Always include rootDir
114
+ };
115
+ GLOBAL_SCAN_OPTIONS.forEach((key) => {
116
+ if (key in options && key !== "toolConfigs") {
117
+ toolOptions[key] = options[key];
118
+ }
119
+ });
120
+ if (options.toolConfigs?.[provider.id]) {
121
+ Object.assign(toolOptions, options.toolConfigs[provider.id]);
122
+ } else if (options[provider.id]) {
123
+ Object.assign(toolOptions, options[provider.id]);
124
+ }
125
+ toolOptions.onProgress = (processed, total, message) => {
126
+ if (options.progressCallback) {
127
+ options.progressCallback({
128
+ tool: provider.id,
129
+ processed,
130
+ total,
131
+ message
132
+ });
133
+ }
134
+ };
135
+ const output = await provider.analyze(toolOptions);
136
+ if (output.metadata) {
137
+ output.metadata.config = sanitizeToolConfig(toolOptions);
138
+ }
139
+ if (options.progressCallback) {
140
+ options.progressCallback({ tool: provider.id, data: output });
141
+ }
142
+ result[provider.id] = output;
143
+ result.summary.toolsRun.push(provider.id);
144
+ if (output.summary?.config) {
145
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(
146
+ output.summary.config
147
+ );
148
+ } else if (output.metadata?.config) {
149
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(
150
+ output.metadata.config
151
+ );
152
+ } else {
153
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(toolOptions);
154
+ }
155
+ const toolFiles = output.summary?.totalFiles || output.summary?.filesAnalyzed || 0;
156
+ if (toolFiles > result.summary.totalFiles) {
157
+ result.summary.totalFiles = toolFiles;
158
+ }
159
+ const issueCount = output.results.reduce(
160
+ (sum, file) => sum + (file.issues?.length || 0),
161
+ 0
162
+ );
163
+ result.summary.totalIssues += issueCount;
164
+ if (provider.alias && Array.isArray(provider.alias)) {
165
+ for (const alias of provider.alias) {
166
+ if (!result[alias]) {
167
+ result[alias] = output;
168
+ }
169
+ }
170
+ }
171
+ const camelCaseId = provider.id.replace(
172
+ /-([a-z])/g,
173
+ (g) => g[1].toUpperCase()
174
+ );
175
+ if (camelCaseId !== provider.id && !result[camelCaseId]) {
176
+ result[camelCaseId] = output;
177
+ }
178
+ } catch (err) {
179
+ console.error(`\u274C Error running tool '${provider.id}':`, err);
180
+ }
181
+ }
182
+ result.summary.config = {
183
+ ...options,
184
+ toolConfigs: result.summary.toolConfigs
185
+ };
186
+ result.summary.executionTime = Date.now() - startTime;
187
+ return result;
188
+ }
189
+ async function scoreUnified(results, options) {
190
+ const toolScores = /* @__PURE__ */ new Map();
191
+ for (const toolId of results.summary.toolsRun) {
192
+ const provider = ToolRegistry.get(toolId);
193
+ if (!provider) continue;
194
+ const output = results[toolId];
195
+ if (!output) continue;
196
+ try {
197
+ const toolScore = provider.score(output, options);
198
+ if (!toolScore.tokenBudget) {
199
+ if (toolId === ToolName.PatternDetect && output.duplicates) {
200
+ const wastedTokens = output.duplicates.reduce(
201
+ (sum, d) => sum + (d.tokenCost || 0),
202
+ 0
203
+ );
204
+ toolScore.tokenBudget = calculateTokenBudget({
205
+ totalContextTokens: wastedTokens * 2,
206
+ wastedTokens: {
207
+ duplication: wastedTokens,
208
+ fragmentation: 0,
209
+ chattiness: 0
210
+ }
211
+ });
212
+ } else if (toolId === ToolName.ContextAnalyzer && output.summary) {
213
+ toolScore.tokenBudget = calculateTokenBudget({
214
+ totalContextTokens: output.summary.totalTokens,
215
+ wastedTokens: {
216
+ duplication: 0,
217
+ fragmentation: output.summary.totalPotentialSavings || 0,
218
+ chattiness: 0
219
+ }
220
+ });
221
+ }
222
+ }
223
+ toolScores.set(toolId, toolScore);
224
+ } catch (err) {
225
+ console.error(`\u274C Error scoring tool '${toolId}':`, err);
226
+ }
227
+ }
228
+ if (toolScores.size === 0) {
229
+ return {
230
+ overall: 0,
231
+ rating: "Critical",
232
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
233
+ toolsUsed: [],
234
+ breakdown: [],
235
+ calculation: {
236
+ formula: "0 / 0 = 0",
237
+ weights: {},
238
+ normalized: "0 / 0 = 0"
239
+ }
240
+ };
241
+ }
242
+ return calculateOverallScore(toolScores, options, void 0);
243
+ }
244
+ function generateUnifiedSummary(result) {
245
+ const { summary } = result;
246
+ let output = `\u{1F680} AIReady Analysis Complete
247
+
248
+ `;
249
+ output += `\u{1F4CA} Summary:
250
+ `;
251
+ output += ` Tools run: ${summary.toolsRun.join(", ")}
252
+ `;
253
+ output += ` Total issues found: ${summary.totalIssues}
254
+ `;
255
+ output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
256
+
257
+ `;
258
+ for (const provider of ToolRegistry.getAll()) {
259
+ const toolResult = result[provider.id];
260
+ if (toolResult) {
261
+ const issueCount = toolResult.results.reduce(
262
+ (sum, r) => sum + (r.issues?.length || 0),
263
+ 0
264
+ );
265
+ output += `\u2022 ${provider.id}: ${issueCount} issues
266
+ `;
267
+ }
268
+ }
269
+ return output;
270
+ }
271
+
272
+ export {
273
+ __require,
274
+ analyzeUnified,
275
+ scoreUnified,
276
+ generateUnifiedSummary
277
+ };
package/dist/cli.js CHANGED
@@ -62,19 +62,22 @@ var TOOL_PACKAGE_MAP = {
62
62
  context: "@aiready/context-analyzer",
63
63
  fragmentation: "@aiready/context-analyzer",
64
64
  consistency: "@aiready/consistency",
65
- "naming-consistency": "@aiready/consistency",
66
65
  "ai-signal": "@aiready/ai-signal-clarity",
67
- "ai-signal-clarity": "@aiready/ai-signal-clarity",
68
66
  grounding: "@aiready/agent-grounding",
69
- "agent-grounding": "@aiready/agent-grounding",
70
67
  testability: "@aiready/testability",
71
- "testability-index": "@aiready/testability",
72
- "doc-drift": "@aiready/doc-drift",
73
68
  "deps-health": "@aiready/deps",
74
- "dependency-health": "@aiready/deps",
75
- "change-amp": "@aiready/change-amplification",
76
- "change-amplification": "@aiready/change-amplification"
69
+ "change-amp": "@aiready/change-amplification"
77
70
  };
71
+ function sanitizeToolConfig(config) {
72
+ if (!config || typeof config !== "object") return config;
73
+ const sanitized = { ...config };
74
+ import_core.GLOBAL_SCAN_OPTIONS.forEach((key) => {
75
+ if (key !== "rootDir") {
76
+ delete sanitized[key];
77
+ }
78
+ });
79
+ return sanitized;
80
+ }
78
81
  async function analyzeUnified(options) {
79
82
  const startTime = Date.now();
80
83
  const requestedTools = options.tools || [
@@ -85,9 +88,15 @@ async function analyzeUnified(options) {
85
88
  const result = {
86
89
  summary: {
87
90
  totalIssues: 0,
91
+ criticalIssues: 0,
92
+ // Added as per instruction
93
+ majorIssues: 0,
94
+ // Added as per instruction
88
95
  totalFiles: 0,
89
96
  toolsRun: [],
90
- executionTime: 0
97
+ executionTime: 0,
98
+ config: options,
99
+ toolConfigs: {}
91
100
  }
92
101
  };
93
102
  for (const toolName of requestedTools) {
@@ -120,24 +129,53 @@ async function analyzeUnified(options) {
120
129
  continue;
121
130
  }
122
131
  try {
123
- const output = await provider.analyze({
124
- ...options,
125
- onProgress: (processed, total, message) => {
126
- if (options.progressCallback) {
127
- options.progressCallback({
128
- tool: provider.id,
129
- processed,
130
- total,
131
- message
132
- });
133
- }
132
+ const sanitizedConfig = { ...options };
133
+ delete sanitizedConfig.onProgress;
134
+ delete sanitizedConfig.progressCallback;
135
+ const toolOptions = {
136
+ rootDir: options.rootDir
137
+ // Always include rootDir
138
+ };
139
+ import_core.GLOBAL_SCAN_OPTIONS.forEach((key) => {
140
+ if (key in options && key !== "toolConfigs") {
141
+ toolOptions[key] = options[key];
134
142
  }
135
143
  });
144
+ if (options.toolConfigs?.[provider.id]) {
145
+ Object.assign(toolOptions, options.toolConfigs[provider.id]);
146
+ } else if (options[provider.id]) {
147
+ Object.assign(toolOptions, options[provider.id]);
148
+ }
149
+ toolOptions.onProgress = (processed, total, message) => {
150
+ if (options.progressCallback) {
151
+ options.progressCallback({
152
+ tool: provider.id,
153
+ processed,
154
+ total,
155
+ message
156
+ });
157
+ }
158
+ };
159
+ const output = await provider.analyze(toolOptions);
160
+ if (output.metadata) {
161
+ output.metadata.config = sanitizeToolConfig(toolOptions);
162
+ }
136
163
  if (options.progressCallback) {
137
164
  options.progressCallback({ tool: provider.id, data: output });
138
165
  }
139
166
  result[provider.id] = output;
140
167
  result.summary.toolsRun.push(provider.id);
168
+ if (output.summary?.config) {
169
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(
170
+ output.summary.config
171
+ );
172
+ } else if (output.metadata?.config) {
173
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(
174
+ output.metadata.config
175
+ );
176
+ } else {
177
+ result.summary.toolConfigs[provider.id] = sanitizeToolConfig(toolOptions);
178
+ }
141
179
  const toolFiles = output.summary?.totalFiles || output.summary?.filesAnalyzed || 0;
142
180
  if (toolFiles > result.summary.totalFiles) {
143
181
  result.summary.totalFiles = toolFiles;
@@ -165,6 +203,10 @@ async function analyzeUnified(options) {
165
203
  console.error(`\u274C Error running tool '${provider.id}':`, err);
166
204
  }
167
205
  }
206
+ result.summary.config = {
207
+ ...options,
208
+ toolConfigs: result.summary.toolConfigs
209
+ };
168
210
  result.summary.executionTime = Date.now() - startTime;
169
211
  return result;
170
212
  }
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  __require,
4
4
  analyzeUnified,
5
5
  scoreUnified
6
- } from "./chunk-7K3CNS6C.mjs";
6
+ } from "./chunk-YNGTO2UX.mjs";
7
7
 
8
8
  // src/cli.ts
9
9
  import { Command } from "commander";