agent-rev 0.2.4 → 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.
@@ -224,19 +224,18 @@ function detectModels(cliName) {
224
224
  case 'agent-rev':
225
225
  case 'agent-explorer': {
226
226
  try {
227
- const out = execSync(`${cliName} --list-models 2>/dev/null`, { encoding: 'utf-8' });
228
- const models = out.trim().split('\n').filter(Boolean);
229
- if (models.length)
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 out = execSync('opencode models 2>/dev/null', { encoding: 'utf-8' });
236
- return out.trim().split('\n').filter(Boolean);
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 ['configured'];
238
+ return ['(configure with /model after login)'];
240
239
  }
241
240
  default: return ['default'];
242
241
  }
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.error(chalk.red(` Usage: ${PKG_NAME} [--model <model>] "<task description or task-id>"`));
81
- process.exit(1);
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,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-rev",
3
- "version": "0.2.4",
4
- "description": "Reviewer agent — validates and reviews code written by the implementor",
3
+ "version": "0.2.5",
4
+ "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "files": ["dist/"],
@@ -11,7 +11,7 @@
11
11
  "dev": "tsx src/index.ts",
12
12
  "prepublishOnly": "npm run build"
13
13
  },
14
- "keywords": ["ai", "agent", "reviewer", "multi-agent", "cli", "coding"],
14
+ "keywords": ["ai","agent","multi-agent","cli","coding"],
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@anthropic-ai/sdk": "^0.39.0",