@swarmvaultai/engine 0.1.33 → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +20 -1
- package/dist/chunk-CWLDFLH2.js +1163 -0
- package/dist/index.d.ts +62 -2
- package/dist/index.js +1561 -456
- package/dist/registry-2REAPKPO.js +12 -0
- package/package.json +7 -7
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
|
@@ -20,10 +20,12 @@ If you only want to use SwarmVault as a tool, install `@swarmvaultai/cli` instea
|
|
|
20
20
|
```ts
|
|
21
21
|
import {
|
|
22
22
|
addInput,
|
|
23
|
+
addManagedSource,
|
|
23
24
|
benchmarkVault,
|
|
24
25
|
compileVault,
|
|
25
26
|
createMcpServer,
|
|
26
27
|
createWebSearchAdapter,
|
|
28
|
+
deleteManagedSource,
|
|
27
29
|
defaultVaultConfig,
|
|
28
30
|
defaultVaultSchema,
|
|
29
31
|
exploreVault,
|
|
@@ -40,6 +42,7 @@ import {
|
|
|
40
42
|
getWebSearchAdapterForTask,
|
|
41
43
|
lintVault,
|
|
42
44
|
listGodNodes,
|
|
45
|
+
listManagedSourceRecords,
|
|
43
46
|
listSchedules,
|
|
44
47
|
loadVaultConfig,
|
|
45
48
|
loadVaultSchema,
|
|
@@ -48,6 +51,7 @@ import {
|
|
|
48
51
|
pushGraphNeo4j,
|
|
49
52
|
queryGraphVault,
|
|
50
53
|
queryVault,
|
|
54
|
+
reloadManagedSources,
|
|
51
55
|
runWatchCycle,
|
|
52
56
|
runSchedule,
|
|
53
57
|
searchVault,
|
|
@@ -67,6 +71,7 @@ The engine also exports the main runtime types for providers, graph artifacts, p
|
|
|
67
71
|
```ts
|
|
68
72
|
import {
|
|
69
73
|
addInput,
|
|
74
|
+
addManagedSource,
|
|
70
75
|
benchmarkVault,
|
|
71
76
|
compileVault,
|
|
72
77
|
exploreVault,
|
|
@@ -76,10 +81,12 @@ import {
|
|
|
76
81
|
importInbox,
|
|
77
82
|
initVault,
|
|
78
83
|
installGitHooks,
|
|
84
|
+
listManagedSourceRecords,
|
|
79
85
|
loadVaultSchemas,
|
|
80
86
|
pushGraphNeo4j,
|
|
81
87
|
queryGraphVault,
|
|
82
88
|
queryVault,
|
|
89
|
+
reloadManagedSources,
|
|
83
90
|
runWatchCycle,
|
|
84
91
|
watchVault
|
|
85
92
|
} from "@swarmvaultai/engine";
|
|
@@ -89,6 +96,8 @@ const rootDir = process.cwd();
|
|
|
89
96
|
await initVault(rootDir, { obsidian: true });
|
|
90
97
|
const schemas = await loadVaultSchemas(rootDir);
|
|
91
98
|
console.log(schemas.root.path);
|
|
99
|
+
const managed = await addManagedSource(rootDir, "https://github.com/karpathy/micrograd");
|
|
100
|
+
console.log(managed.source.id);
|
|
92
101
|
await addInput(rootDir, "https://arxiv.org/abs/2401.12345");
|
|
93
102
|
await importInbox(rootDir);
|
|
94
103
|
await compileVault(rootDir, {});
|
|
@@ -115,6 +124,8 @@ await pushGraphNeo4j(rootDir, {
|
|
|
115
124
|
|
|
116
125
|
await runWatchCycle(rootDir, { repo: true });
|
|
117
126
|
console.log(await getWatchStatus(rootDir));
|
|
127
|
+
console.log(await listManagedSourceRecords(rootDir));
|
|
128
|
+
await reloadManagedSources(rootDir, { all: true, compile: true });
|
|
118
129
|
await installGitHooks(rootDir);
|
|
119
130
|
|
|
120
131
|
const watcher = await watchVault(rootDir, { lint: true, repo: true });
|
|
@@ -170,11 +181,17 @@ This matters because many "OpenAI-compatible" backends only implement part of th
|
|
|
170
181
|
|
|
171
182
|
### Ingest
|
|
172
183
|
|
|
184
|
+
- `addManagedSource(rootDir, input, { compile, brief, maxPages, maxDepth })` registers and syncs a recurring source, then optionally compiles and writes a source brief
|
|
185
|
+
- `listManagedSourceRecords(rootDir)` lists registry-backed managed sources from `state/sources.json`
|
|
186
|
+
- `reloadManagedSources(rootDir, { id, all, compile, brief, maxPages, maxDepth })` re-syncs one managed source or the full registry
|
|
187
|
+
- `deleteManagedSource(rootDir, id)` removes a managed-source registry entry and transient sync state without deleting canonical vault artifacts
|
|
173
188
|
- `ingestInput(rootDir, input, { includeAssets, maxAssetSize })` ingests a local file path or URL
|
|
174
189
|
- `addInput(rootDir, input, { author, contributor })` captures supported URLs into normalized markdown before ingesting them, or falls back to generic URL ingest
|
|
175
190
|
- `ingestDirectory(rootDir, inputDir, { repoRoot, include, exclude, maxFiles, gitignore, extractClasses })` recursively ingests a local directory as a repo-aware code/content source tree
|
|
176
191
|
- `importInbox(rootDir, inputDir?)` recursively imports supported inbox files plus markdown and HTML browser-clipper style bundles
|
|
177
|
-
-
|
|
192
|
+
- managed sources support local directories, public GitHub repo root URLs, and bounded same-domain docs hubs
|
|
193
|
+
- registry data lives in `state/sources.json`, working state lives under `state/sources/<id>/`, and source briefs are written to `wiki/outputs/source-briefs/<id>.md`
|
|
194
|
+
- JavaScript, JSX, TypeScript, TSX, Python, Go, Rust, Java, Kotlin, Scala, Lua, Zig, C#, C, C++, PHP, Ruby, and PowerShell inputs are treated as code sources and compiled into both source pages and `wiki/code/` module pages
|
|
178
195
|
- `.rst` and `.rest` inputs are treated as first-class text sources with lightweight heading and directive normalization before analysis
|
|
179
196
|
- code manifests can carry `repoRelativePath`, and compile writes `state/code-index.json` so local imports can resolve across an ingested repo tree
|
|
180
197
|
- repo-aware manifests, graph nodes, and graph pages can also carry `sourceClass` so first-party, third-party, resource, and generated material can be filtered and reported separately
|
|
@@ -248,6 +265,8 @@ Running the engine produces a local workspace with these main areas:
|
|
|
248
265
|
- `wiki/projects/`: generated project rollups over canonical pages
|
|
249
266
|
- `wiki/candidates/`: staged concept and entity pages awaiting confirmation on a later compile
|
|
250
267
|
- `state/manifests/`: source manifests
|
|
268
|
+
- `state/sources.json`: managed-source registry state
|
|
269
|
+
- `state/sources/`: managed-source working state such as GitHub checkouts and crawl metadata
|
|
251
270
|
- `state/extracts/`: extracted markdown plus JSON sidecars describing extractor kind, warnings, PDF page counts, and image-vision metadata
|
|
252
271
|
- `state/analyses/`: model analysis output
|
|
253
272
|
- `state/code-index.json`: repo-aware code module aliases and local resolution data
|