@swarmvaultai/cli 0.7.22 → 0.7.23

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 +15 -3
  2. package/dist/index.js +38 -3
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -72,6 +72,18 @@ The schema file is the vault-specific instruction layer. Edit it to define namin
72
72
 
73
73
  `--profile` accepts `default`, `personal-research`, or a comma-separated preset list such as `reader,timeline`. For fully custom vault behavior, edit the `profile` block in `swarmvault.config.json`; that deterministic profile layer works alongside the human-written `swarmvault.schema.md`. The `personal-research` starter profile also sets `profile.guidedIngestDefault: true` and `profile.deepLintDefault: true`, so guided ingest/source and lint flows are on by default until you override them with `--no-guide` or `--no-deep`.
74
74
 
75
+ ### `swarmvault scan <directory> [--port <port>] [--no-serve]`
76
+
77
+ Quick-start a scratch vault from a local directory in one command.
78
+
79
+ - initializes the current directory as a SwarmVault workspace
80
+ - ingests the supplied directory as local sources
81
+ - compiles the vault immediately
82
+ - starts `graph serve` unless you pass `--no-serve`
83
+ - respects `--port` when you want a specific viewer port
84
+
85
+ Use this when you want the fastest repo or docs-tree walkthrough without first deciding on managed-source registration.
86
+
75
87
  ### `swarmvault source add|list|reload|review|guide|session|delete`
76
88
 
77
89
  Manage recurring source roots through a registry-backed workflow.
