Help us shape the future of Go! Take the 2026 Go Developer Survey

code

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 48 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 code.Agent, sessionID string) *App

New borrows the agent and workspace. The host closes them after Run returns.

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) SetBackgroundStatus added in v0.15.0

func (a *App) SetBackgroundStatus(message string, warning bool)

SetBackgroundStatus reports optional workspace setup without interrupting input or adding infrastructure messages to the conversation transcript.

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
	PhaseRetrying
	PhaseStopping
)

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) InsertPaste added in v0.16.10

func (e *Editor) InsertPaste(text string)

func (*Editor) Render added in v0.11.0

func (e *Editor) Render(width, maxRows int, chrome EditorChrome) ([]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 EditorChrome added in v0.12.1

type EditorChrome struct {
	TopLabel    string
	BottomLeft  string
	BottomRight string
	TopColor    ansi.Color
	Attachments []string
}

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 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
	Group          string
	Keywords       string
	Shortcut       string
	Checked        bool
	Disabled       bool
	DisabledReason string
}

Jump to

Keyboard shortcuts

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