panel public release

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 01:26:41 -07:00
commit 295eb22826
2165 changed files with 301492 additions and 0 deletions
@@ -0,0 +1,20 @@
-- 004_event_triggers.sql — event-driven schedule triggers.
--
-- Until now schedules only supported cron. This migration adds:
-- * trigger_kind = 'event' schedules, powered by a CEL expression over
-- the event bus. Example: players_online == 0
-- * optional sustained-state: fire only after the condition has been
-- continuously true for N seconds. Enables "idle shutdown if 0 players
-- for 30m" without firing every 60s when the polled player count is 0.
--
-- cron_spec becomes nullable so event triggers can exist with NULL there.
-- Exactly one of cron_spec / event_spec is populated; the application
-- enforces this.
ALTER TABLE schedules ALTER COLUMN cron_spec DROP NOT NULL;
ALTER TABLE schedules
ADD COLUMN event_spec TEXT,
ADD COLUMN event_sustained_seconds INTEGER NOT NULL DEFAULT 0;
CREATE INDEX idx_schedules_trigger_kind ON schedules(trigger_kind);