@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,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<AgentEditorModal />` — shared create + edit modal for the Agents sub-page
|
|
3
|
+
* ([06-admin-agents.md]).
|
|
4
|
+
*
|
|
5
|
+
* Required fields: `display_name` and `letta_agent_id`. **Model / provider /
|
|
6
|
+
* system prompt / tools / memory blocks are intentionally absent** — they
|
|
7
|
+
* live in Letta's ADE per §1, §6.4.1.
|
|
8
|
+
*
|
|
9
|
+
* Step-12.5 — adds an optional "Specialized agent" sub-section below the
|
|
10
|
+
* required fields:
|
|
11
|
+
*
|
|
12
|
+
* - `sandbox_seed_name` — name of a folder under `AI_HUB_FILES_DIR/seeds/`
|
|
13
|
+
* to copy into each new session's working directory.
|
|
14
|
+
* - `fork_source_conversation_id` — Letta conversation id to fork from
|
|
15
|
+
* at session create.
|
|
16
|
+
*
|
|
17
|
+
* Both new fields are optional and independent — see
|
|
18
|
+
* [docs/server/session-sandboxes.md](../../../../../docs/server/session-sandboxes.md).
|
|
19
|
+
*
|
|
20
|
+
* The modal owns local validation (required fields) + the in-flight submit
|
|
21
|
+
* button label; the parent page owns the network call so it can swap the
|
|
22
|
+
* row in / out of its table state on success.
|
|
23
|
+
*
|
|
24
|
+
* Errors are surfaced two ways: inline on the relevant field when the server
|
|
25
|
+
* returns a field-targeted error code (`letta_agent_not_found`,
|
|
26
|
+
* `seed_name_invalid`, `seed_dir_not_found`, `fork_source_not_found`,
|
|
27
|
+
* `fork_source_agent_mismatch`), and as a generic banner above the buttons
|
|
28
|
+
* for anything else.
|
|
29
|
+
*
|
|
30
|
+
* @see SPECIFICATIONS.md §6.3.4 — admin agents endpoints
|
|
31
|
+
* @see ui-sketches/06-admin-agents.md — modal layout
|
|
32
|
+
* @see docs/server/session-sandboxes.md — Step-12.5 specialized-agent levers
|
|
33
|
+
*/
|
|
34
|
+
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
35
|
+
|
|
36
|
+
import type { AIHubAdminTexts } from "../../auth/texts.js";
|
|
37
|
+
import { AIHubRequestError, type AdminRotatingMessageView } from "../../client/AIHubClient.js";
|
|
38
|
+
import { useAIHub } from "../../context/useAIHub.js";
|
|
39
|
+
|
|
40
|
+
/** Modal mode — create-new vs. edit-existing. */
|
|
41
|
+
export type AgentEditorMode = "create" | "edit";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* How the operator is specifying the base conversation:
|
|
45
|
+
* - `none` — no base; every session starts fresh.
|
|
46
|
+
* - `rotating` — pick a rotating starting message (stored as its `rmsg-…` id).
|
|
47
|
+
* - `manual` — paste a raw Letta `conv-…` id.
|
|
48
|
+
*/
|
|
49
|
+
type ForkMode = "none" | "rotating" | "manual";
|
|
50
|
+
|
|
51
|
+
/** Derives the initial fork mode from a stored fork-source value. */
|
|
52
|
+
function initialForkMode(value: string | null | undefined): ForkMode {
|
|
53
|
+
if (!value) return "none";
|
|
54
|
+
return value.startsWith("rmsg-") ? "rotating" : "manual";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Initial values for the edit variant. */
|
|
58
|
+
interface EditorInitial {
|
|
59
|
+
displayName: string;
|
|
60
|
+
lettaAgentId: string;
|
|
61
|
+
/** Step-12.5 — null when no sandbox configured for this agent. */
|
|
62
|
+
sandboxSeedName: string | null;
|
|
63
|
+
/** Step-12.5 — null when no fork source configured for this agent. */
|
|
64
|
+
forkSourceConversationId: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Submit-body shape passed up to the parent page. */
|
|
68
|
+
export interface AgentEditorSubmitBody {
|
|
69
|
+
displayName: string;
|
|
70
|
+
lettaAgentId: string;
|
|
71
|
+
/**
|
|
72
|
+
* Step-12.5 — `null` when the admin cleared the field (or left it blank);
|
|
73
|
+
* `string` when present. The parent's `createAdminAgent` / `patchAdminAgent`
|
|
74
|
+
* call forwards this verbatim — null becomes a `sandbox_seed_name: null`
|
|
75
|
+
* over the wire, which the server treats as "clear the column".
|
|
76
|
+
*/
|
|
77
|
+
sandboxSeedName: string | null;
|
|
78
|
+
/** Step-12.5 — same shape semantics as `sandboxSeedName`. */
|
|
79
|
+
forkSourceConversationId: string | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Props for `<AgentEditorModal />`. */
|
|
83
|
+
export interface AgentEditorModalProps {
|
|
84
|
+
/** Which variant to render. */
|
|
85
|
+
mode: AgentEditorMode;
|
|
86
|
+
/**
|
|
87
|
+
* Initial form values. Required on `mode === "edit"`; ignored on
|
|
88
|
+
* `mode === "create"`.
|
|
89
|
+
*/
|
|
90
|
+
initial?: EditorInitial;
|
|
91
|
+
/** Resolved admin texts. */
|
|
92
|
+
texts: AIHubAdminTexts;
|
|
93
|
+
/**
|
|
94
|
+
* Submits the form. Throws the SDK's `AIHubRequestError` on failure
|
|
95
|
+
* (the modal surfaces it inline / as a banner depending on the error
|
|
96
|
+
* code).
|
|
97
|
+
*/
|
|
98
|
+
onSubmit: (body: AgentEditorSubmitBody) => Promise<void>;
|
|
99
|
+
/** Dismisses the modal without submitting. */
|
|
100
|
+
onCancel: () => void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Renders the shared create / edit form.
|
|
105
|
+
*
|
|
106
|
+
* @param props - see {@link AgentEditorModalProps}.
|
|
107
|
+
* @returns the modal markup.
|
|
108
|
+
*/
|
|
109
|
+
export function AgentEditorModal(props: AgentEditorModalProps): ReactNode {
|
|
110
|
+
const isEdit = props.mode === "edit";
|
|
111
|
+
const [displayName, setDisplayName] = useState(props.initial?.displayName ?? "");
|
|
112
|
+
const [lettaAgentId, setLettaAgentId] = useState(
|
|
113
|
+
props.initial?.lettaAgentId ?? "",
|
|
114
|
+
);
|
|
115
|
+
// Step-12.5 — controlled inputs, empty string = "field cleared".
|
|
116
|
+
const [sandboxSeedName, setSandboxSeedName] = useState(
|
|
117
|
+
props.initial?.sandboxSeedName ?? "",
|
|
118
|
+
);
|
|
119
|
+
// Base-conversation control: a mode + the value for the active mode. The
|
|
120
|
+
// stored `fork_source_conversation_id` is either an `rmsg-…` reference or a
|
|
121
|
+
// raw `conv-…` id; we split it back into mode + value for editing.
|
|
122
|
+
const initialFork = props.initial?.forkSourceConversationId ?? null;
|
|
123
|
+
const [forkMode, setForkMode] = useState<ForkMode>(initialForkMode(initialFork));
|
|
124
|
+
const [selectedRmsgId, setSelectedRmsgId] = useState<string | null>(
|
|
125
|
+
initialFork && initialFork.startsWith("rmsg-") ? initialFork : null,
|
|
126
|
+
);
|
|
127
|
+
const [manualConvId, setManualConvId] = useState(
|
|
128
|
+
initialFork && !initialFork.startsWith("rmsg-") ? initialFork : "",
|
|
129
|
+
);
|
|
130
|
+
const [rmsgList, setRmsgList] = useState<AdminRotatingMessageView[] | null>(null);
|
|
131
|
+
const [rmsgSearch, setRmsgSearch] = useState("");
|
|
132
|
+
const { client } = useAIHub();
|
|
133
|
+
const [nameError, setNameError] = useState<string | null>(null);
|
|
134
|
+
const [idError, setIdError] = useState<string | null>(null);
|
|
135
|
+
const [seedError, setSeedError] = useState<string | null>(null);
|
|
136
|
+
const [forkError, setForkError] = useState<string | null>(null);
|
|
137
|
+
const [banner, setBanner] = useState<string | null>(null);
|
|
138
|
+
const [submitting, setSubmitting] = useState(false);
|
|
139
|
+
const firstFieldRef = useRef<HTMLInputElement | null>(null);
|
|
140
|
+
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
firstFieldRef.current?.focus();
|
|
143
|
+
}, []);
|
|
144
|
+
|
|
145
|
+
// Prefetch the rotating-message catalog so the "Rotating message" picker is
|
|
146
|
+
// ready. Best-effort: an empty list just shows the empty-state copy.
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
let cancelled = false;
|
|
149
|
+
void (async () => {
|
|
150
|
+
try {
|
|
151
|
+
const rows = await client.listAdminRotatingMessages();
|
|
152
|
+
if (!cancelled) setRmsgList(rows.filter((r) => !r.is_archived));
|
|
153
|
+
} catch {
|
|
154
|
+
if (!cancelled) setRmsgList([]);
|
|
155
|
+
}
|
|
156
|
+
})();
|
|
157
|
+
return () => {
|
|
158
|
+
cancelled = true;
|
|
159
|
+
};
|
|
160
|
+
}, [client]);
|
|
161
|
+
|
|
162
|
+
/** Rotating messages matching the search box (by name or id). */
|
|
163
|
+
const filteredRmsgs = useMemo(() => {
|
|
164
|
+
const list = rmsgList ?? [];
|
|
165
|
+
const q = rmsgSearch.trim().toLowerCase();
|
|
166
|
+
if (q.length === 0) return list;
|
|
167
|
+
return list.filter(
|
|
168
|
+
(r) => r.display_name.toLowerCase().includes(q) || r.id.toLowerCase().includes(q),
|
|
169
|
+
);
|
|
170
|
+
}, [rmsgList, rmsgSearch]);
|
|
171
|
+
|
|
172
|
+
/** The fork-source value to submit, derived from the active mode. */
|
|
173
|
+
function computeForkValue(): string | null {
|
|
174
|
+
if (forkMode === "none") return null;
|
|
175
|
+
if (forkMode === "rotating") return selectedRmsgId;
|
|
176
|
+
const trimmed = manualConvId.trim();
|
|
177
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function handleSubmit(event: React.FormEvent): Promise<void> {
|
|
181
|
+
event.preventDefault();
|
|
182
|
+
setBanner(null);
|
|
183
|
+
setNameError(null);
|
|
184
|
+
setIdError(null);
|
|
185
|
+
setSeedError(null);
|
|
186
|
+
setForkError(null);
|
|
187
|
+
const trimmedName = displayName.trim();
|
|
188
|
+
const trimmedId = lettaAgentId.trim();
|
|
189
|
+
const trimmedSeed = sandboxSeedName.trim();
|
|
190
|
+
if (trimmedName.length === 0) {
|
|
191
|
+
setNameError(props.texts.agentNameRequiredError);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (trimmedId.length === 0) {
|
|
195
|
+
setIdError(props.texts.agentLettaIdRequiredError);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setSubmitting(true);
|
|
199
|
+
try {
|
|
200
|
+
await props.onSubmit({
|
|
201
|
+
displayName: trimmedName,
|
|
202
|
+
lettaAgentId: trimmedId,
|
|
203
|
+
sandboxSeedName: trimmedSeed.length > 0 ? trimmedSeed : null,
|
|
204
|
+
forkSourceConversationId: computeForkValue(),
|
|
205
|
+
});
|
|
206
|
+
} catch (err) {
|
|
207
|
+
// Field-targeted error codes go inline; everything else goes
|
|
208
|
+
// to the generic banner.
|
|
209
|
+
if (err instanceof AIHubRequestError) {
|
|
210
|
+
switch (err.code) {
|
|
211
|
+
case "letta_agent_not_found":
|
|
212
|
+
setIdError(props.texts.agentLettaIdNotFoundError);
|
|
213
|
+
break;
|
|
214
|
+
case "seed_name_invalid":
|
|
215
|
+
setSeedError(props.texts.agentSandboxSeedInvalidError);
|
|
216
|
+
break;
|
|
217
|
+
case "seed_dir_not_found":
|
|
218
|
+
setSeedError(props.texts.agentSandboxSeedNotFoundError);
|
|
219
|
+
break;
|
|
220
|
+
case "fork_source_not_found":
|
|
221
|
+
setForkError(props.texts.agentForkSourceNotFoundError);
|
|
222
|
+
break;
|
|
223
|
+
case "fork_source_agent_mismatch":
|
|
224
|
+
setForkError(props.texts.agentForkSourceAgentMismatchError);
|
|
225
|
+
break;
|
|
226
|
+
case "rotating_message_not_found":
|
|
227
|
+
setForkError(props.texts.agentForkSourceRotatingNotFoundError);
|
|
228
|
+
break;
|
|
229
|
+
case "rotating_message_agent_mismatch":
|
|
230
|
+
setForkError(props.texts.agentForkSourceRotatingMismatchError);
|
|
231
|
+
break;
|
|
232
|
+
default: {
|
|
233
|
+
const message =
|
|
234
|
+
err.message.length > 0
|
|
235
|
+
? err.message
|
|
236
|
+
: props.texts.agentSubmitGenericError;
|
|
237
|
+
setBanner(message);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
const message =
|
|
242
|
+
err instanceof Error && err.message.length > 0
|
|
243
|
+
? err.message
|
|
244
|
+
: props.texts.agentSubmitGenericError;
|
|
245
|
+
setBanner(message);
|
|
246
|
+
}
|
|
247
|
+
setSubmitting(false);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const titleText = isEdit
|
|
252
|
+
? props.texts.editAgentModalTitle.replace(
|
|
253
|
+
"{name}",
|
|
254
|
+
props.initial?.displayName ?? "",
|
|
255
|
+
)
|
|
256
|
+
: props.texts.createAgentModalTitle;
|
|
257
|
+
const submitText = submitting
|
|
258
|
+
? props.texts.agentModalSubmittingButton
|
|
259
|
+
: isEdit
|
|
260
|
+
? props.texts.agentModalSaveButton
|
|
261
|
+
: props.texts.agentModalCreateButton;
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<div
|
|
265
|
+
className="data-club-ai-hub-admin__modal-backdrop"
|
|
266
|
+
role="presentation"
|
|
267
|
+
onMouseDown={(event) => {
|
|
268
|
+
if (event.target === event.currentTarget) props.onCancel();
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
<div
|
|
272
|
+
className="data-club-ai-hub-admin__modal"
|
|
273
|
+
role="dialog"
|
|
274
|
+
aria-modal="true"
|
|
275
|
+
aria-labelledby="agent-editor-title"
|
|
276
|
+
data-testid={`admin-agent-${props.mode}-modal`}
|
|
277
|
+
>
|
|
278
|
+
<h2
|
|
279
|
+
id="agent-editor-title"
|
|
280
|
+
className="data-club-ai-hub-admin__modal-title"
|
|
281
|
+
>
|
|
282
|
+
{titleText}
|
|
283
|
+
</h2>
|
|
284
|
+
<form onSubmit={(event) => void handleSubmit(event)} noValidate>
|
|
285
|
+
<label className="data-club-ai-hub-admin__form-field">
|
|
286
|
+
<span className="data-club-ai-hub-admin__form-label">
|
|
287
|
+
{props.texts.agentNameLabel}
|
|
288
|
+
</span>
|
|
289
|
+
<input
|
|
290
|
+
ref={firstFieldRef}
|
|
291
|
+
type="text"
|
|
292
|
+
className="data-club-ai-hub-admin__form-input"
|
|
293
|
+
data-testid="admin-agent-name-input"
|
|
294
|
+
value={displayName}
|
|
295
|
+
onChange={(event) => setDisplayName(event.target.value)}
|
|
296
|
+
required
|
|
297
|
+
maxLength={255}
|
|
298
|
+
disabled={submitting}
|
|
299
|
+
/>
|
|
300
|
+
<span className="data-club-ai-hub-admin__form-helper">
|
|
301
|
+
{props.texts.agentNameHelper}
|
|
302
|
+
</span>
|
|
303
|
+
{nameError !== null ? (
|
|
304
|
+
<span
|
|
305
|
+
className="data-club-ai-hub-admin__form-error"
|
|
306
|
+
role="alert"
|
|
307
|
+
data-testid="admin-agent-name-error"
|
|
308
|
+
>
|
|
309
|
+
{nameError}
|
|
310
|
+
</span>
|
|
311
|
+
) : null}
|
|
312
|
+
</label>
|
|
313
|
+
<label className="data-club-ai-hub-admin__form-field">
|
|
314
|
+
<span className="data-club-ai-hub-admin__form-label">
|
|
315
|
+
{props.texts.agentLettaIdLabel}
|
|
316
|
+
</span>
|
|
317
|
+
<input
|
|
318
|
+
type="text"
|
|
319
|
+
className="data-club-ai-hub-admin__form-input"
|
|
320
|
+
data-testid="admin-agent-letta-id-input"
|
|
321
|
+
value={lettaAgentId}
|
|
322
|
+
onChange={(event) => setLettaAgentId(event.target.value)}
|
|
323
|
+
required
|
|
324
|
+
maxLength={255}
|
|
325
|
+
disabled={submitting}
|
|
326
|
+
/>
|
|
327
|
+
<span className="data-club-ai-hub-admin__form-helper">
|
|
328
|
+
{isEdit
|
|
329
|
+
? props.texts.agentLettaIdReassignHelper
|
|
330
|
+
: props.texts.agentLettaIdHelper}
|
|
331
|
+
</span>
|
|
332
|
+
{idError !== null ? (
|
|
333
|
+
<span
|
|
334
|
+
className="data-club-ai-hub-admin__form-error"
|
|
335
|
+
role="alert"
|
|
336
|
+
data-testid="admin-agent-letta-id-error"
|
|
337
|
+
>
|
|
338
|
+
{idError}
|
|
339
|
+
</span>
|
|
340
|
+
) : null}
|
|
341
|
+
</label>
|
|
342
|
+
|
|
343
|
+
<hr className="data-club-ai-hub-admin__form-divider" />
|
|
344
|
+
<h3
|
|
345
|
+
className="data-club-ai-hub-admin__form-subheading"
|
|
346
|
+
data-testid="admin-agent-specialized-heading"
|
|
347
|
+
>
|
|
348
|
+
{props.texts.agentSpecializedSectionHeading}
|
|
349
|
+
</h3>
|
|
350
|
+
<p className="data-club-ai-hub-admin__form-section-helper">
|
|
351
|
+
{props.texts.agentSpecializedSectionHelper}
|
|
352
|
+
</p>
|
|
353
|
+
|
|
354
|
+
<label className="data-club-ai-hub-admin__form-field">
|
|
355
|
+
<span className="data-club-ai-hub-admin__form-label">
|
|
356
|
+
{props.texts.agentSandboxSeedLabel}
|
|
357
|
+
</span>
|
|
358
|
+
<input
|
|
359
|
+
type="text"
|
|
360
|
+
className="data-club-ai-hub-admin__form-input"
|
|
361
|
+
data-testid="admin-agent-sandbox-seed-input"
|
|
362
|
+
value={sandboxSeedName}
|
|
363
|
+
onChange={(event) => setSandboxSeedName(event.target.value)}
|
|
364
|
+
maxLength={128}
|
|
365
|
+
disabled={submitting}
|
|
366
|
+
/>
|
|
367
|
+
<span className="data-club-ai-hub-admin__form-helper">
|
|
368
|
+
{props.texts.agentSandboxSeedHelper}
|
|
369
|
+
</span>
|
|
370
|
+
{seedError !== null ? (
|
|
371
|
+
<span
|
|
372
|
+
className="data-club-ai-hub-admin__form-error"
|
|
373
|
+
role="alert"
|
|
374
|
+
data-testid="admin-agent-sandbox-seed-error"
|
|
375
|
+
>
|
|
376
|
+
{seedError}
|
|
377
|
+
</span>
|
|
378
|
+
) : null}
|
|
379
|
+
</label>
|
|
380
|
+
|
|
381
|
+
<div className="data-club-ai-hub-admin__form-field" data-testid="admin-agent-fork-source">
|
|
382
|
+
<span className="data-club-ai-hub-admin__form-label">
|
|
383
|
+
{props.texts.agentForkSourceLabel}
|
|
384
|
+
</span>
|
|
385
|
+
<select
|
|
386
|
+
className="data-club-ai-hub-admin__form-input"
|
|
387
|
+
data-testid="admin-agent-fork-mode"
|
|
388
|
+
value={forkMode}
|
|
389
|
+
onChange={(event) => setForkMode(event.target.value as ForkMode)}
|
|
390
|
+
disabled={submitting}
|
|
391
|
+
>
|
|
392
|
+
<option value="none">{props.texts.agentForkSourceModeNone}</option>
|
|
393
|
+
<option value="rotating">{props.texts.agentForkSourceModeRotating}</option>
|
|
394
|
+
<option value="manual">{props.texts.agentForkSourceModeManual}</option>
|
|
395
|
+
</select>
|
|
396
|
+
|
|
397
|
+
{forkMode === "rotating" ? (
|
|
398
|
+
<div className="data-club-ai-hub-admin__fork-rotating">
|
|
399
|
+
<input
|
|
400
|
+
type="text"
|
|
401
|
+
className="data-club-ai-hub-admin__form-input"
|
|
402
|
+
data-testid="admin-agent-fork-rotating-search"
|
|
403
|
+
placeholder={props.texts.agentForkSourceRotatingSearchPlaceholder}
|
|
404
|
+
value={rmsgSearch}
|
|
405
|
+
onChange={(event) => setRmsgSearch(event.target.value)}
|
|
406
|
+
disabled={submitting}
|
|
407
|
+
/>
|
|
408
|
+
{filteredRmsgs.length === 0 ? (
|
|
409
|
+
<p
|
|
410
|
+
className="data-club-ai-hub-admin__form-helper"
|
|
411
|
+
data-testid="admin-agent-fork-rotating-empty"
|
|
412
|
+
>
|
|
413
|
+
{props.texts.agentForkSourceRotatingEmpty}
|
|
414
|
+
</p>
|
|
415
|
+
) : (
|
|
416
|
+
<ul
|
|
417
|
+
className="data-club-ai-hub-admin__fork-rotating-list"
|
|
418
|
+
data-testid="admin-agent-fork-rotating-list"
|
|
419
|
+
role="listbox"
|
|
420
|
+
>
|
|
421
|
+
{filteredRmsgs.map((r) => (
|
|
422
|
+
<li key={r.id}>
|
|
423
|
+
<button
|
|
424
|
+
type="button"
|
|
425
|
+
role="option"
|
|
426
|
+
aria-selected={selectedRmsgId === r.id}
|
|
427
|
+
className={
|
|
428
|
+
selectedRmsgId === r.id
|
|
429
|
+
? "data-club-ai-hub-admin__fork-rotating-item data-club-ai-hub-admin__fork-rotating-item--selected"
|
|
430
|
+
: "data-club-ai-hub-admin__fork-rotating-item"
|
|
431
|
+
}
|
|
432
|
+
data-testid={`admin-agent-fork-rotating-option-${r.id}`}
|
|
433
|
+
onClick={() => setSelectedRmsgId(r.id)}
|
|
434
|
+
disabled={submitting}
|
|
435
|
+
>
|
|
436
|
+
<span>{r.display_name}</span>
|
|
437
|
+
<code className="data-club-ai-hub-admin__mono">{r.id}</code>
|
|
438
|
+
</button>
|
|
439
|
+
</li>
|
|
440
|
+
))}
|
|
441
|
+
</ul>
|
|
442
|
+
)}
|
|
443
|
+
</div>
|
|
444
|
+
) : null}
|
|
445
|
+
|
|
446
|
+
{forkMode === "manual" ? (
|
|
447
|
+
<input
|
|
448
|
+
type="text"
|
|
449
|
+
className="data-club-ai-hub-admin__form-input"
|
|
450
|
+
data-testid="admin-agent-fork-source-input"
|
|
451
|
+
placeholder="conv-…"
|
|
452
|
+
value={manualConvId}
|
|
453
|
+
onChange={(event) => setManualConvId(event.target.value)}
|
|
454
|
+
maxLength={255}
|
|
455
|
+
disabled={submitting}
|
|
456
|
+
/>
|
|
457
|
+
) : null}
|
|
458
|
+
|
|
459
|
+
<span className="data-club-ai-hub-admin__form-helper">
|
|
460
|
+
{props.texts.agentForkSourceHelper}
|
|
461
|
+
</span>
|
|
462
|
+
{forkError !== null ? (
|
|
463
|
+
<span
|
|
464
|
+
className="data-club-ai-hub-admin__form-error"
|
|
465
|
+
role="alert"
|
|
466
|
+
data-testid="admin-agent-fork-source-error"
|
|
467
|
+
>
|
|
468
|
+
{forkError}
|
|
469
|
+
</span>
|
|
470
|
+
) : null}
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
{banner !== null ? (
|
|
474
|
+
<div
|
|
475
|
+
className="data-club-ai-hub-admin__error"
|
|
476
|
+
role="alert"
|
|
477
|
+
data-testid="admin-agent-modal-banner"
|
|
478
|
+
>
|
|
479
|
+
{banner}
|
|
480
|
+
</div>
|
|
481
|
+
) : null}
|
|
482
|
+
<div className="data-club-ai-hub-admin__modal-actions">
|
|
483
|
+
<button
|
|
484
|
+
type="button"
|
|
485
|
+
className="data-club-ai-hub-admin__button"
|
|
486
|
+
data-testid="admin-agent-modal-cancel"
|
|
487
|
+
onClick={props.onCancel}
|
|
488
|
+
disabled={submitting}
|
|
489
|
+
>
|
|
490
|
+
{props.texts.agentModalCancelButton}
|
|
491
|
+
</button>
|
|
492
|
+
<button
|
|
493
|
+
type="submit"
|
|
494
|
+
className="data-club-ai-hub-admin__button data-club-ai-hub-admin__button--primary"
|
|
495
|
+
data-testid="admin-agent-modal-submit"
|
|
496
|
+
disabled={submitting}
|
|
497
|
+
>
|
|
498
|
+
{submitText}
|
|
499
|
+
</button>
|
|
500
|
+
</div>
|
|
501
|
+
</form>
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
);
|
|
505
|
+
}
|