@data-club/ai-hub 0.0.1

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 (344) hide show
  1. package/dist/auth/passwordPolicy.d.ts +55 -0
  2. package/dist/auth/passwordPolicy.d.ts.map +1 -0
  3. package/dist/auth/passwordPolicy.js +63 -0
  4. package/dist/auth/passwordPolicy.js.map +1 -0
  5. package/dist/auth/texts.d.ts +815 -0
  6. package/dist/auth/texts.d.ts.map +1 -0
  7. package/dist/auth/texts.js +429 -0
  8. package/dist/auth/texts.js.map +1 -0
  9. package/dist/client/AIHubClient.d.ts +1058 -0
  10. package/dist/client/AIHubClient.d.ts.map +1 -0
  11. package/dist/client/AIHubClient.js +950 -0
  12. package/dist/client/AIHubClient.js.map +1 -0
  13. package/dist/client/index.d.ts +11 -0
  14. package/dist/client/index.d.ts.map +1 -0
  15. package/dist/client/index.js +9 -0
  16. package/dist/client/index.js.map +1 -0
  17. package/dist/client/sseParser.d.ts +41 -0
  18. package/dist/client/sseParser.d.ts.map +1 -0
  19. package/dist/client/sseParser.js +153 -0
  20. package/dist/client/sseParser.js.map +1 -0
  21. package/dist/client/tokenStorage.d.ts +56 -0
  22. package/dist/client/tokenStorage.d.ts.map +1 -0
  23. package/dist/client/tokenStorage.js +116 -0
  24. package/dist/client/tokenStorage.js.map +1 -0
  25. package/dist/components/AgentsPicker/index.d.ts +70 -0
  26. package/dist/components/AgentsPicker/index.d.ts.map +1 -0
  27. package/dist/components/AgentsPicker/index.js +63 -0
  28. package/dist/components/AgentsPicker/index.js.map +1 -0
  29. package/dist/components/AuthGate/index.d.ts +79 -0
  30. package/dist/components/AuthGate/index.d.ts.map +1 -0
  31. package/dist/components/AuthGate/index.js +61 -0
  32. package/dist/components/AuthGate/index.js.map +1 -0
  33. package/dist/components/CacheBadge/index.d.ts +88 -0
  34. package/dist/components/CacheBadge/index.d.ts.map +1 -0
  35. package/dist/components/CacheBadge/index.js +127 -0
  36. package/dist/components/CacheBadge/index.js.map +1 -0
  37. package/dist/components/ChangePassword/index.d.ts +109 -0
  38. package/dist/components/ChangePassword/index.d.ts.map +1 -0
  39. package/dist/components/ChangePassword/index.js +142 -0
  40. package/dist/components/ChangePassword/index.js.map +1 -0
  41. package/dist/components/ChatShell/ShellHeader.d.ts +44 -0
  42. package/dist/components/ChatShell/ShellHeader.d.ts.map +1 -0
  43. package/dist/components/ChatShell/ShellHeader.js +14 -0
  44. package/dist/components/ChatShell/ShellHeader.js.map +1 -0
  45. package/dist/components/ChatShell/UserMenu.d.ts +48 -0
  46. package/dist/components/ChatShell/UserMenu.d.ts.map +1 -0
  47. package/dist/components/ChatShell/UserMenu.js +86 -0
  48. package/dist/components/ChatShell/UserMenu.js.map +1 -0
  49. package/dist/components/ChatShell/index.d.ts +98 -0
  50. package/dist/components/ChatShell/index.d.ts.map +1 -0
  51. package/dist/components/ChatShell/index.js +124 -0
  52. package/dist/components/ChatShell/index.js.map +1 -0
  53. package/dist/components/DataClubAIHub/index.d.ts +132 -0
  54. package/dist/components/DataClubAIHub/index.d.ts.map +1 -0
  55. package/dist/components/DataClubAIHub/index.js +124 -0
  56. package/dist/components/DataClubAIHub/index.js.map +1 -0
  57. package/dist/components/DataClubAIHubAdmin/AgentEditorModal.d.ts +89 -0
  58. package/dist/components/DataClubAIHubAdmin/AgentEditorModal.d.ts.map +1 -0
  59. package/dist/components/DataClubAIHubAdmin/AgentEditorModal.js +199 -0
  60. package/dist/components/DataClubAIHubAdmin/AgentEditorModal.js.map +1 -0
  61. package/dist/components/DataClubAIHubAdmin/AgentsPage.d.ts +33 -0
  62. package/dist/components/DataClubAIHubAdmin/AgentsPage.d.ts.map +1 -0
  63. package/dist/components/DataClubAIHubAdmin/AgentsPage.js +137 -0
  64. package/dist/components/DataClubAIHubAdmin/AgentsPage.js.map +1 -0
  65. package/dist/components/DataClubAIHubAdmin/CreateUserModal.d.ts +50 -0
  66. package/dist/components/DataClubAIHubAdmin/CreateUserModal.d.ts.map +1 -0
  67. package/dist/components/DataClubAIHubAdmin/CreateUserModal.js +93 -0
  68. package/dist/components/DataClubAIHubAdmin/CreateUserModal.js.map +1 -0
  69. package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.d.ts +49 -0
  70. package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.d.ts.map +1 -0
  71. package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.js +94 -0
  72. package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.js.map +1 -0
  73. package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.d.ts +37 -0
  74. package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.d.ts.map +1 -0
  75. package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.js +44 -0
  76. package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.js.map +1 -0
  77. package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.d.ts +56 -0
  78. package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.d.ts.map +1 -0
  79. package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.js +158 -0
  80. package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.js.map +1 -0
  81. package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.d.ts +29 -0
  82. package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.d.ts.map +1 -0
  83. package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.js +183 -0
  84. package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.js.map +1 -0
  85. package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.d.ts +38 -0
  86. package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.d.ts.map +1 -0
  87. package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.js +294 -0
  88. package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.js.map +1 -0
  89. package/dist/components/DataClubAIHubAdmin/SettingsPage.d.ts +36 -0
  90. package/dist/components/DataClubAIHubAdmin/SettingsPage.d.ts.map +1 -0
  91. package/dist/components/DataClubAIHubAdmin/SettingsPage.js +373 -0
  92. package/dist/components/DataClubAIHubAdmin/SettingsPage.js.map +1 -0
  93. package/dist/components/DataClubAIHubAdmin/UsersPage.d.ts +47 -0
  94. package/dist/components/DataClubAIHubAdmin/UsersPage.d.ts.map +1 -0
  95. package/dist/components/DataClubAIHubAdmin/UsersPage.js +233 -0
  96. package/dist/components/DataClubAIHubAdmin/UsersPage.js.map +1 -0
  97. package/dist/components/DataClubAIHubAdmin/index.d.ts +87 -0
  98. package/dist/components/DataClubAIHubAdmin/index.d.ts.map +1 -0
  99. package/dist/components/DataClubAIHubAdmin/index.js +137 -0
  100. package/dist/components/DataClubAIHubAdmin/index.js.map +1 -0
  101. package/dist/components/DataClubAIHubLogin/index.d.ts +113 -0
  102. package/dist/components/DataClubAIHubLogin/index.d.ts.map +1 -0
  103. package/dist/components/DataClubAIHubLogin/index.js +123 -0
  104. package/dist/components/DataClubAIHubLogin/index.js.map +1 -0
  105. package/dist/components/EffortControl/index.d.ts +57 -0
  106. package/dist/components/EffortControl/index.d.ts.map +1 -0
  107. package/dist/components/EffortControl/index.js +84 -0
  108. package/dist/components/EffortControl/index.js.map +1 -0
  109. package/dist/components/Layout/index.d.ts +63 -0
  110. package/dist/components/Layout/index.d.ts.map +1 -0
  111. package/dist/components/Layout/index.js +45 -0
  112. package/dist/components/Layout/index.js.map +1 -0
  113. package/dist/components/MainColumn/index.d.ts +69 -0
  114. package/dist/components/MainColumn/index.d.ts.map +1 -0
  115. package/dist/components/MainColumn/index.js +47 -0
  116. package/dist/components/MainColumn/index.js.map +1 -0
  117. package/dist/components/MarkdownRenderer/index.d.ts +66 -0
  118. package/dist/components/MarkdownRenderer/index.d.ts.map +1 -0
  119. package/dist/components/MarkdownRenderer/index.js +153 -0
  120. package/dist/components/MarkdownRenderer/index.js.map +1 -0
  121. package/dist/components/MessageInput/index.d.ts +85 -0
  122. package/dist/components/MessageInput/index.d.ts.map +1 -0
  123. package/dist/components/MessageInput/index.js +139 -0
  124. package/dist/components/MessageInput/index.js.map +1 -0
  125. package/dist/components/MessageList/index.d.ts +156 -0
  126. package/dist/components/MessageList/index.d.ts.map +1 -0
  127. package/dist/components/MessageList/index.js +352 -0
  128. package/dist/components/MessageList/index.js.map +1 -0
  129. package/dist/components/ReasoningSelector/index.d.ts +77 -0
  130. package/dist/components/ReasoningSelector/index.d.ts.map +1 -0
  131. package/dist/components/ReasoningSelector/index.js +156 -0
  132. package/dist/components/ReasoningSelector/index.js.map +1 -0
  133. package/dist/components/ReasoningView/index.d.ts +94 -0
  134. package/dist/components/ReasoningView/index.d.ts.map +1 -0
  135. package/dist/components/ReasoningView/index.js +83 -0
  136. package/dist/components/ReasoningView/index.js.map +1 -0
  137. package/dist/components/ScrollToPresentButton/index.d.ts +54 -0
  138. package/dist/components/ScrollToPresentButton/index.d.ts.map +1 -0
  139. package/dist/components/ScrollToPresentButton/index.js +44 -0
  140. package/dist/components/ScrollToPresentButton/index.js.map +1 -0
  141. package/dist/components/SessionsPanel/SessionTitleModal.d.ts +79 -0
  142. package/dist/components/SessionsPanel/SessionTitleModal.d.ts.map +1 -0
  143. package/dist/components/SessionsPanel/SessionTitleModal.js +102 -0
  144. package/dist/components/SessionsPanel/SessionTitleModal.js.map +1 -0
  145. package/dist/components/SessionsPanel/index.d.ts +100 -0
  146. package/dist/components/SessionsPanel/index.d.ts.map +1 -0
  147. package/dist/components/SessionsPanel/index.js +176 -0
  148. package/dist/components/SessionsPanel/index.js.map +1 -0
  149. package/dist/components/SystemNotice/index.d.ts +66 -0
  150. package/dist/components/SystemNotice/index.d.ts.map +1 -0
  151. package/dist/components/SystemNotice/index.js +81 -0
  152. package/dist/components/SystemNotice/index.js.map +1 -0
  153. package/dist/components/ThemeSwitcher/index.d.ts +66 -0
  154. package/dist/components/ThemeSwitcher/index.d.ts.map +1 -0
  155. package/dist/components/ThemeSwitcher/index.js +73 -0
  156. package/dist/components/ThemeSwitcher/index.js.map +1 -0
  157. package/dist/components/ToolCallView/formatContent.d.ts +36 -0
  158. package/dist/components/ToolCallView/formatContent.d.ts.map +1 -0
  159. package/dist/components/ToolCallView/formatContent.js +53 -0
  160. package/dist/components/ToolCallView/formatContent.js.map +1 -0
  161. package/dist/components/ToolCallView/index.d.ts +120 -0
  162. package/dist/components/ToolCallView/index.d.ts.map +1 -0
  163. package/dist/components/ToolCallView/index.js +104 -0
  164. package/dist/components/ToolCallView/index.js.map +1 -0
  165. package/dist/components/TpmBanner/index.d.ts +53 -0
  166. package/dist/components/TpmBanner/index.d.ts.map +1 -0
  167. package/dist/components/TpmBanner/index.js +116 -0
  168. package/dist/components/TpmBanner/index.js.map +1 -0
  169. package/dist/components/TurnStatusIndicator/index.d.ts +77 -0
  170. package/dist/components/TurnStatusIndicator/index.d.ts.map +1 -0
  171. package/dist/components/TurnStatusIndicator/index.js +122 -0
  172. package/dist/components/TurnStatusIndicator/index.js.map +1 -0
  173. package/dist/components/internal/PasswordInput.d.ts +62 -0
  174. package/dist/components/internal/PasswordInput.d.ts.map +1 -0
  175. package/dist/components/internal/PasswordInput.js +42 -0
  176. package/dist/components/internal/PasswordInput.js.map +1 -0
  177. package/dist/context/AIHubContext.d.ts +220 -0
  178. package/dist/context/AIHubContext.d.ts.map +1 -0
  179. package/dist/context/AIHubContext.js +19 -0
  180. package/dist/context/AIHubContext.js.map +1 -0
  181. package/dist/context/AIHubProvider.d.ts +75 -0
  182. package/dist/context/AIHubProvider.d.ts.map +1 -0
  183. package/dist/context/AIHubProvider.js +954 -0
  184. package/dist/context/AIHubProvider.js.map +1 -0
  185. package/dist/context/index.d.ts +9 -0
  186. package/dist/context/index.d.ts.map +1 -0
  187. package/dist/context/index.js +9 -0
  188. package/dist/context/index.js.map +1 -0
  189. package/dist/context/theme.d.ts +43 -0
  190. package/dist/context/theme.d.ts.map +1 -0
  191. package/dist/context/theme.js +70 -0
  192. package/dist/context/theme.js.map +1 -0
  193. package/dist/context/useAIHub.d.ts +104 -0
  194. package/dist/context/useAIHub.d.ts.map +1 -0
  195. package/dist/context/useAIHub.js +63 -0
  196. package/dist/context/useAIHub.js.map +1 -0
  197. package/dist/context/useAIHubAuth.d.ts +44 -0
  198. package/dist/context/useAIHubAuth.d.ts.map +1 -0
  199. package/dist/context/useAIHubAuth.js +35 -0
  200. package/dist/context/useAIHubAuth.js.map +1 -0
  201. package/dist/index.d.ts +76 -0
  202. package/dist/index.d.ts.map +1 -0
  203. package/dist/index.js +57 -0
  204. package/dist/index.js.map +1 -0
  205. package/dist/primitives/index.d.ts +99 -0
  206. package/dist/primitives/index.d.ts.map +1 -0
  207. package/dist/primitives/index.js +97 -0
  208. package/dist/primitives/index.js.map +1 -0
  209. package/dist/state/affordances.d.ts +182 -0
  210. package/dist/state/affordances.d.ts.map +1 -0
  211. package/dist/state/affordances.js +189 -0
  212. package/dist/state/affordances.js.map +1 -0
  213. package/dist/state/stateReducer.d.ts +72 -0
  214. package/dist/state/stateReducer.d.ts.map +1 -0
  215. package/dist/state/stateReducer.js +122 -0
  216. package/dist/state/stateReducer.js.map +1 -0
  217. package/dist/stories/EffortControl.stories.d.ts +14 -0
  218. package/dist/stories/EffortControl.stories.d.ts.map +1 -0
  219. package/dist/stories/EffortControl.stories.js +43 -0
  220. package/dist/stories/EffortControl.stories.js.map +1 -0
  221. package/dist/stories/MarkdownRenderer.stories.d.ts +25 -0
  222. package/dist/stories/MarkdownRenderer.stories.d.ts.map +1 -0
  223. package/dist/stories/MarkdownRenderer.stories.js +178 -0
  224. package/dist/stories/MarkdownRenderer.stories.js.map +1 -0
  225. package/dist/stories/MessageBubble.stories.d.ts +21 -0
  226. package/dist/stories/MessageBubble.stories.d.ts.map +1 -0
  227. package/dist/stories/MessageBubble.stories.js +59 -0
  228. package/dist/stories/MessageBubble.stories.js.map +1 -0
  229. package/dist/stories/ReasoningView.stories.d.ts +18 -0
  230. package/dist/stories/ReasoningView.stories.d.ts.map +1 -0
  231. package/dist/stories/ReasoningView.stories.js +62 -0
  232. package/dist/stories/ReasoningView.stories.js.map +1 -0
  233. package/dist/stories/ScrollToPresentButton.stories.d.ts +18 -0
  234. package/dist/stories/ScrollToPresentButton.stories.d.ts.map +1 -0
  235. package/dist/stories/ScrollToPresentButton.stories.js +34 -0
  236. package/dist/stories/ScrollToPresentButton.stories.js.map +1 -0
  237. package/dist/stories/SystemNotice.stories.d.ts +17 -0
  238. package/dist/stories/SystemNotice.stories.d.ts.map +1 -0
  239. package/dist/stories/SystemNotice.stories.js +42 -0
  240. package/dist/stories/SystemNotice.stories.js.map +1 -0
  241. package/dist/stories/ThemeSwitcher.stories.d.ts +15 -0
  242. package/dist/stories/ThemeSwitcher.stories.d.ts.map +1 -0
  243. package/dist/stories/ThemeSwitcher.stories.js +35 -0
  244. package/dist/stories/ThemeSwitcher.stories.js.map +1 -0
  245. package/dist/stories/ToolCallView.stories.d.ts +20 -0
  246. package/dist/stories/ToolCallView.stories.d.ts.map +1 -0
  247. package/dist/stories/ToolCallView.stories.js +65 -0
  248. package/dist/stories/ToolCallView.stories.js.map +1 -0
  249. package/dist/stories/TpmBanner.stories.d.ts +24 -0
  250. package/dist/stories/TpmBanner.stories.d.ts.map +1 -0
  251. package/dist/stories/TpmBanner.stories.js +63 -0
  252. package/dist/stories/TpmBanner.stories.js.map +1 -0
  253. package/dist/stories/TurnStatusIndicator.stories.d.ts +25 -0
  254. package/dist/stories/TurnStatusIndicator.stories.d.ts.map +1 -0
  255. package/dist/stories/TurnStatusIndicator.stories.js +56 -0
  256. package/dist/stories/TurnStatusIndicator.stories.js.map +1 -0
  257. package/dist/stories/_mockProvider.d.ts +44 -0
  258. package/dist/stories/_mockProvider.d.ts.map +1 -0
  259. package/dist/stories/_mockProvider.js +84 -0
  260. package/dist/stories/_mockProvider.js.map +1 -0
  261. package/dist/types.d.ts +787 -0
  262. package/dist/types.d.ts.map +1 -0
  263. package/dist/types.js +19 -0
  264. package/dist/types.js.map +1 -0
  265. package/dist/webcomponent/defineWebComponent.d.ts +106 -0
  266. package/dist/webcomponent/defineWebComponent.d.ts.map +1 -0
  267. package/dist/webcomponent/defineWebComponent.js +126 -0
  268. package/dist/webcomponent/defineWebComponent.js.map +1 -0
  269. package/dist/webcomponent/index.d.ts +7 -0
  270. package/dist/webcomponent/index.d.ts.map +1 -0
  271. package/dist/webcomponent/index.js +7 -0
  272. package/dist/webcomponent/index.js.map +1 -0
  273. package/package.json +63 -0
  274. package/src/__lint-canary__/step1-lint-canary.ts.disabled +28 -0
  275. package/src/auth/passwordPolicy.ts +75 -0
  276. package/src/auth/texts.ts +1294 -0
  277. package/src/client/AIHubClient.ts +1718 -0
  278. package/src/client/index.ts +30 -0
  279. package/src/client/sseParser.ts +168 -0
  280. package/src/client/tokenStorage.ts +131 -0
  281. package/src/components/AgentsPicker/index.tsx +147 -0
  282. package/src/components/AuthGate/index.tsx +132 -0
  283. package/src/components/CacheBadge/index.tsx +245 -0
  284. package/src/components/ChangePassword/index.tsx +375 -0
  285. package/src/components/ChatShell/ShellHeader.tsx +80 -0
  286. package/src/components/ChatShell/UserMenu.tsx +196 -0
  287. package/src/components/ChatShell/index.tsx +307 -0
  288. package/src/components/DataClubAIHub/index.tsx +300 -0
  289. package/src/components/DataClubAIHubAdmin/AgentEditorModal.tsx +505 -0
  290. package/src/components/DataClubAIHubAdmin/AgentsPage.tsx +342 -0
  291. package/src/components/DataClubAIHubAdmin/CreateUserModal.tsx +214 -0
  292. package/src/components/DataClubAIHubAdmin/PasswordRevealModal.tsx +204 -0
  293. package/src/components/DataClubAIHubAdmin/ResetPasswordModal.tsx +122 -0
  294. package/src/components/DataClubAIHubAdmin/RotatingMessageEditorModal.tsx +408 -0
  295. package/src/components/DataClubAIHubAdmin/RotatingMessagesPage.tsx +373 -0
  296. package/src/components/DataClubAIHubAdmin/SessionsOverviewPage.tsx +639 -0
  297. package/src/components/DataClubAIHubAdmin/SettingsPage.tsx +979 -0
  298. package/src/components/DataClubAIHubAdmin/UsersPage.tsx +495 -0
  299. package/src/components/DataClubAIHubAdmin/index.tsx +277 -0
  300. package/src/components/DataClubAIHubLogin/index.tsx +282 -0
  301. package/src/components/EffortControl/index.tsx +138 -0
  302. package/src/components/Layout/index.tsx +92 -0
  303. package/src/components/MainColumn/index.tsx +131 -0
  304. package/src/components/MarkdownRenderer/index.tsx +256 -0
  305. package/src/components/MessageInput/index.tsx +283 -0
  306. package/src/components/MessageList/index.tsx +753 -0
  307. package/src/components/ReasoningSelector/index.tsx +268 -0
  308. package/src/components/ReasoningView/index.tsx +183 -0
  309. package/src/components/ScrollToPresentButton/index.tsx +85 -0
  310. package/src/components/SessionsPanel/SessionTitleModal.tsx +256 -0
  311. package/src/components/SessionsPanel/index.tsx +406 -0
  312. package/src/components/SystemNotice/index.tsx +151 -0
  313. package/src/components/ThemeSwitcher/index.tsx +136 -0
  314. package/src/components/ToolCallView/formatContent.ts +50 -0
  315. package/src/components/ToolCallView/index.tsx +274 -0
  316. package/src/components/TpmBanner/index.tsx +172 -0
  317. package/src/components/TurnStatusIndicator/index.tsx +203 -0
  318. package/src/components/internal/PasswordInput.tsx +145 -0
  319. package/src/context/AIHubContext.ts +249 -0
  320. package/src/context/AIHubProvider.tsx +1084 -0
  321. package/src/context/index.ts +9 -0
  322. package/src/context/theme.ts +76 -0
  323. package/src/context/useAIHub.ts +151 -0
  324. package/src/context/useAIHubAuth.ts +65 -0
  325. package/src/index.ts +275 -0
  326. package/src/primitives/index.ts +101 -0
  327. package/src/state/affordances.ts +321 -0
  328. package/src/state/stateReducer.ts +131 -0
  329. package/src/stories/EffortControl.stories.tsx +63 -0
  330. package/src/stories/MarkdownRenderer.stories.tsx +201 -0
  331. package/src/stories/MessageBubble.stories.tsx +101 -0
  332. package/src/stories/ReasoningView.stories.tsx +81 -0
  333. package/src/stories/ScrollToPresentButton.stories.tsx +52 -0
  334. package/src/stories/SystemNotice.stories.tsx +59 -0
  335. package/src/stories/ThemeSwitcher.stories.tsx +55 -0
  336. package/src/stories/ToolCallView.stories.tsx +95 -0
  337. package/src/stories/TpmBanner.stories.tsx +93 -0
  338. package/src/stories/TurnStatusIndicator.stories.tsx +86 -0
  339. package/src/stories/_mockProvider.tsx +116 -0
  340. package/src/styles/CLASSES.md +356 -0
  341. package/src/styles/default.css +2937 -0
  342. package/src/types.ts +867 -0
  343. package/src/webcomponent/defineWebComponent.tsx +193 -0
  344. package/src/webcomponent/index.ts +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentsPage.js","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/AgentsPage.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAC;AAQ/B,0EAA0E;AAC1E,SAAS,YAAY,CAAC,MAA0B;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,8DAA8D;AAC9D,SAAS,aAAa,CAAC,CAAiB,EAAE,CAAiB;IACzD,OAAO,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AACtD,CAAC;AAQD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAE5D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA0B,IA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AiB,GAC5B,EAEH,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC1B,KAAC,gBAAgB,IACf,IAAI,EAAE,QAAkC,EACxC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GAC7C,CACH,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CACxB,KAAC,gBAAgB,IACf,IAAI,EAAE,MAAgC,EACtC,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY;oBACtC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc;oBACzC,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,iBAAiB;oBAC/C,wBAAwB,EAAE,MAAM,CAAC,KAAK,CAAC,2BAA2B;iBACnE,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,EACxD,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GAC7C,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * `<CreateUserModal />` — Phase-1 form for the create-user flow.
