@datalayer/agent-runtimes 0.0.10 → 0.0.11
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/components/AgentConfiguration.d.ts +30 -0
- package/lib/components/AgentConfiguration.js +71 -16
- package/lib/components/chat/components/AgentDetails.js +159 -1
- 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/index.d.ts +2 -2
- package/lib/components/index.js +1 -1
- package/lib/config/agents/code-ai/agents.d.ts +25 -0
- package/lib/config/agents/code-ai/agents.js +70 -0
- package/lib/config/agents/code-ai/index.d.ts +1 -0
- package/lib/config/agents/code-ai/index.js +5 -0
- package/lib/config/{agents.d.ts → agents/codemode-paper/agents.d.ts} +1 -5
- package/lib/config/{agents.js → agents/codemode-paper/agents.js} +29 -165
- package/lib/config/agents/codemode-paper/index.d.ts +1 -0
- package/lib/config/agents/codemode-paper/index.js +5 -0
- package/lib/config/agents/datalayer-ai/agents.d.ts +29 -0
- package/lib/config/agents/datalayer-ai/agents.js +267 -0
- package/lib/config/agents/datalayer-ai/index.d.ts +1 -0
- package/lib/config/agents/datalayer-ai/index.js +5 -0
- package/lib/config/agents/index.d.ts +19 -0
- package/lib/config/agents/index.js +38 -0
- package/lib/config/envvars.d.ts +28 -0
- package/lib/config/envvars.js +115 -0
- package/lib/config/index.d.ts +1 -0
- package/lib/config/index.js +1 -0
- package/lib/config/mcpServers.js +26 -2
- package/lib/config/skills.d.ts +2 -0
- package/lib/config/skills.js +6 -0
- package/lib/examples/AgentSpaceFormExample.js +51 -9
- package/lib/types.d.ts +10 -2
- package/package.json +2 -2
- package/scripts/codegen/generate_agents.py +565 -154
- package/scripts/codegen/generate_envvars.py +302 -0
- package/scripts/codegen/generate_mcp_servers.py +28 -16
- package/scripts/codegen/generate_skills.py +19 -6
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Library - Subfolder Organization.
|
|
3
|
+
*
|
|
4
|
+
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentSpec } from '../../types';
|
|
7
|
+
export declare const AGENT_SPECS: Record<string, AgentSpec>;
|
|
8
|
+
/**
|
|
9
|
+
* Get an agent specification by ID.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAgentSpecs(agentId: string): AgentSpec | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* List all available agent specifications.
|
|
14
|
+
*/
|
|
15
|
+
export declare function listAgentSpecs(): AgentSpec[];
|
|
16
|
+
/**
|
|
17
|
+
* Collect all required environment variables for an agent spec.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAgentSpecRequiredEnvVars(spec: AgentSpec): string[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { AGENT_SPECS as DATALAYER_AI_AGENTS } from './datalayer-ai';
|
|
6
|
+
// Use only the datalayer-ai agent specs
|
|
7
|
+
export const AGENT_SPECS = {
|
|
8
|
+
...DATALAYER_AI_AGENTS,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Get an agent specification by ID.
|
|
12
|
+
*/
|
|
13
|
+
export function getAgentSpecs(agentId) {
|
|
14
|
+
return AGENT_SPECS[agentId];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* List all available agent specifications.
|
|
18
|
+
*/
|
|
19
|
+
export function listAgentSpecs() {
|
|
20
|
+
return Object.values(AGENT_SPECS);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Collect all required environment variables for an agent spec.
|
|
24
|
+
*/
|
|
25
|
+
export function getAgentSpecRequiredEnvVars(spec) {
|
|
26
|
+
const vars = new Set();
|
|
27
|
+
for (const server of spec.mcpServers) {
|
|
28
|
+
for (const v of server.requiredEnvVars ?? []) {
|
|
29
|
+
vars.add(v);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const skill of spec.skills) {
|
|
33
|
+
for (const v of skill.requiredEnvVars ?? []) {
|
|
34
|
+
vars.add(v);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return Array.from(vars);
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Variable Catalog
|
|
3
|
+
*
|
|
4
|
+
* Predefined environment variable specifications.
|
|
5
|
+
*
|
|
6
|
+
* This file is AUTO-GENERATED from YAML specifications.
|
|
7
|
+
* DO NOT EDIT MANUALLY - run 'make specs' to regenerate.
|
|
8
|
+
*/
|
|
9
|
+
export interface EnvvarSpec {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
registrationUrl?: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
icon?: string;
|
|
16
|
+
emoji?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ALPHAVANTAGE_API_KEY_SPEC: EnvvarSpec;
|
|
19
|
+
export declare const GITHUB_TOKEN_SPEC: EnvvarSpec;
|
|
20
|
+
export declare const GOOGLE_OAUTH_CLIENT_ID_SPEC: EnvvarSpec;
|
|
21
|
+
export declare const GOOGLE_OAUTH_CLIENT_SECRET_SPEC: EnvvarSpec;
|
|
22
|
+
export declare const KAGGLE_TOKEN_SPEC: EnvvarSpec;
|
|
23
|
+
export declare const SLACK_BOT_TOKEN_SPEC: EnvvarSpec;
|
|
24
|
+
export declare const SLACK_CHANNEL_IDS_SPEC: EnvvarSpec;
|
|
25
|
+
export declare const SLACK_TEAM_ID_SPEC: EnvvarSpec;
|
|
26
|
+
export declare const TAVILY_API_KEY_SPEC: EnvvarSpec;
|
|
27
|
+
export declare const ENVVAR_CATALOG: Record<string, EnvvarSpec>;
|
|
28
|
+
export declare function getEnvvarSpec(envvarId: string): EnvvarSpec;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Environment Variable Definitions
|
|
7
|
+
// ============================================================================
|
|
8
|
+
export const ALPHAVANTAGE_API_KEY_SPEC = {
|
|
9
|
+
id: 'ALPHAVANTAGE_API_KEY',
|
|
10
|
+
name: 'Alpha Vantage API Key',
|
|
11
|
+
description: 'API key for accessing Alpha Vantage financial market data and stock information. Provides real-time and historical stock prices, forex data, and cryptocurrency information.',
|
|
12
|
+
registrationUrl: 'https://www.alphavantage.co/support/#api-key',
|
|
13
|
+
tags: ['authentication', 'api-key', 'finance', 'stocks', 'market-data'],
|
|
14
|
+
icon: 'key',
|
|
15
|
+
emoji: '🔑',
|
|
16
|
+
};
|
|
17
|
+
export const GITHUB_TOKEN_SPEC = {
|
|
18
|
+
id: 'GITHUB_TOKEN',
|
|
19
|
+
name: 'GitHub Token',
|
|
20
|
+
description: 'GitHub API token for repository management and code operations. Required for GitHub MCP server and GitHub skill to interact with GitHub repositories programmatically.',
|
|
21
|
+
registrationUrl: 'https://github.com/settings/tokens',
|
|
22
|
+
tags: ['authentication', 'token', 'github', 'git', 'mcp-server', 'skill'],
|
|
23
|
+
icon: 'key',
|
|
24
|
+
emoji: '🔑',
|
|
25
|
+
};
|
|
26
|
+
export const GOOGLE_OAUTH_CLIENT_ID_SPEC = {
|
|
27
|
+
id: 'GOOGLE_OAUTH_CLIENT_ID',
|
|
28
|
+
name: 'Google OAuth Client ID',
|
|
29
|
+
description: 'OAuth 2.0 client ID for Google Workspace authentication. Required for Google Drive, Gmail, Calendar, and Docs integration through the Google Workspace MCP server.',
|
|
30
|
+
registrationUrl: 'https://console.cloud.google.com/apis/credentials',
|
|
31
|
+
tags: ['authentication', 'oauth', 'google', 'workspace', 'client-id'],
|
|
32
|
+
icon: 'key',
|
|
33
|
+
emoji: '🔑',
|
|
34
|
+
};
|
|
35
|
+
export const GOOGLE_OAUTH_CLIENT_SECRET_SPEC = {
|
|
36
|
+
id: 'GOOGLE_OAUTH_CLIENT_SECRET',
|
|
37
|
+
name: 'Google OAuth Client Secret',
|
|
38
|
+
description: 'OAuth 2.0 client secret for Google Workspace authentication. Used in conjunction with client ID for secure API access to Google services.',
|
|
39
|
+
registrationUrl: 'https://console.cloud.google.com/apis/credentials',
|
|
40
|
+
tags: [
|
|
41
|
+
'authentication',
|
|
42
|
+
'oauth',
|
|
43
|
+
'google',
|
|
44
|
+
'workspace',
|
|
45
|
+
'client-secret',
|
|
46
|
+
'security',
|
|
47
|
+
],
|
|
48
|
+
icon: 'lock',
|
|
49
|
+
emoji: '🔒',
|
|
50
|
+
};
|
|
51
|
+
export const KAGGLE_TOKEN_SPEC = {
|
|
52
|
+
id: 'KAGGLE_TOKEN',
|
|
53
|
+
name: 'Kaggle API Token',
|
|
54
|
+
description: 'API token for accessing Kaggle datasets, competitions, notebooks, and models. Required for Kaggle MCP server authentication.',
|
|
55
|
+
registrationUrl: 'https://www.kaggle.com/settings/account',
|
|
56
|
+
tags: ['authentication', 'api-key', 'kaggle', 'data'],
|
|
57
|
+
icon: 'key',
|
|
58
|
+
emoji: '🔑',
|
|
59
|
+
};
|
|
60
|
+
export const SLACK_BOT_TOKEN_SPEC = {
|
|
61
|
+
id: 'SLACK_BOT_TOKEN',
|
|
62
|
+
name: 'Slack Bot Token',
|
|
63
|
+
description: 'OAuth token for Slack bot authentication. Required for Slack MCP server to send messages, manage channels, and interact with workspace members.',
|
|
64
|
+
registrationUrl: 'https://api.slack.com/apps',
|
|
65
|
+
tags: ['authentication', 'oauth', 'token', 'slack', 'messaging', 'bot'],
|
|
66
|
+
icon: 'key',
|
|
67
|
+
emoji: '🔑',
|
|
68
|
+
};
|
|
69
|
+
export const SLACK_CHANNEL_IDS_SPEC = {
|
|
70
|
+
id: 'SLACK_CHANNEL_IDS',
|
|
71
|
+
name: 'Slack Channel IDs',
|
|
72
|
+
description: 'Comma-separated list of Slack channel IDs that the bot is allowed to access. Restricts bot operations to specific channels for security and organization.',
|
|
73
|
+
tags: ['configuration', 'slack', 'channels', 'identifier'],
|
|
74
|
+
icon: 'hash',
|
|
75
|
+
emoji: undefined,
|
|
76
|
+
};
|
|
77
|
+
export const SLACK_TEAM_ID_SPEC = {
|
|
78
|
+
id: 'SLACK_TEAM_ID',
|
|
79
|
+
name: 'Slack Team ID',
|
|
80
|
+
description: 'Unique identifier for the Slack workspace (team). Required to specify which workspace the bot should connect to.',
|
|
81
|
+
registrationUrl: 'https://api.slack.com/apps',
|
|
82
|
+
tags: ['configuration', 'slack', 'workspace', 'identifier'],
|
|
83
|
+
icon: 'organization',
|
|
84
|
+
emoji: '🏢',
|
|
85
|
+
};
|
|
86
|
+
export const TAVILY_API_KEY_SPEC = {
|
|
87
|
+
id: 'TAVILY_API_KEY',
|
|
88
|
+
name: 'Tavily API Key',
|
|
89
|
+
description: 'API key for Tavily web search and research capabilities. Required for web crawling, content extraction, and search operations.',
|
|
90
|
+
registrationUrl: 'https://tavily.com/api-keys',
|
|
91
|
+
tags: ['authentication', 'api-key', 'search', 'web', 'research'],
|
|
92
|
+
icon: 'key',
|
|
93
|
+
emoji: '🔑',
|
|
94
|
+
};
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// Environment Variable Catalog
|
|
97
|
+
// ============================================================================
|
|
98
|
+
export const ENVVAR_CATALOG = {
|
|
99
|
+
ALPHAVANTAGE_API_KEY: ALPHAVANTAGE_API_KEY_SPEC,
|
|
100
|
+
GITHUB_TOKEN: GITHUB_TOKEN_SPEC,
|
|
101
|
+
GOOGLE_OAUTH_CLIENT_ID: GOOGLE_OAUTH_CLIENT_ID_SPEC,
|
|
102
|
+
GOOGLE_OAUTH_CLIENT_SECRET: GOOGLE_OAUTH_CLIENT_SECRET_SPEC,
|
|
103
|
+
KAGGLE_TOKEN: KAGGLE_TOKEN_SPEC,
|
|
104
|
+
SLACK_BOT_TOKEN: SLACK_BOT_TOKEN_SPEC,
|
|
105
|
+
SLACK_CHANNEL_IDS: SLACK_CHANNEL_IDS_SPEC,
|
|
106
|
+
SLACK_TEAM_ID: SLACK_TEAM_ID_SPEC,
|
|
107
|
+
TAVILY_API_KEY: TAVILY_API_KEY_SPEC,
|
|
108
|
+
};
|
|
109
|
+
export function getEnvvarSpec(envvarId) {
|
|
110
|
+
const spec = ENVVAR_CATALOG[envvarId];
|
|
111
|
+
if (!spec) {
|
|
112
|
+
throw new Error(`Unknown environment variable: ${envvarId}`);
|
|
113
|
+
}
|
|
114
|
+
return spec;
|
|
115
|
+
}
|
package/lib/config/index.d.ts
CHANGED
package/lib/config/index.js
CHANGED
package/lib/config/mcpServers.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
export const ALPHAVANTAGE_MCP_SERVER = {
|
|
9
9
|
id: 'alphavantage',
|
|
10
10
|
name: 'Alpha Vantage',
|
|
11
|
+
description: 'Financial market data and stock information',
|
|
12
|
+
icon: 'graph',
|
|
13
|
+
emoji: '💹',
|
|
11
14
|
url: '',
|
|
12
15
|
command: 'uvx',
|
|
13
16
|
args: ['av-mcp==0.2.1', '${ALPHAVANTAGE_API_KEY}'],
|
|
@@ -20,6 +23,9 @@ export const ALPHAVANTAGE_MCP_SERVER = {
|
|
|
20
23
|
export const CHART_MCP_SERVER = {
|
|
21
24
|
id: 'chart',
|
|
22
25
|
name: 'Chart Generator',
|
|
26
|
+
description: 'Generate charts and visualizations',
|
|
27
|
+
icon: 'graph',
|
|
28
|
+
emoji: '📊',
|
|
23
29
|
url: '',
|
|
24
30
|
command: 'npx',
|
|
25
31
|
args: ['-y', '@antv/mcp-server-chart'],
|
|
@@ -32,6 +38,9 @@ export const CHART_MCP_SERVER = {
|
|
|
32
38
|
export const FILESYSTEM_MCP_SERVER = {
|
|
33
39
|
id: 'filesystem',
|
|
34
40
|
name: 'Filesystem',
|
|
41
|
+
description: 'Local filesystem read/write operations',
|
|
42
|
+
icon: 'file-directory',
|
|
43
|
+
emoji: '📁',
|
|
35
44
|
url: '',
|
|
36
45
|
command: 'npx',
|
|
37
46
|
args: ['-y', '@modelcontextprotocol/server-filesystem', '$TMPDIR'],
|
|
@@ -44,6 +53,9 @@ export const FILESYSTEM_MCP_SERVER = {
|
|
|
44
53
|
export const GITHUB_MCP_SERVER = {
|
|
45
54
|
id: 'github',
|
|
46
55
|
name: 'GitHub',
|
|
56
|
+
description: 'GitHub repository operations (issues, PRs, code search)',
|
|
57
|
+
icon: 'mark-github',
|
|
58
|
+
emoji: '🐙 - git - collaboration',
|
|
47
59
|
url: '',
|
|
48
60
|
command: 'docker',
|
|
49
61
|
args: [
|
|
@@ -51,18 +63,21 @@ export const GITHUB_MCP_SERVER = {
|
|
|
51
63
|
'-i',
|
|
52
64
|
'--rm',
|
|
53
65
|
'-e',
|
|
54
|
-
'
|
|
66
|
+
'GITHUB_TOKEN',
|
|
55
67
|
'ghcr.io/github/github-mcp-server',
|
|
56
68
|
],
|
|
57
69
|
transport: 'stdio',
|
|
58
70
|
enabled: true,
|
|
59
71
|
isAvailable: false,
|
|
60
72
|
tools: [],
|
|
61
|
-
requiredEnvVars: ['
|
|
73
|
+
requiredEnvVars: ['GITHUB_TOKEN'],
|
|
62
74
|
};
|
|
63
75
|
export const GOOGLE_WORKSPACE_MCP_SERVER = {
|
|
64
76
|
id: 'google-workspace',
|
|
65
77
|
name: 'Google Workspace',
|
|
78
|
+
description: 'Google Drive, Gmail, Calendar, and Docs integration',
|
|
79
|
+
icon: 'mail',
|
|
80
|
+
emoji: '📧',
|
|
66
81
|
url: '',
|
|
67
82
|
command: 'uvx',
|
|
68
83
|
args: ['workspace-mcp'],
|
|
@@ -75,6 +90,9 @@ export const GOOGLE_WORKSPACE_MCP_SERVER = {
|
|
|
75
90
|
export const KAGGLE_MCP_SERVER = {
|
|
76
91
|
id: 'kaggle',
|
|
77
92
|
name: 'Kaggle',
|
|
93
|
+
description: 'Kaggle datasets, models, competitions, and notebooks access',
|
|
94
|
+
icon: 'database',
|
|
95
|
+
emoji: '📊',
|
|
78
96
|
url: '',
|
|
79
97
|
command: 'npx',
|
|
80
98
|
args: [
|
|
@@ -93,6 +111,9 @@ export const KAGGLE_MCP_SERVER = {
|
|
|
93
111
|
export const SLACK_MCP_SERVER = {
|
|
94
112
|
id: 'slack',
|
|
95
113
|
name: 'Slack',
|
|
114
|
+
description: 'Slack messaging and channel operations',
|
|
115
|
+
icon: 'comment-discussion',
|
|
116
|
+
emoji: '💬',
|
|
96
117
|
url: '',
|
|
97
118
|
command: 'npx',
|
|
98
119
|
args: ['-y', '@datalayer/slack-mcp-server'],
|
|
@@ -105,6 +126,9 @@ export const SLACK_MCP_SERVER = {
|
|
|
105
126
|
export const TAVILY_MCP_SERVER = {
|
|
106
127
|
id: 'tavily',
|
|
107
128
|
name: 'Tavily Search',
|
|
129
|
+
description: 'Web search and research capabilities via Tavily API',
|
|
130
|
+
icon: 'search',
|
|
131
|
+
emoji: '🔍',
|
|
108
132
|
url: '',
|
|
109
133
|
command: 'npx',
|
|
110
134
|
args: ['-y', 'tavily-mcp'],
|
package/lib/config/skills.d.ts
CHANGED
package/lib/config/skills.js
CHANGED
|
@@ -14,6 +14,8 @@ export const CRAWL_SKILL_SPEC = {
|
|
|
14
14
|
optionalEnvVars: [],
|
|
15
15
|
dependencies: ['requests>=2.31.0', 'beautifulsoup4>=4.12.0'],
|
|
16
16
|
tags: ['web', 'crawl', 'scraping'],
|
|
17
|
+
icon: 'globe',
|
|
18
|
+
emoji: '🌐',
|
|
17
19
|
enabled: true,
|
|
18
20
|
};
|
|
19
21
|
export const GITHUB_SKILL_SPEC = {
|
|
@@ -25,6 +27,8 @@ export const GITHUB_SKILL_SPEC = {
|
|
|
25
27
|
optionalEnvVars: [],
|
|
26
28
|
dependencies: ['PyGithub>=2.1.0'],
|
|
27
29
|
tags: ['github', 'git', 'code'],
|
|
30
|
+
icon: 'mark-github',
|
|
31
|
+
emoji: '🐙',
|
|
28
32
|
enabled: true,
|
|
29
33
|
};
|
|
30
34
|
export const PDF_SKILL_SPEC = {
|
|
@@ -36,6 +40,8 @@ export const PDF_SKILL_SPEC = {
|
|
|
36
40
|
optionalEnvVars: [],
|
|
37
41
|
dependencies: ['PyPDF2>=3.0.0', 'pdfplumber>=0.10.0'],
|
|
38
42
|
tags: ['pdf', 'documents', 'extraction'],
|
|
43
|
+
icon: 'file',
|
|
44
|
+
emoji: '📄',
|
|
39
45
|
enabled: true,
|
|
40
46
|
};
|
|
41
47
|
// ============================================================================
|
|
@@ -16,6 +16,7 @@ import { Chat, useChatStore } from '../components/chat';
|
|
|
16
16
|
import { useAgentsStore } from './stores/examplesStore';
|
|
17
17
|
import { useIdentity } from '../identity';
|
|
18
18
|
import { MockFileBrowser, MainContent, Header, FooterMetrics, AgentConfiguration, } from '../components';
|
|
19
|
+
import { isSpecSelection, getSpecId } from '../components/AgentConfiguration';
|
|
19
20
|
// Create a query client for React Query
|
|
20
21
|
const queryClient = new QueryClient({
|
|
21
22
|
defaultOptions: {
|
|
@@ -335,7 +336,24 @@ githubClientId, kaggleToken, }) => {
|
|
|
335
336
|
}, [autoSelectMcpServers, enableCodemode, selectedMcpServers, baseUrl]);
|
|
336
337
|
// Track previous MCP servers to detect changes
|
|
337
338
|
const prevMcpServersRef = useRef(selectedMcpServers);
|
|
338
|
-
|
|
339
|
+
// Cache for library specs (fetched on-demand, outside QueryClientProvider)
|
|
340
|
+
const librarySpecsRef = useRef(null);
|
|
341
|
+
const fetchLibrarySpecs = useCallback(async () => {
|
|
342
|
+
if (librarySpecsRef.current)
|
|
343
|
+
return librarySpecsRef.current;
|
|
344
|
+
try {
|
|
345
|
+
const response = await fetch(`${baseUrl}/api/v1/agents/library`);
|
|
346
|
+
if (!response.ok)
|
|
347
|
+
return [];
|
|
348
|
+
const data = await response.json();
|
|
349
|
+
librarySpecsRef.current = data;
|
|
350
|
+
return data;
|
|
351
|
+
}
|
|
352
|
+
catch {
|
|
353
|
+
return [];
|
|
354
|
+
}
|
|
355
|
+
}, [baseUrl]);
|
|
356
|
+
const handleAgentSelect = async (agentId) => {
|
|
339
357
|
setSelectedAgentId(agentId);
|
|
340
358
|
setCreateError(null);
|
|
341
359
|
if (agentId === 'new-agent') {
|
|
@@ -343,6 +361,23 @@ githubClientId, kaggleToken, }) => {
|
|
|
343
361
|
setAgentName(DEFAULT_AGENT_ID);
|
|
344
362
|
setTransport('ag-ui');
|
|
345
363
|
}
|
|
364
|
+
else if (isSpecSelection(agentId)) {
|
|
365
|
+
// Populate form fields from the selected library spec
|
|
366
|
+
const specId = getSpecId(agentId);
|
|
367
|
+
const specs = await fetchLibrarySpecs();
|
|
368
|
+
const spec = specs.find(s => s.id === specId);
|
|
369
|
+
if (spec) {
|
|
370
|
+
setAgentName(spec.id);
|
|
371
|
+
// Keep current transport, model, agentLibrary - user can override
|
|
372
|
+
if (spec.skills.length > 0) {
|
|
373
|
+
setSelectedSkills(spec.skills);
|
|
374
|
+
setEnableCodemode(true);
|
|
375
|
+
}
|
|
376
|
+
if (spec.systemPromptCodemodeAddons) {
|
|
377
|
+
setEnableCodemode(true);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
346
381
|
else {
|
|
347
382
|
const agent = agents.find(a => a.id === agentId);
|
|
348
383
|
if (agent) {
|
|
@@ -358,6 +393,10 @@ githubClientId, kaggleToken, }) => {
|
|
|
358
393
|
setIsCreatingAgent(true);
|
|
359
394
|
setCreateError(null);
|
|
360
395
|
try {
|
|
396
|
+
// Resolve spec ID if creating from a library spec
|
|
397
|
+
const specId = isSpecSelection(selectedAgentId)
|
|
398
|
+
? getSpecId(selectedAgentId)
|
|
399
|
+
: undefined;
|
|
361
400
|
const response = await fetch(`${baseUrl}/api/v1/agents`, {
|
|
362
401
|
method: 'POST',
|
|
363
402
|
headers: {
|
|
@@ -377,6 +416,7 @@ githubClientId, kaggleToken, }) => {
|
|
|
377
416
|
selected_mcp_servers: selectedMcpServers,
|
|
378
417
|
skills: selectedSkills,
|
|
379
418
|
jupyter_sandbox: useJupyterSandbox ? jupyterSandboxUrl : undefined,
|
|
419
|
+
...(specId ? { agent_spec_id: specId } : {}),
|
|
380
420
|
}),
|
|
381
421
|
});
|
|
382
422
|
if (!response.ok) {
|
|
@@ -412,6 +452,7 @@ githubClientId, kaggleToken, }) => {
|
|
|
412
452
|
selectedSkills,
|
|
413
453
|
useJupyterSandbox,
|
|
414
454
|
jupyterSandboxUrl,
|
|
455
|
+
selectedAgentId,
|
|
415
456
|
]);
|
|
416
457
|
/**
|
|
417
458
|
* Delete an agent via the API
|
|
@@ -438,9 +479,11 @@ githubClientId, kaggleToken, }) => {
|
|
|
438
479
|
useEffect(() => {
|
|
439
480
|
prevMcpServersRef.current = selectedMcpServers;
|
|
440
481
|
}, [selectedMcpServers]);
|
|
482
|
+
// True when creating a new agent (blank or from a library spec)
|
|
483
|
+
const isNewMode = selectedAgentId === 'new-agent' || isSpecSelection(selectedAgentId);
|
|
441
484
|
const handleConnect = async () => {
|
|
442
|
-
// For existing agents (not new-agent), ensure transport and agentName are set
|
|
443
|
-
if (
|
|
485
|
+
// For existing agents (not new-agent or spec), ensure transport and agentName are set
|
|
486
|
+
if (!isNewMode) {
|
|
444
487
|
const agent = agents.find(a => a.id === selectedAgentId);
|
|
445
488
|
if (agent) {
|
|
446
489
|
setTransport(agent.transport);
|
|
@@ -477,14 +520,13 @@ githubClientId, kaggleToken, }) => {
|
|
|
477
520
|
};
|
|
478
521
|
const handleReset = async () => {
|
|
479
522
|
// Delete the agent from the server if we created it
|
|
480
|
-
if (selectedAgentId === 'new-agent'
|
|
523
|
+
if ((selectedAgentId === 'new-agent' || isSpecSelection(selectedAgentId)) &&
|
|
524
|
+
agentName) {
|
|
481
525
|
await deleteAgentOnServer(agentName);
|
|
482
526
|
}
|
|
483
527
|
setIsConfigured(false);
|
|
484
528
|
};
|
|
485
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(DatalayerThemeProvider, { children: _jsxs(PageLayout, { containerWidth: "full", children: [_jsx(Header, { activeSession: activeSession, agentName:
|
|
486
|
-
? undefined
|
|
487
|
-
: currentAgent?.description, agentStatus: currentAgent?.status, showContextTree: showContextTree, isNewAgent: selectedAgentId === 'new-agent', isConfigured: isConfigured, onSessionChange: setActiveSession, onToggleContextTree: () => setShowContextTree(!showContextTree), onToggleStatus: currentAgent
|
|
529
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(DatalayerThemeProvider, { children: _jsxs(PageLayout, { containerWidth: "full", children: [_jsx(Header, { activeSession: activeSession, agentName: isNewMode ? undefined : currentAgent?.name, agentDescription: isNewMode ? undefined : currentAgent?.description, agentStatus: currentAgent?.status, showContextTree: showContextTree, isNewAgent: isNewMode, isConfigured: isConfigured, onSessionChange: setActiveSession, onToggleContextTree: () => setShowContextTree(!showContextTree), onToggleStatus: currentAgent
|
|
488
530
|
? () => toggleAgentStatus(currentAgent.id)
|
|
489
531
|
: undefined }), leftPaneVisible ? (_jsxs(_Fragment, { children: [_jsx(Box, { sx: {
|
|
490
532
|
position: 'fixed',
|
|
@@ -498,7 +540,7 @@ githubClientId, kaggleToken, }) => {
|
|
|
498
540
|
border: '1px solid',
|
|
499
541
|
borderLeft: 'none',
|
|
500
542
|
borderColor: 'border.default',
|
|
501
|
-
} }) }), _jsx(PageLayout.Pane, { position: "start", resizable: true, sticky: true, width: { min: '250px', default: '300px', max: '90px' }, children:
|
|
543
|
+
} }) }), _jsx(PageLayout.Pane, { position: "start", resizable: true, sticky: true, width: { min: '250px', default: '300px', max: '90px' }, children: isNewMode ? (_jsxs(Blankslate, { border: true, spacious: true, narrow: true, children: [_jsx(Blankslate.Visual, { children: _jsx(AiAgentIcon, { colored: true, size: 48 }) }), _jsx(Blankslate.Heading, { children: "Agent Runtimes" }), _jsx(Box, { sx: { textAlign: 'center' }, children: _jsx(Blankslate.Description, { children: "Expose AI Agents through multiple protocols." }) })] })) : (_jsx(MockFileBrowser, { codemode: codemode })) })] })) : (_jsx(Box, { sx: {
|
|
502
544
|
position: 'fixed',
|
|
503
545
|
left: 0,
|
|
504
546
|
top: '50%',
|
|
@@ -510,7 +552,7 @@ githubClientId, kaggleToken, }) => {
|
|
|
510
552
|
border: '1px solid',
|
|
511
553
|
borderLeft: 'none',
|
|
512
554
|
borderColor: 'border.default',
|
|
513
|
-
} }) })), _jsx(PageLayout.Content, { children: _jsx(MainContent, { showNotebook: showNotebook, timeTravel: timeTravel, onTimeTravelChange: setTimeTravel, richEditor: false, notebookFile: currentAgent?.notebookFile, lexicalFile: currentAgent?.lexicalFile, isNewAgent:
|
|
555
|
+
} }) })), _jsx(PageLayout.Content, { children: _jsx(MainContent, { showNotebook: showNotebook, timeTravel: timeTravel, onTimeTravelChange: setTimeTravel, richEditor: false, notebookFile: currentAgent?.notebookFile, lexicalFile: currentAgent?.lexicalFile, isNewAgent: isNewMode, isConfigured: isConfigured, baseUrl: baseUrl, agentId: currentAgent?.id || agentName, enableCodemode: enableCodemode, selectedMcpServers: selectedMcpServers, onSelectedMcpServersChange: handleSelectedServersChange, onMcpServersChange: () => {
|
|
514
556
|
// Trigger codemode tool regeneration when MCP servers change at runtime
|
|
515
557
|
console.log('[AgentSpaceFormExample] MCP servers changed, regenerating codemode tools...');
|
|
516
558
|
// The Chat component will pick up the new selectedMcpServers via props
|
package/lib/types.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface MCPServer {
|
|
|
24
24
|
id: string;
|
|
25
25
|
/** Display name for the server */
|
|
26
26
|
name: string;
|
|
27
|
+
/** Server description */
|
|
28
|
+
description?: string;
|
|
27
29
|
/** Server URL (for HTTP-based servers) */
|
|
28
30
|
url: string;
|
|
29
31
|
/** Whether the server is enabled */
|
|
@@ -40,6 +42,10 @@ export interface MCPServer {
|
|
|
40
42
|
transport: 'stdio' | 'http';
|
|
41
43
|
/** Environment variables required by this server (e.g., API keys) */
|
|
42
44
|
requiredEnvVars?: string[];
|
|
45
|
+
/** Icon identifier for the server */
|
|
46
|
+
icon?: string;
|
|
47
|
+
/** Emoji identifier for the server */
|
|
48
|
+
emoji?: string;
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
45
51
|
* Specification for an agent skill.
|
|
@@ -82,8 +88,8 @@ export interface AgentSpec {
|
|
|
82
88
|
description: string;
|
|
83
89
|
/** System prompt for the agent */
|
|
84
90
|
systemPrompt?: string;
|
|
85
|
-
/** System prompt when codemode is enabled */
|
|
86
|
-
|
|
91
|
+
/** System prompt addons when codemode is enabled */
|
|
92
|
+
systemPromptCodemodeAddons?: string;
|
|
87
93
|
/** Tags for categorization */
|
|
88
94
|
tags: string[];
|
|
89
95
|
/** Whether the agent is enabled */
|
|
@@ -96,6 +102,8 @@ export interface AgentSpec {
|
|
|
96
102
|
environmentName: string;
|
|
97
103
|
/** Icon identifier or URL for the agent */
|
|
98
104
|
icon?: string;
|
|
105
|
+
/** Emoji identifier for the agent */
|
|
106
|
+
emoji?: string;
|
|
99
107
|
/** Theme color for the agent (hex code) */
|
|
100
108
|
color?: string;
|
|
101
109
|
/** Chat suggestions to show users what this agent can do */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/agent-runtimes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@agentclientprotocol/sdk": "^0.8.0",
|
|
123
123
|
"@ai-sdk/react": "3.0.30",
|
|
124
124
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
125
|
-
"@datalayer/core": "^0.0.
|
|
125
|
+
"@datalayer/core": "^0.0.27",
|
|
126
126
|
"@datalayer/icons-react": "^1.0.6",
|
|
127
127
|
"@datalayer/jupyter-lexical": "^1.0.9",
|
|
128
128
|
"@datalayer/jupyter-react": "^2.0.3",
|