@uipath/maestro-builder-sdk 6.16.5 → 6.16.7

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 (52) hide show
  1. package/dist/api-index.md +78 -78
  2. package/dist/api-members.md +333 -333
  3. package/dist/bpmn/bpmn-expr-check.d.ts +1 -1
  4. package/dist/bpmn/bpmn-expr-check.js +1 -1
  5. package/dist/bpmn/bpmn-sdk.d.ts +1 -52
  6. package/dist/bpmn/bpmn-sdk.js +3 -66
  7. package/dist/bpmn/check-cli.js +2 -2
  8. package/dist/bpmn/check.d.ts +1 -1
  9. package/dist/bpmn/check.js +1 -18
  10. package/dist/bpmn/compile-cli.js +3 -7
  11. package/dist/bpmn/connector.d.ts +1 -1
  12. package/dist/bpmn/connector.js +2 -3
  13. package/dist/bpmn/declared-vars.d.ts +60 -0
  14. package/dist/bpmn/declared-vars.js +66 -0
  15. package/dist/bpmn/decompile-cli.js +4 -8
  16. package/dist/bpmn/merge-cli.js +3 -7
  17. package/dist/bpmn/serialize.js +1 -2
  18. package/dist/bpmn/tidy-cli.js +2 -6
  19. package/dist/case/compile-cli.js +3 -7
  20. package/dist/case/decompile-cli.js +5 -9
  21. package/dist/case/merge-cli.js +2 -6
  22. package/dist/case/serialize.js +1 -1
  23. package/dist/check.js +3 -15
  24. package/dist/cli-library.d.ts +1 -1
  25. package/dist/cli-library.js +1 -1
  26. package/dist/cli-run.d.ts +2 -0
  27. package/dist/cli-run.js +5 -0
  28. package/dist/compile-cli.js +3 -7
  29. package/dist/config.d.ts +0 -8
  30. package/dist/config.js +1 -10
  31. package/dist/core/cli-library.d.ts +0 -2
  32. package/dist/core/cli-library.js +2 -6
  33. package/dist/core/connector-inputs.d.ts +8 -0
  34. package/dist/core/connector-inputs.js +11 -16
  35. package/dist/core/edit-distance.d.ts +10 -0
  36. package/dist/core/edit-distance.js +20 -0
  37. package/dist/core/library.js +1 -12
  38. package/dist/core/step-ports.d.ts +0 -20
  39. package/dist/core/step-ports.js +0 -50
  40. package/dist/decompile-cli.js +3 -7
  41. package/dist/emit.js +1 -1
  42. package/dist/flow-step-tree.d.ts +25 -0
  43. package/dist/flow-step-tree.js +50 -0
  44. package/dist/merge-cli.js +3 -7
  45. package/dist/registry/path-cli.js +1 -1
  46. package/dist/registry/prepare/actions.js +1 -12
  47. package/dist/registry/pull-cli.js +1 -1
  48. package/dist/registry/search-cli.js +1 -1
  49. package/dist/serialize.js +4 -3
  50. package/package.json +2 -2
  51. /package/dist/{registry/cache.d.ts → core/library-cache.d.ts} +0 -0
  52. /package/dist/{registry/cache.js → core/library-cache.js} +0 -0
package/dist/check.js CHANGED
@@ -11,9 +11,11 @@ import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
11
11
  import { checkEventResolution, checkEventSubscription, eventParamsFor, } from './core/event-checks.js';
12
12
  import { FLOW_EXPR_DIALECT, checkBindingLabels, checkBindingPresence, checkConnectorContract as coreCheckConnectorContract, checkConnectorLookups as coreCheckConnectorLookups, checkConnectorSchema as coreCheckConnectorSchema, collectConnectionUses, connectionConnectorConflicts, } from './core/connector-checks.js';
13
13
  import { prepareCommand } from './core/cli-spelling.js';
14
+ import { editDistance } from './core/edit-distance.js';
14
15
  import { isAnswerField } from './core/hitl-answers.js';
15
16
  import { hitlDerivesOutcomeHandles, hitlExitModel, hitlRoutesPerOutcome } from './core/hitl-routing.js';
