@agentuity/cli 1.0.21 → 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 (318) 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/deploy.d.ts.map +1 -1
  15. package/dist/cmd/cloud/deploy.js +1 -1
  16. package/dist/cmd/cloud/deploy.js.map +1 -1
  17. package/dist/cmd/cloud/email/create.d.ts +3 -0
  18. package/dist/cmd/cloud/email/create.d.ts.map +1 -0
  19. package/dist/cmd/cloud/email/create.js +58 -0
  20. package/dist/cmd/cloud/email/create.js.map +1 -0
  21. package/dist/cmd/cloud/email/delete.d.ts +3 -0
  22. package/dist/cmd/cloud/email/delete.d.ts.map +1 -0
  23. package/dist/cmd/cloud/email/delete.js +47 -0
  24. package/dist/cmd/cloud/email/delete.js.map +1 -0
  25. package/dist/cmd/cloud/email/destination/delete.d.ts +3 -0
  26. package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -0
  27. package/dist/cmd/cloud/email/destination/delete.js +54 -0
  28. package/dist/cmd/cloud/email/destination/delete.js.map +1 -0
  29. package/dist/cmd/cloud/email/destination/index.d.ts +3 -0
  30. package/dist/cmd/cloud/email/destination/index.d.ts.map +1 -0
  31. package/dist/cmd/cloud/email/destination/index.js +14 -0
  32. package/dist/cmd/cloud/email/destination/index.js.map +1 -0
  33. package/dist/cmd/cloud/email/destination/list.d.ts +3 -0
  34. package/dist/cmd/cloud/email/destination/list.d.ts.map +1 -0
  35. package/dist/cmd/cloud/email/destination/list.js +39 -0
  36. package/dist/cmd/cloud/email/destination/list.js.map +1 -0
  37. package/dist/cmd/cloud/email/destination/schemas.d.ts +9 -0
  38. package/dist/cmd/cloud/email/destination/schemas.d.ts.map +1 -0
  39. package/dist/cmd/cloud/email/destination/schemas.js +9 -0
  40. package/dist/cmd/cloud/email/destination/schemas.js.map +1 -0
  41. package/dist/cmd/cloud/email/destination/url.d.ts +3 -0
  42. package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -0
  43. package/dist/cmd/cloud/email/destination/url.js +64 -0
  44. package/dist/cmd/cloud/email/destination/url.js.map +1 -0
  45. package/dist/cmd/cloud/email/get.d.ts +3 -0
  46. package/dist/cmd/cloud/email/get.d.ts.map +1 -0
  47. package/dist/cmd/cloud/email/get.js +43 -0
  48. package/dist/cmd/cloud/email/get.js.map +1 -0
  49. package/dist/cmd/cloud/email/inbound/get.d.ts +3 -0
  50. package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -0
  51. package/dist/cmd/cloud/email/inbound/get.js +44 -0
  52. package/dist/cmd/cloud/email/inbound/get.js.map +1 -0
  53. package/dist/cmd/cloud/email/inbound/index.d.ts +3 -0
  54. package/dist/cmd/cloud/email/inbound/index.d.ts.map +1 -0
  55. package/dist/cmd/cloud/email/inbound/index.js +12 -0
  56. package/dist/cmd/cloud/email/inbound/index.js.map +1 -0
  57. package/dist/cmd/cloud/email/inbound/list.d.ts +3 -0
  58. package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -0
  59. package/dist/cmd/cloud/email/inbound/list.js +43 -0
  60. package/dist/cmd/cloud/email/inbound/list.js.map +1 -0
  61. package/dist/cmd/cloud/email/inbound/schemas.d.ts +11 -0
  62. package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -0
  63. package/dist/cmd/cloud/email/inbound/schemas.js +11 -0
  64. package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -0
  65. package/dist/cmd/cloud/email/index.d.ts +3 -0
  66. package/dist/cmd/cloud/email/index.d.ts.map +1 -0
  67. package/dist/cmd/cloud/email/index.js +28 -0
  68. package/dist/cmd/cloud/email/index.js.map +1 -0
  69. package/dist/cmd/cloud/email/list.d.ts +3 -0
  70. package/dist/cmd/cloud/email/list.d.ts.map +1 -0
  71. package/dist/cmd/cloud/email/list.js +37 -0
  72. package/dist/cmd/cloud/email/list.js.map +1 -0
  73. package/dist/cmd/cloud/email/outbound/get.d.ts +3 -0
  74. package/dist/cmd/cloud/email/outbound/get.d.ts.map +1 -0
  75. package/dist/cmd/cloud/email/outbound/get.js +45 -0
  76. package/dist/cmd/cloud/email/outbound/get.js.map +1 -0
  77. package/dist/cmd/cloud/email/outbound/index.d.ts +3 -0
  78. package/dist/cmd/cloud/email/outbound/index.d.ts.map +1 -0
  79. package/dist/cmd/cloud/email/outbound/index.js +12 -0
  80. package/dist/cmd/cloud/email/outbound/index.js.map +1 -0
  81. package/dist/cmd/cloud/email/outbound/list.d.ts +3 -0
  82. package/dist/cmd/cloud/email/outbound/list.d.ts.map +1 -0
  83. package/dist/cmd/cloud/email/outbound/list.js +43 -0
  84. package/dist/cmd/cloud/email/outbound/list.js.map +1 -0
  85. package/dist/cmd/cloud/email/outbound/schemas.d.ts +15 -0
  86. package/dist/cmd/cloud/email/outbound/schemas.d.ts.map +1 -0
  87. package/dist/cmd/cloud/email/outbound/schemas.js +15 -0
  88. package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -0
  89. package/dist/cmd/cloud/email/send.d.ts +3 -0
  90. package/dist/cmd/cloud/email/send.d.ts.map +1 -0
  91. package/dist/cmd/cloud/email/send.js +77 -0
  92. package/dist/cmd/cloud/email/send.js.map +1 -0
  93. package/dist/cmd/cloud/email/util.d.ts +26 -0
  94. package/dist/cmd/cloud/email/util.d.ts.map +1 -0
  95. package/dist/cmd/cloud/email/util.js +57 -0
  96. package/dist/cmd/cloud/email/util.js.map +1 -0
  97. package/dist/cmd/cloud/index.d.ts.map +1 -1
  98. package/dist/cmd/cloud/index.js +8 -0
  99. package/dist/cmd/cloud/index.js.map +1 -1
  100. package/dist/cmd/cloud/region-lookup.d.ts +1 -1
  101. package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
  102. package/dist/cmd/cloud/region-lookup.js +44 -2
  103. package/dist/cmd/cloud/region-lookup.js.map +1 -1
  104. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts +7 -0
  105. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
  106. package/dist/cmd/cloud/sandbox/snapshot/build.js +46 -28
  107. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  108. package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts.map +1 -1
  109. package/dist/cmd/cloud/sandbox/snapshot/generate.js +5 -1
  110. package/dist/cmd/cloud/sandbox/snapshot/generate.js.map +1 -1
  111. package/dist/cmd/cloud/schedule/create.d.ts +3 -0
  112. package/dist/cmd/cloud/schedule/create.d.ts.map +1 -0
  113. package/dist/cmd/cloud/schedule/create.js +72 -0
  114. package/dist/cmd/cloud/schedule/create.js.map +1 -0
  115. package/dist/cmd/cloud/schedule/delete.d.ts +3 -0
  116. package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -0
  117. package/dist/cmd/cloud/schedule/delete.js +38 -0
  118. package/dist/cmd/cloud/schedule/delete.js.map +1 -0
  119. package/dist/cmd/cloud/schedule/delivery/get.d.ts +3 -0
  120. package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -0
  121. package/dist/cmd/cloud/schedule/delivery/get.js +78 -0
  122. package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -0
  123. package/dist/cmd/cloud/schedule/delivery/index.d.ts +3 -0
  124. package/dist/cmd/cloud/schedule/delivery/index.d.ts.map +1 -0
  125. package/dist/cmd/cloud/schedule/delivery/index.js +23 -0
  126. package/dist/cmd/cloud/schedule/delivery/index.js.map +1 -0
  127. package/dist/cmd/cloud/schedule/delivery/list.d.ts +3 -0
  128. package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -0
  129. package/dist/cmd/cloud/schedule/delivery/list.js +67 -0
  130. package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -0
  131. package/dist/cmd/cloud/schedule/destination/create.d.ts +3 -0
  132. package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -0
  133. package/dist/cmd/cloud/schedule/destination/create.js +97 -0
  134. package/dist/cmd/cloud/schedule/destination/create.js.map +1 -0
  135. package/dist/cmd/cloud/schedule/destination/delete.d.ts +3 -0
  136. package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -0
  137. package/dist/cmd/cloud/schedule/destination/delete.js +41 -0
  138. package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -0
  139. package/dist/cmd/cloud/schedule/destination/get.d.ts +3 -0
  140. package/dist/cmd/cloud/schedule/destination/get.d.ts.map +1 -0
  141. package/dist/cmd/cloud/schedule/destination/get.js +57 -0
  142. package/dist/cmd/cloud/schedule/destination/get.js.map +1 -0
  143. package/dist/cmd/cloud/schedule/destination/index.d.ts +3 -0
  144. package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -0
  145. package/dist/cmd/cloud/schedule/destination/index.js +26 -0
  146. package/dist/cmd/cloud/schedule/destination/index.js.map +1 -0
  147. package/dist/cmd/cloud/schedule/destination/list.d.ts +3 -0
  148. package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -0
  149. package/dist/cmd/cloud/schedule/destination/list.js +58 -0
  150. package/dist/cmd/cloud/schedule/destination/list.js.map +1 -0
  151. package/dist/cmd/cloud/schedule/get.d.ts +3 -0
  152. package/dist/cmd/cloud/schedule/get.d.ts.map +1 -0
  153. package/dist/cmd/cloud/schedule/get.js +76 -0
  154. package/dist/cmd/cloud/schedule/get.js.map +1 -0
  155. package/dist/cmd/cloud/schedule/index.d.ts +3 -0
  156. package/dist/cmd/cloud/schedule/index.d.ts.map +1 -0
  157. package/dist/cmd/cloud/schedule/index.js +35 -0
  158. package/dist/cmd/cloud/schedule/index.js.map +1 -0
  159. package/dist/cmd/cloud/schedule/list.d.ts +3 -0
  160. package/dist/cmd/cloud/schedule/list.d.ts.map +1 -0
  161. package/dist/cmd/cloud/schedule/list.js +60 -0
  162. package/dist/cmd/cloud/schedule/list.js.map +1 -0
  163. package/dist/cmd/cloud/schedule/update.d.ts +3 -0
  164. package/dist/cmd/cloud/schedule/update.d.ts.map +1 -0
  165. package/dist/cmd/cloud/schedule/update.js +65 -0
  166. package/dist/cmd/cloud/schedule/update.js.map +1 -0
  167. package/dist/cmd/cloud/schedule/util.d.ts +11 -0
  168. package/dist/cmd/cloud/schedule/util.d.ts.map +1 -0
  169. package/dist/cmd/cloud/schedule/util.js +17 -0
  170. package/dist/cmd/cloud/schedule/util.js.map +1 -0
  171. package/dist/cmd/cloud/task/create.d.ts +3 -0
  172. package/dist/cmd/cloud/task/create.d.ts.map +1 -0
  173. package/dist/cmd/cloud/task/create.js +108 -0
  174. package/dist/cmd/cloud/task/create.js.map +1 -0
  175. package/dist/cmd/cloud/task/get.d.ts +3 -0
  176. package/dist/cmd/cloud/task/get.d.ts.map +1 -0
  177. package/dist/cmd/cloud/task/get.js +124 -0
  178. package/dist/cmd/cloud/task/get.js.map +1 -0
  179. package/dist/cmd/cloud/task/index.d.ts +3 -0
  180. package/dist/cmd/cloud/task/index.d.ts.map +1 -0
  181. package/dist/cmd/cloud/task/index.js +33 -0
  182. package/dist/cmd/cloud/task/index.js.map +1 -0
  183. package/dist/cmd/cloud/task/list.d.ts +3 -0
  184. package/dist/cmd/cloud/task/list.d.ts.map +1 -0
  185. package/dist/cmd/cloud/task/list.js +174 -0
  186. package/dist/cmd/cloud/task/list.js.map +1 -0
  187. package/dist/cmd/cloud/task/update.d.ts +3 -0
  188. package/dist/cmd/cloud/task/update.d.ts.map +1 -0
  189. package/dist/cmd/cloud/task/update.js +118 -0
  190. package/dist/cmd/cloud/task/update.js.map +1 -0
  191. package/dist/cmd/cloud/task/util.d.ts +18 -0
  192. package/dist/cmd/cloud/task/util.d.ts.map +1 -0
  193. package/dist/cmd/cloud/task/util.js +45 -0
  194. package/dist/cmd/cloud/task/util.js.map +1 -0
  195. package/dist/cmd/cloud/webhook/create.d.ts +3 -0
  196. package/dist/cmd/cloud/webhook/create.d.ts.map +1 -0
  197. package/dist/cmd/cloud/webhook/create.js +54 -0
  198. package/dist/cmd/cloud/webhook/create.js.map +1 -0
  199. package/dist/cmd/cloud/webhook/delete.d.ts +3 -0
  200. package/dist/cmd/cloud/webhook/delete.d.ts.map +1 -0
  201. package/dist/cmd/cloud/webhook/delete.js +50 -0
  202. package/dist/cmd/cloud/webhook/delete.js.map +1 -0
  203. package/dist/cmd/cloud/webhook/deliveries.d.ts +3 -0
  204. package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -0
  205. package/dist/cmd/cloud/webhook/deliveries.js +123 -0
  206. package/dist/cmd/cloud/webhook/deliveries.js.map +1 -0
  207. package/dist/cmd/cloud/webhook/destinations.d.ts +3 -0
  208. package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -0
  209. package/dist/cmd/cloud/webhook/destinations.js +212 -0
  210. package/dist/cmd/cloud/webhook/destinations.js.map +1 -0
  211. package/dist/cmd/cloud/webhook/get.d.ts +3 -0
  212. package/dist/cmd/cloud/webhook/get.d.ts.map +1 -0
  213. package/dist/cmd/cloud/webhook/get.js +50 -0
  214. package/dist/cmd/cloud/webhook/get.js.map +1 -0
  215. package/dist/cmd/cloud/webhook/index.d.ts +3 -0
  216. package/dist/cmd/cloud/webhook/index.d.ts.map +1 -0
  217. package/dist/cmd/cloud/webhook/index.js +45 -0
  218. package/dist/cmd/cloud/webhook/index.js.map +1 -0
  219. package/dist/cmd/cloud/webhook/list.d.ts +3 -0
  220. package/dist/cmd/cloud/webhook/list.d.ts.map +1 -0
  221. package/dist/cmd/cloud/webhook/list.js +72 -0
  222. package/dist/cmd/cloud/webhook/list.js.map +1 -0
  223. package/dist/cmd/cloud/webhook/receipts.d.ts +3 -0
  224. package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -0
  225. package/dist/cmd/cloud/webhook/receipts.js +128 -0
  226. package/dist/cmd/cloud/webhook/receipts.js.map +1 -0
  227. package/dist/cmd/cloud/webhook/util.d.ts +27 -0
  228. package/dist/cmd/cloud/webhook/util.d.ts.map +1 -0
  229. package/dist/cmd/cloud/webhook/util.js +20 -0
  230. package/dist/cmd/cloud/webhook/util.js.map +1 -0
  231. package/dist/cmd/project/add/domain.d.ts.map +1 -1
  232. package/dist/cmd/project/add/domain.js +6 -4
  233. package/dist/cmd/project/add/domain.js.map +1 -1
  234. package/dist/cmd/project/domain/check.d.ts.map +1 -1
  235. package/dist/cmd/project/domain/check.js +10 -5
  236. package/dist/cmd/project/domain/check.js.map +1 -1
  237. package/dist/cmd/project/template-flow.d.ts.map +1 -1
  238. package/dist/cmd/project/template-flow.js +2 -1
  239. package/dist/cmd/project/template-flow.js.map +1 -1
  240. package/dist/config.d.ts +8 -0
  241. package/dist/config.d.ts.map +1 -1
  242. package/dist/domain.d.ts +3 -2
  243. package/dist/domain.d.ts.map +1 -1
  244. package/dist/domain.js +87 -21
  245. package/dist/domain.js.map +1 -1
  246. package/dist/types.d.ts +10 -2
  247. package/dist/types.d.ts.map +1 -1
  248. package/dist/types.js +3 -2
  249. package/dist/types.js.map +1 -1
  250. package/dist/version-check.d.ts.map +1 -1
  251. package/dist/version-check.js +18 -3
  252. package/dist/version-check.js.map +1 -1
  253. package/package.json +6 -6
  254. package/src/auth.ts +7 -0
  255. package/src/cache/resource-region.ts +4 -1
  256. package/src/cmd/ai/claude-code/install.ts +0 -3
  257. package/src/cmd/build/vite/public-asset-path-plugin.ts +18 -4
  258. package/src/cmd/cloud/deploy.ts +1 -0
  259. package/src/cmd/cloud/email/create.ts +70 -0
  260. package/src/cmd/cloud/email/delete.ts +53 -0
  261. package/src/cmd/cloud/email/destination/delete.ts +65 -0
  262. package/src/cmd/cloud/email/destination/index.ts +15 -0
  263. package/src/cmd/cloud/email/destination/list.ts +46 -0
  264. package/src/cmd/cloud/email/destination/schemas.ts +9 -0
  265. package/src/cmd/cloud/email/destination/url.ts +75 -0
  266. package/src/cmd/cloud/email/get.ts +52 -0
  267. package/src/cmd/cloud/email/inbound/get.ts +53 -0
  268. package/src/cmd/cloud/email/inbound/index.ts +13 -0
  269. package/src/cmd/cloud/email/inbound/list.ts +50 -0
  270. package/src/cmd/cloud/email/inbound/schemas.ts +11 -0
  271. package/src/cmd/cloud/email/index.ts +29 -0
  272. package/src/cmd/cloud/email/list.ts +44 -0
  273. package/src/cmd/cloud/email/outbound/get.ts +54 -0
  274. package/src/cmd/cloud/email/outbound/index.ts +13 -0
  275. package/src/cmd/cloud/email/outbound/list.ts +50 -0
  276. package/src/cmd/cloud/email/outbound/schemas.ts +15 -0
  277. package/src/cmd/cloud/email/send.ts +91 -0
  278. package/src/cmd/cloud/email/util.ts +89 -0
  279. package/src/cmd/cloud/index.ts +8 -0
  280. package/src/cmd/cloud/region-lookup.ts +58 -2
  281. package/src/cmd/cloud/sandbox/snapshot/build.ts +59 -55
  282. package/src/cmd/cloud/sandbox/snapshot/generate.ts +5 -1
  283. package/src/cmd/cloud/schedule/create.ts +83 -0
  284. package/src/cmd/cloud/schedule/delete.ts +43 -0
  285. package/src/cmd/cloud/schedule/delivery/get.ts +85 -0
  286. package/src/cmd/cloud/schedule/delivery/index.ts +24 -0
  287. package/src/cmd/cloud/schedule/delivery/list.ts +82 -0
  288. package/src/cmd/cloud/schedule/destination/create.ts +110 -0
  289. package/src/cmd/cloud/schedule/destination/delete.ts +46 -0
  290. package/src/cmd/cloud/schedule/destination/get.ts +66 -0
  291. package/src/cmd/cloud/schedule/destination/index.ts +27 -0
  292. package/src/cmd/cloud/schedule/destination/list.ts +72 -0
  293. package/src/cmd/cloud/schedule/get.ts +92 -0
  294. package/src/cmd/cloud/schedule/index.ts +36 -0
  295. package/src/cmd/cloud/schedule/list.ts +78 -0
  296. package/src/cmd/cloud/schedule/update.ts +74 -0
  297. package/src/cmd/cloud/schedule/util.ts +34 -0
  298. package/src/cmd/cloud/task/create.ts +124 -0
  299. package/src/cmd/cloud/task/get.ts +138 -0
  300. package/src/cmd/cloud/task/index.ts +34 -0
  301. package/src/cmd/cloud/task/list.ts +191 -0
  302. package/src/cmd/cloud/task/update.ts +123 -0
  303. package/src/cmd/cloud/task/util.ts +74 -0
  304. package/src/cmd/cloud/webhook/create.ts +66 -0
  305. package/src/cmd/cloud/webhook/delete.ts +57 -0
  306. package/src/cmd/cloud/webhook/deliveries.ts +149 -0
  307. package/src/cmd/cloud/webhook/destinations.ts +274 -0
  308. package/src/cmd/cloud/webhook/get.ts +59 -0
  309. package/src/cmd/cloud/webhook/index.ts +46 -0
  310. package/src/cmd/cloud/webhook/list.ts +82 -0
  311. package/src/cmd/cloud/webhook/receipts.ts +157 -0
  312. package/src/cmd/cloud/webhook/util.ts +35 -0
  313. package/src/cmd/project/add/domain.ts +10 -4
  314. package/src/cmd/project/domain/check.ts +16 -5
  315. package/src/cmd/project/template-flow.ts +2 -1
  316. package/src/domain.ts +96 -21
  317. package/src/types.ts +3 -1
  318. package/src/version-check.ts +22 -3
