Documentation
¶
Overview ¶
Package slash defines built-in slash commands and matching helpers.
Index ¶
- func AllCandidates(options CandidateOptions) []string
- func Candidates(prefix string) []string
- func CandidatesWithOptions(prefix string, options CandidateOptions) []string
- func FilterCandidates(prefix string, candidates []string) []string
- func FilterCandidatesStable(prefix string, candidates []string) []string
- func MenuCandidates(options CandidateOptions) []string
- func RenderHelp(w io.Writer)
- func ResumeSupportedNames() []string
- func Suggest(input string, limit int) []string
- func SuggestWithCandidates(input string, limit int, extraCandidates []string) []string
- func SupportsResume(name string) bool
- type CandidateOptions
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllCandidates ¶
func AllCandidates(options CandidateOptions) []string
AllCandidates returns every visible slash completion candidate for options.
func Candidates ¶
Candidates returns completion candidates for prefix.
func CandidatesWithOptions ¶
func CandidatesWithOptions(prefix string, options CandidateOptions) []string
CandidatesWithOptions returns completion candidates using runtime context.
func FilterCandidates ¶
FilterCandidates returns sorted candidates that start with prefix.
func FilterCandidatesStable ¶
FilterCandidatesStable filters candidates without changing their category order, which keeps built-ins ahead of runtime commands in interactive menus.
func MenuCandidates ¶
func MenuCandidates(options CandidateOptions) []string
MenuCandidates returns command-level entries for the interactive slash menu. Detailed argument templates remain available through AllCandidates.
func RenderHelp ¶
RenderHelp writes a text help table for built-in slash commands.
func ResumeSupportedNames ¶
func ResumeSupportedNames() []string
ResumeSupportedNames returns sorted names for visible resume-safe slash commands.
func SuggestWithCandidates ¶
SuggestWithCandidates returns likely slash commands using built-ins and extra candidates.
func SupportsResume ¶
SupportsResume reports whether name can run through the non-interactive resume path.
Types ¶
type CandidateOptions ¶
type CandidateOptions struct {
Model string
ActiveSessionID string
RecentSessionIDs []string
Extra []string
}
CandidateOptions supplies runtime context for slash completion candidates.
type Spec ¶
type Spec struct {
Name string
Usage string
Description string
ResumeSupported bool
Hidden bool
Disabled bool
}
Spec describes one built-in slash command.
func DescribeCandidate ¶
DescribeCandidate returns the built-in slash spec that explains a completion candidate. Candidates may include arguments or subcommands; only the command token is used for lookup.
func ResumeSupportedSpecs ¶
func ResumeSupportedSpecs() []Spec
ResumeSupportedSpecs returns visible slash commands that support --resume dispatch.