windows-development-sandbox 1.18.4 → 1.23.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 (438) hide show
  1. package/README.md +1 -1
  2. package/config.example.json +17 -1
  3. package/dist/app/features/access/access.def.js +5 -2
  4. package/dist/app/features/access/access.run.js +7 -3
  5. package/dist/app/features/accounts/accounts.def.d.ts +33 -1
  6. package/dist/app/features/accounts/accounts.def.js +10 -4
  7. package/dist/app/features/accounts/accounts.run.d.ts +2 -0
  8. package/dist/app/features/accounts/accounts.run.js +7 -2
  9. package/dist/app/features/accounts/services.def.d.ts +7 -1
  10. package/dist/app/features/accounts/services.def.js +19 -16
  11. package/dist/app/features/accounts/services.run.d.ts +2 -0
  12. package/dist/app/features/accounts/services.run.js +44 -16
  13. package/dist/app/features/agent-commands/agent-commands.def.d.ts +37 -0
  14. package/dist/app/features/agent-commands/agent-commands.def.js +91 -0
  15. package/dist/app/features/agent-commands/agent-commands.run.d.ts +28 -0
  16. package/dist/app/features/agent-commands/agent-commands.run.js +35 -0
  17. package/dist/app/features/agent-commands/index.d.ts +2 -0
  18. package/dist/app/features/agent-commands/index.js +3 -0
  19. package/dist/app/features/agents/agents.def.d.ts +14 -1
  20. package/dist/app/features/agents/agents.def.js +61 -6
  21. package/dist/app/features/agents/agents.run.d.ts +1 -0
  22. package/dist/app/features/agents/agents.run.js +8 -1
  23. package/dist/app/features/agents/claude-env.def.d.ts +36 -0
  24. package/dist/app/features/agents/claude-env.def.js +305 -0
  25. package/dist/app/features/agents/env.def.d.ts +163 -0
  26. package/dist/app/features/agents/env.def.js +184 -0
  27. package/dist/app/features/agents/env.run.d.ts +43 -0
  28. package/dist/app/features/agents/env.run.js +86 -0
  29. package/dist/app/features/agents/index.d.ts +2 -0
  30. package/dist/app/features/agents/index.js +2 -0
  31. package/dist/app/features/defs.d.ts +171 -3
  32. package/dist/app/features/defs.js +9 -0
  33. package/dist/app/features/engine/engine.run.js +1 -1
  34. package/dist/app/features/github/github.def.d.ts +44 -3
  35. package/dist/app/features/github/github.def.js +145 -63
  36. package/dist/app/features/github/github.run.d.ts +9 -2
  37. package/dist/app/features/github/github.run.js +43 -5
  38. package/dist/app/features/health/health.def.js +8 -2
  39. package/dist/app/features/logs/logs.def.js +0 -8
  40. package/dist/app/features/projects/projects.def.js +2 -2
  41. package/dist/app/features/projects/projects.run.js +5 -5
  42. package/dist/app/features/sandbox/sandbox.def.js +7 -3
  43. package/dist/app/features/sessions/sessions.def.d.ts +4 -4
  44. package/dist/app/features/sessions/sessions.def.js +0 -5
  45. package/dist/app/features/sessions/sessions.run.d.ts +1 -1
  46. package/dist/app/features/sessions/sessions.run.js +2 -2
  47. package/dist/app/features/settings/categories.def.js +7 -2
  48. package/dist/app/features/settings/settings-rows.js +6 -2
  49. package/dist/app/features/settings/settings.def.js +1 -1
  50. package/dist/app/features/settings/settings.run.d.ts +8 -0
  51. package/dist/app/features/settings/settings.run.js +12 -3
  52. package/dist/app/features/storage/storage.run.js +18 -9
  53. package/dist/app/features/updates/update-lines.js +2 -2
  54. package/dist/app/features/updates/updates.def.js +1 -1
  55. package/dist/app/features/updates/updates.run.js +13 -3
  56. package/dist/app/features/vpn/vpn.def.d.ts +33 -0
  57. package/dist/app/features/vpn/vpn.def.js +30 -6
  58. package/dist/app/features/vpn/vpn.run.d.ts +11 -0
  59. package/dist/app/features/vpn/vpn.run.js +4 -1
  60. package/dist/app/features/web/web.def.js +2 -2
  61. package/dist/app/features/web/web.run.js +12 -4
  62. package/dist/app/kernel/errors.d.ts +7 -0
  63. package/dist/app/kernel/errors.js +18 -3
  64. package/dist/app/kernel/rpc.d.ts +6 -1
  65. package/dist/app/kernel/view.d.ts +11 -1
  66. package/dist/app/registry.js +7 -1
  67. package/dist/bin/agent-sandbox.js +2 -2
  68. package/dist/bin/{chunk-N4GXYTLV.js → chunk-JETGP2C3.js} +239 -72
  69. package/dist/bin/{chunk-MY7NLQQY.js → chunk-XZKOPGNH.js} +1 -1
  70. package/dist/bin/{chunk-FRPLQLSY.js → chunk-ZTTOF5V3.js} +6566 -4964
  71. package/dist/bin/claude-host.js +2 -2
  72. package/dist/bin/claude-sbx.js +2 -2
  73. package/dist/bin/codex-sbx.js +2 -2
  74. package/dist/bin/gemini-sbx.js +2 -2
  75. package/dist/bin/sandbox.js +2 -2
  76. package/dist/bin/sbx-hide.js +2 -2
  77. package/dist/bin/sbx-show.js +2 -2
  78. package/dist/cli/commands/agent-commands.d.ts +0 -1
  79. package/dist/cli/commands/agent-commands.js +2 -32
  80. package/dist/cli/commands/index.d.ts +1 -1
  81. package/dist/cli/commands/index.js +1 -1
  82. package/dist/cli/commands/launch/launch.js +2 -2
  83. package/dist/cli/commands/registry.js +3 -2
  84. package/dist/cli/manifest.d.ts +3 -3
  85. package/dist/cli/manifest.js +3 -2
  86. package/dist/cli/menu/coverage-exempt.d.ts +17 -0
  87. package/dist/cli/menu/coverage-exempt.js +61 -0
  88. package/dist/cli/menu/io-menu.d.ts +2 -0
  89. package/dist/cli/menu/io-menu.js +50 -5
  90. package/dist/cli/menu/menu.d.ts +1 -1
  91. package/dist/cli/menu/menu.js +3 -3
  92. package/dist/cli/menu/pages/accounts-page.js +1 -1
  93. package/dist/cli/menu/pages/agents-page.d.ts +7 -2
  94. package/dist/cli/menu/pages/agents-page.js +75 -13
  95. package/dist/cli/menu/pages/maintenance-page.d.ts +6 -0
  96. package/dist/cli/menu/pages/maintenance-page.js +10 -4
  97. package/dist/cli/menu/pages/sessions-page.d.ts +2 -0
  98. package/dist/cli/menu/pages/sessions-page.js +12 -4
  99. package/dist/cli/menu/pages/settings-page.js +13 -1
  100. package/dist/cli/menu/remote-menu.js +1 -1
  101. package/dist/cli/menu/shell.d.ts +5 -0
  102. package/dist/cli/menu/shell.js +13 -0
  103. package/dist/cli/menu/views.js +2 -1
  104. package/dist/cli/report.js +2 -0
  105. package/dist/cli/services/agent-commands-service.d.ts +2 -0
  106. package/dist/cli/services/agent-commands-service.js +13 -7
  107. package/dist/cli/services/vpn-service.d.ts +5 -1
  108. package/dist/cli/services/vpn-service.js +6 -1
  109. package/dist/cli/tui/app.d.ts +5 -0
  110. package/dist/cli/tui/app.js +2 -0
  111. package/dist/cli/tui/dialogs/text-screen.js +2 -1
  112. package/dist/cli/tui/terminal.js +3 -1
  113. package/dist/core/config/defaults.js +12 -1
  114. package/dist/core/detect/toolchains.js +9 -0
  115. package/dist/core/disk.d.ts +1 -5
  116. package/dist/core/disk.js +1 -16
  117. package/dist/core/schema/accounts.d.ts +6 -0
  118. package/dist/core/schema/accounts.js +13 -11
  119. package/dist/core/schema/codex.d.ts +29 -0
  120. package/dist/core/schema/codex.js +24 -0
  121. package/dist/core/schema/config.d.ts +58 -14
  122. package/dist/core/schema/config.js +6 -4
  123. package/dist/core/schema/github.js +1 -1
  124. package/dist/core/schema/index.d.ts +1 -0
  125. package/dist/core/schema/index.js +1 -0
  126. package/dist/core/schema/profile.js +8 -4
  127. package/dist/core/schema/resume.js +1 -1
  128. package/dist/core/schema/sandbox.js +3 -3
  129. package/dist/core/schema/toolchains.d.ts +4 -0
  130. package/dist/core/schema/toolchains.js +3 -0
  131. package/dist/core/schema/vpn.js +1 -1
  132. package/dist/core/schema/web.js +3 -3
  133. package/dist/core/types.d.ts +8 -0
  134. package/dist/core/util/errors.d.ts +11 -1
  135. package/dist/core/util/errors.js +7 -1
  136. package/dist/core/util/index.d.ts +1 -1
  137. package/dist/core/util/index.js +1 -1
  138. package/dist/guest/accounts/adapter.d.ts +2 -0
  139. package/dist/guest/accounts/adapters.js +4 -0
  140. package/dist/guest/accounts/apply.d.ts +10 -6
  141. package/dist/guest/accounts/kinds/cfx.d.ts +7 -0
  142. package/dist/guest/accounts/kinds/cfx.js +33 -3
  143. package/dist/guest/accounts/kinds/comet.d.ts +7 -0
  144. package/dist/guest/accounts/kinds/comet.js +50 -0
  145. package/dist/guest/accounts/kinds/perplexity.d.ts +2 -0
  146. package/dist/guest/accounts/kinds/perplexity.js +12 -0
  147. package/dist/guest/accounts/watch.d.ts +2 -0
  148. package/dist/guest/accounts/watch.js +12 -2
  149. package/dist/guest/agents/agent-files.d.ts +26 -6
  150. package/dist/guest/agents/agent-files.js +84 -14
  151. package/dist/guest/agents/agent-installer.js +1 -1
  152. package/dist/guest/agents/local-state.d.ts +5 -2
  153. package/dist/guest/agents/local-state.js +24 -10
  154. package/dist/guest/agents/profile-links.d.ts +2 -0
  155. package/dist/guest/agents/profile-links.js +18 -4
  156. package/dist/guest/apps/after-install.js +19 -0
  157. package/dist/guest/apps/app-installer.d.ts +11 -0
  158. package/dist/guest/apps/app-installer.js +69 -6
  159. package/dist/guest/apps/comet-unpack.d.ts +20 -0
  160. package/dist/guest/apps/comet-unpack.js +127 -0
  161. package/dist/guest/apps/index.d.ts +1 -1
  162. package/dist/guest/apps/index.js +1 -1
  163. package/dist/guest/apps/resolvers-agents-web.d.ts +2 -0
  164. package/dist/guest/apps/resolvers-agents-web.js +7 -0
  165. package/dist/guest/apps/resolvers.js +2 -0
  166. package/dist/guest/apps/shortcuts.d.ts +2 -0
  167. package/dist/guest/apps/shortcuts.js +1 -0
  168. package/dist/guest/apps/unpack.js +14 -4
  169. package/dist/guest/boot/boot.d.ts +45 -16
  170. package/dist/guest/boot/boot.js +325 -149
  171. package/dist/guest/boot/graph.d.ts +252 -0
  172. package/dist/guest/boot/graph.js +257 -0
  173. package/dist/guest/boot/guide-lines.d.ts +25 -0
  174. package/dist/guest/boot/guide-lines.js +41 -0
  175. package/dist/guest/boot/guide.d.ts +1 -4
  176. package/dist/guest/boot/guide.js +6 -8
  177. package/dist/guest/boot/runner.d.ts +77 -0
  178. package/dist/guest/boot/runner.js +215 -0
  179. package/dist/guest/browser/cdp.d.ts +71 -0
  180. package/dist/guest/browser/cdp.js +306 -0
  181. package/dist/guest/browser/comet.d.ts +28 -0
  182. package/dist/guest/browser/comet.js +155 -0
  183. package/dist/guest/daemon/project-provisioner.js +6 -1
  184. package/dist/guest/daemon/sessions.js +2 -1
  185. package/dist/guest/devtools/fivem.d.ts +1 -1
  186. package/dist/guest/devtools/fivem.js +243 -3
  187. package/dist/guest/entries/daemon.js +2 -0
  188. package/dist/guest/runtime/log.d.ts +12 -0
  189. package/dist/guest/runtime/log.js +29 -5
  190. package/dist/guest/runtime/pools.d.ts +24 -0
  191. package/dist/guest/runtime/pools.js +60 -0
  192. package/dist/guest/runtime/process.d.ts +4 -0
  193. package/dist/guest/runtime/process.js +38 -1
  194. package/dist/guest/runtime/status.d.ts +5 -1
  195. package/dist/guest/runtime/status.js +19 -0
  196. package/dist/guest/setup/addon-mcp.d.ts +1 -1
  197. package/dist/guest/setup/addon-mcp.js +52 -12
  198. package/dist/guest/setup/agent-addons.d.ts +3 -2
  199. package/dist/guest/setup/agent-addons.js +12 -3
  200. package/dist/guest/setup/environment.d.ts +1 -1
  201. package/dist/guest/setup/environment.js +25 -12
  202. package/dist/guest/setup/headroom.d.ts +8 -3
  203. package/dist/guest/setup/headroom.js +44 -15
  204. package/dist/guest/setup/path-plan.d.ts +28 -0
  205. package/dist/guest/setup/path-plan.js +69 -2
  206. package/dist/guest/setup/shell-path.d.ts +1 -1
  207. package/dist/guest/setup/shell-path.js +3 -3
  208. package/dist/guest/toolchains/fivem/artifacts.d.ts +48 -1
  209. package/dist/guest/toolchains/fivem/artifacts.js +97 -4
  210. package/dist/guest/toolchains/fivem/fivem.d.ts +32 -1
  211. package/dist/guest/toolchains/fivem/fivem.js +168 -3
  212. package/dist/guest/toolchains/fivem/scaffold.d.ts +35 -0
  213. package/dist/guest/toolchains/fivem/scaffold.js +105 -0
  214. package/dist/guest/toolchains/fivem/serve-plan.d.ts +34 -0
  215. package/dist/guest/toolchains/fivem/serve-plan.js +61 -0
  216. package/dist/guest/toolchains/installers.d.ts +6 -10
  217. package/dist/guest/toolchains/installers.js +4 -12
  218. package/dist/guest/toolchains/languages/go.js +1 -1
  219. package/dist/guest/toolchains/languages/node.js +2 -1
  220. package/dist/guest/toolchains/languages/php.d.ts +2 -0
  221. package/dist/guest/toolchains/languages/php.js +13 -1
  222. package/dist/guest/toolchains/languages/python-tools.js +1 -1
  223. package/dist/guest/toolchains/languages/ruby.js +1 -1
  224. package/dist/guest/toolchains/native/autosdk.d.ts +3 -0
  225. package/dist/guest/toolchains/native/autosdk.js +50 -0
  226. package/dist/guest/toolchains/native/binstall.js +1 -1
  227. package/dist/guest/toolchains/native/msvc/packages.js +10 -4
  228. package/dist/guest/toolchains/native/rust.d.ts +2 -0
  229. package/dist/guest/toolchains/native/rust.js +11 -4
  230. package/dist/guest/toolchains/native/unreal.d.ts +2 -0
  231. package/dist/guest/toolchains/native/unreal.js +19 -6
  232. package/dist/guest/toolchains/native/vcruntime.d.ts +2 -3
  233. package/dist/guest/toolchains/native/vcruntime.js +12 -7
  234. package/dist/guest/toolchains/native/visual-studio.d.ts +5 -2
  235. package/dist/guest/toolchains/native/visual-studio.js +127 -25
  236. package/dist/guest/toolchains/native/vs-request.d.ts +23 -0
  237. package/dist/guest/toolchains/native/vs-request.js +62 -1
  238. package/dist/guest/toolchains/not-yet.d.ts +1 -1
  239. package/dist/guest/toolchains/not-yet.js +3 -3
  240. package/dist/guest/toolchains/persisted.js +2 -7
  241. package/dist/guest/toolchains/plan.js +27 -11
  242. package/dist/guest/toolchains/scheduler.d.ts +2 -21
  243. package/dist/guest/toolchains/scheduler.js +7 -121
  244. package/dist/guest/toolchains/setup.d.ts +15 -2
  245. package/dist/guest/toolchains/setup.js +39 -20
  246. package/dist/guest/toolchains/signature.d.ts +5 -0
  247. package/dist/guest/toolchains/signature.js +22 -0
  248. package/dist/guest/toolchains/split.d.ts +28 -0
  249. package/dist/guest/toolchains/split.js +60 -0
  250. package/dist/guest/toolchains/steam/client.js +2 -1
  251. package/dist/guest/toolchains/step-scheduler.d.ts +51 -0
  252. package/dist/guest/toolchains/step-scheduler.js +147 -0
  253. package/dist/guest/toolchains/step.d.ts +13 -0
  254. package/dist/guest/toolchains/tools/git.js +18 -0
  255. package/dist/guest/vpn/openvpn.js +3 -4
  256. package/dist/guest/vpn/tunnel.d.ts +3 -0
  257. package/dist/guest/vpn/tunnel.js +10 -12
  258. package/dist/guest/vpn/vpn.js +6 -1
  259. package/dist/guest/vpn/wireguard.js +11 -4
  260. package/dist/host/accounts/deliver.js +7 -0
  261. package/dist/host/accounts/handoff.js +2 -6
  262. package/dist/host/accounts/index.d.ts +1 -1
  263. package/dist/host/accounts/index.js +1 -1
  264. package/dist/host/accounts/kinds/cfx.d.ts +1 -1
  265. package/dist/host/accounts/kinds/cfx.js +47 -4
  266. package/dist/host/accounts/kinds/comet.d.ts +2 -0
  267. package/dist/host/accounts/kinds/comet.js +6 -0
  268. package/dist/host/accounts/kinds/perplexity.d.ts +2 -0
  269. package/dist/host/accounts/kinds/perplexity.js +30 -0
  270. package/dist/host/accounts/leases.d.ts +9 -3
  271. package/dist/host/accounts/leases.js +13 -2
  272. package/dist/host/accounts/source.d.ts +7 -1
  273. package/dist/host/accounts/source.js +28 -1
  274. package/dist/host/accounts/sources.js +4 -0
  275. package/dist/host/agent-commands/commands.js +1 -1
  276. package/dist/host/agent-commands/forwarders.d.ts +14 -2
  277. package/dist/host/agent-commands/forwarders.js +31 -13
  278. package/dist/host/agent-commands/reconcile.d.ts +2 -1
  279. package/dist/host/agent-commands/reconcile.js +7 -8
  280. package/dist/host/agent-commands/user-path.d.ts +5 -0
  281. package/dist/host/agent-commands/user-path.js +13 -0
  282. package/dist/host/github/deliver.d.ts +1 -1
  283. package/dist/host/github/deliver.js +20 -1
  284. package/dist/host/github/index.d.ts +2 -1
  285. package/dist/host/github/index.js +1 -0
  286. package/dist/host/github/token.d.ts +13 -1
  287. package/dist/host/github/token.js +19 -2
  288. package/dist/host/github/verify.d.ts +27 -0
  289. package/dist/host/github/verify.js +61 -0
  290. package/dist/host/launch/hints/fivem.d.ts +3 -1
  291. package/dist/host/launch/hints/fivem.js +68 -2
  292. package/dist/host/launch/session-file.js +5 -0
  293. package/dist/host/launch/toolchains.d.ts +2 -1
  294. package/dist/host/launch/toolchains.js +5 -3
  295. package/dist/host/profile/accounts.js +2 -4
  296. package/dist/host/profile/claude-login.d.ts +3 -2
  297. package/dist/host/profile/claude-login.js +3 -13
  298. package/dist/host/vpn/index.d.ts +2 -1
  299. package/dist/host/vpn/index.js +2 -1
  300. package/dist/host/vpn/last.d.ts +28 -0
  301. package/dist/host/vpn/last.js +43 -0
  302. package/dist/host/vpn/login.d.ts +3 -1
  303. package/dist/host/vpn/login.js +17 -3
  304. package/dist/host/vpn/nordvpn.d.ts +2 -4
  305. package/dist/host/vpn/nordvpn.js +2 -24
  306. package/dist/runtime/agent.js +433 -90
  307. package/dist/runtime/daemon.js +3378 -1546
  308. package/dist/runtime/db.js +363 -90
  309. package/dist/runtime/main.js +5134 -2096
  310. package/dist/runtime/netproxy.js +308 -69
  311. package/dist/runtime/tool.js +2867 -1765
  312. package/dist/runtime/view.js +308 -69
  313. package/dist/selftest/agent-commands.test.js +45 -7
  314. package/dist/selftest/agent-paths.test.js +40 -13
  315. package/dist/selftest/agent-settings.test.d.ts +2 -0
  316. package/dist/selftest/agent-settings.test.js +94 -0
  317. package/dist/selftest/agents-web.test.d.ts +2 -0
  318. package/dist/selftest/agents-web.test.js +647 -0
  319. package/dist/selftest/app.test.js +7 -3
  320. package/dist/selftest/boot-runner.test.d.ts +2 -0
  321. package/dist/selftest/boot-runner.test.js +456 -0
  322. package/dist/selftest/channel.test.js +15 -0
  323. package/dist/selftest/cli.test.js +4 -0
  324. package/dist/selftest/fivem.test.js +249 -3
  325. package/dist/selftest/github.test.js +94 -9
  326. package/dist/selftest/guest-boot.test.js +3 -0
  327. package/dist/selftest/health.test.js +1 -1
  328. package/dist/selftest/index.js +10 -0
  329. package/dist/selftest/layout.test.js +5 -0
  330. package/dist/selftest/menu-coverage.test.d.ts +2 -0
  331. package/dist/selftest/menu-coverage.test.js +46 -0
  332. package/dist/selftest/menu-screens.js +37 -1
  333. package/dist/selftest/menu.test.js +5 -3
  334. package/dist/selftest/pc-installs.test.js +5 -0
  335. package/dist/selftest/persisted-installs.test.js +72 -0
  336. package/dist/selftest/service-accounts.test.js +3 -2
  337. package/dist/selftest/support/engine-golden.js +28 -1
  338. package/dist/selftest/support/fixtures.d.ts +15 -0
  339. package/dist/selftest/support/web-preview.d.ts +34 -1
  340. package/dist/selftest/support/web-preview.js +21 -18
  341. package/dist/selftest/toolchains.test.js +23 -1
  342. package/dist/selftest/ui-text.test.d.ts +7 -0
  343. package/dist/selftest/ui-text.test.js +300 -0
  344. package/dist/selftest/vpn.test.js +51 -3
  345. package/dist/shared/accounts/anthropic.d.ts +5 -0
  346. package/dist/shared/accounts/anthropic.js +15 -0
  347. package/dist/shared/accounts/index.d.ts +3 -0
  348. package/dist/shared/accounts/index.js +3 -0
  349. package/dist/shared/accounts/kinds/comet.d.ts +12 -0
  350. package/dist/shared/accounts/kinds/comet.js +64 -0
  351. package/dist/shared/accounts/kinds/perplexity.d.ts +8 -0
  352. package/dist/shared/accounts/kinds/perplexity.js +37 -0
  353. package/dist/shared/accounts/kinds.d.ts +24 -5
  354. package/dist/shared/accounts/kinds.js +86 -4
  355. package/dist/shared/accounts/payloads.d.ts +81 -0
  356. package/dist/shared/accounts/payloads.js +39 -1
  357. package/dist/shared/apps/agent-addons.d.ts +33 -5
  358. package/dist/shared/apps/agent-addons.js +95 -3
  359. package/dist/shared/apps/catalogue-agents-web.d.ts +14 -0
  360. package/dist/shared/apps/catalogue-agents-web.js +112 -0
  361. package/dist/shared/apps/catalogue-modding.js +32 -1
  362. package/dist/shared/apps/catalogue.d.ts +27 -3
  363. package/dist/shared/apps/catalogue.js +2 -1
  364. package/dist/shared/apps/index.d.ts +3 -1
  365. package/dist/shared/apps/index.js +3 -1
  366. package/dist/shared/channel/schema.d.ts +40 -3
  367. package/dist/shared/channel/schema.js +9 -0
  368. package/dist/shared/channel/secrets.d.ts +19 -0
  369. package/dist/shared/concurrency/index.d.ts +3 -0
  370. package/dist/shared/concurrency/index.js +3 -0
  371. package/dist/shared/concurrency/installer-retry.d.ts +6 -0
  372. package/dist/shared/concurrency/installer-retry.js +10 -0
  373. package/dist/shared/concurrency/limiter.d.ts +19 -0
  374. package/dist/shared/concurrency/limiter.js +67 -0
  375. package/dist/shared/concurrency/pools.d.ts +7 -0
  376. package/dist/shared/concurrency/pools.js +9 -0
  377. package/dist/shared/download/archive.d.ts +2 -0
  378. package/dist/shared/download/archive.js +11 -1
  379. package/dist/shared/download/bounded-fetch.d.ts +13 -0
  380. package/dist/shared/download/bounded-fetch.js +40 -0
  381. package/dist/shared/download/downloader.d.ts +5 -0
  382. package/dist/shared/download/downloader.js +50 -38
  383. package/dist/shared/download/index.d.ts +2 -1
  384. package/dist/shared/download/index.js +2 -1
  385. package/dist/shared/io/disk.d.ts +9 -0
  386. package/dist/shared/io/disk.js +19 -0
  387. package/dist/shared/io/index.d.ts +1 -0
  388. package/dist/shared/io/index.js +1 -0
  389. package/dist/shared/readiness.d.ts +9 -0
  390. package/dist/shared/readiness.js +11 -0
  391. package/dist/shared/signer.d.ts +24 -0
  392. package/dist/shared/signer.js +15 -0
  393. package/dist/shared/vpn/failure.d.ts +10 -0
  394. package/dist/shared/vpn/failure.js +28 -0
  395. package/dist/sync/watcher.js +2 -0
  396. package/dist/web/index.html +1 -1
  397. package/dist/web/{main-GVZWWP4I.js → main-CCILLX2M.js} +75 -74
  398. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  399. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  400. package/native/csharp/HostTools/Program.cs +14 -1
  401. package/native/csharp/HostTools/UserPath.cs +17 -0
  402. package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
  403. package/native/scripts/edit-user-path.ps1 +6 -2
  404. package/package.json +1 -1
  405. package/sandbox/addons/browser-use-mcp/requirements.in +1 -0
  406. package/sandbox/addons/browser-use-mcp/requirements.txt +2350 -0
  407. package/sandbox/addons/chrome-devtools-mcp/package-lock.json +38 -0
  408. package/sandbox/addons/chrome-devtools-mcp/package.json +7 -0
  409. package/sandbox/addons/comet-mcp/package-lock.json +1277 -0
  410. package/sandbox/addons/comet-mcp/package.json +7 -0
  411. package/sandbox/addons/perplexity-mcp/package-lock.json +1655 -0
  412. package/sandbox/addons/perplexity-mcp/package.json +7 -0
  413. package/sandbox/scripts/add-firewall-port.ps1 +18 -4
  414. package/sandbox/scripts/get-signature.ps1 +13 -0
  415. package/sandbox/scripts/set-machine-environment.ps1 +30 -15
  416. package/sandbox/templates/fivem/README.txt +6 -2
  417. package/sandbox/templates/fivem/cs/Client/Client.csproj +15 -0
  418. package/sandbox/templates/fivem/cs/Client/ClientMain.cs +20 -0
  419. package/sandbox/templates/fivem/cs/Server/Server.csproj +14 -0
  420. package/sandbox/templates/fivem/cs/Server/ServerMain.cs +20 -0
  421. package/sandbox/templates/fivem/cs/fxmanifest.lua +11 -0
  422. package/sandbox/templates/fivem/js/client.js +12 -0
  423. package/sandbox/templates/fivem/js/fxmanifest.lua +9 -0
  424. package/sandbox/templates/fivem/js/server.js +6 -0
  425. package/sandbox/templates/fivem/lua/client.lua +8 -0
  426. package/sandbox/templates/fivem/lua/fxmanifest.lua +10 -0
  427. package/sandbox/templates/fivem/lua/server.lua +6 -0
  428. package/sandbox/templates/fivem/server.cfg +37 -0
  429. package/sandbox/templates/fivem/ts/build.js +17 -0
  430. package/sandbox/templates/fivem/ts/fxmanifest.lua +9 -0
  431. package/sandbox/templates/fivem/ts/package.json +16 -0
  432. package/sandbox/templates/fivem/ts/src/client/client.ts +12 -0
  433. package/sandbox/templates/fivem/ts/src/client/tsconfig.json +13 -0
  434. package/sandbox/templates/fivem/ts/src/server/server.ts +6 -0
  435. package/sandbox/templates/fivem/ts/src/server/tsconfig.json +13 -0
  436. package/schemas/config.schema.json +120 -27
  437. package/schemas/sandbox-config.schema.json +45 -14
  438. package/sandbox/scripts/get-signer.ps1 +0 -8
