@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
|
@@ -8,42 +8,11 @@ export function FormSubmissionMessage({ submission, }) {
|
|
|
8
8
|
const [expanded, setExpanded] = useState(true);
|
|
9
9
|
const entries = Object.entries(submission.values);
|
|
10
10
|
const count = entries.length;
|
|
11
|
-
return (_jsxs(Box, { sx: {
|
|
12
|
-
width: '100%',
|
|
13
|
-
minWidth: 280,
|
|
14
|
-
border: '1px solid',
|
|
15
|
-
borderColor: 'border.default',
|
|
16
|
-
borderRadius: '12px',
|
|
17
|
-
overflow: 'hidden',
|
|
18
|
-
backgroundColor: 'canvas.default',
|
|
19
|
-
color: 'fg.default',
|
|
20
|
-
}, children: [_jsxs(Box, { as: "button", type: "button", "aria-expanded": expanded, onClick: () => setExpanded(value => !value), sx: {
|
|
21
|
-
width: '100%',
|
|
22
|
-
display: 'flex',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
gap: 2,
|
|
25
|
-
padding: 2,
|
|
26
|
-
backgroundColor: 'canvas.subtle',
|
|
27
|
-
border: 'none',
|
|
28
|
-
borderBottom: expanded ? '1px solid' : 'none',
|
|
29
|
-
borderColor: 'border.default',
|
|
30
|
-
cursor: 'pointer',
|
|
31
|
-
textAlign: 'left',
|
|
32
|
-
color: 'fg.default',
|
|
33
|
-
'&:hover': { backgroundColor: 'neutral.muted' },
|
|
34
|
-
}, children: [_jsx(Box, { sx: { color: 'fg.muted', flexShrink: 0 }, children: expanded ? (_jsx(ChevronDownIcon, { size: 16 })) : (_jsx(ChevronRightIcon, { size: 16 })) }), _jsx(Box, { sx: { color: 'fg.muted', flexShrink: 0 }, children: _jsx(ChecklistIcon, { size: 16 }) }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: ["Submitted ", submission.title] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', ml: 'auto' }, children: [count, " field", count === 1 ? '' : 's'] })] }), expanded ? (_jsx(Box, { as: "table", sx: { width: '100%', borderCollapse: 'collapse' }, children: _jsx(Box, { as: "tbody", children: entries.map(([id, value]) => (_jsxs(Box, { as: "tr", sx: {
|
|
11
|
+
return (_jsxs(Box, { width: "100%", minWidth: 280, border: "1px solid", borderColor: "border.default", borderRadius: "12px", overflow: "hidden", backgroundColor: "canvas.default", color: "fg.default", children: [_jsxs(Box, { as: "button", type: "button", "aria-expanded": expanded, onClick: () => setExpanded(value => !value), width: "100%", display: "flex", alignItems: "center", gap: 2, padding: 2, backgroundColor: "canvas.subtle", border: "none", borderBottom: expanded ? '1px solid' : 'none', borderColor: "border.default", cursor: "pointer", textAlign: "left", color: "fg.default", hover: { backgroundColor: 'neutral.muted' }, children: [_jsx(Box, { color: "fg.muted", flexShrink: 0, children: expanded ? (_jsx(ChevronDownIcon, { size: 16 })) : (_jsx(ChevronRightIcon, { size: 16 })) }), _jsx(Box, { color: "fg.muted", flexShrink: 0, children: _jsx(ChecklistIcon, { size: 16 }) }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: ["Submitted ", submission.title] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', ml: 'auto' }, children: [count, " field", count === 1 ? '' : 's'] })] }), expanded ? (_jsx(Box, { as: "table", width: "100%", borderCollapse: "collapse", children: _jsx(Box, { as: "tbody", children: entries.map(([id, value]) => (_jsxs(Box, { as: "tr", sx: {
|
|
35
12
|
'& + tr td': {
|
|
36
13
|
borderTop: '1px solid',
|
|
37
14
|
borderColor: 'border.muted',
|
|
38
15
|
},
|
|
39
|
-
}, children: [_jsx(Box, { as: "td",
|
|
40
|
-
px: 3,
|
|
41
|
-
py: 1,
|
|
42
|
-
fontSize: 0,
|
|
43
|
-
color: 'fg.muted',
|
|
44
|
-
whiteSpace: 'nowrap',
|
|
45
|
-
verticalAlign: 'top',
|
|
46
|
-
width: '40%',
|
|
47
|
-
}, children: labelOfFieldId(id) }), _jsx(Box, { as: "td", sx: { px: 3, py: 1, fontSize: 1, wordBreak: 'break-word' }, children: displayValue(value) })] }, id))) }) })) : null] }));
|
|
16
|
+
}, children: [_jsx(Box, { as: "td", px: 3, py: 1, fontSize: 0, color: "fg.muted", whiteSpace: "nowrap", verticalAlign: "top", width: "40%", children: labelOfFieldId(id) }), _jsx(Box, { as: "td", px: 3, py: 1, fontSize: 1, wordBreak: "break-word", children: displayValue(value) })] }, id))) }) })) : null] }));
|
|
48
17
|
}
|
|
49
18
|
export default FormSubmissionMessage;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { Box
|
|
3
|
+
import { Box } from '@datalayer/primer-addons';
|
|
4
|
+
import { Text } from '@primer/react';
|
|
4
5
|
import { Cell, Output, OutputViewer, notebookStore, } from '@datalayer/jupyter-react';
|
|
5
6
|
import { decode } from '@toon-format/toon';
|
|
6
7
|
/**
|
|
@@ -239,27 +240,14 @@ export function NotebookToolSurfaces({ documentId, context, }) {
|
|
|
239
240
|
// its default rendering untouched.
|
|
240
241
|
return (_jsxs(_Fragment, { children: [defaultUI, liveOutputs || outputs ? (
|
|
241
242
|
/* An execution's outputs, and nothing else — see above. */
|
|
242
|
-
_jsxs(Box, {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
width: '100%',
|
|
247
|
-
border: '1px solid',
|
|
248
|
-
borderColor: 'border.default',
|
|
249
|
-
borderRadius: 2,
|
|
250
|
-
overflow: 'hidden',
|
|
251
|
-
bg: 'canvas.default',
|
|
252
|
-
}, children: [_jsx(Box, { sx: {
|
|
253
|
-
px: 2,
|
|
254
|
-
py: 1,
|
|
255
|
-
bg: 'canvas.subtle',
|
|
256
|
-
borderBottom: '1px solid',
|
|
257
|
-
borderColor: 'border.muted',
|
|
258
|
-
}, children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Output \u00B7", ' ', status === 'executing'
|
|
243
|
+
_jsxs(Box, { mt: 1,
|
|
244
|
+
// The full column, not the content's own width: a surface sized
|
|
245
|
+
// to its longest line reads as a fragment.
|
|
246
|
+
width: "100%", border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", bg: "canvas.default", children: [_jsx(Box, { px: 2, py: 1, bg: "canvas.subtle", borderBottom: "1px solid", borderColor: "border.muted", children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Output \u00B7", ' ', status === 'executing'
|
|
259
247
|
? 'executing…'
|
|
260
248
|
: status === 'error'
|
|
261
249
|
? 'stopped'
|
|
262
|
-
: 'executed'] }) }), _jsx(Box, {
|
|
250
|
+
: 'executed'] }) }), _jsx(Box, { p: 2, children: liveOutputs ? (
|
|
263
251
|
/* The adapter's live mirror of the run: the area follows the
|
|
264
252
|
model, so each line lands here the moment the kernel prints
|
|
265
253
|
it — mounted from the first render of `executing`, before
|
|
@@ -269,28 +257,11 @@ export function NotebookToolSurfaces({ documentId, context, }) {
|
|
|
269
257
|
Drawn as a surface, the way the A2UI example presents an execution:
|
|
270
258
|
a captioned card, the change first, the outputs after.
|
|
271
259
|
*/
|
|
272
|
-
_jsxs(Box, {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
border: '1px solid',
|
|
278
|
-
borderColor: 'border.default',
|
|
279
|
-
borderRadius: 2,
|
|
280
|
-
overflow: 'hidden',
|
|
281
|
-
bg: 'canvas.default',
|
|
282
|
-
}, children: [_jsx(Box, { sx: {
|
|
283
|
-
px: 2,
|
|
284
|
-
py: 1,
|
|
285
|
-
bg: 'canvas.subtle',
|
|
286
|
-
borderBottom: '1px solid',
|
|
287
|
-
borderColor: 'border.muted',
|
|
288
|
-
}, children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [index !== undefined ? `Cell ${index}` : 'Cell', ' · ', TOOL_VERBS[shortName] ?? shortName] }) }), _jsx(Cell, { readOnly: true, type: cellModel.type ?? 'code', source: cellModel.sharedModel.getSource(), outputs: [] }), cellOutputsModel &&
|
|
289
|
-
(status === 'executing' || cellOutputsModel.length > 0) ? (_jsx(Box, { sx: {
|
|
290
|
-
borderTop: '1px solid',
|
|
291
|
-
borderColor: 'border.muted',
|
|
292
|
-
p: 2,
|
|
293
|
-
}, children: _jsx(Output, { id: `${context.toolCallId}-outputs`, model: cellOutputsModel, showControl: false, showEditor: false, autoRun: false }) })) : null] })) : null] }));
|
|
260
|
+
_jsxs(Box, { mt: 1,
|
|
261
|
+
// The full column, not the content's own width: a surface sized
|
|
262
|
+
// to its longest line reads as a fragment.
|
|
263
|
+
width: "100%", border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", bg: "canvas.default", children: [_jsx(Box, { px: 2, py: 1, bg: "canvas.subtle", borderBottom: "1px solid", borderColor: "border.muted", children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [index !== undefined ? `Cell ${index}` : 'Cell', ' · ', TOOL_VERBS[shortName] ?? shortName] }) }), _jsx(Cell, { readOnly: true, type: cellModel.type ?? 'code', source: cellModel.sharedModel.getSource(), outputs: [] }), cellOutputsModel &&
|
|
264
|
+
(status === 'executing' || cellOutputsModel.length > 0) ? (_jsx(Box, { borderTop: "1px solid", borderColor: "border.muted", p: 2, children: _jsx(Output, { id: `${context.toolCallId}-outputs`, model: cellOutputsModel, showControl: false, showEditor: false, autoRun: false }) })) : null] })) : null] }));
|
|
294
265
|
}
|
|
295
266
|
/**
|
|
296
267
|
* The renderer `ChatBase` mounts when a host names a notebook: the default
|
|
@@ -52,15 +52,9 @@ export function TurnFooter({ usage, live, latest, padding, onCopy, onRemove, })
|
|
|
52
52
|
}
|
|
53
53
|
copiedTimer.current = window.setTimeout(() => setCopied(false), 1500);
|
|
54
54
|
};
|
|
55
|
-
return (_jsxs(Box, { "data-turn-footer": "",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
gap: 1,
|
|
59
|
-
px: padding,
|
|
60
|
-
// Tucked against the turn it accounts for, not opening a new band.
|
|
61
|
-
mt: -1,
|
|
62
|
-
pb: 1,
|
|
63
|
-
minHeight: 24,
|
|
55
|
+
return (_jsxs(Box, { "data-turn-footer": "", display: "flex", alignItems: "center", gap: 1, px: padding,
|
|
56
|
+
// Tucked against the turn it accounts for, not opening a new band.
|
|
57
|
+
mt: -1, pb: 1, minHeight: 24, sx: {
|
|
64
58
|
// Barely there until wanted.
|
|
65
59
|
opacity: 0.55,
|
|
66
60
|
transition: 'opacity 0.15s ease',
|
|
@@ -72,6 +66,6 @@ export function TurnFooter({ usage, live, latest, padding, onCopy, onRemove, })
|
|
|
72
66
|
'&:hover [data-turn-actions], &:focus-within [data-turn-actions]': {
|
|
73
67
|
opacity: 1,
|
|
74
68
|
},
|
|
75
|
-
}, children: [record && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', flexShrink: 0 }, children: [_jsx(Text, { as: "span", sx: { fontWeight: 'semibold', color: 'fg.default', fontSize: 0 }, children: formatTokenCount(record.contextTokens) }), ' / ', formatTokenCount(record.contextWindow), ' ctx · turn ', formatTokenCount(record.inputTokens), _jsx(Text, { as: "span", sx: { color: 'success.fg', fontSize: 0 }, children: '▲' }), ' ', formatTokenCount(record.outputTokens), _jsx(Text, { as: "span", sx: { color: 'attention.fg', fontSize: 0 }, children: '▼' })] })), !live && (_jsxs(Box, { "data-turn-actions": "",
|
|
69
|
+
}, children: [record && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', flexShrink: 0 }, children: [_jsx(Text, { as: "span", sx: { fontWeight: 'semibold', color: 'fg.default', fontSize: 0 }, children: formatTokenCount(record.contextTokens) }), ' / ', formatTokenCount(record.contextWindow), ' ctx · turn ', formatTokenCount(record.inputTokens), _jsx(Text, { as: "span", sx: { color: 'success.fg', fontSize: 0 }, children: '▲' }), ' ', formatTokenCount(record.outputTokens), _jsx(Text, { as: "span", sx: { color: 'attention.fg', fontSize: 0 }, children: '▼' })] })), !live && (_jsxs(Box, { "data-turn-actions": "", display: "flex", alignItems: "center", children: [_jsx(IconButton, { "data-turn-copy": "", icon: copied ? CheckIcon : CopyIcon, "aria-label": chatText.copyTurn, size: "small", variant: "invisible", onClick: () => void handleCopy() }), _jsx(IconButton, { "data-turn-remove": "", icon: TrashIcon, "aria-label": chatText.removeTurn, size: "small", variant: "invisible", onClick: onRemove })] }))] }));
|
|
76
70
|
}
|
|
77
71
|
export default TurnFooter;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { ServerConnection, ServiceManager } from '@jupyterlab/services';
|
|
4
|
-
import { DatalayerThemeProvider, getThemeConfig, useSystemColorMode, useThemeStore, } from '@datalayer/primer-addons';
|
|
5
|
-
import { Box } from '@primer/react';
|
|
4
|
+
import { Box, DatalayerThemeProvider, getThemeConfig, useSystemColorMode, useThemeStore, } from '@datalayer/primer-addons';
|
|
6
5
|
import { Notebook, NotebookToolbar, CellSidebarExtension, CellSidebarButton, JupyterReactTheme, notebookStore, disposeServiceManager, useJupyterLabCssLoaded, } from '@datalayer/jupyter-react';
|
|
7
6
|
import { useAgentsRuntimes } from '../../hooks/useAgentRuntimes';
|
|
8
7
|
import { useResumeServerExecutions } from '../../jupyter/useResumeServerExecutions';
|
|
@@ -380,14 +379,7 @@ export function EphemeralNotebook({ notebookId, runtimeName, runtimeOverride, se
|
|
|
380
379
|
* ephemeral notebooks on one sandbox from sharing a session.
|
|
381
380
|
*/
|
|
382
381
|
const sessionPath = useMemo(() => `.datalayer/${notebookId}.ipynb`, [notebookId]);
|
|
383
|
-
return (_jsx(Box, { sx: {
|
|
384
|
-
flex: 1,
|
|
385
|
-
minHeight: 0,
|
|
386
|
-
height: '100%',
|
|
387
|
-
position: 'relative',
|
|
388
|
-
overflow: 'hidden',
|
|
389
|
-
bg: 'canvas.default',
|
|
390
|
-
}, children: activeServiceManager && notebookReady ? (_jsx(ThemeRoot, { inherit: inheritTheme, colorMode: effectiveColorMode, themeConfig: themeConfig, children: _jsx(JupyterReactTheme, { colormode: resolvedMode, backgroundColor: themeBackground, children: _jsx(Box, { sx: {
|
|
382
|
+
return (_jsx(Box, { flex: 1, minHeight: 0, height: "100%", position: "relative", overflow: "hidden", bg: "canvas.default", children: activeServiceManager && notebookReady ? (_jsx(ThemeRoot, { inherit: inheritTheme, colorMode: effectiveColorMode, themeConfig: themeConfig, children: _jsx(JupyterReactTheme, { colormode: resolvedMode, backgroundColor: themeBackground, children: _jsx(Box, { sx: {
|
|
391
383
|
position: 'absolute',
|
|
392
384
|
inset: 0,
|
|
393
385
|
display: 'flex',
|
|
@@ -35,7 +35,7 @@ export function ReasoningPart({ text, isStreaming }) {
|
|
|
35
35
|
return () => clearTimeout(timer);
|
|
36
36
|
}
|
|
37
37
|
}, [isStreaming, isExpanded]);
|
|
38
|
-
return (_jsxs(Box, {
|
|
38
|
+
return (_jsxs(Box, { marginBottom: 3, children: [_jsxs(Button, { variant: "invisible", size: "small", onClick: () => setIsExpanded(!isExpanded), sx: {
|
|
39
39
|
width: '100%',
|
|
40
40
|
display: 'flex',
|
|
41
41
|
gap: 2,
|
|
@@ -48,20 +48,6 @@ export function ReasoningPart({ text, isStreaming }) {
|
|
|
48
48
|
'&:hover': {
|
|
49
49
|
color: 'fg.default',
|
|
50
50
|
},
|
|
51
|
-
}, children: [_jsx(Text, { sx: { fontSize: 1 }, children: "\uD83E\uDDE0" }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'normal' }, children: isStreaming ? 'Thinking...' : 'Reasoning' }), _jsx(Box, { as: "span", sx: {
|
|
52
|
-
display: 'inline-flex',
|
|
53
|
-
marginLeft: 'auto',
|
|
54
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
55
|
-
transition: 'transform 0.2s',
|
|
56
|
-
}, children: _jsx(ChevronDownIcon, {}) })] }), isExpanded && (_jsx(Box, { sx: {
|
|
57
|
-
marginTop: 2,
|
|
58
|
-
padding: 3,
|
|
59
|
-
backgroundColor: 'canvas.inset',
|
|
60
|
-
borderRadius: 2,
|
|
61
|
-
border: '1px solid',
|
|
62
|
-
borderColor: 'border.default',
|
|
63
|
-
color: 'fg.muted',
|
|
64
|
-
...streamdownMarkdownStyles,
|
|
65
|
-
}, children: _jsx(Streamdown, { children: text }) }))] }));
|
|
51
|
+
}, children: [_jsx(Text, { sx: { fontSize: 1 }, children: "\uD83E\uDDE0" }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'normal' }, children: isStreaming ? 'Thinking...' : 'Reasoning' }), _jsx(Box, { as: "span", display: "inline-flex", marginLeft: "auto", transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: _jsx(ChevronDownIcon, {}) })] }), isExpanded && (_jsx(Box, { marginTop: 2, padding: 3, backgroundColor: "canvas.inset", borderRadius: 2, border: "1px solid", borderColor: "border.default", color: "fg.muted", sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: text }) }))] }));
|
|
66
52
|
}
|
|
67
53
|
export default ReasoningPart;
|
|
@@ -19,21 +19,11 @@ export function TextPart({ text, message, isLastPart, onRegenerate, }) {
|
|
|
19
19
|
console.error('Error copying text:', error);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
return (_jsxs(Box, { sx: {
|
|
23
|
-
padding: 3,
|
|
24
|
-
borderRadius: 2,
|
|
25
|
-
backgroundColor: message.role === 'user' ? 'accent.subtle' : 'canvas.subtle',
|
|
26
|
-
marginBottom: 2,
|
|
27
|
-
}, children: [_jsxs(Box, { sx: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
justifyContent: 'space-between',
|
|
30
|
-
alignItems: 'flex-start',
|
|
31
|
-
marginBottom: 2,
|
|
32
|
-
}, children: [_jsx(Text, { sx: {
|
|
22
|
+
return (_jsxs(Box, { padding: 3, borderRadius: 2, backgroundColor: message.role === 'user' ? 'accent.subtle' : 'canvas.subtle', marginBottom: 2, children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: 2, children: [_jsx(Text, { sx: {
|
|
33
23
|
fontWeight: 'bold',
|
|
34
24
|
fontSize: 1,
|
|
35
25
|
color: 'fg.muted',
|
|
36
26
|
textTransform: 'uppercase',
|
|
37
|
-
}, children: message.role === 'user' ? 'You' : 'Assistant' }), message.role === 'assistant' && isLastPart && (_jsxs(Box, {
|
|
27
|
+
}, children: message.role === 'user' ? 'You' : 'Assistant' }), message.role === 'assistant' && isLastPart && (_jsxs(Box, { display: "flex", gap: 1, children: [_jsx(IconButton, { icon: SyncIcon, "aria-label": "Regenerate", size: "small", variant: "invisible", onClick: () => onRegenerate(message.id) }), _jsx(IconButton, { icon: CopyIcon, "aria-label": "Copy", size: "small", variant: "invisible", onClick: () => copy(text) })] }))] }), _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: text }) })] }));
|
|
38
28
|
}
|
|
39
29
|
export default TextPart;
|
|
@@ -103,13 +103,7 @@ export function ToolPart({ part }) {
|
|
|
103
103
|
part.output.stderr ??
|
|
104
104
|
undefined)
|
|
105
105
|
: undefined);
|
|
106
|
-
return (_jsxs(Box, { sx: {
|
|
107
|
-
marginBottom: 2,
|
|
108
|
-
border: '1px solid',
|
|
109
|
-
borderColor: 'border.default',
|
|
110
|
-
borderRadius: 2,
|
|
111
|
-
overflow: 'hidden',
|
|
112
|
-
}, children: [_jsxs(Button, { variant: "invisible", onClick: () => setIsExpanded(!isExpanded), sx: {
|
|
106
|
+
return (_jsxs(Box, { marginBottom: 2, border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", children: [_jsxs(Button, { variant: "invisible", onClick: () => setIsExpanded(!isExpanded), sx: {
|
|
113
107
|
width: '100%',
|
|
114
108
|
display: 'flex',
|
|
115
109
|
justifyContent: 'space-between',
|
|
@@ -124,27 +118,9 @@ export function ToolPart({ part }) {
|
|
|
124
118
|
'&:hover': {
|
|
125
119
|
backgroundColor: 'neutral.muted',
|
|
126
120
|
},
|
|
127
|
-
}, children: [_jsxs(Box, {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
gap: 1,
|
|
131
|
-
paddingX: 2,
|
|
132
|
-
paddingY: 1,
|
|
133
|
-
borderRadius: 2,
|
|
134
|
-
backgroundColor: 'neutral.subtle',
|
|
135
|
-
fontSize: 0,
|
|
136
|
-
}, children: [_jsx(Text, { sx: { color: statusInfo.color }, children: statusInfo.icon }), _jsx(Text, { sx: { color: statusInfo.color, fontWeight: 'semibold' }, children: statusInfo.label })] })] }), _jsx(Box, { as: "span", sx: {
|
|
137
|
-
display: 'inline-flex',
|
|
138
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
139
|
-
transition: 'transform 0.2s',
|
|
140
|
-
}, children: _jsx(ChevronDownIcon, {}) })] }), isExpanded && (_jsxs(Box, { children: [_jsxs(Box, { sx: {
|
|
141
|
-
padding: 3,
|
|
142
|
-
borderBottom: part.state === 'output-available' ||
|
|
143
|
-
part.state === 'output-error'
|
|
144
|
-
? '1px solid'
|
|
145
|
-
: 'none',
|
|
146
|
-
borderColor: 'border.default',
|
|
147
|
-
}, children: [_jsx(Text, { sx: {
|
|
121
|
+
}, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [hasMark(marks) && (_jsx(Box, { display: "flex", color: "fg.muted", children: _jsx(SpecMark, { icon: marks?.icon, emoji: marks?.emoji, size: 14 }) })), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: toolName }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, paddingX: 2, paddingY: 1, borderRadius: 2, backgroundColor: "neutral.subtle", fontSize: 0, children: [_jsx(Text, { sx: { color: statusInfo.color }, children: statusInfo.icon }), _jsx(Text, { sx: { color: statusInfo.color, fontWeight: 'semibold' }, children: statusInfo.label })] })] }), _jsx(Box, { as: "span", display: "inline-flex", transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: _jsx(ChevronDownIcon, {}) })] }), isExpanded && (_jsxs(Box, { children: [_jsxs(Box, { padding: 3, borderBottom: part.state === 'output-available' || part.state === 'output-error'
|
|
122
|
+
? '1px solid'
|
|
123
|
+
: 'none', borderColor: "border.default", children: [_jsx(Text, { sx: {
|
|
148
124
|
display: 'block',
|
|
149
125
|
fontSize: 0,
|
|
150
126
|
fontWeight: 'semibold',
|
|
@@ -152,20 +128,14 @@ export function ToolPart({ part }) {
|
|
|
152
128
|
textTransform: 'uppercase',
|
|
153
129
|
letterSpacing: '0.05em',
|
|
154
130
|
marginBottom: 2,
|
|
155
|
-
}, children: "Parameters" }), _jsx(Box, {
|
|
156
|
-
backgroundColor: 'canvas.inset',
|
|
157
|
-
borderRadius: 2,
|
|
158
|
-
overflow: 'auto',
|
|
159
|
-
border: '1px solid',
|
|
160
|
-
borderColor: 'border.default',
|
|
161
|
-
}, children: _jsx("pre", { style: {
|
|
131
|
+
}, children: "Parameters" }), _jsx(Box, { backgroundColor: "canvas.inset", borderRadius: 2, overflow: "auto", border: "1px solid", borderColor: "border.default", children: _jsx("pre", { style: {
|
|
162
132
|
margin: 0,
|
|
163
133
|
padding: '12px',
|
|
164
134
|
fontSize: '12px',
|
|
165
135
|
fontFamily: 'monospace',
|
|
166
136
|
lineHeight: 1.5,
|
|
167
137
|
overflow: 'auto',
|
|
168
|
-
}, children: JSON.stringify(part.input, null, 2) }) })] }), part.state === 'output-available' && (_jsxs(Box, {
|
|
138
|
+
}, children: JSON.stringify(part.input, null, 2) }) })] }), part.state === 'output-available' && (_jsxs(Box, { padding: 3, children: [_jsx(Text, { sx: {
|
|
169
139
|
display: 'block',
|
|
170
140
|
fontSize: 0,
|
|
171
141
|
fontWeight: 'semibold',
|
|
@@ -173,13 +143,7 @@ export function ToolPart({ part }) {
|
|
|
173
143
|
textTransform: 'uppercase',
|
|
174
144
|
letterSpacing: '0.05em',
|
|
175
145
|
marginBottom: 2,
|
|
176
|
-
}, children: "Result" }), _jsx(Box, {
|
|
177
|
-
backgroundColor: 'canvas.default',
|
|
178
|
-
borderRadius: 2,
|
|
179
|
-
overflow: 'auto',
|
|
180
|
-
border: '1px solid',
|
|
181
|
-
borderColor: 'border.default',
|
|
182
|
-
}, children: _jsx("pre", { style: {
|
|
146
|
+
}, children: "Result" }), _jsx(Box, { backgroundColor: "canvas.default", borderRadius: 2, overflow: "auto", border: "1px solid", borderColor: "border.default", children: _jsx("pre", { style: {
|
|
183
147
|
margin: 0,
|
|
184
148
|
padding: '12px',
|
|
185
149
|
fontSize: '12px',
|
|
@@ -190,7 +154,7 @@ export function ToolPart({ part }) {
|
|
|
190
154
|
? typeof part.output === 'string'
|
|
191
155
|
? part.output
|
|
192
156
|
: JSON.stringify(part.output, null, 2)
|
|
193
|
-
: 'No output' }) })] })), executionResult && !executionResult.execution_ok && (_jsxs(Box, {
|
|
157
|
+
: 'No output' }) })] })), executionResult && !executionResult.execution_ok && (_jsxs(Box, { padding: 3, children: [_jsxs(Text, { sx: {
|
|
194
158
|
display: 'block',
|
|
195
159
|
fontSize: 0,
|
|
196
160
|
fontWeight: 'semibold',
|
|
@@ -198,14 +162,7 @@ export function ToolPart({ part }) {
|
|
|
198
162
|
textTransform: 'uppercase',
|
|
199
163
|
letterSpacing: '0.05em',
|
|
200
164
|
marginBottom: 2,
|
|
201
|
-
}, children: [_jsx(AlertIcon, { size: 12 }), " Execution Error"] }), _jsxs(Box, { sx: {
|
|
202
|
-
backgroundColor: 'danger.subtle',
|
|
203
|
-
borderRadius: 2,
|
|
204
|
-
overflow: 'auto',
|
|
205
|
-
border: '1px solid',
|
|
206
|
-
borderColor: 'danger.muted',
|
|
207
|
-
padding: 2,
|
|
208
|
-
}, children: [_jsx(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: executionResult.execution_error ||
|
|
165
|
+
}, children: [_jsx(AlertIcon, { size: 12 }), " Execution Error"] }), _jsxs(Box, { backgroundColor: "danger.subtle", borderRadius: 2, overflow: "auto", border: "1px solid", borderColor: "danger.muted", padding: 2, children: [_jsx(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: executionResult.execution_error ||
|
|
209
166
|
'Sandbox execution failed' }), _jsx(Text, { sx: {
|
|
210
167
|
display: 'block',
|
|
211
168
|
fontSize: 0,
|
|
@@ -213,7 +170,7 @@ export function ToolPart({ part }) {
|
|
|
213
170
|
marginTop: 1,
|
|
214
171
|
}, children: "The sandbox or execution environment failed to run the code." })] })] })), executionResult &&
|
|
215
172
|
executionResult.execution_ok &&
|
|
216
|
-
executionResult.code_error && (_jsxs(Box, {
|
|
173
|
+
executionResult.code_error && (_jsxs(Box, { padding: 3, children: [_jsxs(Text, { sx: {
|
|
217
174
|
display: 'block',
|
|
218
175
|
fontSize: 0,
|
|
219
176
|
fontWeight: 'semibold',
|
|
@@ -221,17 +178,7 @@ export function ToolPart({ part }) {
|
|
|
221
178
|
textTransform: 'uppercase',
|
|
222
179
|
letterSpacing: '0.05em',
|
|
223
180
|
marginBottom: 2,
|
|
224
|
-
}, children: ["Code Error: ", executionResult.code_error.name] }), _jsxs(Box, { sx: {
|
|
225
|
-
backgroundColor: 'severe.subtle',
|
|
226
|
-
borderRadius: 2,
|
|
227
|
-
overflow: 'hidden',
|
|
228
|
-
border: '1px solid',
|
|
229
|
-
borderColor: 'severe.muted',
|
|
230
|
-
}, children: [_jsx(Box, { sx: { padding: 2 }, children: _jsx(Text, { sx: { fontSize: 0, color: 'severe.fg' }, children: executionResult.code_error.value }) }), executionResult.code_error.traceback && (_jsx(Box, { sx: {
|
|
231
|
-
borderTop: '1px solid',
|
|
232
|
-
borderColor: 'severe.muted',
|
|
233
|
-
backgroundColor: 'canvas.inset',
|
|
234
|
-
}, children: _jsx("pre", { style: {
|
|
181
|
+
}, children: ["Code Error: ", executionResult.code_error.name] }), _jsxs(Box, { backgroundColor: "severe.subtle", borderRadius: 2, overflow: "hidden", border: "1px solid", borderColor: "severe.muted", children: [_jsx(Box, { padding: 2, children: _jsx(Text, { sx: { fontSize: 0, color: 'severe.fg' }, children: executionResult.code_error.value }) }), executionResult.code_error.traceback && (_jsx(Box, { borderTop: "1px solid", borderColor: "severe.muted", backgroundColor: "canvas.inset", children: _jsx("pre", { style: {
|
|
235
182
|
margin: 0,
|
|
236
183
|
padding: '8px 12px',
|
|
237
184
|
fontSize: '11px',
|
|
@@ -245,7 +192,7 @@ export function ToolPart({ part }) {
|
|
|
245
192
|
executionResult.execution_ok &&
|
|
246
193
|
!executionResult.code_error &&
|
|
247
194
|
executionResult.exit_code != null &&
|
|
248
|
-
executionResult.exit_code !== 0 && (_jsxs(Box, {
|
|
195
|
+
executionResult.exit_code !== 0 && (_jsxs(Box, { padding: 3, children: [_jsx(Text, { sx: {
|
|
249
196
|
display: 'block',
|
|
250
197
|
fontSize: 0,
|
|
251
198
|
fontWeight: 'semibold',
|
|
@@ -253,26 +200,12 @@ export function ToolPart({ part }) {
|
|
|
253
200
|
textTransform: 'uppercase',
|
|
254
201
|
letterSpacing: '0.05em',
|
|
255
202
|
marginBottom: 2,
|
|
256
|
-
}, children: "Process Exited" }), _jsxs(Box, { sx: {
|
|
257
|
-
backgroundColor: 'attention.subtle',
|
|
258
|
-
borderRadius: 2,
|
|
259
|
-
overflow: 'hidden',
|
|
260
|
-
border: '1px solid',
|
|
261
|
-
borderColor: 'attention.muted',
|
|
262
|
-
padding: 2,
|
|
263
|
-
}, children: [_jsxs(Text, { sx: { fontSize: 0, color: 'attention.fg' }, children: ["Process exited with code ", executionResult.exit_code] }), _jsx(Text, { sx: {
|
|
203
|
+
}, children: "Process Exited" }), _jsxs(Box, { backgroundColor: "attention.subtle", borderRadius: 2, overflow: "hidden", border: "1px solid", borderColor: "attention.muted", padding: 2, children: [_jsxs(Text, { sx: { fontSize: 0, color: 'attention.fg' }, children: ["Process exited with code ", executionResult.exit_code] }), _jsx(Text, { sx: {
|
|
264
204
|
display: 'block',
|
|
265
205
|
fontSize: 0,
|
|
266
206
|
color: 'fg.muted',
|
|
267
207
|
marginTop: 1,
|
|
268
|
-
}, children: "The code called sys.exit() with a non-zero exit code." }), effectiveExitOutput && (_jsx(Box, {
|
|
269
|
-
mt: 2,
|
|
270
|
-
backgroundColor: 'canvas.inset',
|
|
271
|
-
borderRadius: 2,
|
|
272
|
-
border: '1px solid',
|
|
273
|
-
borderColor: 'attention.muted',
|
|
274
|
-
overflow: 'auto',
|
|
275
|
-
}, children: _jsx("pre", { style: {
|
|
208
|
+
}, children: "The code called sys.exit() with a non-zero exit code." }), effectiveExitOutput && (_jsx(Box, { mt: 2, backgroundColor: "canvas.inset", borderRadius: 2, border: "1px solid", borderColor: "attention.muted", overflow: "auto", children: _jsx("pre", { style: {
|
|
276
209
|
margin: 0,
|
|
277
210
|
padding: '10px 12px',
|
|
278
211
|
fontSize: '12px',
|
|
@@ -284,7 +217,7 @@ export function ToolPart({ part }) {
|
|
|
284
217
|
}, children: effectiveExitOutput }) }))] })] })), part.state === 'output-error' &&
|
|
285
218
|
'errorText' in part &&
|
|
286
219
|
part.errorText &&
|
|
287
|
-
!executionResult && (_jsxs(Box, {
|
|
220
|
+
!executionResult && (_jsxs(Box, { padding: 3, children: [_jsx(Text, { sx: {
|
|
288
221
|
display: 'block',
|
|
289
222
|
fontSize: 0,
|
|
290
223
|
fontWeight: 'semibold',
|
|
@@ -292,13 +225,6 @@ export function ToolPart({ part }) {
|
|
|
292
225
|
textTransform: 'uppercase',
|
|
293
226
|
letterSpacing: '0.05em',
|
|
294
227
|
marginBottom: 2,
|
|
295
|
-
}, children: "Error" }), _jsx(Box, { sx: {
|
|
296
|
-
backgroundColor: 'danger.subtle',
|
|
297
|
-
borderRadius: 2,
|
|
298
|
-
overflow: 'auto',
|
|
299
|
-
border: '1px solid',
|
|
300
|
-
borderColor: 'danger.muted',
|
|
301
|
-
padding: 2,
|
|
302
|
-
}, children: _jsx(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: part.errorText }) })] }))] }))] }));
|
|
228
|
+
}, children: "Error" }), _jsx(Box, { backgroundColor: "danger.subtle", borderRadius: 2, overflow: "auto", border: "1px solid", borderColor: "danger.muted", padding: 2, children: _jsx(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: part.errorText }) })] }))] }))] }));
|
|
303
229
|
}
|
|
304
230
|
export default ToolPart;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box
|
|
2
|
+
import { Box } from '@datalayer/primer-addons';
|
|
3
|
+
import { Text } from '@primer/react';
|
|
3
4
|
import { FluentEmoji } from '@datalayer/core/lib/components/emoji';
|
|
4
5
|
import { PRESENCE_LINES } from './presenceStatus';
|
|
5
|
-
const ACCENT = 'var(--
|
|
6
|
+
const ACCENT = 'var(--theme-accent)';
|
|
6
7
|
/**
|
|
7
8
|
* A face at `size`: an emoji drawn in Fluent Emoji, the same on every
|
|
8
9
|
* platform (LOOP T-20) — the system's, as text, only for one Datalayer ships
|
|
@@ -14,41 +15,12 @@ export function FaceDrawing({ face, size }) {
|
|
|
14
15
|
export function PresenceFace({ face, size, state, }) {
|
|
15
16
|
const active = state === 'thinking' || state === 'working';
|
|
16
17
|
const paused = state === 'paused';
|
|
17
|
-
return (_jsxs(Box, { as: "span", "aria-hidden": true, "data-presence": state, sx: {
|
|
18
|
-
position: 'relative',
|
|
19
|
-
display: 'inline-flex',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
justifyContent: 'center',
|
|
22
|
-
width: size + 8,
|
|
23
|
-
height: size + 8,
|
|
24
|
-
flexShrink: 0,
|
|
25
|
-
fontSize: size,
|
|
26
|
-
lineHeight: 1,
|
|
27
|
-
}, children: [_jsx(Box, { as: "span", sx: {
|
|
28
|
-
position: 'absolute',
|
|
29
|
-
inset: 0,
|
|
30
|
-
borderRadius: '50%',
|
|
31
|
-
boxShadow: paused ? 'none' : `0 0 0 2px ${ACCENT}`,
|
|
32
|
-
border: paused ? '2px dashed' : 'none',
|
|
33
|
-
borderColor: 'border.default',
|
|
34
|
-
opacity: active || state === 'waiting' || paused ? 0.9 : 0,
|
|
35
|
-
transition: 'opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)',
|
|
36
|
-
animation: active
|
|
37
|
-
? 'loopPresenceBreath 1.8s ease-in-out infinite'
|
|
38
|
-
: 'none',
|
|
18
|
+
return (_jsxs(Box, { as: "span", "aria-hidden": true, "data-presence": state, position: "relative", display: "inline-flex", alignItems: "center", justifyContent: "center", width: size + 8, height: size + 8, flexShrink: 0, fontSize: size, lineHeight: 1, children: [_jsx(Box, { as: "span", position: "absolute", inset: 0, borderRadius: "50%", boxShadow: paused ? 'none' : `0 0 0 2px ${ACCENT}`, border: paused ? '2px dashed' : 'none', borderColor: "border.default", opacity: active || state === 'waiting' || paused ? 0.9 : 0, transition: "opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)", animation: active ? 'loopPresenceBreath 1.8s ease-in-out infinite' : 'none', reducedMotion: { animation: 'none' }, sx: {
|
|
39
19
|
'@keyframes loopPresenceBreath': {
|
|
40
20
|
'0%, 100%': { transform: 'scale(0.92)', opacity: 0.35 },
|
|
41
21
|
'50%': { transform: 'scale(1.06)', opacity: 0.9 },
|
|
42
22
|
},
|
|
43
|
-
|
|
44
|
-
animation: 'none',
|
|
45
|
-
},
|
|
46
|
-
} }), _jsx(Box, { as: "span", sx: {
|
|
47
|
-
display: 'inline-flex',
|
|
48
|
-
opacity: paused ? 0.55 : 1,
|
|
49
|
-
filter: paused ? 'grayscale(0.6)' : 'none',
|
|
50
|
-
transition: 'opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)',
|
|
51
|
-
}, children: _jsx(FaceDrawing, { face: face, size: size }) })] }));
|
|
23
|
+
} }), _jsx(Box, { as: "span", display: "inline-flex", opacity: paused ? 0.55 : 1, filter: paused ? 'grayscale(0.6)' : 'none', transition: "opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)", children: _jsx(FaceDrawing, { face: face, size: size }) })] }));
|
|
52
24
|
}
|
|
53
25
|
export function PresenceLine({ state }) {
|
|
54
26
|
return (_jsx(Text, { role: "status", "aria-live": "polite", "data-presence-line": state, sx: {
|
|
@@ -63,18 +63,6 @@ export function FloatingCard({ children, anchor = 'bottom', }) {
|
|
|
63
63
|
borderRadius: 2,
|
|
64
64
|
boxShadow: 'shadow.large',
|
|
65
65
|
overflow: 'hidden',
|
|
66
|
-
}, children: [_jsx(Box, { onPointerDown: onHandlePointerDown, "aria-label": "Move the prompt",
|
|
67
|
-
display: 'flex',
|
|
68
|
-
alignItems: 'center',
|
|
69
|
-
justifyContent: 'center',
|
|
70
|
-
height: 18,
|
|
71
|
-
cursor: 'grab',
|
|
72
|
-
color: 'fg.subtle',
|
|
73
|
-
bg: 'canvas.subtle',
|
|
74
|
-
borderBottom: '1px solid',
|
|
75
|
-
borderColor: 'border.muted',
|
|
76
|
-
touchAction: 'none',
|
|
77
|
-
'&:active': { cursor: 'grabbing' },
|
|
78
|
-
}, children: _jsx(GrabberIcon, { size: 16 }) }), children] }));
|
|
66
|
+
}, children: [_jsx(Box, { onPointerDown: onHandlePointerDown, "aria-label": "Move the prompt", display: "flex", alignItems: "center", justifyContent: "center", height: 18, cursor: "grab", color: "fg.subtle", bg: "canvas.subtle", borderBottom: "1px solid", borderColor: "border.muted", active: { cursor: 'grabbing' }, touchAction: "none", children: _jsx(GrabberIcon, { size: 16 }) }), children] }));
|
|
79
67
|
}
|
|
80
68
|
export default FloatingCard;
|
|
@@ -148,12 +148,7 @@ export function InputPrompt({ input, setInput, isLoading, kernelStatus, connecti
|
|
|
148
148
|
content: (_jsx(_Fragment, { children: anyOffered || extrasOffered || suggestionsOffered ? (_jsxs(_Fragment, { children: [agentsOffered && (_jsx(AgentsMenu, { agents: agents, selectedAgentId: selectedAgentId, onSelectAgent: onSelectAgent })), toolsOffered && (_jsx(ToolsMenu, { codemodeEnabled: codemodeEnabled, onToggleCodemode: onToggleCodemode, mcpServers: mcpServers, enabledMcpTools: enabledMcpTools, enabledMcpToolCount: enabledMcpToolCount, onToggleMcpTool: onToggleMcpTool, onToggleAllMcpServerTools: onToggleAllMcpServerTools, approvedMcpTools: approvedMcpTools, onToggleMcpToolApproval: onToggleMcpToolApproval, availableTools: availableTools, availableFrontendTools: availableFrontendTools })), skillsOffered && (_jsx(SkillsMenu, { skills: skills, skillsLoading: skillsLoading, enabledSkills: enabledSkills, onToggleSkill: onToggleSkill, onToggleAllSkills: onToggleAllSkills, approvedSkills: approvedSkills, onToggleSkillApproval: onToggleSkillApproval })), modelsOffered && (_jsx(ModelSelector, { models: models, decisions: decisions, selectedModel: selectedModel, onModelSelect: onModelSelect, isA2AProtocol: isA2AProtocol })), suggestionsOffered && (_jsx(SuggestionsMenu, { suggestions: suggestionItems, onPick: text => {
|
|
149
149
|
setInput(text);
|
|
150
150
|
setPickedFocus(n => n + 1);
|
|
151
|
-
} })), extrasOffered && (_jsx(Box, { sx: {
|
|
152
|
-
marginLeft: 'auto',
|
|
153
|
-
display: 'inline-flex',
|
|
154
|
-
alignItems: 'center',
|
|
155
|
-
gap: 1,
|
|
156
|
-
}, children: footerExtras }))] })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading controls..." })) })),
|
|
151
|
+
} })), extrasOffered && (_jsx(Box, { marginLeft: "auto", display: "inline-flex", alignItems: "center", gap: 1, children: footerExtras }))] })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Loading controls..." })) })),
|
|
157
152
|
},
|
|
158
153
|
]
|
|
159
154
|
: [] }), trailingPanel] }));
|
|
@@ -177,16 +177,7 @@ export function InputPromptBase({ variant = 'lexical', placeholder = 'Ask anythi
|
|
|
177
177
|
onStop?.();
|
|
178
178
|
}, [onStop]);
|
|
179
179
|
// ---- Render ------------------------------------------------------------
|
|
180
|
-
return (_jsx(Box, { sx: sx, children: _jsx(Box, {
|
|
181
|
-
p: padding,
|
|
182
|
-
...(showBorderTop && {
|
|
183
|
-
borderTop: '1px solid',
|
|
184
|
-
borderColor: 'border.default',
|
|
185
|
-
}),
|
|
186
|
-
...(showBackground && {
|
|
187
|
-
bg: 'canvas.subtle',
|
|
188
|
-
}),
|
|
189
|
-
}, children: _jsxs(Box
|
|
180
|
+
return (_jsx(Box, { sx: sx, children: _jsx(Box, { p: padding, borderTop: showBorderTop ? '1px solid' : undefined, borderColor: showBorderTop ? 'border.default' : undefined, bg: showBackground ? 'canvas.subtle' : undefined, children: _jsxs(Box
|
|
190
181
|
// Named so the turn-end refocus can ask whether the caret is already
|
|
191
182
|
// somewhere inside this prompt before it reaches for it.
|
|
192
183
|
, {
|
|
@@ -209,14 +200,10 @@ export function InputPromptBase({ variant = 'lexical', placeholder = 'Ask anythi
|
|
|
209
200
|
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
210
201
|
setFocused(false);
|
|
211
202
|
}
|
|
212
|
-
},
|
|
213
|
-
|
|
203
|
+
}, border: "1px solid",
|
|
204
|
+
// The theme's card (LOOP T-03, T-06): today's 6px elsewhere.
|
|
205
|
+
borderRadius: "var(--theme-radius-card, 6px)", bg: "canvas.default", overflow: "hidden", transition: "border-color 0.2s ease", sx: {
|
|
214
206
|
borderColor: 'border.default',
|
|
215
|
-
// The theme's card (LOOP T-03, T-06): today's 6px elsewhere.
|
|
216
|
-
borderRadius: 'var(--theme-radius-card, 6px)',
|
|
217
|
-
bg: 'canvas.default',
|
|
218
|
-
overflow: 'hidden',
|
|
219
|
-
transition: 'border-color 0.2s ease',
|
|
220
207
|
'&:focus-within': {
|
|
221
208
|
borderColor: 'accent.fg',
|
|
222
209
|
boxShadow: (t) => `0 0 0 1px ${t?.colors?.accent?.fg ?? '#16A085'}`,
|