@burdenoff/microfe-planmagnet 2026.1014.2 → 2026.1101.1

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.
Files changed (47) hide show
  1. package/dist/generated/global-types.d.ts +1164 -14
  2. package/dist/generated/wspace-types.d.ts +1333 -9
  3. package/dist/planmagnet/PlanMagnetRoot.js +111 -117
  4. package/dist/planmagnet/automation/AutomationExecutionsPanel.d.ts +2 -0
  5. package/dist/planmagnet/automation/AutomationExecutionsPanel.js +26 -14
  6. package/dist/planmagnet/automation/AutomationRuleFields.d.ts +3 -2
  7. package/dist/planmagnet/automation/AutomationRuleFields.js +120 -117
  8. package/dist/planmagnet/automation/WorkflowSelect.d.ts +5 -0
  9. package/dist/planmagnet/automation/WorkflowSelect.js +74 -0
  10. package/dist/planmagnet/automation/automationRuleTypes.d.ts +16 -10
  11. package/dist/planmagnet/automation/automationRuleTypes.js +38 -32
  12. package/dist/planmagnet/controls/AutomationRuleControls.d.ts +3 -1
  13. package/dist/planmagnet/controls/AutomationRuleControls.js +23 -23
  14. package/dist/planmagnet/controls/FeatureTriage.d.ts +2 -2
  15. package/dist/planmagnet/dependency/DependencyPanel.js +1 -1
  16. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +17 -17
  17. package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +80 -79
  18. package/dist/planmagnet/pages/DashboardDashboardPagePage.js +6 -6
  19. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js +1 -1
  20. package/dist/planmagnet/pages/GoalsGoalsPagePage.js +6 -6
  21. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +5 -5
  22. package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.js +9 -9
  23. package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +16 -13
  24. package/dist/planmagnet/pages/ProductsFeaturesPagePage.js +10 -10
  25. package/dist/planmagnet/pages/ProductsProductsPagePage.js +3 -3
  26. package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +9 -9
  27. package/dist/planmagnet/pages/ProductsReleasesPagePage.js +9 -9
  28. package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js +15 -15
  29. package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +7 -7
  30. package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.js +1 -1
  31. package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +1 -1
  32. package/dist/planmagnet/pages/ProjectsCustomFieldsPagePage.js +1 -1
  33. package/dist/planmagnet/pages/ProjectsGanttPagePage.js +1 -1
  34. package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +13 -10
  35. package/dist/planmagnet/pages/ProjectsMilestonesPagePage.js +6 -6
  36. package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +3 -3
  37. package/dist/planmagnet/pages/ProjectsPlanningPagePage.js +8 -8
  38. package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +26 -23
  39. package/dist/planmagnet/pages/ProjectsProjectsPagePage.js +8 -8
  40. package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +7 -7
  41. package/dist/planmagnet/pages/RisksRiskRegisterPagePage.js +13 -13
  42. package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +1 -1
  43. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +5 -5
  44. package/dist/planmagnet/pages/TasksTasksPagePage.js +16 -16
  45. package/dist/planmagnet/pages/TeamTeamDetailPagePage.js +6 -6
  46. package/dist/planmagnet/pages/analytics/SprintDeliveryCards.js +5 -5
  47. package/package.json +1 -1
@@ -27,12 +27,15 @@
27
27
  * OFF in prod (`isChannelPostingEnabled()` in the engine) until Platform ticket BOFF-8240 ships: saving one
28
28
  * is refused server-side with "Posting to a chat channel from an automation is not available yet", so this
29
29
  * UI never lets it be selected or saved either (see `CHANNEL_POSTING_AVAILABLE` below).
