@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
|
@@ -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()
|
|
Binary file
|