appserver

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 19 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

Overview

The record of the app server protocol of the Codex program and the client of it: the messages icebath sends and reads, as `codex app-server` speaks them on its standard streams. Their shapes are those of codex-rs/app-server-protocol in the Codex repository at rust-v0.125.0, the oldest release the runtime takes, and at the newest; a field a later release added says so

Index

Constants

View Source
const (
	MethodInitialize        = "initialize"
	MethodThreadStart       = "thread/start"
	MethodThreadResume      = "thread/resume"
	MethodThreadArchive     = "thread/archive"
	MethodThreadDelete      = "thread/delete"
	MethodThreadName        = "thread/name/set"
	MethodThreadCompact     = "thread/compact/start"
	MethodTurnStart         = "turn/start"
	MethodTurnSteer         = "turn/steer"
	MethodTurnInterrupt     = "turn/interrupt"
	MethodModelList         = "model/list"
	MethodAccountRead       = "account/read"
	MethodAccountLogin      = "account/login/start"
	MethodAccountLoginStop  = "account/login/cancel"
	MethodAccountLogout     = "account/logout"
	MethodAccountRateLimits = "account/rateLimits/read"
	MethodPluginList        = "plugin/list"
	MethodMCPServerStatus   = "mcpServerStatus/list"
)

Requests icebath makes of the program

View Source
const (
	AskCommand     = "item/commandExecution/requestApproval"
	AskFileChange  = "item/fileChange/requestApproval"
	AskPermissions = "item/permissions/requestApproval"
	AskUserInput   = "item/tool/requestUserInput"
	AskToolCall    = "item/tool/call"
	AskElicitation = "mcpServer/elicitation/request"
	AskTokens      = "account/chatgptAuthTokens/refresh"
	AskAttestation = "attestation/generate"
	// The approvals of the program's first protocol, which a thread started over the second never asks, answered all the same
	AskV1Command = "execCommandApproval"
	AskV1Patch   = "applyPatchApproval"
)

Requests the program makes of icebath

View Source
const (
	NoticeError           = "error"
	NoticeWarning         = "warning"
	NoticeConfigWarning   = "configWarning"
	NoticeDeprecation     = "deprecationNotice"
	NoticeThreadStarted   = "thread/started"
	NoticeTurnStarted     = "turn/started"
	NoticeTurnCompleted   = "turn/completed"
	NoticeTurnDiff        = "turn/diff/updated"
	NoticeTurnPlan        = "turn/plan/updated"
	NoticeItemStarted     = "item/started"
	NoticeItemCompleted   = "item/completed"
	NoticeAgentDelta      = "item/agentMessage/delta"
	NoticePlanDelta       = "item/plan/delta"
	NoticeReasoningDelta  = "item/reasoning/textDelta"
	NoticeSummaryDelta    = "item/reasoning/summaryTextDelta"
	NoticeSummaryPart     = "item/reasoning/summaryPartAdded"
	NoticeCommandOutput   = "item/commandExecution/outputDelta"
	NoticeFileChangeDelta = "item/fileChange/outputDelta"
	NoticePatchUpdated    = "item/fileChange/patchUpdated"
	NoticeMCPProgress     = "item/mcpToolCall/progress"
	NoticeTokenUsage      = "thread/tokenUsage/updated"
	NoticeCompacted       = "thread/compacted"
	NoticeRateLimits      = "account/rateLimits/updated"
	NoticeRerouted        = "model/rerouted"
	NoticeLoginCompleted  = "account/login/completed"
	NoticeAccountUpdated  = "account/updated"
	NoticeRequestResolved = "serverRequest/resolved"
)

What the program tells icebath

View Source
const (
	CodeInvalidRequest = -32600
	CodeMethodNotFound = -32601
	CodeInvalidParams  = -32602
	CodeInternal       = -32603
)

Error codes of the protocol

View Source
const (
	InputText       = "text"
	InputImage      = "image"
	InputLocalImage = "localImage"
)

