@uipath/maestro-builder-sdk 6.44.0 → 6.44.2
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.
- package/dist/merge.d.ts +5 -3
- package/dist/merge.js +20 -10
- package/dist/node-placement.d.ts +6 -5
- package/dist/node-placement.js +25 -10
- package/dist/nodes/process/flow/node-type.js +17 -8
- package/package.json +2 -2
package/dist/merge.d.ts
CHANGED
|
@@ -26,9 +26,11 @@
|
|
|
26
26
|
* as decompile was faithful for every node (the common case).
|
|
27
27
|
*
|
|
28
28
|
* Layout, `metadata`, `solutionId`, `projectId`, `runtime` and `layout` are
|
|
29
|
-
* preserved from the original
|
|
30
|
-
*
|
|
31
|
-
* (
|
|
29
|
+
* preserved from the original, apart from the `layout.nodes` entries of
|
|
30
|
+
* removed nodes (dropped) and added nodes (node-placement.ts); `subflows` and
|
|
31
|
+
* edges (with their ids) come from `edited`; root `variables` merge as a
|
|
32
|
+
* delta per entry, like nodes (merge-variables.ts); `definitions` and
|
|
33
|
+
* `bindings` are unioned
|
|
32
34
|
* (original wins on conflict, since the original's are the tenant-resolved
|
|
33
35
|
* authority). A binding row's identity is what it binds, not its row id, and a
|
|
34
36
|
* row the no-edit recompile minted only for nodes merge kept from the original
|
package/dist/merge.js
CHANGED
|
@@ -26,9 +26,11 @@
|
|
|
26
26
|
* as decompile was faithful for every node (the common case).
|
|
27
27
|
*
|
|
28
28
|
* Layout, `metadata`, `solutionId`, `projectId`, `runtime` and `layout` are
|
|
29
|
-
* preserved from the original
|
|
30
|
-
*
|
|
31
|
-
* (
|
|
29
|
+
* preserved from the original, apart from the `layout.nodes` entries of
|
|
30
|
+
* removed nodes (dropped) and added nodes (node-placement.ts); `subflows` and
|
|
31
|
+
* edges (with their ids) come from `edited`; root `variables` merge as a
|
|
32
|
+
* delta per entry, like nodes (merge-variables.ts); `definitions` and
|
|
33
|
+
* `bindings` are unioned
|
|
32
34
|
* (original wins on conflict, since the original's are the tenant-resolved
|
|
33
35
|
* authority). A binding row's identity is what it binds, not its row id, and a
|
|
34
36
|
* row the no-edit recompile minted only for nodes merge kept from the original
|
|
@@ -261,6 +263,11 @@ function layoutNodesOf(f) {
|
|
|
261
263
|
const nodes = f.layout?.nodes;
|
|
262
264
|
return nodes && typeof nodes === 'object' && !Array.isArray(nodes) ? nodes : undefined;
|
|
263
265
|
}
|
|
266
|
+
/** The original's `layout.nodes` when it holds positions. An SDK compile writes `{}` there and keeps them on `node.ui`. */
|
|
267
|
+
function positionStoreOf(f) {
|
|
268
|
+
const nodes = layoutNodesOf(f);
|
|
269
|
+
return nodes && Object.keys(nodes).length > 0 ? nodes : undefined;
|
|
270
|
+
}
|
|
264
271
|
export function mergeFlow(original, edited, options = {}) {
|
|
265
272
|
const { result, findings } = mergeFlowFindings(original, edited, options);
|
|
266
273
|
reportOrRefuse(findings, options);
|
|
@@ -374,12 +381,13 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
374
381
|
// one already taken elsewhere in the file, gets a fresh id, from ids unused
|
|
375
382
|
// anywhere in the file. ──
|
|
376
383
|
result.edges = withFileUniqueEdgeIds(edited.edges ?? [], subflowScopes);
|
|
377
|
-
// ── Placement: a node the edit ADDED has
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
//
|
|
381
|
-
//
|
|
382
|
-
|
|
384
|
+
// ── Placement: a node the edit ADDED has no original position. Unless the
|
|
385
|
+
// author set one, it has compile's placeholder, an emission-index slot
|
|
386
|
+
// that can land on an original node. Put it next to its predecessor,
|
|
387
|
+
// collision-free, and store every added node's position where the
|
|
388
|
+
// original stores positions — see node-placement.ts. Root scope only: a
|
|
389
|
+
// subflow is taken from `edited` whole, layout included. ──
|
|
390
|
+
placeAddedNodes(finalNodes, result.edges, positionStoreOf(original) && layoutNodesOf(result), (id) => !origNodes.has(id));
|
|
383
391
|
// ── Definitions: the (type, version) pairs used by EVERY node in the file —
|
|
384
392
|
// root and subflows — original winning on conflict (its defs are the
|
|
385
393
|
// tenant-resolved authority). Selecting by root nodes only dropped the
|
|
@@ -398,7 +406,9 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
398
406
|
result.bindings = mergeBindings(original.bindings, edited.bindings);
|
|
399
407
|
result.bindings = withoutRowsMintedForKeptNodes(result.bindings, original, edited, options.baseline, keptFromOriginal);
|
|
400
408
|
// metadata / solutionId / projectId / layout / runtime were carried by the
|
|
401
|
-
// initial clone of `original` and are intentionally left untouched
|
|
409
|
+
// initial clone of `original` and are intentionally left untouched, apart
|
|
410
|
+
// from the `layout.nodes` entries of removed nodes (dropped above) and added
|
|
411
|
+
// nodes (placement).
|
|
402
412
|
//
|
|
403
413
|
// The declared file-format `version` follows the same delta rule the nodes
|
|
404
414
|
// do. The original's wins by default, because a compile of an edited source
|
package/dist/node-placement.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* A child's position is relative to its container, as on the canvas.
|
|
20
20
|
*
|
|
21
21
|
* The position goes where the original stores positions: `layout.nodes[id]`
|
|
22
|
-
* when
|
|
22
|
+
* when its `layout.nodes` has entries, otherwise `node.ui`. Positions are read the
|
|
23
23
|
* way the designer reads them (flow-workbench `flow-schema`
|
|
24
24
|
* `workflow-format-conversion.ts` `mergeLayout`): a `layout.nodes[id]` entry
|
|
25
25
|
* wins over `node.ui`, field by field.
|
|
@@ -77,13 +77,14 @@ interface PlacedNode {
|
|
|
77
77
|
* its placeholder, and placed nodes avoid it.
|
|
78
78
|
*
|
|
79
79
|
* Where the result is written follows the file: when the original stores
|
|
80
|
-
* positions in `layout.nodes` (every canvas-saved file does),
|
|
81
|
-
*
|
|
82
|
-
*
|
|
80
|
+
* positions in `layout.nodes` (every canvas-saved file does), every added
|
|
81
|
+
* node's `node.ui`, placed or not, sticky notes included, replaces its
|
|
82
|
+
* `layout.nodes` entry, so the node has one position; otherwise
|
|
83
|
+
* `node.ui.position` is updated.
|
|
83
84
|
*
|
|
84
85
|
* @param nodes - The merged root nodes (mutated).
|
|
85
86
|
* @param edges - The merged root edges.
|
|
86
|
-
* @param layoutNodes - The merged file's `layout.nodes`, or undefined when the original
|
|
87
|
+
* @param layoutNodes - The merged file's `layout.nodes`, or undefined when the original keeps positions on `node.ui` (mutated).
|
|
87
88
|
* @param isAdded - Whether a node id is new in this merge.
|
|
88
89
|
*/
|
|
89
90
|
export declare function placeAddedNodes(nodes: PlacedNode[], edges: ReadonlyArray<{
|
package/dist/node-placement.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* A child's position is relative to its container, as on the canvas.
|
|
20
20
|
*
|
|
21
21
|
* The position goes where the original stores positions: `layout.nodes[id]`
|
|
22
|
-
* when
|
|
22
|
+
* when its `layout.nodes` has entries, otherwise `node.ui`. Positions are read the
|
|
23
23
|
* way the designer reads them (flow-workbench `flow-schema`
|
|
24
24
|
* `workflow-format-conversion.ts` `mergeLayout`): a `layout.nodes[id]` entry
|
|
25
25
|
* wins over `node.ui`, field by field.
|
|
@@ -83,6 +83,21 @@ function findFreePosition(candidate, size, others) {
|
|
|
83
83
|
}
|
|
84
84
|
return candidate;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Move each added node's `ui` into `layoutNodes`, replacing any entry under its
|
|
88
|
+
* id: the original can hold an entry for an id it has no node for.
|
|
89
|
+
*/
|
|
90
|
+
function moveAddedUi(nodes, layoutNodes, isAdded) {
|
|
91
|
+
for (const n of nodes) {
|
|
92
|
+
if (!isAdded(n.id))
|
|
93
|
+
continue;
|
|
94
|
+
if (n.ui === undefined)
|
|
95
|
+
delete layoutNodes[n.id];
|
|
96
|
+
else
|
|
97
|
+
layoutNodes[n.id] = n.ui;
|
|
98
|
+
delete n.ui;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
86
101
|
/**
|
|
87
102
|
* Give each node the edit added a position next to its predecessor, in place.
|
|
88
103
|
*
|
|
@@ -95,16 +110,19 @@ function findFreePosition(candidate, size, others) {
|
|
|
95
110
|
* its placeholder, and placed nodes avoid it.
|
|
96
111
|
*
|
|
97
112
|
* Where the result is written follows the file: when the original stores
|
|
98
|
-
* positions in `layout.nodes` (every canvas-saved file does),
|
|
99
|
-
*
|
|
100
|
-
*
|
|
113
|
+
* positions in `layout.nodes` (every canvas-saved file does), every added
|
|
114
|
+
* node's `node.ui`, placed or not, sticky notes included, replaces its
|
|
115
|
+
* `layout.nodes` entry, so the node has one position; otherwise
|
|
116
|
+
* `node.ui.position` is updated.
|
|
101
117
|
*
|
|
102
118
|
* @param nodes - The merged root nodes (mutated).
|
|
103
119
|
* @param edges - The merged root edges.
|
|
104
|
-
* @param layoutNodes - The merged file's `layout.nodes`, or undefined when the original
|
|
120
|
+
* @param layoutNodes - The merged file's `layout.nodes`, or undefined when the original keeps positions on `node.ui` (mutated).
|
|
105
121
|
* @param isAdded - Whether a node id is new in this merge.
|
|
106
122
|
*/
|
|
107
123
|
export function placeAddedNodes(nodes, edges, layoutNodes, isAdded) {
|
|
124
|
+
if (layoutNodes)
|
|
125
|
+
moveAddedUi(nodes, layoutNodes, isAdded);
|
|
108
126
|
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
109
127
|
const uiOf = (n) => {
|
|
110
128
|
const entry = layoutNodes?.[n.id];
|
|
@@ -149,13 +167,10 @@ export function placeAddedNodes(nodes, edges, layoutNodes, isAdded) {
|
|
|
149
167
|
.map((o) => ({ ...uiOf(o).position, ...sizeOf(o) }));
|
|
150
168
|
const position = findFreePosition(candidate, sizeOf(n), others);
|
|
151
169
|
const ui = { ...uiOf(n), position };
|
|
152
|
-
if (layoutNodes)
|
|
170
|
+
if (layoutNodes)
|
|
153
171
|
layoutNodes[id] = ui;
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
172
|
+
else
|
|
157
173
|
n.ui = ui;
|
|
158
|
-
}
|
|
159
174
|
pending.delete(id);
|
|
160
175
|
progress = true;
|
|
161
176
|
}
|
|
@@ -698,10 +698,13 @@ function liftProcess(node, ctx, prefix, kind, form) {
|
|
|
698
698
|
const n = node;
|
|
699
699
|
const key = n.type.slice(prefix.length);
|
|
700
700
|
const def = ctx.definition();
|
|
701
|
-
|
|
701
|
+
// Descriptor rows (`[{ name, default }]`), or the early `{ name, folderPath }` object.
|
|
702
|
+
const values = def?.model?.bindings?.values;
|
|
702
703
|
const binding = (name) => {
|
|
703
|
-
const
|
|
704
|
-
|
|
704
|
+
const v = Array.isArray(values)
|
|
705
|
+
? values.find((r) => r?.name === name)?.default
|
|
706
|
+
: values !== null && typeof values === 'object' ? values[name] : undefined;
|
|
707
|
+
return typeof v === 'string' ? v : undefined;
|
|
705
708
|
};
|
|
706
709
|
const name = binding('name');
|
|
707
710
|
const folderPath = binding('folderPath');
|
|
@@ -712,11 +715,13 @@ function liftProcess(node, ctx, prefix, kind, form) {
|
|
|
712
715
|
const projectId = typeof def?.model?.projectId === 'string' ? def.model.projectId : undefined;
|
|
713
716
|
const inSolution = def?.model?.isInSolution === true || projectId !== undefined;
|
|
714
717
|
const inputs = { ...(n.inputs ?? {}) };
|
|
715
|
-
// The design-time fire-and-forget switch is an OPTION on
|
|
716
|
-
// process argument — serialize adds it to `inputs` after rendering the
|
|
717
|
-
// author's map, so it comes back off here.
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
// The design-time fire-and-forget switch is an OPTION on agenticProcess(),
|
|
719
|
+
// not a process argument — serialize adds it to `inputs` after rendering the
|
|
720
|
+
// author's map, so it comes back off here. No other factory has the option, so
|
|
721
|
+
// on another kind the key stays an ordinary input and round-trips as one.
|
|
722
|
+
const fireAndForget = kind === 'agenticProcess' && ctx.plainValue(inputs.fireAndForget) === true;
|
|
723
|
+
if (kind === 'agenticProcess')
|
|
724
|
+
delete inputs.fireAndForget;
|
|
720
725
|
if (kind === 'agent' && (def?.model?.isInSolution === true || def?.model?.projectId !== undefined)) {
|
|
721
726
|
for (const [k, v] of Object.entries(inputs))
|
|
722
727
|
inputs[k] = legacyAgentTemplateInput(v);
|
|
@@ -748,6 +753,9 @@ function liftProcess(node, ctx, prefix, kind, form) {
|
|
|
748
753
|
...(returns !== undefined && !fireAndForget ? { returns } : {}),
|
|
749
754
|
...(form !== undefined ? { form } : {}),
|
|
750
755
|
...(fireAndForget ? { completion: 'fire-and-forget' } : {}),
|
|
756
|
+
// The only field a coded agent's definition differs in (see agentDef);
|
|
757
|
+
// 'lowcode' is the default, so only 'coded' is written.
|
|
758
|
+
...(kind === 'agent' && def?.display?.icon === 'coded-agent' ? { flavour: 'coded' } : {}),
|
|
751
759
|
};
|
|
752
760
|
return { kind, inputs: spec };
|
|
753
761
|
}
|
|
@@ -767,6 +775,7 @@ function printProcess(spec, ctx, factory) {
|
|
|
767
775
|
['returns', p.returns !== undefined ? obj(Object.entries(p.returns).map(([k, t]) => [k, ctx.string(t)])) : undefined],
|
|
768
776
|
['form', p.form !== undefined ? ctx.string(p.form) : undefined],
|
|
769
777
|
['completion', p.completion !== undefined ? ctx.string(p.completion) : undefined],
|
|
778
|
+
['flavour', p.flavour !== undefined ? ctx.string(p.flavour) : undefined],
|
|
770
779
|
],
|
|
771
780
|
};
|
|
772
781
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.44.
|
|
3
|
+
"version": "6.44.2",
|
|
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",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"@types/node": "^22.7.0",
|
|
94
94
|
"esbuild": "^0.28.1"
|
|
95
95
|
},
|
|
96
|
-
"gitref": "
|
|
96
|
+
"gitref": "7afed05cfe5a6856deb6fe7984a5cf2b31a2dd20"
|
|
97
97
|
}
|