@swarmvaultai/engine 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -2
  3. package/package.json +22 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SwarmVault
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # @swarmvaultai/engine
2
2
 
3
- Core library for SwarmVault.
3
+ `@swarmvaultai/engine` is the runtime library behind SwarmVault.
4
4
 
5
- It provides the ingest, compile, query, lint, provider, search, and graph-generation primitives used by the CLI.
5
+ It provides the ingest, compile, query, lint, provider, graph, search, and viewer-serving primitives used by the CLI.
6
+
7
+ ## Who This Is For
8
+
9
+ Use this package if you want to:
10
+
11
+ - build your own interface on top of the SwarmVault runtime
12
+ - integrate vault operations into another Node application
13
+ - customize provider loading or workspace orchestration without shelling out to the CLI
14
+
15
+ If you only want to use SwarmVault as a tool, install `@swarmvaultai/cli` instead.
16
+
17
+ ## Core Exports
18
+
19
+ ```ts
20
+ import {
21
+ compileVault,
22
+ createProvider,
23
+ defaultVaultConfig,
24
+ ingestInput,
25
+ initVault,
26
+ installAgent,
27
+ lintVault,
28
+ loadVaultConfig,
29
+ queryVault,
30
+ startGraphServer
31
+ } from "@swarmvaultai/engine";
32
+ ```
33
+
34
+ The engine also exports the main runtime types for providers, graph artifacts, pages, manifests, and lint findings.
35
+
36
+ ## Example
37
+
38
+ ```ts
39
+ import { compileVault, ingestInput, initVault, queryVault } from "@swarmvaultai/engine";
40
+
41
+ const rootDir = process.cwd();
42
+
43
+ await initVault(rootDir);
44
+ await ingestInput(rootDir, "./research.md");
45
+ await compileVault(rootDir);
46
+
47
+ const result = await queryVault(rootDir, "What changed most recently?", true);
48
+ console.log(result.answer);
49
+ ```
50
+
51
+ ## Provider Model
52
+
53
+ The engine supports:
54
+
55
+ - `openai`
56
+ - `ollama`
57
+ - `anthropic`
58
+ - `gemini`
59
+ - `openai-compatible`
60
+ - `custom`
61
+ - `heuristic`
62
+
63
+ Providers are validated through capabilities such as:
64
+
65
+ - `chat`
66
+ - `structured`
67
+ - `vision`
68
+ - `tools`
69
+ - `embeddings`
70
+ - `streaming`
71
+ - `local`
72
+
73
+ This matters because many "OpenAI-compatible" providers implement only part of the OpenAI surface. The engine is designed to route by capability, not by brand name.
74
+
75
+ ## Artifacts
76
+
77
+ Running the engine produces a local workspace with four main areas:
78
+
79
+ - `raw/`: immutable source inputs and captured assets
80
+ - `wiki/`: generated markdown pages and saved outputs
81
+ - `state/`: manifests, extracts, graph state, compile state, and search index
82
+ - `agent/`: generated agent rules
83
+
84
+ Important artifacts include:
85
+
86
+ - `state/graph.json`
87
+ - `state/search.sqlite`
88
+ - `wiki/index.md`
89
+ - `wiki/sources/*.md`
90
+ - `wiki/concepts/*.md`
91
+ - `wiki/entities/*.md`
92
+ - `wiki/outputs/*.md`
93
+
94
+ ## Notes
95
+
96
+ - The engine expects Node `>=24`
97
+ - The local search layer currently uses the built-in `node:sqlite` module, which may emit an experimental warning in Node 24
98
+ - The graph viewer is served from the companion `@swarmvaultai/viewer` package build output
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/engine",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Core engine for SwarmVault: ingest, compile, query, lint, and provider abstractions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,25 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/swarmclawai/swarmvault.git"
20
+ },
21
+ "homepage": "https://swarmvault.ai",
22
+ "bugs": {
23
+ "url": "https://github.com/swarmclawai/swarmvault/issues"
24
+ },
25
+ "keywords": [
26
+ "swarmvault",
27
+ "llm",
28
+ "knowledge-base",
29
+ "markdown",
30
+ "obsidian",
31
+ "graph",
32
+ "search",
33
+ "local-first"
34
+ ],
35
+ "license": "MIT",
17
36
  "publishConfig": {
18
37
  "access": "public"
19
38
  },
@@ -26,7 +45,8 @@
26
45
  "jsdom": "^27.0.0",
27
46
  "mime-types": "^3.0.1",
28
47
  "turndown": "^7.2.1",
29
- "zod": "^4.1.8"
48
+ "zod": "^4.1.8",
49
+ "@swarmvaultai/viewer": "0.1.1"
30
50
  },
31
51
  "devDependencies": {
32
52
  "@types/jsdom": "^27.0.0",