@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
@@ -11,8 +11,8 @@
11
11
  * @module client/AgentsMixin
12
12
  */
13
13
  import type { Constructor } from '@datalayer/core/lib/client/utils/mixins';
14
- import type { AgentEvent, CreateAgentEventRequest, GetAgentEventResponse, ListAgentEventsParams, ListAgentEventsResponse, UpdateAgentEventRequest, RunningAgent, AgentUsageSummary, ConversationCheckpoint, AgentNotification, NotificationFilters, OutputArtifact, EvalReport, RunEvalsRequest, ContextUsage, CostUsage } from '../types';
15
- import type { ToolApproval, ToolApprovalFilters } from '../types/tool-approvals';
14
+ import type { AgentEvent, CreateAgentEventRequest, GetAgentEventResponse, ListAgentEventsParams, ListAgentEventsResponse, UpdateAgentEventRequest, RunningAgent, AgentUsageSummary, ConversationCheckpoint, AgentNotification, NotificationFilters, OutputArtifact, EvalReport, RunEvalsRequest, ContextUsage, CostUsage, AgentSpec } from '../types';
15
+ import type { CreateAgentRuntimeRequest, CreateRuntimeApiResponse } from '../types/agents-lifecycle';
16
16
  /** Agents mixin providing durable agent management. */
