Documentation
¶
Index ¶
- type Connection
- type Connector
- type Incoming
- type IncomingKind
- type InitializeResponse
- type ItemSnapshot
- type Manager
- type ManagerEvent
- type ManagerEventKind
- type ManagerOptions
- type Options
- type ProtocolError
- type ProtocolErrorKind
- type ProxyConnector
- type RPCError
- type RateLimitSnapshot
- type RateLimitWindow
- type RateLimitsResponse
- type RawID
- type ReadWriteCloser
- type Session
- func (s *Session) Call(ctx context.Context, method string, params any, target any) error
- func (s *Session) Close() error
- func (s *Session) Events() <-chan Incoming
- func (s *Session) Initialize(ctx context.Context, rateLimitsEnabled bool) (InitializeResponse, error)
- func (s *Session) InterruptTurn(ctx context.Context, threadID, turnID string) error
- func (s *Session) ListLoadedThreads(ctx context.Context) ([]string, error)
- func (s *Session) Notify(ctx context.Context, method string, params any) error
- func (s *Session) ReadRateLimits(ctx context.Context) (RateLimitsResponse, error)
- func (s *Session) Respond(ctx context.Context, id RawID, result any) error
- func (s *Session) ResumeThreadSnapshot(ctx context.Context, threadID string) (ThreadSnapshot, error)
- func (s *Session) Start(ctx context.Context)
- func (s *Session) UnsubscribeThread(ctx context.Context, threadID string) error
- func (s *Session) Wait() error
- type ThreadSnapshot
- type ThreadStatus
- type TurnSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection binds an action to the exact app-server transport that supplied its target. Its zero value cannot authorize a write.
type Incoming ¶
type Incoming struct {
Kind IncomingKind
ID RawID
Method string
Params json.RawMessage
}
type IncomingKind ¶
type IncomingKind uint8
const ( IncomingNotification IncomingKind = iota + 1 IncomingServerRequest )
type InitializeResponse ¶
type ItemSnapshot ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(connector Connector, opts ManagerOptions) *Manager
type ManagerEvent ¶
type ManagerEvent struct {
Kind ManagerEventKind
Connection Connection
Incoming Incoming
Initialize InitializeResponse
ThreadIDs []string
ThreadID string
Thread *ThreadSnapshot
FailureStage string
FailureCode string
RateLimits *RateLimitSnapshot
}
type ManagerEventKind ¶
type ManagerEventKind uint8
const ( ManagerConnected ManagerEventKind = iota + 1 ManagerDisconnected ManagerIncoming ManagerThreadsReconciled ManagerThreadAttached ManagerThreadAttachFailed ManagerRateLimitsSnapshot ManagerRateLimitsReadFailed )
type ManagerOptions ¶
type ProtocolError ¶
type ProtocolError struct{ Kind ProtocolErrorKind }
func (*ProtocolError) Error ¶
func (e *ProtocolError) Error() string
type ProtocolErrorKind ¶
type ProtocolErrorKind string
const ( ProtocolMalformedJSON ProtocolErrorKind = "malformed_json" ProtocolMessageTooLarge ProtocolErrorKind = "message_too_large" ProtocolInvalidEnvelope ProtocolErrorKind = "invalid_envelope" ProtocolEventBackpressure ProtocolErrorKind = "event_backpressure" )
type ProxyConnector ¶
type ProxyConnector struct {
CodexBin string
// contains filtered or unexported fields
}
func (*ProxyConnector) Connect ¶
func (c *ProxyConnector) Connect(ctx context.Context) (ReadWriteCloser, error)
type RateLimitSnapshot ¶
type RateLimitSnapshot struct {
LimitID string `json:"limitId,omitempty"`
Primary *RateLimitWindow `json:"primary,omitempty"`
Secondary *RateLimitWindow `json:"secondary,omitempty"`
}
func MergeRateLimits ¶
func MergeRateLimits(current, update RateLimitSnapshot) RateLimitSnapshot
type RateLimitWindow ¶
type RateLimitsResponse ¶
type RateLimitsResponse struct {
RateLimitsByLimitID map[string]RateLimitSnapshot `json:"rateLimitsByLimitId,omitempty"`
}
func (RateLimitsResponse) CodexSnapshot ¶
func (response RateLimitsResponse) CodexSnapshot() (RateLimitSnapshot, bool)
type RawID ¶
type RawID struct {
// contains filtered or unexported fields
}
func ParseRawID ¶
func ParseRawID(raw json.RawMessage) (RawID, error)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(conn io.ReadWriteCloser, opts Options) *Session
func (*Session) Initialize ¶
func (*Session) InterruptTurn ¶
func (*Session) ListLoadedThreads ¶
func (*Session) ReadRateLimits ¶
func (s *Session) ReadRateLimits(ctx context.Context) (RateLimitsResponse, error)
func (*Session) ResumeThreadSnapshot ¶
func (*Session) UnsubscribeThread ¶
type ThreadSnapshot ¶
type ThreadSnapshot struct {
ID string
Name string
Preview string
CWD string
Status ThreadStatus
LatestTurn *TurnSnapshot
}
type ThreadStatus ¶
type TurnSnapshot ¶
type TurnSnapshot struct {
ID string `json:"id"`
Status string `json:"status"`
Items []ItemSnapshot `json:"items"`
StartedAt *int64 `json:"startedAt,omitempty"`
CompletedAt *int64 `json:"completedAt,omitempty"`
DurationMS *int64 `json:"durationMs,omitempty"`
Error json.RawMessage `json:"error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.