alepha 0.22.0 → 0.24.0

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 (869) hide show
  1. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  2. package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
  3. package/dist/api/audits/index.browser.js +49 -52
  4. package/dist/api/audits/index.browser.js.map +1 -1
  5. package/dist/api/audits/index.d.ts +629 -565
  6. package/dist/api/audits/index.d.ts.map +1 -1
  7. package/dist/api/audits/index.js +206 -98
  8. package/dist/api/audits/index.js.map +1 -1
  9. package/dist/api/files/index.browser.js +44 -44
  10. package/dist/api/files/index.browser.js.map +1 -1
  11. package/dist/api/files/index.d.ts +292 -293
  12. package/dist/api/files/index.d.ts.map +1 -1
  13. package/dist/api/files/index.js +61 -64
  14. package/dist/api/files/index.js.map +1 -1
  15. package/dist/api/jobs/index.browser.js +61 -59
  16. package/dist/api/jobs/index.browser.js.map +1 -1
  17. package/dist/api/jobs/index.d.ts +546 -347
  18. package/dist/api/jobs/index.d.ts.map +1 -1
  19. package/dist/api/jobs/index.js +165 -86
  20. package/dist/api/jobs/index.js.map +1 -1
  21. package/dist/api/keys/index.d.ts +242 -230
  22. package/dist/api/keys/index.d.ts.map +1 -1
  23. package/dist/api/keys/index.js +63 -66
  24. package/dist/api/keys/index.js.map +1 -1
  25. package/dist/api/notifications/index.browser.js +40 -38
  26. package/dist/api/notifications/index.browser.js.map +1 -1
  27. package/dist/api/notifications/index.d.ts +339 -209
  28. package/dist/api/notifications/index.d.ts.map +1 -1
  29. package/dist/api/notifications/index.js +108 -60
  30. package/dist/api/notifications/index.js.map +1 -1
  31. package/dist/api/oauth/index.d.ts +190 -78
  32. package/dist/api/oauth/index.d.ts.map +1 -1
  33. package/dist/api/oauth/index.js +290 -68
  34. package/dist/api/oauth/index.js.map +1 -1
  35. package/dist/api/organizations/index.browser.js +14 -14
  36. package/dist/api/organizations/index.browser.js.map +1 -1
  37. package/dist/api/organizations/index.d.ts +158 -134
  38. package/dist/api/organizations/index.d.ts.map +1 -1
  39. package/dist/api/organizations/index.js +18 -18
  40. package/dist/api/organizations/index.js.map +1 -1
  41. package/dist/api/parameters/index.browser.js +74 -53
  42. package/dist/api/parameters/index.browser.js.map +1 -1
  43. package/dist/api/parameters/index.d.ts +607 -513
  44. package/dist/api/parameters/index.d.ts.map +1 -1
  45. package/dist/api/parameters/index.js +205 -127
  46. package/dist/api/parameters/index.js.map +1 -1
  47. package/dist/api/payments/index.d.ts +652 -449
  48. package/dist/api/payments/index.d.ts.map +1 -1
  49. package/dist/api/payments/index.js +159 -93
  50. package/dist/api/payments/index.js.map +1 -1
  51. package/dist/api/subscriptions/index.d.ts +1032 -762
  52. package/dist/api/subscriptions/index.d.ts.map +1 -1
  53. package/dist/api/subscriptions/index.js +166 -185
  54. package/dist/api/subscriptions/index.js.map +1 -1
  55. package/dist/api/users/index.browser.js +48 -71
  56. package/dist/api/users/index.browser.js.map +1 -1
  57. package/dist/api/users/index.d.ts +1297 -1109
  58. package/dist/api/users/index.d.ts.map +1 -1
  59. package/dist/api/users/index.js +454 -369
  60. package/dist/api/users/index.js.map +1 -1
  61. package/dist/api/verifications/index.browser.js +17 -17
  62. package/dist/api/verifications/index.browser.js.map +1 -1
  63. package/dist/api/verifications/index.d.ts +169 -157
  64. package/dist/api/verifications/index.d.ts.map +1 -1
  65. package/dist/api/verifications/index.js +47 -95
  66. package/dist/api/verifications/index.js.map +1 -1
  67. package/dist/background/index.d.ts +0 -1
  68. package/dist/background/index.d.ts.map +1 -1
  69. package/dist/background/index.js.map +1 -1
  70. package/dist/background/index.workerd.js.map +1 -1
  71. package/dist/batch/index.d.ts +0 -1
  72. package/dist/batch/index.d.ts.map +1 -1
  73. package/dist/batch/index.js.map +1 -1
  74. package/dist/bin/index.js +1 -1
  75. package/dist/bin/index.js.map +1 -1
  76. package/dist/bucket/index.d.ts +27 -32
  77. package/dist/bucket/index.d.ts.map +1 -1
  78. package/dist/bucket/index.js +56 -26
  79. package/dist/bucket/index.js.map +1 -1
  80. package/dist/bucket/index.workerd.js +52 -24
  81. package/dist/bucket/index.workerd.js.map +1 -1
  82. package/dist/cache/core/index.d.ts +4 -6
  83. package/dist/cache/core/index.d.ts.map +1 -1
  84. package/dist/cache/core/index.js +4 -10
  85. package/dist/cache/core/index.js.map +1 -1
  86. package/dist/cache/core/index.workerd.js +4 -10
  87. package/dist/cache/core/index.workerd.js.map +1 -1
  88. package/dist/cache/database/index.d.ts +22 -23
  89. package/dist/cache/database/index.d.ts.map +1 -1
  90. package/dist/cache/database/index.js +11 -20
  91. package/dist/cache/database/index.js.map +1 -1
  92. package/dist/cache/redis/index.d.ts +3 -4
  93. package/dist/cache/redis/index.d.ts.map +1 -1
  94. package/dist/cache/redis/index.js +2 -2
  95. package/dist/cache/redis/index.js.map +1 -1
  96. package/dist/captcha/index.d.ts.map +1 -1
  97. package/dist/captcha/index.js +4 -4
  98. package/dist/captcha/index.js.map +1 -1
  99. package/dist/cli/config/index.d.ts +0 -1
  100. package/dist/cli/config/index.d.ts.map +1 -1
  101. package/dist/cli/core/index.d.ts +244 -475
  102. package/dist/cli/core/index.d.ts.map +1 -1
  103. package/dist/cli/core/index.js +308 -383
  104. package/dist/cli/core/index.js.map +1 -1
  105. package/dist/cli/devtools/index.d.ts +3 -9
  106. package/dist/cli/devtools/index.d.ts.map +1 -1
  107. package/dist/cli/devtools/index.js +3 -3
  108. package/dist/cli/devtools/index.js.map +1 -1
  109. package/dist/cli/i18n/index.d.ts +20 -39
  110. package/dist/cli/i18n/index.d.ts.map +1 -1
  111. package/dist/cli/i18n/index.js +51 -17
  112. package/dist/cli/i18n/index.js.map +1 -1
  113. package/dist/cli/platform/index.d.ts +89 -82
  114. package/dist/cli/platform/index.d.ts.map +1 -1
  115. package/dist/cli/platform/index.js +27 -33
  116. package/dist/cli/platform/index.js.map +1 -1
  117. package/dist/cli/platform-lib/index.d.ts +383 -410
  118. package/dist/cli/platform-lib/index.d.ts.map +1 -1
  119. package/dist/cli/platform-lib/index.js +300 -258
  120. package/dist/cli/platform-lib/index.js.map +1 -1
  121. package/dist/cli/vendor/index.d.ts +17 -41
  122. package/dist/cli/vendor/index.d.ts.map +1 -1
  123. package/dist/cli/vendor/index.js +10 -13
  124. package/dist/cli/vendor/index.js.map +1 -1
  125. package/dist/command/index.d.ts +82 -194
  126. package/dist/command/index.d.ts.map +1 -1
  127. package/dist/command/index.js +160 -563
  128. package/dist/command/index.js.map +1 -1
  129. package/dist/core/index.browser.js +845 -859
  130. package/dist/core/index.browser.js.map +1 -1
  131. package/dist/core/index.d.ts +787 -527
  132. package/dist/core/index.d.ts.map +1 -1
  133. package/dist/core/index.js +845 -859
  134. package/dist/core/index.js.map +1 -1
  135. package/dist/core/index.native.js +845 -859
  136. package/dist/core/index.native.js.map +1 -1
  137. package/dist/core/index.workerd.js +845 -859
  138. package/dist/core/index.workerd.js.map +1 -1
  139. package/dist/crypto/index.browser.js +1 -1
  140. package/dist/crypto/index.browser.js.map +1 -1
  141. package/dist/crypto/index.d.ts +3 -4
  142. package/dist/crypto/index.d.ts.map +1 -1
  143. package/dist/crypto/index.js +6 -3
  144. package/dist/crypto/index.js.map +1 -1
  145. package/dist/datetime/index.d.ts +12 -2
  146. package/dist/datetime/index.d.ts.map +1 -1
  147. package/dist/datetime/index.js +6 -1
  148. package/dist/datetime/index.js.map +1 -1
  149. package/dist/email/brevo/index.d.ts +0 -1
  150. package/dist/email/brevo/index.d.ts.map +1 -1
  151. package/dist/email/brevo/index.js +4 -4
  152. package/dist/email/brevo/index.js.map +1 -1
  153. package/dist/email/cloudflare/index.d.ts +0 -1
  154. package/dist/email/cloudflare/index.d.ts.map +1 -1
  155. package/dist/email/cloudflare/index.js +2 -2
  156. package/dist/email/cloudflare/index.js.map +1 -1
  157. package/dist/email/core/index.d.ts +15 -7
  158. package/dist/email/core/index.d.ts.map +1 -1
  159. package/dist/email/core/index.js +14 -5
  160. package/dist/email/core/index.js.map +1 -1
  161. package/dist/email/core/index.workerd.js +5 -1
  162. package/dist/email/core/index.workerd.js.map +1 -1
  163. package/dist/email/smtp/index.d.ts +8 -9
  164. package/dist/email/smtp/index.d.ts.map +1 -1
  165. package/dist/email/smtp/index.js +702 -479
  166. package/dist/email/smtp/index.js.map +1 -1
  167. package/dist/fake/index.d.ts +1580 -1238
  168. package/dist/fake/index.d.ts.map +1 -1
  169. package/dist/fake/index.js +11728 -32131
  170. package/dist/fake/index.js.map +1 -1
  171. package/dist/lock/core/index.d.ts +13 -9
  172. package/dist/lock/core/index.d.ts.map +1 -1
  173. package/dist/lock/core/index.js +5 -5
  174. package/dist/lock/core/index.js.map +1 -1
  175. package/dist/lock/redis/index.d.ts +0 -1
  176. package/dist/lock/redis/index.d.ts.map +1 -1
  177. package/dist/lock/redis/index.js.map +1 -1
  178. package/dist/logger/index.d.ts +81 -69
  179. package/dist/logger/index.d.ts.map +1 -1
  180. package/dist/logger/index.js +123 -56
  181. package/dist/logger/index.js.map +1 -1
  182. package/dist/mcp/index.d.ts +36 -90
  183. package/dist/mcp/index.d.ts.map +1 -1
  184. package/dist/mcp/index.js +65 -70
  185. package/dist/mcp/index.js.map +1 -1
  186. package/dist/orm/core/index.browser.js +54 -40
  187. package/dist/orm/core/index.browser.js.map +1 -1
  188. package/dist/orm/core/index.bun.js +140 -106
  189. package/dist/orm/core/index.bun.js.map +1 -1
  190. package/dist/orm/core/index.d.ts +145 -150
  191. package/dist/orm/core/index.d.ts.map +1 -1
  192. package/dist/orm/core/index.js +144 -109
  193. package/dist/orm/core/index.js.map +1 -1
  194. package/dist/orm/postgres/index.bun.js +64 -54
  195. package/dist/orm/postgres/index.bun.js.map +1 -1
  196. package/dist/orm/postgres/index.d.ts +36 -76
  197. package/dist/orm/postgres/index.d.ts.map +1 -1
  198. package/dist/orm/postgres/index.js +67 -57
  199. package/dist/orm/postgres/index.js.map +1 -1
  200. package/dist/queue/core/index.d.ts +62 -75
  201. package/dist/queue/core/index.d.ts.map +1 -1
  202. package/dist/queue/core/index.js +48 -71
  203. package/dist/queue/core/index.js.map +1 -1
  204. package/dist/queue/core/index.workerd.js +48 -71
  205. package/dist/queue/core/index.workerd.js.map +1 -1
  206. package/dist/queue/redis/index.d.ts +3 -4
  207. package/dist/queue/redis/index.d.ts.map +1 -1
  208. package/dist/queue/redis/index.js +2 -2
  209. package/dist/queue/redis/index.js.map +1 -1
  210. package/dist/react/auth/index.browser.js.map +1 -1
  211. package/dist/react/auth/index.d.ts +7 -4
  212. package/dist/react/auth/index.d.ts.map +1 -1
  213. package/dist/react/auth/index.js.map +1 -1
  214. package/dist/react/core/index.d.ts +87 -5
  215. package/dist/react/core/index.d.ts.map +1 -1
  216. package/dist/react/core/index.js +170 -23
  217. package/dist/react/core/index.js.map +1 -1
  218. package/dist/react/form/index.d.ts +4 -6
  219. package/dist/react/form/index.d.ts.map +1 -1
  220. package/dist/react/form/index.js +107 -71
  221. package/dist/react/form/index.js.map +1 -1
  222. package/dist/react/head/index.browser.js.map +1 -1
  223. package/dist/react/head/index.d.ts +0 -1
  224. package/dist/react/head/index.d.ts.map +1 -1
  225. package/dist/react/head/index.js.map +1 -1
  226. package/dist/react/i18n/index.d.ts +47 -5
  227. package/dist/react/i18n/index.d.ts.map +1 -1
  228. package/dist/react/i18n/index.js +116 -12
  229. package/dist/react/i18n/index.js.map +1 -1
  230. package/dist/react/intro/index.d.ts +1 -4
  231. package/dist/react/intro/index.d.ts.map +1 -1
  232. package/dist/react/intro/index.js.map +1 -1
  233. package/dist/react/router/index.browser.js +188 -29
  234. package/dist/react/router/index.browser.js.map +1 -1
  235. package/dist/react/router/index.d.ts +480 -372
  236. package/dist/react/router/index.d.ts.map +1 -1
  237. package/dist/react/router/index.js +261 -47
  238. package/dist/react/router/index.js.map +1 -1
  239. package/dist/react/sitemap/index.browser.js +35 -0
  240. package/dist/react/sitemap/index.browser.js.map +1 -0
  241. package/dist/react/sitemap/index.d.ts +91 -0
  242. package/dist/react/sitemap/index.d.ts.map +1 -0
  243. package/dist/react/sitemap/index.js +131 -0
  244. package/dist/react/sitemap/index.js.map +1 -0
  245. package/dist/react/testing/index.d.ts +4 -5
  246. package/dist/react/testing/index.d.ts.map +1 -1
  247. package/dist/react/testing/index.js +41 -15
  248. package/dist/react/testing/index.js.map +1 -1
  249. package/dist/react/testing/{chunk-BpyX8vjI.js → rolldown-runtime-Bl3dcgcQ.js} +1 -1
  250. package/dist/react/ui/index.d.ts +35 -34
  251. package/dist/react/ui/index.d.ts.map +1 -1
  252. package/dist/react/ui/index.js +12 -17
  253. package/dist/react/ui/index.js.map +1 -1
  254. package/dist/redis/index.bun.js +5 -5
  255. package/dist/redis/index.bun.js.map +1 -1
  256. package/dist/redis/index.d.ts +6 -7
  257. package/dist/redis/index.d.ts.map +1 -1
  258. package/dist/redis/index.js +6 -6
  259. package/dist/redis/index.js.map +1 -1
  260. package/dist/retry/index.d.ts +0 -1
  261. package/dist/retry/index.d.ts.map +1 -1
  262. package/dist/retry/index.js.map +1 -1
  263. package/dist/router/index.d.ts.map +1 -1
  264. package/dist/router/index.js.map +1 -1
  265. package/dist/scheduler/index.d.ts +4 -12
  266. package/dist/scheduler/index.d.ts.map +1 -1
  267. package/dist/scheduler/index.js +9 -4
  268. package/dist/scheduler/index.js.map +1 -1
  269. package/dist/scheduler/index.workerd.js +9 -4
  270. package/dist/scheduler/index.workerd.js.map +1 -1
  271. package/dist/security/index.browser.js +30 -28
  272. package/dist/security/index.browser.js.map +1 -1
  273. package/dist/security/index.d.ts +113 -44
  274. package/dist/security/index.d.ts.map +1 -1
  275. package/dist/security/index.js +452 -37
  276. package/dist/security/index.js.map +1 -1
  277. package/dist/server/auth/index.browser.js +19 -19
  278. package/dist/server/auth/index.browser.js.map +1 -1
  279. package/dist/server/auth/index.d.ts +215 -187
  280. package/dist/server/auth/index.d.ts.map +1 -1
  281. package/dist/server/auth/index.js +1145 -86
  282. package/dist/server/auth/index.js.map +1 -1
  283. package/dist/server/cookies/index.browser.js +103 -5
  284. package/dist/server/cookies/index.browser.js.map +1 -1
  285. package/dist/server/cookies/index.d.ts +86 -4
  286. package/dist/server/cookies/index.d.ts.map +1 -1
  287. package/dist/server/cookies/index.js +121 -8
  288. package/dist/server/cookies/index.js.map +1 -1
  289. package/dist/server/core/index.browser.js +22 -27
  290. package/dist/server/core/index.browser.js.map +1 -1
  291. package/dist/server/core/index.d.ts +134 -85
  292. package/dist/server/core/index.d.ts.map +1 -1
  293. package/dist/server/core/index.js +130 -118
  294. package/dist/server/core/index.js.map +1 -1
  295. package/dist/server/cors/index.d.ts +9 -10
  296. package/dist/server/cors/index.d.ts.map +1 -1
  297. package/dist/server/cors/index.js +14 -26
  298. package/dist/server/cors/index.js.map +1 -1
  299. package/dist/server/etag/index.d.ts +2 -3
  300. package/dist/server/etag/index.d.ts.map +1 -1
  301. package/dist/server/etag/index.js.map +1 -1
  302. package/dist/server/health/index.d.ts +18 -19
  303. package/dist/server/health/index.d.ts.map +1 -1
  304. package/dist/server/health/index.js +6 -6
  305. package/dist/server/health/index.js.map +1 -1
  306. package/dist/server/links/index.browser.js +15 -18
  307. package/dist/server/links/index.browser.js.map +1 -1
  308. package/dist/server/links/index.d.ts +66 -67
  309. package/dist/server/links/index.d.ts.map +1 -1
  310. package/dist/server/links/index.js +29 -32
  311. package/dist/server/links/index.js.map +1 -1
  312. package/dist/server/metrics/index.d.ts +0 -1
  313. package/dist/server/metrics/index.d.ts.map +1 -1
  314. package/dist/server/metrics/index.js +10 -3
  315. package/dist/server/metrics/index.js.map +1 -1
  316. package/dist/server/proxy/index.d.ts +0 -1
  317. package/dist/server/proxy/index.d.ts.map +1 -1
  318. package/dist/server/proxy/index.js.map +1 -1
  319. package/dist/server/rate-limit/index.d.ts +8 -9
  320. package/dist/server/rate-limit/index.d.ts.map +1 -1
  321. package/dist/server/rate-limit/index.js +6 -12
  322. package/dist/server/rate-limit/index.js.map +1 -1
  323. package/dist/server/static/index.d.ts +0 -1
  324. package/dist/server/static/index.d.ts.map +1 -1
  325. package/dist/server/static/index.js.map +1 -1
  326. package/dist/server/swagger/index.d.ts +4 -4
  327. package/dist/server/swagger/index.d.ts.map +1 -1
  328. package/dist/server/swagger/index.js +37 -25
  329. package/dist/server/swagger/index.js.map +1 -1
  330. package/dist/sms/index.d.ts +0 -1
  331. package/dist/sms/index.d.ts.map +1 -1
  332. package/dist/sms/index.js.map +1 -1
  333. package/dist/system/index.browser.js.map +1 -1
  334. package/dist/system/index.d.ts +0 -1
  335. package/dist/system/index.d.ts.map +1 -1
  336. package/dist/system/index.js +2 -1
  337. package/dist/system/index.js.map +1 -1
  338. package/dist/system/index.workerd.js.map +1 -1
  339. package/dist/topic/core/index.d.ts +19 -20
  340. package/dist/topic/core/index.d.ts.map +1 -1
  341. package/dist/topic/core/index.js +8 -8
  342. package/dist/topic/core/index.js.map +1 -1
  343. package/dist/topic/redis/index.d.ts +3 -4
  344. package/dist/topic/redis/index.d.ts.map +1 -1
  345. package/dist/topic/redis/index.js +2 -2
  346. package/dist/topic/redis/index.js.map +1 -1
  347. package/package.json +36 -36
  348. package/src/api/audits/__tests__/AuditJobs.spec.ts +83 -0
  349. package/src/api/audits/__tests__/AuditService.spec.ts +139 -1
  350. package/src/api/audits/controllers/AdminAuditController.ts +41 -41
  351. package/src/api/audits/entities/audits.ts +22 -22
  352. package/src/api/audits/index.ts +6 -1
  353. package/src/api/audits/jobs/AuditJobs.ts +29 -0
  354. package/src/api/audits/parameters/AuditParameters.ts +51 -0
  355. package/src/api/audits/primitives/$audit.ts +24 -0
  356. package/src/api/audits/schemas/auditQuerySchema.ts +13 -13
  357. package/src/api/audits/schemas/createAuditSchema.ts +18 -18
  358. package/src/api/audits/services/AuditService.ts +79 -7
  359. package/src/api/files/__tests__/FileController.spec.ts +5 -5
  360. package/src/api/files/__tests__/FileJobs.spec.ts +6 -0
  361. package/src/api/files/controllers/FileController.ts +25 -25
  362. package/src/api/files/entities/files.ts +15 -15
  363. package/src/api/files/schemas/fileCreatorSummarySchema.ts +7 -7
  364. package/src/api/files/schemas/fileQuerySchema.ts +9 -9
  365. package/src/api/files/schemas/fileResourceSchema.ts +7 -9
  366. package/src/api/files/schemas/storageStatsSchema.ts +13 -13
  367. package/src/api/jobs/__tests__/$job-hardening.spec.ts +289 -0
  368. package/src/api/jobs/__tests__/$job.spec.ts +18 -18
  369. package/src/api/jobs/controllers/AdminJobController.ts +8 -8
  370. package/src/api/jobs/entities/jobExecutionEntity.ts +29 -19
  371. package/src/api/jobs/providers/JobProvider.ts +128 -12
  372. package/src/api/jobs/providers/JobQueueProvider.ts +2 -2
  373. package/src/api/jobs/schemas/jobConfigAtom.ts +22 -22
  374. package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +6 -6
  375. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -15
  376. package/src/api/jobs/schemas/jobRegistrationSchema.ts +20 -19
  377. package/src/api/jobs/schemas/triggerJobSchema.ts +3 -3
  378. package/src/api/jobs/services/JobService.ts +6 -6
  379. package/src/api/keys/__tests__/ApiKeyService.spec.ts +2 -2
  380. package/src/api/keys/controllers/AdminApiKeyController.ts +10 -10
  381. package/src/api/keys/entities/apiKeyEntity.ts +15 -15
  382. package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +4 -4
  383. package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +15 -15
  384. package/src/api/keys/schemas/createApiKeyBodySchema.ts +5 -5
  385. package/src/api/keys/schemas/createApiKeyResponseSchema.ts +9 -9
  386. package/src/api/keys/schemas/listApiKeyResponseSchema.ts +13 -13
  387. package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +3 -3
  388. package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +3 -3
  389. package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +2 -2
  390. package/src/api/notifications/controllers/AdminNotificationController.ts +38 -14
  391. package/src/api/notifications/jobs/NotificationJobs.ts +7 -6
  392. package/src/api/notifications/primitives/$notification.ts +43 -4
  393. package/src/api/notifications/schemas/notificationContactPreferencesSchema.ts +4 -4
  394. package/src/api/notifications/schemas/notificationContactSchema.ts +7 -7
  395. package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +9 -11
  396. package/src/api/notifications/schemas/notificationPayloadSchema.ts +11 -9
  397. package/src/api/notifications/schemas/notificationQuerySchema.ts +6 -6
  398. package/src/api/notifications/schemas/notificationResourceSchema.ts +14 -14
  399. package/src/api/notifications/services/NotificationSenderService.ts +38 -2
  400. package/src/api/oauth/__tests__/OAuthClientService.spec.ts +42 -0
  401. package/src/api/oauth/__tests__/OAuthController.spec.ts +128 -0
  402. package/src/api/oauth/controllers/OAuthController.ts +132 -12
  403. package/src/api/oauth/entities/oauthClientEntity.ts +29 -12
  404. package/src/api/oauth/helpers/oauthMetadata.ts +1 -0
  405. package/src/api/oauth/helpers/oidcMetadata.ts +19 -0
  406. package/src/api/oauth/index.ts +1 -0
  407. package/src/api/oauth/schemas/authorizeDecisionBodySchema.ts +12 -11
  408. package/src/api/oauth/schemas/authorizeQuerySchema.ts +12 -10
  409. package/src/api/oauth/schemas/registerClientBodySchema.ts +10 -11
  410. package/src/api/oauth/schemas/tokenRequestBodySchema.ts +9 -8
  411. package/src/api/oauth/services/OAuthClientService.ts +228 -15
  412. package/src/api/organizations/controllers/AdminOrganizationController.ts +8 -8
  413. package/src/api/organizations/entities/organizations.ts +6 -6
  414. package/src/api/organizations/schemas/createOrganizationSchema.ts +5 -5
  415. package/src/api/organizations/schemas/organizationQuerySchema.ts +4 -4
  416. package/src/api/organizations/schemas/updateOrganizationSchema.ts +1 -2
  417. package/src/api/parameters/__tests__/$parameter.spec.ts +229 -50
  418. package/src/api/parameters/controllers/AdminParameterController.ts +9 -12
  419. package/src/api/parameters/entities/parameters.ts +29 -16
  420. package/src/api/parameters/primitives/$parameter.ts +3 -3
  421. package/src/api/parameters/schemas/activateParameterBodySchema.ts +4 -4
  422. package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +15 -15
  423. package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +7 -7
  424. package/src/api/parameters/schemas/parameterCurrentResponseSchema.ts +7 -7
  425. package/src/api/parameters/schemas/parameterHistoryResponseSchema.ts +3 -3
  426. package/src/api/parameters/schemas/parameterNameParamSchema.ts +2 -3
  427. package/src/api/parameters/schemas/parameterNamesResponseSchema.ts +3 -3
  428. package/src/api/parameters/schemas/parameterResponseSchema.ts +3 -3
  429. package/src/api/parameters/schemas/parameterStatusSchema.ts +2 -2
  430. package/src/api/parameters/schemas/parameterTreeNodeSchema.ts +6 -6
  431. package/src/api/parameters/schemas/parameterVersionParamSchema.ts +5 -6
  432. package/src/api/parameters/schemas/parameterVersionResponseSchema.ts +3 -3
  433. package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +6 -9
  434. package/src/api/parameters/services/ParameterProvider.ts +152 -65
  435. package/src/api/payments/controllers/AdminPaymentController.ts +7 -7
  436. package/src/api/payments/controllers/MockCheckoutController.ts +79 -28
  437. package/src/api/payments/controllers/PaymentController.ts +4 -4
  438. package/src/api/payments/entities/paymentIntents.ts +11 -11
  439. package/src/api/payments/entities/paymentMethods.ts +11 -11
  440. package/src/api/payments/entities/refunds.ts +9 -9
  441. package/src/api/payments/providers/PaymentProvider.ts +18 -0
  442. package/src/api/payments/schemas/intentSchemas.ts +25 -25
  443. package/src/api/payments/schemas/paymentMethodSchemas.ts +3 -3
  444. package/src/api/payments/services/PaymentService.ts +60 -3
  445. package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +14 -0
  446. package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +11 -11
  447. package/src/api/subscriptions/controllers/SubscriptionController.ts +5 -4
  448. package/src/api/subscriptions/entities/subscriptionEvents.ts +15 -15
  449. package/src/api/subscriptions/entities/subscriptions.ts +22 -22
  450. package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +22 -22
  451. package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +4 -4
  452. package/src/api/subscriptions/schemas/changePlanSchema.ts +5 -5
  453. package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +14 -7
  454. package/src/api/subscriptions/schemas/entitlementsSchema.ts +10 -10
  455. package/src/api/subscriptions/schemas/mrrSchema.ts +9 -9
  456. package/src/api/subscriptions/schemas/planDefinitionSchema.ts +21 -21
  457. package/src/api/subscriptions/schemas/planResourceSchema.ts +19 -19
  458. package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +8 -8
  459. package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +7 -7
  460. package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +17 -17
  461. package/src/api/subscriptions/services/SubscriptionConfig.ts +2 -2
  462. package/src/api/users/__tests__/ApiKeys-integration.spec.ts +11 -11
  463. package/src/api/users/atoms/realmAuthSettingsAtom.ts +111 -119
  464. package/src/api/users/controllers/AdminIdentityController.ts +29 -19
  465. package/src/api/users/controllers/AdminSessionController.ts +37 -27
  466. package/src/api/users/controllers/AdminUserController.ts +75 -53
  467. package/src/api/users/controllers/MySessionController.ts +125 -0
  468. package/src/api/users/controllers/RealmController.ts +9 -9
  469. package/src/api/users/controllers/UserController.ts +55 -55
  470. package/src/api/users/entities/identities.ts +8 -8
  471. package/src/api/users/entities/sessions.ts +17 -17
  472. package/src/api/users/entities/users.ts +17 -17
  473. package/src/api/users/index.ts +3 -0
  474. package/src/api/users/notifications/UserNotifications.ts +76 -24
  475. package/src/api/users/primitives/$realm.ts +12 -0
  476. package/src/api/users/schemas/completePasswordResetRequestSchema.ts +8 -12
  477. package/src/api/users/schemas/completeRegistrationRequestSchema.ts +17 -20
  478. package/src/api/users/schemas/createUserSchema.ts +2 -2
  479. package/src/api/users/schemas/identityQuerySchema.ts +4 -4
  480. package/src/api/users/schemas/identityResourceSchema.ts +3 -2
  481. package/src/api/users/schemas/loginSchema.ts +4 -4
  482. package/src/api/users/schemas/passwordResetIntentResponseSchema.ts +6 -8
  483. package/src/api/users/schemas/realmConfigSchema.ts +10 -10
  484. package/src/api/users/schemas/registerQuerySchema.ts +6 -6
  485. package/src/api/users/schemas/registerRequestSchema.ts +21 -43
  486. package/src/api/users/schemas/registerResponseSchema.ts +2 -2
  487. package/src/api/users/schemas/registerSchema.ts +13 -31
  488. package/src/api/users/schemas/registrationIntentResponseSchema.ts +19 -23
  489. package/src/api/users/schemas/resetPasswordSchema.ts +10 -17
  490. package/src/api/users/schemas/sessionQuerySchema.ts +3 -3
  491. package/src/api/users/schemas/sessionResourceSchema.ts +25 -25
  492. package/src/api/users/schemas/updateUserSchema.ts +3 -4
  493. package/src/api/users/schemas/userQuerySchema.ts +7 -7
  494. package/src/api/users/services/RegistrationService.ts +25 -11
  495. package/src/api/users/services/UserService.ts +12 -6
  496. package/src/api/verifications/__tests__/CodeVerification.spec.ts +63 -101
  497. package/src/api/verifications/__tests__/LinkVerification.spec.ts +23 -92
  498. package/src/api/verifications/controllers/VerificationController.ts +13 -27
  499. package/src/api/verifications/entities/verifications.ts +13 -14
  500. package/src/api/verifications/schemas/requestVerificationCodeResponseSchema.ts +17 -14
  501. package/src/api/verifications/schemas/validateVerificationCodeResponseSchema.ts +9 -10
  502. package/src/api/verifications/schemas/verificationSettingsSchema.ts +65 -66
  503. package/src/api/verifications/schemas/verificationTypeEnumSchema.ts +2 -2
  504. package/src/api/verifications/services/VerificationService.ts +12 -0
  505. package/src/background/__tests__/BackgroundTaskProvider.spec.ts +36 -0
  506. package/src/batch/__tests__/$batch.spec.ts +22 -22
  507. package/src/batch/__tests__/startup-buffering.spec.ts +9 -9
  508. package/src/bin/index.ts +1 -1
  509. package/src/bucket/__tests__/TenantScopedBucket.spec.ts +60 -0
  510. package/src/bucket/providers/LocalFileStorageProvider.ts +14 -6
  511. package/src/bucket/providers/MemoryFileStorageProvider.ts +18 -7
  512. package/src/bucket/providers/R2FileStorageProvider.ts +14 -6
  513. package/src/bucket/providers/S3FileStorageProvider.ts +31 -15
  514. package/src/cache/core/primitives/$cache.ts +7 -10
  515. package/src/cache/database/entities/cacheEntries.ts +16 -27
  516. package/src/cache/database/providers/DatabaseCacheProvider.ts +15 -13
  517. package/src/cache/redis/providers/RedisCacheProvider.ts +6 -6
  518. package/src/captcha/providers/TurnstileCaptchaProvider.ts +4 -4
  519. package/src/cli/core/__tests__/BuildCloudflareTask.spec.ts +178 -0
  520. package/src/cli/core/__tests__/BuildDockerTask.spec.ts +0 -2
  521. package/src/cli/core/__tests__/DbCommand.spec.ts +108 -0
  522. package/src/cli/core/atoms/appEntryOptions.ts +5 -5
  523. package/src/cli/core/atoms/buildOptions.ts +76 -88
  524. package/src/cli/core/atoms/changelogOptions.ts +3 -3
  525. package/src/cli/core/atoms/devOptions.ts +3 -3
  526. package/src/cli/core/commands/build.ts +36 -49
  527. package/src/cli/core/commands/db.ts +171 -83
  528. package/src/cli/core/commands/dev.ts +8 -8
  529. package/src/cli/core/commands/gen/changelog.ts +12 -14
  530. package/src/cli/core/commands/gen/env.ts +6 -6
  531. package/src/cli/core/commands/gen/openapi.ts +6 -6
  532. package/src/cli/core/commands/init.ts +28 -33
  533. package/src/cli/core/commands/pack.ts +10 -10
  534. package/src/cli/core/commands/root.ts +7 -8
  535. package/src/cli/core/commands/test.ts +17 -20
  536. package/src/cli/core/index.ts +0 -3
  537. package/src/cli/core/tasks/BuildCloudflareTask.ts +138 -245
  538. package/src/cli/core/tasks/BuildPrerenderTask.ts +44 -7
  539. package/src/cli/core/templates/apiHelloResponseSchemaTs.ts +4 -4
  540. package/src/cli/devtools/atoms/devtoolsOptions.ts +6 -6
  541. package/src/cli/i18n/__tests__/I18nCheckService.spec.ts +48 -0
  542. package/src/cli/i18n/atoms/i18nOptions.ts +8 -8
  543. package/src/cli/i18n/services/I18nCheckService.ts +65 -11
  544. package/src/cli/platform/commands/SecretsCommand.ts +24 -25
  545. package/src/cli/platform/commands/platform.ts +40 -46
  546. package/src/cli/platform/index.ts +1 -1
  547. package/src/cli/platform-lib/__tests__/CloudflareAdapter.spec.ts +0 -4
  548. package/src/cli/platform-lib/__tests__/PlatformInspector.spec.ts +10 -3
  549. package/src/cli/platform-lib/__tests__/VercelAdapter.spec.ts +0 -2
  550. package/src/cli/platform-lib/adapters/CloudflareAdapter.ts +141 -50
  551. package/src/cli/platform-lib/adapters/VercelAdapter.ts +6 -11
  552. package/src/cli/platform-lib/atoms/platformOptions.ts +46 -25
  553. package/src/cli/platform-lib/schemas/cloudflare.ts +87 -87
  554. package/src/cli/platform-lib/schemas/platform.ts +51 -51
  555. package/src/cli/platform-lib/schemas/vercel.ts +28 -28
  556. package/src/cli/platform-lib/services/CloudflareApi.ts +5 -5
  557. package/src/cli/platform-lib/services/VercelApi.ts +4 -4
  558. package/src/cli/platform-lib/services/VercelCli.ts +6 -15
  559. package/src/cli/platform-lib/services/WranglerApi.ts +6 -15
  560. package/src/cli/vendor/atoms/vendorOptions.ts +9 -9
  561. package/src/cli/vendor/commands/VendorCommand.ts +11 -12
  562. package/src/command/__tests__/$command.spec.ts +82 -83
  563. package/src/command/__tests__/Asker.spec.ts +6 -13
  564. package/src/command/__tests__/CliProvider.spec.ts +136 -149
  565. package/src/command/__tests__/Runner.spec.ts +86 -110
  566. package/src/command/helpers/Asker.ts +23 -58
  567. package/src/command/helpers/Runner.ts +34 -110
  568. package/src/command/index.ts +4 -9
  569. package/src/command/primitives/$command.ts +10 -10
  570. package/src/command/providers/CliProvider.ts +183 -161
  571. package/src/core/Alepha.ts +62 -13
  572. package/src/core/__tests__/$atom.spec.ts +52 -3
  573. package/src/core/__tests__/$computed.spec.ts +129 -0
  574. package/src/core/__tests__/$env.spec.ts +13 -13
  575. package/src/core/__tests__/$inject.spec.ts +4 -4
  576. package/src/core/__tests__/$module.spec.ts +1 -1
  577. package/src/core/__tests__/Alepha-graph.spec.ts +1 -1
  578. package/src/core/__tests__/Alepha-parseEnv.spec.ts +32 -32
  579. package/src/core/__tests__/Alepha-start.spec.ts +3 -3
  580. package/src/core/__tests__/CodecManager.spec.ts +113 -94
  581. package/src/core/__tests__/KeylessJsonSchemaCodec.spec.ts +138 -138
  582. package/src/core/__tests__/SchemaValidator.spec.ts +43 -44
  583. package/src/core/__tests__/StateManager.persist.browser.spec.ts +87 -0
  584. package/src/core/__tests__/StateManager.spec.ts +423 -0
  585. package/src/core/__tests__/TypeBox-usecases.spec.ts +8 -8
  586. package/src/core/__tests__/TypeProvider.spec.ts +314 -309
  587. package/src/core/__tests__/dump.spec.ts +6 -6
  588. package/src/core/__tests__/pagination.spec.ts +4 -4
  589. package/src/core/__tests__/scoped-after-start.spec.ts +43 -0
  590. package/src/core/errors/TypeBoxError.ts +10 -4
  591. package/src/core/helpers/FileLike.ts +5 -5
  592. package/src/core/helpers/coerceStrings.ts +70 -0
  593. package/src/core/helpers/jsonSchemaToZod.ts +112 -0
  594. package/src/core/index.shared.ts +4 -1
  595. package/src/core/primitives/$atom.ts +95 -27
  596. package/src/core/primitives/$computed.ts +148 -0
  597. package/src/core/primitives/$env.ts +5 -5
  598. package/src/core/primitives/$state.ts +1 -1
  599. package/src/core/providers/AlsProvider.ts +26 -0
  600. package/src/core/providers/CodecManager.ts +1 -2
  601. package/src/core/providers/JsonSchemaCodec.ts +1 -2
  602. package/src/core/providers/KeylessJsonSchemaCodec.ts +82 -57
  603. package/src/core/providers/SchemaValidator.ts +48 -158
  604. package/src/core/providers/StateManager.ts +383 -9
  605. package/src/core/providers/TypeProvider.ts +80 -734
  606. package/src/core/providers/ZodProvider.ts +380 -0
  607. package/src/core/providers/zodAugment.ts +69 -0
  608. package/src/core/schemas/pageQuerySchema.ts +19 -21
  609. package/src/core/schemas/pageSchema.ts +47 -57
  610. package/src/crypto/__tests__/SecretProvider.spec.ts +31 -0
  611. package/src/crypto/providers/SecretProvider.ts +16 -10
  612. package/src/datetime/primitives/$throttle.ts +6 -1
  613. package/src/email/brevo/providers/BrevoEmailProvider.ts +4 -4
  614. package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +6 -6
  615. package/src/email/core/index.ts +7 -2
  616. package/src/email/core/primitives/$email.ts +5 -1
  617. package/src/email/core/providers/LocalEmailProvider.ts +5 -5
  618. package/src/email/smtp/providers/NodemailerEmailProvider.ts +41 -52
  619. package/src/fake/__tests__/FakeProvider.spec.ts +110 -110
  620. package/src/fake/__tests__/keyName.example.ts +21 -21
  621. package/src/fake/__tests__/keyName.spec.ts +41 -41
  622. package/src/fake/__tests__/module.example.ts +8 -8
  623. package/src/fake/providers/FakeProvider.ts +122 -121
  624. package/src/lock/core/__tests__/lock-mutual-exclusion.spec.ts +44 -0
  625. package/src/lock/core/index.ts +1 -0
  626. package/src/lock/core/primitives/$lock.ts +13 -6
  627. package/src/logger/__tests__/CliFormatterProvider.spec.ts +76 -0
  628. package/src/logger/__tests__/Logger.spec.ts +49 -0
  629. package/src/logger/index.ts +25 -18
  630. package/src/logger/providers/CliFormatterProvider.ts +75 -0
  631. package/src/logger/schemas/logEntrySchema.ts +10 -10
  632. package/src/logger/services/Logger.ts +18 -0
  633. package/src/mcp/__tests__/$prompt.spec.ts +21 -23
  634. package/src/mcp/__tests__/$tool.spec.ts +22 -22
  635. package/src/mcp/__tests__/McpServerProvider.spec.ts +82 -11
  636. package/src/mcp/__tests__/StreamableHttpMcpTransport.spec.ts +2 -2
  637. package/src/mcp/__tests__/integration.spec.ts +33 -33
  638. package/src/mcp/primitives/$prompt.ts +11 -9
  639. package/src/mcp/primitives/$tool.ts +27 -86
  640. package/src/mcp/providers/McpServerProvider.ts +55 -0
  641. package/src/mcp/transports/StreamableHttpMcpTransport.ts +7 -7
  642. package/src/orm/__tests__/$repository-tests.ts +133 -27
  643. package/src/orm/__tests__/$repository.spec.ts +23 -0
  644. package/src/orm/__tests__/$transactional-tests.ts +4 -4
  645. package/src/orm/__tests__/ModelBuilder-tests.ts +28 -28
  646. package/src/orm/__tests__/ModelBuilder.spec.ts +124 -106
  647. package/src/orm/__tests__/QueryManager.spec.ts +5 -5
  648. package/src/orm/__tests__/delete-returning-tests.ts +11 -11
  649. package/src/orm/__tests__/deletedAt-tests.ts +3 -3
  650. package/src/orm/__tests__/enums.spec.ts +29 -25
  651. package/src/orm/__tests__/execute-tests.ts +8 -8
  652. package/src/orm/__tests__/fixtures/bigEntitySchema.ts +48 -48
  653. package/src/orm/__tests__/fixtures/userEntitySchema.ts +6 -6
  654. package/src/orm/__tests__/joins-tests.ts +30 -30
  655. package/src/orm/__tests__/organization-tests.ts +105 -3
  656. package/src/orm/__tests__/organization.spec.ts +46 -0
  657. package/src/orm/__tests__/orm-errors.spec.ts +10 -10
  658. package/src/orm/__tests__/orm-next-tests.ts +29 -29
  659. package/src/orm/__tests__/orm-showcase-tests.ts +9 -9
  660. package/src/orm/__tests__/primaryKey.spec.ts +4 -4
  661. package/src/orm/__tests__/query-date-encoding-tests.ts +17 -17
  662. package/src/orm/__tests__/ref-auto-onDelete.spec.ts +14 -14
  663. package/src/orm/__tests__/references.spec.ts +7 -7
  664. package/src/orm/__tests__/security.spec.ts +17 -17
  665. package/src/orm/__tests__/string-operators-tests.ts +5 -5
  666. package/src/orm/__tests__/timestamps-tests.ts +14 -14
  667. package/src/orm/__tests__/validation-tests.ts +5 -5
  668. package/src/orm/core/__tests__/BunSqliteProvider.bun.spec.ts +8 -8
  669. package/src/orm/core/constants/PG_SYMBOLS.ts +13 -1
  670. package/src/orm/core/entities/alephaSequences.ts +8 -8
  671. package/src/orm/core/helpers/pgAttr.ts +4 -4
  672. package/src/orm/core/primitives/$entity.ts +10 -6
  673. package/src/orm/core/providers/DatabaseTypeProvider.ts +46 -53
  674. package/src/orm/core/providers/drivers/BunSqliteProvider.ts +8 -8
  675. package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +3 -5
  676. package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +8 -8
  677. package/src/orm/core/schemas/databaseEnvSchema.ts +4 -4
  678. package/src/orm/core/schemas/insertSchema.ts +14 -18
  679. package/src/orm/core/schemas/legacyIdSchema.ts +2 -2
  680. package/src/orm/core/schemas/updateSchema.ts +10 -16
  681. package/src/orm/core/services/PgRelationManager.ts +2 -2
  682. package/src/orm/core/services/QueryManager.ts +13 -2
  683. package/src/orm/core/services/Repository.ts +88 -33
  684. package/src/orm/core/services/SqliteModelBuilder.ts +38 -45
  685. package/src/orm/postgres/__tests__/BunPostgresProvider.bun.spec.ts +4 -4
  686. package/src/orm/postgres/providers/CloudflareHyperdriveProvider.ts +4 -6
  687. package/src/orm/postgres/schemas/postgresEnvSchema.ts +6 -6
  688. package/src/orm/postgres/services/PostgresModelBuilder.ts +127 -114
  689. package/src/queue/core/__tests__/$consumer.spec.ts +4 -4
  690. package/src/queue/core/__tests__/WorkerProvider.spec.ts +4 -4
  691. package/src/queue/core/__tests__/shared.ts +6 -6
  692. package/src/queue/core/primitives/$consumer.ts +5 -5
  693. package/src/queue/core/primitives/$queue.ts +44 -61
  694. package/src/queue/core/providers/CloudflareQueueProvider.ts +6 -0
  695. package/src/queue/core/providers/WorkerProvider.ts +17 -14
  696. package/src/queue/redis/providers/RedisQueueProvider.ts +3 -3
  697. package/src/react/core/__tests__/ErrorBoundary.browser.spec.tsx +92 -0
  698. package/src/react/core/__tests__/Router.spec.tsx +4 -4
  699. package/src/react/core/__tests__/useComputed.browser.spec.tsx +192 -0
  700. package/src/react/core/__tests__/useQuery.browser.spec.tsx +48 -0
  701. package/src/react/core/__tests__/useSelector.browser.spec.tsx +105 -0
  702. package/src/react/core/__tests__/useStore.browser.spec.tsx +113 -0
  703. package/src/react/core/components/ErrorBoundary.tsx +42 -0
  704. package/src/react/core/hooks/useAction.ts +56 -19
  705. package/src/react/core/hooks/useComputed.ts +91 -0
  706. package/src/react/core/hooks/useSelector.ts +67 -0
  707. package/src/react/core/hooks/useStore.ts +36 -17
  708. package/src/react/core/index.ts +3 -0
  709. package/src/react/core/utils/shallowEqual.ts +36 -0
  710. package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +71 -0
  711. package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +96 -0
  712. package/src/react/form/__tests__/useForm.browser.spec.tsx +54 -54
  713. package/src/react/form/errors/FormValidationError.ts +0 -2
  714. package/src/react/form/hooks/useForm.ts +19 -4
  715. package/src/react/form/hooks/useFormQuerySync.ts +0 -0
  716. package/src/react/form/services/FormModel.ts +124 -86
  717. package/src/react/form/services/parseField.ts +66 -27
  718. package/src/react/i18n/__tests__/I18nProvider.spec.ts +89 -0
  719. package/src/react/i18n/__tests__/Localize.spec.tsx +1 -1
  720. package/src/react/i18n/__tests__/locale-routing.spec.ts +107 -0
  721. package/src/react/i18n/providers/I18nProvider.ts +173 -14
  722. package/src/react/router/__tests__/$page.browser.spec.tsx +19 -19
  723. package/src/react/router/__tests__/$page.spec.tsx +21 -21
  724. package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +87 -1
  725. package/src/react/router/__tests__/RouterLocaleProvider.spec.ts +127 -0
  726. package/src/react/router/atoms/ssrManifestAtom.ts +16 -16
  727. package/src/react/router/components/NestedView.tsx +11 -3
  728. package/src/react/router/hooks/useQueryParams.ts +1 -1
  729. package/src/react/router/index.browser.ts +4 -0
  730. package/src/react/router/index.shared.ts +1 -0
  731. package/src/react/router/index.ts +9 -0
  732. package/src/react/router/primitives/$page.ts +2 -2
  733. package/src/react/router/providers/ReactBrowserProvider.ts +64 -13
  734. package/src/react/router/providers/ReactBrowserRouterProvider.ts +15 -1
  735. package/src/react/router/providers/ReactPageProvider.ts +38 -13
  736. package/src/react/router/providers/ReactServerProvider.ts +105 -16
  737. package/src/react/router/providers/RootComponentsProvider.ts +13 -0
  738. package/src/react/router/providers/RouterLocaleProvider.ts +125 -0
  739. package/src/react/router/providers/__tests__/RootComponentsProvider.spec.ts +15 -0
  740. package/src/react/router/providers/__tests__/rootComponents.ssr.browser.spec.tsx +67 -0
  741. package/src/react/sitemap/__tests__/$sitemap.spec.ts +131 -0
  742. package/src/react/sitemap/index.browser.ts +21 -0
  743. package/src/react/sitemap/index.ts +25 -0
  744. package/src/react/sitemap/primitives/$sitemap.browser.ts +26 -0
  745. package/src/react/sitemap/primitives/$sitemap.ts +196 -0
  746. package/src/react/ui/atoms/uiAtom.ts +6 -6
  747. package/src/react/ui/atoms/uiThemeListAtom.ts +7 -7
  748. package/src/react/ui/hooks/useColorMode.ts +11 -4
  749. package/src/react/ui/services/SchemaControl.ts +4 -4
  750. package/src/redis/providers/BunRedisProvider.ts +19 -11
  751. package/src/redis/providers/NodeRedisProvider.ts +3 -3
  752. package/src/scheduler/primitives/$scheduler.ts +21 -8
  753. package/src/security/__tests__/assertRealmScope.spec.ts +29 -0
  754. package/src/security/atoms/currentTenantAtom.ts +6 -6
  755. package/src/security/atoms/currentUserAtom.ts +2 -2
  756. package/src/security/primitives/$issuer.ts +24 -2
  757. package/src/security/providers/JwtProvider.ts +100 -0
  758. package/src/security/providers/SecurityProvider.ts +43 -2
  759. package/src/security/schemas/permissionSchema.ts +19 -19
  760. package/src/security/schemas/roleSchema.ts +22 -28
  761. package/src/security/schemas/userAccountInfoSchema.ts +47 -37
  762. package/src/server/auth/__tests__/appleClientSecret.spec.ts +34 -0
  763. package/src/server/auth/__tests__/federationRedirectReplay.spec.ts +44 -0
  764. package/src/server/auth/helpers/appleClientSecret.ts +24 -0
  765. package/src/server/auth/helpers/jtiReplayGuard.ts +41 -0
  766. package/src/server/auth/helpers/safeRedirectPath.ts +19 -0
  767. package/src/server/auth/index.ts +1 -0
  768. package/src/server/auth/primitives/$auth.ts +6 -6
  769. package/src/server/auth/primitives/$authApple.ts +10 -10
  770. package/src/server/auth/primitives/$authFacebook.ts +10 -10
  771. package/src/server/auth/primitives/$authFranceConnect.ts +10 -10
  772. package/src/server/auth/primitives/$authGithub.ts +10 -10
  773. package/src/server/auth/primitives/$authGoogle.ts +10 -10
  774. package/src/server/auth/primitives/$authMicrosoft.ts +14 -14
  775. package/src/server/auth/providers/ServerAuthProvider.ts +67 -52
  776. package/src/server/auth/schemas/authenticationProviderSchema.ts +9 -12
  777. package/src/server/auth/schemas/tokenResponseSchema.ts +2 -2
  778. package/src/server/auth/schemas/tokensSchema.ts +16 -16
  779. package/src/server/auth/schemas/userinfoResponseSchema.ts +3 -3
  780. package/src/server/cookies/__tests__/AtomCookieBinding.spec.ts +80 -0
  781. package/src/server/cookies/__tests__/AtomCookiePersistence.browser.spec.ts +169 -0
  782. package/src/server/cookies/__tests__/AtomCookiePersistence.spec.ts +294 -0
  783. package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +82 -12
  784. package/src/server/cookies/index.browser.ts +4 -1
  785. package/src/server/cookies/index.ts +8 -1
  786. package/src/server/cookies/primitives/$cookie.browser.ts +1 -1
  787. package/src/server/cookies/primitives/$cookie.ts +16 -0
  788. package/src/server/cookies/providers/AtomCookiePersistence.browser.ts +133 -0
  789. package/src/server/cookies/providers/AtomCookiePersistence.ts +148 -0
  790. package/src/server/cookies/providers/ServerCookiesProvider.ts +32 -4
  791. package/src/server/cookies/services/CookieParser.ts +6 -1
  792. package/src/server/core/__tests__/$action.spec.ts +13 -13
  793. package/src/server/core/__tests__/$middleware.spec.ts +10 -10
  794. package/src/server/core/__tests__/$route.spec.ts +9 -9
  795. package/src/server/core/__tests__/$sse.spec.ts +26 -26
  796. package/src/server/core/__tests__/BunHttpServerProvider.bun.spec.ts +6 -6
  797. package/src/server/core/__tests__/HttpClient.spec.ts +2 -2
  798. package/src/server/core/__tests__/NodeHttpServerProvider.spec.ts +15 -3
  799. package/src/server/core/__tests__/ServerBodyParserProvider.spec.ts +14 -14
  800. package/src/server/core/__tests__/ServerMultipartProvider.spec.ts +33 -33
  801. package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +5 -1
  802. package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +25 -25
  803. package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +9 -5
  804. package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +56 -24
  805. package/src/server/core/errors/ValidationError.ts +6 -3
  806. package/src/server/core/helpers/isMultipart.ts +2 -1
  807. package/src/server/core/index.ts +5 -2
  808. package/src/server/core/interfaces/ServerRequest.ts +14 -14
  809. package/src/server/core/primitives/$action.ts +26 -36
  810. package/src/server/core/primitives/$route.ts +27 -0
  811. package/src/server/core/primitives/$sse.ts +3 -3
  812. package/src/server/core/providers/BunHttpServerProvider.ts +8 -9
  813. package/src/server/core/providers/NodeHttpServerProvider.ts +8 -9
  814. package/src/server/core/providers/ServerBodyParserProvider.ts +20 -12
  815. package/src/server/core/providers/ServerCompressProvider.ts +9 -10
  816. package/src/server/core/providers/ServerHelmetProvider.ts +26 -27
  817. package/src/server/core/providers/ServerMultipartProvider.ts +19 -19
  818. package/src/server/core/providers/ServerRouterProvider.ts +44 -15
  819. package/src/server/core/schemas/errorSchema.ts +20 -25
  820. package/src/server/core/schemas/okSchema.ts +9 -14
  821. package/src/server/core/services/HttpClient.ts +13 -1
  822. package/src/server/core/services/ServerRequestParser.ts +6 -6
  823. package/src/server/cors/providers/ServerCorsProvider.ts +26 -28
  824. package/src/server/health/schemas/healthSchema.ts +6 -6
  825. package/src/server/links/__tests__/$remote.spec.ts +3 -3
  826. package/src/server/links/__tests__/BatchEndpoint.spec.ts +9 -9
  827. package/src/server/links/__tests__/LinkProvider.spec.ts +9 -9
  828. package/src/server/links/__tests__/ServerLinksProvider.spec.ts +23 -23
  829. package/src/server/links/__tests__/fixtures/CrudApp.ts +21 -21
  830. package/src/server/links/atoms/apiLinksAtom.ts +2 -2
  831. package/src/server/links/atoms/linkOptionsAtom.ts +6 -6
  832. package/src/server/links/primitives/$remote.ts +3 -3
  833. package/src/server/links/providers/LinkProvider.ts +3 -3
  834. package/src/server/links/providers/ServerLinksProvider.ts +20 -20
  835. package/src/server/links/schemas/apiLinksResponseSchema.ts +23 -23
  836. package/src/server/proxy/__tests__/$proxy.spec.ts +9 -9
  837. package/src/server/proxy/providers/ServerProxyProvider.ts +5 -0
  838. package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +18 -20
  839. package/src/server/swagger/__tests__/$swagger.spec.ts +91 -94
  840. package/src/server/swagger/__tests__/ui.spec.ts +3 -3
  841. package/src/server/swagger/providers/ServerSwaggerProvider.ts +66 -43
  842. package/src/system/__tests__/NodeShellProvider.spec.ts +46 -0
  843. package/src/system/providers/NodeShellProvider.ts +4 -1
  844. package/src/topic/core/__tests__/$subscriber.spec.ts +4 -4
  845. package/src/topic/core/__tests__/shared.ts +8 -8
  846. package/src/topic/core/primitives/$subscriber.ts +5 -5
  847. package/src/topic/core/primitives/$topic.ts +14 -14
  848. package/src/topic/redis/providers/RedisTopicProvider.ts +3 -3
  849. package/dist/container/core/index.d.ts +0 -236
  850. package/dist/container/core/index.d.ts.map +0 -1
  851. package/dist/container/core/index.js +0 -231
  852. package/dist/container/core/index.js.map +0 -1
  853. package/dist/container/core/index.workerd.js +0 -192
  854. package/dist/container/core/index.workerd.js.map +0 -1
  855. package/src/cli/core/tasks/BuildSitemapTask.ts +0 -130
  856. package/src/command/helpers/PrettyAsker.ts +0 -256
  857. package/src/command/helpers/PrettyPrint.ts +0 -332
  858. package/src/container/core/__tests__/$container.spec.ts +0 -83
  859. package/src/container/core/index.ts +0 -50
  860. package/src/container/core/index.workerd.ts +0 -53
  861. package/src/container/core/interfaces/ContainerOptions.ts +0 -69
  862. package/src/container/core/primitives/$container.ts +0 -100
  863. package/src/container/core/providers/CloudflareContainerProvider.ts +0 -70
  864. package/src/container/core/providers/ContainerProvider.ts +0 -92
  865. package/src/container/core/providers/MockContainerProvider.ts +0 -62
  866. package/src/container/core/providers/NodeContainerProvider.ts +0 -53
  867. package/src/core/__tests__/jsonSchemaToTypeBox.spec.ts +0 -771
  868. package/src/core/helpers/jsonSchemaToTypeBox.ts +0 -359
  869. /package/dist/orm/core/{chunk-B4FMCO8f.js → rolldown-runtime-B4FMCO8f.js} +0 -0
