handlers

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 20 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
}

func NewChatHandler added in v0.27.0

func NewChatHandler(
	agentService domain.AgentService,
	conversationRepo domain.ConversationRepository,
	conversationOptimizer domain.ConversationOptimizer,
	modelService domain.ModelService,
	configService domain.ConfigService,
	toolService domain.ToolService,
	fileService domain.FileService,
	imageService domain.ImageService,
	shortcutRegistry *shortcuts.Registry,
	stateManager domain.StateManager,
	messageQueue domain.MessageQueue,
	taskRetentionService domain.TaskRetentionService,
	backgroundTaskService domain.BackgroundTaskService,
	backgroundShellService domain.BackgroundShellService,
	agentManager domain.AgentManager,
	cfg *config.Config,
) *ChatHandler

func (*ChatHandler) ClearBashDetachChan added in v0.81.0

func (h *ChatHandler) ClearBashDetachChan()

ClearBashDetachChan clears the bash detach channel (thread-safe)

func (*ChatHandler) ExtractMarkdownSummary added in v0.45.4

func (h *ChatHandler) ExtractMarkdownSummary(content string) (string, bool)

func (*ChatHandler) FormatMetrics added in v0.45.4

func (h *ChatHandler) FormatMetrics(metrics *domain.ChatMetrics) string

func (*ChatHandler) GetActiveToolCallID added in v0.97.0

func (h *ChatHandler) GetActiveToolCallID() string

GetActiveToolCallID returns the currently active tool call ID

func (*ChatHandler) GetBashDetachChan added in v0.81.0

func (h *ChatHandler) GetBashDetachChan() chan<- struct{}

GetBashDetachChan gets the bash detach channel (thread-safe)

func (*ChatHandler) Handle added in v0.27.0

func (h *ChatHandler) Handle(msg tea.Msg) tea.Cmd

Handle routes incoming messages to appropriate handler methods based on message type. TODO - refactor this

func (*ChatHandler) HandleA2ATaskCompletedEvent added in v0.53.0

func (h *ChatHandler) HandleA2ATaskCompletedEvent(
	msg domain.A2ATaskCompletedEvent,
) tea.Cmd

func (*ChatHandler) HandleA2ATaskFailedEvent added in v0.53.0

func (h *ChatHandler) HandleA2ATaskFailedEvent(
	msg domain.A2ATaskFailedEvent,
) tea.Cmd

func (*ChatHandler) HandleA2ATaskInputRequiredEvent added in v0.53.0

func (h *ChatHandler) HandleA2ATaskInputRequiredEvent(
	msg domain.A2ATaskInputRequiredEvent,
) tea.Cmd

func (*ChatHandler) HandleA2ATaskStatusUpdateEvent added in v0.53.0

func (h *ChatHandler) HandleA2ATaskStatusUpdateEvent(
	msg domain.A2ATaskStatusUpdateEvent,
) tea.Cmd

func (*ChatHandler) HandleA2ATaskSubmittedEvent added in v0.53.0

func (h *ChatHandler) HandleA2ATaskSubmittedEvent(
	msg domain.A2ATaskSubmittedEvent,
) tea.Cmd

func (*ChatHandler) HandleA2AToolCallExecutedEvent added in v0.53.0

func (h *ChatHandler) HandleA2AToolCallExecutedEvent(
	msg domain.A2AToolCallExecutedEvent,
) tea.Cmd

func (*ChatHandler) HandleAgentStatusUpdateEvent added in v0.67.0

func (h *ChatHandler) HandleAgentStatusUpdateEvent(msg domain.AgentStatusUpdateEvent) tea.Cmd

HandleAgentStatusUpdateEvent handles agent status updates

func (*ChatHandler) HandleBackgroundShellRequest added in v0.97.0

func (h *ChatHandler) HandleBackgroundShellRequest() tea.Cmd

HandleBackgroundShellRequest handles a request to background a running bash command

func (*ChatHandler) HandleBashCommand added in v0.97.0

func (h *ChatHandler) HandleBashCommand(commandText string) tea.Cmd

HandleBashCommand processes bash commands starting with !

func (*ChatHandler) HandleBashCommandCompletedEvent added in v0.68.0

func (h *ChatHandler) HandleBashCommandCompletedEvent(
	msg domain.BashCommandCompletedEvent,
) tea.Cmd

func (*ChatHandler) HandleBashOutputChunkEvent added in v0.65.0

func (h *ChatHandler) HandleBashOutputChunkEvent(
	msg domain.BashOutputChunkEvent,
) tea.Cmd

