Documentation
¶
Index ¶
- Constants
- Variables
- func CheckCommandPermission(cmdID CommandID, perms session.InstancePermissions) bool
- func InitializeCommands(registry *CommandRegistry) error
- func InitializeContexts(registry *CommandRegistry) error
- type Bridge
- func (b *Bridge) DetectKeyConflicts() []string
- func (b *Bridge) GetAvailableKeys() map[string]string
- func (b *Bridge) GetAvailableKeysForInstance(instance interfaces.Instance) map[string]string
- func (b *Bridge) GetCommandForKey(key string) *Command
- func (b *Bridge) GetContextualHelp() string
- func (b *Bridge) GetCurrentContext() ContextID
- func (b *Bridge) GetKeyCategories() map[string][]string
- func (b *Bridge) GetLegacyStatusLine() string
- func (b *Bridge) GetRegistry() *CommandRegistry
- func (b *Bridge) HandleKeyString(key string) (tea.Model, tea.Cmd, error)
- func (b *Bridge) HandleLegacyKey(keyName interface{}) (tea.Model, tea.Cmd, error)
- func (b *Bridge) Initialize(sessionHandlers *commands.SessionHandlers, gitHandlers *commands.GitHandlers, ...)
- func (b *Bridge) IsKeyBound(key string) bool
- func (b *Bridge) PopContext() ContextID
- func (b *Bridge) PushContext(contextID ContextID)
- func (b *Bridge) ReloadConfig()
- func (b *Bridge) SetContext(contextID ContextID)
- func (b *Bridge) ValidateAllContexts() map[string][]string
- func (b *Bridge) ValidateSetup() []string
- type Category
- type Command
- type CommandBuilder
- func (cb *CommandBuilder) BindKey(key string) *CommandBuilder
- func (cb *CommandBuilder) BindKeyInContext(key string, contexts ...ContextID) *CommandBuilder
- func (cb *CommandBuilder) BindKeys(keys ...string) *CommandBuilder
- func (cb *CommandBuilder) DeprecateKey(key, message string) *CommandBuilder
- func (cb *CommandBuilder) SetAlternative(altID CommandID) *CommandBuilder
- type CommandHandler
- type CommandID
- type CommandRegistry
- func (r *CommandRegistry) DetectConflicts() []KeyConflict
- func (r *CommandRegistry) GetAllCommands() map[CommandID]*Command
- func (r *CommandRegistry) GetCommand(id CommandID) (*Command, bool)
- func (r *CommandRegistry) GetCommandsForContext(contextID ContextID) []*Command
- func (r *CommandRegistry) GetContext(id ContextID) (*Context, bool)
- func (r *CommandRegistry) GetKeysForCommand(cmdID CommandID) []string
- func (r *CommandRegistry) Register(cmd *Command) *CommandBuilder
- func (r *CommandRegistry) RegisterContext(ctx *Context) error
- func (r *CommandRegistry) ResolveCommand(contextID ContextID, key string) *Command
- func (r *CommandRegistry) String() string
- type Context
- type ContextID
- type DeprecationInfo
- type KeyConflict
Constants ¶
const ( CategoryView = interfaces.CategoryView CategoryPTY = interfaces.CategoryPTY )
Import category constants from interfaces
Variables ¶
var CategoryOrder = []Category{ CategorySession, CategoryGit, CategoryVC, CategoryOrganization, CategoryNavigation, CategorySystem, CategoryLegacy, }
CategoryOrder defines the display order for help screens
Functions ¶
func CheckCommandPermission ¶
func CheckCommandPermission(cmdID CommandID, perms session.InstancePermissions) bool
CheckCommandPermission checks if the given permissions allow executing the command
func InitializeCommands ¶
func InitializeCommands(registry *CommandRegistry) error
InitializeCommands sets up all standard commands in the registry
func InitializeContexts ¶
func InitializeContexts(registry *CommandRegistry) error
InitializeContexts sets up the context hierarchy
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge provides compatibility between old and new command systems
func GetGlobalBridge ¶
func GetGlobalBridge() *Bridge
GetGlobalBridge returns the global bridge instance
func (*Bridge) DetectKeyConflicts ¶
DetectKeyConflicts checks for duplicate key bindings within the current context
func (*Bridge) GetAvailableKeys ¶
GetAvailableKeys returns all keys available in the current context
func (*Bridge) GetAvailableKeysForInstance ¶
func (b *Bridge) GetAvailableKeysForInstance(instance interfaces.Instance) map[string]string
GetAvailableKeysForInstance returns keys available based on instance permissions This filters commands to only show what the user is allowed to execute for the given instance
func (*Bridge) GetCommandForKey ¶
GetCommandForKey returns the command bound to a key
func (*Bridge) GetContextualHelp ¶
GetContextualHelp generates help for current context
func (*Bridge) GetCurrentContext ¶
GetCurrentContext returns the current context
func (*Bridge) GetKeyCategories ¶
GetKeyCategories returns keys organized by category for dynamic help generation Uses per-context caching to avoid expensive registry lookups on every help display
func (*Bridge) GetLegacyStatusLine ¶
GetLegacyStatusLine generates status line compatible with old menu system
func (*Bridge) GetRegistry ¶
func (b *Bridge) GetRegistry() *CommandRegistry
GetRegistry returns the command registry
func (*Bridge) HandleKeyString ¶
HandleKeyString processes a key string through the new command system
func (*Bridge) HandleLegacyKey ¶
HandleLegacyKey is disabled since legacy keys package has been removed
func (*Bridge) Initialize ¶
func (b *Bridge) Initialize( sessionHandlers *commands.SessionHandlers, gitHandlers *commands.GitHandlers, navigationHandlers *commands.NavigationHandlers, organizationHandlers *commands.OrganizationHandlers, systemHandlers *commands.SystemHandlers, )
Initialize sets up the bridge with handler callbacks
func (*Bridge) IsKeyBound ¶
IsKeyBound checks if a key is bound to any command in current context
func (*Bridge) PopContext ¶
PopContext removes the top context from the stack
func (*Bridge) PushContext ¶
PushContext adds a context to the stack (for modal operations)
func (*Bridge) ReloadConfig ¶
func (b *Bridge) ReloadConfig()
ReloadConfig refreshes the configuration from disk
func (*Bridge) SetContext ¶
SetContext switches to a different application context
func (*Bridge) ValidateAllContexts ¶
ValidateAllContexts checks for key conflicts across all contexts
func (*Bridge) ValidateSetup ¶
ValidateSetup checks if the bridge is properly configured
type Category ¶
type Category = interfaces.Category
const ( CategorySession Category = "Session Management" CategoryGit Category = "Git Integration" CategoryVC Category = "Version Control" // VC tab operations (Git/Jujutsu) CategoryOrganization Category = "Organization" CategorySystem Category = "System" CategoryLegacy Category = "Legacy" CategorySpecial Category = "Special" // Hidden from main help )
Standard command categories for organizing help display
type Command ¶
type Command struct {
ID CommandID
Name string
Description string
Category Category
Handler CommandHandler
Contexts []ContextID
// Optional fields
Aliases []string
Deprecated *DeprecationInfo
Prerequisites []CommandID
// contains filtered or unexported fields
}
Command represents a user action that can be triggered by keybindings
func FilterCommandsByPermissions ¶
func FilterCommandsByPermissions(commands []*Command, perms session.InstancePermissions) []*Command
FilterCommandsByPermissions filters a list of commands based on instance permissions
type CommandBuilder ¶
type CommandBuilder struct {
// contains filtered or unexported fields
}
CommandBuilder provides a fluent interface for configuring commands
func (*CommandBuilder) BindKey ¶
func (cb *CommandBuilder) BindKey(key string) *CommandBuilder
BindKey binds a single key to the command in all its contexts
func (*CommandBuilder) BindKeyInContext ¶
func (cb *CommandBuilder) BindKeyInContext(key string, contexts ...ContextID) *CommandBuilder
BindKeyInContext binds a key to the command only in specific contexts
func (*CommandBuilder) BindKeys ¶
func (cb *CommandBuilder) BindKeys(keys ...string) *CommandBuilder
BindKeys binds multiple keys to the command in all its contexts
func (*CommandBuilder) DeprecateKey ¶
func (cb *CommandBuilder) DeprecateKey(key, message string) *CommandBuilder
DeprecateKey marks a specific key binding as deprecated
func (*CommandBuilder) SetAlternative ¶
func (cb *CommandBuilder) SetAlternative(altID CommandID) *CommandBuilder
SetAlternative sets the alternative command for deprecated commands
type CommandHandler ¶
type CommandHandler func(ctx *interfaces.CommandContext) error
CommandHandler is the function signature for command implementations
type CommandID ¶
type CommandID = interfaces.CommandID
Use types from interfaces package to avoid duplication
type CommandRegistry ¶
type CommandRegistry struct {
// contains filtered or unexported fields
}
CommandRegistry is the central registry for all commands and keybindings
func GetCommandRegistry ¶
func GetCommandRegistry() *CommandRegistry
GetCommandRegistry returns the global command registry
func GetGlobalRegistry ¶
func GetGlobalRegistry() *CommandRegistry
GetGlobalRegistry returns the initialized global registry
func NewCommandRegistry ¶
func NewCommandRegistry() *CommandRegistry
NewCommandRegistry creates a new command registry
func (*CommandRegistry) DetectConflicts ¶
func (r *CommandRegistry) DetectConflicts() []KeyConflict
DetectConflicts finds keybinding conflicts within contexts
func (*CommandRegistry) GetAllCommands ¶
func (r *CommandRegistry) GetAllCommands() map[CommandID]*Command
GetAllCommands returns all registered commands
func (*CommandRegistry) GetCommand ¶
func (r *CommandRegistry) GetCommand(id CommandID) (*Command, bool)
GetCommand retrieves a command by ID
func (*CommandRegistry) GetCommandsForContext ¶
func (r *CommandRegistry) GetCommandsForContext(contextID ContextID) []*Command
GetCommandsForContext returns all commands available in a context (including inherited)
func (*CommandRegistry) GetContext ¶
func (r *CommandRegistry) GetContext(id ContextID) (*Context, bool)
GetContext retrieves a context by ID
func (*CommandRegistry) GetKeysForCommand ¶
func (r *CommandRegistry) GetKeysForCommand(cmdID CommandID) []string
GetKeysForCommand returns all keys bound to a command
func (*CommandRegistry) Register ¶
func (r *CommandRegistry) Register(cmd *Command) *CommandBuilder
Register adds a command to the registry and returns a builder for further configuration
func (*CommandRegistry) RegisterContext ¶
func (r *CommandRegistry) RegisterContext(ctx *Context) error
RegisterContext adds a new context to the registry
func (*CommandRegistry) ResolveCommand ¶
func (r *CommandRegistry) ResolveCommand(contextID ContextID, key string) *Command
ResolveCommand finds the command bound to a key in a given context
func (*CommandRegistry) String ¶
func (r *CommandRegistry) String() string
String returns a debug string representation of the registry
type ContextID ¶
type ContextID = interfaces.ContextID
const ( ContextGlobal ContextID = "global" ContextList ContextID = "list" ContextPTYList ContextID = "pty-list" ContextGitStatus ContextID = "git-status" ContextVCTab ContextID = "vc-tab" ContextHelp ContextID = "help" ContextPrompt ContextID = "prompt" ContextSearch ContextID = "search" ContextConfirm ContextID = "confirm" )
Standard application contexts
type DeprecationInfo ¶
DeprecationInfo tracks deprecated commands and their alternatives
type KeyConflict ¶
KeyConflict represents a keybinding conflict within a context
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
claude-mux is a PTY multiplexer that enables bidirectional terminal access from multiple sources (e.g., IntelliJ terminal + claude-squad web UI).
|
claude-mux is a PTY multiplexer that enables bidirectional terminal access from multiple sources (e.g., IntelliJ terminal + claude-squad web UI). |