Documentation
¶
Index ¶
- type APIError
- type AcceptedResponse
- type ChannelCheck
- type ChannelStatusProvider
- type CronHistoryResponse
- type CronJobResponse
- type CronListResponse
- type Deliverer
- type DetailedHealthResponse
- type ErrorResponse
- type HealthResponse
- type LogBroadcaster
- type ModelListResponse
- type ModelResponse
- type OKResponse
- type Server
- func (s *Server) AddChannel(c ChannelStatusProvider)
- func (s *Server) AddDeliverer(d Deliverer)
- func (s *Server) SetHealthTracker(t *health.Tracker)
- func (s *Server) SetSkillManager(lister SkillLister, toggler SkillToggler)
- func (s *Server) SetSurfaces(handler *surfaces.Handler, store *surfaces.Store)
- func (s *Server) SetVersion(v string)
- func (s *Server) Start(ctx context.Context) error
- type SkillInfo
- type SkillLister
- type SkillToggler
- type TaskListResponse
- type TaskSummary
- type ToolInvokeResponse
- type UsageAllResponse
- type UsageSessionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Message string `json:"message"`
Type string `json:"type"`
Code string `json:"code"`
}
APIError is a detailed error with type and code (OpenAI-compatible).
type AcceptedResponse ¶
type AcceptedResponse struct {
Status string `json:"status"`
}
AcceptedResponse indicates an async task was accepted.
type ChannelCheck ¶
ChannelCheck is one channel's connectivity report inside HealthResponse.
type ChannelStatusProvider ¶
type ChannelStatusProvider interface {
ChannelName() string
IsConnected() bool
Username() string
PairedCount() int
}
ChannelStatusProvider reports whether a channel bot is connected.
type CronHistoryResponse ¶
type CronHistoryResponse struct {
Entries any `json:"entries"`
Total int `json:"total"`
HasMore bool `json:"hasMore"`
}
CronHistoryResponse wraps paginated cron run history.
type CronJobResponse ¶
type CronJobResponse struct {
Job any `json:"job"`
}
CronJobResponse wraps a created/updated job.
type CronListResponse ¶
type CronListResponse struct {
Jobs any `json:"jobs"`
}
CronListResponse wraps the job list.
type DetailedHealthResponse ¶
type DetailedHealthResponse struct {
Status string `json:"status"`
Components any `json:"components"`
Tasks TaskSummary `json:"tasks"`
}
DetailedHealthResponse is the response for /api/health/detail.
type ErrorResponse ¶
type ErrorResponse struct {
Error any `json:"error"`
}
ErrorResponse is the standard error envelope for all API error responses.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
Version string `json:"version"`
Checks map[string]any `json:"checks"`
}
HealthResponse is the structured health check result.
type LogBroadcaster ¶
type LogBroadcaster struct {
// contains filtered or unexported fields
}
LogBroadcaster is a zapcore.WriteSyncer that fans log lines out to SSE clients. Slow clients that can't keep up have messages dropped (non-blocking send).
func NewLogBroadcaster ¶
func NewLogBroadcaster() *LogBroadcaster
NewLogBroadcaster creates a new broadcaster.
func (*LogBroadcaster) Subscribe ¶
func (lb *LogBroadcaster) Subscribe() chan string
Subscribe returns a buffered channel that receives log lines.
func (*LogBroadcaster) Sync ¶
func (lb *LogBroadcaster) Sync() error
Sync implements zapcore.WriteSyncer (no-op).
func (*LogBroadcaster) Unsubscribe ¶
func (lb *LogBroadcaster) Unsubscribe(ch chan string)
Unsubscribe removes a client channel and closes it.
type ModelListResponse ¶
ModelListResponse wraps a list of model objects.
type ModelResponse ¶
type ModelResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
}
ModelResponse describes a single model.
type OKResponse ¶
type OKResponse struct {
OK bool `json:"ok"`
Enabled *bool `json:"enabled,omitempty"`
Result string `json:"result,omitempty"`
}
OKResponse is the standard success envelope for mutation endpoints.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP gateway.
func New ¶
func New(logger *zap.SugaredLogger, cfg *config.Root, ag agent.PrimaryAgent, sessions *session.Manager, cronMgr *cron.Manager, taskMgr *taskqueue.Manager, tools []agent.Tool, logBroadcaster *LogBroadcaster) *Server
New creates the gateway server.
func (*Server) AddChannel ¶
func (s *Server) AddChannel(c ChannelStatusProvider)
AddChannel registers a channel bot for status reporting in the control UI.
func (*Server) AddDeliverer ¶
AddDeliverer registers a channel deliverer for system event routing.
func (*Server) SetHealthTracker ¶
SetHealthTracker registers the health state tracker for the detailed health endpoint.
func (*Server) SetSkillManager ¶
func (s *Server) SetSkillManager(lister SkillLister, toggler SkillToggler)
SetSkillManager registers skill list/toggle callbacks for the dashboard.
func (*Server) SetSurfaces ¶
SetSurfaces registers the surfaces handler and store for the dashboard.
func (*Server) SetVersion ¶
SetVersion sets the version string shown in the dashboard.
type SkillInfo ¶
type SkillInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Origin string `json:"origin"`
Enabled bool `json:"enabled"`
Verified bool `json:"verified"`
}
SkillInfo is a minimal skill descriptor for the UI.
type SkillLister ¶
type SkillLister func() []SkillInfo
SkillLister returns the current skill list for the dashboard.
type SkillToggler ¶
SkillToggler toggles a skill's enabled state. Returns true if found.
type TaskListResponse ¶
type TaskListResponse struct {
Tasks any `json:"tasks"`
}
TaskListResponse wraps the task list.
type TaskSummary ¶
TaskSummary reports the current task queue state.
type ToolInvokeResponse ¶
ToolInvokeResponse wraps a tool execution result.
type UsageAllResponse ¶
UsageAllResponse is the aggregate usage response.
type UsageSessionResponse ¶
type UsageSessionResponse struct {
Session string `json:"session"`
Usage any `json:"usage"`
Calls int `json:"calls"`
}
UsageSessionResponse is a single-session usage response.