Documentation
¶
Index ¶
- func Expand(template string, args []string) string
- func ParseArgs(s string) []string
- func ReadStdinPrompt() (string, error)
- func RunPrint(sess *agent.Session, args []string, jsonMode bool) error
- func RunPrintMode(sess *agent.Session, prompt string, jsonMode bool) error
- func RunTUI(rt *bootstrap.Runtime, version string) error
- type App
- type BtwCommand
- func (c *BtwCommand) Active() bool
- func (c *BtwCommand) Dismiss()
- func (c *BtwCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *BtwCommand) IsModal() bool
- func (c *BtwCommand) Run(_ *CommandContext, inv CommandInvocation) tea.Cmd
- func (c *BtwCommand) SetResult(msg tui.BtwResultMsg)
- func (c *BtwCommand) Spec() CommandSpec
- func (c *BtwCommand) View(width int) string
- type Command
- type CommandContext
- type CommandInvocation
- type CommandKind
- type CommandLoader
- type CommandSpec
- type ContextCommand
- func (c *ContextCommand) Active() bool
- func (c *ContextCommand) Dismiss()
- func (c *ContextCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *ContextCommand) IsModal() bool
- func (c *ContextCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
- func (c *ContextCommand) Spec() CommandSpec
- func (c *ContextCommand) View(width int) string
- type DebugHarnessCommand
- func (c *DebugHarnessCommand) Active() bool
- func (c *DebugHarnessCommand) Dismiss()
- func (c *DebugHarnessCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *DebugHarnessCommand) IsModal() bool
- func (c *DebugHarnessCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
- func (c *DebugHarnessCommand) Spec() CommandSpec
- func (c *DebugHarnessCommand) View(width int) string
- type FileCommandAdapter
- type HelpCommand
- func (c *HelpCommand) Active() bool
- func (c *HelpCommand) Dismiss()
- func (c *HelpCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *HelpCommand) IsModal() bool
- func (c *HelpCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
- func (c *HelpCommand) Spec() CommandSpec
- func (c *HelpCommand) View(width int) string
- type InteractiveCommand
- type ModalOverlay
- type ModelCommand
- type Registry
- func (r *Registry) All() []Command
- func (r *Registry) ClearOverlay()
- func (r *Registry) EffectiveSpec(cmd Command) CommandSpec
- func (r *Registry) Lookup(name string) (Command, bool)
- func (r *Registry) Overlay() InteractiveCommand
- func (r *Registry) Register(cmd Command)
- func (r *Registry) RegisterAll(commands []Command)
- func (r *Registry) SetOverlay(ic InteractiveCommand)
- type ResumeCommand
- func (c *ResumeCommand) Active() bool
- func (c *ResumeCommand) Dismiss()
- func (c *ResumeCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *ResumeCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
- func (c *ResumeCommand) Spec() CommandSpec
- func (c *ResumeCommand) View(width int) string
- type SettingsCommand
- func (c *SettingsCommand) Active() bool
- func (c *SettingsCommand) Dismiss()
- func (c *SettingsCommand) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)
- func (c *SettingsCommand) IsModal() bool
- func (c *SettingsCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
- func (c *SettingsCommand) Spec() CommandSpec
- func (c *SettingsCommand) View(width int) string
- type SimpleCommand
- type SkillCommand
- type TasksCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand substitutes placeholder patterns in template with the given args.
Supported patterns:
- $1, $2, ... $N — positional args (1-based, out-of-range → "")
- ${@:N} — all args from index N onward (1-based)
- ${@:N:L} — L args starting at index N (1-based)
- $@ / $ARGUMENTS — all args joined by space
Substitution is single-pass per pattern class (no recursive expansion).
func ParseArgs ¶
ParseArgs splits a command argument string respecting double and single quotes. Empty quoted strings are skipped.
func ReadStdinPrompt ¶
ReadStdinPrompt reads all of stdin as a prompt (for pipe usage).
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
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
// TaskRuntime provides unified access to all background tasks (shells + agents).
TaskRuntime *agentcore.TaskRuntime
// 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
// 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 BtwCommand ¶ added in v0.0.4
type BtwCommand struct {
// contains filtered or unexported fields
}
BtwCommand implements /btw — ephemeral side-chain Q&A that reads the full conversation context but never mutates history or invokes tools.
func NewBtwCommand ¶ added in v0.0.4
func NewBtwCommand(app *App) *BtwCommand
NewBtwCommand creates a /btw command bound to the given App.
func (*BtwCommand) Active ¶ added in v0.0.4
func (c *BtwCommand) Active() bool
func (*BtwCommand) Dismiss ¶ added in v0.0.4
func (c *BtwCommand) Dismiss()
func (*BtwCommand) IsModal ¶ added in v0.0.4
func (c *BtwCommand) IsModal() bool
func (*BtwCommand) Run ¶ added in v0.0.4
func (c *BtwCommand) Run(_ *CommandContext, inv CommandInvocation) tea.Cmd
func (*BtwCommand) SetResult ¶ added in v0.0.4
func (c *BtwCommand) SetResult(msg tui.BtwResultMsg)
SetResult updates the overlay with the side question response.
func (*BtwCommand) Spec ¶ added in v0.0.4
func (c *BtwCommand) Spec() CommandSpec
func (*BtwCommand) View ¶ added in v0.0.4
func (c *BtwCommand) View(width int) string
type Command ¶ added in v0.0.2
type Command interface {
Spec() CommandSpec
Run(ctx *CommandContext, inv CommandInvocation) tea.Cmd
}
Command is the unified abstraction for all slash commands.
type CommandContext ¶ added in v0.0.2
type CommandContext struct {
App *App
}
CommandContext provides runtime dependencies to commands.
type CommandInvocation ¶ added in v0.0.2
CommandInvocation is the parsed slash-command input passed to command handlers.
type CommandKind ¶ added in v0.0.2
type CommandKind string
const ( CommandKindBuiltin CommandKind = "builtin" CommandKindCustom CommandKind = "custom" CommandKindSkill CommandKind = "skill" )
type CommandLoader ¶ added in v0.0.2
CommandLoader discovers a family of commands and contributes them to the registry.
type CommandSpec ¶ added in v0.0.2
type CommandSpec struct {
Name string
Aliases []string
Usage string
Description string
Category string
NeedsIdle bool
Hidden bool
Kind CommandKind
Source string
}
CommandSpec describes command metadata.
type ContextCommand ¶ added in v0.1.1
type ContextCommand struct {
// contains filtered or unexported fields
}
ContextCommand implements InteractiveCommand for /context. Opens a modal overlay with tabbed sections (usage / composition / suggestions).
func NewContextCommand ¶ added in v0.1.1
func NewContextCommand(app *App) *ContextCommand
func (*ContextCommand) Active ¶ added in v0.1.1
func (c *ContextCommand) Active() bool
func (*ContextCommand) Dismiss ¶ added in v0.1.1
func (c *ContextCommand) Dismiss()
func (*ContextCommand) IsModal ¶ added in v0.1.1
func (c *ContextCommand) IsModal() bool
func (*ContextCommand) Run ¶ added in v0.1.1
func (c *ContextCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*ContextCommand) Spec ¶ added in v0.1.1
func (c *ContextCommand) Spec() CommandSpec
func (*ContextCommand) View ¶ added in v0.1.1
func (c *ContextCommand) View(width int) string
type DebugHarnessCommand ¶ added in v0.1.1
type DebugHarnessCommand struct {
// contains filtered or unexported fields
}
DebugHarnessCommand implements InteractiveCommand for /debug-harness. Opens a modal overlay with tabbed sections (turn / activity / metrics / context).
func NewDebugHarnessCommand ¶ added in v0.1.1
func NewDebugHarnessCommand(app *App) *DebugHarnessCommand
func (*DebugHarnessCommand) Active ¶ added in v0.1.1
func (c *DebugHarnessCommand) Active() bool
func (*DebugHarnessCommand) Dismiss ¶ added in v0.1.1
func (c *DebugHarnessCommand) Dismiss()
func (*DebugHarnessCommand) IsModal ¶ added in v0.1.1
func (c *DebugHarnessCommand) IsModal() bool
func (*DebugHarnessCommand) Run ¶ added in v0.1.1
func (c *DebugHarnessCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*DebugHarnessCommand) Spec ¶ added in v0.1.1
func (c *DebugHarnessCommand) Spec() CommandSpec
func (*DebugHarnessCommand) View ¶ added in v0.1.1
func (c *DebugHarnessCommand) View(width int) string
type FileCommandAdapter ¶ added in v0.0.2
type FileCommandAdapter struct {
// contains filtered or unexported fields
}
func (*FileCommandAdapter) Run ¶ added in v0.0.2
func (c *FileCommandAdapter) Run(ctx *CommandContext, inv CommandInvocation) tea.Cmd
func (*FileCommandAdapter) Spec ¶ added in v0.0.2
func (c *FileCommandAdapter) Spec() CommandSpec
type HelpCommand ¶ added in v0.1.1
type HelpCommand struct {
// contains filtered or unexported fields
}
HelpCommand implements InteractiveCommand for /help. Opens a modal overlay with tabbed sections (general / built-in / custom / skills).
func NewHelpCommand ¶ added in v0.1.1
func NewHelpCommand(app *App) *HelpCommand
func (*HelpCommand) Active ¶ added in v0.1.1
func (c *HelpCommand) Active() bool
func (*HelpCommand) Dismiss ¶ added in v0.1.1
func (c *HelpCommand) Dismiss()
func (*HelpCommand) IsModal ¶ added in v0.1.1
func (c *HelpCommand) IsModal() bool
func (*HelpCommand) Run ¶ added in v0.1.1
func (c *HelpCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*HelpCommand) Spec ¶ added in v0.1.1
func (c *HelpCommand) Spec() CommandSpec
func (*HelpCommand) View ¶ added in v0.1.1
func (c *HelpCommand) View(width int) string
type InteractiveCommand ¶ added in v0.0.2
type InteractiveCommand interface {
Command
Active() bool
HandleKey(msg tea.KeyMsg) (handled bool, cmd tea.Cmd)
View(width int) string
Dismiss()
}
InteractiveCommand extends Command with modal keyboard interception and custom rendering. When Active() returns true the TUI routes all keyboard events through HandleKey and replaces the input area with View.
type ModalOverlay ¶ added in v0.0.4
type ModalOverlay interface {
IsModal() bool
}
ModalOverlay is an optional interface for overlays that replace the input area.
type ModelCommand ¶ added in v0.0.2
type ModelCommand struct {
// contains filtered or unexported fields
}
ModelCommand implements InteractiveCommand for /model. Always opens an interactive selector overlay; any arguments are ignored. Selection is persisted to whichever settings file already owns the model setting (project if it defines provider/model, otherwise global), so that manual edits and /model stay in sync.
func NewModelCommand ¶ added in v0.0.2
func NewModelCommand(app *App) *ModelCommand
func (*ModelCommand) Active ¶ added in v0.0.2
func (c *ModelCommand) Active() bool
func (*ModelCommand) Dismiss ¶ added in v0.0.2
func (c *ModelCommand) Dismiss()
func (*ModelCommand) Run ¶ added in v0.0.2
func (c *ModelCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*ModelCommand) Spec ¶ added in v0.0.2
func (c *ModelCommand) Spec() CommandSpec
func (*ModelCommand) View ¶ added in v0.0.2
func (c *ModelCommand) View(width int) string
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
func (r *Registry) EffectiveSpec(cmd Command) CommandSpec
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() 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) SetOverlay ¶ added in v0.0.2
func (r *Registry) SetOverlay(ic InteractiveCommand)
SetOverlay sets the active interactive overlay.
type ResumeCommand ¶ added in v0.0.2
type ResumeCommand struct {
// contains filtered or unexported fields
}
ResumeCommand implements InteractiveCommand for /resume. Opens an interactive overlay to select and switch sessions.
func NewResumeCommand ¶ added in v0.0.2
func NewResumeCommand(app *App) *ResumeCommand
func (*ResumeCommand) Active ¶ added in v0.0.2
func (c *ResumeCommand) Active() bool
func (*ResumeCommand) Dismiss ¶ added in v0.0.2
func (c *ResumeCommand) Dismiss()
func (*ResumeCommand) Run ¶ added in v0.0.2
func (c *ResumeCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*ResumeCommand) Spec ¶ added in v0.0.2
func (c *ResumeCommand) Spec() CommandSpec
func (*ResumeCommand) View ¶ added in v0.0.2
func (c *ResumeCommand) View(width int) string
type SettingsCommand ¶ added in v0.1.1
type SettingsCommand struct {
// contains filtered or unexported fields
}
SettingsCommand implements InteractiveCommand for /settings. Opens a modal overlay with tabbed sections (general / runtime / providers).
func NewSettingsCommand ¶ added in v0.1.1
func NewSettingsCommand(app *App) *SettingsCommand
func (*SettingsCommand) Active ¶ added in v0.1.1
func (c *SettingsCommand) Active() bool
func (*SettingsCommand) Dismiss ¶ added in v0.1.1
func (c *SettingsCommand) Dismiss()
func (*SettingsCommand) IsModal ¶ added in v0.1.1
func (c *SettingsCommand) IsModal() bool
func (*SettingsCommand) Run ¶ added in v0.1.1
func (c *SettingsCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*SettingsCommand) Spec ¶ added in v0.1.1
func (c *SettingsCommand) Spec() CommandSpec
func (*SettingsCommand) View ¶ added in v0.1.1
func (c *SettingsCommand) View(width int) string
type SimpleCommand ¶ added in v0.0.2
type SimpleCommand struct {
// contains filtered or unexported fields
}
SimpleCommand wraps a plain function as a Command.
func NewSimple ¶ added in v0.0.2
func NewSimple(spec CommandSpec, run func(*CommandContext, CommandInvocation) tea.Cmd) *SimpleCommand
NewSimple creates a SimpleCommand.
func (*SimpleCommand) Run ¶ added in v0.0.2
func (c *SimpleCommand) Run(ctx *CommandContext, inv CommandInvocation) tea.Cmd
func (*SimpleCommand) Spec ¶ added in v0.0.2
func (c *SimpleCommand) Spec() CommandSpec
type SkillCommand ¶ added in v0.0.2
type SkillCommand struct {
// contains filtered or unexported fields
}
func (*SkillCommand) Run ¶ added in v0.0.2
func (c *SkillCommand) Run(ctx *CommandContext, inv CommandInvocation) tea.Cmd
func (*SkillCommand) Spec ¶ added in v0.0.2
func (c *SkillCommand) Spec() CommandSpec
type TasksCommand ¶ added in v0.0.3
type TasksCommand struct {
// contains filtered or unexported fields
}
TasksCommand implements InteractiveCommand for /tasks. Shows background bash commands and agent tasks in a grouped overlay.
func NewTasksCommand ¶ added in v0.0.3
func NewTasksCommand(app *App) *TasksCommand
func (*TasksCommand) Active ¶ added in v0.0.3
func (c *TasksCommand) Active() bool
func (*TasksCommand) Dismiss ¶ added in v0.0.3
func (c *TasksCommand) Dismiss()
func (*TasksCommand) Run ¶ added in v0.0.3
func (c *TasksCommand) Run(ctx *CommandContext, _ CommandInvocation) tea.Cmd
func (*TasksCommand) Spec ¶ added in v0.0.3
func (c *TasksCommand) Spec() CommandSpec
func (*TasksCommand) View ¶ added in v0.0.3
func (c *TasksCommand) View(width int) string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |