@uipath/maestro-builder-sdk 6.16.6 → 6.16.8

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,25 @@
1
+ /**
2
+ * flow-step-tree — walkers over a Flow's `Step` tree. They are typed by Flow's
3
+ * `Step` union (`childStepLists` is exhaustive over `Step['kind']`), so they are
4
+ * Flow code; the family-neutral exit table stays in `core/step-ports.ts`.
5
+ */
6
+ import type { Step } from './flow-sdk.js';
7
+ /**
8
+ * Whether a step list that hands on no tail got there by reaching an End — a
9
+ * `.return()`, on some path — rather than by stopping the whole run
10
+ * (`.terminate`) or leaving a loop (`.break`). Only the first leaves a sibling
11
+ * `.parallel` join waiting: a terminate ends the run, join included.
12
+ */
13
+ export declare function stopsAtEnd(steps: readonly Step[]): boolean;
14
+ /**
15
+ * The step lists nested DIRECTLY inside `step` — the bodies a walk over this
16
+ * flow's own tree must descend into. Exhaustive over `Step['kind']`, so a new
17
+ * container kind fails to compile here instead of being silently skipped by
18
+ * every walker. That is how `check`'s return scan came to miss `.stepSwitch`
19
+ * arms and `.stepToList` / `.onError` bodies, and warned NO_RETURN on flows
20
+ * whose every path ends in `.return()` (UV-16855).
21
+ *
22
+ * A subflow's child flow is deliberately NOT a child here: it is another
23
+ * flow's tree, and its returns say nothing about whether THIS flow ends.
24
+ */
25
+ export declare function childStepLists(step: Step): readonly Step[][];
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Whether a step list that hands on no tail got there by reaching an End — a
3
+ * `.return()`, on some path — rather than by stopping the whole run
4
+ * (`.terminate`) or leaving a loop (`.break`). Only the first leaves a sibling
5
+ * `.parallel` join waiting: a terminate ends the run, join included.
6
+ */
7
+ export function stopsAtEnd(steps) {
8
+ const has = (list, kinds) => list.some((st) => kinds.has(st.kind)
9
+ || (st.kind === 'branch' && (has(st.then, kinds) || has(st.otherwise, kinds)))
10
+ || ((st.kind === 'switch' || st.kind === 'stepSwitch') && st.cases.some((c) => has(c.body, kinds)))
11
+ || (st.kind === 'switch' && st.default !== undefined && has(st.default, kinds)));
12
+ return has(steps, new Set(['return'])) && !has(steps, new Set(['terminate', 'break']));
13
+ }
14
+ /**
15
+ * The step lists nested DIRECTLY inside `step` — the bodies a walk over this
16
+ * flow's own tree must descend into. Exhaustive over `Step['kind']`, so a new
17
+ * container kind fails to compile here instead of being silently skipped by
18
+ * every walker. That is how `check`'s return scan came to miss `.stepSwitch`
19
+ * arms and `.stepToList` / `.onError` bodies, and warned NO_RETURN on flows
20
+ * whose every path ends in `.return()` (UV-16855).
21
+ *
22
+ * A subflow's child flow is deliberately NOT a child here: it is another
23
+ * flow's tree, and its returns say nothing about whether THIS flow ends.
24
+ */
25
+ export function childStepLists(step) {
26
+ switch (step.kind) {
27
+ case 'branch':
28
+ return [step.then, step.otherwise];
29
+ case 'switch':
30
+ return [...step.cases.map((c) => c.body), ...(step.default ? [step.default] : [])];
31
+ case 'stepSwitch':
32
+ return step.cases.map((c) => c.body);
33
+ case 'loop':
34
+ case 'doWhile':
35
+ case 'stepToList':
36
+ return [step.body];
37
+ case 'parallel':
38
+ return step.arms;
39
+ case 'action':
40
+ case 'break':
41
+ case 'terminate':
42
+ case 'stepToRef':
43
+ case 'return':
44
+ return [];
45
+ default: {
46
+ const unhandled = step;
47
+ throw new Error(`childStepLists: unhandled step kind ${JSON.stringify(unhandled.kind)}`);
48
+ }
49
+ }
50
+ }
@@ -1,6 +1,6 @@
1
1
  import { printResult, reportResult } from '../cli-result.js';
