@stackbone/cli 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ -- 0022_trigger_subscriptions_mailbox.sql — add mailbox column to trigger_subscriptions
2
+ -- The mailbox identifies which mailbox a mailbox-scoped trigger polls. When resolving
3
+ -- a declarative poll, the mailbox is injected into the arg the connector declares via
4
+ -- `mailboxParam` (e.g. Outlook app-only's `user-id`). Nullable for backward compatibility
5
+ -- with existing subscriptions.
6
+
7
+ ALTER TABLE stackbone_platform.trigger_subscriptions
8
+ ADD COLUMN mailbox text;
9
+
10
+ -- Last-resort integrity guard against a direct DB insert that skips the register
11
+ -- endpoint's validation. The SOURCE OF TRUTH for "this trigger needs a mailbox" is
12
+ -- the connector definition's `mailboxParam` (enforced by the poll engine + register
13
+ -- endpoint); SQL can't read that, so this constraint hardcodes today's only
14
+ -- mailbox-scoped connector. Adding another one means updating this constraint too.
15
+ ALTER TABLE stackbone_platform.trigger_subscriptions
16
+ ADD CONSTRAINT chk_outlook_app_only_requires_mailbox
17
+ CHECK (
18
+ (connector != 'outlook-app-only' OR mailbox IS NOT NULL)
19
+ );
@@ -0,0 +1,20 @@
1
+ -- 0023_runs_waiting_status.sql — widen the runs status CHECK for serialized
2
+ -- (FIFO) execution (STA-104).
3
+ --
4
+ -- A serialized workflow trigger enqueued behind an active serial run is mirrored
5
+ -- into `stackbone_platform.runs` as a `waiting` row (started_at NULL — it has not
6
+ -- run yet) so both `stackbone dev` and the Studio runs view can surface the queue
7
+ -- read-only. When the FIFO gate admits the trigger and the next run starts, the
8
+ -- waiting row is cleared. The original CHECK (0001 listed
9
+ -- `running/done/failed/interrupted`) predates this value and would reject the
10
+ -- insert. Widen `runs_status_check` to match `runStatusSchema`.
11
+ --
12
+ -- No trigger change is needed: the existing pg_notify fan-out (0001
13
+ -- notify_run_event) already emits `run.created` on the waiting INSERT and
14
+ -- `run.started` on the started_at NULL→NOT-NULL transition when the run starts,
15
+ -- so open Studio views refresh through the existing SSE channel. Self-host and
16
+ -- cloud both run these migrations, so the behavior is identical.
17
+ ALTER TABLE stackbone_platform.runs DROP CONSTRAINT IF EXISTS runs_status_check;
18
+ ALTER TABLE stackbone_platform.runs
19
+ ADD CONSTRAINT runs_status_check
20
+ CHECK (status IN ('running', 'done', 'failed', 'interrupted', 'waiting'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbone/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "bin": {