@standardagents/builder 0.11.0-next.ab7e1ea → 0.11.0-next.af971ae

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/dist/plugin.js CHANGED
@@ -813,16 +813,6 @@ function generatePromptFile(data) {
813
813
  const toolsCode = formatToolsArray(data.tools);
814
814
  lines.push(` tools: ${toolsCode},`);
815
815
  }
816
- if (data.handoffAgents && data.handoffAgents.length > 0) {
817
- const agentsStr = data.handoffAgents.map((a) => `'${escapeString2(a)}'`).join(", ");
818
- lines.push(` handoffAgents: [${agentsStr}],`);
819
- }
820
- if (data.beforeTool) {
821
- lines.push(` beforeTool: '${escapeString2(data.beforeTool)}',`);
822
- }
823
- if (data.afterTool) {
824
- lines.push(` afterTool: '${escapeString2(data.afterTool)}',`);
825
- }
826
816
  if (data.reasoning && hasNonNullProperties(data.reasoning)) {
827
817
  const reasoningCode = formatReasoningConfig(data.reasoning);
828
818
  lines.push(` reasoning: ${reasoningCode},`);
@@ -1000,9 +990,6 @@ function generateAgentFile(data) {
1000
990
  if (data.toolDescription) {
1001
991
  lines.push(` toolDescription: '${escapeString3(data.toolDescription)}',`);
1002
992
  }
1003
- if (data.tags && data.tags.length > 0) {
1004
- lines.push(` tags: ${JSON.stringify(data.tags)},`);
1005
- }
1006
993
  lines.push(`});`);
1007
994
  lines.push("");
1008
995
  return lines.join("\n");
@@ -1022,11 +1009,11 @@ function formatSideConfig(config) {
1022
1009
  if (config.stopToolResponseProperty) {
1023
1010
  parts.push(` stopToolResponseProperty: '${escapeString3(config.stopToolResponseProperty)}',`);
1024
1011
  }
1025
- if (config.maxTurns !== void 0) {
1026
- parts.push(` maxTurns: ${config.maxTurns},`);
1012
+ if (config.maxSteps !== void 0) {
1013
+ parts.push(` maxSteps: ${config.maxSteps},`);
1027
1014
  }
1028
- if (config.endConversationTool) {
1029
- parts.push(` endConversationTool: '${escapeString3(config.endConversationTool)}',`);
1015
+ if (config.endSessionTool) {
1016
+ parts.push(` endSessionTool: '${escapeString3(config.endSessionTool)}',`);
1030
1017
  }
1031
1018
  if (config.manualStopCondition !== void 0) {
1032
1019
  parts.push(` manualStopCondition: ${config.manualStopCondition},`);
@@ -1173,11 +1160,8 @@ function transformPromptData(data) {
1173
1160
  required_schema: "requiredSchema",
1174
1161
  include_chat: "includeChat",
1175
1162
  include_past_tools: "includePastTools",
1176
- before_tool: "beforeTool",
1177
- after_tool: "afterTool",
1178
1163
  parallel_tool_calls: "parallelToolCalls",
1179
1164
  tool_choice: "toolChoice",
1180
- handoff_agents: "handoffAgents",
1181
1165
  reasoning_effort: "reasoningEffort",
1182
1166
  reasoning_max_tokens: "reasoningMaxTokens",
1183
1167
  reasoning_exclude: "reasoningExclude",
@@ -1328,9 +1312,6 @@ function validatePromptData(data) {
1328
1312
  if (data.tools !== void 0 && !Array.isArray(data.tools)) {
1329
1313
  return "tools must be an array";
1330
1314
  }
1331
- if (data.handoffAgents !== void 0 && !Array.isArray(data.handoffAgents)) {
1332
- return "handoffAgents must be an array";
1333
- }
1334
1315
  if (data.reasoning !== void 0) {
1335
1316
  if (typeof data.reasoning !== "object") {
1336
1317
  return "reasoning must be an object";
@@ -1375,11 +1356,11 @@ function transformAgentData(data) {
1375
1356
  if (data.side_a_stop_tool_response_property) {
1376
1357
  transformed.sideA.stopToolResponseProperty = data.side_a_stop_tool_response_property;
1377
1358
  }
1378
- if (data.side_a_max_turns !== void 0) {
1379
- transformed.sideA.maxTurns = data.side_a_max_turns;
1359
+ if (data.side_a_max_steps !== void 0) {
1360
+ transformed.sideA.maxSteps = data.side_a_max_steps;
1380
1361
  }
1381
- if (data.side_a_end_conversation_tool) {
1382
- transformed.sideA.endConversationTool = data.side_a_end_conversation_tool;
1362
+ if (data.side_a_end_session_tool) {
1363
+ transformed.sideA.endSessionTool = data.side_a_end_session_tool;
1383
1364
  }
1384
1365
  if (data.side_a_manual_stop_condition !== void 0) {
1385
1366
  transformed.sideA.manualStopCondition = data.side_a_manual_stop_condition;
@@ -1400,11 +1381,11 @@ function transformAgentData(data) {
1400
1381
  if (data.side_b_stop_tool_response_property) {
1401
1382
  transformed.sideB.stopToolResponseProperty = data.side_b_stop_tool_response_property;
1402
1383
  }
1403
- if (data.side_b_max_turns !== void 0) {
1404
- transformed.sideB.maxTurns = data.side_b_max_turns;
1384
+ if (data.side_b_max_steps !== void 0) {
1385
+ transformed.sideB.maxSteps = data.side_b_max_steps;
1405
1386
  }
1406
- if (data.side_b_end_conversation_tool) {
1407
- transformed.sideB.endConversationTool = data.side_b_end_conversation_tool;
1387
+ if (data.side_b_end_session_tool) {
1388
+ transformed.sideB.endSessionTool = data.side_b_end_session_tool;
1408
1389
  }
1409
1390
  if (data.side_b_manual_stop_condition !== void 0) {
1410
1391
  transformed.sideB.manualStopCondition = data.side_b_manual_stop_condition;
@@ -1416,9 +1397,6 @@ function transformAgentData(data) {
1416
1397
  if (data.tool_description) {
1417
1398
  transformed.toolDescription = data.tool_description;
1418
1399
  }
1419
- if (data.tags) {
1420
- transformed.tags = data.tags;
1421
- }
1422
1400
  return transformed;
1423
1401
  }
1424
1402
  function getAgentFilePath(agentsDir, name) {
@@ -1606,9 +1584,9 @@ function validateAgentData(data) {
1606
1584
  if (data.sideA.stopTool && !data.sideA.stopToolResponseProperty) {
1607
1585
  return "sideA.stopToolResponseProperty is required when sideA.stopTool is set";
1608
1586
  }
1609
- if (data.sideA.maxTurns !== void 0) {
1610
- if (typeof data.sideA.maxTurns !== "number" || data.sideA.maxTurns <= 0) {
1611
- return "sideA.maxTurns must be a positive number";
1587
+ if (data.sideA.maxSteps !== void 0) {
1588
+ if (typeof data.sideA.maxSteps !== "number" || data.sideA.maxSteps <= 0) {
1589
+ return "sideA.maxSteps must be a positive number";
1612
1590
  }
1613
1591
  }
1614
1592
  if (data.type === "dual_ai") {
@@ -1621,9 +1599,9 @@ function validateAgentData(data) {
1621
1599
  if (data.sideB.stopTool && !data.sideB.stopToolResponseProperty) {
1622
1600
  return "sideB.stopToolResponseProperty is required when sideB.stopTool is set";
1623
1601
  }
1624
- if (data.sideB.maxTurns !== void 0) {
1625
- if (typeof data.sideB.maxTurns !== "number" || data.sideB.maxTurns <= 0) {
1626
- return "sideB.maxTurns must be a positive number";
1602
+ if (data.sideB.maxSteps !== void 0) {
1603
+ if (typeof data.sideB.maxSteps !== "number" || data.sideB.maxSteps <= 0) {
1604
+ return "sideB.maxSteps must be a positive number";
1627
1605
  }
1628
1606
  }
1629
1607
  }
@@ -1635,16 +1613,6 @@ function validateAgentData(data) {
1635
1613
  return "maxSessionTurns must be a positive number";
1636
1614
  }
1637
1615
  }
1638
- if (data.tags !== void 0) {
1639
- if (!Array.isArray(data.tags)) {
1640
- return "tags must be an array";
1641
- }
1642
- for (const tag of data.tags) {
1643
- if (typeof tag !== "string") {
1644
- return "Each tag must be a string";
1645
- }
1646
- }
1647
- }
1648
1616
  return null;
1649
1617
  }
1650
1618
 
@@ -2901,20 +2869,12 @@ export class DurableAgentBuilder extends _BaseDurableAgentBuilder {
2901
2869
  const getIncludePastTools = (c) => c.match(/includePastTools:\s*(true|false)/)?.[1] === "true";
2902
2870
  const getParallelToolCalls = (c) => c.match(/parallelToolCalls:\s*(true|false)/)?.[1] === "true";
2903
2871
  const getToolChoice = (c) => c.match(/toolChoice:\s*['"]([^'"]+)['"]/)?.[1];
2904
- const getBeforeTool = (c) => c.match(/beforeTool:\s*['"]([^'"]+)['"]/)?.[1];
2905
- const getAfterTool = (c) => c.match(/afterTool:\s*['"]([^'"]+)['"]/)?.[1];
2906
2872
  const getTools = (c) => {
2907
2873
  const match = c.match(/tools:\s*\[([^\]]*)\]/);
2908
2874
  if (!match) return [];
2909
2875
  const items = match[1].match(/['"]([^'"]+)['"]/g);
2910
2876
  return items ? items.map((s) => s.replace(/['"]/g, "")) : [];
2911
2877
  };
2912
- const getHandoffAgents = (c) => {
2913
- const match = c.match(/handoffAgents:\s*\[([^\]]*)\]/);
2914
- if (!match) return [];
2915
- const items = match[1].match(/['"]([^'"]+)['"]/g);
2916
- return items ? items.map((s) => s.replace(/['"]/g, "")) : [];
2917
- };
2918
2878
  const getPrompt = (c) => {
2919
2879
  const backtickMatch = c.match(/prompt:\s*`([\s\S]*?)`/);
2920
2880
  if (backtickMatch) return backtickMatch[1];
@@ -2942,10 +2902,7 @@ export class DurableAgentBuilder extends _BaseDurableAgentBuilder {
2942
2902
  include_past_tools: getIncludePastTools(content),
2943
2903
  parallel_tool_calls: getParallelToolCalls(content),
2944
2904
  tool_choice: getToolChoice(content) || "auto",
2945
- before_tool: getBeforeTool(content) || null,
2946
- after_tool: getAfterTool(content) || null,
2947
2905
  tools: getTools(content),
2948
- prompts: getHandoffAgents(content),
2949
2906
  reasoning: null,
2950
2907
  // Complex to parse
2951
2908
  created_at: Math.floor(Date.now() / 1e3)