@datalayer/agent-runtimes 1.3.89 → 1.3.91
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/chat/words.d.ts +7 -0
- package/lib/chat/words.js +12 -0
- 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/a2ui/styles.js +16 -5
- 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/AppFeedback.js +12 -3
- 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/apps/feedback.d.ts +3 -2
- package/lib/loop/apps/feedback.js +4 -2
- package/lib/loop/core/index.d.ts +19 -0
- package/lib/loop/core/index.js +27 -0
- 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 +32 -27
- package/lib/loop/plugins/app-elements/AppElements.js +2 -31
- package/lib/loop/plugins/app-page/AppPage.js +26 -8
- 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 +89 -130
- 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/lib/shims/primerAddonsBox.d.ts +0 -1
- package/lib/shims/primerAddonsBox.js +0 -7
|
@@ -69,13 +69,9 @@ function deriveAggregate(status) {
|
|
|
69
69
|
return 'idle';
|
|
70
70
|
}
|
|
71
71
|
function renderSandboxGlyph(aggregate) {
|
|
72
|
-
return (_jsx(Box, { as: "span", sx:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
height: 10,
|
|
76
|
-
borderRadius: '50%',
|
|
77
|
-
bg: SANDBOX_INDICATOR_COLORS[aggregate],
|
|
78
|
-
...(aggregate === 'executing' && {
|
|
72
|
+
return (_jsx(Box, { as: "span", display: "inline-block", width: 10, height: 10, borderRadius: "50%", bg: SANDBOX_INDICATOR_COLORS[aggregate], sx: aggregate !== 'executing'
|
|
73
|
+
? undefined
|
|
74
|
+
: {
|
|
79
75
|
animation: 'sandbox-busy-fade 1.2s ease-in-out infinite',
|
|
80
76
|
'@keyframes sandbox-busy-fade': {
|
|
81
77
|
'0%': {
|
|
@@ -94,8 +90,7 @@ function renderSandboxGlyph(aggregate) {
|
|
|
94
90
|
filter: 'saturate(1)',
|
|
95
91
|
},
|
|
96
92
|
},
|
|
97
|
-
})
|
|
98
|
-
} }));
|
|
93
|
+
} }));
|
|
99
94
|
}
|
|
100
95
|
/* ── Component ─────────────────────────────────────────── */
|
|
101
96
|
export function SandboxStatusIndicator({ apiBase, authToken, agentId, statusOverride, }) {
|
|
@@ -166,12 +161,7 @@ export function SandboxStatusIndicator({ apiBase, authToken, agentId, statusOver
|
|
|
166
161
|
}, [aggregate, effectiveStatus]);
|
|
167
162
|
// Show a subtle gray dot when sandbox is unavailable.
|
|
168
163
|
// The tooltip tells the user none is configured.
|
|
169
|
-
return (_jsxs(Box, { as: "span",
|
|
170
|
-
position: 'relative',
|
|
171
|
-
display: 'inline-flex',
|
|
172
|
-
alignItems: 'center',
|
|
173
|
-
justifyContent: 'center',
|
|
174
|
-
}, onMouseEnter: () => setIsOverlayOpen(true), onMouseLeave: () => setIsOverlayOpen(false), children: [_jsx("button", { type: "button", "aria-label": tooltipText, onClick: aggregate === 'executing' ? sendInterrupt : undefined, onFocus: () => setIsOverlayOpen(true), onBlur: () => setIsOverlayOpen(false), style: {
|
|
164
|
+
return (_jsxs(Box, { as: "span", position: "relative", display: "inline-flex", alignItems: "center", justifyContent: "center", onMouseEnter: () => setIsOverlayOpen(true), onMouseLeave: () => setIsOverlayOpen(false), children: [_jsx("button", { type: "button", "aria-label": tooltipText, onClick: aggregate === 'executing' ? sendInterrupt : undefined, onFocus: () => setIsOverlayOpen(true), onBlur: () => setIsOverlayOpen(false), style: {
|
|
175
165
|
display: 'inline-flex',
|
|
176
166
|
alignItems: 'center',
|
|
177
167
|
justifyContent: 'center',
|
|
@@ -187,24 +177,6 @@ export function SandboxStatusIndicator({ apiBase, authToken, agentId, statusOver
|
|
|
187
177
|
appearance: 'none',
|
|
188
178
|
cursor: aggregate === 'executing' ? 'pointer' : 'default',
|
|
189
179
|
lineHeight: 0,
|
|
190
|
-
}, children: _jsx(Box, { as: "span",
|
|
191
|
-
position: 'absolute',
|
|
192
|
-
right: 0,
|
|
193
|
-
top: 'calc(100% + 6px)',
|
|
194
|
-
minWidth: 220,
|
|
195
|
-
px: 2,
|
|
196
|
-
py: 2,
|
|
197
|
-
borderRadius: 2,
|
|
198
|
-
bg: 'canvas.overlay',
|
|
199
|
-
color: 'fg.default',
|
|
200
|
-
fontSize: 0,
|
|
201
|
-
lineHeight: 1.5,
|
|
202
|
-
boxShadow: 'shadow.medium',
|
|
203
|
-
border: '1px solid',
|
|
204
|
-
borderColor: 'border.default',
|
|
205
|
-
zIndex: 1000,
|
|
206
|
-
fontFamily: 'mono',
|
|
207
|
-
pointerEvents: 'none',
|
|
208
|
-
}, children: [_jsx(Box, { sx: { mb: 1, fontWeight: 600, fontFamily: 'normal' }, children: tooltipText }), effectiveStatus ? (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsxs(Box, { as: "span", sx: { fontWeight: 600 }, children: ["variant:", ' '] }), _jsx(Box, { as: "span", children: effectiveStatus.variant })] }), _jsxs(Box, { children: [_jsxs(Box, { as: "span", sx: { fontWeight: 600 }, children: ["sandbox_running:", ' '] }), _jsx(Box, { as: "span", children: String(effectiveStatus.sandbox_running) })] }), _jsxs(Box, { children: [_jsxs(Box, { as: "span", sx: { fontWeight: 600 }, children: ["is_executing:", ' '] }), _jsx(Box, { as: "span", children: String(effectiveStatus.is_executing) })] }), effectiveStatus.jupyter_url && (_jsxs(Box, { sx: { wordBreak: 'break-all' }, children: [_jsxs(Box, { as: "span", sx: { fontWeight: 600 }, children: ["jupyter_url:", ' '] }), _jsx(Box, { as: "span", children: effectiveStatus.jupyter_url })] })), effectiveStatus.error && (_jsx(Box, { sx: { mt: 1, color: 'danger.fg' }, children: effectiveStatus.error })), aggregate === 'executing' && (_jsx(Box, { sx: { mt: 1, fontFamily: 'normal', color: 'fg.muted' }, children: "Click to interrupt execution" }))] })) : (_jsx(Box, { sx: { fontFamily: 'normal', color: 'fg.muted' }, children: "No sandbox configured for this agent." }))] }))] }));
|
|
180
|
+
}, children: _jsx(Box, { as: "span", display: "inline-flex", alignItems: "center", flexShrink: 0, children: renderSandboxGlyph(aggregate) }) }), isOverlayOpen && (_jsxs(Box, { role: "tooltip", position: "absolute", right: 0, top: "calc(100% + 6px)", minWidth: 220, px: 2, py: 2, borderRadius: 2, bg: "canvas.overlay", color: "fg.default", fontSize: 0, lineHeight: 1.5, boxShadow: "shadow.medium", border: "1px solid", borderColor: "border.default", zIndex: 1000, fontFamily: "mono", pointerEvents: "none", children: [_jsx(Box, { mb: 1, fontWeight: 600, fontFamily: "normal", children: tooltipText }), effectiveStatus ? (_jsxs(_Fragment, { children: [_jsxs(Box, { children: [_jsxs(Box, { as: "span", fontWeight: 600, children: ["variant:", ' '] }), _jsx(Box, { as: "span", children: effectiveStatus.variant })] }), _jsxs(Box, { children: [_jsxs(Box, { as: "span", fontWeight: 600, children: ["sandbox_running:", ' '] }), _jsx(Box, { as: "span", children: String(effectiveStatus.sandbox_running) })] }), _jsxs(Box, { children: [_jsxs(Box, { as: "span", fontWeight: 600, children: ["is_executing:", ' '] }), _jsx(Box, { as: "span", children: String(effectiveStatus.is_executing) })] }), effectiveStatus.jupyter_url && (_jsxs(Box, { wordBreak: "break-all", children: [_jsxs(Box, { as: "span", fontWeight: 600, children: ["jupyter_url:", ' '] }), _jsx(Box, { as: "span", children: effectiveStatus.jupyter_url })] })), effectiveStatus.error && (_jsx(Box, { mt: 1, color: "danger.fg", children: effectiveStatus.error })), aggregate === 'executing' && (_jsx(Box, { mt: 1, fontFamily: "normal", color: "fg.muted", children: "Click to interrupt execution" }))] })) : (_jsx(Box, { fontFamily: "normal", color: "fg.muted", children: "No sandbox configured for this agent." }))] }))] }));
|
|
209
181
|
}
|
|
210
182
|
export default SandboxStatusIndicator;
|
|
@@ -76,17 +76,8 @@ export function SkillsStatusIndicator({ skillsCount, enabledCount, loading = fal
|
|
|
76
76
|
background: 'none',
|
|
77
77
|
cursor: 'default',
|
|
78
78
|
lineHeight: 0,
|
|
79
|
-
}, children: _jsx(Box, { as: "span",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
height: 12,
|
|
83
|
-
borderRadius: '50%',
|
|
84
|
-
bg: SKILLS_STATUS_COLORS[aggregate],
|
|
85
|
-
flexShrink: 0,
|
|
86
|
-
...(aggregate === 'loading' && {
|
|
87
|
-
animation: 'skills-pulse 1.5s ease-in-out infinite',
|
|
88
|
-
}),
|
|
89
|
-
'@media (prefers-reduced-motion: reduce)': { animation: 'none' },
|
|
90
|
-
} }) }) }));
|
|
79
|
+
}, children: _jsx(Box, { as: "span", display: "inline-block", width: 12, height: 12, borderRadius: "50%", bg: SKILLS_STATUS_COLORS[aggregate], flexShrink: 0, animation: aggregate === 'loading'
|
|
80
|
+
? 'skills-pulse 1.5s ease-in-out infinite'
|
|
81
|
+
: undefined, reducedMotion: { animation: 'none' } }) }) }));
|
|
91
82
|
}
|
|
92
83
|
export default SkillsStatusIndicator;
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@datalayer/primer-addons';
|
|
3
3
|
export function TypingDots({ size = 8 }) {
|
|
4
|
-
return (_jsx(Box, { "aria-hidden": "true", "data-typing-dots": "",
|
|
5
|
-
width: size,
|
|
6
|
-
height: size,
|
|
7
|
-
borderRadius: '50%',
|
|
8
|
-
bg: 'fg.muted',
|
|
9
|
-
animation: 'typingPulse 1.4s ease-in-out infinite',
|
|
10
|
-
animationDelay: `${delay}s`,
|
|
4
|
+
return (_jsx(Box, { "aria-hidden": "true", "data-typing-dots": "", display: "inline-flex", alignItems: "center", gap: "4px", children: [0, 0.2, 0.4].map((delay, index) => (_jsx(Box, { width: size, height: size, borderRadius: "50%", bg: "fg.muted", animation: "typingPulse 1.4s ease-in-out infinite", animationDelay: `${delay}s`, reducedMotion: { animation: 'none', opacity: 0.7 }, sx: {
|
|
11
5
|
'@keyframes typingPulse': {
|
|
12
6
|
'0%, 60%, 100%': { transform: 'scale(0.6)', opacity: 0.4 },
|
|
13
7
|
'30%': { transform: 'scale(1)', opacity: 1 },
|
|
14
8
|
},
|
|
15
|
-
'@media (prefers-reduced-motion: reduce)': {
|
|
16
|
-
animation: 'none',
|
|
17
|
-
opacity: 0.7,
|
|
18
|
-
},
|
|
19
9
|
} }, index))) }));
|
|
20
10
|
}
|
|
21
11
|
export default TypingDots;
|
|
@@ -229,34 +229,7 @@ export function SubagentChatPanel({ toolCallId, subagentName: subagentNameHint,
|
|
|
229
229
|
: overA2A && remote?.state === 'launching'
|
|
230
230
|
? 'launching\u2026'
|
|
231
231
|
: 'working\u2026';
|
|
232
|
-
return (_jsxs(Box, { "data-subagent-panel": subagentName, "data-subagent-transport": overA2A ? 'a2a' : 'in-process', sx: {
|
|
233
|
-
mt: 2,
|
|
234
|
-
display: 'flex',
|
|
235
|
-
flexDirection: 'column',
|
|
236
|
-
height,
|
|
237
|
-
width: '100%',
|
|
238
|
-
border: '1px solid',
|
|
239
|
-
borderColor: `${tone}.emphasis`,
|
|
240
|
-
borderRadius: 2,
|
|
241
|
-
overflow: 'hidden',
|
|
242
|
-
bg: 'canvas.default',
|
|
243
|
-
}, children: [_jsxs(Box, { sx: {
|
|
244
|
-
display: 'flex',
|
|
245
|
-
alignItems: 'center',
|
|
246
|
-
gap: 1,
|
|
247
|
-
px: 2,
|
|
248
|
-
py: 1,
|
|
249
|
-
borderBottom: '1px solid',
|
|
250
|
-
borderColor: `${tone}.muted`,
|
|
251
|
-
bg: `${tone}.subtle`,
|
|
252
|
-
flexShrink: 0,
|
|
253
|
-
}, children: [_jsx(Box, { sx: { display: 'flex', color: `${tone}.fg` }, children: overA2A ? _jsx(BroadcastIcon, { size: 14 }) : _jsx(DependabotIcon, { size: 14 }) }), _jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg` }, children: overA2A ? 'A2A agent' : 'Subagent' }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: `${tone}.fg` }, children: subagentName }), remote?.launch ? (_jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg`, opacity: 0.8 }, children: remote.launch })) : null, remote ? (_jsx(Link, { as: "button", type: "button", "data-a2a-card-button": true, onClick: () => setCardOpen(true), sx: { fontSize: 0, ml: 1 }, children: "card" })) : null, _jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg`, ml: 'auto' }, children: progress })] }), cardOpen && remote ? (_jsx(A2AAgentDialog, { details: remote, onClose: () => setCardOpen(false) })) : null, _jsx(Box, { sx: { flex: 1, minHeight: 0, overflowY: 'auto' }, children: _jsx(ChatMessageList, { displayItems: displayItems, isLoading: !isDone, isStreaming: !isDone, showLoadingIndicator: !isDone, hideMessagesAfterToolUI: false, avatarConfig: avatarConfig, padding: 2, onRespond: handleRespond, messagesEndRef: messagesEndRef, emptyContent: _jsxs(Box, { sx: {
|
|
254
|
-
display: 'flex',
|
|
255
|
-
alignItems: 'center',
|
|
256
|
-
gap: 1,
|
|
257
|
-
color: 'fg.muted',
|
|
258
|
-
p: 2,
|
|
259
|
-
}, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Starting\u2026" })] }) }) })] }));
|
|
232
|
+
return (_jsxs(Box, { "data-subagent-panel": subagentName, "data-subagent-transport": overA2A ? 'a2a' : 'in-process', mt: 2, display: "flex", flexDirection: "column", height: height, width: "100%", border: "1px solid", borderColor: `${tone}.emphasis`, borderRadius: 2, overflow: "hidden", bg: "canvas.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, px: 2, py: 1, borderBottom: "1px solid", borderColor: `${tone}.muted`, bg: `${tone}.subtle`, flexShrink: 0, children: [_jsx(Box, { display: "flex", color: `${tone}.fg`, children: overA2A ? _jsx(BroadcastIcon, { size: 14 }) : _jsx(DependabotIcon, { size: 14 }) }), _jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg` }, children: overA2A ? 'A2A agent' : 'Subagent' }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: `${tone}.fg` }, children: subagentName }), remote?.launch ? (_jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg`, opacity: 0.8 }, children: remote.launch })) : null, remote ? (_jsx(Link, { as: "button", type: "button", "data-a2a-card-button": true, onClick: () => setCardOpen(true), sx: { fontSize: 0, ml: 1 }, children: "card" })) : null, _jsx(Text, { sx: { fontSize: 0, color: `${tone}.fg`, ml: 'auto' }, children: progress })] }), cardOpen && remote ? (_jsx(A2AAgentDialog, { details: remote, onClose: () => setCardOpen(false) })) : null, _jsx(Box, { flex: 1, minHeight: 0, overflowY: "auto", children: _jsx(ChatMessageList, { displayItems: displayItems, isLoading: !isDone, isStreaming: !isDone, showLoadingIndicator: !isDone, hideMessagesAfterToolUI: false, avatarConfig: avatarConfig, padding: 2, onRespond: handleRespond, messagesEndRef: messagesEndRef, emptyContent: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, color: "fg.muted", p: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { fontSize: 0 }, children: "Starting\u2026" })] }) }) })] }));
|
|
260
233
|
}
|
|
261
234
|
// ---------------------------------------------------------------------------
|
|
262
235
|
// DefaultToolCallRenderer — reads approvals from the Zustand store,
|
|
@@ -507,23 +480,17 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
507
480
|
: defaultUI;
|
|
508
481
|
if (toolUI === null || toolUI === undefined)
|
|
509
482
|
return null;
|
|
510
|
-
return (_jsx(Box, { "data-chat-tool-row": item.toolName,
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
the whole measure.
|
|
522
|
-
*/
|
|
523
|
-
width: '100%',
|
|
524
|
-
px: padding,
|
|
525
|
-
py: compact ? '2px' : 1,
|
|
526
|
-
}, children: toolUI }, item.id));
|
|
483
|
+
return (_jsx(Box, { "data-chat-tool-row": item.toolName, display: "flex", flexDirection: "column", alignItems: "flex-start",
|
|
484
|
+
/*
|
|
485
|
+
The full column. `maxWidth: '95%'` with content-driven
|
|
486
|
+
width left every tool card as wide as its longest line, so
|
|
487
|
+
a transcript of executions was a ragged stack of
|
|
488
|
+
differently-sized boxes. The default row still hugs its
|
|
489
|
+
content under `alignItems`; anything that declares
|
|
490
|
+
`width: '100%'` — the cell and output surfaces do — gets
|
|
491
|
+
the whole measure.
|
|
492
|
+
*/
|
|
493
|
+
width: "100%", px: padding, py: compact ? '2px' : 1, children: toolUI }, item.id));
|
|
527
494
|
}
|
|
528
495
|
// ---- Chat message item ----
|
|
529
496
|
const message = item;
|
|
@@ -545,20 +512,7 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
545
512
|
: message.note === 'waiting'
|
|
546
513
|
? ClockIcon
|
|
547
514
|
: SkipIcon;
|
|
548
|
-
return (_jsx(Box, {
|
|
549
|
-
display: 'inline-flex',
|
|
550
|
-
gap: 2,
|
|
551
|
-
alignItems: 'center',
|
|
552
|
-
px: 3,
|
|
553
|
-
py: 1,
|
|
554
|
-
borderRadius: 999,
|
|
555
|
-
bg: 'canvas.subtle',
|
|
556
|
-
border: '1px solid',
|
|
557
|
-
borderColor: 'border.muted',
|
|
558
|
-
color: noteColor,
|
|
559
|
-
fontSize: 0,
|
|
560
|
-
maxWidth: '90%',
|
|
561
|
-
}, children: [_jsx(NoteIcon, { size: 14 }), speaker ? (_jsx(Text, { sx: { fontWeight: 'semibold' }, children: speaker.name })) : null, _jsx(Text, { sx: { color: 'fg.muted' }, children: getMessageText(message) }), message.createdAt ? (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { color: 'fg.muted' } })) : null] }) }, message.id));
|
|
515
|
+
return (_jsx(Box, { display: "flex", justifyContent: "center", px: padding, py: 1, children: _jsxs(Box, { display: "inline-flex", gap: 2, alignItems: "center", px: 3, py: 1, borderRadius: 999, bg: "canvas.subtle", border: "1px solid", borderColor: "border.muted", color: noteColor, fontSize: 0, maxWidth: "90%", children: [_jsx(NoteIcon, { size: 14 }), speaker ? (_jsx(Text, { sx: { fontWeight: 'semibold' }, children: speaker.name })) : null, _jsx(Text, { sx: { color: 'fg.muted' }, children: getMessageText(message) }), message.createdAt ? (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { color: 'fg.muted' } })) : null] }) }, message.id));
|
|
562
516
|
}
|
|
563
517
|
// Optionally hide assistant messages that follow a rendered tool call
|
|
564
518
|
if (!isUser && hideMessagesAfterToolUI && hasRenderedToolCall) {
|
|
@@ -591,63 +545,33 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
591
545
|
}
|
|
592
546
|
}
|
|
593
547
|
}
|
|
594
|
-
return (_jsx(Box, { "data-chat-message": message.role,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
*/
|
|
618
|
-
width: '100%',
|
|
619
|
-
}, children: [avatarConfig.showAvatars && (_jsx(Box, { sx: {
|
|
620
|
-
width: avatarConfig.avatarSize,
|
|
621
|
-
height: avatarConfig.avatarSize,
|
|
622
|
-
borderRadius: '50%',
|
|
623
|
-
bg: speaker
|
|
624
|
-
? toneColorsOf(speaker.tone).emphasis
|
|
625
|
-
: isUser
|
|
626
|
-
? avatarConfig.userAvatarBg
|
|
627
|
-
: avatarConfig.assistantAvatarBg,
|
|
628
|
-
color: speaker
|
|
629
|
-
? 'fg.onEmphasis'
|
|
630
|
-
: isUser
|
|
631
|
-
? 'fg.default'
|
|
632
|
-
: 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))',
|
|
633
|
-
display: 'flex',
|
|
634
|
-
alignItems: 'center',
|
|
635
|
-
justifyContent: 'center',
|
|
636
|
-
flexShrink: 0,
|
|
637
|
-
fontSize: speaker ? 0 : undefined,
|
|
638
|
-
fontWeight: speaker ? 'bold' : undefined,
|
|
639
|
-
}, children: speaker
|
|
548
|
+
return (_jsx(Box, { "data-chat-message": message.role, display: "flex", flexDirection: "column", alignItems: isUser ? 'flex-end' : 'flex-start', px: padding, py: compact ? '2px' : 1, children: _jsxs(Box, { display: "flex", gap: 2, flexDirection: isUser ? 'row-reverse' : 'row', alignItems: "flex-start",
|
|
549
|
+
/*
|
|
550
|
+
Full width, always.
|
|
551
|
+
|
|
552
|
+
This row used to shrink to its content under the column's
|
|
553
|
+
alignment, so the bubble's `maxWidth: '85%'` resolved
|
|
554
|
+
against a parent whose width was itself the content's —
|
|
555
|
+
circular geometry that re-settled with every streamed
|
|
556
|
+
chunk, and the person's own message drifted leftward while
|
|
557
|
+
the agent was answering. A full-width row is fixed ground:
|
|
558
|
+
`row-reverse` pins the person's bubble to the right edge,
|
|
559
|
+
`row` pins the agent's to the left, and 85% means 85% of
|
|
560
|
+
the column whatever is being generated below.
|
|
561
|
+
*/
|
|
562
|
+
width: "100%", children: [avatarConfig.showAvatars && (_jsx(Box, { width: avatarConfig.avatarSize, height: avatarConfig.avatarSize, borderRadius: "50%", bg: speaker
|
|
563
|
+
? toneColorsOf(speaker.tone).emphasis
|
|
564
|
+
: isUser
|
|
565
|
+
? avatarConfig.userAvatarBg
|
|
566
|
+
: avatarConfig.assistantAvatarBg, color: speaker
|
|
567
|
+
? 'fg.onEmphasis'
|
|
568
|
+
: isUser
|
|
569
|
+
? 'fg.default'
|
|
570
|
+
: 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))', display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, fontSize: speaker ? 0 : undefined, fontWeight: speaker ? 'bold' : undefined, children: speaker
|
|
640
571
|
? speaker.initials || '?'
|
|
641
572
|
: isUser
|
|
642
573
|
? avatarConfig.userAvatar
|
|
643
|
-
: avatarConfig.assistantAvatar })), _jsxs(Box, {
|
|
644
|
-
display: 'flex',
|
|
645
|
-
gap: 2,
|
|
646
|
-
alignItems: 'baseline',
|
|
647
|
-
flexWrap: 'wrap',
|
|
648
|
-
flexDirection: isUser ? 'row-reverse' : 'row',
|
|
649
|
-
mb: 1,
|
|
650
|
-
}, children: [_jsx(Text, { sx: {
|
|
574
|
+
: avatarConfig.assistantAvatar })), _jsxs(Box, { maxWidth: compact ? '92%' : '85%', minWidth: 0, children: [speaker ? (_jsxs(Box, { display: "flex", gap: 2, alignItems: "baseline", flexWrap: "wrap", flexDirection: isUser ? 'row-reverse' : 'row', mb: 1, children: [_jsx(Text, { sx: {
|
|
651
575
|
fontWeight: 'semibold',
|
|
652
576
|
fontSize: 1,
|
|
653
577
|
color: toneColorsOf(speaker.tone).fg,
|
|
@@ -661,42 +585,29 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
661
585
|
fontWeight: 'semibold',
|
|
662
586
|
fontSize: 1,
|
|
663
587
|
color: toneColorsOf(message.directedTo.tone).fg,
|
|
664
|
-
}, children: message.directedTo.name })] })) : speaker.role ? (_jsx(Label, { size: "small", children: speaker.role })) : null, message.createdAt ? (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { fontSize: 0, color: 'fg.muted' } })) : null] })) : null, _jsxs(Box, {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
588
|
+
}, children: message.directedTo.name })] })) : speaker.role ? (_jsx(Label, { size: "small", children: speaker.role })) : null, message.createdAt ? (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { fontSize: 0, color: 'fg.muted' } })) : null] })) : null, _jsxs(Box, { p: compact ? 1 : 2, px: compact ? 2 : 2, overflowX: "auto",
|
|
589
|
+
// The theme's bubble (LOOP T-03, T-06): today's 6px elsewhere.
|
|
590
|
+
borderRadius: "bubble",
|
|
591
|
+
// A message arriving, at the theme's pace (LOOP T-10): no
|
|
592
|
+
// motion in a theme that sets none, nor when motion is reduced.
|
|
593
|
+
animation: "chatMessageArrive var(--theme-motion-message) var(--theme-motion-easing) both", reducedMotion: { animation: 'none' }, backgroundColor: isUser
|
|
594
|
+
? 'accent.emphasis'
|
|
595
|
+
: speaker
|
|
596
|
+
? toneColorsOf(speaker.tone).subtle
|
|
597
|
+
: 'canvas.subtle', border: !isUser && speaker ? '1px solid' : undefined, borderColor: !isUser && speaker
|
|
598
|
+
? toneColorsOf(speaker.tone).muted
|
|
599
|
+
: undefined,
|
|
600
|
+
// Use primary-button text token for better contrast when
|
|
601
|
+
// accent.emphasis is bright (e.g. Matrix dark theme).
|
|
602
|
+
color: isUser
|
|
603
|
+
? 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))'
|
|
604
|
+
: 'fg.default', sx: {
|
|
673
605
|
'@keyframes chatMessageArrive': {
|
|
674
606
|
from: { opacity: 0, transform: 'translateY(4px)' },
|
|
675
607
|
to: { opacity: 1, transform: 'none' },
|
|
676
608
|
},
|
|
677
|
-
'@media (prefers-reduced-motion: reduce)': {
|
|
678
|
-
animation: 'none',
|
|
679
|
-
},
|
|
680
|
-
backgroundColor: isUser
|
|
681
|
-
? 'accent.emphasis'
|
|
682
|
-
: speaker
|
|
683
|
-
? toneColorsOf(speaker.tone).subtle
|
|
684
|
-
: 'canvas.subtle',
|
|
685
|
-
border: !isUser && speaker ? '1px solid' : undefined,
|
|
686
|
-
borderColor: !isUser && speaker
|
|
687
|
-
? toneColorsOf(speaker.tone).muted
|
|
688
|
-
: undefined,
|
|
689
|
-
// Use primary-button text token for better contrast when
|
|
690
|
-
// accent.emphasis is bright (e.g. Matrix dark theme).
|
|
691
|
-
color: isUser
|
|
692
|
-
? 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))'
|
|
693
|
-
: 'fg.default',
|
|
694
609
|
...streamdownCodeBlockStyles,
|
|
695
|
-
}, children: [message.toolChips?.length ? (_jsx(Box, {
|
|
696
|
-
display: 'inline-flex',
|
|
697
|
-
gap: 1,
|
|
698
|
-
alignItems: 'center',
|
|
699
|
-
}, children: [_jsx(ToolsIcon, { size: 10 }), " ", label] }) }, `${label}-${chipIndex}`))) })) : null, isUser ? ((() => {
|
|
610
|
+
}, children: [message.toolChips?.length ? (_jsx(Box, { display: "flex", gap: 1, flexWrap: "wrap", mb: 2, children: message.toolChips.map((label, chipIndex) => (_jsx(Label, { variant: "secondary", size: "small", children: _jsxs(Box, { as: "span", display: "inline-flex", gap: 1, alignItems: "center", children: [_jsx(ToolsIcon, { size: 10 }), " ", label] }) }, `${label}-${chipIndex}`))) })) : null, isUser ? ((() => {
|
|
700
611
|
// A submitted form is drawn as the form, not as the JSON
|
|
701
612
|
// the agent reads — see `formSubmission`.
|
|
702
613
|
const text = getMessageText(message);
|
|
@@ -705,20 +616,8 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
705
616
|
fontSize: compact ? 0 : 1,
|
|
706
617
|
whiteSpace: 'pre-wrap',
|
|
707
618
|
wordBreak: 'break-word',
|
|
708
|
-
}, children: [message.metadata?.input === 'voice' ? (_jsx(Box, { as: "span", "data-spoken": "", title: "Said aloud", "aria-label": "Said aloud:",
|
|
709
|
-
|
|
710
|
-
verticalAlign: 'text-bottom',
|
|
711
|
-
mr: 1,
|
|
712
|
-
opacity: 0.85,
|
|
713
|
-
}, children: _jsx(MicrophoneIcon, { size: 14, "aria-hidden": "true" }) })) : null, text] }));
|
|
714
|
-
})()) : message.live && !getMessageText(message) ? (_jsx(TypingDots, { size: 6 })) : (_jsx(ChatMarkdown, { density: density, text: getMessageText(message) || (isStreaming ? '...' : '') }))] }), renderMessageFooter ? (_jsx(Box, { sx: {
|
|
715
|
-
display: 'flex',
|
|
716
|
-
gap: 2,
|
|
717
|
-
alignItems: 'center',
|
|
718
|
-
mt: 1,
|
|
719
|
-
flexWrap: 'wrap',
|
|
720
|
-
flexDirection: isUser ? 'row-reverse' : 'row',
|
|
721
|
-
}, children: renderMessageFooter(message) })) : null] })] }) }, message.id));
|
|
619
|
+
}, children: [message.metadata?.input === 'voice' ? (_jsx(Box, { as: "span", "data-spoken": "", title: "Said aloud", "aria-label": "Said aloud:", display: "inline-flex", verticalAlign: "text-bottom", mr: 1, opacity: 0.85, children: _jsx(MicrophoneIcon, { size: 14, "aria-hidden": "true" }) })) : null, text] }));
|
|
620
|
+
})()) : message.live && !getMessageText(message) ? (_jsx(TypingDots, { size: 6 })) : (_jsx(ChatMarkdown, { density: density, text: getMessageText(message) || (isStreaming ? '...' : '') }))] }), renderMessageFooter ? (_jsx(Box, { display: "flex", gap: 2, alignItems: "center", mt: 1, flexWrap: "wrap", flexDirection: isUser ? 'row-reverse' : 'row', children: renderMessageFooter(message) })) : null] })] }) }, message.id));
|
|
722
621
|
};
|
|
723
622
|
return (_jsxs(_Fragment, { children: [displayItems.map((item, index) => {
|
|
724
623
|
const itemUI = renderItem(item, index);
|
|
@@ -727,31 +626,5 @@ export function ChatMessageList({ displayItems, isLoading, isStreaming, showLoad
|
|
|
727
626
|
return null;
|
|
728
627
|
}
|
|
729
628
|
return (_jsxs(Fragment, { children: [itemUI, footer] }, item.id));
|
|
730
|
-
}), showLoadingIndicator && (isLoading || isStreaming) && (_jsx(Box, { "data-chat-typing": "",
|
|
731
|
-
display: 'flex',
|
|
732
|
-
alignItems: 'flex-start',
|
|
733
|
-
px: padding,
|
|
734
|
-
py: 1,
|
|
735
|
-
}, children: _jsxs(Box, { sx: {
|
|
736
|
-
display: 'flex',
|
|
737
|
-
gap: 2,
|
|
738
|
-
alignItems: 'flex-start',
|
|
739
|
-
}, children: [avatarConfig.showAvatars && (_jsx(Box, { sx: {
|
|
740
|
-
width: avatarConfig.avatarSize,
|
|
741
|
-
height: avatarConfig.avatarSize,
|
|
742
|
-
borderRadius: '50%',
|
|
743
|
-
bg: avatarConfig.assistantAvatarBg,
|
|
744
|
-
color: 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))',
|
|
745
|
-
display: 'flex',
|
|
746
|
-
alignItems: 'center',
|
|
747
|
-
justifyContent: 'center',
|
|
748
|
-
flexShrink: 0,
|
|
749
|
-
}, children: avatarConfig.assistantAvatar })), _jsx(Box, { sx: {
|
|
750
|
-
display: 'flex',
|
|
751
|
-
alignItems: 'center',
|
|
752
|
-
p: compact ? 1 : 2,
|
|
753
|
-
borderRadius: 'var(--theme-radius-bubble, 6px)',
|
|
754
|
-
bg: 'canvas.subtle',
|
|
755
|
-
minHeight: compact ? '20px' : '32px',
|
|
756
|
-
}, children: _jsx(TypingDots, {}) })] }) })), _jsx("div", { ref: messagesEndRef })] }));
|
|
629
|
+
}), showLoadingIndicator && (isLoading || isStreaming) && (_jsx(Box, { "data-chat-typing": "", display: "flex", alignItems: "flex-start", px: padding, py: 1, children: _jsxs(Box, { display: "flex", gap: 2, alignItems: "flex-start", children: [avatarConfig.showAvatars && (_jsx(Box, { width: avatarConfig.avatarSize, height: avatarConfig.avatarSize, borderRadius: "50%", bg: avatarConfig.assistantAvatarBg, color: "var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, children: avatarConfig.assistantAvatar })), _jsx(Box, { display: "flex", alignItems: "center", p: compact ? 1 : 2, borderRadius: "var(--theme-radius-bubble, 6px)", bg: "canvas.subtle", minHeight: compact ? '20px' : '32px', children: _jsx(TypingDots, {}) })] }) })), _jsx("div", { ref: messagesEndRef })] }));
|
|
757
630
|
}
|
|
@@ -54,57 +54,27 @@ export function ChatMessages({ messageRenderer, activityRenderer, showTimestamps
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
// Default rendering
|
|
57
|
-
return (_jsxs(Box, { ref: isLast ? lastMessageRef : undefined, sx: {
|
|
58
|
-
display: 'flex',
|
|
59
|
-
gap: 3,
|
|
60
|
-
p: 3,
|
|
57
|
+
return (_jsxs(Box, { ref: isLast ? lastMessageRef : undefined, display: "flex", gap: 3, p: 3, borderColor: "border.muted", bg: message.role === 'assistant' ? 'canvas.subtle' : 'canvas.default', sx: {
|
|
61
58
|
borderBottom: '1px solid',
|
|
62
|
-
borderColor: 'border.muted',
|
|
63
|
-
bg: message.role === 'assistant' ? 'canvas.subtle' : 'canvas.default',
|
|
64
59
|
'&:last-child': {
|
|
65
60
|
borderBottom: 'none',
|
|
66
61
|
},
|
|
67
|
-
}, children: [showAvatars && (_jsx(Box, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
bg: message.role === 'user'
|
|
75
|
-
? 'neutral.muted'
|
|
76
|
-
: message.role === 'assistant'
|
|
77
|
-
? 'accent.emphasis'
|
|
78
|
-
: 'attention.emphasis',
|
|
79
|
-
color: message.role === 'user'
|
|
80
|
-
? 'fg.default'
|
|
81
|
-
: 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))',
|
|
82
|
-
}, children: message.role === 'user' ? (_jsx(PersonIcon, { size: 16 })) : message.role === 'assistant' ? (_jsx(AiAgentIcon, { size: 16, color: assistantIconColor })) : (_jsx(ToolsIcon, { size: 16 })) }) })), _jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsxs(Box, { sx: {
|
|
83
|
-
display: 'flex',
|
|
84
|
-
alignItems: 'center',
|
|
85
|
-
gap: 2,
|
|
86
|
-
mb: 1,
|
|
87
|
-
}, children: [_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: message.role === 'user'
|
|
62
|
+
}, children: [showAvatars && (_jsx(Box, { flexShrink: 0, children: _jsx(Box, { width: 32, height: 32, borderRadius: "50%", display: "flex", alignItems: "center", justifyContent: "center", bg: message.role === 'user'
|
|
63
|
+
? 'neutral.muted'
|
|
64
|
+
: message.role === 'assistant'
|
|
65
|
+
? 'accent.emphasis'
|
|
66
|
+
: 'attention.emphasis', color: message.role === 'user'
|
|
67
|
+
? 'fg.default'
|
|
68
|
+
: 'var(--button-primary-fgColor-rest, var(--fgColor-onEmphasis))', children: message.role === 'user' ? (_jsx(PersonIcon, { size: 16 })) : message.role === 'assistant' ? (_jsx(AiAgentIcon, { size: 16, color: assistantIconColor })) : (_jsx(ToolsIcon, { size: 16 })) }) })), _jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, children: [_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: message.role === 'user'
|
|
88
69
|
? 'You'
|
|
89
70
|
: message.role === 'assistant'
|
|
90
71
|
? 'Assistant'
|
|
91
|
-
: 'System' }), showTimestamps && message.createdAt && (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { fontSize: 0, color: 'fg.muted' } }))] }), _jsx(Box, {
|
|
72
|
+
: 'System' }), showTimestamps && message.createdAt && (_jsx(RelativeTime, { datetime: message.createdAt.toISOString(), sx: { fontSize: 0, color: 'fg.muted' } }))] }), _jsx(Box, { fontSize: 1, lineHeight: 1.5, children: renderMessageContent(message, activityRenderer, uiPluginRegistry ?? undefined) })] })] }, message.id));
|
|
92
73
|
};
|
|
93
74
|
if (messages.length === 0) {
|
|
94
|
-
return (_jsxs(Box, { className: className, sx: {
|
|
95
|
-
display: 'flex',
|
|
96
|
-
flexDirection: 'column',
|
|
97
|
-
alignItems: 'center',
|
|
98
|
-
justifyContent: 'center',
|
|
99
|
-
height: '100%',
|
|
100
|
-
p: 4,
|
|
101
|
-
color: 'fg.muted',
|
|
102
|
-
}, children: [_jsx(AiAgentIcon, { colored: true, size: 48 }), _jsx(Text, { sx: { mt: 3, fontSize: 2 }, children: chatText.startConversation }), _jsx(Text, { sx: { mt: 1, fontSize: 1 }, children: chatText.sendToBegin })] }));
|
|
75
|
+
return (_jsxs(Box, { className: className, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", p: 4, color: "fg.muted", children: [_jsx(AiAgentIcon, { colored: true, size: 48 }), _jsx(Text, { sx: { mt: 3, fontSize: 2 }, children: chatText.startConversation }), _jsx(Text, { sx: { mt: 1, fontSize: 1 }, children: chatText.sendToBegin })] }));
|
|
103
76
|
}
|
|
104
|
-
return (_jsx(Box, { ref: containerRef, className: className,
|
|
105
|
-
flex: 1,
|
|
106
|
-
overflow: 'auto',
|
|
107
|
-
}, children: messages.map((message, index) => renderMessage(message, index === messages.length - 1)) }));
|
|
77
|
+
return (_jsx(Box, { ref: containerRef, className: className, flex: 1, overflow: "auto", children: messages.map((message, index) => renderMessage(message, index === messages.length - 1)) }));
|
|
108
78
|
}
|
|
109
79
|
/**
|
|
110
80
|
* Render message content based on type
|
|
@@ -117,7 +87,7 @@ function renderMessageContent(message, activityRenderer, uiPluginRegistry) {
|
|
|
117
87
|
}
|
|
118
88
|
// Array of content parts
|
|
119
89
|
if (Array.isArray(content)) {
|
|
120
|
-
return (_jsx(Box, {
|
|
90
|
+
return (_jsx(Box, { display: "flex", flexDirection: "column", gap: 2, children: content.map((part, index) => renderContentPart(part, index, activityRenderer, uiPluginRegistry)) }));
|
|
121
91
|
}
|
|
122
92
|
return null;
|
|
123
93
|
}
|
|
@@ -131,36 +101,13 @@ function renderContentPart(part, index, activityRenderer, uiPluginRegistry) {
|
|
|
131
101
|
case 'image':
|
|
132
102
|
return (_jsx(Box, { children: _jsx("img", { src: part.url, alt: part.alt || 'Image', style: { maxWidth: '100%', borderRadius: '8px' } }) }, index));
|
|
133
103
|
case 'tool-call':
|
|
134
|
-
return (_jsxs(Box, { sx: {
|
|
135
|
-
p: 2,
|
|
136
|
-
bg: 'canvas.subtle',
|
|
137
|
-
borderRadius: 2,
|
|
138
|
-
border: '1px solid',
|
|
139
|
-
borderColor: 'border.default',
|
|
140
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 1 }, children: [_jsx(ToolsIcon, { size: 16 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0 }, children: ["Tool: ", part.toolName] })] }), _jsx(Box, { as: "pre", sx: {
|
|
141
|
-
fontSize: 0,
|
|
142
|
-
overflow: 'auto',
|
|
143
|
-
m: 0,
|
|
144
|
-
p: 2,
|
|
145
|
-
bg: 'canvas.inset',
|
|
146
|
-
borderRadius: 1,
|
|
147
|
-
}, children: JSON.stringify(part.args, null, 2) })] }, index));
|
|
104
|
+
return (_jsxs(Box, { p: 2, bg: "canvas.subtle", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, children: [_jsx(ToolsIcon, { size: 16 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0 }, children: ["Tool: ", part.toolName] })] }), _jsx(Box, { as: "pre", fontSize: 0, overflow: "auto", m: 0, p: 2, bg: "canvas.inset", borderRadius: 1, children: JSON.stringify(part.args, null, 2) })] }, index));
|
|
148
105
|
case 'tool-result': {
|
|
149
106
|
const result = part.result;
|
|
150
107
|
const isSuccess = result && typeof result === 'object' && 'success' in result
|
|
151
108
|
? result.success
|
|
152
109
|
: true;
|
|
153
|
-
return (_jsxs(Box, { sx: {
|
|
154
|
-
p: 2,
|
|
155
|
-
bg: isSuccess ? 'success.subtle' : 'danger.subtle',
|
|
156
|
-
borderRadius: 2,
|
|
157
|
-
border: '1px solid',
|
|
158
|
-
borderColor: isSuccess ? 'success.muted' : 'danger.muted',
|
|
159
|
-
}, children: [_jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0, mb: 1 }, children: ["Result: ", part.toolName] }), _jsx(Box, { as: "pre", sx: {
|
|
160
|
-
fontSize: 0,
|
|
161
|
-
overflow: 'auto',
|
|
162
|
-
m: 0,
|
|
163
|
-
}, children: result?.error || JSON.stringify(result, null, 2) })] }, index));
|
|
110
|
+
return (_jsxs(Box, { p: 2, bg: isSuccess ? 'success.subtle' : 'danger.subtle', borderRadius: 2, border: "1px solid", borderColor: isSuccess ? 'success.muted' : 'danger.muted', children: [_jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0, mb: 1 }, children: ["Result: ", part.toolName] }), _jsx(Box, { as: "pre", fontSize: 0, overflow: "auto", m: 0, children: result?.error || JSON.stringify(result, null, 2) })] }, index));
|
|
164
111
|
}
|
|
165
112
|
case 'activity':
|
|
166
113
|
// Check for custom renderer
|
|
@@ -182,18 +129,7 @@ function renderContentPart(part, index, activityRenderer, uiPluginRegistry) {
|
|
|
182
129
|
}
|
|
183
130
|
}
|
|
184
131
|
// Default activity rendering
|
|
185
|
-
return (_jsxs(Box, { sx: {
|
|
186
|
-
p: 2,
|
|
187
|
-
bg: 'accent.subtle',
|
|
188
|
-
borderRadius: 2,
|
|
189
|
-
border: '1px solid',
|
|
190
|
-
borderColor: 'accent.muted',
|
|
191
|
-
}, children: [_jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0 }, children: ["Activity: ", part.activityType] }), part.data != null && (_jsx(Box, { as: "pre", sx: {
|
|
192
|
-
fontSize: 0,
|
|
193
|
-
overflow: 'auto',
|
|
194
|
-
mt: 1,
|
|
195
|
-
m: 0,
|
|
196
|
-
}, children: String(typeof part.data === 'object'
|
|
132
|
+
return (_jsxs(Box, { p: 2, bg: "accent.subtle", borderRadius: 2, border: "1px solid", borderColor: "accent.muted", children: [_jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 0 }, children: ["Activity: ", part.activityType] }), part.data != null && (_jsx(Box, { as: "pre", fontSize: 0, overflow: "auto", mt: 1, m: 0, children: String(typeof part.data === 'object'
|
|
197
133
|
? JSON.stringify(part.data, null, 2)
|
|
198
134
|
: part.data) }))] }, index));
|
|
199
135
|
default:
|