@botbotgo/agent-harness 0.0.452 → 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.452";
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.452";
1
+ export const AGENT_HARNESS_VERSION = "0.0.454";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
@@ -799,15 +799,12 @@ export async function resolveBuiltinMiddlewareTools(input) {
799
799
  if (builtinTools.filesystem === false) {
800
800
  for (const name of [
801
801
  "ls",
802
- "list_files",
803
802
  "read_file",
804
803
  "write_file",
805
804
  "edit_file",
806
805
  "glob",
807
806
  "grep",
808
- "search_files",
809
807
  "execute",
810
- "run_command",
811
808
  ]) {
812
809
  tools.delete(name);
813
810
  }
@@ -201,9 +201,6 @@ export declare const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS: readonly [{
201
201
  }, {
202
202
  readonly name: "ls";
203
203
  readonly description: "List files in a directory.";
204
- }, {
205
- readonly name: "list_files";
206
- readonly description: "List files in a directory.";
207
204
  }, {
208
205
  readonly name: "read_file";
209
206
  readonly description: "Read a file from the workspace filesystem.";
@@ -219,15 +216,9 @@ export declare const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS: readonly [{
219
216
  }, {
220
217
  readonly name: "grep";
221
218
  readonly description: "Search for text across workspace files.";
222
- }, {
223
- readonly name: "search_files";
224
- readonly description: "Search for text across workspace files.";
225
219
  }, {
226
220
  readonly name: "execute";
227
221
  readonly description: "Run a shell command in the workspace sandbox.";
228
- }, {
229
- readonly name: "run_command";
230
- readonly description: "Run a shell command in the workspace sandbox.";
231
222
  }, {
232
223
  readonly name: "fetch_url";
233
224
  readonly description: "Fetch a URL and return the response body.";
@@ -35,15 +35,12 @@ export const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS = [
35
35
  { name: "write_todos", description: "Create and update the runtime todo board for multi-step work." },
36
36
  { name: "read_todos", description: "Read the current runtime todo board." },
37
37
  { name: "ls", description: "List files in a directory." },
38
- { name: "list_files", description: "List files in a directory." },
39
38
  { name: "read_file", description: "Read a file from the workspace filesystem." },
40
39
  { name: "write_file", description: "Write a file in the workspace filesystem." },
41
40
  { name: "edit_file", description: "Replace exact text inside a workspace file." },
42
41
  { name: "glob", description: "Find files matching a glob pattern." },
43
42
  { name: "grep", description: "Search for text across workspace files." },
44
- { name: "search_files", description: "Search for text across workspace files." },
45
43
  { name: "execute", description: "Run a shell command in the workspace sandbox." },
46
- { name: "run_command", description: "Run a shell command in the workspace sandbox." },
47
44
  { name: "fetch_url", description: "Fetch a URL and return the response body." },
48
45
  { name: "http_request", description: "Send a structured HTTP request." },
49
46
  { name: "send_message", description: "Send a message through the configured backend." },
@@ -70,15 +67,12 @@ export function filterBuiltinMiddlewareToolDescriptors(options) {
70
67
  if (options?.filesystem === false
71
68
  && [
72
69
  "ls",
73
- "list_files",
74
70
  "read_file",
75
71
  "write_file",
76
72
  "edit_file",
77
73
  "glob",
78
74
  "grep",
79
- "search_files",
80
75
  "execute",
81
- "run_command",
82
76
  ].includes(descriptor.name)) {
83
77
  return false;
84
78
  }
@@ -330,12 +324,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
330
324
  return finalizeOutput("ls", truncateLines(infos.map((info) => info.is_dir ? `${info.path} (directory)` : `${info.path}${info.size ? ` (${info.size} bytes)` : ""}`)), toolConfig);
331
325
  },
332
326
  });
333
- tools.set("list_files", {
334
- name: "list_files",
335
- description: "List files in a directory.",
336
- schema: z.object({ path: z.string().optional().default("/") }).passthrough(),
337
- invoke: async (input, toolConfig) => tools.get("ls").invoke(input, toolConfig),
338
- });
339
327
  tools.set("read_file", {
340
328
  name: "read_file",
341
329
  description: "Read a file from the workspace filesystem.",
@@ -438,26 +426,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
438
426
  return truncateLines(lines);
439
427
  },
440
428
  });
441
- tools.set("search_files", {
442
- name: "search_files",
443
- description: "Search for text across workspace files.",
444
- schema: z.object({
445
- query: z.string(),
446
- path: z.string().optional().default("/"),
447
- glob: z.string().nullable().optional(),
448
- search_type: z.enum(["content", "path"]).optional().default("content"),
449
- }).passthrough(),
450
- invoke: async (input) => {
451
- const typed = isRecord(input) ? input : {};
452
- const query = typeof typed.query === "string" ? typed.query : "";
453
- const searchPath = normalizeWorkspacePathOrThrow(pathScopedBackend, typeof typed.path === "string" ? typed.path : "/");
454
- const globPattern = typeof typed.glob === "string" ? typed.glob : null;
455
- const searchType = typed.search_type === "path" ? "path" : "content";
456
- return searchType === "path"
457
- ? tools.get("glob").invoke({ pattern: query, path: searchPath })
458
- : tools.get("grep").invoke({ pattern: query, path: searchPath, glob: globPattern });
459
- },
460
- });
461
429
  tools.set("execute", {
462
430
  name: "execute",
463
431
  description: "Run a shell command in the workspace sandbox.",
@@ -478,12 +446,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
478
446
  return finalizeOutput("execute", parts.join(""), toolConfig);
479
447
  },
480
448
  });
481
- tools.set("run_command", {
482
- name: "run_command",
483
- description: "Run a shell command in the workspace sandbox.",
484
- schema: z.object({ command: z.string() }).passthrough(),
485
- invoke: async (input, toolConfig) => tools.get("execute").invoke(input, toolConfig),
486
- });
487
449
  tools.set("fetch_url", {
488
450
  name: "fetch_url",
489
451
  description: "Fetch a URL and return the response body.",
@@ -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",
@@ -6,11 +6,6 @@ import { readSkillMetadata } from "./skills/skill-metadata.js";
6
6
  import { getBindingBackendConfig, getBindingExecutionKind, getBindingExecutionParams, getBindingInterruptCompatibilityRules, getBindingMemorySources, getBindingMiddlewareConfigs, getBindingPrimaryTools, getBindingSkills, getBindingStoreConfig, } from "./support/compiled-binding.js";
7
7
  export const AGENT_INTERRUPT_SENTINEL_PREFIX = "__agent_harness_interrupt__:";
8
8
  export const DEFAULT_DEEPAGENT_RECURSION_LIMIT = 100;
9
- const BUILTIN_MIDDLEWARE_ALIAS_TOOL_NAMES = new Set([
10
- "list_files",
11
- "search_files",
12
- "run_command",
13
- ]);
14
9
  const MODEL_EXPOSED_BUILTIN_MIDDLEWARE_TOOL_NAMES = new Set([
15
10
  "fetch_url",
16
11
  "http_request",
@@ -29,7 +24,6 @@ export function materializeModelExposedBuiltinMiddlewareTools(input) {
29
24
  const tools = [];
30
25
  for (const [toolName, tool] of input.builtinTools.entries()) {
31
26
  if (explicitToolNames.has(toolName)
32
- || BUILTIN_MIDDLEWARE_ALIAS_TOOL_NAMES.has(toolName)
33
27
  || !MODEL_EXPOSED_BUILTIN_MIDDLEWARE_TOOL_NAMES.has(toolName)
34
28
  || (allowedToolNames && !allowedToolNames.has(toolName))) {
35
29
  continue;
@@ -511,7 +511,7 @@ description: Inspect the current workspace before making claims or edits.
511
511
 
512
512
  # Workspace Inspection
513
513
 
514
- 1. Start with lightweight discovery such as \`list_files\` or \`search_files\`.
514
+ 1. Start with lightweight discovery such as \`ls\`, \`glob\`, or \`grep\`.
515
515
  2. Read only the files needed to establish the relevant facts.
516
516
  3. Ground each conclusion in inspected workspace evidence instead of guesses.
517
517
  4. If the workspace does not contain the needed evidence, say that plainly before proposing a next step.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.452",
3
+ "version": "0.0.454",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",