@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
|
@@ -4,6 +4,13 @@ import * as tui from '../../../tui';
|
|
|
4
4
|
import { createStorageAdapter, cacheTaskId } from './util';
|
|
5
5
|
import { getCommand } from '../../../command-prefix';
|
|
6
6
|
|
|
7
|
+
const EntityRefSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
name: z.string(),
|
|
11
|
+
})
|
|
12
|
+
.optional();
|
|
13
|
+
|
|
7
14
|
const TaskGetResponseSchema = z.object({
|
|
8
15
|
success: z.boolean().describe('Whether the operation succeeded'),
|
|
9
16
|
task: z.object({
|
|
@@ -14,15 +21,17 @@ const TaskGetResponseSchema = z.object({
|
|
|
14
21
|
status: z.string().describe('Task status'),
|
|
15
22
|
priority: z.string().describe('Task priority'),
|
|
16
23
|
parent_id: z.string().optional().describe('Parent task ID'),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
creator: EntityRefSchema.describe('Creator'),
|
|
25
|
+
assignee: EntityRefSchema.describe('Assignee'),
|
|
26
|
+
closer: EntityRefSchema.describe('Closer'),
|
|
27
|
+
project: EntityRefSchema.describe('Project'),
|
|
20
28
|
metadata: z.record(z.string(), z.unknown()).optional().describe('Task metadata'),
|
|
21
29
|
created_at: z.string().describe('Creation timestamp'),
|
|
22
30
|
updated_at: z.string().describe('Last update timestamp'),
|
|
23
31
|
open_date: z.string().optional().describe('Date task was opened'),
|
|
24
32
|
in_progress_date: z.string().optional().describe('Date task moved to in-progress'),
|
|
25
33
|
closed_date: z.string().optional().describe('Date task was closed'),
|
|
34
|
+
cancelled_date: z.string().optional().describe('Date task was cancelled'),
|
|
26
35
|
}),
|
|
27
36
|
durationMs: z.number().describe('Operation duration in milliseconds'),
|
|
28
37
|
});
|
|
@@ -34,7 +43,6 @@ export const getSubcommand = createCommand({
|
|
|
34
43
|
tags: ['read-only', 'slow', 'requires-auth'],
|
|
35
44
|
idempotent: true,
|
|
36
45
|
requires: { auth: true },
|
|
37
|
-
optional: { project: true },
|
|
38
46
|
examples: [
|
|
39
47
|
{
|
|
40
48
|
command: getCommand('cloud task get task_abc123'),
|
|
@@ -79,16 +87,20 @@ export const getSubcommand = createCommand({
|
|
|
79
87
|
tableData['Description'] = task.description;
|
|
80
88
|
}
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
if (task.creator) {
|
|
91
|
+
tableData['Creator'] = `${task.creator.name} (${task.creator.id})`;
|
|
92
|
+
}
|
|
93
|
+
if (task.assignee) {
|
|
94
|
+
tableData['Assigned'] = `${task.assignee.name} (${task.assignee.id})`;
|
|
95
|
+
}
|
|
96
|
+
if (task.project) {
|
|
97
|
+
tableData['Project'] = `${task.project.name} (${task.project.id})`;
|
|
86
98
|
}
|
|
87
99
|
if (task.parent_id) {
|
|
88
100
|
tableData['Parent'] = task.parent_id;
|
|
89
101
|
}
|
|
90
|
-
if (task.
|
|
91
|
-
tableData['Closed By'] = task.
|
|
102
|
+
if (task.closer) {
|
|
103
|
+
tableData['Closed By'] = `${task.closer.name} (${task.closer.id})`;
|
|
92
104
|
}
|
|
93
105
|
|
|
94
106
|
tableData['Created'] = new Date(task.created_at).toLocaleString();
|
|
@@ -103,11 +115,16 @@ export const getSubcommand = createCommand({
|
|
|
103
115
|
if (task.closed_date) {
|
|
104
116
|
tableData['Closed'] = new Date(task.closed_date).toLocaleString();
|
|
105
117
|
}
|
|
106
|
-
if (task.
|
|
107
|
-
tableData['
|
|
118
|
+
if (task.cancelled_date) {
|
|
119
|
+
tableData['Cancelled'] = new Date(task.cancelled_date).toLocaleString();
|
|
108
120
|
}
|
|
109
|
-
|
|
110
121
|
tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
|
|
122
|
+
|
|
123
|
+
if (task.metadata && Object.keys(task.metadata).length > 0) {
|
|
124
|
+
tui.newline();
|
|
125
|
+
tui.header('Metadata');
|
|
126
|
+
tui.json(task.metadata);
|
|
127
|
+
}
|
|
111
128
|
}
|
|
112
129
|
|
|
113
130
|
return {
|
|
@@ -120,15 +137,17 @@ export const getSubcommand = createCommand({
|
|
|
120
137
|
status: task.status,
|
|
121
138
|
priority: task.priority,
|
|
122
139
|
parent_id: task.parent_id,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
140
|
+
creator: task.creator,
|
|
141
|
+
assignee: task.assignee,
|
|
142
|
+
closer: task.closer,
|
|
143
|
+
project: task.project,
|
|
126
144
|
metadata: task.metadata,
|
|
127
145
|
created_at: task.created_at,
|
|
128
146
|
updated_at: task.updated_at,
|
|
129
147
|
open_date: task.open_date,
|
|
130
148
|
in_progress_date: task.in_progress_date,
|
|
131
149
|
closed_date: task.closed_date,
|
|
150
|
+
cancelled_date: task.cancelled_date,
|
|
132
151
|
},
|
|
133
152
|
durationMs,
|
|
134
153
|
};
|
|
@@ -3,6 +3,8 @@ import { getSubcommand } from './get';
|
|
|
3
3
|
import { createSubcommand } from './create';
|
|
4
4
|
import { updateSubcommand } from './update';
|
|
5
5
|
import { listSubcommand } from './list';
|
|
6
|
+
import { statsSubcommand } from './stats';
|
|
7
|
+
import { attachmentSubcommand } from './attachment';
|
|
6
8
|
import { getCommand } from '../../../command-prefix';
|
|
7
9
|
|
|
8
10
|
export const taskCommand = createCommand({
|
|
@@ -26,8 +28,19 @@ export const taskCommand = createCommand({
|
|
|
26
28
|
command: getCommand('cloud task update task_abc123 --status in_progress'),
|
|
27
29
|
description: 'Update task status',
|
|
28
30
|
},
|
|
31
|
+
{
|
|
32
|
+
command: getCommand('cloud task attachment upload task_abc123 ./report.pdf'),
|
|
33
|
+
description: 'Upload a file attachment to a task',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
subcommands: [
|
|
37
|
+
getSubcommand,
|
|
38
|
+
createSubcommand,
|
|
39
|
+
updateSubcommand,
|
|
40
|
+
listSubcommand,
|
|
41
|
+
statsSubcommand,
|
|
42
|
+
attachmentSubcommand,
|
|
29
43
|
],
|
|
30
|
-
subcommands: [getSubcommand, createSubcommand, updateSubcommand, listSubcommand],
|
|
31
44
|
requires: { auth: true },
|
|
32
45
|
});
|
|
33
46
|
|
|
@@ -14,7 +14,24 @@ const TaskListResponseSchema = z.object({
|
|
|
14
14
|
type: z.string(),
|
|
15
15
|
status: z.string(),
|
|
16
16
|
priority: z.string(),
|
|
17
|
-
|
|
17
|
+
creator: z
|
|
18
|
+
.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
name: z.string(),
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
23
|
+
assignee: z
|
|
24
|
+
.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
name: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
project: z
|
|
30
|
+
.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
18
35
|
created_at: z.string(),
|
|
19
36
|
updated_at: z.string(),
|
|
20
37
|
})
|
|
@@ -35,7 +52,9 @@ const PRIORITY_COLORS: Record<string, (s: string) => string> = {
|
|
|
35
52
|
const STATUS_COLORS: Record<string, (s: string) => string> = {
|
|
36
53
|
open: tui.colorSuccess,
|
|
37
54
|
in_progress: tui.colorWarning,
|
|
55
|
+
done: tui.colorInfo,
|
|
38
56
|
closed: tui.muted,
|
|
57
|
+
cancelled: tui.muted,
|
|
39
58
|
};
|
|
40
59
|
|
|
41
60
|
function formatPriority(p: string): string {
|
|
@@ -59,7 +78,6 @@ export const listSubcommand = createCommand({
|
|
|
59
78
|
description: 'List tasks with optional filtering and sorting',
|
|
60
79
|
tags: ['read-only', 'slow', 'requires-auth'],
|
|
61
80
|
requires: { auth: true },
|
|
62
|
-
optional: { project: true },
|
|
63
81
|
idempotent: true,
|
|
64
82
|
pagination: {
|
|
65
83
|
supported: true,
|
|
@@ -87,7 +105,10 @@ export const listSubcommand = createCommand({
|
|
|
87
105
|
],
|
|
88
106
|
schema: {
|
|
89
107
|
options: z.object({
|
|
90
|
-
status: z
|
|
108
|
+
status: z
|
|
109
|
+
.enum(['open', 'in_progress', 'done', 'closed', 'cancelled'])
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('filter by status'),
|
|
91
112
|
type: z
|
|
92
113
|
.enum(['epic', 'feature', 'enhancement', 'bug', 'task'])
|
|
93
114
|
.optional()
|
|
@@ -99,17 +120,7 @@ export const listSubcommand = createCommand({
|
|
|
99
120
|
assignedId: z.string().optional().describe('filter by assigned agent or user ID'),
|
|
100
121
|
parentId: z.string().optional().describe('filter by parent task ID'),
|
|
101
122
|
sort: z
|
|
102
|
-
.enum([
|
|
103
|
-
'created_at',
|
|
104
|
-
'updated_at',
|
|
105
|
-
'priority',
|
|
106
|
-
'status',
|
|
107
|
-
'title',
|
|
108
|
-
'type',
|
|
109
|
-
'open_date',
|
|
110
|
-
'in_progress_date',
|
|
111
|
-
'closed_date',
|
|
112
|
-
])
|
|
123
|
+
.enum(['created_at', 'updated_at', 'priority'])
|
|
113
124
|
.optional()
|
|
114
125
|
.describe('field to sort by (default: created_at)'),
|
|
115
126
|
order: z.enum(['asc', 'desc']).optional().describe('sort order (default: desc)'),
|
|
@@ -148,7 +159,8 @@ export const listSubcommand = createCommand({
|
|
|
148
159
|
Type: task.type,
|
|
149
160
|
Status: formatStatus(task.status),
|
|
150
161
|
Priority: formatPriority(task.priority),
|
|
151
|
-
|
|
162
|
+
Creator: task.creator?.name ? truncate(task.creator.name, 20) : tui.muted('—'),
|
|
163
|
+
Assigned: task.assignee?.name ? truncate(task.assignee.name, 20) : tui.muted('—'),
|
|
152
164
|
Updated: new Date(task.updated_at).toLocaleDateString(),
|
|
153
165
|
}));
|
|
154
166
|
|
|
@@ -158,12 +170,13 @@ export const listSubcommand = createCommand({
|
|
|
158
170
|
{ name: 'Type', alignment: 'left' },
|
|
159
171
|
{ name: 'Status', alignment: 'left' },
|
|
160
172
|
{ name: 'Priority', alignment: 'left' },
|
|
173
|
+
{ name: 'Creator', alignment: 'left' },
|
|
161
174
|
{ name: 'Assigned', alignment: 'left' },
|
|
162
175
|
{ name: 'Updated', alignment: 'left' },
|
|
163
176
|
]);
|
|
164
177
|
|
|
165
178
|
tui.info(
|
|
166
|
-
|
|
179
|
+
`Showing ${result.tasks.length} of ${result.total} ${tui.plural(result.total, 'task', 'tasks')} (${durationMs.toFixed(1)}ms)`
|
|
167
180
|
);
|
|
168
181
|
}
|
|
169
182
|
}
|
|
@@ -176,7 +189,9 @@ export const listSubcommand = createCommand({
|
|
|
176
189
|
type: task.type,
|
|
177
190
|
status: task.status,
|
|
178
191
|
priority: task.priority,
|
|
179
|
-
|
|
192
|
+
creator: task.creator,
|
|
193
|
+
assignee: task.assignee,
|
|
194
|
+
project: task.project,
|
|
180
195
|
created_at: task.created_at,
|
|
181
196
|
updated_at: task.updated_at,
|
|
182
197
|
})),
|
|
@@ -0,0 +1,74 @@
|
|
|
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 displayStats(data: ServiceStatsData): void {
|
|
15
|
+
const svc = data.services.task;
|
|
16
|
+
if (!svc) {
|
|
17
|
+
tui.info('No task data found.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
tui.header('Task Statistics');
|
|
21
|
+
tui.newline();
|
|
22
|
+
console.log(` ${tui.muted('Total:')} ${formatNumber(svc.total)}`);
|
|
23
|
+
console.log(` ${tui.muted('Open:')} ${formatNumber(svc.open)}`);
|
|
24
|
+
console.log(` ${tui.muted('In Progress:')} ${formatNumber(svc.inProgress)}`);
|
|
25
|
+
console.log(` ${tui.muted('Done:')} ${formatNumber(svc.done)}`);
|
|
26
|
+
console.log(` ${tui.muted('Closed:')} ${formatNumber(svc.closed)}`);
|
|
27
|
+
console.log(` ${tui.muted('Cancelled:')} ${formatNumber(svc.cancelled)}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const statsSubcommand = createCommand({
|
|
31
|
+
name: 'stats',
|
|
32
|
+
description: 'View task statistics',
|
|
33
|
+
tags: ['read-only', 'requires-auth'],
|
|
34
|
+
requires: { auth: true, org: true },
|
|
35
|
+
examples: [
|
|
36
|
+
{
|
|
37
|
+
command: getCommand('cloud task stats'),
|
|
38
|
+
description: 'View task statistics',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
schema: {
|
|
42
|
+
options: z.object({
|
|
43
|
+
start: z.string().optional().describe('Start time (ISO 8601)'),
|
|
44
|
+
end: z.string().optional().describe('End time (ISO 8601)'),
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
idempotent: true,
|
|
48
|
+
|
|
49
|
+
async handler(ctx) {
|
|
50
|
+
const { opts, options } = ctx;
|
|
51
|
+
const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
|
|
52
|
+
const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
|
|
53
|
+
|
|
54
|
+
if (!orgId) {
|
|
55
|
+
ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const data = await getServiceStats(client, orgId, {
|
|
60
|
+
service: 'task',
|
|
61
|
+
start: opts.start,
|
|
62
|
+
end: opts.end,
|
|
63
|
+
orgIdHeader: orgId,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (!options.json) {
|
|
67
|
+
displayStats(data);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return data;
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export default statsSubcommand;
|
|
@@ -24,7 +24,6 @@ export const updateSubcommand = createCommand({
|
|
|
24
24
|
description: 'Update an existing task',
|
|
25
25
|
tags: ['mutating', 'slow', 'requires-auth'],
|
|
26
26
|
requires: { auth: true },
|
|
27
|
-
optional: { project: true },
|
|
28
27
|
examples: [
|
|
29
28
|
{
|
|
30
29
|
command: getCommand('cloud task update task_abc123 --status in_progress'),
|
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { TaskStorageService, type Logger } from '@agentuity/core';
|
|
2
2
|
import { createServerFetchAdapter } from '@agentuity/server';
|
|
3
|
-
import type { AuthData, Config, GlobalOptions
|
|
3
|
+
import type { AuthData, Config, GlobalOptions } from '../../../types';
|
|
4
4
|
import { getCatalystUrl } from '../../../catalyst';
|
|
5
5
|
import { setResourceInfo } from '../../../cache';
|
|
6
6
|
import { defaultProfileName, getDefaultRegion } from '../../../config';
|
|
7
7
|
import * as tui from '../../../tui';
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
explicitOrgId?: string
|
|
19
|
-
) {
|
|
9
|
+
export interface TaskContext {
|
|
10
|
+
logger: Logger;
|
|
11
|
+
auth: AuthData;
|
|
12
|
+
config: Config | null;
|
|
13
|
+
options: GlobalOptions;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function createStorageAdapter(ctx: TaskContext) {
|
|
20
17
|
const orgId =
|
|
21
|
-
|
|
22
|
-
ctx.project?.orgId ??
|
|
23
|
-
ctx.options.orgId ??
|
|
24
|
-
(process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
18
|
+
ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
25
19
|
if (!orgId) {
|
|
26
|
-
tui.fatal(
|
|
27
|
-
'Organization ID is required. Either run from a project directory or use --org-id flag.'
|
|
28
|
-
);
|
|
20
|
+
tui.fatal('Organization ID is required. Use --org-id flag or set AGENTUITY_CLOUD_ORG_ID.');
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
const adapter = createServerFetchAdapter(
|
|
@@ -39,28 +31,22 @@ export async function createStorageAdapter(
|
|
|
39
31
|
);
|
|
40
32
|
|
|
41
33
|
// Task tenant DB is not regional — any Catalyst can serve the request.
|
|
42
|
-
|
|
43
|
-
const region =
|
|
44
|
-
ctx.region ?? (await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config));
|
|
34
|
+
const region = await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config);
|
|
45
35
|
const baseUrl = getCatalystUrl(region);
|
|
46
36
|
return new TaskStorageService(baseUrl, adapter);
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
export async function cacheTaskId(
|
|
50
40
|
ctx: {
|
|
51
|
-
region?: string;
|
|
52
|
-
project?: ProjectConfig;
|
|
53
41
|
config: Config | null;
|
|
54
42
|
options: GlobalOptions;
|
|
55
43
|
},
|
|
56
44
|
taskId: string
|
|
57
45
|
) {
|
|
58
46
|
const profileName = ctx.config?.name ?? defaultProfileName;
|
|
59
|
-
const region =
|
|
47
|
+
const region = await getDefaultRegion(profileName, ctx.config);
|
|
60
48
|
const orgId =
|
|
61
|
-
ctx.
|
|
62
|
-
ctx.options.orgId ??
|
|
63
|
-
(process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
49
|
+
ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
64
50
|
await setResourceInfo('task', profileName, taskId, region, orgId);
|
|
65
51
|
}
|
|
66
52
|
|
|
@@ -58,31 +58,36 @@ export const getSubcommand = createCommand({
|
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
const data = result.data;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const details: Record<string, unknown> = {
|
|
62
|
+
ID: data.id,
|
|
63
|
+
Key: data.key,
|
|
64
|
+
};
|
|
63
65
|
|
|
64
66
|
if (data.similarity !== undefined) {
|
|
65
|
-
|
|
67
|
+
details.Similarity = `${(data.similarity * 100).toFixed(1)}%`;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
if (data.document) {
|
|
69
|
-
|
|
71
|
+
details.Document =
|
|
70
72
|
data.document.length > 200
|
|
71
73
|
? data.document.substring(0, 197) + '...'
|
|
72
74
|
: data.document;
|
|
73
|
-
tui.info(` Document: ${docPreview}`);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (data.metadata && Object.keys(data.metadata).length > 0) {
|
|
77
|
-
tui.info(` Metadata: ${JSON.stringify(data.metadata, null, 2)}`);
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
if (data.embeddings) {
|
|
81
|
-
|
|
78
|
+
details.Embeddings = `[${data.embeddings.length} dimensions]`;
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
if (data.expiresAt) {
|
|
85
|
-
|
|
82
|
+
details.Expires = new Date(data.expiresAt).toLocaleString();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
tui.table([details], undefined, { layout: 'vertical' });
|
|
86
|
+
|
|
87
|
+
if (data.metadata && Object.keys(data.metadata).length > 0) {
|
|
88
|
+
tui.newline();
|
|
89
|
+
tui.header('Metadata');
|
|
90
|
+
tui.json(data.metadata);
|
|
86
91
|
}
|
|
87
92
|
} else {
|
|
88
93
|
tui.warning(`Vector "${tui.bold(args.key)}" not found in ${tui.bold(args.namespace)}`);
|
|
@@ -85,24 +85,26 @@ export const statsSubcommand = createCommand({
|
|
|
85
85
|
if (stats.count === 0 && stats.sum === 0) {
|
|
86
86
|
tui.info(`Namespace ${tui.bold(args.name)} is empty or does not exist`);
|
|
87
87
|
} else {
|
|
88
|
-
tui.
|
|
89
|
-
tui.info(` Vectors: ${stats.count}`);
|
|
88
|
+
tui.header(`Statistics for ${tui.bold(args.name)}`);
|
|
90
89
|
const sizeDisplay =
|
|
91
90
|
stats.sum < 1024 * 1024
|
|
92
91
|
? `${stats.sum.toLocaleString()} bytes`
|
|
93
92
|
: `${(stats.sum / (1024 * 1024)).toFixed(2)} MB`;
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const statsDetails: Record<string, unknown> = {
|
|
94
|
+
Vectors: stats.count,
|
|
95
|
+
'Total size': sizeDisplay,
|
|
96
|
+
};
|
|
96
97
|
if (stats.createdAt) {
|
|
97
|
-
|
|
98
|
+
statsDetails.Created = new Date(stats.createdAt).toLocaleString();
|
|
98
99
|
}
|
|
99
100
|
if (stats.lastUsed) {
|
|
100
|
-
|
|
101
|
+
statsDetails['Last used'] = new Date(stats.lastUsed).toLocaleString();
|
|
101
102
|
}
|
|
103
|
+
tui.table([statsDetails], undefined, { layout: 'vertical' });
|
|
102
104
|
|
|
103
105
|
if (stats.sampledResults && Object.keys(stats.sampledResults).length > 0) {
|
|
104
|
-
tui.
|
|
105
|
-
tui.
|
|
106
|
+
tui.newline();
|
|
107
|
+
tui.header(`Sample vectors (${Object.keys(stats.sampledResults).length})`);
|
|
106
108
|
|
|
107
109
|
const tableData = Object.entries(stats.sampledResults).map(([key, item]) => {
|
|
108
110
|
const docPreview = item.document
|
|
@@ -5,7 +5,12 @@ import { createWebhookAPIClient, getWebhookApiOptions } from './util';
|
|
|
5
5
|
import { getCommand } from '../../../command-prefix';
|
|
6
6
|
import { createWebhook, WebhookSchema } from '@agentuity/server';
|
|
7
7
|
|
|
8
|
-
const WebhookCreateResponseSchema = WebhookSchema.pick({
|
|
8
|
+
const WebhookCreateResponseSchema = WebhookSchema.pick({
|
|
9
|
+
id: true,
|
|
10
|
+
name: true,
|
|
11
|
+
url: true,
|
|
12
|
+
created_at: true,
|
|
13
|
+
});
|
|
9
14
|
|
|
10
15
|
export const createSubcommand = createCommand({
|
|
11
16
|
name: 'create',
|
|
@@ -18,6 +18,7 @@ const DeliveriesListResponseSchema = z.object({
|
|
|
18
18
|
status: z.string(),
|
|
19
19
|
retries: z.number(),
|
|
20
20
|
webhook_destination_id: z.string(),
|
|
21
|
+
error: z.string().nullable().optional(),
|
|
21
22
|
})
|
|
22
23
|
),
|
|
23
24
|
});
|
|
@@ -73,8 +74,15 @@ const listDeliveriesSubcommand = createSubcommand({
|
|
|
73
74
|
Status: d.status,
|
|
74
75
|
Retries: d.retries,
|
|
75
76
|
'Destination ID': d.webhook_destination_id,
|
|
77
|
+
...(d.error != null ? { Error: d.error } : {}),
|
|
76
78
|
}));
|
|
77
|
-
|
|
79
|
+
const hasErrors = result.deliveries.some((d: WebhookDelivery) => d.error != null);
|
|
80
|
+
tui.table(
|
|
81
|
+
tableData,
|
|
82
|
+
hasErrors
|
|
83
|
+
? ['ID', 'Date', 'Status', 'Retries', 'Destination ID', 'Error']
|
|
84
|
+
: ['ID', 'Date', 'Status', 'Retries', 'Destination ID']
|
|
85
|
+
);
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
|
|
@@ -85,6 +93,7 @@ const listDeliveriesSubcommand = createSubcommand({
|
|
|
85
93
|
status: d.status,
|
|
86
94
|
retries: d.retries,
|
|
87
95
|
webhook_destination_id: d.webhook_destination_id,
|
|
96
|
+
...(d.error != null ? { error: d.error } : {}),
|
|
88
97
|
})),
|
|
89
98
|
};
|
|
90
99
|
},
|
|
@@ -120,8 +129,11 @@ const retryDeliverySubcommand = createSubcommand({
|
|
|
120
129
|
);
|
|
121
130
|
|
|
122
131
|
if (!options.json) {
|
|
123
|
-
tui.success(`Retried delivery: ${delivery.id}`);
|
|
124
|
-
|
|
132
|
+
tui.success(`Retried delivery: ${tui.bold(delivery.id)}`);
|
|
133
|
+
tui.table([{ ID: delivery.id, Status: delivery.status }], ['ID', 'Status'], {
|
|
134
|
+
layout: 'vertical',
|
|
135
|
+
padStart: ' ',
|
|
136
|
+
});
|
|
125
137
|
}
|
|
126
138
|
|
|
127
139
|
return delivery;
|
|
@@ -57,13 +57,19 @@ const listDestinationsSubcommand = createSubcommand({
|
|
|
57
57
|
if (destinations.length === 0) {
|
|
58
58
|
tui.info('No destinations configured');
|
|
59
59
|
} else {
|
|
60
|
-
const tableData = destinations.map((d: WebhookDestination) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
const tableData = destinations.map((d: WebhookDestination) => {
|
|
61
|
+
const config =
|
|
62
|
+
d.type === 'url' && d.config && typeof d.config === 'object' && 'url' in d.config
|
|
63
|
+
? String((d.config as Record<string, unknown>).url)
|
|
64
|
+
: JSON.stringify(d.config);
|
|
65
|
+
return {
|
|
66
|
+
ID: d.id,
|
|
67
|
+
Type: d.type,
|
|
68
|
+
URL: config,
|
|
69
|
+
Created: new Date(d.created_at).toLocaleString(),
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
tui.table(tableData, ['ID', 'Type', 'URL', 'Created']);
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
75
|
|
|
@@ -130,7 +136,7 @@ const createDestinationSubcommand = createCommand({
|
|
|
130
136
|
examples: [
|
|
131
137
|
{
|
|
132
138
|
command: getCommand(
|
|
133
|
-
'cloud webhook destinations create url wh_abc123
|
|
139
|
+
'cloud webhook destinations create url wh_abc123 https://example.com/webhook'
|
|
134
140
|
),
|
|
135
141
|
description: 'Create a URL destination',
|
|
136
142
|
},
|
|
@@ -182,7 +188,13 @@ const updateDestinationSubcommand = createSubcommand({
|
|
|
182
188
|
|
|
183
189
|
if (!options.json) {
|
|
184
190
|
tui.success(`Updated destination: ${destination.id}`);
|
|
185
|
-
|
|
191
|
+
const url =
|
|
192
|
+
destination.config &&
|
|
193
|
+
typeof destination.config === 'object' &&
|
|
194
|
+
'url' in destination.config
|
|
195
|
+
? (destination.config as Record<string, unknown>).url
|
|
196
|
+
: JSON.stringify(destination.config);
|
|
197
|
+
console.log(` URL: ${url}`);
|
|
186
198
|
}
|
|
187
199
|
|
|
188
200
|
return destination;
|
|
@@ -46,8 +46,8 @@ export const getSubcommand = createCommand({
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
details['Created By'] = webhook.created_by;
|
|
49
|
-
details.Created = new Date(webhook.created_at).
|
|
50
|
-
details.Updated = new Date(webhook.updated_at).
|
|
49
|
+
details.Created = new Date(webhook.created_at).toLocaleString();
|
|
50
|
+
details.Updated = new Date(webhook.updated_at).toLocaleString();
|
|
51
51
|
|
|
52
52
|
tui.table([details], undefined, { layout: 'vertical' });
|
|
53
53
|
}
|
|
@@ -124,12 +124,25 @@ const getReceiptSubcommand = createSubcommand({
|
|
|
124
124
|
tui.table([details], undefined, { layout: 'vertical' });
|
|
125
125
|
|
|
126
126
|
tui.newline();
|
|
127
|
-
tui.
|
|
127
|
+
tui.header('Headers');
|
|
128
128
|
tui.json(receipt.headers);
|
|
129
129
|
|
|
130
130
|
tui.newline();
|
|
131
|
-
tui.
|
|
132
|
-
|
|
131
|
+
tui.header('Payload');
|
|
132
|
+
if (typeof receipt.payload === 'string') {
|
|
133
|
+
try {
|
|
134
|
+
const decoded = Buffer.from(receipt.payload, 'base64').toString('utf-8');
|
|
135
|
+
try {
|
|
136
|
+
tui.json(JSON.parse(decoded));
|
|
137
|
+
} catch {
|
|
138
|
+
console.log(decoded);
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
tui.json(receipt.payload);
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
tui.json(receipt.payload);
|
|
145
|
+
}
|
|
133
146
|
}
|
|
134
147
|
|
|
135
148
|
return receipt;
|