@stateset/sandbox-cli 1.0.5 → 3.3.1

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