@agentuity/core 1.0.33 → 1.0.35
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/index.d.ts +2 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -15
- package/dist/index.js.map +1 -1
- package/dist/services/adapter.d.ts +57 -22
- package/dist/services/adapter.d.ts.map +1 -1
- package/dist/services/adapter.js +52 -1
- package/dist/services/adapter.js.map +1 -1
- package/dist/services/api.d.ts +222 -0
- package/dist/services/api.d.ts.map +1 -0
- package/dist/services/api.js +662 -0
- package/dist/services/api.js.map +1 -0
- package/dist/services/apikey/create.d.ts +34 -0
- package/dist/services/apikey/create.d.ts.map +1 -0
- package/dist/services/apikey/create.js +29 -0
- package/dist/services/apikey/create.js.map +1 -0
- package/dist/services/apikey/delete.d.ts.map +1 -0
- package/dist/services/apikey/delete.js.map +1 -0
- package/dist/services/apikey/get.d.ts.map +1 -0
- package/dist/services/apikey/get.js.map +1 -0
- package/dist/services/apikey/index.d.ts.map +1 -0
- package/dist/services/apikey/index.js.map +1 -0
- package/dist/services/apikey/list.d.ts +65 -0
- package/dist/services/apikey/list.d.ts.map +1 -0
- package/dist/services/apikey/list.js +50 -0
- package/dist/services/apikey/list.js.map +1 -0
- package/dist/services/apikey/util.d.ts.map +1 -0
- package/dist/services/apikey/util.js.map +1 -0
- package/dist/services/config.d.ts +22 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +55 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/db/index.d.ts +6 -0
- package/dist/services/db/index.d.ts.map +1 -0
- package/dist/services/db/index.js +6 -0
- package/dist/services/db/index.js.map +1 -0
- package/dist/services/db/logs.d.ts.map +1 -0
- package/dist/services/db/logs.js.map +1 -0
- package/dist/services/db/query.d.ts +40 -0
- package/dist/services/db/query.d.ts.map +1 -0
- package/dist/services/db/query.js +55 -0
- package/dist/services/db/query.js.map +1 -0
- package/dist/services/db/stats.d.ts +146 -0
- package/dist/services/db/stats.d.ts.map +1 -0
- package/dist/services/db/stats.js +94 -0
- package/dist/services/db/stats.js.map +1 -0
- package/dist/services/db/tables.d.ts +50 -0
- package/dist/services/db/tables.d.ts.map +1 -0
- package/dist/services/db/tables.js +64 -0
- package/dist/services/db/tables.js.map +1 -0
- package/dist/services/db/util.d.ts.map +1 -0
- package/dist/services/db/util.js.map +1 -0
- package/dist/services/email/index.d.ts +2 -0
- package/dist/services/email/index.d.ts.map +1 -0
- package/dist/services/email/index.js +2 -0
- package/dist/services/email/index.js.map +1 -0
- package/dist/services/email/service.d.ts +742 -0
- package/dist/services/email/service.d.ts.map +1 -0
- package/dist/services/email/service.js +1107 -0
- package/dist/services/email/service.js.map +1 -0
- package/dist/services/env.d.ts.map +1 -0
- package/dist/services/env.js.map +1 -0
- package/dist/services/eval/events.d.ts +93 -0
- package/dist/services/eval/events.d.ts.map +1 -0
- package/dist/services/eval/events.js +24 -0
- package/dist/services/eval/events.js.map +1 -0
- package/dist/services/eval/get.d.ts.map +1 -0
- package/dist/services/eval/get.js.map +1 -0
- package/dist/services/eval/index.d.ts +6 -0
- package/dist/services/eval/index.d.ts.map +1 -0
- package/dist/services/eval/index.js +6 -0
- package/dist/services/eval/index.js.map +1 -0
- package/dist/services/eval/list.d.ts.map +1 -0
- package/dist/services/eval/list.js.map +1 -0
- package/dist/services/eval/run-get.d.ts.map +1 -0
- package/dist/services/eval/run-get.js.map +1 -0
- package/dist/services/eval/run-list.d.ts.map +1 -0
- package/dist/services/eval/run-list.js.map +1 -0
- package/dist/services/exception.d.ts +28 -9
- package/dist/services/exception.d.ts.map +1 -1
- package/dist/services/exception.js +14 -0
- package/dist/services/exception.js.map +1 -1
- package/dist/services/index.d.ts +26 -12
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +26 -11
- package/dist/services/index.js.map +1 -1
- package/dist/services/keyvalue/index.d.ts +2 -0
- package/dist/services/keyvalue/index.d.ts.map +1 -0
- package/dist/services/keyvalue/index.js +2 -0
- package/dist/services/keyvalue/index.js.map +1 -0
- package/dist/services/keyvalue/service.d.ts +261 -0
- package/dist/services/keyvalue/service.d.ts.map +1 -0
- package/dist/services/keyvalue/service.js +475 -0
- package/dist/services/keyvalue/service.js.map +1 -0
- package/dist/services/logger.d.ts.map +1 -0
- package/dist/services/logger.js.map +1 -0
- package/dist/services/machine/index.d.ts.map +1 -0
- package/dist/services/machine/index.js.map +1 -0
- package/dist/services/machine/machine.d.ts.map +1 -0
- package/dist/services/machine/machine.js +177 -0
- package/dist/services/machine/machine.js.map +1 -0
- package/dist/services/machine/util.d.ts.map +1 -0
- package/dist/services/machine/util.js.map +1 -0
- package/dist/services/org/env-delete.d.ts.map +1 -0
- package/dist/services/org/env-delete.js.map +1 -0
- package/dist/services/org/env-get.d.ts +33 -0
- package/dist/services/org/env-get.d.ts.map +1 -0
- package/dist/services/org/env-get.js +33 -0
- package/dist/services/org/env-get.js.map +1 -0
- package/dist/services/org/env-update.d.ts.map +1 -0
- package/dist/services/org/env-update.js.map +1 -0
- package/dist/services/org/index.d.ts.map +1 -0
- package/dist/services/org/index.js.map +1 -0
- package/dist/services/org/list.d.ts.map +1 -0
- package/dist/services/org/list.js.map +1 -0
- package/dist/services/org/resources.d.ts +150 -0
- package/dist/services/org/resources.d.ts.map +1 -0
- package/dist/services/org/resources.js +111 -0
- package/dist/services/org/resources.js.map +1 -0
- package/dist/services/org/util.d.ts.map +1 -0
- package/dist/services/org/util.js.map +1 -0
- package/dist/services/pagination.d.ts +38 -11
- package/dist/services/pagination.d.ts.map +1 -1
- package/dist/services/pagination.js +30 -1
- package/dist/services/pagination.js.map +1 -1
- package/dist/services/project/agent.d.ts.map +1 -0
- package/dist/services/project/agent.js.map +1 -0
- package/dist/services/project/create.d.ts.map +1 -0
- package/dist/services/project/create.js.map +1 -0
- package/dist/services/project/delete.d.ts.map +1 -0
- package/dist/services/project/delete.js +15 -0
- package/dist/services/project/delete.js.map +1 -0
- package/dist/services/project/deploy.d.ts +468 -0
- package/dist/services/project/deploy.d.ts.map +1 -0
- package/dist/services/project/deploy.js.map +1 -0
- package/dist/services/project/deployment.d.ts.map +1 -0
- package/dist/services/project/deployment.js +180 -0
- package/dist/services/project/deployment.js.map +1 -0
- package/dist/services/project/env-delete.d.ts.map +1 -0
- package/dist/services/project/env-delete.js.map +1 -0
- package/dist/services/project/env-update.d.ts.map +1 -0
- package/dist/services/project/env-update.js.map +1 -0
- package/dist/services/project/exists.d.ts.map +1 -0
- package/dist/services/project/exists.js.map +1 -0
- package/dist/services/project/get.d.ts.map +1 -0
- package/dist/services/project/get.js.map +1 -0
- package/dist/services/project/hostname.d.ts.map +1 -0
- package/dist/services/project/hostname.js +43 -0
- package/dist/services/project/hostname.js.map +1 -0
- package/dist/services/project/index.d.ts.map +1 -0
- package/dist/services/project/index.js.map +1 -0
- package/dist/services/project/list.d.ts.map +1 -0
- package/dist/services/project/list.js.map +1 -0
- package/dist/services/project/malware.d.ts.map +1 -0
- package/dist/services/project/malware.js +57 -0
- package/dist/services/project/malware.js.map +1 -0
- package/dist/services/project/update-region.d.ts.map +1 -0
- package/dist/services/project/update-region.js.map +1 -0
- package/dist/services/project/util.d.ts.map +1 -0
- package/dist/services/project/util.js.map +1 -0
- package/dist/services/queue/analytics.d.ts +261 -0
- package/dist/services/queue/analytics.d.ts.map +1 -0
- package/dist/services/queue/analytics.js +254 -0
- package/dist/services/queue/analytics.js.map +1 -0
- package/dist/services/queue/consumers.d.ts +48 -0
- package/dist/services/queue/consumers.d.ts.map +1 -0
- package/dist/services/queue/consumers.js +43 -0
- package/dist/services/queue/consumers.js.map +1 -0
- package/dist/services/queue/destinations.d.ts +269 -0
- package/dist/services/queue/destinations.d.ts.map +1 -0
- package/dist/services/queue/destinations.js +215 -0
- package/dist/services/queue/destinations.js.map +1 -0
- package/dist/services/queue/dlq.d.ts +170 -0
- package/dist/services/queue/dlq.d.ts.map +1 -0
- package/dist/services/queue/dlq.js.map +1 -0
- package/dist/services/queue/index.d.ts +58 -0
- package/dist/services/queue/index.d.ts.map +1 -0
- package/dist/services/queue/index.js +98 -0
- package/dist/services/queue/index.js.map +1 -0
- package/dist/services/queue/messages.d.ts +511 -0
- package/dist/services/queue/messages.d.ts.map +1 -0
- package/dist/services/queue/messages.js.map +1 -0
- package/dist/services/queue/queues.d.ts +228 -0
- package/dist/services/queue/queues.d.ts.map +1 -0
- package/dist/services/queue/queues.js.map +1 -0
- package/dist/services/queue/service.d.ts +309 -0
- package/dist/services/queue/service.d.ts.map +1 -0
- package/dist/services/queue/service.js +456 -0
- package/dist/services/queue/service.js.map +1 -0
- package/dist/services/queue/sources.d.ts +252 -0
- package/dist/services/queue/sources.d.ts.map +1 -0
- package/dist/services/queue/sources.js +249 -0
- package/dist/services/queue/sources.js.map +1 -0
- package/dist/services/queue/types.d.ts +1335 -0
- package/dist/services/queue/types.d.ts.map +1 -0
- package/dist/services/queue/types.js +1382 -0
- package/dist/services/queue/types.js.map +1 -0
- package/dist/services/queue/util.d.ts +278 -0
- package/dist/services/queue/util.d.ts.map +1 -0
- package/dist/services/queue/util.js +233 -0
- package/dist/services/queue/util.js.map +1 -0
- package/dist/services/queue/validation.d.ts +218 -0
- package/dist/services/queue/validation.d.ts.map +1 -0
- package/dist/services/queue/validation.js +498 -0
- package/dist/services/queue/validation.js.map +1 -0
- package/dist/services/queue/websocket.d.ts +154 -0
- package/dist/services/queue/websocket.d.ts.map +1 -0
- package/dist/services/queue/websocket.js +491 -0
- package/dist/services/queue/websocket.js.map +1 -0
- package/dist/services/region/create.d.ts.map +1 -0
- package/dist/services/region/create.js.map +1 -0
- package/dist/services/region/delete.d.ts.map +1 -0
- package/dist/services/region/delete.js.map +1 -0
- package/dist/services/region/index.d.ts.map +1 -0
- package/dist/services/region/index.js.map +1 -0
- package/dist/services/region/list.d.ts.map +1 -0
- package/dist/services/region/list.js.map +1 -0
- package/dist/services/region/resources.d.ts.map +1 -0
- package/dist/services/region/resources.js.map +1 -0
- package/dist/services/region/util.d.ts.map +1 -0
- package/dist/services/region/util.js.map +1 -0
- package/dist/services/sandbox/cli-list.d.ts +103 -0
- package/dist/services/sandbox/cli-list.d.ts.map +1 -0
- package/dist/services/sandbox/cli-list.js +106 -0
- package/dist/services/sandbox/cli-list.js.map +1 -0
- package/dist/services/sandbox/client.d.ts +173 -0
- package/dist/services/sandbox/client.d.ts.map +1 -0
- package/dist/services/sandbox/client.js +302 -0
- package/dist/services/sandbox/client.js.map +1 -0
- package/dist/services/sandbox/create.d.ts +193 -0
- package/dist/services/sandbox/create.d.ts.map +1 -0
- package/dist/services/sandbox/create.js +215 -0
- package/dist/services/sandbox/create.js.map +1 -0
- package/dist/services/sandbox/destroy.d.ts +23 -0
- package/dist/services/sandbox/destroy.d.ts.map +1 -0
- package/dist/services/sandbox/destroy.js +30 -0
- package/dist/services/sandbox/destroy.js.map +1 -0
- package/dist/services/sandbox/disk-checkpoint.d.ts +108 -0
- package/dist/services/sandbox/disk-checkpoint.d.ts.map +1 -0
- package/dist/services/sandbox/disk-checkpoint.js +124 -0
- package/dist/services/sandbox/disk-checkpoint.js.map +1 -0
- package/dist/services/sandbox/execute.d.ts +96 -0
- package/dist/services/sandbox/execute.d.ts.map +1 -0
- package/dist/services/sandbox/execute.js +109 -0
- package/dist/services/sandbox/execute.js.map +1 -0
- package/dist/services/sandbox/execution.d.ts +145 -0
- package/dist/services/sandbox/execution.d.ts.map +1 -0
- package/dist/services/sandbox/execution.js +113 -0
- package/dist/services/sandbox/execution.js.map +1 -0
- package/dist/services/sandbox/files.d.ts +269 -0
- package/dist/services/sandbox/files.d.ts.map +1 -0
- package/dist/services/sandbox/files.js +454 -0
- package/dist/services/sandbox/files.js.map +1 -0
- package/dist/services/sandbox/get.d.ts +284 -0
- package/dist/services/sandbox/get.d.ts.map +1 -0
- package/dist/services/sandbox/get.js +231 -0
- package/dist/services/sandbox/get.js.map +1 -0
- package/dist/services/sandbox/getStatus.d.ts +20 -0
- package/dist/services/sandbox/getStatus.d.ts.map +1 -0
- package/dist/services/sandbox/getStatus.js +36 -0
- package/dist/services/sandbox/getStatus.js.map +1 -0
- package/dist/services/sandbox/index.d.ts +40 -0
- package/dist/services/sandbox/index.d.ts.map +1 -0
- package/dist/services/sandbox/index.js +21 -0
- package/dist/services/sandbox/index.js.map +1 -0
- package/dist/services/sandbox/list.d.ts +327 -0
- package/dist/services/sandbox/list.d.ts.map +1 -0
- package/dist/services/sandbox/list.js +204 -0
- package/dist/services/sandbox/list.js.map +1 -0
- package/dist/services/sandbox/pause.d.ts +23 -0
- package/dist/services/sandbox/pause.d.ts.map +1 -0
- package/dist/services/sandbox/pause.js +30 -0
- package/dist/services/sandbox/pause.js.map +1 -0
- package/dist/services/sandbox/resolve.d.ts +75 -0
- package/dist/services/sandbox/resolve.d.ts.map +1 -0
- package/dist/services/sandbox/resolve.js +76 -0
- package/dist/services/sandbox/resolve.js.map +1 -0
- package/dist/services/sandbox/resume.d.ts +23 -0
- package/dist/services/sandbox/resume.d.ts.map +1 -0
- package/dist/services/sandbox/resume.js +30 -0
- package/dist/services/sandbox/resume.js.map +1 -0
- package/dist/services/sandbox/run.d.ts +71 -0
- package/dist/services/sandbox/run.d.ts.map +1 -0
- package/dist/services/sandbox/run.js +355 -0
- package/dist/services/sandbox/run.js.map +1 -0
- package/dist/services/sandbox/runtime.d.ts +94 -0
- package/dist/services/sandbox/runtime.d.ts.map +1 -0
- package/dist/services/sandbox/runtime.js +82 -0
- package/dist/services/sandbox/runtime.js.map +1 -0
- package/dist/services/sandbox/snapshot-build.d.ts.map +1 -0
- package/dist/services/sandbox/snapshot-build.js.map +1 -0
- package/dist/services/sandbox/snapshot.d.ts +596 -0
- package/dist/services/sandbox/snapshot.d.ts.map +1 -0
- package/dist/services/sandbox/snapshot.js +612 -0
- package/dist/services/sandbox/snapshot.js.map +1 -0
- package/dist/services/sandbox/types.d.ts +851 -0
- package/dist/services/sandbox/types.d.ts.map +1 -0
- package/dist/services/sandbox/types.js +674 -0
- package/dist/services/sandbox/types.js.map +1 -0
- package/dist/services/sandbox/util.d.ts +295 -0
- package/dist/services/sandbox/util.d.ts.map +1 -0
- package/dist/services/sandbox/util.js +233 -0
- package/dist/services/sandbox/util.js.map +1 -0
- package/dist/services/schedule/index.d.ts +2 -0
- package/dist/services/schedule/index.d.ts.map +1 -0
- package/dist/services/schedule/index.js +2 -0
- package/dist/services/schedule/index.js.map +1 -0
- package/dist/services/schedule/service.d.ts +439 -0
- package/dist/services/schedule/service.d.ts.map +1 -0
- package/dist/services/schedule/service.js +701 -0
- package/dist/services/schedule/service.js.map +1 -0
- package/dist/services/session/events.d.ts +127 -0
- package/dist/services/session/events.d.ts.map +1 -0
- package/dist/services/session/events.js +42 -0
- package/dist/services/session/events.js.map +1 -0
- package/dist/services/session/get.d.ts +170 -0
- package/dist/services/session/get.d.ts.map +1 -0
- package/dist/services/session/get.js.map +1 -0
- package/dist/services/session/index.d.ts +5 -0
- package/dist/services/session/index.d.ts.map +1 -0
- package/dist/services/session/index.js +5 -0
- package/dist/services/session/index.js.map +1 -0
- package/dist/services/session/list.d.ts +150 -0
- package/dist/services/session/list.d.ts.map +1 -0
- package/dist/services/session/list.js +117 -0
- package/dist/services/session/list.js.map +1 -0
- package/dist/services/session/logs.d.ts.map +1 -0
- package/dist/services/session/logs.js.map +1 -0
- package/dist/services/session/util.d.ts.map +1 -0
- package/dist/services/session/util.js.map +1 -0
- package/dist/services/stats.d.ts +261 -0
- package/dist/services/stats.d.ts.map +1 -0
- package/dist/services/stats.js +181 -0
- package/dist/services/stats.js.map +1 -0
- package/dist/services/storage/config.d.ts.map +1 -0
- package/dist/services/storage/config.js.map +1 -0
- package/dist/services/storage/index.d.ts.map +1 -0
- package/dist/services/storage/index.js.map +1 -0
- package/dist/services/storage/objects.d.ts +158 -0
- package/dist/services/storage/objects.d.ts.map +1 -0
- package/dist/services/storage/objects.js +161 -0
- package/dist/services/storage/objects.js.map +1 -0
- package/dist/services/storage/types.d.ts.map +1 -0
- package/dist/services/storage/types.js.map +1 -0
- package/dist/services/storage/util.d.ts.map +1 -0
- package/dist/services/storage/util.js.map +1 -0
- package/dist/services/stream/get.d.ts.map +1 -0
- package/dist/services/stream/get.js.map +1 -0
- package/dist/services/stream/index.d.ts +5 -0
- package/dist/services/stream/index.d.ts.map +1 -0
- package/dist/services/stream/index.js +5 -0
- package/dist/services/stream/index.js.map +1 -0
- package/dist/services/stream/list.d.ts +96 -0
- package/dist/services/stream/list.d.ts.map +1 -0
- package/dist/services/stream/list.js +92 -0
- package/dist/services/stream/list.js.map +1 -0
- package/dist/services/stream/service.d.ts +264 -0
- package/dist/services/stream/service.d.ts.map +1 -0
- package/dist/services/stream/service.js +631 -0
- package/dist/services/stream/service.js.map +1 -0
- package/dist/services/stream/util.d.ts.map +1 -0
- package/dist/services/stream/util.js.map +1 -0
- package/dist/services/task/index.d.ts +2 -0
- package/dist/services/task/index.d.ts.map +1 -0
- package/dist/services/task/index.js +2 -0
- package/dist/services/task/index.js.map +1 -0
- package/dist/services/task/service.d.ts +1491 -0
- package/dist/services/task/service.d.ts.map +1 -0
- package/dist/services/task/service.js +1887 -0
- package/dist/services/task/service.js.map +1 -0
- package/dist/services/thread/delete.d.ts.map +1 -0
- package/dist/services/thread/delete.js.map +1 -0
- package/dist/services/thread/get.d.ts.map +1 -0
- package/dist/services/thread/get.js.map +1 -0
- package/dist/services/thread/index.d.ts.map +1 -0
- package/dist/services/thread/index.js.map +1 -0
- package/dist/services/thread/list.d.ts +75 -0
- package/dist/services/thread/list.d.ts.map +1 -0
- package/dist/services/thread/list.js +65 -0
- package/dist/services/thread/list.js.map +1 -0
- package/dist/services/thread/util.d.ts.map +1 -0
- package/dist/services/thread/util.js.map +1 -0
- package/dist/services/user/index.d.ts.map +1 -0
- package/dist/services/user/index.js.map +1 -0
- package/dist/services/user/util.d.ts.map +1 -0
- package/dist/services/user/util.js.map +1 -0
- package/dist/services/user/whoami.d.ts.map +1 -0
- package/dist/services/user/whoami.js.map +1 -0
- package/dist/services/vector/index.d.ts +2 -0
- package/dist/services/vector/index.d.ts.map +1 -0
- package/dist/services/vector/index.js +2 -0
- package/dist/services/vector/index.js.map +1 -0
- package/dist/services/vector/service.d.ts +459 -0
- package/dist/services/vector/service.d.ts.map +1 -0
- package/dist/services/vector/service.js +707 -0
- package/dist/services/vector/service.js.map +1 -0
- package/dist/services/webhook/analytics.d.ts +77 -0
- package/dist/services/webhook/analytics.d.ts.map +1 -0
- package/dist/services/webhook/analytics.js +56 -0
- package/dist/services/webhook/analytics.js.map +1 -0
- package/dist/services/webhook/deliveries.d.ts +94 -0
- package/dist/services/webhook/deliveries.d.ts.map +1 -0
- package/dist/services/webhook/deliveries.js.map +1 -0
- package/dist/services/webhook/destinations.d.ts +140 -0
- package/dist/services/webhook/destinations.d.ts.map +1 -0
- package/dist/services/webhook/destinations.js.map +1 -0
- package/dist/services/webhook/index.d.ts +43 -0
- package/dist/services/webhook/index.d.ts.map +1 -0
- package/dist/services/webhook/index.js +64 -0
- package/dist/services/webhook/index.js.map +1 -0
- package/dist/services/webhook/receipts.d.ts.map +1 -0
- package/dist/services/webhook/receipts.js.map +1 -0
- package/dist/services/webhook/service.d.ts +374 -0
- package/dist/services/webhook/service.d.ts.map +1 -0
- package/dist/services/webhook/service.js +663 -0
- package/dist/services/webhook/service.js.map +1 -0
- package/dist/services/webhook/types.d.ts +182 -0
- package/dist/services/webhook/types.d.ts.map +1 -0
- package/dist/services/webhook/types.js +188 -0
- package/dist/services/webhook/types.js.map +1 -0
- package/dist/services/webhook/util.d.ts.map +1 -0
- package/dist/services/webhook/util.js.map +1 -0
- package/dist/services/webhook/webhooks.d.ts +150 -0
- package/dist/services/webhook/webhooks.d.ts.map +1 -0
- package/dist/services/webhook/webhooks.js.map +1 -0
- package/package.json +59 -7
- package/src/index.ts +6 -247
- package/src/services/adapter.ts +69 -24
- package/src/services/api.ts +951 -0
- package/src/services/apikey/create.ts +48 -0
- package/src/services/apikey/list.ts +66 -0
- package/src/services/config.ts +65 -0
- package/src/services/db/index.ts +42 -0
- package/src/services/db/query.ts +69 -0
- package/src/services/db/stats.ts +121 -0
- package/src/services/db/tables.ts +94 -0
- package/src/services/email/index.ts +1 -0
- package/src/services/email/service.ts +1476 -0
- package/src/services/eval/index.ts +29 -0
- package/src/services/exception.ts +16 -7
- package/src/services/index.ts +29 -28
- package/src/services/keyvalue/index.ts +1 -0
- package/src/services/keyvalue/service.ts +677 -0
- package/src/services/machine/machine.ts +228 -0
- package/src/services/org/env-get.ts +48 -0
- package/src/services/org/resources.ts +140 -0
- package/src/services/pagination.ts +40 -11
- package/src/services/project/delete.ts +27 -0
- package/src/services/project/deploy.ts +433 -0
- package/src/services/project/deployment.ts +250 -0
- package/src/services/project/hostname.ts +79 -0
- package/src/services/project/malware.ts +85 -0
- package/src/services/queue/analytics.ts +343 -0
- package/src/services/queue/consumers.ts +56 -0
- package/src/services/queue/destinations.ts +329 -0
- package/src/services/queue/index.ts +339 -0
- package/src/services/queue/service.ts +634 -0
- package/src/services/queue/sources.ts +364 -0
- package/src/services/queue/types.ts +1666 -0
- package/src/services/queue/util.ts +275 -0
- package/src/services/queue/validation.ts +541 -0
- package/src/services/queue/websocket.ts +578 -0
- package/src/services/sandbox/cli-list.ts +117 -0
- package/src/services/sandbox/client.ts +435 -0
- package/src/services/sandbox/create.ts +249 -0
- package/src/services/sandbox/destroy.ts +43 -0
- package/src/services/sandbox/disk-checkpoint.ts +184 -0
- package/src/services/sandbox/execute.ts +134 -0
- package/src/services/sandbox/execution.ts +144 -0
- package/src/services/sandbox/files.ts +608 -0
- package/src/services/sandbox/get.ts +262 -0
- package/src/services/sandbox/getStatus.ts +51 -0
- package/src/services/sandbox/index.ts +230 -0
- package/src/services/sandbox/list.ts +234 -0
- package/src/services/sandbox/pause.ts +41 -0
- package/src/services/sandbox/resolve.ts +96 -0
- package/src/services/sandbox/resume.ts +41 -0
- package/src/services/sandbox/run.ts +441 -0
- package/src/services/sandbox/runtime.ts +106 -0
- package/src/services/sandbox/snapshot.ts +791 -0
- package/src/services/sandbox/types.ts +798 -0
- package/src/services/sandbox/util.ts +279 -0
- package/src/services/schedule/index.ts +1 -0
- package/src/services/schedule/service.ts +814 -0
- package/src/services/session/get.ts +108 -0
- package/src/services/session/index.ts +4 -0
- package/src/services/session/list.ts +143 -0
- package/src/services/stats.ts +232 -0
- package/src/services/storage/objects.ts +256 -0
- package/src/services/stream/index.ts +14 -0
- package/src/services/stream/list.ts +105 -0
- package/src/services/stream/service.ts +929 -0
- package/src/services/task/index.ts +1 -0
- package/src/services/task/service.ts +2573 -0
- package/src/services/thread/list.ts +81 -0
- package/src/services/vector/index.ts +1 -0
- package/src/services/vector/service.ts +1242 -0
- package/src/services/webhook/analytics.ts +80 -0
- package/src/services/webhook/index.ts +160 -0
- package/src/services/webhook/service.ts +900 -0
- package/src/services/webhook/types.ts +277 -0
- package/dist/api/api.d.ts +0 -226
- package/dist/api/api.d.ts.map +0 -1
- package/dist/api/api.js +0 -635
- package/dist/api/api.js.map +0 -1
- package/dist/api/apikey/create.d.ts +0 -33
- package/dist/api/apikey/create.d.ts.map +0 -1
- package/dist/api/apikey/create.js +0 -23
- package/dist/api/apikey/create.js.map +0 -1
- package/dist/api/apikey/delete.d.ts.map +0 -1
- package/dist/api/apikey/delete.js.map +0 -1
- package/dist/api/apikey/get.d.ts.map +0 -1
- package/dist/api/apikey/get.js.map +0 -1
- package/dist/api/apikey/index.d.ts.map +0 -1
- package/dist/api/apikey/index.js.map +0 -1
- package/dist/api/apikey/list.d.ts +0 -64
- package/dist/api/apikey/list.d.ts.map +0 -1
- package/dist/api/apikey/list.js +0 -46
- package/dist/api/apikey/list.js.map +0 -1
- package/dist/api/apikey/util.d.ts.map +0 -1
- package/dist/api/apikey/util.js.map +0 -1
- package/dist/api/config.d.ts +0 -20
- package/dist/api/config.d.ts.map +0 -1
- package/dist/api/config.js +0 -43
- package/dist/api/config.js.map +0 -1
- package/dist/api/db/index.d.ts +0 -5
- package/dist/api/db/index.d.ts.map +0 -1
- package/dist/api/db/index.js +0 -5
- package/dist/api/db/index.js.map +0 -1
- package/dist/api/db/logs.d.ts.map +0 -1
- package/dist/api/db/logs.js.map +0 -1
- package/dist/api/db/query.d.ts +0 -39
- package/dist/api/db/query.d.ts.map +0 -1
- package/dist/api/db/query.js +0 -49
- package/dist/api/db/query.js.map +0 -1
- package/dist/api/db/tables.d.ts +0 -49
- package/dist/api/db/tables.d.ts.map +0 -1
- package/dist/api/db/tables.js +0 -59
- package/dist/api/db/tables.js.map +0 -1
- package/dist/api/db/util.d.ts.map +0 -1
- package/dist/api/db/util.js.map +0 -1
- package/dist/api/env.d.ts.map +0 -1
- package/dist/api/env.js.map +0 -1
- package/dist/api/eval/get.d.ts.map +0 -1
- package/dist/api/eval/get.js.map +0 -1
- package/dist/api/eval/index.d.ts +0 -5
- package/dist/api/eval/index.d.ts.map +0 -1
- package/dist/api/eval/index.js +0 -5
- package/dist/api/eval/index.js.map +0 -1
- package/dist/api/eval/list.d.ts.map +0 -1
- package/dist/api/eval/list.js.map +0 -1
- package/dist/api/eval/run-get.d.ts.map +0 -1
- package/dist/api/eval/run-get.js.map +0 -1
- package/dist/api/eval/run-list.d.ts.map +0 -1
- package/dist/api/eval/run-list.js.map +0 -1
- package/dist/api/index.d.ts +0 -21
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -21
- package/dist/api/index.js.map +0 -1
- package/dist/api/logger.d.ts.map +0 -1
- package/dist/api/logger.js.map +0 -1
- package/dist/api/machine/index.d.ts.map +0 -1
- package/dist/api/machine/index.js.map +0 -1
- package/dist/api/machine/machine.d.ts.map +0 -1
- package/dist/api/machine/machine.js +0 -109
- package/dist/api/machine/machine.js.map +0 -1
- package/dist/api/machine/util.d.ts.map +0 -1
- package/dist/api/machine/util.js.map +0 -1
- package/dist/api/org/env-delete.d.ts.map +0 -1
- package/dist/api/org/env-delete.js.map +0 -1
- package/dist/api/org/env-get.d.ts +0 -33
- package/dist/api/org/env-get.d.ts.map +0 -1
- package/dist/api/org/env-get.js +0 -26
- package/dist/api/org/env-get.js.map +0 -1
- package/dist/api/org/env-update.d.ts.map +0 -1
- package/dist/api/org/env-update.js.map +0 -1
- package/dist/api/org/index.d.ts.map +0 -1
- package/dist/api/org/index.js.map +0 -1
- package/dist/api/org/list.d.ts.map +0 -1
- package/dist/api/org/list.js.map +0 -1
- package/dist/api/org/resources.d.ts +0 -141
- package/dist/api/org/resources.d.ts.map +0 -1
- package/dist/api/org/resources.js +0 -97
- package/dist/api/org/resources.js.map +0 -1
- package/dist/api/org/util.d.ts.map +0 -1
- package/dist/api/org/util.js.map +0 -1
- package/dist/api/project/agent.d.ts.map +0 -1
- package/dist/api/project/agent.js.map +0 -1
- package/dist/api/project/create.d.ts.map +0 -1
- package/dist/api/project/create.js.map +0 -1
- package/dist/api/project/delete.d.ts.map +0 -1
- package/dist/api/project/delete.js +0 -13
- package/dist/api/project/delete.js.map +0 -1
- package/dist/api/project/deploy.d.ts +0 -490
- package/dist/api/project/deploy.d.ts.map +0 -1
- package/dist/api/project/deploy.js.map +0 -1
- package/dist/api/project/deployment.d.ts.map +0 -1
- package/dist/api/project/deployment.js +0 -127
- package/dist/api/project/deployment.js.map +0 -1
- package/dist/api/project/env-delete.d.ts.map +0 -1
- package/dist/api/project/env-delete.js.map +0 -1
- package/dist/api/project/env-update.d.ts.map +0 -1
- package/dist/api/project/env-update.js.map +0 -1
- package/dist/api/project/exists.d.ts.map +0 -1
- package/dist/api/project/exists.js.map +0 -1
- package/dist/api/project/get.d.ts.map +0 -1
- package/dist/api/project/get.js.map +0 -1
- package/dist/api/project/hostname.d.ts.map +0 -1
- package/dist/api/project/hostname.js +0 -37
- package/dist/api/project/hostname.js.map +0 -1
- package/dist/api/project/index.d.ts.map +0 -1
- package/dist/api/project/index.js.map +0 -1
- package/dist/api/project/list.d.ts.map +0 -1
- package/dist/api/project/list.js.map +0 -1
- package/dist/api/project/malware.d.ts.map +0 -1
- package/dist/api/project/malware.js +0 -42
- package/dist/api/project/malware.js.map +0 -1
- package/dist/api/project/update-region.d.ts.map +0 -1
- package/dist/api/project/update-region.js.map +0 -1
- package/dist/api/project/util.d.ts.map +0 -1
- package/dist/api/project/util.js.map +0 -1
- package/dist/api/queue/analytics.d.ts +0 -250
- package/dist/api/queue/analytics.d.ts.map +0 -1
- package/dist/api/queue/analytics.js +0 -233
- package/dist/api/queue/analytics.js.map +0 -1
- package/dist/api/queue/destinations.d.ts +0 -202
- package/dist/api/queue/destinations.d.ts.map +0 -1
- package/dist/api/queue/destinations.js +0 -168
- package/dist/api/queue/destinations.js.map +0 -1
- package/dist/api/queue/dlq.d.ts +0 -168
- package/dist/api/queue/dlq.d.ts.map +0 -1
- package/dist/api/queue/dlq.js.map +0 -1
- package/dist/api/queue/index.d.ts +0 -56
- package/dist/api/queue/index.d.ts.map +0 -1
- package/dist/api/queue/index.js +0 -90
- package/dist/api/queue/index.js.map +0 -1
- package/dist/api/queue/messages.d.ts +0 -503
- package/dist/api/queue/messages.d.ts.map +0 -1
- package/dist/api/queue/messages.js.map +0 -1
- package/dist/api/queue/queues.d.ts +0 -226
- package/dist/api/queue/queues.d.ts.map +0 -1
- package/dist/api/queue/queues.js.map +0 -1
- package/dist/api/queue/sources.d.ts +0 -202
- package/dist/api/queue/sources.d.ts.map +0 -1
- package/dist/api/queue/sources.js +0 -202
- package/dist/api/queue/sources.js.map +0 -1
- package/dist/api/queue/types.d.ts +0 -1218
- package/dist/api/queue/types.d.ts.map +0 -1
- package/dist/api/queue/types.js +0 -1002
- package/dist/api/queue/types.js.map +0 -1
- package/dist/api/queue/util.d.ts +0 -278
- package/dist/api/queue/util.d.ts.map +0 -1
- package/dist/api/queue/util.js +0 -233
- package/dist/api/queue/util.js.map +0 -1
- package/dist/api/queue/validation.d.ts +0 -247
- package/dist/api/queue/validation.d.ts.map +0 -1
- package/dist/api/queue/validation.js +0 -513
- package/dist/api/queue/validation.js.map +0 -1
- package/dist/api/queue/websocket.d.ts +0 -172
- package/dist/api/queue/websocket.d.ts.map +0 -1
- package/dist/api/queue/websocket.js +0 -396
- package/dist/api/queue/websocket.js.map +0 -1
- package/dist/api/region/create.d.ts.map +0 -1
- package/dist/api/region/create.js.map +0 -1
- package/dist/api/region/delete.d.ts.map +0 -1
- package/dist/api/region/delete.js.map +0 -1
- package/dist/api/region/index.d.ts.map +0 -1
- package/dist/api/region/index.js.map +0 -1
- package/dist/api/region/list.d.ts.map +0 -1
- package/dist/api/region/list.js.map +0 -1
- package/dist/api/region/resources.d.ts.map +0 -1
- package/dist/api/region/resources.js.map +0 -1
- package/dist/api/region/util.d.ts.map +0 -1
- package/dist/api/region/util.js.map +0 -1
- package/dist/api/sandbox/cli-list.d.ts +0 -114
- package/dist/api/sandbox/cli-list.d.ts.map +0 -1
- package/dist/api/sandbox/cli-list.js +0 -71
- package/dist/api/sandbox/cli-list.js.map +0 -1
- package/dist/api/sandbox/client.d.ts +0 -192
- package/dist/api/sandbox/client.d.ts.map +0 -1
- package/dist/api/sandbox/client.js +0 -262
- package/dist/api/sandbox/client.js.map +0 -1
- package/dist/api/sandbox/create.d.ts +0 -118
- package/dist/api/sandbox/create.d.ts.map +0 -1
- package/dist/api/sandbox/create.js +0 -211
- package/dist/api/sandbox/create.js.map +0 -1
- package/dist/api/sandbox/destroy.d.ts +0 -22
- package/dist/api/sandbox/destroy.d.ts.map +0 -1
- package/dist/api/sandbox/destroy.js +0 -25
- package/dist/api/sandbox/destroy.js.map +0 -1
- package/dist/api/sandbox/disk-checkpoint.d.ts +0 -104
- package/dist/api/sandbox/disk-checkpoint.d.ts.map +0 -1
- package/dist/api/sandbox/disk-checkpoint.js +0 -104
- package/dist/api/sandbox/disk-checkpoint.js.map +0 -1
- package/dist/api/sandbox/execute.d.ts +0 -69
- package/dist/api/sandbox/execute.d.ts.map +0 -1
- package/dist/api/sandbox/execute.js +0 -103
- package/dist/api/sandbox/execute.js.map +0 -1
- package/dist/api/sandbox/execution.d.ts +0 -169
- package/dist/api/sandbox/execution.d.ts.map +0 -1
- package/dist/api/sandbox/execution.js +0 -118
- package/dist/api/sandbox/execution.js.map +0 -1
- package/dist/api/sandbox/files.d.ts +0 -261
- package/dist/api/sandbox/files.d.ts.map +0 -1
- package/dist/api/sandbox/files.js +0 -386
- package/dist/api/sandbox/files.js.map +0 -1
- package/dist/api/sandbox/get.d.ts +0 -283
- package/dist/api/sandbox/get.d.ts.map +0 -1
- package/dist/api/sandbox/get.js +0 -215
- package/dist/api/sandbox/get.js.map +0 -1
- package/dist/api/sandbox/getStatus.d.ts +0 -16
- package/dist/api/sandbox/getStatus.d.ts.map +0 -1
- package/dist/api/sandbox/getStatus.js +0 -32
- package/dist/api/sandbox/getStatus.js.map +0 -1
- package/dist/api/sandbox/index.d.ts +0 -39
- package/dist/api/sandbox/index.d.ts.map +0 -1
- package/dist/api/sandbox/index.js +0 -20
- package/dist/api/sandbox/index.js.map +0 -1
- package/dist/api/sandbox/list.d.ts +0 -293
- package/dist/api/sandbox/list.d.ts.map +0 -1
- package/dist/api/sandbox/list.js +0 -191
- package/dist/api/sandbox/list.js.map +0 -1
- package/dist/api/sandbox/pause.d.ts +0 -22
- package/dist/api/sandbox/pause.d.ts.map +0 -1
- package/dist/api/sandbox/pause.js +0 -25
- package/dist/api/sandbox/pause.js.map +0 -1
- package/dist/api/sandbox/resolve.d.ts +0 -82
- package/dist/api/sandbox/resolve.d.ts.map +0 -1
- package/dist/api/sandbox/resolve.js +0 -71
- package/dist/api/sandbox/resolve.js.map +0 -1
- package/dist/api/sandbox/resume.d.ts +0 -22
- package/dist/api/sandbox/resume.d.ts.map +0 -1
- package/dist/api/sandbox/resume.js +0 -25
- package/dist/api/sandbox/resume.js.map +0 -1
- package/dist/api/sandbox/run.d.ts +0 -28
- package/dist/api/sandbox/run.d.ts.map +0 -1
- package/dist/api/sandbox/run.js +0 -342
- package/dist/api/sandbox/run.js.map +0 -1
- package/dist/api/sandbox/runtime.d.ts +0 -83
- package/dist/api/sandbox/runtime.d.ts.map +0 -1
- package/dist/api/sandbox/runtime.js +0 -78
- package/dist/api/sandbox/runtime.js.map +0 -1
- package/dist/api/sandbox/snapshot-build.d.ts.map +0 -1
- package/dist/api/sandbox/snapshot-build.js.map +0 -1
- package/dist/api/sandbox/snapshot.d.ts +0 -595
- package/dist/api/sandbox/snapshot.d.ts.map +0 -1
- package/dist/api/sandbox/snapshot.js +0 -598
- package/dist/api/sandbox/snapshot.js.map +0 -1
- package/dist/api/sandbox/util.d.ts +0 -284
- package/dist/api/sandbox/util.d.ts.map +0 -1
- package/dist/api/sandbox/util.js +0 -210
- package/dist/api/sandbox/util.js.map +0 -1
- package/dist/api/services/index.d.ts +0 -2
- package/dist/api/services/index.d.ts.map +0 -1
- package/dist/api/services/index.js +0 -2
- package/dist/api/services/index.js.map +0 -1
- package/dist/api/services/stats.d.ts +0 -263
- package/dist/api/services/stats.d.ts.map +0 -1
- package/dist/api/services/stats.js +0 -144
- package/dist/api/services/stats.js.map +0 -1
- package/dist/api/session/get.d.ts +0 -169
- package/dist/api/session/get.d.ts.map +0 -1
- package/dist/api/session/get.js.map +0 -1
- package/dist/api/session/index.d.ts +0 -4
- package/dist/api/session/index.d.ts.map +0 -1
- package/dist/api/session/index.js +0 -4
- package/dist/api/session/index.js.map +0 -1
- package/dist/api/session/list.d.ts +0 -143
- package/dist/api/session/list.d.ts.map +0 -1
- package/dist/api/session/list.js +0 -91
- package/dist/api/session/list.js.map +0 -1
- package/dist/api/session/logs.d.ts.map +0 -1
- package/dist/api/session/logs.js.map +0 -1
- package/dist/api/session/util.d.ts.map +0 -1
- package/dist/api/session/util.js.map +0 -1
- package/dist/api/storage/config.d.ts.map +0 -1
- package/dist/api/storage/config.js.map +0 -1
- package/dist/api/storage/index.d.ts.map +0 -1
- package/dist/api/storage/index.js.map +0 -1
- package/dist/api/storage/objects.d.ts +0 -155
- package/dist/api/storage/objects.d.ts.map +0 -1
- package/dist/api/storage/objects.js +0 -148
- package/dist/api/storage/objects.js.map +0 -1
- package/dist/api/storage/types.d.ts.map +0 -1
- package/dist/api/storage/types.js.map +0 -1
- package/dist/api/storage/util.d.ts.map +0 -1
- package/dist/api/storage/util.js.map +0 -1
- package/dist/api/stream/get.d.ts.map +0 -1
- package/dist/api/stream/get.js.map +0 -1
- package/dist/api/stream/index.d.ts +0 -4
- package/dist/api/stream/index.d.ts.map +0 -1
- package/dist/api/stream/index.js +0 -4
- package/dist/api/stream/index.js.map +0 -1
- package/dist/api/stream/list.d.ts +0 -120
- package/dist/api/stream/list.d.ts.map +0 -1
- package/dist/api/stream/list.js +0 -77
- package/dist/api/stream/list.js.map +0 -1
- package/dist/api/stream/util.d.ts.map +0 -1
- package/dist/api/stream/util.js.map +0 -1
- package/dist/api/thread/delete.d.ts.map +0 -1
- package/dist/api/thread/delete.js.map +0 -1
- package/dist/api/thread/get.d.ts.map +0 -1
- package/dist/api/thread/get.js.map +0 -1
- package/dist/api/thread/index.d.ts.map +0 -1
- package/dist/api/thread/index.js.map +0 -1
- package/dist/api/thread/list.d.ts +0 -69
- package/dist/api/thread/list.d.ts.map +0 -1
- package/dist/api/thread/list.js +0 -51
- package/dist/api/thread/list.js.map +0 -1
- package/dist/api/thread/util.d.ts.map +0 -1
- package/dist/api/thread/util.js.map +0 -1
- package/dist/api/user/index.d.ts.map +0 -1
- package/dist/api/user/index.js.map +0 -1
- package/dist/api/user/util.d.ts.map +0 -1
- package/dist/api/user/util.js.map +0 -1
- package/dist/api/user/whoami.d.ts.map +0 -1
- package/dist/api/user/whoami.js.map +0 -1
- package/dist/api/webhook/deliveries.d.ts +0 -94
- package/dist/api/webhook/deliveries.d.ts.map +0 -1
- package/dist/api/webhook/deliveries.js.map +0 -1
- package/dist/api/webhook/destinations.d.ts +0 -136
- package/dist/api/webhook/destinations.d.ts.map +0 -1
- package/dist/api/webhook/destinations.js.map +0 -1
- package/dist/api/webhook/index.d.ts +0 -41
- package/dist/api/webhook/index.d.ts.map +0 -1
- package/dist/api/webhook/index.js +0 -59
- package/dist/api/webhook/index.js.map +0 -1
- package/dist/api/webhook/receipts.d.ts.map +0 -1
- package/dist/api/webhook/receipts.js.map +0 -1
- package/dist/api/webhook/types.d.ts +0 -249
- package/dist/api/webhook/types.d.ts.map +0 -1
- package/dist/api/webhook/types.js +0 -221
- package/dist/api/webhook/types.js.map +0 -1
- package/dist/api/webhook/util.d.ts.map +0 -1
- package/dist/api/webhook/util.js.map +0 -1
- package/dist/api/webhook/webhooks.d.ts +0 -146
- package/dist/api/webhook/webhooks.d.ts.map +0 -1
- package/dist/api/webhook/webhooks.js.map +0 -1
- package/dist/services/email.d.ts +0 -901
- package/dist/services/email.d.ts.map +0 -1
- package/dist/services/email.js +0 -722
- package/dist/services/email.js.map +0 -1
- package/dist/services/evalrun.d.ts +0 -93
- package/dist/services/evalrun.d.ts.map +0 -1
- package/dist/services/evalrun.js +0 -24
- package/dist/services/evalrun.js.map +0 -1
- package/dist/services/keyvalue.d.ts +0 -283
- package/dist/services/keyvalue.d.ts.map +0 -1
- package/dist/services/keyvalue.js +0 -305
- package/dist/services/keyvalue.js.map +0 -1
- package/dist/services/queue.d.ts +0 -361
- package/dist/services/queue.d.ts.map +0 -1
- package/dist/services/queue.js +0 -308
- package/dist/services/queue.js.map +0 -1
- package/dist/services/sandbox.d.ts +0 -1241
- package/dist/services/sandbox.d.ts.map +0 -1
- package/dist/services/sandbox.js +0 -6
- package/dist/services/sandbox.js.map +0 -1
- package/dist/services/schedule.d.ts +0 -501
- package/dist/services/schedule.d.ts.map +0 -1
- package/dist/services/schedule.js +0 -425
- package/dist/services/schedule.js.map +0 -1
- package/dist/services/session.d.ts +0 -127
- package/dist/services/session.d.ts.map +0 -1
- package/dist/services/session.js +0 -42
- package/dist/services/session.js.map +0 -1
- package/dist/services/stream.d.ts +0 -293
- package/dist/services/stream.d.ts.map +0 -1
- package/dist/services/stream.js +0 -500
- package/dist/services/stream.js.map +0 -1
- package/dist/services/task.d.ts +0 -1337
- package/dist/services/task.d.ts.map +0 -1
- package/dist/services/task.js +0 -1397
- package/dist/services/task.js.map +0 -1
- package/dist/services/vector.d.ts +0 -498
- package/dist/services/vector.d.ts.map +0 -1
- package/dist/services/vector.js +0 -381
- package/dist/services/vector.js.map +0 -1
- package/dist/services/webhook.d.ts +0 -454
- package/dist/services/webhook.d.ts.map +0 -1
- package/dist/services/webhook.js +0 -589
- package/dist/services/webhook.js.map +0 -1
- package/src/api/api.ts +0 -931
- package/src/api/apikey/create.ts +0 -41
- package/src/api/apikey/list.ts +0 -64
- package/src/api/config.ts +0 -60
- package/src/api/db/index.ts +0 -27
- package/src/api/db/query.ts +0 -67
- package/src/api/db/tables.ts +0 -92
- package/src/api/eval/index.ts +0 -28
- package/src/api/index.ts +0 -20
- package/src/api/machine/machine.ts +0 -160
- package/src/api/org/env-get.ts +0 -43
- package/src/api/org/resources.ts +0 -140
- package/src/api/project/delete.ts +0 -25
- package/src/api/project/deploy.ts +0 -458
- package/src/api/project/deployment.ts +0 -195
- package/src/api/project/hostname.ts +0 -73
- package/src/api/project/malware.ts +0 -68
- package/src/api/queue/analytics.ts +0 -311
- package/src/api/queue/destinations.ts +0 -259
- package/src/api/queue/index.ts +0 -308
- package/src/api/queue/sources.ts +0 -294
- package/src/api/queue/types.ts +0 -1325
- package/src/api/queue/util.ts +0 -275
- package/src/api/queue/validation.ts +0 -560
- package/src/api/queue/websocket.ts +0 -521
- package/src/api/sandbox/cli-list.ts +0 -127
- package/src/api/sandbox/client.ts +0 -460
- package/src/api/sandbox/create.ts +0 -256
- package/src/api/sandbox/destroy.ts +0 -41
- package/src/api/sandbox/disk-checkpoint.ts +0 -179
- package/src/api/sandbox/execute.ts +0 -132
- package/src/api/sandbox/execution.ts +0 -183
- package/src/api/sandbox/files.ts +0 -596
- package/src/api/sandbox/get.ts +0 -249
- package/src/api/sandbox/getStatus.ts +0 -54
- package/src/api/sandbox/index.ts +0 -211
- package/src/api/sandbox/list.ts +0 -224
- package/src/api/sandbox/pause.ts +0 -39
- package/src/api/sandbox/resolve.ts +0 -98
- package/src/api/sandbox/resume.ts +0 -39
- package/src/api/sandbox/run.ts +0 -439
- package/src/api/sandbox/runtime.ts +0 -104
- package/src/api/sandbox/snapshot.ts +0 -781
- package/src/api/sandbox/util.ts +0 -275
- package/src/api/services/index.ts +0 -1
- package/src/api/services/stats.ts +0 -213
- package/src/api/session/get.ts +0 -106
- package/src/api/session/index.ts +0 -3
- package/src/api/session/list.ts +0 -136
- package/src/api/storage/objects.ts +0 -250
- package/src/api/stream/index.ts +0 -3
- package/src/api/stream/list.ts +0 -127
- package/src/api/thread/list.ts +0 -76
- package/src/api/webhook/index.ts +0 -133
- package/src/api/webhook/types.ts +0 -309
- package/src/services/email.ts +0 -1410
- package/src/services/keyvalue.ts +0 -620
- package/src/services/queue.ts +0 -603
- package/src/services/sandbox.ts +0 -1466
- package/src/services/schedule.ts +0 -763
- package/src/services/stream.ts +0 -886
- package/src/services/task.ts +0 -2611
- package/src/services/vector.ts +0 -1119
- package/src/services/webhook.ts +0 -921
- /package/dist/{api → services}/apikey/delete.d.ts +0 -0
- /package/dist/{api → services}/apikey/delete.js +0 -0
- /package/dist/{api → services}/apikey/get.d.ts +0 -0
- /package/dist/{api → services}/apikey/get.js +0 -0
- /package/dist/{api → services}/apikey/index.d.ts +0 -0
- /package/dist/{api → services}/apikey/index.js +0 -0
- /package/dist/{api → services}/apikey/util.d.ts +0 -0
- /package/dist/{api → services}/apikey/util.js +0 -0
- /package/dist/{api → services}/db/logs.d.ts +0 -0
- /package/dist/{api → services}/db/logs.js +0 -0
- /package/dist/{api → services}/db/util.d.ts +0 -0
- /package/dist/{api → services}/db/util.js +0 -0
- /package/dist/{api → services}/env.d.ts +0 -0
- /package/dist/{api → services}/env.js +0 -0
- /package/dist/{api → services}/eval/get.d.ts +0 -0
- /package/dist/{api → services}/eval/get.js +0 -0
- /package/dist/{api → services}/eval/list.d.ts +0 -0
- /package/dist/{api → services}/eval/list.js +0 -0
- /package/dist/{api → services}/eval/run-get.d.ts +0 -0
- /package/dist/{api → services}/eval/run-get.js +0 -0
- /package/dist/{api → services}/eval/run-list.d.ts +0 -0
- /package/dist/{api → services}/eval/run-list.js +0 -0
- /package/dist/{api → services}/logger.d.ts +0 -0
- /package/dist/{api → services}/logger.js +0 -0
- /package/dist/{api → services}/machine/index.d.ts +0 -0
- /package/dist/{api → services}/machine/index.js +0 -0
- /package/dist/{api → services}/machine/machine.d.ts +0 -0
- /package/dist/{api → services}/machine/util.d.ts +0 -0
- /package/dist/{api → services}/machine/util.js +0 -0
- /package/dist/{api → services}/org/env-delete.d.ts +0 -0
- /package/dist/{api → services}/org/env-delete.js +0 -0
- /package/dist/{api → services}/org/env-update.d.ts +0 -0
- /package/dist/{api → services}/org/env-update.js +0 -0
- /package/dist/{api → services}/org/index.d.ts +0 -0
- /package/dist/{api → services}/org/index.js +0 -0
- /package/dist/{api → services}/org/list.d.ts +0 -0
- /package/dist/{api → services}/org/list.js +0 -0
- /package/dist/{api → services}/org/util.d.ts +0 -0
- /package/dist/{api → services}/org/util.js +0 -0
- /package/dist/{api → services}/project/agent.d.ts +0 -0
- /package/dist/{api → services}/project/agent.js +0 -0
- /package/dist/{api → services}/project/create.d.ts +0 -0
- /package/dist/{api → services}/project/create.js +0 -0
- /package/dist/{api → services}/project/delete.d.ts +0 -0
- /package/dist/{api → services}/project/deploy.js +0 -0
- /package/dist/{api → services}/project/deployment.d.ts +0 -0
- /package/dist/{api → services}/project/env-delete.d.ts +0 -0
- /package/dist/{api → services}/project/env-delete.js +0 -0
- /package/dist/{api → services}/project/env-update.d.ts +0 -0
- /package/dist/{api → services}/project/env-update.js +0 -0
- /package/dist/{api → services}/project/exists.d.ts +0 -0
- /package/dist/{api → services}/project/exists.js +0 -0
- /package/dist/{api → services}/project/get.d.ts +0 -0
- /package/dist/{api → services}/project/get.js +0 -0
- /package/dist/{api → services}/project/hostname.d.ts +0 -0
- /package/dist/{api → services}/project/index.d.ts +0 -0
- /package/dist/{api → services}/project/index.js +0 -0
- /package/dist/{api → services}/project/list.d.ts +0 -0
- /package/dist/{api → services}/project/list.js +0 -0
- /package/dist/{api → services}/project/malware.d.ts +0 -0
- /package/dist/{api → services}/project/update-region.d.ts +0 -0
- /package/dist/{api → services}/project/update-region.js +0 -0
- /package/dist/{api → services}/project/util.d.ts +0 -0
- /package/dist/{api → services}/project/util.js +0 -0
- /package/dist/{api → services}/queue/dlq.js +0 -0
- /package/dist/{api → services}/queue/messages.js +0 -0
- /package/dist/{api → services}/queue/queues.js +0 -0
- /package/dist/{api → services}/region/create.d.ts +0 -0
- /package/dist/{api → services}/region/create.js +0 -0
- /package/dist/{api → services}/region/delete.d.ts +0 -0
- /package/dist/{api → services}/region/delete.js +0 -0
- /package/dist/{api → services}/region/index.d.ts +0 -0
- /package/dist/{api → services}/region/index.js +0 -0
- /package/dist/{api → services}/region/list.d.ts +0 -0
- /package/dist/{api → services}/region/list.js +0 -0
- /package/dist/{api → services}/region/resources.d.ts +0 -0
- /package/dist/{api → services}/region/resources.js +0 -0
- /package/dist/{api → services}/region/util.d.ts +0 -0
- /package/dist/{api → services}/region/util.js +0 -0
- /package/dist/{api → services}/sandbox/snapshot-build.d.ts +0 -0
- /package/dist/{api → services}/sandbox/snapshot-build.js +0 -0
- /package/dist/{api → services}/session/get.js +0 -0
- /package/dist/{api → services}/session/logs.d.ts +0 -0
- /package/dist/{api → services}/session/logs.js +0 -0
- /package/dist/{api → services}/session/util.d.ts +0 -0
- /package/dist/{api → services}/session/util.js +0 -0
- /package/dist/{api → services}/storage/config.d.ts +0 -0
- /package/dist/{api → services}/storage/config.js +0 -0
- /package/dist/{api → services}/storage/index.d.ts +0 -0
- /package/dist/{api → services}/storage/index.js +0 -0
- /package/dist/{api → services}/storage/types.d.ts +0 -0
- /package/dist/{api → services}/storage/types.js +0 -0
- /package/dist/{api → services}/storage/util.d.ts +0 -0
- /package/dist/{api → services}/storage/util.js +0 -0
- /package/dist/{api → services}/stream/get.d.ts +0 -0
- /package/dist/{api → services}/stream/get.js +0 -0
- /package/dist/{api → services}/stream/util.d.ts +0 -0
- /package/dist/{api → services}/stream/util.js +0 -0
- /package/dist/{api → services}/thread/delete.d.ts +0 -0
- /package/dist/{api → services}/thread/delete.js +0 -0
- /package/dist/{api → services}/thread/get.d.ts +0 -0
- /package/dist/{api → services}/thread/get.js +0 -0
- /package/dist/{api → services}/thread/index.d.ts +0 -0
- /package/dist/{api → services}/thread/index.js +0 -0
- /package/dist/{api → services}/thread/util.d.ts +0 -0
- /package/dist/{api → services}/thread/util.js +0 -0
- /package/dist/{api → services}/user/index.d.ts +0 -0
- /package/dist/{api → services}/user/index.js +0 -0
- /package/dist/{api → services}/user/util.d.ts +0 -0
- /package/dist/{api → services}/user/util.js +0 -0
- /package/dist/{api → services}/user/whoami.d.ts +0 -0
- /package/dist/{api → services}/user/whoami.js +0 -0
- /package/dist/{api → services}/webhook/deliveries.js +0 -0
- /package/dist/{api → services}/webhook/destinations.js +0 -0
- /package/dist/{api → services}/webhook/receipts.d.ts +0 -0
- /package/dist/{api → services}/webhook/receipts.js +0 -0
- /package/dist/{api → services}/webhook/util.d.ts +0 -0
- /package/dist/{api → services}/webhook/util.js +0 -0
- /package/dist/{api → services}/webhook/webhooks.js +0 -0
- /package/src/{api → services}/api-example.md +0 -0
- /package/src/{api → services}/apikey/delete.ts +0 -0
- /package/src/{api → services}/apikey/get.ts +0 -0
- /package/src/{api → services}/apikey/index.ts +0 -0
- /package/src/{api → services}/apikey/util.ts +0 -0
- /package/src/{api → services}/db/logs.ts +0 -0
- /package/src/{api → services}/db/util.ts +0 -0
- /package/src/{api → services}/env.ts +0 -0
- /package/src/services/{evalrun.ts → eval/events.ts} +0 -0
- /package/src/{api → services}/eval/get.ts +0 -0
- /package/src/{api → services}/eval/list.ts +0 -0
- /package/src/{api → services}/eval/run-get.ts +0 -0
- /package/src/{api → services}/eval/run-list.ts +0 -0
- /package/src/{api → services}/logger.ts +0 -0
- /package/src/{api → services}/machine/index.ts +0 -0
- /package/src/{api → services}/machine/util.ts +0 -0
- /package/src/{api → services}/org/env-delete.ts +0 -0
- /package/src/{api → services}/org/env-update.ts +0 -0
- /package/src/{api → services}/org/index.ts +0 -0
- /package/src/{api → services}/org/list.ts +0 -0
- /package/src/{api → services}/org/util.ts +0 -0
- /package/src/{api → services}/project/agent.ts +0 -0
- /package/src/{api → services}/project/create.ts +0 -0
- /package/src/{api → services}/project/env-delete.ts +0 -0
- /package/src/{api → services}/project/env-update.ts +0 -0
- /package/src/{api → services}/project/exists.ts +0 -0
- /package/src/{api → services}/project/get.ts +0 -0
- /package/src/{api → services}/project/index.ts +0 -0
- /package/src/{api → services}/project/list.ts +0 -0
- /package/src/{api → services}/project/update-region.ts +0 -0
- /package/src/{api → services}/project/util.ts +0 -0
- /package/src/{api → services}/queue/dlq.ts +0 -0
- /package/src/{api → services}/queue/messages.ts +0 -0
- /package/src/{api → services}/queue/queues.ts +0 -0
- /package/src/{api → services}/region/create.ts +0 -0
- /package/src/{api → services}/region/delete.ts +0 -0
- /package/src/{api → services}/region/index.ts +0 -0
- /package/src/{api → services}/region/list.ts +0 -0
- /package/src/{api → services}/region/resources.ts +0 -0
- /package/src/{api → services}/region/util.ts +0 -0
- /package/src/{api → services}/sandbox/snapshot-build.ts +0 -0
- /package/src/services/{session.ts → session/events.ts} +0 -0
- /package/src/{api → services}/session/logs.ts +0 -0
- /package/src/{api → services}/session/util.ts +0 -0
- /package/src/{api → services}/storage/config.ts +0 -0
- /package/src/{api → services}/storage/index.ts +0 -0
- /package/src/{api → services}/storage/types.ts +0 -0
- /package/src/{api → services}/storage/util.ts +0 -0
- /package/src/{api → services}/stream/get.ts +0 -0
- /package/src/{api → services}/stream/util.ts +0 -0
- /package/src/{api → services}/thread/delete.ts +0 -0
- /package/src/{api → services}/thread/get.ts +0 -0
- /package/src/{api → services}/thread/index.ts +0 -0
- /package/src/{api → services}/thread/util.ts +0 -0
- /package/src/{api → services}/user/index.ts +0 -0
- /package/src/{api → services}/user/util.ts +0 -0
- /package/src/{api → services}/user/whoami.ts +0 -0
- /package/src/{api → services}/webhook/deliveries.ts +0 -0
- /package/src/{api → services}/webhook/destinations.ts +0 -0
- /package/src/{api → services}/webhook/receipts.ts +0 -0
- /package/src/{api → services}/webhook/util.ts +0 -0
- /package/src/{api → services}/webhook/webhooks.ts +0 -0
package/dist/services/task.js
DELETED
|
@@ -1,1397 +0,0 @@
|
|
|
1
|
-
import { buildUrl, toServiceException } from "./_util.js";
|
|
2
|
-
import { StructuredError } from "../error.js";
|
|
3
|
-
import { safeStringify } from "../json.js";
|
|
4
|
-
/** API version string used for task CRUD, comment, tag, and attachment endpoints. */
|
|
5
|
-
const TASK_API_VERSION = '2026-02-24';
|
|
6
|
-
/** Maximum number of tasks that can be deleted in a single batch request. */
|
|
7
|
-
const MAX_BATCH_DELETE_LIMIT = 200;
|
|
8
|
-
/** API version string used for the task activity analytics endpoint. */
|
|
9
|
-
const TASK_ACTIVITY_API_VERSION = '2026-02-28';
|
|
10
|
-
/** Thrown when a task ID parameter is empty or not a string. */
|
|
11
|
-
const TaskIdRequiredError = StructuredError('TaskIdRequiredError', 'Task ID is required and must be a non-empty string');
|
|
12
|
-
/** Thrown when a task title is empty or not a string. */
|
|
13
|
-
const TaskTitleRequiredError = StructuredError('TaskTitleRequiredError', 'Task title is required and must be a non-empty string');
|
|
14
|
-
/** Thrown when a comment ID parameter is empty or not a string. */
|
|
15
|
-
const CommentIdRequiredError = StructuredError('CommentIdRequiredError', 'Comment ID is required and must be a non-empty string');
|
|
16
|
-
/** Thrown when a comment body is empty or not a string. */
|
|
17
|
-
const CommentBodyRequiredError = StructuredError('CommentBodyRequiredError', 'Comment body is required and must be a non-empty string');
|
|
18
|
-
/** Thrown when a tag ID parameter is empty or not a string. */
|
|
19
|
-
const TagIdRequiredError = StructuredError('TagIdRequiredError', 'Tag ID is required and must be a non-empty string');
|
|
20
|
-
/** Thrown when a tag name is empty or not a string. */
|
|
21
|
-
const TagNameRequiredError = StructuredError('TagNameRequiredError', 'Tag name is required and must be a non-empty string');
|
|
22
|
-
/** Thrown when an attachment ID parameter is empty or not a string. */
|
|
23
|
-
const AttachmentIdRequiredError = StructuredError('AttachmentIdRequiredError', 'Attachment ID is required and must be a non-empty string');
|
|
24
|
-
/** Thrown when a user ID parameter is empty or not a string. */
|
|
25
|
-
const UserIdRequiredError = StructuredError('UserIdRequiredError', 'User ID is required and must be a non-empty string');
|
|
26
|
-
/**
|
|
27
|
-
* Thrown when the API returns a success HTTP status but the response body indicates failure.
|
|
28
|
-
*/
|
|
29
|
-
const TaskStorageResponseError = StructuredError('TaskStorageResponseError')();
|
|
30
|
-
/**
|
|
31
|
-
* Client for the Agentuity Task management service.
|
|
32
|
-
*
|
|
33
|
-
* Provides a full-featured project management API including task CRUD, hierarchical
|
|
34
|
-
* organization (epics → features → tasks), comments, tags, file attachments via
|
|
35
|
-
* presigned S3 URLs, changelog tracking, and activity analytics.
|
|
36
|
-
*
|
|
37
|
-
* Tasks support lifecycle management through status transitions (`open` → `in_progress`
|
|
38
|
-
* → `done`/`closed`/`cancelled`) with automatic date tracking for each transition.
|
|
39
|
-
*
|
|
40
|
-
* All methods validate inputs client-side and throw structured errors for invalid
|
|
41
|
-
* parameters. API errors throw {@link ServiceException}.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const tasks = new TaskStorageService(baseUrl, adapter);
|
|
46
|
-
*
|
|
47
|
-
* // Create a task
|
|
48
|
-
* const task = await tasks.create({
|
|
49
|
-
* title: 'Implement login flow',
|
|
50
|
-
* type: 'feature',
|
|
51
|
-
* created_id: 'user_123',
|
|
52
|
-
* creator: { id: 'user_123', name: 'Alice' },
|
|
53
|
-
* priority: 'high',
|
|
54
|
-
* });
|
|
55
|
-
*
|
|
56
|
-
* // Add a comment
|
|
57
|
-
* await tasks.createComment(task.id, 'Started working on this', 'user_123');
|
|
58
|
-
*
|
|
59
|
-
* // List open tasks
|
|
60
|
-
* const { tasks: openTasks } = await tasks.list({ status: 'open' });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export class TaskStorageService {
|
|
64
|
-
#adapter;
|
|
65
|
-
#baseUrl;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a new TaskStorageService instance.
|
|
68
|
-
*
|
|
69
|
-
* @param baseUrl - The base URL of the task management API
|
|
70
|
-
* @param adapter - The HTTP fetch adapter used for making API requests
|
|
71
|
-
*/
|
|
72
|
-
constructor(baseUrl, adapter) {
|
|
73
|
-
this.#adapter = adapter;
|
|
74
|
-
this.#baseUrl = baseUrl;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Create a new task.
|
|
78
|
-
*
|
|
79
|
-
* @param params - The task creation parameters including title, type, and optional fields
|
|
80
|
-
* @returns The newly created task
|
|
81
|
-
* @throws {@link TaskTitleRequiredError} if the title is empty or not a string
|
|
82
|
-
* @throws {@link ServiceException} if the API request fails
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```typescript
|
|
86
|
-
* const task = await tasks.create({
|
|
87
|
-
* title: 'Fix login bug',
|
|
88
|
-
* type: 'bug',
|
|
89
|
-
* created_id: 'user_123',
|
|
90
|
-
* priority: 'high',
|
|
91
|
-
* creator: { id: 'user_123', name: 'Alice' },
|
|
92
|
-
* project: { id: 'proj_456', name: 'Auth Service' },
|
|
93
|
-
* });
|
|
94
|
-
* console.log('Created:', task.id);
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
async create(params) {
|
|
98
|
-
if (!params?.title || typeof params.title !== 'string' || params.title.trim().length === 0) {
|
|
99
|
-
throw new TaskTitleRequiredError();
|
|
100
|
-
}
|
|
101
|
-
const url = buildUrl(this.#baseUrl, `/task/${TASK_API_VERSION}`);
|
|
102
|
-
const signal = AbortSignal.timeout(30_000);
|
|
103
|
-
const res = await this.#adapter.invoke(url, {
|
|
104
|
-
method: 'POST',
|
|
105
|
-
body: safeStringify(params),
|
|
106
|
-
contentType: 'application/json',
|
|
107
|
-
signal,
|
|
108
|
-
telemetry: {
|
|
109
|
-
name: 'agentuity.task.create',
|
|
110
|
-
attributes: {
|
|
111
|
-
type: params.type,
|
|
112
|
-
priority: params.priority ?? 'none',
|
|
113
|
-
status: params.status ?? 'open',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
if (res.ok) {
|
|
118
|
-
if (res.data.success) {
|
|
119
|
-
return res.data.data;
|
|
120
|
-
}
|
|
121
|
-
throw new TaskStorageResponseError({
|
|
122
|
-
status: res.response.status,
|
|
123
|
-
message: res.data.message,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
throw await toServiceException('POST', url, res.response);
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Get a task by its ID.
|
|
130
|
-
*
|
|
131
|
-
* @param id - The unique task identifier
|
|
132
|
-
* @returns The task if found, or `null` if the task does not exist
|
|
133
|
-
* @throws {@link TaskIdRequiredError} if the ID is empty or not a string
|
|
134
|
-
* @throws {@link ServiceException} if the API request fails
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```typescript
|
|
138
|
-
* const task = await tasks.get('task_abc123');
|
|
139
|
-
* if (task) {
|
|
140
|
-
* console.log(task.title, task.status);
|
|
141
|
-
* } else {
|
|
142
|
-
* console.log('Task not found');
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
async get(id) {
|
|
147
|
-
if (!id || typeof id !== 'string' || id.trim().length === 0) {
|
|
148
|
-
throw new TaskIdRequiredError();
|
|
149
|
-
}
|
|
150
|
-
const url = buildUrl(this.#baseUrl, `/task/${TASK_API_VERSION}/${encodeURIComponent(id)}`);
|
|
151
|
-
const signal = AbortSignal.timeout(30_000);
|
|
152
|
-
const res = await this.#adapter.invoke(url, {
|
|
153
|
-
method: 'GET',
|
|
154
|
-
signal,
|
|
155
|
-
telemetry: {
|
|
156
|
-
name: 'agentuity.task.get',
|
|
157
|
-
attributes: { id },
|
|
158
|
-
},
|
|
159
|
-
});
|
|
160
|
-
if (res.response.status === 404) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
if (res.ok) {
|
|
164
|
-
if (res.data.success) {
|
|
165
|
-
return res.data.data;
|
|
166
|
-
}
|
|
167
|
-
throw new TaskStorageResponseError({
|
|
168
|
-
status: res.response.status,
|
|
169
|
-
message: res.data.message,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
throw await toServiceException('GET', url, res.response);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* List tasks with optional filtering and pagination.
|
|
176
|
-
*
|
|
177
|
-
* @param params - Optional filter and pagination parameters
|
|
178
|
-
* @returns Paginated list of tasks matching the filters
|
|
179
|
-
* @throws {@link ServiceException} if the API request fails
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* ```typescript
|
|
183
|
-
* // List all open high-priority bugs
|
|
184
|
-
* const result = await tasks.list({
|
|
185
|
-
* status: 'open',
|
|
186
|
-
* type: 'bug',
|
|
187
|
-
* priority: 'high',
|
|
188
|
-
* sort: '-created_at',
|
|
189
|
-
* limit: 20,
|
|
190
|
-
* });
|
|
191
|
-
* console.log(`Found ${result.total} bugs, showing ${result.tasks.length}`);
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
async list(params) {
|
|
195
|
-
const queryParams = new URLSearchParams();
|
|
196
|
-
if (params?.status)
|
|
197
|
-
queryParams.set('status', params.status);
|
|
198
|
-
if (params?.type)
|
|
199
|
-
queryParams.set('type', params.type);
|
|
200
|
-
if (params?.priority)
|
|
201
|
-
queryParams.set('priority', params.priority);
|
|
202
|
-
if (params?.assigned_id)
|
|
203
|
-
queryParams.set('assigned_id', params.assigned_id);
|
|
204
|
-
if (params?.parent_id)
|
|
205
|
-
queryParams.set('parent_id', params.parent_id);
|
|
206
|
-
if (params?.project_id)
|
|
207
|
-
queryParams.set('project_id', params.project_id);
|
|
208
|
-
if (params?.tag_id)
|
|
209
|
-
queryParams.set('tag_id', params.tag_id);
|
|
210
|
-
if (params?.deleted !== undefined)
|
|
211
|
-
queryParams.set('deleted', String(params.deleted));
|
|
212
|
-
if (params?.sort)
|
|
213
|
-
queryParams.set('sort', params.sort);
|
|
214
|
-
if (params?.order)
|
|
215
|
-
queryParams.set('order', params.order);
|
|
216
|
-
if (params?.limit !== undefined)
|
|
217
|
-
queryParams.set('limit', String(params.limit));
|
|
218
|
-
if (params?.offset !== undefined)
|
|
219
|
-
queryParams.set('offset', String(params.offset));
|
|
220
|
-
const queryString = queryParams.toString();
|
|
221
|
-
const url = buildUrl(this.#baseUrl, `/task/${TASK_API_VERSION}${queryString ? `?${queryString}` : ''}`);
|
|
222
|
-
const signal = AbortSignal.timeout(30_000);
|
|
223
|
-
const res = await this.#adapter.invoke(url, {
|
|
224
|
-
method: 'GET',
|
|
225
|
-
signal,
|
|
226
|
-
telemetry: {
|
|
227
|
-
name: 'agentuity.task.list',
|
|
228
|
-
attributes: {
|
|
229
|
-
...(params?.status ? { status: params.status } : {}),
|
|
230
|
-
...(params?.type ? { type: params.type } : {}),
|
|
231
|
-
...(params?.priority ? { priority: params.priority } : {}),
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
});
|
|
235
|
-
if (res.ok) {
|
|
236
|
-
if (res.data.success) {
|
|
237
|
-
return res.data.data;
|
|
238
|
-
}
|
|
239
|
-
throw new TaskStorageResponseError({
|
|
240
|
-
status: res.response.status,
|
|
241
|
-
message: res.data.message,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
throw await toServiceException('GET', url, res.response);
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Partially update an existing task.
|
|
248
|
-
*
|
|
249
|
-
* @param id - The unique task identifier
|
|
250
|
-
* @param params - Fields to update; only provided fields are changed
|
|
251
|
-
* @returns The updated task
|
|
252
|
-
* @throws {@link TaskIdRequiredError} if the ID is empty or not a string
|
|
253
|
-
* @throws {@link TaskTitleRequiredError} if a title is provided but is empty
|
|
254
|
-
* @throws {@link ServiceException} if the API request fails
|
|
255
|
-
*
|
|
256
|
-
* @example
|
|
257
|
-
* ```typescript
|
|
258
|
-
* const updated = await tasks.update('task_abc123', {
|
|
259
|
-
* status: 'in_progress',
|
|
260
|
-
* priority: 'high',
|
|
261
|
-
* assignee: { id: 'user_456', name: 'Bob' },
|
|
262
|
-
* });
|
|
263
|
-
* console.log('Updated status:', updated.status);
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
async update(id, params) {
|
|
267
|
-
if (!id || typeof id !== 'string' || id.trim().length === 0) {
|
|
268
|
-
throw new TaskIdRequiredError();
|
|
269
|
-
}
|
|
270
|
-
if (params.title !== undefined &&
|
|
271
|
-
(typeof params.title !== 'string' || params.title.trim().length === 0)) {
|
|
272
|
-
throw new TaskTitleRequiredError();
|
|
273
|
-
}
|
|
274
|
-
const url = buildUrl(this.#baseUrl, `/task/${TASK_API_VERSION}/${encodeURIComponent(id)}`);
|
|
275
|
-
const signal = AbortSignal.timeout(30_000);
|
|
276
|
-
const res = await this.#adapter.invoke(url, {
|
|
277
|
-
method: 'PATCH',
|
|
278
|
-
body: safeStringify(params),
|
|
279
|
-
contentType: 'application/json',
|
|
280
|
-
signal,
|
|
281
|
-
telemetry: {
|
|
282
|
-
name: 'agentuity.task.update',
|
|
283
|
-
attributes: { id },
|
|
284
|
-
},
|
|
285
|
-
});
|
|
286
|
-
if (res.ok) {
|
|
287
|
-
if (res.data.success) {
|
|
288
|
-
return res.data.data;
|
|
289
|
-
}
|
|
290
|
-
throw new TaskStorageResponseError({
|
|
291
|
-
status: res.response.status,
|
|
292
|
-
message: res.data.message,
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
throw await toServiceException('PATCH', url, res.response);
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Close a task by setting its status to closed.
|
|
299
|
-
*
|
|
300
|
-
* @param id - The unique task identifier
|
|
301
|
-
* @returns The closed task with updated `closed_date`
|
|
302
|
-
* @throws {@link TaskIdRequiredError} if the ID is empty or not a string
|
|
303
|
-
* @throws {@link ServiceException} if the API request fails
|
|
304
|
-
*
|
|
305
|
-
* @example
|
|
306
|
-
* ```typescript
|
|
307
|
-
* const closed = await tasks.close('task_abc123');
|
|
308
|
-
* console.log('Closed at:', closed.closed_date);
|
|
309
|
-
* ```
|
|
310
|
-
*/
|
|
311
|
-
async close(id) {
|
|
312
|
-
if (!id || typeof id !== 'string' || id.trim().length === 0) {
|
|
313
|
-
throw new TaskIdRequiredError();
|
|
314
|
-
}
|
|
315
|
-
const url = buildUrl(this.#baseUrl, `/task/${TASK_API_VERSION}/${encodeURIComponent(id)}`);
|
|
316
|
-
const signal = AbortSignal.timeout(30_000);
|
|
317
|
-
const res = await this.#adapter.invoke(url, {
|
|
318
|
-
method: 'DELETE',
|
|
319
|
-
signal,
|
|
320
|
-
telemetry: {
|
|
321
|
-
name: 'agentuity.task.close',
|
|
322
|
-
attributes: { id },
|
|
323
|
-
},
|
|
324
|
-
});
|
|
325
|
-
if (res.ok) {
|
|
326
|
-
if (res.data.success) {
|
|
327
|
-
return res.data.data;
|
|
328
|
-
}
|
|
329
|
-
throw new TaskStorageResponseError({
|
|
330
|
-
status: res.response.status,
|
|
331
|
-
message: res.data.message,
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
throw await toServiceException('DELETE', url, res.response);
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Get the changelog (audit trail) for a task, showing all field changes over time.
|
|
338
|
-
*
|
|
339
|
-
* @param id - The unique task identifier
|
|
340
|
-
* @param params - Optional pagination parameters
|
|
341
|
-
* @returns Paginated list of changelog entries ordered by most recent first
|
|
342
|
-
* @throws {@link TaskIdRequiredError} if the ID is empty or not a string
|
|
343
|
-
* @throws {@link ServiceException} if the API request fails
|
|
344
|
-
*
|
|
345
|
-
* @example
|
|
346
|
-
* ```typescript
|
|
347
|
-
* const { changelog, total } = await tasks.changelog('task_abc123', {
|
|
348
|
-
* limit: 10,
|
|
349
|
-
* offset: 0,
|
|
350
|
-
* });
|
|
351
|
-
* for (const entry of changelog) {
|
|
352
|
-
* console.log(`${entry.field}: ${entry.old_value} → ${entry.new_value}`);
|
|
353
|
-
* }
|
|
354
|
-
* ```
|
|
355
|
-
*/
|
|
356
|
-
async changelog(id, params) {
|
|
357
|
-
if (!id || typeof id !== 'string' || id.trim().length === 0) {
|
|
358
|
-
throw new TaskIdRequiredError();
|
|
359
|
-
}
|
|
360
|
-
const queryParams = new URLSearchParams();
|
|
361
|
-
if (params?.limit !== undefined)
|
|
362
|
-
queryParams.set('limit', String(params.limit));
|
|
363
|
-
if (params?.offset !== undefined)
|
|
364
|
-
queryParams.set('offset', String(params.offset));
|
|
365
|
-
const queryString = queryParams.toString();
|
|
366
|
-
const url = buildUrl(this.#baseUrl, `/task/changelog/${TASK_API_VERSION}/${encodeURIComponent(id)}${queryString ? `?${queryString}` : ''}`);
|
|
367
|
-
const signal = AbortSignal.timeout(30_000);
|
|
368
|
-
const res = await this.#adapter.invoke(url, {
|
|
369
|
-
method: 'GET',
|
|
370
|
-
signal,
|
|
371
|
-
telemetry: {
|
|
372
|
-
name: 'agentuity.task.changelog',
|
|
373
|
-
attributes: { id },
|
|
374
|
-
},
|
|
375
|
-
});
|
|
376
|
-
if (res.ok) {
|
|
377
|
-
if (res.data.success) {
|
|
378
|
-
return res.data.data;
|
|
379
|
-
}
|
|
380
|
-
throw new TaskStorageResponseError({
|
|
381
|
-
status: res.response.status,
|
|
382
|
-
message: res.data.message,
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
throw await toServiceException('GET', url, res.response);
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Soft-delete a task, marking it as deleted without permanent removal.
|
|
389
|
-
*
|
|
390
|
-
* @param id - The unique task identifier
|
|
391
|
-
* @returns The soft-deleted task
|
|
392
|
-
* @throws {@link TaskIdRequiredError} if the ID is empty or not a string
|
|
393
|
-
* @throws {@link ServiceException} if the API request fails
|
|
394
|
-
*
|
|
395
|
-
* @example
|
|
396
|
-
* ```typescript
|
|
397
|
-
* const deleted = await tasks.softDelete('task_abc123');
|
|
398
|
-
* console.log('Soft-deleted task:', deleted.id);
|
|
399
|
-
* ```
|
|
400
|
-
*/
|
|
401
|
-
async softDelete(id) {
|
|
402
|
-
if (!id || typeof id !== 'string' || id.trim().length === 0) {
|
|
403
|
-
throw new TaskIdRequiredError();
|
|
404
|
-
}
|
|
405
|
-
const url = buildUrl(this.#baseUrl, `/task/delete/${TASK_API_VERSION}/${encodeURIComponent(id)}`);
|
|
406
|
-
const signal = AbortSignal.timeout(30_000);
|
|
407
|
-
const res = await this.#adapter.invoke(url, {
|
|
408
|
-
method: 'POST',
|
|
409
|
-
signal,
|
|
410
|
-
telemetry: {
|
|
411
|
-
name: 'agentuity.task.softDelete',
|
|
412
|
-
attributes: { id },
|
|
413
|
-
},
|
|
414
|
-
});
|
|
415
|
-
if (res.ok) {
|
|
416
|
-
if (res.data.success) {
|
|
417
|
-
return res.data.data;
|
|
418
|
-
}
|
|
419
|
-
throw new TaskStorageResponseError({
|
|
420
|
-
status: res.response.status,
|
|
421
|
-
message: res.data.message,
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
throw await toServiceException('POST', url, res.response);
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Batch soft-delete tasks matching the given filters.
|
|
428
|
-
* At least one filter must be provided. The server caps the limit at 200.
|
|
429
|
-
*
|
|
430
|
-
* @param params - Filters to select which tasks to delete
|
|
431
|
-
* @returns The list of deleted tasks and count
|
|
432
|
-
* @throws {@link ServiceException} if the API request fails
|
|
433
|
-
*
|
|
434
|
-
* @example
|
|
435
|
-
* ```typescript
|
|
436
|
-
* const result = await tasks.batchDelete({ status: 'closed', older_than: '7d', limit: 50 });
|
|
437
|
-
* console.log(`Deleted ${result.count} tasks`);
|
|
438
|
-
* ```
|
|
439
|
-
*/
|
|
440
|
-
async batchDelete(params) {
|
|
441
|
-
const hasFilter = params.status ||
|
|
442
|
-
params.type ||
|
|
443
|
-
params.priority ||
|
|
444
|
-
params.parent_id ||
|
|
445
|
-
params.created_id ||
|
|
446
|
-
params.older_than;
|
|
447
|
-
if (!hasFilter) {
|
|
448
|
-
throw new Error('At least one filter is required for batch delete');
|
|
449
|
-
}
|
|
450
|
-
if (params.limit !== undefined && params.limit > MAX_BATCH_DELETE_LIMIT) {
|
|
451
|
-
throw new Error(`Batch delete limit must not exceed ${MAX_BATCH_DELETE_LIMIT} (got ${params.limit})`);
|
|
452
|
-
}
|
|
453
|
-
const url = buildUrl(this.#baseUrl, `/task/delete/batch/${TASK_API_VERSION}`);
|
|
454
|
-
const signal = AbortSignal.timeout(60_000);
|
|
455
|
-
const body = {};
|
|
456
|
-
if (params.status)
|
|
457
|
-
body.status = params.status;
|
|
458
|
-
if (params.type)
|
|
459
|
-
body.type = params.type;
|
|
460
|
-
if (params.priority)
|
|
461
|
-
body.priority = params.priority;
|
|
462
|
-
if (params.parent_id)
|
|
463
|
-
body.parent_id = params.parent_id;
|
|
464
|
-
if (params.created_id)
|
|
465
|
-
body.created_id = params.created_id;
|
|
466
|
-
if (params.older_than)
|
|
467
|
-
body.older_than = params.older_than;
|
|
468
|
-
if (params.limit !== undefined)
|
|
469
|
-
body.limit = params.limit;
|
|
470
|
-
const res = await this.#adapter.invoke(url, {
|
|
471
|
-
method: 'POST',
|
|
472
|
-
body: safeStringify(body),
|
|
473
|
-
headers: { 'Content-Type': 'application/json' },
|
|
474
|
-
signal,
|
|
475
|
-
telemetry: {
|
|
476
|
-
name: 'agentuity.task.batchDelete',
|
|
477
|
-
attributes: {
|
|
478
|
-
...(params.status ? { status: params.status } : {}),
|
|
479
|
-
...(params.type ? { type: params.type } : {}),
|
|
480
|
-
...(params.older_than ? { older_than: params.older_than } : {}),
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
});
|
|
484
|
-
if (res.ok) {
|
|
485
|
-
if (res.data.success) {
|
|
486
|
-
return res.data.data;
|
|
487
|
-
}
|
|
488
|
-
throw new TaskStorageResponseError({
|
|
489
|
-
status: res.response.status,
|
|
490
|
-
message: res.data.message,
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
throw await toServiceException('POST', url, res.response);
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Create a comment on a task.
|
|
497
|
-
*
|
|
498
|
-
* @param taskId - The ID of the task to comment on
|
|
499
|
-
* @param body - The comment text content (must be non-empty)
|
|
500
|
-
* @param userId - The ID of the user authoring the comment
|
|
501
|
-
* @param author - Optional entity reference with the author's display name
|
|
502
|
-
* @returns The newly created comment
|
|
503
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
504
|
-
* @throws {@link CommentBodyRequiredError} if the body is empty or not a string
|
|
505
|
-
* @throws {@link UserIdRequiredError} if the user ID is empty or not a string
|
|
506
|
-
* @throws {@link ServiceException} if the API request fails
|
|
507
|
-
*
|
|
508
|
-
* @example
|
|
509
|
-
* ```typescript
|
|
510
|
-
* const comment = await tasks.createComment(
|
|
511
|
-
* 'task_abc123',
|
|
512
|
-
* 'This is ready for review.',
|
|
513
|
-
* 'user_456',
|
|
514
|
-
* { id: 'user_456', name: 'Bob' },
|
|
515
|
-
* );
|
|
516
|
-
* console.log('Comment created:', comment.id);
|
|
517
|
-
* ```
|
|
518
|
-
*/
|
|
519
|
-
async createComment(taskId, body, userId, author) {
|
|
520
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
521
|
-
throw new TaskIdRequiredError();
|
|
522
|
-
}
|
|
523
|
-
if (!body || typeof body !== 'string' || body.trim().length === 0) {
|
|
524
|
-
throw new CommentBodyRequiredError();
|
|
525
|
-
}
|
|
526
|
-
if (!userId || typeof userId !== 'string' || userId.trim().length === 0) {
|
|
527
|
-
throw new UserIdRequiredError();
|
|
528
|
-
}
|
|
529
|
-
const url = buildUrl(this.#baseUrl, `/task/comments/create/${TASK_API_VERSION}/${encodeURIComponent(taskId)}`);
|
|
530
|
-
const signal = AbortSignal.timeout(30_000);
|
|
531
|
-
const commentBody = { body, user_id: userId };
|
|
532
|
-
if (author)
|
|
533
|
-
commentBody.author = author;
|
|
534
|
-
const res = await this.#adapter.invoke(url, {
|
|
535
|
-
method: 'POST',
|
|
536
|
-
body: safeStringify(commentBody),
|
|
537
|
-
contentType: 'application/json',
|
|
538
|
-
signal,
|
|
539
|
-
telemetry: {
|
|
540
|
-
name: 'agentuity.task.createComment',
|
|
541
|
-
attributes: { taskId },
|
|
542
|
-
},
|
|
543
|
-
});
|
|
544
|
-
if (res.ok) {
|
|
545
|
-
if (res.data.success) {
|
|
546
|
-
return res.data.data;
|
|
547
|
-
}
|
|
548
|
-
throw new TaskStorageResponseError({
|
|
549
|
-
status: res.response.status,
|
|
550
|
-
message: res.data.message,
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
throw await toServiceException('POST', url, res.response);
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Get a comment by its ID.
|
|
557
|
-
*
|
|
558
|
-
* @param commentId - The unique comment identifier
|
|
559
|
-
* @returns The comment
|
|
560
|
-
* @throws {@link CommentIdRequiredError} if the comment ID is empty or not a string
|
|
561
|
-
* @throws {@link ServiceException} if the API request fails
|
|
562
|
-
*
|
|
563
|
-
* @example
|
|
564
|
-
* ```typescript
|
|
565
|
-
* const comment = await tasks.getComment('comment_xyz789');
|
|
566
|
-
* console.log(`${comment.author?.name}: ${comment.body}`);
|
|
567
|
-
* ```
|
|
568
|
-
*/
|
|
569
|
-
async getComment(commentId) {
|
|
570
|
-
if (!commentId || typeof commentId !== 'string' || commentId.trim().length === 0) {
|
|
571
|
-
throw new CommentIdRequiredError();
|
|
572
|
-
}
|
|
573
|
-
const url = buildUrl(this.#baseUrl, `/task/comments/get/${TASK_API_VERSION}/${encodeURIComponent(commentId)}`);
|
|
574
|
-
const signal = AbortSignal.timeout(30_000);
|
|
575
|
-
const res = await this.#adapter.invoke(url, {
|
|
576
|
-
method: 'GET',
|
|
577
|
-
signal,
|
|
578
|
-
telemetry: {
|
|
579
|
-
name: 'agentuity.task.getComment',
|
|
580
|
-
attributes: { commentId },
|
|
581
|
-
},
|
|
582
|
-
});
|
|
583
|
-
if (res.ok) {
|
|
584
|
-
if (res.data.success) {
|
|
585
|
-
return res.data.data;
|
|
586
|
-
}
|
|
587
|
-
throw new TaskStorageResponseError({
|
|
588
|
-
status: res.response.status,
|
|
589
|
-
message: res.data.message,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
throw await toServiceException('GET', url, res.response);
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Update a comment's body text.
|
|
596
|
-
*
|
|
597
|
-
* @param commentId - The unique comment identifier
|
|
598
|
-
* @param body - The new comment text (must be non-empty)
|
|
599
|
-
* @returns The updated comment
|
|
600
|
-
* @throws {@link CommentIdRequiredError} if the comment ID is empty or not a string
|
|
601
|
-
* @throws {@link CommentBodyRequiredError} if the body is empty or not a string
|
|
602
|
-
* @throws {@link ServiceException} if the API request fails
|
|
603
|
-
*
|
|
604
|
-
* @example
|
|
605
|
-
* ```typescript
|
|
606
|
-
* const updated = await tasks.updateComment(
|
|
607
|
-
* 'comment_xyz789',
|
|
608
|
-
* 'Updated: This is now ready for final review.',
|
|
609
|
-
* );
|
|
610
|
-
* console.log('Updated at:', updated.updated_at);
|
|
611
|
-
* ```
|
|
612
|
-
*/
|
|
613
|
-
async updateComment(commentId, body) {
|
|
614
|
-
if (!commentId || typeof commentId !== 'string' || commentId.trim().length === 0) {
|
|
615
|
-
throw new CommentIdRequiredError();
|
|
616
|
-
}
|
|
617
|
-
if (!body || typeof body !== 'string' || body.trim().length === 0) {
|
|
618
|
-
throw new CommentBodyRequiredError();
|
|
619
|
-
}
|
|
620
|
-
const url = buildUrl(this.#baseUrl, `/task/comments/update/${TASK_API_VERSION}/${encodeURIComponent(commentId)}`);
|
|
621
|
-
const signal = AbortSignal.timeout(30_000);
|
|
622
|
-
const res = await this.#adapter.invoke(url, {
|
|
623
|
-
method: 'PATCH',
|
|
624
|
-
body: safeStringify({ body }),
|
|
625
|
-
contentType: 'application/json',
|
|
626
|
-
signal,
|
|
627
|
-
telemetry: {
|
|
628
|
-
name: 'agentuity.task.updateComment',
|
|
629
|
-
attributes: { commentId },
|
|
630
|
-
},
|
|
631
|
-
});
|
|
632
|
-
if (res.ok) {
|
|
633
|
-
if (res.data.success) {
|
|
634
|
-
return res.data.data;
|
|
635
|
-
}
|
|
636
|
-
throw new TaskStorageResponseError({
|
|
637
|
-
status: res.response.status,
|
|
638
|
-
message: res.data.message,
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
throw await toServiceException('PATCH', url, res.response);
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* Delete a comment permanently.
|
|
645
|
-
*
|
|
646
|
-
* @param commentId - The unique comment identifier
|
|
647
|
-
* @throws {@link CommentIdRequiredError} if the comment ID is empty or not a string
|
|
648
|
-
* @throws {@link ServiceException} if the API request fails
|
|
649
|
-
*
|
|
650
|
-
* @example
|
|
651
|
-
* ```typescript
|
|
652
|
-
* await tasks.deleteComment('comment_xyz789');
|
|
653
|
-
* console.log('Comment deleted');
|
|
654
|
-
* ```
|
|
655
|
-
*/
|
|
656
|
-
async deleteComment(commentId) {
|
|
657
|
-
if (!commentId || typeof commentId !== 'string' || commentId.trim().length === 0) {
|
|
658
|
-
throw new CommentIdRequiredError();
|
|
659
|
-
}
|
|
660
|
-
const url = buildUrl(this.#baseUrl, `/task/comments/delete/${TASK_API_VERSION}/${encodeURIComponent(commentId)}`);
|
|
661
|
-
const signal = AbortSignal.timeout(30_000);
|
|
662
|
-
const res = await this.#adapter.invoke(url, {
|
|
663
|
-
method: 'DELETE',
|
|
664
|
-
signal,
|
|
665
|
-
telemetry: {
|
|
666
|
-
name: 'agentuity.task.deleteComment',
|
|
667
|
-
attributes: { commentId },
|
|
668
|
-
},
|
|
669
|
-
});
|
|
670
|
-
if (res.ok) {
|
|
671
|
-
if (res.data?.success === false) {
|
|
672
|
-
throw new TaskStorageResponseError({
|
|
673
|
-
status: res.response.status,
|
|
674
|
-
message: res.data.message ?? 'Operation failed',
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
throw await toServiceException('DELETE', url, res.response);
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* List comments on a task with optional pagination.
|
|
683
|
-
*
|
|
684
|
-
* @param taskId - The ID of the task whose comments to list
|
|
685
|
-
* @param params - Optional pagination parameters
|
|
686
|
-
* @returns Paginated list of comments
|
|
687
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
688
|
-
* @throws {@link ServiceException} if the API request fails
|
|
689
|
-
*
|
|
690
|
-
* @example
|
|
691
|
-
* ```typescript
|
|
692
|
-
* const { comments, total } = await tasks.listComments('task_abc123', {
|
|
693
|
-
* limit: 25,
|
|
694
|
-
* offset: 0,
|
|
695
|
-
* });
|
|
696
|
-
* for (const c of comments) {
|
|
697
|
-
* console.log(`${c.author?.name}: ${c.body}`);
|
|
698
|
-
* }
|
|
699
|
-
* ```
|
|
700
|
-
*/
|
|
701
|
-
async listComments(taskId, params) {
|
|
702
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
703
|
-
throw new TaskIdRequiredError();
|
|
704
|
-
}
|
|
705
|
-
const queryParams = new URLSearchParams();
|
|
706
|
-
if (params?.limit !== undefined)
|
|
707
|
-
queryParams.set('limit', String(params.limit));
|
|
708
|
-
if (params?.offset !== undefined)
|
|
709
|
-
queryParams.set('offset', String(params.offset));
|
|
710
|
-
const queryString = queryParams.toString();
|
|
711
|
-
const url = buildUrl(this.#baseUrl, `/task/comments/list/${TASK_API_VERSION}/${encodeURIComponent(taskId)}${queryString ? `?${queryString}` : ''}`);
|
|
712
|
-
const signal = AbortSignal.timeout(30_000);
|
|
713
|
-
const res = await this.#adapter.invoke(url, {
|
|
714
|
-
method: 'GET',
|
|
715
|
-
signal,
|
|
716
|
-
telemetry: {
|
|
717
|
-
name: 'agentuity.task.listComments',
|
|
718
|
-
attributes: { taskId },
|
|
719
|
-
},
|
|
720
|
-
});
|
|
721
|
-
if (res.ok) {
|
|
722
|
-
if (res.data.success) {
|
|
723
|
-
return res.data.data;
|
|
724
|
-
}
|
|
725
|
-
throw new TaskStorageResponseError({
|
|
726
|
-
status: res.response.status,
|
|
727
|
-
message: res.data.message,
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
throw await toServiceException('GET', url, res.response);
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Create a new tag for categorizing tasks.
|
|
734
|
-
*
|
|
735
|
-
* @param name - The tag display name (must be non-empty)
|
|
736
|
-
* @param color - Optional hex color code (e.g., `'#ff0000'`)
|
|
737
|
-
* @returns The newly created tag
|
|
738
|
-
* @throws {@link TagNameRequiredError} if the name is empty or not a string
|
|
739
|
-
* @throws {@link ServiceException} if the API request fails
|
|
740
|
-
*
|
|
741
|
-
* @example
|
|
742
|
-
* ```typescript
|
|
743
|
-
* const tag = await tasks.createTag('urgent', '#ff0000');
|
|
744
|
-
* console.log('Created tag:', tag.id, tag.name);
|
|
745
|
-
* ```
|
|
746
|
-
*/
|
|
747
|
-
async createTag(name, color) {
|
|
748
|
-
if (!name || typeof name !== 'string' || name.trim().length === 0) {
|
|
749
|
-
throw new TagNameRequiredError();
|
|
750
|
-
}
|
|
751
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/create/${TASK_API_VERSION}`);
|
|
752
|
-
const signal = AbortSignal.timeout(30_000);
|
|
753
|
-
const body = { name };
|
|
754
|
-
if (color !== undefined)
|
|
755
|
-
body.color = color;
|
|
756
|
-
const res = await this.#adapter.invoke(url, {
|
|
757
|
-
method: 'POST',
|
|
758
|
-
body: safeStringify(body),
|
|
759
|
-
contentType: 'application/json',
|
|
760
|
-
signal,
|
|
761
|
-
telemetry: {
|
|
762
|
-
name: 'agentuity.task.createTag',
|
|
763
|
-
attributes: { tagName: name },
|
|
764
|
-
},
|
|
765
|
-
});
|
|
766
|
-
if (res.ok) {
|
|
767
|
-
if (res.data.success) {
|
|
768
|
-
return res.data.data;
|
|
769
|
-
}
|
|
770
|
-
throw new TaskStorageResponseError({
|
|
771
|
-
status: res.response.status,
|
|
772
|
-
message: res.data.message,
|
|
773
|
-
});
|
|
774
|
-
}
|
|
775
|
-
throw await toServiceException('POST', url, res.response);
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* Get a tag by its ID.
|
|
779
|
-
*
|
|
780
|
-
* @param tagId - The unique tag identifier
|
|
781
|
-
* @returns The tag
|
|
782
|
-
* @throws {@link TagIdRequiredError} if the tag ID is empty or not a string
|
|
783
|
-
* @throws {@link ServiceException} if the API request fails
|
|
784
|
-
*
|
|
785
|
-
* @example
|
|
786
|
-
* ```typescript
|
|
787
|
-
* const tag = await tasks.getTag('tag_def456');
|
|
788
|
-
* console.log(`${tag.name} (${tag.color})`);
|
|
789
|
-
* ```
|
|
790
|
-
*/
|
|
791
|
-
async getTag(tagId) {
|
|
792
|
-
if (!tagId || typeof tagId !== 'string' || tagId.trim().length === 0) {
|
|
793
|
-
throw new TagIdRequiredError();
|
|
794
|
-
}
|
|
795
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/get/${TASK_API_VERSION}/${encodeURIComponent(tagId)}`);
|
|
796
|
-
const signal = AbortSignal.timeout(30_000);
|
|
797
|
-
const res = await this.#adapter.invoke(url, {
|
|
798
|
-
method: 'GET',
|
|
799
|
-
signal,
|
|
800
|
-
telemetry: {
|
|
801
|
-
name: 'agentuity.task.getTag',
|
|
802
|
-
attributes: { tagId },
|
|
803
|
-
},
|
|
804
|
-
});
|
|
805
|
-
if (res.ok) {
|
|
806
|
-
if (res.data.success) {
|
|
807
|
-
return res.data.data;
|
|
808
|
-
}
|
|
809
|
-
throw new TaskStorageResponseError({
|
|
810
|
-
status: res.response.status,
|
|
811
|
-
message: res.data.message,
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
throw await toServiceException('GET', url, res.response);
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Update a tag's name and optionally its color.
|
|
818
|
-
*
|
|
819
|
-
* @param tagId - The unique tag identifier
|
|
820
|
-
* @param name - The new tag name (must be non-empty)
|
|
821
|
-
* @param color - Optional new hex color code
|
|
822
|
-
* @returns The updated tag
|
|
823
|
-
* @throws {@link TagIdRequiredError} if the tag ID is empty or not a string
|
|
824
|
-
* @throws {@link TagNameRequiredError} if the name is empty or not a string
|
|
825
|
-
* @throws {@link ServiceException} if the API request fails
|
|
826
|
-
*
|
|
827
|
-
* @example
|
|
828
|
-
* ```typescript
|
|
829
|
-
* const updated = await tasks.updateTag('tag_def456', 'critical', '#cc0000');
|
|
830
|
-
* console.log('Updated:', updated.name);
|
|
831
|
-
* ```
|
|
832
|
-
*/
|
|
833
|
-
async updateTag(tagId, name, color) {
|
|
834
|
-
if (!tagId || typeof tagId !== 'string' || tagId.trim().length === 0) {
|
|
835
|
-
throw new TagIdRequiredError();
|
|
836
|
-
}
|
|
837
|
-
if (!name || typeof name !== 'string' || name.trim().length === 0) {
|
|
838
|
-
throw new TagNameRequiredError();
|
|
839
|
-
}
|
|
840
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/update/${TASK_API_VERSION}/${encodeURIComponent(tagId)}`);
|
|
841
|
-
const signal = AbortSignal.timeout(30_000);
|
|
842
|
-
const body = { name };
|
|
843
|
-
if (color !== undefined)
|
|
844
|
-
body.color = color;
|
|
845
|
-
const res = await this.#adapter.invoke(url, {
|
|
846
|
-
method: 'PATCH',
|
|
847
|
-
body: safeStringify(body),
|
|
848
|
-
contentType: 'application/json',
|
|
849
|
-
signal,
|
|
850
|
-
telemetry: {
|
|
851
|
-
name: 'agentuity.task.updateTag',
|
|
852
|
-
attributes: { tagId },
|
|
853
|
-
},
|
|
854
|
-
});
|
|
855
|
-
if (res.ok) {
|
|
856
|
-
if (res.data.success) {
|
|
857
|
-
return res.data.data;
|
|
858
|
-
}
|
|
859
|
-
throw new TaskStorageResponseError({
|
|
860
|
-
status: res.response.status,
|
|
861
|
-
message: res.data.message,
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
throw await toServiceException('PATCH', url, res.response);
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Delete a tag permanently.
|
|
868
|
-
*
|
|
869
|
-
* @param tagId - The unique tag identifier
|
|
870
|
-
* @throws {@link TagIdRequiredError} if the tag ID is empty or not a string
|
|
871
|
-
* @throws {@link ServiceException} if the API request fails
|
|
872
|
-
*
|
|
873
|
-
* @example
|
|
874
|
-
* ```typescript
|
|
875
|
-
* await tasks.deleteTag('tag_def456');
|
|
876
|
-
* console.log('Tag deleted');
|
|
877
|
-
* ```
|
|
878
|
-
*/
|
|
879
|
-
async deleteTag(tagId) {
|
|
880
|
-
if (!tagId || typeof tagId !== 'string' || tagId.trim().length === 0) {
|
|
881
|
-
throw new TagIdRequiredError();
|
|
882
|
-
}
|
|
883
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/delete/${TASK_API_VERSION}/${encodeURIComponent(tagId)}`);
|
|
884
|
-
const signal = AbortSignal.timeout(30_000);
|
|
885
|
-
const res = await this.#adapter.invoke(url, {
|
|
886
|
-
method: 'DELETE',
|
|
887
|
-
signal,
|
|
888
|
-
telemetry: {
|
|
889
|
-
name: 'agentuity.task.deleteTag',
|
|
890
|
-
attributes: { tagId },
|
|
891
|
-
},
|
|
892
|
-
});
|
|
893
|
-
if (res.ok) {
|
|
894
|
-
if (res.data?.success === false) {
|
|
895
|
-
throw new TaskStorageResponseError({
|
|
896
|
-
status: res.response.status,
|
|
897
|
-
message: res.data.message ?? 'Operation failed',
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
return;
|
|
901
|
-
}
|
|
902
|
-
throw await toServiceException('DELETE', url, res.response);
|
|
903
|
-
}
|
|
904
|
-
/**
|
|
905
|
-
* List all tags in the organization.
|
|
906
|
-
*
|
|
907
|
-
* @returns List of all tags
|
|
908
|
-
* @throws {@link ServiceException} if the API request fails
|
|
909
|
-
*
|
|
910
|
-
* @example
|
|
911
|
-
* ```typescript
|
|
912
|
-
* const { tags } = await tasks.listTags();
|
|
913
|
-
* for (const tag of tags) {
|
|
914
|
-
* console.log(`${tag.name} (${tag.color ?? 'no color'})`);
|
|
915
|
-
* }
|
|
916
|
-
* ```
|
|
917
|
-
*/
|
|
918
|
-
async listTags() {
|
|
919
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/list/${TASK_API_VERSION}`);
|
|
920
|
-
const signal = AbortSignal.timeout(30_000);
|
|
921
|
-
const res = await this.#adapter.invoke(url, {
|
|
922
|
-
method: 'GET',
|
|
923
|
-
signal,
|
|
924
|
-
telemetry: {
|
|
925
|
-
name: 'agentuity.task.listTags',
|
|
926
|
-
attributes: {},
|
|
927
|
-
},
|
|
928
|
-
});
|
|
929
|
-
if (res.ok) {
|
|
930
|
-
if (res.data.success) {
|
|
931
|
-
return res.data.data;
|
|
932
|
-
}
|
|
933
|
-
throw new TaskStorageResponseError({
|
|
934
|
-
status: res.response.status,
|
|
935
|
-
message: res.data.message,
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
throw await toServiceException('GET', url, res.response);
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Associate a tag with a task.
|
|
942
|
-
*
|
|
943
|
-
* @param taskId - The ID of the task
|
|
944
|
-
* @param tagId - The ID of the tag to add
|
|
945
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
946
|
-
* @throws {@link TagIdRequiredError} if the tag ID is empty or not a string
|
|
947
|
-
* @throws {@link ServiceException} if the API request fails
|
|
948
|
-
*
|
|
949
|
-
* @example
|
|
950
|
-
* ```typescript
|
|
951
|
-
* await tasks.addTagToTask('task_abc123', 'tag_def456');
|
|
952
|
-
* console.log('Tag added to task');
|
|
953
|
-
* ```
|
|
954
|
-
*/
|
|
955
|
-
async addTagToTask(taskId, tagId) {
|
|
956
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
957
|
-
throw new TaskIdRequiredError();
|
|
958
|
-
}
|
|
959
|
-
if (!tagId || typeof tagId !== 'string' || tagId.trim().length === 0) {
|
|
960
|
-
throw new TagIdRequiredError();
|
|
961
|
-
}
|
|
962
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/add/${TASK_API_VERSION}/${encodeURIComponent(taskId)}/${encodeURIComponent(tagId)}`);
|
|
963
|
-
const signal = AbortSignal.timeout(30_000);
|
|
964
|
-
const res = await this.#adapter.invoke(url, {
|
|
965
|
-
method: 'POST',
|
|
966
|
-
signal,
|
|
967
|
-
telemetry: {
|
|
968
|
-
name: 'agentuity.task.addTagToTask',
|
|
969
|
-
attributes: { taskId, tagId },
|
|
970
|
-
},
|
|
971
|
-
});
|
|
972
|
-
if (res.ok) {
|
|
973
|
-
if (res.data?.success === false) {
|
|
974
|
-
throw new TaskStorageResponseError({
|
|
975
|
-
status: res.response.status,
|
|
976
|
-
message: res.data.message ?? 'Operation failed',
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
return;
|
|
980
|
-
}
|
|
981
|
-
throw await toServiceException('POST', url, res.response);
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* Remove a tag association from a task.
|
|
985
|
-
*
|
|
986
|
-
* @param taskId - The ID of the task
|
|
987
|
-
* @param tagId - The ID of the tag to remove
|
|
988
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
989
|
-
* @throws {@link TagIdRequiredError} if the tag ID is empty or not a string
|
|
990
|
-
* @throws {@link ServiceException} if the API request fails
|
|
991
|
-
*
|
|
992
|
-
* @example
|
|
993
|
-
* ```typescript
|
|
994
|
-
* await tasks.removeTagFromTask('task_abc123', 'tag_def456');
|
|
995
|
-
* console.log('Tag removed from task');
|
|
996
|
-
* ```
|
|
997
|
-
*/
|
|
998
|
-
async removeTagFromTask(taskId, tagId) {
|
|
999
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
1000
|
-
throw new TaskIdRequiredError();
|
|
1001
|
-
}
|
|
1002
|
-
if (!tagId || typeof tagId !== 'string' || tagId.trim().length === 0) {
|
|
1003
|
-
throw new TagIdRequiredError();
|
|
1004
|
-
}
|
|
1005
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/remove/${TASK_API_VERSION}/${encodeURIComponent(taskId)}/${encodeURIComponent(tagId)}`);
|
|
1006
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1007
|
-
const res = await this.#adapter.invoke(url, {
|
|
1008
|
-
method: 'DELETE',
|
|
1009
|
-
signal,
|
|
1010
|
-
telemetry: {
|
|
1011
|
-
name: 'agentuity.task.removeTagFromTask',
|
|
1012
|
-
attributes: { taskId, tagId },
|
|
1013
|
-
},
|
|
1014
|
-
});
|
|
1015
|
-
if (res.ok) {
|
|
1016
|
-
if (res.data?.success === false) {
|
|
1017
|
-
throw new TaskStorageResponseError({
|
|
1018
|
-
status: res.response.status,
|
|
1019
|
-
message: res.data.message ?? 'Operation failed',
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
throw await toServiceException('DELETE', url, res.response);
|
|
1025
|
-
}
|
|
1026
|
-
/**
|
|
1027
|
-
* List all tags associated with a specific task.
|
|
1028
|
-
*
|
|
1029
|
-
* @param taskId - The ID of the task
|
|
1030
|
-
* @returns Array of tags on the task
|
|
1031
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
1032
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1033
|
-
*
|
|
1034
|
-
* @example
|
|
1035
|
-
* ```typescript
|
|
1036
|
-
* const tags = await tasks.listTagsForTask('task_abc123');
|
|
1037
|
-
* console.log('Tags:', tags.map((t) => t.name).join(', '));
|
|
1038
|
-
* ```
|
|
1039
|
-
*/
|
|
1040
|
-
async listTagsForTask(taskId) {
|
|
1041
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
1042
|
-
throw new TaskIdRequiredError();
|
|
1043
|
-
}
|
|
1044
|
-
const url = buildUrl(this.#baseUrl, `/task/tags/task/${TASK_API_VERSION}/${encodeURIComponent(taskId)}`);
|
|
1045
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1046
|
-
const res = await this.#adapter.invoke(url, {
|
|
1047
|
-
method: 'GET',
|
|
1048
|
-
signal,
|
|
1049
|
-
telemetry: {
|
|
1050
|
-
name: 'agentuity.task.listTagsForTask',
|
|
1051
|
-
attributes: { taskId },
|
|
1052
|
-
},
|
|
1053
|
-
});
|
|
1054
|
-
if (res.ok) {
|
|
1055
|
-
if (res.data.success) {
|
|
1056
|
-
return res.data.data;
|
|
1057
|
-
}
|
|
1058
|
-
throw new TaskStorageResponseError({
|
|
1059
|
-
status: res.response.status,
|
|
1060
|
-
message: res.data.message,
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
throw await toServiceException('GET', url, res.response);
|
|
1064
|
-
}
|
|
1065
|
-
/**
|
|
1066
|
-
* Initiate a file upload to a task. Returns a presigned S3 URL for direct upload.
|
|
1067
|
-
*
|
|
1068
|
-
* @remarks
|
|
1069
|
-
* After receiving the presigned URL, upload the file content via HTTP PUT to that URL.
|
|
1070
|
-
* Then call {@link TaskStorageService.confirmAttachment | confirmAttachment} to finalize.
|
|
1071
|
-
*
|
|
1072
|
-
* @param taskId - The ID of the task to attach the file to
|
|
1073
|
-
* @param params - Attachment metadata including filename, content type, and size
|
|
1074
|
-
* @returns The created attachment record and a presigned upload URL
|
|
1075
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
1076
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1077
|
-
*
|
|
1078
|
-
* @example
|
|
1079
|
-
* ```typescript
|
|
1080
|
-
* const { attachment, presigned_url } = await tasks.uploadAttachment(
|
|
1081
|
-
* 'task_abc123',
|
|
1082
|
-
* { filename: 'report.pdf', content_type: 'application/pdf', size: 102400 },
|
|
1083
|
-
* );
|
|
1084
|
-
*
|
|
1085
|
-
* // Upload the file to S3
|
|
1086
|
-
* await fetch(presigned_url, { method: 'PUT', body: fileContent });
|
|
1087
|
-
*
|
|
1088
|
-
* // Confirm the upload
|
|
1089
|
-
* await tasks.confirmAttachment(attachment.id);
|
|
1090
|
-
* ```
|
|
1091
|
-
*/
|
|
1092
|
-
async uploadAttachment(taskId, params) {
|
|
1093
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
1094
|
-
throw new TaskIdRequiredError();
|
|
1095
|
-
}
|
|
1096
|
-
const url = buildUrl(this.#baseUrl, `/task/attachments/presign-upload/${TASK_API_VERSION}/${encodeURIComponent(taskId)}`);
|
|
1097
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1098
|
-
const res = await this.#adapter.invoke(url, {
|
|
1099
|
-
method: 'POST',
|
|
1100
|
-
body: safeStringify(params),
|
|
1101
|
-
contentType: 'application/json',
|
|
1102
|
-
signal,
|
|
1103
|
-
telemetry: {
|
|
1104
|
-
name: 'agentuity.task.uploadAttachment',
|
|
1105
|
-
attributes: { taskId },
|
|
1106
|
-
},
|
|
1107
|
-
});
|
|
1108
|
-
if (res.ok) {
|
|
1109
|
-
if (res.data.success) {
|
|
1110
|
-
return res.data.data;
|
|
1111
|
-
}
|
|
1112
|
-
throw new TaskStorageResponseError({
|
|
1113
|
-
status: res.response.status,
|
|
1114
|
-
message: res.data.message,
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
throw await toServiceException('POST', url, res.response);
|
|
1118
|
-
}
|
|
1119
|
-
/**
|
|
1120
|
-
* Confirm that a file upload has completed successfully.
|
|
1121
|
-
*
|
|
1122
|
-
* @remarks
|
|
1123
|
-
* Call this after successfully uploading the file to the presigned URL
|
|
1124
|
-
* returned by {@link TaskStorageService.uploadAttachment | uploadAttachment}.
|
|
1125
|
-
*
|
|
1126
|
-
* @param attachmentId - The unique attachment identifier
|
|
1127
|
-
* @returns The confirmed attachment record
|
|
1128
|
-
* @throws {@link AttachmentIdRequiredError} if the attachment ID is empty or not a string
|
|
1129
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1130
|
-
*
|
|
1131
|
-
* @example
|
|
1132
|
-
* ```typescript
|
|
1133
|
-
* const confirmed = await tasks.confirmAttachment('att_ghi789');
|
|
1134
|
-
* console.log('Confirmed:', confirmed.filename);
|
|
1135
|
-
* ```
|
|
1136
|
-
*/
|
|
1137
|
-
async confirmAttachment(attachmentId) {
|
|
1138
|
-
if (!attachmentId || typeof attachmentId !== 'string' || attachmentId.trim().length === 0) {
|
|
1139
|
-
throw new AttachmentIdRequiredError();
|
|
1140
|
-
}
|
|
1141
|
-
const url = buildUrl(this.#baseUrl, `/task/attachments/confirm/${TASK_API_VERSION}/${encodeURIComponent(attachmentId)}`);
|
|
1142
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1143
|
-
const res = await this.#adapter.invoke(url, {
|
|
1144
|
-
method: 'POST',
|
|
1145
|
-
signal,
|
|
1146
|
-
telemetry: {
|
|
1147
|
-
name: 'agentuity.task.confirmAttachment',
|
|
1148
|
-
attributes: { attachmentId },
|
|
1149
|
-
},
|
|
1150
|
-
});
|
|
1151
|
-
if (res.ok) {
|
|
1152
|
-
if (res.data.success) {
|
|
1153
|
-
return res.data.data;
|
|
1154
|
-
}
|
|
1155
|
-
throw new TaskStorageResponseError({
|
|
1156
|
-
status: res.response.status,
|
|
1157
|
-
message: res.data.message,
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
throw await toServiceException('POST', url, res.response);
|
|
1161
|
-
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Get a presigned S3 URL for downloading an attachment.
|
|
1164
|
-
*
|
|
1165
|
-
* @param attachmentId - The unique attachment identifier
|
|
1166
|
-
* @returns A presigned download URL with expiry information
|
|
1167
|
-
* @throws {@link AttachmentIdRequiredError} if the attachment ID is empty or not a string
|
|
1168
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1169
|
-
*
|
|
1170
|
-
* @example
|
|
1171
|
-
* ```typescript
|
|
1172
|
-
* const { presigned_url, expiry_seconds } = await tasks.downloadAttachment('att_ghi789');
|
|
1173
|
-
* console.log(`Download URL (expires in ${expiry_seconds}s):`, presigned_url);
|
|
1174
|
-
* ```
|
|
1175
|
-
*/
|
|
1176
|
-
async downloadAttachment(attachmentId) {
|
|
1177
|
-
if (!attachmentId || typeof attachmentId !== 'string' || attachmentId.trim().length === 0) {
|
|
1178
|
-
throw new AttachmentIdRequiredError();
|
|
1179
|
-
}
|
|
1180
|
-
const url = buildUrl(this.#baseUrl, `/task/attachments/presign-download/${TASK_API_VERSION}/${encodeURIComponent(attachmentId)}`);
|
|
1181
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1182
|
-
const res = await this.#adapter.invoke(url, {
|
|
1183
|
-
method: 'POST',
|
|
1184
|
-
signal,
|
|
1185
|
-
telemetry: {
|
|
1186
|
-
name: 'agentuity.task.downloadAttachment',
|
|
1187
|
-
attributes: { attachmentId },
|
|
1188
|
-
},
|
|
1189
|
-
});
|
|
1190
|
-
if (res.ok) {
|
|
1191
|
-
if (res.data.success) {
|
|
1192
|
-
return res.data.data;
|
|
1193
|
-
}
|
|
1194
|
-
throw new TaskStorageResponseError({
|
|
1195
|
-
status: res.response.status,
|
|
1196
|
-
message: res.data.message,
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1199
|
-
throw await toServiceException('POST', url, res.response);
|
|
1200
|
-
}
|
|
1201
|
-
/**
|
|
1202
|
-
* List all attachments on a task.
|
|
1203
|
-
*
|
|
1204
|
-
* @param taskId - The ID of the task
|
|
1205
|
-
* @returns List of attachments with total count
|
|
1206
|
-
* @throws {@link TaskIdRequiredError} if the task ID is empty or not a string
|
|
1207
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1208
|
-
*
|
|
1209
|
-
* @example
|
|
1210
|
-
* ```typescript
|
|
1211
|
-
* const { attachments, total } = await tasks.listAttachments('task_abc123');
|
|
1212
|
-
* for (const att of attachments) {
|
|
1213
|
-
* console.log(`${att.filename} (${att.content_type}, ${att.size} bytes)`);
|
|
1214
|
-
* }
|
|
1215
|
-
* ```
|
|
1216
|
-
*/
|
|
1217
|
-
async listAttachments(taskId) {
|
|
1218
|
-
if (!taskId || typeof taskId !== 'string' || taskId.trim().length === 0) {
|
|
1219
|
-
throw new TaskIdRequiredError();
|
|
1220
|
-
}
|
|
1221
|
-
const url = buildUrl(this.#baseUrl, `/task/attachments/list/${TASK_API_VERSION}/${encodeURIComponent(taskId)}`);
|
|
1222
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1223
|
-
const res = await this.#adapter.invoke(url, {
|
|
1224
|
-
method: 'GET',
|
|
1225
|
-
signal,
|
|
1226
|
-
telemetry: {
|
|
1227
|
-
name: 'agentuity.task.listAttachments',
|
|
1228
|
-
attributes: { taskId },
|
|
1229
|
-
},
|
|
1230
|
-
});
|
|
1231
|
-
if (res.ok) {
|
|
1232
|
-
if (res.data.success) {
|
|
1233
|
-
return res.data.data;
|
|
1234
|
-
}
|
|
1235
|
-
throw new TaskStorageResponseError({
|
|
1236
|
-
status: res.response.status,
|
|
1237
|
-
message: res.data.message,
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
throw await toServiceException('GET', url, res.response);
|
|
1241
|
-
}
|
|
1242
|
-
/**
|
|
1243
|
-
* Delete an attachment permanently.
|
|
1244
|
-
*
|
|
1245
|
-
* @param attachmentId - The unique attachment identifier
|
|
1246
|
-
* @throws {@link AttachmentIdRequiredError} if the attachment ID is empty or not a string
|
|
1247
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1248
|
-
*
|
|
1249
|
-
* @example
|
|
1250
|
-
* ```typescript
|
|
1251
|
-
* await tasks.deleteAttachment('att_ghi789');
|
|
1252
|
-
* console.log('Attachment deleted');
|
|
1253
|
-
* ```
|
|
1254
|
-
*/
|
|
1255
|
-
async deleteAttachment(attachmentId) {
|
|
1256
|
-
if (!attachmentId || typeof attachmentId !== 'string' || attachmentId.trim().length === 0) {
|
|
1257
|
-
throw new AttachmentIdRequiredError();
|
|
1258
|
-
}
|
|
1259
|
-
const url = buildUrl(this.#baseUrl, `/task/attachments/delete/${TASK_API_VERSION}/${encodeURIComponent(attachmentId)}`);
|
|
1260
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1261
|
-
const res = await this.#adapter.invoke(url, {
|
|
1262
|
-
method: 'DELETE',
|
|
1263
|
-
signal,
|
|
1264
|
-
telemetry: {
|
|
1265
|
-
name: 'agentuity.task.deleteAttachment',
|
|
1266
|
-
attributes: { attachmentId },
|
|
1267
|
-
},
|
|
1268
|
-
});
|
|
1269
|
-
if (res.ok) {
|
|
1270
|
-
if (res.data?.success === false) {
|
|
1271
|
-
throw new TaskStorageResponseError({
|
|
1272
|
-
status: res.response.status,
|
|
1273
|
-
message: res.data.message ?? 'Operation failed',
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
throw await toServiceException('DELETE', url, res.response);
|
|
1279
|
-
}
|
|
1280
|
-
/**
|
|
1281
|
-
* List all users who have been referenced in tasks (as creators, assignees, or closers).
|
|
1282
|
-
*
|
|
1283
|
-
* @returns List of user entity references
|
|
1284
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1285
|
-
*
|
|
1286
|
-
* @example
|
|
1287
|
-
* ```typescript
|
|
1288
|
-
* const { users } = await tasks.listUsers();
|
|
1289
|
-
* for (const user of users) {
|
|
1290
|
-
* console.log(`${user.name} (${user.id})`);
|
|
1291
|
-
* }
|
|
1292
|
-
* ```
|
|
1293
|
-
*/
|
|
1294
|
-
async listUsers() {
|
|
1295
|
-
const url = buildUrl(this.#baseUrl, `/task/users/${TASK_API_VERSION}`);
|
|
1296
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1297
|
-
const res = await this.#adapter.invoke(url, {
|
|
1298
|
-
method: 'GET',
|
|
1299
|
-
signal,
|
|
1300
|
-
telemetry: {
|
|
1301
|
-
name: 'agentuity.task.listUsers',
|
|
1302
|
-
attributes: {},
|
|
1303
|
-
},
|
|
1304
|
-
});
|
|
1305
|
-
if (res.ok) {
|
|
1306
|
-
if (res.data.success) {
|
|
1307
|
-
return res.data.data;
|
|
1308
|
-
}
|
|
1309
|
-
throw new TaskStorageResponseError({
|
|
1310
|
-
status: res.response.status,
|
|
1311
|
-
message: res.data.message,
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
throw await toServiceException('GET', url, res.response);
|
|
1315
|
-
}
|
|
1316
|
-
/**
|
|
1317
|
-
* List all projects that have been referenced in tasks.
|
|
1318
|
-
*
|
|
1319
|
-
* @returns List of project entity references
|
|
1320
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1321
|
-
*
|
|
1322
|
-
* @example
|
|
1323
|
-
* ```typescript
|
|
1324
|
-
* const { projects } = await tasks.listProjects();
|
|
1325
|
-
* for (const project of projects) {
|
|
1326
|
-
* console.log(`${project.name} (${project.id})`);
|
|
1327
|
-
* }
|
|
1328
|
-
* ```
|
|
1329
|
-
*/
|
|
1330
|
-
async listProjects() {
|
|
1331
|
-
const url = buildUrl(this.#baseUrl, `/task/projects/${TASK_API_VERSION}`);
|
|
1332
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1333
|
-
const res = await this.#adapter.invoke(url, {
|
|
1334
|
-
method: 'GET',
|
|
1335
|
-
signal,
|
|
1336
|
-
telemetry: {
|
|
1337
|
-
name: 'agentuity.task.listProjects',
|
|
1338
|
-
attributes: {},
|
|
1339
|
-
},
|
|
1340
|
-
});
|
|
1341
|
-
if (res.ok) {
|
|
1342
|
-
if (res.data.success) {
|
|
1343
|
-
return res.data.data;
|
|
1344
|
-
}
|
|
1345
|
-
throw new TaskStorageResponseError({
|
|
1346
|
-
status: res.response.status,
|
|
1347
|
-
message: res.data.message,
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
throw await toServiceException('GET', url, res.response);
|
|
1351
|
-
}
|
|
1352
|
-
/**
|
|
1353
|
-
* Get task activity time-series data showing daily task counts by status.
|
|
1354
|
-
*
|
|
1355
|
-
* @param params - Optional parameters controlling the number of days to retrieve
|
|
1356
|
-
* @returns Time-series activity data with daily snapshots
|
|
1357
|
-
* @throws {@link ServiceException} if the API request fails
|
|
1358
|
-
*
|
|
1359
|
-
* @example
|
|
1360
|
-
* ```typescript
|
|
1361
|
-
* const { activity, days } = await tasks.getActivity({ days: 30 });
|
|
1362
|
-
* console.log(`Activity over ${days} days:`);
|
|
1363
|
-
* for (const point of activity) {
|
|
1364
|
-
* console.log(`${point.date}: ${point.open} open, ${point.inProgress} in progress`);
|
|
1365
|
-
* }
|
|
1366
|
-
* ```
|
|
1367
|
-
*/
|
|
1368
|
-
async getActivity(params) {
|
|
1369
|
-
const queryParams = new URLSearchParams();
|
|
1370
|
-
if (params?.days !== undefined)
|
|
1371
|
-
queryParams.set('days', String(params.days));
|
|
1372
|
-
const queryString = queryParams.toString();
|
|
1373
|
-
const url = buildUrl(this.#baseUrl, `/task/activity/${TASK_ACTIVITY_API_VERSION}${queryString ? `?${queryString}` : ''}`);
|
|
1374
|
-
const signal = AbortSignal.timeout(30_000);
|
|
1375
|
-
const res = await this.#adapter.invoke(url, {
|
|
1376
|
-
method: 'GET',
|
|
1377
|
-
signal,
|
|
1378
|
-
telemetry: {
|
|
1379
|
-
name: 'agentuity.task.activity',
|
|
1380
|
-
attributes: {
|
|
1381
|
-
...(params?.days !== undefined ? { days: String(params.days) } : {}),
|
|
1382
|
-
},
|
|
1383
|
-
},
|
|
1384
|
-
});
|
|
1385
|
-
if (res.ok) {
|
|
1386
|
-
if (res.data.success) {
|
|
1387
|
-
return res.data.data;
|
|
1388
|
-
}
|
|
1389
|
-
throw new TaskStorageResponseError({
|
|
1390
|
-
status: res.response.status,
|
|
1391
|
-
message: res.data.message,
|
|
1392
|
-
});
|
|
1393
|
-
}
|
|
1394
|
-
throw await toServiceException('GET', url, res.response);
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
//# sourceMappingURL=task.js.map
|