withruntime 0.50.0 → 1.0.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 (491) hide show
  1. package/dist/generated/apps.d.ts +309 -0
  2. package/dist/generated/apps.js +333 -0
  3. package/dist/generated/audit.d.ts +47 -0
  4. package/dist/generated/audit.js +14 -0
  5. package/dist/generated/browsers.d.ts +309 -0
  6. package/dist/generated/browsers.js +333 -0
  7. package/dist/generated/builds.d.ts +309 -0
  8. package/dist/generated/builds.js +333 -0
  9. package/dist/generated/ci.d.ts +309 -0
  10. package/dist/generated/ci.js +333 -0
  11. package/dist/generated/containers.d.ts +309 -0
  12. package/dist/generated/containers.js +333 -0
  13. package/dist/generated/desktops.d.ts +309 -0
  14. package/dist/generated/desktops.js +333 -0
  15. package/dist/generated/domains.d.ts +80 -0
  16. package/dist/generated/domains.js +58 -0
  17. package/dist/generated/egressIps.d.ts +36 -0
  18. package/dist/generated/egressIps.js +14 -0
  19. package/dist/generated/events.d.ts +37 -0
  20. package/dist/generated/events.js +14 -0
  21. package/dist/generated/feedback.d.ts +44 -0
  22. package/dist/generated/feedback.js +13 -0
  23. package/dist/generated/functions.d.ts +309 -0
  24. package/dist/generated/functions.js +333 -0
  25. package/dist/generated/identities.d.ts +36 -0
  26. package/dist/generated/identities.js +22 -0
  27. package/dist/generated/images.d.ts +200 -0
  28. package/dist/generated/images.js +65 -0
  29. package/dist/generated/index.d.ts +143 -0
  30. package/dist/generated/index.js +184 -0
  31. package/dist/generated/jobRuns.d.ts +68 -0
  32. package/dist/generated/jobRuns.js +22 -0
  33. package/dist/generated/jobs.d.ts +144 -0
  34. package/dist/generated/jobs.js +85 -0
  35. package/dist/generated/keys.d.ts +105 -0
  36. package/dist/generated/keys.js +26 -0
  37. package/dist/generated/me.d.ts +33 -0
  38. package/dist/generated/me.js +13 -0
  39. package/dist/generated/networks.d.ts +32 -0
  40. package/dist/generated/networks.js +14 -0
  41. package/dist/generated/notebooks.d.ts +309 -0
  42. package/dist/generated/notebooks.js +333 -0
  43. package/dist/generated/otel.d.ts +46 -0
  44. package/dist/generated/otel.js +22 -0
  45. package/dist/generated/ports.d.ts +55 -0
  46. package/dist/generated/ports.js +22 -0
  47. package/dist/generated/previews.d.ts +86 -0
  48. package/dist/generated/previews.js +67 -0
  49. package/dist/generated/projects.d.ts +47 -0
  50. package/dist/generated/projects.js +26 -0
  51. package/dist/generated/roles.d.ts +36 -0
  52. package/dist/generated/roles.js +22 -0
  53. package/dist/generated/routes.d.ts +3 -0
  54. package/dist/generated/routes.js +4 -0
  55. package/dist/generated/runtime.d.ts +176 -0
  56. package/dist/generated/runtime.js +416 -0
  57. package/dist/generated/sandboxes.d.ts +952 -0
  58. package/dist/generated/sandboxes.js +342 -0
  59. package/dist/generated/secrets.d.ts +116 -0
  60. package/dist/generated/secrets.js +54 -0
  61. package/dist/generated/sessions.d.ts +47 -0
  62. package/dist/generated/sessions.js +17 -0
  63. package/dist/generated/signing.d.ts +68 -0
  64. package/dist/generated/signing.js +187 -0
  65. package/dist/generated/sites.d.ts +309 -0
  66. package/dist/generated/sites.js +333 -0
  67. package/dist/generated/snapshots.d.ts +27 -0
  68. package/dist/generated/snapshots.js +22 -0
  69. package/dist/generated/tunnels.d.ts +68 -0
  70. package/dist/generated/tunnels.js +14 -0
  71. package/dist/generated/usage.d.ts +155 -0
  72. package/dist/generated/usage.js +17 -0
  73. package/dist/generated/volumes.d.ts +36 -0
  74. package/dist/generated/volumes.js +26 -0
  75. package/dist/generated/webhooks.d.ts +44 -0
  76. package/dist/generated/webhooks.js +22 -0
  77. package/dist/generated/workspaces.d.ts +309 -0
  78. package/dist/generated/workspaces.js +333 -0
  79. package/dist/v2/cli.d.ts +7 -0
  80. package/dist/v2/cli.js +283 -0
  81. package/dist/v2/index.d.ts +1 -0
  82. package/dist/v2/index.js +4 -0
  83. package/dist/v2/login.d.ts +35 -0
  84. package/dist/v2/login.js +225 -0
  85. package/dist/v2/mcp.d.ts +1 -0
  86. package/dist/v2/mcp.js +49 -0
  87. package/dist/v2/openapi.json +75750 -0
  88. package/dist/v2/shims/base.d.ts +33 -0
  89. package/dist/v2/shims/base.js +54 -0
  90. package/dist/v2/shims/blaxel.d.ts +60 -0
  91. package/dist/v2/shims/blaxel.js +71 -0
  92. package/dist/v2/shims/cloudflare.d.ts +52 -0
  93. package/dist/v2/shims/cloudflare.js +55 -0
  94. package/dist/v2/shims/daytona.d.ts +58 -0
  95. package/dist/v2/shims/daytona.js +74 -0
  96. package/dist/v2/shims/e2b.d.ts +142 -0
  97. package/dist/v2/shims/e2b.js +238 -0
  98. package/dist/v2/shims/fly.d.ts +6 -0
  99. package/dist/v2/shims/fly.js +91 -0
  100. package/dist/v2/shims/modal.d.ts +54 -0
  101. package/dist/v2/shims/modal.js +79 -0
  102. package/dist/v2/shims/morph.d.ts +60 -0
  103. package/dist/v2/shims/morph.js +87 -0
  104. package/dist/v2/shims/vercel.d.ts +53 -0
  105. package/dist/v2/shims/vercel.js +90 -0
  106. package/dist/v2/table.d.ts +53 -0
  107. package/dist/v2/table.js +122 -0
  108. package/package.json +20 -310
  109. package/BLAXEL.md +0 -290
  110. package/COMPATIBILITY.md +0 -447
  111. package/DAYTONA.md +0 -237
  112. package/E2B.md +0 -314
  113. package/README.md +0 -331
  114. package/README.src.md +0 -333
  115. package/VERCEL.md +0 -230
  116. package/agent-platforms-inventory.json +0 -387
  117. package/compatibility-lock.json +0 -305
  118. package/dist/agents/browser.d.ts +0 -12
  119. package/dist/agents/browser.js +0 -12
  120. package/dist/agents/index.d.ts +0 -11
  121. package/dist/agents/index.js +0 -11
  122. package/dist/agents-cli.d.ts +0 -16
  123. package/dist/agents-cli.js +0 -1237
  124. package/dist/agents-deploy.d.ts +0 -196
  125. package/dist/agents-deploy.js +0 -872
  126. package/dist/agents-file.d.ts +0 -19
  127. package/dist/agents-file.js +0 -135
  128. package/dist/ai/index.d.ts +0 -49
  129. package/dist/ai/index.js +0 -31
  130. package/dist/ai-harness/index.d.ts +0 -194
  131. package/dist/ai-harness/index.js +0 -522
  132. package/dist/api-defaults.d.ts +0 -17
  133. package/dist/api-defaults.js +0 -22
  134. package/dist/apps/index.d.ts +0 -10
  135. package/dist/apps/index.js +0 -11
  136. package/dist/apps-cli.d.ts +0 -16
  137. package/dist/apps-cli.js +0 -1021
  138. package/dist/billing-cli.d.ts +0 -23
  139. package/dist/billing-cli.js +0 -264
  140. package/dist/blaxel/client.d.ts +0 -59
  141. package/dist/blaxel/client.js +0 -86
  142. package/dist/blaxel/context.d.ts +0 -59
  143. package/dist/blaxel/context.js +0 -162
  144. package/dist/blaxel/errors.d.ts +0 -130
  145. package/dist/blaxel/errors.js +0 -315
  146. package/dist/blaxel/filesystem.d.ts +0 -147
  147. package/dist/blaxel/filesystem.js +0 -585
  148. package/dist/blaxel/index.d.ts +0 -287
  149. package/dist/blaxel/index.js +0 -351
  150. package/dist/blaxel/interpreter.d.ts +0 -71
  151. package/dist/blaxel/interpreter.js +0 -256
  152. package/dist/blaxel/lookup.d.ts +0 -39
  153. package/dist/blaxel/lookup.js +0 -84
  154. package/dist/blaxel/pagination.d.ts +0 -39
  155. package/dist/blaxel/pagination.js +0 -88
  156. package/dist/blaxel/preview.d.ts +0 -136
  157. package/dist/blaxel/preview.js +0 -304
  158. package/dist/blaxel/process.d.ts +0 -126
  159. package/dist/blaxel/process.js +0 -581
  160. package/dist/blaxel/sandbox.d.ts +0 -198
  161. package/dist/blaxel/sandbox.js +0 -856
  162. package/dist/blaxel/session.d.ts +0 -31
  163. package/dist/blaxel/session.js +0 -136
  164. package/dist/blaxel/snapshot.d.ts +0 -123
  165. package/dist/blaxel/snapshot.js +0 -199
  166. package/dist/blaxel/types.d.ts +0 -145
  167. package/dist/blaxel/types.js +0 -60
  168. package/dist/blaxel/unsupported.d.ts +0 -20
  169. package/dist/blaxel/unsupported.js +0 -32
  170. package/dist/browser-stub.d.ts +0 -1
  171. package/dist/browser-stub.js +0 -1
  172. package/dist/browsers/index.d.ts +0 -9
  173. package/dist/browsers/index.js +0 -10
  174. package/dist/browsers-cli.d.ts +0 -13
  175. package/dist/browsers-cli.js +0 -279
  176. package/dist/builds/index.d.ts +0 -10
  177. package/dist/builds/index.js +0 -11
  178. package/dist/ci/index.d.ts +0 -13
  179. package/dist/ci/index.js +0 -14
  180. package/dist/ci-cli.d.ts +0 -20
  181. package/dist/ci-cli.js +0 -537
  182. package/dist/ci-import.d.ts +0 -23
  183. package/dist/ci-import.js +0 -565
  184. package/dist/claude-agent-sdk/index.d.ts +0 -7
  185. package/dist/claude-agent-sdk/index.js +0 -65
  186. package/dist/cli/logs.d.ts +0 -21
  187. package/dist/cli/logs.js +0 -188
  188. package/dist/cli-extras.d.ts +0 -39
  189. package/dist/cli-extras.js +0 -267
  190. package/dist/cli-name.d.ts +0 -6
  191. package/dist/cli-name.js +0 -8
  192. package/dist/cli-update.d.ts +0 -11
  193. package/dist/cli-update.js +0 -46
  194. package/dist/cli-words.d.ts +0 -36
  195. package/dist/cli-words.js +0 -167
  196. package/dist/cli.d.ts +0 -92
  197. package/dist/cli.js +0 -5463
  198. package/dist/client.d.ts +0 -189
  199. package/dist/client.js +0 -205
  200. package/dist/cloudflare/errors.d.ts +0 -166
  201. package/dist/cloudflare/errors.js +0 -183
  202. package/dist/cloudflare/identity.d.ts +0 -7
  203. package/dist/cloudflare/identity.js +0 -13
  204. package/dist/cloudflare/index.d.ts +0 -545
  205. package/dist/cloudflare/index.js +0 -1106
  206. package/dist/cloudflare/interpreter.d.ts +0 -119
  207. package/dist/cloudflare/interpreter.js +0 -232
  208. package/dist/cloudflare/mime.d.ts +0 -1
  209. package/dist/cloudflare/mime.js +0 -66
  210. package/dist/cloudflare/streams.d.ts +0 -46
  211. package/dist/cloudflare/streams.js +0 -175
  212. package/dist/cloudflare/types.d.ts +0 -338
  213. package/dist/cloudflare/types.js +0 -80
  214. package/dist/cloudflare/watch.d.ts +0 -9
  215. package/dist/cloudflare/watch.js +0 -24
  216. package/dist/cloudflare/worker.d.ts +0 -706
  217. package/dist/cloudflare/worker.js +0 -633
  218. package/dist/codesandbox/guest-service.d.ts +0 -31
  219. package/dist/codesandbox/guest-service.js +0 -490
  220. package/dist/codesandbox/index.d.ts +0 -574
  221. package/dist/codesandbox/index.js +0 -1747
  222. package/dist/compat/core.d.ts +0 -58
  223. package/dist/compat/core.js +0 -267
  224. package/dist/compat/files.d.ts +0 -27
  225. package/dist/compat/files.js +0 -157
  226. package/dist/compat/lease.d.ts +0 -37
  227. package/dist/compat/lease.js +0 -93
  228. package/dist/compat/shell.d.ts +0 -4
  229. package/dist/compat/shell.js +0 -165
  230. package/dist/containers/index.d.ts +0 -10
  231. package/dist/containers/index.js +0 -11
  232. package/dist/credentials.d.ts +0 -71
  233. package/dist/credentials.js +0 -340
  234. package/dist/daytona/client.d.ts +0 -48
  235. package/dist/daytona/client.js +0 -45
  236. package/dist/daytona/computer-use.d.ts +0 -171
  237. package/dist/daytona/computer-use.js +0 -382
  238. package/dist/daytona/context.d.ts +0 -41
  239. package/dist/daytona/context.js +0 -50
  240. package/dist/daytona/daytona.d.ts +0 -213
  241. package/dist/daytona/daytona.js +0 -578
  242. package/dist/daytona/errors.d.ts +0 -117
  243. package/dist/daytona/errors.js +0 -201
  244. package/dist/daytona/filesystem.d.ts +0 -99
  245. package/dist/daytona/filesystem.js +0 -300
  246. package/dist/daytona/git.d.ts +0 -33
  247. package/dist/daytona/git.js +0 -128
  248. package/dist/daytona/image.d.ts +0 -49
  249. package/dist/daytona/image.js +0 -146
  250. package/dist/daytona/index.d.ts +0 -87
  251. package/dist/daytona/index.js +0 -102
  252. package/dist/daytona/process.d.ts +0 -143
  253. package/dist/daytona/process.js +0 -565
  254. package/dist/daytona/sandbox.d.ts +0 -222
  255. package/dist/daytona/sandbox.js +0 -505
  256. package/dist/desktops/index.d.ts +0 -9
  257. package/dist/desktops/index.js +0 -10
  258. package/dist/domains/index.d.ts +0 -9
  259. package/dist/domains/index.js +0 -10
  260. package/dist/e2b/client.d.ts +0 -76
  261. package/dist/e2b/client.js +0 -124
  262. package/dist/e2b/code-interpreter.d.ts +0 -134
  263. package/dist/e2b/code-interpreter.js +0 -239
  264. package/dist/e2b/commands.d.ts +0 -135
  265. package/dist/e2b/commands.js +0 -452
  266. package/dist/e2b/errors.d.ts +0 -125
  267. package/dist/e2b/errors.js +0 -247
  268. package/dist/e2b/filesystem.d.ts +0 -111
  269. package/dist/e2b/filesystem.js +0 -374
  270. package/dist/e2b/index.d.ts +0 -35
  271. package/dist/e2b/index.js +0 -69
  272. package/dist/e2b/pty.d.ts +0 -24
  273. package/dist/e2b/pty.js +0 -83
  274. package/dist/e2b/sandbox.d.ts +0 -248
  275. package/dist/e2b/sandbox.js +0 -781
  276. package/dist/e2b/unsupported.d.ts +0 -38
  277. package/dist/e2b/unsupported.js +0 -48
  278. package/dist/e2b/users.d.ts +0 -39
  279. package/dist/e2b/users.js +0 -207
  280. package/dist/errors.d.ts +0 -100
  281. package/dist/errors.js +0 -198
  282. package/dist/file-source.d.ts +0 -16
  283. package/dist/file-source.js +0 -162
  284. package/dist/fly/index.d.ts +0 -102
  285. package/dist/fly/index.js +0 -930
  286. package/dist/freestyle/index.d.ts +0 -629
  287. package/dist/freestyle/index.js +0 -1187
  288. package/dist/functions/index.d.ts +0 -10
  289. package/dist/functions/index.js +0 -11
  290. package/dist/identity.d.ts +0 -30
  291. package/dist/identity.js +0 -141
  292. package/dist/image-context.d.ts +0 -39
  293. package/dist/image-context.js +0 -176
  294. package/dist/images/index.d.ts +0 -9
  295. package/dist/images/index.js +0 -10
  296. package/dist/index.d.ts +0 -87
  297. package/dist/index.js +0 -51
  298. package/dist/inngest/index.d.ts +0 -96
  299. package/dist/inngest/index.js +0 -183
  300. package/dist/ips/index.d.ts +0 -9
  301. package/dist/ips/index.js +0 -10
  302. package/dist/jobs/index.d.ts +0 -9
  303. package/dist/jobs/index.js +0 -10
  304. package/dist/jobs-code/cron.d.ts +0 -12
  305. package/dist/jobs-code/cron.js +0 -93
  306. package/dist/jobs-code/registry.d.ts +0 -31
  307. package/dist/jobs-code/registry.js +0 -30
  308. package/dist/jobs-code/runner.d.ts +0 -1
  309. package/dist/jobs-code/runner.js +0 -74
  310. package/dist/jobs-deploy.d.ts +0 -22
  311. package/dist/jobs-deploy.js +0 -247
  312. package/dist/jobs-import.d.ts +0 -15
  313. package/dist/jobs-import.js +0 -231
  314. package/dist/keys.d.ts +0 -55
  315. package/dist/keys.js +0 -211
  316. package/dist/login.d.ts +0 -88
  317. package/dist/login.js +0 -369
  318. package/dist/machine.d.ts +0 -222
  319. package/dist/machine.js +0 -578
  320. package/dist/mcp.d.ts +0 -16
  321. package/dist/mcp.js +0 -377
  322. package/dist/modal/index.d.ts +0 -532
  323. package/dist/modal/index.js +0 -1284
  324. package/dist/morph/index.d.ts +0 -255
  325. package/dist/morph/index.js +0 -641
  326. package/dist/network-cli.d.ts +0 -17
  327. package/dist/network-cli.js +0 -523
  328. package/dist/networks/index.d.ts +0 -11
  329. package/dist/networks/index.js +0 -10
  330. package/dist/openai-agents/index.d.ts +0 -132
  331. package/dist/openai-agents/index.js +0 -738
  332. package/dist/page.d.ts +0 -13
  333. package/dist/page.js +0 -39
  334. package/dist/ports/index.d.ts +0 -9
  335. package/dist/ports/index.js +0 -10
  336. package/dist/product-names.d.ts +0 -52
  337. package/dist/product-names.js +0 -174
  338. package/dist/product-renames.d.ts +0 -103
  339. package/dist/product-renames.js +0 -189
  340. package/dist/products/agents.d.ts +0 -935
  341. package/dist/products/agents.js +0 -581
  342. package/dist/products/api-keys.d.ts +0 -113
  343. package/dist/products/api-keys.js +0 -32
  344. package/dist/products/apps.d.ts +0 -409
  345. package/dist/products/apps.js +0 -231
  346. package/dist/products/audit.d.ts +0 -51
  347. package/dist/products/audit.js +0 -10
  348. package/dist/products/balancers.d.ts +0 -87
  349. package/dist/products/balancers.js +0 -8
  350. package/dist/products/billing.d.ts +0 -76
  351. package/dist/products/billing.js +0 -26
  352. package/dist/products/browser.d.ts +0 -73
  353. package/dist/products/browser.js +0 -29
  354. package/dist/products/browsers.d.ts +0 -184
  355. package/dist/products/browsers.js +0 -180
  356. package/dist/products/builds.d.ts +0 -175
  357. package/dist/products/builds.js +0 -234
  358. package/dist/products/ci.d.ts +0 -406
  359. package/dist/products/ci.js +0 -133
  360. package/dist/products/containers.d.ts +0 -71
  361. package/dist/products/containers.js +0 -6
  362. package/dist/products/desktop.d.ts +0 -141
  363. package/dist/products/desktop.js +0 -83
  364. package/dist/products/desktops.d.ts +0 -71
  365. package/dist/products/desktops.js +0 -27
  366. package/dist/products/functions.d.ts +0 -2
  367. package/dist/products/functions.js +0 -5
  368. package/dist/products/images.d.ts +0 -229
  369. package/dist/products/images.js +0 -235
  370. package/dist/products/index.d.ts +0 -84
  371. package/dist/products/index.js +0 -105
  372. package/dist/products/interpreter.d.ts +0 -97
  373. package/dist/products/interpreter.js +0 -106
  374. package/dist/products/jobs.d.ts +0 -408
  375. package/dist/products/jobs.js +0 -256
  376. package/dist/products/limits.d.ts +0 -61
  377. package/dist/products/limits.js +0 -10
  378. package/dist/products/logs.d.ts +0 -245
  379. package/dist/products/logs.js +0 -274
  380. package/dist/products/mcp.d.ts +0 -88
  381. package/dist/products/mcp.js +0 -58
  382. package/dist/products/mounts.d.ts +0 -49
  383. package/dist/products/mounts.js +0 -21
  384. package/dist/products/network-products.d.ts +0 -268
  385. package/dist/products/network-products.js +0 -127
  386. package/dist/products/network.d.ts +0 -62
  387. package/dist/products/network.js +0 -19
  388. package/dist/products/observability.d.ts +0 -264
  389. package/dist/products/observability.js +0 -123
  390. package/dist/products/plans.d.ts +0 -133
  391. package/dist/products/plans.js +0 -24
  392. package/dist/products/previews.d.ts +0 -70
  393. package/dist/products/previews.js +0 -39
  394. package/dist/products/private-network.d.ts +0 -22
  395. package/dist/products/private-network.js +0 -10
  396. package/dist/products/queues.d.ts +0 -149
  397. package/dist/products/queues.js +0 -213
  398. package/dist/products/referrals.d.ts +0 -50
  399. package/dist/products/referrals.js +0 -8
  400. package/dist/products/reservations.d.ts +0 -108
  401. package/dist/products/reservations.js +0 -41
  402. package/dist/products/resources.d.ts +0 -55
  403. package/dist/products/resources.js +0 -122
  404. package/dist/products/secrets.d.ts +0 -316
  405. package/dist/products/secrets.js +0 -333
  406. package/dist/products/signed-requests.d.ts +0 -21
  407. package/dist/products/signed-requests.js +0 -11
  408. package/dist/products/sso.d.ts +0 -44
  409. package/dist/products/sso.js +0 -8
  410. package/dist/products/streams.d.ts +0 -73
  411. package/dist/products/streams.js +0 -17
  412. package/dist/products/switching.d.ts +0 -123
  413. package/dist/products/switching.js +0 -26
  414. package/dist/products/tailscale.d.ts +0 -57
  415. package/dist/products/tailscale.js +0 -17
  416. package/dist/products/uptime.d.ts +0 -97
  417. package/dist/products/uptime.js +0 -42
  418. package/dist/products/volumes.d.ts +0 -190
  419. package/dist/products/volumes.js +0 -114
  420. package/dist/products/watch.d.ts +0 -112
  421. package/dist/products/watch.js +0 -249
  422. package/dist/proxy.d.ts +0 -30
  423. package/dist/proxy.js +0 -200
  424. package/dist/record-cli.d.ts +0 -23
  425. package/dist/record-cli.js +0 -308
  426. package/dist/renamed-products.d.ts +0 -38
  427. package/dist/renamed-products.js +0 -34
  428. package/dist/resumable.d.ts +0 -32
  429. package/dist/resumable.js +0 -201
  430. package/dist/runloop/index.d.ts +0 -333
  431. package/dist/runloop/index.js +0 -560
  432. package/dist/runloop/pagination.d.ts +0 -46
  433. package/dist/runloop/pagination.js +0 -82
  434. package/dist/runloop/sdk.d.ts +0 -131
  435. package/dist/runloop/sdk.js +0 -167
  436. package/dist/runloop/snapshots.d.ts +0 -52
  437. package/dist/runloop/snapshots.js +0 -244
  438. package/dist/sandbox.d.ts +0 -371
  439. package/dist/sandbox.js +0 -1500
  440. package/dist/sandboxes/index.d.ts +0 -11
  441. package/dist/sandboxes/index.js +0 -12
  442. package/dist/sealing.d.ts +0 -6
  443. package/dist/sealing.js +0 -14
  444. package/dist/snapshots/index.d.ts +0 -9
  445. package/dist/snapshots/index.js +0 -11
  446. package/dist/snapshots.d.ts +0 -82
  447. package/dist/snapshots.js +0 -65
  448. package/dist/sprites/index.d.ts +0 -563
  449. package/dist/sprites/index.js +0 -1370
  450. package/dist/ssh.d.ts +0 -56
  451. package/dist/ssh.js +0 -416
  452. package/dist/switched-off.d.ts +0 -5
  453. package/dist/switched-off.js +0 -8
  454. package/dist/tar.d.ts +0 -15
  455. package/dist/tar.js +0 -526
  456. package/dist/terminal.d.ts +0 -24
  457. package/dist/terminal.js +0 -32
  458. package/dist/tools/index.d.ts +0 -62
  459. package/dist/tools/index.js +0 -181
  460. package/dist/transport.d.ts +0 -165
  461. package/dist/transport.js +0 -883
  462. package/dist/trigger/index.d.ts +0 -202
  463. package/dist/trigger/index.js +0 -244
  464. package/dist/tunnel.d.ts +0 -70
  465. package/dist/tunnel.js +0 -316
  466. package/dist/types.d.ts +0 -585
  467. package/dist/types.js +0 -1
  468. package/dist/vercel/client.d.ts +0 -40
  469. package/dist/vercel/client.js +0 -39
  470. package/dist/vercel/command.d.ts +0 -117
  471. package/dist/vercel/command.js +0 -391
  472. package/dist/vercel/errors.d.ts +0 -53
  473. package/dist/vercel/errors.js +0 -131
  474. package/dist/vercel/filesystem.d.ts +0 -153
  475. package/dist/vercel/filesystem.js +0 -297
  476. package/dist/vercel/index.d.ts +0 -24
  477. package/dist/vercel/index.js +0 -36
  478. package/dist/vercel/sandbox-user.d.ts +0 -70
  479. package/dist/vercel/sandbox-user.js +0 -207
  480. package/dist/vercel/sandbox.d.ts +0 -372
  481. package/dist/vercel/sandbox.js +0 -1037
  482. package/dist/vercel/snapshot.d.ts +0 -94
  483. package/dist/vercel/snapshot.js +0 -137
  484. package/dist/volumes/index.d.ts +0 -9
  485. package/dist/volumes/index.js +0 -10
  486. package/dist/wait.d.ts +0 -12
  487. package/dist/wait.js +0 -47
  488. package/dist/wallet.d.ts +0 -45
  489. package/dist/wallet.js +0 -56
  490. package/dist/wireguard.d.ts +0 -7
  491. package/dist/wireguard.js +0 -13