@@ -1,187 +1,24 @@
1
- import { $atom, $env, $hook, $inject, $module, $state, Alepha, AlephaError, KIND, Primitive, TypeBoxError, createPrimitive, t } from "alepha";
1
+ import { $atom, $env, $hook, $inject, $module, $state, Alepha, AlephaError, KIND, Primitive, TypeBoxError, coerceScalar, createPrimitive, z } from "alepha";
2
2
  import { stdin, stdout } from "node:process";
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import { $logger, ConsoleColorProvider } from "alepha/logger";
5
5
  import { FileSystemProvider, ShellProvider } from "alepha/system";
6
- import { DateTimeProvider } from "alepha/datetime";
7
6
  import * as fs from "node:fs/promises";
8
7
  import { cp, glob, rm } from "node:fs/promises";
9
- //#region ../../src/command/helpers/PrettyAsker.ts
8
+ import { DateTimeProvider } from "alepha/datetime";
9
+ //#region ../../src/command/helpers/Asker.ts
10
10
  /**
11
- * Clack-style interactive prompt renderer.
11
+ * Reads interactive input from the terminal using plain readline prompts.
12
12
  *
13
- * Provides pretty enum selectors (arrow-key navigation),
14
- * text inputs, and confirm prompts with box-drawing framing.
13
+ * One straightforward code path: questions are printed through the logger
14
+ * and answers are read with Node's `readline`. No raw-mode cursor control,
15
+ * no ANSI framing — output stays greppable and works the same in a TTY,
16
+ * under CI, or when piped.
15
17
  */
