@datalayer/agent-runtimes 1.0.17 → 1.0.19
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 +3 -3
- package/lib/AgentNode.js +440 -41
- package/lib/agent-node/AgentNodeGallery.d.ts +80 -0
- package/lib/agent-node/AgentNodeGallery.js +464 -0
- package/lib/agent-notebook-main.js +0 -1
- package/lib/chat/Chat.d.ts +14 -1
- package/lib/chat/Chat.js +22 -7
- package/lib/chat/base/ChatBase.js +38 -12
- package/lib/chat/document/EphemeralDocument.d.ts +45 -1
- package/lib/chat/document/EphemeralDocument.js +135 -11
- package/lib/chat/notebook/EphemeralNotebook.d.ts +36 -1
- package/lib/chat/notebook/EphemeralNotebook.js +42 -9
- package/lib/examples/AgentCodeSandboxesExample.d.ts +3 -0
- package/lib/examples/AgentCodeSandboxesExample.js +192 -0
- package/lib/examples/example-selector.js +1 -0
- package/lib/examples/index.d.ts +1 -0
- package/lib/examples/index.js +1 -0
- package/lib/identity/AgentIdentity.js +1 -2
- package/lib/shims/primerAddonsBox.d.ts +1 -0
- package/lib/shims/primerAddonsBox.js +7 -0
- package/lib/specs/agents/agents.d.ts +8 -0
- package/lib/specs/agents/agents.js +440 -0
- package/lib/types/agentspecs.d.ts +1 -1
- package/lib/types/chat.d.ts +71 -0
- package/lib/types/config.d.ts +1 -1
- package/package.json +4 -3
- package/scripts/codegen/generate_sandbox_agents.py +145 -0
- package/scripts/codegen/__pycache__/versioning.cpython-313.pyc +0 -0
|
@@ -21,7 +21,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
21
21
|
*/
|
|
22
22
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
23
23
|
import { ServerConnection, ServiceManager } from '@jupyterlab/services';
|
|
24
|
-
import {
|
|
24
|
+
import { DatalayerThemeProvider, getThemeConfig, useSystemColorMode, useThemeStore, } from '@datalayer/primer-addons';
|
|
25
|
+
import { Box } from '@primer/react';
|
|
25
26
|
import { Notebook, NotebookToolbar, CellSidebarExtension, CellSidebarButton, JupyterReactTheme, notebookStore, disposeServiceManager, } from '@datalayer/jupyter-react';
|
|
26
27
|
import { useAgentsRuntimes } from '../../hooks/useAgentRuntimes';
|
|
27
28
|
import { registerSandboxServiceManager } from '../../services/sandboxServiceManagers';
|
|
@@ -54,7 +55,7 @@ const EPHEMERAL_NOTEBOOK_CONTENT = {
|
|
|
54
55
|
/**
|
|
55
56
|
* Renders an in-memory notebook backed by a sandbox kernel.
|
|
56
57
|
*/
|
|
57
|
-
export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargin = 120, nbformat, onNbformatChange, toolbarComponent, }) {
|
|
58
|
+
export function EphemeralNotebook({ notebookId, runtimePodName, runtimeOverride, cellSidebarMargin = 120, nbformat, onNbformatChange, toolbarComponent, collaborationProvider, }) {
|
|
58
59
|
// The `nbformat` passed to the `Notebook` component MUST stay a stable
|
|
59
60
|
// reference for the lifetime of a given `notebookId`: the underlying
|
|
60
61
|
// `useNotebookModel` hook rebuilds the notebook model (and its context /
|
|
@@ -77,18 +78,36 @@ export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargi
|
|
|
77
78
|
// notebook must bind to exactly the runtime assigned to this agent, or to
|
|
78
79
|
// none at all (straight path).
|
|
79
80
|
const { runtimes, refetchRuntimes } = useAgentsRuntimes();
|
|
80
|
-
const
|
|
81
|
+
const podResolvedRuntime = useMemo(() => {
|
|
81
82
|
const preferredPod = String(runtimePodName || '').trim();
|
|
82
83
|
if (!preferredPod) {
|
|
83
84
|
return undefined;
|
|
84
85
|
}
|
|
85
86
|
return runtimes.find(rt => String(rt?.pod_name || '') === preferredPod);
|
|
86
87
|
}, [runtimePodName, runtimes]);
|
|
88
|
+
// An explicit endpoint override wins over the pod lookup: it lets a SaaS
|
|
89
|
+
// browser bind the kernel through the runtimes tunnel proxy (the node's
|
|
90
|
+
// Jupyter server is not directly reachable, so no pod exists in the list).
|
|
91
|
+
const selectedRuntime = useMemo(() => {
|
|
92
|
+
const overrideBaseUrl = String(runtimeOverride?.baseUrl || '').trim();
|
|
93
|
+
if (overrideBaseUrl) {
|
|
94
|
+
return {
|
|
95
|
+
url: overrideBaseUrl,
|
|
96
|
+
wsUrl: String(runtimeOverride?.wsUrl || '').trim() || undefined,
|
|
97
|
+
token: String(runtimeOverride?.token || '').trim(),
|
|
98
|
+
pod_name: String(runtimeOverride?.podName || '').trim() || 'agent-node-proxy',
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return podResolvedRuntime;
|
|
102
|
+
}, [runtimeOverride, podResolvedRuntime]);
|
|
87
103
|
// While the assigned pod has not yet appeared in the runtimes list, poll the
|
|
88
104
|
// list quickly instead of waiting for the default (10s) refresh interval.
|
|
89
105
|
// This is what makes the "Starting notebook…" state clear promptly once the
|
|
90
|
-
// agent runtime is ready, rather than lingering for several seconds.
|
|
91
|
-
|
|
106
|
+
// agent runtime is ready, rather than lingering for several seconds. The
|
|
107
|
+
// override path binds immediately, so no polling is needed there.
|
|
108
|
+
const needsRuntimeLookup = Boolean(!runtimeOverride?.baseUrl &&
|
|
109
|
+
String(runtimePodName || '').trim() &&
|
|
110
|
+
!selectedRuntime);
|
|
92
111
|
useEffect(() => {
|
|
93
112
|
if (!needsRuntimeLookup) {
|
|
94
113
|
return;
|
|
@@ -120,9 +139,10 @@ export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargi
|
|
|
120
139
|
}
|
|
121
140
|
try {
|
|
122
141
|
const token = String(selectedRuntime?.token || '').trim();
|
|
142
|
+
const wsUrl = String(selectedRuntime?.wsUrl || '').trim() || baseUrl.replace(/^http/, 'ws');
|
|
123
143
|
const serverSettings = ServerConnection.makeSettings({
|
|
124
144
|
baseUrl,
|
|
125
|
-
wsUrl
|
|
145
|
+
wsUrl,
|
|
126
146
|
token,
|
|
127
147
|
appendToken: true,
|
|
128
148
|
});
|
|
@@ -155,7 +175,12 @@ export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargi
|
|
|
155
175
|
disposeServiceManager(manager);
|
|
156
176
|
}
|
|
157
177
|
};
|
|
158
|
-
}, [
|
|
178
|
+
}, [
|
|
179
|
+
selectedRuntime?.pod_name,
|
|
180
|
+
selectedRuntime?.url,
|
|
181
|
+
selectedRuntime?.token,
|
|
182
|
+
selectedRuntime?.wsUrl,
|
|
183
|
+
]);
|
|
159
184
|
// Bind strictly to the agent runtime sandbox; there is NO local fallback
|
|
160
185
|
// kernel. The notebook executes on the agent's runtime or shows a waiting
|
|
161
186
|
// state until the runtime is ready.
|
|
@@ -163,9 +188,17 @@ export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargi
|
|
|
163
188
|
const activeKernelId = runtimeKernelId;
|
|
164
189
|
const activeStartDefaultKernel = runtimeStartDefaultKernel;
|
|
165
190
|
const ToolbarComponent = toolbarComponent || NotebookToolbar;
|
|
166
|
-
const isRuntimeStarting = Boolean(String(runtimePodName || '').trim()
|
|
191
|
+
const isRuntimeStarting = Boolean((String(runtimePodName || '').trim() ||
|
|
192
|
+
String(runtimeOverride?.baseUrl || '').trim()) &&
|
|
193
|
+
!activeServiceManager);
|
|
167
194
|
useProgressTask(`ephemeral-notebook-start-${notebookId}`, isRuntimeStarting);
|
|
168
195
|
useEffect(() => {
|
|
196
|
+
// When a collaboration provider is active the shared ydoc is the single
|
|
197
|
+
// source of truth and is synced remotely; the local in-memory persistence
|
|
198
|
+
// poll would fight it, so it is disabled in that mode.
|
|
199
|
+
if (collaborationProvider) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
169
202
|
// Read the CURRENT live notebook model straight from the notebook store.
|
|
170
203
|
// The `NotebookAdapter` exposes `notebook` (the widget, whose `.model` is
|
|
171
204
|
// the `INotebookModel`) and `panel` (`panel.content.model`). There is NO
|
|
@@ -247,6 +280,6 @@ export function EphemeralNotebook({ notebookId, runtimePodName, cellSidebarMargi
|
|
|
247
280
|
flex: '1 1 auto',
|
|
248
281
|
minHeight: 0,
|
|
249
282
|
},
|
|
250
|
-
}, children: _jsx(Notebook, { nbformat: initialNbformat, id: notebookId, serviceManager: activeServiceManager, startDefaultKernel: activeStartDefaultKernel, kernelId: activeKernelId, height: "100%", cellSidebarMargin: cellSidebarMargin, extensions: extensions, Toolbar: ToolbarComponent }) }) }) })) : null }));
|
|
283
|
+
}, children: _jsx(Notebook, { nbformat: initialNbformat, id: notebookId, serviceManager: activeServiceManager, startDefaultKernel: activeStartDefaultKernel, kernelId: activeKernelId, height: "100%", cellSidebarMargin: cellSidebarMargin, extensions: extensions, Toolbar: ToolbarComponent, collaborationProvider: collaborationProvider }) }) }) })) : null }));
|
|
251
284
|
}
|
|
252
285
|
export default EphemeralNotebook;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/// <reference types="vite/client" />
|
|
7
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
8
|
+
import { Box } from '@datalayer/primer-addons';
|
|
9
|
+
import { Button, Heading, Label, Spinner, Text } from '@primer/react';
|
|
10
|
+
import { PackageIcon } from '@primer/octicons-react';
|
|
11
|
+
import { useSimpleAuthStore } from '@datalayer/core/lib/views/otel';
|
|
12
|
+
import { ThemedProvider } from './utils/themedProvider';
|
|
13
|
+
import { AuthRequiredView, ErrorView } from './components';
|
|
14
|
+
import { uniqueAgentId } from './utils/agentId';
|
|
15
|
+
import { useExampleAgentRuntimesUrl } from './utils/useExampleAgentRuntimesUrl';
|
|
16
|
+
import { Chat } from '../chat';
|
|
17
|
+
const SANDBOX_SPEC_OPTIONS = [
|
|
18
|
+
{
|
|
19
|
+
variant: 'eval',
|
|
20
|
+
specId: 'example-sandbox-eval',
|
|
21
|
+
title: 'Eval Sandbox',
|
|
22
|
+
description: 'In-process Python execution for quick local iteration.',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
variant: 'jupyter',
|
|
26
|
+
specId: 'example-sandbox-jupyter',
|
|
27
|
+
title: 'Jupyter Sandbox',
|
|
28
|
+
description: 'Kernel-backed execution with notebook-compatible behavior.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
variant: 'docker',
|
|
32
|
+
specId: 'example-sandbox-docker',
|
|
33
|
+
title: 'Docker Sandbox',
|
|
34
|
+
description: 'Containerized execution for stronger process isolation.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
variant: 'datalayer',
|
|
38
|
+
specId: 'example-sandbox-datalayer',
|
|
39
|
+
title: 'Datalayer Sandbox',
|
|
40
|
+
description: 'Cloud sandbox runtime powered by Datalayer environments.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: 'colab',
|
|
44
|
+
specId: 'example-sandbox-colab',
|
|
45
|
+
title: 'Colab Sandbox',
|
|
46
|
+
description: 'Google Colab runtime connector (reuse an already-running kernel).',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: 'kaggle',
|
|
50
|
+
specId: 'example-sandbox-kaggle',
|
|
51
|
+
title: 'Kaggle Sandbox',
|
|
52
|
+
description: 'Kaggle runtime connector (create kernel with API token or attach existing).',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
variant: 'monty',
|
|
56
|
+
specId: 'example-sandbox-monty',
|
|
57
|
+
title: 'Monty Sandbox',
|
|
58
|
+
description: 'Secure in-process interpreter focused on safe snippets.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
variant: 'modal',
|
|
62
|
+
specId: 'example-sandbox-modal',
|
|
63
|
+
title: 'Modal Sandbox',
|
|
64
|
+
description: 'Modal cloud sandbox for scalable remote code execution.',
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
const AgentCodeSandboxesInner = ({ onLogout, }) => {
|
|
68
|
+
const { token } = useSimpleAuthStore();
|
|
69
|
+
const baseUrl = useExampleAgentRuntimesUrl();
|
|
70
|
+
const [selectedSpecId, setSelectedSpecId] = useState(SANDBOX_SPEC_OPTIONS[0].specId);
|
|
71
|
+
const [agentId, setAgentId] = useState(null);
|
|
72
|
+
const [activeSpecId, setActiveSpecId] = useState(null);
|
|
73
|
+
const [isLaunching, setIsLaunching] = useState(false);
|
|
74
|
+
const [error, setError] = useState(null);
|
|
75
|
+
const selectedOption = useMemo(() => SANDBOX_SPEC_OPTIONS.find(option => option.specId === selectedSpecId) ??
|
|
76
|
+
SANDBOX_SPEC_OPTIONS[0], [selectedSpecId]);
|
|
77
|
+
const activeOption = useMemo(() => SANDBOX_SPEC_OPTIONS.find(option => option.specId === activeSpecId) ??
|
|
78
|
+
selectedOption, [activeSpecId, selectedOption]);
|
|
79
|
+
const authFetch = useCallback((url, opts = {}) => fetch(url, {
|
|
80
|
+
...opts,
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
84
|
+
...(opts.headers ?? {}),
|
|
85
|
+
},
|
|
86
|
+
}), [token]);
|
|
87
|
+
const launchAgent = useCallback(async () => {
|
|
88
|
+
setIsLaunching(true);
|
|
89
|
+
setError(null);
|
|
90
|
+
try {
|
|
91
|
+
if (agentId) {
|
|
92
|
+
await authFetch(`${baseUrl}/api/v1/agents/${agentId}`, {
|
|
93
|
+
method: 'DELETE',
|
|
94
|
+
}).catch(() => {
|
|
95
|
+
// Ignore teardown errors while switching specs.
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const agentName = uniqueAgentId(`code-sandbox-${selectedOption.variant}`);
|
|
99
|
+
const response = await authFetch(`${baseUrl}/api/v1/agents`, {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
body: JSON.stringify({
|
|
102
|
+
name: agentName,
|
|
103
|
+
description: `Code sandbox demo (${selectedOption.variant})`,
|
|
104
|
+
agent_library: 'pydantic-ai',
|
|
105
|
+
transport: 'vercel-ai',
|
|
106
|
+
agent_spec_id: selectedOption.specId,
|
|
107
|
+
enable_codemode: true,
|
|
108
|
+
enable_skills: true,
|
|
109
|
+
tools: [],
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
const contentType = response.headers.get('content-type') || '';
|
|
114
|
+
let detail = '';
|
|
115
|
+
if (contentType.includes('application/json')) {
|
|
116
|
+
const payload = await response.json().catch(() => null);
|
|
117
|
+
detail =
|
|
118
|
+
(typeof payload?.detail === 'string' && payload.detail) ||
|
|
119
|
+
(typeof payload?.message === 'string' && payload.message) ||
|
|
120
|
+
'';
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
detail = await response.text().catch(() => '');
|
|
124
|
+
}
|
|
125
|
+
throw new Error(detail || `Failed to create agent (${response.status})`);
|
|
126
|
+
}
|
|
127
|
+
const payload = await response.json();
|
|
128
|
+
const createdAgentId = payload?.id || agentName;
|
|
129
|
+
setAgentId(createdAgentId);
|
|
130
|
+
setActiveSpecId(selectedOption.specId);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
setError(e instanceof Error ? e.message : 'Failed to launch agent');
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
setIsLaunching(false);
|
|
137
|
+
}
|
|
138
|
+
}, [agentId, authFetch, baseUrl, selectedOption]);
|
|
139
|
+
if (!agentId) {
|
|
140
|
+
return (_jsxs(Box, { sx: {
|
|
141
|
+
maxWidth: 840,
|
|
142
|
+
mx: 'auto',
|
|
143
|
+
mt: 6,
|
|
144
|
+
px: 3,
|
|
145
|
+
py: 3,
|
|
146
|
+
border: '1px solid',
|
|
147
|
+
borderColor: 'border.default',
|
|
148
|
+
borderRadius: 2,
|
|
149
|
+
display: 'flex',
|
|
150
|
+
flexDirection: 'column',
|
|
151
|
+
gap: 3,
|
|
152
|
+
bg: 'canvas.subtle',
|
|
153
|
+
}, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.muted' }, children: "SANDBOX VARIANT DEMO" }), _jsx(Heading, { as: "h2", sx: { fontSize: 3 }, children: "Agent Code Sandboxes" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Choose a sandbox variant-backed spec, launch the agent, then run code from chat to compare behavior across sandboxes." }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [_jsxs(Label, { variant: "accent", children: ["Spec: ", selectedOption.specId] }), _jsxs(Label, { variant: "secondary", children: ["Variant: ", selectedOption.variant] }), _jsx(Label, { variant: "success", children: "Codemode: enabled" })] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 600 }, children: "Sandbox Variant" }), _jsx("select", { value: selectedSpecId, onChange: event => {
|
|
154
|
+
setSelectedSpecId(event.target.value);
|
|
155
|
+
}, style: {
|
|
156
|
+
width: '100%',
|
|
157
|
+
maxWidth: 420,
|
|
158
|
+
padding: '8px 10px',
|
|
159
|
+
borderRadius: '6px',
|
|
160
|
+
border: '1px solid var(--borderColor-default)',
|
|
161
|
+
background: 'var(--bgColor-default)',
|
|
162
|
+
color: 'var(--fgColor-default)',
|
|
163
|
+
}, children: SANDBOX_SPEC_OPTIONS.map(option => (_jsxs("option", { value: option.specId, children: [option.title, " (", option.variant, ")"] }, option.specId))) }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: selectedOption.description })] }), _jsx(Button, { variant: "primary", onClick: () => {
|
|
164
|
+
void launchAgent();
|
|
165
|
+
}, disabled: isLaunching, sx: { width: '100%', maxWidth: 420 }, children: isLaunching ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small" }), " Launching..."] })) : (`Launch ${selectedOption.title}`) }), error && _jsx(ErrorView, { error: error, onLogout: onLogout })] }));
|
|
166
|
+
}
|
|
167
|
+
return (_jsx(Chat, { protocol: "vercel-ai", baseUrl: baseUrl, agentId: agentId, runtimeId: agentId, title: `Code Sandboxes: ${activeOption.title}`, description: `Spec ${activeOption.specId} (${activeOption.variant})`, brandIcon: _jsx(PackageIcon, { size: 16 }), showHeader: true, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, showTokenUsage: true, showInformation: true, autoFocus: true, height: "100vh", historyEndpoint: `${baseUrl}/api/v1/history`, suggestions: [
|
|
168
|
+
{
|
|
169
|
+
title: 'Identify sandbox variant',
|
|
170
|
+
message: 'Use execute_code to print(os.getenv("DATALAYER_CODE_SANDBOX_VARIANT")) and summarize the result.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
title: 'Run numeric workload',
|
|
174
|
+
message: 'Use execute_code to compute sum(i*i for i in range(10000)) and report timing and result.',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
title: 'Check package availability',
|
|
178
|
+
message: 'Use execute_code to import pandas and print(pandas.__version__).',
|
|
179
|
+
},
|
|
180
|
+
], submitOnSuggestionClick: true }));
|
|
181
|
+
};
|
|
182
|
+
const AgentCodeSandboxesExample = () => {
|
|
183
|
+
const { token, clearAuth } = useSimpleAuthStore();
|
|
184
|
+
const handleLogout = useCallback(() => {
|
|
185
|
+
clearAuth();
|
|
186
|
+
}, [clearAuth]);
|
|
187
|
+
if (!token) {
|
|
188
|
+
return _jsx(AuthRequiredView, {});
|
|
189
|
+
}
|
|
190
|
+
return (_jsx(ThemedProvider, { children: _jsx(AgentCodeSandboxesInner, { onLogout: handleLogout }) }));
|
|
191
|
+
};
|
|
192
|
+
export default AgentCodeSandboxesExample;
|
|
@@ -84,6 +84,7 @@ export const EXAMPLE_ENTRIES = [
|
|
|
84
84
|
makeEntry('CopilotKitNotebookExample', () => import('./CopilotKitNotebookExample'), 'CopilotKit integration with notebook workflows.'),
|
|
85
85
|
makeEntry('AgentCheckpointsExample', () => import('./AgentCheckpointsExample'), 'Checkpoint and resume lifecycle for agents.'),
|
|
86
86
|
makeEntry('AgentCodemodeExample', () => import('./AgentCodemodeExample'), 'Code mode execution and tool orchestration example.'),
|
|
87
|
+
makeEntry('AgentCodeSandboxesExample', () => import('./AgentCodeSandboxesExample'), 'Launch sandbox-variant agent specs and compare code execution across backends.', ['example', 'agent', 'sandbox', 'codemode']),
|
|
87
88
|
makeEntry('AgentEvalsExample', () => import('./AgentEvalsExample'), 'Evaluation workflows for agent outputs.'),
|
|
88
89
|
makeEntry('AgentGuardrailsExample', () => import('./AgentGuardrailsExample'), 'Guardrails and safety checks for agent runs.'),
|
|
89
90
|
makeEntry('AgentHooksExample', () => import('./AgentHooksExample'), 'Pre-hooks and post-hooks lifecycle execution example.'),
|
package/lib/examples/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as CustomExample } from './ChatCustomExample';
|
|
|
18
18
|
export { default as NotebookCollaborationExample } from './NotebookCollaborationExample';
|
|
19
19
|
export { default as AgentCheckpointsExample } from './AgentCheckpointsExample';
|
|
20
20
|
export { default as AgentCodemodeExample } from './AgentCodemodeExample';
|
|
21
|
+
export { default as AgentCodeSandboxesExample } from './AgentCodeSandboxesExample';
|
|
21
22
|
export { default as AgentEvalsExample } from './AgentEvalsExample';
|
|
22
23
|
export { default as AgentGuardrailsExample } from './AgentGuardrailsExample';
|
|
23
24
|
export { default as AgentHooksExample } from './AgentHooksExample';
|
package/lib/examples/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { default as CustomExample } from './ChatCustomExample';
|
|
|
22
22
|
export { default as NotebookCollaborationExample } from './NotebookCollaborationExample';
|
|
23
23
|
export { default as AgentCheckpointsExample } from './AgentCheckpointsExample';
|
|
24
24
|
export { default as AgentCodemodeExample } from './AgentCodemodeExample';
|
|
25
|
+
export { default as AgentCodeSandboxesExample } from './AgentCodeSandboxesExample';
|
|
25
26
|
export { default as AgentEvalsExample } from './AgentEvalsExample';
|
|
26
27
|
export { default as AgentGuardrailsExample } from './AgentGuardrailsExample';
|
|
27
28
|
export { default as AgentHooksExample } from './AgentHooksExample';
|
|
@@ -201,11 +201,10 @@ export function IdentityCard({ identity, providerConfig, showExpirationDetails =
|
|
|
201
201
|
justifyContent: 'center',
|
|
202
202
|
backgroundColor: display.color,
|
|
203
203
|
color: 'white',
|
|
204
|
-
flexShrink: 0,
|
|
205
204
|
}, children: _jsx(display.icon, { size: 16 }) }), _jsxs(Box, { sx: { flex: 1, display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: display.name }), _jsx(Label, { size: "small", variant: "secondary", children: identity.authType === 'token' ? 'API Key' : 'OAuth' })] }), tokenStatus.isExpired ? (_jsx(Label, { variant: "danger", size: "small", children: _jsxs(Box, { sx: { display: 'inline-flex', alignItems: 'center', gap: 1 }, children: [_jsx(AlertIcon, { size: 12 }), " Expired"] }) })) : tokenStatus.isExpiringSoon ? (_jsx(Label, { variant: "attention", size: "small", children: _jsxs(Box, { sx: { display: 'inline-flex', alignItems: 'center', gap: 1 }, children: [_jsx(ClockIcon, { size: 12 }), " Expiring Soon"] }) })) : (_jsx(Label, { variant: "success", size: "small", children: _jsxs(Box, { sx: { display: 'inline-flex', alignItems: 'center', gap: 1 }, children: [_jsx(CheckCircleFillIcon, { size: 12 }), " Connected"] }) }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [identity.userInfo?.avatarUrl && (_jsx("a", { href: identity.userInfo.profileUrl ||
|
|
206
205
|
(provider === 'github'
|
|
207
206
|
? `https://github.com/${identity.userInfo.username}`
|
|
208
|
-
: undefined), target: "_blank", rel: "noopener noreferrer", style: { display: 'block', lineHeight: 0
|
|
207
|
+
: undefined), target: "_blank", rel: "noopener noreferrer", style: { display: 'block', lineHeight: 0 }, children: _jsx(Avatar, { src: identity.userInfo.avatarUrl, size: 32, alt: identity.userInfo.name ||
|
|
209
208
|
identity.userInfo.username ||
|
|
210
209
|
display.name, sx: { cursor: 'pointer' } }) })), _jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [identity.userInfo?.name && (_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1, display: 'block' }, children: identity.userInfo.name })), (identity.userInfo?.username || identity.userInfo?.email) && (_jsx("a", { href: identity.userInfo.profileUrl ||
|
|
211
210
|
(provider === 'github'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Box as default, Box } from '@primer/react';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
// Runtime shim: force the primer-addons Box export to use Primer's Box.
|
|
6
|
+
// This prevents `sx` from being forwarded to raw DOM nodes as an attribute.
|
|
7
|
+
export { Box as default, Box } from '@primer/react';
|
|
@@ -29,6 +29,14 @@ export declare const EXAMPLE_ONE_TRIGGER_AGENTSPEC_0_0_1: Agentspec;
|
|
|
29
29
|
export declare const EXAMPLE_OTEL_AGENTSPEC_0_0_1: Agentspec;
|
|
30
30
|
export declare const EXAMPLE_OUTPUT_AGENTSPEC_0_0_1: Agentspec;
|
|
31
31
|
export declare const EXAMPLE_PARAMETERS_AGENTSPEC_0_0_1: Agentspec;
|
|
32
|
+
export declare const EXAMPLE_SANDBOX_COLAB_AGENTSPEC_0_0_1: Agentspec;
|
|
33
|
+
export declare const EXAMPLE_SANDBOX_DATALAYER_AGENTSPEC_0_0_1: Agentspec;
|
|
34
|
+
export declare const EXAMPLE_SANDBOX_DOCKER_AGENTSPEC_0_0_1: Agentspec;
|
|
35
|
+
export declare const EXAMPLE_SANDBOX_EVAL_AGENTSPEC_0_0_1: Agentspec;
|
|
36
|
+
export declare const EXAMPLE_SANDBOX_JUPYTER_AGENTSPEC_0_0_1: Agentspec;
|
|
37
|
+
export declare const EXAMPLE_SANDBOX_KAGGLE_AGENTSPEC_0_0_1: Agentspec;
|
|
38
|
+
export declare const EXAMPLE_SANDBOX_MODAL_AGENTSPEC_0_0_1: Agentspec;
|
|
39
|
+
export declare const EXAMPLE_SANDBOX_MONTY_AGENTSPEC_0_0_1: Agentspec;
|
|
32
40
|
export declare const EXAMPLE_SHARED_STATE_AGENTSPEC_0_0_1: Agentspec;
|
|
33
41
|
export declare const EXAMPLE_SIMPLE_AGENTSPEC_0_0_1: Agentspec;
|
|
34
42
|
export declare const EXAMPLE_SKILLS_AGENTSPEC_0_0_1: Agentspec;
|