pub struct HatConfig {
pub name: String,
pub description: Option<String>,
pub triggers: Vec<String>,
pub publishes: Vec<String>,
pub instructions: String,
pub extra_instructions: Vec<String>,
pub backend: Option<HatBackend>,
pub default_publishes: Option<String>,
pub max_activations: Option<u32>,
}Expand description
Configuration for a single hat.
Fields§
§name: StringHuman-readable name for the hat.
description: Option<String>Short description of the hat’s purpose (required). Used in the HATS table to help Ralph understand when to delegate to this hat.
triggers: Vec<String>Events that trigger this hat to be worn. Per spec: “Hats define triggers — which events cause Ralph to wear this hat.”
publishes: Vec<String>Topics this hat publishes.
instructions: StringInstructions prepended to prompts.
extra_instructions: Vec<String>Additional instruction fragments appended to instructions.
Use with YAML anchors to share common instruction blocks across hats:
_confidence_protocol: &confidence_protocol |
### Confidence-Based Decision Protocol
...
hats:
architect:
instructions: |
## ARCHITECT MODE
...
extra_instructions:
- *confidence_protocolbackend: Option<HatBackend>Backend to use for this hat (inherits from cli.backend if not specified).
default_publishes: Option<String>Default event to publish if hat forgets to write an event.
max_activations: Option<u32>Maximum number of times this hat may be activated in a single loop run.
When the limit is exceeded, the orchestrator publishes <hat_id>.exhausted
instead of activating the hat again.