@esankhan3/code-search-mcp 1.1.9 → 1.1.10
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, before, after } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
4
|
-
import { rmSync } from "node:fs";
|
|
4
|
+
import { readFileSync, rmSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import {
|
|
7
7
|
BIN,
|
|
@@ -121,6 +121,10 @@ ${p.stderr()}`);
|
|
|
121
121
|
let indexer = 0;
|
|
122
122
|
await waitFor(() => (indexer = childPid(p.child.pid, "index-child")) > 0, 1e4, `an indexer child process
|
|
123
123
|
${p.stderr()}`);
|
|
124
|
+
if (process.platform === "linux") {
|
|
125
|
+
const score = () => readFileSync(`/proc/${indexer}/oom_score_adj`, "utf8").trim();
|
|
126
|
+
await waitFor(() => score() === "1000", 1e4, "the indexer to put itself first for the out-of-memory killer");
|
|
127
|
+
}
|
|
124
128
|
process.kill(indexer, "SIGKILL");
|
|
125
129
|
const res = await killed;
|
|
126
130
|
assert.equal(res.status, 500, JSON.stringify(res.body));
|
package/dist/index-child.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
1
2
|
import { indexFromPath } from "@esankhan3/anvil-knowledge-core";
|
|
2
3
|
const send = (msg, then) => process.send(msg, then);
|
|
4
|
+
try {
|
|
5
|
+
writeFileSync("/proc/self/oom_score_adj", "1000");
|
|
6
|
+
} catch {
|
|
7
|
+
}
|
|
3
8
|
process.once("message", (run) => {
|
|
4
9
|
indexFromPath(run.project, run.dirPath, {
|
|
5
10
|
force: run.force,
|
package/dist/server.js
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
getBlobStore,
|
|
15
15
|
readVectorIndexHealth,
|
|
16
16
|
indexFromPath,
|
|
17
|
-
getRetriever,
|
|
18
17
|
invalidateRetriever,
|
|
18
|
+
refreshRetriever,
|
|
19
19
|
KnowledgeIndexer
|
|
20
20
|
} from "@esankhan3/anvil-knowledge-core";
|
|
21
21
|
import { loadServerConfig, resolvedKnowledgeConfig } from "./core/env-config.js";
|
|
@@ -340,7 +340,6 @@ function runClusterPrimary(ctx, workerCount) {
|
|
|
340
340
|
let ipcSeq = 0;
|
|
341
341
|
const pendingIndexRequests = /* @__PURE__ */ new Map();
|
|
342
342
|
const pendingRateRequests = /* @__PURE__ */ new Map();
|
|
343
|
-
let invalidation = Promise.resolve();
|
|
344
343
|
function forwardIndexToPrimary(body) {
|
|
345
344
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
346
345
|
if (!process.send) {
|
|
@@ -383,12 +382,10 @@ function registerWorkerIpc(ctx) {
|
|
|
383
382
|
pendingRateRequests.delete(msg.id);
|
|
384
383
|
pending?.({ ok: msg.ok, retryAfterSec: msg.retryAfterSec });
|
|
385
384
|
} else if (msg?.type === "csm:invalidate") {
|
|
386
|
-
invalidation = invalidateRetriever(msg.project).catch(() => {
|
|
387
|
-
});
|
|
388
385
|
if (msg.project === ctx.projectName) ctx.indexReady = true;
|
|
389
386
|
} else if (msg?.type === "csm:warm") {
|
|
390
387
|
const warmed = { type: "csm:warmed", id: msg.id };
|
|
391
|
-
void
|
|
388
|
+
void refreshRetriever(msg.project, resolvedKnowledgeConfig()).then(() => log.info("Search warmed after reindex")).catch((err) => log.warn(`Search warm-up failed (the next query rebuilds): ${err instanceof Error ? err.message : String(err)}`)).finally(() => {
|
|
392
389
|
if (process.connected) process.send?.(warmed);
|
|
393
390
|
});
|
|
394
391
|
} else if (msg?.type === "csm:state") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esankhan3/code-search-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "MCP server for multi-repo code search \u2014 GitHub org or local path, zero config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@esankhan3/anvil-agent-core": "^0.5.4",
|
|
27
|
-
"@esankhan3/anvil-knowledge-core": "^0.4.
|
|
27
|
+
"@esankhan3/anvil-knowledge-core": "^0.4.17",
|
|
28
28
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
29
29
|
"@modelcontextprotocol/server": "^2.0.0"
|
|
30
30
|
},
|