codex

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter communicates with Codex via its WebSocket JSON-RPC API server.

func New

func New(cfg runtime.AdapterConfig) *Adapter

New creates a Codex adapter.

func (*Adapter) CreateSession

func (a *Adapter) CreateSession(_ context.Context) (string, error)

func (*Adapter) Events

func (a *Adapter) Events() <-chan runtime.Event

func (*Adapter) IsHealthy

func (a *Adapter) IsHealthy(_ context.Context) bool

func (*Adapter) RespondToUserInput

func (a *Adapter) RespondToUserInput(callID string, answers []runtime.QuestionAnswer) error

RespondToUserInput sends answers back to Codex via JSON-RPC.

func (*Adapter) ResumeSession

func (a *Adapter) ResumeSession(_ context.Context, sessionID string) error

func (*Adapter) Runtime

func (a *Adapter) Runtime() runtime.Runtime

func (*Adapter) SendMessage

func (a *Adapter) SendMessage(_ context.Context, text string) error

func (*Adapter) Start

func (a *Adapter) Start(ctx context.Context) error

func (*Adapter) Stop

func (a *Adapter) Stop(_ context.Context) error

type Client

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

Client is a JSON-RPC 2.0 client over WebSocket.

func NewClient

func NewClient(url string) (*Client, error)

NewClient dials a WebSocket and starts reading.

func (*Client) Call

func (c *Client) Call(method string, params interface{}) (json.RawMessage, error)

Call sends a JSON-RPC request and waits for the response.

func (*Client) Close

func (c *Client) Close() error

Close shuts down the WebSocket connection.

func (*Client) Notifications

func (c *Client) Notifications() <-chan rpcResponse

Notifications returns the channel for server-push notifications.

Jump to

Keyboard shortcuts

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