@swarmvaultai/cli 3.3.0 → 3.5.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.
Files changed (3) hide show
  1. package/README.md +28 -5
  2. package/dist/index.js +30 -4
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -52,6 +52,7 @@ swarmvault query "Turn this into slides" --format slides
52
52
  swarmvault explore "What should I research next?" --steps 3
53
53
  swarmvault lint --deep
54
54
  swarmvault graph blast ./src/index.ts
55
+ swarmvault graph update .
55
56
  swarmvault graph query "Which nodes bridge the biggest clusters?"
56
57
  swarmvault graph explain "concept:drift"
57
58
  swarmvault watch status
@@ -122,10 +123,11 @@ Run a whole-vault health check before handing the workspace to an agent or openi
122
123
 
123
124
  - checks workspace config and schema presence
124
125
  - reports graph, page, source, review, candidate, task, watch, migration, and retrieval state
126
+ - emits prioritized recommended next actions before the full check list
125
127
  - emits suggested follow-up commands for warnings and errors
126
128
  - supports `--json` for structured automation output
127
129
  - add `--repair` to rebuild safe derived retrieval artifacts
128
- - the live viewer workbench shows the same checks with details and copyable suggested commands
130
+ - the live viewer workbench shows the same recommendations and checks with details, copyable suggested commands, and safe direct repair
129
131
 
130
132
  ### `swarmvault source add|list|reload|review|guide|session|delete`
131
133
 
@@ -371,6 +373,16 @@ When `--repo` sees only code-file changes under tracked repo roots, SwarmVault t
371
373
 
372
374
  Show watched repo roots, the latest watch run, and any pending semantic refresh entries for tracked non-code repo changes.
373
375
 
376
+ ### `swarmvault graph update [path]`
377
+
378
+ Refresh code-derived graph artifacts from tracked repo roots or one explicit repo path.
379
+
380
+ - aliases to `swarmvault graph refresh [path]`
381
+ - runs the same code-only repo refresh path as `swarmvault watch --repo --code-only --once`
382
+ - without `path`, uses configured or auto-discovered watched repo roots
383
+ - with `path`, refreshes that repo root instead of the tracked set
384
+ - `--json` returns the same one-shot watch result shape, including repo import/update/remove counts and pending semantic refresh entries
385
+
374
386
  ### `swarmvault hook install|uninstall|status`
375
387
 
376
388
  Manage SwarmVault's local git hook blocks for the nearest git repository.
@@ -413,8 +425,17 @@ Run SwarmVault as a local MCP server over stdio. This exposes the vault to compa
413
425
  - `rebuild_retrieval`
414
426
  - `doctor_retrieval`
415
427
  - `doctor_vault`
416
-
417
- `compile_vault` also accepts `maxTokens` for bounded wiki output, `blast_radius` traces reverse import impact for a file or module target, `build_context_pack` creates the same bounded agent evidence bundles as `swarmvault context build`, the task tools mirror `swarmvault task`, the memory tools mirror the compatibility command group, `doctor_vault` mirrors `swarmvault doctor`, and retrieval tools inspect or repair the local index.
428
+ - `query_graph`
429
+ - `graph_report`
430
+ - `graph_stats`
431
+ - `get_node`
432
+ - `get_community`
433
+ - `get_neighbors`
434
+ - `get_hyperedges`
435
+ - `shortest_path`
436
+ - `god_nodes`
437
+
438
+ `compile_vault` also accepts `maxTokens` for bounded wiki output, `graph_stats` returns lightweight graph counts, `get_community` resolves community members and pages, `blast_radius` traces reverse import impact for a file or module target, `build_context_pack` creates the same bounded agent evidence bundles as `swarmvault context build`, the task tools mirror `swarmvault task`, the memory tools mirror the compatibility command group, `doctor_vault` mirrors `swarmvault doctor`, and retrieval tools inspect or repair the local index.
418
439
 
419
440
  The MCP surface also exposes `swarmvault://schema`, `swarmvault://sessions`, `swarmvault://sessions/{path}`, `swarmvault://context-packs`, `swarmvault://tasks`, `swarmvault://memory-tasks`, and includes `schemaPath` in `workspace_info`.
420
441
 
