@magic5644/graph-it-live 1.11.0 → 1.12.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.
Binary file
package/docs/CLI.md CHANGED
@@ -19,6 +19,8 @@ The `graph-it` CLI gives you full access to the dependency analysis engine of Gr
19
19
  - [check](#check)
20
20
  - [trace](#trace)
21
21
  - [query](#query)
22
+ - [stats](#stats)
23
+ - [wiki](#wiki)
22
24
  - [tool](#tool)
23
25
  - [serve](#serve)
24
26
  - [install](#install)
@@ -661,6 +663,68 @@ graph-it query "what is the entry point for the CLI" --format json
661
663
 
662
664
  ---
663
665
 
666
+ ### stats
667
+
668
+ Report session-level token metrics with strict separation between:
669
+ - **estimated JSON vs TOON encoding sizes** (chars/4 heuristic), and
670
+ - **real provider-reported LLM usage** (`llmUsage`).
671
+
672
+ ```
673
+ graph-it stats [options]
674
+ ```
675
+
676
+ **Options:**
677
+
678
+ | Option | Default | Description |
679
+ |--------|---------|-------------|
680
+ | `--workspace, -w` | auto-detected | Project root |
681
+ | `--stats-dir <dir>` | `~/.graph-it/stats` | Override persisted stats directory |
682
+ | `--format, -f` | `text` | Output format (`text`, `json`, `markdown`) |
683
+
684
+ **What it reports:**
685
+ - current process session (`byTool`, totals, `llmUsage`)
686
+ - persisted history (`bySource`, `byTool`)
687
+ - required wording that `llmUsage` is never summed into estimated encoding totals
688
+
689
+ **Local zero-LLM proof workflow:**
690
+
691
+ ```bash
692
+ # Runs architecture, codemap, impact, and call-graph analyses twice (JSON + TOON).
693
+ # ANTHROPIC_API_KEY and OPENAI_API_KEY are removed from child processes.
694
+ # Raw outputs and report.json are written under .reports/context-economy/.
695
+ npm run test:context-economy
696
+ ```
697
+
698
+ The generated `report.json` stores, for every corpus operation:
699
+
700
+ - `llmUsage.calls = 0` and `llmUsage.tokensUsed = 0`;
701
+ - raw JSON and TOON output paths;
702
+ - UTF-8 bytes, characters, and `estimateTokenSavings()` values;
703
+ - persisted CLI session snapshots, which also must show zero provider usage.
704
+
705
+ The `chars / 4` values are **encoding estimates**, not provider billing tokens or a
706
+ claim that an LLM was called. Local graph traversal performs no LLM request. The
707
+ optional `query` command may use an LLM only to extract keywords; without a
708
+ provider key it uses the deterministic heuristic fallback. MCP response synthesis
709
+ belongs to the calling AI client, not to Graph-It-Live's local analyzers.
710
+
711
+ **TOON secondary benchmark workflow:**
712
+
713
+ ```bash
714
+ # Primary + secondary payload benchmarks for session-stats TOON encoding
715
+ npx vitest bench tests/benchmarks/sessionStatsToon.bench.ts
716
+ ```
717
+
718
+ **Examples:**
719
+
720
+ ```bash
721
+ graph-it stats
722
+ graph-it stats --format json
723
+ graph-it stats --stats-dir /tmp/graph-it-stats --format markdown
724
+ ```
725
+
726
+ ---
727
+
664
728
  ### wiki
665
729
 
666
730
  Generate a navigable markdown wiki from the call graph. Creates one article per source file with hub scores, symbol lists, caller/callee cross-links, and a grouped index — all with relative links only (portable, can be committed to the repo).
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@magic5644/graph-it-live",
3
3
  "displayName": "Graph-It-Live",
4
4
  "description": "AI-first dependency graph & code intelligence for VS Code. Visualize file imports, symbol call hierarchies, and cross-file call graphs. Detect circular dependencies, dead code, and breaking changes. Built-in MCP Server with 21 tools for GitHub Copilot, Cursor, Claude, Windsurf, and Antigravity. Generate AI-friendly codemaps. TypeScript, JavaScript, C#, Go, Java, Python, Rust, Vue, Svelte, GraphQL.",
5
- "version": "1.11.0",
5
+ "version": "1.12.0",
6
6
  "publisher": "magic5644",
7
7
  "author": {
8
8
  "name": "magic56"
@@ -1116,6 +1116,7 @@
1116
1116
  "test:all": "npm run test:unit",
1117
1117
  "test:bench": "node scripts/run-benchmarks.mjs",
1118
1118
  "test:bench:memory": "node scripts/run-memory-bench.mjs",
1119
+ "test:context-economy": "npm run build:cli && node scripts/context-economy-corpus.mjs",
1119
1120
  "test:mcp": "node scripts/test-mcp.js",
1120
1121
  "test:cli:e2e": "bash scripts/test-cli-e2e.sh",
1121
1122
  "lint": "eslint src",
@@ -1137,7 +1138,7 @@
1137
1138
  "chokidar": "^5.0.0",
1138
1139
  "cytoscape": "^3.34.0",
1139
1140
  "cytoscape-fcose": "^2.2.0",
1140
- "ink": "^7.1.0",
1141
+ "ink": "^7.1.1",
1141
1142
  "react": "^19.2.7",
1142
1143
  "react-devtools-core": "^6.1.5",
1143
1144
  "react-dom": "^19.2.7",
@@ -1146,33 +1147,33 @@
1146
1147
  "tree-sitter-wasms": "^0.1.13",
1147
1148
  "ts-morph": "^27.0.2",
1148
1149
  "vis-network": "10.1.0",
1149
- "web-tree-sitter": "^0.26.10",
1150
+ "web-tree-sitter": "^0.26.11",
1150
1151
  "zod": "^4.4.3"
1151
1152
  },
1152
1153
  "devDependencies": {
1153
1154
  "@eslint/js": "^10.0.1",
1154
1155
  "@testing-library/react": "^16.3.2",
1155
1156
  "@types/mocha": "^10.0.10",
1156
- "@types/node": "^25.9.4",
1157
+ "@types/node": "^25.9.5",
1157
1158
  "@types/react": "^19.2.17",
1158
1159
  "@types/react-dom": "^19.2.3",
1159
1160
  "@types/sql.js": "^1.4.11",
1160
1161
  "@types/vscode": "^1.96.0",
1161
- "@vitest/coverage-v8": "^4.1.9",
1162
- "@vitest/ui": "^4.1.9",
1162
+ "@vitest/coverage-v8": "^4.1.10",
1163
+ "@vitest/ui": "^4.1.10",
1163
1164
  "@vscode/test-electron": "^2.5.2",
1164
1165
  "@vscode/vsce": "^3.9.2",
1165
1166
  "esbuild": "^0.28.1",
1166
1167
  "esbuild-css-modules-plugin": "^3.1.5",
1167
- "eslint": "^10.6.0",
1168
- "fast-check": "^4.8.0",
1168
+ "eslint": "^10.7.0",
1169
+ "fast-check": "^4.9.0",
1169
1170
  "glob": "^13.0.6",
1170
1171
  "globals": "^17.7.0",
1171
1172
  "happy-dom": "^20.10.6",
1172
1173
  "mocha": "^11.7.6",
1173
1174
  "typescript": "^6.0.3",
1174
- "typescript-eslint": "^8.62.1",
1175
- "vitest": "^4.1.9"
1175
+ "typescript-eslint": "^8.64.0",
1176
+ "vitest": "^4.1.10"
1176
1177
  },
1177
1178
  "overrides": {
1178
1179
  "picomatch": "^4.0.4",