@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.
Files changed (299) hide show
  1. package/README.md +182 -1
  2. package/lib/AgentNode.d.ts +3 -0
  3. package/lib/AgentNode.js +676 -0
  4. package/lib/App.js +1 -1
  5. package/lib/agent-node/themeStore.d.ts +3 -0
  6. package/lib/agent-node/themeStore.js +156 -0
  7. package/lib/agent-node-main.d.ts +1 -0
  8. package/lib/agent-node-main.js +14 -0
  9. package/lib/agents/AgentDetails.d.ts +22 -1
  10. package/lib/agents/AgentDetails.js +34 -47
  11. package/lib/api/index.d.ts +0 -1
  12. package/lib/api/index.js +4 -2
  13. package/lib/chat/Chat.d.ts +5 -106
  14. package/lib/chat/Chat.js +20 -14
  15. package/lib/chat/ChatFloating.d.ts +7 -140
  16. package/lib/chat/ChatFloating.js +3 -3
  17. package/lib/chat/ChatPopupStandalone.d.ts +8 -47
  18. package/lib/chat/ChatPopupStandalone.js +3 -3
  19. package/lib/chat/ChatSidebar.d.ts +4 -69
  20. package/lib/chat/ChatSidebar.js +83 -51
  21. package/lib/chat/ChatStandalone.d.ts +4 -54
  22. package/lib/chat/ChatStandalone.js +3 -3
  23. package/lib/chat/base/ChatBase.js +1414 -174
  24. package/lib/chat/display/FloatingBrandButton.js +8 -1
  25. package/lib/chat/header/ChatHeader.d.ts +3 -1
  26. package/lib/chat/header/ChatHeader.js +15 -12
  27. package/lib/chat/header/ChatHeaderBase.d.ts +30 -5
  28. package/lib/chat/header/ChatHeaderBase.js +41 -16
  29. package/lib/chat/indicators/McpStatusIndicator.d.ts +7 -4
  30. package/lib/chat/indicators/McpStatusIndicator.js +7 -32
  31. package/lib/chat/indicators/SandboxStatusIndicator.d.ts +4 -1
  32. package/lib/chat/indicators/SandboxStatusIndicator.js +91 -56
  33. package/lib/chat/indicators/SkillsStatusIndicator.d.ts +7 -0
  34. package/lib/chat/indicators/SkillsStatusIndicator.js +88 -0
  35. package/lib/chat/indicators/index.d.ts +1 -0
  36. package/lib/chat/indicators/index.js +1 -0
  37. package/lib/chat/messages/ChatMessageList.d.ts +1 -1
  38. package/lib/chat/messages/ChatMessageList.js +154 -114
  39. package/lib/chat/messages/ChatMessages.js +6 -2
  40. package/lib/chat/prompt/InputFooter.d.ts +21 -6
  41. package/lib/chat/prompt/InputFooter.js +76 -20
  42. package/lib/chat/prompt/InputPrompt.d.ts +5 -1
  43. package/lib/chat/prompt/InputPrompt.js +4 -4
  44. package/lib/chat/prompt/InputPromptFooter.d.ts +3 -1
  45. package/lib/chat/prompt/InputPromptFooter.js +3 -3
  46. package/lib/chat/prompt/InputPromptLexical.d.ts +3 -1
  47. package/lib/chat/prompt/InputPromptLexical.js +12 -5
  48. package/lib/chat/prompt/InputPromptText.d.ts +3 -1
  49. package/lib/chat/prompt/InputPromptText.js +2 -2
  50. package/lib/chat/tools/ToolApprovalBanner.js +1 -1
  51. package/lib/chat/tools/ToolCallDisplay.d.ts +3 -1
  52. package/lib/chat/tools/ToolCallDisplay.js +2 -2
  53. package/lib/chat/usage/TokenUsageBar.js +20 -2
  54. package/lib/client/AgentRuntimesClientContext.d.ts +53 -0
  55. package/lib/client/AgentRuntimesClientContext.js +55 -0
  56. package/lib/client/AgentsMixin.d.ts +0 -18
  57. package/lib/client/AgentsMixin.js +20 -30
  58. package/lib/client/IAgentRuntimesClient.d.ts +215 -0
  59. package/lib/client/IAgentRuntimesClient.js +5 -0
  60. package/lib/client/SdkAgentRuntimesClient.d.ts +151 -0
  61. package/lib/client/SdkAgentRuntimesClient.js +134 -0
  62. package/lib/client/index.d.ts +4 -1
  63. package/lib/client/index.js +3 -1
  64. package/lib/components/NotificationEventCard.js +5 -1
  65. package/lib/config/AgentConfiguration.d.ts +22 -0
  66. package/lib/config/AgentConfiguration.js +319 -64
  67. package/lib/context/ContextDistribution.d.ts +3 -1
  68. package/lib/context/ContextDistribution.js +8 -27
  69. package/lib/context/ContextInspector.d.ts +3 -1
  70. package/lib/context/ContextInspector.js +19 -67
  71. package/lib/context/ContextPanel.d.ts +3 -1
  72. package/lib/context/ContextPanel.js +104 -64
  73. package/lib/context/ContextUsage.d.ts +3 -1
  74. package/lib/context/ContextUsage.js +3 -3
  75. package/lib/context/CostTracker.d.ts +9 -3
  76. package/lib/context/CostTracker.js +26 -47
  77. package/lib/context/CostUsageChart.d.ts +12 -0
  78. package/lib/context/CostUsageChart.js +378 -0
  79. package/lib/context/GraphFlowChart.d.ts +16 -0
  80. package/lib/context/GraphFlowChart.js +182 -0
  81. package/lib/context/TokenUsageChart.d.ts +8 -1
  82. package/lib/context/TokenUsageChart.js +349 -211
  83. package/lib/context/TurnGraphChart.d.ts +39 -0
  84. package/lib/context/TurnGraphChart.js +538 -0
  85. package/lib/context/otelWsPool.d.ts +20 -0
  86. package/lib/context/otelWsPool.js +69 -0
  87. package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -17
  88. package/lib/examples/A2UiComponentGalleryExample.js +315 -522
  89. package/lib/examples/A2UiContactCardExample.d.ts +0 -18
  90. package/lib/examples/A2UiContactCardExample.js +154 -411
  91. package/lib/examples/A2UiRestaurantExample.d.ts +0 -30
  92. package/lib/examples/A2UiRestaurantExample.js +114 -212
  93. package/lib/examples/A2UiViewerExample.d.ts +0 -18
  94. package/lib/examples/A2UiViewerExample.js +283 -532
  95. package/lib/examples/AgUiBackendToolRenderingExample.js +1 -1
  96. package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -1
  97. package/lib/examples/AgUiHaikuGenUiExample.js +1 -1
  98. package/lib/examples/AgUiSharedStateExample.js +2 -1
  99. package/lib/examples/AgentCheckpointsExample.js +14 -28
  100. package/lib/examples/AgentCodemodeExample.d.ts +4 -6
  101. package/lib/examples/AgentCodemodeExample.js +603 -169
  102. package/lib/examples/AgentEvalsExample.js +339 -53
  103. package/lib/examples/AgentGuardrailsExample.js +383 -66
  104. package/lib/examples/AgentHooksExample.d.ts +3 -0
  105. package/lib/examples/AgentHooksExample.js +122 -0
  106. package/lib/examples/AgentInferenceProviderExample.d.ts +3 -0
  107. package/lib/examples/AgentInferenceProviderExample.js +329 -0
  108. package/lib/examples/AgentMCPExample.d.ts +3 -0
  109. package/lib/examples/AgentMCPExample.js +481 -0
  110. package/lib/examples/AgentMemoryExample.d.ts +1 -2
  111. package/lib/examples/AgentMemoryExample.js +78 -33
  112. package/lib/examples/AgentMonitoringExample.js +261 -200
  113. package/lib/examples/AgentNotificationsExample.d.ts +1 -2
  114. package/lib/examples/AgentNotificationsExample.js +114 -33
  115. package/lib/examples/AgentOtelExample.js +32 -42
  116. package/lib/examples/AgentOutputsExample.d.ts +11 -6
  117. package/lib/examples/AgentOutputsExample.js +433 -81
  118. package/lib/examples/AgentParametersExample.d.ts +3 -0
  119. package/lib/examples/AgentParametersExample.js +248 -0
  120. package/lib/examples/AgentSandboxExample.d.ts +3 -3
  121. package/lib/examples/AgentSandboxExample.js +74 -45
  122. package/lib/examples/AgentSkillsExample.js +95 -103
  123. package/lib/examples/AgentSubagentsExample.d.ts +14 -0
  124. package/lib/examples/AgentSubagentsExample.js +228 -0
  125. package/lib/examples/AgentToolApprovalsExample.js +49 -561
  126. package/lib/examples/AgentTriggersExample.js +823 -569
  127. package/lib/examples/{AgentspecExample.d.ts → AgentspecsExample.d.ts} +2 -2
  128. package/lib/examples/AgentspecsExample.js +1096 -0
  129. package/lib/examples/ChatCustomExample.js +16 -28
  130. package/lib/examples/ChatExample.js +13 -29
  131. package/lib/examples/CopilotKitLexicalExample.js +2 -1
  132. package/lib/examples/CopilotKitNotebookExample.js +2 -1
  133. package/lib/examples/HomeExample.d.ts +15 -0
  134. package/lib/examples/HomeExample.js +77 -0
  135. package/lib/examples/Lexical2Example.js +4 -2
  136. package/lib/examples/{LexicalExample.d.ts → LexicalAgentExample.d.ts} +4 -4
  137. package/lib/examples/{LexicalExample.js → LexicalAgentExample.js} +66 -17
  138. package/lib/examples/{LexicalSidebarExample.d.ts → LexicalAgentSidebarExample.d.ts} +5 -5
  139. package/lib/examples/LexicalAgentSidebarExample.js +261 -0
  140. package/lib/examples/NotebookAgentExample.d.ts +9 -0
  141. package/lib/examples/NotebookAgentExample.js +192 -0
  142. package/lib/examples/{NotebookSidebarExample.d.ts → NotebookAgentSidebarExample.d.ts} +2 -2
  143. package/lib/examples/NotebookAgentSidebarExample.js +221 -0
  144. package/lib/examples/{DatalayerNotebookExample.d.ts → NotebookCollaborationExample.d.ts} +4 -4
  145. package/lib/examples/{DatalayerNotebookExample.js → NotebookCollaborationExample.js} +3 -3
  146. package/lib/examples/NotebookExample.d.ts +4 -7
  147. package/lib/examples/NotebookExample.js +14 -146
  148. package/lib/examples/components/AuthRequiredView.d.ts +6 -0
  149. package/lib/examples/components/AuthRequiredView.js +33 -0
  150. package/lib/examples/components/ExampleWrapper.d.ts +9 -3
  151. package/lib/examples/components/ExampleWrapper.js +45 -9
  152. package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.js +1 -1
  153. package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.js +1 -1
  154. package/lib/examples/{ag-ui → components}/haiku/index.d.ts +1 -1
  155. package/lib/examples/{ag-ui → components}/haiku/index.js +1 -1
  156. package/lib/examples/components/index.d.ts +3 -0
  157. package/lib/examples/components/index.js +4 -0
  158. package/lib/examples/{ag-ui → components}/weather/index.d.ts +1 -1
  159. package/lib/examples/{ag-ui → components}/weather/index.js +1 -1
  160. package/lib/examples/example-selector.d.ts +17 -4
  161. package/lib/examples/example-selector.js +108 -41
  162. package/lib/examples/index.d.ts +10 -6
  163. package/lib/examples/index.js +10 -6
  164. package/lib/examples/lexical/initial-content.json +6 -6
  165. package/lib/examples/main.js +257 -27
  166. package/lib/examples/utils/a2ui.d.ts +18 -0
  167. package/lib/examples/utils/a2ui.js +69 -0
  168. package/lib/examples/utils/a2uiMarkdownProvider.d.ts +7 -0
  169. package/lib/examples/utils/a2uiMarkdownProvider.js +9 -0
  170. package/lib/examples/utils/agentId.d.ts +18 -0
  171. package/lib/examples/utils/agentId.js +54 -0
  172. package/lib/examples/utils/agents/earthquake-detector.json +11 -11
  173. package/lib/examples/utils/agents/sales-forecaster.json +11 -11
  174. package/lib/examples/utils/agents/social-post-generator.json +11 -11
  175. package/lib/examples/utils/agents/stock-market.json +11 -11
  176. package/lib/examples/utils/examplesStore.js +82 -27
  177. package/lib/examples/utils/useExampleAgentRuntimesUrl.d.ts +5 -0
  178. package/lib/examples/utils/useExampleAgentRuntimesUrl.js +19 -0
  179. package/lib/hooks/index.d.ts +8 -8
  180. package/lib/hooks/index.js +7 -7
  181. package/lib/hooks/useA2A.d.ts +2 -3
  182. package/lib/hooks/useAIAgentsWebSocket.d.ts +43 -4
  183. package/lib/hooks/useAIAgentsWebSocket.js +153 -12
  184. package/lib/hooks/useAcp.d.ts +1 -2
  185. package/lib/hooks/useAgUi.d.ts +1 -1
  186. package/lib/hooks/{useAgents.d.ts → useAgentRuntimes.d.ts} +70 -4
  187. package/lib/hooks/{useAgents.js → useAgentRuntimes.js} +237 -32
  188. package/lib/hooks/useAgentsCatalog.js +1 -1
  189. package/lib/hooks/useAgentsService.d.ts +2 -2
  190. package/lib/hooks/useAgentsService.js +7 -7
  191. package/lib/hooks/useCheckpoints.js +1 -1
  192. package/lib/hooks/useConfig.d.ts +4 -1
  193. package/lib/hooks/useConfig.js +10 -3
  194. package/lib/hooks/useContextSnapshot.d.ts +9 -4
  195. package/lib/hooks/useContextSnapshot.js +9 -37
  196. package/lib/hooks/useMonitoring.js +3 -0
  197. package/lib/hooks/useSandbox.d.ts +20 -8
  198. package/lib/hooks/useSandbox.js +105 -40
  199. package/lib/hooks/useSkills.d.ts +23 -5
  200. package/lib/hooks/useSkills.js +94 -39
  201. package/lib/hooks/useToolApprovals.d.ts +60 -36
  202. package/lib/hooks/useToolApprovals.js +318 -69
  203. package/lib/hooks/useVercelAI.d.ts +1 -1
  204. package/lib/index.d.ts +2 -1
  205. package/lib/index.js +1 -0
  206. package/lib/inference/index.d.ts +0 -1
  207. package/lib/middleware/index.d.ts +0 -1
  208. package/lib/protocols/AGUIAdapter.js +6 -0
  209. package/lib/protocols/VercelAIAdapter.d.ts +7 -0
  210. package/lib/protocols/VercelAIAdapter.js +59 -7
  211. package/lib/specs/agents/agents.d.ts +21 -4
  212. package/lib/specs/agents/agents.js +2879 -316
  213. package/lib/specs/agents/index.js +3 -1
  214. package/lib/specs/benchmarks.d.ts +20 -0
  215. package/lib/specs/benchmarks.js +205 -0
  216. package/lib/specs/envvars.js +27 -20
  217. package/lib/specs/evals.d.ts +10 -9
  218. package/lib/specs/evals.js +128 -88
  219. package/lib/specs/events.d.ts +3 -10
  220. package/lib/specs/events.js +127 -84
  221. package/lib/specs/frontendTools.js +2 -2
  222. package/lib/specs/guardrails.d.ts +0 -7
  223. package/lib/specs/guardrails.js +240 -159
  224. package/lib/specs/mcpServers.js +35 -6
  225. package/lib/specs/memory.d.ts +0 -2
  226. package/lib/specs/memory.js +4 -17
  227. package/lib/specs/models.d.ts +0 -2
  228. package/lib/specs/models.js +20 -15
  229. package/lib/specs/notifications.js +102 -18
  230. package/lib/specs/outputs.js +15 -9
  231. package/lib/specs/personas.d.ts +41 -0
  232. package/lib/specs/personas.js +168 -0
  233. package/lib/specs/skills.d.ts +1 -1
  234. package/lib/specs/skills.js +23 -23
  235. package/lib/specs/teams/index.js +3 -1
  236. package/lib/specs/teams/teams.js +468 -348
  237. package/lib/specs/tools.js +4 -4
  238. package/lib/specs/triggers.js +61 -11
  239. package/lib/stores/agentRuntimeStore.d.ts +208 -0
  240. package/lib/stores/agentRuntimeStore.js +650 -0
  241. package/lib/stores/conversationStore.js +2 -2
  242. package/lib/stores/index.d.ts +1 -1
  243. package/lib/stores/index.js +1 -1
  244. package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +1 -2
  245. package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -3
  246. package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +1 -2
  247. package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -3
  248. package/lib/tools/index.d.ts +0 -2
  249. package/lib/tools/index.js +0 -1
  250. package/lib/types/agents-lifecycle.d.ts +18 -0
  251. package/lib/types/agents.d.ts +6 -0
  252. package/lib/types/agentspecs.d.ts +54 -1
  253. package/lib/types/benchmarks.d.ts +43 -0
  254. package/lib/types/benchmarks.js +5 -0
  255. package/lib/types/chat.d.ts +325 -8
  256. package/lib/types/context.d.ts +27 -0
  257. package/lib/types/cost.d.ts +2 -2
  258. package/lib/types/evals.d.ts +26 -17
  259. package/lib/types/index.d.ts +3 -0
  260. package/lib/types/index.js +3 -0
  261. package/lib/types/mcp.d.ts +8 -0
  262. package/lib/types/models.d.ts +2 -2
  263. package/lib/types/personas.d.ts +25 -0
  264. package/lib/types/personas.js +5 -0
  265. package/lib/types/skills.d.ts +43 -1
  266. package/lib/types/stream.d.ts +110 -0
  267. package/lib/types/stream.js +36 -0
  268. package/lib/utils/utils.d.ts +9 -5
  269. package/lib/utils/utils.js +9 -5
  270. package/package.json +19 -11
  271. package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
  272. package/scripts/codegen/__pycache__/generate_benchmarks.cpython-313.pyc +0 -0
  273. package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
  274. package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
  275. package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
  276. package/scripts/codegen/generate_agents.py +187 -45
  277. package/scripts/codegen/generate_benchmarks.py +441 -0
  278. package/scripts/codegen/generate_evals.py +94 -16
  279. package/scripts/codegen/generate_events.py +35 -14
  280. package/scripts/codegen/generate_personas.py +319 -0
  281. package/scripts/codegen/generate_skills.py +9 -9
  282. package/scripts/sync-jupyter.sh +26 -7
  283. package/lib/api/tool-approvals.d.ts +0 -62
  284. package/lib/api/tool-approvals.js +0 -145
  285. package/lib/examples/AgentspecExample.js +0 -705
  286. package/lib/examples/LexicalSidebarExample.js +0 -163
  287. package/lib/examples/NotebookSidebarExample.js +0 -119
  288. package/lib/examples/NotebookSimpleExample.d.ts +0 -6
  289. package/lib/examples/NotebookSimpleExample.js +0 -22
  290. package/lib/examples/ag-ui/index.d.ts +0 -10
  291. package/lib/examples/ag-ui/index.js +0 -16
  292. package/lib/hooks/useAgentsRegistry.d.ts +0 -10
  293. package/lib/hooks/useAgentsRegistry.js +0 -20
  294. package/lib/stores/agentsStore.d.ts +0 -123
  295. package/lib/stores/agentsStore.js +0 -270
  296. /package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.d.ts +0 -0
  297. /package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.d.ts +0 -0
  298. /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.d.ts +0 -0
  299. /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.js +0 -0