@@ -422,9 +443,9 @@ The MCP surface also exposes `swarmvault://schema`, `swarmvault://sessions`, `sw
422
443
 
423
444
  Start the local graph workspace backed by `state/graph.json`, `/api/search`, `/api/page`, local graph query/path/explain endpoints, and the workbench APIs for doctor, retrieval repair, capture, context packs, task start, and source reload.
424
445
 
425
- The workbench renders every vault doctor check with details, suggested commands that can be copied back to a terminal, safe one-click retrieval repair through `doctor --repair`, selectable capture modes (`ingest`, normalized `add`, or `inbox`), editable token budgets for context packs and task starts, and action receipts after workbench operations complete.
446
+ The workbench renders prioritized vault doctor recommendations, every check with details, suggested commands that can be copied back to a terminal, safe one-click retrieval repair through `doctor --repair`, selectable capture modes (`ingest`, normalized `add`, or `inbox`), title/tag capture fields, editable token budgets for context packs and task starts, and action receipts after workbench operations complete.
426
447
 
427
- It also exposes `/api/bookmarklet` and `/api/clip`, so a running local viewer can capture the current browser URL, selected text, markdown, HTML excerpts, and tags through the workbench or bookmarklet without leaving the browser.
448
+ It also exposes `/api/bookmarklet` and `/api/clip`, so a running local viewer can capture the current browser URL, page title, selected text, markdown, HTML excerpts, and tags through the workbench or bookmarklet without leaving the browser. URL-only bookmarklet clips use normalized `add`; selected text is imported through the inbox path.
428
449
 
429
450
  ### `swarmvault graph query "<question>" [--dfs] [--budget <n>]`
430
451
 
@@ -509,6 +530,7 @@ Install agent-specific rules into the current project so an agent understands th
509
530
  Hook-capable installs:
510
531
 
511
532
  ```bash
533
+ swarmvault install --agent codex --hook
512
534
  swarmvault install --agent claude --hook
513
535
  swarmvault install --agent gemini --hook
514
536
  swarmvault install --agent opencode --hook
@@ -529,6 +551,7 @@ Agent target mapping:
529
551
 
530
552
  Hook semantics:
531
553
 
554
+ - `codex --hook` writes `.codex/hooks.json` plus `.codex/hooks/swarmvault-graph-first.js` and emits model-visible guidance before broad shell search
532
555
  - `claude --hook` writes `.claude/settings.json` plus `.claude/hooks/swarmvault-graph-first.js` and adds model-visible advisory context through structured hook JSON
533
556
  - `gemini --hook` writes `.gemini/settings.json` plus `.gemini/hooks/swarmvault-graph-first.js` and stays advisory/model-visible
534
557
  - `opencode --hook` writes `.opencode/plugins/swarmvault-graph-first.js` and stays advisory/log-only
package/dist/index.js CHANGED
@@ -309,9 +309,9 @@ program.name("swarmvault").description("SwarmVault is a local-first knowledge co
309
309
  function readCliVersion() {
310
310
  try {
311
311
  const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
312
- return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "3.3.0";
312
+ return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "3.5.0";
313
313
  } catch {
314
- return "3.3.0";
314
+ return "3.5.0";
315
315
  }
316
316
  }
317
317
  function parsePositiveInt(value, fallback) {
@@ -1134,6 +1134,22 @@ program.command("lint").description("Run anti-drift and wiki-health checks.").op
1134
1134
  });
1135
1135
  var graph = program.command("graph").description("Graph-related commands.").enablePositionalOptions();
1136
1136
  var graphPush = graph.command("push").description("Push the compiled graph into external sinks.");
