@datalayer/agent-runtimes 1.0.19 → 1.0.21
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/README.md +11 -3
- package/lib/AgentNode.js +141 -40
- package/lib/App.js +2 -2
- package/lib/agent-node/AgentNodeGallery.js +188 -25
- package/lib/api/runtimes/runtimes.d.ts +57 -0
- package/lib/api/runtimes/runtimes.js +55 -1
- package/lib/chat/Chat.d.ts +1 -1
- package/lib/chat/Chat.js +2 -2
- package/lib/chat/base/ChatBase.js +50 -13
- package/lib/chat/document/EphemeralDocument.d.ts +5 -1
- package/lib/chat/document/EphemeralDocument.js +7 -5
- package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
- package/lib/chat/header/ChatHeaderBase.js +5 -3
- package/lib/chat/messages/ChatMessageList.d.ts +19 -0
- package/lib/chat/messages/ChatMessageList.js +180 -9
- package/lib/chat/notebook/EphemeralNotebook.d.ts +5 -1
- package/lib/chat/notebook/EphemeralNotebook.js +9 -6
- package/lib/chat/prompt/InputPrompt.js +1 -1
- package/lib/chat/tools/SubagentActivity.d.ts +20 -0
- package/lib/chat/tools/SubagentActivity.js +154 -0
- package/lib/chat/tools/index.d.ts +1 -0
- package/lib/chat/tools/index.js +1 -0
- package/lib/chat/usage/TokenUsageBar.js +3 -3
- package/lib/client/AgentRuntimesClient.d.ts +5 -0
- package/lib/client/AgentsMixin.js +3 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +12 -0
- package/lib/client/mixins/RuntimesMixin.js +24 -1
- package/lib/components/AgentSummary.d.ts +1 -0
- package/lib/components/AgentSummary.js +66 -10
- package/lib/components/runtimes/RuntimePickerBase.js +64 -29
- package/lib/components/runtimes/RuntimePickerCell.js +1 -1
- package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
- package/lib/components/runtimes/RuntimeSimplePicker.js +3 -2
- package/lib/components/runtimes/RuntimeUtils.js +2 -2
- package/lib/context/GraphFlowChart.js +1 -1
- package/lib/context/TokenUsageChart.js +1 -1
- package/lib/context/TurnGraphChart.js +2 -2
- package/lib/examples/A2UiAgentExample.js +4 -4
- package/lib/examples/A2UiComponentsGalleryExample.js +3 -3
- package/lib/examples/A2UiContactCardExample.js +3 -3
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/A2UiViewerExample.js +3 -3
- package/lib/examples/AgUiAgenticExample.js +3 -3
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
- package/lib/examples/AgUiHaikuGenUiExample.js +3 -3
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -5
- package/lib/examples/AgUiSharedStateExample.js +3 -3
- package/lib/examples/AgUiToolsBasedGenUiExample.js +7 -5
- package/lib/examples/AgentCheckpointsExample.js +6 -5
- package/lib/examples/{AgentSandboxExample.d.ts → AgentCodeSandboxExample.d.ts} +4 -4
- package/lib/examples/{AgentSandboxExample.js → AgentCodeSandboxExample.js} +10 -9
- package/lib/examples/AgentCodeSandboxesExample.js +2 -2
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentCompactionExample.d.ts +12 -0
- package/lib/examples/AgentCompactionExample.js +244 -0
- package/lib/examples/AgentEvalsExample.js +10 -20
- package/lib/examples/AgentGuardrailsExample.js +2 -2
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +6 -8
- package/lib/examples/AgentLoopExample.js +3 -3
- package/lib/examples/AgentMCPExample.js +3 -3
- package/lib/examples/AgentMemoryExample.d.ts +4 -2
- package/lib/examples/AgentMemoryExample.js +93 -10
- package/lib/examples/AgentMonitoringExample.js +2 -2
- package/lib/examples/AgentNotificationsExample.js +1 -1
- package/lib/examples/AgentOtelExample.d.ts +2 -3
- package/lib/examples/AgentOtelExample.js +7 -12
- package/lib/examples/AgentOutputsExample.js +5 -5
- package/lib/examples/AgentParametersExample.js +3 -3
- package/lib/examples/AgentSkillsExample.js +4 -4
- package/lib/examples/AgentSubagentsExample.d.ts +2 -2
- package/lib/examples/AgentSubagentsExample.js +43 -34
- package/lib/examples/AgentToolApprovalsExample.js +1 -1
- package/lib/examples/AgentTriggersExample.js +9 -11
- package/lib/examples/AgentspecsExample.js +13 -5
- package/lib/examples/CellExample.d.ts +6 -0
- package/lib/examples/CellExample.js +84 -0
- package/lib/examples/ChatCustomExample.js +1 -1
- package/lib/examples/ChatExample.js +1 -1
- package/lib/examples/ChatStandaloneExample.js +2 -2
- package/lib/examples/HomeExample.js +29 -28
- package/lib/examples/Lexical2Example.js +2 -2
- package/lib/examples/LexicalAgentExample.js +1 -1
- package/lib/examples/LexicalAgentSidebarExample.js +2 -2
- package/lib/examples/NotebookAgentSidebarExample.d.ts +1 -1
- package/lib/examples/NotebookAgentSidebarExample.js +5 -4
- package/lib/examples/NotebookCollaborationExample.js +3 -3
- package/lib/examples/NotebookExample.js +2 -2
- package/lib/examples/components/ExampleWrapper.js +5 -0
- package/lib/examples/components/Header.js +2 -2
- package/lib/examples/components/HeaderControls.js +1 -1
- package/lib/examples/components/LexicalEditor.js +1 -1
- package/lib/examples/components/MainContent.js +1 -1
- package/lib/examples/components/MockFileBrowser.js +8 -8
- package/lib/examples/components/TimeTravel.js +1 -1
- package/lib/examples/components/haiku/HaikuDisplay.js +2 -2
- package/lib/examples/example-selector.js +4 -3
- package/lib/examples/hooks/useExampleAgentRuntime.js +11 -1
- package/lib/examples/hooks/useExampleAgentRuntimes.d.ts +7 -0
- package/lib/examples/hooks/useExampleAgentRuntimes.js +82 -0
- package/lib/examples/index.d.ts +2 -1
- package/lib/examples/index.js +2 -1
- package/lib/examples/main.js +359 -46
- package/lib/examples/utils/agentSummaryStore.d.ts +17 -0
- package/lib/examples/utils/themedProvider.js +32 -2
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +2 -1
- package/lib/examples2/NotebookMutationsKernel.js +6 -3
- package/lib/examples2/NotebookMutationsServiceManager.js +6 -3
- package/lib/examples2/ReactRouterExample.js +5 -5
- package/lib/examples2/main.js +38 -0
- package/lib/hooks/useAIAgentsWebSocket.js +35 -0
- package/lib/hooks/useAgentRuntimes.d.ts +22 -0
- package/lib/hooks/useAgentRuntimes.js +192 -5
- package/lib/hooks/useCheckpoints.js +2 -2
- package/lib/hooks/useToolApprovals.d.ts +10 -4
- package/lib/hooks/useToolApprovals.js +11 -5
- package/lib/models/Runtime.d.ts +10 -8
- package/lib/models/RuntimeDTO.d.ts +5 -3
- package/lib/models/RuntimeDTO.js +3 -3
- package/lib/runtimes/actions.js +3 -1
- package/lib/runtimes/apis.d.ts +7 -0
- package/lib/specs/agents/agents.d.ts +51 -0
- package/lib/specs/agents/agents.js +3389 -94
- package/lib/specs/models.d.ts +2 -0
- package/lib/specs/models.js +37 -0
- package/lib/stores/agentRuntimeStore.d.ts +32 -1
- package/lib/stores/agentRuntimeStore.js +65 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -1
- package/lib/types/agents.d.ts +9 -3
- package/lib/types/agentspecs.d.ts +2 -0
- package/lib/types/chat.d.ts +12 -0
- package/lib/types/models.d.ts +5 -0
- package/lib/types/stream.d.ts +58 -1
- package/package.json +4 -4
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +7 -0
- package/scripts/codegen/generate_models.py +22 -9
- package/scripts/gen_workers.py +340 -0
- package/lib/examples/CellSimpleExample.d.ts +0 -6
- package/lib/examples/CellSimpleExample.js +0 -20
|
@@ -345,7 +345,7 @@ function ViewerContent({ onAction, }) {
|
|
|
345
345
|
borderColor: 'border.default',
|
|
346
346
|
borderRadius: 2,
|
|
347
347
|
p: 3,
|
|
348
|
-
backgroundColor: 'canvas.
|
|
348
|
+
backgroundColor: 'canvas.default',
|
|
349
349
|
display: 'flex',
|
|
350
350
|
flexDirection: 'column',
|
|
351
351
|
gap: 3,
|
|
@@ -368,14 +368,14 @@ const A2UiViewerExample = () => {
|
|
|
368
368
|
py: 3,
|
|
369
369
|
borderBottom: '1px solid',
|
|
370
370
|
borderColor: 'border.default',
|
|
371
|
-
backgroundColor: 'canvas.
|
|
371
|
+
backgroundColor: 'canvas.default',
|
|
372
372
|
}, children: [_jsx(Text, { as: "h1", sx: { fontSize: 3, fontWeight: 'bold' }, children: "\uD83D\uDD0D A2UI Viewer" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Standalone viewer scenes powered by MessageProcessor and A2uiSurface." })] }), _jsx(ViewerContent, { onAction: handleAction }), _jsx(Box, { sx: {
|
|
373
373
|
borderTop: '1px solid',
|
|
374
374
|
borderColor: 'border.default',
|
|
375
375
|
p: 3,
|
|
376
376
|
fontFamily: 'mono',
|
|
377
377
|
fontSize: 0,
|
|
378
|
-
backgroundColor: 'canvas.
|
|
378
|
+
backgroundColor: 'canvas.default',
|
|
379
379
|
whiteSpace: 'pre-wrap',
|
|
380
380
|
maxHeight: 180,
|
|
381
381
|
overflow: 'auto',
|
|
@@ -78,7 +78,7 @@ const AgUiAgenticExample = () => {
|
|
|
78
78
|
borderColor: 'danger.muted',
|
|
79
79
|
}, children: _jsxs(Text, { sx: { color: 'danger.fg', fontSize: 1 }, children: ["Failed to initialize managed agent runtime: ", error] }) })), _jsxs(Box, { sx: {
|
|
80
80
|
padding: 4,
|
|
81
|
-
backgroundColor: 'canvas.
|
|
81
|
+
backgroundColor: 'canvas.default',
|
|
82
82
|
borderRadius: 2,
|
|
83
83
|
border: '1px solid',
|
|
84
84
|
borderColor: 'border.default',
|
|
@@ -89,11 +89,11 @@ const AgUiAgenticExample = () => {
|
|
|
89
89
|
}, children: "Try asking: \"hi\" or \"what can you help with?\"" })] }), _jsxs(Box, { sx: {
|
|
90
90
|
marginTop: 4,
|
|
91
91
|
padding: 4,
|
|
92
|
-
backgroundColor: 'canvas.
|
|
92
|
+
backgroundColor: 'canvas.default',
|
|
93
93
|
borderRadius: 2,
|
|
94
94
|
border: '1px solid',
|
|
95
95
|
borderColor: 'border.default',
|
|
96
|
-
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: "This example demonstrates the AG-UI (Agent User Interface) protocol for streaming AI interactions. The agent uses SSE (Server-Sent Events) to stream responses and tool calls in real-time." }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: [_jsx("strong", { children: "Protocol Events:" }), " TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TOOL_CALL_START, TOOL_CALL_END"] })] })] }), agenticChatEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: agenticChatEndpoint, title: "Agentic Chat", description: "Chat with a managed AG-UI agent runtime.", position: "bottom-right", defaultOpen: true, suggestions: [
|
|
96
|
+
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: "This example demonstrates the AG-UI (Agent User Interface) protocol for streaming AI interactions. The agent uses SSE (Server-Sent Events) to stream responses and tool calls in real-time." }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: [_jsx("strong", { children: "Protocol Events:" }), " TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TOOL_CALL_START, TOOL_CALL_END"] })] })] }), agenticChatEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: agenticChatEndpoint, title: "Agentic Chat", description: "Chat with a managed AG-UI agent runtime.", position: "bottom-right", defaultOpen: true, suggestions: [
|
|
97
97
|
{
|
|
98
98
|
title: 'What time is it?',
|
|
99
99
|
message: 'What is the current time?',
|
|
@@ -91,7 +91,7 @@ const AgUiBackendToolRenderingExample = () => {
|
|
|
91
91
|
marginBottom: 4,
|
|
92
92
|
}, children: ["Ask about the weather anywhere in the world. Weather cards are rendered ", _jsx("strong", { children: "inline in the chat" }), " with dynamic theming!"] }), _jsxs(Box, { sx: {
|
|
93
93
|
padding: 4,
|
|
94
|
-
backgroundColor: 'canvas.
|
|
94
|
+
backgroundColor: 'canvas.default',
|
|
95
95
|
borderRadius: 2,
|
|
96
96
|
border: '1px solid',
|
|
97
97
|
borderColor: 'border.default',
|
|
@@ -105,7 +105,7 @@ const AgUiBackendToolRenderingExample = () => {
|
|
|
105
105
|
marginTop: 1,
|
|
106
106
|
fontSize: 1,
|
|
107
107
|
color: 'fg.muted',
|
|
108
|
-
}, children: [_jsx("li", { children: "\"What's the weather in New York?\"" }), _jsx("li", { children: "\"Weather in London and Paris\"" }), _jsx("li", { children: "\"Is it sunny in Sydney?\"" }), _jsx("li", { children: "\"How's the weather in Tokyo today?\"" })] })] })] })] }), backendToolRenderingEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: backendToolRenderingEndpoint, title: "Weather Assistant", description: "Ask me about the weather anywhere in the world!", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, renderToolResult: renderToolResult, suggestions: [
|
|
108
|
+
}, children: [_jsx("li", { children: "\"What's the weather in New York?\"" }), _jsx("li", { children: "\"Weather in London and Paris\"" }), _jsx("li", { children: "\"Is it sunny in Sydney?\"" }), _jsx("li", { children: "\"How's the weather in Tokyo today?\"" })] })] })] })] }), backendToolRenderingEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: backendToolRenderingEndpoint, title: "Weather Assistant", description: "Ask me about the weather anywhere in the world!", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, renderToolResult: renderToolResult, suggestions: [
|
|
109
109
|
{
|
|
110
110
|
title: 'Paris weather',
|
|
111
111
|
message: "What's the weather like in Paris?",
|
|
@@ -129,14 +129,14 @@ const AgUiHaikuGenUiExample = () => {
|
|
|
129
129
|
marginBottom: 4,
|
|
130
130
|
}, children: "Ask the assistant to generate haiku poetry. Haikus appear both in the chat and in the display area below!" }), _jsx(Box, { sx: {
|
|
131
131
|
padding: 5,
|
|
132
|
-
backgroundColor: 'canvas.
|
|
132
|
+
backgroundColor: 'canvas.default',
|
|
133
133
|
borderRadius: 2,
|
|
134
134
|
border: '1px solid',
|
|
135
135
|
borderColor: 'border.default',
|
|
136
136
|
marginBottom: 4,
|
|
137
137
|
}, children: _jsx(HaikuDisplayWithRef, { ref: displayRef, title: "Your Haiku Collection" }) }), _jsxs(Box, { sx: {
|
|
138
138
|
padding: 4,
|
|
139
|
-
backgroundColor: 'canvas.
|
|
139
|
+
backgroundColor: 'canvas.default',
|
|
140
140
|
borderRadius: 2,
|
|
141
141
|
border: '1px solid',
|
|
142
142
|
borderColor: 'border.default',
|
|
@@ -150,7 +150,7 @@ const AgUiHaikuGenUiExample = () => {
|
|
|
150
150
|
marginTop: 1,
|
|
151
151
|
fontSize: 1,
|
|
152
152
|
color: 'fg.muted',
|
|
153
|
-
}, children: [_jsx("li", { children: "\"Write me a haiku about cherry blossoms\"" }), _jsx("li", { children: "\"Create a haiku about coding late at night\"" }), _jsx("li", { children: "\"Generate a haiku about the ocean\"" }), _jsx("li", { children: "\"Write a haiku about autumn leaves\"" })] })] })] })] }), _jsx(ChatFloating, { protocol: "ag-ui", endpoint: haikuGenUiEndpoint, launching: !haikuGenUiEndpoint, launchingMessage: "Starting the haiku agent runtime\u2026", title: "Haiku Generator", description: "Ask me to write haiku poetry about any topic!", position: "bottom-right", brandColor: brandColor, defaultOpen: true, renderToolResult: renderToolResult, hideMessagesAfterToolUI: true, suggestions: [
|
|
153
|
+
}, children: [_jsx("li", { children: "\"Write me a haiku about cherry blossoms\"" }), _jsx("li", { children: "\"Create a haiku about coding late at night\"" }), _jsx("li", { children: "\"Generate a haiku about the ocean\"" }), _jsx("li", { children: "\"Write a haiku about autumn leaves\"" })] })] })] })] }), _jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: haikuGenUiEndpoint, launching: !haikuGenUiEndpoint, launchingMessage: "Starting the haiku agent runtime\u2026", title: "Haiku Generator", description: "Ask me to write haiku poetry about any topic!", position: "bottom-right", brandColor: brandColor, defaultOpen: true, renderToolResult: renderToolResult, hideMessagesAfterToolUI: true, suggestions: [
|
|
154
154
|
{
|
|
155
155
|
title: 'Cherry blossoms',
|
|
156
156
|
message: 'Write me a haiku about cherry blossoms in spring.',
|
|
@@ -100,7 +100,7 @@ const StepsFeedback = ({ args, status, respond, result }) => {
|
|
|
100
100
|
return (_jsxs(Box, { "data-testid": "select-steps", sx: {
|
|
101
101
|
width: '100%',
|
|
102
102
|
padding: 3,
|
|
103
|
-
backgroundColor: 'canvas.
|
|
103
|
+
backgroundColor: 'canvas.default',
|
|
104
104
|
borderRadius: 2,
|
|
105
105
|
border: '1px solid',
|
|
106
106
|
borderColor: 'border.default',
|
|
@@ -211,18 +211,18 @@ const AgUiHumanInTheLoopExample = () => {
|
|
|
211
211
|
marginBottom: 4,
|
|
212
212
|
}, children: "This example demonstrates human review workflows. Ask the AI to create a plan, then use the Reject/Confirm buttons to respond." }), _jsxs(Box, { sx: {
|
|
213
213
|
padding: 4,
|
|
214
|
-
backgroundColor: 'canvas.
|
|
214
|
+
backgroundColor: 'canvas.default',
|
|
215
215
|
borderRadius: 2,
|
|
216
216
|
border: '1px solid',
|
|
217
217
|
borderColor: 'border.default',
|
|
218
218
|
marginBottom: 4,
|
|
219
219
|
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: "This demonstrates the \"Human in the Loop\" pattern where AI-generated task plans require human approval before proceeding. The pattern follows CopilotKit's useHumanInTheLoop hook." }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: _jsx("strong", { children: "How it works:" }) }), _jsxs(Box, { as: "ul", sx: { fontSize: 1, color: 'fg.muted', mt: 1, pl: 3 }, children: [_jsx("li", { children: "The agent calls the generate_task_steps tool" }), _jsx("li", { children: "A custom UI renders with toggleable steps" }), _jsx("li", { children: "User clicks Reject or Confirm to send response back" }), _jsx("li", { children: "The UI updates to show Rejected or Accepted state" })] }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: [_jsx("strong", { children: "Try:" }), " \"Create a plan to learn machine learning\" or \"Plan a trip to Paris in 5 steps\""] })] }), _jsxs(Box, { sx: {
|
|
220
220
|
padding: 4,
|
|
221
|
-
backgroundColor: '
|
|
221
|
+
backgroundColor: 'neutral.muted',
|
|
222
222
|
borderRadius: 2,
|
|
223
223
|
border: '1px solid',
|
|
224
|
-
borderColor: '
|
|
225
|
-
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Key Concept: respond() Callback" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.default' }, children: ["The ", _jsx("code", { children: "renderToolResult" }), " function receives a", ' ', _jsx("code", { children: "respond" }), " callback when the tool status is \"executing\". Calling ", _jsxs("code", { children: ["respond(", '{ accepted: true, steps: [...] }', ")"] }), ' ', "sends the user's decision back to the agent, completing the human-in-the-loop interaction."] })] })] }), humanInTheLoopEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: humanInTheLoopEndpoint, title: "Task Planner", description: "I can help you plan tasks. I'll generate steps for your review.", position: "bottom-right", brandColor: brandColor, renderToolResult: renderTaskStepsTool, hideMessagesAfterToolUI: true, suggestions: [
|
|
224
|
+
borderColor: 'border.default',
|
|
225
|
+
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Key Concept: respond() Callback" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.default' }, children: ["The ", _jsx("code", { children: "renderToolResult" }), " function receives a", ' ', _jsx("code", { children: "respond" }), " callback when the tool status is \"executing\". Calling ", _jsxs("code", { children: ["respond(", '{ accepted: true, steps: [...] }', ")"] }), ' ', "sends the user's decision back to the agent, completing the human-in-the-loop interaction."] })] })] }), humanInTheLoopEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: humanInTheLoopEndpoint, title: "Task Planner", description: "I can help you plan tasks. I'll generate steps for your review.", position: "bottom-right", brandColor: brandColor, renderToolResult: renderTaskStepsTool, hideMessagesAfterToolUI: true, suggestions: [
|
|
226
226
|
{
|
|
227
227
|
title: 'Plan a trip',
|
|
228
228
|
message: 'Plan a weekend trip to Paris.',
|
|
@@ -163,7 +163,7 @@ const AgUiSharedStateExample = () => {
|
|
|
163
163
|
color: 'fg.muted',
|
|
164
164
|
}, children: "Build a recipe together with AI. Both you and the agent can edit the recipe." })] }), _jsx(Button, { variant: "danger", onClick: handleClear, children: "Clear Recipe" })] }), _jsxs(Box, { sx: {
|
|
165
165
|
padding: 4,
|
|
166
|
-
backgroundColor: 'canvas.
|
|
166
|
+
backgroundColor: 'canvas.default',
|
|
167
167
|
borderRadius: 2,
|
|
168
168
|
border: '1px solid',
|
|
169
169
|
borderColor: 'border.default',
|
|
@@ -175,7 +175,7 @@ const AgUiSharedStateExample = () => {
|
|
|
175
175
|
marginBottom: 3,
|
|
176
176
|
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold' }, children: "Recipe Builder" }), _jsx(Label, { variant: "accent", children: "Shared State" })] }), _jsx(RecipeDisplay, { recipe: recipe, onUpdate: handleLocalUpdate })] }), _jsxs(Box, { sx: {
|
|
177
177
|
padding: 4,
|
|
178
|
-
backgroundColor: 'canvas.
|
|
178
|
+
backgroundColor: 'canvas.default',
|
|
179
179
|
borderRadius: 2,
|
|
180
180
|
border: '1px solid',
|
|
181
181
|
borderColor: 'border.default',
|
|
@@ -184,7 +184,7 @@ const AgUiSharedStateExample = () => {
|
|
|
184
184
|
marginTop: 1,
|
|
185
185
|
fontSize: 1,
|
|
186
186
|
color: 'fg.muted',
|
|
187
|
-
}, children: [_jsx("li", { children: "\"Create a recipe for chocolate chip cookies\"" }), _jsx("li", { children: "\"Add butter and sugar to the ingredients\"" }), _jsx("li", { children: "\"Update the prep time to 20 minutes\"" }), _jsx("li", { children: "\"Suggest 3 more ingredients for my recipe\"" })] })] })] })] }), sharedStateEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: sharedStateEndpoint, title: "Recipe Assistant", description: "Let's build a recipe together! I can add ingredients, instructions, and more.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
187
|
+
}, children: [_jsx("li", { children: "\"Create a recipe for chocolate chip cookies\"" }), _jsx("li", { children: "\"Add butter and sugar to the ingredients\"" }), _jsx("li", { children: "\"Update the prep time to 20 minutes\"" }), _jsx("li", { children: "\"Suggest 3 more ingredients for my recipe\"" })] })] })] })] }), sharedStateEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: sharedStateEndpoint, title: "Recipe Assistant", description: "Let's build a recipe together! I can add ingredients, instructions, and more.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
188
188
|
{
|
|
189
189
|
title: 'Pasta recipe',
|
|
190
190
|
message: 'Help me create a simple pasta recipe.',
|
|
@@ -47,7 +47,7 @@ const PlanStepItem = ({ step, index, onClick, isInteractive = false }) => {
|
|
|
47
47
|
: step.status === 'completed'
|
|
48
48
|
? 'success.subtle'
|
|
49
49
|
: isEnabled
|
|
50
|
-
? 'canvas.
|
|
50
|
+
? 'canvas.default'
|
|
51
51
|
: 'canvas.default',
|
|
52
52
|
border: '1px solid',
|
|
53
53
|
borderColor: step.status === 'in_progress'
|
|
@@ -64,7 +64,9 @@ const PlanStepItem = ({ step, index, onClick, isInteractive = false }) => {
|
|
|
64
64
|
width: '100%',
|
|
65
65
|
'&:hover': isInteractive
|
|
66
66
|
? {
|
|
67
|
-
backgroundColor: step.status === 'completed'
|
|
67
|
+
backgroundColor: step.status === 'completed'
|
|
68
|
+
? 'success.subtle'
|
|
69
|
+
: 'canvas.default',
|
|
68
70
|
borderColor: 'accent.muted',
|
|
69
71
|
}
|
|
70
72
|
: {},
|
|
@@ -242,7 +244,7 @@ const AgUiToolsBasedGenUiExample = () => {
|
|
|
242
244
|
marginBottom: 4,
|
|
243
245
|
}, children: "Watch the AI create and update a plan in real-time using STATE_SNAPSHOT and STATE_DELTA events." }), _jsxs(Box, { sx: {
|
|
244
246
|
padding: 4,
|
|
245
|
-
backgroundColor: 'canvas.
|
|
247
|
+
backgroundColor: 'canvas.default',
|
|
246
248
|
borderRadius: 2,
|
|
247
249
|
border: '1px solid',
|
|
248
250
|
borderColor: 'border.default',
|
|
@@ -250,7 +252,7 @@ const AgUiToolsBasedGenUiExample = () => {
|
|
|
250
252
|
minHeight: '300px',
|
|
251
253
|
}, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 3 }, children: "Generated Plan" }), _jsx(PlanDisplay, { plan: plan, isInteractive: true, onStepToggle: handleStepToggle, onConfirm: handleConfirm, onReject: handleReject, decision: decision })] }), _jsxs(Box, { sx: {
|
|
252
254
|
padding: 4,
|
|
253
|
-
backgroundColor: 'canvas.
|
|
255
|
+
backgroundColor: 'canvas.default',
|
|
254
256
|
borderRadius: 2,
|
|
255
257
|
border: '1px solid',
|
|
256
258
|
borderColor: 'border.default',
|
|
@@ -259,7 +261,7 @@ const AgUiToolsBasedGenUiExample = () => {
|
|
|
259
261
|
marginTop: 1,
|
|
260
262
|
fontSize: 1,
|
|
261
263
|
color: 'fg.muted',
|
|
262
|
-
}, children: [_jsx("li", { children: "STATE_SNAPSHOT - Full state replacement" }), _jsx("li", { children: "STATE_DELTA - Incremental JSON Patch updates (RFC 6902)" }), _jsx("li", { children: "TOOL_CALL_START / TOOL_CALL_END - Tool execution tracking" })] })] })] })] }), agenticGenerativeUiEndpoint && (_jsx(ChatFloating, { protocol: "ag-ui", endpoint: agenticGenerativeUiEndpoint, title: "Plan Generator", description: "I can create detailed plans and update them in real-time.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
264
|
+
}, children: [_jsx("li", { children: "STATE_SNAPSHOT - Full state replacement" }), _jsx("li", { children: "STATE_DELTA - Incremental JSON Patch updates (RFC 6902)" }), _jsx("li", { children: "TOOL_CALL_START / TOOL_CALL_END - Tool execution tracking" })] })] })] })] }), agenticGenerativeUiEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: agenticGenerativeUiEndpoint, title: "Plan Generator", description: "I can create detailed plans and update them in real-time.", position: "bottom-right", brandColor: brandColor, onStateUpdate: handleStateUpdate, suggestions: [
|
|
263
265
|
{
|
|
264
266
|
title: 'Project plan',
|
|
265
267
|
message: 'Create a project plan for building a mobile app.',
|
|
@@ -29,7 +29,8 @@ import { AuthRequiredView, ErrorView } from './components';
|
|
|
29
29
|
import { ThemedProvider } from './utils/themedProvider';
|
|
30
30
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
31
31
|
import { Chat } from '../chat';
|
|
32
|
-
import { useAgentsRuntimes,
|
|
32
|
+
import { useAgentsRuntimes, useAgentRuntimesQuery, useRefreshAgentRuntimes, } from '../hooks/useAgentRuntimes';
|
|
33
|
+
import { useExampleAgentRuntimes as useAgentRuntimes } from './hooks/useExampleAgentRuntimes';
|
|
33
34
|
import { useAgentLifecycle } from '../hooks/useCheckpoints';
|
|
34
35
|
import { useDeletePausedAgentRuntime } from '../hooks/useCheckpoints';
|
|
35
36
|
import { AGENT_STATUS_COLORS } from '../types/agents';
|
|
@@ -189,10 +190,10 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
189
190
|
id: rt.id,
|
|
190
191
|
podName: rt.pod_name,
|
|
191
192
|
name: rt.name,
|
|
192
|
-
description: rt.
|
|
193
|
+
description: rt.environment.title || rt.environment.name,
|
|
193
194
|
status: rt.status,
|
|
194
195
|
protocol: 'vercel-ai',
|
|
195
|
-
environmentName: rt.
|
|
196
|
+
environmentName: rt.environment.name,
|
|
196
197
|
jupyterBaseUrl: rt.url,
|
|
197
198
|
}));
|
|
198
199
|
}, [agentRuntimes, runningAgentsOverride]);
|
|
@@ -312,7 +313,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
312
313
|
borderRight: '1px solid',
|
|
313
314
|
borderColor: 'border.default',
|
|
314
315
|
overflowY: 'auto',
|
|
315
|
-
bg: 'canvas.
|
|
316
|
+
bg: 'canvas.default',
|
|
316
317
|
}, children: [_jsxs(Box, { sx: {
|
|
317
318
|
order: 3,
|
|
318
319
|
p: 3,
|
|
@@ -435,7 +436,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
435
436
|
gap: 3,
|
|
436
437
|
px: 3,
|
|
437
438
|
}, 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') &&
|
|
438
|
-
runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", brandIcon: _jsx(AgentIcon, { size: 16 }), placeholder: "Ask about sales KPIs\u2026", description: "Monitor Sales KPI agent with pause/resume checkpointing", showHeader: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
439
|
+
runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", brandIcon: _jsx(AgentIcon, { size: 16 }), placeholder: "Ask about sales KPIs\u2026", description: "Monitor Sales KPI agent with pause/resume checkpointing", showHeader: true, kernelIndicatorPlacement: "right", showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
439
440
|
{
|
|
440
441
|
title: 'KPIs',
|
|
441
442
|
message: "Show me today's sales KPI dashboard",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* AgentCodeSandboxExample
|
|
3
3
|
*
|
|
4
4
|
* Demonstrates sandbox variant switching (eval / jupyter) with a live
|
|
5
5
|
* sidebar that streams WebSocket messages to and from the
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* - Sidebar shows live sandbox status, WebSocket event log, and an
|
|
11
11
|
* interrupt button
|
|
12
12
|
*
|
|
13
|
-
* @module examples/
|
|
13
|
+
* @module examples/AgentCodeSandboxExample
|
|
14
14
|
*/
|
|
15
15
|
import React from 'react';
|
|
16
|
-
declare const
|
|
17
|
-
export default
|
|
16
|
+
declare const AgentCodeSandboxExample: React.FC;
|
|
17
|
+
export default AgentCodeSandboxExample;
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* Distributed under the terms of the Modified BSD License.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* AgentCodeSandboxExample
|
|
8
8
|
*
|
|
9
9
|
* Demonstrates sandbox variant switching (eval / jupyter) with a live
|
|
10
10
|
* sidebar that streams WebSocket messages to and from the
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
* - Sidebar shows live sandbox status, WebSocket event log, and an
|
|
16
16
|
* interrupt button
|
|
17
17
|
*
|
|
18
|
-
* @module examples/
|
|
18
|
+
* @module examples/AgentCodeSandboxExample
|
|
19
19
|
*/
|
|
20
20
|
/// <reference types="vite/client" />
|
|
21
21
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
@@ -59,7 +59,7 @@ function apiVariantFromUi(variant) {
|
|
|
59
59
|
return variant;
|
|
60
60
|
}
|
|
61
61
|
// ─── Inner component (after auth) ──────────────────────────────────────────
|
|
62
|
-
const
|
|
62
|
+
const AgentCodeSandboxInner = ({ onLogout, }) => {
|
|
63
63
|
const { token } = useSimpleAuthStore();
|
|
64
64
|
const agentName = useRef(uniqueAgentId(AGENT_NAME)).current;
|
|
65
65
|
const chatAuthToken = token === null ? undefined : token;
|
|
@@ -377,9 +377,10 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
377
377
|
display: 'flex',
|
|
378
378
|
flexDirection: 'column',
|
|
379
379
|
minHeight: 0,
|
|
380
|
-
bg: 'canvas.
|
|
380
|
+
bg: 'canvas.default',
|
|
381
381
|
}, children: [_jsxs(Box, { sx: {
|
|
382
382
|
p: 2,
|
|
383
|
+
bg: 'canvas.default',
|
|
383
384
|
borderBottom: '1px solid',
|
|
384
385
|
borderColor: 'border.default',
|
|
385
386
|
}, children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, mb: 1 }, children: "Sandbox Details" }), _jsxs(Box, { sx: {
|
|
@@ -441,7 +442,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
441
442
|
py: '2px',
|
|
442
443
|
color: entry.direction === 'sent' ? 'accent.fg' : 'fg.default',
|
|
443
444
|
bg: entry.direction === 'sent'
|
|
444
|
-
? '
|
|
445
|
+
? 'neutral.muted'
|
|
445
446
|
: 'transparent',
|
|
446
447
|
borderBottom: '1px solid',
|
|
447
448
|
borderColor: 'border.subtle',
|
|
@@ -463,7 +464,7 @@ const AgentSandboxInner = ({ onLogout, }) => {
|
|
|
463
464
|
py: 1,
|
|
464
465
|
borderBottom: '1px solid',
|
|
465
466
|
borderColor: 'border.default',
|
|
466
|
-
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running \u2014 reconnected." }) })), _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: [_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Sandbox Agent", brandIcon: _jsx(TerminalIcon, { size: 16 }), placeholder: "Ask the agent to write and run code\u2026", showHeader: true, showNewChatButton: true, showClearButton: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsxs(SegmentedControl, { "aria-label": "Sandbox variant", size: "small", onChange: index => {
|
|
467
|
+
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running \u2014 reconnected." }) })), _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: [_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Sandbox Agent", brandIcon: _jsx(TerminalIcon, { size: 16 }), placeholder: "Ask the agent to write and run code\u2026", showHeader: true, kernelIndicatorPlacement: "right", showNewChatButton: true, showClearButton: true, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsxs(SegmentedControl, { "aria-label": "Sandbox variant", size: "small", onChange: index => {
|
|
467
468
|
if (isTransitionLocked)
|
|
468
469
|
return;
|
|
469
470
|
void switchVariant(index === 0 ? 'eval' : 'jupyter');
|
|
@@ -495,7 +496,7 @@ const syncTokenToIamStore = (newToken) => {
|
|
|
495
496
|
iamStore.setState({ token: newToken });
|
|
496
497
|
});
|
|
497
498
|
};
|
|
498
|
-
const
|
|
499
|
+
const AgentCodeSandboxExample = () => {
|
|
499
500
|
const { token, clearAuth } = useSimpleAuthStore();
|
|
500
501
|
const hasSynced = useRef(false);
|
|
501
502
|
useEffect(() => {
|
|
@@ -514,6 +515,6 @@ const AgentSandboxExample = () => {
|
|
|
514
515
|
if (!token) {
|
|
515
516
|
return (_jsx(ThemedProvider, { children: _jsx(AuthRequiredView, {}) }));
|
|
516
517
|
}
|
|
517
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemedProvider, { children: _jsx(
|
|
518
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemedProvider, { children: _jsx(AgentCodeSandboxInner, { onLogout: handleLogout }) }) }));
|
|
518
519
|
};
|
|
519
|
-
export default
|
|
520
|
+
export default AgentCodeSandboxExample;
|
|
@@ -149,7 +149,7 @@ const AgentCodeSandboxesInner = ({ onLogout, }) => {
|
|
|
149
149
|
display: 'flex',
|
|
150
150
|
flexDirection: 'column',
|
|
151
151
|
gap: 3,
|
|
152
|
-
bg: 'canvas.
|
|
152
|
+
bg: 'canvas.default',
|
|
153
153
|
}, 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 a sandbox variant-backed spec, launch the agent, then run code from chat to compare behavior across sandboxes." }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", selectedOption.specId] }), _jsxs(Label, { variant: "secondary", children: ["Variant: ", selectedOption.variant] }), _jsx(Label, { variant: "success", children: "Codemode: enabled" })] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Sandbox Variant" }), _jsx("select", { value: selectedSpecId, onChange: event => {
|
|
154
154
|
setSelectedSpecId(event.target.value);
|
|
155
155
|
}, style: {
|
|
@@ -164,7 +164,7 @@ const AgentCodeSandboxesInner = ({ onLogout, }) => {
|
|
|
164
164
|
void launchAgent();
|
|
165
165
|
}, disabled: isLaunching, sx: { width: '100%', maxWidth: 420 }, children: isLaunching ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : (`Launch ${selectedOption.title}`) }), error && _jsx(ErrorView, { error: error, onLogout: onLogout })] }));
|
|
166
166
|
}
|
|
167
|
-
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, runtimeId: agentId, title: `Code Sandboxes: ${activeOption.title}`, description: `Spec ${activeOption.specId} (${activeOption.variant})`, brandIcon: _jsx(PackageIcon, { size: 16 }), showHeader: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
167
|
+
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, runtimeId: agentId, title: `Code Sandboxes: ${activeOption.title}`, description: `Spec ${activeOption.specId} (${activeOption.variant})`, brandIcon: _jsx(PackageIcon, { size: 16 }), showHeader: true, kernelIndicatorPlacement: "right", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
168
168
|
{
|
|
169
169
|
title: 'Identify sandbox variant',
|
|
170
170
|
message: 'Use execute_code to print(os.getenv("DATALAYER_CODE_SANDBOX_VARIANT")) and summarize the result.',
|
|
@@ -46,7 +46,7 @@ const DEMO_AGENT_CONFIGS = [
|
|
|
46
46
|
subtitle: 'Raw MCP tools without codemode conversion',
|
|
47
47
|
suggestionMessage: NO_CODEMODE_SUGGESTION_MESSAGE,
|
|
48
48
|
specId: 'example-no-codemode',
|
|
49
|
-
color: '#
|
|
49
|
+
color: '#16A085',
|
|
50
50
|
baseUrl: NO_CODEMODE_BASE_URL,
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -374,7 +374,7 @@ const AgentRuntimePane = ({ config, token, onTokenConsumed, onAgentIdChange, onC
|
|
|
374
374
|
minHeight: 560,
|
|
375
375
|
display: 'flex',
|
|
376
376
|
flexDirection: 'column',
|
|
377
|
-
}, children: _jsx(Box, { sx: { flex: 1, minHeight: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: config.baseUrl, agentId: agentId, authToken: token, title: config.title, brandIcon: _jsx(CodeIcon, { size: 16 }), subtitle: config.subtitle, placeholder: "Ask both agents the same request to compare behavior...", description: config.subtitle, showHeader: true, headerActions: isReconnectedAgent ? (_jsx(Label, { size: "small", variant: "attention", children: "Reconnected" })) : undefined, autoFocus: false, height: "100%", runtimeId: agentId, historyEndpoint: `${config.baseUrl}/api/v1/history`, mcpStatusData: mcpStatusData, codemodeStatusData: codemodeStatusData, codemodeEnabled: codemodeEnabled, onToggleCodemode: handleToggleCodemode, suggestions: [
|
|
377
|
+
}, children: _jsx(Box, { sx: { flex: 1, minHeight: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: config.baseUrl, agentId: agentId, authToken: token, title: config.title, brandIcon: _jsx(CodeIcon, { size: 16 }), subtitle: config.subtitle, placeholder: "Ask both agents the same request to compare behavior...", description: config.subtitle, showHeader: true, kernelIndicatorPlacement: "right", headerActions: isReconnectedAgent ? (_jsx(Label, { size: "small", variant: "attention", children: "Reconnected" })) : undefined, autoFocus: false, height: "100%", runtimeId: agentId, historyEndpoint: `${config.baseUrl}/api/v1/history`, mcpStatusData: mcpStatusData, codemodeStatusData: codemodeStatusData, codemodeEnabled: codemodeEnabled, onToggleCodemode: handleToggleCodemode, suggestions: [
|
|
378
378
|
{
|
|
379
379
|
title: 'Datalayer extraction',
|
|
380
380
|
message: config.suggestionMessage,
|
|
@@ -436,7 +436,7 @@ const AgentCodemodeInner = ({ onLogout, }) => {
|
|
|
436
436
|
emoji: '🤝',
|
|
437
437
|
title: 'Tie',
|
|
438
438
|
message: 'Both agents are tied on token usage.',
|
|
439
|
-
bg: 'canvas.
|
|
439
|
+
bg: 'canvas.default',
|
|
440
440
|
borderColor: 'border.default',
|
|
441
441
|
color: 'fg.default',
|
|
442
442
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCompactionExample
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates history compaction. Before launching, the user picks a context
|
|
5
|
+
* token ceiling (capped at the agentspec model's tokens_limit). A lower ceiling
|
|
6
|
+
* makes the agent summarize older messages sooner. When compaction runs, a
|
|
7
|
+
* live panel shows a spinner and the details (from/to tokens, from/to messages,
|
|
8
|
+
* and time taken).
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
declare const AgentCompactionExample: React.FC;
|
|
12
|
+
export default AgentCompactionExample;
|