GlueConfig
Category: Config
Source: glue_config.dart
Classes
CatalogSourceConfig
Configuration for how Glue sources the bundled/remote model catalog.
Constructor
const CatalogSourceConfig({this.refresh = 'manual', this.remoteUrl})Properties
| Property | Type | Description |
|---|---|---|
refresh | String | `never |
remoteUrl | Uri? | When non-null, background refresh pulls from here. |
ConfigError
Constructor
ConfigError(this.message)Properties
| Property | Type | Description |
|---|---|---|
message | String |
Methods
String toString()
GlueConfig
Glue application configuration.
Resolution order for the active model: CLI args → env vars (GLUE_MODEL) → ~/.glue/config.yaml → catalog defaults.
Credentials (API keys) live outside this object — in environment variables and ~/.glue/credentials.json, accessed via [credentials].
Constructor
GlueConfig({
required this.activeModel,
required this.catalogData,
required this.credentials,
required this.adapters,
this.smallModel,
this.profiles = const {},
this.catalog = const CatalogSourceConfig(),
this.maxSubagentDepth = AppConstants.maxSubagentDepth,
this.bashMaxLines = AppConstants.bashMaxLinesDefault,
ShellConfig? shellConfig,
DockerConfig? dockerConfig,
WebConfig? webConfig,
this.observability = const ObservabilityConfig(),
this.skillPaths = const [],
this.approvalMode = ApprovalMode.confirm,
this.titleGenerationEnabled = true,
this.anthropicPromptCache = true,
this.mcp = const McpConfig(),
this.runtime,
Map<String, Object?>? runtimeOptions,
})factory GlueConfig.load({
String? cliModel,
Environment? environment,
String? configPath,
ModelCatalog? catalogOverride,
CredentialStore? credentialsOverride,
AdapterRegistry? adaptersOverride,
})Loads configuration from env, optional ~/.glue/config.yaml, and CLI overrides. Constructs the merged catalog, credential store, and adapter registry.
Throws [ConfigError] with a migration pointer when the config file is in the legacy v1 shape (top-level provider:, per-provider api_key:).
Properties
| Property | Type | Description |
|---|---|---|
activeModel | ModelRef | Primary model used for agent conversations. |
smallModel | ModelRef? | Cheap/fast model for session title generation, summaries, etc. When null, [activeModel] is used. |
profiles | Map<String, ModelRef> | Named shortcuts (/model @fast, etc.). |
catalog | CatalogSourceConfig | |
catalogData | ModelCatalog | The fully-merged model catalog (bundled + cached remote + local). |
credentials | CredentialStore | Resolves [CredentialRef]s and walks [AuthSpec] for providers. |
adapters | AdapterRegistry | Registry of provider adapters (anthropic, openai-compatible, …). Not final — ServiceLocator swaps this after observability is constructed so adapters can thread a logging HTTP factory into their LLM clients. |
maxSubagentDepth | int | |
bashMaxLines | int | |
shellConfig | ShellConfig | |
dockerConfig | DockerConfig | |
webConfig | WebConfig | |
observability | ObservabilityConfig | |
skillPaths | List<String> | |
approvalMode | ApprovalMode | |
titleGenerationEnabled | bool | When false, session title generation is skipped entirely. No LLM client is created and the session title remains null. Resolution order: GLUE_TITLE_GENERATION_ENABLED env var → title_generation_enabled YAML key → default true. |
anthropicPromptCache | bool | When true (default), Anthropic requests include a top-level cache_control: {type: "ephemeral"} directive that enables auto-caching of the largest stable prefix of the request. Disable for proxies that reject the field, or for measurement comparisons. Resolution order: GLUE_ANTHROPIC_PROMPT_CACHE env var → anthropic_prompt_cache YAML key → default true. Caching is GA on Claude 4.x and silently no-op on older Anthropic models. The flag has no effect on non-Anthropic providers. |
mcp | McpConfig | MCP (Model Context Protocol) configuration — list of configured servers, tool policy, reconnect defaults. Empty by default. |
runtime | String? | Selected runtime adapter: 'host', 'docker', or the name of a registered cloud adapter (e.g. 'daytona'). When null, resolution falls back to legacy behaviour — Docker if dockerConfig.enabled, host otherwise — so existing configs keep working unchanged. Resolution order: GLUE_RUNTIME env var → runtime: YAML key → legacy fallback above. |
runtimeOptions | Map<String, Object?> | Per-runtime options keyed by runtime id. For example, when runtime: daytona is selected the daytona key holds {api_key, base_url, image} — adapters parse this on startup. Stored as untyped JSON-ish data here to keep glue_harness free of dependencies on cloud-adapter packages. |
effectiveRuntime | String get | Resolves the effective runtime name from [runtime] and the legacy docker.enabled flag. |
Methods
ResolvedProvider resolveProvider(ModelRef ref)
Resolve [ref] against the loaded catalog and credential store.
Throws [ConfigError] when the provider is unknown.
ResolvedProvider resolveProviderById(String providerId)
Resolve a provider without requiring a model id — useful for health checks and action menus where no particular model is in play.
ResolvedModel resolveModel(ModelRef ref)
Resolve [ref] to a concrete [ResolvedModel]. If the model id is not in the catalog, a synthetic [ModelDef] is returned (covers user-typed ids that provider APIs accept but we haven't catalogued).
void validate()
Validates that the active model's provider has a usable credential. Throws [ConfigError] with a remediation message on failure.
`GlueConfig copyWith({
ModelRef? activeModel,
ObservabilityConfig? observability,
})`
Functions
List<String> splitPathList(String value, {bool? isWindows})
Splits a path-list env var using platform-appropriate separators. Unix uses : (like $PATH), Windows uses ;.