30
+ * - `RUN_WORKFLOW` (OVL-09, BOFF-3532) hands the rule off to the shared workflow engine: it starts a run of an
31
+ * ACTIVE workflow from the workspace's workflow builder, with the PlanMagnet event as its trigger data. It
32
+ * needs no work item, so it is the action that makes sprint and release triggers useful. Everything beyond
33
+ * PlanMagnet's own record changes (calling other systems, branching, retries, AI steps) belongs there rather
34
+ * than in this builder.
30
35
  * - `SPRINT_STARTED`/`SPRINT_COMPLETED`/`RELEASE_RELEASED` carry NO target work item (`sprint.service.ts`/
31
- * `release.service.ts` never set `workItemId` on their `TriggerData`), so every work-item action — all five
32
- * above except `POST_TO_CHANNEL` — cannot run for them. Today that leaves such a rule able to do nothing
33
- * (the only action that *could* apply, `POST_TO_CHANNEL`, is itself gated off), so the builder below refuses
34
- * to offer work-item actions for these triggers and blocks Save entirely rather than let someone build a
35
- * rule that silently never fires anything.
36
+ * `release.service.ts` never set `workItemId` on their `TriggerData`), so every work-item action cannot run
37
+ * for them. The builder below offers only `RUN_WORKFLOW` for these triggers (`POST_TO_CHANNEL` is gated off)
38
+ * and blocks Save until the rule has one, rather than let someone build a rule that never does anything.
36
39
  */
37
40
  export declare const TRIGGER_TYPES: readonly ["WORK_ITEM_CREATED", "WORK_ITEM_STATUS_CHANGED", "WORK_ITEM_ASSIGNED", "SPRINT_STARTED", "SPRINT_COMPLETED", "RELEASE_RELEASED", "SCHEDULE", "WORK_ITEM_UPDATED", "MILESTONE_DUE", "WEBHOOK", "MANUAL"];
38
41
  export type TriggerType = (typeof TRIGGER_TYPES)[number];
@@ -61,12 +64,15 @@ export declare function triggerOptionSuffix(trigger: TriggerType): string;
61
64
  export declare function triggerHint(trigger: TriggerType): string | null;
62
65
  export declare const RULE_STATUSES: readonly ["ACTIVE", "PAUSED", "DISABLED", "ERROR"];
63
66
  export type RuleStatus = (typeof RULE_STATUSES)[number];
64
- export declare const ACTION_TYPES: readonly ["ASSIGN_TO_USER", "ADD_LABEL", "SET_STATUS", "SET_PRIORITY", "POST_COMMENT", "POST_TO_CHANNEL"];
67
+ export declare const ACTION_TYPES: readonly ["ASSIGN_TO_USER", "ADD_LABEL", "SET_STATUS", "SET_PRIORITY", "POST_COMMENT", "POST_TO_CHANNEL", "RUN_WORKFLOW"];
65
68
  export type ActionType = (typeof ACTION_TYPES)[number];
66
69
  export declare const ACTION_TYPE_LABEL: Record<ActionType, string>;
67
70
  /** Every action that mutates/comments on the triggering WORK ITEM (automation-engine.ts's `dispatchAction`: only
68
- * `POST_TO_CHANNEL` is handled without one). These are the actions `NO_WORK_ITEM_TRIGGER_TYPES` cannot run. */
71
+ * `POST_TO_CHANNEL` and `RUN_WORKFLOW` are handled without one). These are the actions `NO_WORK_ITEM_TRIGGER_TYPES` cannot run. */
69
72
  export declare const WORK_ITEM_ACTION_TYPES: ReadonlySet<ActionType>;
73
+ /** True when the rule declares actions and none of them targets a work item — "Run now" then needs no work
74
+ * item (mirrors `needsNoWorkItem` in the service's automation.service.ts). */
75
+ export declare function actionsNeedNoWorkItem(actions: RuleAction[]): boolean;
70
76
  /** `POST_TO_CHANNEL` is gated off (BOFF-8240) — mirrors `isChannelPostingEnabled()` in automation-engine.ts,
71
77
  * which this frontend has no way to read directly (it is a server env flag). Flip this only once that ships
72
78
  * AND the option below is meant to become selectable — until then it stays visible but disabled everywhere. */
@@ -179,9 +185,9 @@ export declare function templatePlaceholdersForTrigger(trigger: TriggerType): re
179
185
  /** Sample values for exactly the placeholders `templatePlaceholdersForTrigger` says apply to this trigger — any
180
186
  * other `{{...}}` in the template previews empty, matching what the real engine would do. */
181
187
  export declare function templateSampleValues(trigger: TriggerType): Record<string, string | undefined>;
