agentgui 1.0.307 → 1.0.308
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 +14 -14
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -324,16 +324,6 @@ const AGENT_MODEL_COMMANDS = {
|
|
|
324
324
|
};
|
|
325
325
|
|
|
326
326
|
const AGENT_DEFAULT_MODELS = {
|
|
327
|
-
'claude-code': [
|
|
328
|
-
{ id: '', label: 'Default' },
|
|
329
|
-
{ id: 'sonnet', label: 'Sonnet' },
|
|
330
|
-
{ id: 'opus', label: 'Opus' },
|
|
331
|
-
{ id: 'haiku', label: 'Haiku' },
|
|
332
|
-
{ id: 'claude-sonnet-4-5-20250929', label: 'Sonnet 4.5' },
|
|
333
|
-
{ id: 'claude-sonnet-4-6-20260219', label: 'Sonnet 4.6' },
|
|
334
|
-
{ id: 'claude-opus-4-6', label: 'Opus 4.6' },
|
|
335
|
-
{ id: 'claude-haiku-4-5-20251001', label: 'Haiku 4.5' }
|
|
336
|
-
],
|
|
337
327
|
'gemini': [
|
|
338
328
|
{ id: '', label: 'Default' },
|
|
339
329
|
{ id: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro' },
|
|
@@ -399,9 +389,19 @@ async function getModelsForAgent(agentId) {
|
|
|
399
389
|
modelCache.set(agentId, { models: apiModels, timestamp: Date.now() });
|
|
400
390
|
return apiModels;
|
|
401
391
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
392
|
+
try {
|
|
393
|
+
const result = execSync(AGENT_MODEL_COMMANDS[agentId], { encoding: 'utf-8', timeout: 15000 });
|
|
394
|
+
const lines = result.split('\n').map(l => l.trim()).filter(Boolean);
|
|
395
|
+
if (lines.length > 0) {
|
|
396
|
+
const models = [{ id: '', label: 'Default' }];
|
|
397
|
+
for (const line of lines) {
|
|
398
|
+
models.push({ id: line, label: line });
|
|
399
|
+
}
|
|
400
|
+
modelCache.set(agentId, { models, timestamp: Date.now() });
|
|
401
|
+
return models;
|
|
402
|
+
}
|
|
403
|
+
} catch (_) {}
|
|
404
|
+
return [{ id: '', label: 'Default' }];
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
if (AGENT_MODEL_COMMANDS[agentId]) {
|
|
@@ -428,7 +428,7 @@ async function getModelsForAgent(agentId) {
|
|
|
428
428
|
const { getRegisteredAgents } = await import('./lib/claude-runner.js');
|
|
429
429
|
const agents = getRegisteredAgents();
|
|
430
430
|
const agent = agents.find(a => a.id === agentId);
|
|
431
|
-
|
|
431
|
+
|
|
432
432
|
if (agent && agent.command) {
|
|
433
433
|
const modelCmd = `${agent.command} models`;
|
|
434
434
|
try {
|