@botbotgo/agent-harness 0.0.430 → 0.0.432

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.430";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.432";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-03";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.430";
1
+ export const AGENT_HARNESS_VERSION = "0.0.432";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-05-03";
@@ -263,14 +263,7 @@ function wrapToolWithDedupe(resolvedTool, compiledTool) {
263
263
  });
264
264
  }
265
265
  function shouldConstrainWorkspacePaths(compiledTool) {
266
- if (compiledTool.type === "mcp") {
267
- return false;
268
- }
269
- const normalized = `${compiledTool.name} ${compiledTool.description}`.toLowerCase();
270
- if (/(web[_ .-]?search|fetch[_ .-]?url|https?:\/\/|\burl\b)/.test(normalized)) {
271
- return false;
272
- }
273
- return /(workspace|repo|repository|sandbox|filesystem|file|directory|folder|path|memory|source[- ]control|code search|context search|rag|index|grep|glob|read|write|edit)/.test(normalized);
266
+ return compiledTool.type !== "mcp";
274
267
  }
275
268
  function guardWorkspaceBoundToolInput(input, compiledTool, binding) {
276
269
  const workspaceRoot = binding?.harnessRuntime.workspaceRoot;
@@ -1890,7 +1890,16 @@ export class AgentRuntimeAdapter {
1890
1890
  .split(/\r?\n/u)
1891
1891
  .map((item) => item.trim())
1892
1892
  .filter((item) => /^\d+\s*[.)、.]\s*/u.test(item));
1893
- if ((!selection || selection.refusedReason) && !explicitOwner && explicitTasks.length === 0 && model) {
1893
+ const shouldRouteNumberedClauses = !explicitOwner
1894
+ && explicitTasks.length === 0
1895
+ && model
1896
+ && numberedRequestSteps.length > 1
1897
+ && (!selection
1898
+ || Boolean(selection.refusedReason)
1899
+ || (Array.isArray(selection.delegations)
1900
+ && selection.delegations.length > 1
1901
+ && selection.delegations.length < numberedRequestSteps.length));
1902
+ if (shouldRouteNumberedClauses || ((!selection || selection.refusedReason) && !explicitOwner && explicitTasks.length === 0 && model)) {
1894
1903
  const routeClauses = numberedRequestSteps.length > 1 ? numberedRequestSteps : [requestText];
1895
1904
  const routedDelegations = [];
1896
1905
  for (const [index, clause] of routeClauses.entries()) {
@@ -1921,10 +1930,11 @@ export class AgentRuntimeAdapter {
1921
1930
  }
1922
1931
  routedDelegations.push({ subagentType: routed.subagentType, description: clause });
1923
1932
  }
1924
- if (routedDelegations.length > 1) {
1933
+ const existingDelegationCount = selection?.delegations?.length ?? 0;
1934
+ if (routedDelegations.length > 1 && routedDelegations.length > existingDelegationCount) {
1925
1935
  selection = { delegations: routedDelegations };
1926
1936
  }
1927
- else if (routedDelegations.length === 1) {
1937
+ else if (routedDelegations.length === 1 && existingDelegationCount === 0) {
1928
1938
  selection = { subagentType: routedDelegations[0].subagentType };
1929
1939
  }
1930
1940
  }
@@ -1,13 +1,36 @@
1
1
  import { getBindingPrimaryTools } from "../../support/compiled-binding.js";
2
2
  import { resolveToolApprovalDecisionMode } from "../../adapter/tool/tool-hitl.js";
3
3
  import { compiledToolHasInputSchema } from "../tool-schema.js";
4
+ const FILESYSTEM_INPUT_KEYS = new Set(["path", "paths", "file", "files", "root", "rootDir", "dir", "directory", "folder", "cwd"]);
5
+ function hasStructuredKey(value, keys, depth = 0) {
6
+ if (depth > 4) {
7
+ return false;
8
+ }
9
+ if (Array.isArray(value)) {
10
+ return value.some((item) => hasStructuredKey(item, keys, depth + 1));
11
+ }
12
+ if (typeof value !== "object" || value === null) {
13
+ return false;
14
+ }
15
+ const record = value;
16
+ for (const [key, nested] of Object.entries(record)) {
17
+ if (keys.has(key)) {
18
+ return true;
19
+ }
20
+ if (key === "properties" || key === "items" || key === "anyOf" || key === "oneOf" || key === "allOf") {
21
+ if (hasStructuredKey(nested, keys, depth + 1)) {
22
+ return true;
23
+ }
24
+ }
25
+ }
26
+ return false;
27
+ }
4
28
  function inputHints(binding, tool) {
5
29
  const hints = new Set();
6
- const target = `${tool.name} ${tool.description}`.toLowerCase();
7
- if (/(path|file|dir|directory|folder|workspace|repo|repository)/.test(target)) {
30
+ if (tool.config?.filesystem || hasStructuredKey(tool.modelSchema, FILESYSTEM_INPUT_KEYS)) {
8
31
  hints.add("filesystem-scope");
9
32
  }
10
- if (/(memory|knowledge|store|recall)/.test(target)) {
33
+ if (tool.config?.memory) {
11
34
  hints.add("memory-scope");
12
35
  }
13
36
  if (tool.config?.mcp) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.430",
3
+ "version": "0.0.432",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",