@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
|
@@ -0,0 +1,1107 @@
|
|
|
1
|
+
import { buildUrl, toServiceException } from "../_util.js";
|
|
2
|
+
import { safeStringify } from "../../json.js";
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/**
|
|
5
|
+
* An email address registered with the Agentuity email service.
|
|
6
|
+
*
|
|
7
|
+
* Email addresses are created under the `@agentuity.email` domain and can receive
|
|
8
|
+
* inbound emails (forwarded to configured destinations) and send outbound emails.
|
|
9
|
+
*/
|
|
10
|
+
export const EmailAddressSchema = z.object({
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier for the email address.
|
|
13
|
+
*
|
|
14
|
+
* @remarks Prefixed with `eaddr_`.
|
|
15
|
+
*/
|
|
16
|
+
id: z.string().describe('Unique identifier for the email address.'),
|
|
17
|
+
/**
|
|
18
|
+
* The full email address (e.g., `support@agentuity.email`).
|
|
19
|
+
*/
|
|
20
|
+
email: z.string().describe('The full email address (e.g., `support@agentuity.email`).'),
|
|
21
|
+
/**
|
|
22
|
+
* Provider-specific configuration (e.g., inbound routing config).
|
|
23
|
+
*
|
|
24
|
+
* @remarks Opaque to callers — the structure is managed by the platform.
|
|
25
|
+
*/
|
|
26
|
+
config: z
|
|
27
|
+
.record(z.string(), z.unknown())
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Provider-specific configuration (e.g., inbound routing config).'),
|
|
30
|
+
/**
|
|
31
|
+
* ID of the user who registered this address.
|
|
32
|
+
*/
|
|
33
|
+
created_by: z.string().optional().describe('ID of the user who registered this address.'),
|
|
34
|
+
/**
|
|
35
|
+
* ISO 8601 timestamp when the address was created.
|
|
36
|
+
*/
|
|
37
|
+
created_at: z.string().describe('ISO 8601 timestamp when the address was created.'),
|
|
38
|
+
/**
|
|
39
|
+
* ISO 8601 timestamp when the address was last updated.
|
|
40
|
+
*/
|
|
41
|
+
updated_at: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('ISO 8601 timestamp when the address was last updated.'),
|
|
45
|
+
/**
|
|
46
|
+
* Total number of inbound emails received at this address.
|
|
47
|
+
*/
|
|
48
|
+
inbound_count: z
|
|
49
|
+
.number()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Total number of inbound emails received at this address.'),
|
|
52
|
+
/**
|
|
53
|
+
* Total number of outbound emails sent from this address.
|
|
54
|
+
*/
|
|
55
|
+
outbound_count: z
|
|
56
|
+
.number()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('Total number of outbound emails sent from this address.'),
|
|
59
|
+
/**
|
|
60
|
+
* ISO 8601 timestamp of the most recent inbound or outbound email activity.
|
|
61
|
+
*/
|
|
62
|
+
last_activity: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('ISO 8601 timestamp of the most recent inbound or outbound email activity.'),
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* A destination configuration for an email address.
|
|
69
|
+
*
|
|
70
|
+
* When an inbound email is received at the parent address, the platform forwards
|
|
71
|
+
* it to each configured destination via an HTTP request.
|
|
72
|
+
*/
|
|
73
|
+
export const EmailDestinationSchema = z.object({
|
|
74
|
+
/**
|
|
75
|
+
* Unique identifier for the destination.
|
|
76
|
+
*
|
|
77
|
+
* @remarks Prefixed with `edst_`.
|
|
78
|
+
*/
|
|
79
|
+
id: z.string().describe('Unique identifier for the destination.'),
|
|
80
|
+
/**
|
|
81
|
+
* The destination type. Currently only `'url'` is supported.
|
|
82
|
+
*/
|
|
83
|
+
type: z.string().describe("The destination type. Currently only `'url'` is supported."),
|
|
84
|
+
/**
|
|
85
|
+
* Destination-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* For `'url'` type the shape is:
|
|
89
|
+
* ```typescript
|
|
90
|
+
* {
|
|
91
|
+
* url: string; // Must use http or https; must not point to private/loopback addresses
|
|
92
|
+
* headers?: Record<string, string>;
|
|
93
|
+
* method?: 'POST' | 'PUT' | 'PATCH';
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
config: z
|
|
98
|
+
.record(z.string(), z.unknown())
|
|
99
|
+
.optional()
|
|
100
|
+
.describe('Destination-specific configuration.'),
|
|
101
|
+
/**
|
|
102
|
+
* ISO 8601 timestamp when the destination was created.
|
|
103
|
+
*/
|
|
104
|
+
created_at: z.string().describe('ISO 8601 timestamp when the destination was created.'),
|
|
105
|
+
/**
|
|
106
|
+
* ISO 8601 timestamp when the destination was last updated.
|
|
107
|
+
*/
|
|
108
|
+
updated_at: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('ISO 8601 timestamp when the destination was last updated.'),
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Connection settings for an email protocol (IMAP or POP3).
|
|
115
|
+
*
|
|
116
|
+
* Used to configure a mail client for accessing an Agentuity email address
|
|
117
|
+
* via standard mail protocols.
|
|
118
|
+
*/
|
|
119
|
+
export const EmailProtocolConfigSchema = z.object({
|
|
120
|
+
/**
|
|
121
|
+
* The mail server hostname.
|
|
122
|
+
*/
|
|
123
|
+
host: z.string().describe('The mail server hostname.'),
|
|
124
|
+
/**
|
|
125
|
+
* The mail server port number.
|
|
126
|
+
*/
|
|
127
|
+
port: z.number().describe('The mail server port number.'),
|
|
128
|
+
/**
|
|
129
|
+
* TLS mode (e.g., `'starttls'`, `'ssl'`, `'none'`).
|
|
130
|
+
*/
|
|
131
|
+
tls: z.string().describe("TLS mode (e.g., `'starttls'`, `'ssl'`, `'none'`)."),
|
|
132
|
+
/**
|
|
133
|
+
* The authentication username (typically the address ID).
|
|
134
|
+
*/
|
|
135
|
+
username: z.string().describe('The authentication username (typically the address ID).'),
|
|
136
|
+
/**
|
|
137
|
+
* The authentication password.
|
|
138
|
+
*/
|
|
139
|
+
password: z.string().describe('The authentication password.'),
|
|
140
|
+
});
|
|
141
|
+
/**
|
|
142
|
+
* Full connection configuration for accessing an email address via IMAP and POP3 protocols.
|
|
143
|
+
*
|
|
144
|
+
* Returned by {@link EmailService.getConnectionConfig} to allow external mail clients
|
|
145
|
+
* to connect to an Agentuity email address.
|
|
146
|
+
*/
|
|
147
|
+
export const EmailConnectionConfigSchema = z.object({
|
|
148
|
+
/**
|
|
149
|
+
* The full email address these settings are for.
|
|
150
|
+
*/
|
|
151
|
+
email: z.string().describe('The full email address these settings are for.'),
|
|
152
|
+
/**
|
|
153
|
+
* IMAP protocol connection settings.
|
|
154
|
+
*/
|
|
155
|
+
imap: EmailProtocolConfigSchema.describe('IMAP protocol connection settings.'),
|
|
156
|
+
/**
|
|
157
|
+
* POP3 protocol connection settings.
|
|
158
|
+
*/
|
|
159
|
+
pop3: EmailProtocolConfigSchema.describe('POP3 protocol connection settings.'),
|
|
160
|
+
});
|
|
161
|
+
/**
|
|
162
|
+
* An inbound email message received at an Agentuity email address.
|
|
163
|
+
*/
|
|
164
|
+
export const EmailInboundSchema = z.object({
|
|
165
|
+
/**
|
|
166
|
+
* Unique identifier for the inbound email.
|
|
167
|
+
*
|
|
168
|
+
* @remarks Prefixed with `einb_`.
|
|
169
|
+
*/
|
|
170
|
+
id: z.string().describe('Unique identifier for the inbound email.'),
|
|
171
|
+
/**
|
|
172
|
+
* The sender's email address.
|
|
173
|
+
*/
|
|
174
|
+
from: z.string().describe("The sender's email address."),
|
|
175
|
+
/**
|
|
176
|
+
* The recipient email address (comma-separated if multiple).
|
|
177
|
+
*/
|
|
178
|
+
to: z.string().describe('The recipient email address (comma-separated if multiple).'),
|
|
179
|
+
/**
|
|
180
|
+
* The email subject line.
|
|
181
|
+
*/
|
|
182
|
+
subject: z.string().optional().describe('The email subject line.'),
|
|
183
|
+
/**
|
|
184
|
+
* Plain text body of the email.
|
|
185
|
+
*/
|
|
186
|
+
text: z.string().optional().describe('Plain text body of the email.'),
|
|
187
|
+
/**
|
|
188
|
+
* HTML body of the email.
|
|
189
|
+
*/
|
|
190
|
+
html: z.string().optional().describe('HTML body of the email.'),
|
|
191
|
+
/**
|
|
192
|
+
* ISO 8601 timestamp when the email was received.
|
|
193
|
+
*/
|
|
194
|
+
received_at: z.string().optional().describe('ISO 8601 timestamp when the email was received.'),
|
|
195
|
+
/**
|
|
196
|
+
* Raw email headers as key-value pairs.
|
|
197
|
+
*/
|
|
198
|
+
headers: z
|
|
199
|
+
.record(z.string(), z.unknown())
|
|
200
|
+
.optional()
|
|
201
|
+
.describe('Raw email headers as key-value pairs.'),
|
|
202
|
+
/**
|
|
203
|
+
* Array of stored attachment metadata with S3 locations.
|
|
204
|
+
*/
|
|
205
|
+
attachments: z
|
|
206
|
+
.array(z.lazy(() => EmailStoredAttachmentSchema))
|
|
207
|
+
.optional()
|
|
208
|
+
.describe('Array of stored attachment metadata with S3 locations.'),
|
|
209
|
+
});
|
|
210
|
+
/**
|
|
211
|
+
* An outbound email message sent from an Agentuity email address.
|
|
212
|
+
*/
|
|
213
|
+
export const EmailOutboundSchema = z.object({
|
|
214
|
+
/**
|
|
215
|
+
* Unique identifier for the outbound email.
|
|
216
|
+
*
|
|
217
|
+
* @remarks Prefixed with `eout_`.
|
|
218
|
+
*/
|
|
219
|
+
id: z.string().describe('Unique identifier for the outbound email.'),
|
|
220
|
+
/**
|
|
221
|
+
* The sender's email address (must be owned by the organization).
|
|
222
|
+
*/
|
|
223
|
+
from: z.string().describe("The sender's email address (must be owned by the organization)."),
|
|
224
|
+
/**
|
|
225
|
+
* The recipient email addresses (comma-separated).
|
|
226
|
+
*/
|
|
227
|
+
to: z.string().describe('The recipient email addresses (comma-separated).'),
|
|
228
|
+
/**
|
|
229
|
+
* The email subject line.
|
|
230
|
+
*/
|
|
231
|
+
subject: z.string().optional().describe('The email subject line.'),
|
|
232
|
+
/**
|
|
233
|
+
* Plain text body of the email.
|
|
234
|
+
*/
|
|
235
|
+
text: z.string().optional().describe('Plain text body of the email.'),
|
|
236
|
+
/**
|
|
237
|
+
* HTML body of the email.
|
|
238
|
+
*/
|
|
239
|
+
html: z.string().optional().describe('HTML body of the email.'),
|
|
240
|
+
/**
|
|
241
|
+
* Delivery status: `'pending'`, `'success'`, or `'failed'`.
|
|
242
|
+
*
|
|
243
|
+
* @remarks Emails are sent asynchronously, so the initial status is always `'pending'`.
|
|
244
|
+
*/
|
|
245
|
+
status: z
|
|
246
|
+
.string()
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("Delivery status: `'pending'`, `'success'`, or `'failed'`."),
|
|
249
|
+
/**
|
|
250
|
+
* Error message if the delivery failed.
|
|
251
|
+
*/
|
|
252
|
+
error: z.string().optional().describe('Error message if the delivery failed.'),
|
|
253
|
+
/**
|
|
254
|
+
* ISO 8601 timestamp when the send was initiated.
|
|
255
|
+
*/
|
|
256
|
+
created_at: z.string().optional().describe('ISO 8601 timestamp when the send was initiated.'),
|
|
257
|
+
/**
|
|
258
|
+
* Custom email headers that were included.
|
|
259
|
+
*/
|
|
260
|
+
headers: z
|
|
261
|
+
.record(z.string(), z.unknown())
|
|
262
|
+
.optional()
|
|
263
|
+
.describe('Custom email headers that were included.'),
|
|
264
|
+
/**
|
|
265
|
+
* Array of stored attachment metadata with S3 locations.
|
|
266
|
+
*/
|
|
267
|
+
attachments: z
|
|
268
|
+
.array(z.lazy(() => EmailStoredAttachmentSchema))
|
|
269
|
+
.optional()
|
|
270
|
+
.describe('Array of stored attachment metadata with S3 locations.'),
|
|
271
|
+
});
|
|
272
|
+
/**
|
|
273
|
+
* An email attachment to include when sending an outbound email.
|
|
274
|
+
*/
|
|
275
|
+
export const EmailAttachmentSchema = z.object({
|
|
276
|
+
/**
|
|
277
|
+
* The filename for the attachment
|
|
278
|
+
*/
|
|
279
|
+
filename: z.string().describe('The filename for the attachment'),
|
|
280
|
+
/**
|
|
281
|
+
* The base64-encoded content of the attachment
|
|
282
|
+
*/
|
|
283
|
+
content: z.string().describe('The base64-encoded content of the attachment'),
|
|
284
|
+
/**
|
|
285
|
+
* The MIME content type of the attachment
|
|
286
|
+
*/
|
|
287
|
+
contentType: z.string().optional().describe('The MIME content type of the attachment'),
|
|
288
|
+
});
|
|
289
|
+
/**
|
|
290
|
+
* A stored email attachment with S3 location metadata.
|
|
291
|
+
* Returned by inbound/outbound email queries — different from EmailAttachment used for sending.
|
|
292
|
+
*/
|
|
293
|
+
export const EmailStoredAttachmentSchema = z.object({
|
|
294
|
+
/** The original filename */
|
|
295
|
+
filename: z.string().describe('The original filename'),
|
|
296
|
+
/** The MIME content type */
|
|
297
|
+
content_type: z.string().optional().describe('The MIME content type'),
|
|
298
|
+
/** File size in bytes */
|
|
299
|
+
size: z.number().describe('File size in bytes'),
|
|
300
|
+
/** The S3 bucket name where the attachment is stored */
|
|
301
|
+
bucket: z.string().describe('The S3 bucket name where the attachment is stored'),
|
|
302
|
+
/** The S3 object key */
|
|
303
|
+
key: z.string().describe('The S3 object key'),
|
|
304
|
+
/** Optional pre-signed download URL */
|
|
305
|
+
url: z.string().optional().describe('Optional pre-signed download URL'),
|
|
306
|
+
});
|
|
307
|
+
/**
|
|
308
|
+
* Parameters for sending an email
|
|
309
|
+
*/
|
|
310
|
+
export const EmailSendParamsSchema = z.object({
|
|
311
|
+
/**
|
|
312
|
+
* The sender email address (must be owned by the organization)
|
|
313
|
+
*/
|
|
314
|
+
from: z.string().describe('The sender email address (must be owned by the organization)'),
|
|
315
|
+
/**
|
|
316
|
+
* The recipient email addresses
|
|
317
|
+
*/
|
|
318
|
+
to: z.array(z.string()).describe('The recipient email addresses'),
|
|
319
|
+
/**
|
|
320
|
+
* The email subject
|
|
321
|
+
*/
|
|
322
|
+
subject: z.string().describe('The email subject'),
|
|
323
|
+
/**
|
|
324
|
+
* Plain text email body
|
|
325
|
+
*/
|
|
326
|
+
text: z.string().optional().describe('Plain text email body'),
|
|
327
|
+
/**
|
|
328
|
+
* HTML email body
|
|
329
|
+
*/
|
|
330
|
+
html: z.string().optional().describe('HTML email body'),
|
|
331
|
+
/**
|
|
332
|
+
* File attachments
|
|
333
|
+
*/
|
|
334
|
+
attachments: z.array(EmailAttachmentSchema).optional().describe('File attachments'),
|
|
335
|
+
/**
|
|
336
|
+
* Custom email headers (e.g., In-Reply-To, References for threading)
|
|
337
|
+
*/
|
|
338
|
+
headers: z
|
|
339
|
+
.record(z.string(), z.string())
|
|
340
|
+
.optional()
|
|
341
|
+
.describe('Custom email headers (e.g., In-Reply-To, References for threading)'),
|
|
342
|
+
});
|
|
343
|
+
/**
|
|
344
|
+
* Parameters for querying email activity time-series data.
|
|
345
|
+
*/
|
|
346
|
+
export const EmailActivityParamsSchema = z.object({
|
|
347
|
+
/**
|
|
348
|
+
* Number of days of activity to retrieve.
|
|
349
|
+
*
|
|
350
|
+
* @remarks Values below 7 are clamped to 7; values above 365 are clamped to 365.
|
|
351
|
+
*
|
|
352
|
+
* @default 7
|
|
353
|
+
*/
|
|
354
|
+
days: z.number().min(7).max(365).default(7).describe('Number of days of activity to retrieve.'), // min 7, max 365, default 7
|
|
355
|
+
});
|
|
356
|
+
/**
|
|
357
|
+
* A single data point in the email activity time-series.
|
|
358
|
+
*/
|
|
359
|
+
export const EmailActivityDataPointSchema = z.object({
|
|
360
|
+
/**
|
|
361
|
+
* The date in `YYYY-MM-DD` format.
|
|
362
|
+
*/
|
|
363
|
+
date: z.string().describe('The date in `YYYY-MM-DD` format.'), // "2026-02-28"
|
|
364
|
+
/**
|
|
365
|
+
* Number of inbound emails received on this date.
|
|
366
|
+
*/
|
|
367
|
+
inbound: z.number().describe('Number of inbound emails received on this date.'),
|
|
368
|
+
/**
|
|
369
|
+
* Number of outbound emails sent on this date.
|
|
370
|
+
*/
|
|
371
|
+
outbound: z.number().describe('Number of outbound emails sent on this date.'),
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* Result of an email activity query containing daily time-series data.
|
|
375
|
+
*/
|
|
376
|
+
export const EmailActivityResultSchema = z.object({
|
|
377
|
+
/**
|
|
378
|
+
* Array of daily activity data points, ordered chronologically.
|
|
379
|
+
*/
|
|
380
|
+
activity: z
|
|
381
|
+
.array(EmailActivityDataPointSchema)
|
|
382
|
+
.describe('Array of daily activity data points, ordered chronologically.'),
|
|
383
|
+
/**
|
|
384
|
+
* The number of days of data returned.
|
|
385
|
+
*/
|
|
386
|
+
days: z.number().describe('The number of days of data returned.'),
|
|
387
|
+
});
|
|
388
|
+
/**
|
|
389
|
+
* Unwrap a Catalyst API response payload.
|
|
390
|
+
*
|
|
391
|
+
* The Catalyst API may return data in one of two envelope formats:
|
|
392
|
+
* - `{ key: data }` — the key maps directly to the data
|
|
393
|
+
* - `{ data: { key: data } }` — the data is nested inside a `data` wrapper
|
|
394
|
+
*
|
|
395
|
+
* This helper normalises both shapes so callers always receive the inner value.
|
|
396
|
+
*
|
|
397
|
+
* @param payload - The raw JSON-parsed response body from the API
|
|
398
|
+
* @param key - The property name to extract from the payload (e.g., `'address'`, `'destinations'`)
|
|
399
|
+
* @returns The extracted value cast to type `T`
|
|
400
|
+
*
|
|
401
|
+
* @remarks
|
|
402
|
+
* If neither envelope format matches, the raw payload is returned as-is.
|
|
403
|
+
* This function does not throw — it always returns a value.
|
|
404
|
+
*/
|
|
405
|
+
function unwrap(payload, key) {
|
|
406
|
+
if (typeof payload === 'object' && payload !== null) {
|
|
407
|
+
const obj = payload;
|
|
408
|
+
if (key in obj) {
|
|
409
|
+
return obj[key];
|
|
410
|
+
}
|
|
411
|
+
if ('data' in obj && typeof obj.data === 'object' && obj.data !== null) {
|
|
412
|
+
const data = obj.data;
|
|
413
|
+
if (key in data) {
|
|
414
|
+
return data[key];
|
|
415
|
+
}
|
|
416
|
+
return data;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return payload;
|
|
420
|
+
}
|
|
421
|
+
const EMAIL_ACTIVITY_API_VERSION = '2026-02-28';
|
|
422
|
+
/**
|
|
423
|
+
* Client for the Agentuity Email service.
|
|
424
|
+
*
|
|
425
|
+
* Provides methods for managing email addresses, configuring inbound email
|
|
426
|
+
* destinations, sending outbound emails, and querying email history.
|
|
427
|
+
*
|
|
428
|
+
* Email addresses are created under the `@agentuity.email` domain. Inbound emails
|
|
429
|
+
* can be forwarded to URL destinations. Outbound emails are sent asynchronously
|
|
430
|
+
* and support attachments up to 25 MB total.
|
|
431
|
+
*
|
|
432
|
+
* All methods are instrumented with OpenTelemetry spans for observability.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* const email = new EmailStorageService(baseUrl, adapter);
|
|
437
|
+
*
|
|
438
|
+
* // Create an address
|
|
439
|
+
* const addr = await email.createAddress('notifications');
|
|
440
|
+
*
|
|
441
|
+
* // Send an email
|
|
442
|
+
* await email.send({
|
|
443
|
+
* from: addr.email,
|
|
444
|
+
* to: ['user@example.com'],
|
|
445
|
+
* subject: 'Hello',
|
|
446
|
+
* text: 'Hello from Agentuity!',
|
|
447
|
+
* });
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
export class EmailStorageService {
|
|
451
|
+
#adapter;
|
|
452
|
+
#baseUrl;
|
|
453
|
+
/**
|
|
454
|
+
* Create a new EmailStorageService instance.
|
|
455
|
+
*
|
|
456
|
+
* @param baseUrl - The base URL for the Agentuity Email API (e.g., `https://api.agentuity.com`)
|
|
457
|
+
* @param adapter - The HTTP fetch adapter used for making API requests
|
|
458
|
+
*/
|
|
459
|
+
constructor(baseUrl, adapter) {
|
|
460
|
+
this.#adapter = adapter;
|
|
461
|
+
this.#baseUrl = baseUrl;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Create a new email address under the `@agentuity.email` domain.
|
|
465
|
+
*
|
|
466
|
+
* @param localPart - The local part of the email address (the part before the `@`).
|
|
467
|
+
* For example, passing `'support'` creates `support@agentuity.email`.
|
|
468
|
+
* @returns The newly created email address record
|
|
469
|
+
* @throws ServiceException on API errors (e.g., duplicate address, invalid local part)
|
|
470
|
+
*
|
|
471
|
+
* @example
|
|
472
|
+
* ```typescript
|
|
473
|
+
* const addr = await email.createAddress('support');
|
|
474
|
+
* console.log('Created:', addr.email); // support@agentuity.email
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
async createAddress(localPart) {
|
|
478
|
+
const url = buildUrl(this.#baseUrl, '/email/addresses');
|
|
479
|
+
const signal = AbortSignal.timeout(30_000);
|
|
480
|
+
const res = await this.#adapter.invoke(url, {
|
|
481
|
+
method: 'POST',
|
|
482
|
+
body: safeStringify({ local_part: localPart }),
|
|
483
|
+
contentType: 'application/json',
|
|
484
|
+
signal,
|
|
485
|
+
telemetry: {
|
|
486
|
+
name: 'agentuity.email.createAddress',
|
|
487
|
+
attributes: {
|
|
488
|
+
localPart,
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
});
|
|
492
|
+
if (res.ok) {
|
|
493
|
+
return unwrap(res.data, 'address');
|
|
494
|
+
}
|
|
495
|
+
throw await toServiceException('POST', url, res.response);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* List all email addresses owned by the current organization.
|
|
499
|
+
*
|
|
500
|
+
* @returns An array of email address records. Returns an empty array if none exist.
|
|
501
|
+
* @throws ServiceException on API errors
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* ```typescript
|
|
505
|
+
* const addresses = await email.listAddresses();
|
|
506
|
+
* for (const addr of addresses) {
|
|
507
|
+
* console.log(`${addr.email} — ${addr.inbound_count ?? 0} received`);
|
|
508
|
+
* }
|
|
509
|
+
* ```
|
|
510
|
+
*/
|
|
511
|
+
async listAddresses() {
|
|
512
|
+
const url = buildUrl(this.#baseUrl, '/email/addresses');
|
|
513
|
+
const signal = AbortSignal.timeout(30_000);
|
|
514
|
+
const res = await this.#adapter.invoke(url, {
|
|
515
|
+
method: 'GET',
|
|
516
|
+
signal,
|
|
517
|
+
telemetry: {
|
|
518
|
+
name: 'agentuity.email.listAddresses',
|
|
519
|
+
attributes: {},
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
if (res.response.status === 404) {
|
|
523
|
+
return [];
|
|
524
|
+
}
|
|
525
|
+
if (res.ok) {
|
|
526
|
+
const items = unwrap(res.data, 'addresses');
|
|
527
|
+
return Array.isArray(items) ? items : [];
|
|
528
|
+
}
|
|
529
|
+
throw await toServiceException('GET', url, res.response);
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Get an email address by its ID.
|
|
533
|
+
*
|
|
534
|
+
* @param id - The email address ID (prefixed with `eaddr_`)
|
|
535
|
+
* @returns The email address record, or `null` if no address with the given ID exists
|
|
536
|
+
* @throws ServiceException on API errors (other than 404)
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```typescript
|
|
540
|
+
* const addr = await email.getAddress('eaddr_abc123');
|
|
541
|
+
* if (addr) {
|
|
542
|
+
* console.log('Found:', addr.email);
|
|
543
|
+
* }
|
|
544
|
+
* ```
|
|
545
|
+
*/
|
|
546
|
+
async getAddress(id) {
|
|
547
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}`);
|
|
548
|
+
const signal = AbortSignal.timeout(30_000);
|
|
549
|
+
const res = await this.#adapter.invoke(url, {
|
|
550
|
+
method: 'GET',
|
|
551
|
+
signal,
|
|
552
|
+
telemetry: {
|
|
553
|
+
name: 'agentuity.email.getAddress',
|
|
554
|
+
attributes: {
|
|
555
|
+
id,
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
});
|
|
559
|
+
if (res.response.status === 404) {
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
if (res.ok) {
|
|
563
|
+
return unwrap(res.data, 'address');
|
|
564
|
+
}
|
|
565
|
+
throw await toServiceException('GET', url, res.response);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Get IMAP and POP3 connection settings for an email address.
|
|
569
|
+
*
|
|
570
|
+
* These settings can be used to configure an external mail client (e.g., Thunderbird, Outlook)
|
|
571
|
+
* to access the mailbox associated with the given address.
|
|
572
|
+
*
|
|
573
|
+
* @param id - The email address ID (prefixed with `eaddr_`)
|
|
574
|
+
* @returns The connection configuration with IMAP and POP3 settings, or `null` if the address is not found
|
|
575
|
+
* @throws ServiceException on API errors (other than 404)
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```typescript
|
|
579
|
+
* const config = await email.getConnectionConfig('eaddr_abc123');
|
|
580
|
+
* if (config) {
|
|
581
|
+
* console.log('IMAP host:', config.imap.host);
|
|
582
|
+
* console.log('POP3 host:', config.pop3.host);
|
|
583
|
+
* }
|
|
584
|
+
* ```
|
|
585
|
+
*/
|
|
586
|
+
async getConnectionConfig(id) {
|
|
587
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}/connection`);
|
|
588
|
+
const signal = AbortSignal.timeout(30_000);
|
|
589
|
+
const res = await this.#adapter.invoke(url, {
|
|
590
|
+
method: 'GET',
|
|
591
|
+
signal,
|
|
592
|
+
telemetry: {
|
|
593
|
+
name: 'agentuity.email.getConnectionConfig',
|
|
594
|
+
attributes: {
|
|
595
|
+
id,
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
});
|
|
599
|
+
if (res.response.status === 404) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
if (res.ok) {
|
|
603
|
+
return unwrap(res.data, 'connection');
|
|
604
|
+
}
|
|
605
|
+
throw await toServiceException('GET', url, res.response);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Delete an email address and all associated destinations.
|
|
609
|
+
*
|
|
610
|
+
* @remarks This operation is idempotent — deleting a non-existent address does not throw.
|
|
611
|
+
*
|
|
612
|
+
* @param id - The email address ID (prefixed with `eaddr_`)
|
|
613
|
+
* @throws ServiceException on API errors (other than 404)
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* ```typescript
|
|
617
|
+
* await email.deleteAddress('eaddr_abc123');
|
|
618
|
+
* ```
|
|
619
|
+
*/
|
|
620
|
+
async deleteAddress(id) {
|
|
621
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(id)}`);
|
|
622
|
+
const signal = AbortSignal.timeout(30_000);
|
|
623
|
+
const res = await this.#adapter.invoke(url, {
|
|
624
|
+
method: 'DELETE',
|
|
625
|
+
signal,
|
|
626
|
+
telemetry: {
|
|
627
|
+
name: 'agentuity.email.deleteAddress',
|
|
628
|
+
attributes: {
|
|
629
|
+
id,
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
});
|
|
633
|
+
if (res.ok || res.response.status === 404) {
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
throw await toServiceException('DELETE', url, res.response);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Create a new destination for an email address.
|
|
640
|
+
*
|
|
641
|
+
* Destinations determine where inbound emails are forwarded when they arrive
|
|
642
|
+
* at the parent address.
|
|
643
|
+
*
|
|
644
|
+
* @param addressId - The email address ID (prefixed with `eaddr_`)
|
|
645
|
+
* @param type - The destination type (currently only `'url'` is supported)
|
|
646
|
+
* @param config - Type-specific destination configuration. For `'url'`:
|
|
647
|
+
* `{ url: string, headers?: Record<string, string>, method?: 'POST' | 'PUT' | 'PATCH' }`
|
|
648
|
+
* @returns The newly created destination record
|
|
649
|
+
* @throws ServiceException on API errors (e.g., invalid URL, address not found)
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* ```typescript
|
|
653
|
+
* const dest = await email.createDestination('eaddr_abc123', 'url', {
|
|
654
|
+
* url: 'https://example.com/webhook',
|
|
655
|
+
* headers: { 'X-Secret': 'my-token' },
|
|
656
|
+
* });
|
|
657
|
+
* console.log('Destination created:', dest.id);
|
|
658
|
+
* ```
|
|
659
|
+
*/
|
|
660
|
+
async createDestination(addressId, type, config) {
|
|
661
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(addressId)}/destinations`);
|
|
662
|
+
const signal = AbortSignal.timeout(30_000);
|
|
663
|
+
const res = await this.#adapter.invoke(url, {
|
|
664
|
+
method: 'POST',
|
|
665
|
+
body: safeStringify({ type, config }),
|
|
666
|
+
contentType: 'application/json',
|
|
667
|
+
signal,
|
|
668
|
+
telemetry: {
|
|
669
|
+
name: 'agentuity.email.createDestination',
|
|
670
|
+
attributes: {
|
|
671
|
+
addressId,
|
|
672
|
+
type,
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
});
|
|
676
|
+
if (res.ok) {
|
|
677
|
+
return unwrap(res.data, 'destination');
|
|
678
|
+
}
|
|
679
|
+
throw await toServiceException('POST', url, res.response);
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* List all destinations configured for an email address.
|
|
683
|
+
*
|
|
684
|
+
* @param addressId - The email address ID (prefixed with `eaddr_`)
|
|
685
|
+
* @returns An array of destination records. Returns an empty array if none exist.
|
|
686
|
+
* @throws ServiceException on API errors
|
|
687
|
+
*
|
|
688
|
+
* @example
|
|
689
|
+
* ```typescript
|
|
690
|
+
* const destinations = await email.listDestinations('eaddr_abc123');
|
|
691
|
+
* for (const dest of destinations) {
|
|
692
|
+
* console.log(`${dest.type}: ${dest.id}`);
|
|
693
|
+
* }
|
|
694
|
+
* ```
|
|
695
|
+
*/
|
|
696
|
+
async listDestinations(addressId) {
|
|
697
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(addressId)}/destinations`);
|
|
698
|
+
const signal = AbortSignal.timeout(30_000);
|
|
699
|
+
const res = await this.#adapter.invoke(url, {
|
|
700
|
+
method: 'GET',
|
|
701
|
+
signal,
|
|
702
|
+
telemetry: {
|
|
703
|
+
name: 'agentuity.email.listDestinations',
|
|
704
|
+
attributes: {
|
|
705
|
+
addressId,
|
|
706
|
+
},
|
|
707
|
+
},
|
|
708
|
+
});
|
|
709
|
+
if (res.response.status === 404) {
|
|
710
|
+
return [];
|
|
711
|
+
}
|
|
712
|
+
if (res.ok) {
|
|
713
|
+
const items = unwrap(res.data, 'destinations');
|
|
714
|
+
return Array.isArray(items) ? items : [];
|
|
715
|
+
}
|
|
716
|
+
throw await toServiceException('GET', url, res.response);
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Delete a destination from an email address.
|
|
720
|
+
*
|
|
721
|
+
* @remarks This operation is idempotent — deleting a non-existent destination does not throw.
|
|
722
|
+
*
|
|
723
|
+
* @param addressId - The email address ID (prefixed with `eaddr_`)
|
|
724
|
+
* @param destinationId - The destination ID (prefixed with `edst_`)
|
|
725
|
+
* @throws ServiceException on API errors (other than 404)
|
|
726
|
+
*
|
|
727
|
+
* @example
|
|
728
|
+
* ```typescript
|
|
729
|
+
* await email.deleteDestination('eaddr_abc123', 'edst_xyz789');
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
732
|
+
async deleteDestination(addressId, destinationId) {
|
|
733
|
+
const url = buildUrl(this.#baseUrl, `/email/addresses/${encodeURIComponent(addressId)}/destinations/${encodeURIComponent(destinationId)}`);
|
|
734
|
+
const signal = AbortSignal.timeout(30_000);
|
|
735
|
+
const res = await this.#adapter.invoke(url, {
|
|
736
|
+
method: 'DELETE',
|
|
737
|
+
signal,
|
|
738
|
+
telemetry: {
|
|
739
|
+
name: 'agentuity.email.deleteDestination',
|
|
740
|
+
attributes: {
|
|
741
|
+
addressId,
|
|
742
|
+
destinationId,
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
});
|
|
746
|
+
if (res.ok || res.response.status === 404) {
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
throw await toServiceException('DELETE', url, res.response);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Send an outbound email from an Agentuity email address.
|
|
753
|
+
*
|
|
754
|
+
* Emails are sent asynchronously — this method returns immediately with an outbound
|
|
755
|
+
* record whose status is `'pending'`. Use {@link getOutbound} to poll for delivery status.
|
|
756
|
+
*
|
|
757
|
+
* @remarks
|
|
758
|
+
* - The `from` address must be owned by the current organization.
|
|
759
|
+
* - Maximum 50 recipients per send.
|
|
760
|
+
* - Maximum 25 MB for the full RFC 822 body (including attachments).
|
|
761
|
+
*
|
|
762
|
+
* @param params - The email send parameters including from, to, subject, and body
|
|
763
|
+
* @returns The outbound email record with initial status `'pending'`
|
|
764
|
+
* @throws ServiceException on API errors (e.g., invalid sender, too many recipients)
|
|
765
|
+
*
|
|
766
|
+
* @example
|
|
767
|
+
* ```typescript
|
|
768
|
+
* const result = await email.send({
|
|
769
|
+
* from: 'notifications@agentuity.email',
|
|
770
|
+
* to: ['user@example.com'],
|
|
771
|
+
* subject: 'Welcome!',
|
|
772
|
+
* text: 'Welcome to our platform.',
|
|
773
|
+
* html: '<h1>Welcome!</h1>',
|
|
774
|
+
* attachments: [{
|
|
775
|
+
* filename: 'guide.pdf',
|
|
776
|
+
* content: base64EncodedPdf,
|
|
777
|
+
* contentType: 'application/pdf',
|
|
778
|
+
* }],
|
|
779
|
+
* });
|
|
780
|
+
* console.log('Email queued:', result.id);
|
|
781
|
+
* ```
|
|
782
|
+
*/
|
|
783
|
+
async send(params) {
|
|
784
|
+
const url = buildUrl(this.#baseUrl, '/email/outbound/send');
|
|
785
|
+
const signal = AbortSignal.timeout(30_000);
|
|
786
|
+
// Transform attachments to API format (snake_case)
|
|
787
|
+
const body = {
|
|
788
|
+
from: params.from,
|
|
789
|
+
to: params.to,
|
|
790
|
+
subject: params.subject,
|
|
791
|
+
};
|
|
792
|
+
if (params.text !== undefined) {
|
|
793
|
+
body.text = params.text;
|
|
794
|
+
}
|
|
795
|
+
if (params.html !== undefined) {
|
|
796
|
+
body.html = params.html;
|
|
797
|
+
}
|
|
798
|
+
if (params.attachments && params.attachments.length > 0) {
|
|
799
|
+
body.attachments = params.attachments.map((a) => ({
|
|
800
|
+
filename: a.filename,
|
|
801
|
+
content: a.content,
|
|
802
|
+
...(a.contentType && { content_type: a.contentType }),
|
|
803
|
+
}));
|
|
804
|
+
}
|
|
805
|
+
if (params.headers && Object.keys(params.headers).length > 0) {
|
|
806
|
+
body.headers = params.headers;
|
|
807
|
+
}
|
|
808
|
+
const res = await this.#adapter.invoke(url, {
|
|
809
|
+
method: 'POST',
|
|
810
|
+
body: safeStringify(body),
|
|
811
|
+
contentType: 'application/json',
|
|
812
|
+
signal,
|
|
813
|
+
telemetry: {
|
|
814
|
+
name: 'agentuity.email.send',
|
|
815
|
+
attributes: {
|
|
816
|
+
from: params.from,
|
|
817
|
+
toCount: String(params.to.length),
|
|
818
|
+
},
|
|
819
|
+
},
|
|
820
|
+
});
|
|
821
|
+
if (res.ok) {
|
|
822
|
+
return unwrap(res.data, 'outbound');
|
|
823
|
+
}
|
|
824
|
+
throw await toServiceException('POST', url, res.response);
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* List inbound emails, optionally filtered by email address.
|
|
828
|
+
*
|
|
829
|
+
* @param addressId - Optional email address ID (prefixed with `eaddr_`) to filter results.
|
|
830
|
+
* When omitted, returns inbound emails across all addresses in the organization.
|
|
831
|
+
* @returns An array of inbound email records. Returns an empty array if none exist.
|
|
832
|
+
* @throws ServiceException on API errors
|
|
833
|
+
*
|
|
834
|
+
* @example
|
|
835
|
+
* ```typescript
|
|
836
|
+
* // List all inbound emails
|
|
837
|
+
* const all = await email.listInbound();
|
|
838
|
+
*
|
|
839
|
+
* // List inbound for a specific address
|
|
840
|
+
* const filtered = await email.listInbound('eaddr_abc123');
|
|
841
|
+
* for (const msg of filtered) {
|
|
842
|
+
* console.log(`From: ${msg.from}, Subject: ${msg.subject}`);
|
|
843
|
+
* }
|
|
844
|
+
* ```
|
|
845
|
+
*/
|
|
846
|
+
async listInbound(addressId) {
|
|
847
|
+
const queryParams = new URLSearchParams();
|
|
848
|
+
if (addressId) {
|
|
849
|
+
queryParams.set('address_id', addressId);
|
|
850
|
+
}
|
|
851
|
+
const queryString = queryParams.toString();
|
|
852
|
+
const url = buildUrl(this.#baseUrl, `/email/inbound${queryString ? `?${queryString}` : ''}`);
|
|
853
|
+
const signal = AbortSignal.timeout(30_000);
|
|
854
|
+
const res = await this.#adapter.invoke(url, {
|
|
855
|
+
method: 'GET',
|
|
856
|
+
signal,
|
|
857
|
+
telemetry: {
|
|
858
|
+
name: 'agentuity.email.listInbound',
|
|
859
|
+
attributes: {
|
|
860
|
+
...(addressId && { addressId }),
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
});
|
|
864
|
+
if (res.response.status === 404) {
|
|
865
|
+
return [];
|
|
866
|
+
}
|
|
867
|
+
if (res.ok) {
|
|
868
|
+
const items = unwrap(res.data, 'inbound');
|
|
869
|
+
return Array.isArray(items) ? items : [];
|
|
870
|
+
}
|
|
871
|
+
throw await toServiceException('GET', url, res.response);
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Get an inbound email by its ID.
|
|
875
|
+
*
|
|
876
|
+
* @param id - The inbound email ID (prefixed with `einb_`)
|
|
877
|
+
* @returns The inbound email record, or `null` if not found
|
|
878
|
+
* @throws ServiceException on API errors (other than 404)
|
|
879
|
+
*
|
|
880
|
+
* @example
|
|
881
|
+
* ```typescript
|
|
882
|
+
* const msg = await email.getInbound('einb_abc123');
|
|
883
|
+
* if (msg) {
|
|
884
|
+
* console.log('Subject:', msg.subject);
|
|
885
|
+
* console.log('Attachments:', msg.attachments?.length ?? 0);
|
|
886
|
+
* }
|
|
887
|
+
* ```
|
|
888
|
+
*/
|
|
889
|
+
async getInbound(id) {
|
|
890
|
+
const url = buildUrl(this.#baseUrl, `/email/inbound/${encodeURIComponent(id)}`);
|
|
891
|
+
const signal = AbortSignal.timeout(30_000);
|
|
892
|
+
const res = await this.#adapter.invoke(url, {
|
|
893
|
+
method: 'GET',
|
|
894
|
+
signal,
|
|
895
|
+
telemetry: {
|
|
896
|
+
name: 'agentuity.email.getInbound',
|
|
897
|
+
attributes: {
|
|
898
|
+
id,
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
});
|
|
902
|
+
if (res.response.status === 404) {
|
|
903
|
+
return null;
|
|
904
|
+
}
|
|
905
|
+
if (res.ok) {
|
|
906
|
+
return unwrap(res.data, 'inbound');
|
|
907
|
+
}
|
|
908
|
+
throw await toServiceException('GET', url, res.response);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Delete an inbound email by its ID.
|
|
912
|
+
*
|
|
913
|
+
* @remarks This operation is idempotent — deleting a non-existent email does not throw.
|
|
914
|
+
*
|
|
915
|
+
* @param id - The inbound email ID (prefixed with `einb_`)
|
|
916
|
+
* @throws ServiceException on API errors (other than 404)
|
|
917
|
+
*
|
|
918
|
+
* @example
|
|
919
|
+
* ```typescript
|
|
920
|
+
* await email.deleteInbound('einb_abc123');
|
|
921
|
+
* ```
|
|
922
|
+
*/
|
|
923
|
+
async deleteInbound(id) {
|
|
924
|
+
const url = buildUrl(this.#baseUrl, `/email/inbound/${encodeURIComponent(id)}`);
|
|
925
|
+
const signal = AbortSignal.timeout(30_000);
|
|
926
|
+
const res = await this.#adapter.invoke(url, {
|
|
927
|
+
method: 'DELETE',
|
|
928
|
+
signal,
|
|
929
|
+
telemetry: {
|
|
930
|
+
name: 'agentuity.email.deleteInbound',
|
|
931
|
+
attributes: {
|
|
932
|
+
id,
|
|
933
|
+
},
|
|
934
|
+
},
|
|
935
|
+
});
|
|
936
|
+
if (res.ok || res.response.status === 404) {
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
throw await toServiceException('DELETE', url, res.response);
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* List outbound emails, optionally filtered by email address.
|
|
943
|
+
*
|
|
944
|
+
* @param addressId - Optional email address ID (prefixed with `eaddr_`) to filter results.
|
|
945
|
+
* When omitted, returns outbound emails across all addresses in the organization.
|
|
946
|
+
* @returns An array of outbound email records. Returns an empty array if none exist.
|
|
947
|
+
* @throws ServiceException on API errors
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
* ```typescript
|
|
951
|
+
* // List all outbound emails
|
|
952
|
+
* const all = await email.listOutbound();
|
|
953
|
+
*
|
|
954
|
+
* // List outbound for a specific address
|
|
955
|
+
* const filtered = await email.listOutbound('eaddr_abc123');
|
|
956
|
+
* for (const msg of filtered) {
|
|
957
|
+
* console.log(`To: ${msg.to}, Status: ${msg.status}`);
|
|
958
|
+
* }
|
|
959
|
+
* ```
|
|
960
|
+
*/
|
|
961
|
+
async listOutbound(addressId) {
|
|
962
|
+
const queryParams = new URLSearchParams();
|
|
963
|
+
if (addressId) {
|
|
964
|
+
queryParams.set('address_id', addressId);
|
|
965
|
+
}
|
|
966
|
+
const queryString = queryParams.toString();
|
|
967
|
+
const url = buildUrl(this.#baseUrl, `/email/outbound${queryString ? `?${queryString}` : ''}`);
|
|
968
|
+
const signal = AbortSignal.timeout(30_000);
|
|
969
|
+
const res = await this.#adapter.invoke(url, {
|
|
970
|
+
method: 'GET',
|
|
971
|
+
signal,
|
|
972
|
+
telemetry: {
|
|
973
|
+
name: 'agentuity.email.listOutbound',
|
|
974
|
+
attributes: {
|
|
975
|
+
...(addressId && { addressId }),
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
});
|
|
979
|
+
if (res.response.status === 404) {
|
|
980
|
+
return [];
|
|
981
|
+
}
|
|
982
|
+
if (res.ok) {
|
|
983
|
+
const items = unwrap(res.data, 'outbound');
|
|
984
|
+
return Array.isArray(items) ? items : [];
|
|
985
|
+
}
|
|
986
|
+
throw await toServiceException('GET', url, res.response);
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Get an outbound email by its ID.
|
|
990
|
+
*
|
|
991
|
+
* @param id - The outbound email ID (prefixed with `eout_`)
|
|
992
|
+
* @returns The outbound email record, or `null` if not found
|
|
993
|
+
* @throws ServiceException on API errors (other than 404)
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```typescript
|
|
997
|
+
* const msg = await email.getOutbound('eout_abc123');
|
|
998
|
+
* if (msg) {
|
|
999
|
+
* console.log('Status:', msg.status);
|
|
1000
|
+
* if (msg.error) {
|
|
1001
|
+
* console.error('Delivery failed:', msg.error);
|
|
1002
|
+
* }
|
|
1003
|
+
* }
|
|
1004
|
+
* ```
|
|
1005
|
+
*/
|
|
1006
|
+
async getOutbound(id) {
|
|
1007
|
+
const url = buildUrl(this.#baseUrl, `/email/outbound/${encodeURIComponent(id)}`);
|
|
1008
|
+
const signal = AbortSignal.timeout(30_000);
|
|
1009
|
+
const res = await this.#adapter.invoke(url, {
|
|
1010
|
+
method: 'GET',
|
|
1011
|
+
signal,
|
|
1012
|
+
telemetry: {
|
|
1013
|
+
name: 'agentuity.email.getOutbound',
|
|
1014
|
+
attributes: {
|
|
1015
|
+
id,
|
|
1016
|
+
},
|
|
1017
|
+
},
|
|
1018
|
+
});
|
|
1019
|
+
if (res.response.status === 404) {
|
|
1020
|
+
return null;
|
|
1021
|
+
}
|
|
1022
|
+
if (res.ok) {
|
|
1023
|
+
return unwrap(res.data, 'outbound');
|
|
1024
|
+
}
|
|
1025
|
+
throw await toServiceException('GET', url, res.response);
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Delete an outbound email by its ID.
|
|
1029
|
+
*
|
|
1030
|
+
* @remarks This operation is idempotent — deleting a non-existent email does not throw.
|
|
1031
|
+
*
|
|
1032
|
+
* @param id - The outbound email ID (prefixed with `eout_`)
|
|
1033
|
+
* @throws ServiceException on API errors (other than 404)
|
|
1034
|
+
*
|
|
1035
|
+
* @example
|
|
1036
|
+
* ```typescript
|
|
1037
|
+
* await email.deleteOutbound('eout_abc123');
|
|
1038
|
+
* ```
|
|
1039
|
+
*/
|
|
1040
|
+
async deleteOutbound(id) {
|
|
1041
|
+
const url = buildUrl(this.#baseUrl, `/email/outbound/${encodeURIComponent(id)}`);
|
|
1042
|
+
const signal = AbortSignal.timeout(30_000);
|
|
1043
|
+
const res = await this.#adapter.invoke(url, {
|
|
1044
|
+
method: 'DELETE',
|
|
1045
|
+
signal,
|
|
1046
|
+
telemetry: {
|
|
1047
|
+
name: 'agentuity.email.deleteOutbound',
|
|
1048
|
+
attributes: {
|
|
1049
|
+
id,
|
|
1050
|
+
},
|
|
1051
|
+
},
|
|
1052
|
+
});
|
|
1053
|
+
if (res.ok || res.response.status === 404) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
throw await toServiceException('DELETE', url, res.response);
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Get email activity time-series data showing inbound and outbound counts per day.
|
|
1060
|
+
*
|
|
1061
|
+
* @param params - Optional query parameters. `days` controls the lookback window
|
|
1062
|
+
* (minimum 7, maximum 365, server default 7).
|
|
1063
|
+
* @returns An {@link EmailActivityResult} with daily data points ordered chronologically
|
|
1064
|
+
* and the total number of days returned
|
|
1065
|
+
* @throws ServiceException on API errors
|
|
1066
|
+
*
|
|
1067
|
+
* @example
|
|
1068
|
+
* ```typescript
|
|
1069
|
+
* // Get last 30 days of activity
|
|
1070
|
+
* const result = await email.getActivity({ days: 30 });
|
|
1071
|
+
* console.log(`Activity over ${result.days} days:`);
|
|
1072
|
+
* for (const point of result.activity) {
|
|
1073
|
+
* console.log(` ${point.date}: ${point.inbound} in, ${point.outbound} out`);
|
|
1074
|
+
* }
|
|
1075
|
+
* ```
|
|
1076
|
+
*/
|
|
1077
|
+
async getActivity(params) {
|
|
1078
|
+
const queryParams = new URLSearchParams();
|
|
1079
|
+
if (params?.days !== undefined) {
|
|
1080
|
+
const raw = Number(params.days);
|
|
1081
|
+
if (Number.isFinite(raw)) {
|
|
1082
|
+
const clamped = Math.max(7, Math.min(365, Math.trunc(raw)));
|
|
1083
|
+
queryParams.set('days', String(clamped));
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
const queryString = queryParams.toString();
|
|
1087
|
+
const url = buildUrl(this.#baseUrl, `/email/activity/${EMAIL_ACTIVITY_API_VERSION}${queryString ? `?${queryString}` : ''}`);
|
|
1088
|
+
const signal = AbortSignal.timeout(30_000);
|
|
1089
|
+
const days = queryParams.get('days');
|
|
1090
|
+
const res = await this.#adapter.invoke(url, {
|
|
1091
|
+
method: 'GET',
|
|
1092
|
+
signal,
|
|
1093
|
+
telemetry: {
|
|
1094
|
+
name: 'agentuity.email.activity',
|
|
1095
|
+
attributes: {
|
|
1096
|
+
...(days ? { days } : {}),
|
|
1097
|
+
},
|
|
1098
|
+
},
|
|
1099
|
+
});
|
|
1100
|
+
if (res.ok) {
|
|
1101
|
+
// Email endpoints return data directly (no success wrapper)
|
|
1102
|
+
return res.data;
|
|
1103
|
+
}
|
|
1104
|
+
throw await toServiceException('GET', url, res.response);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
//# sourceMappingURL=service.js.map
|