@agentuity/server 1.0.32 → 1.0.34
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 +1 -227
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +1 -637
- package/dist/api/api.js.map +1 -1
- package/dist/api/index.d.ts +1 -17
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -17
- package/dist/api/index.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +1 -22
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +1 -24
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +1 -32
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +1 -25
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +1 -23
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +1 -25
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/project/get.d.ts +1 -42
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +1 -35
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/list.d.ts +1 -47
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +1 -37
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +1 -70
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +1 -41
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/region/create.d.ts +1 -80
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +1 -176
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/sandbox/client.d.ts +1 -190
- package/dist/api/sandbox/client.d.ts.map +1 -1
- package/dist/api/sandbox/client.js +1 -260
- package/dist/api/sandbox/client.js.map +1 -1
- package/dist/api/sandbox/pause.d.ts +1 -21
- package/dist/api/sandbox/pause.d.ts.map +1 -1
- package/dist/api/sandbox/pause.js +1 -24
- package/dist/api/sandbox/pause.js.map +1 -1
- package/dist/api/sandbox/resume.d.ts +1 -21
- package/dist/api/sandbox/resume.d.ts.map +1 -1
- package/dist/api/sandbox/resume.js +1 -24
- package/dist/api/sandbox/resume.js.map +1 -1
- package/dist/api/sandbox/util.d.ts +1 -284
- package/dist/api/sandbox/util.d.ts.map +1 -1
- package/dist/api/sandbox/util.js +1 -210
- package/dist/api/sandbox/util.js.map +1 -1
- package/dist/api/user/whoami.d.ts +1 -38
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +1 -26
- package/dist/api/user/whoami.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +1 -936
- package/src/api/index.ts +1 -17
- package/src/api/org/env-delete.ts +1 -37
- package/src/api/org/env-get.ts +1 -43
- package/src/api/org/env-update.ts +1 -38
- package/src/api/project/get.ts +1 -49
- package/src/api/project/list.ts +1 -54
- package/src/api/project/malware.ts +1 -68
- package/src/api/region/create.ts +1 -207
- package/src/api/sandbox/client.ts +1 -460
- package/src/api/sandbox/pause.ts +1 -39
- package/src/api/sandbox/resume.ts +1 -39
- package/src/api/sandbox/util.ts +1 -276
- package/src/api/user/whoami.ts +1 -32
- package/src/index.ts +3 -30
- 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 +0 -19
- package/dist/api/apikey/delete.d.ts.map +0 -1
- package/dist/api/apikey/delete.js +0 -19
- package/dist/api/apikey/delete.js.map +0 -1
- package/dist/api/apikey/get.d.ts +0 -45
- package/dist/api/apikey/get.d.ts.map +0 -1
- package/dist/api/apikey/get.js +0 -36
- package/dist/api/apikey/get.js.map +0 -1
- package/dist/api/apikey/index.d.ts +0 -6
- package/dist/api/apikey/index.d.ts.map +0 -1
- package/dist/api/apikey/index.js +0 -6
- 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 +0 -23
- package/dist/api/apikey/util.d.ts.map +0 -1
- package/dist/api/apikey/util.js +0 -3
- package/dist/api/apikey/util.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 +0 -70
- package/dist/api/db/logs.d.ts.map +0 -1
- package/dist/api/db/logs.js +0 -59
- 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 +0 -31
- package/dist/api/db/util.d.ts.map +0 -1
- package/dist/api/db/util.js +0 -4
- package/dist/api/db/util.js.map +0 -1
- package/dist/api/eval/get.d.ts +0 -36
- package/dist/api/eval/get.d.ts.map +0 -1
- package/dist/api/eval/get.js +0 -23
- 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 +0 -50
- package/dist/api/eval/list.d.ts.map +0 -1
- package/dist/api/eval/list.js +0 -32
- package/dist/api/eval/list.js.map +0 -1
- package/dist/api/eval/run-get.d.ts +0 -48
- package/dist/api/eval/run-get.d.ts.map +0 -1
- package/dist/api/eval/run-get.js +0 -29
- package/dist/api/eval/run-get.js.map +0 -1
- package/dist/api/eval/run-list.d.ts +0 -70
- package/dist/api/eval/run-list.d.ts.map +0 -1
- package/dist/api/eval/run-list.js +0 -42
- package/dist/api/eval/run-list.js.map +0 -1
- package/dist/api/machine/index.d.ts +0 -3
- package/dist/api/machine/index.d.ts.map +0 -1
- package/dist/api/machine/index.js +0 -3
- package/dist/api/machine/index.js.map +0 -1
- package/dist/api/machine/machine.d.ts +0 -192
- 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 +0 -14
- package/dist/api/machine/util.d.ts.map +0 -1
- package/dist/api/machine/util.js +0 -3
- package/dist/api/machine/util.js.map +0 -1
- package/dist/api/org/index.d.ts +0 -7
- package/dist/api/org/index.d.ts.map +0 -1
- package/dist/api/org/index.js +0 -7
- package/dist/api/org/index.js.map +0 -1
- package/dist/api/org/list.d.ts +0 -27
- package/dist/api/org/list.d.ts.map +0 -1
- package/dist/api/org/list.js +0 -22
- 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 +0 -45
- package/dist/api/org/util.d.ts.map +0 -1
- package/dist/api/org/util.js +0 -4
- package/dist/api/org/util.js.map +0 -1
- package/dist/api/project/agent.d.ts +0 -89
- package/dist/api/project/agent.d.ts.map +0 -1
- package/dist/api/project/agent.js +0 -60
- package/dist/api/project/agent.js.map +0 -1
- package/dist/api/project/create.d.ts +0 -37
- package/dist/api/project/create.d.ts.map +0 -1
- package/dist/api/project/create.js +0 -31
- package/dist/api/project/create.js.map +0 -1
- package/dist/api/project/delete.d.ts +0 -15
- 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 +0 -313
- package/dist/api/project/deploy.js.map +0 -1
- package/dist/api/project/deployment.d.ts +0 -237
- 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 +0 -22
- package/dist/api/project/env-delete.d.ts.map +0 -1
- package/dist/api/project/env-delete.js +0 -29
- package/dist/api/project/env-delete.js.map +0 -1
- package/dist/api/project/env-update.d.ts +0 -31
- package/dist/api/project/env-update.d.ts.map +0 -1
- package/dist/api/project/env-update.js +0 -36
- package/dist/api/project/env-update.js.map +0 -1
- package/dist/api/project/exists.d.ts +0 -25
- package/dist/api/project/exists.d.ts.map +0 -1
- package/dist/api/project/exists.js +0 -45
- package/dist/api/project/exists.js.map +0 -1
- package/dist/api/project/hostname.d.ts +0 -25
- 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 +0 -14
- package/dist/api/project/index.d.ts.map +0 -1
- package/dist/api/project/index.js +0 -14
- package/dist/api/project/index.js.map +0 -1
- package/dist/api/project/update-region.d.ts +0 -27
- package/dist/api/project/update-region.d.ts.map +0 -1
- package/dist/api/project/update-region.js +0 -25
- package/dist/api/project/update-region.js.map +0 -1
- package/dist/api/project/util.d.ts +0 -62
- package/dist/api/project/util.d.ts.map +0 -1
- package/dist/api/project/util.js +0 -6
- 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 +0 -166
- 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 +0 -549
- 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 +0 -321
- 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 -235
- 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 -168
- package/dist/api/queue/websocket.d.ts.map +0 -1
- package/dist/api/queue/websocket.js +0 -394
- package/dist/api/queue/websocket.js.map +0 -1
- package/dist/api/region/delete.d.ts +0 -62
- package/dist/api/region/delete.d.ts.map +0 -1
- package/dist/api/region/delete.js +0 -37
- package/dist/api/region/delete.js.map +0 -1
- package/dist/api/region/index.d.ts +0 -5
- package/dist/api/region/index.d.ts.map +0 -1
- package/dist/api/region/index.js +0 -5
- package/dist/api/region/index.js.map +0 -1
- package/dist/api/region/list.d.ts +0 -27
- package/dist/api/region/list.d.ts.map +0 -1
- package/dist/api/region/list.js +0 -22
- package/dist/api/region/list.js.map +0 -1
- package/dist/api/region/resources.d.ts +0 -71
- package/dist/api/region/resources.d.ts.map +0 -1
- package/dist/api/region/resources.js +0 -53
- package/dist/api/region/resources.js.map +0 -1
- package/dist/api/region/util.d.ts +0 -23
- package/dist/api/region/util.d.ts.map +0 -1
- package/dist/api/region/util.js +0 -3
- 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/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/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/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 +0 -48
- package/dist/api/sandbox/snapshot-build.d.ts.map +0 -1
- package/dist/api/sandbox/snapshot-build.js +0 -74
- 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/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 +0 -56
- 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 +0 -40
- package/dist/api/session/logs.d.ts.map +0 -1
- package/dist/api/session/logs.js +0 -28
- package/dist/api/session/logs.js.map +0 -1
- package/dist/api/session/util.d.ts +0 -23
- package/dist/api/session/util.d.ts.map +0 -1
- package/dist/api/session/util.js +0 -3
- package/dist/api/session/util.js.map +0 -1
- package/dist/api/storage/config.d.ts +0 -99
- package/dist/api/storage/config.d.ts.map +0 -1
- package/dist/api/storage/config.js +0 -61
- package/dist/api/storage/config.js.map +0 -1
- package/dist/api/storage/index.d.ts +0 -5
- package/dist/api/storage/index.d.ts.map +0 -1
- package/dist/api/storage/index.js +0 -5
- 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 +0 -161
- package/dist/api/storage/types.d.ts.map +0 -1
- package/dist/api/storage/types.js +0 -141
- package/dist/api/storage/types.js.map +0 -1
- package/dist/api/storage/util.d.ts +0 -48
- package/dist/api/storage/util.d.ts.map +0 -1
- package/dist/api/storage/util.js +0 -8
- package/dist/api/storage/util.js.map +0 -1
- package/dist/api/stream/get.d.ts +0 -58
- package/dist/api/stream/get.d.ts.map +0 -1
- package/dist/api/stream/get.js +0 -40
- 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 +0 -23
- package/dist/api/stream/util.d.ts.map +0 -1
- package/dist/api/stream/util.js +0 -3
- package/dist/api/stream/util.js.map +0 -1
- package/dist/api/thread/delete.d.ts +0 -23
- package/dist/api/thread/delete.d.ts.map +0 -1
- package/dist/api/thread/delete.js +0 -21
- package/dist/api/thread/delete.js.map +0 -1
- package/dist/api/thread/get.d.ts +0 -36
- package/dist/api/thread/get.d.ts.map +0 -1
- package/dist/api/thread/get.js +0 -23
- package/dist/api/thread/get.js.map +0 -1
- package/dist/api/thread/index.d.ts +0 -5
- package/dist/api/thread/index.d.ts.map +0 -1
- package/dist/api/thread/index.js +0 -5
- 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 +0 -23
- package/dist/api/thread/util.d.ts.map +0 -1
- package/dist/api/thread/util.js +0 -3
- package/dist/api/thread/util.js.map +0 -1
- package/dist/api/user/index.d.ts +0 -2
- package/dist/api/user/index.d.ts.map +0 -1
- package/dist/api/user/index.js +0 -2
- package/dist/api/user/index.js.map +0 -1
- package/dist/api/user/util.d.ts +0 -23
- package/dist/api/user/util.d.ts.map +0 -1
- package/dist/api/user/util.js +0 -3
- package/dist/api/user/util.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 +0 -79
- 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 +0 -137
- 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 +0 -77
- package/dist/api/webhook/receipts.d.ts.map +0 -1
- package/dist/api/webhook/receipts.js +0 -78
- 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 +0 -202
- package/dist/api/webhook/util.d.ts.map +0 -1
- package/dist/api/webhook/util.js +0 -201
- 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 +0 -165
- package/dist/api/webhook/webhooks.js.map +0 -1
- package/src/api/api-example.md +0 -164
- package/src/api/apikey/create.ts +0 -41
- package/src/api/apikey/delete.ts +0 -30
- package/src/api/apikey/get.ts +0 -48
- package/src/api/apikey/index.ts +0 -5
- package/src/api/apikey/list.ts +0 -64
- package/src/api/apikey/util.ts +0 -3
- package/src/api/db/index.ts +0 -27
- package/src/api/db/logs.ts +0 -75
- package/src/api/db/query.ts +0 -67
- package/src/api/db/tables.ts +0 -92
- package/src/api/db/util.ts +0 -9
- package/src/api/eval/get.ts +0 -33
- package/src/api/eval/index.ts +0 -28
- package/src/api/eval/list.ts +0 -49
- package/src/api/eval/run-get.ts +0 -39
- package/src/api/eval/run-list.ts +0 -59
- package/src/api/machine/index.ts +0 -2
- package/src/api/machine/machine.ts +0 -160
- package/src/api/machine/util.ts +0 -5
- package/src/api/org/index.ts +0 -6
- package/src/api/org/list.ts +0 -28
- package/src/api/org/resources.ts +0 -140
- package/src/api/org/util.ts +0 -4
- package/src/api/project/agent.ts +0 -86
- package/src/api/project/create.ts +0 -47
- 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/env-delete.ts +0 -45
- package/src/api/project/env-update.ts +0 -55
- package/src/api/project/exists.ts +0 -58
- package/src/api/project/hostname.ts +0 -73
- package/src/api/project/index.ts +0 -13
- package/src/api/project/update-region.ts +0 -44
- package/src/api/project/util.ts +0 -8
- package/src/api/queue/analytics.ts +0 -311
- package/src/api/queue/destinations.ts +0 -259
- package/src/api/queue/dlq.ts +0 -243
- package/src/api/queue/index.ts +0 -308
- package/src/api/queue/messages.ts +0 -784
- package/src/api/queue/queues.ts +0 -460
- package/src/api/queue/sources.ts +0 -294
- package/src/api/queue/types.ts +0 -1325
- package/src/api/queue/util.ts +0 -278
- package/src/api/queue/validation.ts +0 -560
- package/src/api/queue/websocket.ts +0 -514
- package/src/api/region/delete.ts +0 -57
- package/src/api/region/index.ts +0 -4
- package/src/api/region/list.ts +0 -32
- package/src/api/region/resources.ts +0 -69
- package/src/api/region/util.ts +0 -3
- package/src/api/sandbox/cli-list.ts +0 -127
- 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/resolve.ts +0 -98
- package/src/api/sandbox/run.ts +0 -439
- package/src/api/sandbox/runtime.ts +0 -100
- package/src/api/sandbox/snapshot-build.ts +0 -98
- package/src/api/sandbox/snapshot.ts +0 -781
- 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/session/logs.ts +0 -47
- package/src/api/session/util.ts +0 -3
- package/src/api/storage/config.ts +0 -111
- package/src/api/storage/index.ts +0 -4
- package/src/api/storage/objects.ts +0 -250
- package/src/api/storage/types.ts +0 -174
- package/src/api/storage/util.ts +0 -10
- package/src/api/stream/get.ts +0 -51
- package/src/api/stream/index.ts +0 -3
- package/src/api/stream/list.ts +0 -127
- package/src/api/stream/util.ts +0 -3
- package/src/api/thread/delete.ts +0 -31
- package/src/api/thread/get.ts +0 -34
- package/src/api/thread/index.ts +0 -4
- package/src/api/thread/list.ts +0 -76
- package/src/api/thread/util.ts +0 -3
- package/src/api/user/index.ts +0 -1
- package/src/api/user/util.ts +0 -3
- package/src/api/webhook/deliveries.ts +0 -129
- package/src/api/webhook/destinations.ts +0 -224
- package/src/api/webhook/index.ts +0 -133
- package/src/api/webhook/receipts.ts +0 -124
- package/src/api/webhook/types.ts +0 -309
- package/src/api/webhook/util.ts +0 -237
- package/src/api/webhook/webhooks.ts +0 -260
package/src/api/sandbox/run.ts
DELETED
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@agentuity/core';
|
|
2
|
-
import type { Readable, Writable } from 'node:stream';
|
|
3
|
-
import { PassThrough } from 'node:stream';
|
|
4
|
-
import { APIClient, PaymentRequiredError } from '../api.ts';
|
|
5
|
-
import { sandboxCreate } from './create.ts';
|
|
6
|
-
import { sandboxDestroy } from './destroy.ts';
|
|
7
|
-
import { sandboxGetStatus } from './getStatus.ts';
|
|
8
|
-
import { ExecutionCancelledError, writeAndDrain } from './util.ts';
|
|
9
|
-
import type { SandboxRunOptions, SandboxRunResult } from '@agentuity/core';
|
|
10
|
-
import { getServiceUrls } from '../../config.ts';
|
|
11
|
-
|
|
12
|
-
const timingLogsEnabled = false;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Creates a Writable stream that captures all chunks to a buffer array
|
|
16
|
-
* and optionally tees (forwards) them to one or more user-provided streams.
|
|
17
|
-
*
|
|
18
|
-
* @param chunks - Array to collect Buffer chunks into
|
|
19
|
-
* @param userStreams - Optional user-provided Writable stream(s) to forward chunks to
|
|
20
|
-
* @returns A Writable stream that captures and optionally forwards data
|
|
21
|
-
*/
|
|
22
|
-
function createTeeWritable(chunks: Buffer[], ...userStreams: (Writable | undefined)[]): Writable {
|
|
23
|
-
const tee = new PassThrough();
|
|
24
|
-
|
|
25
|
-
// Always capture chunks to the buffer
|
|
26
|
-
tee.on('data', (chunk: Buffer) => {
|
|
27
|
-
chunks.push(chunk);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Pipe to all provided user streams with proper backpressure handling
|
|
31
|
-
for (const userStream of userStreams) {
|
|
32
|
-
if (userStream) {
|
|
33
|
-
tee.pipe(userStream, { end: false });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return tee;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface SandboxRunParams {
|
|
41
|
-
options: SandboxRunOptions;
|
|
42
|
-
orgId?: string;
|
|
43
|
-
region?: string;
|
|
44
|
-
apiKey?: string;
|
|
45
|
-
signal?: AbortSignal;
|
|
46
|
-
stdin?: Readable;
|
|
47
|
-
stdout?: Writable;
|
|
48
|
-
stderr?: Writable;
|
|
49
|
-
logger?: Logger;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Creates a sandbox, executes a command, and waits for completion.
|
|
54
|
-
*
|
|
55
|
-
* This is a high-level convenience function that handles the full lifecycle:
|
|
56
|
-
* creating a sandbox, streaming I/O, polling for completion, and cleanup.
|
|
57
|
-
*
|
|
58
|
-
* @param client - The API client to use for the request
|
|
59
|
-
* @param params - Parameters including command options, I/O streams, and timeout settings
|
|
60
|
-
* @returns The run result including exit code and duration
|
|
61
|
-
* @throws {SandboxResponseError} If sandbox creation fails, execution times out, or is cancelled
|
|
62
|
-
*/
|
|
63
|
-
export async function sandboxRun(
|
|
64
|
-
client: APIClient,
|
|
65
|
-
params: SandboxRunParams
|
|
66
|
-
): Promise<SandboxRunResult> {
|
|
67
|
-
const { options, orgId, region, apiKey, signal, stdin, stdout, stderr, logger } = params;
|
|
68
|
-
const started = Date.now();
|
|
69
|
-
if (timingLogsEnabled) console.error(`[TIMING] +0ms: sandbox run started`);
|
|
70
|
-
|
|
71
|
-
let stdinStreamId: string | undefined;
|
|
72
|
-
let stdinStreamUrl: string | undefined;
|
|
73
|
-
|
|
74
|
-
// If stdin is provided and has data, create a stream for it
|
|
75
|
-
if (stdin && region && apiKey) {
|
|
76
|
-
const streamResult = await createStdinStream(region, apiKey, orgId, logger);
|
|
77
|
-
stdinStreamId = streamResult.id;
|
|
78
|
-
stdinStreamUrl = streamResult.url;
|
|
79
|
-
logger?.debug('created stdin stream: %s', stdinStreamId);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const createResponse = await sandboxCreate(client, {
|
|
83
|
-
options: {
|
|
84
|
-
...options,
|
|
85
|
-
command: {
|
|
86
|
-
exec: options.command.exec,
|
|
87
|
-
files: options.command.files,
|
|
88
|
-
mode: 'oneshot',
|
|
89
|
-
},
|
|
90
|
-
stream: {
|
|
91
|
-
...options.stream,
|
|
92
|
-
stdin: stdinStreamId,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
orgId,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const sandboxId = createResponse.sandboxId;
|
|
99
|
-
const stdoutStreamUrl = createResponse.stdoutStreamUrl;
|
|
100
|
-
const stderrStreamUrl = createResponse.stderrStreamUrl;
|
|
101
|
-
|
|
102
|
-
logger?.debug(
|
|
103
|
-
'sandbox created: %s, stdoutUrl: %s, stderrUrl: %s',
|
|
104
|
-
sandboxId,
|
|
105
|
-
stdoutStreamUrl ?? 'none',
|
|
106
|
-
stderrStreamUrl ?? 'none'
|
|
107
|
-
);
|
|
108
|
-
if (timingLogsEnabled)
|
|
109
|
-
console.error(`[TIMING] +${Date.now() - started}ms: sandbox created (${sandboxId})`);
|
|
110
|
-
|
|
111
|
-
const abortController = new AbortController();
|
|
112
|
-
const streamPromises: Promise<void>[] = [];
|
|
113
|
-
|
|
114
|
-
// Create capture buffers for stdout/stderr
|
|
115
|
-
const stdoutChunks: Buffer[] = [];
|
|
116
|
-
const stderrChunks: Buffer[] = [];
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
// Start stdin streaming if we have stdin and a stream URL
|
|
120
|
-
if (stdin && stdinStreamUrl && apiKey) {
|
|
121
|
-
const stdinPromise = streamStdinToUrl(
|
|
122
|
-
stdin,
|
|
123
|
-
stdinStreamUrl,
|
|
124
|
-
apiKey,
|
|
125
|
-
abortController.signal,
|
|
126
|
-
logger
|
|
127
|
-
);
|
|
128
|
-
streamPromises.push(stdinPromise);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Check if stdout and stderr are the same stream (combined output)
|
|
132
|
-
const isCombinedOutput =
|
|
133
|
-
stdoutStreamUrl && stderrStreamUrl && stdoutStreamUrl === stderrStreamUrl;
|
|
134
|
-
|
|
135
|
-
if (isCombinedOutput) {
|
|
136
|
-
// Stream combined output to stdout only to avoid duplicates
|
|
137
|
-
if (stdoutStreamUrl) {
|
|
138
|
-
logger?.debug('using combined output stream (stdout === stderr)');
|
|
139
|
-
const teeStream = createTeeWritable(stdoutChunks, stdout);
|
|
140
|
-
const combinedPromise = streamUrlToWritable(
|
|
141
|
-
stdoutStreamUrl,
|
|
142
|
-
teeStream,
|
|
143
|
-
abortController.signal,
|
|
144
|
-
logger,
|
|
145
|
-
started
|
|
146
|
-
);
|
|
147
|
-
streamPromises.push(combinedPromise);
|
|
148
|
-
}
|
|
149
|
-
} else {
|
|
150
|
-
// Start stdout streaming with capture
|
|
151
|
-
if (stdoutStreamUrl) {
|
|
152
|
-
const teeStream = createTeeWritable(stdoutChunks, stdout);
|
|
153
|
-
const stdoutPromise = streamUrlToWritable(
|
|
154
|
-
stdoutStreamUrl,
|
|
155
|
-
teeStream,
|
|
156
|
-
abortController.signal,
|
|
157
|
-
logger,
|
|
158
|
-
started
|
|
159
|
-
);
|
|
160
|
-
streamPromises.push(stdoutPromise);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Start stderr streaming with capture
|
|
164
|
-
if (stderrStreamUrl) {
|
|
165
|
-
const teeStream = createTeeWritable(stderrChunks, stderr);
|
|
166
|
-
const stderrPromise = streamUrlToWritable(
|
|
167
|
-
stderrStreamUrl,
|
|
168
|
-
teeStream,
|
|
169
|
-
abortController.signal,
|
|
170
|
-
logger,
|
|
171
|
-
started
|
|
172
|
-
);
|
|
173
|
-
streamPromises.push(stderrPromise);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Wait for streams to complete — Pulse closes streams on sandbox termination (EOF).
|
|
178
|
-
// This is our primary completion signal; no polling needed.
|
|
179
|
-
logger?.debug('waiting for streams to complete...');
|
|
180
|
-
|
|
181
|
-
if (streamPromises.length > 0) {
|
|
182
|
-
if (signal) {
|
|
183
|
-
// Race streams against abort signal, cleaning up the listener
|
|
184
|
-
// in all cases so an orphaned reject cannot fire after settlement.
|
|
185
|
-
let onAbort: (() => void) | undefined;
|
|
186
|
-
try {
|
|
187
|
-
await Promise.race([
|
|
188
|
-
Promise.allSettled(streamPromises),
|
|
189
|
-
new Promise<never>((_, reject) => {
|
|
190
|
-
onAbort = () => {
|
|
191
|
-
abortController.abort();
|
|
192
|
-
reject(
|
|
193
|
-
new ExecutionCancelledError({
|
|
194
|
-
message: 'Sandbox execution cancelled',
|
|
195
|
-
sandboxId,
|
|
196
|
-
})
|
|
197
|
-
);
|
|
198
|
-
};
|
|
199
|
-
if (signal.aborted) {
|
|
200
|
-
onAbort();
|
|
201
|
-
} else {
|
|
202
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
203
|
-
}
|
|
204
|
-
}),
|
|
205
|
-
]);
|
|
206
|
-
} finally {
|
|
207
|
-
if (onAbort && signal) {
|
|
208
|
-
signal.removeEventListener('abort', onAbort);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
} else {
|
|
212
|
-
await Promise.allSettled(streamPromises);
|
|
213
|
-
}
|
|
214
|
-
} else {
|
|
215
|
-
// No streams available (shouldn't happen for oneshot, but handle defensively).
|
|
216
|
-
// Fall back to a single wait then check.
|
|
217
|
-
logger?.debug('no streams to wait on, checking sandbox status directly');
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
if (timingLogsEnabled)
|
|
221
|
-
console.error(`[TIMING] +${Date.now() - started}ms: all streams done, fetching exit code`);
|
|
222
|
-
logger?.debug('streams completed, fetching final status');
|
|
223
|
-
|
|
224
|
-
// Stream EOF means the sandbox is done — hadron only closes streams after the
|
|
225
|
-
// container exits. Fetch status once for the exit code; if lifecycle events
|
|
226
|
-
// haven't propagated to Catalyst yet, default to exit code 0.
|
|
227
|
-
let exitCode = 0;
|
|
228
|
-
try {
|
|
229
|
-
const sandboxStatus = await sandboxGetStatus(client, { sandboxId, orgId });
|
|
230
|
-
if (sandboxStatus.exitCode != null) {
|
|
231
|
-
exitCode = sandboxStatus.exitCode;
|
|
232
|
-
} else if (sandboxStatus.status === 'failed') {
|
|
233
|
-
exitCode = 1;
|
|
234
|
-
}
|
|
235
|
-
} catch {
|
|
236
|
-
// Sandbox may already be destroyed (fire-and-forget teardown).
|
|
237
|
-
// Stream EOF already confirmed execution completed.
|
|
238
|
-
logger?.debug('sandboxGetStatus failed after stream EOF, using default exit code 0');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (timingLogsEnabled)
|
|
242
|
-
console.error(
|
|
243
|
-
`[TIMING] +${Date.now() - started}ms: sandboxGet complete (exit: ${exitCode})`
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
// Build captured output strings
|
|
247
|
-
const capturedStdout = Buffer.concat(stdoutChunks).toString('utf-8');
|
|
248
|
-
const capturedStderr = isCombinedOutput
|
|
249
|
-
? capturedStdout
|
|
250
|
-
: Buffer.concat(stderrChunks).toString('utf-8');
|
|
251
|
-
|
|
252
|
-
return {
|
|
253
|
-
sandboxId,
|
|
254
|
-
exitCode,
|
|
255
|
-
durationMs: Date.now() - started,
|
|
256
|
-
stdout: capturedStdout,
|
|
257
|
-
stderr: capturedStderr,
|
|
258
|
-
};
|
|
259
|
-
} catch (error) {
|
|
260
|
-
abortController.abort();
|
|
261
|
-
try {
|
|
262
|
-
await sandboxDestroy(client, { sandboxId, orgId });
|
|
263
|
-
} catch {
|
|
264
|
-
// Ignore cleanup errors
|
|
265
|
-
}
|
|
266
|
-
throw error;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
async function createStdinStream(
|
|
271
|
-
region: string,
|
|
272
|
-
apiKey: string,
|
|
273
|
-
orgId?: string,
|
|
274
|
-
logger?: Logger
|
|
275
|
-
): Promise<{ id: string; url: string }> {
|
|
276
|
-
const urls = getServiceUrls(region);
|
|
277
|
-
const streamBaseUrl = urls.stream;
|
|
278
|
-
|
|
279
|
-
// Build URL with orgId query param for CLI token validation
|
|
280
|
-
const queryParams = new URLSearchParams();
|
|
281
|
-
if (orgId) {
|
|
282
|
-
queryParams.set('orgId', orgId);
|
|
283
|
-
}
|
|
284
|
-
const queryString = queryParams.toString();
|
|
285
|
-
const url = `${streamBaseUrl}${queryString ? `?${queryString}` : ''}`;
|
|
286
|
-
logger?.trace('creating stdin stream: %s', url);
|
|
287
|
-
|
|
288
|
-
const response = await fetch(url, {
|
|
289
|
-
method: 'POST',
|
|
290
|
-
headers: {
|
|
291
|
-
'Content-Type': 'application/json',
|
|
292
|
-
Authorization: `Bearer ${apiKey}`,
|
|
293
|
-
},
|
|
294
|
-
body: JSON.stringify({
|
|
295
|
-
name: `sandbox-stdin-${Date.now()}`,
|
|
296
|
-
}),
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
if (!response.ok) {
|
|
300
|
-
if (response.status === 402) {
|
|
301
|
-
throw new PaymentRequiredError({
|
|
302
|
-
url: url,
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
throw new Error(`Failed to create stdin stream: ${response.status} ${response.statusText}`);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const data = (await response.json()) as { id: string };
|
|
309
|
-
logger?.debug('created stdin stream: %s', data.id);
|
|
310
|
-
|
|
311
|
-
// Include orgId in the URL for subsequent PUT requests (needed for CLI token auth)
|
|
312
|
-
const putQueryString = orgId ? `?orgId=${encodeURIComponent(orgId)}` : '';
|
|
313
|
-
return {
|
|
314
|
-
id: data.id,
|
|
315
|
-
url: `${streamBaseUrl}/${data.id}${putQueryString}`,
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
async function streamStdinToUrl(
|
|
320
|
-
stdin: Readable,
|
|
321
|
-
url: string,
|
|
322
|
-
apiKey: string,
|
|
323
|
-
signal: AbortSignal,
|
|
324
|
-
logger?: Logger
|
|
325
|
-
): Promise<void> {
|
|
326
|
-
try {
|
|
327
|
-
logger?.debug('streaming stdin to: %s', url);
|
|
328
|
-
|
|
329
|
-
// Convert Node.js Readable to a web ReadableStream for fetch body
|
|
330
|
-
let controllerClosed = false;
|
|
331
|
-
const webStream = new ReadableStream({
|
|
332
|
-
start(controller) {
|
|
333
|
-
stdin.on('data', (chunk: Buffer) => {
|
|
334
|
-
if (!signal.aborted && !controllerClosed) {
|
|
335
|
-
controller.enqueue(chunk);
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
stdin.on('end', () => {
|
|
339
|
-
if (!controllerClosed) {
|
|
340
|
-
controllerClosed = true;
|
|
341
|
-
controller.close();
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
stdin.on('error', (err) => {
|
|
345
|
-
if (!controllerClosed) {
|
|
346
|
-
controllerClosed = true;
|
|
347
|
-
controller.error(err);
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
signal.addEventListener('abort', () => {
|
|
351
|
-
if (!controllerClosed) {
|
|
352
|
-
controllerClosed = true;
|
|
353
|
-
controller.close();
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
},
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
const response = await fetch(url, {
|
|
360
|
-
method: 'PUT',
|
|
361
|
-
headers: {
|
|
362
|
-
Authorization: `Bearer ${apiKey}`,
|
|
363
|
-
},
|
|
364
|
-
body: webStream,
|
|
365
|
-
signal,
|
|
366
|
-
duplex: 'half',
|
|
367
|
-
} as RequestInit);
|
|
368
|
-
|
|
369
|
-
if (!response.ok) {
|
|
370
|
-
logger?.debug('stdin stream PUT failed: %d', response.status);
|
|
371
|
-
} else {
|
|
372
|
-
logger?.debug('stdin stream completed');
|
|
373
|
-
}
|
|
374
|
-
} catch (err) {
|
|
375
|
-
if (err instanceof Error && err.name === 'AbortError') {
|
|
376
|
-
logger?.debug('stdin stream aborted (expected on completion)');
|
|
377
|
-
} else {
|
|
378
|
-
logger?.debug('stdin stream error: %s', err);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
async function streamUrlToWritable(
|
|
384
|
-
url: string,
|
|
385
|
-
writable: Writable,
|
|
386
|
-
signal: AbortSignal,
|
|
387
|
-
logger?: Logger,
|
|
388
|
-
started?: number
|
|
389
|
-
): Promise<void> {
|
|
390
|
-
try {
|
|
391
|
-
logger?.debug('fetching stream: %s', url);
|
|
392
|
-
const response = await fetch(url, { signal });
|
|
393
|
-
logger?.debug('stream response status: %d', response.status);
|
|
394
|
-
if (timingLogsEnabled && started)
|
|
395
|
-
console.error(
|
|
396
|
-
`[TIMING] +${Date.now() - started}ms: stream response received (status: ${response.status})`
|
|
397
|
-
);
|
|
398
|
-
|
|
399
|
-
if (!response.ok || !response.body) {
|
|
400
|
-
logger?.debug('stream response not ok or no body');
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
const reader = response.body.getReader();
|
|
405
|
-
let firstChunk = true;
|
|
406
|
-
|
|
407
|
-
// Read until EOF - Pulse will block until data is available
|
|
408
|
-
while (true) {
|
|
409
|
-
const { done, value } = await reader.read();
|
|
410
|
-
if (done) {
|
|
411
|
-
logger?.debug('stream EOF');
|
|
412
|
-
if (timingLogsEnabled && started)
|
|
413
|
-
console.error(`[TIMING] +${Date.now() - started}ms: stream EOF`);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (value) {
|
|
418
|
-
if (firstChunk && started) {
|
|
419
|
-
if (timingLogsEnabled)
|
|
420
|
-
console.error(
|
|
421
|
-
`[TIMING] +${Date.now() - started}ms: first chunk (${value.length} bytes)`
|
|
422
|
-
);
|
|
423
|
-
firstChunk = false;
|
|
424
|
-
}
|
|
425
|
-
logger?.debug('stream chunk: %d bytes', value.length);
|
|
426
|
-
await writeAndDrain(writable, value);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
// Signal end-of-stream to the tee/pipe chain so downstream
|
|
430
|
-
// consumers (e.g. process.stdout pipe) know no more data is coming.
|
|
431
|
-
writable.end();
|
|
432
|
-
} catch (err) {
|
|
433
|
-
if (err instanceof Error && err.name === 'AbortError') {
|
|
434
|
-
logger?.debug('stream aborted');
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
logger?.debug('stream error: %s', err);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { ListRuntimesParams, ListRuntimesResponse, SandboxRuntime } from '@agentuity/core';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
4
|
-
import { API_VERSION, throwSandboxError } from './util.ts';
|
|
5
|
-
|
|
6
|
-
export const RuntimeRequirementsSchema = z
|
|
7
|
-
.object({
|
|
8
|
-
memory: z.string().optional().describe('Memory requirement (e.g., "1Gi")'),
|
|
9
|
-
cpu: z.string().optional().describe('CPU requirement (e.g., "1")'),
|
|
10
|
-
disk: z.string().optional().describe('Disk requirement (e.g., "500Mi")'),
|
|
11
|
-
networkEnabled: z.boolean().describe('Whether network access is enabled'),
|
|
12
|
-
})
|
|
13
|
-
.describe('Runtime resource requirements');
|
|
14
|
-
|
|
15
|
-
export const RuntimeInfoSchema = z
|
|
16
|
-
.object({
|
|
17
|
-
id: z.string().describe('Unique runtime identifier'),
|
|
18
|
-
name: z.string().describe('Runtime name (e.g., "bun:1", "python:3.14")'),
|
|
19
|
-
description: z.string().optional().describe('Optional description'),
|
|
20
|
-
iconUrl: z.string().optional().describe('URL for runtime icon'),
|
|
21
|
-
brandColor: z.string().optional().describe('Brand color for the runtime (hex color code)'),
|
|
22
|
-
url: z.string().optional().describe('URL for runtime documentation or homepage'),
|
|
23
|
-
tags: z.array(z.string()).optional().describe('Optional tags for categorization'),
|
|
24
|
-
requirements: RuntimeRequirementsSchema.optional().describe('Runtime resource requirements'),
|
|
25
|
-
readme: z.string().optional().describe('Readme content in markdown format'),
|
|
26
|
-
})
|
|
27
|
-
.describe('Information about a sandbox runtime');
|
|
28
|
-
|
|
29
|
-
export const ListRuntimesDataSchema = z
|
|
30
|
-
.object({
|
|
31
|
-
runtimes: z.array(RuntimeInfoSchema).describe('List of runtime entries'),
|
|
32
|
-
total: z.number().describe('Total number of runtimes'),
|
|
33
|
-
})
|
|
34
|
-
.describe('List of sandbox runtimes');
|
|
35
|
-
|
|
36
|
-
export const ListRuntimesResponseSchema = APIResponseSchema(ListRuntimesDataSchema);
|
|
37
|
-
|
|
38
|
-
export interface RuntimeListParams extends ListRuntimesParams {
|
|
39
|
-
orgId?: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Lists available sandbox runtimes with optional pagination.
|
|
44
|
-
*
|
|
45
|
-
* @param client - The API client to use for the request
|
|
46
|
-
* @param params - Optional parameters for pagination
|
|
47
|
-
* @returns List of runtimes with total count
|
|
48
|
-
* @throws {SandboxResponseError} If the request fails
|
|
49
|
-
*/
|
|
50
|
-
export async function runtimeList(
|
|
51
|
-
client: APIClient,
|
|
52
|
-
params?: RuntimeListParams
|
|
53
|
-
): Promise<ListRuntimesResponse> {
|
|
54
|
-
const queryParams = new URLSearchParams();
|
|
55
|
-
|
|
56
|
-
if (params?.orgId) {
|
|
57
|
-
queryParams.set('orgId', params.orgId);
|
|
58
|
-
}
|
|
59
|
-
if (params?.limit !== undefined) {
|
|
60
|
-
queryParams.set('limit', params.limit.toString());
|
|
61
|
-
}
|
|
62
|
-
if (params?.offset !== undefined) {
|
|
63
|
-
queryParams.set('offset', params.offset.toString());
|
|
64
|
-
}
|
|
65
|
-
if (params?.sort) {
|
|
66
|
-
queryParams.set('sort', params.sort);
|
|
67
|
-
}
|
|
68
|
-
if (params?.direction) {
|
|
69
|
-
queryParams.set('direction', params.direction);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const queryString = queryParams.toString();
|
|
73
|
-
const url = `/sandbox/${API_VERSION}/runtimes${queryString ? `?${queryString}` : ''}`;
|
|
74
|
-
|
|
75
|
-
const resp = await client.get<z.infer<typeof ListRuntimesResponseSchema>>(
|
|
76
|
-
url,
|
|
77
|
-
ListRuntimesResponseSchema
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
if (resp.success) {
|
|
81
|
-
return {
|
|
82
|
-
runtimes: resp.data.runtimes.map(
|
|
83
|
-
(r): SandboxRuntime => ({
|
|
84
|
-
id: r.id,
|
|
85
|
-
name: r.name,
|
|
86
|
-
description: r.description,
|
|
87
|
-
iconUrl: r.iconUrl,
|
|
88
|
-
brandColor: r.brandColor,
|
|
89
|
-
url: r.url,
|
|
90
|
-
tags: r.tags,
|
|
91
|
-
requirements: r.requirements,
|
|
92
|
-
readme: r.readme,
|
|
93
|
-
})
|
|
94
|
-
),
|
|
95
|
-
total: resp.data.total,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
throwSandboxError(resp, {});
|
|
100
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Regex pattern for validating npm/bun package specifiers.
|
|
5
|
-
* Uses a blocklist approach: rejects shell injection characters while allowing
|
|
6
|
-
* all legitimate specifier formats (names, scoped packages, URLs, git refs, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Valid examples: "typescript", "@types/node", "opencode-ai@1.2.3",
|
|
9
|
-
* "https://github.com/user/repo", "git+https://github.com/user/repo.git",
|
|
10
|
-
* "github:user/repo", "file:../local-pkg"
|
|
11
|
-
* Invalid examples: "foo bar", "pkg;rm -rf", "pkg|cat /etc/passwd", "$(evil)"
|
|
12
|
-
*/
|
|
13
|
-
export const NPM_PACKAGE_NAME_PATTERN = /^[^\s;`|$]+$/;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Base schema for snapshot build configuration file (agentuity-snapshot.yaml)
|
|
17
|
-
* This is the canonical schema - used for JSON Schema generation.
|
|
18
|
-
*/
|
|
19
|
-
export const SnapshotBuildFileBaseSchema = z
|
|
20
|
-
.object({
|
|
21
|
-
version: z.literal(1).describe('Schema version, must be 1'),
|
|
22
|
-
runtime: z
|
|
23
|
-
.string()
|
|
24
|
-
.describe('Runtime identifier (name:tag format, e.g., bun:1, node:20, python:3.12)'),
|
|
25
|
-
name: z
|
|
26
|
-
.string()
|
|
27
|
-
.regex(/^[a-zA-Z0-9_-]+$/)
|
|
28
|
-
.optional()
|
|
29
|
-
.describe('Snapshot name (alphanumeric, underscores, dashes only)'),
|
|
30
|
-
description: z.string().optional().describe('Human-readable description of the snapshot'),
|
|
31
|
-
dir: z
|
|
32
|
-
.string()
|
|
33
|
-
.optional()
|
|
34
|
-
.describe(
|
|
35
|
-
'Subdirectory to use as the build context for file resolution (relative to the CLI directory argument)'
|
|
36
|
-
),
|
|
37
|
-
dependencies: z
|
|
38
|
-
.array(z.string())
|
|
39
|
-
.optional()
|
|
40
|
-
.describe(
|
|
41
|
-
'List of apt packages to install. Supports version pinning: package=version or package=version* for prefix matching'
|
|
42
|
-
),
|
|
43
|
-
packages: z
|
|
44
|
-
.array(
|
|
45
|
-
z
|
|
46
|
-
.string()
|
|
47
|
-
.regex(
|
|
48
|
-
NPM_PACKAGE_NAME_PATTERN,
|
|
49
|
-
'Invalid npm/bun package specifier: must not contain whitespace, semicolons, backticks, pipes, or dollar signs'
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
.optional()
|
|
53
|
-
.describe(
|
|
54
|
-
'List of npm/bun packages to install globally via bun install -g. Example: opencode-ai, typescript'
|
|
55
|
-
),
|
|
56
|
-
files: z
|
|
57
|
-
.array(z.string())
|
|
58
|
-
.optional()
|
|
59
|
-
.describe(
|
|
60
|
-
'Glob patterns for files to include from the build context. Supports negative patterns with ! prefix for exclusions'
|
|
61
|
-
),
|
|
62
|
-
env: z
|
|
63
|
-
.record(z.string(), z.string())
|
|
64
|
-
.optional()
|
|
65
|
-
.describe(
|
|
66
|
-
'Environment variables to set. Use ${VAR} syntax for build-time substitution via --env flag'
|
|
67
|
-
),
|
|
68
|
-
metadata: z
|
|
69
|
-
.record(z.string(), z.string())
|
|
70
|
-
.optional()
|
|
71
|
-
.describe(
|
|
72
|
-
'User-defined metadata key-value pairs. Use ${VAR} syntax for build-time substitution via --metadata flag'
|
|
73
|
-
),
|
|
74
|
-
public: z
|
|
75
|
-
.boolean()
|
|
76
|
-
.optional()
|
|
77
|
-
.describe('Whether to make the snapshot publicly accessible (default: false)'),
|
|
78
|
-
})
|
|
79
|
-
.describe('Agentuity Snapshot Build File - defines a reproducible sandbox environment');
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Schema with validation refinement - use this for parsing/validation.
|
|
83
|
-
* Ensures at least one of dependencies, files, env, or packages is specified.
|
|
84
|
-
*/
|
|
85
|
-
export const SnapshotBuildFileSchema = SnapshotBuildFileBaseSchema.refine(
|
|
86
|
-
(data) => {
|
|
87
|
-
const hasDependencies = data.dependencies && data.dependencies.length > 0;
|
|
88
|
-
const hasFiles = data.files && data.files.length > 0;
|
|
89
|
-
const hasEnv = data.env && Object.keys(data.env).length > 0;
|
|
90
|
-
const hasPackages = data.packages && data.packages.length > 0;
|
|
91
|
-
return hasDependencies || hasFiles || hasEnv || hasPackages;
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
message: 'At least one of dependencies, files, env, or packages must be specified',
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
export type SnapshotBuildFile = z.infer<typeof SnapshotBuildFileSchema>;
|