claude

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package claude implements the Claude CLI foreign-agent driver.

NewAgent resolves provider configuration and an explicitly supplied parent environment into a driver.Agent. Per-turn cwd, posture, prompt, and session selection remain owned by driver.Turn. Spawned streams expose normalized live events and complete authoritative Claude transcript history without exposing transcript paths through the public driver contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent

func NewAgent(parentEnv []string, cfg Config) (driver.Agent, error)

NewAgent resolves provider configuration and a caller-supplied parent environment into an agent. It never reads the ambient process environment.

Types

type CommandWrapper

type CommandWrapper func(*exec.Cmd) (*exec.Cmd, error)

CommandWrapper confines a fully configured child command before pipe attachment and process start.

type Config

type Config struct {
	ExecPath   string
	Home       string
	Model      string
	EnvAllow   []string
	Credential map[string]string
	Wrap       CommandWrapper
}

Config is the provider-owned configuration used to construct a Claude agent. Turn-owned cwd, posture, and session selection are supplied to Agent.Spawn.

type ConfigError

type ConfigError struct{ Field, Reason string }

ConfigError reports invalid provider configuration at construction time.

func (*ConfigError) Error

func (e *ConfigError) Error() string

type PathError

type PathError struct{ Reason string }

PathError reports fail-closed transcript-path derivation.

func (*PathError) Error

func (e *PathError) Error() string

type PlatformError

type PlatformError struct{ GOOS string }

PlatformError reports an OS without the required process-group supervision.

func (*PlatformError) Error

func (e *PlatformError) Error() string

type SpawnConfigError

type SpawnConfigError struct{ Field, Reason string }

SpawnConfigError reports invalid internal agent state discovered before a child is started. NewAgent prevents callers from constructing this state.

func (*SpawnConfigError) Error

func (e *SpawnConfigError) Error() string

type WrapError

type WrapError struct{ Cause error }

WrapError reports a wrapper failure while retaining the underlying cause.

func (*WrapError) Error

func (e *WrapError) Error() string

func (*WrapError) Unwrap

func (e *WrapError) Unwrap() error

Jump to

Keyboard shortcuts

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