@vibgrate/cli 2026.708.3 → 2026.709.2

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/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { G as GraphNode, a as GraphEdge, A as Area, R as ResolverKind, V as VgGr
2
2
  export { C as Centrality, D as DerivedBy, e as EpistemicTier, f as FactConfidence, g as FactKind, h as GraphMeta, N as NodeKind, P as Provenance, S as SCHEMA_VERSION, i as Span, T as Toolchain, U as Unknown } from './types-CXnp1uGj.js';
3
3
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
4
 
5
- declare const VERSION = "2026.708.3";
5
+ declare const VERSION = "2026.709.2";
6
6
 
7
7
  /**
8
8
  * Analysis stage: importance, centrality, hubs, communities, and surprise.
@@ -592,6 +592,13 @@ declare const TOOLS: VgTool[];
592
592
  interface ServeOptions {
593
593
  /** Record local, counts-only usage savings (opt-in). */
594
594
  savings?: boolean;
595
+ /**
596
+ * Periodically upload the counts-only ledger to Vibgrate (opt-in; off by
597
+ * default). Implies recording. The upload itself is driven by the serve
598
+ * command (see commands/serve.ts + engine/stats-share.ts); here it just also
599
+ * turns recording on so there's something to send.
600
+ */
601
+ shareStats?: boolean;
595
602
  /** Air-gapped mode (no model downloads). */
596
603
  local?: boolean;
597
604
  /** Collapse repeat heavy relation lists within a session (opt-in). */
@@ -896,6 +903,17 @@ interface LocalModel {
896
903
  }
897
904
  declare function discoverModels(home?: string): LocalModel[];
898
905
 
906
+ /**
907
+ * How a navigation call reached the map:
908
+ * - `mcp` — a tool call over the local `vg serve` MCP server;
909
+ * - `cli` — a `vg <subcommand>` invocation that identified itself with `--client`.
910
+ * Both are recorded into one ledger under a shared tool vocabulary (CLI
911
+ * subcommands are normalised to their MCP tool names via CLI_TOOL_ALIASES), so
912
+ * `(tool, source)` is the command-vs-MCP split and the token math stays unified.
913
+ * Absent on ledger lines written before sources existed → read as `mcp` (the
914
+ * only path that recorded then).
915
+ */
916
+ type Source = 'mcp' | 'cli';
899
917
  /**
900
918
  * Outcome of a recorded navigation call:
901
919
  * - `complete` — returned results, with nothing capped or paginated;
@@ -909,6 +927,8 @@ interface SavingEntry {
909
927
  outcome?: Outcome;
910
928
  vgTokens: number;
911
929
  baselineTokens: number;
930
+ source?: Source;
931
+ client?: string;
912
932
  }
913
933
  /** Whether a savings ledger exists for this repo (i.e. `vg serve --savings` has recorded). */
914
934
  declare function savingsRecorded(root: string): boolean;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { ASSISTANTS, FREE_PACK, GraphIndex, GraphSource, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assistantById, buildFacts, buildGraph, buildModuleResolver, cosine, coveringTests, createServer, decodeScipIndex, defaultGraphPath, inventory as dependencyInventory, detectRunner, discover, discoverModels, driftCount, driftFor, enrichOnline, exportGraph, findNodes, formatForExt, getNodeEmbeddings, groundGraph, hasDrift, identifierParts, impactOf, installAssistant, isTestFile, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, nodeById, nodeEmbedText, parseGraph, parseJsonc, probeFreshness, queryGraph, queryGraphSemantic, readDoc, readSavings, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveLib, resolveLimits, resolveOne, saveCatalog, savingsRecorded, scipEdges, serializeGraph, serveStdio, shortestPath, stableStringify, testsToRun, uninstallAssistant, verifyDeterminism, vibgrateDir, writeArtifacts, writeSnapshot } from './chunk-2DJ3UXG7.js';
1
+ export { ASSISTANTS, FREE_PACK, GraphIndex, GraphSource, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assistantById, buildFacts, buildGraph, buildModuleResolver, cosine, coveringTests, createServer, decodeScipIndex, defaultGraphPath, inventory as dependencyInventory, detectRunner, discover, discoverModels, driftCount, driftFor, enrichOnline, exportGraph, findNodes, formatForExt, getNodeEmbeddings, groundGraph, hasDrift, identifierParts, impactOf, installAssistant, isTestFile, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, nodeById, nodeEmbedText, parseGraph, parseJsonc, probeFreshness, queryGraph, queryGraphSemantic, readDoc, readSavings, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveLib, resolveLimits, resolveOne, saveCatalog, savingsRecorded, scipEdges, serializeGraph, serveStdio, shortestPath, stableStringify, testsToRun, uninstallAssistant, verifyDeterminism, vibgrateDir, writeArtifacts, writeSnapshot } from './chunk-3TCE6IGZ.js';
2
2
  export { LANGUAGES, allLanguageIds, grammarsSourceDir, langById, langForExtension, parseSource } from './chunk-X5YT263H.js';
3
- export { VERSION } from './chunk-QUELGOCR.js';
3
+ export { VERSION } from './chunk-PIWHQSAR.js';
4
4
  import { redactUrlCredentials, redactSecrets } from './chunk-RXP66R2E.js';
5
5
  import './chunk-GI6W53LM.js';
6
6
  import { execFileSync } from 'child_process';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "2026.708.3",
3
+ "version": "2026.709.2",
4
4
  "description": "vg — local codebase intelligence CLI + MCP server for AI coding agents: deterministic code graph, drift reporting, and version-correct library docs (Apache-2.0)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -49,7 +49,8 @@
49
49
  "dev": "tsx src/cli.ts",
50
50
  "lint": "eslint src",
51
51
  "typecheck": "tsc --noEmit",
52
- "test": "vitest run"
52
+ "test": "vitest run",
53
+ "bench:literal": "tsx bench/literal-search.bench.ts"
53
54
  },