Kinds of input

View Source
const (
	TurnCompleted   = "completed"
	TurnInterrupted = "interrupted"
	TurnFailed      = "failed"
)

How a turn ended

View Source
const (
	ItemUserMessage   = "userMessage"
	ItemAgentMessage  = "agentMessage"
	ItemPlan          = "plan"
	ItemReasoning     = "reasoning"
	ItemCommand       = "commandExecution"
	ItemFileChange    = "fileChange"
	ItemMCPToolCall   = "mcpToolCall"
	ItemDynamicTool   = "dynamicToolCall"
	ItemCollabAgent   = "collabAgentToolCall"
	ItemWebSearch     = "webSearch"
	ItemImageView     = "imageView"
	ItemImageMade     = "imageGeneration"
	ItemEnteredReview = "enteredReviewMode"
	ItemExitedReview  = "exitedReviewMode"
	ItemCompaction    = "contextCompaction"
)

Kinds of items

View Source
const (
	ChangeAdd    = "add"
	ChangeDelete = "delete"
	ChangeUpdate = "update"
)

Kinds of change of a file

View Source
const (
	Accept           = "accept"
	AcceptForSession = "acceptForSession"
	Decline          = "decline"
	Cancel           = "cancel"
)

Answers to an ask of leave

View Source
const (
	ContentText  = "inputText"
	ContentImage = "inputImage"
)

Kinds of the parts of a tool's answer

View Source
const (
	ElicitForm        = "form"
	ElicitURL         = "url"
	ElicitOpenAIForm  = "openai/form"
	ElicitOpenAIForm2 = "openaiForm"
	ElicitVerify      = "openai/userVerification"
)

Kinds of elicitation

View Source
const (
	ElicitAccept  = "accept"
	ElicitDecline = "decline"
	ElicitCancel  = "cancel"
)

Answers to an elicitation

View Source
const (
	LoginAPIKey      = "apiKey"
	LoginChatGPT     = "chatgpt"
	LoginDeviceCode  = "chatgptDeviceCode"
	LoginTokens      = "chatgptAuthTokens"
	AccountChatGPT   = "chatgpt"
	AccountAPIKey    = "apiKey"
	AccountBedrock   = "amazonBedrock"
	AccountGoogleGCP = "gcp"
)

Sign-ins of account/login/start

View Source
const NoticeInitialized = "initialized"

Notification icebath sends once the program answered initialize

View Source
const Purpose = "codex-app-server"

Purpose the ledger of the profile records an app server under

Variables

View Source
var Efforts = Version{0, 138, 0}

Release from which a turn takes any effort its model names, max and ultra among them; those before take none above xhigh

View Source
var Least = Version{0, 125, 0}

Oldest release of Codex the runtime takes: the first whose app server carries every request and answer it uses

View Source
var OlderReasoningDeltas = []string{"item/reasoning/delta", "item/reasoning/summaryDelta"}

Older names of the reasoning deltas, which releases before the second protocol settled sent

View Source
var Rejecting = Version{0, 145, 0}

Release from which a refusal of the first protocol's approvals carries its reason

View Source
var Unsuccessful = []string{"failed", "declined"}

Statuses an item ends with that are no success

Functions

This section is empty.

Types

type AccountResponse

type AccountResponse struct {
	Account *struct {
		Type     string `json:"type"`
		Email    string `json:"email"`
		PlanType string `json:"planType"`
	} `json:"account"`
	RequiresOpenAIAuth bool `json:"requiresOpenaiAuth"`
}

The account the program is signed in with

type AnswerList

type AnswerList struct {
	Answers []string `json:"answers"`
}

type Capabilities

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

What icebath can take: the experimental part of the protocol, which dynamic tools and a sign-in by tokens belong to

type Change

type Change struct {
	Path string     `json:"path"`
	Kind ChangeKind `json:"kind"`
	Diff string     `json:"diff"`
}

