codexapp

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 17 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

View Source
const AgentID = "codex-app"

Variables

This section is empty.

Functions

func Available

func Available(path string) bool

func LookupPath added in v0.1.6

func LookupPath(path string) (string, error)

func Version added in v0.1.6

func Version(ctx context.Context, path string) string

Types

type Agent

type Agent struct {
	Path    string
	Enabled bool
}

func (Agent) Aliases added in v0.1.5

func (a Agent) Aliases() []string

func (Agent) Available

func (a Agent) Available(ctx context.Context) externalagents.Availability

func (Agent) Capabilities added in v0.1.9

func (a Agent) Capabilities() externalagents.Capabilities

func (Agent) DisplayName

func (a Agent) DisplayName() string

func (Agent) ID

func (a Agent) ID() string

func (Agent) Models added in v0.1.12

func (a Agent) Models(context.Context) []string

type AgentMessageDelta

type AgentMessageDelta struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
	ItemID   string `json:"itemId"`
	Delta    string `json:"delta"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn Conn) *Client

func Start

func Start(ctx context.Context, opts ProcessOptions) (*Client, error)

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, params any, out any) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Err

func (c *Client) Err() error

func (*Client) Events

func (c *Client) Events() <-chan Notification

func (*Client) Initialize

func (c *Client) Initialize(ctx context.Context, params InitializeParams) (InitializeResponse, error)

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, method string, params any) error

func (*Client) ResumeThread

func (c *Client) ResumeThread(ctx context.Context, params ThreadResumeParams) (ThreadResumeResponse, error)

func (*Client) StartThread

func (c *Client) StartThread(ctx context.Context, params ThreadStartParams) (ThreadStartResponse, error)

func (*Client) StartTurn

func (c *Client) StartTurn(ctx context.Context, params TurnStartParams) (TurnStartResponse, error)

func (*Client) SteerTurn

func (c *Client) SteerTurn(ctx context.Context, params TurnSteerParams) (TurnSteerResponse, error)

type ClientInfo

type ClientInfo struct {
	Name    string  `json:"name"`
	Title   *string `json:"title"`
	Version string  `json:"version"`
}

type Conn

type Conn interface {
	io.Reader
	io.Writer
	io.Closer
}

type FileChangePatchUpdated added in v0.1.5

type FileChangePatchUpdated struct {
	ThreadID string             `json:"threadId"`
	TurnID   string             `json:"turnId"`
	ItemID   string             `json:"itemId"`
	Changes  []FileUpdateChange `json:"changes"`
}

type FileUpdateChange added in v0.1.5

type FileUpdateChange struct {
	Path string          `json:"path"`
	Diff string          `json:"diff"`
	Kind json.RawMessage `json:"kind"`
}

type InitializeCapabilities

type InitializeCapabilities struct {
	ExperimentalAPI           bool     `json:"experimentalApi"`
	OptOutNotificationMethods []string `json:"optOutNotificationMethods,omitempty"`
}

type InitializeParams

type InitializeParams struct {
	ClientInfo   ClientInfo              `json:"clientInfo"`
	Capabilities *InitializeCapabilities `json:"capabilities"`
}

type InitializeResponse

type InitializeResponse struct {
	UserAgent      string `json:"userAgent"`
	CodexHome      string `json:"codexHome"`
	PlatformFamily string `json:"platformFamily"`
	PlatformOS     string `json:"platformOs"`
}

type ItemNotification added in v0.1.5

type ItemNotification struct {
	ThreadID string          `json:"threadId"`
	TurnID   string          `json:"turnId"`
	Item     json.RawMessage `json:"item"`
}

type Notification

type Notification struct {
	Method string
	Params any
	Raw    []byte
}

type ProcessOptions

type ProcessOptions struct {
	Path   string
	Args   []string
	Stderr io.Writer
}

type ReasoningTextDelta added in v0.1.5

type ReasoningTextDelta struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
	ItemID   string `json:"itemId"`
	Delta    string `json:"delta"`
}

type Runtime

type Runtime struct {
	Agent
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(opts RuntimeOptions) *Runtime

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) Interrupt

func (*Runtime) ResumeSession

func (*Runtime) Send

type RuntimeOptions

type RuntimeOptions struct {
	Path    string
	Enabled bool
	Stderr  io.Writer
	Client  *Client
}

type TextElement

type TextElement struct{}

type Thread

type Thread struct {
	ID            string  `json:"id"`
	SessionID     string  `json:"sessionId"`
	ForkedFromID  *string `json:"forkedFromId"`
	Preview       string  `json:"preview"`
	Ephemeral     bool    `json:"ephemeral"`
	ModelProvider string  `json:"modelProvider"`
	CreatedAt     int64   `json:"createdAt"`
	UpdatedAt     int64   `json:"updatedAt"`
	Status        any     `json:"status"`
	Path          *string `json:"path"`
	CWD           string  `json:"cwd"`
	CLIVersion    string  `json:"cliVersion"`
	Name          *string `json:"name"`
}

type ThreadResumeParams

type ThreadResumeParams struct {
	ThreadID              string         `json:"threadId"`
	Model                 string         `json:"model,omitempty"`
	ModelProvider         string         `json:"modelProvider,omitempty"`
	CWD                   string         `json:"cwd,omitempty"`
	ApprovalPolicy        string         `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer     string         `json:"approvalsReviewer,omitempty"`
	Sandbox               string         `json:"sandbox,omitempty"`
	BaseInstructions      string         `json:"baseInstructions,omitempty"`
	DeveloperInstructions string         `json:"developerInstructions,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
}

type ThreadResumeResponse

type ThreadResumeResponse = ThreadStartResponse

type ThreadStartParams

type ThreadStartParams struct {
	Model                 string         `json:"model,omitempty"`
	ModelProvider         string         `json:"modelProvider,omitempty"`
	CWD                   string         `json:"cwd,omitempty"`
	ApprovalPolicy        string         `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer     string         `json:"approvalsReviewer,omitempty"`
	Sandbox               string         `json:"sandbox,omitempty"`
	BaseInstructions      string         `json:"baseInstructions,omitempty"`
	DeveloperInstructions string         `json:"developerInstructions,omitempty"`
	Ephemeral             *bool          `json:"ephemeral,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
}

type ThreadStartResponse

type ThreadStartResponse struct {
	Thread          Thread  `json:"thread"`
	Model           string  `json:"model"`
	ModelProvider   string  `json:"modelProvider"`
	ServiceTier     *string `json:"serviceTier"`
	CWD             string  `json:"cwd"`
	ApprovalPolicy  string  `json:"approvalPolicy"`
	Sandbox         any     `json:"sandbox"`
	ReasoningEffort *string `json:"reasoningEffort"`
}

type ToolOutputDelta added in v0.1.5

type ToolOutputDelta struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
	ItemID   string `json:"itemId"`
	Delta    string `json:"delta"`
}

type Turn

type Turn struct {
	ID        string `json:"id"`
	ThreadID  string `json:"threadId,omitempty"`
	Status    any    `json:"status"`
	StartedAt int64  `json:"startedAt,omitempty"`
}

type TurnCompleted

type TurnCompleted struct {
	ThreadID string `json:"threadId"`
	Turn     Turn   `json:"turn"`
}

type TurnStartParams

type TurnStartParams struct {
	ThreadID          string      `json:"threadId"`
	Input             []UserInput `json:"input"`
	CWD               string      `json:"cwd,omitempty"`
	ApprovalPolicy    string      `json:"approvalPolicy,omitempty"`
	ApprovalsReviewer string      `json:"approvalsReviewer,omitempty"`
	Model             string      `json:"model,omitempty"`
	Effort            string      `json:"effort,omitempty"`
	Summary           string      `json:"summary,omitempty"`
	OutputSchema      any         `json:"outputSchema,omitempty"`
}

type TurnStartResponse

type TurnStartResponse struct {
	Turn Turn `json:"turn"`
}

type TurnSteerParams

type TurnSteerParams struct {
	ThreadID       string      `json:"threadId"`
	ExpectedTurnID string      `json:"expectedTurnId"`
	Input          []UserInput `json:"input"`
}

type TurnSteerResponse

type TurnSteerResponse struct{}

type UserInput

type UserInput struct {
	Type         string        `json:"type"`
	Text         string        `json:"text,omitempty"`
	TextElements []TextElement `json:"text_elements,omitempty"`
	URL          string        `json:"url,omitempty"`
	Path         string        `json:"path,omitempty"`
	Name         string        `json:"name,omitempty"`
}

func TextInput

func TextInput(text string) UserInput

Jump to

Keyboard shortcuts

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