Documentation
¶
Index ¶
- func Apply(o Options) error
- func BinaryPath(path string) (string, error)
- func CodexHash(matcher *string, raw string) (string, error)
- func Doctor(dbPath, dir string, out io.Writer) (bool, error)
- func InstalledGuards(dbPath string) ([]string, error)
- func ListBackups(out io.Writer) error
- type CodexHook
- type CodexListing
- type FileStatus
- type HookStatus
- type LastHit
- type Manifest
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryPath ¶
func CodexHash ¶
CodexHash ports discovery.rs hook_hash and handler normalization, followed by config/fingerprint.rs version_for_toml, at rust-v0.171.0. TOML omits None fields.
func InstalledGuards ¶ added in v0.4.0
InstalledGuards lists the guard names of installed wrappers, reading the database only if it exists.
func ListBackups ¶
Types ¶
type CodexListing ¶
type CodexListing struct {
Hooks []CodexHook `json:"hooks"`
Errors []struct {
Message string `json:"message"`
} `json:"errors"`
Warnings []string `json:"warnings"`
}
func CodexInspect ¶
func CodexInspect(dir string) ([]CodexListing, map[string]any, error)
CodexInspect asks the installed engine to resolve configuration layers and managed requirements. It makes no model request and runs no guard.
type FileStatus ¶ added in v0.4.0
type FileStatus struct {
Harness string `json:"harness"`
Scope string `json:"scope"`
Path string `json:"path"`
Exists bool `json:"exists"`
Error string `json:"error,omitempty"`
Hooks []HookStatus `json:"hooks"`
}
FileStatus describes one hook file that applies to a directory.
func Status ¶ added in v0.4.0
func Status(dbPath, dir string) ([]FileStatus, error)
Status reports every hook file that applies when an agent works in dir: project and local files for dir, and the user's own files. It reads the database only if it exists and never changes anything.
type HookStatus ¶ added in v0.4.0
type HookStatus struct {
Line int `json:"line"`
Matcher string `json:"matcher"`
Command string `json:"command"`
Wrapped bool `json:"wrapped"`
Guard string `json:"guard,omitempty"`
FailOpen bool `json:"fail_open,omitempty"`
Problem string `json:"problem,omitempty"`
LastHit *LastHit `json:"last_hit,omitempty"`
// WrapCommand installs blotter around an unwrapped hook.
WrapCommand string `json:"wrap_command,omitempty"`
// WrapAlsoMatches counts other unwrapped hooks WrapCommand would select.
WrapAlsoMatches int `json:"wrap_also_matches,omitempty"`
}
HookStatus describes one PreToolUse command hook and where it is defined.