@aiready/context-analyzer 0.9.42 → 0.16.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.9.42 build /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.16.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
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,16 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
+ CJS dist/cli.js 74.67 KB
13
+ CJS dist/index.js 67.31 KB
14
+ CJS ⚡️ Build success in 157ms
12
15
  ESM dist/cli.mjs 19.14 KB
13
16
  ESM dist/index.mjs 2.09 KB
14
- ESM dist/chunk-GFADGYXZ.mjs 57.10 KB
15
17
  ESM dist/python-context-TBI5FVFY.mjs 5.66 KB
16
- ESM ⚡️ Build success in 365ms
17
- CJS dist/cli.js 74.67 KB
18
- CJS dist/index.js 67.31 KB
19
- CJS ⚡️ Build success in 366ms
18
+ ESM dist/chunk-GFADGYXZ.mjs 57.10 KB
19
+ ESM ⚡️ Build success in 161ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 12915ms
21
+ DTS ⚡️ Build success in 3028ms
22
22
  DTS dist/cli.d.ts 20.00 B
23
23
  DTS dist/index.d.ts 12.38 KB
24
24
  DTS dist/cli.d.mts 20.00 B
@@ -1,32 +1,33 @@
1
1
 
2
2
  
3
- > @aiready/context-analyzer@0.9.42 test /Users/pengcao/projects/aiready/packages/context-analyzer
3
+ > @aiready/context-analyzer@0.16.0 test /Users/pengcao/projects/aiready/packages/context-analyzer
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/context-analyzer
8
8
 
9
- ✓ src/__tests__/scoring.test.ts (7 tests) 10ms
10
- ✓ dist/__tests__/fragmentation-advanced.test.js (3 tests) 9ms
11
- ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 24ms
12
- ✓ dist/__tests__/auto-detection.test.js (8 tests) 204ms
13
- ✓ src/__tests__/file-classification.test.ts (63 tests) 77ms
14
- ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 151ms
15
- ✓ dist/__tests__/enhanced-cohesion.test.js (6 tests) 3ms
16
- ✓ src/__tests__/auto-detection.test.ts (8 tests) 205ms
17
- ✓ src/__tests__/analyzer.test.ts (14 tests) 204ms
18
- ✓ dist/__tests__/fragmentation-coupling.test.js (2 tests) 230ms
19
- ✓ dist/__tests__/analyzer.test.js (14 tests) 79ms
20
- ✓ dist/__tests__/scoring.test.js (7 tests) 6ms
9
+ ✓ dist/__tests__/scoring.test.js (7 tests) 3ms
10
+ ✓ src/__tests__/file-classification.test.ts (63 tests) 9ms
11
+ ✓ dist/__tests__/fragmentation-advanced.test.js (3 tests) 2ms
12
+ ✓ src/__tests__/scoring.test.ts (7 tests) 5ms
13
+ ✓ dist/__tests__/auto-detection.test.js (8 tests) 13ms
14
+ ✓ dist/__tests__/fragmentation-coupling.test.js (2 tests) 25ms
15
+ ✓ src/__tests__/contract.test.ts (1 test) 16ms
16
+ ✓ dist/__tests__/analyzer.test.js (14 tests) 86ms
17
+ ✓ src/__tests__/auto-detection.test.ts (8 tests) 39ms
18
+ ✓ src/__tests__/analyzer.test.ts (14 tests) 181ms
19
+ ✓ src/__tests__/fragmentation-coupling.test.ts (2 tests) 76ms
20
+ ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 5ms
21
+ ✓ dist/__tests__/fragmentation-log.test.js (3 tests) 1ms
22
+ ✓ dist/__tests__/enhanced-cohesion.test.js (6 tests) 2ms
23
+ ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 2ms
21
24
  ✓ dist/__tests__/structural-cohesion.test.js (4 tests) 2ms
22
- ✓ dist/__tests__/fragmentation-log.test.js (3 tests) 8ms
23
- ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 2ms
24
- ✓ src/__tests__/enhanced-cohesion.test.ts (6 tests) 3ms
25
- ✓ src/__tests__/fragmentation-advanced.test.ts (3 tests) 3ms
25
+ ✓ src/__tests__/fragmentation-log.test.ts (3 tests) 11ms
26
+ ✓ src/__tests__/structural-cohesion.test.ts (4 tests) 17ms
26
27
 
27
-  Test Files  17 passed (17)
28
-  Tests  157 passed (157)
29
-  Start at  23:46:53
30
-  Duration  2.56s (transform 1.86s, setup 0ms, import 12.68s, tests 1.22s, environment 2ms)
28
+  Test Files  18 passed (18)
29
+  Tests  158 passed (158)
30
+  Start at  15:41:04
31
+  Duration  3.66s (transform 3.86s, setup 0ms, import 22.48s, tests 494ms, environment 25ms)
31
32
 
32
33
  [?25h
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/context-analyzer",
3
- "version": "0.9.42",
3
+ "version": "0.16.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",
@@ -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.9.39"
52
+ "@aiready/core": "0.18.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^24.0.0",
@@ -0,0 +1,38 @@
1
+ import { describe, it, expect, vi } from 'vitest';
2
+ import { analyzeContext, generateSummary } from '../index';
3
+ import { validateSpokeOutput } from '../../../core/src/types/contract';
4
+
5
+ // Mock core functions
6
+ vi.mock('@aiready/core', async (importOriginal) => {
7
+ const actual = await importOriginal<typeof import('@aiready/core')>();
8
+ return {
9
+ ...actual,
10
+ scanFiles: vi.fn().mockResolvedValue(['file1.ts']),
11
+ readFileContent: vi
12
+ .fn()
13
+ .mockResolvedValue('import { a } from "./b"; export const x = 1;'),
14
+ };
15
+ });
16
+
17
+ describe('Context Analyzer Contract Validation', () => {
18
+ it('should produce output matching the SpokeOutput contract', async () => {
19
+ const results = await analyzeContext({
20
+ rootDir: './test',
21
+ } as any);
22
+
23
+ const summary = generateSummary(results);
24
+
25
+ const fullOutput = {
26
+ results,
27
+ summary,
28
+ };
29
+
30
+ const validation = validateSpokeOutput('context-analyzer', fullOutput);
31
+
32
+ if (!validation.valid) {
33
+ console.error('Contract Validation Errors:', validation.errors);
34
+ }
35
+
36
+ expect(validation.valid).toBe(true);
37
+ });
38
+ });