@clawos-dev/clawd 0.2.44 → 0.2.45-beta.67.b41395e

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/cli.cjs +26 -6
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -10784,7 +10784,7 @@ function buildSpawnArgs(ctx) {
10784
10784
  args.push("--setting-sources", "project,local");
10785
10785
  break;
10786
10786
  case "owner":
10787
- args.push("--setting-sources", "user");
10787
+ args.push("--setting-sources", "user,project,local");
10788
10788
  args.push("--permission-mode", "bypassPermissions");
10789
10789
  break;
10790
10790
  case void 0:
@@ -10795,6 +10795,7 @@ function buildSpawnArgs(ctx) {
10795
10795
  throw new Error(`unexpected personaMode: ${String(_exhaustive)}`);
10796
10796
  }
10797
10797
  }
10798
+ if (ctx.extraSettings) args.push("--settings", ctx.extraSettings);
10798
10799
  if (ctx.effort) args.push("--effort", ctx.effort);
10799
10800
  if (ctx.toolSessionId) args.push("--resume", ctx.toolSessionId);
10800
10801
  return args;
@@ -15709,6 +15710,9 @@ function buildSpawnContext(state) {
15709
15710
  if (meta?.personaMode) {
15710
15711
  ctx.personaMode = meta.personaMode;
15711
15712
  }
15713
+ if (meta?.extraSettings) {
15714
+ ctx.extraSettings = meta.extraSettings;
15715
+ }
15712
15716
  return ctx;
15713
15717
  }
15714
15718
  function sessionInfoFrame(file) {
@@ -17631,15 +17635,24 @@ var PersonaStore = class {
17631
17635
  claudeMdPath(personaId) {
17632
17636
  return path6.join(this.personaDir(personaId), "CLAUDE.md");
17633
17637
  }
17634
- settingsPath(personaId) {
17635
- return path6.join(this.personaDir(personaId), ".claude", "settings.json");
17638
+ /**
17639
+ * Sandbox settings 落盘路径 —— 故意放在 `.clawd/` 而不是 `.claude/`,让 CC 的
17640
+ * project source 自动发现机制扫不到。owner 模式 spawn 时不会被 `--setting-sources
17641
+ * user,project,local` 顺手带进来;listener 模式靠 `--settings <这个路径>` 显式拉回。
17642
+ * 把 sandbox 跟 persona CLAUDE.md(仍在 `<persona>/CLAUDE.md`)解耦后,两种模式都能
17643
+ * 加载 persona 人格,只有 listener 多一层 OS sandbox。
17644
+ */
17645
+ sandboxSettingsPath(personaId) {
17646
+ return path6.join(this.personaDir(personaId), ".clawd", "sandbox-settings.json");
17636
17647
  }
17637
17648
  write(persona, personality) {
17638
17649
  const dir = this.personaDir(persona.personaId);
17639
- fs6.mkdirSync(path6.join(dir, ".claude"), { recursive: true });
17640
17650
  fs6.mkdirSync(path6.join(dir, ".clawd"), { recursive: true });
17641
17651
  this.atomicWrite(this.claudeMdPath(persona.personaId), personality);
17642
- this.atomicWrite(this.settingsPath(persona.personaId), JSON.stringify(DEFAULT_SETTINGS, null, 2));
17652
+ this.atomicWrite(
17653
+ this.sandboxSettingsPath(persona.personaId),
17654
+ JSON.stringify(DEFAULT_SETTINGS, null, 2)
17655
+ );
17643
17656
  this.atomicWrite(this.metaPath(persona.personaId), JSON.stringify(persona, null, 2));
17644
17657
  }
17645
17658
  writePersonality(personaId, personality) {
@@ -17840,7 +17853,14 @@ var PersonaManager = class {
17840
17853
  tool: "claude",
17841
17854
  label: subLabel,
17842
17855
  model: persona.model,
17843
- subSessionMeta: { idleKillEnabled: true, personaMode: "listener" }
17856
+ // listener OS sandbox:sandbox JSON 不在 project 自动发现路径上(PersonaStore 把它
17857
+ // 落在 .clawd/sandbox-settings.json),靠 extraSettings 透传到 spawn 的 `--settings <file>`
17858
+ // 显式拉回。owner 路径不传 extraSettings,天然无 sandbox。
17859
+ subSessionMeta: {
17860
+ idleKillEnabled: true,
17861
+ personaMode: "listener",
17862
+ extraSettings: this.deps.store.sandboxSettingsPath(personaId)
17863
+ }
17844
17864
  });
17845
17865
  return { sessionFile, isNew: true };
17846
17866
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawos-dev/clawd",
3
- "version": "0.2.44",
3
+ "version": "0.2.45-beta.67.b41395e",
4
4
  "description": "Standalone clawd daemon — Claude Code (and future Codex) session server over WebSocket",
5
5
  "type": "module",
6
6
  "license": "MIT",