@onereach/step-voice 7.0.50-VOIC1823.0 → 7.0.50
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
|
type WorkingHoursDayKey = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
72
88
|
interface WorkingHoursDayInput {
|
|
73
89
|
enabled?: boolean | string;
|
|
@@ -112,6 +128,7 @@ interface INPUT {
|
|
|
112
128
|
system_tools?: AgentSystemToolConfig[];
|
|
113
129
|
knowledge?: AgentKnowledgeConfig[];
|
|
114
130
|
working_hours?: WorkingHoursInput;
|
|
131
|
+
mcp_servers?: AgentMcpServerConfig[];
|
|
115
132
|
}
|
|
116
133
|
export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
117
134
|
runStep(): Promise<void>;
|
|
@@ -134,6 +151,7 @@ export default class VoiceAgent extends VoiceStep<Partial<INPUT>> {
|
|
|
134
151
|
private validateSoftTimeout;
|
|
135
152
|
private validateSystemTools;
|
|
136
153
|
private validateKnowledge;
|
|
154
|
+
private validateMcpServers;
|
|
137
155
|
private parseAgentServiceOptions;
|
|
138
156
|
exitToThread(): Promise<void>;
|
|
139
157
|
}
|
package/dst/Voice Agent.js
CHANGED
|
@@ -82,7 +82,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
this.triggers.otherwise(async () => {
|
|
85
|
-
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;
|
|
85
|
+
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;
|
|
86
86
|
if (lodash_1.default.isEmpty(system_instruction)) {
|
|
87
87
|
this.throwError(new Error('Voice Agent: system instruction is required'));
|
|
88
88
|
}
|
|
@@ -127,6 +127,9 @@ class VoiceAgent extends voice_1.default {
|
|
|
127
127
|
if (!lodash_1.default.isEmpty(knowledge)) {
|
|
128
128
|
config.knowledge = this.validateKnowledge(knowledge);
|
|
129
129
|
}
|
|
130
|
+
if (!lodash_1.default.isEmpty(mcp_servers)) {
|
|
131
|
+
config.mcp_servers = this.validateMcpServers(mcp_servers);
|
|
132
|
+
}
|
|
130
133
|
const params = { config };
|
|
131
134
|
if (agentCustomUrl) {
|
|
132
135
|
params.url = agentCustomUrl;
|
|
@@ -191,6 +194,8 @@ class VoiceAgent extends voice_1.default {
|
|
|
191
194
|
const llm = this.buildAgentServiceConfig(`subagent "${name}" llm`, sa.llm || {});
|
|
192
195
|
if (llm)
|
|
193
196
|
serialized.llm = llm;
|
|
197
|
+
if (!lodash_1.default.isEmpty(sa.mcp_servers))
|
|
198
|
+
serialized.mcp_servers = this.validateMcpServers(sa.mcp_servers);
|
|
194
199
|
return serialized;
|
|
195
200
|
});
|
|
196
201
|
}
|
|
@@ -484,6 +489,17 @@ class VoiceAgent extends voice_1.default {
|
|
|
484
489
|
}))
|
|
485
490
|
.filter(entry => !lodash_1.default.isEmpty(entry.id)), entry => entry.id);
|
|
486
491
|
}
|
|
492
|
+
// The agent validates names, urls and tools (and slugs the name); this only
|
|
493
|
+
// drops unusable entries and keeps the known fields, since the agent forbids extras.
|
|
494
|
+
validateMcpServers(servers) {
|
|
495
|
+
if (!Array.isArray(servers)) {
|
|
496
|
+
this.throwError(new Error('Voice Agent: mcp_servers must be an array'));
|
|
497
|
+
}
|
|
498
|
+
return servers
|
|
499
|
+
.filter(entry => entry != null && typeof entry === 'object')
|
|
500
|
+
.filter((entry) => !lodash_1.default.isEmpty(entry.name) && !lodash_1.default.isEmpty(entry.url))
|
|
501
|
+
.map((entry) => lodash_1.default.pick(entry, ['name', 'url', 'transport', 'headers', 'tools', 'timeout_seconds']));
|
|
502
|
+
}
|
|
487
503
|
parseAgentServiceOptions(label, options) {
|
|
488
504
|
if (options == null || options === '')
|
|
489
505
|
return undefined;
|