Class: ClaudeHooks::UserPromptExpansion
- Inherits:
-
Base
- Object
- Base
- ClaudeHooks::UserPromptExpansion
show all
- Defined in:
- lib/claude_hooks/user_prompt_expansion.rb
Constant Summary
Constants inherited
from Base
Base::COMMON_INPUT_FIELDS
Instance Attribute Summary
Attributes inherited from Base
#config, #input_data, #logger, #output, #output_data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#agent_id, #agent_type, #allow_continue!, #base_dir, #call, #clear_specifics!, #clear_system_message!, #cwd, #effort, #home_claude_dir, #home_path_for, #hook_event_name, #hook_type, #initialize, #log, #output_and_exit, #path_for, #permission_mode, #prevent_continue!, #project_claude_dir, #project_path_for, #prompt_id, #read_transcript, #session_id, #show_output!, #stringify_output, #suppress_output!, #system_message!, #terminal_sequence, #terminal_sequence!, #transcript_path
Class Method Details
.hook_type ⇒ Object
7
8
9
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 7
def self.hook_type
'UserPromptExpansion'
end
|
11
12
13
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 11
def self.input_fields
%w[expansion_type command_name command_args command_source prompt]
end
|
Instance Method Details
#add_additional_context!(context) ⇒ Object
40
41
42
43
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 40
def add_additional_context!(context)
@output_data['hookSpecificOutput'] ||= { 'hookEventName' => hook_event_name }
@output_data['hookSpecificOutput']['additionalContext'] = context
end
|
#block!(reason = '') ⇒ Object
35
36
37
38
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 35
def block!(reason = '')
@output_data['decision'] = 'block'
@output_data['reason'] = reason
end
|
#command_args ⇒ Object
23
24
25
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 23
def command_args
@input_data['command_args'] || @input_data['commandArgs']
end
|
#command_name ⇒ Object
19
20
21
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 19
def command_name
@input_data['command_name'] || @input_data['commandName']
end
|
#command_source ⇒ Object
27
28
29
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 27
def command_source
@input_data['command_source'] || @input_data['commandSource']
end
|
#expansion_type ⇒ Object
15
16
17
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 15
def expansion_type
@input_data['expansion_type'] || @input_data['expansionType']
end
|
#prompt ⇒ Object
31
32
33
|
# File 'lib/claude_hooks/user_prompt_expansion.rb', line 31
def prompt
@input_data['prompt']
end
|