my-pi 0.1.6 → 0.1.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.
|
@@ -3460,6 +3460,14 @@ function format_server_status(state) {
|
|
|
3460
3460
|
function count_pending_enabled_servers(servers) {
|
|
3461
3461
|
return Array.from(servers.values()).filter((state) => state.enabled && state.status !== "connected").length;
|
|
3462
3462
|
}
|
|
3463
|
+
function report_mcp_failure(state, ctx) {
|
|
3464
|
+
const message = `MCP server failed (${state.config.name}): ${state.error}`;
|
|
3465
|
+
if (ctx?.hasUI) {
|
|
3466
|
+
ctx.ui.notify(message, "warning");
|
|
3467
|
+
return;
|
|
3468
|
+
}
|
|
3469
|
+
console.error(message);
|
|
3470
|
+
}
|
|
3463
3471
|
function update_mcp_status(ctx, servers) {
|
|
3464
3472
|
if (!ctx.hasUI) return;
|
|
3465
3473
|
if (servers.size === 0) {
|
|
@@ -3557,7 +3565,7 @@ async function mcp(pi) {
|
|
|
3557
3565
|
state.error = error instanceof Error ? error.message : String(error);
|
|
3558
3566
|
state.client = void 0;
|
|
3559
3567
|
await client.disconnect().catch(() => {});
|
|
3560
|
-
|
|
3568
|
+
report_mcp_failure(state, ctx);
|
|
3561
3569
|
throw error;
|
|
3562
3570
|
} finally {
|
|
3563
3571
|
state.connect_promise = void 0;
|
|
@@ -5432,4 +5440,4 @@ async function create_my_pi(options = {}) {
|
|
|
5432
5440
|
//#endregion
|
|
5433
5441
|
export { runPrintMode$1 as i, create_my_pi as n, get_force_disabled_builtins as r, InteractiveMode$1 as t };
|
|
5434
5442
|
|
|
5435
|
-
//# sourceMappingURL=api-
|
|
5443
|
+
//# sourceMappingURL=api-DrJVpmLQ.js.map
|