Documentation
¶
Index ¶
- type ChatHandler
- type MessageHandler
- type MessageRouter
- func (r *MessageRouter) AddHandler(handler MessageHandler)
- func (r *MessageRouter) GetHandlerByName(name string) MessageHandler
- func (r *MessageRouter) GetHandlerCount() int
- func (r *MessageRouter) GetHandlers() []MessageHandler
- func (r *MessageRouter) RemoveHandler(handlerName string)
- func (r *MessageRouter) Route(msg tea.Msg, stateManager *services.StateManager, ...) (tea.Model, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatHandler ¶ added in v0.27.0
type ChatHandler struct {
// contains filtered or unexported fields
}
ChatHandler handles chat-related messages using the new state management system
func NewChatHandler ¶ added in v0.27.0
func NewChatHandler( chatService domain.ChatService, conversationRepo domain.ConversationRepository, modelService domain.ModelService, configService domain.ConfigService, toolService domain.ToolService, fileService domain.FileService, commandRegistry *commands.Registry, toolOrchestrator *services.ToolExecutionOrchestrator, debugService *services.DebugService, ) *ChatHandler
NewChatHandler creates a new chat handler
func (*ChatHandler) CanHandle ¶ added in v0.27.0
func (h *ChatHandler) CanHandle(msg tea.Msg) bool
CanHandle determines if this handler can process the message
func (*ChatHandler) GetName ¶ added in v0.27.0
func (h *ChatHandler) GetName() string
GetName returns the handler name
func (*ChatHandler) GetPriority ¶ added in v0.27.0
func (h *ChatHandler) GetPriority() int
GetPriority returns the handler priority
func (*ChatHandler) Handle ¶ added in v0.27.0
func (h *ChatHandler) Handle( msg tea.Msg, stateManager *services.StateManager, debugService *services.DebugService, ) (tea.Model, tea.Cmd)
Handle processes the message using the state manager
type MessageHandler ¶
type MessageHandler interface { CanHandle(msg tea.Msg) bool Handle(msg tea.Msg, stateManager *services.StateManager, debugService *services.DebugService) (tea.Model, tea.Cmd) GetPriority() int GetName() string }
MessageHandler interface for the modern architecture
type MessageRouter ¶
type MessageRouter struct {
// contains filtered or unexported fields
}
MessageRouter routes messages to handlers using the new state management system
func NewMessageRouter ¶
func NewMessageRouter() *MessageRouter
NewMessageRouter creates a new message router
func (*MessageRouter) AddHandler ¶
func (r *MessageRouter) AddHandler(handler MessageHandler)
AddHandler adds a message handler to the router
func (*MessageRouter) GetHandlerByName ¶ added in v0.27.0
func (r *MessageRouter) GetHandlerByName(name string) MessageHandler
GetHandlerByName returns a handler by name
func (*MessageRouter) GetHandlerCount ¶ added in v0.27.0
func (r *MessageRouter) GetHandlerCount() int
GetHandlerCount returns the number of registered handlers
func (*MessageRouter) GetHandlers ¶
func (r *MessageRouter) GetHandlers() []MessageHandler
GetHandlers returns all registered handlers
func (*MessageRouter) RemoveHandler ¶
func (r *MessageRouter) RemoveHandler(handlerName string)
RemoveHandler removes a message handler from the router
func (*MessageRouter) Route ¶
func (r *MessageRouter) Route( msg tea.Msg, stateManager *services.StateManager, debugService *services.DebugService, ) (tea.Model, tea.Cmd)
Route routes a message to the appropriate handler