@rubytech/create-realagent-code 0.1.170 → 0.1.171
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.
|
@@ -83,3 +83,45 @@ test("findPremiumMcpDirs: skips bundle missing plugins/ subdir", () => {
|
|
|
83
83
|
rmSync(dir, { recursive: true, force: true });
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
+
test("findPremiumMcpDirs: discovers standalone MCP at premium-plugins/<bundle>/mcp/", () => {
|
|
87
|
+
const dir = mkdtempSync(join(tmpdir(), "premium-mcp-"));
|
|
88
|
+
try {
|
|
89
|
+
makeTree(dir, {
|
|
90
|
+
"premium-plugins/writer-craft/mcp/package.json": "{}",
|
|
91
|
+
});
|
|
92
|
+
assert.deepEqual(findPremiumMcpDirs(dir), [
|
|
93
|
+
join(dir, "premium-plugins/writer-craft/mcp"),
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
rmSync(dir, { recursive: true, force: true });
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
test("findPremiumMcpDirs: standalone + bundle-sub coexist under different bundles", () => {
|
|
101
|
+
const dir = mkdtempSync(join(tmpdir(), "premium-mcp-"));
|
|
102
|
+
try {
|
|
103
|
+
makeTree(dir, {
|
|
104
|
+
"premium-plugins/writer-craft/mcp/package.json": "{}",
|
|
105
|
+
"premium-plugins/real-agent/plugins/loop/mcp/package.json": "{}",
|
|
106
|
+
});
|
|
107
|
+
assert.deepEqual(findPremiumMcpDirs(dir), [
|
|
108
|
+
join(dir, "premium-plugins/real-agent/plugins/loop/mcp"),
|
|
109
|
+
join(dir, "premium-plugins/writer-craft/mcp"),
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
rmSync(dir, { recursive: true, force: true });
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
test("findPremiumMcpDirs: ignores standalone bundle with no mcp/ dir", () => {
|
|
117
|
+
const dir = mkdtempSync(join(tmpdir(), "premium-mcp-"));
|
|
118
|
+
try {
|
|
119
|
+
makeTree(dir, {
|
|
120
|
+
"premium-plugins/teaching/PLUGIN.md": "---\nname: teaching\n---\n",
|
|
121
|
+
});
|
|
122
|
+
assert.deepEqual(findPremiumMcpDirs(dir), []);
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
rmSync(dir, { recursive: true, force: true });
|
|
126
|
+
}
|
|
127
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Pure premium-plugin MCP directory discovery.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// Two shapes:
|
|
4
4
|
//
|
|
5
|
-
// <installDir>/premium-plugins/<bundle>/
|
|
5
|
+
// Standalone: <installDir>/premium-plugins/<bundle>/mcp/package.json
|
|
6
|
+
// Bundle sub: <installDir>/premium-plugins/<bundle>/plugins/<plugin>/mcp/package.json
|
|
6
7
|
//
|
|
7
8
|
// Recursive walks would match nested dirs that aren't real MCP plugins;
|
|
8
9
|
// the explicit walk eliminates that class of false positive. Each level
|
|
@@ -18,6 +19,12 @@ export function findPremiumMcpDirs(installDir) {
|
|
|
18
19
|
for (const bundle of readdirSync(root, { withFileTypes: true })) {
|
|
19
20
|
if (!bundle.isDirectory())
|
|
20
21
|
continue;
|
|
22
|
+
// Standalone shape: premium-plugins/<bundle>/mcp/
|
|
23
|
+
const standaloneMcp = join(root, bundle.name, "mcp");
|
|
24
|
+
if (existsSync(join(standaloneMcp, "package.json"))) {
|
|
25
|
+
out.push(standaloneMcp);
|
|
26
|
+
}
|
|
27
|
+
// Bundle-sub shape: premium-plugins/<bundle>/plugins/<plugin>/mcp/
|
|
21
28
|
const pluginsRoot = join(root, bundle.name, "plugins");
|
|
22
29
|
if (!existsSync(pluginsRoot))
|
|
23
30
|
continue;
|