@datalayer/agent-runtimes 0.0.10 → 0.0.12

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 (138) hide show
  1. package/README.md +2 -2
  2. package/lib/Agent.d.ts +29 -0
  3. package/lib/Agent.js +131 -0
  4. package/lib/AgentLexical.d.ts +34 -0
  5. package/lib/AgentLexical.js +296 -0
  6. package/lib/AgentNotebook.d.ts +19 -0
  7. package/lib/AgentNotebook.js +192 -0
  8. package/lib/agent-lexical-main.d.ts +1 -0
  9. package/lib/agent-lexical-main.js +11 -0
  10. package/lib/agent-main.d.ts +1 -0
  11. package/lib/agent-main.js +11 -0
  12. package/lib/agent-notebook-main.d.ts +1 -0
  13. package/lib/agent-notebook-main.js +12 -0
  14. package/lib/components/AgentConfiguration.d.ts +33 -21
  15. package/lib/components/AgentConfiguration.js +76 -21
  16. package/lib/components/chat/components/AgentDetails.d.ts +3 -1
  17. package/lib/components/chat/components/AgentDetails.js +164 -6
  18. package/lib/components/chat/components/Chat.d.ts +29 -3
  19. package/lib/components/chat/components/Chat.js +64 -59
  20. package/lib/components/chat/components/ChatFloating.d.ts +34 -12
  21. package/lib/components/chat/components/ChatFloating.js +54 -21
  22. package/lib/components/chat/components/ChatInline.d.ts +5 -1
  23. package/lib/components/chat/components/ChatInline.js +8 -1
  24. package/lib/components/chat/components/ChatSidebar.d.ts +6 -1
  25. package/lib/components/chat/components/ChatSidebar.js +2 -2
  26. package/lib/components/chat/components/ChatStandalone.d.ts +6 -1
  27. package/lib/components/chat/components/ChatStandalone.js +2 -2
  28. package/lib/components/chat/components/ContextDistribution.js +2 -2
  29. package/lib/components/chat/components/ContextInspector.js +4 -2
  30. package/lib/components/chat/components/ContextPanel.js +1 -6
  31. package/lib/components/chat/components/base/ChatBase.d.ts +49 -8
  32. package/lib/components/chat/components/base/ChatBase.js +544 -149
  33. package/lib/components/chat/components/base/InputPrompt.d.ts +42 -0
  34. package/lib/components/chat/components/base/InputPrompt.js +131 -0
  35. package/lib/components/chat/components/index.d.ts +3 -3
  36. package/lib/components/chat/components/index.js +1 -1
  37. package/lib/components/chat/components/parts/ReasoningPart.js +2 -4
  38. package/lib/components/chat/components/parts/TextPart.js +2 -70
  39. package/lib/components/chat/components/styles/streamdownStyles.d.ts +23 -0
  40. package/lib/components/chat/components/styles/streamdownStyles.js +319 -0
  41. package/lib/components/chat/index.d.ts +1 -1
  42. package/lib/components/chat/index.js +1 -1
  43. package/lib/components/chat/inference/DatalayerInferenceProvider.js +16 -12
  44. package/lib/components/chat/inference/SelfHostedInferenceProvider.js +16 -12
  45. package/lib/components/chat/protocols/AGUIAdapter.d.ts +10 -3
  46. package/lib/components/chat/protocols/AGUIAdapter.js +123 -44
  47. package/lib/components/chat/types/tool.d.ts +5 -2
  48. package/lib/components/index.d.ts +2 -19
  49. package/lib/components/index.js +1 -10
  50. package/lib/config/index.d.ts +0 -3
  51. package/lib/config/index.js +0 -3
  52. package/lib/examples/A2UiRestaurantExample.js +1 -1
  53. package/lib/examples/AgentRuntimeChatExample.d.ts +15 -0
  54. package/lib/examples/AgentRuntimeChatExample.js +126 -0
  55. package/lib/examples/{AgentSpaceFormExample.d.ts → AgentRuntimeFormExample.d.ts} +3 -3
  56. package/lib/examples/{AgentSpaceFormExample.js → AgentRuntimeFormExample.js} +61 -17
  57. package/lib/examples/AgentRuntimeLexicalExample.js +6 -3
  58. package/lib/examples/AgentRuntimeLexicalSidebarExample.js +8 -1
  59. package/lib/examples/AgentRuntimeNotebookExample.js +6 -5
  60. package/lib/examples/CopilotKitNotebookExample.js +2 -2
  61. package/lib/examples/JupyterNotebookExample.js +2 -2
  62. package/lib/{components → examples/components}/Header.d.ts +2 -1
  63. package/lib/{components → examples/components}/HeaderControls.js +1 -1
  64. package/lib/{components → examples/components}/LexicalEditor.d.ts +6 -1
  65. package/lib/{components → examples/components}/LexicalEditor.js +4 -4
  66. package/lib/{components → examples/components}/MainContent.d.ts +1 -1
  67. package/lib/{components → examples/components}/MainContent.js +7 -5
  68. package/lib/examples/components/index.d.ts +16 -0
  69. package/lib/examples/components/index.js +13 -0
  70. package/lib/examples/example-selector.js +2 -1
  71. package/lib/examples/index.d.ts +1 -1
  72. package/lib/examples/index.js +1 -1
  73. package/lib/examples/main.js +2 -2
  74. package/lib/examples/stores/examplesStore.d.ts +2 -23
  75. package/lib/index.d.ts +2 -1
  76. package/lib/index.js +1 -0
  77. package/lib/lexical/ChatInlinePlugin.d.ts +13 -2
  78. package/lib/lexical/ChatInlinePlugin.js +41 -179
  79. package/lib/lexical/index.d.ts +1 -0
  80. package/lib/lexical/index.js +1 -0
  81. package/lib/lexical/useChatInlineToolbarItems.d.ts +28 -0
  82. package/lib/lexical/useChatInlineToolbarItems.js +163 -0
  83. package/lib/runtime/useAgentRuntime.d.ts +1 -1
  84. package/lib/runtime/useAgentRuntime.js +1 -1
  85. package/lib/specs/agents/codeai/agents.d.ts +28 -0
  86. package/lib/specs/agents/codeai/agents.js +151 -0
  87. package/lib/specs/agents/codeai/index.d.ts +1 -0
  88. package/lib/specs/agents/codeai/index.js +5 -0
  89. package/lib/{config → specs/agents/codemode-paper}/agents.d.ts +4 -6
  90. package/lib/specs/agents/codemode-paper/agents.js +308 -0
  91. package/lib/specs/agents/codemode-paper/index.d.ts +1 -0
  92. package/lib/specs/agents/codemode-paper/index.js +5 -0
  93. package/lib/specs/agents/datalayer-ai/agents.d.ts +31 -0
  94. package/lib/{config → specs/agents/datalayer-ai}/agents.js +42 -184
  95. package/lib/specs/agents/datalayer-ai/index.d.ts +1 -0
  96. package/lib/specs/agents/datalayer-ai/index.js +5 -0
  97. package/lib/specs/agents/index.d.ts +21 -0
  98. package/lib/specs/agents/index.js +47 -0
  99. package/lib/specs/envvars.d.ts +29 -0
  100. package/lib/specs/envvars.js +125 -0
  101. package/lib/specs/index.d.ts +5 -0
  102. package/lib/specs/index.js +9 -0
  103. package/lib/{config → specs}/mcpServers.d.ts +2 -1
  104. package/lib/{config → specs}/mcpServers.js +47 -1
  105. package/lib/specs/models.d.ts +68 -0
  106. package/lib/specs/models.js +239 -0
  107. package/lib/{config → specs}/skills.d.ts +2 -0
  108. package/lib/{config → specs}/skills.js +6 -0
  109. package/lib/state/substates/AIAgentState.d.ts +0 -1
  110. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.d.ts +11 -22
  111. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +5 -5
  112. package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -6
  113. package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +4 -4
  114. package/lib/tools/adapters/agent-runtimes/notebookHooks.d.ts +6 -6
  115. package/lib/tools/adapters/agent-runtimes/notebookHooks.js +4 -4
  116. package/lib/{types.d.ts → types/Types.d.ts} +42 -8
  117. package/lib/types/index.d.ts +1 -0
  118. package/lib/types/index.js +1 -0
  119. package/package.json +11 -5
  120. package/scripts/codegen/generate_agents.py +608 -157
  121. package/scripts/codegen/generate_envvars.py +302 -0
  122. package/scripts/codegen/generate_mcp_servers.py +33 -21
  123. package/scripts/codegen/generate_models.py +486 -0
  124. package/scripts/codegen/generate_skills.py +21 -8
  125. package/style/primer-primitives.css +22 -0
  126. package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +0 -37
  127. package/lib/components/chat/components/elements/ChatInputPrompt.js +0 -150
  128. /package/lib/{components → examples/components}/FooterMetrics.d.ts +0 -0
  129. /package/lib/{components → examples/components}/FooterMetrics.js +0 -0
  130. /package/lib/{components → examples/components}/Header.js +0 -0
  131. /package/lib/{components → examples/components}/HeaderControls.d.ts +0 -0
  132. /package/lib/{components → examples/components}/MockFileBrowser.d.ts +0 -0
  133. /package/lib/{components → examples/components}/MockFileBrowser.js +0 -0
  134. /package/lib/{components → examples/components}/SessionTabs.d.ts +0 -0
  135. /package/lib/{components → examples/components}/SessionTabs.js +0 -0
  136. /package/lib/{components → examples/components}/TimeTravel.d.ts +0 -0
  137. /package/lib/{components → examples/components}/TimeTravel.js +0 -0
  138. /package/lib/{types.js → types/Types.js} +0 -0
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { useMemo } from 'react';
12
12
  import { notebookStore, DefaultExecutor, notebookToolDefinitions, notebookToolOperations, } from '@datalayer/jupyter-react';
