feat(shared): add Claude hooks command executor and utilities
- Add snake-case.ts: objectToSnakeCase, objectToCamelCase utilities - Add tool-name.ts: transformToolName with PascalCase conversion - Add pattern-matcher.ts: findMatchingHooks for hook config matching - Add hook-disabled.ts: isHookDisabled for hook config validation - Add temporary stub types at src/hooks/claude-code-hooks/types.ts - Export all new utilities from src/shared/index.ts Stub types will be replaced with full implementation in Task 1. Import paths adjusted from opencode-cc-plugin structure to oh-my-opencode. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
25
src/hooks/claude-code-hooks/types.ts
Normal file
25
src/hooks/claude-code-hooks/types.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// Temporary stub types for Task 0 - will be fully implemented in Task 1
|
||||
// These are minimal definitions to allow shared utilities to type-check
|
||||
|
||||
export interface HookCommand {
|
||||
type: string
|
||||
command: string
|
||||
}
|
||||
|
||||
export interface HookMatcher {
|
||||
matcher: string
|
||||
hooks: HookCommand[]
|
||||
}
|
||||
|
||||
export interface ClaudeHooksConfig {
|
||||
PreToolUse?: HookMatcher[]
|
||||
PostToolUse?: HookMatcher[]
|
||||
UserPromptSubmit?: HookMatcher[]
|
||||
Stop?: HookMatcher[]
|
||||
}
|
||||
|
||||
export type ClaudeHookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop"
|
||||
|
||||
export interface PluginConfig {
|
||||
disabledHooks?: boolean | ClaudeHookEvent[]
|
||||
}
|
||||
Reference in New Issue
Block a user