@stateset/sandbox-cli 1.0.6 → 3.4.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 (431) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/LICENSE +22 -0
  3. package/README.md +940 -6
  4. package/dist/client.d.ts +789 -10
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/client.js +694 -12
  7. package/dist/client.js.map +1 -1
  8. package/dist/commands/alias.d.ts +5 -0
  9. package/dist/commands/alias.d.ts.map +1 -0
  10. package/dist/commands/alias.js +131 -0
  11. package/dist/commands/alias.js.map +1 -0
  12. package/dist/commands/api-key.d.ts +3 -0
  13. package/dist/commands/api-key.d.ts.map +1 -0
  14. package/dist/commands/api-key.js +119 -0
  15. package/dist/commands/api-key.js.map +1 -0
  16. package/dist/commands/artifact.d.ts.map +1 -1
  17. package/dist/commands/artifact.js +105 -46
  18. package/dist/commands/artifact.js.map +1 -1
  19. package/dist/commands/audit.d.ts +3 -0
  20. package/dist/commands/audit.d.ts.map +1 -0
  21. package/dist/commands/audit.js +191 -0
  22. package/dist/commands/audit.js.map +1 -0
  23. package/dist/commands/auth.d.ts +3 -0
  24. package/dist/commands/auth.d.ts.map +1 -0
  25. package/dist/commands/auth.js +126 -0
  26. package/dist/commands/auth.js.map +1 -0
  27. package/dist/commands/benchmark.d.ts +3 -0
  28. package/dist/commands/benchmark.d.ts.map +1 -0
  29. package/dist/commands/benchmark.js +166 -0
  30. package/dist/commands/benchmark.js.map +1 -0
  31. package/dist/commands/billing.d.ts +3 -0
  32. package/dist/commands/billing.d.ts.map +1 -0
  33. package/dist/commands/billing.js +139 -0
  34. package/dist/commands/billing.js.map +1 -0
  35. package/dist/commands/checkpoint.d.ts.map +1 -1
  36. package/dist/commands/checkpoint.js +105 -48
  37. package/dist/commands/checkpoint.js.map +1 -1
  38. package/dist/commands/completion.d.ts +3 -0
  39. package/dist/commands/completion.d.ts.map +1 -0
  40. package/dist/commands/completion.js +134 -0
  41. package/dist/commands/completion.js.map +1 -0
  42. package/dist/commands/computer-use.d.ts +3 -0
  43. package/dist/commands/computer-use.d.ts.map +1 -0
  44. package/dist/commands/computer-use.js +124 -0
  45. package/dist/commands/computer-use.js.map +1 -0
  46. package/dist/commands/config.d.ts.map +1 -1
  47. package/dist/commands/config.js +2 -1
  48. package/dist/commands/config.js.map +1 -1
  49. package/dist/commands/context.d.ts +3 -0
  50. package/dist/commands/context.d.ts.map +1 -0
  51. package/dist/commands/context.js +98 -0
  52. package/dist/commands/context.js.map +1 -0
  53. package/dist/commands/cp.d.ts +3 -0
  54. package/dist/commands/cp.d.ts.map +1 -0
  55. package/dist/commands/cp.js +165 -0
  56. package/dist/commands/cp.js.map +1 -0
  57. package/dist/commands/deploy.d.ts +3 -0
  58. package/dist/commands/deploy.d.ts.map +1 -1
  59. package/dist/commands/deploy.js +68 -20
  60. package/dist/commands/deploy.js.map +1 -1
  61. package/dist/commands/diff.d.ts +3 -0
  62. package/dist/commands/diff.d.ts.map +1 -0
  63. package/dist/commands/diff.js +186 -0
  64. package/dist/commands/diff.js.map +1 -0
  65. package/dist/commands/doctor.d.ts +30 -0
  66. package/dist/commands/doctor.d.ts.map +1 -1
  67. package/dist/commands/doctor.js +177 -207
  68. package/dist/commands/doctor.js.map +1 -1
  69. package/dist/commands/egress.d.ts +3 -0
  70. package/dist/commands/egress.d.ts.map +1 -0
  71. package/dist/commands/egress.js +155 -0
  72. package/dist/commands/egress.js.map +1 -0
  73. package/dist/commands/env.d.ts +3 -0
  74. package/dist/commands/env.d.ts.map +1 -0
  75. package/dist/commands/env.js +169 -0
  76. package/dist/commands/env.js.map +1 -0
  77. package/dist/commands/governance.d.ts +47 -0
  78. package/dist/commands/governance.d.ts.map +1 -0
  79. package/dist/commands/governance.js +345 -0
  80. package/dist/commands/governance.js.map +1 -0
  81. package/dist/commands/grade.d.ts +41 -0
  82. package/dist/commands/grade.d.ts.map +1 -1
  83. package/dist/commands/grade.js +255 -160
  84. package/dist/commands/grade.js.map +1 -1
  85. package/dist/commands/history.d.ts +4 -0
  86. package/dist/commands/history.d.ts.map +1 -0
  87. package/dist/commands/history.js +157 -0
  88. package/dist/commands/history.js.map +1 -0
  89. package/dist/commands/images.d.ts +8 -0
  90. package/dist/commands/images.d.ts.map +1 -0
  91. package/dist/commands/images.js +145 -0
  92. package/dist/commands/images.js.map +1 -0
  93. package/dist/commands/info.d.ts +3 -0
  94. package/dist/commands/info.d.ts.map +1 -0
  95. package/dist/commands/info.js +86 -0
  96. package/dist/commands/info.js.map +1 -0
  97. package/dist/commands/init.d.ts +3 -0
  98. package/dist/commands/init.d.ts.map +1 -0
  99. package/dist/commands/init.js +185 -0
  100. package/dist/commands/init.js.map +1 -0
  101. package/dist/commands/logs.d.ts +3 -0
  102. package/dist/commands/logs.d.ts.map +1 -0
  103. package/dist/commands/logs.js +129 -0
  104. package/dist/commands/logs.js.map +1 -0
  105. package/dist/commands/mcp.d.ts +3 -0
  106. package/dist/commands/mcp.d.ts.map +1 -0
  107. package/dist/commands/mcp.js +141 -0
  108. package/dist/commands/mcp.js.map +1 -0
  109. package/dist/commands/open.d.ts +3 -0
  110. package/dist/commands/open.d.ts.map +1 -0
  111. package/dist/commands/open.js +96 -0
  112. package/dist/commands/open.js.map +1 -0
  113. package/dist/commands/platform-status.d.ts +25 -5
  114. package/dist/commands/platform-status.d.ts.map +1 -1
  115. package/dist/commands/platform-status.js +199 -149
  116. package/dist/commands/platform-status.js.map +1 -1
  117. package/dist/commands/plugin.d.ts +5 -0
  118. package/dist/commands/plugin.d.ts.map +1 -0
  119. package/dist/commands/plugin.js +126 -0
  120. package/dist/commands/plugin.js.map +1 -0
  121. package/dist/commands/pool.d.ts.map +1 -1
  122. package/dist/commands/pool.js +52 -66
  123. package/dist/commands/pool.js.map +1 -1
  124. package/dist/commands/profile.d.ts +3 -0
  125. package/dist/commands/profile.d.ts.map +1 -0
  126. package/dist/commands/profile.js +107 -0
  127. package/dist/commands/profile.js.map +1 -0
  128. package/dist/commands/repl.d.ts +3 -0
  129. package/dist/commands/repl.d.ts.map +1 -0
  130. package/dist/commands/repl.js +390 -0
  131. package/dist/commands/repl.js.map +1 -0
  132. package/dist/commands/run.d.ts +3 -0
  133. package/dist/commands/run.d.ts.map +1 -0
  134. package/dist/commands/run.js +154 -0
  135. package/dist/commands/run.js.map +1 -0
  136. package/dist/commands/sandbox-processes.d.ts +27 -0
  137. package/dist/commands/sandbox-processes.d.ts.map +1 -0
  138. package/dist/commands/sandbox-processes.js +195 -0
  139. package/dist/commands/sandbox-processes.js.map +1 -0
  140. package/dist/commands/sandbox.d.ts.map +1 -1
  141. package/dist/commands/sandbox.js +562 -108
  142. package/dist/commands/sandbox.js.map +1 -1
  143. package/dist/commands/secret.d.ts +3 -0
  144. package/dist/commands/secret.d.ts.map +1 -0
  145. package/dist/commands/secret.js +128 -0
  146. package/dist/commands/secret.js.map +1 -0
  147. package/dist/commands/session.d.ts.map +1 -1
  148. package/dist/commands/session.js +285 -52
  149. package/dist/commands/session.js.map +1 -1
  150. package/dist/commands/snapshot.d.ts +3 -0
  151. package/dist/commands/snapshot.d.ts.map +1 -0
  152. package/dist/commands/snapshot.js +253 -0
  153. package/dist/commands/snapshot.js.map +1 -0
  154. package/dist/commands/ssh.d.ts +5 -0
  155. package/dist/commands/ssh.d.ts.map +1 -0
  156. package/dist/commands/ssh.js +154 -0
  157. package/dist/commands/ssh.js.map +1 -0
  158. package/dist/commands/swarm.d.ts +12 -0
  159. package/dist/commands/swarm.d.ts.map +1 -0
  160. package/dist/commands/swarm.js +288 -0
  161. package/dist/commands/swarm.js.map +1 -0
  162. package/dist/commands/template.d.ts +3 -0
  163. package/dist/commands/template.d.ts.map +1 -0
  164. package/dist/commands/template.js +102 -0
  165. package/dist/commands/template.js.map +1 -0
  166. package/dist/commands/terminal.d.ts +55 -0
  167. package/dist/commands/terminal.d.ts.map +1 -0
  168. package/dist/commands/terminal.js +438 -0
  169. package/dist/commands/terminal.js.map +1 -0
  170. package/dist/commands/top.d.ts +3 -0
  171. package/dist/commands/top.d.ts.map +1 -0
  172. package/dist/commands/top.js +116 -0
  173. package/dist/commands/top.js.map +1 -0
  174. package/dist/commands/tunnel.d.ts.map +1 -1
  175. package/dist/commands/tunnel.js +73 -26
  176. package/dist/commands/tunnel.js.map +1 -1
  177. package/dist/commands/update.d.ts +3 -0
  178. package/dist/commands/update.d.ts.map +1 -0
  179. package/dist/commands/update.js +51 -0
  180. package/dist/commands/update.js.map +1 -0
  181. package/dist/commands/wait.d.ts +3 -0
  182. package/dist/commands/wait.d.ts.map +1 -0
  183. package/dist/commands/wait.js +64 -0
  184. package/dist/commands/wait.js.map +1 -0
  185. package/dist/commands/webhook.d.ts +3 -0
  186. package/dist/commands/webhook.d.ts.map +1 -0
  187. package/dist/commands/webhook.js +169 -0
  188. package/dist/commands/webhook.js.map +1 -0
  189. package/dist/commands/workbench.d.ts +138 -0
  190. package/dist/commands/workbench.d.ts.map +1 -0
  191. package/dist/commands/workbench.js +531 -0
  192. package/dist/commands/workbench.js.map +1 -0
  193. package/dist/config.d.ts +14 -6
  194. package/dist/config.d.ts.map +1 -1
  195. package/dist/config.js +109 -16
  196. package/dist/config.js.map +1 -1
  197. package/dist/index.js +169 -11
  198. package/dist/index.js.map +1 -1
  199. package/dist/sandboxctl.d.ts +3 -0
  200. package/dist/sandboxctl.d.ts.map +1 -0
  201. package/dist/sandboxctl.js +37 -0
  202. package/dist/sandboxctl.js.map +1 -0
  203. package/dist/utils/context.d.ts +23 -0
  204. package/dist/utils/context.d.ts.map +1 -0
  205. package/dist/utils/context.js +48 -0
  206. package/dist/utils/context.js.map +1 -0
  207. package/dist/utils/credentials.d.ts +8 -0
  208. package/dist/utils/credentials.d.ts.map +1 -0
  209. package/dist/utils/credentials.js +120 -0
  210. package/dist/utils/credentials.js.map +1 -0
  211. package/dist/utils/dry-run.d.ts +4 -0
  212. package/dist/utils/dry-run.d.ts.map +1 -0
  213. package/dist/utils/dry-run.js +24 -0
  214. package/dist/utils/dry-run.js.map +1 -0
  215. package/dist/utils/egress-policy.d.ts +31 -0
  216. package/dist/utils/egress-policy.d.ts.map +1 -0
  217. package/dist/utils/egress-policy.js +83 -0
  218. package/dist/utils/egress-policy.js.map +1 -0
  219. package/dist/utils/errors.d.ts +53 -0
  220. package/dist/utils/errors.d.ts.map +1 -0
  221. package/dist/utils/errors.js +278 -0
  222. package/dist/utils/errors.js.map +1 -0
  223. package/dist/utils/file-content.d.ts +10 -0
  224. package/dist/utils/file-content.d.ts.map +1 -0
  225. package/dist/utils/file-content.js +14 -0
  226. package/dist/utils/file-content.js.map +1 -0
  227. package/dist/utils/grade-target.d.ts +12 -0
  228. package/dist/utils/grade-target.d.ts.map +1 -0
  229. package/dist/utils/grade-target.js +106 -0
  230. package/dist/utils/grade-target.js.map +1 -0
  231. package/dist/utils/health-report.d.ts +18 -0
  232. package/dist/utils/health-report.d.ts.map +1 -0
  233. package/dist/utils/health-report.js +43 -0
  234. package/dist/utils/health-report.js.map +1 -0
  235. package/dist/utils/output.d.ts +20 -0
  236. package/dist/utils/output.d.ts.map +1 -0
  237. package/dist/utils/output.js +123 -0
  238. package/dist/utils/output.js.map +1 -0
  239. package/dist/utils/plugins.d.ts +17 -0
  240. package/dist/utils/plugins.d.ts.map +1 -0
  241. package/dist/utils/plugins.js +57 -0
  242. package/dist/utils/plugins.js.map +1 -0
  243. package/dist/utils/resource-class.d.ts +12 -0
  244. package/dist/utils/resource-class.d.ts.map +1 -0
  245. package/dist/utils/resource-class.js +17 -0
  246. package/dist/utils/resource-class.js.map +1 -0
  247. package/dist/utils/shutdown.d.ts +14 -0
  248. package/dist/utils/shutdown.d.ts.map +1 -0
  249. package/dist/utils/shutdown.js +54 -0
  250. package/dist/utils/shutdown.js.map +1 -0
  251. package/dist/utils/swarm-plan.d.ts +69 -0
  252. package/dist/utils/swarm-plan.d.ts.map +1 -0
  253. package/dist/utils/swarm-plan.js +321 -0
  254. package/dist/utils/swarm-plan.js.map +1 -0
  255. package/dist/utils/template-create.d.ts +36 -0
  256. package/dist/utils/template-create.d.ts.map +1 -0
  257. package/dist/utils/template-create.js +116 -0
  258. package/dist/utils/template-create.js.map +1 -0
  259. package/dist/utils/tty.d.ts +44 -0
  260. package/dist/utils/tty.d.ts.map +1 -0
  261. package/dist/utils/tty.js +93 -0
  262. package/dist/utils/tty.js.map +1 -0
  263. package/dist/utils/warnings.d.ts +4 -0
  264. package/dist/utils/warnings.d.ts.map +1 -0
  265. package/dist/utils/warnings.js +22 -0
  266. package/dist/utils/warnings.js.map +1 -0
  267. package/dist/utils/watch.d.ts +7 -0
  268. package/dist/utils/watch.d.ts.map +1 -0
  269. package/dist/utils/watch.js +55 -0
  270. package/dist/utils/watch.js.map +1 -0
  271. package/dist/workbench/actions.d.ts +26 -0
  272. package/dist/workbench/actions.d.ts.map +1 -0
  273. package/dist/workbench/actions.js +39 -0
  274. package/dist/workbench/actions.js.map +1 -0
  275. package/dist/workbench/agent-chat.d.ts +71 -0
  276. package/dist/workbench/agent-chat.d.ts.map +1 -0
  277. package/dist/workbench/agent-chat.js +223 -0
  278. package/dist/workbench/agent-chat.js.map +1 -0
  279. package/dist/workbench/agents.d.ts +96 -0
  280. package/dist/workbench/agents.d.ts.map +1 -0
  281. package/dist/workbench/agents.js +370 -0
  282. package/dist/workbench/agents.js.map +1 -0
  283. package/dist/workbench/batch-uploads.d.ts +36 -0
  284. package/dist/workbench/batch-uploads.d.ts.map +1 -0
  285. package/dist/workbench/batch-uploads.js +154 -0
  286. package/dist/workbench/batch-uploads.js.map +1 -0
  287. package/dist/workbench/commands.d.ts +6 -0
  288. package/dist/workbench/commands.d.ts.map +1 -0
  289. package/dist/workbench/commands.js +517 -0
  290. package/dist/workbench/commands.js.map +1 -0
  291. package/dist/workbench/connection-failure.d.ts +9 -0
  292. package/dist/workbench/connection-failure.d.ts.map +1 -0
  293. package/dist/workbench/connection-failure.js +27 -0
  294. package/dist/workbench/connection-failure.js.map +1 -0
  295. package/dist/workbench/connection.d.ts +4 -0
  296. package/dist/workbench/connection.d.ts.map +1 -0
  297. package/dist/workbench/connection.js +28 -0
  298. package/dist/workbench/connection.js.map +1 -0
  299. package/dist/workbench/creation.d.ts +22 -0
  300. package/dist/workbench/creation.d.ts.map +1 -0
  301. package/dist/workbench/creation.js +102 -0
  302. package/dist/workbench/creation.js.map +1 -0
  303. package/dist/workbench/credits.d.ts +11 -0
  304. package/dist/workbench/credits.d.ts.map +1 -0
  305. package/dist/workbench/credits.js +132 -0
  306. package/dist/workbench/credits.js.map +1 -0
  307. package/dist/workbench/docker.d.ts +18 -0
  308. package/dist/workbench/docker.d.ts.map +1 -0
  309. package/dist/workbench/docker.js +207 -0
  310. package/dist/workbench/docker.js.map +1 -0
  311. package/dist/workbench/execution.d.ts +14 -0
  312. package/dist/workbench/execution.d.ts.map +1 -0
  313. package/dist/workbench/execution.js +24 -0
  314. package/dist/workbench/execution.js.map +1 -0
  315. package/dist/workbench/files.d.ts +51 -0
  316. package/dist/workbench/files.d.ts.map +1 -0
  317. package/dist/workbench/files.js +80 -0
  318. package/dist/workbench/files.js.map +1 -0
  319. package/dist/workbench/history.d.ts +34 -0
  320. package/dist/workbench/history.d.ts.map +1 -0
  321. package/dist/workbench/history.js +50 -0
  322. package/dist/workbench/history.js.map +1 -0
  323. package/dist/workbench/input-batch-commands.d.ts +6 -0
  324. package/dist/workbench/input-batch-commands.d.ts.map +1 -0
  325. package/dist/workbench/input-batch-commands.js +41 -0
  326. package/dist/workbench/input-batch-commands.js.map +1 -0
  327. package/dist/workbench/kitty-diacritics.d.ts +2 -0
  328. package/dist/workbench/kitty-diacritics.d.ts.map +1 -0
  329. package/dist/workbench/kitty-diacritics.js +22 -0
  330. package/dist/workbench/kitty-diacritics.js.map +1 -0
  331. package/dist/workbench/kitty-graphics.d.ts +59 -0
  332. package/dist/workbench/kitty-graphics.d.ts.map +1 -0
  333. package/dist/workbench/kitty-graphics.js +263 -0
  334. package/dist/workbench/kitty-graphics.js.map +1 -0
  335. package/dist/workbench/live-execution.d.ts +51 -0
  336. package/dist/workbench/live-execution.d.ts.map +1 -0
  337. package/dist/workbench/live-execution.js +222 -0
  338. package/dist/workbench/live-execution.js.map +1 -0
  339. package/dist/workbench/model.d.ts +110 -0
  340. package/dist/workbench/model.d.ts.map +1 -0
  341. package/dist/workbench/model.js +249 -0
  342. package/dist/workbench/model.js.map +1 -0
  343. package/dist/workbench/overview.d.ts +11 -0
  344. package/dist/workbench/overview.d.ts.map +1 -0
  345. package/dist/workbench/overview.js +92 -0
  346. package/dist/workbench/overview.js.map +1 -0
  347. package/dist/workbench/png.d.ts +10 -0
  348. package/dist/workbench/png.d.ts.map +1 -0
  349. package/dist/workbench/png.js +51 -0
  350. package/dist/workbench/png.js.map +1 -0
  351. package/dist/workbench/python-task.d.ts +21 -0
  352. package/dist/workbench/python-task.d.ts.map +1 -0
  353. package/dist/workbench/python-task.js +52 -0
  354. package/dist/workbench/python-task.js.map +1 -0
  355. package/dist/workbench/registry-commands.d.ts +8 -0
  356. package/dist/workbench/registry-commands.d.ts.map +1 -0
  357. package/dist/workbench/registry-commands.js +93 -0
  358. package/dist/workbench/registry-commands.js.map +1 -0
  359. package/dist/workbench/registry.d.ts +76 -0
  360. package/dist/workbench/registry.d.ts.map +1 -0
  361. package/dist/workbench/registry.js +353 -0
  362. package/dist/workbench/registry.js.map +1 -0
  363. package/dist/workbench/renderer.d.ts +6 -0
  364. package/dist/workbench/renderer.d.ts.map +1 -0
  365. package/dist/workbench/renderer.js +18 -0
  366. package/dist/workbench/renderer.js.map +1 -0
  367. package/dist/workbench/results.d.ts +15 -0
  368. package/dist/workbench/results.d.ts.map +1 -0
  369. package/dist/workbench/results.js +29 -0
  370. package/dist/workbench/results.js.map +1 -0
  371. package/dist/workbench/task-archive.d.ts +23 -0
  372. package/dist/workbench/task-archive.d.ts.map +1 -0
  373. package/dist/workbench/task-archive.js +56 -0
  374. package/dist/workbench/task-archive.js.map +1 -0
  375. package/dist/workbench/task-board.d.ts +26 -0
  376. package/dist/workbench/task-board.d.ts.map +1 -0
  377. package/dist/workbench/task-board.js +43 -0
  378. package/dist/workbench/task-board.js.map +1 -0
  379. package/dist/workbench/task-monitor.d.ts +35 -0
  380. package/dist/workbench/task-monitor.d.ts.map +1 -0
  381. package/dist/workbench/task-monitor.js +176 -0
  382. package/dist/workbench/task-monitor.js.map +1 -0
  383. package/dist/workbench/tasks.d.ts +93 -0
  384. package/dist/workbench/tasks.d.ts.map +1 -0
  385. package/dist/workbench/tasks.js +195 -0
  386. package/dist/workbench/tasks.js.map +1 -0
  387. package/dist/workbench/terminal.d.ts +82 -0
  388. package/dist/workbench/terminal.d.ts.map +1 -0
  389. package/dist/workbench/terminal.js +2607 -0
  390. package/dist/workbench/terminal.js.map +1 -0
  391. package/dist/workbench/text.d.ts +10 -0
  392. package/dist/workbench/text.d.ts.map +1 -0
  393. package/dist/workbench/text.js +72 -0
  394. package/dist/workbench/text.js.map +1 -0
  395. package/dist/workbench/uploads.d.ts +12 -0
  396. package/dist/workbench/uploads.d.ts.map +1 -0
  397. package/dist/workbench/uploads.js +16 -0
  398. package/dist/workbench/uploads.js.map +1 -0
  399. package/dist/workbench/worker-launch.d.ts +10 -0
  400. package/dist/workbench/worker-launch.d.ts.map +1 -0
  401. package/dist/workbench/worker-launch.js +30 -0
  402. package/dist/workbench/worker-launch.js.map +1 -0
  403. package/dist/workbench/worker-monitor.d.ts +33 -0
  404. package/dist/workbench/worker-monitor.d.ts.map +1 -0
  405. package/dist/workbench/worker-monitor.js +142 -0
  406. package/dist/workbench/worker-monitor.js.map +1 -0
  407. package/dist/workbench/worker-output.d.ts +8 -0
  408. package/dist/workbench/worker-output.d.ts.map +1 -0
  409. package/dist/workbench/worker-output.js +32 -0
  410. package/dist/workbench/worker-output.js.map +1 -0
  411. package/dist/workbench/worker-result.d.ts +29 -0
  412. package/dist/workbench/worker-result.d.ts.map +1 -0
  413. package/dist/workbench/worker-result.js +85 -0
  414. package/dist/workbench/worker-result.js.map +1 -0
  415. package/dist/workbench/workers.d.ts +49 -0
  416. package/dist/workbench/workers.d.ts.map +1 -0
  417. package/dist/workbench/workers.js +53 -0
  418. package/dist/workbench/workers.js.map +1 -0
  419. package/package.json +38 -17
  420. package/dist/__tests__/client.test.d.ts +0 -2
  421. package/dist/__tests__/client.test.d.ts.map +0 -1
  422. package/dist/__tests__/client.test.js +0 -198
  423. package/dist/__tests__/client.test.js.map +0 -1
  424. package/dist/__tests__/config.test.d.ts +0 -2
  425. package/dist/__tests__/config.test.d.ts.map +0 -1
  426. package/dist/__tests__/config.test.js +0 -74
  427. package/dist/__tests__/config.test.js.map +0 -1
  428. package/dist/__tests__/utils-cli.test.d.ts +0 -2
  429. package/dist/__tests__/utils-cli.test.d.ts.map +0 -1
  430. package/dist/__tests__/utils-cli.test.js +0 -35
  431. package/dist/__tests__/utils-cli.test.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Sandbox, ExecuteResult, AgentSession, AgentEvent } from '@stateset/sandbox-sdk';
