Documentation
¶
Index ¶
- Variables
- func CompleteMention(prefix string, workDir string) []string
- func CompleteSlashCommand(prefix string, customCmds map[string]*commands.Command) []string
- func DetectMention(ti textinput.Model) (active bool, prefix string)
- func DetectSlashCommand(ti textinput.Model) (active bool, prefix string)
- func ExpandMentions(input string, workDir string) (string, error)
- func FormatDiff(diff string) string
- func FormatToolResult(lang Language, msg ToolStatusMsg) string
- func FormatToolStart(msg ToolStatusMsg) string
- func FormatToolStatus(msg ToolStatusMsg) string
- func IsDiffContent(text string) bool
- func RenderMarkdown(text string) string
- func RenderMarkdownWidth(text string, wrap int) string
- type ApprovalMsg
- type AskUserMsg
- type ConfigView
- type DiffConfirmMsg
- type FullscreenModel
- func (f *FullscreenModel) Fullscreen() bool
- func (f FullscreenModel) Init() tea.Cmd
- func (f *FullscreenModel) Inner() *Model
- func (f *FullscreenModel) RenderContent() string
- func (f *FullscreenModel) ToggleFullscreen()
- func (f FullscreenModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (f FullscreenModel) View() string
- type HarnessCheckpointConfirmMsg
- type Language
- type MCPInfo
- type Mention
- type Model
- func (m *Model) ExecuteRemoteSlashCommand(text string) (string, bool)
- func (m Model) Init() tea.Cmd
- func (m *Model) Session() *session.Session
- func (m *Model) SetAutoMemory(am *memory.AutoMemory)
- func (m *Model) SetAutoMemoryFiles(files []string)
- func (m *Model) SetCommandsManager(mgr *commands.Manager)
- func (m *Model) SetConfig(cfg *config.Config)
- func (m *Model) SetCustomCommands(cmds map[string]*commands.Command)
- func (m *Model) SetIMManager(mgr *im.Manager)
- func (m *Model) SetMCPManager(mgr mcpManager)
- func (m *Model) SetMCPServers(servers []MCPInfo)
- func (m *Model) SetPluginManager(mgr *plugin.Manager)
- func (m *Model) SetProgram(p *tea.Program)
- func (m *Model) SetProjectMemoryFiles(files []string)
- func (m *Model) SetProjectMemoryLoading(loading bool)
- func (m *Model) SetSession(ses *session.Session, store session.Store)
- func (m *Model) SetSubAgentManager(mgr *subagent.Manager)
- func (m *Model) SetUpdateService(svc *update.Service)
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type REPL
- func (r *REPL) Run() error
- func (r *REPL) SetAskUserTool(tools *tool.Registry)
- func (r *REPL) SetAutoMemory(am *memory.AutoMemory)
- func (r *REPL) SetAutoMemoryFiles(files []string)
- func (r *REPL) SetCheckpointManager(m *checkpoint.Manager)
- func (r *REPL) SetCommandsManager(mgr *commands.Manager)
- func (r *REPL) SetConfig(cfg *config.Config)
- func (r *REPL) SetIMManager(mgr *im.Manager)
- func (r *REPL) SetMCPManager(mgr *plugin.MCPManager)
- func (r *REPL) SetMCPServers(servers []MCPInfo)
- func (r *REPL) SetPluginManager(mgr *plugin.Manager)
- func (r *REPL) SetProjectMemoryFiles(files []string)
- func (r *REPL) SetProjectMemoryLoader(loader func() (string, []string, error))
- func (r *REPL) SetResumeID(id string)
- func (r *REPL) SetSessionStore(s session.Store)
- func (r *REPL) SetSubAgentManager(mgr *subagent.Manager, prov provider.Provider, tools *tool.Registry)
- func (r *REPL) SetUpdateService(svc *update.Service)
- type ToolSpinner
- type ToolStatusMsg
- type ViewportModel
- func (v *ViewportModel) AtBottom() bool
- func (v *ViewportModel) AutoFollow() bool
- func (v *ViewportModel) Content() string
- func (v *ViewportModel) GotoBottom()
- func (v *ViewportModel) ScrollDown(n int)
- func (v ViewportModel) ScrollIndicatorStyle() string
- func (v *ViewportModel) ScrollUp(n int)
- func (v *ViewportModel) SetContent(content string)
- func (v *ViewportModel) SetSize(width, height int)
- func (v *ViewportModel) TotalLineCount() int
- func (v ViewportModel) Update(msg tea.Msg) (ViewportModel, tea.Cmd)
- func (v ViewportModel) View() string
- func (v *ViewportModel) VisibleLineCount() int
- func (v *ViewportModel) YOffset() int
Constants ¶
This section is empty.
Variables ¶
var SlashCommandDescriptions = map[string]string{
"/help": "Show help message",
"/?": "Show help message",
"/sessions": "List saved sessions",
"/resume": "Resume a previous session",
"/export": "Export session to markdown",
"/model": "Open model panel",
"/provider": "Open provider manager",
"/clear": "Clear conversation",
"/qq": "Manage QQ channel binding",
"/mcp": "Show MCP servers",
"/memory": "Manage memory",
"/undo": "Undo last file edit",
"/checkpoints": "List checkpoints",
"/allow": "Always allow a tool",
"/plugins": "List loaded plugins",
"/image": "Attach an image",
"/fullscreen": "Toggle fullscreen",
"/mode": "Set agent mode",
"/init": "Create GGCODE.md",
"/harness": "Run harness workflow commands",
"/exit": "Exit ggcode",
"/quit": "Exit ggcode",
"/agents": "List sub-agents",
"/agent": "Sub-agent details",
"/compact": "Compress conversation history",
"/todo": "View/manage todo list",
"/bug": "Report a bug",
"/config": "View/modify configuration",
"/status": "Show current status",
"/update": "Update ggcode to the latest release",
"/lang": "Switch interface language",
"/skills": "Browse available skills",
}
SlashCommandDescriptions provides short descriptions for slash commands.
var SlashCommands = []string{
"/help", "/?", "/sessions", "/resume", "/export", "/model", "/provider",
"/clear", "/qq", "/mcp", "/memory", "/undo", "/checkpoints", "/allow", "/plugins",
"/image", "/fullscreen", "/mode", "/init", "/harness", "/exit", "/quit", "/agents", "/agent",
"/compact", "/todo", "/bug", "/config", "/status", "/update", "/lang", "/skills",
}
SlashCommands is the list of all available slash commands.
Functions ¶
func CompleteMention ¶
CompleteMention returns file/directory completions for an @mention prefix. prefix is the text after "@" (e.g., "internal/t" from "@internal/t").
func CompleteSlashCommand ¶
CompleteSlashCommand returns matching slash commands for a given prefix.
func DetectMention ¶
DetectMention returns true if the cursor is immediately after a "@" with a path fragment. It returns the path fragment after "@" for completion.
func DetectSlashCommand ¶
DetectSlashCommand returns true if the cursor is at a slash command position. It returns the command fragment after "/" for completion.
func ExpandMentions ¶
ExpandMentions reads file contents and directory listings for mentions, returning the expanded message text.
func FormatDiff ¶
FormatDiff formats a unified diff for TUI display.
func FormatToolResult ¶
func FormatToolResult(lang Language, msg ToolStatusMsg) string
FormatToolResult formats the closing line when a tool finishes.
func FormatToolStart ¶
func FormatToolStart(msg ToolStatusMsg) string
FormatToolStart formats the header line when a tool begins executing.
func FormatToolStatus ¶
func FormatToolStatus(msg ToolStatusMsg) string
FormatToolStatus formats a tool completion message (legacy compat).
func IsDiffContent ¶
IsDiffContent checks if text looks like a unified diff.
func RenderMarkdown ¶
func RenderMarkdownWidth ¶ added in v1.1.29
Types ¶
type ApprovalMsg ¶
type ApprovalMsg struct {
ToolName string
Input string
Response chan permission.Decision
}
ApprovalMsg is sent to TUI when agent requests permission.
type AskUserMsg ¶ added in v1.1.12
type AskUserMsg struct {
Request toolpkg.AskUserRequest
Response chan toolpkg.AskUserResponse
}
type ConfigView ¶
type ConfigView struct {
Vendor string
Endpoint string
Model string
VendorNamesFunc func() []string
EndpointNamesFunc func(string) []string
ModelsForEndpoint func(string, string) []string
}
func (*ConfigView) EndpointNames ¶
func (c *ConfigView) EndpointNames(vendor string) []string
func (*ConfigView) VendorNames ¶
func (c *ConfigView) VendorNames() []string
type DiffConfirmMsg ¶
DiffConfirmMsg is sent to TUI when agent wants user to confirm a file edit diff.
type FullscreenModel ¶
type FullscreenModel struct {
// contains filtered or unexported fields
}
FullscreenModel wraps the main Model with alt-screen and viewport support.
func NewFullscreenModel ¶
func NewFullscreenModel(inner Model) FullscreenModel
NewFullscreenModel creates a fullscreen model wrapping the inner model.
func (*FullscreenModel) Fullscreen ¶
func (f *FullscreenModel) Fullscreen() bool
Fullscreen returns whether fullscreen mode is active.
func (FullscreenModel) Init ¶
func (f FullscreenModel) Init() tea.Cmd
Init initializes the fullscreen model.
func (*FullscreenModel) Inner ¶
func (f *FullscreenModel) Inner() *Model
Inner returns a pointer to the inner model.
func (*FullscreenModel) RenderContent ¶
func (f *FullscreenModel) RenderContent() string
RenderContent renders the inner model output content (for viewport). This is exposed so the inner model can be used independently.
func (*FullscreenModel) ToggleFullscreen ¶
func (f *FullscreenModel) ToggleFullscreen()
ToggleFullscreen toggles fullscreen mode.
func (FullscreenModel) View ¶
func (f FullscreenModel) View() string
View renders the fullscreen UI.
type HarnessCheckpointConfirmMsg ¶ added in v1.1.8
type HarnessCheckpointConfirmMsg struct {
Checkpoint harness.DirtyWorkspaceCheckpoint
Response chan bool
}
type MCPInfo ¶
type MCPInfo struct {
Name string
ToolNames []string
PromptNames []string
ResourceNames []string
Connected bool
Pending bool
Error string
Transport string
Migrated bool
}
MCPInfo holds display info about a connected MCP server.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main Bubble Tea model for the REPL.
func NewModel ¶
func NewModel(a *agent.Agent, policy permission.PermissionPolicy) Model
func (*Model) ExecuteRemoteSlashCommand ¶ added in v1.1.32
func (*Model) SetAutoMemory ¶
func (m *Model) SetAutoMemory(am *memory.AutoMemory)
func (*Model) SetAutoMemoryFiles ¶
func (*Model) SetCommandsManager ¶
func (*Model) SetCustomCommands ¶
func (*Model) SetIMManager ¶ added in v1.1.32
func (*Model) SetMCPManager ¶
func (m *Model) SetMCPManager(mgr mcpManager)
func (*Model) SetMCPServers ¶
func (*Model) SetPluginManager ¶
func (*Model) SetProgram ¶
func (*Model) SetProjectMemoryFiles ¶
func (*Model) SetProjectMemoryLoading ¶ added in v1.0.19
func (*Model) SetSubAgentManager ¶
func (*Model) SetUpdateService ¶ added in v1.0.17
type REPL ¶
type REPL struct {
// contains filtered or unexported fields
}
REPL connects the agent to the TUI model.
func NewREPL ¶
func NewREPL(a *agent.Agent, policy permission.PermissionPolicy) *REPL
NewREPL creates a new REPL with optional permission policy.
func (*REPL) SetAskUserTool ¶ added in v1.1.12
func (*REPL) SetAutoMemory ¶
func (r *REPL) SetAutoMemory(am *memory.AutoMemory)
func (*REPL) SetAutoMemoryFiles ¶
func (*REPL) SetCheckpointManager ¶
func (r *REPL) SetCheckpointManager(m *checkpoint.Manager)
SetCheckpointManager wires the checkpoint manager into the agent and REPL.
func (*REPL) SetCommandsManager ¶
func (*REPL) SetConfig ¶
SetConfig passes the config to the model for /model and /provider commands.
func (*REPL) SetIMManager ¶ added in v1.1.32
func (*REPL) SetMCPManager ¶
func (r *REPL) SetMCPManager(mgr *plugin.MCPManager)
func (*REPL) SetMCPServers ¶
SetMCPServers passes MCP server info to the TUI model.
func (*REPL) SetPluginManager ¶
func (*REPL) SetProjectMemoryFiles ¶
func (*REPL) SetProjectMemoryLoader ¶ added in v1.0.19
func (*REPL) SetResumeID ¶
SetResumeID sets the session ID to resume.
func (*REPL) SetSessionStore ¶
SetSessionStore sets the session persistence store.
func (*REPL) SetSubAgentManager ¶
func (r *REPL) SetSubAgentManager(mgr *subagent.Manager, prov provider.Provider, tools *tool.Registry)
SetSubAgentManager wires the sub-agent manager and registers sub-agent tools.
func (*REPL) SetUpdateService ¶ added in v1.0.17
type ToolSpinner ¶
type ToolSpinner struct {
// contains filtered or unexported fields
}
ToolSpinner manages spinner state for active tool execution.
func (*ToolSpinner) CurrentFrame ¶
func (s *ToolSpinner) CurrentFrame() int
CurrentFrame returns the current spinner frame index.
func (*ToolSpinner) Elapsed ¶
func (s *ToolSpinner) Elapsed() time.Duration
Elapsed returns how long the current tool has been running.
func (*ToolSpinner) IsActive ¶
func (s *ToolSpinner) IsActive() bool
IsActive returns whether the spinner is running.
func (*ToolSpinner) Start ¶
func (s *ToolSpinner) Start(label string) tea.Cmd
Start begins the spinner for a tool.
func (*ToolSpinner) String ¶
func (s *ToolSpinner) String() string
String returns the spinner string with tool name.
type ToolStatusMsg ¶
type ToolStatusMsg struct {
ToolID string
ToolName string
DisplayName string
Detail string
Activity string
Running bool // true = start, false = done
Result string
RawArgs string
Args string // raw tool arguments summary, used as a fallback only
IsError bool
Elapsed time.Duration
}
ToolStatusMsg is sent when a tool starts or finishes execution.
type ViewportModel ¶
type ViewportModel struct {
// contains filtered or unexported fields
}
ViewportModel wraps a viewport with auto-follow behavior.
func NewViewportModel ¶
func NewViewportModel(width, height int) ViewportModel
NewViewportModel creates a new viewport model.
func (*ViewportModel) AtBottom ¶
func (v *ViewportModel) AtBottom() bool
AtBottom returns true if the viewport is at the bottom.
func (*ViewportModel) AutoFollow ¶
func (v *ViewportModel) AutoFollow() bool
AutoFollow returns whether auto-follow is enabled.
func (*ViewportModel) Content ¶
func (v *ViewportModel) Content() string
Content returns the current viewport content.
func (*ViewportModel) GotoBottom ¶
func (v *ViewportModel) GotoBottom()
GotoBottom scrolls to the bottom and enables auto-follow.
func (*ViewportModel) ScrollDown ¶
func (v *ViewportModel) ScrollDown(n int)
ScrollDown scrolls down by n lines.
func (ViewportModel) ScrollIndicatorStyle ¶
func (v ViewportModel) ScrollIndicatorStyle() string
ScrollIndicatorStyle returns a styled scroll indicator.
func (*ViewportModel) ScrollUp ¶
func (v *ViewportModel) ScrollUp(n int)
ScrollUp scrolls up by n lines.
func (*ViewportModel) SetContent ¶
func (v *ViewportModel) SetContent(content string)
SetContent sets the viewport content and auto-scrolls to bottom if following.
func (*ViewportModel) SetSize ¶
func (v *ViewportModel) SetSize(width, height int)
SetSize updates the viewport dimensions.
func (*ViewportModel) TotalLineCount ¶
func (v *ViewportModel) TotalLineCount() int
TotalLineCount returns the total number of content lines.
func (ViewportModel) Update ¶
func (v ViewportModel) Update(msg tea.Msg) (ViewportModel, tea.Cmd)
Update handles messages for the viewport.
func (*ViewportModel) VisibleLineCount ¶
func (v *ViewportModel) VisibleLineCount() int
VisibleLineCount returns the number of visible lines.
func (*ViewportModel) YOffset ¶
func (v *ViewportModel) YOffset() int
YOffset returns the current vertical scroll offset.
Source Files
¶
- activity_groups.go
- app.go
- ask_user.go
- commands.go
- completion.go
- conversation_wrap.go
- diff.go
- error_format.go
- file_browser.go
- fullscreen.go
- harness_context_prompt.go
- harness_panel.go
- i18n.go
- im_bridge.go
- im_emit.go
- inspector_panel.go
- logo.go
- markdown.go
- mcp.go
- mcp_panel.go
- model.go
- model_list_filter.go
- model_panel.go
- preview_panel.go
- provider_panel.go
- qq_panel.go
- remote_commands.go
- repl.go
- resize.go
- session_history.go
- shell_mode.go
- skills_panel.go
- spinner.go
- submit.go
- system_actions.go
- tool_labels.go
- update.go
- view.go
- viewport.go