@dyyz1993/pi-coding-agent 0.74.5 → 0.74.7

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.
@@ -172,6 +172,10 @@ export class AgentSession {
172
172
  }
173
173
  }
174
174
  _initMcpServers() {
175
+ if (this._mcpManager) {
176
+ this._mcpManager.dispose().catch(() => { });
177
+ this._mcpManager = undefined;
178
+ }
175
179
  const settings = this.settingsManager.getMergedSettings();
176
180
  const servers = settings?.mcp?.servers;
177
181
  if (!servers || Object.keys(servers).length === 0)
@@ -566,6 +570,20 @@ export class AgentSession {
566
570
  this._eventListeners = [];
567
571
  cleanupSessionResources(this.sessionId);
568
572
  }
573
+ getMcpConnections() {
574
+ if (!this._mcpManager)
575
+ return [];
576
+ return this._mcpManager.getConnections().map((c) => ({
577
+ name: c.name,
578
+ status: c.status,
579
+ error: c.error,
580
+ tools: c.tools.map((t) => ({
581
+ originalName: t.originalName,
582
+ fullName: t.fullName,
583
+ description: t.description,
584
+ })),
585
+ }));
586
+ }
569
587
  // =========================================================================
570
588
  // Read-only State Access
571
589
  // =========================================================================