@datalayer/agent-runtimes 1.0.0 → 1.0.2
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/Agent.js +1 -2
- package/lib/AgentLexical.js +1 -2
- package/lib/AgentNotebook.js +1 -2
- package/lib/components/McpServerManager.d.ts +1 -1
- package/lib/components/McpServerManager.js +1 -1
- package/lib/components/chat/components/Chat.d.ts +1 -1
- package/lib/components/chat/components/ChatFloating.d.ts +4 -2
- package/lib/components/chat/components/ChatFloating.js +1 -1
- package/lib/components/chat/components/base/ChatBase.d.ts +1 -1
- package/lib/components/chat/components/base/ChatBase.js +4 -2
- package/lib/components/chat/store/conversationStore.d.ts +1 -1
- package/lib/components/chat/store/conversationStore.js +2 -2
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/AgUiAgenticExample.js +3 -3
- package/lib/examples/AgUiBackendToolRenderingExample.js +4 -3
- package/lib/examples/AgUiHaikuGenUIExample.js +4 -3
- package/lib/examples/AgUiHumanInTheLoopExample.js +4 -3
- package/lib/examples/AgUiSharedStateExample.js +4 -3
- package/lib/examples/AgUiToolsBasedGenUIExample.js +4 -3
- package/lib/examples/AgentRuntimeChatExample.js +3 -3
- package/lib/examples/AgentRuntimeCustomExample.js +2 -2
- package/lib/examples/AgentRuntimeFormExample.js +2 -2
- package/lib/examples/AgentRuntimeLexical2Example.js +3 -2
- package/lib/examples/AgentRuntimeLexicalExample.js +4 -3
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +3 -2
- package/lib/examples/AgentRuntimeNotebookExample.js +4 -3
- package/lib/examples/AgentRuntimeNotebookSidebarExample.js +3 -2
- package/lib/examples/AgentRuntimeStandaloneExample.js +3 -3
- package/lib/examples/CopilotKitLexicalExample.js +3 -2
- package/lib/examples/CopilotKitNotebookExample.js +3 -2
- package/lib/examples/DatalayerNotebookExample.js +3 -2
- package/lib/examples/JupyterCellExample.js +3 -2
- package/lib/examples/JupyterNotebookExample.js +3 -2
- package/lib/examples/main.js +68 -18
- package/lib/examples/stores/themeStore.d.ts +33 -0
- package/lib/examples/stores/themeStore.js +38 -0
- package/lib/examples/stores/themedProvider.d.ts +45 -0
- package/lib/examples/stores/themedProvider.js +54 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/index.js +8 -0
- package/lib/hooks/useAgentRuntimes.d.ts +350 -0
- package/lib/hooks/useAgentRuntimes.js +78 -0
- package/lib/hooks/useAgentStore.d.ts +30 -0
- package/lib/hooks/useAgentStore.js +22 -0
- package/lib/specs/agents/codeai/agents.d.ts +1 -1
- package/lib/specs/agents/codeai/agents.js +28 -0
- package/lib/specs/agents/codemode-paper/agents.d.ts +1 -1
- package/lib/specs/agents/codemode-paper/agents.js +71 -1
- package/lib/specs/agents/datalayer-ai/agents.d.ts +1 -1
- package/lib/specs/agents/datalayer-ai/agents.js +70 -0
- package/lib/specs/agents/index.js +2 -0
- package/lib/specs/agents/mocks/agents.d.ts +43 -0
- package/lib/specs/agents/mocks/agents.js +2293 -0
- package/lib/specs/agents/mocks/index.d.ts +1 -0
- package/lib/specs/agents/mocks/index.js +5 -0
- package/lib/specs/mcpServers.d.ts +1 -0
- package/lib/specs/mcpServers.js +16 -0
- package/lib/specs/models.d.ts +2 -2
- package/lib/specs/models.js +5 -5
- package/lib/types/Types.d.ts +29 -1
- package/package.json +4 -3
- package/scripts/codegen/generate_agents.py +95 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agents';
|
|
@@ -14,6 +14,7 @@ export declare const GITHUB_MCP_SERVER: MCPServer;
|
|
|
14
14
|
export declare const GOOGLE_WORKSPACE_MCP_SERVER: MCPServer;
|
|
15
15
|
export declare const HUGGINGFACE_MCP_SERVER: MCPServer;
|
|
16
16
|
export declare const KAGGLE_MCP_SERVER: MCPServer;
|
|
17
|
+
export declare const SALESFORCE_MCP_SERVER: MCPServer;
|
|
17
18
|
export declare const SLACK_MCP_SERVER: MCPServer;
|
|
18
19
|
export declare const TAVILY_MCP_SERVER: MCPServer;
|
|
19
20
|
export declare const MCP_SERVER_LIBRARY: Record<string, MCPServer>;
|
package/lib/specs/mcpServers.js
CHANGED
|
@@ -129,6 +129,21 @@ export const KAGGLE_MCP_SERVER = {
|
|
|
129
129
|
tools: [],
|
|
130
130
|
requiredEnvVars: ['KAGGLE_TOKEN'],
|
|
131
131
|
};
|
|
132
|
+
export const SALESFORCE_MCP_SERVER = {
|
|
133
|
+
id: 'salesforce',
|
|
134
|
+
name: 'Salesforce',
|
|
135
|
+
description: 'Salesforce CRM operations (queries, reports, objects, SOQL)',
|
|
136
|
+
icon: 'briefcase',
|
|
137
|
+
emoji: '☁️',
|
|
138
|
+
url: '',
|
|
139
|
+
command: 'npx',
|
|
140
|
+
args: ['-y', '@anthropic/salesforce-mcp-server'],
|
|
141
|
+
transport: 'stdio',
|
|
142
|
+
enabled: true,
|
|
143
|
+
isAvailable: false,
|
|
144
|
+
tools: [],
|
|
145
|
+
requiredEnvVars: ['SALESFORCE_ACCESS_TOKEN', 'SALESFORCE_INSTANCE_URL'],
|
|
146
|
+
};
|
|
132
147
|
export const SLACK_MCP_SERVER = {
|
|
133
148
|
id: 'slack',
|
|
134
149
|
name: 'Slack',
|
|
@@ -170,6 +185,7 @@ export const MCP_SERVER_LIBRARY = {
|
|
|
170
185
|
'google-workspace': GOOGLE_WORKSPACE_MCP_SERVER,
|
|
171
186
|
huggingface: HUGGINGFACE_MCP_SERVER,
|
|
172
187
|
kaggle: KAGGLE_MCP_SERVER,
|
|
188
|
+
salesforce: SALESFORCE_MCP_SERVER,
|
|
173
189
|
slack: SLACK_MCP_SERVER,
|
|
174
190
|
tavily: TAVILY_MCP_SERVER,
|
|
175
191
|
};
|
package/lib/specs/models.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const AIModels: {
|
|
|
31
31
|
readonly AZURE_OPENAI_GPT_4O_MINI: "azure-openai:gpt-4o-mini";
|
|
32
32
|
readonly AZURE_OPENAI_GPT_4O: "azure-openai:gpt-4o";
|
|
33
33
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: "bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0";
|
|
34
|
-
readonly
|
|
34
|
+
readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1: "bedrock:us.anthropic.claude-opus-4-6-v1";
|
|
35
35
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: "bedrock:us.anthropic.claude-opus-4-20250514-v1:0";
|
|
36
36
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: "bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
37
37
|
readonly BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: "bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0";
|
|
@@ -53,7 +53,7 @@ export declare const AZURE_OPENAI_GPT_4_1: AIModel;
|
|
|
53
53
|
export declare const AZURE_OPENAI_GPT_4O_MINI: AIModel;
|
|
54
54
|
export declare const AZURE_OPENAI_GPT_4O: AIModel;
|
|
55
55
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: AIModel;
|
|
56
|
-
export declare const
|
|
56
|
+
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1: AIModel;
|
|
57
57
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: AIModel;
|
|
58
58
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: AIModel;
|
|
59
59
|
export declare const BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: AIModel;
|
package/lib/specs/models.js
CHANGED
|
@@ -16,7 +16,7 @@ export const AIModels = {
|
|
|
16
16
|
AZURE_OPENAI_GPT_4O_MINI: 'azure-openai:gpt-4o-mini',
|
|
17
17
|
AZURE_OPENAI_GPT_4O: 'azure-openai:gpt-4o',
|
|
18
18
|
BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0: 'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0',
|
|
19
|
-
|
|
19
|
+
BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1: 'bedrock:us.anthropic.claude-opus-4-6-v1',
|
|
20
20
|
BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0: 'bedrock:us.anthropic.claude-opus-4-20250514-v1:0',
|
|
21
21
|
BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
22
22
|
BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0: 'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0',
|
|
@@ -114,10 +114,10 @@ export const BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0 = {
|
|
|
114
114
|
'AWS_DEFAULT_REGION',
|
|
115
115
|
],
|
|
116
116
|
};
|
|
117
|
-
export const
|
|
118
|
-
id: 'bedrock:us.anthropic.claude-opus-4-6-v1
|
|
117
|
+
export const BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1 = {
|
|
118
|
+
id: 'bedrock:us.anthropic.claude-opus-4-6-v1',
|
|
119
119
|
name: 'Bedrock Claude Opus 4.6',
|
|
120
|
-
description: 'Claude Opus 4.6 via AWS Bedrock
|
|
120
|
+
description: 'Claude Opus 4.6 via AWS Bedrock',
|
|
121
121
|
provider: 'bedrock',
|
|
122
122
|
default: false,
|
|
123
123
|
requiredEnvVars: [
|
|
@@ -224,7 +224,7 @@ export const AI_MODEL_CATALOGUE = {
|
|
|
224
224
|
'azure-openai:gpt-4o-mini': AZURE_OPENAI_GPT_4O_MINI,
|
|
225
225
|
'azure-openai:gpt-4o': AZURE_OPENAI_GPT_4O,
|
|
226
226
|
'bedrock:us.anthropic.claude-3-5-haiku-20241022-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022_V1_0,
|
|
227
|
-
'bedrock:us.anthropic.claude-opus-4-6-v1
|
|
227
|
+
'bedrock:us.anthropic.claude-opus-4-6-v1': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_6_V1,
|
|
228
228
|
'bedrock:us.anthropic.claude-opus-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_OPUS_4_20250514_V1_0,
|
|
229
229
|
'bedrock:us.anthropic.claude-sonnet-4-5-20250929-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_5_20250929_V1_0,
|
|
230
230
|
'bedrock:us.anthropic.claude-sonnet-4-20250514-v1:0': BEDROCK_US_ANTHROPIC_CLAUDE_SONNET_4_20250514_V1_0,
|
package/lib/types/Types.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export interface AgentSkillSpec {
|
|
|
99
99
|
* Specification for an AI agent.
|
|
100
100
|
*
|
|
101
101
|
* Defines the configuration for a reusable agent template that can be
|
|
102
|
-
* instantiated as an
|
|
102
|
+
* instantiated as an Agent Runtime.
|
|
103
103
|
*/
|
|
104
104
|
export interface AgentSpec {
|
|
105
105
|
/** Unique agent identifier */
|
|
@@ -140,6 +140,34 @@ export interface AgentSpec {
|
|
|
140
140
|
welcomeDocument?: string;
|
|
141
141
|
/** Sandbox variant to use for this agent ('local-eval', 'jupyter', 'local-jupyter') */
|
|
142
142
|
sandboxVariant?: string;
|
|
143
|
+
/** User-facing objective for the agent */
|
|
144
|
+
goal?: string;
|
|
145
|
+
/** Communication protocol (e.g., 'ag-ui', 'acp', 'a2a', 'vercel-ai') */
|
|
146
|
+
protocol?: string;
|
|
147
|
+
/** UI extension type (e.g., 'a2ui', 'mcp-apps') */
|
|
148
|
+
uiExtension?: string;
|
|
149
|
+
/** Trigger configuration (type, cron, description) */
|
|
150
|
+
trigger?: Record<string, any>;
|
|
151
|
+
/** Model configuration (temperature, max_tokens) */
|
|
152
|
+
modelConfig?: Record<string, any>;
|
|
153
|
+
/** MCP server tool configurations with approval settings */
|
|
154
|
+
mcpServerTools?: Record<string, any>[];
|
|
155
|
+
/** Guardrail configurations */
|
|
156
|
+
guardrails?: Record<string, any>[];
|
|
157
|
+
/** Evaluation configurations */
|
|
158
|
+
evals?: Record<string, any>[];
|
|
159
|
+
/** Codemode configuration (enabled, token_reduction, speedup) */
|
|
160
|
+
codemode?: Record<string, any>;
|
|
161
|
+
/** Output configuration (type/formats, template) */
|
|
162
|
+
output?: Record<string, any>;
|
|
163
|
+
/** Advanced settings (cost_limit, time_limit, max_iterations, validation) */
|
|
164
|
+
advanced?: Record<string, any>;
|
|
165
|
+
/** Authorization policy */
|
|
166
|
+
authorizationPolicy?: string;
|
|
167
|
+
/** Notification configuration (email, slack) */
|
|
168
|
+
notifications?: Record<string, any>;
|
|
169
|
+
/** Team configuration for multi-agent flows */
|
|
170
|
+
team?: Record<string, any>;
|
|
143
171
|
}
|
|
144
172
|
/**
|
|
145
173
|
* Configuration for an AI model.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/agent-runtimes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -130,10 +130,11 @@
|
|
|
130
130
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
131
131
|
"@datalayer/core": "^1.0.1",
|
|
132
132
|
"@datalayer/icons-react": "^1.0.6",
|
|
133
|
-
"@datalayer/jupyter-lexical": "^1.0.
|
|
133
|
+
"@datalayer/jupyter-lexical": "^1.0.13",
|
|
134
134
|
"@datalayer/jupyter-react": "^2.0.3",
|
|
135
|
-
"@datalayer/primer-addons": "^1.0.
|
|
135
|
+
"@datalayer/primer-addons": "^1.0.10",
|
|
136
136
|
"@datalayer/primer-rjsf": "^1.0.1",
|
|
137
|
+
"@excalidraw/excalidraw": "^0.18.0",
|
|
137
138
|
"@jupyter-widgets/base-manager": "^1.0.12",
|
|
138
139
|
"@jupyter-widgets/schema": "^0.5.6",
|
|
139
140
|
"@jupyterlab/apputils": "^4.6.0",
|
|
@@ -9,6 +9,7 @@ Generates Python and TypeScript code from YAML agent specifications.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
import argparse
|
|
12
|
+
import json
|
|
12
13
|
import sys
|
|
13
14
|
from pathlib import Path
|
|
14
15
|
from typing import Any, Dict, List
|
|
@@ -23,6 +24,20 @@ def _fmt_list(items: list[str]) -> str:
|
|
|
23
24
|
return "[" + ", ".join(f'"{item}"' for item in items) + "]"
|
|
24
25
|
|
|
25
26
|
|
|
27
|
+
def _fmt_py_literal(value: Any) -> str:
|
|
28
|
+
"""Format a value as a Python literal for code generation."""
|
|
29
|
+
if value is None:
|
|
30
|
+
return "None"
|
|
31
|
+
return repr(value)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _fmt_ts_literal(value: Any) -> str:
|
|
35
|
+
"""Format a value as a TypeScript/JSON literal for code generation."""
|
|
36
|
+
if value is None:
|
|
37
|
+
return "undefined"
|
|
38
|
+
return json.dumps(value, ensure_ascii=False)
|
|
39
|
+
|
|
40
|
+
|
|
26
41
|
def load_yaml_specs(specs_dir: Path) -> List[tuple[str, Dict[str, Any]]]:
|
|
27
42
|
"""
|
|
28
43
|
Load all YAML agent specifications from directory and subdirectories.
|
|
@@ -60,7 +75,7 @@ def generate_python_code(specs: List[tuple[str, Dict[str, Any]]]) -> str:
|
|
|
60
75
|
"""
|
|
61
76
|
Agent Library.
|
|
62
77
|
|
|
63
|
-
Predefined agent specifications that can be instantiated as
|
|
78
|
+
Predefined agent specifications that can be instantiated as Agent Runtimes.
|
|
64
79
|
THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
65
80
|
Generated from YAML specifications in specs/agents/
|
|
66
81
|
"""
|
|
@@ -172,6 +187,30 @@ from agent_runtimes.types import AgentSpec
|
|
|
172
187
|
sandbox_variant = spec.get("sandbox_variant")
|
|
173
188
|
sandbox_variant_str = f'"{sandbox_variant}"' if sandbox_variant else "None"
|
|
174
189
|
|
|
190
|
+
# New flow-level fields
|
|
191
|
+
goal_raw = spec.get("goal")
|
|
192
|
+
goal_str = (
|
|
193
|
+
f'"{goal_raw.replace(chr(10), " ").replace(" ", " ").strip()}"'
|
|
194
|
+
if goal_raw
|
|
195
|
+
else "None"
|
|
196
|
+
)
|
|
197
|
+
protocol_val = spec.get("protocol")
|
|
198
|
+
protocol_str = f'"{protocol_val}"' if protocol_val else "None"
|
|
199
|
+
ui_ext = spec.get("ui_extension")
|
|
200
|
+
ui_ext_str = f'"{ui_ext}"' if ui_ext else "None"
|
|
201
|
+
trigger_val = spec.get("trigger")
|
|
202
|
+
model_cfg = spec.get("model_config")
|
|
203
|
+
mcp_srv_tools = spec.get("mcp_server_tools")
|
|
204
|
+
guardrails_val = spec.get("guardrails")
|
|
205
|
+
evals_val = spec.get("evals")
|
|
206
|
+
codemode_val = spec.get("codemode")
|
|
207
|
+
output_val = spec.get("output")
|
|
208
|
+
advanced_val = spec.get("advanced")
|
|
209
|
+
auth_policy = spec.get("authorization_policy")
|
|
210
|
+
auth_policy_str = f'"{auth_policy}"' if auth_policy is not None else "None"
|
|
211
|
+
notifs = spec.get("notifications")
|
|
212
|
+
team_val = spec.get("team")
|
|
213
|
+
|
|
175
214
|
code += f'''{const_name} = AgentSpec(
|
|
176
215
|
id="{full_agent_id}",
|
|
177
216
|
name="{spec["name"]}",
|
|
@@ -192,6 +231,20 @@ from agent_runtimes.types import AgentSpec
|
|
|
192
231
|
sandbox_variant={sandbox_variant_str},
|
|
193
232
|
system_prompt={system_prompt_str},
|
|
194
233
|
system_prompt_codemode_addons={system_prompt_codemode_addons_str},
|
|
234
|
+
goal={goal_str},
|
|
235
|
+
protocol={protocol_str},
|
|
236
|
+
ui_extension={ui_ext_str},
|
|
237
|
+
trigger={_fmt_py_literal(trigger_val)},
|
|
238
|
+
model_configuration={_fmt_py_literal(model_cfg)},
|
|
239
|
+
mcp_server_tools={_fmt_py_literal(mcp_srv_tools)},
|
|
240
|
+
guardrails={_fmt_py_literal(guardrails_val)},
|
|
241
|
+
evals={_fmt_py_literal(evals_val)},
|
|
242
|
+
codemode={_fmt_py_literal(codemode_val)},
|
|
243
|
+
output={_fmt_py_literal(output_val)},
|
|
244
|
+
advanced={_fmt_py_literal(advanced_val)},
|
|
245
|
+
authorization_policy={auth_policy_str},
|
|
246
|
+
notifications={_fmt_py_literal(notifs)},
|
|
247
|
+
team={_fmt_py_literal(team_val)},
|
|
195
248
|
)
|
|
196
249
|
|
|
197
250
|
'''
|
|
@@ -309,7 +362,7 @@ def generate_typescript_code(
|
|
|
309
362
|
/**
|
|
310
363
|
* Agent Library.
|
|
311
364
|
*
|
|
312
|
-
* Predefined agent specifications that can be instantiated as
|
|
365
|
+
* Predefined agent specifications that can be instantiated as Agent Runtimes.
|
|
313
366
|
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.
|
|
314
367
|
* Generated from YAML specifications in specs/agents/
|
|
315
368
|
*/
|
|
@@ -474,6 +527,32 @@ function toAgentSkillSpec(skill: SkillSpec) {
|
|
|
474
527
|
f"'{sandbox_variant}'" if sandbox_variant else "undefined"
|
|
475
528
|
)
|
|
476
529
|
|
|
530
|
+
# New flow-level fields
|
|
531
|
+
goal_raw = spec.get("goal")
|
|
532
|
+
goal_ts = (
|
|
533
|
+
f"`{goal_raw.replace(chr(10), ' ').replace(' ', ' ').strip().replace('`', chr(92) + '`')}`"
|
|
534
|
+
if goal_raw
|
|
535
|
+
else "undefined"
|
|
536
|
+
)
|
|
537
|
+
protocol_val = spec.get("protocol")
|
|
538
|
+
protocol_ts = f"'{protocol_val}'" if protocol_val else "undefined"
|
|
539
|
+
ui_ext = spec.get("ui_extension")
|
|
540
|
+
ui_ext_ts = f"'{ui_ext}'" if ui_ext else "undefined"
|
|
541
|
+
trigger_val = spec.get("trigger")
|
|
542
|
+
model_cfg = spec.get("model_config")
|
|
543
|
+
mcp_srv_tools = spec.get("mcp_server_tools")
|
|
544
|
+
guardrails_val = spec.get("guardrails")
|
|
545
|
+
evals_val = spec.get("evals")
|
|
546
|
+
codemode_val = spec.get("codemode")
|
|
547
|
+
output_val = spec.get("output")
|
|
548
|
+
advanced_val = spec.get("advanced")
|
|
549
|
+
auth_policy = spec.get("authorization_policy")
|
|
550
|
+
auth_policy_ts = (
|
|
551
|
+
f"'{auth_policy}'" if auth_policy is not None else "undefined"
|
|
552
|
+
)
|
|
553
|
+
notifs = spec.get("notifications")
|
|
554
|
+
team_val = spec.get("team")
|
|
555
|
+
|
|
477
556
|
code += f"""export const {const_name}: AgentSpec = {{
|
|
478
557
|
id: '{full_agent_id}',
|
|
479
558
|
name: '{spec["name"]}',
|
|
@@ -491,6 +570,20 @@ function toAgentSkillSpec(skill: SkillSpec) {
|
|
|
491
570
|
sandboxVariant: {sandbox_variant_ts},
|
|
492
571
|
systemPrompt: {f"`{system_prompt}`" if system_prompt else "undefined"},
|
|
493
572
|
systemPromptCodemodeAddons: {f"`{system_prompt_codemode_addons}`" if system_prompt_codemode_addons else "undefined"},
|
|
573
|
+
goal: {goal_ts},
|
|
574
|
+
protocol: {protocol_ts},
|
|
575
|
+
uiExtension: {ui_ext_ts},
|
|
576
|
+
trigger: {_fmt_ts_literal(trigger_val)},
|
|
577
|
+
modelConfig: {_fmt_ts_literal(model_cfg)},
|
|
578
|
+
mcpServerTools: {_fmt_ts_literal(mcp_srv_tools)},
|
|
579
|
+
guardrails: {_fmt_ts_literal(guardrails_val)},
|
|
580
|
+
evals: {_fmt_ts_literal(evals_val)},
|
|
581
|
+
codemode: {_fmt_ts_literal(codemode_val)},
|
|
582
|
+
output: {_fmt_ts_literal(output_val)},
|
|
583
|
+
advanced: {_fmt_ts_literal(advanced_val)},
|
|
584
|
+
authorizationPolicy: {auth_policy_ts},
|
|
585
|
+
notifications: {_fmt_ts_literal(notifs)},
|
|
586
|
+
team: {_fmt_ts_literal(team_val)},
|
|
494
587
|
}};
|
|
495
588
|
|
|
496
589
|
"""
|