Documentation
¶
Overview ¶
Package codex implements the TermmuxDriverAdapter for the Codex CLI.
Index ¶
- type Driver
- func (d *Driver) BuildCommandArgs(prependArgs, extraArgs []string) []string
- func (d *Driver) BuildCommandEnvVars(runtimeDir string) map[string]string
- func (d *Driver) Command() string
- func (d *Driver) EventHandler() *EventHandler
- func (d *Driver) HandleHookEvent(eventName string, payload json.RawMessage) bool
- func (d *Driver) HandleInterrupt() bool
- func (d *Driver) Name() string
- func (d *Driver) NativeSessionLogPath(configDir, cwd, sessionID string) string
- func (d *Driver) OtelCallbacksForMonitor(mon *monitor.AgentMonitor) (onLogs, onMetrics, onTraces func(json.RawMessage))
- func (d *Driver) ParseSessionLog(reader io.Reader) ([]driver.ConversationEntry, error)
- func (d *Driver) PrepareForLaunch(dryRun bool) (driver.LaunchConfig, error)
- func (d *Driver) SetConfigDir(dir string)
- func (d *Driver) Start(ctx context.Context, events chan<- monitor.AgentEvent) error
- func (d *Driver) Stop()
- func (d *Driver) SupportsHooks() bool
- func (d *Driver) SupportsResume() bool
- func (d *Driver) WriteSessionLog(entries []driver.ConversationEntry, writer io.Writer) error
- type EventHandler
- func (eh *EventHandler) HandleInterrupt()
- func (eh *EventHandler) HandleOtelLogs(payload json.RawMessage) []monitor.AgentEvent
- func (eh *EventHandler) HandleOtelMetrics(_ json.RawMessage) []monitor.AgentEvent
- func (eh *EventHandler) HandleOtelTraces(payload json.RawMessage) []monitor.AgentEvent
- func (eh *EventHandler) SetIdleCallback(fn func())
- func (eh *EventHandler) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements TermmuxDriverAdapter for the Codex CLI.
func (*Driver) BuildCommandArgs ¶
BuildCommandArgs builds the CLI arguments for launching Codex.
func (*Driver) BuildCommandEnvVars ¶
BuildCommandEnvVars returns environment variables for the child process.
func (*Driver) EventHandler ¶
func (d *Driver) EventHandler() *EventHandler
EventHandler returns the underlying event handler for testing.
func (*Driver) HandleHookEvent ¶
func (d *Driver) HandleHookEvent(eventName string, payload json.RawMessage) bool
HandleHookEvent processes hook events. Codex hooks not yet supported.
func (*Driver) HandleInterrupt ¶
HandleInterrupt handles an interrupt signal with suppression window.
func (*Driver) NativeSessionLogPath ¶
NativeSessionLogPath returns empty — Codex session log format is TBD.
func (*Driver) OtelCallbacksForMonitor ¶
func (d *Driver) OtelCallbacksForMonitor(mon *monitor.AgentMonitor) (onLogs, onMetrics, onTraces func(json.RawMessage))
OtelCallbacksForMonitor returns OTEL callbacks for Codex event normalization.
func (*Driver) ParseSessionLog ¶
ParseSessionLog is a V1 non-goal for Codex. Returns error.
func (*Driver) PrepareForLaunch ¶
func (d *Driver) PrepareForLaunch(dryRun bool) (driver.LaunchConfig, error)
PrepareForLaunch prepares the driver for launch.
func (*Driver) SetConfigDir ¶
SetConfigDir sets the config directory for this driver instance.
func (*Driver) SupportsHooks ¶
func (*Driver) SupportsResume ¶
func (*Driver) WriteSessionLog ¶
WriteSessionLog is a V1 non-goal for Codex. Returns error.
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
EventHandler processes OTEL events from Codex and normalizes them into AgentEvents, with debouncing for out-of-order events.
func NewEventHandler ¶
func NewEventHandler() *EventHandler
NewEventHandler creates a new Codex event handler.
func (*EventHandler) HandleInterrupt ¶
func (eh *EventHandler) HandleInterrupt()
HandleInterrupt records an interrupt event and starts the suppression window.
func (*EventHandler) HandleOtelLogs ¶
func (eh *EventHandler) HandleOtelLogs(payload json.RawMessage) []monitor.AgentEvent
HandleOtelLogs processes OTEL log records from Codex.
func (*EventHandler) HandleOtelMetrics ¶
func (eh *EventHandler) HandleOtelMetrics(_ json.RawMessage) []monitor.AgentEvent
HandleOtelMetrics processes OTEL metrics from Codex.
func (*EventHandler) HandleOtelTraces ¶
func (eh *EventHandler) HandleOtelTraces(payload json.RawMessage) []monitor.AgentEvent
HandleOtelTraces processes OTEL traces from Codex.
func (*EventHandler) SetIdleCallback ¶
func (eh *EventHandler) SetIdleCallback(fn func())
SetIdleCallback sets the function called when the idle debounce timer fires.