ToolsConfig class final

One scope's tools: section: tool id → user intent.

Keys are flat tool ids from knownToolIds, plus mcp:<server> keys for per-server MCP granularity — the raw yaml shape tools: {mcp: {my-server: false}} normalizes to the flat key mcp:my-server at parse time. Unknown ids are accepted here; warning about them happens at resolution.

Constructors

ToolsConfig({Map<String, bool> tools = const {}})
Creates a config from an already-normalized tools map.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether this scope declares no tool intent at all.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tools Map<String, bool>
Tool id (or mcp:<server>) → user intent for that tool.
final

Methods

mergedOver(ToolsConfig shallower) ToolsConfig
Merges this (deeper) config over shallower: the receiver wins per key; keys the receiver does not mention fall back to shallower.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
JSON envelope for the app store + CLI/app interchange: {"tools": {"<id>": bool}}. Corrupt input throws ConfigException; the caller decides the fallback.
toString() String
A string representation of this object.
inherited
toYaml() String
Serializes a tools: block: flat keys sorted, mcp:<server> keys rendered as a nested mcp: map. An empty config serializes to ''.

Operators

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

Static Methods

fromJson(Object? json) ToolsConfig
Restores a config from toJson's envelope. Strict like fromYaml.
fromYaml(Object? node) ToolsConfig
Parses one scope's tools: yaml node.