@botbotgo/agent-harness 0.0.418 → 0.0.420
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.
- package/dist/cli/chat-interactive.js +1 -1
- package/dist/cli/chat-stream.js +9 -1
- package/dist/package-version.d.ts +2 -2
- package/dist/package-version.js +2 -2
- package/dist/runtime/adapter/compat/openai-compatible.js +12 -0
- package/dist/runtime/adapter/flow/invocation-flow.d.ts +2 -0
- package/dist/runtime/adapter/flow/invocation-flow.js +13 -5
- package/dist/runtime/adapter/flow/invoke-runtime.d.ts +1 -0
- package/dist/runtime/adapter/flow/invoke-runtime.js +1 -0
- package/dist/runtime/adapter/flow/stream-runtime.d.ts +4 -0
- package/dist/runtime/adapter/flow/stream-runtime.js +177 -14
- package/dist/runtime/adapter/invocation-result.js +17 -6
- package/dist/runtime/adapter/local-tool-invocation.d.ts +2 -1
- package/dist/runtime/adapter/local-tool-invocation.js +268 -21
- package/dist/runtime/adapter/model/model-providers.js +269 -58
- package/dist/runtime/adapter/model/prompted-json-tool-call-capture.d.ts +9 -0
- package/dist/runtime/adapter/model/prompted-json-tool-call-capture.js +40 -0
- package/dist/runtime/adapter/runtime-adapter-support.js +58 -12
- package/dist/runtime/adapter/runtime-shell.js +3 -2
- package/dist/runtime/adapter/stream-event-projection.js +22 -5
- package/dist/runtime/adapter/tool/tool-arguments.js +157 -67
- package/dist/runtime/adapter/tool/tool-replay.js +0 -4
- package/dist/runtime/agent-runtime-adapter.d.ts +3 -0
- package/dist/runtime/agent-runtime-adapter.js +217 -73
- package/dist/runtime/harness/run/stream-run.js +31 -3
- package/dist/runtime/parsing/output-tool-args.js +108 -0
- package/dist/workspace/resource-compilers.js +17 -4
- package/package.json +1 -1
|
@@ -43,6 +43,10 @@ const NUMERIC_MODEL_INIT_FIELDS = new Set([
|
|
|
43
43
|
"topK",
|
|
44
44
|
"topP",
|
|
45
45
|
]);
|
|
46
|
+
const BOOLEAN_MODEL_INIT_FIELDS = new Set([
|
|
47
|
+
"omitAuthHeader",
|
|
48
|
+
"think",
|
|
49
|
+
]);
|
|
46
50
|
function normalizeModelInitFields(init) {
|
|
47
51
|
return Object.fromEntries(Object.entries(init).map(([key, value]) => {
|
|
48
52
|
if (NUMERIC_MODEL_INIT_FIELDS.has(key) && typeof value === "string") {
|
|
@@ -51,6 +55,15 @@ function normalizeModelInitFields(init) {
|
|
|
51
55
|
return [key, Number(trimmed)];
|
|
52
56
|
}
|
|
53
57
|
}
|
|
58
|
+
if (BOOLEAN_MODEL_INIT_FIELDS.has(key) && typeof value === "string") {
|
|
59
|
+
const trimmed = value.trim().toLowerCase();
|
|
60
|
+
if (trimmed === "true") {
|
|
61
|
+
return [key, true];
|
|
62
|
+
}
|
|
63
|
+
if (trimmed === "false") {
|
|
64
|
+
return [key, false];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
54
67
|
return [key, value];
|
|
55
68
|
}));
|
|
56
69
|
}
|
|
@@ -88,7 +101,7 @@ export function parseModelObject(object) {
|
|
|
88
101
|
assertNoInitBlock(value, "Model", object.id);
|
|
89
102
|
const provider = String(value.provider ?? "").trim();
|
|
90
103
|
const model = String((value.model ?? value.name) ?? "").trim();
|
|
91
|
-
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "fallbacks", "metadata"]) ?? {});
|
|
104
|
+
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["apiVersion", "id", "kind", "provider", "model", "name", "init", "clientRef", "fallbacks", "metadata"]) ?? {});
|
|
92
105
|
const fallbacks = Array.isArray(value.fallbacks)
|
|
93
106
|
? value.fallbacks
|
|
94
107
|
.map((item) => (typeof item === "object" && item && "ref" in item ? String(item.ref) : undefined))
|
|
@@ -110,7 +123,7 @@ export function parseEmbeddingModelObject(object) {
|
|
|
110
123
|
assertNoInitBlock(value, "EmbeddingModel", object.id);
|
|
111
124
|
const provider = String(value.provider ?? "").trim();
|
|
112
125
|
const model = String((value.model ?? value.name) ?? "").trim();
|
|
113
|
-
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "metadata"]) ?? {});
|
|
126
|
+
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["apiVersion", "id", "kind", "provider", "model", "name", "init", "clientRef", "metadata"]) ?? {});
|
|
114
127
|
return {
|
|
115
128
|
id: object.id,
|
|
116
129
|
provider,
|
|
@@ -249,7 +262,7 @@ export function compileModel(model) {
|
|
|
249
262
|
id: model.id,
|
|
250
263
|
provider: model.provider,
|
|
251
264
|
model: model.model,
|
|
252
|
-
init: model.init,
|
|
265
|
+
init: normalizeModelInitFields(model.init),
|
|
253
266
|
clientRef: model.clientRef,
|
|
254
267
|
fallbacks: model.fallbacks,
|
|
255
268
|
runtimeValue: `${model.provider}:${model.model}`,
|
|
@@ -275,7 +288,7 @@ export function compileEmbeddingModel(model) {
|
|
|
275
288
|
id: model.id,
|
|
276
289
|
provider: model.provider,
|
|
277
290
|
model: model.model,
|
|
278
|
-
init: model.init,
|
|
291
|
+
init: normalizeModelInitFields(model.init),
|
|
279
292
|
clientRef: model.clientRef,
|
|
280
293
|
runtimeValue: `${model.provider}:${model.model}`,
|
|
281
294
|
};
|