Documentation
¶
Index ¶
- func NewEnhancedTextArea() textarea.Model
- func NewEnhancedTextInput() textinput.Model
- func NewEnhancedThinkingSpinner(_ string) spinner.Model
- func NewEnhancedViewport(width, height int) viewport.Model
- func NewSmoothViewport(width, height int) viewport.Model
- func RegisterToolRenderer(name string, r ToolRenderer)
- func RenderAnimatedStatus(status string, _ int) string
- func RenderBadge(text, badgeType string) string
- func RenderCharacterCount(current, max int) string
- func RenderCompletedThinkingText() string
- func RenderConnectionStatus(connected bool, details string) string
- func RenderCurrentTime() string
- func RenderCustomScrollbar(viewportHeight, contentHeight, scrollTop int) string
- func RenderEnhancedCodeBlock(content string) string
- func RenderEnhancedHeader(text string) string
- func RenderEnhancedInput(input textinput.Model, focused bool) string
- func RenderEnhancedStatusBar(sections []string) string
- func RenderEnhancedTextArea(textarea textarea.Model, focused bool) string
- func RenderEnhancedThinkingText(sp spinner.Model) string
- func RenderInputSuggestions(suggestions []string, selectedIndex int) string
- func RenderKeyHint(key, description string) string
- func RenderKeyHints(hints []string) string
- func RenderMessageSeparator() string
- func RenderModeIndicator(mode string) string
- func RenderProgressBar(current, total int, label string) string
- func RenderScrollHint(direction string) string
- func RenderScrollPosition(current, total int) string
- func RenderSectionDivider() string
- func RenderShadowContainer(content string) string
- func RenderStatus(status string, statusType string) string
- func RenderStatusIndicator(status string) string
- func RenderTimelineLine() string
- func RenderTimelineNode(completed bool) string
- func RenderTokenUsage(current, max int, _ string) string
- func Run(opts Options) error
- type Annotation
- type ApprovalDecision
- type ApprovalDisposition
- type ApprovalHandler
- type ApprovalRequest
- type Event
- type EventType
- type FileType
- type MCPService
- type MarkdownRenderResult
- type MarkdownStyleConfig
- func (s *MarkdownStyleConfig) Code() lipgloss.Style
- func (s *MarkdownStyleConfig) Emphasis() lipgloss.Style
- func (s *MarkdownStyleConfig) Heading(level int) lipgloss.Style
- func (s *MarkdownStyleConfig) Highlight(color string) lipgloss.Style
- func (s *MarkdownStyleConfig) InlineCode() lipgloss.Style
- func (s *MarkdownStyleConfig) Link() lipgloss.Style
- func (s *MarkdownStyleConfig) Strikethrough() lipgloss.Style
- func (s *MarkdownStyleConfig) Strong() lipgloss.Style
- func (s *MarkdownStyleConfig) Text() lipgloss.Style
- type Observer
- type Options
- type RunPromptInput
- type Runner
- type SessionStore
- type SimpleCache
- type SimpleMarkdownRenderer
- type StartupGuide
- type SubAgentToolCall
- type ToolRenderResult
- type ToolRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEnhancedTextArea ¶
Enhanced textarea with better styling
func NewEnhancedTextInput ¶
Enhanced input with placeholder and better visual feedback
func NewEnhancedViewport ¶
func NewSmoothViewport ¶
func RegisterToolRenderer ¶ added in v0.1.7
func RegisterToolRenderer(name string, r ToolRenderer)
RegisterToolRenderer registers a ToolRenderer for the given tool name.
func RenderAnimatedStatus ¶
func RenderBadge ¶
func RenderCharacterCount ¶
Render character count
func RenderCompletedThinkingText ¶
func RenderCompletedThinkingText() string
func RenderConnectionStatus ¶
func RenderCurrentTime ¶
func RenderCurrentTime() string
func RenderCustomScrollbar ¶
func RenderEnhancedCodeBlock ¶
func RenderEnhancedHeader ¶
func RenderEnhancedInput ¶
Render enhanced input with focus state
func RenderEnhancedStatusBar ¶
func RenderEnhancedTextArea ¶
Render enhanced textarea with focus state
func RenderInputSuggestions ¶
Render input suggestions
func RenderKeyHint ¶
func RenderKeyHints ¶
func RenderMessageSeparator ¶
func RenderMessageSeparator() string
func RenderProgressBar ¶
func RenderScrollHint ¶
func RenderScrollPosition ¶
func RenderSectionDivider ¶
func RenderSectionDivider() string
func RenderShadowContainer ¶
func RenderStatus ¶
func RenderStatusIndicator ¶
func RenderTimelineLine ¶
func RenderTimelineLine() string
func RenderTimelineNode ¶
func RenderTokenUsage ¶
Types ¶
type Annotation ¶
Annotation represents a structured annotation with type, label, and content
type ApprovalDecision ¶ added in v0.1.6
type ApprovalDecision struct {
Disposition ApprovalDisposition
}
func NormalizeApprovalDecision ¶ added in v0.1.6
func NormalizeApprovalDecision(d ApprovalDecision) ApprovalDecision
func (ApprovalDecision) Approved ¶ added in v0.1.6
func (d ApprovalDecision) Approved() bool
type ApprovalDisposition ¶ added in v0.1.6
type ApprovalDisposition string
const ( ApprovalApproveOnce ApprovalDisposition = "approve_once" ApprovalApproveSameToolSession ApprovalDisposition = "approve_same_tool_session" ApprovalApproveAllSession ApprovalDisposition = "approve_all_session" ApprovalDeny ApprovalDisposition = "deny" )
type ApprovalHandler ¶
type ApprovalHandler func(ApprovalRequest) (ApprovalDecision, error)
type ApprovalRequest ¶
type Event ¶
type Event struct {
Type EventType
SessionID string
UserInput string
Content string
ToolName string
ToolCallID string
ToolArguments string
ToolResult string
Error string
Plan planpkg.State
Usage llm.Usage
AgentID string // non-empty when emitted by a subagent
InvocationID string // non-empty when emitted by a subagent, globally unique per invocation
// EventThinkingProgress fields — reasoning progress without exposing content.
ReasoningCharCount int
ReasoningActive bool
}
type EventType ¶
type EventType string
const ( EventRunStarted EventType = "run_started" EventAssistantDelta EventType = "assistant_delta" EventAssistantMessage EventType = "assistant_message" EventToolCallStarted EventType = "tool_call_started" EventToolCallCompleted EventType = "tool_call_completed" EventPlanUpdated EventType = "plan_updated" EventUsageUpdated EventType = "usage_updated" EventRunFinished EventType = "run_finished" EventThinkingProgress EventType = "thinking_progress" EventStatusUpdated EventType = "status_updated" )
type MCPService ¶
type MCPService interface {
List(ctx context.Context) ([]mcpctl.ServerStatus, error)
Show(ctx context.Context, serverID string) (mcpctl.ServerDetail, error)
Add(ctx context.Context, req mcpctl.AddRequest) (mcpctl.ServerStatus, error)
Remove(ctx context.Context, serverID string) error
Enable(ctx context.Context, serverID string, enabled bool) (mcpctl.ServerStatus, error)
Test(ctx context.Context, serverID string) (mcpctl.ServerStatus, error)
Reload(ctx context.Context) error
}
type MarkdownRenderResult ¶
type MarkdownStyleConfig ¶
type MarkdownStyleConfig struct {
// 基础颜色
TextColor lipgloss.Color
AccentColor lipgloss.Color
MutedColor lipgloss.Color
SuccessColor lipgloss.Color
WarningColor lipgloss.Color
ErrorColor lipgloss.Color
// 代码块颜色
CodeBgColor lipgloss.Color
CodeBorderColor lipgloss.Color
// 高亮颜色
HighlightColors map[string]lipgloss.Color
}
MarkdownStyleConfig - 简约的样式配置
func (*MarkdownStyleConfig) Emphasis ¶
func (s *MarkdownStyleConfig) Emphasis() lipgloss.Style
Emphasis 返回强调样式
func (*MarkdownStyleConfig) Heading ¶
func (s *MarkdownStyleConfig) Heading(level int) lipgloss.Style
Heading 返回标题样式
func (*MarkdownStyleConfig) Highlight ¶
func (s *MarkdownStyleConfig) Highlight(color string) lipgloss.Style
Highlight 返回高亮样式
func (*MarkdownStyleConfig) InlineCode ¶
func (s *MarkdownStyleConfig) InlineCode() lipgloss.Style
InlineCode 返回内联代码样式
func (*MarkdownStyleConfig) Strikethrough ¶
func (s *MarkdownStyleConfig) Strikethrough() lipgloss.Style
Strikethrough 返回删除线样式
func (*MarkdownStyleConfig) Strong ¶
func (s *MarkdownStyleConfig) Strong() lipgloss.Style
Strong 返回粗体样式
func (*MarkdownStyleConfig) Text ¶
func (s *MarkdownStyleConfig) Text() lipgloss.Style
Text 返回普通文本样式
type Options ¶
type Options struct {
Runner Runner
Store SessionStore
MCPService MCPService
Session *session.Session
ImageStore assets.ImageStore
Notifier notifypkg.Notifier
Config config.Config
Workspace string
Version string
StartupGuide StartupGuide
AgentSource mention.AgentSource
}
type RunPromptInput ¶
type Runner ¶
type Runner interface {
RunPromptWithInput(ctx context.Context, sess *session.Session, input RunPromptInput, mode string, out io.Writer) (string, error)
SetObserver(observer Observer)
SetApprovalHandler(handler ApprovalHandler)
UpdateProvider(providerCfg config.ProviderConfig, client llm.Client)
ListSkills() ([]skills.Skill, []skills.Diagnostic)
GetActiveSkill(sess *session.Session) (skills.Skill, bool)
ActivateSkill(sess *session.Session, name string, args map[string]string) (skills.Skill, error)
ClearActiveSkill(sess *session.Session) error
ClearSkill(name string) (skills.ClearResult, error)
SubAgentManager() *subagentspkg.Manager
ListModels(ctx context.Context) ([]provider.ModelInfo, []provider.Warning, error)
}
type SessionStore ¶
type SessionStore interface {
Save(session *session.Session) error
Load(id string) (*session.Session, error)
List(limit int) ([]session.Summary, []string, error)
DeleteInWorkspace(workspace, id string) error
CleanupZeroMessageSessions(workspace, activeSessionID string) (session.CleanupResult, error)
}
type SimpleCache ¶
type SimpleCache struct {
// contains filtered or unexported fields
}
SimpleCache - 简约的缓存机制
type SimpleMarkdownRenderer ¶
type SimpleMarkdownRenderer struct {
// contains filtered or unexported fields
}
SimpleMarkdownRenderer - 简约的Markdown渲染器
func NewSimpleMarkdownRenderer ¶
func NewSimpleMarkdownRenderer(width int) *SimpleMarkdownRenderer
NewSimpleMarkdownRenderer 创建新的简约Markdown渲染器
func (*SimpleMarkdownRenderer) Render ¶
func (r *SimpleMarkdownRenderer) Render(markdown string) string
Render 渲染Markdown文本
type StartupGuide ¶
type SubAgentToolCall ¶ added in v0.1.8
type SubAgentToolCall struct {
ToolName string
ToolCallID string // precise matching for EventToolCallCompleted
CompactBody string // short description, e.g. "search_text: config"
Status string // "running" / "done" / "error"
Summary string // summary after completion
DetailLines []string // expanded detail lines (ctrl+o)
}
SubAgentToolCall tracks a single tool call made by a running subagent.
type ToolRenderResult ¶ added in v0.1.7
type ToolRenderResult struct {
Summary string
DetailLines []string
Status string
CompactLine string
}
ToolRenderResult is the normalized output used by the TUI pipeline.
type ToolRenderer ¶ added in v0.1.7
type ToolRenderer interface {
// DisplayLabel returns the short tag shown in the tool header (e.g. "READ", "SHELL").
DisplayLabel() string
// Render parses payload once and returns all fields needed by the TUI.
Render(payload string) ToolRenderResult
}
ToolRenderer describes how a tool's execution is displayed in the TUI. Each tool registers an implementation; the rendering pipeline calls Render once so payload parsing is not repeated for summary and compact fields.
func GetToolRenderer ¶ added in v0.1.7
func GetToolRenderer(name string) ToolRenderer
GetToolRenderer returns the registered renderer for the tool, or nil if none.
Source Files
¶
- app.go
- assistant_render_pipeline.go
- clipboard_text.go
- component_chat_stream.go
- component_command_runtime.go
- component_command_utils.go
- component_commit_command.go
- component_conversation.go
- component_enhanced_animation.go
- component_enhanced_input.go
- component_enhanced_layout.go
- component_enhanced_scrollbar.go
- component_enhanced_statusbar.go
- component_footer.go
- component_input.go
- component_input_mutation.go
- component_input_overlays_runtime.go
- component_landing.go
- component_mcp_commands.go
- component_model_switch_command.go
- component_models_command.go
- component_overlays.go
- component_palette_runtime.go
- component_palettes.go
- component_plan_actions.go
- component_plan_panel.go
- component_rollback_command.go
- component_run_flow.go
- component_sessions.go
- component_skill_commands.go
- component_slash_entry.go
- component_startup_guide.go
- component_status_dot.go
- component_status_scroll.go
- component_subagent_commands.go
- component_text_render.go
- component_token_usage_runtime.go
- component_view_shell.go
- component_viewport_layout.go
- diff_preview_util.go
- file_input.go
- input_images.go
- input_paste.go
- input_paste_transaction.go
- markdown_renderer.go
- model.go
- model_layout_viewport.go
- model_mouse_selection.go
- ports.go
- simple_markdown.go
- styles.go
- token_estimator.go
- token_monitor.go
- token_usage_remote.go
- tool_renderer.go
- tool_renderers_builtin.go
- tool_renderers_init.go
- ui_component_defaults.go
- ui_component_types.go
- warnings.go