@uipath/maestro-builder-sdk 6.91.0 → 6.91.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.
@@ -7,9 +7,11 @@
7
7
  * `references/implementation.md` Check 13, `references/case-schema.md`,
8
8
  * `references/sla-response-shapes.md` §5).
9
9
  *
10
- * All five are `lint`: compile still writes the plan as authored, so a
10
+ * All six are `lint`: compile still writes the plan as authored, so a
11
11
  * decompiled source keeps the condition and `check` reports it again. Each is a
12
- * warning wherever `validate --strict` accepts the plan as a working design.
12
+ * warning wherever `validate --strict` accepts the plan as a working design,
13
+ * and an error where the platform cannot run it as written
14
+ * (RUNS_SEQUENTIALLY_MIXED: the converter discards part of the entry).
13
15
  *
14
16
  * Not ported, on evidence: the skill's "a breach rule must not carry
15
17
  * `escalationId`". The converter derives a `sla-status-change` rule's status
@@ -237,6 +237,90 @@ function anyEscalationWithoutAtRisk(built, decls, diags) {
237
237
  });
238
238
  }
239
239
  }
240
+ /**
241
+ * A task entry that mixes `runs-sequentially` with any other rule, in any
242
+ * group or condition. `validate` accepts it; the converter
243
+ * (`CaseManagementGenerateTaskEntryConditionsJSON.ts`, vendored in
244
+ * `local-engine/vendor/case-to-bpmn.mjs`) does not run it as written:
245
+ *
246
+ * - a task is sequential only when every rule of every entry condition is
247
+ * `runs-sequentially` (`taskOnlyRunsSequentiallyInStage`);
248
+ * - for any other task it drops each condition whose first rule is
249
+ * `runs-sequentially`, and writes nothing for that rule elsewhere.
250
+ *
251
+ * `[[rs, stc]]` and `[[rs], [stc]]` give the task no entry condition, so it
252
+ * never starts; `[[stc, rs]]` or two conditions lose the `runs-sequentially`.
253
+ *
254
+ * Sequential sets are built only from sequential tasks, so "the lane after X"
255
+ * waits for X only when X is sequential itself; otherwise the task starts at
256
+ * stage entry. The suggestion offers the lane only then.
257
+ *
258
+ * Stage and case conditions are not checked: there the converter ignores
259
+ * `runs-sequentially` and keeps the other rules.
260
+ */
261
+ function runsSequentiallyMixed(built, diags) {
262
+ const sequential = (task) => {
263
+ const rules = rulesOf(task.entry);
264
+ return rules.length > 0 && rules.every((r) => r.rule === 'runs-sequentially');
265
+ };
266
+ for (const stage of built.stages) {
267
+ // Every key a `selected-tasks-completed` rule names a task of this stage by (`taskIdByKey`).
268
+ const own = new Map();
269
+ stage.lanes.forEach((lane, index) => {
270
+ for (const task of lane) {
271
+ own.set(task.name, { lane: index, task });
272
+ own.set(`${stage.label}/${task.name}`, { lane: index, task });
273
+ }
274
+ });
275
+ for (const lane of stage.lanes)
276
+ for (const task of lane) {
277
+ const rules = rulesOf(task.entry);
278
+ if (!rules.some((r) => r.rule === 'runs-sequentially') || rules.every((r) => r.rule === 'runs-sequentially'))
279
+ continue;
280
+ const others = [...new Set(rules.filter((r) => r.rule !== 'runs-sequentially').map((r) => r.rule))];
281
+ const dropped = task.entry.filter((c) => c.rules[0]?.[0]?.rule === 'runs-sequentially');
282
+ const effect = dropped.length > 0
283
+ ? `It drops ${dropped.length === task.entry.length ? 'every entry condition of this task, so the task never starts' : 'each entry condition whose first rule is `runs-sequentially`, with the other rules in it'}`
284
+ : 'It ignores the `runs-sequentially` rule, so the task does not wait for the set before it';
285
+ const predecessors = [...new Set(rules.filter((r) => r.rule === 'selected-tasks-completed').flatMap((r) => r.tasks ?? []))];
286
+ const resolved = predecessors.map((key) => own.get(key));
287
+ const laneOk = others.length === 1 && others[0] === 'selected-tasks-completed' && predecessors.length > 0
288
+ && resolved.every((p) => p !== undefined && sequential(p.task));
289
+ const keep = others.map((r) => (r === 'selected-tasks-completed' && predecessors.length > 0
290
+ ? `rule('selected-tasks-completed', { tasks: [${predecessors.map((n) => `'${n}'`).join(', ')}] })`
291
+ : `rule('${r}'${r === 'adhoc' || r === 'current-stage-entered' ? '' : ', { … }'})`));
292
+ const keepCall = `.entryWhen(${keep.length === 1 ? keep[0] : `[${keep.join(', ')}]`})`;
293
+ const parts = [`Remove "runs-sequentially" and keep the other rule${others.length > 1 ? 's' : ''}: ${keepCall}.`];
294
+ if (laneOk) {
295
+ const next = Math.max(...resolved.map((p) => p.lane)) + 1;
296
+ parts.push(`Or, since ${predecessors.map((n) => `"${n}"`).join(', ')} ${predecessors.length > 1 ? 'run' : 'runs'} sequentially, `
297
+ + `keep "runs-sequentially" alone and put the task in the next lane: .entryWhen(rule('runs-sequentially')) with { lane: ${next} }.`);
298
+ }
299
+ else {
300
+ const notSequential = predecessors.filter((_, i) => resolved[i] !== undefined && !sequential(resolved[i].task));
301
+ const why = resolved.some((p) => p === undefined)
302
+ ? 'a task it names is in another stage'
303
+ : notSequential.length > 0
304
+ ? `${notSequential.map((n) => `"${n}"`).join(', ')} ${notSequential.length > 1 ? 'are' : 'is'} not`
305
+ : undefined;
306
+ if (why)
307
+ parts.push(`Do not use "runs-sequentially" in a later lane instead: it waits only for tasks that are themselves "runs-sequentially" in this stage, `
308
+ + `and ${why}, so the task would start at stage entry.`);
309
+ else if (predecessors.length === 0 && !others.includes('adhoc'))
310
+ parts.push(`To start it after a task, add rule('selected-tasks-completed', { tasks: ['<task>'] }) to the same AND-group.`);
311
+ }
312
+ diags.push({
313
+ level: 'error',
314
+ code: 'RUNS_SEQUENTIALLY_MIXED',
315
+ message: `Task "${task.name}" mixes rule "runs-sequentially" with ${others.map((r) => `"${r}"`).join(', ')} in its entry. `
316
+ + 'The platform runs a task sequentially only when every rule of every entry condition is "runs-sequentially". '
317
+ + `${effect}. \`uip maestro case validate\` accepts this; the task just does not run as written.`,
318
+ suggestion: parts.join(' '),
319
+ where: `task "${task.name}" entry`,
320
+ });
321
+ }
322
+ }
323
+ }
240
324
  /** The rules above, in the order `check` reports them. */
