@vibgrate/cli 2026.715.1 → 2026.717.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/DOCS.md CHANGED
@@ -567,7 +567,7 @@ vg ask "<question>"
567
567
 
568
568
  A local ONNX embedding model is downloaded once on first use, then cached and fully offline. Degrades gracefully to lexical-only under `--local` or `--no-semantic`.
569
569
 
570
- > **Semantic search is opt-in.** The embedding backend (`fastembed`, which pulls a native ONNX runtime) is declared as an **optional dependency**: package managers install it by default, but if it's absent — e.g. you installed with `--omit=optional`, or it failed to build on your platform — `vg ask` and `vg embed` transparently fall back to lexical + structural search. Nothing else in the CLI needs it, so `vg build`, `vg show`, `vg impact`, drift reporting, and MCP serving all run without it. If you never use semantic `ask`, you can install lean: `npm i @vibgrate/cli --omit=optional`.
570
+ > **Semantic search is opt-in.** The embedding backend (`fastembed`, which pulls a native ONNX runtime) is declared as an **optional dependency**: package managers install it by default, but if it's absent — e.g. you installed with `--omit=optional`, or it failed to build on your platform — `vg ask` and `vg embed` transparently fall back to lexical + structural search. Nothing else in the CLI needs it, so `vg build`, `vg show`, `vg impact`, drift reporting, and MCP serving all run without it. If you never use semantic `ask`, you can install lean: `npm i @vibgrate/cli --omit=optional`. A host application that bundles the CLI without optional dependencies (Vibgrate for VS Code does this) can supply the backend from its own directory by setting `VIBGRATE_EMBEDDER_PATH` to a folder whose `node_modules` contains `fastembed`; when set, that copy is used first.
571
571
 
572
572
  Before answering, `ask` checks whether files changed since the map was last built and, if so, rebuilds it incrementally first (only the changed files re-parse) — so answers always reflect the code as it is now. The check is stat-based and costs almost nothing when nothing changed; `--no-refresh` opts out.
573
573
 
@@ -0,0 +1,6 @@
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
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-BTLZWSNS.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-YWGSHCKW.js"}
@@ -1,5 +1,5 @@
1
1
  import { hashString, langById, shortId, canonicalize, grammarSetVersion, hashBytes, langForExtension, setGrammarsOverride, parseSource } from './chunk-VFO5UDAT.js';
