@agentuity/cli 1.0.24 → 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.
Files changed (147) hide show
  1. package/dist/cache/index.d.ts +1 -0
  2. package/dist/cache/index.d.ts.map +1 -1
  3. package/dist/cache/index.js +1 -0
  4. package/dist/cache/index.js.map +1 -1
  5. package/dist/cache/user-cache.d.ts +20 -0
  6. package/dist/cache/user-cache.d.ts.map +1 -0
  7. package/dist/cache/user-cache.js +79 -0
  8. package/dist/cache/user-cache.js.map +1 -0
  9. package/dist/cmd/auth/logout.d.ts.map +1 -1
  10. package/dist/cmd/auth/logout.js +3 -1
  11. package/dist/cmd/auth/logout.js.map +1 -1
  12. package/dist/cmd/build/entry-generator.d.ts +4 -0
  13. package/dist/cmd/build/entry-generator.d.ts.map +1 -1
  14. package/dist/cmd/build/entry-generator.js +18 -3
  15. package/dist/cmd/build/entry-generator.js.map +1 -1
  16. package/dist/cmd/build/vite/bun-dev-server.d.ts +1 -0
  17. package/dist/cmd/build/vite/bun-dev-server.d.ts.map +1 -1
  18. package/dist/cmd/build/vite/bun-dev-server.js +11 -9
  19. package/dist/cmd/build/vite/bun-dev-server.js.map +1 -1
  20. package/dist/cmd/cloud/db/stats.d.ts.map +1 -1
  21. package/dist/cmd/cloud/db/stats.js.map +1 -1
  22. package/dist/cmd/cloud/email/create.d.ts.map +1 -1
  23. package/dist/cmd/cloud/email/create.js +1 -4
  24. package/dist/cmd/cloud/email/create.js.map +1 -1
  25. package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -1
  26. package/dist/cmd/cloud/email/destination/delete.js +5 -1
  27. package/dist/cmd/cloud/email/destination/delete.js.map +1 -1
  28. package/dist/cmd/cloud/email/get.d.ts.map +1 -1
  29. package/dist/cmd/cloud/email/get.js +1 -3
  30. package/dist/cmd/cloud/email/get.js.map +1 -1
  31. package/dist/cmd/cloud/email/send.d.ts.map +1 -1
  32. package/dist/cmd/cloud/email/send.js +1 -5
  33. package/dist/cmd/cloud/email/send.js.map +1 -1
  34. package/dist/cmd/cloud/email/stats.d.ts.map +1 -1
  35. package/dist/cmd/cloud/email/stats.js.map +1 -1
  36. package/dist/cmd/cloud/email/util.d.ts.map +1 -1
  37. package/dist/cmd/cloud/email/util.js +1 -2
  38. package/dist/cmd/cloud/email/util.js.map +1 -1
  39. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
  40. package/dist/cmd/cloud/sandbox/snapshot/build.js +4 -1
  41. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  42. package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -1
  43. package/dist/cmd/cloud/sandbox/stats.js.map +1 -1
  44. package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -1
  45. package/dist/cmd/cloud/schedule/delete.js +4 -1
  46. package/dist/cmd/cloud/schedule/delete.js.map +1 -1
  47. package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -1
  48. package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -1
  49. package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -1
  50. package/dist/cmd/cloud/schedule/destination/create.js +3 -1
  51. package/dist/cmd/cloud/schedule/destination/create.js.map +1 -1
  52. package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -1
  53. package/dist/cmd/cloud/schedule/destination/index.js.map +1 -1
  54. package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -1
  55. package/dist/cmd/cloud/schedule/destination/list.js.map +1 -1
  56. package/dist/cmd/cloud/schedule/get.d.ts.map +1 -1
  57. package/dist/cmd/cloud/schedule/get.js +4 -1
  58. package/dist/cmd/cloud/schedule/get.js.map +1 -1
  59. package/dist/cmd/cloud/schedule/index.d.ts.map +1 -1
  60. package/dist/cmd/cloud/schedule/index.js +4 -1
  61. package/dist/cmd/cloud/schedule/index.js.map +1 -1
  62. package/dist/cmd/cloud/schedule/list.d.ts.map +1 -1
  63. package/dist/cmd/cloud/schedule/list.js.map +1 -1
  64. package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -1
  65. package/dist/cmd/cloud/schedule/stats.js.map +1 -1
  66. package/dist/cmd/cloud/schedule/util.d.ts.map +1 -1
  67. package/dist/cmd/cloud/schedule/util.js +1 -2
  68. package/dist/cmd/cloud/schedule/util.js.map +1 -1
  69. package/dist/cmd/cloud/services/stats.d.ts.map +1 -1
  70. package/dist/cmd/cloud/services/stats.js.map +1 -1
  71. package/dist/cmd/cloud/stream/index.d.ts.map +1 -1
  72. package/dist/cmd/cloud/stream/index.js +7 -1
  73. package/dist/cmd/cloud/stream/index.js.map +1 -1
  74. package/dist/cmd/cloud/stream/stats.d.ts.map +1 -1
  75. package/dist/cmd/cloud/stream/stats.js.map +1 -1
  76. package/dist/cmd/cloud/task/attachment.d.ts +2 -0
  77. package/dist/cmd/cloud/task/attachment.d.ts.map +1 -0
  78. package/dist/cmd/cloud/task/attachment.js +393 -0
  79. package/dist/cmd/cloud/task/attachment.js.map +1 -0
  80. package/dist/cmd/cloud/task/create.d.ts.map +1 -1
  81. package/dist/cmd/cloud/task/create.js +126 -5
  82. package/dist/cmd/cloud/task/create.js.map +1 -1
  83. package/dist/cmd/cloud/task/get.d.ts.map +1 -1
  84. package/dist/cmd/cloud/task/get.js +29 -11
  85. package/dist/cmd/cloud/task/get.js.map +1 -1
  86. package/dist/cmd/cloud/task/index.d.ts.map +1 -1
  87. package/dist/cmd/cloud/task/index.js +13 -1
  88. package/dist/cmd/cloud/task/index.js.map +1 -1
  89. package/dist/cmd/cloud/task/list.d.ts.map +1 -1
  90. package/dist/cmd/cloud/task/list.js +31 -15
  91. package/dist/cmd/cloud/task/list.js.map +1 -1
  92. package/dist/cmd/cloud/task/stats.js +2 -0
  93. package/dist/cmd/cloud/task/stats.js.map +1 -1
  94. package/dist/cmd/cloud/task/util.d.ts.map +1 -1
  95. package/dist/cmd/cloud/task/util.js +2 -4
  96. package/dist/cmd/cloud/task/util.js.map +1 -1
  97. package/dist/cmd/cloud/webhook/create.d.ts.map +1 -1
  98. package/dist/cmd/cloud/webhook/create.js +6 -1
  99. package/dist/cmd/cloud/webhook/create.js.map +1 -1
  100. package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -1
  101. package/dist/cmd/cloud/webhook/deliveries.js +4 -1
  102. package/dist/cmd/cloud/webhook/deliveries.js.map +1 -1
  103. package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -1
  104. package/dist/cmd/cloud/webhook/destinations.js +4 -5
  105. package/dist/cmd/cloud/webhook/destinations.js.map +1 -1
  106. package/dist/cmd/dev/index.d.ts.map +1 -1
  107. package/dist/cmd/dev/index.js +80 -34
  108. package/dist/cmd/dev/index.js.map +1 -1
  109. package/package.json +6 -6
  110. package/src/cache/index.ts +2 -0
  111. package/src/cache/user-cache.ts +93 -0
  112. package/src/cmd/auth/logout.ts +3 -1
  113. package/src/cmd/build/entry-generator.ts +34 -4
  114. package/src/cmd/build/vite/bun-dev-server.ts +21 -9
  115. package/src/cmd/cloud/db/stats.ts +4 -12
  116. package/src/cmd/cloud/email/create.ts +1 -4
  117. package/src/cmd/cloud/email/destination/delete.ts +5 -1
  118. package/src/cmd/cloud/email/get.ts +1 -3
  119. package/src/cmd/cloud/email/send.ts +1 -5
  120. package/src/cmd/cloud/email/stats.ts +2 -6
  121. package/src/cmd/cloud/email/util.ts +1 -2
  122. package/src/cmd/cloud/sandbox/snapshot/build.ts +25 -6
  123. package/src/cmd/cloud/sandbox/stats.ts +2 -6
  124. package/src/cmd/cloud/schedule/delete.ts +4 -1
  125. package/src/cmd/cloud/schedule/delivery/list.ts +15 -13
  126. package/src/cmd/cloud/schedule/destination/create.ts +11 -3
  127. package/src/cmd/cloud/schedule/destination/index.ts +3 -1
  128. package/src/cmd/cloud/schedule/destination/list.ts +19 -17
  129. package/src/cmd/cloud/schedule/get.ts +25 -20
  130. package/src/cmd/cloud/schedule/index.ts +4 -1
  131. package/src/cmd/cloud/schedule/list.ts +18 -16
  132. package/src/cmd/cloud/schedule/stats.ts +1 -3
  133. package/src/cmd/cloud/schedule/util.ts +1 -2
  134. package/src/cmd/cloud/services/stats.ts +13 -39
  135. package/src/cmd/cloud/stream/index.ts +7 -1
  136. package/src/cmd/cloud/stream/stats.ts +2 -6
  137. package/src/cmd/cloud/task/attachment.ts +432 -0
  138. package/src/cmd/cloud/task/create.ts +131 -5
  139. package/src/cmd/cloud/task/get.ts +30 -12
  140. package/src/cmd/cloud/task/index.ts +13 -1
  141. package/src/cmd/cloud/task/list.ts +31 -15
  142. package/src/cmd/cloud/task/stats.ts +3 -3
  143. package/src/cmd/cloud/task/util.ts +2 -4
  144. package/src/cmd/cloud/webhook/create.ts +6 -1
  145. package/src/cmd/cloud/webhook/deliveries.ts +4 -5
  146. package/src/cmd/cloud/webhook/destinations.ts +4 -5
  147. package/src/cmd/dev/index.ts +91 -48
