@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
@@ -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';
@@ -3,12 +3,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Copyright (c) 2025-2026 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
+ import { useState } from 'react';
6
7
  import { Button, Label, Text, Truncate } from '@primer/react';
7
8
  import { Box } from '@datalayer/primer-addons';
8
- import { DownloadIcon, EyeClosedIcon, EyeIcon, TrashIcon, } from '@primer/octicons-react';
9
- import { createMarkdownDownloadPayload, downloadTextPayload, formatRelativeTime, } from '@datalayer/core/lib/utils';
9
+ import { ChevronDownIcon, DownloadIcon, EyeClosedIcon, EyeIcon, TrashIcon, } from '@primer/octicons-react';
10
+ import { createMarkdownDownloadPayload, downloadTextPayload, formatDurationMs, formatRelativeTime, } from '@datalayer/core/lib/utils';
10
11
  import { Streamdown } from 'streamdown';
11
12
  import { streamdownMarkdownStyles } from '../chat/styles/streamdownStyles';
13
+ const EVENT_KIND_VARIANT = {
14
+ 'agent-start-requested': 'attention',
15
+ 'agent-assigned': 'accent',
16
+ 'agent-started': 'success',
17
+ 'agent-output': 'accent',
18
+ 'agent-termination-requested': 'attention',
19
+ 'agent-terminated': 'danger',
20
+ 'tool-approval-requested': 'attention',
21
+ };
12
22
  const eventStartedAt = (evt) => {
13
23
  const startedAt = evt?.started_at || evt?.payload?.started_at;
14
24
  return typeof startedAt === 'string' && startedAt ? startedAt : null;
@@ -17,15 +27,15 @@ const eventEndedAt = (evt) => {
17
27
  const endedAt = evt?.ended_at || evt?.payload?.ended_at;
18
28
  return typeof endedAt === 'string' && endedAt ? endedAt : null;
19
29
  };
20
- const isRunningEvent = (evt) => {
21
- const status = String(evt?.status ?? '').toLowerCase();
22
- return evt?.kind === 'agent-started' && status === 'running';
23
- };
24
30
  export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
31
+ const [isOutputExpanded, setIsOutputExpanded] = useState(false);
32
+ const [isDetailsExpanded, setIsDetailsExpanded] = useState(false);
33
+ const eventKind = String(event?.kind ?? '').toLowerCase();
34
+ const eventTitle = String(event?.title ?? '');
35
+ const eventOrigin = String(event?.metadata?.origin || '');
25
36
  const startedAt = eventStartedAt(event);
26
37
  const endedAt = eventEndedAt(event);
27
- const running = isRunningEvent(event);
28
- const outputText = event.kind === 'agent-ended' && event.payload?.outputs
38
+ const outputText = eventKind === 'agent-output' && event.payload?.outputs
29
39
  ? String(event.payload.outputs)
30
40
  : null;
31
41
  const runtimeId = String(event?.agent_id ||
@@ -33,6 +43,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
33
43
  event?.payload?.runtime_id ||
34
44
  event?.payload?.agent_id ||
35
45
  'runtime');
46
+ const hasAgentRoute = Boolean(onOpenAgent) && runtimeId !== 'runtime';
36
47
  const detailEntries = [];
37
48
  const detailLineSx = { fontSize: 0, overflowWrap: 'anywhere' };
38
49
  const detailLabelSx = { color: 'fg.muted' };
@@ -51,9 +62,6 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
51
62
  detailEntries.push({ label: key, value: String(value) });
52
63
  });
