@botbotgo/agent-harness 0.0.386 → 0.0.387
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.387";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-01";
|
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.387";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-01";
|
|
@@ -30,6 +30,30 @@ function extractTopLevelInitFields(value, reservedKeys) {
|
|
|
30
30
|
}
|
|
31
31
|
return Object.fromEntries(entries);
|
|
32
32
|
}
|
|
33
|
+
const NUMERIC_MODEL_INIT_FIELDS = new Set([
|
|
34
|
+
"maxRetries",
|
|
35
|
+
"maxTokens",
|
|
36
|
+
"numCtx",
|
|
37
|
+
"numGpu",
|
|
38
|
+
"numPredict",
|
|
39
|
+
"numThread",
|
|
40
|
+
"repeatPenalty",
|
|
41
|
+
"temperature",
|
|
42
|
+
"timeout",
|
|
43
|
+
"topK",
|
|
44
|
+
"topP",
|
|
45
|
+
]);
|
|
46
|
+
function normalizeModelInitFields(init) {
|
|
47
|
+
return Object.fromEntries(Object.entries(init).map(([key, value]) => {
|
|
48
|
+
if (NUMERIC_MODEL_INIT_FIELDS.has(key) && typeof value === "string") {
|
|
49
|
+
const trimmed = value.trim();
|
|
50
|
+
if (/^-?(?:\d+|\d*\.\d+)$/.test(trimmed)) {
|
|
51
|
+
return [key, Number(trimmed)];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return [key, value];
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
33
57
|
function assertNoInitBlock(value, kind, id) {
|
|
34
58
|
if (value.init !== undefined) {
|
|
35
59
|
throw new Error(`${kind} ${id} must define provider options at the top level; nested init is not supported`);
|
|
@@ -64,7 +88,7 @@ export function parseModelObject(object) {
|
|
|
64
88
|
assertNoInitBlock(value, "Model", object.id);
|
|
65
89
|
const provider = String(value.provider ?? "").trim();
|
|
66
90
|
const model = String((value.model ?? value.name) ?? "").trim();
|
|
67
|
-
const init = extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "fallbacks", "metadata"]) ?? {};
|
|
91
|
+
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "fallbacks", "metadata"]) ?? {});
|
|
68
92
|
const fallbacks = Array.isArray(value.fallbacks)
|
|
69
93
|
? value.fallbacks
|
|
70
94
|
.map((item) => (typeof item === "object" && item && "ref" in item ? String(item.ref) : undefined))
|
|
@@ -86,7 +110,7 @@ export function parseEmbeddingModelObject(object) {
|
|
|
86
110
|
assertNoInitBlock(value, "EmbeddingModel", object.id);
|
|
87
111
|
const provider = String(value.provider ?? "").trim();
|
|
88
112
|
const model = String((value.model ?? value.name) ?? "").trim();
|
|
89
|
-
const init = extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "metadata"]) ?? {};
|
|
113
|
+
const init = normalizeModelInitFields(extractTopLevelInitFields(value, ["provider", "model", "name", "init", "clientRef", "metadata"]) ?? {});
|
|
90
114
|
return {
|
|
91
115
|
id: object.id,
|
|
92
116
|
provider,
|