16
- import { childStepLists, declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
17
+ import { declaredExits, hasExits } from './core/step-ports.js';
18
+ import { childStepLists, stopsAtEnd } from './flow-step-tree.js';
17
19
  import { FLOW_SCHEMA_VERSIONS } from './format-profile.js';
18
20
  import { compareSchemaVersions, schemaVersionRefusal } from './schema-version.js';
19
21
  import { planFlowGlobals, planSharedInputs, sharedInputRoots } from './flow-variables.js';
@@ -1394,20 +1396,6 @@ function nearestName(name, candidates) {
1394
1396
  }
1395
1397
  return best;
1396
1398
  }
1397
- /** Levenshtein distance, capped by the caller's threshold (names are short). */
1398
- function editDistance(a, b) {
1399
- const prev = new Array(b.length + 1).fill(0).map((_, j) => j);
1400
- for (let i = 1; i <= a.length; i++) {
1401
- let diag = prev[0];
1402
- prev[0] = i;
1403
- for (let j = 1; j <= b.length; j++) {
1404
- const tmp = prev[j];
1405
- prev[j] = Math.min(prev[j] + 1, prev[j - 1] + 1, diag + (a[i - 1] === b[j - 1] ? 0 : 1));
1406
- diag = tmp;
1407
- }
1408
- }
1409
- return prev[b.length];
1410
- }
1411
1399
  /**
1412
1400
  * Diagnose a `subflow` step: the child flow itself, and the parent→child
1413
1401
  * binding.
@@ -6,4 +6,4 @@
6
6
  * `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
7
7
  * This shim preserves the historical `./cli-library.js` import path.
8
8
  */
9
- export { openCliLibrary, flagValue, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
9
+ export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
@@ -6,4 +6,4 @@
6
6
  * `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
7
7
  * This shim preserves the historical `./cli-library.js` import path.
8
8
  */
9
- export { openCliLibrary, flagValue, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
9
+ export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
package/dist/cli-run.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export type CliExitCode = 0 | 1 | 2;
2
2
  export declare function runWhenInvokedDirectly(moduleUrl: string, label: string, run: (argv: string[]) => Promise<CliExitCode> | CliExitCode): void;
3
+ /** The value after `name` in `argv`, or `undefined`. */
4
+ export declare function flagValue(argv: readonly string[], name: string): string | undefined;
package/dist/cli-run.js CHANGED
@@ -40,3 +40,8 @@ export function runWhenInvokedDirectly(moduleUrl, label, run) {
40
40
  process.exitCode = 1;
41
41
  });
42
42
  }
43
+ /** The value after `name` in `argv`, or `undefined`. */
44
+ export function flagValue(argv, name) {
45
+ const i = argv.indexOf(name);
46
+ return i >= 0 ? argv[i + 1] : undefined;
47
+ }
@@ -25,16 +25,12 @@ import { serializeWithSidecars, connectorInputErrors } from './serialize.js';
25
25
  import { check } from './check.js';
26
26
  import { byoaCheckOpts, eventResolveErrorFor, openCliLibrary } from './cli-library.js';
27
27
  import { Bindings } from './bindings.js';
28
- import { runWhenInvokedDirectly } from './cli-run.js';
28
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
29
29
  import { connectionResources, mergeBindingsV2, readBindingsV2 } from './bindings-v2.js';
30
30
  import { ensureTypeScriptRuntime } from './node-runtime.js';
31
31
  import { defaultBindingsFile } from './workdir.js';
32
32
  import { BindingRefusal } from './core/binding-messages.js';
33
33
  import { ByoaRefusal } from './core/byoa.js';
34
- function opt(argv, name) {
35
- const i = argv.indexOf(name);
36
- return i >= 0 ? argv[i + 1] : undefined;
37
- }
38
34
  /**
39
35
  * The tool `type` values `compile` writes. NOT every `$resourceType: 'tool'`:
40
36
  * the designer writes kinds the SDK cannot derive into the same directory, so
@@ -93,7 +89,7 @@ export async function run(argv) {
93
89
  // library, and answering it from an assumption instead is what made
94
90
  // EVENT_NO_SCOPE an error for HTTP Webhook, whose only correct `where` is empty.
95
91
  const library = openCliLibrary(argv);
96
- const bindFile = opt(argv, '--bindings') ?? defaultBindingsFile();
92
+ const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
97
93
  const bindings = new Bindings(bindFile);
98
94
  if (!noCheck) {
99
95
  const diags = check(built, library
@@ -166,7 +162,7 @@ export async function run(argv) {
166
162
  const { flow: flowJson, sidecars } = emitted;
167
163
  for (const w of warnings)
168
164
  console.error(` ⚠ [${w.code}] ${w.message}`);
169
- const out = opt(argv, '-o') ?? `${built.name || basename(file).replace(/\.flow\.ts$|\.ts$/, '')}.flow`;
165
+ const out = flagValue(argv, '-o') ?? `${built.name || basename(file).replace(/\.flow\.ts$|\.ts$/, '')}.flow`;
170
166
  writeFileSync(out, JSON.stringify(flowJson, null, 2) + '\n');
171
167
  console.log(`compile: wrote ${out} (${flowJson.nodes.length} nodes, ${flowJson.edges.length} edges)`);
172
168
  const written = [];
package/dist/config.d.ts CHANGED
@@ -6,14 +6,6 @@
6
6
  * envelope. This mirrors the platform's own rehydrateConfiguration (Tier-A defaults
7
7
  * + library-derived per-connector statics), minus the fieldsContainer sidecar.
8
8
  */
9
- /**
10
- * Convert an Integration Service operation discriminator into an HTTP transport
11
- * verb. `GETBYID` identifies a curated Retrieve operation in the connector
12
- * library, but the runtime's transport fields accept real HTTP methods only.
13
- * Keep the discriminator in `instanceParameters`; normalize only fields that
14
- * drive the request transport.
15
- */
16
- export declare function transportHttpMethod(method: string): string;
17
9
  /**
18
10
  * Compose the `=jsonString:`-wrapped configuration for a connector library entry.
19
11
  *
package/dist/config.js CHANGED
@@ -7,6 +7,7 @@
7
7
  * + library-derived per-connector statics), minus the fieldsContainer sidecar.
8
8
  */
9
9
  import { parseCeql } from './core/ceql.js';
10
+ import { transportHttpMethod } from './core/connector-inputs.js';
10
11
  const TIER_A_DEFAULTS = {
11
12
  additionalHeaders: null,
12
13
  baseObject: null,
@@ -86,16 +87,6 @@ const ESSENTIAL_KEYS = new Set([
86
87
  'path',
87
88
  'unifiedTypesCompatible',
88
89
  ]);
89
- /**
90
- * Convert an Integration Service operation discriminator into an HTTP transport
91
- * verb. `GETBYID` identifies a curated Retrieve operation in the connector
92
- * library, but the runtime's transport fields accept real HTTP methods only.
93
- * Keep the discriminator in `instanceParameters`; normalize only fields that
94
- * drive the request transport.
95
- */
96
- export function transportHttpMethod(method) {
97
- return method === 'GETBYID' ? 'GET' : method;
98
- }
99
90
  function schemaReplayDetails(operation, inputValues) {
100
91
  if (operation.customFieldsRequestDetails)
101
92
  return operation.customFieldsRequestDetails;
@@ -2,8 +2,6 @@ import { Library } from './library.js';
2
2
  import type { BindingsView } from './binding-messages.js';
3
3
  import { type ConnectorCheckOpts } from './connector-checks.js';
4
4
  import type { EventCheckOpts } from './event-checks.js';
5
- /** The value after `name` in `argv`, or `undefined`. */
6
- export declare function flagValue(argv: readonly string[], name: string): string | undefined;
7
5
  /**
8
6
  * The library for this invocation, or `undefined` when there is none.
9
7
  *
@@ -17,15 +17,11 @@
17
17
  import { existsSync } from 'node:fs';
18
18
  import { join } from 'node:path';
19
19
  import { Library } from './library.js';
20
- import { resolveLibraryDir } from '../registry/cache.js';
20
+ import { resolveLibraryDir } from './library-cache.js';
21
+ import { flagValue } from '../cli-run.js';
21
22
  import { defaultOverlayDir } from '../workdir.js';
22
23
  import { EQUALS_EXPR_DIALECT } from './connector-checks.js';
23
24
  import { connectorInputErrors } from './connector-inputs.js';
24
- /** The value after `name` in `argv`, or `undefined`. */
25
- export function flagValue(argv, name) {
26
- const i = argv.indexOf(name);
27
- return i >= 0 ? argv[i + 1] : undefined;
28
- }
29
25
  /**
30
26
  * The library for this invocation, or `undefined` when there is none.
31
27
  *
@@ -98,3 +98,11 @@ interface ConnectorSlots {
98
98
  * author already wrote under a plain key is merged into, not replaced.
99
99
  */
100
100
  export declare function nestConnectorBody(flat: Record<string, unknown>): Record<string, unknown>;
101
+ /**
102
+ * Convert an Integration Service operation discriminator into an HTTP transport
103
+ * verb. `GETBYID` identifies a curated Retrieve operation in the connector
104
+ * library, but the runtime's transport fields accept real HTTP methods only.
105
+ * Keep the discriminator in `instanceParameters`; normalize only fields that
106
+ * drive the request transport.
107
+ */
108
+ export declare function transportHttpMethod(method: string): string;
@@ -24,6 +24,7 @@
24
24
  */
25
25
  import { isLookupToken, resolvedValue, unresolvedLookupMessage, } from './lookups.js';
26
26
  import { prepareCommand } from './cli-spelling.js';
27
+ import { editDistance } from './edit-distance.js';
27
28
  /** Flow's dialect, re-exported so `serialize.ts` need not reach past this module. */
28
29
  export { FLOW_EXPR_DIALECT } from './connector-checks.js';
29
30
  import { FLOW_EXPR_DIALECT as FLOW_DIALECT } from './connector-checks.js';
@@ -286,6 +287,16 @@ export function nestConnectorBody(flat) {
286
287
  }
287
288
  return out;
288
289
  }
290
+ /**
291
+ * Convert an Integration Service operation discriminator into an HTTP transport
292
+ * verb. `GETBYID` identifies a curated Retrieve operation in the connector
293
+ * library, but the runtime's transport fields accept real HTTP methods only.
294
+ * Keep the discriminator in `instanceParameters`; normalize only fields that
295
+ * drive the request transport.
296
+ */
297
+ export function transportHttpMethod(method) {
298
+ return method === 'GETBYID' ? 'GET' : method;
299
+ }
289
300
  function place(target, parts, index, value) {
290
301
  const part = parts[index];
291
302
  const last = index === parts.length - 1;
@@ -486,19 +497,3 @@ function nearestField(key, names) {
486
497
  }
487
498
  return bestD <= budget ? best : undefined;
488
499
  }
489
- /** Levenshtein distance, two rows — enough for field-name suggestions. */
490
- function editDistance(a, b) {
491
- if (a === b)
492
- return 0;
493
- if (Math.abs(a.length - b.length) > 3)
494
- return 99; // cheap bail: beyond any budget
495
- let prev = Array.from({ length: b.length + 1 }, (_, j) => j);
496
- for (let i = 1; i <= a.length; i++) {
497
- const row = [i];
498
- for (let j = 1; j <= b.length; j++) {
499
- row[j] = Math.min(prev[j] + 1, row[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
500
- }
501
- prev = row;
502
- }
503
- return prev[b.length];
504
- }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
3
+ *
4
+ * Shared by the library's object lookup, Flow's `check`, connector-input routing
5
+ * and `registry prepare`. It returns the EXACT distance: callers compare it to a
6
+ * budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
7
+ * would reorder suggestions.
8
+ */
9
+ /** Levenshtein distance, two rows. Short strings only (names and ids). */
10
+ export declare function editDistance(a: string, b: string): number;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
3
+ *
4
+ * Shared by the library's object lookup, Flow's `check`, connector-input routing
5
+ * and `registry prepare`. It returns the EXACT distance: callers compare it to a
6
+ * budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
7
+ * would reorder suggestions.
8
+ */
9
+ /** Levenshtein distance, two rows. Short strings only (names and ids). */
10
+ export function editDistance(a, b) {
11
+ let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
12
+ for (let i = 1; i <= a.length; i++) {
13
+ const cur = [i];
14
+ for (let j = 1; j <= b.length; j++) {
15
+ cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
16
+ }
17
+ prev = cur;
18
+ }
19
+ return prev[b.length];
20
+ }
@@ -9,6 +9,7 @@
9
9
  import { readFileSync, existsSync } from 'node:fs';
10
10
  import { join } from 'node:path';
11
11
  import { prepareCommand } from './cli-spelling.js';
12
+ import { editDistance } from './edit-distance.js';
12
13
  import { loadListEnvelopes, lookupListEnvelope } from './list-envelope.js';
13
14
  import { lookupSpecOf } from './lookups.js';
14
15
  import { loadByoaLedger, loadInvariantCollections, loadLookupResolutions } from './lookup-store.js';
@@ -1126,18 +1127,6 @@ function nearest(want, objects) {
1126
1127
  }
1127
1128
  return best;
1128
1129
  }
1129
- /** Levenshtein distance, two rows. Short strings only (object names). */
1130
- function editDistance(a, b) {
1131
- let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
1132
- for (let i = 1; i <= a.length; i++) {
1133
- const cur = [i];
1134
- for (let j = 1; j <= b.length; j++) {
1135
- cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
1136
- }
1137
- prev = cur;
1138
- }
1139
- return prev[b.length];
1140
- }
1141
1130
  /**
1142
1131
  * The accepted input vocabulary for one connector operation, with each input's
1143
1132
  * wire LOCATION.
@@ -1,4 +1,3 @@
1
- import type { Step } from '../flow-sdk.js';
2
1
  /** One author-named exit: the value an arm matches on, and the port it wires. */
3
2
  export interface DeclaredExit {
4
3
  /** What `.stepSwitch()`'s arm `value` matches — the outcome or branch NAME. */
@@ -35,23 +34,4 @@ type SpecLike = {
35
34
  export declare function declaredExits(spec: SpecLike | undefined, pinnedVersion?: string): DeclaredExit[] | NoExits;
36
35
  /** Narrowing helper — `declaredExits` returns one or the other. */
37
36
  export declare function hasExits(r: DeclaredExit[] | NoExits): r is DeclaredExit[];
38
- /**
39
- * Whether a step list that hands on no tail got there by reaching an End — a
40
- * `.return()`, on some path — rather than by stopping the whole run
41
- * (`.terminate`) or leaving a loop (`.break`). Only the first leaves a sibling
42
- * `.parallel` join waiting: a terminate ends the run, join included.
43
- */
44
- export declare function stopsAtEnd(steps: readonly Step[]): boolean;
45
- /**
46
- * The step lists nested DIRECTLY inside `step` — the bodies a walk over this
47
- * flow's own tree must descend into. Exhaustive over `Step['kind']`, so a new
48
- * container kind fails to compile here instead of being silently skipped by
49
- * every walker. That is how `check`'s return scan came to miss `.stepSwitch`
50
- * arms and `.stepToList` / `.onError` bodies, and warned NO_RETURN on flows
51
- * whose every path ends in `.return()` (UV-16855).
52
- *
53
- * A subflow's child flow is deliberately NOT a child here: it is another
54
- * flow's tree, and its returns say nothing about whether THIS flow ends.
55
- */
56
- export declare function childStepLists(step: Step): readonly Step[][];
57
37
  export {};
@@ -94,53 +94,3 @@ export function declaredExits(spec, pinnedVersion) {
94
94
  export function hasExits(r) {
95
95
  return Array.isArray(r);
96
96
  }
97
- /**
98
- * Whether a step list that hands on no tail got there by reaching an End — a
99
- * `.return()`, on some path — rather than by stopping the whole run
100
- * (`.terminate`) or leaving a loop (`.break`). Only the first leaves a sibling
101
- * `.parallel` join waiting: a terminate ends the run, join included.
102
- */
103
- export function stopsAtEnd(steps) {
104
- const has = (list, kinds) => list.some((st) => kinds.has(st.kind)
105
- || (st.kind === 'branch' && (has(st.then, kinds) || has(st.otherwise, kinds)))
106
- || ((st.kind === 'switch' || st.kind === 'stepSwitch') && st.cases.some((c) => has(c.body, kinds)))
107
- || (st.kind === 'switch' && st.default !== undefined && has(st.default, kinds)));
108
- return has(steps, new Set(['return'])) && !has(steps, new Set(['terminate', 'break']));
109
- }
110
- /**
111
- * The step lists nested DIRECTLY inside `step` — the bodies a walk over this
112
- * flow's own tree must descend into. Exhaustive over `Step['kind']`, so a new
113
- * container kind fails to compile here instead of being silently skipped by
114
- * every walker. That is how `check`'s return scan came to miss `.stepSwitch`
115
- * arms and `.stepToList` / `.onError` bodies, and warned NO_RETURN on flows
116
- * whose every path ends in `.return()` (UV-16855).
117
- *
118
- * A subflow's child flow is deliberately NOT a child here: it is another
119
- * flow's tree, and its returns say nothing about whether THIS flow ends.
120
- */
121
- export function childStepLists(step) {
122
- switch (step.kind) {
123
- case 'branch':
124
- return [step.then, step.otherwise];
125
- case 'switch':
126
- return [...step.cases.map((c) => c.body), ...(step.default ? [step.default] : [])];
127
- case 'stepSwitch':
128
- return step.cases.map((c) => c.body);
129
- case 'loop':
130
- case 'doWhile':
131
- case 'stepToList':
132
- return [step.body];
133
- case 'parallel':
134
- return step.arms;
135
- case 'action':
136
- case 'break':
137
- case 'terminate':
138
- case 'stepToRef':
139
- case 'return':
140
- return [];
141
- default: {
142
- const unhandled = step;
143
- throw new Error(`childStepLists: unhandled step kind ${JSON.stringify(unhandled.kind)}`);
144
- }
145
- }
146
- }
@@ -23,12 +23,8 @@ import { basename, dirname, join, resolve } from 'node:path';
23
23
  import { defaultSourceOut, workDirBeside, writeSource } from './workdir.js';
24
24
  import { decompile } from './decompile.js';
25
25
  import { resolveFlowRefs } from './ref-resolve.js';
26
- import { runWhenInvokedDirectly } from './cli-run.js';
26
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
27
27
  import { PACKAGE_NAME } from './package-name.js';
28
- function opt(argv, name) {
29
- const i = argv.indexOf(name);
30
- return i >= 0 ? argv[i + 1] : undefined;
31
- }
32
28
  /** Derive a PascalCase base name from the flow name/id for the default output file. */
33
29
  function baseName(flow) {
34
30
  const src = flow.name ?? flow.id ?? 'Flow';
@@ -58,7 +54,7 @@ export function run(argv) {
58
54
  read: (path) => readFileSync(path, 'utf8'),
59
55
  });
60
56
  const ts = decompile(flow, {
61
- importSpecifier: opt(argv, '--import') ?? PACKAGE_NAME,
57
+ importSpecifier: flagValue(argv, '--import') ?? PACKAGE_NAME,
62
58
  bestEffort: !argv.includes('--strict'),
63
59
  // Findings the source cannot carry on its own (a node no trigger reaches, a
64
60
  // pinned core version this SDK lacks, a file-format version outside the
@@ -75,7 +71,7 @@ export function run(argv) {
75
71
  }
76
72
  },
77
73
  });
78
- const out = opt(argv, '-o') ?? defaultSourceOut(`${baseName(flow)}.flow.ts`);
74
+ const out = flagValue(argv, '-o') ?? defaultSourceOut(`${baseName(flow)}.flow.ts`);
79
75
  writeSource(out, ts);
80
76
  console.log(`flow-decompile: wrote ${basename(out)}`);
81
77
  reportResult({ path: resolve(out) });
package/dist/emit.js CHANGED
@@ -30,7 +30,7 @@ import { dirname, join } from 'node:path';
30
30
  import { serialize } from './serialize.js';
31
31
  import { Library } from './library.js';
32
32
  import { Bindings } from './bindings.js';
33
- import { resolveLibraryDir } from './registry/cache.js';
33
+ import { resolveLibraryDir } from './core/library-cache.js';
34
34
  import { defaultBindingsFile } from './workdir.js';
35
35
  /**
36
36
  * Resolve the connector library the same way `compile-cli` does: only load it
@@ -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
+ }
package/dist/merge-cli.js CHANGED
@@ -15,11 +15,7 @@ import { reportResult } from './cli-result.js';
15
15
  import { readFileSync, writeFileSync } from 'node:fs';
16
16
  import { basename, resolve } from 'node:path';
17
17
  import { mergeFlow } from './merge.js';
18
- import { runWhenInvokedDirectly } from './cli-run.js';
19
- function opt(argv, name) {
20
- const i = argv.indexOf(name);
21
- return i >= 0 ? argv[i + 1] : undefined;
22
- }
18
+ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
23
19
  export function run(argv) {
24
20
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
25
21
  console.error('usage: flow-merge <original.flow> <edited.flow> [-o merged.flow] [--baseline <baseline.flow>]');
@@ -34,13 +30,13 @@ export function run(argv) {
34
30
  }
35
31
  const original = JSON.parse(readFileSync(originalPath, 'utf8'));
36
32
  const edited = JSON.parse(readFileSync(editedPath, 'utf8'));
37
- const baselinePath = opt(argv, '--baseline');
33
+ const baselinePath = flagValue(argv, '--baseline');
38
34
  const baseline = baselinePath ? JSON.parse(readFileSync(baselinePath, 'utf8')) : undefined;
39
35
  const merged = mergeFlow(original, edited, {
40
36
  baseline,
41
37
  warn: (m) => console.error(`flow-merge: warning: ${m}`),
42
38
  });
43
- const out = opt(argv, '-o') ?? 'merged.flow';
39
+ const out = flagValue(argv, '-o') ?? 'merged.flow';
44
40
  writeFileSync(out, JSON.stringify(merged, null, 2) + '\n');
45
41
  console.log(`flow-merge: wrote ${basename(out)} (${(merged.nodes ?? []).length} nodes, ${(merged.edges ?? []).length} edges)`);
46
42
  reportResult({ path: resolve(out), nodes: (merged.nodes ?? []).length, edges: (merged.edges ?? []).length });
@@ -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
  *
@@ -17,6 +17,7 @@
17
17
  * everything else is pure over the parsed reply.
18
18
  */
19
19
  import { compareCodePoints, sortedStrings } from "../compat/compare.js";
20
+ import { editDistance } from "../../core/edit-distance.js";
20
21
  import { registrySearch } from "../uip/commands.js";
21
22
  import { failureReason, findJsonDocument, tail } from "../uip/envelope.js";
22
23
  import { isPlainObject, pyOr } from "./support.js";
@@ -81,18 +82,6 @@ export function closestActions(action, candidates) {
81
82
  });
82
83
  return scored.map(({ candidate }) => candidate);
83
84
  }
84
- /** Levenshtein distance, two rows. Short strings only (operation ids). */
85
- function editDistance(a, b) {
86
- let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
87
- for (let i = 1; i <= a.length; i++) {
88
- const cur = [i];
89
- for (let j = 1; j <= b.length; j++) {
90
- cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
91
- }
92
- prev = cur;
93
- }
94
- return prev[b.length];
95
- }
96
85
  /**
97
86
  * {@link closestActions}, kept only where the candidate is plausibly what was
98
87
  * meant: it shares MOST of the wanted id's words (`list-all-records` →
@@ -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,13 +19,14 @@ 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
- import { buildConfiguration, transportHttpMethod } from './config.js';
25
+ import { buildConfiguration } from './config.js';
25
26
  import { 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
- import { buildConnectorInputs, connectorInputErrors as coreConnectorInputErrors, multipartBodyFieldName } from './core/connector-inputs.js';
29
+ import { buildConnectorInputs, connectorInputErrors as coreConnectorInputErrors, multipartBodyFieldName, transportHttpMethod } from './core/connector-inputs.js';
29
30
  /**
30
31
  * What `compile` would refuse these connector inputs with, or `undefined` when it
31
32
  * would accept them — Flow's binding of the shared validator.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.16.5",
3
+ "version": "6.16.7",
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": "b6731e22dc81fb2ca34f4463bc1785aaae16d174"
95
+ "gitref": "c769835ca295fd52b2f51584b3e21ef9bb226347"
96
96
  }