@uipath/maestro-builder-sdk 6.114.0 → 6.116.0

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.
@@ -9,6 +9,8 @@
9
9
  */
10
10
  import type { ResolvedConnector } from '../core/library.js';
11
11
  import type { ExternalEventPair, ExternalExecutionMode } from './case-sdk.js';
12
+ import { isExternalEventMode, isExternalExecutionMode, libraryExecution } from '../core/external-execution.js';
13
+ export { isExternalEventMode, isExternalExecutionMode, libraryExecution };
12
14
  /**
13
15
  * The context rows `serialize` writes on an external task: the set the Case
14
16
  * Designer saves for a sync object (`uip`'s
@@ -27,8 +29,6 @@ export declare const EXTERNAL_TASK_CONTEXT: readonly string[];
27
29
  export declare const EXTERNAL_TASK_EVENT_CONTEXT: readonly string[];
28
30
  /** Check's and compile's code for {@link externalEventRefusal}. */
29
31
  export declare const EXTERNAL_TASK_EVENT = "EXTERNAL_TASK_EVENT";
30
- /** The event modes Integration Service reports for an object's events. */
31
- export declare function isExternalEventMode(value: unknown): value is ExternalEventPair['mode'];
32
32
  /**
33
33
  * Why this task's event pair cannot be written, or `undefined`.
34
34
  *
@@ -45,8 +45,6 @@ export declare function isExternalEventMode(value: unknown): value is ExternalEv
45
45
  * @returns The refusal, or `undefined`.
46
46
  */
47
47
  export declare function externalEventRefusal(owner: string, mode: ExternalExecutionMode, event: unknown): string | undefined;
48
- /** The execution types an external task accepts: the values Integration Service reports. */
49
- export declare function isExternalExecutionMode(value: unknown): value is ExternalExecutionMode;
50
48
  /**
51
49
  * The `data.serviceType` the Case Designer saves for an external task of this
52
50
  * execution type. Studio Web runs `hybrid` as `async` (`determineActualIntsvcType`),
@@ -69,16 +67,6 @@ export type ExternalExecution = {
69
67
  code: string;
70
68
  message: string;
71
69
  };
72
- /**
73
- * The execution facts the connector library records for the object
74
- * (`operation.executionType` and `operation.executionEvent`, from
75
- * `registry build-library` / `registry prepare`, #1369). A value the SDK does
76
- * not know is ignored, as if it were absent.
77
- */
78
- export declare function libraryExecution(operation: unknown): {
79
- mode?: ExternalExecutionMode;
80
- event?: ExternalEventPair;
81
- };
82
70
  /**
83
71
  * The mode and event an external task is written with: what the author passed,
84
72
  * else what the connector library records for the object. `check` and
@@ -1,4 +1,7 @@
1
1
  import { CASE_FORMAT_PROFILE } from './format-profile.js';
2
+ import { isExternalEventMode, isExternalExecutionMode, libraryExecution } from '../core/external-execution.js';
3
+ // Shared with Flow and BPMN, which read the same library record.
4
+ export { isExternalEventMode, isExternalExecutionMode, libraryExecution };
2
5
  /**
3
6
  * The context rows `serialize` writes on an external task: the set the Case
4
7
  * Designer saves for a sync object (`uip`'s
@@ -20,10 +23,6 @@ export const EXTERNAL_TASK_CONTEXT = [
20
23
  export const EXTERNAL_TASK_EVENT_CONTEXT = ['operation', 'eventMode'];
21
24
  /** Check's and compile's code for {@link externalEventRefusal}. */
22
25
  export const EXTERNAL_TASK_EVENT = 'EXTERNAL_TASK_EVENT';
23
- /** The event modes Integration Service reports for an object's events. */
24
- export function isExternalEventMode(value) {
25
- return value === 'polling' || value === 'webhooks';
26
- }
27
26
  /**
28
27
  * Why this task's event pair cannot be written, or `undefined`.
29
28
  *
@@ -60,10 +59,6 @@ export function externalEventRefusal(owner, mode, event) {
60
59
  return `${owner} event.mode must be "polling" or "webhooks"; got ${JSON.stringify(pair.mode)}.`;
61
60
  return undefined;
62
61
  }
63
- /** The execution types an external task accepts: the values Integration Service reports. */
64
- export function isExternalExecutionMode(value) {
65
- return value === 'sync' || value === 'async' || value === 'hybrid';
66
- }
67
62
  /**
68
63
  * The `data.serviceType` the Case Designer saves for an external task of this
69
64
  * execution type. Studio Web runs `hybrid` as `async` (`determineActualIntsvcType`),
@@ -82,22 +77,6 @@ export function externalServiceType(kind, mode) {
82
77
  }
83
78
  /** Check's and compile's code when an authored `mode` disagrees with the library. */