13
- import { createAllAgentRuntimesTools, } from './AgentRuntimesToolAdapter';
13
+ import { createAllAgentRuntimesTools } from './AgentRuntimesToolAdapter';
14
14
  // Hook wrapper to get notebook store state
15
15
  const useNotebookStore = () => notebookStore.getState();
16
16
  /**
@@ -19,17 +19,17 @@ const useNotebookStore = () => notebookStore.getState();
19
19
  *
20
20
  * @param documentId - Document ID (notebook identifier)
21
21
  * @param contextOverrides - Optional context overrides (format, extras, etc.)
22
- * @returns Agent-runtimes tools array for ChatFloating
22
+ * @returns Frontend tools array for ChatFloating / Chat
23
23
  *
24
24
  * @example
25
25
  * ```typescript
26
26
  * // Default context (toon format for AI)
27
- * const tools = useNotebookTools("my-notebook-id");
27
+ * const frontendTools = useNotebookTools("my-notebook-id");
28
28
  *
29
29
  * // Use with ChatFloating
30
30
  * <ChatFloating
31
31
  * endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
32
- * tools={tools}
32
+ * frontendTools={frontendTools}
33
33
  * />
34
34
  * ```
35
35
  */
@@ -1,3 +1,29 @@
1
+ /**
2
+ * Status of an agent.
3
+ */
4
+ export type AgentStatus = 'starting' | 'running' | 'paused' | 'terminated' | 'archived';
5
+ export type Transport = 'acp' | 'ag-ui' | 'vercel-ai' | 'a2a';
6
+ export interface Agent {
7
+ id: string;
8
+ name: string;
9
+ description: string;
10
+ author: string;
11
+ lastEdited: string;
12
+ screenshot: string;
13
+ status?: AgentStatus;
14
+ transport: Transport;
15
+ avatarUrl: string;
16
+ notebookFile: string;
17
+ lexicalFile: string;
18
+ stars: number;
19
+ notifications: number;
20
+ }
21
+ export type AgentsState = {
22
+ agents: readonly Agent[];
23
+ getAgentById: (id: string) => Agent | undefined;
24
+ updateAgentStatus: (id: string, status: AgentStatus) => void;
25
+ toggleAgentStatus: (id: string) => void;
26
+ };
1
27
  export interface ConversationEntry {
2
28
  id: string;
3
29
  firstMessage?: string;
@@ -24,6 +50,8 @@ export interface MCPServer {
24
50
  id: string;
25
51
  /** Display name for the server */
26
52
  name: string;
53
+ /** Server description */
54
+ description?: string;
27
55
  /** Server URL (for HTTP-based servers) */
28
56
  url: string;
29
57
  /** Whether the server is enabled */
@@ -40,6 +68,10 @@ export interface MCPServer {
40
68
  transport: 'stdio' | 'http';
41
69
  /** Environment variables required by this server (e.g., API keys) */
42
70
  requiredEnvVars?: string[];
71
+ /** Icon identifier for the server */
72
+ icon?: string;
73
+ /** Emoji identifier for the server */
74
+ emoji?: string;
43
75
  }
44
76
  /**
45
77
  * Specification for an agent skill.
@@ -63,10 +95,6 @@ export interface AgentSkillSpec {
63
95
  /** Environment variables required by this skill (e.g., API keys) */
64
96
  requiredEnvVars?: string[];
65
97
  }
66
- /**
67
- * Status of an agent space.
68
- */
69
- export type AgentStatus = 'starting' | 'running' | 'paused' | 'terminated' | 'archived';
70
98
  /**
71
99
  * Specification for an AI agent.
72
100
  *
@@ -82,12 +110,14 @@ export interface AgentSpec {
82
110
  description: string;
83
111
  /** System prompt for the agent */
84
112
  systemPrompt?: string;
85
- /** System prompt when codemode is enabled */
86
- systemPromptCodemode?: string;
113
+ /** System prompt addons when codemode is enabled */
114
+ systemPromptCodemodeAddons?: string;
87
115
  /** Tags for categorization */
88
116
  tags: string[];
89
117
  /** Whether the agent is enabled */
90
118
  enabled: boolean;
119
+ /** AI model identifier to use for this agent */
120
+ model?: string;
91
121
  /** MCP servers used by this agent */
92
122
  mcpServers: MCPServer[];
93
123
  /** Skills available to this agent */
@@ -96,6 +126,8 @@ export interface AgentSpec {
96
126
  environmentName: string;
97
127
  /** Icon identifier or URL for the agent */
98
128
  icon?: string;
129
+ /** Emoji identifier for the agent */
130
+ emoji?: string;
99
131
  /** Theme color for the agent (hex code) */
100
132
  color?: string;
101
133
  /** Chat suggestions to show users what this agent can do */
@@ -106,11 +138,13 @@ export interface AgentSpec {
106
138
  welcomeNotebook?: string;
107
139
  /** Path to Lexical document to show on agent creation */
108
140
  welcomeDocument?: string;
141
+ /** Sandbox variant to use for this agent ('local-eval', 'jupyter', 'local-jupyter') */
142
+ sandboxVariant?: string;
109
143
  }
110
144
  /**
111
145
  * Configuration for an AI model.
112
146
  */
113
- export interface AIModel {
147
+ export interface AIModelRuntime {
114
148
  /** Model identifier (e.g., 'anthropic:claude-sonnet-4-5') */
115
149
  id: string;
116
150
  /** Display name for the model */
@@ -136,7 +170,7 @@ export interface BuiltinTool {
136
170
  */
137
171
  export interface FrontendConfig {
138
172
  /** Available AI models */
139
- models: AIModel[];
173
+ models: AIModelRuntime[];
140
174
  /** Available builtin tools */
141
175
  builtinTools: BuiltinTool[];
142
176
  /** Configured MCP servers */
@@ -1 +1,2 @@
1
1
  export * from './AIAgent';
2
+ export * from './Types';
@@ -3,3 +3,4 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  export * from './AIAgent';
6
+ export * from './Types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -67,7 +67,7 @@
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 examples:vite",
70
+ "examples": "run-p server:start jupyter:start examples:vite",
71
71
  "examples:fresh": "npm run clean:cache && npm run examples",
72
72
  "examples:jupyter": "run-p jupyter:start server:start examples:vite",
73
73
  "examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
@@ -94,6 +94,12 @@
94
94
  "start:acp": "run-p server:start start:acp:vite",
95
95
  "start:acp:prod": "run-p server start:acp:vite",
96
96
  "start:acp:vite": "VITE_ACP_WS_URL=ws://localhost:8765/api/v1/acp/ws vite",
97
+ "start:agent": "run-p server:start start:agent:vite",
98
+ "start:agent:vite": "vite --open /html/agent.html",
99
+ "start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
100
+ "start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
101
+ "start:agent-lexical": "run-p server:start jupyter:start start:agent-lexical:vite",
102
+ "start:agent-lexical:vite": "vite --open /html/agent-lexical.html",
97
103
  "storybook": "storybook dev -p 6006",
98
104
  "sync:jupyter": "bash scripts/sync-jupyter.sh",
99
105
  "sync:jupyter:watch": "bash scripts/sync-jupyter.sh --watch",
@@ -122,11 +128,11 @@
122
128
  "@agentclientprotocol/sdk": "^0.8.0",
123
129
  "@ai-sdk/react": "3.0.30",
124
130
  "@anthropic-ai/sdk": "^0.52.0",
125
- "@datalayer/core": "^0.0.25",
131
+ "@datalayer/core": "^1.0.1",
126
132
  "@datalayer/icons-react": "^1.0.6",
127
- "@datalayer/jupyter-lexical": "^1.0.9",
133
+ "@datalayer/jupyter-lexical": "^1.0.11",
128
134
  "@datalayer/jupyter-react": "^2.0.3",
129
- "@datalayer/primer-addons": "^1.0.4",
135
+ "@datalayer/primer-addons": "^1.0.7",
130
136
  "@datalayer/primer-rjsf": "^1.0.1",
131
137
  "@jupyter-widgets/base-manager": "^1.0.12",
132
138
  "@jupyter-widgets/schema": "^0.5.6",