182
- /** `null` when this trigger needs no explanation blocking Save; the reason string otherwise (same text as
183
- * `triggerHint` for a `NO_WORK_ITEM_TRIGGER_TYPES` trigger — the one case that blocks Save outright). */
184
- export declare function triggerSaveBlockReason(trigger: TriggerType): string | null;
188
+ /** `null` when the trigger and actions fit together; the reason string otherwise. A `NO_WORK_ITEM_TRIGGER_TYPES`
189
+ * trigger needs at least one `RUN_WORKFLOW` action and no work-item action (those could never run for it). */
190
+ export declare function triggerSaveBlockReason(trigger: TriggerType, actions?: RuleAction[]): string | null;
185
191
  /** Combines every reason a rule form cannot be saved yet: a trigger with no possible action, a `POST_TO_CHANNEL`
186
192
  * action while channel posting is gated off, or (for `SCHEDULE`) a not-yet-valid schedule window. `null` means
187
193
  * the form is save-able as far as these rules are concerned (the caller still checks name/project separately). */
@@ -36,7 +36,7 @@ function a(e) {
36
36
  return e === "SCHEDULE" || e === "MILESTONE_DUE" ? " (runs daily)" : i.has(e) ? " (no target work item)" : r.has(e) ? " (not yet automatic)" : e === "MANUAL" ? " (run manually)" : "";
37
37
  }
38
38
  function o(e) {
39
- return i.has(e) ? "This trigger fires automatically, but it has no target work item — only \"Post to a channel\" could apply, and that is not available yet (waiting on a platform change). A rule with this trigger cannot do anything right now, so it cannot be saved yet." : e === "SCHEDULE" ? "Runs once a day against every work item matching the statuses and staleness window below, and acts on each matching item at most once per day." : e === "WORK_ITEM_UPDATED" ? "Fires on any field edit, including a save that writes back exactly the values it already had — the dispatcher does not check whether anything actually changed. Fires alongside \"Work item status changed\" / \"Work item assigned\" on an edit that also touches status or assignee, not instead of them." : e === "MILESTONE_DUE" ? "Runs once a day for a rule whose Milestone's due date is today — same daily check as Schedule, but with no extra condition shape of its own: use the conditions below as you would for any other trigger." : r.has(e) ? "This trigger is saved but does not fire on its own yet — use Run now to run it against a work item." : e === "MANUAL" ? "Manual rules never fire on their own — use Run now to run this rule against a work item." : null;
39
+ return i.has(e) ? "This trigger fires automatically, but it has no target work item, so only \"Run a workflow\" can apply. Add one to save the rule." : e === "SCHEDULE" ? "Runs once a day against every work item matching the statuses and staleness window below, and acts on each matching item at most once per day." : e === "WORK_ITEM_UPDATED" ? "Fires on any field edit, including a save that writes back exactly the values it already had — the dispatcher does not check whether anything actually changed. Fires alongside \"Work item status changed\" / \"Work item assigned\" on an edit that also touches status or assignee, not instead of them." : e === "MILESTONE_DUE" ? "Runs once a day for a rule whose Milestone's due date is today — same daily check as Schedule, but with no extra condition shape of its own: use the conditions below as you would for any other trigger." : r.has(e) ? "This trigger is saved but does not fire on its own yet — use Run now to run it against a work item." : e === "MANUAL" ? "Manual rules never fire on their own — use Run now to run this rule against a work item." : null;
40
40
  }
