agent-mp 0.5.41 → 0.5.43

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.
@@ -12,7 +12,7 @@ import { log } from '../utils/logger.js';
12
12
  import { AgentEngine, ExitError } from '../core/engine.js';
13
13
  import { qwenAuthStatus, QWEN_AGENT_HOME, fetchQwenModels, loadApiKeyConfig, saveApiKeyConfig, fetchApiKeyModels, DEFAULT_API_BASE_URL } from '../utils/qwen-auth.js';
14
14
  import { loadGeminiApiKey, saveGeminiApiKey, geminiAuthStatus, deleteGeminiApiKey, GEMINI_MODELS, fetchGeminiModels } from '../utils/gemini.js';
15
- import { loadDeepSeekApiKey, saveDeepSeekApiKey, deleteDeepSeekApiKey, fetchDeepSeekModels } from '../utils/deepseek.js';
15
+ import { loadDeepSeekApiKey, saveDeepSeekApiKey, deleteDeepSeekApiKey, fetchDeepSeekModels, DEEPSEEK_DEFAULT_MODELS } from '../utils/deepseek.js';
16
16
  import { renderWelcomePanel, renderHelpHint, renderSectionBox, renderMultiSectionBox } from '../ui/theme.js';
17
17
  import { FixedInput } from '../ui/input.js';
18
18
  import { newSession, saveSession } from '../utils/sessions.js';
@@ -416,10 +416,16 @@ async function promptDeepseekKeySetup(rl, askFn) {
416
416
  }
417
417
  }
418
418
  else {
419
- console.log(chalk.yellow(' No se pudieron cargar modelos de la API.'));
420
- const pick = await askFn(` Escribí el nombre del modelo [${chosenModel}]: `);
421
- if (pick.trim())
419
+ console.log(chalk.yellow(' No se pudieron cargar modelos de la API — usando defaults.'));
420
+ DEEPSEEK_DEFAULT_MODELS.forEach((m, i) => console.log(chalk.dim(` ${i + 1}. ${m}`)));
421
+ const pick = await askFn(` Modelo [${chosenModel}]: `);
422
+ const num = parseInt(pick.trim());
423
+ if (!isNaN(num) && num >= 1 && num <= DEEPSEEK_DEFAULT_MODELS.length) {
424
+ chosenModel = DEEPSEEK_DEFAULT_MODELS[num - 1];
425
+ }
426
+ else if (pick.trim()) {
422
427
  chosenModel = pick.trim();
428
+ }
423
429
  }
424
430
  await saveDeepSeekApiKey({ api_key: resolvedKey, model: chosenModel });
425
431
  console.log(chalk.green(`\n ✓ DeepSeek API key guardada — ${chosenModel}\n`));
@@ -803,6 +809,8 @@ async function cmdModels(roleArg, fi, rl) {
803
809
  else if (isDeepSeekActive || activeProvider === 'deepseek') {
804
810
  console.log(chalk.dim(' Fetching DeepSeek models...'));
805
811
  models = await fetchDeepSeekModels(deepseekCfg);
812
+ if (!models.length)
813
+ models = DEEPSEEK_DEFAULT_MODELS;
806
814
  }
807
815
  else if (activeProvider === 'qwen') {
808
816
  console.log(chalk.dim(' Fetching Qwen models...'));
@@ -351,6 +351,8 @@ export class AgentEngine {
351
351
  const t0 = Date.now();
352
352
  const fi = this.fi;
353
353
  let streaming = false;
354
+ let statusLine = '';
355
+ let buf = '';
354
356
  fi.startActivity(`${frames[0]} ${label} 0s`);
355
357
  fi.setActivityLines([` ${dotFrames[0]} esperando respuesta...`]);
356
358
  const iv = setInterval(() => {
@@ -360,10 +362,34 @@ export class AgentEngine {
360
362
  if (!streaming) {
361
363
  fi.setActivityLines([` ${dotFrames[ti % dotFrames.length]} esperando respuesta...`]);
362
364
  }
365
+ else if (statusLine) {
366
+ fi.setActivityLines([statusLine]);
367
+ }
363
368
  }, 300);
364
369
  return {
365
370
  stop() { clearInterval(iv); fi.stopActivity(); },
366
- push(_chunk) { streaming = true; },
371
+ push(chunk) {
372
+ streaming = true;
373
+ buf += chunk;
374
+ // Detect === file.md === markers — show which file is being written
375
+ const markers = [...buf.matchAll(/===\s*([\w./\-]+\.md)\s*===/g)];
376
+ if (markers.length > 0) {
377
+ statusLine = ` → ${markers[markers.length - 1][1]}`;
378
+ }
379
+ else {
380
+ // Show last meaningful line of the streamed text
381
+ const lines = buf.split('\n');
382
+ for (let j = lines.length - 1; j >= 0; j--) {
383
+ const l = lines[j].trim();
384
+ if (l.length > 3 && !l.startsWith('```') && !l.startsWith('|---') && !l.startsWith('#')) {
385
+ statusLine = ` ${l.slice(0, 72)}`;
386
+ break;
387
+ }
388
+ }
389
+ }
390
+ if (buf.length > 6000)
391
+ buf = buf.slice(-3000);
392
+ },
367
393
  };
368
394
  }
369
395
  /** Extract readable text lines from a qwen/CLI streaming chunk. */
@@ -10,4 +10,5 @@ export declare function deepseekAuthStatus(): Promise<{
10
10
  model?: string;
11
11
  }>;
12
12
  export declare function callDeepSeekAPI(prompt: string, model?: string, onData?: (chunk: string) => void): Promise<string>;
13
+ export declare const DEEPSEEK_DEFAULT_MODELS: string[];
13
14
  export declare function fetchDeepSeekModels(cfg?: DeepSeekKeyConfig | null): Promise<string[]>;
@@ -94,6 +94,7 @@ export async function callDeepSeekAPI(prompt, model = 'deepseek-chat', onData) {
94
94
  }
95
95
  throw lastErr;
96
96
  }
97
+ export const DEEPSEEK_DEFAULT_MODELS = ['deepseek-chat', 'deepseek-reasoner'];
97
98
  export async function fetchDeepSeekModels(cfg) {
98
99
  const resolved = cfg ?? await loadDeepSeekApiKey();
99
100
  if (!resolved?.api_key)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-mp",
3
- "version": "0.5.41",
3
+ "version": "0.5.43",
4
4
  "description": "Deterministic multi-agent CLI orchestrator — plan, code, review",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",