16
- var PrettyAsker = class {
17
- alepha = $inject(Alepha);
18
- color = $inject(ConsoleColorProvider);
19
- /**
20
- * Whether to use pretty mode.
21
- *
22
- * Same conditions as Runner.useDynamicLogger.
23
- */
24
- get enabled() {
25
- if (this.alepha.isCI() || this.alepha.env.CLAUDECODE) return false;
26
- const logLevel = String(this.alepha.env.LOG_LEVEL || "").toLowerCase();
27
- if (logLevel === "debug" || logLevel === "trace") return false;
28
- return true;
29
- }
30
- /**
31
- * Print the opening frame with a title.
32
- */
33
- intro(title) {
34
- const c = this.color;
35
- this.write(`\n${c.set("DIM", "┌")} ${c.set("BOLD", title)}\n`);
36
- this.write(`${c.set("DIM", "│")}\n`);
37
- }
38
- /**
39
- * Print the closing frame with a message.
40
- */
41
- outro(message) {
42
- const c = this.color;
43
- this.write(`${c.set("DIM", "│")}\n`);
44
- this.write(`${c.set("DIM", "└")} ${message}\n\n`);
45
- }
46
- /**
47
- * Arrow-key select prompt for enum schemas.
48
- */
49
- async select(question, options) {
50
- let selectedIndex = 0;
51
- this.write(`${this.color.set("DIM", "│")}\n`);
52
- this.writeActiveMarker(question);
53
- this.renderOptions(options, selectedIndex);
54
- return new Promise((resolve, reject) => {
55
- if (!(typeof stdin.setRawMode === "function")) {
56
- this.clearOptions(options.length);
57
- this.writeCompletedMarker(question);
58
- this.writeAnswer(options[0]);
59
- resolve(options[0]);
60
- return;
61
- }
62
- stdin.setRawMode(true);
63
- stdin.resume();
64
- const onKeypress = (data) => {
65
- const key = data.toString();
66
- if (key === "") {
67
- cleanup();
68
- stdin.setRawMode(false);
69
- stdin.pause();
70
- reject(new AlephaError("Aborted."));
71
- return;
72
- }
73
- if (key === "\x1B[A" || key === "k") {
74
- selectedIndex = (selectedIndex - 1 + options.length) % options.length;
75
- this.clearOptions(options.length);
76
- this.renderOptions(options, selectedIndex);
77
- return;
78
- }
79
- if (key === "\x1B[B" || key === "j") {
80
- selectedIndex = (selectedIndex + 1) % options.length;
81
- this.clearOptions(options.length);
82
- this.renderOptions(options, selectedIndex);
83
- return;
84
- }
85
- if (key === "\r" || key === "\n") {
86
- cleanup();
87
- stdin.setRawMode(false);
88
- stdin.pause();
89
- this.clearOptions(options.length);
90
- this.clearActiveMarker();
91
- this.writeCompletedMarker(question);
92
- this.writeAnswer(options[selectedIndex]);
93
- resolve(options[selectedIndex]);
94
- }
95
- };
96
- const cleanup = () => {
97
- stdin.removeListener("data", onKeypress);
98
- };
99
- stdin.on("data", onKeypress);
100
- });
101
- }
102
- /**
103
- * Text input prompt with clack framing.
104
- */
105
- async text(question, schema) {
106
- const c = this.color;
107
- const defaultValue = schema && "default" in schema ? String(schema.default) : void 0;
108
- this.write(`${c.set("DIM", "│")}\n`);
109
- this.writeActiveMarker(question);
110
- const defaultHint = defaultValue ? ` ${c.set("DIM", `(${defaultValue})`)}` : "";
111
- this.write(`${c.set("DIM", "│")} ${c.set("DIM", ">")}${defaultHint} `);
112
- const rl = this.createPromptInterface();
113
- try {
114
- const value = (await rl.question("")).trim() || defaultValue || "";
115
- this.write("\x1B[1A\x1B[2K");
116
- this.clearActiveMarker();
117
- this.writeCompletedMarker(question);
118
- this.writeAnswer(value);
119
- if (schema) return this.alepha.codec.decode(schema, value || void 0);
120
- return value;
121
- } finally {
122
- rl.close();
123
- }
124
- }
125
- /**
126
- * Yes/No confirm prompt with clack framing.
127
- */
128
- async confirm(question) {
129
- const c = this.color;
130
- this.write(`${c.set("DIM", "│")}\n`);
131
- this.writeActiveMarker(`${question} ${c.set("DIM", "(Y/n)")}`);
132
- this.write(`${c.set("DIM", "│")} ${c.set("DIM", ">")} `);
133
- const rl = this.createPromptInterface();
134
- try {
135
- const value = (await rl.question("")).trim().toLowerCase();
136
- const result = value !== "n" && value !== "no";
137
- this.write("\x1B[1A\x1B[2K");
138
- this.clearActiveMarker();
139
- this.writeCompletedMarker(question);
140
- this.writeAnswer(result ? "Yes" : "No");
141
- return result;
142
- } finally {
143
- rl.close();
144
- }
145
- }
146
- renderOptions(options, selectedIndex) {
147
- const c = this.color;
148
- for (let i = 0; i < options.length; i++) {
149
- const marker = i === selectedIndex ? `${c.set("CYAN", "❯")} ${c.set("CYAN", options[i])}` : ` ${c.set("DIM", options[i])}`;
150
- this.write(`${c.set("DIM", "│")} ${marker}\n`);
151
- }
152
- }
153
- clearOptions(count) {
154
- for (let i = 0; i < count; i++) this.write("\x1B[1A\x1B[2K");
155
- }
156
- writeActiveMarker(question) {
157
- this.write(`${this.color.set("CYAN", "◆")} ${question}\n`);
158
- }
159
- clearActiveMarker() {
160
- this.write("\x1B[1A\x1B[2K");
161
- }
162
- writeCompletedMarker(question) {
163
- this.write(`${this.color.set("DIM", "◇")} ${question}\n`);
164
- }
165
- writeAnswer(value) {
166
- this.write(`${this.color.set("DIM", "│")} ${this.color.set("DIM", value)}\n`);
167
- }
168
- write(str) {
169
- stdout.write(str);
170
- }
171
- createPromptInterface() {
172
- return createInterface({
173
- input: stdin,
174
- output: stdout
175
- });
176
- }
177
- };
178
- //#endregion
179
- //#region ../../src/command/helpers/Asker.ts
180
18
  var Asker = class {
181
19
  log = $logger();
182
20
  ask;
183
21
  alepha = $inject(Alepha);
184
- pretty = $inject(PrettyAsker);
185
22
  constructor() {
186
23
  this.ask = this.createAskMethod();
187
24
  }
@@ -190,45 +27,23 @@ var Asker = class {
190
27
  return await this.prompt(question, options);
191
28
  };
192
29
  askFn.permission = async (question) => {
193
- if (this.pretty.enabled) return this.pretty.confirm(question);
194
- return (await this.prompt(`${question} [Y/n]`, { schema: t.enum([
30
+ return (await this.prompt(`${question} [Y/n]`, { schema: z.enum([
195
31
  "Y",
196
32
  "y",
197
33
  "n",
198
34
  "no",
199
35
  "yes"
200
- ], { default: "Y" }) })).charAt(0).toLowerCase() === "y";
36
+ ]).default("Y") })).charAt(0).toLowerCase() === "y";
201
37
  };
202
38
  askFn.intro = (title) => {
203
- if (this.pretty.enabled) this.pretty.intro(title);
39
+ this.log.info(title);
204
40
  };
205
41
  askFn.outro = (message) => {
206
- if (this.pretty.enabled) this.pretty.outro(message);
42
+ if (message) this.log.info(message);
207
43
  };
208
44
  return askFn;
209
45
  }
