@datalayer/agent-runtimes 0.0.10 → 0.0.12
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 +2 -2
- package/lib/Agent.d.ts +29 -0
- package/lib/Agent.js +131 -0
- package/lib/AgentLexical.d.ts +34 -0
- package/lib/AgentLexical.js +296 -0
- package/lib/AgentNotebook.d.ts +19 -0
- package/lib/AgentNotebook.js +192 -0
- package/lib/agent-lexical-main.d.ts +1 -0
- package/lib/agent-lexical-main.js +11 -0
- package/lib/agent-main.d.ts +1 -0
- package/lib/agent-main.js +11 -0
- package/lib/agent-notebook-main.d.ts +1 -0
- package/lib/agent-notebook-main.js +12 -0
- package/lib/components/AgentConfiguration.d.ts +33 -21
- package/lib/components/AgentConfiguration.js +76 -21
- package/lib/components/chat/components/AgentDetails.d.ts +3 -1
- package/lib/components/chat/components/AgentDetails.js +164 -6
- package/lib/components/chat/components/Chat.d.ts +29 -3
- package/lib/components/chat/components/Chat.js +64 -59
- package/lib/components/chat/components/ChatFloating.d.ts +34 -12
- package/lib/components/chat/components/ChatFloating.js +54 -21
- package/lib/components/chat/components/ChatInline.d.ts +5 -1
- package/lib/components/chat/components/ChatInline.js +8 -1
- package/lib/components/chat/components/ChatSidebar.d.ts +6 -1
- package/lib/components/chat/components/ChatSidebar.js +2 -2
- package/lib/components/chat/components/ChatStandalone.d.ts +6 -1
- package/lib/components/chat/components/ChatStandalone.js +2 -2
- package/lib/components/chat/components/ContextDistribution.js +2 -2
- package/lib/components/chat/components/ContextInspector.js +4 -2
- package/lib/components/chat/components/ContextPanel.js +1 -6
- package/lib/components/chat/components/base/ChatBase.d.ts +49 -8
- package/lib/components/chat/components/base/ChatBase.js +544 -149
- package/lib/components/chat/components/base/InputPrompt.d.ts +42 -0
- package/lib/components/chat/components/base/InputPrompt.js +131 -0
- package/lib/components/chat/components/index.d.ts +3 -3
- package/lib/components/chat/components/index.js +1 -1
- package/lib/components/chat/components/parts/ReasoningPart.js +2 -4
- package/lib/components/chat/components/parts/TextPart.js +2 -70
- package/lib/components/chat/components/styles/streamdownStyles.d.ts +23 -0
- package/lib/components/chat/components/styles/streamdownStyles.js +319 -0
- package/lib/components/chat/index.d.ts +1 -1
- package/lib/components/chat/index.js +1 -1
- package/lib/components/chat/inference/DatalayerInferenceProvider.js +16 -12
- package/lib/components/chat/inference/SelfHostedInferenceProvider.js +16 -12
- package/lib/components/chat/protocols/AGUIAdapter.d.ts +10 -3
- package/lib/components/chat/protocols/AGUIAdapter.js +123 -44
- package/lib/components/chat/types/tool.d.ts +5 -2
- package/lib/components/index.d.ts +2 -19
- package/lib/components/index.js +1 -10
- package/lib/config/index.d.ts +0 -3
- package/lib/config/index.js +0 -3
- package/lib/examples/A2UiRestaurantExample.js +1 -1
- package/lib/examples/AgentRuntimeChatExample.d.ts +15 -0
- package/lib/examples/AgentRuntimeChatExample.js +126 -0
- package/lib/examples/{AgentSpaceFormExample.d.ts → AgentRuntimeFormExample.d.ts} +3 -3
- package/lib/examples/{AgentSpaceFormExample.js → AgentRuntimeFormExample.js} +61 -17
- package/lib/examples/AgentRuntimeLexicalExample.js +6 -3
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +8 -1
- package/lib/examples/AgentRuntimeNotebookExample.js +6 -5
- package/lib/examples/CopilotKitNotebookExample.js +2 -2
- package/lib/examples/JupyterNotebookExample.js +2 -2
- package/lib/{components → examples/components}/Header.d.ts +2 -1
- package/lib/{components → examples/components}/HeaderControls.js +1 -1
- package/lib/{components → examples/components}/LexicalEditor.d.ts +6 -1
- package/lib/{components → examples/components}/LexicalEditor.js +4 -4
- package/lib/{components → examples/components}/MainContent.d.ts +1 -1
- package/lib/{components → examples/components}/MainContent.js +7 -5
- package/lib/examples/components/index.d.ts +16 -0
- package/lib/examples/components/index.js +13 -0
- package/lib/examples/example-selector.js +2 -1
- package/lib/examples/index.d.ts +1 -1
- package/lib/examples/index.js +1 -1
- package/lib/examples/main.js +2 -2
- package/lib/examples/stores/examplesStore.d.ts +2 -23
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/lexical/ChatInlinePlugin.d.ts +13 -2
- package/lib/lexical/ChatInlinePlugin.js +41 -179
- package/lib/lexical/index.d.ts +1 -0
- package/lib/lexical/index.js +1 -0
- package/lib/lexical/useChatInlineToolbarItems.d.ts +28 -0
- package/lib/lexical/useChatInlineToolbarItems.js +163 -0
- package/lib/runtime/useAgentRuntime.d.ts +1 -1
- package/lib/runtime/useAgentRuntime.js +1 -1
- package/lib/specs/agents/codeai/agents.d.ts +28 -0
- package/lib/specs/agents/codeai/agents.js +151 -0
- package/lib/specs/agents/codeai/index.d.ts +1 -0
- package/lib/specs/agents/codeai/index.js +5 -0
- package/lib/{config → specs/agents/codemode-paper}/agents.d.ts +4 -6
- package/lib/specs/agents/codemode-paper/agents.js +308 -0
- package/lib/specs/agents/codemode-paper/index.d.ts +1 -0
- package/lib/specs/agents/codemode-paper/index.js +5 -0
- package/lib/specs/agents/datalayer-ai/agents.d.ts +31 -0
- package/lib/{config → specs/agents/datalayer-ai}/agents.js +42 -184
- package/lib/specs/agents/datalayer-ai/index.d.ts +1 -0
- package/lib/specs/agents/datalayer-ai/index.js +5 -0
- package/lib/specs/agents/index.d.ts +21 -0
- package/lib/specs/agents/index.js +47 -0
- package/lib/specs/envvars.d.ts +29 -0
- package/lib/specs/envvars.js +125 -0
- package/lib/specs/index.d.ts +5 -0
- package/lib/specs/index.js +9 -0
- package/lib/{config → specs}/mcpServers.d.ts +2 -1
- package/lib/{config → specs}/mcpServers.js +47 -1
- package/lib/specs/models.d.ts +68 -0
- package/lib/specs/models.js +239 -0
- package/lib/{config → specs}/skills.d.ts +2 -0
- package/lib/{config → specs}/skills.js +6 -0
- package/lib/state/substates/AIAgentState.d.ts +0 -1
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.d.ts +11 -22
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +5 -5
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -6
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +4 -4
- package/lib/tools/adapters/agent-runtimes/notebookHooks.d.ts +6 -6
- package/lib/tools/adapters/agent-runtimes/notebookHooks.js +4 -4
- package/lib/{types.d.ts → types/Types.d.ts} +42 -8
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/package.json +11 -5
- package/scripts/codegen/generate_agents.py +608 -157
- package/scripts/codegen/generate_envvars.py +302 -0
- package/scripts/codegen/generate_mcp_servers.py +33 -21
- package/scripts/codegen/generate_models.py +486 -0
- package/scripts/codegen/generate_skills.py +21 -8
- package/style/primer-primitives.css +22 -0
- package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +0 -37
- package/lib/components/chat/components/elements/ChatInputPrompt.js +0 -150
- /package/lib/{components → examples/components}/FooterMetrics.d.ts +0 -0
- /package/lib/{components → examples/components}/FooterMetrics.js +0 -0
- /package/lib/{components → examples/components}/Header.js +0 -0
- /package/lib/{components → examples/components}/HeaderControls.d.ts +0 -0
- /package/lib/{components → examples/components}/MockFileBrowser.d.ts +0 -0
- /package/lib/{components → examples/components}/MockFileBrowser.js +0 -0
- /package/lib/{components → examples/components}/SessionTabs.d.ts +0 -0
- /package/lib/{components → examples/components}/SessionTabs.js +0 -0
- /package/lib/{components → examples/components}/TimeTravel.d.ts +0 -0
- /package/lib/{components → examples/components}/TimeTravel.js +0 -0
- /package/lib/{types.js → types/Types.js} +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { FILESYSTEM_MCP_SERVER, KAGGLE_MCP_SERVER, TAVILY_MCP_SERVER, } from '../../mcpServers';
|
|
6
|
+
import { GITHUB_SKILL_SPEC } from '../../skills';
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// MCP Server Lookup
|
|
9
|
+
// ============================================================================
|
|
10
|
+
const MCP_SERVER_MAP = {
|
|
11
|
+
filesystem: FILESYSTEM_MCP_SERVER,
|
|
12
|
+
kaggle: KAGGLE_MCP_SERVER,
|
|
13
|
+
tavily: TAVILY_MCP_SERVER,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Map skill IDs to SkillSpec objects, converting to AgentSkillSpec shape.
|
|
17
|
+
*/
|
|
18
|
+
const SKILL_MAP = {
|
|
19
|
+
github: GITHUB_SKILL_SPEC,
|
|
20
|
+
};
|
|
21
|
+
function toAgentSkillSpec(skill) {
|
|
22
|
+
return {
|
|
23
|
+
id: skill.id,
|
|
24
|
+
name: skill.name,
|
|
25
|
+
description: skill.description,
|
|
26
|
+
version: '1.0.0',
|
|
27
|
+
tags: skill.tags,
|
|
28
|
+
enabled: skill.enabled,
|
|
29
|
+
requiredEnvVars: skill.requiredEnvVars,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// ============================================================================
|
|
33
|
+
// Agent Specs
|
|
34
|
+
// ============================================================================
|
|
35
|
+
// Codeai Agents
|
|
36
|
+
// ============================================================================
|
|
37
|
+
export const DATA_ACQUISITION_AGENT_SPEC = {
|
|
38
|
+
id: 'codeai/data-acquisition',
|
|
39
|
+
name: 'Data Acquisition Agent',
|
|
40
|
+
description: `Acquires and manages data from various sources including Kaggle datasets and local filesystem operations.`,
|
|
41
|
+
tags: ['data', 'acquisition', 'kaggle', 'filesystem'],
|
|
42
|
+
enabled: true,
|
|
43
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
44
|
+
mcpServers: [
|
|
45
|
+
MCP_SERVER_MAP['kaggle'],
|
|
46
|
+
MCP_SERVER_MAP['filesystem'],
|
|
47
|
+
MCP_SERVER_MAP['tavily'],
|
|
48
|
+
],
|
|
49
|
+
skills: [toAgentSkillSpec(SKILL_MAP['github'])],
|
|
50
|
+
environmentName: 'ai-agents-env',
|
|
51
|
+
icon: 'database',
|
|
52
|
+
emoji: '📊',
|
|
53
|
+
color: '#3B82F6',
|
|
54
|
+
suggestions: [
|
|
55
|
+
'Find popular machine learning datasets on Kaggle',
|
|
56
|
+
'Download and explore a dataset for sentiment analysis',
|
|
57
|
+
'List available files in my workspace',
|
|
58
|
+
'Search Kaggle for time series forecasting competitions',
|
|
59
|
+
],
|
|
60
|
+
sandboxVariant: 'jupyter',
|
|
61
|
+
systemPrompt: `You are a data acquisition specialist with access to Kaggle datasets and filesystem tools. You can search for datasets, download data, read and write files, and help users prepare data for analysis. Guide users through finding relevant datasets and organizing their workspace efficiently.
|
|
62
|
+
`,
|
|
63
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
64
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
65
|
+
Use this to see what MCP servers you can access.
|
|
66
|
+
|
|
67
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
68
|
+
Use this to find relevant tools before executing tasks.
|
|
69
|
+
|
|
70
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
71
|
+
Use this to understand tool parameters before calling them.
|
|
72
|
+
|
|
73
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
74
|
+
Use this for complex multi-step operations. Code runs in a PERSISTENT sandbox.
|
|
75
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
76
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
77
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
78
|
+
|
|
79
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check parameters 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
80
|
+
## Token Efficiency When possible, chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important.
|
|
81
|
+
`,
|
|
82
|
+
};
|
|
83
|
+
export const SIMPLE_AGENT_SPEC = {
|
|
84
|
+
id: 'codeai/simple',
|
|
85
|
+
name: 'A Simple Agent',
|
|
86
|
+
description: `A simple conversational agent. No tools, no MCP servers, no skills — just a helpful AI assistant you can chat with.`,
|
|
87
|
+
tags: ['simple', 'chat', 'assistant'],
|
|
88
|
+
enabled: true,
|
|
89
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
90
|
+
mcpServers: [],
|
|
91
|
+
skills: [],
|
|
92
|
+
environmentName: 'ai-agents-env',
|
|
93
|
+
icon: 'share-2',
|
|
94
|
+
emoji: '🤖',
|
|
95
|
+
color: '#6366F1',
|
|
96
|
+
suggestions: [
|
|
97
|
+
'Tell me a joke',
|
|
98
|
+
'Explain quantum computing in simple terms',
|
|
99
|
+
'Help me brainstorm ideas for a weekend project',
|
|
100
|
+
'Summarize the key points of a topic I describe',
|
|
101
|
+
],
|
|
102
|
+
sandboxVariant: 'jupyter',
|
|
103
|
+
systemPrompt: `You are a helpful, friendly AI assistant. You do not have access to any external tools, MCP servers, or skills. Answer questions using your training knowledge, be concise, and let the user know if a question is outside your knowledge.
|
|
104
|
+
`,
|
|
105
|
+
systemPromptCodemodeAddons: undefined,
|
|
106
|
+
};
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// Agent Specs Registry
|
|
109
|
+
// ============================================================================
|
|
110
|
+
export const AGENT_SPECS = {
|
|
111
|
+
// Codeai
|
|
112
|
+
'codeai/data-acquisition': DATA_ACQUISITION_AGENT_SPEC,
|
|
113
|
+
'codeai/simple': SIMPLE_AGENT_SPEC,
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Get an agent specification by ID.
|
|
117
|
+
*/
|
|
118
|
+
export function getAgentSpecs(agentId) {
|
|
119
|
+
return AGENT_SPECS[agentId];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* List all available agent specifications.
|
|
123
|
+
*
|
|
124
|
+
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
125
|
+
*/
|
|
126
|
+
export function listAgentSpecs(prefix) {
|
|
127
|
+
const specs = Object.values(AGENT_SPECS);
|
|
128
|
+
return prefix !== undefined
|
|
129
|
+
? specs.filter(s => s.id.startsWith(prefix))
|
|
130
|
+
: specs;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Collect all required environment variables for an agent spec.
|
|
134
|
+
*
|
|
135
|
+
* Iterates over the spec's MCP servers and skills and returns the
|
|
136
|
+
* deduplicated union of their `requiredEnvVars` arrays.
|
|
137
|
+
*/
|
|
138
|
+
export function getAgentSpecRequiredEnvVars(spec) {
|
|
139
|
+
const vars = new Set();
|
|
140
|
+
for (const server of spec.mcpServers) {
|
|
141
|
+
for (const v of server.requiredEnvVars ?? []) {
|
|
142
|
+
vars.add(v);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
for (const skill of spec.skills) {
|
|
146
|
+
for (const v of skill.requiredEnvVars ?? []) {
|
|
147
|
+
vars.add(v);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return Array.from(vars);
|
|
151
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agents';
|
|
@@ -5,16 +5,12 @@
|
|
|
5
5
|
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
6
6
|
* Generated from YAML specifications in specs/agents/
|
|
7
7
|
*/
|
|
8
|
-
import type { AgentSpec } from '
|
|
9
|
-
export declare const CRAWLER_MCP_AGENT_SPEC: AgentSpec;
|
|
8
|
+
import type { AgentSpec } from '../../../types/Types';
|
|
10
9
|
export declare const CRAWLER_AGENT_SPEC: AgentSpec;
|
|
11
10
|
export declare const DATA_ACQUISITION_AGENT_SPEC: AgentSpec;
|
|
12
11
|
export declare const FINANCIAL_VIZ_AGENT_SPEC: AgentSpec;
|
|
13
|
-
export declare const FINANCIAL_AGENT_SPEC: AgentSpec;
|
|
14
|
-
export declare const GITHUB_AGENT_MCP_AGENT_SPEC: AgentSpec;
|
|
15
12
|
export declare const GITHUB_AGENT_SPEC: AgentSpec;
|
|
16
13
|
export declare const INFORMATION_ROUTING_AGENT_SPEC: AgentSpec;
|
|
17
|
-
export declare const SIMPLE_AGENT_SPEC: AgentSpec;
|
|
18
14
|
export declare const AGENT_SPECS: Record<string, AgentSpec>;
|
|
19
15
|
/**
|
|
20
16
|
* Get an agent specification by ID.
|
|
@@ -22,8 +18,10 @@ export declare const AGENT_SPECS: Record<string, AgentSpec>;
|
|
|
22
18
|
export declare function getAgentSpecs(agentId: string): AgentSpec | undefined;
|
|
23
19
|
/**
|
|
24
20
|
* List all available agent specifications.
|
|
21
|
+
*
|
|
22
|
+
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
25
23
|
*/
|
|
26
|
-
export declare function listAgentSpecs(): AgentSpec[];
|
|
24
|
+
export declare function listAgentSpecs(prefix?: string): AgentSpec[];
|
|
27
25
|
/**
|
|
28
26
|
* Collect all required environment variables for an agent spec.
|
|
29
27
|
*
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { ALPHAVANTAGE_MCP_SERVER, CHART_MCP_SERVER, FILESYSTEM_MCP_SERVER, GITHUB_MCP_SERVER, GOOGLE_WORKSPACE_MCP_SERVER, HUGGINGFACE_MCP_SERVER, KAGGLE_MCP_SERVER, TAVILY_MCP_SERVER, } from '../../mcpServers';
|
|
6
|
+
import { GITHUB_SKILL_SPEC } from '../../skills';
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// MCP Server Lookup
|
|
9
|
+
// ============================================================================
|
|
10
|
+
const MCP_SERVER_MAP = {
|
|
11
|
+
alphavantage: ALPHAVANTAGE_MCP_SERVER,
|
|
12
|
+
chart: CHART_MCP_SERVER,
|
|
13
|
+
filesystem: FILESYSTEM_MCP_SERVER,
|
|
14
|
+
github: GITHUB_MCP_SERVER,
|
|
15
|
+
'google-workspace': GOOGLE_WORKSPACE_MCP_SERVER,
|
|
16
|
+
huggingface: HUGGINGFACE_MCP_SERVER,
|
|
17
|
+
kaggle: KAGGLE_MCP_SERVER,
|
|
18
|
+
tavily: TAVILY_MCP_SERVER,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Map skill IDs to SkillSpec objects, converting to AgentSkillSpec shape.
|
|
22
|
+
*/
|
|
23
|
+
const SKILL_MAP = {
|
|
24
|
+
github: GITHUB_SKILL_SPEC,
|
|
25
|
+
};
|
|
26
|
+
function toAgentSkillSpec(skill) {
|
|
27
|
+
return {
|
|
28
|
+
id: skill.id,
|
|
29
|
+
name: skill.name,
|
|
30
|
+
description: skill.description,
|
|
31
|
+
version: '1.0.0',
|
|
32
|
+
tags: skill.tags,
|
|
33
|
+
enabled: skill.enabled,
|
|
34
|
+
requiredEnvVars: skill.requiredEnvVars,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// ============================================================================
|
|
38
|
+
// Agent Specs
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Codemode Paper Agents
|
|
41
|
+
// ============================================================================
|
|
42
|
+
export const CRAWLER_AGENT_SPEC = {
|
|
43
|
+
id: 'codemode-paper/crawler',
|
|
44
|
+
name: 'Crawler Agent',
|
|
45
|
+
description: `Web crawling and research agent that searches the web and GitHub repositories for information.`,
|
|
46
|
+
tags: ['web', 'search', 'research', 'crawler', 'github'],
|
|
47
|
+
enabled: false,
|
|
48
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
49
|
+
mcpServers: [
|
|
50
|
+
MCP_SERVER_MAP['tavily'],
|
|
51
|
+
MCP_SERVER_MAP['github'],
|
|
52
|
+
MCP_SERVER_MAP['kaggle'],
|
|
53
|
+
MCP_SERVER_MAP['huggingface'],
|
|
54
|
+
],
|
|
55
|
+
skills: [],
|
|
56
|
+
environmentName: 'ai-agents-env',
|
|
57
|
+
icon: 'globe',
|
|
58
|
+
emoji: '🌐',
|
|
59
|
+
color: '#10B981',
|
|
60
|
+
suggestions: [
|
|
61
|
+
'Search the web for recent news about AI agents',
|
|
62
|
+
'Find trending open-source Python projects on GitHub',
|
|
63
|
+
'Research best practices for building RAG applications',
|
|
64
|
+
'Compare popular JavaScript frameworks in 2024',
|
|
65
|
+
],
|
|
66
|
+
sandboxVariant: 'local-eval',
|
|
67
|
+
systemPrompt: `You are a web crawling and research assistant with access to Tavily search and GitHub tools. Use Tavily to search the web for current information and search GitHub repositories for relevant projects. Synthesize information from multiple sources and provide clear summaries with sources cited.
|
|
68
|
+
`,
|
|
69
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
70
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
71
|
+
Use this to see what MCP servers you can access.
|
|
72
|
+
|
|
73
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
74
|
+
Use this to find relevant tools before executing tasks.
|
|
75
|
+
|
|
76
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
77
|
+
Use this to understand tool parameters before calling them.
|
|
78
|
+
|
|
79
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
80
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
81
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
82
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
83
|
+
|
|
84
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check parameters 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
85
|
+
## Token Efficiency Always chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important.
|
|
86
|
+
For huggingface tools, use search_doc tool to understand other tools return's schema.
|
|
87
|
+
`,
|
|
88
|
+
};
|
|
89
|
+
export const DATA_ACQUISITION_AGENT_SPEC = {
|
|
90
|
+
id: 'codemode-paper/data-acquisition',
|
|
91
|
+
name: 'Data Acquisition Agent',
|
|
92
|
+
description: `Acquires and manages data from various sources including Kaggle datasets and local filesystem operations.`,
|
|
93
|
+
tags: ['data', 'acquisition', 'kaggle', 'filesystem'],
|
|
94
|
+
enabled: true,
|
|
95
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
96
|
+
mcpServers: [
|
|
97
|
+
MCP_SERVER_MAP['kaggle'],
|
|
98
|
+
MCP_SERVER_MAP['filesystem'],
|
|
99
|
+
MCP_SERVER_MAP['tavily'],
|
|
100
|
+
],
|
|
101
|
+
skills: [toAgentSkillSpec(SKILL_MAP['github'])],
|
|
102
|
+
environmentName: 'ai-agents-env',
|
|
103
|
+
icon: 'database',
|
|
104
|
+
emoji: '📊',
|
|
105
|
+
color: '#3B82F6',
|
|
106
|
+
suggestions: [
|
|
107
|
+
'Find popular machine learning datasets on Kaggle',
|
|
108
|
+
'Download and explore a dataset for sentiment analysis',
|
|
109
|
+
'List available files in my workspace',
|
|
110
|
+
'Search Kaggle for time series forecasting competitions',
|
|
111
|
+
],
|
|
112
|
+
sandboxVariant: 'local-eval',
|
|
113
|
+
systemPrompt: `You are a data acquisition specialist with access to Kaggle datasets and filesystem tools. You can search for datasets, download data, read and write files, and help users prepare data for analysis. Guide users through finding relevant datasets and organizing their workspace efficiently.
|
|
114
|
+
`,
|
|
115
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
116
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
117
|
+
Use this to see what MCP servers you can access.
|
|
118
|
+
|
|
119
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
120
|
+
Use this to find relevant tools before executing tasks.
|
|
121
|
+
|
|
122
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
123
|
+
Use this to understand tool parameters before calling them.
|
|
124
|
+
|
|
125
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
126
|
+
Use this for complex multi-step operations. Code runs in a PERSISTENT sandbox.
|
|
127
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
128
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
129
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
130
|
+
|
|
131
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check parameters 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
132
|
+
## Token Efficiency When possible, chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important.
|
|
133
|
+
`,
|
|
134
|
+
};
|
|
135
|
+
export const FINANCIAL_VIZ_AGENT_SPEC = {
|
|
136
|
+
id: 'codemode-paper/financial-viz',
|
|
137
|
+
name: 'Financial Visualization Agent',
|
|
138
|
+
description: `Analyzes financial market data and creates visualizations and charts.`,
|
|
139
|
+
tags: ['finance', 'stocks', 'visualization', 'charts'],
|
|
140
|
+
enabled: false,
|
|
141
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
142
|
+
mcpServers: [MCP_SERVER_MAP['alphavantage'], MCP_SERVER_MAP['chart']],
|
|
143
|
+
skills: [],
|
|
144
|
+
environmentName: 'ai-agents-env',
|
|
145
|
+
icon: 'trending-up',
|
|
146
|
+
emoji: '📈',
|
|
147
|
+
color: '#F59E0B',
|
|
148
|
+
suggestions: [
|
|
149
|
+
'Show me the stock price history for AAPL',
|
|
150
|
+
'Create a chart comparing MSFT and GOOGL over the last year',
|
|
151
|
+
'Analyze the trading volume trends for Tesla',
|
|
152
|
+
'Get the latest market news for tech stocks',
|
|
153
|
+
],
|
|
154
|
+
sandboxVariant: 'local-eval',
|
|
155
|
+
systemPrompt: `You are a financial market analyst with access to Alpha Vantage market data and chart generation tools. You can fetch stock prices, analyze trading volumes, create visualizations, and track market trends. Provide clear insights with relevant data points and generate charts to illustrate patterns.
|
|
156
|
+
`,
|
|
157
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
158
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
159
|
+
Use this to see what MCP servers you can access.
|
|
160
|
+
|
|
161
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
162
|
+
Use this to find relevant tools before executing tasks.
|
|
163
|
+
|
|
164
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
165
|
+
Use this to understand tool parameters before calling them.
|
|
166
|
+
|
|
167
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
168
|
+
Use this for complex multi-step operations. Code runs in a PERSISTENT sandbox.
|
|
169
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
170
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
171
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
172
|
+
|
|
173
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check parameters 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
174
|
+
## Token Efficiency When possible, chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important.
|
|
175
|
+
`,
|
|
176
|
+
};
|
|
177
|
+
export const GITHUB_AGENT_SPEC = {
|
|
178
|
+
id: 'codemode-paper/github-agent',
|
|
179
|
+
name: 'GitHub Agent',
|
|
180
|
+
description: `Manages GitHub repositories, issues, and pull requests with email notification capabilities.`,
|
|
181
|
+
tags: ['github', 'git', 'code', 'email'],
|
|
182
|
+
enabled: false,
|
|
183
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
184
|
+
mcpServers: [MCP_SERVER_MAP['github'], MCP_SERVER_MAP['google-workspace']],
|
|
185
|
+
skills: [],
|
|
186
|
+
environmentName: 'ai-agents-env',
|
|
187
|
+
icon: 'git-branch',
|
|
188
|
+
emoji: '🐙',
|
|
189
|
+
color: '#6366F1',
|
|
190
|
+
suggestions: [
|
|
191
|
+
'List my open pull requests across all repositories',
|
|
192
|
+
'Create an issue for a bug I found in datalayer/ui',
|
|
193
|
+
'Show recent commits on the main branch',
|
|
194
|
+
'Search for repositories related to Jupyter notebooks',
|
|
195
|
+
],
|
|
196
|
+
sandboxVariant: 'local-eval',
|
|
197
|
+
systemPrompt: `You are a GitHub assistant with access to GitHub repository tools and Google Workspace for email notifications.
|
|
198
|
+
`,
|
|
199
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
200
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
201
|
+
Use this to see what MCP servers you can access.
|
|
202
|
+
|
|
203
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
204
|
+
Use this to find relevant tools before executing tasks.
|
|
205
|
+
|
|
206
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
207
|
+
Use this to understand tool parameters before calling them.
|
|
208
|
+
|
|
209
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
210
|
+
Code runs in a PERSISTENT sandbox.
|
|
211
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
212
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
213
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
214
|
+
|
|
215
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check parameters 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
216
|
+
## Token Efficiency Always chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important.
|
|
217
|
+
`,
|
|
218
|
+
};
|
|
219
|
+
export const INFORMATION_ROUTING_AGENT_SPEC = {
|
|
220
|
+
id: 'codemode-paper/information-routing',
|
|
221
|
+
name: 'Information Routing Agent',
|
|
222
|
+
description: `Routes information between Google Drive and other services, managing document workflows and information sharing.`,
|
|
223
|
+
tags: ['workflow', 'communication', 'gdrive'],
|
|
224
|
+
enabled: false,
|
|
225
|
+
model: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
226
|
+
mcpServers: [MCP_SERVER_MAP['google-workspace'], MCP_SERVER_MAP['github']],
|
|
227
|
+
skills: [],
|
|
228
|
+
environmentName: 'ai-agents-env',
|
|
229
|
+
icon: 'share-2',
|
|
230
|
+
emoji: '🔀',
|
|
231
|
+
color: '#EC4899',
|
|
232
|
+
suggestions: [
|
|
233
|
+
'Find documents shared with me in Google Drive',
|
|
234
|
+
'List recent files in my Drive folder',
|
|
235
|
+
'Summarize the contents of a document in my Drive',
|
|
236
|
+
'Search for documents by keyword in Google Drive',
|
|
237
|
+
],
|
|
238
|
+
sandboxVariant: 'local-eval',
|
|
239
|
+
systemPrompt: `You are an information routing specialist with access to Google Drive tools. You can find and manage documents in Drive and automate document workflows. Help users with document management efficiently. Do not use file extension when referring to Google Drive documents. Always use search_drive_files tool before using get_drive_file_content to find parent folder (using only name and mimeType in the query, no other fields!!!).
|
|
240
|
+
`,
|
|
241
|
+
systemPromptCodemodeAddons: `## IMPORTANT: Be Honest About Your Capabilities NEVER claim to have tools or capabilities you haven't verified.
|
|
242
|
+
## Core Codemode Tools Use these 4 tools to accomplish any task: 1. **list_servers** - List available MCP servers
|
|
243
|
+
Use this to see what MCP servers you can access.
|
|
244
|
+
|
|
245
|
+
2. **search_tools** - Progressive tool discovery by natural language query
|
|
246
|
+
Use this to find relevant tools before executing tasks.
|
|
247
|
+
|
|
248
|
+
3. **get_tool_details** - Get full tool schema and documentation
|
|
249
|
+
Use this to understand tool parameters before calling them. If no output schema is specified, try using the tool on a subset and preview the result.
|
|
250
|
+
|
|
251
|
+
4. **execute_code** - Run Python code that composes multiple tools
|
|
252
|
+
Use this for complex multi-step operations. Code runs in a PERSISTENT sandbox.
|
|
253
|
+
Variables, functions, and state PERSIST between execute_code calls.
|
|
254
|
+
Import tools using: \`from generated.servers.<server_name> import <function_name>\`
|
|
255
|
+
NEVER use \`import *\` - always use explicit named imports.
|
|
256
|
+
|
|
257
|
+
## Recommended Workflow 1. **Discover**: Use list_servers and search_tools to find relevant tools 2. **Understand**: Use get_tool_details to check input and output schemas 3. **Execute**: Use execute_code to perform multi-step tasks, calling tools as needed
|
|
258
|
+
## Token Efficiency Always chain multiple tool calls in a single execute_code block. This reduces output tokens by processing intermediate results in code rather than returning them. If you want to examine results, print subsets, preview (maximum 20 first characters) and/or counts instead of full data, this is really important!!!!
|
|
259
|
+
`,
|
|
260
|
+
};
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Agent Specs Registry
|
|
263
|
+
// ============================================================================
|
|
264
|
+
export const AGENT_SPECS = {
|
|
265
|
+
// Codemode Paper
|
|
266
|
+
'codemode-paper/crawler': CRAWLER_AGENT_SPEC,
|
|
267
|
+
'codemode-paper/data-acquisition': DATA_ACQUISITION_AGENT_SPEC,
|
|
268
|
+
'codemode-paper/financial-viz': FINANCIAL_VIZ_AGENT_SPEC,
|
|
269
|
+
'codemode-paper/github-agent': GITHUB_AGENT_SPEC,
|
|
270
|
+
'codemode-paper/information-routing': INFORMATION_ROUTING_AGENT_SPEC,
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Get an agent specification by ID.
|
|
274
|
+
*/
|
|
275
|
+
export function getAgentSpecs(agentId) {
|
|
276
|
+
return AGENT_SPECS[agentId];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* List all available agent specifications.
|
|
280
|
+
*
|
|
281
|
+
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
282
|
+
*/
|
|
283
|
+
export function listAgentSpecs(prefix) {
|
|
284
|
+
const specs = Object.values(AGENT_SPECS);
|
|
285
|
+
return prefix !== undefined
|
|
286
|
+
? specs.filter(s => s.id.startsWith(prefix))
|
|
287
|
+
: specs;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Collect all required environment variables for an agent spec.
|
|
291
|
+
*
|
|
292
|
+
* Iterates over the spec's MCP servers and skills and returns the
|
|
293
|
+
* deduplicated union of their `requiredEnvVars` arrays.
|
|
294
|
+
*/
|
|
295
|
+
export function getAgentSpecRequiredEnvVars(spec) {
|
|
296
|
+
const vars = new Set();
|
|
297
|
+
for (const server of spec.mcpServers) {
|
|
298
|
+
for (const v of server.requiredEnvVars ?? []) {
|
|
299
|
+
vars.add(v);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
for (const skill of spec.skills) {
|
|
303
|
+
for (const v of skill.requiredEnvVars ?? []) {
|
|
304
|
+
vars.add(v);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return Array.from(vars);
|
|
308
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agents';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Library.
|
|
3
|
+
*
|
|
4
|
+
* Predefined agent specifications that can be instantiated as AgentSpaces.
|
|
5
|
+
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
6
|
+
* Generated from YAML specifications in specs/agents/
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentSpec } from '../../../types/Types';
|
|
9
|
+
export declare const CRAWLER_AGENT_SPEC: AgentSpec;
|
|
10
|
+
export declare const DATA_ACQUISITION_AGENT_SPEC: AgentSpec;
|
|
11
|
+
export declare const FINANCIAL_AGENT_SPEC: AgentSpec;
|
|
12
|
+
export declare const GITHUB_AGENT_SPEC: AgentSpec;
|
|
13
|
+
export declare const SIMPLE_AGENT_SPEC: AgentSpec;
|
|
14
|
+
export declare const AGENT_SPECS: Record<string, AgentSpec>;
|
|
15
|
+
/**
|
|
16
|
+
* Get an agent specification by ID.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getAgentSpecs(agentId: string): AgentSpec | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* List all available agent specifications.
|
|
21
|
+
*
|
|
22
|
+
* @param prefix - If provided, only return specs whose ID starts with this prefix.
|
|
23
|
+
*/
|
|
24
|
+
export declare function listAgentSpecs(prefix?: string): AgentSpec[];
|
|
25
|
+
/**
|
|
26
|
+
* Collect all required environment variables for an agent spec.
|
|
27
|
+
*
|
|
28
|
+
* Iterates over the spec's MCP servers and skills and returns the
|
|
29
|
+
* deduplicated union of their `requiredEnvVars` arrays.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getAgentSpecRequiredEnvVars(spec: AgentSpec): string[];
|