@uipath/maestro-builder-sdk 6.33.0 → 6.33.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/api-index.md CHANGED
@@ -287,10 +287,10 @@ could hand you spans for a version you do not have.
287
287
  | `CaseAppConfig` | interface | `dist/case/case-sdk.d.ts:601-607` | Supporting types | Typed configuration for the generated Case App. |
288
288
  | `CaseAppDetailValue` | type | `dist/case/case-sdk.d.ts:590-591` | Supporting types | A value displayed in one Case App section. |
289
289
  | `CaseAppSection` | interface | `dist/case/case-sdk.d.ts:592-600` | Supporting types | One summary section in the generated Case App. |
290
- | `CaseBuilder` | class | `dist/case/case-sdk.d.ts:1050-1293` | Builders | 17 member(s) |
290
+ | `CaseBuilder` | class | `dist/case/case-sdk.d.ts:1056-1299` | Builders | 17 member(s) |
291
291
  | `CaseLayout` | interface | `dist/case/case-sdk.d.ts:629-640` | Supporting types | Optional Case designer layout, keyed by author-level stage and trigger names. |
292
292
  | `CaseNodeLayout` | interface | `dist/case/case-sdk.d.ts:608-628` | Supporting types | Designer-only fields the shipped Case transformer moves into `layout.nodes[id]`. |
293
- | `casePlan` | function | `dist/case/case-sdk.d.ts:1294-1300` | Case authoring | Start building a case plan with the given id. |
293
+ | `casePlan` | function | `dist/case/case-sdk.d.ts:1300-1306` | Case authoring | Start building a case plan with the given id. |
294
294
  | `CaseRule` | interface | `dist/case/case-sdk.d.ts:78-81` | Supporting types | A single DNF rule. |
295
295
  | `CaseRuleGrid` | type | `dist/case/case-sdk.d.ts:113-114` | Supporting types | One rule, one AND-group, or a complete OR-of-AND condition grid. |
296
296
  | `CaseRuleInput` | type | `dist/case/case-sdk.d.ts:111-112` | Supporting types | A concrete rule or a pure expression gate resolved by its receiving slot. |
@@ -329,7 +329,7 @@ could hand you spans for a version you do not have.
329
329
  | `SelectNextStageSpec` | interface | `dist/case/case-sdk.d.ts:318-336` | Supporting types | Data Fabric entity used by the Case runtime to deliver a person's next-stage selection. |
330
330
  | `SlaOpts` | interface | `dist/case/case-sdk.d.ts:166-185` | Option shapes | 5 field(s) |
331
331
  | `SlaUnit` | type | `dist/case/case-sdk.d.ts:115-116` | Supporting types | SLA deadline unit. |
332
- | `StageBuilder` | class | `dist/case/case-sdk.d.ts:978-1049` | Builders | 6 member(s) |
332
+ | `StageBuilder` | class | `dist/case/case-sdk.d.ts:978-1055` | Builders | 6 member(s) |
333
333
  | `StageExitType` | type | `dist/case/case-sdk.d.ts:317` | Supporting types | |
334
334
  | `TaskBuilder` | class | `dist/case/case-sdk.d.ts:717-977` | Builders | 23 member(s) |
335
335
  | `TaskInputBinding` | interface | `dist/case/case-sdk.d.ts:499-506` | Supporting types | A task input binding: a resource input parameter set to a literal or a `=`-expression. |
@@ -58,7 +58,7 @@ not find it either.
58
58
  | `aliases` | property | `LookupSpec` | `dist/core/lookups.d.ts:31-32` |
59
59
  | `allErrors` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:803-804` |
60
60
  | `allowAdhocOptionalStageTasks` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:656-657` |
61
- | `allowAdhocTasks` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1149-1156` |
61
+ | `allowAdhocTasks` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1155-1162` |
62
62
  | `apiWorkflow` | property | `FlowActionSpecs` | `dist/core/actions.d.ts:1558-1561` |
63
63
  | `apiWorkflow` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:779-788` |
64
64
  | `app` | property | `EscalationRef` | `dist/core/actions.d.ts:1458-1485` |
@@ -103,7 +103,7 @@ not find it either.
103
103
  | `breakEnabled` | property | `DoWhileOptions` | `dist/flow-sdk.d.ts:519-520` |
104
104
  | `breakEnabled` | property | `LoopOptions` | `dist/flow-sdk.d.ts:506-510` |
105
105
  | `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3483-3488` |
106
- | `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1287-1292` |
106
+ | `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1293-1298` |
107
107
  | `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1649-1655` |
108
108
  | `businessRule` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2527-2573` |
109
109
  | `by` | property | `LookupResolution` | `dist/core/lookups.d.ts:164` |
@@ -112,7 +112,7 @@ not find it either.
112
112
  | `callContext` | property | `EndCallInputs` | `dist/core/actions.d.ts:247-252` |
113
113
  | `callContext` | property | `VoiceAgentInputs` | `dist/core/actions.d.ts:290-295` |
114
114
  | `cancelActivity` | property | `BoundaryOpts` | `dist/bpmn/bpmn-sdk.d.ts:744-745` |
115
- | `caseApp` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1128-1148` |
115
+ | `caseApp` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1134-1154` |
116
116
  | `caseAppConfig` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:655` |
117
117
  | `caseAppEnabled` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:654` |
118
118
  | `caseExit` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:660` |
@@ -130,7 +130,7 @@ not find it either.
130
130
  | `collection` | property | `LoopSpec` | `dist/bpmn/bpmn-sdk.d.ts:79-80` |
131
131
  | `collection` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:85-95` |
132
132
  | `color` | property | `StickyNote` | `dist/flow-sdk.d.ts:708-709` |
133
- | `completeWhen` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1267-1277` |
133
+ | `completeWhen` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1273-1283` |
134
134
  | `completion` | property | `LoopSpec` | `dist/bpmn/bpmn-sdk.d.ts:85-86` |
135
135
  | `completionCondition` | property | `LoopOptions` | `dist/flow-sdk.d.ts:501-505` |
136
136
  | `condition` | property | `BpmnFlow` | `dist/bpmn/bpmn-sdk.d.ts:350-351` |
@@ -219,7 +219,7 @@ not find it either.
219
219
  | `description` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:543` |
220
220
  | `description` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:532` |