84
79
  export const EXTERNAL_TASK_MODE_MISMATCH = 'EXTERNAL_TASK_MODE_MISMATCH';
85
- /**
86
- * The execution facts the connector library records for the object
87
- * (`operation.executionType` and `operation.executionEvent`, from
88
- * `registry build-library` / `registry prepare`, #1369). A value the SDK does
89
- * not know is ignored, as if it were absent.
90
- */
91
- export function libraryExecution(operation) {
92
- const op = (operation ?? {});
93
- const mode = isExternalExecutionMode(op.executionType) ? op.executionType : undefined;
94
- const raw = op.executionEvent;
95
- const event = mode !== undefined && mode !== 'sync' && typeof raw?.operation === 'string' && raw.operation
96
- && isExternalEventMode(raw.mode)
97
- ? { operation: raw.operation, mode: raw.mode }
98
- : undefined;
99
- return { ...(mode ? { mode } : {}), ...(event ? { event } : {}) };
100
- }
101
80
  /**
102
81
  * The mode and event an external task is written with: what the author passed,
103
82
  * else what the connector library records for the object. `check` and
package/dist/check.js CHANGED
@@ -139,10 +139,14 @@ const OWN_NODE_ERRORS = new WeakSet();
139
139
  */
140
140
  function serializerRefusals(built, compile, found) {
141
141
  const collected = [];
142
+ const warned = [];
142
143
  let flow;
143
144
  let stoppedAt;
144
145
  try {
145
- flow = serialize(built, { ...compile, collect: (r) => collected.push(r) });
146
+ // A stale `.layout()` key is the one serializer warning `check` repeats: compile
147
+ // drops the entry, and the author can only see that here (#1994).
148
+ flow = serialize(built, { ...compile, collect: (r) => collected.push(r), warn: (w) => { if (w.code === 'LAYOUT_UNKNOWN_KEY')
149
+ warned.push(w); } });
146
150
  // Collection stopped: the refusal that stopped it is the last one reported.
147
151
  const stop = collected[collected.length - 1];
148
152
  if (flow === undefined && stop)
@@ -182,6 +186,13 @@ function serializerRefusals(built, compile, found) {
182
186
  ...(r.nodeId !== undefined ? { nodeId: r.nodeId } : {}),
183
187
  });
184
188
  }
189
+ for (const w of warned) {
190
+ const key = `${w.code}\n\n${w.message}`;
191
+ if (seen.has(key))
192
+ continue;
193
+ seen.add(key);
194
+ out.push({ level: 'warning', code: w.code, message: w.message });
195
+ }
185
196
  return { diagnostics: out, flow, ...(stoppedAt ? { stoppedAt } : {}) };
186
197
  }