@@ -0,0 +1,274 @@
1
+ import { z } from 'zod';
2
+ import { createCommand, createSubcommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createWebhookAPIClient, getWebhookApiOptions } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import { ErrorCode } from '../../../errors';
7
+ import {
8
+ createWebhookDestination,
9
+ listWebhookDestinations,
10
+ updateWebhookDestination,
11
+ deleteWebhookDestination,
12
+ WebhookDestinationSchema,
13
+ type WebhookDestination,
14
+ } from '@agentuity/server';
15
+
16
+ const DestinationsListResponseSchema = z.object({
17
+ destinations: z.array(
18
+ z.object({
19
+ id: z.string(),
20
+ type: z.string(),
21
+ config: z.record(z.string(), z.unknown()),
22
+ created_at: z.string(),
23
+ })
24
+ ),
25
+ });
26
+
27
+ const listDestinationsSubcommand = createSubcommand({
28
+ name: 'list',
29
+ aliases: ['ls'],
30
+ description: 'List destinations for a webhook',
31
+ tags: ['read-only', 'fast', 'requires-auth'],
32
+ requires: { auth: true },
33
+ examples: [
34
+ {
35
+ command: getCommand('cloud webhook destinations list wh_abc123'),
36
+ description: 'List webhook destinations',
37
+ },
38
+ ],
39
+ schema: {
40
+ args: z.object({
41
+ webhook_id: z.string().min(1).describe('Webhook ID'),
42
+ }),
43
+ response: DestinationsListResponseSchema,
44
+ },
45
+ idempotent: true,
46
+
47
+ async handler(ctx) {
48
+ const { args, options } = ctx;
49
+ const client = await createWebhookAPIClient(ctx);
50
+ const destinations = await listWebhookDestinations(
51
+ client,
52
+ args.webhook_id,
53
+ getWebhookApiOptions(ctx)
54
+ );
55
+
56
+ if (!options.json) {
57
+ if (destinations.length === 0) {
58
+ tui.info('No destinations configured');
59
+ } else {
60
+ const tableData = destinations.map((d: WebhookDestination) => ({
61
+ ID: d.id,
62
+ Type: d.type,
63
+ Config: JSON.stringify(d.config),
64
+ Created: new Date(d.created_at).toLocaleString(),
65
+ }));
66
+ tui.table(tableData, ['ID', 'Type', 'Config', 'Created']);
67
+ }
68
+ }
69
+
70
+ return {
71
+ destinations: destinations.map((d: WebhookDestination) => ({
72
+ id: d.id,
73
+ type: d.type,
74
+ config: d.config,
75
+ created_at: d.created_at,
76
+ })),
77
+ };
78
+ },
79
+ });
80
+
81
+ const createUrlDestinationSubcommand = createSubcommand({
82
+ name: 'url',
83
+ description: 'Create a URL destination for a webhook',
84
+ tags: ['mutating', 'creates-resource', 'requires-auth'],
85
+ requires: { auth: true },
86
+ examples: [
87
+ {
88
+ command: getCommand(
89
+ 'cloud webhook destinations create url wh_abc123 https://example.com/webhook'
90
+ ),
91
+ description: 'Create a URL destination',
92
+ },
93
+ ],
94
+ schema: {
95
+ args: z.object({
96
+ webhook_id: z.string().min(1).describe('Webhook ID'),
97
+ url: z.string().min(1).describe('Destination URL'),
98
+ }),
99
+ response: WebhookDestinationSchema,
100
+ },
101
+
102
+ async handler(ctx) {
103
+ const { args, options } = ctx;
104
+ const client = await createWebhookAPIClient(ctx);
105
+
106
+ const destination = await createWebhookDestination(
107
+ client,
108
+ args.webhook_id,
109
+ {
110
+ type: 'url',
111
+ config: { url: args.url },
112
+ },
113
+ getWebhookApiOptions(ctx)
114
+ );
115
+
116
+ if (!options.json) {
117
+ tui.success(`Created destination: ${destination.id}`);
118
+ console.log(` URL: ${args.url}`);
119
+ }
120
+
121
+ return destination;
122
+ },
123
+ });
124
+
125
+ const createDestinationSubcommand = createCommand({
126
+ name: 'create',
127
+ description: 'Create a destination for a webhook',
128
+ tags: ['mutating', 'creates-resource', 'requires-auth'],
129
+ requires: { auth: true },
130
+ examples: [
131
+ {
132
+ command: getCommand(
133
+ 'cloud webhook destinations create url wh_abc123 --url https://example.com/webhook'
134
+ ),
135
+ description: 'Create a URL destination',
136
+ },
137
+ ],
138
+ subcommands: [createUrlDestinationSubcommand],
139
+ });
140
+
141
+ const updateDestinationSubcommand = createSubcommand({
142
+ name: 'update',
143
+ description: 'Update a webhook destination',
144
+ tags: ['mutating', 'requires-auth'],
145
+ requires: { auth: true },
146
+ examples: [
147
+ {
148
+ command: getCommand(
149
+ 'cloud webhook destinations update wh_abc123 whds_def456 --url https://example.com/v2'
150
+ ),
151
+ description: 'Update a destination URL',
152
+ },
153
+ ],
154
+ schema: {
155
+ args: z.object({
156
+ webhook_id: z.string().min(1).describe('Webhook ID'),
157
+ destination_id: z.string().min(1).describe('Destination ID'),
158
+ }),
159
+ options: z.object({
160
+ url: z.string().optional().describe('Updated destination URL'),
161
+ }),
162
+ response: WebhookDestinationSchema,
163
+ },
164
+
165
+ async handler(ctx) {
166
+ const { args, opts, options } = ctx;
167
+ const client = await createWebhookAPIClient(ctx);
168
+
169
+ const updateParams: { config?: Record<string, unknown> } = {};
170
+
171
+ if (opts.url) {
172
+ updateParams.config = { url: opts.url };
173
+ }
174
+
175
+ const destination = await updateWebhookDestination(
176
+ client,
177
+ args.webhook_id,
178
+ args.destination_id,
179
+ updateParams,
180
+ getWebhookApiOptions(ctx)
181
+ );
182
+
183
+ if (!options.json) {
184
+ tui.success(`Updated destination: ${destination.id}`);
185
+ console.log(` URL: ${JSON.stringify(destination.config)}`);
186
+ }
187
+
188
+ return destination;
189
+ },
190
+ });
191
+
192
+ const DeleteDestinationResponseSchema = z.object({
193
+ success: z.boolean(),
194
+ webhook_id: z.string(),
195
+ destination_id: z.string(),
196
+ });
197
+
198
+ const deleteDestinationSubcommand = createSubcommand({
199
+ name: 'delete',
200
+ aliases: ['rm'],
201
+ description: 'Delete a destination from a webhook',
202
+ tags: ['mutating', 'deletes-resource', 'requires-auth'],
203
+ requires: { auth: true },
204
+ examples: [
205
+ {
206
+ command: getCommand('cloud webhook destinations delete wh_abc123 whds_def456 --confirm'),
207
+ description: 'Delete a destination',
208
+ },
209
+ ],
210
+ schema: {
211
+ args: z.object({
212
+ webhook_id: z.string().min(1).describe('Webhook ID'),
213
+ destination_id: z.string().min(1).describe('Destination ID'),
214
+ }),
215
+ options: z.object({
216
+ confirm: z.boolean().default(false).describe('Skip confirmation prompt'),
217
+ }),
218
+ response: DeleteDestinationResponseSchema,
219
+ },
220
+
221
+ async handler(ctx) {
222
+ const { args, opts, options } = ctx;
223
+
224
+ if (!opts.confirm) {
225
+ tui.fatal('Use --confirm to confirm destination deletion', ErrorCode.INVALID_ARGUMENT);
226
+ }
227
+
228
+ const client = await createWebhookAPIClient(ctx);
229
+ await deleteWebhookDestination(
230
+ client,
231
+ args.webhook_id,
232
+ args.destination_id,
233
+ getWebhookApiOptions(ctx)
234
+ );
235
+
236
+ if (!options.json) {
237
+ tui.success(`Deleted destination: ${args.destination_id}`);
238
+ }
239
+
240
+ return {
241
+ success: true,
242
+ webhook_id: args.webhook_id,
243
+ destination_id: args.destination_id,
244
+ };
245
+ },
246
+ });
247
+
248
+ export const destinationsSubcommand = createCommand({
249
+ name: 'destinations',
250
+ aliases: ['dest'],
251
+ description: 'Manage webhook destinations',
252
+ tags: ['requires-auth'],
253
+ requires: { auth: true },
254
+ examples: [
255
+ {
256
+ command: getCommand('cloud webhook destinations list wh_abc123'),
257
+ description: 'List destinations',
258
+ },
259
+ {
260
+ command: getCommand(
261
+ 'cloud webhook destinations create url wh_abc123 --url https://example.com/webhook'
262
+ ),
263
+ description: 'Create a URL destination',
264
+ },
265
+ ],
266
+ subcommands: [
267
+ listDestinationsSubcommand,
268
+ createDestinationSubcommand,
269
+ updateDestinationSubcommand,
270
+ deleteDestinationSubcommand,
271
+ ],
272
+ });
273
+
274
+ export default destinationsSubcommand;
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createWebhookAPIClient, getWebhookApiOptions } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import { getWebhook, WebhookSchema } from '@agentuity/server';
7
+
8
+ export const getSubcommand = createCommand({
9
+ name: 'get',
10
+ description: 'Get webhook details',
11
+ tags: ['read-only', 'fast', 'requires-auth'],
12
+ requires: { auth: true },
13
+ examples: [
14
+ {
15
+ command: getCommand('cloud webhook get wh_abc123'),
16
+ description: 'Get webhook details',
17
+ },
18
+ ],
19
+ schema: {
20
+ args: z.object({
21
+ id: z.string().min(1).describe('Webhook ID'),
22
+ }),
23
+ response: WebhookSchema,
24
+ },
25
+ idempotent: true,
26
+
27
+ async handler(ctx) {
28
+ const { args, options } = ctx;
29
+ const client = await createWebhookAPIClient(ctx);
30
+ const apiOptions = getWebhookApiOptions(ctx);
31
+
32
+ const webhook = await getWebhook(client, args.id, apiOptions);
33
+
34
+ if (!options.json) {
35
+ const details: Record<string, unknown> = {
36
+ Name: webhook.name,
37
+ ID: webhook.id,
38
+ };
39
+
40
+ if (webhook.description) {
41
+ details.Description = webhook.description;
42
+ }
43
+
44
+ if (webhook.url) {
45
+ details.URL = webhook.url;
46
+ }
47
+
48
+ details['Created By'] = webhook.created_by;
49
+ details.Created = new Date(webhook.created_at).toISOString();
50
+ details.Updated = new Date(webhook.updated_at).toISOString();
51
+
52
+ tui.table([details], undefined, { layout: 'vertical' });
53
+ }
54
+
55
+ return webhook;
56
+ },
57
+ });
58
+
59
+ export default getSubcommand;
@@ -0,0 +1,46 @@
1
+ import { createCommand } from '../../../types';
2
+ import { listSubcommand } from './list';
3
+ import { createSubcommand } from './create';
4
+ import { getSubcommand } from './get';
5
+ import { deleteSubcommand } from './delete';
6
+ import { destinationsSubcommand } from './destinations';
7
+ import { receiptsSubcommand } from './receipts';
8
+ import { deliveriesSubcommand } from './deliveries';
9
+ import { getCommand } from '../../../command-prefix';
10
+
11
+ export const command = createCommand({
12
+ name: 'webhook',
13
+ aliases: ['webhooks'],
14
+ description: 'Manage webhooks for receiving external HTTP callbacks',
15
+ tags: ['requires-auth'],
16
+ examples: [
17
+ {
18
+ command: getCommand('cloud webhook list'),
19
+ description: 'List all webhooks',
20
+ },
21
+ {
22
+ command: getCommand('cloud webhook create --name my-webhook'),
23
+ description: 'Create a webhook',
24
+ },
25
+ {
26
+ command: getCommand('cloud webhook get wh_abc123'),
27
+ description: 'Get webhook details',
28
+ },
29
+ {
30
+ command: getCommand('cloud webhook destinations list wh_abc123'),
31
+ description: 'List webhook destinations',
32
+ },
33
+ ],
34
+ subcommands: [
35
+ listSubcommand,
36
+ createSubcommand,
37
+ getSubcommand,
38
+ deleteSubcommand,
39
+ destinationsSubcommand,
40
+ receiptsSubcommand,
41
+ deliveriesSubcommand,
42
+ ],
43
+ requires: { auth: true },
44
+ });
45
+
46
+ export default command;
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createWebhookAPIClient, getWebhookApiOptions } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import { listWebhooks, type Webhook } from '@agentuity/server';
7
+
8
+ const WebhookListResponseSchema = z.object({
9
+ webhooks: z.array(
10
+ z.object({
11
+ name: z.string(),
12
+ id: z.string(),
13
+ description: z.string().nullable().optional(),
14
+ created_at: z.string(),
15
+ })
16
+ ),
17
+ });
18
+
19
+ export const listSubcommand = createCommand({
20
+ name: 'list',
21
+ aliases: ['ls'],
22
+ description: 'List all webhooks',
23
+ tags: ['read-only', 'fast', 'requires-auth'],
24
+ requires: { auth: true },
25
+ examples: [
26
+ { command: getCommand('cloud webhook list'), description: 'List all webhooks' },
27
+ { command: getCommand('cloud webhook ls'), description: 'List all webhooks (alias)' },
28
+ ],
29
+ schema: {
30
+ args: z.object({}),
31
+ options: z.object({
32
+ orgId: z.string().optional().describe('Filter by organization ID'),
33
+ limit: z.coerce
34
+ .number()
35
+ .min(0)
36
+ .optional()
37
+ .describe('Maximum number of webhooks to return'),
38
+ offset: z.coerce.number().min(0).optional().describe('Offset for pagination'),
39
+ }),
40
+ response: WebhookListResponseSchema,
41
+ },
42
+ idempotent: true,
43
+
44
+ async handler(ctx) {
45
+ const { options, opts } = ctx;
46
+ const client = await createWebhookAPIClient(ctx);
47
+ const webhookOptions = opts?.orgId ? { orgId: opts.orgId } : getWebhookApiOptions(ctx);
48
+ const result = await listWebhooks(
49
+ client,
50
+ {
51
+ limit: opts.limit,
52
+ offset: opts.offset,
53
+ },
54
+ webhookOptions
55
+ );
56
+
57
+ if (!options.json) {
58
+ if (result.webhooks.length === 0) {
59
+ tui.info('No webhooks found');
60
+ } else {
61
+ const tableData = result.webhooks.map((w: Webhook) => ({
62
+ Name: w.name,
63
+ ID: w.id,
64
+ Description: w.description ?? '-',
65
+ Created: new Date(w.created_at).toLocaleString(),
66
+ }));
67
+ tui.table(tableData, ['Name', 'ID', 'Description', 'Created']);
68
+ }
69
+ }
70
+
71
+ return {
72
+ webhooks: result.webhooks.map((w: Webhook) => ({
73
+ name: w.name,
74
+ id: w.id,
75
+ description: w.description,
76
+ created_at: w.created_at,
77
+ })),
78
+ };
79
+ },
80
+ });
81
+
82
+ export default listSubcommand;
@@ -0,0 +1,157 @@
1
+ import { z } from 'zod';
2
+ import { createCommand, createSubcommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createWebhookAPIClient, getWebhookApiOptions } from './util';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import {
7
+ listWebhookReceipts,
8
+ getWebhookReceipt,
9
+ WebhookReceiptSchema,
10
+ type WebhookReceipt,
11
+ } from '@agentuity/server';
12
+
13
+ const ReceiptsListResponseSchema = z.object({
14
+ receipts: z.array(
15
+ z.object({
16
+ id: z.string(),
17
+ date: z.string(),
18
+ webhook_id: z.string(),
19
+ })
20
+ ),
21
+ });
22
+
23
+ const listReceiptsSubcommand = createSubcommand({
24
+ name: 'list',
25
+ aliases: ['ls'],
26
+ description: 'List receipts for a webhook',
27
+ tags: ['read-only', 'fast', 'requires-auth'],
28
+ requires: { auth: true },
29
+ examples: [
30
+ {
31
+ command: getCommand('cloud webhook receipts list wh_abc123'),
32
+ description: 'List webhook receipts',
33
+ },
34
+ ],
35
+ schema: {
36
+ args: z.object({
37
+ webhook_id: z.string().min(1).describe('Webhook ID'),
38
+ }),
39
+ options: z.object({
40
+ limit: z.coerce
41
+ .number()
42
+ .min(0)
43
+ .optional()
44
+ .describe('Maximum number of receipts to return'),
45
+ offset: z.coerce.number().min(0).optional().describe('Offset for pagination'),
46
+ }),
47
+ response: ReceiptsListResponseSchema,
48
+ },
49
+ idempotent: true,
50
+
51
+ async handler(ctx) {
52
+ const { args, opts, options } = ctx;
53
+ const client = await createWebhookAPIClient(ctx);
54
+ const result = await listWebhookReceipts(
55
+ client,
56
+ args.webhook_id,
57
+ {
58
+ limit: opts.limit,
59
+ offset: opts.offset,
60
+ },
61
+ getWebhookApiOptions(ctx)
62
+ );
63
+
64
+ if (!options.json) {
65
+ if (result.receipts.length === 0) {
66
+ tui.info('No receipts found');
67
+ } else {
68
+ const tableData = result.receipts.map((r: WebhookReceipt) => ({
69
+ ID: r.id,
70
+ Date: new Date(r.date).toLocaleString(),
71
+ 'Webhook ID': r.webhook_id,
72
+ }));
73
+ tui.table(tableData, ['ID', 'Date', 'Webhook ID']);
74
+ }
75
+ }
76
+
77
+ return {
78
+ receipts: result.receipts.map((r: WebhookReceipt) => ({
79
+ id: r.id,
80
+ date: r.date,
81
+ webhook_id: r.webhook_id,
82
+ })),
83
+ };
84
+ },
85
+ });
86
+
87
+ const getReceiptSubcommand = createSubcommand({
88
+ name: 'get',
89
+ description: 'Get receipt details',
90
+ tags: ['read-only', 'fast', 'requires-auth'],
91
+ requires: { auth: true },
92
+ examples: [
93
+ {
94
+ command: getCommand('cloud webhook receipts get wh_abc123 whrc_def456'),
95
+ description: 'Get receipt details',
96
+ },
97
+ ],
98
+ schema: {
99
+ args: z.object({
100
+ webhook_id: z.string().min(1).describe('Webhook ID'),
101
+ receipt_id: z.string().min(1).describe('Receipt ID'),
102
+ }),
103
+ response: WebhookReceiptSchema,
104
+ },
105
+ idempotent: true,
106
+
107
+ async handler(ctx) {
108
+ const { args, options } = ctx;
109
+ const client = await createWebhookAPIClient(ctx);
110
+ const receipt = await getWebhookReceipt(
111
+ client,
112
+ args.webhook_id,
113
+ args.receipt_id,
114
+ getWebhookApiOptions(ctx)
115
+ );
116
+
117
+ if (!options.json) {
118
+ const details: Record<string, unknown> = {
119
+ ID: receipt.id,
120
+ Date: new Date(receipt.date).toLocaleString(),
121
+ 'Webhook ID': receipt.webhook_id,
122
+ };
123
+
124
+ tui.table([details], undefined, { layout: 'vertical' });
125
+
126
+ tui.newline();
127
+ tui.info('Headers');
128
+ tui.json(receipt.headers);
129
+
130
+ tui.newline();
131
+ tui.info('Payload');
132
+ tui.json(receipt.payload);
133
+ }
134
+
135
+ return receipt;
136
+ },
137
+ });
138
+
139
+ export const receiptsSubcommand = createCommand({
140
+ name: 'receipts',
141
+ description: 'Manage webhook receipts',
142
+ tags: ['requires-auth'],
143
+ requires: { auth: true },
144
+ examples: [
145
+ {
146
+ command: getCommand('cloud webhook receipts list wh_abc123'),
147
+ description: 'List receipts',
148
+ },
149
+ {
150
+ command: getCommand('cloud webhook receipts get wh_abc123 whrc_def456'),
151
+ description: 'Get receipt details',
152
+ },
153
+ ],
154
+ subcommands: [listReceiptsSubcommand, getReceiptSubcommand],
155
+ });
156
+
157
+ export default receiptsSubcommand;
@@ -0,0 +1,35 @@
1
+ import type { Logger } from '@agentuity/core';
2
+ import { APIClient, type WebhookApiOptions } from '@agentuity/server';
3
+ import { getGlobalCatalystAPIClient } from '../../../config';
4
+ import type { AuthData, Config, GlobalOptions } from '../../../types';
5
+
6
+ /**
7
+ * Context required for webhook API operations.
8
+ */
9
+ export interface WebhookContext {
10
+ logger: Logger;
11
+ auth: AuthData;
12
+ config: Config | null;
13
+ options: GlobalOptions;
14
+ orgId?: string;
15
+ }
16
+
17
+ /**
18
+ * Creates an API client for webhook operations.
19
+ *
20
+ * Webhooks are global resources that don't require a project context.
21
+ * Uses the global Catalyst API client with user authentication.
22
+ */
23
+ export async function createWebhookAPIClient(ctx: WebhookContext): Promise<APIClient> {
24
+ return getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
25
+ }
26
+
27
+ /**
28
+ * Creates WebhookApiOptions from the CLI context.
29
+ * Prioritizes explicit orgId on context, then falls back to global --org-id option,
30
+ * and finally to the preferred org from the profile configuration.
31
+ */
32
+ export function getWebhookApiOptions(ctx: WebhookContext): WebhookApiOptions | undefined {
33
+ const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
34
+ return orgId ? { orgId } : undefined;
35
+ }
@@ -95,7 +95,7 @@ export const domainSubcommand = createSubcommand({
95
95
  message: `Checking DNS for ${domain}`,
96
96
  clearOnSuccess: true,
97
97
  callback: async () => {
98
- return checkCustomDomainForDNS(project.projectId, [domain], config);
98
+ return checkCustomDomainForDNS(project.projectId, [domain], project.region, config);
99
99
  },
100
100
  });
101
101
 
@@ -117,11 +117,17 @@ export const domainSubcommand = createSubcommand({
117
117
  }
118
118
 
119
119
  tui.newline();
120
- tui.warning('DNS record not yet configured. Please add the following CNAME record:');
120
+ tui.warning(
121
+ 'DNS record not yet configured. Please add one of the following DNS records:'
122
+ );
121
123
  tui.newline();
122
124
  tui.output(` ${tui.colorInfo('Domain:')} ${tui.colorPrimary(result.domain)}`);
123
- tui.output(` ${tui.colorInfo('Type:')} ${tui.colorPrimary(result.recordType)}`);
124
- tui.output(` ${tui.colorInfo('Target:')} ${tui.colorPrimary(result.target)}`);
125
+ tui.output(` ${tui.colorInfo('CNAME:')} ${tui.colorPrimary(result.target)}`);
126
+ if (result.aRecordTarget) {
127
+ tui.output(
128
+ ` ${tui.colorInfo('A:')} ${tui.colorPrimary(result.aRecordTarget)}`
129
+ );
130
+ }
125
131
  tui.newline();
126
132
 
127
133
  if (isMisconfigured(result)) {