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 NewAgentOutput(option *cfg.Option) *AgentOutput
- func NewAgentOutputWithWriters(option *cfg.Option, stdout, stderr io.Writer, terminal bool) *AgentOutput
- func NewStaticAgentOutput(option *cfg.Option) *AgentOutput
- func NewStaticAgentOutputWithWriters(option *cfg.Option, stdout, stderr io.Writer, terminal bool) *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) Markdown() bool
- func (o *AgentOutput) Queued(text string)
- func (o *AgentOutput) QueuedFollowUp(text string)
- func (o *AgentOutput) SetVerbosity(level int)
- func (o *AgentOutput) Start(label, text string)
- func (o *AgentOutput) Stderr() io.Writer
- func (o *AgentOutput) Stdout() io.Writer
- func (o *AgentOutput) Stopped()
- func (o *AgentOutput) Stopping()
- func (o *AgentOutput) VerbosityLabel() string
- func (o *AgentOutput) VerbosityLevel() int
- type AppInfo
- type ArgSpec
- type Command
- type Controller
- type EvalSettings
- type LiveStatus
- func (l *LiveStatus) BeginTurn()
- func (l *LiveStatus) ContextUsage(tokens int) string
- func (l *LiveStatus) DrainTools() []agent.Event
- func (l *LiveStatus) FinishAgent(event agent.Event)
- func (l *LiveStatus) FinishTurn(event agent.Event)
- func (l *LiveStatus) HasTools() bool
- func (l *LiveStatus) MessageUpdate(event agent.Event, contentDelta bool)
- func (l *LiveStatus) Render()
- func (l *LiveStatus) Reset()
- func (l *LiveStatus) Running() bool
- func (l *LiveStatus) SetContextWindow(tokens int)
- func (l *LiveStatus) ShowEvalRound(round int)
- func (l *LiveStatus) StartTool(event agent.Event)
- func (l *LiveStatus) Status() string
- func (l *LiveStatus) Stop()
- func (l *LiveStatus) StopAndDrainTools() []agent.Event
- func (l *LiveStatus) UpdateTool(event agent.Event) (tracked bool, done bool)
- func (l *LiveStatus) WithHidden(fn func())
- type LiveView
- type ProviderInfo
- type RenderMode
- type Session
- type StatusInfo
- type StreamWriter
- func (w *StreamWriter) ContentPrinted() int
- func (w *StreamWriter) Delta(content, reasoning *string)
- func (w *StreamWriter) EnsureLiveBoundary()
- func (w *StreamWriter) EnsureNewline()
- func (w *StreamWriter) Flush()
- func (w *StreamWriter) MarkStreamed()
- func (w *StreamWriter) NewTurn()
- func (w *StreamWriter) ReasoningPrinted() int
- func (w *StreamWriter) Reset()
- func (w *StreamWriter) Streamed() bool
- func (w *StreamWriter) WouldPrintContentDelta(content *string) bool
- func (w *StreamWriter) WouldPrintDelta(content, reasoning *string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentConsoleArgsForLine ¶
func AgentStreamingEnabled ¶
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
}
func NewAgentOutput ¶
func NewAgentOutput(option *cfg.Option) *AgentOutput
func NewStaticAgentOutput ¶ added in v0.2.7
func NewStaticAgentOutput(option *cfg.Option) *AgentOutput
func NewStaticAgentOutputWithWriters ¶ added in v0.2.7
func (*AgentOutput) AbortCurrentRun ¶
func (o *AgentOutput) AbortCurrentRun()
func (*AgentOutput) Empty ¶
func (o *AgentOutput) Empty()
func (*AgentOutput) EnsureStreamNewline ¶
func (o *AgentOutput) EnsureStreamNewline()
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) Markdown ¶ added in v0.2.7
func (o *AgentOutput) Markdown() bool
Markdown returns whether markdown rendering is enabled.
func (*AgentOutput) Queued ¶
func (o *AgentOutput) Queued(text string)
func (*AgentOutput) QueuedFollowUp ¶
func (o *AgentOutput) QueuedFollowUp(text string)
func (*AgentOutput) SetVerbosity ¶ added in v0.2.7
func (o *AgentOutput) SetVerbosity(level int)
func (*AgentOutput) Start ¶
func (o *AgentOutput) Start(label, text string)
func (*AgentOutput) Stderr ¶ added in v0.2.7
func (o *AgentOutput) Stderr() io.Writer
Stderr returns the stream writer's stderr for direct output.
func (*AgentOutput) Stdout ¶ added in v0.2.7
func (o *AgentOutput) Stdout() io.Writer
Stdout returns the stream writer's stdout.
func (*AgentOutput) Stopped ¶
func (o *AgentOutput) Stopped()
func (*AgentOutput) Stopping ¶
func (o *AgentOutput) Stopping()
func (*AgentOutput) VerbosityLabel ¶ added in v0.2.7
func (o *AgentOutput) VerbosityLabel() string
func (*AgentOutput) VerbosityLevel ¶ added in v0.2.7
func (o *AgentOutput) VerbosityLevel() int
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 LiveStatus ¶ added in v0.2.7
type LiveStatus struct {
// contains filtered or unexported fields
}
func NewLiveStatus ¶ added in v0.2.7
func (*LiveStatus) BeginTurn ¶ added in v0.2.7
func (l *LiveStatus) BeginTurn()
func (*LiveStatus) ContextUsage ¶ added in v0.2.7
func (l *LiveStatus) ContextUsage(tokens int) string
func (*LiveStatus) DrainTools ¶ added in v0.2.7
func (l *LiveStatus) DrainTools() []agent.Event
func (*LiveStatus) FinishAgent ¶ added in v0.2.7
func (l *LiveStatus) FinishAgent(event agent.Event)
func (*LiveStatus) FinishTurn ¶ added in v0.2.7
func (l *LiveStatus) FinishTurn(event agent.Event)
func (*LiveStatus) HasTools ¶ added in v0.2.7
func (l *LiveStatus) HasTools() bool
func (*LiveStatus) MessageUpdate ¶ added in v0.2.7
func (l *LiveStatus) MessageUpdate(event agent.Event, contentDelta bool)
func (*LiveStatus) Render ¶ added in v0.2.7
func (l *LiveStatus) Render()
func (*LiveStatus) Reset ¶ added in v0.2.7
func (l *LiveStatus) Reset()
func (*LiveStatus) Running ¶ added in v0.2.7
func (l *LiveStatus) Running() bool
func (*LiveStatus) SetContextWindow ¶ added in v0.2.7
func (l *LiveStatus) SetContextWindow(tokens int)
func (*LiveStatus) ShowEvalRound ¶ added in v0.2.7
func (l *LiveStatus) ShowEvalRound(round int)
func (*LiveStatus) StartTool ¶ added in v0.2.7
func (l *LiveStatus) StartTool(event agent.Event)
func (*LiveStatus) Status ¶ added in v0.2.7
func (l *LiveStatus) Status() string
func (*LiveStatus) Stop ¶ added in v0.2.7
func (l *LiveStatus) Stop()
func (*LiveStatus) StopAndDrainTools ¶ added in v0.2.7
func (l *LiveStatus) StopAndDrainTools() []agent.Event
func (*LiveStatus) UpdateTool ¶ added in v0.2.7
func (l *LiveStatus) UpdateTool(event agent.Event) (tracked bool, done bool)
func (*LiveStatus) WithHidden ¶ added in v0.2.7
func (l *LiveStatus) WithHidden(fn func())
type LiveView ¶ added in v0.2.7
type LiveView struct {
// contains filtered or unexported fields
}
LiveView manages a transient, animated region on the terminal. Lines containing spinnerSentinel get the current animation frame injected on each tick. Stop erases the region cleanly.
func (*LiveView) WithHidden ¶ added in v0.2.7
func (v *LiveView) WithHidden(fn func())
type ProviderInfo ¶
StatusInfo collects current session state for display.
type RenderMode ¶
type RenderMode int
const ( ModeInteractive RenderMode = iota ModeStatic 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
type StreamWriter ¶ added in v0.2.7
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter manages token-by-token content streaming with paragraph-level markdown buffering and reasoning block tracking. It owns all cursor state for the stdout/stderr interleaving.
func NewStreamWriter ¶ added in v0.2.7
func (*StreamWriter) ContentPrinted ¶ added in v0.2.7
func (w *StreamWriter) ContentPrinted() int
ContentPrinted returns the number of content bytes already flushed.
func (*StreamWriter) Delta ¶ added in v0.2.7
func (w *StreamWriter) Delta(content, reasoning *string)
Delta processes a new token delta (content and/or reasoning).
func (*StreamWriter) EnsureLiveBoundary ¶ added in v0.2.7
func (w *StreamWriter) EnsureLiveBoundary()
func (*StreamWriter) EnsureNewline ¶ added in v0.2.7
func (w *StreamWriter) EnsureNewline()
EnsureNewline closes any mid-line stdout cursor.
func (*StreamWriter) Flush ¶ added in v0.2.7
func (w *StreamWriter) Flush()
Flush writes any buffered content and closes open reasoning blocks.
func (*StreamWriter) MarkStreamed ¶ added in v0.2.7
func (w *StreamWriter) MarkStreamed()
MarkStreamed marks the current content as rendered directly.
func (*StreamWriter) NewTurn ¶ added in v0.2.7
func (w *StreamWriter) NewTurn()
NewTurn resets per-turn counters (called at EventTurnStart).
func (*StreamWriter) ReasoningPrinted ¶ added in v0.2.7
func (w *StreamWriter) ReasoningPrinted() int
ReasoningPrinted returns the number of reasoning bytes already flushed.
func (*StreamWriter) Reset ¶ added in v0.2.7
func (w *StreamWriter) Reset()
Reset clears all state (called at run start).
func (*StreamWriter) Streamed ¶ added in v0.2.7
func (w *StreamWriter) Streamed() bool
Streamed returns true if any content was streamed this run.
func (*StreamWriter) WouldPrintContentDelta ¶ added in v0.2.7
func (w *StreamWriter) WouldPrintContentDelta(content *string) bool
func (*StreamWriter) WouldPrintDelta ¶ added in v0.2.7
func (w *StreamWriter) WouldPrintDelta(content, reasoning *string) bool
WouldPrintDelta reports whether Delta would emit visible output for this update. Role-only updates, hidden reasoning, and partial markdown chunks keep the live "thinking" view on screen.