handlers

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(
	agentService domain.AgentService,
	conversationRepo domain.ConversationRepository,
	modelService domain.ModelService,
	configService domain.ConfigService,
	toolService domain.ToolService,
	fileService domain.FileService,
	shortcutRegistry *shortcuts.Registry,
	toolOrchestrator *services.ToolExecutionOrchestrator,
) *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,
) (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) (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,
) (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