app

package
v0.228.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 32 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 tui.VersionInfo,
	agentSupervisor a2adomain.AgentSupervisor,
	agentService agentdomain.AgentService,
	backgroundTaskService a2adomain.BackgroundTaskService,
	backgroundTaskRegistry scheddomain.BackgroundTaskRegistry,
	conversationOptimizer convdomain.ConversationOptimizer,
	conversationRepo convdomain.ConversationRepository,
	fileService agentdomain.FileService,
	imageService agentdomain.ImageService,
	skillsService agentdomain.SkillsService,
	githubIssueService agentdomain.GitHubIssueService,
	githubSetupService agentdomain.GitHubSetupService,
	mcpSupervisor mcpdomain.Supervisor,
	messageQueue convdomain.MessageQueue,
	modelService convdomain.ModelService,
	pricingService convdomain.PricingService,
	sessionRolloverManager convdomain.SessionRollover,
	stateManager *statemanager.Store,
	taskRetentionService a2adomain.TaskRetentionService,
	themeService tui.ThemeService,
	toolService agentdomain.ToolService,
	shortcutRegistry *shortcuts.Registry,
	toolRegistry *tools.Registry,
	approvalCoordinator tui.ApprovalCoordinator,
	chatCompletionRunner tui.ChatCompletionRunner,
	directExecutionService tui.DirectExecutionService,
	toolExecutionCoordinator tui.ToolExecutionCoordinator,
	shellHistoryStore storage.ShellHistoryStorage,
	tokenEstimator convdomain.TokenEstimator,
) *ChatApplication

nolint: funlen // NewChatApplication creates a new chat application

func (*ChatApplication) GetAgentService

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

GetAgentService returns the agent service

func (*ChatApplication) GetAutocomplete

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

GetAutocomplete returns the autocomplete component

func (*ChatApplication) GetConfig

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

GetConfig returns the configuration for keybinding context

func (*ChatApplication) GetConversationRepository

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

GetServices returns the service container

func (*ChatApplication) GetConversationView

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

GetConversationView returns the conversation view

func (*ChatApplication) GetCurrentConversationID

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

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

GetImageService returns the image service

func (*ChatApplication) GetInputView

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

GetInputView returns the input view

func (*ChatApplication) GetPageSize

func (app *ChatApplication) GetPageSize() int

GetPageSize returns the current page size for scrolling

func (*ChatApplication) GetStateStore added in v0.207.0

func (app *ChatApplication) GetStateStore() keybinding.StateStore

GetStateStore returns the current state manager as the narrow slice key handlers consume.

func (*ChatApplication) GetStatusView

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

GetStatusView returns the status view

func (*ChatApplication) Init

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

Init initializes the application

func (*ChatApplication) PrintConversationHistory

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

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

SendMessage sends the current message

func (*ChatApplication) SetTranscriptStore added in v0.220.0

func (app *ChatApplication) SetTranscriptStore(store TranscriptStore)

SetTranscriptStore wires the store sub-agent transcripts are read from.

func (*ChatApplication) ToggleRawFormat

func (app *ChatApplication) ToggleRawFormat()

ToggleRawFormat toggles between raw and rendered markdown display

func (*ChatApplication) ToggleThinkingExpansion

func (app *ChatApplication) ToggleThinkingExpansion()

ToggleThinkingExpansion toggles thinking block expansion

func (*ChatApplication) ToggleToolResultExpansion

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. Mouse tracking is always on; terminals bypass it for text selection with Shift+drag (Option+drag on macOS terminals).

type TranscriptStore added in v0.220.0

type TranscriptStore interface {
	LoadConversation(ctx context.Context, conversationID string) ([]convdomain.ConversationEntry, convdomain.ConversationMetadata, error)
}

TranscriptStore reads a stored conversation without touching the live one, so the chat can show what a running sub-agent has written so far.

Jump to

Keyboard shortcuts

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