Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyRuntimeDefaults(baseDir string)
- func GetConfig() *op.Config
- func GetHostName() string
- func GetIps() []string
- func GetModelConfig(modelKey string) (*op.ModelConfig, error)
- func GetSecrets() map[string]string
- func GetSystem() *op.SystemConfig
- func GetUserConfig() *op.UserConfig
- func GetUserProfile() *op.UserProfile
- func LoadLocalUserProfile() (*op.UserProfile, error)
- func NormalizeServiceTier(value string) string
- func Parse(configDir string) error
- func ReloadLocalUserConfig() (*op.UserProfile, error)
- func SetConfig(next *op.Config) error
- func SetSecrets(values map[string]string)
- func SetSystem(c *op.SystemConfig)
- func SetUserProfile(c *op.UserProfile)
- func StartUserConfigWatcher(ctx context.Context, onReload func(changedPath string)) error
- func SyncModelCache(models []op.ModelConfig)
- type HostInfoConfig
Constants ¶
View Source
const ( DefaultBaseDir = "~/.opagent" // System config supports JSONC under ~/.opagent/configs/config.json. DefaultDebug = false DefaultEnv = op.EnvLocal DefaultMessageStorage = "markdown" DefaultRuntimeUpdateManifestURL = "" DefaultRuntimeUpdateCheckInterval = "10m" DefaultRuntimeUpdateCheckTimeout = "8s" DefaultRuntimeUpdateIdleGracePeriod = "15s" DefaultRuntimeUpdateDownloadDir = "run/runtime-update" DefaultMaxThreads = 10000 )
Variables ¶
View Source
var ( // command line flags CmdBaseDir = "" CmdDebug = false CmdEnv = op.EnvLocal )
Functions ¶
func ApplyRuntimeDefaults ¶
func ApplyRuntimeDefaults(baseDir string)
ApplyRuntimeDefaults resolves storage paths after either the built-in loader or a host ConfigLoader has populated the process configuration.
func GetHostName ¶
func GetHostName() string
func GetModelConfig ¶
func GetModelConfig(modelKey string) (*op.ModelConfig, error)
func GetSecrets ¶
func GetSystem ¶
func GetSystem() *op.SystemConfig
func GetUserConfig ¶
func GetUserConfig() *op.UserConfig
func GetUserProfile ¶
func GetUserProfile() *op.UserProfile
func LoadLocalUserProfile ¶
func LoadLocalUserProfile() (*op.UserProfile, error)
func NormalizeServiceTier ¶
func ReloadLocalUserConfig ¶
func ReloadLocalUserConfig() (*op.UserProfile, error)
func SetSecrets ¶
func SetSystem ¶
func SetSystem(c *op.SystemConfig)
func SetUserProfile ¶
func SetUserProfile(c *op.UserProfile)
func StartUserConfigWatcher ¶
StartUserConfigWatcher watches baseDir/configs/user and hot-reloads local user config files.
func SyncModelCache ¶
func SyncModelCache(models []op.ModelConfig)
Types ¶
type HostInfoConfig ¶
func GetHostInfo ¶
func GetHostInfo(sysDir string) *HostInfoConfig
GetHostInfo returns host info using sysDir for host_id persistence. Use this when building system config before SetSystem has been called.
Click to show internal directories.
Click to hide internal directories.