whygraph 0.1.1 → 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/platform/rules.js +16 -11
- package/package.json +1 -1
package/dist/platform/rules.js
CHANGED
|
@@ -59,10 +59,15 @@ function generateInstructions(config) {
|
|
|
59
59
|
"",
|
|
60
60
|
`Allowed tags: ${tagList}`,
|
|
61
61
|
"",
|
|
62
|
-
"### MCP Server",
|
|
62
|
+
"### MCP Server (preferred)",
|
|
63
63
|
"",
|
|
64
|
-
`Use the \`whygraph\` MCP server for decision capture tools.`,
|
|
65
|
-
"
|
|
64
|
+
`Use the \`whygraph\` MCP server for decision capture tools when available.`,
|
|
65
|
+
"",
|
|
66
|
+
"### Direct File Write (fallback)",
|
|
67
|
+
"",
|
|
68
|
+
"If the MCP server is unreachable or MCP is blocked by your environment,",
|
|
69
|
+
"write the decision file directly to `.whygraph/graph/` using the format above.",
|
|
70
|
+
"The file will be picked up automatically on next server start.",
|
|
66
71
|
"",
|
|
67
72
|
"### Server Status",
|
|
68
73
|
"",
|
|
@@ -89,7 +94,7 @@ function upsertMarkedSection(existing, content) {
|
|
|
89
94
|
// ============================================================
|
|
90
95
|
function registerMcpWithClaude(projectDir) {
|
|
91
96
|
try {
|
|
92
|
-
execSync("claude mcp add --scope project whygraph -- whygraph mcp", {
|
|
97
|
+
execSync("claude mcp add --scope project whygraph -- npx whygraph mcp", {
|
|
93
98
|
cwd: projectDir,
|
|
94
99
|
stdio: "ignore",
|
|
95
100
|
});
|
|
@@ -106,7 +111,7 @@ function registerMcpWithClaude(projectDir) {
|
|
|
106
111
|
}
|
|
107
112
|
const servers = (mcpJson.mcpServers ?? {});
|
|
108
113
|
if (!servers.whygraph) {
|
|
109
|
-
servers.whygraph = { type: "stdio", command: "
|
|
114
|
+
servers.whygraph = { type: "stdio", command: "npx", args: ["whygraph", "mcp"] };
|
|
110
115
|
mcpJson.mcpServers = servers;
|
|
111
116
|
writeFileSync(mcpJsonPath, JSON.stringify(mcpJson, null, 2) + "\n", "utf-8");
|
|
112
117
|
}
|
|
@@ -129,7 +134,7 @@ function registerMcpWithCursor(projectDir) {
|
|
|
129
134
|
}
|
|
130
135
|
const servers = (mcp.mcpServers ?? {});
|
|
131
136
|
if (!servers.whygraph) {
|
|
132
|
-
servers.whygraph = { command: "
|
|
137
|
+
servers.whygraph = { command: "npx", args: ["whygraph", "mcp"] };
|
|
133
138
|
mcp.mcpServers = servers;
|
|
134
139
|
writeFileSync(mcpPath, JSON.stringify(mcp, null, 2) + "\n", "utf-8");
|
|
135
140
|
}
|
|
@@ -150,7 +155,7 @@ function registerMcpWithCopilot(projectDir) {
|
|
|
150
155
|
}
|
|
151
156
|
const servers = (mcp.servers ?? {});
|
|
152
157
|
if (!servers.whygraph) {
|
|
153
|
-
servers.whygraph = { type: "stdio", command: "
|
|
158
|
+
servers.whygraph = { type: "stdio", command: "npx", args: ["whygraph", "mcp"] };
|
|
154
159
|
mcp.servers = servers;
|
|
155
160
|
writeFileSync(mcpPath, JSON.stringify(mcp, null, 2) + "\n", "utf-8");
|
|
156
161
|
}
|
|
@@ -167,16 +172,16 @@ function writeMcpSetupMd(projectDir, environment) {
|
|
|
167
172
|
const lines = ["# Whygraph MCP Setup", ""];
|
|
168
173
|
switch (environment) {
|
|
169
174
|
case "claude-code":
|
|
170
|
-
lines.push("Run the following command in your project root:", "", "```bash", "claude mcp add --scope project whygraph -- whygraph mcp", "```");
|
|
175
|
+
lines.push("Run the following command in your project root:", "", "```bash", "claude mcp add --scope project whygraph -- npx whygraph mcp", "```");
|
|
171
176
|
break;
|
|
172
177
|
case "cursor":
|
|
173
|
-
lines.push("Add the following to `.cursor/mcp.json` in your project root:", "", "```json", JSON.stringify({ mcpServers: { whygraph: { command: "
|
|
178
|
+
lines.push("Add the following to `.cursor/mcp.json` in your project root:", "", "```json", JSON.stringify({ mcpServers: { whygraph: { command: "npx", args: ["whygraph", "mcp"] } } }, null, 2), "```");
|
|
174
179
|
break;
|
|
175
180
|
case "copilot":
|
|
176
|
-
lines.push("Add the following to `.vscode/mcp.json` in your project root:", "", "```json", JSON.stringify({ servers: { whygraph: { type: "stdio", command: "
|
|
181
|
+
lines.push("Add the following to `.vscode/mcp.json` in your project root:", "", "```json", JSON.stringify({ servers: { whygraph: { type: "stdio", command: "npx", args: ["whygraph", "mcp"] } } }, null, 2), "```");
|
|
177
182
|
break;
|
|
178
183
|
default:
|
|
179
|
-
lines.push("Add the whygraph MCP server to your AI assistant's MCP configuration.", "", "**Command:** `whygraph mcp`", "**Transport:** stdio", "", "Refer to your AI assistant's documentation for how to register MCP servers.");
|
|
184
|
+
lines.push("Add the whygraph MCP server to your AI assistant's MCP configuration.", "", "**Command:** `npx whygraph mcp`", "**Transport:** stdio", "", "Refer to your AI assistant's documentation for how to register MCP servers.");
|
|
180
185
|
}
|
|
181
186
|
writeFileSync(filePath, lines.join("\n") + "\n", "utf-8");
|
|
182
187
|
return filePath;
|