Skip to main content

Module theme_discovery

Module theme_discovery 

Source
Expand description

Theme progressive discovery, registry, and loading.

Provides the discovery and registry system for themes that are progressively loaded from project, user, explicit, and package resources. Theme metadata (name, description) is available without parsing all color tokens; the full Theme is constructed on demand when needed.

§Theme File Format

Each theme is a directory containing a theme.toml file:

name = "my-theme"
description = "A warm theme for late-night coding."

[colors]
role_user = "Green"
role_assistant = "#66d9ef"
status_bg = "#1a1a2e"

Colors may be specified as named colors ("Red", "DarkGray", etc.) or hex RGB ("#rrggbb"). Unspecified tokens inherit from the default theme.

§Discovery Precedence

Themes use the same precedence-based discovery as extensions and skills (see crate::resource). Higher precedence values override lower ones when theme names collide.

§Unstable

This module is part of the unstable 0.x extension API. Breaking changes may occur between minor versions without a major version bump.

Structs§

ThemeManifest
Parsed theme manifest from theme.toml.
ThemeRegistry
A registry of discovered themes supporting progressive disclosure and active theme resolution.
ThemeResource
A discovered theme resource with its manifest, filesystem path, and layer precedence.

Enums§

ThemeDiscoveryError
Errors from theme discovery, manifest parsing, and loading.

Functions§

discover_themes
Discover themes across multiple layers with precedence-based deduplication.