@@ -0,0 +1,305 @@
1
+ // The environment variables of Claude Code worth setting, for the "Claude environment" editor. Every name was found in
2
+ // the claude.exe of the sandbox (a bounded grep -a -o -w); descriptions follow code.claude.com/docs (Environment
3
+ // variables). Web-safe: no node imports. A flag is written as "1"; an empty value removes the variable.
4
+ export const ENV_GROUPS = ['Subagents', 'Models', 'Limits', 'Behaviour', 'Privacy', 'Network', 'Providers'];
5
+ const group = (g, kind, rows) => rows.map(([name, label, description, extra]) => ({
6
+ name,
7
+ group: g,
8
+ label,
9
+ kind,
10
+ description,
11
+ ...(kind === 'number' ? { min: 0 } : {}),
12
+ ...extra,
13
+ }));
14
+ /** The variable that sets how many subagents run at once (Claude's code default is 20). */
15
+ export const MAX_SUBAGENTS_VAR = 'CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS';
16
+ export const MAX_SUBAGENTS_DEFAULT = 20;
17
+ export const CLAUDE_ENV = [
18
+ ...group('Subagents', 'number', [
19
+ [
20
+ MAX_SUBAGENTS_VAR,
21
+ 'Subagents at once',
22
+ 'How many subagents may run at the same time.',
23
+ { min: 1, max: 1000, defaultText: String(MAX_SUBAGENTS_DEFAULT) },
24
+ ],
25
+ [
26
+ 'CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH',
27
+ 'Subagent nesting depth',
28
+ 'How deep subagents may start subagents.',
29
+ { min: 1, max: 20 },
30
+ ],
31
+ [
32
+ 'CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION',
33
+ 'Subagents per session',
34
+ 'The most subagents one session may start.',
35
+ { min: 1 },
36
+ ],
37
+ [
38
+ 'CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS',
39
+ 'Workflow agents at once',
40
+ 'How many agents one workflow runs at the same time.',
41
+ { min: 1 },
42
+ ],
43
+ ]),
44
+ ...group('Subagents', 'text', [
45
+ [
46
+ 'CLAUDE_CODE_SUBAGENT_MODEL',
47
+ 'Subagent model',
48
+ 'The model subagents use (an alias such as sonnet, or a full model name).',
49
+ ],
50
+ ]),
51
+ ...group('Subagents', 'flag', [
52
+ [
53
+ 'CLAUDE_CODE_SUBAGENT_MODEL_FORCE',
54
+ 'Force the subagent model',
55
+ 'Use the subagent model even where an agent asks for another one.',
56
+ ],
57
+ ['CLAUDE_CODE_FORK_SUBAGENT', 'Forked subagents', 'Let subagents start from a copy of the conversation so far.'],
58
+ ]),
59
+ ...group('Models', 'text', [
60
+ ['ANTHROPIC_MODEL', 'Model', 'The model Claude uses (an alias such as opus, or a full model name).'],
61
+ ['ANTHROPIC_DEFAULT_OPUS_MODEL', 'Model behind "opus"', 'The model the opus alias stands for.'],
62
+ ['ANTHROPIC_DEFAULT_SONNET_MODEL', 'Model behind "sonnet"', 'The model the sonnet alias stands for.'],
63
+ ['ANTHROPIC_DEFAULT_HAIKU_MODEL', 'Model behind "haiku"', 'The model the haiku alias stands for.'],
64
+ ['ANTHROPIC_SMALL_FAST_MODEL', 'Small, fast model', 'The model used for light background work.'],
65
+ ]),
66
+ {
67
+ name: 'CLAUDE_CODE_EFFORT_LEVEL',
68
+ group: 'Models',
69
+ label: 'Effort level',
70
+ kind: 'enum',
71
+ choices: ['low', 'medium', 'high', 'xhigh', 'max'],
72
+ description: 'How hard Claude thinks, for every session.',
73
+ },
74
+ ...group('Models', 'number', [
75
+ ['MAX_THINKING_TOKENS', 'Thinking budget (tokens)', 'The most tokens Claude may spend thinking before it answers.'],
76
+ ]),
77
+ ...group('Models', 'flag', [
78
+ ['CLAUDE_CODE_DISABLE_THINKING', 'No extended thinking', 'Turn extended thinking off.'],
79
+ [
80
+ 'CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING',
81
+ 'No adaptive thinking',
82
+ 'Use a fixed thinking budget instead of letting the model decide.',
83
+ ],
84
+ ['CLAUDE_CODE_DISABLE_1M_CONTEXT', 'No 1M-token context', 'Do not use the one-million-token context window.'],
85
+ ['CLAUDE_CODE_DISABLE_FAST_MODE', 'No fast mode', 'Turn fast mode off.'],
86
+ ]),
87
+ ...group('Limits', 'number', [
88
+ ['CLAUDE_CODE_MAX_OUTPUT_TOKENS', 'Output tokens per reply', 'The most tokens one reply may have.', { min: 1 }],
89
+ [
90
+ 'CLAUDE_CODE_MAX_CONTEXT_TOKENS',
91
+ 'Context size (tokens)',
92
+ 'The most tokens Claude keeps in the conversation.',
93
+ { min: 1 },
94
+ ],
95
+ [
96
+ 'CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS',
97
+ 'Tokens per file read',
98
+ 'The most tokens one file read may return.',
99
+ { min: 1 },
100
+ ],
101
+ ['MAX_MCP_OUTPUT_TOKENS', 'Tokens per MCP result', 'The most tokens one MCP tool result may have.', { min: 1 }],
102
+ [
103
+ 'BASH_DEFAULT_TIMEOUT_MS',
104
+ 'Command timeout (ms)',
105
+ 'How long a shell command runs before it is stopped, unless the command asks for more.',
106
+ { min: 1 },
107
+ ],
108
+ [
109
+ 'BASH_MAX_TIMEOUT_MS',
110
+ 'Longest command timeout (ms)',
111
+ 'The longest timeout a shell command may ask for.',
112
+ { min: 1 },
113
+ ],
114
+ [
115
+ 'BASH_MAX_OUTPUT_LENGTH',
116
+ 'Command output (characters)',
117
+ 'The most characters of a shell command output kept.',
118
+ { min: 1 },
119
+ ],
120
+ [
121
+ 'TASK_MAX_OUTPUT_LENGTH',
122
+ 'Subagent output (characters)',
123
+ 'The most characters of a subagent output kept.',
124
+ { min: 1 },
125
+ ],
126
+ ['MCP_TIMEOUT', 'MCP start timeout (ms)', 'How long an MCP server may take to start.', { min: 1 }],
127
+ ['MCP_TOOL_TIMEOUT', 'MCP tool timeout (ms)', 'How long one MCP tool call may take.', { min: 1 }],
128
+ ['API_TIMEOUT_MS', 'API timeout (ms)', 'How long a request to the API may take.', { min: 1 }],
129
+ ['CLAUDE_CODE_MAX_RETRIES', 'API retries', 'How many times a failed API request is tried again.'],
130
+ [
131
+ 'CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY',
132
+ 'Tools at once',
133
+ 'How many tool calls may run at the same time.',
134
+ { min: 1 },
135
+ ],
136
+ ['CLAUDE_CODE_MAX_TURNS', 'Most turns', 'The most turns Claude takes on one request.', { min: 1 }],
137
+ [
138
+ 'CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION',
139
+ 'Web searches per session',
140
+ 'The most web searches one session may do.',
141
+ ],
142
+ ['CLAUDE_CODE_GLOB_TIMEOUT_SECONDS', 'File search timeout (s)', 'How long a file search may take.', { min: 1 }],
143
+ [
144
+ 'SLASH_COMMAND_TOOL_CHAR_BUDGET',
145
+ 'Slash command text budget',
146
+ 'The characters of slash command descriptions Claude is told about.',
147
+ { min: 1 },
148
+ ],
149
+ [
150
+ 'CLAUDE_AUTOCOMPACT_PCT_OVERRIDE',
151
+ 'Compact at (% full)',
152
+ 'When the context is this full, Claude compacts it.',
153
+ { min: 1, max: 100 },
154
+ ],
155
+ [
156
+ 'CLAUDE_CODE_AUTO_COMPACT_WINDOW',
157
+ 'Compaction window (tokens)',
158
+ 'The context size compaction is measured against.',
159
+ { min: 1 },
160
+ ],
161
+ ]),
162
+ ...group('Limits', 'flag', [
163
+ ['DISABLE_AUTO_COMPACT', 'No automatic compaction', 'Never compact the context by itself.'],
164
+ ]),
165
+ ...group('Behaviour', 'text', [
166
+ ['CLAUDE_CODE_SHELL', 'Shell', 'The shell Claude runs commands in.'],
167
+ ['CLAUDE_CODE_GIT_BASH_PATH', 'Git Bash path', 'Where bash.exe of Git for Windows is.'],
168
+ ['CLAUDE_CODE_TMPDIR', 'Temp folder', 'The folder Claude keeps its temporary files in.'],
169
+ ['CLAUDE_ENV_FILE', 'Shell setup file', 'A script run before every shell command.'],
170
+ ]),
171
+ ...group('Behaviour', 'flag', [
172
+ [
173
+ 'CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR',
174
+ 'Stay in the project folder',
175
+ 'Return to the project folder after every shell command.',
176
+ ],
177
+ [
178
+ 'USE_BUILTIN_RIPGREP',
179
+ 'Use the built-in ripgrep',
180
+ 'Use the ripgrep that comes with Claude rather than the one on PATH.',
181
+ ],
182
+ ['CLAUDE_CODE_DISABLE_BACKGROUND_TASKS', 'No background tasks', 'Do not let commands run in the background.'],
183
+ ['CLAUDE_CODE_ENABLE_TASKS', 'Task list', 'Turn the task list tools on.'],
184
+ ['CLAUDE_CODE_DISABLE_AUTO_MEMORY', 'No automatic memory', 'Claude does not write memory notes by itself.'],
185
+ ['CLAUDE_CODE_DISABLE_CLAUDE_MDS', 'Ignore CLAUDE.md files', 'Do not load CLAUDE.md files.'],
186
+ [
187
+ 'CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS',
188
+ 'No built-in git instructions',
189
+ 'Leave the git instructions out of the prompt.',
190
+ ],
191
+ ['CLAUDE_CODE_DISABLE_TERMINAL_TITLE', 'Keep the terminal title', 'Do not change the terminal title.'],
192
+ ['CLAUDE_CODE_NO_FLICKER', 'Flicker-free screen', 'Draw the screen in its own buffer, which stops flicker.'],
193
+ ['CLAUDE_CODE_SIMPLE', 'Simple mode', 'Start with fewer tools and a short prompt.'],
194
+ ['CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION', 'Prompt suggestions', 'Suggest what to type next.'],
195
+ ['CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS', 'Agent teams (experimental)', 'Turn the experimental agent teams on.'],
196
+ [
197
+ 'CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS',
198
+ 'No experimental betas',
199
+ 'Do not send experimental beta headers to the API.',
200
+ ],
201
+ ['CLAUDE_CODE_SKIP_PROMPT_HISTORY', 'Do not keep prompt history', 'Do not save what you type.'],
202
+ [
203
+ 'CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL',
204
+ 'No editor extension install',
205
+ 'Do not install the editor extension by itself.',
206
+ ],
207
+ ['ENABLE_TOOL_SEARCH', 'Tool search', 'Load MCP tools when they are needed instead of at the start.'],
208
+ ]),
209
+ ...group('Privacy', 'flag', [
210
+ ['DISABLE_TELEMETRY', 'No telemetry', 'Do not send usage statistics.'],
211
+ ['DISABLE_ERROR_REPORTING', 'No error reports', 'Do not send error reports.'],
212
+ ['DISABLE_COST_WARNINGS', 'No cost warnings', 'Hide the cost warnings.'],
213
+ [
214
+ 'CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC',
215
+ 'Only essential traffic',
216
+ 'Turn off telemetry, error reports, updates and the survey in one go.',
217
+ ],
218
+ ['CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY', 'No feedback survey', 'Do not ask for feedback.'],
219
+ [
220
+ 'DISABLE_AUTOUPDATER',
221
+ 'No automatic updates',
222
+ 'Do not update Claude by itself. The sandbox sets this: it installs Claude itself.',
223
+ ],
224
+ ['DISABLE_PROMPT_CACHING', 'No prompt caching', 'Turn prompt caching off.'],
225
+ ['CLAUDE_CODE_ENABLE_TELEMETRY', 'OpenTelemetry', 'Turn OpenTelemetry metrics on.'],
226
+ ]),
227
+ ...group('Network', 'text', [
228
+ ['HTTPS_PROXY', 'HTTPS proxy', 'A proxy for HTTPS requests (http://host:port).'],
229
+ ['NO_PROXY', 'Hosts without the proxy', 'Hosts that do not go through the proxy, separated by commas.'],
230
+ ['ANTHROPIC_BASE_URL', 'API address', 'Send API requests to this address instead of Anthropic (a gateway).'],
231
+ [
232
+ 'ANTHROPIC_CUSTOM_HEADERS',
233
+ 'Extra API headers',
234
+ 'Headers added to every API request, one "Name: value" per line.',
235
+ { secret: true },
236
+ ],
237
+ ]),
238
+ ...group('Providers', 'flag', [
239
+ ['CLAUDE_CODE_USE_BEDROCK', 'Use Amazon Bedrock', 'Run the models through Amazon Bedrock.'],
240
+ ['CLAUDE_CODE_USE_VERTEX', 'Use Google Vertex AI', 'Run the models through Google Vertex AI.'],
241
+ ['CLAUDE_CODE_USE_FOUNDRY', 'Use Microsoft Foundry', 'Run the models through Microsoft Foundry.'],
242
+ ]),
243
+ ...group('Providers', 'text', [
244
+ ['AWS_BEARER_TOKEN_BEDROCK', 'Bedrock token', 'A bearer token for Amazon Bedrock.', { secret: true }],
245
+ [
246
+ 'ANTHROPIC_AUTH_TOKEN',
247
+ 'Auth token',
248
+ 'A token sent as the Authorization header (for a gateway).',
249
+ { secret: true },
250
+ ],
251
+ [
252
+ 'ANTHROPIC_API_KEY',
253
+ 'API key',
254
+ 'An Anthropic API key. To keep a key for later, use Accounts > Save an API key instead.',
255
+ { secret: true },
256
+ ],
257
+ ]),
258
+ ];
259
+ /** The catalogue entry of a variable name. */
260
+ export function envSpec(name) {
261
+ return CLAUDE_ENV.find((s) => s.name === name);
262
+ }
263
+ /** A variable name anyone may set (the same shape the settings accept). */
264
+ export const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,100}$/;
265
+ /**
266
+ * What a typed value becomes for this variable: the text to save, null when it removes the variable, or a problem the
267
+ * person can act on. A flag is "1" or removed; a number is whole and in range; ANTHROPIC_API_KEY must pass the key
268
+ * check it is given. Pure.
269
+ */
270
+ export function envValue(spec, raw,
271
+ /** What is wrong with an Anthropic API key (the host passes anthropicKeyProblem), or null. */
272
+ keyProblem = () => null) {
273
+ const value = raw === null ? '' : raw.trim();
274
+ if (value === '')
275
+ return { save: null };
276
+ if (!spec)
277
+ return { save: value };
278
+ if (spec.kind === 'flag') {
279
+ const word = value.toLowerCase();
280
+ if (['1', 'true', 'on', 'yes'].includes(word))
281
+ return { save: '1' };
282
+ if (['0', 'false', 'off', 'no'].includes(word))
283
+ return { save: null };
284
+ return { problem: 'Use 1 (on) or leave it empty (off).' };
285
+ }
286
+ if (spec.kind === 'number') {
287
+ const n = Number(value);
288
+ const min = spec.min ?? 0;
289
+ if (!/^\d{1,15}$/.test(value))
290
+ return { problem: 'Use a whole number.' };
291
+ if (n < min || (spec.max !== undefined && n > spec.max))
292
+ return { problem: 'Use a number from ' + min + (spec.max !== undefined ? ' to ' + spec.max : ' up') + '.' };
293
+ return { save: String(n) };
294
+ }
295
+ if (spec.kind === 'enum' && !spec.choices?.includes(value))
296
+ return { problem: 'Use one of: ' + (spec.choices ?? []).join(', ') + '.' };
297
+ if (spec.name === 'ANTHROPIC_API_KEY') {
298
+ const problem = keyProblem(value);
299
+ if (problem)
300
+ return { problem };
301
+ }
302
+ if (/[\r\n\0]/.test(value) && spec.name !== 'ANTHROPIC_CUSTOM_HEADERS')
303
+ return { problem: 'Use a single line.' };
304
+ return { save: value };
305
+ }
@@ -0,0 +1,163 @@
1
+ import { z } from 'zod';
2
+ import { type Field, type Page } from '../../kernel/index.js';
3
+ export declare const EnvRowSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ group: z.ZodEnum<{
6
+ Subagents: "Subagents";
7
+ Models: "Models";
8
+ Limits: "Limits";
9
+ Behaviour: "Behaviour";
10
+ Privacy: "Privacy";
11
+ Network: "Network";
12
+ Providers: "Providers";
13
+ }>;
14
+ label: z.ZodString;
15
+ kind: z.ZodEnum<{
16
+ number: "number";
17
+ enum: "enum";
18
+ flag: "flag";
19
+ text: "text";
20
+ }>;
21
+ description: z.ZodString;
22
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ range: z.ZodOptional<z.ZodString>;
24
+ secret: z.ZodBoolean;
25
+ defaultText: z.ZodOptional<z.ZodString>;
26
+ value: z.ZodNullable<z.ZodString>;
27
+ set: z.ZodBoolean;
28
+ fromSandbox: z.ZodBoolean;
29
+ }, z.core.$strip>;
30
+ export type EnvRow = z.output<typeof EnvRowSchema>;
31
+ export declare const CustomEnvSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ fromSandbox: z.ZodBoolean;
34
+ }, z.core.$strip>;
35
+ export declare const AgentEnvSchema: z.ZodObject<{
36
+ agent: z.ZodString;
37
+ rows: z.ZodArray<z.ZodObject<{
38
+ name: z.ZodString;
39
+ group: z.ZodEnum<{
40
+ Subagents: "Subagents";
41
+ Models: "Models";
42
+ Limits: "Limits";
43
+ Behaviour: "Behaviour";
44
+ Privacy: "Privacy";
45
+ Network: "Network";
46
+ Providers: "Providers";
47
+ }>;
48
+ label: z.ZodString;
49
+ kind: z.ZodEnum<{
50
+ number: "number";
51
+ enum: "enum";
52
+ flag: "flag";
53
+ text: "text";
54
+ }>;
55
+ description: z.ZodString;
56
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
+ range: z.ZodOptional<z.ZodString>;
58
+ secret: z.ZodBoolean;
59
+ defaultText: z.ZodOptional<z.ZodString>;
60
+ value: z.ZodNullable<z.ZodString>;
61
+ set: z.ZodBoolean;
62
+ fromSandbox: z.ZodBoolean;
63
+ }, z.core.$strip>>;
64
+ custom: z.ZodArray<z.ZodObject<{
65
+ name: z.ZodString;
66
+ fromSandbox: z.ZodBoolean;
67
+ }, z.core.$strip>>;
68
+ }, z.core.$strip>;
69
+ export type AgentEnv = z.output<typeof AgentEnvSchema>;
70
+ export declare const agentEnv: import("../../kernel/define.js").QueryDef<z.ZodObject<{
71
+ agent: z.ZodDefault<z.ZodString>;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ agent: z.ZodString;
74
+ rows: z.ZodArray<z.ZodObject<{
75
+ name: z.ZodString;
76
+ group: z.ZodEnum<{
77
+ Subagents: "Subagents";
78
+ Models: "Models";
79
+ Limits: "Limits";
80
+ Behaviour: "Behaviour";
81
+ Privacy: "Privacy";
82
+ Network: "Network";
83
+ Providers: "Providers";
84
+ }>;
85
+ label: z.ZodString;
86
+ kind: z.ZodEnum<{
87
+ number: "number";
88
+ enum: "enum";
89
+ flag: "flag";
90
+ text: "text";
91
+ }>;
92
+ description: z.ZodString;
93
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ range: z.ZodOptional<z.ZodString>;
95
+ secret: z.ZodBoolean;
96
+ defaultText: z.ZodOptional<z.ZodString>;
97
+ value: z.ZodNullable<z.ZodString>;
98
+ set: z.ZodBoolean;
99
+ fromSandbox: z.ZodBoolean;
100
+ }, z.core.$strip>>;
101
+ custom: z.ZodArray<z.ZodObject<{
102
+ name: z.ZodString;
103
+ fromSandbox: z.ZodBoolean;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>, "agents.env">;
106
+ export declare const agentsEnvSet: import("../../kernel/define.js").OperationDef<z.ZodObject<{
107
+ agent: z.ZodString;
108
+ name: z.ZodString;
109
+ value: z.ZodDefault<z.ZodNullable<z.ZodString>>;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ message: z.ZodString;
112
+ }, z.core.$strip>, "agents.env.set">;
113
+ /** The words for a value of a row: what the page shows beside the name. Pure. */
114
+ export declare function envValueText(r: EnvRow): string;
115
+ /** The editor of a row's value: a Field every surface can draw (a flag is switched, so it has none). Pure. */
116
+ export declare function envField(r: EnvRow): Field | undefined;
117
+ /** The page of an agent's variables: a section per group, then the ones of your own and "Add variable…". Pure. */
118
+ export declare function agentEnvPage(o: AgentEnv): Page;
119
+ export interface AgentEnvParams {
120
+ readonly agent?: string;
121
+ }
122
+ export declare const agentEnvView: import("../../kernel/define.js").ViewDef<{
123
+ env: import("../../kernel/define.js").QueryDef<z.ZodObject<{
124
+ agent: z.ZodDefault<z.ZodString>;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ agent: z.ZodString;
127
+ rows: z.ZodArray<z.ZodObject<{
128
+ name: z.ZodString;
129
+ group: z.ZodEnum<{
130
+ Subagents: "Subagents";
131
+ Models: "Models";
132
+ Limits: "Limits";
133
+ Behaviour: "Behaviour";
134
+ Privacy: "Privacy";
135
+ Network: "Network";
136
+ Providers: "Providers";
137
+ }>;
138
+ label: z.ZodString;
139
+ kind: z.ZodEnum<{
140
+ number: "number";
141
+ enum: "enum";
142
+ flag: "flag";
143
+ text: "text";
144
+ }>;
145
+ description: z.ZodString;
146
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ range: z.ZodOptional<z.ZodString>;
148
+ secret: z.ZodBoolean;
149
+ defaultText: z.ZodOptional<z.ZodString>;
150
+ value: z.ZodNullable<z.ZodString>;
151
+ set: z.ZodBoolean;
152
+ fromSandbox: z.ZodBoolean;
153
+ }, z.core.$strip>>;
154
+ custom: z.ZodArray<z.ZodObject<{
155
+ name: z.ZodString;
156
+ fromSandbox: z.ZodBoolean;
157
+ }, z.core.$strip>>;
158
+ }, z.core.$strip>, "agents.env">;
159
+ }, AgentEnvParams, "agentEnv">;
160
+ /** The "Subagents at once" row of the Agents page: its value in words. Pure. */
161
+ export declare function subagentsText(n: number | null): string;
162
+ /** Which catalogue row says how many subagents run at once. */
163
+ export declare const SUBAGENTS_VAR = "CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS";
@@ -0,0 +1,184 @@
1
+ // The environment variables of an agent, edited on every surface. Claude has a catalogue (claude-env.def.ts):
2
+ // names grouped with plain words, flags that switch on and off, numbers that are checked. Any agent also has "your own
3
+ // variables". The values are the agent's `environment` in your settings; secrets are never sent to a screen. Pure.
4
+ import { z } from 'zod';
5
+ import { ENV_GROUPS, ENV_NAME, MAX_SUBAGENTS_DEFAULT, MAX_SUBAGENTS_VAR } from './claude-env.def.js';
6
+ import { action, defineOperation, defineQuery, defineView, humanize, } from '../../kernel/index.js';
7
+ /** Agent names as the settings accept them. */
8
+ const AgentName = z.string().regex(/^[A-Za-z0-9_.-]{1,64}$/);
9
+ export const EnvRowSchema = z.object({
10
+ name: z.string().describe('The variable'),
11
+ group: z.enum(ENV_GROUPS).describe('The group it is listed under'),
12
+ label: z.string().describe('What it is called here'),
13
+ kind: z.enum(['flag', 'number', 'text', 'enum']).describe('What kind of value it takes'),
14
+ description: z.string().describe('What it does'),
15
+ choices: z.array(z.string()).optional().describe('The values an enum takes'),
16
+ range: z.string().optional().describe('The numbers a number takes, in words'),
17
+ secret: z.boolean().describe('Its value is never shown'),
18
+ defaultText: z.string().optional().describe('What Claude does when it is not set'),
19
+ value: z.string().nullable().describe('Its value; null when it is not set or is a secret'),
20
+ set: z.boolean().describe('Set in your settings or by the sandbox'),
21
+ fromSandbox: z.boolean().describe('The sandbox sets it (your settings can change it, not remove it)'),
22
+ });
23
+ export const CustomEnvSchema = z.object({
24
+ name: z.string().describe('The variable'),
25
+ fromSandbox: z.boolean().describe('The sandbox sets it'),
26
+ });
27
+ export const AgentEnvSchema = z.object({
28
+ agent: z.string().describe('The agent'),
29
+ rows: z.array(EnvRowSchema).describe('The variables of the catalogue (Claude only)'),
30
+ custom: z.array(CustomEnvSchema).describe('Variables of your own (values are never shown)'),
31
+ });
32
+ const CLI_EXEMPT = 'sandbox config set harnesses.<agent>.environment.<NAME> <value> does this on the command line';
33
+ export const agentEnv = defineQuery({
34
+ id: 'agents.env',
35
+ title: 'Agent environment',
36
+ summary: "an agent's environment variables, with the catalogue of Claude's",
37
+ input: z.object({ agent: AgentName.default('claude').describe('The agent') }),
38
+ output: AgentEnvSchema,
39
+ surfaces: { except: { cli: CLI_EXEMPT } },
40
+ });
41
+ export const agentsEnvSet = defineOperation({
42
+ id: 'agents.env.set',
43
+ title: 'Set variable',
44
+ summary: 'set or remove one environment variable of an agent in your settings (empty removes it)',
45
+ input: z.object({
46
+ agent: AgentName.describe('The agent'),
47
+ name: z.string().regex(ENV_NAME).describe('The variable'),
48
+ value: z.string().max(4000).nullable().default(null).describe('Its value; empty removes it'),
49
+ }),
50
+ output: z.object({ message: z.string().describe('What happened') }),
51
+ text: (o) => o.message,
52
+ surfaces: { except: { cli: CLI_EXEMPT } },
53
+ });
54
+ /** The words for a value of a row: what the page shows beside the name. Pure. */
55
+ export function envValueText(r) {
56
+ if (!r.set)
57
+ return r.defaultText ? r.defaultText + " (Claude's default)" : 'not set';
58
+ if (r.secret)
59
+ return 'set';
60
+ if (r.kind === 'flag')
61
+ return 'on';
62
+ return r.value ?? 'set';
63
+ }
64
+ /** The editor of a row's value: a Field every surface can draw (a flag is switched, so it has none). Pure. */
65
+ export function envField(r) {
66
+ if (r.kind === 'flag')
67
+ return undefined;
68
+ const help = [
69
+ r.description,
70
+ r.range,
71
+ r.choices ? 'One of: ' + r.choices.join(', ') + '.' : undefined,
72
+ 'Empty removes it.',
73
+ ]
74
+ .filter(Boolean)
75
+ .join(' ');
76
+ return {
77
+ name: 'value',
78
+ key: ['value'],
79
+ kind: r.secret ? 'secret' : r.kind === 'enum' ? 'enum' : 'text',
80
+ label: r.label,
81
+ help,
82
+ optional: true,
83
+ ...(r.kind === 'enum' && r.choices ? { choices: r.choices.map((c) => ({ value: c, label: c })) } : {}),
84
+ };
85
+ }
86
+ function rowItem(agent, r) {
87
+ const field = envField(r);
88
+ const input = { agent, name: r.name };
89
+ return {
90
+ id: 'env:' + r.name,
91
+ label: r.label,
92
+ hint: envValueText(r),
93
+ ...(r.set ? { tone: 'ok' } : { tone: 'muted' }),
94
+ badges: r.fromSandbox ? [{ text: 'set by the sandbox', tone: 'muted' }] : [],
95
+ description: r.description,
96
+ code: r.name,
97
+ keywords: r.name,
98
+ primary: field
99
+ ? action(agentsEnvSet, input, {
100
+ label: 'Change',
101
+ verb: 'edit',
102
+ inline: true,
103
+ fields: [field],
104
+ initial: { value: r.secret ? '' : (r.value ?? '') },
105
+ })
106
+ : action(agentsEnvSet, { ...input, value: r.set ? null : '1' }, { label: r.set ? 'Turn off' : 'Turn on', verb: r.set ? 'turn off' : 'turn on' }),
107
+ actions: r.set && !r.fromSandbox
108
+ ? [action(agentsEnvSet, { ...input, value: null }, { label: 'Remove', verb: 'remove', key: 'r' })]
109
+ : [],
110
+ };
111
+ }
112
+ const ownField = {
113
+ name: 'value',
114
+ key: ['value'],
115
+ kind: 'secret',
116
+ label: 'Value',
117
+ help: 'The value. It is not shown again. Empty removes the variable.',
118
+ optional: true,
119
+ };
120
+ /** The page of an agent's variables: a section per group, then the ones of your own and "Add variable…". Pure. */
121
+ export function agentEnvPage(o) {
122
+ const sections = ENV_GROUPS.flatMap((group) => {
123
+ const rows = o.rows.filter((r) => r.group === group);
124
+ return rows.length ? [{ id: group.toLowerCase(), title: group, items: rows.map((r) => rowItem(o.agent, r)) }] : [];
125
+ });
126
+ sections.push({
127
+ id: 'own',
128
+ title: 'Your own variables',
129
+ description: 'Any other variable the agent should start with. Values are kept in your settings and not shown again.',
130
+ items: [
131
+ ...o.custom.map((c) => ({
132
+ id: 'env:' + c.name,
133
+ label: c.name,
134
+ hint: 'set',
135
+ tone: 'ok',
136
+ badges: c.fromSandbox ? [{ text: 'set by the sandbox', tone: 'muted' }] : [],
137
+ code: c.name,
138
+ primary: action(agentsEnvSet, { agent: o.agent, name: c.name }, { label: 'Change', verb: 'edit', inline: true, fields: [ownField], initial: { value: '' } }),
139
+ actions: c.fromSandbox
140
+ ? []
141
+ : [
142
+ action(agentsEnvSet, { agent: o.agent, name: c.name, value: null }, { label: 'Remove', verb: 'remove', key: 'r' }),
143
+ ],
144
+ })),
145
+ {
146
+ id: 'add',
147
+ label: 'Add variable…',
148
+ description: 'A variable that is not in the list above.',
149
+ primary: action(agentsEnvSet, { agent: o.agent }, {
150
+ label: 'Add variable…',
151
+ verb: 'add',
152
+ fields: [
153
+ {
154
+ name: 'name',
155
+ key: ['name'],
156
+ kind: 'text',
157
+ label: 'Name',
158
+ help: 'Letters, digits and _, e.g. MY_TOKEN.',
159
+ optional: false,
160
+ },
161
+ ownField,
162
+ ],
163
+ }),
164
+ },
165
+ ],
166
+ });
167
+ return { title: o.agent === 'claude' ? 'Claude environment' : humanize(o.agent) + ' environment', sections };
168
+ }
169
+ export const agentEnvView = defineView({
170
+ id: 'agentEnv',
171
+ title: 'Claude environment',
172
+ summary: "An agent's environment variables: Claude's by group (how many subagents, models, limits), and your own.",
173
+ queries: { env: agentEnv },
174
+ operations: [agentsEnvSet],
175
+ params: ['agent'],
176
+ inputs: (p) => ({ env: p.agent ? { agent: p.agent } : {} }),
177
+ build: ({ env }) => agentEnvPage(env),
178
+ });
179
+ /** The "Subagents at once" row of the Agents page: its value in words. Pure. */
180
+ export function subagentsText(n) {
181
+ return n === null ? MAX_SUBAGENTS_DEFAULT + " (Claude's default)" : String(n);
182
+ }
183
+ /** Which catalogue row says how many subagents run at once. */
184
+ export const SUBAGENTS_VAR = MAX_SUBAGENTS_VAR;