Documentation
¶
Index ¶
- Constants
- func DefaultClaudeDir() string
- func DetectClaudeDirForRepo(sessionReader ports.SessionReader, repoInfo string) (string, error)
- func ExpandPath(path string) string
- func GetDBPath() string
- func GetRochaHome() string
- func GetSettingsExample() map[string]any
- func GetSettingsFilePath() string
- func GetSettingsPath() string
- func GetWorktreePath() string
- func ResolveClaudeDir(sessionReader ports.SessionReader, repoInfo, userOverride string) string
- func SaveSettings(settings *Settings) error
- type KeyBindingValue
- type KeyBindingsConfig
- type Settings
- type StatusConfig
- type StringArray
- type TimestampColorConfig
Constants ¶
const DefaultTmuxStatusPosition = "bottom"
DefaultTmuxStatusPosition is the default tmux status bar position
const MainRepoDir = ".main"
MainRepoDir is the directory name used for the main repository clone
Variables ¶
This section is empty.
Functions ¶
func DefaultClaudeDir ¶
func DefaultClaudeDir() string
DefaultClaudeDir returns the default Claude directory Checks CLAUDE_CONFIG_DIR environment variable first, then falls back to ~/.claude
func DetectClaudeDirForRepo ¶
func DetectClaudeDirForRepo(sessionReader ports.SessionReader, repoInfo string) (string, error)
DetectClaudeDirForRepo finds ClaudeDir from existing sessions of the same repository (for consistency) Returns empty string if no existing sessions found or if they don't have ClaudeDir set
func GetSettingsExample ¶
GetSettingsExample uses reflection to generate example settings This automatically stays in sync when new fields are added to Settings
func GetSettingsFilePath ¶
func GetSettingsFilePath() string
GetSettingsFilePath returns the path to the settings file
func GetSettingsPath ¶
func GetSettingsPath() string
GetSettingsPath returns $ROCHA_HOME/settings.json
func ResolveClaudeDir ¶
func ResolveClaudeDir(sessionReader ports.SessionReader, repoInfo, userOverride string) string
ResolveClaudeDir determines ClaudeDir with precedence: 1. User override (if provided and non-empty) 2. Existing sessions' ClaudeDir (if repo has sessions with ClaudeDir set) 3. Default ~/.claude
Always returns an expanded absolute path
func SaveSettings ¶
SaveSettings saves settings to $ROCHA_HOME/settings.json
Types ¶
type KeyBindingValue ¶
type KeyBindingValue []string
KeyBindingValue supports "a" or ["up", "k"] in JSON
func (KeyBindingValue) MarshalJSON ¶
func (kv KeyBindingValue) MarshalJSON() ([]byte, error)
MarshalJSON implements custom marshaling for KeyBindingValue
func (*KeyBindingValue) UnmarshalJSON ¶
func (kv *KeyBindingValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshaling for KeyBindingValue
type KeyBindingsConfig ¶
type KeyBindingsConfig map[string]KeyBindingValue
KeyBindingsConfig holds custom key binding overrides as a map. Keys are binding names (e.g., "archive", "help"), values are the key sequences.
func (KeyBindingsConfig) Validate ¶
func (k KeyBindingsConfig) Validate(validNames []string) error
Validate checks for configuration errors in key bindings. The validNames parameter should come from ui.GetValidKeyNames().
type Settings ¶
type Settings struct {
AllowDangerouslySkipPermissions *bool `json:"allow_dangerously_skip_permissions,omitempty"`
Debug *bool `json:"debug,omitempty"`
Editor string `json:"editor,omitempty"`
ErrorClearDelay *int `json:"error_clear_delay,omitempty"`
Keys KeyBindingsConfig `json:"keys,omitempty"`
MaxLogFiles *int `json:"max_log_files,omitempty"`
ShowPRNumber *bool `json:"show_pr_number,omitempty"`
ShowTimestamps *bool `json:"show_timestamps,omitempty"`
ShowTokenChart *bool `json:"show_token_chart,omitempty"`
StatusColors StringArray `json:"status_colors,omitempty"`
Statuses StringArray `json:"statuses,omitempty"`
TipsDisplayDurationSeconds *int `json:"tips_display_duration_seconds,omitempty"`
TipsEnabled *bool `json:"tips_enabled,omitempty"`
TipsShowIntervalSeconds *int `json:"tips_show_interval_seconds,omitempty"`
TmuxStatusPosition string `json:"tmux_status_position,omitempty"`
}
Settings represents the structure of ~/.rocha/settings.json
func LoadSettings ¶
LoadSettings loads settings from $ROCHA_HOME/settings.json (or ~/.rocha/settings.json if not set) Returns empty Settings if file doesn't exist (not an error)
type StatusConfig ¶
StatusConfig holds the configuration for session implementation statuses
func NewStatusConfig ¶
func NewStatusConfig(statuses, icons, colors string) *StatusConfig
NewStatusConfig creates a new StatusConfig from comma-separated strings
func (*StatusConfig) GetColor ¶
func (c *StatusConfig) GetColor(status string) string
GetColor returns a color for a given status based on its position Uses configured color palette for visual distinction
func (*StatusConfig) GetIcon ¶
func (c *StatusConfig) GetIcon(status string) string
GetIcon returns the icon for a given status name, or empty string if not found
func (*StatusConfig) GetNextStatus ¶
func (c *StatusConfig) GetNextStatus(currentStatus *string) *string
GetNextStatus returns the next status in the cycle nil -> first status -> second status -> ... -> last status -> nil
type StringArray ¶
type StringArray []string
StringArray supports both JSON arrays and comma-separated strings
func (*StringArray) UnmarshalJSON ¶
func (sa *StringArray) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshaling for StringArray
type TimestampColorConfig ¶
type TimestampColorConfig struct {
RecentColor string // Color for recent updates (< RecentMinutes)
RecentMinutes int // Threshold in minutes for recent color
StaleColor string // Color for very old updates (>= WarningMinutes)
WarningColor string // Color for moderately old updates (>= RecentMinutes, < WarningMinutes)
WarningMinutes int // Threshold in minutes for warning color
}
TimestampColorConfig holds configuration for timestamp display colors. Colors change based on how recently the session state was updated.
func NewTimestampColorConfig ¶
func NewTimestampColorConfig(recentMin, warningMin int, recentColor, warningColor, staleColor string) *TimestampColorConfig
NewTimestampColorConfig creates a new TimestampColorConfig with the provided values.