install

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(o Options) error

func BinaryPath

func BinaryPath(path string) (string, error)

func CodexHash

func CodexHash(matcher *string, raw string) (string, error)

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 Doctor

func Doctor(dbPath, dir string, out io.Writer) (bool, error)

func InstalledGuards added in v0.4.0

func InstalledGuards(dbPath string) ([]string, error)

InstalledGuards lists the guard names of installed wrappers, reading the database only if it exists.

func ListBackups

func ListBackups(out io.Writer) error

Types

type CodexHook

type CodexHook struct {
	Key        string `json:"key"`
	Hash       string `json:"currentHash"`
	Trust      string `json:"trustStatus"`
	Enabled    bool   `json:"enabled"`
	SourcePath string `json:"sourcePath"`
	Event      string `json:"eventName"`
}

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.

type LastHit added in v0.4.0

type LastHit struct {
	TS      string `json:"ts"`
	Outcome string `json:"outcome"`
}

type Manifest

type Manifest struct {
	ID                                 int64
	Harness, Scope, Target, Event      string
	GroupIndex, HandlerIndex           int
	Guard, Original, Wrapped, TrustKey string
	PriorTrust                         *string
	InstalledAt, Version               string
	FailOpen                           bool
	SourceTarget                       string
}

type Options

type Options struct {
	Harness, Scope, Dir, Guard, Record, DB, Version, Binary, WrapDB string
	Only, Except, FailOpen                                          []string
	Timeout                                                         int
	NoFailClosed, DryRun, List, Uninstall, Restore                  bool
	Out                                                             io.Writer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL