@datalayer/agent-runtimes 1.0.4 → 1.0.6
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 +182 -1
- package/lib/AgentNode.d.ts +3 -0
- package/lib/AgentNode.js +676 -0
- package/lib/App.js +1 -1
- package/lib/agent-node/themeStore.d.ts +3 -0
- package/lib/agent-node/themeStore.js +156 -0
- package/lib/agent-node-main.d.ts +1 -0
- package/lib/agent-node-main.js +14 -0
- package/lib/agents/AgentDetails.d.ts +22 -1
- package/lib/agents/AgentDetails.js +34 -47
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +4 -2
- package/lib/chat/Chat.d.ts +5 -106
- package/lib/chat/Chat.js +20 -14
- package/lib/chat/ChatFloating.d.ts +7 -140
- package/lib/chat/ChatFloating.js +3 -3
- package/lib/chat/ChatPopupStandalone.d.ts +8 -47
- package/lib/chat/ChatPopupStandalone.js +3 -3
- package/lib/chat/ChatSidebar.d.ts +4 -69
- package/lib/chat/ChatSidebar.js +83 -51
- package/lib/chat/ChatStandalone.d.ts +4 -54
- package/lib/chat/ChatStandalone.js +3 -3
- package/lib/chat/base/ChatBase.js +1414 -174
- package/lib/chat/display/FloatingBrandButton.js +8 -1
- package/lib/chat/header/ChatHeader.d.ts +3 -1
- package/lib/chat/header/ChatHeader.js +15 -12
- package/lib/chat/header/ChatHeaderBase.d.ts +30 -5
- package/lib/chat/header/ChatHeaderBase.js +41 -16
- package/lib/chat/indicators/McpStatusIndicator.d.ts +7 -4
- package/lib/chat/indicators/McpStatusIndicator.js +7 -32
- package/lib/chat/indicators/SandboxStatusIndicator.d.ts +4 -1
- package/lib/chat/indicators/SandboxStatusIndicator.js +91 -56
- package/lib/chat/indicators/SkillsStatusIndicator.d.ts +7 -0
- package/lib/chat/indicators/SkillsStatusIndicator.js +88 -0
- package/lib/chat/indicators/index.d.ts +1 -0
- package/lib/chat/indicators/index.js +1 -0
- package/lib/chat/messages/ChatMessageList.d.ts +1 -1
- package/lib/chat/messages/ChatMessageList.js +154 -114
- package/lib/chat/messages/ChatMessages.js +6 -2
- package/lib/chat/prompt/InputFooter.d.ts +21 -6
- package/lib/chat/prompt/InputFooter.js +76 -20
- package/lib/chat/prompt/InputPrompt.d.ts +5 -1
- package/lib/chat/prompt/InputPrompt.js +4 -4
- package/lib/chat/prompt/InputPromptFooter.d.ts +3 -1
- package/lib/chat/prompt/InputPromptFooter.js +3 -3
- package/lib/chat/prompt/InputPromptLexical.d.ts +3 -1
- package/lib/chat/prompt/InputPromptLexical.js +12 -5
- package/lib/chat/prompt/InputPromptText.d.ts +3 -1
- package/lib/chat/prompt/InputPromptText.js +2 -2
- package/lib/chat/tools/ToolApprovalBanner.js +1 -1
- package/lib/chat/tools/ToolCallDisplay.d.ts +3 -1
- package/lib/chat/tools/ToolCallDisplay.js +2 -2
- package/lib/chat/usage/TokenUsageBar.js +20 -2
- package/lib/client/AgentRuntimesClientContext.d.ts +53 -0
- package/lib/client/AgentRuntimesClientContext.js +55 -0
- package/lib/client/AgentsMixin.d.ts +0 -18
- package/lib/client/AgentsMixin.js +20 -30
- package/lib/client/IAgentRuntimesClient.d.ts +215 -0
- package/lib/client/IAgentRuntimesClient.js +5 -0
- package/lib/client/SdkAgentRuntimesClient.d.ts +151 -0
- package/lib/client/SdkAgentRuntimesClient.js +134 -0
- package/lib/client/index.d.ts +4 -1
- package/lib/client/index.js +3 -1
- package/lib/components/NotificationEventCard.js +5 -1
- package/lib/config/AgentConfiguration.d.ts +22 -0
- package/lib/config/AgentConfiguration.js +319 -64
- package/lib/context/ContextDistribution.d.ts +3 -1
- package/lib/context/ContextDistribution.js +8 -27
- package/lib/context/ContextInspector.d.ts +3 -1
- package/lib/context/ContextInspector.js +19 -67
- package/lib/context/ContextPanel.d.ts +3 -1
- package/lib/context/ContextPanel.js +104 -64
- package/lib/context/ContextUsage.d.ts +3 -1
- package/lib/context/ContextUsage.js +3 -3
- package/lib/context/CostTracker.d.ts +9 -3
- package/lib/context/CostTracker.js +26 -47
- package/lib/context/CostUsageChart.d.ts +12 -0
- package/lib/context/CostUsageChart.js +378 -0
- package/lib/context/GraphFlowChart.d.ts +16 -0
- package/lib/context/GraphFlowChart.js +182 -0
- package/lib/context/TokenUsageChart.d.ts +8 -1
- package/lib/context/TokenUsageChart.js +349 -211
- package/lib/context/TurnGraphChart.d.ts +39 -0
- package/lib/context/TurnGraphChart.js +538 -0
- package/lib/context/otelWsPool.d.ts +20 -0
- package/lib/context/otelWsPool.js +69 -0
- package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -17
- package/lib/examples/A2UiComponentGalleryExample.js +315 -522
- package/lib/examples/A2UiContactCardExample.d.ts +0 -18
- package/lib/examples/A2UiContactCardExample.js +154 -411
- package/lib/examples/A2UiRestaurantExample.d.ts +0 -30
- package/lib/examples/A2UiRestaurantExample.js +114 -212
- package/lib/examples/A2UiViewerExample.d.ts +0 -18
- package/lib/examples/A2UiViewerExample.js +283 -532
- package/lib/examples/AgUiBackendToolRenderingExample.js +1 -1
- package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -1
- package/lib/examples/AgUiHaikuGenUiExample.js +1 -1
- package/lib/examples/AgUiSharedStateExample.js +2 -1
- package/lib/examples/AgentCheckpointsExample.js +14 -28
- package/lib/examples/AgentCodemodeExample.d.ts +4 -6
- package/lib/examples/AgentCodemodeExample.js +603 -169
- package/lib/examples/AgentEvalsExample.js +339 -53
- package/lib/examples/AgentGuardrailsExample.js +383 -66
- package/lib/examples/AgentHooksExample.d.ts +3 -0
- package/lib/examples/AgentHooksExample.js +122 -0
- package/lib/examples/AgentInferenceProviderExample.d.ts +3 -0
- package/lib/examples/AgentInferenceProviderExample.js +329 -0
- package/lib/examples/AgentMCPExample.d.ts +3 -0
- package/lib/examples/AgentMCPExample.js +481 -0
- package/lib/examples/AgentMemoryExample.d.ts +1 -2
- package/lib/examples/AgentMemoryExample.js +78 -33
- package/lib/examples/AgentMonitoringExample.js +261 -200
- package/lib/examples/AgentNotificationsExample.d.ts +1 -2
- package/lib/examples/AgentNotificationsExample.js +114 -33
- package/lib/examples/AgentOtelExample.js +32 -42
- package/lib/examples/AgentOutputsExample.d.ts +11 -6
- package/lib/examples/AgentOutputsExample.js +433 -81
- package/lib/examples/AgentParametersExample.d.ts +3 -0
- package/lib/examples/AgentParametersExample.js +248 -0
- package/lib/examples/AgentSandboxExample.d.ts +3 -3
- package/lib/examples/AgentSandboxExample.js +74 -45
- package/lib/examples/AgentSkillsExample.js +95 -103
- package/lib/examples/AgentSubagentsExample.d.ts +14 -0
- package/lib/examples/AgentSubagentsExample.js +228 -0
- package/lib/examples/AgentToolApprovalsExample.js +49 -561
- package/lib/examples/AgentTriggersExample.js +823 -569
- package/lib/examples/{AgentspecExample.d.ts → AgentspecsExample.d.ts} +2 -2
- package/lib/examples/AgentspecsExample.js +1096 -0
- package/lib/examples/ChatCustomExample.js +16 -28
- package/lib/examples/ChatExample.js +13 -29
- package/lib/examples/CopilotKitLexicalExample.js +2 -1
- package/lib/examples/CopilotKitNotebookExample.js +2 -1
- package/lib/examples/HomeExample.d.ts +15 -0
- package/lib/examples/HomeExample.js +77 -0
- package/lib/examples/Lexical2Example.js +4 -2
- package/lib/examples/{LexicalExample.d.ts → LexicalAgentExample.d.ts} +4 -4
- package/lib/examples/{LexicalExample.js → LexicalAgentExample.js} +66 -17
- package/lib/examples/{LexicalSidebarExample.d.ts → LexicalAgentSidebarExample.d.ts} +5 -5
- package/lib/examples/LexicalAgentSidebarExample.js +261 -0
- package/lib/examples/NotebookAgentExample.d.ts +9 -0
- package/lib/examples/NotebookAgentExample.js +192 -0
- package/lib/examples/{NotebookSidebarExample.d.ts → NotebookAgentSidebarExample.d.ts} +2 -2
- package/lib/examples/NotebookAgentSidebarExample.js +221 -0
- package/lib/examples/{DatalayerNotebookExample.d.ts → NotebookCollaborationExample.d.ts} +4 -4
- package/lib/examples/{DatalayerNotebookExample.js → NotebookCollaborationExample.js} +3 -3
- package/lib/examples/NotebookExample.d.ts +4 -7
- package/lib/examples/NotebookExample.js +14 -146
- package/lib/examples/components/AuthRequiredView.d.ts +6 -0
- package/lib/examples/components/AuthRequiredView.js +33 -0
- package/lib/examples/components/ExampleWrapper.d.ts +9 -3
- package/lib/examples/components/ExampleWrapper.js +45 -9
- package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.js +1 -1
- package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.js +1 -1
- package/lib/examples/{ag-ui → components}/haiku/index.d.ts +1 -1
- package/lib/examples/{ag-ui → components}/haiku/index.js +1 -1
- package/lib/examples/components/index.d.ts +3 -0
- package/lib/examples/components/index.js +4 -0
- package/lib/examples/{ag-ui → components}/weather/index.d.ts +1 -1
- package/lib/examples/{ag-ui → components}/weather/index.js +1 -1
- package/lib/examples/example-selector.d.ts +17 -4
- package/lib/examples/example-selector.js +108 -41
- package/lib/examples/index.d.ts +10 -6
- package/lib/examples/index.js +10 -6
- package/lib/examples/lexical/initial-content.json +6 -6
- package/lib/examples/main.js +257 -27
- package/lib/examples/utils/a2ui.d.ts +18 -0
- package/lib/examples/utils/a2ui.js +69 -0
- package/lib/examples/utils/a2uiMarkdownProvider.d.ts +7 -0
- package/lib/examples/utils/a2uiMarkdownProvider.js +9 -0
- package/lib/examples/utils/agentId.d.ts +18 -0
- package/lib/examples/utils/agentId.js +54 -0
- package/lib/examples/utils/agents/earthquake-detector.json +11 -11
- package/lib/examples/utils/agents/sales-forecaster.json +11 -11
- package/lib/examples/utils/agents/social-post-generator.json +11 -11
- package/lib/examples/utils/agents/stock-market.json +11 -11
- package/lib/examples/utils/examplesStore.js +82 -27
- package/lib/examples/utils/useExampleAgentRuntimesUrl.d.ts +5 -0
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +19 -0
- package/lib/hooks/index.d.ts +8 -8
- package/lib/hooks/index.js +7 -7
- package/lib/hooks/useA2A.d.ts +2 -3
- package/lib/hooks/useAIAgentsWebSocket.d.ts +43 -4
- package/lib/hooks/useAIAgentsWebSocket.js +153 -12
- package/lib/hooks/useAcp.d.ts +1 -2
- package/lib/hooks/useAgUi.d.ts +1 -1
- package/lib/hooks/{useAgents.d.ts → useAgentRuntimes.d.ts} +70 -4
- package/lib/hooks/{useAgents.js → useAgentRuntimes.js} +237 -32
- package/lib/hooks/useAgentsCatalog.js +1 -1
- package/lib/hooks/useAgentsService.d.ts +2 -2
- package/lib/hooks/useAgentsService.js +7 -7
- package/lib/hooks/useCheckpoints.js +1 -1
- package/lib/hooks/useConfig.d.ts +4 -1
- package/lib/hooks/useConfig.js +10 -3
- package/lib/hooks/useContextSnapshot.d.ts +9 -4
- package/lib/hooks/useContextSnapshot.js +9 -37
- package/lib/hooks/useMonitoring.js +3 -0
- package/lib/hooks/useSandbox.d.ts +20 -8
- package/lib/hooks/useSandbox.js +105 -40
- package/lib/hooks/useSkills.d.ts +23 -5
- package/lib/hooks/useSkills.js +94 -39
- package/lib/hooks/useToolApprovals.d.ts +60 -36
- package/lib/hooks/useToolApprovals.js +318 -69
- package/lib/hooks/useVercelAI.d.ts +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/inference/index.d.ts +0 -1
- package/lib/middleware/index.d.ts +0 -1
- package/lib/protocols/AGUIAdapter.js +6 -0
- package/lib/protocols/VercelAIAdapter.d.ts +7 -0
- package/lib/protocols/VercelAIAdapter.js +59 -7
- package/lib/specs/agents/agents.d.ts +21 -4
- package/lib/specs/agents/agents.js +2879 -316
- package/lib/specs/agents/index.js +3 -1
- package/lib/specs/benchmarks.d.ts +20 -0
- package/lib/specs/benchmarks.js +205 -0
- package/lib/specs/envvars.js +27 -20
- package/lib/specs/evals.d.ts +10 -9
- package/lib/specs/evals.js +128 -88
- package/lib/specs/events.d.ts +3 -10
- package/lib/specs/events.js +127 -84
- package/lib/specs/frontendTools.js +2 -2
- package/lib/specs/guardrails.d.ts +0 -7
- package/lib/specs/guardrails.js +240 -159
- package/lib/specs/mcpServers.js +35 -6
- package/lib/specs/memory.d.ts +0 -2
- package/lib/specs/memory.js +4 -17
- package/lib/specs/models.d.ts +0 -2
- package/lib/specs/models.js +20 -15
- package/lib/specs/notifications.js +102 -18
- package/lib/specs/outputs.js +15 -9
- package/lib/specs/personas.d.ts +41 -0
- package/lib/specs/personas.js +168 -0
- package/lib/specs/skills.d.ts +1 -1
- package/lib/specs/skills.js +23 -23
- package/lib/specs/teams/index.js +3 -1
- package/lib/specs/teams/teams.js +468 -348
- package/lib/specs/tools.js +4 -4
- package/lib/specs/triggers.js +61 -11
- package/lib/stores/agentRuntimeStore.d.ts +208 -0
- package/lib/stores/agentRuntimeStore.js +650 -0
- package/lib/stores/conversationStore.js +2 -2
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -1
- package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +1 -2
- package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -3
- package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +1 -2
- package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -3
- package/lib/tools/index.d.ts +0 -2
- package/lib/tools/index.js +0 -1
- package/lib/types/agents-lifecycle.d.ts +18 -0
- package/lib/types/agents.d.ts +6 -0
- package/lib/types/agentspecs.d.ts +54 -1
- package/lib/types/benchmarks.d.ts +43 -0
- package/lib/types/benchmarks.js +5 -0
- package/lib/types/chat.d.ts +325 -8
- package/lib/types/context.d.ts +27 -0
- package/lib/types/cost.d.ts +2 -2
- package/lib/types/evals.d.ts +26 -17
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +3 -0
- package/lib/types/mcp.d.ts +8 -0
- package/lib/types/models.d.ts +2 -2
- package/lib/types/personas.d.ts +25 -0
- package/lib/types/personas.js +5 -0
- package/lib/types/skills.d.ts +43 -1
- package/lib/types/stream.d.ts +110 -0
- package/lib/types/stream.js +36 -0
- package/lib/utils/utils.d.ts +9 -5
- package/lib/utils/utils.js +9 -5
- package/package.json +19 -11
- package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_benchmarks.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +187 -45
- package/scripts/codegen/generate_benchmarks.py +441 -0
- package/scripts/codegen/generate_evals.py +94 -16
- package/scripts/codegen/generate_events.py +35 -14
- package/scripts/codegen/generate_personas.py +319 -0
- package/scripts/codegen/generate_skills.py +9 -9
- package/scripts/sync-jupyter.sh +26 -7
- package/lib/api/tool-approvals.d.ts +0 -62
- package/lib/api/tool-approvals.js +0 -145
- package/lib/examples/AgentspecExample.js +0 -705
- package/lib/examples/LexicalSidebarExample.js +0 -163
- package/lib/examples/NotebookSidebarExample.js +0 -119
- package/lib/examples/NotebookSimpleExample.d.ts +0 -6
- package/lib/examples/NotebookSimpleExample.js +0 -22
- package/lib/examples/ag-ui/index.d.ts +0 -10
- package/lib/examples/ag-ui/index.js +0 -16
- package/lib/hooks/useAgentsRegistry.d.ts +0 -10
- package/lib/hooks/useAgentsRegistry.js +0 -20
- package/lib/stores/agentsStore.d.ts +0 -123
- package/lib/stores/agentsStore.js +0 -270
- /package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.d.ts +0 -0
- /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.js +0 -0
|
@@ -20,7 +20,7 @@ import { Text } from '@primer/react';
|
|
|
20
20
|
import { Box } from '@datalayer/primer-addons';
|
|
21
21
|
import { ThemedProvider, useThemeBrandColor } from './utils/themedProvider';
|
|
22
22
|
import { ChatFloating } from '../chat';
|
|
23
|
-
import { InlineWeatherCard } from './
|
|
23
|
+
import { InlineWeatherCard } from './components/weather';
|
|
24
24
|
// AG-UI endpoint for backend tool rendering example
|
|
25
25
|
const BACKEND_TOOL_RENDERING_ENDPOINT = 'http://localhost:8765/api/v1/examples/backend_tool_rendering/';
|
|
26
26
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Backend: /api/v1/examples/haiku_generative_ui/
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import { type HaikuResult } from './
|
|
15
|
+
import { type HaikuResult } from './components/haiku';
|
|
16
16
|
/**
|
|
17
17
|
* Ref handle for haiku state synchronization between chat and main display
|
|
18
18
|
*/
|
|
@@ -21,7 +21,7 @@ import { Text } from '@primer/react';
|
|
|
21
21
|
import { Box } from '@datalayer/primer-addons';
|
|
22
22
|
import { ThemedProvider, useThemeBrandColor } from './utils/themedProvider';
|
|
23
23
|
import { ChatFloating } from '../chat';
|
|
24
|
-
import { InlineHaikuCard, HaikuDisplay } from './
|
|
24
|
+
import { InlineHaikuCard, HaikuDisplay, } from './components/haiku';
|
|
25
25
|
// AG-UI endpoint for haiku generative UI example
|
|
26
26
|
const HAIKU_ENDPOINT = 'http://localhost:8765/api/v1/examples/haiku_generative_ui/';
|
|
27
27
|
/**
|
|
@@ -127,7 +127,8 @@ const AgUiSharedStateExample = () => {
|
|
|
127
127
|
setRecipe(DEFAULT_RECIPE);
|
|
128
128
|
}, []);
|
|
129
129
|
return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
|
|
130
|
-
|
|
130
|
+
height: '100%',
|
|
131
|
+
overflow: 'auto',
|
|
131
132
|
backgroundColor: 'canvas.default',
|
|
132
133
|
padding: 4,
|
|
133
134
|
}, children: [_jsxs(Box, { sx: {
|
|
@@ -23,18 +23,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
23
23
|
import { useState, useCallback, useEffect, useRef, useMemo, } from 'react';
|
|
24
24
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
25
25
|
import { Text, Button, IconButton, Spinner, Label, Flash, Heading, Tooltip, } from '@primer/react';
|
|
26
|
-
import { AlertIcon, PlayIcon, SquareIcon, HistoryIcon, CheckCircleIcon,
|
|
26
|
+
import { AlertIcon, PlayIcon, SquareIcon, HistoryIcon, CheckCircleIcon, XCircleIcon, ClockIcon, TagIcon, GlobeIcon, ZapIcon, GraphIcon, AiModelIcon, PeopleIcon, SidebarCollapseIcon, SidebarExpandIcon, SyncIcon, AgentIcon, } from '@primer/octicons-react';
|
|
27
27
|
import { Box } from '@datalayer/primer-addons';
|
|
28
|
-
import { ErrorView } from './components';
|
|
29
|
-
import { coreStore } from '@datalayer/core';
|
|
28
|
+
import { AuthRequiredView, ErrorView } from './components';
|
|
30
29
|
import { ThemedProvider } from './utils/themedProvider';
|
|
31
30
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
32
|
-
import { SignInSimple } from '@datalayer/core/lib/views/iam';
|
|
33
|
-
import { UserBadge } from '@datalayer/core/lib/views/profile';
|
|
34
31
|
import { Chat } from '../chat';
|
|
35
|
-
import {
|
|
32
|
+
import { useAgentRuntimes, useAgentRuntimesQuery, useRefreshAgentRuntimes, useDeleteAgentRuntime, } from '../hooks/useAgentRuntimes';
|
|
36
33
|
import { useAgentLifecycle } from '../hooks/useCheckpoints';
|
|
37
|
-
import { useAgentRuntimes, useRefreshAgentRuntimes, useDeleteAgentRuntime, } from '../hooks/useAgents';
|
|
38
34
|
import { useDeletePausedAgentRuntime } from '../hooks/useCheckpoints';
|
|
39
35
|
import { AGENT_STATUS_COLORS } from '../types/agents';
|
|
40
36
|
const queryClient = new QueryClient();
|
|
@@ -53,8 +49,8 @@ const AGENT_SPEC = {
|
|
|
53
49
|
id: 'monitor-sales-kpis',
|
|
54
50
|
name: 'Monitor Sales KPIs',
|
|
55
51
|
description: 'Monitor and analyze sales KPIs from the CRM system. Generate daily reports, identify trends, and flag anomalies.',
|
|
56
|
-
model: 'bedrock:us.anthropic.claude-
|
|
57
|
-
protocol: '
|
|
52
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
53
|
+
protocol: 'vercel-ai',
|
|
58
54
|
memory: 'mem0',
|
|
59
55
|
sandbox_variant: 'jupyter',
|
|
60
56
|
environment_name: 'ai-agents-env',
|
|
@@ -89,14 +85,14 @@ const SpecRow = ({ icon: Icon, label, value }) => (_jsxs(Box, { sx: {
|
|
|
89
85
|
}, 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 })] }));
|
|
90
86
|
// ─── Inner component (rendered after auth) ─────────────────────────────────
|
|
91
87
|
const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
92
|
-
const {
|
|
93
|
-
const { runtime, status: runtimeStatus, endpoint: _agentEndpoint, isReady, error: hookError, launchRuntime, connectToRuntime, disconnect, } = useAgents({
|
|
88
|
+
const { runtime, status: runtimeStatus, endpoint: _agentEndpoint, isReady, error: hookError, launchRuntime, connectToRuntime, disconnect, } = useAgentRuntimes({
|
|
94
89
|
agentSpecId: AGENT_SPEC_ID,
|
|
95
90
|
autoStart: false,
|
|
96
91
|
agentSpec: AGENT_SPEC,
|
|
97
92
|
agentConfig: {
|
|
98
93
|
name: DEMO_AGENT_NAME,
|
|
99
|
-
|
|
94
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
95
|
+
protocol: 'vercel-ai',
|
|
100
96
|
description: 'Monitor Sales KPI agent — exercises pause/resume checkpointing',
|
|
101
97
|
},
|
|
102
98
|
});
|
|
@@ -109,7 +105,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
109
105
|
launchRuntime,
|
|
110
106
|
});
|
|
111
107
|
// Agent runtimes from the focused hook
|
|
112
|
-
const { data: agentRuntimes } =
|
|
108
|
+
const { data: agentRuntimes } = useAgentRuntimesQuery();
|
|
113
109
|
const refetchRuntimes = useRefreshAgentRuntimes();
|
|
114
110
|
const deleteRuntimeMutation = useDeleteAgentRuntime();
|
|
115
111
|
const deletePausedRuntimeMutation = useDeletePausedAgentRuntime();
|
|
@@ -196,7 +192,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
196
192
|
name: rt.name,
|
|
197
193
|
description: rt.environment_title || rt.environment_name,
|
|
198
194
|
status: rt.status,
|
|
199
|
-
protocol: '
|
|
195
|
+
protocol: 'vercel-ai',
|
|
200
196
|
environmentName: rt.environment_name,
|
|
201
197
|
jupyterBaseUrl: rt.url,
|
|
202
198
|
}));
|
|
@@ -309,7 +305,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
309
305
|
runtimeStatus === 'paused' ||
|
|
310
306
|
runtimeStatus === 'resumed', children: "Checkpoint (Light) + Terminate" }), _jsx(Button, { size: "small", leadingVisual: SquareIcon, onClick: () => handlePause('criu'), disabled: actionLoading ||
|
|
311
307
|
runtimeStatus === 'paused' ||
|
|
312
|
-
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" })
|
|
308
|
+
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, { sx: { display: 'flex', flex: 1, minHeight: 0 }, children: [sidebarOpen && (_jsxs(Box, { sx: {
|
|
313
309
|
display: 'flex',
|
|
314
310
|
flexDirection: 'column',
|
|
315
311
|
width: SIDEBAR_WIDTH,
|
|
@@ -440,7 +436,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
440
436
|
gap: 3,
|
|
441
437
|
px: 3,
|
|
442
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: AGENT_SPEC_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') &&
|
|
443
|
-
runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "
|
|
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: false, showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
444
440
|
{
|
|
445
441
|
title: 'KPIs',
|
|
446
442
|
message: "Show me today's sales KPI dashboard",
|
|
@@ -462,7 +458,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
|
|
|
462
458
|
};
|
|
463
459
|
// ─── Main component with auth gate ─────────────────────────────────────────
|
|
464
460
|
const AgentCheckpointsExample = () => {
|
|
465
|
-
const { token,
|
|
461
|
+
const { token, clearAuth } = useSimpleAuthStore();
|
|
466
462
|
const hasSynced = useRef(false);
|
|
467
463
|
// Sync persisted token (from a previous session) to iamStore on mount
|
|
468
464
|
useEffect(() => {
|
|
@@ -474,13 +470,6 @@ const AgentCheckpointsExample = () => {
|
|
|
474
470
|
}
|
|
475
471
|
}, [token]);
|
|
476
472
|
// Wrap setAuth to also sync the token to iamStore on sign-in
|
|
477
|
-
const handleSignIn = useCallback((newToken, handle) => {
|
|
478
|
-
setAuth(newToken, handle);
|
|
479
|
-
hasSynced.current = true;
|
|
480
|
-
import('@datalayer/core/lib/state').then(({ iamStore }) => {
|
|
481
|
-
iamStore.setState({ token: newToken });
|
|
482
|
-
});
|
|
483
|
-
}, [setAuth]);
|
|
484
473
|
// Clear iamStore token on logout
|
|
485
474
|
const handleLogout = useCallback(() => {
|
|
486
475
|
clearAuth();
|
|
@@ -489,11 +478,8 @@ const AgentCheckpointsExample = () => {
|
|
|
489
478
|
iamStore.setState({ token: undefined });
|
|
490
479
|
});
|
|
491
480
|
}, [clearAuth]);
|
|
492
|
-
const loginUrl = useRef(`${coreStore.getState().configuration?.iamRunUrl ||
|
|
493
|
-
coreStore.getState().configuration?.runUrl ||
|
|
494
|
-
'https://prod1.datalayer.run'}/api/iam/v1/login`).current;
|
|
495
481
|
if (!token) {
|
|
496
|
-
return (_jsx(ThemedProvider, { children: _jsx(
|
|
482
|
+
return (_jsx(ThemedProvider, { children: _jsx(AuthRequiredView, {}) }));
|
|
497
483
|
}
|
|
498
484
|
return (_jsx(ThemedProvider, { children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(AgentCheckpointsInner, { onLogout: handleLogout }) }) }));
|
|
499
485
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AgentCodemodeExample
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Compares two tooling modes side-by-side:
|
|
5
|
+
* - MCP tools without codemode conversion
|
|
6
|
+
* - MCP tools with codemode conversion
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
* Runtimes API and deploys an agent on its sidecar
|
|
9
|
-
* - Shows a code panel alongside the chat displaying tool outputs with
|
|
10
|
-
* syntax highlighting, diff views, and the ability to accept/reject changes
|
|
8
|
+
* A sidebar gauge tracks consumed tokens for each agent in real time.
|
|
11
9
|
*/
|
|
12
10
|
import React from 'react';
|
|
13
11
|
declare const AgentCodemodeExample: React.FC;
|