app

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package app wires together services, coordinates agents, and manages application lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLSPStates

func GetLSPStates() map[string]LSPClientInfo

GetLSPStates returns the current state of all LSP clients

func SubscribeLSPEvents

func SubscribeLSPEvents(ctx context.Context) <-chan pubsub.Event[LSPEvent]

SubscribeLSPEvents returns a channel for LSP events

Types

type App

type App struct {
	Sessions    session.Service
	Messages    message.Service
	History     history.Service
	Permissions permission.Service

	AgentCoordinator agent.Coordinator

	LSPClients *csync.Map[string, *lsp.Client]
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error)

New initializes a new application instance.

func (*App) Config

func (app *App) Config() *config.Config

Config returns the application configuration.

func (*App) InitReviewerAgent added in v0.6.0

func (app *App) InitReviewerAgent(ctx context.Context) error

func (*App) RunNonInteractive

func (app *App) RunNonInteractive(ctx context.Context, output io.Writer, prompt string, quiet bool) error

RunNonInteractive runs the application in non-interactive mode with the given prompt, printing to stdout.

func (*App) Shutdown

func (app *App) Shutdown()

Shutdown performs a graceful shutdown of the application.

func (*App) Subscribe

func (app *App) Subscribe(program *tea.Program)

Subscribe sends events to the TUI as tea.Msgs.

func (*App) UpdateAgentModel

func (app *App) UpdateAgentModel(ctx context.Context) error

type LSPClientInfo

type LSPClientInfo struct {
	Name            string
	State           lsp.ServerState
	Error           error
	Client          *lsp.Client
	DiagnosticCount int
	ConnectedAt     time.Time
}

LSPClientInfo holds information about an LSP client's state

func GetLSPState

func GetLSPState(name string) (LSPClientInfo, bool)

GetLSPState returns the state of a specific LSP client

type LSPEvent

type LSPEvent struct {
	Type            LSPEventType
	Name            string
	State           lsp.ServerState
	Error           error
	DiagnosticCount int
}

LSPEvent represents an event in the LSP system

type LSPEventType

type LSPEventType string

LSPEventType represents the type of LSP event

const (
	LSPEventStateChanged       LSPEventType = "state_changed"
	LSPEventDiagnosticsChanged LSPEventType = "diagnostics_changed"
)

Jump to

Keyboard shortcuts

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