53
64
  Object.entries(event?.payload || {}).forEach(([key, value]) => {
54
- if (key === 'outputs') {
55
- return;
56
- }
57
65
  if (value === undefined || value === null || value === '') {
58
66
  return;
59
67
  }
@@ -88,13 +96,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
88
96
  gap: 2,
89
97
  minWidth: 0,
90
98
  flex: 1,
91
- }, children: [_jsx(Label, { variant: event.kind === 'agent-started'
92
- ? 'accent'
93
- : event.kind === 'agent-ended'
94
- ? 'success'
95
- : event.kind?.includes('alert')
96
- ? 'danger'
97
- : 'attention', children: event.kind }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title }), event.kind === 'agent-ended' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [running && event.agent_id && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { sx: {
99
+ }, children: [_jsx(Label, { variant: EVENT_KIND_VARIANT[eventKind] ?? 'secondary', children: eventKind }), _jsx(Truncate, { maxWidth: "50%", title: String(eventTitle || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: eventTitle }), eventKind === 'agent-output' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) })), eventOrigin && (_jsxs(Label, { variant: "secondary", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Origin: ", eventOrigin] }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [hasAgentRoute && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(runtimeId), children: "View agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { sx: {
98
100
  fontSize: 0,
99
101
  color: 'fg.muted',
100
102
  mt: 1,
@@ -102,21 +104,24 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
102
104
  overflowWrap: 'anywhere',
103
105
  }, children: [(startedAt ||
104
106
  endedAt ||
105
- (event.kind === 'agent-ended' &&
107
+ (eventKind === 'agent-output' &&
106
108
  event.payload.duration_ms != null)) && (_jsxs(Text, { as: "p", children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) &&
107
- event.kind === 'agent-ended' &&
109
+ eventKind === 'agent-output' &&
108
110
  event.payload.duration_ms != null
109
111
  ? ' · '
110
- : '', event.kind === 'agent-ended' && event.payload.duration_ms != null
111
- ? `Duration: ${(Number(event.payload.duration_ms) / 1000).toFixed(1)}s`
112
- : ''] })), event.kind?.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), event.kind?.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), event.kind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, { sx: {
112
+ : '', eventKind === 'agent-output' && event.payload.duration_ms != null
113
+ ? `Duration: ${formatDurationMs(Number(event.payload.duration_ms))}`
114
+ : ''] })), eventKind.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), eventKind.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), eventKind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, { sx: {
113
115
  mt: 2,
114
116
  p: 2,
115
117
  borderRadius: 2,
116
118
  border: '1px solid',
117
119
  borderColor: 'border.muted',
118
120
  bg: 'canvas.subtle',
119
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { children: [_jsx("summary", { style: {
121
+ }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
122
+ e.preventDefault();
123
+ setIsOutputExpanded(prev => !prev);
124
+ }, style: {
120
125
  cursor: 'pointer',
121
126
  display: 'flex',
122
127
  alignItems: 'center',
@@ -128,7 +133,16 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
128
133
  minWidth: 0,
129
134
  width: '100%',
130
135
  flexWrap: 'nowrap',
131
- }, children: [_jsx(Text, { sx: {
136
+ }, children: [_jsx(Box, { sx: {
137
+ display: 'flex',
138
+ alignItems: 'center',
139
+ color: 'fg.muted',
140
+ flexShrink: 0,
141
+ transition: 'transform 0.15s ease',
142
+ transform: isOutputExpanded
143
+ ? 'rotate(180deg)'
144
+ : 'rotate(0deg)',
145
+ }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
132
146
  fontSize: 0,
133
147
  fontWeight: 'semibold',
134
148
  flexShrink: 0,
@@ -147,6 +161,21 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
147
161
  border: '1px solid',
148
162
  borderColor: 'border.muted',
149
163
  bg: 'canvas.subtle',
150
- }, children: _jsxs("details", { children: [_jsx("summary", { style: { cursor: 'pointer' }, children: _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" }) }), _jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
164
+ }, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
165
+ e.preventDefault();
166
+ setIsDetailsExpanded(prev => !prev);
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: {
172
+ display: 'flex',
173
+ alignItems: 'center',
174
+ color: 'fg.muted',
175
+ transition: 'transform 0.15s ease',
176
+ transform: isDetailsExpanded
177
+ ? 'rotate(180deg)'
178
+ : 'rotate(0deg)',
179
+ }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
151
180
  }
152
181
  export default NotificationEventCard;
@@ -3,14 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Copyright (c) 2025-2026 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
+ import { useState } from 'react';
6
7
  import { Button, Label, Text, Truncate } from '@primer/react';
7
8
  import { Box } from '@datalayer/primer-addons';
8
- import { DownloadIcon, EyeClosedIcon, EyeIcon, TrashIcon, } from '@primer/octicons-react';
9
- import { createMarkdownDownloadPayload, downloadTextPayload, formatRelativeTime, } from '@datalayer/core/lib/utils';
9
+ import { ChevronDownIcon, DownloadIcon, EyeClosedIcon, EyeIcon, TrashIcon, } from '@primer/octicons-react';
10
+ import { createMarkdownDownloadPayload, downloadTextPayload, formatDurationMs, formatRelativeTime, } from '@datalayer/core/lib/utils';
10
11
  import { Streamdown } from 'streamdown';
11
12
  import { streamdownMarkdownStyles } from '../chat/styles/streamdownStyles';
12
13
  export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
13
- const outputText = event.kind === 'agent-ended' && event.payload?.outputs
14
+ const [isOutputExpanded, setIsOutputExpanded] = useState(false);
15
+ const outputText = event.kind === 'agent-output' && event.payload?.outputs
14
16
  ? String(event.payload.outputs)
15
17
  : null;
16
18
  const runtimeId = String(event?.agent_id ||
@@ -20,7 +22,7 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
20
22
  'runtime');
21
23
  const startedAt = event?.started_at || event?.payload?.started_at || null;
22
24
  const endedAt = event?.ended_at || event?.payload?.ended_at || null;
23
- const durationMs = event.kind === 'agent-ended' ? event.payload?.duration_ms : null;
25
+ const durationMs = event.kind === 'agent-output' ? event.payload?.duration_ms : null;
24
26
  return (_jsxs(Box, { sx: {
25
27
  minWidth: 0,
26
28
  maxWidth: '100%',
@@ -44,14 +46,17 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
44
46
  minWidth: 0,
45
47
  flex: 1,
46
48
  }, children: [_jsx(Label, { variant: "success", children: "output" }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || runtimeId), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title || runtimeId }), event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [event.agent_id && onOpenAgent && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), (startedAt || endedAt || durationMs != null) && (_jsxs(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) && durationMs != null ? ' · ' : '', durationMs != null
47
- ? `Duration: ${(Number(durationMs) / 1000).toFixed(1)}s`
49
+ ? `Duration: ${formatDurationMs(Number(durationMs))}`
48
50
  : ''] })), outputText && (_jsx(Box, { sx: {
49
51
  p: 2,
50
52
  borderRadius: 2,
51
53
  border: '1px solid',
52
54
  borderColor: 'border.muted',
53
55
  bg: 'canvas.subtle',
54
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { children: [_jsx("summary", { style: {
56
+ }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
57
+ e.preventDefault();
58
+ setIsOutputExpanded(prev => !prev);
59
+ }, style: {
55
60
  cursor: 'pointer',
56
61
  display: 'flex',
57
62
  alignItems: 'center',
@@ -63,7 +68,16 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
63
68
  minWidth: 0,
64
69
  width: '100%',
65
70
  flexWrap: 'nowrap',
66
- }, children: [_jsx(Text, { sx: {
71
+ }, children: [_jsx(Box, { sx: {
72
+ display: 'flex',
73
+ alignItems: 'center',
74
+ color: 'fg.muted',
75
+ flexShrink: 0,
76
+ transition: 'transform 0.15s ease',
77
+ transform: isOutputExpanded
78
+ ? 'rotate(180deg)'
79
+ : 'rotate(0deg)',
80
+ }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
67
81
  fontSize: 0,
68
82
  fontWeight: 'semibold',
69
83
  flexShrink: 0,
@@ -3,9 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Copyright (c) 2025-2026 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
+ import { useState } from 'react';
6
7
  import { Button, Label, Text } from '@primer/react';
7
8
  import { Box } from '@datalayer/primer-addons';
8
- import { CheckCircleIcon, EyeClosedIcon, EyeIcon, TrashIcon, XCircleIcon, } from '@primer/octicons-react';
9
+ import { CheckCircleIcon, ChevronDownIcon, EyeClosedIcon, EyeIcon, TrashIcon, XCircleIcon, } from '@primer/octicons-react';
9
10
  import { formatRelativeTime } from '@datalayer/core/lib/utils';
10
11
  export const TOOL_APPROVAL_STATUS_CONFIG = {
11
12
  pending: { label: 'Pending', variant: 'attention' },
@@ -19,6 +20,7 @@ const RISK_CONFIG = {
19
20
  high: { label: 'High Risk', variant: 'severe' },
20
21
  };
21
22
  export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead, onDelete, }) {
23
+ const [isDetailsExpanded, setIsDetailsExpanded] = useState(false);
22
24
  const statusConfig = TOOL_APPROVAL_STATUS_CONFIG[approval.status];
23
25
  const riskConfig = RISK_CONFIG[approval.riskLevel];
24
26
  const parameterCount = approval.parameters
@@ -55,6 +57,22 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
55
57
  border: '1px solid',
56
58
  borderColor: 'border.muted',
57
59
  bg: 'canvas.subtle',
58
- }, children: _jsxs("details", { children: [_jsx("summary", { style: { cursor: 'pointer' }, children: _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" }) }), _jsxs(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { sx: { display: 'flex', gap: 2, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
60
+ }, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
61
+ e.preventDefault();
62
+ setIsDetailsExpanded(prev => !prev);
63
+ }, style: {
64
+ cursor: 'pointer',
65
+ display: 'flex',
66
+ alignItems: 'center',
67
+ minWidth: 0,
68
+ }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Box, { sx: {
69
+ display: 'flex',
70
+ alignItems: 'center',
71
+ color: 'fg.muted',
72
+ transition: 'transform 0.15s ease',
73
+ transform: isDetailsExpanded
74
+ ? 'rotate(180deg)'
75
+ : 'rotate(0deg)',
76
+ }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { sx: { display: 'flex', gap: 2, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
59
77
  }
60
78
  export default ToolApprovalCard;
@@ -431,7 +431,7 @@ export const AgentConfiguration = ({ agentLibrary, protocol: transport, extensio
431
431
  .map(spec => {
432
432
  const pkg = spec.id.includes('/') ? spec.id.split('/')[0] : '';
433
433
  return (_jsxs(Select.Option, { value: `spec:${spec.id}`, children: [spec.emoji ? `${spec.emoji} ` : '', pkg ? `[${pkg}] ` : '', spec.name] }, `spec:${spec.id}`));
434
- }), agents.map(agent => (_jsxs(Select.Option, { value: agent.id, children: ["[Example] ", agent.status === 'running' && '● ', agent.name] }, agent.id)))] }), _jsx(FormControl.Caption, { children: isNewAgentMode
434
+ }), agents.map(agent => (_jsxs(Select.Option, { value: agent.id, children: ["[Persona] ", agent.status === 'running' && '● ', agent.name] }, agent.id)))] }), _jsx(FormControl.Caption, { children: isNewAgentMode
435
435
  ? selectedSpec
436
436
  ? `Creating from spec: ${selectedSpec.name} — capabilities are locked`
437
437
  : 'Configure a new custom agent'
@@ -444,7 +444,7 @@ export const AgentConfiguration = ({ agentLibrary, protocol: transport, extensio
444
444
  : 'The base URL of your agent-runtimes server' })] }), _jsxs(Box, { sx: { display: 'flex', gap: 3, marginBottom: 3 }, children: [_jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "Agent Library" }), _jsx(Select, { value: agentLibrary, onChange: e => onAgentLibraryChange(e.target.value), sx: { width: '100%' }, children: AGENT_LIBRARIES.map(lib => (_jsxs(Select.Option, { value: lib.value, disabled: lib.disabled, children: [lib.label, lib.disabled && ' (Coming Soon)'] }, lib.value))) })] }), _jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly || models.length === 0, children: [_jsx(FormControl.Label, { children: "Model" }), _jsx(Select, { value: model, onChange: e => onModelChange(e.target.value), sx: { width: '100%' }, children: models.length === 0 ? (_jsx(Select.Option, { value: "", children: "Loading models..." })) : (models.map(m => (_jsxs(Select.Option, { value: m.id, disabled: !m.isAvailable, children: [m.name, !m.isAvailable && ' (API key required)'] }, m.id)))) })] }), _jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "Transport" }), _jsx(Select, { value: transport, onChange: e => onTransportChange(e.target.value), sx: { width: '100%' }, children: TRANSPORTS.map(t => (_jsx(Select.Option, { value: t.value, children: t.label }, t.value))) })] }), _jsxs(FormControl, { sx: { flex: 1 }, children: [_jsx(FormControl.Label, { children: "Extensions" }), _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: EXTENSIONS.map(ext => (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { value: ext.value, checked: extensions.includes(ext.value), disabled: isFormReadOnly || !isExtensionEnabled(ext.value), onChange: e => handleExtensionChange(ext.value, e.target.checked) }), _jsx(Text, { children: ext.label })] }, ext.value))) })] })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "System Prompt" }), _jsx(TextInput, { value: systemPrompt, onChange: e => onSystemPromptChange(e.target.value), placeholder: "You are a helpful AI assistant.", sx: { width: '100%' } })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "System Prompt Codemode Addons" }), _jsx(TextInput, { value: systemPromptCodemodeAddons, onChange: e => onSystemPromptCodemodeAddonsChange(e.target.value), placeholder: "Additional codemode instructions", sx: { width: '100%' } })] }), _jsxs(Box, { sx: { display: 'flex', gap: 3, marginBottom: 3 }, children: [_jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "Tools (comma-separated)" }), _jsx(TextInput, { value: tools.join(', '), onChange: e => onToolsChange(e.target.value
445
445
  .split(',')
446
446
  .map(tool => tool.trim())
447
- .filter(Boolean)), placeholder: "tool_a, tool_b", sx: { width: '100%' } })] }), _jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "Sandbox Variant" }), _jsxs(Select, { value: sandboxVariant, onChange: e => onSandboxVariantChange(e.target.value), sx: { width: '100%' }, children: [_jsx(Select.Option, { value: "", children: "Default" }), _jsx(Select.Option, { value: "local-eval", children: "local-eval" }), _jsx(Select.Option, { value: "jupyter", children: "jupyter" }), _jsx(Select.Option, { value: "local-jupyter", children: "local-jupyter" })] })] })] }), _jsxs(Box, { sx: {
447
+ .filter(Boolean)), placeholder: "tool_a, tool_b", sx: { width: '100%' } })] }), _jsxs(FormControl, { sx: { flex: 1 }, disabled: isFormReadOnly, children: [_jsx(FormControl.Label, { children: "Sandbox Variant" }), _jsxs(Select, { value: sandboxVariant, onChange: e => onSandboxVariantChange(e.target.value), sx: { width: '100%' }, children: [_jsx(Select.Option, { value: "", children: "Default" }), _jsx(Select.Option, { value: "eval", children: "eval" }), _jsx(Select.Option, { value: "jupyter", children: "jupyter" })] })] })] }), _jsxs(Box, { sx: {
448
448
  marginBottom: 3,
449
449
  padding: 3,
450
450
  border: '1px solid',
@@ -470,7 +470,7 @@ export const AgentConfiguration = ({ agentLibrary, protocol: transport, extensio
470
470
  color: 'fg.muted',
471
471
  fontWeight: 'normal',
472
472
  ml: 2,
473
- }, children: "\u2014 defined by spec" }))] }), _jsx(Box, { sx: { display: 'flex', gap: 4, opacity: isSpecMode ? 0.6 : 1 }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: enableCodemode, disabled: !isNewAgentMode || isSpecMode, onChange: e => onEnableCodemodeChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Codemode" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Execute code to compose tools" })] })] }) }), skillsEnabled && enableCodemode && (_jsx(Flash, { variant: "default", sx: { mt: 3 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Skills provide curated capabilities; Codemode composes tools with Python for multi-step execution." }) })), skillsEnabled && !enableCodemode && (_jsx(Flash, { variant: "default", sx: { mt: 3 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Skills will run with a standalone code sandbox for script execution. Enable Codemode to compose skills with other tools." }) })), enableCodemode && (_jsxs(Box, { sx: { mt: 3, display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: allowDirectToolCalls, disabled: !isNewAgentMode || isSpecMode, onChange: e => onAllowDirectToolCallsChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Allow direct tool calls" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Expose call_tool for simple, single-tool operations" })] })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: enableToolReranker, disabled: !isNewAgentMode || isSpecMode, onChange: e => onEnableToolRerankerChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Enable tool reranker" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Reorder search results using the configured reranker" })] })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: useJupyterSandbox, disabled: !isNewAgentMode || isSpecMode, onChange: e => onUseJupyterSandboxChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Use Jupyter Sandbox" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Execute code in a Jupyter Sandbox instead of local-eval Sandbox" })] })] })] }))] }), _jsxs(Box, { sx: {
473
+ }, children: "\u2014 defined by spec" }))] }), _jsx(Box, { sx: { display: 'flex', gap: 4, opacity: isSpecMode ? 0.6 : 1 }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: enableCodemode, disabled: !isNewAgentMode || isSpecMode, onChange: e => onEnableCodemodeChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Codemode" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Execute code to compose tools" })] })] }) }), skillsEnabled && enableCodemode && (_jsx(Flash, { variant: "default", sx: { mt: 3 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Skills provide curated capabilities; Codemode composes tools with Python for multi-step execution." }) })), skillsEnabled && !enableCodemode && (_jsx(Flash, { variant: "default", sx: { mt: 3 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Skills will run with a standalone code sandbox for script execution. Enable Codemode to compose skills with other tools." }) })), enableCodemode && (_jsxs(Box, { sx: { mt: 3, display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: allowDirectToolCalls, disabled: !isNewAgentMode || isSpecMode, onChange: e => onAllowDirectToolCallsChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Allow direct tool calls" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Expose call_tool for simple, single-tool operations" })] })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: enableToolReranker, disabled: !isNewAgentMode || isSpecMode, onChange: e => onEnableToolRerankerChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Enable tool reranker" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Reorder search results using the configured reranker" })] })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: useJupyterSandbox, disabled: !isNewAgentMode || isSpecMode, onChange: e => onUseJupyterSandboxChange?.(e.target.checked) }), _jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Use Jupyter Sandbox" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block' }, children: "Execute code in a Jupyter Sandbox instead of eval Sandbox" })] })] })] }))] }), _jsxs(Box, { sx: {
474
474
  marginBottom: 3,
