Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category string
Category groups related commands for help display
const ( CategorySession Category = "Session Management" CategoryPTY Category = "PTY Management" CategoryGit Category = "Git Integration" CategoryOrganization Category = "Organization" CategoryView Category = "View" CategorySystem Category = "System" CategoryLegacy Category = "Legacy" CategorySpecial Category = "Special" // Hidden from main help )
Standard command categories
type CommandContext ¶
type CommandContext struct {
Command interface{} // The actual command (opaque to avoid circular import)
Args map[string]interface{}
AppState interface{}
UIState interface{}
Key string
}
CommandContext provides context and state to command handlers
type CommandHandler ¶
type CommandHandler func(ctx *CommandContext) error
CommandHandler is the function signature for command implementations
type CommandInterface ¶
type CommandInterface interface {
GetID() CommandID
GetName() string
GetDescription() string
GetCategory() Category
GetContexts() []ContextID
GetKeys() []string
IsDeprecated() bool
GetDeprecationInfo() *DeprecationInfo
Execute(ctx *CommandContext) error
}
CommandInterface defines the interface for commands
type ContextID ¶
type ContextID string
ContextID identifies different application contexts/modes
const ( ContextGlobal ContextID = "global" ContextList ContextID = "list" ContextPTYList ContextID = "pty-list" ContextGitStatus ContextID = "git-status" ContextHelp ContextID = "help" ContextPrompt ContextID = "prompt" ContextSearch ContextID = "search" ContextConfirm ContextID = "confirm" )
Standard application contexts
type ContextInterface ¶
type ContextInterface interface {
GetID() ContextID
GetName() string
GetDescription() string
GetParent() *ContextID
}
ContextInterface defines the interface for contexts
type DeprecationInfo ¶
DeprecationInfo tracks deprecated commands and their alternatives
type Instance ¶
type Instance interface {
GetPermissions() session.InstancePermissions
}
Instance represents a session instance with permission checks This interface allows command filtering without importing the full session package
type KeyConflict ¶
KeyConflict represents a keybinding conflict within a context
type RegistryInterface ¶
type RegistryInterface interface {
// Command management
GetCommand(id CommandID) (CommandInterface, bool)
GetAllCommands() map[CommandID]CommandInterface
GetKeysForCommand(cmdID CommandID) []string
ResolveCommand(contextID ContextID, key string) CommandInterface
// Context management
GetContext(id ContextID) (ContextInterface, bool)
GetCommandsForContext(contextID ContextID) []CommandInterface
// Validation
DetectConflicts() []KeyConflict
}
RegistryInterface defines the interface for command registries