{"modulePath":"github.com/lichdotdev/lich","version":"v0.94.0-rc.5","isLatest":false,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package codexhooks\n\nPackage codexhooks reads Codex's hooks/list, the app-server's account of each hook and whether the person trusted it (measured on 0.170.0), which a Codex chat and a Codex terminal session both read.\n\n## Functions\n\n```go\nfunc LichTrust(list List) string\n```\nLichTrust is the trust of a lich-plugin PreToolUse hook Codex is not running because its content changed or was never trusted, \"\" when every one is trusted or none is installed. Codex runs such a hook not at all and says nothing (docs/hooks/subagent-cards.md, Known ceilings), so its subagents stay native.\n\n```go\nfunc TrustLich(ctx context.Context, cmd *exec.Cmd, cwd string) (int, error)\n```\nTrustLich trusts every lich-plugin hook Codex holds as untrusted or modified (LichTrust's states), through cmd, a \\`codex app-server\\` not yet started: the same hooks.state write a Codex chat's /hooks makes, for lich's own hooks alone, so a session runs them with no /hooks step. It reports how many it trusted.\n\n## Types\n\n```go\ntype Hook struct {\n\tKey       string `json:\"key\"`\n\tEvent     string `json:\"eventName\"`\n\tType      string `json:\"handlerType\"`\n\tMatcher   string `json:\"matcher\"`\n\tCommand   string `json:\"command\"`\n\tTimeout   int    `json:\"timeoutSec\"`\n\tStatus    string `json:\"statusMessage\"`\n\tSource    string `json:\"source\"`\n\tPlugin    string `json:\"pluginId\"`\n\tEnabled   bool   `json:\"enabled\"`\n\tIsManaged bool   `json:\"isManaged\"`\n\tHash      string `json:\"currentHash\"`\n\tTrust     string `json:\"trustStatus\"`\n}\n```\nHook is one hooks/list entry.\n\n```go\ntype List struct {\n\tData []struct {\n\t\tHooks  []Hook `json:\"hooks\"`\n\t\tErrors []struct {\n\t\t\tMessage string `json:\"message\"`\n\t\t\tPath    string `json:\"path\"`\n\t\t} `json:\"errors\"`\n\t} `json:\"data\"`\n}\n```\nList is hooks/list's answer.\n\n```go\nfunc Probe(ctx context.Context, cmd *exec.Cmd, cwd string) (List, error)\n```\nProbe reads hooks/list for cwd through cmd, a \\`codex app-server\\` not yet started, and ends it: the app-server's stdio JSON-RPC, initialize then hooks/list, nothing written to Codex's config.\n\n","path":"github.com/lichdotdev/lich/internal/codexhooks","name":"codexhooks","synopsis":"Package codexhooks reads Codex's hooks/list, the app-server's account of each hook and whether the person trusted it (measured on 0.170.0), which a Codex chat and a Codex terminal session both read.","isRedistributable":true}
