@agentuity/cli 1.0.22 → 1.0.23

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 (297) hide show
  1. package/dist/auth.d.ts.map +1 -1
  2. package/dist/auth.js +7 -0
  3. package/dist/auth.js.map +1 -1
  4. package/dist/cache/resource-region.d.ts +1 -1
  5. package/dist/cache/resource-region.d.ts.map +1 -1
  6. package/dist/cache/resource-region.js.map +1 -1
  7. package/dist/cmd/ai/claude-code/install.d.ts.map +1 -1
  8. package/dist/cmd/ai/claude-code/install.js +0 -1
  9. package/dist/cmd/ai/claude-code/install.js.map +1 -1
  10. package/dist/cmd/build/vite/public-asset-path-plugin.d.ts +4 -2
  11. package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +1 -1
  12. package/dist/cmd/build/vite/public-asset-path-plugin.js +18 -4
  13. package/dist/cmd/build/vite/public-asset-path-plugin.js.map +1 -1
  14. package/dist/cmd/cloud/email/create.d.ts +3 -0
  15. package/dist/cmd/cloud/email/create.d.ts.map +1 -0
  16. package/dist/cmd/cloud/email/create.js +58 -0
  17. package/dist/cmd/cloud/email/create.js.map +1 -0
  18. package/dist/cmd/cloud/email/delete.d.ts +3 -0
  19. package/dist/cmd/cloud/email/delete.d.ts.map +1 -0
  20. package/dist/cmd/cloud/email/delete.js +47 -0
  21. package/dist/cmd/cloud/email/delete.js.map +1 -0
  22. package/dist/cmd/cloud/email/destination/delete.d.ts +3 -0
  23. package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -0
  24. package/dist/cmd/cloud/email/destination/delete.js +54 -0
  25. package/dist/cmd/cloud/email/destination/delete.js.map +1 -0
  26. package/dist/cmd/cloud/email/destination/index.d.ts +3 -0
  27. package/dist/cmd/cloud/email/destination/index.d.ts.map +1 -0
  28. package/dist/cmd/cloud/email/destination/index.js +14 -0
  29. package/dist/cmd/cloud/email/destination/index.js.map +1 -0
  30. package/dist/cmd/cloud/email/destination/list.d.ts +3 -0
  31. package/dist/cmd/cloud/email/destination/list.d.ts.map +1 -0
  32. package/dist/cmd/cloud/email/destination/list.js +39 -0
  33. package/dist/cmd/cloud/email/destination/list.js.map +1 -0
  34. package/dist/cmd/cloud/email/destination/schemas.d.ts +9 -0
  35. package/dist/cmd/cloud/email/destination/schemas.d.ts.map +1 -0
  36. package/dist/cmd/cloud/email/destination/schemas.js +9 -0
  37. package/dist/cmd/cloud/email/destination/schemas.js.map +1 -0
  38. package/dist/cmd/cloud/email/destination/url.d.ts +3 -0
  39. package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -0
  40. package/dist/cmd/cloud/email/destination/url.js +64 -0
  41. package/dist/cmd/cloud/email/destination/url.js.map +1 -0
  42. package/dist/cmd/cloud/email/get.d.ts +3 -0
  43. package/dist/cmd/cloud/email/get.d.ts.map +1 -0
  44. package/dist/cmd/cloud/email/get.js +43 -0
  45. package/dist/cmd/cloud/email/get.js.map +1 -0
  46. package/dist/cmd/cloud/email/inbound/get.d.ts +3 -0
  47. package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -0
  48. package/dist/cmd/cloud/email/inbound/get.js +44 -0
  49. package/dist/cmd/cloud/email/inbound/get.js.map +1 -0
  50. package/dist/cmd/cloud/email/inbound/index.d.ts +3 -0
  51. package/dist/cmd/cloud/email/inbound/index.d.ts.map +1 -0
  52. package/dist/cmd/cloud/email/inbound/index.js +12 -0
  53. package/dist/cmd/cloud/email/inbound/index.js.map +1 -0
  54. package/dist/cmd/cloud/email/inbound/list.d.ts +3 -0
  55. package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -0
  56. package/dist/cmd/cloud/email/inbound/list.js +43 -0
  57. package/dist/cmd/cloud/email/inbound/list.js.map +1 -0
  58. package/dist/cmd/cloud/email/inbound/schemas.d.ts +11 -0
  59. package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -0
  60. package/dist/cmd/cloud/email/inbound/schemas.js +11 -0
  61. package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -0
  62. package/dist/cmd/cloud/email/index.d.ts +3 -0
  63. package/dist/cmd/cloud/email/index.d.ts.map +1 -0
  64. package/dist/cmd/cloud/email/index.js +28 -0
  65. package/dist/cmd/cloud/email/index.js.map +1 -0
  66. package/dist/cmd/cloud/email/list.d.ts +3 -0
  67. package/dist/cmd/cloud/email/list.d.ts.map +1 -0
  68. package/dist/cmd/cloud/email/list.js +37 -0
  69. package/dist/cmd/cloud/email/list.js.map +1 -0
  70. package/dist/cmd/cloud/email/outbound/get.d.ts +3 -0
  71. package/dist/cmd/cloud/email/outbound/get.d.ts.map +1 -0
  72. package/dist/cmd/cloud/email/outbound/get.js +45 -0
  73. package/dist/cmd/cloud/email/outbound/get.js.map +1 -0
  74. package/dist/cmd/cloud/email/outbound/index.d.ts +3 -0
  75. package/dist/cmd/cloud/email/outbound/index.d.ts.map +1 -0
  76. package/dist/cmd/cloud/email/outbound/index.js +12 -0
  77. package/dist/cmd/cloud/email/outbound/index.js.map +1 -0
  78. package/dist/cmd/cloud/email/outbound/list.d.ts +3 -0
  79. package/dist/cmd/cloud/email/outbound/list.d.ts.map +1 -0
  80. package/dist/cmd/cloud/email/outbound/list.js +43 -0
  81. package/dist/cmd/cloud/email/outbound/list.js.map +1 -0
  82. package/dist/cmd/cloud/email/outbound/schemas.d.ts +15 -0
  83. package/dist/cmd/cloud/email/outbound/schemas.d.ts.map +1 -0
  84. package/dist/cmd/cloud/email/outbound/schemas.js +15 -0
  85. package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -0
  86. package/dist/cmd/cloud/email/send.d.ts +3 -0
  87. package/dist/cmd/cloud/email/send.d.ts.map +1 -0
  88. package/dist/cmd/cloud/email/send.js +77 -0
  89. package/dist/cmd/cloud/email/send.js.map +1 -0
  90. package/dist/cmd/cloud/email/util.d.ts +26 -0
  91. package/dist/cmd/cloud/email/util.d.ts.map +1 -0
  92. package/dist/cmd/cloud/email/util.js +57 -0
  93. package/dist/cmd/cloud/email/util.js.map +1 -0
  94. package/dist/cmd/cloud/index.d.ts.map +1 -1
  95. package/dist/cmd/cloud/index.js +8 -0
  96. package/dist/cmd/cloud/index.js.map +1 -1
  97. package/dist/cmd/cloud/region-lookup.d.ts +1 -1
  98. package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
  99. package/dist/cmd/cloud/region-lookup.js +44 -2
  100. package/dist/cmd/cloud/region-lookup.js.map +1 -1
  101. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts +7 -0
  102. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
  103. package/dist/cmd/cloud/sandbox/snapshot/build.js +46 -28
  104. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  105. package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts.map +1 -1
  106. package/dist/cmd/cloud/sandbox/snapshot/generate.js +5 -1
  107. package/dist/cmd/cloud/sandbox/snapshot/generate.js.map +1 -1
  108. package/dist/cmd/cloud/schedule/create.d.ts +3 -0
  109. package/dist/cmd/cloud/schedule/create.d.ts.map +1 -0
  110. package/dist/cmd/cloud/schedule/create.js +72 -0
  111. package/dist/cmd/cloud/schedule/create.js.map +1 -0
  112. package/dist/cmd/cloud/schedule/delete.d.ts +3 -0
  113. package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -0
  114. package/dist/cmd/cloud/schedule/delete.js +38 -0
  115. package/dist/cmd/cloud/schedule/delete.js.map +1 -0
  116. package/dist/cmd/cloud/schedule/delivery/get.d.ts +3 -0
  117. package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -0
  118. package/dist/cmd/cloud/schedule/delivery/get.js +78 -0
  119. package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -0
  120. package/dist/cmd/cloud/schedule/delivery/index.d.ts +3 -0
  121. package/dist/cmd/cloud/schedule/delivery/index.d.ts.map +1 -0
  122. package/dist/cmd/cloud/schedule/delivery/index.js +23 -0
  123. package/dist/cmd/cloud/schedule/delivery/index.js.map +1 -0
  124. package/dist/cmd/cloud/schedule/delivery/list.d.ts +3 -0
  125. package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -0
  126. package/dist/cmd/cloud/schedule/delivery/list.js +67 -0
  127. package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -0
  128. package/dist/cmd/cloud/schedule/destination/create.d.ts +3 -0
  129. package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -0
  130. package/dist/cmd/cloud/schedule/destination/create.js +97 -0
  131. package/dist/cmd/cloud/schedule/destination/create.js.map +1 -0
  132. package/dist/cmd/cloud/schedule/destination/delete.d.ts +3 -0
  133. package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -0
  134. package/dist/cmd/cloud/schedule/destination/delete.js +41 -0
  135. package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -0
  136. package/dist/cmd/cloud/schedule/destination/get.d.ts +3 -0
  137. package/dist/cmd/cloud/schedule/destination/get.d.ts.map +1 -0
  138. package/dist/cmd/cloud/schedule/destination/get.js +57 -0
  139. package/dist/cmd/cloud/schedule/destination/get.js.map +1 -0
  140. package/dist/cmd/cloud/schedule/destination/index.d.ts +3 -0
  141. package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -0
  142. package/dist/cmd/cloud/schedule/destination/index.js +26 -0
  143. package/dist/cmd/cloud/schedule/destination/index.js.map +1 -0
  144. package/dist/cmd/cloud/schedule/destination/list.d.ts +3 -0
  145. package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -0
  146. package/dist/cmd/cloud/schedule/destination/list.js +58 -0
  147. package/dist/cmd/cloud/schedule/destination/list.js.map +1 -0
  148. package/dist/cmd/cloud/schedule/get.d.ts +3 -0
  149. package/dist/cmd/cloud/schedule/get.d.ts.map +1 -0
  150. package/dist/cmd/cloud/schedule/get.js +76 -0
  151. package/dist/cmd/cloud/schedule/get.js.map +1 -0
  152. package/dist/cmd/cloud/schedule/index.d.ts +3 -0
  153. package/dist/cmd/cloud/schedule/index.d.ts.map +1 -0
  154. package/dist/cmd/cloud/schedule/index.js +35 -0
  155. package/dist/cmd/cloud/schedule/index.js.map +1 -0
  156. package/dist/cmd/cloud/schedule/list.d.ts +3 -0
  157. package/dist/cmd/cloud/schedule/list.d.ts.map +1 -0
  158. package/dist/cmd/cloud/schedule/list.js +60 -0
  159. package/dist/cmd/cloud/schedule/list.js.map +1 -0
  160. package/dist/cmd/cloud/schedule/update.d.ts +3 -0
  161. package/dist/cmd/cloud/schedule/update.d.ts.map +1 -0
  162. package/dist/cmd/cloud/schedule/update.js +65 -0
  163. package/dist/cmd/cloud/schedule/update.js.map +1 -0
  164. package/dist/cmd/cloud/schedule/util.d.ts +11 -0
  165. package/dist/cmd/cloud/schedule/util.d.ts.map +1 -0
  166. package/dist/cmd/cloud/schedule/util.js +17 -0
  167. package/dist/cmd/cloud/schedule/util.js.map +1 -0
  168. package/dist/cmd/cloud/task/create.d.ts +3 -0
  169. package/dist/cmd/cloud/task/create.d.ts.map +1 -0
  170. package/dist/cmd/cloud/task/create.js +108 -0
  171. package/dist/cmd/cloud/task/create.js.map +1 -0
  172. package/dist/cmd/cloud/task/get.d.ts +3 -0
  173. package/dist/cmd/cloud/task/get.d.ts.map +1 -0
  174. package/dist/cmd/cloud/task/get.js +124 -0
  175. package/dist/cmd/cloud/task/get.js.map +1 -0
  176. package/dist/cmd/cloud/task/index.d.ts +3 -0
  177. package/dist/cmd/cloud/task/index.d.ts.map +1 -0
  178. package/dist/cmd/cloud/task/index.js +33 -0
  179. package/dist/cmd/cloud/task/index.js.map +1 -0
  180. package/dist/cmd/cloud/task/list.d.ts +3 -0
  181. package/dist/cmd/cloud/task/list.d.ts.map +1 -0
  182. package/dist/cmd/cloud/task/list.js +174 -0
  183. package/dist/cmd/cloud/task/list.js.map +1 -0
  184. package/dist/cmd/cloud/task/update.d.ts +3 -0
  185. package/dist/cmd/cloud/task/update.d.ts.map +1 -0
  186. package/dist/cmd/cloud/task/update.js +118 -0
  187. package/dist/cmd/cloud/task/update.js.map +1 -0
  188. package/dist/cmd/cloud/task/util.d.ts +18 -0
  189. package/dist/cmd/cloud/task/util.d.ts.map +1 -0
  190. package/dist/cmd/cloud/task/util.js +45 -0
  191. package/dist/cmd/cloud/task/util.js.map +1 -0
  192. package/dist/cmd/cloud/webhook/create.d.ts +3 -0
  193. package/dist/cmd/cloud/webhook/create.d.ts.map +1 -0
  194. package/dist/cmd/cloud/webhook/create.js +54 -0
  195. package/dist/cmd/cloud/webhook/create.js.map +1 -0
  196. package/dist/cmd/cloud/webhook/delete.d.ts +3 -0
  197. package/dist/cmd/cloud/webhook/delete.d.ts.map +1 -0
  198. package/dist/cmd/cloud/webhook/delete.js +50 -0
  199. package/dist/cmd/cloud/webhook/delete.js.map +1 -0
  200. package/dist/cmd/cloud/webhook/deliveries.d.ts +3 -0
  201. package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -0
  202. package/dist/cmd/cloud/webhook/deliveries.js +123 -0
  203. package/dist/cmd/cloud/webhook/deliveries.js.map +1 -0
  204. package/dist/cmd/cloud/webhook/destinations.d.ts +3 -0
  205. package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -0
  206. package/dist/cmd/cloud/webhook/destinations.js +212 -0
  207. package/dist/cmd/cloud/webhook/destinations.js.map +1 -0
  208. package/dist/cmd/cloud/webhook/get.d.ts +3 -0
  209. package/dist/cmd/cloud/webhook/get.d.ts.map +1 -0
  210. package/dist/cmd/cloud/webhook/get.js +50 -0
  211. package/dist/cmd/cloud/webhook/get.js.map +1 -0
  212. package/dist/cmd/cloud/webhook/index.d.ts +3 -0
  213. package/dist/cmd/cloud/webhook/index.d.ts.map +1 -0
  214. package/dist/cmd/cloud/webhook/index.js +45 -0
  215. package/dist/cmd/cloud/webhook/index.js.map +1 -0
  216. package/dist/cmd/cloud/webhook/list.d.ts +3 -0
  217. package/dist/cmd/cloud/webhook/list.d.ts.map +1 -0
  218. package/dist/cmd/cloud/webhook/list.js +72 -0
  219. package/dist/cmd/cloud/webhook/list.js.map +1 -0
  220. package/dist/cmd/cloud/webhook/receipts.d.ts +3 -0
  221. package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -0
  222. package/dist/cmd/cloud/webhook/receipts.js +128 -0
  223. package/dist/cmd/cloud/webhook/receipts.js.map +1 -0
  224. package/dist/cmd/cloud/webhook/util.d.ts +27 -0
  225. package/dist/cmd/cloud/webhook/util.d.ts.map +1 -0
  226. package/dist/cmd/cloud/webhook/util.js +20 -0
  227. package/dist/cmd/cloud/webhook/util.js.map +1 -0
  228. package/dist/config.d.ts +8 -0
  229. package/dist/config.d.ts.map +1 -1
  230. package/dist/types.d.ts +10 -2
  231. package/dist/types.d.ts.map +1 -1
  232. package/dist/types.js +3 -2
  233. package/dist/types.js.map +1 -1
  234. package/dist/version-check.d.ts.map +1 -1
  235. package/dist/version-check.js +18 -3
  236. package/dist/version-check.js.map +1 -1
  237. package/package.json +6 -6
  238. package/src/auth.ts +7 -0
  239. package/src/cache/resource-region.ts +4 -1
  240. package/src/cmd/ai/claude-code/install.ts +0 -3
  241. package/src/cmd/build/vite/public-asset-path-plugin.ts +18 -4
  242. package/src/cmd/cloud/email/create.ts +70 -0
  243. package/src/cmd/cloud/email/delete.ts +53 -0
  244. package/src/cmd/cloud/email/destination/delete.ts +65 -0
  245. package/src/cmd/cloud/email/destination/index.ts +15 -0
  246. package/src/cmd/cloud/email/destination/list.ts +46 -0
  247. package/src/cmd/cloud/email/destination/schemas.ts +9 -0
  248. package/src/cmd/cloud/email/destination/url.ts +75 -0
  249. package/src/cmd/cloud/email/get.ts +52 -0
  250. package/src/cmd/cloud/email/inbound/get.ts +53 -0
  251. package/src/cmd/cloud/email/inbound/index.ts +13 -0
  252. package/src/cmd/cloud/email/inbound/list.ts +50 -0
  253. package/src/cmd/cloud/email/inbound/schemas.ts +11 -0
  254. package/src/cmd/cloud/email/index.ts +29 -0
  255. package/src/cmd/cloud/email/list.ts +44 -0
  256. package/src/cmd/cloud/email/outbound/get.ts +54 -0
  257. package/src/cmd/cloud/email/outbound/index.ts +13 -0
  258. package/src/cmd/cloud/email/outbound/list.ts +50 -0
  259. package/src/cmd/cloud/email/outbound/schemas.ts +15 -0
  260. package/src/cmd/cloud/email/send.ts +91 -0
  261. package/src/cmd/cloud/email/util.ts +89 -0
  262. package/src/cmd/cloud/index.ts +8 -0
  263. package/src/cmd/cloud/region-lookup.ts +58 -2
  264. package/src/cmd/cloud/sandbox/snapshot/build.ts +59 -55
  265. package/src/cmd/cloud/sandbox/snapshot/generate.ts +5 -1
  266. package/src/cmd/cloud/schedule/create.ts +83 -0
  267. package/src/cmd/cloud/schedule/delete.ts +43 -0
  268. package/src/cmd/cloud/schedule/delivery/get.ts +85 -0
  269. package/src/cmd/cloud/schedule/delivery/index.ts +24 -0
  270. package/src/cmd/cloud/schedule/delivery/list.ts +82 -0
  271. package/src/cmd/cloud/schedule/destination/create.ts +110 -0
  272. package/src/cmd/cloud/schedule/destination/delete.ts +46 -0
  273. package/src/cmd/cloud/schedule/destination/get.ts +66 -0
  274. package/src/cmd/cloud/schedule/destination/index.ts +27 -0
  275. package/src/cmd/cloud/schedule/destination/list.ts +72 -0
  276. package/src/cmd/cloud/schedule/get.ts +92 -0
  277. package/src/cmd/cloud/schedule/index.ts +36 -0
  278. package/src/cmd/cloud/schedule/list.ts +78 -0
  279. package/src/cmd/cloud/schedule/update.ts +74 -0
  280. package/src/cmd/cloud/schedule/util.ts +34 -0
  281. package/src/cmd/cloud/task/create.ts +124 -0
  282. package/src/cmd/cloud/task/get.ts +138 -0
  283. package/src/cmd/cloud/task/index.ts +34 -0
  284. package/src/cmd/cloud/task/list.ts +191 -0
  285. package/src/cmd/cloud/task/update.ts +123 -0
  286. package/src/cmd/cloud/task/util.ts +74 -0
  287. package/src/cmd/cloud/webhook/create.ts +66 -0
  288. package/src/cmd/cloud/webhook/delete.ts +57 -0
  289. package/src/cmd/cloud/webhook/deliveries.ts +149 -0
  290. package/src/cmd/cloud/webhook/destinations.ts +274 -0
  291. package/src/cmd/cloud/webhook/get.ts +59 -0
  292. package/src/cmd/cloud/webhook/index.ts +46 -0
  293. package/src/cmd/cloud/webhook/list.ts +82 -0
  294. package/src/cmd/cloud/webhook/receipts.ts +157 -0
  295. package/src/cmd/cloud/webhook/util.ts +35 -0
  296. package/src/types.ts +3 -1
  297. package/src/version-check.ts +22 -3
