@uipath/maestro-builder-sdk 6.124.18 → 6.124.19

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.
@@ -33,7 +33,7 @@ interface RtFlow {
33
33
  /** One difference, or one inconsistency in the merged file. */
34
34
  export interface MergeFinding {
35
35
  /** Which comparison found it. */
36
- kind: 'node-removed' | 'node-added' | 'node-type' | 'implicit-end' | 'edge-handle-renamed' | 'edge-rewired' | 'edge-removed' | 'edge-added' | 'handle-ids' | 'binding-removed' | 'binding-added' | 'variable-added' | 'variable-changed' | 'undeclared-handle' | 'duplicate-binding' | 'agent-sidecar' | 'agent-storage' | 'agent-prompt-input' | 'agent-embedded-edit' | 'outputs-superseded' | 'entry-point-repaired' | 'extract-draft' | 'processor-provisioned' | 'taxonomy-ids-minted';
36
+ kind: 'node-removed' | 'node-added' | 'node-type' | 'implicit-end' | 'edge-handle-renamed' | 'edge-rewired' | 'edge-removed' | 'edge-added' | 'handle-ids' | 'binding-removed' | 'binding-added' | 'binding-closed' | 'variable-added' | 'variable-changed' | 'undeclared-handle' | 'duplicate-binding' | 'agent-sidecar' | 'agent-storage' | 'agent-prompt-input' | 'agent-embedded-edit' | 'outputs-superseded' | 'entry-point-repaired' | 'extract-draft' | 'processor-provisioned' | 'taxonomy-ids-minted';
37
37
  /** The finding, phrased for the author, naming the node, edge or row. */
38
38
  message: string;
39
39
  /**
@@ -41,8 +41,8 @@ export interface MergeFinding {
41
41
  * `binding-removed`, which leave the merged file doing what the original does,
42
42
  * for `agent-embedded-edit`, which reports what merge did not carry, for
43
43
  * `outputs-superseded`, which reports a declaration merge corrected, and for
44
- * `entry-point-repaired`, `processor-provisioned` and `taxonomy-ids-minted`,
45
- * which report a fix merge made.
44
+ * `entry-point-repaired`, `processor-provisioned`, `taxonomy-ids-minted` and
45
+ * `binding-closed`, which report a fix merge made.
46
46
  */
47
47
  refuses: boolean;
48
48
  /**
@@ -76,7 +76,7 @@ export interface MergeFinding {
76
76
  * `correctedVariables` are root `variables.nodes` ids merge rewrote on purpose
77
77
  * (merge-superseded-outputs.ts), so they are not reported as a rewrite here.
78
78
  */
79
- export declare function roundTripFindings(original: RtFlow, baseline: RtFlow, merged: RtFlow, correctedVariables?: ReadonlySet<string>): MergeFinding[];
79
+ export declare function roundTripFindings(original: RtFlow, baseline: RtFlow, merged: RtFlow, correctedVariables?: ReadonlySet<string>, closedBindings?: ReadonlySet<string>): MergeFinding[];
80
80
  /**
81
81
  * Inconsistencies in the merged file that come from mixing its sources: a root
82
82
  * edge leaving a handle its source node does not declare, and two binding rows
@@ -114,7 +114,7 @@ function bindingText(b) {
114
114
  * `correctedVariables` are root `variables.nodes` ids merge rewrote on purpose
115
115
  * (merge-superseded-outputs.ts), so they are not reported as a rewrite here.
116
116
  */
117
- export function roundTripFindings(original, baseline, merged, correctedVariables = new Set()) {
117
+ export function roundTripFindings(original, baseline, merged, correctedVariables = new Set(), closedBindings = new Set()) {
118
118
  const out = [];
119
119
  const origDefs = defsOf(original);
120
120
  const baseDefs = defsOf(baseline);
@@ -291,7 +291,7 @@ export function roundTripFindings(original, baseline, merged, correctedVariables
291
291
  }
292
292
  }
293
293
  for (const [k, r] of bRows) {
294
- if (!oRows.has(k) && mRows.has(k)) {
294
+ if (!oRows.has(k) && mRows.has(k) && !closedBindings.has(k)) {
295
295
  out.push({ kind: 'binding-added', refuses: true, message: `the round trip adds a binding row for ${bindingText(r)}; merge will write it.` });
296
296
  }
297
297
  }
package/dist/merge.d.ts CHANGED
@@ -131,6 +131,8 @@ export interface MergeOptions {
131
131
  * - a node output declaration or definition an older SDK wrote wrongly, which
132
132
  * merge replaced with the edited compile's (merge-superseded-outputs.ts);
133
133
  * never refused;
134
+ * - a connection binding row merge wrote for a node whose `<bindings.NAME>`
135
+ * the original left with no row (`binding-closed`); never refused;
134
136
  * - an edited agent whose original carries its prompts and model on the node
135
137
  * (embedded): merge keeps them and applies only the node change, so a prompt
136
138
  * or model edit in the source is not carried. Under `strict` it refuses a
package/dist/merge.js CHANGED
@@ -676,11 +676,15 @@ function mergeFlowFindings(original, edited, options) {
676
676
  // newly-added nodes come from `edited` while the original's stay intact.
677
677
  // A row the no-edit recompile minted only for nodes the merge kept from the
678
678
  // original, or for fields of an edited node the edit did not change, is
679
- // not carried (#1133). ──
679
+ // not carried (#1133), unless it closes a placeholder the original left
680
+ // open (UV-18367). ──
680
681
  result.bindings = mergeBindings(original.bindings, edited.bindings);
681
- result.bindings = withoutRowsMintedForKeptNodes(result.bindings, original, edited, options.baseline, keptFromOriginal, fieldwise);
682
+ const closedRows = new Map();
683
+ result.bindings = withoutRowsMintedForKeptNodes(result.bindings, original, edited, options.baseline, keptFromOriginal, fieldwise, closedRows);
682
684
  result.bindings = withoutSupersededAppRows(result.bindings, originalNodes, allNodes);
683
685
  result.bindings = withoutStaleConnectionRows(result.bindings, originalNodes, allNodes);
686
+ const writtenRows = new Set((result.bindings ?? []).map(bindingIdentity));
687
+ const bindingRepairs = [...closedRows].filter(([identity]) => writtenRows.has(identity)).map(([, f]) => f);
684
688
  // metadata / solutionId / projectId / layout / runtime were carried by the
685
689
  // initial clone of `original` and are intentionally left untouched, apart
686
690
  // from the `layout.nodes` entries of removed nodes (dropped above) and added
@@ -710,8 +714,9 @@ function mergeFlowFindings(original, edited, options) {
710
714
  const findings = [
711
715
  ...drafts.discarded,
712
716
  ...superseded.findings,
713
- ...(options.baseline ? roundTripFindings(original, options.baseline, result, superseded.rootVariables) : []),
717
+ ...(options.baseline ? roundTripFindings(original, options.baseline, result, superseded.rootVariables, new Set(closedRows.keys())) : []),
714
718
  ...entryPointRepairs,
719
+ ...bindingRepairs,
715
720
  ...processorRepairs,
716
721
  ...taxonomyRepairs,
717
722
  ...mergedFileFindings(result, original),
@@ -1106,6 +1111,14 @@ function withoutStaleConnectionRows(rows, originalNodes, mergedNodes) {
1106
1111
  * which is in `keptFromOriginal`: the kept node is the original's, which reaches
1107
1112
  * its resource without that row.
1108
1113
  *
1114
+ * Except a keyed connection row whose `<bindings.NAME>` the original node itself
1115
+ * spells (in the node, or in the original's definition of its type) when no
1116
+ * original row of that name closes it, by the same key or by a key the original
1117
+ * node spells: the original left the placeholder open, and dropping the row
1118
+ * would leave it open (UV-18367). A `""`-keyed row binds nothing, so it is
1119
+ * still dropped. Each row kept this way goes into `closed` as a
1120
+ * `binding-closed` finding.
1121
+ *
1109
1122
  * Examples:
1110
1123
  * - A classic-CLI IxP extract carries its model inline and has no rows. It
1111
1124
  * decompiles to `ixpExtract(...)`, whose compile mints `ixpDeployment` rows
@@ -1134,7 +1147,7 @@ function withoutStaleConnectionRows(rows, originalNodes, mergedNodes) {
1134
1147
  * with its id is referenced by a kept node (the recompile resolved a label stub
1135
1148
  * for a node the merge discarded).
1136
1149
  */
1137
- function withoutRowsMintedForKeptNodes(rows, original, edited, baseline, keptFromOriginal, fieldwise) {
1150
+ function withoutRowsMintedForKeptNodes(rows, original, edited, baseline, keptFromOriginal, fieldwise, closed) {
1138
1151
  if (!baseline || !rows || (keptFromOriginal.size === 0 && fieldwise.size === 0))
1139
1152
  return rows;
1140
1153
  const contextByType = new Map();
@@ -1143,7 +1156,17 @@ function withoutRowsMintedForKeptNodes(rows, original, edited, baseline, keptFro
1143
1156
  continue;
1144
1157
  contextByType.set(d.nodeType, (contextByType.get(d.nodeType) ?? '') + JSON.stringify(d.model.context));
1145
1158
  }
1146
- const describe = (n, kept, changed) => ({ kept, changed, text: JSON.stringify(n) + (contextByType.get(n.type) ?? '') });
1159
+ const describe = (n, kept, changed) => ({ id: n.id, kept, changed, text: JSON.stringify(n) + (contextByType.get(n.type) ?? '') });
1160
+ const originalContextByType = new Map();
1161
+ for (const d of (original.definitions ?? [])) {
1162
+ if (typeof d?.nodeType !== 'string' || d.model?.context === undefined)
1163
+ continue;
1164
+ originalContextByType.set(d.nodeType, (originalContextByType.get(d.nodeType) ?? '') + JSON.stringify(d.model.context));
1165
+ }
1166
+ const originalText = new Map();
1167
+ for (const n of original.nodes ?? []) {
1168
+ originalText.set(n.id, JSON.stringify(n) + (originalContextByType.get(n.type) ?? ''));
1169
+ }
1147
1170
  const nodes = [
1148
1171
  ...(edited.nodes ?? []).map((n) => describe(n, keptFromOriginal.has(n.id), fieldwise.has(n.id) ? JSON.stringify(fieldwise.get(n.id) ?? {}) : undefined)),
1149
1172
  ...Object.values(edited.subflows ?? {}).flatMap((sf) => (sf?.nodes ?? []).map((n) => describe(n, false))),
@@ -1181,6 +1204,24 @@ function withoutRowsMintedForKeptNodes(rows, original, edited, baseline, keptFro
1181
1204
  return !counterpart || !nodes.some((n) => n.kept && refersTo(counterpart, originalRows, n.text));
1182
1205
  }
1183
1206
  const needs = (n) => !n.kept && (n.changed === undefined || references(n.changed));
1184
- return !(referencers.length > 0 && !referencers.some(needs));
1207
+ const openInOriginal = (n) => {
1208
+ const text = originalText.get(n.id);
1209
+ if (b.resource !== 'connection' || keyOf(b) === '' || text === undefined || typeof b.name !== 'string')
1210
+ return false;
1211
+ if (!text.includes(spelled(`<bindings.${b.name}>`)))
1212
+ return false;
1213
+ return !originalRows.some((o) => o.name === b.name
1214
+ && (keyOf(o) === keyOf(b) || (keyOf(o) !== '' && text.includes(spelled(keyOf(o))))));
1215
+ };
1216
+ if (referencers.length === 0 || referencers.some(needs))
1217
+ return true;
1218
+ const opener = referencers.find(openInOriginal);
1219
+ if (!opener)
1220
+ return false;
1221
+ closed.set(identity, {
1222
+ kind: 'binding-closed', refuses: false,
1223
+ message: `node "${opener.id}" spells <bindings.${String(b.name)}> but the original has no binding row for it, so Studio Web refuses to publish the flow; merge writes the row for connection "${keyOf(b)}" ${String(b.propertyAttribute ?? b.name)}.`,
1224
+ });
1225
+ return true;
1185
1226
  });
1186
1227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.124.18",
3
+ "version": "6.124.19",
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",
@@ -128,5 +128,5 @@
128
128
  "@types/node": "^22.7.0",
129
129
  "esbuild": "^0.28.1"
130
130
  },
131
- "gitref": "ee27233f8a6142eb8d89ce7c3824aa8c0697fe5f"
131
+ "gitref": "47a39806b6ecdeabac27e5f64636bc9dfbe0f7dd"
132
132
  }