@uipath/maestro-builder-sdk 6.16.6 → 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.
@@ -22,7 +22,7 @@
22
22
  * Variables are SCOPED: a sub-process sees the enclosing variables plus its own.
23
23
  */
24
24
  import { type ExprDiagnostic } from '../core/expr-check.js';
25
- import { type BuiltBpmn } from './bpmn-sdk.js';
25
+ import type { BuiltBpmn } from './bpmn-sdk.js';
26
26
  /** A diagnostic plus the element it was found in. */
27
27
  export interface BpmnLocatedDiagnostic extends ExprDiagnostic {
28
28
  where: string;
@@ -22,7 +22,7 @@
22
22
  * Variables are SCOPED: a sub-process sees the enclosing variables plus its own.
23
23
  */
24
24
  import { checkExpression } from '../core/expr-check.js';
25
- import { nodeDeclaredVars } from './bpmn-sdk.js';
25
+ import { nodeDeclaredVars } from './declared-vars.js';
26
26
  const NOUN = 'variable';
27
27
  const NAMESPACE = 'vars';
28
28
  const BINDING_NOUN = 'binding';
@@ -27,6 +27,7 @@ import { type DataServiceOperation } from './data-service.js';
27
27
  export type { DataServiceOperation } from './data-service.js';
28
28
  export { BpmnBuildError } from './bpmn-expr-check.js';
29
29
  export type { BpmnLocatedDiagnostic } from './bpmn-expr-check.js';
30
+ export { connectorOutputVars, nodeDeclaredVars, typedNodeDeclaredVars } from './declared-vars.js';
30
31
  /** ISO-8601 timer specification (one of duration / date / cycle). */
31
32
  export interface TimerSpec {
32
33
  /** Fire after this ISO-8601 duration, e.g. `'PT30S'`. */
@@ -3135,58 +3136,6 @@ export type BpmnConnectorOpts = ConnectorOpts & ActivityOpts & {
3135
3136
  */
3136
3137
  outputVar?: string;
3137
3138
  };
3138
- /**
3139
- * The variables a connector task's output rows land in.
3140
- *
3141
- * Per-node by default, because a `uipath:output`'s `var` IS the variable
3142
- * declaration as far as the platform is concerned (its canvas model maps every
3143
- * node output to a variable keyed by `var`). A shared name would therefore mean
3144
- * two connectors writing one variable, with the second silently clobbering the
3145
- * first — and it is the reason both the serializer and the expression check need
3146
- * the same answer, hence one function.
3147
- *
3148
- * @param n - The connector node.
3149
- * @returns The response and error variable names.
3150
- *
3151
- * @internal
3152
- */
3153
- export declare function connectorOutputVars(n: Extract<BpmnNode, {
3154
- kind: 'connector';
3155
- }>): {
3156
- response: string;
3157
- error: string;
3158
- };
3159
- /**
3160
- * The variables a typed node writes — the ONE definition of that set.
3161
- *
3162
- * It had grown three: this one (what an expression may read), `implicitNodeVars` in
3163
- * serialize (what gets declared in `uipath:variables`), and `derivedVariableIds` in
3164
- * decompile (what a decompiled file must NOT re-declare). All three must agree, and
3165
- * adding `outputRows` proved they do not stay agreed on their own: two were updated,
3166
- * this one was missed, and a human task's mapped output stopped being visible to the
3167
- * expression checker — `vars.decision` reported undeclared for a variable the node
3168
- * plainly writes. So serialize now calls this instead of repeating it, and only
3169
- * decompile's copy is separate, which its own comment already flags as load-bearing.
3170
- *
3171
- * @param n - The typed node.
3172
- * @returns The variable ids its output rows write.
3173
- * @internal
3174
- */
3175
- export declare function typedNodeDeclaredVars(n: Extract<BpmnNode, {
3176
- kind: 'typed';
3177
- }>): string[];
3178
- /**
3179
- * Every variable name a node DECLARES by writing to it — the platform counts a
3180
- * node's output `var` as a declaration, so a downstream `=vars.<name>` resolves
3181
- * against it without any `uipath:variables` entry. The expression check mirrors
3182
- * that, or it would reject reads the platform accepts.
3183
- *
3184
- * @param n - The node to inspect.
3185
- * @returns The variable names it declares, if any.
3186
- *
3187
- * @internal
3188
- */
3189
- export declare function nodeDeclaredVars(n: BpmnNode): string[];
3190
3139
  /** A sub-process body: the same graph methods, plus an internal node builder. */
3191
3140
  export declare class SubProcessBuilder extends ScopeBuilder {
3192
3141
  /**
@@ -2,9 +2,11 @@ import { connector as makeConnector } from '../core/actions.js';
2
2
  import { checkBpmnExpressions, BpmnBuildError } from './bpmn-expr-check.js';
3
3
  import { BPMN_SCHEMA_VERSIONS } from './format-profile.js';
4
4
  import { schemaVersionRefusal } from '../schema-version.js';
5
- import { bindingRequiredFields, REGISTRY_GAPS, registryType, typedNodeOutputVar } from './typed-node.js';
5
+ import { bindingRequiredFields, REGISTRY_GAPS, registryType } from './typed-node.js';
6
6
  import { DATA_SERVICE_ACTIVITY_TYPE, DATA_SERVICE_CONNECTOR_KEY, dataServiceWire } from './data-service.js';
7
7
  export { BpmnBuildError } from './bpmn-expr-check.js';
8
+ // @internal helpers kept on the published /bpmn subpath; SDK code imports declared-vars.js.
9
+ export { connectorOutputVars, nodeDeclaredVars, typedNodeDeclaredVars } from './declared-vars.js';
8
10
  function normTimer(t) {
9
11
  return typeof t === 'string' ? { duration: t } : t;
10
12
  }
@@ -2264,47 +2266,6 @@ class ScopeBuilder {
2264
2266
  return this;
2265
2267
  }
2266
2268
  }
2267
- /**
2268
- * The variables a connector task's output rows land in.
2269
- *
2270
- * Per-node by default, because a `uipath:output`'s `var` IS the variable
2271
- * declaration as far as the platform is concerned (its canvas model maps every
2272
- * node output to a variable keyed by `var`). A shared name would therefore mean
2273
- * two connectors writing one variable, with the second silently clobbering the
2274
- * first — and it is the reason both the serializer and the expression check need
2275
- * the same answer, hence one function.
2276
- *
2277
- * @param n - The connector node.
2278
- * @returns The response and error variable names.
2279
- *
2280
- * @internal
2281
- */
2282
- export function connectorOutputVars(n) {
2283
- return { response: n.outputVar ?? `${n.id}_response`, error: `${n.id}_Error` };
2284
- }
2285
- /**
2286
- * The variables a typed node writes — the ONE definition of that set.
2287
- *
2288
- * It had grown three: this one (what an expression may read), `implicitNodeVars` in
2289
- * serialize (what gets declared in `uipath:variables`), and `derivedVariableIds` in
2290
- * decompile (what a decompiled file must NOT re-declare). All three must agree, and
2291
- * adding `outputRows` proved they do not stay agreed on their own: two were updated,
2292
- * this one was missed, and a human task's mapped output stopped being visible to the
2293
- * expression checker — `vars.decision` reported undeclared for a variable the node
2294
- * plainly writes. So serialize now calls this instead of repeating it, and only
2295
- * decompile's copy is separate, which its own comment already flags as load-bearing.
2296
- *
2297
- * @param n - The typed node.
2298
- * @returns The variable ids its output rows write.
2299
- * @internal
2300
- */
2301
- export function typedNodeDeclaredVars(n) {
2302
- // Spelled-out rows REPLACE the derived pair, so they are the whole answer.
2303
- if (n.outputRows)
2304
- return n.outputRows.map((r) => r.var).filter((v) => v !== undefined);
2305
- const v = typedNodeOutputVar(n.id, n.type, n.outputVar, n.spec);
2306
- return [...(v ? [v] : []), ...Object.keys(n.outputs ?? {})];
2307
- }
2308
2269
  /**
2309
2270
  * Fill in `activity` on a connector task from the `operation` beside it.
2310
2271
  *
@@ -2348,30 +2309,6 @@ function defaultActivityIdentityRows(type, context, rows) {
2348
2309
  return rows;
2349
2310
  return [...rows, { name: 'activity', type: 'string', value: operation }];
2350
2311
  }
2351
- /**
2352
- * Every variable name a node DECLARES by writing to it — the platform counts a
2353
- * node's output `var` as a declaration, so a downstream `=vars.<name>` resolves
2354
- * against it without any `uipath:variables` entry. The expression check mirrors
2355
- * that, or it would reject reads the platform accepts.
2356
- *
2357
- * @param n - The node to inspect.
2358
- * @returns The variable names it declares, if any.
2359
- *
2360
- * @internal
2361
- */
2362
- export function nodeDeclaredVars(n) {
2363
- if (n.kind === 'connector') {
2364
- const { response, error } = connectorOutputVars(n);
2365
- return [response, error];
2366
- }
2367
- if (n.kind === 'typed')
2368
- return typedNodeDeclaredVars(n);
2369
- if (n.kind === 'scriptTask')
2370
- return Object.keys(n.outputs);
2371
- if (n.kind === 'task')
2372
- return Object.keys(n.set);
2373
- return [];
2374
- }
2375
2312
  /** A sub-process body: the same graph methods, plus an internal node builder. */
2376
2313
  export class SubProcessBuilder extends ScopeBuilder {
2377
2314
  /**
@@ -15,7 +15,7 @@
15
15
  * implicit join — the diagnostic is a `warning`, and its comment says which
16
16
  * platform rule it corresponds to and how the two differ.
17
17
  */
18
- import { type BuiltBpmn } from './bpmn-sdk.js';
18
+ import type { BuiltBpmn } from './bpmn-sdk.js';
19
19
  import { type ConnectorCheckOpts } from '../core/connector-checks.js';
20
20
  import { type EventCheckOpts } from '../core/event-checks.js';
21
21
  export interface Diagnostic {
@@ -1,21 +1,4 @@
1
- /**
2
- * bpmn/check — fast static validation of a BuiltBpmn before serialization.
3
- *
4
- * Surfaces the common Maestro canvas-rule failures early (dangling flow refs,
5
- * duplicate ids, a gateway branch with no condition, a superfluous gateway, an
6
- * implicit join, a missing start event, a boundary event attached to nothing, an
7
- * empty timer) so authoring gets instant feedback. The authoritative gate is
8
- * still `uip maestro bpmn validate` (`validateBpmnCanvas`) on the emitted
9
- * `.bpmn`.
10
- *
11
- * **An `error` here must mirror a real platform rule.** Being stricter than
12
- * `validate` is worse than being looser: it refuses processes that deploy and run
13
- * correctly, and the author has no way to appeal. Where this file is deliberately
14
- * stricter than the platform — an unconditioned inclusive-gateway branch, an
15
- * implicit join — the diagnostic is a `warning`, and its comment says which
16
- * platform rule it corresponds to and how the two differ.
17
- */
18
- import { nodeDeclaredVars } from './bpmn-sdk.js';
1
+ import { nodeDeclaredVars } from './declared-vars.js';
19
2
  import { allNodes, folderCompanionKeys, implicitNodeVars, processId } from './serialize.js';
20
3
  import { KNOWN_METHOD_SET } from './known-methods.js';
21
4
  import { EQUALS_EXPR_DIALECT, checkConnectorContract, checkConnectorLookups, checkConnectorSchema, checkBindingLabels, } from '../core/connector-checks.js';
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import type BpmnModdle from 'bpmn-moddle';
22
22
  import type { ModdleElement } from 'bpmn-moddle';
23
- import { type BpmnNode } from './bpmn-sdk.js';
23
+ import type { BpmnNode } from './bpmn-sdk.js';
24
24
  import type { Library } from '../core/library.js';
25
25
  import type { Bindings } from '../core/bindings.js';
26
26
  type El = ModdleElement;
@@ -1,4 +1,4 @@
1
- import { connectorOutputVars } from './bpmn-sdk.js';
1
+ import { connectorOutputVars } from './declared-vars.js';
2
2
  import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
3
3
  import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '../core/connector-inputs.js';
4
4
  export function createConnectorTask(ctx, n) {
@@ -0,0 +1,60 @@
1
+ /**
2
+ * bpmn/declared-vars — which variables a BPMN node declares by writing to them.
3
+ *
4
+ * The builder, the expression check and the serializer all need the one answer.
5
+ * It lives outside `bpmn-sdk.ts` so the checker does not import the builder back
6
+ * (the runtime import cycle FB003 reported).
7
+ */
8
+ import type { BpmnNode } from './bpmn-sdk.js';
9
+ /**
10
+ * The variables a connector task's output rows land in.
11
+ *
12
+ * Per-node by default, because a `uipath:output`'s `var` IS the variable
13
+ * declaration as far as the platform is concerned (its canvas model maps every
14
+ * node output to a variable keyed by `var`). A shared name would therefore mean
15
+ * two connectors writing one variable, with the second silently clobbering the
16
+ * first — and it is the reason both the serializer and the expression check need
17
+ * the same answer, hence one function.
18
+ *
19
+ * @param n - The connector node.
20
+ * @returns The response and error variable names.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare function connectorOutputVars(n: Extract<BpmnNode, {
25
+ kind: 'connector';
26
+ }>): {
27
+ response: string;
28
+ error: string;
29
+ };
30
+ /**
31
+ * The variables a typed node writes — the ONE definition of that set.
32
+ *
33
+ * It had grown three: this one (what an expression may read), `implicitNodeVars` in
34
+ * serialize (what gets declared in `uipath:variables`), and `derivedVariableIds` in
35
+ * decompile (what a decompiled file must NOT re-declare). All three must agree, and
36
+ * adding `outputRows` proved they do not stay agreed on their own: two were updated,
37
+ * this one was missed, and a human task's mapped output stopped being visible to the
38
+ * expression checker — `vars.decision` reported undeclared for a variable the node
39
+ * plainly writes. So serialize now calls this instead of repeating it, and only
40
+ * decompile's copy is separate, which its own comment already flags as load-bearing.
41
+ *
42
+ * @param n - The typed node.
43
+ * @returns The variable ids its output rows write.
44
+ * @internal
45
+ */
46
+ export declare function typedNodeDeclaredVars(n: Extract<BpmnNode, {
47
+ kind: 'typed';
48
+ }>): string[];
49
+ /**
50
+ * Every variable name a node DECLARES by writing to it — the platform counts a
51
+ * node's output `var` as a declaration, so a downstream `=vars.<name>` resolves
52
+ * against it without any `uipath:variables` entry. The expression check mirrors
53
+ * that, or it would reject reads the platform accepts.
54
+ *
55
+ * @param n - The node to inspect.
56
+ * @returns The variable names it declares, if any.
57
+ *
58
+ * @internal
59
+ */
60
+ export declare function nodeDeclaredVars(n: BpmnNode): string[];
@@ -0,0 +1,66 @@
1
+ import { typedNodeOutputVar } from './typed-node.js';
2
+ /**
3
+ * The variables a connector task's output rows land in.
4
+ *
5
+ * Per-node by default, because a `uipath:output`'s `var` IS the variable
6
+ * declaration as far as the platform is concerned (its canvas model maps every
7
+ * node output to a variable keyed by `var`). A shared name would therefore mean
8
+ * two connectors writing one variable, with the second silently clobbering the
9
+ * first — and it is the reason both the serializer and the expression check need
10
+ * the same answer, hence one function.
11
+ *
12
+ * @param n - The connector node.
13
+ * @returns The response and error variable names.
14
+ *
15
+ * @internal
16
+ */
17
+ export function connectorOutputVars(n) {
18
+ return { response: n.outputVar ?? `${n.id}_response`, error: `${n.id}_Error` };
19
+ }
20
+ /**
21
+ * The variables a typed node writes — the ONE definition of that set.
22
+ *
23
+ * It had grown three: this one (what an expression may read), `implicitNodeVars` in
24
+ * serialize (what gets declared in `uipath:variables`), and `derivedVariableIds` in
25
+ * decompile (what a decompiled file must NOT re-declare). All three must agree, and
26
+ * adding `outputRows` proved they do not stay agreed on their own: two were updated,
27
+ * this one was missed, and a human task's mapped output stopped being visible to the
28
+ * expression checker — `vars.decision` reported undeclared for a variable the node
29
+ * plainly writes. So serialize now calls this instead of repeating it, and only
30
+ * decompile's copy is separate, which its own comment already flags as load-bearing.
31
+ *
32
+ * @param n - The typed node.
33
+ * @returns The variable ids its output rows write.
34
+ * @internal
35
+ */
36
+ export function typedNodeDeclaredVars(n) {
37
+ // Spelled-out rows REPLACE the derived pair, so they are the whole answer.
38
+ if (n.outputRows)
39
+ return n.outputRows.map((r) => r.var).filter((v) => v !== undefined);
40
+ const v = typedNodeOutputVar(n.id, n.type, n.outputVar, n.spec);
41
+ return [...(v ? [v] : []), ...Object.keys(n.outputs ?? {})];
42
+ }
43
+ /**
44
+ * Every variable name a node DECLARES by writing to it — the platform counts a
45
+ * node's output `var` as a declaration, so a downstream `=vars.<name>` resolves
46
+ * against it without any `uipath:variables` entry. The expression check mirrors
47
+ * that, or it would reject reads the platform accepts.
48
+ *
49
+ * @param n - The node to inspect.
50
+ * @returns The variable names it declares, if any.
51
+ *
52
+ * @internal
53
+ */
54
+ export function nodeDeclaredVars(n) {
55
+ if (n.kind === 'connector') {
56
+ const { response, error } = connectorOutputVars(n);
57
+ return [response, error];
58
+ }
59
+ if (n.kind === 'typed')
60
+ return typedNodeDeclaredVars(n);
61
+ if (n.kind === 'scriptTask')
62
+ return Object.keys(n.outputs);
63
+ if (n.kind === 'task')
64
+ return Object.keys(n.set);
65
+ return [];
66
+ }
@@ -15,11 +15,10 @@
15
15
  */
16
16
  import BpmnModdle from 'bpmn-moddle';
17
17
  import { createRequire } from 'node:module';
18
- import { connectorOutputVars, } from './bpmn-sdk.js';
19
18
  import { createConnectorTask } from './connector.js';
20
19
  import { createConnectorEvent, createExternalTask, intsvcOutputVar } from './intsvc.js';
21
20
  import { createExtensionPayload, createTypedNode, rowDeclaration, typedNodeOutputVar, verbatimOutputRows } from './typed-node.js';
22
- import { typedNodeDeclaredVars } from './bpmn-sdk.js';
21
+ import { connectorOutputVars, typedNodeDeclaredVars } from './declared-vars.js';
23
22
  const require = createRequire(import.meta.url);
24
23
  const uipathDescriptor = require('./uipath-moddle.v1.json');
25
24
  const NS = {
@@ -17,7 +17,7 @@
17
17
  */
18
18
  import { reportResult } from '../cli-result.js';
19
19
  import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
20
- import { resolveLibraryDir } from '../registry/cache.js';
20
+ import { resolveLibraryDir } from '../core/library-cache.js';
21
21
  import { basename, join, resolve } from 'node:path';
22
22
  import { defaultSourceOut, workDirBeside, writeSource } from '../workdir.js';
23
23
  import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
package/dist/check.js CHANGED
@@ -14,7 +14,8 @@ import { prepareCommand } from './core/cli-spelling.js';
14
14
  import { editDistance } from './core/edit-distance.js';
15
15
  import { isAnswerField } from './core/hitl-answers.js';
16
16
  import { hitlDerivesOutcomeHandles, hitlExitModel, hitlRoutesPerOutcome } from './core/hitl-routing.js';
17
- 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';
18
19
  import { FLOW_SCHEMA_VERSIONS } from './format-profile.js';
19
20
  import { compareSchemaVersions, schemaVersionRefusal } from './schema-version.js';
20
21
  import { planFlowGlobals, planSharedInputs, sharedInputRoots } from './flow-variables.js';
@@ -17,7 +17,7 @@
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
21
  import { flagValue } from '../cli-run.js';
22
22
  import { defaultOverlayDir } from '../workdir.js';
23
23
  import { EQUALS_EXPR_DIALECT } from './connector-checks.js';
@@ -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
- }
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
+ }
@@ -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,7 +19,8 @@ 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
26
  import { stableId } from './core/stable-id.js';
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.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": "36462ef66bdae191ba107334d402dddaed067b2e"
95
+ "gitref": "c769835ca295fd52b2f51584b3e21ef9bb226347"
96
96
  }