withruntime 0.49.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 -574
  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,65 @@
1
+ // Generated by spec-gen from engines/front/crates/spec. Do not edit:
2
+ // change the spec and run `cargo run -p runtime-front-spec-gen -- write`.
3
+ import { Paginated, toBytes } from "./runtime.js";
4
+ /** One of images: What a machine boots: a root filesystem, its environment and its start. */
5
+ export class Image {
6
+ #c;
7
+ /** What it was when last read. */
8
+ info;
9
+ constructor(client, info) {
10
+ this.#c = client;
11
+ this.info = info;
12
+ }
13
+ /** Its id. */
14
+ get id() {
15
+ return this.info.id;
16
+ }
17
+ /** Returns an image, by its ID, its name (its newest version) or one of its tags (`name:tag`). */
18
+ async refresh(options) {
19
+ this.info = await (await this.#c.get(this.id, options)).info;
20
+ return this;
21
+ }
22
+ /** Deletes an image version. Sandboxes already started from it keep running. One an App boots from is refused with image_in_use (409) naming the App. */
23
+ delete(options) {
24
+ return this.#c.delete(this.id, options);
25
+ }
26
+ /** Returns an image's build log after a line, as the build writes it and once it has ended. */
27
+ logs(query = {}, options) {
28
+ return this.#c.logs(this.id, query, options);
29
+ }
30
+ }
31
+ /** What a machine boots: a root filesystem, its environment and its start. */
32
+ export class Images {
33
+ #t;
34
+ constructor(transport) {
35
+ this.#t = transport;
36
+ }
37
+ /** Returns an image, by its ID, its name (its newest version) or one of its tags (`name:tag`). */
38
+ async get(id, options) {
39
+ return new Image(this, await this.#t.request("GET", `/v2/images/${encodeURIComponent(id)}`, { options, idempotent: true }));
40
+ }
41
+ /** Lists the project's images, newest first. */
42
+ list(query = {}, options) {
43
+ return new Paginated((cursor) => this.#t.request("GET", `/v2/images`, { query: { ...query, cursor }, options, idempotent: true }));
44
+ }
45
+ /** Returns which chunks of a build context still need uploading. The chunks it holds count as used, so they are kept for the build that names them: a chunk is kept 24 hours after its last use, and an organization's build context holds at most 200 MiB. */
46
+ missing(input, options) {
47
+ return this.#t.request("POST", `/v2/images/context:missing`, { body: input, options, idempotent: true });
48
+ }
49
+ /** Uploads one chunk of a build context: the request's bytes, 1 byte to 1 MiB, named by their SHA-256. Asked again, it stores nothing more. */
50
+ put(digest, data, options) {
51
+ return this.#t.request("PUT", `/v2/images/context/${encodeURIComponent(digest)}`, { data: toBytes(data), options, idempotent: true });
52
+ }
53
+ /** Deletes an image version. Sandboxes already started from it keep running. One an App boots from is refused with image_in_use (409) naming the App. */
54
+ delete(id, options) {
55
+ return this.#t.request("DELETE", `/v2/images/${encodeURIComponent(id)}`, { options });
56
+ }
57
+ /** Builds an image from an OCI image or a Dockerfile on a machine of its own, and returns it at once, `making`: `ready` once built, else `failed` with `error`. Each build of a name is its next version. Asked again with the same Idempotency-Key, it returns the same one. */
58
+ async create(input = {}, options) {
59
+ return new Image(this, await this.#t.request("POST", `/v2/images`, { body: input, options, idempotent: true }));
60
+ }
61
+ /** Returns an image's build log after a line, as the build writes it and once it has ended. */
62
+ logs(id, query = {}, options) {
63
+ return this.#t.request("GET", `/v2/images/${encodeURIComponent(id)}/logs`, { query: { ...query }, options, idempotent: true });
64
+ }
65
+ }
@@ -0,0 +1,143 @@
1
+ import { type ClientOptions, type RequestOptions, Transport } from "./runtime.js";
2
+ import type { Process } from "./sandboxes.js";
3
+ import { Sandboxes } from "./sandboxes.js";
4
+ import { Functions } from "./functions.js";
5
+ import { Secrets } from "./secrets.js";
6
+ import { Apps } from "./apps.js";
7
+ import { Sites } from "./sites.js";
8
+ import { Ci } from "./ci.js";
9
+ import { Browsers } from "./browsers.js";
10
+ import { Desktops } from "./desktops.js";
11
+ import { Notebooks } from "./notebooks.js";
12
+ import { Workspaces } from "./workspaces.js";
13
+ import { Containers } from "./containers.js";
14
+ import { Builds } from "./builds.js";
15
+ import { Jobs } from "./jobs.js";
16
+ import { JobRuns } from "./jobRuns.js";
17
+ import { Snapshots } from "./snapshots.js";
18
+ import { Images } from "./images.js";
19
+ import { Volumes } from "./volumes.js";
20
+ import { Sessions } from "./sessions.js";
21
+ import { Keys } from "./keys.js";
22
+ import { Projects } from "./projects.js";
23
+ import { Identities } from "./identities.js";
24
+ import { Roles } from "./roles.js";
25
+ import { Audit } from "./audit.js";
26
+ import { MeClient } from "./me.js";
27
+ import { UsageClient } from "./usage.js";
28
+ import { Previews } from "./previews.js";
29
+ import { Domains } from "./domains.js";
30
+ import { Ports } from "./ports.js";
31
+ import { EgressIps } from "./egressIps.js";
32
+ import { Tunnels } from "./tunnels.js";
33
+ import { Networks } from "./networks.js";
34
+ import { Webhooks } from "./webhooks.js";
35
+ import { Events } from "./events.js";
36
+ import { Otel } from "./otel.js";
37
+ import { FeedbackClient } from "./feedback.js";
38
+ export * from "./runtime.js";
39
+ export * from "./sandboxes.js";
40
+ export * from "./functions.js";
41
+ export * from "./secrets.js";
42
+ export * from "./apps.js";
43
+ export * from "./sites.js";
44
+ export * from "./ci.js";
45
+ export * from "./browsers.js";
46
+ export * from "./desktops.js";
47
+ export * from "./notebooks.js";
48
+ export * from "./workspaces.js";
49
+ export * from "./containers.js";
50
+ export * from "./builds.js";
51
+ export * from "./jobs.js";
52
+ export * from "./jobRuns.js";
53
+ export * from "./snapshots.js";
54
+ export * from "./images.js";
55
+ export * from "./volumes.js";
56
+ export * from "./sessions.js";
57
+ export * from "./keys.js";
58
+ export * from "./projects.js";
59
+ export * from "./identities.js";
60
+ export * from "./roles.js";
61
+ export * from "./audit.js";
62
+ export * from "./me.js";
63
+ export * from "./usage.js";
64
+ export * from "./previews.js";
65
+ export * from "./domains.js";
66
+ export * from "./ports.js";
67
+ export * from "./egressIps.js";
68
+ export * from "./tunnels.js";
69
+ export * from "./networks.js";
70
+ export * from "./webhooks.js";
71
+ export * from "./events.js";
72
+ export * from "./otel.js";
73
+ export * from "./feedback.js";
74
+ export * from "./routes.js";
75
+ /** What run takes. */
76
+ export interface RunArgs {
77
+ /** The command: text is run by `bash -lc`; a list is the program and its arguments, run without a shell. */
78
+ cmd: string | string[];
79
+ /** The image it boots, by name or ID; Runtime's default image when omitted. */
80
+ image?: string;
81
+ /** Its vCPUs; 2 when omitted. */
82
+ vcpu?: number;
83
+ /** Its memory in GB (1 GB is 1,024 MiB); 4 when omitted. */
84
+ memoryGB?: number;
85
+ /** The directory it runs in; the user's home when omitted. */
86
+ cwd?: string;
87
+ /** Environment variables to add. */
88
+ env?: Record<string, string>;
89
+ /** Bytes sent to its standard input. */
90
+ stdin?: string;
91
+ /** Seconds it may run before it is stopped; it runs to its end when omitted. */
92
+ timeoutSeconds?: number;
93
+ }
94
+ /** Runtime: every product's client over one transport. `new Runtime()` reads
95
+ * RUNTIME_API_KEY; `await runtime.sandboxes.create()` is a sandbox to work in. */
96
+ export declare class Runtime {
97
+ #private;
98
+ readonly transport: Transport;
99
+ readonly sandboxes: Sandboxes;
100
+ readonly functions: Functions;
101
+ readonly secrets: Secrets;
102
+ readonly apps: Apps;
103
+ readonly sites: Sites;
104
+ readonly ci: Ci;
105
+ readonly browsers: Browsers;
106
+ readonly desktops: Desktops;
107
+ readonly notebooks: Notebooks;
108
+ readonly workspaces: Workspaces;
109
+ readonly containers: Containers;
110
+ readonly builds: Builds;
111
+ readonly jobs: Jobs;
112
+ readonly jobRuns: JobRuns;
113
+ readonly snapshots: Snapshots;
114
+ readonly images: Images;
115
+ readonly volumes: Volumes;
116
+ readonly sessions: Sessions;
117
+ readonly keys: Keys;
118
+ readonly projects: Projects;
119
+ readonly identities: Identities;
120
+ readonly roles: Roles;
121
+ readonly audit: Audit;
122
+ readonly me: MeClient;
123
+ readonly usage: UsageClient;
124
+ readonly previews: Previews;
125
+ readonly domains: Domains;
126
+ readonly ports: Ports;
127
+ readonly egressIps: EgressIps;
128
+ readonly tunnels: Tunnels;
129
+ readonly networks: Networks;
130
+ readonly webhooks: Webhooks;
131
+ readonly events: Events;
132
+ readonly otel: Otel;
133
+ readonly feedback: FeedbackClient;
134
+ constructor(options?: ClientOptions);
135
+ /** Calls any verb by its name, `product.verb` (`sandboxes.create`), with
136
+ * its arguments by name: its path's parts, its query's fields and its
137
+ * body's. A verb newer than this SDK is found in the API's own served
138
+ * description, so it is callable before the SDK is updated. */
139
+ call<T = unknown>(name: string, args?: Record<string, unknown>, options?: RequestOptions): Promise<T>;
140
+ /** Runs a command in a new sandbox and deletes the sandbox after, whether the command succeeded or not. Returns the command's result. */
141
+ run(args: RunArgs, options?: RequestOptions): Promise<Process>;
142
+ }
143
+ export default Runtime;
@@ -0,0 +1,184 @@
1
+ // Generated by spec-gen from engines/front/crates/spec. Do not edit:
2
+ // change the spec and run `cargo run -p runtime-front-spec-gen -- write`.
3
+ import { Transport, callRoute, defined, routesOf } from "./runtime.js";
4
+ import { ROUTES } from "./routes.js";
5
+ import { Sandboxes } from "./sandboxes.js";
6
+ import { Functions } from "./functions.js";
7
+ import { Secrets } from "./secrets.js";
8
+ import { Apps } from "./apps.js";
9
+ import { Sites } from "./sites.js";
10
+ import { Ci } from "./ci.js";
11
+ import { Browsers } from "./browsers.js";
12
+ import { Desktops } from "./desktops.js";
13
+ import { Notebooks } from "./notebooks.js";
14
+ import { Workspaces } from "./workspaces.js";
15
+ import { Containers } from "./containers.js";
16
+ import { Builds } from "./builds.js";
17
+ import { Jobs } from "./jobs.js";
18
+ import { JobRuns } from "./jobRuns.js";
19
+ import { Snapshots } from "./snapshots.js";
20
+ import { Images } from "./images.js";
21
+ import { Volumes } from "./volumes.js";
22
+ import { Sessions } from "./sessions.js";
23
+ import { Keys } from "./keys.js";
24
+ import { Projects } from "./projects.js";
25
+ import { Identities } from "./identities.js";
26
+ import { Roles } from "./roles.js";
27
+ import { Audit } from "./audit.js";
28
+ import { MeClient } from "./me.js";
29
+ import { UsageClient } from "./usage.js";
30
+ import { Previews } from "./previews.js";
31
+ import { Domains } from "./domains.js";
32
+ import { Ports } from "./ports.js";
33
+ import { EgressIps } from "./egressIps.js";
34
+ import { Tunnels } from "./tunnels.js";
35
+ import { Networks } from "./networks.js";
36
+ import { Webhooks } from "./webhooks.js";
37
+ import { Events } from "./events.js";
38
+ import { Otel } from "./otel.js";
39
+ import { FeedbackClient } from "./feedback.js";
40
+ export * from "./runtime.js";
41
+ export * from "./sandboxes.js";
42
+ export * from "./functions.js";
43
+ export * from "./secrets.js";
44
+ export * from "./apps.js";
45
+ export * from "./sites.js";
46
+ export * from "./ci.js";
47
+ export * from "./browsers.js";
48
+ export * from "./desktops.js";
49
+ export * from "./notebooks.js";
50
+ export * from "./workspaces.js";
51
+ export * from "./containers.js";
52
+ export * from "./builds.js";
53
+ export * from "./jobs.js";
54
+ export * from "./jobRuns.js";
55
+ export * from "./snapshots.js";
56
+ export * from "./images.js";
57
+ export * from "./volumes.js";
58
+ export * from "./sessions.js";
59
+ export * from "./keys.js";
60
+ export * from "./projects.js";
61
+ export * from "./identities.js";
62
+ export * from "./roles.js";
63
+ export * from "./audit.js";
64
+ export * from "./me.js";
65
+ export * from "./usage.js";
66
+ export * from "./previews.js";
67
+ export * from "./domains.js";
68
+ export * from "./ports.js";
69
+ export * from "./egressIps.js";
70
+ export * from "./tunnels.js";
71
+ export * from "./networks.js";
72
+ export * from "./webhooks.js";
73
+ export * from "./events.js";
74
+ export * from "./otel.js";
75
+ export * from "./feedback.js";
76
+ export * from "./routes.js";
77
+ /** Runtime: every product's client over one transport. `new Runtime()` reads
78
+ * RUNTIME_API_KEY; `await runtime.sandboxes.create()` is a sandbox to work in. */
79
+ export class Runtime {
80
+ transport;
81
+ #served;
82
+ sandboxes;
83
+ functions;
84
+ secrets;
85
+ apps;
86
+ sites;
87
+ ci;
88
+ browsers;
89
+ desktops;
90
+ notebooks;
91
+ workspaces;
92
+ containers;
93
+ builds;
94
+ jobs;
95
+ jobRuns;
96
+ snapshots;
97
+ images;
98
+ volumes;
99
+ sessions;
100
+ keys;
101
+ projects;
102
+ identities;
103
+ roles;
104
+ audit;
105
+ me;
106
+ usage;
107
+ previews;
108
+ domains;
109
+ ports;
110
+ egressIps;
111
+ tunnels;
112
+ networks;
113
+ webhooks;
114
+ events;
115
+ otel;
116
+ feedback;
117
+ constructor(options = {}) {
118
+ this.transport = new Transport(options);
119
+ this.sandboxes = new Sandboxes(this.transport);
120
+ this.functions = new Functions(this.transport);
121
+ this.secrets = new Secrets(this.transport);
122
+ this.apps = new Apps(this.transport);
123
+ this.sites = new Sites(this.transport);
124
+ this.ci = new Ci(this.transport);
125
+ this.browsers = new Browsers(this.transport);
126
+ this.desktops = new Desktops(this.transport);
127
+ this.notebooks = new Notebooks(this.transport);
128
+ this.workspaces = new Workspaces(this.transport);
129
+ this.containers = new Containers(this.transport);
130
+ this.builds = new Builds(this.transport);
131
+ this.jobs = new Jobs(this.transport);
132
+ this.jobRuns = new JobRuns(this.transport);
133
+ this.snapshots = new Snapshots(this.transport);
134
+ this.images = new Images(this.transport);
135
+ this.volumes = new Volumes(this.transport);
136
+ this.sessions = new Sessions(this.transport);
137
+ this.keys = new Keys(this.transport);
138
+ this.projects = new Projects(this.transport);
139
+ this.identities = new Identities(this.transport);
140
+ this.roles = new Roles(this.transport);
141
+ this.audit = new Audit(this.transport);
142
+ this.me = new MeClient(this.transport);
143
+ this.usage = new UsageClient(this.transport);
144
+ this.previews = new Previews(this.transport);
145
+ this.domains = new Domains(this.transport);
146
+ this.ports = new Ports(this.transport);
147
+ this.egressIps = new EgressIps(this.transport);
148
+ this.tunnels = new Tunnels(this.transport);
149
+ this.networks = new Networks(this.transport);
150
+ this.webhooks = new Webhooks(this.transport);
151
+ this.events = new Events(this.transport);
152
+ this.otel = new Otel(this.transport);
153
+ this.feedback = new FeedbackClient(this.transport);
154
+ }
155
+ /** Calls any verb by its name, `product.verb` (`sandboxes.create`), with
156
+ * its arguments by name: its path's parts, its query's fields and its
157
+ * body's. A verb newer than this SDK is found in the API's own served
158
+ * description, so it is callable before the SDK is updated. */
159
+ async call(name, args = {}, options) {
160
+ const route = ROUTES[name] ?? (await this.#routes())[name];
161
+ if (!route)
162
+ throw new TypeError(`No verb ${name}: GET /v2/openapi.json names each.`);
163
+ return (await callRoute(this.transport, route, args, options));
164
+ }
165
+ #routes() {
166
+ this.#served ??= this.transport.request("GET", "/v2/openapi.json", { idempotent: true }).then(routesOf, (e) => {
167
+ this.#served = undefined;
168
+ throw e;
169
+ });
170
+ return this.#served;
171
+ }
172
+ /** Runs a command in a new sandbox and deletes the sandbox after, whether the command succeeded or not. Returns the command's result. */
173
+ async run(args, options) {
174
+ const a0 = await this.call("sandboxes.create", defined({ image: args.image, vcpu: args.vcpu, memoryGB: args.memoryGB }), options);
175
+ try {
176
+ const a1 = await this.call("sandboxes.exec", defined({ id: a0["id"], cmd: args.cmd, cwd: args.cwd, env: args.env, stdin: args.stdin, timeoutSeconds: args.timeoutSeconds }), options);
177
+ return a1;
178
+ }
179
+ finally {
180
+ await this.call("sandboxes.delete", defined({ id: a0["id"] }), options);
181
+ }
182
+ }
183
+ }
184
+ export default Runtime;
@@ -0,0 +1,68 @@
1
+ import type { RequestOptions, Transport } from "./runtime.js";
2
+ import { Paginated } from "./runtime.js";
3
+ import type { OutputChunk } from "./sandboxes.js";
4
+ /** One run of a job: a machine made at one of its times, deleted when its command ended. */
5
+ export interface JobRun {
6
+ /** Its ID. */
7
+ id: string;
8
+ /** Always `job.run`. */
9
+ object: "job.run" | (string & {});
10
+ /** Its job's ID. */
11
+ job: string;
12
+ /** Its machine's state: `starting` and `running` while it runs, `deleted` once it ended, `error` when it failed to start. */
13
+ state: "starting" | "running" | "paused" | "deleted" | "error" | (string & {});
14
+ /** The time it is for: its schedule's, or when it was asked for. */
15
+ at: string;
16
+ /** Its attempt at that time, from 1. */
17
+ attempt: number;
18
+ /** Someone asked for it (`run`), rather than its schedule. */
19
+ manual: boolean;
20
+ /** When it was made. */
21
+ createdAt: string;
22
+ /** When its command ended. */
23
+ endedAt?: string;
24
+ /** Its command's exit code, once it ended; none for one a signal or its timeout ended, or one deleted before its end. */
25
+ exitCode?: number;
26
+ /** It ended with exit code 0. */
27
+ succeeded: boolean;
28
+ /** How many bytes its command wrote, stdout and stderr together. */
29
+ outputBytes?: number;
30
+ }
31
+ /** A run's output, stdout and stderr together in the order written, after a cursor: its last 256 KiB are kept. */
32
+ export interface JobRunOutput {
33
+ /** The output, in the order it was written. */
34
+ chunks: OutputChunk[];
35
+ /** The cursor to read on from. */
36
+ nextCursor: number;
37
+ /** Output before what is kept was dropped, past the cursor. */
38
+ truncated: boolean;
39
+ /** The run ended and nothing is left past the next cursor. */
40
+ complete: boolean;
41
+ }
42
+ /** What list takes in its query. */
43
+ export type JobRunListQuery = {
44
+ /** Its job, by ID. */
45
+ job: string;
46
+ /** `newest` first, or `oldest` first. Default: "oldest". */
47
+ order?: "oldest" | "newest" | (string & {});
48
+ /** The most items the page holds. At least 1. At most 200. Default: 50. */
49
+ limit?: number;
50
+ };
51
+ /** What output takes in its query. */
52
+ export type JobRunOutputQuery = {
53
+ /** Output after this byte. At least 0. Default: 0. */
54
+ cursor?: number;
55
+ /** At most this many bytes. At least 1. At most 262144. Default: 65536. */
56
+ maxBytes?: number;
57
+ };
58
+ /** One run of a job: a machine made at one of its times, deleted when its command ends. Its record (exit code, times, the last 256 KiB of its output) stays readable for 7 days after. */
59
+ export declare class JobRuns {
60
+ #private;
61
+ constructor(transport: Transport);
62
+ /** Lists a job's runs, oldest first unless `order` is `newest`, deleted ones included while their records are kept. */
63
+ list(query: JobRunListQuery, options?: RequestOptions): Paginated<JobRun>;
64
+ /** Returns a run. */
65
+ get(id: string, options?: RequestOptions): Promise<JobRun>;
66
+ /** Returns a run's output after a cursor, stdout and stderr together in the order written, and the cursor to read on from. Its last 256 KiB are kept; truncated says when the cursor fell before them. */
67
+ output(id: string, query?: JobRunOutputQuery, options?: RequestOptions): Promise<JobRunOutput>;
68
+ }
@@ -0,0 +1,22 @@
1
+ // Generated by spec-gen from engines/front/crates/spec. Do not edit:
2
+ // change the spec and run `cargo run -p runtime-front-spec-gen -- write`.
3
+ import { Paginated } from "./runtime.js";
4
+ /** One run of a job: a machine made at one of its times, deleted when its command ends. Its record (exit code, times, the last 256 KiB of its output) stays readable for 7 days after. */
5
+ export class JobRuns {
6
+ #t;
7
+ constructor(transport) {
8
+ this.#t = transport;
9
+ }
10
+ /** Lists a job's runs, oldest first unless `order` is `newest`, deleted ones included while their records are kept. */
11
+ list(query, options) {
12
+ return new Paginated((cursor) => this.#t.request("GET", `/v2/job-runs`, { query: { ...query, cursor }, options, idempotent: true }));
13
+ }
14
+ /** Returns a run. */
15
+ get(id, options) {
16
+ return this.#t.request("GET", `/v2/job-runs/${encodeURIComponent(id)}`, { options, idempotent: true });
17
+ }
18
+ /** Returns a run's output after a cursor, stdout and stderr together in the order written, and the cursor to read on from. Its last 256 KiB are kept; truncated says when the cursor fell before them. */
19
+ output(id, query = {}, options) {
20
+ return this.#t.request("GET", `/v2/job-runs/${encodeURIComponent(id)}/output`, { query: { ...query }, options, idempotent: true });
21
+ }
22
+ }
@@ -0,0 +1,144 @@
1
+ import type { RequestOptions, Transport } from "./runtime.js";
2
+ import { Paginated } from "./runtime.js";
3
+ import type { SandboxRun } from "./sandboxes.js";
4
+ import type { VolumeMount } from "./sandboxes.js";
5
+ /** When a job runs: once, at `at`; or at each time of its `cron` in its `timezone`. One of the two. */
6
+ export interface JobSchedule {
7
+ /** The one time it runs. */
8
+ at?: string;
9
+ /** A cron expression of five fields (minute, hour, day of month, month, day of week), as cron reads them, or `@hourly`, `@daily`, `@weekly`, `@monthly` or `@yearly`. */
10
+ cron?: string;
11
+ /** The IANA timezone its cron's times are in (`America/Denver`), daylight saving included; UTC when omitted. */
12
+ timezone?: string;
13
+ }
14
+ /** How a failed run is run again: a run that ends with an exit code other than 0, or at its timeout. */
15
+ export interface JobRetry {
16
+ /** Attempts in all for one time, the first included; 1 (no retry) when omitted. At least 1. At most 10. Default: 1. */
17
+ maxAttempts?: number;
18
+ /** Seconds from a failed attempt's end to the next. At least 0. At most 86400. Default: 30. */
19
+ backoffSeconds?: number;
20
+ }
21
+ /** Which of its org's secrets each run gets, and under which variables. */
22
+ export interface JobSecrets {
23
+ /** The secrets each run gets in their own variables, by name: only those of them whose scope admits it; [] none. At most 64 items. */
24
+ only?: string[];
25
+ /** Variables each holding the value of one of the org's visible secrets whose scope admits the run, by the secret's name, `only` or not: `{"WEBSITE_TOKEN": "CRON_SECRET"}`. */
26
+ env?: Record<string, string>;
27
+ }
28
+ /** A job's settings: what each of its runs is made with. */
29
+ export interface JobSettings {
30
+ /** When it runs. */
31
+ schedule?: JobSchedule;
32
+ /** The command each run runs; the run ends when it ends. */
33
+ run?: SandboxRun;
34
+ /** How a failed run is run again; never when omitted. */
35
+ retry?: JobRetry;
36
+ /** Which of its org's secrets each run gets; every one whose scope admits it when omitted. */
37
+ secrets?: JobSecrets;
38
+ /** Each run's vCPUs. At least 1. Default: 1. */
39
+ vcpu?: number;
40
+ /** Each run's memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`0.5`). At least 1. Default: 1. */
41
+ memoryGB?: number;
42
+ /** Each run's disk in GB, to the MiB, over a fresh copy of its image. At least 1. Default: 4. */
43
+ diskGB?: number;
44
+ /** The image each run boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
45
+ image?: string;
46
+ /** Who its command runs as: `runtime` (uid 1000, with passwordless sudo) or `root`. Its image's when omitted, else `runtime`. */
47
+ user?: "runtime" | "root" | (string & {});
48
+ /** Volumes each run attaches and mounts, at most one, in the job's project; a run waits while another machine holds it. */
49
+ volumes?: VolumeMount[];
50
+ /** The most one run may cost, in US dollars (`"0.50"`): a run pauses once it has cost that, as a machine at its maxCost does. */
51
+ maxCost?: string;
52
+ }
53
+ /** A job to create: its schedule and run are required. */
54
+ export interface JobCreate extends JobSettings {
55
+ /** Its name, unique in its project. */
56
+ name?: string;
57
+ /** Labels to find it by; each run carries them. */
58
+ labels?: Record<string, string>;
59
+ }
60
+ /** Why a time's run was not made and will not be tried again: the answer its create got. The job waits for its next time; a run made takes it off. */
61
+ export interface JobError {
62
+ /** The time whose run was not made. */
63
+ at: string;
64
+ /** The HTTP status its create was answered with. */
65
+ status: number;
66
+ /** The error's code, as any call's error names it. */
67
+ code: string;
68
+ /** What went wrong. */
69
+ message: string;
70
+ /** The create's request ID, for support. */
71
+ requestId?: string;
72
+ }
73
+ /** A job. */
74
+ export interface JobInfo extends JobSettings {
75
+ /** Its ID. */
76
+ id: string;
77
+ /** Always `job`. */
78
+ object: "job" | (string & {});
79
+ /** Its name, unique in its project. */
80
+ name?: string;
81
+ /** Where it is: `scheduled` (its runs are made at their times), `paused` (none is), `finished` (its one time ran). */
82
+ state: "scheduled" | "paused" | "finished" | "deleted" | (string & {});
83
+ /** Its labels. */
84
+ labels: Record<string, string>;
85
+ /** When its next run is made, or its next retry; none when paused or finished. */
86
+ nextRunAt?: string;
87
+ /** Why its last time's run was not made, when it was refused: that time failed and it waits for its next; none once a run is made. */
88
+ lastError?: JobError;
89
+ /** When it was created. */
90
+ createdAt?: string;
91
+ /** Its revision, changed by every change to it. */
92
+ revision?: number;
93
+ /** When it was deleted: a delete's answer, its state `deleted`. */
94
+ deletedAt?: string;
95
+ }
96
+ /** What list takes in its query. */
97
+ export type JobListQuery = {
98
+ /** Only those with every label given (repeat it for several): key:value, or a key for any value. */
99
+ label?: string[];
100
+ /** The most items the page holds. At least 1. At most 200. Default: 50. */
101
+ limit?: number;
102
+ };
103
+ /** One of jobs: A command run in a fresh machine, once or on a cron schedule in a timezone. Each run is a machine made at its time, deleted when its command ends, and billed as any machine is; its exit code and its last 256 KiB of output are kept. Runs of one job never overlap: a time that comes while one runs is made once it ends, and times missed make one run. */
104
+ export declare class Job {
105
+ #private;
106
+ /** What it was when last read. */
107
+ info: JobInfo;
108
+ constructor(client: Jobs, info: JobInfo);
109
+ /** Its id. */
110
+ get id(): string;
111
+ /** Returns a job. */
112
+ refresh(options?: RequestOptions): Promise<this>;
113
+ /** Deletes a job: no run is made from then on, and a run in flight is ended. Its runs' records stay readable for 7 days. */
114
+ delete(options?: RequestOptions): Promise<JobInfo>;
115
+ /** Pauses a job: no run is made at its times until it is resumed. A run in flight runs to its end. */
116
+ pause(options?: RequestOptions): Promise<this>;
117
+ /** Resumes a paused job: its next run is made at its schedule's next time from now. */
118
+ resume(options?: RequestOptions): Promise<this>;
119
+ /** Changes a job's settings: each one named replaces its own, the rest are kept. Runs made from then on use them; one in flight runs as it was made. A new schedule's next run is at its next time from now. */
120
+ update(input?: JobSettings, options?: RequestOptions): Promise<this>;
121
+ /** Makes a run now, beside its schedule; a paused job stays paused. Refused 409 while a run of it is in flight. Asked again with the same Idempotency-Key, it makes nothing more. */
122
+ run(options?: RequestOptions): Promise<this>;
123
+ }
124
+ /** A command run in a fresh machine, once or on a cron schedule in a timezone. Each run is a machine made at its time, deleted when its command ends, and billed as any machine is; its exit code and its last 256 KiB of output are kept. Runs of one job never overlap: a time that comes while one runs is made once it ends, and times missed make one run. */
125
+ export declare class Jobs {
126
+ #private;
127
+ constructor(transport: Transport);
128
+ /** Creates a job. Its first run is made at its schedule's first time. Asked again with the same Idempotency-Key, it returns the same job. */
129
+ create(input?: JobCreate, options?: RequestOptions): Promise<Job>;
130
+ /** Returns a job. */
131
+ get(id: string, options?: RequestOptions): Promise<Job>;
132
+ /** Lists the project's jobs, newest first. */
133
+ list(query?: JobListQuery, options?: RequestOptions): Paginated<JobInfo>;
134
+ /** Deletes a job: no run is made from then on, and a run in flight is ended. Its runs' records stay readable for 7 days. */
135
+ delete(id: string, options?: RequestOptions): Promise<JobInfo>;
136
+ /** Pauses a job: no run is made at its times until it is resumed. A run in flight runs to its end. */
137
+ pause(id: string, options?: RequestOptions): Promise<JobInfo>;
138
+ /** Resumes a paused job: its next run is made at its schedule's next time from now. */
139
+ resume(id: string, options?: RequestOptions): Promise<JobInfo>;
140
+ /** Changes a job's settings: each one named replaces its own, the rest are kept. Runs made from then on use them; one in flight runs as it was made. A new schedule's next run is at its next time from now. */
141
+ update(id: string, input?: JobSettings, options?: RequestOptions): Promise<JobInfo>;
142
+ /** Makes a run now, beside its schedule; a paused job stays paused. Refused 409 while a run of it is in flight. Asked again with the same Idempotency-Key, it makes nothing more. */
143
+ run(id: string, options?: RequestOptions): Promise<JobInfo>;
144
+ }