@kontextmind/kxm 0.7.128 → 0.7.130
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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +20 -0
- package/docs/architecture/inventory.md +1 -1
- package/docs/concepts/data-and-storage.md +1 -1
- package/docs/contracts/README.md +1 -1
- package/docs/contracts/migration.md +12 -8
- package/docs/contributing/development.md +3 -1
- package/docs/operations/backup-and-restore.md +3 -3
- package/docs/operations/upgrade.md +2 -2
- package/docs/reference/cli-reference.md +11 -6
- package/docs/reference/config-reference.md +5 -2
- package/package.json +8 -8
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +2284 -222
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/runtime-supervisor.js +461 -106
- package/plugins/kxm/dist/runtime.js +470 -114
- package/plugins/kxm/dist/server.js +17 -14
- package/plugins/kxm/package.json +1 -1
- package/plugins/kxm/src/cli/lanes.ts +109 -4
- package/plugins/kxm/src/cli/project.ts +2 -2
- package/plugins/kxm/src/database.ts +25 -19
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/runtime-service.ts +1 -0
- package/plugins/kxm/src/runtime-store.ts +390 -77
- package/plugins/kxm/src/runtime-supervisor.ts +87 -3
- package/scripts/run-bounded.mjs +53 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Wall-clock guard for a test suite. Node's --test-timeout also bounds each
|
|
4
|
+
// file (each file is a test), so the suite scripts do not pass it. This
|
|
5
|
+
// bounds the process that runs them.
|
|
6
|
+
|
|
7
|
+
import { spawn } from "node:child_process";
|
|
8
|
+
|
|
9
|
+
const timeoutMs = Number(process.argv[2]);
|
|
10
|
+
const command = process.argv[3];
|
|
11
|
+
const args = process.argv.slice(4);
|
|
12
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || command === undefined) {
|
|
13
|
+
console.error("usage: run-bounded.mjs <timeout-ms> <command> [args...]");
|
|
14
|
+
process.exit(2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const child = spawn(command, args, { stdio: "inherit", detached: true });
|
|
18
|
+
let timedOut = false;
|
|
19
|
+
|
|
20
|
+
function signalGroup(signal) {
|
|
21
|
+
if (child.pid === undefined) return;
|
|
22
|
+
try {
|
|
23
|
+
process.kill(-child.pid, signal);
|
|
24
|
+
} catch {
|
|
25
|
+
try { child.kill(signal); } catch { /* already gone */ }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const timer = setTimeout(() => {
|
|
30
|
+
timedOut = true;
|
|
31
|
+
console.error(`wall clock ${timeoutMs}ms exceeded`);
|
|
32
|
+
signalGroup("SIGTERM");
|
|
33
|
+
setTimeout(() => signalGroup("SIGKILL"), 2000).unref();
|
|
34
|
+
}, timeoutMs);
|
|
35
|
+
|
|
36
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
37
|
+
process.on(signal, () => {
|
|
38
|
+
signalGroup(signal);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
child.on("error", (error) => {
|
|
43
|
+
clearTimeout(timer);
|
|
44
|
+
console.error(error.message);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
child.on("exit", (code, signal) => {
|
|
49
|
+
clearTimeout(timer);
|
|
50
|
+
if (timedOut) process.exit(124);
|
|
51
|
+
if (signal) process.exit(1);
|
|
52
|
+
process.exit(code ?? 1);
|
|
53
|
+
});
|