475
475
  padding: 3,
476
476
  border: '1px solid',
@@ -103,9 +103,11 @@ export interface ContextDistributionProps {
103
103
  agentId: string;
104
104
  /** Height of the chart */
105
105
  height?: string;
106
+ /** Live snapshot data from WS — bypasses REST polling when provided */
107
+ liveData?: ContextSnapshotResponse | null;
106
108
  }
107
109
  /**
108
110
  * ContextDistribution component displays context distribution as a treemap.
109
111
  */
110
- export declare function ContextDistribution({ agentId, height, }: ContextDistributionProps): import("react/jsx-runtime").JSX.Element;
112
+ export declare function ContextDistribution({ agentId, height, liveData, }: ContextDistributionProps): import("react/jsx-runtime").JSX.Element;
111
113
  export default ContextDistribution;
@@ -6,18 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  */
7
7
  import { Box, Text, Spinner, Button } from '@primer/react';
8
8
  import { ListUnorderedIcon } from '@primer/octicons-react';
9
- import { useQuery } from '@tanstack/react-query';
10
9
  import ReactECharts from 'echarts-for-react';
11
10
  import { useState } from 'react';
12
- function getLocalApiBase() {
13
- if (typeof window === 'undefined') {
14
- return '';
15
- }
16
- const host = window.location.hostname;
17
- return host === 'localhost' || host === '127.0.0.1'
18
- ? 'http://127.0.0.1:8765'
19
- : '';
20
- }
21
11
  /**
22
12
  * Format token count for display
23
13
  */
