@agentuity/cli 1.0.23 → 1.0.25
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/cache/index.d.ts +1 -0
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +1 -0
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/user-cache.d.ts +20 -0
- package/dist/cache/user-cache.d.ts.map +1 -0
- package/dist/cache/user-cache.js +79 -0
- package/dist/cache/user-cache.js.map +1 -0
- package/dist/cmd/auth/logout.d.ts.map +1 -1
- package/dist/cmd/auth/logout.js +3 -1
- package/dist/cmd/auth/logout.js.map +1 -1
- package/dist/cmd/build/entry-generator.d.ts +4 -0
- package/dist/cmd/build/entry-generator.d.ts.map +1 -1
- package/dist/cmd/build/entry-generator.js +18 -3
- package/dist/cmd/build/entry-generator.js.map +1 -1
- package/dist/cmd/build/vite/bun-dev-server.d.ts +1 -0
- package/dist/cmd/build/vite/bun-dev-server.d.ts.map +1 -1
- package/dist/cmd/build/vite/bun-dev-server.js +11 -9
- package/dist/cmd/build/vite/bun-dev-server.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.map +1 -1
- package/dist/cmd/cloud/email/create.js +15 -10
- package/dist/cmd/cloud/email/create.js.map +1 -1
- package/dist/cmd/cloud/email/delete.js +1 -1
- package/dist/cmd/cloud/email/delete.js.map +1 -1
- package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/email/destination/delete.js +6 -2
- package/dist/cmd/cloud/email/destination/delete.js.map +1 -1
- package/dist/cmd/cloud/email/destination/list.js +1 -1
- package/dist/cmd/cloud/email/destination/list.js.map +1 -1
- package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -1
- package/dist/cmd/cloud/email/destination/url.js +5 -4
- package/dist/cmd/cloud/email/destination/url.js.map +1 -1
- package/dist/cmd/cloud/email/get.d.ts.map +1 -1
- package/dist/cmd/cloud/email/get.js +2 -4
- package/dist/cmd/cloud/email/get.js.map +1 -1
- package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -1
- package/dist/cmd/cloud/email/inbound/get.js +2 -3
- package/dist/cmd/cloud/email/inbound/get.js.map +1 -1
- package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -1
- package/dist/cmd/cloud/email/inbound/list.js +1 -3
- package/dist/cmd/cloud/email/inbound/list.js.map +1 -1
- package/dist/cmd/cloud/email/inbound/schemas.d.ts +3 -1
- package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -1
- package/dist/cmd/cloud/email/inbound/schemas.js +3 -1
- package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -1
- package/dist/cmd/cloud/email/index.d.ts.map +1 -1
- package/dist/cmd/cloud/email/index.js +2 -0
- package/dist/cmd/cloud/email/index.js.map +1 -1
- package/dist/cmd/cloud/email/list.d.ts.map +1 -1
- package/dist/cmd/cloud/email/list.js +9 -2
- package/dist/cmd/cloud/email/list.js.map +1 -1
- package/dist/cmd/cloud/email/outbound/get.js +4 -4
- package/dist/cmd/cloud/email/outbound/get.js.map +1 -1
- package/dist/cmd/cloud/email/outbound/list.js +3 -3
- package/dist/cmd/cloud/email/outbound/list.js.map +1 -1
- package/dist/cmd/cloud/email/outbound/schemas.d.ts +2 -2
- package/dist/cmd/cloud/email/outbound/schemas.js +2 -2
- package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -1
- package/dist/cmd/cloud/email/send.d.ts.map +1 -1
- package/dist/cmd/cloud/email/send.js +9 -15
- package/dist/cmd/cloud/email/send.js.map +1 -1
- 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 +4 -7
- package/dist/cmd/cloud/email/util.d.ts.map +1 -1
- package/dist/cmd/cloud/email/util.js +8 -24
- package/dist/cmd/cloud/email/util.js.map +1 -1
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +2 -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/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.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js +13 -10
- package/dist/cmd/cloud/sandbox/snapshot/build.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.map +1 -1
- package/dist/cmd/cloud/schedule/create.js +3 -4
- package/dist/cmd/cloud/schedule/create.js.map +1 -1
- package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/delete.js +6 -4
- package/dist/cmd/cloud/schedule/delete.js.map +1 -1
- package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/delivery/get.js +3 -4
- package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -1
- package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/delivery/list.js +2 -3
- package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -1
- package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/destination/create.js +10 -5
- package/dist/cmd/cloud/schedule/destination/create.js.map +1 -1
- package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/destination/delete.js +2 -3
- package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -1
- package/dist/cmd/cloud/schedule/destination/get.js +15 -13
- package/dist/cmd/cloud/schedule/destination/get.js.map +1 -1
- package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/destination/index.js.map +1 -1
- package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/destination/list.js +13 -9
- package/dist/cmd/cloud/schedule/destination/list.js.map +1 -1
- package/dist/cmd/cloud/schedule/get.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/get.js +19 -12
- package/dist/cmd/cloud/schedule/get.js.map +1 -1
- package/dist/cmd/cloud/schedule/index.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/index.js +6 -1
- package/dist/cmd/cloud/schedule/index.js.map +1 -1
- package/dist/cmd/cloud/schedule/list.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/list.js +2 -3
- package/dist/cmd/cloud/schedule/list.js.map +1 -1
- 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.js +5 -5
- package/dist/cmd/cloud/schedule/update.js.map +1 -1
- package/dist/cmd/cloud/schedule/util.d.ts +4 -5
- package/dist/cmd/cloud/schedule/util.d.ts.map +1 -1
- package/dist/cmd/cloud/schedule/util.js +6 -7
- package/dist/cmd/cloud/schedule/util.js.map +1 -1
- 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 +8 -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/attachment.d.ts +2 -0
- package/dist/cmd/cloud/task/attachment.d.ts.map +1 -0
- package/dist/cmd/cloud/task/attachment.js +393 -0
- package/dist/cmd/cloud/task/attachment.js.map +1 -0
- package/dist/cmd/cloud/task/create.d.ts.map +1 -1
- package/dist/cmd/cloud/task/create.js +125 -5
- package/dist/cmd/cloud/task/create.js.map +1 -1
- package/dist/cmd/cloud/task/get.d.ts.map +1 -1
- package/dist/cmd/cloud/task/get.js +33 -14
- package/dist/cmd/cloud/task/get.js.map +1 -1
- package/dist/cmd/cloud/task/index.d.ts.map +1 -1
- package/dist/cmd/cloud/task/index.js +14 -1
- package/dist/cmd/cloud/task/index.js.map +1 -1
- package/dist/cmd/cloud/task/list.d.ts.map +1 -1
- package/dist/cmd/cloud/task/list.js +32 -17
- package/dist/cmd/cloud/task/list.js.map +1 -1
- 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 +68 -0
- package/dist/cmd/cloud/task/stats.js.map +1 -0
- package/dist/cmd/cloud/task/update.d.ts.map +1 -1
- package/dist/cmd/cloud/task/update.js +0 -1
- package/dist/cmd/cloud/task/update.js.map +1 -1
- package/dist/cmd/cloud/task/util.d.ts +4 -7
- package/dist/cmd/cloud/task/util.d.ts.map +1 -1
- package/dist/cmd/cloud/task/util.js +6 -12
- package/dist/cmd/cloud/task/util.js.map +1 -1
- 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.map +1 -1
- package/dist/cmd/cloud/webhook/create.js +6 -1
- package/dist/cmd/cloud/webhook/create.js.map +1 -1
- package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -1
- package/dist/cmd/cloud/webhook/deliveries.js +12 -3
- package/dist/cmd/cloud/webhook/deliveries.js.map +1 -1
- package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -1
- package/dist/cmd/cloud/webhook/destinations.js +19 -9
- package/dist/cmd/cloud/webhook/destinations.js.map +1 -1
- package/dist/cmd/cloud/webhook/get.js +2 -2
- package/dist/cmd/cloud/webhook/get.js.map +1 -1
- package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -1
- package/dist/cmd/cloud/webhook/receipts.js +19 -3
- package/dist/cmd/cloud/webhook/receipts.js.map +1 -1
- package/dist/cmd/dev/index.d.ts.map +1 -1
- package/dist/cmd/dev/index.js +80 -34
- package/dist/cmd/dev/index.js.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/package.json +6 -6
- package/src/cache/index.ts +2 -0
- package/src/cache/user-cache.ts +93 -0
- package/src/cmd/auth/logout.ts +3 -1
- package/src/cmd/build/entry-generator.ts +34 -4
- package/src/cmd/build/vite/bun-dev-server.ts +21 -9
- package/src/cmd/cloud/db/index.ts +2 -0
- package/src/cmd/cloud/db/stats.ts +72 -0
- package/src/cmd/cloud/email/create.ts +17 -10
- package/src/cmd/cloud/email/delete.ts +1 -1
- package/src/cmd/cloud/email/destination/delete.ts +6 -2
- package/src/cmd/cloud/email/destination/list.ts +1 -1
- package/src/cmd/cloud/email/destination/url.ts +5 -4
- package/src/cmd/cloud/email/get.ts +2 -4
- package/src/cmd/cloud/email/inbound/get.ts +2 -3
- package/src/cmd/cloud/email/inbound/list.ts +1 -3
- package/src/cmd/cloud/email/inbound/schemas.ts +3 -1
- package/src/cmd/cloud/email/index.ts +2 -0
- package/src/cmd/cloud/email/list.ts +9 -2
- package/src/cmd/cloud/email/outbound/get.ts +4 -4
- package/src/cmd/cloud/email/outbound/list.ts +3 -3
- package/src/cmd/cloud/email/outbound/schemas.ts +2 -2
- package/src/cmd/cloud/email/send.ts +9 -15
- package/src/cmd/cloud/email/stats.ts +73 -0
- package/src/cmd/cloud/email/util.ts +11 -31
- package/src/cmd/cloud/index.ts +2 -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/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 +34 -15
- package/src/cmd/cloud/sandbox/snapshot/get.ts +3 -3
- package/src/cmd/cloud/sandbox/stats.ts +82 -0
- package/src/cmd/cloud/schedule/create.ts +3 -4
- package/src/cmd/cloud/schedule/delete.ts +6 -4
- package/src/cmd/cloud/schedule/delivery/get.ts +3 -4
- package/src/cmd/cloud/schedule/delivery/list.ts +17 -16
- package/src/cmd/cloud/schedule/destination/create.ts +19 -7
- package/src/cmd/cloud/schedule/destination/delete.ts +2 -3
- package/src/cmd/cloud/schedule/destination/get.ts +17 -17
- package/src/cmd/cloud/schedule/destination/index.ts +3 -1
- package/src/cmd/cloud/schedule/destination/list.ts +22 -15
- package/src/cmd/cloud/schedule/get.ts +30 -20
- package/src/cmd/cloud/schedule/index.ts +6 -1
- package/src/cmd/cloud/schedule/list.ts +20 -19
- package/src/cmd/cloud/schedule/stats.ts +72 -0
- package/src/cmd/cloud/schedule/update.ts +5 -5
- package/src/cmd/cloud/schedule/util.ts +14 -20
- package/src/cmd/cloud/services/index.ts +11 -0
- package/src/cmd/cloud/services/stats.ts +199 -0
- package/src/cmd/cloud/stream/index.ts +8 -1
- package/src/cmd/cloud/stream/stats.ts +70 -0
- package/src/cmd/cloud/task/attachment.ts +432 -0
- package/src/cmd/cloud/task/create.ts +130 -5
- package/src/cmd/cloud/task/get.ts +35 -16
- package/src/cmd/cloud/task/index.ts +14 -1
- package/src/cmd/cloud/task/list.ts +32 -17
- package/src/cmd/cloud/task/stats.ts +74 -0
- package/src/cmd/cloud/task/update.ts +0 -1
- package/src/cmd/cloud/task/util.ts +14 -28
- 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 +6 -1
- package/src/cmd/cloud/webhook/deliveries.ts +15 -3
- package/src/cmd/cloud/webhook/destinations.ts +21 -9
- package/src/cmd/cloud/webhook/get.ts +2 -2
- package/src/cmd/cloud/webhook/receipts.ts +16 -3
- package/src/cmd/dev/index.ts +91 -48
- package/src/tui.ts +9 -0
|
@@ -147,14 +147,17 @@ export const getSubcommand = createCommand({
|
|
|
147
147
|
if (resourceParts.length > 0) {
|
|
148
148
|
tableData['Resources'] = resourceParts.join(', ');
|
|
149
149
|
}
|
|
150
|
-
if (result.metadata && Object.keys(result.metadata).length > 0) {
|
|
151
|
-
tableData['Metadata'] = JSON.stringify(result.metadata);
|
|
152
|
-
}
|
|
153
150
|
if (result.url) {
|
|
154
151
|
tableData['URL'] = tui.link(result.url);
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
|
|
155
|
+
|
|
156
|
+
if (result.metadata && Object.keys(result.metadata).length > 0) {
|
|
157
|
+
tui.newline();
|
|
158
|
+
tui.header('Metadata');
|
|
159
|
+
tui.json(result.metadata);
|
|
160
|
+
}
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
return {
|
|
@@ -18,6 +18,8 @@ import { uploadSubcommand } from './upload';
|
|
|
18
18
|
import { envSubcommand } from './env';
|
|
19
19
|
import { pauseSubcommand } from './pause';
|
|
20
20
|
import { resumeSubcommand } from './resume';
|
|
21
|
+
import { checkpointCommand } from './checkpoint';
|
|
22
|
+
import { statsSubcommand } from './stats';
|
|
21
23
|
import { getCommand } from '../../../command-prefix';
|
|
22
24
|
|
|
23
25
|
export const command = createCommand({
|
|
@@ -59,6 +61,8 @@ export const command = createCommand({
|
|
|
59
61
|
envSubcommand,
|
|
60
62
|
pauseSubcommand,
|
|
61
63
|
resumeSubcommand,
|
|
64
|
+
checkpointCommand,
|
|
65
|
+
statsSubcommand,
|
|
62
66
|
],
|
|
63
67
|
requires: { auth: true, org: true },
|
|
64
68
|
});
|
|
@@ -358,7 +358,9 @@ export const buildSubcommand = createCommand({
|
|
|
358
358
|
description: 'Build using a custom build file',
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
command: getCommand(
|
|
361
|
+
command: getCommand(
|
|
362
|
+
'cloud sandbox snapshot build . --env API_KEY=secret --tag production'
|
|
363
|
+
),
|
|
362
364
|
description: 'Build with environment variable substitution and custom tag',
|
|
363
365
|
},
|
|
364
366
|
{
|
|
@@ -379,7 +381,10 @@ export const buildSubcommand = createCommand({
|
|
|
379
381
|
.string()
|
|
380
382
|
.optional()
|
|
381
383
|
.describe('Path to build file (defaults to agentuity-snapshot.[json|yaml|yml])'),
|
|
382
|
-
env: z
|
|
384
|
+
env: z
|
|
385
|
+
.array(z.string())
|
|
386
|
+
.optional()
|
|
387
|
+
.describe('Environment variable substitution (KEY=VALUE)'),
|
|
383
388
|
name: z.string().optional().describe('Snapshot name (overrides build file)'),
|
|
384
389
|
tag: z.string().optional().describe('Snapshot tag (defaults to "latest")'),
|
|
385
390
|
description: z.string().optional().describe('Snapshot description (overrides build file)'),
|
|
@@ -529,7 +534,9 @@ export const buildSubcommand = createCommand({
|
|
|
529
534
|
|
|
530
535
|
if (opts.tag) {
|
|
531
536
|
if (opts.tag.length > MAX_SNAPSHOT_TAG_LENGTH) {
|
|
532
|
-
logger.fatal(
|
|
537
|
+
logger.fatal(
|
|
538
|
+
`Invalid snapshot tag: must be at most ${MAX_SNAPSHOT_TAG_LENGTH} characters`
|
|
539
|
+
);
|
|
533
540
|
}
|
|
534
541
|
if (!SNAPSHOT_TAG_REGEX.test(opts.tag)) {
|
|
535
542
|
logger.fatal(
|
|
@@ -576,7 +583,12 @@ export const buildSubcommand = createCommand({
|
|
|
576
583
|
message: 'Validating apt dependencies...',
|
|
577
584
|
type: 'simple',
|
|
578
585
|
callback: async () => {
|
|
579
|
-
return await validateAptDependencies(
|
|
586
|
+
return await validateAptDependencies(
|
|
587
|
+
buildConfig.dependencies!,
|
|
588
|
+
region,
|
|
589
|
+
config,
|
|
590
|
+
logger
|
|
591
|
+
);
|
|
580
592
|
},
|
|
581
593
|
});
|
|
582
594
|
|
|
@@ -676,7 +688,7 @@ export const buildSubcommand = createCommand({
|
|
|
676
688
|
|
|
677
689
|
if (buildConfig.dependencies && buildConfig.dependencies.length > 0) {
|
|
678
690
|
console.log('');
|
|
679
|
-
tui.
|
|
691
|
+
tui.header('Dependencies');
|
|
680
692
|
for (const dep of buildConfig.dependencies) {
|
|
681
693
|
console.log(` ${tui.muted('•')} ${dep}`);
|
|
682
694
|
}
|
|
@@ -684,7 +696,7 @@ export const buildSubcommand = createCommand({
|
|
|
684
696
|
|
|
685
697
|
if (buildConfig.packages && buildConfig.packages.length > 0) {
|
|
686
698
|
console.log('');
|
|
687
|
-
tui.
|
|
699
|
+
tui.header('Packages (npm/bun)');
|
|
688
700
|
for (const pkg of buildConfig.packages) {
|
|
689
701
|
console.log(` ${tui.muted('•')} ${pkg}`);
|
|
690
702
|
}
|
|
@@ -692,7 +704,7 @@ export const buildSubcommand = createCommand({
|
|
|
692
704
|
|
|
693
705
|
if (finalEnv && Object.keys(finalEnv).length > 0) {
|
|
694
706
|
console.log('');
|
|
695
|
-
tui.
|
|
707
|
+
tui.header('Environment');
|
|
696
708
|
for (const [envKey, envValue] of Object.entries(finalEnv)) {
|
|
697
709
|
console.log(` ${tui.muted('•')} ${envKey}=${tui.maskSecret(envValue)}`);
|
|
698
710
|
}
|
|
@@ -700,7 +712,7 @@ export const buildSubcommand = createCommand({
|
|
|
700
712
|
|
|
701
713
|
if (fileList.length > 0) {
|
|
702
714
|
console.log('');
|
|
703
|
-
tui.
|
|
715
|
+
tui.header('Files');
|
|
704
716
|
printFileTree(fileList);
|
|
705
717
|
}
|
|
706
718
|
}
|
|
@@ -890,7 +902,11 @@ export const buildSubcommand = createCommand({
|
|
|
890
902
|
clearOnError: true,
|
|
891
903
|
callback: async (updateProgress) => {
|
|
892
904
|
const uploadFile = Bun.file(uploadPath);
|
|
893
|
-
const progressStream = createProgressStream(
|
|
905
|
+
const progressStream = createProgressStream(
|
|
906
|
+
uploadFile,
|
|
907
|
+
uploadSize,
|
|
908
|
+
updateProgress
|
|
909
|
+
);
|
|
894
910
|
await snapshotUpload(client, {
|
|
895
911
|
snapshotId: initResult.snapshotId!,
|
|
896
912
|
body: progressStream,
|
|
@@ -933,7 +949,10 @@ export const buildSubcommand = createCommand({
|
|
|
933
949
|
'Malware Detected',
|
|
934
950
|
`Your snapshot was rejected because it contains malware.\n\nVirus: ${virusName}\n\nPlease remove the infected files and try again.`
|
|
935
951
|
);
|
|
936
|
-
tui.fatal(
|
|
952
|
+
tui.fatal(
|
|
953
|
+
'Snapshot build failed due to malware detection',
|
|
954
|
+
ErrorCode.MALWARE_DETECTED
|
|
955
|
+
);
|
|
937
956
|
}
|
|
938
957
|
|
|
939
958
|
throw err;
|
|
@@ -980,7 +999,7 @@ export const buildSubcommand = createCommand({
|
|
|
980
999
|
|
|
981
1000
|
if (buildConfig.dependencies && buildConfig.dependencies.length > 0) {
|
|
982
1001
|
console.log('');
|
|
983
|
-
tui.
|
|
1002
|
+
tui.header('Dependencies');
|
|
984
1003
|
for (const dep of buildConfig.dependencies) {
|
|
985
1004
|
console.log(` ${tui.muted('•')} ${dep}`);
|
|
986
1005
|
}
|
|
@@ -988,7 +1007,7 @@ export const buildSubcommand = createCommand({
|
|
|
988
1007
|
|
|
989
1008
|
if (buildConfig.packages && buildConfig.packages.length > 0) {
|
|
990
1009
|
console.log('');
|
|
991
|
-
tui.
|
|
1010
|
+
tui.header('Packages (npm/bun)');
|
|
992
1011
|
for (const pkg of buildConfig.packages) {
|
|
993
1012
|
console.log(` ${tui.muted('•')} ${pkg}`);
|
|
994
1013
|
}
|
|
@@ -996,7 +1015,7 @@ export const buildSubcommand = createCommand({
|
|
|
996
1015
|
|
|
997
1016
|
if (finalEnv && Object.keys(finalEnv).length > 0) {
|
|
998
1017
|
console.log('');
|
|
999
|
-
tui.
|
|
1018
|
+
tui.header('Environment');
|
|
1000
1019
|
for (const [envKey, envValue] of Object.entries(finalEnv)) {
|
|
1001
1020
|
console.log(` ${tui.muted('•')} ${envKey}=${tui.maskSecret(envValue)}`);
|
|
1002
1021
|
}
|
|
@@ -1004,7 +1023,7 @@ export const buildSubcommand = createCommand({
|
|
|
1004
1023
|
|
|
1005
1024
|
if (finalMetadata && Object.keys(finalMetadata).length > 0) {
|
|
1006
1025
|
console.log('');
|
|
1007
|
-
tui.
|
|
1026
|
+
tui.header('Metadata');
|
|
1008
1027
|
for (const key of Object.keys(finalMetadata)) {
|
|
1009
1028
|
console.log(` ${tui.muted('•')} ${key}=${finalMetadata[key]}`);
|
|
1010
1029
|
}
|
|
@@ -1012,7 +1031,7 @@ export const buildSubcommand = createCommand({
|
|
|
1012
1031
|
|
|
1013
1032
|
if (snapshot.files && snapshot.files.length > 0) {
|
|
1014
1033
|
console.log('');
|
|
1015
|
-
tui.
|
|
1034
|
+
tui.header('Files');
|
|
1016
1035
|
printFileTree(snapshot.files);
|
|
1017
1036
|
}
|
|
1018
1037
|
}
|
|
@@ -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,82 @@
|
|
|
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(` ${tui.muted('Executions:')} ${formatNumber(svc.totalExecutions)}`);
|
|
31
|
+
console.log(` ${tui.muted('CPU Time:')} ${formatLatency(svc.totalCpuTimeMs)}`);
|
|
32
|
+
console.log(` ${tui.muted('Memory:')} ${tui.formatBytes(svc.totalMemoryByteSec)}`);
|
|
33
|
+
console.log(
|
|
34
|
+
` ${tui.muted('Network Out:')} ${tui.formatBytes(svc.totalNetworkEgressBytes)}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const statsSubcommand = createCommand({
|
|
39
|
+
name: 'stats',
|
|
40
|
+
description: 'View sandbox statistics',
|
|
41
|
+
tags: ['read-only', 'requires-auth'],
|
|
42
|
+
requires: { auth: true, org: true },
|
|
43
|
+
examples: [
|
|
44
|
+
{
|
|
45
|
+
command: getCommand('cloud sandbox stats'),
|
|
46
|
+
description: 'View sandbox statistics',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
schema: {
|
|
50
|
+
options: z.object({
|
|
51
|
+
start: z.string().optional().describe('Start time (ISO 8601)'),
|
|
52
|
+
end: z.string().optional().describe('End time (ISO 8601)'),
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
idempotent: true,
|
|
56
|
+
|
|
57
|
+
async handler(ctx) {
|
|
58
|
+
const { opts, options } = ctx;
|
|
59
|
+
const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
|
|
60
|
+
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
61
|
+
|
|
62
|
+
if (!orgId) {
|
|
63
|
+
ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const data = await getServiceStats(client, orgId, {
|
|
68
|
+
service: 'sandbox',
|
|
69
|
+
start: opts.start,
|
|
70
|
+
end: opts.end,
|
|
71
|
+
orgIdHeader: orgId,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (!options.json) {
|
|
75
|
+
displayStats(data);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return data;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export default statsSubcommand;
|
|
@@ -32,8 +32,7 @@ export const createSubcommand = createCommand({
|
|
|
32
32
|
name: 'create',
|
|
33
33
|
description: 'Create a schedule',
|
|
34
34
|
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
35
|
-
requires: { auth: true
|
|
36
|
-
optional: { project: true },
|
|
35
|
+
requires: { auth: true },
|
|
37
36
|
examples: [
|
|
38
37
|
{
|
|
39
38
|
command: getCommand("cloud schedule create --name nightly --expression '0 0 * * *'"),
|
|
@@ -51,7 +50,7 @@ export const createSubcommand = createCommand({
|
|
|
51
50
|
|
|
52
51
|
async handler(ctx) {
|
|
53
52
|
const { opts, options } = ctx;
|
|
54
|
-
const schedule = createScheduleAdapter(ctx);
|
|
53
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
55
54
|
const result = await schedule.create({
|
|
56
55
|
name: opts.name,
|
|
57
56
|
expression: opts.expression,
|
|
@@ -66,7 +65,7 @@ export const createSubcommand = createCommand({
|
|
|
66
65
|
Name: result.schedule.name,
|
|
67
66
|
ID: result.schedule.id,
|
|
68
67
|
Expression: result.schedule.expression,
|
|
69
|
-
Description: result.schedule.description
|
|
68
|
+
Description: result.schedule.description || '-',
|
|
70
69
|
'Next Due': result.schedule.due_date,
|
|
71
70
|
Created: new Date(result.schedule.created_at).toLocaleString(),
|
|
72
71
|
},
|
|
@@ -14,11 +14,13 @@ export const deleteSubcommand = createCommand({
|
|
|
14
14
|
aliases: ['rm'],
|
|
15
15
|
description: 'Delete a schedule',
|
|
16
16
|
tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
|
|
17
|
-
requires: { auth: true
|
|
18
|
-
optional: { project: true },
|
|
17
|
+
requires: { auth: true },
|
|
19
18
|
idempotent: true,
|
|
20
19
|
examples: [
|
|
21
|
-
{
|
|
20
|
+
{
|
|
21
|
+
command: getCommand('cloud schedule delete sched_abc123'),
|
|
22
|
+
description: 'Delete a schedule',
|
|
23
|
+
},
|
|
22
24
|
],
|
|
23
25
|
schema: {
|
|
24
26
|
args: z.object({
|
|
@@ -29,7 +31,7 @@ export const deleteSubcommand = createCommand({
|
|
|
29
31
|
|
|
30
32
|
async handler(ctx) {
|
|
31
33
|
const { args, options } = ctx;
|
|
32
|
-
const schedule = createScheduleAdapter(ctx);
|
|
34
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
33
35
|
await schedule.delete(args.schedule_id);
|
|
34
36
|
|
|
35
37
|
if (!options.json) {
|
|
@@ -21,8 +21,7 @@ export const getSubcommand = createCommand({
|
|
|
21
21
|
name: 'get',
|
|
22
22
|
description: 'Get delivery details',
|
|
23
23
|
tags: ['read-only', 'fast', 'requires-auth'],
|
|
24
|
-
requires: { auth: true
|
|
25
|
-
optional: { project: true },
|
|
24
|
+
requires: { auth: true },
|
|
26
25
|
idempotent: true,
|
|
27
26
|
examples: [
|
|
28
27
|
{
|
|
@@ -52,7 +51,7 @@ export const getSubcommand = createCommand({
|
|
|
52
51
|
|
|
53
52
|
async handler(ctx) {
|
|
54
53
|
const { args, opts, options } = ctx;
|
|
55
|
-
const schedule = createScheduleAdapter(ctx);
|
|
54
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
56
55
|
const delivery = await schedule.getDelivery(args.schedule_id, args.delivery_id, {
|
|
57
56
|
limit: opts.limit,
|
|
58
57
|
offset: opts.offset,
|
|
@@ -73,7 +72,7 @@ export const getSubcommand = createCommand({
|
|
|
73
72
|
|
|
74
73
|
if (delivery.response) {
|
|
75
74
|
tui.newline();
|
|
76
|
-
tui.
|
|
75
|
+
tui.header('Response');
|
|
77
76
|
tui.json(delivery.response);
|
|
78
77
|
}
|
|
79
78
|
}
|
|
@@ -24,8 +24,7 @@ export const listSubcommand = createCommand({
|
|
|
24
24
|
aliases: ['ls'],
|
|
25
25
|
description: 'List deliveries for a schedule',
|
|
26
26
|
tags: ['read-only', 'fast', 'requires-auth'],
|
|
27
|
-
requires: { auth: true
|
|
28
|
-
optional: { project: true },
|
|
27
|
+
requires: { auth: true },
|
|
29
28
|
idempotent: true,
|
|
30
29
|
examples: [
|
|
31
30
|
{
|
|
@@ -46,7 +45,7 @@ export const listSubcommand = createCommand({
|
|
|
46
45
|
|
|
47
46
|
async handler(ctx) {
|
|
48
47
|
const { args, opts, options } = ctx;
|
|
49
|
-
const schedule = createScheduleAdapter(ctx);
|
|
48
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
50
49
|
const result = await schedule.listDeliveries(args.schedule_id, {
|
|
51
50
|
limit: opts.limit,
|
|
52
51
|
offset: opts.offset,
|
|
@@ -57,19 +56,21 @@ export const listSubcommand = createCommand({
|
|
|
57
56
|
tui.info('No deliveries found');
|
|
58
57
|
} else {
|
|
59
58
|
tui.table(
|
|
60
|
-
result.deliveries.map(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
result.deliveries.map(
|
|
60
|
+
(delivery: {
|
|
61
|
+
id: string;
|
|
62
|
+
date: string;
|
|
63
|
+
status: 'pending' | 'success' | 'failed';
|
|
64
|
+
retries: number;
|
|
65
|
+
schedule_destination_id: string;
|
|
66
|
+
}) => ({
|
|
67
|
+
ID: delivery.id,
|
|
68
|
+
Date: new Date(delivery.date).toLocaleString(),
|
|
69
|
+
Status: delivery.status,
|
|
70
|
+
Retries: delivery.retries,
|
|
71
|
+
'Destination ID': delivery.schedule_destination_id,
|
|
72
|
+
})
|
|
73
|
+
),
|
|
73
74
|
['ID', 'Date', 'Status', 'Retries', 'Destination ID']
|
|
74
75
|
);
|
|
75
76
|
}
|
|
@@ -20,15 +20,18 @@ export const createSubcommand = createCommand({
|
|
|
20
20
|
name: 'create',
|
|
21
21
|
description: 'Create destination for a schedule',
|
|
22
22
|
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
23
|
-
requires: { auth: true
|
|
24
|
-
optional: { project: true },
|
|
23
|
+
requires: { auth: true },
|
|
25
24
|
examples: [
|
|
26
25
|
{
|
|
27
|
-
command: getCommand(
|
|
26
|
+
command: getCommand(
|
|
27
|
+
'cloud schedule destination create url sched_abc123 https://example.com'
|
|
28
|
+
),
|
|
28
29
|
description: 'Create URL destination',
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
|
-
command: getCommand(
|
|
32
|
+
command: getCommand(
|
|
33
|
+
'cloud schedule destination create url sched_abc123 https://example.com --method POST'
|
|
34
|
+
),
|
|
32
35
|
description: 'Create URL destination with POST method',
|
|
33
36
|
},
|
|
34
37
|
],
|
|
@@ -48,12 +51,16 @@ export const createSubcommand = createCommand({
|
|
|
48
51
|
|
|
49
52
|
async handler(ctx) {
|
|
50
53
|
const { args, opts, options } = ctx;
|
|
51
|
-
const schedule = createScheduleAdapter(ctx);
|
|
54
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
52
55
|
|
|
53
56
|
if (args.type === 'sandbox' && !args.target.startsWith('sbx_')) {
|
|
54
57
|
tui.fatal('Sandbox target must start with "sbx_"');
|
|
55
58
|
}
|
|
56
|
-
if (
|
|
59
|
+
if (
|
|
60
|
+
args.type === 'url' &&
|
|
61
|
+
!args.target.startsWith('http://') &&
|
|
62
|
+
!args.target.startsWith('https://')
|
|
63
|
+
) {
|
|
57
64
|
tui.fatal('URL target must start with http:// or https://');
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -95,12 +102,17 @@ export const createSubcommand = createCommand({
|
|
|
95
102
|
{
|
|
96
103
|
ID: result.destination.id,
|
|
97
104
|
Type: result.destination.type,
|
|
98
|
-
Config: JSON.stringify(result.destination.config),
|
|
99
105
|
},
|
|
100
106
|
],
|
|
101
107
|
undefined,
|
|
102
108
|
{ layout: 'vertical' }
|
|
103
109
|
);
|
|
110
|
+
|
|
111
|
+
if (result.destination.config && Object.keys(result.destination.config).length > 0) {
|
|
112
|
+
tui.newline();
|
|
113
|
+
tui.header('Config');
|
|
114
|
+
tui.json(result.destination.config);
|
|
115
|
+
}
|
|
104
116
|
}
|
|
105
117
|
|
|
106
118
|
return result;
|
|
@@ -14,8 +14,7 @@ export const deleteSubcommand = createCommand({
|
|
|
14
14
|
aliases: ['rm'],
|
|
15
15
|
description: 'Delete a destination',
|
|
16
16
|
tags: ['destructive', 'deletes-resource', 'slow', 'requires-auth'],
|
|
17
|
-
requires: { auth: true
|
|
18
|
-
optional: { project: true },
|
|
17
|
+
requires: { auth: true },
|
|
19
18
|
idempotent: true,
|
|
20
19
|
examples: [
|
|
21
20
|
{
|
|
@@ -32,7 +31,7 @@ export const deleteSubcommand = createCommand({
|
|
|
32
31
|
|
|
33
32
|
async handler(ctx) {
|
|
34
33
|
const { args, options } = ctx;
|
|
35
|
-
const schedule = createScheduleAdapter(ctx);
|
|
34
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
36
35
|
await schedule.deleteDestination(args.destination_id);
|
|
37
36
|
|
|
38
37
|
if (!options.json) {
|
|
@@ -20,8 +20,7 @@ export const getSubcommand = createCommand({
|
|
|
20
20
|
name: 'get',
|
|
21
21
|
description: 'Get destination details',
|
|
22
22
|
tags: ['read-only', 'fast', 'requires-auth'],
|
|
23
|
-
requires: { auth: true
|
|
24
|
-
optional: { project: true },
|
|
23
|
+
requires: { auth: true },
|
|
25
24
|
idempotent: true,
|
|
26
25
|
examples: [
|
|
27
26
|
{
|
|
@@ -39,24 +38,25 @@ export const getSubcommand = createCommand({
|
|
|
39
38
|
|
|
40
39
|
async handler(ctx) {
|
|
41
40
|
const { args, options } = ctx;
|
|
42
|
-
const schedule = createScheduleAdapter(ctx);
|
|
41
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
43
42
|
const destination = await schedule.getDestination(args.schedule_id, args.destination_id);
|
|
44
43
|
|
|
45
44
|
if (!options.json) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
const details: Record<string, unknown> = {
|
|
46
|
+
ID: destination.id,
|
|
47
|
+
'Schedule ID': destination.schedule_id,
|
|
48
|
+
Type: destination.type,
|
|
49
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
50
|
+
Updated: new Date(destination.updated_at).toLocaleString(),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
tui.table([details], undefined, { layout: 'vertical' });
|
|
54
|
+
|
|
55
|
+
if (destination.config && Object.keys(destination.config).length > 0) {
|
|
56
|
+
tui.newline();
|
|
57
|
+
tui.header('Config');
|
|
58
|
+
tui.json(destination.config);
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return { destination };
|
|
@@ -18,7 +18,9 @@ export const command = createCommand({
|
|
|
18
18
|
description: 'List destinations',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
command: getCommand(
|
|
21
|
+
command: getCommand(
|
|
22
|
+
'cloud schedule destination create url sched_abc123 https://example.com'
|
|
23
|
+
),
|
|
22
24
|
description: 'Create URL destination',
|
|
23
25
|
},
|
|
24
26
|
],
|
|
@@ -23,8 +23,7 @@ export const listSubcommand = createCommand({
|
|
|
23
23
|
aliases: ['ls'],
|
|
24
24
|
description: 'List destinations for a schedule',
|
|
25
25
|
tags: ['read-only', 'fast', 'requires-auth'],
|
|
26
|
-
requires: { auth: true
|
|
27
|
-
optional: { project: true },
|
|
26
|
+
requires: { auth: true },
|
|
28
27
|
idempotent: true,
|
|
29
28
|
examples: [
|
|
30
29
|
{
|
|
@@ -41,7 +40,7 @@ export const listSubcommand = createCommand({
|
|
|
41
40
|
|
|
42
41
|
async handler(ctx) {
|
|
43
42
|
const { args, options } = ctx;
|
|
44
|
-
const schedule = createScheduleAdapter(ctx);
|
|
43
|
+
const schedule = await createScheduleAdapter(ctx);
|
|
45
44
|
const result = await schedule.get(args.schedule_id);
|
|
46
45
|
|
|
47
46
|
if (!options.json) {
|
|
@@ -49,18 +48,26 @@ export const listSubcommand = createCommand({
|
|
|
49
48
|
tui.info('No destinations configured');
|
|
50
49
|
} else {
|
|
51
50
|
tui.table(
|
|
52
|
-
result.destinations.map(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
result.destinations.map(
|
|
52
|
+
(destination: {
|
|
53
|
+
id: string;
|
|
54
|
+
type: 'url' | 'sandbox';
|
|
55
|
+
config: Record<string, unknown>;
|
|
56
|
+
created_at: string;
|
|
57
|
+
}) => {
|
|
58
|
+
const configDisplay =
|
|
59
|
+
destination.type === 'url' && destination.config?.url
|
|
60
|
+
? String(destination.config.url)
|
|
61
|
+
: JSON.stringify(destination.config);
|
|
62
|
+
return {
|
|
63
|
+
ID: destination.id,
|
|
64
|
+
Type: destination.type,
|
|
65
|
+
URL: configDisplay,
|
|
66
|
+
Created: new Date(destination.created_at).toLocaleString(),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
['ID', 'Type', 'URL', 'Created']
|
|
64
71
|
);
|
|
65
72
|
}
|
|
66
73
|
}
|