Documentation
¶
Overview ¶
internal/hooks/hooks.go 钩子系统:preToolUse / postToolUse 事件
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookDef ¶
type HookDef struct {
Match string `json:"match"` // 匹配的工具名(空表示匹配所有)
Command string `json:"command"` // 要执行的 shell 命令
}
HookDef 单个钩子定义
type HooksConfig ¶
type HooksConfig struct {
PreToolUse []HookDef `json:"preToolUse,omitempty"`
PostToolUse []HookDef `json:"postToolUse,omitempty"`
}
HooksConfig 钩子配置(从 settings.json 读取)
func LoadConfig ¶
func LoadConfig(settingsPath string) HooksConfig
LoadConfig 从 settings.json 加载钩子配置
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 钩子管理器
func (*Manager) RunPostToolUse ¶
RunPostToolUse 执行 postToolUse 钩子
Click to show internal directories.
Click to hide internal directories.