@agentuity/cli 1.0.22 → 1.0.24
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/auth.d.ts.map +1 -1
- package/dist/auth.js +7 -0
- package/dist/auth.js.map +1 -1
- package/dist/cache/resource-region.d.ts +1 -1
- package/dist/cache/resource-region.d.ts.map +1 -1
- package/dist/cache/resource-region.js.map +1 -1
- package/dist/cmd/ai/claude-code/install.d.ts.map +1 -1
- package/dist/cmd/ai/claude-code/install.js +0 -1
- package/dist/cmd/ai/claude-code/install.js.map +1 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts +4 -2
- package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +1 -1
- package/dist/cmd/build/vite/public-asset-path-plugin.js +18 -4
- package/dist/cmd/build/vite/public-asset-path-plugin.js.map +1 -1
- package/dist/cmd/cloud/db/index.d.ts.map +1 -1
- package/dist/cmd/cloud/db/index.js +2 -0
- package/dist/cmd/cloud/db/index.js.map +1 -1
- package/dist/cmd/cloud/db/stats.d.ts +3 -0
- package/dist/cmd/cloud/db/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/db/stats.js +66 -0
- package/dist/cmd/cloud/db/stats.js.map +1 -0
- package/dist/cmd/cloud/email/create.d.ts +3 -0
- package/dist/cmd/cloud/email/create.d.ts.map +1 -0
- package/dist/cmd/cloud/email/create.js +66 -0
- package/dist/cmd/cloud/email/create.js.map +1 -0
- package/dist/cmd/cloud/email/delete.d.ts +3 -0
- package/dist/cmd/cloud/email/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/email/delete.js +47 -0
- package/dist/cmd/cloud/email/delete.js.map +1 -0
- package/dist/cmd/cloud/email/destination/delete.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/delete.js +54 -0
- package/dist/cmd/cloud/email/destination/delete.js.map +1 -0
- package/dist/cmd/cloud/email/destination/index.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/index.js +14 -0
- package/dist/cmd/cloud/email/destination/index.js.map +1 -0
- package/dist/cmd/cloud/email/destination/list.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/list.js +39 -0
- package/dist/cmd/cloud/email/destination/list.js.map +1 -0
- package/dist/cmd/cloud/email/destination/schemas.d.ts +9 -0
- package/dist/cmd/cloud/email/destination/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/schemas.js +9 -0
- package/dist/cmd/cloud/email/destination/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/destination/url.d.ts +3 -0
- package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -0
- package/dist/cmd/cloud/email/destination/url.js +65 -0
- package/dist/cmd/cloud/email/destination/url.js.map +1 -0
- package/dist/cmd/cloud/email/get.d.ts +3 -0
- package/dist/cmd/cloud/email/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/get.js +43 -0
- package/dist/cmd/cloud/email/get.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/get.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/get.js +43 -0
- package/dist/cmd/cloud/email/inbound/get.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/index.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/index.js +12 -0
- package/dist/cmd/cloud/email/inbound/index.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/list.d.ts +3 -0
- package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/list.js +41 -0
- package/dist/cmd/cloud/email/inbound/list.js.map +1 -0
- package/dist/cmd/cloud/email/inbound/schemas.d.ts +13 -0
- package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/inbound/schemas.js +13 -0
- package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/index.d.ts +3 -0
- package/dist/cmd/cloud/email/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/index.js +30 -0
- package/dist/cmd/cloud/email/index.js.map +1 -0
- package/dist/cmd/cloud/email/list.d.ts +3 -0
- package/dist/cmd/cloud/email/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/list.js +44 -0
- package/dist/cmd/cloud/email/list.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/get.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/get.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/get.js +45 -0
- package/dist/cmd/cloud/email/outbound/get.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/index.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/index.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/index.js +12 -0
- package/dist/cmd/cloud/email/outbound/index.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/list.d.ts +3 -0
- package/dist/cmd/cloud/email/outbound/list.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/list.js +43 -0
- package/dist/cmd/cloud/email/outbound/list.js.map +1 -0
- package/dist/cmd/cloud/email/outbound/schemas.d.ts +15 -0
- package/dist/cmd/cloud/email/outbound/schemas.d.ts.map +1 -0
- package/dist/cmd/cloud/email/outbound/schemas.js +15 -0
- package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -0
- package/dist/cmd/cloud/email/send.d.ts +3 -0
- package/dist/cmd/cloud/email/send.d.ts.map +1 -0
- package/dist/cmd/cloud/email/send.js +75 -0
- package/dist/cmd/cloud/email/send.js.map +1 -0
- package/dist/cmd/cloud/email/stats.d.ts +3 -0
- package/dist/cmd/cloud/email/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/email/stats.js +65 -0
- package/dist/cmd/cloud/email/stats.js.map +1 -0
- package/dist/cmd/cloud/email/util.d.ts +23 -0
- package/dist/cmd/cloud/email/util.d.ts.map +1 -0
- package/dist/cmd/cloud/email/util.js +42 -0
- package/dist/cmd/cloud/email/util.js.map +1 -0
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +10 -0
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/queue/get.js +4 -4
- package/dist/cmd/cloud/queue/get.js.map +1 -1
- package/dist/cmd/cloud/queue/receive.d.ts.map +1 -1
- package/dist/cmd/cloud/queue/receive.js +11 -7
- package/dist/cmd/cloud/queue/receive.js.map +1 -1
- package/dist/cmd/cloud/queue/stats.js +3 -3
- package/dist/cmd/cloud/queue/stats.js.map +1 -1
- package/dist/cmd/cloud/region-lookup.d.ts +1 -1
- package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
- package/dist/cmd/cloud/region-lookup.js +44 -2
- package/dist/cmd/cloud/region-lookup.js.map +1 -1
- package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.js +71 -0
- package/dist/cmd/cloud/sandbox/checkpoint/create.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.js +78 -0
- package/dist/cmd/cloud/sandbox/checkpoint/delete.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts +2 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.js +33 -0
- package/dist/cmd/cloud/sandbox/checkpoint/index.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.js +72 -0
- package/dist/cmd/cloud/sandbox/checkpoint/list.js.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.js +61 -0
- package/dist/cmd/cloud/sandbox/checkpoint/restore.js.map +1 -0
- package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/get.js +5 -3
- package/dist/cmd/cloud/sandbox/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/index.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/index.js +4 -0
- package/dist/cmd/cloud/sandbox/index.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.d.ts +7 -0
- package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js +55 -37
- package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.js +5 -1
- package/dist/cmd/cloud/sandbox/snapshot/generate.js.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/get.js +3 -3
- package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
- package/dist/cmd/cloud/sandbox/stats.d.ts +3 -0
- package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/sandbox/stats.js +72 -0
- package/dist/cmd/cloud/sandbox/stats.js.map +1 -0
- package/dist/cmd/cloud/schedule/create.d.ts +3 -0
- package/dist/cmd/cloud/schedule/create.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/create.js +71 -0
- package/dist/cmd/cloud/schedule/create.js.map +1 -0
- package/dist/cmd/cloud/schedule/delete.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delete.js +37 -0
- package/dist/cmd/cloud/schedule/delete.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/get.js +77 -0
- package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/index.js +23 -0
- package/dist/cmd/cloud/schedule/delivery/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/delivery/list.js +66 -0
- package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/create.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/create.js +100 -0
- package/dist/cmd/cloud/schedule/destination/create.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/delete.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/delete.js +40 -0
- package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/get.js +59 -0
- package/dist/cmd/cloud/schedule/destination/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/index.js +26 -0
- package/dist/cmd/cloud/schedule/destination/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/destination/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/destination/list.js +62 -0
- package/dist/cmd/cloud/schedule/destination/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/get.d.ts +3 -0
- package/dist/cmd/cloud/schedule/get.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/get.js +80 -0
- package/dist/cmd/cloud/schedule/get.js.map +1 -0
- package/dist/cmd/cloud/schedule/index.d.ts +3 -0
- package/dist/cmd/cloud/schedule/index.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/index.js +37 -0
- package/dist/cmd/cloud/schedule/index.js.map +1 -0
- package/dist/cmd/cloud/schedule/list.d.ts +3 -0
- package/dist/cmd/cloud/schedule/list.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/list.js +59 -0
- package/dist/cmd/cloud/schedule/list.js.map +1 -0
- package/dist/cmd/cloud/schedule/stats.d.ts +3 -0
- package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/stats.js +64 -0
- package/dist/cmd/cloud/schedule/stats.js.map +1 -0
- package/dist/cmd/cloud/schedule/update.d.ts +3 -0
- package/dist/cmd/cloud/schedule/update.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/update.js +65 -0
- package/dist/cmd/cloud/schedule/update.js.map +1 -0
- package/dist/cmd/cloud/schedule/util.d.ts +10 -0
- package/dist/cmd/cloud/schedule/util.d.ts.map +1 -0
- package/dist/cmd/cloud/schedule/util.js +17 -0
- package/dist/cmd/cloud/schedule/util.js.map +1 -0
- package/dist/cmd/cloud/services/index.d.ts +3 -0
- package/dist/cmd/cloud/services/index.d.ts.map +1 -0
- package/dist/cmd/cloud/services/index.js +10 -0
- package/dist/cmd/cloud/services/index.js.map +1 -0
- package/dist/cmd/cloud/services/stats.d.ts +3 -0
- package/dist/cmd/cloud/services/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/services/stats.js +153 -0
- package/dist/cmd/cloud/services/stats.js.map +1 -0
- package/dist/cmd/cloud/stream/index.d.ts.map +1 -1
- package/dist/cmd/cloud/stream/index.js +2 -1
- package/dist/cmd/cloud/stream/index.js.map +1 -1
- package/dist/cmd/cloud/stream/stats.d.ts +3 -0
- package/dist/cmd/cloud/stream/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/stream/stats.js +64 -0
- package/dist/cmd/cloud/stream/stats.js.map +1 -0
- package/dist/cmd/cloud/task/create.d.ts +3 -0
- package/dist/cmd/cloud/task/create.d.ts.map +1 -0
- package/dist/cmd/cloud/task/create.js +107 -0
- package/dist/cmd/cloud/task/create.js.map +1 -0
- package/dist/cmd/cloud/task/get.d.ts +3 -0
- package/dist/cmd/cloud/task/get.d.ts.map +1 -0
- package/dist/cmd/cloud/task/get.js +125 -0
- package/dist/cmd/cloud/task/get.js.map +1 -0
- package/dist/cmd/cloud/task/index.d.ts +3 -0
- package/dist/cmd/cloud/task/index.d.ts.map +1 -0
- package/dist/cmd/cloud/task/index.js +34 -0
- package/dist/cmd/cloud/task/index.js.map +1 -0
- package/dist/cmd/cloud/task/list.d.ts +3 -0
- package/dist/cmd/cloud/task/list.d.ts.map +1 -0
- package/dist/cmd/cloud/task/list.js +173 -0
- package/dist/cmd/cloud/task/list.js.map +1 -0
- package/dist/cmd/cloud/task/stats.d.ts +3 -0
- package/dist/cmd/cloud/task/stats.d.ts.map +1 -0
- package/dist/cmd/cloud/task/stats.js +66 -0
- package/dist/cmd/cloud/task/stats.js.map +1 -0
- package/dist/cmd/cloud/task/update.d.ts +3 -0
- package/dist/cmd/cloud/task/update.d.ts.map +1 -0
- package/dist/cmd/cloud/task/update.js +117 -0
- package/dist/cmd/cloud/task/update.js.map +1 -0
- package/dist/cmd/cloud/task/util.d.ts +15 -0
- package/dist/cmd/cloud/task/util.d.ts.map +1 -0
- package/dist/cmd/cloud/task/util.js +41 -0
- package/dist/cmd/cloud/task/util.js.map +1 -0
- package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/get.js +17 -12
- package/dist/cmd/cloud/vector/get.js.map +1 -1
- package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
- package/dist/cmd/cloud/vector/stats.js +10 -7
- package/dist/cmd/cloud/vector/stats.js.map +1 -1
- package/dist/cmd/cloud/webhook/create.d.ts +3 -0
- package/dist/cmd/cloud/webhook/create.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/create.js +54 -0
- package/dist/cmd/cloud/webhook/create.js.map +1 -0
- package/dist/cmd/cloud/webhook/delete.d.ts +3 -0
- package/dist/cmd/cloud/webhook/delete.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/delete.js +50 -0
- package/dist/cmd/cloud/webhook/delete.js.map +1 -0
- package/dist/cmd/cloud/webhook/deliveries.d.ts +3 -0
- package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/deliveries.js +129 -0
- package/dist/cmd/cloud/webhook/deliveries.js.map +1 -0
- package/dist/cmd/cloud/webhook/destinations.d.ts +3 -0
- package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/destinations.js +223 -0
- package/dist/cmd/cloud/webhook/destinations.js.map +1 -0
- package/dist/cmd/cloud/webhook/get.d.ts +3 -0
- package/dist/cmd/cloud/webhook/get.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/get.js +50 -0
- package/dist/cmd/cloud/webhook/get.js.map +1 -0
- package/dist/cmd/cloud/webhook/index.d.ts +3 -0
- package/dist/cmd/cloud/webhook/index.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/index.js +45 -0
- package/dist/cmd/cloud/webhook/index.js.map +1 -0
- package/dist/cmd/cloud/webhook/list.d.ts +3 -0
- package/dist/cmd/cloud/webhook/list.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/list.js +72 -0
- package/dist/cmd/cloud/webhook/list.js.map +1 -0
- package/dist/cmd/cloud/webhook/receipts.d.ts +3 -0
- package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/receipts.js +144 -0
- package/dist/cmd/cloud/webhook/receipts.js.map +1 -0
- package/dist/cmd/cloud/webhook/util.d.ts +27 -0
- package/dist/cmd/cloud/webhook/util.d.ts.map +1 -0
- package/dist/cmd/cloud/webhook/util.js +20 -0
- package/dist/cmd/cloud/webhook/util.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/tui.d.ts +4 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +8 -0
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +10 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/dist/version-check.d.ts.map +1 -1
- package/dist/version-check.js +18 -3
- package/dist/version-check.js.map +1 -1
- package/package.json +6 -6
- package/src/auth.ts +7 -0
- package/src/cache/resource-region.ts +4 -1
- package/src/cmd/ai/claude-code/install.ts +0 -3
- package/src/cmd/build/vite/public-asset-path-plugin.ts +18 -4
- package/src/cmd/cloud/db/index.ts +2 -0
- package/src/cmd/cloud/db/stats.ts +80 -0
- package/src/cmd/cloud/email/create.ts +80 -0
- package/src/cmd/cloud/email/delete.ts +53 -0
- package/src/cmd/cloud/email/destination/delete.ts +65 -0
- package/src/cmd/cloud/email/destination/index.ts +15 -0
- package/src/cmd/cloud/email/destination/list.ts +46 -0
- package/src/cmd/cloud/email/destination/schemas.ts +9 -0
- package/src/cmd/cloud/email/destination/url.ts +76 -0
- package/src/cmd/cloud/email/get.ts +52 -0
- package/src/cmd/cloud/email/inbound/get.ts +52 -0
- package/src/cmd/cloud/email/inbound/index.ts +13 -0
- package/src/cmd/cloud/email/inbound/list.ts +48 -0
- package/src/cmd/cloud/email/inbound/schemas.ts +13 -0
- package/src/cmd/cloud/email/index.ts +31 -0
- package/src/cmd/cloud/email/list.ts +51 -0
- package/src/cmd/cloud/email/outbound/get.ts +54 -0
- package/src/cmd/cloud/email/outbound/index.ts +13 -0
- package/src/cmd/cloud/email/outbound/list.ts +50 -0
- package/src/cmd/cloud/email/outbound/schemas.ts +15 -0
- package/src/cmd/cloud/email/send.ts +89 -0
- package/src/cmd/cloud/email/stats.ts +77 -0
- package/src/cmd/cloud/email/util.ts +70 -0
- package/src/cmd/cloud/index.ts +10 -0
- package/src/cmd/cloud/queue/get.ts +4 -4
- package/src/cmd/cloud/queue/receive.ts +15 -7
- package/src/cmd/cloud/queue/stats.ts +3 -3
- package/src/cmd/cloud/region-lookup.ts +58 -2
- package/src/cmd/cloud/sandbox/checkpoint/create.ts +85 -0
- package/src/cmd/cloud/sandbox/checkpoint/delete.ts +93 -0
- package/src/cmd/cloud/sandbox/checkpoint/index.ts +33 -0
- package/src/cmd/cloud/sandbox/checkpoint/list.ts +83 -0
- package/src/cmd/cloud/sandbox/checkpoint/restore.ts +72 -0
- package/src/cmd/cloud/sandbox/get.ts +6 -3
- package/src/cmd/cloud/sandbox/index.ts +4 -0
- package/src/cmd/cloud/sandbox/snapshot/build.ts +68 -64
- package/src/cmd/cloud/sandbox/snapshot/generate.ts +5 -1
- package/src/cmd/cloud/sandbox/snapshot/get.ts +3 -3
- package/src/cmd/cloud/sandbox/stats.ts +86 -0
- package/src/cmd/cloud/schedule/create.ts +82 -0
- package/src/cmd/cloud/schedule/delete.ts +42 -0
- package/src/cmd/cloud/schedule/delivery/get.ts +84 -0
- package/src/cmd/cloud/schedule/delivery/index.ts +24 -0
- package/src/cmd/cloud/schedule/delivery/list.ts +81 -0
- package/src/cmd/cloud/schedule/destination/create.ts +114 -0
- package/src/cmd/cloud/schedule/destination/delete.ts +45 -0
- package/src/cmd/cloud/schedule/destination/get.ts +66 -0
- package/src/cmd/cloud/schedule/destination/index.ts +27 -0
- package/src/cmd/cloud/schedule/destination/list.ts +77 -0
- package/src/cmd/cloud/schedule/get.ts +97 -0
- package/src/cmd/cloud/schedule/index.ts +38 -0
- package/src/cmd/cloud/schedule/list.ts +77 -0
- package/src/cmd/cloud/schedule/stats.ts +74 -0
- package/src/cmd/cloud/schedule/update.ts +74 -0
- package/src/cmd/cloud/schedule/util.ts +29 -0
- package/src/cmd/cloud/services/index.ts +11 -0
- package/src/cmd/cloud/services/stats.ts +225 -0
- package/src/cmd/cloud/stream/index.ts +2 -1
- package/src/cmd/cloud/stream/stats.ts +74 -0
- package/src/cmd/cloud/task/create.ts +123 -0
- package/src/cmd/cloud/task/get.ts +139 -0
- package/src/cmd/cloud/task/index.ts +35 -0
- package/src/cmd/cloud/task/list.ts +190 -0
- package/src/cmd/cloud/task/stats.ts +74 -0
- package/src/cmd/cloud/task/update.ts +122 -0
- package/src/cmd/cloud/task/util.ts +62 -0
- package/src/cmd/cloud/vector/get.ts +16 -11
- package/src/cmd/cloud/vector/stats.ts +10 -8
- package/src/cmd/cloud/webhook/create.ts +66 -0
- package/src/cmd/cloud/webhook/delete.ts +57 -0
- package/src/cmd/cloud/webhook/deliveries.ts +162 -0
- package/src/cmd/cloud/webhook/destinations.ts +287 -0
- package/src/cmd/cloud/webhook/get.ts +59 -0
- package/src/cmd/cloud/webhook/index.ts +46 -0
- package/src/cmd/cloud/webhook/list.ts +82 -0
- package/src/cmd/cloud/webhook/receipts.ts +170 -0
- package/src/cmd/cloud/webhook/util.ts +35 -0
- package/src/tui.ts +9 -0
- package/src/types.ts +3 -1
- package/src/version-check.ts +22 -3
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import * as tui from '../../../../tui';
|
|
8
|
-
import { ErrorCode } from '../../../../errors';
|
|
9
|
-
import { getCommand } from '../../../../command-prefix';
|
|
1
|
+
import { createHash, createPublicKey, randomUUID } from 'node:crypto';
|
|
2
|
+
import { createReadStream, createWriteStream, existsSync, statSync } from 'node:fs';
|
|
3
|
+
import { rm } from 'node:fs/promises';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { extname, isAbsolute, join, resolve } from 'node:path';
|
|
6
|
+
import type { SnapshotBuildGitInfo, SnapshotFileInfo } from '@agentuity/server';
|
|
10
7
|
import {
|
|
11
|
-
|
|
8
|
+
NPM_PACKAGE_NAME_PATTERN,
|
|
9
|
+
SnapshotBuildFileSchema,
|
|
12
10
|
snapshotBuildFinalize,
|
|
11
|
+
snapshotBuildInit,
|
|
13
12
|
snapshotUpload,
|
|
14
|
-
SnapshotBuildFileSchema,
|
|
15
|
-
NPM_PACKAGE_NAME_PATTERN,
|
|
16
13
|
} from '@agentuity/server';
|
|
17
|
-
import
|
|
14
|
+
import { YAML } from 'bun';
|
|
15
|
+
import * as tar from 'tar';
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { getCommand } from '../../../../command-prefix';
|
|
18
18
|
import { getCatalystAPIClient } from '../../../../config';
|
|
19
|
+
import { encryptFIPSKEMDEMStream } from '../../../../crypto/box';
|
|
20
|
+
import { ErrorCode } from '../../../../errors';
|
|
21
|
+
import * as tui from '../../../../tui';
|
|
22
|
+
import { createCommand } from '../../../../types';
|
|
19
23
|
import { validateAptDependencies } from '../../../../utils/apt-validator';
|
|
20
24
|
import { getGitInfo, mergeGitInfo } from '../../../../utils/git';
|
|
21
|
-
import { encryptFIPSKEMDEMStream } from '../../../../crypto/box';
|
|
22
|
-
import { tmpdir } from 'node:os';
|
|
23
|
-
import { randomUUID, createHash, createPublicKey } from 'node:crypto';
|
|
24
|
-
import { rm } from 'node:fs/promises';
|
|
25
25
|
|
|
26
26
|
export const SNAPSHOT_TAG_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
27
27
|
export const MAX_SNAPSHOT_TAG_LENGTH = 128;
|
|
@@ -175,9 +175,9 @@ function substituteVariables(
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// Default patterns that are always excluded from snapshot builds
|
|
178
|
-
const DEFAULT_EXCLUSIONS = ['.git', '.git/**', 'node_modules/**', '.agentuity/**', '.env*'];
|
|
178
|
+
export const DEFAULT_EXCLUSIONS = ['.git', '.git/**', 'node_modules/**', '.agentuity/**', '.env*'];
|
|
179
179
|
|
|
180
|
-
async function resolveFileGlobs(
|
|
180
|
+
export async function resolveFileGlobs(
|
|
181
181
|
directory: string,
|
|
182
182
|
patterns: string[]
|
|
183
183
|
): Promise<Map<string, FileEntry>> {
|
|
@@ -206,9 +206,9 @@ async function resolveFileGlobs(
|
|
|
206
206
|
size: stat.size,
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
} catch {
|
|
209
|
+
} catch (err) {
|
|
210
210
|
// Skip files that can't be stat'd (broken symlinks, permission issues, etc.)
|
|
211
|
-
|
|
211
|
+
console.debug(`Skipping ${file}: ${err instanceof Error ? err.message : err}`);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
@@ -358,9 +358,7 @@ export const buildSubcommand = createCommand({
|
|
|
358
358
|
description: 'Build using a custom build file',
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
command: getCommand(
|
|
362
|
-
'cloud sandbox snapshot build . --env API_KEY=secret --tag production'
|
|
363
|
-
),
|
|
361
|
+
command: getCommand('cloud sandbox snapshot build . --env API_KEY=secret --tag production'),
|
|
364
362
|
description: 'Build with environment variable substitution and custom tag',
|
|
365
363
|
},
|
|
366
364
|
{
|
|
@@ -381,10 +379,7 @@ export const buildSubcommand = createCommand({
|
|
|
381
379
|
.string()
|
|
382
380
|
.optional()
|
|
383
381
|
.describe('Path to build file (defaults to agentuity-snapshot.[json|yaml|yml])'),
|
|
384
|
-
env: z
|
|
385
|
-
.array(z.string())
|
|
386
|
-
.optional()
|
|
387
|
-
.describe('Environment variable substitution (KEY=VALUE)'),
|
|
382
|
+
env: z.array(z.string()).optional().describe('Environment variable substitution (KEY=VALUE)'),
|
|
388
383
|
name: z.string().optional().describe('Snapshot name (overrides build file)'),
|
|
389
384
|
tag: z.string().optional().describe('Snapshot tag (defaults to "latest")'),
|
|
390
385
|
description: z.string().optional().describe('Snapshot description (overrides build file)'),
|
|
@@ -416,7 +411,7 @@ export const buildSubcommand = createCommand({
|
|
|
416
411
|
|
|
417
412
|
const dryRun = options.dryRun === true;
|
|
418
413
|
|
|
419
|
-
|
|
414
|
+
let directory = resolve(args.directory);
|
|
420
415
|
if (!existsSync(directory)) {
|
|
421
416
|
logger.fatal(`Directory not found: ${directory}`);
|
|
422
417
|
}
|
|
@@ -475,6 +470,29 @@ export const buildSubcommand = createCommand({
|
|
|
475
470
|
|
|
476
471
|
const buildConfig = validationResult.data;
|
|
477
472
|
|
|
473
|
+
// If dir is specified in the build file, use it as the effective build context
|
|
474
|
+
if (buildConfig.dir) {
|
|
475
|
+
if (isAbsolute(buildConfig.dir)) {
|
|
476
|
+
logger.fatal(`'dir' must be a relative path, got: ${buildConfig.dir}`);
|
|
477
|
+
}
|
|
478
|
+
const dirPath = resolve(directory, buildConfig.dir);
|
|
479
|
+
if (!dirPath.startsWith(`${directory}/`) && dirPath !== directory) {
|
|
480
|
+
logger.fatal(`'dir' resolves outside the build root: ${dirPath}`);
|
|
481
|
+
}
|
|
482
|
+
let isDir = false;
|
|
483
|
+
try {
|
|
484
|
+
isDir = statSync(dirPath).isDirectory();
|
|
485
|
+
} catch {
|
|
486
|
+
// path does not exist
|
|
487
|
+
}
|
|
488
|
+
if (!isDir) {
|
|
489
|
+
logger.fatal(
|
|
490
|
+
`Build context directory not found or is not a directory: ${dirPath} (specified by 'dir: ${buildConfig.dir}' in build file)`
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
directory = dirPath;
|
|
494
|
+
}
|
|
495
|
+
|
|
478
496
|
// Determine if snapshot is public: CLI flag takes precedence, otherwise use build file
|
|
479
497
|
const isPublic =
|
|
480
498
|
opts.public === true || (opts.public === undefined && buildConfig.public === true);
|
|
@@ -483,21 +501,21 @@ export const buildSubcommand = createCommand({
|
|
|
483
501
|
if (!opts.confirm) {
|
|
484
502
|
if (!tui.isTTYLike()) {
|
|
485
503
|
logger.fatal(
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
504
|
+
'Publishing a public snapshot requires confirmation.\n\n' +
|
|
505
|
+
'Public snapshots make all environment variables and files publicly accessible.\n\n' +
|
|
506
|
+
'To proceed, add the --confirm flag:\n' +
|
|
489
507
|
` ${getCommand('cloud sandbox snapshot build . --public --confirm')}\n\n` +
|
|
490
|
-
|
|
508
|
+
'To preview what will be published, use --dry-run first:\n' +
|
|
491
509
|
` ${getCommand('cloud sandbox snapshot build . --public --dry-run')}`
|
|
492
510
|
);
|
|
493
511
|
}
|
|
494
512
|
|
|
495
513
|
tui.warningBox(
|
|
496
514
|
'Public Snapshot',
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
515
|
+
'You are publishing a public snapshot.\n\n' +
|
|
516
|
+
'This will make all environment variables and\n' +
|
|
517
|
+
'files in the snapshot publicly accessible.\n\n' +
|
|
518
|
+
'Run with --dry-run to preview the contents.'
|
|
501
519
|
);
|
|
502
520
|
console.log('');
|
|
503
521
|
|
|
@@ -511,9 +529,7 @@ export const buildSubcommand = createCommand({
|
|
|
511
529
|
|
|
512
530
|
if (opts.tag) {
|
|
513
531
|
if (opts.tag.length > MAX_SNAPSHOT_TAG_LENGTH) {
|
|
514
|
-
logger.fatal(
|
|
515
|
-
`Invalid snapshot tag: must be at most ${MAX_SNAPSHOT_TAG_LENGTH} characters`
|
|
516
|
-
);
|
|
532
|
+
logger.fatal(`Invalid snapshot tag: must be at most ${MAX_SNAPSHOT_TAG_LENGTH} characters`);
|
|
517
533
|
}
|
|
518
534
|
if (!SNAPSHOT_TAG_REGEX.test(opts.tag)) {
|
|
519
535
|
logger.fatal(
|
|
@@ -560,12 +576,7 @@ export const buildSubcommand = createCommand({
|
|
|
560
576
|
message: 'Validating apt dependencies...',
|
|
561
577
|
type: 'simple',
|
|
562
578
|
callback: async () => {
|
|
563
|
-
return await validateAptDependencies(
|
|
564
|
-
buildConfig.dependencies!,
|
|
565
|
-
region,
|
|
566
|
-
config,
|
|
567
|
-
logger
|
|
568
|
-
);
|
|
579
|
+
return await validateAptDependencies(buildConfig.dependencies!, region, config, logger);
|
|
569
580
|
},
|
|
570
581
|
});
|
|
571
582
|
|
|
@@ -665,7 +676,7 @@ export const buildSubcommand = createCommand({
|
|
|
665
676
|
|
|
666
677
|
if (buildConfig.dependencies && buildConfig.dependencies.length > 0) {
|
|
667
678
|
console.log('');
|
|
668
|
-
tui.
|
|
679
|
+
tui.header('Dependencies');
|
|
669
680
|
for (const dep of buildConfig.dependencies) {
|
|
670
681
|
console.log(` ${tui.muted('•')} ${dep}`);
|
|
671
682
|
}
|
|
@@ -673,7 +684,7 @@ export const buildSubcommand = createCommand({
|
|
|
673
684
|
|
|
674
685
|
if (buildConfig.packages && buildConfig.packages.length > 0) {
|
|
675
686
|
console.log('');
|
|
676
|
-
tui.
|
|
687
|
+
tui.header('Packages (npm/bun)');
|
|
677
688
|
for (const pkg of buildConfig.packages) {
|
|
678
689
|
console.log(` ${tui.muted('•')} ${pkg}`);
|
|
679
690
|
}
|
|
@@ -681,7 +692,7 @@ export const buildSubcommand = createCommand({
|
|
|
681
692
|
|
|
682
693
|
if (finalEnv && Object.keys(finalEnv).length > 0) {
|
|
683
694
|
console.log('');
|
|
684
|
-
tui.
|
|
695
|
+
tui.header('Environment');
|
|
685
696
|
for (const [envKey, envValue] of Object.entries(finalEnv)) {
|
|
686
697
|
console.log(` ${tui.muted('•')} ${envKey}=${tui.maskSecret(envValue)}`);
|
|
687
698
|
}
|
|
@@ -689,7 +700,7 @@ export const buildSubcommand = createCommand({
|
|
|
689
700
|
|
|
690
701
|
if (fileList.length > 0) {
|
|
691
702
|
console.log('');
|
|
692
|
-
tui.
|
|
703
|
+
tui.header('Files');
|
|
693
704
|
printFileTree(fileList);
|
|
694
705
|
}
|
|
695
706
|
}
|
|
@@ -879,11 +890,7 @@ export const buildSubcommand = createCommand({
|
|
|
879
890
|
clearOnError: true,
|
|
880
891
|
callback: async (updateProgress) => {
|
|
881
892
|
const uploadFile = Bun.file(uploadPath);
|
|
882
|
-
const progressStream = createProgressStream(
|
|
883
|
-
uploadFile,
|
|
884
|
-
uploadSize,
|
|
885
|
-
updateProgress
|
|
886
|
-
);
|
|
893
|
+
const progressStream = createProgressStream(uploadFile, uploadSize, updateProgress);
|
|
887
894
|
await snapshotUpload(client, {
|
|
888
895
|
snapshotId: initResult.snapshotId!,
|
|
889
896
|
body: progressStream,
|
|
@@ -926,10 +933,7 @@ export const buildSubcommand = createCommand({
|
|
|
926
933
|
'Malware Detected',
|
|
927
934
|
`Your snapshot was rejected because it contains malware.\n\nVirus: ${virusName}\n\nPlease remove the infected files and try again.`
|
|
928
935
|
);
|
|
929
|
-
tui.fatal(
|
|
930
|
-
'Snapshot build failed due to malware detection',
|
|
931
|
-
ErrorCode.MALWARE_DETECTED
|
|
932
|
-
);
|
|
936
|
+
tui.fatal('Snapshot build failed due to malware detection', ErrorCode.MALWARE_DETECTED);
|
|
933
937
|
}
|
|
934
938
|
|
|
935
939
|
throw err;
|
|
@@ -976,7 +980,7 @@ export const buildSubcommand = createCommand({
|
|
|
976
980
|
|
|
977
981
|
if (buildConfig.dependencies && buildConfig.dependencies.length > 0) {
|
|
978
982
|
console.log('');
|
|
979
|
-
tui.
|
|
983
|
+
tui.header('Dependencies');
|
|
980
984
|
for (const dep of buildConfig.dependencies) {
|
|
981
985
|
console.log(` ${tui.muted('•')} ${dep}`);
|
|
982
986
|
}
|
|
@@ -984,7 +988,7 @@ export const buildSubcommand = createCommand({
|
|
|
984
988
|
|
|
985
989
|
if (buildConfig.packages && buildConfig.packages.length > 0) {
|
|
986
990
|
console.log('');
|
|
987
|
-
tui.
|
|
991
|
+
tui.header('Packages (npm/bun)');
|
|
988
992
|
for (const pkg of buildConfig.packages) {
|
|
989
993
|
console.log(` ${tui.muted('•')} ${pkg}`);
|
|
990
994
|
}
|
|
@@ -992,7 +996,7 @@ export const buildSubcommand = createCommand({
|
|
|
992
996
|
|
|
993
997
|
if (finalEnv && Object.keys(finalEnv).length > 0) {
|
|
994
998
|
console.log('');
|
|
995
|
-
tui.
|
|
999
|
+
tui.header('Environment');
|
|
996
1000
|
for (const [envKey, envValue] of Object.entries(finalEnv)) {
|
|
997
1001
|
console.log(` ${tui.muted('•')} ${envKey}=${tui.maskSecret(envValue)}`);
|
|
998
1002
|
}
|
|
@@ -1000,7 +1004,7 @@ export const buildSubcommand = createCommand({
|
|
|
1000
1004
|
|
|
1001
1005
|
if (finalMetadata && Object.keys(finalMetadata).length > 0) {
|
|
1002
1006
|
console.log('');
|
|
1003
|
-
tui.
|
|
1007
|
+
tui.header('Metadata');
|
|
1004
1008
|
for (const key of Object.keys(finalMetadata)) {
|
|
1005
1009
|
console.log(` ${tui.muted('•')} ${key}=${finalMetadata[key]}`);
|
|
1006
1010
|
}
|
|
@@ -1008,7 +1012,7 @@ export const buildSubcommand = createCommand({
|
|
|
1008
1012
|
|
|
1009
1013
|
if (snapshot.files && snapshot.files.length > 0) {
|
|
1010
1014
|
console.log('');
|
|
1011
|
-
tui.
|
|
1015
|
+
tui.header('Files');
|
|
1012
1016
|
printFileTree(snapshot.files);
|
|
1013
1017
|
}
|
|
1014
1018
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { createCommand } from '../../../../types';
|
|
3
2
|
import { getCommand } from '../../../../command-prefix';
|
|
3
|
+
import { createCommand } from '../../../../types';
|
|
4
4
|
|
|
5
5
|
const TEMPLATE_YAML = `# yaml-language-server: $schema=https://agentuity.dev/schema/cli/v1/agentuity-snapshot.json
|
|
6
6
|
#
|
|
@@ -27,6 +27,10 @@ runtime: bun:1
|
|
|
27
27
|
# Can be overridden with --description flag
|
|
28
28
|
description: My sandbox snapshot
|
|
29
29
|
|
|
30
|
+
# Optional: Subdirectory to use as the build context
|
|
31
|
+
# Files are resolved relative to this directory instead of the CLI directory argument
|
|
32
|
+
# dir: src
|
|
33
|
+
|
|
30
34
|
# Optional: Apt packages to install
|
|
31
35
|
# Packages are validated against Debian stable repositories
|
|
32
36
|
# Supports version pinning: package=version or package=version* (prefix match)
|
|
@@ -138,7 +138,7 @@ export const getSubcommand = createCommand({
|
|
|
138
138
|
Object.keys(snapshot.userMetadata).length > 0
|
|
139
139
|
) {
|
|
140
140
|
console.log('');
|
|
141
|
-
tui.
|
|
141
|
+
tui.header('Metadata');
|
|
142
142
|
for (const [key, value] of Object.entries(snapshot.userMetadata)) {
|
|
143
143
|
console.log(` ${tui.muted('•')} ${key}=${value}`);
|
|
144
144
|
}
|
|
@@ -146,13 +146,13 @@ export const getSubcommand = createCommand({
|
|
|
146
146
|
|
|
147
147
|
if (snapshot.files && snapshot.files.length > 0) {
|
|
148
148
|
console.log('');
|
|
149
|
-
tui.
|
|
149
|
+
tui.header('Files');
|
|
150
150
|
printFileTree(snapshot.files);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
if (activeSandboxes.length > 0) {
|
|
154
154
|
console.log('');
|
|
155
|
-
tui.
|
|
155
|
+
tui.header(`Attached Sandboxes (${activeSandboxes.length}):`);
|
|
156
156
|
printSandboxTree(activeSandboxes);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
|
|
7
|
+
|
|
8
|
+
function formatNumber(n: number): string {
|
|
9
|
+
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
10
|
+
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
|
|
11
|
+
return String(n);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function formatLatency(ms: number): string {
|
|
15
|
+
if (ms >= 1000) return `${(ms / 1000).toFixed(1)}s`;
|
|
16
|
+
return `${Math.round(ms)}ms`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function displayStats(data: ServiceStatsData): void {
|
|
20
|
+
const svc = data.services.sandbox;
|
|
21
|
+
if (!svc) {
|
|
22
|
+
tui.info('No sandbox data found.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
tui.header('Sandbox Statistics');
|
|
26
|
+
tui.newline();
|
|
27
|
+
console.log(
|
|
28
|
+
` ${tui.muted('Active:')} ${formatNumber(svc.totalActive)} (${svc.running} running, ${svc.idle} idle, ${svc.creating} creating)`
|
|
29
|
+
);
|
|
30
|
+
console.log(
|
|
31
|
+
` ${tui.muted('Executions:')} ${formatNumber(svc.totalExecutions)}`
|
|
32
|
+
);
|
|
33
|
+
console.log(` ${tui.muted('CPU Time:')} ${formatLatency(svc.totalCpuTimeMs)}`);
|
|
34
|
+
console.log(
|
|
35
|
+
` ${tui.muted('Memory:')} ${tui.formatBytes(svc.totalMemoryByteSec)}`
|
|
36
|
+
);
|
|
37
|
+
console.log(
|
|
38
|
+
` ${tui.muted('Network Out:')} ${tui.formatBytes(svc.totalNetworkEgressBytes)}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const statsSubcommand = createCommand({
|
|
43
|
+
name: 'stats',
|
|
44
|
+
description: 'View sandbox statistics',
|
|
45
|
+
tags: ['read-only', 'requires-auth'],
|
|
46
|
+
requires: { auth: true, org: true },
|
|
47
|
+
examples: [
|
|
48
|
+
{
|
|
49
|
+
command: getCommand('cloud sandbox stats'),
|
|
50
|
+
description: 'View sandbox statistics',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
schema: {
|
|
54
|
+
options: z.object({
|
|
55
|
+
start: z.string().optional().describe('Start time (ISO 8601)'),
|
|
56
|
+
end: z.string().optional().describe('End time (ISO 8601)'),
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
idempotent: true,
|
|
60
|
+
|
|
61
|
+
async handler(ctx) {
|
|
62
|
+
const { opts, options } = ctx;
|
|
63
|
+
const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
|
|
64
|
+
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
65
|
+
|
|
66
|
+
if (!orgId) {
|
|
67
|
+
ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const data = await getServiceStats(client, orgId, {
|
|
72
|
+
service: 'sandbox',
|
|
73
|
+
start: opts.start,
|
|
74
|
+
end: opts.end,
|
|
75
|
+
orgIdHeader: orgId,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (!options.json) {
|
|
79
|
+
displayStats(data);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return data;
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export default statsSubcommand;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const CreateScheduleResponseSchema = z.object({
|
|
8
|
+
schedule: z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
name: z.string(),
|
|
11
|
+
expression: z.string(),
|
|
12
|
+
description: z.string().nullable(),
|
|
13
|
+
due_date: z.string(),
|
|
14
|
+
created_at: z.string(),
|
|
15
|
+
updated_at: z.string(),
|
|
16
|
+
created_by: z.string(),
|
|
17
|
+
}),
|
|
18
|
+
destinations: z.array(
|
|
19
|
+
z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
schedule_id: z.string(),
|
|
22
|
+
created_at: z.string(),
|
|
23
|
+
updated_at: z.string(),
|
|
24
|
+
created_by: z.string(),
|
|
25
|
+
type: z.enum(['url', 'sandbox']),
|
|
26
|
+
config: z.record(z.string(), z.unknown()),
|
|
27
|
+
})
|
|
28
|
+
),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const createSubcommand = createCommand({
|
|
32
|
+
name: 'create',
|
|
33
|
+
description: 'Create a schedule',
|
|
34
|
+
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
35
|
+
requires: { auth: true },
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
command: getCommand("cloud schedule create --name nightly --expression '0 0 * * *'"),
|
|
39
|
+
description: 'Create a nightly schedule',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
schema: {
|
|
43
|
+
options: z.object({
|
|
44
|
+
name: z.string().min(1).describe('Schedule name'),
|
|
45
|
+
expression: z.string().min(1).describe('Cron expression'),
|
|
46
|
+
description: z.string().optional().describe('Schedule description'),
|
|
47
|
+
}),
|
|
48
|
+
response: CreateScheduleResponseSchema,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
async handler(ctx) {
|
|
52
|
+
const { opts, options } = ctx;
|
|
53
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
54
|
+
const result = await schedule.create({
|
|
55
|
+
name: opts.name,
|
|
56
|
+
expression: opts.expression,
|
|
57
|
+
description: opts.description,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!options.json) {
|
|
61
|
+
tui.success(`Created schedule: ${result.schedule.name}`);
|
|
62
|
+
tui.table(
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
Name: result.schedule.name,
|
|
66
|
+
ID: result.schedule.id,
|
|
67
|
+
Expression: result.schedule.expression,
|
|
68
|
+
Description: result.schedule.description || '-',
|
|
69
|
+
'Next Due': result.schedule.due_date,
|
|
70
|
+
Created: new Date(result.schedule.created_at).toLocaleString(),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
undefined,
|
|
74
|
+
{ layout: 'vertical' }
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return result;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export default createSubcommand;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const ScheduleDeleteResponseSchema = z.object({
|
|
8
|
+
success: z.boolean(),
|
|
9
|
+
schedule_id: z.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const deleteSubcommand = createCommand({
|
|
13
|
+
name: 'delete',
|
|
14
|
+
aliases: ['rm'],
|
|
15
|
+
description: 'Delete a schedule',
|
|
16
|
+
tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
|
|
17
|
+
requires: { auth: true },
|
|
18
|
+
idempotent: true,
|
|
19
|
+
examples: [
|
|
20
|
+
{ command: getCommand('cloud schedule delete sched_abc123'), description: 'Delete a schedule' },
|
|
21
|
+
],
|
|
22
|
+
schema: {
|
|
23
|
+
args: z.object({
|
|
24
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
25
|
+
}),
|
|
26
|
+
response: ScheduleDeleteResponseSchema,
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
async handler(ctx) {
|
|
30
|
+
const { args, options } = ctx;
|
|
31
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
32
|
+
await schedule.delete(args.schedule_id);
|
|
33
|
+
|
|
34
|
+
if (!options.json) {
|
|
35
|
+
tui.success(`Deleted schedule: ${args.schedule_id}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return { success: true, schedule_id: args.schedule_id };
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default deleteSubcommand;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../../types';
|
|
3
|
+
import * as tui from '../../../../tui';
|
|
4
|
+
import { createScheduleAdapter } from '../util';
|
|
5
|
+
import { getCommand } from '../../../../command-prefix';
|
|
6
|
+
|
|
7
|
+
const DeliveryGetResponseSchema = z.object({
|
|
8
|
+
delivery: z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
date: z.string(),
|
|
11
|
+
schedule_id: z.string(),
|
|
12
|
+
schedule_destination_id: z.string(),
|
|
13
|
+
status: z.enum(['pending', 'success', 'failed']),
|
|
14
|
+
retries: z.number(),
|
|
15
|
+
error: z.string().nullable(),
|
|
16
|
+
response: z.record(z.string(), z.unknown()).nullable(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const getSubcommand = createCommand({
|
|
21
|
+
name: 'get',
|
|
22
|
+
description: 'Get delivery details',
|
|
23
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
24
|
+
requires: { auth: true },
|
|
25
|
+
idempotent: true,
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
command: getCommand('cloud schedule delivery get sched_abc123 sdel_abc456'),
|
|
29
|
+
description: 'Get delivery details',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
schema: {
|
|
33
|
+
args: z.object({
|
|
34
|
+
schedule_id: z.string().min(1).describe('Schedule ID'),
|
|
35
|
+
delivery_id: z.string().min(1).describe('Delivery ID'),
|
|
36
|
+
}),
|
|
37
|
+
options: z.object({
|
|
38
|
+
limit: z.coerce
|
|
39
|
+
.number()
|
|
40
|
+
.min(0)
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Maximum number of deliveries to scan while filtering'),
|
|
43
|
+
offset: z.coerce
|
|
44
|
+
.number()
|
|
45
|
+
.min(0)
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Offset while scanning deliveries for filtering'),
|
|
48
|
+
}),
|
|
49
|
+
response: DeliveryGetResponseSchema,
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
async handler(ctx) {
|
|
53
|
+
const { args, opts, options } = ctx;
|
|
54
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
55
|
+
const delivery = await schedule.getDelivery(args.schedule_id, args.delivery_id, {
|
|
56
|
+
limit: opts.limit,
|
|
57
|
+
offset: opts.offset,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!options.json) {
|
|
61
|
+
const details: Record<string, unknown> = {
|
|
62
|
+
ID: delivery.id,
|
|
63
|
+
'Schedule ID': delivery.schedule_id,
|
|
64
|
+
'Destination ID': delivery.schedule_destination_id,
|
|
65
|
+
Date: new Date(delivery.date).toLocaleString(),
|
|
66
|
+
Status: delivery.status,
|
|
67
|
+
Retries: delivery.retries,
|
|
68
|
+
Error: delivery.error ?? '-',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
tui.table([details], undefined, { layout: 'vertical' });
|
|
72
|
+
|
|
73
|
+
if (delivery.response) {
|
|
74
|
+
tui.newline();
|
|
75
|
+
tui.header('Response');
|
|
76
|
+
tui.json(delivery.response);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return { delivery };
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createCommand } from '../../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { getSubcommand } from './get';
|
|
4
|
+
import { getCommand } from '../../../../command-prefix';
|
|
5
|
+
|
|
6
|
+
export const command = createCommand({
|
|
7
|
+
name: 'delivery',
|
|
8
|
+
description: 'Manage schedule delivery attempts',
|
|
9
|
+
tags: ['requires-auth'],
|
|
10
|
+
requires: { auth: true },
|
|
11
|
+
subcommands: [listSubcommand, getSubcommand],
|
|
12
|
+
examples: [
|
|
13
|
+
{
|
|
14
|
+
command: getCommand('cloud schedule delivery list sched_abc123'),
|
|
15
|
+
description: 'List deliveries for schedule',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
command: getCommand('cloud schedule delivery get sched_abc123 sdel_abc456'),
|
|
19
|
+
description: 'Get delivery details',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default command;
|