@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.
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-test.log +11 -3
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +4 -4
- package/package.json +2 -2
- package/src/cli.ts +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/context-analyzer@0.7.
|
|
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
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[32mCJS[39m [1mdist/index.js [22m[32m33.35 KB[39m
|
|
13
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m49.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m49.43 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 201ms
|
|
15
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m18.50 KB[39m
|
|
15
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m504.00 B[39m
|
|
16
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m18.45 KB[39m
|
|
17
17
|
[32mESM[39m [1mdist/chunk-DMRZMS2U.mjs [22m[32m31.83 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 208ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
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
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/context-analyzer@0.7.
|
|
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
|
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.9 [39m[90m/Users/pengcao/projects/aiready/packages/context-analyzer[39m
|
|
8
8
|
|
|
9
9
|
[?25l [90m·[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (14)[22m
|
|
10
|
+
[32m✓[39m [2msrc/__tests__/[22menhanced-cohesion[2m.test.ts[22m[2m (6)[22m
|
|
11
|
+
[?25l[?25l[2K[1A[2K[1A[2K[G [90m·[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (14)[22m
|
|
12
|
+
[90m·[39m [2msrc/__tests__/[22mauto-detection[2m.test.ts[22m[2m (8)[22m
|
|
13
|
+
[32m✓[39m [2msrc/__tests__/[22menhanced-cohesion[2m.test.ts[22m[2m (6)[22m
|
|
14
|
+
[?25l[?25l[2K[1A[2K[1A[2K[1A[2K[G [90m·[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (14)[22m
|
|
15
|
+
[32m✓[39m [2msrc/__tests__/[22mauto-detection[2m.test.ts[22m[2m (8)[22m
|
|
16
|
+
[32m✓[39m [2msrc/__tests__/[22menhanced-cohesion[2m.test.ts[22m[2m (6)[22m
|
|
17
|
+
[?25l[?25l[2K[1A[2K[1A[2K[1A[2K[G [32m✓[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (14)[22m
|
|
10
18
|
[32m✓[39m [2msrc/__tests__/[22mauto-detection[2m.test.ts[22m[2m (8)[22m
|
|
11
19
|
[32m✓[39m [2msrc/__tests__/[22menhanced-cohesion[2m.test.ts[22m[2m (6)[22m
|
|
12
20
|
[2K[1A[2K[1A[2K[1A[2K[G [32m✓[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (14)[22m
|
|
@@ -15,7 +23,7 @@
|
|
|
15
23
|
|
|
16
24
|
[2m Test Files [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
17
25
|
[2m Tests [22m [1m[32m28 passed[39m[22m[90m (28)[39m
|
|
18
|
-
[2m Start at [22m 18:
|
|
19
|
-
[2m Duration [22m
|
|
26
|
+
[2m Start at [22m 18:01:20
|
|
27
|
+
[2m Duration [22m 2.10s[2m (transform 200ms, setup 0ms, collect 2.75s, tests 110ms, environment 0ms, prepare 440ms)[22m
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
}
|