@fanchaozz/provider-manager 0.2.1 → 0.2.2

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.
Files changed (3) hide show
  1. package/commands.ts +6 -4
  2. package/package.json +1 -1
  3. package/ui.ts +5 -3
package/commands.ts CHANGED
@@ -259,7 +259,8 @@ async function testCommand(ctx: ExtensionCommandContext, arg: string): Promise<v
259
259
  }
260
260
 
261
261
  const result = await testModel({ ctx: ctx as any, provider, model, mode: "full" });
262
- ctx.ui.notify(formatTestResult(result), result.ok ? "info" : "warning");
262
+ // 同步 dashboard:测试结果统一 info(showStatus 可覆盖),失败语义靠文本 ✗ fail 前缀表达
263
+ ctx.ui.notify(formatTestResult(result), "info");
263
264
  }
264
265
 
265
266
  /** 批量测某 provider 全部 model;无参数时取第一个 provider。 */
@@ -295,7 +296,8 @@ async function testAllCommand(ctx: ExtensionCommandContext, providerId: string |
295
296
  mode: "full",
296
297
  concurrency: 3,
297
298
  });
298
- for (const r of results) {
299
- ctx.ui.notify(formatTestResult(r), r.ok ? "info" : "warning");
300
- }
299
+ // 批量结果拼成一条 notify:逐条 notify 会被 showStatus 原地覆盖,只残留最后一条
300
+ const okCount = results.filter((r) => r.ok).length;
301
+ const summary = results.map((r) => formatTestResult(r)).join("\n\n") + `\n${provider}: ${okCount}/${results.length} ok`;
302
+ ctx.ui.notify(summary, "info");
301
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanchaozz/provider-manager",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A pi extension that manages custom providers and models in ~/.pi/agent/models.json via a TUI dashboard, /providers slash command, and remote model sync.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/ui.ts CHANGED
@@ -416,9 +416,10 @@ class Dashboard {
416
416
  let okCount = 0;
417
417
  for (const r of results) {
418
418
  if (r.ok) okCount++;
419
- ctx.ui.notify(formatTestResult(r), r.ok ? "info" : "warning");
420
419
  }
421
- ctx.ui.notify(`${provider.id}: ${okCount}/${results.length} ok`, okCount === results.length ? "success" : "warning");
420
+ // 批量结果拼成一条 notify:逐条 notify 会被 showStatus 原地覆盖,只残留汇总行
421
+ const summary = results.map((r) => formatTestResult(r)).join("\n\n") + `\n${provider.id}: ${okCount}/${results.length} ok`;
422
+ ctx.ui.notify(summary, "info");
422
423
  } else {
423
424
  // t: 测当前 pane 的 model(provider pane 测第一个 model;model pane 测当前 model)
424
425
  let modelId: string | undefined;
@@ -430,7 +431,8 @@ class Dashboard {
430
431
  if (!modelId) { ctx.ui.notify(`${provider.id} 无 model`, "warning"); return; }
431
432
  ctx.ui.notify(`testing ${provider.id}/${modelId}...`, "info");
432
433
  const r = await testModel({ ctx, provider: provider.id, model: modelId, mode: "full" });
433
- ctx.ui.notify(formatTestResult(r), r.ok ? "success" : "warning");
434
+ // 同上:统一 info 避免滞留
435
+ ctx.ui.notify(formatTestResult(r), "info");
434
436
  }
435
437
  this.invalidate();
436
438
  }