Documentation
¶
Index ¶
- Variables
- func BuildSystemPrompt(tools []apitypes.ToolDef) string
- func PrintBanner(w io.Writer, cfg BannerConfig)
- func ReadInput(scanner *bufio.Scanner) (string, error)
- func RenderMarkdown(text string) string
- func RenderToolOutput(name string, output string, isError bool) string
- func RunOneShot(ctx context.Context, rt *agent.ConversationRuntime, prompt string, stream bool, ...) error
- type BannerConfig
- type Display
- func (d *Display) Error(err error)
- func (d *Display) PermissionPrompt(toolName, operation string)
- func (d *Display) PermissionPromptExtended(toolName, operation string)
- func (d *Display) RenderResponse(resp *apitypes.MessageResponse)
- func (d *Display) StreamEvent(ev apitypes.StreamEvent)
- func (d *Display) Usage(usage string)
- type REPL
- func (r *REPL) Run(ctx context.Context) error
- func (r *REPL) SetBuddy(b *buddy.Companion)
- func (r *REPL) SetCheckpointManager(mgr *checkpoint.Manager)
- func (r *REPL) SetDreamEngine(d *dream.Dreamer)
- func (r *REPL) SetOutputStyle(style string)
- func (r *REPL) SetUltraPlanner(p *ultraplan.Planner)
- func (r *REPL) SetVoiceListener(l *voice.Listener)
- func (r *REPL) SetWorktreeManager(mgr *worktree.Manager)
- type REPLConfig
- type SlashCommand
- type Spinner
- type TerminalPermissionPrompter
- type TerminalToolCallback
Constants ¶
This section is empty.
Variables ¶
var SkipProjectConfig bool
SkipProjectConfig disables loading GOCODE.md/CLAUDE.md into the system prompt.
Functions ¶
func BuildSystemPrompt ¶
BuildSystemPrompt constructs the system prompt for the agent. Modeled after Claude Code's agentic behavior — proactive, autonomous, thorough.
func PrintBanner ¶
func PrintBanner(w io.Writer, cfg BannerConfig)
PrintBanner renders the OpenCode-style welcome screen with Go blue GOCODE branding.
func ReadInput ¶
ReadInput reads a potentially multi-line input from the reader. Lines ending with backslash are treated as continuations.
func RenderMarkdown ¶ added in v0.2.2
RenderMarkdown converts markdown text to ANSI-colored terminal output.
func RenderToolOutput ¶ added in v0.2.2
RenderToolOutput formats tool output with dimmed styling.
Types ¶
type BannerConfig ¶
type BannerConfig struct {
Version string
Model string
MaxTurns int
Cwd string
BuddyLine string // optional — empty means no buddy
}
BannerConfig holds the info displayed in the welcome banner.
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
Display handles rendering of streaming events and tool status to the terminal.
func NewDisplay ¶
NewDisplay creates a new Display writing to w.
func (*Display) PermissionPrompt ¶
PermissionPrompt displays a permission request.
func (*Display) PermissionPromptExtended ¶ added in v0.8.1
PermissionPromptExtended displays a permission request with trust options.
func (*Display) RenderResponse ¶ added in v0.2.2
func (d *Display) RenderResponse(resp *apitypes.MessageResponse)
RenderResponse renders a full message response with markdown formatting.
func (*Display) StreamEvent ¶
func (d *Display) StreamEvent(ev apitypes.StreamEvent)
StreamEvent renders a single stream event incrementally.
type REPL ¶
type REPL struct {
// contains filtered or unexported fields
}
REPL provides the interactive terminal chat interface.
func NewREPL ¶
func NewREPL(rt *agent.ConversationRuntime, r io.Reader, w io.Writer, cfg REPLConfig, sk []skills.Skill) *REPL
NewREPL creates a new REPL.
func (*REPL) SetBuddy ¶ added in v0.9.0
SetBuddy sets the terminal companion displayed in the banner.
func (*REPL) SetCheckpointManager ¶ added in v0.9.0
func (r *REPL) SetCheckpointManager(mgr *checkpoint.Manager)
SetCheckpointManager sets the checkpoint manager for /undo support.
func (*REPL) SetDreamEngine ¶ added in v0.9.0
SetDreamEngine sets the dream engine for idle/session-end memory consolidation.
func (*REPL) SetOutputStyle ¶ added in v0.9.0
SetOutputStyle sets the active output style.
func (*REPL) SetUltraPlanner ¶ added in v0.9.0
SetUltraPlanner sets the ultraplan planner for /ultraplan support.
func (*REPL) SetVoiceListener ¶ added in v0.9.0
SetVoiceListener sets the voice listener for /voice support.
func (*REPL) SetWorktreeManager ¶ added in v0.9.0
SetWorktreeManager sets the worktree manager for /worktree support.
type REPLConfig ¶
REPLConfig holds configuration for the REPL display.
type SlashCommand ¶
type SlashCommand int
SlashCommand represents a parsed slash command.
const ( CmdNone SlashCommand = iota CmdExit CmdClear CmdCost CmdPlan CmdInitDeep CmdSkill CmdCompact CmdModel CmdHelp CmdDiff CmdUndo CmdStatus CmdReview CmdPermissions CmdDoctor CmdRedo CmdConnect CmdCommit CmdMemory CmdTasks CmdWorktree CmdVoice CmdUltraPlan CmdVim CmdOutputStyle )
func ParseSlashCommand ¶
func ParseSlashCommand(input string) SlashCommand
ParseSlashCommand checks if input is a slash command.
type Spinner ¶ added in v0.2.1
type Spinner struct {
// contains filtered or unexported fields
}
Spinner shows an animated loading indicator. It is restartable — Stop/Start can be called multiple times.
func NewSpinner ¶ added in v0.2.1
NewSpinner creates a spinner that writes to w.
func (*Spinner) Start ¶ added in v0.2.1
func (s *Spinner) Start()
Start begins the spinner animation in a goroutine. Safe to call multiple times — restarts if already stopped.
func (*Spinner) Stop ¶ added in v0.2.1
func (s *Spinner) Stop()
Stop halts the spinner and clears the line. Safe to call multiple times or when not running.
func (*Spinner) UpdateMessage ¶ added in v0.2.1
UpdateMessage changes the spinner text while running.
type TerminalPermissionPrompter ¶
type TerminalPermissionPrompter struct {
Scanner *bufio.Scanner
Writer io.Writer
Trusted *agent.TrustedToolStore
}
TerminalPermissionPrompter prompts the user in the terminal for permission.
type TerminalToolCallback ¶ added in v0.2.1
TerminalToolCallback updates the terminal during tool execution. It stops the spinner before showing tool progress.
func (*TerminalToolCallback) OnToolEnd ¶ added in v0.2.1
func (t *TerminalToolCallback) OnToolEnd(name string, success bool)
func (*TerminalToolCallback) OnToolStart ¶ added in v0.2.1
func (t *TerminalToolCallback) OnToolStart(name string, input map[string]interface{})