codex_types

package
v0.0.246 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 5 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

func FromCodex added in v0.0.22

func FromCodex(events []Event, _ string) []types.AgentEvent

func TraceIsAssistantItem added in v0.0.38

func TraceIsAssistantItem(itemType string) bool

func TraceItemText added in v0.0.38

func TraceItemText(item *TraceItem) string

func TraceMessageText added in v0.0.38

func TraceMessageText(message *TraceMessage) string

Types

type CodexEvent

type CodexEvent struct {
	Type    string     `json:"type"`
	Item    *EventItem `json:"item,omitempty"`
	Delta   string     `json:"delta,omitempty"`
	Text    string     `json:"text,omitempty"`
	Message string     `json:"message,omitempty"`
}

type Event

type Event struct {
	Type    EventType         `json:"type"`
	Item    *EventItem        `json:"item,omitempty"`
	Message string            `json:"message,omitempty"`
	Text    string            `json:"text,omitempty"`
	Mock    *types.MockConfig `json:"mock,omitempty"`
}

func ToCodex

func ToCodex(events []types.AgentEvent) []Event

type EventItem

type EventItem struct {
	ID               string          `json:"id"`
	Type             ItemType        `json:"type"`
	Text             string          `json:"text,omitempty"`
	Message          string          `json:"message,omitempty"`
	Content          []ItemPart      `json:"content,omitempty"`
	Command          string          `json:"command,omitempty"`
	AggregatedOutput string          `json:"aggregated_output,omitempty"`
	ExitCode         *int            `json:"exit_code,omitempty"`
	Status           string          `json:"status,omitempty"`
	Items            []TraceTodoItem `json:"items,omitempty"`
	Plan             []TracePlanItem `json:"plan,omitempty"`
	Explanation      string          `json:"explanation,omitempty"`
	Changes          []FileChange    `json:"changes,omitempty"`
	Raw              json.RawMessage `json:"-"`
}

type EventType

type EventType string
const (
	EventStarted   EventType = "item.started"
	EventUpdated   EventType = "item.updated"
	EventCompleted EventType = "item.completed"
	EventError     EventType = "error"
)

type FileChange

type FileChange = types.FileChange

type ItemPart

type ItemPart struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

type ItemType

type ItemType string
const (
	ItemReasoning        ItemType = "reasoning"
	ItemCommandExecution ItemType = "command_execution"
	ItemFileChange       ItemType = "file_change"
	ItemMessage          ItemType = "message"
)

type TraceContent added in v0.0.38

type TraceContent struct {
	Type string `json:"type,omitempty"`
	Text string `json:"text,omitempty"`
}

type TraceEvent added in v0.0.38

type TraceEvent struct {
	Type     string                     `json:"type"`
	Subtype  string                     `json:"subtype,omitempty"`
	CallID   string                     `json:"call_id,omitempty"`
	Message  *TraceMessage              `json:"message,omitempty"`
	Result   string                     `json:"result,omitempty"`
	Item     *TraceItem                 `json:"item,omitempty"`
	ToolCall map[string]json.RawMessage `json:"tool_call,omitempty"`
	Delta    string                     `json:"delta,omitempty"`
	Text     string                     `json:"text,omitempty"`
}

type TraceItem added in v0.0.38

type TraceItem struct {
	ID               string          `json:"id,omitempty"`
	Type             string          `json:"type,omitempty"`
	Text             string          `json:"text,omitempty"`
	Message          string          `json:"message,omitempty"`
	Content          []TraceContent  `json:"content,omitempty"`
	Command          string          `json:"command,omitempty"`
	AggregatedOutput string          `json:"aggregated_output,omitempty"`
	ExitCode         *int            `json:"exit_code,omitempty"`
	Status           string          `json:"status,omitempty"`
	Items            []TraceTodoItem `json:"items,omitempty"`
	Plan             []TracePlanItem `json:"plan,omitempty"`
	Explanation      string          `json:"explanation,omitempty"`
	Changes          []FileChange    `json:"changes,omitempty"`
	Raw              json.RawMessage `json:"-"`
}

func (*TraceItem) UnmarshalJSON added in v0.0.38

func (i *TraceItem) UnmarshalJSON(data []byte) error

type TraceMessage added in v0.0.38

type TraceMessage struct {
	Content []TraceContent `json:"content"`
}

type TracePlanItem added in v0.0.38

type TracePlanItem struct {
	Step   string `json:"step,omitempty"`
	Status string `json:"status,omitempty"`
}

type TraceTodoItem added in v0.0.38

type TraceTodoItem struct {
	Text      string `json:"text,omitempty"`
	Completed bool   `json:"completed,omitempty"`
	Status    string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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