@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.
- package/dist/auth/passwordPolicy.d.ts +55 -0
- package/dist/auth/passwordPolicy.d.ts.map +1 -0
- package/dist/auth/passwordPolicy.js +63 -0
- package/dist/auth/passwordPolicy.js.map +1 -0
- package/dist/auth/texts.d.ts +815 -0
- package/dist/auth/texts.d.ts.map +1 -0
- package/dist/auth/texts.js +429 -0
- package/dist/auth/texts.js.map +1 -0
- package/dist/client/AIHubClient.d.ts +1058 -0
- package/dist/client/AIHubClient.d.ts.map +1 -0
- package/dist/client/AIHubClient.js +950 -0
- package/dist/client/AIHubClient.js.map +1 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +9 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/sseParser.d.ts +41 -0
- package/dist/client/sseParser.d.ts.map +1 -0
- package/dist/client/sseParser.js +153 -0
- package/dist/client/sseParser.js.map +1 -0
- package/dist/client/tokenStorage.d.ts +56 -0
- package/dist/client/tokenStorage.d.ts.map +1 -0
- package/dist/client/tokenStorage.js +116 -0
- package/dist/client/tokenStorage.js.map +1 -0
- package/dist/components/AgentsPicker/index.d.ts +70 -0
- package/dist/components/AgentsPicker/index.d.ts.map +1 -0
- package/dist/components/AgentsPicker/index.js +63 -0
- package/dist/components/AgentsPicker/index.js.map +1 -0
- package/dist/components/AuthGate/index.d.ts +79 -0
- package/dist/components/AuthGate/index.d.ts.map +1 -0
- package/dist/components/AuthGate/index.js +61 -0
- package/dist/components/AuthGate/index.js.map +1 -0
- package/dist/components/CacheBadge/index.d.ts +88 -0
- package/dist/components/CacheBadge/index.d.ts.map +1 -0
- package/dist/components/CacheBadge/index.js +127 -0
- package/dist/components/CacheBadge/index.js.map +1 -0
- package/dist/components/ChangePassword/index.d.ts +109 -0
- package/dist/components/ChangePassword/index.d.ts.map +1 -0
- package/dist/components/ChangePassword/index.js +142 -0
- package/dist/components/ChangePassword/index.js.map +1 -0
- package/dist/components/ChatShell/ShellHeader.d.ts +44 -0
- package/dist/components/ChatShell/ShellHeader.d.ts.map +1 -0
- package/dist/components/ChatShell/ShellHeader.js +14 -0
- package/dist/components/ChatShell/ShellHeader.js.map +1 -0
- package/dist/components/ChatShell/UserMenu.d.ts +48 -0
- package/dist/components/ChatShell/UserMenu.d.ts.map +1 -0
- package/dist/components/ChatShell/UserMenu.js +86 -0
- package/dist/components/ChatShell/UserMenu.js.map +1 -0
- package/dist/components/ChatShell/index.d.ts +98 -0
- package/dist/components/ChatShell/index.d.ts.map +1 -0
- package/dist/components/ChatShell/index.js +124 -0
- package/dist/components/ChatShell/index.js.map +1 -0
- package/dist/components/DataClubAIHub/index.d.ts +132 -0
- package/dist/components/DataClubAIHub/index.d.ts.map +1 -0
- package/dist/components/DataClubAIHub/index.js +124 -0
- package/dist/components/DataClubAIHub/index.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/AgentEditorModal.d.ts +89 -0
- package/dist/components/DataClubAIHubAdmin/AgentEditorModal.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/AgentEditorModal.js +199 -0
- package/dist/components/DataClubAIHubAdmin/AgentEditorModal.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/AgentsPage.d.ts +33 -0
- package/dist/components/DataClubAIHubAdmin/AgentsPage.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/AgentsPage.js +137 -0
- package/dist/components/DataClubAIHubAdmin/AgentsPage.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/CreateUserModal.d.ts +50 -0
- package/dist/components/DataClubAIHubAdmin/CreateUserModal.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/CreateUserModal.js +93 -0
- package/dist/components/DataClubAIHubAdmin/CreateUserModal.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.d.ts +49 -0
- package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.js +94 -0
- package/dist/components/DataClubAIHubAdmin/PasswordRevealModal.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.d.ts +37 -0
- package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.js +44 -0
- package/dist/components/DataClubAIHubAdmin/ResetPasswordModal.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.d.ts +56 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.js +158 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessageEditorModal.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.d.ts +29 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.js +183 -0
- package/dist/components/DataClubAIHubAdmin/RotatingMessagesPage.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.d.ts +38 -0
- package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.js +294 -0
- package/dist/components/DataClubAIHubAdmin/SessionsOverviewPage.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/SettingsPage.d.ts +36 -0
- package/dist/components/DataClubAIHubAdmin/SettingsPage.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/SettingsPage.js +373 -0
- package/dist/components/DataClubAIHubAdmin/SettingsPage.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/UsersPage.d.ts +47 -0
- package/dist/components/DataClubAIHubAdmin/UsersPage.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/UsersPage.js +233 -0
- package/dist/components/DataClubAIHubAdmin/UsersPage.js.map +1 -0
- package/dist/components/DataClubAIHubAdmin/index.d.ts +87 -0
- package/dist/components/DataClubAIHubAdmin/index.d.ts.map +1 -0
- package/dist/components/DataClubAIHubAdmin/index.js +137 -0
- package/dist/components/DataClubAIHubAdmin/index.js.map +1 -0
- package/dist/components/DataClubAIHubLogin/index.d.ts +113 -0
- package/dist/components/DataClubAIHubLogin/index.d.ts.map +1 -0
- package/dist/components/DataClubAIHubLogin/index.js +123 -0
- package/dist/components/DataClubAIHubLogin/index.js.map +1 -0
- package/dist/components/EffortControl/index.d.ts +57 -0
- package/dist/components/EffortControl/index.d.ts.map +1 -0
- package/dist/components/EffortControl/index.js +84 -0
- package/dist/components/EffortControl/index.js.map +1 -0
- package/dist/components/Layout/index.d.ts +63 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/Layout/index.js +45 -0
- package/dist/components/Layout/index.js.map +1 -0
- package/dist/components/MainColumn/index.d.ts +69 -0
- package/dist/components/MainColumn/index.d.ts.map +1 -0
- package/dist/components/MainColumn/index.js +47 -0
- package/dist/components/MainColumn/index.js.map +1 -0
- package/dist/components/MarkdownRenderer/index.d.ts +66 -0
- package/dist/components/MarkdownRenderer/index.d.ts.map +1 -0
- package/dist/components/MarkdownRenderer/index.js +153 -0
- package/dist/components/MarkdownRenderer/index.js.map +1 -0
- package/dist/components/MessageInput/index.d.ts +85 -0
- package/dist/components/MessageInput/index.d.ts.map +1 -0
- package/dist/components/MessageInput/index.js +139 -0
- package/dist/components/MessageInput/index.js.map +1 -0
- package/dist/components/MessageList/index.d.ts +156 -0
- package/dist/components/MessageList/index.d.ts.map +1 -0
- package/dist/components/MessageList/index.js +352 -0
- package/dist/components/MessageList/index.js.map +1 -0
- package/dist/components/ReasoningSelector/index.d.ts +77 -0
- package/dist/components/ReasoningSelector/index.d.ts.map +1 -0
- package/dist/components/ReasoningSelector/index.js +156 -0
- package/dist/components/ReasoningSelector/index.js.map +1 -0
- package/dist/components/ReasoningView/index.d.ts +94 -0
- package/dist/components/ReasoningView/index.d.ts.map +1 -0
- package/dist/components/ReasoningView/index.js +83 -0
- package/dist/components/ReasoningView/index.js.map +1 -0
- package/dist/components/ScrollToPresentButton/index.d.ts +54 -0
- package/dist/components/ScrollToPresentButton/index.d.ts.map +1 -0
- package/dist/components/ScrollToPresentButton/index.js +44 -0
- package/dist/components/ScrollToPresentButton/index.js.map +1 -0
- package/dist/components/SessionsPanel/SessionTitleModal.d.ts +79 -0
- package/dist/components/SessionsPanel/SessionTitleModal.d.ts.map +1 -0
- package/dist/components/SessionsPanel/SessionTitleModal.js +102 -0
- package/dist/components/SessionsPanel/SessionTitleModal.js.map +1 -0
- package/dist/components/SessionsPanel/index.d.ts +100 -0
- package/dist/components/SessionsPanel/index.d.ts.map +1 -0
- package/dist/components/SessionsPanel/index.js +176 -0
- package/dist/components/SessionsPanel/index.js.map +1 -0
- package/dist/components/SystemNotice/index.d.ts +66 -0
- package/dist/components/SystemNotice/index.d.ts.map +1 -0
- package/dist/components/SystemNotice/index.js +81 -0
- package/dist/components/SystemNotice/index.js.map +1 -0
- package/dist/components/ThemeSwitcher/index.d.ts +66 -0
- package/dist/components/ThemeSwitcher/index.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher/index.js +73 -0
- package/dist/components/ThemeSwitcher/index.js.map +1 -0
- package/dist/components/ToolCallView/formatContent.d.ts +36 -0
- package/dist/components/ToolCallView/formatContent.d.ts.map +1 -0
- package/dist/components/ToolCallView/formatContent.js +53 -0
- package/dist/components/ToolCallView/formatContent.js.map +1 -0
- package/dist/components/ToolCallView/index.d.ts +120 -0
- package/dist/components/ToolCallView/index.d.ts.map +1 -0
- package/dist/components/ToolCallView/index.js +104 -0
- package/dist/components/ToolCallView/index.js.map +1 -0
- package/dist/components/TpmBanner/index.d.ts +53 -0
- package/dist/components/TpmBanner/index.d.ts.map +1 -0
- package/dist/components/TpmBanner/index.js +116 -0
- package/dist/components/TpmBanner/index.js.map +1 -0
- package/dist/components/TurnStatusIndicator/index.d.ts +77 -0
- package/dist/components/TurnStatusIndicator/index.d.ts.map +1 -0
- package/dist/components/TurnStatusIndicator/index.js +122 -0
- package/dist/components/TurnStatusIndicator/index.js.map +1 -0
- package/dist/components/internal/PasswordInput.d.ts +62 -0
- package/dist/components/internal/PasswordInput.d.ts.map +1 -0
- package/dist/components/internal/PasswordInput.js +42 -0
- package/dist/components/internal/PasswordInput.js.map +1 -0
- package/dist/context/AIHubContext.d.ts +220 -0
- package/dist/context/AIHubContext.d.ts.map +1 -0
- package/dist/context/AIHubContext.js +19 -0
- package/dist/context/AIHubContext.js.map +1 -0
- package/dist/context/AIHubProvider.d.ts +75 -0
- package/dist/context/AIHubProvider.d.ts.map +1 -0
- package/dist/context/AIHubProvider.js +954 -0
- package/dist/context/AIHubProvider.js.map +1 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +9 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/theme.d.ts +43 -0
- package/dist/context/theme.d.ts.map +1 -0
- package/dist/context/theme.js +70 -0
- package/dist/context/theme.js.map +1 -0
- package/dist/context/useAIHub.d.ts +104 -0
- package/dist/context/useAIHub.d.ts.map +1 -0
- package/dist/context/useAIHub.js +63 -0
- package/dist/context/useAIHub.js.map +1 -0
- package/dist/context/useAIHubAuth.d.ts +44 -0
- package/dist/context/useAIHubAuth.d.ts.map +1 -0
- package/dist/context/useAIHubAuth.js +35 -0
- package/dist/context/useAIHubAuth.js.map +1 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives/index.d.ts +99 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +97 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/state/affordances.d.ts +182 -0
- package/dist/state/affordances.d.ts.map +1 -0
- package/dist/state/affordances.js +189 -0
- package/dist/state/affordances.js.map +1 -0
- package/dist/state/stateReducer.d.ts +72 -0
- package/dist/state/stateReducer.d.ts.map +1 -0
- package/dist/state/stateReducer.js +122 -0
- package/dist/state/stateReducer.js.map +1 -0
- package/dist/stories/EffortControl.stories.d.ts +14 -0
- package/dist/stories/EffortControl.stories.d.ts.map +1 -0
- package/dist/stories/EffortControl.stories.js +43 -0
- package/dist/stories/EffortControl.stories.js.map +1 -0
- package/dist/stories/MarkdownRenderer.stories.d.ts +25 -0
- package/dist/stories/MarkdownRenderer.stories.d.ts.map +1 -0
- package/dist/stories/MarkdownRenderer.stories.js +178 -0
- package/dist/stories/MarkdownRenderer.stories.js.map +1 -0
- package/dist/stories/MessageBubble.stories.d.ts +21 -0
- package/dist/stories/MessageBubble.stories.d.ts.map +1 -0
- package/dist/stories/MessageBubble.stories.js +59 -0
- package/dist/stories/MessageBubble.stories.js.map +1 -0
- package/dist/stories/ReasoningView.stories.d.ts +18 -0
- package/dist/stories/ReasoningView.stories.d.ts.map +1 -0
- package/dist/stories/ReasoningView.stories.js +62 -0
- package/dist/stories/ReasoningView.stories.js.map +1 -0
- package/dist/stories/ScrollToPresentButton.stories.d.ts +18 -0
- package/dist/stories/ScrollToPresentButton.stories.d.ts.map +1 -0
- package/dist/stories/ScrollToPresentButton.stories.js +34 -0
- package/dist/stories/ScrollToPresentButton.stories.js.map +1 -0
- package/dist/stories/SystemNotice.stories.d.ts +17 -0
- package/dist/stories/SystemNotice.stories.d.ts.map +1 -0
- package/dist/stories/SystemNotice.stories.js +42 -0
- package/dist/stories/SystemNotice.stories.js.map +1 -0
- package/dist/stories/ThemeSwitcher.stories.d.ts +15 -0
- package/dist/stories/ThemeSwitcher.stories.d.ts.map +1 -0
- package/dist/stories/ThemeSwitcher.stories.js +35 -0
- package/dist/stories/ThemeSwitcher.stories.js.map +1 -0
- package/dist/stories/ToolCallView.stories.d.ts +20 -0
- package/dist/stories/ToolCallView.stories.d.ts.map +1 -0
- package/dist/stories/ToolCallView.stories.js +65 -0
- package/dist/stories/ToolCallView.stories.js.map +1 -0
- package/dist/stories/TpmBanner.stories.d.ts +24 -0
- package/dist/stories/TpmBanner.stories.d.ts.map +1 -0
- package/dist/stories/TpmBanner.stories.js +63 -0
- package/dist/stories/TpmBanner.stories.js.map +1 -0
- package/dist/stories/TurnStatusIndicator.stories.d.ts +25 -0
- package/dist/stories/TurnStatusIndicator.stories.d.ts.map +1 -0
- package/dist/stories/TurnStatusIndicator.stories.js +56 -0
- package/dist/stories/TurnStatusIndicator.stories.js.map +1 -0
- package/dist/stories/_mockProvider.d.ts +44 -0
- package/dist/stories/_mockProvider.d.ts.map +1 -0
- package/dist/stories/_mockProvider.js +84 -0
- package/dist/stories/_mockProvider.js.map +1 -0
- package/dist/types.d.ts +787 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/webcomponent/defineWebComponent.d.ts +106 -0
- package/dist/webcomponent/defineWebComponent.d.ts.map +1 -0
- package/dist/webcomponent/defineWebComponent.js +126 -0
- package/dist/webcomponent/defineWebComponent.js.map +1 -0
- package/dist/webcomponent/index.d.ts +7 -0
- package/dist/webcomponent/index.d.ts.map +1 -0
- package/dist/webcomponent/index.js +7 -0
- package/dist/webcomponent/index.js.map +1 -0
- package/package.json +63 -0
- package/src/__lint-canary__/step1-lint-canary.ts.disabled +28 -0
- package/src/auth/passwordPolicy.ts +75 -0
- package/src/auth/texts.ts +1294 -0
- package/src/client/AIHubClient.ts +1718 -0
- package/src/client/index.ts +30 -0
- package/src/client/sseParser.ts +168 -0
- package/src/client/tokenStorage.ts +131 -0
- package/src/components/AgentsPicker/index.tsx +147 -0
- package/src/components/AuthGate/index.tsx +132 -0
- package/src/components/CacheBadge/index.tsx +245 -0
- package/src/components/ChangePassword/index.tsx +375 -0
- package/src/components/ChatShell/ShellHeader.tsx +80 -0
- package/src/components/ChatShell/UserMenu.tsx +196 -0
- package/src/components/ChatShell/index.tsx +307 -0
- package/src/components/DataClubAIHub/index.tsx +300 -0
- package/src/components/DataClubAIHubAdmin/AgentEditorModal.tsx +505 -0
- package/src/components/DataClubAIHubAdmin/AgentsPage.tsx +342 -0
- package/src/components/DataClubAIHubAdmin/CreateUserModal.tsx +214 -0
- package/src/components/DataClubAIHubAdmin/PasswordRevealModal.tsx +204 -0
- package/src/components/DataClubAIHubAdmin/ResetPasswordModal.tsx +122 -0
- package/src/components/DataClubAIHubAdmin/RotatingMessageEditorModal.tsx +408 -0
- package/src/components/DataClubAIHubAdmin/RotatingMessagesPage.tsx +373 -0
- package/src/components/DataClubAIHubAdmin/SessionsOverviewPage.tsx +639 -0
- package/src/components/DataClubAIHubAdmin/SettingsPage.tsx +979 -0
- package/src/components/DataClubAIHubAdmin/UsersPage.tsx +495 -0
- package/src/components/DataClubAIHubAdmin/index.tsx +277 -0
- package/src/components/DataClubAIHubLogin/index.tsx +282 -0
- package/src/components/EffortControl/index.tsx +138 -0
- package/src/components/Layout/index.tsx +92 -0
- package/src/components/MainColumn/index.tsx +131 -0
- package/src/components/MarkdownRenderer/index.tsx +256 -0
- package/src/components/MessageInput/index.tsx +283 -0
- package/src/components/MessageList/index.tsx +753 -0
- package/src/components/ReasoningSelector/index.tsx +268 -0
- package/src/components/ReasoningView/index.tsx +183 -0
- package/src/components/ScrollToPresentButton/index.tsx +85 -0
- package/src/components/SessionsPanel/SessionTitleModal.tsx +256 -0
- package/src/components/SessionsPanel/index.tsx +406 -0
- package/src/components/SystemNotice/index.tsx +151 -0
- package/src/components/ThemeSwitcher/index.tsx +136 -0
- package/src/components/ToolCallView/formatContent.ts +50 -0
- package/src/components/ToolCallView/index.tsx +274 -0
- package/src/components/TpmBanner/index.tsx +172 -0
- package/src/components/TurnStatusIndicator/index.tsx +203 -0
- package/src/components/internal/PasswordInput.tsx +145 -0
- package/src/context/AIHubContext.ts +249 -0
- package/src/context/AIHubProvider.tsx +1084 -0
- package/src/context/index.ts +9 -0
- package/src/context/theme.ts +76 -0
- package/src/context/useAIHub.ts +151 -0
- package/src/context/useAIHubAuth.ts +65 -0
- package/src/index.ts +275 -0
- package/src/primitives/index.ts +101 -0
- package/src/state/affordances.ts +321 -0
- package/src/state/stateReducer.ts +131 -0
- package/src/stories/EffortControl.stories.tsx +63 -0
- package/src/stories/MarkdownRenderer.stories.tsx +201 -0
- package/src/stories/MessageBubble.stories.tsx +101 -0
- package/src/stories/ReasoningView.stories.tsx +81 -0
- package/src/stories/ScrollToPresentButton.stories.tsx +52 -0
- package/src/stories/SystemNotice.stories.tsx +59 -0
- package/src/stories/ThemeSwitcher.stories.tsx +55 -0
- package/src/stories/ToolCallView.stories.tsx +95 -0
- package/src/stories/TpmBanner.stories.tsx +93 -0
- package/src/stories/TurnStatusIndicator.stories.tsx +86 -0
- package/src/stories/_mockProvider.tsx +116 -0
- package/src/styles/CLASSES.md +356 -0
- package/src/styles/default.css +2937 -0
- package/src/types.ts +867 -0
- package/src/webcomponent/defineWebComponent.tsx +193 -0
- 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
|
+
}
|