Documentation
¶
Overview ¶
Package codex connects a per-run Codex app-server and remote TUI to otag.
Index ¶
- Constants
- type Adapter
- func (*Adapter) Deliver(ctx context.Context, t adapter.Target, msg adapter.Message) error
- func (*Adapter) DeliverReceipt(ctx context.Context, t adapter.Target, m adapter.Message) (adapter.Receipt, error)
- func (*Adapter) DenyOutput(kind, reason string) []byte
- func (*Adapter) GuardKind(kind string) bool
- func (*Adapter) Harness() string
- func (*Adapter) NoopOutput(string) []byte
- func (a *Adapter) ParseEvent(hc adapter.HookContext, kind string, raw []byte) (adapter.HookResult, error)
- func (*Adapter) Prepare(ctx context.Context, spec adapter.RunSpec) (*adapter.LaunchSpec, error)
- func (*Adapter) RunSidecar(ctx context.Context, sc adapter.Sidecar, args []string) error
- func (*Adapter) SetupServer(ctx context.Context, spec adapter.RunSpec, launch *adapter.LaunchSpec) error
- func (*Adapter) Stop(ctx context.Context, target adapter.Target) error
- type DeliveryError
- type Receipt
Constants ¶
const ( ReasonNotReady = "not_ready" // listener not connected/reconciled, or TUI not attached ReasonWaitingDialog = "waiting_dialog" // an approval or question is open ReasonBusy = "busy" // a turn is running and steer was not allowed ReasonBusyMismatch = "busy_mismatch" // steer refused: the expected turn is no longer active ReasonRejected = "rejected" // Codex refused the request ReasonUnknown = "unknown" // sent, but no answer: it may have been delivered ReasonBadRequest = "bad_request" )
Delivery refusal reasons of the control protocol (DeliveryError.Reason).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}
func (*Adapter) Deliver ¶
Deliver implements adapter.Deliverer (mode B) through the listener's control socket. msg.ID is the attempt nonce and msg.Text must carry the caller's marker.
func (*Adapter) DeliverReceipt ¶
func (*Adapter) DeliverReceipt(ctx context.Context, t adapter.Target, m adapter.Message) (adapter.Receipt, error)
DeliverReceipt implements adapter.ReceiptDeliverer (mode B) on DeliverReceipt: the receipt is the turn the text went into (turn/start's or turn/steer's turn id). A refusal before anything reached Codex wraps adapter.ErrNotSent: a "not now" one (busy, not_ready, busy_mismatch, waiting_dialog) wraps adapter.ErrNotReady, retried soon without using up attempts; rejected and bad_request are definite. unknown (and any reason this otag does not know) is ambiguous.
func (*Adapter) DenyOutput ¶
DenyOutput implements adapter.Guarder.
func (*Adapter) GuardKind ¶
GuardKind implements adapter.Guarder: the pre-tool and permission hooks decide.
func (*Adapter) NoopOutput ¶
func (*Adapter) ParseEvent ¶
func (a *Adapter) ParseEvent(hc adapter.HookContext, kind string, raw []byte) (adapter.HookResult, error)
func (*Adapter) RunSidecar ¶
func (*Adapter) SetupServer ¶
type DeliveryError ¶
DeliveryError is a delivery the listener refused or could not confirm. Reason is one of the Reason* constants; only ReasonUnknown may have reached Codex.
func (*DeliveryError) Error ¶
func (e *DeliveryError) Error() string
func (*DeliveryError) Unknown ¶
func (e *DeliveryError) Unknown() bool
Unknown reports that the message may have been delivered (never resend it).