ConfigService class final

The config service over one ExecutionEnv. See the library docs.

Constructors

ConfigService({required ExecutionEnv env, String? homeDir, bool supportsProcesses = true})
Creates the service. homeDir may be null on hosts without a home directory (web) — the global scope answers "not available" instead of guessing a path. supportsProcesses is false on hosts that cannot spawn host-side processes (web browser, iOS/Android containers): the stdio-server members of mcp: then answer "not applicable on this host" instead of resolving or writing dead config (issue #29 AC11).

Properties

env → ExecutionEnv
The execution env the service reads and writes through.
final
globalConfigPath → String?
The user config file, or null when the host has no home directory.
no setter
hashCode → int
The hash code for this object.
no setterinherited
homeDir → String?
The user home directory, or null when the host has none.
final
projectConfigPath → String
The project config file (resolved against the env cwd).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportsProcesses → bool
Whether this host can spawn host-side processes (MCP stdio servers).
final

Methods

check() → Future<ConfigCheckReport>
Validates both config files with the real section parsers. Missing files are fine (defaults apply); syntax errors, strict-section schema errors and bad scalar types are errors; unknown top-level keys are warnings (the runtime silently ignores them — the check does not).
get(String key) → Future<ConfigGetResult>
Resolves one dotted key (memory.projectPath, tools.web_search, provider, mcp.servers.fs.url, ...) to its effective value. Project scope wins for the project-capable sections; everything else comes from the user file. Unknown top-level keys throw — get must catch typos, not report them as "not set".
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paths() → Future<List<ConfigPathInfo>>
The config file locations and whether each exists.
resolveWriteScope(ConfigScope? scope, {String? key}) → Future<ConfigScope>
Resolves the write scope: an explicit scope wins. By default the project-capable sections (memory/cube/tools) belong in the project file (created when absent); everything else belongs in the user file.
set(String key, String value, {ConfigScope? scope}) → Future<ConfigSetResult>
Writes value (rendered as a YAML scalar) at the dotted key in the resolved scope file. The edited text is validated with the real parsers BEFORE the write, so a bad value throws and nothing is persisted. Missing files are created with the minimal section (never a half-written document).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited