@aidemd-mcp/server 0.2.0 → 0.2.1
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/.aide/bin/aide-tree.mjs +8 -0
- package/dist/cli/init/index.js +9 -3
- package/dist/cli/init/writeAideTree/index.d.ts +13 -0
- package/dist/cli/init/writeAideTree/index.js +25 -0
- package/dist/tools/init/index.js +3 -0
- package/dist/tools/init/initContent/index.d.ts +1 -0
- package/dist/tools/init/initContent/index.js +1 -0
- package/dist/tools/init/installAideTree/index.d.ts +11 -0
- package/dist/tools/init/installAideTree/index.js +59 -0
- package/dist/tools/init/wireMcp/index.d.ts +1 -1
- package/dist/tools/init/wireMcp/index.js +2 -6
- package/package.json +3 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { join, dirname } from "node:path";
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const cliPath = join(dirname(require.resolve("@aidemd-mcp/server")), "cli", "index.js");
|
|
8
|
+
execFileSync("node", [cliPath, ...process.argv.slice(2)], { stdio: "inherit" });
|
package/dist/cli/init/index.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import writeMcpEntry from "./writeMcpEntry/index.js";
|
|
3
3
|
import writeInitCommand from "./writeInitCommand/index.js";
|
|
4
|
+
import writeAideTree from "./writeAideTree/index.js";
|
|
4
5
|
const MCP_LABEL = ".mcp.json";
|
|
5
6
|
const CMD_LABEL = ".claude/commands/aide/init.md";
|
|
7
|
+
const TREE_LABEL = ".aide/bin/aide-tree.mjs";
|
|
6
8
|
export async function runInit(cwd, write = (line) => process.stdout.write(line + "\n")) {
|
|
7
9
|
const mcpResult = await writeMcpEntry(cwd);
|
|
8
10
|
const cmdResult = await writeInitCommand(cwd);
|
|
11
|
+
const treeResult = await writeAideTree(cwd);
|
|
9
12
|
write(`[${mcpResult.status}] ${MCP_LABEL} — ${mcpResult.message}`);
|
|
10
13
|
write(`[${cmdResult.status}] ${CMD_LABEL} — ${cmdResult.message}`);
|
|
11
|
-
|
|
14
|
+
write(`[${treeResult.status}] ${TREE_LABEL} — ${treeResult.message}`);
|
|
15
|
+
if (mcpResult.status === "exists" &&
|
|
16
|
+
cmdResult.status === "exists" &&
|
|
17
|
+
treeResult.status === "exists") {
|
|
12
18
|
write("Already set up. Run /aide:init in Claude Code to continue.");
|
|
13
19
|
return 0;
|
|
14
20
|
}
|
|
@@ -17,8 +23,8 @@ export async function runInit(cwd, write = (line) => process.stdout.write(line +
|
|
|
17
23
|
}
|
|
18
24
|
(async () => {
|
|
19
25
|
if (process.argv.includes("--help")) {
|
|
20
|
-
process.stdout.write("Usage:
|
|
21
|
-
"Wires the AIDE MCP server
|
|
26
|
+
process.stdout.write("Usage: node dist/cli/init/index.js\n" +
|
|
27
|
+
"Wires the AIDE MCP server, init command, and aide-tree into the current project.\n");
|
|
22
28
|
process.exit(0);
|
|
23
29
|
}
|
|
24
30
|
try {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface WriteAideTreeResult {
|
|
2
|
+
status: "created" | "exists";
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Write the `.aide/bin/aide-tree.mjs` launcher script to the host project.
|
|
7
|
+
*
|
|
8
|
+
* Target path is `<projectRoot>/.aide/bin/aide-tree.mjs`. Returns `exists`
|
|
9
|
+
* when the file is already present on disk. Otherwise creates the full parent
|
|
10
|
+
* directory tree, reads the canonical content via `readCanonicalDoc`, writes
|
|
11
|
+
* the file, and returns `created`.
|
|
12
|
+
*/
|
|
13
|
+
export default function writeAideTree(projectRoot: string): Promise<WriteAideTreeResult>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { access, mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { readCanonicalDoc } from "../../../tools/init/initContent/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Write the `.aide/bin/aide-tree.mjs` launcher script to the host project.
|
|
6
|
+
*
|
|
7
|
+
* Target path is `<projectRoot>/.aide/bin/aide-tree.mjs`. Returns `exists`
|
|
8
|
+
* when the file is already present on disk. Otherwise creates the full parent
|
|
9
|
+
* directory tree, reads the canonical content via `readCanonicalDoc`, writes
|
|
10
|
+
* the file, and returns `created`.
|
|
11
|
+
*/
|
|
12
|
+
export default async function writeAideTree(projectRoot) {
|
|
13
|
+
const launcherPath = join(projectRoot, ".aide", "bin", "aide-tree.mjs");
|
|
14
|
+
try {
|
|
15
|
+
await access(launcherPath);
|
|
16
|
+
return { status: "exists", message: "aide-tree launcher already present" };
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// ENOENT — file does not exist, proceed to create
|
|
20
|
+
}
|
|
21
|
+
await mkdir(dirname(launcherPath), { recursive: true });
|
|
22
|
+
const content = readCanonicalDoc("bin/aide-tree");
|
|
23
|
+
await writeFile(launcherPath, content, "utf-8");
|
|
24
|
+
return { status: "created", message: "aide-tree launcher" };
|
|
25
|
+
}
|
package/dist/tools/init/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import installMethodologyDocs from "./installMethodologyDocs/index.js";
|
|
|
9
9
|
import scaffoldCommands from "./scaffoldCommands/index.js";
|
|
10
10
|
import installAgents from "./installAgents/index.js";
|
|
11
11
|
import installSkills from "./installSkills/index.js";
|
|
12
|
+
import installAideTree from "./installAideTree/index.js";
|
|
12
13
|
import wireMcp from "./wireMcp/index.js";
|
|
13
14
|
import provisionBrain from "./provisionBrain/index.js";
|
|
14
15
|
/**
|
|
@@ -55,6 +56,7 @@ export default async function init(root, framework, path, brainPath) {
|
|
|
55
56
|
const commandSteps = await scaffoldCommands(join(projectRoot, config.commandDir));
|
|
56
57
|
const agentSteps = await installAgents(join(projectRoot, config.agentDir));
|
|
57
58
|
const skillSteps = await installSkills(join(projectRoot, config.skillDir));
|
|
59
|
+
const aideTreeSteps = await installAideTree(projectRoot);
|
|
58
60
|
const mcpStep = await wireMcp(join(projectRoot, config.mcpConfigPath));
|
|
59
61
|
// Brain steps require a confirmed vault path. When brainPath is explicitly
|
|
60
62
|
// provided (agent-confirmed), use it directly. When hints exist, use the
|
|
@@ -86,6 +88,7 @@ export default async function init(root, framework, path, brainPath) {
|
|
|
86
88
|
...commandSteps,
|
|
87
89
|
...agentSteps,
|
|
88
90
|
...skillSteps,
|
|
91
|
+
...aideTreeSteps,
|
|
89
92
|
mcpStep,
|
|
90
93
|
...brainSteps,
|
|
91
94
|
zedStep,
|
|
@@ -37,6 +37,7 @@ declare const DOC_PATHS: {
|
|
|
37
37
|
readonly "cascading-alignment": ".aide/docs/cascading-alignment.md";
|
|
38
38
|
readonly "skills/study-playbook": ".claude/skills/study-playbook/SKILL.md";
|
|
39
39
|
readonly "skills/brain": ".claude/skills/brain/SKILL.md";
|
|
40
|
+
readonly "bin/aide-tree": ".aide/bin/aide-tree.mjs";
|
|
40
41
|
};
|
|
41
42
|
export type CanonicalDocName = keyof typeof DOC_PATHS;
|
|
42
43
|
/**
|
|
@@ -61,6 +61,7 @@ const DOC_PATHS = {
|
|
|
61
61
|
"cascading-alignment": ".aide/docs/cascading-alignment.md",
|
|
62
62
|
"skills/study-playbook": ".claude/skills/study-playbook/SKILL.md",
|
|
63
63
|
"skills/brain": ".claude/skills/brain/SKILL.md",
|
|
64
|
+
"bin/aide-tree": ".aide/bin/aide-tree.mjs",
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
67
|
* The canonical list of methodology docs that ship into the host-side doc
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InitStep } from "../../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Return a planning step for the aide-tree launcher script.
|
|
4
|
+
*
|
|
5
|
+
* Checks whether `.aide/bin/aide-tree.mjs` already exists under `projectRoot`.
|
|
6
|
+
* Returns `exists` if the file is present, `would-create` with the canonical
|
|
7
|
+
* script content if it is absent. A failing canonical read returns `would-skip`.
|
|
8
|
+
*
|
|
9
|
+
* This helper never writes to disk — it is a planner only.
|
|
10
|
+
*/
|
|
11
|
+
export default function installAideTree(projectRoot: string): Promise<InitStep[]>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { access } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { readCanonicalDoc } from "../../../tools/init/initContent/index.js";
|
|
4
|
+
/** Check if a file exists on disk. */
|
|
5
|
+
async function fileExists(path) {
|
|
6
|
+
try {
|
|
7
|
+
await access(path);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Return a planning step for the aide-tree launcher script.
|
|
16
|
+
*
|
|
17
|
+
* Checks whether `.aide/bin/aide-tree.mjs` already exists under `projectRoot`.
|
|
18
|
+
* Returns `exists` if the file is present, `would-create` with the canonical
|
|
19
|
+
* script content if it is absent. A failing canonical read returns `would-skip`.
|
|
20
|
+
*
|
|
21
|
+
* This helper never writes to disk — it is a planner only.
|
|
22
|
+
*/
|
|
23
|
+
export default async function installAideTree(projectRoot) {
|
|
24
|
+
const targetPath = join(projectRoot, ".aide", "bin", "aide-tree.mjs");
|
|
25
|
+
const displayName = ".aide/bin/aide-tree.mjs";
|
|
26
|
+
if (await fileExists(targetPath)) {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
name: displayName,
|
|
30
|
+
status: "exists",
|
|
31
|
+
category: "commands",
|
|
32
|
+
filePath: targetPath,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
let content;
|
|
37
|
+
try {
|
|
38
|
+
content = readCanonicalDoc("bin/aide-tree");
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
name: displayName,
|
|
44
|
+
status: "would-skip",
|
|
45
|
+
category: "commands",
|
|
46
|
+
filePath: targetPath,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
name: displayName,
|
|
53
|
+
status: "would-create",
|
|
54
|
+
category: "commands",
|
|
55
|
+
filePath: targetPath,
|
|
56
|
+
content,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InitStep, McpPrescription } from "../../../types/index.js";
|
|
2
|
-
/** Build the MCP server entry
|
|
2
|
+
/** Build the MCP server entry using the cmd /c npx form. */
|
|
3
3
|
export declare function mcpEntry(): McpPrescription["entry"];
|
|
4
4
|
/**
|
|
5
5
|
* Inspect the project's MCP config and return a planning step for the aide
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { platform } from "node:os";
|
|
3
2
|
/** Read a file, returning empty string if it doesn't exist. */
|
|
4
3
|
async function safeReadFile(path) {
|
|
5
4
|
try {
|
|
@@ -9,12 +8,9 @@ async function safeReadFile(path) {
|
|
|
9
8
|
return "";
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
/** Build the MCP server entry
|
|
11
|
+
/** Build the MCP server entry using the cmd /c npx form. */
|
|
13
12
|
export function mcpEntry() {
|
|
14
|
-
|
|
15
|
-
return { command: "cmd", args: ["/c", "npx", "@aidemd-mcp/server"] };
|
|
16
|
-
}
|
|
17
|
-
return { command: "npx", args: ["@aidemd-mcp/server"] };
|
|
13
|
+
return { command: "cmd", args: ["/c", "npx", "@aidemd-mcp/server"] };
|
|
18
14
|
}
|
|
19
15
|
/**
|
|
20
16
|
* Inspect the project's MCP config and return a planning step for the aide
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidemd-mcp/server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP server that teaches any agent the AIDE methodology through tool descriptions and progressive disclosure tooling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"aidemd-mcp": "dist/index.js"
|
|
8
|
-
"aide-tree": "dist/cli/index.js",
|
|
9
|
-
"server": "dist/cli/init/index.js"
|
|
7
|
+
"aidemd-mcp": "dist/index.js"
|
|
10
8
|
},
|
|
11
9
|
"main": "dist/index.js",
|
|
12
10
|
"scripts": {
|
|
@@ -14,7 +12,6 @@
|
|
|
14
12
|
"prepublishOnly": "rm -rf dist && npm run build",
|
|
15
13
|
"dev": "tsc --watch",
|
|
16
14
|
"test": "vitest run",
|
|
17
|
-
"aide-tree": "node dist/cli/index.js",
|
|
18
15
|
"export-pdf": "tsx scripts/export-pdf.ts"
|
|
19
16
|
},
|
|
20
17
|
"keywords": [
|
|
@@ -34,6 +31,7 @@
|
|
|
34
31
|
"dist",
|
|
35
32
|
"README.md",
|
|
36
33
|
".aide",
|
|
34
|
+
".aide/bin",
|
|
37
35
|
".claude/commands/aide"
|
|
38
36
|
],
|
|
39
37
|
"dependencies": {
|