Documentation
¶
Index ¶
- func AgentConsoleArgsForLine(line string) ([]string, error)
- func AgentStreamingEnabled(_ *cfg.Option) bool
- func RunAgentConsoleWithTerminal(ctx context.Context, option *cfg.Option, appInfo AppInfo, session *agent.Agent, ...) error
- func RunIOAContext(ctx context.Context, client *ioaclient.Client, option *cfg.Option, ...) error
- func RunIOAMessages(ctx context.Context, client *ioaclient.Client, option *cfg.Option, ...) error
- func RunIOANodes(ctx context.Context, client *ioaclient.Client, option *cfg.Option, ...) error
- func RunIOASpaces(ctx context.Context, client *ioaclient.Client, option *cfg.Option, ...) error
- func RunPrompt(s *Session, label, input string) error
- func RunRemoteAgentConsole(ctx context.Context, option *cfg.Option, appInfo AppInfo, session *agent.Agent, ...) error
- func RunRemoteAgentConsoleWithControl(ctx context.Context, option *cfg.Option, appInfo AppInfo, session *agent.Agent, ...) error
- type AgentConsole
- type AgentOutput
- func (o *AgentOutput) AbortCurrentRun()
- func (o *AgentOutput) Empty()
- func (o *AgentOutput) EnsureStreamNewline()
- func (o *AgentOutput) Error(err error)
- func (o *AgentOutput) Final(content string)
- func (o *AgentOutput) HandleEvent(event agent.Event)
- func (o *AgentOutput) Queued(text string)
- func (o *AgentOutput) QueuedFollowUp(text string)
- func (o *AgentOutput) Start(label, text string)
- func (o *AgentOutput) Stopped()
- func (o *AgentOutput) Stopping()
- type AppInfo
- type ArgSpec
- type Command
- type Controller
- type EvalSettings
- type ProviderInfo
- type RenderMode
- type Session
- type StatusInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentConsoleArgsForLine ¶
func AgentStreamingEnabled ¶
AgentStreamingEnabled keeps the agent/provider path event-streamed by default, matching the streamSimple-first model. Rendering decisions are separate: non-TTY stdout can stay buffered while subscribers still receive message_update events.
func RunIOAContext ¶
func RunIOAMessages ¶
func RunIOANodes ¶
func RunIOASpaces ¶
func RunRemoteAgentConsole ¶
func RunRemoteAgentConsole(ctx context.Context, option *cfg.Option, appInfo AppInfo, session *agent.Agent, input io.Reader, output io.Writer, bus ...*eventbus.Bus[agent.Event]) error
RunRemoteAgentConsole runs the agent console over a byte-stream transport. The transport provides raw terminal input and receives terminal output.
Types ¶
type AgentConsole ¶
type AgentConsole struct {
// contains filtered or unexported fields
}
func NewAgentConsole ¶
func (*AgentConsole) InterruptCurrentRun ¶
func (r *AgentConsole) InterruptCurrentRun() bool
InterruptCurrentRun stops the current agent run or direct command.
func (*AgentConsole) Start ¶
func (r *AgentConsole) Start() error
type AgentOutput ¶
type AgentOutput struct {
// contains filtered or unexported fields
}
AgentOutput renders agent events and assistant content to the terminal. It is safe for concurrent use: a sync.Mutex serializes HandleEvent, streamDelta, and lifecycle methods so streaming tokens and bus events from different goroutines never interleave output.
func NewAgentOutput ¶
func NewAgentOutput(option *cfg.Option) *AgentOutput
func NewAgentOutputWithWriters ¶
func NewAgentOutputWithWriters(option *cfg.Option, stdout, stderr io.Writer, terminal bool) *AgentOutput
NewAgentOutputWithWriters constructs an AgentOutput for a terminal-like stream that is not necessarily backed by os.Stdout/os.Stderr.
func (*AgentOutput) AbortCurrentRun ¶
func (o *AgentOutput) AbortCurrentRun()
func (*AgentOutput) Empty ¶
func (o *AgentOutput) Empty()
func (*AgentOutput) EnsureStreamNewline ¶
func (o *AgentOutput) EnsureStreamNewline()
EnsureStreamNewline closes any open streamed line (mid-line cursor) by emitting a newline. Thread-safe wrapper for the locked variant.
func (*AgentOutput) Error ¶
func (o *AgentOutput) Error(err error)
func (*AgentOutput) Final ¶
func (o *AgentOutput) Final(content string)
func (*AgentOutput) HandleEvent ¶
func (o *AgentOutput) HandleEvent(event agent.Event)
func (*AgentOutput) Queued ¶
func (o *AgentOutput) Queued(text string)
func (*AgentOutput) QueuedFollowUp ¶
func (o *AgentOutput) QueuedFollowUp(text string)
func (*AgentOutput) Start ¶
func (o *AgentOutput) Start(label, text string)
func (*AgentOutput) Stopped ¶
func (o *AgentOutput) Stopped()
func (*AgentOutput) Stopping ¶
func (o *AgentOutput) Stopping()
type AppInfo ¶
type AppInfo struct {
Provider agent.Provider
ProviderConfig agent.ProviderConfig
ProviderFallbacks []agent.ProviderEntry
Commands *commands.CommandRegistry
Skills *skills.Store
OnProviderChange func(agent.Provider, agent.ProviderConfig)
}
AppInfo holds the subset of runtime state that tui commands need.
type Command ¶
type Command struct {
Name string
Aliases []string
Description string
Args ArgSpec
Hidden bool
Run func(ctx context.Context, s *Session, args []string) error
}
Command describes a REPL command independent of any UI framework.
func SkillCommands ¶
SkillCommands generates commands for each non-internal skill.
type Controller ¶
type Controller interface {
SubmitPrompt(label, displayText, prompt string) error
Continue() error
Stop() bool
Running() bool
}
Controller is the async execution interface that tui implements.
type EvalSettings ¶
type ProviderInfo ¶
StatusInfo collects current session state for display.
type RenderMode ¶
type RenderMode int
RenderMode selects how aggressively the renderer decorates output.
const ( // ModeInteractive: a human sits at a local TTY. Full firepower — truecolor // via lipgloss/glamour, single-line spinners, OSC 8 hyperlinks, and // synchronized-output flicker suppression. ModeInteractive RenderMode = iota // ModeForwarded: the PTY stream is consumed by a remote agent (aider). // Transient UI (spinners) is suppressed so the forwarded transcript stays a // clean line-oriented stream; OSC sequences degrade to no-ops in dumb // consumers and colors are kept (harmless — stripped or rendered downstream). ModeForwarded )
type Session ¶
type Session struct {
Ctx context.Context
Option *cfg.Option
AppInfo AppInfo
Agent *agent.Agent
Controller Controller
EvalCriteria string
OnEvalChange func(string)
}
Session holds the dependencies commands need to operate on.
type StatusInfo ¶
type StatusInfo struct {
Provider string
Model string
Providers []ProviderInfo
Mode string
Task string
IOA string
History string
Skills string
}
func CollectStatus ¶
func CollectStatus(s *Session, mode, historyPath string) StatusInfo