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