@cabane/companion 0.6.31 → 0.6.32

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
@@ -5514,9 +5514,13 @@ function sealHeld2(held, terminal) {
5514
5514
  import { z as z11 } from "zod";
5515
5515
  function codexToolPolicy(policy) {
5516
5516
  return policy.hostFs ? {
5517
- permissionProfile: "cabane-coding",
5517
+ sandboxMode: "danger-full-access",
5518
+ // Headless: nothing to approve, because nothing is denied.
5518
5519
  approvalPolicy: "never",
5519
- networkAccessEnabled: policy.web
5520
+ // Full access means the command network is open regardless of the grant —
5521
+ // recorded as `true` so the value never claims a restriction that isn't
5522
+ // enforced.
5523
+ networkAccessEnabled: true
5520
5524
  } : {
5521
5525
  sandboxMode: "read-only",
5522
5526
  // Headless: the sandbox is the boundary; never pause for a human.
@@ -5636,7 +5640,6 @@ function buildConfig(req, baseInstructionsFile) {
5636
5640
  default_tools_approval_mode: "approve"
5637
5641
  };
5638
5642
  }
5639
- const policy = codexToolPolicy(req.policy);
5640
5643
  const tmpDir = req.local.env?.TMPDIR;
5641
5644
  const shellEnv = {};
5642
5645
  if (tmpDir) shellEnv.TMPDIR = tmpDir;
@@ -5644,7 +5647,6 @@ function buildConfig(req, baseInstructionsFile) {
5644
5647
  const value = req.local.env?.[key];
5645
5648
  if (value !== void 0) shellEnv[key] = value;
5646
5649
  }
5647
- const gateLockDir = req.local.env?.CABANE_GATE_LOCK_DIR;
5648
5650
  return {
5649
5651
  mcp_servers,
5650
5652
  experimental_use_rmcp_client: true,
@@ -5652,28 +5654,7 @@ function buildConfig(req, baseInstructionsFile) {
5652
5654
  // becomes Codex's base instructions, and Codex's own environment preamble goes
5653
5655
  // with the harness prompt it belonged to.
5654
5656
  ...baseInstructionsFile ? { model_instructions_file: baseInstructionsFile, include_environment_context: false } : {},
5655
- ...Object.keys(shellEnv).length ? { shell_environment_policy: { set: shellEnv } } : {},
5656
- ...policy.permissionProfile ? {
5657
- // CT733: named permission profiles are Codex's split-filesystem path.
5658
- // `:root = read` preserves coding-mode host reads; the one explicit
5659
- // workspace-root write grants the checkout, and the more-specific
5660
- // `.git` write reopens the metadata Codex protects by default. Neither
5661
- // rule grants an adjacent directory. Do not combine this with legacy `sandbox_mode` /
5662
- // `sandbox_workspace_write`, which would restore the `.git` carve-out.
5663
- approval_policy: policy.approvalPolicy,
5664
- default_permissions: policy.permissionProfile,
5665
- permissions: {
5666
- [policy.permissionProfile]: {
5667
- filesystem: {
5668
- ":root": "read",
5669
- ":workspace_roots": { ".": "write", ".git": "write" },
5670
- // The one absolute-path grant — see the CT612-fallout note above.
5671
- ...gateLockDir ? { [gateLockDir]: "write" } : {}
5672
- },
5673
- network: { enabled: policy.networkAccessEnabled, mode: "full" }
5674
- }
5675
- }
5676
- } : {}
5657
+ ...Object.keys(shellEnv).length ? { shell_environment_policy: { set: shellEnv } } : {}
5677
5658
  };
5678
5659
  }
5679
5660
  function isStringRecord2(v) {
@@ -5687,11 +5668,10 @@ import {
5687
5668
  function buildSdkThreadOptions(spec) {
5688
5669
  return {
5689
5670
  ...spec.model ? { model: spec.model } : {},
5690
- ...spec.policy.sandboxMode ? { sandboxMode: spec.policy.sandboxMode } : {},
5671
+ sandboxMode: spec.policy.sandboxMode,
5691
5672
  workingDirectory: spec.directory,
5692
5673
  skipGitRepoCheck: spec.skipGitRepoCheck,
5693
- ...spec.policy.sandboxMode ? { approvalPolicy: spec.policy.approvalPolicy } : {},
5694
- ...spec.policy.sandboxMode === "workspace-write" ? { networkAccessEnabled: spec.policy.networkAccessEnabled } : {},
5674
+ approvalPolicy: spec.policy.approvalPolicy,
5695
5675
  ...spec.modelReasoningEffort ? { modelReasoningEffort: spec.modelReasoningEffort } : {}
5696
5676
  };
5697
5677
  }
@@ -7717,22 +7697,7 @@ ${reason}`,
7717
7697
  }
7718
7698
  }
7719
7699
  }
7720
- let turnEnv = hookEnv;
7721
- if (effectiveCwd && turnContext.runtime === "codex") {
7722
- const tmpDir = join15(effectiveCwd, "node_modules", ".cache", "cabane-tmp", turnId);
7723
- try {
7724
- mkdirSync11(tmpDir, { recursive: true });
7725
- turnEnv = { ...hookEnv, TMPDIR: tmpDir };
7726
- } catch (err) {
7727
- turnLog.warn(
7728
- { err: err instanceof Error ? err.message : String(err), tmpDir },
7729
- "dispatcher: failed to create per-turn TMPDIR \u2014 proceeding with the inherited temp dir"
7730
- );
7731
- }
7732
- }
7733
- if (turnContext.runtime === "codex" && process.env.CABANE_GATE_LOCK_DIR) {
7734
- turnEnv = { ...turnEnv, CABANE_GATE_LOCK_DIR: process.env.CABANE_GATE_LOCK_DIR };
7735
- }
7700
+ const turnEnv = hookEnv;
7736
7701
  const key = runKey(payload.conversationId, payload.agentId);
7737
7702
  const abortController = new AbortController();
7738
7703
  this.aborts.set(key, abortController);
package/dist/runtime.js CHANGED
@@ -4626,9 +4626,13 @@ function sealHeld2(held, terminal) {
4626
4626
  import { z as z11 } from "zod";
4627
4627
  function codexToolPolicy(policy) {
4628
4628
  return policy.hostFs ? {
4629
- permissionProfile: "cabane-coding",
4629
+ sandboxMode: "danger-full-access",
4630
+ // Headless: nothing to approve, because nothing is denied.
4630
4631
  approvalPolicy: "never",
4631
- networkAccessEnabled: policy.web
4632
+ // Full access means the command network is open regardless of the grant —
4633
+ // recorded as `true` so the value never claims a restriction that isn't
4634
+ // enforced.
4635
+ networkAccessEnabled: true
4632
4636
  } : {
4633
4637
  sandboxMode: "read-only",
4634
4638
  // Headless: the sandbox is the boundary; never pause for a human.
@@ -4748,7 +4752,6 @@ function buildConfig(req, baseInstructionsFile) {
4748
4752
  default_tools_approval_mode: "approve"
4749
4753
  };
4750
4754
  }
4751
- const policy = codexToolPolicy(req.policy);
4752
4755
  const tmpDir = req.local.env?.TMPDIR;
4753
4756
  const shellEnv = {};
4754
4757
  if (tmpDir) shellEnv.TMPDIR = tmpDir;
@@ -4756,7 +4759,6 @@ function buildConfig(req, baseInstructionsFile) {
4756
4759
  const value = req.local.env?.[key];
4757
4760
  if (value !== void 0) shellEnv[key] = value;
4758
4761
  }
4759
- const gateLockDir = req.local.env?.CABANE_GATE_LOCK_DIR;
4760
4762
  return {
4761
4763
  mcp_servers,
4762
4764
  experimental_use_rmcp_client: true,
@@ -4764,28 +4766,7 @@ function buildConfig(req, baseInstructionsFile) {
4764
4766
  // becomes Codex's base instructions, and Codex's own environment preamble goes
4765
4767
  // with the harness prompt it belonged to.
4766
4768
  ...baseInstructionsFile ? { model_instructions_file: baseInstructionsFile, include_environment_context: false } : {},
4767
- ...Object.keys(shellEnv).length ? { shell_environment_policy: { set: shellEnv } } : {},
4768
- ...policy.permissionProfile ? {
4769
- // CT733: named permission profiles are Codex's split-filesystem path.
4770
- // `:root = read` preserves coding-mode host reads; the one explicit
4771
- // workspace-root write grants the checkout, and the more-specific
4772
- // `.git` write reopens the metadata Codex protects by default. Neither
4773
- // rule grants an adjacent directory. Do not combine this with legacy `sandbox_mode` /
4774
- // `sandbox_workspace_write`, which would restore the `.git` carve-out.
4775
- approval_policy: policy.approvalPolicy,
4776
- default_permissions: policy.permissionProfile,
4777
- permissions: {
4778
- [policy.permissionProfile]: {
4779
- filesystem: {
4780
- ":root": "read",
4781
- ":workspace_roots": { ".": "write", ".git": "write" },
4782
- // The one absolute-path grant — see the CT612-fallout note above.
4783
- ...gateLockDir ? { [gateLockDir]: "write" } : {}
4784
- },
4785
- network: { enabled: policy.networkAccessEnabled, mode: "full" }
4786
- }
4787
- }
4788
- } : {}
4769
+ ...Object.keys(shellEnv).length ? { shell_environment_policy: { set: shellEnv } } : {}
4789
4770
  };
4790
4771
  }
4791
4772
  function isStringRecord2(v) {
@@ -4799,11 +4780,10 @@ import {
4799
4780
  function buildSdkThreadOptions(spec) {
4800
4781
  return {
4801
4782
  ...spec.model ? { model: spec.model } : {},
4802
- ...spec.policy.sandboxMode ? { sandboxMode: spec.policy.sandboxMode } : {},
4783
+ sandboxMode: spec.policy.sandboxMode,
4803
4784
  workingDirectory: spec.directory,
4804
4785
  skipGitRepoCheck: spec.skipGitRepoCheck,
4805
- ...spec.policy.sandboxMode ? { approvalPolicy: spec.policy.approvalPolicy } : {},
4806
- ...spec.policy.sandboxMode === "workspace-write" ? { networkAccessEnabled: spec.policy.networkAccessEnabled } : {},
4786
+ approvalPolicy: spec.policy.approvalPolicy,
4807
4787
  ...spec.modelReasoningEffort ? { modelReasoningEffort: spec.modelReasoningEffort } : {}
4808
4788
  };
4809
4789
  }
@@ -6829,22 +6809,7 @@ ${reason}`,
6829
6809
  }
6830
6810
  }
6831
6811
  }
6832
- let turnEnv = hookEnv;
6833
- if (effectiveCwd && turnContext.runtime === "codex") {
6834
- const tmpDir = join13(effectiveCwd, "node_modules", ".cache", "cabane-tmp", turnId);
6835
- try {
6836
- mkdirSync9(tmpDir, { recursive: true });
6837
- turnEnv = { ...hookEnv, TMPDIR: tmpDir };
6838
- } catch (err) {
6839
- turnLog.warn(
6840
- { err: err instanceof Error ? err.message : String(err), tmpDir },
6841
- "dispatcher: failed to create per-turn TMPDIR \u2014 proceeding with the inherited temp dir"
6842
- );
6843
- }
6844
- }
6845
- if (turnContext.runtime === "codex" && process.env.CABANE_GATE_LOCK_DIR) {
6846
- turnEnv = { ...turnEnv, CABANE_GATE_LOCK_DIR: process.env.CABANE_GATE_LOCK_DIR };
6847
- }
6812
+ const turnEnv = hookEnv;
6848
6813
  const key = runKey(payload.conversationId, payload.agentId);
6849
6814
  const abortController = new AbortController();
6850
6815
  this.aborts.set(key, abortController);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.31",
3
+ "version": "0.6.32",
4
4
  "type": "module",
5
5
  "description": "The Cabane Companion (headless): connect a coding agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
6
6
  "license": "UNLICENSED",