Documentation
¶
Overview ¶
Package adhoc implements process-scoped Codex Responses connections. It never creates or rewrites Codex configuration, auth, or model-catalog files.
Index ¶
- Constants
- func FilterEfforts(values []string) []string
- func SupportedEfforts() []string
- func SupportsEffort(e string) bool
- type Connection
- func (c Connection) Apply(argv []string, interactive bool) ([]string, error)
- func (c Connection) ChildEnv(inherited []string) ([]string, error)
- func (c *Connection) Clone() *Connection
- func (c Connection) ProviderID() string
- func (c Connection) Validate() error
- func (c Connection) ValidatePersistedEnv(entries []string) error
- type Credential
- type ReasoningPolicy
Constants ¶
const TokenEnv = "AGENT_PRO_CODEX_AUTH_TOKEN"
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func FilterEfforts ¶
func SupportedEfforts ¶
func SupportedEfforts() []string
SupportedEfforts is the direct Responses wire vocabulary verified with Codex 0.166, not an upstream capability claim. max is passed through; ultra is a CLI orchestration level that emits xhigh, so it cannot represent API effort ultra.
func SupportsEffort ¶
Types ¶
type Connection ¶
type Connection struct {
Version int `json:"version"`
Provider string `json:"provider"`
BaseURL string `json:"base_url"`
Model string `json:"model"`
Reasoning ReasoningPolicy `json:"reasoning"`
Auth Credential `json:"auth"`
}
Connection is safe to persist: Auth contains references or an explicitly public dummy credential, never a private bearer token.
func (Connection) Apply ¶
func (c Connection) Apply(argv []string, interactive bool) ([]string, error)
Apply compiles provider flags without touching files or resolving a secret. It rejects conflicting caller flags rather than silently routing elsewhere. Call before appending a positional prompt. interactive applies to TUI/resume, not to codex exec (which doesn't accept --no-daemon).
func (Connection) ChildEnv ¶
func (c Connection) ChildEnv(inherited []string) ([]string, error)
ChildEnv removes a stale reserved token and injects this credential only into the final Codex child. Never feed the returned slice into persisted RunOptions.Env.
func (*Connection) Clone ¶
func (c *Connection) Clone() *Connection
func (Connection) ProviderID ¶
func (c Connection) ProviderID() string
ProviderID is deterministic across resume and independent of display labels.
func (Connection) Validate ¶
func (c Connection) Validate() error
func (Connection) ValidatePersistedEnv ¶
func (c Connection) ValidatePersistedEnv(entries []string) error
ValidatePersistedEnv prevents callers from accidentally sending the provider secret through the legacy persisted Env / env-file transport. File/JSON refs or a value inherited by the final wrapper are the supported private sources.
type Credential ¶
type Credential struct {
EnvKey string `json:"env_key,omitempty"`
File string `json:"file,omitempty"`
JSONPointer string `json:"json_pointer,omitempty"`
Guards map[string]string `json:"guards,omitempty"`
PublicToken string `json:"public_token,omitempty"`
// SHA256 optionally pins unnamed inline credentials against accidental reorder.
SHA256 string `json:"sha256,omitempty"`
}
Credential is a non-secret reference resolved in the final spawn process. PublicToken is ONLY for public proxy-managed dummy values, not API secrets.
func (Credential) Empty ¶
func (c Credential) Empty() bool
func (Credential) Validate ¶
func (c Credential) Validate() error