@@ -0,0 +1,215 @@
1
+ /**
2
+ * Domain-level interface abstracting every operation the chat component and
3
+ * hooks need against the Datalayer agent runtime platform.
4
+ *
5
+ * Two concrete implementations are expected:
6
+ *
7
+ * 1. `SdkAgentRuntimesClient` — the default browser / Node implementation
8
+ * that delegates to a `DatalayerClient` composed with `AgentsMixin`.
9
+ * Makes real HTTP calls against the configured service URLs.
10
+ *
11
+ * 2. A bridge implementation hosted inside the VSCode webview sandbox (lives
12
+ * in the `vscode-datalayer` extension, not in this package). It implements
13
+ * the same interface but tunnels every call to the extension host via
14
+ * `postMessage` correlation IDs. The extension host answers the calls
15
+ * using its own `SdkAgentRuntimesClient` so the webview never touches the
16
+ * network or the auth token directly.
17
+ *
18
+ * The interface is deliberately transport-agnostic: consumers depend on
19
+ * semantic method names (`listRunningAgents`, `getAgentStatus`) rather
20
+ * than on URLs, fetch options, or WebSocket frames.
21
+ *
22
+ * @module client/IAgentRuntimesClient
23
+ */
24
+ import type { AgentEvent, AgentNotification, AgentUsageSummary, ContextUsage, ConversationCheckpoint, CostUsage, CreateAgentEventRequest, EvalReport, GetAgentEventResponse, ListAgentEventsParams, ListAgentEventsResponse, NotificationFilters, OutputArtifact, RunEvalsRequest, RunningAgent, UpdateAgentEventRequest } from '../types';
25
+ import type { CreateAgentRuntimeRequest, CreateRuntimeApiResponse } from '../types/agents-lifecycle';
26
+ /**
27
+ * Unified client contract for the Datalayer agent-runtimes control plane.
28
+ *
29
+ * Every method corresponds one-to-one with an operation on
30
+ * `AgentsMixin`. Phase 1 of the interface covers the non-streaming
31
+ * surface. Streaming chat (`streamChat`), chat config, history, and related
32
+ * transport-specific operations will be added in a follow-up once
33
+ * `AgentsMixin` grows typed wrappers for them.
34
+ */
35
+ export interface IAgentRuntimesClient {
36
+ /**
37
+ * Lists every running agent across all runtimes the caller can see.
38
+ *
39
+ * @returns Array of running agent summaries.
40
+ */
41
+ listRunningAgents(): Promise<RunningAgent[]>;
42
+ /**
43
+ * Retrieves the detailed status of a specific running agent.
44
+ *
45
+ * @param podName - Pod name hosting the agent.
46
+ * @param agentId - Optional agent ID within the pod (for multi-agent pods).
47
+ *
48
+ * @returns The agent's current status record.
49
+ */
50
+ getAgentStatus(podName: string, agentId?: string): Promise<RunningAgent>;
51
+ /**
52
+ * Pauses a running agent (light checkpoint by default).
53
+ *
54
+ * @param podName - Pod name hosting the agent.
55
+ */
56
+ pauseAgent(podName: string): Promise<void>;
57
+ /**
58
+ * Resumes a previously paused / checkpointed agent.
59
+ *
60
+ * @param podName - Pod name hosting the agent.
61
+ */
62
+ resumeAgent(podName: string): Promise<void>;
63
+ /**
64
+ * Lists conversation checkpoints for an agent.
65
+ *
66
+ * @param podName - Pod name hosting the agent.
67
+ * @param agentId - Optional agent ID within the pod.
68
+ *
69
+ * @returns Array of conversation checkpoints.
70
+ */
71
+ getAgentCheckpoints(podName: string, agentId?: string): Promise<ConversationCheckpoint[]>;
72
+ /**
73
+ * Retrieves the token and cost usage summary for an agent.
74
+ *
75
+ * @param podName - Pod name hosting the agent.
76
+ * @param agentId - Optional agent ID within the pod.
77
+ *
78
+ * @returns Aggregated usage totals.
79
+ */
80
+ getAgentUsage(podName: string, agentId?: string): Promise<AgentUsageSummary>;
81
+ /**
82
+ * Lists agent notifications, optionally filtered by level or read status.
83
+ *
84
+ * @param filters - Optional filter predicates.
85
+ *
86
+ * @returns Array of notifications matching the filters.
87
+ */
88
+ listNotifications(filters?: NotificationFilters): Promise<AgentNotification[]>;
89
+ /**
90
+ * Marks a single notification as read.
91
+ *
92
+ * @param notificationId - ID of the notification.
93
+ */
94
+ markNotificationRead(notificationId: string): Promise<void>;
95
+ /**
96
+ * Marks every notification for the caller as read.
97
+ */
98
+ markAllNotificationsRead(): Promise<void>;
99
+ /**
100
+ * Creates a new event for an agent.
101
+ *
102
+ * @param data - Event payload.
103
+ *
104
+ * @returns The created event wrapped in a success envelope.
105
+ */
106
+ createEvent(data: CreateAgentEventRequest): Promise<{
107
+ success: boolean;
108
+ event: AgentEvent;
109
+ }>;
110
+ /**
111
+ * Lists events for an agent with optional filters.
112
+ *
113
+ * @param agentId - Agent identifier whose events are being listed.
114
+ * @param params - Optional list filters (pagination, type, status).
115
+ *
116
+ * @returns Paginated events response.
117
+ */
118
+ listEvents(agentId: string, params?: Omit<ListAgentEventsParams, 'agent_id'>): Promise<ListAgentEventsResponse>;
119
+ /**
120
+ * Retrieves a single event by identifier.
121
+ *
122
+ * @param agentId - Agent that owns the event.
123
+ * @param eventId - Event identifier.
124
+ *
125
+ * @returns The requested event.
126
+ */
127
+ getEvent(agentId: string, eventId: string): Promise<GetAgentEventResponse>;
128
+ /**
129
+ * Patches an existing event.
130
+ *
131
+ * @param agentId - Agent that owns the event.
132
+ * @param eventId - Event identifier.
133
+ * @param data - Partial event fields to update.
134
+ *
135
+ * @returns The updated event.
136
+ */
137
+ updateEvent(agentId: string, eventId: string, data: UpdateAgentEventRequest): Promise<GetAgentEventResponse>;
138
+ /**
139
+ * Lists every output artifact an agent has generated.
140
+ *
141
+ * @param agentId - Agent identifier.
142
+ *
143
+ * @returns Array of output artifacts.
144
+ */
145
+ getAgentOutputs(agentId: string): Promise<OutputArtifact[]>;
146
+ /**
147
+ * Retrieves a single output artifact by identifier.
148
+ *
149
+ * @param agentId - Agent identifier.
150
+ * @param outputId - Output artifact identifier.
151
+ *
152
+ * @returns The requested output artifact.
153
+ */
154
+ getAgentOutput(agentId: string, outputId: string): Promise<OutputArtifact>;
155
+ /**
156
+ * Generates a new output artifact for an agent.
157
+ *
158
+ * @param agentId - Agent identifier.
159
+ * @param format - Requested output format (e.g. `"pdf"`).
160
+ * @param options - Optional format-specific generation options.
161
+ *
162
+ * @returns The newly generated output artifact.
163
+ */
164
+ generateAgentOutput(agentId: string, format: string, options?: Record<string, unknown>): Promise<OutputArtifact>;
165
+ /**
166
+ * Runs an evaluation batch against an agent.
167
+ *
168
+ * @param agentId - Agent identifier.
169
+ * @param request - Eval configuration payload.
170
+ *
171
+ * @returns Eval report capturing results and metrics.
172
+ */
173
+ runEvals(agentId: string, request: RunEvalsRequest): Promise<EvalReport>;
174
+ /**
175
+ * Lists past eval reports for an agent.
176
+ *
177
+ * @param agentId - Agent identifier.
178
+ *
179
+ * @returns Array of eval reports in reverse-chronological order.
180
+ */
181
+ listEvals(agentId: string): Promise<EvalReport[]>;
182
+ /**
183
+ * Retrieves a single eval report by identifier.
184
+ *
185
+ * @param agentId - Agent identifier.
186
+ * @param evalId - Eval report identifier.
187
+ *
188
+ * @returns The requested eval report.
189
+ */
190
+ getEval(agentId: string, evalId: string): Promise<EvalReport>;
191
+ /**
192
+ * Retrieves the current context window usage for an agent.
193
+ *
194
+ * @param agentId - Agent identifier.
195
+ *
196
+ * @returns Context usage details.
197
+ */
198
+ getContextUsage(agentId: string): Promise<ContextUsage>;
199
+ /**
200
+ * Retrieves the per-model cost usage for an agent.
201
+ *
202
+ * @param agentId - Agent identifier.
203
+ *
204
+ * @returns Cost usage aggregates.
205
+ */
206
+ getCostUsage(agentId: string): Promise<CostUsage>;
207
+ /**
208
+ * Creates a new agent runtime.
209
+ *
210
+ * @param data - Runtime creation parameters.
211
+ *
212
+ * @returns The creation response with the provisioned runtime descriptor.
213
+ */
214
+ createAgentRuntime(data: CreateAgentRuntimeRequest): Promise<CreateRuntimeApiResponse>;
215
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ export {};
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Default implementation of {@link IAgentRuntimesClient} that delegates to a
3
+ * `DatalayerClient` composed with `AgentsMixin`.
4
+ *
5
+ * This is the implementation used by browser, Node, JupyterLab, and standalone
6
+ * examples of the chat component. The VSCode extension provides its own
7
+ * implementation (`BridgeAgentRuntimesClient`) that tunnels calls through a
8
+ * message-passing bridge to an extension-host instance of this same class.
9
+ *
10
+ * @module client/SdkAgentRuntimesClient
11
+ */
12
+ import type { AgentEvent, AgentNotification, AgentUsageSummary, ContextUsage, ConversationCheckpoint, CostUsage, CreateAgentEventRequest, EvalReport, GetAgentEventResponse, ListAgentEventsParams, ListAgentEventsResponse, NotificationFilters, OutputArtifact, RunEvalsRequest, RunningAgent, UpdateAgentEventRequest } from '../types';
13
+ import type { CreateAgentRuntimeRequest, CreateRuntimeApiResponse } from '../types/agents-lifecycle';
14
+ import type { IAgentRuntimesClient } from './IAgentRuntimesClient';
15
+ /**
16
+ * Structural type describing the subset of methods {@link SdkAgentRuntimesClient}
17
+ * needs on the underlying SDK instance. Any `DatalayerClient` composed with
18
+ * `AgentsMixin` satisfies this shape; accepting it structurally avoids a
19
+ * hard type dependency on `@datalayer/core` inside this file, which keeps the
20
+ * default implementation drop-in replaceable in alternative deployments.
21
+ */
22
+ export interface AgentsSdkLike {
23
+ /** Lists every running agent across runtimes the caller can see. */
24
+ getRunningAgents(): Promise<RunningAgent[]>;
25
+ /** Retrieves the detailed status of a specific running agent. */
26
+ getAgentStatus(podName: string, agentId?: string): Promise<RunningAgent>;
27
+ /** Pauses a running agent. */
28
+ pauseAgent(podName: string): Promise<void>;
29
+ /** Resumes a previously paused agent. */
30
+ resumeAgent(podName: string): Promise<void>;
31
+ /** Lists conversation checkpoints for an agent. */
32
+ getAgentCheckpoints(podName: string, agentId?: string): Promise<ConversationCheckpoint[]>;
33
+ /** Retrieves the token and cost usage summary for an agent. */
34
+ getAgentUsage(podName: string, agentId?: string): Promise<AgentUsageSummary>;
35
+ /** Lists agent notifications with optional filters. */
36
+ getNotifications(filters?: NotificationFilters): Promise<AgentNotification[]>;
37
+ /** Marks a single notification as read. */
38
+ markNotificationRead(notificationId: string): Promise<void>;
39
+ /** Marks every notification for the caller as read. */
40
+ markAllNotificationsRead(): Promise<void>;
41
+ /** Creates a new event for an agent. */
42
+ createEvent(data: CreateAgentEventRequest): Promise<{
43
+ success: boolean;
44
+ event: AgentEvent;
45
+ }>;
46
+ /** Lists events for an agent. */
47
+ listEvents(agentId: string, params?: Omit<ListAgentEventsParams, 'agent_id'>): Promise<ListAgentEventsResponse>;
48
+ /** Retrieves a single event. */
49
+ getEvent(agentId: string, eventId: string): Promise<GetAgentEventResponse>;
50
+ /** Updates an event. */
51
+ updateEvent(agentId: string, eventId: string, data: UpdateAgentEventRequest): Promise<GetAgentEventResponse>;
52
+ /** Lists output artifacts for an agent. */
53
+ getAgentOutputs(agentId: string): Promise<OutputArtifact[]>;
54
+ /** Retrieves a single output artifact. */
55
+ getAgentOutput(agentId: string, outputId: string): Promise<OutputArtifact>;
56
+ /** Generates a new output artifact. */
57
+ generateAgentOutput(agentId: string, format: string, options?: Record<string, unknown>): Promise<OutputArtifact>;
58
+ /** Runs an evaluation batch. */
59
+ runEvals(agentId: string, request: RunEvalsRequest): Promise<EvalReport>;
60
+ /** Lists eval reports for an agent. */
61
+ listEvals(agentId: string): Promise<EvalReport[]>;
62
+ /** Retrieves a single eval report. */
63
+ getEval(agentId: string, evalId: string): Promise<EvalReport>;
64
+ /** Retrieves context window usage. */
65
+ getContextUsage(agentId: string): Promise<ContextUsage>;
66
+ /** Retrieves cost usage. */
67
+ getCostUsage(agentId: string): Promise<CostUsage>;
68
+ /** Creates a new agent runtime. */
69
+ createAgentRuntime(data: CreateAgentRuntimeRequest): Promise<CreateRuntimeApiResponse>;
70
+ }
71
+ /**
72
+ * {@link IAgentRuntimesClient} implementation that forwards every call to a
73
+ * pre-composed `DatalayerClient + AgentsMixin` instance.
74
+ *
75
+ * Construct with:
76
+ *
77
+ * ```ts
78
+ * import { DatalayerClient } from '@datalayer/core/lib/client';
79
+ * import { AgentsMixin, SdkAgentRuntimesClient } from '@datalayer/agent-runtimes';
80
+ *
81
+ * const ClientWithAgents = AgentsMixin(DatalayerClient);
82
+ * const sdk = new ClientWithAgents({ iamRunUrl, runtimesRunUrl, spacerRunUrl });
83
+ * const client = new SdkAgentRuntimesClient(sdk);
84
+ * ```
85
+ */
86
+ export declare class SdkAgentRuntimesClient implements IAgentRuntimesClient {
87
+ private readonly sdk;
88
+ /**
89
+ * Constructs the default client.
90
+ *
91
+ * @param sdk - A composed `DatalayerClient + AgentsMixin` instance whose
92
+ * `getToken()` / service URL resolvers already return valid values.
93
+ * When `null`, every method throws — pass a real SDK to use the client.
94
+ */
95
+ constructor(sdk: AgentsSdkLike | null);
96
+ /**
97
+ * Asserts the SDK is available for control-plane operations.
98
+ *
99
+ * @throws When the client was constructed without an SDK.
100
+ *
101
+ * @returns The SDK instance.
102
+ */
103
+ private requireSdk;
104
+ /** @inheritdoc */
105
+ listRunningAgents(): Promise<RunningAgent[]>;
106
+ /** @inheritdoc */
107
+ getAgentStatus(podName: string, agentId?: string): Promise<RunningAgent>;
108
+ /** @inheritdoc */
109
+ pauseAgent(podName: string): Promise<void>;
110
+ /** @inheritdoc */
111
+ resumeAgent(podName: string): Promise<void>;
112
+ /** @inheritdoc */
113
+ getAgentCheckpoints(podName: string, agentId?: string): Promise<ConversationCheckpoint[]>;
114
+ /** @inheritdoc */
115
+ getAgentUsage(podName: string, agentId?: string): Promise<AgentUsageSummary>;
116
+ /** @inheritdoc */
117
+ listNotifications(filters?: NotificationFilters): Promise<AgentNotification[]>;
118
+ /** @inheritdoc */
119
+ markNotificationRead(notificationId: string): Promise<void>;
120
+ /** @inheritdoc */
121
+ markAllNotificationsRead(): Promise<void>;
122
+ /** @inheritdoc */
123
+ createEvent(data: CreateAgentEventRequest): Promise<{
124
+ success: boolean;
125
+ event: AgentEvent;
126
+ }>;
127
+ /** @inheritdoc */
128
+ listEvents(agentId: string, params?: Omit<ListAgentEventsParams, 'agent_id'>): Promise<ListAgentEventsResponse>;
129
+ /** @inheritdoc */
130
+ getEvent(agentId: string, eventId: string): Promise<GetAgentEventResponse>;
131
+ /** @inheritdoc */
132
+ updateEvent(agentId: string, eventId: string, data: UpdateAgentEventRequest): Promise<GetAgentEventResponse>;
133
+ /** @inheritdoc */
134
+ getAgentOutputs(agentId: string): Promise<OutputArtifact[]>;
135
+ /** @inheritdoc */
136
+ getAgentOutput(agentId: string, outputId: string): Promise<OutputArtifact>;
137
+ /** @inheritdoc */
138
+ generateAgentOutput(agentId: string, format: string, options?: Record<string, unknown>): Promise<OutputArtifact>;
139
+ /** @inheritdoc */
140
+ runEvals(agentId: string, request: RunEvalsRequest): Promise<EvalReport>;
141
+ /** @inheritdoc */
142
+ listEvals(agentId: string): Promise<EvalReport[]>;
143
+ /** @inheritdoc */
144
+ getEval(agentId: string, evalId: string): Promise<EvalReport>;
145
+ /** @inheritdoc */
146
+ getContextUsage(agentId: string): Promise<ContextUsage>;
147
+ /** @inheritdoc */
148
+ getCostUsage(agentId: string): Promise<CostUsage>;
149
+ /** @inheritdoc */
150
+ createAgentRuntime(data: CreateAgentRuntimeRequest): Promise<CreateRuntimeApiResponse>;
151
+ }
@@ -0,0 +1,134 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * {@link IAgentRuntimesClient} implementation that forwards every call to a
7
+ * pre-composed `DatalayerClient + AgentsMixin` instance.
8
+ *
9
+ * Construct with:
10
+ *
11
+ * ```ts
12
+ * import { DatalayerClient } from '@datalayer/core/lib/client';
13
+ * import { AgentsMixin, SdkAgentRuntimesClient } from '@datalayer/agent-runtimes';
14
+ *
15
+ * const ClientWithAgents = AgentsMixin(DatalayerClient);
16
+ * const sdk = new ClientWithAgents({ iamRunUrl, runtimesRunUrl, spacerRunUrl });
17
+ * const client = new SdkAgentRuntimesClient(sdk);
18
+ * ```
19
+ */
20
+ export class SdkAgentRuntimesClient {
21
+ sdk;
22
+ /**
23
+ * Constructs the default client.
24
+ *
25
+ * @param sdk - A composed `DatalayerClient + AgentsMixin` instance whose
26
+ * `getToken()` / service URL resolvers already return valid values.
27
+ * When `null`, every method throws — pass a real SDK to use the client.
28
+ */
29
+ constructor(sdk) {
30
+ this.sdk = sdk;
31
+ }
32
+ /**
33
+ * Asserts the SDK is available for control-plane operations.
34
+ *
35
+ * @throws When the client was constructed without an SDK.
36
+ *
37
+ * @returns The SDK instance.
38
+ */
39
+ requireSdk() {
40
+ if (!this.sdk) {
41
+ throw new Error('Control-plane operations require an SDK instance. ' +
42
+ 'Construct SdkAgentRuntimesClient with a DatalayerClient+AgentsMixin.');
43
+ }
44
+ return this.sdk;
45
+ }
46
+ /** @inheritdoc */
47
+ async listRunningAgents() {
48
+ return this.requireSdk().getRunningAgents();
49
+ }
50
+ /** @inheritdoc */
51
+ async getAgentStatus(podName, agentId) {
52
+ return this.requireSdk().getAgentStatus(podName, agentId);
53
+ }
54
+ /** @inheritdoc */
55
+ async pauseAgent(podName) {
56
+ return this.requireSdk().pauseAgent(podName);
57
+ }
58
+ /** @inheritdoc */
59
+ async resumeAgent(podName) {
60
+ return this.requireSdk().resumeAgent(podName);
61
+ }
62
+ /** @inheritdoc */
63
+ async getAgentCheckpoints(podName, agentId) {
64
+ return this.requireSdk().getAgentCheckpoints(podName, agentId);
65
+ }
66
+ /** @inheritdoc */
67
+ async getAgentUsage(podName, agentId) {
68
+ return this.requireSdk().getAgentUsage(podName, agentId);
69
+ }
70
+ /** @inheritdoc */
71
+ async listNotifications(filters) {
72
+ return this.requireSdk().getNotifications(filters);
73
+ }
74
+ /** @inheritdoc */
75
+ async markNotificationRead(notificationId) {
76
+ return this.requireSdk().markNotificationRead(notificationId);
77
+ }
78
+ /** @inheritdoc */
79
+ async markAllNotificationsRead() {
80
+ return this.requireSdk().markAllNotificationsRead();
81
+ }
82
+ /** @inheritdoc */
83
+ async createEvent(data) {
84
+ return this.requireSdk().createEvent(data);
85
+ }
86
+ /** @inheritdoc */
87
+ async listEvents(agentId, params) {
88
+ return this.requireSdk().listEvents(agentId, params);
89
+ }
90
+ /** @inheritdoc */
91
+ async getEvent(agentId, eventId) {
92
+ return this.requireSdk().getEvent(agentId, eventId);
93
+ }
94
+ /** @inheritdoc */
95
+ async updateEvent(agentId, eventId, data) {
96
+ return this.requireSdk().updateEvent(agentId, eventId, data);
97
+ }
98
+ /** @inheritdoc */
99
+ async getAgentOutputs(agentId) {
100
+ return this.requireSdk().getAgentOutputs(agentId);
101
+ }
102
+ /** @inheritdoc */
103
+ async getAgentOutput(agentId, outputId) {
104
+ return this.requireSdk().getAgentOutput(agentId, outputId);
105
+ }
106
+ /** @inheritdoc */
107
+ async generateAgentOutput(agentId, format, options) {
108
+ return this.requireSdk().generateAgentOutput(agentId, format, options);
109
+ }
110
+ /** @inheritdoc */
111
+ async runEvals(agentId, request) {
112
+ return this.requireSdk().runEvals(agentId, request);
113
+ }
114
+ /** @inheritdoc */
115
+ async listEvals(agentId) {
116
+ return this.requireSdk().listEvals(agentId);
117
+ }
118
+ /** @inheritdoc */
119
+ async getEval(agentId, evalId) {
120
+ return this.requireSdk().getEval(agentId, evalId);
121
+ }
122
+ /** @inheritdoc */
123
+ async getContextUsage(agentId) {
124
+ return this.requireSdk().getContextUsage(agentId);
125
+ }
126
+ /** @inheritdoc */
127
+ async getCostUsage(agentId) {
128
+ return this.requireSdk().getCostUsage(agentId);
129
+ }
130
+ /** @inheritdoc */
131
+ async createAgentRuntime(data) {
132
+ return this.requireSdk().createAgentRuntime(data);
133
+ }
134
+ }
@@ -1,6 +1,9 @@
1
1
  /**
2
- * Client mixins for agent-runtimes.
2
+ * Client mixins and domain-level client abstractions for agent-runtimes.
3
3
  *
4
4
  * @module client
5
5
  */
6
6
  export { AgentsMixin } from './AgentsMixin';
7
+ export type { IAgentRuntimesClient } from './IAgentRuntimesClient';
8
+ export { SdkAgentRuntimesClient, type AgentsSdkLike, } from './SdkAgentRuntimesClient';
9
+ export { AgentRuntimesClientProvider, useAgentRuntimesClient, useOptionalAgentRuntimesClient, type AgentRuntimesClientProviderProps, } from './AgentRuntimesClientContext';
@@ -3,8 +3,10 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * Client mixins for agent-runtimes.
6
+ * Client mixins and domain-level client abstractions for agent-runtimes.
7
7
  *
8
8
  * @module client
9
9
  */
10
10
  export { AgentsMixin } from './AgentsMixin';
11
+ export { SdkAgentRuntimesClient, } from './SdkAgentRuntimesClient';
12
+ export { AgentRuntimesClientProvider, useAgentRuntimesClient, useOptionalAgentRuntimesClient, } from './AgentRuntimesClientContext';
@@ -164,7 +164,11 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
164
164
  }, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
