@slock-ai/daemon 0.18.0 → 0.20.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 +40 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -372,8 +372,14 @@ var ClaudeDriver = class {
372
372
  }
373
373
  }
374
374
  });
375
- const mcpConfigPath = path.join(ctx.workingDirectory, ".slock-claude-mcp.json");
376
- writeFileSync(mcpConfigPath, mcpConfig, "utf8");
375
+ let mcpConfigArg;
376
+ if (process.platform === "win32") {
377
+ const mcpConfigPath = path.join(ctx.workingDirectory, ".slock-claude-mcp.json");
378
+ writeFileSync(mcpConfigPath, mcpConfig, "utf8");
379
+ mcpConfigArg = mcpConfigPath;
380
+ } else {
381
+ mcpConfigArg = mcpConfig;
382
+ }
377
383
  const args2 = [
378
384
  "--allow-dangerously-skip-permissions",
379
385
  "--dangerously-skip-permissions",
@@ -383,9 +389,11 @@ var ClaudeDriver = class {
383
389
  "--input-format",
384
390
  "stream-json",
385
391
  "--mcp-config",
386
- mcpConfigPath,
392
+ mcpConfigArg,
387
393
  "--model",
388
- ctx.config.model || "sonnet"
394
+ ctx.config.model || "sonnet",
395
+ "--disallowed-tools",
396
+ "EnterPlanMode,ExitPlanMode"
389
397
  ];
390
398
  if (ctx.config.sessionId) {
391
399
  args2.push("--resume", ctx.config.sessionId);
@@ -576,11 +584,36 @@ var CodexDriver = class {
576
584
  }
577
585
  args2.push(ctx.prompt);
578
586
  const spawnEnv = { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1", ...ctx.config.envVars || {} };
579
- const proc = spawn2("codex", args2, {
587
+ let spawnCmd = "codex";
588
+ let spawnArgs = args2;
589
+ if (process.platform === "win32") {
590
+ let codexEntry = null;
591
+ try {
592
+ const globalRoot = execSync("npm root -g", { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
593
+ const candidate = path2.join(globalRoot, "@openai", "codex", "bin", "codex.js");
594
+ if (existsSync(candidate)) codexEntry = candidate;
595
+ } catch {
596
+ }
597
+ if (!codexEntry) {
598
+ try {
599
+ const cmdPath = execSync("where codex", { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim().split(/\r?\n/)[0];
600
+ const candidate = path2.join(path2.dirname(cmdPath), "node_modules", "@openai", "codex", "bin", "codex.js");
601
+ if (existsSync(candidate)) codexEntry = candidate;
602
+ } catch {
603
+ }
604
+ }
605
+ if (!codexEntry) {
606
+ throw new Error(
607
+ "Cannot resolve Codex CLI entry point on Windows. Ensure @openai/codex is installed globally via npm (npm i -g @openai/codex)."
608
+ );
609
+ }
610
+ spawnCmd = process.execPath;
611
+ spawnArgs = [codexEntry, ...args2];
612
+ }
613
+ const proc = spawn2(spawnCmd, spawnArgs, {
580
614
  cwd: ctx.workingDirectory,
581
615
  stdio: ["pipe", "pipe", "pipe"],
582
- env: spawnEnv,
583
- shell: process.platform === "win32"
616
+ env: spawnEnv
584
617
  });
585
618
  return { process: proc };
586
619
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slock-ai/daemon",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "slock-daemon": "dist/index.js"