Expand description
Lazy, hot-reloading resolution of Rhai script providers.
Native providers are built eagerly at daemon startup. Script providers are
not: a .rhai file in the providers directory becomes a live provider only
when an agent references its name, and it is reloaded automatically when
the file changes. ScriptProviderLayer is the seam the ProviderRegistry
consults for any name it doesn’t have natively; it caches compiled providers
keyed by file mtime, so:
- first reference to
<name>→ compile +initialize+ cache; - unchanged file → cached instance (no recompile);
- edited file (newer mtime) → rebuild;
- a brand-new file that didn’t exist at startup → loads on first reference;
- a deleted file → evicted, the provider disappears;
- a broken script → not resolved (logged), so selection falls through.
Structs§
- Script
Provider Layer - Lazy, hot-reloading resolver for script providers.
- Script
Provider Spec - Per-provider configuration from
[model_providers.<name>]. All fields are optional overrides - a script activates by an agent referencing its name and the file existing, not by having an entry here.