messages

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package messages defines all TUI message types organized by domain.

Messages are grouped into domain-specific files:

  • session.go: Session lifecycle (new, exit, save, load, etc.)
  • theme.go: Theme selection and preview
  • agent.go: Agent switching and model selection
  • toggle.go: UI state toggles (YOLO, thinking, sidebar)
  • input.go: Editor input, attachments, and speech
  • mcp.go: MCP prompt interactions

This organization follows the Elm Architecture principle of grouping messages by the domain they affect, making it easier to understand which components handle which messages.

Package messages defines all TUI message types organized by domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCommandMsg

type AgentCommandMsg struct{ Command string }

AgentCommandMsg sends a command to the agent.

type AttachFileMsg added in v1.18.4

type AttachFileMsg struct{ FilePath string }

AttachFileMsg attaches a file directly or opens file picker if empty/directory.

type ChangeModelMsg added in v1.19.0

type ChangeModelMsg struct{ ModelRef string }

ChangeModelMsg changes the model for the current agent.

type ChangeThemeMsg added in v1.20.0

type ChangeThemeMsg struct {
	ThemeRef string // Theme reference to apply
}

ChangeThemeMsg applies the specified theme.

type ClearQueueMsg added in v1.19.3

type ClearQueueMsg struct{}

ClearQueueMsg clears all queued messages.

type CompactSessionMsg

type CompactSessionMsg struct{ AdditionalPrompt string }

CompactSessionMsg generates a summary and compacts session history.

type CopyLastResponseToClipboardMsg added in v1.19.1

type CopyLastResponseToClipboardMsg struct{}

CopyLastResponseToClipboardMsg copies the last assistant response to clipboard.

type CopySessionToClipboardMsg

type CopySessionToClipboardMsg struct{}

CopySessionToClipboardMsg copies the entire conversation to clipboard.

type ElicitationResponseMsg added in v1.19.3

type ElicitationResponseMsg struct {
	Action  tools.ElicitationAction
	Content map[string]any
}

ElicitationResponseMsg contains response to an elicitation request.

type EvalSessionMsg

type EvalSessionMsg struct{ Filename string }

EvalSessionMsg saves evaluation data to the specified file.

type ExitAfterFirstResponseMsg added in v1.19.4

type ExitAfterFirstResponseMsg struct{}

ExitAfterFirstResponseMsg exits TUI after first assistant response completes.

type ExitSessionMsg

type ExitSessionMsg struct{}

ExitSessionMsg requests exiting the current session.

type ExportSessionMsg added in v1.18.6

type ExportSessionMsg struct{ Filename string }

ExportSessionMsg exports the session to the specified file.

type InsertFileRefMsg added in v1.18.4

type InsertFileRefMsg struct{ FilePath string }

InsertFileRefMsg inserts @filepath reference into editor.

type LoadSessionMsg

type LoadSessionMsg struct{ SessionID string }

LoadSessionMsg loads a session by ID.

type MCPPromptMsg

type MCPPromptMsg struct {
	PromptName string
	Arguments  map[string]string
}

MCPPromptMsg executes an MCP prompt with arguments.

type NewSessionMsg

type NewSessionMsg struct{}

NewSessionMsg requests creation of a new session.

type OpenModelPickerMsg added in v1.19.0

type OpenModelPickerMsg struct{}

OpenModelPickerMsg opens the model picker dialog.

type OpenSessionBrowserMsg

type OpenSessionBrowserMsg struct{}

OpenSessionBrowserMsg opens the session browser dialog.

type OpenThemePickerMsg added in v1.20.0

type OpenThemePickerMsg struct{}

OpenThemePickerMsg opens the theme picker dialog.

type OpenURLMsg

type OpenURLMsg struct{ URL string }

OpenURLMsg opens a URL in the browser.

type RegenerateTitleMsg added in v1.20.0

type RegenerateTitleMsg struct{}

