@aiready/context-analyzer 0.7.7 → 0.7.12

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/context-analyzer@0.7.7 build /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.7.12 build /Users/pengcao/projects/aiready/packages/context-analyzer
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,14 +10,14 @@
10
10
  CJS Build start
11
11
  ESM Build start
12
12
  CJS dist/index.js 33.35 KB
13
- CJS dist/cli.js 49.38 KB
14
- CJS ⚡️ Build success in 54ms
13
+ CJS dist/cli.js 49.43 KB
14
+ CJS ⚡️ Build success in 201ms
15
+ ESM dist/cli.mjs 18.50 KB
15
16
  ESM dist/index.mjs 504.00 B
16
- ESM dist/cli.mjs 18.45 KB
17
17
  ESM dist/chunk-DMRZMS2U.mjs 31.83 KB
18
- ESM ⚡️ Build success in 54ms
18
+ ESM ⚡️ Build success in 208ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 574ms
20
+ DTS ⚡️ Build success in 1547ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
22
  DTS dist/index.d.ts 5.56 KB
23
23
  DTS dist/cli.d.mts 20.00 B
@@ -1,12 +1,20 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.7.7 test /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.7.12 test /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > vitest run
5
5
 
6
6
 
7
7
   RUN  v2.1.9 /Users/pengcao/projects/aiready/packages/context-analyzer
8
8
 
