codex

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: 20 Imported by: 0

Documentation

Overview

Package codex implements the Codex CLI foreign-agent driver. NewAgent resolves provider configuration and an explicitly supplied parent environment into a driver.Agent. Per-turn cwd, prompt, and session selection remain owned by driver.Turn. Codex v1 streams expose normalized live events and explicitly unavailable authoritative history.

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 ApprovalPolicy

type ApprovalPolicy uint8

ApprovalPolicy is the typed Codex CLI approval policy.

const (
	ApprovalUntrusted ApprovalPolicy = iota
	ApprovalOnRequest
	ApprovalNever
)

type Config

type Config struct {
	ExecPath         string
	Model            string
	Profile          string
	AdditionalDirs   []string
	Sandbox          SandboxMode
	Approval         ApprovalPolicy
	EnvAllow         []string
	Credential       map[string]string
	IgnoreUserConfig bool
	IgnoreRules      bool
	SkipGitRepoCheck bool
}

Config is the provider-owned configuration used to construct a Codex agent. Turn-owned cwd 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 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 SandboxMode

type SandboxMode uint8

SandboxMode is the typed Codex CLI sandbox mode.

const (
	SandboxReadOnly SandboxMode = iota
	SandboxWorkspaceWrite
	SandboxDangerFullAccess
)

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

Jump to

Keyboard shortcuts

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