@datalayer/agent-runtimes 0.0.5 → 0.0.8

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 (119) hide show
  1. package/README.md +150 -22
  2. package/lib/components/chat/components/AgentDetails.d.ts +15 -2
  3. package/lib/components/chat/components/AgentDetails.js +9 -93
  4. package/lib/components/chat/components/AgentIdentity.d.ts +92 -0
  5. package/lib/components/chat/components/AgentIdentity.js +318 -0
  6. package/lib/components/chat/components/Chat.d.ts +24 -1
  7. package/lib/components/chat/components/Chat.js +41 -19
  8. package/lib/components/chat/components/ChatFloating.d.ts +6 -1
  9. package/lib/components/chat/components/ChatFloating.js +12 -6
  10. package/lib/components/chat/components/ContextDistribution.d.ts +47 -0
  11. package/lib/components/chat/components/ContextDistribution.js +146 -0
  12. package/lib/components/chat/components/ContextUsage.d.ts +33 -0
  13. package/lib/components/chat/components/ContextUsage.js +127 -0
  14. package/lib/components/chat/components/base/ChatBase.d.ts +51 -1
  15. package/lib/components/chat/components/base/ChatBase.js +278 -74
  16. package/lib/components/chat/components/display/ToolCallDisplay.d.ts +16 -2
  17. package/lib/components/chat/components/display/ToolCallDisplay.js +148 -6
  18. package/lib/components/chat/components/display/index.d.ts +1 -1
  19. package/lib/components/chat/components/display/index.js +1 -1
  20. package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +12 -1
  21. package/lib/components/chat/components/elements/ChatInputPrompt.js +8 -3
  22. package/lib/components/chat/components/index.d.ts +3 -0
  23. package/lib/components/chat/components/index.js +3 -0
  24. package/lib/components/chat/components/parts/ToolPart.d.ts +1 -1
  25. package/lib/components/chat/components/parts/ToolPart.js +142 -6
  26. package/lib/components/chat/index.d.ts +1 -1
  27. package/lib/components/chat/index.js +1 -1
  28. package/lib/components/chat/protocols/A2AAdapter.d.ts +9 -0
  29. package/lib/components/chat/protocols/A2AAdapter.js +13 -2
  30. package/lib/components/chat/protocols/ACPAdapter.d.ts +9 -0
  31. package/lib/components/chat/protocols/ACPAdapter.js +13 -2
  32. package/lib/components/chat/protocols/AGUIAdapter.d.ts +9 -0
  33. package/lib/components/chat/protocols/AGUIAdapter.js +19 -1
  34. package/lib/components/chat/protocols/VercelAIAdapter.d.ts +7 -0
  35. package/lib/components/chat/protocols/VercelAIAdapter.js +19 -0
  36. package/lib/components/chat/types/execution.d.ts +78 -0
  37. package/lib/components/chat/types/execution.js +64 -0
  38. package/lib/components/chat/types/index.d.ts +1 -0
  39. package/lib/components/chat/types/index.js +1 -0
  40. package/lib/components/chat/types/protocol.d.ts +9 -0
  41. package/lib/components/ui/pagination.d.ts +2 -2
  42. package/lib/components/ui/pagination.js +4 -4
  43. package/lib/components/ui/resizable.d.ts +4 -4
  44. package/lib/components/ui/resizable.js +4 -4
  45. package/lib/examples/A2UiRestaurantExample.js +2 -2
  46. package/lib/examples/AgUiAgenticExample.js +2 -2
  47. package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
  48. package/lib/examples/AgUiHaikuGenUIExample.js +2 -2
  49. package/lib/examples/AgUiHumanInTheLoopExample.js +2 -2
  50. package/lib/examples/AgUiSharedStateExample.js +2 -2
  51. package/lib/examples/AgUiToolsBasedGenUIExample.js +2 -2
  52. package/lib/examples/AgentRuntimeCustomExample.js +2 -2
  53. package/lib/examples/AgentRuntimeLexical2Example.js +2 -1
  54. package/lib/examples/AgentRuntimeLexicalExample.js +5 -2
  55. package/lib/examples/AgentRuntimeLexicalSidebarExample.js +4 -2
  56. package/lib/examples/AgentRuntimeNotebookExample.js +1 -1
  57. package/lib/examples/AgentRuntimeStandaloneExample.js +2 -2
  58. package/lib/examples/AgentSpaceFormExample.d.ts +70 -2
  59. package/lib/examples/AgentSpaceFormExample.js +204 -35
  60. package/lib/examples/CopilotKitLexicalExample.js +2 -1
  61. package/lib/examples/components/AgentConfiguration.d.ts +37 -0
  62. package/lib/examples/components/AgentConfiguration.js +239 -8
  63. package/lib/examples/components/Header.d.ts +0 -2
  64. package/lib/examples/components/Header.js +2 -16
  65. package/lib/examples/components/LexicalEditor.js +2 -1
  66. package/lib/examples/components/MockFileBrowser.js +6 -2
  67. package/lib/examples/components/index.d.ts +0 -1
  68. package/lib/examples/components/index.js +0 -1
  69. package/lib/examples/example-selector.js +0 -1
  70. package/lib/examples/index.d.ts +0 -1
  71. package/lib/examples/index.js +0 -1
  72. package/lib/examples/lexical/editorConfig.d.ts +3 -2
  73. package/lib/examples/lexical/editorConfig.js +7 -1
  74. package/lib/examples/lexical/initial-content.json +2210 -0
  75. package/lib/examples/main.js +15 -1
  76. package/lib/identity/IdentityConnect.d.ts +90 -0
  77. package/lib/identity/IdentityConnect.js +316 -0
  78. package/lib/identity/OAuthCallback.d.ts +58 -0
  79. package/lib/identity/OAuthCallback.js +223 -0
  80. package/lib/identity/dcr.d.ts +257 -0
  81. package/lib/identity/dcr.js +282 -0
  82. package/lib/identity/identityStore.d.ts +72 -0
  83. package/lib/identity/identityStore.js +529 -0
  84. package/lib/identity/index.d.ts +46 -0
  85. package/lib/identity/index.js +17 -0
  86. package/lib/identity/pkce.d.ts +30 -0
  87. package/lib/identity/pkce.js +65 -0
  88. package/lib/identity/types.d.ts +293 -0
  89. package/lib/identity/types.js +73 -0
  90. package/lib/identity/useIdentity.d.ts +108 -0
  91. package/lib/identity/useIdentity.js +323 -0
  92. package/lib/index.d.ts +2 -0
  93. package/lib/index.js +2 -0
  94. package/lib/lib/utils.js +1 -1
  95. package/lib/renderers/a2ui/lib/utils.js +1 -1
  96. package/lib/runtime/index.d.ts +35 -0
  97. package/lib/runtime/index.js +40 -0
  98. package/lib/runtime/runtimeStore.d.ts +77 -0
  99. package/lib/runtime/runtimeStore.js +184 -0
  100. package/lib/runtime/types.d.ts +84 -0
  101. package/lib/runtime/types.js +15 -0
  102. package/lib/runtime/useAgentConnection.d.ts +46 -0
  103. package/lib/runtime/useAgentConnection.js +112 -0
  104. package/lib/runtime/useAgentRuntime.d.ts +94 -0
  105. package/lib/runtime/useAgentRuntime.js +125 -0
  106. package/lib/test-setup.d.ts +1 -1
  107. package/lib/test-setup.js +1 -0
  108. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +32 -1
  109. package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -0
  110. package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +16 -17
  111. package/package.json +20 -7
  112. package/patches/@datalayer+jupyter-lexical+1.0.8.patch +11628 -0
  113. package/patches/@datalayer+jupyter-react+2.0.2.patch +5338 -0
  114. package/lib/examples/AgentSpaceHomeExample.d.ts +0 -8
  115. package/lib/examples/AgentSpaceHomeExample.js +0 -171
  116. package/lib/examples/components/AgentsDataTable.d.ts +0 -13
  117. package/lib/examples/components/AgentsDataTable.js +0 -74
  118. package/lib/examples/components/Rating.d.ts +0 -14
  119. package/lib/examples/components/Rating.js +0 -12
