Skip to content

GlueConfig

Category: Config

Source: glue_config.dart

Classes

CatalogSourceConfig

Configuration for how Glue sources the bundled/remote model catalog.

Constructor

dart
const CatalogSourceConfig({this.refresh = 'manual', this.remoteUrl})

Properties

PropertyTypeDescription
refreshString`never
remoteUrlUri?When non-null, background refresh pulls from here.

ConfigError

Constructor

dart
ConfigError(this.message)

Properties

PropertyTypeDescription
messageString

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

dart
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,
  })
dart
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

PropertyTypeDescription
activeModelModelRefPrimary model used for agent conversations.
smallModelModelRef?Cheap/fast model for session title generation, summaries, etc. When null, [activeModel] is used.
profilesMap&lt;String, ModelRef&gt;Named shortcuts (/model @fast, etc.).
catalogCatalogSourceConfig
catalogDataModelCatalogThe fully-merged model catalog (bundled + cached remote + local).
credentialsCredentialStoreResolves [CredentialRef]s and walks [AuthSpec] for providers.
adaptersAdapterRegistryRegistry 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.
maxSubagentDepthint
bashMaxLinesint
shellConfigShellConfig
dockerConfigDockerConfig
webConfigWebConfig
observabilityObservabilityConfig
skillPathsList&lt;String&gt;
approvalModeApprovalMode
titleGenerationEnabledboolWhen 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.
anthropicPromptCacheboolWhen 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.
mcpMcpConfigMCP (Model Context Protocol) configuration — list of configured servers, tool policy, reconnect defaults. Empty by default.
runtimeString?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.
runtimeOptionsMap&lt;String, Object?&gt;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.
effectiveRuntimeString getResolves 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&lt;String&gt; splitPathList(String value, {bool? isWindows})

Splits a path-list env var using platform-appropriate separators. Unix uses : (like $PATH), Windows uses ;.

Released under the MIT License.