210
46
  async prompt(question, options) {
211
- if (this.pretty.enabled) return this.prettyPrompt(question, options);
212
- return this.plainPrompt(question, options);
213
- }
214
- /**
215
- * Pretty mode: delegate to PrettyAsker based on schema type.
216
- */
217
- async prettyPrompt(question, options) {
218
- const schema = options.schema;
219
- if (schema?.enum && Array.isArray(schema.enum)) {
220
- const value = await this.pretty.select(question, schema.enum);
221
- if (options.validate) options.validate(value);
222
- return value;
223
- }
224
- const value = await this.pretty.text(question, schema);
225
- if (options.validate) options.validate(value);
226
- return value;
227
- }
228
- /**
229
- * Plain mode: readline-based prompts (CI, Claude Code, debug).
230
- */
231
- async plainPrompt(question, options) {
232
47
  const rl = this.createPromptInterface();
233
48
  let value;
234
49
  try {
@@ -236,8 +51,10 @@ var Asker = class {
236
51
  try {
237
52
  this.log.info(question);
238
53
  const answer = await rl.question("> ");
239
- if (options.schema) value = this.alepha.codec.decode(options.schema, answer ? answer.trim() : void 0);
240
- else value = String(answer.trim());
54
+ if (options.schema) {
55
+ const raw = answer ? answer.trim() : void 0;
56
+ value = this.alepha.codec.decode(options.schema, raw === void 0 ? void 0 : coerceScalar(options.schema, raw));
57
+ } else value = String(answer.trim());
241
58
  if (options.validate) options.validate(value);
242
59
  } catch (error) {
243
60
  if (error instanceof AlephaError) {
@@ -315,259 +132,41 @@ var EnvUtils = class {
315
132
  }
316
133
  };
317
134
  //#endregion
318
- //#region ../../src/command/helpers/PrettyPrint.ts
319
- var PrettyPrint = class {
320
- dateTimeProvider = $inject(DateTimeProvider);
321
- spinnerInterval;
322
- frames = [
323
- "⠋",
324
- "⠙",
325
- "⠹",
326
- "⠸",
327
- "⠼",
328
- "⠴",
329
- "⠦",
330
- "⠧",
331
- "⠇",
332
- "⠏"
333
- ];
334
- tasks = /* @__PURE__ */ new Map();
335
- lastLineCount = 0;
336
- header;
337
- commandStartTime;
338
- paused = false;
339
- originalStdoutWrite;
340
- bufferedOutput = [];
341
- isOwnWrite = false;
342
- colors = {
343
- reset: "\x1B[0m",
344
- cyan: "\x1B[36m",
345
- green: "\x1B[32m",
346
- red: "\x1B[31m",
347
- dim: "\x1B[2m"
348
- };
349
- /**
350
- * Start a new command session with header
351
- */
352
- startCommand(cliName, commandName) {
353
- this.header = commandName ? `${cliName} ${commandName}` : cliName;
354
- this.commandStartTime = this.dateTimeProvider.nowMillis();
355
- this.tasks.clear();
356
- this.lastLineCount = 0;
357
- this.write(`┌─ ${this.header}\n`);
358
- }
359
- /**
360
- * End the command session with footer
361
- */
362
- endCommand() {
363
- this.restoreStdout();
364
- if (this.commandStartTime) {
365
- const totalDuration = ((this.dateTimeProvider.nowMillis() - this.commandStartTime) / 1e3).toFixed(1);
366
- this.write(`└─ Done in ${totalDuration}s\n`);
367
- }
368
- this.header = void 0;
369
- this.commandStartTime = void 0;
370
- }
371
- /**
372
- * Start an animated spinner with a task name
373
- */
374
- startSpinner(id, taskName) {
375
- this.tasks.set(id, {
376
- taskName,
377
- frameIndex: 0,
378
- status: "running",
379
- startTime: this.dateTimeProvider.nowMillis()
380
- });
381
- this.interceptStdout();
382
- if (!this.spinnerInterval) this.spinnerInterval = this.dateTimeProvider.createInterval(() => this.updateDisplay(), 80, true);
383
- this.updateDisplay();
384
- }
385
- /**
386
- * Stop the spinner and show success with a tick
387
- */
388
- success(id, taskName, duration, message) {
389
- const task = this.tasks.get(id);
390
- if (task) {
391
- task.status = "success";
392
- if (taskName) task.taskName = taskName;
393
- if (duration) task.duration = duration;
394
- if (message) task.message = message;
395
- this.updateDisplay();
396
- }
397
- this.checkIfAllDone();
398
- }
399
- /**
400
- * Stop the spinner and show error with a cross
401
- */
402
- error(id, taskName) {
403
- const task = this.tasks.get(id);
404
- if (task) {
405
- task.status = "error";
406
- if (taskName) task.taskName = taskName;
407
- this.updateDisplay();
408
- }
409
- this.checkIfAllDone();
410
- this.restoreStdout();
411
- }
412
- /**
413
- * Update the display for all tasks
414
- */
415
- updateDisplay() {
416
- if (this.lastLineCount > 0) for (let i = 0; i < this.lastLineCount; i++) this.write("\x1B[1A\x1B[2K");
417
- if (this.bufferedOutput.length > 0) {
418
- for (const chunk of this.bufferedOutput) this.write(chunk);
419
- this.bufferedOutput = [];
420
- }
421
- const taskArray = Array.from(this.tasks.values());
422
- const prefix = this.header ? "│ " : "";
423
- for (const task of taskArray) {
424
- let line = prefix;
425
- if (task.status === "running") {
426
- const frame = this.frames[task.frameIndex];
427
- const elapsed = String(Math.floor((this.dateTimeProvider.nowMillis() - task.startTime) / 100) / 10).padEnd(3, ".0");
428
- line += `${this.colors.cyan}${frame}${this.colors.reset} ${this.colors.dim}${task.taskName}${this.colors.reset} ${this.colors.dim}${elapsed}s${this.colors.reset}`;
429
- task.frameIndex = (task.frameIndex + 1) % this.frames.length;
430
- } else if (task.status === "success") {
431
- const durationStr = task.duration ? ` ${this.colors.dim}${task.duration}${this.colors.reset}` : "";
432
- const messageStr = task.message ? ` - ${task.message}` : "";
433
- line += `${this.colors.green}✓${this.colors.reset} ${task.taskName}${durationStr}${messageStr}`;
434
- } else if (task.status === "error") line += `${this.colors.red}✗${this.colors.reset} ${task.taskName}`;
435
- this.write(`${line}\n`);
436
- }
437
- this.lastLineCount = taskArray.length;
438
- }
439
- /**
440
- * Check if all tasks are done and stop the interval
441
- */
442
- checkIfAllDone() {
443
- if (!Array.from(this.tasks.values()).some((task) => task.status === "running") && this.spinnerInterval) {
444
- this.dateTimeProvider.clearInterval(this.spinnerInterval);
445
- this.spinnerInterval = void 0;
446
- }
447
- }
448
- /**
449
- * Pause the spinner animation and restore stdout so external processes
450
- * (e.g. interactive login) can write to the terminal directly.
451
- */
452
- pause() {
453
- if (this.paused) return;
454
- this.paused = true;
455
- this.stopSpinner();
456
- if (this.lastLineCount > 0) {
457
- for (let i = 0; i < this.lastLineCount; i++) this.write("\x1B[1A\x1B[2K");
458
- this.lastLineCount = 0;
459
- }
460
- if (this.header) this.write("└───\n\n");
461
- this.restoreStdout();
462
- }
463
- /**
464
- * Resume the spinner animation after a pause.
465
- */
466
- resume() {
467
- if (!this.paused) return;
468
- this.paused = false;
469
- if (this.header) this.write("\n┌───\n");
470
- this.interceptStdout();
471
- if (Array.from(this.tasks.values()).some((task) => task.status === "running")) {
472
- this.updateDisplay();
473
- if (!this.spinnerInterval) this.spinnerInterval = this.dateTimeProvider.createInterval(() => this.updateDisplay(), 80, true);
474
- }
475
- }
476
- /**
477
- * Stop the spinner without showing any symbol
478
- */
479
- stopSpinner() {
480
- if (this.spinnerInterval) {
481
- this.dateTimeProvider.clearInterval(this.spinnerInterval);
482
- this.spinnerInterval = void 0;
483
- }
484
- }
485
- /**
486
- * Clear all tasks
487
- */
488
- clear() {
489
- this.tasks.clear();
490
- this.stopSpinner();
491
- this.restoreStdout();
492
- this.lastLineCount = 0;
493
- }
494
- /**
495
- * Intercept process.stdout.write so external writes (logs, wrangler output)
496
- * are buffered instead of breaking the spinner animation. Buffered output is
497
- * flushed above the spinner area on each redraw.
498
- */
499
- interceptStdout() {
500
- if (this.originalStdoutWrite) return;
501
- const original = process.stdout.write.bind(process.stdout);
502
- this.originalStdoutWrite = original;
503
- process.stdout.write = ((chunk, encodingOrCb, cb) => {
504
- if (this.isOwnWrite) return original(chunk, encodingOrCb, cb);
505
- this.bufferedOutput.push(String(chunk));
506
- return true;
507
- });
508
- }
509
- /**
510
- * Restore the original process.stdout.write and flush remaining buffer.
511
- */
512
- restoreStdout() {
513
- if (!this.originalStdoutWrite) return;
514
- const original = this.originalStdoutWrite;
515
- this.originalStdoutWrite = void 0;
516
- process.stdout.write = original;
517
- for (const chunk of this.bufferedOutput) original(chunk);
518
- this.bufferedOutput = [];
519
- }
520
- /**
521
- * Write to stdout bypassing the intercept.
522
- */
523
- write(str) {
524
- this.isOwnWrite = true;
525
- process.stdout.write(str);
526
- this.isOwnWrite = false;
527
- }
528
- };
529
- //#endregion
530
135
  //#region ../../src/command/errors/CommandError.ts
531
136
  var CommandError = class extends AlephaError {
532
137
  name = "CommandError";
533
138
  };
534
139
  //#endregion
535
140
  //#region ../../src/command/helpers/Runner.ts
141
+ /**
142
+ * Runs CLI tasks (shell commands or functions) and logs their lifecycle.
143
+ *
144
+ * Output is intentionally plain and verbose: every task logs a
145
+ * `Starting …` / `Finished … after Ns` line through the standard logger,
146
+ * and shelled commands **stream** their stdout/stderr straight to the
147
+ * terminal (`capture: false`) so tool output — `vite build` warnings,
148
+ * Biome diagnostics, nested `alepha` subcommands — is visible live.
149
+ */
536
150
  var Runner = class {
537
151
  log = $logger();
538
152
  dateTime = $inject(DateTimeProvider);
539
153
  timers = [];
540
154
  startTime = this.dateTime.nowMillis();
541
- prettyPrint = $inject(PrettyPrint);
542
155
  alepha = $inject(Alepha);
543
156
  shell = $inject(ShellProvider);
544
157
  run;
545
- cliName = "";
546
- commandName = "";
547
- firstTaskStarted = false;
548
- taskCounter = 0;
549
158
  constructor() {
550
159
  this.run = this.createRunMethod();
551
160
  }
552
- get useDynamicLogger() {
553
- if (this.alepha.isCI() || this.alepha.env.CLAUDECODE) return false;
554
- const logLevel = String(this.alepha.store.get("alepha.logger.level") ?? this.alepha.env.LOG_LEVEL ?? "").toLowerCase();
555
- if (logLevel === "debug" || logLevel === "trace") return false;
556
- return (this.alepha.store.get("alepha.logger.format") ?? this.alepha.env.LOG_FORMAT) === "raw";
557
- }
558
161
  /**
559
- * Start a new command session with header (for pretty print mode)
162
+ * Start a new command session.
163
+ *
164
+ * Retained for API compatibility (the CLI calls it before each command);
165
+ * task lifecycle is now logged statelessly, so there is nothing to reset.
560
166
  */
561
- startCommand(cliName, commandName) {
562
- this.cliName = cliName;
563
- this.commandName = commandName;
564
- this.firstTaskStarted = false;
565
- this.taskCounter = 0;
566
- }
167
+ startCommand(_cliName, _commandName) {}
567
168
  createRunMethod() {
568
169
  const runFn = async (cmd, options) => {
569
- if (this.useDynamicLogger && !this.firstTaskStarted) this.prettyPrint.startCommand(this.cliName, this.commandName);
570
- this.firstTaskStarted = true;
571
170
  const root = typeof options === "object" && options.root ? options.root : void 0;
572
171
  if (Array.isArray(cmd)) return await this.execute(cmd.map((it) => typeof it === "string" ? {
573
172
  name: it,
@@ -610,18 +209,13 @@ var Runner = class {
610
209
  }, options);
611
210
  };
612
211
  runFn.end = () => this.end();
613
- runFn.pause = () => {
614
- if (this.useDynamicLogger) this.prettyPrint.pause();
615
- };
616
- runFn.resume = () => {
617
- if (this.useDynamicLogger) this.prettyPrint.resume();
618
- };
619
212
  return runFn;
620
213
  }
621
214
  async exec(cmd, opts = {}) {
215
+ const stream = this.log.isLevelEnabled("DEBUG");
622
216
  return this.shell.run(cmd, {
623
217
  root: opts.root,
624
- capture: true
218
+ capture: !stream
625
219
  });
626
220
  }
627
221
  /**
@@ -639,55 +233,34 @@ var Runner = class {
639
233
  * Prints a summary of all executed tasks and their durations.
640
234
  */
641
235
  end() {
642
- if (this.useDynamicLogger && this.firstTaskStarted) {
643
- this.prettyPrint.endCommand();
644
- return;
645
- }
646
236
  if (this.timers.length === 0) return;
647
- this.log.info("");
648
237
  const totalTime = ((this.dateTime.nowMillis() - this.startTime) / 1e3).toFixed(1);
649
238
  this.log.info(`Total time: ${totalTime}s`);
650
- this.log.info(``);
651
239
  this.timers = [];
652
240
  }
653
241
  async executeTask(task) {
654
242
  const now = this.dateTime.nowMillis();
655
- const taskId = `task-${++this.taskCounter}`;
656
- if (this.useDynamicLogger) this.prettyPrint.startSpinner(taskId, task.name);
657
- else this.log.info(`Starting '${task.name}' ...`);
243
+ this.log.info(`Starting '${task.name}' ...`);
658
244
  let stdout = "";
659
245
  try {
660
246
  stdout = String(await task.handler() ?? "");
661
247
  } catch (error) {
662
- if (this.useDynamicLogger) this.prettyPrint.error(taskId, task.name);
663
- if (error instanceof Error && "stdout" in error) this.log.info(`\n\n${error.stdout}`);
248
+ const err = error;
249
+ const captured = [err?.stdout, err?.stderr].filter(Boolean).join("\n").trim();
250
+ if (captured) this.log.info(`\n\n${captured}`);
664
251
  throw new CommandError(`Task '${task.name}' failed`, { cause: error });
665
252
  }
666
253
  if (stdout) this.log.trace(stdout);
667
254
  const duration = ((this.dateTime.nowMillis() - now) / 1e3).toFixed(1);
668
255
  const message = stdout && !stdout.includes("\n") ? stdout.trim() : void 0;
669
- if (this.useDynamicLogger) this.prettyPrint.success(taskId, task.name, `${duration}s`, message);
670
- else {
671
- const suffix = message ? ` - ${message}` : "";
672
- this.log.info(`Finished '${task.name}' after ${duration}s${suffix}`);
673
- }
256
+ const suffix = message ? ` - ${message}` : "";
257
+ this.log.info(`Finished '${task.name}' after ${duration}s${suffix}`);
674
258
  this.timers.push({
675
259
  name: task.name,
676
260
  duration: `${duration}s`
677
261
  });
678
262
  return stdout;
679
263
  }
680
- renderTable(data) {
681
- if (data.length === 0) return;
682
- const col1Width = Math.max(...data.map(([col1]) => col1.length), 7);
683
- const col2Width = Math.max(...data.map(([, col2]) => col2.length), 8);
684
- const divider = `+${"-".repeat(col1Width + 2)}+${"-".repeat(col2Width + 2)}+`;
685
- this.log.info(divider);
686
- this.log.info(`| ${"Command".padEnd(col1Width)} | ${"Duration".padEnd(col2Width)} |`);
687
- this.log.info(divider);
688
- for (const [col1, col2] of data) this.log.info(`| ${col1.padEnd(col1Width)} | ${col2.padEnd(col2Width)} |`);
689
- this.log.info(divider);
690
- }
691
264
  };
692
265
  //#endregion
693
266
  //#region ../../src/command/primitives/$command.ts
@@ -699,8 +272,8 @@ var Runner = class {
699
272
  */
700
273
  const $command = (options) => createPrimitive(CommandPrimitive, options);
701
274
  var CommandPrimitive = class extends Primitive {
702
- flags = this.options.flags ?? t.object({});
703
- env = this.options.env ?? t.object({});
275
+ flags = this.options.flags ?? z.object({});
276
+ env = this.options.env ?? z.object({});
704
277
  aliases = this.options.aliases ?? [];
705
278
  onInit() {
706
279
  if (this.options.pre || this.options.post) this.options.hide ??= true;
@@ -733,12 +306,12 @@ var CommandPrimitive = class extends Primitive {
733
306
  $command[KIND] = CommandPrimitive;
734
307
  //#endregion
735
308
  //#region ../../src/command/providers/CliProvider.ts
736
- const envSchema = t.object({
737
- CLI_NAME: t.text({
309
+ const envSchema = z.object({
310
+ CLI_NAME: z.text({
738
311
  default: "cli",
739
312
  description: "Name of the CLI application."
740
313
  }),
741
- CLI_DESCRIPTION: t.text({
314
+ CLI_DESCRIPTION: z.text({
742
315
  default: "",
743
316
  description: "Description of the CLI application."
744
317
  })
@@ -748,10 +321,10 @@ const envSchema = t.object({
748
321
  */
749
322
  const cliOptions = $atom({
750
323
  name: "alepha.command.cli.options",
751
- schema: t.object({
752
- name: t.optional(t.string({ description: "Name of the CLI application." })),
753
- description: t.optional(t.string({ description: "Description of the CLI application." })),
754
- argv: t.optional(t.array(t.string(), { description: "Command line arguments to parse." }))
324
+ schema: z.object({
325
+ name: z.string().describe("Name of the CLI application.").optional(),
326
+ description: z.string().describe("Description of the CLI application.").optional(),
327
+ argv: z.array(z.string()).describe("Command line arguments to parse.").optional()
755
328
  }),
756
329
  default: {}
757
330
  });
@@ -772,7 +345,7 @@ const cliOptions = $atom({
772
345
  * build = $command({
773
346
  * name: "build",
774
347
  * description: "Build the project",
775
- * flags: t.object({ watch: t.optional(t.boolean()) }),
348
+ * flags: z.object({ watch: z.boolean().optional() }),
776
349
  * handler: async ({ flags }) => { ... }
777
350
  * });
778
351
  * }
@@ -806,12 +379,12 @@ var CliProvider = class {
806
379
  help: {
807
380
  aliases: ["h", "help"],
808
381
  description: "Show this help message",
809
- schema: t.boolean()
382
+ schema: z.boolean()
810
383
  },
811
384
  verbose: {
812
385
  aliases: ["verbose"],
813
- description: "Verbose output: debug logs in plain pretty format (turns off the dynamic CLI UI).",
814
- schema: t.boolean()
386
+ description: "Verbose output: trace-level logs (framework internals) in pretty format. Task output already streams by default.",
387
+ schema: z.boolean()
815
388
  }
816
389
  };
817
390
  /**
@@ -828,8 +401,8 @@ var CliProvider = class {
828
401
  key,
829
402
  ...value
830
403
  })), { strict: false });
831
- if (globalFlags.verbose) {
832
- this.alepha.store.set("alepha.logger.level", "debug");
404
+ if (globalFlags.verbose || !!this.alepha.env.CLAUDECODE) {
405
+ this.alepha.store.set("alepha.logger.level", "trace");
833
406
  this.alepha.store.set("alepha.logger.format", "pretty");
834
407
  }
835
408
  if (globalFlags.help) {
@@ -1050,21 +623,44 @@ var CliProvider = class {
1050
623
  return { ...this.globalFlags };
1051
624
  }
1052
625
  /**
626
+ * Read a schema's metadata (`title`, `description`, `aliases`, `alias`, …).
627
+ *
628
+ * Under zod these options live on the schema's `.meta()` registry rather than
629
+ * as direct properties (typebox), and they sit on the INNER schema — so any
630
+ * optional / nullable / default wrappers are peeled first.
631
+ */
632
+ schemaMeta(schema) {
633
+ if (!schema) return {};
634
+ const base = z.schema.unwrap(schema);
635
+ return (typeof base?.meta === "function" ? base.meta() : void 0) ?? {};
636
+ }
637
+ /**
638
+ * Build flag definitions (key, aliases, description, schema) from a flags
639
+ * object schema. Centralises the metadata reading so every call-site (parsing,
640
+ * arg-splitting, help) extracts aliases/descriptions the same way.
641
+ */
642
+ extractFlagDefs(schema) {
643
+ return Object.entries(schema.properties).map(([key, value]) => {
644
+ const meta = this.schemaMeta(value);
645
+ return {
646
+ key,
647
+ aliases: [key, ...meta.aliases ?? (meta.alias ? [meta.alias] : [])],
648
+ description: meta.description,
649
+ schema: value
650
+ };
651
+ });
652
+ }
653
+ /**
1053
654
  * Parse command flags from argv using the command's flag schema
1054
655
  */
1055
656
  parseCommandFlags(argv, schema, options = {}) {
1056
657
  const { modeEnabled = false } = options;
1057
- const flagDefs = Object.entries(schema.properties).map(([key, value]) => ({
1058
- key,
1059
- aliases: [key, ...value.aliases ?? (value.alias ? [value.alias] : void 0) ?? []],
1060
- description: value.description,
1061
- schema: value
1062
- }));
658
+ const flagDefs = this.extractFlagDefs(schema);
1063
659
  if (modeEnabled) flagDefs.push({
1064
660
  key: "__mode__",
1065
661
  aliases: ["mode", "m"],
1066
662
  description: void 0,
1067
- schema: t.string()
663
+ schema: z.string()
1068
664
  });
1069
665
  const claimed = new Set(flagDefs.flatMap((d) => d.aliases));
1070
666
  for (const [key, value] of Object.entries(this.getAllGlobalFlags())) {
@@ -1079,9 +675,9 @@ var CliProvider = class {
1079
675
  const parsed = this.parseFlags(argv, flagDefs);
1080
676
  parsed.__mode__ = void 0;
1081
677
  for (const key of Object.keys(parsed)) if (key.startsWith("__global_")) delete parsed[key];
1082
- for (const [key, value] of Object.entries(schema.properties)) if (!(key in parsed) && t.schema.isOptional(value)) {
1083
- const innerSchema = value;
1084
- if (innerSchema && "default" in innerSchema) parsed[key] = innerSchema.default;
678
+ for (const [key, value] of Object.entries(schema.properties)) if (!(key in parsed)) {
679
+ const def = z.schema.getDefault(value);
680
+ if (def !== void 0) parsed[key] = def;
1085
681
  }
1086
682
  try {
1087
683
  return this.alepha.codec.decode(schema, parsed);
@@ -1099,8 +695,11 @@ var CliProvider = class {
1099
695
  for (const [key, propSchema] of Object.entries(schema.properties)) {
1100
696
  const value = process.env[key];
1101
697
  if (value !== void 0) result[key] = value;
1102
- else if ("default" in propSchema) result[key] = propSchema.default;
1103
- else if (t.schema.isOptional(propSchema)) {} else missing.push(key);
698
+ else {
699
+ const def = z.schema.getDefault(propSchema);
700
+ if (def !== void 0) result[key] = def;
701
+ else if (z.schema.isOptional(propSchema)) {} else missing.push(key);
702
+ }
1104
703
  }
1105
704
  if (missing.length > 0) {
1106
705
  const vars = missing.join(", ");
@@ -1146,42 +745,47 @@ var CliProvider = class {
1146
745
  const arg = argv[i];
1147
746
  if (!arg.startsWith("-")) continue;
1148
747
  const [rawKey, ...valueParts] = arg.replace(/^-{1,2}/, "").split("=");
1149
- let value = valueParts.join("=");
748
+ const value = valueParts.join("=");
1150
749
  const def = flagDefs.find((d) => d.aliases.includes(rawKey));
1151
750
  if (!def) {
1152
751
  if (strict) throw new CommandError(`Unknown flag: --${rawKey}`);
1153
752
  continue;
1154
753
  }
1155
- const isUnionWithBoolean = t.schema.isUnion(def.schema) && def.schema.anyOf.some((s) => t.schema.isBoolean(s));
1156
- if (t.schema.isBoolean(def.schema)) result[def.key] = true;
754
+ const base = z.schema.unwrap(def.schema);
755
+ const isUnionWithBoolean = z.schema.isUnion(base) && base.anyOf.some((s) => z.schema.isBoolean(s));
756
+ if (z.schema.isBoolean(base)) result[def.key] = true;
1157
757
  else if (isUnionWithBoolean && !value) {
1158
758
  const nextArg = argv[i + 1];
1159
759
  if (nextArg && !nextArg.startsWith("-")) {
1160
760
  result[def.key] = nextArg;
1161
761
  i++;
1162
762
  } else result[def.key] = true;
1163
- } else if (value) try {
1164
- if (t.schema.isObject(def.schema) || t.schema.isArray(def.schema)) result[def.key] = JSON.parse(value);
1165
- else result[def.key] = value;
1166
- } catch {
1167
- throw new CommandError(`Invalid JSON value for flag --${rawKey}`);
1168
- }
763
+ } else if (value) result[def.key] = this.castFlagValue(value, base, rawKey);
1169
764
  else {
1170
765
  const nextArg = argv[i + 1];
1171
- if (nextArg && !nextArg.startsWith("-")) {
1172
- value = nextArg;
1173
- try {
1174
- if (t.schema.isObject(def.schema) || t.schema.isArray(def.schema)) result[def.key] = JSON.parse(value);
1175
- else result[def.key] = value;
1176
- } catch {
1177
- throw new CommandError(`Invalid JSON value for flag --${rawKey}`);
1178
- }
1179
- } else throw new CommandError(`Flag --${rawKey} requires a value.`);
766
+ if (nextArg && !nextArg.startsWith("-")) result[def.key] = this.castFlagValue(nextArg, base, rawKey);
767
+ else throw new CommandError(`Flag --${rawKey} requires a value.`);
1180
768
  }
1181
769
  }
1182
770
  return result;
1183
771
  }
1184
772
  /**
773
+ * Convert a raw flag value string into the value its schema expects.
774
+ *
775
+ * zod no longer coerces, so scalar values (number / integer / boolean) are
776
+ * cast + validated via {@link parseArgumentValue} (same path as positional
777
+ * args); object / array / record values are JSON-parsed. `schema` is expected
778
+ * to already be unwrapped of optional/nullable/default.
779
+ */
780
+ castFlagValue(value, schema, rawKey) {
781
+ if (z.schema.isObject(schema) || z.schema.isArray(schema) || z.schema.isRecord(schema)) try {
782
+ return JSON.parse(value);
783
+ } catch {
784
+ throw new CommandError(`Invalid JSON value for flag --${rawKey}`);
785
+ }
786
+ return this.parseArgumentValue(value, schema);
787
+ }
788
+ /**
1185
789
  * Get indices of argv elements consumed by flags (for separating args from flags)
1186
790
  */
1187
791
  getFlagConsumedIndices(argv, flagDefs) {
@@ -1194,8 +798,9 @@ var CliProvider = class {
1194
798
  const hasEqualValue = valueParts.length > 0;
1195
799
  const def = flagDefs.find((d) => d.aliases.includes(rawKey));
1196
800
  if (!def) continue;
1197
- const isUnionWithBoolean = t.schema.isUnion(def.schema) && def.schema.anyOf.some((s) => t.schema.isBoolean(s));
1198
- if (!t.schema.isBoolean(def.schema) && !isUnionWithBoolean && !hasEqualValue) {
801
+ const base = z.schema.unwrap(def.schema);
802
+ const isUnionWithBoolean = z.schema.isUnion(base) && base.anyOf.some((s) => z.schema.isBoolean(s));
803
+ if (!z.schema.isBoolean(base) && !isUnionWithBoolean && !hasEqualValue) {
1199
804
  const nextArg = argv[i + 1];
1200
805
  if (nextArg && !nextArg.startsWith("-")) consumed.add(i + 1);
1201
806
  } else if (isUnionWithBoolean && !hasEqualValue) {
@@ -1207,25 +812,21 @@ var CliProvider = class {
1207
812
  }
1208
813
  parseCommandArgs(argv, schema, isRootCommand = false, flagSchema) {
1209
814
  if (!schema) return;
1210
- const flagDefs = flagSchema ? Object.entries(flagSchema.properties).map(([key, value]) => ({
1211
- key,
1212
- aliases: [key, ...value.aliases ?? (value.alias ? [value.alias] : void 0) ?? []],
1213
- schema: value
1214
- })) : [];
815
+ const flagDefs = flagSchema ? this.extractFlagDefs(flagSchema) : [];
1215
816
  const consumedIndices = this.getFlagConsumedIndices(argv, flagDefs);
1216
817
  const positionalArgs = argv.filter((arg, idx) => !arg.startsWith("-") && !consumedIndices.has(idx));
1217
818
  const argsOnly = isRootCommand ? positionalArgs : positionalArgs.slice(1);
1218
819
  try {
1219
- if (t.schema.isOptional(schema)) {
820
+ if (z.schema.isOptional(schema)) {
1220
821
  if (argsOnly.length === 0) return;
1221
822
  return this.parseArgumentValue(argsOnly[0], schema);
1222
- } else if (t.schema.isTuple(schema) && schema.items) {
823
+ } else if (z.schema.isTuple(schema) && schema.items) {
1223
824
  const result = [];
1224
825
  const items = schema.items;
1225
826
  for (let i = 0; i < items.length; i++) {
1226
827
  const itemSchema = items[i];
1227
828
  if (i < argsOnly.length) result.push(this.parseArgumentValue(argsOnly[i], itemSchema));
1228
- else if (t.schema.isOptional(itemSchema)) result.push(void 0);
829
+ else if (z.schema.isOptional(itemSchema)) result.push(void 0);
1229
830
  else throw new CommandError(`Missing required argument at position ${i + 1}`);
1230
831
  }
1231
832
  return result;
@@ -1242,14 +843,14 @@ var CliProvider = class {
1242
843
  * Convert a string argument value to the appropriate type based on schema
1243
844
  */
1244
845
  parseArgumentValue(value, schema) {
1245
- if (t.schema.isString(schema)) return value;
1246
- if (t.schema.isNumber(schema) || t.schema.isInteger(schema)) {
846
+ if (z.schema.isString(schema)) return value;
847
+ if (z.schema.isNumber(schema) || z.schema.isInteger(schema)) {
1247
848
  const num = Number(value);
1248
849
  if (Number.isNaN(num)) throw new CommandError(`Expected number, got "${value}"`);
1249
- if (t.schema.isInteger(schema) && !Number.isInteger(num)) throw new CommandError(`Expected integer, got "${value}"`);
850
+ if (z.schema.isInteger(schema) && !Number.isInteger(num)) throw new CommandError(`Expected integer, got "${value}"`);
1250
851
  return num;
1251
852
  }
1252
- if (t.schema.isBoolean(schema)) {
853
+ if (z.schema.isBoolean(schema)) {
1253
854
  const lower = value.toLowerCase();
1254
855
  if (lower === "true" || lower === "1") return true;
1255
856
  if (lower === "false" || lower === "0") return false;
@@ -1262,28 +863,29 @@ var CliProvider = class {
1262
863
  */
1263
864
  generateArgsUsage(schema) {
1264
865
  if (!schema) return "";
1265
- if (t.schema.isOptional(schema)) {
866
+ if (z.schema.isOptional(schema)) {
1266
867
  const typeName = this.getTypeName(schema);
1267
- return ` [${"title" in schema ? schema.title : "arg1"}${typeName}]`;
868
+ return ` [${this.schemaMeta(schema).title ?? "arg1"}${typeName}]`;
1268
869
  }
1269
- if (t.schema.isTuple(schema) && schema.items) return ` ${schema.items.map((item, index) => {
870
+ if (z.schema.isTuple(schema) && schema.items) return ` ${schema.items.map((item, index) => {
1270
871
  const argName = `arg${index + 1}`;
1271
872
  const typeName = this.getTypeName(item);
1272
- if (t.schema.isOptional(item)) return `[${argName}${typeName}]`;
873
+ if (z.schema.isOptional(item)) return `[${argName}${typeName}]`;
1273
874
  return `<${argName}${typeName}>`;
1274
875
  }).join(" ")}`;
1275
876
  const typeName = this.getTypeName(schema);
1276
- return ` <${"title" in schema ? schema.title : "arg1"}${typeName}>`;
877
+ return ` <${this.schemaMeta(schema).title ?? "arg1"}${typeName}>`;
1277
878
  }
1278
879
  /**
1279
880
  * Get display type name for a schema (e.g., ": number", ": boolean")
1280
881
  */
1281
882
  getTypeName(schema) {
1282
883
  if (!schema) return "";
1283
- if (t.schema.isString(schema)) return "";
1284
- if (t.schema.isNumber(schema)) return ": number";
1285
- if (t.schema.isInteger(schema)) return ": integer";
1286
- if (t.schema.isBoolean(schema)) return ": boolean";
884
+ const base = z.schema.unwrap(schema);
885
+ if (z.schema.isString(base)) return "";
886
+ if (z.schema.isInteger(base)) return ": integer";
887
+ if (z.schema.isNumber(base)) return ": number";
888
+ if (z.schema.isBoolean(base)) return ": boolean";
1287
889
  return "";
1288
890
  }
1289
891
  /**
@@ -1293,6 +895,7 @@ var CliProvider = class {
1293
895
  * If omitted, shows general CLI help with all commands.
1294
896
  */
1295
897
  printHelp(command) {
898
+ this.alepha.store.set("alepha.logger.format", "raw");
1296
899
  const cliName = this.name || "cli";
1297
900
  const c = this.color;
1298
901
  this.log.info("");
@@ -1322,17 +925,12 @@ var CliProvider = class {
1322
925
  this.log.info("");
1323
926
  this.log.info(c.set("WHITE_BOLD", "Flags:"));
1324
927
  const flags = [
1325
- ...Object.entries(command.flags.properties).map(([key, value]) => ({
1326
- key,
1327
- schema: value,
1328
- aliases: [key, ...value.aliases ?? (value.alias ? [value.alias] : [])],
1329
- description: value.description
1330
- })),
928
+ ...this.extractFlagDefs(command.flags),
1331
929
  ...command.options.mode ? [{
1332
930
  key: "mode",
1333
931
  aliases: ["m", "mode"],
1334
932
  description: typeof command.options.mode === "string" ? `Environment mode - loads .env.{mode} (default: ${command.options.mode})` : "Environment mode (e.g., production, staging) - loads .env.{mode}",
1335
- schema: t.string()
933
+ schema: z.string()
1336
934
  }] : [],
1337
935
  ...Object.entries(this.getAllGlobalFlags()).map(([key, value]) => ({
1338
936
  key,
@@ -1355,7 +953,7 @@ var CliProvider = class {
1355
953
  this.log.info(c.set("WHITE_BOLD", "Env:"));
1356
954
  const maxEnvLength = Math.max(...envVars.map(([key]) => key.length));
1357
955
  for (const [key, schema] of envVars) {
1358
- const isOptional = t.schema.isOptional(schema);
956
+ const isOptional = z.schema.isOptional(schema);
1359
957
  const description = schema.description ?? "";
1360
958
  const optionalStr = isOptional ? c.set("GREY_DARK", " (optional)") : c.set("RED", " (required)");
1361
959
  const coloredKey = c.set("CYAN", key);
@@ -1379,12 +977,7 @@ var CliProvider = class {
1379
977
  this.log.info("");
1380
978
  this.log.info(c.set("WHITE_BOLD", "Flags:"));
1381
979
  const rootCommand = this.commands.find((cmd) => cmd.name === "");
1382
- const globalFlags = [...rootCommand ? Object.entries(rootCommand.flags.properties).map(([key, value]) => ({
1383
- key,
1384
- aliases: [key, ...value.aliases ?? (value.alias ? [value.alias] : void 0) ?? []],
1385
- description: value.description,
1386
- schema: value
1387
- })) : [], ...Object.values(this.getAllGlobalFlags())];
980
+ const globalFlags = [...rootCommand ? this.extractFlagDefs(rootCommand.flags) : [], ...Object.values(this.getAllGlobalFlags())];
1388
981
  const maxFlagLength = this.getMaxFlagLength(globalFlags);
1389
982
  for (const { aliases, description, schema } of globalFlags) {
1390
983
  const flagStr = aliases.map((a) => a.length === 1 ? `-${a}` : `--${a}`).join(", ");
@@ -1402,19 +995,19 @@ var CliProvider = class {
1402
995
  generateColoredArgsUsage(schema) {
1403
996
  if (!schema) return "";
1404
997
  const c = this.color;
1405
- if (t.schema.isOptional(schema)) {
998
+ if (z.schema.isOptional(schema)) {
1406
999
  const typeName = this.getTypeName(schema);
1407
- const key = "title" in schema ? schema.title : "arg1";
1000
+ const key = this.schemaMeta(schema).title ?? "arg1";
1408
1001
  return ` ${c.set("GREY_DARK", `[${key}${typeName}]`)}`;
1409
1002
  }
1410
- if (t.schema.isTuple(schema) && schema.items) return ` ${schema.items.map((item, index) => {
1003
+ if (z.schema.isTuple(schema) && schema.items) return ` ${schema.items.map((item, index) => {
1411
1004
  const argName = `arg${index + 1}`;
1412
1005
  const typeName = this.getTypeName(item);
1413
- if (t.schema.isOptional(item)) return c.set("GREY_DARK", `[${argName}${typeName}]`);
1006
+ if (z.schema.isOptional(item)) return c.set("GREY_DARK", `[${argName}${typeName}]`);
1414
1007
  return c.set("CYAN", `<${argName}${typeName}>`);
1415
1008
  }).join(" ")}`;
1416
1009
  const typeName = this.getTypeName(schema);
1417
- const key = "title" in schema ? schema.title : "arg1";
1010
+ const key = this.schemaMeta(schema).title ?? "arg1";
1418
1011
  return ` ${c.set("CYAN", `<${key}${typeName}>`)}`;
1419
1012
  }
1420
1013
  /**
@@ -1475,12 +1068,19 @@ var CliProvider = class {
1475
1068
  */
1476
1069
  getEnumValues(schema) {
1477
1070
  if (!schema) return void 0;
1478
- if ("enum" in schema && Array.isArray(schema.enum) && schema.enum.every((v) => typeof v === "string")) return schema.enum;
1479
- if (t.schema.isUnion(schema)) {
1480
- const union = schema;
1071
+ const base = z.schema.unwrap(schema);
1072
+ if (z.schema.isEnum(base)) {
1073
+ const values = z.schema.enumValues(base);
1074
+ return values.length > 0 && values.every((v) => typeof v === "string") ? values : void 0;
1075
+ }
1076
+ if (z.schema.isUnion(base)) {
1077
+ const variants = base.anyOf ?? [];
1481
1078
  const values = [];
1482
- for (const variant of union.anyOf) if (t.schema.isString(variant) && "const" in variant && typeof variant.const === "string") values.push(variant.const);
1483
- else return;
1079
+ for (const variant of variants) {
1080
+ const value = variant.value;
1081
+ if (z.schema.isLiteral(variant) && typeof value === "string") values.push(value);
1082
+ else return;
1083
+ }
1484
1084
  return values.length > 0 ? values : void 0;
1485
1085
  }
1486
1086
  }
@@ -1506,9 +1106,8 @@ var CliProvider = class {
1506
1106
  *
1507
1107
  * **Features:**
1508
1108
  * - CLI command definitions
1509
- * - Interactive CLI prompts
1510
- * - Command execution
1511
- * - Formatted colored output
1109
+ * - Interactive CLI prompts (plain readline)
1110
+ * - Command execution with streamed, verbose output
1512
1111
  * - Environment variable utilities
1513
1112
  * - Schema validation for CLI arguments
1514
1113
  *
@@ -1521,12 +1120,10 @@ const AlephaCommand = $module({
1521
1120
  CliProvider,
1522
1121
  Runner,
1523
1122
  Asker,
1524
- PrettyAsker,
1525
- PrettyPrint,
1526
1123
  EnvUtils
1527
1124
  ]
1528
1125
  });
1529
1126
  //#endregion
1530
- export { $command, AlephaCommand, Asker, CliProvider, CommandError, CommandPrimitive, EnvUtils, PrettyAsker, PrettyPrint, Runner, cliOptions };
1127
+ export { $command, AlephaCommand, Asker, CliProvider, CommandError, CommandPrimitive, EnvUtils, Runner, cliOptions };
1531
1128
 
1532
1129
  //# sourceMappingURL=index.js.map