@botbotgo/agent-harness 0.0.437 → 0.0.439
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.
|
|
2
|
-
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.439";
|
|
2
|
+
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
package/dist/package-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
2
|
-
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.439";
|
|
2
|
+
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -486,7 +486,7 @@ function parseCompactRouterSelection(value, subagentNames) {
|
|
|
486
486
|
}
|
|
487
487
|
return null;
|
|
488
488
|
}
|
|
489
|
-
function buildCompactRouterPolicy(routingPolicy
|
|
489
|
+
function buildCompactRouterPolicy(routingPolicy) {
|
|
490
490
|
if (!routingPolicy) {
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
@@ -494,63 +494,18 @@ function buildCompactRouterPolicy(routingPolicy, subagentNames) {
|
|
|
494
494
|
.split(/\r?\n/u)
|
|
495
495
|
.map((line) => line.trim())
|
|
496
496
|
.filter((line) => line.length > 0);
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const escaped = escapeRegExp(name);
|
|
502
|
-
return new RegExp(`(?:^|[^\\p{L}\\p{N}_-])\`?${escaped}\`?(?:$|[^\\p{L}\\p{N}_-])`, "iu");
|
|
503
|
-
});
|
|
504
|
-
for (const line of lines) {
|
|
505
|
-
const normalized = line.toLowerCase();
|
|
506
|
-
if (/^route by meaning\b/iu.test(line)) {
|
|
507
|
-
inRoutingBlock = true;
|
|
508
|
-
inDelegationBlock = false;
|
|
509
|
-
selected.push(line);
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
if (/^delegation rules\b/iu.test(line)) {
|
|
513
|
-
inRoutingBlock = false;
|
|
514
|
-
inDelegationBlock = true;
|
|
515
|
-
selected.push(line);
|
|
516
|
-
continue;
|
|
517
|
-
}
|
|
518
|
-
if (/^(output|role|rules|working style|tool rules)\b/iu.test(line)) {
|
|
519
|
-
inRoutingBlock = false;
|
|
520
|
-
inDelegationBlock = false;
|
|
521
|
-
}
|
|
522
|
-
const mentionsSubagent = subagentPatterns.some((pattern) => pattern.test(line));
|
|
523
|
-
const mentionsDelegationPrimitive = normalized.includes("task")
|
|
524
|
-
|| normalized.includes("delegate")
|
|
525
|
-
|| normalized.includes("delegating")
|
|
526
|
-
|| normalized.includes("委托")
|
|
527
|
-
|| normalized.includes("路由");
|
|
528
|
-
if (inRoutingBlock && mentionsSubagent) {
|
|
529
|
-
selected.push(line);
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
if (inDelegationBlock && (mentionsSubagent || mentionsDelegationPrimitive)) {
|
|
533
|
-
selected.push(line);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return selected.slice(0, 80).join("\n");
|
|
497
|
+
const outputContractIndex = lines.findIndex((line) => /^output:?$/iu.test(line));
|
|
498
|
+
return (outputContractIndex >= 0 ? lines.slice(0, outputContractIndex) : lines)
|
|
499
|
+
.slice(0, 80)
|
|
500
|
+
.join("\n");
|
|
537
501
|
}
|
|
538
502
|
function buildDelegatedOwnedTaskInstruction(input) {
|
|
539
|
-
const relevantPolicyLines = (input.routingPolicy ?? "")
|
|
540
|
-
.split(/\r?\n/u)
|
|
541
|
-
.map((line) => line.trim())
|
|
542
|
-
.filter((line) => line.includes(`\`${input.subagentType}\``)
|
|
543
|
-
|| line.includes(` ${input.subagentType} `)
|
|
544
|
-
|| line.toLowerCase().includes(`to ${input.subagentType}`))
|
|
545
|
-
.slice(0, 8);
|
|
546
503
|
return [
|
|
547
504
|
`Delegated owner: ${input.subagentType}.`,
|
|
548
505
|
"Execute only this owner's bounded portion of the larger request.",
|
|
549
506
|
"Do not take over other specialist-owned work; return blockers for missing access instead of inventing success.",
|
|
550
507
|
"Owned subtask:",
|
|
551
508
|
input.taskText.trim() || input.originalRequest,
|
|
552
|
-
relevantPolicyLines.length > 0 ? "Relevant parent routing/delegation policy for this owner:" : "",
|
|
553
|
-
...relevantPolicyLines,
|
|
554
509
|
"If the owner policy or tool contract requires evidence, call write_todos first and then execute the appropriate non-planning evidence tool before any final answer.",
|
|
555
510
|
"Close every TODO as completed or failed before final output.",
|
|
556
511
|
].filter(Boolean).join("\n");
|
|
@@ -1333,7 +1288,7 @@ export class AgentRuntimeAdapter {
|
|
|
1333
1288
|
.map((subagent) => `- ${subagent.name}: ${subagent.description}`)
|
|
1334
1289
|
.join("\n");
|
|
1335
1290
|
const routingPolicy = getBindingSystemPrompt(binding);
|
|
1336
|
-
const compactRoutingPolicy = buildCompactRouterPolicy(routingPolicy
|
|
1291
|
+
const compactRoutingPolicy = buildCompactRouterPolicy(routingPolicy);
|
|
1337
1292
|
const prompt = [
|
|
1338
1293
|
primaryModel.init?.think === false ? "/no_think" : "",
|
|
1339
1294
|
"You are selecting a subagent for a delegation-only agent.",
|
|
@@ -1689,7 +1644,7 @@ export class AgentRuntimeAdapter {
|
|
|
1689
1644
|
.map((subagent) => `- ${subagent.name}: ${subagent.description}`)
|
|
1690
1645
|
.join("\n");
|
|
1691
1646
|
const routingPolicy = getBindingSystemPrompt(binding);
|
|
1692
|
-
const compactRoutingPolicy = buildCompactRouterPolicy(routingPolicy
|
|
1647
|
+
const compactRoutingPolicy = buildCompactRouterPolicy(routingPolicy);
|
|
1693
1648
|
const prompt = [
|
|
1694
1649
|
primaryModel.init?.think === false ? "/no_think" : "",
|
|
1695
1650
|
"You are planning delegation for a delegation-only agent.",
|
|
@@ -1926,8 +1881,6 @@ export class AgentRuntimeAdapter {
|
|
|
1926
1881
|
subagentType: planned.subagentType,
|
|
1927
1882
|
taskText: planned.description,
|
|
1928
1883
|
originalRequest: requestText,
|
|
1929
|
-
routingPolicy,
|
|
1930
|
-
ownerPolicy: selectedBinding ? getBindingSystemPrompt(selectedBinding) : undefined,
|
|
1931
1884
|
});
|
|
1932
1885
|
yield {
|
|
1933
1886
|
kind: "commentary",
|
|
@@ -2149,8 +2102,6 @@ export class AgentRuntimeAdapter {
|
|
|
2149
2102
|
subagentType,
|
|
2150
2103
|
taskText: requestText,
|
|
2151
2104
|
originalRequest: requestText,
|
|
2152
|
-
routingPolicy,
|
|
2153
|
-
ownerPolicy: getBindingSystemPrompt(selectedBinding),
|
|
2154
2105
|
});
|
|
2155
2106
|
let delegatedResult = yield* runDelegatedStreamAttempt(delegatedText);
|
|
2156
2107
|
const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(selectedBinding).length > 0;
|