@swarmvaultai/cli 0.1.2 → 0.1.4

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 +51 -15
  2. package/dist/index.js +32 -2
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @swarmvaultai/cli
2
2
 
3
- `@swarmvaultai/cli` is the globally installable entry point for SwarmVault.
3
+ `@swarmvaultai/cli` is the global command-line entry point for SwarmVault.
4
4
 
5
- It gives you the `swarmvault` command for creating and operating a local-first LLM knowledge vault that compiles into markdown, graph data, and local search artifacts.
5
+ It gives you the `swarmvault` command for building a local-first knowledge vault from files, URLs, browser clips, and saved query outputs.
6
6
 
7
7
  ## Install
8
8
 
@@ -23,9 +23,10 @@ Installed commands:
23
23
  mkdir my-vault
24
24
  cd my-vault
25
25
  swarmvault init
26
+ sed -n '1,120p' swarmvault.schema.md
26
27
  swarmvault ingest ./notes.md
27
28
  swarmvault compile
28
- swarmvault query "What themes keep recurring?" --save
29
+ swarmvault query "What keeps recurring?" --save
29
30
  swarmvault graph serve
30
31
  ```
31
32
 
@@ -33,47 +34,76 @@ swarmvault graph serve
33
34
 
34
35
  ### `swarmvault init`
35
36
 
36
- Creates a new SwarmVault workspace in the current directory, including:
37
+ Create a workspace with:
37
38
 
39
+ - `inbox/`
38
40
  - `raw/`
39
41
  - `wiki/`
40
42
  - `state/`
41
43
  - `agent/`
42
44
  - `swarmvault.config.json`
45
+ - `swarmvault.schema.md`
46
+
47
+ The schema file is the vault-specific instruction layer. Edit it to define naming rules, categories, grounding expectations, and exclusions before a serious compile.
43
48
 
44
49
  ### `swarmvault ingest <path-or-url>`
45
50
 
46
- Adds a local file or URL to the vault and records a manifest in `state/manifests/`.
51
+ Ingest a local file path or URL into immutable source storage and write a manifest to `state/manifests/`.
52
+
53
+ ### `swarmvault inbox import [dir]`
54
+
55
+ Import supported files from the configured inbox directory. This is meant for browser-clipper style markdown bundles and other capture workflows. Local image and asset references are preserved and copied into canonical storage under `raw/assets/`.
47
56
 
48
57
  ### `swarmvault compile`
49
58
 
50
- Compiles the current manifests into:
59
+ Compile the current manifests into:
51
60
 
52
61
  - generated markdown in `wiki/`
53
62
  - structured graph data in `state/graph.json`
54
63
  - local search data in `state/search.sqlite`
55
64
 
65
+ The compiler also reads `swarmvault.schema.md` and records a `schema_hash` in generated pages so schema edits can mark pages stale.
66
+
56
67
  ### `swarmvault query "<question>" [--save]`
57
68
 
58
- Queries the compiled vault. Use `--save` to write the result into `wiki/outputs/` so the answer becomes part of the vault.
69
+ Query the compiled vault. The query layer also reads `swarmvault.schema.md`, so answers follow the vault’s own structure and grounding rules. With `--save`, the answer is written into `wiki/outputs/` so the result becomes part of the vault.
59
70
 
60
71
  ### `swarmvault lint`
61
72
 
62
- Runs anti-drift checks and other health checks against the current vault state.
73
+ Run anti-drift and vault health checks such as stale pages, missing graph artifacts, and other structural issues.
74
+
75
+ ### `swarmvault watch [--lint] [--debounce <ms>]`
76
+
77
+ Watch the inbox directory and trigger import and compile cycles when files change. With `--lint`, each cycle also runs linting. Run metadata is appended to `state/jobs.ndjson`.
78
+
79
+ ### `swarmvault mcp`
80
+
81
+ Run SwarmVault as a local MCP server over stdio. This exposes the vault to compatible clients and agents through tools and resources such as:
82
+
83
+ - `workspace_info`
84
+ - `search_pages`
85
+ - `read_page`
86
+ - `list_sources`
87
+ - `query_vault`
88
+ - `ingest_input`
89
+ - `compile_vault`
90
+ - `lint_vault`
91
+
92
+ The MCP surface also exposes `swarmvault://schema` and includes `schemaPath` in `workspace_info`.
63
93
 
64
94
  ### `swarmvault graph serve`
65
95
 
66
- Starts the local graph UI backed by `state/graph.json`.
96
+ Start the local graph UI backed by `state/graph.json`.
67
97
 
68
98
  ### `swarmvault install --agent <codex|claude|cursor>`
69
99
 
70
- Writes agent-specific rules into the current project so your coding agent understands the SwarmVault directory contract and workflow.
100
+ Install agent-specific rules into the current project so an agent understands the SwarmVault workspace contract and workflow.
71
101
 
72
102
  ## Provider Configuration
73
103
 
74
- SwarmVault defaults to a local heuristic provider so the CLI can run without API keys, but real vaults should usually point at an actual model provider.
104
+ SwarmVault defaults to a local `heuristic` provider so the CLI works without API keys, but real vaults will usually point at an actual model provider.
75
105
 
76
- Inside an existing `swarmvault.config.json`, your `providers` and `tasks` sections can look like this:
106
+ Example:
77
107
 