187
198
  /**
@@ -0,0 +1,38 @@
1
+ /**
2
+ * core/external-execution — how an external agent or automation runs, as the
3
+ * connector library records it.
4
+ *
5
+ * Integration Service keeps it on the connector object, not on the registry
6
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
7
+ * `hybrid` object, the event it answers with. `registry build-library` and
8
+ * `registry prepare` copy both from `uip is resources describe` onto the
9
+ * entry's `operation` (`registry/library-build/enrich.ts`, #1369). Case and Flow
10
+ * read them through {@link libraryExecution}.
11
+ */
12
+ /** An external object's execution type, as Integration Service reports it. */
13
+ export type ExecutionMode = 'sync' | 'async' | 'hybrid';
14
+ /** The event an `async` or `hybrid` object answers with: its operation and how it is received. */
15
+ export interface ExecutionEvent {
16
+ operation: string;
17
+ mode: 'polling' | 'webhooks';
18
+ }
19
+ /** The event modes Integration Service reports for an object's events. */
20
+ export declare function isExternalEventMode(value: unknown): value is ExecutionEvent['mode'];
21
+ /** The execution types an external object can have: the values Integration Service reports. */
22
+ export declare function isExternalExecutionMode(value: unknown): value is ExecutionMode;
23
+ /**
24
+ * The execution facts the connector library records for the object
25
+ * (`operation.executionType` and `operation.executionEvent`, from
26
+ * `registry build-library` / `registry prepare`, #1369). A value the SDK does
27
+ * not know is ignored, as if it were absent. A `sync` object has no event.
28
+ *
29
+ * For example `{ executionType: 'hybrid', executionEvent: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`
30
+ * reads as `{ mode: 'hybrid', event: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`.
31
+ *
32
+ * @param operation - A library entry's `operation`.
33
+ * @returns The recorded mode and event; `{}` when the library records none.
34
+ */
35
+ export declare function libraryExecution(operation: unknown): {
36
+ mode?: ExecutionMode;
37
+ event?: ExecutionEvent;
38
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * core/external-execution — how an external agent or automation runs, as the
3
+ * connector library records it.
4
+ *
5
+ * Integration Service keeps it on the connector object, not on the registry
6
+ * node: `executionType` (`sync`, `async` or `hybrid`) and, for an `async` or
7
+ * `hybrid` object, the event it answers with. `registry build-library` and
8
+ * `registry prepare` copy both from `uip is resources describe` onto the
9
+ * entry's `operation` (`registry/library-build/enrich.ts`, #1369). Case and Flow
10
+ * read them through {@link libraryExecution}.
11
+ */
12
+ /** The event modes Integration Service reports for an object's events. */
13
+ export function isExternalEventMode(value) {
14
+ return value === 'polling' || value === 'webhooks';
15
+ }
16
+ /** The execution types an external object can have: the values Integration Service reports. */
17
+ export function isExternalExecutionMode(value) {
18
+ return value === 'sync' || value === 'async' || value === 'hybrid';
19
+ }
20
+ /**
21
+ * The execution facts the connector library records for the object
22
+ * (`operation.executionType` and `operation.executionEvent`, from
23
+ * `registry build-library` / `registry prepare`, #1369). A value the SDK does
24
+ * not know is ignored, as if it were absent. A `sync` object has no event.
25
+ *
26
+ * For example `{ executionType: 'hybrid', executionEvent: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`
27
+ * reads as `{ mode: 'hybrid', event: { operation: 'TRIGGER_CREATED', mode: 'polling' } }`.
28
+ *
29
+ * @param operation - A library entry's `operation`.
30
+ * @returns The recorded mode and event; `{}` when the library records none.
31
+ */
32
+ export function libraryExecution(operation) {
33
+ const op = (operation ?? {});
34
+ const mode = isExternalExecutionMode(op.executionType) ? op.executionType : undefined;
35
+ const raw = op.executionEvent;
36
+ const event = mode !== undefined && mode !== 'sync' && typeof raw?.operation === 'string' && raw.operation
37
+ && isExternalEventMode(raw.mode)
38
+ ? { operation: raw.operation, mode: raw.mode }
39
+ : undefined;
40
+ return { ...(mode ? { mode } : {}), ...(event ? { event } : {}) };
41
+ }
@@ -570,7 +570,7 @@ export declare const REFUSALS: {
570
570
  readonly LAYOUT_AUTO_FAILED: "lowering";
571
571
  readonly LAYOUT_EDGE_AMBIGUOUS: "lowering";
572
572
  readonly LAYOUT_EDGE_KEY_FORM: "lowering";
573
- readonly LAYOUT_UNKNOWN_KEY: "lowering";
573
+ readonly LAYOUT_UNKNOWN_KEY: "lint";
574
574
  readonly LIBRARY_NOT_FOUND: "lowering";
575
575
  readonly LIBRARY_REQUIRED: "lowering";
576
576
  readonly LIST_OUTPUT_WRAPPER: "lint";
@@ -646,7 +646,7 @@ export const REFUSALS = {
646
646
  LAYOUT_AUTO_FAILED: 'lowering',
647
647
  LAYOUT_EDGE_AMBIGUOUS: 'lowering',
648
648
  LAYOUT_EDGE_KEY_FORM: 'lowering',
649
- LAYOUT_UNKNOWN_KEY: 'lowering',
649
+ LAYOUT_UNKNOWN_KEY: 'lint',
650
650
  LIBRARY_NOT_FOUND: 'lowering',
651
651
  LIBRARY_REQUIRED: 'lowering',
652
652
  LIST_OUTPUT_WRAPPER: 'lint',
package/dist/merge.js CHANGED
@@ -291,6 +291,88 @@ function keepOriginalSourcesInSubflows(original, subflows, baseline) {
291
291
  nodes[i] = withOriginalSource(nodes[i], origNodes.get(nodes[i].id), baseNodes.get(nodes[i].id));
292
292
  }
293
293
  }
294
+ /** The `.layout()` fields a node entry carries. */
295
+ const LAYOUT_FIELDS = ['position', 'size', 'collapsed'];
296
+ /** A node's ui as the designer reads it: its `layout.nodes` entry over `node.ui`, field by field. */
297
+ function drawnUi(scope, n) {
298
+ if (!n)
299
+ return undefined;
300
+ const entry = layoutNodesOf(scope)?.[n.id];
301
+ const own = isRecord(n.ui) ? n.ui : undefined;
302
+ return entry || own ? { ...own, ...entry } : undefined;
303
+ }
304
+ /**
305
+ * Apply each `.layout()` field the author changed onto `into`'s node of the same id:
306
+ * a field whose edited value differs from the baseline's (the no-edit round trip) is
307
+ * the author's, and is written where `into` already keeps that node's field (its
308
+ * `layout.nodes` entry, else `node.ui`). A node compile left unplaced in the edit
309
+ * (`isUnplaced`) has no author layout, and a node the baseline lacks is added, so
310
+ * placement owns both. A scope whose source has no `.layout()` at all is all
311
+ * unplaced: merge's compiles keep the placeholder row there and flag every node
312
+ * (`SerializeOpts.autoLayout: false`), so compile's own layout of the edit is
313
+ * never read as an author move.
314
+ *
315
+ * Example: the decompiled source has `review: at(640, 144)`, the author writes
316
+ * `review: at(640, 304)`; the merged file's `layout.nodes.review.position` is
317
+ * `{ x: 640, y: 304 }`, and every other node keeps the original's.
318
+ */
319
+ function applyLayoutEdits(into, edited, baseline, isUnplaced, originalEdges = []) {
320
+ const editedNodes = byId(edited?.nodes);
321
+ const baseNodes = byId(baseline?.nodes);
322
+ const moved = new Set();
323
+ const store = layoutNodesOf(into);
324
+ for (const n of into.nodes ?? []) {
325
+ const e = drawnUi(edited, editedNodes.get(n.id));
326
+ const b = drawnUi(baseline, baseNodes.get(n.id));
327
+ if (!e || !b || isUnplaced(e))
328
+ continue;
329
+ for (const field of LAYOUT_FIELDS) {
330
+ if (e[field] === undefined || sortedJson(e[field]) === sortedJson(b[field]))
331
+ continue;
332
+ const value = jsonClone(e[field]);
333
+ const entry = store?.[n.id];
334
+ if (isRecord(entry) && (field in entry || !(isRecord(n.ui) && field in n.ui)))
335
+ entry[field] = value;
336
+ else if (isRecord(n.ui))
337
+ n.ui[field] = value;
338
+ else if (store && Object.keys(store).length > 0)
339
+ store[n.id] = { ...(isRecord(entry) ? entry : {}), [field]: value };
340
+ else
341
+ n.ui = { [field]: value };
342
+ if (field === 'position')
343
+ moved.add(n.id);
344
+ }
345
+ }
346
+ dropStaleRoutes(into, moved, originalEdges);
347
+ }
348
+ /**
349
+ * Drop the stored route of every edge into or out of a node the author moved: its
350
+ * bends were drawn for the old position, and with no route the designer draws the
351
+ * edge afresh (as it does after a drag). Studio Web keeps routes in `layout.edges`,
352
+ * keyed by edge id; an SDK file may also carry them on the edge's `ui`.
353
+ *
354
+ * Example: `mark` moves from y 144 to 464; the original's route for `big -> mark`,
355
+ * bending at y 144, is dropped instead of drawing a dog-leg back to the old row.
356
+ */
357
+ function dropStaleRoutes(scope, moved, originalEdges) {
358
+ if (moved.size === 0)
359
+ return;
360
+ const routes = scope.layout?.edges;
361
+ // The original's edge ids too: the route map is the original's, keyed by its ids.
362
+ for (const e of [...(scope.edges ?? []), ...originalEdges]) {
363
+ if (!moved.has(e.sourceNodeId) && !moved.has(e.targetNodeId))
364
+ continue;
365
+ if (isRecord(routes) && e.id !== undefined)
366
+ delete routes[e.id];
367
+ const ui = e.ui;
368
+ if (isRecord(ui)) {
369
+ delete ui.waypoints;
370
+ delete ui.routedWaypoints;
371
+ if (Object.keys(ui).length === 0)
372
+ delete e.ui;
373
+ }
374
+ }
375
+ }
294
376
  /** The original's `layout.nodes` map, when it has one. */
295
377
  function layoutNodesOf(f) {
296
378
  const nodes = f.layout?.nodes;
@@ -478,7 +560,20 @@ function mergeFlowFindings(original, edited, options) {
478
560
  // positions — see node-placement.ts. Root scope only: a
479
561
  // subflow is taken from `edited` whole, layout included. ──
480
562
  const editedNodes = [...(edited.nodes ?? []), ...Object.values(edited.subflows ?? {}).flatMap((sf) => sf?.nodes ?? [])];
481
- placeAddedNodes(finalNodes, result.edges, positionStoreOf(original) && layoutNodesOf(result), (id) => !origNodes.has(id), unplacedRule(editedNodes));
563
+ const isUnplaced = unplacedRule(editedNodes);
564
+ // ── Layout edits: a `.layout()` entry the author changed (edited differs from
565
+ // the baseline) is an edit like any other, so it lands on the original's node,
566
+ // root and every subflow, before added nodes are placed around it (#1994). ──
567
+ if (options.baseline) {
568
+ const scopes = [
569
+ [{ nodes: finalNodes, edges: result.edges, layout: result.layout }, edited, options.baseline, original.edges ?? []],
570
+ ...Object.entries(result.subflows).map(([k, sf]) => [sf, edited.subflows?.[k],
571
+ options.baseline.subflows?.[k], original.subflows?.[k]?.edges ?? []]),
572
+ ];
573
+ for (const [into, from, base, origEdges] of scopes)
574
+ applyLayoutEdits(into, from, base, isUnplaced, origEdges);
575
+ }
576
+ placeAddedNodes(finalNodes, result.edges, positionStoreOf(original) && layoutNodesOf(result), (id) => !origNodes.has(id), isUnplaced);
482
577
  // An added root node is where merge put it now, not where compile did: drop its
483
578
  // mark. A subflow taken whole keeps compile's layout and its marks, so a later
484
579
  // decompile still leaves it to compile; an original node keeps the original's ui.
@@ -3,6 +3,7 @@ import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../
3
3
  import { PULL_COMMAND, prepareCommand } from '../../../core/cli-spelling.js';
4
4
  import { carriedConnector, carriedDefinitionMismatch, carriedOperationOf, carriedOperationRefusal, } from '../../../core/carried-connector-operation.js';
5
5
  import { buildConfiguration, readConfigurationIdentity } from '../../../core/connector-configuration.js';
6
+ import { libraryExecution } from '../../../core/external-execution.js';
6
7
  import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, replayInputsOf, transportHttpMethod } from '../../../core/connector-inputs.js';
7
8
  import { ConnectorResolveError } from '../../../core/connector-resolve-error.js';
8
9
  import { definitionHasErrorPort } from '../../../core/error-port.js';
@@ -240,6 +241,13 @@ function serializeConnector(spec, ctx) {
240
241
  }
241
242
  })();
242
243
  const replayInputs = replayInputsOf(connectorInputs);
244
+ // An external agent or automation runs the way its connector object says
245
+ // (#1988). The Flow runtime reads it off the detail: `executionType` picks
246
+ // the sync or async service type, and an async / hybrid object's event is
247
+ // what the node waits on. `uip maestro flow nodes configure` writes the same
248
+ // three keys. Without them a sync agent runs as the registry's
249
+ // `Intsvc.AsyncAgentExecution` and waits for an event that never comes.
250
+ const execution = libraryExecution(rc.entry?.operation);
243
251
  const detail = {
244
252
  connector: rc.connectorKey,
245
253
  method: transportHttpMethod(rc.httpMethod),
@@ -252,7 +260,9 @@ function serializeConnector(spec, ctx) {
252
260
  inputMetadata: {},
253
261
  errorState: { hasError: false },
254
262
  telemetryData: { connectorKey: rc.connectorKey, connectorName: rc.connectorName },
255
- configuration: buildConfiguration(rc.entry, rc.version, replayInputs, ctx.nodeId),
263
+ configuration: buildConfiguration(rc.entry, rc.version, replayInputs, ctx.nodeId, execution.mode ?? null),
264
+ ...(execution.mode ? { executionType: execution.mode } : {}),
265
+ ...(execution.event ? { eventMode: execution.event.mode, eventType: execution.event.operation } : {}),
256
266
  ...(rc.activityTypeId ? { uiPathActivityTypeId: rc.activityTypeId } : {}),
257
267
  ...(conn ? { connectionId: conn, connectionResourceId: conn } : {}),
258
268
  ...(folder ? { connectionFolderKey: folder } : {}),
@@ -19,6 +19,8 @@ export declare function discoverOperationName(ctx: BuildContext, entry: LibraryE
19
19
  * payload; `objectDisplayName` and `display.operationLabel` fill gaps only.
20
20
  */
21
21
  export declare function applyDescribe(entry: LibraryEntry, data: unknown): LibraryEntry;
22
+ /** Whether `operation` is an external agent's or automation's: an `AgentExecution` / `ProcessExecution` subtype. */
23
+ export declare function isExternalOperation(operation: unknown): boolean;
22
24
  /**
23
25
  * Record an external agent's or automation's execution facts on its operation,
24
26
  * from the describe payload (#1369, #1387).
@@ -95,6 +95,10 @@ export function applyDescribe(entry, data) {
95
95
  }
96
96
  /** The operation subtypes Case's and BPMN's external agent / workflow tasks run. */
97
97
  const EXTERNAL_SUBTYPES = new Set(["AgentExecution", "ProcessExecution"]);
98
+ /** Whether `operation` is an external agent's or automation's: an `AgentExecution` / `ProcessExecution` subtype. */
99
+ export function isExternalOperation(operation) {
100
+ return EXTERNAL_SUBTYPES.has(String(get(operation, "subType") ?? ""));
101
+ }
98
102
  /** The execution types Integration Service reports, as Case and BPMN read them. */
99
103
  const EXECUTION_TYPES = new Set(["sync", "async", "hybrid"]);
100
104
  /**
@@ -116,7 +120,7 @@ const EXECUTION_TYPES = new Set(["sync", "async", "hybrid"]);
116
120
  * leaves the entry as it was, so an older build stays byte-identical.
117
121
  */
118
122
  export function applyExternalExecution(operation, data) {
119
- if (!EXTERNAL_SUBTYPES.has(String(get(operation, "subType") ?? "")))
123
+ if (!isExternalOperation(operation))
120
124
  return;
121
125
  // Stored only as one of the three values Case and BPMN read, lowercased: a
122
126
  // `Hybrid` kept verbatim would be ignored downstream and read as "no record".
@@ -169,6 +169,19 @@ export declare function probeSkippedReason(key: string): string;
169
169
  export declare function catalogRefreshPartialLine(reason: string): string;
170
170
  /** The warning when that pull failed; the fallback continues against the local copy. */
171
171
  export declare function catalogRefreshFailedLine(reason: string): string;
172
+ /**
173
+ * The warning when an external agent's or automation's describe reported no
174
+ * execution type (#1988). A `uip` older than uip#5702 does not report it, and
175
+ * without it the compiled Flow node keeps the registry's service type, so a
176
+ * sync agent runs as async and waits for an event that never comes.
177
+ */
178
+ export declare function unrecordedExecutionLine(nodeType: string): string;
179
+ /**
180
+ * The warning when an `async` or `hybrid` external object's describe names no
181
+ * event it answers with: the compiled node has nothing to wait on. The CLI's
182
+ * `nodes configure` warns the same (`externalExecutionWarning`).
183
+ */
184
+ export declare function missingExecutionEventLine(nodeType: string, mode: string): string;
172
185
  /** The note when the author's `--action` spelling was not the entry's id. */
173
186
  export declare function actionCanonicalizedLine(given: string, actionId: string): string;
174
187
  /**
@@ -377,6 +377,27 @@ export function catalogRefreshPartialLine(reason) {
377
377
  export function catalogRefreshFailedLine(reason) {
378
378
  return `${PREFIX}registry pull --force failed (${reason}); continuing with the local catalog copy, which may be stale.`;
379
379
  }
380
+ /**
381
+ * The warning when an external agent's or automation's describe reported no
382
+ * execution type (#1988). A `uip` older than uip#5702 does not report it, and
383
+ * without it the compiled Flow node keeps the registry's service type, so a
384
+ * sync agent runs as async and waits for an event that never comes.
385
+ */
386
+ export function unrecordedExecutionLine(nodeType) {
387
+ return (`${PREFIX}WARN: Integration Service reported no execution type (sync, async or hybrid) for the external ` +
388
+ `operation ${nodeType}, so the compiled node keeps the registry's service type and may wait on an event that ` +
389
+ "never comes. A `uip` older than the release with ExecutionType in `uip is resources describe` does not " +
390
+ "report it: run `uip update` and prepare again.");
391
+ }
392
+ /**
393
+ * The warning when an `async` or `hybrid` external object's describe names no
394
+ * event it answers with: the compiled node has nothing to wait on. The CLI's
395
+ * `nodes configure` warns the same (`externalExecutionWarning`).
396
+ */
397
+ export function missingExecutionEventLine(nodeType, mode) {
398
+ return (`${PREFIX}WARN: the external operation ${nodeType} runs ${mode}, but Integration Service names no event it ` +
399
+ "answers with, so the compiled node has nothing to wait on and may never finish.");
400
+ }
380
401
  /** The note when the author's `--action` spelling was not the entry's id. */
381
402
  export function actionCanonicalizedLine(given, actionId) {
382
403
  return ` action: "${given}" is Integration Service activity ${actionId}; the entry is written under that id.`;
@@ -31,7 +31,8 @@ import { PACKAGE_NAME } from "../../package-name.js";
31
31
  import { afterLast } from "../compat/pystr.js";
32
32
  import { extractCanonical, isHttpPassthrough, nodeOf } from "../library-build/canonical.js";
33
33
  import { createBuildContext, isResourcesList, registryProbe } from "../library-build/context.js";
34
- import { enrichEntry } from "../library-build/enrich.js";
34
+ import { enrichEntry, isExternalOperation } from "../library-build/enrich.js";
35
+ import { libraryExecution } from "../../core/external-execution.js";
35
36
  import { expandGenericForConnector, genericTemplatesByOp } from "../library-build/generic-expand.js";
36
37
  import { planLibrary } from "../library-build/plan.js";
37
38
  import { MemoryResponseCache } from "../uip/response-cache.js";
@@ -43,7 +44,7 @@ import { prepareEvent } from "./event.js";
43
44
  import { integrationServiceEntry } from "./integration-service.js";
44
45
  import { descriptorUsage } from "./handoff.js";
45
46
  import { ResolutionsExhausted, allParentsResolved, resolvedParentValues, writeResolutions } from "./ledger.js";
46
- import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, unresolvedOperationMessage, planRowReplacedLine, } from "./messages.js";
47
+ import { PrepareRefusal, ambiguousLabelsMessage, connectionChoiceLine, bindingsLine, bpmnConnectorUsageLines, candidateLabel, connectionLine, describeNextLine, generatedModulesLine, genericActionNeedsObjectMessage, inputFieldNote, flagDiffersFromSourceLine, keptSchemaMessage, labelTakenMessage, lookupVocabularyLines, missingGenericSchemaMessage, missingParentsNote, nextLine, noCanonicalEntryMessage, objectFlagsOnlyForGenericMessage, objectNoteLine, objectRecordedLine, parentFieldNamesMismatchMessage, parentOnlyMessage, prefixed, preparedFromIntegrationServiceLine, actionCanonicalizedLine, catalogRefreshFailedLine, catalogRefreshPartialLine, probeSkippedReason, refreshingCatalogLine, rememberedAbsenceLine, preparedSummaryLine, rejectedParentFieldsMessage, rerunAgainstLine, resolvedParentsNote, registryGetFailedMessage, sharedLabelMessage, sourceLabelSuffix, tsNote, partlyUnreadableLabelLine, unreadableLabelLine, missingExecutionEventLine, unrecordedExecutionLine, unresolvedOperationMessage, planRowReplacedLine, } from "./messages.js";
47
48
  import { ObjectMatchRefusal, RESOLUTIONS_FILENAME, matchObject, recordObjectResolution } from "./objects.js";
48
49
  import { countInputFields, keepPreparedSchema, lookupSpecsFromOverlay, mergeFilesInto, parentFields as overlayParentFields, schemaActionParents, } from "./overlay.js";
49
50
  import { declaredParents, objectActionRequest, objectActionSpecs, parseFields } from "./parents.js";
@@ -519,8 +520,16 @@ async function prepareOnConnection(options, ports, connected, registryRefresh) {
519
520
  if (objectName || options.allObjects)
520
521
  throw new PrepareRefusal(objectFlagsOnlyForGenericMessage(), "OBJECT_NOT_GENERIC");
521
522
  // An Integration Service entry IS the describe; there is nothing to enrich it with.
522
- if (fromIntegrationService === undefined)
523
+ if (fromIntegrationService === undefined) {
523
524
  entry = await enrichEntry(ctx, entry); // full schema via --connection-id
525
+ if (isExternalOperation(entry.operation)) {
526
+ const { mode, event } = libraryExecution(entry.operation);
527
+ if (mode === undefined)
528
+ warn(unrecordedExecutionLine(entry.nodeType));
529
+ else if (mode !== "sync" && event === undefined)
530
+ warn(missingExecutionEventLine(entry.nodeType, mode));
531
+ }
532
+ }
524
533
  preparedEntries = [entry];
525
534
  }
526
535
  const entryNodeType = entry.nodeType;
package/dist/serialize.js CHANGED
@@ -330,23 +330,42 @@ function emitStickyNotes(built, scope, claimNoteId) {
330
330
  * Apply an author `.layout()` to a finished scope (design §2.3): node entries
331
331
  * mutate the emitted nodes' `ui` in place; edge entries resolve their
332
332
  * `"from->to"` keys to real edge ids and are returned for the caller to attach
333
- * as the persisted `layout.edges` section. Unknown keys are compile errors —
334
- * a silently dropped layout entry would read as "the designer moved my node".
333
+ * as the persisted `layout.edges` section. A key that names no step, or an edge
334
+ * key that matches no edge, is dropped with a `LAYOUT_UNKNOWN_KEY` warning
335
+ * (#1994): it is a leftover of a removed or renamed step, and refusing the flow
336
+ * over it blocked every merge of such an edit. Example: `.layout({ nodes: { gone:
337
+ * at(640, 144) } })` after `gone` was deleted warns
338
+ * `flow "x".layout: "gone" names no step or node in this flow …` and compiles.
335
339
  */
336
- function applyAuthorLayout(layout, scope, where, author) {
340
+ function applyAuthorLayout(layout, scope, where, author, warn) {
337
341
  if (!layout)
338
342
  return undefined;
343
+ // A key that names nothing is a leftover (the step was removed or renamed since
344
+ // the layout was written): it places nothing, so it is dropped with a warning
345
+ // rather than refusing the whole flow (#1994).
346
+ // A typo looks the same as a leftover, so the warning names the closest key that
347
+ // `.layout()` does not already place: `reveiw` -> "did you mean "review"?".
348
+ const named = new Set(Object.keys(layout.nodes ?? {}));
349
+ const keys = [...new Set([...scope.stepNodeId.keys(), ...(scope.noteNodeId?.keys() ?? []), ...scope.nodes.map((n) => String(n.id))])];
350
+ const stale = (message, key) => {
351
+ const near = key === undefined ? undefined : nearestName(key, keys.filter((k) => !named.has(k)));
352
+ const fix = near !== undefined
353
+ ? `Did you mean "${near}"? Rename the entry to the step it places, or remove it if that step was deleted.`
354
+ : 'Rename the entry to the step it places, or remove it if that step was deleted.';
355
+ warn?.({ code: 'LAYOUT_UNKNOWN_KEY', message: `${where}.layout: ${message} Compile ignores the entry. ${fix}` });
356
+ return undefined;
357
+ };
339
358
  const resolveId = (key) => {
340
359
  const id = scope.stepNodeId.get(key)
341
360
  ?? scope.noteNodeId?.get(key)
342
361
  ?? (scope.nodes.some((n) => n.id === key) ? key : undefined);
343
- if (!id) {
344
- throw new CompileRefusal('LAYOUT_UNKNOWN_KEY', `${where}.layout: "${key}" names no step or node in this flow. Layout keys are the flow's own step names (plus the trigger id and "end").`);
345
- }
346
- return id;
362
+ return id ?? stale(`"${key}" names no step or node in this flow (layout keys are the flow's own step names, plus the trigger id and "end").`, key);
347
363
  };
348
364
  for (const [key, nl] of Object.entries(layout.nodes ?? {})) {
349
- const node = scope.nodes.find((n) => n.id === resolveId(key));
365
+ const id = resolveId(key);
366
+ if (id === undefined)
367
+ continue;
368
+ const node = scope.nodes.find((n) => n.id === id);
350
369
  node.ui = node.ui ?? {};
351
370
  node.ui.position = { x: nl.position.x, y: nl.position.y };
352
371
  author.placed.add(node.id);
@@ -365,7 +384,13 @@ function applyAuthorLayout(layout, scope, where, author) {
365
384
  if (!m)
366
385
  throw new CompileRefusal('LAYOUT_EDGE_KEY_FORM', `${where}.layout: edge key "${key}" must be "<fromStep>-><toStep>".`);
367
386
  const [src, tgt] = [resolveId(m[1].trim()), resolveId(m[2].trim())];
387
+ if (src === undefined || tgt === undefined)
388
+ continue;
368
389
  const matches = scope.edges.filter((e) => e.sourceNodeId === src && e.targetNodeId === tgt);
390
+ if (matches.length === 0) {
391
+ stale(`edge "${key}" matches no emitted edge.`);
392
+ continue;
393
+ }
369
394
  if (matches.length !== 1) {
370
395
  throw new CompileRefusal('LAYOUT_EDGE_AMBIGUOUS', `${where}.layout: edge "${key}" matches ${matches.length} emitted edges; expected exactly 1.`);
371
396
  }
@@ -2017,7 +2042,7 @@ function serializeFlow(built, opts) {
2017
2042
  assertHitlExitInvariant(scope.nodes, scope.edges, legacyCompletedNodes);
2018
2043
  typeAgentInputSchemas(scope, globals);
2019
2044
  emitStickyNotes(child, scope, claimNoteId);
2020
- const layoutEdges = applyAuthorLayout(child.layout, scope, `subflow "${nodeId}"`, authorGeometry);
2045
+ const layoutEdges = applyAuthorLayout(child.layout, scope, `subflow "${nodeId}"`, authorGeometry, opts.warn);
2021
2046
  assertNodeEnvelope(scope.nodes, `subflow "${nodeId}"`);
2022
2047
  return {
2023
2048
  nodes: scope.nodes,
@@ -3667,7 +3692,7 @@ function serializeFlow(built, opts) {
3667
3692
  assertHitlExitInvariant(root.nodes, root.edges, legacyCompletedNodes);
3668
3693
  typeAgentInputSchemas(root, globals);
3669
3694
  emitStickyNotes(built, root, claimNoteId);
3670
- const rootLayoutEdges = applyAuthorLayout(built.layout, root, `flow "${built.id}"`, authorGeometry);
3695
+ const rootLayoutEdges = applyAuthorLayout(built.layout, root, `flow "${built.id}"`, authorGeometry, opts.warn);
3671
3696
  assertNodeEnvelope(root.nodes, `flow "${built.id}"`);
3672
3697
  // The FILE-FORMAT version this document declares: the author's
3673
3698
  // `.schemaVersion()` when they set one, else the profile's write floor. It is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.114.0",
3
+ "version": "6.116.0",
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",
@@ -124,5 +124,5 @@
124
124
  "@types/node": "^22.7.0",
125
125
  "esbuild": "^0.28.1"
126
126
  },
127
- "gitref": "5597e702b2d95b80ff1e333d8cdfce8ca05b8601"
127
+ "gitref": "af42df6616e52079ecf678c69fdb763518cc61bf"
128
128
  }