2
2
  import { join } from "node:path";
3
- import { CURRENT_LINK, PULL_COMMAND, currentEntrySha, libraryCacheRoot, resolveCachedLibrary, resolveCachedMarkdown, } from "./cache.js";
3
+ import { CURRENT_LINK, PULL_COMMAND, currentEntrySha, libraryCacheRoot, resolveCachedLibrary, resolveCachedMarkdown, } from "../core/library-cache.js";
4
4
  /**
5
5
  * Say where the connector library is.
6
6
  *
@@ -2,7 +2,7 @@ import { reportResult } from '../cli-result.js';
2
2
  import { createHash } from "node:crypto";
3
3
  import { mkdir, readFile, rename, rm, stat, symlink, writeFile, } from "node:fs/promises";
4
4
  import { join, resolve } from "node:path";
5
- import { CURRENT_LINK, LIBRARY_JSON_DIR, LIBRARY_MARKDOWN_DIR, cacheEntry, libraryCacheRoot, referencedConnectorKeys, } from "./cache.js";
5
+ import { CURRENT_LINK, LIBRARY_JSON_DIR, LIBRARY_MARKDOWN_DIR, cacheEntry, libraryCacheRoot, referencedConnectorKeys, } from "../core/library-cache.js";
6
6
  import { extractLibrary } from "./extractor.js";
7
7
  import { materializeRegistry } from "./materializer.js";
8
8
  import { curatedOverlayIdentity } from "./curated-overlay.js";
@@ -1,6 +1,6 @@
1
1
  import { printResult, reportResult } from '../cli-result.js';
2
2
  import { readFile, stat } from "node:fs/promises";
3
- import { PULL_COMMAND, resolveLibraryDir } from "./cache.js";
3
+ import { PULL_COMMAND, resolveLibraryDir } from "../core/library-cache.js";
4
4
  import { dirname, join } from "node:path";
5
5
  export const DEFAULT_SEARCH_LIMIT = 20;
6
6
  const USAGE = "Usage: flow-sdk registry search [query] [--library <dir>] [--library-md <dir>] [--connector <key>] [--limit <n>]";
package/dist/serialize.js CHANGED
@@ -19,10 +19,11 @@ import { connectionConnectors } from './bindings-v2.js';
19
19
  import { BindingRefusal, GUID_RE, bindingMissingMessage, bindingSelfNameMessage, bindingUndeclaredMessage, missingBindingLabels, undeclaredBinding } from './core/binding-messages.js';
20
20
  import { ByoaRefusal, byoaUnverified } from './core/byoa.js';
21
21
  import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitModel, hitlExitViolation, outcomeSlug } from './core/hitl-routing.js';
22
- import { declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
22
+ import { declaredExits, hasExits } from './core/step-ports.js';
23
+ import { stopsAtEnd } from './flow-step-tree.js';
23
24
  import { assertNodeEnvelope } from './core/node-envelope.js';
24
25
  import { buildConfiguration } from './config.js';
25
- import { stableId } from './core/stable-id.js';
26
+ import { fnv1aX4Uuid, stableId } from './core/stable-id.js';
26
27
  import { readEventFilter, eventFilterProblem, eventFilterJmes, eventFilterTreeLeaf } from './core/event-filters.js';
27
28
  import { FLOW_EXPR_DIALECT } from './core/connector-checks.js';
28
29
  import { buildConnectorInputs, connectorInputErrors as coreConnectorInputErrors, multipartBodyFieldName, transportHttpMethod } from './core/connector-inputs.js';
@@ -3428,37 +3429,6 @@ export function serializeWithSidecars(built, opts = {}) {
3428
3429
  const flow = serialize(built, { ...opts, sidecars });
3429
3430
  return { flow, sidecars };
3430
3431
  }
3431
- /**
3432
- * A deterministic v4-shaped uuid from a string.
3433
- *
3434
- * Used for an inline agent's `source` when the author does not pass one. It has to
3435
- * LOOK like a uuid (the platform treats it as an opaque directory name and the
3436
- * designer shows it as a folder) and it has to be STABLE, because a random one would
3437
- * make every recompile a diff of the `.flow` and a rename of a directory. FNV-1a
3438
- * ×4 with the version/variant nibbles pinned — not a cryptographic hash, and it does
3439
- * not need to be: the only requirement is that two different (flow, step) pairs do
3440
- * not collide within one project.
3441
- */
3442
- function stableUuid(seed) {
3443
- const words = [];
3444
- for (let i = 0; i < 4; i++) {
3445
- let h = 0x811c9dc5 ^ (i * 0x9e3779b9);
3446
- const s = `${seed}#${i}`;
3447
- for (let j = 0; j < s.length; j++) {
3448
- h ^= s.charCodeAt(j);
3449
- h = Math.imul(h, 0x01000193) >>> 0;
3450
- }
3451
- words.push(h >>> 0);
3452
- }
3453
- const hex = words.map((w) => w.toString(16).padStart(8, '0')).join('');
3454
- return [
3455
- hex.slice(0, 8),
3456
- hex.slice(8, 12),
3457
- `4${hex.slice(13, 16)}`,
3458
- `${((parseInt(hex.slice(16, 17), 16) & 0x3) | 0x8).toString(16)}${hex.slice(17, 20)}`,
3459
- hex.slice(20, 32),
3460
- ].join('-');
3461
- }
3462
3432
  /**
3463
3433
  * `variables.nodes` — one entry per node OUTPUT, derived from the nodes we just
3464
3434
  * emitted.
@@ -5080,7 +5050,7 @@ export function serialize(built, opts = {}) {
5080
5050
  // name rather than random so a recompile is byte-identical — a v4-shaped uuid
5081
5051
  // over a stable hash, because the platform treats it as an opaque id and the
5082
5052
  // designer shows it as a folder.
5083
- const source = s.source ?? stableUuid(`${built.id}/${step.name}`);
5053
+ const source = s.source ?? fnv1aX4Uuid(`${built.id}/${step.name}`);
5084
5054
  const node = makeNode(def.nodeType, id, step.name, { parentId, requestedVersion: step.options?.version, def });
5085
5055
  // Unlike the published families the inline agent KEEPS no node-level model:
5086
5056
  // 29 of 29 deployed instances carry none (the def's `model.source: true` is
@@ -5192,7 +5162,7 @@ export function serialize(built, opts = {}) {
5192
5162
  // resource's `id` are the same uuid, because that is what joins them. The
5193
5163
  // platform validator says so in its own refusal text — *"the resource id
5194
5164
  // from the parent inline agent's `resources[]`"*.
5195
- const contextResourceId = stableUuid(`${built.id}/${step.name}/context/${cx.id}`);
5165
+ const contextResourceId = fnv1aX4Uuid(`${built.id}/${step.name}/context/${cx.id}`);
5196
5166
  const contextQuery = renderContextQuery(cx.query, scope.rename);
5197
5167
  cnode.inputs = {
5198
5168
  // REQUIRED, and the platform's validator is what says so — measured
@@ -5406,7 +5376,7 @@ export function serialize(built, opts = {}) {
5406
5376
  : tr.kind === 'clientside' ? `clientside.${tr.name}`
5407
5377
  : tr.kind === 'httpRequest' ? `httprequest.${tr.name ?? 'default'}`
5408
5378
  : tr.key;
5409
- const toolResourceId = stableUuid(`${built.id}/${step.name}/tool/${toolSeed}`);
5379
+ const toolResourceId = fnv1aX4Uuid(`${built.id}/${step.name}/tool/${toolSeed}`);
5410
5380
  tnode.inputs = {
5411
5381
  source: toolResourceId,
5412
5382
  ...extraInputs,
@@ -5449,7 +5419,7 @@ export function serialize(built, opts = {}) {
5449
5419
  type: f.type,
5450
5420
  direction: f.direction,
5451
5421
  }));
5452
- const qsource = stableUuid(`${built.id}/${step.name}/escalation/${esc.name}`);
5422
+ const qsource = fnv1aX4Uuid(`${built.id}/${step.name}/escalation/${esc.name}`);
5453
5423
  qnode.inputs = {
5454
5424
  source: qsource,
5455
5425
  name: esc.name,
@@ -5485,7 +5455,7 @@ export function serialize(built, opts = {}) {
5485
5455
  path: `${source}/resources/${qsource}/resource.json`,
5486
5456
  json: escalationResourceJson(esc, {
5487
5457
  id: qsource,
5488
- channelId: stableUuid(`${built.id}/${step.name}/escalation/${esc.name}/channel`),
5458
+ channelId: fnv1aX4Uuid(`${built.id}/${step.name}/escalation/${esc.name}/channel`),
5489
5459
  quickFormSchema: qnode.inputs.schema,
5490
5460
  }),
5491
5461
  });
@@ -5497,7 +5467,7 @@ export function serialize(built, opts = {}) {
5497
5467
  const enode = makeNode(edef.nodeType, eid, esc.name, { parentId, def: edef });
5498
5468
  enode.display = { ...enode.display, shape: 'circle' };
5499
5469
  delete enode.model;
5500
- const esource = stableUuid(`${built.id}/${step.name}/escalation/${esc.name}`);
5470
+ const esource = fnv1aX4Uuid(`${built.id}/${step.name}/escalation/${esc.name}`);
5501
5471
  enode.inputs = {
5502
5472
  source: esource,
5503
5473
  name: esc.name,
@@ -5534,7 +5504,7 @@ export function serialize(built, opts = {}) {
5534
5504
  path: `${source}/resources/${esource}/resource.json`,
5535
5505
  json: escalationResourceJson(esc, {
5536
5506
  id: esource,
5537
- channelId: stableUuid(`${built.id}/${step.name}/escalation/${esc.name}/channel`),
5507
+ channelId: fnv1aX4Uuid(`${built.id}/${step.name}/escalation/${esc.name}/channel`),
5538
5508
  }),
5539
5509
  });
5540
5510
  }
@@ -5548,7 +5518,7 @@ export function serialize(built, opts = {}) {
5548
5518
  mnode.display = { ...mnode.display, shape: 'circle' };
5549
5519
  delete mnode.model;
5550
5520
  mnode.inputs = {
5551
- source: stableUuid(`${built.id}/${step.name}/memory/${m.id}`),
5521
+ source: fnv1aX4Uuid(`${built.id}/${step.name}/memory/${m.id}`),
5552
5522
  name: m.name,
5553
5523
  description: m.description ?? '',
5554
5524
  dynamicFewShotLearning: m.dynamicFewShotLearning ?? true,
@@ -5664,7 +5634,7 @@ export function serialize(built, opts = {}) {
5664
5634
  // lets the platform do that translation.
5665
5635
  const s = spec.inputs;
5666
5636
  const id = stepUid(scope, step.name);
5667
- const source = s.source ?? stableUuid(`${built.id}/${step.name}`);
5637
+ const source = s.source ?? fnv1aX4Uuid(`${built.id}/${step.name}`);
5668
5638
  const node = makeNode(NODE_TYPE.conversationalAgent, id, step.name, { parentId, requestedVersion: step.options?.version });
5669
5639
  delete node.model;
5670
5640
  const st = s.settings ?? {};
@@ -5757,7 +5727,7 @@ export function serialize(built, opts = {}) {
5757
5727
  // definition declares what comes back.
5758
5728
  const s = spec.inputs;
5759
5729
  const id = stepUid(scope, step.name);
5760
- const source = s.source ?? stableUuid(`${built.id}/${step.name}`);
5730
+ const source = s.source ?? fnv1aX4Uuid(`${built.id}/${step.name}`);
5761
5731
  const node = makeNode(NODE_TYPE.voiceAgent, id, step.name, { parentId, requestedVersion: step.options?.version });
5762
5732
  // Same rule as the inline agent's: the resource model lives on the
5763
5733
  // definition (its `model.source: true` is what makes `source` an input).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.16.6",
3
+ "version": "6.16.8",
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",
@@ -92,5 +92,5 @@
92
92
  "@types/node": "^22.7.0",
93
93
  "esbuild": "^0.28.1"
94
94
  },
95
- "gitref": "36462ef66bdae191ba107334d402dddaed067b2e"
95
+ "gitref": "77b292a40160cde6e025bbeb534397e5e930bae1"
96
96
  }