Documentation
¶
Overview ¶
Package tui presents the Coding Runtime as a terminal-first chat interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bootstrap ¶
type Bootstrap func(context.Context, bool) (Controller, error)
Bootstrap loads configuration and opens the first Runtime. trustProject is the user's explicit Workspace trust decision.
type Controller ¶
type Controller interface {
Prompt(context.Context, ...ai.Message) iter.Seq2[coding.Event, error]
Continue(context.Context) iter.Seq2[coding.Event, error]
Resolve(context.Context, approval.Resolution) iter.Seq2[coding.Event, error]
ResolveQuestion(context.Context, question.Resolution) iter.Seq2[coding.Event, error]
RejectQuestion(context.Context, string, string) iter.Seq2[coding.Event, error]
Tree(context.Context) (coding.SessionTree, error)
PreviewCompaction(context.Context) (coding.CompactionPreview, error)
Compact(context.Context, coding.CompactionRequest) iter.Seq2[coding.Event, error]
Steer(...ai.Message) error
FollowUp(...ai.Message) error
Cancel() error
Reload(context.Context) error
ListWorkspaceFiles(context.Context) (attachment.Snapshot, error)
ResolveWorkspaceFile(context.Context, attachment.Reference) (attachment.Resolved, error)
Snapshot() coding.State
SessionID() string
Model() runtimecontrol.ModelState
Capabilities() ai.Capabilities
Mode() runtimecontrol.ModeState
SetMode(context.Context, coding.OperatingMode) error
Permissions() runtimecontrol.PermissionState
NewFullAccessConfirmation(context.Context, runtimecontrol.PermissionUpdate) (*runtimecontrol.FullAccessConfirmation, error)
SetPermissions(context.Context, runtimecontrol.PermissionUpdate, ...*runtimecontrol.FullAccessConfirmation) error
WorkspaceStatus(context.Context) (changes.WorktreeStatus, error)
Models() []modelcatalog.Entry
Config() config.Config
Detached() bool
ListSessions(context.Context) ([]session.Metadata, error)
ListSessionSummaries(context.Context) ([]runtimecontrol.SessionSummary, error)
ListSubagents(context.Context) ([]subagent.Summary, error)
InspectSubagent(context.Context, string) (subagent.Detail, error)
InspectSubagentState(context.Context, string) (coding.State, error)
GenerateTeamProposal(context.Context, coding.TeamProposalPrompt) (coding.TeamProposal, error)
ReviseTeamProposal(context.Context, string, string) (coding.TeamProposal, error)
DeclineTeam(context.Context, string) error
ConfirmTeam(context.Context, coding.TeamConfirmation) (coding.TeamReference, error)
ReadTeam(context.Context, coding.TeamReadRequest) (coding.TeamView, error)
SubmitTeamControl(context.Context, coding.TeamControlRequest) (coding.TeamControlReference, error)
ResolveTeamWorkerApproval(
context.Context,
coding.TeamWorkerTarget,
approval.Resolution,
) (coding.TeamControlReference, error)
ResolveTeamWorkerQuestion(
context.Context,
coding.TeamWorkerTarget,
question.Resolution,
) (coding.TeamControlReference, error)
RejectTeamWorkerQuestion(
context.Context,
coding.TeamWorkerTarget,
string,
string,
) (coding.TeamControlReference, error)
ObserveTeamWorker(context.Context, coding.TeamWorkerTarget) (coding.EventObservation, error)
InspectTeamWorkerState(context.Context, coding.TeamWorkerTarget) (coding.State, error)
DiscoverTeamRecovery(context.Context) ([]coding.TeamRecoveryCandidate, error)
ResumeTeam(
context.Context,
team.ID,
coding.TeamResumeDecision,
) (coding.TeamReference, error)
PrepareTeamIntegration(
context.Context,
coding.TeamIntegrationRequest,
) (coding.TeamIntegrationPreview, error)
ApplyTeamIntegration(
context.Context,
coding.TeamIntegrationApproval,
) (coding.TeamIntegrationResult, error)
RejectTeamIntegration(context.Context, coding.TeamIntegrationApproval) error
TeamIntegrationRecoveries(context.Context) ([]coding.TeamIntegrationRecovery, error)
RecoverTeamIntegration(
context.Context,
coding.TeamIntegrationRecoveryRequest,
) (coding.TeamIntegrationResult, error)
CleanupTeam(context.Context, coding.TeamCleanupRequest) (coding.TeamCleanupResult, error)
Skills(context.Context) (coding.SkillSnapshot, error)
SetSkillEnabled(context.Context, coding.SkillID, bool) error
WaitSubagent(context.Context, string) (subagent.Result, error)
CancelSubagent(context.Context, string) error
NewSession(context.Context) error
ResumeSession(context.Context, string) error
ForkSession(context.Context, string) error
SwitchModel(context.Context, modelcatalog.Selection) error
Close(context.Context) error
}
Controller is the application control surface consumed by the TUI.
type ExitHandler ¶
ExitHandler runs after terminal restoration and Controller release.
type ImageClipboard ¶
ImageClipboard is the one-method clipboard boundary consumed by the TUI.
type ImageIngress ¶
type ImageIngress interface {
Receive(context.Context) (attachment.Image, error)
}
ImageIngress receives validated immutable images from an application-owned bridge such as one remote SSH session.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubble Tea state machine.
type Options ¶
type Options struct {
Input io.Reader
Output io.Writer
Environment []string
Workspace string
ThemeDirectory string
Trusted bool
NoColor bool
Bootstrap Bootstrap
Clipboard ImageClipboard
ImageIngress ImageIngress
OnExit ExitHandler
StatusLine []statusline.Item
SaveStatusLine StatusLineSaver
SaveTheme ThemeSaver
}
Options contain the CLI-owned resources used by one TUI Program.
type StatusLineSaver ¶
type StatusLineSaver func(context.Context, []statusline.Item) error
StatusLineSaver atomically persists one complete ordered field selection.
type ThemeSaver ¶
ThemeSaver persists only the requested theme ID in the active config file.
type TrustError ¶
type TrustError struct {
Err error
}
TrustError means persisting an explicit Workspace trust decision failed and the Trust Overlay should remain available for retry.
func (*TrustError) Error ¶
func (e *TrustError) Error() string
func (*TrustError) Unwrap ¶
func (e *TrustError) Unwrap() error
Unwrap returns the persistence failure.
Source Files
¶
- action.go
- activity.go
- agents_overlay.go
- banner.go
- bridge.go
- clipboard.go
- command_picker.go
- composer.go
- composer_submission.go
- control.go
- direct_agent.go
- file_picker.go
- image_ingress.go
- markdown.go
- model.go
- patch_preview.go
- permissions_picker.go
- picker.go
- plan_review.go
- print.go
- prompt.go
- route.go
- route_search.go
- route_skills.go
- route_team.go
- route_team_integration.go
- route_team_presentation.go
- route_team_worker.go
- route_tree.go
- run.go
- scrollback.go
- selection.go
- session_picker.go
- skill_picker.go
- statusline_picker.go
- streaming.go
- subagent_interaction.go
- surface_helpers.go
- team_interaction.go
- team_panel.go
- team_projection.go
- theme.go
- theme_picker.go
- theme_registry.go
- theme_runtime.go
- timeline.go
- tool_activity.go
- tool_detail.go
- workspace_changes.go