@vibgrate/cli 2026.717.1 → 2026.720.1

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-BgNa-FZQ.js';
3
3
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
4
 
5
- declare const VERSION = "2026.717.1";
5
+ declare const VERSION = "2026.720.1";
6
6
 
7
7
  /**
8
8
  * Analysis stage: importance, centrality, hubs, communities, and surprise.
@@ -603,6 +603,114 @@ interface VgTool {
603
603
  }
604
604
  declare const TOOLS: VgTool[];
605
605
 
606
+ /**
607
+ * How a navigation call reached the map:
608
+ * - `mcp` — a tool call over the local `vg serve` MCP server;
609
+ * - `cli` — a `vg <subcommand>` invocation that identified itself with `--client`.
610
+ * Both are recorded into one ledger under a shared tool vocabulary (CLI
611
+ * subcommands are normalised to their MCP tool names via CLI_TOOL_ALIASES), so
612
+ * `(tool, source)` is the command-vs-MCP split and the token math stays unified.
613
+ * Absent on ledger lines written before sources existed → read as `mcp` (the
614
+ * only path that recorded then).
615
+ */
616
+ type Source = 'mcp' | 'cli';
617
+ /**
618
+ * Outcome of a recorded navigation call:
619
+ * - `complete` — returned results, with nothing capped or paginated;
620
+ * - `partial` — returned results, but more were available/truncated;
621
+ * - `miss` — returned no result (no match, not-found, not-connected).
622
+ */
623
+ type Outcome = 'complete' | 'partial' | 'miss';
624
+ interface SavingEntry {
625
+ ts: number;
626
+ tool: string;
627
+ outcome?: Outcome;
628
+ vgTokens: number;
629
+ baselineTokens: number;
630
+ source?: Source;
631
+ client?: string;
632
+ ms?: number;
633
+ }
634
+ /** Whether a savings ledger exists for this repo (i.e. `vg serve --savings` has recorded). */
635
+ declare function savingsRecorded(root: string): boolean;
636
+ declare function recordSaving(root: string, entry: Omit<SavingEntry, 'ts'>, now: number): void;
637
+ interface SavingsReport {
638
+ enabled: boolean;
639
+ days: number;
640
+ queries: number;
641
+ vgTokens: number;
642
+ baselineTokens: number;
643
+ ratio: number;
644
+ estCostVg: number;
645
+ estCostBaseline: number;
646
+ saved: number;
647
+ rateLabel: string;
648
+ }
649
+ declare function readSavings(root: string, days: number, now: number, ratePerM?: number): SavingsReport;
650
+
651
+ /**
652
+ * Live, in-memory session stats for `vg serve` — the "is it earning its keep?"
653
+ * display. While the MCP server runs, every tool call is aggregated per tool
654
+ * and per client (which AI is calling, how many calls, how long they take, and
655
+ * the context tokens served vs the grep/read baseline they replaced), and a
656
+ * status block on stderr keeps the operator posted.
657
+ *
658
+ * Privacy: everything here lives and dies with the process — nothing is
659
+ * persisted or uploaded, so the display is always on (GUARDRAILS §3.4 applies
660
+ * to the opt-in ledger/upload, which remain separate and off by default).
661
+ * Counts only — never code, paths beyond what the operator already sees, or
662
+ * question text.
663
+ *
664
+ * Output discipline: stderr only. Under stdio transport, stdout IS the MCP
665
+ * protocol stream and carries nothing else.
666
+ */
667
+ interface CallSample {
668
+ tool: string;
669
+ /** Coarse, sanitized client label ('claude', 'cursor', … or 'unknown'). */
670
+ client: string;
671
+ outcome: Outcome;
672
+ /** Wall time of the tool call, ms. */
673
+ ms: number;
674
+ /** Context tokens vg actually returned (savings tools only; else 0). */
675
+ vgTokens: number;
676
+ /** Grep/read baseline estimate those tokens replaced (savings tools only; else 0). */
677
+ baselineTokens: number;
678
+ }
679
+ interface RollupRow {
680
+ key: string;
681
+ calls: number;
682
+ complete: number;
683
+ partial: number;
684
+ miss: number;
685
+ totalMs: number;
686
+ vgTokens: number;
687
+ baselineTokens: number;
688
+ }
689
+ interface SessionSnapshot {
690
+ startedAt: number;
691
+ /** Bumped on every recorded call — cheap dirty check for renderers. */
692
+ revision: number;
693
+ /** Epoch ms of the most recent call, or null when none yet (never 0). */
694
+ lastCallAt: number | null;
695
+ totals: RollupRow;
696
+ /** Sorted by calls desc, then key — deterministic display order. */
697
+ clients: RollupRow[];
698
+ tools: RollupRow[];
699
+ }
700
+ /** Aggregates tool calls for the lifetime of one serve process. */
701
+ declare class SessionStats {
702
+ readonly startedAt: number;
703
+ private revision;
704
+ private lastCallAt;
705
+ private readonly totals;
706
+ private readonly byClient;
707
+ private readonly byTool;
708
+ constructor(now?: number);
709
+ record(sample: CallSample, now?: number): void;
710
+ snapshot(): SessionSnapshot;
711
+ private rowFor;
712
+ }
713
+
606
714
  interface ServeOptions {
607
715
  /** Record local, counts-only usage savings (opt-in). */
608
716
  savings?: boolean;
@@ -619,6 +727,12 @@ interface ServeOptions {
619
727
  dedup?: boolean;
620
728
  /** Auto-refresh the map when the working tree drifts (default true). */
621
729
  refresh?: boolean;
730
+ /**
731
+ * In-memory session stats behind the live `vg serve` status display. Always
732
+ * safe to pass: nothing recorded here is persisted or uploaded — it dies with
733
+ * the process (the opt-in ledger above is a separate concern).
734
+ */
735
+ stats?: SessionStats;
622
736
  }
623
737
  declare class GraphSource {
624
738
  readonly graphPath: string;
@@ -917,50 +1031,6 @@ interface LocalModel {
917
1031
  }
918
1032
  declare function discoverModels(home?: string): LocalModel[];
919
1033
 
920
- /**
921
- * How a navigation call reached the map:
922
- * - `mcp` — a tool call over the local `vg serve` MCP server;
923
- * - `cli` — a `vg <subcommand>` invocation that identified itself with `--client`.
924
- * Both are recorded into one ledger under a shared tool vocabulary (CLI
925
- * subcommands are normalised to their MCP tool names via CLI_TOOL_ALIASES), so
926
- * `(tool, source)` is the command-vs-MCP split and the token math stays unified.
927
- * Absent on ledger lines written before sources existed → read as `mcp` (the
928
- * only path that recorded then).
929
- */
930
- type Source = 'mcp' | 'cli';
931
- /**
932
- * Outcome of a recorded navigation call:
933
- * - `complete` — returned results, with nothing capped or paginated;
934
- * - `partial` — returned results, but more were available/truncated;
935
- * - `miss` — returned no result (no match, not-found, not-connected).
936
- */
937
- type Outcome = 'complete' | 'partial' | 'miss';
938
- interface SavingEntry {
939
- ts: number;
940
- tool: string;
941
- outcome?: Outcome;
942
- vgTokens: number;
943
- baselineTokens: number;
944
- source?: Source;
945
- client?: string;
946
- }
947
- /** Whether a savings ledger exists for this repo (i.e. `vg serve --savings` has recorded). */
948
- declare function savingsRecorded(root: string): boolean;
949
- declare function recordSaving(root: string, entry: Omit<SavingEntry, 'ts'>, now: number): void;
950
- interface SavingsReport {
951
- enabled: boolean;
952
- days: number;
953
- queries: number;
954
- vgTokens: number;
955
- baselineTokens: number;
956
- ratio: number;
957
- estCostVg: number;
958
- estCostBaseline: number;
959
- saved: number;
960
- rateLabel: string;
961
- }
962
- declare function readSavings(root: string, days: number, now: number, ratePerM?: number): SavingsReport;
963
-
964
1034
  /**
965
1035
  * `vg lib` — a deterministic, on-disk library-currency catalog: version-correct
966
1036
  * usage docs for the **exact version in your lockfile**, drift-annotated, from
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-L42NVMD6.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-VQLOVQZP.js';
2
2
  export { LANGUAGES, allLanguageIds, grammarsSourceDir, langById, langForExtension, parseSource } from './chunk-VFO5UDAT.js';
3
- export { VERSION } from './chunk-M62BGJMK.js';
3
+ export { VERSION } from './chunk-AJDUMRVI.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,7 +1,9 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "2026.717.1",
3
+ "version": "2026.720.1",
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
+ "//mcpName": "Official MCP registry ownership proof: the registry fetches the published npm package and requires this field to match the com.vibgrate/ai-context server entry (see docs/marketing/mcp-registry/README.md). Must ship in the published @vibgrate/cli package.json.",
6
+ "mcpName": "com.vibgrate/ai-context",
5
7
  "type": "module",
6
8
  "license": "Apache-2.0",
7
9
  "packageManager": "pnpm@9.0.0",
@@ -1,6 +0,0 @@
1
- export { baselineCommand, runBaseline } from './chunk-WZNIDXZP.js';
2
- import './chunk-M62BGJMK.js';
3
- import './chunk-RXP66R2E.js';
4
- import './chunk-GI6W53LM.js';
5
- //# sourceMappingURL=baseline-YWGSHCKW.js.map
6
- //# sourceMappingURL=baseline-YWGSHCKW.js.map