open-agents-ai 0.103.78 → 0.103.79
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 +44 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30706,7 +30706,8 @@ async function fetchOllamaModels(baseUrl) {
|
|
|
30706
30706
|
sizeBytes: m.size,
|
|
30707
30707
|
modified: formatRelativeTime(m.modified_at),
|
|
30708
30708
|
parameterSize: m.details?.parameter_size,
|
|
30709
|
-
contextLength: void 0
|
|
30709
|
+
contextLength: void 0,
|
|
30710
|
+
caps: void 0
|
|
30710
30711
|
})).sort((a, b) => b.sizeBytes - a.sizeBytes);
|
|
30711
30712
|
const normalized = normalizeBaseUrl(baseUrl);
|
|
30712
30713
|
const showResults = await Promise.allSettled(result.map((m) => fetch(`${normalized}/api/show`, {
|
|
@@ -30735,6 +30736,34 @@ async function fetchOllamaModels(baseUrl) {
|
|
|
30735
30736
|
}
|
|
30736
30737
|
}
|
|
30737
30738
|
}
|
|
30739
|
+
const modelCaps = { vision: false, toolUse: false, thinking: false };
|
|
30740
|
+
const nameLower = result[i].name.toLowerCase();
|
|
30741
|
+
if (Array.isArray(show.capabilities)) {
|
|
30742
|
+
if (show.capabilities.includes("vision"))
|
|
30743
|
+
modelCaps.vision = true;
|
|
30744
|
+
if (show.capabilities.includes("tools"))
|
|
30745
|
+
modelCaps.toolUse = true;
|
|
30746
|
+
if (show.capabilities.includes("thinking"))
|
|
30747
|
+
modelCaps.thinking = true;
|
|
30748
|
+
}
|
|
30749
|
+
if (show.model_info) {
|
|
30750
|
+
for (const key of Object.keys(show.model_info)) {
|
|
30751
|
+
const k = key.toLowerCase();
|
|
30752
|
+
if (k.includes("vision.block_count") || k.includes("clip.") || k.includes("image_token_id") || k.includes("projector")) {
|
|
30753
|
+
const val = show.model_info[key];
|
|
30754
|
+
if (val !== null && val !== void 0 && val !== 0 && val !== "") {
|
|
30755
|
+
modelCaps.vision = true;
|
|
30756
|
+
}
|
|
30757
|
+
}
|
|
30758
|
+
}
|
|
30759
|
+
}
|
|
30760
|
+
if (/qwen3|qwen2\.5|llama3\.[13]|mistral|mixtral|command-r|gemma3|devstral|deepseek/.test(nameLower)) {
|
|
30761
|
+
modelCaps.toolUse = true;
|
|
30762
|
+
}
|
|
30763
|
+
if (show.template && (show.template.includes("<think>") || show.template.includes("thinking"))) {
|
|
30764
|
+
modelCaps.thinking = true;
|
|
30765
|
+
}
|
|
30766
|
+
result[i].caps = modelCaps;
|
|
30738
30767
|
}
|
|
30739
30768
|
return result;
|
|
30740
30769
|
}
|
|
@@ -31107,6 +31136,16 @@ function formatContextLength(tokens) {
|
|
|
31107
31136
|
return `${Math.round(tokens / 1024)}K ctx`;
|
|
31108
31137
|
return `${tokens} ctx`;
|
|
31109
31138
|
}
|
|
31139
|
+
function formatCaps(caps) {
|
|
31140
|
+
const tags = [];
|
|
31141
|
+
if (caps.vision)
|
|
31142
|
+
tags.push("vision");
|
|
31143
|
+
if (caps.toolUse)
|
|
31144
|
+
tags.push("tools");
|
|
31145
|
+
if (caps.thinking)
|
|
31146
|
+
tags.push("think");
|
|
31147
|
+
return tags.join("+");
|
|
31148
|
+
}
|
|
31110
31149
|
function formatRelativeTime(iso) {
|
|
31111
31150
|
const now = Date.now();
|
|
31112
31151
|
const then = new Date(iso).getTime();
|
|
@@ -35240,10 +35279,11 @@ async function showModelPicker(ctx, local = false) {
|
|
|
35240
35279
|
const available = liveModelNames.has(h.value) ? "" : c2.yellow(" [offline]");
|
|
35241
35280
|
const meta = modelMap.get(h.value);
|
|
35242
35281
|
const ctx2 = meta?.contextLength ? ` ${formatContextLength(meta.contextLength)}` : "";
|
|
35282
|
+
const capStr = meta?.caps ? ` ${formatCaps(meta.caps)}` : "";
|
|
35243
35283
|
items.push({
|
|
35244
35284
|
key: h.value,
|
|
35245
35285
|
label: h.value,
|
|
35246
|
-
detail: `${uses}${ctx2}${available}`
|
|
35286
|
+
detail: `${uses}${ctx2}${capStr}${available}`
|
|
35247
35287
|
});
|
|
35248
35288
|
}
|
|
35249
35289
|
items.push({ key: "__header_available__", label: c2.dim("\u2500\u2500 Available \u2500\u2500"), detail: "" });
|
|
@@ -35253,10 +35293,11 @@ async function showModelPicker(ctx, local = false) {
|
|
|
35253
35293
|
if (history.length > 0 && historyKeys.has(m.name))
|
|
35254
35294
|
continue;
|
|
35255
35295
|
const ctx2 = m.contextLength ? formatContextLength(m.contextLength) : "";
|
|
35296
|
+
const capStr = m.caps ? formatCaps(m.caps) : "";
|
|
35256
35297
|
items.push({
|
|
35257
35298
|
key: m.name,
|
|
35258
35299
|
label: m.name,
|
|
35259
|
-
detail: [m.parameterSize, ctx2,
|
|
35300
|
+
detail: [m.parameterSize, ctx2, capStr, m.modified].filter(Boolean).join(" ")
|
|
35260
35301
|
});
|
|
35261
35302
|
}
|
|
35262
35303
|
const result = await tuiSelect({
|
package/package.json
CHANGED