@lyupro/codex-bridge 0.5.2 → 0.5.3

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Platform flags a delegated run needs before its sandbox can start a process at all.
3
+ *
4
+ * codex-cli 0.149.0 on Windows runs sandboxed commands under a restricted token, and which token
5
+ * it builds is `windows.sandbox` — `elevated` or `unelevated`. The unelevated form refuses
6
+ * CreateProcess outright: every command the model tries comes back as
7
+ * `Rejected("… rejected: blocked by policy")` before the process exists. That setting lives in the
8
+ * operator's own config.toml, which `--ignore-user-config` deliberately drops, so on 2026-08-23
9
+ * every codex-scout and codex-review run died without reading a single file while codex-build
10
+ * kept working — not because writing is exempt, but because it is the one agent that does not pass
11
+ * `--ignore-user-config` and so inherited the operator's key by luck. Four probes on the installed
12
+ * CLI, differing by this flag alone, separate the two: with the key a run prints its command output
13
+ * and exits 0, without it both read-only AND workspace-write are refused.
14
+ *
15
+ * Naming the flag here keeps the isolation intact — a run still ignores the operator's config —
16
+ * and stops the package from depending on a line in a personal file it does not own.
17
+ *
18
+ * The value carries no quotes on purpose: unsafeForCmd() refuses any argument containing `"`,
19
+ * because the whole command line goes through cmd.exe. Codex parses `elevated` as a bare TOML
20
+ * literal, and rejects an unknown variant loudly, so the unquoted form is checked, not assumed.
21
+ */
22
+ export const WINDOWS_SANDBOX = ['-c', 'windows.sandbox=elevated'];
23
+
24
+ /** Empty off Windows: no other platform has this setting, and passing it would be an error. */
25
+ export function platformSandboxArgs(platform = process.platform) {
26
+ return platform === 'win32' ? [...WINDOWS_SANDBOX] : [];
27
+ }