@aiready/cli 0.3.6 → 0.3.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/cli@0.3.6 build /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.3.8 build /Users/pengcao/projects/aiready/packages/cli
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -10,20 +10,15 @@
10
10
  CJS Build start
11
11
  ESM Build start
12
12
  CJS dist/index.js 2.57 KB
13
- CJS dist/cli.js 10.77 KB
14
- CJS ⚡️ Build success in 51ms
13
+ CJS dist/cli.js 11.46 KB
14
+ CJS ⚡️ Build success in 53ms
15
15
  ESM dist/index.mjs 138.00 B
16
+ ESM dist/cli.mjs 8.61 KB
16
17
  ESM dist/chunk-KZKXZKES.mjs 1.45 KB
17
- ESM dist/cli.mjs 7.92 KB
18
- ESM ⚡️ Build success in 51ms
18
+ ESM ⚡️ Build success in 54ms
19
19
  DTS Build start
20
- src/cli.ts(57,17): error TS2339: Property 'getSmartDefaults' does not exist on type '{ default: typeof import("/Users/pengcao/projects/aiready/packages/pattern-detect/dist/index"); analyzePatterns: (options: PatternDetectOptions) => Promise<{ results: AnalysisResult[]; duplicates: DuplicatePattern[]; files: string[]; }>; detectDuplicatePatterns: (files: FileContent[], options: DetectionOptions) => P...'.
21
-
22
- Error: error occurred in dts build
23
- at Worker.<anonymous> (/Users/pengcao/projects/aiready/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/dist/index.js:1545:26)
24
- at Worker.emit (node:events:519:28)
25
- at MessagePort.<anonymous> (node:internal/worker:269:53)
26
- at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
27
- at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
28
- DTS Build error
29
-  ELIFECYCLE  Command failed with exit code 1.
20
+ DTS ⚡️ Build success in 538ms
21
+ DTS dist/cli.d.ts 20.00 B
22
+ DTS dist/index.d.ts 880.00 B
23
+ DTS dist/cli.d.mts 20.00 B
24
+ DTS dist/index.d.mts 880.00 B
package/dist/cli.js CHANGED
@@ -195,12 +195,23 @@ program.command("context").description("Run context window cost analysis").argum
195
195
  file: void 0
196
196
  }
197
197
  };
198
- const finalOptions = (0, import_core.loadMergedConfig)(directory, defaults, {
198
+ let baseOptions = (0, import_core.loadMergedConfig)(directory, defaults, {
199
199
  maxDepth: options.maxDepth ? parseInt(options.maxDepth) : void 0,
200
200
  maxContextBudget: options.maxContext ? parseInt(options.maxContext) : void 0,
201
201
  include: options.include?.split(","),
202
202
  exclude: options.exclude?.split(",")
203
203
  });
204
+ let finalOptions = { ...baseOptions };
205
+ const { getSmartDefaults } = await import("@aiready/context-analyzer");
206
+ const contextSmartDefaults = await getSmartDefaults(directory, baseOptions);
207
+ finalOptions = { ...contextSmartDefaults, ...finalOptions };
208
+ console.log("\u{1F4CB} Configuration:");
209
+ console.log(` Max depth: ${finalOptions.maxDepth}`);
210
+ console.log(` Max context budget: ${finalOptions.maxContextBudget}`);
211
+ console.log(` Min cohesion: ${(finalOptions.minCohesion * 100).toFixed(1)}%`);
212
+ console.log(` Max fragmentation: ${(finalOptions.maxFragmentation * 100).toFixed(1)}%`);
213
+ console.log(` Analysis focus: ${finalOptions.focus}`);
214
+ console.log("");
204
215
  const { analyzeContext: analyzeContext2, generateSummary } = await import("@aiready/context-analyzer");
205
216
  const results = await analyzeContext2(finalOptions);
206
217
  const elapsedTime = (0, import_core.getElapsedTime)(startTime);
package/dist/cli.mjs CHANGED
@@ -124,12 +124,23 @@ program.command("context").description("Run context window cost analysis").argum
124
124
  file: void 0
125
125
  }
126
126
  };
