handlers

package
v0.33.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL