@vertesia/ui 1.5.0 → 1.6.0-dev.20260918.061604Z

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 (336) hide show
  1. package/README.md +125 -0
  2. package/lib/boot/branding.d.ts +58 -0
  3. package/lib/boot/branding.d.ts.map +1 -0
  4. package/lib/boot/branding.js +62 -0
  5. package/lib/boot/branding.js.map +1 -0
  6. package/lib/boot/index.d.ts +27 -0
  7. package/lib/boot/index.d.ts.map +1 -0
  8. package/lib/boot/index.js +325 -0
  9. package/lib/boot/index.js.map +1 -0
  10. package/lib/boot/vite.d.ts +63 -0
  11. package/lib/boot/vite.d.ts.map +1 -0
  12. package/lib/boot/vite.js +108 -0
  13. package/lib/boot/vite.js.map +1 -0
  14. package/lib/core/components/shadcn/button.d.ts.map +1 -1
  15. package/lib/core/components/shadcn/button.js +1 -2
  16. package/lib/core/components/shadcn/button.js.map +1 -1
  17. package/lib/core/components/shadcn/filters/filter-styles.d.ts +1 -1
  18. package/lib/core/components/shadcn/filters/filter-styles.d.ts.map +1 -1
  19. package/lib/core/components/shadcn/filters/filter-styles.js +4 -4
  20. package/lib/core/components/shadcn/label.js +1 -1
  21. package/lib/core/components/shadcn/label.js.map +1 -1
  22. package/lib/env/index.d.ts +32 -1
  23. package/lib/env/index.d.ts.map +1 -1
  24. package/lib/env/index.js +55 -3
  25. package/lib/env/index.js.map +1 -1
  26. package/lib/features/agent/PayloadBuilder.d.ts +4 -0
  27. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  28. package/lib/features/agent/PayloadBuilder.js +6 -1
  29. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  30. package/lib/features/agent/chat/AgentRunFeedback.d.ts +66 -0
  31. package/lib/features/agent/chat/AgentRunFeedback.d.ts.map +1 -0
  32. package/lib/features/agent/chat/AgentRunFeedback.js +298 -0
  33. package/lib/features/agent/chat/AgentRunFeedback.js.map +1 -0
  34. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  35. package/lib/features/agent/chat/ModernAgentConversation.js +7 -5
  36. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  37. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
  38. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  39. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +11 -10
  40. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  41. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  42. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  43. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
  44. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  45. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +28 -7
  46. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  47. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  48. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +2 -0
  49. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  50. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts +1 -1
  51. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
  52. package/lib/features/agent/chat/hooks/useAgentPlans.js +5 -5
  53. package/lib/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
  54. package/lib/features/agent/chat/index.d.ts +1 -0
  55. package/lib/features/agent/chat/index.d.ts.map +1 -1
  56. package/lib/features/agent/chat/index.js +1 -0
  57. package/lib/features/agent/chat/index.js.map +1 -1
  58. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +8 -0
  59. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  60. package/lib/features/facets/AgentRunnerFacetsNav.js +12 -0
  61. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  62. package/lib/features/permissions/UserPermissionsProvider.d.ts +15 -1
  63. package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  64. package/lib/features/permissions/UserPermissionsProvider.js +20 -12
  65. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  66. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  67. package/lib/features/store/objects/search/DocumentSearchContext.js +6 -1
  68. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  69. package/lib/features/store/objects/selection/SelectionActions.js +1 -1
  70. package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
  71. package/lib/features/store/types/TypeRegistry.d.ts +130 -0
  72. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  73. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +130 -0
  74. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  75. package/lib/i18n/index.d.ts +5 -4
  76. package/lib/i18n/index.d.ts.map +1 -1
  77. package/lib/i18n/index.js +16 -2
  78. package/lib/i18n/index.js.map +1 -1
  79. package/lib/i18n/locales/ar.json +30 -0
  80. package/lib/i18n/locales/de.json +30 -0
  81. package/lib/i18n/locales/en.json +30 -0
  82. package/lib/i18n/locales/es.json +30 -0
  83. package/lib/i18n/locales/fr.json +30 -0
  84. package/lib/i18n/locales/it.json +30 -0
  85. package/lib/i18n/locales/ja.json +30 -0
  86. package/lib/i18n/locales/ko.json +30 -0
  87. package/lib/i18n/locales/pt.json +30 -0
  88. package/lib/i18n/locales/ru.json +30 -0
  89. package/lib/i18n/locales/tr.json +30 -0
  90. package/lib/i18n/locales/zh-TW.json +30 -0
  91. package/lib/i18n/locales/zh.json +30 -0
  92. package/lib/layout/ErrorPage.js +1 -1
  93. package/lib/layout/ErrorPage.js.map +1 -1
  94. package/lib/layout/Navbar.d.ts.map +1 -1
  95. package/lib/layout/Navbar.js +3 -2
  96. package/lib/layout/Navbar.js.map +1 -1
  97. package/lib/session/UserSession.d.ts.map +1 -1
  98. package/lib/session/UserSession.js +2 -3
  99. package/lib/session/UserSession.js.map +1 -1
  100. package/lib/session/UserSessionProvider.d.ts +2 -1
  101. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  102. package/lib/session/UserSessionProvider.js +13 -4
  103. package/lib/session/UserSessionProvider.js.map +1 -1
  104. package/lib/session/auth/composable.d.ts.map +1 -1
  105. package/lib/session/auth/composable.js +88 -3
  106. package/lib/session/auth/composable.js.map +1 -1
  107. package/lib/session/auth/domainRouting.d.ts +22 -12
  108. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  109. package/lib/session/auth/domainRouting.js +35 -21
  110. package/lib/session/auth/domainRouting.js.map +1 -1
  111. package/lib/session/auth/firebase.d.ts.map +1 -1
  112. package/lib/session/auth/firebase.js +10 -0
  113. package/lib/session/auth/firebase.js.map +1 -1
  114. package/lib/session/auth/useAuthState.d.ts +9 -4
  115. package/lib/session/auth/useAuthState.d.ts.map +1 -1
  116. package/lib/session/auth/useAuthState.js +9 -4
  117. package/lib/session/auth/useAuthState.js.map +1 -1
  118. package/lib/session/index.d.ts.map +1 -1
  119. package/lib/session/index.js +3 -1
  120. package/lib/session/index.js.map +1 -1
  121. package/lib/shell/AuthScreenPreview.d.ts +12 -0
  122. package/lib/shell/AuthScreenPreview.d.ts.map +1 -0
  123. package/lib/shell/AuthScreenPreview.js +140 -0
  124. package/lib/shell/AuthScreenPreview.js.map +1 -0
  125. package/lib/shell/BrandedAuthScreens.d.ts +19 -0
  126. package/lib/shell/BrandedAuthScreens.d.ts.map +1 -0
  127. package/lib/shell/BrandedAuthScreens.js +64 -0
  128. package/lib/shell/BrandedAuthScreens.js.map +1 -0
  129. package/lib/shell/SplashScreen.d.ts +13 -2
  130. package/lib/shell/SplashScreen.d.ts.map +1 -1
  131. package/lib/shell/SplashScreen.js +20 -19
  132. package/lib/shell/SplashScreen.js.map +1 -1
  133. package/lib/shell/VertesiaShell.d.ts +15 -4
  134. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  135. package/lib/shell/VertesiaShell.js +8 -3
  136. package/lib/shell/VertesiaShell.js.map +1 -1
  137. package/lib/shell/apps/StandaloneApp.js +5 -1
  138. package/lib/shell/apps/StandaloneApp.js.map +1 -1
  139. package/lib/shell/index.d.ts +6 -0
  140. package/lib/shell/index.d.ts.map +1 -1
  141. package/lib/shell/index.js +5 -0
  142. package/lib/shell/index.js.map +1 -1
  143. package/lib/shell/login/SignInAuthPending.js +1 -1
  144. package/lib/shell/login/SignInAuthPending.js.map +1 -1
  145. package/lib/shell/login/SignInEmailStep.d.ts.map +1 -1
  146. package/lib/shell/login/SignInEmailStep.js +2 -2
  147. package/lib/shell/login/SignInEmailStep.js.map +1 -1
  148. package/lib/shell/login/SignInFlow.d.ts +68 -0
  149. package/lib/shell/login/SignInFlow.d.ts.map +1 -0
  150. package/lib/shell/login/SignInFlow.js +108 -0
  151. package/lib/shell/login/SignInFlow.js.map +1 -0
  152. package/lib/shell/login/SignInIcons.d.ts +1 -1
  153. package/lib/shell/login/SignInIcons.d.ts.map +1 -1
  154. package/lib/shell/login/SignInPageShell.d.ts +13 -0
  155. package/lib/shell/login/SignInPageShell.d.ts.map +1 -0
  156. package/lib/shell/login/SignInPageShell.js +14 -0
  157. package/lib/shell/login/SignInPageShell.js.map +1 -0
  158. package/lib/shell/login/SignInPrimitives.d.ts +3 -3
  159. package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
  160. package/lib/shell/login/SignInPrimitives.js +13 -11
  161. package/lib/shell/login/SignInPrimitives.js.map +1 -1
  162. package/lib/shell/login/SignInRestrictedEnvStep.d.ts +5 -0
  163. package/lib/shell/login/SignInRestrictedEnvStep.d.ts.map +1 -1
  164. package/lib/shell/login/SignInRestrictedEnvStep.js +8 -4
  165. package/lib/shell/login/SignInRestrictedEnvStep.js.map +1 -1
  166. package/lib/shell/login/SigninScreen.d.ts +38 -3
  167. package/lib/shell/login/SigninScreen.d.ts.map +1 -1
  168. package/lib/shell/login/SigninScreen.js +33 -86
  169. package/lib/shell/login/SigninScreen.js.map +1 -1
  170. package/lib/shell/login/SignupForm.d.ts +3 -1
  171. package/lib/shell/login/SignupForm.d.ts.map +1 -1
  172. package/lib/shell/login/SignupForm.js +7 -3
  173. package/lib/shell/login/SignupForm.js.map +1 -1
  174. package/lib/shell/login/signInUtils.d.ts +12 -1
  175. package/lib/shell/login/signInUtils.d.ts.map +1 -1
  176. package/lib/shell/login/signInUtils.js +34 -11
  177. package/lib/shell/login/signInUtils.js.map +1 -1
  178. package/lib/vertesia-ui-boot.js +237 -0
  179. package/lib/vertesia-ui-boot.js.map +1 -0
  180. package/lib/vertesia-ui-core.js +88 -46
  181. package/lib/vertesia-ui-core.js.map +1 -1
  182. package/lib/vertesia-ui-env.js +1 -1
  183. package/lib/vertesia-ui-env.js.map +1 -1
  184. package/lib/vertesia-ui-features.js +350 -317
  185. package/lib/vertesia-ui-features.js.map +1 -1
  186. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js +5 -0
  187. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js.map +1 -0
  188. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js +5 -0
  189. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js.map +1 -0
  190. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js +5 -0
  191. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js.map +1 -0
  192. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js +5 -0
  193. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js.map +1 -0
  194. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js +5 -0
  195. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js.map +1 -0
  196. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js +5 -0
  197. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js.map +1 -0
  198. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js +5 -0
  199. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js.map +1 -0
  200. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js +5 -0
  201. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js.map +1 -0
  202. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js +5 -0
  203. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js.map +1 -0
  204. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js +5 -0
  205. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js.map +1 -0
  206. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js +5 -0
  207. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js.map +1 -0
  208. package/lib/vertesia-ui-i18n.js +2 -2
  209. package/lib/vertesia-ui-i18n.js.map +1 -1
  210. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js +5 -0
  211. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js.map +1 -0
  212. package/lib/vertesia-ui-layout.js +43 -19
  213. package/lib/vertesia-ui-layout.js.map +1 -1
  214. package/lib/vertesia-ui-rich-text.js +123 -74
  215. package/lib/vertesia-ui-rich-text.js.map +1 -1
  216. package/lib/vertesia-ui-router.js.map +1 -1
  217. package/lib/vertesia-ui-session.js +1 -1
  218. package/lib/vertesia-ui-session.js.map +1 -1
  219. package/lib/vertesia-ui-shell.js +87 -33
  220. package/lib/vertesia-ui-shell.js.map +1 -1
  221. package/lib/vertesia-ui-widgets.js +154 -98
  222. package/lib/vertesia-ui-widgets.js.map +1 -1
  223. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  224. package/llms.txt +6 -2
  225. package/package.json +45 -36
  226. package/src/__tests__/a11y.test.tsx +25 -0
  227. package/src/__tests__/theme.test.ts +91 -0
  228. package/src/boot/branding.test.ts +72 -0
  229. package/src/boot/branding.ts +108 -0
  230. package/src/boot/index.test.ts +216 -0
  231. package/src/boot/index.ts +356 -0
  232. package/src/boot/vite.test.ts +93 -0
  233. package/src/boot/vite.ts +118 -0
  234. package/src/core/components/shadcn/button.tsx +1 -2
  235. package/src/core/components/shadcn/filters/filter-styles.ts +4 -4
  236. package/src/core/components/shadcn/label.tsx +1 -1
  237. package/src/env/index.test.ts +127 -0
  238. package/src/env/index.ts +73 -3
  239. package/src/features/agent/PayloadBuilder.tsx +10 -1
  240. package/src/features/agent/chat/AgentRunFeedback.test.tsx +347 -0
  241. package/src/features/agent/chat/AgentRunFeedback.tsx +465 -0
  242. package/src/features/agent/chat/ModernAgentConversation.test.tsx +1 -1
  243. package/src/features/agent/chat/ModernAgentConversation.tsx +52 -47
  244. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +145 -0
  245. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +42 -24
  246. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +4 -0
  247. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +38 -5
  248. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +2 -0
  249. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +14 -0
  250. package/src/features/agent/chat/hooks/useAgentPlans.test.ts +52 -0
  251. package/src/features/agent/chat/hooks/useAgentPlans.ts +5 -5
  252. package/src/features/agent/chat/hooks/useFileProcessing.test.tsx +0 -5
  253. package/src/features/agent/chat/index.ts +6 -0
  254. package/src/features/facets/AgentRunnerFacetsNav.tsx +26 -0
  255. package/src/features/permissions/UserPermissionsProvider.test.tsx +50 -1
  256. package/src/features/permissions/UserPermissionsProvider.tsx +82 -44
  257. package/src/features/store/objects/search/DocumentSearchContext.ts +8 -3
  258. package/src/features/store/objects/selection/SelectionActions.tsx +4 -1
  259. package/src/i18n/index.tsx +25 -2
  260. package/src/i18n/locales/ar.json +30 -0
  261. package/src/i18n/locales/de.json +30 -0
  262. package/src/i18n/locales/en.json +30 -0
  263. package/src/i18n/locales/es.json +30 -0
  264. package/src/i18n/locales/fr.json +30 -0
  265. package/src/i18n/locales/it.json +30 -0
  266. package/src/i18n/locales/ja.json +30 -0
  267. package/src/i18n/locales/ko.json +30 -0
  268. package/src/i18n/locales/pt.json +30 -0
  269. package/src/i18n/locales/ru.json +30 -0
  270. package/src/i18n/locales/tr.json +30 -0
  271. package/src/i18n/locales/zh-TW.json +30 -0
  272. package/src/i18n/locales/zh.json +30 -0
  273. package/src/layout/ErrorPage.tsx +1 -1
  274. package/src/layout/Navbar.test.tsx +58 -0
  275. package/src/layout/Navbar.tsx +5 -2
  276. package/src/router/path.test.ts +5 -5
  277. package/src/session/UserSession.ts +2 -4
  278. package/src/session/UserSessionProvider.strict-mode.test.tsx +44 -0
  279. package/src/session/UserSessionProvider.test.ts +62 -1
  280. package/src/session/UserSessionProvider.tsx +12 -4
  281. package/src/session/auth/composable.renewal.test.ts +170 -0
  282. package/src/session/auth/composable.test.ts +23 -1
  283. package/src/session/auth/composable.ts +101 -2
  284. package/src/session/auth/domainRouting.test.ts +35 -65
  285. package/src/session/auth/domainRouting.ts +51 -34
  286. package/src/session/auth/firebase.test.ts +25 -0
  287. package/src/session/auth/firebase.ts +10 -0
  288. package/src/session/auth/useAuthState.ts +11 -4
  289. package/src/session/index.ts +3 -1
  290. package/src/shell/AuthScreenPreview.test.tsx +44 -0
  291. package/src/shell/AuthScreenPreview.tsx +228 -0
  292. package/src/shell/BrandedAuthScreens.test.tsx +181 -0
  293. package/src/shell/BrandedAuthScreens.tsx +117 -0
  294. package/src/shell/SplashScreen.test.tsx +37 -0
  295. package/src/shell/SplashScreen.tsx +44 -39
  296. package/src/shell/VertesiaShell.tsx +49 -22
  297. package/src/shell/apps/StandaloneApp.tsx +5 -1
  298. package/src/shell/index.tsx +6 -0
  299. package/src/shell/login/SignInAuthPending.tsx +3 -3
  300. package/src/shell/login/SignInEmailStep.test.tsx +32 -0
  301. package/src/shell/login/SignInEmailStep.tsx +13 -9
  302. package/src/shell/login/SignInFlow.tsx +213 -0
  303. package/src/shell/login/SignInPageShell.tsx +62 -0
  304. package/src/shell/login/SignInPrimitives.tsx +14 -11
  305. package/src/shell/login/SignInRestrictedEnvStep.tsx +19 -7
  306. package/src/shell/login/SigninScreen.test.tsx +104 -0
  307. package/src/shell/login/SigninScreen.tsx +115 -145
  308. package/src/shell/login/SignupForm.tsx +8 -3
  309. package/src/shell/login/signInUtils.ts +42 -9
  310. package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +11 -3
  311. package/src/widgets/markdown/markdown.css +21 -21
  312. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js +0 -5
  313. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js.map +0 -1
  314. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js +0 -5
  315. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js.map +0 -1
  316. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js +0 -5
  317. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js.map +0 -1
  318. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js +0 -5
  319. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js.map +0 -1
  320. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js +0 -5
  321. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js.map +0 -1
  322. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js +0 -5
  323. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js.map +0 -1
  324. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js +0 -5
  325. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js.map +0 -1
  326. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js +0 -5
  327. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js.map +0 -1
  328. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js +0 -5
  329. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js.map +0 -1
  330. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js +0 -5
  331. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js.map +0 -1
  332. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js +0 -5
  333. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js.map +0 -1
  334. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js +0 -5
  335. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js.map +0 -1
  336. package/src/session/auth/authState.test.ts +0 -35
