@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,123 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * `<DataClubAIHubLogin />` — the built-in login screen.
4
+ *
5
+ * Auto-rendered by `<DataClubAIHub />` (and `AIHub.AuthGate`) when no
6
+ * valid session token is present. Per §7.2.1 + §7.3 + §8.5, this screen
7
+ * is **library-owned** — there is no escape hatch in v1 to substitute a
8
+ * custom React component. Wrappers brand it via `productName` /
9
+ * `usernamePlaceholder` props, `texts` for localization, the BEM class
10
+ * contract, and CSS custom properties on `.data-club-ai-hub`.
11
+ *
12
+ * Behavior summary:
13
+ *
14
+ * - Submit → `useAIHubAuth().login(username, password)`.
15
+ * - On success with `mustChangePassword === false` → fires `onLoggedIn(user)`.
16
+ * `AIHub.AuthGate` listens to `mustChangePassword` and routes to the
17
+ * forced-change screen automatically; this component does not navigate
18
+ * on its own.
19
+ * - On failure → shows the `error_message` banner above the form; inputs
20
+ * stay editable.
21
+ * - No "Forgot password?" link, no "Sign up" link — per v1 spec; the
22
+ * `forgot_password_note` is plain helper text.
23
+ *
24
+ * @see SPECIFICATIONS.md §7.2.1 — `<DataClubAIHubLogin />` props
25
+ * @see SPECIFICATIONS.md §8.5 — login flow + initial-password handling
26
+ * @see ui-sketches/01-login.md — visual contract for every region
27
+ */
28
+ import { useState } from "react";
29
+ import { useAIHubAuth } from "../../context/useAIHubAuth.js";
30
+ import { AIHubRequestError } from "../../client/AIHubClient.js";
31
+ import { resolveAIHubTexts } from "../../auth/texts.js";
32
+ import { PasswordInput } from "../internal/PasswordInput.js";
33
+ /**
34
+ * Default BEM class names. Stable, kebab-case, scoped under
35
+ * `data-club-ai-hub__login`. Wrappers override individual entries via
36
+ * the `classNames` prop.
37
+ */
38
+ const DEFAULT_CLASS_NAMES = Object.freeze({
39
+ root: "data-club-ai-hub__login",
40
+ card: "data-club-ai-hub__login-card",
41
+ title: "data-club-ai-hub__login-card__title",
42
+ errorBanner: "data-club-ai-hub__login-card__error",
43
+ form: "data-club-ai-hub__login-card__form",
44
+ fieldGroup: "data-club-ai-hub__login-card__field",
45
+ fieldLabel: "data-club-ai-hub__login-card__label",
46
+ textInput: "data-club-ai-hub__login-card__input",
47
+ passwordWrapper: "data-club-ai-hub__login-card__password",
48
+ passwordInput: "data-club-ai-hub__login-card__input data-club-ai-hub__login-card__input--password",
49
+ passwordToggle: "data-club-ai-hub__login-card__toggle",
50
+ submitButton: "data-club-ai-hub__login-card__submit",
51
+ spinner: "data-club-ai-hub__spinner",
52
+ forgotNote: "data-club-ai-hub__login-card__forgot",
53
+ });
54
+ /**
55
+ * Renders the login card.
56
+ *
57
+ * Always reads auth state from the nearest `<AIHubProvider>` — there is no
58
+ * "controlled" mode where a parent supplies the username / password / submit
59
+ * handler.
60
+ *
61
+ * @param props - see `DataClubAIHubLoginProps`.
62
+ * @returns the rendered card.
63
+ */
64
+ export function DataClubAIHubLogin(props) {
65
+ const auth = useAIHubAuth();
66
+ const classes = { ...DEFAULT_CLASS_NAMES, ...(props.classNames ?? {}) };
67
+ const texts = resolveAIHubTexts(props.texts).login;
68
+ const productName = props.productName ?? "ai-hub";
69
+ const [username, setUsername] = useState("");
70
+ const [password, setPassword] = useState("");
71
+ const [submitting, setSubmitting] = useState(false);
72
+ const [errorMessage, setErrorMessage] = useState(null);
73
+ const handleSubmit = async (e) => {
74
+ e.preventDefault();
75
+ if (submitting)
76
+ return;
77
+ if (username.length === 0 || password.length === 0)
78
+ return;
79
+ setSubmitting(true);
80
+ setErrorMessage(null);
81
+ try {
82
+ const result = await auth.login(username, password);
83
+ // AuthGate watches `mustChangePassword` to switch screens — this
84
+ // component just notifies the parent when the login was definitive.
85
+ // Reading the user from `result` (not from `auth.user`) avoids the
86
+ // stale-closure pitfall: the surrounding `auth` snapshot was taken
87
+ // before `setUser` re-rendered the provider, so `auth.user` here is
88
+ // still null.
89
+ if (!result.mustChangePassword && props.onLoggedIn) {
90
+ props.onLoggedIn(result.user);
91
+ }
92
+ }
93
+ catch (err) {
94
+ if (err instanceof AIHubRequestError) {
95
+ // Map the wire error code to a localized banner.
96
+ if (err.code === "unauthorized" || err.status === 401) {
97
+ setErrorMessage(texts.invalidCredentialsError);
98
+ }
99
+ else if (err.code === "network") {
100
+ setErrorMessage(texts.networkError);
101
+ }
102
+ else {
103
+ // Fall back to the server's message — it's safe to surface per §9.
104
+ setErrorMessage(err.message || texts.invalidCredentialsError);
105
+ }
106
+ }
107
+ else {
108
+ setErrorMessage(texts.networkError);
109
+ }
110
+ }
111
+ finally {
112
+ setSubmitting(false);
113
+ }
114
+ };
115
+ const submitDisabled = submitting || username.length === 0 || password.length === 0;
116
+ const rootClass = props.className !== undefined
117
+ ? `${classes.root} ${props.className}`
118
+ : classes.root;
119
+ return (_jsx("div", { className: rootClass, "data-testid": "login-root", children: _jsxs("div", { className: classes.card, role: "form", "aria-labelledby": "dc-aih-login-title", children: [_jsx("h1", { id: "dc-aih-login-title", className: classes.title, children: productName }), errorMessage !== null ? (_jsx("div", { className: classes.errorBanner, role: "alert", "aria-live": "polite", "data-testid": "login-error", children: errorMessage })) : null, _jsxs("form", { className: classes.form, onSubmit: handleSubmit, noValidate: true, children: [_jsxs("div", { className: classes.fieldGroup, children: [_jsx("label", { htmlFor: "dc-aih-login-username", className: classes.fieldLabel, children: texts.usernameLabel }), _jsx("input", { id: "dc-aih-login-username", type: "text", name: "username", autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), ...(props.usernamePlaceholder
120
+ ? { placeholder: props.usernamePlaceholder }
121
+ : {}), disabled: submitting, required: true, autoFocus: true, className: classes.textInput })] }), _jsxs("div", { className: classes.fieldGroup, children: [_jsx("label", { htmlFor: "dc-aih-login-password", className: classes.fieldLabel, children: texts.passwordLabel }), _jsx(PasswordInput, { id: "dc-aih-login-password", value: password, onChange: setPassword, name: "password", autoComplete: "current-password", disabled: submitting, required: true, showAriaLabel: texts.showPasswordAriaLabel, hideAriaLabel: texts.hidePasswordAriaLabel, wrapperClassName: classes.passwordWrapper, inputClassName: classes.passwordInput, toggleClassName: classes.passwordToggle, testId: "login-password-field" })] }), _jsx("button", { type: "submit", className: classes.submitButton, disabled: submitDisabled, "data-testid": "login-submit", children: submitting ? (_jsxs(_Fragment, { children: [_jsx("span", { className: classes.spinner, "aria-hidden": "true" }), texts.signingInButton] })) : (texts.signInButton) })] }), _jsx("p", { className: classes.forgotNote, "data-testid": "login-forgot-note", children: texts.forgotPasswordNote })] }) }));
122
+ }
123
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DataClubAIHubLogin/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAqC,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAsC7D;;;;GAIG;AACH,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,qCAAqC;IAC5C,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,oCAAoC;IAC1C,UAAU,EAAE,qCAAqC;IACjD,UAAU,EAAE,qCAAqC;IACjD,SAAS,EAAE,qC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AC1B,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAC,UAAU,EACf,YAAY,EAAC,kBAAkB,EAC/B,QAAQ,EAAE,UAAU,EACpB,QAAQ,QACR,aAAa,EAAE,KAAK,CAAC,qBAAqB,EAC1C,aAAa,EAAE,KAAK,CAAC,qBAAqB,EAC1C,gBAAgB,EAAE,OAAO,CAAC,eAAe,EACzC,cAAc,EAAE,OAAO,CAAC,aAAa,EACrC,eAAe,EAAE,OAAO,CAAC,cAAc,EACvC,MAAM,EAAC,sBAAsB,GAC7B,IACE,EAEN,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,CAAC,YAAY,EAC/B,QAAQ,EAAE,cAAc,iBACZ,cAAc,YAEzB,UAAU,CAAC,CAAC,CAAC,CACZ,8BACE,eAAM,SAAS,EAAE,OAAO,CAAC,OAAO,iBAAc,MAAM,GAAG,EACtD,KAAK,CAAC,eAAe,IACrB,CACJ,CAAC,CAAC,CAAC,CACF,KAAK,CAAC,YAAY,CACnB,GACM,IACJ,EAEP,YAAG,SAAS,EAAE,OAAO,CAAC,UAAU,iBAAc,mBAAmB,YAC9D,KAAK,CAAC,kBAAkB,GACvB,IACA,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * `<EffortControl />` — the per-message reasoning-effort dropdown.
3
+ *
4
+ * Mirrors Letta's ADE enum exactly: `None | Minimal | Low | Medium | High |
5
+ * Extra High` (snake-cased on the wire — `extra_high`). **`None` is the
6
+ * off state** for reasoning; there is no separate thinking/reasoning
7
+ * toggle. Per-message: the user changes effort, the next `sendMessage`
8
+ * picks it up, and the value sticks until the user changes it again
9
+ * (within the session — `setEffort` lives on the provider).
10
+ *
11
+ * Renders nothing when `effortControlVisible === false` upstream
12
+ * (server toggle wins over the React prop per §8.4). The component
13
+ * accepts the resolved boolean as an explicit prop so the predicate
14
+ * isn't re-derived at every render site.
15
+ *
16
+ * Exported under `AIHub.EffortControl`.
17
+ *
18
+ * @see SPECIFICATIONS.md §7.4 — reasoning effort
19
+ * @see ui-sketches/03-chat.md — effort_control
20
+ */
21
+ import { type ReactNode } from "react";
22
+ import { type AIHubTexts, type DeepPartial } from "../../auth/texts.js";
23
+ import type { AIHubEffort } from "../../client/AIHubClient.js";
24
+ /** BEM class names emitted by `<EffortControl />`. */
25
+ export interface EffortControlClassNames {
26
+ /** The label-wrapping container. */
27
+ root: string;
28
+ /** The label text. */
29
+ label: string;
30
+ /** The select element. */
31
+ select: string;
32
+ }
33
+ /**
34
+ * Ordered list of every effort value — used by the renderer + by tests
35
+ * that want to assert the dropdown's option set without re-deriving the
36
+ * order.
37
+ */
38
+ export declare const EFFORT_VALUES: ReadonlyArray<AIHubEffort>;
39
+ /** Props for `<EffortControl />`. */
40
+ export interface EffortControlProps {
41
+ /** Disable the control (e.g. while a turn is streaming). Default false. */
42
+ disabled?: boolean;
43
+ /** Wrapper-supplied i18n. */
44
+ texts?: DeepPartial<AIHubTexts>;
45
+ /** Extra class merged onto the root. */
46
+ className?: string;
47
+ /** Per-element class overrides. */
48
+ classNames?: Partial<EffortControlClassNames>;
49
+ }
50
+ /**
51
+ * Renders the effort dropdown.
52
+ *
53
+ * @param props - see `EffortControlProps`.
54
+ * @returns the rendered dropdown.
55
+ */
56
+ export declare function EffortControl(props: EffortControlProps): ReactNode;
57
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EffortControl/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,WAAW,CAOnD,CAAC;AA6BH,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAChC,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CA+BlE"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<EffortControl />` — the per-message reasoning-effort dropdown.
4
+ *
5
+ * Mirrors Letta's ADE enum exactly: `None | Minimal | Low | Medium | High |
6
+ * Extra High` (snake-cased on the wire — `extra_high`). **`None` is the
7
+ * off state** for reasoning; there is no separate thinking/reasoning
8
+ * toggle. Per-message: the user changes effort, the next `sendMessage`
9
+ * picks it up, and the value sticks until the user changes it again
10
+ * (within the session — `setEffort` lives on the provider).
11
+ *
12
+ * Renders nothing when `effortControlVisible === false` upstream
13
+ * (server toggle wins over the React prop per §8.4). The component
14
+ * accepts the resolved boolean as an explicit prop so the predicate
15
+ * isn't re-derived at every render site.
16
+ *
17
+ * Exported under `AIHub.EffortControl`.
18
+ *
19
+ * @see SPECIFICATIONS.md §7.4 — reasoning effort
20
+ * @see ui-sketches/03-chat.md — effort_control
21
+ */
22
+ import {} from "react";
23
+ import { resolveAIHubTexts, } from "../../auth/texts.js";
24
+ import { useAIHub } from "../../context/useAIHub.js";
25
+ const DEFAULT_CLASS_NAMES = Object.freeze({
26
+ root: "data-club-ai-hub__effort-control",
27
+ label: "data-club-ai-hub__effort-control__label",
28
+ select: "data-club-ai-hub__effort-control__select",
29
+ });
30
+ /**
31
+ * Ordered list of every effort value — used by the renderer + by tests
32
+ * that want to assert the dropdown's option set without re-deriving the
33
+ * order.
34
+ */
35
+ export const EFFORT_VALUES = Object.freeze([
36
+ "none",
37
+ "minimal",
38
+ "low",
39
+ "medium",
40
+ "high",
41
+ "extra_high",
42
+ ]);
43
+ /**
44
+ * Resolves the i18n label for a given effort value.
45
+ *
46
+ * @param value - the effort enum value.
47
+ * @param texts - resolved chat texts.
48
+ * @returns the display label.
49
+ */
50
+ function labelForEffort(value, texts) {
51
+ switch (value) {
52
+ case "none":
53
+ return texts.effortNone;
54
+ case "minimal":
55
+ return texts.effortMinimal;
56
+ case "low":
57
+ return texts.effortLow;
58
+ case "medium":
59
+ return texts.effortMedium;
60
+ case "high":
61
+ return texts.effortHigh;
62
+ case "extra_high":
63
+ return texts.effortExtraHigh;
64
+ }
65
+ }
66
+ /**
67
+ * Renders the effort dropdown.
68
+ *
69
+ * @param props - see `EffortControlProps`.
70
+ * @returns the rendered dropdown.
71
+ */
72
+ export function EffortControl(props) {
73
+ const { effort, setEffort } = useAIHub();
74
+ const texts = resolveAIHubTexts(props.texts);
75
+ const cls = { ...DEFAULT_CLASS_NAMES, ...(props.classNames ?? {}) };
76
+ const rootClass = props.className
77
+ ? `${cls.root} ${props.className}`
78
+ : cls.root;
79
+ function handleChange(e) {
80
+ setEffort(e.target.value);
81
+ }
82
+ return (_jsxs("label", { className: rootClass, "data-testid": "effort-control", children: [_jsx("span", { className: cls.label, children: texts.chat.effortLabel }), _jsx("select", { className: cls.select, value: effort, onChange: handleChange, disabled: props.disabled, "data-testid": "effort-control-select", "aria-label": texts.chat.effortLabel, children: EFFORT_VALUES.map((value) => (_jsx("option", { value: value, children: labelForEffort(value, texts.chat) }, value))) })] }));
83
+ }
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/EffortControl/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,EACL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAYrD,MAAM,mBAAmB,GAA4B,MAAM,CAAC,MAAM,CAAC;IACjE,IAAI,EAAE,kCAAkC;IACxC,KAAK,EAAE,yCAAyC;IAChD,MAAM,EAAE,0CAA0C;CACnD,CAA4B,CAAC;AAE9B;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,MAAM,CAAC,MAAM,CAAC;IACrE,MAAM;IACN,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM;IACN,YAAY;CACb,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,cAAc,CACrB,KAAkB,EAClB,KAAyB;IAEzB,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,UAAU,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,aAAa,CAAC;QAC7B,KAAK,KAAK;YACR,OAAO,KAAK,CAAC,SAAS,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,YAAY,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,UAAU,CAAC;QAC1B,KAAK,YAAY;YACf,OAAO,KAAK,CAAC,eAAe,CAAC;IACjC,CAAC;AACH,CAAC;AAcD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,EAAE,GAAG,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;IACpE,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS;QAC/B,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,SAAS,EAAE;QAClC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IAEb,SAAS,YAAY,CAAC,CAAiC;QACrD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAoB,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CACL,iBAAO,SAAS,EAAE,SAAS,iBAAc,gBAAgB,aACvD,eAAM,SAAS,EAAE,GAAG,CAAC,KAAK,YAAG,KAAK,CAAC,IAAI,CAAC,WAAW,GAAQ,EAC3D,iBACE,SAAS,EAAE,GAAG,CAAC,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,iBACZ,uBAAuB,gBACvB,KAAK,CAAC,IAAI,CAAC,WAAW,YAEjC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5B,iBAAoB,KAAK,EAAE,KAAK,YAC7B,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IADvB,KAAK,CAET,CACV,CAAC,GACK,IACH,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * `<Layout />` — the flex container holding the sessions panel beside the
3
+ * main column.
4
+ *
5
+ * The default monolith puts the sessions panel on the left at 25% width;
6
+ * Tier 3 wrappers use this primitive directly to flip the position
7
+ * (`panelPosition="right"`) or to drop the panel entirely.
8
+ *
9
+ * Exported under `AIHub.Layout`.
10
+ *
11
+ * @see SPECIFICATIONS.md §7.1 — exports
12
+ * @see SPECIFICATIONS.md §7.9 — Tier-3 composition
13
+ * @see ui-sketches/03-chat.md — sessions_panel + main_column
14
+ */
15
+ import { type ReactNode } from "react";
16
+ /**
17
+ * BEM class names emitted by `<Layout />`. The class names react to the
18
+ * `panelPosition` prop via a single modifier on the root.
19
+ */
20
+ export interface LayoutClassNames {
21
+ /** Outer flex container. */
22
+ root: string;
23
+ /** Modifier appended when `panelPosition === "left"` (default). */
24
+ rootPanelLeft: string;
25
+ /** Modifier appended when `panelPosition === "right"`. */
26
+ rootPanelRight: string;
27
+ }
28
+ /**
29
+ * Props for `<Layout />`.
30
+ */
31
+ export interface LayoutProps {
32
+ /**
33
+ * Which side the sessions panel sits on. Defaults to `"left"`.
34
+ * `<DataClubAIHub />` forwards its `sessionsPanelPosition` prop here.
35
+ */
36
+ panelPosition?: "left" | "right";
37
+ /**
38
+ * Sessions panel width in percent. Defaults to `25`. Layout only uses
39
+ * this for the CSS custom property `--dc-aih-sessions-panel-width`;
40
+ * the panel itself reads it.
41
+ */
42
+ panelWidthPercent?: number;
43
+ /** Extra className merged onto the root. */
44
+ className?: string;
45
+ /** Per-element class overrides. */
46
+ classNames?: Partial<LayoutClassNames>;
47
+ /**
48
+ * Children — typically `<SessionsPanel />` and `<MainColumn />` in
49
+ * either order; this primitive trusts the caller to put them in DOM
50
+ * order. The `panelPosition` modifier flips the visual order via
51
+ * `flex-direction: row-reverse` in CSS, so the sessions panel is
52
+ * always rendered first in the DOM regardless.
53
+ */
54
+ children: ReactNode;
55
+ }
56
+ /**
57
+ * Renders the layout container.
58
+ *
59
+ * @param props - see `LayoutProps`.
60
+ * @returns the rendered layout.
61
+ */
62
+ export declare function Layout(props: LayoutProps): ReactNode;
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;CACxB;AAQD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAoBpD"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * `<Layout />` — the flex container holding the sessions panel beside the
4
+ * main column.
5
+ *
6
+ * The default monolith puts the sessions panel on the left at 25% width;
7
+ * Tier 3 wrappers use this primitive directly to flip the position
8
+ * (`panelPosition="right"`) or to drop the panel entirely.
9
+ *
10
+ * Exported under `AIHub.Layout`.
11
+ *
12
+ * @see SPECIFICATIONS.md §7.1 — exports
13
+ * @see SPECIFICATIONS.md §7.9 — Tier-3 composition
14
+ * @see ui-sketches/03-chat.md — sessions_panel + main_column
15
+ */
16
+ import {} from "react";
17
+ const DEFAULT_CLASS_NAMES = Object.freeze({
18
+ root: "data-club-ai-hub__layout",
19
+ rootPanelLeft: "data-club-ai-hub__layout--panel-left",
20
+ rootPanelRight: "data-club-ai-hub__layout--panel-right",
21
+ });
22
+ /**
23
+ * Renders the layout container.
24
+ *
25
+ * @param props - see `LayoutProps`.
26
+ * @returns the rendered layout.
27
+ */
28
+ export function Layout(props) {
29
+ const cls = { ...DEFAULT_CLASS_NAMES, ...(props.classNames ?? {}) };
30
+ const position = props.panelPosition ?? "left";
31
+ const widthPercent = props.panelWidthPercent ?? 25;
32
+ const rootClasses = [
33
+ cls.root,
34
+ position === "right" ? cls.rootPanelRight : cls.rootPanelLeft,
35
+ props.className,
36
+ ]
37
+ .filter(Boolean)
38
+ .join(" ");
39
+ const style = {
40
+ // Custom property consumed by the sessions panel.
41
+ ["--dc-aih-sessions-panel-width"]: `${widthPercent}%`,
42
+ };
43
+ return (_jsx("div", { className: rootClasses, "data-testid": "layout", style: style, children: props.children }));
44
+ }
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAsC,MAAM,OAAO,CAAC;AAe3D,MAAM,mBAAmB,GAAqB,MAAM,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,0BAA0B;IAChC,aAAa,EAAE,sCAAsC;IACrD,cAAc,EAAE,uCAAuC;CACxD,CAAqB,CAAC;AA+BvB;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,GAAG,GAAG,EAAE,GAAG,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;IACpE,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,IAAI,MAAM,CAAC;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG;QAClB,GAAG,CAAC,IAAI;QACR,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa;QAC7D,KAAK,CAAC,SAAS;KAChB;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,KAAK,GAAkB;QAC3B,kDAAkD;QAClD,CAAC,+BAAsD,CAAC,EAAE,GAAG,YAAY,GAAG;KAC5D,CAAC;IACnB,OAAO,CACL,cAAK,SAAS,EAAE,WAAW,iBAAc,QAAQ,EAAC,KAAK,EAAE,KAAK,YAC3D,KAAK,CAAC,QAAQ,GACX,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * `<MainColumn />` — the right side of the chat layout: chat header on
3
+ * top, scrollable message list in the middle, input area on the bottom.
4
+ *
5
+ * Step 10 mounts `<TurnStatusIndicator />` in the chat header to the right
6
+ * of the agent display name (gated by `showTurnStatus`, which the
7
+ * upstream §8.4 resolver passes in as a boolean prop). The
8
+ * `customHeaderContent` slot remains the wrapper-owned right-side slot
9
+ * (rendered after the turn-status indicator).
10
+ *
11
+ * Exported under `AIHub.MainColumn`.
12
+ *
13
+ * @see SPECIFICATIONS.md §7.1 — exports
14
+ * @see ui-sketches/03-chat.md — main_column + chat_header
15
+ */
16
+ import { type ReactNode } from "react";
17
+ import { type AIHubTexts, type DeepPartial } from "../../auth/texts.js";
18
+ /**
19
+ * BEM class names emitted by `<MainColumn />`.
20
+ */
21
+ export interface MainColumnClassNames {
22
+ /** Outer column. */
23
+ root: string;
24
+ /** Chat header strip at the top. */
25
+ header: string;
26
+ /** Back-to-agents-picker link. */
27
+ back: string;
28
+ /** Agent display-name text. */
29
+ title: string;
30
+ /** Wrapper for slot content on the right side of the header. */
31
+ extras: string;
32
+ /** Children container (messages + input live here). */
33
+ body: string;
34
+ }
35
+ /**
36
+ * Props for `<MainColumn />`.
37
+ */
38
+ export interface MainColumnProps {
39
+ /**
40
+ * Whether the back link to the agents picker is shown. Controlled by
41
+ * `<DataClubAIHub />`'s `showAgentsPicker` prop (the monolith hides
42
+ * the link in single-agent embeds). Defaults to true.
43
+ */
44
+ showBackToAgents?: boolean;
45
+ /**
46
+ * Whether to mount the turn-status indicator in the chat header.
47
+ * Receives the resolved §8.4 flag stack (server toggle > prop >
48
+ * default). Defaults to true.
49
+ */
50
+ showTurnStatus?: boolean;
51
+ /** Slot rendered on the right side of the chat header. */
52
+ customHeaderContent?: ReactNode;
53
+ /** The children — `<MessageList />` + `<MessageInput />` (or whatever). */
54
+ children: ReactNode;
55
+ /** Extra class merged onto the root. */
56
+ className?: string;
57
+ /** Per-element class overrides. */
58
+ classNames?: Partial<MainColumnClassNames>;
59
+ /** Wrapper-supplied i18n. */
60
+ texts?: DeepPartial<AIHubTexts>;
61
+ }
62
+ /**
63
+ * Renders the main column.
64
+ *
65
+ * @param props - see `MainColumnProps`.
66
+ * @returns the rendered column.
67
+ */
68
+ export declare function MainColumn(props: MainColumnProps): ReactNode;
69
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MainColumn/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAK7B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAWD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC3C,6BAA6B;IAC7B,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CA0C5D"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<MainColumn />` — the right side of the chat layout: chat header on
4
+ * top, scrollable message list in the middle, input area on the bottom.
5
+ *
6
+ * Step 10 mounts `<TurnStatusIndicator />` in the chat header to the right
7
+ * of the agent display name (gated by `showTurnStatus`, which the
8
+ * upstream §8.4 resolver passes in as a boolean prop). The
9
+ * `customHeaderContent` slot remains the wrapper-owned right-side slot
10
+ * (rendered after the turn-status indicator).
11
+ *
12
+ * Exported under `AIHub.MainColumn`.
13
+ *
14
+ * @see SPECIFICATIONS.md §7.1 — exports
15
+ * @see ui-sketches/03-chat.md — main_column + chat_header
16
+ */
17
+ import { useMemo } from "react";
18
+ import { resolveAIHubTexts, } from "../../auth/texts.js";
19
+ import { useAIHub } from "../../context/useAIHub.js";
20
+ import { TurnStatusIndicator } from "../TurnStatusIndicator/index.js";
21
+ const DEFAULT_CLASS_NAMES = Object.freeze({
22
+ root: "data-club-ai-hub__main-column",
23
+ header: "data-club-ai-hub__chat-header",
24
+ back: "data-club-ai-hub__chat-header__back",
25
+ title: "data-club-ai-hub__chat-header__title",
26
+ extras: "data-club-ai-hub__chat-header__extras",
27
+ body: "data-club-ai-hub__main-column__body",
28
+ });
29
+ /**
30
+ * Renders the main column.
31
+ *
32
+ * @param props - see `MainColumnProps`.
33
+ * @returns the rendered column.
34
+ */
35
+ export function MainColumn(props) {
36
+ const { agents, activeAgentId, setActiveAgent } = useAIHub();
37
+ const texts = resolveAIHubTexts(props.texts);
38
+ const cls = { ...DEFAULT_CLASS_NAMES, ...(props.classNames ?? {}) };
39
+ const showBack = props.showBackToAgents ?? true;
40
+ const showTurnStatus = props.showTurnStatus ?? true;
41
+ const activeAgent = useMemo(() => agents.find((a) => a.id === activeAgentId) ?? null, [agents, activeAgentId]);
42
+ const rootClass = props.className
43
+ ? `${cls.root} ${props.className}`
44
+ : cls.root;
45
+ return (_jsxs("section", { className: rootClass, "data-testid": "main-column", children: [_jsxs("header", { className: cls.header, "data-testid": "chat-header", children: [showBack ? (_jsx("button", { type: "button", className: cls.back, onClick: () => setActiveAgent(null), "data-testid": "chat-header-back", children: texts.chat.backToAgentsLink })) : null, _jsx("h2", { className: cls.title, "data-testid": "chat-header-title", children: activeAgent?.display_name ?? "" }), showTurnStatus ? _jsx(TurnStatusIndicator, {}) : null, props.customHeaderContent ? (_jsx("div", { className: cls.extras, "data-testid": "chat-header-extras", children: props.customHeaderContent })) : null] }), _jsx("div", { className: cls.body, children: props.children })] }));
46
+ }
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MainColumn/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAEhD,OAAO,EACL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAoBtE,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,+BAA+B;IACrC,MAAM,EAAE,+BAA+B;IACvC,IAAI,EAAE,qCAAqC;IAC3C,KAAK,EAAE,sCAAsC;IAC7C,MAAM,EAAE,uC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AS,EAAE,GAAG,CAAC,KAAK,iBAAc,mBAAmB,YACtD,WAAW,EAAE,YAAY,IAAI,EAAE,GAC7B,EACJ,cAAc,CAAC,CAAC,CAAC,KAAC,mBAAmB,KAAG,CAAC,CAAC,CAAC,IAAI,EAC/C,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAC3B,cAAK,SAAS,EAAE,GAAG,CAAC,MAAM,iBAAc,oBAAoB,YACzD,KAAK,CAAC,mBAAmB,GACtB,CACP,CAAC,CAAC,CAAC,IAAI,IACD,EACT,cAAK,SAAS,EAAE,GAAG,CAAC,IAAI,YAAG,KAAK,CAAC,QAAQ,GAAO,IACxC,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * BEM class names emitted by `<MarkdownRenderer />`.
4
+ *
5
+ * Every element a markdown document can produce gets a stable class so
6
+ * per-customer wrappers can override individual pieces (e.g. brand the
7
+ * table border without touching the surrounding bubble).
8
+ */
9
+ export interface MarkdownRendererClassNames {
10
+ /** Wrapper around the rendered markdown tree. */
11
+ root: string;
12
+ /** `<p>` paragraph. */
13
+ paragraph: string;
14
+ /** `<h1>` — `<h6>` headings. */
15
+ heading: string;
16
+ /** `<ul>` unordered list. */
17
+ ul: string;
18
+ /** `<ol>` ordered list. */
19
+ ol: string;
20
+ /** `<li>` list item. */
21
+ li: string;
22
+ /** `<a>` link. */
23
+ link: string;
24
+ /** `<blockquote>`. */
25
+ blockquote: string;
26
+ /** `<hr>` horizontal rule. */
27
+ hr: string;
28
+ /** Inline `<code>` (within a paragraph). */
29
+ inlineCode: string;
30
+ /** Fenced code block — the `<pre>` wrapper. */
31
+ codeBlock: string;
32
+ /** Wrapping `<div>` around `<table>` (horizontal-scroll container). */
33
+ tableWrapper: string;
34
+ /** The `<table>` itself. */
35
+ table: string;
36
+ /** `<thead>`. */
37
+ thead: string;
38
+ /** `<tbody>`. */
39
+ tbody: string;
40
+ /** `<tr>`. */
41
+ tr: string;
42
+ /** `<th>` header cell. */
43
+ th: string;
44
+ /** `<td>` body cell. */
45
+ td: string;
46
+ }
47
+ /**
48
+ * Props for `<MarkdownRenderer />`.
49
+ */
50
+ export interface MarkdownRendererProps {
51
+ /** Raw markdown source. Empty / whitespace-only input renders nothing. */
52
+ content: string;
53
+ /** Extra class merged onto the root. */
54
+ className?: string;
55
+ /** Per-element class overrides. */
56
+ classNames?: Partial<MarkdownRendererClassNames>;
57
+ }
58
+ /**
59
+ * Render markdown source as the body of an assistant message.
60
+ *
61
+ * @param props - see `MarkdownRendererProps`.
62
+ * @returns the rendered markdown tree, or `null` if `content` is
63
+ * whitespace-only.
64
+ */
65
+ export declare function MarkdownRenderer(props: MarkdownRendererProps): ReactNode;
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,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