codexappserver

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Type     string `json:"type,omitempty"`
	Email    string `json:"email,omitempty"`
	PlanType string `json:"plan_type,omitempty"`
}

type Bridge

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

func NewBridge

func NewBridge(lifecycle fx.Lifecycle, logger *slog.Logger) *Bridge

func (*Bridge) CancelLogin

func (b *Bridge) CancelLogin(ctx context.Context, loginID string) error

func (*Bridge) EnsureStarted

func (b *Bridge) EnsureStarted(ctx context.Context) error

func (*Bridge) InjectThreadItems

func (b *Bridge) InjectThreadItems(ctx context.Context, threadID string, items []map[string]any) error

func (*Bridge) RecentDiagnosticSummary

func (b *Bridge) RecentDiagnosticSummary(limit int) string

func (*Bridge) RecentEvents

func (b *Bridge) RecentEvents(limit int) []Event

func (*Bridge) RecentStderr

func (b *Bridge) RecentStderr(limit int) []string

func (*Bridge) Snapshot

func (b *Bridge) Snapshot() Snapshot

func (*Bridge) StartDeviceCodeLogin

func (b *Bridge) StartDeviceCodeLogin(ctx context.Context) (DeviceCodeLoginResult, error)

func (*Bridge) StartThread

func (b *Bridge) StartThread(ctx context.Context, params ThreadStartParams) (ThreadStartResult, error)

func (*Bridge) StartTurn

func (b *Bridge) StartTurn(ctx context.Context, params TurnStartParams) (TurnStartResult, error)

func (*Bridge) Stop

func (b *Bridge) Stop(ctx context.Context) error

func (*Bridge) Subscribe

func (b *Bridge) Subscribe(ctx context.Context) <-chan Event

func (*Bridge) Warmup

func (b *Bridge) Warmup()

type DeviceCodeLoginResult

type DeviceCodeLoginResult struct {
	LoginID         string `json:"login_id"`
	VerificationURL string `json:"verification_url"`
	UserCode        string `json:"user_code"`
}

type Event

type Event struct {
	Seq      int64           `json:"seq"`
	Time     time.Time       `json:"time"`
	Source   string          `json:"source,omitempty"`
	Method   string          `json:"method,omitempty"`
	ThreadID string          `json:"thread_id,omitempty"`
	TurnID   string          `json:"turn_id,omitempty"`
	ItemID   string          `json:"item_id,omitempty"`
	Summary  string          `json:"summary,omitempty"`
	Delta    string          `json:"delta,omitempty"`
	Payload  json.RawMessage `json:"payload,omitempty"`
}

type InitializeInfo

type InitializeInfo struct {
	UserAgent      string `json:"user_agent,omitempty"`
	CodexHome      string `json:"codex_home,omitempty"`
	PlatformFamily string `json:"platform_family,omitempty"`
	PlatformOS     string `json:"platform_os,omitempty"`
}

type LoginState

type LoginState struct {
	Pending         bool      `json:"pending"`
	Type            string    `json:"type,omitempty"`
	LoginID         string    `json:"login_id,omitempty"`
	VerificationURL string    `json:"verification_url,omitempty"`
	UserCode        string    `json:"user_code,omitempty"`
	StartedAt       time.Time `json:"started_at,omitempty"`
	LastError       string    `json:"last_error,omitempty"`
}

type Snapshot

type Snapshot struct {
	Command            string         `json:"command"`
	CommandArgs        []string       `json:"command_args,omitempty"`
	CommandCWD         string         `json:"command_cwd,omitempty"`
	PID                int            `json:"pid,omitempty"`
	Running            bool           `json:"running"`
	Starting           bool           `json:"starting"`
	Ready              bool           `json:"ready"`
	Initialized        bool           `json:"initialized"`
	LastError          string         `json:"last_error,omitempty"`
	StartedAt          time.Time      `json:"started_at,omitempty"`
	LastExitAt         time.Time      `json:"last_exit_at,omitempty"`
	InitializeInfo     InitializeInfo `json:"initialize_info,omitempty"`
	AuthMethod         string         `json:"auth_method,omitempty"`
	RequiresOpenAIAuth *bool          `json:"requires_openai_auth,omitempty"`
	Account            *Account       `json:"account,omitempty"`
	Login              *LoginState    `json:"login,omitempty"`
	Thread             *ThreadState   `json:"thread,omitempty"`
	Turn               *TurnState     `json:"turn,omitempty"`
}

type ThreadStartParams

type ThreadStartParams struct {
	CWD                   string
	Model                 string
	ModelProvider         string
	ApprovalPolicy        string
	SandboxType           string
	DeveloperInstructions string
}

type ThreadStartResult

type ThreadStartResult struct {
	ThreadID       string `json:"thread_id"`
	CWD            string `json:"cwd,omitempty"`
	Model          string `json:"model,omitempty"`
	ModelProvider  string `json:"model_provider,omitempty"`
	ApprovalPolicy string `json:"approval_policy,omitempty"`
	Sandbox        string `json:"sandbox,omitempty"`
	ThreadPreview  string `json:"thread_preview,omitempty"`
}

type ThreadState

type ThreadState struct {
	ID             string    `json:"id,omitempty"`
	Preview        string    `json:"preview,omitempty"`
	CWD            string    `json:"cwd,omitempty"`
	Model          string    `json:"model,omitempty"`
	ModelProvider  string    `json:"model_provider,omitempty"`
	ApprovalPolicy string    `json:"approval_policy,omitempty"`
	Sandbox        string    `json:"sandbox,omitempty"`
	CreatedAt      time.Time `json:"created_at,omitempty"`
	UpdatedAt      time.Time `json:"updated_at,omitempty"`
}

type TurnStartParams

type TurnStartParams struct {
	ThreadID       string
	Input          []map[string]any
	CWD            string
	ApprovalPolicy string
	SandboxType    string
	Model          string
	Effort         string
	Summary        string
}

type TurnStartResult

type TurnStartResult struct {
	TurnID   string `json:"turn_id"`
	ThreadID string `json:"thread_id"`
	Status   string `json:"status,omitempty"`
}

type TurnState

type TurnState struct {
	ID        string    `json:"id,omitempty"`
	ThreadID  string    `json:"thread_id,omitempty"`
	Status    string    `json:"status,omitempty"`
	Error     string    `json:"error,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

Jump to

Keyboard shortcuts

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