17
17
  export declare function AgentsMixin<TBase extends Constructor>(Base: TBase): {
18
18
  new (...args: any[]): {
@@ -52,23 +52,6 @@ export declare function AgentsMixin<TBase extends Constructor>(Base: TBase): {
52
52
  * @returns Usage summary including tokens, cost, iterations
53
53
  */
54
54
  getAgentUsage(podName: string, agentId?: string): Promise<AgentUsageSummary>;
55
- /**
56
- * List tool approval requests, optionally filtered.
57
- * @param filters - Optional filters (status, agentId)
58
- * @returns Array of tool approval records
59
- */
60
- getToolApprovals(filters?: ToolApprovalFilters): Promise<ToolApproval[]>;
61
- /**
62
- * Approve a tool execution request.
63
- * @param approvalId - ID of the approval to approve
64
- */
65
- approveToolRequest(approvalId: string): Promise<void>;
66
- /**
67
- * Reject a tool execution request.
68
- * @param approvalId - ID of the approval to reject
69
- * @param reason - Optional rejection reason
70
- */
71
- rejectToolRequest(approvalId: string, reason?: string): Promise<void>;
72
55
  /**
73
56
  * List notifications, optionally filtered.
74
57
  * @param filters - Optional filters (level, read status)
@@ -165,5 +148,51 @@ export declare function AgentsMixin<TBase extends Constructor>(Base: TBase): {
165
148
  * @returns Cost usage including per-model breakdown
166
149
  */
167
150
  getCostUsage(agentId: string): Promise<CostUsage>;
151
+ /**
152
+ * Get an agent specification by ID.
153
+ * @param agentSpecId - Agent spec identifier.
154
+ * @returns The agent spec, or undefined if not found.
155
+ */
156
+ getAgentSpec(agentSpecId: string): AgentSpec | undefined;
157
+ /**
158
+ * List all available agent specifications.
159
+ * @param prefix - If provided, only return specs whose ID starts with this prefix.
160
+ * @returns Array of agent specifications.
161
+ */
162
+ listAgentSpecs(prefix?: string): AgentSpec[];
163
+ /**
164
+ * Get required environment variables for an agent spec.
165
+ * @param spec - The agent specification.
166
+ * @returns Deduplicated array of required environment variable names.
167
+ */
168
+ getAgentSpecRequiredEnvVars(spec: AgentSpec): string[];
169
+ /**
170
+ * Assign an agent runtime to a project.
171
+ * @param projectUid - Project UID.
172
+ * @param agentPodName - Agent runtime pod name.
173
+ * @param agentSpecId - Agent spec ID.
174
+ * @param agentGivenName - Human-readable runtime name.
175
+ * @returns Updated project.
176
+ */
177
+ assignAgentToProject(projectUid: string, agentPodName: string, agentSpecId?: string, agentGivenName?: string): Promise<any>;
178
+ /**
179
+ * Remove the agent assignment from a project.
180
+ * @param projectUid - Project UID.
181
+ * @returns Updated project.
182
+ */
183
+ unassignAgentFromProject(projectUid: string): Promise<any>;
184
+ /**
185
+ * Create an agent runtime.
186
+ * @param data - Runtime creation parameters.
187
+ * @returns The created runtime response.
188
+ */
189
+ createAgentRuntime(data: CreateAgentRuntimeRequest): Promise<CreateRuntimeApiResponse>;
190
+ /**
191
+ * Create an agent runtime and assign it to a project.
192
+ * @param projectUid - The project UID to assign the agent to.
193
+ * @param data - Runtime creation parameters.
194
+ * @returns The created runtime response.
195
+ */
196
+ createAgentRuntimeForProject(projectUid: string, data: CreateAgentRuntimeRequest): Promise<CreateRuntimeApiResponse>;
168
197
  };
169
198
  } & TBase;
@@ -3,12 +3,13 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import * as agents from '../api/agents';
6
- import * as toolApprovals from '../api/tool-approvals';
7
6
  import * as notifications from '../api/notifications';
8
7
  import * as events from '../api/events';
9
8
  import * as output from '../api/output';
10
9
  import * as evals from '../api/evals';
11
10
  import * as context from '../api/context';
11
+ import * as agentSpecs from '../specs/agents';
12
+ import { requestDatalayerAPI } from '@datalayer/core/lib/api/DatalayerApi';
12
13
  /** Agents mixin providing durable agent management. */
13
14
  export function AgentsMixin(Base) {
14
15
  return class extends Base {
@@ -78,35 +79,12 @@ export function AgentsMixin(Base) {
78
79
  // ========================================================================
79
80
  // Tool Approvals
80
81
  // ========================================================================
81
- /**
82
- * List tool approval requests, optionally filtered.
83
- * @param filters - Optional filters (status, agentId)
84
- * @returns Array of tool approval records
85
- */
86
- async getToolApprovals(filters) {
87
- const token = this.getToken();
88
- const baseUrl = this.getIamRunUrl();
89
- return toolApprovals.getToolApprovals(token, filters, baseUrl);
90
- }
91
- /**
92
- * Approve a tool execution request.
93
- * @param approvalId - ID of the approval to approve
94
- */
95
- async approveToolRequest(approvalId) {
96
- const token = this.getToken();
97
- const baseUrl = this.getIamRunUrl();
98
- return toolApprovals.approveToolRequest(token, approvalId, baseUrl);
99
- }
100
- /**
101
- * Reject a tool execution request.
102
- * @param approvalId - ID of the approval to reject
103
- * @param reason - Optional rejection reason
104
- */
105
- async rejectToolRequest(approvalId, reason) {
106
- const token = this.getToken();
107
- const baseUrl = this.getIamRunUrl();
108
- return toolApprovals.rejectToolRequest(token, approvalId, reason, baseUrl);
109
- }
82
+ //
83
+ // Tool approval interactions have been removed from the REST mixin.
84
+ // All approval flows (list / approve / reject / realtime updates) now
85
+ // travel exclusively over the AI Agents websocket stream. Use the
86
+ // `useToolApprovals` React hook (or send `tool_approval_decision`
87
+ // messages directly on the stream) instead.
110
88
  // ========================================================================
111
89
  // Notifications
112
90
  // ========================================================================
@@ -275,5 +253,112 @@ export function AgentsMixin(Base) {
275
253
  const baseUrl = this.getIamRunUrl();
276
254
  return context.getCostUsage(token, agentId, baseUrl);
277
255
  }
256
+ // ========================================================================
257
+ // Agent Specs
258
+ // ========================================================================
259
+ /**
260
+ * Get an agent specification by ID.
261
+ * @param agentSpecId - Agent spec identifier.
262
+ * @returns The agent spec, or undefined if not found.
263
+ */
264
+ getAgentSpec(agentSpecId) {
265
+ return agentSpecs.getAgentSpecs(agentSpecId);
266
+ }
267
+ /**
268
+ * List all available agent specifications.
269
+ * @param prefix - If provided, only return specs whose ID starts with this prefix.
270
+ * @returns Array of agent specifications.
271
+ */
272
+ listAgentSpecs(prefix) {
273
+ return agentSpecs.listAgentSpecs(prefix);
274
+ }
275
+ /**
276
+ * Get required environment variables for an agent spec.
277
+ * @param spec - The agent specification.
278
+ * @returns Deduplicated array of required environment variable names.
279
+ */
280
+ getAgentSpecRequiredEnvVars(spec) {
281
+ return agentSpecs.getAgentSpecRequiredEnvVars(spec);
282
+ }
283
+ // ========================================================================
284
+ // Project Agent Assignment
285
+ // ========================================================================
286
+ /**
287
+ * Assign an agent runtime to a project.
288
+ * @param projectUid - Project UID.
289
+ * @param agentPodName - Agent runtime pod name.
290
+ * @param agentSpecId - Agent spec ID.
291
+ * @param agentGivenName - Human-readable runtime name.
292
+ * @returns Updated project.
293
+ */
294
+ async assignAgentToProject(projectUid, agentPodName, agentSpecId, agentGivenName) {
295
+ // Backend requires name and description on every update
296
+ const project = await this.getProject(projectUid);
297
+ return this.updateProject(projectUid, {
298
+ name: project.name,
299
+ description: project.description,
300
+ attached_agent_pod_name_s: agentPodName,
301
+ attached_agent_spec_id_s: agentSpecId || '',
302
+ attached_agent_given_name_s: agentGivenName || '',
303
+ });
304
+ }
305
+ /**
306
+ * Remove the agent assignment from a project.
307
+ * @param projectUid - Project UID.
308
+ * @returns Updated project.
309
+ */
310
+ async unassignAgentFromProject(projectUid) {
311
+ // Backend requires name and description on every update
312
+ const project = await this.getProject(projectUid);
313
+ return this.updateProject(projectUid, {
314
+ name: project.name,
315
+ description: project.description,
316
+ attached_agent_pod_name_s: '',
317
+ attached_agent_spec_id_s: '',
318
+ attached_agent_given_name_s: '',
319
+ });
320
+ }
321
+ // ========================================================================
322
+ // Agent Runtime Lifecycle
323
+ // ========================================================================
324
+ /**
325
+ * Create an agent runtime.
326
+ * @param data - Runtime creation parameters.
327
+ * @returns The created runtime response.
328
+ */
329
+ async createAgentRuntime(data) {
330
+ const token = this.getToken();
331
+ const runtimesRunUrl = this.getRuntimesRunUrl();
332
+ return requestDatalayerAPI({
333
+ url: `${runtimesRunUrl}/api/runtimes/v1/runtimes`,
334
+ method: 'POST',
335
+ token,
336
+ body: {
337
+ environment_name: data.environmentName || 'ai-agents-env',
338
+ given_name: data.givenName || 'Agent',
339
+ credits_limit: data.creditsLimit || 10,
340
+ type: data.type || 'notebook',
341
+ editor_variant: data.editorVariant || 'none',
342
+ enable_codemode: data.enableCodemode ?? false,
343
+ agent_spec_id: data.agentSpecId || undefined,
344
+ agent_spec: data.agentSpec || undefined,
345
+ },
346
+ });
347
+ }
348
+ /**
349
+ * Create an agent runtime and assign it to a project.
350
+ * @param projectUid - The project UID to assign the agent to.
351
+ * @param data - Runtime creation parameters.
352
+ * @returns The created runtime response.
353
+ */
354
+ async createAgentRuntimeForProject(projectUid, data) {
355
+ const response = await this.createAgentRuntime(data);
356
+ if (response.success && response.runtime) {
357
+ const podName = response.runtime.pod_name;
358
+ const givenName = response.runtime.given_name || data.givenName || data.agentSpecId;
359
+ await this.assignAgentToProject(projectUid, podName, data.agentSpecId, givenName);
360
+ }
361
+ return response;
362
+ }
278
363
  };
279
364
  }
@@ -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
+ }