41
41
  var s = [
42
42
  "ACTIVE",
@@ -49,21 +49,27 @@ var s = [
49
49
  "SET_STATUS",
50
50
  "SET_PRIORITY",
51
51
  "POST_COMMENT",
52
- "POST_TO_CHANNEL"
52
+ "POST_TO_CHANNEL",
53
+ "RUN_WORKFLOW"
53
54
  ], l = {
54
55
  ASSIGN_TO_USER: "Assign to user",
55
56
  ADD_LABEL: "Add label",
56
57
  SET_STATUS: "Set status",
57
58
  SET_PRIORITY: "Set priority",
58
59
  POST_COMMENT: "Post a comment",
59
- POST_TO_CHANNEL: "Post to a channel"
60
+ POST_TO_CHANNEL: "Post to a channel",
61
+ RUN_WORKFLOW: "Run a workflow"
60
62
  }, u = new Set([
61
63
  "ASSIGN_TO_USER",
62
64
  "ADD_LABEL",
63
65
  "SET_STATUS",
64
66
  "SET_PRIORITY",
65
67
  "POST_COMMENT"
66
- ]), d = "Not available yet — waiting on a platform change", f = "Posting to a chat channel from an automation is not available yet.", p = [
68
+ ]);
69
+ function d(e) {
70
+ return e.length > 0 && e.every((e) => !u.has(e.type) && c.includes(e.type));
71
+ }
72
+ var f = "Not available yet — waiting on a platform change", p = "Posting to a chat channel from an automation is not available yet.", m = [
67
73
  "eq",
68
74
  "neq",
69
75
  "in",
@@ -74,7 +80,7 @@ var s = [
74
80
  "lt",
75
81
  "lte",
76
82
  "exists"
77
- ], m = {
83
+ ], h = {
78
84
  eq: "is",
79
85
  neq: "is not",
80
86
  in: "is one of",
@@ -85,7 +91,7 @@ var s = [
85
91
  lt: "<",
86
92
  lte: "<=",
87
93
  exists: "is set"
88
- }, h = [
94
+ }, g = [
89
95
  "status",
90
96
  "previousStatus",
91
97
  "priority",
@@ -96,13 +102,13 @@ var s = [
96
102
  "sprintId",
97
103
  "projectId"
98
104
  ];
99
- function g(e) {
105
+ function _(e) {
100
106
  return e.filter((e) => e.value.trim() !== "").map((e) => ({
101
107
  type: e.type,
102
108
  value: e.value.trim()
103
109
  }));
104
110
  }
105
- function _(e) {
111
+ function v(e) {
106
112
  let t = e.filter((e) => e.field.trim() !== "");
107
113
  if (t.length !== 0) return t.map((e) => e.operator === "exists" ? {
108
114
  field: e.field.trim(),
@@ -117,26 +123,26 @@ function _(e) {
117
123
  value: e.value
118
124
  });
119
125
  }
120
- function v(e) {
126
+ function y(e) {
121
127
  return Array.isArray(e) ? e.filter((e) => !!e && typeof e == "object" && typeof e.field == "string").map((e) => ({
122
128
  field: e.field,
123
- operator: p.includes(e.operator) ? e.operator : "eq",
129
+ operator: m.includes(e.operator) ? e.operator : "eq",
124
130
  value: Array.isArray(e.value) ? e.value.join(", ") : e.value == null ? "" : String(e.value)
125
131
  })) : [];
126
132
  }
127
- function y(e) {
133
+ function b(e) {
128
134
  return Array.isArray(e) ? e.filter((e) => !!e && typeof e == "object" && typeof e.type == "string").map((e) => ({
129
135
  type: e.type,
130
136
  value: e.value == null ? "" : String(e.value)
131
137
  })) : [];
132
138
  }
133
- function b(e) {
139
+ function x(e) {
134
140
  let t = e.trim();
135
141
  if (!/^\d+$/.test(t)) return null;
136
142
  let n = Number(t);
137
143
  return n >= 1 ? n : null;
138
144
  }
139
- function x(e) {
145
+ function S(e) {
140
146
  if (!e || typeof e != "object") return {
141
147
  statuses: [],
142
148
  days: ""
@@ -147,18 +153,18 @@ function x(e) {
147
153
  days: typeof n == "number" && Number.isFinite(n) ? String(n) : ""
148
154
  };
149
155
  }
150
- function S(e, t) {
151
- let n = b(t);
156
+ function C(e, t) {
157
+ let n = x(t);
152
158
  if (!(e.length === 0 || n === null)) return {
153
159
  status: e,
154
160
  notUpdatedForDays: n
155
161
  };
156
162
  }
157
- function C(e, t) {
158
- return e.length > 0 && b(t) !== null;
163
+ function w(e, t) {
164
+ return e.length > 0 && x(t) !== null;
159
165
  }
160
- var w = 2e3, T = 2e3, E = /\{\{\s*([a-zA-Z][a-zA-Z0-9_.]*)\s*\}\}/g;
161
- function D(e) {
166
+ var T = 2e3, E = 2e3, D = /\{\{\s*([a-zA-Z][a-zA-Z0-9_.]*)\s*\}\}/g;
167
+ function O(e) {
162
168
  let t = "";
163
169
  for (let n of e) {
164
170
  let e = n.codePointAt(0) ?? 0;
@@ -166,14 +172,14 @@ function D(e) {
166
172
  }
167
173
  return t.trim();
168
174
  }
169
- function O(e, t, n) {
170
- let r = e.replace(E, (e, n) => {
175
+ function k(e, t, n) {
176
+ let r = e.replace(D, (e, n) => {
171
177
  let r = t[n];
172
- return r === void 0 ? "" : D(r);
178
+ return r === void 0 ? "" : O(r);
173
179
  }).trim();
174
180
  return r.length <= n ? r : `${r.slice(0, Math.max(0, n - 1))}…`;
175
181
  }
176
- var k = {
182
+ var A = {
177
183
  "workItem.key": {
178
184
  label: "Work item key",
179
185
  sample: "PM-42"
@@ -207,7 +213,7 @@ var k = {
207
213
  sample: "September release"
208
214
  }
209
215
  };
210
- function A(e) {
216
+ function j(e) {
211
217
  return e === "SPRINT_STARTED" || e === "SPRINT_COMPLETED" ? ["sprint.name", "actor"] : e === "RELEASE_RELEASED" ? [
212
218
  "release.version",
213
219
  "release.name",
@@ -229,19 +235,19 @@ function A(e) {
229
235
  "actor"
230
236
  ];
231
237
  }
232
- function j(e) {
238
+ function M(e) {
233
239
  let t = {};
234
- for (let n of A(e)) t[n] = k[n]?.sample;
240
+ for (let n of j(e)) t[n] = A[n]?.sample;
235
241
  return t;
236
242
  }
237
- function M(e) {
238
- return i.has(e) ? o(e) : null;
239
- }
240
- function N(e) {
241
- return M(e.triggerType) || (e.actions.some((e) => e.type === "POST_TO_CHANNEL") ? f : e.triggerType === "SCHEDULE" && !C(e.scheduleStatuses, e.scheduleNotUpdatedForDays) ? "Choose at least one status and a whole number of days (1 or more) before saving this schedule." : null);
243
+ function N(e, t = []) {
244
+ return i.has(e) ? t.some((e) => u.has(e.type)) ? "This trigger has no target work item, so work item actions cannot run for it. Remove them before saving." : t.some((e) => e.type === "RUN_WORKFLOW" && e.value.trim() !== "") ? null : o(e) : null;
242
245
  }
243
246
  function P(e) {
247
+ return N(e.triggerType, e.actions) || (e.actions.some((e) => e.type === "POST_TO_CHANNEL") ? p : e.actions.some((e) => e.type === "RUN_WORKFLOW" && e.value.trim() === "") ? "Choose the workflow each \"Run a workflow\" action should start." : e.triggerType === "SCHEDULE" && !w(e.scheduleStatuses, e.scheduleNotUpdatedForDays) ? "Choose at least one status and a whole number of days (1 or more) before saving this schedule." : null);
248
+ }
249
+ function F(e) {
244
250
  return e ? e.split("; ").map((e) => e.trim()).filter(Boolean) : [];
245
251
  }
246
252
  //#endregion
247
- export { c as ACTION_TYPES, l as ACTION_TYPE_LABEL, w as AUTOMATION_TEMPLATE_MAX_LENGTH, f as CHANNEL_POSTING_BLOCKED_MESSAGE, d as CHANNEL_POSTING_OPTION_REASON, h as CONDITION_FIELDS, p as CONDITION_OPERATORS, m as CONDITION_OPERATOR_LABEL, i as NO_WORK_ITEM_TRIGGER_TYPES, T as POST_COMMENT_MAX_RENDERED_LENGTH, s as RULE_STATUSES, k as TEMPLATE_PLACEHOLDER_INFO, e as TRIGGER_TYPES, t as TRIGGER_TYPE_LABEL, u as WORK_ITEM_ACTION_TYPES, y as actionsFromApi, g as actionsToApi, v as conditionsFromApi, _ as conditionsToApi, b as parseScheduleDays, O as renderTemplatePreview, N as saveBlockReason, x as scheduleConditionsFromApi, S as scheduleConditionsToApi, P as splitExecutionErrors, A as templatePlaceholdersForTrigger, j as templateSampleValues, o as triggerHint, a as triggerOptionSuffix, n as triggerTypeLabel };
253
+ export { c as ACTION_TYPES, l as ACTION_TYPE_LABEL, T as AUTOMATION_TEMPLATE_MAX_LENGTH, p as CHANNEL_POSTING_BLOCKED_MESSAGE, f as CHANNEL_POSTING_OPTION_REASON, g as CONDITION_FIELDS, m as CONDITION_OPERATORS, h as CONDITION_OPERATOR_LABEL, i as NO_WORK_ITEM_TRIGGER_TYPES, E as POST_COMMENT_MAX_RENDERED_LENGTH, s as RULE_STATUSES, A as TEMPLATE_PLACEHOLDER_INFO, e as TRIGGER_TYPES, t as TRIGGER_TYPE_LABEL, u as WORK_ITEM_ACTION_TYPES, b as actionsFromApi, d as actionsNeedNoWorkItem, _ as actionsToApi, y as conditionsFromApi, v as conditionsToApi, x as parseScheduleDays, k as renderTemplatePreview, P as saveBlockReason, S as scheduleConditionsFromApi, C as scheduleConditionsToApi, F as splitExecutionErrors, j as templatePlaceholdersForTrigger, M as templateSampleValues, o as triggerHint, a as triggerOptionSuffix, N as triggerSaveBlockReason, n as triggerTypeLabel };
@@ -16,8 +16,10 @@ export declare function AutomationRuleDeleteButton({ ruleId, name }: {
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
17
  /** Runs a rule against one chosen work item — works for a rule of ANY trigger type, including the ones that
18
18
  * cannot fire on their own (see automationRuleTypes.ts). Always records an outcome, including a non-match. */
19
- export declare function RunAutomationRuleDialog({ ruleId, projectId, }: {
19
+ export declare function RunAutomationRuleDialog({ ruleId, projectId, needsWorkItem, }: {
20
20
  ruleId: string;
21
21
  projectId?: string;
22
+ /** False when every action of the rule needs no work item (RUN_WORKFLOW, OVL-09) — the run then names none. */
23
+ needsWorkItem?: boolean;
22
24
  }): import("react/jsx-runtime").JSX.Element;
23
25
  //# sourceMappingURL=AutomationRuleControls.d.ts.map
@@ -94,27 +94,27 @@ var M = {
94
94
  FAILURE: "destructive",
95
95
  SKIPPED: "secondary"
96
96
  };
97
- function N({ ruleId: e, projectId: r }) {
98
- let [a, d] = l(!1), [f, T] = l(""), [D, O] = l(null), [A, j] = l(null), [N, { loading: P }] = p(k, {
97
+ function N({ ruleId: e, projectId: r, needsWorkItem: a = !0 }) {
98
+ let [d, f] = l(!1), [T, D] = l(""), [O, A] = l(null), [j, N] = l(null), [P, { loading: F }] = p(k, {
99
99
  refetchQueries: ["AutomationExecutionsForRule", ...E],
100
100
  awaitRefetchQueries: !0
101
- }), F = async () => {
102
- if (f) {
103
- O(null), j(null);
101
+ }), I = async () => {
102
+ if (!(a && !T)) {
103
+ A(null), N(null);
104
104
  try {
105
- j((await i(N({ variables: {
105
+ N((await i(P({ variables: {
106
106
  id: e,
107
- triggerData: { workItemId: f }
107
+ triggerData: T ? { workItemId: T } : {}
108
108
  } }))).data?.planmagnetExecuteAutomationRule ?? null);
109
109
  } catch (e) {
110
- O(t(e) ? "Your role can view automation rules but not run them." : n(e, "The rule could not be run."));
110
+ A(t(e) ? "Your role can view automation rules but not run them." : n(e, "The rule could not be run."));
111
111
  }
112
112
  }
113
113
  };
114
114
  return /* @__PURE__ */ h(v, {
115
- open: a,
115
+ open: d,
116
116
  onOpenChange: (e) => {
117
- d(e), e && (T(""), O(null), j(null));
117
+ f(e), e && (D(""), A(null), N(null));
118
118
  },
119
119
  children: [/* @__PURE__ */ m(w, {
120
120
  asChild: !0,
@@ -134,27 +134,27 @@ function N({ ruleId: e, projectId: r }) {
134
134
  /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
135
135
  htmlFor: "automation-run-work-item",
136
136
  className: "text-sm font-medium",
137
- children: "Work item"
137
+ children: a ? "Work item" : "Work item (optional)"
138
138
  }), /* @__PURE__ */ m("div", {
139
139
  className: "mt-1",
140
140
  children: /* @__PURE__ */ m(s, {
141
141
  id: "automation-run-work-item",
142
142
  projectId: r,
143
- value: f,
144
- onChange: T
143
+ value: T,
144
+ onChange: D
145
145
  })
146
146
  })] }),
147
- D && /* @__PURE__ */ m(o, { message: D }),
148
- A && /* @__PURE__ */ h("div", {
147
+ O && /* @__PURE__ */ m(o, { message: O }),
148
+ j && /* @__PURE__ */ h("div", {
149
149
  role: "status",
150
150
  className: "rounded-md border p-3 text-sm space-y-1",
151
151
  children: [/* @__PURE__ */ m(g, {
152
- variant: M[A.status] ?? "secondary",
153
- children: A.status.toLowerCase().replace("_", " ")
154
- }), A.errorMessage && /* @__PURE__ */ m("ul", {
152
+ variant: M[j.status] ?? "secondary",
153
+ children: j.status.toLowerCase().replace("_", " ")
154
+ }), j.errorMessage && /* @__PURE__ */ m("ul", {
155
155
  className: "space-y-0.5",
156
- children: c(A.errorMessage).map((e, t) => /* @__PURE__ */ m("li", {
157
- className: A.status === "SUCCESS" ? "text-muted-foreground" : "text-destructive",
156
+ children: c(j.errorMessage).map((e, t) => /* @__PURE__ */ m("li", {
157
+ className: j.status === "SUCCESS" ? "text-muted-foreground" : "text-destructive",
158
158
  children: e
159
159
  }, t))
160
160
  })]
@@ -162,10 +162,10 @@ function N({ ruleId: e, projectId: r }) {
162
162
  ]
163
163
  }),
164
164
  /* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(_, {
165
- onClick: () => void F(),
166
- disabled: !f || P,
165
+ onClick: () => void I(),
166
+ disabled: a && !T || F,
167
167
  "data-testid": "automation-run-submit",
168
- children: P ? "Running…" : "Run"
168
+ children: F ? "Running…" : "Run"
169
169
  }) })
170
170
  ]
171
171
  })]
@@ -8,8 +8,8 @@ export interface TriageFeature {
8
8
  }
9
9
  /** True while the request waits for a decision (accept, decline and merge apply). */
10
10
  export declare const isOpenRequest: (status: string) => boolean;
11
- /** A snooze that has not passed yet. */
12
- export declare const isSnoozed: (snoozedUntil: string | null | undefined, now: number) => boolean;
11
+ /** A snooze that has not passed yet. Type guard: narrows `snoozedUntil` to the date string callers then format. */
12
+ export declare const isSnoozed: (snoozedUntil: string | null | undefined, now: number) => snoozedUntil is string;
13
13
  /**
14
14
  * The four triage actions for an undecided request. Snooze applies only while it waits for triage (SUBMITTED);
15
15
  * a snoozed request offers "Back to triage" instead.
@@ -282,7 +282,7 @@ function k({ workspaceId: r, workItemId: a, projectId: u }) {
282
282
  children: "Loading dependencies…"
283
283
  }),
284
284
  M && /* @__PURE__ */ h("p", {
285
- className: "text-sm text-red-500",
285
+ className: "text-sm text-status-error-text",
286
286
  children: ["Error: ", M.message]
287
287
  }),
288
288
  E && /* @__PURE__ */ m(n, { message: E }),
@@ -166,13 +166,13 @@ var Me = f`
166
166
  }
167
167
  }
168
168
  `, w = {
169
- BACKLOG: "#9ca3af",
170
- TODO: "#60a5fa",
171
- IN_PROGRESS: "#fbbf24",
172
- IN_REVIEW: "#a78bfa",
173
- TESTING: "#f472b6",
174
- DONE: "#4ade80",
175
- CANCELLED: "#f87171"
169
+ BACKLOG: "var(--color-text-muted)",
170
+ TODO: "var(--color-chart-1)",
171
+ IN_PROGRESS: "var(--color-chart-4)",
172
+ IN_REVIEW: "var(--color-chart-3)",
173
+ TESTING: "var(--color-chart-11)",
174
+ DONE: "var(--color-chart-2)",
175
+ CANCELLED: "var(--color-chart-5)"
176
176
  };
177
177
  function T(e) {
178
178
  let t = new Date(e);
@@ -260,7 +260,7 @@ function E() {
260
260
  children: /* @__PURE__ */ m("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
261
261
  });
262
262
  if (Ze) return /* @__PURE__ */ h("div", {
263
- className: "p-6 text-red-500",
263
+ className: "p-6 text-status-error-text",
264
264
  children: [
265
265
  E("planmagnet.analytics.errorLoading", "Error loading analytics"),
266
266
  ": ",
@@ -408,7 +408,7 @@ function E() {
408
408
  children: e.value
409
409
  }),
410
410
  /* @__PURE__ */ m("p", {
411
- className: "text-xs text-green-600 mt-1",
411
+ className: "text-xs text-status-success-text mt-1",
412
412
  children: e.trend
413
413
  })
414
414
  ]
@@ -529,7 +529,7 @@ function E() {
529
529
  type: "monotone",
530
530
  dataKey: "remaining",
531
531
  name: E("planmagnet.analytics.burndown.remaining", "Remaining points"),
532
- stroke: "#f59e0b",
532
+ stroke: "var(--color-chart-4)",
533
533
  strokeWidth: 2,
534
534
  dot: { r: 2 }
535
535
  }),
@@ -537,7 +537,7 @@ function E() {
537
537
  type: "monotone",
538
538
  dataKey: "completed",
539
539
  name: E("planmagnet.analytics.burndown.completed", "Completed points"),
540
- stroke: "#22c55e",
540
+ stroke: "var(--color-chart-7)",
541
541
  strokeWidth: 2,
542
542
  dot: { r: 2 }
543
543
  })
@@ -591,16 +591,16 @@ function E() {
591
591
  /* @__PURE__ */ m(i, {
592
592
  dataKey: "planned",
593
593
  name: E("planmagnet.analytics.velocity.planned", "Planned"),
594
- fill: "#cbd5e1"
594
+ fill: "var(--color-border-strong)"
595
595
  }),
596
596
  /* @__PURE__ */ m(i, {
597
597
  dataKey: "completed",
598
598
  name: E("planmagnet.analytics.velocity.completed", "Completed"),
599
- fill: "#6366f1"
599
+ fill: "var(--color-chart-12)"
600
600
  }),
601
601
  /* @__PURE__ */ m(ee, {
602
602
  y: bt,
603
- stroke: "#22c55e",
603
+ stroke: "var(--color-chart-7)",
604
604
  strokeDasharray: "4 4",
605
605
  label: {
606
606
  value: E("planmagnet.analytics.velocity.avgLabel", "avg"),
@@ -674,8 +674,8 @@ function E() {
674
674
  dataKey: e,
675
675
  name: e.toLowerCase().replace("_", " "),
676
676
  stackId: "cfd",
677
- stroke: w[e] ?? "#a3a3a3",
678
- fill: w[e] ?? "#a3a3a3",
677
+ stroke: w[e] ?? "var(--color-text-muted)",
678
+ fill: w[e] ?? "var(--color-text-muted)",
679
679
  fillOpacity: .7
680
680
  }, e))
681
681
  ]
@@ -754,7 +754,7 @@ function E() {
754
754
  children: /* @__PURE__ */ m("div", {
755
755
  className: "w-full h-2 rounded-full bg-muted overflow-hidden",
756
756
  children: /* @__PURE__ */ m("div", {
757
- className: `h-full rounded-full ${n === "at_risk" ? "bg-orange-400" : n === "on_track" ? "bg-green-400" : "bg-blue-400"}`,
757
+ className: `h-full rounded-full ${n === "at_risk" ? "bg-status-warning" : n === "on_track" ? "bg-status-success" : "bg-status-info"}`,
758
758
  style: { width: `${t}%` }
759
759
  })
760
760
  })