@datalayer/agent-runtimes 1.3.89 → 1.3.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Agent.js +2 -18
- package/lib/AgentDocument.js +5 -55
- package/lib/AgentNode.js +31 -208
- package/lib/AgentNotebook.js +5 -59
- package/lib/agent-node/AgentNodeGallery.js +23 -111
- package/lib/agents/AgentDetails.js +36 -274
- package/lib/agents/AgentRuntimeChat.js +1 -8
- package/lib/chat/Chat.js +7 -46
- package/lib/chat/ChatFloating.js +15 -100
- package/lib/chat/ChatInline.js +5 -47
- package/lib/chat/ChatPopupStandalone.js +5 -53
- package/lib/chat/ChatSidebar.js +4 -51
- package/lib/chat/ChatStandalone.js +4 -45
- package/lib/chat/EphemeralSurfaceControl.js +5 -25
- package/lib/chat/assistant/AssistantContextMenu.d.ts +8 -0
- package/lib/chat/assistant/AssistantContextMenu.js +17 -1
- package/lib/chat/assistant/AssistantStage.js +6 -25
- package/lib/chat/assistant/BalloonParts.js +8 -40
- package/lib/chat/assistant/BalloonVisual.js +2 -2
- package/lib/chat/assistant/ConversationBalloon.js +2 -11
- package/lib/chat/assistant/DecisionAsk.js +3 -3
- package/lib/chat/assistant/SandboxDetailsDialog.js +3 -17
- package/lib/chat/assistant/SpeechBalloon.js +14 -78
- package/lib/chat/base/ChatBase.js +37 -172
- package/lib/chat/display/EmptyState.js +7 -35
- package/lib/chat/display/FloatingBrandButton.js +4 -34
- package/lib/chat/display/PoweredByTag.js +3 -14
- package/lib/chat/document/EphemeralDocument.js +3 -18
- package/lib/chat/header/ChatHeader.js +1 -17
- package/lib/chat/header/ChatHeaderBase.js +2 -24
- package/lib/chat/header/ChatViewModeToggle.js +7 -29
- package/lib/chat/indicators/McpStatusIndicator.js +3 -12
- package/lib/chat/indicators/SandboxStatusIndicator.js +6 -34
- package/lib/chat/indicators/SkillsStatusIndicator.js +3 -12
- package/lib/chat/indicators/TypingDots.js +1 -11
- package/lib/chat/messages/ChatMessageList.js +58 -185
- package/lib/chat/messages/ChatMessages.js +15 -79
- package/lib/chat/messages/FormSubmissionMessage.js +2 -33
- package/lib/chat/messages/NotebookToolSurfaces.js +12 -41
- package/lib/chat/messages/TurnFooter.js +4 -10
- package/lib/chat/notebook/EphemeralNotebook.js +2 -10
- package/lib/chat/parts/ReasoningPart.js +2 -16
- package/lib/chat/parts/TextPart.js +2 -12
- package/lib/chat/parts/ToolPart.js +16 -90
- package/lib/chat/presence/Presence.js +5 -33
- package/lib/chat/prompt/FloatingCard.js +1 -13
- package/lib/chat/prompt/InputPrompt.js +1 -6
- package/lib/chat/prompt/InputPromptBase.js +4 -17
- package/lib/chat/prompt/InputPromptLexical.js +44 -45
- package/lib/chat/prompt/InputPromptText.js +1 -1
- package/lib/chat/prompt/footer/InPromptFooter.js +1 -8
- package/lib/chat/prompt/menus/AgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/InlineAgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/ModelSelector.js +1 -5
- package/lib/chat/prompt/menus/SkillsMenu.js +3 -30
- package/lib/chat/prompt/menus/SuggestionsMenu.js +1 -1
- package/lib/chat/prompt/menus/ToolsMenu.js +4 -48
- package/lib/chat/prompt/plugins/AgentMentionPlugin.js +2 -9
- package/lib/chat/prompt/plugins/CommandPlugin.js +2 -9
- package/lib/chat/prompt/plugins/MentionChip.js +1 -15
- package/lib/chat/prompt/stack.js +1 -19
- package/lib/chat/tools/A2AAgentDialog.js +9 -42
- package/lib/chat/tools/SubagentActivity.js +5 -22
- package/lib/chat/tools/ToolApprovalBanner.js +4 -34
- package/lib/chat/tools/ToolApprovalDialog.js +4 -19
- package/lib/chat/tools/ToolCallDisplay.js +12 -97
- package/lib/chat/usage/ContextPie.js +4 -45
- package/lib/components/a2ui/datalayer/Chart.js +4 -10
- package/lib/components/a2ui/datalayer/Chat.js +2 -10
- package/lib/components/a2ui/datalayer/Download.js +1 -1
- package/lib/components/a2ui/datalayer/Evidence.js +1 -15
- package/lib/components/a2ui/datalayer/FileUpload.js +1 -12
- package/lib/components/a2ui/datalayer/Table.js +9 -17
- package/lib/components/a2ui/datalayer/formWidgets.js +3 -2
- package/lib/components/a2ui/datalayer/parts.js +1 -16
- package/lib/components/agents/AgentSummary.js +1 -51
- package/lib/components/cards/NotificationEventCard.js +6 -72
- package/lib/components/cards/OutputCard.js +4 -48
- package/lib/components/cards/ToolApprovalCard.js +2 -35
- package/lib/components/code-sandboxes/CodeSandboxCellVariables.js +1 -1
- package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +4 -14
- package/lib/components/code-sandboxes/CodeSandboxPicker.js +16 -21
- package/lib/components/code-sandboxes/CodeSandboxVariables.js +2 -2
- package/lib/components/scheduler/ScheduleMenu.js +5 -10
- package/lib/components/specs/SpecPayloadPreview.js +1 -26
- package/lib/components/teams/A2ATeamGraph.d.ts +4 -3
- package/lib/components/teams/A2ATeamGraph.js +25 -71
- package/lib/components/teams/AnswerSurfacesView.js +2 -2
- package/lib/components/teams/NotebookPreview.js +1 -10
- package/lib/components/teams/NotebookPreviewView.js +2 -3
- package/lib/components/teams/SceneTranscript.js +3 -17
- package/lib/components/teams/SceneView.js +1 -8
- package/lib/components/teams/TeamNotebook.js +5 -13
- package/lib/components/teams/TeamNotebookView.js +2 -12
- package/lib/components/teams/index.d.ts +1 -0
- package/lib/components/teams/index.js +1 -0
- package/lib/components/teams/useBalloonRoom.d.ts +39 -0
- package/lib/components/teams/useBalloonRoom.js +89 -0
- package/lib/config/AgentConfiguration.js +22 -225
- package/lib/context/ContextDistribution.js +7 -41
- package/lib/context/ContextInspector.js +9 -107
- package/lib/context/ContextPanel.js +11 -86
- package/lib/context/ContextUsage.js +6 -34
- package/lib/context/CostTracker.js +7 -42
- package/lib/context/MessageHistory.js +3 -37
- package/lib/context/TurnGraphChart.js +9 -41
- package/lib/examples/A2UiAgentExample.js +6 -108
- package/lib/examples/A2UiComponentsGalleryExample.js +1 -1
- package/lib/examples/A2UiContactCardExample.js +1 -1
- package/lib/examples/A2UiJupyterOutputExample.js +25 -125
- package/lib/examples/A2UiRestaurantExample.js +1 -1
- package/lib/examples/A2UiViewerExample.js +1 -1
- package/lib/examples/AgUiAgenticExample.js +3 -35
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -25
- package/lib/examples/AgUiHaikuGenUiExample.js +2 -32
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -59
- package/lib/examples/AgUiSharedStateExample.js +6 -56
- package/lib/examples/AgUiToolsBasedGenUiExample.js +25 -120
- package/lib/examples/AgentA2AExample.js +1 -15
- package/lib/examples/AgentA2ATeamExample.js +6 -30
- package/lib/examples/AgentCheckpointsExample.js +11 -145
- package/lib/examples/AgentCodeSandboxExample.js +5 -108
- package/lib/examples/AgentCodeSandboxesExample.js +3 -30
- package/lib/examples/AgentCodemodeExample.js +9 -85
- package/lib/examples/AgentCompactionExample.js +3 -64
- package/lib/examples/AgentDecideExample.js +1 -13
- package/lib/examples/AgentEvalsExample.js +5 -60
- package/lib/examples/AgentGuardrailsExample.js +4 -28
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +5 -96
- package/lib/examples/AgentMCPExample.js +7 -105
- package/lib/examples/AgentMemoryExample.js +5 -74
- package/lib/examples/AgentMonitoringExample.js +7 -53
- package/lib/examples/AgentNotificationsExample.js +3 -61
- package/lib/examples/AgentOtelExample.js +3 -72
- package/lib/examples/AgentOutputsExample.js +6 -81
- package/lib/examples/AgentParametersExample.js +2 -37
- package/lib/examples/AgentSkillsExample.js +3 -45
- package/lib/examples/AgentSubagentsExample.js +6 -56
- package/lib/examples/AgentToolApprovalsExample.js +1 -11
- package/lib/examples/AgentTriggersExample.js +29 -239
- package/lib/examples/AgentspecsExample.js +6 -60
- package/lib/examples/AssistantExample.js +5 -5
- package/lib/examples/AssistantGalleryExample.js +8 -65
- package/lib/examples/CellExample.js +1 -6
- package/lib/examples/ChatCustomExample.js +2 -31
- package/lib/examples/ChatExample.js +1 -9
- package/lib/examples/ChatStandaloneExample.js +3 -37
- package/lib/examples/CopilotKitLexicalExample.js +1 -24
- package/lib/examples/DecksAgent.js +1 -1
- package/lib/examples/DocumentPageAgent.js +1 -1
- package/lib/examples/HomeExample.js +14 -62
- package/lib/examples/Lexical2Example.js +3 -32
- package/lib/examples/LexicalAgentExample.js +2 -34
- package/lib/examples/LexicalAgentSidebarExample.js +3 -34
- package/lib/examples/LoopAppComputerExample.js +1 -1
- package/lib/examples/LoopShellExample.js +2 -2
- package/lib/examples/LoopStrategyExample.js +15 -87
- package/lib/examples/LoopWorkspaceEmbed.js +2 -18
- package/lib/examples/LoopWorkspaceExample.js +2 -2
- package/lib/examples/NotebookAgentExample.js +2 -33
- package/lib/examples/NotebookAgentSidebarExample.js +3 -46
- package/lib/examples/NotebookCollaborationExample.js +1 -31
- package/lib/examples/NotebookExample.js +1 -18
- package/lib/examples/NotebookPageAgent.js +1 -1
- package/lib/examples/ScenesExample.js +5 -24
- package/lib/examples/VoiceChatExample.js +1 -1
- package/lib/examples/components/AuthRequiredView.js +1 -7
- package/lib/examples/components/ErrorView.js +1 -8
- package/lib/examples/components/ExampleErrorBoundary.js +1 -14
- package/lib/examples/components/FooterMetrics.js +1 -7
- package/lib/examples/components/Header.js +12 -51
- package/lib/examples/components/HeaderControls.js +1 -9
- package/lib/examples/components/LexicalEditor.js +1 -8
- package/lib/examples/components/MainContent.js +1 -13
- package/lib/examples/components/MockFileBrowser.js +4 -40
- package/lib/examples/components/SessionTabs.js +1 -1
- package/lib/examples/components/TimeTravel.js +1 -13
- package/lib/examples/main.js +13 -81
- package/lib/examples/scenes/A2UiComponentsGalleryScene.js +3 -34
- package/lib/examples/scenes/A2UiContactCardScene.js +3 -35
- package/lib/examples/scenes/A2UiRestaurantScene.js +3 -53
- package/lib/examples/scenes/A2UiViewerScene.js +3 -34
- package/lib/examples/utils/AssistantGalleryGrid.js +6 -35
- package/lib/examples2/DatalayerNotebookExample.js +3 -33
- package/lib/examples2/NativeNavigationExample.js +4 -10
- package/lib/examples2/NotebookMutationsKernel.js +2 -1
- package/lib/examples2/NotebookMutationsServiceManager.js +2 -1
- package/lib/examples2/ReactRouterExample.js +14 -42
- package/lib/hooks/useToolApprovals.d.ts +2 -34
- package/lib/hooks/useToolApprovals.js +1 -64
- package/lib/identity/AgentIdentity.js +17 -62
- package/lib/identity/IdentityConnect.js +13 -59
- package/lib/identity/OAuthCallback.js +6 -44
- package/lib/lexical/ChatInlinePlugin.js +6 -14
- package/lib/loop/apps/AppRenderer.d.ts +4 -3
- package/lib/loop/apps/AppRenderer.js +11 -12
- package/lib/loop/apps/appspec.js +6 -3
- package/lib/loop/embed/AppEmbed.d.ts +1 -1
- package/lib/loop/embed/AppEmbed.js +2 -1
- package/lib/loop/embed/LoopEmbed.js +1 -7
- package/lib/loop/embed/embedConfig.d.ts +3 -3
- package/lib/loop/embed/embedConfig.js +2 -3
- package/lib/loop/embed/embedTheme.d.ts +4 -4
- package/lib/loop/embed/embedTheme.js +11 -7
- package/lib/loop/plugins/a2a-sidebar/A2ASidebar.js +7 -34
- package/lib/loop/plugins/a2ui/A2uiView.js +4 -12
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +1 -16
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +2 -12
- package/lib/loop/plugins/agents/AnonymousKeyBadge.js +3 -2
- package/lib/loop/plugins/agents/SandboxSelector.js +3 -7
- package/lib/loop/plugins/agents/SandboxView.js +4 -27
- package/lib/loop/plugins/agents/TeamMemberPicker.js +2 -2
- package/lib/loop/plugins/agentspecs/AgentspecPicker.js +3 -2
- package/lib/loop/plugins/app-activity/AppActivity.js +1 -1
- package/lib/loop/plugins/app-computer/AppComputer.js +5 -21
- package/lib/loop/plugins/app-elements/AppElements.js +2 -31
- package/lib/loop/plugins/app-page/AppPage.js +1 -1
- package/lib/loop/plugins/app-rules/AppRulesCard.js +4 -20
- package/lib/loop/plugins/assistant/index.js +1 -13
- package/lib/loop/plugins/chat/ChatView.js +40 -106
- package/lib/loop/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -13
- package/lib/loop/plugins/decks/DeckSurface.js +2 -2
- package/lib/loop/plugins/document/DocumentView.js +4 -12
- package/lib/loop/plugins/document-toolbar/SandboxStatusItem.js +3 -8
- package/lib/loop/plugins/graph/GraphView.js +2 -2
- package/lib/loop/plugins/input-prompt/ComposerView.js +1 -1
- package/lib/loop/plugins/notebook/NotebookView.js +3 -11
- package/lib/loop/plugins/page-layout/SplitLayout.js +11 -34
- package/lib/loop/plugins/page-layout/TurnPanel.js +9 -35
- package/lib/loop/plugins/shell/useEditorPreviews.js +3 -2
- package/lib/loop/plugins/subagent-activity/SubagentPulse.js +1 -13
- package/lib/loop/plugins/window-frame/WindowFrame.js +10 -44
- package/lib/loop/plugins/window-frame/index.js +1 -1
- package/lib/loop/shell/LoopWorkspace.js +34 -77
- package/lib/loop/shell/PluginToggles.js +4 -15
- package/lib/loop/shell/SidebarRail.js +8 -40
- package/lib/loop/shell/ViewSwitcher.js +4 -24
- package/lib/loop-main.js +2 -3
- package/lib/mcp/McpServerManager.js +6 -37
- package/lib/portable/index.d.ts +11 -0
- package/lib/portable/index.js +20 -0
- package/lib/protocols/AGUIAdapter.js +2 -2
- package/lib/protocols/BaseProtocolAdapter.d.ts +2 -0
- package/lib/protocols/BaseProtocolAdapter.js +4 -0
- package/lib/specs/apps.js +6 -0
- package/lib/specs/appspecSchema.js +11 -4
- package/lib/stories/loop/ReferenceScreens.js +17 -91
- package/lib/stories/loop/pictures-main.js +1 -1
- package/lib/types/agentspecs.d.ts +5 -2
- package/lib/types/protocol.d.ts +2 -0
- package/lib/utils/approvals.d.ts +59 -0
- package/lib/utils/approvals.js +101 -0
- package/lib/voice/VoiceInput.js +3 -39
- package/package.json +2 -2
- package/lib/shims/primerAddonsBox.d.ts +0 -1
- package/lib/shims/primerAddonsBox.js +0 -7
|
@@ -19,10 +19,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
* @module components/a2ui/datalayer/formWidgets
|
|
20
20
|
*/
|
|
21
21
|
import { useState } from 'react';
|
|
22
|
-
import { Box
|
|
22
|
+
import { Box } from '@datalayer/primer-addons';
|
|
23
|
+
import { FormControl, Text, TextInputWithTokens, ToggleSwitch, } from '@primer/react';
|
|
23
24
|
/** A `boolean` as a toggle switch. */
|
|
24
25
|
export function SwitchWidget({ id, value, label, disabled, readonly, onChange, }) {
|
|
25
|
-
return (_jsxs(Box, {
|
|
26
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, children: [_jsx(Text, { as: "span", id: `${id}-label`, sx: { fontWeight: 'semibold' }, children: label }), _jsx(ToggleSwitch, { size: "small", "aria-labelledby": `${id}-label`, checked: Boolean(value), disabled: disabled || readonly, onClick: () => onChange(!value) })] }));
|
|
26
27
|
}
|
|
27
28
|
/** An `array` of `string` items as tokens: typed, then Enter or a comma. */
|
|
28
29
|
export function TagsWidget({ id, value, label, disabled, readonly, placeholder, onChange, }) {
|
|
@@ -5,22 +5,7 @@ import { Box } from '@datalayer/primer-addons';
|
|
|
5
5
|
export const CARD_RADIUS = 'var(--theme-radius-card, 6px)';
|
|
6
6
|
/** A block's frame: its title above, what it draws inside. */
|
|
7
7
|
export function BlockFrame({ title, label, weight, children, testId, }) {
|
|
8
|
-
return (_jsxs(Box, { as: "section", "aria-label": title || label, "data-testid": testId, sx: {
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
gap: 2,
|
|
12
|
-
minWidth: 0,
|
|
13
|
-
boxSizing: 'border-box',
|
|
14
|
-
p: 3,
|
|
15
|
-
border: '1px solid',
|
|
16
|
-
borderColor: 'border.default',
|
|
17
|
-
borderRadius: CARD_RADIUS,
|
|
18
|
-
bg: 'canvas.default',
|
|
19
|
-
color: 'fg.default',
|
|
20
|
-
...(typeof weight === 'number'
|
|
21
|
-
? { flex: `${weight}`, minHeight: 0 }
|
|
22
|
-
: null),
|
|
23
|
-
}, children: [title ? (_jsx(Heading, { as: "h3", sx: { fontSize: 2, m: 0 }, children: title })) : null, children] }));
|
|
8
|
+
return (_jsxs(Box, { as: "section", "aria-label": title || label, "data-testid": testId, display: "flex", flexDirection: "column", gap: 2, minWidth: 0, boxSizing: "border-box", p: 3, border: "1px solid", borderColor: "border.default", borderRadius: CARD_RADIUS, bg: "canvas.default", color: "fg.default", flex: typeof weight === 'number' ? `${weight}` : undefined, minHeight: typeof weight === 'number' ? 0 : undefined, children: [title ? (_jsx(Heading, { as: "h3", sx: { fontSize: 2, m: 0 }, children: title })) : null, children] }));
|
|
24
9
|
}
|
|
25
10
|
/** What a block says instead of what it was given, when that cannot be drawn. */
|
|
26
11
|
export function Problem({ children }) {
|
|
@@ -108,55 +108,5 @@ export const AgentSummary = ({ summary, title = 'Active Agent', }) => {
|
|
|
108
108
|
const shortAgentName = strip(summary.agentName, MAX_AGENT_NAME_LENGTH);
|
|
109
109
|
const badgeLabel = `${summary.agentName} · ${summary.location}`;
|
|
110
110
|
const badgeLabelShort = `${shortAgentName} · ${summary.location}`;
|
|
111
|
-
return (_jsxs(Box, { ref: badgeRef,
|
|
112
|
-
px: 2,
|
|
113
|
-
py: '6px',
|
|
114
|
-
maxWidth: 280,
|
|
115
|
-
minWidth: 0,
|
|
116
|
-
border: '1px solid',
|
|
117
|
-
borderColor: hasError ? 'danger.emphasis' : 'border.default',
|
|
118
|
-
borderRadius: 2,
|
|
119
|
-
bg: hasError ? 'danger.subtle' : 'canvas.default',
|
|
120
|
-
color: hasError ? 'danger.fg' : 'fg.default',
|
|
121
|
-
fontSize: 0,
|
|
122
|
-
cursor: 'default',
|
|
123
|
-
display: 'flex',
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
gap: 1,
|
|
126
|
-
}, children: [isCreating && _jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), hasError && _jsx("span", { "aria-hidden": true, children: "\u26A0" }), _jsx(Box, { as: "span", sx: {
|
|
127
|
-
display: 'block',
|
|
128
|
-
minWidth: 0,
|
|
129
|
-
overflow: 'hidden',
|
|
130
|
-
textOverflow: 'ellipsis',
|
|
131
|
-
whiteSpace: 'nowrap',
|
|
132
|
-
}, children: badgeLabelShort })] }), isHovering && (_jsxs(Box, { sx: {
|
|
133
|
-
position: 'absolute',
|
|
134
|
-
top: 'calc(100% + 8px)',
|
|
135
|
-
...(opensLeftward ? { right: 0 } : { left: 0 }),
|
|
136
|
-
width: OVERLAY_WIDTH,
|
|
137
|
-
p: 2,
|
|
138
|
-
border: '1px solid',
|
|
139
|
-
borderColor: 'border.default',
|
|
140
|
-
borderRadius: 2,
|
|
141
|
-
bg: 'canvas.overlay',
|
|
142
|
-
boxShadow: 'shadow.large',
|
|
143
|
-
zIndex: 120,
|
|
144
|
-
fontSize: 0,
|
|
145
|
-
color: 'fg.default',
|
|
146
|
-
}, children: [_jsx(Box, { sx: { mb: 1, fontWeight: 600 }, children: title }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Name: ", summary.agentName] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Location: ", summary.location] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Spec: ", summary.specId || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Harness: ", summary.harness || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Variant: ", summary.variant || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Status: ", isCreating ? 'creating' : summary.status || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Agent base URL: ", summary.baseUrl || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Code sandbox base URL:", ' ', summary.sandboxBaseUrl ? (_jsx(Box, { as: "a", href: summary.sandboxBaseUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: summary.sandboxBaseUrl })) : ('—')] }), _jsxs(Box, { sx: {
|
|
147
|
-
color: 'fg.muted',
|
|
148
|
-
wordBreak: 'break-all',
|
|
149
|
-
display: 'flex',
|
|
150
|
-
alignItems: 'center',
|
|
151
|
-
gap: 1,
|
|
152
|
-
}, children: ["Agent ID:", ' ', summary.agentId ? (summary.agentId) : isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), "Creating\u2026"] })) : ('—')] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Agent status:", ' ', hasAgent && agentStatusUrl ? (_jsx(Box, { as: "a", href: agentStatusUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: agentStatusUrl })) : ('n/a')] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Code sandbox status:", ' ', sandboxStatusUrl ? (_jsx(Box, { as: "a", href: sandboxStatusUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: sandboxStatusUrl })) : ('n/a')] }), hasError && (_jsxs(Box, { sx: {
|
|
153
|
-
mt: 1,
|
|
154
|
-
p: 1,
|
|
155
|
-
border: '1px solid',
|
|
156
|
-
borderColor: 'danger.muted',
|
|
157
|
-
borderRadius: 2,
|
|
158
|
-
bg: 'danger.subtle',
|
|
159
|
-
color: 'danger.fg',
|
|
160
|
-
wordBreak: 'break-word',
|
|
161
|
-
}, children: ["Error: ", summary.error] }))] }))] }));
|
|
111
|
+
return (_jsxs(Box, { ref: badgeRef, position: "relative", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsxs(Box, { as: "button", type: "button", title: badgeLabel, px: 2, py: "6px", maxWidth: 280, minWidth: 0, border: "1px solid", borderColor: hasError ? 'danger.emphasis' : 'border.default', borderRadius: 2, bg: hasError ? 'danger.subtle' : 'canvas.default', color: hasError ? 'danger.fg' : 'fg.default', fontSize: 0, cursor: "default", display: "flex", alignItems: "center", gap: 1, children: [isCreating && _jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), hasError && _jsx("span", { "aria-hidden": true, children: "\u26A0" }), _jsx(Box, { as: "span", display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: badgeLabelShort })] }), isHovering && (_jsxs(Box, { position: "absolute", top: "calc(100% + 8px)", width: OVERLAY_WIDTH, p: 2, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.overlay", boxShadow: "shadow.large", zIndex: 120, fontSize: 0, color: "fg.default", right: opensLeftward ? 0 : undefined, left: opensLeftward ? undefined : 0, children: [_jsx(Box, { mb: 1, fontWeight: 600, children: title }), _jsxs(Box, { color: "fg.muted", children: ["Name: ", summary.agentName] }), _jsxs(Box, { color: "fg.muted", children: ["Location: ", summary.location] }), _jsxs(Box, { color: "fg.muted", children: ["Spec: ", summary.specId || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Harness: ", summary.harness || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Variant: ", summary.variant || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Status: ", isCreating ? 'creating' : summary.status || '—'] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Agent base URL: ", summary.baseUrl || '—'] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Code sandbox base URL:", ' ', summary.sandboxBaseUrl ? (_jsx(Box, { as: "a", href: summary.sandboxBaseUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: summary.sandboxBaseUrl })) : ('—')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", display: "flex", alignItems: "center", gap: 1, children: ["Agent ID:", ' ', summary.agentId ? (summary.agentId) : isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), "Creating\u2026"] })) : ('—')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Agent status:", ' ', hasAgent && agentStatusUrl ? (_jsx(Box, { as: "a", href: agentStatusUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: agentStatusUrl })) : ('n/a')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Code sandbox status:", ' ', sandboxStatusUrl ? (_jsx(Box, { as: "a", href: sandboxStatusUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: sandboxStatusUrl })) : ('n/a')] }), hasError && (_jsxs(Box, { mt: 1, p: 1, border: "1px solid", borderColor: "danger.muted", borderRadius: 2, bg: "danger.subtle", color: "danger.fg", wordBreak: "break-word", children: ["Error: ", summary.error] }))] }))] }));
|
|
162
112
|
};
|
|
@@ -74,35 +74,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
|
|
|
74
74
|
}
|
|
75
75
|
detailEntries.push({ label: `payload.${key}`, value: String(value) });
|
|
76
76
|
});
|
|
77
|
-
return (_jsxs(Box, { sx: {
|
|
78
|
-
minWidth: 0,
|
|
79
|
-
maxWidth: '100%',
|
|
80
|
-
overflow: 'hidden',
|
|
81
|
-
p: 3,
|
|
82
|
-
borderRadius: 2,
|
|
83
|
-
border: '1px solid',
|
|
84
|
-
borderColor: event.read ? 'border.default' : 'accent.muted',
|
|
85
|
-
bg: event.read ? 'canvas.default' : 'accent.subtle',
|
|
86
|
-
}, children: [_jsxs(Box, { sx: {
|
|
87
|
-
display: 'flex',
|
|
88
|
-
justifyContent: 'space-between',
|
|
89
|
-
alignItems: 'flex-start',
|
|
90
|
-
gap: 2,
|
|
91
|
-
mb: 1,
|
|
92
|
-
minWidth: 0,
|
|
93
|
-
}, children: [_jsxs(Box, { sx: {
|
|
94
|
-
display: 'flex',
|
|
95
|
-
alignItems: 'center',
|
|
96
|
-
gap: 2,
|
|
97
|
-
minWidth: 0,
|
|
98
|
-
flex: 1,
|
|
99
|
-
}, children: [_jsx(Label, { variant: EVENT_KIND_VARIANT[eventKind] ?? 'secondary', children: eventKind }), _jsx(Truncate, { maxWidth: "50%", title: String(eventTitle || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: eventTitle }), eventKind === 'agent-output' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) })), eventOrigin && (_jsxs(Label, { variant: "secondary", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Origin: ", eventOrigin] }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [hasAgentRoute && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(runtimeId), children: "View agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { sx: {
|
|
100
|
-
fontSize: 0,
|
|
101
|
-
color: 'fg.muted',
|
|
102
|
-
mt: 1,
|
|
103
|
-
minWidth: 0,
|
|
104
|
-
overflowWrap: 'anywhere',
|
|
105
|
-
}, children: [(startedAt ||
|
|
77
|
+
return (_jsxs(Box, { minWidth: 0, maxWidth: "100%", overflow: "hidden", p: 3, borderRadius: 2, border: "1px solid", borderColor: event.read ? 'border.default' : 'accent.muted', bg: event.read ? 'canvas.default' : 'accent.subtle', children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 2, mb: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, flex: 1, children: [_jsx(Label, { variant: EVENT_KIND_VARIANT[eventKind] ?? 'secondary', children: eventKind }), _jsx(Truncate, { maxWidth: "50%", title: String(eventTitle || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: eventTitle }), eventKind === 'agent-output' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) })), eventOrigin && (_jsxs(Label, { variant: "secondary", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Origin: ", eventOrigin] }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [hasAgentRoute && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(runtimeId), children: "View agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { fontSize: 0, color: "fg.muted", mt: 1, minWidth: 0, overflowWrap: "anywhere", children: [(startedAt ||
|
|
106
78
|
endedAt ||
|
|
107
79
|
(eventKind === 'agent-output' &&
|
|
108
80
|
event.payload.duration_ms != null)) && (_jsxs(Text, { as: "p", children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) &&
|
|
@@ -111,14 +83,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
|
|
|
111
83
|
? ' · '
|
|
112
84
|
: '', eventKind === 'agent-output' && event.payload.duration_ms != null
|
|
113
85
|
? `Duration: ${formatDurationMs(Number(event.payload.duration_ms))}`
|
|
114
|
-
: ''] })), eventKind.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), eventKind.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), eventKind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, {
|
|
115
|
-
mt: 2,
|
|
116
|
-
p: 2,
|
|
117
|
-
borderRadius: 2,
|
|
118
|
-
border: '1px solid',
|
|
119
|
-
borderColor: 'border.muted',
|
|
120
|
-
bg: 'canvas.subtle',
|
|
121
|
-
}, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
|
|
86
|
+
: ''] })), eventKind.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), eventKind.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), eventKind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, { mt: 2, p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs(Box, { display: "flex", alignItems: "flex-start", gap: 1, children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
|
|
122
87
|
e.preventDefault();
|
|
123
88
|
setIsOutputExpanded(prev => !prev);
|
|
124
89
|
}, style: {
|
|
@@ -126,23 +91,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
|
|
|
126
91
|
display: 'flex',
|
|
127
92
|
alignItems: 'center',
|
|
128
93
|
minWidth: 0,
|
|
129
|
-
}, children: _jsxs(Box, { sx: {
|
|
130
|
-
display: 'flex',
|
|
131
|
-
alignItems: 'center',
|
|
132
|
-
gap: 2,
|
|
133
|
-
minWidth: 0,
|
|
134
|
-
width: '100%',
|
|
135
|
-
flexWrap: 'nowrap',
|
|
136
|
-
}, children: [_jsx(Box, { sx: {
|
|
137
|
-
display: 'flex',
|
|
138
|
-
alignItems: 'center',
|
|
139
|
-
color: 'fg.muted',
|
|
140
|
-
flexShrink: 0,
|
|
141
|
-
transition: 'transform 0.15s ease',
|
|
142
|
-
transform: isOutputExpanded
|
|
143
|
-
? 'rotate(180deg)'
|
|
144
|
-
: 'rotate(0deg)',
|
|
145
|
-
}, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
|
|
94
|
+
}, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, width: "100%", flexWrap: "nowrap", children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", flexShrink: 0, transition: "transform 0.15s ease", transform: isOutputExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
|
|
146
95
|
fontSize: 0,
|
|
147
96
|
fontWeight: 'semibold',
|
|
148
97
|
flexShrink: 0,
|
|
@@ -151,31 +100,16 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
|
|
|
151
100
|
color: 'fg.muted',
|
|
152
101
|
minWidth: 0,
|
|
153
102
|
flex: 1,
|
|
154
|
-
}, children: outputText })] }) }), _jsx(Box, {
|
|
103
|
+
}, children: outputText })] }) }), _jsx(Box, { mt: 2, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
|
|
155
104
|
const payload = createMarkdownDownloadPayload(outputText, `${runtimeId}-output`);
|
|
156
105
|
downloadTextPayload(payload);
|
|
157
|
-
}, children: _jsx(DownloadIcon, { size: 12 }) })] }) })), _jsx(Box, {
|
|
158
|
-
mt: 2,
|
|
159
|
-
p: 2,
|
|
160
|
-
borderRadius: 2,
|
|
161
|
-
border: '1px solid',
|
|
162
|
-
borderColor: 'border.muted',
|
|
163
|
-
bg: 'canvas.subtle',
|
|
164
|
-
}, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
|
|
106
|
+
}, children: _jsx(DownloadIcon, { size: 12 }) })] }) })), _jsx(Box, { mt: 2, p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
|
|
165
107
|
e.preventDefault();
|
|
166
108
|
setIsDetailsExpanded(prev => !prev);
|
|
167
109
|
}, style: {
|
|
168
110
|
cursor: 'pointer',
|
|
169
111
|
display: 'flex',
|
|
170
112
|
alignItems: 'center',
|
|
171
|
-
}, children: _jsxs(Box, {
|
|
172
|
-
display: 'flex',
|
|
173
|
-
alignItems: 'center',
|
|
174
|
-
color: 'fg.muted',
|
|
175
|
-
transition: 'transform 0.15s ease',
|
|
176
|
-
transform: isDetailsExpanded
|
|
177
|
-
? 'rotate(180deg)'
|
|
178
|
-
: 'rotate(0deg)',
|
|
179
|
-
}, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
|
|
113
|
+
}, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsx(Box, { mt: 2, display: "grid", gap: 1, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
|
|
180
114
|
}
|
|
181
115
|
export default NotificationEventCard;
|
|
@@ -23,37 +23,9 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
|
|
|
23
23
|
const startedAt = event?.started_at || event?.payload?.started_at || null;
|
|
24
24
|
const endedAt = event?.ended_at || event?.payload?.ended_at || null;
|
|
25
25
|
const durationMs = event.kind === 'agent-output' ? event.payload?.duration_ms : null;
|
|
26
|
-
return (_jsxs(Box, { sx: {
|
|
27
|
-
minWidth: 0,
|
|
28
|
-
maxWidth: '100%',
|
|
29
|
-
overflow: 'hidden',
|
|
30
|
-
p: 3,
|
|
31
|
-
borderRadius: 2,
|
|
32
|
-
border: '1px solid',
|
|
33
|
-
borderColor: event.read ? 'border.default' : 'accent.muted',
|
|
34
|
-
bg: event.read ? 'canvas.default' : 'accent.subtle',
|
|
35
|
-
}, children: [_jsxs(Box, { sx: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
justifyContent: 'space-between',
|
|
38
|
-
alignItems: 'flex-start',
|
|
39
|
-
gap: 2,
|
|
40
|
-
mb: 2,
|
|
41
|
-
minWidth: 0,
|
|
42
|
-
}, children: [_jsxs(Box, { sx: {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
gap: 2,
|
|
46
|
-
minWidth: 0,
|
|
47
|
-
flex: 1,
|
|
48
|
-
}, children: [_jsx(Label, { variant: "success", children: "output" }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || runtimeId), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title || runtimeId }), event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [event.agent_id && onOpenAgent && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), (startedAt || endedAt || durationMs != null) && (_jsxs(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) && durationMs != null ? ' · ' : '', durationMs != null
|
|
26
|
+
return (_jsxs(Box, { minWidth: 0, maxWidth: "100%", overflow: "hidden", p: 3, borderRadius: 2, border: "1px solid", borderColor: event.read ? 'border.default' : 'accent.muted', bg: event.read ? 'canvas.default' : 'accent.subtle', children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 2, mb: 2, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, flex: 1, children: [_jsx(Label, { variant: "success", children: "output" }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || runtimeId), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title || runtimeId }), event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [event.agent_id && onOpenAgent && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), (startedAt || endedAt || durationMs != null) && (_jsxs(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) && durationMs != null ? ' · ' : '', durationMs != null
|
|
49
27
|
? `Duration: ${formatDurationMs(Number(durationMs))}`
|
|
50
|
-
: ''] })), outputText && (_jsx(Box, {
|
|
51
|
-
p: 2,
|
|
52
|
-
borderRadius: 2,
|
|
53
|
-
border: '1px solid',
|
|
54
|
-
borderColor: 'border.muted',
|
|
55
|
-
bg: 'canvas.subtle',
|
|
56
|
-
}, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
|
|
28
|
+
: ''] })), outputText && (_jsx(Box, { p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs(Box, { display: "flex", alignItems: "flex-start", gap: 1, children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
|
|
57
29
|
e.preventDefault();
|
|
58
30
|
setIsOutputExpanded(prev => !prev);
|
|
59
31
|
}, style: {
|
|
@@ -61,23 +33,7 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
|
|
|
61
33
|
display: 'flex',
|
|
62
34
|
alignItems: 'center',
|
|
63
35
|
minWidth: 0,
|
|
64
|
-
}, children: _jsxs(Box, { sx: {
|
|
65
|
-
display: 'flex',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
gap: 2,
|
|
68
|
-
minWidth: 0,
|
|
69
|
-
width: '100%',
|
|
70
|
-
flexWrap: 'nowrap',
|
|
71
|
-
}, children: [_jsx(Box, { sx: {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
color: 'fg.muted',
|
|
75
|
-
flexShrink: 0,
|
|
76
|
-
transition: 'transform 0.15s ease',
|
|
77
|
-
transform: isOutputExpanded
|
|
78
|
-
? 'rotate(180deg)'
|
|
79
|
-
: 'rotate(0deg)',
|
|
80
|
-
}, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
|
|
36
|
+
}, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, width: "100%", flexWrap: "nowrap", children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", flexShrink: 0, transition: "transform 0.15s ease", transform: isOutputExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
|
|
81
37
|
fontSize: 0,
|
|
82
38
|
fontWeight: 'semibold',
|
|
83
39
|
flexShrink: 0,
|
|
@@ -86,7 +42,7 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
|
|
|
86
42
|
color: 'fg.muted',
|
|
87
43
|
minWidth: 0,
|
|
88
44
|
flex: 1,
|
|
89
|
-
}, children: outputText })] }) }), _jsx(Box, {
|
|
45
|
+
}, children: outputText })] }) }), _jsx(Box, { mt: 2, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
|
|
90
46
|
const payload = createMarkdownDownloadPayload(outputText, `${runtimeId}-output`);
|
|
91
47
|
downloadTextPayload(payload);
|
|
92
48
|
}, children: _jsx(DownloadIcon, { size: 12 }) })] }) }))] }));
|
|
@@ -43,32 +43,7 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
|
|
|
43
43
|
: approval.status === 'pending'
|
|
44
44
|
? ', review pending'
|
|
45
45
|
: `, ${statusDescriptor}`;
|
|
46
|
-
return (_jsx(Box, { sx: {
|
|
47
|
-
p: 3,
|
|
48
|
-
borderRadius: 2,
|
|
49
|
-
border: '1px solid',
|
|
50
|
-
borderColor: isRead ? 'transparent' : 'accent.muted',
|
|
51
|
-
bg: isRead ? 'canvas.default' : 'accent.subtle',
|
|
52
|
-
}, children: _jsxs(Box, { sx: {
|
|
53
|
-
display: 'flex',
|
|
54
|
-
justifyContent: 'space-between',
|
|
55
|
-
alignItems: 'flex-start',
|
|
56
|
-
gap: 3,
|
|
57
|
-
}, children: [_jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsxs(Box, { sx: {
|
|
58
|
-
display: 'flex',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
gap: 2,
|
|
61
|
-
mb: 1,
|
|
62
|
-
flexWrap: 'wrap',
|
|
63
|
-
}, children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Box, { sx: {
|
|
64
|
-
mt: 2,
|
|
65
|
-
width: '100%',
|
|
66
|
-
p: 2,
|
|
67
|
-
borderRadius: 2,
|
|
68
|
-
border: '1px solid',
|
|
69
|
-
borderColor: 'border.muted',
|
|
70
|
-
bg: 'canvas.subtle',
|
|
71
|
-
}, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
|
|
46
|
+
return (_jsx(Box, { p: 3, borderRadius: 2, border: "1px solid", borderColor: isRead ? 'transparent' : 'accent.muted', bg: isRead ? 'canvas.default' : 'accent.subtle', children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 3, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, flexWrap: "wrap", children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Box, { mt: 2, width: "100%", p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
|
|
72
47
|
e.preventDefault();
|
|
73
48
|
setIsDetailsExpanded(prev => !prev);
|
|
74
49
|
}, style: {
|
|
@@ -76,14 +51,6 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
|
|
|
76
51
|
display: 'flex',
|
|
77
52
|
alignItems: 'center',
|
|
78
53
|
minWidth: 0,
|
|
79
|
-
}, children: _jsxs(Box, { sx: { display: '
|
|
80
|
-
display: 'flex',
|
|
81
|
-
alignItems: 'center',
|
|
82
|
-
color: 'fg.muted',
|
|
83
|
-
transition: 'transform 0.15s ease',
|
|
84
|
-
transform: isDetailsExpanded
|
|
85
|
-
? 'rotate(180deg)'
|
|
86
|
-
: 'rotate(0deg)',
|
|
87
|
-
}, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { sx: { display: 'flex', gap: 2, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
|
|
54
|
+
}, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { mt: 2, display: "grid", gap: 1, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { mt: 2, display: "grid", gap: 1, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { display: "flex", gap: 2, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
|
|
88
55
|
}
|
|
89
56
|
export default ToolApprovalCard;
|
|
@@ -147,7 +147,7 @@ export function CodeSandboxCellVariables(props) {
|
|
|
147
147
|
setWillSaveOutput(false);
|
|
148
148
|
}
|
|
149
149
|
}, [willSaveOutput]);
|
|
150
|
-
return (_jsxs(Box, { as: "form",
|
|
150
|
+
return (_jsxs(Box, { as: "form", p: 3, children: [_jsxs(FormControl, { children: [_jsx(FormControl.Label, { id: "cell-input-variables", children: trans.__('Inputs') }), _jsxs(Autocomplete, { children: [_jsx(Autocomplete.Input, { as: TextInputWithTokens, tokens: inputsState.filter(item => item.selected), onTokenRemove: onTokenRemove, onChange: handleChange }), _jsx(Autocomplete.Overlay, { children: _jsx(Autocomplete.Menu, { addNewItem: filterVal &&
|
|
151
151
|
!inputsState.find(localItem => localItem.text === filterVal)
|
|
152
152
|
? {
|
|
153
153
|
id: filterVal,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Box } from '@datalayer/primer-addons';
|
|
3
|
+
import { ActionList, ActionMenu, Label, Link, Text } from '@primer/react';
|
|
3
4
|
/**
|
|
4
5
|
* The labels of an option, on one line: cost, name, provider, where.
|
|
5
6
|
*
|
|
@@ -9,12 +10,7 @@ import { ActionList, ActionMenu, Box, Label, Link, Text } from '@primer/react';
|
|
|
9
10
|
*/
|
|
10
11
|
function OptionLabels(props) {
|
|
11
12
|
const { option } = props;
|
|
12
|
-
return (_jsxs(Box, { as: "span",
|
|
13
|
-
display: 'inline-flex',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
gap: 1,
|
|
16
|
-
whiteSpace: 'nowrap',
|
|
17
|
-
}, children: [option.burningRate ? (_jsxs(Label, { size: "small", variant: "sponsors", children: [option.burningRate, " credits/second"] })) : null, option.gpu ? (_jsx(Label, { size: "small", variant: "success", children: "GPU" })) : null, option.version ? (_jsx(Label, { size: "small", variant: "secondary", children: option.version })) : null, option.sizeClass ? (_jsx(Label, { size: "small", variant: "secondary", children: option.sizeClass })) : null, option.name ? _jsx(Label, { size: "small", children: option.name }) : null, option.providerTitle ? (_jsx(Label, { size: "small", variant: "accent", children: option.providerTitle })) : null, option.location ? (_jsx(Label, { size: "small", variant: "secondary", children: option.location })) : null] }));
|
|
13
|
+
return (_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1, whiteSpace: "nowrap", children: [option.burningRate ? (_jsxs(Label, { size: "small", variant: "sponsors", children: [option.burningRate, " credits/second"] })) : null, option.gpu ? (_jsx(Label, { size: "small", variant: "success", children: "GPU" })) : null, option.version ? (_jsx(Label, { size: "small", variant: "secondary", children: option.version })) : null, option.sizeClass ? (_jsx(Label, { size: "small", variant: "secondary", children: option.sizeClass })) : null, option.name ? _jsx(Label, { size: "small", children: option.name }) : null, option.providerTitle ? (_jsx(Label, { size: "small", variant: "accent", children: option.providerTitle })) : null, option.location ? (_jsx(Label, { size: "small", variant: "secondary", children: option.location })) : null] }));
|
|
18
14
|
}
|
|
19
15
|
export function CodeSandboxEnvironmentSelect(props) {
|
|
20
16
|
const { disabled, onSelect, options, overlayWidth = 'xlarge', placeholder = 'Select an environment', selectedKey, } = props;
|
|
@@ -68,13 +64,7 @@ export function CodeSandboxEnvironmentSelect(props) {
|
|
|
68
64
|
gridTemplateColumns: 'min-content minmax(0, 1fr) min-content',
|
|
69
65
|
},
|
|
70
66
|
'& [data-component="text"]': { width: '100%', textAlign: 'left' },
|
|
71
|
-
}, children: selected ? (_jsxs(Box, { as: "span",
|
|
72
|
-
display: 'flex',
|
|
73
|
-
width: '100%',
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
justifyContent: 'space-between',
|
|
76
|
-
gap: 2,
|
|
77
|
-
}, children: [_jsx(Text, { children: selected.title }), _jsx(OptionLabels, { option: selected })] })) : (placeholder) }), _jsx(ActionMenu.Overlay, { width: overlayWidth, children: _jsx(ActionList, { selectionVariant: "single", children: grouped
|
|
67
|
+
}, children: selected ? (_jsxs(Box, { as: "span", display: "flex", width: "100%", alignItems: "center", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { children: selected.title }), _jsx(OptionLabels, { option: selected })] })) : (placeholder) }), _jsx(ActionMenu.Overlay, { width: overlayWidth, children: _jsx(ActionList, { selectionVariant: "single", children: grouped
|
|
78
68
|
? groups.map(group => (_jsxs(ActionList.Group, { children: [group ? (_jsx(ActionList.GroupHeading, { children: group })) : null, rows(priceFirst(ordered.filter(option => (option.group ?? '') === group)))] }, group || 'ungrouped')))
|
|
79
69
|
: rows(ordered) }) })] }));
|
|
80
70
|
}
|
|
@@ -129,26 +129,21 @@ export function CodeSandboxPicker(props) {
|
|
|
129
129
|
// then lists only environments to start, so it needs no group heading
|
|
130
130
|
// of its own ("Assign a new Code Sandbox" already labels the control).
|
|
131
131
|
.map(option => ({ ...option, group: undefined })), [dropdownDescs, dropdownOptions]);
|
|
132
|
-
const radioSections = (entries) => (_jsx(RadioGroup, { name: "kernel-options", "aria-labelledby": "kernel-options", children: entries.map(([group, runtimeDescs]) => (_jsxs(Box, { children: [_jsx(Box, { as: "h4",
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
marginBottom: 2,
|
|
148
|
-
color: 'fg.default',
|
|
149
|
-
fontSize: 'var(--text-body-size-medium, 0.875rem)',
|
|
150
|
-
fontWeight: 'var(--base-text-weight-semibold, 600)',
|
|
151
|
-
}, children: group }), runtimeDescs.map(k => {
|
|
132
|
+
const radioSections = (entries) => (_jsx(RadioGroup, { name: "kernel-options", "aria-labelledby": "kernel-options", children: entries.map(([group, runtimeDescs]) => (_jsxs(Box, { children: [_jsx(Box, { as: "h4",
|
|
133
|
+
/*
|
|
134
|
+
* The type of a form label, not of a heading.
|
|
135
|
+
*
|
|
136
|
+
* "Assign an existing Code Sandbox" and "Assign a
|
|
137
|
+
* new Code Sandbox" name the two ways of answering
|
|
138
|
+
* one question, and the second is the label of the
|
|
139
|
+
* dropdown; set in the larger, heavier type of an
|
|
140
|
+
* `h4`, the first read as a section above it rather
|
|
141
|
+
* than as its pair. The values are the ones Primer
|
|
142
|
+
* gives `FormControl.Label` — taken as the variables
|
|
143
|
+
* it resolves rather than through the Primer scale,
|
|
144
|
+
* whose `semibold` the JupyterLab theme redefines.
|
|
145
|
+
*/
|
|
146
|
+
margin: 0, marginBottom: 2, color: "fg.default", fontSize: "var(--text-body-size-medium, 0.875rem)", fontWeight: "var(--base-text-weight-semibold, 600)", children: group }), runtimeDescs.map(k => {
|
|
152
147
|
const choiceKey = codeSandboxDescKey(k);
|
|
153
148
|
const displayId = codeSandboxDisplayId(k);
|
|
154
149
|
return (
|
|
@@ -157,7 +152,7 @@ export function CodeSandboxPicker(props) {
|
|
|
157
152
|
// by where it runs and what it runs.
|
|
158
153
|
_jsxs(Box, { title: k.name, children: [_jsxs(FormControl, { children: [_jsx(Radio, { value: choiceKey, onChange: () => {
|
|
159
154
|
setRuntimeDesc(k);
|
|
160
|
-
}, checked: isSameCodeSandbox(k, runtimeDesc) }), _jsx(FormControl.Label, { children: _jsxs(Box, { display: "flex",
|
|
155
|
+
}, checked: isSameCodeSandbox(k, runtimeDesc) }), _jsx(FormControl.Label, { children: _jsxs(Box, { display: "flex", alignItems: "baseline", children: [_jsx(Box, { children: k.displayName }), displayId && (_jsx(Text, { sx: {
|
|
161
156
|
ml: 2,
|
|
162
157
|
fontSize: 0,
|
|
163
158
|
color: 'fg.muted',
|
|
@@ -147,10 +147,10 @@ export function CodeSandboxVariables(props) {
|
|
|
147
147
|
},
|
|
148
148
|
},
|
|
149
149
|
];
|
|
150
|
-
return (_jsxs(Box, { className: className,
|
|
150
|
+
return (_jsxs(Box, { className: className, paddingTop: "10px", children: [_jsxs(FormControl, { layout: "horizontal", children: [_jsx(FormControl.Label, { children: trans.__('Transfer variables') }), _jsx(ToggleSwitch, { checked: transferVariables, size: "small", onClick: e => {
|
|
151
151
|
e.preventDefault();
|
|
152
152
|
setTransferVariable(!transferVariables);
|
|
153
153
|
}, "aria-labelledby": "kernel-toggle-variables" })] }), transferVariables && (_jsxs(Table.Container, { sx: { flex: '1 1 auto', marginTop: 3 }, children: [_jsx(Table.Subtitle, { as: "p", id: "dla-kernel-variables-subtitle", children: trans.__('The list of transferable runtime variables.') }), kernelVariables ? (Object.keys(kernelVariables ?? {}).length ? (_jsx(DataTable, { "aria-labelledby": "dla-kernel-variables", "aria-describedby": "dla-kernel-variables-subtitle", data: Object.entries(kernelVariables ?? {})
|
|
154
154
|
.map(([name, type], id) => ({ id, name, type }))
|
|
155
|
-
.sort((a, b) => (a.name > b.name ? 1 : -1)), columns: columns, cellPadding: "condensed" })) : (_jsx(Box, {
|
|
155
|
+
.sort((a, b) => (a.name > b.name ? 1 : -1)), columns: columns, cellPadding: "condensed" })) : (_jsx(Box, { gridArea: "table", children: _jsx(Blankslate, { border: true, children: _jsx(Blankslate.Heading, { children: trans.__('No eligible variables.') }) }) }))) : (_jsx(Table.Skeleton, { "aria-labelledby": "dla-kernel-variables", "aria-describedby": "dla-kernel-variables-subtitle", columns: columns, rows: 5 }))] }))] }));
|
|
156
156
|
}
|
|
@@ -4,7 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* Distributed under the terms of the Modified BSD License.
|
|
5
5
|
*/
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { Box } from '@datalayer/primer-addons';
|
|
8
|
+
import { ActionList, ActionMenu, Button, Dialog, FormControl, IconButton, Spinner, Text, TextInput, } from '@primer/react';
|
|
8
9
|
import { ClockIcon, TrashIcon } from '@primer/octicons-react';
|
|
9
10
|
import { disableSchedule, updateSchedule, upsertSchedule, } from '../../api/scheduler/schedules';
|
|
10
11
|
import { DEFAULT_SERVICE_URLS } from '@datalayer/core/lib/api/constants';
|
|
@@ -130,23 +131,17 @@ export const ScheduleMenu = ({ notebookUid, scheduleUid, token, baseUrl = DEFAUL
|
|
|
130
131
|
? `${ariaLabel} (saving…)`
|
|
131
132
|
: isEnabled
|
|
132
133
|
? ariaLabel
|
|
133
|
-
: `${ariaLabel} (disabled)` }) }), _jsxs(ActionMenu.Overlay, { width: "medium", sx: { minWidth: 300 }, children: [_jsx(Box, { sx: {
|
|
134
|
-
px: 3,
|
|
135
|
-
pt: 3,
|
|
136
|
-
pb: 2,
|
|
137
|
-
borderBottom: '1px solid',
|
|
138
|
-
borderColor: 'border.default',
|
|
139
|
-
}, children: _jsx(Text, { as: "p", sx: { fontWeight: 600 }, children: "Schedule" }) }), _jsx(ActionList, { selectionVariant: "single", showDividers: true, children: SCHEDULE_PRESETS.map(option => (_jsxs(ActionList.Item, { selected: preset === option.id, disabled: !isEnabled, onSelect: () => selectPreset(option.id), children: [option.label, _jsx(ActionList.Description, { variant: "block", children: option.cron })] }, option.id))) }), _jsxs(Box, { sx: { p: 3, borderTop: '1px solid', borderColor: 'border.default' }, children: [_jsx(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: "Cron Expression" }), _jsx(TextInput, { value: cronExpression, onChange: event => {
|
|
134
|
+
: `${ariaLabel} (disabled)` }) }), _jsxs(ActionMenu.Overlay, { width: "medium", sx: { minWidth: 300 }, children: [_jsx(Box, { px: 3, pt: 3, pb: 2, borderBottom: "1px solid", borderColor: "border.default", children: _jsx(Text, { as: "p", sx: { fontWeight: 600 }, children: "Schedule" }) }), _jsx(ActionList, { selectionVariant: "single", showDividers: true, children: SCHEDULE_PRESETS.map(option => (_jsxs(ActionList.Item, { selected: preset === option.id, disabled: !isEnabled, onSelect: () => selectPreset(option.id), children: [option.label, _jsx(ActionList.Description, { variant: "block", children: option.cron })] }, option.id))) }), _jsxs(Box, { p: 3, borderTop: "1px solid", borderColor: "border.default", children: [_jsx(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: "Cron Expression" }), _jsx(TextInput, { value: cronExpression, onChange: event => {
|
|
140
135
|
const value = event.currentTarget.value;
|
|
141
136
|
setHasExplicitCron(value.trim().length > 0);
|
|
142
137
|
setCronExpression(value);
|
|
143
|
-
}, placeholder: "* * * * *", "aria-label": "Cron expression", block: true, disabled: !isEnabled }), _jsxs(Box, {
|
|
138
|
+
}, placeholder: "* * * * *", "aria-label": "Cron expression", block: true, disabled: !isEnabled }), _jsxs(Box, { mt: 2, display: "flex", gap: 2, flexWrap: "wrap", children: [_jsx(Button, { size: "small", onClick: applyCustomCron, disabled: !isEnabled, children: "Apply Cron" }), scheduleUid ? (_jsx(Button, { size: "small", variant: "danger", leadingVisual: TrashIcon, onClick: () => setIsDeleteDialogOpen(true), disabled: !isEnabled, children: "Delete Schedule" })) : null] }), _jsxs(Text, { as: "p", sx: { mt: 2, fontSize: 0, color: 'fg.muted' }, children: ["Current: ", selectedPresetDescription] })] })] })] }), isDeleteDialogOpen && scheduleUid ? (_jsx(Dialog, { title: "Delete schedule", onClose: () => {
|
|
144
139
|
if (isDeleting) {
|
|
145
140
|
return;
|
|
146
141
|
}
|
|
147
142
|
setIsDeleteDialogOpen(false);
|
|
148
143
|
setDeleteConfirmUid('');
|
|
149
|
-
}, width: "medium", children: _jsxs(Box, {
|
|
144
|
+
}, width: "medium", children: _jsxs(Box, { display: "grid", gap: 3, children: [_jsxs(Text, { children: ["This action will disable the schedule and remove planned runs. Type", ' ', _jsx(Text, { as: "span", sx: { fontWeight: 700 }, children: scheduleUid }), ' ', "to confirm."] }), _jsxs(FormControl, { children: [_jsx(FormControl.Label, { children: "Schedule UID" }), _jsx(TextInput, { value: deleteConfirmUid, onChange: event => setDeleteConfirmUid(event.currentTarget.value), placeholder: scheduleUid, autoFocus: true })] }), _jsxs(Box, { display: "flex", justifyContent: "flex-end", gap: 2, children: [_jsx(Button, { variant: "default", onClick: () => {
|
|
150
145
|
setIsDeleteDialogOpen(false);
|
|
151
146
|
setDeleteConfirmUid('');
|
|
152
147
|
}, disabled: isDeleting, children: "Cancel" }), _jsx(Button, { variant: "danger", onClick: () => void performDeleteSchedule(), disabled: isDeleting || deleteConfirmUid !== scheduleUid, children: "Delete schedule" })] })] }) })) : null] }));
|
|
@@ -72,31 +72,6 @@ export function SpecPayloadPreview({ spec, onClose, title = 'Spec Payload Previe
|
|
|
72
72
|
document.addEventListener('keydown', onKeyDown);
|
|
73
73
|
return () => document.removeEventListener('keydown', onKeyDown);
|
|
74
74
|
}, [onClose]);
|
|
75
|
-
return (_jsxs(Box, { role: "dialog", "aria-label": title, "aria-modal": "true", sx: {
|
|
76
|
-
position: 'fixed',
|
|
77
|
-
inset: 24,
|
|
78
|
-
zIndex: 300,
|
|
79
|
-
bg: 'canvas.default',
|
|
80
|
-
border: '1px solid',
|
|
81
|
-
borderColor: 'border.default',
|
|
82
|
-
borderRadius: 1,
|
|
83
|
-
boxShadow: 'shadow.large',
|
|
84
|
-
display: 'flex',
|
|
85
|
-
flexDirection: 'column',
|
|
86
|
-
}, children: [_jsxs(Box, { sx: {
|
|
87
|
-
display: 'flex',
|
|
88
|
-
alignItems: 'center',
|
|
89
|
-
justifyContent: 'space-between',
|
|
90
|
-
px: 3,
|
|
91
|
-
py: 2,
|
|
92
|
-
borderBottom: '1px solid',
|
|
93
|
-
borderColor: 'border.default',
|
|
94
|
-
}, children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: title }), _jsx(IconButton, { icon: XIcon, "aria-label": "Close spec preview", size: "small", variant: "invisible", onClick: onClose })] }), _jsx(Box, { sx: { p: 3, overflow: 'auto', flex: 1 }, children: _jsx(Box, { as: "pre", sx: {
|
|
95
|
-
m: 0,
|
|
96
|
-
whiteSpace: 'pre',
|
|
97
|
-
fontFamily: 'monospace',
|
|
98
|
-
fontSize: 0,
|
|
99
|
-
lineHeight: '20px',
|
|
100
|
-
}, children: specToYaml(spec) }) })] }));
|
|
75
|
+
return (_jsxs(Box, { role: "dialog", "aria-label": title, "aria-modal": "true", position: "fixed", inset: 24, zIndex: 300, bg: "canvas.default", border: "1px solid", borderColor: "border.default", borderRadius: 1, boxShadow: "shadow.large", display: "flex", flexDirection: "column", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: title }), _jsx(IconButton, { icon: XIcon, "aria-label": "Close spec preview", size: "small", variant: "invisible", onClick: onClose })] }), _jsx(Box, { p: 3, overflow: "auto", flex: 1, children: _jsx(Box, { as: "pre", m: 0, whiteSpace: "pre", fontFamily: "monospace", fontSize: 0, lineHeight: "20px", children: specToYaml(spec) }) })] }));
|
|
101
76
|
}
|
|
102
77
|
export default SpecPayloadPreview;
|