@datalayer/agent-runtimes 1.3.88 → 1.3.90
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/lib/Agent.js +2 -18
- package/lib/AgentDocument.js +5 -55
- package/lib/AgentNode.js +31 -208
- package/lib/AgentNotebook.js +5 -59
- package/lib/agent-node/AgentNodeGallery.js +23 -111
- package/lib/agents/AgentDetails.js +36 -274
- package/lib/agents/AgentRuntimeChat.js +1 -8
- package/lib/chat/Chat.js +7 -46
- package/lib/chat/ChatFloating.js +15 -100
- package/lib/chat/ChatInline.js +5 -47
- package/lib/chat/ChatPopupStandalone.js +5 -53
- package/lib/chat/ChatSidebar.js +4 -51
- package/lib/chat/ChatStandalone.js +4 -45
- package/lib/chat/EphemeralSurfaceControl.js +5 -25
- package/lib/chat/assistant/AssistantContextMenu.d.ts +8 -0
- package/lib/chat/assistant/AssistantContextMenu.js +17 -1
- package/lib/chat/assistant/AssistantStage.js +6 -25
- package/lib/chat/assistant/BalloonParts.js +8 -40
- package/lib/chat/assistant/BalloonVisual.js +2 -2
- package/lib/chat/assistant/ConversationBalloon.js +2 -11
- package/lib/chat/assistant/DecisionAsk.js +3 -3
- package/lib/chat/assistant/SandboxDetailsDialog.js +3 -17
- package/lib/chat/assistant/SpeechBalloon.js +14 -78
- package/lib/chat/base/ChatBase.js +37 -172
- package/lib/chat/display/EmptyState.js +7 -35
- package/lib/chat/display/FloatingBrandButton.js +4 -34
- package/lib/chat/display/PoweredByTag.js +3 -14
- package/lib/chat/document/EphemeralDocument.js +3 -18
- package/lib/chat/header/ChatHeader.js +1 -17
- package/lib/chat/header/ChatHeaderBase.js +2 -24
- package/lib/chat/header/ChatViewModeToggle.js +7 -29
- package/lib/chat/indicators/McpStatusIndicator.js +3 -12
- package/lib/chat/indicators/SandboxStatusIndicator.js +6 -34
- package/lib/chat/indicators/SkillsStatusIndicator.js +3 -12
- package/lib/chat/indicators/TypingDots.js +1 -11
- package/lib/chat/messages/ChatMessageList.js +58 -185
- package/lib/chat/messages/ChatMessages.js +15 -79
- package/lib/chat/messages/FormSubmissionMessage.js +2 -33
- package/lib/chat/messages/NotebookToolSurfaces.js +12 -41
- package/lib/chat/messages/TurnFooter.js +4 -10
- package/lib/chat/notebook/EphemeralNotebook.js +2 -10
- package/lib/chat/parts/ReasoningPart.js +2 -16
- package/lib/chat/parts/TextPart.js +2 -12
- package/lib/chat/parts/ToolPart.js +16 -90
- package/lib/chat/presence/Presence.js +5 -33
- package/lib/chat/prompt/FloatingCard.js +1 -13
- package/lib/chat/prompt/InputPrompt.js +1 -6
- package/lib/chat/prompt/InputPromptBase.js +4 -17
- package/lib/chat/prompt/InputPromptLexical.js +44 -45
- package/lib/chat/prompt/InputPromptText.js +1 -1
- package/lib/chat/prompt/footer/InPromptFooter.js +1 -8
- package/lib/chat/prompt/menus/AgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/InlineAgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/ModelSelector.js +1 -5
- package/lib/chat/prompt/menus/SkillsMenu.js +3 -30
- package/lib/chat/prompt/menus/SuggestionsMenu.js +1 -1
- package/lib/chat/prompt/menus/ToolsMenu.js +4 -48
- package/lib/chat/prompt/plugins/AgentMentionPlugin.js +2 -9
- package/lib/chat/prompt/plugins/CommandPlugin.js +2 -9
- package/lib/chat/prompt/plugins/MentionChip.js +1 -15
- package/lib/chat/prompt/stack.js +1 -19
- package/lib/chat/tools/A2AAgentDialog.js +9 -42
- package/lib/chat/tools/SubagentActivity.js +5 -22
- package/lib/chat/tools/ToolApprovalBanner.js +4 -34
- package/lib/chat/tools/ToolApprovalDialog.js +4 -19
- package/lib/chat/tools/ToolCallDisplay.js +12 -97
- package/lib/chat/usage/ContextPie.js +4 -45
- package/lib/components/a2ui/datalayer/Chart.js +4 -10
- package/lib/components/a2ui/datalayer/Chat.js +2 -10
- package/lib/components/a2ui/datalayer/Download.js +1 -1
- package/lib/components/a2ui/datalayer/Evidence.js +1 -15
- package/lib/components/a2ui/datalayer/FileUpload.js +1 -12
- package/lib/components/a2ui/datalayer/Table.js +9 -17
- package/lib/components/a2ui/datalayer/formWidgets.js +3 -2
- package/lib/components/a2ui/datalayer/parts.js +1 -16
- package/lib/components/agents/AgentSummary.js +1 -51
- package/lib/components/cards/NotificationEventCard.js +6 -72
- package/lib/components/cards/OutputCard.js +4 -48
- package/lib/components/cards/ToolApprovalCard.js +2 -35
- package/lib/components/code-sandboxes/CodeSandboxCellVariables.js +1 -1
- package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +4 -14
- package/lib/components/code-sandboxes/CodeSandboxPicker.js +16 -21
- package/lib/components/code-sandboxes/CodeSandboxVariables.js +2 -2
- package/lib/components/scheduler/ScheduleMenu.js +5 -10
- package/lib/components/specs/SpecPayloadPreview.js +1 -26
- package/lib/components/teams/A2ATeamGraph.d.ts +4 -3
- package/lib/components/teams/A2ATeamGraph.js +25 -71
- package/lib/components/teams/AnswerSurfacesView.js +2 -2
- package/lib/components/teams/NotebookPreview.js +1 -10
- package/lib/components/teams/NotebookPreviewView.js +2 -3
- package/lib/components/teams/SceneTranscript.js +3 -17
- package/lib/components/teams/SceneView.js +1 -8
- package/lib/components/teams/TeamNotebook.js +5 -13
- package/lib/components/teams/TeamNotebookView.js +2 -12
- package/lib/components/teams/index.d.ts +1 -0
- package/lib/components/teams/index.js +1 -0
- package/lib/components/teams/useBalloonRoom.d.ts +39 -0
- package/lib/components/teams/useBalloonRoom.js +89 -0
- package/lib/config/AgentConfiguration.js +22 -225
- package/lib/context/ContextDistribution.js +7 -41
- package/lib/context/ContextInspector.js +9 -107
- package/lib/context/ContextPanel.js +11 -86
- package/lib/context/ContextUsage.js +6 -34
- package/lib/context/CostTracker.js +7 -42
- package/lib/context/MessageHistory.js +3 -37
- package/lib/context/TurnGraphChart.js +9 -41
- package/lib/examples/A2UiAgentExample.js +6 -108
- package/lib/examples/A2UiComponentsGalleryExample.js +1 -1
- package/lib/examples/A2UiContactCardExample.js +1 -1
- package/lib/examples/A2UiJupyterOutputExample.js +25 -125
- package/lib/examples/A2UiRestaurantExample.js +1 -1
- package/lib/examples/A2UiViewerExample.js +1 -1
- package/lib/examples/AgUiAgenticExample.js +3 -35
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -25
- package/lib/examples/AgUiHaikuGenUiExample.js +2 -32
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -59
- package/lib/examples/AgUiSharedStateExample.js +6 -56
- package/lib/examples/AgUiToolsBasedGenUiExample.js +25 -120
- package/lib/examples/AgentA2AExample.js +1 -15
- package/lib/examples/AgentA2ATeamExample.js +6 -30
- package/lib/examples/AgentCheckpointsExample.js +11 -145
- package/lib/examples/AgentCodeSandboxExample.js +5 -108
- package/lib/examples/AgentCodeSandboxesExample.js +3 -30
- package/lib/examples/AgentCodemodeExample.js +9 -85
- package/lib/examples/AgentCompactionExample.js +3 -64
- package/lib/examples/AgentDecideExample.js +1 -13
- package/lib/examples/AgentEvalsExample.js +5 -60
- package/lib/examples/AgentGuardrailsExample.js +4 -28
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +5 -96
- package/lib/examples/AgentMCPExample.js +7 -105
- package/lib/examples/AgentMemoryExample.js +5 -74
- package/lib/examples/AgentMonitoringExample.js +7 -53
- package/lib/examples/AgentNotificationsExample.js +3 -61
- package/lib/examples/AgentOtelExample.js +3 -72
- package/lib/examples/AgentOutputsExample.js +6 -81
- package/lib/examples/AgentParametersExample.js +2 -37
- package/lib/examples/AgentSkillsExample.js +3 -45
- package/lib/examples/AgentSubagentsExample.js +6 -56
- package/lib/examples/AgentToolApprovalsExample.js +1 -11
- package/lib/examples/AgentTriggersExample.js +29 -239
- package/lib/examples/AgentspecsExample.js +6 -60
- package/lib/examples/AssistantExample.js +5 -5
- package/lib/examples/AssistantGalleryExample.js +8 -65
- package/lib/examples/CellExample.js +1 -6
- package/lib/examples/ChatCustomExample.js +2 -31
- package/lib/examples/ChatExample.js +1 -9
- package/lib/examples/ChatStandaloneExample.js +3 -37
- package/lib/examples/CopilotKitLexicalExample.js +1 -24
- package/lib/examples/DecksAgent.js +1 -1
- package/lib/examples/DocumentPageAgent.js +1 -1
- package/lib/examples/HomeExample.js +14 -62
- package/lib/examples/Lexical2Example.js +3 -32
- package/lib/examples/LexicalAgentExample.js +2 -34
- package/lib/examples/LexicalAgentSidebarExample.js +3 -34
- package/lib/examples/LoopAppComputerExample.js +1 -1
- package/lib/examples/LoopShellExample.js +2 -2
- package/lib/examples/LoopStrategyExample.js +15 -87
- package/lib/examples/LoopWorkspaceEmbed.js +2 -18
- package/lib/examples/LoopWorkspaceExample.js +2 -2
- package/lib/examples/NotebookAgentExample.js +2 -33
- package/lib/examples/NotebookAgentSidebarExample.js +3 -46
- package/lib/examples/NotebookCollaborationExample.js +1 -31
- package/lib/examples/NotebookExample.js +1 -18
- package/lib/examples/NotebookPageAgent.js +1 -1
- package/lib/examples/ScenesExample.js +5 -24
- package/lib/examples/VoiceChatExample.js +1 -1
- package/lib/examples/components/AuthRequiredView.js +1 -7
- package/lib/examples/components/ErrorView.js +1 -8
- package/lib/examples/components/ExampleErrorBoundary.js +1 -14
- package/lib/examples/components/FooterMetrics.js +1 -7
- package/lib/examples/components/Header.js +12 -51
- package/lib/examples/components/HeaderControls.js +1 -9
- package/lib/examples/components/LexicalEditor.js +1 -8
- package/lib/examples/components/MainContent.js +1 -13
- package/lib/examples/components/MockFileBrowser.js +4 -40
- package/lib/examples/components/SessionTabs.js +1 -1
- package/lib/examples/components/TimeTravel.js +1 -13
- package/lib/examples/main.js +13 -81
- package/lib/examples/scenes/A2UiComponentsGalleryScene.js +3 -34
- package/lib/examples/scenes/A2UiContactCardScene.js +3 -35
- package/lib/examples/scenes/A2UiRestaurantScene.js +3 -53
- package/lib/examples/scenes/A2UiViewerScene.js +3 -34
- package/lib/examples/utils/AssistantGalleryGrid.js +6 -35
- package/lib/examples2/DatalayerNotebookExample.js +3 -33
- package/lib/examples2/NativeNavigationExample.js +4 -10
- package/lib/examples2/NotebookMutationsKernel.js +2 -1
- package/lib/examples2/NotebookMutationsServiceManager.js +2 -1
- package/lib/examples2/ReactRouterExample.js +14 -42
- package/lib/hooks/useToolApprovals.d.ts +2 -34
- package/lib/hooks/useToolApprovals.js +1 -64
- package/lib/identity/AgentIdentity.js +17 -62
- package/lib/identity/IdentityConnect.js +13 -59
- package/lib/identity/OAuthCallback.js +6 -44
- package/lib/lexical/ChatInlinePlugin.js +6 -14
- package/lib/loop/apps/AppRenderer.d.ts +4 -3
- package/lib/loop/apps/AppRenderer.js +11 -12
- package/lib/loop/apps/appspec.js +6 -3
- package/lib/loop/embed/AppEmbed.d.ts +1 -1
- package/lib/loop/embed/AppEmbed.js +2 -1
- package/lib/loop/embed/LoopEmbed.js +1 -7
- package/lib/loop/embed/embedConfig.d.ts +3 -3
- package/lib/loop/embed/embedConfig.js +2 -3
- package/lib/loop/embed/embedTheme.d.ts +4 -4
- package/lib/loop/embed/embedTheme.js +11 -7
- package/lib/loop/plugins/a2a-sidebar/A2ASidebar.js +7 -34
- package/lib/loop/plugins/a2ui/A2uiView.js +4 -12
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +1 -16
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +2 -12
- package/lib/loop/plugins/agents/AnonymousKeyBadge.js +3 -2
- package/lib/loop/plugins/agents/SandboxSelector.js +3 -7
- package/lib/loop/plugins/agents/SandboxView.js +4 -27
- package/lib/loop/plugins/agents/TeamMemberPicker.js +2 -2
- package/lib/loop/plugins/agentspecs/AgentspecPicker.js +3 -2
- package/lib/loop/plugins/app-activity/AppActivity.js +1 -1
- package/lib/loop/plugins/app-computer/AppComputer.js +5 -21
- package/lib/loop/plugins/app-elements/AppElements.js +2 -31
- package/lib/loop/plugins/app-page/AppPage.js +1 -1
- package/lib/loop/plugins/app-rules/AppRulesCard.js +4 -20
- package/lib/loop/plugins/assistant/index.js +1 -13
- package/lib/loop/plugins/chat/ChatView.js +40 -106
- package/lib/loop/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -13
- package/lib/loop/plugins/decks/DeckSurface.js +2 -2
- package/lib/loop/plugins/document/DocumentView.js +4 -12
- package/lib/loop/plugins/document-toolbar/SandboxStatusItem.js +3 -8
- package/lib/loop/plugins/graph/GraphView.js +2 -2
- package/lib/loop/plugins/input-prompt/ComposerView.js +1 -1
- package/lib/loop/plugins/notebook/NotebookView.js +3 -11
- package/lib/loop/plugins/page-layout/SplitLayout.js +11 -34
- package/lib/loop/plugins/page-layout/TurnPanel.js +9 -35
- package/lib/loop/plugins/shell/useEditorPreviews.js +3 -2
- package/lib/loop/plugins/subagent-activity/SubagentPulse.js +1 -13
- package/lib/loop/plugins/window-frame/WindowFrame.js +10 -44
- package/lib/loop/plugins/window-frame/index.js +1 -1
- package/lib/loop/shell/LoopWorkspace.js +34 -77
- package/lib/loop/shell/PluginToggles.js +4 -15
- package/lib/loop/shell/SidebarRail.js +8 -40
- package/lib/loop/shell/ViewSwitcher.js +4 -24
- package/lib/loop-main.js +2 -3
- package/lib/mcp/McpServerManager.js +6 -37
- package/lib/portable/index.d.ts +11 -0
- package/lib/portable/index.js +20 -0
- package/lib/protocols/AGUIAdapter.js +2 -2
- package/lib/protocols/BaseProtocolAdapter.d.ts +2 -0
- package/lib/protocols/BaseProtocolAdapter.js +4 -0
- package/lib/specs/apps.js +6 -0
- package/lib/specs/appspecSchema.js +11 -4
- package/lib/stories/loop/ReferenceScreens.js +17 -91
- package/lib/stories/loop/pictures-main.js +1 -1
- package/lib/types/agentspecs.d.ts +5 -2
- package/lib/types/protocol.d.ts +2 -0
- package/lib/utils/approvals.d.ts +59 -0
- package/lib/utils/approvals.js +101 -0
- package/lib/voice/VoiceInput.js +3 -39
- package/package.json +2 -2
- package/scripts/codegen/generate_envvars.py +0 -1
- package/lib/shims/primerAddonsBox.d.ts +0 -1
- package/lib/shims/primerAddonsBox.js +0 -7
package/lib/Agent.js
CHANGED
|
@@ -93,27 +93,11 @@ export const Agent = () => {
|
|
|
93
93
|
}, [agentId]);
|
|
94
94
|
// Loading state while verifying agent
|
|
95
95
|
if (!isReady && !error) {
|
|
96
|
-
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
97
|
-
display: 'flex',
|
|
98
|
-
flexDirection: 'column',
|
|
99
|
-
alignItems: 'center',
|
|
100
|
-
justifyContent: 'center',
|
|
101
|
-
height: '100vh',
|
|
102
|
-
gap: 3,
|
|
103
|
-
bg: 'canvas.default',
|
|
104
|
-
}, children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "..."] })] }) }));
|
|
96
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "..."] })] }) }));
|
|
105
97
|
}
|
|
106
98
|
// Error state
|
|
107
99
|
if (error) {
|
|
108
|
-
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
109
|
-
display: 'flex',
|
|
110
|
-
flexDirection: 'column',
|
|
111
|
-
alignItems: 'center',
|
|
112
|
-
justifyContent: 'center',
|
|
113
|
-
height: '100vh',
|
|
114
|
-
gap: 3,
|
|
115
|
-
bg: 'canvas.default',
|
|
116
|
-
}, children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect to agent" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
100
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect to agent" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
117
101
|
}
|
|
118
102
|
// Agent is ready — render the Chat component
|
|
119
103
|
return (_jsx(DatalayerThemeProvider, { children: _jsx(Chat, { protocol: "ag-ui", baseUrl: BASE_URL, agentId: agentId, title: "Agent", placeholder: "Send a message...", description: "Chat with the agent", showHeader: true, height: '100vh', showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, runtimeId: agentId, historyEndpoint: `${BASE_URL}/api/v1/history`, suggestions: [
|
package/lib/AgentDocument.js
CHANGED
|
@@ -207,26 +207,13 @@ const LexicalPanel = React.memo(function LexicalPanel({ serviceManager, kernelId
|
|
|
207
207
|
}, []);
|
|
208
208
|
const agentId = getAgentId();
|
|
209
209
|
const agUiEndpoint = `${BASE_URL}/api/v1/ag-ui/${encodeURIComponent(agentId)}/`;
|
|
210
|
-
return (_jsx(Box, {
|
|
211
|
-
flex: 1,
|
|
212
|
-
display: 'flex',
|
|
213
|
-
flexDirection: 'column',
|
|
214
|
-
overflow: 'auto',
|
|
215
|
-
borderRight: '1px solid',
|
|
216
|
-
borderColor: 'border.default',
|
|
217
|
-
}, children: _jsx(Box, { sx: { padding: 3 }, children: _jsxs(LexicalConfigProvider, { lexicalId: DOCUMENT_ID, serviceManager: serviceManager, children: [_jsx(LexicalToolsPlugin, { onToolsReady: onToolsReady }), _jsx(LexicalExtensionComposer, { extension: editorExtension, contentEditable: null, children: _jsxs("div", { className: "lexical-editor-inner", ref: onRef, children: [_jsx(LexicalStatePlugin, {}), _jsx(ContentEditable, { className: "lexical-editor-content", "aria-label": "Lexical Editor" }), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(LoadContentPlugin, {}), _jsx(TableCellResizerPlugin, {}), _jsx(JupyterReactTheme, { colormode: colormode, backgroundColor: backgroundColor, children: _jsx(KernelPluginsInner, { serviceManager: serviceManager, kernelId: kernelId, onKernelReady: onKernelReady }) }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem, setIsLinkEditMode: setIsLinkEditMode, extraItems: toolbarItems }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] })), _jsx(ChatInlinePlugin, { protocol: {
|
|
210
|
+
return (_jsx(Box, { flex: 1, display: "flex", flexDirection: "column", overflow: "auto", borderRight: "1px solid", borderColor: "border.default", children: _jsx(Box, { padding: 3, children: _jsxs(LexicalConfigProvider, { lexicalId: DOCUMENT_ID, serviceManager: serviceManager, children: [_jsx(LexicalToolsPlugin, { onToolsReady: onToolsReady }), _jsx(LexicalExtensionComposer, { extension: editorExtension, contentEditable: null, children: _jsxs("div", { className: "lexical-editor-inner", ref: onRef, children: [_jsx(LexicalStatePlugin, {}), _jsx(ContentEditable, { className: "lexical-editor-content", "aria-label": "Lexical Editor" }), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(LoadContentPlugin, {}), _jsx(TableCellResizerPlugin, {}), _jsx(JupyterReactTheme, { colormode: colormode, backgroundColor: backgroundColor, children: _jsx(KernelPluginsInner, { serviceManager: serviceManager, kernelId: kernelId, onKernelReady: onKernelReady }) }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem, setIsLinkEditMode: setIsLinkEditMode, extraItems: toolbarItems }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] })), _jsx(ChatInlinePlugin, { protocol: {
|
|
218
211
|
type: 'ag-ui',
|
|
219
212
|
endpoint: agUiEndpoint,
|
|
220
213
|
}, isOpen: isAiOpen, onClose: closeAi, pendingPrompt: pendingPrompt, onPendingPromptConsumed: clearPendingPrompt })] }) })] }) }) }));
|
|
221
214
|
});
|
|
222
215
|
const ChatPanel = ({ agentId, tools, kernel }) => {
|
|
223
|
-
return (_jsx(Box, {
|
|
224
|
-
width: '420px',
|
|
225
|
-
minWidth: '320px',
|
|
226
|
-
display: 'flex',
|
|
227
|
-
flexDirection: 'column',
|
|
228
|
-
overflow: 'hidden',
|
|
229
|
-
}, children: _jsx(Chat, { protocol: "ag-ui", baseUrl: BASE_URL, agentId: agentId, title: "Agent Document", placeholder: "Ask about the document...", description: "Chat with the agent to manipulate the document", showHeader: true, height: "100%", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, disableInternalJupyterTheme: true, frontendTools: tools, autoFocus: true, runtimeId: agentId, kernel: kernel, historyEndpoint: `${BASE_URL}/api/v1/history`, suggestions: [
|
|
216
|
+
return (_jsx(Box, { width: "420px", minWidth: "320px", display: "flex", flexDirection: "column", overflow: "hidden", children: _jsx(Chat, { protocol: "ag-ui", baseUrl: BASE_URL, agentId: agentId, title: "Agent Document", placeholder: "Ask about the document...", description: "Chat with the agent to manipulate the document", showHeader: true, height: "100%", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, disableInternalJupyterTheme: true, frontendTools: tools, autoFocus: true, runtimeId: agentId, kernel: kernel, historyEndpoint: `${BASE_URL}/api/v1/history`, suggestions: [
|
|
230
217
|
{
|
|
231
218
|
title: 'Insert heading',
|
|
232
219
|
message: 'Insert a heading that says "Welcome"',
|
|
@@ -347,50 +334,13 @@ export const AgentDocument = () => {
|
|
|
347
334
|
}, [kernelId]);
|
|
348
335
|
// Loading
|
|
349
336
|
if (!isReady && !error) {
|
|
350
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { sx: {
|
|
351
|
-
display: 'flex',
|
|
352
|
-
flexDirection: 'column',
|
|
353
|
-
alignItems: 'center',
|
|
354
|
-
justifyContent: 'center',
|
|
355
|
-
height: '100vh',
|
|
356
|
-
gap: 3,
|
|
357
|
-
bg: 'canvas.default',
|
|
358
|
-
}, children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "\u2026"] })] }) }));
|
|
337
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "\u2026"] })] }) }));
|
|
359
338
|
}
|
|
360
339
|
// Error
|
|
361
340
|
if (error) {
|
|
362
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { sx: {
|
|
363
|
-
display: 'flex',
|
|
364
|
-
flexDirection: 'column',
|
|
365
|
-
alignItems: 'center',
|
|
366
|
-
justifyContent: 'center',
|
|
367
|
-
height: '100vh',
|
|
368
|
-
gap: 3,
|
|
369
|
-
bg: 'canvas.default',
|
|
370
|
-
}, children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
341
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
371
342
|
}
|
|
372
343
|
// Ready — lexical editor + chat side-by-side
|
|
373
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, {
|
|
374
|
-
display: 'flex',
|
|
375
|
-
flexDirection: 'column',
|
|
376
|
-
height: '100vh',
|
|
377
|
-
width: '100vw',
|
|
378
|
-
overflow: 'hidden',
|
|
379
|
-
bg: 'canvas.default',
|
|
380
|
-
}, children: [_jsx(Box, { sx: {
|
|
381
|
-
display: 'flex',
|
|
382
|
-
justifyContent: 'flex-end',
|
|
383
|
-
alignItems: 'center',
|
|
384
|
-
px: 3,
|
|
385
|
-
py: 2,
|
|
386
|
-
borderBottom: '1px solid',
|
|
387
|
-
borderColor: 'border.default',
|
|
388
|
-
flexShrink: 0,
|
|
389
|
-
}, children: _jsx(AppearanceControlsWithStore, { useStore: useAgentDocumentThemeStore }) }), _jsxs(Box, { sx: {
|
|
390
|
-
display: 'flex',
|
|
391
|
-
flex: 1,
|
|
392
|
-
minHeight: 0,
|
|
393
|
-
overflow: 'hidden',
|
|
394
|
-
}, children: [serviceManager && kernelResolved && (_jsx(LexicalPanel, { serviceManager: serviceManager, kernelId: kernelId, colormode: resolvedMode, backgroundColor: themeBackground, onToolsReady: handleToolsReady, onKernelReady: handleKernelReady })), _jsx(ChatPanel, { agentId: agentId, tools: tools, kernel: documentKernel })] })] }) }));
|
|
344
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", height: "100vh", width: "100vw", overflow: "hidden", bg: "canvas.default", children: [_jsx(Box, { display: "flex", justifyContent: "flex-end", alignItems: "center", px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: _jsx(AppearanceControlsWithStore, { useStore: useAgentDocumentThemeStore }) }), _jsxs(Box, { display: "flex", flex: 1, minHeight: 0, overflow: "hidden", children: [serviceManager && kernelResolved && (_jsx(LexicalPanel, { serviceManager: serviceManager, kernelId: kernelId, colormode: resolvedMode, backgroundColor: themeBackground, onToolsReady: handleToolsReady, onKernelReady: handleKernelReady })), _jsx(ChatPanel, { agentId: agentId, tools: tools, kernel: documentKernel })] })] }) }));
|
|
395
345
|
};
|
|
396
346
|
export default AgentDocument;
|
package/lib/AgentNode.js
CHANGED
|
@@ -6,9 +6,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
7
7
|
import { useQueryClient } from '@tanstack/react-query';
|
|
8
8
|
import { AiAgentIcon, AlienIcon } from '@datalayer/icons-react';
|
|
9
|
-
import { DatalayerLogoText, DatalayerThemeProvider, getColorPalette, getLogoColors, setupPrimerPortals, themeConfigs, } from '@datalayer/primer-addons';
|
|
9
|
+
import { Box, DatalayerLogoText, DatalayerThemeProvider, getColorPalette, getLogoColors, setupPrimerPortals, themeConfigs, } from '@datalayer/primer-addons';
|
|
10
10
|
import { AppearanceMenu } from '@datalayer/primer-addons/lib/components/appearance';
|
|
11
|
-
import { ActionList, ActionMenu,
|
|
11
|
+
import { ActionList, ActionMenu, Button, Heading, Label, PageHeader, PageLayout, Spinner, Text, } from '@primer/react';
|
|
12
12
|
import { CommentIcon, HomeIcon, KeyAsteriskIcon, LockIcon, MoonIcon, PeopleIcon, PersonIcon, GearIcon, SignOutIcon, } from '@primer/octicons-react';
|
|
13
13
|
import { SignInSimple } from '@datalayer/core/lib/views/iam';
|
|
14
14
|
import { UserAvatar } from '@datalayer/core/lib/components/avatars';
|
|
@@ -203,50 +203,13 @@ function AgentNodeProfileView({ token, onTokenExpired, avatarFallbackBackground,
|
|
|
203
203
|
roles: Array.isArray(u.roles) ? u.roles : [],
|
|
204
204
|
};
|
|
205
205
|
}, [user]);
|
|
206
|
-
return (_jsx(Box, { sx: {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
display: 'flex',
|
|
212
|
-
flexDirection: 'column',
|
|
213
|
-
gap: 3,
|
|
214
|
-
}, children: !token ? (_jsx(Text, { sx: { color: 'fg.muted' }, children: "Sign in to view your profile." })) : !display ? (_jsx(Text, { sx: { color: 'fg.muted' }, children: "Loading profile\u2026" })) : (_jsxs(_Fragment, { children: [_jsx(Heading, { sx: { fontSize: 2, mb: 2 }, children: "Profile" }), _jsxs(Box, { sx: {
|
|
215
|
-
display: 'grid',
|
|
216
|
-
gridTemplateColumns: [
|
|
217
|
-
'1fr',
|
|
218
|
-
null,
|
|
219
|
-
'minmax(280px, 1fr) minmax(320px, 2fr)',
|
|
220
|
-
],
|
|
221
|
-
gap: 4,
|
|
222
|
-
alignItems: 'start',
|
|
223
|
-
}, children: [_jsxs(Box, { sx: {
|
|
224
|
-
border: '1px solid',
|
|
225
|
-
borderColor: 'border.default',
|
|
226
|
-
borderRadius: 2,
|
|
227
|
-
p: 3,
|
|
228
|
-
display: 'flex',
|
|
229
|
-
flexDirection: 'column',
|
|
230
|
-
gap: 3,
|
|
231
|
-
}, children: [_jsx(Box, { sx: { textAlign: 'left' }, children: _jsx(UserBadge, { token: token, variant: "small", onTokenExpired: onTokenExpired }) }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 3 }, children: [hasRealAvatar(display.avatarUrl) ? (_jsx(UserAvatar, { avatarUrl: display.avatarUrl, size: 72, square: false })) : (_jsx(Box, { sx: {
|
|
232
|
-
width: 72,
|
|
233
|
-
height: 72,
|
|
234
|
-
borderRadius: '50%',
|
|
235
|
-
bg: avatarFallbackBackground || 'accent.subtle',
|
|
236
|
-
display: 'flex',
|
|
237
|
-
alignItems: 'center',
|
|
238
|
-
justifyContent: 'center',
|
|
206
|
+
return (_jsx(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 4, display: "flex", flexDirection: "column", gap: 3, children: !token ? (_jsx(Text, { sx: { color: 'fg.muted' }, children: "Sign in to view your profile." })) : !display ? (_jsx(Text, { sx: { color: 'fg.muted' }, children: "Loading profile\u2026" })) : (_jsxs(_Fragment, { children: [_jsx(Heading, { sx: { fontSize: 2, mb: 2 }, children: "Profile" }), _jsxs(Box, { display: "grid", gridTemplateColumns: [
|
|
207
|
+
'1fr',
|
|
208
|
+
null,
|
|
209
|
+
'minmax(280px, 1fr) minmax(320px, 2fr)',
|
|
210
|
+
], gap: 4, alignItems: "start", children: [_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, display: "flex", flexDirection: "column", gap: 3, children: [_jsx(Box, { textAlign: "left", children: _jsx(UserBadge, { token: token, variant: "small", onTokenExpired: onTokenExpired }) }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 3, children: [hasRealAvatar(display.avatarUrl) ? (_jsx(UserAvatar, { avatarUrl: display.avatarUrl, size: 72, square: false })) : (_jsx(Box, { width: 72, height: 72, borderRadius: "50%", bg: avatarFallbackBackground || 'accent.subtle', display: "flex", alignItems: "center", justifyContent: "center", sx: {
|
|
239
211
|
'--datalayer-icon-fg': avatarFallbackForeground || 'accent.fg',
|
|
240
|
-
}, children: _jsx(AlienIcon, { size: 34, themed: true, colormode: true }) })), _jsxs(Box, {
|
|
241
|
-
border: '1px solid',
|
|
242
|
-
borderColor: 'border.default',
|
|
243
|
-
borderRadius: 2,
|
|
244
|
-
p: 3,
|
|
245
|
-
display: 'grid',
|
|
246
|
-
gridTemplateColumns: '1fr 2fr',
|
|
247
|
-
rowGap: 2,
|
|
248
|
-
columnGap: 3,
|
|
249
|
-
}, children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: "Username" }), _jsx(Text, { children: display.username || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Display name" }), _jsx(Text, { children: display.displayName || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Email" }), _jsx(Text, { children: display.email || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Initials" }), _jsx(Text, { children: display.initials || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Origin" }), _jsx(Text, { children: display.origin || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Roles" }), _jsx(Box, { sx: { display: 'flex', gap: 1, flexWrap: 'wrap' }, children: display.roles.length > 0 ? (display.roles.map(role => (_jsx(Label, { size: "small", variant: "secondary", children: role }, role)))) : (_jsx(Text, { children: "-" })) })] })] })] })) }));
|
|
212
|
+
}, children: _jsx(AlienIcon, { size: 34, themed: true, colormode: true }) })), _jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Heading, { sx: { fontSize: 3, mb: 1 }, children: display.headingDisplayName }), display.handle && (_jsx(Text, { sx: { color: 'fg.muted' }, children: display.handle }))] })] }), display.id && (_jsx(Box, { children: _jsx(Label, { size: "large", variant: "secondary", children: display.id }) }))] }), _jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, display: "grid", gridTemplateColumns: "1fr 2fr", rowGap: 2, columnGap: 3, children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: "Username" }), _jsx(Text, { children: display.username || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Display name" }), _jsx(Text, { children: display.displayName || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Email" }), _jsx(Text, { children: display.email || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Initials" }), _jsx(Text, { children: display.initials || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Origin" }), _jsx(Text, { children: display.origin || '-' }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: "Roles" }), _jsx(Box, { display: "flex", gap: 1, flexWrap: "wrap", children: display.roles.length > 0 ? (display.roles.map(role => (_jsx(Label, { size: "small", variant: "secondary", children: role }, role)))) : (_jsx(Text, { children: "-" })) })] })] })] })) }));
|
|
250
213
|
}
|
|
251
214
|
export function AgentNode() {
|
|
252
215
|
const { token, setAuth, clearAuth } = useSimpleAuthStore();
|
|
@@ -1093,65 +1056,21 @@ export function AgentNode() {
|
|
|
1093
1056
|
}
|
|
1094
1057
|
}, children: label }));
|
|
1095
1058
|
};
|
|
1096
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: cfg.primerTheme, themeStyles: cfg.themeStyles, children: _jsx(Box, { sx: {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
zIndex: 1000,
|
|
1112
|
-
pointerEvents: 'none',
|
|
1113
|
-
display: 'flex',
|
|
1114
|
-
justifyContent: 'stretch',
|
|
1115
|
-
}, children: _jsx(Box, { role: banner?.kind === 'error' ? 'alert' : 'status', sx: {
|
|
1116
|
-
pointerEvents: banner ? 'auto' : 'none',
|
|
1117
|
-
width: '100%',
|
|
1118
|
-
px: 4,
|
|
1119
|
-
py: 4,
|
|
1120
|
-
borderRadius: 0,
|
|
1121
|
-
borderBottom: '1px solid',
|
|
1122
|
-
borderColor: banner?.kind === 'error'
|
|
1123
|
-
? 'danger.emphasis'
|
|
1124
|
-
: banner?.kind === 'warning'
|
|
1125
|
-
? 'attention.emphasis'
|
|
1126
|
-
: banner?.kind === 'success'
|
|
1127
|
-
? 'success.emphasis'
|
|
1128
|
-
: 'accent.emphasis',
|
|
1129
|
-
bg: banner?.kind === 'error'
|
|
1130
|
-
? 'danger.subtle'
|
|
1131
|
-
: banner?.kind === 'warning'
|
|
1132
|
-
? 'attention.subtle'
|
|
1133
|
-
: banner?.kind === 'success'
|
|
1134
|
-
? 'success.subtle'
|
|
1135
|
-
: 'accent.subtle',
|
|
1136
|
-
color: 'fg.default',
|
|
1137
|
-
boxShadow: banner ? '0 4px 16px rgba(0, 0, 0, 0.12)' : 'none',
|
|
1138
|
-
opacity: banner ? 1 : 0,
|
|
1139
|
-
transform: banner ? 'translateY(0)' : 'translateY(-100%)',
|
|
1140
|
-
transition: banner
|
|
1141
|
-
? 'opacity 600ms ease, transform 700ms cubic-bezier(0.16, 1, 0.3, 1)'
|
|
1142
|
-
: 'opacity 250ms ease, transform 350ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
1143
|
-
textAlign: 'center',
|
|
1144
|
-
}, children: _jsx(Text, { sx: { fontSize: 3, fontWeight: 'bold' }, children: banner?.message ?? '' }) }) }), !token && (_jsxs(Box, { sx: { mb: 3 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 1 }, children: [_jsx(Box, { sx: { color: 'fg.muted', display: 'inline-flex' }, children: _jsx(KeyAsteriskIcon, { size: 18 }) }), _jsx(Heading, { sx: { fontSize: 3, m: 0 }, children: "Agent Node" })] }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Authenticate, configure Private/Shared/Sleep mode, then chat from this node." })] })), step === 'auth' && (_jsx(Box, { sx: {
|
|
1145
|
-
border: '1px solid',
|
|
1146
|
-
borderColor: 'border.default',
|
|
1147
|
-
borderTop: '3px solid',
|
|
1148
|
-
borderTopColor: cfg.brandColor,
|
|
1149
|
-
borderRadius: 2,
|
|
1150
|
-
p: 4,
|
|
1151
|
-
backgroundImage: `linear-gradient(135deg, ${authGradient.from}1A 0%, ${authGradient.to}1A 100%)`,
|
|
1152
|
-
}, children: _jsx(Box, { sx: {
|
|
1153
|
-
maxWidth: 640,
|
|
1154
|
-
mx: 'auto',
|
|
1059
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: cfg.primerTheme, themeStyles: cfg.themeStyles, children: _jsx(Box, { minHeight: "100vh", bg: "canvas.default", color: "fg.default", children: _jsxs(PageLayout, { containerWidth: "full", padding: "normal", sx: { bg: 'canvas.default', color: 'fg.default' }, style: { minHeight: '100vh', overflow: 'visible' }, children: [_jsx(PageLayout.Header, { children: _jsxs(PageHeader, { children: [_jsx(PageHeader.TitleArea, { children: _jsx(PageHeader.Title, { children: _jsx(Box, { as: "a", href: "https://datalayer.ai", target: "_blank", rel: "noopener noreferrer", "aria-label": "Open Datalayer website", display: "inline-flex", alignItems: "center", children: _jsx(DatalayerLogoText, { size: 24, inverse: true, variant: themeVariant, colorMode: colorMode, primaryColor: logoColors.primary, secondaryColor: logoColors.secondary, textColor: logoColors.textColor, primaryGradient: logoColors.primaryGradient, secondaryGradient: logoColors.secondaryGradient, gradient: true }) }) }) }), _jsx(PageHeader.Actions, { children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, fontSize: 2, lineHeight: "22px", children: [token && (_jsxs(_Fragment, { children: [_jsx(StepEntry, { entryStep: "chat", label: "Chat", leadingVisual: CommentIcon }), _jsx(StepEntry, { entryStep: "gallery", label: "Agents", leadingVisual: AiAgentIcon }), _jsx(StepEntry, { entryStep: "config", label: "Configuration", leadingVisual: GearIcon })] })), !token ? null : (_jsxs(_Fragment, { children: [_jsx(StepEntry, { entryStep: "profile", label: "Profile", leadingVisual: PersonIcon }), _jsx(Button, { size: "small", variant: "invisible", onClick: handleSignOut, leadingVisual: SignOutIcon, sx: { color: 'fg.default' }, children: "Sign out" })] })), _jsx(AppearanceMenu, { colorMode: colorMode, themeVariant: themeVariant, onColorModeChange: setColorMode, onThemeChange: nextTheme => setTheme(nextTheme, false), shape: "circle" })] }) })] }) }), _jsxs(PageLayout.Content, { children: [_jsx(Box, { "aria-live": "polite", position: "fixed", top: 0, left: 0, right: 0, zIndex: 1000, pointerEvents: "none", display: "flex", justifyContent: "stretch", children: _jsx(Box, { role: banner?.kind === 'error' ? 'alert' : 'status', pointerEvents: banner ? 'auto' : 'none', width: "100%", px: 4, py: 4, borderRadius: 0, borderBottom: "1px solid", borderColor: banner?.kind === 'error'
|
|
1060
|
+
? 'danger.emphasis'
|
|
1061
|
+
: banner?.kind === 'warning'
|
|
1062
|
+
? 'attention.emphasis'
|
|
1063
|
+
: banner?.kind === 'success'
|
|
1064
|
+
? 'success.emphasis'
|
|
1065
|
+
: 'accent.emphasis', bg: banner?.kind === 'error'
|
|
1066
|
+
? 'danger.subtle'
|
|
1067
|
+
: banner?.kind === 'warning'
|
|
1068
|
+
? 'attention.subtle'
|
|
1069
|
+
: banner?.kind === 'success'
|
|
1070
|
+
? 'success.subtle'
|
|
1071
|
+
: 'accent.subtle', color: "fg.default", boxShadow: banner ? '0 4px 16px rgba(0, 0, 0, 0.12)' : 'none', opacity: banner ? 1 : 0, transform: banner ? 'translateY(0)' : 'translateY(-100%)', transition: banner
|
|
1072
|
+
? 'opacity 600ms ease, transform 700ms cubic-bezier(0.16, 1, 0.3, 1)'
|
|
1073
|
+
: 'opacity 250ms ease, transform 350ms cubic-bezier(0.16, 1, 0.3, 1)', textAlign: "center", children: _jsx(Text, { sx: { fontSize: 3, fontWeight: 'bold' }, children: banner?.message ?? '' }) }) }), !token && (_jsxs(Box, { mb: 3, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, children: [_jsx(Box, { color: "fg.muted", display: "inline-flex", children: _jsx(KeyAsteriskIcon, { size: 18 }) }), _jsx(Heading, { sx: { fontSize: 3, m: 0 }, children: "Agent Node" })] }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Authenticate, configure Private/Shared/Sleep mode, then chat from this node." })] })), step === 'auth' && (_jsx(Box, { border: "1px solid", borderColor: "border.default", borderTop: "3px solid", borderTopColor: cfg.brandColor, borderRadius: 2, p: 4, backgroundImage: `linear-gradient(135deg, ${authGradient.from}1A 0%, ${authGradient.to}1A 100%)`, children: _jsx(Box, { maxWidth: 640, mx: "auto", sx: {
|
|
1155
1074
|
// SignInSimple renders a full-height shell; scope overrides
|
|
1156
1075
|
// here so the auth view inherits this page layout/theme.
|
|
1157
1076
|
'& > div': {
|
|
@@ -1173,114 +1092,23 @@ export function AgentNode() {
|
|
|
1173
1092
|
'& h2, & h3': {
|
|
1174
1093
|
color: cfg.brandColor,
|
|
1175
1094
|
},
|
|
1176
|
-
}, children: _jsx(SignInSimple, { loginUrl: signInLoginUrl, onSignIn: handleSignIn, onApiKeySignIn: handleApiKeySignIn, title: "Agent Node", description: "Sign in to configure node settings and run authenticated chat sessions.", leadingIcon: _jsx(Box, {
|
|
1177
|
-
border: '1px solid',
|
|
1178
|
-
borderColor: 'border.default',
|
|
1179
|
-
borderRadius: 2,
|
|
1180
|
-
p: 3,
|
|
1181
|
-
display: 'flex',
|
|
1182
|
-
flexDirection: 'column',
|
|
1183
|
-
gap: 3,
|
|
1184
|
-
}, children: [_jsxs(Box, { sx: {
|
|
1185
|
-
display: 'grid',
|
|
1186
|
-
gridTemplateColumns: ['1fr', null, '1fr 1fr'],
|
|
1187
|
-
gap: 4,
|
|
1188
|
-
alignItems: 'start',
|
|
1189
|
-
}, children: [_jsxs(Box, { sx: {
|
|
1190
|
-
display: 'flex',
|
|
1191
|
-
flexDirection: 'column',
|
|
1192
|
-
gap: 3,
|
|
1193
|
-
}, children: [_jsxs(Box, { sx: {
|
|
1194
|
-
border: '1px solid',
|
|
1195
|
-
borderColor: 'border.default',
|
|
1196
|
-
borderRadius: 2,
|
|
1197
|
-
p: 3,
|
|
1198
|
-
}, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Mode" }), _jsx(Box, { sx: {
|
|
1199
|
-
display: 'grid',
|
|
1200
|
-
gridTemplateColumns: 'repeat(3, 1fr)',
|
|
1201
|
-
gap: 3,
|
|
1202
|
-
}, children: MODE_CARDS.map(card => {
|
|
1095
|
+
}, children: _jsx(SignInSimple, { loginUrl: signInLoginUrl, onSignIn: handleSignIn, onApiKeySignIn: handleApiKeySignIn, title: "Agent Node", description: "Sign in to configure node settings and run authenticated chat sessions.", leadingIcon: _jsx(Box, { color: cfg.brandColor, display: "inline-flex", children: _jsx(HomeIcon, { size: 24 }) }) }) }) })), step === 'config' && (_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, display: "flex", flexDirection: "column", gap: 3, children: [_jsxs(Box, { display: "grid", gridTemplateColumns: ['1fr', null, '1fr 1fr'], gap: 4, alignItems: "start", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, children: [_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Mode" }), _jsx(Box, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 3, children: MODE_CARDS.map(card => {
|
|
1203
1096
|
const isSelected = configuration.mode === card.mode;
|
|
1204
1097
|
const Icon = card.Icon;
|
|
1205
1098
|
return (_jsxs(Box, { as: "button", type: "button", onClick: () => setConfiguration(prev => ({
|
|
1206
1099
|
...prev,
|
|
1207
1100
|
mode: card.mode,
|
|
1208
|
-
})), "aria-pressed": isSelected,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
flexDirection: 'column',
|
|
1213
|
-
gap: 2,
|
|
1214
|
-
p: 3,
|
|
1215
|
-
borderRadius: 2,
|
|
1216
|
-
border: '1px solid',
|
|
1217
|
-
borderColor: isSelected
|
|
1218
|
-
? cfg.brandColor
|
|
1219
|
-
: 'border.default',
|
|
1220
|
-
bg: isSelected
|
|
1221
|
-
? 'canvas.subtle'
|
|
1222
|
-
: 'canvas.default',
|
|
1223
|
-
color: 'fg.default',
|
|
1224
|
-
boxShadow: isSelected
|
|
1225
|
-
? `0 0 0 1px ${cfg.brandColor}`
|
|
1226
|
-
: 'none',
|
|
1227
|
-
'&:hover': {
|
|
1228
|
-
borderColor: cfg.brandColor,
|
|
1229
|
-
},
|
|
1230
|
-
}, children: [_jsxs(Box, { sx: {
|
|
1231
|
-
display: 'flex',
|
|
1232
|
-
alignItems: 'center',
|
|
1233
|
-
gap: 2,
|
|
1234
|
-
color: isSelected
|
|
1235
|
-
? cfg.brandColor
|
|
1236
|
-
: 'fg.default',
|
|
1237
|
-
}, children: [_jsx(Icon, { size: 20 }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: card.name })] }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: card.description })] }, card.mode));
|
|
1238
|
-
}) })] }), _jsxs(Box, { sx: {
|
|
1239
|
-
border: '1px solid',
|
|
1240
|
-
borderColor: 'border.default',
|
|
1241
|
-
borderRadius: 2,
|
|
1242
|
-
p: 3,
|
|
1243
|
-
}, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Inference" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1, mb: 2 }, children: "Used inference provider for newly launched agent sessions." }), _jsxs(Box, { sx: {
|
|
1244
|
-
display: 'flex',
|
|
1245
|
-
gap: 2,
|
|
1246
|
-
flexWrap: 'wrap',
|
|
1247
|
-
mb: inferenceProvider === 'datalayer' ? 2 : 0,
|
|
1248
|
-
}, children: [_jsx(Button, { size: "small", variant: inferenceProvider === 'local'
|
|
1101
|
+
})), "aria-pressed": isSelected, textAlign: "left", cursor: "pointer", display: "flex", flexDirection: "column", gap: 2, p: 3, borderRadius: 2, border: "1px solid", borderColor: isSelected ? cfg.brandColor : 'border.default', bg: isSelected ? 'canvas.subtle' : 'canvas.default', color: "fg.default", boxShadow: isSelected
|
|
1102
|
+
? `0 0 0 1px ${cfg.brandColor}`
|
|
1103
|
+
: 'none', hover: { borderColor: cfg.brandColor }, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, color: isSelected ? cfg.brandColor : 'fg.default', children: [_jsx(Icon, { size: 20 }), _jsx(Text, { sx: { fontWeight: 'bold' }, children: card.name })] }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: card.description })] }, card.mode));
|
|
1104
|
+
}) })] }), _jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Inference" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1, mb: 2 }, children: "Used inference provider for newly launched agent sessions." }), _jsxs(Box, { display: "flex", gap: 2, flexWrap: "wrap", mb: inferenceProvider === 'datalayer' ? 2 : 0, children: [_jsx(Button, { size: "small", variant: inferenceProvider === 'local'
|
|
1249
1105
|
? 'primary'
|
|
1250
1106
|
: 'default', onClick: () => setInferenceProvider('local'), children: "local" }), _jsx(Button, { size: "small", variant: inferenceProvider === 'datalayer'
|
|
1251
1107
|
? 'primary'
|
|
1252
|
-
: 'default', onClick: () => setInferenceProvider('datalayer'), children: "datalayer" })] }), inferenceProvider === 'datalayer' && (_jsxs(Box, { sx: {
|
|
1253
|
-
border: '1px solid',
|
|
1254
|
-
borderColor: 'border.default',
|
|
1255
|
-
borderRadius: 2,
|
|
1256
|
-
p: 2,
|
|
1257
|
-
bg: 'canvas.subtle',
|
|
1258
|
-
display: 'flex',
|
|
1259
|
-
flexDirection: 'column',
|
|
1260
|
-
gap: 1,
|
|
1261
|
-
}, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Models ai-inference serves" }), inferenceModels.length === 0 ? (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: inferenceModelsNote ??
|
|
1108
|
+
: 'default', onClick: () => setInferenceProvider('datalayer'), children: "datalayer" })] }), inferenceProvider === 'datalayer' && (_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 2, bg: "canvas.subtle", display: "flex", flexDirection: "column", gap: 1, children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: "Models ai-inference serves" }), inferenceModels.length === 0 ? (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: inferenceModelsNote ??
|
|
1262
1109
|
'The runtime has not said which models ai-inference serves.' })) : (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { children: inferenceModels.length === 1
|
|
1263
1110
|
? inferenceModels[0]
|
|
1264
|
-
: `${inferenceModels.length} models` }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsx(ActionList, { children: inferenceModels.map(model => (_jsx(ActionList.Item, { inactiveText: "Selection is locked", children: model }, model))) }) })] }))] }))] }), iamUser ? (_jsxs(Box, { sx: {
|
|
1265
|
-
border: '1px solid',
|
|
1266
|
-
borderColor: 'border.default',
|
|
1267
|
-
borderRadius: 2,
|
|
1268
|
-
p: 3,
|
|
1269
|
-
}, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Billing Entity" }), _jsx(BillingEntitySelect, { value: configuration.billing_entity_uid || '', onChange: handleBillingEntityChange, onSelectedAccountChange: handleSelectedAccountChange, onAccountsResolved: handleAccountsResolved })] })) : (_jsxs(Box, { sx: {
|
|
1270
|
-
border: '1px solid',
|
|
1271
|
-
borderColor: 'border.default',
|
|
1272
|
-
borderRadius: 2,
|
|
1273
|
-
p: 3,
|
|
1274
|
-
}, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Billing Entity" }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Loading billing entities..." })] })] }))] }), _jsx(Box, { sx: {
|
|
1275
|
-
display: 'flex',
|
|
1276
|
-
flexDirection: 'column',
|
|
1277
|
-
gap: 2,
|
|
1278
|
-
}, children: _jsxs(Box, { sx: {
|
|
1279
|
-
border: '1px solid',
|
|
1280
|
-
borderColor: 'border.default',
|
|
1281
|
-
borderRadius: 2,
|
|
1282
|
-
p: 3,
|
|
1283
|
-
}, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Share" }), _jsx(ShareAccessComponent, { isOpen: true, displayMode: "inline", requestUrl: `${AGENT_RUNTIMES_BASE_URL}/api/v1/agent-node/sharing`, resourceLabel: "Agent Node", resourceName: "this Agent Node", onClose: handleSharingInlineClose })] }) })] }), error && _jsx(Text, { sx: { color: 'danger.fg' }, children: error }), _jsx(Box, { sx: { display: 'flex', justifyContent: 'flex-end' }, children: _jsx(Button, { variant: "primary", onClick: saveConfiguration, disabled: isSaving, children: isSaving ? 'Saving...' : 'Save' }) })] })), step === 'profile' && (_jsx(AgentNodeProfileView, { token: token, onTokenExpired: handleSignOut, avatarFallbackBackground: avatarPalette.bgAlt, avatarFallbackForeground: avatarPalette.primary })), step === 'gallery' && (_jsx(AgentNodeGallery, { baseUrl: AGENT_RUNTIMES_BASE_URL, token: token, activeAgentId: configuration.active_agent_id, onLaunchError: message => {
|
|
1111
|
+
: `${inferenceModels.length} models` }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsx(ActionList, { children: inferenceModels.map(model => (_jsx(ActionList.Item, { inactiveText: "Selection is locked", children: model }, model))) }) })] }))] }))] }), iamUser ? (_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Billing Entity" }), _jsx(BillingEntitySelect, { value: configuration.billing_entity_uid || '', onChange: handleBillingEntityChange, onSelectedAccountChange: handleSelectedAccountChange, onAccountsResolved: handleAccountsResolved })] })) : (_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Billing Entity" }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Loading billing entities..." })] })] }))] }), _jsx(Box, { display: "flex", flexDirection: "column", gap: 2, children: _jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, children: [_jsx(Heading, { sx: { fontSize: 2, m: 0, mb: 2 }, children: "Share" }), _jsx(ShareAccessComponent, { isOpen: true, displayMode: "inline", requestUrl: `${AGENT_RUNTIMES_BASE_URL}/api/v1/agent-node/sharing`, resourceLabel: "Agent Node", resourceName: "this Agent Node", onClose: handleSharingInlineClose })] }) })] }), error && _jsx(Text, { sx: { color: 'danger.fg' }, children: error }), _jsx(Box, { display: "flex", justifyContent: "flex-end", children: _jsx(Button, { variant: "primary", onClick: saveConfiguration, disabled: isSaving, children: isSaving ? 'Saving...' : 'Save' }) })] })), step === 'profile' && (_jsx(AgentNodeProfileView, { token: token, onTokenExpired: handleSignOut, avatarFallbackBackground: avatarPalette.bgAlt, avatarFallbackForeground: avatarPalette.primary })), step === 'gallery' && (_jsx(AgentNodeGallery, { baseUrl: AGENT_RUNTIMES_BASE_URL, token: token, activeAgentId: configuration.active_agent_id, onLaunchError: message => {
|
|
1284
1112
|
showBanner('error', message);
|
|
1285
1113
|
}, onLaunched: (agentId, protocol) => {
|
|
1286
1114
|
setSelectedAgentId(agentId);
|
|
@@ -1318,11 +1146,6 @@ export function AgentNode() {
|
|
|
1318
1146
|
active_agent_id: undefined,
|
|
1319
1147
|
}));
|
|
1320
1148
|
setStep('gallery');
|
|
1321
|
-
} })), step === 'chat' && (_jsx(Box, { sx: {
|
|
1322
|
-
border: '1px solid',
|
|
1323
|
-
borderColor: 'border.default',
|
|
1324
|
-
borderRadius: 2,
|
|
1325
|
-
overflow: 'hidden',
|
|
1326
|
-
}, children: isSaasOnlyChat ? (_jsxs(Box, { sx: { p: 4 }, children: [_jsx(Heading, { sx: { fontSize: 2, mb: 2 }, children: "Chat From SaaS" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "This Agent Node deployment is configured for SaaS-only chat. Use the Datalayer Agent Nodes view to open chat sessions over the runtimes tunnel." })] })) : (_jsx(Chat, { protocol: activeAgentProtocol, baseUrl: AGENT_RUNTIMES_BASE_URL, agentId: selectedAgentId, title: chatTitle, placeholder: "Send a message...", description: chatDescription, suggestions: chatSuggestions, submitOnSuggestionClick: true, showHeader: true, height: '70vh', showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, enableEphemeralNotebook: true, enableEphemeralDocument: true, initialEphemeralSurfaceMode: "notebook", runtimeId: selectedAgentId, ephemeralRuntimeOverride: sandboxRuntimeOverride, kernelEnvironmentName: sandboxEnvironmentName, themeVariant: themeVariant, colorMode: colorMode, ephemeralNotebookCollaborationProvider: ephemeralNotebookCollaborationProvider, ephemeralNotebookCollaborationDocumentId: ephemeralCollaborationDocumentId, ephemeralDocumentCollaboration: ephemeralDocumentCollaboration, historyEndpoint: `${AGENT_RUNTIMES_BASE_URL}/api/v1/history` })) }))] })] }) }) }));
|
|
1149
|
+
} })), step === 'chat' && (_jsx(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", children: isSaasOnlyChat ? (_jsxs(Box, { p: 4, children: [_jsx(Heading, { sx: { fontSize: 2, mb: 2 }, children: "Chat From SaaS" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "This Agent Node deployment is configured for SaaS-only chat. Use the Datalayer Agent Nodes view to open chat sessions over the runtimes tunnel." })] })) : (_jsx(Chat, { protocol: activeAgentProtocol, baseUrl: AGENT_RUNTIMES_BASE_URL, agentId: selectedAgentId, title: chatTitle, placeholder: "Send a message...", description: chatDescription, suggestions: chatSuggestions, submitOnSuggestionClick: true, showHeader: true, height: '70vh', showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, enableEphemeralNotebook: true, enableEphemeralDocument: true, initialEphemeralSurfaceMode: "notebook", runtimeId: selectedAgentId, ephemeralRuntimeOverride: sandboxRuntimeOverride, kernelEnvironmentName: sandboxEnvironmentName, themeVariant: themeVariant, colorMode: colorMode, ephemeralNotebookCollaborationProvider: ephemeralNotebookCollaborationProvider, ephemeralNotebookCollaborationDocumentId: ephemeralCollaborationDocumentId, ephemeralDocumentCollaboration: ephemeralDocumentCollaboration, historyEndpoint: `${AGENT_RUNTIMES_BASE_URL}/api/v1/history` })) }))] })] }) }) }));
|
|
1327
1150
|
}
|
|
1328
1151
|
export default AgentNode;
|
package/lib/AgentNotebook.js
CHANGED
|
@@ -168,27 +168,11 @@ function useNotebookKernel(notebookId, active) {
|
|
|
168
168
|
}, [notebookId, active]);
|
|
169
169
|
return kernel;
|
|
170
170
|
}
|
|
171
|
-
const NotebookPanel = ({ serviceManager, kernelId, colormode, backgroundColor, }) => (_jsx(Box, {
|
|
172
|
-
flex: 1,
|
|
173
|
-
minWidth: '360px',
|
|
174
|
-
minHeight: 0,
|
|
175
|
-
display: 'flex',
|
|
176
|
-
flexDirection: 'column',
|
|
177
|
-
overflow: 'hidden',
|
|
178
|
-
borderRight: '1px solid',
|
|
179
|
-
borderColor: 'border.default',
|
|
180
|
-
}, children: _jsx(JupyterReactTheme, { colormode: colormode, backgroundColor: backgroundColor, children: _jsx(Notebook, { nbformat: EmptyNotebook, id: NOTEBOOK_ID, serviceManager: serviceManager, kernelId: kernelId, height: `calc(100vh - ${TOP_BAR_HEIGHT}px)`, cellSidebarMargin: 120, startDefaultKernel: !kernelId }) }) }));
|
|
171
|
+
const NotebookPanel = ({ serviceManager, kernelId, colormode, backgroundColor, }) => (_jsx(Box, { flex: 1, minWidth: "360px", minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden", borderRight: "1px solid", borderColor: "border.default", children: _jsx(JupyterReactTheme, { colormode: colormode, backgroundColor: backgroundColor, children: _jsx(Notebook, { nbformat: EmptyNotebook, id: NOTEBOOK_ID, serviceManager: serviceManager, kernelId: kernelId, height: `calc(100vh - ${TOP_BAR_HEIGHT}px)`, cellSidebarMargin: 120, startDefaultKernel: !kernelId }) }) }));
|
|
181
172
|
const ChatPanel = ({ agentId, kernel }) => {
|
|
182
173
|
// Register notebook tools so the agent can manipulate cells
|
|
183
174
|
const notebookTools = useNotebookTools(NOTEBOOK_ID);
|
|
184
|
-
return (_jsx(Box, {
|
|
185
|
-
width: '420px',
|
|
186
|
-
minWidth: '320px',
|
|
187
|
-
flexShrink: 0,
|
|
188
|
-
display: 'flex',
|
|
189
|
-
flexDirection: 'column',
|
|
190
|
-
overflow: 'hidden',
|
|
191
|
-
}, children: _jsx(Chat, { protocol: "ag-ui", baseUrl: BASE_URL, agentId: agentId, title: "Agent Notebook", placeholder: "Ask about the notebook...", description: "Chat with the agent to manipulate the notebook", showHeader: true, height: "100%", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, disableInternalJupyterTheme: true, frontendTools: notebookTools, autoFocus: true, runtimeId: agentId, kernel: kernel, historyEndpoint: `${BASE_URL}/api/v1/history`, suggestions: [
|
|
175
|
+
return (_jsx(Box, { width: "420px", minWidth: "320px", flexShrink: 0, display: "flex", flexDirection: "column", overflow: "hidden", children: _jsx(Chat, { protocol: "ag-ui", baseUrl: BASE_URL, agentId: agentId, title: "Agent Notebook", placeholder: "Ask about the notebook...", description: "Chat with the agent to manipulate the notebook", showHeader: true, height: "100%", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, disableInternalJupyterTheme: true, frontendTools: notebookTools, autoFocus: true, runtimeId: agentId, kernel: kernel, historyEndpoint: `${BASE_URL}/api/v1/history`, suggestions: [
|
|
192
176
|
{
|
|
193
177
|
title: 'Add a cell',
|
|
194
178
|
message: 'Insert a new code cell into the notebook',
|
|
@@ -296,51 +280,13 @@ export const AgentNotebook = () => {
|
|
|
296
280
|
}, [kernelId]);
|
|
297
281
|
// Loading
|
|
298
282
|
if (!isReady && !error) {
|
|
299
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { sx: {
|
|
300
|
-
display: 'flex',
|
|
301
|
-
flexDirection: 'column',
|
|
302
|
-
alignItems: 'center',
|
|
303
|
-
justifyContent: 'center',
|
|
304
|
-
height: '100vh',
|
|
305
|
-
gap: 3,
|
|
306
|
-
bg: 'canvas.default',
|
|
307
|
-
}, children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "\u2026"] })] }) }));
|
|
283
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(Spinner, { size: "large" }), _jsxs(Text, { sx: { color: 'fg.muted' }, children: ["Connecting to agent ", agentId, "\u2026"] })] }) }));
|
|
308
284
|
}
|
|
309
285
|
// Error
|
|
310
286
|
if (error) {
|
|
311
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { sx: {
|
|
312
|
-
display: 'flex',
|
|
313
|
-
flexDirection: 'column',
|
|
314
|
-
alignItems: 'center',
|
|
315
|
-
justifyContent: 'center',
|
|
316
|
-
height: '100vh',
|
|
317
|
-
gap: 3,
|
|
318
|
-
bg: 'canvas.default',
|
|
319
|
-
}, children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
287
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", gap: 3, bg: "canvas.default", children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Failed to connect" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: error })] }) }));
|
|
320
288
|
}
|
|
321
289
|
// Ready — notebook + chat side-by-side
|
|
322
|
-
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, {
|
|
323
|
-
display: 'flex',
|
|
324
|
-
flexDirection: 'column',
|
|
325
|
-
height: '100vh',
|
|
326
|
-
width: '100vw',
|
|
327
|
-
overflow: 'hidden',
|
|
328
|
-
bg: 'canvas.default',
|
|
329
|
-
}, children: [_jsx(Box, { sx: {
|
|
330
|
-
display: 'flex',
|
|
331
|
-
justifyContent: 'flex-end',
|
|
332
|
-
alignItems: 'center',
|
|
333
|
-
px: 3,
|
|
334
|
-
height: `${TOP_BAR_HEIGHT}px`,
|
|
335
|
-
boxSizing: 'border-box',
|
|
336
|
-
borderBottom: '1px solid',
|
|
337
|
-
borderColor: 'border.default',
|
|
338
|
-
flexShrink: 0,
|
|
339
|
-
}, children: _jsx(AppearanceControlsWithStore, { useStore: useAgentNotebookThemeStore }) }), _jsxs(Box, { sx: {
|
|
340
|
-
display: 'flex',
|
|
341
|
-
flex: 1,
|
|
342
|
-
minHeight: 0,
|
|
343
|
-
overflow: 'hidden',
|
|
344
|
-
}, children: [serviceManager && (_jsx(NotebookPanel, { serviceManager: serviceManager, kernelId: kernelId, colormode: resolvedMode, backgroundColor: themeBackground })), _jsx(ChatPanel, { agentId: agentId, kernel: notebookKernel })] })] }) }));
|
|
290
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: colorMode, theme: themeConfig.primerTheme, themeStyles: themeConfig.themeStyles, children: _jsxs(Box, { display: "flex", flexDirection: "column", height: "100vh", width: "100vw", overflow: "hidden", bg: "canvas.default", children: [_jsx(Box, { display: "flex", justifyContent: "flex-end", alignItems: "center", px: 3, height: `${TOP_BAR_HEIGHT}px`, boxSizing: "border-box", borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: _jsx(AppearanceControlsWithStore, { useStore: useAgentNotebookThemeStore }) }), _jsxs(Box, { display: "flex", flex: 1, minHeight: 0, overflow: "hidden", children: [serviceManager && (_jsx(NotebookPanel, { serviceManager: serviceManager, kernelId: kernelId, colormode: resolvedMode, backgroundColor: themeBackground })), _jsx(ChatPanel, { agentId: agentId, kernel: notebookKernel })] })] }) }));
|
|
345
291
|
};
|
|
346
292
|
export default AgentNotebook;
|