1
+ import type { SandboxInfo, ExecuteResult, AgentSession, AgentEvent, StreamCallbacks, TaskRegistryApi, AuditReadMetadata, CreateTunnelOptions, CreateSwarmOptions, ListSwarmsOptions, Swarm, SwarmPage } from '@stateset/sandbox-sdk';
2
2
  export interface CheckpointInfo {
3
3
  id: string;
4
4
  sandbox_id: string;
@@ -8,6 +8,17 @@ export interface CheckpointInfo {
8
8
  file_count: number;
9
9
  created_at: string;
10
10
  checksum: string;
11
+ /** Non-fatal notices, e.g. `env_not_captured`. Present only when non-empty. */
12
+ warnings?: string[];
13
+ }
14
+ export interface BranchResult {
15
+ forked_id?: string;
16
+ promoted_id?: string;
17
+ checkpoint_id: string;
18
+ status?: string;
19
+ promoted_status?: string;
20
+ warnings?: string[];
21
+ [key: string]: unknown;
11
22
  }
12
23
  export interface CheckpointDiff {
13
24
  checkpoint_1: {
@@ -66,20 +77,188 @@ export interface TunnelInfo {
66
77
  expires_at: string;
67
78
  token?: string;
68
79
  }
80
+ /** A supervised background process (GET /sandbox/:id/processes/:processId). */
81
+ export interface ProcessInfo {
82
+ process_id: string;
83
+ name?: string;
84
+ command: string[];
85
+ pid: number;
86
+ status: string;
87
+ exit_code: number | null;
88
+ signal: string | null;
89
+ restarts: number;
90
+ restart: string;
91
+ created_at: string;
92
+ started_at: string | null;
93
+ exited_at: string | null;
94
+ last_error?: string;
95
+ log?: {
96
+ stdout_bytes: number;
97
+ stderr_bytes: number;
98
+ };
99
+ [key: string]: unknown;
100
+ }
101
+ /** A terminal session (GET /sandbox/:id/terminals/:terminalId). */
102
+ export interface TerminalInfo {
103
+ terminal_id: string;
104
+ name?: string;
105
+ command: string[];
106
+ cols: number;
107
+ rows: number;
108
+ status: string;
109
+ exit_code: number | null;
110
+ signal: string | null;
111
+ created_at: string;
112
+ started_at: string | null;
113
+ exited_at: string | null;
114
+ output_bytes: number;
115
+ [key: string]: unknown;
116
+ }
117
+ export interface CreateTerminalRequest {
118
+ command?: string | string[];
119
+ workingDir?: string;
120
+ name?: string;
121
+ cols?: number;
122
+ rows?: number;
123
+ }
124
+ /** Terminal sessions, as the SDK exposes them (`sdk.terminals`). */
125
+ export interface CliTerminals {
126
+ create: (sandboxId: string, options?: CreateTerminalRequest) => Promise<TerminalInfo>;
127
+ list: (sandboxId: string) => Promise<TerminalInfo[]>;
128
+ get: (sandboxId: string, terminalId: string) => Promise<TerminalInfo>;
129
+ write: (sandboxId: string, terminalId: string, data: string | Uint8Array) => Promise<unknown>;
130
+ resize: (sandboxId: string, terminalId: string, cols: number, rows: number) => Promise<TerminalInfo>;
131
+ stream: (sandboxId: string, terminalId: string, options?: {
132
+ offset?: number;
133
+ signal?: AbortSignal;
134
+ }) => AsyncGenerator<{
135
+ offset: number;
136
+ next_offset: number;
137
+ bytes: Uint8Array;
138
+ truncated?: boolean;
139
+ }, TerminalInfo | undefined>;
140
+ close: (sandboxId: string, terminalId: string, options?: {
141
+ graceSeconds?: number;
142
+ }) => Promise<TerminalInfo>;
143
+ /** What the terminal is displaying; absent on an SDK that predates screens. */
144
+ screen?: (sandboxId: string, terminalId: string, options?: {
145
+ scrollback?: number;
146
+ ansi?: boolean;
147
+ }) => Promise<TerminalScreenInfo>;
148
+ /** The session as asciicast text; absent on an SDK that predates recordings. */
149
+ recording?: (sandboxId: string, terminalId: string, options?: {
150
+ idleTimeLimit?: number;
151
+ }) => Promise<string>;
152
+ /** Find text in the screen and its history; absent on an SDK that predates search. */
153
+ search?: (sandboxId: string, terminalId: string, text: string, options?: {
154
+ caseSensitive?: boolean;
155
+ limit?: number;
156
+ }) => Promise<TerminalSearchInfo>;
157
+ /** A Claude Code session's state, then each change, until the terminal ends; absent on an SDK that predates it. */
158
+ watchClaudeCode?: (sandboxId: string, terminalId: string, options?: {
159
+ intervalMs?: number;
160
+ settleMs?: number;
161
+ signal?: AbortSignal;
162
+ }) => AsyncGenerator<ClaudeCodeStatusInfo, TerminalScreenInfo | undefined>;
163
+ }
164
+ /** What a Claude Code session in a terminal is doing, read off its screen. */
165
+ export interface ClaudeCodeStatusInfo {
166
+ state: 'working' | 'waiting' | 'permission' | 'unknown';
167
+ /** The permission dialog's title, or the spinner's line while working. */
168
+ detail?: string;
169
+ screen: TerminalScreenInfo;
170
+ }
171
+ export interface TerminalSearchInfo {
172
+ matches: Array<{
173
+ line: number;
174
+ column: number;
175
+ text: string;
176
+ }>;
177
+ count: number;
178
+ truncated: boolean;
179
+ searched_lines: number;
180
+ complete: boolean;
181
+ [key: string]: unknown;
182
+ }
183
+ export interface TerminalScreenInfo {
184
+ cols: number;
185
+ rows: number;
186
+ cursor: {
187
+ row: number;
188
+ col: number;
189
+ };
190
+ alternate_screen: boolean;
191
+ lines: string[];
192
+ text: string;
193
+ scrollback: string[];
194
+ offset: number;
195
+ complete: boolean;
196
+ ansi?: string;
197
+ [key: string]: unknown;
198
+ }
199
+ /** One log read: `data` is base64; offsets are absolute byte positions. */
200
+ export interface ProcessLogChunk {
201
+ stream: 'stdout' | 'stderr';
202
+ offset: number;
203
+ next_offset: number;
204
+ eof: boolean;
205
+ truncated?: boolean;
206
+ data: string;
207
+ status: string;
208
+ }
209
+ export interface StartProcessRequest {
210
+ command: string | string[];
211
+ working_dir?: string;
212
+ env?: Record<string, string>;
213
+ name?: string;
214
+ restart?: 'never' | 'on-failure' | 'always';
215
+ max_restarts?: number;
216
+ stdin?: boolean;
217
+ timeout_seconds?: number | null;
218
+ }
69
219
  export interface CliClient {
220
+ auth: {
221
+ introspect: () => Promise<AuthContextInfo>;
222
+ exchangeBootstrapToken: () => Promise<BootstrapExchangeResult>;
223
+ };
70
224
  sandbox: {
71
- create: (options: Record<string, unknown>) => Promise<Sandbox>;
225
+ taskRegistry?: TaskRegistryApi;
226
+ readFileStream?: (sandboxId: string, path: string, options?: {
227
+ signal?: AbortSignal;
228
+ maxBytes?: number;
229
+ }) => AsyncIterable<Uint8Array>;
230
+ create: (options: Record<string, unknown>) => Promise<SandboxInfo>;
231
+ /** POST /sandbox/create-from-template: writes the template's files and runs its setup commands. */
232
+ createFromTemplate: (templateId: string, options?: Record<string, unknown>) => Promise<SandboxInfo>;
72
233
  list: () => Promise<{
73
- sandboxes: Sandbox[];
234
+ sandboxes: SandboxInfo[];
74
235
  }>;
75
- get: (sandboxId: string) => Promise<Sandbox>;
76
- execute: (sandboxId: string, command: string[]) => Promise<ExecuteResult>;
236
+ get: (sandboxId: string) => Promise<SandboxInfo>;
237
+ execute: (sandboxId: string, command: string[], timeoutMs?: number) => Promise<ExecuteResult>;
238
+ executeStream?: (sandboxId: string, command: string[], callbacks: StreamCallbacks, options?: {
239
+ timeout?: number;
240
+ workingDir?: string;
241
+ signal?: AbortSignal;
242
+ }) => Promise<void>;
77
243
  stop: (sandboxId: string) => Promise<{
78
244
  success: boolean;
79
245
  }>;
80
- extend: (sandboxId: string, additionalSeconds: number) => Promise<Sandbox>;
246
+ fork: (sandboxId: string, options?: Record<string, unknown>) => Promise<BranchResult>;
247
+ promote: (sandboxId: string, options: Record<string, unknown>) => Promise<BranchResult>;
248
+ extend: (sandboxId: string, additionalSeconds: number) => Promise<SandboxInfo>;
249
+ /** Snapshot pause (durable sandboxes): 200 'paused', or 202 'pausing' with wait false. */
250
+ pause: (sandboxId: string, options?: PauseResumeRequest) => Promise<SandboxPauseResponse>;
251
+ /** Resume a paused sandbox: 200 'running', or 202 'resuming' with wait false. */
252
+ resume: (sandboxId: string, options?: PauseResumeRequest) => Promise<SandboxResumeResponse>;
81
253
  writeFile: (sandboxId: string, path: string, content: string) => Promise<void>;
82
- readFile: (sandboxId: string, path: string) => Promise<{
254
+ writeFiles: (sandboxId: string, files: Array<{
255
+ path: string;
256
+ content: string;
257
+ }>) => Promise<{
258
+ success: boolean;
259
+ files_written: number;
260
+ }>;
261
+ readFile: (sandboxId: string, path: string, signal?: AbortSignal) => Promise<{
83
262
  path: string;
84
263
  content: string;
85
264
  size: number;
@@ -87,6 +266,36 @@ export interface CliClient {
87
266
  listFiles: (sandboxId: string, path?: string, options?: {
88
267
  recursive?: boolean;
89
268
  }) => Promise<ListFilesResult>;
269
+ glob: (sandboxId: string, pattern: string) => Promise<string[]>;
270
+ mkdir: (sandboxId: string, path: string, recursive?: boolean) => Promise<void>;
271
+ deleteFile: (sandboxId: string, path: string, recursive?: boolean) => Promise<void>;
272
+ moveFile: (sandboxId: string, source: string, destination: string) => Promise<void>;
273
+ copyFile: (sandboxId: string, source: string, destination: string) => Promise<void>;
274
+ /** Terminal sessions (a shell on a real pseudo-terminal). Throws when the installed SDK predates them. */
275
+ terminals?: () => CliTerminals;
276
+ /** Supervised background processes. */
277
+ processes: {
278
+ result?: (sandboxId: string, processId: string, tailBytes?: number, signal?: AbortSignal) => Promise<unknown>;
279
+ start: (sandboxId: string, body: StartProcessRequest) => Promise<ProcessInfo>;
280
+ list: (sandboxId: string, signal?: AbortSignal) => Promise<ProcessInfo[]>;
281
+ get: (sandboxId: string, processId: string, signal?: AbortSignal) => Promise<ProcessInfo>;
282
+ logs: (sandboxId: string, processId: string, options?: {
283
+ stream?: 'stdout' | 'stderr';
284
+ offset?: number;
285
+ limit?: number;
286
+ signal?: AbortSignal;
287
+ }) => Promise<ProcessLogChunk>;
288
+ kill: (sandboxId: string, processId: string, graceSeconds?: number) => Promise<ProcessInfo>;
289
+ stdin?: (sandboxId: string, processId: string, data: string) => Promise<unknown>;
290
+ };
291
+ executions?: {
292
+ list: (sandboxId: string) => Promise<unknown[]>;
293
+ get: (sandboxId: string, executionId: string, signal?: AbortSignal) => Promise<unknown>;
294
+ cancel?: (sandboxId: string, executionId: string) => Promise<{
295
+ execution_id: string;
296
+ cancellation_requested: boolean;
297
+ }>;
298
+ };
90
299
  };
91
300
  checkpoints: {
92
301
  create: (sandboxId: string, name: string, options?: Record<string, unknown>) => Promise<CheckpointInfo>;
@@ -96,6 +305,7 @@ export interface CliClient {
96
305
  get: (checkpointId: string) => Promise<CheckpointInfo>;
97
306
  restore: (sandboxId: string, checkpointId: string, options?: Record<string, unknown>) => Promise<{
98
307
  success: boolean;
308
+ warnings?: string[];
99
309
  }>;
100
310
  clone: (checkpointId: string, name: string) => Promise<CheckpointInfo>;
101
311
  compare: (checkpointId1: string, checkpointId2: string) => Promise<CheckpointDiff>;
@@ -121,7 +331,7 @@ export interface CliClient {
121
331
  getStats: () => Promise<PoolStats>;
122
332
  };
123
333
  tunnels: {
124
- open: (sandboxId: string, options: Record<string, unknown>) => Promise<TunnelInfo>;
334
+ open: (sandboxId: string, options: CreateTunnelOptions) => Promise<TunnelInfo>;
125
335
  list: (sandboxId: string) => Promise<{
126
336
  tunnels: TunnelInfo[];
127
337
  }>;
@@ -146,10 +356,10 @@ export interface CliClient {
146
356
  session: AgentSession;
147
357
  }>;
148
358
  pause: (sessionId: string) => Promise<{
149
- success: boolean;
359
+ session: AgentSession;
150
360
  }>;
151
361
  resume: (sessionId: string) => Promise<{
152
- success: boolean;
362
+ session: AgentSession;
153
363
  }>;
154
364
  stop: (sessionId: string, reason?: string) => Promise<{
155
365
  success: boolean;
@@ -163,9 +373,578 @@ export interface CliClient {
163
373
  after_sequence?: number;
164
374
  }) => Promise<{
165
375
  events: AgentEvent[];
376
+ latestSequence?: number;
377
+ latest_sequence?: number;
378
+ }>;
379
+ heartbeat: (sessionId: string) => Promise<{
380
+ success: boolean;
381
+ }>;
382
+ run: (options: Record<string, unknown>) => Promise<{
383
+ session: AgentSession;
384
+ execution?: ExecuteResult;
385
+ stopped: boolean;
386
+ }>;
387
+ connect: (options: Record<string, unknown>) => Promise<{
388
+ session: AgentSession;
389
+ reattached: boolean;
390
+ created: boolean;
391
+ source: 'reattached' | 'created';
392
+ stopped: boolean;
393
+ }>;
394
+ };
395
+ webhooks: {
396
+ list: () => Promise<{
397
+ webhooks: WebhookInfo[];
398
+ }>;
399
+ create: (url: string, events: string[], secret?: string) => Promise<WebhookInfo>;
400
+ delete: (webhookId: string) => Promise<{
401
+ success: boolean;
402
+ }>;
403
+ test: (webhookId: string) => Promise<{
404
+ success: boolean;
405
+ status_code?: number;
406
+ error?: string;
407
+ }>;
408
+ deliveries: (webhookId: string, limit?: number) => Promise<{
409
+ deliveries: WebhookDeliveryInfo[];
410
+ }>;
411
+ };
412
+ audit: {
413
+ list: (options?: {
414
+ sandbox_id?: string;
415
+ action?: string;
416
+ outcome?: string;
417
+ limit?: number;
418
+ offset?: number;
419
+ end_time?: string;
420
+ }) => Promise<{
421
+ events: AuditEventInfo[];
422
+ total: number;
423
+ } & AuditReadMetadata>;
424
+ summary: (sandboxId: string) => Promise<AuditSummaryInfo>;
425
+ };
426
+ governance: {
427
+ timeline: (sandboxId: string, query?: {
428
+ cursor?: string;
429
+ since?: string;
430
+ types?: string;
431
+ limit?: number;
432
+ }) => Promise<TimelinePageInfo>;
433
+ sandboxCost: (sandboxId: string) => Promise<RunCostInfo>;
434
+ orgCosts: (query?: {
435
+ group_by?: string;
436
+ from?: string;
437
+ to?: string;
438
+ limit?: number;
439
+ }) => Promise<OrgCostsInfo>;
440
+ getPolicy: () => Promise<{
441
+ policy: OrgPolicyInfo;
442
+ }>;
443
+ updatePolicy: (update: Record<string, unknown>) => Promise<{
444
+ policy: OrgPolicyInfo;
445
+ }>;
446
+ sandboxEgress: (sandboxId: string) => Promise<SandboxEgressInfo>;
447
+ updateSandboxEgress: (sandboxId: string, update: Record<string, unknown>) => Promise<SandboxEgressInfo>;
448
+ };
449
+ images: {
450
+ register: (options: {
451
+ name: string;
452
+ image: string;
453
+ pull_secret?: string;
454
+ run_image_command?: boolean;
455
+ }) => Promise<CustomImageInfo>;
456
+ list: () => Promise<{
457
+ images: CustomImageInfo[];
458
+ }>;
459
+ get: (name: string) => Promise<CustomImageInfo>;
460
+ delete: (name: string) => Promise<{
461
+ success: boolean;
462
+ name: string;
463
+ }>;
464
+ };
465
+ swarms: {
466
+ /**
467
+ * Store a plan. The SDK sends a random `Idempotency-Key` of its own with each call, which the caller cannot
468
+ * set, so a second call stores a second swarm; the service gives the first answer only to the same key,
469
+ * within 24 hours. Within a call the SDK sends it again, with the same key, only when the service certainly
470
+ * did not act on it.
471
+ */
472
+ create: (options: CreateSwarmOptions) => Promise<Swarm>;
473
+ /** One page, newest first, without tasks. */
474
+ list: (options?: ListSwarmsOptions) => Promise<SwarmPage>;
475
+ get: (swarmId: string) => Promise<Swarm>;
476
+ cancel: (swarmId: string) => Promise<Swarm>;
477
+ };
478
+ secrets: {
479
+ list: () => Promise<{
480
+ secrets: SecretInfo[];
481
+ }>;
482
+ create: (name: string, value: string, options?: {
483
+ scope?: string;
484
+ expires_at?: string;
485
+ }) => Promise<SecretInfo>;
486
+ delete: (name: string) => Promise<{
487
+ success: boolean;
488
+ }>;
489
+ inject: (sandboxId: string, secrets: string[]) => Promise<{
490
+ success: boolean;
491
+ secrets_injected: number;
492
+ }>;
493
+ };
494
+ templates: {
495
+ list: (options?: {
496
+ category?: string;
497
+ search?: string;
498
+ }) => Promise<{
499
+ templates: TemplateInfo[];
500
+ }>;
501
+ get: (templateId: string) => Promise<TemplateInfo>;
502
+ };
503
+ apiKeys: {
504
+ list: () => Promise<{
505
+ api_keys: ApiKeyInfo[];
506
+ }>;
507
+ create: (name: string, options?: {
508
+ scopes?: string[];
509
+ expires_in_days?: number;
510
+ }) => Promise<CreateApiKeyResult>;
511
+ revoke: (keyId: string) => Promise<{
512
+ success: boolean;
513
+ }>;
514
+ };
515
+ billing: {
516
+ subscription: () => Promise<SubscriptionInfo>;
517
+ usage: () => Promise<UsageSummaryInfo>;
518
+ invoices: (limit?: number) => Promise<{
519
+ invoices: InvoiceInfo[];
520
+ }>;
521
+ portal: (returnUrl: string) => Promise<{
522
+ url: string;
523
+ }>;
524
+ };
525
+ snapshots: {
526
+ list: () => Promise<{
527
+ snapshots: SnapshotResponse[];
528
+ total: number;
529
+ enabled: boolean;
530
+ }>;
531
+ status: () => Promise<{
532
+ enabled: boolean;
533
+ snapshotCount: number;
534
+ snapshotDir: string;
535
+ memoryBackend: string;
536
+ snapshotType: string;
537
+ }>;
538
+ create: (payload: Record<string, unknown>) => Promise<SnapshotResponse>;
539
+ get: (profileKey: string) => Promise<SnapshotResponse>;
540
+ delete: (profileKey: string) => Promise<{
541
+ message: string;
542
+ }>;
543
+ restore: (profileKey: string) => Promise<{
544
+ vmId: string;
545
+ socketPath: string;
546
+ restoreDurationMs: number;
547
+ profileKey: string;
548
+ }>;
549
+ warm: (payload: {
550
+ count?: number;
551
+ }) => Promise<{
552
+ message: string;
553
+ profiles_requested: number;
554
+ profiles_warmed: number;
555
+ profiles_created: number;
166
556
  }>;
557
+ cleanup: (payload: {
558
+ max_age_seconds?: number;
559
+ keep_most_recent?: number;
560
+ dry_run?: boolean;
561
+ }) => Promise<{
562
+ message: string;
563
+ dry_run: boolean;
564
+ profiles_removed: number;
565
+ removed_profiles: string[];
566
+ profiles_removed_by_age: number;
567
+ profiles_removed_by_keep_limit: number;
568
+ total_found: number;
569
+ total_remaining: number;
570
+ }>;
571
+ };
572
+ computerUse: {
573
+ screenshot: (sandboxId: string, options?: {
574
+ format?: string;
575
+ quality?: number;
576
+ }) => Promise<any>;
577
+ mouse: (sandboxId: string, action: string, x: number, y: number, button?: string) => Promise<void>;
578
+ keyboard: (sandboxId: string, action: string, textOrKey: string, modifiers?: string[]) => Promise<void>;
579
+ getScreenSize: (sandboxId: string) => Promise<{
580
+ width: number;
581
+ height: number;
582
+ }>;
583
+ };
584
+ repl: {
585
+ create: (sandboxId: string, language?: string) => Promise<any>;
586
+ list: (sandboxId: string) => Promise<any[]>;
587
+ get: (sandboxId: string, sessionId: string) => Promise<any>;
588
+ execute: (sandboxId: string, sessionId: string, code: string, timeoutMs?: number) => Promise<any>;
589
+ interrupt: (sandboxId: string, sessionId: string) => Promise<void>;
590
+ delete: (sandboxId: string, sessionId: string) => Promise<void>;
591
+ };
592
+ mcp: {
593
+ start: (sandboxId: string, name: string, command: string, args?: string[], env?: Record<string, string>, port?: number) => Promise<any>;
594
+ stop: (sandboxId: string, name: string) => Promise<void>;
595
+ list: (sandboxId: string) => Promise<any[]>;
596
+ presets: () => Promise<any[]>;
597
+ };
598
+ egress: {
599
+ get: () => Promise<any>;
600
+ set: (mode: string, options?: {
601
+ allowed_domains?: string[];
602
+ denied_domains?: string[];
603
+ allowed_ports?: number[];
604
+ log_all_requests?: boolean;
605
+ }) => Promise<any>;
606
+ audit: (options?: {
607
+ sandbox_id?: string;
608
+ host?: string;
609
+ decision?: string;
610
+ limit?: number;
611
+ }) => Promise<any[]>;
612
+ };
613
+ benchmark: {
614
+ run: (runs?: number) => Promise<any>;
615
+ history: (options?: {
616
+ limit?: number;
617
+ days?: number;
618
+ region?: string;
619
+ }) => Promise<any[]>;
620
+ summary: () => Promise<any>;
621
+ };
622
+ }
623
+ export interface WebhookInfo {
624
+ id: string;
625
+ url: string;
626
+ events: string[];
627
+ enabled: boolean;
628
+ secret?: string;
629
+ created_at: string;
630
+ updated_at?: string;
631
+ }
632
+ export interface WebhookDeliveryInfo {
633
+ id: string;
634
+ webhook_id: string;
635
+ event: string;
636
+ status: 'success' | 'failure' | 'pending';
637
+ attempts: number;
638
+ response_status?: number;
639
+ response_body?: string;
640
+ created_at: string;
641
+ completed_at?: string;
642
+ }
643
+ export interface AuditEventInfo {
644
+ id: string;
645
+ timestamp: string;
646
+ org_id?: string;
647
+ sandbox_id?: string;
648
+ action: string;
649
+ resource: string;
650
+ outcome: string;
651
+ actor?: string;
652
+ details?: Record<string, unknown>;
653
+ }
654
+ export interface AuditSummaryInfo extends AuditReadMetadata {
655
+ total_events: number;
656
+ commands_executed: number;
657
+ files_written: number;
658
+ files_read: number;
659
+ secrets_accessed: number;
660
+ network_requests?: number;
661
+ sandboxes_created?: number;
662
+ sandboxes_stopped?: number;
663
+ errors?: number;
664
+ duration?: number;
665
+ }
666
+ /** One run timeline entry (GET /sandbox/:id/timeline). */
667
+ export interface TimelineEntryInfo {
668
+ cursor: string;
669
+ source: 'event' | 'exec' | 'egress' | 'llm' | 'billing';
670
+ type: string;
671
+ occurred_at: string;
672
+ data: Record<string, unknown>;
673
+ }
674
+ export interface TimelinePageInfo {
675
+ sandbox_id: string;
676
+ entries: TimelineEntryInfo[];
677
+ next_cursor: string | null;
678
+ has_more: boolean;
679
+ }
680
+ /** A run's cost breakdown (GET /sandbox/:id/cost); cents are USD cents. */
681
+ export interface RunCostInfo {
682
+ sandbox_id?: string;
683
+ currency: string;
684
+ total_cents: number;
685
+ compute: {
686
+ cents: number;
687
+ plan: string;
688
+ billable_seconds: number;
689
+ paused_seconds: number;
690
+ settled: boolean;
691
+ interim_bills: number;
692
+ };
693
+ llm: {
694
+ cents: number;
695
+ input_tokens: number;
696
+ output_tokens: number;
697
+ calls: number;
698
+ unpriced_models: string[];
699
+ by_model: Array<{
700
+ provider: string;
701
+ model: string | null;
702
+ calls: number;
703
+ input_tokens: number;
704
+ output_tokens: number;
705
+ cents: number;
706
+ priced: boolean;
707
+ }>;
708
+ };
709
+ storage: {
710
+ cents: number;
711
+ metered: boolean;
712
+ };
713
+ budget?: Record<string, unknown> | null;
714
+ as_of: string;
715
+ }
716
+ export interface OrgCostGroupInfo {
717
+ key: string;
718
+ compute_cents: number;
719
+ llm_cents: number;
720
+ total_cents: number;
721
+ llm_input_tokens: number;
722
+ llm_output_tokens: number;
723
+ }
724
+ export interface OrgCostsInfo {
725
+ group_by: string;
726
+ from: string;
727
+ to: string;
728
+ currency: string;
729
+ totals: Omit<OrgCostGroupInfo, 'key'>;
730
+ groups: OrgCostGroupInfo[];
731
+ unpriced_models: string[];
732
+ }
733
+ /** One egress credential rule (names only; the gateway holds the values). */
734
+ export interface EgressCredentialRuleInfo {
735
+ id: string;
736
+ scope: 'org' | 'sandbox';
737
+ host: string;
738
+ header: string;
739
+ format: string;
740
+ secret: string;
741
+ path_prefix: string | null;
742
+ }
743
+ /** GET / PATCH /sandbox/:id/egress. */
744
+ export interface SandboxEgressInfo {
745
+ sandbox_id: string;
746
+ egress: {
747
+ allow: string[];
748
+ deny: string[];
167
749
  };
750
+ credentials: EgressCredentialRuleInfo[];
751
+ org_credentials: EgressCredentialRuleInfo[];
752
+ }
753
+ export interface OrgPolicyInfo {
754
+ org_id: string;
755
+ allowed_images: string[] | null;
756
+ max_cpus: number | null;
757
+ max_memory_gib: number | null;
758
+ max_lifetime_seconds: number | null;
759
+ egress_mode_floor: string;
760
+ require_inference_gateway: boolean;
761
+ default_budget: Record<string, unknown> | null;
762
+ updated_by: string | null;
763
+ updated_at: string | null;
764
+ }
765
+ /** A registered custom image (docs/CUSTOM_IMAGES.md). */
766
+ export interface CustomImageInfo {
767
+ id: string;
768
+ name: string;
769
+ image: string;
770
+ reference: string;
771
+ pinned_reference: string;
772
+ digest: string;
773
+ index_digest: string | null;
774
+ platform: string;
775
+ user: string;
776
+ entrypoint: string[];
777
+ cmd: string[];
778
+ run_image_command: boolean;
779
+ pull_secret: string | null;
780
+ status: string;
781
+ scan_status: string;
782
+ scan_detail: string | null;
783
+ created_by: string | null;
784
+ created_at: string;
785
+ updated_at: string;
786
+ }
787
+ export interface SecretInfo {
788
+ id: string;
789
+ name: string;
790
+ scope: 'sandbox' | 'global' | 'registry';
791
+ allowed_sandbox_patterns?: string[];
792
+ created_at: string;
793
+ updated_at: string;
794
+ expires_at?: string;
795
+ }
796
+ export interface TemplateInfo {
797
+ id: string;
798
+ name: string;
799
+ description: string;
800
+ category: string;
801
+ tags?: string[];
802
+ config: {
803
+ cpus: string;
804
+ memory: string;
805
+ timeout_seconds: number;
806
+ env?: Record<string, string>;
807
+ setup_commands?: string[];
808
+ };
809
+ files?: Array<{
810
+ path: string;
811
+ content: string;
812
+ }>;
813
+ }
814
+ export interface ApiKeyInfo {
815
+ id: string;
816
+ name: string;
817
+ key_prefix: string;
818
+ scopes: string[];
819
+ rate_limit_override?: number;
820
+ last_used_at?: string;
821
+ expires_at?: string;
822
+ created_at: string;
823
+ }
824
+ export interface CreateApiKeyResult {
825
+ api_key: ApiKeyInfo;
826
+ key: string;
827
+ }
828
+ export interface AuthContextInfo {
829
+ auth_type: 'api_key' | 'session';
830
+ organization: {
831
+ id: string;
832
+ name?: string;
833
+ slug?: string;
834
+ plan?: string;
835
+ suspended?: boolean;
836
+ };
837
+ user?: {
838
+ id: string;
839
+ email?: string;
840
+ role?: string;
841
+ email_verified?: boolean;
842
+ };
843
+ session?: {
844
+ expires_at: string;
845
+ };
846
+ api_key?: ApiKeyInfo;
847
+ }
848
+ /** Response of GET /settings (controller/src/routes/settings.routes.ts). */
849
+ export interface OrgSettingsResponse {
850
+ organization: {
851
+ id: string;
852
+ name?: string;
853
+ slug?: string;
854
+ planType?: string;
855
+ };
856
+ user?: {
857
+ id: string;
858
+ email?: string;
859
+ role?: string;
860
+ emailVerified?: boolean;
861
+ } | null;
862
+ }
863
+ export declare function toAuthContextInfo(settings: OrgSettingsResponse): AuthContextInfo;
864
+ export interface PauseResumeRequest {
865
+ wait?: boolean;
866
+ timeoutSeconds?: number;
867
+ }
868
+ export interface SandboxPauseResponse {
869
+ sandbox_id: string;
870
+ status: 'paused' | 'pausing';
871
+ paused_at?: string | null;
872
+ paused_expires_at?: string | null;
873
+ remaining_timeout_seconds?: number | null;
874
+ preserves?: {
875
+ filesystem: boolean;
876
+ memory: boolean;
877
+ processes: boolean;
878
+ };
879
+ }
880
+ export interface SandboxResumeResponse {
881
+ sandbox_id: string;
882
+ status: 'running' | 'resuming';
883
+ expires_at?: string | null;
884
+ pod_generation?: number | null;
885
+ }
886
+ export interface BootstrapExchangeResult extends CreateApiKeyResult {
887
+ issued_via: 'bootstrap_token';
888
+ }
889
+ export interface SubscriptionInfo {
890
+ subscription: {
891
+ id: string;
892
+ status: string;
893
+ current_period_start: string;
894
+ current_period_end: string;
895
+ } | null;
896
+ plan: string;
897
+ }
898
+ export interface InvoiceInfo {
899
+ id: string;
900
+ status: string;
901
+ amount_due: number;
902
+ amount_paid: number;
903
+ currency: string;
904
+ created: number;
905
+ period_start: number;
906
+ period_end: number;
907
+ hosted_invoice_url?: string;
908
+ invoice_pdf?: string;
909
+ }
910
+ export interface UsageSummaryInfo {
911
+ period_start: string;
912
+ period_end: string;
913
+ cpu_hours: number;
914
+ memory_gb_hours: number;
915
+ network_gb: number;
916
+ sandbox_creations: number;
917
+ estimated_cost_cents: number;
918
+ breakdown: {
919
+ cpu_cost_cents: number;
920
+ memory_cost_cents: number;
921
+ network_cost_cents: number;
922
+ creations_cost_cents: number;
923
+ };
924
+ }
925
+ export interface SnapshotResponse {
926
+ profileKey: string;
927
+ memoryPath: string;
928
+ statePath: string;
929
+ createdAt: string;
930
+ vcpuCount: number;
931
+ memSizeMib: number;
932
+ snapshotType: string;
933
+ memoryBackend: string;
934
+ version: number;
168
935
  }
936
+ /**
937
+ * Call an operator-only route under /api/admin/internal (admin auth). The admin
938
+ * token comes from STATESET_ADMIN_TOKEN, falling back to the configured key.
939
+ */
940
+ export declare function requestAdminInternal<T>(apiUrl: string, adminToken: string, method: string, path: string, body?: unknown): Promise<T>;
169
941
  export declare function getClient(): CliClient;
942
+ /** Build a non-singleton client for short-lived credentials such as an agent
943
+ * bootstrap token. Keeping this separate prevents an exchanged credential
944
+ * from replacing the active profile's cached client. */
945
+ export declare function createClientWithToken(authToken: string, apiUrl?: string, transportOptions?: {
946
+ retry?: false;
947
+ timeout?: number;
948
+ }): CliClient;
170
949
  export declare function resetClient(): void;
171
950
  //# sourceMappingURL=client.d.ts.map