@aiready/context-analyzer 0.22.6 → 0.22.7

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,31 +1,32 @@
1
-
2
- > @aiready/context-analyzer@0.22.6 build /Users/pengcao/projects/aiready/packages/context-analyzer
3
- > tsup src/index.ts src/cli.ts --format cjs,esm --dts
4
-
5
- CLI Building entry: src/cli.ts, src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Target: es2020
9
- CJS Build start
10
- ESM Build start
11
- CJS dist/index.js 83.32 KB
12
- CJS dist/cli.js 69.59 KB
13
- CJS ⚡️ Build success in 148ms
14
- ESM dist/cli-action-VCXBZGZP.mjs 2.86 KB
15
- ESM dist/cli.mjs 1.81 KB
16
- ESM dist/python-context-BWDC4E5Z.mjs 4.48 KB
17
- ESM dist/chunk-M2EGQ36M.mjs 41.00 KB
18
- ESM dist/index.mjs 12.64 KB
19
- ESM dist/chunk-J3SZQZNU.mjs 8.11 KB
20
- ESM dist/chunk-EMYD7NS6.mjs 4.91 KB
21
- ESM dist/chunk-64U3PNO3.mjs 2.65 KB
22
- ESM dist/summary-7PZVW72O.mjs 119.00 B
23
- ESM dist/orchestrator-KMAKMHTD.mjs 190.00 B
24
- ESM dist/chunk-BQCISA2F.mjs 3.35 KB
25
- ESM ⚡️ Build success in 151ms
26
- DTS Build start
27
- DTS ⚡️ Build success in 12467ms
28
- DTS dist/cli.d.ts 20.00 B
29
- DTS dist/index.d.ts 25.64 KB
30
- DTS dist/cli.d.mts 20.00 B
31
- DTS dist/index.d.mts 25.64 KB
1
+
2
+ 
3
+ > @aiready/context-analyzer@0.22.7 build /Users/pengcao/projects/aiready/packages/context-analyzer
4
+ > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
+
6
+ CLI Building entry: src/cli.ts, src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.1
9
+ CLI Target: es2020
10
+ CJS Build start
11
+ ESM Build start
12
+ CJS dist/cli.js 69.59 KB
13
+ CJS dist/index.js 83.38 KB
14
+ CJS ⚡️ Build success in 567ms
15
+ ESM dist/index.mjs 12.69 KB
16
+ ESM dist/cli-action-VCXBZGZP.mjs 2.86 KB
17
+ ESM dist/summary-7PZVW72O.mjs 119.00 B
18
+ ESM dist/chunk-J3SZQZNU.mjs 8.11 KB
19
+ ESM dist/python-context-BWDC4E5Z.mjs 4.48 KB
20
+ ESM dist/chunk-M2EGQ36M.mjs 41.00 KB
21
+ ESM dist/cli.mjs 1.81 KB
22
+ ESM dist/chunk-EMYD7NS6.mjs 4.91 KB
23
+ ESM dist/chunk-64U3PNO3.mjs 2.65 KB
24
+ ESM dist/chunk-BQCISA2F.mjs 3.35 KB
25
+ ESM dist/orchestrator-KMAKMHTD.mjs 190.00 B
26
+ ESM ⚡️ Build success in 568ms
27
+ DTS Build start
28
+ DTS ⚡️ Build success in 11173ms
29
+ DTS dist/cli.d.ts 20.00 B
30
+ DTS dist/index.d.ts 25.64 KB
31
+ DTS dist/cli.d.mts 20.00 B
32
+ DTS dist/index.d.mts 25.64 KB
@@ -1,49 +1,51 @@
1
-
2
- > @aiready/context-analyzer@0.22.5 test /Users/pengcao/projects/aiready/packages/context-analyzer
3
- > vitest run --exclude "**/dist/**"
4
-
5
-
6
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/context-analyzer
7
-
8
- ✓ src/__tests__/domain-inference.test.ts (26 tests) 29ms
9
- ✓ src/__tests__/report/console-report.test.ts (8 tests) 79ms
10
- ✓ src/__tests__/report/html-report.test.ts (11 tests) 71ms
11
- ✓ src/__tests__/remediation.test.ts (6 tests) 5ms
12
- stderr | src/__tests__/python-context.test.ts > python-context > analyzePythonContext > should filter for Python files only
13
- Failed to analyze src/file2.py: TypeError: Cannot read properties of undefined (reading 'split')
14
- at Module.analyzePythonContext (/Users/pengcao/projects/aiready/packages/context-analyzer/src/analyzers/python-context.ts:91:32)
15
-  at processTicksAndRejections (node:internal/process/task_queues:104:5)
16
- at /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/python-context.test.ts:63:23
17
- at file:///Users/pengcao/projects/aiready/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:915:20
18
-
19
- stderr | src/__tests__/python-context.test.ts > python-context > analyzePythonContext > should analyze Python files and return metrics
20
- Failed to analyze src/test.py: TypeError: Cannot read properties of undefined (reading 'split')
21
- at Module.analyzePythonContext (/Users/pengcao/projects/aiready/packages/context-analyzer/src/analyzers/python-context.ts:91:32)
22
-  at processTicksAndRejections (node:internal/process/task_queues:104:5)
23
- at /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/python-context.test.ts:84:23
24
- at file:///Users/pengcao/projects/aiready/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:915:20
25
-
26
- ✓ src/__tests__/python-context.test.ts (4 tests) 14ms
27
- ✓ src/__tests__/issue-analyzer.test.ts (17 tests) 104ms
28
- ✓ src/__tests__/provider.test.ts (2 tests) 4ms
29
- ✓ src/__tests__/orchestrator.test.ts (8 tests) 130ms
30
- ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 14ms
31
- ✓ src/__tests__/analyzer.test.ts (14 tests) 30ms
32
- ✓ src/__tests__/file-classification.test.ts (63 tests) 58ms
33
- ✓ src/__tests__/auto-detection.test.ts (8 tests) 115ms
34
- ✓ src/__tests__/contract.test.ts (1 test) 120ms
35
- ✓ src/__tests__/scoring.test.ts (15 tests) 4ms
36
- ✓ src/__tests__/consolidation.test.ts (6 tests) 4ms
37
- ✓ src/__tests__/cluster-detector.test.ts (3 tests) 6ms
38
- ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 1ms
39
- ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 2ms
40
- ✓ src/__tests__/defaults.test.ts (7 tests) 8ms
41
- ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 3ms
42
- ✓ src/__tests__/boilerplate-barrel.test.ts (7 tests) 4ms
43
- ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 2ms
44
-
45
-  Test Files  22 passed (22)
46
-  Tests  224 passed (224)
47
-  Start at  20:27:24
48
-  Duration  6.51s (transform 11.24s, setup 0ms, import 42.58s, tests 806ms, environment 30ms)
49
-
1
+
2
+ 
3
+ > @aiready/context-analyzer@0.22.6 test /Users/pengcao/projects/aiready/packages/context-analyzer
4
+ > vitest run --exclude "**/dist/**"
5
+
6
+ [?25l
7
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/context-analyzer
8
+
9
+ ✓ src/__tests__/report/console-report.test.ts (8 tests) 62ms
10
+ ✓ src/__tests__/remediation.test.ts (6 tests) 3ms
11
+ ✓ src/__tests__/report/html-report.test.ts (11 tests) 114ms
12
+ ✓ src/__tests__/domain-inference.test.ts (26 tests) 14ms
13
+ stderr | src/__tests__/python-context.test.ts > python-context > analyzePythonContext > should filter for Python files only
14
+ Failed to analyze src/file2.py: TypeError: Cannot read properties of undefined (reading 'split')
15
+ at Module.analyzePythonContext (/Users/pengcao/projects/aiready/packages/context-analyzer/src/analyzers/python-context.ts:91:32)
16
+  at processTicksAndRejections (node:internal/process/task_queues:104:5)
17
+ at /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/python-context.test.ts:63:23
18
+ at file:///Users/pengcao/projects/aiready/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:915:20
19
+
20
+ stderr | src/__tests__/python-context.test.ts > python-context > analyzePythonContext > should analyze Python files and return metrics
21
+ Failed to analyze src/test.py: TypeError: Cannot read properties of undefined (reading 'split')
22
+ at Module.analyzePythonContext (/Users/pengcao/projects/aiready/packages/context-analyzer/src/analyzers/python-context.ts:91:32)
23
+  at processTicksAndRejections (node:internal/process/task_queues:104:5)
24
+ at /Users/pengcao/projects/aiready/packages/context-analyzer/src/__tests__/python-context.test.ts:84:23
25
+ at file:///Users/pengcao/projects/aiready/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:915:20
26
+
27
+ ✓ src/__tests__/python-context.test.ts (4 tests) 55ms
28
+ ✓ src/__tests__/consolidation.test.ts (6 tests) 15ms
29
+ ✓ src/__tests__/issue-analyzer.test.ts (17 tests) 20ms
30
+ ✓ src/__tests__/boilerplate-barrel.test.ts (7 tests) 4ms
31
+ ✓ src/__tests__/orchestrator.test.ts (8 tests) 177ms
32
+ ✓ src/__tests__/analyzer.test.ts (14 tests) 180ms
33
+ ✓ src/__tests__/contract.test.ts (1 test) 25ms
34
+ ✓ src/__tests__/auto-detection.test.ts (8 tests) 186ms
35
+ ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 36ms
36
+ ✓ src/__tests__/file-classification.test.ts (63 tests) 6ms
37
+ ✓ src/__tests__/provider.test.ts (2 tests) 13ms
38
+ ✓ src/__tests__/cluster-detector.test.ts (3 tests) 6ms
39
+ ✓ src/__tests__/defaults.test.ts (7 tests) 7ms
40
+ ✓ src/__tests__/scoring.test.ts (15 tests) 4ms
41
+ ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 2ms
42
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 2ms
43
+ ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 15ms
44
+ ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 3ms
45
+
46
+  Test Files  22 passed (22)
47
+  Tests  224 passed (224)
48
+  Start at  22:04:25
49
+  Duration  8.27s (transform 13.02s, setup 0ms, import 52.87s, tests 948ms, environment 34ms)
50
+
51
+ [?25h
package/CONTRIBUTING.md CHANGED
@@ -13,7 +13,7 @@ The Context Analyzer measures and optimizes **context window usage** - how much
13
13
 
14
14
  ## 🐛 Reporting Issues
15
15
 
16
- Found a bug or have a feature request? [Open an issue](https://github.com/caopengau/aiready-context-analyzer/issues) with:
16
+ Found a bug or have a feature request? [Open an issue](https://github.com/getaiready/aiready-context-analyzer/issues) with:
17
17
 
18
18
  - Clear description of the problem or feature
19
19
  - Sample code that demonstrates the issue
package/dist/index.js CHANGED
@@ -1949,15 +1949,16 @@ var WEIGHT_DEPTH = 0.25;
1949
1949
  var WEIGHT_FRAGMENTATION = 0.25;
1950
1950
  function calculateContextScore(summary, costConfig) {
1951
1951
  const {
1952
- avgContextBudget,
1953
- maxContextBudget,
1954
- avgImportDepth,
1955
- maxImportDepth,
1956
- avgFragmentation,
1957
- criticalIssues,
1958
- majorIssues,
1959
- totalFiles
1960
- } = summary;
1952
+ avgContextBudget = 0,
1953
+ maxContextBudget = 0,
1954
+ avgImportDepth = 0,
1955
+ maxImportDepth = 0,
1956
+ avgFragmentation = 0.5,
1957
+ // neutral
1958
+ criticalIssues = 0,
1959
+ majorIssues = 0,
1960
+ totalFiles = 0
1961
+ } = summary || {};
1961
1962
  const budgetScore = avgContextBudget < BUDGET_EXCELLENT_THRESHOLD ? 100 : Math.max(
1962
1963
  0,
1963
1964
  100 - (avgContextBudget - BUDGET_EXCELLENT_THRESHOLD) / BUDGET_PENALTY_RATE
package/dist/index.mjs CHANGED
@@ -100,15 +100,16 @@ var WEIGHT_DEPTH = 0.25;
100
100
  var WEIGHT_FRAGMENTATION = 0.25;
101
101
  function calculateContextScore(summary, costConfig) {
102
102
  const {
103
- avgContextBudget,
104
- maxContextBudget,
105
- avgImportDepth,
106
- maxImportDepth,
107
- avgFragmentation,
108
- criticalIssues,
109
- majorIssues,
110
- totalFiles
111
- } = summary;
103
+ avgContextBudget = 0,
104
+ maxContextBudget = 0,
105
+ avgImportDepth = 0,
106
+ maxImportDepth = 0,
107
+ avgFragmentation = 0.5,
108
+ // neutral
109
+ criticalIssues = 0,
110
+ majorIssues = 0,
111
+ totalFiles = 0
112
+ } = summary || {};
112
113
  const budgetScore = avgContextBudget < BUDGET_EXCELLENT_THRESHOLD ? 100 : Math.max(
113
114
  0,
114
115
  100 - (avgContextBudget - BUDGET_EXCELLENT_THRESHOLD) / BUDGET_PENALTY_RATE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/context-analyzer",
3
- "version": "0.22.6",
3
+ "version": "0.22.7",
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",
@@ -49,7 +49,7 @@
49
49
  "commander": "^14.0.0",
50
50
  "chalk": "^5.3.0",
51
51
  "prompts": "^2.4.2",
52
- "@aiready/core": "0.24.6"
52
+ "@aiready/core": "0.24.7"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^24.0.0",
package/src/scoring.ts CHANGED
@@ -49,15 +49,15 @@ export function calculateContextScore(
49
49
  costConfig?: Partial<CostConfig>
50
50
  ): ToolScoringOutput {
51
51
  const {
52
- avgContextBudget,
53
- maxContextBudget,
54
- avgImportDepth,
55
- maxImportDepth,
56
- avgFragmentation,
57
- criticalIssues,
58
- majorIssues,
59
- totalFiles,
60
- } = summary;
52
+ avgContextBudget = 0,
53
+ maxContextBudget = 0,
54
+ avgImportDepth = 0,
55
+ maxImportDepth = 0,
56
+ avgFragmentation = 0.5, // neutral
57
+ criticalIssues = 0,
58
+ majorIssues = 0,
59
+ totalFiles = 0,
60
+ } = summary || {};
61
61
 
62
62
  // More reasonable thresholds for modern codebases
63
63
  const budgetScore =