@datalayer/agent-runtimes 1.0.19 → 1.0.20
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 +11 -3
- package/lib/AgentNode.js +141 -40
- package/lib/App.js +2 -2
- package/lib/agent-node/AgentNodeGallery.js +188 -25
- package/lib/api/runtimes/runtimes.d.ts +57 -0
- package/lib/api/runtimes/runtimes.js +55 -1
- package/lib/chat/Chat.d.ts +1 -1
- package/lib/chat/Chat.js +2 -2
- package/lib/chat/base/ChatBase.js +50 -13
- package/lib/chat/document/EphemeralDocument.d.ts +5 -1
- package/lib/chat/document/EphemeralDocument.js +7 -5
- package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
- package/lib/chat/header/ChatHeaderBase.js +5 -3
- package/lib/chat/messages/ChatMessageList.d.ts +19 -0
- package/lib/chat/messages/ChatMessageList.js +180 -9
- package/lib/chat/notebook/EphemeralNotebook.d.ts +5 -1
- package/lib/chat/notebook/EphemeralNotebook.js +9 -6
- package/lib/chat/prompt/InputPrompt.js +1 -1
- package/lib/chat/tools/SubagentActivity.d.ts +20 -0
- package/lib/chat/tools/SubagentActivity.js +154 -0
- package/lib/chat/tools/index.d.ts +1 -0
- package/lib/chat/tools/index.js +1 -0
- package/lib/chat/usage/TokenUsageBar.js +3 -3
- package/lib/client/AgentRuntimesClient.d.ts +5 -0
- package/lib/client/AgentsMixin.js +3 -1
- package/lib/client/mixins/RuntimesMixin.d.ts +12 -0
- package/lib/client/mixins/RuntimesMixin.js +24 -1
- package/lib/components/AgentSummary.d.ts +1 -0
- package/lib/components/AgentSummary.js +66 -10
- package/lib/components/runtimes/RuntimePickerBase.js +64 -29
- package/lib/components/runtimes/RuntimePickerCell.js +1 -1
- package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
- package/lib/components/runtimes/RuntimeSimplePicker.js +3 -2
- package/lib/components/runtimes/RuntimeUtils.js +2 -2
- package/lib/context/GraphFlowChart.js +1 -1
- package/lib/context/TokenUsageChart.js +1 -1
- package/lib/context/TurnGraphChart.js +2 -2
- package/lib/examples/A2UiAgentExample.js +4 -4
- package/lib/examples/A2UiComponentsGalleryExample.js +3 -3
- package/lib/examples/A2UiContactCardExample.js +3 -3
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/A2UiViewerExample.js +3 -3
- package/lib/examples/AgUiAgenticExample.js +3 -3
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
- package/lib/examples/AgUiHaikuGenUiExample.js +3 -3
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -5
- package/lib/examples/AgUiSharedStateExample.js +3 -3
- package/lib/examples/AgUiToolsBasedGenUiExample.js +7 -5
- package/lib/examples/AgentCheckpointsExample.js +6 -5
- package/lib/examples/{AgentSandboxExample.d.ts → AgentCodeSandboxExample.d.ts} +4 -4
- package/lib/examples/{AgentSandboxExample.js → AgentCodeSandboxExample.js} +10 -9
- package/lib/examples/AgentCodeSandboxesExample.js +2 -2
- package/lib/examples/AgentCodemodeExample.js +3 -3
- package/lib/examples/AgentCompactionExample.d.ts +12 -0
- package/lib/examples/AgentCompactionExample.js +244 -0
- package/lib/examples/AgentEvalsExample.js +10 -20
- package/lib/examples/AgentGuardrailsExample.js +2 -2
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +6 -8
- package/lib/examples/AgentLoopExample.js +3 -3
- package/lib/examples/AgentMCPExample.js +3 -3
- package/lib/examples/AgentMemoryExample.d.ts +4 -2
- package/lib/examples/AgentMemoryExample.js +93 -10
- package/lib/examples/AgentMonitoringExample.js +2 -2
- package/lib/examples/AgentNotificationsExample.js +1 -1
- package/lib/examples/AgentOtelExample.d.ts +2 -3
- package/lib/examples/AgentOtelExample.js +7 -12
- package/lib/examples/AgentOutputsExample.js +5 -5
- package/lib/examples/AgentParametersExample.js +3 -3
- package/lib/examples/AgentSkillsExample.js +4 -4
- package/lib/examples/AgentSubagentsExample.d.ts +2 -2
- package/lib/examples/AgentSubagentsExample.js +43 -34
- package/lib/examples/AgentToolApprovalsExample.js +1 -1
- package/lib/examples/AgentTriggersExample.js +9 -11
- package/lib/examples/AgentspecsExample.js +13 -5
- package/lib/examples/CellExample.d.ts +6 -0
- package/lib/examples/CellExample.js +84 -0
- package/lib/examples/ChatCustomExample.js +1 -1
- package/lib/examples/ChatExample.js +1 -1
- package/lib/examples/ChatStandaloneExample.js +2 -2
- package/lib/examples/HomeExample.js +29 -28
- package/lib/examples/Lexical2Example.js +2 -2
- package/lib/examples/LexicalAgentExample.js +1 -1
- package/lib/examples/LexicalAgentSidebarExample.js +2 -2
- package/lib/examples/NotebookAgentSidebarExample.d.ts +1 -1
- package/lib/examples/NotebookAgentSidebarExample.js +5 -4
- package/lib/examples/NotebookCollaborationExample.js +3 -3
- package/lib/examples/NotebookExample.js +2 -2
- package/lib/examples/components/ExampleWrapper.js +5 -0
- package/lib/examples/components/Header.js +2 -2
- package/lib/examples/components/HeaderControls.js +1 -1
- package/lib/examples/components/LexicalEditor.js +1 -1
- package/lib/examples/components/MainContent.js +1 -1
- package/lib/examples/components/MockFileBrowser.js +8 -8
- package/lib/examples/components/TimeTravel.js +1 -1
- package/lib/examples/components/haiku/HaikuDisplay.js +2 -2
- package/lib/examples/example-selector.js +4 -3
- package/lib/examples/hooks/useExampleAgentRuntime.js +11 -1
- package/lib/examples/hooks/useExampleAgentRuntimes.d.ts +7 -0
- package/lib/examples/hooks/useExampleAgentRuntimes.js +82 -0
- package/lib/examples/index.d.ts +2 -1
- package/lib/examples/index.js +2 -1
- package/lib/examples/main.js +359 -46
- package/lib/examples/utils/agentSummaryStore.d.ts +17 -0
- package/lib/examples/utils/themedProvider.js +32 -2
- package/lib/examples/utils/useExampleAgentRuntimesUrl.js +2 -1
- package/lib/examples2/NotebookMutationsKernel.js +6 -3
- package/lib/examples2/NotebookMutationsServiceManager.js +6 -3
- package/lib/examples2/ReactRouterExample.js +5 -5
- package/lib/examples2/main.js +38 -0
- package/lib/hooks/useAIAgentsWebSocket.js +35 -0
- package/lib/hooks/useAgentRuntimes.d.ts +22 -0
- package/lib/hooks/useAgentRuntimes.js +192 -5
- package/lib/hooks/useCheckpoints.js +2 -2
- package/lib/hooks/useToolApprovals.d.ts +10 -4
- package/lib/hooks/useToolApprovals.js +11 -5
- package/lib/models/Runtime.d.ts +10 -8
- package/lib/models/RuntimeDTO.d.ts +5 -3
- package/lib/models/RuntimeDTO.js +3 -3
- package/lib/runtimes/actions.js +3 -1
- package/lib/runtimes/apis.d.ts +7 -0
- package/lib/specs/agents/agents.d.ts +51 -0
- package/lib/specs/agents/agents.js +3389 -94
- package/lib/specs/models.d.ts +2 -0
- package/lib/specs/models.js +37 -0
- package/lib/stores/agentRuntimeStore.d.ts +32 -1
- package/lib/stores/agentRuntimeStore.js +65 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -1
- package/lib/types/agents.d.ts +9 -3
- package/lib/types/agentspecs.d.ts +2 -0
- package/lib/types/chat.d.ts +12 -0
- package/lib/types/models.d.ts +5 -0
- package/lib/types/stream.d.ts +58 -1
- package/package.json +4 -4
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_agents.py +7 -0
- package/scripts/codegen/generate_models.py +22 -9
- package/scripts/gen_workers.py +340 -0
- package/lib/examples/CellSimpleExample.d.ts +0 -6
- package/lib/examples/CellSimpleExample.js +0 -20
|
@@ -6,8 +6,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
/**
|
|
7
7
|
* AgentMemoryExample
|
|
8
8
|
*
|
|
9
|
-
* Demonstrates
|
|
10
|
-
*
|
|
9
|
+
* Demonstrates durable agent memory.
|
|
10
|
+
* Uses a local SQLite store for local runs (offline, no API key) and
|
|
11
|
+
* pgvector-backed Mem0 (PostgreSQL) for cloud runs when server-side
|
|
12
|
+
* postgres env is configured.
|
|
11
13
|
*
|
|
12
14
|
* The left panel shows a standard Chat. The right panel shows the
|
|
13
15
|
* agent's memory contents (fetched from the runtime sidecar) and lets
|
|
@@ -17,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
19
|
import { useEffect, useState, useCallback, useRef } from 'react';
|
|
18
20
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
19
21
|
import { Text, Button, Spinner, TextInput, Heading, Label, Flash, } from '@primer/react';
|
|
20
|
-
import { SearchIcon, DatabaseIcon } from '@primer/octicons-react';
|
|
22
|
+
import { SearchIcon, DatabaseIcon, ListUnorderedIcon, } from '@primer/octicons-react';
|
|
21
23
|
import { Box } from '@datalayer/primer-addons';
|
|
22
24
|
import { AuthRequiredView, ErrorView } from './components';
|
|
23
25
|
import { ThemedProvider } from './utils/themedProvider';
|
|
@@ -25,7 +27,9 @@ import { uniqueAgentId } from './utils/agentId';
|
|
|
25
27
|
const queryClient = new QueryClient();
|
|
26
28
|
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
27
29
|
import { Chat } from '../chat';
|
|
30
|
+
import { listRuntimeMemories } from '../api/runtimes/runtimes';
|
|
28
31
|
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
32
|
+
import { useRuntimeTargetStore } from './utils/runtimeTargetStore';
|
|
29
33
|
// ─── Constants ─────────────────────────────────────────────────────────────
|
|
30
34
|
const AGENT_NAME = 'memory-example-agent';
|
|
31
35
|
const AGENTSPEC_ID = 'example-memory';
|
|
@@ -34,13 +38,17 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
34
38
|
const { token } = useSimpleAuthStore();
|
|
35
39
|
const agentName = useRef(uniqueAgentId(AGENT_NAME)).current;
|
|
36
40
|
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
41
|
+
const runtimeTarget = useRuntimeTargetStore(state => state.target);
|
|
37
42
|
const [runtimeStatus, setRuntimeStatus] = useState('launching');
|
|
38
43
|
const [isReady, setIsReady] = useState(false);
|
|
39
44
|
const [hookError, setHookError] = useState(null);
|
|
40
45
|
const [agentId, setAgentId] = useState(agentName);
|
|
41
46
|
const [memories, setMemories] = useState([]);
|
|
47
|
+
const [accountMemories, setAccountMemories] = useState([]);
|
|
48
|
+
const [accountMemoriesError, setAccountMemoriesError] = useState(null);
|
|
42
49
|
const [searchQuery, setSearchQuery] = useState('');
|
|
43
50
|
const [searchResults, setSearchResults] = useState([]);
|
|
51
|
+
const [searchAttempted, setSearchAttempted] = useState(false);
|
|
44
52
|
const [searching, setSearching] = useState(false);
|
|
45
53
|
const podName = isReady ? `local:${agentId}` : '(launching…)';
|
|
46
54
|
// Authenticated fetch helper (for sidecar endpoints)
|
|
@@ -63,10 +71,11 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
63
71
|
method: 'POST',
|
|
64
72
|
body: JSON.stringify({
|
|
65
73
|
name: agentName,
|
|
66
|
-
description: 'Agent with
|
|
74
|
+
description: 'Agent with persistent memory',
|
|
67
75
|
agent_library: 'pydantic-ai',
|
|
68
76
|
transport: 'vercel-ai',
|
|
69
77
|
agent_spec_id: AGENTSPEC_ID,
|
|
78
|
+
memory: runtimeTarget === 'local' ? 'sqlite' : 'mem0',
|
|
70
79
|
enable_skills: true,
|
|
71
80
|
tools: [],
|
|
72
81
|
}),
|
|
@@ -110,7 +119,7 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
110
119
|
return () => {
|
|
111
120
|
isCancelled = true;
|
|
112
121
|
};
|
|
113
|
-
}, [agentBaseUrl, agentName, authFetch]);
|
|
122
|
+
}, [agentBaseUrl, agentName, authFetch, runtimeTarget]);
|
|
114
123
|
// ── Fetch memory list ────────────────────────────────────────────────────
|
|
115
124
|
const fetchMemories = useCallback(async () => {
|
|
116
125
|
if (!isReady || !agentBaseUrl)
|
|
@@ -133,10 +142,48 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
133
142
|
return () => clearInterval(interval);
|
|
134
143
|
}
|
|
135
144
|
}, [isReady, fetchMemories]);
|
|
145
|
+
const fetchAccountMemories = useCallback(async () => {
|
|
146
|
+
if (!isReady || !agentBaseUrl || !token) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
const response = await listRuntimeMemories(token, { agentId: agentId, limit: 10 }, agentBaseUrl);
|
|
151
|
+
const normalized = (response.memories || []).map((item) => ({
|
|
152
|
+
id: String(item?.id || ''),
|
|
153
|
+
content: String(item?.memory || ''),
|
|
154
|
+
score: typeof item?.score === 'number' ? item.score : undefined,
|
|
155
|
+
metadata: item?.metadata && typeof item.metadata === 'object'
|
|
156
|
+
? item.metadata
|
|
157
|
+
: undefined,
|
|
158
|
+
}));
|
|
159
|
+
setAccountMemories(normalized);
|
|
160
|
+
setAccountMemoriesError(null);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
setAccountMemories([]);
|
|
164
|
+
const rawMessage = String(error?.message || '');
|
|
165
|
+
const isMissingEndpoint = /404|not\s*found/i.test(rawMessage);
|
|
166
|
+
setAccountMemoriesError(isMissingEndpoint
|
|
167
|
+
? 'Runtimes memory API endpoint is not available in this environment (expected in local example-only mode).'
|
|
168
|
+
: rawMessage ||
|
|
169
|
+
'Runtimes memory API is not available in this environment.');
|
|
170
|
+
}
|
|
171
|
+
}, [agentBaseUrl, agentId, isReady, token]);
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
if (!isReady) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
void fetchAccountMemories();
|
|
177
|
+
const interval = setInterval(() => {
|
|
178
|
+
void fetchAccountMemories();
|
|
179
|
+
}, 15_000);
|
|
180
|
+
return () => clearInterval(interval);
|
|
181
|
+
}, [fetchAccountMemories, isReady]);
|
|
136
182
|
// ── Search memory ────────────────────────────────────────────────────────
|
|
137
183
|
const handleSearch = useCallback(async () => {
|
|
138
184
|
if (!isReady || !agentBaseUrl || !searchQuery.trim())
|
|
139
185
|
return;
|
|
186
|
+
setSearchAttempted(true);
|
|
140
187
|
setSearching(true);
|
|
141
188
|
try {
|
|
142
189
|
const res = await authFetch(`${agentBaseUrl}/api/v1/agents/${agentId}/memory/search`, {
|
|
@@ -147,14 +194,25 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
147
194
|
const data = await res.json();
|
|
148
195
|
setSearchResults(Array.isArray(data) ? data : (data.results ?? []));
|
|
149
196
|
}
|
|
197
|
+
else {
|
|
198
|
+
setSearchResults([]);
|
|
199
|
+
}
|
|
150
200
|
}
|
|
151
201
|
catch {
|
|
152
202
|
// Endpoint may not exist yet
|
|
203
|
+
setSearchResults([]);
|
|
153
204
|
}
|
|
154
205
|
finally {
|
|
155
206
|
setSearching(false);
|
|
156
207
|
}
|
|
157
208
|
}, [isReady, agentBaseUrl, agentId, searchQuery, authFetch]);
|
|
209
|
+
// ── List all memories (clears any active search) ──────────────────────────
|
|
210
|
+
const handleListAll = useCallback(() => {
|
|
211
|
+
setSearchQuery('');
|
|
212
|
+
setSearchResults([]);
|
|
213
|
+
setSearchAttempted(false);
|
|
214
|
+
void fetchMemories();
|
|
215
|
+
}, [fetchMemories]);
|
|
158
216
|
// ── Loading state ────────────────────────────────────────────────────────
|
|
159
217
|
if (!isReady && runtimeStatus !== 'error') {
|
|
160
218
|
return (_jsxs(Box, { sx: {
|
|
@@ -164,6 +222,7 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
164
222
|
justifyContent: 'center',
|
|
165
223
|
height: '100%',
|
|
166
224
|
gap: 3,
|
|
225
|
+
bg: 'canvas.default',
|
|
167
226
|
}, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Launching local memory-enabled agent\u2026" })] }));
|
|
168
227
|
}
|
|
169
228
|
if (runtimeStatus === 'error' || hookError) {
|
|
@@ -174,6 +233,7 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
174
233
|
height: '100%',
|
|
175
234
|
display: 'flex',
|
|
176
235
|
flexDirection: 'column',
|
|
236
|
+
bg: 'canvas.default',
|
|
177
237
|
}, children: [_jsxs(Box, { sx: {
|
|
178
238
|
display: 'flex',
|
|
179
239
|
alignItems: 'center',
|
|
@@ -188,7 +248,7 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
188
248
|
minWidth: 0,
|
|
189
249
|
borderRight: '1px solid',
|
|
190
250
|
borderColor: 'border.default',
|
|
191
|
-
}, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Memory Agent", brandIcon: _jsx(DatabaseIcon, { size: 16 }), placeholder: "Chat \u2014 the agent remembers you across sessions\u2026", description: "Agent with
|
|
251
|
+
}, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Memory Agent", brandIcon: _jsx(DatabaseIcon, { size: 16 }), placeholder: "Chat \u2014 the agent remembers you across sessions\u2026", description: "Agent with persistent memory", showHeader: true, kernelIndicatorPlacement: "right", showTokenUsage: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
192
252
|
{
|
|
193
253
|
title: 'Remember',
|
|
194
254
|
message: 'My favourite colour is midnight blue.',
|
|
@@ -203,13 +263,15 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
203
263
|
flexShrink: 0,
|
|
204
264
|
display: 'flex',
|
|
205
265
|
flexDirection: 'column',
|
|
206
|
-
bg: 'canvas.
|
|
266
|
+
bg: 'canvas.default',
|
|
207
267
|
}, children: [_jsxs(Box, { sx: {
|
|
208
268
|
px: 3,
|
|
209
269
|
py: 2,
|
|
210
270
|
borderBottom: '1px solid',
|
|
211
271
|
borderColor: 'border.default',
|
|
212
|
-
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(DatabaseIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2 }, children: "Memory Inspector" })] }), _jsx(Label, { variant: "accent", sx: { mb: 2 }, children:
|
|
272
|
+
}, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(DatabaseIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2 }, children: "Memory Inspector" })] }), _jsx(Label, { variant: "accent", sx: { mb: 2 }, children: runtimeTarget === 'local'
|
|
273
|
+
? 'SQLite backend (local, persistent)'
|
|
274
|
+
: 'Mem0 pgvector backend (cloud)' }), _jsx(Flash, { variant: "default", sx: { fontSize: 0, mt: 2 }, children: "Memory persistence conditions: for local runs the agent uses a durable SQLite store; for cloud runs it uses Mem0. Durable facts are saved when the model emits a remember action (not every turn)." }), _jsxs(Box, { sx: { display: 'flex', gap: 1, mt: 2 }, children: [_jsx(TextInput, { size: "small", value: searchQuery, onChange: e => setSearchQuery(e.target.value), placeholder: "Search agent memory\u2026", sx: { flex: 1 }, onKeyDown: e => e.key === 'Enter' && handleSearch() }), _jsx(Button, { size: "small", leadingVisual: SearchIcon, onClick: handleSearch, disabled: searching, children: searching ? _jsx(Spinner, { size: "small" }) : 'Search' }), _jsx(Button, { size: "small", leadingVisual: ListUnorderedIcon, onClick: handleListAll, children: "List all" })] })] }), searchResults.length > 0 && (_jsxs(Box, { sx: {
|
|
213
275
|
px: 3,
|
|
214
276
|
py: 2,
|
|
215
277
|
borderBottom: '1px solid',
|
|
@@ -227,7 +289,15 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
227
289
|
border: '1px solid',
|
|
228
290
|
borderColor: 'border.muted',
|
|
229
291
|
fontSize: 0,
|
|
230
|
-
}, children: [_jsx(Text, { sx: { display: 'block' }, children: entry.content }), entry.score != null && (_jsxs(Text, { sx: { color: 'fg.muted', fontSize: '10px' }, children: ["score: ", entry.score.toFixed(3)] }))] }, entry.id || i)))] })),
|
|
292
|
+
}, children: [_jsx(Text, { sx: { display: 'block' }, children: entry.content }), entry.score != null && (_jsxs(Text, { sx: { color: 'fg.muted', fontSize: '10px' }, children: ["score: ", entry.score.toFixed(3)] }))] }, entry.id || i)))] })), searchAttempted &&
|
|
293
|
+
!searching &&
|
|
294
|
+
searchQuery.trim() &&
|
|
295
|
+
searchResults.length === 0 && (_jsx(Box, { sx: {
|
|
296
|
+
px: 3,
|
|
297
|
+
py: 2,
|
|
298
|
+
borderBottom: '1px solid',
|
|
299
|
+
borderColor: 'border.default',
|
|
300
|
+
}, children: _jsx(Flash, { variant: "default", sx: { fontSize: 0 }, children: "No matching memories found for this query yet." }) })), _jsxs(Box, { sx: { flex: 1, overflow: 'auto', px: 3, py: 2 }, children: [_jsxs(Box, { sx: {
|
|
231
301
|
display: 'flex',
|
|
232
302
|
alignItems: 'center',
|
|
233
303
|
justifyContent: 'space-between',
|
|
@@ -240,7 +310,20 @@ const AgentMemoryInner = ({ onLogout }) => {
|
|
|
240
310
|
border: '1px solid',
|
|
241
311
|
borderColor: 'border.muted',
|
|
242
312
|
fontSize: 0,
|
|
243
|
-
}, children: _jsx(Text, { sx: { display: 'block' }, children: entry.content }) }, entry.id || i))))
|
|
313
|
+
}, children: _jsx(Text, { sx: { display: 'block' }, children: entry.content }) }, entry.id || i)))), _jsxs(Box, { sx: { mt: 3 }, children: [_jsx(Text, { sx: {
|
|
314
|
+
fontWeight: 'semibold',
|
|
315
|
+
fontSize: 0,
|
|
316
|
+
display: 'block',
|
|
317
|
+
mb: 2,
|
|
318
|
+
}, children: "Runtimes API (account scoped)" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block', mb: 2 }, children: "Uses listRuntimeMemories against /api/runtimes/v1/memories. This endpoint is only available when the runtimes service is configured; local example-only runs may return Not Found." }), accountMemoriesError ? (_jsx(Flash, { variant: "warning", sx: { fontSize: 0, mb: 2 }, children: accountMemoriesError })) : null, accountMemories.length === 0 ? (_jsx(Flash, { variant: "default", sx: { fontSize: 0 }, children: "No runtime memories returned." })) : (accountMemories.map((entry, i) => (_jsx(Box, { sx: {
|
|
319
|
+
p: 2,
|
|
320
|
+
mb: 1,
|
|
321
|
+
bg: 'canvas.default',
|
|
322
|
+
borderRadius: 2,
|
|
323
|
+
border: '1px solid',
|
|
324
|
+
borderColor: 'border.muted',
|
|
325
|
+
fontSize: 0,
|
|
326
|
+
}, children: _jsx(Text, { sx: { display: 'block' }, children: entry.content }) }, `runtime-${entry.id || i}`))))] })] })] })] })] }));
|
|
244
327
|
};
|
|
245
328
|
// ─── Sync token to core IAM store ──────────────────────────────────────────
|
|
246
329
|
const syncTokenToIamStore = (token) => {
|
|
@@ -65,7 +65,7 @@ const AgentMonitoringInner = ({ onLogout, }) => {
|
|
|
65
65
|
configuration?.datalayerUrl ||
|
|
66
66
|
OTEL_BASE_URL_ENV ||
|
|
67
67
|
DATALAYER_URL_ENV ||
|
|
68
|
-
|
|
68
|
+
agentBaseUrl;
|
|
69
69
|
const podName = agentId;
|
|
70
70
|
// The OTEL service_name resource attribute is 'agent-runtimes' (the
|
|
71
71
|
// application name), NOT the individual agent ID. Use the correct value
|
|
@@ -337,7 +337,7 @@ const AgentMonitoringInner = ({ onLogout, }) => {
|
|
|
337
337
|
fontSize: 0,
|
|
338
338
|
mt: 1,
|
|
339
339
|
display: 'block',
|
|
340
|
-
}, children: ["Last close: ", monitorSocket.lastClose.detail] }))] }))] })] }), _jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Monitoring Agent", brandIcon: _jsx(GraphIcon, { size: 16 }), placeholder: "Ask for cost, token usage, and turn-level monitoring insights...", description: `${alerts.length} active alert${alerts.length !== 1 ? 's' : ''}`, showHeader: true, showTokenUsage: true, showToolsMenu: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
340
|
+
}, children: ["Last close: ", monitorSocket.lastClose.detail] }))] }))] })] }), _jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Monitoring Agent", brandIcon: _jsx(GraphIcon, { size: 16 }), placeholder: "Ask for cost, token usage, and turn-level monitoring insights...", description: `${alerts.length} active alert${alerts.length !== 1 ? 's' : ''}`, showHeader: true, kernelIndicatorPlacement: "right", showTokenUsage: true, showToolsMenu: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
341
341
|
{
|
|
342
342
|
title: '▶ No-tool turn',
|
|
343
343
|
message: 'Briefly introduce yourself without calling any tool or skill — produces a linear Start → Model → Decision → End graph.',
|
|
@@ -250,7 +250,7 @@ const AgentNotificationsInner = ({ onLogout, }) => {
|
|
|
250
250
|
borderBottom: '1px solid',
|
|
251
251
|
borderColor: 'border.default',
|
|
252
252
|
flexShrink: 0,
|
|
253
|
-
}, children: [_jsx(BellIcon, { size: 16 }), _jsxs(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: ["Notifications \u2014 ", podName] }), unreadCount > 0 && (_jsxs(Label, { variant: "accent", size: "small", children: [unreadCount, " unread"] }))] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Notification Agent", brandIcon: _jsx(BellIcon, { size: 16 }), placeholder: "Ask the agent to send you notifications\u2026", description: `${unreadCount} unread notification${unreadCount !== 1 ? 's' : ''}`, showHeader: true, autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
253
|
+
}, children: [_jsx(BellIcon, { size: 16 }), _jsxs(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: ["Notifications \u2014 ", podName] }), unreadCount > 0 && (_jsxs(Label, { variant: "accent", size: "small", children: [unreadCount, " unread"] }))] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, title: "Notification Agent", brandIcon: _jsx(BellIcon, { size: 16 }), placeholder: "Ask the agent to send you notifications\u2026", description: `${unreadCount} unread notification${unreadCount !== 1 ? 's' : ''}`, showHeader: true, kernelIndicatorPlacement: "right", autoFocus: true, height: "100%", runtimeId: podName, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
254
254
|
{
|
|
255
255
|
title: 'Alert me',
|
|
256
256
|
message: 'Notify me when KPIs drop below threshold',
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The OTEL backend is configured via `configuration.otelUrl` when available
|
|
11
11
|
* (falling back to `configuration.datalayerUrl`, then `VITE_OTEL_BASE_URL`, then
|
|
12
|
-
* `VITE_DATALAYER_URL`, then
|
|
13
|
-
* Agent routes
|
|
14
|
-
* direct run URL to avoid proxy-relative calls.
|
|
12
|
+
* `VITE_DATALAYER_URL`, then the resolved runtime base URL).
|
|
13
|
+
* Agent routes resolve from the shared local/cloud runtime target hook.
|
|
15
14
|
*
|
|
16
15
|
* For Python-side observability, wire in `agent_runtimes/otel.py`:
|
|
17
16
|
* from agent_runtimes.otel import setup_otel
|
|
@@ -14,9 +14,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
*
|
|
15
15
|
* The OTEL backend is configured via `configuration.otelUrl` when available
|
|
16
16
|
* (falling back to `configuration.datalayerUrl`, then `VITE_OTEL_BASE_URL`, then
|
|
17
|
-
* `VITE_DATALAYER_URL`, then
|
|
18
|
-
* Agent routes
|
|
19
|
-
* direct run URL to avoid proxy-relative calls.
|
|
17
|
+
* `VITE_DATALAYER_URL`, then the resolved runtime base URL).
|
|
18
|
+
* Agent routes resolve from the shared local/cloud runtime target hook.
|
|
20
19
|
*
|
|
21
20
|
* For Python-side observability, wire in `agent_runtimes/otel.py`:
|
|
22
21
|
* from agent_runtimes.otel import setup_otel
|
|
@@ -32,17 +31,13 @@ import { useCoreStore } from '@datalayer/core';
|
|
|
32
31
|
import { ThemedProvider } from './utils/themedProvider';
|
|
33
32
|
import { AuthRequiredView } from './components';
|
|
34
33
|
import { ChatSidebar } from '../chat';
|
|
34
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
35
35
|
// ─── Environment / defaults ────────────────────────────────────────────────
|
|
36
36
|
const OTEL_BASE_URL_ENV = import.meta.env.VITE_OTEL_BASE_URL ?? '';
|
|
37
37
|
// Consume-side OTEL override (DATALAYER_OTEL_IN_URL). When set, telemetry is
|
|
38
38
|
// read from here instead of VITE_OTEL_BASE_URL (e.g. prod during local dev).
|
|
39
39
|
const OTEL_IN_BASE_URL_ENV = import.meta.env.VITE_OTEL_IN_BASE_URL ?? '';
|
|
40
40
|
const DATALAYER_URL_ENV = import.meta.env.VITE_DATALAYER_URL ?? '';
|
|
41
|
-
/**
|
|
42
|
-
* Base URL of the agent-runtimes server.
|
|
43
|
-
* Defaults to proxy-relative calls when VITE_BASE_URL is unset.
|
|
44
|
-
*/
|
|
45
|
-
const AGENT_BASE_URL_ENV = import.meta.env.VITE_BASE_URL || '';
|
|
46
41
|
const DEFAULT_AGENT_PROTOCOL = 'vercel-ai';
|
|
47
42
|
const DEFAULT_AGENT_LIBRARY = 'pydantic-ai';
|
|
48
43
|
/** Spec id this example always launches. */
|
|
@@ -123,7 +118,7 @@ const AgentLaunchPanel = ({ baseUrl, onConnected, onDisconnected, isConnected, c
|
|
|
123
118
|
flexDirection: 'column',
|
|
124
119
|
gap: 2,
|
|
125
120
|
flexShrink: 0,
|
|
126
|
-
bg: 'canvas.
|
|
121
|
+
bg: 'canvas.default',
|
|
127
122
|
}, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "AGENT" }), loading ? (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Spinner, { size: "small" }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: ["Launching ", AGENTSPEC_ID, "\u2026"] })] })) : error ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: error }), _jsx(Button, { variant: "primary", size: "small", onClick: handleLaunch, leadingVisual: PlugIcon, sx: { width: '100%' }, children: "Retry" })] })) : (_jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: ["Launching ", AGENTSPEC_ID, "\u2026"] }))] }));
|
|
128
123
|
};
|
|
129
124
|
const TAB_SX = (active) => ({
|
|
@@ -139,15 +134,15 @@ const TAB_SX = (active) => ({
|
|
|
139
134
|
});
|
|
140
135
|
const AgentOtelExampleInner = ({ token }) => {
|
|
141
136
|
const { configuration } = useCoreStore();
|
|
137
|
+
const agentBaseUrl = useExampleAgentRuntimesUrl();
|
|
142
138
|
const resolvedUrl = configuration?.otelInUrl ||
|
|
143
139
|
OTEL_IN_BASE_URL_ENV ||
|
|
144
140
|
configuration?.otelUrl ||
|
|
145
141
|
configuration?.datalayerUrl ||
|
|
146
142
|
OTEL_BASE_URL_ENV ||
|
|
147
143
|
DATALAYER_URL_ENV ||
|
|
148
|
-
|
|
144
|
+
agentBaseUrl;
|
|
149
145
|
const otelBaseUrl = resolvedUrl;
|
|
150
|
-
const agentBaseUrl = AGENT_BASE_URL_ENV;
|
|
151
146
|
// ── OTEL view state ─────────────────────────────────────────────
|
|
152
147
|
const [view, setView] = useState('dashboard');
|
|
153
148
|
const signalSetterRef = useRef(null);
|
|
@@ -241,7 +236,7 @@ const AgentOtelExampleInner = ({ token }) => {
|
|
|
241
236
|
flex: 1,
|
|
242
237
|
minHeight: 0,
|
|
243
238
|
overflow: 'hidden',
|
|
244
|
-
}, children: view === 'dashboard' ? (_jsx(DashboardView, { baseUrl: otelBaseUrl, wsBaseUrl: otelBaseUrl, token: token, autoRefreshMs: 5000, defaultSignal: "traces", limit: 200, onSignalRef: handleSignalRef })) : view === 'sql' ? (_jsx(SqlView, { baseUrl: otelBaseUrl, token: token })) : (_jsx(SystemView, { baseUrl: otelBaseUrl, token: token })) })] }), _jsx(ChatSidebar, { title: "AI Agent", protocol: protocolConfig, position: "right", width: 380, defaultOpen: true, showNewChatButton: true, showClearButton: true, showSettingsButton: false, clickOutsideToClose: false, placeholder: "Ask the agent about your telemetry data\u2026", description: "Connect an agent to start chatting about your traces, logs, and metrics.", panelProps: protocolConfig
|
|
239
|
+
}, children: view === 'dashboard' ? (_jsx(DashboardView, { baseUrl: otelBaseUrl, wsBaseUrl: otelBaseUrl, token: token, autoRefreshMs: 5000, defaultSignal: "traces", limit: 200, onSignalRef: handleSignalRef })) : view === 'sql' ? (_jsx(SqlView, { baseUrl: otelBaseUrl, token: token })) : (_jsx(SystemView, { baseUrl: otelBaseUrl, token: token })) })] }), _jsx(ChatSidebar, { kernelIndicatorPlacement: "right", title: "AI Agent", protocol: protocolConfig, position: "right", width: 380, defaultOpen: true, showNewChatButton: true, showClearButton: true, showSettingsButton: false, clickOutsideToClose: false, placeholder: "Ask the agent about your telemetry data\u2026", description: "Connect an agent to start chatting about your traces, logs, and metrics.", panelProps: protocolConfig
|
|
245
240
|
? {
|
|
246
241
|
protocol: protocolConfig,
|
|
247
242
|
useStore: true,
|
|
@@ -227,7 +227,7 @@ const MarkdownTable = ({ source }) => {
|
|
|
227
227
|
whiteSpace: 'normal',
|
|
228
228
|
wordBreak: 'break-word',
|
|
229
229
|
},
|
|
230
|
-
th: { bg: 'canvas.
|
|
230
|
+
th: { bg: 'canvas.default', fontWeight: 'bold' },
|
|
231
231
|
}, children: [_jsx("thead", { children: _jsx("tr", { children: headers.map((h, i) => (_jsx("th", { children: h }, i))) }) }), _jsx("tbody", { children: rows.map((r, i) => (_jsx("tr", { children: r.map((c, j) => (_jsx("td", { children: c }, j))) }, i))) })] }) }));
|
|
232
232
|
};
|
|
233
233
|
// ─── Chart renderer (lazy ECharts) ─────────────────────────────────────────
|
|
@@ -264,7 +264,7 @@ const ChartView = ({ source }) => {
|
|
|
264
264
|
fontFamily: 'mono',
|
|
265
265
|
fontSize: 0,
|
|
266
266
|
whiteSpace: 'pre-wrap',
|
|
267
|
-
bg: 'canvas.
|
|
267
|
+
bg: 'canvas.default',
|
|
268
268
|
p: 2,
|
|
269
269
|
borderRadius: 2,
|
|
270
270
|
m: 0,
|
|
@@ -439,7 +439,7 @@ const AgentOutputsInner = ({ onLogout, }) => {
|
|
|
439
439
|
borderBottom: '1px solid',
|
|
440
440
|
borderColor: 'border.default',
|
|
441
441
|
flexShrink: 0,
|
|
442
|
-
}, children: [_jsx(TableIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Agent Outputs \u2014 Local Runtime" })] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Outputs Demo Agent", brandIcon: _jsx(FileIcon, { size: 16 }), placeholder: "Ask for a Table, JSON, Chart, or File\u2026", description: `${detected.length} detected output${detected.length !== 1 ? 's' : ''}`, showHeader: true, showToolsMenu: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
442
|
+
}, children: [_jsx(TableIcon, { size: 16 }), _jsx(Heading, { as: "h3", sx: { fontSize: 2, flex: 1 }, children: "Agent Outputs \u2014 Local Runtime" })] }), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: "Outputs Demo Agent", brandIcon: _jsx(FileIcon, { size: 16 }), placeholder: "Ask for a Table, JSON, Chart, or File\u2026", description: `${detected.length} detected output${detected.length !== 1 ? 's' : ''}`, showHeader: true, kernelIndicatorPlacement: "right", showToolsMenu: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, suggestions: [
|
|
443
443
|
{
|
|
444
444
|
title: 'Table',
|
|
445
445
|
message: 'Generate a Markdown table of the top 5 US cities by population, with columns City, State, Population.',
|
|
@@ -497,7 +497,7 @@ const AgentOutputsInner = ({ onLogout, }) => {
|
|
|
497
497
|
mb: 2,
|
|
498
498
|
gap: 2,
|
|
499
499
|
}, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: d.filename ?? `${d.tab} output` }), _jsx(Label, { size: "small", variant: "secondary", children: d.tab })] }), d.tab === 'table' && _jsx(MarkdownTable, { source: d.payload }), d.tab === 'json' && (_jsx(Box, { as: "pre", sx: {
|
|
500
|
-
bg: 'canvas.
|
|
500
|
+
bg: 'canvas.default',
|
|
501
501
|
p: 2,
|
|
502
502
|
borderRadius: 2,
|
|
503
503
|
fontFamily: 'mono',
|
|
@@ -514,7 +514,7 @@ const AgentOutputsInner = ({ onLogout, }) => {
|
|
|
514
514
|
return d.payload;
|
|
515
515
|
}
|
|
516
516
|
})() })), d.tab === 'chart' && _jsx(ChartView, { source: d.payload }), d.tab === 'files' && (_jsxs(_Fragment, { children: [_jsx(Box, { as: "pre", sx: {
|
|
517
|
-
bg: 'canvas.
|
|
517
|
+
bg: 'canvas.default',
|
|
518
518
|
p: 2,
|
|
519
519
|
borderRadius: 2,
|
|
520
520
|
fontFamily: 'mono',
|
|
@@ -189,7 +189,7 @@ const AgentParametersExample = () => {
|
|
|
189
189
|
display: 'flex',
|
|
190
190
|
flexDirection: 'column',
|
|
191
191
|
gap: 2,
|
|
192
|
-
bg: 'canvas.
|
|
192
|
+
bg: 'canvas.default',
|
|
193
193
|
}, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "CONFIGURE AGENT" }), _jsx(Heading, { as: "h2", sx: { fontSize: 2 }, children: "Launch Parameterized Agent" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1, maxWidth: 620 }, children: "Load the runtime schema directly from example-parameters, fill the generated form, then launch with validated parameters." }), _jsxs(Box, { sx: {
|
|
194
194
|
display: 'flex',
|
|
195
195
|
alignItems: 'center',
|
|
@@ -207,7 +207,7 @@ const AgentParametersExample = () => {
|
|
|
207
207
|
border: '1px solid',
|
|
208
208
|
borderColor: 'border.default',
|
|
209
209
|
borderRadius: 2,
|
|
210
|
-
bg: 'canvas.
|
|
210
|
+
bg: 'canvas.default',
|
|
211
211
|
}, children: [_jsxs(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: ["Required fields:", ' ', Array.isArray(schema.required) ? schema.required.length : 0] }), _jsx(Label, { variant: hasRequired ? 'success' : 'attention', children: hasRequired ? 'Ready to launch' : 'Complete required fields' })] })), showSchemaForm && schema && (_jsx(Box, { sx: {
|
|
212
212
|
border: '1px solid',
|
|
213
213
|
borderColor: 'border.default',
|
|
@@ -222,7 +222,7 @@ const AgentParametersExample = () => {
|
|
|
222
222
|
event?.stopPropagation();
|
|
223
223
|
}, noHtml5Validate: true }) })), _jsx(Button, { variant: "primary", size: "small", type: "button", onClick: launchAgent, disabled: !canLaunch || isCreating, sx: { width: '100%' }, children: isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : ('Launch Agent') }), schema && formTouched && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Parameters are sent as agent_parameters in the create-agent request." })), effectiveError && (_jsx(ErrorView, { error: "Launch failed", detail: effectiveError }))] }) }));
|
|
224
224
|
}
|
|
225
|
-
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, title: `Parameterized Agent: ${String(formData.project ?? 'Project')}`, brandIcon: _jsx(FileIcon, { size: 16 }), placeholder: "Ask something about your configured project...", description: `Role: ${String(formData.role ?? 'n/a')} · Tone: ${String(formData.tone ?? 'n/a')}`, showHeader: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", runtimeId: agentId, historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
225
|
+
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, title: `Parameterized Agent: ${String(formData.project ?? 'Project')}`, brandIcon: _jsx(FileIcon, { size: 16 }), placeholder: "Ask something about your configured project...", description: `Role: ${String(formData.role ?? 'n/a')} · Tone: ${String(formData.tone ?? 'n/a')}`, showHeader: true, kernelIndicatorPlacement: "right", showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", runtimeId: agentId, historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
226
226
|
{
|
|
227
227
|
title: 'Print demo_params',
|
|
228
228
|
message: 'Use execute_code to print(demo_params) from the sandbox, then explain what it is.',
|
|
@@ -54,7 +54,7 @@ const SkillCard = ({ skill, onToggle, onToggleApproval }) => {
|
|
|
54
54
|
wordBreak: 'break-word',
|
|
55
55
|
m: 0,
|
|
56
56
|
p: 3,
|
|
57
|
-
bg: 'canvas.
|
|
57
|
+
bg: 'canvas.default',
|
|
58
58
|
borderRadius: 2,
|
|
59
59
|
border: '1px solid',
|
|
60
60
|
borderColor: 'border.muted',
|
|
@@ -192,7 +192,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
192
192
|
py: 1,
|
|
193
193
|
borderBottom: '1px solid',
|
|
194
194
|
borderColor: 'border.default',
|
|
195
|
-
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Skills Demo Agent`, brandIcon: _jsx(BriefcaseIcon, { size: 16 }), placeholder: "Ask the agent to use its skills...", showHeader: true, showNewChatButton: true, showClearButton: true, showTokenUsage: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsx(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: ["Skills: ", skills.length] }) }), suggestions: [
|
|
195
|
+
}, children: _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: "Agent already running - reconnected." }) })), _jsxs(Box, { sx: { flex: 1, minHeight: 0, display: 'flex' }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(Chat, { protocol: "vercel-ai", baseUrl: agentBaseUrl, agentId: agentId, authToken: chatAuthToken, title: `Skills Demo Agent`, brandIcon: _jsx(BriefcaseIcon, { size: 16 }), placeholder: "Ask the agent to use its skills...", showHeader: true, kernelIndicatorPlacement: "right", showNewChatButton: true, showClearButton: true, showTokenUsage: true, showSkillsMenu: true, autoFocus: true, height: "100%", runtimeId: agentId, historyEndpoint: `${agentBaseUrl}/api/v1/history`, headerActions: _jsx(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: ["Skills: ", skills.length] }) }), suggestions: [
|
|
196
196
|
{
|
|
197
197
|
title: 'List available skills',
|
|
198
198
|
message: 'List all your available skills and what they can do.',
|
|
@@ -233,7 +233,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
233
233
|
display: 'flex',
|
|
234
234
|
flexDirection: 'column',
|
|
235
235
|
minHeight: 0,
|
|
236
|
-
bg: 'canvas.
|
|
236
|
+
bg: 'canvas.default',
|
|
237
237
|
}, children: [_jsxs(Box, { sx: {
|
|
238
238
|
p: 2,
|
|
239
239
|
borderBottom: '1px solid',
|
|
@@ -242,7 +242,7 @@ const AgentSkillsInner = ({ onLogout }) => {
|
|
|
242
242
|
mt: 3,
|
|
243
243
|
p: 2,
|
|
244
244
|
borderRadius: 2,
|
|
245
|
-
bg: 'canvas.
|
|
245
|
+
bg: 'canvas.default',
|
|
246
246
|
border: '1px solid',
|
|
247
247
|
borderColor: 'border.muted',
|
|
248
248
|
}, children: [_jsx(Heading, { as: "h5", sx: { fontSize: 0, mb: 1 }, children: "Skill Statuses" }), _jsxs(Box, { sx: { fontSize: 0, color: 'fg.muted' }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1 }, children: [_jsx(Label, { size: "small", variant: "secondary", children: "available" }), _jsx(Text, { children: "In catalog, not yet enabled" })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1 }, children: [_jsx(Label, { size: "small", variant: "attention", children: "enabled" }), _jsx(Text, { children: "Enabled, loading pending" })] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Label, { size: "small", variant: "success", children: "loaded" }), _jsx(Text, { children: "SKILL.md loaded, in system prompt" })] })] })] })] })] })] })] }));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AgentSubagentsExample
|
|
3
3
|
*
|
|
4
|
-
* Demonstrates multi-agent delegation using subagents
|
|
4
|
+
* Demonstrates multi-agent delegation using the in-repo subagents capability.
|
|
5
5
|
* The parent agent orchestrates a researcher and a writer subagent,
|
|
6
6
|
* delegating tasks and combining results for the user.
|
|
7
7
|
*
|
|
8
|
-
* - Creates
|
|
8
|
+
* - Creates an agent from the 'example-subagents' spec on the selected target
|
|
9
9
|
* - Shows a Chat component for interacting with the orchestrator
|
|
10
10
|
* - Sidebar displays subagent info and active task status
|
|
11
11
|
*/
|