@swarmvaultai/cli 0.11.0 → 1.0.0

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 (2) hide show
  1. package/dist/index.js +20 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -59,6 +59,7 @@ import {
59
59
  reviewManagedSource,
60
60
  reviewSourceScope,
61
61
  runAutoPromotion,
62
+ runMigration,
62
63
  runSchedule,
63
64
  runWatchCycle,
64
65
  serveSchedules,
@@ -283,9 +284,9 @@ program.name("swarmvault").description("SwarmVault is a local-first knowledge co
283
284
  function readCliVersion() {
284
285
  try {
285
286
  const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
286
- return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.11.0";
287
+ return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "1.0.0";
287
288
  } catch {
288
- return "0.11.0";
289
+ return "1.0.0";
289
290
  }
290
291
  }
291
292
  function parsePositiveInt(value, fallback) {
@@ -1299,6 +1300,23 @@ schedule.command("serve").description("Run the local schedule loop.").option("--
1299
1300
  process2.exit(0);
1300
1301
  });
1301
1302
  });
1303
+ program.command("migrate").description("Detect vault version and plan or apply schema/config/graph migrations.").option("--target <version>", "Limit migrations to those at or below this target version").option("--apply", "Write migration changes to disk (default is dry-run)", false).option("--dry-run", "Report planned changes without writing (overrides --apply)", false).action(async (options) => {
1304
+ const dryRun = options.dryRun === true ? true : options.apply !== true;
1305
+ const result = await runMigration(process2.cwd(), { targetVersion: options.target, dryRun });
1306
+ if (isJson()) {
1307
+ emitJson(result);
1308
+ return;
1309
+ }
1310
+ log(
1311
+ `Vault version: ${result.fromVersion ?? "unknown"} \u2192 ${result.toVersion} (${result.planned} step${result.planned === 1 ? "" : "s"} planned, ${result.applied.length} applied, ${result.skipped.length} skipped${dryRun ? "; dry-run" : ""})`
1312
+ );
1313
+ for (const entry of result.applied) {
1314
+ log(`applied ${entry.id}: ${entry.changed.length} change${entry.changed.length === 1 ? "" : "s"}`);
1315
+ }
1316
+ for (const entry of result.skipped) {
1317
+ log(`skip ${entry.id}: ${entry.reason}`);
1318
+ }
1319
+ });
1302
1320
  program.command("mcp").description("Run SwarmVault as a local MCP server over stdio.").action(async () => {
1303
1321
  if (isJson()) {
1304
1322
  process2.stderr.write(`${JSON.stringify({ status: "running", transport: "stdio" })}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/cli",
3
- "version": "0.11.0",
3
+ "version": "1.0.0",
4
4
  "description": "Global CLI for SwarmVault.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "prepublishOnly": "node ../../scripts/check-release-sync.mjs && node ../../scripts/check-published-manifests.mjs"
45
45
  },
46
46
  "dependencies": {
47
- "@swarmvaultai/engine": "0.11.0",
47
+ "@swarmvaultai/engine": "1.0.0",
48
48
  "commander": "^14.0.1"
49
49
  },
50
50
  "devDependencies": {