@onereach/step-voice 7.0.41-subagents.1 → 7.0.41-subagents.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.
@@ -36,10 +36,21 @@ interface SubagentTool {
36
36
  parameters: string;
37
37
  feedback?: PerToolConfig;
38
38
  }
39
+ interface AgentServiceConfig {
40
+ provider: string;
41
+ model: string;
42
+ api_key?: string;
43
+ options?: Record<string, unknown>;
44
+ }
45
+ type SubagentContextMode = 'own' | 'shared';
39
46
  interface Subagent {
40
47
  id: string;
41
48
  name: string;
42
49
  system_instruction: string;
50
+ developer_messages?: string[];
51
+ context: SubagentContextMode;
52
+ transfer_targets?: string[];
53
+ llm?: Partial<AgentServiceConfig> | null;
43
54
  tools: SubagentTool[];
44
55
  exitId?: string;
45
56
  }
@@ -48,12 +59,6 @@ interface AgentSystemToolConfig {
48
59
  description?: string;
49
60
  parameters?: Record<string, unknown>;
50
61
  }
51
- interface AgentServiceConfig {
52
- provider: string;
53
- model: string;
54
- api_key?: string;
55
- options?: Record<string, unknown>;
56
- }
57
62
  interface INPUT {
58
63
  handlers: Handler[];
59
64
  subagents: Subagent[];
@@ -198,15 +198,32 @@ class VoiceAgent extends voice_1.default {
198
198
  serializeSubagents(subagents) {
199
199
  if (!Array.isArray(subagents))
200
200
  return [];
201
+ const names = new Set(subagents
202
+ .map(sa => lodash_1.default.trim(sa?.name || ''))
203
+ .filter(name => !lodash_1.default.isEmpty(name)));
201
204
  return subagents
202
205
  .filter(sa => sa != null && !lodash_1.default.isEmpty(lodash_1.default.trim(sa.name)))
203
- .map(sa => ({
204
- name: lodash_1.default.trim(sa.name),
205
- system_instruction: sa.system_instruction || '',
206
- tools: (sa.tools || [])
207
- .filter(t => t != null && !lodash_1.default.isEmpty(lodash_1.default.trim(t.name)))
208
- .map(t => this.serializeTool(t))
209
- }));
206
+ .map(sa => {
207
+ const name = lodash_1.default.trim(sa.name);
208
+ const serialized = {
209
+ name,
210
+ system_instruction: sa.system_instruction || '',
211
+ developer_messages: (sa.developer_messages || [])
212
+ .map(msg => typeof msg === 'string' ? msg : '')
213
+ .filter(msg => !lodash_1.default.isEmpty(lodash_1.default.trim(msg))),
214
+ context: sa.context,
215
+ transfer_targets: (sa.transfer_targets || [])
216
+ .map(target => lodash_1.default.trim(String(target || '')))
217
+ .filter(target => target === 'main' || (names.has(target) && target !== name)),
218
+ tools: (sa.tools || [])
219
+ .filter(t => t != null && !lodash_1.default.isEmpty(lodash_1.default.trim(t.name)))
220
+ .map(t => this.serializeTool(t))
221
+ };
222
+ const llm = this.buildAgentServiceConfig(`subagent "${name}" llm`, sa.llm || {});
223
+ if (llm)
224
+ serialized.llm = llm;
225
+ return serialized;
226
+ });
210
227
  }
211
228
  isSubagentExitLabel(label) {
212
229
  const subagents = this.data.subagents || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.41-subagents.1",
3
+ "version": "7.0.41-subagents.2",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",