@agentuity/core 1.0.32 → 1.0.33
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/api/api.d.ts +226 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +635 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/apikey/create.d.ts +33 -0
- package/dist/api/apikey/create.d.ts.map +1 -0
- package/dist/api/apikey/create.js +23 -0
- package/dist/api/apikey/create.js.map +1 -0
- package/dist/api/apikey/delete.d.ts +19 -0
- package/dist/api/apikey/delete.d.ts.map +1 -0
- package/dist/api/apikey/delete.js +19 -0
- package/dist/api/apikey/delete.js.map +1 -0
- package/dist/api/apikey/get.d.ts +45 -0
- package/dist/api/apikey/get.d.ts.map +1 -0
- package/dist/api/apikey/get.js +36 -0
- package/dist/api/apikey/get.js.map +1 -0
- package/dist/api/apikey/index.d.ts +6 -0
- package/dist/api/apikey/index.d.ts.map +1 -0
- package/dist/api/apikey/index.js +6 -0
- package/dist/api/apikey/index.js.map +1 -0
- package/dist/api/apikey/list.d.ts +64 -0
- package/dist/api/apikey/list.d.ts.map +1 -0
- package/dist/api/apikey/list.js +46 -0
- package/dist/api/apikey/list.js.map +1 -0
- package/dist/api/apikey/util.d.ts +23 -0
- package/dist/api/apikey/util.d.ts.map +1 -0
- package/dist/api/apikey/util.js +3 -0
- package/dist/api/apikey/util.js.map +1 -0
- package/dist/api/config.d.ts +20 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +43 -0
- package/dist/api/config.js.map +1 -0
- package/dist/api/db/index.d.ts +5 -0
- package/dist/api/db/index.d.ts.map +1 -0
- package/dist/api/db/index.js +5 -0
- package/dist/api/db/index.js.map +1 -0
- package/dist/api/db/logs.d.ts +70 -0
- package/dist/api/db/logs.d.ts.map +1 -0
- package/dist/api/db/logs.js +59 -0
- package/dist/api/db/logs.js.map +1 -0
- package/dist/api/db/query.d.ts +39 -0
- package/dist/api/db/query.d.ts.map +1 -0
- package/dist/api/db/query.js +49 -0
- package/dist/api/db/query.js.map +1 -0
- package/dist/api/db/tables.d.ts +49 -0
- package/dist/api/db/tables.d.ts.map +1 -0
- package/dist/api/db/tables.js +59 -0
- package/dist/api/db/tables.js.map +1 -0
- package/dist/api/db/util.d.ts +31 -0
- package/dist/api/db/util.d.ts.map +1 -0
- package/dist/api/db/util.js +4 -0
- package/dist/api/db/util.js.map +1 -0
- package/dist/api/env.d.ts +5 -0
- package/dist/api/env.d.ts.map +1 -0
- package/dist/api/env.js +10 -0
- package/dist/api/env.js.map +1 -0
- package/dist/api/eval/get.d.ts +36 -0
- package/dist/api/eval/get.d.ts.map +1 -0
- package/dist/api/eval/get.js +23 -0
- package/dist/api/eval/get.js.map +1 -0
- package/dist/api/eval/index.d.ts +5 -0
- package/dist/api/eval/index.d.ts.map +1 -0
- package/dist/api/eval/index.js +5 -0
- package/dist/api/eval/index.js.map +1 -0
- package/dist/api/eval/list.d.ts +50 -0
- package/dist/api/eval/list.d.ts.map +1 -0
- package/dist/api/eval/list.js +32 -0
- package/dist/api/eval/list.js.map +1 -0
- package/dist/api/eval/run-get.d.ts +48 -0
- package/dist/api/eval/run-get.d.ts.map +1 -0
- package/dist/api/eval/run-get.js +29 -0
- package/dist/api/eval/run-get.js.map +1 -0
- package/dist/api/eval/run-list.d.ts +70 -0
- package/dist/api/eval/run-list.d.ts.map +1 -0
- package/dist/api/eval/run-list.js +42 -0
- package/dist/api/eval/run-list.js.map +1 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/logger.d.ts +7 -0
- package/dist/api/logger.d.ts.map +1 -0
- package/dist/api/logger.js +23 -0
- package/dist/api/logger.js.map +1 -0
- package/dist/api/machine/index.d.ts +3 -0
- package/dist/api/machine/index.d.ts.map +1 -0
- package/dist/api/machine/index.js +3 -0
- package/dist/api/machine/index.js.map +1 -0
- package/dist/api/machine/machine.d.ts +192 -0
- package/dist/api/machine/machine.d.ts.map +1 -0
- package/dist/api/machine/machine.js +109 -0
- package/dist/api/machine/machine.js.map +1 -0
- package/dist/api/machine/util.d.ts +14 -0
- package/dist/api/machine/util.d.ts.map +1 -0
- package/dist/api/machine/util.js +3 -0
- package/dist/api/machine/util.js.map +1 -0
- package/dist/api/org/env-delete.d.ts +23 -0
- package/dist/api/org/env-delete.d.ts.map +1 -0
- package/dist/api/org/env-delete.js +25 -0
- package/dist/api/org/env-delete.js.map +1 -0
- package/dist/api/org/env-get.d.ts +33 -0
- package/dist/api/org/env-get.d.ts.map +1 -0
- package/dist/api/org/env-get.js +26 -0
- package/dist/api/org/env-get.js.map +1 -0
- package/dist/api/org/env-update.d.ts +24 -0
- package/dist/api/org/env-update.d.ts.map +1 -0
- package/dist/api/org/env-update.js +26 -0
- package/dist/api/org/env-update.js.map +1 -0
- package/dist/api/org/index.d.ts +7 -0
- package/dist/api/org/index.d.ts.map +1 -0
- package/dist/api/org/index.js +7 -0
- package/dist/api/org/index.js.map +1 -0
- package/dist/api/org/list.d.ts +27 -0
- package/dist/api/org/list.d.ts.map +1 -0
- package/dist/api/org/list.js +22 -0
- package/dist/api/org/list.js.map +1 -0
- package/dist/api/org/resources.d.ts +141 -0
- package/dist/api/org/resources.d.ts.map +1 -0
- package/dist/api/org/resources.js +97 -0
- package/dist/api/org/resources.js.map +1 -0
- package/dist/api/org/util.d.ts +45 -0
- package/dist/api/org/util.d.ts.map +1 -0
- package/dist/api/org/util.js +4 -0
- package/dist/api/org/util.js.map +1 -0
- package/dist/api/project/agent.d.ts +89 -0
- package/dist/api/project/agent.d.ts.map +1 -0
- package/dist/api/project/agent.js +60 -0
- package/dist/api/project/agent.js.map +1 -0
- package/dist/api/project/create.d.ts +37 -0
- package/dist/api/project/create.d.ts.map +1 -0
- package/dist/api/project/create.js +31 -0
- package/dist/api/project/create.js.map +1 -0
- package/dist/api/project/delete.d.ts +15 -0
- package/dist/api/project/delete.d.ts.map +1 -0
- package/dist/api/project/delete.js +13 -0
- package/dist/api/project/delete.js.map +1 -0
- package/dist/api/project/deploy.d.ts +490 -0
- package/dist/api/project/deploy.d.ts.map +1 -0
- package/dist/api/project/deploy.js +313 -0
- package/dist/api/project/deploy.js.map +1 -0
- package/dist/api/project/deployment.d.ts +237 -0
- package/dist/api/project/deployment.d.ts.map +1 -0
- package/dist/api/project/deployment.js +127 -0
- package/dist/api/project/deployment.js.map +1 -0
- package/dist/api/project/env-delete.d.ts +22 -0
- package/dist/api/project/env-delete.d.ts.map +1 -0
- package/dist/api/project/env-delete.js +29 -0
- package/dist/api/project/env-delete.js.map +1 -0
- package/dist/api/project/env-update.d.ts +31 -0
- package/dist/api/project/env-update.d.ts.map +1 -0
- package/dist/api/project/env-update.js +36 -0
- package/dist/api/project/env-update.js.map +1 -0
- package/dist/api/project/exists.d.ts +25 -0
- package/dist/api/project/exists.d.ts.map +1 -0
- package/dist/api/project/exists.js +45 -0
- package/dist/api/project/exists.js.map +1 -0
- package/dist/api/project/get.d.ts +43 -0
- package/dist/api/project/get.d.ts.map +1 -0
- package/dist/api/project/get.js +36 -0
- package/dist/api/project/get.js.map +1 -0
- package/dist/api/project/hostname.d.ts +25 -0
- package/dist/api/project/hostname.d.ts.map +1 -0
- package/dist/api/project/hostname.js +37 -0
- package/dist/api/project/hostname.js.map +1 -0
- package/dist/api/project/index.d.ts +14 -0
- package/dist/api/project/index.d.ts.map +1 -0
- package/dist/api/project/index.js +14 -0
- package/dist/api/project/index.js.map +1 -0
- package/dist/api/project/list.d.ts +48 -0
- package/dist/api/project/list.d.ts.map +1 -0
- package/dist/api/project/list.js +38 -0
- package/dist/api/project/list.js.map +1 -0
- package/dist/api/project/malware.d.ts +71 -0
- package/dist/api/project/malware.d.ts.map +1 -0
- package/dist/api/project/malware.js +42 -0
- package/dist/api/project/malware.js.map +1 -0
- package/dist/api/project/update-region.d.ts +27 -0
- package/dist/api/project/update-region.d.ts.map +1 -0
- package/dist/api/project/update-region.js +25 -0
- package/dist/api/project/update-region.js.map +1 -0
- package/dist/api/project/util.d.ts +62 -0
- package/dist/api/project/util.d.ts.map +1 -0
- package/dist/api/project/util.js +6 -0
- package/dist/api/project/util.js.map +1 -0
- package/dist/api/queue/analytics.d.ts +250 -0
- package/dist/api/queue/analytics.d.ts.map +1 -0
- package/dist/api/queue/analytics.js +233 -0
- package/dist/api/queue/analytics.js.map +1 -0
- package/dist/api/queue/destinations.d.ts +202 -0
- package/dist/api/queue/destinations.d.ts.map +1 -0
- package/dist/api/queue/destinations.js +168 -0
- package/dist/api/queue/destinations.js.map +1 -0
- package/dist/api/queue/dlq.d.ts +168 -0
- package/dist/api/queue/dlq.d.ts.map +1 -0
- package/dist/api/queue/dlq.js +166 -0
- package/dist/api/queue/dlq.js.map +1 -0
- package/dist/api/queue/index.d.ts +56 -0
- package/dist/api/queue/index.d.ts.map +1 -0
- package/dist/api/queue/index.js +90 -0
- package/dist/api/queue/index.js.map +1 -0
- package/dist/api/queue/messages.d.ts +503 -0
- package/dist/api/queue/messages.d.ts.map +1 -0
- package/dist/api/queue/messages.js +549 -0
- package/dist/api/queue/messages.js.map +1 -0
- package/dist/api/queue/queues.d.ts +226 -0
- package/dist/api/queue/queues.d.ts.map +1 -0
- package/dist/api/queue/queues.js +321 -0
- package/dist/api/queue/queues.js.map +1 -0
- package/dist/api/queue/sources.d.ts +202 -0
- package/dist/api/queue/sources.d.ts.map +1 -0
- package/dist/api/queue/sources.js +202 -0
- package/dist/api/queue/sources.js.map +1 -0
- package/dist/api/queue/types.d.ts +1218 -0
- package/dist/api/queue/types.d.ts.map +1 -0
- package/dist/api/queue/types.js +1002 -0
- package/dist/api/queue/types.js.map +1 -0
- package/dist/api/queue/util.d.ts +278 -0
- package/dist/api/queue/util.d.ts.map +1 -0
- package/dist/api/queue/util.js +233 -0
- package/dist/api/queue/util.js.map +1 -0
- package/dist/api/queue/validation.d.ts +247 -0
- package/dist/api/queue/validation.d.ts.map +1 -0
- package/dist/api/queue/validation.js +513 -0
- package/dist/api/queue/validation.js.map +1 -0
- package/dist/api/queue/websocket.d.ts +172 -0
- package/dist/api/queue/websocket.d.ts.map +1 -0
- package/dist/api/queue/websocket.js +396 -0
- package/dist/api/queue/websocket.js.map +1 -0
- package/dist/api/region/create.d.ts +81 -0
- package/dist/api/region/create.d.ts.map +1 -0
- package/dist/api/region/create.js +177 -0
- package/dist/api/region/create.js.map +1 -0
- package/dist/api/region/delete.d.ts +62 -0
- package/dist/api/region/delete.d.ts.map +1 -0
- package/dist/api/region/delete.js +37 -0
- package/dist/api/region/delete.js.map +1 -0
- package/dist/api/region/index.d.ts +5 -0
- package/dist/api/region/index.d.ts.map +1 -0
- package/dist/api/region/index.js +5 -0
- package/dist/api/region/index.js.map +1 -0
- package/dist/api/region/list.d.ts +27 -0
- package/dist/api/region/list.d.ts.map +1 -0
- package/dist/api/region/list.js +22 -0
- package/dist/api/region/list.js.map +1 -0
- package/dist/api/region/resources.d.ts +71 -0
- package/dist/api/region/resources.d.ts.map +1 -0
- package/dist/api/region/resources.js +53 -0
- package/dist/api/region/resources.js.map +1 -0
- package/dist/api/region/util.d.ts +23 -0
- package/dist/api/region/util.d.ts.map +1 -0
- package/dist/api/region/util.js +3 -0
- package/dist/api/region/util.js.map +1 -0
- package/dist/api/sandbox/cli-list.d.ts +114 -0
- package/dist/api/sandbox/cli-list.d.ts.map +1 -0
- package/dist/api/sandbox/cli-list.js +71 -0
- package/dist/api/sandbox/cli-list.js.map +1 -0
- package/dist/api/sandbox/client.d.ts +192 -0
- package/dist/api/sandbox/client.d.ts.map +1 -0
- package/dist/api/sandbox/client.js +262 -0
- package/dist/api/sandbox/client.js.map +1 -0
- package/dist/api/sandbox/create.d.ts +118 -0
- package/dist/api/sandbox/create.d.ts.map +1 -0
- package/dist/api/sandbox/create.js +211 -0
- package/dist/api/sandbox/create.js.map +1 -0
- package/dist/api/sandbox/destroy.d.ts +22 -0
- package/dist/api/sandbox/destroy.d.ts.map +1 -0
- package/dist/api/sandbox/destroy.js +25 -0
- package/dist/api/sandbox/destroy.js.map +1 -0
- package/dist/api/sandbox/disk-checkpoint.d.ts +104 -0
- package/dist/api/sandbox/disk-checkpoint.d.ts.map +1 -0
- package/dist/api/sandbox/disk-checkpoint.js +104 -0
- package/dist/api/sandbox/disk-checkpoint.js.map +1 -0
- package/dist/api/sandbox/execute.d.ts +69 -0
- package/dist/api/sandbox/execute.d.ts.map +1 -0
- package/dist/api/sandbox/execute.js +103 -0
- package/dist/api/sandbox/execute.js.map +1 -0
- package/dist/api/sandbox/execution.d.ts +169 -0
- package/dist/api/sandbox/execution.d.ts.map +1 -0
- package/dist/api/sandbox/execution.js +118 -0
- package/dist/api/sandbox/execution.js.map +1 -0
- package/dist/api/sandbox/files.d.ts +261 -0
- package/dist/api/sandbox/files.d.ts.map +1 -0
- package/dist/api/sandbox/files.js +386 -0
- package/dist/api/sandbox/files.js.map +1 -0
- package/dist/api/sandbox/get.d.ts +283 -0
- package/dist/api/sandbox/get.d.ts.map +1 -0
- package/dist/api/sandbox/get.js +215 -0
- package/dist/api/sandbox/get.js.map +1 -0
- package/dist/api/sandbox/getStatus.d.ts +16 -0
- package/dist/api/sandbox/getStatus.d.ts.map +1 -0
- package/dist/api/sandbox/getStatus.js +32 -0
- package/dist/api/sandbox/getStatus.js.map +1 -0
- package/dist/api/sandbox/index.d.ts +39 -0
- package/dist/api/sandbox/index.d.ts.map +1 -0
- package/dist/api/sandbox/index.js +20 -0
- package/dist/api/sandbox/index.js.map +1 -0
- package/dist/api/sandbox/list.d.ts +293 -0
- package/dist/api/sandbox/list.d.ts.map +1 -0
- package/dist/api/sandbox/list.js +191 -0
- package/dist/api/sandbox/list.js.map +1 -0
- package/dist/api/sandbox/pause.d.ts +22 -0
- package/dist/api/sandbox/pause.d.ts.map +1 -0
- package/dist/api/sandbox/pause.js +25 -0
- package/dist/api/sandbox/pause.js.map +1 -0
- package/dist/api/sandbox/resolve.d.ts +82 -0
- package/dist/api/sandbox/resolve.d.ts.map +1 -0
- package/dist/api/sandbox/resolve.js +71 -0
- package/dist/api/sandbox/resolve.js.map +1 -0
- package/dist/api/sandbox/resume.d.ts +22 -0
- package/dist/api/sandbox/resume.d.ts.map +1 -0
- package/dist/api/sandbox/resume.js +25 -0
- package/dist/api/sandbox/resume.js.map +1 -0
- package/dist/api/sandbox/run.d.ts +28 -0
- package/dist/api/sandbox/run.d.ts.map +1 -0
- package/dist/api/sandbox/run.js +342 -0
- package/dist/api/sandbox/run.js.map +1 -0
- package/dist/api/sandbox/runtime.d.ts +83 -0
- package/dist/api/sandbox/runtime.d.ts.map +1 -0
- package/dist/api/sandbox/runtime.js +78 -0
- package/dist/api/sandbox/runtime.js.map +1 -0
- package/dist/api/sandbox/snapshot-build.d.ts +48 -0
- package/dist/api/sandbox/snapshot-build.d.ts.map +1 -0
- package/dist/api/sandbox/snapshot-build.js +72 -0
- package/dist/api/sandbox/snapshot-build.js.map +1 -0
- package/dist/api/sandbox/snapshot.d.ts +595 -0
- package/dist/api/sandbox/snapshot.d.ts.map +1 -0
- package/dist/api/sandbox/snapshot.js +598 -0
- package/dist/api/sandbox/snapshot.js.map +1 -0
- package/dist/api/sandbox/util.d.ts +284 -0
- package/dist/api/sandbox/util.d.ts.map +1 -0
- package/dist/api/sandbox/util.js +210 -0
- package/dist/api/sandbox/util.js.map +1 -0
- package/dist/api/services/index.d.ts +2 -0
- package/dist/api/services/index.d.ts.map +1 -0
- package/dist/api/services/index.js +2 -0
- package/dist/api/services/index.js.map +1 -0
- package/dist/api/services/stats.d.ts +263 -0
- package/dist/api/services/stats.d.ts.map +1 -0
- package/dist/api/services/stats.js +144 -0
- package/dist/api/services/stats.js.map +1 -0
- package/dist/api/session/get.d.ts +169 -0
- package/dist/api/session/get.d.ts.map +1 -0
- package/dist/api/session/get.js +56 -0
- package/dist/api/session/get.js.map +1 -0
- package/dist/api/session/index.d.ts +4 -0
- package/dist/api/session/index.d.ts.map +1 -0
- package/dist/api/session/index.js +4 -0
- package/dist/api/session/index.js.map +1 -0
- package/dist/api/session/list.d.ts +143 -0
- package/dist/api/session/list.d.ts.map +1 -0
- package/dist/api/session/list.js +91 -0
- package/dist/api/session/list.js.map +1 -0
- package/dist/api/session/logs.d.ts +40 -0
- package/dist/api/session/logs.d.ts.map +1 -0
- package/dist/api/session/logs.js +28 -0
- package/dist/api/session/logs.js.map +1 -0
- package/dist/api/session/util.d.ts +23 -0
- package/dist/api/session/util.d.ts.map +1 -0
- package/dist/api/session/util.js +3 -0
- package/dist/api/session/util.js.map +1 -0
- package/dist/api/storage/config.d.ts +99 -0
- package/dist/api/storage/config.d.ts.map +1 -0
- package/dist/api/storage/config.js +61 -0
- package/dist/api/storage/config.js.map +1 -0
- package/dist/api/storage/index.d.ts +5 -0
- package/dist/api/storage/index.d.ts.map +1 -0
- package/dist/api/storage/index.js +5 -0
- package/dist/api/storage/index.js.map +1 -0
- package/dist/api/storage/objects.d.ts +155 -0
- package/dist/api/storage/objects.d.ts.map +1 -0
- package/dist/api/storage/objects.js +148 -0
- package/dist/api/storage/objects.js.map +1 -0
- package/dist/api/storage/types.d.ts +161 -0
- package/dist/api/storage/types.d.ts.map +1 -0
- package/dist/api/storage/types.js +141 -0
- package/dist/api/storage/types.js.map +1 -0
- package/dist/api/storage/util.d.ts +45 -0
- package/dist/api/storage/util.d.ts.map +1 -0
- package/dist/api/storage/util.js +4 -0
- package/dist/api/storage/util.js.map +1 -0
- package/dist/api/stream/get.d.ts +58 -0
- package/dist/api/stream/get.d.ts.map +1 -0
- package/dist/api/stream/get.js +40 -0
- package/dist/api/stream/get.js.map +1 -0
- package/dist/api/stream/index.d.ts +4 -0
- package/dist/api/stream/index.d.ts.map +1 -0
- package/dist/api/stream/index.js +4 -0
- package/dist/api/stream/index.js.map +1 -0
- package/dist/api/stream/list.d.ts +120 -0
- package/dist/api/stream/list.d.ts.map +1 -0
- package/dist/api/stream/list.js +77 -0
- package/dist/api/stream/list.js.map +1 -0
- package/dist/api/stream/util.d.ts +23 -0
- package/dist/api/stream/util.d.ts.map +1 -0
- package/dist/api/stream/util.js +3 -0
- package/dist/api/stream/util.js.map +1 -0
- package/dist/api/thread/delete.d.ts +23 -0
- package/dist/api/thread/delete.d.ts.map +1 -0
- package/dist/api/thread/delete.js +21 -0
- package/dist/api/thread/delete.js.map +1 -0
- package/dist/api/thread/get.d.ts +36 -0
- package/dist/api/thread/get.d.ts.map +1 -0
- package/dist/api/thread/get.js +23 -0
- package/dist/api/thread/get.js.map +1 -0
- package/dist/api/thread/index.d.ts +5 -0
- package/dist/api/thread/index.d.ts.map +1 -0
- package/dist/api/thread/index.js +5 -0
- package/dist/api/thread/index.js.map +1 -0
- package/dist/api/thread/list.d.ts +69 -0
- package/dist/api/thread/list.d.ts.map +1 -0
- package/dist/api/thread/list.js +51 -0
- package/dist/api/thread/list.js.map +1 -0
- package/dist/api/thread/util.d.ts +23 -0
- package/dist/api/thread/util.d.ts.map +1 -0
- package/dist/api/thread/util.js +3 -0
- package/dist/api/thread/util.js.map +1 -0
- package/dist/api/user/index.d.ts +2 -0
- package/dist/api/user/index.d.ts.map +1 -0
- package/dist/api/user/index.js +2 -0
- package/dist/api/user/index.js.map +1 -0
- package/dist/api/user/util.d.ts +23 -0
- package/dist/api/user/util.d.ts.map +1 -0
- package/dist/api/user/util.js +3 -0
- package/dist/api/user/util.js.map +1 -0
- package/dist/api/user/whoami.d.ts +39 -0
- package/dist/api/user/whoami.d.ts.map +1 -0
- package/dist/api/user/whoami.js +27 -0
- package/dist/api/user/whoami.js.map +1 -0
- package/dist/api/webhook/deliveries.d.ts +94 -0
- package/dist/api/webhook/deliveries.d.ts.map +1 -0
- package/dist/api/webhook/deliveries.js +79 -0
- package/dist/api/webhook/deliveries.js.map +1 -0
- package/dist/api/webhook/destinations.d.ts +136 -0
- package/dist/api/webhook/destinations.d.ts.map +1 -0
- package/dist/api/webhook/destinations.js +137 -0
- package/dist/api/webhook/destinations.js.map +1 -0
- package/dist/api/webhook/index.d.ts +41 -0
- package/dist/api/webhook/index.d.ts.map +1 -0
- package/dist/api/webhook/index.js +59 -0
- package/dist/api/webhook/index.js.map +1 -0
- package/dist/api/webhook/receipts.d.ts +77 -0
- package/dist/api/webhook/receipts.d.ts.map +1 -0
- package/dist/api/webhook/receipts.js +78 -0
- package/dist/api/webhook/receipts.js.map +1 -0
- package/dist/api/webhook/types.d.ts +249 -0
- package/dist/api/webhook/types.d.ts.map +1 -0
- package/dist/api/webhook/types.js +221 -0
- package/dist/api/webhook/types.js.map +1 -0
- package/dist/api/webhook/util.d.ts +202 -0
- package/dist/api/webhook/util.d.ts.map +1 -0
- package/dist/api/webhook/util.js +199 -0
- package/dist/api/webhook/util.js.map +1 -0
- package/dist/api/webhook/webhooks.d.ts +146 -0
- package/dist/api/webhook/webhooks.d.ts.map +1 -0
- package/dist/api/webhook/webhooks.js +165 -0
- package/dist/api/webhook/webhooks.js.map +1 -0
- package/dist/env-example.d.ts +11 -0
- package/dist/env-example.d.ts.map +1 -0
- package/dist/env-example.js +70 -0
- package/dist/env-example.js.map +1 -0
- package/dist/index.d.ts +20 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/dist/services/email.d.ts.map +1 -1
- package/dist/services/email.js +15 -15
- package/dist/services/email.js.map +1 -1
- package/dist/services/keyvalue.d.ts.map +1 -1
- package/dist/services/keyvalue.js +10 -10
- package/dist/services/keyvalue.js.map +1 -1
- package/dist/services/queue.d.ts.map +1 -1
- package/dist/services/queue.js +3 -3
- package/dist/services/queue.js.map +1 -1
- package/dist/services/schedule.d.ts.map +1 -1
- package/dist/services/schedule.js +8 -10
- package/dist/services/schedule.js.map +1 -1
- package/dist/services/stream.d.ts +2 -2
- package/dist/services/stream.d.ts.map +1 -1
- package/dist/services/stream.js +2 -2
- package/dist/services/stream.js.map +1 -1
- package/dist/services/vector.d.ts.map +1 -1
- package/dist/services/vector.js +9 -9
- package/dist/services/vector.js.map +1 -1
- package/dist/services/webhook.d.ts +2 -1
- package/dist/services/webhook.d.ts.map +1 -1
- package/dist/services/webhook.js +12 -14
- package/dist/services/webhook.js.map +1 -1
- package/package.json +2 -2
- package/src/api/api-example.md +164 -0
- package/src/api/api.ts +931 -0
- package/src/api/apikey/create.ts +41 -0
- package/src/api/apikey/delete.ts +30 -0
- package/src/api/apikey/get.ts +48 -0
- package/src/api/apikey/index.ts +5 -0
- package/src/api/apikey/list.ts +64 -0
- package/src/api/apikey/util.ts +3 -0
- package/src/api/config.ts +60 -0
- package/src/api/db/index.ts +27 -0
- package/src/api/db/logs.ts +75 -0
- package/src/api/db/query.ts +67 -0
- package/src/api/db/tables.ts +92 -0
- package/src/api/db/util.ts +9 -0
- package/src/api/env.ts +9 -0
- package/src/api/eval/get.ts +33 -0
- package/src/api/eval/index.ts +28 -0
- package/src/api/eval/list.ts +49 -0
- package/src/api/eval/run-get.ts +39 -0
- package/src/api/eval/run-list.ts +59 -0
- package/src/api/index.ts +20 -0
- package/src/api/logger.ts +24 -0
- package/src/api/machine/index.ts +2 -0
- package/src/api/machine/machine.ts +160 -0
- package/src/api/machine/util.ts +5 -0
- package/src/api/org/env-delete.ts +37 -0
- package/src/api/org/env-get.ts +43 -0
- package/src/api/org/env-update.ts +38 -0
- package/src/api/org/index.ts +6 -0
- package/src/api/org/list.ts +28 -0
- package/src/api/org/resources.ts +140 -0
- package/src/api/org/util.ts +4 -0
- package/src/api/project/agent.ts +86 -0
- package/src/api/project/create.ts +47 -0
- package/src/api/project/delete.ts +25 -0
- package/src/api/project/deploy.ts +458 -0
- package/src/api/project/deployment.ts +195 -0
- package/src/api/project/env-delete.ts +45 -0
- package/src/api/project/env-update.ts +55 -0
- package/src/api/project/exists.ts +58 -0
- package/src/api/project/get.ts +49 -0
- package/src/api/project/hostname.ts +73 -0
- package/src/api/project/index.ts +13 -0
- package/src/api/project/list.ts +54 -0
- package/src/api/project/malware.ts +68 -0
- package/src/api/project/update-region.ts +44 -0
- package/src/api/project/util.ts +8 -0
- package/src/api/queue/analytics.ts +311 -0
- package/src/api/queue/destinations.ts +259 -0
- package/src/api/queue/dlq.ts +243 -0
- package/src/api/queue/index.ts +308 -0
- package/src/api/queue/messages.ts +784 -0
- package/src/api/queue/queues.ts +460 -0
- package/src/api/queue/sources.ts +294 -0
- package/src/api/queue/types.ts +1325 -0
- package/src/api/queue/util.ts +275 -0
- package/src/api/queue/validation.ts +560 -0
- package/src/api/queue/websocket.ts +521 -0
- package/src/api/region/create.ts +207 -0
- package/src/api/region/delete.ts +57 -0
- package/src/api/region/index.ts +4 -0
- package/src/api/region/list.ts +32 -0
- package/src/api/region/resources.ts +69 -0
- package/src/api/region/util.ts +3 -0
- package/src/api/sandbox/cli-list.ts +127 -0
- package/src/api/sandbox/client.ts +460 -0
- package/src/api/sandbox/create.ts +256 -0
- package/src/api/sandbox/destroy.ts +41 -0
- package/src/api/sandbox/disk-checkpoint.ts +179 -0
- package/src/api/sandbox/execute.ts +132 -0
- package/src/api/sandbox/execution.ts +183 -0
- package/src/api/sandbox/files.ts +596 -0
- package/src/api/sandbox/get.ts +249 -0
- package/src/api/sandbox/getStatus.ts +54 -0
- package/src/api/sandbox/index.ts +211 -0
- package/src/api/sandbox/list.ts +224 -0
- package/src/api/sandbox/pause.ts +39 -0
- package/src/api/sandbox/resolve.ts +98 -0
- package/src/api/sandbox/resume.ts +39 -0
- package/src/api/sandbox/run.ts +439 -0
- package/src/api/sandbox/runtime.ts +104 -0
- package/src/api/sandbox/snapshot-build.ts +94 -0
- package/src/api/sandbox/snapshot.ts +781 -0
- package/src/api/sandbox/util.ts +275 -0
- package/src/api/services/index.ts +1 -0
- package/src/api/services/stats.ts +213 -0
- package/src/api/session/get.ts +106 -0
- package/src/api/session/index.ts +3 -0
- package/src/api/session/list.ts +136 -0
- package/src/api/session/logs.ts +47 -0
- package/src/api/session/util.ts +3 -0
- package/src/api/storage/config.ts +111 -0
- package/src/api/storage/index.ts +4 -0
- package/src/api/storage/objects.ts +250 -0
- package/src/api/storage/types.ts +174 -0
- package/src/api/storage/util.ts +4 -0
- package/src/api/stream/get.ts +51 -0
- package/src/api/stream/index.ts +3 -0
- package/src/api/stream/list.ts +127 -0
- package/src/api/stream/util.ts +3 -0
- package/src/api/thread/delete.ts +31 -0
- package/src/api/thread/get.ts +34 -0
- package/src/api/thread/index.ts +4 -0
- package/src/api/thread/list.ts +76 -0
- package/src/api/thread/util.ts +3 -0
- package/src/api/user/index.ts +1 -0
- package/src/api/user/util.ts +3 -0
- package/src/api/user/whoami.ts +32 -0
- package/src/api/webhook/deliveries.ts +129 -0
- package/src/api/webhook/destinations.ts +224 -0
- package/src/api/webhook/index.ts +133 -0
- package/src/api/webhook/receipts.ts +124 -0
- package/src/api/webhook/types.ts +309 -0
- package/src/api/webhook/util.ts +234 -0
- package/src/api/webhook/webhooks.ts +260 -0
- package/src/env-example.ts +90 -0
- package/src/index.ts +209 -206
- package/src/services/email.ts +15 -24
- package/src/services/keyvalue.ts +10 -13
- package/src/services/queue.ts +3 -6
- package/src/services/schedule.ts +8 -19
- package/src/services/stream.ts +4 -4
- package/src/services/vector.ts +9 -12
- package/src/services/webhook.ts +14 -24
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchemaNoData } from '../api.ts';
|
|
3
|
+
import { throwSandboxError } from './util.ts';
|
|
4
|
+
|
|
5
|
+
export const DestroyResponseSchema = APIResponseSchemaNoData();
|
|
6
|
+
|
|
7
|
+
export interface SandboxDestroyParams {
|
|
8
|
+
sandboxId: string;
|
|
9
|
+
orgId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Destroys a sandbox and releases all associated resources.
|
|
14
|
+
*
|
|
15
|
+
* @param client - The API client to use for the request
|
|
16
|
+
* @param params - Parameters including the sandbox ID to destroy
|
|
17
|
+
* @throws {SandboxResponseError} If the sandbox is not found or destruction fails
|
|
18
|
+
*/
|
|
19
|
+
export async function sandboxDestroy(
|
|
20
|
+
client: APIClient,
|
|
21
|
+
params: SandboxDestroyParams
|
|
22
|
+
): Promise<void> {
|
|
23
|
+
const { sandboxId, orgId } = params;
|
|
24
|
+
const queryParams = new URLSearchParams();
|
|
25
|
+
if (orgId) {
|
|
26
|
+
queryParams.set('orgId', orgId);
|
|
27
|
+
}
|
|
28
|
+
const queryString = queryParams.toString();
|
|
29
|
+
const url = `/sandbox/${sandboxId}${queryString ? `?${queryString}` : ''}`;
|
|
30
|
+
|
|
31
|
+
const resp = await client.delete<z.infer<typeof DestroyResponseSchema>>(
|
|
32
|
+
url,
|
|
33
|
+
DestroyResponseSchema
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (resp.success) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
throwSandboxError(resp, { sandboxId });
|
|
41
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { z as zType } from 'zod';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api.ts';
|
|
4
|
+
import { throwSandboxError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
// --- Schemas ---
|
|
7
|
+
|
|
8
|
+
export const DiskCheckpointInfoSchema = z.object({
|
|
9
|
+
id: z.string().describe('Globally unique checkpoint ID (ckpt_xxx)'),
|
|
10
|
+
name: z.string().describe('User-provided checkpoint name'),
|
|
11
|
+
createdAt: z.string().describe('ISO timestamp of creation'),
|
|
12
|
+
parent: z.string().describe('Parent checkpoint name (empty for base)'),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type DiskCheckpointInfo = z.infer<typeof DiskCheckpointInfoSchema>;
|
|
16
|
+
|
|
17
|
+
const CreateDiskCheckpointDataSchema = DiskCheckpointInfoSchema;
|
|
18
|
+
export const CreateDiskCheckpointResponseSchema = APIResponseSchema(CreateDiskCheckpointDataSchema);
|
|
19
|
+
|
|
20
|
+
const ListDiskCheckpointsDataSchema = z.object({
|
|
21
|
+
checkpoints: z.array(DiskCheckpointInfoSchema),
|
|
22
|
+
});
|
|
23
|
+
export const ListDiskCheckpointsResponseSchema = APIResponseSchema(ListDiskCheckpointsDataSchema);
|
|
24
|
+
|
|
25
|
+
export const RestoreDiskCheckpointResponseSchema = APIResponseSchemaNoData();
|
|
26
|
+
export const DeleteDiskCheckpointResponseSchema = APIResponseSchemaNoData();
|
|
27
|
+
|
|
28
|
+
// --- Params ---
|
|
29
|
+
|
|
30
|
+
export interface DiskCheckpointCreateParams {
|
|
31
|
+
sandboxId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
orgId?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface DiskCheckpointListParams {
|
|
37
|
+
sandboxId: string;
|
|
38
|
+
orgId?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DiskCheckpointRestoreParams {
|
|
42
|
+
sandboxId: string;
|
|
43
|
+
checkpointId: string;
|
|
44
|
+
orgId?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DiskCheckpointDeleteParams {
|
|
48
|
+
sandboxId: string;
|
|
49
|
+
checkpointId: string;
|
|
50
|
+
orgId?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// --- API Functions ---
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new disk checkpoint for a sandbox.
|
|
57
|
+
*
|
|
58
|
+
* @param client - The API client to use for the request
|
|
59
|
+
* @param params - Parameters including the sandbox ID and checkpoint name
|
|
60
|
+
* @throws {SandboxResponseError} If the sandbox is not found or checkpoint creation fails
|
|
61
|
+
*/
|
|
62
|
+
export async function diskCheckpointCreate(
|
|
63
|
+
client: APIClient,
|
|
64
|
+
params: DiskCheckpointCreateParams
|
|
65
|
+
): Promise<DiskCheckpointInfo> {
|
|
66
|
+
const { sandboxId, name, orgId } = params;
|
|
67
|
+
const queryParams = new URLSearchParams();
|
|
68
|
+
if (orgId) {
|
|
69
|
+
queryParams.set('orgId', orgId);
|
|
70
|
+
}
|
|
71
|
+
const queryString = queryParams.toString();
|
|
72
|
+
const url = `/sandbox/${encodeURIComponent(sandboxId)}/checkpoint${queryString ? `?${queryString}` : ''}`;
|
|
73
|
+
|
|
74
|
+
const resp = await client.post<zType.infer<typeof CreateDiskCheckpointResponseSchema>>(
|
|
75
|
+
url,
|
|
76
|
+
{ name },
|
|
77
|
+
CreateDiskCheckpointResponseSchema
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
if (resp.success) {
|
|
81
|
+
return resp.data;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
throwSandboxError(resp, { sandboxId });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Lists all disk checkpoints for a sandbox.
|
|
89
|
+
*
|
|
90
|
+
* @param client - The API client to use for the request
|
|
91
|
+
* @param params - Parameters including the sandbox ID
|
|
92
|
+
* @throws {SandboxResponseError} If the sandbox is not found or listing fails
|
|
93
|
+
*/
|
|
94
|
+
export async function diskCheckpointList(
|
|
95
|
+
client: APIClient,
|
|
96
|
+
params: DiskCheckpointListParams
|
|
97
|
+
): Promise<DiskCheckpointInfo[]> {
|
|
98
|
+
const { sandboxId, orgId } = params;
|
|
99
|
+
const queryParams = new URLSearchParams();
|
|
100
|
+
if (orgId) {
|
|
101
|
+
queryParams.set('orgId', orgId);
|
|
102
|
+
}
|
|
103
|
+
const queryString = queryParams.toString();
|
|
104
|
+
const url = `/sandbox/checkpoints/${encodeURIComponent(sandboxId)}${queryString ? `?${queryString}` : ''}`;
|
|
105
|
+
|
|
106
|
+
const resp = await client.get<zType.infer<typeof ListDiskCheckpointsResponseSchema>>(
|
|
107
|
+
url,
|
|
108
|
+
ListDiskCheckpointsResponseSchema
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
if (resp.success) {
|
|
112
|
+
return resp.data.checkpoints;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
throwSandboxError(resp, { sandboxId });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Restores a sandbox to a specific disk checkpoint.
|
|
120
|
+
*
|
|
121
|
+
* @param client - The API client to use for the request
|
|
122
|
+
* @param params - Parameters including the sandbox ID and checkpoint ID
|
|
123
|
+
* @throws {SandboxResponseError} If the sandbox or checkpoint is not found, or restore fails
|
|
124
|
+
*/
|
|
125
|
+
export async function diskCheckpointRestore(
|
|
126
|
+
client: APIClient,
|
|
127
|
+
params: DiskCheckpointRestoreParams
|
|
128
|
+
): Promise<void> {
|
|
129
|
+
const { sandboxId, checkpointId, orgId } = params;
|
|
130
|
+
const queryParams = new URLSearchParams();
|
|
131
|
+
if (orgId) {
|
|
132
|
+
queryParams.set('orgId', orgId);
|
|
133
|
+
}
|
|
134
|
+
const queryString = queryParams.toString();
|
|
135
|
+
const url = `/sandbox/${encodeURIComponent(sandboxId)}/checkpoint/${encodeURIComponent(checkpointId)}/restore${queryString ? `?${queryString}` : ''}`;
|
|
136
|
+
|
|
137
|
+
const resp = await client.post<zType.infer<typeof RestoreDiskCheckpointResponseSchema>>(
|
|
138
|
+
url,
|
|
139
|
+
undefined,
|
|
140
|
+
RestoreDiskCheckpointResponseSchema
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (resp.success) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
throwSandboxError(resp, { sandboxId });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Deletes a disk checkpoint from a sandbox.
|
|
152
|
+
*
|
|
153
|
+
* @param client - The API client to use for the request
|
|
154
|
+
* @param params - Parameters including the sandbox ID and checkpoint ID
|
|
155
|
+
* @throws {SandboxResponseError} If the sandbox or checkpoint is not found, or deletion fails
|
|
156
|
+
*/
|
|
157
|
+
export async function diskCheckpointDelete(
|
|
158
|
+
client: APIClient,
|
|
159
|
+
params: DiskCheckpointDeleteParams
|
|
160
|
+
): Promise<void> {
|
|
161
|
+
const { sandboxId, checkpointId, orgId } = params;
|
|
162
|
+
const queryParams = new URLSearchParams();
|
|
163
|
+
if (orgId) {
|
|
164
|
+
queryParams.set('orgId', orgId);
|
|
165
|
+
}
|
|
166
|
+
const queryString = queryParams.toString();
|
|
167
|
+
const url = `/sandbox/${encodeURIComponent(sandboxId)}/checkpoint/${encodeURIComponent(checkpointId)}${queryString ? `?${queryString}` : ''}`;
|
|
168
|
+
|
|
169
|
+
const resp = await client.delete<zType.infer<typeof DeleteDiskCheckpointResponseSchema>>(
|
|
170
|
+
url,
|
|
171
|
+
DeleteDiskCheckpointResponseSchema
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
if (resp.success) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
throwSandboxError(resp, { sandboxId });
|
|
179
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { ExecuteOptions, Execution, ExecutionStatus } from '../../services/sandbox.ts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { SandboxBusyError, throwSandboxError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const ExecuteRequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
command: z.array(z.string()).describe('Command and arguments to execute'),
|
|
9
|
+
files: z
|
|
10
|
+
.array(
|
|
11
|
+
z.object({
|
|
12
|
+
path: z.string().describe('File path relative to workspace'),
|
|
13
|
+
content: z.string().describe('Base64-encoded file content'),
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Files to write before execution'),
|
|
18
|
+
timeout: z.string().optional().describe('Execution timeout (e.g., "30s", "5m")'),
|
|
19
|
+
stream: z
|
|
20
|
+
.object({
|
|
21
|
+
stdout: z.string().optional().describe('Stream ID for stdout output'),
|
|
22
|
+
stderr: z.string().optional().describe('Stream ID for stderr output'),
|
|
23
|
+
timestamps: z.boolean().optional().describe('Whether to include timestamps in output'),
|
|
24
|
+
})
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Stream configuration for output redirection'),
|
|
27
|
+
})
|
|
28
|
+
.describe('Request body for executing a command in a sandbox');
|
|
29
|
+
|
|
30
|
+
export const ExecuteDataSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
executionId: z.string().describe('Unique identifier for the execution'),
|
|
33
|
+
status: z
|
|
34
|
+
.enum(['queued', 'running', 'completed', 'failed', 'timeout', 'cancelled'])
|
|
35
|
+
.describe('Current status of the execution'),
|
|
36
|
+
exitCode: z.number().optional().describe('Exit code of the executed command'),
|
|
37
|
+
durationMs: z.number().optional().describe('Execution duration in milliseconds'),
|
|
38
|
+
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
39
|
+
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
40
|
+
})
|
|
41
|
+
.describe('Response data from command execution');
|
|
42
|
+
|
|
43
|
+
export const ExecuteResponseSchema = APIResponseSchema(ExecuteDataSchema);
|
|
44
|
+
|
|
45
|
+
export interface SandboxExecuteParams {
|
|
46
|
+
sandboxId: string;
|
|
47
|
+
options: ExecuteOptions;
|
|
48
|
+
orgId?: string;
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Executes a command in an existing sandbox.
|
|
54
|
+
*
|
|
55
|
+
* @param client - The API client to use for the request
|
|
56
|
+
* @param params - Parameters including sandbox ID and execution options
|
|
57
|
+
* @returns The execution result including status and stream URLs
|
|
58
|
+
* @throws {SandboxResponseError} If the execution request fails
|
|
59
|
+
*/
|
|
60
|
+
export async function sandboxExecute(
|
|
61
|
+
client: APIClient,
|
|
62
|
+
params: SandboxExecuteParams
|
|
63
|
+
): Promise<Execution> {
|
|
64
|
+
const { sandboxId, options, orgId, signal } = params;
|
|
65
|
+
const body: z.infer<typeof ExecuteRequestSchema> = {
|
|
66
|
+
command: options.command,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (options.files && options.files.length > 0) {
|
|
70
|
+
body.files = options.files.map((f) => ({
|
|
71
|
+
path: f.path,
|
|
72
|
+
content: f.content.toString('base64'),
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
if (options.timeout) {
|
|
76
|
+
body.timeout = options.timeout;
|
|
77
|
+
}
|
|
78
|
+
if (options.stream) {
|
|
79
|
+
body.stream = options.stream;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const queryParams = new URLSearchParams();
|
|
83
|
+
if (orgId) {
|
|
84
|
+
queryParams.set('orgId', orgId);
|
|
85
|
+
}
|
|
86
|
+
const queryString = queryParams.toString();
|
|
87
|
+
const url = `/sandbox/${sandboxId}/execute${queryString ? `?${queryString}` : ''}`;
|
|
88
|
+
|
|
89
|
+
let resp: z.infer<typeof ExecuteResponseSchema>;
|
|
90
|
+
try {
|
|
91
|
+
resp = await client.post<z.infer<typeof ExecuteResponseSchema>>(
|
|
92
|
+
url,
|
|
93
|
+
body,
|
|
94
|
+
ExecuteResponseSchema,
|
|
95
|
+
ExecuteRequestSchema,
|
|
96
|
+
signal ?? options.signal
|
|
97
|
+
);
|
|
98
|
+
} catch (error: unknown) {
|
|
99
|
+
// Detect 409 Conflict (sandbox busy) and throw a specific error.
|
|
100
|
+
// The sandbox API client is configured with maxRetries: 0 to fail fast
|
|
101
|
+
// when sandbox is busy (retrying wouldn't help - sandbox is still busy).
|
|
102
|
+
// Convert APIErrorResponse with status 409 to SandboxBusyError for clarity.
|
|
103
|
+
if (
|
|
104
|
+
error &&
|
|
105
|
+
typeof error === 'object' &&
|
|
106
|
+
'_tag' in error &&
|
|
107
|
+
(error as { _tag: string })._tag === 'APIErrorResponse' &&
|
|
108
|
+
'status' in error &&
|
|
109
|
+
(error as { status: number }).status === 409
|
|
110
|
+
) {
|
|
111
|
+
throw new SandboxBusyError({
|
|
112
|
+
message:
|
|
113
|
+
'Sandbox is currently busy executing another command. Please wait for the current execution to complete before submitting a new one.',
|
|
114
|
+
sandboxId,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (resp.success) {
|
|
121
|
+
return {
|
|
122
|
+
executionId: resp.data.executionId,
|
|
123
|
+
status: resp.data.status as ExecutionStatus,
|
|
124
|
+
exitCode: resp.data.exitCode,
|
|
125
|
+
durationMs: resp.data.durationMs,
|
|
126
|
+
stdoutStreamUrl: resp.data.stdoutStreamUrl,
|
|
127
|
+
stderrStreamUrl: resp.data.stderrStreamUrl,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
throwSandboxError(resp, { sandboxId });
|
|
132
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { ExecutionStatus } from '../../services/sandbox.ts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { throwSandboxError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const ExecutionInfoSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
executionId: z.string().describe('Unique identifier for the execution'),
|
|
9
|
+
sandboxId: z.string().describe('ID of the sandbox where the execution ran'),
|
|
10
|
+
type: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Type of execution (e.g., exec, write_files, read_file)'),
|
|
14
|
+
status: z
|
|
15
|
+
.enum(['queued', 'running', 'completed', 'failed', 'timeout', 'cancelled'])
|
|
16
|
+
.describe('Current status of the execution'),
|
|
17
|
+
command: z.array(z.string()).optional().describe('Command that was executed'),
|
|
18
|
+
exitCode: z.number().optional().describe('Exit code of the executed command'),
|
|
19
|
+
durationMs: z.number().optional().describe('Execution duration in milliseconds'),
|
|
20
|
+
startedAt: z.string().optional().describe('ISO timestamp when execution started'),
|
|
21
|
+
completedAt: z.string().optional().describe('ISO timestamp when execution completed'),
|
|
22
|
+
error: z.string().optional().describe('Error message if execution failed'),
|
|
23
|
+
stdoutStreamUrl: z.string().optional().describe('URL to stream stdout output'),
|
|
24
|
+
stderrStreamUrl: z.string().optional().describe('URL to stream stderr output'),
|
|
25
|
+
})
|
|
26
|
+
.describe('Detailed information about a command execution');
|
|
27
|
+
|
|
28
|
+
export const ExecutionGetResponseSchema = APIResponseSchema(ExecutionInfoSchema);
|
|
29
|
+
|
|
30
|
+
export const ExecutionListDataSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
executions: z.array(ExecutionInfoSchema).describe('List of executions'),
|
|
33
|
+
})
|
|
34
|
+
.describe('List of executions for a sandbox');
|
|
35
|
+
|
|
36
|
+
export const ExecutionListResponseSchema = APIResponseSchema(ExecutionListDataSchema);
|
|
37
|
+
|
|
38
|
+
export interface ExecutionInfo {
|
|
39
|
+
executionId: string;
|
|
40
|
+
sandboxId: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
status: ExecutionStatus;
|
|
43
|
+
command?: string[];
|
|
44
|
+
exitCode?: number;
|
|
45
|
+
durationMs?: number;
|
|
46
|
+
startedAt?: string;
|
|
47
|
+
completedAt?: string;
|
|
48
|
+
error?: string;
|
|
49
|
+
stdoutStreamUrl?: string;
|
|
50
|
+
stderrStreamUrl?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ExecutionGetParams {
|
|
54
|
+
executionId: string;
|
|
55
|
+
orgId?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional wait duration for long-polling. If specified, the server will hold
|
|
58
|
+
* the connection open until the execution reaches a terminal state (completed,
|
|
59
|
+
* failed, timeout, cancelled) or the wait duration expires.
|
|
60
|
+
*
|
|
61
|
+
* Format: duration string like "30s", "1m", "5m"
|
|
62
|
+
* Maximum: 5 minutes (server will cap at this value)
|
|
63
|
+
*
|
|
64
|
+
* If not specified, returns immediately with current status.
|
|
65
|
+
*/
|
|
66
|
+
wait?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves detailed information about a specific execution.
|
|
71
|
+
*
|
|
72
|
+
* @param client - The API client to use for the request
|
|
73
|
+
* @param params - Parameters including the execution ID and optional wait duration
|
|
74
|
+
* @returns Detailed execution information including status, timing, and errors
|
|
75
|
+
* @throws {SandboxResponseError} If the execution is not found or request fails
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Immediate return (current behavior)
|
|
79
|
+
* const info = await executionGet(client, { executionId: 'exec_123' });
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* // Long-poll: wait up to 60 seconds for completion
|
|
83
|
+
* const info = await executionGet(client, { executionId: 'exec_123', wait: '60s' });
|
|
84
|
+
*/
|
|
85
|
+
export async function executionGet(
|
|
86
|
+
client: APIClient,
|
|
87
|
+
params: ExecutionGetParams
|
|
88
|
+
): Promise<ExecutionInfo> {
|
|
89
|
+
const { executionId, orgId, wait } = params;
|
|
90
|
+
const queryParams = new URLSearchParams();
|
|
91
|
+
if (orgId) {
|
|
92
|
+
queryParams.set('orgId', orgId);
|
|
93
|
+
}
|
|
94
|
+
if (wait) {
|
|
95
|
+
queryParams.set('wait', wait);
|
|
96
|
+
}
|
|
97
|
+
const queryString = queryParams.toString();
|
|
98
|
+
const url = `/sandbox/execution/${executionId}${queryString ? `?${queryString}` : ''}`;
|
|
99
|
+
|
|
100
|
+
const resp = await client.get<z.infer<typeof ExecutionGetResponseSchema>>(
|
|
101
|
+
url,
|
|
102
|
+
ExecutionGetResponseSchema
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
if (resp.success) {
|
|
106
|
+
return {
|
|
107
|
+
executionId: resp.data.executionId,
|
|
108
|
+
sandboxId: resp.data.sandboxId,
|
|
109
|
+
type: resp.data.type,
|
|
110
|
+
status: resp.data.status as ExecutionStatus,
|
|
111
|
+
command: resp.data.command,
|
|
112
|
+
exitCode: resp.data.exitCode,
|
|
113
|
+
durationMs: resp.data.durationMs,
|
|
114
|
+
startedAt: resp.data.startedAt,
|
|
115
|
+
completedAt: resp.data.completedAt,
|
|
116
|
+
error: resp.data.error,
|
|
117
|
+
stdoutStreamUrl: resp.data.stdoutStreamUrl,
|
|
118
|
+
stderrStreamUrl: resp.data.stderrStreamUrl,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
throwSandboxError(resp, { executionId });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ExecutionListParams {
|
|
126
|
+
sandboxId: string;
|
|
127
|
+
orgId?: string;
|
|
128
|
+
limit?: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ExecutionListResponse {
|
|
132
|
+
executions: ExecutionInfo[];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Lists all executions for a specific sandbox.
|
|
137
|
+
*
|
|
138
|
+
* @param client - The API client to use for the request
|
|
139
|
+
* @param params - Parameters including the sandbox ID and optional limit
|
|
140
|
+
* @returns List of execution information for the sandbox
|
|
141
|
+
* @throws {SandboxResponseError} If the sandbox is not found or request fails
|
|
142
|
+
*/
|
|
143
|
+
export async function executionList(
|
|
144
|
+
client: APIClient,
|
|
145
|
+
params: ExecutionListParams
|
|
146
|
+
): Promise<ExecutionListResponse> {
|
|
147
|
+
const { sandboxId, orgId, limit } = params;
|
|
148
|
+
const queryParams = new URLSearchParams();
|
|
149
|
+
if (orgId) {
|
|
150
|
+
queryParams.set('orgId', orgId);
|
|
151
|
+
}
|
|
152
|
+
if (limit !== undefined) {
|
|
153
|
+
queryParams.set('limit', String(limit));
|
|
154
|
+
}
|
|
155
|
+
const queryString = queryParams.toString();
|
|
156
|
+
const url = `/sandbox/sandboxes/${sandboxId}/executions${queryString ? `?${queryString}` : ''}`;
|
|
157
|
+
|
|
158
|
+
const resp = await client.get<z.infer<typeof ExecutionListResponseSchema>>(
|
|
159
|
+
url,
|
|
160
|
+
ExecutionListResponseSchema
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
if (resp.success) {
|
|
164
|
+
return {
|
|
165
|
+
executions: resp.data.executions.map((exec) => ({
|
|
166
|
+
executionId: exec.executionId,
|
|
167
|
+
sandboxId: exec.sandboxId,
|
|
168
|
+
type: exec.type,
|
|
169
|
+
status: exec.status as ExecutionStatus,
|
|
170
|
+
command: exec.command,
|
|
171
|
+
exitCode: exec.exitCode,
|
|
172
|
+
durationMs: exec.durationMs,
|
|
173
|
+
startedAt: exec.startedAt,
|
|
174
|
+
completedAt: exec.completedAt,
|
|
175
|
+
error: exec.error,
|
|
176
|
+
stdoutStreamUrl: exec.stdoutStreamUrl,
|
|
177
|
+
stderrStreamUrl: exec.stderrStreamUrl,
|
|
178
|
+
})),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
throwSandboxError(resp, { sandboxId });
|
|
183
|
+
}
|