127
- const finalOptions = loadMergedConfig(directory, defaults, {
127
+ let baseOptions = loadMergedConfig(directory, defaults, {
128
128
  maxDepth: options.maxDepth ? parseInt(options.maxDepth) : void 0,
129
129
  maxContextBudget: options.maxContext ? parseInt(options.maxContext) : void 0,
130
130
  include: options.include?.split(","),
131
131
  exclude: options.exclude?.split(",")
132
132
  });
133
+ let finalOptions = { ...baseOptions };
134
+ const { getSmartDefaults } = await import("@aiready/context-analyzer");
135
+ const contextSmartDefaults = await getSmartDefaults(directory, baseOptions);
136
+ finalOptions = { ...contextSmartDefaults, ...finalOptions };
137
+ console.log("\u{1F4CB} Configuration:");
138
+ console.log(` Max depth: ${finalOptions.maxDepth}`);
139
+ console.log(` Max context budget: ${finalOptions.maxContextBudget}`);
140
+ console.log(` Min cohesion: ${(finalOptions.minCohesion * 100).toFixed(1)}%`);
141
+ console.log(` Max fragmentation: ${(finalOptions.maxFragmentation * 100).toFixed(1)}%`);
142
+ console.log(` Analysis focus: ${finalOptions.focus}`);
143
+ console.log("");
133
144
  const { analyzeContext, generateSummary } = await import("@aiready/context-analyzer");
134
145
  const results = await analyzeContext(finalOptions);
135
146
  const elapsedTime = getElapsedTime(startTime);
package/dist/index.d.mts CHANGED
@@ -3,6 +3,11 @@ import { ContextAnalysisResult } from '@aiready/context-analyzer';
3
3
 
4
4
  interface UnifiedAnalysisOptions extends ScanOptions {
5
5
  tools?: ('patterns' | 'context')[];
6
+ minSimilarity?: number;
7
+ minLines?: number;
8
+ maxCandidatesPerBlock?: number;
9
+ minSharedTokens?: number;
10
+ useSmartDefaults?: boolean;
6
11
  }
7
12
  interface UnifiedAnalysisResult {
8
13
  patterns?: AnalysisResult[];
package/dist/index.d.ts CHANGED
@@ -3,6 +3,11 @@ import { ContextAnalysisResult } from '@aiready/context-analyzer';
3
3
 
4
4
  interface UnifiedAnalysisOptions extends ScanOptions {
5
5
  tools?: ('patterns' | 'context')[];
6
+ minSimilarity?: number;
7
+ minLines?: number;
8
+ maxCandidatesPerBlock?: number;
9
+ minSharedTokens?: number;
10
+ useSmartDefaults?: boolean;
6
11
  }
7
12
  interface UnifiedAnalysisResult {
8
13
  patterns?: AnalysisResult[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Unified CLI for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -11,9 +11,9 @@
11
11
  "dependencies": {
12
12
  "commander": "^12.1.0",
13
13
  "chalk": "^5.3.0",
14
- "@aiready/pattern-detect": "0.7.9",
15
- "@aiready/core": "0.3.6",
16
- "@aiready/context-analyzer": "0.3.7"
14
+ "@aiready/core": "0.3.7",
15
+ "@aiready/pattern-detect": "0.7.12",
16
+ "@aiready/context-analyzer": "0.3.8"
17
17
  },
18
18
  "devDependencies": {
19
19
  "tsup": "^8.3.5",
package/src/cli.ts CHANGED
@@ -200,13 +200,28 @@ program
200
200
  };
201
201
 
202
202
  // Load and merge config with CLI options
203
- const finalOptions = loadMergedConfig(directory, defaults, {
203
+ let baseOptions = loadMergedConfig(directory, defaults, {
204
204
  maxDepth: options.maxDepth ? parseInt(options.maxDepth) : undefined,
205
205
  maxContextBudget: options.maxContext ? parseInt(options.maxContext) : undefined,
206
206
  include: options.include?.split(','),
207
207
  exclude: options.exclude?.split(','),
208
208
  });
209
209
 
210
+ // Apply smart defaults for context analysis (always for individual context command)
211
+ let finalOptions: any = { ...baseOptions };
212
+ const { getSmartDefaults } = await import('@aiready/context-analyzer');
213
+ const contextSmartDefaults = await getSmartDefaults(directory, baseOptions);
214
+ finalOptions = { ...contextSmartDefaults, ...finalOptions };
215
+
216
+ // Display configuration
217
+ console.log('📋 Configuration:');
218
+ console.log(` Max depth: ${finalOptions.maxDepth}`);
219
+ console.log(` Max context budget: ${finalOptions.maxContextBudget}`);
220
+ console.log(` Min cohesion: ${(finalOptions.minCohesion * 100).toFixed(1)}%`);
221
+ console.log(` Max fragmentation: ${(finalOptions.maxFragmentation * 100).toFixed(1)}%`);
222
+ console.log(` Analysis focus: ${finalOptions.focus}`);
223
+ console.log('');
224
+
210
225
  const { analyzeContext, generateSummary } = await import('@aiready/context-analyzer');
211
226
 
212
227
  const results = await analyzeContext(finalOptions);