From ae928f0002d7b8cd596d8a949ec265f3d57b4a37 Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 30 Dec 2025 17:23:37 +0000 Subject: [PATCH] fix(hooks): correct hooks format - string matcher, hooks wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Format fixes based on Claude Code validation: - matcher: string regex (e.g., "Edit|Write|MultiEdit") not object - SessionStart/Stop: require { hooks: [...] } wrapper Bumps to v0.1.42 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .claude/settings.json | 20 ++++++++++++++------ npm/packages/ruvector/bin/cli.js | 12 ++++++------ npm/packages/ruvector/package.json | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 37e8cd2d..a668b39c 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -48,13 +48,13 @@ "hooks": { "PreToolUse": [ { - "matcher": { "tools": ["Edit", "Write", "MultiEdit"] }, + "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "npx ruvector hooks pre-edit \"$TOOL_INPUT_file_path\"" } ] }, { - "matcher": { "tools": ["Bash"] }, + "matcher": "Bash", "hooks": [ { "type": "command", "command": "npx ruvector hooks pre-command \"$TOOL_INPUT_command\"" } ] @@ -62,23 +62,31 @@ ], "PostToolUse": [ { - "matcher": { "tools": ["Edit", "Write", "MultiEdit"] }, + "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "npx ruvector hooks post-edit \"$TOOL_INPUT_file_path\"" } ] }, { - "matcher": { "tools": ["Bash"] }, + "matcher": "Bash", "hooks": [ { "type": "command", "command": "npx ruvector hooks post-command \"$TOOL_INPUT_command\"" } ] } ], "SessionStart": [ - { "type": "command", "command": "npx ruvector hooks session-start" } + { + "hooks": [ + { "type": "command", "command": "npx ruvector hooks session-start" } + ] + } ], "Stop": [ - { "type": "command", "command": "npx ruvector hooks session-end" } + { + "hooks": [ + { "type": "command", "command": "npx ruvector hooks session-end" } + ] + } ], "PreCompact": [ { diff --git a/npm/packages/ruvector/bin/cli.js b/npm/packages/ruvector/bin/cli.js index 935258da..b49d4f33 100755 --- a/npm/packages/ruvector/bin/cli.js +++ b/npm/packages/ruvector/bin/cli.js @@ -2277,15 +2277,15 @@ hooksCmd.command('init').description('Initialize hooks in current project').opti } settings.hooks = settings.hooks || {}; settings.hooks.PreToolUse = [ - { matcher: { tools: ['Edit', 'Write', 'MultiEdit'] }, hooks: [{ type: 'command', command: 'npx ruvector hooks pre-edit "$TOOL_INPUT_file_path"' }] }, - { matcher: { tools: ['Bash'] }, hooks: [{ type: 'command', command: 'npx ruvector hooks pre-command "$TOOL_INPUT_command"' }] } + { matcher: 'Edit|Write|MultiEdit', hooks: [{ type: 'command', command: 'npx ruvector hooks pre-edit "$TOOL_INPUT_file_path"' }] }, + { matcher: 'Bash', hooks: [{ type: 'command', command: 'npx ruvector hooks pre-command "$TOOL_INPUT_command"' }] } ]; settings.hooks.PostToolUse = [ - { matcher: { tools: ['Edit', 'Write', 'MultiEdit'] }, hooks: [{ type: 'command', command: 'npx ruvector hooks post-edit "$TOOL_INPUT_file_path"' }] }, - { matcher: { tools: ['Bash'] }, hooks: [{ type: 'command', command: 'npx ruvector hooks post-command "$TOOL_INPUT_command"' }] } + { matcher: 'Edit|Write|MultiEdit', hooks: [{ type: 'command', command: 'npx ruvector hooks post-edit "$TOOL_INPUT_file_path"' }] }, + { matcher: 'Bash', hooks: [{ type: 'command', command: 'npx ruvector hooks post-command "$TOOL_INPUT_command"' }] } ]; - settings.hooks.SessionStart = [{ type: 'command', command: 'npx ruvector hooks session-start' }]; - settings.hooks.Stop = [{ type: 'command', command: 'npx ruvector hooks session-end' }]; + settings.hooks.SessionStart = [{ hooks: [{ type: 'command', command: 'npx ruvector hooks session-start' }] }]; + settings.hooks.Stop = [{ hooks: [{ type: 'command', command: 'npx ruvector hooks session-end' }] }]; fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2)); console.log(chalk.green('✅ Hooks initialized in .claude/settings.json')); }); diff --git a/npm/packages/ruvector/package.json b/npm/packages/ruvector/package.json index 8869d45e..81d1530b 100644 --- a/npm/packages/ruvector/package.json +++ b/npm/packages/ruvector/package.json @@ -1,6 +1,6 @@ { "name": "ruvector", - "version": "0.1.41", + "version": "0.1.42", "description": "High-performance vector database for Node.js with automatic native/WASM fallback", "main": "dist/index.js", "types": "dist/index.d.ts",