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.
- package/dist/generated/apps.d.ts +309 -0
- package/dist/generated/apps.js +333 -0
- package/dist/generated/audit.d.ts +47 -0
- package/dist/generated/audit.js +14 -0
- package/dist/generated/browsers.d.ts +309 -0
- package/dist/generated/browsers.js +333 -0
- package/dist/generated/builds.d.ts +309 -0
- package/dist/generated/builds.js +333 -0
- package/dist/generated/ci.d.ts +309 -0
- package/dist/generated/ci.js +333 -0
- package/dist/generated/containers.d.ts +309 -0
- package/dist/generated/containers.js +333 -0
- package/dist/generated/desktops.d.ts +309 -0
- package/dist/generated/desktops.js +333 -0
- package/dist/generated/domains.d.ts +80 -0
- package/dist/generated/domains.js +58 -0
- package/dist/generated/egressIps.d.ts +36 -0
- package/dist/generated/egressIps.js +14 -0
- package/dist/generated/events.d.ts +37 -0
- package/dist/generated/events.js +14 -0
- package/dist/generated/feedback.d.ts +44 -0
- package/dist/generated/feedback.js +13 -0
- package/dist/generated/functions.d.ts +309 -0
- package/dist/generated/functions.js +333 -0
- package/dist/generated/identities.d.ts +36 -0
- package/dist/generated/identities.js +22 -0
- package/dist/generated/images.d.ts +200 -0
- package/dist/generated/images.js +65 -0
- package/dist/generated/index.d.ts +143 -0
- package/dist/generated/index.js +184 -0
- package/dist/generated/jobRuns.d.ts +68 -0
- package/dist/generated/jobRuns.js +22 -0
- package/dist/generated/jobs.d.ts +144 -0
- package/dist/generated/jobs.js +85 -0
- package/dist/generated/keys.d.ts +105 -0
- package/dist/generated/keys.js +26 -0
- package/dist/generated/me.d.ts +33 -0
- package/dist/generated/me.js +13 -0
- package/dist/generated/networks.d.ts +32 -0
- package/dist/generated/networks.js +14 -0
- package/dist/generated/notebooks.d.ts +309 -0
- package/dist/generated/notebooks.js +333 -0
- package/dist/generated/otel.d.ts +46 -0
- package/dist/generated/otel.js +22 -0
- package/dist/generated/ports.d.ts +55 -0
- package/dist/generated/ports.js +22 -0
- package/dist/generated/previews.d.ts +86 -0
- package/dist/generated/previews.js +67 -0
- package/dist/generated/projects.d.ts +47 -0
- package/dist/generated/projects.js +26 -0
- package/dist/generated/roles.d.ts +36 -0
- package/dist/generated/roles.js +22 -0
- package/dist/generated/routes.d.ts +3 -0
- package/dist/generated/routes.js +4 -0
- package/dist/generated/runtime.d.ts +176 -0
- package/dist/generated/runtime.js +416 -0
- package/dist/generated/sandboxes.d.ts +952 -0
- package/dist/generated/sandboxes.js +342 -0
- package/dist/generated/secrets.d.ts +116 -0
- package/dist/generated/secrets.js +54 -0
- package/dist/generated/sessions.d.ts +47 -0
- package/dist/generated/sessions.js +17 -0
- package/dist/generated/signing.d.ts +68 -0
- package/dist/generated/signing.js +187 -0
- package/dist/generated/sites.d.ts +309 -0
- package/dist/generated/sites.js +333 -0
- package/dist/generated/snapshots.d.ts +27 -0
- package/dist/generated/snapshots.js +22 -0
- package/dist/generated/tunnels.d.ts +68 -0
- package/dist/generated/tunnels.js +14 -0
- package/dist/generated/usage.d.ts +155 -0
- package/dist/generated/usage.js +17 -0
- package/dist/generated/volumes.d.ts +36 -0
- package/dist/generated/volumes.js +26 -0
- package/dist/generated/webhooks.d.ts +44 -0
- package/dist/generated/webhooks.js +22 -0
- package/dist/generated/workspaces.d.ts +309 -0
- package/dist/generated/workspaces.js +333 -0
- package/dist/v2/cli.d.ts +7 -0
- package/dist/v2/cli.js +283 -0
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.js +4 -0
- package/dist/v2/login.d.ts +35 -0
- package/dist/v2/login.js +225 -0
- package/dist/v2/mcp.d.ts +1 -0
- package/dist/v2/mcp.js +49 -0
- package/dist/v2/openapi.json +75750 -0
- package/dist/v2/shims/base.d.ts +33 -0
- package/dist/v2/shims/base.js +54 -0
- package/dist/v2/shims/blaxel.d.ts +60 -0
- package/dist/v2/shims/blaxel.js +71 -0
- package/dist/v2/shims/cloudflare.d.ts +52 -0
- package/dist/v2/shims/cloudflare.js +55 -0
- package/dist/v2/shims/daytona.d.ts +58 -0
- package/dist/v2/shims/daytona.js +74 -0
- package/dist/v2/shims/e2b.d.ts +142 -0
- package/dist/v2/shims/e2b.js +238 -0
- package/dist/v2/shims/fly.d.ts +6 -0
- package/dist/v2/shims/fly.js +91 -0
- package/dist/v2/shims/modal.d.ts +54 -0
- package/dist/v2/shims/modal.js +79 -0
- package/dist/v2/shims/morph.d.ts +60 -0
- package/dist/v2/shims/morph.js +87 -0
- package/dist/v2/shims/vercel.d.ts +53 -0
- package/dist/v2/shims/vercel.js +90 -0
- package/dist/v2/table.d.ts +53 -0
- package/dist/v2/table.js +122 -0
- package/package.json +20 -310
- package/BLAXEL.md +0 -290
- package/COMPATIBILITY.md +0 -447
- package/DAYTONA.md +0 -237
- package/E2B.md +0 -314
- package/README.md +0 -331
- package/README.src.md +0 -333
- package/VERCEL.md +0 -230
- package/agent-platforms-inventory.json +0 -387
- package/compatibility-lock.json +0 -305
- package/dist/agents/browser.d.ts +0 -12
- package/dist/agents/browser.js +0 -12
- package/dist/agents/index.d.ts +0 -11
- package/dist/agents/index.js +0 -11
- package/dist/agents-cli.d.ts +0 -16
- package/dist/agents-cli.js +0 -1237
- package/dist/agents-deploy.d.ts +0 -196
- package/dist/agents-deploy.js +0 -872
- package/dist/agents-file.d.ts +0 -19
- package/dist/agents-file.js +0 -135
- package/dist/ai/index.d.ts +0 -49
- package/dist/ai/index.js +0 -31
- package/dist/ai-harness/index.d.ts +0 -194
- package/dist/ai-harness/index.js +0 -522
- package/dist/api-defaults.d.ts +0 -17
- package/dist/api-defaults.js +0 -22
- package/dist/apps/index.d.ts +0 -10
- package/dist/apps/index.js +0 -11
- package/dist/apps-cli.d.ts +0 -16
- package/dist/apps-cli.js +0 -1021
- package/dist/billing-cli.d.ts +0 -23
- package/dist/billing-cli.js +0 -264
- package/dist/blaxel/client.d.ts +0 -59
- package/dist/blaxel/client.js +0 -86
- package/dist/blaxel/context.d.ts +0 -59
- package/dist/blaxel/context.js +0 -162
- package/dist/blaxel/errors.d.ts +0 -130
- package/dist/blaxel/errors.js +0 -315
- package/dist/blaxel/filesystem.d.ts +0 -147
- package/dist/blaxel/filesystem.js +0 -585
- package/dist/blaxel/index.d.ts +0 -287
- package/dist/blaxel/index.js +0 -351
- package/dist/blaxel/interpreter.d.ts +0 -71
- package/dist/blaxel/interpreter.js +0 -256
- package/dist/blaxel/lookup.d.ts +0 -39
- package/dist/blaxel/lookup.js +0 -84
- package/dist/blaxel/pagination.d.ts +0 -39
- package/dist/blaxel/pagination.js +0 -88
- package/dist/blaxel/preview.d.ts +0 -136
- package/dist/blaxel/preview.js +0 -304
- package/dist/blaxel/process.d.ts +0 -126
- package/dist/blaxel/process.js +0 -581
- package/dist/blaxel/sandbox.d.ts +0 -198
- package/dist/blaxel/sandbox.js +0 -856
- package/dist/blaxel/session.d.ts +0 -31
- package/dist/blaxel/session.js +0 -136
- package/dist/blaxel/snapshot.d.ts +0 -123
- package/dist/blaxel/snapshot.js +0 -199
- package/dist/blaxel/types.d.ts +0 -145
- package/dist/blaxel/types.js +0 -60
- package/dist/blaxel/unsupported.d.ts +0 -20
- package/dist/blaxel/unsupported.js +0 -32
- package/dist/browser-stub.d.ts +0 -1
- package/dist/browser-stub.js +0 -1
- package/dist/browsers/index.d.ts +0 -9
- package/dist/browsers/index.js +0 -10
- package/dist/browsers-cli.d.ts +0 -13
- package/dist/browsers-cli.js +0 -279
- package/dist/builds/index.d.ts +0 -10
- package/dist/builds/index.js +0 -11
- package/dist/ci/index.d.ts +0 -13
- package/dist/ci/index.js +0 -14
- package/dist/ci-cli.d.ts +0 -20
- package/dist/ci-cli.js +0 -537
- package/dist/ci-import.d.ts +0 -23
- package/dist/ci-import.js +0 -565
- package/dist/claude-agent-sdk/index.d.ts +0 -7
- package/dist/claude-agent-sdk/index.js +0 -65
- package/dist/cli/logs.d.ts +0 -21
- package/dist/cli/logs.js +0 -188
- package/dist/cli-extras.d.ts +0 -39
- package/dist/cli-extras.js +0 -267
- package/dist/cli-name.d.ts +0 -6
- package/dist/cli-name.js +0 -8
- package/dist/cli-update.d.ts +0 -11
- package/dist/cli-update.js +0 -46
- package/dist/cli-words.d.ts +0 -36
- package/dist/cli-words.js +0 -167
- package/dist/cli.d.ts +0 -92
- package/dist/cli.js +0 -5463
- package/dist/client.d.ts +0 -189
- package/dist/client.js +0 -205
- package/dist/cloudflare/errors.d.ts +0 -166
- package/dist/cloudflare/errors.js +0 -183
- package/dist/cloudflare/identity.d.ts +0 -7
- package/dist/cloudflare/identity.js +0 -13
- package/dist/cloudflare/index.d.ts +0 -545
- package/dist/cloudflare/index.js +0 -1106
- package/dist/cloudflare/interpreter.d.ts +0 -119
- package/dist/cloudflare/interpreter.js +0 -232
- package/dist/cloudflare/mime.d.ts +0 -1
- package/dist/cloudflare/mime.js +0 -66
- package/dist/cloudflare/streams.d.ts +0 -46
- package/dist/cloudflare/streams.js +0 -175
- package/dist/cloudflare/types.d.ts +0 -338
- package/dist/cloudflare/types.js +0 -80
- package/dist/cloudflare/watch.d.ts +0 -9
- package/dist/cloudflare/watch.js +0 -24
- package/dist/cloudflare/worker.d.ts +0 -706
- package/dist/cloudflare/worker.js +0 -633
- package/dist/codesandbox/guest-service.d.ts +0 -31
- package/dist/codesandbox/guest-service.js +0 -490
- package/dist/codesandbox/index.d.ts +0 -574
- package/dist/codesandbox/index.js +0 -1747
- package/dist/compat/core.d.ts +0 -58
- package/dist/compat/core.js +0 -267
- package/dist/compat/files.d.ts +0 -27
- package/dist/compat/files.js +0 -157
- package/dist/compat/lease.d.ts +0 -37
- package/dist/compat/lease.js +0 -93
- package/dist/compat/shell.d.ts +0 -4
- package/dist/compat/shell.js +0 -165
- package/dist/containers/index.d.ts +0 -10
- package/dist/containers/index.js +0 -11
- package/dist/credentials.d.ts +0 -71
- package/dist/credentials.js +0 -340
- package/dist/daytona/client.d.ts +0 -48
- package/dist/daytona/client.js +0 -45
- package/dist/daytona/computer-use.d.ts +0 -171
- package/dist/daytona/computer-use.js +0 -382
- package/dist/daytona/context.d.ts +0 -41
- package/dist/daytona/context.js +0 -50
- package/dist/daytona/daytona.d.ts +0 -213
- package/dist/daytona/daytona.js +0 -578
- package/dist/daytona/errors.d.ts +0 -117
- package/dist/daytona/errors.js +0 -201
- package/dist/daytona/filesystem.d.ts +0 -99
- package/dist/daytona/filesystem.js +0 -300
- package/dist/daytona/git.d.ts +0 -33
- package/dist/daytona/git.js +0 -128
- package/dist/daytona/image.d.ts +0 -49
- package/dist/daytona/image.js +0 -146
- package/dist/daytona/index.d.ts +0 -87
- package/dist/daytona/index.js +0 -102
- package/dist/daytona/process.d.ts +0 -143
- package/dist/daytona/process.js +0 -565
- package/dist/daytona/sandbox.d.ts +0 -222
- package/dist/daytona/sandbox.js +0 -505
- package/dist/desktops/index.d.ts +0 -9
- package/dist/desktops/index.js +0 -10
- package/dist/domains/index.d.ts +0 -9
- package/dist/domains/index.js +0 -10
- package/dist/e2b/client.d.ts +0 -76
- package/dist/e2b/client.js +0 -124
- package/dist/e2b/code-interpreter.d.ts +0 -134
- package/dist/e2b/code-interpreter.js +0 -239
- package/dist/e2b/commands.d.ts +0 -135
- package/dist/e2b/commands.js +0 -452
- package/dist/e2b/errors.d.ts +0 -125
- package/dist/e2b/errors.js +0 -247
- package/dist/e2b/filesystem.d.ts +0 -111
- package/dist/e2b/filesystem.js +0 -374
- package/dist/e2b/index.d.ts +0 -35
- package/dist/e2b/index.js +0 -69
- package/dist/e2b/pty.d.ts +0 -24
- package/dist/e2b/pty.js +0 -83
- package/dist/e2b/sandbox.d.ts +0 -248
- package/dist/e2b/sandbox.js +0 -781
- package/dist/e2b/unsupported.d.ts +0 -38
- package/dist/e2b/unsupported.js +0 -48
- package/dist/e2b/users.d.ts +0 -39
- package/dist/e2b/users.js +0 -207
- package/dist/errors.d.ts +0 -100
- package/dist/errors.js +0 -198
- package/dist/file-source.d.ts +0 -16
- package/dist/file-source.js +0 -162
- package/dist/fly/index.d.ts +0 -102
- package/dist/fly/index.js +0 -930
- package/dist/freestyle/index.d.ts +0 -629
- package/dist/freestyle/index.js +0 -1187
- package/dist/functions/index.d.ts +0 -10
- package/dist/functions/index.js +0 -11
- package/dist/identity.d.ts +0 -30
- package/dist/identity.js +0 -141
- package/dist/image-context.d.ts +0 -39
- package/dist/image-context.js +0 -176
- package/dist/images/index.d.ts +0 -9
- package/dist/images/index.js +0 -10
- package/dist/index.d.ts +0 -87
- package/dist/index.js +0 -51
- package/dist/inngest/index.d.ts +0 -96
- package/dist/inngest/index.js +0 -183
- package/dist/ips/index.d.ts +0 -9
- package/dist/ips/index.js +0 -10
- package/dist/jobs/index.d.ts +0 -9
- package/dist/jobs/index.js +0 -10
- package/dist/jobs-code/cron.d.ts +0 -12
- package/dist/jobs-code/cron.js +0 -93
- package/dist/jobs-code/registry.d.ts +0 -31
- package/dist/jobs-code/registry.js +0 -30
- package/dist/jobs-code/runner.d.ts +0 -1
- package/dist/jobs-code/runner.js +0 -74
- package/dist/jobs-deploy.d.ts +0 -22
- package/dist/jobs-deploy.js +0 -247
- package/dist/jobs-import.d.ts +0 -15
- package/dist/jobs-import.js +0 -231
- package/dist/keys.d.ts +0 -55
- package/dist/keys.js +0 -211
- package/dist/login.d.ts +0 -88
- package/dist/login.js +0 -369
- package/dist/machine.d.ts +0 -222
- package/dist/machine.js +0 -578
- package/dist/mcp.d.ts +0 -16
- package/dist/mcp.js +0 -377
- package/dist/modal/index.d.ts +0 -532
- package/dist/modal/index.js +0 -1284
- package/dist/morph/index.d.ts +0 -255
- package/dist/morph/index.js +0 -641
- package/dist/network-cli.d.ts +0 -17
- package/dist/network-cli.js +0 -523
- package/dist/networks/index.d.ts +0 -11
- package/dist/networks/index.js +0 -10
- package/dist/openai-agents/index.d.ts +0 -132
- package/dist/openai-agents/index.js +0 -738
- package/dist/page.d.ts +0 -13
- package/dist/page.js +0 -39
- package/dist/ports/index.d.ts +0 -9
- package/dist/ports/index.js +0 -10
- package/dist/product-names.d.ts +0 -52
- package/dist/product-names.js +0 -174
- package/dist/product-renames.d.ts +0 -103
- package/dist/product-renames.js +0 -189
- package/dist/products/agents.d.ts +0 -935
- package/dist/products/agents.js +0 -581
- package/dist/products/api-keys.d.ts +0 -113
- package/dist/products/api-keys.js +0 -32
- package/dist/products/apps.d.ts +0 -409
- package/dist/products/apps.js +0 -231
- package/dist/products/audit.d.ts +0 -51
- package/dist/products/audit.js +0 -10
- package/dist/products/balancers.d.ts +0 -87
- package/dist/products/balancers.js +0 -8
- package/dist/products/billing.d.ts +0 -76
- package/dist/products/billing.js +0 -26
- package/dist/products/browser.d.ts +0 -73
- package/dist/products/browser.js +0 -29
- package/dist/products/browsers.d.ts +0 -184
- package/dist/products/browsers.js +0 -180
- package/dist/products/builds.d.ts +0 -175
- package/dist/products/builds.js +0 -234
- package/dist/products/ci.d.ts +0 -406
- package/dist/products/ci.js +0 -133
- package/dist/products/containers.d.ts +0 -71
- package/dist/products/containers.js +0 -6
- package/dist/products/desktop.d.ts +0 -141
- package/dist/products/desktop.js +0 -83
- package/dist/products/desktops.d.ts +0 -71
- package/dist/products/desktops.js +0 -27
- package/dist/products/functions.d.ts +0 -2
- package/dist/products/functions.js +0 -5
- package/dist/products/images.d.ts +0 -229
- package/dist/products/images.js +0 -235
- package/dist/products/index.d.ts +0 -84
- package/dist/products/index.js +0 -105
- package/dist/products/interpreter.d.ts +0 -97
- package/dist/products/interpreter.js +0 -106
- package/dist/products/jobs.d.ts +0 -408
- package/dist/products/jobs.js +0 -256
- package/dist/products/limits.d.ts +0 -61
- package/dist/products/limits.js +0 -10
- package/dist/products/logs.d.ts +0 -245
- package/dist/products/logs.js +0 -274
- package/dist/products/mcp.d.ts +0 -88
- package/dist/products/mcp.js +0 -58
- package/dist/products/mounts.d.ts +0 -49
- package/dist/products/mounts.js +0 -21
- package/dist/products/network-products.d.ts +0 -268
- package/dist/products/network-products.js +0 -127
- package/dist/products/network.d.ts +0 -62
- package/dist/products/network.js +0 -19
- package/dist/products/observability.d.ts +0 -264
- package/dist/products/observability.js +0 -123
- package/dist/products/plans.d.ts +0 -133
- package/dist/products/plans.js +0 -24
- package/dist/products/previews.d.ts +0 -70
- package/dist/products/previews.js +0 -39
- package/dist/products/private-network.d.ts +0 -22
- package/dist/products/private-network.js +0 -10
- package/dist/products/queues.d.ts +0 -149
- package/dist/products/queues.js +0 -213
- package/dist/products/referrals.d.ts +0 -50
- package/dist/products/referrals.js +0 -8
- package/dist/products/reservations.d.ts +0 -108
- package/dist/products/reservations.js +0 -41
- package/dist/products/resources.d.ts +0 -55
- package/dist/products/resources.js +0 -122
- package/dist/products/secrets.d.ts +0 -316
- package/dist/products/secrets.js +0 -333
- package/dist/products/signed-requests.d.ts +0 -21
- package/dist/products/signed-requests.js +0 -11
- package/dist/products/sso.d.ts +0 -44
- package/dist/products/sso.js +0 -8
- package/dist/products/streams.d.ts +0 -73
- package/dist/products/streams.js +0 -17
- package/dist/products/switching.d.ts +0 -123
- package/dist/products/switching.js +0 -26
- package/dist/products/tailscale.d.ts +0 -57
- package/dist/products/tailscale.js +0 -17
- package/dist/products/uptime.d.ts +0 -97
- package/dist/products/uptime.js +0 -42
- package/dist/products/volumes.d.ts +0 -190
- package/dist/products/volumes.js +0 -114
- package/dist/products/watch.d.ts +0 -112
- package/dist/products/watch.js +0 -249
- package/dist/proxy.d.ts +0 -30
- package/dist/proxy.js +0 -200
- package/dist/record-cli.d.ts +0 -23
- package/dist/record-cli.js +0 -308
- package/dist/renamed-products.d.ts +0 -38
- package/dist/renamed-products.js +0 -34
- package/dist/resumable.d.ts +0 -32
- package/dist/resumable.js +0 -201
- package/dist/runloop/index.d.ts +0 -333
- package/dist/runloop/index.js +0 -560
- package/dist/runloop/pagination.d.ts +0 -46
- package/dist/runloop/pagination.js +0 -82
- package/dist/runloop/sdk.d.ts +0 -131
- package/dist/runloop/sdk.js +0 -167
- package/dist/runloop/snapshots.d.ts +0 -52
- package/dist/runloop/snapshots.js +0 -244
- package/dist/sandbox.d.ts +0 -371
- package/dist/sandbox.js +0 -1500
- package/dist/sandboxes/index.d.ts +0 -11
- package/dist/sandboxes/index.js +0 -12
- package/dist/sealing.d.ts +0 -6
- package/dist/sealing.js +0 -14
- package/dist/snapshots/index.d.ts +0 -9
- package/dist/snapshots/index.js +0 -11
- package/dist/snapshots.d.ts +0 -82
- package/dist/snapshots.js +0 -65
- package/dist/sprites/index.d.ts +0 -563
- package/dist/sprites/index.js +0 -1370
- package/dist/ssh.d.ts +0 -56
- package/dist/ssh.js +0 -416
- package/dist/switched-off.d.ts +0 -5
- package/dist/switched-off.js +0 -8
- package/dist/tar.d.ts +0 -15
- package/dist/tar.js +0 -526
- package/dist/terminal.d.ts +0 -24
- package/dist/terminal.js +0 -32
- package/dist/tools/index.d.ts +0 -62
- package/dist/tools/index.js +0 -181
- package/dist/transport.d.ts +0 -165
- package/dist/transport.js +0 -883
- package/dist/trigger/index.d.ts +0 -202
- package/dist/trigger/index.js +0 -244
- package/dist/tunnel.d.ts +0 -70
- package/dist/tunnel.js +0 -316
- package/dist/types.d.ts +0 -585
- package/dist/types.js +0 -1
- package/dist/vercel/client.d.ts +0 -40
- package/dist/vercel/client.js +0 -39
- package/dist/vercel/command.d.ts +0 -117
- package/dist/vercel/command.js +0 -391
- package/dist/vercel/errors.d.ts +0 -53
- package/dist/vercel/errors.js +0 -131
- package/dist/vercel/filesystem.d.ts +0 -153
- package/dist/vercel/filesystem.js +0 -297
- package/dist/vercel/index.d.ts +0 -24
- package/dist/vercel/index.js +0 -36
- package/dist/vercel/sandbox-user.d.ts +0 -70
- package/dist/vercel/sandbox-user.js +0 -207
- package/dist/vercel/sandbox.d.ts +0 -372
- package/dist/vercel/sandbox.js +0 -1037
- package/dist/vercel/snapshot.d.ts +0 -94
- package/dist/vercel/snapshot.js +0 -137
- package/dist/volumes/index.d.ts +0 -9
- package/dist/volumes/index.js +0 -10
- package/dist/wait.d.ts +0 -12
- package/dist/wait.js +0 -47
- package/dist/wallet.d.ts +0 -45
- package/dist/wallet.js +0 -56
- package/dist/wireguard.d.ts +0 -7
- 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
|
+
}
|