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
@@ -1363,11 +1363,11 @@ var require_lodash = __commonJS({
1363
1363
  return isFunction(object2[key]);
1364
1364
  });
1365
1365
  }
1366
- function baseGet(object2, path16) {
1367
- path16 = castPath(path16, object2);
1368
- var index = 0, length = path16.length;
1366
+ function baseGet(object2, path17) {
1367
+ path17 = castPath(path17, object2);
1368
+ var index = 0, length = path17.length;
1369
1369
  while (object2 != null && index < length) {
1370
- object2 = object2[toKey(path16[index++])];
1370
+ object2 = object2[toKey(path17[index++])];
1371
1371
  }
1372
1372
  return index && index == length ? object2 : undefined2;
1373
1373
  }
@@ -1431,10 +1431,10 @@ var require_lodash = __commonJS({
1431
1431
  });
1432
1432
  return accumulator;
1433
1433
  }
1434
- function baseInvoke(object2, path16, args2) {
1435
- path16 = castPath(path16, object2);
1436
- object2 = parent(object2, path16);
1437
- var func = object2 == null ? object2 : object2[toKey(last(path16))];
1434
+ function baseInvoke(object2, path17, args2) {
1435
+ path17 = castPath(path17, object2);
1436
+ object2 = parent(object2, path17);
1437
+ var func = object2 == null ? object2 : object2[toKey(last(path17))];
1438
1438
  return func == null ? undefined2 : apply(func, object2, args2);
1439
1439
  }
1440
1440
  function baseIsArguments(value) {
@@ -1590,13 +1590,13 @@ var require_lodash = __commonJS({
1590
1590
  return object2 === source || baseIsMatch(object2, source, matchData);
1591
1591
  };
1592
1592
  }
1593
- function baseMatchesProperty(path16, srcValue) {
1594
- if (isKey(path16) && isStrictComparable(srcValue)) {
1595
- return matchesStrictComparable(toKey(path16), srcValue);
1593
+ function baseMatchesProperty(path17, srcValue) {
1594
+ if (isKey(path17) && isStrictComparable(srcValue)) {
1595
+ return matchesStrictComparable(toKey(path17), srcValue);
1596
1596
  }
1597
1597
  return function(object2) {
1598
- var objValue = get(object2, path16);
1599
- return objValue === undefined2 && objValue === srcValue ? hasIn(object2, path16) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
1598
+ var objValue = get(object2, path17);
1599
+ return objValue === undefined2 && objValue === srcValue ? hasIn(object2, path17) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
1600
1600
  };
1601
1601
  }
1602
1602
  function baseMerge(object2, source, srcIndex, customizer, stack) {
@@ -1693,23 +1693,23 @@ var require_lodash = __commonJS({
1693
1693
  });
1694
1694
  }
1695
1695
  function basePick(object2, paths) {
1696
- return basePickBy(object2, paths, function(value, path16) {
1697
- return hasIn(object2, path16);
1696
+ return basePickBy(object2, paths, function(value, path17) {
1697
+ return hasIn(object2, path17);
1698
1698
  });
1699
1699
  }
1700
1700
  function basePickBy(object2, paths, predicate) {
1701
1701
  var index = -1, length = paths.length, result2 = {};
1702
1702
  while (++index < length) {
1703
- var path16 = paths[index], value = baseGet(object2, path16);
1704
- if (predicate(value, path16)) {
1705
- baseSet(result2, castPath(path16, object2), value);
1703
+ var path17 = paths[index], value = baseGet(object2, path17);
1704
+ if (predicate(value, path17)) {
1705
+ baseSet(result2, castPath(path17, object2), value);
1706
1706
  }
1707
1707
  }
1708
1708
  return result2;
1709
1709
  }
1710
- function basePropertyDeep(path16) {
1710
+ function basePropertyDeep(path17) {
1711
1711
  return function(object2) {
1712
- return baseGet(object2, path16);
1712
+ return baseGet(object2, path17);
1713
1713
  };
1714
1714
  }
1715
1715
  function basePullAll(array2, values2, iteratee2, comparator) {
@@ -1783,14 +1783,14 @@ var require_lodash = __commonJS({
1783
1783
  var array2 = values(collection);
1784
1784
  return shuffleSelf(array2, baseClamp(n, 0, array2.length));
1785
1785
  }
1786
- function baseSet(object2, path16, value, customizer) {
1786
+ function baseSet(object2, path17, value, customizer) {
1787
1787
  if (!isObject2(object2)) {
1788
1788
  return object2;
1789
1789
  }
1790
- path16 = castPath(path16, object2);
1791
- var index = -1, length = path16.length, lastIndex = length - 1, nested = object2;
1790
+ path17 = castPath(path17, object2);
1791
+ var index = -1, length = path17.length, lastIndex = length - 1, nested = object2;
1792
1792
  while (nested != null && ++index < length) {
1793
- var key = toKey(path16[index]), newValue = value;
1793
+ var key = toKey(path17[index]), newValue = value;
1794
1794
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
1795
1795
  return object2;
1796
1796
  }
@@ -1798,7 +1798,7 @@ var require_lodash = __commonJS({
1798
1798
  var objValue = nested[key];
1799
1799
  newValue = customizer ? customizer(objValue, key, nested) : undefined2;
1800
1800
  if (newValue === undefined2) {
1801
- newValue = isObject2(objValue) ? objValue : isIndex(path16[index + 1]) ? [] : {};
1801
+ newValue = isObject2(objValue) ? objValue : isIndex(path17[index + 1]) ? [] : {};
1802
1802
  }
1803
1803
  }
1804
1804
  assignValue(nested, key, newValue);
@@ -1964,14 +1964,14 @@ var require_lodash = __commonJS({
1964
1964
  }
1965
1965
  return result2;
1966
1966
  }
1967
- function baseUnset(object2, path16) {
1968
- path16 = castPath(path16, object2);
1969
- var index = -1, length = path16.length;
1967
+ function baseUnset(object2, path17) {
1968
+ path17 = castPath(path17, object2);
1969
+ var index = -1, length = path17.length;
1970
1970
  if (!length) {
1971
1971
  return true;
1972
1972
  }
1973
1973
  while (++index < length) {
1974
- var key = toKey(path16[index]);
1974
+ var key = toKey(path17[index]);
1975
1975
  if (key === "__proto__" && !hasOwnProperty.call(object2, "__proto__")) {
1976
1976
  return false;
1977
1977
  }
@@ -1979,11 +1979,11 @@ var require_lodash = __commonJS({
1979
1979
  return false;
1980
1980
  }
1981
1981
  }
1982
- var obj = parent(object2, path16);
1983
- return obj == null || delete obj[toKey(last(path16))];
1982
+ var obj = parent(object2, path17);
1983
+ return obj == null || delete obj[toKey(last(path17))];
1984
1984
  }
1985
- function baseUpdate(object2, path16, updater, customizer) {
1986
- return baseSet(object2, path16, updater(baseGet(object2, path16)), customizer);
1985
+ function baseUpdate(object2, path17, updater, customizer) {
1986
+ return baseSet(object2, path17, updater(baseGet(object2, path17)), customizer);
1987
1987
  }
1988
1988
  function baseWhile(array2, predicate, isDrop, fromRight) {
1989
1989
  var length = array2.length, index = fromRight ? length : -1;
@@ -2866,11 +2866,11 @@ var require_lodash = __commonJS({
2866
2866
  var match = source.match(reWrapDetails);
2867
2867
  return match ? match[1].split(reSplitDetails) : [];
2868
2868
  }
2869
- function hasPath(object2, path16, hasFunc) {
2870
- path16 = castPath(path16, object2);
2871
- var index = -1, length = path16.length, result2 = false;
2869
+ function hasPath(object2, path17, hasFunc) {
2870
+ path17 = castPath(path17, object2);
2871
+ var index = -1, length = path17.length, result2 = false;
2872
2872
  while (++index < length) {
2873
- var key = toKey(path16[index]);
2873
+ var key = toKey(path17[index]);
2874
2874
  if (!(result2 = object2 != null && hasFunc(object2, key))) {
2875
2875
  break;
2876
2876
  }
@@ -3072,8 +3072,8 @@ var require_lodash = __commonJS({
3072
3072
  return apply(func, this, otherArgs);
3073
3073
  };
3074
3074
  }
3075
- function parent(object2, path16) {
3076
- return path16.length < 2 ? object2 : baseGet(object2, baseSlice(path16, 0, -1));
3075
+ function parent(object2, path17) {
3076
+ return path17.length < 2 ? object2 : baseGet(object2, baseSlice(path17, 0, -1));
3077
3077
  }
3078
3078
  function reorder(array2, indexes) {
3079
3079
  var arrLength = array2.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array2);
@@ -3708,10 +3708,10 @@ var require_lodash = __commonJS({
3708
3708
  }
3709
3709
  return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
3710
3710
  }
3711
- var invokeMap = baseRest(function(collection, path16, args2) {
3712
- var index = -1, isFunc = typeof path16 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
3711
+ var invokeMap = baseRest(function(collection, path17, args2) {
3712
+ var index = -1, isFunc = typeof path17 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
3713
3713
  baseEach(collection, function(value) {
3714
- result2[++index] = isFunc ? apply(path16, value, args2) : baseInvoke(value, path16, args2);
3714
+ result2[++index] = isFunc ? apply(path17, value, args2) : baseInvoke(value, path17, args2);
3715
3715
  });
3716
3716
  return result2;
3717
3717
  });
@@ -4363,15 +4363,15 @@ var require_lodash = __commonJS({
4363
4363
  function functionsIn(object2) {
4364
4364
  return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
4365
4365
  }
4366
- function get(object2, path16, defaultValue) {
4367
- var result2 = object2 == null ? undefined2 : baseGet(object2, path16);
4366
+ function get(object2, path17, defaultValue) {
4367
+ var result2 = object2 == null ? undefined2 : baseGet(object2, path17);
4368
4368
  return result2 === undefined2 ? defaultValue : result2;
4369
4369
  }
4370
- function has(object2, path16) {
4371
- return object2 != null && hasPath(object2, path16, baseHas);
4370
+ function has(object2, path17) {
4371
+ return object2 != null && hasPath(object2, path17, baseHas);
4372
4372
  }
4373
- function hasIn(object2, path16) {
4374
- return object2 != null && hasPath(object2, path16, baseHasIn);
4373
+ function hasIn(object2, path17) {
4374
+ return object2 != null && hasPath(object2, path17, baseHasIn);
4375
4375
  }
4376
4376
  var invert = createInverter(function(result2, value, key) {
4377
4377
  if (value != null && typeof value.toString != "function") {
@@ -4424,10 +4424,10 @@ var require_lodash = __commonJS({
4424
4424
  return result2;
4425
4425
  }
4426
4426
  var isDeep = false;
4427
- paths = arrayMap(paths, function(path16) {
4428
- path16 = castPath(path16, object2);
4429
- isDeep || (isDeep = path16.length > 1);
4430
- return path16;
4427
+ paths = arrayMap(paths, function(path17) {
4428
+ path17 = castPath(path17, object2);
4429
+ isDeep || (isDeep = path17.length > 1);
4430
+ return path17;
4431
4431
  });
4432
4432
  copyObject(object2, getAllKeysIn(object2), result2);
4433
4433
  if (isDeep) {
@@ -4453,19 +4453,19 @@ var require_lodash = __commonJS({
4453
4453
  return [prop];
4454
4454
  });
4455
4455
  predicate = getIteratee(predicate);
4456
- return basePickBy(object2, props, function(value, path16) {
4457
- return predicate(value, path16[0]);
4456
+ return basePickBy(object2, props, function(value, path17) {
4457
+ return predicate(value, path17[0]);
4458
4458
  });
4459
4459
  }
4460
- function result(object2, path16, defaultValue) {
4461
- path16 = castPath(path16, object2);
4462
- var index = -1, length = path16.length;
4460
+ function result(object2, path17, defaultValue) {
4461
+ path17 = castPath(path17, object2);
4462
+ var index = -1, length = path17.length;
4463
4463
  if (!length) {
4464
4464
  length = 1;
4465
4465
  object2 = undefined2;
4466
4466
  }
4467
4467
  while (++index < length) {
4468
- var value = object2 == null ? undefined2 : object2[toKey(path16[index])];
4468
+ var value = object2 == null ? undefined2 : object2[toKey(path17[index])];
4469
4469
  if (value === undefined2) {
4470
4470
  index = length;
4471
4471
  value = defaultValue;
@@ -4474,12 +4474,12 @@ var require_lodash = __commonJS({
4474
4474
  }
4475
4475
  return object2;
4476
4476
  }
4477
- function set2(object2, path16, value) {
4478
- return object2 == null ? object2 : baseSet(object2, path16, value);
4477
+ function set2(object2, path17, value) {
4478
+ return object2 == null ? object2 : baseSet(object2, path17, value);
4479
4479
  }
4480
- function setWith(object2, path16, value, customizer) {
4480
+ function setWith(object2, path17, value, customizer) {
4481
4481
  customizer = typeof customizer == "function" ? customizer : undefined2;
4482
- return object2 == null ? object2 : baseSet(object2, path16, value, customizer);
4482
+ return object2 == null ? object2 : baseSet(object2, path17, value, customizer);
4483
4483
  }
4484
4484
  var toPairs = createToPairs(keys);
4485
4485
  var toPairsIn = createToPairs(keysIn);
@@ -4501,15 +4501,15 @@ var require_lodash = __commonJS({
4501
4501
  });
4502
4502
  return accumulator;
4503
4503
  }
4504
- function unset(object2, path16) {
4505
- return object2 == null ? true : baseUnset(object2, path16);
4504
+ function unset(object2, path17) {
4505
+ return object2 == null ? true : baseUnset(object2, path17);
4506
4506
  }
4507
- function update(object2, path16, updater) {
4508
- return object2 == null ? object2 : baseUpdate(object2, path16, castFunction(updater));
4507
+ function update(object2, path17, updater) {
4508
+ return object2 == null ? object2 : baseUpdate(object2, path17, castFunction(updater));
4509
4509
  }
4510
- function updateWith(object2, path16, updater, customizer) {
4510
+ function updateWith(object2, path17, updater, customizer) {
4511
4511
  customizer = typeof customizer == "function" ? customizer : undefined2;
4512
- return object2 == null ? object2 : baseUpdate(object2, path16, castFunction(updater), customizer);
4512
+ return object2 == null ? object2 : baseUpdate(object2, path17, castFunction(updater), customizer);
4513
4513
  }
4514
4514
  function values(object2) {
4515
4515
  return object2 == null ? [] : baseValues(object2, keys(object2));
@@ -4895,17 +4895,17 @@ var require_lodash = __commonJS({
4895
4895
  function matches(source) {
4896
4896
  return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
4897
4897
  }
4898
- function matchesProperty(path16, srcValue) {
4899
- return baseMatchesProperty(path16, baseClone(srcValue, CLONE_DEEP_FLAG));
4898
+ function matchesProperty(path17, srcValue) {
4899
+ return baseMatchesProperty(path17, baseClone(srcValue, CLONE_DEEP_FLAG));
4900
4900
  }
4901
- var method = baseRest(function(path16, args2) {
4901
+ var method = baseRest(function(path17, args2) {
4902
4902
  return function(object2) {
4903
- return baseInvoke(object2, path16, args2);
4903
+ return baseInvoke(object2, path17, args2);
4904
4904
  };
4905
4905
  });
4906
4906
  var methodOf = baseRest(function(object2, args2) {
4907
- return function(path16) {
4908
- return baseInvoke(object2, path16, args2);
4907
+ return function(path17) {
4908
+ return baseInvoke(object2, path17, args2);
4909
4909
  };
4910
4910
  });
4911
4911
  function mixin(object2, source, options) {
@@ -4952,12 +4952,12 @@ var require_lodash = __commonJS({
4952
4952
  var over = createOver(arrayMap);
4953
4953
  var overEvery = createOver(arrayEvery);
4954
4954
  var overSome = createOver(arraySome);
4955
- function property(path16) {
4956
- return isKey(path16) ? baseProperty(toKey(path16)) : basePropertyDeep(path16);
4955
+ function property(path17) {
4956
+ return isKey(path17) ? baseProperty(toKey(path17)) : basePropertyDeep(path17);
4957
4957
  }
4958
4958
  function propertyOf(object2) {
4959
- return function(path16) {
4960
- return object2 == null ? undefined2 : baseGet(object2, path16);
4959
+ return function(path17) {
4960
+ return object2 == null ? undefined2 : baseGet(object2, path17);
4961
4961
  };
4962
4962
  }
4963
4963
  var range = createRange();
@@ -5410,12 +5410,12 @@ var require_lodash = __commonJS({
5410
5410
  LazyWrapper.prototype.findLast = function(predicate) {
5411
5411
  return this.reverse().find(predicate);
5412
5412
  };
5413
- LazyWrapper.prototype.invokeMap = baseRest(function(path16, args2) {
5414
- if (typeof path16 == "function") {
5413
+ LazyWrapper.prototype.invokeMap = baseRest(function(path17, args2) {
5414
+ if (typeof path17 == "function") {
5415
5415
  return new LazyWrapper(this);
5416
5416
  }
5417
5417
  return this.map(function(value) {
5418
- return baseInvoke(value, path16, args2);
5418
+ return baseInvoke(value, path17, args2);
5419
5419
  });
5420
5420
  });
5421
5421
  LazyWrapper.prototype.reject = function(predicate) {
@@ -5558,7 +5558,7 @@ var fivemTool = {
5558
5558
 
5559
5559
  // src/guest/devtools/steam.ts
5560
5560
  import fs13 from "node:fs";
5561
- import path15 from "node:path";
5561
+ import path16 from "node:path";
5562
5562
  import { spawn as spawn2 } from "node:child_process";
5563
5563
 
5564
5564
  // src/shared/accounts/kinds/steam.ts
@@ -6539,10 +6539,10 @@ function mergeDefs(...defs) {
6539
6539
  function cloneDef(schema) {
6540
6540
  return mergeDefs(schema._zod.def);
6541
6541
  }
6542
- function getElementAtPath(obj, path16) {
6543
- if (!path16)
6542
+ function getElementAtPath(obj, path17) {
6543
+ if (!path17)
6544
6544
  return obj;
6545
- return path16.reduce((acc, key) => acc?.[key], obj);
6545
+ return path17.reduce((acc, key) => acc?.[key], obj);
6546
6546
  }
6547
6547
  function promiseAllObject(promisesObj) {
6548
6548
  const keys = Object.keys(promisesObj);
@@ -6882,11 +6882,11 @@ function explicitlyAborted(x, startIndex = 0) {
6882
6882
  }
6883
6883
  return false;
6884
6884
  }
6885
- function prefixIssues(path16, issues) {
6885
+ function prefixIssues(path17, issues) {
6886
6886
  return issues.map((iss) => {
6887
6887
  var _a3;
6888
6888
  (_a3 = iss).path ?? (_a3.path = []);
6889
- iss.path.unshift(path16);
6889
+ iss.path.unshift(path17);
6890
6890
  return iss;
6891
6891
  });
6892
6892
  }
@@ -7336,16 +7336,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
7336
7336
  }
7337
7337
  function formatError(error62, mapper = (issue2) => issue2.message) {
7338
7338
  const fieldErrors = { _errors: [] };
7339
- const processError = (error63, path16 = []) => {
7339
+ const processError = (error63, path17 = []) => {
7340
7340
  for (const issue2 of error63.issues) {
7341
7341
  if (issue2.code === "invalid_union" && issue2.errors.length) {
7342
- issue2.errors.map((issues) => processError({ issues }, [...path16, ...issue2.path]));
7342
+ issue2.errors.map((issues) => processError({ issues }, [...path17, ...issue2.path]));
7343
7343
  } else if (issue2.code === "invalid_key") {
7344
- processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
7344
+ processError({ issues: issue2.issues }, [...path17, ...issue2.path]);
7345
7345
  } else if (issue2.code === "invalid_element") {
7346
- processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
7346
+ processError({ issues: issue2.issues }, [...path17, ...issue2.path]);
7347
7347
  } else {
7348
- const fullpath = [...path16, ...issue2.path];
7348
+ const fullpath = [...path17, ...issue2.path];
7349
7349
  if (fullpath.length === 0) {
7350
7350
  fieldErrors._errors.push(mapper(issue2));
7351
7351
  } else {
@@ -7384,17 +7384,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
7384
7384
  }
7385
7385
  function treeifyError(error62, mapper = (issue2) => issue2.message) {
7386
7386
  const result = { errors: [] };
7387
- const processError = (error63, path16 = []) => {
7387
+ const processError = (error63, path17 = []) => {
7388
7388
  var _a3;
7389
7389
  for (const issue2 of error63.issues) {
7390
7390
  if (issue2.code === "invalid_union" && issue2.errors.length) {
7391
- issue2.errors.map((issues) => processError({ issues }, [...path16, ...issue2.path]));
7391
+ issue2.errors.map((issues) => processError({ issues }, [...path17, ...issue2.path]));
7392
7392
  } else if (issue2.code === "invalid_key") {
7393
- processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
7393
+ processError({ issues: issue2.issues }, [...path17, ...issue2.path]);
7394
7394
  } else if (issue2.code === "invalid_element") {
7395
- processError({ issues: issue2.issues }, [...path16, ...issue2.path]);
7395
+ processError({ issues: issue2.issues }, [...path17, ...issue2.path]);
7396
7396
  } else {
7397
- const fullpath = [...path16, ...issue2.path];
7397
+ const fullpath = [...path17, ...issue2.path];
7398
7398
  if (fullpath.length === 0) {
7399
7399
  result.errors.push(mapper(issue2));
7400
7400
  continue;
@@ -7433,8 +7433,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
7433
7433
  }
7434
7434
  function toDotPath(_path) {
7435
7435
  const segs = [];
7436
- const path16 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
7437
- for (const seg of path16) {
7436
+ const path17 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
7437
+ for (const seg of path17) {
7438
7438
  if (typeof seg === "number")
7439
7439
  segs.push(`[${seg}]`);
7440
7440
  else if (typeof seg === "symbol")
@@ -24536,13 +24536,13 @@ function resolveRef(ref, ctx) {
24536
24536
  if (!ref.startsWith("#")) {
24537
24537
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
24538
24538
  }
24539
- const path16 = ref.slice(1).split("/").filter(Boolean);
24540
- if (path16.length === 0) {
24539
+ const path17 = ref.slice(1).split("/").filter(Boolean);
24540
+ if (path17.length === 0) {
24541
24541
  return ctx.rootSchema;
24542
24542
  }
24543
24543
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
24544
- if (path16[0] === defsKey) {
24545
- const key = path16[1] === void 0 ? void 0 : decodeJSONPointerSegment(path16[1]);
24544
+ if (path17[0] === defsKey) {
24545
+ const key = path17[1] === void 0 ? void 0 : decodeJSONPointerSegment(path17[1]);
24546
24546
  if (!key || !ctx.defs[key]) {
24547
24547
  throw new Error(`Reference not found: ${ref}`);
24548
24548
  }
@@ -25621,8 +25621,8 @@ async function fetchRetry(url2, init = {}, attempts = 5, timeoutMs = 6e4) {
25621
25621
  }
25622
25622
 
25623
25623
  // src/shared/download/archive.ts
25624
- import fs6 from "node:fs";
25625
- import path7 from "node:path";
25624
+ import fs7 from "node:fs";
25625
+ import path8 from "node:path";
25626
25626
  import crypto from "node:crypto";
25627
25627
 
25628
25628
  // src/shared/io/json.ts
@@ -25765,11 +25765,25 @@ function safeRemove(target, root) {
25765
25765
  fs4.rmSync(target, { recursive: true, force: true, maxRetries: 2 });
25766
25766
  }
25767
25767
 
25768
- // src/shared/system.ts
25768
+ // src/shared/io/disk.ts
25769
+ import fs5 from "node:fs";
25769
25770
  import path5 from "node:path";
25771
+ function freeBytesAt(dir, statfs = fs5.statfsSync) {
25772
+ let at = path5.resolve(dir);
25773
+ while (!fs5.existsSync(at) && path5.dirname(at) !== at) at = path5.dirname(at);
25774
+ try {
25775
+ const s = statfs(at);
25776
+ return s.bavail * s.bsize;
25777
+ } catch {
25778
+ return null;
25779
+ }
25780
+ }
25781
+
25782
+ // src/shared/system.ts
25783
+ import path6 from "node:path";
25770
25784
  var systemRoot = () => process.env.SystemRoot ?? process.env.WINDIR ?? "C:\\Windows";
25771
25785
  function system32(exe) {
25772
- return path5.join(systemRoot(), "System32", exe);
25786
+ return path6.join(systemRoot(), "System32", exe);
25773
25787
  }
25774
25788
  var SYSTEM = {
25775
25789
  cmd: () => system32("cmd.exe"),
@@ -25790,17 +25804,17 @@ var SYSTEM = {
25790
25804
  msiexec: () => system32("msiexec.exe"),
25791
25805
  sc: () => system32("sc.exe"),
25792
25806
  /** The .NET Framework C# compiler that ships with Windows (C# 5). */
25793
- csc: () => path5.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
25807
+ csc: () => path6.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
25794
25808
  };
25795
25809
 
25796
25810
  // src/shared/scripts.ts
25797
- import fs5 from "node:fs";
25798
- import path6 from "node:path";
25811
+ import fs6 from "node:fs";
25812
+ import path7 from "node:path";
25799
25813
  import { fileURLToPath } from "node:url";
25800
- var HERE = path6.dirname(fileURLToPath(import.meta.url));
25814
+ var HERE = path7.dirname(fileURLToPath(import.meta.url));
25801
25815
  function sandboxScriptsDir() {
25802
- const candidates = [path6.resolve(HERE, "..", "sandbox"), path6.resolve(HERE, "..", "..", "sandbox")];
25803
- return candidates.find((dir) => fs5.existsSync(path6.join(dir, "boot", "bootstrap.ps1"))) ?? candidates[candidates.length - 1];
25816
+ const candidates = [path7.resolve(HERE, "..", "sandbox"), path7.resolve(HERE, "..", "..", "sandbox")];
25817
+ return candidates.find((dir) => fs6.existsSync(path7.join(dir, "boot", "bootstrap.ps1"))) ?? candidates[candidates.length - 1];
25804
25818
  }
25805
25819
  function scriptArgs(name2, args2 = []) {
25806
25820
  return [
@@ -25810,7 +25824,7 @@ function scriptArgs(name2, args2 = []) {
25810
25824
  "-ExecutionPolicy",
25811
25825
  "Bypass",
25812
25826
  "-File",
25813
- path6.join(sandboxScriptsDir(), "scripts", name2),
25827
+ path7.join(sandboxScriptsDir(), "scripts", name2),
25814
25828
  ...args2
25815
25829
  ];
25816
25830
  }
@@ -25830,16 +25844,16 @@ function stagingFolder(destination) {
25830
25844
  return destination + ".staging-" + crypto.randomBytes(3).toString("hex");
25831
25845
  }
25832
25846
  function moveIntoPlace(work, destination) {
25833
- safeRemove(destination, path7.dirname(destination));
25834
- fs6.mkdirSync(path7.dirname(destination), { recursive: true });
25835
- fs6.renameSync(work, destination);
25847
+ safeRemove(destination, path8.dirname(destination));
25848
+ fs7.mkdirSync(path8.dirname(destination), { recursive: true });
25849
+ fs7.renameSync(work, destination);
25836
25850
  }
25837
25851
  async function extractArchive(archive, destination, members2 = []) {
25838
- fs6.mkdirSync(destination, { recursive: true });
25852
+ fs7.mkdirSync(destination, { recursive: true });
25839
25853
  let status = await spawnAsync(SYSTEM.tar(), ["-xf", archive, "-C", destination, ...members2]);
25840
25854
  if (status !== 0 && /\.(zip|nupkg)$/i.test(archive)) {
25841
25855
  const zip = archive.endsWith(".zip") ? archive : archive + ".zip";
25842
- if (zip !== archive) fs6.copyFileSync(archive, zip);
25856
+ if (zip !== archive) fs7.copyFileSync(archive, zip);
25843
25857
  status = await spawnAsync(
25844
25858
  SYSTEM.powershell(),
25845
25859
  scriptArgs("expand-archive.ps1", ["-Archive", zip, "-Destination", destination])
@@ -25848,21 +25862,21 @@ async function extractArchive(archive, destination, members2 = []) {
25848
25862
  if (status !== 0) throw new Error("Could not extract " + archive);
25849
25863
  }
25850
25864
  function findFile(root, name2, maxDepth = 4) {
25851
- if (maxDepth < 0 || !fs6.existsSync(root)) return null;
25852
- const entries = fs6.readdirSync(root, { withFileTypes: true });
25865
+ if (maxDepth < 0 || !fs7.existsSync(root)) return null;
25866
+ const entries = fs7.readdirSync(root, { withFileTypes: true });
25853
25867
  for (const entry of entries)
25854
- if (entry.isFile() && entry.name.toLowerCase() === name2.toLowerCase()) return path7.join(root, entry.name);
25868
+ if (entry.isFile() && entry.name.toLowerCase() === name2.toLowerCase()) return path8.join(root, entry.name);
25855
25869
  for (const entry of entries)
25856
25870
  if (entry.isDirectory()) {
25857
- const found = findFile(path7.join(root, entry.name), name2, maxDepth - 1);
25871
+ const found = findFile(path8.join(root, entry.name), name2, maxDepth - 1);
25858
25872
  if (found) return found;
25859
25873
  }
25860
25874
  return null;
25861
25875
  }
25862
25876
 
25863
25877
  // src/shared/download/downloader.ts
25864
- import fs7 from "node:fs";
25865
- import path8 from "node:path";
25878
+ import fs8 from "node:fs";
25879
+ import path9 from "node:path";
25866
25880
  import crypto2 from "node:crypto";
25867
25881
  import { Readable, Transform } from "node:stream";
25868
25882
  import { pipeline } from "node:stream/promises";
@@ -25883,12 +25897,12 @@ var Downloader = class {
25883
25897
  const sums = typeof expected === "string" || expected === null ? { sha256: expected } : expected;
25884
25898
  if (this.requireChecksum && !sums.sha256?.trim() && !sums.sha512?.trim() && !sums.sha1?.trim() && !sums.verify) {
25885
25899
  throw new Error(
25886
- "Refusing to download " + path8.basename(destination) + " (" + url2 + "): no checksum is published for it, and downloads.requireChecksum is on. Turn that setting off to allow downloads that cannot be verified."
25900
+ "Refusing to download " + path9.basename(destination) + " (" + url2 + "): no checksum is published for it, and downloads.requireChecksum is on. Turn that setting off to allow downloads that cannot be verified."
25887
25901
  );
25888
25902
  }
25889
25903
  const response = await fetchRetry(url2, {}, 3, 20 * 60 * 1e3);
25890
25904
  if (!response.body) throw new Error("Empty response for " + url2);
25891
- fs7.mkdirSync(path8.dirname(destination), { recursive: true });
25905
+ fs8.mkdirSync(path9.dirname(destination), { recursive: true });
25892
25906
  const checks = ["sha256", "sha512", "sha1"].flatMap((kind) => {
25893
25907
  const want = sums[kind]?.trim().toLowerCase();
25894
25908
  return want ? [{ want, hash: crypto2.createHash(kind) }] : [];
@@ -25918,13 +25932,13 @@ var Downloader = class {
25918
25932
  });
25919
25933
  const partial2 = destination + ".part";
25920
25934
  try {
25921
- await pipeline(Readable.fromWeb(response.body), tap, fs7.createWriteStream(partial2));
25935
+ await pipeline(Readable.fromWeb(response.body), tap, fs8.createWriteStream(partial2));
25922
25936
  if (checks.some((c) => c.hash.digest("hex") !== c.want)) throw new Error("Checksum mismatch for " + url2);
25923
25937
  if (sums.verify) await sums.verify(partial2);
25924
- fs7.rmSync(destination, { force: true });
25925
- fs7.renameSync(partial2, destination);
25938
+ fs8.rmSync(destination, { force: true });
25939
+ fs8.renameSync(partial2, destination);
25926
25940
  } finally {
25927
- fs7.rmSync(partial2, { force: true });
25941
+ fs8.rmSync(partial2, { force: true });
25928
25942
  }
25929
25943
  }
25930
25944
  /**
@@ -25934,41 +25948,41 @@ var Downloader = class {
25934
25948
  async archive(url2, destination, options = {}) {
25935
25949
  const work = stagingFolder(destination);
25936
25950
  try {
25937
- const archive = path8.join(work, options.fileName ?? path8.basename(new URL(url2).pathname));
25951
+ const archive = path9.join(work, options.fileName ?? path9.basename(new URL(url2).pathname));
25938
25952
  await this.file(url2, archive, {
25939
25953
  sha256: options.sha256,
25940
25954
  sha512: options.sha512,
25941
25955
  sha1: options.sha1,
25942
25956
  ...options.verify ? { verify: options.verify } : {}
25943
25957
  });
25944
- const extracted = path8.join(work, "x");
25958
+ const extracted = path9.join(work, "x");
25945
25959
  await extractArchive(archive, extracted, options.members);
25946
25960
  let root = extracted;
25947
25961
  if (options.locate) {
25948
25962
  const found = findFile(extracted, options.locate);
25949
25963
  if (!found) throw new Error(options.locate + " not found in " + url2);
25950
- root = path8.dirname(found);
25951
- for (let i = 0; i < (options.up ?? 0) && path8.dirname(root).startsWith(extracted); i++)
25952
- root = path8.dirname(root);
25964
+ root = path9.dirname(found);
25965
+ for (let i = 0; i < (options.up ?? 0) && path9.dirname(root).startsWith(extracted); i++)
25966
+ root = path9.dirname(root);
25953
25967
  }
25954
25968
  moveIntoPlace(root, destination);
25955
25969
  } finally {
25956
- safeRemove(work, path8.dirname(work));
25970
+ safeRemove(work, path9.dirname(work));
25957
25971
  }
25958
25972
  }
25959
25973
  };
25960
25974
  var downloader = new Downloader();
25961
25975
 
25962
25976
  // src/guest/runtime/session.ts
25963
- import fs9 from "node:fs";
25964
- import path11 from "node:path";
25977
+ import fs10 from "node:fs";
25978
+ import path12 from "node:path";
25965
25979
 
25966
25980
  // src/guest/runtime/paths.ts
25967
- import path10 from "node:path";
25981
+ import path11 from "node:path";
25968
25982
 
25969
25983
  // src/shared/channel/run-dir.ts
25970
- import fs8 from "node:fs";
25971
- import path9 from "node:path";
25984
+ import fs9 from "node:fs";
25985
+ import path10 from "node:path";
25972
25986
 
25973
25987
  // src/shared/paths/guest-paths.ts
25974
25988
  var RESERVED_GUEST = /^C:\\(?:Windows|Program Files|Program Files \(x86\)|ProgramData|Users|AgentLaunch|AgentData|HostTools|nvm|Mirror|PcInstalls)(?:\\|$)/i;
@@ -26059,6 +26073,22 @@ var DatabasesSchema = external_exports.strictObject({
26059
26073
  })
26060
26074
  });
26061
26075
 
26076
+ // src/core/schema/codex.ts
26077
+ var CodexSchema = external_exports.strictObject({
26078
+ sandboxMode: external_exports.enum(["danger-full-access", "workspace-write", "read-only"]).describe(
26079
+ "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."
26080
+ ),
26081
+ approvalPolicy: external_exports.enum(["never", "on-request", "on-failure", "untrusted"]).describe('When Codex asks before it runs a command. "never" with danger-full-access starts it with no questions.'),
26082
+ model: external_exports.string().max(100).regex(/^[A-Za-z0-9._:/-]*$/, "letters, digits and . _ : / - only").describe("The model Codex uses. Empty = Codex's own default."),
26083
+ reasoningEffort: external_exports.enum(["default", "minimal", "low", "medium", "high", "xhigh"]).describe(`How hard Codex thinks. "default" = Codex's own default.`),
26084
+ windowsSandbox: external_exports.enum(["off", "unelevated", "elevated"]).describe(
26085
+ `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.`
26086
+ ),
26087
+ mcpLoginsInFile: external_exports.boolean().describe(
26088
+ `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.`
26089
+ )
26090
+ });
26091
+
26062
26092
  // src/core/schema/harness.ts
26063
26093
  var SubfolderSchema = external_exports.string().regex(/^(?!.*(^|[\\/])\.\.([\\/]|$))[A-Za-z0-9._ -]+([\\/][A-Za-z0-9._ -]+)*$/, "a plain relative folder");
26064
26094
  var HarnessHomeSchema = external_exports.strictObject({
@@ -26371,6 +26401,9 @@ var ToolchainsSchema = external_exports.strictObject({
26371
26401
  keepInstallFiles: external_exports.boolean().describe(
26372
26402
  "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."
26373
26403
  ),
26404
+ visualStudio: external_exports.enum(["full", "autosdk"]).describe(
26405
+ `"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).`
26406
+ ),
26374
26407
  persistEngines: external_exports.boolean().describe(
26375
26408
  "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)."
26376
26409
  ),
@@ -27702,6 +27735,7 @@ var ConfigSchema = external_exports.strictObject({
27702
27735
  apps: AppsSchema,
27703
27736
  claudeProfile: ClaudeProfileSchema,
27704
27737
  harnesses: external_exports.record(NameSchema, HarnessSchema).describe("Agents that can run in the sandbox."),
27738
+ codex: CodexSchema,
27705
27739
  hooks: external_exports.strictObject({ failFast: external_exports.boolean().describe("Stop when a hook script fails.") }),
27706
27740
  projects: ProjectsSchema.describe(
27707
27741
  "Several projects in one sandbox: folders of projects mapped at every start, and adding folders while it runs."
@@ -27945,6 +27979,8 @@ var ProjectStatusSchema = external_exports.object({
27945
27979
  var VpnStatusSchema = external_exports.object({
27946
27980
  state: external_exports.enum(["off", "starting", "up", "failed"]),
27947
27981
  message: Text(2e3),
27982
+ /** Why it failed, when it did: `auth` (login refused), `unreachable`, `driver`, `timeout` or `other`. */
27983
+ code: external_exports.enum(["auth", "unreachable", "driver", "timeout", "other"]).optional(),
27948
27984
  killSwitch: external_exports.boolean(),
27949
27985
  /** A direct connection was tried after the kill switch was applied: false = it still got out. */
27950
27986
  killSwitchHeld: external_exports.boolean().optional(),
@@ -27960,14 +27996,14 @@ function safeId(id) {
27960
27996
  return IdSchema.parse(id);
27961
27997
  }
27962
27998
  var scan = (schema, dir) => {
27963
- if (!fs8.existsSync(dir)) return { valid: [], invalid: [] };
27999
+ if (!fs9.existsSync(dir)) return { valid: [], invalid: [] };
27964
28000
  const valid = [];
27965
28001
  const invalid = [];
27966
- for (const name2 of fs8.readdirSync(dir)) {
28002
+ for (const name2 of fs9.readdirSync(dir)) {
27967
28003
  if (name2.endsWith(".tmp")) continue;
27968
- const message = /^[A-Za-z0-9_-]{1,64}\.json$/.test(name2) ? readValid(schema, path9.join(dir, name2)) : null;
28004
+ const message = /^[A-Za-z0-9_-]{1,64}\.json$/.test(name2) ? readValid(schema, path10.join(dir, name2)) : null;
27969
28005
  if (message) valid.push(message);
27970
- else invalid.push(path9.join(dir, name2));
28006
+ else invalid.push(path10.join(dir, name2));
27971
28007
  }
27972
28008
  return { valid, invalid };
27973
28009
  };
@@ -27998,45 +28034,45 @@ var RunDir = class {
27998
28034
  liveDir;
27999
28035
  liveRepliesDir;
28000
28036
  constructor(dataDir2) {
28001
- this.root = path9.join(dataDir2, "run");
28002
- this.sandboxFile = path9.join(this.root, "sandbox.json");
28003
- this.vpnFile = path9.join(this.root, "vpn.json");
28004
- this.pressureFile = path9.join(this.root, "pressure.json");
28005
- this.heartbeatFile = path9.join(this.root, "heartbeat.json");
28006
- this.budgetFile = path9.join(this.root, "budget.json");
28007
- this.requestsDir = path9.join(this.root, "requests");
28008
- this.responsesDir = path9.join(this.root, "responses");
28009
- this.sessionsDir = path9.join(this.root, "sessions");
28010
- this.projectsDir = path9.join(this.root, "projects");
28011
- this.auditDir = path9.join(this.root, "audit");
28012
- this.treesDir = path9.join(this.root, "trees");
28013
- this.secretsDir = path9.join(dataDir2, "secrets");
28014
- this.liveDir = path9.join(this.root, "live");
28015
- this.liveRepliesDir = path9.join(this.root, "live-replies");
28037
+ this.root = path10.join(dataDir2, "run");
28038
+ this.sandboxFile = path10.join(this.root, "sandbox.json");
28039
+ this.vpnFile = path10.join(this.root, "vpn.json");
28040
+ this.pressureFile = path10.join(this.root, "pressure.json");
28041
+ this.heartbeatFile = path10.join(this.root, "heartbeat.json");
28042
+ this.budgetFile = path10.join(this.root, "budget.json");
28043
+ this.requestsDir = path10.join(this.root, "requests");
28044
+ this.responsesDir = path10.join(this.root, "responses");
28045
+ this.sessionsDir = path10.join(this.root, "sessions");
28046
+ this.projectsDir = path10.join(this.root, "projects");
28047
+ this.auditDir = path10.join(this.root, "audit");
28048
+ this.treesDir = path10.join(this.root, "trees");
28049
+ this.secretsDir = path10.join(dataDir2, "secrets");
28050
+ this.liveDir = path10.join(this.root, "live");
28051
+ this.liveRepliesDir = path10.join(this.root, "live-replies");
28016
28052
  }
28017
28053
  liveFile(id) {
28018
- return path9.join(this.liveDir, safeId(id) + ".json");
28054
+ return path10.join(this.liveDir, safeId(id) + ".json");
28019
28055
  }
28020
28056
  liveReplyFile(id) {
28021
- return path9.join(this.liveRepliesDir, safeId(id) + ".json");
28057
+ return path10.join(this.liveRepliesDir, safeId(id) + ".json");
28022
28058
  }
28023
28059
  requestFile(id) {
28024
- return path9.join(this.requestsDir, safeId(id) + ".json");
28060
+ return path10.join(this.requestsDir, safeId(id) + ".json");
28025
28061
  }
28026
28062
  responseFile(id) {
28027
- return path9.join(this.responsesDir, safeId(id) + ".json");
28063
+ return path10.join(this.responsesDir, safeId(id) + ".json");
28028
28064
  }
28029
28065
  sessionFile(id) {
28030
- return path9.join(this.sessionsDir, safeId(id) + ".json");
28066
+ return path10.join(this.sessionsDir, safeId(id) + ".json");
28031
28067
  }
28032
28068
  treeFile(id) {
28033
- return path9.join(this.treesDir, safeId(id) + ".json");
28069
+ return path10.join(this.treesDir, safeId(id) + ".json");
28034
28070
  }
28035
28071
  projectFile(name2) {
28036
- return path9.join(this.projectsDir, safeId(name2) + ".json");
28072
+ return path10.join(this.projectsDir, safeId(name2) + ".json");
28037
28073
  }
28038
28074
  secretFile(id) {
28039
- return path9.join(this.secretsDir, safeId(id) + ".json");
28075
+ return path10.join(this.secretsDir, safeId(id) + ".json");
28040
28076
  }
28041
28077
  readSandboxStatus() {
28042
28078
  return readValid(SandboxStatusSchema, this.sandboxFile);
@@ -28078,37 +28114,37 @@ var launchDir = process.env.AGENT_LAUNCH_DIR ?? "C:\\AgentLaunch";
28078
28114
  var dataDir = process.env.AGENT_DATA_DIR ?? "C:\\AgentData";
28079
28115
  var hostToolsDir = process.env.AGENT_HOST_TOOLS_DIR ?? "C:\\HostTools";
28080
28116
  var localDir = process.env.AGENT_LOCAL_DIR ?? "C:\\nvm";
28081
- var toolsDir = path10.join(dataDir, "tools");
28082
- var logsDir = path10.join(dataDir, "logs");
28117
+ var toolsDir = path11.join(dataDir, "tools");
28118
+ var logsDir = path11.join(dataDir, "logs");
28083
28119
  var run = new RunDir(dataDir);
28084
28120
 
28085
28121
  // src/guest/runtime/session.ts
28086
28122
  var session = JSON.parse(
28087
- fs9.readFileSync(path11.join(launchDir, "session.json"), "utf8").replace(/^\uFEFF/, "")
28123
+ fs10.readFileSync(path12.join(launchDir, "session.json"), "utf8").replace(/^\uFEFF/, "")
28088
28124
  );
28089
28125
  downloader.requireChecksum = session.downloads?.requireChecksum === true;
28090
28126
  var workspace = process.env.AGENT_WORKSPACE ?? session.workspace;
28091
- var stateDir = path11.join(dataDir, session.persistAgentState ? "state" : "state-session");
28092
- var claudeDir = path11.join(stateDir, "claude");
28127
+ var stateDir = path12.join(dataDir, session.persistAgentState ? "state" : "state-session");
28128
+ var claudeDir = path12.join(stateDir, "claude");
28093
28129
 
28094
28130
  // src/guest/toolchains/steam/commands.ts
28095
- import fs10 from "node:fs";
28096
- import path12 from "node:path";
28131
+ import fs11 from "node:fs";
28132
+ import path13 from "node:path";
28097
28133
  var STEAMCMD_DIR = "C:\\SteamCMD";
28098
28134
  function steamAppsRoot(tools = toolsDir) {
28099
- return path12.join(tools, "steam-apps");
28135
+ return path13.join(tools, "steam-apps");
28100
28136
  }
28101
28137
  function steamAppDir(appId, tools = toolsDir) {
28102
- return path12.join(steamAppsRoot(tools), checkAppId(appId));
28138
+ return path13.join(steamAppsRoot(tools), checkAppId(appId));
28103
28139
  }
28104
28140
  function workshopCache(data = dataDir) {
28105
- return path12.join(data, "cache", "steam-workshop");
28141
+ return path13.join(data, "cache", "steam-workshop");
28106
28142
  }
28107
28143
  function workshopItemDir(cache, appId, item) {
28108
- return path12.join(cache, "steamapps", "workshop", "content", checkAppId(appId), checkItemId(item));
28144
+ return path13.join(cache, "steamapps", "workshop", "content", checkAppId(appId), checkItemId(item));
28109
28145
  }
28110
28146
  function steamClientDir(tools = toolsDir) {
28111
- return path12.join(tools, "steam");
28147
+ return path13.join(tools, "steam");
28112
28148
  }
28113
28149
  function checked(value, pattern, what) {
28114
28150
  if (!pattern.test(value)) throw new Error("not a " + what + ": " + JSON.stringify(value.slice(0, 80)));
@@ -28119,7 +28155,7 @@ var checkItemId = (v) => checked(v, /^[1-9]\d{0,19}$/, "workshop item ID");
28119
28155
  var checkBranch = (v) => checked(v, /^[A-Za-z0-9._-]{1,64}$/, "branch name");
28120
28156
  var checkLogin = (v) => checked(v, STEAM_ACCOUNT, "Steam account name");
28121
28157
  function checkPathValue(p, what) {
28122
- if (!path12.isAbsolute(p) || /["\r\n\0]/.test(p) || /(^|[\\/ ])\+/.test(p))
28158
+ if (!path13.isAbsolute(p) || /["\r\n\0]/.test(p) || /(^|[\\/ ])\+/.test(p))
28123
28159
  throw new Error(what + " cannot be given to SteamCMD: " + JSON.stringify(p.slice(0, 200)));
28124
28160
  return p;
28125
28161
  }
@@ -28195,19 +28231,19 @@ function withBuildSettings(text, o) {
28195
28231
  function readScript(file2) {
28196
28232
  let size;
28197
28233
  try {
28198
- const stat = fs10.lstatSync(file2);
28234
+ const stat = fs11.lstatSync(file2);
28199
28235
  if (!stat.isFile()) throw new Error("not a file");
28200
28236
  size = stat.size;
28201
28237
  } catch {
28202
28238
  throw new Error("cannot read " + file2 + " (missing, a link, or not a file)");
28203
28239
  }
28204
28240
  if (size > MAX_SCRIPT_BYTES) throw new Error(file2 + " is bigger than " + MAX_SCRIPT_BYTES / 1024 + " KB");
28205
- return fs10.readFileSync(file2, "utf8");
28241
+ return fs11.readFileSync(file2, "utf8");
28206
28242
  }
28207
28243
 
28208
28244
  // src/guest/toolchains/steam/apps.ts
28209
28245
  import fs12 from "node:fs";
28210
- import path14 from "node:path";
28246
+ import path15 from "node:path";
28211
28247
 
28212
28248
  // src/shared/installs.ts
28213
28249
  var INSTALL_RECORDS_FILE = "installs.json";
@@ -28221,19 +28257,13 @@ var InstallRecordSchema = external_exports.object({
28221
28257
  var InstallRecordsSchema = external_exports.object({ installs: external_exports.array(InstallRecordSchema).max(1e3) });
28222
28258
 
28223
28259
  // src/guest/toolchains/persisted.ts
28224
- import fs11 from "node:fs";
28225
- import path13 from "node:path";
28260
+ import path14 from "node:path";
28226
28261
  var GB = 1024 ** 3;
28227
28262
  var LOCAL_RESERVE_BYTES = 13 * GB;
28228
- var toolsOf = (deps) => deps.toolsDir ?? path13.join(dataDir, "tools");
28229
- var recordsFile = (deps) => path13.join(toolsOf(deps), INSTALL_RECORDS_FILE);
28263
+ var toolsOf = (deps) => deps.toolsDir ?? path14.join(dataDir, "tools");
28264
+ var recordsFile = (deps) => path14.join(toolsOf(deps), INSTALL_RECORDS_FILE);
28230
28265
  function freeBytes(dir, deps = {}) {
28231
- try {
28232
- const s = (deps.statfs ?? fs11.statfsSync)(dir);
28233
- return s.bavail * s.bsize;
28234
- } catch {
28235
- return 0;
28236
- }
28266
+ return freeBytesAt(dir, deps.statfs) ?? 0;
28237
28267
  }
28238
28268
  var gb = (bytes) => (bytes / GB).toFixed(1) + " GB";
28239
28269
  function assertRoom(dir, needBytes, what, fix, deps = {}) {
@@ -28256,7 +28286,7 @@ var MAX_MANIFEST_BYTES = 256 * 1024;
28256
28286
  var toolsOf2 = (deps) => deps.toolsDir ?? toolsDir;
28257
28287
  function assertAppRoom(dir, needBytes, what, deps = {}) {
28258
28288
  let probe = dir;
28259
- while (!fs12.existsSync(probe) && path14.dirname(probe) !== probe) probe = path14.dirname(probe);
28289
+ while (!fs12.existsSync(probe) && path15.dirname(probe) !== probe) probe = path15.dirname(probe);
28260
28290
  assertRoom(
28261
28291
  probe,
28262
28292
  needBytes,
@@ -28279,7 +28309,7 @@ function folderSize(dir) {
28279
28309
  }
28280
28310
  for (const e of entries) {
28281
28311
  if (++seen > MAX_WALK) return null;
28282
- const full = path14.join(current, e.name);
28312
+ const full = path15.join(current, e.name);
28283
28313
  if (e.isDirectory()) stack.push(full);
28284
28314
  else if (e.isFile())
28285
28315
  try {
@@ -28304,7 +28334,7 @@ function recordApp(appId, sizeBytes, deps = {}) {
28304
28334
  };
28305
28335
  const installs = [...all.filter((r) => r !== known), record2];
28306
28336
  fs12.mkdirSync(toolsOf2(deps), { recursive: true });
28307
- writeJsonAtomic(path14.join(toolsOf2(deps), INSTALL_RECORDS_FILE), { installs });
28337
+ writeJsonAtomic(path15.join(toolsOf2(deps), INSTALL_RECORDS_FILE), { installs });
28308
28338
  }
28309
28339
  function readAppManifest(file2) {
28310
28340
  const bytes = readBoundedFile(file2, MAX_MANIFEST_BYTES);
@@ -28330,8 +28360,8 @@ function installedApps(deps = {}) {
28330
28360
  }
28331
28361
  const records = installRecords(deps);
28332
28362
  return ids.map((appId) => {
28333
- const dir = path14.join(root, appId);
28334
- const manifest = readAppManifest(path14.join(dir, "steamapps", "appmanifest_" + appId + ".acf"));
28363
+ const dir = path15.join(root, appId);
28364
+ const manifest = readAppManifest(path15.join(dir, "steamapps", "appmanifest_" + appId + ".acf"));
28335
28365
  const record2 = records.find((r) => r.name === STEAM_APPS_RECORD && r.version === appId);
28336
28366
  return { appId, name: manifest?.name ?? "(not downloaded yet)", dir, sizeBytes: record2?.sizeBytes ?? null };
28337
28367
  });
@@ -28371,7 +28401,7 @@ function parse3(args2) {
28371
28401
  }
28372
28402
  return { words, values, flags };
28373
28403
  }
28374
- var steamcmd = () => path15.join(STEAMCMD_DIR, "steamcmd.exe");
28404
+ var steamcmd = () => path16.join(STEAMCMD_DIR, "steamcmd.exe");
28375
28405
  function requireSteamCmd() {
28376
28406
  if (!fs13.existsSync(steamcmd()))
28377
28407
  throw new Error("SteamCMD is not set up in this sandbox (toolchains.steam: see the boot log for why)");
@@ -28402,8 +28432,8 @@ async function login(p) {
28402
28432
  if (!name2) throw new Error("Usage: sbx-steam login <account name>");
28403
28433
  const code = await steamCmd(loginArgs(name2));
28404
28434
  if (code !== 0) return code;
28405
- fs13.mkdirSync(path15.join(STEAMCMD_DIR, "config"), { recursive: true });
28406
- fs13.writeFileSync(path15.join(STEAMCMD_DIR, "config", STEAM_ACCOUNT_FILE), name2, "utf8");
28435
+ fs13.mkdirSync(path16.join(STEAMCMD_DIR, "config"), { recursive: true });
28436
+ fs13.writeFileSync(path16.join(STEAMCMD_DIR, "config", STEAM_ACCOUNT_FILE), name2, "utf8");
28407
28437
  console.log(
28408
28438
  "Signed in as " + name2 + ". SteamCMD keeps the login in C:\\SteamCMD\\config (this sandbox only). With accounts.steam.share on, the PC keeps it, encrypted, for the next sandboxes; no password is kept."
28409
28439
  );
@@ -28412,7 +28442,7 @@ async function login(p) {
28412
28442
  async function app(p) {
28413
28443
  const appId = checkAppId(p.words[1] ?? "");
28414
28444
  const given = p.values.get("--dir");
28415
- const dir = given ? path15.resolve(given) : steamAppDir(appId);
28445
+ const dir = given ? path16.resolve(given) : steamAppDir(appId);
28416
28446
  const needGb = Number(p.values.get("--need-gb") ?? DEFAULT_APP_NEED_BYTES / GB3);
28417
28447
  if (!Number.isFinite(needGb) || needGb < 0 || needGb > 1e4) throw new Error("--need-gb takes a number of GB");
28418
28448
  assertAppRoom(dir, needGb * GB3, "app " + appId);
@@ -28450,7 +28480,7 @@ async function workshop(p) {
28450
28480
  return code;
28451
28481
  }
28452
28482
  if (verb === "push") {
28453
- const script = path15.resolve(p.words[2] ?? "");
28483
+ const script = path16.resolve(p.words[2] ?? "");
28454
28484
  if (scriptKind(readScript(script)) !== "workshopitem")
28455
28485
  throw new Error(script + ' is not a workshop_item script (its first block is not "workshopitem")');
28456
28486
  return steamCmd(workshopPushArgs(account(p, false), script));
@@ -28458,7 +28488,7 @@ async function workshop(p) {
28458
28488
  throw new Error("Usage: sbx-steam workshop get <appid> <item>... | workshop push <workshop_item.vdf>");
28459
28489
  }
28460
28490
  async function build(p) {
28461
- const script = path15.resolve(p.words[1] ?? "");
28491
+ const script = path16.resolve(p.words[1] ?? "");
28462
28492
  const text = readScript(script);
28463
28493
  if (scriptKind(text) !== "appbuild")
28464
28494
  throw new Error(script + ' is not an app_build script (its first block is not "AppBuild")');
@@ -28469,7 +28499,7 @@ async function build(p) {
28469
28499
  preview: p.flags.has("--preview"),
28470
28500
  ...desc !== void 0 ? { desc } : {}
28471
28501
  });
28472
- const copy = path15.join(path15.dirname(script), path15.basename(script, ".vdf") + ".sbx-" + process.pid + ".vdf");
28502
+ const copy = path16.join(path16.dirname(script), path16.basename(script, ".vdf") + ".sbx-" + process.pid + ".vdf");
28473
28503
  fs13.writeFileSync(copy, changed ?? text, "utf8");
28474
28504
  try {
28475
28505
  return await steamCmd(appBuildArgs(login2, copy));
@@ -28496,7 +28526,7 @@ function client() {
28496
28526
  console.error("The Steam client is off: set toolchains.steam.client to true and restart the sandbox.");
28497
28527
  return 1;
28498
28528
  }
28499
- const exe = path15.join(steamClientDir(), "steam.exe");
28529
+ const exe = path16.join(steamClientDir(), "steam.exe");
28500
28530
  if (!fs13.existsSync(exe)) {
28501
28531
  console.error("The Steam client is not set up (see the boot log).");
28502
28532
  return 1;