@swarmvaultai/cli 0.7.22 → 0.7.24

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 +26 -5
  2. package/dist/index.js +38 -3
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -70,7 +70,19 @@ Create a workspace with:
70
70
 
71
71
  The schema file is the vault-specific instruction layer. Edit it to define naming rules, categories, grounding expectations, and exclusions before a serious compile.
72
72
 
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`.
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` preset 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
+
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.
74
86
 
75
87
  ### `swarmvault source add|list|reload|review|guide|session|delete`
76
88
 
@@ -100,6 +112,15 @@ Useful flags:
100
112
 
101
113
  Managed sources write registry state to `state/sources.json`. Guided sessions write durable anchors to `wiki/outputs/source-sessions/` and session state to `state/source-sessions/`. In an interactive TTY, `--guide` can ask the session questions immediately; otherwise use `source session <id>` or `--answers-file <path>` to resume and stage the approval bundle later. Local directory entries remain compatible with `watch --repo`; remote GitHub and docs-crawl sources are manual `source reload` sources in this release.
102
114
 
115
+ Source-scoped artifacts are intentionally split by role:
116
+
117
+ | Artifact | Created by | Purpose |
118
+ |----------|-----------|---------|
119
+ | Source brief | `source add`, `ingest` (always) | Auto summary written to `wiki/outputs/source-briefs/` |
120
+ | Source review | `source review`, `source add --guide`, `ingest --review`, `ingest --guide` | Lighter staged assessment in `wiki/outputs/source-reviews/` |
121
+ | Source guide | `source guide`, `source add --guide`, `ingest --guide` | Guided walkthrough with approval-bundled updates in `wiki/outputs/source-guides/` |
122
+ | Source session | `source session`, `source add --guide`, `ingest --guide` | Resumable workflow state in `wiki/outputs/source-sessions/` and `state/source-sessions/` |
123
+
103
124
  ### `swarmvault ingest <path-or-url>`
104
125
 
105
126
  Ingest a local file path, directory path, or URL into immutable source storage and write manifests to `state/manifests/`.
@@ -240,13 +261,13 @@ Run anti-drift and vault health checks such as stale pages, missing graph artifa
240
261
 
241
262
  Set `profile.deepLintDefault: true` when deep lint should be the default for `swarmvault lint`, and use `--no-deep` when one run should stay structural only.
242
263
 
243
- `--web` can only be used when deep lint is enabled, either explicitly with `--deep` or through `profile.deepLintDefault`. It enriches deep-lint findings with external evidence snippets and URLs from a configured web-search provider.
264
+ `--web` can only be used when deep lint is enabled, either explicitly with `--deep` or through `profile.deepLintDefault`. It enriches deep-lint findings with external evidence snippets and URLs from a configured web-search provider. Web search is currently scoped to deep lint; other commands (compile, query, explore) use only local vault state.
244
265
 
245
266
  `--conflicts` filters the results down to contradiction-focused findings so you can audit conflicting claims without the rest of the lint output.
246
267
 
247
- ### `swarmvault watch [--lint] [--repo] [--once] [--debounce <ms>]`
268
+ ### `swarmvault watch [--lint] [--repo] [--once] [--code-only] [--debounce <ms>]`
248
269
 
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`.
270
+ 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
271
 
251
272
  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
273
 
@@ -264,7 +285,7 @@ Manage SwarmVault's local git hook blocks for the nearest git repository.
264
285
  - `hook uninstall` removes only the SwarmVault-managed hook block
265
286
  - `hook status` reports whether those managed hook blocks are installed
266
287
 
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.
288
+ 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
289
 
269
290
  ### `swarmvault mcp`
270
291
 
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.24";
274
274
  } catch {
275
- return "0.7.22";
275
+ return "0.7.24";
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.24",
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.24",
42
42
  "commander": "^14.0.1"
43
43
  },
44
44
  "devDependencies": {