@@ -33,23 +23,14 @@ function formatTokens(tokens) {
33
23
  /**
34
24
  * ContextDistribution component displays context distribution as a treemap.
35
25
  */
36
- export function ContextDistribution({ agentId, height = '250px', }) {
26
+ export function ContextDistribution({ agentId, height = '250px', liveData, }) {
37
27
  const [showDetails, setShowDetails] = useState(false);
38
- const { data: snapshotData, isLoading, error, } = useQuery({
39
- queryKey: ['context-snapshot', agentId],
40
- queryFn: async () => {
41
- const apiBase = getLocalApiBase();
42
- const response = await fetch(`${apiBase}/api/v1/configure/agents/${encodeURIComponent(agentId)}/context-snapshot`);
43
- if (!response.ok) {
44
- throw new Error('Failed to fetch context snapshot');
45
- }
46
- return response.json();
47
- },
48
- refetchInterval: 10000, // Refresh every 10 seconds
49
- refetchOnMount: 'always',
50
- staleTime: 0,
51
- });
52
- if (isLoading) {
28
+ const hasLiveData = liveData !== undefined;
29
+ // REST polling removed — data comes exclusively via WS `agent.snapshot`.
30
+ const snapshotData = liveData;
31
+ const showLoading = !hasLiveData;
32
+ const hasError = false;
33
+ if (showLoading) {
53
34
  return (_jsxs(Box, { sx: {
54
35
  p: 3,
55
36
  display: 'flex',
@@ -58,7 +39,7 @@ export function ContextDistribution({ agentId, height = '250px', }) {
58
39
  height,
59
40
  }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { ml: 2, fontSize: 1, color: 'fg.muted' }, children: "Loading context distribution..." })] }));
60
41
  }
61
- if (error || !snapshotData) {
42
+ if (hasError || !snapshotData) {
62
43
  return (_jsx(Box, { sx: {
63
44
  p: 3,
64
45
  bg: 'canvas.subtle',
@@ -73,9 +73,11 @@ export interface ContextInspectorProps {
73
73
  agentId: string;
74
74
  /** API base URL for fetching context data */
75
75
  apiBase?: string;
76
+ /** Live full-context data from WS — bypasses REST polling when provided */
77
+ liveData?: FullContextResponse | null;
76
78
  }
77
79
  /**
78
80
  * ContextInspector component displays full detailed context snapshot.
79
81
  */
80
- export declare function ContextInspector({ agentId, apiBase }: ContextInspectorProps): import("react/jsx-runtime").JSX.Element;
82
+ export declare function ContextInspector({ agentId, apiBase, liveData, }: ContextInspectorProps): import("react/jsx-runtime").JSX.Element;
81
83
  export default ContextInspector;