One file a fileChange item changes: its path, the kind of change, and the change as text, which is the whole file for a file added or removed and a unified diff for one changed

type ChangeKind

type ChangeKind struct {
	Type     string `json:"type"`
	MovePath string `json:"move_path"`
}

type ClientInfo

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

type CommandAsk

type CommandAsk struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
	ItemID   string `json:"itemId"`
	Reason   string `json:"reason"`
	Command  string `json:"command"`
	Cwd      string `json:"cwd"`
	// Kind of ask, command when absent: humanCommand and writeStdin came after rust-v0.125.0
	Kind    string          `json:"kind"`
	Network *NetworkContext `json:"networkApprovalContext"`
}

The program asks leave to run a command

type ContentItem

type ContentItem struct {
	Type     string `json:"type"`
	Text     string `json:"text,omitempty"`
	ImageURL string `json:"imageUrl,omitempty"`
}

One part of what a tool of icebath's gave back

type Decision

type Decision struct {
	Decision string `json:"decision"`
}

type Delta

type Delta struct {
	ItemID string `json:"itemId"`
	Delta  string `json:"delta"`
	// Older releases put the text here
	Text string `json:"text"`
}

Text of a delta notification

func (Delta) Said

func (d Delta) Said() string

The text the delta carries, wherever the release put it

type DynamicTool

type DynamicTool struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
}

A tool of icebath's the thread is offered, in the flat form every release takes

type ElicitationAnswer

type ElicitationAnswer struct {
	Action  string         `json:"action"`
	Content map[string]any `json:"content"`
	Meta    map[string]any `json:"_meta"`
}

type ElicitationAsk

type ElicitationAsk struct {
	ThreadID   string          `json:"threadId"`
	TurnID     string          `json:"turnId"`
	ServerName string          `json:"serverName"`
	Mode       string          `json:"mode"`
	Message    string          `json:"message"`
	Schema     json.RawMessage `json:"requestedSchema"`
	URL        string          `json:"url"`
	Title      string          `json:"title"`
	Text       string          `json:"description"`
}

A server of the thread's MCP servers asks the person something: a form to fill in, an address to open, or a check of who they are

type Ended

type Ended struct {
	Doing string
	// The end of what it wrote to its standard error, else how it ended
	Said string
}

The program ended before it answered

func (*Ended) Error

func (e *Ended) Error() string

type ErrorNotice

type ErrorNotice struct {
	Error     TurnError `json:"error"`
	WillRetry bool      `json:"willRetry"`
	ThreadID  string    `json:"threadId"`
	TurnID    string    `json:"turnId"`
}

The error notification: a turn's failure, which the program may try again itself

type FileChangeAsk

type FileChangeAsk struct {
	ThreadID  string `json:"threadId"`
	TurnID    string `json:"turnId"`
	ItemID    string `json:"itemId"`
	Reason    string `json:"reason"`
	GrantRoot string `json:"grantRoot"`
}

The program asks leave to change files

type InitializeParams

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

type InitializeResponse

type InitializeResponse struct {
	UserAgent string `json:"userAgent"`
	CodexHome string `json:"codexHome,omitempty"`
}

The program's answer to initialize; codexHome and the platform fields came after rust-v0.125.0

type Input

type Input struct {
	Type string `json:"type"`
	// Of text
	Text         string `json:"text,omitempty"`
	TextElements []any  `json:"text_elements,omitempty"`
	// Of an image by address, data addresses among them, and of a file of this computer
	URL  string `json:"url,omitempty"`
	Path string `json:"path,omitempty"`
}

One part of what the person or icebath gives a turn

func TextInput

func TextInput(text string) Input

Text input, with the empty list of elements the second protocol asks for

type InputOption

type InputOption struct {
	Label       string `json:"label"`
	Description string `json:"description"`
}

type InputQuestion