@@ -14,10 +14,7 @@ export const createSubcommand = createCommand({
14
14
  requires: { auth: true },
15
15
  schema: {
16
16
  options: z.object({
17
- localPart: z
18
- .string()
19
- .optional()
20
- .describe('Local part for the email address (before @)'),
17
+ localPart: z.string().optional().describe('Local part for the email address (before @)'),
21
18
  }),
22
19
  response: EmailAddressSchema,
23
20
  },
@@ -43,7 +43,11 @@ export const deleteSubcommand = createCommand({
43
43
  );
44
44
  if (!ok) {
45
45
  tui.info('Cancelled');
46
- return { success: false, address_id: args.address_id, destination_id: args.destination_id };
46
+ return {
47
+ success: false,
48
+ address_id: args.address_id,
49
+ destination_id: args.destination_id,
50
+ };
47
51
  }
48
52
  }
49
53
 
@@ -35,9 +35,7 @@ export const getSubcommand = createCommand({
35
35
  Provider: address.provider ?? '-',
36
36
  Config: address.config ? JSON.stringify(address.config) : '-',
37
37
  Created: new Date(address.created_at).toLocaleString(),
38
- Updated: address.updated_at
39
- ? new Date(address.updated_at).toLocaleString()
40
- : '-',
38
+ Updated: address.updated_at ? new Date(address.updated_at).toLocaleString() : '-',
41
39
  },
42
40
  ],
43
41
  ['ID', 'Email', 'Project', 'Provider', 'Config', 'Created', 'Updated'],
@@ -32,11 +32,7 @@ export const sendSubcommand = createCommand({
32
32
  tui.fatal('At least one of --text or --html is required');
33
33
  }
34
34
 
35
- const fileValues = Array.isArray(opts.file)
36
- ? opts.file
37
- : opts.file
38
- ? [opts.file]
39
- : [];
35
+ const fileValues = Array.isArray(opts.file) ? opts.file : opts.file ? [opts.file] : [];
40
36
 
41
37
  const attachments: EmailAttachment[] = [];
42
38
  for (const filePath of fileValues) {
@@ -19,12 +19,8 @@ function displayStats(data: ServiceStatsData): void {
19
19
  }
20
20
  tui.header('Email Statistics');
21
21
  tui.newline();
22
- console.log(
23
- ` ${tui.muted('Addresses:')} ${formatNumber(svc.addressCount)}`
24
- );
25
- console.log(
26
- ` ${tui.muted('Inbound:')} ${formatNumber(svc.inboundCount)}`
27
- );
22
+ console.log(` ${tui.muted('Addresses:')} ${formatNumber(svc.addressCount)}`);
23
+ console.log(` ${tui.muted('Inbound:')} ${formatNumber(svc.inboundCount)}`);
28
24
  console.log(
29
25
  ` ${tui.muted('Outbound:')} ${formatNumber(svc.outboundCount)} (${svc.outboundSuccess} ok, ${svc.outboundFailed} failed)`
30
26
  );
@@ -24,8 +24,7 @@ export interface EmailContext {
24
24
 
25
25
  export function resolveEmailOrgId(ctx: EmailContext): string {
26
26
  const orgId =
27
- ctx.options.orgId ??
28
- (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
27
+ ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
29
28
 
30
29
  if (!orgId) {
31
30
  tui.fatal('Organization ID is required. Use --org-id flag or set AGENTUITY_CLOUD_ORG_ID.');
@@ -358,7 +358,9 @@ export const buildSubcommand = createCommand({
358
358
  description: 'Build using a custom build file',
359
359
  },
360
360
  {
361
- command: getCommand('cloud sandbox snapshot build . --env API_KEY=secret --tag production'),
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.array(z.string()).optional().describe('Environment variable substitution (KEY=VALUE)'),
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(`Invalid snapshot tag: must be at most ${MAX_SNAPSHOT_TAG_LENGTH} characters`);
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(buildConfig.dependencies!, region, config, logger);
586
+ return await validateAptDependencies(
587
+ buildConfig.dependencies!,
588
+ region,
589
+ config,
590
+ logger
591
+ );
580
592
  },
581
593
  });
582
594
 
@@ -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(uploadFile, uploadSize, updateProgress);
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('Snapshot build failed due to malware detection', ErrorCode.MALWARE_DETECTED);
952
+ tui.fatal(
953
+ 'Snapshot build failed due to malware detection',
954
+ ErrorCode.MALWARE_DETECTED
955
+ );
937
956
  }
938
957
 
939
958
  throw err;
@@ -27,13 +27,9 @@ function displayStats(data: ServiceStatsData): void {
27
27
  console.log(
28
28
  ` ${tui.muted('Active:')} ${formatNumber(svc.totalActive)} (${svc.running} running, ${svc.idle} idle, ${svc.creating} creating)`
29
29
  );
30
- console.log(
31
- ` ${tui.muted('Executions:')} ${formatNumber(svc.totalExecutions)}`
32
- );
30
+ console.log(` ${tui.muted('Executions:')} ${formatNumber(svc.totalExecutions)}`);
33
31
  console.log(` ${tui.muted('CPU Time:')} ${formatLatency(svc.totalCpuTimeMs)}`);
34
- console.log(
35
- ` ${tui.muted('Memory:')} ${tui.formatBytes(svc.totalMemoryByteSec)}`
36
- );
32
+ console.log(` ${tui.muted('Memory:')} ${tui.formatBytes(svc.totalMemoryByteSec)}`);
37
33
  console.log(
38
34
  ` ${tui.muted('Network Out:')} ${tui.formatBytes(svc.totalNetworkEgressBytes)}`
39
35
  );
@@ -17,7 +17,10 @@ export const deleteSubcommand = createCommand({
17
17
  requires: { auth: true },
18
18
  idempotent: true,
19
19
  examples: [
20
- { command: getCommand('cloud schedule delete sched_abc123'), description: 'Delete a schedule' },
20
+ {
21
+ command: getCommand('cloud schedule delete sched_abc123'),
22
+ description: 'Delete a schedule',
23
+ },
21
24
  ],
22
25
  schema: {
23
26
  args: z.object({
@@ -56,19 +56,21 @@ export const listSubcommand = createCommand({
56
56
  tui.info('No deliveries found');
57
57
  } else {
58
58
  tui.table(
59
- result.deliveries.map((delivery: {
60
- id: string;
61
- date: string;
62
- status: 'pending' | 'success' | 'failed';
63
- retries: number;
64
- schedule_destination_id: string;
65
- }) => ({
66
- ID: delivery.id,
67
- Date: new Date(delivery.date).toLocaleString(),
68
- Status: delivery.status,
69
- Retries: delivery.retries,
70
- 'Destination ID': delivery.schedule_destination_id,
71
- })),
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
+ ),
72
74
  ['ID', 'Date', 'Status', 'Retries', 'Destination ID']
73
75
  );
74
76
  }
@@ -23,11 +23,15 @@ export const createSubcommand = createCommand({
23
23
  requires: { auth: true },
24
24
  examples: [
25
25
  {
26
- command: getCommand('cloud schedule destination create url sched_abc123 https://example.com'),
26
+ command: getCommand(
27
+ 'cloud schedule destination create url sched_abc123 https://example.com'
28
+ ),
27
29
  description: 'Create URL destination',
28
30
  },
29
31
  {
30
- command: getCommand('cloud schedule destination create url sched_abc123 https://example.com --method POST'),
32
+ command: getCommand(
33
+ 'cloud schedule destination create url sched_abc123 https://example.com --method POST'
34
+ ),
31
35
  description: 'Create URL destination with POST method',
32
36
  },
33
37
  ],
@@ -52,7 +56,11 @@ export const createSubcommand = createCommand({
52
56
  if (args.type === 'sandbox' && !args.target.startsWith('sbx_')) {
53
57
  tui.fatal('Sandbox target must start with "sbx_"');
54
58
  }
55
- if (args.type === 'url' && !args.target.startsWith('http://') && !args.target.startsWith('https://')) {
59
+ if (
60
+ args.type === 'url' &&
61
+ !args.target.startsWith('http://') &&
62
+ !args.target.startsWith('https://')
63
+ ) {
56
64
  tui.fatal('URL target must start with http:// or https://');
57
65
  }
58
66
 
@@ -18,7 +18,9 @@ export const command = createCommand({
18
18
  description: 'List destinations',
19
19
  },
20
20
  {
21
- command: getCommand('cloud schedule destination create url sched_abc123 https://example.com'),
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
  ],
@@ -48,23 +48,25 @@ export const listSubcommand = createCommand({
48
48
  tui.info('No destinations configured');
49
49
  } else {
50
50
  tui.table(
51
- result.destinations.map((destination: {
52
- id: string;
53
- type: 'url' | 'sandbox';
54
- config: Record<string, unknown>;
55
- created_at: string;
56
- }) => {
57
- const configDisplay =
58
- destination.type === 'url' && destination.config?.url
59
- ? String(destination.config.url)
60
- : JSON.stringify(destination.config);
61
- return {
62
- ID: destination.id,
63
- Type: destination.type,
64
- URL: configDisplay,
65
- Created: new Date(destination.created_at).toLocaleString(),
66
- };
67
- }),
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
+ ),
68
70
  ['ID', 'Type', 'URL', 'Created']
69
71
  );
70
72
  }
@@ -34,9 +34,12 @@ export const getSubcommand = createCommand({
34
34
  tags: ['read-only', 'fast', 'requires-auth'],
35
35
  requires: { auth: true },
36
36
  idempotent: true,
37
- examples: [
38
- { command: getCommand('cloud schedule get sched_abc123'), description: 'Get schedule details' },
39
- ],
37
+ examples: [
38
+ {
39
+ command: getCommand('cloud schedule get sched_abc123'),
40
+ description: 'Get schedule details',
41
+ },
42
+ ],
40
43
  schema: {
41
44
  args: z.object({
42
45
  schedule_id: z.string().min(1).describe('Schedule ID'),
@@ -68,23 +71,25 @@ export const getSubcommand = createCommand({
68
71
  tui.info('No destinations configured');
69
72
  } else {
70
73
  tui.table(
71
- result.destinations.map((destination: {
72
- id: string;
73
- type: 'url' | 'sandbox';
74
- config: Record<string, unknown>;
75
- created_at: string;
76
- }) => {
77
- const configDisplay =
78
- destination.type === 'url' && destination.config?.url
79
- ? String(destination.config.url)
80
- : JSON.stringify(destination.config);
81
- return {
82
- ID: destination.id,
83
- Type: destination.type,
84
- URL: configDisplay,
85
- Created: new Date(destination.created_at).toLocaleString(),
86
- };
87
- }),
74
+ result.destinations.map(
75
+ (destination: {
76
+ id: string;
77
+ type: 'url' | 'sandbox';
78
+ config: Record<string, unknown>;
79
+ created_at: string;
80
+ }) => {
81
+ const configDisplay =
82
+ destination.type === 'url' && destination.config?.url
83
+ ? String(destination.config.url)
84
+ : JSON.stringify(destination.config);
85
+ return {
86
+ ID: destination.id,
87
+ Type: destination.type,
88
+ URL: configDisplay,
89
+ Created: new Date(destination.created_at).toLocaleString(),
90
+ };
91
+ }
92
+ ),
88
93
  ['ID', 'Type', 'URL', 'Created']
89
94
  );
90
95
  }
@@ -31,7 +31,10 @@ export const command = createCommand({
31
31
  command: getCommand("cloud schedule create --name nightly --expression '0 0 * * *'"),
32
32
  description: 'Create a schedule',
33
33
  },
34
- { command: getCommand('cloud schedule get sched_abc123'), description: 'Get schedule details' },
34
+ {
35
+ command: getCommand('cloud schedule get sched_abc123'),
36
+ description: 'Get schedule details',
37
+ },
35
38
  ],
36
39
  });
37
40
 
@@ -49,22 +49,24 @@ export const listSubcommand = createCommand({
49
49
  tui.info('No schedules found');
50
50
  } else {
51
51
  tui.table(
52
- result.schedules.map((item: {
53
- id: string;
54
- created_at: string;
55
- updated_at: string;
56
- created_by: string;
57
- name: string;
58
- description: string | null;
59
- expression: string;
60
- due_date: string;
61
- }) => ({
62
- Name: item.name,
63
- ID: item.id,
64
- Expression: item.expression,
65
- 'Next Due': item.due_date,
66
- Created: new Date(item.created_at).toLocaleString(),
67
- })),
52
+ result.schedules.map(
53
+ (item: {
54
+ id: string;
55
+ created_at: string;
56
+ updated_at: string;
57
+ created_by: string;
58
+ name: string;
59
+ description: string | null;
60
+ expression: string;
61
+ due_date: string;
62
+ }) => ({
63
+ Name: item.name,
64
+ ID: item.id,
65
+ Expression: item.expression,
66
+ 'Next Due': item.due_date,
67
+ Created: new Date(item.created_at).toLocaleString(),
68
+ })
69
+ ),
68
70
  ['Name', 'ID', 'Expression', 'Next Due', 'Created']
69
71
  );
70
72
  }
@@ -19,9 +19,7 @@ function displayStats(data: ServiceStatsData): void {
19
19
  }
20
20
  tui.header('Schedule Statistics');
21
21
  tui.newline();
22
- console.log(
23
- ` ${tui.muted('Schedules:')} ${formatNumber(svc.scheduleCount)}`
24
- );
22
+ console.log(` ${tui.muted('Schedules:')} ${formatNumber(svc.scheduleCount)}`);
25
23
  console.log(
26
24
  ` ${tui.muted('Deliveries:')} ${formatNumber(svc.totalDeliveries)} (${svc.successDeliveries} ok, ${svc.failedDeliveries} failed)`
27
25
  );
@@ -14,8 +14,7 @@ export interface ScheduleContext {
14
14
 
15
15
  export async function createScheduleAdapter(ctx: ScheduleContext) {
16
16
  const orgId =
17
- ctx.options.orgId ??
18
- (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
17
+ ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
19
18
  if (!orgId) {
20
19
  tui.fatal('Organization ID is required. Use --org-id flag or set AGENTUITY_CLOUD_ORG_ID.');
21
20
  }
@@ -34,9 +34,7 @@ function displayServiceStats(data: ServiceStatsData): void {
34
34
  console.log(
35
35
  ` ${tui.muted('Namespaces:')} ${formatNumber(services.keyvalue.namespaceCount)}`
36
36
  );
37
- console.log(
38
- ` ${tui.muted('Keys:')} ${formatNumber(services.keyvalue.keyCount)}`
39
- );
37
+ console.log(` ${tui.muted('Keys:')} ${formatNumber(services.keyvalue.keyCount)}`);
40
38
  console.log(
41
39
  ` ${tui.muted('Total Size:')} ${tui.formatBytes(services.keyvalue.totalSizeBytes)}`
42
40
  );
@@ -61,15 +59,11 @@ function displayServiceStats(data: ServiceStatsData): void {
61
59
  hasData = true;
62
60
  tui.newline();
63
61
  console.log(tui.colorPrimary('Queue:'));
64
- console.log(
65
- ` ${tui.muted('Queues:')} ${formatNumber(services.queue.queueCount)}`
66
- );
62
+ console.log(` ${tui.muted('Queues:')} ${formatNumber(services.queue.queueCount)}`);
67
63
  console.log(
68
64
  ` ${tui.muted('Total Messages:')} ${formatNumber(services.queue.totalMessages)}`
69
65
  );
70
- console.log(
71
- ` ${tui.muted('DLQ Messages:')} ${formatNumber(services.queue.totalDlq)}`
72
- );
66
+ console.log(` ${tui.muted('DLQ Messages:')} ${formatNumber(services.queue.totalDlq)}`);
73
67
  }
74
68
 
75
69
  if (services.stream) {
@@ -92,13 +86,9 @@ function displayServiceStats(data: ServiceStatsData): void {
92
86
  console.log(
93
87
  ` ${tui.muted('Active:')} ${formatNumber(sb.totalActive)} (${sb.running} running, ${sb.idle} idle, ${sb.creating} creating)`
94
88
  );
95
- console.log(
96
- ` ${tui.muted('Executions:')} ${formatNumber(sb.totalExecutions)}`
97
- );
89
+ console.log(` ${tui.muted('Executions:')} ${formatNumber(sb.totalExecutions)}`);
98
90
  console.log(` ${tui.muted('CPU Time:')} ${formatLatency(sb.totalCpuTimeMs)}`);
99
- console.log(
100
- ` ${tui.muted('Memory:')} ${tui.formatBytes(sb.totalMemoryByteSec)}`
101
- );
91
+ console.log(` ${tui.muted('Memory:')} ${tui.formatBytes(sb.totalMemoryByteSec)}`);
102
92
  console.log(
103
93
  ` ${tui.muted('Network Out:')} ${tui.formatBytes(sb.totalNetworkEgressBytes)}`
104
94
  );
@@ -109,12 +99,8 @@ function displayServiceStats(data: ServiceStatsData): void {
109
99
  const em = services.email;
110
100
  tui.newline();
111
101
  console.log(tui.colorPrimary('Email:'));
112
- console.log(
113
- ` ${tui.muted('Addresses:')} ${formatNumber(em.addressCount)}`
114
- );
115
- console.log(
116
- ` ${tui.muted('Inbound:')} ${formatNumber(em.inboundCount)}`
117
- );
102
+ console.log(` ${tui.muted('Addresses:')} ${formatNumber(em.addressCount)}`);
103
+ console.log(` ${tui.muted('Inbound:')} ${formatNumber(em.inboundCount)}`);
118
104
  console.log(
119
105
  ` ${tui.muted('Outbound:')} ${formatNumber(em.outboundCount)} (${em.outboundSuccess} ok, ${em.outboundFailed} failed)`
120
106
  );
@@ -127,9 +113,7 @@ function displayServiceStats(data: ServiceStatsData): void {
127
113
  console.log(tui.colorPrimary('Task:'));
128
114
  console.log(` ${tui.muted('Total:')} ${formatNumber(tk.total)}`);
129
115
  console.log(` ${tui.muted('Open:')} ${formatNumber(tk.open)}`);
130
- console.log(
131
- ` ${tui.muted('In Progress:')} ${formatNumber(tk.inProgress)}`
132
- );
116
+ console.log(` ${tui.muted('In Progress:')} ${formatNumber(tk.inProgress)}`);
133
117
  console.log(` ${tui.muted('Closed:')} ${formatNumber(tk.closed)}`);
134
118
  }
135
119
 
@@ -138,9 +122,7 @@ function displayServiceStats(data: ServiceStatsData): void {
138
122
  const sc = services.schedule;
139
123
  tui.newline();
140
124
  console.log(tui.colorPrimary('Schedule:'));
141
- console.log(
142
- ` ${tui.muted('Schedules:')} ${formatNumber(sc.scheduleCount)}`
143
- );
125
+ console.log(` ${tui.muted('Schedules:')} ${formatNumber(sc.scheduleCount)}`);
144
126
  console.log(
145
127
  ` ${tui.muted('Deliveries:')} ${formatNumber(sc.totalDeliveries)} (${sc.successDeliveries} ok, ${sc.failedDeliveries} failed)`
146
128
  );
@@ -151,18 +133,10 @@ function displayServiceStats(data: ServiceStatsData): void {
151
133
  const db = services.database;
152
134
  tui.newline();
153
135
  console.log(tui.colorPrimary('Database:'));
154
- console.log(
155
- ` ${tui.muted('Databases:')} ${formatNumber(db.databaseCount)}`
156
- );
157
- console.log(
158
- ` ${tui.muted('Tables:')} ${formatNumber(db.totalTableCount)}`
159
- );
160
- console.log(
161
- ` ${tui.muted('Records:')} ${formatNumber(db.totalRecordCount)}`
162
- );
163
- console.log(
164
- ` ${tui.muted('Total Size:')} ${tui.formatBytes(db.totalSizeBytes)}`
165
- );
136
+ console.log(` ${tui.muted('Databases:')} ${formatNumber(db.databaseCount)}`);
137
+ console.log(` ${tui.muted('Tables:')} ${formatNumber(db.totalTableCount)}`);
138
+ console.log(` ${tui.muted('Records:')} ${formatNumber(db.totalRecordCount)}`);
139
+ console.log(` ${tui.muted('Total Size:')} ${tui.formatBytes(db.totalSizeBytes)}`);
166
140
  }
167
141
 
168
142
  if (!hasData) {
@@ -23,7 +23,13 @@ export const streamCommand = createCommand({
23
23
  { command: getCommand('cloud stream list'), description: 'List all streams' },
24
24
  { command: getCommand('cloud stream get <id>'), description: 'Get stream details' },
25
25
  ],
26
- subcommands: [createSubcommand, listSubcommand, getSubcommand, deleteSubcommand, statsSubcommand],
26
+ subcommands: [
27
+ createSubcommand,
28
+ listSubcommand,
29
+ getSubcommand,
30
+ deleteSubcommand,
31
+ statsSubcommand,
32
+ ],
27
33
  });
28
34
 
29
35
  export default streamCommand;
@@ -19,12 +19,8 @@ function displayStats(data: ServiceStatsData): void {
19
19
  }
20
20
  tui.header('Stream Statistics');
21
21
  tui.newline();
22
- console.log(
23
- ` ${tui.muted('Streams:')} ${formatNumber(svc.streamCount)}`
24
- );
25
- console.log(
26
- ` ${tui.muted('Total Size:')} ${tui.formatBytes(svc.totalSizeBytes)}`
27
- );
22
+ console.log(` ${tui.muted('Streams:')} ${formatNumber(svc.streamCount)}`);
23
+ console.log(` ${tui.muted('Total Size:')} ${tui.formatBytes(svc.totalSizeBytes)}`);
28
24
  }
29
25
 
30
26
  export const statsSubcommand = createCommand({