@botbotgo/agent-harness 0.0.434 → 0.0.436

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.
@@ -1,2 +1,2 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.434";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.436";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-03";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.434";
1
+ export const AGENT_HARNESS_VERSION = "0.0.436";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-05-03";
@@ -196,6 +196,16 @@ function terminalToolErrorRecoveryInstruction(terminalText) {
196
196
  function requiresPlanEvidence(binding) {
197
197
  return binding.harnessRuntime.executionContract?.requiresPlan === true;
198
198
  }
199
+ function escapeRegExp(value) {
200
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
201
+ }
202
+ function textExplicitlyNamesTool(text, toolName) {
203
+ const trimmedToolName = toolName.trim();
204
+ if (trimmedToolName.length === 0) {
205
+ return false;
206
+ }
207
+ return new RegExp(`(?:^|[^\\p{L}\\p{N}_-])${escapeRegExp(trimmedToolName)}(?:$|[^\\p{L}\\p{N}_-])`, "iu").test(text);
208
+ }
199
209
  function resolveCommittedTodoEvidenceTool(executedToolResults, primaryTools) {
200
210
  const availableTools = primaryTools
201
211
  .filter((tool) => typeof tool.name === "string" && tool.name.length > 0 && !isPlanToolName(tool.name));
@@ -225,8 +235,8 @@ function resolveCommittedTodoEvidenceTool(executedToolResults, primaryTools) {
225
235
  item.title,
226
236
  item.name,
227
237
  item.text,
228
- ].filter((value) => typeof value === "string").join(" ").toLowerCase();
229
- const matched = availableTools.map((tool) => tool.name).filter((toolName) => content.includes(toolName.toLowerCase()));
238
+ ].filter((value) => typeof value === "string").join(" ");
239
+ const matched = availableTools.map((tool) => tool.name).filter((toolName) => textExplicitlyNamesTool(content, toolName));
230
240
  if (matched.length === 1) {
231
241
  return {
232
242
  name: matched[0],
@@ -486,24 +486,6 @@ function parseCompactRouterSelection(value, subagentNames) {
486
486
  }
487
487
  return null;
488
488
  }
489
- function resolveSingleExplicitOwnerMention(requestText, subagentNames) {
490
- const numberedClauses = requestText
491
- .split(/\r?\n/u)
492
- .map((item) => item.trim())
493
- .filter((item) => /^\d+\s*[.)、.]\s*/u.test(item));
494
- if (numberedClauses.length > 1) {
495
- return null;
496
- }
497
- const matches = [];
498
- for (const subagentName of subagentNames) {
499
- const escapedName = escapeRegExp(subagentName);
500
- const pattern = new RegExp(`(?:^|[^\\p{L}\\p{N}_-])\`?${escapedName}\`?(?:$|[^\\p{L}\\p{N}_-])`, "iu");
501
- if (pattern.test(requestText)) {
502
- matches.push(subagentName);
503
- }
504
- }
505
- return matches.length === 1 ? matches[0] : null;
506
- }
507
489
  function extractExplicitSubagentTasks(requestText, subagentNames) {
508
490
  const lines = requestText.split(/\r?\n/u);
509
491
  const tasks = [];
@@ -1466,10 +1448,6 @@ export class AgentRuntimeAdapter {
1466
1448
  : parsedSelection;
1467
1449
  }
1468
1450
  }
1469
- const explicitOwner = resolveSingleExplicitOwnerMention(requestText, subagentNames);
1470
- if ((selection?.refusedReason || !selection) && explicitOwner) {
1471
- selection = { subagentType: explicitOwner };
1472
- }
1473
1451
  if (selection?.delegations && selection.delegations.length > 0) {
1474
1452
  selection = { subagentType: selection.delegations[0].subagentType };
1475
1453
  }
@@ -1834,16 +1812,11 @@ export class AgentRuntimeAdapter {
1834
1812
  }
1835
1813
  }
1836
1814
  const explicitTasks = extractExplicitSubagentTasks(requestText, subagentNames);
1837
- const explicitOwner = resolveSingleExplicitOwnerMention(requestText, subagentNames);
1838
- if (selection?.refusedReason && explicitOwner) {
1839
- selection = { subagentType: explicitOwner };
1840
- }
1841
1815
  const numberedRequestSteps = requestText
1842
1816
  .split(/\r?\n/u)
1843
1817
  .map((item) => item.trim())
1844
1818
  .filter((item) => /^\d+\s*[.)、.]\s*/u.test(item));
1845
- const shouldRouteNumberedClauses = !explicitOwner
1846
- && explicitTasks.length === 0
1819
+ const shouldRouteNumberedClauses = explicitTasks.length === 0
1847
1820
  && model
1848
1821
  && numberedRequestSteps.length > 1
1849
1822
  && (!selection
@@ -1851,7 +1824,7 @@ export class AgentRuntimeAdapter {
1851
1824
  || (Array.isArray(selection.delegations)
1852
1825
  && selection.delegations.length > 1
1853
1826
  && selection.delegations.length < numberedRequestSteps.length));
1854
- if (shouldRouteNumberedClauses || ((!selection || selection.refusedReason) && !explicitOwner && explicitTasks.length === 0 && model)) {
1827
+ if (shouldRouteNumberedClauses || ((!selection || selection.refusedReason) && explicitTasks.length === 0 && model)) {
1855
1828
  const routeClauses = numberedRequestSteps.length > 1 ? numberedRequestSteps : [requestText];
1856
1829
  const routedDelegations = [];
1857
1830
  for (const [index, clause] of routeClauses.entries()) {
@@ -1902,19 +1875,11 @@ export class AgentRuntimeAdapter {
1902
1875
  else if (explicitTasks.length === 1) {
1903
1876
  selection = { subagentType: explicitTasks[0].subagentType };
1904
1877
  }
1905
- else if (explicitOwner) {
1906
- selection = { subagentType: explicitOwner };
1907
- }
1908
1878
  }
1909
1879
  if (selection?.delegations?.length === 1) {
1910
1880
  const onlyDelegation = selection.delegations[0];
1911
1881
  selection = { subagentType: onlyDelegation.subagentType };
1912
1882
  }
1913
- if (selection?.delegations && selection.delegations.length > 1) {
1914
- if (explicitOwner) {
1915
- selection = { subagentType: explicitOwner };
1916
- }
1917
- }
1918
1883
  if (selection?.delegations && selection.delegations.length > 1) {
1919
1884
  const plannedDelegations = selection.delegations;
1920
1885
  const plannedNames = new Set(plannedDelegations.map((item) => item.subagentType));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.434",
3
+ "version": "0.0.436",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",