Documentation
¶
Overview ¶
ABOUTME: Configuration loading, user identity detection, and project identity resolution. ABOUTME: Reads JSON config file with defaults, auto-detects git identity with config override.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAgentsviewDBPath ¶
func DefaultAgentsviewDBPath() string
DefaultAgentsviewDBPath returns the standard agentsview DB location if it exists. Checks ~/.agentsview/sessions.db first, then ~/.claude/agentsview/sessions.db.
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir returns ~/.config/agentlore/data as the default data directory.
func DetectUserIdentity ¶
DetectUserIdentity runs git config to auto-detect the user's name and email. Returns userName, userID (email), error.
func ResolveProjectIdentity ¶
ResolveProjectIdentity returns the project ID and name for a given project path. projectID is the git remote origin URL; projectName is derived from the last path component of the remote URL without .git, or the directory basename as fallback. If the path is not a git repo or has no remote, returns ("", basename).
Types ¶
type Config ¶
type Config struct {
ClickHouseAddr string `json:"clickhouse_addr"`
ClickHouseDatabase string `json:"clickhouse_database"`
ClickHouseSecure bool `json:"clickhouse_secure"`
ClickHouseUser string `json:"clickhouse_user"`
ClickHousePassword string `json:"clickhouse_password"`
UserName string `json:"user_name"`
UserID string `json:"user_id"`
AgentsviewDBPath string `json:"agentsview_db_path"`
DataDir string `json:"data_dir"`
ServerPort int `json:"server_port"`
}
Config holds all daemon configuration fields.
func Load ¶
Load reads configuration from a JSON file at the given path. Returns sensible defaults when the file does not exist.
func (*Config) ResolvedUserIdentity ¶
ResolvedUserIdentity returns the user identity, preferring config overrides and falling back to git auto-detection. Returns userID (email), userName.