code

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(ctx context.Context, coderAgent *coder.Agent, sessionID string) *App

func (*App) Confirm

func (a *App) Confirm(ctx context.Context, message string) (bool, error)

func (*App) Elicit added in v0.10.1

func (a *App) Elicit(ctx context.Context, req tool.ElicitRequest) (tool.ElicitResult, error)

func (*App) Run

func (a *App) Run() error

func (*App) SetSessionID

func (a *App) SetSessionID(id string)

func (*App) WithTerminal added in v0.11.0

func (a *App) WithTerminal(t *inline.Terminal)

WithTerminal replaces the terminal, used by tests.

type AppPhase

type AppPhase int
const (
	PhaseIdle AppPhase = iota
	PhasePreparing
	PhaseThinking
	PhaseStreaming
	PhaseToolRunning
)

type Editor added in v0.11.0

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

Editor is a multiline input bounded by horizontal rules. The rule color is a status channel (mode, activity) set by the app.

func NewEditor added in v0.11.0

func NewEditor() *Editor

func (*Editor) AddHistory added in v0.11.0

func (e *Editor) AddHistory(entry string)

func (*Editor) HandleKey added in v0.11.0

func (e *Editor) HandleKey(ev inline.KeyEvent) bool

HandleKey processes an input event. It reports whether the event was consumed; unconsumed navigation (history recall) is handled by the caller.

func (*Editor) HistoryNext added in v0.11.0

func (e *Editor) HistoryNext() bool

func (*Editor) HistoryPrev added in v0.11.0

func (e *Editor) HistoryPrev() bool

func (*Editor) Insert added in v0.11.0

func (e *Editor) Insert(text string)

func (*Editor) Render added in v0.11.0

func (e *Editor) Render(width, maxRows int) ([]string, inline.Pos)

Render returns the editor lines (rules included) and the cursor position relative to the returned block.

func (*Editor) ReplaceRange added in v0.11.7

func (e *Editor) ReplaceRange(from, to int, text string)

ReplaceRange substitutes the rune range [from, to) with text and leaves the cursor after the inserted text.

func (*Editor) ResetHistoryCursor added in v0.11.0

func (e *Editor) ResetHistoryCursor()

func (*Editor) SetPlaceholder added in v0.11.0

func (e *Editor) SetPlaceholder(p string)

func (*Editor) SetRuleColor added in v0.11.0

func (e *Editor) SetRuleColor(c ansi.Color)

func (*Editor) SetText added in v0.11.0

func (e *Editor) SetText(text string)

func (*Editor) Text added in v0.11.0

func (e *Editor) Text() string

type Mode

type Mode int
const (
	ModeAgent Mode = iota
	ModePlan
)

type Overlay added in v0.11.0

type Overlay interface {
	HandleKey(ev inline.KeyEvent) bool
	Render(width, height int) []string
}

Overlay is a full-screen view replacing the chat frame. HandleKey returns true when the overlay should close.

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

Popup is the single list component behind slash-command completion, file mentions, and the model/effort/rewind pickers. It renders below the composer. Standalone pickers (popupList) capture all input; the other kinds filter as the user types in the editor.

func (*Popup) Current added in v0.11.0

func (p *Popup) Current() (PopupItem, bool)

func (*Popup) Empty added in v0.11.0

func (p *Popup) Empty() bool

func (*Popup) HandleKey added in v0.11.0

func (p *Popup) HandleKey(ev inline.KeyEvent) (bool, bool)

HandleKey processes navigation. Returns (consumed, closed).

func (*Popup) Render added in v0.11.0

func (p *Popup) Render(width int) []string

func (*Popup) SelectID added in v0.11.0

func (p *Popup) SelectID(id string)

func (*Popup) SetQuery added in v0.11.0

func (p *Popup) SetQuery(query string)

func (*Popup) SetSelected added in v0.11.0

func (p *Popup) SetSelected(id string, on bool)

type PopupItem added in v0.11.0

type PopupItem struct {
	ID     string
	Label  string
	Detail string
}

Jump to

Keyboard shortcuts

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