@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,300 @@
1
+ /**
2
+ * `<DataClubAIHub />` — the default monolithic chat component
3
+ * (Tier 1 / Tier 2 surface).
4
+ *
5
+ * Internally a thin composition over `<AIHubProvider>` + `<AuthGate>` +
6
+ * `<ChatShell>`. The structural budget of ≤50 lines for the body (§7.1)
7
+ * is honored — the body is a single JSX tree; the prop forwarding is
8
+ * verbose because TypeScript's `exactOptionalPropertyTypes: true`
9
+ * forbids passing `prop={undefined}`.
10
+ *
11
+ * Step 10 lights up:
12
+ *
13
+ * - The remaining slot props (`customMessageActions`,
14
+ * `customMessageBubble`, `customInputToolbarItems`).
15
+ * - The server-toggle precedence (§8.4) — the resolved boolean stack
16
+ * is computed inside `ChatShell` from `useAIHub().featureToggles +
17
+ * the prop overrides we forward here.
18
+ * - The theme props (`defaultTheme`, `showThemeSwitcher`) — these flow
19
+ * through the provider (theme_default is a server-config override).
20
+ *
21
+ * @see SPECIFICATIONS.md §7.3 — `<DataClubAIHub />` props
22
+ * @see SPECIFICATIONS.md §5 — per-customer wrapper shape
23
+ * @see ui-sketches/03-chat.md — the chat layout
24
+ * @see ui-sketches/00-shell.md — the shell chrome
25
+ */
26
+
27
+ import { useState, type ReactNode } from "react";
28
+
29
+ import type {
30
+ AIHubMessageActionRenderer,
31
+ AIHubMessageBubbleRenderer,
32
+ } from "../../types.js";
33
+ import { AIHubProvider } from "../../context/AIHubProvider.js";
34
+ import { AuthGate } from "../AuthGate/index.js";
35
+ import { ChatShell } from "../ChatShell/index.js";
36
+ import { DataClubAIHubAdmin } from "../DataClubAIHubAdmin/index.js";
37
+ import type {
38
+ AIHubLoginClassNames,
39
+ } from "../DataClubAIHubLogin/index.js";
40
+ import type {
41
+ AIHubChangePasswordClassNames,
42
+ } from "../ChangePassword/index.js";
43
+ import type { AIHubTexts, DeepPartial } from "../../auth/texts.js";
44
+
45
+ /**
46
+ * Props for `<DataClubAIHub />`.
47
+ *
48
+ * Every `show*` / boolean prop here is a **React-prop default** for the
49
+ * §8.4 precedence stack: server toggle > React prop > built-in default.
50
+ * The server toggle is fetched lazily by the provider and applied
51
+ * inside `ChatShell` via `resolveAffordanceFlags`.
52
+ */
53
+ export interface DataClubAIHubProps {
54
+ /**
55
+ * Base URL the ai-hub-server is mounted at — typically `/api/ai-hub`
56
+ * for the per-customer wrapper shape (§5). Defaults to `/api/ai-hub`.
57
+ */
58
+ baseUrl?: string;
59
+ /**
60
+ * Title shown on the login_card *and* used as the default shell
61
+ * header logo when `customShellHeaderLeft` is unset. Defaults to
62
+ * `"ai-hub"`. Per-customer wrappers set this to their brand label.
63
+ */
64
+ productName?: string;
65
+ /** Placeholder for the username input on the login card. */
66
+ usernamePlaceholder?: string;
67
+ /** Wrapper-supplied i18n. */
68
+ texts?: DeepPartial<AIHubTexts>;
69
+ /** Per-element class overrides for the login screen. */
70
+ loginClassNames?: Partial<AIHubLoginClassNames>;
71
+ /** Per-element class overrides for the change-password screen. */
72
+ changePasswordClassNames?: Partial<AIHubChangePasswordClassNames>;
73
+ /** Extra className merged onto the chat shell root. */
74
+ className?: string;
75
+
76
+ /* ── Sessions panel toggles (§7.3 / §8.4) ──────────────────────── */
77
+ /** Default for sessions_panel_enabled. Default true. */
78
+ sessions?: boolean;
79
+ /** Default for sessions_panel_resizable. Default true. */
80
+ sessionsPanelResizable?: boolean;
81
+ /** Sessions panel side — not a §8.4 toggle, pure layout prop. */
82
+ sessionsPanelPosition?: "left" | "right";
83
+ /** Sessions panel width in percent — not a §8.4 toggle. */
84
+ sessionsPanelWidthPercent?: number;
85
+ /** Default for sessions_panel_collapsible. Default true. */
86
+ sessionsPanelCollapsible?: boolean;
87
+ /** Default for create_session_button_enabled. Default true. */
88
+ showCreateSessionButton?: boolean;
89
+
90
+ /* ── Input controls (§8.4) ─────────────────────────────────────── */
91
+ /** Default for user_input_enabled. Default true. */
92
+ userInput?: boolean;
93
+ /** Default for effort_control_visible. Default true. */
94
+ showEffortControl?: boolean;
95
+ /** Default for stop_button_enabled. Default true. */
96
+ showStopButton?: boolean;
97
+
98
+ /* ── Chat affordances (§8.4) ───────────────────────────────────── */
99
+ /** Default for tool_calls_visible. Default true. */
100
+ showToolCalls?: boolean;
101
+ /** Default for reasoning_visible. Default true. */
102
+ showReasoning?: boolean;
103
+ /** Default for system_messages_visible. Default true. */
104
+ showSystemMessages?: boolean;
105
+ /** Default for tpm_notice_visible. Default true. */
106
+ showTpmNotice?: boolean;
107
+ /** Default for scroll_to_present_visible. Default true. */
108
+ showScrollToPresentButton?: boolean;
109
+ /** Default for turn_status_visible. Default true. */
110
+ showTurnStatus?: boolean;
111
+
112
+ /* ── Theming (§7.6) ────────────────────────────────────────────── */
113
+ /**
114
+ * Fallback theme used before `/auth/me` resolves (or when no
115
+ * cache exists). Server's `theme_default` wins after hydration.
116
+ */
117
+ defaultTheme?: "light" | "dark";
118
+ /**
119
+ * Whether the `ThemeSwitcher` primitive renders in the user menu.
120
+ * Server's `theme_switcher_enabled` wins (true → switcher; false →
121
+ * hidden entirely). The React prop is the dev-time fallback.
122
+ */
123
+ showThemeSwitcher?: boolean;
124
+
125
+ /* ── Agents picker / deep-links ────────────────────────────────── */
126
+ /** Whether the agents picker is reachable. Default true. */
127
+ showAgentsPicker?: boolean;
128
+ /** Open this agent directly on mount (skips the picker). */
129
+ initialAgentId?: string;
130
+ /** Open this session directly on mount. */
131
+ initialSessionId?: string;
132
+
133
+ /* ── Slot props ────────────────────────────────────────────────── */
134
+ /** Left-of-shell-header slot (logo + brand name + nav links). */
135
+ customShellHeaderLeft?: ReactNode;
136
+ /** Bottom-of-shell footer strip. Unset → no footer. */
137
+ customShellFooter?: ReactNode;
138
+ /** Per-agent header slot (right of agent name + turn-status indicator). */
139
+ customHeaderContent?: ReactNode;
140
+ /** Top-of-sessions-panel slot. */
141
+ customSidebarHeader?: ReactNode;
142
+ /** Bottom-of-sessions-panel slot. */
143
+ customSidebarFooter?: ReactNode;
144
+ /** Per-message action bar renderer — gets every assistant message. */
145
+ customMessageActions?: AIHubMessageActionRenderer;
146
+ /** Replaces the entire message bubble. Advanced; Tier 3 only typically. */
147
+ customMessageBubble?: AIHubMessageBubbleRenderer;
148
+ /** Extra toolbar items in the input area (next to the effort dropdown). */
149
+ customInputToolbarItems?: ReactNode;
150
+ }
151
+
152
+ /**
153
+ * Renders the monolith.
154
+ *
155
+ * @param props - see `DataClubAIHubProps`.
156
+ * @returns the rendered component.
157
+ */
158
+ export function DataClubAIHub(props: DataClubAIHubProps): ReactNode {
159
+ const baseUrl = props.baseUrl ?? "/api/ai-hub";
160
+ return (
161
+ <AIHubProvider
162
+ baseUrl={baseUrl}
163
+ {...(props.defaultTheme !== undefined ? { defaultTheme: props.defaultTheme } : {})}
164
+ >
165
+ <AuthGate
166
+ {...(props.productName !== undefined ? { productName: props.productName } : {})}
167
+ {...(props.usernamePlaceholder !== undefined
168
+ ? { usernamePlaceholder: props.usernamePlaceholder }
169
+ : {})}
170
+ {...(props.texts !== undefined ? { texts: props.texts } : {})}
171
+ {...(props.loginClassNames !== undefined
172
+ ? { loginClassNames: props.loginClassNames }
173
+ : {})}
174
+ {...(props.changePasswordClassNames !== undefined
175
+ ? { changePasswordClassNames: props.changePasswordClassNames }
176
+ : {})}
177
+ >
178
+ <AuthedShell props={props} />
179
+ </AuthGate>
180
+ </AIHubProvider>
181
+ );
182
+ }
183
+
184
+ /**
185
+ * Internal helper that owns the chat-vs-admin route state inside the
186
+ * authenticated tree. Lives here (rather than in `ChatShell` or
187
+ * `DataClubAIHubAdmin`) because the admin <-> chat swap is monolith-
188
+ * specific behavior — Tier-3 wrappers handle navigation themselves and
189
+ * compose `<AIHub.AdminShell />` directly when needed.
190
+ *
191
+ * Kept as a function component so React's hook ordering is well-defined
192
+ * and the route state survives across AuthGate's children rerenders.
193
+ *
194
+ * @param hostProps - destructured component-props wrapper.
195
+ * @param hostProps.props - the monolith's full prop bag, forwarded to
196
+ * ChatShell (and selectively to `DataClubAIHubAdmin` in admin mode).
197
+ * @returns either the chat shell or the admin shell.
198
+ */
199
+ function AuthedShell({ props }: { props: DataClubAIHubProps }): ReactNode {
200
+ const [view, setView] = useState<"chat" | "admin">("chat");
201
+ if (view === "admin") {
202
+ return (
203
+ <DataClubAIHubAdmin
204
+ {...(props.texts !== undefined ? { texts: props.texts } : {})}
205
+ {...(props.productName !== undefined
206
+ ? { productName: props.productName }
207
+ : {})}
208
+ {...(props.customShellHeaderLeft !== undefined
209
+ ? { customShellHeaderLeft: props.customShellHeaderLeft }
210
+ : {})}
211
+ onExit={() => setView("chat")}
212
+ />
213
+ );
214
+ }
215
+ return (
216
+ <ChatShell
217
+ onOpenAdmin={() => setView("admin")}
218
+ {...(props.productName !== undefined ? { productName: props.productName } : {})}
219
+ {...(props.customShellHeaderLeft !== undefined
220
+ ? { customShellHeaderLeft: props.customShellHeaderLeft }
221
+ : {})}
222
+ {...(props.customShellFooter !== undefined
223
+ ? { customShellFooter: props.customShellFooter }
224
+ : {})}
225
+ {...(props.customHeaderContent !== undefined
226
+ ? { customHeaderContent: props.customHeaderContent }
227
+ : {})}
228
+ {...(props.customSidebarHeader !== undefined
229
+ ? { customSidebarHeader: props.customSidebarHeader }
230
+ : {})}
231
+ {...(props.customSidebarFooter !== undefined
232
+ ? { customSidebarFooter: props.customSidebarFooter }
233
+ : {})}
234
+ {...(props.customMessageActions !== undefined
235
+ ? { customMessageActions: props.customMessageActions }
236
+ : {})}
237
+ {...(props.customMessageBubble !== undefined
238
+ ? { customMessageBubble: props.customMessageBubble }
239
+ : {})}
240
+ {...(props.customInputToolbarItems !== undefined
241
+ ? { customInputToolbarItems: props.customInputToolbarItems }
242
+ : {})}
243
+ {...(props.showAgentsPicker !== undefined
244
+ ? { showAgentsPicker: props.showAgentsPicker }
245
+ : {})}
246
+ {...(props.initialAgentId !== undefined
247
+ ? { initialAgentId: props.initialAgentId }
248
+ : {})}
249
+ {...(props.initialSessionId !== undefined
250
+ ? { initialSessionId: props.initialSessionId }
251
+ : {})}
252
+ {...(props.sessions !== undefined ? { showSessionsPanel: props.sessions } : {})}
253
+ {...(props.sessionsPanelCollapsible !== undefined
254
+ ? { sessionsPanelCollapsible: props.sessionsPanelCollapsible }
255
+ : {})}
256
+ {...(props.sessionsPanelResizable !== undefined
257
+ ? { sessionsPanelResizable: props.sessionsPanelResizable }
258
+ : {})}
259
+ {...(props.sessionsPanelPosition !== undefined
260
+ ? { sessionsPanelPosition: props.sessionsPanelPosition }
261
+ : {})}
262
+ {...(props.sessionsPanelWidthPercent !== undefined
263
+ ? { sessionsPanelWidthPercent: props.sessionsPanelWidthPercent }
264
+ : {})}
265
+ {...(props.userInput !== undefined ? { showInput: props.userInput } : {})}
266
+ {...(props.showCreateSessionButton !== undefined
267
+ ? { showCreateSessionButton: props.showCreateSessionButton }
268
+ : {})}
269
+ {...(props.showEffortControl !== undefined
270
+ ? { showEffortControl: props.showEffortControl }
271
+ : {})}
272
+ {...(props.showStopButton !== undefined
273
+ ? { showStopButton: props.showStopButton }
274
+ : {})}
275
+ {...(props.showToolCalls !== undefined
276
+ ? { showToolCalls: props.showToolCalls }
277
+ : {})}
278
+ {...(props.showReasoning !== undefined
279
+ ? { showReasoning: props.showReasoning }
280
+ : {})}
281
+ {...(props.showSystemMessages !== undefined
282
+ ? { showSystemMessages: props.showSystemMessages }
283
+ : {})}
284
+ {...(props.showTpmNotice !== undefined
285
+ ? { showTpmNotice: props.showTpmNotice }
286
+ : {})}
287
+ {...(props.showScrollToPresentButton !== undefined
288
+ ? { showScrollToPresentButton: props.showScrollToPresentButton }
289
+ : {})}
290
+ {...(props.showTurnStatus !== undefined
291
+ ? { showTurnStatus: props.showTurnStatus }
292
+ : {})}
293
+ {...(props.showThemeSwitcher !== undefined
294
+ ? { showThemeSwitcher: props.showThemeSwitcher }
295
+ : {})}
296
+ {...(props.texts !== undefined ? { texts: props.texts } : {})}
297
+ {...(props.className !== undefined ? { className: props.className } : {})}
298
+ />
299
+ );
300
+ }