9
9
  [?25l · src/__tests__/analyzer.test.ts (14)
10
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6)
11
+ [?25l[?25l · src/__tests__/analyzer.test.ts (14)
12
+ · src/__tests__/auto-detection.test.ts (8)
13
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6)
14
+ [?25l[?25l · src/__tests__/analyzer.test.ts (14)
15
+ ✓ src/__tests__/auto-detection.test.ts (8)
16
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6)
17
+ [?25l[?25l ✓ src/__tests__/analyzer.test.ts (14)
10
18
  ✓ src/__tests__/auto-detection.test.ts (8)
11
19
  ✓ src/__tests__/enhanced-cohesion.test.ts (6)
12
20
   ✓ src/__tests__/analyzer.test.ts (14)
@@ -15,7 +23,7 @@
15
23
 
16
24
   Test Files  3 passed (3)
17
25
   Tests  28 passed (28)
18
-  Start at  18:32:40
19
-  Duration  542ms (transform 233ms, setup 0ms, collect 831ms, tests 28ms, environment 0ms, prepare 140ms)
26
+  Start at  18:01:20
27
+  Duration  2.10s (transform 200ms, setup 0ms, collect 2.75s, tests 110ms, environment 0ms, prepare 440ms)
20
28
 
21
29
  [?25h[?25h
package/dist/cli.js CHANGED
@@ -967,26 +967,26 @@ program.parse();
967
967
  function displayTuningGuidance(results, options) {
968
968
  const issueCount = results.filter((r) => r.severity !== "info").length;
969
969
  if (issueCount === 0) {
970
- console.log(import_chalk.default.green("\n\u2728 No issues found! Your code is well-structured for AI context usage.\n"));
970
+ console.log(import_chalk.default.green("\n\u2728 No optimization opportunities found! Your code is well-structured for AI context usage.\n"));
971
971
  return;
972
972
  }
973
973
  console.log(import_chalk.default.cyan("\n\u2501".repeat(60)));
974
974
  console.log(import_chalk.default.bold.white(" TUNING GUIDANCE"));
975
975
  console.log(import_chalk.default.cyan("\u2501".repeat(60) + "\n"));
976
976
  if (issueCount < 5) {
977
- console.log(import_chalk.default.yellow("\u{1F4CA} Showing few issues. To catch more potential problems:\n"));
977
+ console.log(import_chalk.default.yellow("\u{1F4CA} Showing few optimization opportunities. To find more areas to improve:\n"));
978
978
  console.log(import_chalk.default.dim(" \u2022 Lower --max-depth (currently: " + options.maxDepth + ") to catch shallower import chains"));
979
979
  console.log(import_chalk.default.dim(" \u2022 Lower --max-context (currently: " + options.maxContextBudget.toLocaleString() + ") to catch smaller files"));
980
980
  console.log(import_chalk.default.dim(" \u2022 Raise --min-cohesion (currently: " + (options.minCohesion * 100).toFixed(0) + "%) to be stricter about mixed concerns"));
981
981
  console.log(import_chalk.default.dim(" \u2022 Lower --max-fragmentation (currently: " + (options.maxFragmentation * 100).toFixed(0) + "%) to catch scattered code\n"));
982
982
  } else if (issueCount > 20) {
983
- console.log(import_chalk.default.yellow("\u{1F4CA} Showing many issues. To focus on most critical problems:\n"));
983
+ console.log(import_chalk.default.yellow("\u{1F4CA} Showing many opportunities. To focus on highest-impact areas:\n"));
984
984
  console.log(import_chalk.default.dim(" \u2022 Raise --max-depth (currently: " + options.maxDepth + ") to only catch very deep chains"));
985
985
  console.log(import_chalk.default.dim(" \u2022 Raise --max-context (currently: " + options.maxContextBudget.toLocaleString() + ") to focus on largest files"));
986
986
  console.log(import_chalk.default.dim(" \u2022 Lower --min-cohesion (currently: " + (options.minCohesion * 100).toFixed(0) + "%) to only flag severe mixed concerns"));
987
987
  console.log(import_chalk.default.dim(" \u2022 Raise --max-fragmentation (currently: " + (options.maxFragmentation * 100).toFixed(0) + "%) to only flag highly scattered code\n"));
988
988
  } else {
989
- console.log(import_chalk.default.green("\u{1F4CA} Good balance of issues detected (showing " + issueCount + " issues)\n"));
989
+ console.log(import_chalk.default.green("\u{1F4CA} Good balance of optimization opportunities (showing " + issueCount + " areas)\n"));
990
990
  console.log(import_chalk.default.dim(" \u{1F4A1} Tip: Adjust thresholds if needed:"));
991
991
  console.log(import_chalk.default.dim(" aiready-context . --max-depth N --max-context N --min-cohesion 0.X\n"));
992
992
  }
package/dist/cli.mjs CHANGED
@@ -99,26 +99,26 @@ program.parse();
99
99
  function displayTuningGuidance(results, options) {
100
100
  const issueCount = results.filter((r) => r.severity !== "info").length;
101
101
  if (issueCount === 0) {
102
- console.log(chalk.green("\n\u2728 No issues found! Your code is well-structured for AI context usage.\n"));
102
+ console.log(chalk.green("\n\u2728 No optimization opportunities found! Your code is well-structured for AI context usage.\n"));
103
103
  return;
104
104
  }
105
105
  console.log(chalk.cyan("\n\u2501".repeat(60)));
106
106
  console.log(chalk.bold.white(" TUNING GUIDANCE"));
107
107
  console.log(chalk.cyan("\u2501".repeat(60) + "\n"));
108
108
  if (issueCount < 5) {
109
- console.log(chalk.yellow("\u{1F4CA} Showing few issues. To catch more potential problems:\n"));
109
+ console.log(chalk.yellow("\u{1F4CA} Showing few optimization opportunities. To find more areas to improve:\n"));
110
110
  console.log(chalk.dim(" \u2022 Lower --max-depth (currently: " + options.maxDepth + ") to catch shallower import chains"));
111
111
  console.log(chalk.dim(" \u2022 Lower --max-context (currently: " + options.maxContextBudget.toLocaleString() + ") to catch smaller files"));
112
112
  console.log(chalk.dim(" \u2022 Raise --min-cohesion (currently: " + (options.minCohesion * 100).toFixed(0) + "%) to be stricter about mixed concerns"));
113
113
  console.log(chalk.dim(" \u2022 Lower --max-fragmentation (currently: " + (options.maxFragmentation * 100).toFixed(0) + "%) to catch scattered code\n"));
114
114
  } else if (issueCount > 20) {
115
- console.log(chalk.yellow("\u{1F4CA} Showing many issues. To focus on most critical problems:\n"));
115
+ console.log(chalk.yellow("\u{1F4CA} Showing many opportunities. To focus on highest-impact areas:\n"));
116
116
  console.log(chalk.dim(" \u2022 Raise --max-depth (currently: " + options.maxDepth + ") to only catch very deep chains"));
117
117
  console.log(chalk.dim(" \u2022 Raise --max-context (currently: " + options.maxContextBudget.toLocaleString() + ") to focus on largest files"));
118
118
  console.log(chalk.dim(" \u2022 Lower --min-cohesion (currently: " + (options.minCohesion * 100).toFixed(0) + "%) to only flag severe mixed concerns"));
119
119
  console.log(chalk.dim(" \u2022 Raise --max-fragmentation (currently: " + (options.maxFragmentation * 100).toFixed(0) + "%) to only flag highly scattered code\n"));
120
120
  } else {
121
- console.log(chalk.green("\u{1F4CA} Good balance of issues detected (showing " + issueCount + " issues)\n"));
121
+ console.log(chalk.green("\u{1F4CA} Good balance of optimization opportunities (showing " + issueCount + " areas)\n"));
122
122
  console.log(chalk.dim(" \u{1F4A1} Tip: Adjust thresholds if needed:"));
123
123
  console.log(chalk.dim(" aiready-context . --max-depth N --max-context N --min-cohesion 0.X\n"));
124
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/context-analyzer",
3
- "version": "0.7.7",
3
+ "version": "0.7.12",
4
4
  "description": "AI context window cost analysis - detect fragmented code, deep import chains, and expensive context budgets",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -50,7 +50,7 @@
50
50
  "commander": "^12.1.0",
51
51
  "chalk": "^5.3.0",
52
52
  "prompts": "^2.4.2",
53
- "@aiready/core": "0.7.5"
53
+ "@aiready/core": "0.7.9"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^22.10.2",
package/src/cli.ts CHANGED
@@ -141,7 +141,7 @@ function displayTuningGuidance(
141
141
  const issueCount = results.filter(r => r.severity !== 'info').length;
142
142
 
143
143
  if (issueCount === 0) {
144
- console.log(chalk.green('\n✨ No issues found! Your code is well-structured for AI context usage.\n'));
144
+ console.log(chalk.green('\n✨ No optimization opportunities found! Your code is well-structured for AI context usage.\n'));
145
145
  return;
146
146
  }
147
147
 
@@ -150,19 +150,19 @@ function displayTuningGuidance(
150
150
  console.log(chalk.cyan('━'.repeat(60) + '\n'));
151
151
 
152
152
  if (issueCount < 5) {
153
- console.log(chalk.yellow('📊 Showing few issues. To catch more potential problems:\n'));
153
+ console.log(chalk.yellow('📊 Showing few optimization opportunities. To find more areas to improve:\n'));
154
154
  console.log(chalk.dim(' • Lower --max-depth (currently: ' + options.maxDepth + ') to catch shallower import chains'));
155
155
  console.log(chalk.dim(' • Lower --max-context (currently: ' + options.maxContextBudget.toLocaleString() + ') to catch smaller files'));
156
156
  console.log(chalk.dim(' • Raise --min-cohesion (currently: ' + (options.minCohesion * 100).toFixed(0) + '%) to be stricter about mixed concerns'));
157
157
  console.log(chalk.dim(' • Lower --max-fragmentation (currently: ' + (options.maxFragmentation * 100).toFixed(0) + '%) to catch scattered code\n'));
158
158
  } else if (issueCount > 20) {
159
- console.log(chalk.yellow('📊 Showing many issues. To focus on most critical problems:\n'));
159
+ console.log(chalk.yellow('📊 Showing many opportunities. To focus on highest-impact areas:\n'));
160
160
  console.log(chalk.dim(' • Raise --max-depth (currently: ' + options.maxDepth + ') to only catch very deep chains'));
161
161
  console.log(chalk.dim(' • Raise --max-context (currently: ' + options.maxContextBudget.toLocaleString() + ') to focus on largest files'));
162
162
  console.log(chalk.dim(' • Lower --min-cohesion (currently: ' + (options.minCohesion * 100).toFixed(0) + '%) to only flag severe mixed concerns'));
163
163
  console.log(chalk.dim(' • Raise --max-fragmentation (currently: ' + (options.maxFragmentation * 100).toFixed(0) + '%) to only flag highly scattered code\n'));
164
164
  } else {
165
- console.log(chalk.green('📊 Good balance of issues detected (showing ' + issueCount + ' issues)\n'));
165
+ console.log(chalk.green('📊 Good balance of optimization opportunities (showing ' + issueCount + ' areas)\n'));
166
166
  console.log(chalk.dim(' 💡 Tip: Adjust thresholds if needed:'));
167
167
  console.log(chalk.dim(' aiready-context . --max-depth N --max-context N --min-cohesion 0.X\n'));
168
168
  }