@livx.cc/agentx 0.99.24 → 0.99.25
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/cli.d.ts +1 -0
- package/dist/cli.js +30 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ interface Args {
|
|
|
144
144
|
worktree?: string;
|
|
145
145
|
updateCheck?: boolean;
|
|
146
146
|
update?: boolean;
|
|
147
|
+
listModels?: boolean;
|
|
147
148
|
}
|
|
148
149
|
declare function parseArgs(argv: string[]): Args;
|
|
149
150
|
declare function makeHost(format?: 'text' | 'json' | 'stream-json', opts?: {
|
package/dist/cli.js
CHANGED
|
@@ -12075,8 +12075,13 @@ function parseArgs(argv) {
|
|
|
12075
12075
|
const x = argv[i];
|
|
12076
12076
|
if (x === "-h" || x === "--help") a.help = true;
|
|
12077
12077
|
else if (x === "-v" || x === "--version") a.version = true;
|
|
12078
|
-
else if (x === "-m" || x === "--model")
|
|
12079
|
-
|
|
12078
|
+
else if (x === "-m" || x === "--model") {
|
|
12079
|
+
const nxt = argv[i + 1];
|
|
12080
|
+
if (nxt === void 0 || nxt.startsWith("-") || nxt === "list" || nxt === "ls" || nxt === "?") {
|
|
12081
|
+
a.listModels = true;
|
|
12082
|
+
if (nxt === "list" || nxt === "ls" || nxt === "?") i++;
|
|
12083
|
+
} else a.model = argv[++i];
|
|
12084
|
+
} else if (x === "-C" || x === "--cwd") a.cwd = val(++i, x);
|
|
12080
12085
|
else if (x === "-p" || x === "--print") {
|
|
12081
12086
|
const nxt = argv[i + 1];
|
|
12082
12087
|
if (nxt !== void 0 && !nxt.startsWith("-")) a.task = argv[++i];
|
|
@@ -12149,7 +12154,7 @@ var HELP = `agentx \u2014 agent runtime CLI
|
|
|
12149
12154
|
agentx -c "<task>" continue the most recent session
|
|
12150
12155
|
|
|
12151
12156
|
Flags:
|
|
12152
|
-
-m, --model <id> model (default anthropic/claude-sonnet-4-6)
|
|
12157
|
+
-m, --model <id> model (default anthropic/claude-sonnet-4-6); bare -m or -m list = list all models
|
|
12153
12158
|
-C, --cwd <dir> working dir / project root (default .)
|
|
12154
12159
|
-c, --continue resume the most recent session in this dir
|
|
12155
12160
|
-r, --resume [id] resume a session \u2014 with an id, or bare for an interactive picker
|
|
@@ -12229,6 +12234,24 @@ REPL paste: large/multi-line pastes collapse to a [Pasted text +N lines] preview
|
|
|
12229
12234
|
function newestModel() {
|
|
12230
12235
|
return listModels().slice().sort((a, b) => (getModelInfo(b)?.releaseDate ?? "").localeCompare(getModelInfo(a)?.releaseDate ?? ""))[0] ?? "";
|
|
12231
12236
|
}
|
|
12237
|
+
function printModels() {
|
|
12238
|
+
const byProvider = /* @__PURE__ */ new Map();
|
|
12239
|
+
for (const id of listModels()) {
|
|
12240
|
+
const provider = getProviderFromModel(id) ?? "other";
|
|
12241
|
+
if (!byProvider.has(provider)) byProvider.set(provider, []);
|
|
12242
|
+
byProvider.get(provider).push(id);
|
|
12243
|
+
}
|
|
12244
|
+
for (const [provider, ids] of Array.from(byProvider.entries()).sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
12245
|
+
console.log(`
|
|
12246
|
+
${provider}`);
|
|
12247
|
+
ids.sort((a, b) => (getModelInfo(b)?.releaseDate ?? "").localeCompare(getModelInfo(a)?.releaseDate ?? ""));
|
|
12248
|
+
for (const id of ids) {
|
|
12249
|
+
const info = getModelInfo(id);
|
|
12250
|
+
const meta = [info?.displayName, info?.releaseDate].filter(Boolean).join(" \xB7 ");
|
|
12251
|
+
console.log(` ${id}${meta ? ` (${meta})` : ""}`);
|
|
12252
|
+
}
|
|
12253
|
+
}
|
|
12254
|
+
}
|
|
12232
12255
|
function resolveModelOrNewest(model) {
|
|
12233
12256
|
const want = model ?? new AgentOptions().model;
|
|
12234
12257
|
const resolved = resolveModel(want);
|
|
@@ -15492,6 +15515,10 @@ async function main() {
|
|
|
15492
15515
|
console.log(HELP);
|
|
15493
15516
|
return;
|
|
15494
15517
|
}
|
|
15518
|
+
if (args.listModels) {
|
|
15519
|
+
printModels();
|
|
15520
|
+
return;
|
|
15521
|
+
}
|
|
15495
15522
|
if (args.update) {
|
|
15496
15523
|
const msg = await checkForUpdate(VERSION).catch(() => null);
|
|
15497
15524
|
if (!msg) {
|