config

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalConfigPath

func GlobalConfigPath() string

GlobalConfigPath is the path to the global config file (~/.agentstore/config).

func RepoConfigPath

func RepoConfigPath(repoRoot string) string

RepoConfigPath is the path to a clone's local config file (.agentstore/config).

func SaveGlobal

func SaveGlobal(cfg GlobalConfig) error

SaveGlobal writes the GlobalConfig to ~/.agentstore/config.

func SaveRepo

func SaveRepo(repoRoot string, cfg RepoConfig) error

SaveRepo writes a RepoConfig to .agentstore/config in the repo root.

Types

type AuthSection

type AuthSection struct {
	RequestFreshnessSeconds int `toml:"request_freshness_seconds"`
}

AuthSection holds authentication settings.

type GlobalConfig

type GlobalConfig struct {
	// Remotes maps remote URL to its identity config: [remotes."https://..."]
	Remotes map[string]RemoteIdentity `toml:"remotes"`
}

GlobalConfig is parsed from ~/.agentstore/config.

func LoadGlobal

func LoadGlobal() (GlobalConfig, error)

LoadGlobal reads ~/.agentstore/config. Missing file is not an error.

type LimitsSection

type LimitsSection struct {
	MaxFileSizeBytes int64    `toml:"max_file_size_bytes"`
	MaxRepoSizeBytes int64    `toml:"max_repo_size_bytes"`
	AllowedFileTypes []string `toml:"allowed_file_types"`
}

LimitsSection holds resource limits.

type RemoteIdentity

type RemoteIdentity struct {
	Username    string `toml:"username"`
	KeyPath     string `toml:"key_path"`
	PrincipalID string `toml:"principal_id"`
}

RemoteIdentity holds per-remote authentication config from the global config file.

type RepoConfig

type RepoConfig struct {
	// Remotes maps remote name to URL: [remotes.origin]
	Remotes  map[string]RepoRemote `toml:"remotes"`
	Identity RepoIdentity          `toml:"identity"`
}

RepoConfig is parsed from .agentstore/config (per-clone, never pushed).

func LoadRepo

func LoadRepo(repoRoot string) (RepoConfig, error)

LoadRepo reads .agentstore/config from the given repo root. Missing file is not an error.

type RepoIdentity

type RepoIdentity struct {
	PrincipalID string `toml:"principal_id"`
}

RepoIdentity records which principal this clone belongs to, so local commits are authored by the right principal without consulting the global config. Local-only (never pushed); set at init/clone time.

type RepoRemote

type RepoRemote struct {
	URL string `toml:"url"`
}

RepoRemote holds the URL for a named remote in a per-repo config file.

type ServerConfig

type ServerConfig struct {
	Server ServerSection `toml:"server"`
	Limits LimitsSection `toml:"limits"`
	Auth   AuthSection   `toml:"auth"`
}

ServerConfig is parsed from server.toml in the data directory.

func DefaultServerConfig

func DefaultServerConfig() ServerConfig

DefaultServerConfig returns a ServerConfig populated with all defaults.

func LoadServer

func LoadServer(dataDir string) (ServerConfig, error)

LoadServer reads server.toml from the given data directory, merging over defaults. Missing file is not an error.

type ServerSection

type ServerSection struct {
	Addr string `toml:"addr"`
}

ServerSection holds network configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL