@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0BH,wEAAwE;AAExE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAOhC,yEAAyE;AAEzE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAqB3B,yEAAyE;AAEzE,OAAO,EACL,aAAa,EACb,QAAQ,EACR,YAAY,GACb,MAAM,oBAAoB,CAAC;AAO5B,yEAAyE;AAEzE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AAGjC,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AAExE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAUzB,wEAAwE;AAExE,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAMlC,wEAAwE;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `AIHub.*` namespace — Tier-3 composition primitives.
|
|
3
|
+
*
|
|
4
|
+
* Every primitive is real after Step 10. Tier-3 wrappers compose them
|
|
5
|
+
* directly; the default monolith `<DataClubAIHub />` is itself a Tier-3
|
|
6
|
+
* composition that lives in the library as a reference (~50 lines of
|
|
7
|
+
* internal body code).
|
|
8
|
+
*
|
|
9
|
+
* The namespace is intentionally a single object literal so consumers
|
|
10
|
+
* can do `import { AIHub } from "@data-club/ai-hub"` and reach every
|
|
11
|
+
* primitive via dotted access (`<AIHub.MessageList renderMessageActions={…} />`).
|
|
12
|
+
*
|
|
13
|
+
* @see SPECIFICATIONS.md §7.1 — exports
|
|
14
|
+
* @see SPECIFICATIONS.md §7.9 — Tier 3 composition
|
|
15
|
+
*/
|
|
16
|
+
import { AIHubProvider } from "../context/AIHubProvider.js";
|
|
17
|
+
import { AgentsPicker } from "../components/AgentsPicker/index.js";
|
|
18
|
+
import { AuthGate } from "../components/AuthGate/index.js";
|
|
19
|
+
import { DataClubAIHubAdmin } from "../components/DataClubAIHubAdmin/index.js";
|
|
20
|
+
import { EffortControl } from "../components/EffortControl/index.js";
|
|
21
|
+
import { Layout } from "../components/Layout/index.js";
|
|
22
|
+
import { MainColumn } from "../components/MainColumn/index.js";
|
|
23
|
+
import { MarkdownRenderer } from "../components/MarkdownRenderer/index.js";
|
|
24
|
+
import { MessageInput } from "../components/MessageInput/index.js";
|
|
25
|
+
import { MessageList } from "../components/MessageList/index.js";
|
|
26
|
+
import { ReasoningSelector } from "../components/ReasoningSelector/index.js";
|
|
27
|
+
import { ReasoningView } from "../components/ReasoningView/index.js";
|
|
28
|
+
import { ScrollToPresentButton } from "../components/ScrollToPresentButton/index.js";
|
|
29
|
+
import { SessionsPanel } from "../components/SessionsPanel/index.js";
|
|
30
|
+
import { SystemNotice } from "../components/SystemNotice/index.js";
|
|
31
|
+
import { ThemeSwitcher } from "../components/ThemeSwitcher/index.js";
|
|
32
|
+
import { ToolCallView } from "../components/ToolCallView/index.js";
|
|
33
|
+
import { TpmBanner } from "../components/TpmBanner/index.js";
|
|
34
|
+
import { TurnStatusIndicator } from "../components/TurnStatusIndicator/index.js";
|
|
35
|
+
/**
|
|
36
|
+
* Tier-3 composition primitives. Build a custom layout by composing
|
|
37
|
+
* `AIHub.Provider` + `AIHub.AuthGate` + `AIHub.Layout` + sub-primitives.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <AIHub.Provider baseUrl="/api/ai-hub">
|
|
42
|
+
* <AIHub.AuthGate>
|
|
43
|
+
* <AIHub.Layout>
|
|
44
|
+
* <AIHub.SessionsPanel />
|
|
45
|
+
* <AIHub.MainColumn>
|
|
46
|
+
* <AIHub.MessageList />
|
|
47
|
+
* <AIHub.Input toolbar={<AIHub.EffortControl />} />
|
|
48
|
+
* </AIHub.MainColumn>
|
|
49
|
+
* </AIHub.Layout>
|
|
50
|
+
* </AIHub.AuthGate>
|
|
51
|
+
* </AIHub.Provider>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see SPECIFICATIONS.md §7.9
|
|
55
|
+
*/
|
|
56
|
+
export declare const AIHub: {
|
|
57
|
+
/** Root context provider. */
|
|
58
|
+
readonly Provider: typeof AIHubProvider;
|
|
59
|
+
/** Auth gate — renders Login / ChangePassword when needed. */
|
|
60
|
+
readonly AuthGate: typeof AuthGate;
|
|
61
|
+
/** Post-login landing view. */
|
|
62
|
+
readonly AgentsPicker: typeof AgentsPicker;
|
|
63
|
+
/** Flex layout container for SessionsPanel + MainColumn. */
|
|
64
|
+
readonly Layout: typeof Layout;
|
|
65
|
+
/** Sessions sidebar. */
|
|
66
|
+
readonly SessionsPanel: typeof SessionsPanel;
|
|
67
|
+
/** Main chat column. */
|
|
68
|
+
readonly MainColumn: typeof MainColumn;
|
|
69
|
+
/** Scrollable message list. */
|
|
70
|
+
readonly MessageList: typeof MessageList;
|
|
71
|
+
/** Input area with send/stop buttons + toolbar. */
|
|
72
|
+
readonly Input: typeof MessageInput;
|
|
73
|
+
/** Markdown renderer for assistant message bodies (GFM + math). */
|
|
74
|
+
readonly MarkdownRenderer: typeof MarkdownRenderer;
|
|
75
|
+
/** Standalone reasoning-effort selector (per-message, legacy §7.4 path). */
|
|
76
|
+
readonly EffortControl: typeof EffortControl;
|
|
77
|
+
/** Capability-driven per-session reasoning UI. Renders 0–3 dropdowns/inputs
|
|
78
|
+
* based on the active agent's model. Returns null for no-reasoning models. */
|
|
79
|
+
readonly ReasoningSelector: typeof ReasoningSelector;
|
|
80
|
+
/** System-notice banner (TPM wait / resumed / error). */
|
|
81
|
+
readonly SystemNotice: typeof SystemNotice;
|
|
82
|
+
/** TPM-recovery banner with countdown. */
|
|
83
|
+
readonly TpmBanner: typeof TpmBanner;
|
|
84
|
+
/** `(status, phase)` indicator dot + label (§10.4). */
|
|
85
|
+
readonly TurnStatusIndicator: typeof TurnStatusIndicator;
|
|
86
|
+
/** Sun/moon theme toggle. */
|
|
87
|
+
readonly ThemeSwitcher: typeof ThemeSwitcher;
|
|
88
|
+
/** Floating "↓ Jump to latest" button. */
|
|
89
|
+
readonly ScrollToPresentButton: typeof ScrollToPresentButton;
|
|
90
|
+
/** Collapsible reasoning block inside an assistant bubble. */
|
|
91
|
+
readonly ReasoningView: typeof ReasoningView;
|
|
92
|
+
/** Collapsible tool-call card. */
|
|
93
|
+
readonly ToolCallView: typeof ToolCallView;
|
|
94
|
+
/** Role-gated admin UI (returns null for `user`-role callers). */
|
|
95
|
+
readonly AdminShell: typeof DataClubAIHubAdmin;
|
|
96
|
+
};
|
|
97
|
+
/** The `AIHub` namespace type — exported for consumers that type-spread it. */
|
|
98
|
+
export type AIHubNamespace = typeof AIHub;
|
|
99
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,KAAK;IAChB,6BAA6B;;IAE7B,8DAA8D;;IAE9D,+BAA+B;;IAE/B,4DAA4D;;IAE5D,wBAAwB;;IAExB,wBAAwB;;IAExB,+BAA+B;;IAE/B,mDAAmD;;IAEnD,mEAAmE;;IAEnE,4EAA4E;;IAE5E;mFAC+E;;IAE/E,yDAAyD;;IAEzD,0CAA0C;;IAE1C,uDAAuD;;IAEvD,6BAA6B;;IAE7B,0CAA0C;;IAE1C,8DAA8D;;IAE9D,kCAAkC;;IAElC,kEAAkE;;CAE1D,CAAC;AAEX,+EAA+E;AAC/E,MAAM,MAAM,cAAc,GAAG,OAAO,KAAK,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `AIHub.*` namespace — Tier-3 composition primitives.
|
|
3
|
+
*
|
|
4
|
+
* Every primitive is real after Step 10. Tier-3 wrappers compose them
|
|
5
|
+
* directly; the default monolith `<DataClubAIHub />` is itself a Tier-3
|
|
6
|
+
* composition that lives in the library as a reference (~50 lines of
|
|
7
|
+
* internal body code).
|
|
8
|
+
*
|
|
9
|
+
* The namespace is intentionally a single object literal so consumers
|
|
10
|
+
* can do `import { AIHub } from "@data-club/ai-hub"` and reach every
|
|
11
|
+
* primitive via dotted access (`<AIHub.MessageList renderMessageActions={…} />`).
|
|
12
|
+
*
|
|
13
|
+
* @see SPECIFICATIONS.md §7.1 — exports
|
|
14
|
+
* @see SPECIFICATIONS.md §7.9 — Tier 3 composition
|
|
15
|
+
*/
|
|
16
|
+
import { AIHubProvider } from "../context/AIHubProvider.js";
|
|
17
|
+
import { AgentsPicker } from "../components/AgentsPicker/index.js";
|
|
18
|
+
import { AuthGate } from "../components/AuthGate/index.js";
|
|
19
|
+
import { DataClubAIHubAdmin } from "../components/DataClubAIHubAdmin/index.js";
|
|
20
|
+
import { EffortControl } from "../components/EffortControl/index.js";
|
|
21
|
+
import { Layout } from "../components/Layout/index.js";
|
|
22
|
+
import { MainColumn } from "../components/MainColumn/index.js";
|
|
23
|
+
import { MarkdownRenderer } from "../components/MarkdownRenderer/index.js";
|
|
24
|
+
import { MessageInput } from "../components/MessageInput/index.js";
|
|
25
|
+
import { MessageList } from "../components/MessageList/index.js";
|
|
26
|
+
import { ReasoningSelector } from "../components/ReasoningSelector/index.js";
|
|
27
|
+
import { ReasoningView } from "../components/ReasoningView/index.js";
|
|
28
|
+
import { ScrollToPresentButton } from "../components/ScrollToPresentButton/index.js";
|
|
29
|
+
import { SessionsPanel } from "../components/SessionsPanel/index.js";
|
|
30
|
+
import { SystemNotice } from "../components/SystemNotice/index.js";
|
|
31
|
+
import { ThemeSwitcher } from "../components/ThemeSwitcher/index.js";
|
|
32
|
+
import { ToolCallView } from "../components/ToolCallView/index.js";
|
|
33
|
+
import { TpmBanner } from "../components/TpmBanner/index.js";
|
|
34
|
+
import { TurnStatusIndicator } from "../components/TurnStatusIndicator/index.js";
|
|
35
|
+
/**
|
|
36
|
+
* Tier-3 composition primitives. Build a custom layout by composing
|
|
37
|
+
* `AIHub.Provider` + `AIHub.AuthGate` + `AIHub.Layout` + sub-primitives.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <AIHub.Provider baseUrl="/api/ai-hub">
|
|
42
|
+
* <AIHub.AuthGate>
|
|
43
|
+
* <AIHub.Layout>
|
|
44
|
+
* <AIHub.SessionsPanel />
|
|
45
|
+
* <AIHub.MainColumn>
|
|
46
|
+
* <AIHub.MessageList />
|
|
47
|
+
* <AIHub.Input toolbar={<AIHub.EffortControl />} />
|
|
48
|
+
* </AIHub.MainColumn>
|
|
49
|
+
* </AIHub.Layout>
|
|
50
|
+
* </AIHub.AuthGate>
|
|
51
|
+
* </AIHub.Provider>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see SPECIFICATIONS.md §7.9
|
|
55
|
+
*/
|
|
56
|
+
export const AIHub = {
|
|
57
|
+
/** Root context provider. */
|
|
58
|
+
Provider: AIHubProvider,
|
|
59
|
+
/** Auth gate — renders Login / ChangePassword when needed. */
|
|
60
|
+
AuthGate,
|
|
61
|
+
/** Post-login landing view. */
|
|
62
|
+
AgentsPicker,
|
|
63
|
+
/** Flex layout container for SessionsPanel + MainColumn. */
|
|
64
|
+
Layout,
|
|
65
|
+
/** Sessions sidebar. */
|
|
66
|
+
SessionsPanel,
|
|
67
|
+
/** Main chat column. */
|
|
68
|
+
MainColumn,
|
|
69
|
+
/** Scrollable message list. */
|
|
70
|
+
MessageList,
|
|
71
|
+
/** Input area with send/stop buttons + toolbar. */
|
|
72
|
+
Input: MessageInput,
|
|
73
|
+
/** Markdown renderer for assistant message bodies (GFM + math). */
|
|
74
|
+
MarkdownRenderer,
|
|
75
|
+
/** Standalone reasoning-effort selector (per-message, legacy §7.4 path). */
|
|
76
|
+
EffortControl,
|
|
77
|
+
/** Capability-driven per-session reasoning UI. Renders 0–3 dropdowns/inputs
|
|
78
|
+
* based on the active agent's model. Returns null for no-reasoning models. */
|
|
79
|
+
ReasoningSelector,
|
|
80
|
+
/** System-notice banner (TPM wait / resumed / error). */
|
|
81
|
+
SystemNotice,
|
|
82
|
+
/** TPM-recovery banner with countdown. */
|
|
83
|
+
TpmBanner,
|
|
84
|
+
/** `(status, phase)` indicator dot + label (§10.4). */
|
|
85
|
+
TurnStatusIndicator,
|
|
86
|
+
/** Sun/moon theme toggle. */
|
|
87
|
+
ThemeSwitcher,
|
|
88
|
+
/** Floating "↓ Jump to latest" button. */
|
|
89
|
+
ScrollToPresentButton,
|
|
90
|
+
/** Collapsible reasoning block inside an assistant bubble. */
|
|
91
|
+
ReasoningView,
|
|
92
|
+
/** Collapsible tool-call card. */
|
|
93
|
+
ToolCallView,
|
|
94
|
+
/** Role-gated admin UI (returns null for `user`-role callers). */
|
|
95
|
+
AdminShell: DataClubAIHubAdmin,
|
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BAA6B;IAC7B,QAAQ,EAAE,aAAa;IACvB,8DAA8D;IAC9D,QAAQ;IACR,+BAA+B;IAC/B,YAAY;IACZ,4DAA4D;IAC5D,MAAM;IACN,wBAAwB;IACxB,aAAa;IACb,wBAAwB;IACxB,UAAU;IACV,+BAA+B;IAC/B,WAAW;IACX,mDAAmD;IACnD,KAAK,EAAE,YAAY;IACnB,mEAAmE;IACnE,gBAAgB;IAChB,4EAA4E;IAC5E,aAAa;IACb;mFAC+E;IAC/E,iBAAiB;IACjB,yDAAyD;IACzD,YAAY;IACZ,0CAA0C;IAC1C,SAAS;IACT,uDAAuD;IACvD,mBAAmB;IACnB,6BAA6B;IAC7B,aAAa;IACb,0CAA0C;IAC1C,qBAAqB;IACrB,8DAA8D;IAC9D,aAAa;IACb,kCAAkC;IAClC,YAAY;IACZ,kEAAkE;IAClE,UAAU,EAAE,kBAAkB;CACtB,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Affordance helpers — the pure-function half of Step 10.
|
|
3
|
+
*
|
|
4
|
+
* Two concerns live here:
|
|
5
|
+
*
|
|
6
|
+
* 1. **§8.4 precedence resolution.** `resolveAffordanceFlags()` composes
|
|
7
|
+
* the three layers — server toggles (highest), React prop overrides,
|
|
8
|
+
* built-in defaults — into one flat record of booleans. The monolith
|
|
9
|
+
* `<DataClubAIHub />` calls this once and passes the resolved flags
|
|
10
|
+
* down to layout / affordance primitives, so each primitive doesn't
|
|
11
|
+
* have to re-implement the merge.
|
|
12
|
+
*
|
|
13
|
+
* 2. **§10.4 predicate table.** `chatAffordances()` is a pure function of
|
|
14
|
+
* `(status, phase)` returning the predicate booleans the table calls
|
|
15
|
+
* for ("Stop button visible", "Input disabled", "TPM banner",
|
|
16
|
+
* "Streaming dots", etc.). Primitives consume the returned record
|
|
17
|
+
* directly so the same predicates are tested in one place and never
|
|
18
|
+
* drift between e.g. the stop button and the streaming-cursor
|
|
19
|
+
* indicator.
|
|
20
|
+
*
|
|
21
|
+
* Neither function reads context — both are testable in isolation against
|
|
22
|
+
* the cross-package SSE fixtures. The provider's React surface is
|
|
23
|
+
* `useAIHub().featureToggles` (raw) + the helpers here.
|
|
24
|
+
*
|
|
25
|
+
* @see SPECIFICATIONS.md §8.4 — feature toggles
|
|
26
|
+
* @see SPECIFICATIONS.md §10.4 — affordances bound to (status, phase)
|
|
27
|
+
*/
|
|
28
|
+
import type { AIHubFeatureToggles, AIHubState, RunningPhase, TurnStatus } from "../types.js";
|
|
29
|
+
/**
|
|
30
|
+
* The flat, resolved (after-precedence) affordance flag record.
|
|
31
|
+
*
|
|
32
|
+
* Field names are camelCase here (React-side); the wire shape is
|
|
33
|
+
* snake_case (`AIHubFeatureToggles`). The mapping between the two is
|
|
34
|
+
* locked down by `resolveAffordanceFlags` below.
|
|
35
|
+
*/
|
|
36
|
+
export interface AIHubAffordanceFlags {
|
|
37
|
+
/** Whether the sessions panel renders at all. Default true. */
|
|
38
|
+
sessionsPanelEnabled: boolean;
|
|
39
|
+
/** Whether the sessions-panel handle is draggable. Default true. */
|
|
40
|
+
sessionsPanelResizable: boolean;
|
|
41
|
+
/** Whether the sessions panel can be collapsed. Default true. */
|
|
42
|
+
sessionsPanelCollapsible: boolean;
|
|
43
|
+
/** Whether the "+ New chat" button renders on the panel. Default true. */
|
|
44
|
+
createSessionButtonEnabled: boolean;
|
|
45
|
+
/** Whether the input area renders (read-only when false). Default true. */
|
|
46
|
+
userInputEnabled: boolean;
|
|
47
|
+
/** Whether the stop button is exposed while a turn is running. Default true. */
|
|
48
|
+
stopButtonEnabled: boolean;
|
|
49
|
+
/** Whether tool-call cards render in assistant bubbles. Default true. */
|
|
50
|
+
toolCallsVisible: boolean;
|
|
51
|
+
/** Whether reasoning blocks render in assistant bubbles. Default true. */
|
|
52
|
+
reasoningVisible: boolean;
|
|
53
|
+
/** Whether system messages render in the list. Default true. */
|
|
54
|
+
systemMessagesVisible: boolean;
|
|
55
|
+
/** Whether the TPM-recovery banner renders during waiting_provider. Default true. */
|
|
56
|
+
tpmNoticeVisible: boolean;
|
|
57
|
+
/** Whether the effort dropdown renders in the input toolbar. Default true. */
|
|
58
|
+
effortControlVisible: boolean;
|
|
59
|
+
/** Whether the scroll-to-present button renders when the user scrolled up. Default true. */
|
|
60
|
+
scrollToPresentVisible: boolean;
|
|
61
|
+
/** Whether the turn-status indicator renders in the chat header. Default true. */
|
|
62
|
+
turnStatusVisible: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Built-in defaults — applied when neither server nor React prop sets a value. */
|
|
65
|
+
export declare const DEFAULT_AFFORDANCE_FLAGS: AIHubAffordanceFlags;
|
|
66
|
+
/**
|
|
67
|
+
* Per-flag mapping from the wire key (`AIHubFeatureToggles`) to the
|
|
68
|
+
* camelCase field on `AIHubAffordanceFlags`. Exported so tests can
|
|
69
|
+
* iterate the §8.4 mapping without duplicating it in the test file.
|
|
70
|
+
*/
|
|
71
|
+
export declare const FEATURE_TOGGLE_KEY_MAP: ReadonlyArray<readonly [keyof AIHubFeatureToggles, keyof AIHubAffordanceFlags]>;
|
|
72
|
+
/**
|
|
73
|
+
* Composes the three layers into a flat resolved record of all 13
|
|
74
|
+
* affordance booleans.
|
|
75
|
+
*
|
|
76
|
+
* Per §8.4: server toggle wins; falling through, the React prop wins;
|
|
77
|
+
* falling through that, the built-in default wins. Adding a new toggle
|
|
78
|
+
* requires updating `FEATURE_TOGGLE_KEY_MAP` + the schema in
|
|
79
|
+
* `routes/admin/settings.ts` + the field on `AIHubFeatureToggles` — the
|
|
80
|
+
* compile-time exhaustiveness check on the for-loop will surface any
|
|
81
|
+
* missed addition.
|
|
82
|
+
*
|
|
83
|
+
* @param serverToggles - the wire blob from `GET /feature-toggles`
|
|
84
|
+
* (`null` while the request is in flight; treat as an empty blob).
|
|
85
|
+
* @param propOverrides - React-prop overrides keyed by the camelCase
|
|
86
|
+
* field name (`AIHubAffordanceFlags`). All fields optional.
|
|
87
|
+
* @returns the fully-resolved record. Every field is a boolean.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveAffordanceFlags(serverToggles: AIHubFeatureToggles | null, propOverrides: Partial<AIHubAffordanceFlags>): AIHubAffordanceFlags;
|
|
90
|
+
/**
|
|
91
|
+
* The §10.4 predicate table — pure function of `(status, phase)` (lifted
|
|
92
|
+
* from `AIHubState`). Each field maps to one row of the table; primitives
|
|
93
|
+
* consume the booleans directly so the same predicate is sourced from one
|
|
94
|
+
* place.
|
|
95
|
+
*
|
|
96
|
+
* Some predicates depend on transient affordance flags (e.g. the stop
|
|
97
|
+
* button is suppressed when `stopButtonEnabled === false` from server
|
|
98
|
+
* config). For those the caller AND-merges the predicate result with the
|
|
99
|
+
* flag — keeping this function pure (no closure over flags) avoids
|
|
100
|
+
* coupling the §8.4 layer to the §10.4 layer.
|
|
101
|
+
*/
|
|
102
|
+
export interface AIHubChatAffordances {
|
|
103
|
+
/** §10.4 row "Stop button visible" — predicate only; ignore stopButtonEnabled here. */
|
|
104
|
+
stopButtonVisible: boolean;
|
|
105
|
+
/** §10.4 row "Input disabled". */
|
|
106
|
+
inputDisabled: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* §10.4 row "Scroll-to-present button" — true when the *predicate* fires,
|
|
109
|
+
* which is `status === "running"`. The component additionally requires
|
|
110
|
+
* `userScrolledAwayFromBottom`, which is local state, not table state.
|
|
111
|
+
*/
|
|
112
|
+
scrollToPresentVisible: boolean;
|
|
113
|
+
/** §10.4 row "Streaming dots" — `running && phase === model_text`. */
|
|
114
|
+
streamingDots: boolean;
|
|
115
|
+
/** §10.4 row "Reasoning spinner / panel" — `running && phase === model_reasoning`. */
|
|
116
|
+
reasoningSpinner: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* §10.4 row "Tool-call card 'preparing'" — `phase === model_tool_input`.
|
|
119
|
+
* Note: spec says the predicate is just `phase === model_tool_input`,
|
|
120
|
+
* not `status === running` — `phase` is only meaningful when `status ===
|
|
121
|
+
* running` anyway, so the AND is implicit.
|
|
122
|
+
*/
|
|
123
|
+
toolCallPreparing: boolean;
|
|
124
|
+
/** §10.4 row "Tool-call card 'running' with spinner" — `phase === tool_executing`. */
|
|
125
|
+
toolCallRunning: boolean;
|
|
126
|
+
/** §10.4 row "TPM banner with countdown" — `phase === waiting_provider`. */
|
|
127
|
+
tpmBannerVisible: boolean;
|
|
128
|
+
/** §10.4 row "'Stopped' stamp" — `status === cancelled`. */
|
|
129
|
+
cancelledStamp: boolean;
|
|
130
|
+
/** §10.4 row "Retry button on assistant turn" — `status === failed`. */
|
|
131
|
+
retryButtonVisible: boolean;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Computes the §10.4 predicate booleans for a given chat state.
|
|
135
|
+
*
|
|
136
|
+
* Pure function — `(state) => predicates`. Used by every affordance-aware
|
|
137
|
+
* component (`MessageInput`, `MessageList`, `ScrollToPresentButton`,
|
|
138
|
+
* `TurnStatusIndicator`, …) so the table lives in exactly one place.
|
|
139
|
+
*
|
|
140
|
+
* @param state - the current `AIHubState` from the reducer.
|
|
141
|
+
* @returns the predicate record.
|
|
142
|
+
*/
|
|
143
|
+
export declare function chatAffordances(state: AIHubState): AIHubChatAffordances;
|
|
144
|
+
/**
|
|
145
|
+
* The §10.4 turn-status indicator table — pure function of `(status,
|
|
146
|
+
* phase)` returning the user-visible label + the dot variant the
|
|
147
|
+
* `TurnStatusIndicator` primitive renders.
|
|
148
|
+
*
|
|
149
|
+
* Three dot variants exist:
|
|
150
|
+
*
|
|
151
|
+
* - `"idle"` — gray, static
|
|
152
|
+
* - `"running"` — accent, pulsing
|
|
153
|
+
* - `"warning"` — warning yellow, pulsing (rate-limit wait)
|
|
154
|
+
* - `"error"` — error red, static
|
|
155
|
+
*
|
|
156
|
+
* Mapping is exactly the table from §10.4. The transient flashes ("Done"
|
|
157
|
+
* before settling to "Ready", "Cancelled" before settling to "Ready")
|
|
158
|
+
* are not encoded here — those are handled in the component via
|
|
159
|
+
* `useEffect` + a short timer.
|
|
160
|
+
*/
|
|
161
|
+
export interface AIHubTurnStatusVisual {
|
|
162
|
+
/** Short human-readable label rendered next to the dot. */
|
|
163
|
+
label: string;
|
|
164
|
+
/** Dot variant — drives the BEM modifier on the dot element. */
|
|
165
|
+
dot: "idle" | "running" | "warning" | "error";
|
|
166
|
+
/** Whether the dot pulses (suppressed under `prefers-reduced-motion`). */
|
|
167
|
+
pulse: boolean;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Computes the §10.4 turn-status indicator's `(label, dot, pulse)` from
|
|
171
|
+
* a `(status, phase)` pair.
|
|
172
|
+
*
|
|
173
|
+
* Pure. Drives the BEM modifier on the dot + the label text inside the
|
|
174
|
+
* indicator. The "Done" flash and the "Cancelled → Ready" auto-clear
|
|
175
|
+
* timings are local to the component.
|
|
176
|
+
*
|
|
177
|
+
* @param status - the turn status.
|
|
178
|
+
* @param phase - the running phase (only meaningful when status === running).
|
|
179
|
+
* @returns the visual triple.
|
|
180
|
+
*/
|
|
181
|
+
export declare function turnStatusVisual(status: TurnStatus, phase: RunningPhase | null): AIHubTurnStatusVisual;
|
|
182
|
+
//# sourceMappingURL=affordances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affordances.d.ts","sourceRoot":"","sources":["../../src/state/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,UAAU,EACX,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oEAAoE;IACpE,sBAAsB,EAAE,OAAO,CAAC;IAChC,iEAAiE;IACjE,wBAAwB,EAAE,OAAO,CAAC;IAClC,0EAA0E;IAC1E,0BAA0B,EAAE,OAAO,CAAC;IACpC,2EAA2E;IAC3E,gBAAgB,EAAE,OAAO,CAAC;IAC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,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB,CAcvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9C,0EAA0E;IAC1E,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,YAAY,GAAG,IAAI,GACzB,qBAAqB,CAyCvB"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Affordance helpers — the pure-function half of Step 10.
|
|
3
|
+
*
|
|
4
|
+
* Two concerns live here:
|
|
5
|
+
*
|
|
6
|
+
* 1. **§8.4 precedence resolution.** `resolveAffordanceFlags()` composes
|
|
7
|
+
* the three layers — server toggles (highest), React prop overrides,
|
|
8
|
+
* built-in defaults — into one flat record of booleans. The monolith
|
|
9
|
+
* `<DataClubAIHub />` calls this once and passes the resolved flags
|
|
10
|
+
* down to layout / affordance primitives, so each primitive doesn't
|
|
11
|
+
* have to re-implement the merge.
|
|
12
|
+
*
|
|
13
|
+
* 2. **§10.4 predicate table.** `chatAffordances()` is a pure function of
|
|
14
|
+
* `(status, phase)` returning the predicate booleans the table calls
|
|
15
|
+
* for ("Stop button visible", "Input disabled", "TPM banner",
|
|
16
|
+
* "Streaming dots", etc.). Primitives consume the returned record
|
|
17
|
+
* directly so the same predicates are tested in one place and never
|
|
18
|
+
* drift between e.g. the stop button and the streaming-cursor
|
|
19
|
+
* indicator.
|
|
20
|
+
*
|
|
21
|
+
* Neither function reads context — both are testable in isolation against
|
|
22
|
+
* the cross-package SSE fixtures. The provider's React surface is
|
|
23
|
+
* `useAIHub().featureToggles` (raw) + the helpers here.
|
|
24
|
+
*
|
|
25
|
+
* @see SPECIFICATIONS.md §8.4 — feature toggles
|
|
26
|
+
* @see SPECIFICATIONS.md §10.4 — affordances bound to (status, phase)
|
|
27
|
+
*/
|
|
28
|
+
/** Built-in defaults — applied when neither server nor React prop sets a value. */
|
|
29
|
+
export const DEFAULT_AFFORDANCE_FLAGS = Object.freeze({
|
|
30
|
+
sessionsPanelEnabled: true,
|
|
31
|
+
sessionsPanelResizable: true,
|
|
32
|
+
sessionsPanelCollapsible: true,
|
|
33
|
+
createSessionButtonEnabled: true,
|
|
34
|
+
userInputEnabled: true,
|
|
35
|
+
stopButtonEnabled: true,
|
|
36
|
+
toolCallsVisible: true,
|
|
37
|
+
reasoningVisible: true,
|
|
38
|
+
systemMessagesVisible: true,
|
|
39
|
+
tpmNoticeVisible: true,
|
|
40
|
+
effortControlVisible: true,
|
|
41
|
+
scrollToPresentVisible: true,
|
|
42
|
+
turnStatusVisible: true,
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Per-flag mapping from the wire key (`AIHubFeatureToggles`) to the
|
|
46
|
+
* camelCase field on `AIHubAffordanceFlags`. Exported so tests can
|
|
47
|
+
* iterate the §8.4 mapping without duplicating it in the test file.
|
|
48
|
+
*/
|
|
49
|
+
export const FEATURE_TOGGLE_KEY_MAP = Object.freeze([
|
|
50
|
+
["sessions_panel_enabled", "sessionsPanelEnabled"],
|
|
51
|
+
["sessions_panel_resizable", "sessionsPanelResizable"],
|
|
52
|
+
["sessions_panel_collapsible", "sessionsPanelCollapsible"],
|
|
53
|
+
["create_session_button_enabled", "createSessionButtonEnabled"],
|
|
54
|
+
["user_input_enabled", "userInputEnabled"],
|
|
55
|
+
["stop_button_enabled", "stopButtonEnabled"],
|
|
56
|
+
["tool_calls_visible", "toolCallsVisible"],
|
|
57
|
+
["reasoning_visible", "reasoningVisible"],
|
|
58
|
+
["system_messages_visible", "systemMessagesVisible"],
|
|
59
|
+
["tpm_notice_visible", "tpmNoticeVisible"],
|
|
60
|
+
["effort_control_visible", "effortControlVisible"],
|
|
61
|
+
["scroll_to_present_visible", "scrollToPresentVisible"],
|
|
62
|
+
["turn_status_visible", "turnStatusVisible"],
|
|
63
|
+
]);
|
|
64
|
+
/**
|
|
65
|
+
* Resolves the precedence stack for one toggle.
|
|
66
|
+
*
|
|
67
|
+
* **Server toggle > React prop > built-in default.** Documented in §8.4
|
|
68
|
+
* and enforced by this function alone — every caller that wants the
|
|
69
|
+
* effective state must go through here.
|
|
70
|
+
*
|
|
71
|
+
* @param serverValue - the server-set value (`undefined` when the
|
|
72
|
+
* super_admin hasn't set this toggle explicitly).
|
|
73
|
+
* @param propValue - the React-prop override (`undefined` when the
|
|
74
|
+
* wrapper didn't supply one).
|
|
75
|
+
* @param defaultValue - the built-in default for this flag.
|
|
76
|
+
* @returns the effective boolean.
|
|
77
|
+
*/
|
|
78
|
+
function resolveOne(serverValue, propValue, defaultValue) {
|
|
79
|
+
if (typeof serverValue === "boolean")
|
|
80
|
+
return serverValue;
|
|
81
|
+
if (typeof propValue === "boolean")
|
|
82
|
+
return propValue;
|
|
83
|
+
return defaultValue;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Composes the three layers into a flat resolved record of all 13
|
|
87
|
+
* affordance booleans.
|
|
88
|
+
*
|
|
89
|
+
* Per §8.4: server toggle wins; falling through, the React prop wins;
|
|
90
|
+
* falling through that, the built-in default wins. Adding a new toggle
|
|
91
|
+
* requires updating `FEATURE_TOGGLE_KEY_MAP` + the schema in
|
|
92
|
+
* `routes/admin/settings.ts` + the field on `AIHubFeatureToggles` — the
|
|
93
|
+
* compile-time exhaustiveness check on the for-loop will surface any
|
|
94
|
+
* missed addition.
|
|
95
|
+
*
|
|
96
|
+
* @param serverToggles - the wire blob from `GET /feature-toggles`
|
|
97
|
+
* (`null` while the request is in flight; treat as an empty blob).
|
|
98
|
+
* @param propOverrides - React-prop overrides keyed by the camelCase
|
|
99
|
+
* field name (`AIHubAffordanceFlags`). All fields optional.
|
|
100
|
+
* @returns the fully-resolved record. Every field is a boolean.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveAffordanceFlags(serverToggles, propOverrides) {
|
|
103
|
+
const out = { ...DEFAULT_AFFORDANCE_FLAGS };
|
|
104
|
+
const server = serverToggles ?? {};
|
|
105
|
+
for (const [wireKey, fieldKey] of FEATURE_TOGGLE_KEY_MAP) {
|
|
106
|
+
out[fieldKey] = resolveOne(server[wireKey], propOverrides[fieldKey], DEFAULT_AFFORDANCE_FLAGS[fieldKey]);
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Computes the §10.4 predicate booleans for a given chat state.
|
|
112
|
+
*
|
|
113
|
+
* Pure function — `(state) => predicates`. Used by every affordance-aware
|
|
114
|
+
* component (`MessageInput`, `MessageList`, `ScrollToPresentButton`,
|
|
115
|
+
* `TurnStatusIndicator`, …) so the table lives in exactly one place.
|
|
116
|
+
*
|
|
117
|
+
* @param state - the current `AIHubState` from the reducer.
|
|
118
|
+
* @returns the predicate record.
|
|
119
|
+
*/
|
|
120
|
+
export function chatAffordances(state) {
|
|
121
|
+
const isRunning = state.status === "running";
|
|
122
|
+
return {
|
|
123
|
+
stopButtonVisible: isRunning,
|
|
124
|
+
inputDisabled: isRunning,
|
|
125
|
+
scrollToPresentVisible: isRunning,
|
|
126
|
+
streamingDots: isRunning && state.phase === "model_text",
|
|
127
|
+
reasoningSpinner: isRunning && state.phase === "model_reasoning",
|
|
128
|
+
toolCallPreparing: isRunning && state.phase === "model_tool_input",
|
|
129
|
+
toolCallRunning: isRunning && state.phase === "tool_executing",
|
|
130
|
+
tpmBannerVisible: isRunning && state.phase === "waiting_provider",
|
|
131
|
+
cancelledStamp: state.status === "cancelled",
|
|
132
|
+
retryButtonVisible: state.status === "failed",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Computes the §10.4 turn-status indicator's `(label, dot, pulse)` from
|
|
137
|
+
* a `(status, phase)` pair.
|
|
138
|
+
*
|
|
139
|
+
* Pure. Drives the BEM modifier on the dot + the label text inside the
|
|
140
|
+
* indicator. The "Done" flash and the "Cancelled → Ready" auto-clear
|
|
141
|
+
* timings are local to the component.
|
|
142
|
+
*
|
|
143
|
+
* @param status - the turn status.
|
|
144
|
+
* @param phase - the running phase (only meaningful when status === running).
|
|
145
|
+
* @returns the visual triple.
|
|
146
|
+
*/
|
|
147
|
+
export function turnStatusVisual(status, phase) {
|
|
148
|
+
if (status === "running") {
|
|
149
|
+
switch (phase) {
|
|
150
|
+
case "model_text":
|
|
151
|
+
return { label: "Generating…", dot: "running", pulse: true };
|
|
152
|
+
case "model_reasoning":
|
|
153
|
+
return { label: "Reasoning…", dot: "running", pulse: true };
|
|
154
|
+
case "model_tool_input":
|
|
155
|
+
return {
|
|
156
|
+
label: "Preparing tool call…",
|
|
157
|
+
dot: "running",
|
|
158
|
+
pulse: true,
|
|
159
|
+
};
|
|
160
|
+
case "tool_executing":
|
|
161
|
+
return { label: "Running tool…", dot: "running", pulse: true };
|
|
162
|
+
case "waiting_provider":
|
|
163
|
+
return {
|
|
164
|
+
label: "Waiting (rate limit)…",
|
|
165
|
+
dot: "warning",
|
|
166
|
+
pulse: true,
|
|
167
|
+
};
|
|
168
|
+
case "awaiting_user":
|
|
169
|
+
// Not exercised by the predicate table (the spec doesn't surface
|
|
170
|
+
// a label for awaiting_user); fall back to "Ready" so the dot
|
|
171
|
+
// doesn't strobe.
|
|
172
|
+
return { label: "Ready", dot: "idle", pulse: false };
|
|
173
|
+
case null:
|
|
174
|
+
return { label: "Generating…", dot: "running", pulse: true };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (status === "failed") {
|
|
178
|
+
return { label: "Failed", dot: "error", pulse: false };
|
|
179
|
+
}
|
|
180
|
+
if (status === "cancelled") {
|
|
181
|
+
return { label: "Cancelled", dot: "idle", pulse: false };
|
|
182
|
+
}
|
|
183
|
+
if (status === "done") {
|
|
184
|
+
return { label: "Done", dot: "idle", pulse: false };
|
|
185
|
+
}
|
|
186
|
+
// idle
|
|
187
|
+
return { label: "Ready", dot: "idle", pulse: false };
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=affordances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affordances.js","sourceRoot":"","sources":["../../src/state/affordances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA6CH,mFAAmF;AACnF,MAAM,CAAC,MAAM,wBAAwB,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC1E,oBAAoB,EAAE,IAAI;IAC1B,sBAAsB,EAAE,IAAI;IAC5B,wBAAwB,EAAE,IAAI;IAC9B,0BAA0B,EAAE,IAAI;IAChC,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,IAAI;IAC1B,sBAAsB,EAAE,IAAI;IAC5B,iBAAiB,EAAE,IAAI;CACxB,CAAyB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAE/B,MAAM,CAAC,MAAM,CAAC;IAChB,CAAC,wBAAwB,EAAE,sBAAsB,CAAC;IAClD,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;IACtD,CAAC,4BAA4B,EAAE,0BAA0B,CAAC;IAC1D,CAAC,+BAA+B,EAAE,4BAA4B,CAAC;IAC/D,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;IAC1C,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;IAC5C,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;IAC1C,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;IACzC,CAAC,yBAAyB,EAAE,uBAAuB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