@datalayer/agent-runtimes 1.0.3 → 1.0.5

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.
Files changed (275) hide show
  1. package/README.md +35 -119
  2. package/lib/App.js +1 -1
  3. package/lib/agents/AgentDetails.d.ts +22 -1
  4. package/lib/agents/AgentDetails.js +34 -47
  5. package/lib/api/index.d.ts +0 -1
  6. package/lib/api/index.js +4 -2
  7. package/lib/chat/Chat.d.ts +5 -104
  8. package/lib/chat/Chat.js +4 -4
  9. package/lib/chat/ChatFloating.d.ts +7 -140
  10. package/lib/chat/ChatFloating.js +2 -2
  11. package/lib/chat/ChatPopupStandalone.d.ts +8 -47
  12. package/lib/chat/ChatPopupStandalone.js +3 -3
  13. package/lib/chat/ChatSidebar.d.ts +4 -69
  14. package/lib/chat/ChatSidebar.js +2 -2
  15. package/lib/chat/ChatStandalone.d.ts +4 -54
  16. package/lib/chat/ChatStandalone.js +3 -3
  17. package/lib/chat/base/ChatBase.js +1118 -141
  18. package/lib/chat/header/ChatHeaderBase.d.ts +11 -6
  19. package/lib/chat/header/ChatHeaderBase.js +18 -16
  20. package/lib/chat/indicators/McpStatusIndicator.d.ts +7 -4
  21. package/lib/chat/indicators/McpStatusIndicator.js +7 -32
  22. package/lib/chat/indicators/SandboxStatusIndicator.d.ts +4 -1
  23. package/lib/chat/indicators/SandboxStatusIndicator.js +9 -9
  24. package/lib/chat/indicators/SkillsStatusIndicator.d.ts +7 -0
  25. package/lib/chat/indicators/SkillsStatusIndicator.js +88 -0
  26. package/lib/chat/indicators/index.d.ts +1 -0
  27. package/lib/chat/indicators/index.js +1 -0
  28. package/lib/chat/messages/ChatMessageList.d.ts +1 -1
  29. package/lib/chat/messages/ChatMessageList.js +110 -102
  30. package/lib/chat/prompt/InputFooter.d.ts +19 -6
  31. package/lib/chat/prompt/InputFooter.js +71 -18
  32. package/lib/chat/prompt/InputPrompt.d.ts +3 -1
  33. package/lib/chat/prompt/InputPrompt.js +4 -4
  34. package/lib/chat/prompt/InputPromptFooter.js +1 -1
  35. package/lib/chat/prompt/InputPromptLexical.d.ts +3 -1
  36. package/lib/chat/prompt/InputPromptLexical.js +12 -5
  37. package/lib/chat/prompt/InputPromptText.d.ts +3 -1
  38. package/lib/chat/prompt/InputPromptText.js +2 -2
  39. package/lib/chat/tools/ToolApprovalBanner.js +1 -1
  40. package/lib/chat/tools/ToolCallDisplay.d.ts +3 -1
  41. package/lib/chat/tools/ToolCallDisplay.js +2 -2
  42. package/lib/chat/usage/TokenUsageBar.js +20 -2
  43. package/lib/client/AgentRuntimesClientContext.d.ts +53 -0
  44. package/lib/client/AgentRuntimesClientContext.js +55 -0
  45. package/lib/client/AgentsMixin.d.ts +48 -19
  46. package/lib/client/AgentsMixin.js +115 -30
  47. package/lib/client/IAgentRuntimesClient.d.ts +215 -0
  48. package/lib/client/IAgentRuntimesClient.js +5 -0
  49. package/lib/client/SdkAgentRuntimesClient.d.ts +151 -0
  50. package/lib/client/SdkAgentRuntimesClient.js +134 -0
  51. package/lib/client/index.d.ts +4 -1
  52. package/lib/client/index.js +3 -1
  53. package/lib/components/NotificationEventCard.js +55 -26
  54. package/lib/components/OutputCard.js +21 -7
  55. package/lib/components/ToolApprovalCard.js +20 -2
  56. package/lib/config/AgentConfiguration.js +3 -3
  57. package/lib/context/ContextDistribution.d.ts +3 -1
  58. package/lib/context/ContextDistribution.js +8 -27
  59. package/lib/context/ContextInspector.d.ts +3 -1
  60. package/lib/context/ContextInspector.js +19 -67
  61. package/lib/context/ContextPanel.d.ts +3 -1
  62. package/lib/context/ContextPanel.js +104 -64
  63. package/lib/context/ContextUsage.d.ts +3 -1
  64. package/lib/context/ContextUsage.js +3 -3
  65. package/lib/context/CostTracker.d.ts +9 -3
  66. package/lib/context/CostTracker.js +26 -47
  67. package/lib/context/CostUsageChart.d.ts +12 -0
  68. package/lib/context/CostUsageChart.js +378 -0
  69. package/lib/context/GraphFlowChart.d.ts +16 -0
  70. package/lib/context/GraphFlowChart.js +182 -0
  71. package/lib/context/TokenUsageChart.d.ts +8 -1
  72. package/lib/context/TokenUsageChart.js +349 -211
  73. package/lib/context/TurnGraphChart.d.ts +39 -0
  74. package/lib/context/TurnGraphChart.js +538 -0
  75. package/lib/context/otelWsPool.d.ts +20 -0
  76. package/lib/context/otelWsPool.js +69 -0
  77. package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -17
  78. package/lib/examples/A2UiComponentGalleryExample.js +315 -522
  79. package/lib/examples/A2UiContactCardExample.d.ts +0 -18
  80. package/lib/examples/A2UiContactCardExample.js +154 -411
  81. package/lib/examples/A2UiRestaurantExample.d.ts +0 -30
  82. package/lib/examples/A2UiRestaurantExample.js +114 -212
  83. package/lib/examples/A2UiViewerExample.d.ts +0 -18
  84. package/lib/examples/A2UiViewerExample.js +283 -532
  85. package/lib/examples/AgUiBackendToolRenderingExample.js +1 -1
  86. package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -1
  87. package/lib/examples/AgUiHaikuGenUiExample.js +1 -1
  88. package/lib/examples/AgentCheckpointsExample.js +14 -34
  89. package/lib/examples/AgentCodemodeExample.d.ts +4 -6
  90. package/lib/examples/AgentCodemodeExample.js +591 -175
  91. package/lib/examples/AgentEvalsExample.js +13 -23
  92. package/lib/examples/AgentGuardrailsExample.js +371 -71
  93. package/lib/examples/AgentHooksExample.d.ts +3 -0
  94. package/lib/examples/AgentHooksExample.js +104 -0
  95. package/lib/examples/AgentMCPExample.d.ts +3 -0
  96. package/lib/examples/AgentMCPExample.js +480 -0
  97. package/lib/examples/AgentMemoryExample.js +14 -24
  98. package/lib/examples/AgentMonitoringExample.js +261 -206
  99. package/lib/examples/AgentNotificationsExample.js +50 -24
  100. package/lib/examples/AgentOtelExample.js +2 -3
  101. package/lib/examples/AgentOutputsExample.d.ts +11 -6
  102. package/lib/examples/AgentOutputsExample.js +383 -88
  103. package/lib/examples/AgentParametersExample.d.ts +3 -0
  104. package/lib/examples/AgentParametersExample.js +246 -0
  105. package/lib/examples/AgentSandboxExample.d.ts +2 -2
  106. package/lib/examples/AgentSandboxExample.js +69 -47
  107. package/lib/examples/AgentSkillsExample.js +92 -106
  108. package/lib/examples/{AgentspecExample.js → AgentSpecsExample.js} +10 -21
  109. package/lib/examples/AgentSubagentsExample.d.ts +14 -0
  110. package/lib/examples/AgentSubagentsExample.js +228 -0
  111. package/lib/examples/AgentToolApprovalsExample.js +30 -493
  112. package/lib/examples/AgentTriggersExample.js +1067 -246
  113. package/lib/examples/ChatCustomExample.js +11 -24
  114. package/lib/examples/ChatExample.js +9 -34
  115. package/lib/examples/CopilotKitLexicalExample.js +2 -1
  116. package/lib/examples/CopilotKitNotebookExample.js +2 -1
  117. package/lib/examples/HomeExample.d.ts +15 -0
  118. package/lib/examples/HomeExample.js +77 -0
  119. package/lib/examples/Lexical2Example.js +4 -2
  120. package/lib/examples/{LexicalExample.d.ts → LexicalAgentExample.d.ts} +4 -4
  121. package/lib/examples/{LexicalExample.js → LexicalAgentExample.js} +65 -16
  122. package/lib/examples/{LexicalSidebarExample.d.ts → LexicalAgentSidebarExample.d.ts} +5 -5
  123. package/lib/examples/LexicalAgentSidebarExample.js +261 -0
  124. package/lib/examples/NotebookAgentExample.d.ts +9 -0
  125. package/lib/examples/NotebookAgentExample.js +192 -0
  126. package/lib/examples/{NotebookSidebarExample.d.ts → NotebookAgentSidebarExample.d.ts} +2 -2
  127. package/lib/examples/NotebookAgentSidebarExample.js +221 -0
  128. package/lib/examples/{DatalayerNotebookExample.d.ts → NotebookCollaborationExample.d.ts} +4 -4
  129. package/lib/examples/{DatalayerNotebookExample.js → NotebookCollaborationExample.js} +3 -3
  130. package/lib/examples/NotebookExample.d.ts +4 -7
  131. package/lib/examples/NotebookExample.js +14 -146
  132. package/lib/examples/components/AuthRequiredView.d.ts +6 -0
  133. package/lib/examples/components/AuthRequiredView.js +33 -0
  134. package/lib/examples/components/ErrorView.d.ts +14 -0
  135. package/lib/examples/components/ErrorView.js +20 -0
  136. package/lib/examples/components/ExampleWrapper.d.ts +7 -0
  137. package/lib/examples/components/ExampleWrapper.js +25 -6
  138. package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.js +1 -1
  139. package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.js +1 -1
  140. package/lib/examples/{ag-ui → components}/haiku/index.d.ts +1 -1
  141. package/lib/examples/{ag-ui → components}/haiku/index.js +1 -1
  142. package/lib/examples/components/index.d.ts +5 -0
  143. package/lib/examples/components/index.js +5 -0
  144. package/lib/examples/{ag-ui → components}/weather/index.d.ts +1 -1
  145. package/lib/examples/{ag-ui → components}/weather/index.js +1 -1
  146. package/lib/examples/example-selector.d.ts +17 -4
  147. package/lib/examples/example-selector.js +107 -41
  148. package/lib/examples/index.d.ts +9 -6
  149. package/lib/examples/index.js +9 -6
  150. package/lib/examples/main.d.ts +1 -0
  151. package/lib/examples/main.js +218 -27
  152. package/lib/examples/utils/a2ui.d.ts +18 -0
  153. package/lib/examples/utils/a2ui.js +69 -0
  154. package/lib/examples/utils/a2uiMarkdownProvider.d.ts +7 -0
  155. package/lib/examples/utils/a2uiMarkdownProvider.js +9 -0
  156. package/lib/examples/utils/agentId.d.ts +18 -0
  157. package/lib/examples/utils/agentId.js +54 -0
  158. package/lib/examples/utils/agents/earthquake-detector.json +11 -11
  159. package/lib/examples/utils/agents/sales-forecaster.json +11 -11
  160. package/lib/examples/utils/agents/social-post-generator.json +11 -11
  161. package/lib/examples/utils/agents/stock-market.json +11 -11
  162. package/lib/examples/utils/examplesStore.js +82 -27
  163. package/lib/hooks/index.d.ts +8 -8
  164. package/lib/hooks/index.js +7 -7
  165. package/lib/hooks/useA2A.d.ts +2 -3
  166. package/lib/hooks/useAIAgentsWebSocket.d.ts +43 -4
  167. package/lib/hooks/useAIAgentsWebSocket.js +118 -12
  168. package/lib/hooks/useAcp.d.ts +1 -2
  169. package/lib/hooks/useAgUi.d.ts +1 -1
  170. package/lib/hooks/{useAgents.d.ts → useAgentRuntimes.d.ts} +39 -2
  171. package/lib/hooks/{useAgents.js → useAgentRuntimes.js} +125 -15
  172. package/lib/hooks/useAgentsCatalog.js +1 -1
  173. package/lib/hooks/useAgentsService.d.ts +2 -2
  174. package/lib/hooks/useAgentsService.js +7 -7
  175. package/lib/hooks/useCheckpoints.js +1 -1
  176. package/lib/hooks/useConfig.d.ts +4 -1
  177. package/lib/hooks/useConfig.js +10 -3
  178. package/lib/hooks/useContextSnapshot.d.ts +9 -4
  179. package/lib/hooks/useContextSnapshot.js +9 -37
  180. package/lib/hooks/useMonitoring.js +3 -0
  181. package/lib/hooks/useSandbox.d.ts +20 -8
  182. package/lib/hooks/useSandbox.js +105 -40
  183. package/lib/hooks/useSkills.d.ts +23 -5
  184. package/lib/hooks/useSkills.js +94 -39
  185. package/lib/hooks/useToolApprovals.d.ts +60 -36
  186. package/lib/hooks/useToolApprovals.js +318 -69
  187. package/lib/hooks/useVercelAI.d.ts +1 -1
  188. package/lib/index.d.ts +2 -1
  189. package/lib/index.js +1 -0
  190. package/lib/inference/index.d.ts +0 -1
  191. package/lib/middleware/index.d.ts +0 -1
  192. package/lib/protocols/AGUIAdapter.js +6 -0
  193. package/lib/protocols/VercelAIAdapter.d.ts +9 -0
  194. package/lib/protocols/VercelAIAdapter.js +144 -26
  195. package/lib/shims/json5.d.ts +4 -0
  196. package/lib/shims/json5.js +8 -0
  197. package/lib/specs/agents/agents.d.ts +10 -0
  198. package/lib/specs/agents/agents.js +752 -24
  199. package/lib/specs/envvars.d.ts +1 -0
  200. package/lib/specs/envvars.js +11 -0
  201. package/lib/specs/events.d.ts +1 -0
  202. package/lib/specs/events.js +1 -0
  203. package/lib/specs/index.d.ts +1 -0
  204. package/lib/specs/index.js +1 -0
  205. package/lib/specs/personas.d.ts +41 -0
  206. package/lib/specs/personas.js +168 -0
  207. package/lib/specs/skills.d.ts +2 -1
  208. package/lib/specs/skills.js +23 -5
  209. package/lib/specs/tools.js +3 -0
  210. package/lib/stores/agentRuntimeStore.d.ts +204 -0
  211. package/lib/stores/agentRuntimeStore.js +636 -0
  212. package/lib/stores/index.d.ts +1 -1
  213. package/lib/stores/index.js +1 -1
  214. package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +1 -2
  215. package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -3
  216. package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +1 -2
  217. package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -3
  218. package/lib/tools/index.d.ts +0 -2
  219. package/lib/tools/index.js +0 -1
  220. package/lib/types/agentspecs.d.ts +50 -1
  221. package/lib/types/chat.d.ts +309 -8
  222. package/lib/types/context.d.ts +27 -0
  223. package/lib/types/cost.d.ts +2 -2
  224. package/lib/types/index.d.ts +2 -0
  225. package/lib/types/index.js +2 -0
  226. package/lib/types/mcp.d.ts +8 -0
  227. package/lib/types/models.d.ts +2 -2
  228. package/lib/types/personas.d.ts +25 -0
  229. package/lib/types/personas.js +5 -0
  230. package/lib/types/skills.d.ts +43 -1
  231. package/lib/types/stream.d.ts +110 -0
  232. package/lib/types/stream.js +36 -0
  233. package/lib/types/tools.d.ts +2 -0
  234. package/lib/utils/utils.d.ts +9 -5
  235. package/lib/utils/utils.js +9 -5
  236. package/package.json +13 -9
  237. package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
  238. package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
  239. package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
  240. package/scripts/codegen/generate_agents.py +106 -7
  241. package/scripts/codegen/generate_events.py +47 -17
  242. package/scripts/codegen/generate_personas.py +319 -0
  243. package/scripts/codegen/generate_skills.py +9 -9
  244. package/scripts/codegen/generate_tools.py +20 -0
  245. package/scripts/sync-jupyter.sh +26 -7
  246. package/style/primer-primitives.css +1 -6
  247. package/lib/api/tool-approvals.d.ts +0 -62
  248. package/lib/api/tool-approvals.js +0 -145
  249. package/lib/examples/LexicalSidebarExample.js +0 -163
  250. package/lib/examples/NotebookSidebarExample.js +0 -119
  251. package/lib/examples/NotebookSimpleExample.d.ts +0 -6
  252. package/lib/examples/NotebookSimpleExample.js +0 -22
  253. package/lib/examples/ag-ui/index.d.ts +0 -10
  254. package/lib/examples/ag-ui/index.js +0 -16
  255. package/lib/hooks/useAgentsRegistry.d.ts +0 -10
  256. package/lib/hooks/useAgentsRegistry.js +0 -20
  257. package/lib/stores/agentsStore.d.ts +0 -123
  258. package/lib/stores/agentsStore.js +0 -270
  259. package/scripts/codegen/__pycache__/generate_envvars.cpython-313.pyc +0 -0
  260. package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
  261. package/scripts/codegen/__pycache__/generate_guardrails.cpython-313.pyc +0 -0
  262. package/scripts/codegen/__pycache__/generate_mcp_servers.cpython-313.pyc +0 -0
  263. package/scripts/codegen/__pycache__/generate_memory.cpython-313.pyc +0 -0
  264. package/scripts/codegen/__pycache__/generate_models.cpython-313.pyc +0 -0
  265. package/scripts/codegen/__pycache__/generate_notifications.cpython-313.pyc +0 -0
  266. package/scripts/codegen/__pycache__/generate_outputs.cpython-313.pyc +0 -0
  267. package/scripts/codegen/__pycache__/generate_skills.cpython-313.pyc +0 -0
  268. package/scripts/codegen/__pycache__/generate_teams.cpython-313.pyc +0 -0
  269. package/scripts/codegen/__pycache__/generate_tools.cpython-313.pyc +0 -0
  270. package/scripts/codegen/__pycache__/generate_triggers.cpython-313.pyc +0 -0
  271. /package/lib/examples/{AgentspecExample.d.ts → AgentSpecsExample.d.ts} +0 -0
  272. /package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.d.ts +0 -0
  273. /package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.d.ts +0 -0
  274. /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.d.ts +0 -0
  275. /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 './ag-ui/weather';
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 './ag-ui/haiku';
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 './ag-ui/haiku';
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
  /**
@@ -23,17 +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, WorkflowIcon, SignOutIcon, XCircleIcon, ClockIcon, TagIcon, GlobeIcon, ZapIcon, GraphIcon, AiModelIcon, PeopleIcon, SidebarCollapseIcon, SidebarExpandIcon, SyncIcon, AgentIcon, } from '@primer/octicons-react';
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 { coreStore } from '@datalayer/core';
28
+ import { AuthRequiredView, ErrorView } from './components';
29
29
  import { ThemedProvider } from './utils/themedProvider';
30
30
  import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
31
- import { SignInSimple } from '@datalayer/core/lib/views/iam';
32
- import { UserBadge } from '@datalayer/core/lib/views/profile';
33
31
  import { Chat } from '../chat';
34
- import { useAgents } from '../hooks/useAgents';
32
+ import { useAgentRuntimes, useAgentRuntimesQuery, useRefreshAgentRuntimes, useDeleteAgentRuntime, } from '../hooks/useAgentRuntimes';
35
33
  import { useAgentLifecycle } from '../hooks/useCheckpoints';
36
- import { useAgentRuntimes, useRefreshAgentRuntimes, useDeleteAgentRuntime, } from '../hooks/useAgents';
37
34
  import { useDeletePausedAgentRuntime } from '../hooks/useCheckpoints';
38
35
  import { AGENT_STATUS_COLORS } from '../types/agents';
39
36
  const queryClient = new QueryClient();
@@ -53,7 +50,7 @@ const AGENT_SPEC = {
53
50
  name: 'Monitor Sales KPIs',
54
51
  description: 'Monitor and analyze sales KPIs from the CRM system. Generate daily reports, identify trends, and flag anomalies.',
55
52
  model: 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0',
56
- protocol: 'ag-ui',
53
+ protocol: 'vercel-ai',
57
54
  memory: 'mem0',
58
55
  sandbox_variant: 'jupyter',
59
56
  environment_name: 'ai-agents-env',
@@ -88,14 +85,14 @@ const SpecRow = ({ icon: Icon, label, value }) => (_jsxs(Box, { sx: {
88
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 })] }));
89
86
  // ─── Inner component (rendered after auth) ─────────────────────────────────
90
87
  const AgentCheckpointsInner = ({ onLogout, }) => {
91
- const { token } = useSimpleAuthStore();
92
- 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({
93
89
  agentSpecId: AGENT_SPEC_ID,
94
90
  autoStart: false,
95
91
  agentSpec: AGENT_SPEC,
96
92
  agentConfig: {
97
93
  name: DEMO_AGENT_NAME,
98
- protocol: 'ag-ui',
94
+ model: 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0',
95
+ protocol: 'vercel-ai',
99
96
  description: 'Monitor Sales KPI agent — exercises pause/resume checkpointing',
100
97
  },
101
98
  });
@@ -108,7 +105,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
108
105
  launchRuntime,
109
106
  });
110
107
  // Agent runtimes from the focused hook
111
- const { data: agentRuntimes } = useAgentRuntimes();
108
+ const { data: agentRuntimes } = useAgentRuntimesQuery();
112
109
  const refetchRuntimes = useRefreshAgentRuntimes();
113
110
  const deleteRuntimeMutation = useDeleteAgentRuntime();
114
111
  const deletePausedRuntimeMutation = useDeletePausedAgentRuntime();
@@ -195,7 +192,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
195
192
  name: rt.name,
196
193
  description: rt.environment_title || rt.environment_name,
197
194
  status: rt.status,
198
- protocol: 'ag-ui',
195
+ protocol: 'vercel-ai',
199
196
  environmentName: rt.environment_name,
200
197
  jupyterBaseUrl: rt.url,
201
198
  }));
@@ -285,14 +282,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
285
282
  isStarting;
286
283
  // ── Error ────────────────────────────────────────────────────────────────
287
284
  if (runtimeStatus === 'error' && !runtime) {
288
- return (_jsxs(Box, { sx: {
289
- display: 'flex',
290
- flexDirection: 'column',
291
- alignItems: 'center',
292
- justifyContent: 'center',
293
- height: '100vh',
294
- gap: 3,
295
- }, children: [_jsx(AlertIcon, { size: 48 }), _jsx(Text, { sx: { color: 'danger.fg', fontSize: 2 }, children: "Agent failed to start" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: displayError })] }));
285
+ return _jsx(ErrorView, { detail: displayError, onLogout: onLogout });
296
286
  }
297
287
  // ── Running / Paused ─────────────────────────────────────────────────────
298
288
  return (_jsxs(Box, { sx: {
@@ -315,7 +305,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
315
305
  runtimeStatus === 'paused' ||
316
306
  runtimeStatus === 'resumed', children: "Checkpoint (Light) + Terminate" }), _jsx(Button, { size: "small", leadingVisual: SquareIcon, onClick: () => handlePause('criu'), disabled: actionLoading ||
317
307
  runtimeStatus === 'paused' ||
318
- 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" }), token && _jsx(UserBadge, { token: token, variant: "small" }), _jsx(Button, { size: "small", variant: "invisible", onClick: onLogout, leadingVisual: SignOutIcon, sx: { color: 'fg.muted' }, children: "Sign out" })] }), 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: {
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: {
319
309
  display: 'flex',
320
310
  flexDirection: 'column',
321
311
  width: SIDEBAR_WIDTH,
@@ -446,7 +436,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
446
436
  gap: 3,
447
437
  px: 3,
448
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') &&
449
- runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "ag-ui", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", 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: [
439
+ runtimeStatus !== 'paused' ? (_jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Monitor Sales KPI Agent", 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: [
450
440
  {
451
441
  title: 'KPIs',
452
442
  message: "Show me today's sales KPI dashboard",
@@ -468,7 +458,7 @@ const AgentCheckpointsInner = ({ onLogout, }) => {
468
458
  };
469
459
  // ─── Main component with auth gate ─────────────────────────────────────────
470
460
  const AgentCheckpointsExample = () => {
471
- const { token, setAuth, clearAuth } = useSimpleAuthStore();
461
+ const { token, clearAuth } = useSimpleAuthStore();
472
462
  const hasSynced = useRef(false);
473
463
  // Sync persisted token (from a previous session) to iamStore on mount
474
464
  useEffect(() => {
@@ -480,13 +470,6 @@ const AgentCheckpointsExample = () => {
480
470
  }
481
471
  }, [token]);
482
472
  // Wrap setAuth to also sync the token to iamStore on sign-in
483
- const handleSignIn = useCallback((newToken, handle) => {
484
- setAuth(newToken, handle);
485
- hasSynced.current = true;
486
- import('@datalayer/core/lib/state').then(({ iamStore }) => {
487
- iamStore.setState({ token: newToken });
488
- });
489
- }, [setAuth]);
490
473
  // Clear iamStore token on logout
491
474
  const handleLogout = useCallback(() => {
492
475
  clearAuth();
@@ -495,11 +478,8 @@ const AgentCheckpointsExample = () => {
495
478
  iamStore.setState({ token: undefined });
496
479
  });
497
480
  }, [clearAuth]);
498
- const loginUrl = useRef(`${coreStore.getState().configuration?.iamRunUrl ||
499
- coreStore.getState().configuration?.runUrl ||
500
- 'https://prod1.datalayer.run'}/api/iam/v1/login`).current;
501
481
  if (!token) {
502
- return (_jsx(ThemedProvider, { children: _jsx(SignInSimple, { onSignIn: handleSignIn, onApiKeySignIn: apiKey => handleSignIn(apiKey, 'api-key-user'), loginUrl: loginUrl, title: "Agent Checkpointing", description: "Sign in to launch and checkpoint durable agents.", leadingIcon: _jsx(WorkflowIcon, { size: 24 }) }) }));
482
+ return (_jsx(ThemedProvider, { children: _jsx(AuthRequiredView, {}) }));
503
483
  }
504
484
  return (_jsx(ThemedProvider, { children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(AgentCheckpointsInner, { onLogout: handleLogout }) }) }));
505
485
  };
@@ -1,13 +1,11 @@
1
1
  /**
2
2
  * AgentCodemodeExample
3
3
  *
4
- * Demonstrates Codemode: tools that return structured outputs with schemas
5
- * rendered inline as executable code blocks, diffs, or file previews.
4
+ * Compares two Tavily-based agents side-by-side:
5
+ * - Tavily MCP without codemode conversion
6
+ * - Tavily MCP with codemode conversion
6
7
  *
7
- * - Creates a cloud agent runtime (environment: 'ai-agents-env') via the Datalayer
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;