@@ -3,11 +3,139 @@ 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 React from 'react';
7
- import { Text, TextInput, Button, FormControl, Select, Checkbox, Spinner, Flash, Label, ActionList, } from '@primer/react';
8
- import { CheckIcon, XIcon, ToolsIcon } from '@primer/octicons-react';
6
+ import { useMemo, useState, useCallback } from 'react';
7
+ import { Text, TextInput, Button, FormControl, Select, Checkbox, Spinner, Flash, Label, IconButton, } from '@primer/react';
8
+ import { ToolsIcon, KeyIcon, SyncIcon, PlusIcon, XIcon, LinkExternalIcon, } from '@primer/octicons-react';
9
9
  import { useQuery } from '@tanstack/react-query';
10
10
  import { Box } from '@datalayer/primer-addons';
11
+ import { IdentityConnect, useIdentity } from '../../identity';
12
+ import { IdentityCard } from '../../components/chat';
13
+ /**
14
+ * Token-based identity providers that can be connected via API key
15
+ */
16
+ const TOKEN_PROVIDERS = [
17
+ {
18
+ provider: 'kaggle',
19
+ name: 'Kaggle',
20
+ description: 'Access Kaggle datasets and notebooks',
21
+ iconUrl: 'https://www.kaggle.com/static/images/favicon.ico',
22
+ color: '#20beff',
23
+ helpUrl: 'https://www.kaggle.com/settings/account',
24
+ helpText: 'Get your API key from the Account page',
25
+ placeholder: 'Enter your Kaggle API key',
26
+ },
27
+ ];
28
+ /**
29
+ * Combined component that shows:
30
+ * - Connected identities with token status (from AgentIdentity)
31
+ * - Connect buttons only for providers NOT yet connected (from IdentityConnect)
32
+ * - Token input for token-based providers (Kaggle, etc.)
33
+ */
34
+ function IdentityConnectWithStatus({ identityProviders = {}, disabled = false, onConnect, onDisconnect, }) {
35
+ const { identities, connectWithToken, disconnect } = useIdentity();
36
+ const [expandedTokenProvider, setExpandedTokenProvider] = useState(null);
37
+ const [tokenInput, setTokenInput] = useState('');
38
+ const [isConnecting, setIsConnecting] = useState(false);
39
+ // Get list of connected provider names
40
+ const connectedProviders = useMemo(() => new Set(identities.map(id => id.provider)), [identities]);
41
+ // Get providers that have config and are already connected (OAuth providers)
42
+ // Plus any token-based providers that are connected (no config needed)
43
+ const connectedIdentities = useMemo(() => {
44
+ const providerKeys = Object.keys(identityProviders);
45
+ return identities.filter(id => providerKeys.includes(id.provider) ||
46
+ (id.authType === 'token' && id.isConnected));
47
+ }, [identities, identityProviders]);
48
+ // Get OAuth providers that are NOT yet connected
49
+ const unconnectedProviders = useMemo(() => {
50
+ const providerKeys = Object.keys(identityProviders);
51
+ const unconnected = {};
52
+ for (const provider of providerKeys) {
53
+ if (!connectedProviders.has(provider)) {
54
+ unconnected[provider] = identityProviders[provider];
55
+ }
56
+ }
57
+ return unconnected;
58
+ }, [identityProviders, connectedProviders]);
59
+ // Get token providers that are NOT yet connected
60
+ const unconnectedTokenProviders = useMemo(() => {
61
+ return TOKEN_PROVIDERS.filter(tp => !connectedProviders.has(tp.provider));
62
+ }, [connectedProviders]);
63
+ const hasUnconnected = Object.keys(unconnectedProviders).length > 0;
64
+ const hasUnconnectedToken = unconnectedTokenProviders.length > 0;
65
+ // Check if there's anything to show
66
+ const hasContent = connectedIdentities.length > 0 || hasUnconnected || hasUnconnectedToken;
67
+ // Handle token connection
68
+ const handleTokenConnect = useCallback(async (provider, displayName, iconUrl) => {
69
+ if (!tokenInput.trim())
70
+ return;
71
+ setIsConnecting(true);
72
+ try {
73
+ const identity = await connectWithToken(provider, tokenInput.trim(), {
74
+ displayName,
75
+ iconUrl,
76
+ });
77
+ onConnect?.(identity);
78
+ setTokenInput('');
79
+ setExpandedTokenProvider(null);
80
+ }
81
+ catch (err) {
82
+ console.error(`Failed to connect ${provider}:`, err);
83
+ }
84
+ finally {
85
+ setIsConnecting(false);
86
+ }
87
+ }, [tokenInput, connectWithToken, onConnect]);
88
+ // Handle token disconnect
89
+ const handleTokenDisconnect = useCallback(async (provider) => {
90
+ try {
91
+ await disconnect(provider);
92
+ onDisconnect?.(provider);
93
+ }
94
+ catch (err) {
95
+ console.error(`Failed to disconnect ${provider}:`, err);
96
+ }
97
+ }, [disconnect, onDisconnect]);
98
+ if (!hasContent) {
99
+ return null;
100
+ }
101
+ return (_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 3 }, children: [connectedIdentities.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: connectedIdentities.map(identity => (_jsx(IdentityCard, { identity: identity, providerConfig: identityProviders?.[identity.provider], showExpirationDetails: true, allowReconnect: !disabled && identity.authType !== 'token', onConnect: onConnect, onDisconnect: identity.authType === 'token'
102
+ ? () => handleTokenDisconnect(identity.provider)
103
+ : onDisconnect }, identity.provider))) })), hasUnconnected && (_jsx(IdentityConnect, { providers: unconnectedProviders, layout: "list", showHeader: false, size: "medium", showDescriptions: true, disabled: disabled, onConnect: onConnect, onDisconnect: onDisconnect })), hasUnconnectedToken && !disabled && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: unconnectedTokenProviders.map(tp => (_jsxs(Box, { sx: {
104
+ border: '1px solid',
105
+ borderColor: expandedTokenProvider === tp.provider
106
+ ? tp.color
107
+ : 'border.default',
108
+ borderRadius: 2,
109
+ overflow: 'hidden',
110
+ }, children: [_jsxs(Box, { as: "button", onClick: () => {
111
+ setExpandedTokenProvider(expandedTokenProvider === tp.provider ? null : tp.provider);
112
+ setTokenInput('');
113
+ }, sx: {
114
+ width: '100%',
115
+ display: 'flex',
116
+ alignItems: 'center',
117
+ gap: 2,
118
+ padding: 2,
119
+ backgroundColor: 'canvas.subtle',
120
+ border: 'none',
121
+ cursor: 'pointer',
122
+ '&:hover': {
123
+ backgroundColor: 'canvas.inset',
124
+ },
125
+ }, children: [tp.iconUrl ? (_jsx("img", { src: tp.iconUrl, alt: tp.name, style: { width: 20, height: 20 } })) : (_jsx(KeyIcon, { size: 20 })), _jsxs(Box, { sx: { flex: 1, textAlign: 'left' }, children: [_jsxs(Text, { sx: { fontWeight: 'semibold', display: 'block' }, children: ["Connect ", tp.name] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: tp.description })] }), _jsx(PlusIcon, { size: 16 })] }), expandedTokenProvider === tp.provider && (_jsxs(Box, { sx: { padding: 3, backgroundColor: 'canvas.default' }, children: [_jsxs(Box, { sx: {
126
+ mb: 2,
127
+ display: 'flex',
128
+ alignItems: 'center',
129
+ gap: 1,
130
+ }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: tp.helpText }), _jsx(Button, { as: "a", href: tp.helpUrl, target: "_blank", rel: "noopener noreferrer", variant: "invisible", size: "small", leadingVisual: LinkExternalIcon, sx: { fontSize: 0 }, children: "Get API Key" })] }), _jsxs(Box, { sx: { display: 'flex', gap: 2 }, children: [_jsx(TextInput, { type: "password", placeholder: tp.placeholder, value: tokenInput, onChange: e => setTokenInput(e.target.value), onKeyDown: e => {
131
+ if (e.key === 'Enter' && tokenInput.trim()) {
132
+ handleTokenConnect(tp.provider, tp.name, tp.iconUrl);
133
+ }
134
+ }, sx: { flex: 1 }, disabled: isConnecting, autoFocus: true }), _jsx(Button, { onClick: () => handleTokenConnect(tp.provider, tp.name, tp.iconUrl), disabled: !tokenInput.trim() || isConnecting, variant: "primary", children: isConnecting ? _jsx(Spinner, { size: "small" }) : 'Connect' }), _jsx(IconButton, { icon: XIcon, "aria-label": "Cancel", onClick: () => {
135
+ setExpandedTokenProvider(null);
136
+ setTokenInput('');
137
+ }, variant: "invisible" })] })] }))] }, tp.provider))) }))] }));
138
+ }
11
139
  const AGENT_LIBRARIES = [
12
140
  {
13
141
  value: 'pydantic-ai',
@@ -71,7 +199,7 @@ const EXTENSIONS = [
71
199
  *
72
200
  * Form for configuring agent connection settings.
73
201
  */
74
- export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl, baseUrl, agentName, agents, selectedAgentId, isCreatingAgent = false, createError = null, onAgentLibraryChange, onTransportChange, onExtensionsChange, onWsUrlChange, onBaseUrlChange, onAgentNameChange, onAgentSelect, onConnect, }) => {
202
+ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl, baseUrl, agentName, model, agents, selectedAgentId, isCreatingAgent = false, createError = null, enableCodemode = false, allowDirectToolCalls = false, enableToolReranker = false, availableSkills = [], selectedSkills = [], selectedMcpServers = [], identityProviders, onIdentityConnect, onIdentityDisconnect, onAgentLibraryChange, onTransportChange, onExtensionsChange, onWsUrlChange, onBaseUrlChange, onAgentNameChange, onModelChange, onAgentSelect, onConnect, onEnableCodemodeChange, onAllowDirectToolCallsChange, onEnableToolRerankerChange, onSelectedSkillsChange, onSelectedMcpServersChange, }) => {
75
203
  // Fetch MCP servers configuration from the backend
76
204
  const configQuery = useQuery({
77
205
  queryKey: ['agent-config', baseUrl],
@@ -86,7 +214,48 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
86
214
  staleTime: 1000 * 60 * 5, // 5 minutes
87
215
  retry: 1,
88
216
  });
217
+ // Fetch skills from the backend (only when codemode is enabled)
218
+ const skillsQuery = useQuery({
219
+ queryKey: ['agent-skills', baseUrl],
220
+ queryFn: async () => {
221
+ const response = await fetch(`${baseUrl}/api/v1/skills`);
222
+ if (!response.ok) {
223
+ throw new Error('Failed to fetch skills');
224
+ }
225
+ return response.json();
226
+ },
227
+ enabled: !!baseUrl && enableCodemode,
228
+ staleTime: 1000 * 60 * 5, // 5 minutes
229
+ retry: 1,
230
+ });
89
231
  const mcpServers = configQuery.data?.mcpServers || [];
232
+ const models = configQuery.data?.models || [];
233
+ // Use fetched skills when codemode is enabled, otherwise use passed availableSkills (which may be empty)
234
+ const fetchedSkills = skillsQuery.data?.skills || [];
235
+ const displaySkills = enableCodemode ? fetchedSkills : availableSkills;
236
+ const previewServers = selectedMcpServers.length
237
+ ? mcpServers.filter(server => selectedMcpServers.includes(server.id))
238
+ : [];
239
+ const skillsEnabled = selectedSkills.length > 0;
240
+ // Handle MCP server checkbox change
241
+ const handleMcpServerChange = (serverId, checked) => {
242
+ if (checked) {
243
+ onSelectedMcpServersChange?.([...selectedMcpServers, serverId]);
244
+ }
245
+ else {
246
+ onSelectedMcpServersChange?.(selectedMcpServers.filter(id => id !== serverId));
247
+ }
248
+ };
249
+ const handleSkillChange = (skillId, checked) => {
250
+ if (checked) {
251
+ onSelectedSkillsChange?.([...selectedSkills, skillId]);
252
+ }
253
+ else {
254
+ onSelectedSkillsChange?.(selectedSkills.filter(id => id !== skillId));
255
+ }
256
+ };
257
+ // MCP servers are disabled for existing agents (new-agent only)
258
+ const mcpServersDisabled = selectedAgentId !== 'new-agent';
90
259
  // Determine which extensions are enabled based on transport
91
260
  const isExtensionEnabled = (ext) => {
92
261
  if (selectedAgentId !== 'new-agent')
@@ -119,27 +288,89 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
119
288
  marginBottom: 3,
120
289
  }, children: "Create a new Agent" }), _jsxs(FormControl, { sx: { marginBottom: 3 }, children: [_jsx(FormControl.Label, { children: "Available Agents" }), _jsxs(Select, { value: selectedAgentId, onChange: e => onAgentSelect(e.target.value), sx: { width: '100%' }, children: [_jsx(Select.Option, { value: "new-agent", children: "+ New Agent..." }), agents.map(agent => (_jsxs(Select.Option, { value: agent.id, children: [agent.status === 'running' && '● ', agent.name] }, agent.id)))] }), _jsx(FormControl.Caption, { children: selectedAgentId === 'new-agent'
121
290
  ? 'Configure a new custom agent'
122
- : 'Selected agent - form fields below are disabled' })] }), _jsxs(Box, { sx: { display: 'flex', gap: 3, marginBottom: 3 }, children: [_jsxs(FormControl, { sx: { flex: 1 }, children: [_jsx(FormControl.Label, { children: "Agent Library" }), _jsx(Select, { value: agentLibrary, onChange: e => onAgentLibraryChange(e.target.value), disabled: selectedAgentId !== 'new-agent', 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 }, children: [_jsx(FormControl.Label, { children: "Transport" }), _jsx(Select, { value: transport, onChange: e => onTransportChange(e.target.value), disabled: selectedAgentId !== 'new-agent', 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: !isExtensionEnabled(ext.value), onChange: e => handleExtensionChange(ext.value, e.target.checked) }), _jsx(Text, { children: ext.label })] }, ext.value))) })] })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, children: [_jsx(FormControl.Label, { children: transport === 'acp' ? 'WebSocket URL' : 'Base URL' }), _jsx(TextInput, { value: transport === 'acp' ? wsUrl : baseUrl, onChange: e => transport === 'acp'
291
+ : 'Selected agent - form fields below are disabled' })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, children: [_jsx(FormControl.Label, { children: "Agent Name" }), _jsx(TextInput, { value: agentName, onChange: e => onAgentNameChange(e.target.value), disabled: selectedAgentId !== 'new-agent', placeholder: "demo-agent", sx: { width: '100%' } }), _jsx(FormControl.Caption, { children: "The name of the agent to connect to" })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, children: [_jsx(FormControl.Label, { children: transport === 'acp' ? 'WebSocket URL' : 'Base URL' }), _jsx(TextInput, { value: transport === 'acp' ? wsUrl : baseUrl, onChange: e => transport === 'acp'
123
292
  ? onWsUrlChange(e.target.value)
124
293
  : onBaseUrlChange(e.target.value), disabled: selectedAgentId !== 'new-agent', placeholder: transport === 'acp'
125
294
  ? 'ws://localhost:8000/api/v1/acp/ws'
126
295
  : 'http://localhost:8000', sx: { width: '100%' } }), _jsx(FormControl.Caption, { children: transport === 'acp'
127
296
  ? 'The WebSocket endpoint of your agent-runtimes server'
128
- : 'The base URL of your agent-runtimes server' })] }), _jsxs(FormControl, { sx: { marginBottom: 3 }, children: [_jsx(FormControl.Label, { children: "Agent Name" }), _jsx(TextInput, { value: agentName, onChange: e => onAgentNameChange(e.target.value), disabled: selectedAgentId !== 'new-agent', placeholder: "demo-agent", sx: { width: '100%' } }), _jsx(FormControl.Caption, { children: "The name of the agent to connect to" })] }), _jsxs(Box, { sx: {
297
+ : 'The base URL of your agent-runtimes server' })] }), _jsxs(Box, { sx: { display: 'flex', gap: 3, marginBottom: 3 }, children: [_jsxs(FormControl, { sx: { flex: 1 }, children: [_jsx(FormControl.Label, { children: "Agent Library" }), _jsx(Select, { value: agentLibrary, onChange: e => onAgentLibraryChange(e.target.value), disabled: selectedAgentId !== 'new-agent', 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 }, children: [_jsx(FormControl.Label, { children: "Model" }), _jsx(Select, { value: model, onChange: e => onModelChange(e.target.value), disabled: selectedAgentId !== 'new-agent' || models.length === 0, 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 }, children: [_jsx(FormControl.Label, { children: "Transport" }), _jsx(Select, { value: transport, onChange: e => onTransportChange(e.target.value), disabled: selectedAgentId !== 'new-agent', 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: !isExtensionEnabled(ext.value), onChange: e => handleExtensionChange(ext.value, e.target.checked) }), _jsx(Text, { children: ext.label })] }, ext.value))) })] })] }), _jsxs(Box, { sx: {
298
+ marginBottom: 3,
299
+ padding: 3,
300
+ border: '1px solid',
301
+ borderColor: 'border.default',
302
+ borderRadius: 2,
303
+ backgroundColor: 'canvas.default',
304
+ }, children: [_jsxs(Box, { sx: {
305
+ display: 'flex',
306
+ alignItems: 'center',
307
+ gap: 2,
308
+ marginBottom: 2,
309
+ }, children: [_jsx(KeyIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: "Connected Accounts" })] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', display: 'block', mb: 3 }, children: "Connect your accounts to give the agent access to external services like GitHub repositories, Google services, or Kaggle datasets." }), _jsx(IdentityConnectWithStatus, { identityProviders: identityProviders, disabled: selectedAgentId !== 'new-agent', onConnect: onIdentityConnect, onDisconnect: onIdentityDisconnect })] }), _jsxs(Box, { sx: {
310
+ marginBottom: 3,
311
+ padding: 3,
312
+ border: '1px solid',
313
+ borderColor: 'border.default',
314
+ borderRadius: 2,
315
+ backgroundColor: 'canvas.default',
316
+ }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold', display: 'block', mb: 2 }, children: "Agent Capabilities" }), _jsx(Box, { sx: { display: 'flex', gap: 4 }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Checkbox, { checked: enableCodemode, disabled: selectedAgentId !== 'new-agent', 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." }) })), 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: selectedAgentId !== 'new-agent', 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: selectedAgentId !== 'new-agent', 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: {
129
317
  marginBottom: 3,
130
318
  padding: 3,
131
319
  border: '1px solid',
132
320
  borderColor: 'border.default',
133
321
  borderRadius: 2,
134
322
  backgroundColor: 'canvas.default',
323
+ opacity: enableCodemode ? 1 : 0.5,
135
324
  }, children: [_jsxs(Box, { sx: {
136
325
  display: 'flex',
137
326
  alignItems: 'center',
138
327
  gap: 2,
139
328
  marginBottom: 2,
140
- }, children: [_jsx(ToolsIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: "MCP Servers" }), configQuery.isLoading && _jsx(Spinner, { size: "small" })] }), configQuery.isError && (_jsx(Flash, { variant: "warning", sx: { marginBottom: 2 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Unable to fetch MCP servers. Check that the server is running." }) })), mcpServers.length === 0 &&
329
+ }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: "Skills" }), skillsQuery.isLoading && _jsx(Spinner, { size: "small" }), enableCodemode && !skillsQuery.isLoading && (_jsx(Button, { variant: "invisible", size: "small", onClick: () => skillsQuery.refetch(), sx: { padding: 1 }, "aria-label": "Refresh skills", children: _jsx(SyncIcon, { size: 14 }) }))] }), !enableCodemode ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Enable Codemode to use skills." })) : skillsQuery.isError ? (_jsx(Flash, { variant: "warning", sx: { marginBottom: 2 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Unable to fetch skills. Check that the server is running." }) })) : displaySkills.length === 0 && !skillsQuery.isLoading ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No skills available." })) : (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: displaySkills.map(skill => (_jsxs(Box, { sx: {
330
+ display: 'flex',
331
+ alignItems: 'center',
332
+ gap: 2,
333
+ padding: 2,
334
+ borderRadius: 1,
335
+ backgroundColor: 'canvas.subtle',
336
+ opacity: selectedAgentId !== 'new-agent' ? 0.6 : 1,
337
+ }, children: [_jsx(Checkbox, { checked: selectedSkills.includes(skill.id), disabled: selectedAgentId !== 'new-agent', onChange: e => handleSkillChange(skill.id, e.target.checked) }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: skill.name }), skill.description && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: skill.description }))] })] }, skill.id))) }))] }), _jsxs(Box, { sx: {
338
+ marginBottom: 3,
339
+ padding: 3,
340
+ border: '1px solid',
341
+ borderColor: 'border.default',
342
+ borderRadius: 2,
343
+ backgroundColor: 'canvas.default',
344
+ }, children: [_jsxs(Box, { sx: {
345
+ display: 'flex',
346
+ alignItems: 'center',
347
+ gap: 2,
348
+ marginBottom: 2,
349
+ }, children: [_jsx(ToolsIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: "MCP Servers" }), configQuery.isLoading && _jsx(Spinner, { size: "small" }), !configQuery.isLoading && (_jsx(Button, { variant: "invisible", size: "small", onClick: () => configQuery.refetch(), sx: { padding: 1 }, "aria-label": "Refresh MCP servers", children: _jsx(SyncIcon, { size: 14 }) }))] }), configQuery.isError && (_jsx(Flash, { variant: "warning", sx: { marginBottom: 2 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "Unable to fetch MCP servers. Check that the server is running." }) })), mcpServers.length === 0 &&
141
350
  !configQuery.isLoading &&
142
- !configQuery.isError && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No MCP servers configured." })), mcpServers.length > 0 && (_jsx(ActionList, { children: mcpServers.map((server, index) => (_jsxs(React.Fragment, { children: [index > 0 && _jsx(ActionList.Divider, {}), _jsxs(ActionList.Item, { disabled: true, children: [_jsx(ActionList.LeadingVisual, { children: server.isAvailable ? (_jsx(CheckIcon, { size: 16 })) : (_jsx(XIcon, { size: 16 })) }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: server.name }), _jsx(Label, { variant: server.isAvailable ? 'success' : 'secondary', size: "small", children: server.isAvailable ? 'Available' : 'Not Available' })] }), server.tools.length > 0 && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Tools: ", server.tools.map(t => t.name).join(', ')] }))] })] })] }, server.id))) }))] }), createError && (_jsx(Flash, { variant: "danger", sx: { marginBottom: 3 }, children: createError })), _jsx(Button, { variant: "primary", onClick: onConnect, disabled: isCreatingAgent ||
351
+ !configQuery.isError && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No MCP servers configured." })), enableCodemode && (_jsx(Flash, { variant: "default", sx: { marginBottom: 2 }, children: _jsx(Text, { sx: { fontSize: 0 }, children: "When Codemode is enabled, selected MCP servers are used to build the Codemode tool registry (tools are exposed via Codemode meta tools like search and execute_code)." }) })), enableCodemode && (_jsxs(Box, { sx: {
352
+ marginBottom: 2,
353
+ padding: 2,
354
+ borderRadius: 1,
355
+ border: '1px solid',
356
+ borderColor: 'border.default',
357
+ backgroundColor: 'canvas.subtle',
358
+ }, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold', display: 'block' }, children: "Codemode registry preview" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', mb: 1 }, children: selectedMcpServers.length > 0
359
+ ? 'Using selected MCP servers'
360
+ : 'No servers selected — select servers to scope Codemode tools.' }), previewServers.length > 0 ? (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: previewServers.map(server => (_jsxs(Text, { sx: { fontSize: 0 }, children: [server.name, " \u2014 ", server.tools.length, " tools"] }, server.id))) })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No servers selected." })), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', mt: 2 }, children: "Exposed meta-tools: list_tool_names, search_tools, get_tool_details, list_servers, execute_code, call_tool (optional)" })] })), mcpServers.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: mcpServers.map(server => (_jsxs(Box, { sx: {
361
+ display: 'flex',
362
+ alignItems: 'flex-start',
363
+ gap: 2,
364
+ padding: 2,
365
+ borderRadius: 1,
366
+ backgroundColor: 'canvas.subtle',
367
+ opacity: mcpServersDisabled || !server.isAvailable ? 0.6 : 1,
368
+ }, children: [_jsx(Checkbox, { checked: selectedMcpServers.includes(server.id), disabled: mcpServersDisabled || !server.isAvailable, onChange: e => handleMcpServerChange(server.id, e.target.checked) }), _jsxs(Box, { sx: {
369
+ display: 'flex',
370
+ flexDirection: 'column',
371
+ gap: 1,
372
+ flex: 1,
373
+ }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: server.name }), _jsx(Label, { variant: server.isAvailable ? 'success' : 'secondary', size: "small", children: server.isAvailable ? 'Available' : 'Not Available' })] }), server.tools.length > 0 && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Tools: ", server.tools.map(t => t.name).join(', ')] }))] })] }, server.id))) }))] }), createError && (_jsx(Flash, { variant: "danger", sx: { marginBottom: 3 }, children: createError })), _jsx(Button, { variant: "primary", onClick: onConnect, disabled: isCreatingAgent ||
143
374
  !agentName ||