@@ -0,0 +1,118 @@
1
+ /** Node-only adapter. Import from @vertesia/ui/boot/vite, never from browser code. */
2
+ import { readFileSync } from 'node:fs';
3
+ import { extname } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { type AppBranding, brandedBootOptions, escapeBrandHtml } from './branding.js';
6
+ import { injectBootScreenHtml } from './index.js';
7
+
8
+ const VIRTUAL_ID = 'virtual:vertesia-branding';
9
+ const RESOLVED_ID = `\0${VIRTUAL_ID}`;
10
+ const MIME: Record<string, string> = {
11
+ '.svg': 'image/svg+xml',
12
+ '.png': 'image/png',
13
+ '.jpg': 'image/jpeg',
14
+ '.jpeg': 'image/jpeg',
15
+ '.webp': 'image/webp',
16
+ '.ico': 'image/x-icon',
17
+ '.woff2': 'font/woff2',
18
+ '.woff': 'font/woff',
19
+ '.otf': 'font/otf',
20
+ '.ttf': 'font/ttf',
21
+ '.avif': 'image/avif',
22
+ };
23
+
24
+ /** Inline local assets so React and pre-React markup work under any gateway base path. */
25
+ export function resolveBrandingAssets(branding: AppBranding, moduleUrl: URL, watch: (file: string) => void = () => {}) {
26
+ function asset(value: string, base = moduleUrl): string {
27
+ if (/^(https?:|data:|#)/i.test(value)) return value;
28
+ const url = new URL(value, base);
29
+ if (url.protocol !== 'file:') throw new Error(`Unsupported branding asset URL: ${value}`);
30
+ const file = fileURLToPath(url);
31
+ const mime = MIME[extname(file).toLowerCase()];
32
+ if (!mime) throw new Error(`Unsupported branding asset type: ${file}`);
33
+ watch(file);
34
+ return `data:${mime};base64,${readFileSync(file).toString('base64')}`;
35
+ }
36
+ function source(value: string, css: boolean): string {
37
+ const url = new URL(value, moduleUrl);
38
+ const file = fileURLToPath(url);
39
+ watch(file);
40
+ const text = readFileSync(file, 'utf8');
41
+ return css
42
+ ? text.replace(
43
+ /url\(\s*['"]?([^'"\s)]+)['"]?\s*\)/g,
44
+ (_match, path: string) => `url("${asset(path, url)}")`,
45
+ )
46
+ : text.replace(
47
+ /(<(?:img|source|link)\b[^>]*?\s)(src|href)=["']([^"']+)["']/gi,
48
+ (_match, tag: string, attr: string, path: string) =>
49
+ `${tag}${attr}="${escapeBrandHtml(asset(path, url))}"`,
50
+ );
51
+ }
52
+ return {
53
+ ...branding,
54
+ logo: branding.logo && {
55
+ ...branding.logo,
56
+ light: asset(branding.logo.light),
57
+ dark: branding.logo.dark ? asset(branding.logo.dark) : undefined,
58
+ },
59
+ loadingIcon: branding.loadingIcon && {
60
+ ...branding.loadingIcon,
61
+ light: asset(branding.loadingIcon.light),
62
+ dark: branding.loadingIcon.dark ? asset(branding.loadingIcon.dark) : undefined,
63
+ },
64
+ favicon: branding.favicon ? asset(branding.favicon) : undefined,
65
+ font: branding.font && {
66
+ ...branding.font,
67
+ regular: asset(branding.font.regular),
68
+ bold: branding.font.bold ? asset(branding.font.bold) : undefined,
69
+ },
70
+ boot: branding.boot && {
71
+ html: branding.boot.html ? source(branding.boot.html, false) : undefined,
72
+ styles: branding.boot.styles ? source(branding.boot.styles, true) : undefined,
73
+ },
74
+ } satisfies AppBranding;
75
+ }
76
+
77
+ export function createAppBrandingPlugin(branding: AppBranding, moduleUrl: URL) {
78
+ const watched = new Set<string>();
79
+ const resolve = () => resolveBrandingAssets(branding, moduleUrl, (file) => watched.add(file));
80
+ return {
81
+ name: 'vertesia-app-branding',
82
+ resolveId(id: string) {
83
+ if (id === VIRTUAL_ID) return RESOLVED_ID;
84
+ },
85
+ load(this: { addWatchFile(file: string): void }, id: string) {
86
+ if (id !== RESOLVED_ID) return;
87
+ const resolved = resolve();
88
+ for (const file of watched) this.addWatchFile(file);
89
+ return `export default ${JSON.stringify(resolved)};`;
90
+ },
91
+ handleHotUpdate<Module>(context: {
92
+ file: string;
93
+ server: {
94
+ moduleGraph: { getModuleById(id: string): Module | undefined; invalidateModule(module: Module): void };
95
+ ws: { send(payload: { type: 'full-reload' }): void };
96
+ };
97
+ }) {
98
+ if (!watched.has(context.file)) return;
99
+ const module = context.server.moduleGraph.getModuleById(RESOLVED_ID);
100
+ if (module) context.server.moduleGraph.invalidateModule(module);
101
+ context.server.ws.send({ type: 'full-reload' });
102
+ return [];
103
+ },
104
+ transformIndexHtml(html: string) {
105
+ const resolved = resolve();
106
+ const title = escapeBrandHtml(resolved.title ?? resolved.name);
107
+ let result = html.replace(/<title\b[^>]*>[\s\S]*?<\/title>/i, `<title>${title}</title>`);
108
+ if (resolved.favicon) {
109
+ result = result.replace(/<link\b(?=[^>]*\brel=["'](?:shortcut )?icon["'])[^>]*>/gi, '');
110
+ result = result.replace(
111
+ '</head>',
112
+ `<link rel="icon" href="${escapeBrandHtml(resolved.favicon)}"></head>`,
113
+ );
114
+ }
115
+ return injectBootScreenHtml(result, brandedBootOptions(resolved));
116
+ },
117
+ };
118
+ }
@@ -5,7 +5,6 @@ import { Slot } from '@radix-ui/react-slot';
5
5
  // pinned to the fallback language regardless of LanguageProvider changes.
6
6
  import { useUITranslation } from '@vertesia/ui/i18n';
7
7
  import { cva, type VariantProps } from 'class-variance-authority';
8
- import clsx from 'clsx';
9
8
  import { Check, CopyIcon, Loader2 } from 'lucide-react';
10
9
  import * as React from 'react';
11
10
  import { useEffect, useState } from 'react';
@@ -149,7 +148,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
149
148
 
150
149
  const buttonElement = (
151
150
  <Comp
152
- className={clsx(cn(buttonVariants({ variant, size })), className)}
151
+ className={cn(buttonVariants({ variant, size }), className)}
153
152
  disabled={isDisabled || isLoading || props.disabled}
154
153
  ref={ref}
155
154
  onClick={onClick}
@@ -20,13 +20,13 @@ export const calendarStyles = `
20
20
  min-width: 32px !important;
21
21
  height: 32px !important;
22
22
  border-radius: 4px !important;
23
- border: 1px solid hsl(var(--border)) !important;
24
- background: hsl(var(--background)) !important;
25
- color: hsl(var(--foreground)) !important;
23
+ border: 1px solid var(--border) !important;
24
+ background: var(--background) !important;
25
+ color: var(--foreground) !important;
26
26
  }
27
27
 
28
28
  .calendar-wrapper .react-calendar__navigation__arrow:hover {
29
- background: oklch(var(--muted)) !important;
29
+ background: var(--muted) !important;
30
30
  }
31
31
 
32
32
  .calendar-wrapper .react-calendar__tile {
@@ -17,7 +17,7 @@ const Label: React.ForwardRefExoticComponent<
17
17
  ({ className, required, ...props }, ref) => (
18
18
  <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}>
19
19
  {props.children}
20
- {required && <span className="text-destructive-foreground ms-1">*</span>}
20
+ {required && <span className="text-destructive ms-1">*</span>}
21
21
  </LabelPrimitive.Root>
22
22
  ),
23
23
  );
@@ -92,3 +92,130 @@ describe('VertesiaEnvironment runtime configuration', () => {
92
92
  expect(window.AUTH_MODE).toBe('central');
93
93
  });
94
94
  });
95
+
96
+ describe('VertesiaEnvironment build configuration', () => {
97
+ const buildEnv = {
98
+ VITE_FIREBASE_API_KEY: 'build-key',
99
+ VITE_FIREBASE_AUTH_DOMAIN: 'project.firebaseapp.com',
100
+ VITE_FIREBASE_PROJECT_ID: 'project',
101
+ VITE_FIREBASE_APP_ID: 'build-app',
102
+ };
103
+
104
+ afterEach(() => vi.unstubAllGlobals());
105
+
106
+ it('enables Firebase only with an explicit mode and complete build settings', () => {
107
+ vi.stubGlobal('window', {});
108
+ const env = new VertesiaEnvironment().init(baseProps, { ...buildEnv, VITE_AUTH_MODE: 'firebase' });
109
+ expect(env.firebase?.apiKey).toBe('build-key');
110
+ expect(env.firebase?.authDomain).toBe('project.firebaseapp.com');
111
+ expect(window.AUTH_MODE).toBe('firebase');
112
+ });
113
+
114
+ it.each([buildEnv, { VITE_FIREBASE_API_KEY: 'unused-key' }])(
115
+ 'retains central auth when Firebase values exist without an explicit mode',
116
+ (settings) => {
117
+ vi.stubGlobal('window', {});
118
+ const env = new VertesiaEnvironment().init(baseProps, settings);
119
+ expect(env.firebase).toBeUndefined();
120
+ expect(window.AUTH_MODE).toBeUndefined();
121
+ },
122
+ );
123
+
124
+ it('allows explicit central mode even with Firebase build settings', () => {
125
+ vi.stubGlobal('window', {});
126
+ const env = new VertesiaEnvironment().init(baseProps, { ...buildEnv, VITE_AUTH_MODE: 'central' });
127
+ expect(env.firebase).toBeUndefined();
128
+ expect(window.AUTH_MODE).toBe('central');
129
+ });
130
+
131
+ it('rejects incomplete settings when Firebase is selected', () => {
132
+ vi.stubGlobal('window', {});
133
+ expect(() =>
134
+ new VertesiaEnvironment().init(baseProps, {
135
+ VITE_AUTH_MODE: 'firebase',
136
+ VITE_FIREBASE_API_KEY: 'key',
137
+ }),
138
+ ).toThrow('VITE_FIREBASE_AUTH_DOMAIN, VITE_FIREBASE_PROJECT_ID, VITE_FIREBASE_APP_ID');
139
+ });
140
+
141
+ it('rejects an unknown mode', () => {
142
+ vi.stubGlobal('window', {});
143
+ expect(() => new VertesiaEnvironment().init(baseProps, { VITE_AUTH_MODE: 'typo' })).toThrow(
144
+ 'VITE_AUTH_MODE must be firebase or central',
145
+ );
146
+ });
147
+
148
+ it('preserves gateway Firebase configuration ahead of conflicting build settings', () => {
149
+ const firebase = {
150
+ apiKey: 'runtime-key',
151
+ authDomain: 'gateway.example.com',
152
+ projectId: 'runtime',
153
+ appId: 'runtime-app',
154
+ };
155
+ vi.stubGlobal('window', { __VERTESIA_RUNTIME_CONFIG__: { authMode: 'firebase', firebase } });
156
+ const env = new VertesiaEnvironment().init(baseProps, { VITE_AUTH_MODE: 'central' });
157
+ expect(env.firebase).toEqual(firebase);
158
+ expect(window.AUTH_MODE).toBe('firebase');
159
+ });
160
+
161
+ it('preserves gateway central mode ahead of Firebase build settings', () => {
162
+ vi.stubGlobal('window', { __VERTESIA_RUNTIME_CONFIG__: { authMode: 'central' } });
163
+ const env = new VertesiaEnvironment().init(baseProps, buildEnv);
164
+ expect(env.firebase).toBeUndefined();
165
+ expect(window.AUTH_MODE).toBe('central');
166
+ });
167
+
168
+ it('leaves the existing central default unchanged without settings', () => {
169
+ vi.stubGlobal('window', {});
170
+ const env = new VertesiaEnvironment().init(baseProps, {});
171
+ expect(env.firebase).toBeUndefined();
172
+ expect(window.AUTH_MODE).toBeUndefined();
173
+ });
174
+ });
175
+
176
+ describe('build-time default workspace', () => {
177
+ it('reads and trims Vertesia IDs independently of the Firebase project', () => {
178
+ const env = new VertesiaEnvironment().init(baseProps, {
179
+ VITE_VERTESIA_ACCOUNT_ID: ' account-1 ',
180
+ VITE_VERTESIA_PROJECT_ID: ' project-1 ',
181
+ });
182
+ expect(env.defaultAuthSelection).toEqual({ accountId: 'account-1', projectId: 'project-1' });
183
+ });
184
+ it('ignores blank settings and preserves an explicit selection as a whole pair', () => {
185
+ expect(
186
+ new VertesiaEnvironment().init(baseProps, { VITE_VERTESIA_ACCOUNT_ID: ' ' }).defaultAuthSelection,
187
+ ).toBeUndefined();
188
+ const env = new VertesiaEnvironment().init(
189
+ { ...baseProps, defaultAuthSelection: { accountId: 'explicit' } },
190
+ { VITE_VERTESIA_ACCOUNT_ID: 'build', VITE_VERTESIA_PROJECT_ID: 'other-project' },
191
+ );
192
+ expect(env.defaultAuthSelection).toEqual({ accountId: 'explicit' });
193
+ });
194
+ });
195
+
196
+ describe('fixed Firebase tenant', () => {
197
+ afterEach(() => vi.unstubAllGlobals());
198
+
199
+ it('combines an app tenant with gateway credentials', () => {
200
+ vi.stubGlobal('window', {
201
+ __VERTESIA_RUNTIME_CONFIG__: {
202
+ authMode: 'firebase',
203
+ firebase: {
204
+ apiKey: 'gateway',
205
+ authDomain: 'app.example.com',
206
+ projectId: 'project',
207
+ appId: 'app',
208
+ },
209
+ },
210
+ });
211
+ const env = new VertesiaEnvironment().init(baseProps, { VITE_FIREBASE_TENANT_ID: ' example-tenant ' });
212
+ expect(env.firebase?.tenantId).toBe('example-tenant');
213
+ expect(env.firebase?.apiKey).toBe('gateway');
214
+ });
215
+
216
+ it('does not enable Firebase just because a tenant is supplied', () => {
217
+ vi.stubGlobal('window', {});
218
+ const env = new VertesiaEnvironment().init(baseProps, { VITE_FIREBASE_TENANT_ID: 'tenant' });
219
+ expect(env.firebase).toBeUndefined();
220
+ });
221
+ });
package/src/env/index.ts CHANGED
@@ -15,6 +15,14 @@ export interface EnvProps {
15
15
  zeno: string;
16
16
  studio: string;
17
17
  sts: string; // Security Token Service endpoint
18
+ /**
19
+ * Central Auth broker that issues the sign-in redirect and hosts `/logout`.
20
+ *
21
+ * Optional: when unset the session falls back to the long-standing broker, so an app that
22
+ * does not set it keeps its current behaviour exactly. Set it to move one environment at a
23
+ * time onto a different broker.
24
+ */
25
+ auth?: string;
18
26
  git?: string; // Smart HTTP app source git endpoint
19
27
  mcp?: string;
20
28
  /** Appgen app-gateway endpoint (serves live development previews and app bundles). */
@@ -26,7 +34,11 @@ export interface EnvProps {
26
34
  projectId: string;
27
35
  appId?: string;
28
36
  providerType?: string;
37
+ /** Fixed Identity Platform tenant, preserved throughout sign-in. */
38
+ tenantId?: string;
29
39
  };
40
+ /** Default workspace selection when the URL does not explicitly select an account or project. */
41
+ defaultAuthSelection?: { accountId?: string; projectId?: string };
30
42
  region?: string;
31
43
  datadogRum?: boolean;
32
44
  datadogLogs?: boolean;
@@ -87,14 +99,68 @@ function injectedRuntimeConfig(): VertesiaRuntimeConfig | undefined {
87
99
  return runtimeConfig;
88
100
  }
89
101
 
102
+ /** Public build-time settings, for example Vite's import.meta.env. */
103
+ export type AppBuildEnvironment = Record<string, string | boolean | undefined>;
104
+
105
+ function buildRuntimeConfig(env?: AppBuildEnvironment): VertesiaRuntimeConfig | undefined {
106
+ if (!env) return undefined;
107
+ const value = (name: string) => (typeof env[name] === 'string' ? env[name].trim() : '');
108
+ const mode = value('VITE_AUTH_MODE');
109
+ if (mode && mode !== 'firebase' && mode !== 'central') {
110
+ throw new Error('VITE_AUTH_MODE must be firebase or central');
111
+ }
112
+ // Firebase build settings are only consumed after an explicit opt-in.
113
+ if (!mode) return undefined;
114
+ if (mode === 'central') return { authMode: 'central' };
115
+ const fields = {
116
+ apiKey: 'VITE_FIREBASE_API_KEY',
117
+ authDomain: 'VITE_FIREBASE_AUTH_DOMAIN',
118
+ projectId: 'VITE_FIREBASE_PROJECT_ID',
119
+ appId: 'VITE_FIREBASE_APP_ID',
120
+ };
121
+ const missing = Object.values(fields).filter((name) => !value(name));
122
+ if (missing.length) {
123
+ throw new Error(`Firebase authentication requires: ${missing.join(', ')}`);
124
+ }
125
+ return {
126
+ authMode: 'firebase',
127
+ firebase: {
128
+ apiKey: value(fields.apiKey),
129
+ authDomain: value(fields.authDomain),
130
+ projectId: value(fields.projectId),
131
+ appId: value(fields.appId),
132
+ },
133
+ };
134
+ }
135
+
90
136
  export class VertesiaEnvironment implements Readonly<EnvProps> {
91
137
  constructor(private _props?: EnvProps | undefined) {}
92
138
 
93
- init(props?: EnvProps) {
94
- const runtimeConfig = injectedRuntimeConfig();
139
+ init(props?: EnvProps, buildEnv?: AppBuildEnvironment) {
140
+ // Host runtime configuration takes precedence over static deployment defaults.
141
+ const runtimeConfig = injectedRuntimeConfig() ?? buildRuntimeConfig(buildEnv);
95
142
  const runtimeFirebase = runtimeConfig?.authMode === 'firebase' ? runtimeConfig.firebase : undefined;
96
143
  this._props = props && runtimeFirebase && !props.firebase ? { ...props, firebase: runtimeFirebase } : props;
97
- if (runtimeConfig && window.AUTH_MODE === undefined) window.AUTH_MODE = runtimeConfig.authMode;
144
+ const tenantId =
145
+ typeof buildEnv?.VITE_FIREBASE_TENANT_ID === 'string' ? buildEnv.VITE_FIREBASE_TENANT_ID.trim() : '';
146
+ if (this._props?.firebase && tenantId && !this._props.firebase.tenantId) {
147
+ this._props = { ...this._props, firebase: { ...this._props.firebase, tenantId } };
148
+ }
149
+ if (this._props && this._props.defaultAuthSelection === undefined && buildEnv) {
150
+ const accountId =
151
+ typeof buildEnv.VITE_VERTESIA_ACCOUNT_ID === 'string'
152
+ ? buildEnv.VITE_VERTESIA_ACCOUNT_ID.trim() || undefined
153
+ : undefined;
154
+ const projectId =
155
+ typeof buildEnv.VITE_VERTESIA_PROJECT_ID === 'string'
156
+ ? buildEnv.VITE_VERTESIA_PROJECT_ID.trim() || undefined
157
+ : undefined;
158
+ if (accountId || projectId)
159
+ this._props = { ...this._props, defaultAuthSelection: { accountId, projectId } };
160
+ }
161
+ if (runtimeConfig && typeof window !== 'undefined' && window.AUTH_MODE === undefined) {
162
+ window.AUTH_MODE = runtimeConfig.authMode;
163
+ }
98
164
  return this;
99
165
  }
100
166
 
@@ -173,6 +239,10 @@ export class VertesiaEnvironment implements Readonly<EnvProps> {
173
239
  return this._props?.devAuthToken;
174
240
  }
175
241
 
242
+ get defaultAuthSelection() {
243
+ return this._props?.defaultAuthSelection;
244
+ }
245
+
176
246
  get authTokenProvider() {
177
247
  return this._props?.authTokenProvider;
178
248
  }
@@ -39,6 +39,10 @@ function getExecutableProvider(provider: ExecutionEnvironmentRef['provider']): M
39
39
  }
40
40
 
41
41
  export interface ScheduledWorkflowConfig {
42
+ run_as?: import('@vertesia/common').ScheduleRunAs;
43
+ /** Local datetime input; serialize as delegation_expires_at (ISO or null) for schedule requests. */
44
+ delegation_expiry_input?: string;
45
+ request_id?: string;
42
46
  name: string;
43
47
  description?: string;
44
48
  cron_expression: string;
@@ -328,7 +332,12 @@ export class PayloadBuilder {
328
332
  this._model_options = interaction.model_options as ModelOptions | undefined;
329
333
  if (interaction.runtime?.environment) {
330
334
  const envId = interaction.runtime.environment;
331
- this.vertesia.environments.retrieve(envId).then((environment) => (this.environment = environment));
335
+ this.vertesia.environments
336
+ .retrieve(envId)
337
+ .then((environment) => (this.environment = environment))
338
+ .catch(() => {
339
+ this.environment = undefined;
340
+ });
332
341
  }
333
342
  }
334
343
  this.onStateChanged();