@aiready/context-analyzer 0.4.6 → 0.5.0
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 +5 -5
- package/.turbo/turbo-test.log +26 -5
- package/README.md +62 -2
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/context-analyzer@0.
|
|
3
|
+
> @aiready/context-analyzer@0.5.0 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
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[32mCJS[39m [1mdist/cli.js [22m[32m39.27 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m20.62 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 42ms
|
|
15
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m18.45 KB[39m
|
|
15
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m164.00 B[39m
|
|
16
17
|
[32mESM[39m [1mdist/chunk-NJUW6VED.mjs [22m[32m19.48 KB[39m
|
|
17
|
-
[32mESM[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in 55ms
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 42ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 551ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 2.44 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/context-analyzer@0.
|
|
3
|
+
> @aiready/context-analyzer@0.5.0 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 (13)[22m
|
|
10
|
+
[90m·[39m buildDependencyGraph[2m (1)[22m
|
|
11
|
+
[90m·[39m should build a basic dependency graph
|
|
12
|
+
[90m·[39m calculateImportDepth[2m (2)[22m
|
|
13
|
+
[90m·[39m should calculate import depth correctly
|
|
14
|
+
[90m·[39m should handle circular dependencies gracefully
|
|
15
|
+
[90m·[39m getTransitiveDependencies[2m (1)[22m
|
|
16
|
+
[90m·[39m should get all transitive dependencies
|
|
17
|
+
[90m·[39m calculateContextBudget[2m (1)[22m
|
|
18
|
+
[90m·[39m should calculate total token cost including dependencies
|
|
19
|
+
[90m·[39m detectCircularDependencies[2m (2)[22m
|
|
20
|
+
[90m·[39m should detect circular dependencies
|
|
21
|
+
[90m·[39m should return empty for no circular dependencies
|
|
22
|
+
[90m·[39m calculateCohesion[2m (3)[22m
|
|
23
|
+
[90m·[39m should return 1 for single export
|
|
24
|
+
[90m·[39m should return high cohesion for related exports
|
|
25
|
+
[90m·[39m should return low cohesion for mixed exports
|
|
26
|
+
[90m·[39m calculateFragmentation[2m (3)[22m
|
|
27
|
+
[90m·[39m should return 0 for single file
|
|
28
|
+
[90m·[39m should return 0 for files in same directory
|
|
29
|
+
[90m·[39m should return high fragmentation for scattered files
|
|
30
|
+
[?25l[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[1A[2K[G [32m✓[39m [2msrc/__tests__/[22manalyzer[2m.test.ts[22m[2m (13)[22m
|
|
10
31
|
[32m✓[39m buildDependencyGraph[2m (1)[22m
|
|
11
32
|
[32m✓[39m should build a basic dependency graph
|
|
12
33
|
[32m✓[39m calculateImportDepth[2m (2)[22m
|
|
@@ -30,7 +51,7 @@
|
|
|
30
51
|
|
|
31
52
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
32
53
|
[2m Tests [22m [1m[32m13 passed[39m[22m[90m (13)[39m
|
|
33
|
-
[2m Start at [22m 07:
|
|
34
|
-
[2m Duration [22m
|
|
54
|
+
[2m Start at [22m 07:46:59
|
|
55
|
+
[2m Duration [22m 394ms[2m (transform 66ms, setup 0ms, collect 75ms, tests 41ms, environment 0ms, prepare 42ms)[22m
|
|
35
56
|
|
|
36
|
-
[?25h
|
|
57
|
+
[?25h[?25h
|
package/README.md
CHANGED
|
@@ -67,6 +67,9 @@ npx @aiready/context-analyzer ./src
|
|
|
67
67
|
# Basic usage
|
|
68
68
|
aiready-context ./src
|
|
69
69
|
|
|
70
|
+
# Show more results in console (default: 10)
|
|
71
|
+
aiready-context ./src --max-results 25
|
|
72
|
+
|
|
70
73
|
# Focus on specific concerns
|
|
71
74
|
aiready-context ./src --focus fragmentation
|
|
72
75
|
aiready-context ./src --focus cohesion
|
|
@@ -75,7 +78,7 @@ aiready-context ./src --focus depth
|
|
|
75
78
|
# Set thresholds
|
|
76
79
|
aiready-context ./src --max-depth 5 --max-context 10000 --min-cohesion 0.6
|
|
77
80
|
|
|
78
|
-
# Export to JSON (saved to .aiready/ by default)
|
|
81
|
+
# Export to JSON for full details (saved to .aiready/ by default)
|
|
79
82
|
aiready-context ./src --output json
|
|
80
83
|
|
|
81
84
|
# Or specify custom path
|
|
@@ -88,6 +91,8 @@ aiready-context ./src --output json --output-file custom-report.json
|
|
|
88
91
|
|
|
89
92
|
**Smart defaults automatically adjust based on your repository size** to show ~10 most serious issues.
|
|
90
93
|
|
|
94
|
+
> **💡 Tip:** By default, console output shows the top 10 results per category. Use `--max-results <number>` to see more, or use `--output json` to get complete details of all issues.
|
|
95
|
+
|
|
91
96
|
### Getting More/Fewer Results
|
|
92
97
|
|
|
93
98
|
**Want to catch MORE potential issues?** (More sensitive, shows smaller problems)
|
|
@@ -132,9 +137,47 @@ aiready-context ./src --max-depth 5 --max-context 15000
|
|
|
132
137
|
aiready-context ./src --max-depth 8 --max-context 25000 --min-cohesion 0.3
|
|
133
138
|
```
|
|
134
139
|
|
|
140
|
+
## 📤 Output Options
|
|
141
|
+
|
|
142
|
+
### Console Output (Default)
|
|
143
|
+
|
|
144
|
+
Shows a summary with top 10 results per category:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Default - shows top 10 items
|
|
148
|
+
aiready-context ./src
|
|
149
|
+
|
|
150
|
+
# Show more items (e.g., top 25)
|
|
151
|
+
aiready-context ./src --max-results 25
|
|
152
|
+
|
|
153
|
+
# Show all items (use a large number)
|
|
154
|
+
aiready-context ./src --max-results 999
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### JSON Output
|
|
158
|
+
|
|
159
|
+
Get complete details of **all** issues (not limited to 10):
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Generate JSON with all issues
|
|
163
|
+
aiready-context ./src --output json
|
|
164
|
+
|
|
165
|
+
# Custom output path
|
|
166
|
+
aiready-context ./src --output json --output-file reports/analysis.json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### HTML Report
|
|
170
|
+
|
|
171
|
+
Visual report with charts and detailed breakdown:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
135
174
|
# Generate HTML report
|
|
136
175
|
aiready-context ./src --output html --output-file report.html
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Include/Exclude Patterns
|
|
137
179
|
|
|
180
|
+
```bash
|
|
138
181
|
# Include/exclude patterns
|
|
139
182
|
aiready-context ./src --exclude "**/test/**,**/*.test.ts"
|
|
140
183
|
```
|
|
@@ -154,12 +197,29 @@ Create an `aiready.json` or `aiready.config.json` file in your project root:
|
|
|
154
197
|
"maxDepth": 4,
|
|
155
198
|
"maxContextBudget": 8000,
|
|
156
199
|
"minCohesion": 0.7,
|
|
157
|
-
"
|
|
200
|
+
"maxFragmentation": 0.6,
|
|
201
|
+
"focus": "all",
|
|
202
|
+
"maxResults": 10
|
|
158
203
|
}
|
|
204
|
+
},
|
|
205
|
+
"output": {
|
|
206
|
+
"format": "console"
|
|
159
207
|
}
|
|
160
208
|
}
|
|
161
209
|
```
|
|
162
210
|
|
|
211
|
+
**Configuration Options:**
|
|
212
|
+
|
|
213
|
+
| Option | Type | Default | Description |
|
|
214
|
+
|--------|------|---------|-------------|
|
|
215
|
+
| `maxDepth` | number | `5` | Max acceptable import depth |
|
|
216
|
+
| `maxContextBudget` | number | `10000` | Max acceptable token budget |
|
|
217
|
+
| `minCohesion` | number | `0.6` | Min acceptable cohesion score (0-1) |
|
|
218
|
+
| `maxFragmentation` | number | `0.5` | Max acceptable fragmentation (0-1) |
|
|
219
|
+
| `focus` | string | `'all'` | Focus: `'fragmentation'`, `'cohesion'`, `'depth'`, `'all'` |
|
|
220
|
+
| `maxResults` | number | `10` | Max results per category in console |
|
|
221
|
+
| `includeNodeModules` | boolean | `false` | Include node_modules in analysis |
|
|
222
|
+
|
|
163
223
|
### Sample Output
|
|
164
224
|
|
|
165
225
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/context-analyzer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|