@botbotgo/agent-harness 0.0.453 → 0.0.454

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.453";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.454";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.453";
1
+ export const AGENT_HARNESS_VERSION = "0.0.454";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
@@ -38,60 +38,8 @@ function hasDelegatedExecutionToolEvidence(result) {
38
38
  return executedToolResults.some((toolResult) => (toolResult.isError !== true
39
39
  && !isPlanToolName(toolResult.toolName)));
40
40
  }
41
- function normalizeEvidenceToolName(toolName) {
42
- return typeof toolName === "string" ? toolName.trim().toLowerCase() : "";
43
- }
44
- function collectSuccessfulDelegatedExecutionToolNames(result) {
45
- const executedToolResults = Array.isArray(result.metadata?.executedToolResults)
46
- ? result.metadata.executedToolResults
47
- : [];
48
- return new Set(executedToolResults
49
- .filter((toolResult) => toolResult.isError !== true && !isPlanToolName(toolResult.toolName))
50
- .map((toolResult) => normalizeEvidenceToolName(toolResult.toolName))
51
- .filter((toolName) => toolName.length > 0));
52
- }
53
- function textExplicitlyNamesConfiguredTool(text, toolName) {
54
- const name = toolName.trim();
55
- if (!name) {
56
- return false;
57
- }
58
- const pattern = new RegExp(`(?:^|[^\\p{L}\\p{N}_-])${escapeRegExp(name)}(?:$|[^\\p{L}\\p{N}_-])`, "iu");
59
- return pattern.test(text);
60
- }
61
- function resolveExplicitRequestedExecutionToolNames(binding, requestText) {
62
- const text = requestText.trim();
63
- if (!text) {
64
- return [];
65
- }
66
- return getBindingPrimaryTools(binding)
67
- .map((tool) => tool.name)
68
- .filter((toolName) => typeof toolName === "string" && toolName.trim().length > 0)
69
- .filter((toolName) => !isPlanToolName(toolName))
70
- .filter((toolName) => textExplicitlyNamesConfiguredTool(text, toolName));
71
- }
72
- function listMissingDelegatedExecutionToolEvidence(result, requiredToolNames = []) {
73
- if (requiredToolNames.length === 0) {
74
- return hasDelegatedExecutionToolEvidence(result) ? [] : ["configured non-planning tools"];
75
- }
76
- const observed = collectSuccessfulDelegatedExecutionToolNames(result);
77
- return requiredToolNames.filter((toolName) => !observed.has(normalizeEvidenceToolName(toolName)));
78
- }
79
- function hasRequiredDelegatedExecutionToolEvidence(result, requiredToolNames = []) {
80
- return hasDelegatedExecutionToolEvidence(result)
81
- && listMissingDelegatedExecutionToolEvidence(result, requiredToolNames).length === 0;
82
- }
83
- function buildExplicitExecutionToolRetryInstruction(missingToolNames) {
84
- const tools = missingToolNames
85
- .filter((toolName) => toolName !== "configured non-planning tools")
86
- .join(", ");
87
- if (!tools) {
88
- return "";
89
- }
90
- return [
91
- `The request explicitly named configured evidence tool(s): ${tools}.`,
92
- "Before the final answer, call every listed non-planning tool that has not already produced a successful tool result.",
93
- "Do not substitute a different evidence tool for an explicitly named configured tool unless that tool invocation itself fails and the blocker is reported.",
94
- ].join("\n");
41
+ function hasRequiredDelegatedExecutionToolEvidence(result) {
42
+ return hasDelegatedExecutionToolEvidence(result);
95
43
  }
96
44
  function buildDelegatedPlanEvidenceBlocker(agentId) {
97
45
  return JSON.stringify({
@@ -329,9 +277,6 @@ function buildDelegatedOwnedTaskInstruction(input) {
329
277
  "Close every TODO as completed or failed before final output.",
330
278
  ].filter(Boolean).join("\n");
331
279
  }
332
- function escapeRegExp(value) {
333
- return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
334
- }
335
280
  function isDelegationOnlyDeepAgentBinding(binding) {
336
281
  return isDeepAgentBinding(binding)
337
282
  && getBindingSubagents(binding).length > 0
@@ -752,15 +697,12 @@ export class AgentRuntimeAdapter {
752
697
  const runDelegatedRequest = (text, requestSuffix = "") => this.invoke(targetBinding, text, childSessionId, `${childRequestId}${requestSuffix}`, undefined, [], invokeOptions);
753
698
  let result = await runDelegatedRequest(requestText);
754
699
  const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(targetBinding).length > 0;
755
- const requiredExecutionToolNames = resolveExplicitRequestedExecutionToolNames(targetBinding, requestText);
756
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(result, requiredExecutionToolNames)) {
757
- const missingToolNames = listMissingDelegatedExecutionToolEvidence(result, requiredExecutionToolNames);
700
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(result)) {
758
701
  result = await runDelegatedRequest([
759
702
  requestText,
760
703
  EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
761
- buildExplicitExecutionToolRetryInstruction(missingToolNames),
762
704
  ].filter(Boolean).join("\n\n"), ":tool-evidence-retry");
763
- if (!hasRequiredDelegatedExecutionToolEvidence(result, requiredExecutionToolNames)) {
705
+ if (!hasRequiredDelegatedExecutionToolEvidence(result)) {
764
706
  throw new DelegatedExecutionNoToolEvidenceError(targetBinding.agent.id);
765
707
  }
766
708
  }
@@ -1304,7 +1246,6 @@ export class AgentRuntimeAdapter {
1304
1246
  }
1305
1247
  }
1306
1248
  const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(selectedBinding).length > 0;
1307
- const requiredExecutionToolNames = resolveExplicitRequestedExecutionToolNames(selectedBinding, requestText);
1308
1249
  if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
1309
1250
  && !hasDelegatedPlanEvidence(delegatedResult)) {
1310
1251
  try {
@@ -1324,13 +1265,11 @@ export class AgentRuntimeAdapter {
1324
1265
  };
1325
1266
  }
1326
1267
  }
1327
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
1328
- const missingToolNames = listMissingDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames);
1268
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1329
1269
  try {
1330
1270
  delegatedResult = await runDelegatedRequest([
1331
1271
  requestText,
1332
1272
  EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
1333
- buildExplicitExecutionToolRetryInstruction(missingToolNames),
1334
1273
  ].filter(Boolean).join("\n\n"), ":tool-evidence-retry", selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
1335
1274
  ? {
1336
1275
  suppressInitialRequiredPlanInstruction: true,
@@ -1366,10 +1305,8 @@ export class AgentRuntimeAdapter {
1366
1305
  },
1367
1306
  };
1368
1307
  }
1369
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
1370
- const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, requiredExecutionToolNames.length > 0
1371
- ? requiredExecutionToolNames
1372
- : getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
1308
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1309
+ const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
1373
1310
  return {
1374
1311
  toolOutput: output,
1375
1312
  delegatedSubagentType: subagentType,
@@ -1764,16 +1701,11 @@ export class AgentRuntimeAdapter {
1764
1701
  delegatedResult = mergeDelegatedResultToolEvidence(yield* runPlannedDelegation(planned.subagentType, [delegatedText, DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-retry"), previousDelegatedResult);
1765
1702
  }
1766
1703
  const targetRequiresExecutionToolEvidence = selectedBinding ? getBindingPrimaryTools(selectedBinding).length > 0 : false;
1767
- const requiredExecutionToolNames = selectedBinding
1768
- ? resolveExplicitRequestedExecutionToolNames(selectedBinding, planned.description)
1769
- : [];
1770
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
1771
- const missingToolNames = listMissingDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames);
1704
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1772
1705
  const previousDelegatedResult = delegatedResult;
1773
1706
  delegatedResult = mergeDelegatedResultToolEvidence(yield* runPlannedDelegation(planned.subagentType, [
1774
1707
  delegatedText,
1775
1708
  EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
1776
- buildExplicitExecutionToolRetryInstruction(missingToolNames),
1777
1709
  ].filter(Boolean).join("\n\n"), ":tool-evidence-retry"), previousDelegatedResult);
1778
1710
  }
1779
1711
  if (selectedBinding?.harnessRuntime.executionContract?.requiresPlan === true && !hasDelegatedPlanEvidence(delegatedResult)) {
@@ -1785,10 +1717,8 @@ export class AgentRuntimeAdapter {
1785
1717
  finalMessageText: output,
1786
1718
  };
1787
1719
  }
1788
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
1789
- const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, requiredExecutionToolNames.length > 0
1790
- ? requiredExecutionToolNames
1791
- : getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
1720
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1721
+ const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
1792
1722
  delegatedResult = {
1793
1723
  ...delegatedResult,
1794
1724
  state: "failed",
@@ -1981,19 +1911,16 @@ export class AgentRuntimeAdapter {
1981
1911
  });
1982
1912
  let delegatedResult = yield* runDelegatedStreamAttempt(delegatedText);
1983
1913
  const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(selectedBinding).length > 0;
1984
- const requiredExecutionToolNames = resolveExplicitRequestedExecutionToolNames(selectedBinding, requestText);
1985
1914
  if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
1986
1915
  && !hasDelegatedPlanEvidence(delegatedResult)) {
1987
1916
  const previousDelegatedResult = delegatedResult;
1988
1917
  delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([delegatedText, DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-retry"), previousDelegatedResult);
1989
1918
  }
1990
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
1991
- const missingToolNames = listMissingDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames);
1919
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1992
1920
  const previousDelegatedResult = delegatedResult;
1993
1921
  delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([
1994
1922
  delegatedText,
1995
1923
  EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
1996
- buildExplicitExecutionToolRetryInstruction(missingToolNames),
1997
1924
  ].filter(Boolean).join("\n\n"), ":tool-evidence-retry"), previousDelegatedResult);
1998
1925
  }
1999
1926
  if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
@@ -2006,10 +1933,8 @@ export class AgentRuntimeAdapter {
2006
1933
  finalMessageText: output,
2007
1934
  };
2008
1935
  }
2009
- if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult, requiredExecutionToolNames)) {
2010
- const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, requiredExecutionToolNames.length > 0
2011
- ? requiredExecutionToolNames
2012
- : getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
1936
+ if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
1937
+ const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
2013
1938
  delegatedResult = {
2014
1939
  ...delegatedResult,
2015
1940
  state: "failed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.453",
3
+ "version": "0.0.454",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",