241
325
  export function checkRuleSemantics(built, diags) {
242
326
  adhocSelections(built, diags);
@@ -245,4 +329,5 @@ export function checkRuleSemantics(built, diags) {
245
329
  slaReentry(built, decls, diags);
246
330
  slaNameDuplicates(built, decls, diags);
247
331
  anyEscalationWithoutAtRisk(built, decls, diags);
332
+ runsSequentiallyMixed(built, diags);
248
333
  }
@@ -22,7 +22,15 @@
22
22
  * (emitted JSON) apply the one rule.
23
23
  */
24
24
  export declare function v31TaskSets<T>(sets: readonly (readonly T[])[], runsSequentially: (task: T) => boolean): T[][];
25
- /** The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`. */
25
+ /**
26
+ * The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`.
27
+ *
28
+ * The converter's test is stricter (EVERY rule of every condition,
29
+ * `taskOnlyRunsSequentiallyInStage`). The two differ only on a task that mixes
30
+ * `runs-sequentially` with another rule, which `check` reports as
31
+ * RUNS_SEQUENTIALLY_MIXED because the converter drops part of it; on every
32
+ * task `check` passes they agree.
33
+ */
26
34
  export declare function taskJsonRunsSequentially(task: {
27
35
  entryConditions?: Array<{
28
36
  rules?: Array<Array<{
@@ -37,7 +37,15 @@ export function v31TaskSets(sets, runsSequentially) {
37
37
  }
38
38
  return out;
39
39
  }
40
- /** The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`. */
40
+ /**
41
+ * The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`.
42
+ *
43
+ * The converter's test is stricter (EVERY rule of every condition,
44
+ * `taskOnlyRunsSequentiallyInStage`). The two differ only on a task that mixes
45
+ * `runs-sequentially` with another rule, which `check` reports as
46
+ * RUNS_SEQUENTIALLY_MIXED because the converter drops part of it; on every
47
+ * task `check` passes they agree.
48
+ */
41
49
  export function taskJsonRunsSequentially(task) {
42
50
  return (task.entryConditions ?? []).some((condition) => (condition.rules ?? []).some((group) => group.some((r) => r?.rule === 'runs-sequentially')));
43
51
  }
@@ -188,6 +188,7 @@ export declare const REFUSALS: {
188
188
  readonly SLA_RESPONSE_REENTERS_STAGE: "lint";
189
189
  readonly SLA_NAME_DUPLICATE: "lint";
190
190
  readonly ANY_ESCALATION_NO_AT_RISK: "lint";
191
+ readonly RUNS_SEQUENTIALLY_MIXED: "lint";
191
192
  readonly CASE_MGMT_BINDING_KEY_MISMATCH: "lint";
192
193
  readonly CASE_MGMT_NODE_ID_DUPLICATE: "lint";
193
194
  readonly CASE_MGMT_OUTPUT_ID_DUPLICATE: "lint";
@@ -253,6 +253,7 @@ export const REFUSALS = {
253
253
  SLA_RESPONSE_REENTERS_STAGE: 'lint',
254
254
  SLA_NAME_DUPLICATE: 'lint',
255
255
  ANY_ESCALATION_NO_AT_RISK: 'lint',
256
+ RUNS_SEQUENTIALLY_MIXED: 'lint',
256
257
  // `uip maestro case validate`'s own codes, ported to case/plan-check/. All
257
258
  // `lint` for now: only `check` reports them. The four on fields compile writes
258
259
  // (ids, binding keys) are also carried from a decompiled plan's preserved
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.91.0",
3
+ "version": "6.91.1",
4
4
  "description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.uipath.com/maestro",
@@ -111,5 +111,5 @@
111
111
  "@types/node": "^22.7.0",
112
112
  "esbuild": "^0.28.1"
113
113
  },
114
- "gitref": "ebc34129dfd4dc427791db0a25d2c4652c73f63c"
114
+ "gitref": "1a23673ee955694372b97478f0e031bdf861f6f1"
115
115
  }