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
package/dist/products/jobs.js
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { JOB_START_SECONDS, JOB_TIMEOUT_SECONDS } from "../api-defaults.js";
|
|
2
|
-
import { Page } from "../page.js";
|
|
3
|
-
import { RuntimeError, ServiceUnavailableError } from "../errors.js";
|
|
4
|
-
/** The size a run gets when `compute` leaves a field out: the sandbox
|
|
5
|
-
* defaults, in the region `us-east`. */
|
|
6
|
-
export const JOB_DEFAULTS = {
|
|
7
|
-
region: "us-east",
|
|
8
|
-
vcpu: 2,
|
|
9
|
-
cpuMode: "shared",
|
|
10
|
-
cpuFloorMillis: 50,
|
|
11
|
-
memoryMiB: 4096,
|
|
12
|
-
diskMiB: 4096,
|
|
13
|
-
timeoutSeconds: JOB_TIMEOUT_SECONDS,
|
|
14
|
-
/** Added to the timeout for the sandbox to start, within the hour. */
|
|
15
|
-
startSeconds: JOB_START_SECONDS,
|
|
16
|
-
};
|
|
17
|
-
/** A run is one sandbox: at most 16 vCPU and 64 GiB, a disk no smaller than
|
|
18
|
-
* the system image and no larger than 400 GiB, and paid for at most an hour. */
|
|
19
|
-
export const JOB_LIMITS = {
|
|
20
|
-
maxVcpu: 16,
|
|
21
|
-
maxMemoryMiB: 65_536,
|
|
22
|
-
minDiskMiB: 3072,
|
|
23
|
-
maxDiskMiB: 409_600,
|
|
24
|
-
maxDurationSeconds: 3600,
|
|
25
|
-
maxAttempts: 5,
|
|
26
|
-
maxSecrets: 16,
|
|
27
|
-
maxVolumes: 4,
|
|
28
|
-
};
|
|
29
|
-
function invalid(message, field) {
|
|
30
|
-
return new RuntimeError({
|
|
31
|
-
message,
|
|
32
|
-
code: "invalid_request",
|
|
33
|
-
status: 0,
|
|
34
|
-
details: { field },
|
|
35
|
-
hint: "Nothing was sent. Fix the field and call again.",
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/** Unix milliseconds from a Date, an ISO time or a number. */
|
|
39
|
-
export function jobTime(at) {
|
|
40
|
-
const ms = at instanceof Date
|
|
41
|
-
? at.getTime()
|
|
42
|
-
: typeof at === "number"
|
|
43
|
-
? at
|
|
44
|
-
: /^\d+$/.test(at)
|
|
45
|
-
? Number(at)
|
|
46
|
-
: Date.parse(at);
|
|
47
|
-
if (!Number.isSafeInteger(ms) || ms < 0)
|
|
48
|
-
throw invalid(`schedule.at must be a time: a Date, an ISO time such as 2026-10-01T03:00:00Z, or Unix milliseconds; got ${String(at)}.`, "schedule.at");
|
|
49
|
-
return ms;
|
|
50
|
-
}
|
|
51
|
-
/** The API's schedule from what `create` and `reschedule` take: `{ at }`,
|
|
52
|
-
* `{ cron, timezone? }` or the raw `{ kind: ... }`. */
|
|
53
|
-
export function jobSchedule(input) {
|
|
54
|
-
const s = (input ?? {});
|
|
55
|
-
if (s.kind === "once" || (s.kind === undefined && s.at !== undefined))
|
|
56
|
-
return { kind: "once", at: jobTime(s.at) };
|
|
57
|
-
if (s.kind === "cron" || (s.kind === undefined && s.cron !== undefined)) {
|
|
58
|
-
const expression = String(s.expression ?? s.cron).trim();
|
|
59
|
-
if (expression.split(/\s+/).length !== 5)
|
|
60
|
-
throw invalid(`A cron schedule has five fields, minute hour day-of-month month day-of-week, such as "0 3 * * *"; got "${expression}".`, "schedule.cron");
|
|
61
|
-
return {
|
|
62
|
-
kind: "cron",
|
|
63
|
-
expression,
|
|
64
|
-
...(s.timezone === undefined ? {} : { timezone: s.timezone }),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
throw invalid("schedule takes { at } or { cron }.", "schedule");
|
|
68
|
-
}
|
|
69
|
-
/** The API's job body from `CreateJob`, with every default filled in and the
|
|
70
|
-
* sandbox's size checked before anything is sent. */
|
|
71
|
-
export function jobBody(input) {
|
|
72
|
-
const schedule = jobSchedule(input.schedule);
|
|
73
|
-
const command = Array.isArray(input.command) ? { argv: input.command } : input.command;
|
|
74
|
-
if (!command?.argv?.length)
|
|
75
|
-
throw invalid('command is an argv array such as ["python3", "job.py"].', "command");
|
|
76
|
-
const timeoutSeconds = input.timeoutSeconds ?? JOB_DEFAULTS.timeoutSeconds;
|
|
77
|
-
const given = input.compute ?? {};
|
|
78
|
-
const vcpu = given.vcpu ?? JOB_DEFAULTS.vcpu;
|
|
79
|
-
const cpuMode = given.cpuMode ?? JOB_DEFAULTS.cpuMode;
|
|
80
|
-
const compute = {
|
|
81
|
-
region: given.region ?? JOB_DEFAULTS.region,
|
|
82
|
-
vcpu,
|
|
83
|
-
cpuMode,
|
|
84
|
-
cpuFloorMillis: given.cpuFloorMillis ??
|
|
85
|
-
(cpuMode === "reserved" ? vcpu * 1000 : Math.min(JOB_DEFAULTS.cpuFloorMillis, vcpu * 1000)),
|
|
86
|
-
memoryMiB: given.memoryMiB ?? JOB_DEFAULTS.memoryMiB,
|
|
87
|
-
diskMiB: given.diskMiB ?? JOB_DEFAULTS.diskMiB,
|
|
88
|
-
durationSeconds: given.durationSeconds ??
|
|
89
|
-
Math.min(JOB_LIMITS.maxDurationSeconds, timeoutSeconds + JOB_DEFAULTS.startSeconds),
|
|
90
|
-
...(given.maxCostMicros === undefined ? {} : { maxCostMicros: given.maxCostMicros }),
|
|
91
|
-
...(given.volumes === undefined ? {} : { volumes: given.volumes }),
|
|
92
|
-
};
|
|
93
|
-
// The API checks each volume is the key's, in the job's region; this
|
|
94
|
-
// catches a malformed list before anything is sent.
|
|
95
|
-
if (compute.volumes !== undefined) {
|
|
96
|
-
const volumes = compute.volumes;
|
|
97
|
-
if (!Array.isArray(volumes) ||
|
|
98
|
-
volumes.length > JOB_LIMITS.maxVolumes ||
|
|
99
|
-
volumes.some((v) => typeof v?.volumeId !== "string" ||
|
|
100
|
-
typeof v.path !== "string" ||
|
|
101
|
-
!v.path.startsWith("/") ||
|
|
102
|
-
(v.mode !== undefined && v.mode !== "rw" && v.mode !== "snapshot")))
|
|
103
|
-
throw invalid(`compute.volumes is at most ${JOB_LIMITS.maxVolumes} of { volumeId, path: "/data", mode?: "rw" | "snapshot" }.`, "compute.volumes");
|
|
104
|
-
}
|
|
105
|
-
if (compute.vcpu > JOB_LIMITS.maxVcpu || compute.memoryMiB > JOB_LIMITS.maxMemoryMiB)
|
|
106
|
-
throw invalid(`A run's sandbox is at most ${JOB_LIMITS.maxVcpu} vCPU and ${JOB_LIMITS.maxMemoryMiB / 1024} GiB of memory; asked for ${compute.vcpu} vCPU and ${compute.memoryMiB} MiB.`, compute.vcpu > JOB_LIMITS.maxVcpu ? "compute.vcpu" : "compute.memoryMiB");
|
|
107
|
-
if (compute.diskMiB < JOB_LIMITS.minDiskMiB)
|
|
108
|
-
throw invalid(`A run's disk is at least ${JOB_LIMITS.minDiskMiB} MiB, the size of the system image; asked for ${compute.diskMiB}.`, "compute.diskMiB");
|
|
109
|
-
if (compute.diskMiB > JOB_LIMITS.maxDiskMiB)
|
|
110
|
-
throw invalid(`A run's disk is at most ${JOB_LIMITS.maxDiskMiB} MiB (${JOB_LIMITS.maxDiskMiB / 1024} GiB); asked for ${compute.diskMiB}.`, "compute.diskMiB");
|
|
111
|
-
if (timeoutSeconds > compute.durationSeconds ||
|
|
112
|
-
compute.durationSeconds > JOB_LIMITS.maxDurationSeconds)
|
|
113
|
-
throw invalid(`timeoutSeconds (${timeoutSeconds}) must fit in the time a run is paid for (compute.durationSeconds ${compute.durationSeconds}), which is at most ${JOB_LIMITS.maxDurationSeconds} seconds.`, "timeoutSeconds");
|
|
114
|
-
return {
|
|
115
|
-
name: input.name,
|
|
116
|
-
schedule,
|
|
117
|
-
compute,
|
|
118
|
-
command,
|
|
119
|
-
timeoutSeconds,
|
|
120
|
-
...(input.retry === undefined ? {} : { retry: input.retry }),
|
|
121
|
-
...(input.secrets === undefined ? {} : { secrets: input.secrets }),
|
|
122
|
-
...(input.maxTotalCostMicros === undefined
|
|
123
|
-
? {}
|
|
124
|
-
: { maxTotalCostMicros: input.maxTotalCostMicros }),
|
|
125
|
-
...(input.image === undefined ? {} : { image: input.image }),
|
|
126
|
-
...(input.alert === undefined ? {} : { alert: input.alert }),
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
/** The API's update body from `UpdateJob`: a command as an argv array is
|
|
130
|
-
* sent as `{ argv }`; the rest as given. */
|
|
131
|
-
export function jobUpdateBody(input) {
|
|
132
|
-
const body = {};
|
|
133
|
-
for (const [field, value] of Object.entries(input))
|
|
134
|
-
if (value !== undefined)
|
|
135
|
-
body[field] = value;
|
|
136
|
-
if (Array.isArray(input.command))
|
|
137
|
-
body.command = { argv: input.command };
|
|
138
|
-
if (!Object.keys(body).length)
|
|
139
|
-
throw invalid("update takes at least one of command, image, compute, secrets, alert, timeoutSeconds, retry or maxTotalCostMicros.", "update");
|
|
140
|
-
return body;
|
|
141
|
-
}
|
|
142
|
-
const enc = encodeURIComponent;
|
|
143
|
-
/** The API answers a product switched off where it runs with 501 (503
|
|
144
|
-
* from an older server) `unavailable` and words that do not name it ("This product is not enabled
|
|
145
|
-
* on this deployment."). This names the product, keeps the code, status and
|
|
146
|
-
* request id, and says no retry will change it. */
|
|
147
|
-
export function switchedOff(product) {
|
|
148
|
-
return (error) => {
|
|
149
|
-
if (error instanceof RuntimeError && error.code === "unavailable")
|
|
150
|
-
throw new ServiceUnavailableError({
|
|
151
|
-
message: `${product} are not enabled on this Runtime API yet.`,
|
|
152
|
-
code: error.code,
|
|
153
|
-
status: error.status,
|
|
154
|
-
hint: `${product} are switched off here for now, so retrying will not help. Tell us you need them: runtime feedback "need ${product.toLowerCase()}".`,
|
|
155
|
-
...(error.requestId ? { requestId: error.requestId } : {}),
|
|
156
|
-
...(error.details ? { details: error.details } : {}),
|
|
157
|
-
cause: error,
|
|
158
|
-
});
|
|
159
|
-
throw error;
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
/** Scheduled jobs: a command run in a fresh sandbox, once or on a cron
|
|
163
|
-
* schedule. Each run is a sandbox, paid for as one: from the free usage first while the run fits the limits without credit, then from credit
|
|
164
|
-
* at the sandbox rates, through the same holds and spending limits.
|
|
165
|
-
*
|
|
166
|
-
* const job = await runtime.jobs.create({
|
|
167
|
-
* name: "nightly-report",
|
|
168
|
-
* schedule: { cron: "0 3 * * *", timezone: "Europe/Berlin" },
|
|
169
|
-
* command: ["python3", "/workspace/report.py"],
|
|
170
|
-
* });
|
|
171
|
-
*
|
|
172
|
-
* When jobs are switched off where you call, every method fails at once with
|
|
173
|
-
* `ServiceUnavailableError` (code `unavailable`, "Jobs are unavailable."),
|
|
174
|
-
* which retrying does not change. */
|
|
175
|
-
export function jobs(transport) {
|
|
176
|
-
const off = switchedOff("Jobs");
|
|
177
|
-
const t = {
|
|
178
|
-
json: (call) => transport.json(call).catch(off),
|
|
179
|
-
};
|
|
180
|
-
const list = async (query = {}, options) => {
|
|
181
|
-
const page = await t.json({ method: "GET", path: "/v1/jobs", query, ...options });
|
|
182
|
-
return new Page(page.items, page.nextCursor, (cursor) => list({ ...query, cursor }, options));
|
|
183
|
-
};
|
|
184
|
-
const runs = async (jobId, query = {}, options) => {
|
|
185
|
-
const page = await t.json({
|
|
186
|
-
method: "GET",
|
|
187
|
-
path: `/v1/jobs/${enc(jobId)}/runs`,
|
|
188
|
-
query,
|
|
189
|
-
...options,
|
|
190
|
-
});
|
|
191
|
-
return new Page(page.items, page.nextCursor, (cursor) => runs(jobId, { ...query, cursor }, options));
|
|
192
|
-
};
|
|
193
|
-
const verb = (id, action, options) => t.json({ method: "POST", path: `/v1/jobs/${enc(id)}:${action}`, body: {}, ...options });
|
|
194
|
-
return {
|
|
195
|
-
/** Schedule a job. Nothing runs until its time comes; a time already past
|
|
196
|
-
* runs at once. Sizes, timeout and region default to a 2 vCPU, 4 GiB
|
|
197
|
-
* sandbox for up to 30 minutes. */
|
|
198
|
-
create: (input, options) => t.json({ method: "POST", path: "/v1/jobs", body: jobBody(input), ...options }),
|
|
199
|
-
/** Your jobs, oldest first. Await for a page, or `for await` for all. */
|
|
200
|
-
list,
|
|
201
|
-
/** Read a Cloud Run job or an AWS Batch job definition, with its
|
|
202
|
-
* schedule, into the jobs that run the same container here, and what
|
|
203
|
-
* could not be carried over. Changes nothing; `runtime jobs import`
|
|
204
|
-
* builds and creates the plan. */
|
|
205
|
-
importPlan: (input, options) => t.json({ method: "POST", path: "/v1/job-imports", body: input, ...options }),
|
|
206
|
-
get: (id, options) => t.json({ method: "GET", path: `/v1/jobs/${enc(id)}`, ...options }),
|
|
207
|
-
/** A job's runs, oldest first: each attempt of each occurrence.
|
|
208
|
-
* `{ order: "newest" }`: newest first, so the last run is one call.
|
|
209
|
-
*
|
|
210
|
-
* const [last] = (await runtime.jobs.runs(job.id, { limit: 1, order: "newest" })).data; */
|
|
211
|
-
runs,
|
|
212
|
-
/** One run by its id. */
|
|
213
|
-
run: (runId, options) => t.json({ method: "GET", path: `/v1/job-runs/${enc(runId)}`, ...options }),
|
|
214
|
-
/** A run's output from `cursor` (a byte offset, 0 by default), at most
|
|
215
|
-
* `limitBytes` (4 to 65536, default 16384). Keep calling with `nextCursor`
|
|
216
|
-
* until `complete`. A run keeps its last 256 KiB. */
|
|
217
|
-
logs: (runId, query = {}, options) => t.json({
|
|
218
|
-
method: "GET",
|
|
219
|
-
path: `/v1/job-runs/${enc(runId)}/logs`,
|
|
220
|
-
query,
|
|
221
|
-
...options,
|
|
222
|
-
}),
|
|
223
|
-
/** Stop scheduling new runs; a run already going finishes. */
|
|
224
|
-
pause: (id, options) => verb(id, "pause", options),
|
|
225
|
-
resume: (id, options) => verb(id, "resume", options),
|
|
226
|
-
/** End the job for good and stop any run in progress. A run that already
|
|
227
|
-
* finished keeps its result. Cancelling again answers the same job. */
|
|
228
|
-
cancel: (id, options) => verb(id, "cancel", options),
|
|
229
|
-
/** Run it now, once, beside its schedule, which does not move. A paused
|
|
230
|
-
* job runs once and stays paused. While a run is starting or going it is
|
|
231
|
-
* refused with `run_in_progress`; a cancelled or finished job with
|
|
232
|
-
* `invalid_state`. The run is in `runs` with `trigger: "manual"`. */
|
|
233
|
-
trigger: (id, options) => verb(id, "trigger", options),
|
|
234
|
-
/** A new schedule, in any form `create` takes: `{ cron, timezone? }` or
|
|
235
|
-
* `{ at }`. The next run is the new schedule's next time; a run going
|
|
236
|
-
* finishes as it began, and a paused job stays paused. */
|
|
237
|
-
reschedule: (id, schedule, options) => t.json({
|
|
238
|
-
method: "POST",
|
|
239
|
-
path: `/v1/jobs/${enc(id)}:reschedule`,
|
|
240
|
-
body: { schedule: jobSchedule(schedule) },
|
|
241
|
-
...options,
|
|
242
|
-
}),
|
|
243
|
-
/** Change a job in place: its command, image, compute, secrets, alert,
|
|
244
|
-
* timeout or retry. Its id, history and schedule stay; a run already
|
|
245
|
-
* started finishes as it began, and the next run is the new job.
|
|
246
|
-
*
|
|
247
|
-
* await runtime.jobs.update(job.id, { image: "hub:latest" });
|
|
248
|
-
* await runtime.jobs.update(job.id, { alert: { afterFailures: 3, email: true } }); */
|
|
249
|
-
update: (id, changes, options) => t.json({
|
|
250
|
-
method: "POST",
|
|
251
|
-
path: `/v1/jobs/${enc(id)}:update`,
|
|
252
|
-
body: jobUpdateBody(changes),
|
|
253
|
-
...options,
|
|
254
|
-
}),
|
|
255
|
-
};
|
|
256
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Usage } from "../types.js";
|
|
2
|
-
import type { RequestOptions, Transport } from "../transport.js";
|
|
3
|
-
/** What this key may do, and the daily spending limit on its agent. Money is
|
|
4
|
-
* integer microdollars in strings (1,000,000 = $1). */
|
|
5
|
-
export type KeyLimits = {
|
|
6
|
-
/** full: every action. read: every read and nothing else (a read-only key).
|
|
7
|
-
* selected: the actions the key names. */
|
|
8
|
-
access: "full" | "read" | "selected" | null;
|
|
9
|
-
daily: {
|
|
10
|
-
/** The most this agent may commit in any 24 hours, or null for no limit. */
|
|
11
|
-
limitMicros: string | null;
|
|
12
|
-
/** Committed in the last 24 hours: charges settled plus money on hold. */
|
|
13
|
-
usedMicros: string;
|
|
14
|
-
/** What is left under the limit now, or null for no limit. */
|
|
15
|
-
remainingMicros: string | null;
|
|
16
|
-
window: "24h";
|
|
17
|
-
};
|
|
18
|
-
/** Machine time the account can still run without credit, the same
|
|
19
|
-
* figures as `usage.get()`'s `trial`, or null when it has none. */
|
|
20
|
-
trial: Usage["trial"];
|
|
21
|
-
/** Every limit the account is held to, with what it uses of each now: the
|
|
22
|
-
* numbers a create past one is refused `quota_exceeded` by (its
|
|
23
|
-
* `details.limit` names the row). Null when they can't be read. */
|
|
24
|
-
account: AccountLimit[] | null;
|
|
25
|
-
/** The account's prepaid credit and how long it lasts. */
|
|
26
|
-
credit: {
|
|
27
|
-
/** Credit left to spend now, in microdollars. */
|
|
28
|
-
availableMicros: string;
|
|
29
|
-
/** What the account spends in a day at this month's pace, or null when
|
|
30
|
-
* nothing has been spent yet. */
|
|
31
|
-
dailyPaceMicros: string | null;
|
|
32
|
-
/** Days the credit lasts at that pace, or null when nothing is being spent. */
|
|
33
|
-
runwayDays: number | null;
|
|
34
|
-
/** `state` is "low" when the runway is under this many days. */
|
|
35
|
-
lowBelowDays: number;
|
|
36
|
-
/** ok: enough. low: under `lowBelowDays` of runway. empty: none left. */
|
|
37
|
-
state: "ok" | "low" | "empty";
|
|
38
|
-
/** owner: a person pays for this account. agent: it was opened with a
|
|
39
|
-
* wallet and no person pays, so its own agent adds credit with
|
|
40
|
-
* `runtime billing topup <usd>`. */
|
|
41
|
-
addedBy: "owner" | "agent";
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/** One of the account's limits, as https://withruntime.com/account/limits shows it. */
|
|
45
|
-
export type AccountLimit = {
|
|
46
|
-
/** `<kind>.<dimension>`: sandbox.count, sandbox.vcpu, sandbox.memory_mib, volume.count… */
|
|
47
|
-
limit: string;
|
|
48
|
-
label: string;
|
|
49
|
-
/** What `max` and `used` count: things, or MiB. */
|
|
50
|
-
unit: "count" | "mib";
|
|
51
|
-
max: number;
|
|
52
|
-
used: number;
|
|
53
|
-
};
|
|
54
|
-
/** `runtime.limits.get()`: whether this key is read-only, what its agent
|
|
55
|
-
* may still spend today, and the account's limits with what it uses of each. An owner sets the limit at
|
|
56
|
-
* https://withruntime.com/account/keys; a key can read it, never change it.
|
|
57
|
-
* Past it, a create, wake, extension or renewal fails with
|
|
58
|
-
* `spending_limit_reached` (HTTP 402). */
|
|
59
|
-
export declare function limits(t: Transport): {
|
|
60
|
-
get: (options?: RequestOptions) => Promise<KeyLimits>;
|
|
61
|
-
};
|
package/dist/products/limits.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** `runtime.limits.get()`: whether this key is read-only, what its agent
|
|
2
|
-
* may still spend today, and the account's limits with what it uses of each. An owner sets the limit at
|
|
3
|
-
* https://withruntime.com/account/keys; a key can read it, never change it.
|
|
4
|
-
* Past it, a create, wake, extension or renewal fails with
|
|
5
|
-
* `spending_limit_reached` (HTTP 402). */
|
|
6
|
-
export function limits(t) {
|
|
7
|
-
return {
|
|
8
|
-
get: (options) => t.json({ method: "GET", path: "/v1/limits", ...options }),
|
|
9
|
-
};
|
|
10
|
-
}
|
package/dist/products/logs.d.ts
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { Page } from "../page.js";
|
|
2
|
-
import type { RequestOptions, Transport } from "../transport.js";
|
|
3
|
-
/** Native logsd hit_json. Nanoseconds stay strings so no precision is lost. */
|
|
4
|
-
export type LogLine = {
|
|
5
|
-
time: string;
|
|
6
|
-
timeUnixNano: string;
|
|
7
|
-
severity: number;
|
|
8
|
-
severityText: string;
|
|
9
|
-
body: unknown;
|
|
10
|
-
labels: Record<string, string>;
|
|
11
|
-
attributes: Record<string, unknown>;
|
|
12
|
-
traceId: string | null;
|
|
13
|
-
spanId: string | null;
|
|
14
|
-
};
|
|
15
|
-
export type LogSearch = {
|
|
16
|
-
query: string;
|
|
17
|
-
start?: string;
|
|
18
|
-
end?: string;
|
|
19
|
-
limit?: number;
|
|
20
|
-
direction?: "forward" | "backward";
|
|
21
|
-
cursor?: string;
|
|
22
|
-
};
|
|
23
|
-
export type LogSearchResult = {
|
|
24
|
-
lines: LogLine[];
|
|
25
|
-
next?: string | null;
|
|
26
|
-
stats: {
|
|
27
|
-
ms: number;
|
|
28
|
-
blocks: number;
|
|
29
|
-
skippedByTime: number;
|
|
30
|
-
skippedByLabels: number;
|
|
31
|
-
skippedByWords: number;
|
|
32
|
-
scanned: number;
|
|
33
|
-
bytesRead: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export type TailGap = {
|
|
37
|
-
gap: true;
|
|
38
|
-
from: string;
|
|
39
|
-
to: string;
|
|
40
|
-
};
|
|
41
|
-
export type TailLine = LogLine & {
|
|
42
|
-
cursor: string;
|
|
43
|
-
gap?: false;
|
|
44
|
-
};
|
|
45
|
-
export type TailEvent = TailLine | TailGap;
|
|
46
|
-
export type LogQuery = {
|
|
47
|
-
query: string;
|
|
48
|
-
time?: string;
|
|
49
|
-
limit?: number;
|
|
50
|
-
direction?: "forward" | "backward";
|
|
51
|
-
};
|
|
52
|
-
export type LogRange = Omit<LogQuery, "time"> & {
|
|
53
|
-
start?: string;
|
|
54
|
-
end?: string;
|
|
55
|
-
step?: string;
|
|
56
|
-
interval?: string;
|
|
57
|
-
};
|
|
58
|
-
export type LokiResult = {
|
|
59
|
-
status: "success";
|
|
60
|
-
data: ({
|
|
61
|
-
resultType: "streams";
|
|
62
|
-
result: {
|
|
63
|
-
stream: Record<string, string>;
|
|
64
|
-
values: [string, string, Record<string, string>?][];
|
|
65
|
-
}[];
|
|
66
|
-
} | {
|
|
67
|
-
resultType: "matrix";
|
|
68
|
-
result: {
|
|
69
|
-
metric: Record<string, string>;
|
|
70
|
-
values: [number, string][];
|
|
71
|
-
}[];
|
|
72
|
-
} | {
|
|
73
|
-
resultType: "vector";
|
|
74
|
-
result: {
|
|
75
|
-
metric: Record<string, string>;
|
|
76
|
-
value: [number, string];
|
|
77
|
-
}[];
|
|
78
|
-
} | {
|
|
79
|
-
resultType: "scalar";
|
|
80
|
-
result: [number, string];
|
|
81
|
-
}) & {
|
|
82
|
-
stats?: Record<string, unknown>;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
export type LabelResult = {
|
|
86
|
-
status: "success";
|
|
87
|
-
data: string[];
|
|
88
|
-
};
|
|
89
|
-
export type ViewInput = {
|
|
90
|
-
name: string;
|
|
91
|
-
labels: Record<string, string>;
|
|
92
|
-
query: string;
|
|
93
|
-
defaultRange?: string;
|
|
94
|
-
};
|
|
95
|
-
export type SavedView = ViewInput & {
|
|
96
|
-
id: string;
|
|
97
|
-
state: string;
|
|
98
|
-
createdAt: string;
|
|
99
|
-
};
|
|
100
|
-
export type AlertInput = {
|
|
101
|
-
name: string;
|
|
102
|
-
labels: Record<string, string>;
|
|
103
|
-
query: string;
|
|
104
|
-
condition: string;
|
|
105
|
-
for: string;
|
|
106
|
-
actions: Record<string, unknown>[];
|
|
107
|
-
};
|
|
108
|
-
export type Alert = AlertInput & {
|
|
109
|
-
id: string;
|
|
110
|
-
state: string;
|
|
111
|
-
createdAt: string;
|
|
112
|
-
};
|
|
113
|
-
/** OTLP/HTTP JSON; the server validates the signal's complete OTLP schema. */
|
|
114
|
-
export type OtlpLogs = {
|
|
115
|
-
resourceLogs: Record<string, unknown>[];
|
|
116
|
-
};
|
|
117
|
-
export type OtlpTraces = {
|
|
118
|
-
resourceSpans: Record<string, unknown>[];
|
|
119
|
-
};
|
|
120
|
-
export type TraceSpan = {
|
|
121
|
-
traceId: string;
|
|
122
|
-
spanId: string;
|
|
123
|
-
parentSpanId?: string;
|
|
124
|
-
name: string;
|
|
125
|
-
startTimeUnixNano: string;
|
|
126
|
-
endTimeUnixNano: string;
|
|
127
|
-
attributes?: {
|
|
128
|
-
key: string;
|
|
129
|
-
value: Record<string, unknown>;
|
|
130
|
-
}[];
|
|
131
|
-
status?: {
|
|
132
|
-
code?: number;
|
|
133
|
-
message?: string;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
export type Trace = {
|
|
137
|
-
resourceSpans: {
|
|
138
|
-
resource?: {
|
|
139
|
-
attributes?: {
|
|
140
|
-
key: string;
|
|
141
|
-
value: Record<string, unknown>;
|
|
142
|
-
}[];
|
|
143
|
-
};
|
|
144
|
-
scopeSpans: {
|
|
145
|
-
spans: TraceSpan[];
|
|
146
|
-
}[];
|
|
147
|
-
}[];
|
|
148
|
-
};
|
|
149
|
-
export type TraceSearchResult = {
|
|
150
|
-
traces: {
|
|
151
|
-
traceID: string;
|
|
152
|
-
rootServiceName: string;
|
|
153
|
-
rootTraceName: string;
|
|
154
|
-
startTimeUnixNano: string;
|
|
155
|
-
durationMs: number;
|
|
156
|
-
}[];
|
|
157
|
-
metrics?: Record<string, unknown>;
|
|
158
|
-
};
|
|
159
|
-
/** Hidden until Logs launches. */
|
|
160
|
-
export declare function logs(t: Transport): {
|
|
161
|
-
search: (body: LogSearch, options?: RequestOptions) => Promise<LogSearchResult>;
|
|
162
|
-
pages(input: LogSearch, options?: RequestOptions): AsyncGenerator<LogSearchResult>;
|
|
163
|
-
/** The record's cursor, not timestamp or text, identifies a line. The
|
|
164
|
-
* server replays strictly after it. An echoed boundary is ignored; two
|
|
165
|
-
* identical lines at different record positions are both delivered. */
|
|
166
|
-
tail(query: string, options?: RequestOptions & {
|
|
167
|
-
cursor?: string;
|
|
168
|
-
start?: string;
|
|
169
|
-
reconnectMs?: number;
|
|
170
|
-
}): AsyncGenerator<TailEvent>;
|
|
171
|
-
query: (query: LogQuery, options?: RequestOptions) => Promise<LokiResult>;
|
|
172
|
-
queryRange: (query: LogRange, options?: RequestOptions) => Promise<LokiResult>;
|
|
173
|
-
labels: (query?: {
|
|
174
|
-
start?: string;
|
|
175
|
-
end?: string;
|
|
176
|
-
}, options?: RequestOptions) => Promise<LabelResult>;
|
|
177
|
-
labelValues: (name: string, query?: {
|
|
178
|
-
start?: string;
|
|
179
|
-
end?: string;
|
|
180
|
-
}, options?: RequestOptions) => Promise<LabelResult>;
|
|
181
|
-
views: {
|
|
182
|
-
create: (body: ViewInput, options?: RequestOptions) => Promise<SavedView>;
|
|
183
|
-
get: (id: string, options?: RequestOptions) => Promise<SavedView>;
|
|
184
|
-
list: (query?: {
|
|
185
|
-
limit?: number;
|
|
186
|
-
cursor?: string;
|
|
187
|
-
}, options?: RequestOptions) => Promise<Page<SavedView>>;
|
|
188
|
-
update: (id: string, body: Partial<ViewInput>, options?: RequestOptions) => Promise<SavedView>;
|
|
189
|
-
delete: (id: string, options?: RequestOptions) => Promise<void>;
|
|
190
|
-
};
|
|
191
|
-
ingest: (body: OtlpLogs, options?: RequestOptions) => Promise<{
|
|
192
|
-
partialSuccess?: {
|
|
193
|
-
rejectedLogRecords?: string;
|
|
194
|
-
rejectedSpans?: string;
|
|
195
|
-
errorMessage?: string;
|
|
196
|
-
};
|
|
197
|
-
}>;
|
|
198
|
-
};
|
|
199
|
-
export declare function traces(t: Transport): {
|
|
200
|
-
get: (id: string, options?: RequestOptions) => Promise<Trace>;
|
|
201
|
-
search: (q: string, options?: RequestOptions) => Promise<TraceSearchResult>;
|
|
202
|
-
tags: (options?: RequestOptions) => Promise<{
|
|
203
|
-
tagNames: string[];
|
|
204
|
-
}>;
|
|
205
|
-
views: {
|
|
206
|
-
create: (body: ViewInput, options?: RequestOptions) => Promise<SavedView>;
|
|
207
|
-
get: (id: string, options?: RequestOptions) => Promise<SavedView>;
|
|
208
|
-
list: (query?: {
|
|
209
|
-
limit?: number;
|
|
210
|
-
cursor?: string;
|
|
211
|
-
}, options?: RequestOptions) => Promise<Page<SavedView>>;
|
|
212
|
-
update: (id: string, body: Partial<ViewInput>, options?: RequestOptions) => Promise<SavedView>;
|
|
213
|
-
delete: (id: string, options?: RequestOptions) => Promise<void>;
|
|
214
|
-
};
|
|
215
|
-
ingest: (body: OtlpTraces, options?: RequestOptions) => Promise<{
|
|
216
|
-
partialSuccess?: {
|
|
217
|
-
rejectedLogRecords?: string;
|
|
218
|
-
rejectedSpans?: string;
|
|
219
|
-
errorMessage?: string;
|
|
220
|
-
};
|
|
221
|
-
}>;
|
|
222
|
-
};
|
|
223
|
-
export declare function alerts(t: Transport): {
|
|
224
|
-
test: (id: string, options?: RequestOptions) => Promise<{
|
|
225
|
-
firing: boolean;
|
|
226
|
-
matches: number;
|
|
227
|
-
}>;
|
|
228
|
-
silence: (id: string, input: {
|
|
229
|
-
until: string;
|
|
230
|
-
reason?: string;
|
|
231
|
-
}, options?: RequestOptions) => Promise<Alert>;
|
|
232
|
-
create: (body: AlertInput, options?: RequestOptions) => Promise<Alert>;
|
|
233
|
-
get: (id: string, options?: RequestOptions) => Promise<Alert>;
|
|
234
|
-
list: (query?: {
|
|
235
|
-
limit?: number;
|
|
236
|
-
cursor?: string;
|
|
237
|
-
}, options?: RequestOptions) => Promise<Page<Alert>>;
|
|
238
|
-
update: (id: string, body: Partial<AlertInput>, options?: RequestOptions) => Promise<Alert>;
|
|
239
|
-
delete: (id: string, options?: RequestOptions) => Promise<void>;
|
|
240
|
-
};
|
|
241
|
-
export type ObservabilityClient = {
|
|
242
|
-
logs: ReturnType<typeof logs>;
|
|
243
|
-
traces: ReturnType<typeof traces>;
|
|
244
|
-
alerts: ReturnType<typeof alerts>;
|
|
245
|
-
};
|