@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,275 @@
|
|
|
1
|
+
import { StructuredError } from '../../error.ts';
|
|
2
|
+
import type { EventEmitter } from 'node:events';
|
|
3
|
+
|
|
4
|
+
interface WritableWithDrain extends EventEmitter {
|
|
5
|
+
write(chunk: Uint8Array): boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Machine-readable error codes for sandbox operations.
|
|
10
|
+
* These codes allow programmatic error handling without fragile string matching.
|
|
11
|
+
*/
|
|
12
|
+
export type SandboxErrorCode =
|
|
13
|
+
| 'SANDBOX_NOT_FOUND'
|
|
14
|
+
| 'SANDBOX_TERMINATED'
|
|
15
|
+
| 'SANDBOX_BUSY'
|
|
16
|
+
| 'EXECUTION_NOT_FOUND'
|
|
17
|
+
| 'EXECUTION_TIMEOUT'
|
|
18
|
+
| 'EXECUTION_CANCELLED'
|
|
19
|
+
| 'SNAPSHOT_NOT_FOUND';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when a sandbox API request fails.
|
|
23
|
+
*
|
|
24
|
+
* Includes optional context about which sandbox or execution caused the error.
|
|
25
|
+
*/
|
|
26
|
+
export const SandboxResponseError = StructuredError('SandboxResponseError')<{
|
|
27
|
+
/** The sandbox ID associated with the error, if applicable */
|
|
28
|
+
sandboxId?: string;
|
|
29
|
+
/** The execution ID associated with the error, if applicable */
|
|
30
|
+
executionId?: string;
|
|
31
|
+
/** The session ID (trace ID) from the x-session-id response header for OTel correlation */
|
|
32
|
+
sessionId?: string | null;
|
|
33
|
+
/** Machine-readable error code for programmatic error handling */
|
|
34
|
+
code?: SandboxErrorCode;
|
|
35
|
+
}>();
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Error thrown when a sandbox is not found.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* try {
|
|
43
|
+
* await sandboxGet(client, { sandboxId: 'non-existent' });
|
|
44
|
+
* } catch (error) {
|
|
45
|
+
* if (error._tag === 'SandboxNotFoundError') {
|
|
46
|
+
* console.error(`Sandbox not found: ${error.sandboxId}`);
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export const SandboxNotFoundError = StructuredError('SandboxNotFoundError')<{
|
|
52
|
+
sandboxId: string;
|
|
53
|
+
}>();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Error thrown when a sandbox has already terminated.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* try {
|
|
61
|
+
* await sandboxExecute(client, { sandboxId: 'terminated-sandbox', command: ['ls'] });
|
|
62
|
+
* } catch (error) {
|
|
63
|
+
* if (error._tag === 'SandboxTerminatedError') {
|
|
64
|
+
* console.error(`Sandbox terminated: ${error.sandboxId}`);
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export const SandboxTerminatedError = StructuredError('SandboxTerminatedError')<{
|
|
70
|
+
sandboxId: string;
|
|
71
|
+
}>();
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Error thrown when a sandbox is currently busy executing another command.
|
|
75
|
+
*
|
|
76
|
+
* This typically occurs when a second execute request is sent before the
|
|
77
|
+
* previous execution has completed. Sandbox executions are serialized -
|
|
78
|
+
* wait for the current execution to complete before sending a new one.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* try {
|
|
83
|
+
* await sandbox.execute({ command: ['ls'] });
|
|
84
|
+
* } catch (error) {
|
|
85
|
+
* if (error._tag === 'SandboxBusyError') {
|
|
86
|
+
* console.error('Sandbox is busy, waiting for current execution to finish');
|
|
87
|
+
* // Wait and retry, or use executionGet with long-polling to wait for completion
|
|
88
|
+
* }
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export const SandboxBusyError = StructuredError('SandboxBusyError')<{
|
|
93
|
+
sandboxId?: string;
|
|
94
|
+
}>();
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Error thrown when an execution is not found.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* try {
|
|
102
|
+
* await executionGet(client, { executionId: 'non-existent' });
|
|
103
|
+
* } catch (error) {
|
|
104
|
+
* if (error._tag === 'ExecutionNotFoundError') {
|
|
105
|
+
* console.error(`Execution not found: ${error.executionId}`);
|
|
106
|
+
* }
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export const ExecutionNotFoundError = StructuredError('ExecutionNotFoundError')<{
|
|
111
|
+
executionId: string;
|
|
112
|
+
sandboxId?: string;
|
|
113
|
+
}>();
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Error thrown when an execution times out.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* try {
|
|
121
|
+
* await sandboxExecute(client, { sandboxId, command: ['long-running'], timeout: '30s' });
|
|
122
|
+
* } catch (error) {
|
|
123
|
+
* if (error._tag === 'ExecutionTimeoutError') {
|
|
124
|
+
* console.error('Execution timed out');
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export const ExecutionTimeoutError = StructuredError('ExecutionTimeoutError')<{
|
|
130
|
+
executionId?: string;
|
|
131
|
+
sandboxId?: string;
|
|
132
|
+
}>();
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Error thrown when an execution is cancelled.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* try {
|
|
140
|
+
* await sandboxRun(client, params, { signal: controller.signal });
|
|
141
|
+
* } catch (error) {
|
|
142
|
+
* if (error._tag === 'ExecutionCancelledError') {
|
|
143
|
+
* console.error('Execution was cancelled');
|
|
144
|
+
* }
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export const ExecutionCancelledError = StructuredError('ExecutionCancelledError')<{
|
|
149
|
+
sandboxId?: string;
|
|
150
|
+
}>();
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Error thrown when a snapshot is not found.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* try {
|
|
158
|
+
* await snapshotGet(client, { snapshotId: 'non-existent' });
|
|
159
|
+
* } catch (error) {
|
|
160
|
+
* if (error._tag === 'SnapshotNotFoundError') {
|
|
161
|
+
* console.error(`Snapshot not found: ${error.snapshotId}`);
|
|
162
|
+
* }
|
|
163
|
+
* }
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export const SnapshotNotFoundError = StructuredError('SnapshotNotFoundError')<{
|
|
167
|
+
snapshotId?: string;
|
|
168
|
+
}>();
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Context for throwing sandbox errors.
|
|
172
|
+
*/
|
|
173
|
+
export interface SandboxErrorContext {
|
|
174
|
+
sandboxId?: string;
|
|
175
|
+
executionId?: string;
|
|
176
|
+
sessionId?: string | null;
|
|
177
|
+
snapshotId?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Throws the appropriate sandbox error based on the response code.
|
|
182
|
+
*
|
|
183
|
+
* This helper centralizes error mapping logic, throwing specific error types
|
|
184
|
+
* when the backend returns a known error code, and falling back to
|
|
185
|
+
* SandboxResponseError for unknown codes.
|
|
186
|
+
*
|
|
187
|
+
* Note: Pause and resume operations use standard error codes. The backend
|
|
188
|
+
* returns SANDBOX_NOT_FOUND when the sandbox doesn't exist, and HTTP 409
|
|
189
|
+
* Conflict (handled by APIClient retries) for invalid state transitions
|
|
190
|
+
* (e.g. pausing a non-running sandbox, resuming a non-suspended sandbox).
|
|
191
|
+
* No additional error codes are needed for pause/resume.
|
|
192
|
+
*
|
|
193
|
+
* @param resp - The API response containing message and optional code
|
|
194
|
+
* @param context - Context about the operation (sandbox ID, execution ID, etc.)
|
|
195
|
+
* @throws {SandboxNotFoundError} When code is 'SANDBOX_NOT_FOUND'
|
|
196
|
+
* @throws {SandboxTerminatedError} When code is 'SANDBOX_TERMINATED'
|
|
197
|
+
* @throws {SandboxBusyError} When code is 'SANDBOX_BUSY'
|
|
198
|
+
* @throws {ExecutionNotFoundError} When code is 'EXECUTION_NOT_FOUND'
|
|
199
|
+
* @throws {ExecutionTimeoutError} When code is 'EXECUTION_TIMEOUT'
|
|
200
|
+
* @throws {ExecutionCancelledError} When code is 'EXECUTION_CANCELLED'
|
|
201
|
+
* @throws {SnapshotNotFoundError} When code is 'SNAPSHOT_NOT_FOUND'
|
|
202
|
+
* @throws {SandboxResponseError} For unknown codes or when no code is provided
|
|
203
|
+
*/
|
|
204
|
+
export function throwSandboxError(
|
|
205
|
+
resp: { message?: string; code?: string },
|
|
206
|
+
context: SandboxErrorContext
|
|
207
|
+
): never {
|
|
208
|
+
const { sandboxId, executionId, sessionId, snapshotId } = context;
|
|
209
|
+
const code = resp.code as SandboxErrorCode | undefined;
|
|
210
|
+
|
|
211
|
+
switch (code) {
|
|
212
|
+
case 'SANDBOX_NOT_FOUND':
|
|
213
|
+
throw new SandboxNotFoundError({ message: resp.message, sandboxId: sandboxId ?? '' });
|
|
214
|
+
case 'SANDBOX_TERMINATED':
|
|
215
|
+
throw new SandboxTerminatedError({ message: resp.message, sandboxId: sandboxId ?? '' });
|
|
216
|
+
case 'SANDBOX_BUSY':
|
|
217
|
+
throw new SandboxBusyError({ message: resp.message, sandboxId });
|
|
218
|
+
case 'EXECUTION_NOT_FOUND':
|
|
219
|
+
throw new ExecutionNotFoundError({
|
|
220
|
+
message: resp.message,
|
|
221
|
+
executionId: executionId ?? '',
|
|
222
|
+
sandboxId,
|
|
223
|
+
});
|
|
224
|
+
case 'EXECUTION_TIMEOUT':
|
|
225
|
+
throw new ExecutionTimeoutError({ message: resp.message, executionId, sandboxId });
|
|
226
|
+
case 'EXECUTION_CANCELLED':
|
|
227
|
+
throw new ExecutionCancelledError({ message: resp.message, sandboxId });
|
|
228
|
+
case 'SNAPSHOT_NOT_FOUND':
|
|
229
|
+
throw new SnapshotNotFoundError({ message: resp.message, snapshotId });
|
|
230
|
+
default:
|
|
231
|
+
throw new SandboxResponseError({
|
|
232
|
+
message: resp.message,
|
|
233
|
+
sandboxId,
|
|
234
|
+
executionId,
|
|
235
|
+
sessionId,
|
|
236
|
+
code,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Current sandbox API version */
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Write a chunk to a writable stream and wait for it to drain if necessary.
|
|
245
|
+
* Properly cleans up event listeners to avoid memory leaks.
|
|
246
|
+
*/
|
|
247
|
+
export function writeAndDrain(writable: WritableWithDrain, chunk: Uint8Array): Promise<void> {
|
|
248
|
+
return new Promise((resolve, reject) => {
|
|
249
|
+
let needsDrain: boolean;
|
|
250
|
+
try {
|
|
251
|
+
needsDrain = !writable.write(chunk);
|
|
252
|
+
} catch (err) {
|
|
253
|
+
reject(err);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (needsDrain) {
|
|
257
|
+
const cleanup = () => {
|
|
258
|
+
writable.removeListener('drain', onDrain);
|
|
259
|
+
writable.removeListener('error', onError);
|
|
260
|
+
};
|
|
261
|
+
const onDrain = () => {
|
|
262
|
+
cleanup();
|
|
263
|
+
resolve();
|
|
264
|
+
};
|
|
265
|
+
const onError = (err: Error) => {
|
|
266
|
+
cleanup();
|
|
267
|
+
reject(err);
|
|
268
|
+
};
|
|
269
|
+
writable.once('drain', onDrain);
|
|
270
|
+
writable.once('error', onError);
|
|
271
|
+
} else {
|
|
272
|
+
resolve();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stats.ts';
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { StructuredError } from '../../error.ts';
|
|
4
|
+
|
|
5
|
+
// --- Error ---
|
|
6
|
+
|
|
7
|
+
export const ServiceStatsError = StructuredError('ServiceStatsError')<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>();
|
|
10
|
+
|
|
11
|
+
// --- Per-Service Stat Schemas ---
|
|
12
|
+
|
|
13
|
+
export const KeyValueStatSchema = z.object({
|
|
14
|
+
namespaceCount: z.number(),
|
|
15
|
+
keyCount: z.number(),
|
|
16
|
+
totalSizeBytes: z.number(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const VectorStatSchema = z.object({
|
|
20
|
+
namespaceCount: z.number(),
|
|
21
|
+
documentCount: z.number(),
|
|
22
|
+
totalSizeBytes: z.number(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const QueueStatSchema = z.object({
|
|
26
|
+
queueCount: z.number(),
|
|
27
|
+
totalMessages: z.number(),
|
|
28
|
+
totalDlq: z.number(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const StreamStatSchema = z.object({
|
|
32
|
+
streamCount: z.number(),
|
|
33
|
+
totalSizeBytes: z.number(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const SandboxStatSchema = z.object({
|
|
37
|
+
totalActive: z.number(),
|
|
38
|
+
running: z.number(),
|
|
39
|
+
idle: z.number(),
|
|
40
|
+
creating: z.number(),
|
|
41
|
+
totalExecutions: z.number(),
|
|
42
|
+
totalCpuTimeMs: z.number(),
|
|
43
|
+
totalMemoryByteSec: z.number(),
|
|
44
|
+
totalNetworkEgressBytes: z.number(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const EmailStatSchema = z.object({
|
|
48
|
+
addressCount: z.number(),
|
|
49
|
+
inboundCount: z.number(),
|
|
50
|
+
outboundCount: z.number(),
|
|
51
|
+
outboundSuccess: z.number(),
|
|
52
|
+
outboundFailed: z.number(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const TaskStatSchema = z.object({
|
|
56
|
+
total: z.number().default(0),
|
|
57
|
+
open: z.number().default(0),
|
|
58
|
+
inProgress: z.number().default(0),
|
|
59
|
+
done: z.number().default(0),
|
|
60
|
+
closed: z.number().default(0),
|
|
61
|
+
cancelled: z.number().default(0),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const ScheduleStatSchema = z.object({
|
|
65
|
+
scheduleCount: z.number(),
|
|
66
|
+
totalDeliveries: z.number(),
|
|
67
|
+
successDeliveries: z.number(),
|
|
68
|
+
failedDeliveries: z.number(),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export const DatabaseStatSchema = z.object({
|
|
72
|
+
databaseCount: z.number(),
|
|
73
|
+
totalTableCount: z.number(),
|
|
74
|
+
totalRecordCount: z.number(),
|
|
75
|
+
totalSizeBytes: z.number(),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// --- Aggregate Schema ---
|
|
79
|
+
|
|
80
|
+
export const ServiceStatsDataSchema = z.object({
|
|
81
|
+
services: z.object({
|
|
82
|
+
database: DatabaseStatSchema.optional(),
|
|
83
|
+
keyvalue: KeyValueStatSchema.optional(),
|
|
84
|
+
vector: VectorStatSchema.optional(),
|
|
85
|
+
queue: QueueStatSchema.optional(),
|
|
86
|
+
stream: StreamStatSchema.optional(),
|
|
87
|
+
sandbox: SandboxStatSchema.optional(),
|
|
88
|
+
email: EmailStatSchema.optional(),
|
|
89
|
+
task: TaskStatSchema.optional(),
|
|
90
|
+
schedule: ScheduleStatSchema.optional(),
|
|
91
|
+
}),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export const ServiceStatsResponseSchema = APIResponseSchema(ServiceStatsDataSchema);
|
|
95
|
+
|
|
96
|
+
// --- Types ---
|
|
97
|
+
|
|
98
|
+
export type KeyValueStat = z.infer<typeof KeyValueStatSchema>;
|
|
99
|
+
export type VectorStat = z.infer<typeof VectorStatSchema>;
|
|
100
|
+
export type QueueStat = z.infer<typeof QueueStatSchema>;
|
|
101
|
+
export type StreamStat = z.infer<typeof StreamStatSchema>;
|
|
102
|
+
export type SandboxStat = z.infer<typeof SandboxStatSchema>;
|
|
103
|
+
export type EmailStat = z.infer<typeof EmailStatSchema>;
|
|
104
|
+
export type TaskStat = z.infer<typeof TaskStatSchema>;
|
|
105
|
+
export type ScheduleStat = z.infer<typeof ScheduleStatSchema>;
|
|
106
|
+
export type DatabaseStat = z.infer<typeof DatabaseStatSchema>;
|
|
107
|
+
export type ServiceStatsData = z.infer<typeof ServiceStatsDataSchema>;
|
|
108
|
+
export type ServiceStatsResponse = z.infer<typeof ServiceStatsResponseSchema>;
|
|
109
|
+
|
|
110
|
+
// --- Valid Services ---
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Valid service names that can be used to filter stats.
|
|
114
|
+
*/
|
|
115
|
+
export const VALID_SERVICES = [
|
|
116
|
+
'database',
|
|
117
|
+
'keyvalue',
|
|
118
|
+
'email',
|
|
119
|
+
'vector',
|
|
120
|
+
'schedule',
|
|
121
|
+
'task',
|
|
122
|
+
'stream',
|
|
123
|
+
'sandbox',
|
|
124
|
+
'queue',
|
|
125
|
+
] as const;
|
|
126
|
+
|
|
127
|
+
export type ServiceName = (typeof VALID_SERVICES)[number];
|
|
128
|
+
|
|
129
|
+
// --- Options ---
|
|
130
|
+
|
|
131
|
+
export interface ServiceStatsOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Filter to a specific service. If omitted, returns stats for all services.
|
|
134
|
+
*/
|
|
135
|
+
service?: ServiceName;
|
|
136
|
+
/**
|
|
137
|
+
* Start time filter (ISO 8601 timestamp).
|
|
138
|
+
*/
|
|
139
|
+
start?: string;
|
|
140
|
+
/**
|
|
141
|
+
* End time filter (ISO 8601 timestamp).
|
|
142
|
+
*/
|
|
143
|
+
end?: string;
|
|
144
|
+
/**
|
|
145
|
+
* For CLI auth: sets x-agentuity-orgid header.
|
|
146
|
+
* Required when using CLI token auth (bearer tokens without embedded org).
|
|
147
|
+
*/
|
|
148
|
+
orgIdHeader?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// --- API Function ---
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Get aggregated stats for services used by an organization.
|
|
155
|
+
*
|
|
156
|
+
* Returns per-service stats with service-specific fields (counts, sizes, etc.).
|
|
157
|
+
* Services that error on the backend are omitted from the response.
|
|
158
|
+
* Services with no provisioned tenant DB return zero values.
|
|
159
|
+
*
|
|
160
|
+
* @param client - The API client instance
|
|
161
|
+
* @param orgId - The organization ID
|
|
162
|
+
* @param options - Optional filtering (service, time range)
|
|
163
|
+
* @returns Service stats data with per-service breakdown
|
|
164
|
+
* @throws {ServiceStatsError} If the API request fails
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* // Get stats for all services
|
|
169
|
+
* const stats = await getServiceStats(client, 'org_123');
|
|
170
|
+
* console.log(`KV keys: ${stats.services.keyvalue?.keyCount}`);
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* // Get stats for a specific service
|
|
176
|
+
* const stats = await getServiceStats(client, 'org_123', {
|
|
177
|
+
* service: 'keyvalue',
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export async function getServiceStats(
|
|
182
|
+
client: APIClient,
|
|
183
|
+
orgId: string,
|
|
184
|
+
options?: ServiceStatsOptions
|
|
185
|
+
): Promise<ServiceStatsData> {
|
|
186
|
+
const params = new URLSearchParams();
|
|
187
|
+
if (options?.service) params.set('service', options.service);
|
|
188
|
+
if (options?.start) params.set('start', options.start);
|
|
189
|
+
if (options?.end) params.set('end', options.end);
|
|
190
|
+
|
|
191
|
+
const queryString = params.toString();
|
|
192
|
+
const url = `/services/stats/${encodeURIComponent(orgId)}${queryString ? `?${queryString}` : ''}`;
|
|
193
|
+
|
|
194
|
+
const headers: Record<string, string> = {};
|
|
195
|
+
if (options?.orgIdHeader) {
|
|
196
|
+
headers['x-agentuity-orgid'] = options.orgIdHeader;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const resp = await client.get(
|
|
200
|
+
url,
|
|
201
|
+
ServiceStatsResponseSchema,
|
|
202
|
+
undefined,
|
|
203
|
+
Object.keys(headers).length > 0 ? headers : undefined
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
if (resp.success) {
|
|
207
|
+
return resp.data;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
throw new ServiceStatsError({
|
|
211
|
+
message: resp.message || 'Failed to get service stats',
|
|
212
|
+
});
|
|
213
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { SessionSchema, type Session } from './list.ts';
|
|
4
|
+
import { SessionResponseError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const _SessionGetRequestSchema = z.object({
|
|
7
|
+
id: z.string().describe('the session id'),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const SessionEvalRunSchema = z.object({
|
|
11
|
+
id: z.string().describe('eval run id'),
|
|
12
|
+
created_at: z.string().describe('creation timestamp'),
|
|
13
|
+
eval_id: z.string().describe('evaluation id'),
|
|
14
|
+
pending: z.boolean().describe('pending status'),
|
|
15
|
+
success: z.boolean().describe('success status'),
|
|
16
|
+
error: z.string().nullable().describe('error message'),
|
|
17
|
+
result: z.record(z.string(), z.unknown()).nullable().describe('result object'),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export interface SpanNode {
|
|
21
|
+
id: string;
|
|
22
|
+
duration: number;
|
|
23
|
+
operation: string;
|
|
24
|
+
attributes: Record<string, unknown>;
|
|
25
|
+
children?: SpanNode[];
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const SpanNodeSchema: z.ZodType<SpanNode> = z.lazy(() =>
|
|
30
|
+
z.object({
|
|
31
|
+
id: z.string().describe('span ID'),
|
|
32
|
+
duration: z.number().describe('duration in milliseconds'),
|
|
33
|
+
operation: z.string().describe('operation name'),
|
|
34
|
+
attributes: z.record(z.string(), z.unknown()).describe('span attributes'),
|
|
35
|
+
children: z.array(SpanNodeSchema).optional().describe('child spans'),
|
|
36
|
+
error: z.string().optional().describe('error message'),
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const RouteInfoSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
id: z.string().describe('route id'),
|
|
43
|
+
method: z.string().describe('HTTP method'),
|
|
44
|
+
path: z.string().describe('route path'),
|
|
45
|
+
})
|
|
46
|
+
.nullable();
|
|
47
|
+
|
|
48
|
+
export const AgentInfoSchema = z.object({
|
|
49
|
+
name: z.string().describe('agent name'),
|
|
50
|
+
identifier: z.string().describe('agent identifier'),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const EnrichedSessionDataSchema = z.object({
|
|
54
|
+
session: SessionSchema,
|
|
55
|
+
agents: z.array(AgentInfoSchema).describe('resolved agents'),
|
|
56
|
+
eval_runs: z.array(SessionEvalRunSchema).describe('eval runs for this session'),
|
|
57
|
+
route: RouteInfoSchema.describe('route information'),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const SessionGetResponseSchema = APIResponseSchema(EnrichedSessionDataSchema);
|
|
61
|
+
|
|
62
|
+
type SessionGetRequest = z.infer<typeof _SessionGetRequestSchema>;
|
|
63
|
+
type SessionGetResponse = z.infer<typeof SessionGetResponseSchema>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get a single session by id
|
|
67
|
+
*
|
|
68
|
+
* @param client
|
|
69
|
+
* @param request
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
export type SessionEvalRun = z.infer<typeof SessionEvalRunSchema>;
|
|
73
|
+
/** @deprecated Use SessionEvalRun instead */
|
|
74
|
+
export type EvalRun = SessionEvalRun;
|
|
75
|
+
export type RouteInfo = z.infer<typeof RouteInfoSchema>;
|
|
76
|
+
export type AgentInfo = z.infer<typeof AgentInfoSchema>;
|
|
77
|
+
export type EnrichedSession = {
|
|
78
|
+
session: Session;
|
|
79
|
+
agents: AgentInfo[];
|
|
80
|
+
evalRuns: SessionEvalRun[];
|
|
81
|
+
timeline: SpanNode | null;
|
|
82
|
+
route: RouteInfo;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export async function sessionGet(
|
|
86
|
+
client: APIClient,
|
|
87
|
+
request: SessionGetRequest
|
|
88
|
+
): Promise<EnrichedSession> {
|
|
89
|
+
const resp = await client.request<SessionGetResponse>(
|
|
90
|
+
'GET',
|
|
91
|
+
`/session/${request.id}`,
|
|
92
|
+
SessionGetResponseSchema
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
if (resp.success) {
|
|
96
|
+
return {
|
|
97
|
+
session: resp.data.session,
|
|
98
|
+
agents: resp.data.agents,
|
|
99
|
+
evalRuns: resp.data.eval_runs,
|
|
100
|
+
timeline: (resp.data.session.timeline as SpanNode) ?? null,
|
|
101
|
+
route: resp.data.route,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
throw new SessionResponseError({ message: resp.message });
|
|
106
|
+
}
|