@datalayer/agent-runtimes 0.0.7 → 0.0.9
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.
- package/README.md +9 -0
- package/lib/components/chat/components/AgentDetails.d.ts +14 -1
- package/lib/components/chat/components/AgentDetails.js +3 -2
- package/lib/components/chat/components/AgentIdentity.d.ts +92 -0
- package/lib/components/chat/components/AgentIdentity.js +318 -0
- package/lib/components/chat/components/Chat.d.ts +20 -1
- package/lib/components/chat/components/Chat.js +16 -3
- package/lib/components/chat/components/ChatFloating.d.ts +6 -1
- package/lib/components/chat/components/ChatFloating.js +12 -6
- package/lib/components/chat/components/base/ChatBase.d.ts +47 -1
- package/lib/components/chat/components/base/ChatBase.js +242 -63
- package/lib/components/chat/components/display/ToolCallDisplay.d.ts +16 -2
- package/lib/components/chat/components/display/ToolCallDisplay.js +148 -6
- package/lib/components/chat/components/display/index.d.ts +1 -1
- package/lib/components/chat/components/display/index.js +1 -1
- package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +12 -1
- package/lib/components/chat/components/elements/ChatInputPrompt.js +8 -3
- package/lib/components/chat/components/index.d.ts +1 -0
- package/lib/components/chat/components/index.js +1 -0
- package/lib/components/chat/components/parts/ToolPart.d.ts +1 -1
- package/lib/components/chat/components/parts/ToolPart.js +142 -6
- package/lib/components/chat/index.d.ts +1 -1
- package/lib/components/chat/index.js +1 -1
- package/lib/components/chat/protocols/A2AAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/A2AAdapter.js +13 -2
- package/lib/components/chat/protocols/ACPAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/ACPAdapter.js +13 -2
- package/lib/components/chat/protocols/AGUIAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/AGUIAdapter.js +19 -1
- package/lib/components/chat/protocols/VercelAIAdapter.d.ts +7 -0
- package/lib/components/chat/protocols/VercelAIAdapter.js +19 -0
- package/lib/components/chat/types/execution.d.ts +78 -0
- package/lib/components/chat/types/execution.js +64 -0
- package/lib/components/chat/types/index.d.ts +1 -0
- package/lib/components/chat/types/index.js +1 -0
- package/lib/components/chat/types/protocol.d.ts +9 -0
- package/lib/components/ui/pagination.d.ts +2 -2
- package/lib/components/ui/pagination.js +4 -4
- package/lib/components/ui/resizable.d.ts +4 -4
- package/lib/components/ui/resizable.js +4 -4
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/AgUiAgenticExample.js +2 -2
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
- package/lib/examples/AgUiHaikuGenUIExample.js +2 -2
- package/lib/examples/AgUiHumanInTheLoopExample.js +2 -2
- package/lib/examples/AgUiSharedStateExample.js +2 -2
- package/lib/examples/AgUiToolsBasedGenUIExample.js +2 -2
- package/lib/examples/AgentRuntimeCustomExample.js +2 -2
- package/lib/examples/AgentRuntimeLexical2Example.js +2 -1
- package/lib/examples/AgentRuntimeLexicalExample.js +5 -2
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +4 -2
- package/lib/examples/AgentRuntimeNotebookExample.js +1 -1
- package/lib/examples/AgentRuntimeStandaloneExample.js +2 -2
- package/lib/examples/AgentSpaceFormExample.d.ts +70 -2
- package/lib/examples/AgentSpaceFormExample.js +177 -43
- package/lib/examples/CopilotKitLexicalExample.js +2 -1
- package/lib/examples/components/AgentConfiguration.d.ts +17 -2
- package/lib/examples/components/AgentConfiguration.js +220 -16
- package/lib/examples/components/LexicalEditor.js +2 -1
- package/lib/examples/components/MockFileBrowser.js +6 -2
- package/lib/examples/components/index.d.ts +0 -1
- package/lib/examples/components/index.js +0 -1
- package/lib/examples/example-selector.js +0 -1
- package/lib/examples/index.d.ts +0 -1
- package/lib/examples/index.js +0 -1
- package/lib/examples/lexical/editorConfig.d.ts +3 -2
- package/lib/examples/lexical/editorConfig.js +7 -1
- package/lib/examples/lexical/initial-content.json +2210 -0
- package/lib/examples/main.js +15 -1
- package/lib/identity/IdentityConnect.d.ts +90 -0
- package/lib/identity/IdentityConnect.js +316 -0
- package/lib/identity/OAuthCallback.d.ts +58 -0
- package/lib/identity/OAuthCallback.js +223 -0
- package/lib/identity/dcr.d.ts +257 -0
- package/lib/identity/dcr.js +282 -0
- package/lib/identity/identityStore.d.ts +72 -0
- package/lib/identity/identityStore.js +529 -0
- package/lib/identity/index.d.ts +46 -0
- package/lib/identity/index.js +17 -0
- package/lib/identity/pkce.d.ts +30 -0
- package/lib/identity/pkce.js +65 -0
- package/lib/identity/types.d.ts +293 -0
- package/lib/identity/types.js +73 -0
- package/lib/identity/useIdentity.d.ts +108 -0
- package/lib/identity/useIdentity.js +323 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/lib/utils.js +1 -1
- package/lib/renderers/a2ui/lib/utils.js +1 -1
- package/lib/test-setup.d.ts +1 -1
- package/lib/test-setup.js +1 -0
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +32 -1
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -0
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +16 -17
- package/package.json +20 -7
- package/patches/@datalayer+jupyter-lexical+1.0.8.patch +11628 -0
- package/patches/@datalayer+jupyter-react+2.0.2.patch +5338 -0
- package/scripts/apply-patches.sh +32 -0
- package/lib/examples/AgentSpaceHomeExample.d.ts +0 -8
- package/lib/examples/AgentSpaceHomeExample.js +0 -171
- package/lib/examples/components/AgentsDataTable.d.ts +0 -13
- package/lib/examples/components/AgentsDataTable.js +0 -74
- package/lib/examples/components/Rating.d.ts +0 -14
- package/lib/examples/components/Rating.js +0 -12
|
@@ -1,8 +1,141 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
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';
|
|
4
9
|
import { useQuery } from '@tanstack/react-query';
|
|
5
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
|
+
}
|
|
6
139
|
const AGENT_LIBRARIES = [
|
|
7
140
|
{
|
|
8
141
|
value: 'pydantic-ai',
|
|
@@ -66,7 +199,7 @@ const EXTENSIONS = [
|
|
|
66
199
|
*
|
|
67
200
|
* Form for configuring agent connection settings.
|
|
68
201
|
*/
|
|
69
|
-
export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl, baseUrl, agentName, model, agents, selectedAgentId, isCreatingAgent = false, createError = null,
|
|
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, }) => {
|
|
70
203
|
// Fetch MCP servers configuration from the backend
|
|
71
204
|
const configQuery = useQuery({
|
|
72
205
|
queryKey: ['agent-config', baseUrl],
|
|
@@ -81,8 +214,29 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
|
|
|
81
214
|
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
82
215
|
retry: 1,
|
|
83
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
|
+
});
|
|
84
231
|
const mcpServers = configQuery.data?.mcpServers || [];
|
|
85
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;
|
|
86
240
|
// Handle MCP server checkbox change
|
|
87
241
|
const handleMcpServerChange = (serverId, checked) => {
|
|
88
242
|
if (checked) {
|
|
@@ -92,8 +246,16 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
|
|
|
92
246
|
onSelectedMcpServersChange?.(selectedMcpServers.filter(id => id !== serverId));
|
|
93
247
|
}
|
|
94
248
|
};
|
|
95
|
-
|
|
96
|
-
|
|
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';
|
|
97
259
|
// Determine which extensions are enabled based on transport
|
|
98
260
|
const isExtensionEnabled = (ext) => {
|
|
99
261
|
if (selectedAgentId !== 'new-agent')
|
|
@@ -126,20 +288,53 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
|
|
|
126
288
|
marginBottom: 3,
|
|
127
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'
|
|
128
290
|
? 'Configure a new custom agent'
|
|
129
|
-
: 'Selected agent - form fields below are disabled' })] }), _jsxs(
|
|
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'
|
|
292
|
+
? onWsUrlChange(e.target.value)
|
|
293
|
+
: onBaseUrlChange(e.target.value), disabled: selectedAgentId !== 'new-agent', placeholder: transport === 'acp'
|
|
294
|
+
? 'ws://localhost:8000/api/v1/acp/ws'
|
|
295
|
+
: 'http://localhost:8000', sx: { width: '100%' } }), _jsx(FormControl.Caption, { children: transport === 'acp'
|
|
296
|
+
? 'The WebSocket endpoint of your agent-runtimes server'
|
|
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: {
|
|
130
298
|
marginBottom: 3,
|
|
131
299
|
padding: 3,
|
|
132
300
|
border: '1px solid',
|
|
133
301
|
borderColor: 'border.default',
|
|
134
302
|
borderRadius: 2,
|
|
135
303
|
backgroundColor: 'canvas.default',
|
|
136
|
-
}, children: [
|
|
137
|
-
|
|
138
|
-
:
|
|
139
|
-
|
|
140
|
-
:
|
|
141
|
-
|
|
142
|
-
|
|
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: {
|
|
317
|
+
marginBottom: 3,
|
|
318
|
+
padding: 3,
|
|
319
|
+
border: '1px solid',
|
|
320
|
+
borderColor: 'border.default',
|
|
321
|
+
borderRadius: 2,
|
|
322
|
+
backgroundColor: 'canvas.default',
|
|
323
|
+
opacity: enableCodemode ? 1 : 0.5,
|
|
324
|
+
}, children: [_jsxs(Box, { sx: {
|
|
325
|
+
display: 'flex',
|
|
326
|
+
alignItems: 'center',
|
|
327
|
+
gap: 2,
|
|
328
|
+
marginBottom: 2,
|
|
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: {
|
|
143
338
|
marginBottom: 3,
|
|
144
339
|
padding: 3,
|
|
145
340
|
border: '1px solid',
|
|
@@ -151,9 +346,18 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
|
|
|
151
346
|
alignItems: 'center',
|
|
152
347
|
gap: 2,
|
|
153
348
|
marginBottom: 2,
|
|
154
|
-
}, 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 &&
|
|
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 &&
|
|
155
350
|
!configQuery.isLoading &&
|
|
156
|
-
!configQuery.isError && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No MCP servers configured." })), enableCodemode && (_jsx(Flash, { variant: "
|
|
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: {
|
|
157
361
|
display: 'flex',
|
|
158
362
|
alignItems: 'flex-start',
|
|
159
363
|
gap: 2,
|
|
@@ -161,7 +365,7 @@ export const AgentConfiguration = ({ agentLibrary, transport, extensions, wsUrl,
|
|
|
161
365
|
borderRadius: 1,
|
|
162
366
|
backgroundColor: 'canvas.subtle',
|
|
163
367
|
opacity: mcpServersDisabled || !server.isAvailable ? 0.6 : 1,
|
|
164
|
-
}, children: [_jsx(Checkbox, { checked:
|
|
368
|
+
}, children: [_jsx(Checkbox, { checked: selectedMcpServers.includes(server.id), disabled: mcpServersDisabled || !server.isAvailable, onChange: e => handleMcpServerChange(server.id, e.target.checked) }), _jsxs(Box, { sx: {
|
|
165
369
|
display: 'flex',
|
|
166
370
|
flexDirection: 'column',
|
|
167
371
|
gap: 1,
|
|
@@ -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: '
|
|
100
|
-
{ id: 2, 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'),
|
package/lib/examples/index.d.ts
CHANGED
|
@@ -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';
|
package/lib/examples/index.js
CHANGED
|
@@ -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
|
-
|
|
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,
|