@agentuity/cli 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/dist/cache/index.d.ts +1 -0
  2. package/dist/cache/index.d.ts.map +1 -1
  3. package/dist/cache/index.js +1 -0
  4. package/dist/cache/index.js.map +1 -1
  5. package/dist/cache/user-cache.d.ts +20 -0
  6. package/dist/cache/user-cache.d.ts.map +1 -0
  7. package/dist/cache/user-cache.js +79 -0
  8. package/dist/cache/user-cache.js.map +1 -0
  9. package/dist/cmd/auth/logout.d.ts.map +1 -1
  10. package/dist/cmd/auth/logout.js +3 -1
  11. package/dist/cmd/auth/logout.js.map +1 -1
  12. package/dist/cmd/build/entry-generator.d.ts +4 -0
  13. package/dist/cmd/build/entry-generator.d.ts.map +1 -1
  14. package/dist/cmd/build/entry-generator.js +18 -3
  15. package/dist/cmd/build/entry-generator.js.map +1 -1
  16. package/dist/cmd/build/vite/bun-dev-server.d.ts +1 -0
  17. package/dist/cmd/build/vite/bun-dev-server.d.ts.map +1 -1
  18. package/dist/cmd/build/vite/bun-dev-server.js +11 -9
  19. package/dist/cmd/build/vite/bun-dev-server.js.map +1 -1
  20. package/dist/cmd/cloud/db/index.d.ts.map +1 -1
  21. package/dist/cmd/cloud/db/index.js +2 -0
  22. package/dist/cmd/cloud/db/index.js.map +1 -1
  23. package/dist/cmd/cloud/db/stats.d.ts +3 -0
  24. package/dist/cmd/cloud/db/stats.d.ts.map +1 -0
  25. package/dist/cmd/cloud/db/stats.js +66 -0
  26. package/dist/cmd/cloud/db/stats.js.map +1 -0
  27. package/dist/cmd/cloud/email/create.d.ts.map +1 -1
  28. package/dist/cmd/cloud/email/create.js +15 -10
  29. package/dist/cmd/cloud/email/create.js.map +1 -1
  30. package/dist/cmd/cloud/email/delete.js +1 -1
  31. package/dist/cmd/cloud/email/delete.js.map +1 -1
  32. package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -1
  33. package/dist/cmd/cloud/email/destination/delete.js +6 -2
  34. package/dist/cmd/cloud/email/destination/delete.js.map +1 -1
  35. package/dist/cmd/cloud/email/destination/list.js +1 -1
  36. package/dist/cmd/cloud/email/destination/list.js.map +1 -1
  37. package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -1
  38. package/dist/cmd/cloud/email/destination/url.js +5 -4
  39. package/dist/cmd/cloud/email/destination/url.js.map +1 -1
  40. package/dist/cmd/cloud/email/get.d.ts.map +1 -1
  41. package/dist/cmd/cloud/email/get.js +2 -4
  42. package/dist/cmd/cloud/email/get.js.map +1 -1
  43. package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -1
  44. package/dist/cmd/cloud/email/inbound/get.js +2 -3
  45. package/dist/cmd/cloud/email/inbound/get.js.map +1 -1
  46. package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -1
  47. package/dist/cmd/cloud/email/inbound/list.js +1 -3
  48. package/dist/cmd/cloud/email/inbound/list.js.map +1 -1
  49. package/dist/cmd/cloud/email/inbound/schemas.d.ts +3 -1
  50. package/dist/cmd/cloud/email/inbound/schemas.d.ts.map +1 -1
  51. package/dist/cmd/cloud/email/inbound/schemas.js +3 -1
  52. package/dist/cmd/cloud/email/inbound/schemas.js.map +1 -1
  53. package/dist/cmd/cloud/email/index.d.ts.map +1 -1
  54. package/dist/cmd/cloud/email/index.js +2 -0
  55. package/dist/cmd/cloud/email/index.js.map +1 -1
  56. package/dist/cmd/cloud/email/list.d.ts.map +1 -1
  57. package/dist/cmd/cloud/email/list.js +9 -2
  58. package/dist/cmd/cloud/email/list.js.map +1 -1
  59. package/dist/cmd/cloud/email/outbound/get.js +4 -4
  60. package/dist/cmd/cloud/email/outbound/get.js.map +1 -1
  61. package/dist/cmd/cloud/email/outbound/list.js +3 -3
  62. package/dist/cmd/cloud/email/outbound/list.js.map +1 -1
  63. package/dist/cmd/cloud/email/outbound/schemas.d.ts +2 -2
  64. package/dist/cmd/cloud/email/outbound/schemas.js +2 -2
  65. package/dist/cmd/cloud/email/outbound/schemas.js.map +1 -1
  66. package/dist/cmd/cloud/email/send.d.ts.map +1 -1
  67. package/dist/cmd/cloud/email/send.js +9 -15
  68. package/dist/cmd/cloud/email/send.js.map +1 -1
  69. package/dist/cmd/cloud/email/stats.d.ts +3 -0
  70. package/dist/cmd/cloud/email/stats.d.ts.map +1 -0
  71. package/dist/cmd/cloud/email/stats.js +65 -0
  72. package/dist/cmd/cloud/email/stats.js.map +1 -0
  73. package/dist/cmd/cloud/email/util.d.ts +4 -7
  74. package/dist/cmd/cloud/email/util.d.ts.map +1 -1
  75. package/dist/cmd/cloud/email/util.js +8 -24
  76. package/dist/cmd/cloud/email/util.js.map +1 -1
  77. package/dist/cmd/cloud/index.d.ts.map +1 -1
  78. package/dist/cmd/cloud/index.js +2 -0
  79. package/dist/cmd/cloud/index.js.map +1 -1
  80. package/dist/cmd/cloud/queue/get.js +4 -4
  81. package/dist/cmd/cloud/queue/get.js.map +1 -1
  82. package/dist/cmd/cloud/queue/receive.d.ts.map +1 -1
  83. package/dist/cmd/cloud/queue/receive.js +11 -7
  84. package/dist/cmd/cloud/queue/receive.js.map +1 -1
  85. package/dist/cmd/cloud/queue/stats.js +3 -3
  86. package/dist/cmd/cloud/queue/stats.js.map +1 -1
  87. package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts +3 -0
  88. package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts.map +1 -0
  89. package/dist/cmd/cloud/sandbox/checkpoint/create.js +71 -0
  90. package/dist/cmd/cloud/sandbox/checkpoint/create.js.map +1 -0
  91. package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts +3 -0
  92. package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts.map +1 -0
  93. package/dist/cmd/cloud/sandbox/checkpoint/delete.js +78 -0
  94. package/dist/cmd/cloud/sandbox/checkpoint/delete.js.map +1 -0
  95. package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts +2 -0
  96. package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts.map +1 -0
  97. package/dist/cmd/cloud/sandbox/checkpoint/index.js +33 -0
  98. package/dist/cmd/cloud/sandbox/checkpoint/index.js.map +1 -0
  99. package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts +3 -0
  100. package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts.map +1 -0
  101. package/dist/cmd/cloud/sandbox/checkpoint/list.js +72 -0
  102. package/dist/cmd/cloud/sandbox/checkpoint/list.js.map +1 -0
  103. package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts +3 -0
  104. package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts.map +1 -0
  105. package/dist/cmd/cloud/sandbox/checkpoint/restore.js +61 -0
  106. package/dist/cmd/cloud/sandbox/checkpoint/restore.js.map +1 -0
  107. package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
  108. package/dist/cmd/cloud/sandbox/get.js +5 -3
  109. package/dist/cmd/cloud/sandbox/get.js.map +1 -1
  110. package/dist/cmd/cloud/sandbox/index.d.ts.map +1 -1
  111. package/dist/cmd/cloud/sandbox/index.js +4 -0
  112. package/dist/cmd/cloud/sandbox/index.js.map +1 -1
  113. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
  114. package/dist/cmd/cloud/sandbox/snapshot/build.js +13 -10
  115. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  116. package/dist/cmd/cloud/sandbox/snapshot/get.js +3 -3
  117. package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
  118. package/dist/cmd/cloud/sandbox/stats.d.ts +3 -0
  119. package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -0
  120. package/dist/cmd/cloud/sandbox/stats.js +72 -0
  121. package/dist/cmd/cloud/sandbox/stats.js.map +1 -0
  122. package/dist/cmd/cloud/schedule/create.d.ts.map +1 -1
  123. package/dist/cmd/cloud/schedule/create.js +3 -4
  124. package/dist/cmd/cloud/schedule/create.js.map +1 -1
  125. package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -1
  126. package/dist/cmd/cloud/schedule/delete.js +6 -4
  127. package/dist/cmd/cloud/schedule/delete.js.map +1 -1
  128. package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -1
  129. package/dist/cmd/cloud/schedule/delivery/get.js +3 -4
  130. package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -1
  131. package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -1
  132. package/dist/cmd/cloud/schedule/delivery/list.js +2 -3
  133. package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -1
  134. package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -1
  135. package/dist/cmd/cloud/schedule/destination/create.js +10 -5
  136. package/dist/cmd/cloud/schedule/destination/create.js.map +1 -1
  137. package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -1
  138. package/dist/cmd/cloud/schedule/destination/delete.js +2 -3
  139. package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -1
  140. package/dist/cmd/cloud/schedule/destination/get.js +15 -13
  141. package/dist/cmd/cloud/schedule/destination/get.js.map +1 -1
  142. package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -1
  143. package/dist/cmd/cloud/schedule/destination/index.js.map +1 -1
  144. package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -1
  145. package/dist/cmd/cloud/schedule/destination/list.js +13 -9
  146. package/dist/cmd/cloud/schedule/destination/list.js.map +1 -1
  147. package/dist/cmd/cloud/schedule/get.d.ts.map +1 -1
  148. package/dist/cmd/cloud/schedule/get.js +19 -12
  149. package/dist/cmd/cloud/schedule/get.js.map +1 -1
  150. package/dist/cmd/cloud/schedule/index.d.ts.map +1 -1
  151. package/dist/cmd/cloud/schedule/index.js +6 -1
  152. package/dist/cmd/cloud/schedule/index.js.map +1 -1
  153. package/dist/cmd/cloud/schedule/list.d.ts.map +1 -1
  154. package/dist/cmd/cloud/schedule/list.js +2 -3
  155. package/dist/cmd/cloud/schedule/list.js.map +1 -1
  156. package/dist/cmd/cloud/schedule/stats.d.ts +3 -0
  157. package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -0
  158. package/dist/cmd/cloud/schedule/stats.js +64 -0
  159. package/dist/cmd/cloud/schedule/stats.js.map +1 -0
  160. package/dist/cmd/cloud/schedule/update.js +5 -5
  161. package/dist/cmd/cloud/schedule/update.js.map +1 -1
  162. package/dist/cmd/cloud/schedule/util.d.ts +4 -5
  163. package/dist/cmd/cloud/schedule/util.d.ts.map +1 -1
  164. package/dist/cmd/cloud/schedule/util.js +6 -7
  165. package/dist/cmd/cloud/schedule/util.js.map +1 -1
  166. package/dist/cmd/cloud/services/index.d.ts +3 -0
  167. package/dist/cmd/cloud/services/index.d.ts.map +1 -0
  168. package/dist/cmd/cloud/services/index.js +10 -0
  169. package/dist/cmd/cloud/services/index.js.map +1 -0
  170. package/dist/cmd/cloud/services/stats.d.ts +3 -0
  171. package/dist/cmd/cloud/services/stats.d.ts.map +1 -0
  172. package/dist/cmd/cloud/services/stats.js +153 -0
  173. package/dist/cmd/cloud/services/stats.js.map +1 -0
  174. package/dist/cmd/cloud/stream/index.d.ts.map +1 -1
  175. package/dist/cmd/cloud/stream/index.js +8 -1
  176. package/dist/cmd/cloud/stream/index.js.map +1 -1
  177. package/dist/cmd/cloud/stream/stats.d.ts +3 -0
  178. package/dist/cmd/cloud/stream/stats.d.ts.map +1 -0
  179. package/dist/cmd/cloud/stream/stats.js +64 -0
  180. package/dist/cmd/cloud/stream/stats.js.map +1 -0
  181. package/dist/cmd/cloud/task/attachment.d.ts +2 -0
  182. package/dist/cmd/cloud/task/attachment.d.ts.map +1 -0
  183. package/dist/cmd/cloud/task/attachment.js +393 -0
  184. package/dist/cmd/cloud/task/attachment.js.map +1 -0
  185. package/dist/cmd/cloud/task/create.d.ts.map +1 -1
  186. package/dist/cmd/cloud/task/create.js +125 -5
  187. package/dist/cmd/cloud/task/create.js.map +1 -1
  188. package/dist/cmd/cloud/task/get.d.ts.map +1 -1
  189. package/dist/cmd/cloud/task/get.js +33 -14
  190. package/dist/cmd/cloud/task/get.js.map +1 -1
  191. package/dist/cmd/cloud/task/index.d.ts.map +1 -1
  192. package/dist/cmd/cloud/task/index.js +14 -1
  193. package/dist/cmd/cloud/task/index.js.map +1 -1
  194. package/dist/cmd/cloud/task/list.d.ts.map +1 -1
  195. package/dist/cmd/cloud/task/list.js +32 -17
  196. package/dist/cmd/cloud/task/list.js.map +1 -1
  197. package/dist/cmd/cloud/task/stats.d.ts +3 -0
  198. package/dist/cmd/cloud/task/stats.d.ts.map +1 -0
  199. package/dist/cmd/cloud/task/stats.js +68 -0
  200. package/dist/cmd/cloud/task/stats.js.map +1 -0
  201. package/dist/cmd/cloud/task/update.d.ts.map +1 -1
  202. package/dist/cmd/cloud/task/update.js +0 -1
  203. package/dist/cmd/cloud/task/update.js.map +1 -1
  204. package/dist/cmd/cloud/task/util.d.ts +4 -7
  205. package/dist/cmd/cloud/task/util.d.ts.map +1 -1
  206. package/dist/cmd/cloud/task/util.js +6 -12
  207. package/dist/cmd/cloud/task/util.js.map +1 -1
  208. package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
  209. package/dist/cmd/cloud/vector/get.js +17 -12
  210. package/dist/cmd/cloud/vector/get.js.map +1 -1
  211. package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
  212. package/dist/cmd/cloud/vector/stats.js +10 -7
  213. package/dist/cmd/cloud/vector/stats.js.map +1 -1
  214. package/dist/cmd/cloud/webhook/create.d.ts.map +1 -1
  215. package/dist/cmd/cloud/webhook/create.js +6 -1
  216. package/dist/cmd/cloud/webhook/create.js.map +1 -1
  217. package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -1
  218. package/dist/cmd/cloud/webhook/deliveries.js +12 -3
  219. package/dist/cmd/cloud/webhook/deliveries.js.map +1 -1
  220. package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -1
  221. package/dist/cmd/cloud/webhook/destinations.js +19 -9
  222. package/dist/cmd/cloud/webhook/destinations.js.map +1 -1
  223. package/dist/cmd/cloud/webhook/get.js +2 -2
  224. package/dist/cmd/cloud/webhook/get.js.map +1 -1
  225. package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -1
  226. package/dist/cmd/cloud/webhook/receipts.js +19 -3
  227. package/dist/cmd/cloud/webhook/receipts.js.map +1 -1
  228. package/dist/cmd/dev/index.d.ts.map +1 -1
  229. package/dist/cmd/dev/index.js +80 -34
  230. package/dist/cmd/dev/index.js.map +1 -1
  231. package/dist/tui.d.ts +4 -0
  232. package/dist/tui.d.ts.map +1 -1
  233. package/dist/tui.js +8 -0
  234. package/dist/tui.js.map +1 -1
  235. package/package.json +6 -6
  236. package/src/cache/index.ts +2 -0
  237. package/src/cache/user-cache.ts +93 -0
  238. package/src/cmd/auth/logout.ts +3 -1
  239. package/src/cmd/build/entry-generator.ts +34 -4
  240. package/src/cmd/build/vite/bun-dev-server.ts +21 -9
  241. package/src/cmd/cloud/db/index.ts +2 -0
  242. package/src/cmd/cloud/db/stats.ts +72 -0
  243. package/src/cmd/cloud/email/create.ts +17 -10
  244. package/src/cmd/cloud/email/delete.ts +1 -1
  245. package/src/cmd/cloud/email/destination/delete.ts +6 -2
  246. package/src/cmd/cloud/email/destination/list.ts +1 -1
  247. package/src/cmd/cloud/email/destination/url.ts +5 -4
  248. package/src/cmd/cloud/email/get.ts +2 -4
  249. package/src/cmd/cloud/email/inbound/get.ts +2 -3
  250. package/src/cmd/cloud/email/inbound/list.ts +1 -3
  251. package/src/cmd/cloud/email/inbound/schemas.ts +3 -1
  252. package/src/cmd/cloud/email/index.ts +2 -0
  253. package/src/cmd/cloud/email/list.ts +9 -2
  254. package/src/cmd/cloud/email/outbound/get.ts +4 -4
  255. package/src/cmd/cloud/email/outbound/list.ts +3 -3
  256. package/src/cmd/cloud/email/outbound/schemas.ts +2 -2
  257. package/src/cmd/cloud/email/send.ts +9 -15
  258. package/src/cmd/cloud/email/stats.ts +73 -0
  259. package/src/cmd/cloud/email/util.ts +11 -31
  260. package/src/cmd/cloud/index.ts +2 -0
  261. package/src/cmd/cloud/queue/get.ts +4 -4
  262. package/src/cmd/cloud/queue/receive.ts +15 -7
  263. package/src/cmd/cloud/queue/stats.ts +3 -3
  264. package/src/cmd/cloud/sandbox/checkpoint/create.ts +85 -0
  265. package/src/cmd/cloud/sandbox/checkpoint/delete.ts +93 -0
  266. package/src/cmd/cloud/sandbox/checkpoint/index.ts +33 -0
  267. package/src/cmd/cloud/sandbox/checkpoint/list.ts +83 -0
  268. package/src/cmd/cloud/sandbox/checkpoint/restore.ts +72 -0
  269. package/src/cmd/cloud/sandbox/get.ts +6 -3
  270. package/src/cmd/cloud/sandbox/index.ts +4 -0
  271. package/src/cmd/cloud/sandbox/snapshot/build.ts +34 -15
  272. package/src/cmd/cloud/sandbox/snapshot/get.ts +3 -3
  273. package/src/cmd/cloud/sandbox/stats.ts +82 -0
  274. package/src/cmd/cloud/schedule/create.ts +3 -4
  275. package/src/cmd/cloud/schedule/delete.ts +6 -4
  276. package/src/cmd/cloud/schedule/delivery/get.ts +3 -4
  277. package/src/cmd/cloud/schedule/delivery/list.ts +17 -16
  278. package/src/cmd/cloud/schedule/destination/create.ts +19 -7
  279. package/src/cmd/cloud/schedule/destination/delete.ts +2 -3
  280. package/src/cmd/cloud/schedule/destination/get.ts +17 -17
  281. package/src/cmd/cloud/schedule/destination/index.ts +3 -1
  282. package/src/cmd/cloud/schedule/destination/list.ts +22 -15
  283. package/src/cmd/cloud/schedule/get.ts +30 -20
  284. package/src/cmd/cloud/schedule/index.ts +6 -1
  285. package/src/cmd/cloud/schedule/list.ts +20 -19
  286. package/src/cmd/cloud/schedule/stats.ts +72 -0
  287. package/src/cmd/cloud/schedule/update.ts +5 -5
  288. package/src/cmd/cloud/schedule/util.ts +14 -20
  289. package/src/cmd/cloud/services/index.ts +11 -0
  290. package/src/cmd/cloud/services/stats.ts +199 -0
  291. package/src/cmd/cloud/stream/index.ts +8 -1
  292. package/src/cmd/cloud/stream/stats.ts +70 -0
  293. package/src/cmd/cloud/task/attachment.ts +432 -0
  294. package/src/cmd/cloud/task/create.ts +130 -5
  295. package/src/cmd/cloud/task/get.ts +35 -16
  296. package/src/cmd/cloud/task/index.ts +14 -1
  297. package/src/cmd/cloud/task/list.ts +32 -17
  298. package/src/cmd/cloud/task/stats.ts +74 -0
  299. package/src/cmd/cloud/task/update.ts +0 -1
  300. package/src/cmd/cloud/task/util.ts +14 -28
  301. package/src/cmd/cloud/vector/get.ts +16 -11
  302. package/src/cmd/cloud/vector/stats.ts +10 -8
  303. package/src/cmd/cloud/webhook/create.ts +6 -1
  304. package/src/cmd/cloud/webhook/deliveries.ts +15 -3
  305. package/src/cmd/cloud/webhook/destinations.ts +21 -9
  306. package/src/cmd/cloud/webhook/get.ts +2 -2
  307. package/src/cmd/cloud/webhook/receipts.ts +16 -3
  308. package/src/cmd/dev/index.ts +91 -48
  309. package/src/tui.ts +9 -0
