@agentuity/server 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js.map +1 -1
- package/dist/api/apikey/create.d.ts +1 -1
- package/dist/api/apikey/create.d.ts.map +1 -1
- package/dist/api/apikey/create.js +2 -2
- package/dist/api/apikey/create.js.map +1 -1
- package/dist/api/apikey/delete.d.ts +1 -1
- package/dist/api/apikey/delete.d.ts.map +1 -1
- package/dist/api/apikey/delete.js +2 -2
- package/dist/api/apikey/delete.js.map +1 -1
- package/dist/api/apikey/get.d.ts +1 -1
- package/dist/api/apikey/get.d.ts.map +1 -1
- package/dist/api/apikey/get.js +2 -2
- package/dist/api/apikey/get.js.map +1 -1
- package/dist/api/apikey/index.d.ts +5 -5
- package/dist/api/apikey/index.d.ts.map +1 -1
- package/dist/api/apikey/index.js +5 -5
- package/dist/api/apikey/index.js.map +1 -1
- package/dist/api/apikey/list.d.ts +1 -1
- package/dist/api/apikey/list.d.ts.map +1 -1
- package/dist/api/apikey/list.js +2 -2
- package/dist/api/apikey/list.js.map +1 -1
- package/dist/api/db/index.d.ts +4 -4
- package/dist/api/db/index.d.ts.map +1 -1
- package/dist/api/db/index.js +4 -4
- package/dist/api/db/index.js.map +1 -1
- package/dist/api/db/logs.d.ts +1 -1
- package/dist/api/db/logs.d.ts.map +1 -1
- package/dist/api/db/logs.js +2 -2
- package/dist/api/db/logs.js.map +1 -1
- package/dist/api/db/query.d.ts +1 -1
- package/dist/api/db/query.d.ts.map +1 -1
- package/dist/api/db/query.js +2 -2
- package/dist/api/db/query.js.map +1 -1
- package/dist/api/db/tables.d.ts +1 -1
- package/dist/api/db/tables.d.ts.map +1 -1
- package/dist/api/db/tables.js +2 -2
- package/dist/api/db/tables.js.map +1 -1
- package/dist/api/eval/get.d.ts +1 -1
- package/dist/api/eval/get.d.ts.map +1 -1
- package/dist/api/eval/get.js +1 -1
- package/dist/api/eval/get.js.map +1 -1
- package/dist/api/eval/index.d.ts +4 -4
- package/dist/api/eval/index.d.ts.map +1 -1
- package/dist/api/eval/index.js +4 -4
- package/dist/api/eval/index.js.map +1 -1
- package/dist/api/eval/list.d.ts +1 -1
- package/dist/api/eval/list.d.ts.map +1 -1
- package/dist/api/eval/list.js +1 -1
- package/dist/api/eval/list.js.map +1 -1
- package/dist/api/eval/run-get.d.ts +1 -1
- package/dist/api/eval/run-get.d.ts.map +1 -1
- package/dist/api/eval/run-get.js +1 -1
- package/dist/api/eval/run-get.js.map +1 -1
- package/dist/api/eval/run-list.d.ts +1 -1
- package/dist/api/eval/run-list.d.ts.map +1 -1
- package/dist/api/eval/run-list.js +1 -1
- package/dist/api/eval/run-list.js.map +1 -1
- package/dist/api/index.d.ts +14 -14
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +14 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/machine/index.d.ts +2 -2
- package/dist/api/machine/index.d.ts.map +1 -1
- package/dist/api/machine/index.js +2 -2
- package/dist/api/machine/index.js.map +1 -1
- package/dist/api/machine/machine.d.ts +1 -1
- package/dist/api/machine/machine.d.ts.map +1 -1
- package/dist/api/machine/machine.js +2 -2
- package/dist/api/machine/machine.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +1 -1
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +2 -2
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +1 -1
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +2 -2
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +1 -1
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +2 -2
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/org/index.d.ts +6 -6
- package/dist/api/org/index.d.ts.map +1 -1
- package/dist/api/org/index.js +6 -6
- package/dist/api/org/index.js.map +1 -1
- package/dist/api/org/list.d.ts +1 -1
- package/dist/api/org/list.d.ts.map +1 -1
- package/dist/api/org/list.js +2 -2
- package/dist/api/org/list.js.map +1 -1
- package/dist/api/org/resources.d.ts +1 -1
- package/dist/api/org/resources.d.ts.map +1 -1
- package/dist/api/org/resources.js +2 -2
- package/dist/api/org/resources.js.map +1 -1
- package/dist/api/project/agent.d.ts +1 -1
- package/dist/api/project/agent.d.ts.map +1 -1
- package/dist/api/project/agent.js +2 -2
- package/dist/api/project/agent.js.map +1 -1
- package/dist/api/project/create.d.ts +1 -1
- package/dist/api/project/create.d.ts.map +1 -1
- package/dist/api/project/create.js +2 -2
- package/dist/api/project/create.js.map +1 -1
- package/dist/api/project/delete.d.ts +1 -1
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +2 -2
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +1 -1
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +2 -2
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/project/deployment.d.ts +1 -1
- package/dist/api/project/deployment.d.ts.map +1 -1
- package/dist/api/project/deployment.js +2 -2
- package/dist/api/project/deployment.js.map +1 -1
- package/dist/api/project/env-delete.d.ts +1 -1
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +2 -2
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts +2 -2
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +3 -3
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +1 -1
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +2 -2
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +1 -1
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +2 -2
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/hostname.d.ts +1 -1
- package/dist/api/project/hostname.d.ts.map +1 -1
- package/dist/api/project/hostname.js +2 -2
- package/dist/api/project/hostname.js.map +1 -1
- package/dist/api/project/index.d.ts +13 -13
- package/dist/api/project/index.d.ts.map +1 -1
- package/dist/api/project/index.js +13 -13
- package/dist/api/project/index.js.map +1 -1
- package/dist/api/project/list.d.ts +1 -1
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +2 -2
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +1 -1
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +6 -2
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/project/update-region.d.ts +1 -1
- package/dist/api/project/update-region.d.ts.map +1 -1
- package/dist/api/project/update-region.js +2 -2
- package/dist/api/project/update-region.js.map +1 -1
- package/dist/api/project/util.d.ts +13 -0
- package/dist/api/project/util.d.ts.map +1 -1
- package/dist/api/project/util.js +1 -0
- package/dist/api/project/util.js.map +1 -1
- package/dist/api/queue/analytics.d.ts +2 -2
- package/dist/api/queue/analytics.d.ts.map +1 -1
- package/dist/api/queue/analytics.js +6 -18
- package/dist/api/queue/analytics.js.map +1 -1
- package/dist/api/queue/destinations.d.ts +2 -2
- package/dist/api/queue/destinations.d.ts.map +1 -1
- package/dist/api/queue/destinations.js +14 -84
- package/dist/api/queue/destinations.js.map +1 -1
- package/dist/api/queue/dlq.d.ts +2 -2
- package/dist/api/queue/dlq.d.ts.map +1 -1
- package/dist/api/queue/dlq.js +8 -46
- package/dist/api/queue/dlq.js.map +1 -1
- package/dist/api/queue/index.d.ts +10 -10
- package/dist/api/queue/index.d.ts.map +1 -1
- package/dist/api/queue/index.js +10 -10
- package/dist/api/queue/index.js.map +1 -1
- package/dist/api/queue/messages.d.ts +2 -2
- package/dist/api/queue/messages.d.ts.map +1 -1
- package/dist/api/queue/messages.js +17 -107
- package/dist/api/queue/messages.js.map +1 -1
- package/dist/api/queue/queues.d.ts +2 -2
- package/dist/api/queue/queues.d.ts.map +1 -1
- package/dist/api/queue/queues.js +9 -39
- package/dist/api/queue/queues.js.map +1 -1
- package/dist/api/queue/sources.d.ts +2 -2
- package/dist/api/queue/sources.d.ts.map +1 -1
- package/dist/api/queue/sources.js +15 -98
- package/dist/api/queue/sources.js.map +1 -1
- package/dist/api/queue/util.d.ts +16 -0
- package/dist/api/queue/util.d.ts.map +1 -1
- package/dist/api/queue/util.js +64 -0
- package/dist/api/queue/util.js.map +1 -1
- package/dist/api/queue/websocket.d.ts +1 -1
- package/dist/api/queue/websocket.d.ts.map +1 -1
- package/dist/api/queue/websocket.js +3 -3
- package/dist/api/queue/websocket.js.map +1 -1
- package/dist/api/region/create.d.ts +1 -1
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +8 -2
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/region/delete.d.ts +1 -1
- package/dist/api/region/delete.d.ts.map +1 -1
- package/dist/api/region/delete.js +2 -2
- package/dist/api/region/delete.js.map +1 -1
- package/dist/api/region/index.d.ts +4 -4
- package/dist/api/region/index.d.ts.map +1 -1
- package/dist/api/region/index.js +4 -4
- package/dist/api/region/index.js.map +1 -1
- package/dist/api/region/list.d.ts +1 -1
- package/dist/api/region/list.d.ts.map +1 -1
- package/dist/api/region/list.js +2 -2
- package/dist/api/region/list.js.map +1 -1
- package/dist/api/region/resources.d.ts +1 -1
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +2 -2
- package/dist/api/region/resources.js.map +1 -1
- package/dist/api/sandbox/cli-list.d.ts +1 -1
- package/dist/api/sandbox/cli-list.d.ts.map +1 -1
- package/dist/api/sandbox/cli-list.js +2 -2
- package/dist/api/sandbox/cli-list.js.map +1 -1
- package/dist/api/sandbox/client.d.ts +5 -1
- package/dist/api/sandbox/client.d.ts.map +1 -1
- package/dist/api/sandbox/client.js +12 -11
- package/dist/api/sandbox/client.js.map +1 -1
- package/dist/api/sandbox/create.d.ts +7 -1
- package/dist/api/sandbox/create.d.ts.map +1 -1
- package/dist/api/sandbox/create.js +15 -4
- package/dist/api/sandbox/create.js.map +1 -1
- package/dist/api/sandbox/destroy.d.ts +1 -1
- package/dist/api/sandbox/destroy.d.ts.map +1 -1
- package/dist/api/sandbox/destroy.js +2 -2
- package/dist/api/sandbox/destroy.js.map +1 -1
- package/dist/api/sandbox/execute.d.ts +1 -1
- package/dist/api/sandbox/execute.d.ts.map +1 -1
- package/dist/api/sandbox/execute.js +2 -2
- package/dist/api/sandbox/execute.js.map +1 -1
- package/dist/api/sandbox/execution.d.ts +1 -1
- package/dist/api/sandbox/execution.d.ts.map +1 -1
- package/dist/api/sandbox/execution.js +2 -2
- package/dist/api/sandbox/execution.js.map +1 -1
- package/dist/api/sandbox/files.d.ts +1 -1
- package/dist/api/sandbox/files.d.ts.map +1 -1
- package/dist/api/sandbox/files.js +1 -1
- package/dist/api/sandbox/files.js.map +1 -1
- package/dist/api/sandbox/get.d.ts +5 -1
- package/dist/api/sandbox/get.d.ts.map +1 -1
- package/dist/api/sandbox/get.js +17 -3
- package/dist/api/sandbox/get.js.map +1 -1
- package/dist/api/sandbox/index.d.ts +34 -30
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +17 -15
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/list.d.ts +7 -1
- package/dist/api/sandbox/list.d.ts.map +1 -1
- package/dist/api/sandbox/list.js +17 -3
- package/dist/api/sandbox/list.js.map +1 -1
- package/dist/api/sandbox/pause.d.ts +22 -0
- package/dist/api/sandbox/pause.d.ts.map +1 -0
- package/dist/api/sandbox/pause.js +25 -0
- package/dist/api/sandbox/pause.js.map +1 -0
- package/dist/api/sandbox/resolve.d.ts +1 -1
- package/dist/api/sandbox/resolve.d.ts.map +1 -1
- package/dist/api/sandbox/resolve.js +1 -1
- package/dist/api/sandbox/resolve.js.map +1 -1
- package/dist/api/sandbox/resume.d.ts +22 -0
- package/dist/api/sandbox/resume.d.ts.map +1 -0
- package/dist/api/sandbox/resume.js +25 -0
- package/dist/api/sandbox/resume.js.map +1 -0
- package/dist/api/sandbox/run.d.ts +1 -1
- package/dist/api/sandbox/run.d.ts.map +1 -1
- package/dist/api/sandbox/run.js +6 -6
- package/dist/api/sandbox/run.js.map +1 -1
- package/dist/api/sandbox/runtime.d.ts +1 -1
- package/dist/api/sandbox/runtime.d.ts.map +1 -1
- package/dist/api/sandbox/runtime.js +2 -2
- package/dist/api/sandbox/runtime.js.map +1 -1
- package/dist/api/sandbox/snapshot.d.ts +1 -1
- package/dist/api/sandbox/snapshot.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot.js +3 -3
- package/dist/api/sandbox/snapshot.js.map +1 -1
- package/dist/api/sandbox/util.d.ts +6 -0
- package/dist/api/sandbox/util.d.ts.map +1 -1
- package/dist/api/sandbox/util.js +6 -0
- package/dist/api/sandbox/util.js.map +1 -1
- package/dist/api/session/get.d.ts +2 -2
- package/dist/api/session/get.d.ts.map +1 -1
- package/dist/api/session/get.js +3 -3
- package/dist/api/session/get.js.map +1 -1
- package/dist/api/session/index.d.ts +3 -3
- package/dist/api/session/index.d.ts.map +1 -1
- package/dist/api/session/index.js +3 -3
- package/dist/api/session/index.js.map +1 -1
- package/dist/api/session/list.d.ts +1 -1
- package/dist/api/session/list.d.ts.map +1 -1
- package/dist/api/session/list.js +2 -2
- package/dist/api/session/list.js.map +1 -1
- package/dist/api/session/logs.d.ts +1 -1
- package/dist/api/session/logs.d.ts.map +1 -1
- package/dist/api/session/logs.js +2 -2
- package/dist/api/session/logs.js.map +1 -1
- package/dist/api/stream/get.d.ts +1 -1
- package/dist/api/stream/get.d.ts.map +1 -1
- package/dist/api/stream/get.js +2 -2
- package/dist/api/stream/get.js.map +1 -1
- package/dist/api/stream/index.d.ts +3 -3
- package/dist/api/stream/index.d.ts.map +1 -1
- package/dist/api/stream/index.js +3 -3
- package/dist/api/stream/index.js.map +1 -1
- package/dist/api/stream/list.d.ts +1 -1
- package/dist/api/stream/list.d.ts.map +1 -1
- package/dist/api/stream/list.js +2 -2
- package/dist/api/stream/list.js.map +1 -1
- package/dist/api/thread/delete.d.ts +1 -1
- package/dist/api/thread/delete.d.ts.map +1 -1
- package/dist/api/thread/delete.js +2 -2
- package/dist/api/thread/delete.js.map +1 -1
- package/dist/api/thread/get.d.ts +2 -2
- package/dist/api/thread/get.d.ts.map +1 -1
- package/dist/api/thread/get.js +3 -3
- package/dist/api/thread/get.js.map +1 -1
- package/dist/api/thread/index.d.ts +4 -4
- package/dist/api/thread/index.d.ts.map +1 -1
- package/dist/api/thread/index.js +4 -4
- package/dist/api/thread/index.js.map +1 -1
- package/dist/api/thread/list.d.ts +1 -1
- package/dist/api/thread/list.d.ts.map +1 -1
- package/dist/api/thread/list.js +2 -2
- package/dist/api/thread/list.js.map +1 -1
- package/dist/api/user/index.d.ts +1 -1
- package/dist/api/user/index.d.ts.map +1 -1
- package/dist/api/user/index.js +1 -1
- package/dist/api/user/index.js.map +1 -1
- package/dist/api/user/whoami.d.ts +1 -1
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +2 -2
- package/dist/api/user/whoami.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/runtime-bootstrap.js +1 -1
- package/dist/runtime-bootstrap.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +3 -8
- package/src/api/apikey/create.ts +2 -2
- package/src/api/apikey/delete.ts +2 -2
- package/src/api/apikey/get.ts +2 -2
- package/src/api/apikey/index.ts +5 -5
- package/src/api/apikey/list.ts +2 -2
- package/src/api/db/index.ts +4 -4
- package/src/api/db/logs.ts +2 -2
- package/src/api/db/query.ts +2 -2
- package/src/api/db/tables.ts +2 -2
- package/src/api/eval/get.ts +1 -1
- package/src/api/eval/index.ts +4 -4
- package/src/api/eval/list.ts +1 -1
- package/src/api/eval/run-get.ts +1 -1
- package/src/api/eval/run-list.ts +1 -1
- package/src/api/index.ts +14 -14
- package/src/api/machine/index.ts +2 -2
- package/src/api/machine/machine.ts +2 -2
- package/src/api/org/env-delete.ts +2 -2
- package/src/api/org/env-get.ts +2 -2
- package/src/api/org/env-update.ts +2 -2
- package/src/api/org/index.ts +6 -6
- package/src/api/org/list.ts +2 -2
- package/src/api/org/resources.ts +2 -2
- package/src/api/project/agent.ts +3 -3
- package/src/api/project/create.ts +2 -2
- package/src/api/project/delete.ts +2 -2
- package/src/api/project/deploy.ts +2 -2
- package/src/api/project/deployment.ts +2 -2
- package/src/api/project/env-delete.ts +2 -2
- package/src/api/project/env-update.ts +4 -4
- package/src/api/project/exists.ts +2 -2
- package/src/api/project/get.ts +2 -2
- package/src/api/project/hostname.ts +2 -2
- package/src/api/project/index.ts +13 -13
- package/src/api/project/list.ts +2 -2
- package/src/api/project/malware.ts +6 -2
- package/src/api/project/update-region.ts +2 -2
- package/src/api/project/util.ts +3 -0
- package/src/api/queue/analytics.ts +22 -28
- package/src/api/queue/destinations.ts +55 -119
- package/src/api/queue/dlq.ts +32 -72
- package/src/api/queue/index.ts +10 -10
- package/src/api/queue/messages.ts +92 -185
- package/src/api/queue/queues.ts +50 -71
- package/src/api/queue/sources.ts +50 -140
- package/src/api/queue/util.ts +74 -0
- package/src/api/queue/websocket.ts +8 -8
- package/src/api/region/create.ts +8 -2
- package/src/api/region/delete.ts +2 -2
- package/src/api/region/index.ts +4 -4
- package/src/api/region/list.ts +2 -2
- package/src/api/region/resources.ts +2 -2
- package/src/api/sandbox/cli-list.ts +11 -3
- package/src/api/sandbox/client.ts +17 -11
- package/src/api/sandbox/create.ts +17 -4
- package/src/api/sandbox/destroy.ts +2 -2
- package/src/api/sandbox/execute.ts +2 -2
- package/src/api/sandbox/execution.ts +2 -2
- package/src/api/sandbox/files.ts +2 -2
- package/src/api/sandbox/get.ts +17 -3
- package/src/api/sandbox/index.ts +34 -30
- package/src/api/sandbox/list.ts +17 -3
- package/src/api/sandbox/pause.ts +39 -0
- package/src/api/sandbox/resolve.ts +1 -1
- package/src/api/sandbox/resume.ts +39 -0
- package/src/api/sandbox/run.ts +6 -6
- package/src/api/sandbox/runtime.ts +2 -2
- package/src/api/sandbox/snapshot.ts +3 -3
- package/src/api/sandbox/util.ts +6 -0
- package/src/api/session/get.ts +3 -3
- package/src/api/session/index.ts +3 -3
- package/src/api/session/list.ts +2 -2
- package/src/api/session/logs.ts +2 -2
- package/src/api/stream/get.ts +2 -2
- package/src/api/stream/index.ts +3 -3
- package/src/api/stream/list.ts +2 -2
- package/src/api/thread/delete.ts +2 -2
- package/src/api/thread/get.ts +3 -3
- package/src/api/thread/index.ts +4 -4
- package/src/api/thread/list.ts +2 -2
- package/src/api/user/index.ts +1 -1
- package/src/api/user/whoami.ts +2 -2
- package/src/index.ts +8 -8
- package/src/runtime-bootstrap.ts +1 -1
|
@@ -9,17 +9,17 @@ import type {
|
|
|
9
9
|
SandboxRunResult,
|
|
10
10
|
} from '@agentuity/core';
|
|
11
11
|
import type { Readable, Writable } from 'node:stream';
|
|
12
|
-
import { APIClient } from '../api';
|
|
13
|
-
import { sandboxCreate, type SandboxCreateResponse } from './create';
|
|
14
|
-
import { sandboxDestroy } from './destroy';
|
|
15
|
-
import { sandboxGet } from './get';
|
|
16
|
-
import { sandboxExecute } from './execute';
|
|
17
|
-
import { sandboxWriteFiles, sandboxReadFile } from './files';
|
|
18
|
-
import { sandboxRun } from './run';
|
|
19
|
-
import { executionGet, type ExecutionInfo } from './execution';
|
|
20
|
-
import { ConsoleLogger } from '../../logger';
|
|
21
|
-
import { getServiceUrls } from '../../config';
|
|
22
|
-
import { writeAndDrain } from './util';
|
|
12
|
+
import { APIClient } from '../api.ts';
|
|
13
|
+
import { sandboxCreate, type SandboxCreateResponse } from './create.ts';
|
|
14
|
+
import { sandboxDestroy } from './destroy.ts';
|
|
15
|
+
import { sandboxGet } from './get.ts';
|
|
16
|
+
import { sandboxExecute } from './execute.ts';
|
|
17
|
+
import { sandboxWriteFiles, sandboxReadFile } from './files.ts';
|
|
18
|
+
import { sandboxRun } from './run.ts';
|
|
19
|
+
import { executionGet, type ExecutionInfo } from './execution.ts';
|
|
20
|
+
import { ConsoleLogger } from '../../logger.ts';
|
|
21
|
+
import { getServiceUrls } from '../../config.ts';
|
|
22
|
+
import { writeAndDrain } from './util.ts';
|
|
23
23
|
|
|
24
24
|
// Server-side long-poll wait duration (max 5 minutes supported by server)
|
|
25
25
|
const EXECUTION_WAIT_DURATION = '5m';
|
|
@@ -177,6 +177,11 @@ export interface SandboxInstance {
|
|
|
177
177
|
*/
|
|
178
178
|
stderrStreamUrl?: string;
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* URL to stream audit events (eBPF/Tetragon security events)
|
|
182
|
+
*/
|
|
183
|
+
auditStreamUrl?: string;
|
|
184
|
+
|
|
180
185
|
/**
|
|
181
186
|
* Execute a command in the sandbox
|
|
182
187
|
*/
|
|
@@ -313,6 +318,7 @@ export class SandboxClient {
|
|
|
313
318
|
status: response.status,
|
|
314
319
|
stdoutStreamUrl: response.stdoutStreamUrl,
|
|
315
320
|
stderrStreamUrl: response.stderrStreamUrl,
|
|
321
|
+
auditStreamUrl: response.auditStreamUrl,
|
|
316
322
|
|
|
317
323
|
async execute(executeOptions: ExecuteOptions): Promise<Execution> {
|
|
318
324
|
const { pipe, ...coreOptions } = executeOptions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SandboxCreateOptions, SandboxStatus } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { NPM_PACKAGE_NAME_PATTERN } from './snapshot-build';
|
|
5
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { NPM_PACKAGE_NAME_PATTERN } from './snapshot-build.ts';
|
|
5
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
6
6
|
|
|
7
7
|
export const SandboxCreateRequestSchema = z
|
|
8
8
|
.object({
|
|
@@ -122,12 +122,23 @@ export const SandboxCreateDataSchema = z
|
|
|
122
122
|
.object({
|
|
123
123
|
sandboxId: z.string().describe('Unique identifier for the created sandbox'),
|
|
124
124
|
status: z
|
|
125
|
-
.enum([
|
|
125
|
+
.enum([
|
|
126
|
+
'creating',
|
|
127
|
+
'idle',
|
|
128
|
+
'running',
|
|
129
|
+
'paused',
|
|
130
|
+
'stopping',
|
|
131
|
+
'suspended',
|
|
132
|
+
'terminated',
|
|
133
|
+
'failed',
|
|
134
|
+
])
|
|
126
135
|
.describe('Current status of the sandbox'),
|
|
127
136
|
stdoutStreamId: z.string().optional().describe('Stream ID for reading stdout'),
|
|
128
137
|
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
129
138
|
stderrStreamId: z.string().optional().describe('Stream ID for reading stderr'),
|
|
130
139
|
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
140
|
+
auditStreamId: z.string().optional().describe('Stream ID for reading audit events'),
|
|
141
|
+
auditStreamUrl: z.string().optional().describe('URL for streaming audit events'),
|
|
131
142
|
})
|
|
132
143
|
.describe('Response data from sandbox creation');
|
|
133
144
|
|
|
@@ -140,6 +151,8 @@ export interface SandboxCreateResponse {
|
|
|
140
151
|
stdoutStreamUrl?: string;
|
|
141
152
|
stderrStreamId?: string;
|
|
142
153
|
stderrStreamUrl?: string;
|
|
154
|
+
auditStreamId?: string;
|
|
155
|
+
auditStreamUrl?: string;
|
|
143
156
|
}
|
|
144
157
|
|
|
145
158
|
export interface SandboxCreateParams {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchemaNoData } from '../api.ts';
|
|
3
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const DestroyResponseSchema = APIResponseSchemaNoData();
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExecuteOptions, Execution, ExecutionStatus } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { API_VERSION, SandboxBusyError, throwSandboxError } from './util';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { API_VERSION, SandboxBusyError, throwSandboxError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const ExecuteRequestSchema = z
|
|
7
7
|
.object({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExecutionStatus } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const ExecutionInfoSchema = z
|
|
7
7
|
.object({
|
package/src/api/sandbox/files.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient } from '../api';
|
|
3
|
-
import { SandboxResponseError, throwSandboxError, API_VERSION } from './util';
|
|
2
|
+
import { APIClient } from '../api.ts';
|
|
3
|
+
import { SandboxResponseError, throwSandboxError, API_VERSION } from './util.ts';
|
|
4
4
|
import type { FileToWrite } from '@agentuity/core';
|
|
5
5
|
|
|
6
6
|
export const FileToWriteSchema = z.object({
|
package/src/api/sandbox/get.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type {
|
|
|
5
5
|
SandboxStatus,
|
|
6
6
|
} from '@agentuity/core';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
9
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
8
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
9
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
10
10
|
|
|
11
11
|
export const SandboxResourcesSchema = z
|
|
12
12
|
.object({
|
|
@@ -105,7 +105,17 @@ export const SandboxInfoDataSchema = z
|
|
|
105
105
|
name: z.string().optional().describe('Sandbox name'),
|
|
106
106
|
description: z.string().optional().describe('Sandbox description'),
|
|
107
107
|
status: z
|
|
108
|
-
.enum([
|
|
108
|
+
.enum([
|
|
109
|
+
'creating',
|
|
110
|
+
'idle',
|
|
111
|
+
'running',
|
|
112
|
+
'paused',
|
|
113
|
+
'stopping',
|
|
114
|
+
'suspended',
|
|
115
|
+
'terminated',
|
|
116
|
+
'failed',
|
|
117
|
+
'deleted',
|
|
118
|
+
])
|
|
109
119
|
.describe('Current status of the sandbox'),
|
|
110
120
|
mode: z.string().optional().describe('Sandbox mode (interactive or oneshot)'),
|
|
111
121
|
createdAt: z.string().describe('ISO timestamp when the sandbox was created'),
|
|
@@ -119,6 +129,8 @@ export const SandboxInfoDataSchema = z
|
|
|
119
129
|
.describe('Exit code from the last execution (only for terminated/failed sandboxes)'),
|
|
120
130
|
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
121
131
|
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
132
|
+
auditStreamId: z.string().optional().describe('ID of the audit event stream'),
|
|
133
|
+
auditStreamUrl: z.string().optional().describe('URL for streaming audit events'),
|
|
122
134
|
dependencies: z
|
|
123
135
|
.array(z.string())
|
|
124
136
|
.optional()
|
|
@@ -212,6 +224,8 @@ export async function sandboxGet(
|
|
|
212
224
|
exitCode: resp.data.exitCode,
|
|
213
225
|
stdoutStreamUrl: resp.data.stdoutStreamUrl,
|
|
214
226
|
stderrStreamUrl: resp.data.stderrStreamUrl,
|
|
227
|
+
auditStreamId: resp.data.auditStreamId,
|
|
228
|
+
auditStreamUrl: resp.data.auditStreamUrl,
|
|
215
229
|
dependencies: resp.data.dependencies,
|
|
216
230
|
packages: resp.data.packages,
|
|
217
231
|
metadata: resp.data.metadata as Record<string, unknown> | undefined,
|
package/src/api/sandbox/index.ts
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
export type { CLISandboxInfo, CLISandboxListData, CLISandboxListOptions } from './cli-list';
|
|
2
|
-
export { cliSandboxList, SandboxListDataSchema, SandboxListResponseSchema } from './cli-list';
|
|
1
|
+
export type { CLISandboxInfo, CLISandboxListData, CLISandboxListOptions } from './cli-list.ts';
|
|
2
|
+
export { cliSandboxList, SandboxListDataSchema, SandboxListResponseSchema } from './cli-list.ts';
|
|
3
3
|
export type {
|
|
4
4
|
ExecuteOptions,
|
|
5
5
|
SandboxClientOptions,
|
|
6
6
|
SandboxClientRunIO,
|
|
7
7
|
SandboxInstance,
|
|
8
|
-
} from './client';
|
|
9
|
-
export { SandboxClient } from './client';
|
|
10
|
-
export type { SandboxCreateParams, SandboxCreateResponse } from './create';
|
|
8
|
+
} from './client.ts';
|
|
9
|
+
export { SandboxClient } from './client.ts';
|
|
10
|
+
export type { SandboxCreateParams, SandboxCreateResponse } from './create.ts';
|
|
11
11
|
export {
|
|
12
12
|
SandboxCreateDataSchema,
|
|
13
13
|
SandboxCreateRequestSchema,
|
|
14
14
|
SandboxCreateResponseSchema,
|
|
15
15
|
sandboxCreate,
|
|
16
|
-
} from './create';
|
|
17
|
-
export type { SandboxDestroyParams } from './destroy';
|
|
18
|
-
export { DestroyResponseSchema, sandboxDestroy } from './destroy';
|
|
19
|
-
export type {
|
|
16
|
+
} from './create.ts';
|
|
17
|
+
export type { SandboxDestroyParams } from './destroy.ts';
|
|
18
|
+
export { DestroyResponseSchema, sandboxDestroy } from './destroy.ts';
|
|
19
|
+
export type { SandboxPauseParams } from './pause.ts';
|
|
20
|
+
export { PauseResponseSchema, sandboxPause } from './pause.ts';
|
|
21
|
+
export type { SandboxResumeParams } from './resume.ts';
|
|
22
|
+
export { ResumeResponseSchema, sandboxResume } from './resume.ts';
|
|
23
|
+
export type { SandboxExecuteParams } from './execute.ts';
|
|
20
24
|
export {
|
|
21
25
|
ExecuteDataSchema,
|
|
22
26
|
ExecuteRequestSchema,
|
|
23
27
|
ExecuteResponseSchema,
|
|
24
28
|
sandboxExecute,
|
|
25
|
-
} from './execute';
|
|
29
|
+
} from './execute.ts';
|
|
26
30
|
export type {
|
|
27
31
|
ExecutionGetParams,
|
|
28
32
|
ExecutionInfo,
|
|
29
33
|
ExecutionListParams,
|
|
30
34
|
ExecutionListResponse,
|
|
31
|
-
} from './execution';
|
|
35
|
+
} from './execution.ts';
|
|
32
36
|
export {
|
|
33
37
|
ExecutionGetResponseSchema,
|
|
34
38
|
ExecutionInfoSchema,
|
|
@@ -36,7 +40,7 @@ export {
|
|
|
36
40
|
ExecutionListResponseSchema,
|
|
37
41
|
executionGet,
|
|
38
42
|
executionList,
|
|
39
|
-
} from './execution';
|
|
43
|
+
} from './execution.ts';
|
|
40
44
|
export type {
|
|
41
45
|
ArchiveFormat,
|
|
42
46
|
DownloadArchiveParams,
|
|
@@ -52,7 +56,7 @@ export type {
|
|
|
52
56
|
UploadArchiveParams,
|
|
53
57
|
WriteFilesParams,
|
|
54
58
|
WriteFilesResult,
|
|
55
|
-
} from './files';
|
|
59
|
+
} from './files.ts';
|
|
56
60
|
export {
|
|
57
61
|
FileInfoSchema,
|
|
58
62
|
FileToWriteSchema,
|
|
@@ -80,8 +84,8 @@ export {
|
|
|
80
84
|
WriteFilesDataSchema,
|
|
81
85
|
WriteFilesRequestSchema,
|
|
82
86
|
WriteFilesResponseSchema,
|
|
83
|
-
} from './files';
|
|
84
|
-
export type { SandboxGetParams } from './get';
|
|
87
|
+
} from './files.ts';
|
|
88
|
+
export type { SandboxGetParams } from './get.ts';
|
|
85
89
|
export {
|
|
86
90
|
SandboxAgentInfoSchema,
|
|
87
91
|
SandboxGetResponseSchema,
|
|
@@ -90,8 +94,8 @@ export {
|
|
|
90
94
|
SandboxResourcesSchema,
|
|
91
95
|
SandboxUserInfoSchema,
|
|
92
96
|
sandboxGet,
|
|
93
|
-
} from './get';
|
|
94
|
-
export type { SandboxListParams } from './list';
|
|
97
|
+
} from './get.ts';
|
|
98
|
+
export type { SandboxListParams } from './list.ts';
|
|
95
99
|
export {
|
|
96
100
|
ListSandboxesDataSchema,
|
|
97
101
|
ListSandboxesResponseSchema,
|
|
@@ -102,24 +106,24 @@ export {
|
|
|
102
106
|
SandboxSnapshotOrgInfoSchema,
|
|
103
107
|
SandboxSnapshotUserInfoSchema,
|
|
104
108
|
sandboxList,
|
|
105
|
-
} from './list';
|
|
106
|
-
export type { ResolvedSandboxInfo } from './resolve';
|
|
109
|
+
} from './list.ts';
|
|
110
|
+
export type { ResolvedSandboxInfo } from './resolve.ts';
|
|
107
111
|
export {
|
|
108
112
|
SandboxResolveDataSchema,
|
|
109
113
|
SandboxResolveError,
|
|
110
114
|
SandboxResolveResponseSchema,
|
|
111
115
|
sandboxResolve,
|
|
112
|
-
} from './resolve';
|
|
113
|
-
export type { SandboxRunParams } from './run';
|
|
114
|
-
export { sandboxRun } from './run';
|
|
115
|
-
export type { RuntimeListParams } from './runtime';
|
|
116
|
+
} from './resolve.ts';
|
|
117
|
+
export type { SandboxRunParams } from './run.ts';
|
|
118
|
+
export { sandboxRun } from './run.ts';
|
|
119
|
+
export type { RuntimeListParams } from './runtime.ts';
|
|
116
120
|
export {
|
|
117
121
|
ListRuntimesDataSchema,
|
|
118
122
|
ListRuntimesResponseSchema,
|
|
119
123
|
RuntimeInfoSchema,
|
|
120
124
|
RuntimeRequirementsSchema,
|
|
121
125
|
runtimeList,
|
|
122
|
-
} from './runtime';
|
|
126
|
+
} from './runtime.ts';
|
|
123
127
|
export type {
|
|
124
128
|
SnapshotBuildFinalizeParams,
|
|
125
129
|
SnapshotBuildGitInfo,
|
|
@@ -140,7 +144,7 @@ export type {
|
|
|
140
144
|
SnapshotTagParams,
|
|
141
145
|
SnapshotUploadParams,
|
|
142
146
|
SnapshotUploadResponse,
|
|
143
|
-
} from './snapshot';
|
|
147
|
+
} from './snapshot.ts';
|
|
144
148
|
export {
|
|
145
149
|
SnapshotBuildGitInfoSchema,
|
|
146
150
|
SnapshotBuildInitAPIResponseSchema,
|
|
@@ -169,10 +173,10 @@ export {
|
|
|
169
173
|
snapshotPublicList,
|
|
170
174
|
snapshotTag,
|
|
171
175
|
snapshotUpload,
|
|
172
|
-
} from './snapshot';
|
|
173
|
-
export type { SnapshotBuildFile } from './snapshot-build';
|
|
174
|
-
export { SnapshotBuildFileSchema, NPM_PACKAGE_NAME_PATTERN } from './snapshot-build';
|
|
175
|
-
export type { SandboxErrorCode, SandboxErrorContext } from './util';
|
|
176
|
+
} from './snapshot.ts';
|
|
177
|
+
export type { SnapshotBuildFile } from './snapshot-build.ts';
|
|
178
|
+
export { SnapshotBuildFileSchema, NPM_PACKAGE_NAME_PATTERN } from './snapshot-build.ts';
|
|
179
|
+
export type { SandboxErrorCode, SandboxErrorContext } from './util.ts';
|
|
176
180
|
export {
|
|
177
181
|
ExecutionCancelledError,
|
|
178
182
|
ExecutionNotFoundError,
|
|
@@ -184,4 +188,4 @@ export {
|
|
|
184
188
|
SnapshotNotFoundError,
|
|
185
189
|
throwSandboxError,
|
|
186
190
|
writeAndDrain,
|
|
187
|
-
} from './util';
|
|
191
|
+
} from './util.ts';
|
package/src/api/sandbox/list.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
SandboxStatus,
|
|
7
7
|
} from '@agentuity/core';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
10
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
9
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
10
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
11
11
|
|
|
12
12
|
export const SandboxOrgInfoSchema = z
|
|
13
13
|
.object({
|
|
@@ -76,7 +76,17 @@ export const SandboxInfoSchema = z
|
|
|
76
76
|
name: z.string().optional().describe('Sandbox name'),
|
|
77
77
|
description: z.string().optional().describe('Sandbox description'),
|
|
78
78
|
status: z
|
|
79
|
-
.enum([
|
|
79
|
+
.enum([
|
|
80
|
+
'creating',
|
|
81
|
+
'idle',
|
|
82
|
+
'running',
|
|
83
|
+
'paused',
|
|
84
|
+
'stopping',
|
|
85
|
+
'suspended',
|
|
86
|
+
'terminated',
|
|
87
|
+
'failed',
|
|
88
|
+
'deleted',
|
|
89
|
+
])
|
|
80
90
|
.describe('Current status of the sandbox'),
|
|
81
91
|
mode: z.string().optional().describe('Sandbox mode (interactive or oneshot)'),
|
|
82
92
|
createdAt: z.string().describe('ISO timestamp when the sandbox was created'),
|
|
@@ -86,6 +96,8 @@ export const SandboxInfoSchema = z
|
|
|
86
96
|
executions: z.number().describe('Total number of executions in this sandbox'),
|
|
87
97
|
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
88
98
|
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
99
|
+
auditStreamId: z.string().optional().describe('ID of the audit event stream'),
|
|
100
|
+
auditStreamUrl: z.string().optional().describe('URL for streaming audit events'),
|
|
89
101
|
networkEnabled: z.boolean().optional().describe('Whether network access is enabled'),
|
|
90
102
|
networkPort: z.number().optional().describe('Network port exposed from the sandbox'),
|
|
91
103
|
url: z
|
|
@@ -197,6 +209,8 @@ export async function sandboxList(
|
|
|
197
209
|
executions: s.executions,
|
|
198
210
|
stdoutStreamUrl: s.stdoutStreamUrl,
|
|
199
211
|
stderrStreamUrl: s.stderrStreamUrl,
|
|
212
|
+
auditStreamId: s.auditStreamId,
|
|
213
|
+
auditStreamUrl: s.auditStreamUrl,
|
|
200
214
|
networkEnabled: s.networkEnabled,
|
|
201
215
|
networkPort: s.networkPort,
|
|
202
216
|
url: s.url,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
|
+
import { API_VERSION, throwSandboxError } from './util';
|
|
4
|
+
|
|
5
|
+
export const PauseResponseSchema = APIResponseSchemaNoData();
|
|
6
|
+
|
|
7
|
+
export interface SandboxPauseParams {
|
|
8
|
+
sandboxId: string;
|
|
9
|
+
orgId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Pauses a running sandbox, creating a checkpoint of its current state.
|
|
14
|
+
*
|
|
15
|
+
* @param client - The API client to use for the request
|
|
16
|
+
* @param params - Parameters including the sandbox ID to pause
|
|
17
|
+
* @throws {SandboxResponseError} If the sandbox is not found or pause fails
|
|
18
|
+
*/
|
|
19
|
+
export async function sandboxPause(client: APIClient, params: SandboxPauseParams): Promise<void> {
|
|
20
|
+
const { sandboxId, orgId } = params;
|
|
21
|
+
const queryParams = new URLSearchParams();
|
|
22
|
+
if (orgId) {
|
|
23
|
+
queryParams.set('orgId', orgId);
|
|
24
|
+
}
|
|
25
|
+
const queryString = queryParams.toString();
|
|
26
|
+
const url = `/sandbox/${API_VERSION}/${sandboxId}/pause${queryString ? `?${queryString}` : ''}`;
|
|
27
|
+
|
|
28
|
+
const resp = await client.post<z.infer<typeof PauseResponseSchema>>(
|
|
29
|
+
url,
|
|
30
|
+
undefined,
|
|
31
|
+
PauseResponseSchema
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (resp.success) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
throwSandboxError(resp, { sandboxId });
|
|
39
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StructuredError } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchemaOptionalData } from '../api';
|
|
3
|
+
import { type APIClient, APIResponseSchemaOptionalData } from '../api.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Data schema for sandbox resolve endpoint
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
|
+
import { API_VERSION, throwSandboxError } from './util';
|
|
4
|
+
|
|
5
|
+
export const ResumeResponseSchema = APIResponseSchemaNoData();
|
|
6
|
+
|
|
7
|
+
export interface SandboxResumeParams {
|
|
8
|
+
sandboxId: string;
|
|
9
|
+
orgId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Resumes a paused sandbox from its checkpoint.
|
|
14
|
+
*
|
|
15
|
+
* @param client - The API client to use for the request
|
|
16
|
+
* @param params - Parameters including the sandbox ID to resume
|
|
17
|
+
* @throws {SandboxResponseError} If the sandbox is not found or resume fails
|
|
18
|
+
*/
|
|
19
|
+
export async function sandboxResume(client: APIClient, params: SandboxResumeParams): Promise<void> {
|
|
20
|
+
const { sandboxId, orgId } = params;
|
|
21
|
+
const queryParams = new URLSearchParams();
|
|
22
|
+
if (orgId) {
|
|
23
|
+
queryParams.set('orgId', orgId);
|
|
24
|
+
}
|
|
25
|
+
const queryString = queryParams.toString();
|
|
26
|
+
const url = `/sandbox/${API_VERSION}/${sandboxId}/resume${queryString ? `?${queryString}` : ''}`;
|
|
27
|
+
|
|
28
|
+
const resp = await client.post<z.infer<typeof ResumeResponseSchema>>(
|
|
29
|
+
url,
|
|
30
|
+
undefined,
|
|
31
|
+
ResumeResponseSchema
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (resp.success) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
throwSandboxError(resp, { sandboxId });
|
|
39
|
+
}
|
package/src/api/sandbox/run.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Logger } from '@agentuity/core';
|
|
2
2
|
import type { Readable, Writable } from 'node:stream';
|
|
3
3
|
import { PassThrough } from 'node:stream';
|
|
4
|
-
import { APIClient, PaymentRequiredError } from '../api';
|
|
5
|
-
import { sandboxCreate } from './create';
|
|
6
|
-
import { sandboxDestroy } from './destroy';
|
|
7
|
-
import { sandboxGet } from './get';
|
|
8
|
-
import { ExecutionCancelledError, ExecutionTimeoutError, writeAndDrain } from './util';
|
|
4
|
+
import { APIClient, PaymentRequiredError } from '../api.ts';
|
|
5
|
+
import { sandboxCreate } from './create.ts';
|
|
6
|
+
import { sandboxDestroy } from './destroy.ts';
|
|
7
|
+
import { sandboxGet } from './get.ts';
|
|
8
|
+
import { ExecutionCancelledError, ExecutionTimeoutError, writeAndDrain } from './util.ts';
|
|
9
9
|
import type { SandboxRunOptions, SandboxRunResult } from '@agentuity/core';
|
|
10
|
-
import { getServiceUrls } from '../../config';
|
|
10
|
+
import { getServiceUrls } from '../../config.ts';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates a Writable stream that captures all chunks to a buffer array
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ListRuntimesParams, ListRuntimesResponse, SandboxRuntime } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { API_VERSION, throwSandboxError } from './util';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const RuntimeRequirementsSchema = z
|
|
7
7
|
.object({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
3
|
-
import { NPM_PACKAGE_NAME_PATTERN } from './snapshot-build';
|
|
4
|
-
import { API_VERSION, SandboxResponseError, throwSandboxError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api.ts';
|
|
3
|
+
import { NPM_PACKAGE_NAME_PATTERN } from './snapshot-build.ts';
|
|
4
|
+
import { API_VERSION, SandboxResponseError, throwSandboxError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const SnapshotFileInfoSchema = z
|
|
7
7
|
.object({
|
package/src/api/sandbox/util.ts
CHANGED
|
@@ -184,6 +184,12 @@ export interface SandboxErrorContext {
|
|
|
184
184
|
* when the backend returns a known error code, and falling back to
|
|
185
185
|
* SandboxResponseError for unknown codes.
|
|
186
186
|
*
|
|
187
|
+
* Note: Pause and resume operations use standard error codes. The backend
|
|
188
|
+
* returns SANDBOX_NOT_FOUND when the sandbox doesn't exist, and HTTP 409
|
|
189
|
+
* Conflict (handled by APIClient retries) for invalid state transitions
|
|
190
|
+
* (e.g. pausing a non-running sandbox, resuming a non-suspended sandbox).
|
|
191
|
+
* No additional error codes are needed for pause/resume.
|
|
192
|
+
*
|
|
187
193
|
* @param resp - The API response containing message and optional code
|
|
188
194
|
* @param context - Context about the operation (sandbox ID, execution ID, etc.)
|
|
189
195
|
* @throws {SandboxNotFoundError} When code is 'SANDBOX_NOT_FOUND'
|
package/src/api/session/get.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { SessionSchema, type Session } from './list';
|
|
4
|
-
import { SessionResponseError } from './util';
|
|
2
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { SessionSchema, type Session } from './list.ts';
|
|
4
|
+
import { SessionResponseError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const _SessionGetRequestSchema = z.object({
|
|
7
7
|
id: z.string().describe('the session id'),
|
package/src/api/session/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get';
|
|
2
|
-
export * from './list';
|
|
3
|
-
export * from './logs';
|
|
1
|
+
export * from './get.ts';
|
|
2
|
+
export * from './list.ts';
|
|
3
|
+
export * from './logs.ts';
|
package/src/api/session/list.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SortDirection } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { SessionResponseError } from './util';
|
|
3
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { SessionResponseError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
const SessionSchema = z.object({
|
|
7
7
|
id: z.string().describe('the session id'),
|
package/src/api/session/logs.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { SessionResponseError } from './util';
|
|
2
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { SessionResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const _SessionLogsRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the session id'),
|
package/src/api/stream/get.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { StreamResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { StreamResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const StreamDetailSchema = z.object({
|
|
6
6
|
id: z.string().describe('the stream id'),
|
package/src/api/stream/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './get';
|
|
2
|
-
export * from './list';
|
|
3
|
-
export * from './util';
|
|
1
|
+
export * from './get.ts';
|
|
2
|
+
export * from './list.ts';
|
|
3
|
+
export * from './util.ts';
|
package/src/api/stream/list.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SortDirection } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { StreamResponseError } from './util';
|
|
3
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { StreamResponseError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const StreamInfoSchema = z.object({
|
|
7
7
|
id: z.string().describe('the stream id'),
|
package/src/api/thread/delete.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
|
-
import { ThreadResponseError } from './util';
|
|
2
|
+
import { APIClient, APIResponseSchemaNoData } from '../api.ts';
|
|
3
|
+
import { ThreadResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const _ThreadDeleteRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the thread id'),
|
package/src/api/thread/get.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { ThreadSchema, type Thread } from './list';
|
|
4
|
-
import { ThreadResponseError } from './util';
|
|
2
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ThreadSchema, type Thread } from './list.ts';
|
|
4
|
+
import { ThreadResponseError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const _ThreadGetRequestSchema = z.object({
|
|
7
7
|
id: z.string().describe('the thread id'),
|
package/src/api/thread/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './get';
|
|
2
|
-
export * from './list';
|
|
3
|
-
export * from './delete';
|
|
4
|
-
export * from './util';
|
|
1
|
+
export * from './get.ts';
|
|
2
|
+
export * from './list.ts';
|
|
3
|
+
export * from './delete.ts';
|
|
4
|
+
export * from './util.ts';
|
package/src/api/thread/list.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SortDirection } from '@agentuity/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
4
|
-
import { ThreadResponseError } from './util';
|
|
3
|
+
import { APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
+
import { ThreadResponseError } from './util.ts';
|
|
5
5
|
|
|
6
6
|
export const ThreadSchema = z.object({
|
|
7
7
|
id: z.string().describe('the thread id'),
|
package/src/api/user/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './whoami';
|
|
1
|
+
export * from './whoami.ts';
|