agentgui 1.0.347 → 1.0.348
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/server.js +15 -0
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -323,16 +323,31 @@ function extractModelsFromClaudeCLI() {
|
|
|
323
323
|
let m;
|
|
324
324
|
while ((m = re.exec(src)) !== null) ids.add(m[1]);
|
|
325
325
|
if (ids.size === 0) return null;
|
|
326
|
+
|
|
326
327
|
const models = [{ id: '', label: 'Default' }];
|
|
327
328
|
const sorted = [...ids].sort((a, b) => {
|
|
328
329
|
const va = a.replace(/claude-/, '').replace(/-\d{8}$/, '');
|
|
329
330
|
const vb = b.replace(/claude-/, '').replace(/-\d{8}$/, '');
|
|
330
331
|
return vb.localeCompare(va);
|
|
331
332
|
});
|
|
333
|
+
|
|
334
|
+
const latest = { haiku: null, sonnet: null, opus: null };
|
|
335
|
+
for (const id of sorted) {
|
|
336
|
+
if (id.startsWith('claude-3-')) continue;
|
|
337
|
+
if (id.includes('haiku') && !latest.haiku) latest.haiku = id;
|
|
338
|
+
if (id.includes('sonnet') && !latest.sonnet) latest.sonnet = id;
|
|
339
|
+
if (id.includes('opus') && !latest.opus) latest.opus = id;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (latest.opus) models.push({ id: latest.opus, label: 'Opus (Latest)' });
|
|
343
|
+
if (latest.sonnet) models.push({ id: latest.sonnet, label: 'Sonnet (Latest)' });
|
|
344
|
+
if (latest.haiku) models.push({ id: latest.haiku, label: 'Haiku (Latest)' });
|
|
345
|
+
|
|
332
346
|
for (const id of sorted) {
|
|
333
347
|
if (id.startsWith('claude-3-')) continue;
|
|
334
348
|
models.push({ id, label: modelIdToLabel(id) });
|
|
335
349
|
}
|
|
350
|
+
|
|
336
351
|
return models;
|
|
337
352
|
} catch { return null; }
|
|
338
353
|
}
|