app

package
v0.153.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatApplication

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

ChatApplication represents the main application model using state management

func NewChatApplication

func NewChatApplication(
	cfg *config.Config,
	models []string,
	defaultModel string,
	versionInfo domain.VersionInfo,
	agentManager domain.AgentManager,
	agentService domain.AgentService,
	backgroundTaskService domain.BackgroundTaskService,
	backgroundTaskRegistry domain.BackgroundTaskRegistry,
	conversationOptimizer domain.ConversationOptimizer,
	conversationRepo domain.ConversationRepository,
	fileService domain.FileService,
	imageService domain.ImageService,
	skillsService domain.SkillsService,
	githubIssueService domain.GitHubIssueService,
	githubSetupService domain.GitHubSetupService,
	mcpManager domain.MCPManager,
	messageQueue domain.MessageQueue,
	modelService domain.ModelService,
	pricingService domain.PricingService,
	sessionRolloverManager *services.SessionRolloverManager,
	stateManager *services.StateManager,
	taskRetentionService domain.TaskRetentionService,
	themeService domain.ThemeService,
	toolService domain.ToolService,
	shortcutRegistry *shortcuts.Registry,
	toolRegistry *tools.Registry,
	a2aTaskCoordinator domain.A2ATaskCoordinator,
	approvalCoordinator domain.ApprovalCoordinator,
	chatCompletionRunner domain.ChatCompletionRunner,
	directExecutionService domain.DirectExecutionService,
	toolExecutionCoordinator domain.ToolExecutionCoordinator,
	shellHistoryStore storage.ShellHistoryStorage,
) *ChatApplication

nolint: funlen // NewChatApplication creates a new chat application

func (*ChatApplication) GetAgentService added in v0.48.0

func (app *ChatApplication) GetAgentService() domain.AgentService

GetAgentService returns the agent service

func (*ChatApplication) GetAutocomplete added in v0.76.5

func (app *ChatApplication) GetAutocomplete() ui.AutocompleteComponent

GetAutocomplete returns the autocomplete component

func (*ChatApplication) GetConfig added in v0.36.0

func (app *ChatApplication) GetConfig() *config.Config

GetConfig returns the configuration for keybinding context

func (*ChatApplication) GetConfigDir added in v0.89.0

func (app *ChatApplication) GetConfigDir() string

GetConfigDir returns the configuration directory path

func (*ChatApplication) GetConversationRepository added in v0.36.0

func (app *ChatApplication) GetConversationRepository() domain.ConversationRepository

GetServices returns the service container

func (*ChatApplication) GetConversationView added in v0.27.0

func (app *ChatApplication) GetConversationView() ui.ConversationRenderer

GetConversationView returns the conversation view

func (*ChatApplication) GetCurrentConversationID added in v0.133.0

func (app *ChatApplication) GetCurrentConversationID() string

GetCurrentConversationID returns the current conversation ID from the repository. Returns an empty string for in-memory (non-persistent) repositories.

func (*ChatApplication) GetImageService added in v0.57.0

func (app *ChatApplication) GetImageService() domain.ImageService

GetImageService returns the image service

func (*ChatApplication) GetInputView added in v0.27.0

func (app *ChatApplication) GetInputView() ui.InputComponent

GetInputView returns the input view

func (*ChatApplication) GetMouseEnabled added in v0.76.2

func (app *ChatApplication) GetMouseEnabled() bool

GetMouseEnabled returns the current mouse mode state

func (*ChatApplication) GetPageSize added in v0.27.0

func (app *ChatApplication) GetPageSize() int

GetPageSize returns the current page size for scrolling

func (*ChatApplication) GetStateManager added in v0.27.0

func (app *ChatApplication) GetStateManager() *services.StateManager

GetStateManager returns the current state manager

func (*ChatApplication) GetStatusView added in v0.27.0

func (app *ChatApplication) GetStatusView() ui.StatusComponent

GetStatusView returns the status view

func (*ChatApplication) Init

func (app *ChatApplication) Init() tea.Cmd

Init initializes the application

func (*ChatApplication) PrintConversationHistory added in v0.74.0

func (app *ChatApplication) PrintConversationHistory()

PrintConversationHistory outputs the full conversation history to stdout This is called when the application exits to preserve the chat session

func (*ChatApplication) SendMessage added in v0.27.0

func (app *ChatApplication) SendMessage() tea.Cmd

SendMessage sends the current message

func (*ChatApplication) SetMouseEnabled added in v0.76.2

func (app *ChatApplication) SetMouseEnabled(enabled bool)

SetMouseEnabled sets the mouse mode state

func (*ChatApplication) ToggleRawFormat added in v0.61.0

func (app *ChatApplication) ToggleRawFormat()

ToggleRawFormat toggles between raw and rendered markdown display

func (*ChatApplication) ToggleThinkingExpansion added in v0.97.0

func (app *ChatApplication) ToggleThinkingExpansion()

ToggleThinkingExpansion toggles thinking block expansion

func (*ChatApplication) ToggleToolResultExpansion added in v0.27.0

func (app *ChatApplication) ToggleToolResultExpansion()

ToggleToolResultExpansion toggles tool result expansion. While an approval is pending, ctrl+o instead expands the pending diff preview so it can be reviewed in full before approving — consistent with expanding tool results inline.

func (*ChatApplication) Update

func (app *ChatApplication) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles all application messages using the state management system. It is the single ingress for every message - background producers push through the UI notifier (program.Send), so this is the one place to measure handler duration: a slow handler in the single-threaded loop is a visible UI freeze.

func (*ChatApplication) View

func (app *ChatApplication) View() tea.View

View renders the current application view using state management. Bubble Tea v2 expects tea.View; viewContent keeps the original string-composition logic and View wraps it. MouseMode is read from the app's mouse-enabled state on every render so the ctrl+s toggle actually takes effect - without this, no mouse/wheel events arrive.

Jump to

Keyboard shortcuts

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