ceddcozum 0.1.1 → 0.1.2
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/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27170,7 +27170,7 @@ var HIDDEN_TOOL_IDS = [
|
|
|
27170
27170
|
"gfr",
|
|
27171
27171
|
"leptin-sds"
|
|
27172
27172
|
];
|
|
27173
|
-
var VERSION = "0.1.
|
|
27173
|
+
var VERSION = "0.1.2";
|
|
27174
27174
|
var visibleSchemas = toolSchemas.filter(
|
|
27175
27175
|
(s) => !HIDDEN_TOOL_IDS.includes(s.function.name)
|
|
27176
27176
|
);
|
|
@@ -27360,8 +27360,9 @@ function parseKeyValueArgs(pairs, schema) {
|
|
|
27360
27360
|
console.error(` Use ${cyan2("key=value")} format, e.g. ${dim2("sex=male age=5.5")}`);
|
|
27361
27361
|
process.exit(1);
|
|
27362
27362
|
}
|
|
27363
|
-
const
|
|
27363
|
+
const rawKey = pair.slice(0, eqIdx);
|
|
27364
27364
|
const raw = pair.slice(eqIdx + 1);
|
|
27365
|
+
const key = Object.keys(props).find((k) => k.toLowerCase() === rawKey.toLowerCase()) ?? rawKey;
|
|
27365
27366
|
const prop = props[key];
|
|
27366
27367
|
if (prop?.type === "number") {
|
|
27367
27368
|
const n = Number(raw);
|
|
@@ -27373,7 +27374,12 @@ function parseKeyValueArgs(pairs, schema) {
|
|
|
27373
27374
|
} else if (prop?.type === "boolean") {
|
|
27374
27375
|
args[key] = raw === "true" || raw === "1";
|
|
27375
27376
|
} else {
|
|
27376
|
-
|
|
27377
|
+
if (prop?.enum) {
|
|
27378
|
+
const match = prop.enum.find((e) => e.toLowerCase() === raw.toLowerCase());
|
|
27379
|
+
args[key] = match ?? raw;
|
|
27380
|
+
} else {
|
|
27381
|
+
args[key] = raw;
|
|
27382
|
+
}
|
|
27377
27383
|
}
|
|
27378
27384
|
}
|
|
27379
27385
|
return args;
|