RegenerateTitleMsg regenerates the session title using the AI.

type SendAttachmentMsg added in v1.19.3

type SendAttachmentMsg struct{ Content *session.Message }

SendAttachmentMsg is a message for the first message with an attachment.

type SendMsg added in v1.19.3

type SendMsg struct {
	Content     string            // Full content sent to the agent (with file contents expanded)
	Attachments map[string]string // Map of filename to content for attachments
}

SendMsg contains the content sent to the agent.

type SetSessionTitleMsg added in v1.20.0

type SetSessionTitleMsg struct{ Title string }

SetSessionTitleMsg sets the session title to specified value.

type ShowCostDialogMsg added in v1.18.6

type ShowCostDialogMsg struct{}

ShowCostDialogMsg shows the cost/usage dialog.

type ShowMCPPromptInputMsg

type ShowMCPPromptInputMsg struct {
	PromptName string
	PromptInfo any // mcptools.PromptInfo but avoiding import cycles
}

ShowMCPPromptInputMsg shows input dialog for MCP prompt.

type ShowPermissionsDialogMsg added in v1.20.0

type ShowPermissionsDialogMsg struct{}

ShowPermissionsDialogMsg shows the permissions dialog.

type SpeakTranscriptMsg added in v1.19.2

type SpeakTranscriptMsg struct{ Delta string }

SpeakTranscriptMsg contains transcription delta from speech-to-text.

type StartShellMsg

type StartShellMsg struct{}

StartShellMsg starts an interactive shell.

type StartSpeakMsg added in v1.19.2

type StartSpeakMsg struct{}

StartSpeakMsg starts speech-to-text transcription.

type StopSpeakMsg added in v1.19.2

type StopSpeakMsg struct{}

StopSpeakMsg stops speech-to-text transcription.

type StreamCancelledMsg added in v1.19.3

type StreamCancelledMsg struct{ ShowMessage bool }

StreamCancelledMsg notifies components that the stream has been cancelled.

type SwitchAgentMsg

type SwitchAgentMsg struct{ AgentName string }

SwitchAgentMsg switches to a different agent.

type ThemeCancelPreviewMsg added in v1.20.0

type ThemeCancelPreviewMsg struct {
	OriginalRef string // Theme reference to restore
}

ThemeCancelPreviewMsg cancels theme preview and restores original.

type ThemeChangedMsg added in v1.20.0

type ThemeChangedMsg struct{}

ThemeChangedMsg notifies components that the theme has changed (for cache invalidation).

type ThemeFileChangedMsg added in v1.20.0

type ThemeFileChangedMsg struct {
	ThemeRef string // The theme ref that was modified
}

ThemeFileChangedMsg notifies TUI that the theme file was modified on disk (hot reload). The TUI should load and apply the theme on the main goroutine to avoid race conditions.

type ThemePreviewMsg added in v1.20.0

type ThemePreviewMsg struct {
	ThemeRef    string // Theme reference to preview
	OriginalRef string // Original theme to restore on cancel
}

ThemePreviewMsg previews a theme without committing.

type ToggleHideToolResultsMsg

type ToggleHideToolResultsMsg struct{}

ToggleHideToolResultsMsg toggles hiding of tool results.

type ToggleSessionStarMsg added in v1.18.4

type ToggleSessionStarMsg struct{ SessionID string }

ToggleSessionStarMsg toggles star on a session; empty ID means current session.

type ToggleSidebarMsg added in v1.19.6

type ToggleSidebarMsg struct{}

ToggleSidebarMsg toggles sidebar visibility.

type ToggleThinkingMsg added in v1.19.3

type ToggleThinkingMsg struct{}

ToggleThinkingMsg toggles extended thinking mode.

type ToggleYoloMsg

type ToggleYoloMsg struct{}

ToggleYoloMsg toggles YOLO mode (auto-approve tools).

Jump to

Keyboard shortcuts

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