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.
- package/dist/commands/repl.d.ts +2 -0
- package/dist/commands/repl.js +1 -1
- package/dist/index.js +5 -23
- package/package.json +1 -1
package/dist/commands/repl.d.ts
CHANGED
|
@@ -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.
|
package/dist/commands/repl.js
CHANGED
|
@@ -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:
|
|
103
|
+
// --login: multi-provider login (Qwen / Gemini / DeepSeek), same as agent-mp /login
|
|
104
104
|
if (args.includes('--login') || args.includes('login')) {
|
|
105
|
-
const {
|
|
105
|
+
const { cmdLogin } = await import('./commands/repl.js');
|
|
106
106
|
const rl = (await import('readline')).createInterface({ input: process.stdin, output: process.stdout });
|
|
107
|
-
|
|
108
|
-
const
|
|
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
|
-
|
|
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')) {
|