type InputQuestion struct {
	ID       string        `json:"id"`
	Header   string        `json:"header"`
	Question string        `json:"question"`
	IsOther  bool          `json:"isOther"`
	IsSecret bool          `json:"isSecret"`
	Options  []InputOption `json:"options"`
}

type Item

type Item struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	// agentMessage, plan
	Text  string `json:"text"`
	Phase string `json:"phase"`
	// reasoning
	Summary []string `json:"summary"`
	Content []string `json:"content"`
	// commandExecution
	Command          string `json:"command"`
	Cwd              string `json:"cwd"`
	Status           string `json:"status"`
	AggregatedOutput string `json:"aggregatedOutput"`
	ExitCode         *int   `json:"exitCode"`
	DurationMS       *int64 `json:"durationMs"`
	// fileChange
	Changes []Change `json:"changes"`
	// mcpToolCall, dynamicToolCall
	Server       string          `json:"server"`
	Tool         string          `json:"tool"`
	Arguments    json.RawMessage `json:"arguments"`
	Result       json.RawMessage `json:"result"`
	Error        json.RawMessage `json:"error"`
	ContentItems json.RawMessage `json:"contentItems"`
	Success      *bool           `json:"success"`
	// webSearch, and what the search did, such as a page it opened
	Query  string          `json:"query"`
	Action json.RawMessage `json:"action"`
	// imageView, imageGeneration
	Path          string `json:"path"`
	SavedPath     string `json:"savedPath"`
	RevisedPrompt string `json:"revisedPrompt"`
	// collabAgentToolCall
	Prompt         string                     `json:"prompt"`
	Model          string                     `json:"model"`
	ReceiverThread []string                   `json:"receiverThreadIds"`
	AgentsStates   map[string]json.RawMessage `json:"agentsStates"`
	// enteredReviewMode, exitedReviewMode
	Review string `json:"review"`
	// What the item holds whole, for a kind this record does not name
	Raw json.RawMessage `json:"-"`
}

One item of a thread, as item/started and item/completed carry it: what every kind has, and the fields of each kind

func ReadItem

func ReadItem(raw json.RawMessage) (Item, bool)

The item of a notification, its whole JSON kept beside its fields

type Launch

type Launch struct {
	Command string
	Dir     string
	Env     map[string]string
	Log     string
	Config  *config.Config
}

What starts an app server: the program, the folder it runs in, its environment, the log its standard error goes to, and the settings of the profile it runs for

type ListParams

type ListParams struct {
	Cursor string `json:"cursor,omitempty"`
}

type LoginCompleted

