@icoretech/warden-mcp 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/bin/warden-mcp.js +24 -18
- package/dist/server.js +9 -4
- package/package.json +1 -1
package/bin/warden-mcp.js
CHANGED
|
@@ -8,24 +8,30 @@ import { fileURLToPath } from 'node:url';
|
|
|
8
8
|
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
prepareBwStartup(
|
|
11
|
+
async function main() {
|
|
12
|
+
const startupPath = resolve(__dirname, '../dist/startup/bwStartup.js');
|
|
13
|
+
if (!existsSync(startupPath)) {
|
|
14
|
+
console.error(
|
|
15
|
+
'[warden-mcp] ERROR: dist/startup/bwStartup.js not found. Run `npm run build` first.',
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const { prepareBwStartup } = await import(startupPath);
|
|
20
|
+
prepareBwStartup(process.env);
|
|
21
|
+
|
|
22
|
+
// Delegate to the compiled server entry, forwarding all arguments.
|
|
23
|
+
const serverPath = resolve(__dirname, '../dist/server.js');
|
|
24
|
+
if (!existsSync(serverPath)) {
|
|
25
|
+
console.error(
|
|
26
|
+
'[warden-mcp] ERROR: dist/server.js not found. Run `npm run build` first.',
|
|
27
|
+
);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
20
30
|
|
|
21
|
-
|
|
22
|
-
const serverPath = resolve(__dirname, '../dist/server.js');
|
|
23
|
-
if (!existsSync(serverPath)) {
|
|
24
|
-
console.error(
|
|
25
|
-
'[warden-mcp] ERROR: dist/server.js not found. Run `npm run build` first.',
|
|
26
|
-
);
|
|
27
|
-
process.exit(1);
|
|
31
|
+
await import(serverPath);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
void main().catch((error) => {
|
|
35
|
+
console.error(error);
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
});
|
package/dist/server.js
CHANGED
|
@@ -10,10 +10,11 @@ const { values } = parseArgs({
|
|
|
10
10
|
strict: false,
|
|
11
11
|
});
|
|
12
12
|
const useStdio = values.stdio === true || process.env.WARDEN_MCP_STDIO === 'true';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
async function main() {
|
|
14
|
+
if (useStdio) {
|
|
15
|
+
await runStdioTransport();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
17
18
|
const PORT = Number.parseInt(process.env.PORT ?? '3005', 10);
|
|
18
19
|
const app = createKeychainApp();
|
|
19
20
|
const server = app.listen(PORT, () => {
|
|
@@ -24,3 +25,7 @@ else {
|
|
|
24
25
|
server.once('error', reject);
|
|
25
26
|
});
|
|
26
27
|
}
|
|
28
|
+
void main().catch((error) => {
|
|
29
|
+
console.error(error);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
});
|