Documentation
¶
Index ¶
- Constants
- func GetClaudeCommand() (string, error)
- func GetConfigDir() (string, error)
- func SaveConfig(config *Config) error
- func SaveState(state *State) error
- type AppState
- type Config
- type InstanceStorage
- type State
- func (s *State) AddRecentRepo(path string) error
- func (s *State) DeleteAllInstances() error
- func (s *State) GetHelpScreensSeen() uint32
- func (s *State) GetInstances() json.RawMessage
- func (s *State) GetRecentRepos() []string
- func (s *State) GetTopics() json.RawMessage
- func (s *State) SaveInstances(instancesJSON json.RawMessage) error
- func (s *State) SaveTopics(topicsJSON json.RawMessage) error
- func (s *State) SetHelpScreensSeen(seen uint32) error
- type StateManager
- type TopicStorage
Constants ¶
const ( StateFileName = "state.json" InstancesFileName = "instances.json" )
const (
ConfigFileName = "config.json"
)
Variables ¶
This section is empty.
Functions ¶
func GetClaudeCommand ¶
GetClaudeCommand attempts to find the "claude" command in the user's shell It checks in the following order: 1. Shell alias resolution: using "which" command 2. PATH lookup
If both fail, it returns an error.
func GetConfigDir ¶
GetConfigDir returns the path to the application's configuration directory
func SaveConfig ¶
SaveConfig exports the saveConfig function for use by other packages
Types ¶
type AppState ¶
type AppState interface {
// GetHelpScreensSeen returns the bitmask of seen help screens
GetHelpScreensSeen() uint32
// SetHelpScreensSeen updates the bitmask of seen help screens
SetHelpScreensSeen(seen uint32) error
}
AppState handles application-level state
type Config ¶
type Config struct {
// DefaultProgram is the default program to run in new instances
DefaultProgram string `json:"default_program"`
// AutoYes is a flag to automatically accept all prompts.
AutoYes bool `json:"auto_yes"`
// DaemonPollInterval is the interval (ms) at which the daemon polls sessions for autoyes mode.
DaemonPollInterval int `json:"daemon_poll_interval"`
// BranchPrefix is the prefix used for git branches created by the application.
BranchPrefix string `json:"branch_prefix"`
// NotificationsEnabled controls whether macOS/Linux desktop notifications
// are sent when an agent finishes (Running -> Ready).
NotificationsEnabled *bool `json:"notifications_enabled,omitempty"`
}
Config represents the application configuration
func LoadConfig ¶
func LoadConfig() *Config
func (*Config) AreNotificationsEnabled ¶
AreNotificationsEnabled returns whether desktop notifications are enabled. Defaults to true when the field is not set.
type InstanceStorage ¶
type InstanceStorage interface {
// SaveInstances saves the raw instance data
SaveInstances(instancesJSON json.RawMessage) error
// GetInstances returns the raw instance data
GetInstances() json.RawMessage
// DeleteAllInstances removes all stored instances
DeleteAllInstances() error
}
InstanceStorage handles instance-related operations
type State ¶
type State struct {
// HelpScreensSeen is a bitmask tracking which help screens have been shown
HelpScreensSeen uint32 `json:"help_screens_seen"`
// Instances stores the serialized instance data as raw JSON
InstancesData json.RawMessage `json:"instances"`
// TopicsData stores the serialized topic data as raw JSON
TopicsData json.RawMessage `json:"topics,omitempty"`
// RecentRepos stores recently opened repo paths so they persist in the picker
RecentRepos []string `json:"recent_repos,omitempty"`
}
State represents the application state that persists between sessions
func LoadState ¶
func LoadState() *State
LoadState loads the state from disk. If it cannot be done, we return the default state.
func (*State) AddRecentRepo ¶
AddRecentRepo adds a repo path to the recent list if not already present.
func (*State) DeleteAllInstances ¶
DeleteAllInstances removes all stored instances
func (*State) GetHelpScreensSeen ¶
GetHelpScreensSeen returns the bitmask of seen help screens
func (*State) GetInstances ¶
func (s *State) GetInstances() json.RawMessage
GetInstances returns the raw instance data
func (*State) GetRecentRepos ¶
GetRecentRepos returns the list of recently opened repo paths.
func (*State) GetTopics ¶
func (s *State) GetTopics() json.RawMessage
GetTopics returns the raw topic data
func (*State) SaveInstances ¶
func (s *State) SaveInstances(instancesJSON json.RawMessage) error
SaveInstances saves the raw instance data
func (*State) SaveTopics ¶
func (s *State) SaveTopics(topicsJSON json.RawMessage) error
SaveTopics saves the raw topic data
func (*State) SetHelpScreensSeen ¶
SetHelpScreensSeen updates the bitmask of seen help screens
type StateManager ¶
type StateManager interface {
InstanceStorage
TopicStorage
AppState
}
StateManager combines instance storage, topic storage, and app state management
type TopicStorage ¶
type TopicStorage interface {
SaveTopics(topicsJSON json.RawMessage) error
GetTopics() json.RawMessage
}
TopicStorage handles topic-related operations