@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
@@ -553,6 +553,7 @@ export const deploySubcommand = createSubcommand({
553
553
  await domain.promptForDNS(
554
554
  project.projectId,
555
555
  project.deployment.domains,
556
+ project.region,
556
557
  config!,
557
558
  () => pauseStepUI(true)
558
559
  );
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ import enquirer from 'enquirer';
3
+ import { createCommand } from '../../../types';
4
+ import * as tui from '../../../tui';
5
+ import { setResourceInfo } from '../../../cache';
6
+ import { createEmailAdapter, resolveEmailOrgId, resolveEmailRegion, EmailAddressSchema } from './util';
7
+
8
+ export const createSubcommand = createCommand({
9
+ name: 'create',
10
+ aliases: ['add'],
11
+ description: 'Create an email address',
12
+ tags: ['mutating', 'creates-resource', 'requires-auth'],
13
+ requires: { auth: true },
14
+ schema: {
15
+ options: z.object({
16
+ localPart: z
17
+ .string()
18
+ .optional()
19
+ .describe('Local part for the email address (before @)'),
20
+ }),
21
+ response: EmailAddressSchema,
22
+ },
23
+
24
+ async handler(ctx) {
25
+ const { opts, options, config } = ctx;
26
+ let localPart = opts.localPart?.trim();
27
+
28
+ if (!localPart) {
29
+ const answer = await enquirer.prompt<{ local_part: string }>({
30
+ type: 'input',
31
+ name: 'local_part',
32
+ message: 'Local part (username):',
33
+ });
34
+ localPart = answer.local_part?.trim();
35
+ }
36
+
37
+ if (!localPart) {
38
+ tui.fatal('Local part is required');
39
+ }
40
+
41
+ const email = createEmailAdapter(ctx);
42
+ const address = await email.createAddress(localPart);
43
+
44
+ const profileName = config?.name ?? 'production';
45
+ const orgId = resolveEmailOrgId(ctx);
46
+ const region = resolveEmailRegion(ctx);
47
+ await setResourceInfo('email', profileName, address.id, region, orgId);
48
+
49
+ if (!options.json) {
50
+ tui.success(`Email Address: ${tui.bold(address.email)}`);
51
+ tui.table(
52
+ [
53
+ {
54
+ ID: address.id,
55
+ Email: address.email,
56
+ Project: address.project_id ?? '-',
57
+ Provider: address.provider ?? '-',
58
+ Created: new Date(address.created_at).toLocaleString(),
59
+ },
60
+ ],
61
+ ['ID', 'Email', 'Project', 'Provider', 'Created'],
62
+ { layout: 'vertical', padStart: ' ' }
63
+ );
64
+ }
65
+
66
+ return address;
67
+ },
68
+ });
69
+
70
+ export default createSubcommand;
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createEmailAdapter } from './util';
5
+
6
+ const DeleteResponseSchema = z.object({
7
+ success: z.boolean(),
8
+ id: z.string(),
9
+ });
10
+
11
+ export const deleteSubcommand = createCommand({
12
+ name: 'delete',
13
+ aliases: ['rm', 'del'],
14
+ description: 'Delete an email address',
15
+ tags: ['destructive', 'deletes-resource', 'requires-auth'],
16
+ requires: { auth: true },
17
+ schema: {
18
+ args: z.object({
19
+ id: z.string().min(1).describe('Email address ID (eaddr_*)'),
20
+ }),
21
+ options: z.object({
22
+ confirm: z.boolean().optional().default(false).describe('Skip confirmation prompt'),
23
+ }),
24
+ response: DeleteResponseSchema,
25
+ },
26
+
27
+ async handler(ctx) {
28
+ const { args, opts, options } = ctx;
29
+ if (!opts.confirm) {
30
+ const ok = await tui.confirm(`Delete email address ${tui.bold(args.id)}?`, false);
31
+ if (!ok) {
32
+ if (!options.json) {
33
+ tui.info('Cancelled');
34
+ }
35
+ return { success: false, id: args.id };
36
+ }
37
+ }
38
+
39
+ const email = createEmailAdapter(ctx);
40
+ await email.deleteAddress(args.id);
41
+
42
+ if (!options.json) {
43
+ tui.success(`Deleted email address ${args.id}`);
44
+ }
45
+
46
+ return {
47
+ success: true,
48
+ id: args.id,
49
+ };
50
+ },
51
+ });
52
+
53
+ export default deleteSubcommand;
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { createEmailAdapter } from '../util';
5
+
6
+ const DeleteDestinationResponseSchema = z.object({
7
+ success: z.boolean(),
8
+ address_id: z.string(),
9
+ destination_id: z.string(),
10
+ });
11
+
12
+ export const deleteSubcommand = createCommand({
13
+ name: 'delete',
14
+ aliases: ['rm', 'del'],
15
+ description: 'Delete a destination from an email address',
16
+ tags: ['destructive', 'deletes-resource', 'requires-auth'],
17
+ requires: { auth: true },
18
+ schema: {
19
+ args: z.object({
20
+ address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
21
+ destination_id: z.string().min(1).describe('Destination ID (edest_*)'),
22
+ }),
23
+ options: z.object({
24
+ confirm: z.boolean().optional().default(false).describe('Skip confirmation prompt'),
25
+ }),
26
+ response: DeleteDestinationResponseSchema,
27
+ },
28
+
29
+ async handler(ctx) {
30
+ const { args, opts, options } = ctx;
31
+
32
+ if (!args.address_id.startsWith('eaddr_')) {
33
+ tui.fatal('Invalid email address ID — must start with eaddr_');
34
+ }
35
+ if (!args.destination_id.startsWith('edest_')) {
36
+ tui.fatal('Invalid destination ID — must start with edest_');
37
+ }
38
+
39
+ if (!opts.confirm && !options.json) {
40
+ const ok = await tui.confirm(
41
+ `Delete destination ${tui.bold(args.destination_id)} from address ${tui.bold(args.address_id)}?`,
42
+ false
43
+ );
44
+ if (!ok) {
45
+ tui.info('Cancelled');
46
+ return { success: false, address_id: args.address_id, destination_id: args.destination_id };
47
+ }
48
+ }
49
+
50
+ const email = createEmailAdapter(ctx);
51
+ await email.deleteDestination(args.address_id, args.destination_id);
52
+
53
+ if (!options.json) {
54
+ tui.success(`Deleted destination ${args.destination_id}`);
55
+ }
56
+
57
+ return {
58
+ success: true,
59
+ address_id: args.address_id,
60
+ destination_id: args.destination_id,
61
+ };
62
+ },
63
+ });
64
+
65
+ export default deleteSubcommand;
@@ -0,0 +1,15 @@
1
+ import { createCommand } from '../../../../types';
2
+ import { urlSubcommand } from './url';
3
+ import { listSubcommand } from './list';
4
+ import { deleteSubcommand } from './delete';
5
+
6
+ export const destinationCommand = createCommand({
7
+ name: 'destination',
8
+ aliases: ['destinations', 'dest'],
9
+ description: 'Manage email destinations for an address',
10
+ tags: ['requires-auth'],
11
+ requires: { auth: true },
12
+ subcommands: [urlSubcommand, listSubcommand, deleteSubcommand],
13
+ });
14
+
15
+ export default destinationCommand;
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { createEmailAdapter } from '../util';
5
+ import { DestinationSchema } from './schemas';
6
+
7
+ export const listSubcommand = createCommand({
8
+ name: 'list',
9
+ aliases: ['ls'],
10
+ description: 'List destinations for an email address',
11
+ tags: ['read-only', 'requires-auth'],
12
+ requires: { auth: true },
13
+ schema: {
14
+ args: z.object({
15
+ address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
16
+ }),
17
+ response: z.array(DestinationSchema),
18
+ },
19
+
20
+ async handler(ctx) {
21
+ const { args, options } = ctx;
22
+ const email = createEmailAdapter(ctx);
23
+ const destinations = await email.listDestinations(args.address_id);
24
+
25
+ if (!options.json) {
26
+ tui.table(
27
+ destinations.map((item) => ({
28
+ ID: item.id,
29
+ Type: item.type,
30
+ 'Config URL': typeof item.config?.url === 'string' ? item.config.url : '-',
31
+ Created: new Date(item.created_at).toLocaleString(),
32
+ })),
33
+ [
34
+ { name: 'ID', alignment: 'left' },
35
+ { name: 'Type', alignment: 'left' },
36
+ { name: 'Config URL', alignment: 'left' },
37
+ { name: 'Created', alignment: 'left' },
38
+ ]
39
+ );
40
+ }
41
+
42
+ return destinations;
43
+ },
44
+ });
45
+
46
+ export default listSubcommand;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+
3
+ export const DestinationSchema = z.object({
4
+ id: z.string(),
5
+ type: z.string(),
6
+ config: z.record(z.string(), z.unknown()).optional(),
7
+ created_at: z.string(),
8
+ updated_at: z.string().optional(),
9
+ });
@@ -0,0 +1,75 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { setResourceInfo } from '../../../../cache';
5
+ import { createEmailAdapter, resolveEmailOrgId, resolveEmailRegion } from '../util';
6
+ import { DestinationSchema } from './schemas';
7
+
8
+ export const urlSubcommand = createCommand({
9
+ name: 'url',
10
+ description: 'Add a URL destination to an email address',
11
+ tags: ['mutating', 'creates-resource', 'requires-auth'],
12
+ requires: { auth: true },
13
+ schema: {
14
+ args: z.object({
15
+ address_id: z.string().min(1).describe('Email address ID (eaddr_*)'),
16
+ url: z
17
+ .string()
18
+ .url()
19
+ .refine((u) => /^https?:\/\//i.test(u), {
20
+ message: 'URL must use http or https protocol',
21
+ })
22
+ .describe('Destination webhook URL'),
23
+ }),
24
+ options: z.object({
25
+ method: z
26
+ .enum(['POST', 'PUT', 'PATCH'])
27
+ .optional()
28
+ .default('POST')
29
+ .describe('HTTP method (default: POST)'),
30
+ }),
31
+ response: DestinationSchema,
32
+ },
33
+
34
+ async handler(ctx) {
35
+ const { args, opts, options, config } = ctx;
36
+
37
+ const destinationConfig: Record<string, unknown> = {
38
+ url: args.url,
39
+ };
40
+ if (opts.method && opts.method !== 'POST') {
41
+ destinationConfig.method = opts.method;
42
+ }
43
+
44
+ const email = createEmailAdapter(ctx);
45
+ const destination = await email.createDestination(args.address_id, 'url', destinationConfig);
46
+
47
+ const profileName = config?.name ?? 'production';
48
+ const orgId = resolveEmailOrgId(ctx);
49
+ const region = resolveEmailRegion(ctx);
50
+ setResourceInfo('email', profileName, destination.id, region, orgId).catch(() => {
51
+ // Non-blocking: destination was already created successfully
52
+ });
53
+
54
+ if (!options.json) {
55
+ tui.success(`Destination created: ${tui.bold(destination.id)}`);
56
+ tui.table(
57
+ [
58
+ {
59
+ ID: destination.id,
60
+ Type: 'url',
61
+ URL: args.url,
62
+ Method: opts.method ?? 'POST',
63
+ Created: new Date(destination.created_at).toLocaleString(),
64
+ },
65
+ ],
66
+ ['ID', 'Type', 'URL', 'Method', 'Created'],
67
+ { layout: 'vertical', padStart: ' ' }
68
+ );
69
+ }
70
+
71
+ return destination;
72
+ },
73
+ });
74
+
75
+ export default urlSubcommand;
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createEmailAdapter, EmailAddressSchema } from './util';
5
+
6
+ export const getSubcommand = createCommand({
7
+ name: 'get',
8
+ description: 'Get an email address by ID',
9
+ tags: ['read-only', 'requires-auth'],
10
+ requires: { auth: true },
11
+ schema: {
12
+ args: z.object({
13
+ id: z.string().min(1).describe('Email address ID (eaddr_*)'),
14
+ }),
15
+ response: EmailAddressSchema,
16
+ },
17
+
18
+ async handler(ctx) {
19
+ const { args, options } = ctx;
20
+ const email = createEmailAdapter(ctx);
21
+ const address = await email.getAddress(args.id);
22
+
23
+ if (!address) {
24
+ tui.fatal(`Email address not found: ${args.id}`);
25
+ }
26
+
27
+ if (!options.json) {
28
+ tui.success(`Email Address: ${tui.bold(address.email)}`);
29
+ tui.table(
30
+ [
31
+ {
32
+ ID: address.id,
33
+ Email: address.email,
34
+ Project: address.project_id ?? '-',
35
+ Provider: address.provider ?? '-',
36
+ Config: address.config ? JSON.stringify(address.config) : '-',
37
+ Created: new Date(address.created_at).toLocaleString(),
38
+ Updated: address.updated_at
39
+ ? new Date(address.updated_at).toLocaleString()
40
+ : '-',
41
+ },
42
+ ],
43
+ ['ID', 'Email', 'Project', 'Provider', 'Config', 'Created', 'Updated'],
44
+ { layout: 'vertical', padStart: ' ' }
45
+ );
46
+ }
47
+
48
+ return address;
49
+ },
50
+ });
51
+
52
+ export default getSubcommand;
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { createEmailAdapter, truncate } from '../util';
5
+ import { EmailInboundSchema } from './schemas';
6
+
7
+ export const getSubcommand = createCommand({
8
+ name: 'get',
9
+ description: 'Get a received email by ID',
10
+ tags: ['read-only', 'requires-auth'],
11
+ requires: { auth: true },
12
+ schema: {
13
+ args: z.object({
14
+ id: z.string().min(1).describe('Inbound email ID (ein_*)'),
15
+ }),
16
+ response: EmailInboundSchema,
17
+ },
18
+
19
+ async handler(ctx) {
20
+ const { args, options } = ctx;
21
+ const email = createEmailAdapter(ctx);
22
+ const inbound = await email.getInbound(args.id);
23
+
24
+ if (!inbound) {
25
+ tui.fatal(`Inbound email not found: ${args.id}`);
26
+ }
27
+
28
+ if (!options.json) {
29
+ tui.success(`Inbound Email: ${tui.bold(inbound.id)}`);
30
+ tui.table(
31
+ [
32
+ {
33
+ ID: inbound.id,
34
+ From: inbound.from,
35
+ To: inbound.to,
36
+ Subject: inbound.subject ?? '-',
37
+ Text: truncate(inbound.text),
38
+ Status: inbound.status ?? '-',
39
+ Received: inbound.received_at
40
+ ? new Date(inbound.received_at).toLocaleString()
41
+ : '-',
42
+ },
43
+ ],
44
+ ['ID', 'From', 'To', 'Subject', 'Text', 'Status', 'Received'],
45
+ { layout: 'vertical', padStart: ' ' }
46
+ );
47
+ }
48
+
49
+ return inbound;
50
+ },
51
+ });
52
+
53
+ export default getSubcommand;
@@ -0,0 +1,13 @@
1
+ import { createCommand } from '../../../../types';
2
+ import { listSubcommand } from './list';
3
+ import { getSubcommand } from './get';
4
+
5
+ export const inboundCommand = createCommand({
6
+ name: 'inbound',
7
+ description: 'Manage inbound (received) emails',
8
+ tags: ['requires-auth'],
9
+ requires: { auth: true },
10
+ subcommands: [listSubcommand, getSubcommand],
11
+ });
12
+
13
+ export default inboundCommand;
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { createEmailAdapter } from '../util';
5
+ import { EmailInboundSchema } from './schemas';
6
+
7
+ export const listSubcommand = createCommand({
8
+ name: 'list',
9
+ aliases: ['ls'],
10
+ description: 'List received emails',
11
+ tags: ['read-only', 'requires-auth'],
12
+ requires: { auth: true },
13
+ schema: {
14
+ options: z.object({
15
+ addressId: z.string().optional().describe('Filter by email address ID'),
16
+ }),
17
+ response: z.array(EmailInboundSchema),
18
+ },
19
+
20
+ async handler(ctx) {
21
+ const { opts, options } = ctx;
22
+ const email = createEmailAdapter(ctx);
23
+ const inbound = await email.listInbound(opts.addressId);
24
+
25
+ if (!options.json) {
26
+ tui.table(
27
+ inbound.map((item) => ({
28
+ ID: item.id,
29
+ From: item.from,
30
+ To: item.to,
31
+ Subject: item.subject ?? '-',
32
+ Status: item.status ?? '-',
33
+ Received: item.received_at ? new Date(item.received_at).toLocaleString() : '-',
34
+ })),
35
+ [
36
+ { name: 'ID', alignment: 'left' },
37
+ { name: 'From', alignment: 'left' },
38
+ { name: 'To', alignment: 'left' },
39
+ { name: 'Subject', alignment: 'left' },
40
+ { name: 'Status', alignment: 'left' },
41
+ { name: 'Received', alignment: 'left' },
42
+ ]
43
+ );
44
+ }
45
+
46
+ return inbound;
47
+ },
48
+ });
49
+
50
+ export default listSubcommand;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export const EmailInboundSchema = z.object({
4
+ id: z.string(),
5
+ from: z.string(),
6
+ to: z.string(),
7
+ subject: z.string().optional(),
8
+ text: z.string().optional(),
9
+ status: z.string().optional(),
10
+ received_at: z.string().optional(),
11
+ });
@@ -0,0 +1,29 @@
1
+ import { createCommand } from '../../../types';
2
+ import { createSubcommand } from './create';
3
+ import { listSubcommand } from './list';
4
+ import { getSubcommand } from './get';
5
+ import { deleteSubcommand } from './delete';
6
+ import { destinationCommand } from './destination';
7
+ import { sendSubcommand } from './send';
8
+ import { inboundCommand } from './inbound';
9
+ import { outboundCommand } from './outbound';
10
+
11
+ export const emailCommand = createCommand({
12
+ name: 'email',
13
+ aliases: ['mail'],
14
+ description: 'Manage email addresses and messages',
15
+ tags: ['requires-auth'],
16
+ subcommands: [
17
+ createSubcommand,
18
+ listSubcommand,
19
+ getSubcommand,
20
+ deleteSubcommand,
21
+ destinationCommand,
22
+ sendSubcommand,
23
+ inboundCommand,
24
+ outboundCommand,
25
+ ],
26
+ requires: { auth: true },
27
+ });
28
+
29
+ export default emailCommand;
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { createEmailAdapter, EmailAddressSchema } from './util';
5
+
6
+ export const listSubcommand = createCommand({
7
+ name: 'list',
8
+ aliases: ['ls'],
9
+ description: 'List email addresses',
10
+ tags: ['read-only', 'requires-auth'],
11
+ requires: { auth: true },
12
+ schema: {
13
+ response: z.array(EmailAddressSchema),
14
+ },
15
+
16
+ async handler(ctx) {
17
+ const { options } = ctx;
18
+ const email = createEmailAdapter(ctx);
19
+ const addresses = await email.listAddresses();
20
+
21
+ if (!options.json) {
22
+ tui.table(
23
+ addresses.map((item) => ({
24
+ ID: item.id,
25
+ Email: item.email,
26
+ Project: item.project_id ?? '-',
27
+ Provider: item.provider ?? '-',
28
+ Created: new Date(item.created_at).toLocaleString(),
29
+ })),
30
+ [
31
+ { name: 'ID', alignment: 'left' },
32
+ { name: 'Email', alignment: 'left' },
33
+ { name: 'Project', alignment: 'left' },
34
+ { name: 'Provider', alignment: 'left' },
35
+ { name: 'Created', alignment: 'left' },
36
+ ]
37
+ );
38
+ }
39
+
40
+ return addresses;
41
+ },
42
+ });
43
+
44
+ export default listSubcommand;
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../../types';
3
+ import * as tui from '../../../../tui';
4
+ import { createEmailAdapter, truncate } from '../util';
5
+ import { EmailOutboundSchema } from './schemas';
6
+
7
+ export const getSubcommand = createCommand({
8
+ name: 'get',
9
+ description: 'Get a sent email by ID',
10
+ tags: ['read-only', 'requires-auth'],
11
+ requires: { auth: true },
12
+ schema: {
13
+ args: z.object({
14
+ id: z.string().min(1).describe('Outbound email ID (eout_*)'),
15
+ }),
16
+ response: EmailOutboundSchema,
17
+ },
18
+
19
+ async handler(ctx) {
20
+ const { args, options } = ctx;
21
+ const email = createEmailAdapter(ctx);
22
+ const outbound = await email.getOutbound(args.id);
23
+
24
+ if (!outbound) {
25
+ tui.fatal(`Outbound email not found: ${args.id}`);
26
+ }
27
+
28
+ if (!options.json) {
29
+ tui.success(`Outbound Email: ${tui.bold(outbound.id)}`);
30
+ tui.table(
31
+ [
32
+ {
33
+ ID: outbound.id,
34
+ From: outbound.from,
35
+ To: outbound.to,
36
+ Subject: outbound.subject ?? '-',
37
+ Text: truncate(outbound.text),
38
+ Status: outbound.status ?? '-',
39
+ Error: outbound.error ?? '-',
40
+ Sent: outbound.sent_at
41
+ ? new Date(outbound.sent_at).toLocaleString()
42
+ : '-',
43
+ },
44
+ ],
45
+ ['ID', 'From', 'To', 'Subject', 'Text', 'Status', 'Error', 'Sent'],
46
+ { layout: 'vertical', padStart: ' ' }
47
+ );
48
+ }
49
+
50
+ return outbound;
51
+ },
52
+ });
53
+
54
+ export default getSubcommand;
@@ -0,0 +1,13 @@
1
+ import { createCommand } from '../../../../types';
2
+ import { listSubcommand } from './list';
3
+ import { getSubcommand } from './get';
4
+
5
+ export const outboundCommand = createCommand({
6
+ name: 'outbound',
7
+ description: 'Manage outbound (sent) emails',
8
+ tags: ['requires-auth'],
9
+ requires: { auth: true },
10
+ subcommands: [listSubcommand, getSubcommand],
11
+ });
12
+
13
+ export default outboundCommand;