@datalayer/agent-runtimes 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +182 -1
  2. package/lib/AgentNode.d.ts +3 -0
  3. package/lib/AgentNode.js +676 -0
  4. package/lib/App.js +1 -1
  5. package/lib/agent-node/themeStore.d.ts +3 -0
  6. package/lib/agent-node/themeStore.js +156 -0
  7. package/lib/agent-node-main.d.ts +1 -0
  8. package/lib/agent-node-main.js +14 -0
  9. package/lib/agents/AgentDetails.d.ts +22 -1
  10. package/lib/agents/AgentDetails.js +34 -47
  11. package/lib/api/index.d.ts +0 -1
  12. package/lib/api/index.js +4 -2
  13. package/lib/chat/Chat.d.ts +5 -106
  14. package/lib/chat/Chat.js +20 -14
  15. package/lib/chat/ChatFloating.d.ts +7 -140
  16. package/lib/chat/ChatFloating.js +3 -3
  17. package/lib/chat/ChatPopupStandalone.d.ts +8 -47
  18. package/lib/chat/ChatPopupStandalone.js +3 -3
  19. package/lib/chat/ChatSidebar.d.ts +4 -69
  20. package/lib/chat/ChatSidebar.js +83 -51
  21. package/lib/chat/ChatStandalone.d.ts +4 -54
  22. package/lib/chat/ChatStandalone.js +3 -3
  23. package/lib/chat/base/ChatBase.js +1414 -174
  24. package/lib/chat/display/FloatingBrandButton.js +8 -1
  25. package/lib/chat/header/ChatHeader.d.ts +3 -1
  26. package/lib/chat/header/ChatHeader.js +15 -12
  27. package/lib/chat/header/ChatHeaderBase.d.ts +30 -5
  28. package/lib/chat/header/ChatHeaderBase.js +41 -16
  29. package/lib/chat/indicators/McpStatusIndicator.d.ts +7 -4
  30. package/lib/chat/indicators/McpStatusIndicator.js +7 -32
  31. package/lib/chat/indicators/SandboxStatusIndicator.d.ts +4 -1
  32. package/lib/chat/indicators/SandboxStatusIndicator.js +91 -56
  33. package/lib/chat/indicators/SkillsStatusIndicator.d.ts +7 -0
  34. package/lib/chat/indicators/SkillsStatusIndicator.js +88 -0
  35. package/lib/chat/indicators/index.d.ts +1 -0
  36. package/lib/chat/indicators/index.js +1 -0
  37. package/lib/chat/messages/ChatMessageList.d.ts +1 -1
  38. package/lib/chat/messages/ChatMessageList.js +154 -114
  39. package/lib/chat/messages/ChatMessages.js +6 -2
  40. package/lib/chat/prompt/InputFooter.d.ts +21 -6
  41. package/lib/chat/prompt/InputFooter.js +76 -20
  42. package/lib/chat/prompt/InputPrompt.d.ts +5 -1
  43. package/lib/chat/prompt/InputPrompt.js +4 -4
  44. package/lib/chat/prompt/InputPromptFooter.d.ts +3 -1
  45. package/lib/chat/prompt/InputPromptFooter.js +3 -3
  46. package/lib/chat/prompt/InputPromptLexical.d.ts +3 -1
  47. package/lib/chat/prompt/InputPromptLexical.js +12 -5
  48. package/lib/chat/prompt/InputPromptText.d.ts +3 -1
  49. package/lib/chat/prompt/InputPromptText.js +2 -2
  50. package/lib/chat/tools/ToolApprovalBanner.js +1 -1
  51. package/lib/chat/tools/ToolCallDisplay.d.ts +3 -1
  52. package/lib/chat/tools/ToolCallDisplay.js +2 -2
  53. package/lib/chat/usage/TokenUsageBar.js +20 -2
  54. package/lib/client/AgentRuntimesClientContext.d.ts +53 -0
  55. package/lib/client/AgentRuntimesClientContext.js +55 -0
  56. package/lib/client/AgentsMixin.d.ts +0 -18
  57. package/lib/client/AgentsMixin.js +20 -30
  58. package/lib/client/IAgentRuntimesClient.d.ts +215 -0
  59. package/lib/client/IAgentRuntimesClient.js +5 -0
  60. package/lib/client/SdkAgentRuntimesClient.d.ts +151 -0
  61. package/lib/client/SdkAgentRuntimesClient.js +134 -0
  62. package/lib/client/index.d.ts +4 -1
  63. package/lib/client/index.js +3 -1
  64. package/lib/components/NotificationEventCard.js +5 -1
  65. package/lib/config/AgentConfiguration.d.ts +22 -0
  66. package/lib/config/AgentConfiguration.js +319 -64
  67. package/lib/context/ContextDistribution.d.ts +3 -1
  68. package/lib/context/ContextDistribution.js +8 -27
  69. package/lib/context/ContextInspector.d.ts +3 -1
  70. package/lib/context/ContextInspector.js +19 -67
  71. package/lib/context/ContextPanel.d.ts +3 -1
  72. package/lib/context/ContextPanel.js +104 -64
  73. package/lib/context/ContextUsage.d.ts +3 -1
  74. package/lib/context/ContextUsage.js +3 -3
  75. package/lib/context/CostTracker.d.ts +9 -3
  76. package/lib/context/CostTracker.js +26 -47
  77. package/lib/context/CostUsageChart.d.ts +12 -0
  78. package/lib/context/CostUsageChart.js +378 -0
  79. package/lib/context/GraphFlowChart.d.ts +16 -0
  80. package/lib/context/GraphFlowChart.js +182 -0
  81. package/lib/context/TokenUsageChart.d.ts +8 -1
  82. package/lib/context/TokenUsageChart.js +349 -211
  83. package/lib/context/TurnGraphChart.d.ts +39 -0
  84. package/lib/context/TurnGraphChart.js +538 -0
  85. package/lib/context/otelWsPool.d.ts +20 -0
  86. package/lib/context/otelWsPool.js +69 -0
  87. package/lib/examples/A2UiComponentGalleryExample.d.ts +0 -17
  88. package/lib/examples/A2UiComponentGalleryExample.js +315 -522
  89. package/lib/examples/A2UiContactCardExample.d.ts +0 -18
  90. package/lib/examples/A2UiContactCardExample.js +154 -411
  91. package/lib/examples/A2UiRestaurantExample.d.ts +0 -30
  92. package/lib/examples/A2UiRestaurantExample.js +114 -212
  93. package/lib/examples/A2UiViewerExample.d.ts +0 -18
  94. package/lib/examples/A2UiViewerExample.js +283 -532
  95. package/lib/examples/AgUiBackendToolRenderingExample.js +1 -1
  96. package/lib/examples/AgUiHaikuGenUiExample.d.ts +1 -1
  97. package/lib/examples/AgUiHaikuGenUiExample.js +1 -1
  98. package/lib/examples/AgUiSharedStateExample.js +2 -1
  99. package/lib/examples/AgentCheckpointsExample.js +14 -28
  100. package/lib/examples/AgentCodemodeExample.d.ts +4 -6
  101. package/lib/examples/AgentCodemodeExample.js +603 -169
  102. package/lib/examples/AgentEvalsExample.js +339 -53
  103. package/lib/examples/AgentGuardrailsExample.js +383 -66
  104. package/lib/examples/AgentHooksExample.d.ts +3 -0
  105. package/lib/examples/AgentHooksExample.js +122 -0
  106. package/lib/examples/AgentInferenceProviderExample.d.ts +3 -0
  107. package/lib/examples/AgentInferenceProviderExample.js +329 -0
  108. package/lib/examples/AgentMCPExample.d.ts +3 -0
  109. package/lib/examples/AgentMCPExample.js +481 -0
  110. package/lib/examples/AgentMemoryExample.d.ts +1 -2
  111. package/lib/examples/AgentMemoryExample.js +78 -33
  112. package/lib/examples/AgentMonitoringExample.js +261 -200
  113. package/lib/examples/AgentNotificationsExample.d.ts +1 -2
  114. package/lib/examples/AgentNotificationsExample.js +114 -33
  115. package/lib/examples/AgentOtelExample.js +32 -42
  116. package/lib/examples/AgentOutputsExample.d.ts +11 -6
  117. package/lib/examples/AgentOutputsExample.js +433 -81
  118. package/lib/examples/AgentParametersExample.d.ts +3 -0
  119. package/lib/examples/AgentParametersExample.js +248 -0
  120. package/lib/examples/AgentSandboxExample.d.ts +3 -3
  121. package/lib/examples/AgentSandboxExample.js +74 -45
  122. package/lib/examples/AgentSkillsExample.js +95 -103
  123. package/lib/examples/AgentSubagentsExample.d.ts +14 -0
  124. package/lib/examples/AgentSubagentsExample.js +228 -0
  125. package/lib/examples/AgentToolApprovalsExample.js +49 -561
  126. package/lib/examples/AgentTriggersExample.js +823 -569
  127. package/lib/examples/{AgentspecExample.d.ts → AgentspecsExample.d.ts} +2 -2
  128. package/lib/examples/AgentspecsExample.js +1096 -0
  129. package/lib/examples/ChatCustomExample.js +16 -28
  130. package/lib/examples/ChatExample.js +13 -29
  131. package/lib/examples/CopilotKitLexicalExample.js +2 -1
  132. package/lib/examples/CopilotKitNotebookExample.js +2 -1
  133. package/lib/examples/HomeExample.d.ts +15 -0
  134. package/lib/examples/HomeExample.js +77 -0
  135. package/lib/examples/Lexical2Example.js +4 -2
  136. package/lib/examples/{LexicalExample.d.ts → LexicalAgentExample.d.ts} +4 -4
  137. package/lib/examples/{LexicalExample.js → LexicalAgentExample.js} +66 -17
  138. package/lib/examples/{LexicalSidebarExample.d.ts → LexicalAgentSidebarExample.d.ts} +5 -5
  139. package/lib/examples/LexicalAgentSidebarExample.js +261 -0
  140. package/lib/examples/NotebookAgentExample.d.ts +9 -0
  141. package/lib/examples/NotebookAgentExample.js +192 -0
  142. package/lib/examples/{NotebookSidebarExample.d.ts → NotebookAgentSidebarExample.d.ts} +2 -2
  143. package/lib/examples/NotebookAgentSidebarExample.js +221 -0
  144. package/lib/examples/{DatalayerNotebookExample.d.ts → NotebookCollaborationExample.d.ts} +4 -4
  145. package/lib/examples/{DatalayerNotebookExample.js → NotebookCollaborationExample.js} +3 -3
  146. package/lib/examples/NotebookExample.d.ts +4 -7
  147. package/lib/examples/NotebookExample.js +14 -146
  148. package/lib/examples/components/AuthRequiredView.d.ts +6 -0
  149. package/lib/examples/components/AuthRequiredView.js +33 -0
  150. package/lib/examples/components/ExampleWrapper.d.ts +9 -3
  151. package/lib/examples/components/ExampleWrapper.js +45 -9
  152. package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.js +1 -1
  153. package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.js +1 -1
  154. package/lib/examples/{ag-ui → components}/haiku/index.d.ts +1 -1
  155. package/lib/examples/{ag-ui → components}/haiku/index.js +1 -1
  156. package/lib/examples/components/index.d.ts +3 -0
  157. package/lib/examples/components/index.js +4 -0
  158. package/lib/examples/{ag-ui → components}/weather/index.d.ts +1 -1
  159. package/lib/examples/{ag-ui → components}/weather/index.js +1 -1
  160. package/lib/examples/example-selector.d.ts +17 -4
  161. package/lib/examples/example-selector.js +108 -41
  162. package/lib/examples/index.d.ts +10 -6
  163. package/lib/examples/index.js +10 -6
  164. package/lib/examples/lexical/initial-content.json +6 -6
  165. package/lib/examples/main.js +257 -27
  166. package/lib/examples/utils/a2ui.d.ts +18 -0
  167. package/lib/examples/utils/a2ui.js +69 -0
  168. package/lib/examples/utils/a2uiMarkdownProvider.d.ts +7 -0
  169. package/lib/examples/utils/a2uiMarkdownProvider.js +9 -0
  170. package/lib/examples/utils/agentId.d.ts +18 -0
  171. package/lib/examples/utils/agentId.js +54 -0
  172. package/lib/examples/utils/agents/earthquake-detector.json +11 -11
  173. package/lib/examples/utils/agents/sales-forecaster.json +11 -11
  174. package/lib/examples/utils/agents/social-post-generator.json +11 -11
  175. package/lib/examples/utils/agents/stock-market.json +11 -11
  176. package/lib/examples/utils/examplesStore.js +82 -27
  177. package/lib/examples/utils/useExampleAgentRuntimesUrl.d.ts +5 -0
  178. package/lib/examples/utils/useExampleAgentRuntimesUrl.js +19 -0
  179. package/lib/hooks/index.d.ts +8 -8
  180. package/lib/hooks/index.js +7 -7
  181. package/lib/hooks/useA2A.d.ts +2 -3
  182. package/lib/hooks/useAIAgentsWebSocket.d.ts +43 -4
  183. package/lib/hooks/useAIAgentsWebSocket.js +153 -12
  184. package/lib/hooks/useAcp.d.ts +1 -2
  185. package/lib/hooks/useAgUi.d.ts +1 -1
  186. package/lib/hooks/{useAgents.d.ts → useAgentRuntimes.d.ts} +70 -4
  187. package/lib/hooks/{useAgents.js → useAgentRuntimes.js} +237 -32
  188. package/lib/hooks/useAgentsCatalog.js +1 -1
  189. package/lib/hooks/useAgentsService.d.ts +2 -2
  190. package/lib/hooks/useAgentsService.js +7 -7
  191. package/lib/hooks/useCheckpoints.js +1 -1
  192. package/lib/hooks/useConfig.d.ts +4 -1
  193. package/lib/hooks/useConfig.js +10 -3
  194. package/lib/hooks/useContextSnapshot.d.ts +9 -4
  195. package/lib/hooks/useContextSnapshot.js +9 -37
  196. package/lib/hooks/useMonitoring.js +3 -0
  197. package/lib/hooks/useSandbox.d.ts +20 -8
  198. package/lib/hooks/useSandbox.js +105 -40
  199. package/lib/hooks/useSkills.d.ts +23 -5
  200. package/lib/hooks/useSkills.js +94 -39
  201. package/lib/hooks/useToolApprovals.d.ts +60 -36
  202. package/lib/hooks/useToolApprovals.js +318 -69
  203. package/lib/hooks/useVercelAI.d.ts +1 -1
  204. package/lib/index.d.ts +2 -1
  205. package/lib/index.js +1 -0
  206. package/lib/inference/index.d.ts +0 -1
  207. package/lib/middleware/index.d.ts +0 -1
  208. package/lib/protocols/AGUIAdapter.js +6 -0
  209. package/lib/protocols/VercelAIAdapter.d.ts +7 -0
  210. package/lib/protocols/VercelAIAdapter.js +59 -7
  211. package/lib/specs/agents/agents.d.ts +21 -4
  212. package/lib/specs/agents/agents.js +2879 -316
  213. package/lib/specs/agents/index.js +3 -1
  214. package/lib/specs/benchmarks.d.ts +20 -0
  215. package/lib/specs/benchmarks.js +205 -0
  216. package/lib/specs/envvars.js +27 -20
  217. package/lib/specs/evals.d.ts +10 -9
  218. package/lib/specs/evals.js +128 -88
  219. package/lib/specs/events.d.ts +3 -10
  220. package/lib/specs/events.js +127 -84
  221. package/lib/specs/frontendTools.js +2 -2
  222. package/lib/specs/guardrails.d.ts +0 -7
  223. package/lib/specs/guardrails.js +240 -159
  224. package/lib/specs/mcpServers.js +35 -6
  225. package/lib/specs/memory.d.ts +0 -2
  226. package/lib/specs/memory.js +4 -17
  227. package/lib/specs/models.d.ts +0 -2
  228. package/lib/specs/models.js +20 -15
  229. package/lib/specs/notifications.js +102 -18
  230. package/lib/specs/outputs.js +15 -9
  231. package/lib/specs/personas.d.ts +41 -0
  232. package/lib/specs/personas.js +168 -0
  233. package/lib/specs/skills.d.ts +1 -1
  234. package/lib/specs/skills.js +23 -23
  235. package/lib/specs/teams/index.js +3 -1
  236. package/lib/specs/teams/teams.js +468 -348
  237. package/lib/specs/tools.js +4 -4
  238. package/lib/specs/triggers.js +61 -11
  239. package/lib/stores/agentRuntimeStore.d.ts +208 -0
  240. package/lib/stores/agentRuntimeStore.js +650 -0
  241. package/lib/stores/conversationStore.js +2 -2
  242. package/lib/stores/index.d.ts +1 -1
  243. package/lib/stores/index.js +1 -1
  244. package/lib/tools/adapters/copilotkit/lexicalHooks.d.ts +1 -2
  245. package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -3
  246. package/lib/tools/adapters/copilotkit/notebookHooks.d.ts +1 -2
  247. package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -3
  248. package/lib/tools/index.d.ts +0 -2
  249. package/lib/tools/index.js +0 -1
  250. package/lib/types/agents-lifecycle.d.ts +18 -0
  251. package/lib/types/agents.d.ts +6 -0
  252. package/lib/types/agentspecs.d.ts +54 -1
  253. package/lib/types/benchmarks.d.ts +43 -0
  254. package/lib/types/benchmarks.js +5 -0
  255. package/lib/types/chat.d.ts +325 -8
  256. package/lib/types/context.d.ts +27 -0
  257. package/lib/types/cost.d.ts +2 -2
  258. package/lib/types/evals.d.ts +26 -17
  259. package/lib/types/index.d.ts +3 -0
  260. package/lib/types/index.js +3 -0
  261. package/lib/types/mcp.d.ts +8 -0
  262. package/lib/types/models.d.ts +2 -2
  263. package/lib/types/personas.d.ts +25 -0
  264. package/lib/types/personas.js +5 -0
  265. package/lib/types/skills.d.ts +43 -1
  266. package/lib/types/stream.d.ts +110 -0
  267. package/lib/types/stream.js +36 -0
  268. package/lib/utils/utils.d.ts +9 -5
  269. package/lib/utils/utils.js +9 -5
  270. package/package.json +19 -11
  271. package/scripts/codegen/__pycache__/generate_agents.cpython-313.pyc +0 -0
  272. package/scripts/codegen/__pycache__/generate_benchmarks.cpython-313.pyc +0 -0
  273. package/scripts/codegen/__pycache__/generate_evals.cpython-313.pyc +0 -0
  274. package/scripts/codegen/__pycache__/generate_events.cpython-313.pyc +0 -0
  275. package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
  276. package/scripts/codegen/generate_agents.py +187 -45
  277. package/scripts/codegen/generate_benchmarks.py +441 -0
  278. package/scripts/codegen/generate_evals.py +94 -16
  279. package/scripts/codegen/generate_events.py +35 -14
  280. package/scripts/codegen/generate_personas.py +319 -0
  281. package/scripts/codegen/generate_skills.py +9 -9
  282. package/scripts/sync-jupyter.sh +26 -7
  283. package/lib/api/tool-approvals.d.ts +0 -62
  284. package/lib/api/tool-approvals.js +0 -145
  285. package/lib/examples/AgentspecExample.js +0 -705
  286. package/lib/examples/LexicalSidebarExample.js +0 -163
  287. package/lib/examples/NotebookSidebarExample.js +0 -119
  288. package/lib/examples/NotebookSimpleExample.d.ts +0 -6
  289. package/lib/examples/NotebookSimpleExample.js +0 -22
  290. package/lib/examples/ag-ui/index.d.ts +0 -10
  291. package/lib/examples/ag-ui/index.js +0 -16
  292. package/lib/hooks/useAgentsRegistry.d.ts +0 -10
  293. package/lib/hooks/useAgentsRegistry.js +0 -20
  294. package/lib/stores/agentsStore.d.ts +0 -123
  295. package/lib/stores/agentsStore.js +0 -270
  296. /package/lib/examples/{ag-ui → components}/haiku/HaikuDisplay.d.ts +0 -0
  297. /package/lib/examples/{ag-ui → components}/haiku/InlineHaikuCard.d.ts +0 -0
  298. /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.d.ts +0 -0
  299. /package/lib/examples/{ag-ui → components}/weather/InlineWeatherCard.js +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Evaluation benchmark specification.
