windows-development-sandbox 1.18.4 → 1.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 (181) hide show
  1. package/README.md +1 -1
  2. package/config.example.json +9 -0
  3. package/dist/app/features/accounts/accounts.def.d.ts +4 -0
  4. package/dist/app/features/accounts/accounts.run.d.ts +1 -0
  5. package/dist/app/features/accounts/services.def.d.ts +3 -0
  6. package/dist/app/features/accounts/services.def.js +4 -2
  7. package/dist/app/features/accounts/services.run.d.ts +1 -0
  8. package/dist/app/features/accounts/services.run.js +3 -1
  9. package/dist/app/features/agent-commands/agent-commands.def.d.ts +37 -0
  10. package/dist/app/features/agent-commands/agent-commands.def.js +91 -0
  11. package/dist/app/features/agent-commands/agent-commands.run.d.ts +28 -0
  12. package/dist/app/features/agent-commands/agent-commands.run.js +35 -0
  13. package/dist/app/features/agent-commands/index.d.ts +2 -0
  14. package/dist/app/features/agent-commands/index.js +3 -0
  15. package/dist/app/features/agents/agents.def.d.ts +14 -1
  16. package/dist/app/features/agents/agents.def.js +61 -6
  17. package/dist/app/features/agents/agents.run.d.ts +1 -0
  18. package/dist/app/features/agents/agents.run.js +8 -1
  19. package/dist/app/features/agents/claude-env.def.d.ts +36 -0
  20. package/dist/app/features/agents/claude-env.def.js +305 -0
  21. package/dist/app/features/agents/env.def.d.ts +163 -0
  22. package/dist/app/features/agents/env.def.js +184 -0
  23. package/dist/app/features/agents/env.run.d.ts +43 -0
  24. package/dist/app/features/agents/env.run.js +86 -0
  25. package/dist/app/features/agents/index.d.ts +2 -0
  26. package/dist/app/features/agents/index.js +2 -0
  27. package/dist/app/features/defs.d.ts +132 -1
  28. package/dist/app/features/defs.js +9 -0
  29. package/dist/app/features/settings/categories.def.js +5 -2
  30. package/dist/app/features/settings/settings-rows.js +5 -1
  31. package/dist/app/features/settings/settings.run.d.ts +8 -0
  32. package/dist/app/features/settings/settings.run.js +9 -0
  33. package/dist/app/features/updates/updates.run.js +12 -2
  34. package/dist/app/features/vpn/vpn.def.d.ts +33 -0
  35. package/dist/app/features/vpn/vpn.def.js +30 -6
  36. package/dist/app/features/vpn/vpn.run.d.ts +11 -0
  37. package/dist/app/features/vpn/vpn.run.js +4 -1
  38. package/dist/app/kernel/rpc.d.ts +1 -1
  39. package/dist/app/registry.js +7 -1
  40. package/dist/bin/agent-sandbox.js +2 -2
  41. package/dist/bin/{chunk-MY7NLQQY.js → chunk-2IMT7ZCT.js} +1 -1
  42. package/dist/bin/{chunk-N4GXYTLV.js → chunk-DK4NTBUF.js} +69 -26
  43. package/dist/bin/{chunk-FRPLQLSY.js → chunk-Z2P5OGKL.js} +4323 -3463
  44. package/dist/bin/claude-host.js +2 -2
  45. package/dist/bin/claude-sbx.js +2 -2
  46. package/dist/bin/codex-sbx.js +2 -2
  47. package/dist/bin/gemini-sbx.js +2 -2
  48. package/dist/bin/sandbox.js +2 -2
  49. package/dist/bin/sbx-hide.js +2 -2
  50. package/dist/bin/sbx-show.js +2 -2
  51. package/dist/cli/commands/agent-commands.d.ts +0 -1
  52. package/dist/cli/commands/agent-commands.js +2 -32
  53. package/dist/cli/commands/index.d.ts +1 -1
  54. package/dist/cli/commands/index.js +1 -1
  55. package/dist/cli/commands/launch/launch.js +2 -2
  56. package/dist/cli/commands/registry.js +3 -2
  57. package/dist/cli/manifest.d.ts +1 -1
  58. package/dist/cli/manifest.js +1 -1
  59. package/dist/cli/menu/menu.d.ts +1 -1
  60. package/dist/cli/menu/menu.js +3 -3
  61. package/dist/cli/menu/pages/agents-page.d.ts +7 -2
  62. package/dist/cli/menu/pages/agents-page.js +67 -11
  63. package/dist/cli/menu/pages/maintenance-page.js +1 -2
  64. package/dist/cli/menu/pages/settings-page.js +1 -0
  65. package/dist/cli/menu/views.js +2 -1
  66. package/dist/cli/services/agent-commands-service.d.ts +2 -0
  67. package/dist/cli/services/agent-commands-service.js +13 -7
  68. package/dist/cli/services/vpn-service.d.ts +5 -1
  69. package/dist/cli/services/vpn-service.js +6 -1
  70. package/dist/cli/tui/dialogs/text-screen.js +2 -1
  71. package/dist/cli/tui/terminal.js +3 -1
  72. package/dist/core/config/defaults.js +9 -0
  73. package/dist/core/detect/toolchains.js +9 -0
  74. package/dist/core/disk.d.ts +1 -5
  75. package/dist/core/disk.js +1 -16
  76. package/dist/core/schema/codex.d.ts +29 -0
  77. package/dist/core/schema/codex.js +24 -0
  78. package/dist/core/schema/config.d.ts +46 -14
  79. package/dist/core/schema/config.js +2 -0
  80. package/dist/core/schema/index.d.ts +1 -0
  81. package/dist/core/schema/index.js +1 -0
  82. package/dist/core/schema/toolchains.d.ts +4 -0
  83. package/dist/core/schema/toolchains.js +3 -0
  84. package/dist/core/types.d.ts +2 -0
  85. package/dist/guest/accounts/apply.d.ts +6 -6
  86. package/dist/guest/agents/agent-files.d.ts +26 -6
  87. package/dist/guest/agents/agent-files.js +84 -14
  88. package/dist/guest/agents/local-state.d.ts +5 -2
  89. package/dist/guest/agents/local-state.js +24 -10
  90. package/dist/guest/boot/boot.js +10 -5
  91. package/dist/guest/daemon/sessions.js +2 -1
  92. package/dist/guest/toolchains/installers.d.ts +6 -10
  93. package/dist/guest/toolchains/installers.js +4 -12
  94. package/dist/guest/toolchains/native/autosdk.d.ts +3 -0
  95. package/dist/guest/toolchains/native/autosdk.js +50 -0
  96. package/dist/guest/toolchains/native/unreal.js +3 -0
  97. package/dist/guest/toolchains/native/vcruntime.d.ts +0 -3
  98. package/dist/guest/toolchains/native/vcruntime.js +2 -5
  99. package/dist/guest/toolchains/native/visual-studio.d.ts +2 -2
  100. package/dist/guest/toolchains/native/visual-studio.js +100 -16
  101. package/dist/guest/toolchains/native/vs-request.d.ts +21 -0
  102. package/dist/guest/toolchains/native/vs-request.js +60 -1
  103. package/dist/guest/toolchains/not-yet.d.ts +1 -1
  104. package/dist/guest/toolchains/not-yet.js +3 -3
  105. package/dist/guest/toolchains/persisted.js +2 -7
  106. package/dist/guest/toolchains/plan.js +9 -4
  107. package/dist/guest/toolchains/signature.d.ts +5 -0
  108. package/dist/guest/toolchains/signature.js +22 -0
  109. package/dist/guest/vpn/tunnel.d.ts +3 -0
  110. package/dist/guest/vpn/tunnel.js +10 -12
  111. package/dist/guest/vpn/vpn.js +6 -1
  112. package/dist/host/accounts/leases.d.ts +3 -3
  113. package/dist/host/accounts/source.js +1 -1
  114. package/dist/host/agent-commands/commands.js +1 -1
  115. package/dist/host/agent-commands/forwarders.d.ts +14 -2
  116. package/dist/host/agent-commands/forwarders.js +31 -13
  117. package/dist/host/agent-commands/reconcile.d.ts +2 -1
  118. package/dist/host/agent-commands/reconcile.js +7 -8
  119. package/dist/host/agent-commands/user-path.d.ts +5 -0
  120. package/dist/host/agent-commands/user-path.js +13 -0
  121. package/dist/host/launch/session-file.js +1 -0
  122. package/dist/host/profile/accounts.js +2 -4
  123. package/dist/host/profile/claude-login.d.ts +3 -2
  124. package/dist/host/profile/claude-login.js +3 -13
  125. package/dist/host/vpn/index.d.ts +2 -1
  126. package/dist/host/vpn/index.js +2 -1
  127. package/dist/host/vpn/last.d.ts +28 -0
  128. package/dist/host/vpn/last.js +43 -0
  129. package/dist/host/vpn/login.d.ts +3 -1
  130. package/dist/host/vpn/login.js +17 -3
  131. package/dist/runtime/agent.js +28 -0
  132. package/dist/runtime/daemon.js +1117 -912
  133. package/dist/runtime/db.js +30 -0
  134. package/dist/runtime/main.js +1308 -1036
  135. package/dist/runtime/netproxy.js +22 -0
  136. package/dist/runtime/tool.js +238 -208
  137. package/dist/runtime/view.js +22 -0
  138. package/dist/selftest/agent-commands.test.js +45 -7
  139. package/dist/selftest/agent-paths.test.js +1 -12
  140. package/dist/selftest/agent-settings.test.d.ts +2 -0
  141. package/dist/selftest/agent-settings.test.js +94 -0
  142. package/dist/selftest/app.test.js +2 -1
  143. package/dist/selftest/cli.test.js +4 -0
  144. package/dist/selftest/index.js +2 -0
  145. package/dist/selftest/menu.test.js +5 -3
  146. package/dist/selftest/pc-installs.test.js +5 -0
  147. package/dist/selftest/persisted-installs.test.js +69 -0
  148. package/dist/selftest/service-accounts.test.js +1 -1
  149. package/dist/selftest/support/engine-golden.js +1 -1
  150. package/dist/selftest/support/fixtures.d.ts +9 -0
  151. package/dist/selftest/vpn.test.js +51 -3
  152. package/dist/shared/accounts/anthropic.d.ts +5 -0
  153. package/dist/shared/accounts/anthropic.js +15 -0
  154. package/dist/shared/accounts/index.d.ts +1 -0
  155. package/dist/shared/accounts/index.js +1 -0
  156. package/dist/shared/channel/schema.d.ts +19 -0
  157. package/dist/shared/channel/schema.js +2 -0
  158. package/dist/shared/io/disk.d.ts +9 -0
  159. package/dist/shared/io/disk.js +19 -0
  160. package/dist/shared/io/index.d.ts +1 -0
  161. package/dist/shared/io/index.js +1 -0
  162. package/dist/shared/readiness.d.ts +9 -0
  163. package/dist/shared/readiness.js +11 -0
  164. package/dist/shared/signer.d.ts +24 -0
  165. package/dist/shared/signer.js +15 -0
  166. package/dist/shared/vpn/failure.d.ts +10 -0
  167. package/dist/shared/vpn/failure.js +28 -0
  168. package/dist/sync/watcher.js +2 -0
  169. package/dist/web/index.html +1 -1
  170. package/dist/web/{main-GVZWWP4I.js → main-OUUQYNK4.js} +75 -74
  171. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  172. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  173. package/native/csharp/HostTools/Program.cs +14 -1
  174. package/native/csharp/HostTools/UserPath.cs +17 -0
  175. package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
  176. package/native/scripts/edit-user-path.ps1 +6 -2
  177. package/package.json +1 -1
  178. package/sandbox/scripts/get-signature.ps1 +13 -0
  179. package/schemas/config.schema.json +64 -0
  180. package/schemas/sandbox-config.schema.json +8 -0
  181. package/sandbox/scripts/get-signer.ps1 +0 -8
