@botbotgo/agent-harness 0.0.376 → 0.0.377
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.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.377";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
|
package/dist/package-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.377";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
|
|
@@ -900,56 +900,58 @@ export class AgentRuntimeAdapter {
|
|
|
900
900
|
"User request:",
|
|
901
901
|
requestText,
|
|
902
902
|
].filter(Boolean).join("\n\n");
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
requestId,
|
|
910
|
-
context: options.context,
|
|
911
|
-
toolRuntimeContext: this.buildFunctionToolRuntimeContext(binding, {
|
|
912
|
-
...options,
|
|
903
|
+
if (!selection) {
|
|
904
|
+
const model = await this.resolveModel(primaryModel);
|
|
905
|
+
if (typeof model.invoke !== "function") {
|
|
906
|
+
return null;
|
|
907
|
+
}
|
|
908
|
+
const invokeRouter = async (activePrompt, operationName) => this.invokeWithProviderRetry(binding, () => this.withTimeout(() => model.invoke(activePrompt, resolveLangChainInvocationConfig(binding, {
|
|
913
909
|
sessionId,
|
|
914
910
|
requestId,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
911
|
+
context: options.context,
|
|
912
|
+
toolRuntimeContext: this.buildFunctionToolRuntimeContext(binding, {
|
|
913
|
+
...options,
|
|
914
|
+
sessionId,
|
|
915
|
+
requestId,
|
|
916
|
+
}),
|
|
917
|
+
})), resolveBindingTimeout(binding), operationName, "invoke"));
|
|
918
|
+
const routerPrompts = [
|
|
920
919
|
prompt,
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
920
|
+
[
|
|
921
|
+
prompt,
|
|
922
|
+
"Your previous router output was invalid.",
|
|
923
|
+
"Return only one JSON object now. Do not include prose, markdown, labels, or tool-call wrappers.",
|
|
924
|
+
].join("\n\n"),
|
|
925
|
+
[
|
|
926
|
+
primaryModel.init?.think === false ? "/no_think" : "",
|
|
927
|
+
"Select one subagent from this exact list:",
|
|
928
|
+
Array.from(subagentNames).join(", "),
|
|
929
|
+
"Return JSON only:",
|
|
930
|
+
"{\"subagent_type\":\"<one exact listed name>\"}",
|
|
931
|
+
"User request:",
|
|
932
|
+
requestText,
|
|
933
|
+
].filter(Boolean).join("\n\n"),
|
|
934
|
+
[
|
|
935
|
+
primaryModel.init?.think === false ? "/no_think" : "",
|
|
936
|
+
"JSON only. Pick a listed subagent or refuse.",
|
|
937
|
+
"Listed subagents:",
|
|
938
|
+
Array.from(subagentNames).join(", "),
|
|
939
|
+
"Allowed outputs:",
|
|
940
|
+
"{\"subagent_type\":\"<listed name>\"}",
|
|
941
|
+
"{\"status\":\"refused\",\"reason\":\"No configured subagent can handle the request.\"}",
|
|
942
|
+
"Request:",
|
|
943
|
+
requestText,
|
|
944
|
+
].filter(Boolean).join("\n\n"),
|
|
945
|
+
];
|
|
946
|
+
let previousRawText = "";
|
|
947
|
+
for (let index = 0; index < routerPrompts.length && !selection; index += 1) {
|
|
948
|
+
const activePrompt = index <= 1 || !previousRawText
|
|
949
|
+
? routerPrompts[index]
|
|
950
|
+
: [routerPrompts[index], "Previous output:", previousRawText].join("\n\n");
|
|
951
|
+
const raw = await invokeRouter(activePrompt, index === 0 ? "delegation router invoke" : `delegation router retry invoke ${index}`);
|
|
952
|
+
previousRawText = readModelText(raw);
|
|
953
|
+
selection = parseCompactRouterSelection(previousRawText, subagentNames);
|
|
954
|
+
}
|
|
953
955
|
}
|
|
954
956
|
if (selection?.refusedReason) {
|
|
955
957
|
return {
|
|
@@ -1266,56 +1268,58 @@ export class AgentRuntimeAdapter {
|
|
|
1266
1268
|
"User request:",
|
|
1267
1269
|
requestText,
|
|
1268
1270
|
].filter(Boolean).join("\n\n");
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
requestId,
|
|
1276
|
-
context: options.context,
|
|
1277
|
-
toolRuntimeContext: this.buildFunctionToolRuntimeContext(binding, {
|
|
1278
|
-
...options,
|
|
1271
|
+
if (!selection) {
|
|
1272
|
+
const model = await this.resolveModel(primaryModel);
|
|
1273
|
+
if (typeof model.invoke !== "function") {
|
|
1274
|
+
return null;
|
|
1275
|
+
}
|
|
1276
|
+
const invokeRouter = async (activePrompt, operationName) => this.invokeWithProviderRetry(binding, () => this.withTimeout(() => model.invoke(activePrompt, resolveLangChainInvocationConfig(binding, {
|
|
1279
1277
|
sessionId,
|
|
1280
1278
|
requestId,
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1279
|
+
context: options.context,
|
|
1280
|
+
toolRuntimeContext: this.buildFunctionToolRuntimeContext(binding, {
|
|
1281
|
+
...options,
|
|
1282
|
+
sessionId,
|
|
1283
|
+
requestId,
|
|
1284
|
+
}),
|
|
1285
|
+
})), resolveBindingTimeout(binding), operationName, "invoke"));
|
|
1286
|
+
const routerPrompts = [
|
|
1286
1287
|
prompt,
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1288
|
+
[
|
|
1289
|
+
prompt,
|
|
1290
|
+
"Your previous router output was invalid.",
|
|
1291
|
+
"Return only one JSON object now. Do not include prose, markdown, labels, or tool-call wrappers.",
|
|
1292
|
+
].join("\n\n"),
|
|
1293
|
+
[
|
|
1294
|
+
primaryModel.init?.think === false ? "/no_think" : "",
|
|
1295
|
+
"Select one subagent from this exact list:",
|
|
1296
|
+
Array.from(subagentNames).join(", "),
|
|
1297
|
+
"Return JSON only:",
|
|
1298
|
+
"{\"subagent_type\":\"<one exact listed name>\"}",
|
|
1299
|
+
"User request:",
|
|
1300
|
+
requestText,
|
|
1301
|
+
].filter(Boolean).join("\n\n"),
|
|
1302
|
+
[
|
|
1303
|
+
primaryModel.init?.think === false ? "/no_think" : "",
|
|
1304
|
+
"JSON only. Pick a listed subagent or refuse.",
|
|
1305
|
+
"Listed subagents:",
|
|
1306
|
+
Array.from(subagentNames).join(", "),
|
|
1307
|
+
"Allowed outputs:",
|
|
1308
|
+
"{\"subagent_type\":\"<listed name>\"}",
|
|
1309
|
+
"{\"status\":\"refused\",\"reason\":\"No configured subagent can handle the request.\"}",
|
|
1310
|
+
"Request:",
|
|
1311
|
+
requestText,
|
|
1312
|
+
].filter(Boolean).join("\n\n"),
|
|
1313
|
+
];
|
|
1314
|
+
let previousRawText = "";
|
|
1315
|
+
for (let index = 0; index < routerPrompts.length && !selection; index += 1) {
|
|
1316
|
+
const activePrompt = index <= 1 || !previousRawText
|
|
1317
|
+
? routerPrompts[index]
|
|
1318
|
+
: [routerPrompts[index], "Previous output:", previousRawText].join("\n\n");
|
|
1319
|
+
const raw = await invokeRouter(activePrompt, index === 0 ? "delegation router invoke" : `delegation router retry invoke ${index}`);
|
|
1320
|
+
previousRawText = readModelText(raw);
|
|
1321
|
+
selection = parseCompactRouterSelection(previousRawText, subagentNames);
|
|
1322
|
+
}
|
|
1319
1323
|
}
|
|
1320
1324
|
if (selection?.refusedReason) {
|
|
1321
1325
|
return {
|