165
165
  e.preventDefault();
166
166
  setIsDetailsExpanded(prev => !prev);
167
- }, style: { cursor: 'pointer', display: 'flex', alignItems: 'center' }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Box, { sx: {
167
+ }, style: {
168
+ cursor: 'pointer',
169
+ display: 'flex',
170
+ alignItems: 'center',
171
+ }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Box, { sx: {
168
172
  display: 'flex',
169
173
  alignItems: 'center',
170
174
  color: 'fg.muted',
@@ -53,10 +53,20 @@ export declare const isSpecSelection: (id: string) => boolean;
53
53
  * Helper: extract the spec id from a spec selection value.
54
54
  */
55
55
  export declare const getSpecId: (id: string) => string;
56
+ /**
57
+ * Helper: is the selected agent id a cloud library spec?
58
+ */
59
+ export declare const isCloudSpecSelection: (id: string) => boolean;
60
+ /**
61
+ * Helper: extract the cloud spec id from a cloud selection value.
62
+ */
63
+ export declare const getCloudSpecId: (id: string) => string;
56
64
  export interface SkillOption {
57
65
  id: string;
58
66
  name: string;
59
67
  description?: string;
68
+ requiredEnvVars?: string[];
69
+ isAvailable?: boolean;
60
70
  }
61
71
  declare const AGENT_LIBRARIES: {
62
72
  value: AgentLibrary;
@@ -110,6 +120,18 @@ export interface AgentConfigurationProps {
110
120
  selectedSkills?: string[];
111
121
  /** Selected MCP servers */
112
122
  selectedMcpServers?: McpServerSelection[];
123
+ /** Cloud-discovered specs fetched from a remote runtime catalog. */
124
+ cloudLibrarySpecs?: LibraryAgentSpec[];
125
+ /** Loading state for cloud library specs. */
126
+ cloudLibraryLoading?: boolean;
127
+ /** Optional cloud library fetch error message. */
128
+ cloudLibraryError?: string | null;
129
+ /** Current runtime target mode label. */
130
+ launchTarget?: 'local' | 'cloud';
131
+ /** Current launch/runtime status label. */
132
+ launchStatus?: string;
133
+ /** Effective service URL that will be used when launching. */
134
+ launchBaseUrl?: string;
113
135
  identityProviders?: {
114
136
  [K in OAuthProvider]?: {
115
137
  clientId: string;