2
- import { writeTextFile, pathExists, readJsonFile, loadConfig, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-C5AVF7PT.js';
2
+ import { writeTextFile, pathExists, readJsonFile, loadConfig, computeUpgradeImpact, getChangelogSignals, gitHistoryAvailable, buildVersionTimelines, findPackageTimeline, severityRank, projectTypeToVulnEcosystem, VERSION } from './chunk-M62BGJMK.js';
3
3
  import * as fs19 from 'fs';
4
4
  import { spawnSync, execFileSync } from 'child_process';
5
5
  import * as path19 from 'path';
@@ -11,8 +11,9 @@ import betweenness from 'graphology-metrics/centrality/betweenness.js';
11
11
  import eigenvector from 'graphology-metrics/centrality/eigenvector.js';
12
12
  import louvain from 'graphology-communities-louvain';
13
13
  import * as os from 'os';
14
- import { fileURLToPath } from 'url';
14
+ import { pathToFileURL, fileURLToPath } from 'url';
15
15
  import ts from 'typescript';
16
+ import { createRequire } from 'module';
16
17
  import { bidirectional } from 'graphology-shortest-path/unweighted.js';
17
18
  import * as crypto from 'crypto';
18
19
  import { createHash } from 'crypto';
@@ -2678,7 +2679,7 @@ async function loadEmbedder(options = {}) {
2678
2679
  options.onUnavailable?.(reason);
2679
2680
  return null;
2680
2681
  };
2681
- const mod = await import('fastembed').catch(() => null);
2682
+ const mod = await importEmbedBackend();
2682
2683
  if (!mod?.FlagEmbedding) return fail("not-installed");
2683
2684
  const cache = modelCacheDir();
2684
2685
  try {
@@ -2718,6 +2719,19 @@ async function loadEmbedder(options = {}) {
2718
2719
  return fail(isPermissionError(e) ? "no-permission" : "download-failed");
2719
2720
  }
2720
2721
  }
2722
+ async function importEmbedBackend() {
2723
+ const hostDir = process.env.VIBGRATE_EMBEDDER_PATH;
2724
+ if (hostDir) {
2725
+ try {
2726
+ const req = createRequire(path19.join(hostDir, "package.json"));
2727
+ const mod = await import(pathToFileURL(req.resolve("fastembed")).href);
2728
+ const resolved = mod?.FlagEmbedding ? mod : mod?.default;
2729
+ if (resolved?.FlagEmbedding) return resolved;
2730
+ } catch {
2731
+ }
2732
+ }
2733
+ return await import('fastembed').catch(() => null);
2734
+ }
2721
2735
  function embedInitTimeoutMs() {
2722
2736
  const n = Number(process.env.VG_EMBED_TIMEOUT_MS);
2723
2737
  return Number.isFinite(n) && n > 0 ? n : 6e4;
@@ -7078,60 +7092,96 @@ var ASSISTANTS = [
7078
7092
  label: "Claude Code",
7079
7093
  skill: ".claude/skills/vg/SKILL.md",
7080
7094
  mcp: { file: ".mcp.json", key: "mcpServers" },
7081
- nudge: { file: "CLAUDE.md", kind: "block" }
7095
+ nudge: { file: "CLAUDE.md", kind: "block" },
7096
+ markers: ["CLAUDE.md", ".claude"],
7097
+ homeMarkers: [".claude", ".claude.json"],
7098
+ bin: ["claude"]
7082
7099
  },
7083
7100
  {
7084
7101
  id: "cursor",
7085
7102
  label: "Cursor",
7086
7103
  mcp: { file: ".cursor/mcp.json", key: "mcpServers" },
7087
- nudge: { file: ".cursor/rules/vg.mdc", kind: "file" }
7104
+ nudge: { file: ".cursor/rules/vg.mdc", kind: "file" },
7105
+ markers: [".cursor", ".cursorrules"],
7106
+ homeMarkers: [".cursor"],
7107
+ bin: ["cursor-agent"]
7088
7108
  },
7089
7109
  {
7090
7110
  id: "windsurf",
7091
7111
  label: "Windsurf",
7092
7112
  mcp: { file: ".windsurf/mcp.json", key: "mcpServers" },
7093
- nudge: { file: ".windsurf/rules/vg.md", kind: "file" }
7113
+ nudge: { file: ".windsurf/rules/vg.md", kind: "file" },
7114
+ markers: [".windsurf", ".windsurfrules"],
7115
+ homeMarkers: [".codeium/windsurf"]
7094
7116
  },
7095
7117
  {
7096
7118
  id: "vscode",
7097
7119
  label: "VS Code (Copilot Chat)",
7098
7120
  mcp: { file: ".vscode/mcp.json", key: "servers", vscode: true },
7099
- nudge: { file: ".github/copilot-instructions.md", kind: "block" }
7121
+ nudge: { file: ".github/copilot-instructions.md", kind: "block" },
7122
+ markers: [".github/copilot-instructions.md"]
7100
7123
  },
7101
7124
  {
7102
7125
  id: "codex",
7103
7126
  label: "Codex",
7104
7127
  skill: ".codex/skills/vg/SKILL.md",
7105
- nudge: { file: "AGENTS.md", kind: "block" }
7128
+ nudge: { file: "AGENTS.md", kind: "block" },
7129
+ markers: [".codex"],
7130
+ homeMarkers: [".codex"],
7131
+ bin: ["codex"]
7106
7132
  },
7107
7133
  {
7108
7134
  id: "gemini",
7109
7135
  label: "Gemini CLI",
7110
7136
  skill: ".gemini/skills/vg/SKILL.md",
7111
- nudge: { file: "GEMINI.md", kind: "block" }
7137
+ nudge: { file: "GEMINI.md", kind: "block" },
7138
+ markers: ["GEMINI.md", ".gemini"],
7139
+ homeMarkers: [".gemini"],
7140
+ bin: ["gemini"]
7112
7141
  },
7113
7142
  // Skill + advisory AGENTS.md nudge (the broad-reach common denominator). MCP
7114
7143
  // registration for these hosts is host-specific and added as their formats
7115
7144
  // stabilise; the skill + nudge work today.
7116
- { id: "opencode", label: "OpenCode", skill: ".opencode/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7117
- { id: "kilo", label: "Kilo Code", skill: ".kilo/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7118
- { id: "aider", label: "Aider", skill: ".aider/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7119
- { id: "factory", label: "Factory Droid", skill: ".factory/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7120
- { id: "trae", label: "Trae", skill: ".trae/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7121
- { id: "kiro", label: "Kiro", skill: ".kiro/skills/vg/SKILL.md", nudge: { file: ".kiro/steering/vg.md", kind: "file" } },
7122
- { id: "amp", label: "Amp", skill: ".agents/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7123
- { id: "kimi", label: "Kimi Code", skill: ".kimi/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7124
- { id: "codebuddy", label: "CodeBuddy", skill: ".codebuddy/skills/vg/SKILL.md", nudge: { file: "CODEBUDDY.md", kind: "block" } },
7125
- { id: "copilot-cli", label: "GitHub Copilot CLI", skill: ".copilot/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7126
- { id: "pi", label: "Pi", skill: ".pi/agent/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7127
- { id: "devin", label: "Devin CLI", skill: ".devin/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7128
- { id: "hermes", label: "Hermes", skill: ".hermes/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7129
- { id: "openclaw", label: "OpenClaw", skill: ".openclaw/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } },
7130
- { id: "agents", label: "Agent-Skills (generic)", skill: ".agents/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" } }
7145
+ { id: "grok", label: "Grok CLI", skill: ".grok/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".grok", "GROK.md"], homeMarkers: [".grok"], bin: ["grok"] },
7146
+ { id: "opencode", label: "OpenCode", skill: ".opencode/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".opencode", "opencode.json"], homeMarkers: [".config/opencode"], bin: ["opencode"] },
7147
+ { id: "kilo", label: "Kilo Code", skill: ".kilo/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".kilo", ".kilocode"], homeMarkers: [".kilocode"] },
7148
+ { id: "aider", label: "Aider", skill: ".aider/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".aider", ".aider.conf.yml"], homeMarkers: [".aider.conf.yml"], bin: ["aider"] },
7149
+ { id: "factory", label: "Factory Droid", skill: ".factory/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".factory"], homeMarkers: [".factory"], bin: ["droid"] },
7150
+ { id: "trae", label: "Trae", skill: ".trae/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".trae"], homeMarkers: [".trae"] },
7151
+ { id: "kiro", label: "Kiro", skill: ".kiro/skills/vg/SKILL.md", nudge: { file: ".kiro/steering/vg.md", kind: "file" }, markers: [".kiro"], homeMarkers: [".kiro"] },
7152
+ { id: "amp", label: "Amp", skill: ".agents/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, homeMarkers: [".config/amp"], bin: ["amp"] },
7153
+ { id: "kimi", label: "Kimi Code", skill: ".kimi/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".kimi"], homeMarkers: [".kimi"] },
7154
+ { id: "codebuddy", label: "CodeBuddy", skill: ".codebuddy/skills/vg/SKILL.md", nudge: { file: "CODEBUDDY.md", kind: "block" }, markers: ["CODEBUDDY.md", ".codebuddy"], homeMarkers: [".codebuddy"] },
7155
+ { id: "copilot-cli", label: "GitHub Copilot CLI", skill: ".copilot/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".copilot"], homeMarkers: [".copilot"], bin: ["copilot"] },
7156
+ { id: "pi", label: "Pi", skill: ".pi/agent/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".pi"], homeMarkers: [".pi"] },
7157
+ { id: "devin", label: "Devin CLI", skill: ".devin/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".devin"], homeMarkers: [".devin"] },
7158
+ { id: "hermes", label: "Hermes", skill: ".hermes/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".hermes"], homeMarkers: [".hermes"] },
7159
+ { id: "openclaw", label: "OpenClaw", skill: ".openclaw/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: [".openclaw"], homeMarkers: [".openclaw"], bin: ["openclaw"] },
7160
+ { id: "agents", label: "Agent-Skills (generic)", skill: ".agents/skills/vg/SKILL.md", nudge: { file: "AGENTS.md", kind: "block" }, markers: ["AGENTS.md", ".agents"] }
7131
7161
  ];
7132
7162
  function assistantById(id) {
7133
7163
  return ASSISTANTS.find((a) => a.id === id);
7134
7164
  }
7165
+ function detectAssistants(root, opts = {}) {
7166
+ const home = opts.home ?? os.homedir();
7167
+ const which = opts.which ?? whichOnPath;
7168
+ const found = [];
7169
+ for (const assistant of ASSISTANTS) {
7170
+ const repoHit = (assistant.markers ?? []).find((m) => fs19.existsSync(path19.join(root, m)));
7171
+ if (repoHit) {
7172
+ found.push({ assistant, via: "repo", marker: repoHit });
7173
+ continue;
7174
+ }
7175
+ const homeHit = (assistant.homeMarkers ?? []).find((m) => fs19.existsSync(path19.join(home, m)));
7176
+ if (homeHit) {
7177
+ found.push({ assistant, via: "home", marker: homeHit });
7178
+ continue;
7179
+ }
7180
+ const binHit = (assistant.bin ?? []).find((b) => which(b) !== null);
7181
+ if (binHit) found.push({ assistant, via: "path", marker: binHit });
7182
+ }
7183
+ return found;
7184
+ }
7135
7185
  function detectServeLaunch(which = whichOnPath) {
7136
7186
  const vg = which("vg");
7137
7187
  if (vg && isInstalledOwnBinary(vg)) return { command: "vg", args: ["serve"] };
@@ -7491,6 +7541,6 @@ function spdx(ctx) {
7491
7541
  return JSON.stringify(doc, null, 2) + "\n";
7492
7542
  }
7493
7543
 
7494
- export { ASSISTANTS, CLI_TOOL_ALIASES, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearStoredCredentials, cosine, countPending, countTokens, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocsCached, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, identifierParts, impactOf, indexFor, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, readUsage, recordCliCall, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, saveCatalog, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
7495
- //# sourceMappingURL=chunk-D4BPWARI.js.map
7496
- //# sourceMappingURL=chunk-D4BPWARI.js.map
7544
+ export { ASSISTANTS, CLI_TOOL_ALIASES, CliError, ECOSYSTEMS, ExitCode, FREE_PACK, GraphIndex, GraphSource, NPX_INVOCATION, ResourceLimitError, SCHEMA_VERSION, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, addLibrary, analyze, applyCoverage, applyStaticTestLinkage, assessDocQuality, assistantById, availableRegionIds, buildFacts, buildGraph, buildModuleResolver, cacheDir, catalogPath, clearModelCache, clearStoredCredentials, cosine, countPending, countTokens, coveringTests, createServer, createWorkspaceDsn, credentialsPath, dashHostForIngestHost, decodeScipIndex, defaultGraphPath, detectAssistants, detectRunner, detectServeLaunch, discover, discoverModels, driftCount, driftFor, dsnCommand, embeddingsCached, enrichOnline, ensureGitignored, epistemicBreakdown, exportGraph, fetchHostedDocsCached, findGitRoot, findNodes, formatForExt, getNodeEmbeddings, gitignoreEntryForCredentials, groundGraph, hasDrift, identifierParts, impactOf, indexFor, ingestHostForRegionId, installAssistant, inventory, isModelReady, isTestFile, libDir, libId, loadCatalog, loadCoverage, loadEmbedder, loadGraph, loadSnapshot, localApiSurface, localPackageDocs, modelCacheInfo, nodeById, nodeEmbedText, parseDsn, parseGraph, parseJsonc, probeFreshness, publishPrivateLibrary, pushCommand, queryGraph, queryGraphSemantic, readDoc, readSavings, readScanArtifact, readUsage, recordCliCall, recordSaving, refreshIfStale, relativeResolver, renderHtml, renderReport, resolveCliInvocation, resolveDsn, resolveEmbedModel, resolveIngestHost, resolveLib, resolveLimits, resolveOne, resolveVersion, saveCatalog, savingsRecorded, scipEdges, selectForBudget, serializeGraph, serveStdio, shortestPath, stableStringify, symbolsFromApi, testsToRun, unavailableMessage, uninstallAssistant, uploadScanArtifact, usageError, verifyDeterminism, vibgrateDir, writeArtifacts, writeNavigationConfig, writeSnapshot, writeStoredCredentials };
7545
+ //# sourceMappingURL=chunk-L42NVMD6.js.map
7546
+ //# sourceMappingURL=chunk-L42NVMD6.js.map