@nowcrew/daemon 0.6.94 → 0.6.95-beta.1
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/list-models.js +6 -31
- package/package.json +1 -1
package/dist/list-models.js
CHANGED
|
@@ -182,35 +182,10 @@ export function parseOpencodeModels(stdout) {
|
|
|
182
182
|
}
|
|
183
183
|
return models;
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (line.length === 0 || line.toLowerCase().startsWith("warning"))
|
|
192
|
-
continue;
|
|
193
|
-
const columns = line.split(/\s+/);
|
|
194
|
-
const [provider, model, context, maxOutput, thinking, images] = columns;
|
|
195
|
-
if (provider === "provider" && model === "model"
|
|
196
|
-
|| !provider || !model
|
|
197
|
-
|| !/^\d+(?:\.\d+)?[KMG]$/i.test(context ?? "")
|
|
198
|
-
|| !/^\d+(?:\.\d+)?[KMG]$/i.test(maxOutput ?? "")
|
|
199
|
-
|| !/^(?:yes|no)$/i.test(thinking ?? "")
|
|
200
|
-
|| !/^(?:yes|no)$/i.test(images ?? ""))
|
|
201
|
-
continue;
|
|
202
|
-
const id = `${provider}/${model}`;
|
|
203
|
-
if (seen.has(id))
|
|
204
|
-
continue;
|
|
205
|
-
seen.add(id);
|
|
206
|
-
models.push({
|
|
207
|
-
id,
|
|
208
|
-
label: id,
|
|
209
|
-
...(thinking?.toLowerCase() === "yes" ? { reasoning } : {}),
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
// `pi --list-models` does not identify the configured default model, and its
|
|
213
|
-
// output order is not a default-model contract. Leave default unset so the
|
|
214
|
-
// UI does not infer capabilities from an unrelated first row.
|
|
215
|
-
return models;
|
|
185
|
+
function parsePiModels(stdout) {
|
|
186
|
+
return stdout
|
|
187
|
+
.split(/\r?\n/)
|
|
188
|
+
.map((line) => line.trim())
|
|
189
|
+
.filter((line) => line.length > 0 && !line.toLowerCase().startsWith("warning"))
|
|
190
|
+
.map((line, index) => ({ id: line, label: line, ...(index === 0 ? { default: true } : {}) }));
|
|
216
191
|
}
|