agent-mp 0.5.37 → 0.5.38

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.
@@ -1,5 +1,7 @@
1
+ import * as readline from 'readline';
1
2
  import { CliInfo } from '../types.js';
2
3
  import { Session } from '../utils/sessions.js';
4
+ export declare function cmdLogin(rl: readline.Interface): Promise<boolean>;
3
5
  /**
4
6
  * Shared coordinator setup: detect CLIs, pick coordinator, check auth.
5
7
  * Returns { coordinatorCmd, activeCli, installed, rl } or null if setup failed.
@@ -382,7 +382,7 @@ async function promptDeepseekKeySetup(rl, askFn) {
382
382
  console.log(chalk.green(`\n ✓ DeepSeek API key guardada — ${chosenModel}\n`));
383
383
  return true;
384
384
  }
385
- async function cmdLogin(rl) {
385
+ export async function cmdLogin(rl) {
386
386
  console.log(chalk.bold.cyan('\n Configure API Key\n'));
387
387
  console.log(chalk.bold(' Proveedor:'));
388
388
  console.log(chalk.dim(' 1. Qwen / OpenAI-compatible'));
package/dist/index.js CHANGED
@@ -100,32 +100,14 @@ if (nativeRole) {
100
100
  console.log(chalk.dim(` Version: ${PKG_NAME} --version\n`));
101
101
  process.exit(0);
102
102
  }
103
- // --login: configure API key for this role
103
+ // --login: multi-provider login (Qwen / Gemini / DeepSeek), same as agent-mp /login
104
104
  if (args.includes('--login') || args.includes('login')) {
105
- const { saveApiKeyConfig, loadApiKeyConfig, DEFAULT_API_BASE_URL } = await import('./utils/qwen-auth.js');
105
+ const { cmdLogin } = await import('./commands/repl.js');
106
106
  const rl = (await import('readline')).createInterface({ input: process.stdin, output: process.stdout });
107
- const ask = (q) => new Promise((res) => rl.question(q, res));
108
- const existing = await loadApiKeyConfig();
109
- console.log(chalk.bold.cyan(`\n ${PKG_NAME} — API Key Setup\n`));
110
- if (existing) {
111
- console.log(chalk.dim(` Current: ${existing.provider} / ${existing.model}`));
112
- }
113
- const apiKey = await ask(` API Key${existing ? ' [Enter to keep]' : ''}: `);
114
- const model = await ask(` Model [${existing?.model ?? 'qwen-plus'}]: `);
107
+ console.log(chalk.bold.cyan(`\n ${PKG_NAME} Login\n`));
108
+ const ok = await cmdLogin(rl);
115
109
  rl.close();
116
- const cfg = {
117
- provider: existing?.provider ?? 'openai-compatible',
118
- api_key: apiKey.trim() || existing?.api_key || '',
119
- base_url: DEFAULT_API_BASE_URL,
120
- model: model.trim() || existing?.model || 'qwen-plus',
121
- };
122
- if (!cfg.api_key) {
123
- console.log(chalk.red(' API key is required.'));
124
- process.exit(1);
125
- }
126
- await saveApiKeyConfig(cfg);
127
- console.log(chalk.green(`\n ✓ API key saved — ${cfg.provider} / ${cfg.model}\n`));
128
- process.exit(0);
110
+ process.exit(ok ? 0 : 1);
129
111
  }
130
112
  // --status: show auth status
131
113
  if (args.includes('--status') || args.includes('status')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.5.37",
3
+ "version": "0.5.38",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",