221
221
  | `description` | property | `BuiltTrigger` | `dist/case/case-sdk.d.ts:200` |
222
- | `description` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1113-1119` |
222
+ | `description` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1119-1125` |
223
223
  | `description` | property | `ClientSideToolRef` | `dist/core/actions.d.ts:1230-1231` |
224
224
  | `description` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:1331-1335` |
225
225
  | `description` | property | `CustomGuardrail` | `dist/core/actions.d.ts:812` |
@@ -294,7 +294,7 @@ not find it either.
294
294
  | `entryPoint` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1385-1435` |
295
295
  | `entryPointId` | property | `ProcessMetadata` | `dist/bpmn/bpmn-sdk.d.ts:534-539` |
296
296
  | `entryPoints` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:778-779` |
297
- | `entryWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1022-1029` |
297
+ | `entryWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1028-1035` |
298
298
  | `entryWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:965-974` |
299
299
  | `err` | method | `StepList` | `dist/flow-sdk.d.ts:802-827` |
300
300
  | `error` | property | `BoundaryOpts` | `dist/bpmn/bpmn-sdk.d.ts:750-754` |
@@ -324,7 +324,7 @@ not find it either.
324
324
  | `every` | property | `ScheduledInputs` | `dist/flow-sdk.d.ts:150-160` |
325
325
  | `every` | property | `TimerTriggerOpts` | `dist/case/case-sdk.d.ts:215-223` |
326
326
  | `exception` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:542` |
327
- | `exceptionStage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1259-1266` |
327
+ | `exceptionStage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1265-1272` |
328
328
  | `exchangeId` | property | `ConversationalAgentSettings` | `dist/core/actions.d.ts:183-184` |
329
329
  | `exchangeId` | property | `SendMessageInputs` | `dist/nodes/conversation/flow/spec.d.ts:14-19` |
330
330
  | `exchangeLimit` | property | `ConversationContextInputs` | `dist/nodes/conversation/flow/spec.d.ts:40-43` |
@@ -334,7 +334,7 @@ not find it either.
334
334
  | `exit` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:547` |
335
335
  | `exitToStage` | property | `BuiltExitCondition` | `dist/case/case-sdk.d.ts:347-361` |
336
336
  | `exitToStage` | property | `ExitOpts` | `dist/case/case-sdk.d.ts:696-710` |
337
- | `exitWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1030-1037` |
337
+ | `exitWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1036-1043` |
338
338
  | `exponentialBase` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:801-802` |
339
339
  | `exposeError` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:245-251` |
340
340
  | `expression` | property | `BuiltSla` | `dist/case/case-sdk.d.ts:191-192` |
@@ -455,14 +455,14 @@ not find it either.
455
455
  | `id` | property | `SwitchArm` | `dist/flow-sdk.d.ts:369-375` |
456
456
  | `id` | property | `VarEntry` | `dist/bpmn/bpmn-sdk.d.ts:992-993` |
457
457
  | `identifier` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:652` |
458
- | `identifier` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1120-1127` |
458
+ | `identifier` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1126-1133` |
459
459
  | `identifierType` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:653` |
460
460
  | `implied` | property | `BpmnFlow` | `dist/bpmn/bpmn-sdk.d.ts:352-359` |
461
461
  | `impliedFlowIds` | property | `SugarRegistry` | `dist/bpmn/bpmn-sdk.d.ts:1949-1950` |
462
462
  | `inclusive` | property | `ChooseOpts` | `dist/bpmn/bpmn-sdk.d.ts:1820-1824` |
463
463
  | `inclusiveGateway` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2266-2273` |
464
464
  | `inlineAgent` | property | `FlowActionSpecs` | `dist/core/actions.d.ts:1590-1593` |
465
- | `input` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1178-1203` |
465
+ | `input` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1184-1209` |
466
466
  | `input` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1590-1602` |
467
467
  | `input` | property | `HumanTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1355-1356` |
468
468
  | `input` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1241-1242` |
@@ -551,7 +551,7 @@ not find it either.
551
551
  | `lanes` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:545` |
552
552
  | `layout` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:664-665` |
553
553
  | `layout` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:768-769` |
554
- | `layout` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1157-1177` |
554
+ | `layout` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1163-1183` |
555
555
  | `layout` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1327-1337` |
556
556
  | `legacyCompleted` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:252-284` |
557
557
  | `limit` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:95-100` |
@@ -636,7 +636,7 @@ not find it either.
636
636
  | `name` | property | `BuiltInValidatorGuardrail` | `dist/core/actions.d.ts:824` |
637
637
  | `name` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:519-520` |
638
638
  | `name` | property | `BuiltTrigger` | `dist/case/case-sdk.d.ts:198-199` |
639
- | `name` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1068-1074` |
639
+ | `name` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1074-1080` |
640
640
  | `name` | property | `CaseVarDecl` | `dist/case/case-sdk.d.ts:576` |
641
641
  | `name` | property | `CatchOpts` | `dist/bpmn/bpmn-sdk.d.ts:715-716` |
642
642
  | `name` | property | `ChooseOpts` | `dist/bpmn/bpmn-sdk.d.ts:1818-1819` |
@@ -738,7 +738,7 @@ not find it either.
738
738
  | `outcomePorts` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:230-244` |
739
739
  | `outcomes` | property | `EscalationRef` | `dist/core/actions.d.ts:1488-1493` |
740
740
  | `outcomes` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:211-225` |
741
- | `output` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1204-1216` |
741
+ | `output` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1210-1222` |
742
742
  | `output` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1603-1638` |
743
743
  | `output` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:90` |
744
744
  | `output` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3077-3085` |
@@ -914,7 +914,7 @@ not find it either.
914
914
  | `schemas` | property | `BuiltBpmn` | `dist/bpmn/bpmn-sdk.d.ts:509-510` |
915
915
  | `schemaVersion` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3375-3404` |
916
916
  | `schemaVersion` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:752-758` |
917
- | `schemaVersion` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1086-1112` |
917
+ | `schemaVersion` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1092-1118` |
918
918
  | `schemaVersion` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1470-1509` |
919
919
  | `scope` | property | `EscalationRecipient` | `dist/case/case-sdk.d.ts:121` |
920
920
  | `scopes` | property | `GuardrailSelector` | `dist/core/actions.d.ts:758` |
@@ -954,9 +954,9 @@ not find it either.
954
954
  | `skipCondition` | property | `QueueItemOpts` | `dist/bpmn/bpmn-sdk.d.ts:1323-1324` |
955
955
  | `skipCondition` | property | `ReceiveMessageOpts` | `dist/bpmn/bpmn-sdk.d.ts:1398-1399` |
956
956
  | `skipWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:931-937` |
957
- | `sla` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1278-1286` |
957
+ | `sla` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1284-1292` |
958
958
  | `sla` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:63-68` |
