@aiready/cli 0.12.10 → 0.12.11

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.
@@ -140,12 +140,14 @@ export async function scanAction(directory: string, options: ScanOptions) {
140
140
  const { getSmartDefaults } = await import('@aiready/pattern-detect');
141
141
  const patternSmartDefaults = await getSmartDefaults(
142
142
  resolvedDir,
143
- baseOptions
143
+ finalOptions.toolConfigs?.[ToolName.PatternDetect] || {}
144
144
  );
145
- finalOptions = {
145
+
146
+ // Merge smart defaults into toolConfigs instead of root level
147
+ if (!finalOptions.toolConfigs) finalOptions.toolConfigs = {};
148
+ finalOptions.toolConfigs[ToolName.PatternDetect] = {
146
149
  ...patternSmartDefaults,
147
- ...finalOptions,
148
- ...baseOptions,
150
+ ...finalOptions.toolConfigs[ToolName.PatternDetect],
149
151
  };
150
152
  }
151
153
 
@@ -182,7 +184,7 @@ export async function scanAction(directory: string, options: ScanOptions) {
182
184
  const results = await analyzeUnified({
183
185
  ...finalOptions,
184
186
  progressCallback,
185
- onProgress: () => {},
187
+ onProgress: () => { },
186
188
  suppressToolConfig: true,
187
189
  });
188
190
 
package/src/index.ts CHANGED
@@ -4,6 +4,8 @@ import {
4
4
  calculateOverallScore,
5
5
  calculateTokenBudget,
6
6
  GLOBAL_SCAN_OPTIONS,
7
+ GLOBAL_INFRA_OPTIONS,
8
+ COMMON_FINE_TUNING_OPTIONS,
7
9
  } from '@aiready/core';
8
10
  import type {
9
11
  AnalysisResult,
@@ -95,7 +97,7 @@ const TOOL_PACKAGE_MAP: Record<string, string> = {
95
97
  function sanitizeToolConfig(config: any): any {
96
98
  if (!config || typeof config !== 'object') return config;
97
99
  const sanitized = { ...config };
98
- GLOBAL_SCAN_OPTIONS.forEach((key: string) => {
100
+ GLOBAL_INFRA_OPTIONS.forEach((key: string) => {
99
101
  if (key !== 'rootDir') {
100
102
  delete (sanitized as any)[key];
101
103
  }
@@ -176,12 +178,14 @@ export async function analyzeUnified(
176
178
  rootDir: options.rootDir, // Always include rootDir
177
179
  };
178
180
 
179
- // 2. Add other global options that tools might need
180
- GLOBAL_SCAN_OPTIONS.forEach((key) => {
181
- if (key in options && key !== 'toolConfigs') {
182
- toolOptions[key] = (options as any)[key];
181
+ // 1. Pass through all known infra and fine-tuning options from root level
182
+ [...GLOBAL_INFRA_OPTIONS, ...COMMON_FINE_TUNING_OPTIONS].forEach(
183
+ (key) => {
184
+ if (key in options && key !== 'toolConfigs') {
185
+ toolOptions[key] = (options as any)[key];
186
+ }
183
187
  }
184
- });
188
+ );
185
189
 
186
190
  // 3. Add tool-specific overrides
187
191
  if (options.toolConfigs?.[provider.id]) {