app

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(version, command string, args []string, stdout, stderr io.Writer, stdin io.Reader) int

Main dispatches CLI commands and returns the process exit code.

func PrintUsage

func PrintUsage(w io.Writer)

Types

type RedactionResult added in v0.1.20

type RedactionResult struct {
	Content          []byte
	Counts           map[string]int
	RuntimeTokenLeak bool
}

RedactionResult is the outcome of redacting a transcript. Counts holds the number of redactions per routine pattern. RuntimeTokenLeak reports whether a Kei runtime token (KEI_RUNTIME_TOKEN or kh_live_*) was found; such a value is a leak, not a routine redaction, so it is reported separately and never folded into Counts.

func RedactTranscript added in v0.1.20

func RedactTranscript(content []byte) RedactionResult

RedactTranscript redacts known secret patterns from content and returns the redacted content, a count of redactions per routine pattern, and whether a Kei runtime token leak was detected.

type TranscriptDeps added in v0.1.20

type TranscriptDeps struct {
	HomeDir  string
	Cwd      string
	CacheDir string
	// Getenv resolves an environment variable for harness config directories
	// (CODEX_HOME, CLAUDE_CONFIG_DIR). Nil returns empty.
	Getenv func(string) string
	// RunCmd executes a harness command and returns its stdout.
	RunCmd func(ctx context.Context, name string, args ...string) ([]byte, error)
	// ReadFile reads a transcript file. The export path is the only place a
	// transcript is read; it never reads the Kei config or the keychain.
	// Tests inject a recording opener to prove the config path is never opened.
	ReadFile func(path string) ([]byte, error)
}

TranscriptDeps holds the injectable dependencies used by the transcript locators. Tests substitute HomeDir, Cwd, CacheDir, RunCmd and ReadFile with fixtures so no real home directory, harness binary, or config file is ever touched.

type TranscriptLocator added in v0.1.20

type TranscriptLocator interface {
	// Kind returns the harness kind: claude, codex, or opencode.
	Kind() string
	// Locate returns the path to the transcript file for sessionID. When
	// sessionID is empty it selects the most recent session for the current
	// working directory. The returned path may be a temporary file (opencode).
	Locate(ctx context.Context, sessionID string) (string, error)
}

TranscriptLocator locates a harness session transcript on disk.

Jump to

Keyboard shortcuts

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