Documentation
¶
Index ¶
- Constants
- func ExecuteShellCommandDirectly(command string) (string, error)
- func ExtractGitSubcommand(command string) string
- func IsGitCheckoutSubcommand(command string) bool
- func IsGitDiscardCommand(command string) bool
- func IsShellCommand(prompt string) bool
- func SelectAndExecuteCommand(registry *CommandRegistry, chatAgent *agent.Agent) error
- func SetGitDir(dir string)
- func ShowCommandSelector(registry *CommandRegistry, chatAgent *agent.Agent) (string, error)
- func WriteJSONToOutput(value interface{}) error
- func WriteToOutput(output string)
- type ChangesCommand
- type ClearCommand
- type Command
- type CommandContext
- type CommandItem
- type CommandRegistry
- func (r *CommandRegistry) AliasesOf(canonical string) []string
- func (r *CommandRegistry) CompletionCandidates() []string
- func (r *CommandRegistry) Execute(input string, chatAgent *agent.Agent) error
- func (r *CommandRegistry) GetCommand(name string) (Command, bool)
- func (r *CommandRegistry) IsSlashCommand(input string) bool
- func (r *CommandRegistry) ListCommands() []Command
- func (r *CommandRegistry) Register(cmd Command)
- func (r *CommandRegistry) RegisterAlias(short, canonical string)
- func (r *CommandRegistry) SuggestCommands(name string, maxSuggestions int) []string
- type CommitAction
- type CommitActionItem
- type CommitCommand
- func (c *CommitCommand) Description() string
- func (c *CommitCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *CommitCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *CommitCommand) Name() string
- func (c *CommitCommand) SetAgentError(err error)
- type CommitFlow
- type CommitJSONResult
- type CommitMessageHandler
- func (h *CommitMessageHandler) CreateCommit(commitMessage string) error
- func (h *CommitMessageHandler) EditCommitMessage(commitMessage string) (string, error)
- func (h *CommitMessageHandler) GenerateCommitMessage(diffOutput []byte, isSingleFile bool, filename string) (string, error)
- func (h *CommitMessageHandler) HandleCommitConfirmation(commitMessage string, filename string) (string, bool, error)
- type CompactCommand
- type EditCommand
- type ExecCommand
- type ExitCommand
- type FileItem
- type HelpCommand
- type IndexCommand
- type InitCommand
- type JSONCommand
- type LogAction
- type LogActionItem
- type LogCommand
- type LogFlow
- type MCPCommand
- type MaxContextCommand
- type ModelsCommand
- type OutputFormat
- type OutputWriter
- type PersonaCommand
- type ProvidersCommand
- type ReviewCommand
- type ReviewDeepCommand
- type RevisionItem
- type RewindCommand
- type RiskProfileCommand
- type RollbackCommand
- type SearchCommand
- func (c *SearchCommand) Description() string
- func (c *SearchCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *SearchCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *SearchCommand) Name() string
- func (c *SearchCommand) Usage() string
- type SelfReviewCommand
- type SelfReviewGateCommand
- type SessionsCommand
- type SessionsFlow
- func (f *SessionsFlow) ExecuteSessionDelete(args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionExport(args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionImport(chatAgent *agent.Agent, args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionList(chatAgent *agent.Agent) (string, error)
- func (f *SessionsFlow) ExecuteSessionLoad(chatAgent *agent.Agent, args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionRename(chatAgent *agent.Agent, args []string) (string, error)
- type SetupCommand
- type ShellCommand
- type SkillCommand
- func (c *SkillCommand) Description() string
- func (c *SkillCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *SkillCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *SkillCommand) Name() string
- func (c *SkillCommand) Usage() string
- type StatsCommand
- type StatusCommand
- type SubagentConfigCommand
- type SubagentPersonaCommand
- type SubagentPersonasCommand
- type TranscriptCommand
- type UsageProvider
Constants ¶
const ( CommitStatusSuccess = "success" CommitStatusError = "error" CommitStatusDryRun = "dry-run" )
Commit status constants
Variables ¶
This section is empty.
Functions ¶
func ExecuteShellCommandDirectly ¶
ExecuteShellCommandDirectly executes a shell command directly and returns the result. NOTE: This function includes security checks for git commands. For unprivileged execution, callers should use tools.ExecuteShellCommand directly (but this is generally not recommended for agent-initiated commands).
func ExtractGitSubcommand ¶
ExtractGitSubcommand extracts the first git subcommand from a command string for display purposes.
func IsGitCheckoutSubcommand ¶
IsGitCheckoutSubcommand checks if a git command is a checkout or switch operation. These operations are blocked from direct execution to require explicit user approval. This function checks ALL git commands in a compound shell command (e.g., "cd x && git checkout").
func IsGitDiscardCommand ¶
IsGitDiscardCommand checks if a git command could discard changes (restore, reset --hard, checkout -- <file>). These are always blocked from direct execution regardless of orchestrator permissions. This function checks ALL git commands in a compound shell command (e.g., "cd x && git reset").
func IsShellCommand ¶
IsShellCommand checks if a prompt starts with common shell tools
func SelectAndExecuteCommand ¶
func SelectAndExecuteCommand(registry *CommandRegistry, chatAgent *agent.Agent) error
SelectAndExecuteCommand shows command selector and executes the selected command
func SetGitDir ¶
func SetGitDir(dir string)
SetGitDir sets the working directory for subsequent gitCommand calls.
func ShowCommandSelector ¶
func ShowCommandSelector(registry *CommandRegistry, chatAgent *agent.Agent) (string, error)
ShowCommandSelector displays a dropdown for slash command selection
func WriteJSONToOutput ¶
func WriteJSONToOutput(value interface{}) error
WriteJSONToOutput writes a JSON representation of value to stdout
Types ¶
type ChangesCommand ¶
type ChangesCommand struct{}
ChangesCommand shows tracked file changes in the current session
func (*ChangesCommand) Description ¶
func (c *ChangesCommand) Description() string
Description returns the command description
type ClearCommand ¶
type ClearCommand struct{}
ClearCommand handles clearing of conversation history
func (*ClearCommand) Description ¶
func (c *ClearCommand) Description() string
func (*ClearCommand) Execute ¶
func (c *ClearCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ClearCommand) Name ¶
func (c *ClearCommand) Name() string
type Command ¶
type Command interface {
Name() string
Description() string
Execute(args []string, chatAgent *agent.Agent) error
}
Command represents a slash command
type CommandContext ¶
type CommandContext struct {
OutputFormat OutputFormat
}
CommandContext provides context for command execution
type CommandItem ¶
CommandItem adapts a slash command for dropdown display
func (*CommandItem) Display ¶
func (c *CommandItem) Display() string
func (*CommandItem) SearchText ¶
func (c *CommandItem) SearchText() string
func (*CommandItem) Value ¶
func (c *CommandItem) Value() interface{}
type CommandRegistry ¶
type CommandRegistry struct {
// contains filtered or unexported fields
}
CommandRegistry manages all available slash commands
func NewCommandRegistry ¶
func NewCommandRegistry() *CommandRegistry
NewCommandRegistry creates a new command registry
func (*CommandRegistry) AliasesOf ¶
func (r *CommandRegistry) AliasesOf(canonical string) []string
AliasesOf returns the set of aliases that resolve to the given canonical command name. Used by /help <name> to show alternate spellings.
func (*CommandRegistry) CompletionCandidates ¶
func (r *CommandRegistry) CompletionCandidates() []string
CompletionCandidates returns all valid slash-command names (canonical plus aliases) sorted alphabetically. Used by the tab-completion CompletionProvider in the input reader.
func (*CommandRegistry) Execute ¶
func (r *CommandRegistry) Execute(input string, chatAgent *agent.Agent) error
Execute processes a slash command input Supports both / and ! prefixes (e.g. /exec ls or !exec ls)
func (*CommandRegistry) GetCommand ¶
func (r *CommandRegistry) GetCommand(name string) (Command, bool)
GetCommand returns a command by name. If name matches an alias, the canonical command is returned (SP-048-2d).
func (*CommandRegistry) IsSlashCommand ¶
func (r *CommandRegistry) IsSlashCommand(input string) bool
IsSlashCommand checks if input starts with a slash or bang
func (*CommandRegistry) ListCommands ¶
func (r *CommandRegistry) ListCommands() []Command
ListCommands returns all available commands
func (*CommandRegistry) Register ¶
func (r *CommandRegistry) Register(cmd Command)
Register adds a command to the registry
func (*CommandRegistry) RegisterAlias ¶
func (r *CommandRegistry) RegisterAlias(short, canonical string)
RegisterAlias maps a short name to a canonical command name. Looking up the alias via GetCommand or Execute resolves transparently. Aliases also participate in tab completion and "did you mean" suggestions.
func (*CommandRegistry) SuggestCommands ¶
func (r *CommandRegistry) SuggestCommands(name string, maxSuggestions int) []string
SuggestCommands returns up to maxSuggestions command names that are plausible corrections for a mistyped command. Matches are ranked by Levenshtein distance against the lowercased canonical name; commands whose lowercased name has the input as a prefix are pulled to the front (distance 0). Returns nil for empty input or when no candidate is reasonably close.
type CommitAction ¶
type CommitAction struct {
ID string
DisplayName string
Description string
Action func(*CommitFlow) error
}
CommitAction represents different commit actions
type CommitActionItem ¶
CommitActionItem adapts CommitAction for dropdown display
func (*CommitActionItem) Display ¶
func (c *CommitActionItem) Display() string
func (*CommitActionItem) SearchText ¶
func (c *CommitActionItem) SearchText() string
func (*CommitActionItem) Value ¶
func (c *CommitActionItem) Value() interface{}
type CommitCommand ¶
type CommitCommand struct {
// contains filtered or unexported fields
}
CommitCommand implements the /commit slash command
func (*CommitCommand) Description ¶
func (c *CommitCommand) Description() string
Description returns the command description
func (*CommitCommand) Execute ¶
func (c *CommitCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the commit command
func (*CommitCommand) ExecuteWithJSONOutput ¶
func (c *CommitCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput runs the commit command with JSON output
func (*CommitCommand) SetAgentError ¶
func (c *CommitCommand) SetAgentError(err error)
SetAgentError sets the agent creation error for better error reporting
type CommitFlow ¶
type CommitFlow struct {
// contains filtered or unexported fields
}
CommitFlow manages the interactive commit workflow
func NewCommitFlow ¶
func NewCommitFlow(chatAgent *agent.Agent) *CommitFlow
NewCommitFlow creates a new commit flow
func NewCommitFlowWithFlags ¶
func NewCommitFlowWithFlags(chatAgent *agent.Agent, skipPrompt, dryRun, allowSecrets bool) *CommitFlow
NewCommitFlowWithFlags creates a new commit flow with CLI flags
func (*CommitFlow) CommitStagedWithMessage ¶
func (cf *CommitFlow) CommitStagedWithMessage() error
CommitStagedWithMessage commits staged files with an optional message or auto-generated message This method is designed for non-interactive use by the commit tool
func (*CommitFlow) Execute ¶
func (cf *CommitFlow) Execute() error
Execute runs a simplified commit flow: 1) If there are staged changes, use them and generate a commit message 2) If there are no staged changes, prompt user to select files, then generate the commit message
func (*CommitFlow) SetUserInstructions ¶
func (cf *CommitFlow) SetUserInstructions(instructions string)
SetUserInstructions sets the user instructions for commit message generation
type CommitJSONResult ¶
type CommitJSONResult struct {
Status string `json:"status"` // success, error, dry-run
Commit string `json:"commit,omitempty"` // commit hash if successful
Message string `json:"message,omitempty"` // commit message
Branch string `json:"branch,omitempty"` // branch name
Error string `json:"error,omitempty"` // error message
Review string `json:"review,omitempty"` // commit review (critical concerns)
}
CommitJSONResult is the JSON output structure for commit command
func (*CommitJSONResult) Validate ¶
func (r *CommitJSONResult) Validate() error
Validate checks that required fields are populated
type CommitMessageHandler ¶
type CommitMessageHandler struct {
// contains filtered or unexported fields
}
CommitMessageHandler handles commit message generation, editing, and retry logic
func NewCommitMessageHandler ¶
func NewCommitMessageHandler(chatAgent *agent.Agent, reader *bufio.Reader) *CommitMessageHandler
NewCommitMessageHandler creates a new commit message handler
func (*CommitMessageHandler) CreateCommit ¶
func (h *CommitMessageHandler) CreateCommit(commitMessage string) error
CreateCommit creates the git commit with the given message
func (*CommitMessageHandler) EditCommitMessage ¶
func (h *CommitMessageHandler) EditCommitMessage(commitMessage string) (string, error)
EditCommitMessage opens the default editor to edit the commit message
func (*CommitMessageHandler) GenerateCommitMessage ¶
func (h *CommitMessageHandler) GenerateCommitMessage(diffOutput []byte, isSingleFile bool, filename string) (string, error)
GenerateCommitMessage generates a commit message from staged diff
func (*CommitMessageHandler) HandleCommitConfirmation ¶
func (h *CommitMessageHandler) HandleCommitConfirmation(commitMessage string, filename string) (string, bool, error)
HandleCommitConfirmation handles the commit message preview, editing, and confirmation
type CompactCommand ¶
type CompactCommand struct{}
CompactCommand implements the /compact slash command. It produces an LLM-generated recap of the messages preceding the most recent user turn, substitutes that recap for the recapped messages, and leaves the latest user turn and everything after it intact.
func (*CompactCommand) Description ¶
func (c *CompactCommand) Description() string
Description returns the command description
type EditCommand ¶
type EditCommand struct{}
EditCommand opens $EDITOR to compose or edit a query.
func (*EditCommand) Description ¶
func (c *EditCommand) Description() string
func (*EditCommand) Execute ¶
func (c *EditCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*EditCommand) Name ¶
func (c *EditCommand) Name() string
type ExecCommand ¶
type ExecCommand struct{}
ExecCommand handles the /exec slash command Usage: /exec <shell-command-to-execute> Alias: !<shell-command-to-execute> (matches other tools like Jupyter, R, etc.)
func (*ExecCommand) Description ¶
func (c *ExecCommand) Description() string
func (*ExecCommand) Execute ¶
func (c *ExecCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ExecCommand) Name ¶
func (c *ExecCommand) Name() string
type ExitCommand ¶
type ExitCommand struct{}
ExitCommand implements the /exit slash command
func (*ExitCommand) Description ¶
func (e *ExitCommand) Description() string
Description returns the command description
type HelpCommand ¶
type HelpCommand struct {
// contains filtered or unexported fields
}
HelpCommand implements the /help slash command
func (*HelpCommand) Description ¶
func (h *HelpCommand) Description() string
Description returns the command description
type IndexCommand ¶
type IndexCommand struct{}
IndexCommand implements the /index slash command for toggling workspace indexing.
func (*IndexCommand) Description ¶
func (c *IndexCommand) Description() string
Description returns the command description
type InitCommand ¶
type InitCommand struct{}
InitCommand implements the /init slash command
func (*InitCommand) Description ¶
func (i *InitCommand) Description() string
Description returns the command description
type JSONCommand ¶
type JSONCommand interface {
Command
ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
}
JSONCommand extends Command to support JSON output
type LogAction ¶
type LogAction struct {
ID string
DisplayName string
Description string
Action func(*LogFlow) error
}
LogAction represents different log management actions
type LogActionItem ¶
LogActionItem adapts LogAction for dropdown display
func (*LogActionItem) Display ¶
func (l *LogActionItem) Display() string
func (*LogActionItem) SearchText ¶
func (l *LogActionItem) SearchText() string
func (*LogActionItem) Value ¶
func (l *LogActionItem) Value() interface{}
type LogCommand ¶
type LogCommand struct{}
LogCommand shows the change history using the history package
func (*LogCommand) Description ¶
func (l *LogCommand) Description() string
Description returns the command description
type LogFlow ¶
type LogFlow struct {
// contains filtered or unexported fields
}
LogFlow manages enhanced log and history operations
func NewLogFlow ¶
NewLogFlow creates a new log flow
type MCPCommand ¶
type MCPCommand struct{}
MCPCommand implements the /mcp slash command
func (*MCPCommand) Description ¶
func (m *MCPCommand) Description() string
Description returns the command description
type MaxContextCommand ¶ added in v0.16.17
type MaxContextCommand struct{}
MaxContextCommand implements /max-context for inspecting or setting the user-defined context window cap (Config.MaxContextTokens). When set, the agent treats the model as if it has at most this many context tokens, limiting input/output budgets as a cost-control measure.
func (*MaxContextCommand) Description ¶ added in v0.16.17
func (c *MaxContextCommand) Description() string
func (*MaxContextCommand) Execute ¶ added in v0.16.17
func (c *MaxContextCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*MaxContextCommand) Name ¶ added in v0.16.17
func (c *MaxContextCommand) Name() string
func (*MaxContextCommand) Usage ¶ added in v0.16.17
func (c *MaxContextCommand) Usage() string
type ModelsCommand ¶
type ModelsCommand struct{}
ModelsCommand implements the /model slash command
func (*ModelsCommand) Description ¶
func (m *ModelsCommand) Description() string
Description returns the command description
type OutputFormat ¶
type OutputFormat int
OutputFormat defines output format for commands
const ( OutputText OutputFormat = iota OutputJSON )
type OutputWriter ¶
OutputWriter captures and buffers output
func (*OutputWriter) String ¶
func (ow *OutputWriter) String() string
String returns the captured output
type PersonaCommand ¶
type PersonaCommand struct{}
PersonaCommand implements the /persona slash command.
Personas are catalog-fixed: the set of personas, their tool allowlists, system prompts, providers, and models are defined in pkg/personas/configs/*.json and are NOT user-customizable at runtime. The only mutable knob is enable/disable, which is recorded by ID in Config.DisabledPersonas so the catalog itself never gets mutated.
Workflow-level provider/model overrides (sprout automate) and per-spawn overrides (`run_subagent` arguments) remain available — those are transient, programmatic, and tracked separately.
func (*PersonaCommand) Description ¶
func (p *PersonaCommand) Description() string
func (*PersonaCommand) Execute ¶
func (p *PersonaCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*PersonaCommand) Name ¶
func (p *PersonaCommand) Name() string
type ProvidersCommand ¶
type ProvidersCommand struct{}
ProvidersCommand implements the /provider slash command
func (*ProvidersCommand) Description ¶
func (p *ProvidersCommand) Description() string
Description returns the command description
func (*ProvidersCommand) Execute ¶
func (p *ProvidersCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the providers command
func (*ProvidersCommand) Name ¶
func (p *ProvidersCommand) Name() string
Name returns the command name
type ReviewCommand ¶
type ReviewCommand struct {
// contains filtered or unexported fields
}
func (*ReviewCommand) Description ¶
func (c *ReviewCommand) Description() string
Description returns the command description
func (*ReviewCommand) Execute ¶
func (c *ReviewCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the code review command
func (*ReviewCommand) SetContext ¶ added in v0.16.17
func (c *ReviewCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for review LLM calls (SP-073). When wired through the command registry, this receives the agent's InterruptCtx so Stop/Ctrl+C can abort in-flight review requests.
type ReviewDeepCommand ¶
type ReviewDeepCommand struct {
// contains filtered or unexported fields
}
ReviewDeepCommand implements the /review-deep slash command This command performs a deeper evidence-focused review on staged Git changes
func (*ReviewDeepCommand) Description ¶
func (c *ReviewDeepCommand) Description() string
Description returns the command description
func (*ReviewDeepCommand) Execute ¶
func (c *ReviewDeepCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the deep code review command
func (*ReviewDeepCommand) Name ¶
func (c *ReviewDeepCommand) Name() string
Name returns the command name
func (*ReviewDeepCommand) SetContext ¶ added in v0.16.17
func (c *ReviewDeepCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for review LLM calls (SP-073).
type RevisionItem ¶
RevisionItem adapts revision information for dropdown display
func (*RevisionItem) Display ¶
func (r *RevisionItem) Display() string
func (*RevisionItem) SearchText ¶
func (r *RevisionItem) SearchText() string
func (*RevisionItem) Value ¶
func (r *RevisionItem) Value() interface{}
type RewindCommand ¶ added in v0.16.12
type RewindCommand struct{}
RewindCommand handles rewinding conversation to a previous turn
func (*RewindCommand) Description ¶ added in v0.16.12
func (c *RewindCommand) Description() string
func (*RewindCommand) Execute ¶ added in v0.16.12
func (c *RewindCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*RewindCommand) Name ¶ added in v0.16.12
func (c *RewindCommand) Name() string
func (*RewindCommand) Usage ¶ added in v0.16.12
func (c *RewindCommand) Usage() string
type RiskProfileCommand ¶
type RiskProfileCommand struct{}
RiskProfileCommand implements /risk-profile for inspecting or switching the SP-058 shell-command gating profile mid-session. The CLI flag --risk-profile sets the same field at startup; this command lets the user adjust without restarting.
func (*RiskProfileCommand) Description ¶
func (c *RiskProfileCommand) Description() string
func (*RiskProfileCommand) Execute ¶
func (c *RiskProfileCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*RiskProfileCommand) Name ¶
func (c *RiskProfileCommand) Name() string
func (*RiskProfileCommand) Usage ¶
func (c *RiskProfileCommand) Usage() string
type RollbackCommand ¶
type RollbackCommand struct{}
RollbackCommand provides rollback functionality
func (*RollbackCommand) Description ¶
func (r *RollbackCommand) Description() string
Description returns the command description
func (*RollbackCommand) Execute ¶
func (r *RollbackCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute performs a rollback
func (*RollbackCommand) Name ¶
func (r *RollbackCommand) Name() string
Name returns the command name
type SearchCommand ¶ added in v0.16.18
type SearchCommand struct{}
SearchCommand implements the /search slash command for searching across saved sessions by message content.
func (*SearchCommand) Description ¶ added in v0.16.18
func (c *SearchCommand) Description() string
func (*SearchCommand) Execute ¶ added in v0.16.18
func (c *SearchCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SearchCommand) ExecuteWithJSONOutput ¶ added in v0.16.18
func (c *SearchCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
func (*SearchCommand) Name ¶ added in v0.16.18
func (c *SearchCommand) Name() string
func (*SearchCommand) Usage ¶ added in v0.16.18
func (c *SearchCommand) Usage() string
type SelfReviewCommand ¶
type SelfReviewCommand struct {
// contains filtered or unexported fields
}
SelfReviewCommand implements the /self-review slash command.
func (*SelfReviewCommand) Description ¶
func (c *SelfReviewCommand) Description() string
func (*SelfReviewCommand) Execute ¶
func (c *SelfReviewCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SelfReviewCommand) Name ¶
func (c *SelfReviewCommand) Name() string
func (*SelfReviewCommand) SetContext ¶ added in v0.16.12
func (c *SelfReviewCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for review operations (SP-073).
type SelfReviewGateCommand ¶
type SelfReviewGateCommand struct{}
SelfReviewGateCommand implements the /self-review-gate slash command.
func (*SelfReviewGateCommand) Description ¶
func (c *SelfReviewGateCommand) Description() string
func (*SelfReviewGateCommand) Execute ¶
func (c *SelfReviewGateCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SelfReviewGateCommand) Name ¶
func (c *SelfReviewGateCommand) Name() string
type SessionsCommand ¶
type SessionsCommand struct{}
SessionsCommand handles session management with auto-tracking and session recovery
func (*SessionsCommand) Description ¶
func (c *SessionsCommand) Description() string
func (*SessionsCommand) Execute ¶
func (c *SessionsCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SessionsCommand) Name ¶
func (c *SessionsCommand) Name() string
type SessionsFlow ¶
type SessionsFlow struct{}
SessionsFlow handles advanced session operations
func (*SessionsFlow) ExecuteSessionDelete ¶
func (f *SessionsFlow) ExecuteSessionDelete(args []string) (string, error)
ExecuteSessionDelete removes a session file
func (*SessionsFlow) ExecuteSessionExport ¶
func (f *SessionsFlow) ExecuteSessionExport(args []string) (string, error)
ExecuteSessionExport exports a session to a JSON file
func (*SessionsFlow) ExecuteSessionImport ¶
ExecuteSessionImport imports a session from a JSON file
func (*SessionsFlow) ExecuteSessionList ¶
func (f *SessionsFlow) ExecuteSessionList(chatAgent *agent.Agent) (string, error)
ExecuteSessionList lists sessions for the current working directory, newest first.
func (*SessionsFlow) ExecuteSessionLoad ¶
ExecuteSessionLoad loads a session with optional summary context restoration
func (*SessionsFlow) ExecuteSessionRename ¶
ExecuteSessionRename renames a session
type SetupCommand ¶ added in v0.16.2
type SetupCommand struct{}
SetupCommand implements the /setup slash command, which displays a human-readable summary of the current Sprout configuration.
func (*SetupCommand) Description ¶ added in v0.16.2
func (s *SetupCommand) Description() string
Description returns the command description.
func (*SetupCommand) Execute ¶ added in v0.16.2
func (s *SetupCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the /setup command.
func (*SetupCommand) Name ¶ added in v0.16.2
func (s *SetupCommand) Name() string
Name returns the command name.
type ShellCommand ¶
func (*ShellCommand) Description ¶
func (c *ShellCommand) Description() string
func (*ShellCommand) Execute ¶
func (c *ShellCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ShellCommand) Name ¶
func (c *ShellCommand) Name() string
func (*ShellCommand) SetContext ¶ added in v0.16.12
func (c *ShellCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for LLM calls (SP-073).
type SkillCommand ¶ added in v0.16.18
type SkillCommand struct{}
SkillCommand exposes the /skill slash command.
func (*SkillCommand) Description ¶ added in v0.16.18
func (c *SkillCommand) Description() string
func (*SkillCommand) Execute ¶ added in v0.16.18
func (c *SkillCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SkillCommand) ExecuteWithJSONOutput ¶ added in v0.16.18
func (c *SkillCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
func (*SkillCommand) Name ¶ added in v0.16.18
func (c *SkillCommand) Name() string
func (*SkillCommand) Usage ¶ added in v0.16.18
func (c *SkillCommand) Usage() string
type StatsCommand ¶
type StatsCommand struct{}
StatsCommand implements the /stats slash command
func (*StatsCommand) Description ¶
func (s *StatsCommand) Description() string
Description returns the command description
type StatusCommand ¶
type StatusCommand struct{}
StatusCommand shows the current change tracking status
func (*StatusCommand) Description ¶
func (s *StatusCommand) Description() string
Description returns the command description
type SubagentConfigCommand ¶
type SubagentConfigCommand struct {
// contains filtered or unexported fields
}
SubagentConfigCommand implements the /subagent-provider and /subagent-model commands
func (*SubagentConfigCommand) Description ¶
func (s *SubagentConfigCommand) Description() string
Description returns the command description
func (*SubagentConfigCommand) Execute ¶
func (s *SubagentConfigCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the subagent config command
func (*SubagentConfigCommand) Name ¶
func (s *SubagentConfigCommand) Name() string
Name returns the command name
type SubagentPersonaCommand ¶
type SubagentPersonaCommand struct{}
SubagentPersonaCommand is a backwards-compatible alias for /persona.
func (*SubagentPersonaCommand) Description ¶
func (s *SubagentPersonaCommand) Description() string
func (*SubagentPersonaCommand) Execute ¶
func (s *SubagentPersonaCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SubagentPersonaCommand) Name ¶
func (s *SubagentPersonaCommand) Name() string
type SubagentPersonasCommand ¶
type SubagentPersonasCommand struct{}
SubagentPersonasCommand is a backwards-compatible alias for /persona list.
func (*SubagentPersonasCommand) Description ¶
func (s *SubagentPersonasCommand) Description() string
func (*SubagentPersonasCommand) Execute ¶
func (s *SubagentPersonasCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SubagentPersonasCommand) Name ¶
func (s *SubagentPersonasCommand) Name() string
type TranscriptCommand ¶ added in v0.16.4
type TranscriptCommand struct{}
TranscriptCommand implements the /transcript slash command, a diagnostic tool for inspecting the agent's current conversation state. The default invocation captures a JSON snapshot to ~/.sprout/transcripts/<scope>/<session>/<utc>-manual.json. Subcommands enrich or change the output:
/transcript # snapshot only /transcript preview # snapshot + would-be /compact preview /transcript markdown # snapshot + rendered .md alongside /transcript diff # snapshot + diff vs previous snapshot
Multiple subcommands can be combined (e.g. `/transcript preview diff`). All snapshots include per-message source annotations so a reader can see which messages are LLM-generated checkpoint substitutes vs the original turns.
func (*TranscriptCommand) Description ¶ added in v0.16.4
func (c *TranscriptCommand) Description() string
Description returns the command description
func (*TranscriptCommand) Execute ¶ added in v0.16.4
func (c *TranscriptCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the transcript command.
func (*TranscriptCommand) Name ¶ added in v0.16.4
func (c *TranscriptCommand) Name() string
Name returns the command name
func (*TranscriptCommand) Usage ¶ added in v0.16.4
func (c *TranscriptCommand) Usage() string
Usage returns the detailed help text shown by `/help transcript`.
type UsageProvider ¶
type UsageProvider interface {
Usage() string
}
UsageProvider is implemented by commands that want to surface a longer per-command help string via `/help <name>`. Commands that don't implement it fall back to their Description().
Source Files
¶
- changes.go
- clear.go
- command_selector.go
- commands.go
- commit.go
- commit_command.go
- commit_flow.go
- commit_flow_console.go
- commit_git.go
- commit_review.go
- commit_types.go
- commit_utils.go
- compact.go
- diff_utils.go
- edit.go
- exec.go
- exit.go
- git_validator.go
- help.go
- index.go
- info.go
- init.go
- log_flow.go
- max_context.go
- mcp.go
- models.go
- persona.go
- providers.go
- review.go
- review_context.go
- rewind_command.go
- risk_profile.go
- search.go
- self_review.go
- self_review_gate.go
- sessions.go
- sessions_flow.go
- setup.go
- shell.go
- skill.go
- subagent_config.go
- suggestions.go
- transcript.go