@causyne/agent 1.20.7 → 1.20.8
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/acp/agentCatalog.js +9 -3
- package/src/acp/agentCatalog.ts +20 -4
- package/src/commands.js +25 -10
- package/src/dynamicCatalogue.js +568 -77
- package/src/dynamicCatalogue.ts +608 -79
- package/src/providers/acp.js +35 -2
- package/src/providers/acp.ts +38 -2
- package/src/providers/antigravity.d.ts +7 -1
- package/src/providers/antigravity.js +100 -12
- package/src/providers/antigravity.ts +99 -12
- package/src/tui/modelPicker.js +288 -69
- package/src/tui/modelPicker.ts +333 -72
package/package.json
CHANGED
package/src/acp/agentCatalog.js
CHANGED
|
@@ -259,6 +259,7 @@ export async function testPeerHandshake(options) {
|
|
|
259
259
|
const clientOptions = {
|
|
260
260
|
command: options.command,
|
|
261
261
|
cwd,
|
|
262
|
+
env: { ...process.env, CI: '1', BROWSER: 'false', NO_BROWSER: '1' },
|
|
262
263
|
promptTimeoutMs: options.timeoutMs || 15000
|
|
263
264
|
};
|
|
264
265
|
if (options.args) {
|
|
@@ -275,13 +276,16 @@ export async function testPeerHandshake(options) {
|
|
|
275
276
|
const authMethods = Array.isArray(init.authMethods)
|
|
276
277
|
? init.authMethods.map((m) => (typeof m === 'object' && m !== null && 'id' in m ? String(m.id) : String(m)))
|
|
277
278
|
: [];
|
|
278
|
-
// Attempt session/new to ensure agent is fully operational
|
|
279
|
+
// Attempt session/new to ensure agent is fully operational and extract live models
|
|
279
280
|
try {
|
|
280
|
-
await client.newSession(cwd);
|
|
281
|
+
const sessionId = await client.newSession(cwd);
|
|
282
|
+
const sessionModels = client.getSessionModels(sessionId);
|
|
281
283
|
return {
|
|
282
284
|
ready: true,
|
|
283
285
|
...(agentInfo ? { agentInfo } : {}),
|
|
284
|
-
authMethods
|
|
286
|
+
authMethods,
|
|
287
|
+
...(sessionModels.availableModels.length > 0 ? { availableModels: sessionModels.availableModels } : {}),
|
|
288
|
+
...(sessionModels.currentModelId ? { currentModelId: sessionModels.currentModelId } : {})
|
|
285
289
|
};
|
|
286
290
|
}
|
|
287
291
|
catch (sessionErr) {
|
|
@@ -372,6 +376,8 @@ export async function detectAllPeers(cwd = process.cwd()) {
|
|
|
372
376
|
args: activeArgs,
|
|
373
377
|
...(handshake.agentInfo ? { agentInfo: handshake.agentInfo } : {}),
|
|
374
378
|
...(handshake.authMethods ? { authMethods: handshake.authMethods } : {}),
|
|
379
|
+
...(handshake.availableModels ? { availableModels: handshake.availableModels } : {}),
|
|
380
|
+
...(handshake.currentModelId ? { currentModelId: handshake.currentModelId } : {}),
|
|
375
381
|
details: 'Operational and ready for delegation.'
|
|
376
382
|
});
|
|
377
383
|
}
|
package/src/acp/agentCatalog.ts
CHANGED
|
@@ -48,6 +48,8 @@ export interface PeerDetectionResult {
|
|
|
48
48
|
details?: string;
|
|
49
49
|
agentInfo?: { name: string; version: string };
|
|
50
50
|
authMethods?: string[];
|
|
51
|
+
availableModels?: string[];
|
|
52
|
+
currentModelId?: string;
|
|
51
53
|
setupInstruction?: string;
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -309,12 +311,21 @@ export async function testPeerHandshake(
|
|
|
309
311
|
ready: boolean;
|
|
310
312
|
agentInfo?: { name: string; version: string };
|
|
311
313
|
authMethods?: string[];
|
|
314
|
+
availableModels?: string[];
|
|
315
|
+
currentModelId?: string;
|
|
312
316
|
error?: string;
|
|
313
317
|
}> {
|
|
314
318
|
const cwd = options.cwd || process.cwd();
|
|
315
|
-
const clientOptions: {
|
|
319
|
+
const clientOptions: {
|
|
320
|
+
command: string;
|
|
321
|
+
args?: string[];
|
|
322
|
+
cwd: string;
|
|
323
|
+
env: NodeJS.ProcessEnv;
|
|
324
|
+
promptTimeoutMs: number;
|
|
325
|
+
} = {
|
|
316
326
|
command: options.command,
|
|
317
327
|
cwd,
|
|
328
|
+
env: { ...process.env, CI: '1', BROWSER: 'false', NO_BROWSER: '1' },
|
|
318
329
|
promptTimeoutMs: options.timeoutMs || 15000
|
|
319
330
|
};
|
|
320
331
|
if (options.args) {
|
|
@@ -336,13 +347,16 @@ export async function testPeerHandshake(
|
|
|
336
347
|
? init.authMethods.map((m) => (typeof m === 'object' && m !== null && 'id' in m ? String((m as { id: unknown }).id) : String(m)))
|
|
337
348
|
: [];
|
|
338
349
|
|
|
339
|
-
// Attempt session/new to ensure agent is fully operational
|
|
350
|
+
// Attempt session/new to ensure agent is fully operational and extract live models
|
|
340
351
|
try {
|
|
341
|
-
await client.newSession(cwd);
|
|
352
|
+
const sessionId = await client.newSession(cwd);
|
|
353
|
+
const sessionModels = client.getSessionModels(sessionId);
|
|
342
354
|
return {
|
|
343
355
|
ready: true,
|
|
344
356
|
...(agentInfo ? { agentInfo } : {}),
|
|
345
|
-
authMethods
|
|
357
|
+
authMethods,
|
|
358
|
+
...(sessionModels.availableModels.length > 0 ? { availableModels: sessionModels.availableModels } : {}),
|
|
359
|
+
...(sessionModels.currentModelId ? { currentModelId: sessionModels.currentModelId } : {})
|
|
346
360
|
};
|
|
347
361
|
} catch (sessionErr: unknown) {
|
|
348
362
|
const msg = sessionErr instanceof Error ? sessionErr.message : String(sessionErr);
|
|
@@ -439,6 +453,8 @@ export async function detectAllPeers(cwd: string = process.cwd()): Promise<PeerD
|
|
|
439
453
|
args: activeArgs,
|
|
440
454
|
...(handshake.agentInfo ? { agentInfo: handshake.agentInfo } : {}),
|
|
441
455
|
...(handshake.authMethods ? { authMethods: handshake.authMethods } : {}),
|
|
456
|
+
...(handshake.availableModels ? { availableModels: handshake.availableModels } : {}),
|
|
457
|
+
...(handshake.currentModelId ? { currentModelId: handshake.currentModelId } : {}),
|
|
442
458
|
details: 'Operational and ready for delegation.'
|
|
443
459
|
});
|
|
444
460
|
} else if (handshake.error && /auth/i.test(handshake.error)) {
|
package/src/commands.js
CHANGED
|
@@ -20,7 +20,13 @@ import {
|
|
|
20
20
|
} from './userSkills.js';
|
|
21
21
|
import { buildContextText, buildUsageText, buildCheckpointsText, buildUndoText, buildStatusText } from './reporting.js';
|
|
22
22
|
import { loadConfig, saveConfig } from './config.js';
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
resolveAvailableModels,
|
|
25
|
+
getCuratedModels,
|
|
26
|
+
getAvailableProvidersOverview,
|
|
27
|
+
resolveAvailableProvidersOverview,
|
|
28
|
+
pickDefaultPeerModel
|
|
29
|
+
} from './dynamicCatalogue.js';
|
|
24
30
|
import { DEFAULT_MODEL_BY_PROVIDER, PEER_MODEL_CATALOGUE } from './modelCatalogue.js';
|
|
25
31
|
import { isAcpProvider } from './providers/acp.js';
|
|
26
32
|
import { listSessions, getActiveSessionId } from './sessionStore.js';
|
|
@@ -1176,9 +1182,16 @@ export const COMMANDS = [
|
|
|
1176
1182
|
}
|
|
1177
1183
|
|
|
1178
1184
|
if (first === 'refresh') {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1185
|
+
const targetRefresh = argv[1];
|
|
1186
|
+
if (targetRefresh && targetRefresh.toLowerCase() === 'all') {
|
|
1187
|
+
const refreshed = await resolveAvailableProvidersOverview(config, { forceRefresh: true });
|
|
1188
|
+
const readyCount = refreshed.acp.filter(p => p.installed).length + refreshed.byok.filter(p => p.isConfigured).length;
|
|
1189
|
+
return ok(`Refreshed live models across ${readyCount} installed/configured providers. Run /model list to view.`);
|
|
1190
|
+
}
|
|
1191
|
+
const providerToRefresh = targetRefresh || config.provider;
|
|
1192
|
+
if (!providerToRefresh) return fail('No provider configured. Run /setup first.');
|
|
1193
|
+
const result = await resolveAvailableModels(providerToRefresh, config, true);
|
|
1194
|
+
return ok(`Refreshed ${providerToRefresh} models (${result.models.length} available, source: ${result.source}). Run /model list to view.`);
|
|
1182
1195
|
}
|
|
1183
1196
|
|
|
1184
1197
|
const rawRequested = argv.join(' ').trim().replace(/^\/model\s+/i, '');
|
|
@@ -1216,16 +1229,15 @@ export const COMMANDS = [
|
|
|
1216
1229
|
return ok(feedbackMessage || `Now using ${config.provider} / ${config.model}.`, { effect: 'inline' });
|
|
1217
1230
|
};
|
|
1218
1231
|
|
|
1219
|
-
// 1. Antigravity provider (e.g. antigravity or antigravity/Gemini 3.8 Flash (High))
|
|
1220
1232
|
// 1. Antigravity provider (e.g. antigravity or antigravity/Gemini 3.8 Flash (High))
|
|
1221
1233
|
if (rawRequested.toLowerCase() === 'antigravity' || rawRequested.toLowerCase().startsWith('antigravity/')) {
|
|
1222
|
-
const agyModel = rawRequested.includes('/')
|
|
1223
|
-
? rawRequested.slice(rawRequested.indexOf('/') + 1).trim()
|
|
1224
|
-
: (DEFAULT_MODEL_BY_PROVIDER['antigravity'] || 'Gemini 3.8 Flash (Low)');
|
|
1225
1234
|
const agyPeer = overview.acp.find(p => p.id === 'antigravity');
|
|
1226
1235
|
if (agyPeer && !agyPeer.installed) {
|
|
1227
1236
|
return fail(`Notice: Antigravity CLI (agy) is not installed on this machine.\nSetup: ${agyPeer.setupInstruction}\n\nModel was not changed.`);
|
|
1228
1237
|
}
|
|
1238
|
+
const agyModel = rawRequested.includes('/')
|
|
1239
|
+
? rawRequested.slice(rawRequested.indexOf('/') + 1).trim()
|
|
1240
|
+
: pickDefaultPeerModel('antigravity', agyPeer?.models);
|
|
1229
1241
|
return activateModel('antigravity', agyModel, `Now using Google Antigravity / ${agyModel}.`);
|
|
1230
1242
|
}
|
|
1231
1243
|
|
|
@@ -1234,11 +1246,13 @@ export const COMMANDS = [
|
|
|
1234
1246
|
if (acpTarget) {
|
|
1235
1247
|
const peer = acpTarget[1].toLowerCase();
|
|
1236
1248
|
const nextProvider = `acp/${peer}`;
|
|
1237
|
-
const peerModel = acpTarget[2] ? acpTarget[2].trim() : (DEFAULT_MODEL_BY_PROVIDER[nextProvider] || peer);
|
|
1238
1249
|
const peerInfo = overview.acp.find(p => p.id === peer);
|
|
1239
1250
|
if (peerInfo && !peerInfo.installed) {
|
|
1240
1251
|
return fail(`Notice: "${peerInfo.label}" CLI is not installed on this machine.\nBinary "${peerInfo.id}" was not found on PATH.\nSetup: ${peerInfo.setupInstruction}\n\nModel was not changed.`);
|
|
1241
1252
|
}
|
|
1253
|
+
const peerModel = acpTarget[2]
|
|
1254
|
+
? acpTarget[2].trim()
|
|
1255
|
+
: pickDefaultPeerModel(nextProvider, peerInfo?.models);
|
|
1242
1256
|
return activateModel(nextProvider, peerModel, `Now using ${nextProvider} / ${peerModel}.`);
|
|
1243
1257
|
}
|
|
1244
1258
|
|
|
@@ -1255,6 +1269,7 @@ export const COMMANDS = [
|
|
|
1255
1269
|
if (slashIndex > 0) {
|
|
1256
1270
|
const rest = rawRequested.slice(slashIndex + 1).trim();
|
|
1257
1271
|
if (
|
|
1272
|
+
(Array.isArray(acpPeer.models) && acpPeer.models.includes(rawRequested)) ||
|
|
1258
1273
|
(PEER_MODEL_CATALOGUE[acpPeer.id] && PEER_MODEL_CATALOGUE[acpPeer.id].includes(rawRequested)) ||
|
|
1259
1274
|
(acpPeer.id === 'opencode' && rawRequested.startsWith('opencode/'))
|
|
1260
1275
|
) {
|
|
@@ -1263,7 +1278,7 @@ export const COMMANDS = [
|
|
|
1263
1278
|
peerModel = rest;
|
|
1264
1279
|
}
|
|
1265
1280
|
} else {
|
|
1266
|
-
peerModel =
|
|
1281
|
+
peerModel = pickDefaultPeerModel(nextProvider, acpPeer.models);
|
|
1267
1282
|
}
|
|
1268
1283
|
return activateModel(nextProvider, peerModel, `Now using ${nextProvider} / ${peerModel}.`);
|
|
1269
1284
|
}
|