@@ -38,6 +38,14 @@ export const DEFAULTS = {
38
38
  network: { blockPrivateRanges: true, allowOnly: [], blockHosts: [], forwardPorts: [], dns: [], proxy: '' },
39
39
  vpn: { enabled: false, provider: 'nordvpn', protocol: 'udp', country: '', configFile: '', killSwitch: true },
40
40
  github: { shareToken: false },
41
+ codex: {
42
+ sandboxMode: 'danger-full-access',
43
+ approvalPolicy: 'never',
44
+ model: '',
45
+ reasoningEffort: 'default',
46
+ windowsSandbox: 'off',
47
+ mcpLoginsInFile: true,
48
+ },
41
49
  accounts: {
42
50
  epic: { share: false },
43
51
  steam: { share: false },
@@ -78,6 +86,7 @@ export const DEFAULTS = {
78
86
  acceptLicense: false,
79
87
  components: [],
80
88
  keepInstallFiles: true,
89
+ visualStudio: 'full',
81
90
  persistEngines: true,
82
91
  derivedDataCache: 'persisted',
83
92
  },
@@ -1,3 +1,4 @@
1
+ import { isToolchainReady } from '../../shared/readiness.js';
1
2
  import { projectUses } from './versions.js';
2
3
  /** Files that show a project uses a language (looked for in the workspace and one folder down). */
3
4
  export const MARKERS = {
@@ -84,6 +85,8 @@ export function decideToolchains(settings, entries, pcHas, hints = {}) {
84
85
  const setting = settings[name].enabled;
85
86
  if (setting !== 'auto')
86
87
  return { on: setting, reason: setting ? 'enabled in config' : 'disabled in config' };
88
+ if (!isToolchainReady(name))
89
+ return { on: false, reason: 'coming in a later version' };
87
90
  const marker = MARKERS[name].map((m) => entries.find((e) => projectUses([e], [m]))).find(Boolean);
88
91
  if (marker)
89
92
  return { on: true, reason: marker };
@@ -124,9 +127,15 @@ function applyImplications(settings, result) {
124
127
  imply(settings, result, 'android', 'React Native builds for Android');
125
128
  if (result.godot.on && settings.godot.dotnet === true)
126
129
  imply(settings, result, 'dotnet', "Godot's .NET build");
130
+ if (result.unreal.on && settings.unreal.visualStudio === 'autosdk')
131
+ imply(settings, result, 'msvc', 'Unreal builds from the portable MSVC (AutoSDK)');
132
+ // Unreal's licence acceptance covers the MSVC it builds from (the same Visual Studio terms).
133
+ const autosdkLicence = settings.unreal.visualStudio === 'autosdk' && settings.unreal.acceptLicense;
127
134
  for (const name of LICENSED_TOOLCHAINS) {
128
135
  if (settings[name].enabled !== 'auto' || !result[name].on || settings[name].acceptLicense)
129
136
  continue;
137
+ if (name === 'msvc' && autosdkLicence)
138
+ continue;
130
139
  result[name] = {
131
140
  on: false,
132
141
  reason: 'would be used (' + result[name].reason + '); set toolchains.' + name + '.acceptLicense to install it',
@@ -8,11 +8,7 @@ export declare function humanBytes(bytes: number): string;
8
8
  export declare function sizeOf(p: string): number;
9
9
  /** sizeOf with a time budget: null when measuring would take longer than `ms` (a big data folder can take minutes). */
10
10
  export declare function sizeWithin(p: string, ms: number): number | null;
11
- /**
12
- * Free bytes on the drive that holds `dir` (which may not exist yet: the nearest existing parent is asked); null if
13
- * unknown.
14
- */
15
- export declare function freeBytesAt(dir: string): number | null;
11
+ export { freeBytesAt } from '../shared/io/disk.js';
16
12
  export interface DiskUsage {
17
13
  drive: string;
18
14
  totalBytes: number;
package/dist/core/disk.js CHANGED
@@ -59,22 +59,7 @@ export function sizeWithin(p, ms) {
59
59
  throw e;
60
60
  }
61
61
  }
62
- /**
63
- * Free bytes on the drive that holds `dir` (which may not exist yet: the nearest existing parent is asked); null if
64
- * unknown.
65
- */
66
- export function freeBytesAt(dir) {
67
- let at = path.resolve(dir);
68
- while (!fs.existsSync(at) && path.dirname(at) !== at)
69
- at = path.dirname(at);
70
- try {
71
- const s = fs.statfsSync(at);
72
- return s.bavail * s.bsize;
73
- }
74
- catch {
75
- return null;
76
- }
77
- }
62
+ export { freeBytesAt } from '../shared/io/disk.js';
78
63
  /** Every local drive's size and free space, and which one holds the sandbox storage. */
79
64
  export function diskUsage(storageRoot) {
80
65
  const storageDrive = path.parse(path.resolve(storageRoot)).root.toUpperCase();
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const CodexSchema: z.ZodObject<{
3
+ sandboxMode: z.ZodEnum<{
4
+ "danger-full-access": "danger-full-access";
5
+ "workspace-write": "workspace-write";
6
+ "read-only": "read-only";
7
+ }>;
8
+ approvalPolicy: z.ZodEnum<{
9
+ never: "never";
10
+ "on-request": "on-request";
11
+ "on-failure": "on-failure";
12
+ untrusted: "untrusted";
13
+ }>;
14
+ model: z.ZodString;
15
+ reasoningEffort: z.ZodEnum<{
16
+ default: "default";
17
+ minimal: "minimal";
18
+ low: "low";
19
+ medium: "medium";
20
+ high: "high";
21
+ xhigh: "xhigh";
22
+ }>;
23
+ windowsSandbox: z.ZodEnum<{
24
+ off: "off";
25
+ unelevated: "unelevated";
26
+ elevated: "elevated";
27
+ }>;
28
+ mcpLoginsInFile: z.ZodBoolean;
29
+ }, z.core.$strict>;
@@ -0,0 +1,24 @@
1
+ // How Codex runs inside the sandbox. Yours only: a project file (.sandbox-config.json) cannot change it.
2
+ import { z } from 'zod';
3
+ export const CodexSchema = z.strictObject({
4
+ sandboxMode: z
5
+ .enum(['danger-full-access', 'workspace-write', 'read-only'])
6
+ .describe("Codex's own sandbox. Inside Windows Sandbox Codex's own sandbox only slows it down (it re-grants file permissions over your profile at every boot), so the default is danger-full-access: Windows Sandbox is the sandbox."),
7
+ approvalPolicy: z
8
+ .enum(['never', 'on-request', 'on-failure', 'untrusted'])
9
+ .describe('When Codex asks before it runs a command. "never" with danger-full-access starts it with no questions.'),
10
+ model: z
11
+ .string()
12
+ .max(100)
13
+ .regex(/^[A-Za-z0-9._:/-]*$/, 'letters, digits and . _ : / - only')
14
+ .describe("The model Codex uses. Empty = Codex's own default."),
15
+ reasoningEffort: z
16
+ .enum(['default', 'minimal', 'low', 'medium', 'high', 'xhigh'])
17
+ .describe('How hard Codex thinks. "default" = Codex\'s own default.'),
18
+ windowsSandbox: z
19
+ .enum(['off', 'unelevated', 'elevated'])
20
+ .describe('Codex\'s Windows sandbox mode in its config.toml. "off" removes the setting so Codex does not set up its sandbox users and firewall rules at every boot.'),
21
+ mcpLoginsInFile: z
22
+ .boolean()
23
+ .describe('Keep the sign-ins of Codex\'s MCP servers in a file in the saved Codex folder (mcp_oauth_credentials_store = "file"), so they survive between sandboxes. A value you set in config.toml is kept.'),
24
+ });
@@ -190,6 +190,10 @@ export declare const ConfigSchema: z.ZodObject<{
190
190
  acceptLicense: z.ZodBoolean;
191
191
  components: z.ZodArray<z.ZodString>;
192
192
  keepInstallFiles: z.ZodBoolean;
193
+ visualStudio: z.ZodEnum<{
194
+ full: "full";
195
+ autosdk: "autosdk";
196
+ }>;
193
197
  persistEngines: z.ZodBoolean;
194
198
  derivedDataCache: z.ZodEnum<{
195
199
  persisted: "persisted";
@@ -444,6 +448,34 @@ export declare const ConfigSchema: z.ZodObject<{
444
448
  resumeArguments: z.ZodOptional<z.ZodArray<z.ZodString>>;
445
449
  resumeOneArguments: z.ZodOptional<z.ZodArray<z.ZodString>>;
446
450
  }, z.core.$strict>>;
451
+ codex: z.ZodObject<{
452
+ sandboxMode: z.ZodEnum<{
453
+ "danger-full-access": "danger-full-access";
454
+ "workspace-write": "workspace-write";
455
+ "read-only": "read-only";
456
+ }>;
457
+ approvalPolicy: z.ZodEnum<{
458
+ never: "never";
459
+ "on-request": "on-request";
460
+ "on-failure": "on-failure";
461
+ untrusted: "untrusted";
462
+ }>;
463
+ model: z.ZodString;
464
+ reasoningEffort: z.ZodEnum<{
465
+ default: "default";
466
+ minimal: "minimal";
467
+ low: "low";
468
+ medium: "medium";
469
+ high: "high";
470
+ xhigh: "xhigh";
471
+ }>;
472
+ windowsSandbox: z.ZodEnum<{
473
+ off: "off";
474
+ unelevated: "unelevated";
475
+ elevated: "elevated";
476
+ }>;
477
+ mcpLoginsInFile: z.ZodBoolean;
478
+ }, z.core.$strict>;
447
479
  hooks: z.ZodObject<{
448
480
  failFast: z.ZodBoolean;
449
481
  }, z.core.$strict>;
@@ -556,7 +588,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
556
588
  }, z.core.$strict>>;
557
589
  toolchains: z.ZodOptional<z.ZodObject<{
558
590
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
559
- node: z.ZodOptional<z.ZodObject<{
591
+ unity: z.ZodOptional<z.ZodObject<{
560
592
  enabled: z.ZodOptional<z.ZodBoolean>;
561
593
  }, z.core.$strict> | z.ZodObject<{
562
594
  version: z.ZodOptional<z.ZodString>;
@@ -571,7 +603,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
571
603
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
572
604
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
573
605
  }, z.core.$strict>>;
574
- go: z.ZodOptional<z.ZodObject<{
606
+ godot: z.ZodOptional<z.ZodObject<{
575
607
  enabled: z.ZodOptional<z.ZodBoolean>;
576
608
  }, z.core.$strict> | z.ZodObject<{
577
609
  version: z.ZodOptional<z.ZodString>;
@@ -586,7 +618,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
586
618
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
587
619
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
588
620
  }, z.core.$strict>>;
589
- python: z.ZodOptional<z.ZodObject<{
621
+ android: z.ZodOptional<z.ZodObject<{
590
622
  enabled: z.ZodOptional<z.ZodBoolean>;
591
623
  }, z.core.$strict> | z.ZodObject<{
592
624
  version: z.ZodOptional<z.ZodString>;
@@ -601,7 +633,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
601
633
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
602
634
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
603
635
  }, z.core.$strict>>;
604
- rust: z.ZodOptional<z.ZodObject<{
636
+ flutter: z.ZodOptional<z.ZodObject<{
605
637
  enabled: z.ZodOptional<z.ZodBoolean>;
606
638
  }, z.core.$strict> | z.ZodObject<{
607
639
  version: z.ZodOptional<z.ZodString>;
@@ -616,7 +648,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
616
648
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
617
649
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
618
650
  }, z.core.$strict>>;
619
- msvc: z.ZodOptional<z.ZodObject<{
651
+ dart: z.ZodOptional<z.ZodObject<{
620
652
  enabled: z.ZodOptional<z.ZodBoolean>;
621
653
  }, z.core.$strict> | z.ZodObject<{
622
654
  version: z.ZodOptional<z.ZodString>;
@@ -631,7 +663,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
631
663
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
632
664
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
633
665
  }, z.core.$strict>>;
634
- unreal: z.ZodOptional<z.ZodObject<{
666
+ reactNative: z.ZodOptional<z.ZodObject<{
635
667
  enabled: z.ZodOptional<z.ZodBoolean>;
636
668
  }, z.core.$strict> | z.ZodObject<{
637
669
  version: z.ZodOptional<z.ZodString>;
@@ -646,7 +678,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
646
678
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
647
679
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
648
680
  }, z.core.$strict>>;
649
- unity: z.ZodOptional<z.ZodObject<{
681
+ fivem: z.ZodOptional<z.ZodObject<{
650
682
  enabled: z.ZodOptional<z.ZodBoolean>;
651
683
  }, z.core.$strict> | z.ZodObject<{
652
684
  version: z.ZodOptional<z.ZodString>;
@@ -661,7 +693,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
661
693
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
662
694
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
663
695
  }, z.core.$strict>>;
664
- godot: z.ZodOptional<z.ZodObject<{
696
+ unreal: z.ZodOptional<z.ZodObject<{
665
697
  enabled: z.ZodOptional<z.ZodBoolean>;
666
698
  }, z.core.$strict> | z.ZodObject<{
667
699
  version: z.ZodOptional<z.ZodString>;
@@ -676,7 +708,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
676
708
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
677
709
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
678
710
  }, z.core.$strict>>;
679
- steam: z.ZodOptional<z.ZodObject<{
711
+ node: z.ZodOptional<z.ZodObject<{
680
712
  enabled: z.ZodOptional<z.ZodBoolean>;
681
713
  }, z.core.$strict> | z.ZodObject<{
682
714
  version: z.ZodOptional<z.ZodString>;
@@ -691,7 +723,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
691
723
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
692
724
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
693
725
  }, z.core.$strict>>;
694
- fivem: z.ZodOptional<z.ZodObject<{
726
+ go: z.ZodOptional<z.ZodObject<{
695
727
  enabled: z.ZodOptional<z.ZodBoolean>;
696
728
  }, z.core.$strict> | z.ZodObject<{
697
729
  version: z.ZodOptional<z.ZodString>;
@@ -706,7 +738,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
706
738
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
707
739
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
708
740
  }, z.core.$strict>>;
709
- android: z.ZodOptional<z.ZodObject<{
741
+ python: z.ZodOptional<z.ZodObject<{
710
742
  enabled: z.ZodOptional<z.ZodBoolean>;
711
743
  }, z.core.$strict> | z.ZodObject<{
712
744
  version: z.ZodOptional<z.ZodString>;
@@ -721,7 +753,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
721
753
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
722
754
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
723
755
  }, z.core.$strict>>;
724
- flutter: z.ZodOptional<z.ZodObject<{
756
+ rust: z.ZodOptional<z.ZodObject<{
725
757
  enabled: z.ZodOptional<z.ZodBoolean>;
726
758
  }, z.core.$strict> | z.ZodObject<{
727
759
  version: z.ZodOptional<z.ZodString>;
@@ -736,7 +768,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
736
768
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
737
769
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
738
770
  }, z.core.$strict>>;
739
- dart: z.ZodOptional<z.ZodObject<{
771
+ msvc: z.ZodOptional<z.ZodObject<{
740
772
  enabled: z.ZodOptional<z.ZodBoolean>;
741
773
  }, z.core.$strict> | z.ZodObject<{
742
774
  version: z.ZodOptional<z.ZodString>;
@@ -751,7 +783,7 @@ export declare const LocalOverridesSchema: z.ZodObject<{
751
783
  zstd: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
752
784
  openssl: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
753
785
  }, z.core.$strict>>;
754
- reactNative: z.ZodOptional<z.ZodObject<{
786
+ steam: z.ZodOptional<z.ZodObject<{
755
787
  enabled: z.ZodOptional<z.ZodBoolean>;
756
788
  }, z.core.$strict> | z.ZodObject<{
757
789
  version: z.ZodOptional<z.ZodString>;
@@ -4,6 +4,7 @@ import _ from 'lodash';
4
4
  import { z } from 'zod';
5
5
  import { NameSchema, SchemaRefSchema, StringsSchema, toggle } from './common.js';
6
6
  import { DatabasesSchema } from './databases.js';
7
+ import { CodexSchema } from './codex.js';
7
8
  import { HarnessSchema } from './harness.js';
8
9
  import { AgentCommandsSchema, AttachSchema, ClaudeProfileSchema, SecretsSchema } from './profile.js';
9
10
  import { AuditSchema, DownloadsSchema, SharingSchema, GitSchema, GuestWorkspaceSchema, MappingSchema, NetworkSchema, ProvisioningSchema, SandboxSchema, WorkspaceFilterSchema, } from './sandbox.js';
@@ -101,6 +102,7 @@ export const ConfigSchema = z
101
102
  apps: AppsSchema,
102
103
  claudeProfile: ClaudeProfileSchema,
103
104
  harnesses: z.record(NameSchema, HarnessSchema).describe('Agents that can run in the sandbox.'),
105
+ codex: CodexSchema,
104
106
  hooks: z.strictObject({ failFast: z.boolean().describe('Stop when a hook script fails.') }),
105
107
  projects: ProjectsSchema.describe('Several projects in one sandbox: folders of projects mapped at every start, and adding folders while it runs.'),
106
108
  resume: ResumeSchema.describe('Reopening the sessions of the last sandbox when a new one starts.'),
@@ -2,6 +2,7 @@ export { GitAccessSchema, NameSchema, secret } from './common.js';
2
2
  export { REDACTED, redactSecrets, scrubSecrets, secretPaths, secretValues } from './redact.js';
3
3
  export { ConfigSchema, LocalOverridesSchema } from './config.js';
4
4
  export { HarnessSchema } from './harness.js';
5
+ export { CodexSchema } from './codex.js';
5
6
  export { describeIssues, jsonSchemas } from './json-schema.js';
6
7
  export { MappingSchema } from './sandbox.js';
7
8
  export { ToolchainsSchema } from './toolchains.js';
@@ -4,6 +4,7 @@ export { GitAccessSchema, NameSchema, secret } from './common.js';
4
4
  export { REDACTED, redactSecrets, scrubSecrets, secretPaths, secretValues } from './redact.js';
5
5
  export { ConfigSchema, LocalOverridesSchema } from './config.js';
6
6
  export { HarnessSchema } from './harness.js';
7
+ export { CodexSchema } from './codex.js';
7
8
  export { describeIssues, jsonSchemas } from './json-schema.js';
8
9
  export { MappingSchema } from './sandbox.js';
9
10
  export { ToolchainsSchema } from './toolchains.js';
@@ -39,6 +39,10 @@ export declare const ToolchainsSchema: z.ZodObject<{
39
39
  acceptLicense: z.ZodBoolean;
40
40
  components: z.ZodArray<z.ZodString>;
41
41
  keepInstallFiles: z.ZodBoolean;
42
+ visualStudio: z.ZodEnum<{
43
+ full: "full";
44
+ autosdk: "autosdk";
45
+ }>;
42
46
  persistEngines: z.ZodBoolean;
43
47
  derivedDataCache: z.ZodEnum<{
44
48
  persisted: "persisted";
@@ -62,6 +62,9 @@ export const ToolchainsSchema = z.strictObject({
62
62
  keepInstallFiles: z
63
63
  .boolean()
64
64
  .describe('Keep an offline copy of the Visual Studio install files in tools\\visualstudio (~10 GB, made once), so later boots install without downloading them again. Skipped while that disk has too little room.'),
65
+ visualStudio: z
66
+ .enum(['full', 'autosdk'])
67
+ .describe('"full": install Visual Studio Community (the engine finds it through the Setup API; ~10 GB, redone every boot). "autosdk" (experimental): skip Visual Studio and build an Unreal AutoSDK tree from the portable MSVC in tools\\unreal\\autosdk (kept between sandboxes); UnrealBuildTool finds MSVC through AutoSDK, but the editor\'s Visual Studio integration is not available. Needs toolchains.msvc (turned on for you).'),
65
68
  persistEngines: z
66
69
  .boolean()
67
70
  .describe('Engines the Epic Games Launcher installs go to tools\\unreal\\engines (kept between sandboxes, 40-60 GB each) and are registered with the launcher again every boot. Off: they go on the sandbox disk and are lost when it closes. Engines installed on this PC can be mapped instead (pcInstalls.unrealEngines).'),
@@ -284,6 +284,8 @@ export interface GuestSession {
284
284
  * creates.
285
285
  */
286
286
  agentBackstop?: 'auto' | 'none' | number;
287
+ /** The codex settings: the flags every Codex start gets and what boot writes to its config.toml. */
288
+ codex?: Config['codex'];
287
289
  /** "gentle" when vGPU is on: the governor and the watchdog act earlier, compilers run below normal. */
288
290
  loadProfile?: 'normal' | 'gentle';
289
291
  /** sandbox.pressureResponse: the daemon slows builds down when memory runs low. */
@@ -5,23 +5,23 @@ import { type GuestAdapter } from './adapter.js';
5
5
  export declare const DeliveredSchema: z.ZodObject<{
6
6
  fingerprints: z.ZodRecord<z.ZodEnum<{
7
7
  unity: "unity";
8
- steam: "steam";
9
- epic: "epic";
10
- cfx: "cfx";
11
8
  keystore: "keystore";
12
9
  play: "play";
13
10
  expo: "expo";
14
11
  appstore: "appstore";
12
+ cfx: "cfx";
13
+ steam: "steam";
14
+ epic: "epic";
15
15
  }> & z.core.$partial, z.ZodString>;
16
16
  leased: z.ZodArray<z.ZodEnum<{
17
17
  unity: "unity";
18
- steam: "steam";
19
- epic: "epic";
20
- cfx: "cfx";
21
18
  keystore: "keystore";
22
19
  play: "play";
23
20
  expo: "expo";
24
21
  appstore: "appstore";
22
+ cfx: "cfx";
23
+ steam: "steam";
24
+ epic: "epic";
25
25
  }>>;
26
26
  }, z.core.$strip>;
27
27
  export type Delivered = z.output<typeof DeliveredSchema>;
@@ -1,4 +1,4 @@
1
- import type { Harness } from '../../core/types.js';
1
+ import type { Config, Harness } from '../../core/types.js';
2
2
  /** Where an agent lives in persistent storage: its folder, and the program (an .exe, or an npm .cmd) in it. */
3
3
  export interface AgentPaths {
4
4
  readonly dir: string;
@@ -13,12 +13,14 @@ export interface AgentShim {
13
13
  readonly name: string;
14
14
  readonly command: string;
15
15
  readonly target: string;
16
+ /** Flags the shim puts before the arguments of the caller (codex: the sandbox's own settings). */
17
+ readonly arguments?: readonly string[];
16
18
  }
17
19
  /** One shim per configured agent that can be installed here (a name that is not a plain command word is skipped). */
18
- export declare function agentShims(toolsDir: string, agents: Readonly<Record<string, Harness>>): AgentShim[];
20
+ export declare function agentShims(toolsDir: string, agents: Readonly<Record<string, Harness>>, flags?: Readonly<Record<string, readonly string[]>>): AgentShim[];
19
21
  /**
20
22
  * The text of `<command>.cmd`: runs the installed agent, or installs it first (`install` = node + installer script).
21
- * The agent's own arguments pass through %* untouched.
23
+ * The agent's own arguments pass through %* untouched, after the shim's flags if it has any.
22
24
  */
23
25
  export declare function shimText(shim: AgentShim, install: {
24
26
  node: string;
@@ -48,13 +50,31 @@ export declare function bootResetPaths(agents: Readonly<Record<string, Harness>>
48
50
  agent: string;
49
51
  path: string;
50
52
  }[];
53
+ type CodexSettings = Config['codex'];
51
54
  /**
52
- * Codex's config.toml with its own command sandbox off, or null when it already says which one to use. Inside Windows
53
- * Sandbox that inner sandbox only costs: its setup re-grants ACLs over the whole profile at every boot (minutes), and
54
- * every command hangs until it is done. A `sandbox_mode` the user set (before the first [table]) is kept.
55
+ * The flags every Codex start gets. Flags beat config.toml and a resumed thread's saved permissions, which is why the
56
+ * sandbox does not rely on the file. Full access with no questions is the one flag that skips Codex's Windows sandbox
57
+ * setup for certain. Pure.
58
+ */
59
+ export declare function codexArguments(c: CodexSettings): string[];
60
+ /** The arguments an agent always starts with: its own, and for codex the sandbox's settings. */
61
+ export declare function agentArguments(name: string, harness: Harness, codex: CodexSettings | undefined): string[];
62
+ /** The largest config.toml the sandbox edits. */
63
+ export declare const MAX_CODEX_CONFIG_BYTES: number;
64
+ /**
65
+ * Codex's config.toml as the sandbox wants it, every other line byte for byte: the lines an older version wrote above
66
+ * the first table (sandbox_mode, approval_policy, under the marker comment) are gone, `[windows] sandbox` follows
67
+ * windowsSandbox ("off" removes the line, so Codex does not set up its own sandbox users), and
68
+ * mcp_oauth_credentials_store = "file" is added when it is not set. Running it again changes nothing. Pure.
69
+ */
70
+ export declare function codexConfigOwned(toml: string, c: CodexSettings): string;
71
+ /**
72
+ * Codex's config.toml with its own command sandbox off, or null when that changes nothing. Kept for callers that
73
+ * predate the codex settings; use codexConfigOwned.
55
74
  */
56
75
  export declare function codexConfigWithoutSandbox(toml: string): string | null;
57
76
  /** A SQLite database file or one of its -wal / -shm siblings. */
58
77
  export declare const isDatabaseFile: (name: string) => boolean;
59
78
  /** Files that make a consistent copy: the databases and their -wal (the -shm is rebuilt by SQLite). */
60
79
  export declare const isCopyableDatabaseFile: (name: string) => boolean;
80
+ export {};
@@ -15,19 +15,19 @@ export function agentCommand(name, harness) {
15
15
  return harness.npmBin ?? harness.uvBin ?? (harness.hostExecutable ?? name).replace(/\.exe$/i, '');
16
16
  }
17
17
  /** One shim per configured agent that can be installed here (a name that is not a plain command word is skipped). */
18
- export function agentShims(toolsDir, agents) {
18
+ export function agentShims(toolsDir, agents, flags = {}) {
19
19
  return Object.entries(agents).flatMap(([name, harness]) => {
20
20
  const p = agentPaths(toolsDir, name, harness);
21
21
  const target = p.exe ?? p.cmd;
22
22
  const command = agentCommand(name, harness);
23
23
  return target && /^[A-Za-z0-9_-]+$/.test(command) && /^[A-Za-z0-9_-]+$/.test(name)
24
- ? [{ name, command, target }]
24
+ ? [{ name, command, target, ...(flags[name]?.length ? { arguments: flags[name] } : {}) }]
25
25
  : [];
26
26
  });
27
27
  }
28
28
  /**
29
29
  * The text of `<command>.cmd`: runs the installed agent, or installs it first (`install` = node + installer script).
30
- * The agent's own arguments pass through %* untouched.
30
+ * The agent's own arguments pass through %* untouched, after the shim's flags if it has any.
31
31
  */
32
32
  export function shimText(shim, install) {
33
33
  return [
@@ -39,7 +39,7 @@ export function shimText(shim, install) {
39
39
  '"' + install.node + '" "' + install.script + '" install ' + shim.name,
40
40
  'if errorlevel 1 exit /b 1',
41
41
  ':run',
42
- 'endlocal & "%SBX_REAL%" %*',
42
+ 'endlocal & "%SBX_REAL%" ' + (shim.arguments?.length ? shim.arguments.join(' ') + ' ' : '') + '%*',
43
43
  '',
44
44
  ].join('\r\n');
45
45
  }
@@ -61,19 +61,89 @@ export function localStateEntries(agents, stateDir, localRoot) {
61
61
  export function bootResetPaths(agents, stateDir) {
62
62
  return Object.entries(agents).flatMap(([agent, harness]) => (harness.bootReset ?? []).map((rel) => ({ agent, path: path.join(stateDir, agent, rel) })));
63
63
  }
64
+ /** The marker the sandbox puts above the lines it writes into config.toml. */
65
+ const CODEX_MARKER = '# Set by the sandbox';
64
66
  /**
65
- * Codex's config.toml with its own command sandbox off, or null when it already says which one to use. Inside Windows
66
- * Sandbox that inner sandbox only costs: its setup re-grants ACLs over the whole profile at every boot (minutes), and
67
- * every command hangs until it is done. A `sandbox_mode` the user set (before the first [table]) is kept.
67
+ * The flags every Codex start gets. Flags beat config.toml and a resumed thread's saved permissions, which is why the
68
+ * sandbox does not rely on the file. Full access with no questions is the one flag that skips Codex's Windows sandbox
69
+ * setup for certain. Pure.
70
+ */
71
+ export function codexArguments(c) {
72
+ const out = c.sandboxMode === 'danger-full-access' && c.approvalPolicy === 'never'
73
+ ? ['--dangerously-bypass-approvals-and-sandbox']
74
+ : ['--sandbox', c.sandboxMode, '--ask-for-approval', c.approvalPolicy];
75
+ if (c.model)
76
+ out.push('-c', 'model="' + c.model + '"');
77
+ if (c.reasoningEffort !== 'default')
78
+ out.push('-c', 'model_reasoning_effort="' + c.reasoningEffort + '"');
79
+ return out;
80
+ }
81
+ /** The arguments an agent always starts with: its own, and for codex the sandbox's settings. */
82
+ export function agentArguments(name, harness, codex) {
83
+ return name === 'codex' && codex ? [...harness.arguments, ...codexArguments(codex)] : [...harness.arguments];
84
+ }
85
+ /** The largest config.toml the sandbox edits. */
86
+ export const MAX_CODEX_CONFIG_BYTES = 1024 * 1024;
87
+ /**
88
+ * Codex's config.toml as the sandbox wants it, every other line byte for byte: the lines an older version wrote above
89
+ * the first table (sandbox_mode, approval_policy, under the marker comment) are gone, `[windows] sandbox` follows
90
+ * windowsSandbox ("off" removes the line, so Codex does not set up its own sandbox users), and
91
+ * mcp_oauth_credentials_store = "file" is added when it is not set. Running it again changes nothing. Pure.
92
+ */
93
+ export function codexConfigOwned(toml, c) {
94
+ const eol = toml.includes('\r\n') ? '\r\n' : '\n';
95
+ const firstTable = toml.search(/^[ \t]*\[/m);
96
+ let top = firstTable < 0 ? toml : toml.slice(0, firstTable);
97
+ const tables = firstTable < 0 ? '' : toml.slice(firstTable);
98
+ top = top.replace(MARKED_LINES, '');
99
+ if (c.mcpLoginsInFile && !/^[ \t]*mcp_oauth_credentials_store[ \t]*=/m.test(top)) {
100
+ if (top && !top.endsWith('\n'))
101
+ top += eol;
102
+ top += 'mcp_oauth_credentials_store = "file"' + eol + (tables ? eol : '');
103
+ }
104
+ return top + codexWindowsSandbox(tables, c.windowsSandbox, eol);
105
+ }
106
+ /** The lines an older version wrote above the first table: its marker comment, then sandbox_mode / approval_policy. */
107
+ const MARKED_LINES = new RegExp('^' + CODEX_MARKER + '[^\r\n]*\r?\n(?:(?:sandbox_mode|approval_policy)[ \t]*=[^\r\n]*\r?\n)*(?:[ \t]*\r?\n)?', 'm');
108
+ /** The tables of config.toml (from the first one on) with `[windows] sandbox` set to the mode, or removed for "off". */
109
+ function codexWindowsSandbox(tables, mode, eol) {
110
+ const setting = 'sandbox = "' + mode + '"';
111
+ const header = /^[ \t]*\[windows\][ \t]*(#[^\r\n]*)?(\r?\n|$)/m.exec(tables);
112
+ if (!header) {
113
+ if (mode === 'off')
114
+ return tables;
115
+ const gap = tables && !tables.endsWith('\n') ? eol : '';
116
+ return tables + gap + (tables ? eol : '') + '[windows]' + eol + setting + eol;
117
+ }
118
+ const bodyStart = header.index + header[0].length;
119
+ const next = tables.slice(bodyStart).search(/^[ \t]*\[/m);
120
+ const bodyEnd = next < 0 ? tables.length : bodyStart + next;
121
+ const body = tables.slice(bodyStart, bodyEnd);
122
+ const line = /^[ \t]*sandbox[ \t]*=[^\r\n]*(\r?\n|$)/m.exec(body);
123
+ let updated;
124
+ if (!line)
125
+ updated = mode === 'off' ? body : setting + eol + body;
126
+ else if (mode === 'off')
127
+ updated = body.slice(0, line.index) + body.slice(line.index + line[0].length);
128
+ else
129
+ updated = body.slice(0, line.index) + setting + line[1] + body.slice(line.index + line[0].length);
130
+ const head = tables.slice(0, bodyStart);
131
+ return (head.endsWith('\n') || !updated ? head : head + eol) + updated + tables.slice(bodyEnd);
132
+ }
133
+ /**
134
+ * Codex's config.toml with its own command sandbox off, or null when that changes nothing. Kept for callers that
135
+ * predate the codex settings; use codexConfigOwned.
68
136
  */
69
137
  export function codexConfigWithoutSandbox(toml) {
70
- const firstTable = toml.search(/^\s*\[/m);
71
- const topLevel = firstTable < 0 ? toml : toml.slice(0, firstTable);
72
- if (/^\s*sandbox_mode\s*=/m.test(topLevel))
73
- return null;
74
- return ('# Set by the sandbox: Windows Sandbox already contains Codex, its own command sandbox would only slow it down.\n' +
75
- 'sandbox_mode = "danger-full-access"\n' +
76
- (toml ? '\n' + toml : ''));
138
+ const out = codexConfigOwned(toml, {
139
+ sandboxMode: 'danger-full-access',
140
+ approvalPolicy: 'never',
141
+ model: '',
142
+ reasoningEffort: 'default',
143
+ windowsSandbox: 'off',
144
+ mcpLoginsInFile: true,
145
+ });
146
+ return out === toml ? null : out;
77
147
  }
78
148
  /** A SQLite database file or one of its -wal / -shm siblings. */
79
149
  export const isDatabaseFile = (name) => /\.(sqlite3?|db)(-wal|-shm)?$/i.test(name);
@@ -5,8 +5,11 @@ export declare function agentLocalStates(): LocalState[];
5
5
  export declare function localStateVars(): Record<string, string>;
6
6
  /** Boot: what an agent sealed to the last sandbox (bootReset) is deleted, so it sets it up again. Links are left. */
7
7
  export declare function resetMachineBound(): void;
8
- /** Boot: Codex runs its commands without its own sandbox (codexConfigWithoutSandbox), unless the user picked one. */
9
- export declare function codexWithoutInnerSandbox(): void;
8
+ /**
9
+ * Boot: Codex's config.toml follows the codex settings (codexConfigOwned): no Windows sandbox setup of its own, its MCP
10
+ * logins in a file. The sandbox mode itself travels as launch flags (codexArguments), which beat this file.
11
+ */
12
+ export declare function codexBootConfig(): void;
10
13
  /** Boot: the saved databases of every configured agent are copied to the sandbox's disk, where the agent runs them. */
11
14
  export declare function restoreLocalState(): void;
12
15
  /**