959
- | `sla` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1038-1046` |
959
+ | `sla` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1044-1052` |
960
960
  | `slaRules` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:661` |
961
961
  | `slaRules` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:548` |
962
962
  | `slug` | property | `McpToolRef` | `dist/core/actions.d.ts:1191-1192` |
@@ -976,7 +976,7 @@ not find it either.
976
976
  | `sourceTrigger` | property | `CaseVarDecl` | `dist/case/case-sdk.d.ts:582-588` |
977
977
  | `spec` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1547-1561` |
978
978
  | `splitPages` | property | `DocumentClassifyInputs` | `dist/nodes/document/flow/spec.d.ts:14-15` |
979
- | `stage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1251-1258` |
979
+ | `stage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1257-1264` |
980
980
  | `stage` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:29-39` |
981
981
  | `stages` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:659` |
982
982
  | `stages` | property | `CaseLayout` | `dist/case/case-sdk.d.ts:636-637` |
@@ -1027,7 +1027,7 @@ not find it either.
1027
1027
  | `target` | property | `TypedInputRow` | `dist/bpmn/typed-node.d.ts:203-204` |
1028
1028
  | `target` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:279-284` |
1029
1029
  | `task` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2293-2301` |
1030
- | `task` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1002-1021` |
1030
+ | `task` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1002-1027` |
1031
1031
  | `tasks` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:40-55` |
1032
1032
  | `taskTitle` | property | `EscalationRef` | `dist/core/actions.d.ts:1494-1495` |
1033
1033
  | `taxonomy` | property | `DocValidationInputs` | `dist/nodes/hitl/flow/spec.d.ts:91-92` |
@@ -1057,7 +1057,7 @@ not find it either.
1057
1057
  | `transformation` | property | `FieldMapping` | `dist/nodes/transform/flow/spec.d.ts:30-31` |
1058
1058
  | `trigger` | property | `BuiltEntryPoint` | `dist/flow-sdk.d.ts:737-738` |
1059
1059
  | `trigger` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:763-765` |
1060
- | `trigger` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1242-1250` |
1060
+ | `trigger` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1248-1256` |
1061
1061
  | `trigger` | property | `EscalationOpts` | `dist/case/case-sdk.d.ts:128-129` |
1062
1062
  | `trigger` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1364-1384` |
1063
1063
  | `trigger` | property | `StartOpts` | `dist/bpmn/bpmn-sdk.d.ts:624-671` |
@@ -1119,7 +1119,7 @@ not find it either.
1119
1119
  | `value` | property | `TypedContextRow` | `dist/bpmn/typed-node.d.ts:174-175` |
1120
1120
  | `value` | property | `TypedInputRow` | `dist/bpmn/typed-node.d.ts:205-206` |
1121
1121
  | `values` | property | `DataFabricCreateInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:132-137` |
1122
- | `var` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1217-1241` |
1122
+ | `var` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1223-1247` |
1123
1123
  | `var` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1639-1648` |
1124
1124
  | `var` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3059-3067` |
1125
1125
  | `var` | property | `TaskOutputBinding` | `dist/case/case-sdk.d.ts:512-513` |
@@ -1136,7 +1136,7 @@ not find it either.
1136
1136
  | `varSchema` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:257-271` |
1137
1137
  | `version` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:644-650` |
1138
1138
  | `version` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:751` |
1139
- | `version` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1075-1085` |
1139
+ | `version` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1081-1091` |
1140
1140
  | `version` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1435-1436` |
1141
1141
  | `version` | property | `ConnectorMeta` | `dist/core/connectors.d.ts:63` |
1142
1142
  | `version` | property | `ConnectorOpts` | `dist/core/actions.d.ts:14-15` |
