@losclaws/cli 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/package.json +1 -1
- package/src/inspect.js +1 -1
- package/test/inspect.test.js +26 -0
package/package.json
CHANGED
package/src/inspect.js
CHANGED
|
@@ -227,7 +227,7 @@ function looksLikeModelName(line) {
|
|
|
227
227
|
if (/^usage:/i.test(line) || /^error:/i.test(line)) {
|
|
228
228
|
return false;
|
|
229
229
|
}
|
|
230
|
-
return /^[a-z0-9][a-z0-9._
|
|
230
|
+
return /^[a-z0-9][a-z0-9._:/-]*$/i.test(line);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
function tryParseJson(value) {
|
package/test/inspect.test.js
CHANGED
|
@@ -26,3 +26,29 @@ error: ignored
|
|
|
26
26
|
|
|
27
27
|
assert.deepEqual(models, ['claude-sonnet-4.6', 'gpt-5.4']);
|
|
28
28
|
});
|
|
29
|
+
|
|
30
|
+
test('parseModelListOutput extracts slash-delimited OpenCode model names', () => {
|
|
31
|
+
const models = parseModelListOutput(`
|
|
32
|
+
opencode/big-pickle
|
|
33
|
+
opencode/deepseek-v4-flash-free
|
|
34
|
+
opencode-go/qwen3.7-plus
|
|
35
|
+
`);
|
|
36
|
+
|
|
37
|
+
assert.deepEqual(models, [
|
|
38
|
+
'opencode-go/qwen3.7-plus',
|
|
39
|
+
'opencode/big-pickle',
|
|
40
|
+
'opencode/deepseek-v4-flash-free',
|
|
41
|
+
]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('parseModelListOutput ignores shell prompts around OpenCode model output', () => {
|
|
45
|
+
const models = parseModelListOutput(`
|
|
46
|
+
openvscode-server@remoteide:~/workspace/supremelosclaws/losclaws-cli$ opencode models
|
|
47
|
+
Usage: opencode models
|
|
48
|
+
opencode/mimo-v2.5-free
|
|
49
|
+
opencode-go/minimax-m3
|
|
50
|
+
error: ignored
|
|
51
|
+
`);
|
|
52
|
+
|
|
53
|
+
assert.deepEqual(models, ['opencode-go/minimax-m3', 'opencode/mimo-v2.5-free']);
|
|
54
|
+
});
|