@versot/vaguspi 0.1.0 → 0.1.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/dist/bin.js +5 -1
- package/dist/bin.js.map +2 -2
- package/extensions/mcp-extension.js +9 -21
- package/package.json +9 -2
|
@@ -12,8 +12,6 @@ const connecting = new Map();
|
|
|
12
12
|
function serverKey(server) {
|
|
13
13
|
return server.config.cwd ? `${server.name}@${server.config.cwd}` : server.name;
|
|
14
14
|
}
|
|
15
|
-
/** Names known to provide MCP tool registration in a pi session. */
|
|
16
|
-
const KNOWN_MCP_ADAPTER_HINTS = ["mcp-adapter", "pi-mcp", "mcp_server"];
|
|
17
15
|
/** Read { mcpServers: {...} } from a JSON file (missing/corrupt → {}). */
|
|
18
16
|
function readMcpFile(path) {
|
|
19
17
|
try {
|
|
@@ -32,18 +30,8 @@ function loadServers(agentDir, cwd) {
|
|
|
32
30
|
const user = readMcpFile(join(agentDir, "mcp.json"));
|
|
33
31
|
const project = readMcpFile(join(cwd, ".mcp.json"));
|
|
34
32
|
// Normalize: accept BOTH the flat `{ name: config }` shape AND the
|
|
35
|
-
// Claude-style `{ "mcpServers": { name: config } }` wrapper.
|
|
36
|
-
|
|
37
|
-
const normalize = (raw) => {
|
|
38
|
-
if (raw && typeof raw === "object" && "mcpServers" in raw) {
|
|
39
|
-
const wrapped = raw.mcpServers;
|
|
40
|
-
if (wrapped && typeof wrapped === "object" && !Array.isArray(wrapped)) {
|
|
41
|
-
return wrapped;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return raw;
|
|
45
|
-
};
|
|
46
|
-
const merged = { ...normalize(user), ...normalize(project) };
|
|
33
|
+
// Claude-style `{ "mcpServers": { name: config } }` wrapper.
|
|
34
|
+
const merged = { ...normalizeConfigShape(user), ...normalizeConfigShape(project) };
|
|
47
35
|
return Object.entries(merged)
|
|
48
36
|
.map(([name, cfg]) => ({
|
|
49
37
|
name,
|
|
@@ -54,14 +42,14 @@ function loadServers(agentDir, cwd) {
|
|
|
54
42
|
.filter((s) => s.config.enabled !== false);
|
|
55
43
|
}
|
|
56
44
|
/** Best-effort check for another extension that already provides MCP tools. */
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return false;
|
|
45
|
+
function normalizeConfigShape(raw) {
|
|
46
|
+
if (raw && typeof raw === "object" && "mcpServers" in raw) {
|
|
47
|
+
const wrapped = raw.mcpServers;
|
|
48
|
+
if (wrapped && typeof wrapped === "object" && !Array.isArray(wrapped)) {
|
|
49
|
+
return wrapped;
|
|
50
|
+
}
|
|
64
51
|
}
|
|
52
|
+
return raw;
|
|
65
53
|
}
|
|
66
54
|
/** Convert an MCP JSON Schema to a TypeBox schema. Falls back to Type.Any(). */
|
|
67
55
|
function toTypeBoxSchema(inputSchema) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versot/vaguspi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "pi-web — a web frontend for the pi coding agent. Launch the full chat UI in your browser with one command.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi",
|
|
7
|
+
"pi-web",
|
|
8
|
+
"pi-package",
|
|
9
|
+
"gui",
|
|
10
|
+
"web-ui",
|
|
11
|
+
"mcp"
|
|
12
|
+
],
|
|
6
13
|
"type": "module",
|
|
7
14
|
"license": "MIT",
|
|
8
15
|
"bin": {
|