Versions in this module Expand all Collapse all v0 v0.1.0 Jun 17, 2026 Changes in this version + var ErrBroken = errors.New("downstream broken: too many consecutive failures") + var ErrClientSessionClosed = errors.New("client session closed") + var ErrClosed = errors.New("pool closed") + var ErrPoolExhausted = errors.New("downstream pool exhausted") + type ClientSession struct + func (cs *ClientSession) Close() error + func (cs *ClientSession) Dispatch(ctx context.Context, call *domain.Call) (*domain.Result, error) + type DownstreamSession interface + CallTool func(ctx context.Context, tool string, args json.RawMessage) (*domain.Result, error) + ListTools func(ctx context.Context, cursor string) (tools []ToolInfo, next string, err error) + Ping func(ctx context.Context) error + type Factory interface + New func(ctx context.Context) (Session, error) + type HTTPConfig struct + HTTPClient *http.Client + Headers map[string]string + URL string + type HTTPFactory struct + func NewHTTPFactory(cfg HTTPConfig) *HTTPFactory + func (f *HTTPFactory) New(ctx context.Context) (Session, error) + type ManagedDownstream struct + Mode SessionMode + Name string + Pool *Pool + type Manager struct + func NewManager(downstreams []ManagedDownstream) (*Manager, error) + func (m *Manager) Close() error + func (m *Manager) NewClientSession() *ClientSession + type Pool struct + func NewPool(factory Factory, cfg PoolConfig) *Pool + func (p *Pool) Acquire(ctx context.Context) (Session, error) + func (p *Pool) Close() error + func (p *Pool) Discard(sess Session) + func (p *Pool) IdleTTL() time.Duration + func (p *Pool) Release(sess Session) + func (p *Pool) Stats() Stats + type PoolConfig struct + AcquireTimeout time.Duration + IdleTTL time.Duration + Max int + type Session interface + Close func() error + type SessionMode int + const PerClient + const Shared + type Stats struct + Created int64 + Idle int + InUse int + type StdioConfig struct — darwin/amd64, linux/amd64 + Command []string + Env map[string]string + TerminateDuration time.Duration + type StdioFactory struct — darwin/amd64, linux/amd64 + func NewStdioFactory(cfg StdioConfig) *StdioFactory + func (f *StdioFactory) New(ctx context.Context) (Session, error) + type SupervisedFactory struct + func NewSupervisedFactory(delegate Factory, cfg SupervisorConfig) *SupervisedFactory + func (f *SupervisedFactory) New(ctx context.Context) (Session, error) + type SupervisorConfig struct + BrokenCooldown time.Duration + MaxConsecutiveFailures int + type ToolInfo struct + Annotations json.RawMessage + Description string + Icons json.RawMessage + InputSchema json.RawMessage + Name string + OutputSchema json.RawMessage + Title string