144
375
  (transport === 'acp' ? !wsUrl : !baseUrl), sx: { width: '100%' }, children: isCreatingAgent ? (_jsxs(Box, { sx: {
145
376
  display: 'flex',
@@ -6,14 +6,12 @@ interface HeaderProps {
6
6
  agentStatus?: 'running' | 'paused';
7
7
  richEditor: boolean;
8
8
  durable: boolean;
9
- codemode: boolean;
10
9
  showContextTree: boolean;
11
10
  isNewAgent?: boolean;
12
11
  isConfigured?: boolean;
13
12
  onSessionChange: (sessionId: string) => void;
14
13
  onRichEditorChange: (value: boolean) => void;
15
14
  onDurableChange: (value: boolean) => void;
16
- onCodemodeChange: (value: boolean) => void;
17
15
  onToggleContextTree: () => void;
18
16
  onToggleStatus?: () => void;
19
17
  }
@@ -112,7 +112,7 @@ const OPTIMIZED_CONTEXT_DATA = {
112
112
  * Main header for the agent runtime interface with session tabs,
113
113
  * toggle switches, controls, and optional context treemap.
114
114
  */
115
- export const Header = ({ activeSession, agentName, agentDescription, agentStatus, richEditor, durable, codemode, showContextTree, isNewAgent = false, isConfigured = false, onSessionChange, onRichEditorChange, onDurableChange, onCodemodeChange, onToggleContextTree, onToggleStatus, }) => {
115
+ export const Header = ({ activeSession, agentName, agentDescription, agentStatus, richEditor, durable, showContextTree, isNewAgent = false, isConfigured = false, onSessionChange, onRichEditorChange, onDurableChange, onToggleContextTree, onToggleStatus, }) => {
116
116
  const [isOptimizing, setIsOptimizing] = useState(false);
117
117
  const [contextData, setContextData] = useState(MOCK_CONTEXT_DATA);
118
118
  const [totalTokens, setTotalTokens] = useState('1.52M');
@@ -121,7 +121,6 @@ export const Header = ({ activeSession, agentName, agentDescription, agentStatus
121
121
  const [openOverlay, setOpenOverlay] = useState(null);
122
122
  const richEditorRef = useRef(null);
123
123
  const durableRef = useRef(null);
124
- const codemodeRef = useRef(null);
125
124
  const handleOptimize = () => {
126
125
  setIsOptimizing(true);
127
126
  setTimeout(() => {
@@ -142,20 +141,7 @@ export const Header = ({ activeSession, agentName, agentDescription, agentStatus
142
141
  alignItems: 'center',
143
142
  gap: 3,
144
143
  marginLeft: 'auto',
145
- }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(ToggleSwitch, { size: "small", checked: codemode, onClick: () => onCodemodeChange(!codemode), "aria-labelledby": "codemode-label", disabled: isNewAgent || !isConfigured }), _jsx(Text, { id: "codemode-label", sx: { fontSize: 0 }, children: "Codemode" }), _jsx(IconButton, { ref: codemodeRef, icon: InfoIcon, size: "small", variant: "invisible", "aria-label": "Codemode info", onClick: () => setOpenOverlay(openOverlay === 'codemode' ? null : 'codemode') }), _jsx(AnchoredOverlay, { open: openOverlay === 'codemode', onOpen: () => setOpenOverlay('codemode'), onClose: () => setOpenOverlay(null), renderAnchor: () => _jsx("span", {}), anchorRef: codemodeRef, children: _jsxs(Box, { sx: {
146
- p: 3,
147
- maxWidth: '300px',
148
- bg: 'canvas.overlay',
149
- border: '1px solid',
150
- borderColor: 'border.default',
151
- borderRadius: 2,
152
- boxShadow: 'shadow.large',
153
- }, children: [_jsx(Text, { sx: {
154
- fontSize: 0,
155
- display: 'block',
156
- mb: 1,
157
- fontWeight: 'bold',
158
- }, children: "Codemode" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Optimize the agent for code-focused tasks including code generation, debugging, and technical problem-solving." })] }) })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(ToggleSwitch, { size: "small", checked: richEditor, onClick: () => onRichEditorChange(!richEditor), "aria-labelledby": "rich-editor-label", disabled: isNewAgent || !isConfigured }), _jsx(Text, { id: "rich-editor-label", sx: { fontSize: 0 }, children: "Rich Editor" }), _jsx(IconButton, { ref: richEditorRef, icon: InfoIcon, size: "small", variant: "invisible", "aria-label": "Rich Editor info", onClick: () => setOpenOverlay(openOverlay === 'richEditor' ? null : 'richEditor') }), _jsx(AnchoredOverlay, { open: openOverlay === 'richEditor', onOpen: () => setOpenOverlay('richEditor'), onClose: () => setOpenOverlay(null), renderAnchor: () => _jsx("span", {}), anchorRef: richEditorRef, children: _jsxs(Box, { sx: {
144
+ }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(ToggleSwitch, { size: "small", checked: richEditor, onClick: () => onRichEditorChange(!richEditor), "aria-labelledby": "rich-editor-label", disabled: isNewAgent || !isConfigured }), _jsx(Text, { id: "rich-editor-label", sx: { fontSize: 0 }, children: "Rich Editor" }), _jsx(IconButton, { ref: richEditorRef, icon: InfoIcon, size: "small", variant: "invisible", "aria-label": "Rich Editor info", onClick: () => setOpenOverlay(openOverlay === 'richEditor' ? null : 'richEditor') }), _jsx(AnchoredOverlay, { open: openOverlay === 'richEditor', onOpen: () => setOpenOverlay('richEditor'), onClose: () => setOpenOverlay(null), renderAnchor: () => _jsx("span", {}), anchorRef: richEditorRef, children: _jsxs(Box, { sx: {
159
145
  p: 3,
160
146
  maxWidth: '300px',
161
147
  bg: 'canvas.overlay',
@@ -99,6 +99,7 @@ function SimpleKernelPluginsInner() {
99
99
  */
100
100
  export const LexicalEditor = ({ content = INITIAL_CONTENT, serviceManager, }) => {
101
101
  const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
102
+ const [_isLinkEditMode, setIsLinkEditMode] = useState(false);
102
103
  const onRef = (_floatingAnchorElem) => {
103
104
  if (_floatingAnchorElem !== null) {
104
105
  setFloatingAnchorElem(_floatingAnchorElem);
@@ -114,5 +115,5 @@ export const LexicalEditor = ({ content = INITIAL_CONTENT, serviceManager, }) =>
114
115
  padding: 3,
115
116
  backgroundColor: 'canvas.default',
116
117
  minHeight: '600px',
117
- }, children: _jsx(LexicalConfigProvider, { lexicalId: LEXICAL_ID, serviceManager: serviceManager, children: _jsx(LexicalComposer, { initialConfig: editorConfig, children: _jsxs("div", { className: "lexical-editor-inner", ref: onRef, children: [_jsx(LexicalStatePlugin, {}), _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "lexical-editor-content", "aria-label": "Lexical Editor" }), ErrorBoundary: LexicalErrorBoundary }), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(LoadContentPlugin, { content: content }), _jsx(CodeHighlightPlugin, {}), _jsx(ImagesPlugin, { captionsEnabled: false }), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterReactTheme, { children: _jsx(SimpleKernelPluginsInner, {}) }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] }) }) }) }));
118
+ }, children: _jsx(LexicalConfigProvider, { lexicalId: LEXICAL_ID, serviceManager: serviceManager, children: _jsx(LexicalComposer, { initialConfig: editorConfig, children: _jsxs("div", { className: "lexical-editor-inner", ref: onRef, children: [_jsx(LexicalStatePlugin, {}), _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "lexical-editor-content", "aria-label": "Lexical Editor" }), ErrorBoundary: LexicalErrorBoundary }), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(LoadContentPlugin, { content: content }), _jsx(CodeHighlightPlugin, {}), _jsx(ImagesPlugin, { captionsEnabled: false }), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterReactTheme, { children: _jsx(SimpleKernelPluginsInner, {}) }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem, setIsLinkEditMode: setIsLinkEditMode }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] }) }) }) }));
118
119
  };
@@ -96,8 +96,12 @@ export const MockFileBrowser = ({ codemode = false, }) => {
96
96
  mb: 2,
97
97
  }, children: codemode ? 'Codemode Tools' : 'MCP Tools' }), _jsx(DataTable, { "aria-label": codemode ? 'Codemode Tools table' : 'MCP Tools table', data: codemode
98
98
  ? [
99
- { id: 1, tool: 'execute_code' },
100
- { id: 2, tool: 'search_tool' },
99
+ { id: 1, tool: 'list_tool_names' },
100
+ { id: 2, tool: 'search_tools' },
101
+ { id: 3, tool: 'get_tool_details' },
102
+ { id: 4, tool: 'list_servers' },
103
+ { id: 5, tool: 'execute_code' },
104
+ { id: 6, tool: 'call_tool (optional)' },
101
105
  ]
102
106
  : [
103
107
  { id: 1, tool: 'search_dataset' },
@@ -6,6 +6,5 @@ export { HeaderControls } from './HeaderControls';
6
6
  export { FooterMetrics } from './FooterMetrics';
7
7
  export { TimeTravel } from './TimeTravel';
8
8
  export { LexicalEditor } from './LexicalEditor';
9
- export { Rating } from './Rating';
10
9
  export { AgentConfiguration, AGENT_LIBRARIES, TRANSPORTS, EXTENSIONS, } from './AgentConfiguration';
11
10
  export type { AgentLibrary, Transport, Extension, MCPServerConfig, MCPServerTool, } from './AgentConfiguration';
@@ -10,5 +10,4 @@ export { HeaderControls } from './HeaderControls';
10
10
  export { FooterMetrics } from './FooterMetrics';
11
11
  export { TimeTravel } from './TimeTravel';
12
12
  export { LexicalEditor } from './LexicalEditor';
13
- export { Rating } from './Rating';
14
13
  export { AgentConfiguration, AGENT_LIBRARIES, TRANSPORTS, EXTENSIONS, } from './AgentConfiguration';
@@ -17,7 +17,6 @@ export const EXAMPLES = {
17
17
  AgUiToolsBasedGenUIExample: () => import('./AgUiToolsBasedGenUIExample'),
18
18
  AgentRuntimeCustomExample: () => import('./AgentRuntimeCustomExample'),
19
19
  AgentSpaceFormExample: () => import('./AgentSpaceFormExample'),
20
- AgentSpaceHomeExample: () => import('./AgentSpaceHomeExample'),
21
20
  AgentRuntimeLexicalSidebarExample: () => import('./AgentRuntimeLexicalSidebarExample'),
22
21
  AgentRuntimeNotebookExample: () => import('./AgentRuntimeNotebookExample'),
23
22
  AgentRuntimeNotebookSidebarExample: () => import('./AgentRuntimeNotebookSidebarExample'),
@@ -13,7 +13,6 @@ export { default as AgentRuntimeNotebookExample } from './AgentRuntimeNotebookEx
13
13
  export { default as AgentRuntimeNotebookSidebarExample } from './AgentRuntimeNotebookSidebarExample';
14
14
  export { default as AgentRuntimeStandaloneExample } from './AgentRuntimeStandaloneExample';
15
15
  export { default as AgentSpaceFormExample } from './AgentSpaceFormExample';
16
- export { default as AgentSpaceHomeExample } from './AgentSpaceHomeExample';
17
16
  export { default as CopilotKitLexicalExample } from './CopilotKitLexicalExample';
18
17
  export { default as CopilotKitNotebookExample } from './CopilotKitNotebookExample';
19
18
  export { default as DatalayerNotebookExample } from './DatalayerNotebookExample';
@@ -17,7 +17,6 @@ export { default as AgentRuntimeNotebookExample } from './AgentRuntimeNotebookEx
17
17
  export { default as AgentRuntimeNotebookSidebarExample } from './AgentRuntimeNotebookSidebarExample';
18
18
  export { default as AgentRuntimeStandaloneExample } from './AgentRuntimeStandaloneExample';
19
19
  export { default as AgentSpaceFormExample } from './AgentSpaceFormExample';
20
- export { default as AgentSpaceHomeExample } from './AgentSpaceHomeExample';
21
20
  export { default as CopilotKitLexicalExample } from './CopilotKitLexicalExample';
22
21
  export { default as CopilotKitNotebookExample } from './CopilotKitNotebookExample';
23
22
  export { default as DatalayerNotebookExample } from './DatalayerNotebookExample';
@@ -7,7 +7,7 @@ import { HashtagNode } from '@lexical/hashtag';
7
7
  import { MarkNode } from '@lexical/mark';
8
8
  import { OverflowNode } from '@lexical/overflow';
9
9
  import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
10
- import { EquationNode, ImageNode, YouTubeNode, JupyterCellNode, JupyterInputNode, JupyterInputHighlightNode, JupyterOutputNode, InlineCompletionNode } from '@datalayer/jupyter-lexical';
10
+ import { EquationNode, ImageNode, YouTubeNode, ExcalidrawNode, CollapsibleContainerNode, CollapsibleTitleNode, CollapsibleContentNode, JupyterCellNode, JupyterInputNode, JupyterInputHighlightNode, JupyterOutputNode, InlineCompletionNode } from '@datalayer/jupyter-lexical';
11
11
  /**
12
12
  * Lexical editor configuration
13
13
  */
@@ -71,6 +71,7 @@ export declare const editorConfig: {
71
71
  hr: string;
72
72
  mark: string;
73
73
  };
74
- nodes: (typeof HeadingNode | typeof QuoteNode | typeof ListNode | typeof ListItemNode | typeof CodeNode | typeof CodeHighlightNode | typeof LinkNode | typeof TableNode | typeof TableCellNode | typeof TableRowNode | typeof HashtagNode | typeof MarkNode | typeof OverflowNode | typeof HorizontalRuleNode | typeof EquationNode | typeof ImageNode | typeof YouTubeNode | typeof JupyterCellNode | typeof JupyterInputNode | typeof JupyterInputHighlightNode | typeof JupyterOutputNode | typeof InlineCompletionNode)[];
74
+ editorState: string;
75
+ nodes: (typeof HeadingNode | typeof QuoteNode | typeof ListNode | typeof ListItemNode | typeof CodeNode | typeof CodeHighlightNode | typeof LinkNode | typeof TableNode | typeof TableCellNode | typeof TableRowNode | typeof HashtagNode | typeof MarkNode | typeof OverflowNode | typeof HorizontalRuleNode | typeof EquationNode | typeof ImageNode | typeof YouTubeNode | typeof ExcalidrawNode | typeof CollapsibleContainerNode | typeof CollapsibleTitleNode | typeof CollapsibleContentNode | typeof JupyterCellNode | typeof JupyterInputNode | typeof JupyterInputHighlightNode | typeof JupyterOutputNode | typeof InlineCompletionNode)[];
75
76
  onError(_error: Error): void;
76
77
  };
@@ -11,8 +11,9 @@ import { HashtagNode } from '@lexical/hashtag';
11
11
  import { MarkNode } from '@lexical/mark';
12
12
  import { OverflowNode } from '@lexical/overflow';
13
13
  import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
14
- import { EquationNode, ImageNode, YouTubeNode, JupyterCellNode, JupyterInputNode, JupyterInputHighlightNode, JupyterOutputNode, InlineCompletionNode, } from '@datalayer/jupyter-lexical';
14
+ import { EquationNode, ImageNode, YouTubeNode, ExcalidrawNode, CollapsibleContainerNode, CollapsibleTitleNode, CollapsibleContentNode, JupyterCellNode, JupyterInputNode, JupyterInputHighlightNode, JupyterOutputNode, InlineCompletionNode, } from '@datalayer/jupyter-lexical';
15
15
  import { lexicalTheme } from './theme';
16
+ import initialContent from './initial-content.json';
16
17
  /**
17
18
  * Lexical editor configuration
18
19
  */
@@ -20,6 +21,7 @@ export const editorConfig = {
20
21
  namespace: 'AgUiLexicalEditor',
21
22
  editable: true,
22
23
  theme: lexicalTheme,
24
+ editorState: JSON.stringify(initialContent),
23
25
  nodes: [
24
26
  // Basic rich text nodes
25
27
  HeadingNode,
@@ -43,6 +45,10 @@ export const editorConfig = {
43
45
  EquationNode,
44
46
  ImageNode,
45
47
  YouTubeNode,
48
+ ExcalidrawNode,
49
+ CollapsibleContainerNode,
50
+ CollapsibleTitleNode,
51
+ CollapsibleContentNode,
46
52
  JupyterCellNode,
47
53
  JupyterInputNode,
48
54
  JupyterInputHighlightNode,