@agentuity/core 1.0.31 → 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/error.d.ts.map +1 -1
- package/dist/error.js +16 -9
- package/dist/error.js.map +1 -1
- 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 +3 -3
- package/dist/services/stream.d.ts.map +1 -1
- package/dist/services/stream.js +8 -13
- 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/error.ts +16 -9
- 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 +11 -17
- package/src/services/vector.ts +9 -12
- package/src/services/webhook.ts +14 -24
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import type { EventEmitter } from 'node:events';
|
|
2
|
+
interface WritableWithDrain extends EventEmitter {
|
|
3
|
+
write(chunk: Uint8Array): boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Machine-readable error codes for sandbox operations.
|
|
7
|
+
* These codes allow programmatic error handling without fragile string matching.
|
|
8
|
+
*/
|
|
9
|
+
export type SandboxErrorCode = 'SANDBOX_NOT_FOUND' | 'SANDBOX_TERMINATED' | 'SANDBOX_BUSY' | 'EXECUTION_NOT_FOUND' | 'EXECUTION_TIMEOUT' | 'EXECUTION_CANCELLED' | 'SNAPSHOT_NOT_FOUND';
|
|
10
|
+
/**
|
|
11
|
+
* Error thrown when a sandbox API request fails.
|
|
12
|
+
*
|
|
13
|
+
* Includes optional context about which sandbox or execution caused the error.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SandboxResponseError: {
|
|
16
|
+
new (args?: ({
|
|
17
|
+
/** The sandbox ID associated with the error, if applicable */
|
|
18
|
+
sandboxId?: string;
|
|
19
|
+
/** The execution ID associated with the error, if applicable */
|
|
20
|
+
executionId?: string;
|
|
21
|
+
/** The session ID (trace ID) from the x-session-id response header for OTel correlation */
|
|
22
|
+
sessionId?: string | null;
|
|
23
|
+
/** Machine-readable error code for programmatic error handling */
|
|
24
|
+
code?: SandboxErrorCode;
|
|
25
|
+
} & {
|
|
26
|
+
message?: string;
|
|
27
|
+
cause?: unknown;
|
|
28
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
29
|
+
readonly _tag: "SandboxResponseError";
|
|
30
|
+
} & Readonly<{
|
|
31
|
+
/** The sandbox ID associated with the error, if applicable */
|
|
32
|
+
sandboxId?: string;
|
|
33
|
+
/** The execution ID associated with the error, if applicable */
|
|
34
|
+
executionId?: string;
|
|
35
|
+
/** The session ID (trace ID) from the x-session-id response header for OTel correlation */
|
|
36
|
+
sessionId?: string | null;
|
|
37
|
+
/** Machine-readable error code for programmatic error handling */
|
|
38
|
+
code?: SandboxErrorCode;
|
|
39
|
+
}>;
|
|
40
|
+
readonly defaultMessage?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Error thrown when a sandbox is not found.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* try {
|
|
48
|
+
* await sandboxGet(client, { sandboxId: 'non-existent' });
|
|
49
|
+
* } catch (error) {
|
|
50
|
+
* if (error._tag === 'SandboxNotFoundError') {
|
|
51
|
+
* console.error(`Sandbox not found: ${error.sandboxId}`);
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const SandboxNotFoundError: {
|
|
57
|
+
new (args?: ({
|
|
58
|
+
sandboxId: string;
|
|
59
|
+
} & {
|
|
60
|
+
message?: string;
|
|
61
|
+
cause?: unknown;
|
|
62
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
63
|
+
readonly _tag: "SandboxNotFoundError";
|
|
64
|
+
} & Readonly<{
|
|
65
|
+
sandboxId: string;
|
|
66
|
+
}>;
|
|
67
|
+
readonly defaultMessage?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Error thrown when a sandbox has already terminated.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* try {
|
|
75
|
+
* await sandboxExecute(client, { sandboxId: 'terminated-sandbox', command: ['ls'] });
|
|
76
|
+
* } catch (error) {
|
|
77
|
+
* if (error._tag === 'SandboxTerminatedError') {
|
|
78
|
+
* console.error(`Sandbox terminated: ${error.sandboxId}`);
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const SandboxTerminatedError: {
|
|
84
|
+
new (args?: ({
|
|
85
|
+
sandboxId: string;
|
|
86
|
+
} & {
|
|
87
|
+
message?: string;
|
|
88
|
+
cause?: unknown;
|
|
89
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
90
|
+
readonly _tag: "SandboxTerminatedError";
|
|
91
|
+
} & Readonly<{
|
|
92
|
+
sandboxId: string;
|
|
93
|
+
}>;
|
|
94
|
+
readonly defaultMessage?: string;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Error thrown when a sandbox is currently busy executing another command.
|
|
98
|
+
*
|
|
99
|
+
* This typically occurs when a second execute request is sent before the
|
|
100
|
+
* previous execution has completed. Sandbox executions are serialized -
|
|
101
|
+
* wait for the current execution to complete before sending a new one.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* try {
|
|
106
|
+
* await sandbox.execute({ command: ['ls'] });
|
|
107
|
+
* } catch (error) {
|
|
108
|
+
* if (error._tag === 'SandboxBusyError') {
|
|
109
|
+
* console.error('Sandbox is busy, waiting for current execution to finish');
|
|
110
|
+
* // Wait and retry, or use executionGet with long-polling to wait for completion
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare const SandboxBusyError: {
|
|
116
|
+
new (args?: ({
|
|
117
|
+
sandboxId?: string;
|
|
118
|
+
} & {
|
|
119
|
+
message?: string;
|
|
120
|
+
cause?: unknown;
|
|
121
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
122
|
+
readonly _tag: "SandboxBusyError";
|
|
123
|
+
} & Readonly<{
|
|
124
|
+
sandboxId?: string;
|
|
125
|
+
}>;
|
|
126
|
+
readonly defaultMessage?: string;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Error thrown when an execution is not found.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* try {
|
|
134
|
+
* await executionGet(client, { executionId: 'non-existent' });
|
|
135
|
+
* } catch (error) {
|
|
136
|
+
* if (error._tag === 'ExecutionNotFoundError') {
|
|
137
|
+
* console.error(`Execution not found: ${error.executionId}`);
|
|
138
|
+
* }
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
export declare const ExecutionNotFoundError: {
|
|
143
|
+
new (args?: ({
|
|
144
|
+
executionId: string;
|
|
145
|
+
sandboxId?: string;
|
|
146
|
+
} & {
|
|
147
|
+
message?: string;
|
|
148
|
+
cause?: unknown;
|
|
149
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
150
|
+
readonly _tag: "ExecutionNotFoundError";
|
|
151
|
+
} & Readonly<{
|
|
152
|
+
executionId: string;
|
|
153
|
+
sandboxId?: string;
|
|
154
|
+
}>;
|
|
155
|
+
readonly defaultMessage?: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Error thrown when an execution times out.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* try {
|
|
163
|
+
* await sandboxExecute(client, { sandboxId, command: ['long-running'], timeout: '30s' });
|
|
164
|
+
* } catch (error) {
|
|
165
|
+
* if (error._tag === 'ExecutionTimeoutError') {
|
|
166
|
+
* console.error('Execution timed out');
|
|
167
|
+
* }
|
|
168
|
+
* }
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare const ExecutionTimeoutError: {
|
|
172
|
+
new (args?: ({
|
|
173
|
+
executionId?: string;
|
|
174
|
+
sandboxId?: string;
|
|
175
|
+
} & {
|
|
176
|
+
message?: string;
|
|
177
|
+
cause?: unknown;
|
|
178
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
179
|
+
readonly _tag: "ExecutionTimeoutError";
|
|
180
|
+
} & Readonly<{
|
|
181
|
+
executionId?: string;
|
|
182
|
+
sandboxId?: string;
|
|
183
|
+
}>;
|
|
184
|
+
readonly defaultMessage?: string;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Error thrown when an execution is cancelled.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* try {
|
|
192
|
+
* await sandboxRun(client, params, { signal: controller.signal });
|
|
193
|
+
* } catch (error) {
|
|
194
|
+
* if (error._tag === 'ExecutionCancelledError') {
|
|
195
|
+
* console.error('Execution was cancelled');
|
|
196
|
+
* }
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export declare const ExecutionCancelledError: {
|
|
201
|
+
new (args?: ({
|
|
202
|
+
sandboxId?: string;
|
|
203
|
+
} & {
|
|
204
|
+
message?: string;
|
|
205
|
+
cause?: unknown;
|
|
206
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
207
|
+
readonly _tag: "ExecutionCancelledError";
|
|
208
|
+
} & Readonly<{
|
|
209
|
+
sandboxId?: string;
|
|
210
|
+
}>;
|
|
211
|
+
readonly defaultMessage?: string;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Error thrown when a snapshot is not found.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* try {
|
|
219
|
+
* await snapshotGet(client, { snapshotId: 'non-existent' });
|
|
220
|
+
* } catch (error) {
|
|
221
|
+
* if (error._tag === 'SnapshotNotFoundError') {
|
|
222
|
+
* console.error(`Snapshot not found: ${error.snapshotId}`);
|
|
223
|
+
* }
|
|
224
|
+
* }
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
export declare const SnapshotNotFoundError: {
|
|
228
|
+
new (args?: ({
|
|
229
|
+
snapshotId?: string;
|
|
230
|
+
} & {
|
|
231
|
+
message?: string;
|
|
232
|
+
cause?: unknown;
|
|
233
|
+
}) | undefined): import("../../error.ts").RichError & {
|
|
234
|
+
readonly _tag: "SnapshotNotFoundError";
|
|
235
|
+
} & Readonly<{
|
|
236
|
+
snapshotId?: string;
|
|
237
|
+
}>;
|
|
238
|
+
readonly defaultMessage?: string;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Context for throwing sandbox errors.
|
|
242
|
+
*/
|
|
243
|
+
export interface SandboxErrorContext {
|
|
244
|
+
sandboxId?: string;
|
|
245
|
+
executionId?: string;
|
|
246
|
+
sessionId?: string | null;
|
|
247
|
+
snapshotId?: string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Throws the appropriate sandbox error based on the response code.
|
|
251
|
+
*
|
|
252
|
+
* This helper centralizes error mapping logic, throwing specific error types
|
|
253
|
+
* when the backend returns a known error code, and falling back to
|
|
254
|
+
* SandboxResponseError for unknown codes.
|
|
255
|
+
*
|
|
256
|
+
* Note: Pause and resume operations use standard error codes. The backend
|
|
257
|
+
* returns SANDBOX_NOT_FOUND when the sandbox doesn't exist, and HTTP 409
|
|
258
|
+
* Conflict (handled by APIClient retries) for invalid state transitions
|
|
259
|
+
* (e.g. pausing a non-running sandbox, resuming a non-suspended sandbox).
|
|
260
|
+
* No additional error codes are needed for pause/resume.
|
|
261
|
+
*
|
|
262
|
+
* @param resp - The API response containing message and optional code
|
|
263
|
+
* @param context - Context about the operation (sandbox ID, execution ID, etc.)
|
|
264
|
+
* @throws {SandboxNotFoundError} When code is 'SANDBOX_NOT_FOUND'
|
|
265
|
+
* @throws {SandboxTerminatedError} When code is 'SANDBOX_TERMINATED'
|
|
266
|
+
* @throws {SandboxBusyError} When code is 'SANDBOX_BUSY'
|
|
267
|
+
* @throws {ExecutionNotFoundError} When code is 'EXECUTION_NOT_FOUND'
|
|
268
|
+
* @throws {ExecutionTimeoutError} When code is 'EXECUTION_TIMEOUT'
|
|
269
|
+
* @throws {ExecutionCancelledError} When code is 'EXECUTION_CANCELLED'
|
|
270
|
+
* @throws {SnapshotNotFoundError} When code is 'SNAPSHOT_NOT_FOUND'
|
|
271
|
+
* @throws {SandboxResponseError} For unknown codes or when no code is provided
|
|
272
|
+
*/
|
|
273
|
+
export declare function throwSandboxError(resp: {
|
|
274
|
+
message?: string;
|
|
275
|
+
code?: string;
|
|
276
|
+
}, context: SandboxErrorContext): never;
|
|
277
|
+
/** Current sandbox API version */
|
|
278
|
+
/**
|
|
279
|
+
* Write a chunk to a writable stream and wait for it to drain if necessary.
|
|
280
|
+
* Properly cleans up event listeners to avoid memory leaks.
|
|
281
|
+
*/
|
|
282
|
+
export declare function writeAndDrain(writable: WritableWithDrain, chunk: Uint8Array): Promise<void>;
|
|
283
|
+
export {};
|
|
284
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,UAAU,iBAAkB,SAAQ,YAA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ACpB,MAAM;;;;;;;qBAAN,MAAM;;;CAChB,CAAC;AAEL;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACzC,OAAO,EAAE,mBAAmB,GAC1B,KAAK,CAgCP;AAED,kCAAkC;AAElC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B3F"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { StructuredError } from "../../error.js";
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when a sandbox API request fails.
|
|
4
|
+
*
|
|
5
|
+
* Includes optional context about which sandbox or execution caused the error.
|
|
6
|
+
*/
|
|
7
|
+
export const SandboxResponseError = StructuredError('SandboxResponseError')();
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when a sandbox is not found.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* try {
|
|
14
|
+
* await sandboxGet(client, { sandboxId: 'non-existent' });
|
|
15
|
+
* } catch (error) {
|
|
16
|
+
* if (error._tag === 'SandboxNotFoundError') {
|
|
17
|
+
* console.error(`Sandbox not found: ${error.sandboxId}`);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export const SandboxNotFoundError = StructuredError('SandboxNotFoundError')();
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when a sandbox has already terminated.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* try {
|
|
29
|
+
* await sandboxExecute(client, { sandboxId: 'terminated-sandbox', command: ['ls'] });
|
|
30
|
+
* } catch (error) {
|
|
31
|
+
* if (error._tag === 'SandboxTerminatedError') {
|
|
32
|
+
* console.error(`Sandbox terminated: ${error.sandboxId}`);
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const SandboxTerminatedError = StructuredError('SandboxTerminatedError')();
|
|
38
|
+
/**
|
|
39
|
+
* Error thrown when a sandbox is currently busy executing another command.
|
|
40
|
+
*
|
|
41
|
+
* This typically occurs when a second execute request is sent before the
|
|
42
|
+
* previous execution has completed. Sandbox executions are serialized -
|
|
43
|
+
* wait for the current execution to complete before sending a new one.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* try {
|
|
48
|
+
* await sandbox.execute({ command: ['ls'] });
|
|
49
|
+
* } catch (error) {
|
|
50
|
+
* if (error._tag === 'SandboxBusyError') {
|
|
51
|
+
* console.error('Sandbox is busy, waiting for current execution to finish');
|
|
52
|
+
* // Wait and retry, or use executionGet with long-polling to wait for completion
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const SandboxBusyError = StructuredError('SandboxBusyError')();
|
|
58
|
+
/**
|
|
59
|
+
* Error thrown when an execution is not found.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* try {
|
|
64
|
+
* await executionGet(client, { executionId: 'non-existent' });
|
|
65
|
+
* } catch (error) {
|
|
66
|
+
* if (error._tag === 'ExecutionNotFoundError') {
|
|
67
|
+
* console.error(`Execution not found: ${error.executionId}`);
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export const ExecutionNotFoundError = StructuredError('ExecutionNotFoundError')();
|
|
73
|
+
/**
|
|
74
|
+
* Error thrown when an execution times out.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* try {
|
|
79
|
+
* await sandboxExecute(client, { sandboxId, command: ['long-running'], timeout: '30s' });
|
|
80
|
+
* } catch (error) {
|
|
81
|
+
* if (error._tag === 'ExecutionTimeoutError') {
|
|
82
|
+
* console.error('Execution timed out');
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export const ExecutionTimeoutError = StructuredError('ExecutionTimeoutError')();
|
|
88
|
+
/**
|
|
89
|
+
* Error thrown when an execution is cancelled.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* try {
|
|
94
|
+
* await sandboxRun(client, params, { signal: controller.signal });
|
|
95
|
+
* } catch (error) {
|
|
96
|
+
* if (error._tag === 'ExecutionCancelledError') {
|
|
97
|
+
* console.error('Execution was cancelled');
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export const ExecutionCancelledError = StructuredError('ExecutionCancelledError')();
|
|
103
|
+
/**
|
|
104
|
+
* Error thrown when a snapshot is not found.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* try {
|
|
109
|
+
* await snapshotGet(client, { snapshotId: 'non-existent' });
|
|
110
|
+
* } catch (error) {
|
|
111
|
+
* if (error._tag === 'SnapshotNotFoundError') {
|
|
112
|
+
* console.error(`Snapshot not found: ${error.snapshotId}`);
|
|
113
|
+
* }
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export const SnapshotNotFoundError = StructuredError('SnapshotNotFoundError')();
|
|
118
|
+
/**
|
|
119
|
+
* Throws the appropriate sandbox error based on the response code.
|
|
120
|
+
*
|
|
121
|
+
* This helper centralizes error mapping logic, throwing specific error types
|
|
122
|
+
* when the backend returns a known error code, and falling back to
|
|
123
|
+
* SandboxResponseError for unknown codes.
|
|
124
|
+
*
|
|
125
|
+
* Note: Pause and resume operations use standard error codes. The backend
|
|
126
|
+
* returns SANDBOX_NOT_FOUND when the sandbox doesn't exist, and HTTP 409
|
|
127
|
+
* Conflict (handled by APIClient retries) for invalid state transitions
|
|
128
|
+
* (e.g. pausing a non-running sandbox, resuming a non-suspended sandbox).
|
|
129
|
+
* No additional error codes are needed for pause/resume.
|
|
130
|
+
*
|
|
131
|
+
* @param resp - The API response containing message and optional code
|
|
132
|
+
* @param context - Context about the operation (sandbox ID, execution ID, etc.)
|
|
133
|
+
* @throws {SandboxNotFoundError} When code is 'SANDBOX_NOT_FOUND'
|
|
134
|
+
* @throws {SandboxTerminatedError} When code is 'SANDBOX_TERMINATED'
|
|
135
|
+
* @throws {SandboxBusyError} When code is 'SANDBOX_BUSY'
|
|
136
|
+
* @throws {ExecutionNotFoundError} When code is 'EXECUTION_NOT_FOUND'
|
|
137
|
+
* @throws {ExecutionTimeoutError} When code is 'EXECUTION_TIMEOUT'
|
|
138
|
+
* @throws {ExecutionCancelledError} When code is 'EXECUTION_CANCELLED'
|
|
139
|
+
* @throws {SnapshotNotFoundError} When code is 'SNAPSHOT_NOT_FOUND'
|
|
140
|
+
* @throws {SandboxResponseError} For unknown codes or when no code is provided
|
|
141
|
+
*/
|
|
142
|
+
export function throwSandboxError(resp, context) {
|
|
143
|
+
const { sandboxId, executionId, sessionId, snapshotId } = context;
|
|
144
|
+
const code = resp.code;
|
|
145
|
+
switch (code) {
|
|
146
|
+
case 'SANDBOX_NOT_FOUND':
|
|
147
|
+
throw new SandboxNotFoundError({ message: resp.message, sandboxId: sandboxId ?? '' });
|
|
148
|
+
case 'SANDBOX_TERMINATED':
|
|
149
|
+
throw new SandboxTerminatedError({ message: resp.message, sandboxId: sandboxId ?? '' });
|
|
150
|
+
case 'SANDBOX_BUSY':
|
|
151
|
+
throw new SandboxBusyError({ message: resp.message, sandboxId });
|
|
152
|
+
case 'EXECUTION_NOT_FOUND':
|
|
153
|
+
throw new ExecutionNotFoundError({
|
|
154
|
+
message: resp.message,
|
|
155
|
+
executionId: executionId ?? '',
|
|
156
|
+
sandboxId,
|
|
157
|
+
});
|
|
158
|
+
case 'EXECUTION_TIMEOUT':
|
|
159
|
+
throw new ExecutionTimeoutError({ message: resp.message, executionId, sandboxId });
|
|
160
|
+
case 'EXECUTION_CANCELLED':
|
|
161
|
+
throw new ExecutionCancelledError({ message: resp.message, sandboxId });
|
|
162
|
+
case 'SNAPSHOT_NOT_FOUND':
|
|
163
|
+
throw new SnapshotNotFoundError({ message: resp.message, snapshotId });
|
|
164
|
+
default:
|
|
165
|
+
throw new SandboxResponseError({
|
|
166
|
+
message: resp.message,
|
|
167
|
+
sandboxId,
|
|
168
|
+
executionId,
|
|
169
|
+
sessionId,
|
|
170
|
+
code,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/** Current sandbox API version */
|
|
175
|
+
/**
|
|
176
|
+
* Write a chunk to a writable stream and wait for it to drain if necessary.
|
|
177
|
+
* Properly cleans up event listeners to avoid memory leaks.
|
|
178
|
+
*/
|
|
179
|
+
export function writeAndDrain(writable, chunk) {
|
|
180
|
+
return new Promise((resolve, reject) => {
|
|
181
|
+
let needsDrain;
|
|
182
|
+
try {
|
|
183
|
+
needsDrain = !writable.write(chunk);
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
reject(err);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (needsDrain) {
|
|
190
|
+
const cleanup = () => {
|
|
191
|
+
writable.removeListener('drain', onDrain);
|
|
192
|
+
writable.removeListener('error', onError);
|
|
193
|
+
};
|
|
194
|
+
const onDrain = () => {
|
|
195
|
+
cleanup();
|
|
196
|
+
resolve();
|
|
197
|
+
};
|
|
198
|
+
const onError = (err) => {
|
|
199
|
+
cleanup();
|
|
200
|
+
reject(err);
|
|
201
|
+
};
|
|
202
|
+
writable.once('drain', onDrain);
|
|
203
|
+
writable.once('error', onError);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
resolve();
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/api/sandbox/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAoBjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,sBAAsB,CAAC,EASvE,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,sBAAsB,CAAC,EAEvE,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,wBAAwB,CAAC,EAE3E,CAAC;AAEL;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,kBAAkB,CAAC,EAE/D,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC,wBAAwB,CAAC,EAG3E,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC,uBAAuB,CAAC,EAGzE,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,yBAAyB,CAAC,EAE7E,CAAC;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC,uBAAuB,CAAC,EAEzE,CAAC;AAYL;;;;;;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c,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|