@onereach/step-voice 7.0.48 → 7.0.49-VOIC1688mcpservers.0
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/dst/Voice Agent.d.ts +18 -0
- package/dst/Voice Agent.js +17 -1
- package/package.json +1 -1
package/dst/Voice Agent.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ interface Subagent {
|
|
|
56
56
|
context?: SubagentContextMode;
|
|
57
57
|
llm?: Partial<AgentServiceConfig> | null;
|
|
58
58
|
tools: SubagentTool[];
|
|
59
|
+
mcp_servers?: AgentMcpServerConfig[];
|
|
59
60
|
exitId?: string;
|
|
60
61
|
}
|
|
61
62
|
interface AgentSystemToolConfig {
|
|
@@ -68,6 +69,21 @@ interface AgentKnowledgeConfig {
|
|
|
68
69
|
id: string;
|
|
69
70
|
mode: KnowledgeMode;
|
|
70
71
|
}
|
|
72
|
+
type McpTransport = 'streamable_http' | 'sse';
|
|
73
|
+
type McpToolPolicy = 'allow' | 'disallow';
|
|
74
|
+
interface AgentMcpToolConfig {
|
|
75
|
+
policy: McpToolPolicy;
|
|
76
|
+
description?: string;
|
|
77
|
+
parameters?: Record<string, unknown>;
|
|
78
|
+
}
|
|
79
|
+
interface AgentMcpServerConfig {
|
|
80
|
+
name: string;
|
|
81
|
+
url: string;
|
|
82
|
+
transport: McpTransport;
|
|
83
|
+
headers?: Record<string, string>;
|
|
84
|
+
tools: Record<string, AgentMcpToolConfig>;
|
|
85
|
+
timeout_seconds?: number;
|
|
86
|
+
}
|
|
71
87
|
interface INPUT {
|
|
72
88
|
handlers: Handler[];
|
|
73
89
|
subagents: Subagent[];
|
|
@@ -98,6 +114,7 @@ interface INPUT {
|
|
|
98
114
|
soft_timeout?: SoftTimeoutConfig;
|
|
99
115
|
system_tools?: AgentSystemToolConfig[];
|
|
100
116
|
knowledge?: AgentKnowledgeConfig[];
|
|
117
|
+
mcp_servers?: AgentMcpServerConfig[];
|
|
101
118
|
}
|
|
102
119
|
export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
103
120
|
runStep(): Promise<void>;
|
|
@@ -118,6 +135,7 @@ export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
|
118
135
|
private validateSoftTimeout;
|
|
119
136
|
private validateSystemTools;
|
|
120
137
|
private validateKnowledge;
|
|
138
|
+
private validateMcpServers;
|
|
121
139
|
private parseAgentServiceOptions;
|
|
122
140
|
exitToThread(): Promise<void>;
|
|
123
141
|
}
|
package/dst/Voice Agent.js
CHANGED
|
@@ -79,7 +79,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
this.triggers.otherwise(async () => {
|
|
82
|
-
const { handlers = [], subagents = [], system_instruction = '', developer_messages = [], custom_config_enabled = false, agent_url_overwritten = false, system_tools, knowledge = [], agent_url = '', mode = '', stt = {}, llm = {}, tts = {}, realtime = {} } = this.data;
|
|
82
|
+
const { handlers = [], subagents = [], system_instruction = '', developer_messages = [], custom_config_enabled = false, agent_url_overwritten = false, system_tools, knowledge = [], mcp_servers = [], agent_url = '', mode = '', stt = {}, llm = {}, tts = {}, realtime = {} } = this.data;
|
|
83
83
|
if (lodash_1.default.isEmpty(system_instruction)) {
|
|
84
84
|
this.throwError(new Error('Voice Agent: system instruction is required'));
|
|
85
85
|
}
|
|
@@ -123,6 +123,9 @@ class VoiceAgent extends voice_1.default {
|
|
|
123
123
|
if (!lodash_1.default.isEmpty(knowledge)) {
|
|
124
124
|
config.knowledge = this.validateKnowledge(knowledge);
|
|
125
125
|
}
|
|
126
|
+
if (!lodash_1.default.isEmpty(mcp_servers)) {
|
|
127
|
+
config.mcp_servers = this.validateMcpServers(mcp_servers);
|
|
128
|
+
}
|
|
126
129
|
const params = { config };
|
|
127
130
|
if (agentCustomUrl) {
|
|
128
131
|
params.url = agentCustomUrl;
|
|
@@ -187,6 +190,8 @@ class VoiceAgent extends voice_1.default {
|
|
|
187
190
|
const llm = this.buildAgentServiceConfig(`subagent "${name}" llm`, sa.llm || {});
|
|
188
191
|
if (llm)
|
|
189
192
|
serialized.llm = llm;
|
|
193
|
+
if (!lodash_1.default.isEmpty(sa.mcp_servers))
|
|
194
|
+
serialized.mcp_servers = this.validateMcpServers(sa.mcp_servers);
|
|
190
195
|
return serialized;
|
|
191
196
|
});
|
|
192
197
|
}
|
|
@@ -438,6 +443,17 @@ class VoiceAgent extends voice_1.default {
|
|
|
438
443
|
}))
|
|
439
444
|
.filter(entry => !lodash_1.default.isEmpty(entry.id)), entry => entry.id);
|
|
440
445
|
}
|
|
446
|
+
// The agent validates names, urls and tools (and slugs the name); this only
|
|
447
|
+
// drops unusable entries and keeps the known fields, since the agent forbids extras.
|
|
448
|
+
validateMcpServers(servers) {
|
|
449
|
+
if (!Array.isArray(servers)) {
|
|
450
|
+
this.throwError(new Error('Voice Agent: mcp_servers must be an array'));
|
|
451
|
+
}
|
|
452
|
+
return servers
|
|
453
|
+
.filter(entry => entry != null && typeof entry === 'object')
|
|
454
|
+
.filter((entry) => !lodash_1.default.isEmpty(entry.name) && !lodash_1.default.isEmpty(entry.url))
|
|
455
|
+
.map((entry) => lodash_1.default.pick(entry, ['name', 'url', 'transport', 'headers', 'tools', 'timeout_seconds']));
|
|
456
|
+
}
|
|
441
457
|
parseAgentServiceOptions(label, options) {
|
|
442
458
|
if (options == null || options === '')
|
|
443
459
|
return undefined;
|