@swarmvaultai/cli 0.7.1 → 0.7.2
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/README.md +7 -3
- package/dist/index.js +18 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ 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`.
|
|
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`, so guided ingest/source flows are on by default until you override them with `--no-guide`.
|
|
74
74
|
|
|
75
75
|
### `swarmvault source add|list|reload|review|guide|session|delete`
|
|
76
76
|
|
|
@@ -79,6 +79,7 @@ Manage recurring source roots through a registry-backed workflow.
|
|
|
79
79
|
- `source add <input>` supports local files, local directories, public GitHub repo root URLs such as `https://github.com/karpathy/micrograd`, and docs/wiki/help/reference/tutorial hubs
|
|
80
80
|
- by default `source add` registers the source, syncs it into the vault, runs one compile, and writes a source brief to `wiki/outputs/source-briefs/<source-id>.md`
|
|
81
81
|
- add `--guide` when you want a resumable source session, source brief, source review, source guide, and approval-bundled canonical page edits when `profile.guidedSessionMode` is `canonical_review`, with `wiki/insights/` fallback for `insights_only`
|
|
82
|
+
- set `profile.guidedIngestDefault: true` when guided mode should be the default for `source add` and `source reload`, and use `--no-guide` for individual light-path runs
|
|
82
83
|
- `source list` shows every managed source with its kind, status, and current brief path
|
|
83
84
|
- `source reload [id]` re-syncs one source, or use `--all` to refresh everything in the registry and compile once
|
|
84
85
|
- `source review <id>` stages a lighter source-scoped review artifact
|
|
@@ -90,6 +91,7 @@ Useful flags:
|
|
|
90
91
|
|
|
91
92
|
- `--all`
|
|
92
93
|
- `--guide`
|
|
94
|
+
- `--no-guide`
|
|
93
95
|
- `--answers-file <path>`
|
|
94
96
|
- `--no-compile`
|
|
95
97
|
- `--no-brief`
|
|
@@ -107,14 +109,16 @@ Ingest a local file path, directory path, or URL into immutable source storage a
|
|
|
107
109
|
- repo-aware directory ingest records `repoRelativePath` and later compile writes `state/code-index.json`
|
|
108
110
|
- use `source add` instead when the same local directory, public GitHub repo root, or docs hub should stay registered and reloadable
|
|
109
111
|
- URL ingest still localizes remote image references by default
|
|
110
|
-
- local file ingest supports markdown, text, reStructuredText, HTML, PDF,
|
|
112
|
+
- local file and archive ingest supports markdown, text, reStructuredText, HTML, PDF, Word, RTF, OpenDocument, EPUB, CSV/TSV, Excel, PowerPoint, Jupyter notebooks, BibTeX, Org-mode, AsciiDoc, transcripts, Slack exports, email, calendar, structured config/data, developer manifests, images, and code
|
|
111
113
|
- add `--guide` when you want a resumable source session, source brief, source review, source guide, and approval-bundled canonical page edits when `profile.guidedSessionMode` is `canonical_review`, with `wiki/insights/` fallback for `insights_only`
|
|
112
|
-
-
|
|
114
|
+
- set `profile.guidedIngestDefault: true` when guided mode should be the default for `ingest`, and use `--no-guide` to force a plain ingest for one run
|
|
115
|
+
- code-aware directory ingest currently covers JavaScript, JSX, TypeScript, TSX, Bash/shell scripts, Python, Go, Rust, Java, Kotlin, Scala, Dart, Lua, Zig, C#, C, C++, PHP, Ruby, PowerShell, Elixir, OCaml, Objective-C, ReScript, Solidity, HTML, CSS, and Vue single-file components
|
|
113
116
|
|
|
114
117
|
Useful flags:
|
|
115
118
|
|
|
116
119
|
- `--repo-root <path>`
|
|
117
120
|
- `--answers-file <path>`
|
|
121
|
+
- `--no-guide`
|
|
118
122
|
- `--include <glob...>`
|
|
119
123
|
- `--exclude <glob...>`
|
|
120
124
|
- `--max-files <n>`
|
package/dist/index.js
CHANGED
|
@@ -268,9 +268,9 @@ program.name("swarmvault").description("SwarmVault is a local-first knowledge co
|
|
|
268
268
|
function readCliVersion() {
|
|
269
269
|
try {
|
|
270
270
|
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
271
|
-
return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.7.
|
|
271
|
+
return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.7.2";
|
|
272
272
|
} catch {
|
|
273
|
-
return "0.7.
|
|
273
|
+
return "0.7.2";
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
function parsePositiveInt(value, fallback) {
|
|
@@ -427,9 +427,11 @@ program.command("init").description("Initialize a SwarmVault workspace in the cu
|
|
|
427
427
|
log("Initialized SwarmVault workspace.");
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
program.command("ingest").description("Ingest a local file path, directory path, or URL into the raw SwarmVault workspace.").argument("<input>", "Local file path, directory path, or URL").option("--review", "Stage a source review artifact after ingest and compile", false).option("--guide", "Stage a guided source integration bundle after ingest and compile",
|
|
430
|
+
program.command("ingest").description("Ingest a local file path, directory path, or URL into the raw SwarmVault workspace.").argument("<input>", "Local file path, directory path, or URL").option("--review", "Stage a source review artifact after ingest and compile", false).option("--guide", "Stage a guided source integration bundle after ingest and compile (default: from config)").option("--no-guide", "Skip guided mode even if enabled in config").option("--answers-file <path>", "JSON file with guided-session answers keyed by question id or listed in prompt order").option("--include-assets", "Download remote image assets when ingesting URLs", true).option("--no-include-assets", "Skip downloading remote image assets when ingesting URLs").option("--max-asset-size <bytes>", "Maximum number of bytes to fetch for a single remote image asset").option("--repo-root <path>", "Override the detected repo root when ingesting a directory").option("--include <glob...>", "Only ingest files matching one or more glob patterns").option("--exclude <glob...>", "Skip files matching one or more glob patterns").option("--max-files <n>", "Maximum number of files to ingest from a directory").option("--include-third-party", "Also ingest repo files classified as third-party", false).option("--include-resources", "Also ingest repo files classified as resources", false).option("--include-generated", "Also ingest repo files classified as generated output", false).option("--no-gitignore", "Ignore .gitignore rules when ingesting a directory").action(
|
|
431
431
|
async (input, options) => {
|
|
432
432
|
const guideAnswers = readGuideAnswersFile(options.answersFile);
|
|
433
|
+
const vaultConfig = await loadVaultConfig(process2.cwd()).catch(() => null);
|
|
434
|
+
const guideEnabled = options.guide ?? vaultConfig?.config.profile.guidedIngestDefault ?? false;
|
|
433
435
|
const maxAssetSize = typeof options.maxAssetSize === "string" && options.maxAssetSize.trim() ? parsePositiveInt(options.maxAssetSize, 0) || void 0 : void 0;
|
|
434
436
|
const maxFiles = typeof options.maxFiles === "string" && options.maxFiles.trim() ? parsePositiveInt(options.maxFiles, 0) || void 0 : void 0;
|
|
435
437
|
const extractClasses = [
|
|
@@ -452,7 +454,7 @@ program.command("ingest").description("Ingest a local file path, directory path,
|
|
|
452
454
|
(fs) => fs.stat(input).then((stat) => stat.isDirectory() ? ingestDirectory(process2.cwd(), input, commonOptions) : null).catch(() => null)
|
|
453
455
|
) : null;
|
|
454
456
|
if (directoryResult) {
|
|
455
|
-
const scope2 = options.review ||
|
|
457
|
+
const scope2 = options.review || guideEnabled ? await (async () => {
|
|
456
458
|
const pathModule = await import("path");
|
|
457
459
|
const absoluteInput = pathModule.resolve(process2.cwd(), input);
|
|
458
460
|
const sourceIds = (await listManifests(process2.cwd())).filter((manifest) => {
|
|
@@ -470,11 +472,11 @@ program.command("ingest").description("Ingest a local file path, directory path,
|
|
|
470
472
|
} : void 0;
|
|
471
473
|
})() : void 0;
|
|
472
474
|
const shouldStage = Boolean(scope2 && (directoryResult.imported.length || directoryResult.updated.length));
|
|
473
|
-
const review3 = shouldStage && options.review && !
|
|
475
|
+
const review3 = shouldStage && options.review && !guideEnabled ? await (async () => {
|
|
474
476
|
await compileVault(process2.cwd(), {});
|
|
475
477
|
return await reviewSourceScope(process2.cwd(), scope2);
|
|
476
478
|
})() : void 0;
|
|
477
|
-
const guide2 = shouldStage &&
|
|
479
|
+
const guide2 = shouldStage && guideEnabled ? await (async () => {
|
|
478
480
|
await compileVault(process2.cwd(), {});
|
|
479
481
|
return await guideSourceScope(process2.cwd(), scope2, { answers: guideAnswers });
|
|
480
482
|
})() : void 0;
|
|
@@ -502,11 +504,11 @@ program.command("ingest").description("Ingest a local file path, directory path,
|
|
|
502
504
|
}
|
|
503
505
|
const ingest = await ingestInputDetailed(process2.cwd(), input, commonOptions);
|
|
504
506
|
const scope = sourceScopeFromManifests(input, [...ingest.created, ...ingest.updated, ...ingest.unchanged]);
|
|
505
|
-
const review2 = options.review && !
|
|
507
|
+
const review2 = options.review && !guideEnabled && scope && (ingest.created.length || ingest.updated.length || ingest.unchanged.length) ? await (async () => {
|
|
506
508
|
await compileVault(process2.cwd(), {});
|
|
507
509
|
return await reviewSourceScope(process2.cwd(), scope);
|
|
508
510
|
})() : void 0;
|
|
509
|
-
const guide =
|
|
511
|
+
const guide = guideEnabled && scope && (ingest.created.length || ingest.updated.length || ingest.unchanged.length) ? await (async () => {
|
|
510
512
|
await compileVault(process2.cwd(), {});
|
|
511
513
|
return await guideSourceScope(process2.cwd(), scope, { answers: guideAnswers });
|
|
512
514
|
})() : void 0;
|
|
@@ -547,14 +549,16 @@ program.command("add").description("Capture supported URLs into normalized markd
|
|
|
547
549
|
}
|
|
548
550
|
});
|
|
549
551
|
var source = program.command("source").description("Manage recurring local files, directories, public repos, and docs sources.");
|
|
550
|
-
source.command("add").description("Register and sync a managed source from a local file, directory, public GitHub repo root URL, or docs hub URL.").argument("<input>", "Local file path, directory path, public GitHub repo root URL, or docs hub URL").option("--no-compile", "Register and sync without compiling the vault").option("--no-brief", "Skip source brief generation after sync").option("--review", "Stage a source review artifact after sync and compile", false).option("--guide", "Stage a guided source integration bundle after sync and compile",
|
|
552
|
+
source.command("add").description("Register and sync a managed source from a local file, directory, public GitHub repo root URL, or docs hub URL.").argument("<input>", "Local file path, directory path, public GitHub repo root URL, or docs hub URL").option("--no-compile", "Register and sync without compiling the vault").option("--no-brief", "Skip source brief generation after sync").option("--review", "Stage a source review artifact after sync and compile", false).option("--guide", "Stage a guided source integration bundle after sync and compile (default: from config)").option("--no-guide", "Skip guided mode even if enabled in config").option("--answers-file <path>", "JSON file with guided-session answers keyed by question id or listed in prompt order").option("--max-pages <n>", "Maximum number of pages to crawl for docs sources").option("--max-depth <n>", "Maximum crawl depth for docs sources").action(
|
|
551
553
|
async (input, options) => {
|
|
552
554
|
const guideAnswers = readGuideAnswersFile(options.answersFile);
|
|
555
|
+
const addConfig = await loadVaultConfig(process2.cwd()).catch(() => null);
|
|
556
|
+
const guideEnabled = options.guide ?? addConfig?.config.profile.guidedIngestDefault ?? false;
|
|
553
557
|
const result = await addManagedSource(process2.cwd(), input, {
|
|
554
558
|
compile: options.compile,
|
|
555
559
|
brief: options.brief,
|
|
556
560
|
review: options.review,
|
|
557
|
-
guide:
|
|
561
|
+
guide: guideEnabled,
|
|
558
562
|
guideAnswers,
|
|
559
563
|
maxPages: options.maxPages ? parsePositiveInt(options.maxPages, 0) || void 0 : void 0,
|
|
560
564
|
maxDepth: options.maxDepth ? parsePositiveInt(options.maxDepth, 0) || void 0 : void 0
|
|
@@ -583,16 +587,18 @@ source.command("list").description("List managed sources registered in this vaul
|
|
|
583
587
|
}
|
|
584
588
|
}
|
|
585
589
|
});
|
|
586
|
-
source.command("reload").description("Re-sync one managed source or all managed sources, then optionally compile and refresh briefs.").argument("[id]", "Managed source id").option("--all", "Reload all managed sources", false).option("--no-compile", "Re-sync without compiling the vault").option("--no-brief", "Skip source brief generation after sync").option("--review", "Stage a source review artifact after sync and compile", false).option("--guide", "Stage a guided source integration bundle after sync and compile",
|
|
590
|
+
source.command("reload").description("Re-sync one managed source or all managed sources, then optionally compile and refresh briefs.").argument("[id]", "Managed source id").option("--all", "Reload all managed sources", false).option("--no-compile", "Re-sync without compiling the vault").option("--no-brief", "Skip source brief generation after sync").option("--review", "Stage a source review artifact after sync and compile", false).option("--guide", "Stage a guided source integration bundle after sync and compile (default: from config)").option("--no-guide", "Skip guided mode even if enabled in config").option("--answers-file <path>", "JSON file with guided-session answers keyed by question id or listed in prompt order").option("--max-pages <n>", "Maximum number of pages to crawl for docs sources").option("--max-depth <n>", "Maximum crawl depth for docs sources").action(
|
|
587
591
|
async (id, options) => {
|
|
588
592
|
const guideAnswers = readGuideAnswersFile(options.answersFile);
|
|
593
|
+
const reloadConfig = await loadVaultConfig(process2.cwd()).catch(() => null);
|
|
594
|
+
const guideEnabled = options.guide ?? reloadConfig?.config.profile.guidedIngestDefault ?? false;
|
|
589
595
|
const result = await reloadManagedSources(process2.cwd(), {
|
|
590
596
|
id,
|
|
591
597
|
all: options.all ?? false,
|
|
592
598
|
compile: options.compile,
|
|
593
599
|
brief: options.brief,
|
|
594
600
|
review: options.review,
|
|
595
|
-
guide:
|
|
601
|
+
guide: guideEnabled,
|
|
596
602
|
guideAnswers,
|
|
597
603
|
maxPages: options.maxPages ? parsePositiveInt(options.maxPages, 0) || void 0 : void 0,
|
|
598
604
|
maxDepth: options.maxDepth ? parsePositiveInt(options.maxDepth, 0) || void 0 : void 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmvaultai/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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.
|
|
41
|
+
"@swarmvaultai/engine": "0.7.2",
|
|
42
42
|
"commander": "^14.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|