Documentation
¶
Overview ¶
Package hookinstall provides the core logic for `openclaw-cortex hook install`. It is a separate package so the cmd layer can delegate to it and the tests/ package can exercise the logic without importing package main.
Index ¶
Constants ¶
const ( // EventUserPromptSubmit is the Claude Code hook event fired when the user submits a prompt. EventUserPromptSubmit = "UserPromptSubmit" // EventStop is the Claude Code hook event fired when the assistant stops generating. EventStop = "Stop" // BinaryName is the name of the openclaw-cortex binary. BinaryName = "openclaw-cortex" )
Variables ¶
This section is empty.
Functions ¶
func DefaultHookConfig ¶
func DefaultHookConfig() map[string][]HookMatcher
DefaultHookConfig returns the hook matchers to inject for each event.
func Install ¶
Install reads the settings file at path (creating it if absent), merges the openclaw-cortex hook configuration, and writes the result back. It returns true when the file was modified and false when it was already up to date.
func ResolveSettingsPath ¶
ResolveSettingsPath returns the absolute path to the Claude Code settings.json given whether the global flag was set.
Types ¶
type HookMatcher ¶
HookMatcher represents a matcher+hooks pair in the Claude Code settings.