Documentation
¶
Index ¶
- Constants
- Variables
- func AppServerSchemaDigest() string
- type Adapter
- func (*Adapter) Capabilities() agent.Caps
- func (a *Adapter) Launch(ctx context.Context, _ container.Handle, inv agent.AgentInvocation) (<-chan agent.AgentEvent, <-chan agent.AgentOutcome, error)
- func (a *Adapter) PreflightResume(ctx context.Context, req agent.LiveResumePreflightRequest) error
- func (*Adapter) Ref() string
- func (*Adapter) RequiredEnv() []string
- func (a *Adapter) ValidateConfig(with ir.RawConfig) error
- func (a *Adapter) Version(ctx context.Context, _ container.Handle) (string, error)
- type Client
- type Option
- type PermissionRequest
- type PermissionResponse
- type ProviderEvent
- type ProviderInfo
- type RPCError
- type ThreadInfo
- type ThreadResumeRequest
- type ThreadStartRequest
- type TurnHandle
- type TurnStartRequest
- type Usage
Constants ¶
View Source
const ( EventAgentMessageDelta = "item/agentMessage/delta" EventReasoningSummaryDelta = "item/reasoning/summaryTextDelta" EventItemCompleted = "item/completed" EventTurnCompleted = "turn/completed" EventThreadTokenUsage = "thread/tokenUsage/updated" EventPermissionRequest = "server/request/permission" )
View Source
const AdapterRef = "openai/codex-live"
Variables ¶
View Source
var DefaultEnvAllowlist = []string{"OPENAI_API_KEY", "CODEX_HOME"}
DefaultEnvAllowlist mirrors the strict Codex adapter's auth/config inputs. CODEX_HOME preserves local Codex login/cache context; OPENAI_API_KEY covers API-key based Codex installs.
Functions ¶
func AppServerSchemaDigest ¶
func AppServerSchemaDigest() string
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func (*Adapter) Capabilities ¶
func (*Adapter) Launch ¶
func (a *Adapter) Launch(ctx context.Context, _ container.Handle, inv agent.AgentInvocation) (<-chan agent.AgentEvent, <-chan agent.AgentOutcome, error)
func (*Adapter) PreflightResume ¶
func (*Adapter) RequiredEnv ¶
RequiredEnv implements agent.CredentialNamer. Returns the CREDENTIAL env var name codex-live authenticates with. OPENAI_API_KEY is defined in DefaultEnvAllowlist; CODEX_HOME is a config directory (not a credential) and is intentionally excluded.
type Client ¶
type Client interface {
ProviderInfo(context.Context) (ProviderInfo, error)
StartThread(context.Context, ThreadStartRequest) (ThreadInfo, error)
ResumeThread(context.Context, ThreadResumeRequest) (ThreadInfo, error)
StartTurn(context.Context, TurnStartRequest) (TurnHandle, error)
RespondPermission(context.Context, PermissionResponse) error
}
type Option ¶
type Option func(*Adapter)
func WithBackoff ¶
func WithClient ¶
func WithLiveRoot ¶
func WithPricing ¶
WithPricing injects the pricing.Table used to derive a USD cost from token usage. Tests pass a self-contained fixture table; production leaves it unset so New defaults it to pricing.Default() (embedded rates ⊕ $AWF_PRICING_FILE).
type PermissionRequest ¶
type PermissionResponse ¶
type ProviderEvent ¶
type ProviderEvent struct {
Type string
Text string
Output map[string]any
Usage Usage
Status string
Error string
// ItemType is the completed item's type on an EventItemCompleted event
// (e.g. "agentMessage", "command_execution"); empty on other events.
ItemType string
// Command / ExitCode carry a completed command_execution item's command line
// and exit status (ExitCode nil = unknown); Text carries its aggregated output.
Command string
ExitCode *int
Permission *PermissionRequest
}
type ProviderInfo ¶
type ThreadInfo ¶
type ThreadResumeRequest ¶
type ThreadStartRequest ¶
type TurnHandle ¶
type TurnHandle struct {
TurnID string
Events <-chan ProviderEvent
}
type TurnStartRequest ¶
type Usage ¶
type Usage struct {
InputTokens int
OutputTokens int
CachedInputTokens int
// TotalTokens is the cache-inclusion oracle (see normalizeForPricing): when
// total == input+output, cached is a subset of input (safe to subtract for
// pricing); otherwise cached is disjoint and must not be subtracted.
TotalTokens int
}
Click to show internal directories.
Click to hide internal directories.