@datalayer/agent-runtimes 1.0.17 → 1.0.18
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/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/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/config.d.ts +1 -1
- package/package.json +1 -1
- package/scripts/codegen/__pycache__/generate_sandbox_agents.cpython-313.pyc +0 -0
- package/scripts/codegen/generate_sandbox_agents.py +145 -0
|
@@ -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';
|
|
@@ -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;
|
|
@@ -1521,6 +1521,438 @@ export const EXAMPLE_PARAMETERS_AGENTSPEC_0_0_1 = {
|
|
|
1521
1521
|
},
|
|
1522
1522
|
subagents: undefined,
|
|
1523
1523
|
};
|
|
1524
|
+
export const EXAMPLE_SANDBOX_COLAB_AGENTSPEC_0_0_1 = {
|
|
1525
|
+
id: 'example-sandbox-colab',
|
|
1526
|
+
version: '0.0.1',
|
|
1527
|
+
name: 'Example Sandbox Colab Agent',
|
|
1528
|
+
description: `Demonstration agent configured to run codemode code execution with the 'colab' sandbox variant.`,
|
|
1529
|
+
tags: ['sandbox', 'codemode', 'colab'],
|
|
1530
|
+
enabled: true,
|
|
1531
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1532
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1533
|
+
skills: [
|
|
1534
|
+
SKILL_MAP['events:0.0.1']
|
|
1535
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1536
|
+
: undefined,
|
|
1537
|
+
].filter(Boolean),
|
|
1538
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1539
|
+
frontendTools: [
|
|
1540
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1541
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1542
|
+
],
|
|
1543
|
+
environmentName: 'ai-agents-env',
|
|
1544
|
+
icon: 'package',
|
|
1545
|
+
emoji: 'E',
|
|
1546
|
+
color: '#1F6FEB',
|
|
1547
|
+
suggestions: [
|
|
1548
|
+
"Use execute_code to print('sandbox variant: colab')",
|
|
1549
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1550
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1551
|
+
],
|
|
1552
|
+
welcomeMessage: "You're connected to the colab sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1553
|
+
welcomeNotebook: undefined,
|
|
1554
|
+
welcomeDocument: undefined,
|
|
1555
|
+
sandboxVariant: 'colab',
|
|
1556
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1557
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1558
|
+
goal: undefined,
|
|
1559
|
+
protocol: undefined,
|
|
1560
|
+
uiExtension: undefined,
|
|
1561
|
+
trigger: undefined,
|
|
1562
|
+
modelConfig: undefined,
|
|
1563
|
+
mcpServerTools: undefined,
|
|
1564
|
+
guardrails: undefined,
|
|
1565
|
+
evals: undefined,
|
|
1566
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1567
|
+
output: undefined,
|
|
1568
|
+
advanced: undefined,
|
|
1569
|
+
authorizationPolicy: undefined,
|
|
1570
|
+
notifications: undefined,
|
|
1571
|
+
memory: 'ephemeral',
|
|
1572
|
+
preHooks: undefined,
|
|
1573
|
+
postHooks: undefined,
|
|
1574
|
+
toolHooks: undefined,
|
|
1575
|
+
parameters: undefined,
|
|
1576
|
+
subagents: undefined,
|
|
1577
|
+
};
|
|
1578
|
+
export const EXAMPLE_SANDBOX_DATALAYER_AGENTSPEC_0_0_1 = {
|
|
1579
|
+
id: 'example-sandbox-datalayer',
|
|
1580
|
+
version: '0.0.1',
|
|
1581
|
+
name: 'Example Sandbox Datalayer Agent',
|
|
1582
|
+
description: `Demonstration agent configured to run codemode code execution with the 'datalayer' sandbox variant.`,
|
|
1583
|
+
tags: ['sandbox', 'codemode', 'datalayer'],
|
|
1584
|
+
enabled: true,
|
|
1585
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1586
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1587
|
+
skills: [
|
|
1588
|
+
SKILL_MAP['events:0.0.1']
|
|
1589
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1590
|
+
: undefined,
|
|
1591
|
+
].filter(Boolean),
|
|
1592
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1593
|
+
frontendTools: [
|
|
1594
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1595
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1596
|
+
],
|
|
1597
|
+
environmentName: 'ai-agents-env',
|
|
1598
|
+
icon: 'package',
|
|
1599
|
+
emoji: 'D',
|
|
1600
|
+
color: '#1F6FEB',
|
|
1601
|
+
suggestions: [
|
|
1602
|
+
"Use execute_code to print('sandbox variant: datalayer')",
|
|
1603
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1604
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1605
|
+
],
|
|
1606
|
+
welcomeMessage: "You're connected to the datalayer sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1607
|
+
welcomeNotebook: undefined,
|
|
1608
|
+
welcomeDocument: undefined,
|
|
1609
|
+
sandboxVariant: 'datalayer',
|
|
1610
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1611
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1612
|
+
goal: undefined,
|
|
1613
|
+
protocol: undefined,
|
|
1614
|
+
uiExtension: undefined,
|
|
1615
|
+
trigger: undefined,
|
|
1616
|
+
modelConfig: undefined,
|
|
1617
|
+
mcpServerTools: undefined,
|
|
1618
|
+
guardrails: undefined,
|
|
1619
|
+
evals: undefined,
|
|
1620
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1621
|
+
output: undefined,
|
|
1622
|
+
advanced: undefined,
|
|
1623
|
+
authorizationPolicy: undefined,
|
|
1624
|
+
notifications: undefined,
|
|
1625
|
+
memory: 'ephemeral',
|
|
1626
|
+
preHooks: undefined,
|
|
1627
|
+
postHooks: undefined,
|
|
1628
|
+
toolHooks: undefined,
|
|
1629
|
+
parameters: undefined,
|
|
1630
|
+
subagents: undefined,
|
|
1631
|
+
};
|
|
1632
|
+
export const EXAMPLE_SANDBOX_DOCKER_AGENTSPEC_0_0_1 = {
|
|
1633
|
+
id: 'example-sandbox-docker',
|
|
1634
|
+
version: '0.0.1',
|
|
1635
|
+
name: 'Example Sandbox Docker Agent',
|
|
1636
|
+
description: `Demonstration agent configured to run codemode code execution with the 'docker' sandbox variant.`,
|
|
1637
|
+
tags: ['sandbox', 'codemode', 'docker'],
|
|
1638
|
+
enabled: true,
|
|
1639
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1640
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1641
|
+
skills: [
|
|
1642
|
+
SKILL_MAP['events:0.0.1']
|
|
1643
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1644
|
+
: undefined,
|
|
1645
|
+
].filter(Boolean),
|
|
1646
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1647
|
+
frontendTools: [
|
|
1648
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1649
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1650
|
+
],
|
|
1651
|
+
environmentName: 'ai-agents-env',
|
|
1652
|
+
icon: 'package',
|
|
1653
|
+
emoji: 'C',
|
|
1654
|
+
color: '#1F6FEB',
|
|
1655
|
+
suggestions: [
|
|
1656
|
+
"Use execute_code to print('sandbox variant: docker')",
|
|
1657
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1658
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1659
|
+
],
|
|
1660
|
+
welcomeMessage: "You're connected to the docker sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1661
|
+
welcomeNotebook: undefined,
|
|
1662
|
+
welcomeDocument: undefined,
|
|
1663
|
+
sandboxVariant: 'docker',
|
|
1664
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1665
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1666
|
+
goal: undefined,
|
|
1667
|
+
protocol: undefined,
|
|
1668
|
+
uiExtension: undefined,
|
|
1669
|
+
trigger: undefined,
|
|
1670
|
+
modelConfig: undefined,
|
|
1671
|
+
mcpServerTools: undefined,
|
|
1672
|
+
guardrails: undefined,
|
|
1673
|
+
evals: undefined,
|
|
1674
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1675
|
+
output: undefined,
|
|
1676
|
+
advanced: undefined,
|
|
1677
|
+
authorizationPolicy: undefined,
|
|
1678
|
+
notifications: undefined,
|
|
1679
|
+
memory: 'ephemeral',
|
|
1680
|
+
preHooks: undefined,
|
|
1681
|
+
postHooks: undefined,
|
|
1682
|
+
toolHooks: undefined,
|
|
1683
|
+
parameters: undefined,
|
|
1684
|
+
subagents: undefined,
|
|
1685
|
+
};
|
|
1686
|
+
export const EXAMPLE_SANDBOX_EVAL_AGENTSPEC_0_0_1 = {
|
|
1687
|
+
id: 'example-sandbox-eval',
|
|
1688
|
+
version: '0.0.1',
|
|
1689
|
+
name: 'Example Sandbox Eval Agent',
|
|
1690
|
+
description: `Demonstration agent configured to run codemode code execution with the 'eval' sandbox variant.`,
|
|
1691
|
+
tags: ['sandbox', 'codemode', 'eval'],
|
|
1692
|
+
enabled: true,
|
|
1693
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1694
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1695
|
+
skills: [
|
|
1696
|
+
SKILL_MAP['events:0.0.1']
|
|
1697
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1698
|
+
: undefined,
|
|
1699
|
+
].filter(Boolean),
|
|
1700
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1701
|
+
frontendTools: [
|
|
1702
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1703
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1704
|
+
],
|
|
1705
|
+
environmentName: 'ai-agents-env',
|
|
1706
|
+
icon: 'package',
|
|
1707
|
+
emoji: 'A',
|
|
1708
|
+
color: '#1F6FEB',
|
|
1709
|
+
suggestions: [
|
|
1710
|
+
"Use execute_code to print('sandbox variant: eval')",
|
|
1711
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1712
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1713
|
+
],
|
|
1714
|
+
welcomeMessage: "You're connected to the eval sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1715
|
+
welcomeNotebook: undefined,
|
|
1716
|
+
welcomeDocument: undefined,
|
|
1717
|
+
sandboxVariant: 'eval',
|
|
1718
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1719
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1720
|
+
goal: undefined,
|
|
1721
|
+
protocol: undefined,
|
|
1722
|
+
uiExtension: undefined,
|
|
1723
|
+
trigger: undefined,
|
|
1724
|
+
modelConfig: undefined,
|
|
1725
|
+
mcpServerTools: undefined,
|
|
1726
|
+
guardrails: undefined,
|
|
1727
|
+
evals: undefined,
|
|
1728
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1729
|
+
output: undefined,
|
|
1730
|
+
advanced: undefined,
|
|
1731
|
+
authorizationPolicy: undefined,
|
|
1732
|
+
notifications: undefined,
|
|
1733
|
+
memory: 'ephemeral',
|
|
1734
|
+
preHooks: undefined,
|
|
1735
|
+
postHooks: undefined,
|
|
1736
|
+
toolHooks: undefined,
|
|
1737
|
+
parameters: undefined,
|
|
1738
|
+
subagents: undefined,
|
|
1739
|
+
};
|
|
1740
|
+
export const EXAMPLE_SANDBOX_JUPYTER_AGENTSPEC_0_0_1 = {
|
|
1741
|
+
id: 'example-sandbox-jupyter',
|
|
1742
|
+
version: '0.0.1',
|
|
1743
|
+
name: 'Example Sandbox Jupyter Agent',
|
|
1744
|
+
description: `Demonstration agent configured to run codemode code execution with the 'jupyter' sandbox variant.`,
|
|
1745
|
+
tags: ['sandbox', 'codemode', 'jupyter'],
|
|
1746
|
+
enabled: true,
|
|
1747
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1748
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1749
|
+
skills: [
|
|
1750
|
+
SKILL_MAP['events:0.0.1']
|
|
1751
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1752
|
+
: undefined,
|
|
1753
|
+
].filter(Boolean),
|
|
1754
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1755
|
+
frontendTools: [
|
|
1756
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1757
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1758
|
+
],
|
|
1759
|
+
environmentName: 'ai-agents-env',
|
|
1760
|
+
icon: 'package',
|
|
1761
|
+
emoji: 'B',
|
|
1762
|
+
color: '#1F6FEB',
|
|
1763
|
+
suggestions: [
|
|
1764
|
+
"Use execute_code to print('sandbox variant: jupyter')",
|
|
1765
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1766
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1767
|
+
],
|
|
1768
|
+
welcomeMessage: "You're connected to the jupyter sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1769
|
+
welcomeNotebook: undefined,
|
|
1770
|
+
welcomeDocument: undefined,
|
|
1771
|
+
sandboxVariant: 'jupyter',
|
|
1772
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1773
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1774
|
+
goal: undefined,
|
|
1775
|
+
protocol: undefined,
|
|
1776
|
+
uiExtension: undefined,
|
|
1777
|
+
trigger: undefined,
|
|
1778
|
+
modelConfig: undefined,
|
|
1779
|
+
mcpServerTools: undefined,
|
|
1780
|
+
guardrails: undefined,
|
|
1781
|
+
evals: undefined,
|
|
1782
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1783
|
+
output: undefined,
|
|
1784
|
+
advanced: undefined,
|
|
1785
|
+
authorizationPolicy: undefined,
|
|
1786
|
+
notifications: undefined,
|
|
1787
|
+
memory: 'ephemeral',
|
|
1788
|
+
preHooks: undefined,
|
|
1789
|
+
postHooks: undefined,
|
|
1790
|
+
toolHooks: undefined,
|
|
1791
|
+
parameters: undefined,
|
|
1792
|
+
subagents: undefined,
|
|
1793
|
+
};
|
|
1794
|
+
export const EXAMPLE_SANDBOX_KAGGLE_AGENTSPEC_0_0_1 = {
|
|
1795
|
+
id: 'example-sandbox-kaggle',
|
|
1796
|
+
version: '0.0.1',
|
|
1797
|
+
name: 'Example Sandbox Kaggle Agent',
|
|
1798
|
+
description: `Demonstration agent configured to run codemode code execution with the 'kaggle' sandbox variant.`,
|
|
1799
|
+
tags: ['sandbox', 'codemode', 'kaggle'],
|
|
1800
|
+
enabled: true,
|
|
1801
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1802
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1803
|
+
skills: [
|
|
1804
|
+
SKILL_MAP['events:0.0.1']
|
|
1805
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1806
|
+
: undefined,
|
|
1807
|
+
].filter(Boolean),
|
|
1808
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1809
|
+
frontendTools: [
|
|
1810
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1811
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1812
|
+
],
|
|
1813
|
+
environmentName: 'ai-agents-env',
|
|
1814
|
+
icon: 'package',
|
|
1815
|
+
emoji: 'H',
|
|
1816
|
+
color: '#1F6FEB',
|
|
1817
|
+
suggestions: [
|
|
1818
|
+
"Use execute_code to print('sandbox variant: kaggle')",
|
|
1819
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1820
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1821
|
+
],
|
|
1822
|
+
welcomeMessage: "You're connected to the kaggle sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1823
|
+
welcomeNotebook: undefined,
|
|
1824
|
+
welcomeDocument: undefined,
|
|
1825
|
+
sandboxVariant: 'kaggle',
|
|
1826
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1827
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1828
|
+
goal: undefined,
|
|
1829
|
+
protocol: undefined,
|
|
1830
|
+
uiExtension: undefined,
|
|
1831
|
+
trigger: undefined,
|
|
1832
|
+
modelConfig: undefined,
|
|
1833
|
+
mcpServerTools: undefined,
|
|
1834
|
+
guardrails: undefined,
|
|
1835
|
+
evals: undefined,
|
|
1836
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1837
|
+
output: undefined,
|
|
1838
|
+
advanced: undefined,
|
|
1839
|
+
authorizationPolicy: undefined,
|
|
1840
|
+
notifications: undefined,
|
|
1841
|
+
memory: 'ephemeral',
|
|
1842
|
+
preHooks: undefined,
|
|
1843
|
+
postHooks: undefined,
|
|
1844
|
+
toolHooks: undefined,
|
|
1845
|
+
parameters: undefined,
|
|
1846
|
+
subagents: undefined,
|
|
1847
|
+
};
|
|
1848
|
+
export const EXAMPLE_SANDBOX_MODAL_AGENTSPEC_0_0_1 = {
|
|
1849
|
+
id: 'example-sandbox-modal',
|
|
1850
|
+
version: '0.0.1',
|
|
1851
|
+
name: 'Example Sandbox Modal Agent',
|
|
1852
|
+
description: `Demonstration agent configured to run codemode code execution with the 'modal' sandbox variant.`,
|
|
1853
|
+
tags: ['sandbox', 'codemode', 'modal'],
|
|
1854
|
+
enabled: true,
|
|
1855
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1856
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1857
|
+
skills: [
|
|
1858
|
+
SKILL_MAP['events:0.0.1']
|
|
1859
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1860
|
+
: undefined,
|
|
1861
|
+
].filter(Boolean),
|
|
1862
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1863
|
+
frontendTools: [
|
|
1864
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1865
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1866
|
+
],
|
|
1867
|
+
environmentName: 'ai-agents-env',
|
|
1868
|
+
icon: 'package',
|
|
1869
|
+
emoji: 'G',
|
|
1870
|
+
color: '#1F6FEB',
|
|
1871
|
+
suggestions: [
|
|
1872
|
+
"Use execute_code to print('sandbox variant: modal')",
|
|
1873
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1874
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1875
|
+
],
|
|
1876
|
+
welcomeMessage: "You're connected to the modal sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1877
|
+
welcomeNotebook: undefined,
|
|
1878
|
+
welcomeDocument: undefined,
|
|
1879
|
+
sandboxVariant: 'modal',
|
|
1880
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1881
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1882
|
+
goal: undefined,
|
|
1883
|
+
protocol: undefined,
|
|
1884
|
+
uiExtension: undefined,
|
|
1885
|
+
trigger: undefined,
|
|
1886
|
+
modelConfig: undefined,
|
|
1887
|
+
mcpServerTools: undefined,
|
|
1888
|
+
guardrails: undefined,
|
|
1889
|
+
evals: undefined,
|
|
1890
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1891
|
+
output: undefined,
|
|
1892
|
+
advanced: undefined,
|
|
1893
|
+
authorizationPolicy: undefined,
|
|
1894
|
+
notifications: undefined,
|
|
1895
|
+
memory: 'ephemeral',
|
|
1896
|
+
preHooks: undefined,
|
|
1897
|
+
postHooks: undefined,
|
|
1898
|
+
toolHooks: undefined,
|
|
1899
|
+
parameters: undefined,
|
|
1900
|
+
subagents: undefined,
|
|
1901
|
+
};
|
|
1902
|
+
export const EXAMPLE_SANDBOX_MONTY_AGENTSPEC_0_0_1 = {
|
|
1903
|
+
id: 'example-sandbox-monty',
|
|
1904
|
+
version: '0.0.1',
|
|
1905
|
+
name: 'Example Sandbox Monty Agent',
|
|
1906
|
+
description: `Demonstration agent configured to run codemode code execution with the 'monty' sandbox variant.`,
|
|
1907
|
+
tags: ['sandbox', 'codemode', 'monty'],
|
|
1908
|
+
enabled: true,
|
|
1909
|
+
model: 'bedrock:us.anthropic.claude-opus-4-8',
|
|
1910
|
+
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
1911
|
+
skills: [
|
|
1912
|
+
SKILL_MAP['events:0.0.1']
|
|
1913
|
+
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
1914
|
+
: undefined,
|
|
1915
|
+
].filter(Boolean),
|
|
1916
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
1917
|
+
frontendTools: [
|
|
1918
|
+
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
1919
|
+
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
1920
|
+
],
|
|
1921
|
+
environmentName: 'ai-agents-env',
|
|
1922
|
+
icon: 'package',
|
|
1923
|
+
emoji: 'F',
|
|
1924
|
+
color: '#1F6FEB',
|
|
1925
|
+
suggestions: [
|
|
1926
|
+
"Use execute_code to print('sandbox variant: monty')",
|
|
1927
|
+
'Use execute_code to compute sum(i*i for i in range(20))',
|
|
1928
|
+
'Use execute_code to load pandas and build a small DataFrame',
|
|
1929
|
+
],
|
|
1930
|
+
welcomeMessage: "You're connected to the monty sandbox variant demo. Ask me to run Python code and I will use execute_code in codemode.",
|
|
1931
|
+
welcomeNotebook: undefined,
|
|
1932
|
+
welcomeDocument: undefined,
|
|
1933
|
+
sandboxVariant: 'monty',
|
|
1934
|
+
systemPrompt: `You are a sandbox-variant demonstration assistant. Prefer executing Python code via execute_code for computations, data checks, and quick experiments, then summarize results clearly.`,
|
|
1935
|
+
systemPromptCodemodeAddons: `Always use execute_code when the user requests calculations, scripts, DataFrame operations, package checks, or shell-style diagnostics.`,
|
|
1936
|
+
goal: undefined,
|
|
1937
|
+
protocol: undefined,
|
|
1938
|
+
uiExtension: undefined,
|
|
1939
|
+
trigger: undefined,
|
|
1940
|
+
modelConfig: undefined,
|
|
1941
|
+
mcpServerTools: undefined,
|
|
1942
|
+
guardrails: undefined,
|
|
1943
|
+
evals: undefined,
|
|
1944
|
+
codemode: { enabled: true, token_reduction: '~80%', speedup: '~1.5x' },
|
|
1945
|
+
output: undefined,
|
|
1946
|
+
advanced: undefined,
|
|
1947
|
+
authorizationPolicy: undefined,
|
|
1948
|
+
notifications: undefined,
|
|
1949
|
+
memory: 'ephemeral',
|
|
1950
|
+
preHooks: undefined,
|
|
1951
|
+
postHooks: undefined,
|
|
1952
|
+
toolHooks: undefined,
|
|
1953
|
+
parameters: undefined,
|
|
1954
|
+
subagents: undefined,
|
|
1955
|
+
};
|
|
1524
1956
|
export const EXAMPLE_SHARED_STATE_AGENTSPEC_0_0_1 = {
|
|
1525
1957
|
id: 'example-shared-state',
|
|
1526
1958
|
version: '0.0.1',
|
|
@@ -6301,6 +6733,14 @@ export const AGENTSPECS = {
|
|
|
6301
6733
|
'example-otel': EXAMPLE_OTEL_AGENTSPEC_0_0_1,
|
|
6302
6734
|
'example-output': EXAMPLE_OUTPUT_AGENTSPEC_0_0_1,
|
|
6303
6735
|
'example-parameters': EXAMPLE_PARAMETERS_AGENTSPEC_0_0_1,
|
|
6736
|
+
'example-sandbox-colab': EXAMPLE_SANDBOX_COLAB_AGENTSPEC_0_0_1,
|
|
6737
|
+
'example-sandbox-datalayer': EXAMPLE_SANDBOX_DATALAYER_AGENTSPEC_0_0_1,
|
|
6738
|
+
'example-sandbox-docker': EXAMPLE_SANDBOX_DOCKER_AGENTSPEC_0_0_1,
|
|
6739
|
+
'example-sandbox-eval': EXAMPLE_SANDBOX_EVAL_AGENTSPEC_0_0_1,
|
|
6740
|
+
'example-sandbox-jupyter': EXAMPLE_SANDBOX_JUPYTER_AGENTSPEC_0_0_1,
|
|
6741
|
+
'example-sandbox-kaggle': EXAMPLE_SANDBOX_KAGGLE_AGENTSPEC_0_0_1,
|
|
6742
|
+
'example-sandbox-modal': EXAMPLE_SANDBOX_MODAL_AGENTSPEC_0_0_1,
|
|
6743
|
+
'example-sandbox-monty': EXAMPLE_SANDBOX_MONTY_AGENTSPEC_0_0_1,
|
|
6304
6744
|
'example-shared-state': EXAMPLE_SHARED_STATE_AGENTSPEC_0_0_1,
|
|
6305
6745
|
'example-simple': EXAMPLE_SIMPLE_AGENTSPEC_0_0_1,
|
|
6306
6746
|
'example-skills': EXAMPLE_SKILLS_AGENTSPEC_0_0_1,
|
|
@@ -63,7 +63,7 @@ export interface Agentspec {
|
|
|
63
63
|
welcomeNotebook?: string;
|
|
64
64
|
/** Path to Lexical document to show on agent creation */
|
|
65
65
|
welcomeDocument?: string;
|
|
66
|
-
/** Sandbox variant to use for this agent ('eval', 'jupyter') */
|
|
66
|
+
/** Sandbox variant to use for this agent (e.g. 'eval', 'jupyter', 'kaggle'). */
|
|
67
67
|
sandboxVariant?: string;
|
|
68
68
|
/** User-facing objective for the agent */
|
|
69
69
|
goal?: string;
|
package/lib/types/config.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface AgentConfig {
|
|
|
33
33
|
inferenceProvider?: string;
|
|
34
34
|
/** Enable codemode if supported by the selected spec/runtime. */
|
|
35
35
|
enableCodemode?: boolean;
|
|
36
|
-
/** Optional sandbox variant (e.g. eval, jupyter). */
|
|
36
|
+
/** Optional sandbox variant (e.g. eval, jupyter, kaggle). */
|
|
37
37
|
sandboxVariant?: string;
|
|
38
38
|
/** Optional Jupyter sandbox URL for jupyter-backed sandbox mode. */
|
|
39
39
|
jupyterSandbox?: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
# Distributed under the terms of the Modified BSD License.
|
|
4
|
+
|
|
5
|
+
"""Generate example sandbox agent specs for each sandbox variant.
|
|
6
|
+
|
|
7
|
+
This keeps sandbox demonstration specs aligned with supported sandbox variants
|
|
8
|
+
so examples can offer a consistent variant picker.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
VARIANTS: tuple[str, ...] = (
|
|
17
|
+
"eval",
|
|
18
|
+
"jupyter",
|
|
19
|
+
"docker",
|
|
20
|
+
"datalayer",
|
|
21
|
+
"colab",
|
|
22
|
+
"kaggle",
|
|
23
|
+
"monty",
|
|
24
|
+
"modal",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _emoji_for_variant(variant: str) -> str:
|
|
29
|
+
mapping = {
|
|
30
|
+
"eval": "A",
|
|
31
|
+
"jupyter": "B",
|
|
32
|
+
"docker": "C",
|
|
33
|
+
"datalayer": "D",
|
|
34
|
+
"colab": "E",
|
|
35
|
+
"kaggle": "H",
|
|
36
|
+
"monty": "F",
|
|
37
|
+
"modal": "G",
|
|
38
|
+
}
|
|
39
|
+
return mapping.get(variant, "A")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _content_for_variant(variant: str) -> str:
|
|
43
|
+
variant_title = variant.capitalize()
|
|
44
|
+
spec_id = f"example-sandbox-{variant}"
|
|
45
|
+
emoji = _emoji_for_variant(variant)
|
|
46
|
+
|
|
47
|
+
return f"""# Copyright (c) 2025-2026 Datalayer, Inc.
|
|
48
|
+
# Distributed under the terms of the Modified BSD License.
|
|
49
|
+
|
|
50
|
+
# Agent Specification: Sandbox Variant ({variant})
|
|
51
|
+
|
|
52
|
+
id: {spec_id}
|
|
53
|
+
version: 0.0.1
|
|
54
|
+
name: Example Sandbox {variant_title} Agent
|
|
55
|
+
description: >-
|
|
56
|
+
Demonstration agent configured to run codemode code execution with the
|
|
57
|
+
'{variant}' sandbox variant.
|
|
58
|
+
|
|
59
|
+
tags:
|
|
60
|
+
- sandbox
|
|
61
|
+
- codemode
|
|
62
|
+
- {variant}
|
|
63
|
+
|
|
64
|
+
enabled: true
|
|
65
|
+
model: "bedrock:us.anthropic.claude-opus-4-8"
|
|
66
|
+
|
|
67
|
+
sandbox_variant: {variant}
|
|
68
|
+
memory: ephemeral
|
|
69
|
+
|
|
70
|
+
mcp_servers:
|
|
71
|
+
- tavily:0.0.1
|
|
72
|
+
|
|
73
|
+
skills:
|
|
74
|
+
- events:0.0.1
|
|
75
|
+
|
|
76
|
+
tools:
|
|
77
|
+
- runtime-echo:0.0.1
|
|
78
|
+
|
|
79
|
+
frontend_tools:
|
|
80
|
+
- jupyter-notebook:0.0.1
|
|
81
|
+
- lexical-document:0.0.1
|
|
82
|
+
|
|
83
|
+
environment_name: ai-agents-env
|
|
84
|
+
|
|
85
|
+
icon: package
|
|
86
|
+
emoji: "{emoji}"
|
|
87
|
+
color: "#1F6FEB"
|
|
88
|
+
|
|
89
|
+
suggestions:
|
|
90
|
+
- "Use execute_code to print('sandbox variant: {variant}')"
|
|
91
|
+
- "Use execute_code to compute sum(i*i for i in range(20))"
|
|
92
|
+
- "Use execute_code to load pandas and build a small DataFrame"
|
|
93
|
+
|
|
94
|
+
welcome_message: >-
|
|
95
|
+
You're connected to the {variant} sandbox variant demo. Ask me to run
|
|
96
|
+
Python code and I will use execute_code in codemode.
|
|
97
|
+
|
|
98
|
+
system_prompt: >-
|
|
99
|
+
You are a sandbox-variant demonstration assistant. Prefer executing
|
|
100
|
+
Python code via execute_code for computations, data checks, and quick
|
|
101
|
+
experiments, then summarize results clearly.
|
|
102
|
+
|
|
103
|
+
system_prompt_codemode_addons: >-
|
|
104
|
+
Always use execute_code when the user requests calculations, scripts,
|
|
105
|
+
DataFrame operations, package checks, or shell-style diagnostics.
|
|
106
|
+
|
|
107
|
+
codemode:
|
|
108
|
+
enabled: true
|
|
109
|
+
token_reduction: "~80%"
|
|
110
|
+
speedup: "~1.5x"
|
|
111
|
+
|
|
112
|
+
welcome_notebook: null
|
|
113
|
+
welcome_document: null
|
|
114
|
+
trigger: null
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def generate_specs(agents_dir: Path) -> int:
|
|
119
|
+
agents_dir.mkdir(parents=True, exist_ok=True)
|
|
120
|
+
count = 0
|
|
121
|
+
for variant in VARIANTS:
|
|
122
|
+
path = agents_dir / f"example-sandbox-{variant}.yaml"
|
|
123
|
+
path.write_text(_content_for_variant(variant), encoding="utf-8")
|
|
124
|
+
count += 1
|
|
125
|
+
return count
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def main() -> None:
|
|
129
|
+
parser = argparse.ArgumentParser(
|
|
130
|
+
description="Generate example sandbox agentspec files by sandbox variant."
|
|
131
|
+
)
|
|
132
|
+
parser.add_argument(
|
|
133
|
+
"--agents-dir",
|
|
134
|
+
type=Path,
|
|
135
|
+
required=True,
|
|
136
|
+
help="Path to agentspecs/agents directory.",
|
|
137
|
+
)
|
|
138
|
+
args = parser.parse_args()
|
|
139
|
+
|
|
140
|
+
generated = generate_specs(args.agents_dir)
|
|
141
|
+
print(f"Generated {generated} sandbox variant agentspec files in {args.agents_dir}")
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
if __name__ == "__main__":
|
|
145
|
+
main()
|