@@ -0,0 +1,952 @@
1
+ import type { RequestOptions, Transport } from "./runtime.js";
2
+ import { Paginated, Stream } from "./runtime.js";
3
+ /** A command a machine starts at every fresh boot. */
4
+ export interface MachineStart {
5
+ /** The command: text, run by `bash -lc`, or the program and its arguments as a list, run without a shell. */
6
+ cmd: string | string[];
7
+ /** The directory it runs in; the user's home when omitted. */
8
+ cwd?: string;
9
+ /** Environment variables to add. */
10
+ env?: Record<string, string>;
11
+ /** A port it listens on once ready: a create answers once something listens there. At least 1. At most 65535. */
12
+ readyPort?: number;
13
+ /** A shell command that exits 0 once it is ready, run by `/bin/sh -c` in `cwd` until it does: a create answers once it has. */
14
+ readyCommand?: string;
15
+ /** How long a create waits for `readyPort` or `readyCommand`, 1 to 300 seconds: 60 when omitted. At least 1. At most 300. */
16
+ readyTimeoutSeconds?: number;
17
+ }
18
+ /** A volume a machine attaches at its create, mounted read-write in it, one machine at a time; detached when the machine is deleted. */
19
+ export interface VolumeMount {
20
+ /** The volume, by name or ID, in the machine's project. */
21
+ volume: string;
22
+ /** Where it is mounted, such as `/data`: an absolute path, not under `/proc`, `/sys`, `/dev`, `/etc`, `/usr`, `/bin`, `/sbin`, `/lib` or `/boot`. */
23
+ path: string;
24
+ }
25
+ /** A command a sandbox runs once it starts: when it ends, the sandbox stops. */
26
+ export interface SandboxRun {
27
+ /** The command: text, run by `bash -lc`, or the program and its arguments as a list, run without a shell. */
28
+ cmd: string | string[];
29
+ /** The directory it runs in; the user's home when omitted. */
30
+ cwd?: string;
31
+ /** Environment variables to add. */
32
+ env?: Record<string, string>;
33
+ /** Seconds it may run before it is stopped (`1.5` for 1,500 ms); no limit when omitted or 0. At least 0. */
34
+ timeoutSeconds?: number;
35
+ }
36
+ /** Where a sandbox may connect out, past the walls every machine has. */
37
+ export interface NetworkRules {
38
+ /** The only places it may reach, each a host, `*.` and a name for every name under it, an address or a CIDR (`[` and `]` around an IPv6 address), every port when it names none; `:port` for that port alone, on a host name for a port beyond 80 and 443, which go together. `*` is every public host. Every public host when omitted; nothing when empty. */
39
+ allowOutbound?: string[];
40
+ /** Places it may never reach, written as in allowOutbound with no port: a deny wins over every allow. */
41
+ denyOutbound?: string[];
42
+ }
43
+ /** A sandbox's settings: what a create sets on its machine. */
44
+ export interface SandboxSettings {
45
+ /** Its vCPUs. At least 1. Default: 2. */
46
+ vcpu?: number;
47
+ /** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). At least 1. Default: 4. */
48
+ memoryGB?: number;
49
+ /** Its disk in GB (1 GB is 1,024 MiB), to the MiB. At least 1. Default: 4. */
50
+ diskGB?: number;
51
+ /** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
52
+ image?: string;
53
+ /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. Fixed for its life: a fork or a copy of a snapshot keeps it. At most 64 items. */
54
+ secrets?: string[];
55
+ /** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
56
+ start?: MachineStart;
57
+ /** Who every command, process, terminal and code run in it runs as when the call names no `user`: `runtime` (uid 1000, with passwordless sudo) or `root`. Its image's when omitted, else `runtime`. */
58
+ user?: "runtime" | "root" | (string & {});
59
+ }
60
+ /** A sandbox to create. */
61
+ export interface SandboxCreate extends SandboxSettings {
62
+ /** Volumes it attaches and mounts at its create, at most one; detached when it is deleted, to attach to another. */
63
+ volumes?: VolumeMount[];
64
+ /** A command it runs once it starts. When the command ends, the sandbox is `paused` with its disk kept (exitCode says how it ended) and a call starts it again. Needs the `exec` permission too. */
65
+ run?: SandboxRun;
66
+ /** Its name, unique in its project. */
67
+ name?: string;
68
+ /** Labels to find it by. */
69
+ labels?: Record<string, string>;
70
+ /** With a name: the sandbox of that name when there is one, else a new one. */
71
+ getOrCreate?: boolean;
72
+ /** The most it may cost in all, in US dollars (`"5.00"`): once it has cost that it pauses, and starts again only once its maxCost is raised (`update`); what a key's per-request and spend caps count. When omitted under a key with a per-request or spend cap, the most that key's caps leave. */
73
+ maxCost?: string;
74
+ /** Seconds with nothing happening before it pauses, 60 to 86400; 0 never; 300 when omitted. A fork keeps its source's, except 0: a copy never pauses only when its fork asks. At least 0. At most 86400. */
75
+ idlePauseSeconds?: number;
76
+ /** A snapshot it starts as: a copy of it running, at its sizes, in its project, with its secrets. */
77
+ snapshot?: string;
78
+ /** Where it may connect out from its first start, as setNetwork takes it; the open internet behind every machine's walls when omitted. */
79
+ network?: NetworkRules;
80
+ /** Environment variables for every command and process in it and its start, at most 32 and 32768 bytes of names and values; values are never answered. A copy keeps them. */
81
+ env?: Record<string, string>;
82
+ }
83
+ /** How a create's wait for its start's ready check (`start.readyPort`, `start.readyCommand`) went. */
84
+ export interface MachineReady {
85
+ /** `ready` (the check passed), `timeout` (not within `readyTimeoutSeconds`), or `not_running` (it never ran). */
86
+ state: "ready" | "timeout" | "not_running" | (string & {});
87
+ /** How long it waited, in milliseconds. */
88
+ waitedMs: number;
89
+ }
90
+ /** A sandbox. */
91
+ export interface SandboxInfo extends SandboxSettings {
92
+ /** Its ID. */
93
+ id: string;
94
+ /** Always `sandbox`. */
95
+ object: "sandbox" | "function" | "app" | "site" | "ci" | "browser" | "desktop" | "notebook" | "workspace" | "container" | "build" | (string & {});
96
+ /** Its name, unique in its project. */
97
+ name?: string;
98
+ /** Where it is. */
99
+ state: "starting" | "running" | "paused" | "deleted" | "error" | (string & {});
100
+ /** Its labels. */
101
+ labels: Record<string, string>;
102
+ /** When it was created. */
103
+ createdAt?: string;
104
+ /** When it was deleted: a delete's answer alone. */
105
+ deletedAt?: string;
106
+ /** Its revision, changed by every change to it: what an update's If-Match names. */
107
+ revision?: number;
108
+ /** Seconds with nothing happening before it pauses; 0 never. Default: 300. */
109
+ idlePauseSeconds?: number;
110
+ /** The most it may cost in all, in US dollars; none when it has no such cap. */
111
+ maxCost?: string;
112
+ /** Its run's exit code, once its run ended; none for one a signal or its timeout ended. */
113
+ exitCode?: number;
114
+ /** When its run ended. */
115
+ endedAt?: string;
116
+ /** A create's answer alone, for a start with a ready check: how its wait went. */
117
+ ready?: MachineReady;
118
+ }
119
+ /** A terminal's size. */
120
+ export interface Terminal {
121
+ /** Its columns. At least 1. At most 65535. */
122
+ cols: number;
123
+ /** Its rows. At least 1. At most 65535. */
124
+ rows: number;
125
+ }
126
+ /** A command to run: to its end, or started and answered at once (`wait: false`). */
127
+ export interface ExecRequest {
128
+ /** The command: text, run by `bash -lc` (`"npm test"`), or a list, the program and its arguments run without a shell (`["npm", "test"]`). */
129
+ cmd: string | string[];
130
+ /** The directory it runs in; the user's home when omitted. */
131
+ cwd?: string;
132
+ /** Environment variables to add. */
133
+ env?: Record<string, string>;
134
+ /** Bytes sent to its standard input. */
135
+ stdin?: string;
136
+ /** Seconds it may run before it is stopped (`1.5` for 1,500 ms); it runs to its end when omitted or 0. At least 0. */
137
+ timeoutSeconds?: number;
138
+ /** Answer as NDJSON events while it runs (start, stdout, stderr, exit), as `Accept: application/x-ndjson` does. */
139
+ stream?: boolean;
140
+ /** Wait for it to end and return it with its output. False returns it at once, running: read its output with processes.output, send it input with processes.write and signals with processes.signal. Default: true. */
141
+ wait?: boolean;
142
+ /** Keep its standard input open for processes.write; not with stdin, and not with a wait for its end. */
143
+ stdinOpen?: boolean;
144
+ /** How processes.output answers its output. Default: "utf8". */
145
+ outputEncoding?: "utf8" | "base64" | (string & {});
146
+ /** Run it on a terminal of this size: its input, output and controlling terminal; not with a wait for its end. */
147
+ pty?: Terminal;
148
+ /** Who it runs as: `runtime` (uid 1000, with passwordless sudo) or `root`; the sandbox's `user` when omitted. */
149
+ user?: "runtime" | "root" | (string & {});
150
+ }
151
+ /** A process. */
152
+ export interface Process {
153
+ /** Its ID. */
154
+ id: string;
155
+ /** Always `process`. */
156
+ object: "process" | (string & {});
157
+ /** Where it is. */
158
+ state: "running" | "exited" | "killed" | "timed_out" | (string & {});
159
+ /** Its exit code once it exited; negative when a signal ended it. */
160
+ exitCode?: number;
161
+ /** The command it runs. */
162
+ command: string;
163
+ /** The directory it runs in. */
164
+ cwd?: string;
165
+ /** It runs on a terminal. */
166
+ pty: boolean;
167
+ /** Its standard input is open for processes.write. */
168
+ stdinOpen: boolean;
169
+ /** Bytes of input it has taken. */
170
+ stdinOffset: number;
171
+ /** How its output is answered. */
172
+ outputEncoding: "utf8" | "base64" | (string & {});
173
+ /** When it started. */
174
+ startedAt: string;
175
+ /** When it ended. */
176
+ endedAt?: string;
177
+ /** Seconds it may run before it is killed. */
178
+ timeoutSeconds?: number;
179
+ /** Bytes of output it has written: the cursor past its last. */
180
+ outputBytes: number;
181
+ /** The oldest byte of its output still kept. */
182
+ firstOffset: number;
183
+ /** What it wrote to standard output, as UTF-8: given once an exec waited for its end. */
184
+ stdout?: string;
185
+ /** What it wrote to standard error, as UTF-8: given once an exec waited for its end. */
186
+ stderr?: string;
187
+ /** stdout holds only part of what it wrote (its first 1 MiB). */
188
+ stdoutTruncated?: boolean;
189
+ /** stderr holds only part of what it wrote (its first 1 MiB). */
190
+ stderrTruncated?: boolean;
191
+ /** How long it ran, in seconds, to the millisecond, once it ended. */
192
+ durationSeconds?: number;
193
+ }
194
+ /** A file written. */
195
+ export interface FileWritten {
196
+ /** Its path. */
197
+ path: string;
198
+ /** Its size in bytes, after the write. */
199
+ size: number;
200
+ /** Its SHA-256 in hex: given for a file written whole. */
201
+ sha256?: string;
202
+ /** Where the bytes were written: given for a write at an offset. */
203
+ offset?: number;
204
+ }
205
+ /** Some of a process's output. */
206
+ export interface OutputChunk {
207
+ /** Where it starts in the process's output. */
208
+ offset: number;
209
+ /** The stream it was written to. */
210
+ stream: "stdout" | "stderr" | (string & {});
211
+ /** It, as text. */
212
+ text: string;
213
+ /** It, as bytes, when the process answers base64. */
214
+ base64?: string;
215
+ }
216
+ /** A process's output after a cursor. */
217
+ export interface ProcessOutput {
218
+ /** The output, in the order it was written. */
219
+ chunks: OutputChunk[];
220
+ /** The cursor to read on from. */
221
+ nextCursor: number;
222
+ /** Output past the cursor was dropped before it was read. */
223
+ truncated: boolean;
224
+ /** How many bytes were dropped. */
225
+ droppedBytes: number;
226
+ /** The process. */
227
+ process?: Process;
228
+ }
229
+ /** Input to send a process. */
230
+ export interface ProcessInput {
231
+ /** The bytes. */
232
+ data?: string;
233
+ /** Bytes of input sent before these (its stdinOffset): a resend is then never taken twice. They go after every other write when omitted. */
234
+ offset?: number;
235
+ /** Close its input after these (^D on a terminal). */
236
+ eof?: boolean;
237
+ }
238
+ /** Input a process took. */
239
+ export interface ProcessWritten {
240
+ /** Bytes of input it has taken in all. */
241
+ offset: number;
242
+ /** The process. */
243
+ process?: Process;
244
+ }
245
+ /** A signal to send a process and its group. */
246
+ export interface ProcessSignal {
247
+ /** The signal; SIGTERM when omitted. */
248
+ signal?: "SIGINT" | "SIGTERM" | "SIGHUP" | "SIGQUIT" | "SIGUSR1" | "SIGUSR2" | "SIGKILL" | (string & {});
249
+ }
250
+ /** A machine's processes, newest first. */
251
+ export interface ProcessList {
252
+ /** Each process. */
253
+ items: Process[];
254
+ }
255
+ /** A file, a link or a directory to remove. */
256
+ export interface FileRemove {
257
+ /** Its path. */
258
+ path: string;
259
+ /** A directory with its contents; refused for a directory with contents when omitted. */
260
+ recursive?: boolean;
261
+ }
262
+ /** A file, a link or a directory removed. */
263
+ export interface FileRemoved {
264
+ /** Its path. */
265
+ path: string;
266
+ /** It was there and is removed; false when it was missing. */
267
+ removed: boolean;
268
+ }
269
+ /** A path in a sandbox: what is there, if anything. */
270
+ export interface FileInfo {
271
+ /** Its path. */
272
+ path: string;
273
+ /** Something is there. */
274
+ exists: boolean;
275
+ /** Its last part. */
276
+ name?: string;
277
+ /** What it is: `file`, `directory`, `symlink` or `other`. */
278
+ type?: "file" | "directory" | "symlink" | "other" | (string & {});
279
+ /** Its size in bytes. */
280
+ size?: number;
281
+ /** Its permissions, in octal (`0644`). */
282
+ mode?: string;
283
+ /** When it last changed. */
284
+ modifiedAt?: string;
285
+ /** Its owner's user ID. */
286
+ uid?: number;
287
+ /** Its group's ID. */
288
+ gid?: number;
289
+ /** Where a link points. */
290
+ symlinkTarget?: string;
291
+ /** A file's SHA-256 in hex, read from its bytes: given when asked (`sha256=true`). */
292
+ sha256?: string;
293
+ }
294
+ /** What a directory holds, in path order. */
295
+ export interface FileList {
296
+ /** Each entry. */
297
+ items: FileInfo[];
298
+ /** There were more entries than limit. */
299
+ truncated: boolean;
300
+ }
301
+ /** A folder unpacked. */
302
+ export interface FolderUnpacked {
303
+ /** The folder. */
304
+ path: string;
305
+ /** The archive's bytes tar took. */
306
+ received: number;
307
+ }
308
+ /** A folder upload to begin: a tar archive sent in parts, unpacked into a folder as they arrive. */
309
+ export interface FolderUploadBegin {
310
+ /** The folder, absolute and plain, such as `/workspace/app`: made with its parents. */
311
+ path: string;
312
+ /** The archive is gzip-compressed (`.tar.gz`). Default: false. */
313
+ gzip?: boolean;
314
+ /** Who unpacks it: `runtime` or `root`; the machine's `user` when omitted. */
315
+ user?: "runtime" | "root" | (string & {});
316
+ }
317
+ /** A folder upload begun: its parts go to it in order, then its commit. */
318
+ export interface FolderUpload {
319
+ /** Its ID, which its parts, its commit and its abort name. */
320
+ uploadId: string;
321
+ /** The folder it unpacks into. */
322
+ path: string;
323
+ /** The archive is gzip-compressed. */
324
+ gzip: boolean;
325
+ /** The most bytes a part should carry. */
326
+ chunkBytes: number;
327
+ }
328
+ /** A folder upload's part taken. */
329
+ export interface FolderUploadReceived {
330
+ /** The archive's bytes tar has taken so far: the next part's offset. */
331
+ received: number;
332
+ }
333
+ /** A folder upload ended unfinished. */
334
+ export interface FolderUploadAborted {
335
+ /** Always true: tar was stopped; what it unpacked stays. */
336
+ aborted: boolean;
337
+ }
338
+ /** A directory to make. */
339
+ export interface FileMkdir {
340
+ /** Its path. */
341
+ path: string;
342
+ /** Its parents are made too; true when omitted. */
343
+ parents?: boolean;
344
+ }
345
+ /** A directory made. */
346
+ export interface FileMade {
347
+ /** Its path. */
348
+ path: string;
349
+ /** It was made; false when it was there already. */
350
+ created: boolean;
351
+ }
352
+ /** A file, a link or a directory to move. */
353
+ export interface FileRename {
354
+ /** Where it is. */
355
+ from: string;
356
+ /** Where it goes. */
357
+ to: string;
358
+ /** Replace what is at `to`; refused 409 when something is there and this is omitted. */
359
+ overwrite?: boolean;
360
+ /** The file's SHA-256 in hex: only a file whose bytes hash to it moves. With it, a rename sent again after it moved returns the same answer. */
361
+ sha256?: string;
362
+ /** The file's size in bytes: only a file of this size, every byte of it written, moves. At least 0. */
363
+ size?: number;
364
+ }
365
+ /** A file, a link or a directory moved. */
366
+ export interface FileRenamed {
367
+ /** Where it was. */
368
+ from: string;
369
+ /** Where it is now. */
370
+ to: string;
371
+ /** Its size in bytes: given for a move checked by sha256. */
372
+ size?: number;
373
+ /** Its SHA-256 in hex: given for a move checked by sha256. */
374
+ sha256?: string;
375
+ }
376
+ /** A file link to make: an expiring address for one file of a sandbox (or, with `archive`, a folder) that anyone may open with no API key. */
377
+ export interface FileLinkCreate {
378
+ /** The file's absolute path in the sandbox. For GET it must exist when the link is made. */
379
+ path: string;
380
+ /** `GET` (default): a download link. `PUT`: an upload link; the request's body becomes the file. */
381
+ method?: "GET" | "PUT" | (string & {});
382
+ /** How long the link works, in seconds. At least 60. At most 604800. Default: 3600. */
383
+ expiresInSeconds?: number;
384
+ /** Download as this name (`Content-Disposition: attachment`). Without it a picture, video, sound or plain text shows in the browser; anything else downloads. */
385
+ filename?: string;
386
+ /** PUT only: the largest body the link takes, in bytes; 5 GiB by default and at most. At least 0. At most 5368709120. */
387
+ maxBytes?: number;
388
+ /** false: a paused sandbox is not woken for the link, which answers 409 `sandbox_paused`. Unset or true: it is woken. */
389
+ wake?: boolean;
390
+ /** GET only: `path` is a folder, downloaded as a `.tar.gz`. Default: false. */
391
+ archive?: boolean;
392
+ }
393
+ /** A file link. */
394
+ export interface FileLink {
395
+ /** Its address, opened with no key: GET to download, PUT the file's bytes to upload. */
396
+ url: string;
397
+ /** `GET` or `PUT`. */
398
+ method: "GET" | "PUT" | (string & {});
399
+ /** The file's path in the sandbox. */
400
+ path: string;
401
+ /** The sandbox. */
402
+ sandboxId: string;
403
+ /** When it stops working. */
404
+ expiresAt: string;
405
+ /** The name it downloads as. */
406
+ filename?: string;
407
+ /** The largest body an upload link takes. */
408
+ maxBytes?: number;
409
+ /** It downloads a folder as a `.tar.gz`. */
410
+ archive?: boolean;
411
+ }
412
+ /** A sandbox's file links ended. */
413
+ export interface FileLinksRevoked {
414
+ /** The sandbox. */
415
+ sandboxId: string;
416
+ /** When they ended: every link made before it. */
417
+ revokedAt: string;
418
+ }
419
+ /** Where a sandbox may connect out. */
420
+ export interface SandboxNetwork extends NetworkRules {
421
+ /** The sandbox's ID. */
422
+ id: string;
423
+ }
424
+ /** A machine's CPU and memory as its host measures them from the machine's own cgroup, never by a call into the machine, so reading them does not wake it or keep it awake. Either the current reading (over the host's last 5 seconds, with disk and pressure) or one step of a window (averaged over the time the machine ran in it). */
425
+ export interface MetricPoint {
426
+ /** When it was read; for a step, where the step starts. */
427
+ at: string;
428
+ /** Its CPU, as a percent of all its vCPUs (0 to 100). */
429
+ cpuPercent: number;
430
+ /** The same as a number of cores. */
431
+ cpuCores?: number;
432
+ /** Its busiest minute, as a percent of all its vCPUs. */
433
+ cpuPeakPercent?: number;
434
+ /** Percent of the last 10 seconds some task of it waited for a CPU. */
435
+ cpuWaitPercent?: number;
436
+ /** Percent of the last 10 seconds some task of it waited for memory. */
437
+ memoryStallPercent?: number;
438
+ /** Memory it holds, in bytes: its resident memory on its host. */
439
+ memoryBytes: number;
440
+ /** The most memory it has held, in bytes; for a step, its highest minute's average. */
441
+ memoryPeakBytes?: number;
442
+ /** How many measures it is made of: two reads for the reading now; for a step, the minutes the host measured it in. */
443
+ samples: number;
444
+ /** Bytes its disks read a second. */
445
+ diskReadBytesPerSecond?: number;
446
+ /** Bytes its disks wrote a second. */
447
+ diskWriteBytesPerSecond?: number;
448
+ /** Reads its disks completed a second. */
449
+ diskReadOpsPerSecond?: number;
450
+ /** Writes its disks completed a second. */
451
+ diskWriteOpsPerSecond?: number;
452
+ }
453
+ /** A sandbox's CPU and memory over a time window, in steps, and its current reading (with disk and pressure) while it runs. Steps are returned in every state, including paused and stopped. Ranges: `15m` and `1h` in 60-second steps, `6h` in 120-second steps, `24h` in 480-second steps, `7d` and `30d` in 1-hour steps. Defaults to `1h`. */
454
+ export interface MetricsBase {
455
+ /** Its state. */
456
+ state: "starting" | "running" | "paused" | "deleted" | "error" | (string & {});
457
+ /** The window asked for. */
458
+ range: "15m" | "1h" | "6h" | "24h" | "7d" | "30d" | (string & {});
459
+ /** The window's step, in seconds. */
460
+ stepSeconds: number;
461
+ /** Where the window starts: the start of the step that holds the range's start. */
462
+ since: string;
463
+ /** Where it ends: now. */
464
+ until: string;
465
+ /** Its vCPUs. */
466
+ vcpu: number;
467
+ /** Its memory, in bytes. */
468
+ memoryLimitBytes: number;
469
+ /** Its disk, in bytes. */
470
+ diskLimitBytes: number;
471
+ /** The reading taken now; none when it is not running or its host could not read it. */
472
+ latest?: MetricPoint;
473
+ /** The window's steps, oldest first, each averaged over the time the sandbox ran in it. Steps in which it did not run are omitted. A minute appears about a minute after it ends; `latest` holds the current reading. */
474
+ points: MetricPoint[];
475
+ }
476
+ /** A sandbox's metrics. */
477
+ export interface SandboxMetrics extends MetricsBase {
478
+ /** The sandbox's ID. */
479
+ id: string;
480
+ }
481
+ /** Copies of a sandbox to make, as it is now. */
482
+ export interface ForkRequest {
483
+ /** How many. At least 1. At most 100. Default: 1. */
484
+ count?: number;
485
+ /** Its name, for a fork of one. */
486
+ name?: string;
487
+ /** Labels each copy gets. */
488
+ labels?: Record<string, string>;
489
+ /** The secrets each copy gets, by name: only these, never one its source may not use; its source's when omitted. At most 64 items. */
490
+ secrets?: string[];
491
+ /** The most each may cost in all, in US dollars (`"5.00"`): once one has cost that it pauses, as a create's maxCost. When omitted, the least of its key's caps and its source's maxCost. */
492
+ maxCost?: string;
493
+ /** Seconds with nothing happening before each copy pauses, 60 to 86400; 0 never. When omitted, its source's, unless its source never pauses (0): then its product's default, 300 for a sandbox. At least 0. At most 86400. */
494
+ idlePauseSeconds?: number;
495
+ }
496
+ /** The copies a fork made, each running. */
497
+ export interface Forked {
498
+ /** The copies, in the order made. */
499
+ sandboxes: SandboxInfo[];
500
+ }
501
+ /** A snapshot of a sandbox to take. */
502
+ export interface SnapshotRequest {
503
+ /** Its name, unique among the project's snapshots. */
504
+ name?: string;
505
+ /** Labels to find it by. */
506
+ labels?: Record<string, string>;
507
+ /** Keeps its disk alone, synced, as the next version of the image of this name (`name:1`, `name:2`, ...) in place of a snapshot: an image machines are created from, each booting fresh over a disk of its own. Its memory is not kept; name is ignored. */
508
+ image?: string;
509
+ /** With image: the command each machine created from the image starts at every fresh boot; the sandbox's own when omitted. */
510
+ start?: MachineStart;
511
+ }
512
+ /** Stored data: a snapshot, an image or a volume. */
513
+ export interface Stored {
514
+ /** Its ID. */
515
+ id: string;
516
+ /** Its kind: `snapshot`, `image` or `volume`. */
517
+ object: "snapshot" | "image" | "volume" | (string & {});
518
+ /** Its name, unique in its project among its kind. */
519
+ name?: string;
520
+ /** Where it is. */
521
+ state: "making" | "ready" | "failed" | "deleted" | (string & {});
522
+ /** Its labels. */
523
+ labels: Record<string, string>;
524
+ /** What it was made to hold, in bytes. */
525
+ sizeBytes: number;
526
+ /** What it holds now, in bytes. */
527
+ storedBytes: number;
528
+ /** What it was made from (a snapshot's sandbox, an image's base), if anything. */
529
+ parentId?: string;
530
+ /** The machine it is attached to now, if any. */
531
+ attachedTo?: string;
532
+ /** When it was made. */
533
+ createdAt?: string;
534
+ /** An image's version of its name: each build or keep of a name is its next. */
535
+ version?: number;
536
+ /** An image's tags, each `name:tag`. */
537
+ tags?: string[];
538
+ /** Why an image's build failed. */
539
+ error?: string;
540
+ /** When it was deleted: a delete's answer, its state `deleted`. */
541
+ deletedAt?: string;
542
+ }
543
+ /** A change to a machine's settings: each field left out stays as it is. */
544
+ export interface MachineUpdate {
545
+ /** Its name, unique in its project. */
546
+ name?: string;
547
+ /** Its labels, in place of its own; those under `runtime.` are kept. */
548
+ labels?: Record<string, string>;
549
+ /** Seconds with nothing happening before it pauses, 60 to 86400; 0 never. */
550
+ idlePauseSeconds?: number;
551
+ /** Its vCPUs, grown while it runs; a running sandbox's vCPUs only grow. At least 1. */
552
+ vcpu?: number;
553
+ /** Its memory in GB (1 GB is 1,024 MiB), grown while it runs; a running sandbox's memory only grows. At least 1. */
554
+ memoryGB?: number;
555
+ /** Its disk in GB (1 GB is 1,024 MiB), grown while it runs, its file system with it; a disk only grows. At least 1. */
556
+ diskGB?: number;
557
+ /** Who its commands run as from now when a call names no `user`: `runtime` or `root`. Running ones keep theirs. */
558
+ user?: "runtime" | "root" | (string & {});
559
+ /** Environment variables to set, each over its own value, the others kept: the update answers once a running one holds the change (a paused one is given it at its wake), so each process, command and terminal it starts after the answer has them; processes already running keep the environment they started with. At most 32 variables and 32768 bytes of names and values in all, as a create's; values are never answered. */
560
+ env?: Record<string, string>;
561
+ /** Names of environment variables to take out, the same way: gone from the next process it starts; processes already running keep them. */
562
+ removeEnv?: string[];
563
+ /** The most it may cost in all, in US dollars (`"5.00"`), in place of its own: one paused at its old maxCost wakes at its next call under a higher one. */
564
+ maxCost?: string;
565
+ }
566
+ /** One step of an act: a mouse move, click, drag or scroll, typed text, a key chord, or a wait. */
567
+ export interface Action {
568
+ /** What it does: `move` to `x`,`y`; `click` (at `x`,`y` when given, `count` times, with `keys` held); `mouseDown` and `mouseUp` of `button`; `drag` from `x`,`y` to `toX`,`toY`; `scroll` by `dx`,`dy` wheel clicks (at `x`,`y` when given); `type` `text`; `key` the chords in `keys`; `wait` `ms`. */
569
+ type: "move" | "click" | "mouseDown" | "mouseUp" | "drag" | "scroll" | "type" | "key" | "wait" | (string & {});
570
+ /** Pixels from the screen's left edge. At least 0. At most 16384. */
571
+ x?: number;
572
+ /** Pixels from the screen's top edge. At least 0. At most 16384. */
573
+ y?: number;
574
+ /** A drag's end, from the left edge. At least 0. At most 16384. */
575
+ toX?: number;
576
+ /** A drag's end, from the top edge. At least 0. At most 16384. */
577
+ toY?: number;
578
+ /** The mouse button of a click, a drag, a mouseDown or a mouseUp. Default: "left". */
579
+ button?: "left" | "middle" | "right" | (string & {});
580
+ /** A click's count: 2 a double click, 3 a triple click. At least 1. At most 3. Default: 1. */
581
+ count?: number;
582
+ /** A scroll's wheel clicks to the right (negative to the left). At least -100. At most 100. */
583
+ dx?: number;
584
+ /** A scroll's wheel clicks down (negative up). At least -100. At most 100. */
585
+ dy?: number;
586
+ /** The text a `type` types, as it is: any Unicode, newlines and tabs. At most 8192 characters. */
587
+ text?: string;
588
+ /** For `key`, chords pressed in turn, space-separated, each keys joined by `+` in X keysym names (`ctrl+l`, `Return`, `ctrl+shift+t`); for `click` and `scroll`, the modifiers held during it (`shift`, `ctrl+alt`). At most 1000 characters. */
589
+ keys?: string;
590
+ /** A wait's milliseconds. At least 0. At most 10000. */
591
+ ms?: number;
592
+ }
593
+ /** Steps of the mouse and keyboard, run in order as one command. */
594
+ export interface ActRequest {
595
+ /** The steps, in order; the act stops at the first that fails. At least 1 item. At most 100 items. */
596
+ actions: Action[];
597
+ }
598
+ /** A point on the screen, in pixels from its top left corner. */
599
+ export interface Point {
600
+ /** */
601
+ x: number;
602
+ /** */
603
+ y: number;
604
+ }
605
+ /** The screen's size, in pixels. */
606
+ export interface ScreenSize {
607
+ /** */
608
+ width: number;
609
+ /** */
610
+ height: number;
611
+ }
612
+ /** The screen once an act's steps ran. */
613
+ export interface Acted {
614
+ /** Where the mouse is. */
615
+ cursor: Point;
616
+ /** The screen's size. */
617
+ screen: ScreenSize;
618
+ }
619
+ /** A cell to run. */
620
+ export interface RunCode {
621
+ /** The code. At most 1048576 characters. */
622
+ code: string;
623
+ /** Its language: `python`. Default: "python". */
624
+ language?: "python" | (string & {});
625
+ /** The context it runs in, each its own kernel and state, started on its first cell (`a-z`, `0-9`, `-`, at most 63); `default` when omitted. At least 1 character. At most 63 characters. */
626
+ context?: string;
627
+ /** Seconds it may run before it is interrupted, its context kept: 1 to 50, 45 when omitted. Run longer work as a process (exec with `wait: false`). At least 1. At most 50. */
628
+ timeoutSeconds?: number;
629
+ }
630
+ /** One value a cell returned or displayed, in each form it gave. */
631
+ export interface CodeResult {
632
+ /** The cell's own value (its last expression), rather than a display. */
633
+ main: boolean;
634
+ /** As plain text (`text/plain`). */
635
+ text?: string;
636
+ /** As HTML (`text/html`): a table, for a DataFrame. */
637
+ html?: string;
638
+ /** As Markdown (`text/markdown`). */
639
+ markdown?: string;
640
+ /** As JSON text (`application/json`). */
641
+ json?: string;
642
+ /** As a PNG image (`image/png`): a chart. */
643
+ png?: string;
644
+ /** As a JPEG image (`image/jpeg`). */
645
+ jpeg?: string;
646
+ /** As an SVG image (`image/svg+xml`). */
647
+ svg?: string;
648
+ /** As LaTeX (`text/latex`). */
649
+ latex?: string;
650
+ }
651
+ /** The exception a cell raised. */
652
+ export interface CodeError {
653
+ /** Its name (`ZeroDivisionError`). */
654
+ name: string;
655
+ /** Its message. */
656
+ value: string;
657
+ /** Its traceback, as text. */
658
+ traceback: string;
659
+ }
660
+ /** A cell that ran. */
661
+ export interface CodeRun {
662
+ /** The context it ran in. */
663
+ context: string;
664
+ /** Its language. */
665
+ language: "python" | (string & {});
666
+ /** `ok`; `error`, an exception (`error`); `timeout`, interrupted at its time, its context kept. */
667
+ status: "ok" | "error" | "timeout" | (string & {});
668
+ /** Its number in its context, as a notebook counts cells. */
669
+ executionCount?: number;
670
+ /** What it printed. */
671
+ stdout: string;
672
+ /** What it wrote to standard error. */
673
+ stderr: string;
674
+ /** The values it returned and displayed, in order. */
675
+ results: CodeResult[];
676
+ /** The exception it raised. */
677
+ error?: CodeError;
678
+ /** Whether its context's kernel was started for it: its first cell, or one after the kernel ended. */
679
+ started: boolean;
680
+ /** How long it ran, in seconds. */
681
+ durationSeconds: number;
682
+ }
683
+ /** What get takes in its query. */
684
+ export type SandboxGetQuery = {
685
+ /** Seconds to wait, at most 60, for its state to differ from `ifState`; it answers once it does, or as it is when the wait ends. At least 0. At most 60. */
686
+ wait?: number;
687
+ /** The state the caller last read, which `wait` waits for it to leave. */
688
+ ifState?: string;
689
+ };
690
+ /** What list takes in its query. */
691
+ export type SandboxListQuery = {
692
+ /** Only those in these states, comma-separated. */
693
+ state?: string;
694
+ /** Only the sandbox of this name. */
695
+ name?: string;
696
+ /** Only those with every label given (repeat it for several): key:value, or a key for any value. */
697
+ label?: string[];
698
+ /** The most items the page holds. At least 1. At most 200. Default: 50. */
699
+ limit?: number;
700
+ };
701
+ /** What read takes in its query. */
702
+ export type SandboxReadQuery = {
703
+ /** The file's path in the machine. */
704
+ path: string;
705
+ };
706
+ /** What write takes in its query. */
707
+ export type SandboxWriteQuery = {
708
+ /** The file's path in the machine. */
709
+ path: string;
710
+ /** Its mode, in octal (`644`). */
711
+ mode?: string;
712
+ /** Write the bytes into the file in place from this byte, keeping the bytes before and after them (the file is made when there is none); one that fails part way may leave its range written in part, so send it again. Parts of one file may be written so at once and in any order: write them to a new path, then rename it with its size and sha256 to put it in place whole. At least 0. */
713
+ offset?: number;
714
+ /** The bytes' SHA-256 in hex: refused 409 `checksum_mismatch`, the file as it was, when they differ. Not with offset. */
715
+ sha256?: string;
716
+ };
717
+ /** What processOutput takes in its query. */
718
+ export type SandboxProcessOutputQuery = {
719
+ /** Output after this byte. At least 0. Default: 0. */
720
+ cursor?: number;
721
+ /** Seconds to wait for output past the cursor or its exit, at most 8. At least 0. At most 8. */
722
+ waitSeconds?: number;
723
+ /** At most this many bytes. At least 4096. At most 196608. Default: 65536. */
724
+ maxBytes?: number;
725
+ /** Answer as NDJSON events from the cursor until it exits (stdout, stderr, truncated, exit; continue with the cursor to follow on from), as `Accept: application/x-ndjson` does. */
726
+ follow?: boolean;
727
+ };
728
+ /** What stat takes in its query. */
729
+ export type SandboxStatQuery = {
730
+ /** The file's path in the machine. */
731
+ path: string;
732
+ /** Also return a file's SHA-256, read from its bytes: to check a file you put in place (files:rename with sha256) is whole. Default: false. */
733
+ sha256?: boolean;
734
+ };
735
+ /** What listFiles takes in its query. */
736
+ export type SandboxListFilesQuery = {
737
+ /** The directory. Default: "/workspace". */
738
+ path?: string;
739
+ /** How deep to list. At least 1. At most 10. Default: 1. */
740
+ depth?: number;
741
+ /** At most this many entries. At least 1. At most 2000. Default: 2000. */
742
+ limit?: number;
743
+ /** List entries whose names start with a dot. Default: true. */
744
+ hidden?: boolean;
745
+ /** Only entries whose path relative to the directory matches: `*` within a name, `**` across folders, `?` one character, `{a,b}` either (`**\/*.py`); at most 512 characters, 32 wildcards and 64 texts in braces. The listing then reaches as deep as the glob does (10 folders for `**`) unless depth says, and is searched past its first 2,000 entries, up to 50,000. At most 512 characters. */
746
+ glob?: string;
747
+ };
748
+ /** What downloadFolder takes in its query. */
749
+ export type SandboxDownloadFolderQuery = {
750
+ /** The folder, absolute, such as `/workspace/app`. */
751
+ path: string;
752
+ /** Compress the archive with gzip. Default: false. */
753
+ gzip?: boolean;
754
+ /** Who packs it: `runtime` or `root`; the sandbox's `user` when omitted. */
755
+ user?: "runtime" | "root" | (string & {});
756
+ /** Paths in the folder to leave out, relative to it and comma-separated (`node_modules,.cache`): plain names, no wildcards, at most 32. */
757
+ exclude?: string;
758
+ };
759
+ /** What uploadFolder takes in its query. */
760
+ export type SandboxUploadFolderQuery = {
761
+ /** The folder, absolute, such as `/workspace/app`: made with its parents. */
762
+ path: string;
763
+ /** Who unpacks it: `runtime` or `root`; the sandbox's `user` when omitted. */
764
+ user?: "runtime" | "root" | (string & {});
765
+ };
766
+ /** What writeFolderUpload takes in its query. */
767
+ export type SandboxWriteFolderUploadQuery = {
768
+ /** Where the part starts in the archive: at most the bytes received so far. Bytes before them were taken already and are skipped, so a part sent again is never unpacked twice. At least 0. Default: 0. */
769
+ offset?: number;
770
+ };
771
+ /** What metrics takes in its query. */
772
+ export type SandboxMetricsQuery = {
773
+ /** The window: `15m`, `1h`, `6h`, `24h`, `7d` or `30d`. Default: "1h". */
774
+ range?: "15m" | "1h" | "6h" | "24h" | "7d" | "30d" | (string & {});
775
+ };
776
+ /** What screenshot takes in its query. */
777
+ export type SandboxScreenshotQuery = {
778
+ /** `png`, or `jpeg`: smaller and quicker to send, for a model that reads it. Default: "png". */
779
+ format?: "png" | "jpeg" | (string & {});
780
+ /** A jpeg's quality, 1 to 100. At least 1. At most 100. Default: 80. */
781
+ quality?: number;
782
+ };
783
+ /** A sandbox's files. */
784
+ export declare class SandboxFiles {
785
+ #private;
786
+ constructor(client: Sandboxes, id: string);
787
+ /** Returns a file's bytes. */
788
+ read(path: string, query?: Omit<SandboxReadQuery, "path">, options?: RequestOptions): Promise<Uint8Array>;
789
+ /** Writes the request's bytes to a file as they come, of any size (Content-Length required), its folders made: the file whole when they all came, or as it was. With offset, they are written into it in place. */
790
+ write(path: string, data: Uint8Array | string, query?: Omit<SandboxWriteQuery, "path">, options?: RequestOptions): Promise<FileWritten>;
791
+ /** Removes a file, a link or a directory (recursive for one with contents). One missing is success, removed false. */
792
+ remove(path: string, input?: Omit<FileRemove, "path">, options?: RequestOptions): Promise<FileRemoved>;
793
+ /** Returns what is at a path: a file, a directory or a link, or nothing (exists false). With sha256=true, a file's SHA-256 too. */
794
+ stat(path: string, query?: Omit<SandboxStatQuery, "path">, options?: RequestOptions): Promise<FileInfo>;
795
+ /** Lists a directory's entries in path order, to a depth. */
796
+ list(query?: SandboxListFilesQuery, options?: RequestOptions): Promise<FileList>;
797
+ /** Returns a folder as a tar archive (`application/x-tar`, or `application/gzip` with gzip), packed by tar in the sandbox as it streams, of any size; its entries are relative to the folder (`./a.txt`). A folder that fails part way (a file it may not read, or one that changes as it is read) ends as an archive every tar reader refuses, never as a short one that reads whole. At most 4 at once in a sandbox. A paused sandbox is woken first. */
798
+ downloadFolder(path: string, query?: Omit<SandboxDownloadFolderQuery, "path">, options?: RequestOptions): Promise<Uint8Array>;
799
+ /** Unpacks the request's tar archive (gzip-compressed or not, told by its first bytes) into a folder, made with its parents, by tar in the sandbox as the bytes arrive, of any size, nothing of it kept on disk but what tar writes; returns once tar has ended, or 400 `invalid_archive` with what tar said. A paused sandbox is woken first. */
800
+ uploadFolder(path: string, data: Uint8Array | string, query?: Omit<SandboxUploadFolderQuery, "path">, options?: RequestOptions): Promise<FolderUnpacked>;
801
+ /** Begins a folder's upload in parts: tar starts in the sandbox, unpacking into the folder each part as it arrives. Send the parts in order by offset (writeFolderUpload), then commitFolderUpload; an upload no call names for 10 minutes is ended. A paused sandbox is woken first. */
802
+ beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
803
+ /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
804
+ writeFolderUpload(upload: string, data: Uint8Array | string, query?: SandboxWriteFolderUploadQuery, options?: RequestOptions): Promise<FolderUploadReceived>;
805
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
806
+ commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
807
+ /** Stops a folder upload's tar; what it unpacked so far stays. */
808
+ abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
809
+ /** Makes a directory, and its parents unless parents is false. One there already is success, created false. */
810
+ mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
811
+ /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
812
+ rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
813
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. */
814
+ link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
815
+ /** Ends every file link made for a sandbox so far; links made after work. */
816
+ revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
817
+ }
818
+ /** A sandbox's processes. */
819
+ export declare class SandboxProcesses {
820
+ #private;
821
+ constructor(client: Sandboxes, id: string);
822
+ /** Returns a process's output after a cursor, and the cursor to read on from. The latest 1 MiB is kept; truncated says when the cursor fell behind. */
823
+ output(process: string, query?: SandboxProcessOutputQuery, options?: RequestOptions): Promise<ProcessOutput>;
824
+ /** Sends input to a process started with stdinOpen or a pty, and returns how much of its input it has taken. */
825
+ write(process: string, input?: ProcessInput, options?: RequestOptions): Promise<ProcessWritten>;
826
+ /** Sends a signal to a process and its group; a process that ended is not signalled, so a retry is safe. */
827
+ signal(process: string, input?: ProcessSignal, options?: RequestOptions): Promise<Process>;
828
+ /** Lists a sandbox's processes, newest first: those running and those that ended lately. */
829
+ list(options?: RequestOptions): Promise<ProcessList>;
830
+ }
831
+ /** A sandbox's network. */
832
+ export declare class SandboxNetworkCalls {
833
+ #private;
834
+ constructor(client: Sandboxes, id: string);
835
+ /** Returns where a sandbox may connect out. */
836
+ get(options?: RequestOptions): Promise<SandboxNetwork>;
837
+ /** Replaces where a sandbox may connect out, for its next connection and within a second for its open ones: those the new rules refuse are cut. */
838
+ set(input?: NetworkRules, options?: RequestOptions): Promise<SandboxNetwork>;
839
+ }
840
+ /** One of sandboxes: A Linux machine with its own kernel, made in milliseconds, paused with its memory kept when idle and resumed where it was. Its life: running, then idle, then paused, until you delete it. A paused sandbox is kept with its memory and disk until it is deleted: it has no time limit, no retention period and no expiry, and nothing deletes it for its age. Every 30 days a sandbox stays paused with nothing changing it, a `sandbox.still_paused` event is written for its organization. */
841
+ export declare class Sandbox {
842
+ #private;
843
+ /** What it was when last read. */
844
+ info: SandboxInfo;
845
+ readonly files: SandboxFiles;
846
+ readonly processes: SandboxProcesses;
847
+ readonly network: SandboxNetworkCalls;
848
+ constructor(client: Sandboxes, info: SandboxInfo);
849
+ /** Its id. */
850
+ get id(): string;
851
+ /** Returns a sandbox. */
852
+ refresh(query?: SandboxGetQuery, options?: RequestOptions): Promise<this>;
853
+ /** Deletes a sandbox, its memory and its disk. */
854
+ delete(options?: RequestOptions): Promise<SandboxInfo>;
855
+ /** Pauses a sandbox with its memory and disk kept. A call to it resumes it. */
856
+ pause(options?: RequestOptions): Promise<this>;
857
+ /** Resumes a paused sandbox where it was, its memory and processes as they were. */
858
+ resume(options?: RequestOptions): Promise<this>;
859
+ /** Runs a command as a process and returns it once it ended, with its output; with wait false, at once, while it runs. A paused sandbox is resumed first. Asked again with the same Idempotency-Key, it runs nothing more: it returns the first run's process, waiting for its end while it runs. */
860
+ exec(cmd: string | string[], input?: Omit<ExecRequest, "cmd">, options?: RequestOptions): Promise<Process>;
861
+ /** Returns a sandbox's CPU, memory, disks and pressure, as its host reads them from the sandbox's own cgroup over a fifth of a second: never a call into the sandbox, so it does not wake a paused one nor keep one from its idle pause. One that is not running has no reading. */
862
+ metrics(query?: SandboxMetricsQuery, options?: RequestOptions): Promise<SandboxMetrics>;
863
+ /** Copies a sandbox as it is now, memory and disk, into `count` copies of its own, each running on its host. Asked again with the same Idempotency-Key, it returns the same copies. */
864
+ fork(input?: ForkRequest, options?: RequestOptions): Promise<Forked>;
865
+ /** Keeps a sandbox's memory and disk as they are now, a snapshot to start sandboxes from; with `image`, its disk alone as that image's next version. The sandbox runs on. Asked again with the same Idempotency-Key, it returns the same snapshot. */
866
+ snapshot(input?: SnapshotRequest, options?: RequestOptions): Promise<Stored>;
867
+ /** Changes its name, labels, idle pause, maxCost, environment or sizes; each field left out stays as it is. A running one holds a changed environment before this answers (a paused one's at its wake): each process it starts after the answer has it, and its running processes keep the one they started with. Its vCPUs, memory and disk grow while it runs, its commands running on; a smaller size, or a sandbox that is not running, is refused 409 naming why, and nothing is changed. With If-Match, made only while its revision is that one, else 412. */
868
+ update(input?: MachineUpdate, options?: RequestOptions): Promise<this>;
869
+ /** Returns what a sandbox's screen shows now, as `image/png` (or `image/jpeg`): its X display `:1`, whole. Refused 409 `display_not_running` when no display runs. A paused sandbox is resumed first. */
870
+ screenshot(query?: SandboxScreenshotQuery, options?: RequestOptions): Promise<Uint8Array>;
871
+ /** Moves, clicks, drags and scrolls the mouse and types on the keyboard of a sandbox's screen (its X display `:1`), each step in turn as one command, and returns where the mouse is then. It stops at the first step that fails, refused 409 `act_failed` naming it; refused 409 `display_not_running` when no display runs. A paused sandbox is resumed first. */
872
+ act(actions: Action[], input?: Omit<ActRequest, "actions">, options?: RequestOptions): Promise<Acted>;
873
+ /** Runs a cell of Python in a sandbox as a notebook does, in a Jupyter kernel it keeps running for the cell's `context`: variables, imports and functions stay for the next cell. Returns what it printed, its values and displays (text, HTML, images such as charts), and its exception with its traceback. The context's kernel starts on its first cell. A cell past `timeoutSeconds` is interrupted and its context kept. Refused 409 `kernel_not_installed` when the image has no ipykernel. A paused sandbox is resumed first. */
874
+ runCode(code: string, input?: Omit<RunCode, "code">, options?: RequestOptions): Promise<CodeRun>;
875
+ /** Runs a command and yields its output as it is written, stdout and stderr in order; once it ends, wait() returns the process with its exit code. */
876
+ execStream(cmd: string | string[], input?: Omit<ExecRequest, "cmd">, options?: RequestOptions): Stream<OutputChunk, Process>;
877
+ }
878
+ /** A Linux machine with its own kernel, made in milliseconds, paused with its memory kept when idle and resumed where it was. Its life: running, then idle, then paused, until you delete it. A paused sandbox is kept with its memory and disk until it is deleted: it has no time limit, no retention period and no expiry, and nothing deletes it for its age. Every 30 days a sandbox stays paused with nothing changing it, a `sandbox.still_paused` event is written for its organization. */
879
+ export declare class Sandboxes {
880
+ #private;
881
+ constructor(transport: Transport);
882
+ /** Creates a sandbox. Asked again with the same Idempotency-Key, it returns the same sandbox. */
883
+ create(input?: SandboxCreate, options?: RequestOptions): Promise<Sandbox>;
884
+ /** Returns a sandbox. */
885
+ get(id: string, query?: SandboxGetQuery, options?: RequestOptions): Promise<Sandbox>;
886
+ /** Lists the project's sandboxes, newest first. */
887
+ list(query?: SandboxListQuery, options?: RequestOptions): Paginated<SandboxInfo>;
888
+ /** Deletes a sandbox, its memory and its disk. */
889
+ delete(id: string, options?: RequestOptions): Promise<SandboxInfo>;
890
+ /** Pauses a sandbox with its memory and disk kept. A call to it resumes it. */
891
+ pause(id: string, options?: RequestOptions): Promise<SandboxInfo>;
892
+ /** Resumes a paused sandbox where it was, its memory and processes as they were. */
893
+ resume(id: string, options?: RequestOptions): Promise<SandboxInfo>;
894
+ /** Runs a command as a process and returns it once it ended, with its output; with wait false, at once, while it runs. A paused sandbox is resumed first. Asked again with the same Idempotency-Key, it runs nothing more: it returns the first run's process, waiting for its end while it runs. */
895
+ exec(id: string, input: ExecRequest, options?: RequestOptions): Promise<Process>;
896
+ /** Returns a file's bytes. */
897
+ read(id: string, query: SandboxReadQuery, options?: RequestOptions): Promise<Uint8Array>;
898
+ /** Writes the request's bytes to a file as they come, of any size (Content-Length required), its folders made: the file whole when they all came, or as it was. With offset, they are written into it in place. */
899
+ write(id: string, data: Uint8Array | string, query: SandboxWriteQuery, options?: RequestOptions): Promise<FileWritten>;
900
+ /** Returns a process's output after a cursor, and the cursor to read on from. The latest 1 MiB is kept; truncated says when the cursor fell behind. */
901
+ processOutput(id: string, process: string, query?: SandboxProcessOutputQuery, options?: RequestOptions): Promise<ProcessOutput>;
902
+ /** Sends input to a process started with stdinOpen or a pty, and returns how much of its input it has taken. */
903
+ writeProcess(id: string, process: string, input?: ProcessInput, options?: RequestOptions): Promise<ProcessWritten>;
904
+ /** Sends a signal to a process and its group; a process that ended is not signalled, so a retry is safe. */
905
+ signalProcess(id: string, process: string, input?: ProcessSignal, options?: RequestOptions): Promise<Process>;
906
+ /** Lists a sandbox's processes, newest first: those running and those that ended lately. */
907
+ listProcesses(id: string, options?: RequestOptions): Promise<ProcessList>;
908
+ /** Removes a file, a link or a directory (recursive for one with contents). One missing is success, removed false. */
909
+ remove(id: string, input: FileRemove, options?: RequestOptions): Promise<FileRemoved>;
910
+ /** Returns what is at a path: a file, a directory or a link, or nothing (exists false). With sha256=true, a file's SHA-256 too. */
911
+ stat(id: string, query: SandboxStatQuery, options?: RequestOptions): Promise<FileInfo>;
912
+ /** Lists a directory's entries in path order, to a depth. */
913
+ listFiles(id: string, query?: SandboxListFilesQuery, options?: RequestOptions): Promise<FileList>;
914
+ /** Returns a folder as a tar archive (`application/x-tar`, or `application/gzip` with gzip), packed by tar in the sandbox as it streams, of any size; its entries are relative to the folder (`./a.txt`). A folder that fails part way (a file it may not read, or one that changes as it is read) ends as an archive every tar reader refuses, never as a short one that reads whole. At most 4 at once in a sandbox. A paused sandbox is woken first. */
915
+ downloadFolder(id: string, query: SandboxDownloadFolderQuery, options?: RequestOptions): Promise<Uint8Array>;
916
+ /** Unpacks the request's tar archive (gzip-compressed or not, told by its first bytes) into a folder, made with its parents, by tar in the sandbox as the bytes arrive, of any size, nothing of it kept on disk but what tar writes; returns once tar has ended, or 400 `invalid_archive` with what tar said. A paused sandbox is woken first. */
917
+ uploadFolder(id: string, data: Uint8Array | string, query: SandboxUploadFolderQuery, options?: RequestOptions): Promise<FolderUnpacked>;
918
+ /** Begins a folder's upload in parts: tar starts in the sandbox, unpacking into the folder each part as it arrives. Send the parts in order by offset (writeFolderUpload), then commitFolderUpload; an upload no call names for 10 minutes is ended. A paused sandbox is woken first. */
919
+ beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
920
+ /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
921
+ writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: SandboxWriteFolderUploadQuery, options?: RequestOptions): Promise<FolderUploadReceived>;
922
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
923
+ commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
924
+ /** Stops a folder upload's tar; what it unpacked so far stays. */
925
+ abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
926
+ /** Makes a directory, and its parents unless parents is false. One there already is success, created false. */
927
+ mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
928
+ /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
929
+ rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
930
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. */
931
+ link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
932
+ /** Ends every file link made for a sandbox so far; links made after work. */
933
+ revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
934
+ /** Returns where a sandbox may connect out. */
935
+ getNetwork(id: string, options?: RequestOptions): Promise<SandboxNetwork>;
936
+ /** Returns a sandbox's CPU, memory, disks and pressure, as its host reads them from the sandbox's own cgroup over a fifth of a second: never a call into the sandbox, so it does not wake a paused one nor keep one from its idle pause. One that is not running has no reading. */
937
+ metrics(id: string, query?: SandboxMetricsQuery, options?: RequestOptions): Promise<SandboxMetrics>;
938
+ /** Replaces where a sandbox may connect out, for its next connection and within a second for its open ones: those the new rules refuse are cut. */
939
+ setNetwork(id: string, input?: NetworkRules, options?: RequestOptions): Promise<SandboxNetwork>;
940
+ /** Copies a sandbox as it is now, memory and disk, into `count` copies of its own, each running on its host. Asked again with the same Idempotency-Key, it returns the same copies. */
941
+ fork(id: string, input?: ForkRequest, options?: RequestOptions): Promise<Forked>;
942
+ /** Keeps a sandbox's memory and disk as they are now, a snapshot to start sandboxes from; with `image`, its disk alone as that image's next version. The sandbox runs on. Asked again with the same Idempotency-Key, it returns the same snapshot. */
943
+ snapshot(id: string, input?: SnapshotRequest, options?: RequestOptions): Promise<Stored>;
944
+ /** Changes its name, labels, idle pause, maxCost, environment or sizes; each field left out stays as it is. A running one holds a changed environment before this answers (a paused one's at its wake): each process it starts after the answer has it, and its running processes keep the one they started with. Its vCPUs, memory and disk grow while it runs, its commands running on; a smaller size, or a sandbox that is not running, is refused 409 naming why, and nothing is changed. With If-Match, made only while its revision is that one, else 412. */
945
+ update(id: string, input?: MachineUpdate, options?: RequestOptions): Promise<SandboxInfo>;
946
+ /** Returns what a sandbox's screen shows now, as `image/png` (or `image/jpeg`): its X display `:1`, whole. Refused 409 `display_not_running` when no display runs. A paused sandbox is resumed first. */
947
+ screenshot(id: string, query?: SandboxScreenshotQuery, options?: RequestOptions): Promise<Uint8Array>;
948
+ /** Moves, clicks, drags and scrolls the mouse and types on the keyboard of a sandbox's screen (its X display `:1`), each step in turn as one command, and returns where the mouse is then. It stops at the first step that fails, refused 409 `act_failed` naming it; refused 409 `display_not_running` when no display runs. A paused sandbox is resumed first. */
949
+ act(id: string, input: ActRequest, options?: RequestOptions): Promise<Acted>;
950
+ /** Runs a cell of Python in a sandbox as a notebook does, in a Jupyter kernel it keeps running for the cell's `context`: variables, imports and functions stay for the next cell. Returns what it printed, its values and displays (text, HTML, images such as charts), and its exception with its traceback. The context's kernel starts on its first cell. A cell past `timeoutSeconds` is interrupted and its context kept. Refused 409 `kernel_not_installed` when the image has no ipykernel. A paused sandbox is resumed first. */
951
+ runCode(id: string, input: RunCode, options?: RequestOptions): Promise<CodeRun>;
952
+ }