@wrongstack/codebase-index-mcp 1.0.11 → 1.0.12
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.js +39 -10
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -279,30 +279,58 @@ function parseArgs(argv, env = process.env) {
|
|
|
279
279
|
writable: false,
|
|
280
280
|
help: false
|
|
281
281
|
};
|
|
282
|
+
const warn = (event, message) => {
|
|
283
|
+
console.warn(
|
|
284
|
+
JSON.stringify({ level: "warn", event, message, timestamp: (/* @__PURE__ */ new Date()).toISOString() })
|
|
285
|
+
);
|
|
286
|
+
};
|
|
282
287
|
for (let index = 0; index < argv.length; index++) {
|
|
283
288
|
const arg = argv[index];
|
|
289
|
+
const value = () => {
|
|
290
|
+
const next = argv[index + 1];
|
|
291
|
+
if (next === void 0 || next.startsWith("--")) {
|
|
292
|
+
warn("mcp_cli_flag_missing_value", `${arg} expects a value; ignoring it.`);
|
|
293
|
+
return void 0;
|
|
294
|
+
}
|
|
295
|
+
index++;
|
|
296
|
+
return next;
|
|
297
|
+
};
|
|
284
298
|
switch (arg) {
|
|
285
|
-
case "--project-root":
|
|
286
|
-
|
|
299
|
+
case "--project-root": {
|
|
300
|
+
const v = value();
|
|
301
|
+
if (v !== void 0) parsed.projectRoot = path.resolve(v);
|
|
287
302
|
break;
|
|
288
|
-
|
|
289
|
-
|
|
303
|
+
}
|
|
304
|
+
case "--index-dir": {
|
|
305
|
+
const v = value();
|
|
306
|
+
if (v !== void 0) parsed.indexDir = path.resolve(v);
|
|
290
307
|
break;
|
|
308
|
+
}
|
|
291
309
|
case "--stdio":
|
|
292
310
|
parsed.transport = "stdio";
|
|
293
311
|
break;
|
|
294
312
|
case "--http":
|
|
295
313
|
parsed.transport = "http";
|
|
296
314
|
break;
|
|
297
|
-
case "--port":
|
|
298
|
-
|
|
315
|
+
case "--port": {
|
|
316
|
+
const v = value();
|
|
317
|
+
if (v === void 0) break;
|
|
318
|
+
const port = Number(v);
|
|
319
|
+
if (Number.isInteger(port) && port >= 0 && port <= 65535) parsed.httpPort = port;
|
|
320
|
+
else
|
|
321
|
+
warn("mcp_cli_invalid_port", `--port ${v} is not a valid port; using an ephemeral port.`);
|
|
299
322
|
break;
|
|
300
|
-
|
|
301
|
-
|
|
323
|
+
}
|
|
324
|
+
case "--host": {
|
|
325
|
+
const v = value();
|
|
326
|
+
if (v !== void 0) parsed.httpHost = v;
|
|
302
327
|
break;
|
|
303
|
-
|
|
304
|
-
|
|
328
|
+
}
|
|
329
|
+
case "--token": {
|
|
330
|
+
const v = value();
|
|
331
|
+
if (v !== void 0) parsed.httpToken = v;
|
|
305
332
|
break;
|
|
333
|
+
}
|
|
306
334
|
case "--writable":
|
|
307
335
|
parsed.writable = true;
|
|
308
336
|
break;
|
|
@@ -311,6 +339,7 @@ function parseArgs(argv, env = process.env) {
|
|
|
311
339
|
parsed.help = true;
|
|
312
340
|
break;
|
|
313
341
|
default:
|
|
342
|
+
if (arg?.startsWith("-")) warn("mcp_cli_unknown_option", `unknown option ${arg} ignored.`);
|
|
314
343
|
break;
|
|
315
344
|
}
|
|
316
345
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/codebase-index-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack Codebase Index as an MCP server, backed by the existing project-scoped IPC daemon.",
|
|
6
6
|
"repository": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"!dist/**/*.map"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@wrongstack/core": "1.0.
|
|
35
|
-
"@wrongstack/mcp": "1.0.
|
|
36
|
-
"@wrongstack/tools": "1.0.
|
|
34
|
+
"@wrongstack/core": "1.0.12",
|
|
35
|
+
"@wrongstack/mcp": "1.0.12",
|
|
36
|
+
"@wrongstack/tools": "1.0.12"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26.5.1",
|