func (*ChatHandler) HandleCancelledEvent added in v0.53.0

func (h *ChatHandler) HandleCancelledEvent(
	msg domain.CancelledEvent,
) tea.Cmd

func (*ChatHandler) HandleChatChunkEvent added in v0.53.0

func (h *ChatHandler) HandleChatChunkEvent(
	msg domain.ChatChunkEvent,
) tea.Cmd

func (*ChatHandler) HandleChatCompleteEvent added in v0.53.0

func (h *ChatHandler) HandleChatCompleteEvent(
	msg domain.ChatCompleteEvent,
) tea.Cmd

func (*ChatHandler) HandleChatErrorEvent added in v0.53.0

func (h *ChatHandler) HandleChatErrorEvent(
	msg domain.ChatErrorEvent,
) tea.Cmd

func (*ChatHandler) HandleChatStartEvent added in v0.53.0

func (h *ChatHandler) HandleChatStartEvent(
	msg domain.ChatStartEvent,
) tea.Cmd

func (*ChatHandler) HandleCommand added in v0.97.0

func (h *ChatHandler) HandleCommand(commandText string) tea.Cmd

HandleCommand processes slash commands

func (*ChatHandler) HandleComputerUsePausedEvent added in v0.96.0

func (h *ChatHandler) HandleComputerUsePausedEvent(msg domain.ComputerUsePausedEvent) tea.Cmd

HandleComputerUsePausedEvent handles computer use pause events

func (*ChatHandler) HandleComputerUseResumedEvent added in v0.96.0

func (h *ChatHandler) HandleComputerUseResumedEvent(msg domain.ComputerUseResumedEvent) tea.Cmd

HandleComputerUseResumedEvent handles computer use resume events

func (*ChatHandler) HandleConversationSelectedEvent added in v0.53.0

func (h *ChatHandler) HandleConversationSelectedEvent(
	msg domain.ConversationSelectedEvent,
) tea.Cmd

func (*ChatHandler) HandleFileSelectionRequestEvent added in v0.53.0

func (h *ChatHandler) HandleFileSelectionRequestEvent(
	msg domain.FileSelectionRequestEvent,
) tea.Cmd

func (*ChatHandler) HandleMessageQueuedEvent added in v0.53.0

func (h *ChatHandler) HandleMessageQueuedEvent(
	msg domain.MessageQueuedEvent,
) tea.Cmd

func (*ChatHandler) HandleOptimizationStatusEvent added in v0.53.0

func (h *ChatHandler) HandleOptimizationStatusEvent(
	msg domain.OptimizationStatusEvent,
) tea.Cmd

func (*ChatHandler) HandlePlanApprovalRequestedEvent added in v0.68.0

func (h *ChatHandler) HandlePlanApprovalRequestedEvent(
	msg domain.PlanApprovalRequestedEvent,
) tea.Cmd

func (*ChatHandler) HandlePlanApprovalResponseEvent added in v0.68.0

func (h *ChatHandler) HandlePlanApprovalResponseEvent(
	msg domain.PlanApprovalResponseEvent,
) tea.Cmd

func (*ChatHandler) HandleTodoUpdateChatEvent added in v0.63.1

func (h *ChatHandler) HandleTodoUpdateChatEvent(
	msg domain.TodoUpdateChatEvent,
) tea.Cmd

HandleTodoUpdateChatEvent converts the chat event to a UI event for the todo component

func (*ChatHandler) HandleToolApprovalRequestedEvent added in v0.56.0

func (h *ChatHandler) HandleToolApprovalRequestedEvent(
	msg domain.ToolApprovalRequestedEvent,
) tea.Cmd

func (*ChatHandler) HandleToolApprovalResponseEvent added in v0.56.0

func (h *ChatHandler) HandleToolApprovalResponseEvent(
	msg domain.ToolApprovalResponseEvent,
) tea.Cmd

func (*ChatHandler) HandleToolCallReadyEvent added in v0.53.0

func (h *ChatHandler) HandleToolCallReadyEvent(
	msg domain.ToolCallReadyEvent,
) tea.Cmd

func (*ChatHandler) HandleToolCallUpdateEvent added in v0.53.0

func (h *ChatHandler) HandleToolCallUpdateEvent(
	msg domain.ToolCallUpdateEvent,
) tea.Cmd

func (*ChatHandler) HandleToolCommand added in v0.97.0

func (h *ChatHandler) HandleToolCommand(commandText string) tea.Cmd

HandleToolCommand processes tool commands starting with !!

func (*ChatHandler) HandleToolExecutionCompletedEvent added in v0.53.0

