@aidemd-mcp/server 0.2.1 → 0.2.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/cli/init/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export async function runInit(cwd, write = (line) => process.stdout.write(line +
|
|
|
23
23
|
}
|
|
24
24
|
(async () => {
|
|
25
25
|
if (process.argv.includes("--help")) {
|
|
26
|
-
process.stdout.write("Usage:
|
|
26
|
+
process.stdout.write("Usage: npx @aidemd-mcp/server init\n" +
|
|
27
27
|
"Wires the AIDE MCP server, init command, and aide-tree into the current project.\n");
|
|
28
28
|
process.exit(0);
|
|
29
29
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Check process.argv for a known subcommand and dispatch it via dynamic
|
|
4
|
+
* import. Returns true if a subcommand was handled (caller must not start
|
|
5
|
+
* the MCP server). Returns false when no subcommand matched.
|
|
6
|
+
*/
|
|
7
|
+
export declare function routeSubcommand(): Promise<boolean>;
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,18 @@ import init, { InitInput } from "./tools/init/index.js";
|
|
|
10
10
|
import applySteps from "./tools/init/applySteps/index.js";
|
|
11
11
|
import upgrade, { UpgradeInput } from "./tools/upgrade/index.js";
|
|
12
12
|
import applyFiles from "./tools/upgrade/applyFiles/index.js";
|
|
13
|
+
/**
|
|
14
|
+
* Check process.argv for a known subcommand and dispatch it via dynamic
|
|
15
|
+
* import. Returns true if a subcommand was handled (caller must not start
|
|
16
|
+
* the MCP server). Returns false when no subcommand matched.
|
|
17
|
+
*/
|
|
18
|
+
export async function routeSubcommand() {
|
|
19
|
+
if (process.argv[2] === "init") {
|
|
20
|
+
await import("./cli/init/index.js");
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
13
25
|
/** Parse --root flag from CLI args, default to cwd. */
|
|
14
26
|
function parseRoot() {
|
|
15
27
|
const args = process.argv.slice(2);
|
|
@@ -222,7 +234,11 @@ async function main() {
|
|
|
222
234
|
const transport = new StdioServerTransport();
|
|
223
235
|
await server.connect(transport);
|
|
224
236
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
237
|
+
// Route subcommands before starting the MCP server to avoid stdio conflicts.
|
|
238
|
+
// If routeSubcommand() returns true, the init IIFE handles process lifecycle.
|
|
239
|
+
if (!(await routeSubcommand())) {
|
|
240
|
+
main().catch((error) => {
|
|
241
|
+
console.error("Fatal:", error);
|
|
242
|
+
process.exit(1);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { InitStep, McpPrescription } from "../../../types/index.js";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Build the MCP server entry for the current platform.
|
|
4
|
+
*
|
|
5
|
+
* On Windows, `npx` must be invoked through `cmd /c` so that the shell can
|
|
6
|
+
* resolve the `.cmd` shim. On macOS and Linux, `npx` can be invoked directly.
|
|
7
|
+
*/
|
|
3
8
|
export declare function mcpEntry(): McpPrescription["entry"];
|
|
4
9
|
/**
|
|
5
10
|
* Inspect the project's MCP config and return a planning step for the aide
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { platform } from "node:os";
|
|
2
3
|
/** Read a file, returning empty string if it doesn't exist. */
|
|
3
4
|
async function safeReadFile(path) {
|
|
4
5
|
try {
|
|
@@ -8,9 +9,17 @@ async function safeReadFile(path) {
|
|
|
8
9
|
return "";
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Build the MCP server entry for the current platform.
|
|
14
|
+
*
|
|
15
|
+
* On Windows, `npx` must be invoked through `cmd /c` so that the shell can
|
|
16
|
+
* resolve the `.cmd` shim. On macOS and Linux, `npx` can be invoked directly.
|
|
17
|
+
*/
|
|
12
18
|
export function mcpEntry() {
|
|
13
|
-
|
|
19
|
+
if (platform() === "win32") {
|
|
20
|
+
return { command: "cmd", args: ["/c", "npx", "@aidemd-mcp/server"] };
|
|
21
|
+
}
|
|
22
|
+
return { command: "npx", args: ["@aidemd-mcp/server"] };
|
|
14
23
|
}
|
|
15
24
|
/**
|
|
16
25
|
* Inspect the project's MCP config and return a planning step for the aide
|
package/package.json
CHANGED