@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
|
@@ -81,13 +81,7 @@ const STATUS_COLORS = AGENT_STATUS_COLORS;
|
|
|
81
81
|
// ─── Sidebar width ─────────────────────────────────────────────────────────
|
|
82
82
|
const SIDEBAR_WIDTH = 300;
|
|
83
83
|
// ─── Spec attribute row helper ─────────────────────────────────────────────
|
|
84
|
-
const SpecRow = ({ icon: Icon, label, value }) => (_jsxs(Box, { sx: {
|
|
85
|
-
display: 'flex',
|
|
86
|
-
alignItems: 'flex-start',
|
|
87
|
-
gap: 2,
|
|
88
|
-
fontSize: 0,
|
|
89
|
-
mb: 1,
|
|
90
|
-
}, children: [Icon && (_jsx(Box, { sx: { color: 'fg.muted', flexShrink: 0, mt: '2px' }, children: _jsx(Icon, { size: 12 }) })), _jsx(Text, { sx: { color: 'fg.muted', flexShrink: 0, minWidth: 80 }, children: label }), _jsx(Text, { sx: { fontWeight: 'semibold', wordBreak: 'break-word' }, children: value })] }));
|
|
84
|
+
const SpecRow = ({ icon: Icon, label, value }) => (_jsxs(Box, { display: "flex", alignItems: "flex-start", gap: 2, fontSize: 0, mb: 1, children: [Icon && (_jsx(Box, { color: "fg.muted", flexShrink: 0, mt: "2px", children: _jsx(Icon, { size: 12 }) })), _jsx(Text, { sx: { color: 'fg.muted', flexShrink: 0, minWidth: 80 }, children: label }), _jsx(Text, { sx: { fontWeight: 'semibold', wordBreak: 'break-word' }, children: value })] }));
|
|
91
85
|
// ─── Inner component (rendered after auth) ─────────────────────────────────
|
|
92
86
|
const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
93
87
|
const { runtime, status: runtimeStatus, endpoint: _agentEndpoint, isReady, error: hookError, launchRuntime, connectToRuntime, disconnect, } = useAgentRuntimes({
|
|
@@ -283,68 +277,19 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
283
277
|
return _jsx(ErrorView, { detail: displayError, onLogout: onLogout });
|
|
284
278
|
}
|
|
285
279
|
// ── Running / Paused ─────────────────────────────────────────────────────
|
|
286
|
-
return (_jsxs(Box, { sx: {
|
|
287
|
-
height: '100%',
|
|
288
|
-
display: 'flex',
|
|
289
|
-
flexDirection: 'column',
|
|
290
|
-
}, children: [_jsxs(Box, { sx: {
|
|
291
|
-
display: 'flex',
|
|
292
|
-
alignItems: 'center',
|
|
293
|
-
gap: 2,
|
|
294
|
-
px: 3,
|
|
295
|
-
py: 2,
|
|
296
|
-
borderBottom: '1px solid',
|
|
297
|
-
borderColor: 'border.default',
|
|
298
|
-
flexShrink: 0,
|
|
299
|
-
}, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => setSidebarOpen(prev => !prev), leadingVisual: sidebarOpen ? SidebarCollapseIcon : SidebarExpandIcon, "aria-label": sidebarOpen ? 'Collapse sidebar' : 'Expand sidebar' }), _jsxs(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: ["Agent \u2014 ", runtimeName] }), _jsx(Label, { variant: STATUS_COLORS[runtimeStatus], children: runtimeStatus }), (runtimeStatus === 'ready' ||
|
|
280
|
+
return (_jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => setSidebarOpen(prev => !prev), leadingVisual: sidebarOpen ? SidebarCollapseIcon : SidebarExpandIcon, "aria-label": sidebarOpen ? 'Collapse sidebar' : 'Expand sidebar' }), _jsxs(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: ["Agent \u2014 ", runtimeName] }), _jsx(Label, { variant: STATUS_COLORS[runtimeStatus], children: runtimeStatus }), (runtimeStatus === 'ready' ||
|
|
300
281
|
runtimeStatus === 'resumed' ||
|
|
301
282
|
runtimeStatus === 'resuming' ||
|
|
302
283
|
runtimeStatus === 'paused') && (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", leadingVisual: SquareIcon, onClick: () => handlePause('light'), disabled: actionLoading ||
|
|
303
284
|
runtimeStatus === 'paused' ||
|
|
304
285
|
runtimeStatus === 'resumed', children: "Checkpoint (Light) + Terminate" }), _jsx(Button, { size: "small", leadingVisual: SquareIcon, onClick: () => handlePause('criu'), disabled: actionLoading ||
|
|
305
286
|
runtimeStatus === 'paused' ||
|
|
306
|
-
runtimeStatus === 'resumed', children: "Checkpoint (CRIU) + Terminate" }), runtimeStatus === 'paused' ? (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(resumeMode), disabled: actionLoading, children: resumeMode === 'light' ? 'Resume (light)' : 'Resume (criu)' }), _jsx(Button, { size: "small", variant: resumeMode === 'light' ? 'primary' : 'invisible', onClick: () => setResumeMode('light'), disabled: actionLoading, children: "Light" }), _jsx(Button, { size: "small", variant: resumeMode === 'criu' ? 'primary' : 'invisible', onClick: () => setResumeMode('criu'), disabled: actionLoading, children: "CRIU checkpoint" })] })) : null, _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: handleTerminate, disabled: actionLoading, children: "Terminate" })] })), actionLoading && _jsx(Spinner, { size: "small" })] }), displayError && (_jsx(Flash, { variant: "danger", sx: { mx: 3, mt: 2 }, children: displayError })), _jsxs(Box, {
|
|
307
|
-
display: 'flex',
|
|
308
|
-
flexDirection: 'column',
|
|
309
|
-
width: SIDEBAR_WIDTH,
|
|
310
|
-
flexShrink: 0,
|
|
311
|
-
borderRight: '1px solid',
|
|
312
|
-
borderColor: 'border.default',
|
|
313
|
-
overflowY: 'auto',
|
|
314
|
-
bg: 'canvas.default',
|
|
315
|
-
}, children: [_jsxs(Box, { sx: {
|
|
316
|
-
order: 3,
|
|
317
|
-
p: 3,
|
|
318
|
-
borderBottom: '1px solid',
|
|
319
|
-
borderColor: 'border.default',
|
|
320
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(Text, { sx: { fontSize: '20px' }, children: AGENTSPEC.emoji }), _jsx(Heading, { as: "h4", sx: { fontSize: 2, m: 0 }, children: AGENTSPEC.name })] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block', mb: 3 }, children: AGENTSPEC.description }), _jsx(SpecRow, { icon: AiModelIcon, label: "Model", value: AGENTSPEC.model }), _jsx(SpecRow, { icon: GlobeIcon, label: "Protocol", value: AGENTSPEC.protocol }), _jsx(SpecRow, { icon: ZapIcon, label: "Memory", value: AGENTSPEC.memory }), _jsx(SpecRow, { icon: GraphIcon, label: "Environment", value: AGENTSPEC.environment_name }), _jsx(SpecRow, { icon: ClockIcon, label: "Trigger", value: AGENTSPEC.trigger.description }), _jsx(SpecRow, { icon: TagIcon, label: "Tags", value: AGENTSPEC.tags.join(', ') }), _jsxs(Box, { sx: {
|
|
321
|
-
mt: 2,
|
|
322
|
-
pt: 2,
|
|
323
|
-
borderTop: '1px solid',
|
|
324
|
-
borderColor: 'border.default',
|
|
325
|
-
}, children: [_jsx(Text, { sx: {
|
|
287
|
+
runtimeStatus === 'resumed', children: "Checkpoint (CRIU) + Terminate" }), runtimeStatus === 'paused' ? (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(resumeMode), disabled: actionLoading, children: resumeMode === 'light' ? 'Resume (light)' : 'Resume (criu)' }), _jsx(Button, { size: "small", variant: resumeMode === 'light' ? 'primary' : 'invisible', onClick: () => setResumeMode('light'), disabled: actionLoading, children: "Light" }), _jsx(Button, { size: "small", variant: resumeMode === 'criu' ? 'primary' : 'invisible', onClick: () => setResumeMode('criu'), disabled: actionLoading, children: "CRIU checkpoint" })] })) : null, _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: handleTerminate, disabled: actionLoading, children: "Terminate" })] })), actionLoading && _jsx(Spinner, { size: "small" })] }), displayError && (_jsx(Flash, { variant: "danger", sx: { mx: 3, mt: 2 }, children: displayError })), _jsxs(Box, { display: "flex", flex: 1, minHeight: 0, children: [sidebarOpen && (_jsxs(Box, { display: "flex", flexDirection: "column", width: SIDEBAR_WIDTH, flexShrink: 0, borderRight: "1px solid", borderColor: "border.default", overflowY: "auto", bg: "canvas.default", children: [_jsxs(Box, { order: 3, p: 3, borderBottom: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [_jsx(Text, { sx: { fontSize: '20px' }, children: AGENTSPEC.emoji }), _jsx(Heading, { as: "h4", sx: { fontSize: 2, m: 0 }, children: AGENTSPEC.name })] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block', mb: 3 }, children: AGENTSPEC.description }), _jsx(SpecRow, { icon: AiModelIcon, label: "Model", value: AGENTSPEC.model }), _jsx(SpecRow, { icon: GlobeIcon, label: "Protocol", value: AGENTSPEC.protocol }), _jsx(SpecRow, { icon: ZapIcon, label: "Memory", value: AGENTSPEC.memory }), _jsx(SpecRow, { icon: GraphIcon, label: "Environment", value: AGENTSPEC.environment_name }), _jsx(SpecRow, { icon: ClockIcon, label: "Trigger", value: AGENTSPEC.trigger.description }), _jsx(SpecRow, { icon: TagIcon, label: "Tags", value: AGENTSPEC.tags.join(', ') }), _jsxs(Box, { mt: 2, pt: 2, borderTop: "1px solid", borderColor: "border.default", children: [_jsx(Text, { sx: {
|
|
326
288
|
fontWeight: 'semibold',
|
|
327
289
|
fontSize: 0,
|
|
328
290
|
display: 'block',
|
|
329
291
|
mb: 1,
|
|
330
|
-
}, children: "Advanced" }), _jsx(SpecRow, { label: "Cost limit", value: AGENTSPEC.advanced.cost_limit }), _jsx(SpecRow, { label: "Time limit", value: AGENTSPEC.advanced.time_limit }), _jsx(SpecRow, { label: "Max iterations", value: String(AGENTSPEC.advanced.max_iterations) }), _jsx(SpecRow, { label: "Checkpoint interval", value: `${AGENTSPEC.advanced.checkpoint_interval}s` }), _jsx(SpecRow, { label: "Temperature", value: String(AGENTSPEC.model_config.temperature) }), _jsx(SpecRow, { label: "Max tokens", value: String(AGENTSPEC.model_config.max_tokens) })] })] }), _jsxs(Box, { sx: {
|
|
331
|
-
order: 2,
|
|
332
|
-
p: 3,
|
|
333
|
-
borderBottom: '1px solid',
|
|
334
|
-
borderColor: 'border.default',
|
|
335
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 2 }, children: [_jsx(PeopleIcon, { size: 14 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: ["Running Agents (", activeAgents.length, ")"] })] }), activeAgents.length === 0 ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', fontStyle: 'italic' }, children: "No running agents." })) : (activeAgents.map((a) => (_jsxs(Box, { sx: {
|
|
336
|
-
p: 2,
|
|
337
|
-
mb: 1,
|
|
338
|
-
bg: 'canvas.default',
|
|
339
|
-
borderRadius: 2,
|
|
340
|
-
border: '1px solid',
|
|
341
|
-
borderColor: 'border.default',
|
|
342
|
-
}, children: [_jsxs(Box, { sx: {
|
|
343
|
-
display: 'flex',
|
|
344
|
-
alignItems: 'center',
|
|
345
|
-
gap: 1,
|
|
346
|
-
mb: 1,
|
|
347
|
-
}, children: [_jsx(Label, { variant: STATUS_COLORS[(a.id === agentId || a.name === DEMO_AGENT_NAME
|
|
292
|
+
}, children: "Advanced" }), _jsx(SpecRow, { label: "Cost limit", value: AGENTSPEC.advanced.cost_limit }), _jsx(SpecRow, { label: "Time limit", value: AGENTSPEC.advanced.time_limit }), _jsx(SpecRow, { label: "Max iterations", value: String(AGENTSPEC.advanced.max_iterations) }), _jsx(SpecRow, { label: "Checkpoint interval", value: `${AGENTSPEC.advanced.checkpoint_interval}s` }), _jsx(SpecRow, { label: "Temperature", value: String(AGENTSPEC.model_config.temperature) }), _jsx(SpecRow, { label: "Max tokens", value: String(AGENTSPEC.model_config.max_tokens) })] })] }), _jsxs(Box, { order: 2, p: 3, borderBottom: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, mb: 2, children: [_jsx(PeopleIcon, { size: 14 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: ["Running Agents (", activeAgents.length, ")"] })] }), activeAgents.length === 0 ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', fontStyle: 'italic' }, children: "No running agents." })) : (activeAgents.map((a) => (_jsxs(Box, { p: 2, mb: 1, bg: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, mb: 1, children: [_jsx(Label, { variant: STATUS_COLORS[(a.id === agentId || a.name === DEMO_AGENT_NAME
|
|
348
293
|
? runtimeStatus
|
|
349
294
|
: a.status) ?? 'running'] ?? 'secondary', sx: { fontSize: '10px' }, children: (a.id === agentId || a.name === DEMO_AGENT_NAME
|
|
350
295
|
? runtimeStatus
|
|
@@ -353,51 +298,13 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
353
298
|
color: 'fg.muted',
|
|
354
299
|
display: 'block',
|
|
355
300
|
mb: 1,
|
|
356
|
-
}, children: a.description })), _jsxs(Box, { sx: {
|
|
357
|
-
display: 'flex',
|
|
358
|
-
gap: 1,
|
|
359
|
-
flexWrap: 'wrap',
|
|
360
|
-
alignItems: 'center',
|
|
361
|
-
}, children: [a.protocol && (_jsx(Label, { sx: { fontSize: '10px' }, variant: "accent", children: a.protocol })), _jsx(Box, { sx: { flex: 1 } }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => handleTerminateRuntime(a), disabled: actionLoading, sx: { fontSize: 0 }, children: "Terminate" })] })] }, a.id))))] }), _jsxs(Box, { sx: {
|
|
362
|
-
order: 1,
|
|
363
|
-
p: 3,
|
|
364
|
-
borderBottom: '1px solid',
|
|
365
|
-
borderColor: 'border.default',
|
|
366
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 2 }, children: [_jsx(HistoryIcon, { size: 14 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1, flex: 1 }, children: ["Checkpoints (", checkpoints.length + pausedAgentsWithoutCheckpoint.length, ")"] }), _jsx(IconButton, { "aria-label": "Refresh checkpoints", icon: SyncIcon, size: "small", variant: "invisible", onClick: refreshCheckpoints })] }), pausedAgentsWithoutCheckpoint.map((a) => (_jsxs(Box, { sx: {
|
|
367
|
-
p: 2,
|
|
368
|
-
mb: 1,
|
|
369
|
-
bg: 'canvas.default',
|
|
370
|
-
borderRadius: 2,
|
|
371
|
-
border: '1px solid',
|
|
372
|
-
borderColor: 'attention.muted',
|
|
373
|
-
}, children: [_jsxs(Box, { sx: {
|
|
374
|
-
display: 'flex',
|
|
375
|
-
alignItems: 'center',
|
|
376
|
-
gap: 1,
|
|
377
|
-
mb: 1,
|
|
378
|
-
}, children: [_jsx(SquareIcon, { size: 12 }), _jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 0, flex: 1 }, children: a.name ?? a.id }), _jsx(Label, { variant: "severe", sx: { fontSize: '9px' }, children: "paused" })] }), a.description && (_jsx(Text, { sx: {
|
|
301
|
+
}, children: a.description })), _jsxs(Box, { display: "flex", gap: 1, flexWrap: "wrap", alignItems: "center", children: [a.protocol && (_jsx(Label, { sx: { fontSize: '10px' }, variant: "accent", children: a.protocol })), _jsx(Box, { flex: 1 }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => handleTerminateRuntime(a), disabled: actionLoading, sx: { fontSize: 0 }, children: "Terminate" })] })] }, a.id))))] }), _jsxs(Box, { order: 1, p: 3, borderBottom: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, mb: 2, children: [_jsx(HistoryIcon, { size: 14 }), _jsxs(Text, { sx: { fontWeight: 'semibold', fontSize: 1, flex: 1 }, children: ["Checkpoints (", checkpoints.length + pausedAgentsWithoutCheckpoint.length, ")"] }), _jsx(IconButton, { "aria-label": "Refresh checkpoints", icon: SyncIcon, size: "small", variant: "invisible", onClick: refreshCheckpoints })] }), pausedAgentsWithoutCheckpoint.map((a) => (_jsxs(Box, { p: 2, mb: 1, bg: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "attention.muted", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, mb: 1, children: [_jsx(SquareIcon, { size: 12 }), _jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 0, flex: 1 }, children: a.name ?? a.id }), _jsx(Label, { variant: "severe", sx: { fontSize: '9px' }, children: "paused" })] }), a.description && (_jsx(Text, { sx: {
|
|
379
302
|
fontSize: 0,
|
|
380
303
|
color: 'fg.muted',
|
|
381
304
|
display: 'block',
|
|
382
305
|
mb: 1,
|
|
383
|
-
}, children: a.description })), _jsx(Box, {
|
|
384
|
-
|
|
385
|
-
display: 'flex',
|
|
386
|
-
justifyContent: 'flex-end',
|
|
387
|
-
}, children: _jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(resumeMode, undefined, a.runtimeName), disabled: actionLoading, children: "Resume" }) })] }, `paused-${a.id}`))), checkpoints.length === 0 &&
|
|
388
|
-
pausedAgentsWithoutCheckpoint.length === 0 ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', fontStyle: 'italic' }, children: "No checkpoints yet. Use Checkpoint (Light) or Checkpoint create one." })) : (checkpoints.map((ckpt) => (_jsxs(Box, { sx: {
|
|
389
|
-
p: 2,
|
|
390
|
-
mb: 1,
|
|
391
|
-
bg: 'canvas.default',
|
|
392
|
-
borderRadius: 2,
|
|
393
|
-
border: '1px solid',
|
|
394
|
-
borderColor: 'border.default',
|
|
395
|
-
}, children: [_jsxs(Box, { sx: {
|
|
396
|
-
display: 'flex',
|
|
397
|
-
alignItems: 'center',
|
|
398
|
-
gap: 1,
|
|
399
|
-
mb: 1,
|
|
400
|
-
}, children: [ckpt.status === 'failed' ? (_jsx(AlertIcon, { size: 12, fill: "var(--fgColor-danger)" })) : (_jsx(CheckCircleIcon, { size: 12 })), _jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 0, flex: 1 }, children: ckpt.name }), _jsx(Label, { variant: ckpt.status === 'failed'
|
|
306
|
+
}, children: a.description })), _jsx(Box, { mt: 2, display: "flex", justifyContent: "flex-end", children: _jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(resumeMode, undefined, a.runtimeName), disabled: actionLoading, children: "Resume" }) })] }, `paused-${a.id}`))), checkpoints.length === 0 &&
|
|
307
|
+
pausedAgentsWithoutCheckpoint.length === 0 ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', fontStyle: 'italic' }, children: "No checkpoints yet. Use Checkpoint (Light) or Checkpoint create one." })) : (checkpoints.map((ckpt) => (_jsxs(Box, { p: 2, mb: 1, bg: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, mb: 1, children: [ckpt.status === 'failed' ? (_jsx(AlertIcon, { size: 12, fill: "var(--fgColor-danger)" })) : (_jsx(CheckCircleIcon, { size: 12 })), _jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 0, flex: 1 }, children: ckpt.name }), _jsx(Label, { variant: ckpt.status === 'failed'
|
|
401
308
|
? 'danger'
|
|
402
309
|
: ckpt.status === 'paused'
|
|
403
310
|
? 'done'
|
|
@@ -412,37 +319,10 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
412
319
|
maxWidth: '100%',
|
|
413
320
|
fontSize: 'var(--text-body-size-small, 12px)',
|
|
414
321
|
color: 'var(--fgColor-danger, var(--color-danger-fg))',
|
|
415
|
-
}, children: ckpt.status_message }) })), ckpt.agent_spec_id && (_jsx(Label, { sx: { mt: 1, fontSize: '10px' }, variant: "accent", children: ckpt.agent_spec_id })), _jsx(Box, { sx: {
|
|
416
|
-
mt: 2,
|
|
417
|
-
display: 'flex',
|
|
418
|
-
justifyContent: 'flex-end',
|
|
419
|
-
}, children: _jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(ckpt.checkpoint_mode || 'light', ckpt.id, ckpt.runtime_uid), disabled: actionLoading || ckpt.status === 'failed', children: "Resume" }) })] }, ckpt.id))))] })] })), _jsx(Box, { sx: { flex: 1, minHeight: 0 }, children: showLaunchingView ? (_jsxs(Box, { sx: {
|
|
420
|
-
display: 'flex',
|
|
421
|
-
flexDirection: 'column',
|
|
422
|
-
alignItems: 'center',
|
|
423
|
-
justifyContent: 'center',
|
|
424
|
-
height: '100%',
|
|
425
|
-
gap: 3,
|
|
426
|
-
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: runtimeStatus === 'launching'
|
|
322
|
+
}, children: ckpt.status_message }) })), ckpt.agent_spec_id && (_jsx(Label, { sx: { mt: 1, fontSize: '10px' }, variant: "accent", children: ckpt.agent_spec_id })), _jsx(Box, { mt: 2, display: "flex", justifyContent: "flex-end", children: _jsx(Button, { size: "small", variant: "primary", leadingVisual: PlayIcon, onClick: () => handleResume(ckpt.checkpoint_mode || 'light', ckpt.id, ckpt.runtime_uid), disabled: actionLoading || ckpt.status === 'failed', children: "Resume" }) })] }, ckpt.id))))] })] })), _jsx(Box, { flex: 1, minHeight: 0, children: showLaunchingView ? (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", gap: 3, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: runtimeStatus === 'launching'
|
|
427
323
|
? `Launching runtime for ${AGENTSPEC_ID}…`
|
|
428
|
-
: 'Creating agent on runtime…' })] })) : showNoAgentRunningView ? (_jsxs(Box, { sx: {
|
|
429
|
-
|
|
430
|
-
flexDirection: 'column',
|
|
431
|
-
alignItems: 'center',
|
|
432
|
-
justifyContent: 'center',
|
|
433
|
-
height: '100%',
|
|
434
|
-
gap: 3,
|
|
435
|
-
px: 3,
|
|
436
|
-
}, children: [_jsx(AgentIcon, { size: 48 }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Checkpoint Agent" }), _jsxs(Text, { sx: { color: 'fg.muted', textAlign: 'center', maxWidth: 560 }, children: ["Launch a cloud agent runtime with pause/resume checkpointing. The agent will be deployed from the", ' ', _jsx("strong", { children: AGENTSPEC_ID }), " spec."] }), displayError && (_jsx(Flash, { variant: "danger", sx: { maxWidth: 560, width: '100%' }, children: displayError })), _jsx(Button, { variant: "primary", size: "large", leadingVisual: PlayIcon, onClick: handleLaunch, children: "Launch Agent" })] })) : (isReady || runtimeStatus === 'resumed') &&
|
|
437
|
-
runtimeStatus !== 'paused' ? (_jsx(LoopEmbed, { serverUrl: agentBaseUrl, target: "local", agentId: agentId, defaultEditor: "none", showHeader: true, plugins: LOOP_PLUGINS_AGENTCHE })) : (_jsx(Box, { sx: {
|
|
438
|
-
display: 'flex',
|
|
439
|
-
flexDirection: 'column',
|
|
440
|
-
alignItems: 'center',
|
|
441
|
-
justifyContent: 'center',
|
|
442
|
-
height: '100%',
|
|
443
|
-
color: 'fg.muted',
|
|
444
|
-
gap: 3,
|
|
445
|
-
}, children: runtimeStatus === 'paused' ? (_jsx(Text, { sx: { fontSize: 2 }, children: "Agent is paused \u2014 click Resume to continue the conversation." })) : runtimeStatus === 'idle' ||
|
|
324
|
+
: 'Creating agent on runtime…' })] })) : showNoAgentRunningView ? (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", gap: 3, px: 3, children: [_jsx(AgentIcon, { size: 48 }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Checkpoint Agent" }), _jsxs(Text, { sx: { color: 'fg.muted', textAlign: 'center', maxWidth: 560 }, children: ["Launch a cloud agent runtime with pause/resume checkpointing. The agent will be deployed from the", ' ', _jsx("strong", { children: AGENTSPEC_ID }), " spec."] }), displayError && (_jsx(Flash, { variant: "danger", sx: { maxWidth: 560, width: '100%' }, children: displayError })), _jsx(Button, { variant: "primary", size: "large", leadingVisual: PlayIcon, onClick: handleLaunch, children: "Launch Agent" })] })) : (isReady || runtimeStatus === 'resumed') &&
|
|
325
|
+
runtimeStatus !== 'paused' ? (_jsx(LoopEmbed, { serverUrl: agentBaseUrl, target: "local", agentId: agentId, defaultEditor: "none", showHeader: true, plugins: LOOP_PLUGINS_AGENTCHE })) : (_jsx(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", color: "fg.muted", gap: 3, children: runtimeStatus === 'paused' ? (_jsx(Text, { sx: { fontSize: 2 }, children: "Agent is paused \u2014 click Resume to continue the conversation." })) : runtimeStatus === 'idle' ||
|
|
446
326
|
runtimeStatus === 'disconnected' ? (_jsx(Text, { sx: { fontSize: 2 }, children: "No active runtime connection. Launch an agent or select one in the sidebar." })) : runtimeStatus === 'error' ? (_jsxs(_Fragment, { children: [_jsx(AlertIcon, { size: 32 }), _jsx(Text, { sx: { fontSize: 2, color: 'danger.fg' }, children: "Agent failed to connect" }), displayError && (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: displayError })), _jsx(Button, { variant: "primary", onClick: handleLaunch, children: "Retry Launch" })] })) : (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "medium" }), _jsxs(Text, { sx: { fontSize: 2 }, children: ["Connecting to agent\u2026 (status: ", runtimeStatus, ")"] })] })) })) })] })] }));
|
|
447
327
|
};
|
|
448
328
|
// ─── Runtime checkpoints: the cloud console, behind its auth gate ─────────
|
|
@@ -477,21 +357,7 @@ const LOCAL_AGENT_NAME = 'checkpoints-example-agent';
|
|
|
477
357
|
const ConversationCheckpointsExample = () => {
|
|
478
358
|
const agentName = useMemo(() => uniqueAgentId(LOCAL_AGENT_NAME), []);
|
|
479
359
|
const plugins = useMemo(() => [AgentCheckpointsPlugin, CheckpointsSidebarPlugin], []);
|
|
480
|
-
return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
|
|
481
|
-
height: '100%',
|
|
482
|
-
display: 'flex',
|
|
483
|
-
flexDirection: 'column',
|
|
484
|
-
bg: 'canvas.default',
|
|
485
|
-
}, children: [_jsxs(Box, { sx: {
|
|
486
|
-
display: 'flex',
|
|
487
|
-
alignItems: 'center',
|
|
488
|
-
gap: 2,
|
|
489
|
-
px: 3,
|
|
490
|
-
py: 2,
|
|
491
|
-
borderBottom: '1px solid',
|
|
492
|
-
borderColor: 'border.default',
|
|
493
|
-
flexShrink: 0,
|
|
494
|
-
}, children: [_jsx(VersionsIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Checkpoints Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsx(Label, { variant: "accent", children: "conversation checkpoints" })] }), _jsx(Box, { sx: { flex: 1, minHeight: 0 }, children: _jsx(LoopEmbed, { serverUrl: resolveExampleAgentRuntimesUrl('local'), target: "local", showAgentVariants: true, agentId: agentName, editors: false, showHeader: true, plugins: plugins }) })] }) }));
|
|
360
|
+
return (_jsx(ThemedProvider, { children: _jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", bg: "canvas.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(VersionsIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Checkpoints Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsx(Label, { variant: "accent", children: "conversation checkpoints" })] }), _jsx(Box, { flex: 1, minHeight: 0, children: _jsx(LoopEmbed, { serverUrl: resolveExampleAgentRuntimesUrl('local'), target: "local", showAgentVariants: true, agentId: agentName, editors: false, showHeader: true, plugins: plugins }) })] }) }));
|
|
495
361
|
};
|
|
496
362
|
// ─── The example: one capability, at the level the target offers it ─────────
|
|
497
363
|
const AgentCheckpointsExample = () => {
|
|
@@ -181,130 +181,27 @@ const AgentCodeSandboxInner = () => {
|
|
|
181
181
|
const statusColor = SANDBOX_STATUS_COLORS[aggregate];
|
|
182
182
|
const statusLabel = SANDBOX_STATUS_LABELS[aggregate];
|
|
183
183
|
// ── Sidebar ──
|
|
184
|
-
const sidebar = (_jsxs(Box, { "data-sandbox-sidebar": true, "data-sandbox-aggregate": aggregate, "data-sandbox-variant": liveVariant ?? undefined, sx: {
|
|
185
|
-
width: 360,
|
|
186
|
-
minWidth: 300,
|
|
187
|
-
borderLeft: '1px solid',
|
|
188
|
-
borderColor: 'border.default',
|
|
189
|
-
display: 'flex',
|
|
190
|
-
flexDirection: 'column',
|
|
191
|
-
minHeight: 0,
|
|
192
|
-
bg: 'canvas.default',
|
|
193
|
-
}, children: [_jsxs(Box, { sx: {
|
|
194
|
-
p: 2,
|
|
195
|
-
bg: 'canvas.default',
|
|
196
|
-
borderBottom: '1px solid',
|
|
197
|
-
borderColor: 'border.default',
|
|
198
|
-
}, children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: "Sandbox Details" }), _jsxs(Box, { sx: {
|
|
199
|
-
display: 'flex',
|
|
200
|
-
alignItems: 'center',
|
|
201
|
-
gap: 2,
|
|
202
|
-
flexWrap: 'wrap',
|
|
203
|
-
}, children: [_jsxs(Label, { variant: wsState === 'connected'
|
|
184
|
+
const sidebar = (_jsxs(Box, { "data-sandbox-sidebar": true, "data-sandbox-aggregate": aggregate, "data-sandbox-variant": liveVariant ?? undefined, width: 360, minWidth: 300, borderLeft: "1px solid", borderColor: "border.default", display: "flex", flexDirection: "column", minHeight: 0, bg: "canvas.default", children: [_jsxs(Box, { p: 2, bg: "canvas.default", borderBottom: "1px solid", borderColor: "border.default", children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: "Sandbox Details" }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, flexWrap: "wrap", children: [_jsxs(Label, { variant: wsState === 'connected'
|
|
204
185
|
? 'success'
|
|
205
186
|
: wsState === 'connecting'
|
|
206
187
|
? 'attention'
|
|
207
|
-
: 'secondary', children: ["WS: ", wsState] }), _jsx(Box, { as: "span", sx: {
|
|
208
|
-
display: 'inline-block',
|
|
209
|
-
width: 10,
|
|
210
|
-
height: 10,
|
|
211
|
-
borderRadius: '50%',
|
|
212
|
-
bg: statusColor,
|
|
213
|
-
flexShrink: 0,
|
|
214
|
-
} }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: statusLabel })] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', mt: 1, display: 'block' }, children: ["Active variant: ", displayedVariant ?? '—', pendingVariant ? ' (switching...)' : ''] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', mt: 1, display: 'block' }, children: ["Last switch:", ' ', lastSwitch
|
|
188
|
+
: 'secondary', children: ["WS: ", wsState] }), _jsx(Box, { as: "span", display: "inline-block", width: 10, height: 10, borderRadius: "50%", bg: statusColor, flexShrink: 0 }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: statusLabel })] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', mt: 1, display: 'block' }, children: ["Active variant: ", displayedVariant ?? '—', pendingVariant ? ' (switching...)' : ''] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', mt: 1, display: 'block' }, children: ["Last switch:", ' ', lastSwitch
|
|
215
189
|
? `${lastSwitch.variant} at ${formatSwitchTime(lastSwitch.switchedAt)}`
|
|
216
|
-
: 'n/a'] })] }), switchError && (_jsx(Flash, { variant: "danger", sx: { mx: 2, mt: 2, fontSize: 0, p: 2 }, children: switchError })), sandboxStatus && (_jsxs(Box, { sx: {
|
|
217
|
-
mx: 2,
|
|
218
|
-
mt: 2,
|
|
219
|
-
p: 2,
|
|
220
|
-
border: '1px solid',
|
|
221
|
-
borderColor: 'border.default',
|
|
222
|
-
borderRadius: 2,
|
|
223
|
-
bg: 'canvas.default',
|
|
224
|
-
fontSize: 0,
|
|
225
|
-
fontFamily: 'mono',
|
|
226
|
-
}, children: [_jsxs(Box, { sx: { mb: 1 }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "variant: " }), _jsx(Text, { children: sandboxStatus.variant })] }), _jsxs(Box, { sx: { mb: 1 }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "sandbox_running: " }), _jsx(Text, { children: String(sandboxStatus.sandbox_running) })] }), _jsxs(Box, { sx: { mb: 1 }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "is_executing: " }), _jsx(Label, { variant: sandboxStatus.is_executing ? 'accent' : 'secondary', children: String(sandboxStatus.is_executing) })] }), sandboxStatus.jupyter_url && (_jsxs(Box, { sx: { mb: 1 }, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "jupyter_url: " }), _jsx(Text, { sx: { wordBreak: 'break-all' }, children: sandboxStatus.jupyter_url })] })), sandboxStatus.error && (_jsx(Flash, { variant: "danger", sx: { mt: 1, fontSize: 0, p: 1 }, children: sandboxStatus.error }))] })), _jsx(Box, { sx: { mx: 2, mt: 2 }, children: _jsx(Button, { size: "small", variant: "danger", disabled: aggregate !== 'executing' || isTransitionLocked, onClick: sendInterrupt, leadingVisual: StopIcon, block: true, "data-sandbox-interrupt": true, children: "Interrupt Execution" }) }), _jsxs(Box, { sx: {
|
|
227
|
-
mx: 2,
|
|
228
|
-
mt: 2,
|
|
229
|
-
mb: 2,
|
|
230
|
-
flex: 1,
|
|
231
|
-
border: '1px solid',
|
|
232
|
-
borderColor: 'border.default',
|
|
233
|
-
borderRadius: 2,
|
|
234
|
-
bg: 'canvas.default',
|
|
235
|
-
display: 'flex',
|
|
236
|
-
flexDirection: 'column',
|
|
237
|
-
minHeight: 0,
|
|
238
|
-
}, children: [_jsxs(Box, { sx: {
|
|
239
|
-
px: 2,
|
|
240
|
-
py: 1,
|
|
241
|
-
borderBottom: '1px solid',
|
|
242
|
-
borderColor: 'border.default',
|
|
243
|
-
display: 'flex',
|
|
244
|
-
alignItems: 'center',
|
|
245
|
-
justifyContent: 'space-between',
|
|
246
|
-
}, children: [_jsxs(Text, { sx: { fontWeight: 600, fontSize: 0 }, children: ["WebSocket Log (", wsLog.length, ")"] }), _jsx(Button, { size: "small", variant: "invisible", disabled: isTransitionLocked, onClick: () => setWsLog([]), sx: { fontSize: 0, px: 1 }, children: "Clear" })] }), _jsx(Box, { "data-sandbox-ws-log": true, sx: {
|
|
247
|
-
overflow: 'auto',
|
|
248
|
-
flex: 1,
|
|
249
|
-
fontFamily: 'mono',
|
|
250
|
-
fontSize: '11px',
|
|
251
|
-
lineHeight: '18px',
|
|
252
|
-
}, children: wsLog.length === 0 ? (_jsx(Text, { sx: { color: 'fg.muted', p: 2, display: 'block', fontSize: 0 }, children: "No messages yet." })) : (wsLog.map(entry => (_jsxs(Box, { sx: {
|
|
253
|
-
px: 2,
|
|
254
|
-
py: '2px',
|
|
255
|
-
color: entry.direction === 'sent' ? 'accent.fg' : 'fg.default',
|
|
256
|
-
bg: entry.direction === 'sent'
|
|
257
|
-
? 'neutral.muted'
|
|
258
|
-
: 'transparent',
|
|
259
|
-
borderBottom: '1px solid',
|
|
260
|
-
borderColor: 'border.subtle',
|
|
261
|
-
wordBreak: 'break-all',
|
|
262
|
-
}, children: [_jsx(Text, { sx: {
|
|
190
|
+
: 'n/a'] })] }), switchError && (_jsx(Flash, { variant: "danger", sx: { mx: 2, mt: 2, fontSize: 0, p: 2 }, children: switchError })), sandboxStatus && (_jsxs(Box, { mx: 2, mt: 2, p: 2, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", fontSize: 0, fontFamily: "mono", children: [_jsxs(Box, { mb: 1, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "variant: " }), _jsx(Text, { children: sandboxStatus.variant })] }), _jsxs(Box, { mb: 1, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "sandbox_running: " }), _jsx(Text, { children: String(sandboxStatus.sandbox_running) })] }), _jsxs(Box, { mb: 1, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "is_executing: " }), _jsx(Label, { variant: sandboxStatus.is_executing ? 'accent' : 'secondary', children: String(sandboxStatus.is_executing) })] }), sandboxStatus.jupyter_url && (_jsxs(Box, { mb: 1, children: [_jsx(Text, { sx: { fontWeight: 600 }, children: "jupyter_url: " }), _jsx(Text, { sx: { wordBreak: 'break-all' }, children: sandboxStatus.jupyter_url })] })), sandboxStatus.error && (_jsx(Flash, { variant: "danger", sx: { mt: 1, fontSize: 0, p: 1 }, children: sandboxStatus.error }))] })), _jsx(Box, { mx: 2, mt: 2, children: _jsx(Button, { size: "small", variant: "danger", disabled: aggregate !== 'executing' || isTransitionLocked, onClick: sendInterrupt, leadingVisual: StopIcon, block: true, "data-sandbox-interrupt": true, children: "Interrupt Execution" }) }), _jsxs(Box, { mx: 2, mt: 2, mb: 2, flex: 1, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", display: "flex", flexDirection: "column", minHeight: 0, children: [_jsxs(Box, { px: 2, py: 1, borderBottom: "1px solid", borderColor: "border.default", display: "flex", alignItems: "center", justifyContent: "space-between", children: [_jsxs(Text, { sx: { fontWeight: 600, fontSize: 0 }, children: ["WebSocket Log (", wsLog.length, ")"] }), _jsx(Button, { size: "small", variant: "invisible", disabled: isTransitionLocked, onClick: () => setWsLog([]), sx: { fontSize: 0, px: 1 }, children: "Clear" })] }), _jsx(Box, { "data-sandbox-ws-log": true, overflow: "auto", flex: 1, fontFamily: "mono", fontSize: "11px", lineHeight: "18px", children: wsLog.length === 0 ? (_jsx(Text, { sx: { color: 'fg.muted', p: 2, display: 'block', fontSize: 0 }, children: "No messages yet." })) : (wsLog.map(entry => (_jsxs(Box, { px: 2, py: "2px", color: entry.direction === 'sent' ? 'accent.fg' : 'fg.default', bg: entry.direction === 'sent' ? 'neutral.muted' : 'transparent', borderBottom: "1px solid", borderColor: "border.subtle", wordBreak: "break-all", children: [_jsx(Text, { sx: {
|
|
263
191
|
color: 'fg.muted',
|
|
264
192
|
mr: 1,
|
|
265
193
|
userSelect: 'none',
|
|
266
194
|
}, children: entry.ts }), _jsxs(Text, { sx: {
|
|
267
195
|
fontWeight: entry.direction === 'sent' ? 600 : 400,
|
|
268
196
|
}, children: [entry.direction === 'sent' ? '▲ ' : '▼ ', entry.raw] })] }, entry.id)))) })] })] }));
|
|
269
|
-
return (_jsxs(Box, { sx: {
|
|
270
|
-
height: '100%',
|
|
271
|
-
minHeight: 0,
|
|
272
|
-
display: 'flex',
|
|
273
|
-
flexDirection: 'column',
|
|
274
|
-
bg: 'canvas.default',
|
|
275
|
-
}, children: [_jsxs(Box, { sx: {
|
|
276
|
-
display: 'flex',
|
|
277
|
-
alignItems: 'center',
|
|
278
|
-
gap: 2,
|
|
279
|
-
px: 3,
|
|
280
|
-
py: 2,
|
|
281
|
-
borderBottom: '1px solid',
|
|
282
|
-
borderColor: 'border.default',
|
|
283
|
-
flexShrink: 0,
|
|
284
|
-
}, children: [_jsx(CodespacesIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Code Sandbox Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsxs(Label, { variant: "accent", children: [VARIANTS.length, " sandbox variants"] })] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs(Box, { sx: { position: 'relative', height: '100%' }, children: [_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', height: '100%' }, children: [_jsxs(Box, { sx: {
|
|
285
|
-
display: 'flex',
|
|
286
|
-
alignItems: 'center',
|
|
287
|
-
gap: 2,
|
|
288
|
-
px: 3,
|
|
289
|
-
py: 2,
|
|
290
|
-
borderBottom: '1px solid',
|
|
291
|
-
borderColor: 'border.default',
|
|
292
|
-
flexShrink: 0,
|
|
293
|
-
}, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Sandbox variant" }), _jsxs(SegmentedControl, { "aria-label": "Sandbox variant", size: "small", onChange: index => {
|
|
197
|
+
return (_jsxs(Box, { height: "100%", minHeight: 0, display: "flex", flexDirection: "column", bg: "canvas.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(CodespacesIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Code Sandbox Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsxs(Label, { variant: "accent", children: [VARIANTS.length, " sandbox variants"] })] }), _jsxs(Box, { flex: 1, minHeight: 0, display: "flex", children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsxs(Box, { position: "relative", height: "100%", children: [_jsxs(Box, { display: "flex", flexDirection: "column", height: "100%", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Sandbox variant" }), _jsxs(SegmentedControl, { "aria-label": "Sandbox variant", size: "small", onChange: index => {
|
|
294
198
|
if (isTransitionLocked)
|
|
295
199
|
return;
|
|
296
200
|
const next = VARIANTS[index];
|
|
297
201
|
if (next && next !== displayedVariant) {
|
|
298
202
|
void switchVariant(next);
|
|
299
203
|
}
|
|
300
|
-
}, children: [_jsx(SegmentedControl.Button, { selected: displayedVariant === 'eval', leadingIcon: TerminalIcon, disabled: isTransitionLocked, "data-sandbox-variant-button": "eval", children: "eval" }), _jsx(SegmentedControl.Button, { selected: displayedVariant === 'jupyter-server', leadingIcon: CodeIcon, disabled: isTransitionLocked, "data-sandbox-variant-button": "jupyter-server", children: "jupyter" })] }), pendingVariant && _jsx(Spinner, { size: "small" })] }), _jsx(Box, {
|
|
301
|
-
position: 'absolute',
|
|
302
|
-
inset: 0,
|
|
303
|
-
bg: 'canvas.default',
|
|
304
|
-
opacity: 0.35,
|
|
305
|
-
zIndex: 2,
|
|
306
|
-
cursor: 'wait',
|
|
307
|
-
} }))] }) }), sidebar] })] }));
|
|
204
|
+
}, children: [_jsx(SegmentedControl.Button, { selected: displayedVariant === 'eval', leadingIcon: TerminalIcon, disabled: isTransitionLocked, "data-sandbox-variant-button": "eval", children: "eval" }), _jsx(SegmentedControl.Button, { selected: displayedVariant === 'jupyter-server', leadingIcon: CodeIcon, disabled: isTransitionLocked, "data-sandbox-variant-button": "jupyter-server", children: "jupyter" })] }), pendingVariant && _jsx(Spinner, { size: "small" })] }), _jsx(Box, { flex: 1, minHeight: 0, children: _jsx(LoopEmbed, { serverUrl: agentBaseUrl, target: "local", showAgentVariants: true, agentId: agentId, editors: false, showHeader: true, plugins: chatPlugins }) })] }), isTransitionLocked && (_jsx(Box, { position: "absolute", inset: 0, bg: "canvas.default", opacity: 0.35, zIndex: 2, cursor: "wait" }))] }) }), sidebar] })] }));
|
|
308
205
|
};
|
|
309
206
|
const AgentCodeSandboxExample = () => (_jsx(ThemedProvider, { children: _jsx(AgentCodeSandboxInner, {}) }));
|
|
310
207
|
export default AgentCodeSandboxExample;
|
|
@@ -37,20 +37,7 @@ const AgentCodeSandboxesInner = () => {
|
|
|
37
37
|
// sandbox_variant the agent is created with.
|
|
38
38
|
const plugins = useMemo(() => (launched ? [SandboxCapacityPlugins[launched.key]] : []), [launched]);
|
|
39
39
|
if (!launched) {
|
|
40
|
-
return (_jsxs(Box, { "data-sandboxes-chooser": true, sx: {
|
|
41
|
-
maxWidth: 840,
|
|
42
|
-
mx: 'auto',
|
|
43
|
-
mt: 6,
|
|
44
|
-
px: 3,
|
|
45
|
-
py: 3,
|
|
46
|
-
border: '1px solid',
|
|
47
|
-
borderColor: 'border.default',
|
|
48
|
-
borderRadius: 2,
|
|
49
|
-
display: 'flex',
|
|
50
|
-
flexDirection: 'column',
|
|
51
|
-
gap: 3,
|
|
52
|
-
bg: 'canvas.default',
|
|
53
|
-
}, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "SANDBOX VARIANT DEMO" }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Agent Code Sandboxes" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Choose where the agent's Python should run, launch it, then ask the code where it ran to compare the sandboxes." }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", selected.specId] }), _jsxs(Label, { variant: "secondary", children: ["Variant: ", selected.variant] })] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Sandbox Variant" }), _jsx("select", { value: selectedKey, "data-sandboxes-select": true, onChange: event => setSelectedKey(event.target.value), style: {
|
|
40
|
+
return (_jsxs(Box, { "data-sandboxes-chooser": true, maxWidth: 840, mx: "auto", mt: 6, px: 3, py: 3, border: "1px solid", borderColor: "border.default", borderRadius: 2, display: "flex", flexDirection: "column", gap: 3, bg: "canvas.default", children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "SANDBOX VARIANT DEMO" }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Agent Code Sandboxes" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Choose where the agent's Python should run, launch it, then ask the code where it ran to compare the sandboxes." }), _jsxs(Box, { display: "flex", gap: 2, flexWrap: "wrap", children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", selected.specId] }), _jsxs(Label, { variant: "secondary", children: ["Variant: ", selected.variant] })] }), _jsxs(Box, { display: "flex", flexDirection: "column", gap: 2, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Sandbox Variant" }), _jsx("select", { value: selectedKey, "data-sandboxes-select": true, onChange: event => setSelectedKey(event.target.value), style: {
|
|
54
41
|
width: '100%',
|
|
55
42
|
maxWidth: 420,
|
|
56
43
|
padding: '8px 10px',
|
|
@@ -63,24 +50,10 @@ const AgentCodeSandboxesInner = () => {
|
|
|
63
50
|
agentId: uniqueAgentId(`code-sandbox-${selected.variant}`),
|
|
64
51
|
}), sx: { width: '100%', maxWidth: 420 }, children: ["Launch ", selected.displayName] })] }));
|
|
65
52
|
}
|
|
66
|
-
return (_jsxs(Box, { sx: {
|
|
67
|
-
height: '100%',
|
|
68
|
-
display: 'flex',
|
|
69
|
-
flexDirection: 'column',
|
|
70
|
-
bg: 'canvas.default',
|
|
71
|
-
}, children: [_jsxs(Box, { sx: {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
gap: 2,
|
|
75
|
-
px: 3,
|
|
76
|
-
py: 2,
|
|
77
|
-
borderBottom: '1px solid',
|
|
78
|
-
borderColor: 'border.default',
|
|
79
|
-
flexShrink: 0,
|
|
80
|
-
}, children: [_jsx(CodespacesIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Code Sandboxes Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsxs(Label, { variant: "accent", "data-sandboxes-active": active.variant, children: [active.displayName, " \u00B7 ", active.variant] }), _jsx(Button, { size: "small", leadingVisual: SyncIcon, "data-sandboxes-change": true, onClick: () => {
|
|
53
|
+
return (_jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", bg: "canvas.default", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(CodespacesIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Code Sandboxes Demo" }), _jsx(Label, { variant: "accent", children: "local" }), _jsxs(Label, { variant: "accent", "data-sandboxes-active": active.variant, children: [active.displayName, " \u00B7 ", active.variant] }), _jsx(Button, { size: "small", leadingVisual: SyncIcon, "data-sandboxes-change": true, onClick: () => {
|
|
81
54
|
setSelectedKey(active.key);
|
|
82
55
|
setLaunched(null);
|
|
83
|
-
}, children: "Change sandbox" })] }), _jsx(Box, {
|
|
56
|
+
}, children: "Change sandbox" })] }), _jsx(Box, { flex: 1, minHeight: 0, children: _jsx(LoopEmbed, { serverUrl: serverUrl, target: "local", showAgentVariants: true, agentId: launched.agentId, editors: false, showHeader: true, plugins: plugins }, launched.agentId) })] }));
|
|
84
57
|
};
|
|
85
58
|
const AgentCodeSandboxesExample = () => (_jsx(ThemedProvider, { children: _jsx(AgentCodeSandboxesInner, {}) }));
|
|
86
59
|
export default AgentCodeSandboxesExample;
|
|
@@ -306,15 +306,7 @@ const AgentRuntimePane = ({ config, active, token, onTokenConsumed, onAgentIdCha
|
|
|
306
306
|
if (!active) {
|
|
307
307
|
return null;
|
|
308
308
|
}
|
|
309
|
-
return (_jsx(Box, {
|
|
310
|
-
border: '1px solid',
|
|
311
|
-
borderColor: 'border.default',
|
|
312
|
-
borderRadius: 2,
|
|
313
|
-
overflow: 'hidden',
|
|
314
|
-
minHeight: 560,
|
|
315
|
-
display: 'flex',
|
|
316
|
-
flexDirection: 'column',
|
|
317
|
-
}, children: _jsx(Box, { sx: { flex: 1, minHeight: 0 }, children: _jsx(LoopEmbed, { serverUrl: config.baseUrl, target: "local", showAgentVariants: true, agentId: agentId, editors: false, showHeader: true, plugins: chatPlugins }) }) }));
|
|
309
|
+
return (_jsx(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", minHeight: 560, display: "flex", flexDirection: "column", children: _jsx(Box, { flex: 1, minHeight: 0, children: _jsx(LoopEmbed, { serverUrl: config.baseUrl, target: "local", showAgentVariants: true, agentId: agentId, editors: false, showHeader: true, plugins: chatPlugins }) }) }));
|
|
318
310
|
};
|
|
319
311
|
const AgentCodemodeInner = ({ onLogout, }) => {
|
|
320
312
|
const { token } = useSimpleAuthStore();
|
|
@@ -464,32 +456,9 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
464
456
|
if (!token) {
|
|
465
457
|
return null;
|
|
466
458
|
}
|
|
467
|
-
return (_jsxs(Box, { sx: {
|
|
468
|
-
height: '100%',
|
|
469
|
-
display: 'flex',
|
|
470
|
-
flexDirection: 'column',
|
|
471
|
-
}, children: [_jsxs(Box, { sx: {
|
|
472
|
-
display: 'flex',
|
|
473
|
-
alignItems: 'center',
|
|
474
|
-
gap: 2,
|
|
475
|
-
px: 3,
|
|
476
|
-
py: 2,
|
|
477
|
-
borderBottom: '1px solid',
|
|
478
|
-
borderColor: 'border.default',
|
|
479
|
-
flexShrink: 0,
|
|
480
|
-
}, children: [_jsx(CodeIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Codemode \u2014 MCP Tools vs Codemode Tools" }), _jsx(SegmentedControl, { "aria-label": "Side on screen", size: "small", onChange: index => setActiveKey(DEMO_AGENT_CONFIGS[index]?.key ?? 'no-codemode'), children: DEMO_AGENT_CONFIGS.map(config => (_jsx(SegmentedControl.Button, { selected: config.key === activeKey, "data-codemode-side": config.key, children: config.key === 'codemode' ? 'Codemode tools' : 'MCP tools' }, config.key))) })] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [DEMO_AGENT_CONFIGS.filter(c => c.key === 'no-codemode').map(config => (() => {
|
|
459
|
+
return (_jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", flexShrink: 0, children: [_jsx(CodeIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Codemode \u2014 MCP Tools vs Codemode Tools" }), _jsx(SegmentedControl, { "aria-label": "Side on screen", size: "small", onChange: index => setActiveKey(DEMO_AGENT_CONFIGS[index]?.key ?? 'no-codemode'), children: DEMO_AGENT_CONFIGS.map(config => (_jsx(SegmentedControl.Button, { selected: config.key === activeKey, "data-codemode-side": config.key, children: config.key === 'codemode' ? 'Codemode tools' : 'MCP tools' }, config.key))) })] }), _jsxs(Box, { flex: 1, minHeight: 0, display: "flex", children: [DEMO_AGENT_CONFIGS.filter(c => c.key === 'no-codemode').map(config => (() => {
|
|
481
460
|
const outcome = outcomeFor(config.key);
|
|
482
|
-
return (_jsxs(Box, { sx: {
|
|
483
|
-
width: 320,
|
|
484
|
-
borderRight: '1px solid',
|
|
485
|
-
borderColor: 'border.default',
|
|
486
|
-
p: 3,
|
|
487
|
-
display: 'flex',
|
|
488
|
-
flexDirection: 'column',
|
|
489
|
-
gap: 3,
|
|
490
|
-
flexShrink: 0,
|
|
491
|
-
overflow: 'auto',
|
|
492
|
-
}, children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: config.title }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: "Tokens consumed (no codemode)." }), _jsx(Text, { sx: {
|
|
461
|
+
return (_jsxs(Box, { width: 320, borderRight: "1px solid", borderColor: "border.default", p: 3, display: "flex", flexDirection: "column", gap: 3, flexShrink: 0, overflow: "auto", children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: config.title }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: "Tokens consumed (no codemode)." }), _jsx(Text, { sx: {
|
|
493
462
|
color: 'fg.muted',
|
|
494
463
|
fontSize: 0,
|
|
495
464
|
fontFamily: 'mono',
|
|
@@ -502,17 +471,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
502
471
|
display: 'block',
|
|
503
472
|
mt: 1,
|
|
504
473
|
wordBreak: 'break-all',
|
|
505
|
-
}, children: agentIdByKey[config.key] || 'launching…' })] }), _jsxs(Box, { sx: {
|
|
506
|
-
p: 2,
|
|
507
|
-
borderRadius: 2,
|
|
508
|
-
border: '1px solid',
|
|
509
|
-
bg: outcome.bg,
|
|
510
|
-
borderColor: outcome.borderColor,
|
|
511
|
-
textAlign: 'center',
|
|
512
|
-
display: 'flex',
|
|
513
|
-
flexDirection: 'column',
|
|
514
|
-
alignItems: 'center',
|
|
515
|
-
}, children: [_jsx(Text, { sx: { fontSize: 4, lineHeight: 1, mb: 1 }, children: outcome.emoji }), _jsx(Text, { sx: {
|
|
474
|
+
}, children: agentIdByKey[config.key] || 'launching…' })] }), _jsxs(Box, { p: 2, borderRadius: 2, border: "1px solid", bg: outcome.bg, borderColor: outcome.borderColor, textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", children: [_jsx(Text, { sx: { fontSize: 4, lineHeight: 1, mb: 1 }, children: outcome.emoji }), _jsx(Text, { sx: {
|
|
516
475
|
fontSize: 0,
|
|
517
476
|
color: outcome.color,
|
|
518
477
|
fontWeight: 'bold',
|
|
@@ -527,31 +486,10 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
527
486
|
maxHeight: 240,
|
|
528
487
|
width: '100%',
|
|
529
488
|
flexShrink: 0,
|
|
530
|
-
} }), _jsxs(Box, { sx: {
|
|
531
|
-
|
|
532
|
-
justifyContent: 'space-between',
|
|
533
|
-
gap: 2,
|
|
534
|
-
}, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Consumed" }), _jsxs(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: [(consumedByAgent[config.key] ?? 0).toLocaleString(), " tokens"] })] }), agentIdByKey[config.key] && (_jsx(ContextPanel, { agentId: agentIdByKey[config.key], apiBase: config.baseUrl, liveData: contextSnapshotByKey[config.key] ?? null, chartHeight: "180px" }))] }, config.key));
|
|
535
|
-
})()), _jsx(Box, { sx: {
|
|
536
|
-
flex: 1,
|
|
537
|
-
minWidth: 0,
|
|
538
|
-
p: 3,
|
|
539
|
-
display: 'flex',
|
|
540
|
-
flexDirection: 'column',
|
|
541
|
-
overflow: 'auto',
|
|
542
|
-
}, children: DEMO_AGENT_CONFIGS.map(config => (_jsx(AgentRuntimePane, { config: config, active: config.key === activeKey, token: token, onTokenConsumed: handleTokenConsumed, onAgentIdChange: handleAgentIdChange, onContextSnapshot: handleContextSnapshot }, config.key))) }), DEMO_AGENT_CONFIGS.filter(c => c.key === 'codemode').map(config => (() => {
|
|
489
|
+
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Consumed" }), _jsxs(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: [(consumedByAgent[config.key] ?? 0).toLocaleString(), " tokens"] })] }), agentIdByKey[config.key] && (_jsx(ContextPanel, { agentId: agentIdByKey[config.key], apiBase: config.baseUrl, liveData: contextSnapshotByKey[config.key] ?? null, chartHeight: "180px" }))] }, config.key));
|
|
490
|
+
})()), _jsx(Box, { flex: 1, minWidth: 0, p: 3, display: "flex", flexDirection: "column", overflow: "auto", children: DEMO_AGENT_CONFIGS.map(config => (_jsx(AgentRuntimePane, { config: config, active: config.key === activeKey, token: token, onTokenConsumed: handleTokenConsumed, onAgentIdChange: handleAgentIdChange, onContextSnapshot: handleContextSnapshot }, config.key))) }), DEMO_AGENT_CONFIGS.filter(c => c.key === 'codemode').map(config => (() => {
|
|
543
491
|
const outcome = outcomeFor(config.key);
|
|
544
|
-
return (_jsxs(Box, { sx: {
|
|
545
|
-
width: 320,
|
|
546
|
-
borderLeft: '1px solid',
|
|
547
|
-
borderColor: 'border.default',
|
|
548
|
-
p: 3,
|
|
549
|
-
display: 'flex',
|
|
550
|
-
flexDirection: 'column',
|
|
551
|
-
gap: 3,
|
|
552
|
-
flexShrink: 0,
|
|
553
|
-
overflow: 'auto',
|
|
554
|
-
}, children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: config.title }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: "Tokens consumed (codemode)." }), _jsx(Text, { sx: {
|
|
492
|
+
return (_jsxs(Box, { width: 320, borderLeft: "1px solid", borderColor: "border.default", p: 3, display: "flex", flexDirection: "column", gap: 3, flexShrink: 0, overflow: "auto", children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: config.title }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: "Tokens consumed (codemode)." }), _jsx(Text, { sx: {
|
|
555
493
|
color: 'fg.muted',
|
|
556
494
|
fontSize: 0,
|
|
557
495
|
fontFamily: 'mono',
|
|
@@ -564,17 +502,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
564
502
|
display: 'block',
|
|
565
503
|
mt: 1,
|
|
566
504
|
wordBreak: 'break-all',
|
|
567
|
-
}, children: agentIdByKey[config.key] || 'launching…' })] }), _jsxs(Box, { sx: {
|
|
568
|
-
p: 2,
|
|
569
|
-
borderRadius: 2,
|
|
570
|
-
border: '1px solid',
|
|
571
|
-
bg: outcome.bg,
|
|
572
|
-
borderColor: outcome.borderColor,
|
|
573
|
-
textAlign: 'center',
|
|
574
|
-
display: 'flex',
|
|
575
|
-
flexDirection: 'column',
|
|
576
|
-
alignItems: 'center',
|
|
577
|
-
}, children: [_jsx(Text, { sx: { fontSize: 4, lineHeight: 1, mb: 1 }, children: outcome.emoji }), _jsx(Text, { sx: {
|
|
505
|
+
}, children: agentIdByKey[config.key] || 'launching…' })] }), _jsxs(Box, { p: 2, borderRadius: 2, border: "1px solid", bg: outcome.bg, borderColor: outcome.borderColor, textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", children: [_jsx(Text, { sx: { fontSize: 4, lineHeight: 1, mb: 1 }, children: outcome.emoji }), _jsx(Text, { sx: {
|
|
578
506
|
fontSize: 0,
|
|
579
507
|
color: outcome.color,
|
|
580
508
|
fontWeight: 'bold',
|
|
@@ -589,11 +517,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
589
517
|
maxHeight: 240,
|
|
590
518
|
width: '100%',
|
|
591
519
|
flexShrink: 0,
|
|
592
|
-
} }), _jsxs(Box, { sx: {
|
|
593
|
-
display: 'flex',
|
|
594
|
-
justifyContent: 'space-between',
|
|
595
|
-
gap: 2,
|
|
596
|
-
}, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Consumed" }), _jsxs(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: [(consumedByAgent[config.key] ?? 0).toLocaleString(), " tokens"] })] }), agentIdByKey[config.key] && (_jsx(ContextPanel, { agentId: agentIdByKey[config.key], apiBase: config.baseUrl, liveData: contextSnapshotByKey[config.key] ?? null, chartHeight: "180px" }))] }, config.key));
|
|
520
|
+
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Consumed" }), _jsxs(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: [(consumedByAgent[config.key] ?? 0).toLocaleString(), " tokens"] })] }), agentIdByKey[config.key] && (_jsx(ContextPanel, { agentId: agentIdByKey[config.key], apiBase: config.baseUrl, liveData: contextSnapshotByKey[config.key] ?? null, chartHeight: "180px" }))] }, config.key));
|
|
597
521
|
})())] })] }));
|
|
598
522
|
};
|
|
599
523
|
const syncTokenToIamStore = (token) => {
|