@agentuity/core 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api.d.ts +226 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +635 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/apikey/create.d.ts +33 -0
- package/dist/api/apikey/create.d.ts.map +1 -0
- package/dist/api/apikey/create.js +23 -0
- package/dist/api/apikey/create.js.map +1 -0
- package/dist/api/apikey/delete.d.ts +19 -0
- package/dist/api/apikey/delete.d.ts.map +1 -0
- package/dist/api/apikey/delete.js +19 -0
- package/dist/api/apikey/delete.js.map +1 -0
- package/dist/api/apikey/get.d.ts +45 -0
- package/dist/api/apikey/get.d.ts.map +1 -0
- package/dist/api/apikey/get.js +36 -0
- package/dist/api/apikey/get.js.map +1 -0
- package/dist/api/apikey/index.d.ts +6 -0
- package/dist/api/apikey/index.d.ts.map +1 -0
- package/dist/api/apikey/index.js +6 -0
- package/dist/api/apikey/index.js.map +1 -0
- package/dist/api/apikey/list.d.ts +64 -0
- package/dist/api/apikey/list.d.ts.map +1 -0
- package/dist/api/apikey/list.js +46 -0
- package/dist/api/apikey/list.js.map +1 -0
- package/dist/api/apikey/util.d.ts +23 -0
- package/dist/api/apikey/util.d.ts.map +1 -0
- package/dist/api/apikey/util.js +3 -0
- package/dist/api/apikey/util.js.map +1 -0
- package/dist/api/config.d.ts +20 -0
- package/dist/api/config.d.ts.map +1 -0
- package/dist/api/config.js +43 -0
- package/dist/api/config.js.map +1 -0
- package/dist/api/db/index.d.ts +5 -0
- package/dist/api/db/index.d.ts.map +1 -0
- package/dist/api/db/index.js +5 -0
- package/dist/api/db/index.js.map +1 -0
- package/dist/api/db/logs.d.ts +70 -0
- package/dist/api/db/logs.d.ts.map +1 -0
- package/dist/api/db/logs.js +59 -0
- package/dist/api/db/logs.js.map +1 -0
- package/dist/api/db/query.d.ts +39 -0
- package/dist/api/db/query.d.ts.map +1 -0
- package/dist/api/db/query.js +49 -0
- package/dist/api/db/query.js.map +1 -0
- package/dist/api/db/tables.d.ts +49 -0
- package/dist/api/db/tables.d.ts.map +1 -0
- package/dist/api/db/tables.js +59 -0
- package/dist/api/db/tables.js.map +1 -0
- package/dist/api/db/util.d.ts +31 -0
- package/dist/api/db/util.d.ts.map +1 -0
- package/dist/api/db/util.js +4 -0
- package/dist/api/db/util.js.map +1 -0
- package/dist/api/env.d.ts +5 -0
- package/dist/api/env.d.ts.map +1 -0
- package/dist/api/env.js +10 -0
- package/dist/api/env.js.map +1 -0
- package/dist/api/eval/get.d.ts +36 -0
- package/dist/api/eval/get.d.ts.map +1 -0
- package/dist/api/eval/get.js +23 -0
- package/dist/api/eval/get.js.map +1 -0
- package/dist/api/eval/index.d.ts +5 -0
- package/dist/api/eval/index.d.ts.map +1 -0
- package/dist/api/eval/index.js +5 -0
- package/dist/api/eval/index.js.map +1 -0
- package/dist/api/eval/list.d.ts +50 -0
- package/dist/api/eval/list.d.ts.map +1 -0
- package/dist/api/eval/list.js +32 -0
- package/dist/api/eval/list.js.map +1 -0
- package/dist/api/eval/run-get.d.ts +48 -0
- package/dist/api/eval/run-get.d.ts.map +1 -0
- package/dist/api/eval/run-get.js +29 -0
- package/dist/api/eval/run-get.js.map +1 -0
- package/dist/api/eval/run-list.d.ts +70 -0
- package/dist/api/eval/run-list.d.ts.map +1 -0
- package/dist/api/eval/run-list.js +42 -0
- package/dist/api/eval/run-list.js.map +1 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/logger.d.ts +7 -0
- package/dist/api/logger.d.ts.map +1 -0
- package/dist/api/logger.js +23 -0
- package/dist/api/logger.js.map +1 -0
- package/dist/api/machine/index.d.ts +3 -0
- package/dist/api/machine/index.d.ts.map +1 -0
- package/dist/api/machine/index.js +3 -0
- package/dist/api/machine/index.js.map +1 -0
- package/dist/api/machine/machine.d.ts +192 -0
- package/dist/api/machine/machine.d.ts.map +1 -0
- package/dist/api/machine/machine.js +109 -0
- package/dist/api/machine/machine.js.map +1 -0
- package/dist/api/machine/util.d.ts +14 -0
- package/dist/api/machine/util.d.ts.map +1 -0
- package/dist/api/machine/util.js +3 -0
- package/dist/api/machine/util.js.map +1 -0
- package/dist/api/org/env-delete.d.ts +23 -0
- package/dist/api/org/env-delete.d.ts.map +1 -0
- package/dist/api/org/env-delete.js +25 -0
- package/dist/api/org/env-delete.js.map +1 -0
- package/dist/api/org/env-get.d.ts +33 -0
- package/dist/api/org/env-get.d.ts.map +1 -0
- package/dist/api/org/env-get.js +26 -0
- package/dist/api/org/env-get.js.map +1 -0
- package/dist/api/org/env-update.d.ts +24 -0
- package/dist/api/org/env-update.d.ts.map +1 -0
- package/dist/api/org/env-update.js +26 -0
- package/dist/api/org/env-update.js.map +1 -0
- package/dist/api/org/index.d.ts +7 -0
- package/dist/api/org/index.d.ts.map +1 -0
- package/dist/api/org/index.js +7 -0
- package/dist/api/org/index.js.map +1 -0
- package/dist/api/org/list.d.ts +27 -0
- package/dist/api/org/list.d.ts.map +1 -0
- package/dist/api/org/list.js +22 -0
- package/dist/api/org/list.js.map +1 -0
- package/dist/api/org/resources.d.ts +141 -0
- package/dist/api/org/resources.d.ts.map +1 -0
- package/dist/api/org/resources.js +97 -0
- package/dist/api/org/resources.js.map +1 -0
- package/dist/api/org/util.d.ts +45 -0
- package/dist/api/org/util.d.ts.map +1 -0
- package/dist/api/org/util.js +4 -0
- package/dist/api/org/util.js.map +1 -0
- package/dist/api/project/agent.d.ts +89 -0
- package/dist/api/project/agent.d.ts.map +1 -0
- package/dist/api/project/agent.js +60 -0
- package/dist/api/project/agent.js.map +1 -0
- package/dist/api/project/create.d.ts +37 -0
- package/dist/api/project/create.d.ts.map +1 -0
- package/dist/api/project/create.js +31 -0
- package/dist/api/project/create.js.map +1 -0
- package/dist/api/project/delete.d.ts +15 -0
- package/dist/api/project/delete.d.ts.map +1 -0
- package/dist/api/project/delete.js +13 -0
- package/dist/api/project/delete.js.map +1 -0
- package/dist/api/project/deploy.d.ts +490 -0
- package/dist/api/project/deploy.d.ts.map +1 -0
- package/dist/api/project/deploy.js +313 -0
- package/dist/api/project/deploy.js.map +1 -0
- package/dist/api/project/deployment.d.ts +237 -0
- package/dist/api/project/deployment.d.ts.map +1 -0
- package/dist/api/project/deployment.js +127 -0
- package/dist/api/project/deployment.js.map +1 -0
- package/dist/api/project/env-delete.d.ts +22 -0
- package/dist/api/project/env-delete.d.ts.map +1 -0
- package/dist/api/project/env-delete.js +29 -0
- package/dist/api/project/env-delete.js.map +1 -0
- package/dist/api/project/env-update.d.ts +31 -0
- package/dist/api/project/env-update.d.ts.map +1 -0
- package/dist/api/project/env-update.js +36 -0
- package/dist/api/project/env-update.js.map +1 -0
- package/dist/api/project/exists.d.ts +25 -0
- package/dist/api/project/exists.d.ts.map +1 -0
- package/dist/api/project/exists.js +45 -0
- package/dist/api/project/exists.js.map +1 -0
- package/dist/api/project/get.d.ts +43 -0
- package/dist/api/project/get.d.ts.map +1 -0
- package/dist/api/project/get.js +36 -0
- package/dist/api/project/get.js.map +1 -0
- package/dist/api/project/hostname.d.ts +25 -0
- package/dist/api/project/hostname.d.ts.map +1 -0
- package/dist/api/project/hostname.js +37 -0
- package/dist/api/project/hostname.js.map +1 -0
- package/dist/api/project/index.d.ts +14 -0
- package/dist/api/project/index.d.ts.map +1 -0
- package/dist/api/project/index.js +14 -0
- package/dist/api/project/index.js.map +1 -0
- package/dist/api/project/list.d.ts +48 -0
- package/dist/api/project/list.d.ts.map +1 -0
- package/dist/api/project/list.js +38 -0
- package/dist/api/project/list.js.map +1 -0
- package/dist/api/project/malware.d.ts +71 -0
- package/dist/api/project/malware.d.ts.map +1 -0
- package/dist/api/project/malware.js +42 -0
- package/dist/api/project/malware.js.map +1 -0
- package/dist/api/project/update-region.d.ts +27 -0
- package/dist/api/project/update-region.d.ts.map +1 -0
- package/dist/api/project/update-region.js +25 -0
- package/dist/api/project/update-region.js.map +1 -0
- package/dist/api/project/util.d.ts +62 -0
- package/dist/api/project/util.d.ts.map +1 -0
- package/dist/api/project/util.js +6 -0
- package/dist/api/project/util.js.map +1 -0
- package/dist/api/queue/analytics.d.ts +250 -0
- package/dist/api/queue/analytics.d.ts.map +1 -0
- package/dist/api/queue/analytics.js +233 -0
- package/dist/api/queue/analytics.js.map +1 -0
- package/dist/api/queue/destinations.d.ts +202 -0
- package/dist/api/queue/destinations.d.ts.map +1 -0
- package/dist/api/queue/destinations.js +168 -0
- package/dist/api/queue/destinations.js.map +1 -0
- package/dist/api/queue/dlq.d.ts +168 -0
- package/dist/api/queue/dlq.d.ts.map +1 -0
- package/dist/api/queue/dlq.js +166 -0
- package/dist/api/queue/dlq.js.map +1 -0
- package/dist/api/queue/index.d.ts +56 -0
- package/dist/api/queue/index.d.ts.map +1 -0
- package/dist/api/queue/index.js +90 -0
- package/dist/api/queue/index.js.map +1 -0
- package/dist/api/queue/messages.d.ts +503 -0
- package/dist/api/queue/messages.d.ts.map +1 -0
- package/dist/api/queue/messages.js +549 -0
- package/dist/api/queue/messages.js.map +1 -0
- package/dist/api/queue/queues.d.ts +226 -0
- package/dist/api/queue/queues.d.ts.map +1 -0
- package/dist/api/queue/queues.js +321 -0
- package/dist/api/queue/queues.js.map +1 -0
- package/dist/api/queue/sources.d.ts +202 -0
- package/dist/api/queue/sources.d.ts.map +1 -0
- package/dist/api/queue/sources.js +202 -0
- package/dist/api/queue/sources.js.map +1 -0
- package/dist/api/queue/types.d.ts +1218 -0
- package/dist/api/queue/types.d.ts.map +1 -0
- package/dist/api/queue/types.js +1002 -0
- package/dist/api/queue/types.js.map +1 -0
- package/dist/api/queue/util.d.ts +278 -0
- package/dist/api/queue/util.d.ts.map +1 -0
- package/dist/api/queue/util.js +233 -0
- package/dist/api/queue/util.js.map +1 -0
- package/dist/api/queue/validation.d.ts +247 -0
- package/dist/api/queue/validation.d.ts.map +1 -0
- package/dist/api/queue/validation.js +513 -0
- package/dist/api/queue/validation.js.map +1 -0
- package/dist/api/queue/websocket.d.ts +172 -0
- package/dist/api/queue/websocket.d.ts.map +1 -0
- package/dist/api/queue/websocket.js +396 -0
- package/dist/api/queue/websocket.js.map +1 -0
- package/dist/api/region/create.d.ts +81 -0
- package/dist/api/region/create.d.ts.map +1 -0
- package/dist/api/region/create.js +177 -0
- package/dist/api/region/create.js.map +1 -0
- package/dist/api/region/delete.d.ts +62 -0
- package/dist/api/region/delete.d.ts.map +1 -0
- package/dist/api/region/delete.js +37 -0
- package/dist/api/region/delete.js.map +1 -0
- package/dist/api/region/index.d.ts +5 -0
- package/dist/api/region/index.d.ts.map +1 -0
- package/dist/api/region/index.js +5 -0
- package/dist/api/region/index.js.map +1 -0
- package/dist/api/region/list.d.ts +27 -0
- package/dist/api/region/list.d.ts.map +1 -0
- package/dist/api/region/list.js +22 -0
- package/dist/api/region/list.js.map +1 -0
- package/dist/api/region/resources.d.ts +71 -0
- package/dist/api/region/resources.d.ts.map +1 -0
- package/dist/api/region/resources.js +53 -0
- package/dist/api/region/resources.js.map +1 -0
- package/dist/api/region/util.d.ts +23 -0
- package/dist/api/region/util.d.ts.map +1 -0
- package/dist/api/region/util.js +3 -0
- package/dist/api/region/util.js.map +1 -0
- package/dist/api/sandbox/cli-list.d.ts +114 -0
- package/dist/api/sandbox/cli-list.d.ts.map +1 -0
- package/dist/api/sandbox/cli-list.js +71 -0
- package/dist/api/sandbox/cli-list.js.map +1 -0
- package/dist/api/sandbox/client.d.ts +192 -0
- package/dist/api/sandbox/client.d.ts.map +1 -0
- package/dist/api/sandbox/client.js +262 -0
- package/dist/api/sandbox/client.js.map +1 -0
- package/dist/api/sandbox/create.d.ts +118 -0
- package/dist/api/sandbox/create.d.ts.map +1 -0
- package/dist/api/sandbox/create.js +211 -0
- package/dist/api/sandbox/create.js.map +1 -0
- package/dist/api/sandbox/destroy.d.ts +22 -0
- package/dist/api/sandbox/destroy.d.ts.map +1 -0
- package/dist/api/sandbox/destroy.js +25 -0
- package/dist/api/sandbox/destroy.js.map +1 -0
- package/dist/api/sandbox/disk-checkpoint.d.ts +104 -0
- package/dist/api/sandbox/disk-checkpoint.d.ts.map +1 -0
- package/dist/api/sandbox/disk-checkpoint.js +104 -0
- package/dist/api/sandbox/disk-checkpoint.js.map +1 -0
- package/dist/api/sandbox/execute.d.ts +69 -0
- package/dist/api/sandbox/execute.d.ts.map +1 -0
- package/dist/api/sandbox/execute.js +103 -0
- package/dist/api/sandbox/execute.js.map +1 -0
- package/dist/api/sandbox/execution.d.ts +169 -0
- package/dist/api/sandbox/execution.d.ts.map +1 -0
- package/dist/api/sandbox/execution.js +118 -0
- package/dist/api/sandbox/execution.js.map +1 -0
- package/dist/api/sandbox/files.d.ts +261 -0
- package/dist/api/sandbox/files.d.ts.map +1 -0
- package/dist/api/sandbox/files.js +386 -0
- package/dist/api/sandbox/files.js.map +1 -0
- package/dist/api/sandbox/get.d.ts +283 -0
- package/dist/api/sandbox/get.d.ts.map +1 -0
- package/dist/api/sandbox/get.js +215 -0
- package/dist/api/sandbox/get.js.map +1 -0
- package/dist/api/sandbox/getStatus.d.ts +16 -0
- package/dist/api/sandbox/getStatus.d.ts.map +1 -0
- package/dist/api/sandbox/getStatus.js +32 -0
- package/dist/api/sandbox/getStatus.js.map +1 -0
- package/dist/api/sandbox/index.d.ts +39 -0
- package/dist/api/sandbox/index.d.ts.map +1 -0
- package/dist/api/sandbox/index.js +20 -0
- package/dist/api/sandbox/index.js.map +1 -0
- package/dist/api/sandbox/list.d.ts +293 -0
- package/dist/api/sandbox/list.d.ts.map +1 -0
- package/dist/api/sandbox/list.js +191 -0
- package/dist/api/sandbox/list.js.map +1 -0
- package/dist/api/sandbox/pause.d.ts +22 -0
- package/dist/api/sandbox/pause.d.ts.map +1 -0
- package/dist/api/sandbox/pause.js +25 -0
- package/dist/api/sandbox/pause.js.map +1 -0
- package/dist/api/sandbox/resolve.d.ts +82 -0
- package/dist/api/sandbox/resolve.d.ts.map +1 -0
- package/dist/api/sandbox/resolve.js +71 -0
- package/dist/api/sandbox/resolve.js.map +1 -0
- package/dist/api/sandbox/resume.d.ts +22 -0
- package/dist/api/sandbox/resume.d.ts.map +1 -0
- package/dist/api/sandbox/resume.js +25 -0
- package/dist/api/sandbox/resume.js.map +1 -0
- package/dist/api/sandbox/run.d.ts +28 -0
- package/dist/api/sandbox/run.d.ts.map +1 -0
- package/dist/api/sandbox/run.js +342 -0
- package/dist/api/sandbox/run.js.map +1 -0
- package/dist/api/sandbox/runtime.d.ts +83 -0
- package/dist/api/sandbox/runtime.d.ts.map +1 -0
- package/dist/api/sandbox/runtime.js +78 -0
- package/dist/api/sandbox/runtime.js.map +1 -0
- package/dist/api/sandbox/snapshot-build.d.ts +48 -0
- package/dist/api/sandbox/snapshot-build.d.ts.map +1 -0
- package/dist/api/sandbox/snapshot-build.js +72 -0
- package/dist/api/sandbox/snapshot-build.js.map +1 -0
- package/dist/api/sandbox/snapshot.d.ts +595 -0
- package/dist/api/sandbox/snapshot.d.ts.map +1 -0
- package/dist/api/sandbox/snapshot.js +598 -0
- package/dist/api/sandbox/snapshot.js.map +1 -0
- package/dist/api/sandbox/util.d.ts +284 -0
- package/dist/api/sandbox/util.d.ts.map +1 -0
- package/dist/api/sandbox/util.js +210 -0
- package/dist/api/sandbox/util.js.map +1 -0
- package/dist/api/services/index.d.ts +2 -0
- package/dist/api/services/index.d.ts.map +1 -0
- package/dist/api/services/index.js +2 -0
- package/dist/api/services/index.js.map +1 -0
- package/dist/api/services/stats.d.ts +263 -0
- package/dist/api/services/stats.d.ts.map +1 -0
- package/dist/api/services/stats.js +144 -0
- package/dist/api/services/stats.js.map +1 -0
- package/dist/api/session/get.d.ts +169 -0
- package/dist/api/session/get.d.ts.map +1 -0
- package/dist/api/session/get.js +56 -0
- package/dist/api/session/get.js.map +1 -0
- package/dist/api/session/index.d.ts +4 -0
- package/dist/api/session/index.d.ts.map +1 -0
- package/dist/api/session/index.js +4 -0
- package/dist/api/session/index.js.map +1 -0
- package/dist/api/session/list.d.ts +143 -0
- package/dist/api/session/list.d.ts.map +1 -0
- package/dist/api/session/list.js +91 -0
- package/dist/api/session/list.js.map +1 -0
- package/dist/api/session/logs.d.ts +40 -0
- package/dist/api/session/logs.d.ts.map +1 -0
- package/dist/api/session/logs.js +28 -0
- package/dist/api/session/logs.js.map +1 -0
- package/dist/api/session/util.d.ts +23 -0
- package/dist/api/session/util.d.ts.map +1 -0
- package/dist/api/session/util.js +3 -0
- package/dist/api/session/util.js.map +1 -0
- package/dist/api/storage/config.d.ts +99 -0
- package/dist/api/storage/config.d.ts.map +1 -0
- package/dist/api/storage/config.js +61 -0
- package/dist/api/storage/config.js.map +1 -0
- package/dist/api/storage/index.d.ts +5 -0
- package/dist/api/storage/index.d.ts.map +1 -0
- package/dist/api/storage/index.js +5 -0
- package/dist/api/storage/index.js.map +1 -0
- package/dist/api/storage/objects.d.ts +155 -0
- package/dist/api/storage/objects.d.ts.map +1 -0
- package/dist/api/storage/objects.js +148 -0
- package/dist/api/storage/objects.js.map +1 -0
- package/dist/api/storage/types.d.ts +161 -0
- package/dist/api/storage/types.d.ts.map +1 -0
- package/dist/api/storage/types.js +141 -0
- package/dist/api/storage/types.js.map +1 -0
- package/dist/api/storage/util.d.ts +45 -0
- package/dist/api/storage/util.d.ts.map +1 -0
- package/dist/api/storage/util.js +4 -0
- package/dist/api/storage/util.js.map +1 -0
- package/dist/api/stream/get.d.ts +58 -0
- package/dist/api/stream/get.d.ts.map +1 -0
- package/dist/api/stream/get.js +40 -0
- package/dist/api/stream/get.js.map +1 -0
- package/dist/api/stream/index.d.ts +4 -0
- package/dist/api/stream/index.d.ts.map +1 -0
- package/dist/api/stream/index.js +4 -0
- package/dist/api/stream/index.js.map +1 -0
- package/dist/api/stream/list.d.ts +120 -0
- package/dist/api/stream/list.d.ts.map +1 -0
- package/dist/api/stream/list.js +77 -0
- package/dist/api/stream/list.js.map +1 -0
- package/dist/api/stream/util.d.ts +23 -0
- package/dist/api/stream/util.d.ts.map +1 -0
- package/dist/api/stream/util.js +3 -0
- package/dist/api/stream/util.js.map +1 -0
- package/dist/api/thread/delete.d.ts +23 -0
- package/dist/api/thread/delete.d.ts.map +1 -0
- package/dist/api/thread/delete.js +21 -0
- package/dist/api/thread/delete.js.map +1 -0
- package/dist/api/thread/get.d.ts +36 -0
- package/dist/api/thread/get.d.ts.map +1 -0
- package/dist/api/thread/get.js +23 -0
- package/dist/api/thread/get.js.map +1 -0
- package/dist/api/thread/index.d.ts +5 -0
- package/dist/api/thread/index.d.ts.map +1 -0
- package/dist/api/thread/index.js +5 -0
- package/dist/api/thread/index.js.map +1 -0
- package/dist/api/thread/list.d.ts +69 -0
- package/dist/api/thread/list.d.ts.map +1 -0
- package/dist/api/thread/list.js +51 -0
- package/dist/api/thread/list.js.map +1 -0
- package/dist/api/thread/util.d.ts +23 -0
- package/dist/api/thread/util.d.ts.map +1 -0
- package/dist/api/thread/util.js +3 -0
- package/dist/api/thread/util.js.map +1 -0
- package/dist/api/user/index.d.ts +2 -0
- package/dist/api/user/index.d.ts.map +1 -0
- package/dist/api/user/index.js +2 -0
- package/dist/api/user/index.js.map +1 -0
- package/dist/api/user/util.d.ts +23 -0
- package/dist/api/user/util.d.ts.map +1 -0
- package/dist/api/user/util.js +3 -0
- package/dist/api/user/util.js.map +1 -0
- package/dist/api/user/whoami.d.ts +39 -0
- package/dist/api/user/whoami.d.ts.map +1 -0
- package/dist/api/user/whoami.js +27 -0
- package/dist/api/user/whoami.js.map +1 -0
- package/dist/api/webhook/deliveries.d.ts +94 -0
- package/dist/api/webhook/deliveries.d.ts.map +1 -0
- package/dist/api/webhook/deliveries.js +79 -0
- package/dist/api/webhook/deliveries.js.map +1 -0
- package/dist/api/webhook/destinations.d.ts +136 -0
- package/dist/api/webhook/destinations.d.ts.map +1 -0
- package/dist/api/webhook/destinations.js +137 -0
- package/dist/api/webhook/destinations.js.map +1 -0
- package/dist/api/webhook/index.d.ts +41 -0
- package/dist/api/webhook/index.d.ts.map +1 -0
- package/dist/api/webhook/index.js +59 -0
- package/dist/api/webhook/index.js.map +1 -0
- package/dist/api/webhook/receipts.d.ts +77 -0
- package/dist/api/webhook/receipts.d.ts.map +1 -0
- package/dist/api/webhook/receipts.js +78 -0
- package/dist/api/webhook/receipts.js.map +1 -0
- package/dist/api/webhook/types.d.ts +249 -0
- package/dist/api/webhook/types.d.ts.map +1 -0
- package/dist/api/webhook/types.js +221 -0
- package/dist/api/webhook/types.js.map +1 -0
- package/dist/api/webhook/util.d.ts +202 -0
- package/dist/api/webhook/util.d.ts.map +1 -0
- package/dist/api/webhook/util.js +199 -0
- package/dist/api/webhook/util.js.map +1 -0
- package/dist/api/webhook/webhooks.d.ts +146 -0
- package/dist/api/webhook/webhooks.d.ts.map +1 -0
- package/dist/api/webhook/webhooks.js +165 -0
- package/dist/api/webhook/webhooks.js.map +1 -0
- package/dist/env-example.d.ts +11 -0
- package/dist/env-example.d.ts.map +1 -0
- package/dist/env-example.js +70 -0
- package/dist/env-example.js.map +1 -0
- package/dist/index.d.ts +20 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -12
- package/dist/index.js.map +1 -1
- package/dist/services/email.d.ts.map +1 -1
- package/dist/services/email.js +15 -15
- package/dist/services/email.js.map +1 -1
- package/dist/services/keyvalue.d.ts.map +1 -1
- package/dist/services/keyvalue.js +10 -10
- package/dist/services/keyvalue.js.map +1 -1
- package/dist/services/queue.d.ts.map +1 -1
- package/dist/services/queue.js +3 -3
- package/dist/services/queue.js.map +1 -1
- package/dist/services/schedule.d.ts.map +1 -1
- package/dist/services/schedule.js +8 -10
- package/dist/services/schedule.js.map +1 -1
- package/dist/services/stream.d.ts +2 -2
- package/dist/services/stream.d.ts.map +1 -1
- package/dist/services/stream.js +2 -2
- package/dist/services/stream.js.map +1 -1
- package/dist/services/vector.d.ts.map +1 -1
- package/dist/services/vector.js +9 -9
- package/dist/services/vector.js.map +1 -1
- package/dist/services/webhook.d.ts +2 -1
- package/dist/services/webhook.d.ts.map +1 -1
- package/dist/services/webhook.js +12 -14
- package/dist/services/webhook.js.map +1 -1
- package/package.json +2 -2
- package/src/api/api-example.md +164 -0
- package/src/api/api.ts +931 -0
- package/src/api/apikey/create.ts +41 -0
- package/src/api/apikey/delete.ts +30 -0
- package/src/api/apikey/get.ts +48 -0
- package/src/api/apikey/index.ts +5 -0
- package/src/api/apikey/list.ts +64 -0
- package/src/api/apikey/util.ts +3 -0
- package/src/api/config.ts +60 -0
- package/src/api/db/index.ts +27 -0
- package/src/api/db/logs.ts +75 -0
- package/src/api/db/query.ts +67 -0
- package/src/api/db/tables.ts +92 -0
- package/src/api/db/util.ts +9 -0
- package/src/api/env.ts +9 -0
- package/src/api/eval/get.ts +33 -0
- package/src/api/eval/index.ts +28 -0
- package/src/api/eval/list.ts +49 -0
- package/src/api/eval/run-get.ts +39 -0
- package/src/api/eval/run-list.ts +59 -0
- package/src/api/index.ts +20 -0
- package/src/api/logger.ts +24 -0
- package/src/api/machine/index.ts +2 -0
- package/src/api/machine/machine.ts +160 -0
- package/src/api/machine/util.ts +5 -0
- package/src/api/org/env-delete.ts +37 -0
- package/src/api/org/env-get.ts +43 -0
- package/src/api/org/env-update.ts +38 -0
- package/src/api/org/index.ts +6 -0
- package/src/api/org/list.ts +28 -0
- package/src/api/org/resources.ts +140 -0
- package/src/api/org/util.ts +4 -0
- package/src/api/project/agent.ts +86 -0
- package/src/api/project/create.ts +47 -0
- package/src/api/project/delete.ts +25 -0
- package/src/api/project/deploy.ts +458 -0
- package/src/api/project/deployment.ts +195 -0
- package/src/api/project/env-delete.ts +45 -0
- package/src/api/project/env-update.ts +55 -0
- package/src/api/project/exists.ts +58 -0
- package/src/api/project/get.ts +49 -0
- package/src/api/project/hostname.ts +73 -0
- package/src/api/project/index.ts +13 -0
- package/src/api/project/list.ts +54 -0
- package/src/api/project/malware.ts +68 -0
- package/src/api/project/update-region.ts +44 -0
- package/src/api/project/util.ts +8 -0
- package/src/api/queue/analytics.ts +311 -0
- package/src/api/queue/destinations.ts +259 -0
- package/src/api/queue/dlq.ts +243 -0
- package/src/api/queue/index.ts +308 -0
- package/src/api/queue/messages.ts +784 -0
- package/src/api/queue/queues.ts +460 -0
- package/src/api/queue/sources.ts +294 -0
- package/src/api/queue/types.ts +1325 -0
- package/src/api/queue/util.ts +275 -0
- package/src/api/queue/validation.ts +560 -0
- package/src/api/queue/websocket.ts +521 -0
- package/src/api/region/create.ts +207 -0
- package/src/api/region/delete.ts +57 -0
- package/src/api/region/index.ts +4 -0
- package/src/api/region/list.ts +32 -0
- package/src/api/region/resources.ts +69 -0
- package/src/api/region/util.ts +3 -0
- package/src/api/sandbox/cli-list.ts +127 -0
- package/src/api/sandbox/client.ts +460 -0
- package/src/api/sandbox/create.ts +256 -0
- package/src/api/sandbox/destroy.ts +41 -0
- package/src/api/sandbox/disk-checkpoint.ts +179 -0
- package/src/api/sandbox/execute.ts +132 -0
- package/src/api/sandbox/execution.ts +183 -0
- package/src/api/sandbox/files.ts +596 -0
- package/src/api/sandbox/get.ts +249 -0
- package/src/api/sandbox/getStatus.ts +54 -0
- package/src/api/sandbox/index.ts +211 -0
- package/src/api/sandbox/list.ts +224 -0
- package/src/api/sandbox/pause.ts +39 -0
- package/src/api/sandbox/resolve.ts +98 -0
- package/src/api/sandbox/resume.ts +39 -0
- package/src/api/sandbox/run.ts +439 -0
- package/src/api/sandbox/runtime.ts +104 -0
- package/src/api/sandbox/snapshot-build.ts +94 -0
- package/src/api/sandbox/snapshot.ts +781 -0
- package/src/api/sandbox/util.ts +275 -0
- package/src/api/services/index.ts +1 -0
- package/src/api/services/stats.ts +213 -0
- package/src/api/session/get.ts +106 -0
- package/src/api/session/index.ts +3 -0
- package/src/api/session/list.ts +136 -0
- package/src/api/session/logs.ts +47 -0
- package/src/api/session/util.ts +3 -0
- package/src/api/storage/config.ts +111 -0
- package/src/api/storage/index.ts +4 -0
- package/src/api/storage/objects.ts +250 -0
- package/src/api/storage/types.ts +174 -0
- package/src/api/storage/util.ts +4 -0
- package/src/api/stream/get.ts +51 -0
- package/src/api/stream/index.ts +3 -0
- package/src/api/stream/list.ts +127 -0
- package/src/api/stream/util.ts +3 -0
- package/src/api/thread/delete.ts +31 -0
- package/src/api/thread/get.ts +34 -0
- package/src/api/thread/index.ts +4 -0
- package/src/api/thread/list.ts +76 -0
- package/src/api/thread/util.ts +3 -0
- package/src/api/user/index.ts +1 -0
- package/src/api/user/util.ts +3 -0
- package/src/api/user/whoami.ts +32 -0
- package/src/api/webhook/deliveries.ts +129 -0
- package/src/api/webhook/destinations.ts +224 -0
- package/src/api/webhook/index.ts +133 -0
- package/src/api/webhook/receipts.ts +124 -0
- package/src/api/webhook/types.ts +309 -0
- package/src/api/webhook/util.ts +234 -0
- package/src/api/webhook/webhooks.ts +260 -0
- package/src/env-example.ts +90 -0
- package/src/index.ts +209 -206
- package/src/services/email.ts +15 -24
- package/src/services/keyvalue.ts +10 -13
- package/src/services/queue.ts +3 -6
- package/src/services/schedule.ts +8 -19
- package/src/services/stream.ts +4 -4
- package/src/services/vector.ts +9 -12
- package/src/services/webhook.ts +14 -24
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Valid storage tier values */
|
|
4
|
+
export const StorageTierValues = ['STANDARD', 'INFREQUENT_ACCESS', 'ARCHIVE'] as const;
|
|
5
|
+
|
|
6
|
+
/** Storage tier enum schema */
|
|
7
|
+
export const StorageTierSchema = z.enum(StorageTierValues).describe('Storage tier for the bucket');
|
|
8
|
+
|
|
9
|
+
/** Storage tier type */
|
|
10
|
+
export type StorageTier = z.infer<typeof StorageTierSchema>;
|
|
11
|
+
|
|
12
|
+
/** CORS configuration for a bucket */
|
|
13
|
+
export const CORSConfigSchema = z.object({
|
|
14
|
+
allowed_origins: z
|
|
15
|
+
.array(z.string().describe('An allowed origin URL'))
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('List of allowed origin URLs for CORS requests'),
|
|
18
|
+
allowed_methods: z
|
|
19
|
+
.array(z.string().describe('An allowed HTTP method'))
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('List of allowed HTTP methods for CORS requests'),
|
|
22
|
+
allowed_headers: z
|
|
23
|
+
.array(z.string().describe('An allowed request header'))
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('List of allowed request headers for CORS requests'),
|
|
26
|
+
expose_headers: z
|
|
27
|
+
.array(z.string().describe('A response header to expose'))
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('List of response headers to expose to the browser'),
|
|
30
|
+
max_age_seconds: z
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.min(0)
|
|
34
|
+
.nullable()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Maximum time in seconds that preflight results can be cached'),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/** Full bucket config (response from GET/PUT) */
|
|
40
|
+
export const BucketConfigSchema = z.object({
|
|
41
|
+
bucket_name: z.string().describe('The name of the storage bucket'),
|
|
42
|
+
storage_tier: StorageTierSchema.nullable().optional().describe('Storage tier for the bucket'),
|
|
43
|
+
ttl: z.number().int().min(0).nullable().optional().describe('Object TTL in seconds'),
|
|
44
|
+
public: z.boolean().nullable().optional().describe('Whether the bucket is publicly accessible'),
|
|
45
|
+
cache_control: z
|
|
46
|
+
.string()
|
|
47
|
+
.nullable()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Default Cache-Control header for objects'),
|
|
50
|
+
cors: CORSConfigSchema.nullable().optional().describe('Custom CORS configuration'),
|
|
51
|
+
additional_headers: z
|
|
52
|
+
.record(z.string(), z.string())
|
|
53
|
+
.nullable()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Additional response headers as key-value pairs'),
|
|
56
|
+
bucket_location: z.string().nullable().optional().describe('Bucket location or region override'),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Update request body (all fields optional — partial update).
|
|
61
|
+
* Send a field with a value to set it, send null to unset it, omit to leave unchanged.
|
|
62
|
+
*/
|
|
63
|
+
export const BucketConfigUpdateSchema = z.object({
|
|
64
|
+
storage_tier: StorageTierSchema.nullable().optional().describe('Storage tier for the bucket'),
|
|
65
|
+
ttl: z
|
|
66
|
+
.number()
|
|
67
|
+
.int()
|
|
68
|
+
.min(0)
|
|
69
|
+
.nullable()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe('Object TTL in seconds (0 to clear)'),
|
|
72
|
+
public: z.boolean().nullable().optional().describe('Whether the bucket is publicly accessible'),
|
|
73
|
+
cache_control: z
|
|
74
|
+
.string()
|
|
75
|
+
.nullable()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe('Default Cache-Control header for objects'),
|
|
78
|
+
cors: CORSConfigSchema.nullable().optional().describe('Custom CORS configuration'),
|
|
79
|
+
additional_headers: z
|
|
80
|
+
.record(z.string(), z.string())
|
|
81
|
+
.nullable()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('Additional response headers as key-value pairs'),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/** TypeScript types derived from Zod schemas */
|
|
87
|
+
export type CORSConfig = z.infer<typeof CORSConfigSchema>;
|
|
88
|
+
export type BucketConfig = z.infer<typeof BucketConfigSchema>;
|
|
89
|
+
export type BucketConfigUpdate = z.infer<typeof BucketConfigUpdateSchema>;
|
|
90
|
+
|
|
91
|
+
// --- Storage Objects types ---
|
|
92
|
+
|
|
93
|
+
/** A storage object in a bucket */
|
|
94
|
+
export const StorageObjectSchema = z.object({
|
|
95
|
+
bucket_name: z.string().describe('The bucket this object belongs to'),
|
|
96
|
+
key: z.string().describe('Object key (path)'),
|
|
97
|
+
size: z.number().int().nonnegative().describe('Object size in bytes'),
|
|
98
|
+
etag: z.string().optional().describe('Object ETag'),
|
|
99
|
+
content_type: z.string().optional().describe('Object content type'),
|
|
100
|
+
last_modified: z.string().optional().describe('Last modified timestamp (ISO8601)'),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/** Paginated list of storage objects */
|
|
104
|
+
export const StorageListResponseSchema = z.object({
|
|
105
|
+
objects: z.array(StorageObjectSchema).describe('List of objects'),
|
|
106
|
+
total: z.number().int().nonnegative().describe('Total count matching the query'),
|
|
107
|
+
prefix: z.string().describe('Prefix filter applied'),
|
|
108
|
+
limit: z.number().int().nonnegative().describe('Page size'),
|
|
109
|
+
offset: z.number().int().nonnegative().describe('Page offset'),
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
/** Delete response */
|
|
113
|
+
export const StorageDeleteResponseSchema = z.object({
|
|
114
|
+
deleted_count: z.number().int().nonnegative().describe('Number of objects deleted'),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/** Presigned URL response */
|
|
118
|
+
export const StoragePresignResponseSchema = z.object({
|
|
119
|
+
presigned_url: z.string().describe('The presigned URL'),
|
|
120
|
+
expiry_seconds: z.number().int().nonnegative().describe('URL expiry time in seconds'),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/** Bucket stats response */
|
|
124
|
+
export const StorageStatsResponseSchema = z.object({
|
|
125
|
+
bucket_name: z.string().describe('The bucket name'),
|
|
126
|
+
object_count: z.number().int().nonnegative().describe('Number of objects'),
|
|
127
|
+
total_size: z.number().int().nonnegative().describe('Total size in bytes'),
|
|
128
|
+
last_event_at: z.string().optional().describe('Last event timestamp (ISO8601)'),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// --- Storage Analytics types ---
|
|
132
|
+
|
|
133
|
+
/** Summary totals across all buckets */
|
|
134
|
+
export const StorageAnalyticsSummarySchema = z.object({
|
|
135
|
+
total_object_count: z.number().int().nonnegative().describe('Total objects across all buckets'),
|
|
136
|
+
total_size: z.number().int().nonnegative().describe('Total size in bytes across all buckets'),
|
|
137
|
+
estimated_monthly_cost: z.number().describe('Estimated monthly cost in USD'),
|
|
138
|
+
cost_per_gb_month: z.number().describe('Cost rate per GB per month in USD'),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
/** Per-bucket breakdown */
|
|
142
|
+
export const StorageAnalyticsBucketSchema = z.object({
|
|
143
|
+
bucket_name: z.string().describe('The bucket name'),
|
|
144
|
+
object_count: z.number().int().nonnegative().describe('Number of objects in this bucket'),
|
|
145
|
+
total_size: z.number().int().nonnegative().describe('Total size in bytes for this bucket'),
|
|
146
|
+
last_event_at: z.string().optional().describe('Last event timestamp (ISO8601)'),
|
|
147
|
+
estimated_monthly_cost: z.number().describe('Estimated monthly cost for this bucket in USD'),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
/** Daily snapshot for sparklines */
|
|
151
|
+
export const StorageAnalyticsDailySnapshotSchema = z.object({
|
|
152
|
+
date: z.string().describe('Snapshot date (YYYY-MM-DD)'),
|
|
153
|
+
total_object_count: z.number().int().nonnegative().describe('Total objects on this date'),
|
|
154
|
+
total_size: z.number().int().nonnegative().describe('Total size in bytes on this date'),
|
|
155
|
+
estimated_cost: z.number().describe('Estimated monthly cost at this snapshot in USD'),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
/** Full analytics response */
|
|
159
|
+
export const StorageAnalyticsResponseSchema = z.object({
|
|
160
|
+
summary: StorageAnalyticsSummarySchema.describe('Org-wide totals'),
|
|
161
|
+
buckets: z.array(StorageAnalyticsBucketSchema).describe('Per-bucket breakdown'),
|
|
162
|
+
daily: z.array(StorageAnalyticsDailySnapshotSchema).describe('Daily snapshots for sparklines'),
|
|
163
|
+
days: z.number().int().nonnegative().describe('Number of days requested'),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
export type StorageObject = z.infer<typeof StorageObjectSchema>;
|
|
167
|
+
export type StorageListResponse = z.infer<typeof StorageListResponseSchema>;
|
|
168
|
+
export type StorageDeleteResponse = z.infer<typeof StorageDeleteResponseSchema>;
|
|
169
|
+
export type StoragePresignResponse = z.infer<typeof StoragePresignResponseSchema>;
|
|
170
|
+
export type StorageStatsResponse = z.infer<typeof StorageStatsResponseSchema>;
|
|
171
|
+
export type StorageAnalyticsSummary = z.infer<typeof StorageAnalyticsSummarySchema>;
|
|
172
|
+
export type StorageAnalyticsBucket = z.infer<typeof StorageAnalyticsBucketSchema>;
|
|
173
|
+
export type StorageAnalyticsDailySnapshot = z.infer<typeof StorageAnalyticsDailySnapshotSchema>;
|
|
174
|
+
export type StorageAnalyticsResponse = z.infer<typeof StorageAnalyticsResponseSchema>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { StreamResponseError } from './util.ts';
|
|
4
|
+
|
|
5
|
+
export const StreamDetailSchema = z.object({
|
|
6
|
+
id: z.string().describe('the stream id'),
|
|
7
|
+
namespace: z.string().describe('the stream namespace'),
|
|
8
|
+
metadata: z.record(z.string(), z.string()).describe('stream metadata'),
|
|
9
|
+
url: z.string().describe('public URL to access the stream'),
|
|
10
|
+
sizeBytes: z.number().describe('size in bytes'),
|
|
11
|
+
createdAt: z.string().nullable().describe('ISO 8601 creation timestamp'),
|
|
12
|
+
updatedAt: z.string().nullable().describe('ISO 8601 last update timestamp'),
|
|
13
|
+
startedAt: z.string().nullable().describe('ISO 8601 stream start timestamp'),
|
|
14
|
+
endedAt: z.string().nullable().describe('ISO 8601 stream end timestamp'),
|
|
15
|
+
expiresAt: z.string().nullable().describe('ISO 8601 expiration timestamp or null'),
|
|
16
|
+
orgId: z.string().describe('the organization id'),
|
|
17
|
+
projectId: z.string().nullable().describe('the project id'),
|
|
18
|
+
completed: z.boolean().describe('whether the stream upload is completed'),
|
|
19
|
+
headers: z.record(z.string(), z.string()).describe('stream headers'),
|
|
20
|
+
chunks: z.number().describe('number of chunks'),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const StreamDetailResponseSchema = APIResponseSchema(StreamDetailSchema);
|
|
24
|
+
|
|
25
|
+
export type StreamDetailResponse = z.infer<typeof StreamDetailResponseSchema>;
|
|
26
|
+
export type StreamDetail = z.infer<typeof StreamDetailSchema>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get a specific stream by ID.
|
|
30
|
+
*
|
|
31
|
+
* @param client - The API client
|
|
32
|
+
* @param id - The stream ID
|
|
33
|
+
* @returns A promise that resolves to the stream details
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const stream = await streamGet(client, 'stream_abc123');
|
|
37
|
+
* console.log(`Namespace: ${stream.namespace}, Size: ${stream.sizeBytes} bytes`);
|
|
38
|
+
*/
|
|
39
|
+
export async function streamGet(client: APIClient, id: string): Promise<StreamDetail> {
|
|
40
|
+
const resp = await client.request<StreamDetailResponse>(
|
|
41
|
+
'GET',
|
|
42
|
+
`/cli/stream/${encodeURIComponent(id)}`,
|
|
43
|
+
StreamDetailResponseSchema
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
if (resp.success) {
|
|
47
|
+
return resp.data;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
throw new StreamResponseError({ message: resp.message });
|
|
51
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { SortDirection } from '../../services/pagination.ts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { StreamResponseError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const StreamInfoSchema = z.object({
|
|
7
|
+
id: z.string().describe('the stream id'),
|
|
8
|
+
namespace: z.string().describe('the stream namespace'),
|
|
9
|
+
metadata: z.record(z.string(), z.string()).describe('stream metadata'),
|
|
10
|
+
url: z.string().describe('public URL to access the stream'),
|
|
11
|
+
sizeBytes: z.number().describe('size in bytes'),
|
|
12
|
+
expiresAt: z.string().nullable().describe('ISO 8601 expiration timestamp or null'),
|
|
13
|
+
orgId: z.string().describe('the organization id'),
|
|
14
|
+
projectId: z.string().nullable().describe('the project id'),
|
|
15
|
+
projectName: z.string().nullable().describe('the project name'),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const StreamListDataSchema = z.object({
|
|
19
|
+
streams: z.array(StreamInfoSchema).describe('list of streams'),
|
|
20
|
+
total: z.number().describe('total count of matching streams'),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const StreamListResponseSchema = APIResponseSchema(StreamListDataSchema);
|
|
24
|
+
|
|
25
|
+
export type StreamListResponse = z.infer<typeof StreamListResponseSchema>;
|
|
26
|
+
export type StreamListData = z.infer<typeof StreamListDataSchema>;
|
|
27
|
+
export type StreamInfo = z.infer<typeof StreamInfoSchema>;
|
|
28
|
+
|
|
29
|
+
export interface StreamListOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Filter by specific project ID
|
|
32
|
+
*/
|
|
33
|
+
projectId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Filter by specific organization ID
|
|
36
|
+
*/
|
|
37
|
+
orgId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Filter by stream namespace
|
|
40
|
+
*/
|
|
41
|
+
namespace?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Filter by stream name
|
|
44
|
+
*/
|
|
45
|
+
name?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Maximum number of streams to return (default: 100, max: 1000)
|
|
48
|
+
*/
|
|
49
|
+
limit?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Number of streams to skip for pagination
|
|
52
|
+
*/
|
|
53
|
+
offset?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Filter by metadata key-value pairs
|
|
56
|
+
*/
|
|
57
|
+
metadata?: Record<string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Field to sort by
|
|
60
|
+
*/
|
|
61
|
+
sort?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Sort direction (default: 'desc')
|
|
64
|
+
*/
|
|
65
|
+
direction?: SortDirection;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* List streams with optional filtering.
|
|
70
|
+
*
|
|
71
|
+
* If no projectId or orgId is provided, returns streams from all orgs the user is a member of.
|
|
72
|
+
*
|
|
73
|
+
* @param client - The API client
|
|
74
|
+
* @param options - Filtering and pagination options
|
|
75
|
+
* @returns A promise that resolves to the list of streams with metadata
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // List all streams across all orgs
|
|
79
|
+
* const result = await streamList(client);
|
|
80
|
+
* console.log(`Found ${result.total} streams`);
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // List streams for a specific project
|
|
84
|
+
* const result = await streamList(client, { projectId: 'proj_123' });
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // List streams with namespace filter
|
|
88
|
+
* const result = await streamList(client, { namespace: 'agent-logs' });
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // List streams with metadata filter
|
|
92
|
+
* const result = await streamList(client, {
|
|
93
|
+
* metadata: { type: 'export', env: 'production' }
|
|
94
|
+
* });
|
|
95
|
+
*/
|
|
96
|
+
export async function streamList(
|
|
97
|
+
client: APIClient,
|
|
98
|
+
options: StreamListOptions = {}
|
|
99
|
+
): Promise<StreamListData> {
|
|
100
|
+
const { projectId, orgId, namespace, name, limit, offset, metadata } = options;
|
|
101
|
+
const params = new URLSearchParams();
|
|
102
|
+
|
|
103
|
+
if (projectId) params.set('projectId', projectId);
|
|
104
|
+
if (orgId) params.set('orgId', orgId);
|
|
105
|
+
if (namespace) params.set('namespace', namespace);
|
|
106
|
+
if (name) params.set('name', name);
|
|
107
|
+
if (limit !== undefined) params.set('limit', limit.toString());
|
|
108
|
+
if (offset !== undefined) params.set('offset', offset.toString());
|
|
109
|
+
if (metadata && Object.keys(metadata).length > 0) {
|
|
110
|
+
params.set('metadata', JSON.stringify(metadata));
|
|
111
|
+
}
|
|
112
|
+
if (options.sort) params.set('sort', options.sort);
|
|
113
|
+
if (options.direction) params.set('direction', options.direction);
|
|
114
|
+
|
|
115
|
+
const queryString = params.toString();
|
|
116
|
+
const resp = await client.request<StreamListResponse>(
|
|
117
|
+
'GET',
|
|
118
|
+
`/cli/stream${queryString ? `?${queryString}` : ''}`,
|
|
119
|
+
StreamListResponseSchema
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
if (resp.success) {
|
|
123
|
+
return resp.data;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
throw new StreamResponseError({ message: resp.message });
|
|
127
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIClient, APIResponseSchemaNoData } from '../api.ts';
|
|
3
|
+
import { ThreadResponseError } from './util.ts';
|
|
4
|
+
|
|
5
|
+
export const _ThreadDeleteRequestSchema = z.object({
|
|
6
|
+
id: z.string().describe('the thread id'),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const ThreadDeleteResponseSchema = APIResponseSchemaNoData();
|
|
10
|
+
|
|
11
|
+
export type ThreadDeleteRequest = z.infer<typeof _ThreadDeleteRequestSchema>;
|
|
12
|
+
export type ThreadDeleteResponse = z.infer<typeof ThreadDeleteResponseSchema>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Delete a thread by id
|
|
16
|
+
*
|
|
17
|
+
* @param client
|
|
18
|
+
* @param request
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export async function threadDelete(client: APIClient, request: ThreadDeleteRequest): Promise<void> {
|
|
22
|
+
const resp = await client.request<ThreadDeleteResponse>(
|
|
23
|
+
'DELETE',
|
|
24
|
+
`/thread/${request.id}`,
|
|
25
|
+
ThreadDeleteResponseSchema
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (!resp.success) {
|
|
29
|
+
throw new ThreadResponseError({ message: resp.message });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ThreadSchema, type Thread } from './list.ts';
|
|
4
|
+
import { ThreadResponseError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const _ThreadGetRequestSchema = z.object({
|
|
7
|
+
id: z.string().describe('the thread id'),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const ThreadGetResponseSchema = APIResponseSchema(ThreadSchema);
|
|
11
|
+
|
|
12
|
+
export type ThreadGetRequest = z.infer<typeof _ThreadGetRequestSchema>;
|
|
13
|
+
export type ThreadGetResponse = z.infer<typeof ThreadGetResponseSchema>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get a single thread by id
|
|
17
|
+
*
|
|
18
|
+
* @param client
|
|
19
|
+
* @param request
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export async function threadGet(client: APIClient, request: ThreadGetRequest): Promise<Thread> {
|
|
23
|
+
const resp = await client.request<ThreadGetResponse>(
|
|
24
|
+
'GET',
|
|
25
|
+
`/thread/${encodeURIComponent(request.id)}`,
|
|
26
|
+
ThreadGetResponseSchema
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
if (resp.success) {
|
|
30
|
+
return resp.data;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
throw new ThreadResponseError({ message: resp.message });
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { SortDirection } from '../../services/pagination.ts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { ThreadResponseError } from './util.ts';
|
|
5
|
+
|
|
6
|
+
export const ThreadSchema = z.object({
|
|
7
|
+
id: z.string().describe('the thread id'),
|
|
8
|
+
created_at: z.string().describe('the creation timestamp'),
|
|
9
|
+
updated_at: z.string().describe('the last update timestamp'),
|
|
10
|
+
deleted: z.boolean().describe('whether the thread is deleted'),
|
|
11
|
+
deleted_at: z.string().nullable().describe('the deletion timestamp'),
|
|
12
|
+
deleted_by: z.string().nullable().describe('who deleted the thread'),
|
|
13
|
+
org_id: z.string().describe('the organization id'),
|
|
14
|
+
project_id: z.string().describe('the project id'),
|
|
15
|
+
user_data: z.string().nullable().optional().describe('the user data as JSON'),
|
|
16
|
+
metadata: z
|
|
17
|
+
.record(z.string(), z.unknown())
|
|
18
|
+
.nullable()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('unencrypted key-value metadata'),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const ThreadListResponseData = z.array(ThreadSchema);
|
|
24
|
+
|
|
25
|
+
export const ThreadListResponseSchema = APIResponseSchema(ThreadListResponseData);
|
|
26
|
+
|
|
27
|
+
export type ThreadListResponse = z.infer<typeof ThreadListResponseSchema>;
|
|
28
|
+
export type ThreadList = z.infer<typeof ThreadListResponseData>;
|
|
29
|
+
export type Thread = z.infer<typeof ThreadSchema>;
|
|
30
|
+
|
|
31
|
+
export type ThreadSortField = 'created' | 'updated';
|
|
32
|
+
|
|
33
|
+
export interface ThreadListOptions {
|
|
34
|
+
count?: number;
|
|
35
|
+
limit?: number;
|
|
36
|
+
offset?: number;
|
|
37
|
+
sort?: ThreadSortField;
|
|
38
|
+
direction?: SortDirection;
|
|
39
|
+
orgId?: string;
|
|
40
|
+
projectId?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* List threads
|
|
46
|
+
*
|
|
47
|
+
* @param client
|
|
48
|
+
* @param options filtering and pagination options
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
export async function threadList(
|
|
52
|
+
client: APIClient,
|
|
53
|
+
options: ThreadListOptions = {}
|
|
54
|
+
): Promise<ThreadList> {
|
|
55
|
+
const { limit, count, offset, sort, direction, orgId, projectId, metadata } = options;
|
|
56
|
+
const resolvedLimit = limit ?? count ?? 10;
|
|
57
|
+
const params = new URLSearchParams({ limit: resolvedLimit.toString() });
|
|
58
|
+
if (orgId) params.set('orgId', orgId);
|
|
59
|
+
if (projectId) params.set('projectId', projectId);
|
|
60
|
+
if (offset !== undefined) params.set('offset', offset.toString());
|
|
61
|
+
if (sort) params.set('sort', sort);
|
|
62
|
+
if (direction) params.set('direction', direction);
|
|
63
|
+
if (metadata) params.set('metadata', JSON.stringify(metadata));
|
|
64
|
+
|
|
65
|
+
const resp = await client.request<ThreadListResponse>(
|
|
66
|
+
'GET',
|
|
67
|
+
`/thread?${params.toString()}`,
|
|
68
|
+
ThreadListResponseSchema
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
if (resp.success) {
|
|
72
|
+
return resp.data;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
throw new ThreadResponseError({ message: resp.message });
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './whoami.ts';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema, APIClient } from '../api.ts';
|
|
3
|
+
import { UserResponseError } from './util.ts';
|
|
4
|
+
|
|
5
|
+
export const OrganizationSchema = z.object({
|
|
6
|
+
id: z.string().describe('the unique id for the organization'),
|
|
7
|
+
name: z.string().describe('the name of the organization'),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const WhoamiResponse = z.object({
|
|
11
|
+
firstName: z.string().describe('the first name of the user'),
|
|
12
|
+
lastName: z.string().describe('the last name of the user'),
|
|
13
|
+
organizations: z.array(OrganizationSchema).describe('the organizations the user is a member of'),
|
|
14
|
+
});
|
|
15
|
+
export const WhoamiResponseSchema = APIResponseSchema(WhoamiResponse);
|
|
16
|
+
|
|
17
|
+
export type WhoamiResponse = z.infer<typeof WhoamiResponseSchema>;
|
|
18
|
+
export type User = z.infer<typeof WhoamiResponse>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get the current authenticated user information
|
|
22
|
+
*
|
|
23
|
+
* @param client
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export async function whoami(client: APIClient): Promise<User> {
|
|
27
|
+
const resp = await client.get<WhoamiResponse>('/cli/auth/user', WhoamiResponseSchema);
|
|
28
|
+
if (resp.success) {
|
|
29
|
+
return resp.data;
|
|
30
|
+
}
|
|
31
|
+
throw new UserResponseError({ message: resp.message });
|
|
32
|
+
}
|