agent-rev 0.2.3 → 0.2.5
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/commands/repl.js +25 -26
- package/dist/commands/setup.js +15 -7
- package/dist/index.js +24 -3
- package/package.json +6 -12
package/dist/commands/repl.js
CHANGED
|
@@ -224,19 +224,18 @@ function detectModels(cliName) {
|
|
|
224
224
|
case 'agent-rev':
|
|
225
225
|
case 'agent-explorer': {
|
|
226
226
|
try {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return models;
|
|
227
|
+
const cfg = JSON.parse(fsSync.readFileSync(path.join(os.homedir(), `.${cliName}`, 'cli-config.json'), 'utf-8'));
|
|
228
|
+
if (cfg.coordinatorModel)
|
|
229
|
+
return [cfg.coordinatorModel];
|
|
231
230
|
}
|
|
232
231
|
catch { }
|
|
233
|
-
// fallback: list from opencode since that's typically the underlying CLI
|
|
234
232
|
try {
|
|
235
|
-
const
|
|
236
|
-
|
|
233
|
+
const cfg = JSON.parse(fsSync.readFileSync(path.join(os.homedir(), '.agent-mp', 'cli-config.json'), 'utf-8'));
|
|
234
|
+
if (cfg.coordinatorModel)
|
|
235
|
+
return [cfg.coordinatorModel];
|
|
237
236
|
}
|
|
238
237
|
catch { }
|
|
239
|
-
return ['
|
|
238
|
+
return ['(configure with /model after login)'];
|
|
240
239
|
}
|
|
241
240
|
default: return ['default'];
|
|
242
241
|
}
|
|
@@ -938,6 +937,24 @@ export async function runRepl(resumeSession) {
|
|
|
938
937
|
roles: welcomeRoles,
|
|
939
938
|
}) + '\n');
|
|
940
939
|
process.stdout.write(renderHelpHint() + '\n\n');
|
|
940
|
+
// Print coordinator header BEFORE fi.setup() so no blank lines appear between them
|
|
941
|
+
try {
|
|
942
|
+
const dir = process.cwd();
|
|
943
|
+
const config = await loadProjectConfig(dir);
|
|
944
|
+
if (config.roles?.orchestrator?.cli) {
|
|
945
|
+
process.stdout.write('\n');
|
|
946
|
+
process.stdout.write(chalk.bold.cyan('═'.repeat(46)) + '\n');
|
|
947
|
+
process.stdout.write(chalk.bold.cyan(` COORDINADOR — ${config.project}`) + '\n');
|
|
948
|
+
process.stdout.write(chalk.bold.cyan('═'.repeat(46)) + '\n');
|
|
949
|
+
process.stdout.write(chalk.blue(` → Rol: COORDINADOR (solo orquesta, nunca ejecuta)`) + '\n');
|
|
950
|
+
process.stdout.write(chalk.dim(' ' + '─'.repeat(42)) + '\n');
|
|
951
|
+
process.stdout.write(chalk.bold(` ── FASE 0 — Clarificacion ──`) + '\n');
|
|
952
|
+
process.stdout.write(chalk.dim(` → El coordinador va a conversar con vos para entender la tarea.`) + '\n');
|
|
953
|
+
process.stdout.write(chalk.dim(` → Cuando el coordinador tenga claro el objetivo, te va a pedir confirmación para lanzar el plan.`) + '\n');
|
|
954
|
+
process.stdout.write(chalk.dim(' ' + '─'.repeat(42)) + '\n');
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
catch { }
|
|
941
958
|
// Fixed-bottom input — owns the last 3 terminal rows permanently
|
|
942
959
|
const fi = new FixedInput();
|
|
943
960
|
fi.setup();
|
|
@@ -970,24 +987,6 @@ export async function runRepl(resumeSession) {
|
|
|
970
987
|
resume();
|
|
971
988
|
}
|
|
972
989
|
};
|
|
973
|
-
// Show coordinator header before the REPL loop (once, at startup)
|
|
974
|
-
try {
|
|
975
|
-
const dir = process.cwd();
|
|
976
|
-
const config = await loadProjectConfig(dir);
|
|
977
|
-
if (config.roles?.orchestrator?.cli) {
|
|
978
|
-
fi.println('');
|
|
979
|
-
fi.println(chalk.bold.cyan('═'.repeat(46)));
|
|
980
|
-
fi.println(chalk.bold.cyan(` COORDINADOR — ${config.project}`));
|
|
981
|
-
fi.println(chalk.bold.cyan('═'.repeat(46)));
|
|
982
|
-
fi.println(chalk.blue(` → Rol: COORDINADOR (solo orquesta, nunca ejecuta)`));
|
|
983
|
-
fi.println(chalk.dim(' ' + '─'.repeat(42)));
|
|
984
|
-
fi.println(chalk.bold(` ── FASE 0 — Clarificacion ──`));
|
|
985
|
-
fi.println(chalk.dim(` → El coordinador va a conversar con vos para entender la tarea.`));
|
|
986
|
-
fi.println(chalk.dim(` → Cuando el coordinador tenga claro el objetivo, te va a pedir confirmación para lanzar el plan.`));
|
|
987
|
-
fi.println(chalk.dim(' ' + '─'.repeat(42)));
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
catch { }
|
|
991
990
|
// Command handler — used by the main loop AND by the engine during mid-conversation
|
|
992
991
|
const handleCmd = async (trimmed) => {
|
|
993
992
|
const parts = trimmed.slice(1).split(/\s+/);
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as readline from 'readline';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import * as os from 'os';
|
|
3
4
|
import * as fs from 'fs/promises';
|
|
5
|
+
import * as fsSync from 'fs';
|
|
4
6
|
import chalk from 'chalk';
|
|
5
7
|
import { execSync } from 'child_process';
|
|
6
8
|
import { CLI_REGISTRY } from '../types.js';
|
|
@@ -61,19 +63,25 @@ function detectModels(cliName) {
|
|
|
61
63
|
case 'agent-impl':
|
|
62
64
|
case 'agent-rev':
|
|
63
65
|
case 'agent-explorer': {
|
|
66
|
+
// Try to read the saved coordinator model from the agent's own config
|
|
64
67
|
try {
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
const agentHome = path.join(os.homedir(), `.${cliName}`);
|
|
69
|
+
const cfgRaw = fsSync.readFileSync(path.join(agentHome, 'cli-config.json'), 'utf-8');
|
|
70
|
+
const cfg = JSON.parse(cfgRaw);
|
|
71
|
+
if (cfg.coordinatorModel)
|
|
72
|
+
return [cfg.coordinatorModel];
|
|
69
73
|
}
|
|
70
74
|
catch { }
|
|
75
|
+
// Try to read from shared agent-mp config as fallback
|
|
71
76
|
try {
|
|
72
|
-
const
|
|
73
|
-
|
|
77
|
+
const agentHome = path.join(os.homedir(), '.agent-mp');
|
|
78
|
+
const cfgRaw = fsSync.readFileSync(path.join(agentHome, 'cli-config.json'), 'utf-8');
|
|
79
|
+
const cfg = JSON.parse(cfgRaw);
|
|
80
|
+
if (cfg.coordinatorModel)
|
|
81
|
+
return [cfg.coordinatorModel];
|
|
74
82
|
}
|
|
75
83
|
catch { }
|
|
76
|
-
return ['
|
|
84
|
+
return ['(configure with /model after login)'];
|
|
77
85
|
}
|
|
78
86
|
default:
|
|
79
87
|
return ['default'];
|
package/dist/index.js
CHANGED
|
@@ -68,8 +68,26 @@ const ROLE_BINS = {
|
|
|
68
68
|
};
|
|
69
69
|
const nativeRole = ROLE_BINS[PKG_NAME];
|
|
70
70
|
if (nativeRole) {
|
|
71
|
-
// Parse --model flag if provided
|
|
72
71
|
const args = process.argv.slice(2);
|
|
72
|
+
// --login: OAuth login for this role's account
|
|
73
|
+
if (args.includes('--login') || args.includes('login')) {
|
|
74
|
+
const { qwenLogin } = await import('./utils/qwen-auth.js');
|
|
75
|
+
const ok = await qwenLogin();
|
|
76
|
+
process.exit(ok ? 0 : 1);
|
|
77
|
+
}
|
|
78
|
+
// --status: show auth status
|
|
79
|
+
if (args.includes('--status') || args.includes('status')) {
|
|
80
|
+
const { qwenAuthStatus } = await import('./utils/qwen-auth.js');
|
|
81
|
+
const status = await qwenAuthStatus();
|
|
82
|
+
if (status.authenticated) {
|
|
83
|
+
console.log(chalk.green(` ✓ ${PKG_NAME}: authenticated`));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log(chalk.yellow(` ✗ ${PKG_NAME}: not authenticated — run: ${PKG_NAME} --login`));
|
|
87
|
+
}
|
|
88
|
+
process.exit(0);
|
|
89
|
+
}
|
|
90
|
+
// Parse --model flag if provided
|
|
73
91
|
const modelIdx = args.findIndex(a => a === '--model' || a === '-m');
|
|
74
92
|
let model;
|
|
75
93
|
if (modelIdx !== -1 && args[modelIdx + 1]) {
|
|
@@ -77,8 +95,11 @@ if (nativeRole) {
|
|
|
77
95
|
}
|
|
78
96
|
const taskArg = args.filter((a, i) => !a.startsWith('-') && i !== modelIdx + 1).join(' ').trim();
|
|
79
97
|
if (!taskArg) {
|
|
80
|
-
console.
|
|
81
|
-
|
|
98
|
+
console.log(chalk.bold.cyan(`\n ${PKG_NAME} — ${nativeRole} agent\n`));
|
|
99
|
+
console.log(chalk.dim(` Usage: ${PKG_NAME} [--model <model>] "<task>"`));
|
|
100
|
+
console.log(chalk.dim(` Login: ${PKG_NAME} --login`));
|
|
101
|
+
console.log(chalk.dim(` Status: ${PKG_NAME} --status\n`));
|
|
102
|
+
process.exit(0);
|
|
82
103
|
}
|
|
83
104
|
await runRole(nativeRole, taskArg, model);
|
|
84
105
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-rev",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
|
-
"files": [
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
"bin": {
|
|
11
|
-
"agent-rev": "dist/index.js"
|
|
12
|
-
},
|
|
7
|
+
"files": ["dist/"],
|
|
8
|
+
"bin": { "agent-rev": "dist/index.js" },
|
|
13
9
|
"scripts": {
|
|
14
10
|
"build": "tsc && echo '#!/usr/bin/env node' | cat - dist/index.js > dist/index.tmp && mv dist/index.tmp dist/index.js && chmod +x dist/index.js",
|
|
15
11
|
"dev": "tsx src/index.ts",
|
|
16
12
|
"prepublishOnly": "npm run build"
|
|
17
13
|
},
|
|
18
|
-
"keywords": ["ai",
|
|
14
|
+
"keywords": ["ai","agent","multi-agent","cli","coding"],
|
|
19
15
|
"license": "MIT",
|
|
20
16
|
"dependencies": {
|
|
21
17
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
@@ -31,7 +27,5 @@
|
|
|
31
27
|
"tsx": "^4.19.3",
|
|
32
28
|
"typescript": "^5.7.3"
|
|
33
29
|
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=18.0.0"
|
|
36
|
-
}
|
|
30
|
+
"engines": { "node": ">=18.0.0" }
|
|
37
31
|
}
|