@botbotgo/agent-harness 0.0.474 → 0.0.475
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.475";
|
|
2
|
+
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-08";
|
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.475";
|
|
2
|
+
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-08";
|
|
@@ -137,12 +137,26 @@ function readStructuredToolCall(value) {
|
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
139
|
const typed = parsed;
|
|
140
|
-
|
|
140
|
+
if (Array.isArray(typed.tool_calls)) {
|
|
141
|
+
return readStructuredToolCall(typed.tool_calls[0]);
|
|
142
|
+
}
|
|
143
|
+
const functionPayload = typeof typed.function === "object" && typed.function !== null ? typed.function : undefined;
|
|
144
|
+
const nameCandidate = typed.name
|
|
145
|
+
?? typed.tool_name
|
|
146
|
+
?? typed.tool
|
|
147
|
+
?? functionPayload?.name
|
|
148
|
+
?? (typeof typed.function === "string" ? typed.function : undefined);
|
|
141
149
|
const name = typeof nameCandidate === "string" ? nameCandidate.trim() : "";
|
|
142
150
|
if (!name) {
|
|
143
151
|
return null;
|
|
144
152
|
}
|
|
145
|
-
const argsCandidate = typed.arguments
|
|
153
|
+
const argsCandidate = typed.arguments
|
|
154
|
+
?? typed.args
|
|
155
|
+
?? typed.parameters
|
|
156
|
+
?? functionPayload?.arguments
|
|
157
|
+
?? functionPayload?.args
|
|
158
|
+
?? functionPayload?.parameters
|
|
159
|
+
?? {};
|
|
146
160
|
const args = typeof argsCandidate === "object" && argsCandidate !== null && !Array.isArray(argsCandidate)
|
|
147
161
|
? argsCandidate
|
|
148
162
|
: {};
|
|
@@ -630,18 +630,44 @@ function normalizeParsedToolCall(payload) {
|
|
|
630
630
|
return normalizeParsedToolCall(payload[0]);
|
|
631
631
|
}
|
|
632
632
|
const typed = payload;
|
|
633
|
+
if (Array.isArray(typed.tool_calls)) {
|
|
634
|
+
return normalizeParsedToolCall(typed.tool_calls[0]);
|
|
635
|
+
}
|
|
633
636
|
const functionPayload = typeof typed.function === "object" && typed.function !== null ? typed.function : undefined;
|
|
634
|
-
const nameCandidate = typed.name
|
|
637
|
+
const nameCandidate = typed.name
|
|
638
|
+
?? typed.tool_name
|
|
639
|
+
?? typed.tool
|
|
640
|
+
?? functionPayload?.name
|
|
641
|
+
?? (typeof typed.function === "string" ? typed.function : undefined);
|
|
635
642
|
const name = typeof nameCandidate === "string" ? nameCandidate.trim() : "";
|
|
636
643
|
if (!name) {
|
|
637
644
|
return null;
|
|
638
645
|
}
|
|
639
|
-
const argsCandidate = typed.arguments
|
|
646
|
+
const argsCandidate = typed.arguments
|
|
647
|
+
?? typed.args
|
|
648
|
+
?? typed.parameters
|
|
649
|
+
?? typed.input
|
|
650
|
+
?? functionPayload?.arguments
|
|
651
|
+
?? functionPayload?.args
|
|
652
|
+
?? functionPayload?.parameters
|
|
653
|
+
?? {};
|
|
640
654
|
const args = Array.isArray(argsCandidate)
|
|
641
655
|
? { args: argsCandidate }
|
|
642
656
|
: salvageToolArgs(argsCandidate) ?? {};
|
|
643
657
|
return { name, args: normalizeKnownToolArgs(name, args) };
|
|
644
658
|
}
|
|
659
|
+
function buildInvalidPromptedJsonToolCall(toolCall) {
|
|
660
|
+
return new AIMessage({
|
|
661
|
+
content: "",
|
|
662
|
+
invalid_tool_calls: [{
|
|
663
|
+
id: `invalid-tool-${Math.random().toString(36).slice(2, 10)}`,
|
|
664
|
+
name: toolCall.name,
|
|
665
|
+
args: JSON.stringify(toolCall.args),
|
|
666
|
+
error: `Prompted-json model requested unavailable tool: ${toolCall.name}`,
|
|
667
|
+
type: "invalid_tool_call",
|
|
668
|
+
}],
|
|
669
|
+
});
|
|
670
|
+
}
|
|
645
671
|
function buildFallbackTodoContents() {
|
|
646
672
|
return [
|
|
647
673
|
"Identify the concrete evidence tool required for this request",
|
|
@@ -911,7 +937,7 @@ function createPromptedJsonToolBindableModel(model, boundTools = [], options = {
|
|
|
911
937
|
return rawResult;
|
|
912
938
|
}
|
|
913
939
|
if (!isAllowedPromptedJsonToolCall(parsedToolCall.name, effectiveBoundTools)) {
|
|
914
|
-
return
|
|
940
|
+
return buildInvalidPromptedJsonToolCall(parsedToolCall);
|
|
915
941
|
}
|
|
916
942
|
const effectiveParsedToolCall = forcePlanningToolCall
|
|
917
943
|
? normalizeInitialTodoPlanToolCall(parsedToolCall)
|