2
+ * Built-in evaluator specification.
3
3
  */
4
4
  export interface EvalSpec {
5
5
  /** Unique eval identifier */
@@ -8,20 +8,26 @@ export interface EvalSpec {
8
8
  version?: string;
9
9
  /** Display name */
10
10
  name: string;
11
- /** Description of the evaluation */
11
+ /** Description of the evaluator */
12
12
  description: string;
13
- /** Category: Coding, Knowledge, Reasoning, Agentic, or Safety */
14
- category: 'Coding' | 'Knowledge' | 'Reasoning' | 'Agentic' | 'Safety';
15
- /** Number of tasks in the benchmark */
16
- task_count: number;
17
- /** Primary metric (e.g., 'pass@1', 'accuracy', 'success_rate') */
18
- metric: string;
19
- /** Source URL or repository */
13
+ /** Evaluator family */
14
+ category: 'Comparison' | 'Type Validation' | 'Performance' | 'LLM-as-a-Judge' | 'Span-Based' | 'Report';
15
+ /** Case-level or report-level evaluator */
16
+ evaluator_type: 'case' | 'report';
17
+ /** Pydantic evaluator class name */
18
+ pydantic_class: string;
19
+ /** Primary output shape */
20
+ output_kind: 'boolean' | 'boolean_with_reason' | 'score' | 'score_and_assertion' | 'report_table' | 'report_curve';
21
+ /** Cost tier for running this evaluator */
22
+ cost_tier: 'free' | 'llm';
23
+ /** Expected latency profile */
24
+ latency: 'instant' | 'fast' | 'slow';
25
+ /** Runtime requirements (e.g. expected_output, logfire, model) */
26
+ requires?: string[];
27
+ /** Source documentation URL */
20
28
  source: string;
21
- /** Difficulty level */
22
- difficulty: 'easy' | 'medium' | 'hard' | 'expert';
23
- /** Relevant languages */
24
- languages: string[];
29
+ /** Suggested baseline configuration */
30
+ default_config?: Record<string, unknown>;
25
31
  }
26
32
  /**
27
33
  * Eval configuration for an agent spec.
@@ -31,11 +37,14 @@ export interface AgentEvalConfig {
31
37
  name?: string;
32
38
  description?: string;
33
39
  category?: string;
34
- task_count?: number;
35
- metric?: string;
40
+ evaluator_type?: string;
41
+ pydantic_class?: string;
42
+ output_kind?: string;
43
+ cost_tier?: string;
44
+ latency?: string;
45
+ requires?: string[];
36
46
  source?: string;
37
- difficulty?: string;
38
- languages?: string[];
47
+ default_config?: Record<string, unknown>;
39
48
  [key: string]: unknown;
40
49
  }
41
50
  export interface EvalReport {
@@ -4,6 +4,7 @@ export * from './ag-ui';
4
4
  export * from './agents';
5
5
  export * from './agents-lifecycle';
6
6
  export * from './agentspecs';
7
+ export * from './benchmarks';
7
8
  export * from './chat';
8
9
  export * from './checkpoints';
9
10
  export * from './config';
@@ -26,9 +27,11 @@ export * from './middleware';
26
27
  export * from './models';
27
28
  export * from './notifications';
28
29
  export * from './outputs';
30
+ export * from './personas';
29
31
  export * from './protocol';
30
32
  export * from './sandbox';
31
33
  export * from './skills';
34
+ export * from './stream';
32
35
  export * from './teams';
33
36
  export * from './tool-approvals';
34
37
  export * from './tools';
@@ -8,6 +8,7 @@ export * from './ag-ui';
8
8
  export * from './agents';
9
9
  export * from './agents-lifecycle';
10
10
  export * from './agentspecs';
11
+ export * from './benchmarks';
11
12
  export * from './chat';
12
13
  export * from './checkpoints';
13
14
  export * from './config';
@@ -30,9 +31,11 @@ export * from './middleware';
30
31
  export * from './models';
31
32
  export * from './notifications';
32
33
  export * from './outputs';
34
+ export * from './personas';
33
35
  export * from './protocol';
34
36
  export * from './sandbox';
35
37
  export * from './skills';
38
+ export * from './stream';
36
39
  export * from './teams';
37
40
  export * from './tool-approvals';
38
41
  export * from './tools';
@@ -73,6 +73,11 @@ export interface McpServerStatus {
73
73
  status: 'none' | 'not_started' | 'starting' | 'failed' | 'started';
74
74
  error?: string;
75
75
  tools_count?: number;
76
+ tools?: Array<{
77
+ name: string;
78
+ description?: string;
79
+ enabled?: boolean;
80
+ }>;
76
81
  }
77
82
  /**
78
83
  * Full response from `/api/v1/configure/mcp-toolsets-status`.
@@ -84,6 +89,9 @@ export interface McpToolsetsStatusResponse {
84
89
  ready_servers: string[];
85
90
  failed_servers: Record<string, string>;
86
91
  servers: McpServerStatus[];
92
+ enabled_tools_by_server?: Record<string, string[]>;
93
+ enabled_tools_count?: number;
94
+ approved_tools_by_server?: Record<string, string[]>;
87
95
  }
88
96
  /**
89
97
  * Primer-addon indicator colours for each aggregate MCP status.
@@ -3,7 +3,7 @@ import type { MCPServer } from './mcp';
3
3
  * Specification for an AI model from the catalog.
4
4
  */
5
5
  export interface AIModel {
6
- /** Unique model identifier (e.g., 'anthropic:claude-sonnet-4-5-20250514') */
6
+ /** Unique model identifier (e.g., 'anthropic:claude-3-5-haiku-20241022') */
7
7
  id: string;
8
8
  /** Model spec version */
9
9
  version: string;
@@ -22,7 +22,7 @@ export interface AIModel {
22
22
  * Configuration for an AI model runtime (as returned by the server).
23
23
  */
24
24
  export interface AIModelRuntime {
25
- /** Model identifier (e.g., 'anthropic:claude-sonnet-4-5') */
25
+ /** Model identifier (e.g., 'anthropic:claude-3-5-haiku-20241022') */
26
26
  id: string;
27
27
  /** Display name for the model */
28
28
  name: string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Specification for a Persona.
3
+ *
4
+ * A Persona is a lightweight identity built on top of an agent spec —
5
+ * it bundles a name, a description and a set of tags that describe the
6
+ * role and tone of the underlying agent.
7
+ */
8
+ export interface PersonaSpec {
9
+ /** Unique persona identifier (e.g., 'tutor', 'sentinel') */
10
+ id: string;
11
+ /** Persona spec version */
12
+ version: string;
13
+ /** Display name of the persona */
14
+ name: string;
15
+ /** Short persona description */
16
+ description: string;
17
+ /** Categorization tags */
18
+ tags: string[];
19
+ /** Icon identifier */
20
+ icon?: string;
21
+ /** Emoji representation */
22
+ emoji?: string;
23
+ /** Optional reference to the underlying agent spec id */
24
+ agent?: string;
25
+ }
@@ -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 {};
@@ -1,5 +1,13 @@
1
1
  /**
2
- * Skill information from backend
2
+ * Skill status as tracked by the server-side skills area.
3
+ *
4
+ * - `available`: in catalog, not yet enabled
5
+ * - `enabled`: enabled, SKILL.md loading pending
6
+ * - `loaded`: SKILL.md loaded, included in the LLM system prompt
7
+ */
8
+ export type SkillStatus = 'available' | 'enabled' | 'loaded';
9
+ /**
10
+ * Skill information from the WebSocket snapshot.
3
11
  */
4
12
  export interface SkillInfo {
5
13
  id: string;
@@ -9,6 +17,40 @@ export interface SkillInfo {
9
17
  tags?: string[];
10
18
  has_scripts?: boolean;
11
19
  has_resources?: boolean;
20
+ /** Lifecycle status from the server-side skills area */
21
+ status?: SkillStatus;
22
+ /** Whether the skill is approved (defaults to true when omitted) */
23
+ approved?: boolean;
24
+ /** Raw SKILL.md content (populated once status is 'loaded') */
25
+ skill_definition?: string | null;
26
+ /** Discovery/source variant for this skill */
27
+ source_variant?: 'module' | 'package' | 'path' | 'unknown';
28
+ module?: string;
29
+ package?: string;
30
+ method?: string;
31
+ path?: string;
32
+ }
33
+ /**
34
+ * Loaded skill normalized for UI/state consumption.
35
+ *
36
+ * This representation is resolved from an agent's active spec and optional
37
+ * catalog enrichment, then persisted per-agent in the runtime store.
38
+ */
39
+ export interface LoadedSkillInfo {
40
+ id: string;
41
+ name: string;
42
+ description: string;
43
+ variant: 'module' | 'package' | 'path' | 'unknown';
44
+ module?: string;
45
+ package?: string;
46
+ method?: string;
47
+ path?: string;
48
+ license?: string;
49
+ compatibility?: string;
50
+ allowedTools?: string[];
51
+ skillMetadata?: Record<string, string>;
52
+ tags?: string[];
53
+ emoji?: string;
12
54
  }
13
55
  /**
14
56
  * Skills response from backend
@@ -0,0 +1,110 @@
1
+ import type { ContextSnapshotData } from './context';
2
+ import type { McpToolsetsStatusResponse } from './mcp';
3
+ import type { SkillStatus } from './skills';
4
+ export type AgentStreamEventType = 'agent.snapshot' | 'tool_approval_created' | 'tool_approval_approved' | 'tool_approval_rejected';
5
+ export interface AgentStreamMessage<TPayload = Record<string, unknown>> {
6
+ version: string;
7
+ type: AgentStreamEventType | string;
8
+ agentId?: string;
9
+ timestamp: string;
10
+ payload: TPayload;
11
+ event?: string;
12
+ data?: unknown;
13
+ }
14
+ export interface AgentStreamToolApprovalPayload {
15
+ id: string;
16
+ agent_id?: string;
17
+ pod_name?: string;
18
+ tool_name: string;
19
+ tool_call_id?: string;
20
+ tool_args?: Record<string, unknown>;
21
+ status?: string;
22
+ note?: string | null;
23
+ created_at?: string;
24
+ updated_at?: string;
25
+ }
26
+ export interface AgentStreamSnapshotPayload {
27
+ agentId?: string;
28
+ approvals: AgentStreamToolApprovalPayload[];
29
+ pendingApprovalCount: number;
30
+ contextSnapshot?: ContextSnapshotData | null;
31
+ costUsage?: ContextSnapshotData['costUsage'];
32
+ mcpStatus?: McpToolsetsStatusResponse | null;
33
+ codemodeStatus?: CodemodeStatusData | null;
34
+ fullContext?: Record<string, unknown> | null;
35
+ graphTelemetry?: GraphTelemetryData | null;
36
+ }
37
+ /** Graph-level telemetry data from pydantic-graph execution. */
38
+ export interface GraphTelemetryData {
39
+ agentId?: string;
40
+ graphName?: string | null;
41
+ /** Static topology: graph node definitions. */
42
+ nodes: GraphTelemetryNode[];
43
+ /** Static topology: edges between nodes. */
44
+ edges: GraphTelemetryEdge[];
45
+ /** Dynamic execution trace: per-node events. */
46
+ events: GraphNodeEvent[];
47
+ totalNodesExecuted: number;
48
+ totalDurationMs: number;
49
+ lastRunStartMs: number;
50
+ lastRunEndMs: number;
51
+ runCount: number;
52
+ }
53
+ export interface GraphTelemetryNode {
54
+ id: string;
55
+ name: string;
56
+ category: string;
57
+ }
58
+ export interface GraphTelemetryEdge {
59
+ source: string;
60
+ target: string;
61
+ label?: string | null;
62
+ edgeType: string;
63
+ }
64
+ export interface GraphNodeEvent {
65
+ nodeId: string;
66
+ nodeType: string;
67
+ status: string;
68
+ timestampMs: number;
69
+ durationMs?: number | null;
70
+ parentNodeId?: string | null;
71
+ error?: string | null;
72
+ }
73
+ /** Codemode status as pushed via the monitoring WebSocket. */
74
+ export interface CodemodeStatusData {
75
+ enabled: boolean;
76
+ skills: Array<{
77
+ id?: string;
78
+ name: string;
79
+ description?: string;
80
+ tags?: string[];
81
+ has_scripts?: boolean;
82
+ has_resources?: boolean;
83
+ status?: SkillStatus;
84
+ approved?: boolean;
85
+ skill_definition?: string | null;
86
+ source_variant?: 'module' | 'package' | 'path' | 'unknown';
87
+ module?: string;
88
+ package?: string;
89
+ method?: string;
90
+ path?: string;
91
+ }>;
92
+ available_skills: Array<{
93
+ id?: string;
94
+ name: string;
95
+ description?: string;
96
+ tags?: string[];
97
+ has_scripts?: boolean;
98
+ has_resources?: boolean;
99
+ status?: SkillStatus;
100
+ approved?: boolean;
101
+ skill_definition?: string | null;
102
+ source_variant?: 'module' | 'package' | 'path' | 'unknown';
103
+ module?: string;
104
+ package?: string;
105
+ method?: string;
106
+ path?: string;
107
+ }>;
108
+ sandbox?: Record<string, unknown> | null;
109
+ }
110
+ export declare function parseAgentStreamMessage(raw: unknown): AgentStreamMessage | null;
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ const isObject = (value) => !!value && typeof value === 'object';
6
+ export function parseAgentStreamMessage(raw) {
7
+ if (!isObject(raw)) {
8
+ return null;
9
+ }
10
+ // New envelope format.
11
+ if (typeof raw.type === 'string' && isObject(raw.payload)) {
12
+ return {
13
+ version: typeof raw.version === 'string' ? raw.version : '1.0',
14
+ type: raw.type,
15
+ agentId: typeof raw.agentId === 'string' ? raw.agentId : undefined,
16
+ timestamp: typeof raw.timestamp === 'string'
17
+ ? raw.timestamp
18
+ : new Date().toISOString(),
19
+ payload: raw.payload,
20
+ event: typeof raw.event === 'string' ? raw.event : undefined,
21
+ data: raw.data,
22
+ };
23
+ }
24
+ // Legacy event/data format.
25
+ if (typeof raw.event === 'string' && isObject(raw.data)) {
26
+ return {
27
+ version: '1.0',
28
+ type: raw.event,
29
+ timestamp: new Date().toISOString(),
30
+ payload: raw.data,
31
+ event: raw.event,
32
+ data: raw.data,
33
+ };
34
+ }
35
+ return null;
36
+ }
@@ -47,11 +47,15 @@ export declare function convertHistoryToDisplayItems(messages: ChatMessage[]): D
47
47
  */
48
48
  export declare function formatTokenCount(tokens: number): string;
49
49
  /**
50
- * Derive the API base URL from a configEndpoint.
51
- * configEndpoint may look like:
52
- * "http://host:port/api/v1/config" (from agentRuntimeConfig)
53
- * "http://host:port/api/v1/configure" (from Chat component)
54
- * We strip the trailing path segment to get "http://host:port/api/v1".
50
+ * Derives the API base URL from a config endpoint URL.
51
+ *
52
+ * The config endpoint may be `{base}/api/v1/config` (from agentRuntimeConfig)
53
+ * or `{base}/api/v1/configure` (from the Chat component). This function
54
+ * strips the trailing path segment to yield `{base}/api/v1`.
55
+ *
56
+ * @param configEndpoint - Full config endpoint URL.
57
+ *
58
+ * @returns The API base URL without the trailing config segment.
55
59
  */
56
60
  export declare function getApiBaseFromConfig(configEndpoint: string): string;
57
61
  /**
@@ -166,11 +166,15 @@ export function formatTokenCount(tokens) {
166
166
  return tokens.toString();
167
167
  }
168
168
  /**
169
- * Derive the API base URL from a configEndpoint.
170
- * configEndpoint may look like:
171
- * "http://host:port/api/v1/config" (from agentRuntimeConfig)
172
- * "http://host:port/api/v1/configure" (from Chat component)
173
- * We strip the trailing path segment to get "http://host:port/api/v1".
169
+ * Derives the API base URL from a config endpoint URL.
170
+ *
171
+ * The config endpoint may be `{base}/api/v1/config` (from agentRuntimeConfig)
172
+ * or `{base}/api/v1/configure` (from the Chat component). This function
173
+ * strips the trailing path segment to yield `{base}/api/v1`.
174
+ *
175
+ * @param configEndpoint - Full config endpoint URL.
176
+ *
177
+ * @returns The API base URL without the trailing config segment.
174
178
  */
175
179
  export function getApiBaseFromConfig(configEndpoint) {
176
180
  return configEndpoint.replace(/\/(config|configure)\/?$/, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -60,18 +60,19 @@
60
60
  "build:lib": "npm run clean:lib && gulp resources-to-lib && tsc -b",
61
61
  "build:nextjs": "npm run build --workspace=nextjs-notebook-example",
62
62
  "build:types": "npm run clean:lib && tsc -b",
63
- "check": "npm run format:check && npm run lint:all && npm run type-check:all",
63
+ "check": "npm run format:check && npm run lint:all && npm run type-check:all && npm run typedoc",
64
64
  "check:fix": "npm run format:all && npm run lint:fix && npm run type-check:all",
65
65
  "clean": "rimraf lib dist build tsconfig.tsbuildinfo",
66
66
  "clean:cache": "rimraf node_modules/.vite",
67
67
  "clean:dist": "rimraf dist",
68
68
  "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
69
69
  "create:patches": "bash scripts/create-patches.sh",
70
- "examples": "run-p server:start jupyter:start examples:vite",
70
+ "examples": "run-p server:start server:start:codemode jupyter:start examples:vite",
71
+ "examples:proxy": "make examples:proxy",
71
72
  "examples:fresh": "npm run clean:cache && npm run examples",
72
- "examples:jupyter": "run-p jupyter:start server:start examples:vite",
73
+ "examples:jupyter": "run-p jupyter:start server:start server:start:codemode examples:vite",
73
74
  "examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
74
- "examples:vite": "VITE_APP_TARGET=examples VITE_DATALAYER_RUN_URL=http://localhost:8888 vite",
75
+ "examples:vite": "VITE_DATALAYER_RUN_URL=${VITE_DATALAYER_RUN_URL:-https://prod1.datalayer.run} VITE_DATALAYER_RUNTIMES_URL=${VITE_DATALAYER_RUNTIMES_URL:-https://r1.datalayer.run} VITE_DATALAYER_AGENT_RUNTIMES_URL=${VITE_DATALAYER_AGENT_RUNTIMES_URL:-https://r1.datalayer.run} VITE_APP_TARGET=examples vite",
75
76
  "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,json,md}\" \"examples/**/*.{js,jsx,ts,tsx,css,json,md,mjs}\"",
76
77
  "format:all": "npm run format && npm run format --workspaces --if-present",
77
78
  "format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,css,json,md}\" \"examples/**/*.{js,jsx,ts,tsx,css,json,md,mjs}\"",
@@ -89,13 +90,18 @@
89
90
  "preview": "vite preview",
90
91
  "rebuild:fresh": "npm run create:patches && npm install && npm run build && npm run clean:cache",
91
92
  "server": "python -m agent_runtimes serve",
92
- "server:start": "PYTHONIOENCODING=utf-8 AGENT_RUNTIMES_DEBUG=false AGENT_RUNTIMES_LOG_LEVEL=info python -m agent_runtimes serve --port 8765 --log-level info",
93
+ "server:start": "PYTHONIOENCODING=utf-8 AGENT_RUNTIMES_DEBUG=false AGENT_RUNTIMES_LOG_LEVEL=info DATALAYER_EVALS_MODE=interactive DATALAYER_EVALS_EMIT_LIVE_EVENTS=true python -m agent_runtimes serve --port 8765 --log-level info",
94
+ "server:start:agent-node": "PYTHONIOENCODING=utf-8 AGENT_RUNTIMES_DEBUG=false AGENT_RUNTIMES_LOG_LEVEL=info DATALAYER_EVALS_MODE=interactive DATALAYER_EVALS_EMIT_LIVE_EVENTS=true AGENT_RUNTIMES_INFERENCE_PROVIDER_OVERRIDE=${AGENT_RUNTIMES_INFERENCE_PROVIDER_OVERRIDE:-datalayer} python -m agent_runtimes serve --node --port 8765 --log-level info",
95
+ "server:start:codemode": "PYTHONIOENCODING=utf-8 AGENT_RUNTIMES_DEBUG=false AGENT_RUNTIMES_LOG_LEVEL=info DATALAYER_EVALS_MODE=interactive DATALAYER_EVALS_EMIT_LIVE_EVENTS=true python -m agent_runtimes serve --port 8766 --log-level info",
96
+ "examples:codemode": "run-p server:start server:start:codemode examples:vite",
93
97
  "start": "vite",
94
98
  "start:acp": "run-p server:start start:acp:vite",
95
99
  "start:acp:prod": "run-p server start:acp:vite",
96
100
  "start:acp:vite": "VITE_ACP_WS_URL=ws://localhost:8765/api/v1/acp/ws vite",
97
101
  "start:agent": "run-p server:start start:agent:vite",
98
102
  "start:agent:vite": "vite --open /html/agent.html",
103
+ "start:agent-node": "run-p server:start:agent-node start:agent-node:vite",
104
+ "start:agent-node:vite": "vite --open /html/agent-node.html",
99
105
  "start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
100
106
  "start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
101
107
  "start:agent-lexical": "run-p server:start jupyter:start start:agent-lexical:vite",
@@ -120,7 +126,7 @@
120
126
  },
121
127
  "dependencies": {
122
128
  "@a2a-js/sdk": "^0.3.6",
123
- "@a2ui/react": "^0.8.0",
129
+ "@a2ui/react": "^0.9.1",
124
130
  "@ag-ui/client": "^0.0.42",
125
131
  "@ag-ui/core": "^0.0.42",
126
132
  "@ag-ui/encoder": "^0.0.42",
@@ -128,12 +134,12 @@
128
134
  "@agentclientprotocol/sdk": "^0.8.0",
129
135
  "@ai-sdk/react": "^4.0.0-beta.33",
130
136
  "@anthropic-ai/sdk": "^0.52.0",
131
- "@datalayer/core": "^1.0.13",
132
- "@datalayer/icons-react": "^1.0.6",
137
+ "@datalayer/core": "^1.0.22",
138
+ "@datalayer/icons-react": "^1.0.7",
133
139
  "@datalayer/jupyter-lexical": "^1.0.16",
134
140
  "@datalayer/jupyter-react": "^2.0.7",
135
- "@datalayer/primer-addons": "^1.0.10",
136
- "@datalayer/primer-rjsf": "^1.0.1",
141
+ "@datalayer/primer-addons": "^1.0.15",
142
+ "@datalayer/primer-rjsf": "^1.0.3",
137
143
  "@excalidraw/excalidraw": "^0.18.0",
138
144
  "@jupyter-widgets/base-manager": "^1.0.12",
139
145
  "@jupyter-widgets/schema": "^0.5.6",
@@ -301,6 +307,7 @@
301
307
  "vitest": "^3.2.4"
302
308
  },
303
309
  "resolutions": {
310
+ "@langchain/core": "^0.3.80",
304
311
  "@ai-sdk/react": "^4.0.0-beta.33",
305
312
  "@microsoft/fast-colors": "5.3.1",
306
313
  "@microsoft/fast-components": "2.30.6",
@@ -318,6 +325,7 @@
318
325
  "typescript": "^5.8.3"
319
326
  },
320
327
  "overrides": {
328
+ "@langchain/core": "^0.3.80",
321
329
  "@ai-sdk/react": "^4.0.0-beta.33",
322
330
  "@microsoft/fast-colors": "5.3.1",
323
331
  "@microsoft/fast-components": "2.30.6",