Documentation
¶
Index ¶
- Constants
- Variables
- func Capabilities(q Qualification, b Binding, provider string, found bool) map[string]domain.Capability
- func OfficialSupportMatrix() map[string]domain.Capability
- type AgentExecutor
- type Approval
- type AuthService
- type Binding
- type Codex
- func (c *Codex) Cancel(ctx context.Context, session string) error
- func (c *Codex) Close() error
- func (c *Codex) DecideApproval(ctx context.Context, session string, approval Approval) error
- func (c *Codex) DelegateIsolatedCommand(ctx context.Context, session string, command sandbox.Command) (sandbox.CommandResult, error)
- func (c *Codex) ManagedLogin(ctx context.Context, action UserAction) (Login, error)
- func (c *Codex) ManagedLoginStatus(ctx context.Context, loginID string) (string, error)
- func (c *Codex) ManagedLogout(ctx context.Context, action UserAction) error
- func (c *Codex) ProbeVersionAndAuth(ctx context.Context) (Probe, error)
- func (c *Codex) ResumeIfSupported(ctx context.Context, session string) error
- func (c *Codex) Start(ctx context.Context, request Request) (string, error)
- func (c *Codex) StreamEvents(ctx context.Context, session string, emit func(Event) error) error
- type CodexConfig
- type CommandConfig
- type ConnectionReader
- type ContainerConfig
- type Effect
- type Event
- type Factory
- type Launcher
- type Login
- type NativeAccount
- type NativeAction
- type NativeHost
- type NativeKubernetesConfig
- type NativeManager
- type NativeOpen
- type NativeScope
- type NativeState
- type Probe
- type Qualification
- type QualificationService
- func (s *QualificationService) Delete(ctx context.Context, session auth.Session, org, connectionID string) error
- func (s *QualificationService) Get(ctx context.Context, session auth.Session, org, connectionID string) (Qualification, bool, error)
- func (s *QualificationService) Put(ctx context.Context, session auth.Session, org, connectionID string, ...) (Qualification, error)
- type Request
- type Runtime
- type StdioProcess
- type Transport
- type UserAction
Constants ¶
View Source
const CodexBillingRoute = "codex.chatgpt_subscription"
View Source
const CodexVersion = "0.150.1"
View Source
const NativeClaudeVersion = "2.1.302"
View Source
const NativeCodexVersion = "0.163.0"
Variables ¶
View Source
var ErrDenied = errors.New("official agent effect denied")
View Source
var ErrDisabled = errors.New("official agent route is not qualified")
View Source
var ErrInvalidQualification = errors.New("agent qualification is invalid")
View Source
var ErrProtocol = errors.New("official agent protocol violation")
View Source
var ErrUncertain = errors.New("official agent outcome uncertain; reconcile before retry")
Functions ¶
func Capabilities ¶
func Capabilities(q Qualification, b Binding, provider string, found bool) map[string]domain.Capability
func OfficialSupportMatrix ¶
func OfficialSupportMatrix() map[string]domain.Capability
Types ¶
type AgentExecutor ¶
type AgentExecutor interface {
ProbeVersionAndAuth(context.Context) (Probe, error)
Start(context.Context, Request) (string, error)
StreamEvents(context.Context, string, func(Event) error) error
DecideApproval(context.Context, string, Approval) error
DelegateIsolatedCommand(context.Context, string, sandbox.Command) (sandbox.CommandResult, error)
ResumeIfSupported(context.Context, string) error
Cancel(context.Context, string) error
}
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(db *store.Store, identity *auth.Service, reader ConnectionReader, qualifications *QualificationService, factory *Factory) *AuthService
type Binding ¶
type Binding struct {
OrgID string `json:"org_id"`
ConnectionID string `json:"connection_id"`
RunnerID string `json:"runner_id,omitempty"`
ConnectionVersion int64 `json:"connection_version"`
CredentialVersion int64 `json:"credential_version"`
AccountID string `json:"account_id"`
Model string `json:"model"`
RuntimeDigest string `json:"runtime_digest"`
Deployment string `json:"deployment"`
}
func BindingFor ¶
func BindingFor(connection connections.Connection) Binding
type Codex ¶
type Codex struct {
// contains filtered or unexported fields
}
func NewCodex ¶
func NewCodex(config CodexConfig) (*Codex, error)
func (*Codex) DecideApproval ¶
func (*Codex) DelegateIsolatedCommand ¶
func (*Codex) ManagedLogin ¶
func (*Codex) ManagedLoginStatus ¶
func (*Codex) ManagedLogout ¶
func (c *Codex) ManagedLogout(ctx context.Context, action UserAction) error
func (*Codex) ProbeVersionAndAuth ¶
func (*Codex) ResumeIfSupported ¶
type CodexConfig ¶
type CodexConfig struct {
Binding Binding
Open func(context.Context, Binding) (Runtime, error)
Qualify func(context.Context, Binding) (Qualification, error)
Authorize func(context.Context, Effect, func() error) error
AuthorizeUserAction func(context.Context, Binding, UserAction, func() error) error
Sandbox sandbox.SandboxRuntime
Timeout time.Duration
MaxToolCalls int
}
type CommandConfig ¶
type ConnectionReader ¶
type ConnectionReader interface {
Get(context.Context, auth.Session, string, string) (connections.Connection, error)
}
type ContainerConfig ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func NewFactory(launch Launcher, box sandbox.SandboxRuntime) *Factory
func (*Factory) Configured ¶
type Launcher ¶
func NewCommandLauncher ¶
func NewCommandLauncher(config CommandConfig) Launcher
func NewContainerLauncher ¶
func NewContainerLauncher(config ContainerConfig) Launcher
type Login ¶
type NativeAccount ¶ added in v0.2.49
type NativeAction ¶ added in v0.2.49
type NativeAction struct {
Kind string `json:"kind"`
LoginID string `json:"login_id,omitempty"`
Code string `json:"code,omitempty"`
Model string `json:"model,omitempty"`
}
func (NativeAction) GoString ¶ added in v0.2.49
func (NativeAction) GoString() string
func (NativeAction) LogValue ¶ added in v0.2.49
func (NativeAction) LogValue() slog.Value
func (NativeAction) String ¶ added in v0.2.49
func (NativeAction) String() string
func (NativeAction) Valid ¶ added in v0.2.49
func (a NativeAction) Valid() bool
type NativeHost ¶ added in v0.2.49
type NativeKubernetesConfig ¶ added in v0.2.49
type NativeManager ¶ added in v0.2.49
type NativeManager struct {
// contains filtered or unexported fields
}
func NewNativeManager ¶ added in v0.2.49
func NewNativeManager(ctx context.Context, open NativeOpen) *NativeManager
func (*NativeManager) Action ¶ added in v0.2.49
func (m *NativeManager) Action(ctx context.Context, scope NativeScope, action NativeAction) (NativeState, error)
func (*NativeManager) Configured ¶ added in v0.2.49
func (m *NativeManager) Configured() bool
func (*NativeManager) Turn ¶ added in v0.2.49
func (m *NativeManager) Turn(ctx context.Context, scope NativeScope, in model.Turn) (model.TurnResult, error)
type NativeOpen ¶ added in v0.2.49
type NativeOpen func(context.Context, NativeScope) (NativeHost, error)
func NewNativeKubernetesOpen ¶ added in v0.2.49
func NewNativeKubernetesOpen(cfg NativeKubernetesConfig) NativeOpen
type NativeScope ¶ added in v0.2.49
type NativeScope struct {
OrgID string `json:"org_id"`
UserID string `json:"user_id"`
ConnectionID string `json:"connection_id"`
RunnerID string `json:"runner_id"`
Provider string `json:"provider"`
AccountID string `json:"account_id,omitempty"`
}
func (NativeScope) Key ¶ added in v0.2.49
func (s NativeScope) Key() string
func (NativeScope) Valid ¶ added in v0.2.49
func (s NativeScope) Valid() bool
type NativeState ¶ added in v0.2.49
type NativeState struct {
State string `json:"state"`
Login *Login `json:"login,omitempty"`
Account *NativeAccount `json:"account,omitempty"`
Models []model.Model `json:"models,omitempty"`
Version string `json:"version,omitempty"`
Reason string `json:"reason,omitempty"`
CodeOnly bool `json:"code_required,omitempty"`
Model string `json:"model,omitempty"`
}
type Qualification ¶
type Qualification struct {
Binding Binding `json:"binding"`
EvidenceID string `json:"evidence_id"`
CheckedAt time.Time `json:"checked_at"`
ExpiresAt time.Time `json:"expires_at"`
AuthCustody bool `json:"auth_custody"`
NativeToolContainment bool `json:"native_tool_containment"`
Terms bool `json:"terms"`
Topology bool `json:"topology"`
Entitlement bool `json:"entitlement"`
Quota bool `json:"quota"`
NoPaidOverage bool `json:"no_paid_overage"`
}
type QualificationService ¶
type QualificationService struct {
// contains filtered or unexported fields
}
func NewQualificationService ¶
func NewQualificationService(db *store.Store, identity *auth.Service) *QualificationService
func (*QualificationService) Get ¶
func (s *QualificationService) Get(ctx context.Context, session auth.Session, org, connectionID string) (Qualification, bool, error)
func (*QualificationService) Put ¶
func (s *QualificationService) Put(ctx context.Context, session auth.Session, org, connectionID string, q Qualification) (Qualification, error)
type StdioProcess ¶
type StdioProcess struct {
// contains filtered or unexported fields
}
func StartPreparedRuntime ¶
func StartPreparedRuntime(command *exec.Cmd) (*StdioProcess, error)
func (*StdioProcess) Close ¶
func (p *StdioProcess) Close() error
type UserAction ¶
Click to show internal directories.
Click to hide internal directories.