54
55
  "keywords": [
55
56
  "code-graph",
@@ -99,6 +100,6 @@
99
100
  "vitest": "^4.0.0"
100
101
  },
101
102
  "engines": {
102
- "node": ">=20.0.0"
103
+ "node": ">=22.0.0"
103
104
  }
104
105
  }
@@ -8,13 +8,26 @@ description: Query the local code graph (vg) for structure, impact, and navigati
8
8
  This repo has a deterministic code graph built by `vg`. Prefer it over reading or
9
9
  grepping many files — it is smaller, more relevant context, and free.
10
10
 
11
- ## When to use it
11
+ ## Prefer the MCP tools
12
12
 
13
- - **Understand code:** `vg "<question>"` returns a budget-bounded, fact-annotated
14
- context block. Start here instead of opening files blindly.
15
- - **Find a symbol:** `vg show <name>` what it is, what it calls, what calls it.
16
- - **Before changing something:** `vg impact <name>` what breaks if you change it.
17
- - **Navigate:** `vg path <A> <B>`, `vg tree <name>`, `vg hubs`, `vg areas`.
13
+ If the `vg` MCP server is registered (it is after `vg install`), call its
14
+ read-only tools directly they are the **fastest** path. The server keeps the
15
+ map parsed, the relation index warm, and the embedding model loaded across calls,
16
+ so each query is cheaper than spawning the CLI fresh. Use:
17
+ `query_graph`, `get_node`, `impact_of`, `find_path`, `list_hubs`, `list_areas`,
18
+ `get_graph_summary`, `search_symbols`. They are side-effect-free and
19
+ auto-approvable, and the server records which client is calling automatically.
20
+
21
+ ## If you use the `vg` CLI instead
22
+
23
+ When the MCP server isn't available, use the CLI — and **always pass
24
+ `--client=<your-ai>`** so your calls are counted (that's how the CLI-vs-MCP split
25
+ is measured and the tools improved):
26
+
27
+ - **Understand code:** `vg "<question>" --client=<your-ai>` — a budget-bounded, fact-annotated context block.
28
+ - **Find a symbol:** `vg show <name> --client=<your-ai>` — what it is, what it calls, what calls it.
29
+ - **Before changing something:** `vg impact <name> --client=<your-ai>` — what breaks if you change it.
30
+ - **Navigate:** `vg path <A> <B> --client=<your-ai>`, `vg tree <name> --client=<your-ai>`.
18
31
 
19
32
  ## Dependencies & library docs
20
33
 
@@ -24,19 +37,17 @@ grepping many files — it is smaller, more relevant context, and free.
24
37
  - **Version-correct docs:** `vg lib <name>` returns drift-annotated, version-
25
38
  specific usage docs for a library — inject these instead of guessing an API.
26
39
 
27
- ## Via MCP
28
-
29
- If the `vg` MCP server is registered, call its read-only tools directly:
30
- `query_graph`, `get_node`, `impact_of`, `find_path`, `list_hubs`, `list_areas`,
31
- `get_graph_summary`. They are side-effect-free and auto-approvable.
32
-
33
40
  ## Keep it fresh
34
41
 
35
- Run `vg` after pulling or making structural changes. The map lives at
36
- `.vibgrate/graph.json` and is deterministic (byte-identical across machines).
42
+ The map keeps itself fresh: `vg ask` and the MCP tools detect changed files
43
+ and rebuild it incrementally before answering — you can edit code and query
44
+ immediately. Running `vg` after a large pull still warms everything in one go.
45
+ The map lives at `.vibgrate/graph.json` and is deterministic (byte-identical
46
+ across machines).
37
47
 
38
48
  ---
39
49
 
40
50
  > This is the canonical reference copy. `vg install <assistant>` writes this skill
41
- > into each assistant's expected location and registers the local MCP server. The
51
+ > into each assistant's expected location (substituting the assistant's own name
52
+ > for `<your-ai>` in the `--client` flag) and registers the local MCP server. The
42
53
  > source of truth is `src/install/content.ts`.
@@ -1,6 +0,0 @@
1
- export { baselineCommand, runBaseline } from './chunk-JXGVMXYE.js';
2
- import './chunk-QUELGOCR.js';
3
- import './chunk-RXP66R2E.js';
4
- import './chunk-GI6W53LM.js';
5
- //# sourceMappingURL=baseline-AUC3HAXW.js.map
6
- //# sourceMappingURL=baseline-AUC3HAXW.js.map