pi-soly 1.11.0 → 1.11.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.
- package/index.ts +13 -0
- package/mcp/init.ts +34 -7
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -746,4 +746,17 @@ export default function solyExtension(pi: ExtensionAPI) {
|
|
|
746
746
|
|
|
747
747
|
// Mount built-in sub-features
|
|
748
748
|
piAskExtension(pi);
|
|
749
|
+
|
|
750
|
+
// MCP adapter (was: separate pi-mcp-adapter plugin by nicobailon).
|
|
751
|
+
// Bundled into pi-soly as of v1.11.0 with UE5 session-retry fix + framed
|
|
752
|
+
// notifications + compact per-server status footer.
|
|
753
|
+
// We import dynamically because mcp/ has heavy deps (modelcontextprotocol/sdk)
|
|
754
|
+
// and we want soly to still load if MCP fails for any reason.
|
|
755
|
+
void import("./mcp/index.ts").then((m) => {
|
|
756
|
+
try {
|
|
757
|
+
m.default(pi);
|
|
758
|
+
} catch (err) {
|
|
759
|
+
console.error("[soly] MCP adapter failed to initialize:", err);
|
|
760
|
+
}
|
|
761
|
+
});
|
|
749
762
|
}
|
package/mcp/init.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI, ExtensionContext, ExtensionUIContext } from "@earendil-works/pi-coding-agent";
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext, ExtensionUIContext, ThemeColor } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { McpExtensionState } from "./state.ts";
|
|
3
3
|
import type { ToolMetadata } from "./types.ts";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
@@ -139,7 +139,7 @@ export async function initializeMcp(
|
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
if (ctx.hasUI && startupServers.length > 0) {
|
|
142
|
-
ctx.ui.setStatus("mcp", `
|
|
142
|
+
ctx.ui.setStatus("mcp", `connecting ${startupServers.length} server${startupServers.length === 1 ? "" : "s"}…`);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
const results = await parallelLimit(startupServers, 10, async ([name, definition]) => {
|
|
@@ -295,13 +295,40 @@ export function flushMetadataCache(state: McpExtensionState): void {
|
|
|
295
295
|
export function updateStatusBar(state: McpExtensionState): void {
|
|
296
296
|
const ui = state.ui;
|
|
297
297
|
if (!ui) return;
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
298
|
+
const serverNames = Object.keys(state.config.mcpServers);
|
|
299
|
+
if (serverNames.length === 0) {
|
|
300
300
|
ui.setStatus("mcp", undefined);
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
// Build compact per-server list: "unreal ✓ · github ✗"
|
|
304
|
+
// Status icon reflects current state:
|
|
305
|
+
// ✓ connected
|
|
306
|
+
// ✗ failed (in failureTracker, with active backoff)
|
|
307
|
+
// ⚠ needs-auth (OAuth)
|
|
308
|
+
// ○ not connected / closed
|
|
309
|
+
const theme = ui.theme;
|
|
310
|
+
const fg = (color: ThemeColor, text: string): string => theme.fg(color, text);
|
|
311
|
+
const parts: string[] = [];
|
|
312
|
+
for (const name of serverNames) {
|
|
313
|
+
const connection = state.manager.getConnection(name);
|
|
314
|
+
let icon: string;
|
|
315
|
+
let color: ThemeColor;
|
|
316
|
+
if (connection?.status === "connected") {
|
|
317
|
+
icon = "✓";
|
|
318
|
+
color = "success";
|
|
319
|
+
} else if (connection?.status === "needs-auth") {
|
|
320
|
+
icon = "⚠";
|
|
321
|
+
color = "warning";
|
|
322
|
+
} else if (state.failureTracker.has(name)) {
|
|
323
|
+
icon = "✗";
|
|
324
|
+
color = "error";
|
|
325
|
+
} else {
|
|
326
|
+
icon = "○";
|
|
327
|
+
color = "dim";
|
|
328
|
+
}
|
|
329
|
+
parts.push(`${name} ${fg(color, icon)}`);
|
|
330
|
+
}
|
|
331
|
+
ui.setStatus("mcp", parts.join(" · "));
|
|
305
332
|
}
|
|
306
333
|
|
|
307
334
|
export function getFailureAgeSeconds(state: McpExtensionState, serverName: string): number | null {
|
|
@@ -330,7 +357,7 @@ export async function lazyConnect(state: McpExtensionState, serverName: string):
|
|
|
330
357
|
|
|
331
358
|
try {
|
|
332
359
|
if (state.ui) {
|
|
333
|
-
state.ui.setStatus("mcp", `
|
|
360
|
+
state.ui.setStatus("mcp", `connecting ${serverName}…`);
|
|
334
361
|
}
|
|
335
362
|
const newConnection = await state.manager.connect(serverName, definition);
|
|
336
363
|
if (newConnection.status === "needs-auth") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-soly",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "Project management + workflow engine for pi-coding-agent. Plans, state, MANDATORY rules, multi-question picker — one npm install, zero config. LLM is the executor (no subagent layer).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|