Documentation
¶
Index ¶
- type AgentDetails
- type AgentInfo
- type Event
- type Server
- type StreamManager
- func (sm *StreamManager) Publish(agentID string, event Event)
- func (sm *StreamManager) PublishToAll(event Event)
- func (sm *StreamManager) Subscribe(agentID string) <-chan Event
- func (sm *StreamManager) SubscriberCount(agentID string) int
- func (sm *StreamManager) Unsubscribe(agentID string, ch <-chan Event)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentDetails ¶
type AgentDetails struct {
AgentInfo
CurrentAction string `json:"current_action,omitempty"`
LastActionTick int64 `json:"last_action_tick"`
IsRunning bool `json:"is_running"`
HasCrashed bool `json:"has_crashed"`
CrashCount int `json:"crash_count"`
Faction string `json:"faction"`
}
AgentDetails extends AgentInfo with additional runtime information
type AgentInfo ¶
type AgentInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Role string `json:"role"`
Status string `json:"status"`
Empire string `json:"empire,omitempty"`
Faction string `json:"faction,omitempty"`
}
AgentInfo represents basic agent information
type Event ¶
type Event struct {
AgentID string `json:"agent_id,omitempty"`
Type string `json:"type"`
Timestamp time.Time `json:"timestamp"`
Data interface{} `json:"data"`
}
Event represents an SSE event
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides HTTP API for agent-server
func (*Server) GetStreamManager ¶
func (s *Server) GetStreamManager() *StreamManager
GetStreamManager returns the stream manager (for integration with runners)
func (*Server) SetLLMClient ¶ added in v0.2.0
SetLLMClient sets the LLM client for model hot-swapping via the API.
type StreamManager ¶
type StreamManager struct {
// contains filtered or unexported fields
}
StreamManager manages Server-Sent Events subscriptions for agents
func NewStreamManager ¶
func NewStreamManager() *StreamManager
NewStreamManager creates a new stream manager
func (*StreamManager) Publish ¶
func (sm *StreamManager) Publish(agentID string, event Event)
Publish sends an event to all subscribers of an agent
func (*StreamManager) PublishToAll ¶
func (sm *StreamManager) PublishToAll(event Event)
PublishToAll sends an event to all subscribers across all agents
func (*StreamManager) Subscribe ¶
func (sm *StreamManager) Subscribe(agentID string) <-chan Event
Subscribe creates a new subscription for an agent's events
func (*StreamManager) SubscriberCount ¶
func (sm *StreamManager) SubscriberCount(agentID string) int
SubscriberCount returns the number of active subscribers for an agent
func (*StreamManager) Unsubscribe ¶
func (sm *StreamManager) Unsubscribe(agentID string, ch <-chan Event)
Unsubscribe removes a subscription