@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,201 @@
1
+ /**
2
+ * Stories for `<MarkdownRenderer />` — the assistant-bubble body
3
+ * renderer that turns GFM markdown (+ LaTeX-style math) into themed HTML.
4
+ *
5
+ * Each story feeds a curated chunk of markdown so designers can eyeball
6
+ * one feature at a time (paragraphs, tables, code blocks, math…) without
7
+ * having to spin up a real chat turn. The "Showcase" story stitches all
8
+ * of them together — that's the one to load when checking the renderer
9
+ * end-to-end after a CSS-token tweak.
10
+ *
11
+ * @see docs/react/markdown-rendering.md
12
+ */
13
+ import type { Meta, StoryObj } from "@storybook/react-vite";
14
+
15
+ import { MarkdownRenderer } from "../components/MarkdownRenderer/index.js";
16
+
17
+ const meta: Meta<typeof MarkdownRenderer> = {
18
+ title: "Affordances/MarkdownRenderer",
19
+ component: MarkdownRenderer,
20
+ parameters: {
21
+ docs: {
22
+ description: {
23
+ component:
24
+ "Renders assistant-bubble bodies as GitHub-flavored Markdown with KaTeX math. Per-customer wrappers theme it via the `--dc-aih-markdown-*` custom properties (default mappings live in `src/styles/default.css`).",
25
+ },
26
+ },
27
+ },
28
+ };
29
+ export default meta;
30
+ type Story = StoryObj<typeof MarkdownRenderer>;
31
+
32
+ export const Paragraphs: Story = {
33
+ args: {
34
+ content: [
35
+ "This is a **bold** statement with some *emphasis*, an [inline link](https://example.com), and ~~strikethrough~~ for good measure.",
36
+ "",
37
+ "Second paragraph — separated by a blank line. Inline code looks like `const x = 42;`.",
38
+ ].join("\n"),
39
+ },
40
+ };
41
+
42
+ export const HeadingsAndLists: Story = {
43
+ args: {
44
+ content: [
45
+ "# Heading 1",
46
+ "## Heading 2",
47
+ "### Heading 3",
48
+ "",
49
+ "Unordered list:",
50
+ "- First item",
51
+ "- Second item",
52
+ " - Nested item",
53
+ "- Third item",
54
+ "",
55
+ "Ordered list:",
56
+ "1. Step one",
57
+ "2. Step two",
58
+ "3. Step three",
59
+ ].join("\n"),
60
+ },
61
+ };
62
+
63
+ export const Tables: Story = {
64
+ args: {
65
+ content: [
66
+ "| Plan | Monthly | Annual |",
67
+ "|------|---------|--------|",
68
+ "| Starter | $9 | $90 |",
69
+ "| Pro | $29 | $290 |",
70
+ "| Enterprise | Contact us | Contact us |",
71
+ "",
72
+ "Wide tables are horizontally scrollable, so the bubble keeps its `max-width: 80%` even when the table doesn't fit:",
73
+ "",
74
+ "| Region | Q1 | Q2 | Q3 | Q4 | Total | YoY % | Notes |",
75
+ "|--------|----|----|----|----|-------|-------|-------|",
76
+ "| EMEA | 120 | 134 | 142 | 158 | 554 | +18% | Growth driven by DACH region |",
77
+ "| APAC | 87 | 95 | 110 | 121 | 413 | +24% | Strong tailwind from JP launches |",
78
+ "| Americas | 210 | 215 | 219 | 240 | 884 | +6% | Mature market, steady |",
79
+ ].join("\n"),
80
+ },
81
+ };
82
+
83
+ export const CodeBlocks: Story = {
84
+ args: {
85
+ content: [
86
+ "Here's a TypeScript snippet:",
87
+ "",
88
+ "```ts",
89
+ "function greet(name: string): string {",
90
+ " return `Hello, ${name}!`;",
91
+ "}",
92
+ "",
93
+ "const message = greet('world');",
94
+ "console.log(message);",
95
+ "```",
96
+ "",
97
+ "And a Python one:",
98
+ "",
99
+ "```python",
100
+ "def fibonacci(n: int) -> int:",
101
+ " if n < 2:",
102
+ " return n",
103
+ " return fibonacci(n - 1) + fibonacci(n - 2)",
104
+ "```",
105
+ ].join("\n"),
106
+ },
107
+ };
108
+
109
+ export const MathEquations: Story = {
110
+ args: {
111
+ content: [
112
+ "Inline math: the Pythagorean identity is $a^2 + b^2 = c^2$.",
113
+ "",
114
+ "Block math:",
115
+ "",
116
+ "$$",
117
+ "\\int_0^\\infty e^{-x^2} \\, dx = \\frac{\\sqrt{\\pi}}{2}",
118
+ "$$",
119
+ "",
120
+ "The quadratic formula:",
121
+ "",
122
+ "$$",
123
+ "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",
124
+ "$$",
125
+ "",
126
+ "Euler's identity, $e^{i\\pi} + 1 = 0$, links five fundamental constants.",
127
+ ].join("\n"),
128
+ },
129
+ };
130
+
131
+ export const Blockquotes: Story = {
132
+ args: {
133
+ content: [
134
+ "> This is a blockquote. It's typically used to highlight a quote, an aside, or a callout from another source.",
135
+ ">",
136
+ "> Multi-paragraph quotes work too.",
137
+ "",
138
+ "Back to regular text.",
139
+ ].join("\n"),
140
+ },
141
+ };
142
+
143
+ export const Showcase: Story = {
144
+ args: {
145
+ content: [
146
+ "# Markdown showcase",
147
+ "",
148
+ "This story renders every feature the chat supports — use it as a regression sanity-check after touching `--dc-aih-markdown-*` tokens.",
149
+ "",
150
+ "## Inline formatting",
151
+ "",
152
+ "Mix of **bold**, *italic*, `inline code`, [a link](https://example.com), and ~~strikethrough~~.",
153
+ "",
154
+ "## Lists",
155
+ "",
156
+ "- Apples",
157
+ "- Oranges",
158
+ " - Mandarins",
159
+ " - Clementines",
160
+ "- Bananas",
161
+ "",
162
+ "1. Mise en place",
163
+ "2. Sauté the aromatics",
164
+ "3. Simmer until thickened",
165
+ "",
166
+ "## Tables",
167
+ "",
168
+ "| Customer | MRR | Tier |",
169
+ "|----------|-----|------|",
170
+ "| Acme Co. | $9,400 | Enterprise |",
171
+ "| Globex | $2,100 | Pro |",
172
+ "| Initech | $290 | Starter |",
173
+ "",
174
+ "## Code",
175
+ "",
176
+ "```ts",
177
+ "export function sum(xs: number[]): number {",
178
+ " return xs.reduce((a, b) => a + b, 0);",
179
+ "}",
180
+ "```",
181
+ "",
182
+ "## Math",
183
+ "",
184
+ "The sum of the first $n$ natural numbers is",
185
+ "",
186
+ "$$",
187
+ "\\sum_{k=1}^{n} k = \\frac{n(n+1)}{2}.",
188
+ "$$",
189
+ "",
190
+ "## Blockquote",
191
+ "",
192
+ "> The best way to predict the future is to invent it.",
193
+ ">",
194
+ "> — Alan Kay",
195
+ "",
196
+ "---",
197
+ "",
198
+ "End of showcase.",
199
+ ].join("\n"),
200
+ },
201
+ };
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Stories for the message-bubble variants emitted by `<MessageList />`.
3
+ *
4
+ * The bubble is not a separate primitive — it's the inner element of
5
+ * `MessageList`. Each story mounts a full `<MessageList />` under a
6
+ * `MockProvider` whose `messages` array + reducer `state` produces the
7
+ * variant under inspection (user / assistant / system / tool / failed
8
+ * assistant / cancelled assistant).
9
+ *
10
+ * @see SPECIFICATIONS.md §7.3 — message bubble variants
11
+ * @see ui-sketches/03-chat.md
12
+ */
13
+ import type { Meta, StoryObj } from "@storybook/react-vite";
14
+
15
+ import { MessageList } from "../components/MessageList/index.js";
16
+ import type { AIHubMessage } from "../types.js";
17
+
18
+ import { MockProvider, type MockProviderOpts } from "./_mockProvider.js";
19
+
20
+ function msg(
21
+ id: string,
22
+ role: AIHubMessage["role"],
23
+ content: string,
24
+ ): AIHubMessage {
25
+ return {
26
+ id,
27
+ role,
28
+ content,
29
+ created_at: "2026-05-13T12:00:00.000Z",
30
+ };
31
+ }
32
+
33
+ function withProvider(opts: MockProviderOpts) {
34
+ return (Story: () => React.ReactNode) => (
35
+ <MockProvider opts={{ activeSessionId: "s-mock", ...opts }}>
36
+ <div style={{ height: "32rem", display: "flex" }}>
37
+ <Story />
38
+ </div>
39
+ </MockProvider>
40
+ );
41
+ }
42
+
43
+ const HISTORY: AIHubMessage[] = [
44
+ msg("m1", "user", "Why did my last turn fail?"),
45
+ msg(
46
+ "m2",
47
+ "assistant",
48
+ "Looking at the logs, the upstream provider returned a 429 and we exhausted the retry budget.",
49
+ ),
50
+ msg(
51
+ "m3",
52
+ "system",
53
+ "Notice: deployment-wide TPM recovery is configured for 5 retries with 30s backoff.",
54
+ ),
55
+ msg("m4", "tool", "search_docs → 3 results returned"),
56
+ ];
57
+
58
+ const meta: Meta<typeof MessageList> = {
59
+ title: "Affordances/MessageBubble",
60
+ component: MessageList,
61
+ parameters: {
62
+ docs: {
63
+ description: {
64
+ component:
65
+ "Each story mounts `<MessageList />` with a curated `messages` array + reducer state so the resulting DOM shows one of the six bubble variants (user / assistant / system / tool / failed assistant / cancelled assistant).",
66
+ },
67
+ },
68
+ },
69
+ };
70
+ export default meta;
71
+
72
+ type Story = StoryObj<typeof MessageList>;
73
+
74
+ export const Mixed_AllVariants: Story = {
75
+ decorators: [withProvider({ status: "idle", messages: HISTORY })],
76
+ };
77
+
78
+ export const FailedAssistant: Story = {
79
+ decorators: [
80
+ withProvider({
81
+ status: "failed",
82
+ lastTurnError: "Stream failed: upstream provider unavailable.",
83
+ messages: [
84
+ msg("m1", "user", "Summarize the last release."),
85
+ msg("m2", "assistant", "Sure, here's what I have so far —"),
86
+ ],
87
+ }),
88
+ ],
89
+ };
90
+
91
+ export const CancelledAssistant: Story = {
92
+ decorators: [
93
+ withProvider({
94
+ status: "cancelled",
95
+ messages: [
96
+ msg("m1", "user", "Run a long simulation."),
97
+ msg("m2", "assistant", "Starting the simulation now…"),
98
+ ],
99
+ }),
100
+ ],
101
+ };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Stories for `<ReasoningView />` — collapsible reasoning block inside
3
+ * an assistant bubble.
4
+ *
5
+ * Pure presentational primitive (no context needed).
6
+ *
7
+ * @see SPECIFICATIONS.md §7.3 — showReasoning prop
8
+ */
9
+ import type { Meta, StoryObj } from "@storybook/react-vite";
10
+
11
+ import { ReasoningView } from "../components/ReasoningView/index.js";
12
+
13
+ const SAMPLE_REASONING = [
14
+ "The user is asking about the difference between a tool error and an",
15
+ "agent error. The §10.3 rule states that tool errors do NOT fail the",
16
+ "turn — phase reverts to model_text and the model gets a chance to",
17
+ "react. Only agent errors transition the turn to failed.",
18
+ ].join(" ");
19
+
20
+ const meta: Meta<typeof ReasoningView> = {
21
+ title: "Affordances/ReasoningView",
22
+ component: ReasoningView,
23
+ parameters: {
24
+ docs: {
25
+ description: {
26
+ component:
27
+ "Collapsible reasoning block. Default-collapsed; the header shows duration once known. Streaming mode replaces the body with a placeholder until deltas arrive.",
28
+ },
29
+ },
30
+ },
31
+ };
32
+ export default meta;
33
+
34
+ type Story = StoryObj<typeof ReasoningView>;
35
+
36
+ export const Collapsed: Story = {
37
+ args: {
38
+ content: SAMPLE_REASONING,
39
+ durationSeconds: 2.4,
40
+ defaultExpanded: false,
41
+ },
42
+ };
43
+
44
+ export const Expanded: Story = {
45
+ args: {
46
+ content: SAMPLE_REASONING,
47
+ durationSeconds: 2.4,
48
+ defaultExpanded: true,
49
+ },
50
+ };
51
+
52
+ export const Streaming: Story = {
53
+ args: {
54
+ content: "",
55
+ streaming: true,
56
+ defaultExpanded: true,
57
+ },
58
+ parameters: {
59
+ docs: {
60
+ description: {
61
+ story:
62
+ "While reasoning deltas are arriving, the duration is unknown and the body shows a placeholder until the first chunks land.",
63
+ },
64
+ },
65
+ },
66
+ };
67
+
68
+ export const WithDuration: Story = {
69
+ args: {
70
+ content: SAMPLE_REASONING,
71
+ durationSeconds: 12.7,
72
+ defaultExpanded: true,
73
+ },
74
+ parameters: {
75
+ docs: {
76
+ description: {
77
+ story: "Longer reasoning — the header surfaces the wall-clock duration.",
78
+ },
79
+ },
80
+ },
81
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Stories for `<ScrollToPresentButton />` — floating "↓ Jump to latest"
3
+ * button.
4
+ *
5
+ * The §10.4 predicate (`status === "running" && userScrolledAwayFromBottom`)
6
+ * is computed by the parent; the primitive itself only checks the
7
+ * `visible` prop.
8
+ *
9
+ * @see SPECIFICATIONS.md §10.4
10
+ */
11
+ import type { Meta, StoryObj } from "@storybook/react-vite";
12
+
13
+ import { ScrollToPresentButton } from "../components/ScrollToPresentButton/index.js";
14
+
15
+ const meta: Meta<typeof ScrollToPresentButton> = {
16
+ title: "Affordances/ScrollToPresentButton",
17
+ component: ScrollToPresentButton,
18
+ parameters: {
19
+ layout: "centered",
20
+ docs: {
21
+ description: {
22
+ component:
23
+ "Floating button that appears when the user has scrolled away from the bottom during a running turn. The parent computes the predicate; the primitive only respects `visible`.",
24
+ },
25
+ },
26
+ },
27
+ };
28
+ export default meta;
29
+
30
+ type Story = StoryObj<typeof ScrollToPresentButton>;
31
+
32
+ export const Visible: Story = {
33
+ args: {
34
+ visible: true,
35
+ onClick: () => undefined,
36
+ },
37
+ };
38
+
39
+ export const Hidden: Story = {
40
+ args: {
41
+ visible: false,
42
+ onClick: () => undefined,
43
+ },
44
+ parameters: {
45
+ docs: {
46
+ description: {
47
+ story:
48
+ "When `visible` is false the primitive returns `null` — there is no DOM element to inspect, but the story documents the contract.",
49
+ },
50
+ },
51
+ },
52
+ };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Stories for `<SystemNotice />` — TPM wait / resumed / error banners.
3
+ *
4
+ * Pure presentational primitive — no context needed.
5
+ *
6
+ * @see SPECIFICATIONS.md §9.4 — system_notice events
7
+ */
8
+ import type { Meta, StoryObj } from "@storybook/react-vite";
9
+
10
+ import { SystemNotice } from "../components/SystemNotice/index.js";
11
+
12
+ const meta: Meta<typeof SystemNotice> = {
13
+ title: "Affordances/SystemNotice",
14
+ component: SystemNotice,
15
+ parameters: {
16
+ docs: {
17
+ description: {
18
+ component:
19
+ "Banner for TPM-recovery + non-fatal errors. Variants: `tpm-wait` (countdown), `resumed` (transient flash), `error` (with optional retry button).",
20
+ },
21
+ },
22
+ },
23
+ };
24
+ export default meta;
25
+
26
+ type Story = StoryObj<typeof SystemNotice>;
27
+
28
+ export const TpmWait: Story = {
29
+ args: {
30
+ variant: "tpm-wait",
31
+ message: "Provider rate-limited — retrying in 47s",
32
+ },
33
+ };
34
+
35
+ export const Resumed: Story = {
36
+ args: {
37
+ variant: "resumed",
38
+ message: "Resumed.",
39
+ },
40
+ };
41
+
42
+ export const ErrorWithAction: Story = {
43
+ args: {
44
+ variant: "error",
45
+ message:
46
+ "Recovery exhausted — the model is unavailable. Try again in a moment.",
47
+ action: {
48
+ label: "Retry",
49
+ onClick: () => undefined,
50
+ },
51
+ },
52
+ };
53
+
54
+ export const ErrorNoAction: Story = {
55
+ args: {
56
+ variant: "error",
57
+ message: "Something went wrong on the server. Contact your administrator.",
58
+ },
59
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Stories for `<ThemeSwitcher />` — sun/moon toggle, also renders
3
+ * nothing when the deployment has the switcher disabled.
4
+ *
5
+ * @see SPECIFICATIONS.md §7.6 — theme resolution
6
+ */
7
+ import type { Meta, StoryObj } from "@storybook/react-vite";
8
+
9
+ import { ThemeSwitcher } from "../components/ThemeSwitcher/index.js";
10
+
11
+ import { MockProvider, type MockProviderOpts } from "./_mockProvider.js";
12
+
13
+ function withProvider(opts: MockProviderOpts) {
14
+ return (Story: () => React.ReactNode) => (
15
+ <MockProvider opts={opts}>
16
+ <Story />
17
+ </MockProvider>
18
+ );
19
+ }
20
+
21
+ const meta: Meta<typeof ThemeSwitcher> = {
22
+ title: "Affordances/ThemeSwitcher",
23
+ component: ThemeSwitcher,
24
+ parameters: {
25
+ docs: {
26
+ description: {
27
+ component:
28
+ "Sun/moon switch that calls `setTheme()` on the provider. Renders nothing when `themeSwitcherEnabled === false`.",
29
+ },
30
+ },
31
+ },
32
+ };
33
+ export default meta;
34
+
35
+ type Story = StoryObj<typeof ThemeSwitcher>;
36
+
37
+ export const LightActive: Story = {
38
+ decorators: [withProvider({ theme: "light", themeSwitcherEnabled: true })],
39
+ };
40
+
41
+ export const DarkActive: Story = {
42
+ decorators: [withProvider({ theme: "dark", themeSwitcherEnabled: true })],
43
+ };
44
+
45
+ export const SwitcherDisabled: Story = {
46
+ decorators: [withProvider({ theme: "light", themeSwitcherEnabled: false })],
47
+ parameters: {
48
+ docs: {
49
+ description: {
50
+ story:
51
+ "When the super_admin has disabled the switcher, the primitive renders `null` — there is nothing to inspect in the DOM.",
52
+ },
53
+ },
54
+ },
55
+ };
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Stories for `<ToolCallView />` — collapsible tool-call card.
3
+ *
4
+ * Per §10.3 a tool error does NOT fail the turn — the card stays as
5
+ * evidence of what happened. Stories cover running / done / error
6
+ * variants in both collapsed + expanded states.
7
+ *
8
+ * @see SPECIFICATIONS.md §9.3 — tool events
9
+ * @see SPECIFICATIONS.md §10.3 — tool error vs. agent error
10
+ */
11
+ import type { Meta, StoryObj } from "@storybook/react-vite";
12
+
13
+ import { ToolCallView } from "../components/ToolCallView/index.js";
14
+
15
+ const SAMPLE_INPUT = JSON.stringify(
16
+ { query: "wire protocol §9.3", max_results: 5 },
17
+ null,
18
+ 2,
19
+ );
20
+
21
+ const SAMPLE_OUTPUT = JSON.stringify(
22
+ {
23
+ results: [
24
+ { title: "9.3 — Tool events", url: "/docs/SPECIFICATIONS.md#tool-events" },
25
+ ],
26
+ },
27
+ null,
28
+ 2,
29
+ );
30
+
31
+ const meta: Meta<typeof ToolCallView> = {
32
+ title: "Affordances/ToolCallView",
33
+ component: ToolCallView,
34
+ parameters: {
35
+ docs: {
36
+ description: {
37
+ component:
38
+ "Tool-call card showing name, status (running/done/error), and duration. Body holds input + output (or input + error). Default collapsed.",
39
+ },
40
+ },
41
+ },
42
+ };
43
+ export default meta;
44
+
45
+ type Story = StoryObj<typeof ToolCallView>;
46
+
47
+ export const RunningCollapsed: Story = {
48
+ args: {
49
+ toolName: "search_docs",
50
+ status: "running",
51
+ input: SAMPLE_INPUT,
52
+ defaultExpanded: false,
53
+ },
54
+ };
55
+
56
+ export const DoneCollapsed: Story = {
57
+ args: {
58
+ toolName: "search_docs",
59
+ status: "done",
60
+ input: SAMPLE_INPUT,
61
+ output: SAMPLE_OUTPUT,
62
+ durationSeconds: 1.8,
63
+ defaultExpanded: false,
64
+ },
65
+ };
66
+
67
+ export const DoneExpanded: Story = {
68
+ args: {
69
+ toolName: "search_docs",
70
+ status: "done",
71
+ input: SAMPLE_INPUT,
72
+ output: SAMPLE_OUTPUT,
73
+ durationSeconds: 1.8,
74
+ defaultExpanded: true,
75
+ },
76
+ };
77
+
78
+ export const ErrorExpanded: Story = {
79
+ args: {
80
+ toolName: "search_docs",
81
+ status: "error",
82
+ input: SAMPLE_INPUT,
83
+ error: "TimeoutError: upstream search took longer than 10s",
84
+ durationSeconds: 10.0,
85
+ defaultExpanded: true,
86
+ },
87
+ parameters: {
88
+ docs: {
89
+ description: {
90
+ story:
91
+ "A tool-side failure surfaces in the card body. Per §10.3 the turn stays running — the model gets `tool_call_result {error}` and decides what to do next.",
92
+ },
93
+ },
94
+ },
95
+ };