volute 0.14.0 → 0.14.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/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ if (!process.env.VOLUTE_HOME) {
9
9
  var command = process.argv[2];
10
10
  var args = process.argv.slice(3);
11
11
  if (command === "--version" || command === "-v") {
12
- const { default: pkg } = await import("./package-EYUA3AMC.js");
12
+ const { default: pkg } = await import("./package-I7Z6G44Y.js");
13
13
  console.log(pkg.version);
14
14
  process.exit(0);
15
15
  }
@@ -39,13 +39,13 @@ switch (command) {
39
39
  await import("./env-6LXDUZDA.js").then((m) => m.run(args));
40
40
  break;
41
41
  case "up":
42
- await import("./up-SUZ6C5PY.js").then((m) => m.run(args));
42
+ await import("./up-C4MV6EXV.js").then((m) => m.run(args));
43
43
  break;
44
44
  case "down":
45
45
  await import("./down-A56B5JLK.js").then((m) => m.run(args));
46
46
  break;
47
47
  case "restart":
48
- await import("./daemon-restart-KNJHZ7FP.js").then((m) => m.run(args));
48
+ await import("./daemon-restart-IZGEF4NA.js").then((m) => m.run(args));
49
49
  break;
50
50
  case "setup":
51
51
  await import("./setup-DJKIZKGW.js").then((m) => m.run(args));
@@ -63,7 +63,7 @@ switch (command) {
63
63
  await import("./seed-AP4Q7RZ7.js").then((m) => m.run(args));
64
64
  break;
65
65
  case "sprout":
66
- await import("./sprout-2V3MWONK.js").then((m) => m.run(args));
66
+ await import("./sprout-TJ3BHVOG.js").then((m) => m.run(args));
67
67
  break;
68
68
  case "--help":
69
69
  case "-h":
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "./chunk-GR3OG4QK.js";
4
+ } from "./chunk-BEFIBW5B.js";
5
5
  import {
6
6
  stopDaemon
7
7
  } from "./chunk-QJIIHU32.js";
package/dist/daemon.js CHANGED
@@ -73,6 +73,7 @@ import {
73
73
  removeMind,
74
74
  removeVariant,
75
75
  setMindRunning,
76
+ setMindStage,
76
77
  setVariantRunning,
77
78
  stateDir,
78
79
  validateBranchName,
@@ -2359,6 +2360,14 @@ async function mergeTemplateBranch(worktreeDir) {
2359
2360
  throw e;
2360
2361
  }
2361
2362
  }
2363
+ async function npmInstallAsMind(cwd, mindName) {
2364
+ if (isIsolationEnabled()) {
2365
+ const [cmd, args] = wrapForIsolation("npm", ["install"], mindName);
2366
+ await exec(cmd, args, { cwd, env: { ...process.env, HOME: resolve11(cwd, "home") } });
2367
+ } else {
2368
+ await exec("npm", ["install"], { cwd });
2369
+ }
2370
+ }
2362
2371
  var createMindSchema = z2.object({
2363
2372
  name: z2.string(),
2364
2373
  template: z2.string().optional(),
@@ -2393,18 +2402,18 @@ var app7 = new Hono7().post("/", requireAdmin, zValidator2("json", createMindSch
2393
2402
  ensureVoluteGroup();
2394
2403
  createMindUser(name, homeDir);
2395
2404
  chownMindDir(dest, name);
2396
- const mindName = isIsolationEnabled() ? name : void 0;
2397
- const env = mindName ? { ...process.env, HOME: homeDir } : void 0;
2398
- await exec("npm", ["install"], { cwd: dest, mindName, env });
2405
+ await npmInstallAsMind(dest, name);
2399
2406
  let gitWarning;
2400
2407
  try {
2401
- await gitExec(["init"], { cwd: dest, mindName, env });
2402
- await initTemplateBranch(dest, composedDir, manifest, mindName, env);
2408
+ const env = isIsolationEnabled() ? { ...process.env, HOME: homeDir } : void 0;
2409
+ await gitExec(["init"], { cwd: dest, mindName: name, env });
2410
+ await initTemplateBranch(dest, composedDir, manifest, name, env);
2403
2411
  } catch (err) {
2404
2412
  console.error(`[daemon] git setup failed for ${name}:`, err);
2405
2413
  rmSync(resolve11(dest, ".git"), { recursive: true, force: true });
2406
2414
  gitWarning = "Git setup failed \u2014 variants and upgrades won't be available until git is initialized.";
2407
2415
  }
2416
+ chownMindDir(dest, name);
2408
2417
  if (body.stage === "seed") {
2409
2418
  const descLine = body.description ? `
2410
2419
  The human who planted you described you as: "${body.description}"
@@ -2511,15 +2520,14 @@ ${user.trimEnd()}
2511
2520
  ensureVoluteGroup();
2512
2521
  createMindUser(name, homeDir);
2513
2522
  chownMindDir(dest, name);
2514
- const mindName = isIsolationEnabled() ? name : void 0;
2515
- const env = mindName ? { ...process.env, HOME: homeDir } : void 0;
2516
- await exec("npm", ["install"], { cwd: dest, mindName, env });
2523
+ await npmInstallAsMind(dest, name);
2517
2524
  if (!hasMemory && dailyLogCount > 0) {
2518
2525
  await consolidateMemory(dest);
2519
2526
  }
2520
- await gitExec(["init"], { cwd: dest, mindName, env });
2521
- await gitExec(["add", "-A"], { cwd: dest, mindName, env });
2522
- await gitExec(["commit", "-m", "import from OpenClaw"], { cwd: dest, mindName, env });
2527
+ const env = isIsolationEnabled() ? { ...process.env, HOME: resolve11(dest, "home") } : void 0;
2528
+ await gitExec(["init"], { cwd: dest, mindName: name, env });
2529
+ await gitExec(["add", "-A"], { cwd: dest, mindName: name, env });
2530
+ await gitExec(["commit", "-m", "import from OpenClaw"], { cwd: dest, mindName: name, env });
2523
2531
  const sessionFile = body.sessionPath ? resolve11(body.sessionPath) : findOpenClawSession(wsDir);
2524
2532
  if (sessionFile && existsSync8(sessionFile)) {
2525
2533
  if (template === "pi") {
@@ -2532,6 +2540,7 @@ ${user.trimEnd()}
2532
2540
  }
2533
2541
  }
2534
2542
  importOpenClawConnectors(name, dest);
2543
+ chownMindDir(dest, name);
2535
2544
  return c.json({ ok: true, name, port, message: `Imported mind: ${name} (port ${port})` });
2536
2545
  } catch (err) {
2537
2546
  if (existsSync8(dest)) rmSync(dest, { recursive: true, force: true });
@@ -2740,12 +2749,12 @@ ${user.trimEnd()}
2740
2749
  } catch {
2741
2750
  }
2742
2751
  removeVariant(baseName, mergeVariantName);
2752
+ chownMindDir(projectRoot, baseName);
2743
2753
  try {
2744
- await exec("npm", ["install"], { cwd: projectRoot });
2754
+ await npmInstallAsMind(projectRoot, baseName);
2745
2755
  } catch (e) {
2746
2756
  console.error(`[daemon] npm install failed after merge for ${baseName}:`, e);
2747
2757
  }
2748
- chownMindDir(projectRoot, baseName);
2749
2758
  }
2750
2759
  }
2751
2760
  if (context) {
@@ -2793,6 +2802,15 @@ ${user.trimEnd()}
2793
2802
  } catch (err) {
2794
2803
  return c.json({ error: err instanceof Error ? err.message : "Failed to stop mind" }, 500);
2795
2804
  }
2805
+ }).post("/:name/sprout", requireAdmin, async (c) => {
2806
+ const name = c.req.param("name");
2807
+ const entry = findMind(name);
2808
+ if (!entry) return c.json({ error: "Mind not found" }, 404);
2809
+ if (entry.stage !== "seed") {
2810
+ return c.json({ error: `Mind is not a seed (stage: ${entry.stage})` }, 409);
2811
+ }
2812
+ setMindStage(name, "sprouted");
2813
+ return c.json({ ok: true });
2796
2814
  }).delete("/:name", requireAdmin, async (c) => {
2797
2815
  const name = c.req.param("name");
2798
2816
  const entry = findMind(name);
@@ -2842,13 +2860,14 @@ ${user.trimEnd()}
2842
2860
  }
2843
2861
  try {
2844
2862
  await gitExec(["add", "-A"], { cwd: worktreeDir2 });
2845
- await gitExec(["commit", "--no-edit"], { cwd: worktreeDir2 });
2863
+ await gitExec(["commit", "-m", "merge template update"], { cwd: worktreeDir2 });
2846
2864
  } catch (e) {
2847
2865
  const msg = e instanceof Error ? e.message : String(e);
2848
2866
  if (!msg.includes("nothing to commit")) throw e;
2849
2867
  }
2868
+ chownMindDir(dir, mindName);
2850
2869
  try {
2851
- await exec("npm", ["install"], { cwd: worktreeDir2 });
2870
+ await npmInstallAsMind(worktreeDir2, mindName);
2852
2871
  const variantPort = nextPort();
2853
2872
  addVariant(mindName, {
2854
2873
  name: UPGRADE_VARIANT,
@@ -2857,7 +2876,6 @@ ${user.trimEnd()}
2857
2876
  port: variantPort,
2858
2877
  created: (/* @__PURE__ */ new Date()).toISOString()
2859
2878
  });
2860
- chownMindDir(dir, mindName);
2861
2879
  await getMindManager().startMind(`${mindName}@${UPGRADE_VARIANT}`);
2862
2880
  return c.json({
2863
2881
  ok: true,
@@ -2921,7 +2939,7 @@ ${user.trimEnd()}
2921
2939
  });
2922
2940
  }
2923
2941
  try {
2924
- await exec("npm", ["install"], { cwd: worktreeDir });
2942
+ await npmInstallAsMind(worktreeDir, mindName);
2925
2943
  const variantPort = nextPort();
2926
2944
  addVariant(mindName, {
2927
2945
  name: UPGRADE_VARIANT,
@@ -2930,7 +2948,6 @@ ${user.trimEnd()}
2930
2948
  port: variantPort,
2931
2949
  created: (/* @__PURE__ */ new Date()).toISOString()
2932
2950
  });
2933
- chownMindDir(dir, mindName);
2934
2951
  await getMindManager().startMind(`${mindName}@${UPGRADE_VARIANT}`);
2935
2952
  return c.json({
2936
2953
  ok: true,
@@ -3506,8 +3523,17 @@ var app13 = new Hono13().get("/:name/variants", async (c) => {
3506
3523
  const msg = e instanceof Error ? e.message : String(e);
3507
3524
  return c.json({ error: `Failed to create worktree: ${msg}` }, 500);
3508
3525
  }
3526
+ chownMindDir(projectRoot, mindName);
3509
3527
  try {
3510
- await exec("npm", ["install"], { cwd: variantDir });
3528
+ if (isIsolationEnabled()) {
3529
+ const [cmd, args] = wrapForIsolation("npm", ["install"], mindName);
3530
+ await exec(cmd, args, {
3531
+ cwd: variantDir,
3532
+ env: { ...process.env, HOME: resolve14(variantDir, "home") }
3533
+ });
3534
+ } else {
3535
+ await exec("npm", ["install"], { cwd: variantDir });
3536
+ }
3511
3537
  } catch (e) {
3512
3538
  const msg = e instanceof Error ? e.message : String(e);
3513
3539
  return c.json({ error: `npm install failed: ${msg}` }, 500);
@@ -3524,7 +3550,6 @@ var app13 = new Hono13().get("/:name/variants", async (c) => {
3524
3550
  created: (/* @__PURE__ */ new Date()).toISOString()
3525
3551
  };
3526
3552
  addVariant(mindName, variant);
3527
- chownMindDir(projectRoot, mindName);
3528
3553
  if (!body.noStart) {
3529
3554
  try {
3530
3555
  await getMindManager().startMind(`${mindName}@${variantName}`);
@@ -3620,11 +3645,19 @@ var app13 = new Hono13().get("/:name/variants", async (c) => {
3620
3645
  } catch {
3621
3646
  }
3622
3647
  removeVariant(mindName, variantName);
3648
+ chownMindDir(projectRoot, mindName);
3623
3649
  try {
3624
- await exec("npm", ["install"], { cwd: projectRoot });
3650
+ if (isIsolationEnabled()) {
3651
+ const [cmd, args] = wrapForIsolation("npm", ["install"], mindName);
3652
+ await exec(cmd, args, {
3653
+ cwd: projectRoot,
3654
+ env: { ...process.env, HOME: resolve14(projectRoot, "home") }
3655
+ });
3656
+ } else {
3657
+ await exec("npm", ["install"], { cwd: projectRoot });
3658
+ }
3625
3659
  } catch {
3626
3660
  }
3627
- chownMindDir(projectRoot, mindName);
3628
3661
  const manager = getMindManager();
3629
3662
  const context = {
3630
3663
  type: "merged",
@@ -4,7 +4,7 @@ import "./chunk-K3NQKI34.js";
4
4
  // package.json
5
5
  var package_default = {
6
6
  name: "volute",
7
- version: "0.14.0",
7
+ version: "0.14.1",
8
8
  description: "CLI for creating and managing self-modifying AI minds powered by the Claude Agent SDK",
9
9
  type: "module",
10
10
  license: "MIT",
@@ -5,8 +5,7 @@ import {
5
5
  } from "./chunk-PO5Q2AYN.js";
6
6
  import {
7
7
  findMind,
8
- mindDir,
9
- setMindStage
8
+ mindDir
10
9
  } from "./chunk-M77QBTEH.js";
11
10
  import "./chunk-K3NQKI34.js";
12
11
 
@@ -65,10 +64,18 @@ async function run(_args) {
65
64
  } finally {
66
65
  rmSync(composedDir, { recursive: true, force: true });
67
66
  }
68
- setMindStage(mindName, "sprouted");
69
67
  const { daemonFetch } = await import("./daemon-client-ODKDUYDE.js");
70
68
  const { getClient, urlOf } = await import("./api-client-YPKOZP2O.js");
71
69
  const client = getClient();
70
+ const sproutRes = await daemonFetch(
71
+ urlOf(client.api.minds[":name"].sprout.$url({ param: { name: mindName } })),
72
+ { method: "POST" }
73
+ );
74
+ if (!sproutRes.ok) {
75
+ const data = await sproutRes.json();
76
+ console.error(data.error ?? "Failed to update stage");
77
+ process.exit(1);
78
+ }
72
79
  const res = await daemonFetch(
73
80
  urlOf(client.api.minds[":name"].restart.$url({ param: { name: mindName } })),
74
81
  {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readGlobalConfig,
4
4
  run
5
- } from "./chunk-GR3OG4QK.js";
5
+ } from "./chunk-BEFIBW5B.js";
6
6
  import "./chunk-6BDNWYKG.js";
7
7
  import "./chunk-2Y77MCFG.js";
8
8
  import "./chunk-ZCEYUUID.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volute",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "CLI for creating and managing self-modifying AI minds powered by the Claude Agent SDK",
5
5
  "type": "module",
6
6
  "license": "MIT",
File without changes