type LoginCompleted struct {
	LoginID string `json:"loginId"`
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

How a sign-in the program ran ended

type LoginParams

type LoginParams struct {
	Type        string  `json:"type"`
	APIKey      string  `json:"apiKey,omitempty"`
	AccessToken string  `json:"accessToken,omitempty"`
	AccountID   string  `json:"chatgptAccountId,omitempty"`
	PlanType    *string `json:"chatgptPlanType,omitempty"`
}

Parameters of account/login/start for each way of signing in

type LoginResponse

type LoginResponse struct {
	Type            string `json:"type"`
	LoginID         string `json:"loginId"`
	AuthURL         string `json:"authUrl"`
	VerificationURL string `json:"verificationUrl"`
	UserCode        string `json:"userCode"`
}

Answer of account/login/start: where the person signs in, or the code they type there

type MCPServerList

type MCPServerList struct {
	Data []struct {
		Name    string                     `json:"name"`
		Tools   map[string]json.RawMessage `json:"tools"`
		Auth    string                     `json:"authStatus"`
		Runtime string                     `json:"runtimeStatus"`
		Failure string                     `json:"toolsError"`
	} `json:"data"`
	NextCursor *string `json:"nextCursor"`
}

Codex's own MCP servers and how each stands; runtimeStatus and toolsError came after rust-v0.125.0

type Model

type Model struct {
	ID          string `json:"id"`
	Model       string `json:"model"`
	DisplayName string `json:"displayName"`
	Hidden      bool   `json:"hidden"`
	IsDefault   bool   `json:"isDefault"`
	Efforts     []struct {
		Effort string `json:"reasoningEffort"`
	} `json:"supportedReasoningEfforts"`
}

A model the program offers

type ModelList

type ModelList struct {
	Data       []Model `json:"data"`
	NextCursor *string `json:"nextCursor"`
}

type ModelListParams

type ModelListParams struct {
	Cursor        string `json:"cursor,omitempty"`
	ModelProvider string `json:"modelProvider,omitempty"`
	IncludeHidden bool   `json:"includeHidden,omitempty"`
}

type NetworkContext

type NetworkContext struct {
	Host     string `json:"host"`
	Protocol string `json:"protocol"`
}

type Permissions

type Permissions struct {
	Network *struct {
		Enabled *bool `json:"enabled"`
	} `json:"network"`
	FileSystem *struct {
		Read  []string `json:"read"`
		Write []string `json:"write"`
	} `json:"fileSystem"`
}

What a permissions ask names: the network, and folders by what may be done in them

type PermissionsAnswer

type PermissionsAnswer struct {
	Permissions json.RawMessage `json:"permissions"`
	Scope       string          `json:"scope"`
}

type PermissionsAsk

type PermissionsAsk struct {
	ThreadID    string          `json:"threadId"`
	TurnID      string          `json:"turnId"`
	ItemID      string          `json:"itemId"`
	Cwd         string          `json:"cwd"`
	Reason      string          `json:"reason"`
	Permissions json.RawMessage `json:"permissions"`
}

The program asks for more than its sandbox allows: the network, or folders to read and write

type Plan

type Plan struct {
	Explanation string     `json:"explanation"`
	Plan        []PlanStep `json:"plan"`
}

The plan of a turn as the model last set it

type PlanStep

type PlanStep struct {
	Step   string `json:"step"`
	Status string `json:"status"`
}

type PluginList

type PluginList struct {
	Marketplaces []struct {
		Name    string `json:"name"`
		Plugins []struct {
			Name         string `json:"name"`
			Installed    bool   `json:"installed"`
			Enabled      *bool  `json:"enabled"`
			Availability string `json:"availability"`
		} `json:"plugins"`
	} `json:"marketplaces"`
}

Codex's own plugins, as plugin/list lists them by marketplace; availability came after rust-v0.125.0

type Program

type Program struct {

	// What it answered the handshake with
	Hello InitializeResponse
	// contains filtered or unexported fields
}

An app server icebath started, through the terminal host so it dies with icebath however icebath ends: the program, the connection to it and what it last wrote to its standard error

func Start

func Start(ctx context.Context, tm *terminal.Terminal, l Launch, handler acp.Handler, version string) (*Program, error)

Starts `codex app-server` with its standard streams held by icebath, has it answer the handshake as a client that takes the experimental part of the protocol, and serves what it asks and tells through the handler until it ends

func (*Program) Alive

func (p *Program) Alive() bool

Whether the program still runs

func (*Program) Call

func (p *Program) Call(ctx context.Context, method string, params, result any) error

Asks the program and waits for its answer, read into result unless that is nil; a refusal is an *acp.Error

func (*Program) Close

func (p *Program) Close()

Ends the conversation and the program: nothing more is written to it, which it ends on, and one that goes on is ended with everything it started

func (*Program) Done

func (p *Program) Done() <-chan struct{}

Closed once the program ended

func (*Program) Notify

func (p *Program) Notify(method string, params any) error

Tells the program something it sends no answer to

func (*Program) PID

func (p *Program) PID() int

Process id of the program

func (*Program) Said

func (p *Program) Said() string

Why the program ended, as far as it said: the end of what it wrote to its standard error, else the code it ended with; empty while it runs and said nothing

func (*Program) Settle

func (p *Program) Settle(ctx context.Context) error

Waits until what the program told before now was taken in

func (*Program) Tail

func (p *Program) Tail(lines int) string

The end of what the program wrote to its standard error, every line of it for zero

type RateLimitSnapshot

type RateLimitSnapshot struct {
	LimitName string           `json:"limitName"`
	Primary   *RateLimitWindow `json:"primary"`
	Secondary *RateLimitWindow `json:"secondary"`
	PlanType  string           `json:"planType"`
	Reached   string           `json:"rateLimitReachedType"`
}

type RateLimitWindow

type RateLimitWindow struct {
	UsedPercent int    `json:"usedPercent"`
	Minutes     *int64 `json:"windowDurationMins"`
	ResetsAt    *int64 `json:"resetsAt"`
}

type RateLimits

type RateLimits struct {
	RateLimits RateLimitSnapshot `json:"rateLimits"`
}

Limits of the account as the program reads them

type Rerouted

type Rerouted struct {
	FromModel string `json:"fromModel"`
	ToModel   string `json:"toModel"`
	Reason    string `json:"reason"`
}

The model the program moved a turn to from the one asked for

type Scope

type Scope struct {
	ThreadID string          `json:"threadId"`
	TurnID   string          `json:"turnId"`
	Turn     *Turn           `json:"turn"`
	Item     json.RawMessage `json:"item"`
}

What a notification of a turn says of where it belongs

func (Scope) Turned

func (s Scope) Turned() string

Id of the turn a notification belongs to, from its own field or its turn

type Thread

type Thread struct {
	ID        string `json:"id"`
	SessionID string `json:"sessionId"`
	Name      string `json:"name"`
}

type ThreadNameParams

type ThreadNameParams struct {
	ThreadID string `json:"threadId"`
	Name     string `json:"name"`
}

type ThreadNamed

type ThreadNamed struct {
	ThreadID string `json:"threadId"`
}

type ThreadParams

type ThreadParams struct {
	ThreadID              string         `json:"threadId,omitempty"`
	Model                 string         `json:"model,omitempty"`
	ModelProvider         string         `json:"modelProvider,omitempty"`
	Cwd                   string         `json:"cwd,omitempty"`
	ApprovalPolicy        string         `json:"approvalPolicy,omitempty"`
	Sandbox               string         `json:"sandbox,omitempty"`
	Config                map[string]any `json:"config,omitempty"`
	DeveloperInstructions string         `json:"developerInstructions,omitempty"`
	// Offered at thread/start alone: a thread keeps the tools it started with
	DynamicTools []DynamicTool `json:"dynamicTools,omitempty"`
}

Parameters of thread/start, and of thread/resume with the id of the thread

type ThreadResponse

type ThreadResponse struct {
	Thread        Thread `json:"thread"`
	Model         string `json:"model"`
	ModelProvider string `json:"modelProvider"`
	// Where early releases put the id
	SessionID string `json:"sessionId"`
	ThreadID  string `json:"threadId"`
}

Answer of thread/start and thread/resume: the thread, and the model and provider it runs on

func (ThreadResponse) ID

func (r ThreadResponse) ID() string

Id of the thread an answer names, wherever the release put it

type TokenUsage

type TokenUsage struct {
	TokenUsage struct {
		Total  Tokens `json:"total"`
		Last   Tokens `json:"last"`
		Window int64  `json:"modelContextWindow"`
	} `json:"tokenUsage"`
}

Tokens of the thread: of its last request and in all, and the model's window

type Tokens

type Tokens struct {
	Total      int64 `json:"totalTokens"`
	Input      int64 `json:"inputTokens"`
	Cached     int64 `json:"cachedInputTokens"`
	CacheWrite int64 `json:"cacheWriteInputTokens"`
	Output     int64 `json:"outputTokens"`
	Reasoning  int64 `json:"reasoningOutputTokens"`
}

type TokensAnswer

type TokensAnswer struct {
	AccessToken string  `json:"accessToken"`
	AccountID   string  `json:"chatgptAccountId"`
	PlanType    *string `json:"chatgptPlanType"`
}

type TokensAsk

type TokensAsk struct {
	Reason   string `json:"reason"`
	Previous string `json:"previousAccountId"`
}

The program asks icebath for a fresh ChatGPT token it handed in

type ToolCallAnswer

type ToolCallAnswer struct {
	ContentItems []ContentItem `json:"contentItems"`
	Success      bool          `json:"success"`
}

type ToolCallAsk

type ToolCallAsk struct {
	ThreadID  string          `json:"threadId"`
	TurnID    string          `json:"turnId"`
	CallID    string          `json:"callId"`
	Namespace string          `json:"namespace"`
	Tool      string          `json:"tool"`
	Arguments json.RawMessage `json:"arguments"`
}

The thread calls one of icebath's tools

type Turn

type Turn struct {
	ID     string     `json:"id"`
	Status string     `json:"status"`
	Error  *TurnError `json:"error"`
}

type TurnError

type TurnError struct {
	Message string          `json:"message"`
	Info    json.RawMessage `json:"codexErrorInfo"`
	Details string          `json:"additionalDetails"`
}

What went wrong in a turn, with what kind of failure the program made of it

func (*TurnError) Kind

func (e *TurnError) Kind() (string, int)

Kind of failure the program made of a turn's error, and the HTTP status it carries where it has one

type TurnInterruptParams

type TurnInterruptParams struct {
	ThreadID string `json:"threadId"`
	TurnID   string `json:"turnId"`
}

type TurnResponse

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

type TurnStartParams

type TurnStartParams struct {
	ThreadID string  `json:"threadId"`
	Input    []Input `json:"input"`
	Model    string  `json:"model,omitempty"`
	Effort   string  `json:"effort,omitempty"`
	Summary  string  `json:"summary,omitempty"`
	// Speed tier of this turn and those after it: null asks for the standard one, absent keeps the thread's
	ServiceTier *json.RawMessage `json:"serviceTier,omitempty"`
}

type TurnSteerParams

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

type TurnSteerResponse

type TurnSteerResponse struct {
	TurnID string `json:"turnId"`
}

type UserInputAnswer

type UserInputAnswer struct {
	Answers map[string]AnswerList `json:"answers"`
}

type UserInputAsk

type UserInputAsk struct {
	ThreadID  string          `json:"threadId"`
	TurnID    string          `json:"turnId"`
	ItemID    string          `json:"itemId"`
	Questions []InputQuestion `json:"questions"`
}

The program asks the person questions

type V1CommandAsk

type V1CommandAsk struct {
	CallID  string   `json:"callId"`
	Command []string `json:"command"`
	Cwd     string   `json:"cwd"`
	Reason  string   `json:"reason"`
}

The approvals of the first protocol

type V1PatchAsk

type V1PatchAsk struct {
	CallID      string                     `json:"callId"`
	FileChanges map[string]json.RawMessage `json:"fileChanges"`
	Reason      string                     `json:"reason"`
	GrantRoot   string                     `json:"grantRoot"`
}

type Version

type Version [3]int

Major, minor and patch of a release of Codex

func Check

func Check(ctx context.Context, command string, env map[string]string) (Version, error)

Release of the program as `codex --version` prints it, run with the environment given; an error in words a person reads when it does not run or names no release

func ParseVersion

func ParseVersion(text string) (Version, bool)

Release a text names, such as what `codex --version` prints or the user agent of the handshake; false when it names none

func (Version) Before

func (v Version) Before(other Version) bool

Whether the release is older than the other

func (Version) String

func (v Version) String() string

func (Version) Zero

func (v Version) Zero() bool

Whether no release is known

type Warning

type Warning struct {
	Message string `json:"message"`
	Summary string `json:"summary"`
	Details string `json:"details"`
}

A warning the program gives, of its settings or of a feature going away

Jump to

Keyboard shortcuts

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