Documentation
¶
Index ¶
- func FormatError(err error, fallbackPrefix string) string
- func ReadStdinPrompt() (string, error)
- func RunOnboarding() (tui.OnboardingResult, error)
- func RunPrint(rt *bootstrap.Runtime, args []string, jsonMode bool) error
- func RunPrintMode(sess *agent.Session, taskRT *task.Runtime, prompt string, jsonMode bool) error
- func RunTUI(rt *bootstrap.Runtime, version string) error
- type App
- type CommandLoader
- type ModalOverlay
- type Registry
- func (r *Registry) All() []commands.Command
- func (r *Registry) ClearOverlay()
- func (r *Registry) EffectiveSpec(cmd commands.Command) commands.Spec
- func (r *Registry) Lookup(name string) (commands.Command, bool)
- func (r *Registry) Overlay() commands.InteractiveCommand
- func (r *Registry) Register(cmd commands.Command)
- func (r *Registry) RegisterAll(cmds []commands.Command)
- func (r *Registry) Reset()
- func (r *Registry) SetOverlay(ic commands.InteractiveCommand)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatError ¶ added in v0.1.3
FormatError renders err for user display. Recognizes common cross-cutting conditions (cancellation, agent loop limits, LLM provider errors) with short friendly messages; falls back to err.Error() for anything else.
fallbackPrefix is prepended when no friendly category matches and the fallback is err.Error(). Pass "" to skip.
func ReadStdinPrompt ¶
ReadStdinPrompt reads all of stdin as a prompt (for pipe usage).
func RunOnboarding ¶ added in v0.3.0
func RunOnboarding() (tui.OnboardingResult, error)
RunOnboarding runs the first-run setup wizard. Called by main() before the runtime boots when no configuration exists (or with -setup).
func RunPrintMode ¶
RunPrintMode runs the agent in non-interactive mode. stdout receives assistant text (pipe-friendly), stderr receives tool/status info. When jsonMode is true, all events are streamed as JSONL to stdout.
Types ¶
type App ¶
type App struct {
Session *agent.Session
Cwd string
GitBranch string
Version string
ApprovalEngine *approval.Engine
// Commands are user-defined slash commands loaded from .md files.
Commands []config.FileCommand
// Skills are loaded skill definitions.
Skills []skill.Spec
// SkillCatalog provides shared skill invocation behavior across UI and tools.
SkillCatalog *skill.Catalog
PluginCatalog *plugin.Catalog
// MCPManager manages MCP server connections.
MCPManager *mcpclient.Manager
MCPServers map[string]mcpclient.ServerConfig
// CronStore holds session-scoped cron jobs for /loop command.
CronStore *cron.Store
// Dreamer triggers background memory consolidation for /dream.
// nil in modes without one (print); the command degrades gracefully.
Dreamer *dream.Dreamer
// TaskRuntime provides unified access to all background tasks (shells + agents).
TaskRuntime *task.Runtime
// TeamRegistry is the session-wide team registry. nil before any
// team_create call; the chrome's team chip and any team-aware command
// degrade to "no team" when nil or HasTeam() returns false.
TeamRegistry *team.Registry
// TeammateEvents is the per-session fan-out hub for teammate AgentLoop
// events. The TUI's teammate-transcript modal subscribes here. May be
// nil in headless / non-TUI flows; nil is a valid no-op publisher.
TeammateEvents *cbteam.EventHub
// PlanStore persists plans to ~/.codebot/plans/.
PlanStore *storage.PlanStore
// SessionStore is used to record plan slug into the session log.
SessionStore *storage.Store
// History provides input history for Up/Down navigation.
History *storage.History
PlanManager *plan.Manager
GoalManager *goal.Manager
// CommandLoaders allow alternative command sources to be injected at app construction time.
CommandLoaders []CommandLoader
// contains filtered or unexported fields
}
App is the TUI adapter. Business logic lives in agent.Session.
type CommandLoader ¶ added in v0.0.2
CommandLoader discovers a family of commands and contributes them to the registry.
type ModalOverlay ¶ added in v0.0.4
type ModalOverlay interface {
IsModal() bool
}
ModalOverlay is an optional interface used by overlays that want to opt out of the modal default. Overlays that intercept keyboard input (the typical case) replace the input area; non-modal overlays — autocomplete-style hint panels that coexist with the input — must implement this and return false.
type Registry ¶ added in v0.0.2
type Registry struct {
// contains filtered or unexported fields
}
Registry manages command registration, lookup by name/alias, and the active interactive overlay.
func NewRegistry ¶ added in v0.0.2
func NewRegistry() *Registry
NewRegistry creates an empty Registry.
func (*Registry) All ¶ added in v0.0.2
All returns all registered commands sorted by kind and then by name.
func (*Registry) ClearOverlay ¶ added in v0.0.2
func (r *Registry) ClearOverlay()
ClearOverlay dismisses and clears the active overlay.
func (*Registry) EffectiveSpec ¶ added in v0.0.2
EffectiveSpec returns the command metadata with only active aliases included.
func (*Registry) Lookup ¶ added in v0.0.2
Lookup finds a command by name or alias (case-insensitive).
func (*Registry) Overlay ¶ added in v0.0.2
func (r *Registry) Overlay() commands.InteractiveCommand
Overlay returns the currently active interactive command, or nil.
func (*Registry) Register ¶ added in v0.0.2
Register adds or replaces a command and its aliases in the registry.
func (*Registry) RegisterAll ¶ added in v0.0.2
RegisterAll adds a batch of commands to the registry.
func (*Registry) Reset ¶ added in v0.1.3
func (r *Registry) Reset()
Reset clears all registered commands and aliases. The active overlay is preserved because rebuilds (e.g. on /reload) should not dismiss an open modal that the user is interacting with.
func (*Registry) SetOverlay ¶ added in v0.0.2
func (r *Registry) SetOverlay(ic commands.InteractiveCommand)
SetOverlay sets the active interactive overlay.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package commands holds the slash-command implementations and the abstractions required to register them with the host UI.
|
Package commands holds the slash-command implementations and the abstractions required to register them with the host UI. |
|
Package imageinput handles image input from clipboard paste and file drag-drop, converting raw data to agentcore ContentBlocks.
|
Package imageinput handles image input from clipboard paste and file drag-drop, converting raw data to agentcore ContentBlocks. |
|
syntax
Package syntax wraps chroma to emit ANSI-colored code that nests safely inside a lipgloss background-color span.
|
Package syntax wraps chroma to emit ANSI-colored code that nests safely inside a lipgloss background-color span. |