@@ -0,0 +1,124 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createStorageAdapter, parseMetadataFlag, cacheTaskId } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import type { TaskPriority, TaskStatus, TaskType } from '@agentuity/core';
7
+
8
+ const TaskCreateResponseSchema = z.object({
9
+ success: z.boolean().describe('Whether the operation succeeded'),
10
+ task: z.object({
11
+ id: z.string().describe('Task ID'),
12
+ title: z.string().describe('Task title'),
13
+ type: z.string().describe('Task type'),
14
+ status: z.string().describe('Task status'),
15
+ priority: z.string().describe('Task priority'),
16
+ created_at: z.string().describe('Creation timestamp'),
17
+ }),
18
+ durationMs: z.number().describe('Operation duration in milliseconds'),
19
+ });
20
+
21
+ export const createSubcommand = createCommand({
22
+ name: 'create',
23
+ aliases: ['new', 'add'],
24
+ description: 'Create a new task',
25
+ tags: ['mutating', 'slow', 'requires-auth'],
26
+ requires: { auth: true },
27
+ optional: { project: true },
28
+ examples: [
29
+ {
30
+ command: getCommand('cloud task create "Fix login bug" --type bug --created-id agent_001'),
31
+ description: 'Create a bug task',
32
+ },
33
+ {
34
+ command: getCommand(
35
+ 'cloud task create "Add dark mode" --type feature --created-id agent_001 --priority high --description "Implement dark mode toggle"'
36
+ ),
37
+ description: 'Create a feature with priority and description',
38
+ },
39
+ {
40
+ command: getCommand(
41
+ 'cloud task create "Q1 Planning" --type epic --created-id agent_001 --metadata \'{"team":"engineering"}\''
42
+ ),
43
+ description: 'Create an epic with metadata',
44
+ },
45
+ ],
46
+ schema: {
47
+ args: z.object({
48
+ title: z.string().min(1).describe('the task title'),
49
+ }),
50
+ options: z.object({
51
+ type: z.enum(['epic', 'feature', 'enhancement', 'bug', 'task']).describe('the task type'),
52
+ createdId: z.string().min(1).describe('the ID of the creator (agent or user)'),
53
+ description: z.string().optional().describe('task description'),
54
+ priority: z
55
+ .enum(['high', 'medium', 'low', 'none'])
56
+ .optional()
57
+ .describe('task priority (default: none)'),
58
+ status: z
59
+ .enum(['open', 'in_progress', 'closed'])
60
+ .optional()
61
+ .describe('initial task status (default: open)'),
62
+ parentId: z.string().optional().describe('parent task ID for subtasks'),
63
+ assignedId: z.string().optional().describe('ID of the assigned agent or user'),
64
+ metadata: z.string().optional().describe('JSON metadata object'),
65
+ }),
66
+ response: TaskCreateResponseSchema,
67
+ },
68
+
69
+ async handler(ctx) {
70
+ const { args, opts, options } = ctx;
71
+ const started = Date.now();
72
+ const storage = await createStorageAdapter(ctx);
73
+
74
+ const metadata = parseMetadataFlag(opts.metadata);
75
+
76
+ const task = await storage.create({
77
+ title: args.title,
78
+ type: opts.type as TaskType,
79
+ created_id: opts.createdId,
80
+ description: opts.description,
81
+ priority: opts.priority as TaskPriority,
82
+ status: opts.status as TaskStatus,
83
+ parent_id: opts.parentId,
84
+ assigned_id: opts.assignedId,
85
+ metadata,
86
+ });
87
+
88
+ const durationMs = Date.now() - started;
89
+ await cacheTaskId(ctx, task.id);
90
+
91
+ if (!options.json) {
92
+ tui.success(`Task created: ${tui.bold(task.id)}`);
93
+
94
+ const tableData: Record<string, string> = {
95
+ Title: task.title,
96
+ Type: task.type,
97
+ Status: task.status,
98
+ Priority: task.priority,
99
+ Created: new Date(task.created_at).toLocaleString(),
100
+ };
101
+
102
+ if (task.description) {
103
+ tableData['Description'] = task.description;
104
+ }
105
+
106
+ tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
107
+ }
108
+
109
+ return {
110
+ success: true,
111
+ task: {
112
+ id: task.id,
113
+ title: task.title,
114
+ type: task.type,
115
+ status: task.status,
116
+ priority: task.priority,
117
+ created_at: task.created_at,
118
+ },
119
+ durationMs,
120
+ };
121
+ },
122
+ });
123
+
124
+ export default createSubcommand;
@@ -0,0 +1,138 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createStorageAdapter, cacheTaskId } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+
7
+ const TaskGetResponseSchema = z.object({
8
+ success: z.boolean().describe('Whether the operation succeeded'),
9
+ task: z.object({
10
+ id: z.string().describe('Task ID'),
11
+ title: z.string().describe('Task title'),
12
+ description: z.string().optional().describe('Task description'),
13
+ type: z.string().describe('Task type'),
14
+ status: z.string().describe('Task status'),
15
+ priority: z.string().describe('Task priority'),
16
+ parent_id: z.string().optional().describe('Parent task ID'),
17
+ assigned_id: z.string().optional().describe('Assigned agent or user ID'),
18
+ created_id: z.string().describe('Creator ID'),
19
+ closed_id: z.string().optional().describe('Closer ID'),
20
+ metadata: z.record(z.string(), z.unknown()).optional().describe('Task metadata'),
21
+ created_at: z.string().describe('Creation timestamp'),
22
+ updated_at: z.string().describe('Last update timestamp'),
23
+ open_date: z.string().optional().describe('Date task was opened'),
24
+ in_progress_date: z.string().optional().describe('Date task moved to in-progress'),
25
+ closed_date: z.string().optional().describe('Date task was closed'),
26
+ }),
27
+ durationMs: z.number().describe('Operation duration in milliseconds'),
28
+ });
29
+
30
+ export const getSubcommand = createCommand({
31
+ name: 'get',
32
+ aliases: ['show', 'info'],
33
+ description: 'Get details of a task by ID',
34
+ tags: ['read-only', 'slow', 'requires-auth'],
35
+ idempotent: true,
36
+ requires: { auth: true },
37
+ optional: { project: true },
38
+ examples: [
39
+ {
40
+ command: getCommand('cloud task get task_abc123'),
41
+ description: 'Get task details',
42
+ },
43
+ {
44
+ command: getCommand('cloud task get task_abc123 --json'),
45
+ description: 'Get task details as JSON',
46
+ },
47
+ ],
48
+ schema: {
49
+ args: z.object({
50
+ id: z.string().min(1).describe('the task ID to get'),
51
+ }),
52
+ response: TaskGetResponseSchema,
53
+ },
54
+
55
+ async handler(ctx) {
56
+ const { args, options } = ctx;
57
+ const started = Date.now();
58
+ const storage = await createStorageAdapter(ctx);
59
+
60
+ const task = await storage.get(args.id);
61
+ const durationMs = Date.now() - started;
62
+
63
+ if (!task) {
64
+ tui.fatal(`Task not found: ${args.id}`);
65
+ }
66
+
67
+ await cacheTaskId(ctx, task.id);
68
+
69
+ if (!options.json) {
70
+ const tableData: Record<string, string> = {
71
+ ID: task.id,
72
+ Title: task.title,
73
+ Type: task.type,
74
+ Status: task.status,
75
+ Priority: task.priority,
76
+ };
77
+
78
+ if (task.description) {
79
+ tableData['Description'] = task.description;
80
+ }
81
+
82
+ tableData['Creator'] = task.created_id;
83
+
84
+ if (task.assigned_id) {
85
+ tableData['Assigned'] = task.assigned_id;
86
+ }
87
+ if (task.parent_id) {
88
+ tableData['Parent'] = task.parent_id;
89
+ }
90
+ if (task.closed_id) {
91
+ tableData['Closed By'] = task.closed_id;
92
+ }
93
+
94
+ tableData['Created'] = new Date(task.created_at).toLocaleString();
95
+ tableData['Updated'] = new Date(task.updated_at).toLocaleString();
96
+
97
+ if (task.open_date) {
98
+ tableData['Opened'] = new Date(task.open_date).toLocaleString();
99
+ }
100
+ if (task.in_progress_date) {
101
+ tableData['In Progress'] = new Date(task.in_progress_date).toLocaleString();
102
+ }
103
+ if (task.closed_date) {
104
+ tableData['Closed'] = new Date(task.closed_date).toLocaleString();
105
+ }
106
+ if (task.metadata && Object.keys(task.metadata).length > 0) {
107
+ tableData['Metadata'] = JSON.stringify(task.metadata);
108
+ }
109
+
110
+ tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
111
+ }
112
+
113
+ return {
114
+ success: true,
115
+ task: {
116
+ id: task.id,
117
+ title: task.title,
118
+ description: task.description,
119
+ type: task.type,
120
+ status: task.status,
121
+ priority: task.priority,
122
+ parent_id: task.parent_id,
123
+ assigned_id: task.assigned_id,
124
+ created_id: task.created_id,
125
+ closed_id: task.closed_id,
126
+ metadata: task.metadata,
127
+ created_at: task.created_at,
128
+ updated_at: task.updated_at,
129
+ open_date: task.open_date,
130
+ in_progress_date: task.in_progress_date,
131
+ closed_date: task.closed_date,
132
+ },
133
+ durationMs,
134
+ };
135
+ },
136
+ });
137
+
138
+ export default getSubcommand;
@@ -0,0 +1,34 @@
1
+ import { createCommand } from '../../../types';
2
+ import { getSubcommand } from './get';
3
+ import { createSubcommand } from './create';
4
+ import { updateSubcommand } from './update';
5
+ import { listSubcommand } from './list';
6
+ import { getCommand } from '../../../command-prefix';
7
+
8
+ export const taskCommand = createCommand({
9
+ name: 'task',
10
+ description: 'Manage tasks for your projects',
11
+ tags: ['requires-auth', 'slow'],
12
+ examples: [
13
+ {
14
+ command: getCommand('cloud task get task_abc123'),
15
+ description: 'Get task details',
16
+ },
17
+ {
18
+ command: getCommand('cloud task create "Fix bug" --type bug --created-id agent_001'),
19
+ description: 'Create a new bug task',
20
+ },
21
+ {
22
+ command: getCommand('cloud task list --status open'),
23
+ description: 'List open tasks',
24
+ },
25
+ {
26
+ command: getCommand('cloud task update task_abc123 --status in_progress'),
27
+ description: 'Update task status',
28
+ },
29
+ ],
30
+ subcommands: [getSubcommand, createSubcommand, updateSubcommand, listSubcommand],
31
+ requires: { auth: true },
32
+ });
33
+
34
+ export default taskCommand;
@@ -0,0 +1,191 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createStorageAdapter } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import type { TaskPriority, TaskStatus, TaskType, Task } from '@agentuity/core';
7
+
8
+ const TaskListResponseSchema = z.object({
9
+ success: z.boolean().describe('Whether the operation succeeded'),
10
+ tasks: z.array(
11
+ z.object({
12
+ id: z.string(),
13
+ title: z.string(),
14
+ type: z.string(),
15
+ status: z.string(),
16
+ priority: z.string(),
17
+ assigned_id: z.string().optional(),
18
+ created_at: z.string(),
19
+ updated_at: z.string(),
20
+ })
21
+ ),
22
+ total: z.number().describe('Total number of matching tasks'),
23
+ limit: z.number().describe('Page size'),
24
+ offset: z.number().describe('Page offset'),
25
+ durationMs: z.number().describe('Operation duration in milliseconds'),
26
+ });
27
+
28
+ const PRIORITY_COLORS: Record<string, (s: string) => string> = {
29
+ high: tui.colorError,
30
+ medium: tui.colorWarning,
31
+ low: tui.colorInfo,
32
+ none: tui.muted,
33
+ };
34
+
35
+ const STATUS_COLORS: Record<string, (s: string) => string> = {
36
+ open: tui.colorSuccess,
37
+ in_progress: tui.colorWarning,
38
+ closed: tui.muted,
39
+ };
40
+
41
+ function formatPriority(p: string): string {
42
+ const colorFn = PRIORITY_COLORS[p] ?? tui.muted;
43
+ return colorFn(p);
44
+ }
45
+
46
+ function formatStatus(s: string): string {
47
+ const colorFn = STATUS_COLORS[s] ?? tui.muted;
48
+ return colorFn(s);
49
+ }
50
+
51
+ function truncate(s: string, max: number): string {
52
+ if (s.length <= max) return s;
53
+ return `${s.slice(0, max - 1)}…`;
54
+ }
55
+
56
+ export const listSubcommand = createCommand({
57
+ name: 'list',
58
+ aliases: ['ls'],
59
+ description: 'List tasks with optional filtering and sorting',
60
+ tags: ['read-only', 'slow', 'requires-auth'],
61
+ requires: { auth: true },
62
+ optional: { project: true },
63
+ idempotent: true,
64
+ pagination: {
65
+ supported: true,
66
+ defaultLimit: 50,
67
+ maxLimit: 100,
68
+ parameters: { limit: 'limit', offset: 'offset' },
69
+ },
70
+ examples: [
71
+ {
72
+ command: getCommand('cloud task list'),
73
+ description: 'List all tasks',
74
+ },
75
+ {
76
+ command: getCommand('cloud task list --status open --priority high'),
77
+ description: 'List open high-priority tasks',
78
+ },
79
+ {
80
+ command: getCommand('cloud task list --type bug --sort created_at --order asc'),
81
+ description: 'List bugs sorted by oldest first',
82
+ },
83
+ {
84
+ command: getCommand('cloud task list --assigned-id agent_001 --limit 10'),
85
+ description: 'List first 10 tasks assigned to an agent',
86
+ },
87
+ ],
88
+ schema: {
89
+ options: z.object({
90
+ status: z.enum(['open', 'in_progress', 'closed']).optional().describe('filter by status'),
91
+ type: z
92
+ .enum(['epic', 'feature', 'enhancement', 'bug', 'task'])
93
+ .optional()
94
+ .describe('filter by type'),
95
+ priority: z
96
+ .enum(['high', 'medium', 'low', 'none'])
97
+ .optional()
98
+ .describe('filter by priority'),
99
+ assignedId: z.string().optional().describe('filter by assigned agent or user ID'),
100
+ parentId: z.string().optional().describe('filter by parent task ID'),
101
+ 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
+ ])
113
+ .optional()
114
+ .describe('field to sort by (default: created_at)'),
115
+ order: z.enum(['asc', 'desc']).optional().describe('sort order (default: desc)'),
116
+ limit: z.coerce.number().optional().describe('max results to return (default: 50)'),
117
+ offset: z.coerce.number().optional().describe('offset for pagination'),
118
+ }),
119
+ response: TaskListResponseSchema,
120
+ },
121
+
122
+ async handler(ctx) {
123
+ const { opts, options } = ctx;
124
+ const started = Date.now();
125
+ const storage = await createStorageAdapter(ctx);
126
+
127
+ const result = await storage.list({
128
+ status: opts.status as TaskStatus | undefined,
129
+ type: opts.type as TaskType | undefined,
130
+ priority: opts.priority as TaskPriority | undefined,
131
+ assigned_id: opts.assignedId,
132
+ parent_id: opts.parentId,
133
+ sort: opts.sort,
134
+ order: opts.order,
135
+ limit: opts.limit,
136
+ offset: opts.offset,
137
+ });
138
+
139
+ const durationMs = Date.now() - started;
140
+
141
+ if (!options.json) {
142
+ if (result.tasks.length === 0) {
143
+ tui.info('No tasks found');
144
+ } else {
145
+ const tableData = result.tasks.map((task: Task) => ({
146
+ ID: tui.muted(truncate(task.id, 28)),
147
+ Title: truncate(task.title, 40),
148
+ Type: task.type,
149
+ Status: formatStatus(task.status),
150
+ Priority: formatPriority(task.priority),
151
+ Assigned: task.assigned_id ?? tui.muted('—'),
152
+ Updated: new Date(task.updated_at).toLocaleDateString(),
153
+ }));
154
+
155
+ tui.table(tableData, [
156
+ { name: 'ID', alignment: 'left' },
157
+ { name: 'Title', alignment: 'left' },
158
+ { name: 'Type', alignment: 'left' },
159
+ { name: 'Status', alignment: 'left' },
160
+ { name: 'Priority', alignment: 'left' },
161
+ { name: 'Assigned', alignment: 'left' },
162
+ { name: 'Updated', alignment: 'left' },
163
+ ]);
164
+
165
+ tui.info(
166
+ `\nShowing ${result.tasks.length} of ${result.total} ${tui.plural(result.total, 'task', 'tasks')} (${durationMs.toFixed(1)}ms)`
167
+ );
168
+ }
169
+ }
170
+
171
+ return {
172
+ success: true,
173
+ tasks: result.tasks.map((task: Task) => ({
174
+ id: task.id,
175
+ title: task.title,
176
+ type: task.type,
177
+ status: task.status,
178
+ priority: task.priority,
179
+ assigned_id: task.assigned_id,
180
+ created_at: task.created_at,
181
+ updated_at: task.updated_at,
182
+ })),
183
+ total: result.total,
184
+ limit: result.limit,
185
+ offset: result.offset,
186
+ durationMs,
187
+ };
188
+ },
189
+ });
190
+
191
+ export default listSubcommand;
@@ -0,0 +1,123 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createStorageAdapter, parseMetadataFlag, cacheTaskId } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import type { TaskPriority, TaskStatus, TaskType } from '@agentuity/core';
7
+
8
+ const TaskUpdateResponseSchema = z.object({
9
+ success: z.boolean().describe('Whether the operation succeeded'),
10
+ task: z.object({
11
+ id: z.string().describe('Task ID'),
12
+ title: z.string().describe('Task title'),
13
+ type: z.string().describe('Task type'),
14
+ status: z.string().describe('Task status'),
15
+ priority: z.string().describe('Task priority'),
16
+ updated_at: z.string().describe('Last update timestamp'),
17
+ }),
18
+ durationMs: z.number().describe('Operation duration in milliseconds'),
19
+ });
20
+
21
+ export const updateSubcommand = createCommand({
22
+ name: 'update',
23
+ aliases: ['edit'],
24
+ description: 'Update an existing task',
25
+ tags: ['mutating', 'slow', 'requires-auth'],
26
+ requires: { auth: true },
27
+ optional: { project: true },
28
+ examples: [
29
+ {
30
+ command: getCommand('cloud task update task_abc123 --status in_progress'),
31
+ description: 'Move task to in-progress',
32
+ },
33
+ {
34
+ command: getCommand(
35
+ 'cloud task update task_abc123 --title "Updated title" --priority high'
36
+ ),
37
+ description: 'Update title and priority',
38
+ },
39
+ {
40
+ command: getCommand('cloud task update task_abc123 --assigned-id agent_002'),
41
+ description: 'Reassign a task',
42
+ },
43
+ ],
44
+ schema: {
45
+ args: z.object({
46
+ id: z.string().min(1).describe('the task ID to update'),
47
+ }),
48
+ options: z.object({
49
+ title: z.string().optional().describe('new task title'),
50
+ description: z.string().optional().describe('new task description'),
51
+ priority: z
52
+ .enum(['high', 'medium', 'low', 'none'])
53
+ .optional()
54
+ .describe('new task priority'),
55
+ type: z
56
+ .enum(['epic', 'feature', 'enhancement', 'bug', 'task'])
57
+ .optional()
58
+ .describe('new task type'),
59
+ status: z.enum(['open', 'in_progress', 'closed']).optional().describe('new task status'),
60
+ assignedId: z.string().optional().describe('new assigned agent or user ID'),
61
+ parentId: z.string().optional().describe('new parent task ID'),
62
+ closedId: z.string().optional().describe('ID of the closer (agent or user)'),
63
+ metadata: z.string().optional().describe('JSON metadata object'),
64
+ }),
65
+ response: TaskUpdateResponseSchema,
66
+ },
67
+
68
+ async handler(ctx) {
69
+ const { args, opts, options } = ctx;
70
+ const started = Date.now();
71
+ const storage = await createStorageAdapter(ctx);
72
+
73
+ const metadata = parseMetadataFlag(opts.metadata);
74
+
75
+ const params: Record<string, unknown> = {};
76
+ if (opts.title !== undefined) params.title = opts.title;
77
+ if (opts.description !== undefined) params.description = opts.description;
78
+ if (opts.priority !== undefined) params.priority = opts.priority as TaskPriority;
79
+ if (opts.type !== undefined) params.type = opts.type as TaskType;
80
+ if (opts.status !== undefined) params.status = opts.status as TaskStatus;
81
+ if (opts.assignedId !== undefined) params.assigned_id = opts.assignedId;
82
+ if (opts.parentId !== undefined) params.parent_id = opts.parentId;
83
+ if (opts.closedId !== undefined) params.closed_id = opts.closedId;
84
+ if (metadata !== undefined) params.metadata = metadata;
85
+
86
+ if (Object.keys(params).length === 0) {
87
+ tui.fatal('No update fields provided. Use --title, --status, --priority, etc.');
88
+ }
89
+
90
+ const task = await storage.update(args.id, params);
91
+ const durationMs = Date.now() - started;
92
+ await cacheTaskId(ctx, task.id);
93
+
94
+ if (!options.json) {
95
+ tui.success(`Task updated: ${tui.bold(task.id)}`);
96
+
97
+ const tableData: Record<string, string> = {
98
+ Title: task.title,
99
+ Type: task.type,
100
+ Status: task.status,
101
+ Priority: task.priority,
102
+ Updated: new Date(task.updated_at).toLocaleString(),
103
+ };
104
+
105
+ tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
106
+ }
107
+
108
+ return {
109
+ success: true,
110
+ task: {
111
+ id: task.id,
112
+ title: task.title,
113
+ type: task.type,
114
+ status: task.status,
115
+ priority: task.priority,
116
+ updated_at: task.updated_at,
117
+ },
118
+ durationMs,
119
+ };
120
+ },
121
+ });
122
+
123
+ export default updateSubcommand;
@@ -0,0 +1,74 @@
1
+ import { TaskStorageService, type Logger } from '@agentuity/core';
2
+ import { createServerFetchAdapter } from '@agentuity/server';
3
+ import type { AuthData, Config, GlobalOptions, ProjectConfig } from '../../../types';
4
+ import { getCatalystUrl } from '../../../catalyst';
5
+ import { setResourceInfo } from '../../../cache';
6
+ import { defaultProfileName, getDefaultRegion } from '../../../config';
7
+ import * as tui from '../../../tui';
8
+
9
+ export async function createStorageAdapter(
10
+ ctx: {
11
+ logger: Logger;
12
+ auth: AuthData;
13
+ region?: string;
14
+ project?: ProjectConfig;
15
+ config: Config | null;
16
+ options: GlobalOptions;
17
+ },
18
+ explicitOrgId?: string
19
+ ) {
20
+ const orgId =
21
+ explicitOrgId ??
22
+ ctx.project?.orgId ??
23
+ ctx.options.orgId ??
24
+ (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
25
+ if (!orgId) {
26
+ tui.fatal(
27
+ 'Organization ID is required. Either run from a project directory or use --org-id flag.'
28
+ );
29
+ }
30
+
31
+ const adapter = createServerFetchAdapter(
32
+ {
33
+ headers: {
34
+ Authorization: `Bearer ${ctx.auth.apiKey}`,
35
+ 'x-agentuity-orgid': orgId,
36
+ },
37
+ },
38
+ ctx.logger
39
+ );
40
+
41
+ // Task tenant DB is not regional — any Catalyst can serve the request.
42
+ // Use provided region or fall back to default.
43
+ const region =
44
+ ctx.region ?? (await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config));
45
+ const baseUrl = getCatalystUrl(region);
46
+ return new TaskStorageService(baseUrl, adapter);
47
+ }
48
+
49
+ export async function cacheTaskId(
50
+ ctx: {
51
+ region?: string;
52
+ project?: ProjectConfig;
53
+ config: Config | null;
54
+ options: GlobalOptions;
55
+ },
56
+ taskId: string
57
+ ) {
58
+ const profileName = ctx.config?.name ?? defaultProfileName;
59
+ const region = ctx.region ?? (await getDefaultRegion(profileName, ctx.config));
60
+ const orgId =
61
+ ctx.project?.orgId ??
62
+ ctx.options.orgId ??
63
+ (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
64
+ await setResourceInfo('task', profileName, taskId, region, orgId);
65
+ }
66
+
67
+ export function parseMetadataFlag(raw: string | undefined): Record<string, unknown> | undefined {
68
+ if (!raw) return undefined;
69
+ try {
70
+ return JSON.parse(raw) as Record<string, unknown>;
71
+ } catch {
72
+ tui.fatal('Invalid JSON for --metadata flag');
73
+ }
74
+ }