Add OpenCode hook support with automatic event normalization#6
Open
terraboops wants to merge 2 commits intomainfrom
Open
Add OpenCode hook support with automatic event normalization#6terraboops wants to merge 2 commits intomainfrom
terraboops wants to merge 2 commits intomainfrom
Conversation
OpenCode events (tool.execute.before, session.idle, file.edited, etc.) are now auto-detected and mapped to internal hook names (PreToolUse, Stop, FileEdited, etc.), so existing match rules and handlers work transparently with both Claude Code and OpenCode. - Add src/hooks/opencode.rs with event mapping, detection, and new FileEdited/SessionError hook types - Normalize OpenCode events in Event::from_json() by injecting hook_event_name for downstream matchers - Extend config resolution to check OPENCODE_PROJECT_DIR and .opencode/boopifier.json paths - Update README with OpenCode setup guide and event mapping table https://claude.ai/code/session_015Q9X2qEKwAjYzy2EQ3aKGg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenCode events (tool.execute.before, session.idle, file.edited, etc.)
are now auto-detected and mapped to internal hook names (PreToolUse, Stop,
FileEdited, etc.), so existing match rules and handlers work transparently
with both Claude Code and OpenCode.
FileEdited/SessionError hook types
hook_event_name for downstream matchers
.opencode/boopifier.json paths
https://claude.ai/code/session_015Q9X2qEKwAjYzy2EQ3aKGg