78
108
  ```json
79
109
  {
@@ -94,10 +124,16 @@ Inside an existing `swarmvault.config.json`, your `providers` and `tasks` sectio
94
124
  }
95
125
  ```
96
126
 
97
- Generic OpenAI-compatible APIs are also supported through config alone when the provider follows the same request shape closely enough.
127
+ Generic OpenAI-compatible APIs are supported through config when the provider follows the OpenAI request shape closely enough.
98
128
 
99
129
  ## Troubleshooting
100
130
 
101
- - If `graph serve` says the viewer build is missing, run `pnpm build` in the repository first
131
+ - If you are running from a source checkout and `graph serve` says the viewer build is missing, run `pnpm build` in the repository first
102
132
  - If a provider claims OpenAI compatibility but fails structured generation, declare only the capabilities it actually supports
103
- - Node 24 may emit an experimental warning for `node:sqlite`; this is expected in the current release
133
+ - Node 24 may emit an experimental warning for `node:sqlite`; that is expected in the current release
134
+
135
+ ## Links
136
+
137
+ - Website: https://www.swarmvault.ai
138
+ - Docs: https://www.swarmvault.ai/docs
139
+ - GitHub: https://github.com/swarmclawai/swarmvault
package/dist/index.js CHANGED
@@ -5,15 +5,18 @@ import { Command } from "commander";
5
5
  import process from "process";
6
6
  import {
7
7
  compileVault,
8
+ importInbox,
8
9
  ingestInput,
9
10
  initVault,
10
11
  installAgent,
11
12
  lintVault,
12
13
  queryVault,
13
- startGraphServer
14
+ startGraphServer,
15
+ startMcpServer,
16
+ watchVault
14
17
  } from "@swarmvaultai/engine";
15
18
  var program = new Command();
16
- program.name("swarmvault").description("SwarmVault is a local-first LLM wiki compiler with graph outputs and pluggable providers.").version("0.1.2");
19
+ program.name("swarmvault").description("SwarmVault is a local-first LLM wiki compiler with graph outputs and pluggable providers.").version("0.1.4");
17
20
  program.command("init").description("Initialize a SwarmVault workspace in the current directory.").action(async () => {
18
21
  await initVault(process.cwd());
19
22
  process.stdout.write("Initialized SwarmVault workspace.\n");
@@ -23,6 +26,14 @@ program.command("ingest").description("Ingest a local file path or URL into the
23
26
  process.stdout.write(`${manifest.sourceId}
24
27
  `);
25
28
  });
29
+ var inbox = program.command("inbox").description("Inbox and capture workflows.");
30
+ inbox.command("import").description("Import supported files from the configured inbox directory.").argument("[dir]", "Optional inbox directory override").action(async (dir) => {
31
+ const result = await importInbox(process.cwd(), dir);
32
+ process.stdout.write(
33
+ `Imported ${result.imported.length} source(s) from ${result.inputDir}. Scanned: ${result.scannedCount}. Attachments: ${result.attachmentCount}. Skipped: ${result.skipped.length}.
34
+ `
35
+ );
36
+ });
26
37
  program.command("compile").description("Compile manifests into wiki pages, graph JSON, and search index.").action(async () => {
27
38
  const result = await compileVault(process.cwd());
28
39
  process.stdout.write(
@@ -63,6 +74,25 @@ graph.command("serve").description("Serve the local graph viewer.").option("--po
63
74
  process.exit(0);
64
75
  });
65
76
  });
77
+ program.command("watch").description("Watch the inbox directory and run import/compile cycles on changes.").option("--lint", "Run lint after each compile cycle", false).option("--debounce <ms>", "Debounce window in milliseconds", "900").action(async (options) => {
78
+ const debounceMs = Number.parseInt(options.debounce ?? "900", 10);
79
+ const controller = await watchVault(process.cwd(), {
80
+ lint: options.lint ?? false,
81
+ debounceMs: Number.isFinite(debounceMs) ? debounceMs : 900
82
+ });
83
+ process.stdout.write("Watching inbox for changes. Press Ctrl+C to stop.\n");
84
+ process.on("SIGINT", async () => {
85
+ await controller.close();
86
+ process.exit(0);
87
+ });
88
+ });
89
+ program.command("mcp").description("Run SwarmVault as a local MCP server over stdio.").action(async () => {
90
+ const controller = await startMcpServer(process.cwd());
91
+ process.on("SIGINT", async () => {
92
+ await controller.close();
93
+ process.exit(0);
94
+ });
95
+ });
66
96
  program.command("install").description("Install SwarmVault instructions for an agent in the current project.").requiredOption("--agent <agent>", "codex, claude, or cursor").action(async (options) => {
67
97
  const target = await installAgent(process.cwd(), options.agent);
68
98
  process.stdout.write(`Installed rules into ${target}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Global CLI for SwarmVault.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,7 +12,7 @@
12
12
  "type": "git",
13
13
  "url": "git+https://github.com/swarmclawai/swarmvault.git"
14
14
  },
15
- "homepage": "https://swarmvault.ai",
15
+ "homepage": "https://www.swarmvault.ai",
16
16
  "bugs": {
17
17
  "url": "https://github.com/swarmclawai/swarmvault/issues"
18
18
  },
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "commander": "^14.0.1",
42
- "@swarmvaultai/engine": "0.1.2"
42
+ "@swarmvaultai/engine": "0.1.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^24.6.0",