pub struct Config {Show 14 fields
pub paths: Paths,
pub agent: AgentConfig,
pub providers: ProvidersConfig,
pub heartbeat: HeartbeatConfig,
pub memory: MemoryConfig,
pub server: ServerConfig,
pub logging: LoggingConfig,
pub tools: ToolsConfig,
pub security: SecurityConfig,
pub sandbox: SandboxConfig,
pub telegram: Option<TelegramConfig>,
pub cron: CronConfig,
pub hooks: HooksConfig,
pub mcp: McpConfig,
}Fields§
§paths: PathsResolved XDG-compliant paths (not serialized)
agent: AgentConfig§providers: ProvidersConfig§heartbeat: HeartbeatConfig§memory: MemoryConfig§server: ServerConfig§logging: LoggingConfig§tools: ToolsConfig§security: SecurityConfig§sandbox: SandboxConfig§telegram: Option<TelegramConfig>§cron: CronConfig§hooks: HooksConfig§mcp: McpConfigImplementations§
Source§impl Config
impl Config
pub fn load() -> Result<Self>
Sourcepub fn load_from_dir(data_dir: &str) -> Result<Self>
pub fn load_from_dir(data_dir: &str) -> Result<Self>
Load (or create default) config with all directories rooted under data_dir.
Mobile apps use this instead of load() since they don’t have XDG dirs.
pub fn save(&self) -> Result<()>
Sourcepub fn save_with_template(&self) -> Result<()>
pub fn save_with_template(&self) -> Result<()>
Save config with a helpful template (for first-time setup)
pub fn config_path() -> Result<PathBuf>
pub fn get_value(&self, key: &str) -> Result<String>
pub fn set_value(&mut self, key: &str, value: &str) -> Result<()>
Sourcepub fn workspace_path(&self) -> PathBuf
pub fn workspace_path(&self) -> PathBuf
Get workspace path from resolved Paths.
Resolution is handled by Paths::resolve():
- LOCALGPT_WORKSPACE env var (absolute path override)
- LOCALGPT_PROFILE env var (creates workspace-{profile} under data_dir)
- memory.workspace from config file (deprecated compat)
- Default: data_dir/workspace
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().