@@ -0,0 +1,93 @@
1
+ import { Database } from 'bun:sqlite';
2
+ import { join } from 'node:path';
3
+ import { mkdirSync } from 'node:fs';
4
+ import { getDefaultConfigDir } from '../config';
5
+
6
+ let db: Database | null = null;
7
+
8
+ /**
9
+ * Get or create the database connection synchronously.
10
+ * Reuses the existing resource.db file for consistency.
11
+ */
12
+ function getDatabase(): Database {
13
+ if (db) return db;
14
+
15
+ const configDir = getDefaultConfigDir();
16
+ mkdirSync(configDir, { recursive: true });
17
+
18
+ db = new Database(join(configDir, 'resource.db'));
19
+ db.run(`
20
+ CREATE TABLE IF NOT EXISTS user_info_cache (
21
+ profile TEXT PRIMARY KEY,
22
+ user_id TEXT NOT NULL,
23
+ first_name TEXT NOT NULL,
24
+ last_name TEXT NOT NULL,
25
+ cached_at INTEGER NOT NULL
26
+ )
27
+ `);
28
+ return db;
29
+ }
30
+
31
+ /**
32
+ * Get cached user info for a profile.
33
+ * Returns null if not found in cache.
34
+ */
35
+ export function getCachedUserInfo(
36
+ profile: string
37
+ ): { userId: string; firstName: string; lastName: string } | null {
38
+ try {
39
+ const row = getDatabase()
40
+ .query<
41
+ { user_id: string; first_name: string; last_name: string },
42
+ [string]
43
+ >('SELECT user_id, first_name, last_name FROM user_info_cache WHERE profile = ?')
44
+ .get(profile);
45
+ if (!row) return null;
46
+ return {
47
+ userId: row.user_id,
48
+ firstName: row.first_name,
49
+ lastName: row.last_name,
50
+ };
51
+ } catch {
52
+ // Non-critical — return null on error
53
+ return null;
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Cache user info for a profile.
59
+ * Upserts the entry so repeated calls are safe.
60
+ */
61
+ export function setCachedUserInfo(
62
+ profile: string,
63
+ userId: string,
64
+ firstName: string,
65
+ lastName: string
66
+ ): void {
67
+ try {
68
+ getDatabase().run(
69
+ `INSERT INTO user_info_cache (profile, user_id, first_name, last_name, cached_at)
70
+ VALUES (?, ?, ?, ?, ?)
71
+ ON CONFLICT(profile) DO UPDATE SET
72
+ user_id = excluded.user_id,
73
+ first_name = excluded.first_name,
74
+ last_name = excluded.last_name,
75
+ cached_at = excluded.cached_at`,
76
+ [profile, userId, firstName, lastName, Date.now()]
77
+ );
78
+ } catch {
79
+ // Non-critical — caching failure shouldn't block CLI
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Clear cached user info for a profile.
85
+ * Called on logout to ensure stale data is removed.
86
+ */
87
+ export function clearCachedUserInfo(profile: string): void {
88
+ try {
89
+ getDatabase().run('DELETE FROM user_info_cache WHERE profile = ?', [profile]);
90
+ } catch {
91
+ // Non-critical — cache cleanup failure shouldn't block logout
92
+ }
93
+ }
@@ -1,5 +1,6 @@
1
1
  import { createSubcommand } from '../../types';
2
- import { clearAuth } from '../../config';
2
+ import { clearAuth, defaultProfileName } from '../../config';
3
+ import { clearCachedUserInfo } from '../../cache';
3
4
  import * as tui from '../../tui';
4
5
  import { getCommand } from '../../command-prefix';
5
6
 
@@ -17,6 +18,7 @@ export const logoutCommand = createSubcommand({
17
18
  async handler(ctx) {
18
19
  const { options } = ctx;
19
20
  await clearAuth();
21
+ clearCachedUserInfo(ctx.config?.name ?? defaultProfileName);
20
22
  if (!options.json) {
21
23
  tui.success('You have been logged out');
22
24
  }
@@ -18,14 +18,27 @@ interface GenerateEntryOptions {
18
18
  workbench?: WorkbenchConfig;
19
19
  analytics?: boolean | AnalyticsConfig;
20
20
  vitePort?: number; // Port of Vite asset server (dev mode only)
21
+ noBundle?: boolean; // Skip bundling — apply runtime patches instead
22
+ /** Pre-discovered routes to avoid redundant route discovery */
23
+ preDiscoveredRoutes?: Awaited<ReturnType<typeof discoverRoutes>>['routeInfoList'];
21
24
  }
22
25
 
23
26
  /**
24
27
  * Generate entry file with clean Vite-native architecture
25
28
  */
26
29
  export async function generateEntryFile(options: GenerateEntryOptions): Promise<void> {
27
- const { rootDir, projectId, deploymentId, logger, mode, workbench, analytics, vitePort } =
28
- options;
30
+ const {
31
+ rootDir,
32
+ projectId,
33
+ deploymentId,
34
+ logger,
35
+ mode,
36
+ workbench,
37
+ analytics,
38
+ vitePort,
39
+ noBundle,
40
+ preDiscoveredRoutes,
41
+ } = options;
29
42
 
30
43
  const srcDir = join(rootDir, 'src');
31
44
  const generatedDir = join(srcDir, 'generated');
@@ -41,8 +54,10 @@ export async function generateEntryFile(options: GenerateEntryOptions): Promise<
41
54
  await generateWebAnalyticsFile({ rootDir, logger, analytics });
42
55
  }
43
56
 
44
- // Discover routes to determine which files need to be imported
45
- const { routeInfoList } = await discoverRoutes(srcDir, projectId, deploymentId, logger);
57
+ // Use pre-discovered routes if available, otherwise discover them
58
+ const routeInfoList =
59
+ preDiscoveredRoutes ??
60
+ (await discoverRoutes(srcDir, projectId, deploymentId, logger)).routeInfoList;
46
61
 
47
62
  // Check for web and workbench
48
63
  const hasWebFrontend =
@@ -87,6 +102,10 @@ export async function generateEntryFile(options: GenerateEntryOptions): Promise<
87
102
  ` runShutdown,`,
88
103
  ];
89
104
 
105
+ if (noBundle) {
106
+ runtimeImports.push(` applyDevPatches,`);
107
+ }
108
+
90
109
  if (hasWebFrontend) {
91
110
  runtimeImports.push(` mimeTypes,`);
92
111
  }
@@ -610,6 +629,15 @@ if (isDevelopment()) {
610
629
  }
611
630
  `;
612
631
 
632
+ const devPatchesStep = noBundle
633
+ ? `
634
+ // Step 0.1: Apply runtime dev patches (--experimental-no-bundle mode)
635
+ // Replaces build-time Bun.build patches for LLM gateway routing, AI SDK telemetry, and OTel spans
636
+ if (isDevelopment()) {
637
+ await applyDevPatches();
638
+ }
639
+ `
640
+ : '';
613
641
  const code = `// @generated
614
642
  // Auto-generated by Agentuity
615
643
  // DO NOT EDIT - This file is regenerated on every build
@@ -626,6 +654,8 @@ if (isDevelopment()) {
626
654
  await bootstrapRuntimeEnv({ projectDir: import.meta.dir + '/../..' });
627
655
  }
628
656
 
657
+ ${devPatchesStep}
658
+
629
659
  // Step 0.25: load our runtime metadata and cache it
630
660
  loadBuildMetadata();
631
661
 
@@ -19,6 +19,7 @@ export interface BunDevServerOptions {
19
19
  inspect?: boolean; // Enable bun debugger
20
20
  inspectWait?: boolean; // Enable bun debugger and wait for connection
21
21
  inspectBrk?: boolean; // Enable bun debugger with breakpoint at first line
22
+ noBundle?: boolean; // Run src/generated/app.ts directly without bundling
22
23
  }
23
24
 
24
25
  export interface BunDevServerResult {
@@ -39,17 +40,28 @@ export interface BunDevServerResult {
39
40
  * as a subprocess to enable passing the debugger CLI flags.
40
41
  */
41
42
  export async function startBunDevServer(options: BunDevServerOptions): Promise<BunDevServerResult> {
42
- const { rootDir, port = 3500, logger, vitePort, inspect, inspectWait, inspectBrk } = options;
43
+ const {
44
+ rootDir,
45
+ port = 3500,
46
+ logger,
47
+ vitePort,
48
+ inspect,
49
+ inspectWait,
50
+ inspectBrk,
51
+ noBundle,
52
+ } = options;
43
53
 
44
54
  logger.debug('Starting Bun dev server (Vite already running on port %d)...', vitePort);
45
55
 
46
- const appPath = `${rootDir}/.agentuity/app.js`;
56
+ const appPath = noBundle ? `${rootDir}/src/generated/app.ts` : `${rootDir}/.agentuity/app.js`;
47
57
 
48
- // Verify bundle exists before attempting to load
58
+ // Verify entry file exists before attempting to load
49
59
  const appFile = Bun.file(appPath);
50
60
  if (!(await appFile.exists())) {
51
61
  throw new Error(
52
- `Dev bundle not found at ${appPath}. The bundle must be generated before starting the dev server.`
62
+ noBundle
63
+ ? `Generated entry not found at ${appPath}. Run the dev command to generate it.`
64
+ : `Dev bundle not found at ${appPath}. The bundle must be generated before starting the dev server.`
53
65
  );
54
66
  }
55
67
 
@@ -126,11 +138,11 @@ export async function startBunDevServer(options: BunDevServerOptions): Promise<B
126
138
  logger.debug(`Bun dev server started on http://127.0.0.1:${port} with debugger enabled`);
127
139
  logger.debug(`Asset requests (/@vite/*, /src/web/*, etc.) proxied to Vite:${vitePort}`);
128
140
  } else {
129
- // Load the bundled app - this will start Bun.serve() internally
130
- // IMPORTANT: We must import the bundled .agentuity/app.js (NOT src/generated/app.ts)
131
- // because the bundled version has LLM provider patches applied that enable AI Gateway routing.
132
- // Importing the source file directly would bypass these patches.
133
- logger.debug('📦 Loading bundled app (Bun server will start)...');
141
+ // Load the app entry - this will start Bun.serve() internally
142
+ // In bundle mode: imports .agentuity/app.js (with build-time LLM patches)
143
+ // In no-bundle mode: imports src/generated/app.ts directly (with runtime patches)
144
+ logger.debug('Loading app from: %s (noBundle: %s)', appPath, !!noBundle);
145
+ logger.debug('📦 Loading app entry (Bun server will start)...');
134
146
 
135
147
  // Import the generated app with cache-busting query parameter.
136
148
  // Bun's module cache is keyed by the full specifier including query string,
@@ -5,6 +5,7 @@ import { deleteSubcommand } from './delete';
5
5
  import { getSubcommand } from './get';
6
6
  import { logsSubcommand } from './logs';
7
7
  import { sqlSubcommand } from './sql';
8
+ import { statsSubcommand } from './stats';
8
9
  import { getCommand } from '../../../command-prefix';
9
10
 
10
11
  export const dbCommand = createCommand({
@@ -23,5 +24,6 @@ export const dbCommand = createCommand({
23
24
  deleteSubcommand,
24
25
  logsSubcommand,
25
26
  sqlSubcommand,
27
+ statsSubcommand,
26
28
  ],
27
29
  });
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod';
2
+ import { createCommand } from '../../../types';
3
+ import * as tui from '../../../tui';
4
+ import { getGlobalCatalystAPIClient } from '../../../config';
5
+ import { getCommand } from '../../../command-prefix';
6
+ import { getServiceStats, type ServiceStatsData } from '@agentuity/server';
7
+
8
+ function formatNumber(n: number): string {
9
+ if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
10
+ if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
11
+ return String(n);
12
+ }
13
+
14
+ function displayStats(data: ServiceStatsData): void {
15
+ const svc = data.services.database;
16
+ if (!svc) {
17
+ tui.info('No database data found.');
18
+ return;
19
+ }
20
+ tui.header('Database Statistics');
21
+ tui.newline();
22
+ console.log(` ${tui.muted('Databases:')} ${formatNumber(svc.databaseCount)}`);
23
+ console.log(` ${tui.muted('Tables:')} ${formatNumber(svc.totalTableCount)}`);
24
+ console.log(` ${tui.muted('Records:')} ${formatNumber(svc.totalRecordCount)}`);
25
+ console.log(` ${tui.muted('Total Size:')} ${tui.formatBytes(svc.totalSizeBytes)}`);
26
+ }
27
+
28
+ export const statsSubcommand = createCommand({
29
+ name: 'stats',
30
+ description: 'View database statistics',
31
+ tags: ['read-only', 'requires-auth'],
32
+ requires: { auth: true, org: true },
33
+ examples: [
34
+ {
35
+ command: getCommand('cloud db stats'),
36
+ description: 'View database statistics',
37
+ },
38
+ ],
39
+ schema: {
40
+ options: z.object({
41
+ start: z.string().optional().describe('Start time (ISO 8601)'),
42
+ end: z.string().optional().describe('End time (ISO 8601)'),
43
+ }),
44
+ },
45
+ idempotent: true,
46
+
47
+ async handler(ctx) {
48
+ const { opts, options } = ctx;
49
+ const client = await getGlobalCatalystAPIClient(ctx.logger, ctx.auth, ctx.config?.name);
50
+ const orgId = ctx.orgId ?? ctx.options.orgId ?? ctx.config?.preferences?.orgId;
51
+
52
+ if (!orgId) {
53
+ ctx.logger.fatal('Organization ID is required. Use --org-id or set a preferred org.');
54
+ return;
55
+ }
56
+
57
+ const data = await getServiceStats(client, orgId, {
58
+ service: 'database',
59
+ start: opts.start,
60
+ end: opts.end,
61
+ orgIdHeader: orgId,
62
+ });
63
+
64
+ if (!options.json) {
65
+ displayStats(data);
66
+ }
67
+
68
+ return data;
69
+ },
70
+ });
71
+
72
+ export default statsSubcommand;
@@ -3,7 +3,8 @@ import enquirer from 'enquirer';
3
3
  import { createCommand } from '../../../types';
4
4
  import * as tui from '../../../tui';
5
5
  import { setResourceInfo } from '../../../cache';
6
- import { createEmailAdapter, resolveEmailOrgId, resolveEmailRegion, EmailAddressSchema } from './util';
6
+ import { createEmailAdapter, resolveEmailOrgId, EmailAddressSchema } from './util';
7
+ import { defaultProfileName, getDefaultRegion } from '../../../config';
7
8
 
8
9
  export const createSubcommand = createCommand({
9
10
  name: 'create',
@@ -13,10 +14,7 @@ export const createSubcommand = createCommand({
13
14
  requires: { auth: true },
14
15
  schema: {
15
16
  options: z.object({
16
- localPart: z
17
- .string()
18
- .optional()
19
- .describe('Local part for the email address (before @)'),
17
+ localPart: z.string().optional().describe('Local part for the email address (before @)'),
20
18
  }),
21
19
  response: EmailAddressSchema,
22
20
  },
@@ -29,21 +27,30 @@ export const createSubcommand = createCommand({
29
27
  const answer = await enquirer.prompt<{ local_part: string }>({
30
28
  type: 'input',
31
29
  name: 'local_part',
32
- message: 'Local part (username):',
30
+ message: 'Email address or username (e.g. "support" or "support@agentuity.email"):',
33
31
  });
34
32
  localPart = answer.local_part?.trim();
35
33
  }
36
34
 
37
35
  if (!localPart) {
38
- tui.fatal('Local part is required');
36
+ tui.fatal('Email address or username is required');
39
37
  }
40
38
 
41
- const email = createEmailAdapter(ctx);
39
+ // If user entered a full email, extract just the local part
40
+ if (localPart.includes('@')) {
41
+ localPart = localPart.split('@')[0]?.trim() ?? '';
42
+ }
43
+
44
+ if (!localPart) {
45
+ tui.fatal('Email address or username is required');
46
+ }
47
+
48
+ const profileName = config?.name ?? defaultProfileName;
49
+ const region = await getDefaultRegion(profileName, ctx.config);
50
+ const email = await createEmailAdapter(ctx, region);
42
51
  const address = await email.createAddress(localPart);
43
52
 
44
- const profileName = config?.name ?? 'production';
45
53
  const orgId = resolveEmailOrgId(ctx);
46
- const region = resolveEmailRegion(ctx);
47
54
  await setResourceInfo('email', profileName, address.id, region, orgId);
48
55
 
49
56
  if (!options.json) {
@@ -36,7 +36,7 @@ export const deleteSubcommand = createCommand({
36
36
  }
37
37
  }
38
38
 
39
- const email = createEmailAdapter(ctx);
39
+ const email = await createEmailAdapter(ctx);
40
40
  await email.deleteAddress(args.id);
41
41
 
42
42
  if (!options.json) {
@@ -43,11 +43,15 @@ export const deleteSubcommand = createCommand({
43
43
  );
44
44
  if (!ok) {
45
45
  tui.info('Cancelled');
46
- return { success: false, address_id: args.address_id, destination_id: args.destination_id };
46
+ return {
47
+ success: false,
48
+ address_id: args.address_id,
49
+ destination_id: args.destination_id,
50
+ };
47
51
  }
48
52
  }
49
53
 
50
- const email = createEmailAdapter(ctx);
54
+ const email = await createEmailAdapter(ctx);
51
55
  await email.deleteDestination(args.address_id, args.destination_id);
52
56
 
53
57
  if (!options.json) {
@@ -19,7 +19,7 @@ export const listSubcommand = createCommand({
19
19
 
20
20
  async handler(ctx) {
21
21
  const { args, options } = ctx;
22
- const email = createEmailAdapter(ctx);
22
+ const email = await createEmailAdapter(ctx);
23
23
  const destinations = await email.listDestinations(args.address_id);
24
24
 
25
25
  if (!options.json) {
@@ -2,7 +2,8 @@ import { z } from 'zod';
2
2
  import { createCommand } from '../../../../types';
3
3
  import * as tui from '../../../../tui';
4
4
  import { setResourceInfo } from '../../../../cache';
5
- import { createEmailAdapter, resolveEmailOrgId, resolveEmailRegion } from '../util';
5
+ import { createEmailAdapter, resolveEmailOrgId } from '../util';
6
+ import { defaultProfileName, getDefaultRegion } from '../../../../config';
6
7
  import { DestinationSchema } from './schemas';
7
8
 
8
9
  export const urlSubcommand = createCommand({
@@ -41,12 +42,12 @@ export const urlSubcommand = createCommand({
41
42
  destinationConfig.method = opts.method;
42
43
  }
43
44
 
44
- const email = createEmailAdapter(ctx);
45
+ const profileName = config?.name ?? defaultProfileName;
46
+ const region = await getDefaultRegion(profileName, ctx.config);
47
+ const email = await createEmailAdapter(ctx, region);
45
48
  const destination = await email.createDestination(args.address_id, 'url', destinationConfig);
46
49
 
47
- const profileName = config?.name ?? 'production';
48
50
  const orgId = resolveEmailOrgId(ctx);
49
- const region = resolveEmailRegion(ctx);
50
51
  setResourceInfo('email', profileName, destination.id, region, orgId).catch(() => {
51
52
  // Non-blocking: destination was already created successfully
52
53
  });
@@ -17,7 +17,7 @@ export const getSubcommand = createCommand({
17
17
 
18
18
  async handler(ctx) {
19
19
  const { args, options } = ctx;
20
- const email = createEmailAdapter(ctx);
20
+ const email = await createEmailAdapter(ctx);
21
21
  const address = await email.getAddress(args.id);
22
22
 
23
23
  if (!address) {
@@ -35,9 +35,7 @@ export const getSubcommand = createCommand({
35
35
  Provider: address.provider ?? '-',
36
36
  Config: address.config ? JSON.stringify(address.config) : '-',
37
37
  Created: new Date(address.created_at).toLocaleString(),
38
- Updated: address.updated_at
39
- ? new Date(address.updated_at).toLocaleString()
40
- : '-',
38
+ Updated: address.updated_at ? new Date(address.updated_at).toLocaleString() : '-',
41
39
  },
42
40
  ],
43
41
  ['ID', 'Email', 'Project', 'Provider', 'Config', 'Created', 'Updated'],
@@ -18,7 +18,7 @@ export const getSubcommand = createCommand({
18
18
 
19
19
  async handler(ctx) {
20
20
  const { args, options } = ctx;
21
- const email = createEmailAdapter(ctx);
21
+ const email = await createEmailAdapter(ctx);
22
22
  const inbound = await email.getInbound(args.id);
23
23
 
24
24
  if (!inbound) {
@@ -35,13 +35,12 @@ export const getSubcommand = createCommand({
35
35
  To: inbound.to,
36
36
  Subject: inbound.subject ?? '-',
37
37
  Text: truncate(inbound.text),
38
- Status: inbound.status ?? '-',
39
38
  Received: inbound.received_at
40
39
  ? new Date(inbound.received_at).toLocaleString()
41
40
  : '-',
42
41
  },
43
42
  ],
44
- ['ID', 'From', 'To', 'Subject', 'Text', 'Status', 'Received'],
43
+ ['ID', 'From', 'To', 'Subject', 'Text', 'Received'],
45
44
  { layout: 'vertical', padStart: ' ' }
46
45
  );
47
46
  }
@@ -19,7 +19,7 @@ export const listSubcommand = createCommand({
19
19
 
20
20
  async handler(ctx) {
21
21
  const { opts, options } = ctx;
22
- const email = createEmailAdapter(ctx);
22
+ const email = await createEmailAdapter(ctx);
23
23
  const inbound = await email.listInbound(opts.addressId);
24
24
 
25
25
  if (!options.json) {
@@ -29,7 +29,6 @@ export const listSubcommand = createCommand({
29
29
  From: item.from,
30
30
  To: item.to,
31
31
  Subject: item.subject ?? '-',
32
- Status: item.status ?? '-',
33
32
  Received: item.received_at ? new Date(item.received_at).toLocaleString() : '-',
34
33
  })),
35
34
  [
@@ -37,7 +36,6 @@ export const listSubcommand = createCommand({
37
36
  { name: 'From', alignment: 'left' },
38
37
  { name: 'To', alignment: 'left' },
39
38
  { name: 'Subject', alignment: 'left' },
40
- { name: 'Status', alignment: 'left' },
41
39
  { name: 'Received', alignment: 'left' },
42
40
  ]
43
41
  );
@@ -6,6 +6,8 @@ export const EmailInboundSchema = z.object({
6
6
  to: z.string(),
7
7
  subject: z.string().optional(),
8
8
  text: z.string().optional(),
9
- status: z.string().optional(),
9
+ html: z.string().optional(),
10
10
  received_at: z.string().optional(),
11
+ headers: z.record(z.string(), z.unknown()).optional(),
12
+ attachments: z.array(z.unknown()).optional(),
11
13
  });
@@ -7,6 +7,7 @@ import { destinationCommand } from './destination';
7
7
  import { sendSubcommand } from './send';
8
8
  import { inboundCommand } from './inbound';
9
9
  import { outboundCommand } from './outbound';
10
+ import { statsSubcommand } from './stats';
10
11
 
11
12
  export const emailCommand = createCommand({
12
13
  name: 'email',
@@ -22,6 +23,7 @@ export const emailCommand = createCommand({
22
23
  sendSubcommand,
23
24
  inboundCommand,
24
25
  outboundCommand,
26
+ statsSubcommand,
25
27
  ],
26
28
  requires: { auth: true },
27
29
  });
@@ -15,7 +15,7 @@ export const listSubcommand = createCommand({
15
15
 
16
16
  async handler(ctx) {
17
17
  const { options } = ctx;
18
- const email = createEmailAdapter(ctx);
18
+ const email = await createEmailAdapter(ctx);
19
19
  const addresses = await email.listAddresses();
20
20
 
21
21
  if (!options.json) {
@@ -37,7 +37,14 @@ export const listSubcommand = createCommand({
37
37
  );
38
38
  }
39
39
 
40
- return addresses;
40
+ return addresses.map((item) => ({
41
+ id: item.id,
42
+ email: item.email,
43
+ project_id: item.project_id,
44
+ provider: item.provider,
45
+ created_at: item.created_at,
46
+ updated_at: item.updated_at,
47
+ }));
41
48
  },
42
49
  });
43
50
 
@@ -18,7 +18,7 @@ export const getSubcommand = createCommand({
18
18
 
19
19
  async handler(ctx) {
20
20
  const { args, options } = ctx;
21
- const email = createEmailAdapter(ctx);
21
+ const email = await createEmailAdapter(ctx);
22
22
  const outbound = await email.getOutbound(args.id);
23
23
 
24
24
  if (!outbound) {
@@ -37,12 +37,12 @@ export const getSubcommand = createCommand({
37
37
  Text: truncate(outbound.text),
38
38
  Status: outbound.status ?? '-',
39
39
  Error: outbound.error ?? '-',
40
- Sent: outbound.sent_at
41
- ? new Date(outbound.sent_at).toLocaleString()
40
+ Created: outbound.created_at
41
+ ? new Date(outbound.created_at).toLocaleString()
42
42
  : '-',
43
43
  },
44
44
  ],
45
- ['ID', 'From', 'To', 'Subject', 'Text', 'Status', 'Error', 'Sent'],
45
+ ['ID', 'From', 'To', 'Subject', 'Text', 'Status', 'Error', 'Created'],
46
46
  { layout: 'vertical', padStart: ' ' }
47
47
  );
48
48
  }
@@ -19,7 +19,7 @@ export const listSubcommand = createCommand({
19
19
 
20
20
  async handler(ctx) {
21
21
  const { opts, options } = ctx;
22
- const email = createEmailAdapter(ctx);
22
+ const email = await createEmailAdapter(ctx);
23
23
  const outbound = await email.listOutbound(opts.addressId);
24
24
 
25
25
  if (!options.json) {
@@ -30,7 +30,7 @@ export const listSubcommand = createCommand({
30
30
  To: item.to,
31
31
  Subject: item.subject ?? '-',
32
32
  Status: item.status ?? '-',
33
- Sent: item.sent_at ? new Date(item.sent_at).toLocaleString() : '-',
33
+ Created: item.created_at ? new Date(item.created_at).toLocaleString() : '-',
34
34
  })),
35
35
  [
36
36
  { name: 'ID', alignment: 'left' },
@@ -38,7 +38,7 @@ export const listSubcommand = createCommand({
38
38
  { name: 'To', alignment: 'left' },
39
39
  { name: 'Subject', alignment: 'left' },
40
40
  { name: 'Status', alignment: 'left' },
41
- { name: 'Sent', alignment: 'left' },
41
+ { name: 'Created', alignment: 'left' },
42
42
  ]
43
43
  );
44
44
  }
@@ -9,7 +9,7 @@ export const EmailOutboundSchema = z.object({
9
9
  html: z.string().optional(),
10
10
  status: z.string().optional(),
11
11
  error: z.string().optional(),
12
- sent_at: z.string().optional(),
13
12
  created_at: z.string().optional(),
14
- updated_at: z.string().optional(),
13
+ headers: z.record(z.string(), z.unknown()).optional(),
14
+ attachments: z.array(z.unknown()).optional(),
15
15
  });