@@ -1010,10 +1010,16 @@ declare class StageBuilder {
1010
1010
  * scheduler rules whether they share a set or not, and the designer writes
1011
1011
  * one task per set even for a stage its own SDD calls parallel.
1012
1012
  *
1013
+ * A task without a `runs-sequentially` rule is always written to a set of its
1014
+ * own, placed right after the set `lane` names; `lane` only groups sequential
1015
+ * tasks. Case schema V31 made set membership behavioural: its V30→V31
1016
+ * migration rewrites the entry conditions of any non-sequential task that
1017
+ * shares a set (builder-sdk#1248).
1018
+ *
1013
1019
  * @param displayName - The task's display name.
1014
1020
  * @param fn - Receives a sub-builder for what the task does.
1015
- * @param opts - `lane` is the task's set index in `data.tasks[][]` (default 0);
1016
- * it orders `runs-sequentially` sets and is inert for every other task.
1021
+ * @param opts - `lane` is the index of the set a `runs-sequentially` task joins
1022
+ * in `data.tasks[][]` (default 0). Any other task gets its own set after it.
1017
1023
  * @returns This builder, so calls chain.
1018
1024
  */
1019
1025
  task(displayName: string, fn: (t: TaskBuilder) => void, opts?: {
@@ -516,10 +516,16 @@ class StageBuilder {
516
516
  * scheduler rules whether they share a set or not, and the designer writes
517
517
  * one task per set even for a stage its own SDD calls parallel.
518
518
  *
519
+ * A task without a `runs-sequentially` rule is always written to a set of its
520
+ * own, placed right after the set `lane` names; `lane` only groups sequential
521
+ * tasks. Case schema V31 made set membership behavioural: its V30→V31
522
+ * migration rewrites the entry conditions of any non-sequential task that
523
+ * shares a set (builder-sdk#1248).
524
+ *
519
525
  * @param displayName - The task's display name.
520
526
  * @param fn - Receives a sub-builder for what the task does.
521
- * @param opts - `lane` is the task's set index in `data.tasks[][]` (default 0);
522
- * it orders `runs-sequentially` sets and is inert for every other task.
527
+ * @param opts - `lane` is the index of the set a `runs-sequentially` task joins
528
+ * in `data.tasks[][]` (default 0). Any other task gets its own set after it.
523
529
  * @returns This builder, so calls chain.
524
530
  */
525
531
  task(displayName, fn, opts = {}) {
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import { IdGen } from './ids.js';
12
12
  import { isUnrestorableSlotId } from './preserve.js';
13
+ import { v31TaskSets } from './task-sets.js';
13
14
  import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '../core/connector-inputs.js';
14
15
  import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
15
16
  import { bindingLabelRefusal } from '../core/binding-messages.js';
@@ -109,6 +110,8 @@ export function serialize(built, opts = {}) {
109
110
  built.stages.forEach((stage) => prealloc(stage.slaRules, stage.label));
110
111
  const stageIds = [];
111
112
  const taskIds = []; // [stageIndex][lane][taskIndex]
113
+ // The task sets as written: one set per parallel task (see `laneSets`).
114
+ const stageLanes = built.stages.map((stage) => laneSets(stage.lanes));
112
115
  // Task displayNames must be unique across the whole case: the platform rejects
113
116
  // duplicates (CASE_MGMT_STAGE_TASK_NAME_DUPLICATE, CRITICAL), and a bare
114
117
  // `selected-tasks-completed` reference resolves against a single name→id map, so
@@ -121,7 +124,7 @@ export function serialize(built, opts = {}) {
121
124
  resolver.stageIdByLabel.set(stage.label, sid);
122
125
  stageIds.push(sid);
123
126
  taskIds.push([]);
124
- stage.lanes.forEach((lane, li) => {
127
+ stageLanes[si].forEach((lane, li) => {
125
128
  taskIds[si].push([]);
126
129
  lane.forEach((task) => {
127
130
  if (seenTaskNames.has(task.name))
@@ -144,7 +147,7 @@ export function serialize(built, opts = {}) {
144
147
  const triggerNodeByRef = new Map();
145
148
  built.triggers.forEach((t, i) => triggerNodeByRef.set(t, triggerNodes[i]));
146
149
  built.stages.forEach((stage, si) => {
147
- nodes.push(emitStage(stage, si, stageIds[si], taskIds[si], ids, resolver));
150
+ nodes.push(emitStage(stage, stageLanes[si], si, stageIds[si], taskIds[si], ids, resolver));
148
151
  });
149
152
  // ── Metadata (case-level) ──
150
153
  const metadata = {
@@ -382,7 +385,7 @@ export function applyPreservation(result, preservation, options = {}) {
382
385
  .filter((node) => String(node.type ?? '').endsWith('Stage'));
383
386
  for (const entry of preservation.taskFields ?? []) {
384
387
  const stage = stageNodes.find((candidate) => candidate.data?.label === entry.stage);
385
- const task = stage?.data?.tasks?.[entry.lane]?.find((candidate) => candidate.displayName === entry.task);
388
+ const task = stageTask(stage, entry.task);
386
389
  // A brownfield edit may deliberately delete a typed task or its stage. Its
387
390
  // attached designer-only fields leave with that construct; surviving tasks
388
391
  // still collide-refuse below instead of letting preservation overwrite
@@ -408,7 +411,7 @@ export function applyPreservation(result, preservation, options = {}) {
408
411
  }
409
412
  for (const entry of preservation.omitTaskElementIds ?? []) {
410
413
  const stage = stageNodes.find((candidate) => candidate.data?.label === entry.stage);
411
- const task = stage?.data?.tasks?.[entry.lane]?.find((candidate) => candidate.displayName === entry.task);
414
+ const task = stageTask(stage, entry.task);
412
415
  if (task)
413
416
  delete task.elementId;
414
417
  }
@@ -483,8 +486,8 @@ function applyPreservedIdentities(result, preservation) {
483
486
  takeConditions(stage?.data?.entryConditions, stageIdentity.entryConditions);
484
487
  takeConditions(stage?.data?.exitConditions, stageIdentity.exitConditions);
485
488
  takeSlas(stage?.data?.slaRules, stageIdentity.slaRules);
486
- (stageIdentity.tasks ?? []).forEach((lane, laneIndex) => lane.forEach((taskIdentity) => {
487
- const task = stage?.data?.tasks?.[laneIndex]?.find((candidate) => candidate.displayName === taskIdentity.name);
489
+ (stageIdentity.tasks ?? []).forEach((lane) => lane.forEach((taskIdentity) => {
490
+ const task = stageTask(stage, taskIdentity.name);
488
491
  take(task, taskIdentity.id);
489
492
  takeConditions(task?.entryConditions, taskIdentity.entryConditions);
490
493
  (taskIdentity.inputs ?? []).forEach((row, index) => take(task?.data?.inputs?.[index], row.id));
@@ -729,13 +732,25 @@ function emitTriggers(triggers, ids, resolver) {
729
732
  };
730
733
  });
731
734
  }
732
- function emitStage(stage, si, stageId, laneTaskIds, ids, resolver) {
735
+ /** A stage's task sets as the serializer writes them — one set per parallel task (`v31TaskSets`). */
736
+ function laneSets(lanes) {
737
+ return v31TaskSets(lanes, (task) => task.entry.some((condition) => condition.rules.some((group) => group.some((r) => r.rule === 'runs-sequentially'))));
738
+ }
739
+ /** One emitted task of a stage node, by its (case-unique) display name, in any set. */
740
+ function stageTask(stage, name) {
741
+ for (const lane of stage?.data?.tasks ?? [])
742
+ for (const candidate of lane)
743
+ if (candidate.displayName === name)
744
+ return candidate;
745
+ return undefined;
746
+ }
747
+ function emitStage(stage, lanes, si, stageId, laneTaskIds, ids, resolver) {
733
748
  const data = {
734
749
  [CASE_FORMAT_PROFILE.stageLabelField]: stage.label,
735
750
  parentElement: { id: 'root', type: 'case-management:root' },
736
751
  isInvalidDropTarget: false,
737
752
  isPendingParent: false,
738
- tasks: stage.lanes.map((lane, li) => lane.map((task, ti) => emitTask(task, stage.label, laneTaskIds[li][ti], ids, resolver))),
753
+ tasks: lanes.map((lane, li) => lane.map((task, ti) => emitTask(task, stage.label, laneTaskIds[li][ti], ids, resolver))),
739
754
  };
740
755
  if (stage.description)
741
756
  data.description = stage.description;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Task sets (`data.tasks[i]`) in the shape Case schema V31+ keeps unchanged.
3
+ *
4
+ * V31 made a set a sequential chain. Its V30→V31 migration — which the product
5
+ * runs on every V30 document it reads — keeps a set unchanged only when it holds
6
+ * one task, or when every task in it declares a `runs-sequentially` rule. Every
7
+ * other task in a shared set has its entry conditions REPLACED by a generated
8
+ * `runs-sequentially` condition, so two parallel `current-stage-entered` tasks
9
+ * written into one set ran one after the other, under conditions the author
10
+ * never wrote, and nothing reported it (builder-sdk#1248).
11
+ *
12
+ * At V30 the regrouping is free: the converter reads a set's position only for
13
+ * tasks whose every rule is `runs-sequentially`; every other task runs on its
14
+ * own entry condition wherever it sits. A task the migration would rewrite
15
+ * therefore moves to a set of its own right after the set it was written in, so
16
+ * the stage's flattened task order — the order the converter writes its rules
17
+ * in — is unchanged too. Tasks the migration treats as sequential keep their
18
+ * set. The only case that reorders is a set that mixed both kinds: its
19
+ * sequential tasks stay together and the others follow.
20
+ *
21
+ * Generic over the task shape so the serializer (built tasks) and the tests
22
+ * (emitted JSON) apply the one rule.
23
+ */
24
+ export declare function v31TaskSets<T>(sets: readonly (readonly T[])[], runsSequentially: (task: T) => boolean): T[][];
25
+ /** The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`. */
26
+ export declare function taskJsonRunsSequentially(task: {
27
+ entryConditions?: Array<{
28
+ rules?: Array<Array<{
29
+ rule?: string;
30
+ }>>;
31
+ }>;
32
+ }): boolean;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Task sets (`data.tasks[i]`) in the shape Case schema V31+ keeps unchanged.
3
+ *
4
+ * V31 made a set a sequential chain. Its V30→V31 migration — which the product
5
+ * runs on every V30 document it reads — keeps a set unchanged only when it holds
6
+ * one task, or when every task in it declares a `runs-sequentially` rule. Every
7
+ * other task in a shared set has its entry conditions REPLACED by a generated
8
+ * `runs-sequentially` condition, so two parallel `current-stage-entered` tasks
9
+ * written into one set ran one after the other, under conditions the author
10
+ * never wrote, and nothing reported it (builder-sdk#1248).
11
+ *
12
+ * At V30 the regrouping is free: the converter reads a set's position only for
13
+ * tasks whose every rule is `runs-sequentially`; every other task runs on its
14
+ * own entry condition wherever it sits. A task the migration would rewrite
15
+ * therefore moves to a set of its own right after the set it was written in, so
16
+ * the stage's flattened task order — the order the converter writes its rules
17
+ * in — is unchanged too. Tasks the migration treats as sequential keep their
18
+ * set. The only case that reorders is a set that mixed both kinds: its
19
+ * sequential tasks stay together and the others follow.
20
+ *
21
+ * Generic over the task shape so the serializer (built tasks) and the tests
22
+ * (emitted JSON) apply the one rule.
23
+ */
24
+ export function v31TaskSets(sets, runsSequentially) {
25
+ const out = [];
26
+ for (const set of sets) {
27
+ if (set.length <= 1 || set.every(runsSequentially)) {
28
+ out.push([...set]);
29
+ continue;
30
+ }
31
+ const sequential = set.filter(runsSequentially);
32
+ if (sequential.length)
33
+ out.push(sequential);
34
+ for (const task of set)
35
+ if (!runsSequentially(task))
36
+ out.push([task]);
37
+ }
38
+ return out;
39
+ }
40
+ /** The V30→V31 migration's own test, on emitted task JSON: any rule of any entry condition is `runs-sequentially`. */
41
+ export function taskJsonRunsSequentially(task) {
42
+ return (task.entryConditions ?? []).some((condition) => (condition.rules ?? []).some((group) => group.some((r) => r?.rule === 'runs-sequentially')));
43
+ }
@@ -9,6 +9,8 @@ export interface FlowGlobalDeclaration {
9
9
  subType?: string;
10
10
  schema?: Record<string, unknown>;
11
11
  }
12
+ /** The keys of `variables` that hold declarations rather than name one (the map spelling). */
13
+ export declare const CONTAINER_KEYS: ReadonlySet<string>;
12
14
  /** Read both supported Flow variable spellings into one declaration table. */
13
15
  export declare function readFlowGlobals(variables: unknown, strict?: boolean): FlowGlobalDeclaration[];
14
16
  /** The declaration fields `planFlowGlobals` reads (structurally a `VarDecl`). */
@@ -1,5 +1,6 @@
1
1
  import { globalNameCollisionMessage, globalNameCollisions } from './core/global-names.js';
2
- const CONTAINER_KEYS = new Set(['globals', 'nodes', 'variableUpdates']);
2
+ /** The keys of `variables` that hold declarations rather than name one (the map spelling). */
3
+ export const CONTAINER_KEYS = new Set(['globals', 'nodes', 'variableUpdates']);
3
4
  const DIRECTIONS = new Set(['in', 'out', 'inout']);
4
5
  /** Read both supported Flow variable spellings into one declaration table. */
5
6
  export function readFlowGlobals(variables, strict = false) {
@@ -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' | 'undeclared-handle' | 'duplicate-binding' | 'agent-sidecar' | 'agent-storage' | 'agent-prompt-input' | 'agent-embedded-edit';
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';
37
37
  /** The finding, phrased for the author, naming the node, edge or row. */
38
38
  message: string;
39
39
  /**
@@ -27,7 +27,10 @@
27
27
  * - switch case ids and human-task outcome ids, which name the handles the
28
28
  * edges leave from;
29
29
  * - binding rows by what they bind (`core/binding-identity.ts`), never by the
30
- * row `id`.
30
+ * row `id`;
31
+ * - root `variables` entries (`globals`, `nodes`) by id. Merge restores an
32
+ * entry the author did not touch (merge-variables.ts), so this reports only
33
+ * what slipped past that rule, such as a section taken whole.
31
34
  *
32
35
  * Two checks run on the MERGED file whatever the baseline says, because merge
33
36
  * mixes sources (untouched nodes from the original, edges from the edited file):
@@ -52,6 +55,7 @@
52
55
  import { bindingIdentity } from './core/binding-identity.js';
53
56
  import { expandSourceHandles } from './core/definition-handles.js';
54
57
  import { OUTCOME_HANDLE_NODE_TYPES } from './core/hitl-routing.js';
58
+ import { isDeltaSpelling, stableJson } from './merge-variables.js';
55
59
  /** A file's definitions, keyed `nodeType@version`. */
56
60
  function defsOf(f) {
57
61
  const out = new Map();
@@ -276,6 +280,33 @@ export function roundTripFindings(original, baseline, merged) {
276
280
  out.push({ kind: 'binding-added', refuses: true, message: `the round trip adds a binding row for ${bindingText(r)}; merge will write it.` });
277
281
  }
278
282
  }
283
+ // ── Root variables, by section and id ──
284
+ // A map-spelled original is taken whole on any edit (merge-variables.ts), so
285
+ // what that carries is reported but never refused: the author cannot avoid it.
286
+ const refuses = isDeltaSpelling(original.variables);
287
+ const tail = refuses ? '' : ' (the original uses the map spelling, so merge takes the edited section whole; not refused under --strict)';
288
+ for (const section of ['globals', 'nodes']) {
289
+ const entries = (f) => {
290
+ const list = f.variables?.[section];
291
+ return new Map((Array.isArray(list) ? list : [])
292
+ .filter((v) => typeof v?.id === 'string').map((v) => [v.id, v]));
293
+ };
294
+ const o = entries(original);
295
+ const b = entries(baseline);
296
+ const m = entries(merged);
297
+ for (const [id, bv] of b) {
298
+ const mv = m.get(id);
299
+ const ov = o.get(id);
300
+ if (mv === undefined || stableJson(mv) !== stableJson(bv) || (ov !== undefined && stableJson(ov) === stableJson(bv)))
301
+ continue;
302
+ if (ov === undefined) {
303
+ out.push({ kind: 'variable-added', refuses, message: `the round trip adds variables.${section} "${id}"; merge will write it${tail}.` });
304
+ continue;
305
+ }
306
+ const fields = [...new Set([...Object.keys(ov), ...Object.keys(bv)])].filter((k) => stableJson(ov[k]) !== stableJson(bv[k]));
307
+ out.push({ kind: 'variable-changed', refuses, message: `the round trip rewrites ${fields.join(', ')} of variables.${section} "${id}"; merge will write it${tail}.` });
308
+ }
309
+ }
279
310
  return out;
280
311
  }
281
312
  /** The source handles a node's definition declares, or `undefined` when they cannot be known. */
@@ -0,0 +1,19 @@
1
+ type Json = unknown;
2
+ /** JSON with object keys sorted, so key order is not a difference. */
3
+ export declare function stableJson(v: Json): string;
4
+ /**
5
+ * Whether `variables` is spelled the way the delta reads it: absent, or an
6
+ * object whose keys are only the container keys (`globals`, `nodes`,
7
+ * `variableUpdates`). A map-spelled original is not, and is taken whole.
8
+ */
9
+ export declare function isDeltaSpelling(variables: Json): boolean;
10
+ /**
11
+ * The merged root `variables`. `goneNodeIds` are the original's nodes (root and
12
+ * subflows) the merged file no longer has: a node variable, or a
13
+ * `variableUpdates` key, kept from the original for one of them is dropped
14
+ * with the node.
15
+ */
16
+ export declare function mergeVariables(original: Json, edited: Json, baseline: {
17
+ variables?: Json;
18
+ } | undefined, goneNodeIds: Set<string>): Json;
19
+ export {};
@@ -0,0 +1,191 @@
1
+ /**
2
+ * merge-variables — the delta rule for a flow's root `variables` (#1261).
3
+ *
4
+ * Nodes merge as a delta: one the author did not touch (edited equals
5
+ * baseline) is restored from the original. `variables` follow the same rule.
6
+ *
7
+ * The same rule, applied at three levels:
8
+ *
9
+ * - the whole section: edited equals baseline → the original's, verbatim;
10
+ * - a top-level key (`globals`, `nodes`, `variableUpdates`): edited equals
11
+ * baseline → the original's (absent stays absent);
12
+ * - an entry of an id-keyed list (`globals`, `nodes`) or a key of a map
13
+ * (`variableUpdates`): the same, and inside an entry each field the same,
14
+ * so an edited global's new `type` lands without the `name` compile adds.
15
+ *
16
+ * Presence follows the same logic. An entry the edited file lacks was removed
17
+ * by the author when the baseline has it, and lost by the round trip when it
18
+ * does not (kept). An entry the original lacks is the author's when the
19
+ * baseline lacks it or differs, and the round trip's when the baseline has it
20
+ * unchanged (dropped).
21
+ *
22
+ * Example, after the author changes `creditAmount`'s type and nothing else:
23
+ *
24
+ * original { id: 'creditAmount', direction: 'out', type: 'string' }
25
+ * baseline { id: 'creditAmount', name: 'creditAmount', direction: 'out', type: 'string' }
26
+ * edited { id: 'creditAmount', name: 'creditAmount', direction: 'out', type: 'number' }
27
+ * merged { id: 'creditAmount', direction: 'out', type: 'number' }
28
+ *
29
+ * An original with no `variables` section, or with no `globals` / `nodes` /
30
+ * `variableUpdates` key, is treated as empty there: what compile minted for
31
+ * the untouched part is still the round trip's, and only the author's
32
+ * additions land.
33
+ *
34
+ * Without a baseline there is nothing to tell an edit from the round trip, so
35
+ * the edited section is taken whole. So is a section whose original uses a key
36
+ * this file does not know (the older map spelling, `variables.city = {...}`)
37
+ * once the author changed anything: mixing two spellings in one section is
38
+ * worse than taking the compile's. The round-trip report still lists what that
39
+ * carries, but does not refuse it under `--strict`, because the author cannot
40
+ * avoid it short of making no edit ({@link isDeltaSpelling}).
41
+ */
42
+ import { jsonClone } from './core/json-clone.js';
43
+ import { CONTAINER_KEYS } from './flow-variables.js';
44
+ /** `jsonClone`, which also passes `undefined` (an absent section or key) through. */
45
+ const copy = (v) => (v === undefined ? v : jsonClone(v));
46
+ const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
47
+ /** JSON with object keys sorted, so key order is not a difference. */
48
+ export function stableJson(v) {
49
+ return JSON.stringify(v, (_k, val) => (isObj(val)
50
+ ? Object.fromEntries(Object.keys(val).sort().map((k) => [k, val[k]]))
51
+ : val));
52
+ }
53
+ const same = (a, b) => stableJson(a) === stableJson(b);
54
+ /**
55
+ * Whether `variables` is spelled the way the delta reads it: absent, or an
56
+ * object whose keys are only the container keys (`globals`, `nodes`,
57
+ * `variableUpdates`). A map-spelled original is not, and is taken whole.
58
+ */
59
+ export function isDeltaSpelling(variables) {
60
+ return variables === undefined || (isObj(variables) && Object.keys(variables).every((k) => CONTAINER_KEYS.has(k)));
61
+ }
62
+ /**
63
+ * The merged root `variables`. `goneNodeIds` are the original's nodes (root and
64
+ * subflows) the merged file no longer has: a node variable, or a
65
+ * `variableUpdates` key, kept from the original for one of them is dropped
66
+ * with the node.
67
+ */
68
+ export function mergeVariables(original, edited, baseline, goneNodeIds) {
69
+ if (!baseline)
70
+ return copy(edited);
71
+ const base = baseline.variables;
72
+ if (same(edited, base))
73
+ return withoutGoneUpdates(copy(original), goneNodeIds);
74
+ if (!isDeltaSpelling(original) || !isObj(edited))
75
+ return copy(edited);
76
+ const orig = isObj(original) ? original : {};
77
+ const baseObj = isObj(base) ? base : {};
78
+ const out = {};
79
+ for (const key of keysInOrder(orig, edited)) {
80
+ const updates = key === 'variableUpdates';
81
+ const inner = updates
82
+ ? (o, b, e) => (isObj(o) && isObj(e) ? mergeFields(o, isObj(b) ? b : undefined, e) : copy(e))
83
+ : (o, b, e) => mergeList(o, b, e, goneNodeIds);
84
+ // A section the original lacks but the round trip writes is merged as an
85
+ // empty one, so its minted entries stay out and only the author's land.
86
+ const absent = !(key in orig) && key in baseObj && key in edited && !same(edited[key], baseObj[key]);
87
+ const value = absent
88
+ ? nonEmpty(inner(updates ? {} : [], baseObj[key], edited[key]))
89
+ : mergeKey(orig[key], baseObj[key], edited[key], key in orig, key in baseObj, key in edited, inner);
90
+ if (value !== undefined)
91
+ out[key] = value;
92
+ }
93
+ if (original === undefined && Object.keys(out).length === 0)
94
+ return undefined;
95
+ return withoutGoneUpdates(out, goneNodeIds);
96
+ }
97
+ /** `undefined` for an empty list or map, so an absent section stays absent. */
98
+ function nonEmpty(v) {
99
+ if (Array.isArray(v))
100
+ return v.length ? v : undefined;
101
+ if (isObj(v))
102
+ return Object.keys(v).length ? v : undefined;
103
+ return v;
104
+ }
105
+ /**
106
+ * `variables` without the `variableUpdates` keys (node ids) of nodes the merge
107
+ * dropped. A key the round trip lost is kept from the original, so without
108
+ * this it would outlive its node.
109
+ */
110
+ function withoutGoneUpdates(variables, goneNodeIds) {
111
+ const updates = isObj(variables) ? variables.variableUpdates : undefined;
112
+ if (!isObj(updates) || !Object.keys(updates).some((k) => goneNodeIds.has(k)))
113
+ return variables;
114
+ return { ...variables, variableUpdates: Object.fromEntries(Object.entries(updates).filter(([k]) => !goneNodeIds.has(k))) };
115
+ }
116
+ /** Original's keys in its order, then the edited file's new ones. */
117
+ function keysInOrder(original, edited) {
118
+ return [...Object.keys(original), ...Object.keys(edited).filter((k) => !(k in original))];
119
+ }
120
+ /**
121
+ * One key's value under the delta rule; `undefined` = leave the key out.
122
+ * `inner` merges a value both sides have and the author changed.
123
+ */
124
+ function mergeKey(o, b, e, inOriginal, inBaseline, inEdited, inner) {
125
+ if (!inEdited)
126
+ return inBaseline || !inOriginal ? undefined : copy(o); // removed by the author / lost by the round trip
127
+ if (inBaseline && same(e, b))
128
+ return inOriginal ? copy(o) : undefined; // untouched
129
+ if (!inOriginal)
130
+ return copy(e); // the author's addition
131
+ return inner(o, b, e);
132
+ }
133
+ /** An id-keyed list (`globals`, `nodes`): per entry, then per field. */
134
+ function mergeList(o, b, e, goneNodeIds) {
135
+ if (!idList(o) || !idList(e))
136
+ return copy(e);
137
+ const base = new Map((idList(b) ? b : []).map((x) => [x.id, x]));
138
+ const edits = new Map(e.map((x) => [x.id, x]));
139
+ const out = [];
140
+ for (const entry of o) {
141
+ const id = entry.id;
142
+ if (!edits.has(id)) {
143
+ // The author removed it (baseline has it), or the round trip lost it; a
144
+ // lost node variable whose node is gone goes with the node.
145
+ if (!base.has(id) && !boundToGoneNode(entry, goneNodeIds))
146
+ out.push(copy(entry));
147
+ continue;
148
+ }
149
+ const ed = edits.get(id);
150
+ out.push(base.has(id) && same(ed, base.get(id)) ? copy(entry) : mergeFields(entry, base.get(id), ed));
151
+ }
152
+ const originalIds = new Set(o.map((x) => x.id));
153
+ for (const [i, ed] of e.entries()) {
154
+ const id = ed.id;
155
+ if (originalIds.has(id) || (base.has(id) && same(ed, base.get(id))))
156
+ continue; // kept above / minted by the round trip
157
+ out.splice(insertAt(out, e, i), 0, copy(ed));
158
+ }
159
+ return out;
160
+ }
161
+ /** After the nearest earlier edited entry already in `out`, else first. */
162
+ function insertAt(out, edited, i) {
163
+ for (let j = i - 1; j >= 0; j--) {
164
+ const at = out.findIndex((x) => x.id === edited[j].id);
165
+ if (at >= 0)
166
+ return at + 1;
167
+ }
168
+ return 0;
169
+ }
170
+ /**
171
+ * An object the author changed — a list entry, or the `variableUpdates` map
172
+ * (keyed by node id): each key under the delta rule, each value taken whole,
173
+ * keys in the original's order.
174
+ */
175
+ function mergeFields(o, b, e) {
176
+ const base = b ?? {};
177
+ const out = {};
178
+ for (const key of keysInOrder(o, e)) {
179
+ const v = mergeKey(o[key], base[key], e[key], key in o, key in base, key in e, (_o, _b, ev) => copy(ev));
180
+ if (v !== undefined)
181
+ out[key] = v;
182
+ }
183
+ return out;
184
+ }
185
+ function idList(v) {
186
+ return Array.isArray(v) && v.every((x) => isObj(x) && typeof x.id === 'string');
187
+ }
188
+ function boundToGoneNode(entry, goneNodeIds) {
189
+ const nodeId = isObj(entry.binding) ? entry.binding.nodeId : undefined;
190
+ return typeof nodeId === 'string' && goneNodeIds.has(nodeId);
191
+ }
package/dist/merge.d.ts CHANGED
@@ -26,7 +26,8 @@
26
26
  *
27
27
  * Layout, `metadata`, `solutionId`, `projectId`, `runtime` and `layout` are
28
28
  * preserved from the original; `subflows` and edges (with their ids) come from
29
- * `edited`; `definitions` and `bindings` are unioned
29
+ * `edited`; root `variables` merge as a delta per entry, like nodes
30
+ * (merge-variables.ts); `definitions` and `bindings` are unioned
30
31
  * (original wins on conflict, since the original's are the tenant-resolved
31
32
  * authority). A binding row's identity is what it binds, not its row id, and a
32
33
  * row the no-edit recompile minted only for nodes merge kept from the original
@@ -143,8 +144,8 @@ export interface MergeOptions {
143
144
  * - with a `baseline`, each wire-identity difference between the baseline
144
145
  * (the no-edit round trip) and the original — a node or edge added, dropped
145
146
  * or rewired, a switch case id or human-task outcome id renamed, a binding
146
- * row added or dropped — that the merged file still carries, i.e. the
147
- * author's edit did not undo it;
147
+ * row added or dropped, a root `variables` entry added or rewritten — that
148
+ * the merged file still carries, i.e. the author's edit did not undo it;
148
149
  * - an edited node whose `typeVersion` differs from the original node with
149
150
  * the same id, because the edit took the SDK's version;
150
151
  * - a merged edge whose `sourcePort` is not a handle its source node declares,
package/dist/merge.js CHANGED
@@ -26,7 +26,8 @@
26
26
  *
27
27
  * Layout, `metadata`, `solutionId`, `projectId`, `runtime` and `layout` are
28
28
  * preserved from the original; `subflows` and edges (with their ids) come from
29
- * `edited`; `definitions` and `bindings` are unioned
29
+ * `edited`; root `variables` merge as a delta per entry, like nodes
30
+ * (merge-variables.ts); `definitions` and `bindings` are unioned
30
31
  * (original wins on conflict, since the original's are the tenant-resolved
31
32
  * authority). A binding row's identity is what it binds, not its row id, and a
32
33
  * row the no-edit recompile minted only for nodes merge kept from the original
@@ -89,6 +90,7 @@ import { MergeRefusedError, mergedFileFindings, roundTripFindings } from './merg
89
90
  import { placeAddedNodes } from './node-placement.js';
90
91
  import { mergeAgentSidecars } from './merge-sidecars.js';
91
92
  import { embeddedAgentFindings, isEmbeddedAgent, mergeEmbeddedAgentNode } from './merge-embedded-agent.js';
93
+ import { mergeVariables } from './merge-variables.js';
92
94
  export { MergeRefusedError } from './merge-roundtrip.js';
93
95
  function byId(nodes) {
94
96
  return new Map((nodes ?? []).map((n) => [n.id, n]));
@@ -256,8 +258,7 @@ function mergeFlowFindings(original, edited, options) {
256
258
  result.nodes = finalNodes;
257
259
  // Nodes present in the original but absent from `edited` were deleted by the
258
260
  // user; they are simply not carried over.
259
- // ── Variables & subflows: the edited flow is authoritative (the user's graph). ──
260
- result.variables = jsonClone(edited.variables);
261
+ // ── Subflows: the edited flow is authoritative (the user's graph). ──
261
262
  result.subflows = jsonClone(edited.subflows ?? {});
262
263
  // A subflow is taken from `edited` whole, so an embedded agent inside one
263
264
  // would flip to the edited shell even with no edit. Keep it embedded too.
@@ -267,6 +268,20 @@ function mergeFlowFindings(original, edited, options) {
267
268
  if (options.baseline)
268
269
  keepOriginalSourcesInSubflows(original, result.subflows, options.baseline);
269
270
  const subflowScopes = Object.values(result.subflows);
271
+ // ── Variables: the same delta as nodes, per entry — what the author did not
272
+ // change stays the original's, so compile's own spellings (an added
273
+ // `name`, a re-derived End output type) do not reach the file (#1261).
274
+ // See merge-variables.ts. ──
275
+ const mergedNodeIds = new Set([...finalNodes, ...subflowScopes.flatMap((sf) => sf?.nodes ?? [])].map((n) => n.id));
276
+ const goneNodeIds = new Set([
277
+ ...(original.nodes ?? []),
278
+ ...Object.values(original.subflows ?? {}).flatMap((sf) => sf?.nodes ?? []),
279
+ ].map((n) => n.id).filter((id) => !mergedNodeIds.has(id)));
280
+ const variables = mergeVariables(original.variables, edited.variables, options.baseline, goneNodeIds);
281
+ if (variables === undefined)
282
+ delete result.variables;
283
+ else
284
+ result.variables = variables;
270
285
  // ── Edges: the edited graph's edges define the wiring, under the edited
271
286
  // file's own ids. compile draws every edge id — root AND subflows — from
272
287
  // one file-wide counter, so they are already unique. Renumbering the root
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.33.0",
3
+ "version": "6.33.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": "8875d03ffd74e131e88778405d2eb401dd13d0e9"
96
+ "gitref": "04124f15f4e70827cb18bbd0f52c0bf676ceedd1"
97
97
  }