Documentation
¶
Overview ¶
Package state persists per-project dump records in the user's application data directory so delta dumps can know the last commit a project was dumped from, without polluting the repository itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProjectKey ¶
GetProjectKey returns a stable 16-hex-char key for an absolute project path.
func SavePreferences ¶
func SavePreferences(prefs Preferences) error
SavePreferences writes user preferences atomically.
Types ¶
type AppState ¶
type AppState struct {
Projects map[string]DumpRecord `json:"projects"`
}
AppState holds the dump record of every project that has been dumped, keyed by GetProjectKey.
func (*AppState) Get ¶
func (s *AppState) Get(key string) (DumpRecord, bool)
Get returns the dump record for a project key, if present.
type DumpRecord ¶
type DumpRecord struct {
LastCommitHash string `json:"last_commit_hash"`
LastCommitMsg string `json:"last_commit_msg"`
DumpTimestamp time.Time `json:"dump_timestamp"`
FilesDumped int `json:"files_dumped"`
TokensDumped int `json:"tokens_dumped"`
}
DumpRecord describes the most recent dump of a project.
type Preferences ¶
type Preferences struct {
UITheme string `json:"ui_theme,omitempty"`
}
Preferences contains user-level interactive preferences that should survive picker sessions but do not belong to a project's dump history.
func LoadPreferences ¶
func LoadPreferences() (Preferences, error)
LoadPreferences loads user preferences. Missing preferences are normal and return the zero-value preference set.