@@ -244,9 +256,9 @@ Set `profile.deepLintDefault: true` when deep lint should be the default for `sw
244
256
 
245
257
  `--conflicts` filters the results down to contradiction-focused findings so you can audit conflicting claims without the rest of the lint output.
246
258
 
247
- ### `swarmvault watch [--lint] [--repo] [--once] [--debounce <ms>]`
259
+ ### `swarmvault watch [--lint] [--repo] [--once] [--code-only] [--debounce <ms>]`
248
260
 
249
- Watch the inbox directory and trigger import and compile cycles when files change. With `--repo`, each cycle also refreshes tracked repo roots that were previously ingested through directory ingest. With `--once`, SwarmVault runs one refresh cycle immediately instead of starting a long-running watcher. With `--lint`, each cycle also runs linting. Each cycle writes a canonical session artifact to `state/sessions/`, and compatibility run metadata is still appended to `state/jobs.ndjson`.
261
+ Watch the inbox directory and trigger import and compile cycles when files change. With `--repo`, each cycle also refreshes tracked repo roots that were previously ingested through directory ingest. With `--once`, SwarmVault runs one refresh cycle immediately instead of starting a long-running watcher. With `--code-only`, SwarmVault forces the narrower AST-only refresh path and skips non-code semantic re-analysis until you run a normal `compile`. With `--lint`, each cycle also runs linting. Each cycle writes a canonical session artifact to `state/sessions/`, and compatibility run metadata is still appended to `state/jobs.ndjson`.
250
262
 
251
263
  When `--repo` sees non-code changes under tracked repo roots, SwarmVault records those files under `state/watch/pending-semantic-refresh.json`, marks affected compiled pages stale, and exposes the pending set through `watch status` and the local graph workspace instead of silently re-ingesting them.
252
264
 
@@ -264,7 +276,7 @@ Manage SwarmVault's local git hook blocks for the nearest git repository.
264
276
  - `hook uninstall` removes only the SwarmVault-managed hook block
265
277
  - `hook status` reports whether those managed hook blocks are installed
266
278
 
267
- The installed hooks run `swarmvault watch --repo --once` from the vault root so repo-aware source changes are re-ingested and recompiled after commit and checkout.
279
+ The installed hooks run `swarmvault watch --repo --once --code-only` from the vault root so commit and checkout refreshes update code pages and graph structure quickly. Run a normal `swarmvault compile` when you also want non-code semantic re-analysis.
268
280
 
269
281
  ### `swarmvault mcp`
270
282
 
package/dist/index.js CHANGED
@@ -270,9 +270,9 @@ program.name("swarmvault").description("SwarmVault is a local-first knowledge co
270
270
  function readCliVersion() {
271
271
  try {
272
272
  const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
273
- return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.7.22";
273
+ return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.7.23";
274
274
  } catch {
275
- return "0.7.22";
275
+ return "0.7.23";
276
276
  }
277
277
  }
278
278
  function parsePositiveInt(value, fallback) {
@@ -981,12 +981,13 @@ candidate.command("archive").description("Archive a candidate by removing it fro
981
981
  log(`Archived ${result.pageId}`);
982
982
  }
983
983
  });
984
- var watch = program.command("watch").description("Watch the inbox directory and optionally tracked repos, or run one refresh cycle immediately.").option("--lint", "Run lint after each compile cycle", false).option("--repo", "Also refresh tracked repo sources and watch their repo roots", false).option("--once", "Run one import/refresh cycle immediately instead of starting a watcher", false).option("--debounce <ms>", "Debounce window in milliseconds", "900").action(async (options) => {
984
+ var watch = program.command("watch").description("Watch the inbox directory and optionally tracked repos, or run one refresh cycle immediately.").option("--lint", "Run lint after each compile cycle", false).option("--repo", "Also refresh tracked repo sources and watch their repo roots", false).option("--once", "Run one import/refresh cycle immediately instead of starting a watcher", false).option("--code-only", "Only re-extract code sources (AST-only, no LLM re-analysis)", false).option("--debounce <ms>", "Debounce window in milliseconds", "900").action(async (options) => {
985
985
  const debounceMs = parsePositiveInt(options.debounce, 900);
986
986
  if (options.once) {
987
987
  const result = await runWatchCycle(process2.cwd(), {
988
988
  lint: options.lint ?? false,
989
989
  repo: options.repo ?? false,
990
+ codeOnly: options.codeOnly ?? false,
990
991
  debounceMs
991
992
  });
992
993
  if (isJson()) {
@@ -1002,6 +1003,7 @@ var watch = program.command("watch").description("Watch the inbox directory and
1002
1003
  const controller = await watchVault(process2.cwd(), {
1003
1004
  lint: options.lint ?? false,
1004
1005
  repo: options.repo ?? false,
1006
+ codeOnly: options.codeOnly ?? false,
1005
1007
  debounceMs
1006
1008
  });
1007
1009
  if (isJson()) {
@@ -1139,6 +1141,39 @@ program.command("install").description("Install SwarmVault instructions for an a
1139
1141
  }
1140
1142
  }
1141
1143
  );
1144
+ program.command("scan").description("Quick-start: initialize, ingest, compile, and serve a graph viewer in one command.").argument("<directory>", "Directory to scan").option("--port <port>", "Port for the graph viewer").option("--no-serve", "Skip launching the graph viewer after compile").action(async (directory, options) => {
1145
+ const rootDir = process2.cwd();
1146
+ await initVault(rootDir, {});
1147
+ if (!isJson()) {
1148
+ log("Initialized workspace.");
1149
+ }
1150
+ const result = await ingestDirectory(rootDir, directory, {});
1151
+ if (!isJson()) {
1152
+ log(`Ingested ${result.imported.length} file(s).`);
1153
+ }
1154
+ const compiled = await compileVault(rootDir, {});
1155
+ if (!isJson()) {
1156
+ log(`Compiled ${compiled.sourceCount} source(s), ${compiled.pageCount} page(s).`);
1157
+ }
1158
+ if (options.serve !== false) {
1159
+ const port = options.port ? parsePositiveInt(options.port, 0) || void 0 : void 0;
1160
+ const server = await startGraphServer(rootDir, port, { full: false });
1161
+ if (isJson()) {
1162
+ emitJson({ ...result, compiled, port: server.port, url: `http://localhost:${server.port}` });
1163
+ } else {
1164
+ log(`Graph viewer running at http://localhost:${server.port}`);
1165
+ }
1166
+ process2.on("SIGINT", async () => {
1167
+ try {
1168
+ await server.close();
1169
+ } catch {
1170
+ }
1171
+ process2.exit(0);
1172
+ });
1173
+ } else if (isJson()) {
1174
+ emitJson({ ...result, compiled });
1175
+ }
1176
+ });
1142
1177
  program.parseAsync(process2.argv).catch((error) => {
1143
1178
  const message = error instanceof Error ? error.message : String(error);
1144
1179
  if (isJson()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/cli",
3
- "version": "0.7.22",
3
+ "version": "0.7.23",
4
4
  "description": "Global CLI for SwarmVault.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "node": ">=24.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@swarmvaultai/engine": "0.7.22",
41
+ "@swarmvaultai/engine": "0.7.23",
42
42
  "commander": "^14.0.1"
43
43
  },
44
44
  "devDependencies": {