func (h *ChatHandler) HandleToolExecutionCompletedEvent(
	msg domain.ToolExecutionCompletedEvent,
) tea.Cmd

func (*ChatHandler) HandleToolExecutionProgressEvent added in v0.53.0

func (h *ChatHandler) HandleToolExecutionProgressEvent(
	msg domain.ToolExecutionProgressEvent,
) tea.Cmd

func (*ChatHandler) HandleToolExecutionStartedEvent added in v0.53.0

func (h *ChatHandler) HandleToolExecutionStartedEvent(
	msg domain.ToolExecutionStartedEvent,
) tea.Cmd

func (*ChatHandler) HandleUserInputEvent added in v0.53.0

func (h *ChatHandler) HandleUserInputEvent(
	msg domain.UserInputEvent,
) tea.Cmd

func (*ChatHandler) ListenForChatEvents added in v0.97.0

func (h *ChatHandler) ListenForChatEvents(eventChan <-chan domain.ChatEvent) tea.Cmd

ListenForChatEvents creates a tea.Cmd that listens for the next event from the channel

func (*ChatHandler) ListenForEvents added in v0.97.0

func (h *ChatHandler) ListenForEvents(eventChan <-chan tea.Msg) tea.Cmd

ListenForEvents creates a tea.Cmd that listens for the next event from the channel This is a generic event listener that works with any tea.Msg channel

func (*ChatHandler) ParseArguments added in v0.45.4

func (h *ChatHandler) ParseArguments(argsStr string) (map[string]any, error)

ParseArguments parses function arguments in the format key="value", key2="value2" (exposed for testing)

func (*ChatHandler) ParseToolCall added in v0.45.4

func (h *ChatHandler) ParseToolCall(input string) (string, map[string]any, error)

ParseToolCall parses a tool call in the format ToolName(arg="value", arg2="value2") (exposed for testing)

func (*ChatHandler) SetActiveToolCallID added in v0.97.0

func (h *ChatHandler) SetActiveToolCallID(id string)

SetActiveToolCallID sets the currently active tool call ID

func (*ChatHandler) SetBashDetachChan added in v0.81.0

func (h *ChatHandler) SetBashDetachChan(ch chan<- struct{})

SetBashDetachChan sets the bash detach channel (thread-safe)

type ChatMessageProcessor added in v0.45.4

type ChatMessageProcessor struct {
	// contains filtered or unexported fields
}

ChatMessageProcessor handles message processing logic

func NewChatMessageProcessor added in v0.45.4

func NewChatMessageProcessor(handler *ChatHandler) *ChatMessageProcessor

NewChatMessageProcessor creates a new message processor

func (*ChatMessageProcessor) ExtractMarkdownSummary added in v0.45.4

func (p *ChatMessageProcessor) ExtractMarkdownSummary(content string) (string, bool)

ExtractMarkdownSummary extracts the "## Summary" section from markdown content (exposed for testing)

type ChatShortcutHandler added in v0.45.4

type ChatShortcutHandler struct {
	// contains filtered or unexported fields
}

ChatShortcutHandler handles shortcut execution and side effects

func NewChatShortcutHandler added in v0.45.4

func NewChatShortcutHandler(handler *ChatHandler) *ChatShortcutHandler

NewChatShortcutHandler creates a new shortcut handler

type MessageHistoryHandler added in v0.91.0

type MessageHistoryHandler struct {
	// contains filtered or unexported fields
}

MessageHistoryHandler handles message history navigation and restoration

func NewMessageHistoryHandler added in v0.91.0

func NewMessageHistoryHandler(
	stateManager domain.StateManager,
	conversationRepo domain.ConversationRepository,
) *MessageHistoryHandler

NewMessageHistoryHandler creates a new message history handler

func (*MessageHistoryHandler) HandleEdit added in v0.92.0

HandleEdit processes the message history edit event

func (*MessageHistoryHandler) HandleEditSubmit added in v0.92.0

func (h *MessageHistoryHandler) HandleEditSubmit(event domain.MessageEditSubmitEvent) tea.Cmd

HandleEditSubmit processes the message edit submission

func (*MessageHistoryHandler) HandleNavigateBackInTime added in v0.91.0

func (h *MessageHistoryHandler) HandleNavigateBackInTime(event domain.NavigateBackInTimeEvent) tea.Cmd

HandleNavigateBackInTime processes the navigate back in time event

func (*MessageHistoryHandler) HandleRestore added in v0.91.0

HandleRestore processes the message history restore event

Jump to

Keyboard shortcuts

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