fix(hooks): init command now fixes invalid schema and hook names

- Fixes $schema to correct URL
- Removes invalid Start/End hooks (renamed to SessionStart/Stop)
- Preserves other existing settings when merging

Bumps to v0.1.43

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rUv 2025-12-30 19:22:00 +00:00
parent 6e9cb87493
commit 5e5841925a
2 changed files with 10 additions and 1 deletions

View file

@ -2275,6 +2275,15 @@ hooksCmd.command('init').description('Initialize hooks in current project').opti
if (fs.existsSync(settingsPath) && !opts.force) {
try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8')); } catch {}
}
// Fix schema if present
if (settings.$schema) {
settings.$schema = 'https://json.schemastore.org/claude-code-settings.json';
}
// Clean up invalid hook names
if (settings.hooks) {
if (settings.hooks.Start) { delete settings.hooks.Start; }
if (settings.hooks.End) { delete settings.hooks.End; }
}
settings.hooks = settings.hooks || {};
settings.hooks.PreToolUse = [
{ matcher: 'Edit|Write|MultiEdit', hooks: [{ type: 'command', command: 'npx ruvector hooks pre-edit "$TOOL_INPUT_file_path"' }] },

View file

@ -1,6 +1,6 @@
{
"name": "ruvector",
"version": "0.1.42",
"version": "0.1.43",
"description": "High-performance vector database for Node.js with automatic native/WASM fallback",
"main": "dist/index.js",
"types": "dist/index.d.ts",