3
+ *
4
+ * Submitting POSTs `/admin/users` (server generates the password); the
5
+ * one-time plaintext is returned in the response and surfaced via
6
+ * `<PasswordRevealModal />` afterward — the parent owns the phase
7
+ * transition because the password is the parent's state to keep until
8
+ * dismissed.
9
+ *
10
+ * Role-option filtering ([05-admin-users.md]):
11
+ *
12
+ * - `admin` callers see `user / power_user / admin`. They cannot create
13
+ * `super_admin`s — server enforces and the dropdown hides the option.
14
+ * - `super_admin` callers additionally see `super_admin`.
15
+ *
16
+ * @see SPECIFICATIONS.md §6.3.4 / §8.5
17
+ * @see ui-sketches/05-admin-users.md — create_user_modal
18
+ */
19
+ import { type ReactNode } from "react";
20
+ import type { AIHubAdminTexts } from "../../auth/texts.js";
21
+ import type { AIHubRole } from "../../types.js";
22
+ /**
23
+ * Props for `<CreateUserModal />`.
24
+ */
25
+ export interface CreateUserModalProps {
26
+ /** Caller's role — drives the role-option filter. */
27
+ callerRole: AIHubRole | null;
28
+ /** Resolved admin texts. */
29
+ texts: AIHubAdminTexts;
30
+ /**
31
+ * Submits the form. Resolves on success; throws `AIHubRequestError` on
32
+ * validation / forbidden / `username_taken` so the modal can surface the
33
+ * right inline message.
34
+ */
35
+ onSubmit: (input: {
36
+ username: string;
37
+ displayName: string | null;
38
+ role: AIHubRole;
39
+ }) => Promise<void>;
40
+ /** Fired when the admin clicks Cancel (no server call). */
41
+ onCancel: () => void;
42
+ }
43
+ /**
44
+ * Renders the create-user modal.
45
+ *
46
+ * @param props - see `CreateUserModalProps`.
47
+ * @returns the rendered modal.
48
+ */
49
+ export declare function CreateUserModal(props: CreateUserModalProps): ReactNode;
50
+ //# sourceMappingURL=CreateUserModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateUserModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/CreateUserModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUhD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,4BAA4B;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,IAAI,EAAE,SAAS,CAAC;KACjB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAyJtE"}
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<CreateUserModal />` — Phase-1 form for the create-user flow.
4
+ *
5
+ * Submitting POSTs `/admin/users` (server generates the password); the
6
+ * one-time plaintext is returned in the response and surfaced via
7
+ * `<PasswordRevealModal />` afterward — the parent owns the phase
8
+ * transition because the password is the parent's state to keep until
9
+ * dismissed.
10
+ *
11
+ * Role-option filtering ([05-admin-users.md]):
12
+ *
13
+ * - `admin` callers see `user / power_user / admin`. They cannot create
14
+ * `super_admin`s — server enforces and the dropdown hides the option.
15
+ * - `super_admin` callers additionally see `super_admin`.
16
+ *
17
+ * @see SPECIFICATIONS.md §6.3.4 / §8.5
18
+ * @see ui-sketches/05-admin-users.md — create_user_modal
19
+ */
20
+ import { useState } from "react";
21
+ import { AIHubRequestError } from "../../client/AIHubClient.js";
22
+ /** The role options each caller role can offer. */
23
+ function roleOptionsForCaller(role) {
24
+ if (role === "super_admin") {
25
+ return ["user", "power_user", "admin", "super_admin"];
26
+ }
27
+ return ["user", "power_user", "admin"];
28
+ }
29
+ /**
30
+ * Renders the create-user modal.
31
+ *
32
+ * @param props - see `CreateUserModalProps`.
33
+ * @returns the rendered modal.
34
+ */
35
+ export function CreateUserModal(props) {
36
+ const options = roleOptionsForCaller(props.callerRole);
37
+ const [username, setUsername] = useState("");
38
+ const [displayName, setDisplayName] = useState("");
39
+ const [role, setRole] = useState(options[0] ?? "user");
40
+ const [submitting, setSubmitting] = useState(false);
41
+ const [errorText, setErrorText] = useState(null);
42
+ function roleLabel(r) {
43
+ if (r === "super_admin")
44
+ return props.texts.roleOptionSuperAdmin;
45
+ if (r === "admin")
46
+ return props.texts.roleOptionAdmin;
47
+ if (r === "power_user")
48
+ return props.texts.roleOptionPowerUser;
49
+ return props.texts.roleOptionUser;
50
+ }
51
+ async function handleSubmit(e) {
52
+ e.preventDefault();
53
+ const trimmed = username.trim();
54
+ if (trimmed.length === 0) {
55
+ setErrorText(props.texts.createUserUsernameRequiredError);
56
+ return;
57
+ }
58
+ setErrorText(null);
59
+ setSubmitting(true);
60
+ try {
61
+ await props.onSubmit({
62
+ username: trimmed,
63
+ displayName: displayName.trim().length > 0 ? displayName.trim() : null,
64
+ role,
65
+ });
66
+ // Parent unmounts us on success → no further state work here.
67
+ }
68
+ catch (err) {
69
+ // Map known error codes to localized strings; fall back to generic.
70
+ if (err instanceof AIHubRequestError) {
71
+ if (err.code === "username_taken" || err.status === 409) {
72
+ setErrorText(props.texts.createUserUsernameTakenError);
73
+ }
74
+ else if (err.message) {
75
+ setErrorText(err.message);
76
+ }
77
+ else {
78
+ setErrorText(props.texts.createUserGenericError);
79
+ }
80
+ }
81
+ else {
82
+ setErrorText(props.texts.createUserGenericError);
83
+ }
84
+ setSubmitting(false);
85
+ }
86
+ }
87
+ return (_jsx("div", { className: "data-club-ai-hub-admin__modal-backdrop", role: "presentation", children: _jsxs("form", { className: "data-club-ai-hub-admin__modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "create-user-modal-title", "data-testid": "create-user-modal", onSubmit: (e) => {
88
+ void handleSubmit(e);
89
+ }, children: [_jsx("h2", { id: "create-user-modal-title", className: "data-club-ai-hub-admin__modal-title", children: props.texts.createUserModalTitle }), errorText !== null ? (_jsx("div", { className: "data-club-ai-hub-admin__modal-error", "data-testid": "create-user-error", role: "alert", children: errorText })) : null, _jsxs("label", { className: "data-club-ai-hub-admin__modal-field", children: [_jsx("span", { className: "data-club-ai-hub-admin__modal-label", children: props.texts.createUserUsernameLabel }), _jsx("input", { type: "text", value: username, onChange: (e) => setUsername(e.target.value), className: "data-club-ai-hub-admin__modal-input", "data-testid": "create-user-username", autoFocus: true, disabled: submitting })] }), _jsxs("label", { className: "data-club-ai-hub-admin__modal-field", children: [_jsx("span", { className: "data-club-ai-hub-admin__modal-label", children: props.texts.createUserDisplayLabel }), _jsx("input", { type: "text", value: displayName, onChange: (e) => setDisplayName(e.target.value), className: "data-club-ai-hub-admin__modal-input", "data-testid": "create-user-display", disabled: submitting })] }), _jsxs("label", { className: "data-club-ai-hub-admin__modal-field", children: [_jsx("span", { className: "data-club-ai-hub-admin__modal-label", children: props.texts.createUserRoleLabel }), _jsx("select", { value: role, onChange: (e) => setRole(e.target.value), className: "data-club-ai-hub-admin__modal-input", "data-testid": "create-user-role", disabled: submitting, children: options.map((r) => (_jsx("option", { value: r, children: roleLabel(r) }, r))) })] }), _jsxs("div", { className: "data-club-ai-hub-admin__modal-actions", children: [_jsx("button", { type: "button", className: "data-club-ai-hub-admin__button", "data-testid": "create-user-cancel", onClick: props.onCancel, disabled: submitting, children: props.texts.createUserCancelButton }), _jsx("button", { type: "submit", className: "data-club-ai-hub-admin__button data-club-ai-hub-admin__button--primary", "data-testid": "create-user-submit", disabled: submitting || username.trim().length === 0, children: submitting
90
+ ? props.texts.createUserSubmittingButton
91
+ : props.texts.createUserSubmitButton })] })] }) }));
92
+ }
93
+ //# sourceMappingURL=CreateUserModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateUserModal.js","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/CreateUserModal.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,mDAAmD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AI,EACX,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAkB,CAAC,EACrD,SAAS,EAAC,qCAAqC,iBACnC,kBAAkB,EAC9B,QAAQ,EAAE,UAAU,YAEnB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClB,iBAAgB,KAAK,EAAE,CAAC,YACrB,SAAS,CAAC,CAAC,CAAC,IADF,CAAC,CAEL,CACV,CAAC,GACK,IACH,EACR,eAAK,SAAS,EAAC,uCAAuC,aACpD,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,gCAAgC,iBAC9B,oBAAoB,EAChC,OAAO,EAAE,KAAK,CAAC,QAAQ,EACvB,QAAQ,EAAE,UAAU,YAEnB,KAAK,CAAC,KAAK,CAAC,sBAAsB,GAC5B,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wEAAwE,iBACtE,oBAAoB,EAChC,QAAQ,EAAE,UAAU,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,YAEnD,UAAU;gCACT,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B;gCACxC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,GAC/B,IACL,IACD,GACH,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `<PasswordRevealModal />` — one-time-display of a server-generated
3
+ * password. Reused for the create-user and reset-password flows on the
4
+ * Admin Users page ([05-admin-users.md]).
5
+ *
6
+ * Once dismissed, the password is gone — there's no path back. The
7
+ * component never logs the value and never lifts it into any persistent
8
+ * store; it lives in the host component's local state until `onClose`.
9
+ *
10
+ * Behavior contracts:
11
+ *
12
+ * - Clicking the copy button writes the password to the clipboard and
13
+ * flashes the "Copied!" confirmation for ~2s. The flash uses a timer
14
+ * that the host doesn't need to manage.
15
+ * - There is no "click outside to dismiss" — the modal must be explicitly
16
+ * closed via the Done button. This is deliberate ([05-admin-users.md]):
17
+ * the admin can't accidentally lose the password by misclicking.
18
+ * - The password field is a read-only `<input>` so a screen-reader user
19
+ * can read + select it like any other text field (rather than putting
20
+ * it inside a `<div>` and forcing the user to mouse-drag-select).
21
+ *
22
+ * @see SPECIFICATIONS.md §8.5 — password reset semantics
23
+ * @see ui-sketches/05-admin-users.md — password_reveal_modal
24
+ */
25
+ import { type ReactNode } from "react";
26
+ import type { AIHubAdminTexts } from "../../auth/texts.js";
27
+ /**
28
+ * Props for `<PasswordRevealModal />`.
29
+ */
30
+ export interface PasswordRevealModalProps {
31
+ /** Modal-title variant — drives which texts key is used. */
32
+ variant: "create" | "reset";
33
+ /** Username the password belongs to. */
34
+ username: string;
35
+ /** The 16-char alphanumeric plaintext. Never logged; never stored. */
36
+ password: string;
37
+ /** Resolved admin texts (admin namespace). */
38
+ texts: AIHubAdminTexts;
39
+ /** Fired when the admin clicks Done — the password is unrecoverable after. */
40
+ onClose: () => void;
41
+ }
42
+ /**
43
+ * Renders the reveal modal.
44
+ *
45
+ * @param props - see `PasswordRevealModalProps`.
46
+ * @returns the rendered modal.
47
+ */
48
+ export declare function PasswordRevealModal(props: PasswordRevealModalProps): ReactNode;
49
+ //# sourceMappingURL=PasswordRevealModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordRevealModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/PasswordRevealModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,4DAA4D;IAC5D,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,KAAK,EAAE,eAAe,CAAC;IACvB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CAuJX"}
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<PasswordRevealModal />` — one-time-display of a server-generated
4
+ * password. Reused for the create-user and reset-password flows on the
5
+ * Admin Users page ([05-admin-users.md]).
6
+ *
7
+ * Once dismissed, the password is gone — there's no path back. The
8
+ * component never logs the value and never lifts it into any persistent
9
+ * store; it lives in the host component's local state until `onClose`.
10
+ *
11
+ * Behavior contracts:
12
+ *
13
+ * - Clicking the copy button writes the password to the clipboard and
14
+ * flashes the "Copied!" confirmation for ~2s. The flash uses a timer
15
+ * that the host doesn't need to manage.
16
+ * - There is no "click outside to dismiss" — the modal must be explicitly
17
+ * closed via the Done button. This is deliberate ([05-admin-users.md]):
18
+ * the admin can't accidentally lose the password by misclicking.
19
+ * - The password field is a read-only `<input>` so a screen-reader user
20
+ * can read + select it like any other text field (rather than putting
21
+ * it inside a `<div>` and forcing the user to mouse-drag-select).
22
+ *
23
+ * @see SPECIFICATIONS.md §8.5 — password reset semantics
24
+ * @see ui-sketches/05-admin-users.md — password_reveal_modal
25
+ */
26
+ import { useEffect, useRef, useState } from "react";
27
+ /**
28
+ * Renders the reveal modal.
29
+ *
30
+ * @param props - see `PasswordRevealModalProps`.
31
+ * @returns the rendered modal.
32
+ */
33
+ export function PasswordRevealModal(props) {
34
+ const [copied, setCopied] = useState(false);
35
+ // Stash the timeout id so unmount during the flash cleans up properly.
36
+ const flashTimer = useRef(null);
37
+ useEffect(() => {
38
+ return () => {
39
+ if (flashTimer.current !== null)
40
+ clearTimeout(flashTimer.current);
41
+ };
42
+ }, []);
43
+ async function handleCopy() {
44
+ // Two clipboard backends to cover JSDOM tests AND old browsers without
45
+ // the async clipboard API: prefer the modern one, fall back to
46
+ // `document.execCommand` via a hidden textarea.
47
+ let ok = false;
48
+ try {
49
+ if (typeof navigator !== "undefined" &&
50
+ navigator.clipboard?.writeText) {
51
+ await navigator.clipboard.writeText(props.password);
52
+ ok = true;
53
+ }
54
+ }
55
+ catch {
56
+ ok = false;
57
+ }
58
+ if (!ok && typeof document !== "undefined") {
59
+ try {
60
+ const ta = document.createElement("textarea");
61
+ ta.value = props.password;
62
+ ta.setAttribute("readonly", "");
63
+ ta.style.position = "absolute";
64
+ ta.style.left = "-9999px";
65
+ document.body.appendChild(ta);
66
+ ta.select();
67
+ try {
68
+ document.execCommand("copy");
69
+ ok = true;
70
+ }
71
+ finally {
72
+ document.body.removeChild(ta);
73
+ }
74
+ }
75
+ catch {
76
+ ok = false;
77
+ }
78
+ }
79
+ // Even if both paths failed (unlikely outside test envs), surface the
80
+ // flash so the admin knows their click registered; the password is
81
+ // still visible on screen for manual transcription.
82
+ setCopied(true);
83
+ if (flashTimer.current !== null)
84
+ clearTimeout(flashTimer.current);
85
+ flashTimer.current = setTimeout(() => setCopied(false), 2000);
86
+ }
87
+ const title = props.variant === "create"
88
+ ? props.texts.passwordRevealCreateTitle
89
+ : props.texts.passwordRevealResetTitle;
90
+ return (_jsx("div", { className: "data-club-ai-hub-admin__modal-backdrop", "data-testid": "password-reveal-modal-backdrop", role: "presentation", children: _jsxs("div", { className: "data-club-ai-hub-admin__modal data-club-ai-hub-admin__modal--password-reveal", role: "dialog", "aria-modal": "true", "aria-labelledby": "password-reveal-title", "data-testid": "password-reveal-modal", children: [_jsx("h2", { id: "password-reveal-title", className: "data-club-ai-hub-admin__modal-title", children: title }), _jsxs("p", { className: "data-club-ai-hub-admin__modal-warning", "data-testid": "password-reveal-warning", children: ["\u26A0 ", props.texts.passwordRevealWarning] }), _jsxs("label", { className: "data-club-ai-hub-admin__modal-field", "data-testid": "password-reveal-username-row", children: [_jsx("span", { className: "data-club-ai-hub-admin__modal-label", children: props.texts.passwordRevealUsernameLabel }), _jsx("input", { type: "text", readOnly: true, value: props.username, className: "data-club-ai-hub-admin__modal-input", "data-testid": "password-reveal-username" })] }), _jsxs("label", { className: "data-club-ai-hub-admin__modal-field", "data-testid": "password-reveal-password-row", children: [_jsx("span", { className: "data-club-ai-hub-admin__modal-label", children: props.texts.passwordRevealPasswordLabel }), _jsxs("div", { className: "data-club-ai-hub-admin__password-reveal-row", children: [_jsx("input", { type: "text", readOnly: true, value: props.password, className: "data-club-ai-hub-admin__modal-input data-club-ai-hub-admin__modal-input--password", "data-testid": "password-reveal-password", spellCheck: false }), _jsx("button", { type: "button", className: "data-club-ai-hub-admin__copy-button", "data-testid": "password-reveal-copy", "aria-label": props.texts.passwordRevealCopyAriaLabel, onClick: () => {
91
+ void handleCopy();
92
+ }, children: "\uD83D\uDCCB" }), copied ? (_jsx("span", { className: "data-club-ai-hub-admin__copy-flash", "data-testid": "password-reveal-copied-flash", role: "status", "aria-live": "polite", children: props.texts.passwordRevealCopiedFlash })) : null] })] }), _jsx("div", { className: "data-club-ai-hub-admin__modal-actions", children: _jsx("button", { type: "button", className: "data-club-ai-hub-admin__button data-club-ai-hub-admin__button--primary", "data-testid": "password-reveal-done", onClick: props.onClose, children: props.texts.passwordRevealDoneButton }) })] }) }));
93
+ }
94
+ //# sourceMappingURL=PasswordRevealModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordRevealModal.js","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/PasswordRevealModal.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAoBpE;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAA+B;IAE/B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GA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K,CAAC,QAAQ,EACrB,SAAS,EAAC,qCAAqC,iBACnC,0BAA0B,GACtC,IACI,EACR,iBACE,SAAS,EAAC,qCAAqC,iBACnC,8BAA8B,aAE1C,eAAM,SAAS,EAAC,qCAAqC,YAClD,KAAK,CAAC,KAAK,CAAC,2BAA2B,GACnC,EACP,eAAK,SAAS,EAAC,6CAA6C,aAC1D,gBACE,IAAI,EAAC,MAAM,EACX,QAAQ,QACR,KAAK,EAAE,KAAK,CAAC,QAAQ,EACrB,SAAS,EAAC,mFAAmF,iBACjF,0BAA0B,EACtC,UAAU,EAAE,KAAK,GACjB,EACF,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,qCAAqC,iBACnC,sBAAsB,gBACtB,KAAK,CAAC,KAAK,CAAC,2BAA2B,EACnD,OAAO,EAAE,GAAG,EAAE;wCACZ,KAAK,UAAU,EAAE,CAAC;oCACpB,CAAC,6BAGM,EACR,MAAM,CAAC,CAAC,CAAC,CACR,eACE,SAAS,EAAC,oCAAoC,iBAClC,8BAA8B,EAC1C,IAAI,EAAC,QAAQ,eACH,QAAQ,YAEjB,KAAK,CAAC,KAAK,CAAC,yBAAyB,GACjC,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,IACA,EACR,cAAK,SAAS,EAAC,uCAAuC,YACpD,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wEAAwE,iBACtE,sBAAsB,EAClC,OAAO,EAAE,KAAK,CAAC,OAAO,YAErB,KAAK,CAAC,KAAK,CAAC,wBAAwB,GAC9B,GACL,IACF,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `<ResetPasswordModal />` — Phase-1 confirm dialog for the password-reset
3
+ * flow ([05-admin-users.md]).
4
+ *
5
+ * Phase 2 (revealing the new plaintext) reuses `<PasswordRevealModal />`
6
+ * exactly as the create-user flow does — the parent (`<AdminUsersPage />`)
7
+ * owns the phase transition.
8
+ *
9
+ * @see SPECIFICATIONS.md §8.5 — password reset semantics
10
+ * @see ui-sketches/05-admin-users.md — reset_password_confirm_modal
11
+ */
12
+ import { type ReactNode } from "react";
13
+ import type { AIHubAdminTexts } from "../../auth/texts.js";
14
+ /**
15
+ * Props for `<ResetPasswordModal />`.
16
+ */
17
+ export interface ResetPasswordModalProps {
18
+ /** Username of the target — substituted into the modal title. */
19
+ username: string;
20
+ /** Resolved admin texts. */
21
+ texts: AIHubAdminTexts;
22
+ /**
23
+ * Confirms the reset. Resolves on success; throws on failure so the modal
24
+ * can surface the message inline.
25
+ */
26
+ onConfirm: () => Promise<void>;
27
+ /** Fired when the admin cancels — no server call. */
28
+ onCancel: () => void;
29
+ }
30
+ /**
31
+ * Renders the reset-password confirm modal.
32
+ *
33
+ * @param props - see `ResetPasswordModalProps`.
34
+ * @returns the rendered modal.
35
+ */
36
+ export declare function ResetPasswordModal(props: ResetPasswordModalProps): ReactNode;
37
+ //# sourceMappingURL=ResetPasswordModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPasswordModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/ResetPasswordModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,SAAS,CAiFX"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<ResetPasswordModal />` — Phase-1 confirm dialog for the password-reset
4
+ * flow ([05-admin-users.md]).
5
+ *
6
+ * Phase 2 (revealing the new plaintext) reuses `<PasswordRevealModal />`
7
+ * exactly as the create-user flow does — the parent (`<AdminUsersPage />`)
8
+ * owns the phase transition.
9
+ *
10
+ * @see SPECIFICATIONS.md §8.5 — password reset semantics
11
+ * @see ui-sketches/05-admin-users.md — reset_password_confirm_modal
12
+ */
13
+ import { useState } from "react";
14
+ /**
15
+ * Renders the reset-password confirm modal.
16
+ *
17
+ * @param props - see `ResetPasswordModalProps`.
18
+ * @returns the rendered modal.
19
+ */
20
+ export function ResetPasswordModal(props) {
21
+ const [submitting, setSubmitting] = useState(false);
22
+ const [errorText, setErrorText] = useState(null);
23
+ async function handleConfirm() {
24
+ setErrorText(null);
25
+ setSubmitting(true);
26
+ try {
27
+ await props.onConfirm();
28
+ }
29
+ catch (err) {
30
+ const message = err instanceof Error && err.message
31
+ ? err.message
32
+ : props.texts.resetPasswordGenericError;
33
+ setErrorText(message);
34
+ setSubmitting(false);
35
+ }
36
+ }
37
+ const title = props.texts.resetPasswordModalTitle.replace("{username}", props.username);
38
+ return (_jsx("div", { className: "data-club-ai-hub-admin__modal-backdrop", role: "presentation", children: _jsxs("div", { className: "data-club-ai-hub-admin__modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "reset-password-modal-title", "data-testid": "reset-password-modal", children: [_jsx("h2", { id: "reset-password-modal-title", className: "data-club-ai-hub-admin__modal-title", children: title }), errorText !== null ? (_jsx("div", { className: "data-club-ai-hub-admin__modal-error", "data-testid": "reset-password-error", role: "alert", children: errorText })) : null, _jsx("p", { className: "data-club-ai-hub-admin__modal-body", children: props.texts.resetPasswordModalBody }), _jsxs("div", { className: "data-club-ai-hub-admin__modal-actions", children: [_jsx("button", { type: "button", className: "data-club-ai-hub-admin__button", "data-testid": "reset-password-cancel", onClick: props.onCancel, disabled: submitting, children: props.texts.resetPasswordCancelButton }), _jsx("button", { type: "button", className: "data-club-ai-hub-admin__button data-club-ai-hub-admin__button--primary", "data-testid": "reset-password-confirm", onClick: () => {
39
+ void handleConfirm();
40
+ }, disabled: submitting, children: submitting
41
+ ? props.texts.resetPasswordConfirmingButton
42
+ : props.texts.resetPasswordConfirmButton })] })] }) }));
43
+ }
44
+ //# sourceMappingURL=ResetPasswordModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPasswordModal.js","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/ResetPasswordModal.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAqBjD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA8B;IAE9B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAEhE,KAAK,UAAU,aAAa;QAC1B,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO;gBACjC,CAAC,CAAC,GAAG,CAAC,OAAO;gBACb,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC;YAC5C,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,CACvD,YAAY,EACZ,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAC,wCAAwC,EAClD,IAAI,EAAC,cAAc,YAEnB,eACE,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAC,QAAQ,gBACF,MAAM,qBACD,4BAA4B,iBAChC,sBAAsB,aAElC,aACE,EAAE,EAAC,4BAA4B,EAC/B,SAAS,EAAC,qCAAqC,YAE9C,KAAK,GACH,EACJ,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,CACpB,cACE,SAAS,EAAC,qCAAqC,iBACnC,sBAAsB,EAClC,IAAI,EAAC,OAAO,YAEX,SAAS,GACN,CACP,CAAC,CAAC,CAAC,IAAI,EACR,YAAG,SAAS,EAAC,oCAAoC,YAC9C,KAAK,CAAC,KAAK,CAAC,sBAAsB,GACjC,EACJ,eAAK,SAAS,EAAC,uCAAuC,aACpD,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,gCAAgC,iBAC9B,uBAAuB,EACnC,OAAO,EAAE,KAAK,CAAC,QAAQ,EACvB,QAAQ,EAAE,UAAU,YAEnB,KAAK,CAAC,KAAK,CAAC,yBAAyB,GAC/B,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wEAAwE,iBACtE,wBAAwB,EACpC,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,aAAa,EAAE,CAAC;4BACvB,CAAC,EACD,QAAQ,EAAE,UAAU,YAEnB,UAAU;gCACT,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,6BAA6B;gCAC3C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,GACnC,IACL,IACF,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * `<RotatingMessageEditorModal />` — shared create + edit modal for the
3
+ * Rotating messages sub-page.
4
+ *
5
+ * Fields: display name, prompt (textarea), raw Letta agent id, and a schedule
6
+ * picker offering the two presets (`every N hours/days`, `daily at HH:MM`) plus
7
+ * an advanced cron escape hatch. The modal owns local required-field validation
8
+ * and the schedule-shape assembly; the parent page owns the network call.
9
+ *
10
+ * Errors surface inline for field-targeted server codes
11
+ * (`letta_agent_not_found` → agent field, `invalid_schedule` → schedule) and as
12
+ * a banner otherwise.
13
+ *
14
+ * @see docs/server/rotating-messages.md
15
+ */
16
+ import { type ReactNode } from "react";
17
+ import type { AIHubAdminTexts } from "../../auth/texts.js";
18
+ import { type RotatingMessageScheduleKind } from "../../client/AIHubClient.js";
19
+ /** Create vs edit. */
20
+ export type RotatingEditorMode = "create" | "edit";
21
+ /** Initial values for the edit variant. */
22
+ export interface RotatingEditorInitial {
23
+ displayName: string;
24
+ prompt: string;
25
+ lettaAgentId: string;
26
+ scheduleKind: RotatingMessageScheduleKind;
27
+ intervalSeconds: number | null;
28
+ dailyTime: string | null;
29
+ cronExpression: string | null;
30
+ }
31
+ /** Submit body passed up to the parent page. */
32
+ export interface RotatingEditorSubmitBody {
33
+ displayName: string;
34
+ prompt: string;
35
+ lettaAgentId: string;
36
+ scheduleKind: RotatingMessageScheduleKind;
37
+ intervalSeconds: number | null;
38
+ dailyTime: string | null;
39
+ cronExpression: string | null;
40
+ }
41
+ /** Props for `<RotatingMessageEditorModal />`. */
42
+ export interface RotatingMessageEditorModalProps {
43
+ mode: RotatingEditorMode;
44
+ initial?: RotatingEditorInitial;
45
+ texts: AIHubAdminTexts;
46
+ onSubmit: (body: RotatingEditorSubmitBody) => Promise<void>;
47
+ onCancel: () => void;
48
+ }
49
+ /**
50
+ * Renders the create / edit form.
51
+ *
52
+ * @param props - see {@link RotatingMessageEditorModalProps}.
53
+ * @returns the modal markup.
54
+ */
55
+ export declare function RotatingMessageEditorModal(props: RotatingMessageEditorModalProps): ReactNode;
56
+ //# sourceMappingURL=RotatingMessageEditorModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RotatingMessageEditorModal.d.ts","sourceRoot":"","sources":["../../../src/components/DataClubAIHubAdmin/RotatingMessageEditorModal.tsx"],"names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