1137
+ graph.command("update").alias("refresh").description("Refresh code-derived graph artifacts from tracked repo roots or one explicit repo path.").argument("[path]", "Optional repo root to refresh instead of configured/tracked roots").option("--lint", "Run lint after the refresh cycle", false).action(async (targetPath, options) => {
1138
+ const overrideRoots = targetPath ? [path2.resolve(process2.cwd(), targetPath)] : void 0;
1139
+ const result = await runWatchCycle(process2.cwd(), {
1140
+ repo: true,
1141
+ codeOnly: true,
1142
+ lint: options.lint ?? false,
1143
+ overrideRoots
1144
+ });
1145
+ if (isJson()) {
1146
+ emitJson(result);
1147
+ return;
1148
+ }
1149
+ log(
1150
+ `Updated graph from ${result.watchedRepoRoots.length} repo root${result.watchedRepoRoots.length === 1 ? "" : "s"}. Imported ${result.repoImportedCount}, updated ${result.repoUpdatedCount}, removed ${result.repoRemovedCount}, pending semantic refresh ${result.pendingSemanticRefreshCount}.`
1151
+ );
1152
+ });
1137
1153
  graphPush.command("neo4j").description("Push the compiled graph directly into Neo4j over Bolt/Aura.").option("--uri <bolt-uri>", "Neo4j Bolt or Aura URI").option("--username <user>", "Neo4j username").option("--password-env <env-var>", "Environment variable containing the Neo4j password").option("--database <name>", "Neo4j database name").option("--vault-id <id>", "Stable vault identifier used for shared-database namespacing").option("--batch-size <n>", "Maximum rows to write per Neo4j transaction batch").option("--include-third-party", "Also push third-party repo material", false).option("--include-resources", "Also push resource-like content", false).option("--include-generated", "Also push generated output", false).option("--dry-run", "Show what would be pushed without writing to Neo4j", false).action(
1138
1154
  async (options) => {
1139
1155
  const batchSize = typeof options.batchSize === "string" && options.batchSize.trim() ? parsePositiveInt(options.batchSize, 0) || void 0 : void 0;
@@ -1717,9 +1733,9 @@ program.command("install").description("Install SwarmVault instructions for an a
1717
1733
  "claude, codex, cursor, gemini, goose, opencode, copilot, aider, droid, pi, trae, claw, kiro, hermes, antigravity, vscode, amp, augment, adal, bob, cline, codebuddy, command-code, continue, cortex, crush, deepagents, firebender, iflow, junie, kilo-code, kimi, kode, mcpjam, mistral-vibe, mux, neovate, openclaw, openhands, pochi, qoder, qwen-code, replit, roo-code, trae-cn, warp, windsurf, or zencoder"
1718
1734
  ).option("--hook", "Also install hook/plugin guidance when the target agent supports it", false).action(
1719
1735
  async (options) => {
1720
- const hookCapableAgents = /* @__PURE__ */ new Set(["claude", "opencode", "gemini", "copilot"]);
1736
+ const hookCapableAgents = /* @__PURE__ */ new Set(["codex", "claude", "opencode", "gemini", "copilot"]);
1721
1737
  if (options.hook && !hookCapableAgents.has(options.agent)) {
1722
- throw new Error("--hook is only supported for --agent claude, opencode, gemini, or copilot");
1738
+ throw new Error("--hook is only supported for --agent codex, claude, opencode, gemini, or copilot");
1723
1739
  }
1724
1740
  const result = await installAgent(process2.cwd(), options.agent, { hook: options.hook ?? false });
1725
1741
  if (isJson()) {
@@ -2024,6 +2040,16 @@ program.command("doctor").description("Diagnose vault health across graph, retri
2024
2040
  log(
2025
2041
  `Sources ${report.counts.sources} | Managed ${report.counts.managedSources} | Pages ${report.counts.pages} | Nodes ${report.counts.nodes} | Edges ${report.counts.edges}`
2026
2042
  );
2043
+ if (report.recommendations.length) {
2044
+ log("Recommended next actions:");
2045
+ for (const recommendation of report.recommendations) {
2046
+ const action = recommendation.command ? ` ${recommendation.command}` : "";
2047
+ log(` [${recommendation.priority}] ${recommendation.label}:${action}`);
2048
+ if (recommendation.description) {
2049
+ log(` ${recommendation.description}`);
2050
+ }
2051
+ }
2052
+ }
2027
2053
  for (const check of report.checks) {
2028
2054
  log(`[${check.status}] ${check.label}: ${check.summary}`);
2029
2055
  if (check.detail) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/cli",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Global CLI for SwarmVault.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "prepublishOnly": "node ../../scripts/check-release-sync.mjs && node ../../scripts/check-published-manifests.mjs"
45
45
  },
46
46
  "dependencies": {
47
- "@swarmvaultai/engine": "3.3.0",
47
+ "@swarmvaultai/engine": "3.5.0",
48
48
  "commander": "^14.0.1"
49
49
  },
50
50
  "devDependencies": {