Expand description
Automations (#220): scheduled and webhook-triggered spawns.
Two layers. The rules — cron evaluation, webhook signatures,
task-template interpolation — are pure functions over borrowed data, with
now supplied by the caller, so every one of them is testable without
waiting for wall-clock time to pass. AutomationEngine is the thin
stateful shell that reads the store, decides what is due, and spawns.
Structs§
- Automation
- A configured automation.
- Automation
Engine - The automation runtime: stored triggers, the tick that fires them, and the run history they leave behind (#220).
- Automation
Run - One recorded firing of an automation, successful or not.
- Create
Automation Body - Body for
POST /api/automations. - Created
Automation Response - Response to
POST /api/automations. - Fired
Response - Response to a fire request (
run now, or an accepted webhook). - SetEnabled
Body - Body for
PUT /api/automations/{id}/enabled. - Spawn
Template - The spawn an automation performs each time it fires.
- Stored
Automation - An automation as persisted, including the secret the wire type omits.
Enums§
Constants§
- MAX_
SUBSTITUTION - Longest substituted value, in bytes. A webhook payload is caller-controlled, and an unbounded field would let one request push a multi-megabyte prompt into an agent. Longer values are truncated with an explicit marker rather than silently cut, so the agent can see that it is reading a fragment.
- RUN_
HISTORY_ LIMIT - Runs retained per automation. Run history is a debugging aid, not an audit log (the event store holds those), so it is bounded rather than growing without limit in the config DB.
Functions§
- due_
fire - The scheduled tick this automation owes, or
Noneif it owes nothing yet. - interpolate
- Substitute
{{ dotted.path }}placeholders in a task template frompayload. - normalize_
schedule - Adapt an operator-written cron expression to the 6-field form the
croncrate parses. - parse_
schedule - Parse an operator-written schedule, normalizing the 5-field form first.
- stamp
- Render a timestamp the one way the store compares them.
- verify_
webhook_ signature - Verify a webhook’s
sha256=<hex>HMAC signature over the raw request body.