context-vault 3.16.0 → 3.16.1
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/cli.js +5 -431
- package/dist/register-tools.d.ts.map +1 -1
- package/dist/register-tools.js +4 -0
- package/dist/register-tools.js.map +1 -1
- package/dist/server.js +3 -436
- package/dist/server.js.map +1 -1
- package/node_modules/@context-vault/core/package.json +1 -1
- package/package.json +2 -2
- package/scripts/postinstall.js +26 -1
- package/src/register-tools.ts +4 -0
- package/src/server.ts +3 -432
package/bin/cli.js
CHANGED
|
@@ -443,7 +443,6 @@ ${bold('Commands:')}
|
|
|
443
443
|
${cyan('status')} Show vault diagnostics
|
|
444
444
|
${cyan('doctor')} Diagnose and repair common issues
|
|
445
445
|
${cyan('debug')} Generate AI-pasteable debug report
|
|
446
|
-
${cyan('daemon')} start|stop|status Run vault as a shared HTTP daemon (one process, all sessions)
|
|
447
446
|
${cyan('restart')} Stop running MCP server processes (client auto-restarts)
|
|
448
447
|
${cyan('reconnect')} Fix vault path, kill stale servers, re-register MCP, reindex
|
|
449
448
|
${cyan('search')} Search vault entries from CLI
|
|
@@ -6408,116 +6407,6 @@ async function runHealth() {
|
|
|
6408
6407
|
if (!healthy) process.exit(1);
|
|
6409
6408
|
}
|
|
6410
6409
|
|
|
6411
|
-
async function runRestart() {
|
|
6412
|
-
const force = flags.has('--force');
|
|
6413
|
-
|
|
6414
|
-
console.log();
|
|
6415
|
-
console.log(` ${bold('◇ context-vault restart')}`);
|
|
6416
|
-
console.log();
|
|
6417
|
-
|
|
6418
|
-
const isWin = platform() === 'win32';
|
|
6419
|
-
let psOutput;
|
|
6420
|
-
try {
|
|
6421
|
-
const psCmd = isWin
|
|
6422
|
-
? 'wmic process where "CommandLine like \'%context-vault%\'" get ProcessId,CommandLine /format:list'
|
|
6423
|
-
: 'ps aux';
|
|
6424
|
-
psOutput = execSync(psCmd, { encoding: 'utf-8', timeout: 5000 });
|
|
6425
|
-
} catch (e) {
|
|
6426
|
-
console.error(red(` Failed to list processes: ${e.message}`));
|
|
6427
|
-
process.exit(1);
|
|
6428
|
-
}
|
|
6429
|
-
|
|
6430
|
-
const currentPid = process.pid;
|
|
6431
|
-
const serverPids = [];
|
|
6432
|
-
|
|
6433
|
-
if (isWin) {
|
|
6434
|
-
const pidMatches = psOutput.matchAll(/ProcessId=(\d+)/g);
|
|
6435
|
-
for (const m of pidMatches) {
|
|
6436
|
-
const pid = parseInt(m[1], 10);
|
|
6437
|
-
if (pid !== currentPid) serverPids.push(pid);
|
|
6438
|
-
}
|
|
6439
|
-
} else {
|
|
6440
|
-
const lines = psOutput.split('\n');
|
|
6441
|
-
for (const line of lines) {
|
|
6442
|
-
const match = line.match(/^\S+\s+(\d+)\s/);
|
|
6443
|
-
if (!match) continue;
|
|
6444
|
-
const pid = parseInt(match[1], 10);
|
|
6445
|
-
if (pid === currentPid) continue;
|
|
6446
|
-
if (
|
|
6447
|
-
/context-vault.*(serve|stdio|server\/index)/.test(line) ||
|
|
6448
|
-
/server\/index\.js.*context-vault/.test(line)
|
|
6449
|
-
) {
|
|
6450
|
-
serverPids.push(pid);
|
|
6451
|
-
}
|
|
6452
|
-
}
|
|
6453
|
-
}
|
|
6454
|
-
|
|
6455
|
-
if (serverPids.length === 0) {
|
|
6456
|
-
console.log(dim(' No running context-vault MCP server processes found.'));
|
|
6457
|
-
console.log(dim(' The MCP client will start the server automatically on the next tool call.'));
|
|
6458
|
-
console.log();
|
|
6459
|
-
return;
|
|
6460
|
-
}
|
|
6461
|
-
|
|
6462
|
-
console.log(
|
|
6463
|
-
` Found ${serverPids.length} server process${serverPids.length === 1 ? '' : 'es'}: ${dim(serverPids.join(', '))}`
|
|
6464
|
-
);
|
|
6465
|
-
console.log();
|
|
6466
|
-
|
|
6467
|
-
const signal = force ? 'SIGKILL' : 'SIGTERM';
|
|
6468
|
-
const killed = [];
|
|
6469
|
-
const failed = [];
|
|
6470
|
-
|
|
6471
|
-
for (const pid of serverPids) {
|
|
6472
|
-
try {
|
|
6473
|
-
process.kill(pid, signal);
|
|
6474
|
-
killed.push(pid);
|
|
6475
|
-
console.log(` ${green('✓')} Sent ${signal} to PID ${pid}`);
|
|
6476
|
-
} catch (e) {
|
|
6477
|
-
if (e.code === 'ESRCH') {
|
|
6478
|
-
console.log(` ${dim('-')} PID ${pid} already gone`);
|
|
6479
|
-
} else {
|
|
6480
|
-
failed.push(pid);
|
|
6481
|
-
console.log(` ${red('✘')} Failed to signal PID ${pid}: ${e.message}`);
|
|
6482
|
-
}
|
|
6483
|
-
}
|
|
6484
|
-
}
|
|
6485
|
-
|
|
6486
|
-
if (!force && killed.length > 0) {
|
|
6487
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
6488
|
-
|
|
6489
|
-
for (const pid of killed) {
|
|
6490
|
-
try {
|
|
6491
|
-
process.kill(pid, 0);
|
|
6492
|
-
console.log(` ${yellow('!')} PID ${pid} still running — sending SIGKILL`);
|
|
6493
|
-
try {
|
|
6494
|
-
process.kill(pid, 'SIGKILL');
|
|
6495
|
-
} catch {}
|
|
6496
|
-
} catch {
|
|
6497
|
-
// process is gone — expected
|
|
6498
|
-
}
|
|
6499
|
-
}
|
|
6500
|
-
}
|
|
6501
|
-
|
|
6502
|
-
console.log();
|
|
6503
|
-
|
|
6504
|
-
if (failed.length > 0) {
|
|
6505
|
-
console.log(
|
|
6506
|
-
red(
|
|
6507
|
-
` Could not stop ${failed.length} process${failed.length === 1 ? '' : 'es'}. Try --force.`
|
|
6508
|
-
)
|
|
6509
|
-
);
|
|
6510
|
-
process.exit(1);
|
|
6511
|
-
} else {
|
|
6512
|
-
console.log(
|
|
6513
|
-
green(' Server stopped.') +
|
|
6514
|
-
dim(' The MCP client will restart it automatically on the next tool call.')
|
|
6515
|
-
);
|
|
6516
|
-
}
|
|
6517
|
-
|
|
6518
|
-
console.log();
|
|
6519
|
-
}
|
|
6520
|
-
|
|
6521
6410
|
async function runReconnect() {
|
|
6522
6411
|
console.log();
|
|
6523
6412
|
console.log(` ${bold('◇ context-vault reconnect')}`);
|
|
@@ -6857,323 +6746,6 @@ async function runDebug() {
|
|
|
6857
6746
|
console.log(lines.join('\n'));
|
|
6858
6747
|
}
|
|
6859
6748
|
|
|
6860
|
-
async function runDaemon() {
|
|
6861
|
-
const sub = args[1];
|
|
6862
|
-
const pidPath = join(HOME, '.context-mcp', 'daemon.pid');
|
|
6863
|
-
const defaultPort = 3377;
|
|
6864
|
-
|
|
6865
|
-
function readPid() {
|
|
6866
|
-
try {
|
|
6867
|
-
return JSON.parse(readFileSync(pidPath, 'utf-8'));
|
|
6868
|
-
} catch {
|
|
6869
|
-
return null;
|
|
6870
|
-
}
|
|
6871
|
-
}
|
|
6872
|
-
|
|
6873
|
-
function isAlive(pid) {
|
|
6874
|
-
try {
|
|
6875
|
-
process.kill(pid, 0);
|
|
6876
|
-
return true;
|
|
6877
|
-
} catch {
|
|
6878
|
-
return false;
|
|
6879
|
-
}
|
|
6880
|
-
}
|
|
6881
|
-
|
|
6882
|
-
async function pollHealth(port, timeoutMs = 5000) {
|
|
6883
|
-
const start = Date.now();
|
|
6884
|
-
while (Date.now() - start < timeoutMs) {
|
|
6885
|
-
try {
|
|
6886
|
-
const res = await fetch(`http://localhost:${port}/health`);
|
|
6887
|
-
if (res.ok) return await res.json();
|
|
6888
|
-
} catch {}
|
|
6889
|
-
await new Promise((r) => setTimeout(r, 200));
|
|
6890
|
-
}
|
|
6891
|
-
return null;
|
|
6892
|
-
}
|
|
6893
|
-
|
|
6894
|
-
function configureClaudeDaemon(port) {
|
|
6895
|
-
const env = { ...process.env };
|
|
6896
|
-
delete env.CLAUDECODE;
|
|
6897
|
-
|
|
6898
|
-
for (const oldName of ['context-mcp', 'context-vault']) {
|
|
6899
|
-
try {
|
|
6900
|
-
execFileSync('claude', ['mcp', 'remove', oldName, '-s', 'user'], {
|
|
6901
|
-
stdio: 'pipe',
|
|
6902
|
-
env,
|
|
6903
|
-
});
|
|
6904
|
-
} catch {}
|
|
6905
|
-
}
|
|
6906
|
-
|
|
6907
|
-
try {
|
|
6908
|
-
execFileSync(
|
|
6909
|
-
'claude',
|
|
6910
|
-
[
|
|
6911
|
-
'mcp', 'add', '-s', 'user',
|
|
6912
|
-
'--transport', 'http',
|
|
6913
|
-
'context-vault',
|
|
6914
|
-
`http://localhost:${port}/mcp`,
|
|
6915
|
-
],
|
|
6916
|
-
{ stdio: 'pipe', env }
|
|
6917
|
-
);
|
|
6918
|
-
} catch (e) {
|
|
6919
|
-
const stderr = e.stderr?.toString().trim();
|
|
6920
|
-
throw new Error(stderr || e.message);
|
|
6921
|
-
}
|
|
6922
|
-
}
|
|
6923
|
-
|
|
6924
|
-
if (!sub || sub === '--help') {
|
|
6925
|
-
console.log(`
|
|
6926
|
-
${bold('◇ context-vault daemon')} ${dim('— shared HTTP daemon')}
|
|
6927
|
-
|
|
6928
|
-
${bold('Subcommands:')}
|
|
6929
|
-
${cyan('start')} [--port PORT] Start the daemon (default port: ${defaultPort})
|
|
6930
|
-
${cyan('stop')} Stop the running daemon
|
|
6931
|
-
${cyan('status')} Show daemon status
|
|
6932
|
-
${cyan('install')} Start daemon + configure Claude Code to use it
|
|
6933
|
-
${cyan('uninstall')} Stop daemon + revert Claude Code to stdio mode
|
|
6934
|
-
`);
|
|
6935
|
-
return;
|
|
6936
|
-
}
|
|
6937
|
-
|
|
6938
|
-
if (sub === 'start') {
|
|
6939
|
-
const port = parseInt(getFlag('--port') || String(defaultPort), 10);
|
|
6940
|
-
const existing = readPid();
|
|
6941
|
-
|
|
6942
|
-
if (existing && isAlive(existing.pid)) {
|
|
6943
|
-
console.log(` ${green('✓')} Daemon already running (PID ${existing.pid} on port ${existing.port})`);
|
|
6944
|
-
return;
|
|
6945
|
-
}
|
|
6946
|
-
|
|
6947
|
-
if (existing) {
|
|
6948
|
-
try { unlinkSync(pidPath); } catch {}
|
|
6949
|
-
}
|
|
6950
|
-
|
|
6951
|
-
console.log(` Starting daemon on port ${port}...`);
|
|
6952
|
-
|
|
6953
|
-
const vaultDir = getFlag('--vault-dir');
|
|
6954
|
-
const serverArgs = [SERVER_PATH, '--http', '--port', String(port)];
|
|
6955
|
-
if (vaultDir) serverArgs.push('--vault-dir', vaultDir);
|
|
6956
|
-
|
|
6957
|
-
const child = spawn(process.execPath, serverArgs, {
|
|
6958
|
-
detached: true,
|
|
6959
|
-
stdio: 'ignore',
|
|
6960
|
-
env: { ...process.env, NODE_OPTIONS: '--no-warnings=ExperimentalWarning' },
|
|
6961
|
-
});
|
|
6962
|
-
child.unref();
|
|
6963
|
-
|
|
6964
|
-
const health = await pollHealth(port);
|
|
6965
|
-
if (health) {
|
|
6966
|
-
console.log(` ${green('✓')} Daemon started on http://localhost:${port}/mcp (PID ${health.pid})`);
|
|
6967
|
-
} else {
|
|
6968
|
-
console.error(red(` Failed to start daemon. Check error log: ~/.context-mcp/error.log`));
|
|
6969
|
-
process.exit(1);
|
|
6970
|
-
}
|
|
6971
|
-
|
|
6972
|
-
} else if (sub === 'stop') {
|
|
6973
|
-
const existing = readPid();
|
|
6974
|
-
if (!existing) {
|
|
6975
|
-
console.log(dim(' No daemon running.'));
|
|
6976
|
-
return;
|
|
6977
|
-
}
|
|
6978
|
-
|
|
6979
|
-
if (!isAlive(existing.pid)) {
|
|
6980
|
-
console.log(dim(' Stale PID file (process not running). Cleaning up.'));
|
|
6981
|
-
try { unlinkSync(pidPath); } catch {}
|
|
6982
|
-
return;
|
|
6983
|
-
}
|
|
6984
|
-
|
|
6985
|
-
console.log(` Stopping daemon (PID ${existing.pid})...`);
|
|
6986
|
-
process.kill(existing.pid, 'SIGTERM');
|
|
6987
|
-
|
|
6988
|
-
const deadline = Date.now() + 3000;
|
|
6989
|
-
while (Date.now() < deadline && isAlive(existing.pid)) {
|
|
6990
|
-
await new Promise((r) => setTimeout(r, 200));
|
|
6991
|
-
}
|
|
6992
|
-
|
|
6993
|
-
if (isAlive(existing.pid)) {
|
|
6994
|
-
console.log(` ${yellow('!')} Still alive, sending SIGKILL...`);
|
|
6995
|
-
try { process.kill(existing.pid, 'SIGKILL'); } catch {}
|
|
6996
|
-
}
|
|
6997
|
-
|
|
6998
|
-
try { unlinkSync(pidPath); } catch {}
|
|
6999
|
-
console.log(` ${green('✓')} Daemon stopped.`);
|
|
7000
|
-
|
|
7001
|
-
} else if (sub === 'status') {
|
|
7002
|
-
const existing = readPid();
|
|
7003
|
-
if (!existing) {
|
|
7004
|
-
console.log(dim(' Not running.'));
|
|
7005
|
-
return;
|
|
7006
|
-
}
|
|
7007
|
-
|
|
7008
|
-
if (!isAlive(existing.pid)) {
|
|
7009
|
-
console.log(` ${yellow('!')} Stale PID file (PID ${existing.pid} not found).`);
|
|
7010
|
-
return;
|
|
7011
|
-
}
|
|
7012
|
-
|
|
7013
|
-
try {
|
|
7014
|
-
const res = await fetch(`http://localhost:${existing.port}/health`);
|
|
7015
|
-
const health = await res.json();
|
|
7016
|
-
const uptimeMin = Math.floor(health.uptime / 60);
|
|
7017
|
-
console.log(
|
|
7018
|
-
` ${green('●')} Running (PID ${health.pid}, port ${existing.port}, v${health.version}, ` +
|
|
7019
|
-
`${health.sessions} session${health.sessions === 1 ? '' : 's'}, uptime ${uptimeMin}m)`
|
|
7020
|
-
);
|
|
7021
|
-
} catch (e) {
|
|
7022
|
-
console.log(` ${yellow('!')} Process alive (PID ${existing.pid}) but health check failed: ${e.message}`);
|
|
7023
|
-
}
|
|
7024
|
-
|
|
7025
|
-
} else if (sub === 'install') {
|
|
7026
|
-
const port = parseInt(getFlag('--port') || String(defaultPort), 10);
|
|
7027
|
-
|
|
7028
|
-
// 1. Install LaunchAgent on macOS for auto-start on login
|
|
7029
|
-
if (platform() === 'darwin') {
|
|
7030
|
-
const launchAgentDir = join(HOME, 'Library', 'LaunchAgents');
|
|
7031
|
-
const plistPath = join(launchAgentDir, 'com.context-vault.daemon.plist');
|
|
7032
|
-
const logPath = join(HOME, '.context-mcp', 'daemon.log');
|
|
7033
|
-
const vaultDir = getFlag('--vault-dir');
|
|
7034
|
-
const progArgs = [process.execPath, SERVER_PATH, '--http', '--port', String(port)];
|
|
7035
|
-
if (vaultDir) progArgs.push('--vault-dir', vaultDir);
|
|
7036
|
-
|
|
7037
|
-
const plist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
7038
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
7039
|
-
<plist version="1.0">
|
|
7040
|
-
<dict>
|
|
7041
|
-
<key>Label</key>
|
|
7042
|
-
<string>com.context-vault.daemon</string>
|
|
7043
|
-
<key>ProgramArguments</key>
|
|
7044
|
-
<array>
|
|
7045
|
-
${progArgs.map(a => ` <string>${a}</string>`).join('\n')}
|
|
7046
|
-
</array>
|
|
7047
|
-
<key>RunAtLoad</key>
|
|
7048
|
-
<true/>
|
|
7049
|
-
<key>KeepAlive</key>
|
|
7050
|
-
<dict>
|
|
7051
|
-
<key>SuccessfulExit</key>
|
|
7052
|
-
<false/>
|
|
7053
|
-
</dict>
|
|
7054
|
-
<key>StandardErrorPath</key>
|
|
7055
|
-
<string>${logPath}</string>
|
|
7056
|
-
<key>StandardOutPath</key>
|
|
7057
|
-
<string>/dev/null</string>
|
|
7058
|
-
<key>EnvironmentVariables</key>
|
|
7059
|
-
<dict>
|
|
7060
|
-
<key>NODE_OPTIONS</key>
|
|
7061
|
-
<string>--no-warnings=ExperimentalWarning</string>
|
|
7062
|
-
<key>CONTEXT_VAULT_NO_DAEMON</key>
|
|
7063
|
-
<string>1</string>
|
|
7064
|
-
</dict>
|
|
7065
|
-
<key>ThrottleInterval</key>
|
|
7066
|
-
<integer>5</integer>
|
|
7067
|
-
</dict>
|
|
7068
|
-
</plist>`;
|
|
7069
|
-
|
|
7070
|
-
mkdirSync(launchAgentDir, { recursive: true });
|
|
7071
|
-
|
|
7072
|
-
// Unload existing agent if present
|
|
7073
|
-
try { execSync(`launchctl unload "${plistPath}" 2>/dev/null`, { stdio: 'pipe' }); } catch {}
|
|
7074
|
-
|
|
7075
|
-
writeFileSync(plistPath, plist);
|
|
7076
|
-
try {
|
|
7077
|
-
execSync(`launchctl load -w "${plistPath}"`, { stdio: 'pipe' });
|
|
7078
|
-
console.log(` ${green('✓')} LaunchAgent installed (auto-starts on login, restarts on crash)`);
|
|
7079
|
-
} catch (e) {
|
|
7080
|
-
console.log(` ${yellow('!')} LaunchAgent write succeeded but launchctl load failed: ${e.message}`);
|
|
7081
|
-
}
|
|
7082
|
-
|
|
7083
|
-
// Wait for launchd to start the daemon
|
|
7084
|
-
const health = await pollHealth(port, 8000);
|
|
7085
|
-
if (health) {
|
|
7086
|
-
console.log(` ${green('✓')} Daemon running (PID ${health.pid})`);
|
|
7087
|
-
} else {
|
|
7088
|
-
console.error(red(` Daemon did not start. Check log: ${logPath}`));
|
|
7089
|
-
process.exit(1);
|
|
7090
|
-
}
|
|
7091
|
-
} else {
|
|
7092
|
-
// Non-macOS: direct spawn (no service manager integration yet)
|
|
7093
|
-
const existing = readPid();
|
|
7094
|
-
if (!existing || !isAlive(existing.pid)) {
|
|
7095
|
-
if (existing) try { unlinkSync(pidPath); } catch {}
|
|
7096
|
-
|
|
7097
|
-
console.log(` Starting daemon on port ${port}...`);
|
|
7098
|
-
const vaultDir = getFlag('--vault-dir');
|
|
7099
|
-
const serverArgs = [SERVER_PATH, '--http', '--port', String(port)];
|
|
7100
|
-
if (vaultDir) serverArgs.push('--vault-dir', vaultDir);
|
|
7101
|
-
|
|
7102
|
-
const child = spawn(process.execPath, serverArgs, {
|
|
7103
|
-
detached: true,
|
|
7104
|
-
stdio: 'ignore',
|
|
7105
|
-
env: { ...process.env, NODE_OPTIONS: '--no-warnings=ExperimentalWarning' },
|
|
7106
|
-
});
|
|
7107
|
-
child.unref();
|
|
7108
|
-
|
|
7109
|
-
const health = await pollHealth(port);
|
|
7110
|
-
if (!health) {
|
|
7111
|
-
console.error(red(` Failed to start daemon.`));
|
|
7112
|
-
process.exit(1);
|
|
7113
|
-
}
|
|
7114
|
-
console.log(` ${green('✓')} Daemon started (PID ${health.pid})`);
|
|
7115
|
-
} else {
|
|
7116
|
-
console.log(` ${green('✓')} Daemon already running (PID ${existing.pid})`);
|
|
7117
|
-
}
|
|
7118
|
-
}
|
|
7119
|
-
|
|
7120
|
-
// 2. Configure Claude Code for HTTP transport
|
|
7121
|
-
console.log(` Configuring Claude Code to use HTTP transport...`);
|
|
7122
|
-
try {
|
|
7123
|
-
configureClaudeDaemon(port);
|
|
7124
|
-
console.log(` ${green('✓')} Claude Code configured for http://localhost:${port}/mcp`);
|
|
7125
|
-
console.log();
|
|
7126
|
-
console.log(dim(' Restart any open Claude Code sessions for the change to take effect.'));
|
|
7127
|
-
} catch (e) {
|
|
7128
|
-
console.error(red(` Failed to configure Claude Code: ${e.message}`));
|
|
7129
|
-
process.exit(1);
|
|
7130
|
-
}
|
|
7131
|
-
|
|
7132
|
-
} else if (sub === 'uninstall') {
|
|
7133
|
-
// 1. Revert Claude Code to stdio
|
|
7134
|
-
console.log(` Reverting Claude Code to stdio mode...`);
|
|
7135
|
-
try {
|
|
7136
|
-
const vaultDir = getFlag('--vault-dir') || join(HOME, '.vault');
|
|
7137
|
-
const tool = { name: 'Claude Code', configPath: null };
|
|
7138
|
-
await configureClaude(tool, vaultDir);
|
|
7139
|
-
console.log(` ${green('✓')} Claude Code reverted to stdio`);
|
|
7140
|
-
} catch (e) {
|
|
7141
|
-
console.error(red(` Failed to reconfigure Claude Code: ${e.message}`));
|
|
7142
|
-
}
|
|
7143
|
-
|
|
7144
|
-
// 2. Remove LaunchAgent on macOS
|
|
7145
|
-
if (platform() === 'darwin') {
|
|
7146
|
-
const plistPath = join(HOME, 'Library', 'LaunchAgents', 'com.context-vault.daemon.plist');
|
|
7147
|
-
if (existsSync(plistPath)) {
|
|
7148
|
-
try { execSync(`launchctl unload "${plistPath}" 2>/dev/null`, { stdio: 'pipe' }); } catch {}
|
|
7149
|
-
try { unlinkSync(plistPath); } catch {}
|
|
7150
|
-
console.log(` ${green('✓')} LaunchAgent removed`);
|
|
7151
|
-
}
|
|
7152
|
-
}
|
|
7153
|
-
|
|
7154
|
-
// 3. Stop daemon if running
|
|
7155
|
-
const existing = readPid();
|
|
7156
|
-
if (existing && isAlive(existing.pid)) {
|
|
7157
|
-
console.log(` Stopping daemon (PID ${existing.pid})...`);
|
|
7158
|
-
process.kill(existing.pid, 'SIGTERM');
|
|
7159
|
-
const deadline = Date.now() + 3000;
|
|
7160
|
-
while (Date.now() < deadline && isAlive(existing.pid)) {
|
|
7161
|
-
await new Promise((r) => setTimeout(r, 200));
|
|
7162
|
-
}
|
|
7163
|
-
if (isAlive(existing.pid)) {
|
|
7164
|
-
try { process.kill(existing.pid, 'SIGKILL'); } catch {}
|
|
7165
|
-
}
|
|
7166
|
-
try { unlinkSync(pidPath); } catch {}
|
|
7167
|
-
console.log(` ${green('✓')} Daemon stopped.`);
|
|
7168
|
-
}
|
|
7169
|
-
|
|
7170
|
-
} else {
|
|
7171
|
-
console.error(red(` Unknown daemon subcommand: ${sub}`));
|
|
7172
|
-
console.error(` Run ${cyan('context-vault daemon --help')} for usage.`);
|
|
7173
|
-
process.exit(1);
|
|
7174
|
-
}
|
|
7175
|
-
}
|
|
7176
|
-
|
|
7177
6749
|
async function runTier() {
|
|
7178
6750
|
const { resolveConfig } = await import('@context-vault/core/config');
|
|
7179
6751
|
const { initDatabase, prepareStatements, insertVec, deleteVec, insertCtxVec, deleteCtxVec } = await import('@context-vault/core/db');
|
|
@@ -8496,7 +8068,7 @@ async function main() {
|
|
|
8496
8068
|
|
|
8497
8069
|
if (flags.has('--help') || command === 'help') {
|
|
8498
8070
|
// Commands with their own --help handling: delegate to them
|
|
8499
|
-
const commandsWithHelp = new Set(['save', 'search', 'rules', 'hooks', '
|
|
8071
|
+
const commandsWithHelp = new Set(['save', 'search', 'rules', 'hooks', 'team', 'remote']);
|
|
8500
8072
|
if (!command || command === 'help' || !commandsWithHelp.has(command)) {
|
|
8501
8073
|
showHelp(flags.has('--all'));
|
|
8502
8074
|
return;
|
|
@@ -8525,7 +8097,8 @@ async function main() {
|
|
|
8525
8097
|
await runSwitch();
|
|
8526
8098
|
break;
|
|
8527
8099
|
case 'daemon':
|
|
8528
|
-
|
|
8100
|
+
console.log('The daemon command was removed in v3.16.1. context-vault now runs in stdio mode only.');
|
|
8101
|
+
process.exit(0);
|
|
8529
8102
|
break;
|
|
8530
8103
|
case 'serve':
|
|
8531
8104
|
await runServe();
|
|
@@ -8615,7 +8188,8 @@ async function main() {
|
|
|
8615
8188
|
await runHealth();
|
|
8616
8189
|
break;
|
|
8617
8190
|
case 'restart':
|
|
8618
|
-
|
|
8191
|
+
console.log('The restart command was removed in v3.16.1. Use "context-vault reconnect" instead.');
|
|
8192
|
+
process.exit(0);
|
|
8619
8193
|
break;
|
|
8620
8194
|
case 'reconnect':
|
|
8621
8195
|
await runReconnect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../src/register-tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../src/register-tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;AAoFlE,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAgJ9D"}
|
package/dist/register-tools.js
CHANGED
|
@@ -67,7 +67,11 @@ let reindexPromise = null;
|
|
|
67
67
|
let reindexAttempts = 0;
|
|
68
68
|
let reindexFailed = false;
|
|
69
69
|
const MAX_REINDEX_ATTEMPTS = 2;
|
|
70
|
+
const registeredServers = new WeakSet();
|
|
70
71
|
export function registerTools(server, ctx) {
|
|
72
|
+
if (registeredServers.has(server))
|
|
73
|
+
return;
|
|
74
|
+
registeredServers.add(server);
|
|
71
75
|
function tracked(handler, toolName) {
|
|
72
76
|
return async (...args) => {
|
|
73
77
|
if (ctx.activeOps)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tools.js","sourceRoot":"","sources":["../src/register-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErF,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OA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