@uipath/maestro-builder-sdk 6.88.2 → 6.89.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.
package/dist/api-index.md CHANGED
@@ -333,7 +333,7 @@ could hand you spans for a version you do not have.
333
333
  | `CaseAppConfig` | interface | `dist/case/case-sdk.d.ts:1059-1071` | Supporting types | Typed configuration for the generated Case App. |
334
334
  | `CaseAppDetailValue` | type | `dist/case/case-sdk.d.ts:1048-1049` | Supporting types | A value displayed in one Case App section. |
335
335
  | `CaseAppSection` | interface | `dist/case/case-sdk.d.ts:1050-1058` | Supporting types | One summary section in the generated Case App. |
336
- | `CaseBuilder` | class | `dist/case/case-sdk.d.ts:1796-2085` | Builders | 18 member(s) |
336
+ | `CaseBuilder` | class | `dist/case/case-sdk.d.ts:1797-2086` | Builders | 18 member(s) |
337
337
  | `CaseConnectorOpts` | interface | `dist/case/case-sdk.d.ts:524-547` | Option shapes | TaskBuilder.connector's options: the Flow `connector()` options, plus the fields a decompiled task carries. |
338
338
  | `CaseDocumentExtractionSpec` | interface | `dist/case/case-sdk.d.ts:620-665` | Supporting types | A document-extraction task's IXP deployment and inputs (`.documentExtraction()`). |
339
339
  | `CaseEventFilter` | type | `dist/core/actions.d.ts:993-1017` | Supporting types | A Case event filter: an EventFilter, or a text test or equality whose value is computed at runtime from a Case… |
@@ -341,7 +341,7 @@ could hand you spans for a version you do not have.
341
341
  | `CaseHttpRequestSpec` | interface | `dist/case/case-sdk.d.ts:568-610` | Supporting types | An HTTP request task's request (`.httpRequest()`). |
342
342
  | `CaseLayout` | interface | `dist/case/case-sdk.d.ts:1093-1104` | Supporting types | Optional Case designer layout, keyed by author-level stage and trigger names. |
343
343
  | `CaseNodeLayout` | interface | `dist/case/case-sdk.d.ts:1072-1092` | Supporting types | Designer-only fields the shipped Case transformer moves into `layout.nodes[id]`. |
344
- | `casePlan` | function | `dist/case/case-sdk.d.ts:2086-2092` | Case authoring | Start building a case plan with the given id. |
344
+ | `casePlan` | function | `dist/case/case-sdk.d.ts:2087-2093` | Case authoring | Start building a case plan with the given id. |
345
345
  | `CaseRule` | interface | `dist/case/case-sdk.d.ts:96-99` | Supporting types | A single DNF rule. |
346
346
  | `CaseRuleGrid` | type | `dist/case/case-sdk.d.ts:180-181` | Supporting types | One rule, one AND-group, or a complete OR-of-AND condition grid. |
347
347
  | `CaseRuleInput` | type | `dist/case/case-sdk.d.ts:178-179` | Supporting types | A concrete rule or a pure expression gate resolved by its receiving slot. |
@@ -388,9 +388,9 @@ could hand you spans for a version you do not have.
388
388
  | `SelectNextStageSpec` | interface | `dist/case/case-sdk.d.ts:403-421` | Supporting types | Data Fabric entity used by the Case runtime to deliver a person's next-stage selection. |
389
389
  | `SlaOpts` | interface | `dist/case/case-sdk.d.ts:251-270` | Option shapes | 5 field(s) |
390
390
  | `SlaUnit` | type | `dist/case/case-sdk.d.ts:182-183` | Supporting types | SLA deadline unit. |
391
- | `StageBuilder` | class | `dist/case/case-sdk.d.ts:1718-1795` | Builders | 6 member(s) |
391
+ | `StageBuilder` | class | `dist/case/case-sdk.d.ts:1719-1796` | Builders | 6 member(s) |
392
392
  | `StageExitType` | type | `dist/case/case-sdk.d.ts:402` | Supporting types | |
393
- | `TaskBuilder` | class | `dist/case/case-sdk.d.ts:1207-1717` | Builders | 29 member(s) |
393
+ | `TaskBuilder` | class | `dist/case/case-sdk.d.ts:1207-1718` | Builders | 29 member(s) |
394
394
  | `TaskInputBinding` | interface | `dist/case/case-sdk.d.ts:908-919` | Supporting types | A task input binding: a resource input parameter set to a literal or a `=`-expression. |
395
395
  | `TaskKind` | type | `dist/case/case-sdk.d.ts:460` | Supporting types | |
396
396
  | `taskOutput` | function | `dist/case/case-sdk.d.ts:130-158` | Case authoring | Read another task's output in place, in a `=js:` expression or a task input: `=vars.<id>` once compiled, where `<id>` is… |
@@ -69,7 +69,7 @@ not find it either.
69
69
  | `aliases` | property | `LookupSpec` | `dist/core/lookups.d.ts:31-32` |
70
70
  | `allErrors` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:861-862` |
71
71
  | `allowAdhocOptionalStageTasks` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1143-1144` |
72
- | `allowAdhocTasks` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1905-1912` |
72
+ | `allowAdhocTasks` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1906-1913` |
73
73
  | `apiWorkflow` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:395-398` |
74
74
  | `apiWorkflow` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1289-1298` |
75
75
  | `app` | property | `EscalationRef` | `dist/core/actions.d.ts:745-772` |
@@ -120,9 +120,9 @@ not find it either.
120
120
  | `breakEnabled` | property | `DoWhileOptions` | `dist/flow-sdk.d.ts:442-443` |
121
121
  | `breakEnabled` | property | `LoopOptions` | `dist/flow-sdk.d.ts:429-433` |
122
122
  | `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3776-3785` |
123
- | `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2079-2084` |
123
+ | `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2080-2085` |
124
124
  | `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1653-1661` |
125
- | `businessEvent` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2068-2078` |
125
+ | `businessEvent` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2069-2079` |
126
126
  | `businessEvent` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:85-92` |
127
127
  | `businessEvents` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1149-1150` |
128
128
  | `businessRule` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:944-945` |
@@ -135,7 +135,7 @@ not find it either.
135
135
  | `callContext` | property | `VoiceAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:163-168` |
136
136
  | `cancelActivity` | property | `BoundaryOpts` | `dist/bpmn/bpmn-sdk.d.ts:802-803` |
137
137
  | `carriedFields` | property | `CaseConnectorOpts` | `dist/case/case-sdk.d.ts:529-546` |
138
- | `caseApp` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1878-1904` |
138
+ | `caseApp` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1879-1905` |
139
139
  | `caseAppConfig` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1142` |
140
140
  | `caseAppEnabled` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1141` |
141
141
  | `caseExit` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1147` |
@@ -156,7 +156,7 @@ not find it either.
156
156
  | `collection` | property | `TransformInputs` | `dist/nodes/transform/flow/spec.d.ts:85-100` |
157
157
  | `color` | property | `StickyNote` | `dist/flow-sdk.d.ts:684-685` |
158
158
  | `colSpan` | property | `FormFieldSettings` | `dist/core/actions.d.ts:187-188` |
159
- | `completeWhen` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2048-2058` |
159
+ | `completeWhen` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2049-2059` |
160
160
  | `completion` | property | `LoopSpec` | `dist/bpmn/bpmn-sdk.d.ts:87-88` |
161
161
  | `completionCondition` | property | `LoopOptions` | `dist/flow-sdk.d.ts:424-428` |
162
162
  | `complexGateway` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2437-2451` |
@@ -260,7 +260,7 @@ not find it either.
260
260
  | `description` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:963` |
261
261
  | `description` | property | `BuiltTrigger` | `dist/case/case-sdk.d.ts:285` |
262
262
  | `description` | property | `BusinessEventOpts` | `dist/case/case-sdk.d.ts:1107-1108` |
263
- | `description` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1863-1869` |
263
+ | `description` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1864-1870` |
264
264
  | `description` | property | `CaseVarDecl` | `dist/case/case-sdk.d.ts:1026-1031` |
265
265
  | `description` | property | `CaseVarSpec` | `dist/case/case-sdk.d.ts:1014-1015` |
266
266
  | `description` | property | `ClientSideToolRef` | `dist/core/actions.d.ts:503-504` |
@@ -279,8 +279,8 @@ not find it either.
279
279
  | `description` | property | `ProcessToolRef` | `dist/core/actions.d.ts:671-676` |
280
280
  | `description` | property | `RemoteA2aToolRef` | `dist/core/actions.d.ts:486` |
281
281
  | `description` | property | `ResolvedEventTriggerOpts` | `dist/case/case-sdk.d.ts:371-372` |
282
- | `description` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1728-1734` |
283
- | `description` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1572-1578` |
282
+ | `description` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1729-1735` |
283
+ | `description` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1573-1579` |
284
284
  | `description` | property | `TimerTriggerOpts` | `dist/case/case-sdk.d.ts:310` |
285
285
  | `description` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:322-323` |
286
286
  | `description` | property | `VarDecl` | `dist/flow-sdk.d.ts:70-71` |
@@ -354,8 +354,8 @@ not find it either.
354
354
  | `entryPointId` | property | `ProcessMetadata` | `dist/bpmn/bpmn-sdk.d.ts:564-576` |
355
355
  | `entryPointId` | property | `StartOpts` | `dist/bpmn/bpmn-sdk.d.ts:728-736` |
356
356
  | `entryPoints` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:754-755` |
357
- | `entryWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1768-1775` |
358
- | `entryWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1705-1714` |
357
+ | `entryWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1769-1776` |
358
+ | `entryWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1706-1715` |
359
359
  | `err` | method | `StepList` | `dist/flow-sdk.d.ts:778-803` |
360
360
  | `error` | property | `BoundaryOpts` | `dist/bpmn/bpmn-sdk.d.ts:808-812` |
361
361
  | `error` | property | `EndOpts` | `dist/bpmn/bpmn-sdk.d.ts:749-759` |
@@ -387,7 +387,7 @@ not find it either.
387
387
  | `every` | property | `ScheduledInputs` | `dist/nodes/trigger/flow/spec.d.ts:30-41` |
388
388
  | `every` | property | `TimerTriggerOpts` | `dist/case/case-sdk.d.ts:300-308` |
389
389
  | `exception` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:973` |
390
- | `exceptionStage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2040-2047` |
390
+ | `exceptionStage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2041-2048` |
391
391
  | `exchangeId` | property | `ConversationalAgentSettings` | `dist/nodes/agent/flow/spec.d.ts:31-32` |
392
392
  | `exchangeId` | property | `SendMessageInputs` | `dist/nodes/conversation/flow/spec.d.ts:14-19` |
393
393
  | `exchangeLimit` | property | `ConversationContextInputs` | `dist/nodes/conversation/flow/spec.d.ts:40-43` |
@@ -397,7 +397,7 @@ not find it either.
397
397
  | `exit` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:978` |
398
398
  | `exitToStage` | property | `BuiltExitCondition` | `dist/case/case-sdk.d.ts:432-446` |
399
399
  | `exitToStage` | property | `ExitOpts` | `dist/case/case-sdk.d.ts:1186-1200` |
400
- | `exitWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1776-1783` |
400
+ | `exitWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1777-1784` |
401
401
  | `exponentialBase` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:859-860` |
402
402
  | `exposeError` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:379-385` |
403
403
  | `expression` | property | `BuiltSla` | `dist/case/case-sdk.d.ts:276-277` |
@@ -509,7 +509,7 @@ not find it either.
509
509
  | `http` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:956-957` |
510
510
  | `http` | property | `FlowActionSpecs` | `dist/nodes/http/flow/spec.d.ts:145-148` |
511
511
  | `http` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2538-2572` |
512
- | `httpRequest` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1530-1549` |
512
+ | `httpRequest` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1531-1550` |
513
513
  | `humanTask` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2826-2909` |
514
514
  | `id` | property | `AgentMemoryRef` | `dist/core/actions.d.ts:565-566` |
515
515
  | `id` | property | `AskedField` | `dist/core/actions.d.ts:225-226` |
@@ -547,7 +547,7 @@ not find it either.
547
547
  | `id` | property | `SwitchArm` | `dist/flow-sdk.d.ts:212-218` |
548
548
  | `id` | property | `VarEntry` | `dist/bpmn/bpmn-sdk.d.ts:1055-1056` |
549
549
  | `identifier` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1139` |
550
- | `identifier` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1870-1877` |
550
+ | `identifier` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1871-1878` |
551
551
  | `identifierType` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1140` |
552
552
  | `implied` | property | `BpmnFlow` | `dist/bpmn/bpmn-sdk.d.ts:382-389` |
553
553
  | `impliedFlowIds` | property | `SugarRegistry` | `dist/bpmn/bpmn-sdk.d.ts:2094-2095` |
@@ -557,7 +557,7 @@ not find it either.
557
557
  | `inlineAgent` | property | `FlowActionSpecs` | `dist/nodes/agent/flow/spec.d.ts:464-467` |
558
558
  | `inOuts` | property | `ActionSchemaFile` | `dist/nodes/hitl/flow/spec.d.ts:287-288` |
559
559
  | `inOuts` | property | `PlatformActionSchema` | `dist/nodes/hitl/flow/spec.d.ts:311-312` |
560
- | `input` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1934-1980` |
560
+ | `input` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1935-1981` |
561
561
  | `input` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1594-1606` |
562
562
  | `input` | property | `HumanTaskAppOpts` | `dist/bpmn/bpmn-sdk.d.ts:1454-1455` |
563
563
  | `input` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1320-1321` |
@@ -586,7 +586,7 @@ not find it either.
586
586
  | `inputs` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:47-52` |
587
587
  | `inputs` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:937-956` |
588
588
  | `inputs` | property | `SubflowSpec` | `dist/flow-sdk.d.ts:57-58` |
589
- | `inputs` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1586-1621` |
589
+ | `inputs` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1587-1622` |
590
590
  | `inputs` | property | `VoiceAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:157-162` |
591
591
  | `inputSchema` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1718-1726` |
592
592
  | `inputSchema` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:245-253` |
@@ -663,7 +663,7 @@ not find it either.
663
663
  | `lanes` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:976` |
664
664
  | `layout` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1153-1154` |
665
665
  | `layout` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:744-745` |
666
- | `layout` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1913-1933` |
666
+ | `layout` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1914-1934` |
667
667
  | `layout` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1313-1339` |
668
668
  | `legacyCompleted` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:386-418` |
669
669
  | `limit` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:101-106` |
@@ -759,7 +759,7 @@ not find it either.
759
759
  | `name` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:939-940` |
760
760
  | `name` | property | `BuiltTrigger` | `dist/case/case-sdk.d.ts:283-284` |
761
761
  | `name` | property | `CarriedConnectorField` | `dist/core/carried-connector-fields.d.ts:41-42` |
762
- | `name` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1815-1821` |
762
+ | `name` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1816-1822` |
763
763
  | `name` | property | `CaseVarDecl` | `dist/case/case-sdk.d.ts:1020` |
764
764
  | `name` | property | `CatchOpts` | `dist/bpmn/bpmn-sdk.d.ts:768-769` |
765
765
  | `name` | property | `ChooseOpts` | `dist/bpmn/bpmn-sdk.d.ts:1959-1960` |
@@ -872,7 +872,7 @@ not find it either.
872
872
  | `outcomes` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:345-359` |
873
873
  | `outcomes` | property | `HumanTaskForm` | `dist/bpmn/human-task-form.d.ts:87-91` |
874
874
  | `outcomes` | property | `PlatformActionSchema` | `dist/nodes/hitl/flow/spec.d.ts:313-314` |
875
- | `output` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1981-1989` |
875
+ | `output` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1982-1990` |
876
876
  | `output` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1607-1642` |
877
877
  | `output` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:97` |
878
878
  | `output` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3341-3349` |
@@ -897,7 +897,7 @@ not find it either.
897
897
  | `outputs` | property | `ReceiveMessageOpts` | `dist/bpmn/bpmn-sdk.d.ts:1514-1529` |
898
898
  | `outputs` | property | `ResolvedEventTriggerOpts` | `dist/case/case-sdk.d.ts:373-377` |
899
899
  | `outputs` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:957-971` |
900
- | `outputs` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1622-1704` |
900
+ | `outputs` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1623-1705` |
901
901
  | `outputSchema` | property | `ClientSideToolRef` | `dist/core/actions.d.ts:521-522` |
902
902
  | `outputVar` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1691-1692` |
903
903
  | `outputVar` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1600-1605` |
@@ -1002,8 +1002,8 @@ not find it either.
1002
1002
  | `required` | property | `PlatformActionSchemaArg` | `dist/nodes/hitl/flow/spec.d.ts:298-299` |
1003
1003
  | `required` | property | `RegistryContextField` | `dist/bpmn/typed-node.d.ts:26` |
1004
1004
  | `required` | property | `RegistryInputField` | `dist/bpmn/typed-node.d.ts:67` |
1005
- | `required` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1735-1741` |
1006
- | `required` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1550-1556` |
1005
+ | `required` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1736-1742` |
1006
+ | `required` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1551-1557` |
1007
1007
  | `required` | property | `TaskInputBinding` | `dist/case/case-sdk.d.ts:915-916` |
1008
1008
  | `required` | property | `TypedContextRow` | `dist/bpmn/typed-node.d.ts:229-230` |
1009
1009
  | `required` | property | `VarOpts` | `dist/bpmn/bpmn-sdk.d.ts:1827-1828` |
@@ -1063,9 +1063,9 @@ not find it either.
1063
1063
  | `rules` | property | `CustomGuardrail` | `dist/core/actions.d.ts:351` |
1064
1064
  | `rules` | property | `FormFieldSettings` | `dist/core/actions.d.ts:183-184` |
1065
1065
  | `runOnce` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:962` |
1066
- | `runOnce` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1557-1563` |
1067
- | `runOnReEntry` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1564-1571` |
1068
- | `savedDocumentExtraction` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1483-1499` |
1066
+ | `runOnce` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1558-1564` |
1067
+ | `runOnReEntry` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1565-1572` |
1068
+ | `savedDocumentExtraction` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1483-1500` |
1069
1069
  | `schema` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3700-3725` |
1070
1070
  | `schema` | property | `BpmnVarDecl` | `dist/bpmn/bpmn-sdk.d.ts:416-417` |
1071
1071
  | `schema` | property | `DataServiceOpts` | `dist/bpmn/bpmn-sdk.d.ts:1187-1192` |
@@ -1079,14 +1079,14 @@ not find it either.
1079
1079
  | `schemas` | property | `BuiltBpmn` | `dist/bpmn/bpmn-sdk.d.ts:539-540` |
1080
1080
  | `schemaVersion` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3668-3697` |
1081
1081
  | `schemaVersion` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:728-734` |
1082
- | `schemaVersion` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1833-1862` |
1082
+ | `schemaVersion` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1834-1863` |
1083
1083
  | `schemaVersion` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1473-1512` |
1084
1084
  | `scope` | property | `EscalationRecipient` | `dist/case/case-sdk.d.ts:188` |
1085
1085
  | `scopes` | property | `GuardrailSelector` | `dist/core/actions.d.ts:292` |
1086
1086
  | `script` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:954-955` |
1087
1087
  | `script` | property | `FlowActionSpecs` | `dist/nodes/script/flow/spec.d.ts:111-114` |
1088
1088
  | `script` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:904-920` |
1089
- | `script` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1500-1529` |
1089
+ | `script` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1501-1530` |
1090
1090
  | `scriptFormat` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:921-922` |
1091
1091
  | `scriptTask` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2452-2460` |
1092
1092
  | `scriptVersion` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:923-936` |
@@ -1120,10 +1120,10 @@ not find it either.
1120
1120
  | `skipCondition` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1355-1356` |
1121
1121
  | `skipCondition` | property | `QueueItemOpts` | `dist/bpmn/bpmn-sdk.d.ts:1402-1403` |
1122
1122
  | `skipCondition` | property | `ReceiveMessageOpts` | `dist/bpmn/bpmn-sdk.d.ts:1512-1513` |
1123
- | `skipWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1579-1585` |
1124
- | `sla` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2059-2067` |
1123
+ | `skipWhen` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1580-1586` |
1124
+ | `sla` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2060-2068` |
1125
1125
  | `sla` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:72-77` |
1126
- | `sla` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1784-1792` |
1126
+ | `sla` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1785-1793` |
1127
1127
  | `slaRules` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1148` |
1128
1128
  | `slaRules` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:979` |
1129
1129
  | `slug` | property | `McpToolRef` | `dist/core/actions.d.ts:464-465` |
@@ -1145,7 +1145,7 @@ not find it either.
1145
1145
  | `sourceTrigger` | property | `CaseVarDecl` | `dist/case/case-sdk.d.ts:1039-1046` |
1146
1146
  | `spec` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1674-1690` |
1147
1147
  | `splitPages` | property | `DocumentClassifyInputs` | `dist/nodes/document/flow/spec.d.ts:16-17` |
1148
- | `stage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2032-2039` |
1148
+ | `stage` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2033-2040` |
1149
1149
  | `stage` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:13-24` |
1150
1150
  | `stages` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1146` |
1151
1151
  | `stages` | property | `CaseLayout` | `dist/case/case-sdk.d.ts:1100-1101` |
@@ -1200,7 +1200,7 @@ not find it either.
1200
1200
  | `target` | property | `TypedInputRow` | `dist/bpmn/typed-node.d.ts:248-249` |
1201
1201
  | `target` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:324-329` |
1202
1202
  | `task` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2461-2469` |
1203
- | `task` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1742-1767` |
1203
+ | `task` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1743-1768` |
1204
1204
  | `tasks` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:36-51` |
1205
1205
  | `taskTitle` | property | `EscalationRef` | `dist/core/actions.d.ts:781-782` |
1206
1206
  | `taxonomy` | property | `DocValidationInputs` | `dist/nodes/hitl/flow/spec.d.ts:97-98` |
@@ -1231,7 +1231,7 @@ not find it either.
1231
1231
  | `transformation` | property | `FieldMapping` | `dist/nodes/transform/flow/spec.d.ts:30-31` |
1232
1232
  | `trigger` | property | `BuiltEntryPoint` | `dist/flow-sdk.d.ts:713-714` |
1233
1233
  | `trigger` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:739-741` |
1234
- | `trigger` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2023-2031` |
1234
+ | `trigger` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:2024-2032` |
1235
1235
  | `trigger` | property | `EscalationOpts` | `dist/case/case-sdk.d.ts:195-196` |
1236
1236
  | `trigger` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1366-1386` |
1237
1237
  | `trigger` | property | `StartOpts` | `dist/bpmn/bpmn-sdk.d.ts:666-713` |
@@ -1306,7 +1306,7 @@ not find it either.
1306
1306
  | `value` | property | `TypedContextRow` | `dist/bpmn/typed-node.d.ts:219-220` |
1307
1307
  | `value` | property | `TypedInputRow` | `dist/bpmn/typed-node.d.ts:250-251` |
1308
1308
  | `values` | property | `DataFabricCreateInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:143-148` |
1309
- | `var` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1990-2022` |
1309
+ | `var` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1991-2023` |
1310
1310
  | `var` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1643-1652` |
1311
1311
  | `var` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3323-3331` |
1312
1312
  | `var` | property | `TaskOutputBinding` | `dist/case/case-sdk.d.ts:925-926` |
@@ -1326,7 +1326,7 @@ not find it either.
1326
1326
  | `varSchema` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:302-316` |
1327
1327
  | `version` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:1131-1137` |
1328
1328
  | `version` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:727` |
1329
- | `version` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1822-1832` |
1329
+ | `version` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1823-1833` |
1330
1330
  | `version` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1554-1555` |
1331
1331
  | `version` | property | `ConnectorMeta` | `dist/core/connectors.d.ts:76` |
1332
1332
  | `version` | property | `ConnectorOpts` | `dist/core/actions.d.ts:16-17` |
@@ -1495,6 +1495,7 @@ declare class TaskBuilder {
1495
1495
  * @returns This builder, so calls chain.
1496
1496
  * @enforcedBy DOCUMENT_EXTRACTION_OLDER_SHAPE `check` warns that the task is carried as saved and a re-save upgrades it.
1497
1497
  * @enforcedBy DOCUMENT_EXTRACTION_SAVED_DATA compile refuses it without its preserved data, or with `.outputs()`.
1498
+ * @enforcedBy DOCUMENT_EXTRACTION_SAVED_VAR_UNDECLARED `check` warns when a saved output row writes a variable no `.var()` declares.
1498
1499
  */
1499
1500
  savedDocumentExtraction(): this;
1500
1501
  /**
@@ -570,6 +570,7 @@ class TaskBuilder {
570
570
  * @returns This builder, so calls chain.
571
571
  * @enforcedBy DOCUMENT_EXTRACTION_OLDER_SHAPE `check` warns that the task is carried as saved and a re-save upgrades it.
572
572
  * @enforcedBy DOCUMENT_EXTRACTION_SAVED_DATA compile refuses it without its preserved data, or with `.outputs()`.
573
+ * @enforcedBy DOCUMENT_EXTRACTION_SAVED_VAR_UNDECLARED `check` warns when a saved output row writes a variable no `.var()` declares.
573
574
  */
574
575
  savedDocumentExtraction() {
575
576
  this.setKind('document-extraction');
@@ -4,11 +4,21 @@
4
4
  *
5
5
  * Usage: node --experimental-strip-types check-cli.js <case.ts | BaseName> \
6
6
  * [--library <library-json dir>] [--connectors-local <overlay dir>] [--bindings <bindings.json>] \
7
- * [-o <the plan compile writes>] [--resources <resources.json>]
7
+ * [-o <the plan compile writes>] [--resources <resources.json>] \
8
+ * [--registry-resolved <tasks/registry-resolved.json> | --no-registry-resolved]
8
9
  * Exits 0 when clean (warnings allowed), 1 on any error.
9
10
  *
10
11
  * The library is opened exactly as `compile-cli` opens it (`openCliLibrary`), so
11
12
  * a connector task `compile` cannot resolve fails here first (#1014).
13
+ *
14
+ * `--registry-resolved <file>` holds each resource task to the resource the
15
+ * SDD resolved it to (RESOURCE_NOT_AS_RESOLVED). With no file named, check
16
+ * looks where `uip maestro case sdd resolve` writes it (`registryCandidates`).
17
+ * A file found there that gives no entries is reported and passed over; a
18
+ * named one is an error. The file read, how many resource tasks it judged, the
19
+ * tasks it had no entry for, and the entries it could not use are printed, so
20
+ * the check is never silent. `--no-registry-resolved` turns it off for an
21
+ * author who chose another resource on purpose, and check says so.
12
22
  */
13
23
  import { reportDiagnostics } from '../cli-result.js';
14
24
  import { resolveCaseFile, loadBuiltCase } from './load.js';
@@ -20,9 +30,71 @@ import { runWhenInvokedDirectly } from '../cli-run.js';
20
30
  import { ensureTypeScriptRuntime } from '../node-runtime.js';
21
31
  import { defaultResourcesFile } from '../workdir.js';
22
32
  import { readCliResources } from '../registry/prepare/resources.js';
33
+ import { DEFAULT_REGISTRY_RESOLVED, RESOLVE_COMMAND, readRegistryResolved, registryResolvedCoverage } from './registry-resolved.js';
34
+ import { existsSync, readFileSync } from 'node:fs';
35
+ import { dirname, join, relative, resolve } from 'node:path';
23
36
  /** Flags that take a value: their argument is never the source positional. */
24
- const VALUE_FLAGS = new Set(['--library', '--connectors-local', '--bindings', '--resources', '-o']);
25
- const USAGE = 'usage: check <case.ts | BaseName> [--library <dir>] [--connectors-local <dir>] [--bindings <file>] [--resources <file>] [-o <plan>]';
37
+ const VALUE_FLAGS = new Set(['--library', '--connectors-local', '--bindings', '--resources', '--registry-resolved', '-o']);
38
+ const USAGE = 'usage: check <case.ts | BaseName> [--library <dir>] [--connectors-local <dir>] [--bindings <file>] [--resources <file>] [--registry-resolved <file> | --no-registry-resolved] [-o <plan>]';
39
+ /**
40
+ * Where to look for the SDD's resolutions when no file is named: the working
41
+ * directory's `tasks/`, then beside the case file and up to two directories
42
+ * above it, under `tasks/` or at the root (cli `findRegistryLedger`). The
43
+ * authoring layout puts the case at `<workspace>/<solution>/<project>/` and the
44
+ * file at `<workspace>/tasks/`, so check run from either place finds it.
45
+ */
46
+ function registryCandidates(caseFile) {
47
+ const dir = dirname(resolve(caseFile));
48
+ const all = [resolve(DEFAULT_REGISTRY_RESOLVED)];
49
+ for (const up of ['', '..', join('..', '..')])
50
+ for (const leaf of ['tasks', '.'])
51
+ all.push(resolve(dir, up, leaf, 'registry-resolved.json'));
52
+ return [...new Set(all)];
53
+ }
54
+ const shown = (file) => relative(process.cwd(), file) || file;
55
+ /** Read one registry-resolved file: its resolutions, or why it gives none. */
56
+ function readRegistryFile(file) {
57
+ let json;
58
+ try {
59
+ json = JSON.parse(readFileSync(file, 'utf8'));
60
+ }
61
+ catch (e) {
62
+ return { why: `not JSON (${e.message})` };
63
+ }
64
+ const registry = readRegistryResolved(json);
65
+ return registry ? { registry: { ...registry, file: shown(file) } } : { why: 'no resolved entries (no object with a "task" and a "selected")' };
66
+ }
67
+ /**
68
+ * The SDD's resolutions. A file named with `--registry-resolved` must give
69
+ * some: if not, that is an error. Otherwise the first candidate that gives
70
+ * some is used, and each candidate passed over is reported in `notes`.
71
+ * `--no-registry-resolved` reads none, and says so when a candidate exists.
72
+ */
73
+ function cliRegistryResolved(argv, caseFile) {
74
+ const i = argv.indexOf('--registry-resolved');
75
+ const named = i >= 0 ? argv[i + 1] : undefined;
76
+ const found = () => registryCandidates(caseFile).filter((f) => existsSync(f));
77
+ if (argv.includes('--no-registry-resolved')) {
78
+ if (i >= 0)
79
+ return { error: '--registry-resolved and --no-registry-resolved are both given. Remove one of them.', notes: [] };
80
+ const first = found()[0];
81
+ return { notes: first ? [`check: ${shown(first)} not read (--no-registry-resolved): resource tasks are not held to the SDD's resolutions.`] : [] };
82
+ }
83
+ if (named !== undefined) {
84
+ if (!existsSync(resolve(named)))
85
+ return { error: `cannot read ${named}: no such file. Name the file \`${RESOLVE_COMMAND}\` wrote, or drop --registry-resolved.`, notes: [] };
86
+ const { registry, why } = readRegistryFile(resolve(named));
87
+ return registry ? { registry, notes: [] } : { error: `cannot read ${named}: ${why}. Fix the file, or drop --registry-resolved.`, notes: [] };
88
+ }
89
+ const notes = [];
90
+ for (const file of found()) {
91
+ const { registry, why } = readRegistryFile(file);
92
+ if (registry)
93
+ return { registry, notes };
94
+ notes.push(`check: ${shown(file)} not read: ${why}. Resource tasks are not held to it.`);
95
+ }
96
+ return { notes };
97
+ }
26
98
  export async function run(argv) {
27
99
  if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
28
100
  console.error(USAGE);
@@ -40,7 +112,45 @@ export async function run(argv) {
40
112
  // binding-label rules (#1034): `-o` names the plan as it does for compile.
41
113
  const { bindings } = caseCompileTarget(argv);
42
114
  const resources = readCliResources(argv, defaultResourcesFile());
43
- const diags = check(built, { ...caseCheckOpts(openCliLibrary(argv), bindings), ...(resources ? { resources } : {}) });
115
+ const resolved = cliRegistryResolved(argv, file);
116
+ if (resolved.error) {
117
+ console.error(`check: ${resolved.error}`);
118
+ return 1;
119
+ }
120
+ for (const note of resolved.notes)
121
+ console.error(note);
122
+ if (resolved.registry) {
123
+ const cover = registryResolvedCoverage(built, resolved.registry);
124
+ const quoted = (names) => names.map((n) => JSON.stringify(n)).join(', ');
125
+ const { resolved: list, unusable } = resolved.registry;
126
+ const inSolution = list.filter((e) => e.selected.inSolution).length;
127
+ const open = unusable.filter((e) => e.why === 'unresolved').length;
128
+ const noName = unusable.length - open;
129
+ console.error(`check: resource tasks held to ${resolved.registry.file}: ${cover.held} of ${cover.held + cover.noEntry.length + cover.ambiguous.length + cover.unusable.length} judged`
130
+ + ` (${list.length} resolution(s)${open ? `, ${open} unresolved` : ''}`
131
+ + `${noName ? `, ${noName} with no selected name` : ''}`
132
+ + `${inSolution ? `, ${inSolution} with no folder, read as solution_folder (a project in this solution)` : ''}).`);
133
+ if (cover.noEntry.length)
134
+ console.error(`check: not judged, no entry with this task name: ${quoted(cover.noEntry)}. `
135
+ + 'Use the SDD\'s task name, or resolve the task again.');
136
+ if (cover.ambiguous.length)
137
+ console.error(`check: not judged, more than one entry has this task name and none is in the task's stage: ${quoted(cover.ambiguous)}. `
138
+ + 'Use the SDD\'s stage name, or resolve the task again.');
139
+ const unjudged = (why) => cover.unusable.filter((u) => u.why === why).map((u) => u.task);
140
+ if (unjudged('unresolved').length)
141
+ console.error(`check: not judged, the SDD left the task unresolved (selected: null): ${quoted(unjudged('unresolved'))}. `
142
+ + 'A resource created for it is not checked against the SDD.');
143
+ if (unjudged('no-name').length)
144
+ console.error(`check: not judged, the entry's selection has no string name: ${quoted(unjudged('no-name'))}. `
145
+ + `Fix the entry, or resolve the task again (\`${RESOLVE_COMMAND}\`).`);
146
+ if (cover.unused.length)
147
+ console.error(`check: no resource task matched these resolutions: ${quoted(cover.unused)}.`);
148
+ }
149
+ const diags = check(built, {
150
+ ...caseCheckOpts(openCliLibrary(argv), bindings),
151
+ ...(resources ? { resources } : {}),
152
+ ...(resolved.registry ? { registryResolved: resolved.registry } : {}),
153
+ });
44
154
  reportDiagnostics(diags);
45
155
  for (const d of diags)
46
156
  console.error(` ${d.level === 'error' ? '✗' : '⚠'} [${d.code}] ${d.message}`);
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import type { BuiltCase } from './case-sdk.js';
15
15
  import { type ConnectorCheckOpts } from '../core/connector-checks.js';
16
+ import { type RegistryResolved } from './registry-resolved.js';
16
17
  import type { Library } from '../core/library.js';
17
18
  export interface Diagnostic {
18
19
  level: 'error' | 'warning';
@@ -43,6 +44,12 @@ export interface Diagnostic {
43
44
  export type CaseCheckOpts = Pick<ConnectorCheckOpts, 'lookups' | 'resolutions' | 'resources' | 'schemaReadiness' | 'bindings'> & {
44
45
  /** The library `compile` serializes against, for the serializer `check` runs. */
45
46
  library?: Library;
47
+ /**
48
+ * The resources the SDD resolved each task to (`tasks/registry-resolved.json`,
49
+ * read with `readRegistryResolved`). A resource task whose name or folder
50
+ * differs is RESOURCE_NOT_AS_RESOLVED. Omit it and no task is judged.
51
+ */
52
+ registryResolved?: RegistryResolved;
46
53
  };
47
54
  /**
48
55
  * Validate a built case.
@@ -4,10 +4,12 @@ import { schemaVersionRefusal } from '../schema-version.js';
4
4
  import { EQUALS_EXPR_DIALECT, checkConnectorLookups, checkConnectorResources, checkConnectorSchema, } from '../core/connector-checks.js';
5
5
  import { isConnectorPlaceholder } from './connector-placeholder.js';
6
6
  import { documentExtractionLint } from './document-extraction.js';
7
- import { savedDocumentExtractionLint } from './document-extraction-saved.js';
7
+ import { carriedDocumentExtractionTasks, savedDocumentExtractionLint, savedDocumentExtractionVarLint } from './document-extraction-saved.js';
8
+ import { caseJsonPreservation } from './preserve.js';
8
9
  import { scriptLint } from './script.js';
9
10
  import { httpRequestLint } from './http-request.js';
10
11
  import { checkRuleSemantics } from './check-rule-semantics.js';
12
+ import { registryResolvedLint } from './registry-resolved.js';
11
13
  import { serialize } from './serialize.js';
12
14
  import { lintPlanFindings, planReport } from './plan-check/index.js';
13
15
  import { caseExprLints } from './case-expr-check.js';
@@ -226,6 +228,9 @@ export function check(built, opts = {}) {
226
228
  const f = savedDocumentExtractionLint(`Document extraction task "${t.name}"`);
227
229
  diags.push({ level: 'warning', code: f.code, message: f.message, suggestion: f.suggestion, where: t.name });
228
230
  }
231
+ // A carried task's saved row that writes an undeclared variable (lint).
232
+ for (const f of savedDocumentExtractionVarLint(carriedDocumentExtractionTasks(built), caseJsonPreservation(built)?.documentExtractionData, new Set(built.vars.map((v) => v.name))))
233
+ diags.push({ level: 'warning', code: f.code, message: f.message, suggestion: f.suggestion, where: f.where });
229
234
  // A script body compile writes as authored but a person should fix (lint).
230
235
  for (const stage of built.stages)
231
236
  for (const lane of stage.lanes)
@@ -242,6 +247,10 @@ export function check(built, opts = {}) {
242
247
  for (const f of httpRequestLint(`HTTP request task "${t.name}"`, t.http))
243
248
  diags.push({ level: 'error', code: f.code, message: f.message, ...(f.suggestion ? { suggestion: f.suggestion } : {}), where: t.name });
244
249
  checkRuleSemantics(built, diags);
250
+ // A resource task bound to another resource than the SDD resolved (lint).
251
+ if (opts.registryResolved)
252
+ for (const f of registryResolvedLint(built, opts.registryResolved))
253
+ diags.push({ level: 'error', code: f.code, message: f.message, suggestion: f.suggestion, where: f.where });
245
254
  checkLibraryConnectors(built, opts, diags);
246
255
  diags.push(...serializerRefusals(built, opts, diags, reportedReads));
247
256
  return diags;
@@ -446,13 +455,17 @@ function checkSla(sla, where, diags) {
446
455
  // escalation notifies nobody until the id is filled in. The test is the one
447
456
  // CASE_MGMT_ESCALATION_RECIPIENT_LITERAL skips on (plan-check/rules/sla.ts),
448
457
  // so the two split every non-GUID target with no gap: `<UNRESOLVED>`,
449
- // `<UNRESOLVED: …>` and a marker mid-string all land here.
458
+ // `<UNRESOLVED: …>` and a marker mid-string all land here. So does a blank
459
+ // target, which neither rule otherwise reports and `validate` accepts: it is
460
+ // the same gap, a recipient with nobody named yet.
450
461
  for (const r of e.notify)
451
- if (r.target.includes('<UNRESOLVED'))
462
+ if (r.target.includes('<UNRESOLVED') || r.target.trim() === '')
452
463
  diags.push({
453
464
  level: 'warning',
454
465
  code: 'ESCALATION_RECIPIENT_UNRESOLVED',
455
- message: `${where}: an escalation recipient is still the marker ${JSON.stringify(r.target)}, so it notifies no one until the tenant id is filled in.`,
466
+ message: r.target.trim() === ''
467
+ ? `${where}: an escalation recipient has a blank target, so it notifies no one.`
468
+ : `${where}: an escalation recipient is still the marker ${JSON.stringify(r.target)}, so it notifies no one until the tenant id is filled in.`,
456
469
  suggestion: r.scope === 'UserGroup'
457
470
  ? "Put the group's tenant id in target: toGroup('<group id>', '<name>'). 'uip admin groups list --output json' lists them."
458
471
  : "Put the user's tenant id or email in target: toUser('<user id or email>', '<email>').",
@@ -1,4 +1,5 @@
1
1
  import type { DocumentExtractionFinding } from './document-extraction.js';
2
+ import type { BuiltCase } from './case-sdk.js';
2
3
  /** Whether a document-extraction task's saved `data` is the older shape, which is carried rather than lifted. */
3
4
  export declare function isOlderDocumentExtractionData(data: unknown): data is Record<string, unknown>;
4
5
  /** One carried task's saved `data`, located the way the other per-task lanes are. */
@@ -19,6 +20,54 @@ export declare function savedDocumentExtractionLint(owner: string): DocumentExtr
19
20
  * refusal: the task names no saved data (the payload was dropped or the task
20
21
  * renamed), or it maps outputs, which the saved rows already are.
21
22
  */
22
- export declare function savedDocumentExtractionData(owner: string, entries: readonly PreservedDocumentExtractionData[] | undefined, stage: string, task: string, hasOutputs: boolean): Record<string, unknown>;
23
+ export declare function savedDocumentExtractionData(owner: string, pairing: SavedDocumentExtractionPairing, stage: string, task: string, hasOutputs: boolean): Record<string, unknown>;
24
+ /** A `.savedDocumentExtraction()` task, as compile meets it. */
25
+ export interface SavedDocumentExtractionTask {
26
+ stage: string;
27
+ task: string;
28
+ }
29
+ /** Each carried task's payload entry, keyed by {@link savedTaskKey}; `unpaired` is what could not be matched. */
30
+ export interface SavedDocumentExtractionPairing {
31
+ get(key: string): PreservedDocumentExtractionData | undefined;
32
+ readonly unpaired: readonly PreservedDocumentExtractionData[];
33
+ }
34
+ export declare const savedTaskKey: (stage: string, task: string) => string;
35
+ /**
36
+ * Pairs each carried task with its payload entry, following a rename. The
37
+ * payload names a task by its stage label and task name, as every per-task
38
+ * lane does; an edit that renames the stage or the task would otherwise lose
39
+ * the data, and compile would refuse a plan the author only relabelled.
40
+ *
41
+ * Exact (stage, task) pairs go first. Renames are followed only when as many
42
+ * entries are left as tasks: one entry more means a task was deleted too, and
43
+ * then a rename cannot be told apart from a deletion. A task left over then takes an entry
44
+ * that shares its stage (the task was renamed) or its name (the stage was
45
+ * renamed), but only when that entry is the one entry left sharing either with
46
+ * the task, and the task is the one task left sharing either with the entry.
47
+ * So a task whose stage points at one entry and whose name points at another
48
+ * (a carried task deleted, another moved into its stage) stays unpaired rather
49
+ * than taking the wrong task's data. Last, the only entry left goes to the
50
+ * only task left (both renamed). Anything ambiguous stays unpaired, and compile
51
+ * refuses it by name ({@link savedDocumentExtractionData}).
52
+ */
53
+ export declare function pairSavedDocumentExtractions(tasks: readonly SavedDocumentExtractionTask[], entries: readonly PreservedDocumentExtractionData[] | undefined): SavedDocumentExtractionPairing;
54
+ /** A carried task's saved output rows that write a variable other than their own id: row id → variable. */
55
+ export declare function savedRowMappings(data: Record<string, unknown>): Map<string, string>;
56
+ /** The plan's carried document-extraction tasks, by stage label and task name: what {@link pairSavedDocumentExtractions} pairs. */
57
+ export declare function carriedDocumentExtractionTasks(built: BuiltCase): SavedDocumentExtractionTask[];
58
+ /**
59
+ * What `check` says (`lint`, a warning) when a carried task's saved row writes
60
+ * a variable no `.var()` declares. The mapping sits in the payload, so the
61
+ * `.var()` looks unused in the source, and deleting it leaves the result with
62
+ * nowhere to go. Compile writes the plan as saved and adds no root variable:
63
+ * the saved plan did not have one either when it came that way.
64
+ *
65
+ * Only entries paired with a task in the source are judged, as compile pairs
66
+ * them: the entry of a deleted task is not written, so its variable is not
67
+ * needed. The finding names the task as the source names it now.
68
+ */
69
+ export declare function savedDocumentExtractionVarLint(tasks: readonly SavedDocumentExtractionTask[], entries: readonly PreservedDocumentExtractionData[] | undefined, declared: ReadonlySet<string>): (DocumentExtractionFinding & {
70
+ where: string;
71
+ })[];
23
72
  /** Why a payload's `documentExtractionData` entry cannot stand, or `undefined`. */
24
73
  export declare function preservedDocumentExtractionDataError(entry: PreservedDocumentExtractionData): string | undefined;
@@ -43,14 +43,116 @@ export function savedDocumentExtractionLint(owner) {
43
43
  * refusal: the task names no saved data (the payload was dropped or the task
44
44
  * renamed), or it maps outputs, which the saved rows already are.
45
45
  */
46
- export function savedDocumentExtractionData(owner, entries, stage, task, hasOutputs) {
46
+ export function savedDocumentExtractionData(owner, pairing, stage, task, hasOutputs) {
47
47
  if (hasOutputs)
48
48
  throw new CompileRefusal('DOCUMENT_EXTRACTION_SAVED_DATA', `${owner} is carried as saved, and its saved output rows are written as they are; .outputs() cannot add to them.`, 'Drop .outputs(), or re-author the task with .documentExtraction(model, spec) and map its outputs there.');
49
- const entry = (entries ?? []).find((e) => e.stage === stage && e.task === task);
50
- if (!entry)
51
- throw new CompileRefusal('DOCUMENT_EXTRACTION_SAVED_DATA', `${owner} is .savedDocumentExtraction(), but the preserveCaseJson(...) payload carries no documentExtractionData entry for stage "${stage}", task "${task}".`, 'Keep the payload decompile wrote (and the stage and task names it records), or re-author the task with .documentExtraction(model, spec).');
49
+ const entry = pairing.get(savedTaskKey(stage, task));
50
+ if (!entry) {
51
+ const unpaired = pairing.unpaired.map((e) => `{ stage: "${e.stage}", task: "${e.task}" }`).join(', ');
52
+ throw new CompileRefusal('DOCUMENT_EXTRACTION_SAVED_DATA', `${owner} is .savedDocumentExtraction(), but the preserveCaseJson(...) payload carries no documentExtractionData entry for stage "${stage}", task "${task}"`
53
+ + (unpaired ? `, and the entries left over (${unpaired}) cannot be told apart.` : '.'), unpaired
54
+ ? `Set that entry's stage to "${stage}" and its task to "${task}" in the payload's documentExtractionData, or re-author the task with .documentExtraction(model, spec).`
55
+ : 'Keep the payload decompile wrote, or re-author the task with .documentExtraction(model, spec).');
56
+ }
52
57
  return structuredClone(entry.data);
53
58
  }
59
+ export const savedTaskKey = (stage, task) => JSON.stringify([stage, task]);
60
+ /**
61
+ * Pairs each carried task with its payload entry, following a rename. The
62
+ * payload names a task by its stage label and task name, as every per-task
63
+ * lane does; an edit that renames the stage or the task would otherwise lose
64
+ * the data, and compile would refuse a plan the author only relabelled.
65
+ *
66
+ * Exact (stage, task) pairs go first. Renames are followed only when as many
67
+ * entries are left as tasks: one entry more means a task was deleted too, and
68
+ * then a rename cannot be told apart from a deletion. A task left over then takes an entry
69
+ * that shares its stage (the task was renamed) or its name (the stage was
70
+ * renamed), but only when that entry is the one entry left sharing either with
71
+ * the task, and the task is the one task left sharing either with the entry.
72
+ * So a task whose stage points at one entry and whose name points at another
73
+ * (a carried task deleted, another moved into its stage) stays unpaired rather
74
+ * than taking the wrong task's data. Last, the only entry left goes to the
75
+ * only task left (both renamed). Anything ambiguous stays unpaired, and compile
76
+ * refuses it by name ({@link savedDocumentExtractionData}).
77
+ */
78
+ export function pairSavedDocumentExtractions(tasks, entries) {
79
+ const paired = new Map();
80
+ let left = [...(entries ?? [])];
81
+ let waiting = tasks.filter((t) => {
82
+ const i = left.findIndex((e) => e.stage === t.stage && e.task === t.task);
83
+ if (i < 0)
84
+ return true;
85
+ paired.set(savedTaskKey(t.stage, t.task), left[i]);
86
+ left.splice(i, 1);
87
+ return false;
88
+ });
89
+ // A rename is followed only when the counts leave no room for a deletion:
90
+ // with more entries left than tasks waiting, "A renamed, B deleted" and "B
91
+ // renamed, A deleted" can fit the same source, so the waiting tasks stay
92
+ // unpaired and compile refuses them by name.
93
+ if (left.length !== waiting.length)
94
+ return { get: (key) => paired.get(key), unpaired: left };
95
+ // A rename keeps the stage or the name. Both rules are asked at once, so one
96
+ // cannot pair a task the other points elsewhere.
97
+ const shares = (t, e) => e.stage === t.stage || e.task === t.task;
98
+ for (let progressed = true; progressed;) {
99
+ progressed = false;
100
+ waiting = waiting.filter((t) => {
101
+ const candidates = left.filter((e) => shares(t, e));
102
+ if (candidates.length !== 1 || waiting.filter((other) => shares(other, candidates[0])).length !== 1)
103
+ return true;
104
+ paired.set(savedTaskKey(t.stage, t.task), candidates[0]);
105
+ left = left.filter((e) => e !== candidates[0]);
106
+ progressed = true;
107
+ return false;
108
+ });
109
+ }
110
+ if (waiting.length === 1 && left.length === 1) {
111
+ paired.set(savedTaskKey(waiting[0].stage, waiting[0].task), left[0]);
112
+ left = [];
113
+ }
114
+ return { get: (key) => paired.get(key), unpaired: left };
115
+ }
116
+ /** A carried task's saved output rows that write a variable other than their own id: row id → variable. */
117
+ export function savedRowMappings(data) {
118
+ const mappings = new Map();
119
+ for (const row of Array.isArray(data.outputs) ? data.outputs : []) {
120
+ const { id, var: variable } = (row ?? {});
121
+ if (typeof id === 'string' && typeof variable === 'string' && variable !== '' && variable !== id)
122
+ mappings.set(id, variable);
123
+ }
124
+ return mappings;
125
+ }
126
+ /** The plan's carried document-extraction tasks, by stage label and task name: what {@link pairSavedDocumentExtractions} pairs. */
127
+ export function carriedDocumentExtractionTasks(built) {
128
+ return built.stages.flatMap((stage) => stage.lanes.flat().filter((task) => task.documentExtractionSaved).map((task) => ({ stage: stage.label, task: task.name })));
129
+ }
130
+ /**
131
+ * What `check` says (`lint`, a warning) when a carried task's saved row writes
132
+ * a variable no `.var()` declares. The mapping sits in the payload, so the
133
+ * `.var()` looks unused in the source, and deleting it leaves the result with
134
+ * nowhere to go. Compile writes the plan as saved and adds no root variable:
135
+ * the saved plan did not have one either when it came that way.
136
+ *
137
+ * Only entries paired with a task in the source are judged, as compile pairs
138
+ * them: the entry of a deleted task is not written, so its variable is not
139
+ * needed. The finding names the task as the source names it now.
140
+ */
141
+ export function savedDocumentExtractionVarLint(tasks, entries, declared) {
142
+ const pairing = pairSavedDocumentExtractions(tasks, entries);
143
+ return tasks.flatMap((t) => {
144
+ const entry = pairing.get(savedTaskKey(t.stage, t.task));
145
+ return entry ? [{ t, entry }] : [];
146
+ }).flatMap(({ t, entry }) => [...savedRowMappings(entry.data)]
147
+ .filter(([, variable]) => !declared.has(variable))
148
+ .map(([row, variable]) => ({
149
+ where: t.task,
150
+ code: 'DOCUMENT_EXTRACTION_SAVED_VAR_UNDECLARED',
151
+ message: `Document extraction task "${t.task}" (stage "${t.stage}") is carried as saved, and its saved output row "${row}" `
152
+ + `writes case variable "${variable}", which no .var() declares. The plan has no root variable for it, so the result has nowhere to go.`,
153
+ suggestion: `Declare it: .var("${variable}", "object"). The mapping is in the preserveCaseJson(...) payload, so the .var() can look unused.`,
154
+ })));
155
+ }
54
156
  /** Why a payload's `documentExtractionData` entry cannot stand, or `undefined`. */
55
157
  export function preservedDocumentExtractionDataError(entry) {
56
158
  const where = `preserved document-extraction data of task "${entry?.stage}/${entry?.task}"`;
@@ -135,7 +135,8 @@ export function httpRequestRefusal(owner, spec) {
135
135
  return {
136
136
  code: 'HTTP_REQUEST_BODY_EXPRESSION',
137
137
  message: `${owner} body has the value ${JSON.stringify(leaf)}, an \`=\` expression compile cannot write as a JavaScript value inside the body: `
138
- + 'a body value must be a reference, or `=js:` followed by exactly one JavaScript expression (not a statement, nor code that does not parse).',
138
+ + 'a body value must be a reference, or `=js:` followed by exactly one JavaScript expression (not a statement, nor code that does not parse, '
139
+ + 'nor an HTML-like `<!--` / `-->` comment, which `uip maestro case validate --strict` refuses).',
139
140
  suggestion: "Write the value as `=js:<expression>` (for example '=js:vars.amount * 2'), as a reference (`=vars.amount`), "
140
141
  + "or as another task's output (`=${taskOutput('Stage', 'Task', 'body')}`).",
141
142
  };
@@ -179,12 +180,26 @@ function isTaskOutputReference(text) {
179
180
  function oneExpression(code) {
180
181
  const text = `(${code}\n)`;
181
182
  let program;
183
+ // Script mode accepts Annex B's HTML-like comments (`<!--`, and `-->` at a
184
+ // line start), which `validate --strict` refuses and the Case runtime's engine
185
+ // is not known to accept; module mode would refuse them but is strict, which
186
+ // changes more than that (legacy octal `010`, which the CLI accepts). So a
187
+ // comment acorn reports that opens with either marker refuses the value.
188
+ let htmlComment = false;
182
189
  try {
183
- program = parse(text, { ecmaVersion: 'latest', sourceType: 'script', preserveParens: true });
190
+ program = parse(text, {
191
+ ecmaVersion: 'latest', sourceType: 'script', preserveParens: true,
192
+ onComment: (_block, _body, start) => {
193
+ if (text.startsWith('<!--', start) || text.startsWith('-->', start))
194
+ htmlComment = true;
195
+ },
196
+ });
184
197
  }
185
198
  catch {
186
199
  return undefined;
187
200
  }
201
+ if (htmlComment)
202
+ return undefined;
188
203
  const [statement] = program.body;
189
204
  if (program.body.length !== 1 || statement.type !== 'ExpressionStatement')
190
205
  return undefined;
@@ -1,5 +1,4 @@
1
1
  import { asRecord, planTasks } from '../walk.js';
2
- import { WRITTEN_BY_COMPILE } from './common.js';
3
2
  /** The CLI's `RECIPIENT_PREFIXES`: a value still carrying one is `STRICT_RECIPIENT_PREFIX_LEFT`'s, not ported. */
4
3
  const RECIPIENT_PREFIXES = ['User:', 'UserGroup:', 'Role:', 'Email:', 'Expression:'];
5
4
  const recipientExpressionType = {
@@ -99,7 +98,13 @@ const taskMissingElementId = {
99
98
  found.push({
100
99
  path: `nodes[${t.stageId}].data.tasks[${t.taskId}]`,
101
100
  message: `Task "${t.taskLabel}" carries inputs or outputs but has no "elementId", so those variables do not resolve to it.`,
102
- fix: `The elementId is "${t.stageId}-${t.taskId}"; ${WRITTEN_BY_COMPILE}`,
101
+ // Compile stamps every task's elementId, so this fires only on a plan
102
+ // decompiled from a Designer save that omitted it (`omitTaskElementIds`):
103
+ // the shared "else it is an SDK bug" text would point the wrong way.
104
+ fix: `The source plan omitted this task's elementId ("${t.stageId}-${t.taskId}") and compile kept the omission, `
105
+ + 'so the plan stays as the Designer saved it. Remove this task from omitTaskElementIds in the preserveCaseJson(...) '
106
+ + 'payload, and compile writes the elementId. Or, in the Case Designer, select the task\'s resource again. '
107
+ + 'A plain re-save keeps the omission.',
103
108
  where: t.taskLabel,
104
109
  nodeId: t.taskId,
105
110
  });
@@ -0,0 +1,121 @@
1
+ /**
2
+ * case/registry-resolved — `check` holds each resource task to the resource
3
+ * the SDD resolved it to.
4
+ *
5
+ * `uip maestro case sdd resolve sdd.md --out tasks/registry-resolved.json`
6
+ * records, per SDD task, the tenant resource it was resolved to:
7
+ *
8
+ * { "resolved": [ { "stage": "Binding Matrix (`bindingMatrix`)", "task": "Echo literal",
9
+ * "taskType": "api-workflow",
10
+ * "selected": { "name": "API Workflow", "folder": "Shared/…/CM-Golden-Expense-Reporting-106", … } } ] }
11
+ *
12
+ * An author who then writes a different name or folder on the task (the
13
+ * folder's last segment as the name, say) gets a plan that compiles and
14
+ * validates, but binds a resource the tenant does not have under that key.
15
+ * Compile and `validate` read the name and folder as free strings. So `check`
16
+ * compares them (RESOURCE_NOT_AS_RESOLVED, `lint`: compile writes the task as
17
+ * authored).
18
+ *
19
+ * Why the ledger may make `check` stricter. The CLI reads the same file only
20
+ * to soften a finding, because the agent being audited can edit it. Here the
21
+ * ledger is the record of the resources the user approved in the SDD review,
22
+ * and `check` runs while the agent authors against it. A wrong binding is the
23
+ * likely error, and an edit to the ledger to match it is not. The two cases
24
+ * where the ledger is wrong have a way out: run `sdd resolve` again when the
25
+ * SDD changed, or pass `--no-registry-resolved` for a resource chosen on purpose.
26
+ *
27
+ * Read as data, the way the CLI reads it (`registry-ledger.ts`): entries are
28
+ * found wherever they sit, to a bounded depth, so a bare array or another
29
+ * envelope reads too. An entry this module cannot use is kept and reported,
30
+ * never guessed at. A selection with no folder is a project in this solution,
31
+ * read as `solution_folder`, and the message says so. Comparison follows the
32
+ * CLI's `comparableFolder`: folders ignore case, surrounding whitespace and
33
+ * leading or trailing slashes. Names are exact, against `selected.name`, the
34
+ * one name `sdd resolve` writes and `validate --strict --sdd` compares. An
35
+ * action app also answers to its other spellings (`deploymentTitle`, `title`,
36
+ * `displayName`), as `sdd resolve` matches it.
37
+ */
38
+ import type { BuiltCase } from './case-sdk.js';
39
+ /** Where `uip maestro case sdd resolve` writes its resolutions, relative to the workspace. */
40
+ export declare const DEFAULT_REGISTRY_RESOLVED = "tasks/registry-resolved.json";
41
+ /** The command that writes the resolutions again. */
42
+ export declare const RESOLVE_COMMAND = "uip maestro case sdd resolve sdd.md --out tasks/registry-resolved.json";
43
+ /** One resolved SDD task. */
44
+ export interface RegistryResolution {
45
+ /** The SDD's stage heading, e.g. "Review (`review`)". Absent in some hand-written ledgers. */
46
+ stage?: string;
47
+ /** The SDD task's name. */
48
+ task: string;
49
+ /** The SDD task type, e.g. `api-workflow`, `process`, `agent`. */
50
+ taskType?: string;
51
+ /**
52
+ * The resource the task resolved to. `name` is the one to write; `names`
53
+ * holds every spelling the task may bind (more than one only for an action
54
+ * app). `inSolution` marks a project in this solution, which the entry gives
55
+ * with no folder: `folder` is then `solution_folder`.
56
+ */
57
+ selected: {
58
+ name: string;
59
+ names: readonly string[];
60
+ folder: string;
61
+ inSolution: boolean;
62
+ };
63
+ }
64
+ /** An entry `check` cannot judge a task against, and why. */
65
+ export interface UnusableEntry {
66
+ stage?: string;
67
+ task: string;
68
+ /** `unresolved`: `selected` is null, the SDD left the task open. `no-name`: the selection has no string name. */
69
+ why: 'unresolved' | 'no-name';
70
+ }
71
+ /** What `check` needs from a registry-resolved file, with the entries it cannot use. */
72
+ export interface RegistryResolved {
73
+ resolved: readonly RegistryResolution[];
74
+ /** Entries found but not usable. They still count when tasks are matched by name. */
75
+ unusable: readonly UnusableEntry[];
76
+ /** The file read, for messages. Defaults to {@link DEFAULT_REGISTRY_RESOLVED}. */
77
+ file?: string;
78
+ }
79
+ /** A finding from {@link registryResolvedLint}. */
80
+ export interface RegistryResolvedFinding {
81
+ code: 'RESOURCE_NOT_AS_RESOLVED';
82
+ message: string;
83
+ suggestion: string;
84
+ where: string;
85
+ }
86
+ /** A folder in the form two spellings of it share (cli `comparableFolder`). */
87
+ export declare function comparableFolder(folder: string): string;
88
+ /**
89
+ * Read a parsed registry-resolved file. Returns `undefined` when it holds no
90
+ * entry. An entry with `selected: null` and one whose selection has no string
91
+ * name are kept as {@link UnusableEntry}. A selection with `source: "local"`
92
+ * or no folder is a project in this solution (`sdd resolve` writes a sibling
93
+ * that way): its folder is read as `solution_folder` and marked `inSolution`.
94
+ */
95
+ export declare function readRegistryResolved(json: unknown): RegistryResolved | undefined;
96
+ /** The stage label of an SDD stage heading: "Review (`review`)" → "Review". */
97
+ export declare function sddStageLabel(heading: string): string;
98
+ /** How the SDD's resolutions met the plan's resource tasks: what `check` judged and what it could not. */
99
+ export interface RegistryResolvedCoverage {
100
+ /** Resource tasks matched to a usable entry, so judged. */
101
+ held: number;
102
+ /** Resource tasks (by name) with no entry of that name: not judged. A renamed task lands here. */
103
+ noEntry: string[];
104
+ /** Resource tasks (by name) whose name more than one entry has, none of them in the task's stage: not judged. */
105
+ ambiguous: string[];
106
+ /** Resource tasks matched to an entry `check` cannot use: not judged. */
107
+ unusable: {
108
+ task: string;
109
+ why: UnusableEntry['why'];
110
+ }[];
111
+ /** Usable entries (by task name) that no resource task matched. */
112
+ unused: string[];
113
+ }
114
+ /** What {@link registryResolvedLint} judged, so the CLI can say what it did not. */
115
+ export declare function registryResolvedCoverage(built: BuiltCase, registry: RegistryResolved): RegistryResolvedCoverage;
116
+ /**
117
+ * A resource task whose name or folder differs from the resource the SDD
118
+ * resolved it to. Tasks are matched as {@link matchTasks} says; a task with no
119
+ * usable entry is not judged ({@link registryResolvedCoverage} counts it).
120
+ */
121
+ export declare function registryResolvedLint(built: BuiltCase, registry: RegistryResolved): RegistryResolvedFinding[];
@@ -0,0 +1,155 @@
1
+ /** Where `uip maestro case sdd resolve` writes its resolutions, relative to the workspace. */
2
+ export const DEFAULT_REGISTRY_RESOLVED = 'tasks/registry-resolved.json';
3
+ /** The command that writes the resolutions again. */
4
+ export const RESOLVE_COMMAND = `uip maestro case sdd resolve sdd.md --out ${DEFAULT_REGISTRY_RESOLVED}`;
5
+ const isText = (v) => typeof v === 'string';
6
+ const asRecord = (v) => v !== null && typeof v === 'object' && !Array.isArray(v) ? v : undefined;
7
+ /** The spellings an index entry answers to, as `sdd resolve` reads them (`namesOf`). */
8
+ const NAME_FIELDS = ['name', 'deploymentTitle', 'title', 'displayName'];
9
+ /**
10
+ * Entries wherever they sit: an object with a string `task` and a `selected`
11
+ * or `matches` key, in an array at depth 4 or less (cli `collectEntries`).
12
+ */
13
+ function collectEntries(value, into, depth = 0) {
14
+ if (depth > 4)
15
+ return;
16
+ if (Array.isArray(value)) {
17
+ for (const item of value) {
18
+ const record = asRecord(item);
19
+ if (record && isText(record.task) && ('selected' in record || 'matches' in record))
20
+ into.push(record);
21
+ else
22
+ collectEntries(item, into, depth + 1);
23
+ }
24
+ return;
25
+ }
26
+ for (const v of Object.values(asRecord(value) ?? {}))
27
+ collectEntries(v, into, depth + 1);
28
+ }
29
+ /** A folder in the form two spellings of it share (cli `comparableFolder`). */
30
+ export function comparableFolder(folder) {
31
+ return folder.trim().replace(/^\/+|\/+$/g, '').toLowerCase();
32
+ }
33
+ /** The folder compile writes for a resource in this solution, and `sdd resolve` lists a sibling project under. */
34
+ const SOLUTION_FOLDER = 'solution_folder';
35
+ /**
36
+ * Read a parsed registry-resolved file. Returns `undefined` when it holds no
37
+ * entry. An entry with `selected: null` and one whose selection has no string
38
+ * name are kept as {@link UnusableEntry}. A selection with `source: "local"`
39
+ * or no folder is a project in this solution (`sdd resolve` writes a sibling
40
+ * that way): its folder is read as `solution_folder` and marked `inSolution`.
41
+ */
42
+ export function readRegistryResolved(json) {
43
+ const entries = [];
44
+ collectEntries(json, entries);
45
+ if (entries.length === 0)
46
+ return undefined;
47
+ const resolved = [];
48
+ const unusable = [];
49
+ for (const e of entries) {
50
+ const head = { ...(isText(e.stage) ? { stage: e.stage } : {}), task: e.task };
51
+ if (e.selected === null || e.selected === undefined) {
52
+ unusable.push({ ...head, why: 'unresolved' });
53
+ continue;
54
+ }
55
+ const sel = asRecord(e.selected);
56
+ const spellings = sel ? NAME_FIELDS.map((f) => sel[f]).filter((v) => isText(v) && v !== '') : [];
57
+ const inSolution = sel?.source === 'local' || sel?.folder === undefined || sel.folder === null || sel.folder === '';
58
+ if (!sel || spellings.length === 0 || (!inSolution && !isText(sel.folder))) {
59
+ unusable.push({ ...head, why: 'no-name' });
60
+ continue;
61
+ }
62
+ // `sdd resolve` writes one name (`namesOf(entry)[0]`), and validate
63
+ // --strict --sdd compares a binding to it exactly. Only an action app is
64
+ // matched under its other spellings (title, deploymentTitle) as well.
65
+ const names = e.taskType === 'action' ? spellings : spellings.slice(0, 1);
66
+ resolved.push({
67
+ ...head,
68
+ ...(isText(e.taskType) ? { taskType: e.taskType } : {}),
69
+ selected: { name: spellings[0], names, folder: inSolution ? SOLUTION_FOLDER : sel.folder, inSolution },
70
+ });
71
+ }
72
+ return { resolved, unusable };
73
+ }
74
+ /** The stage label of an SDD stage heading: "Review (`review`)" → "Review". */
75
+ export function sddStageLabel(heading) {
76
+ return heading.replace(/\s*\(`[^`]*`\)\s*$/, '').trim();
77
+ }
78
+ /**
79
+ * Pair each resource task with its entry: by stage label and task name; when
80
+ * no entry of that name has the task's stage (the stage was relabelled, or the
81
+ * entry has none), by task name alone if exactly one entry has it. Unusable
82
+ * entries count as candidates, so a task whose own entry is unresolved is
83
+ * never judged against another stage's entry of the same name.
84
+ */
85
+ function matchTasks(built, registry) {
86
+ const all = [
87
+ ...registry.resolved.map((e) => ({ stage: e.stage, task: e.task, candidate: { usable: e } })),
88
+ ...registry.unusable.map((e) => ({ stage: e.stage, task: e.task, candidate: { unusable: e } })),
89
+ ];
90
+ const out = [];
91
+ for (const stage of built.stages)
92
+ for (const lane of stage.lanes)
93
+ for (const task of lane) {
94
+ if (!task.ref)
95
+ continue;
96
+ const byName = all.filter((e) => e.task === task.name);
97
+ const hit = byName.find((e) => e.stage !== undefined && sddStageLabel(e.stage) === stage.label)
98
+ ?? (byName.length === 1 ? byName[0] : undefined);
99
+ const found = hit ? 'entry' : byName.length > 1 ? 'ambiguous' : 'none';
100
+ out.push({ stage: stage.label, task: { name: task.name, ref: task.ref }, found, ...(hit ? { candidate: hit.candidate } : {}) });
101
+ }
102
+ return out;
103
+ }
104
+ const usableOf = (m) => m.candidate && 'usable' in m.candidate ? m.candidate.usable : undefined;
105
+ /** What {@link registryResolvedLint} judged, so the CLI can say what it did not. */
106
+ export function registryResolvedCoverage(built, registry) {
107
+ const matches = matchTasks(built, registry);
108
+ const used = new Set(matches.flatMap((m) => usableOf(m) ?? []));
109
+ return {
110
+ held: matches.filter((m) => usableOf(m)).length,
111
+ noEntry: matches.filter((m) => m.found === 'none').map((m) => m.task.name),
112
+ ambiguous: matches.filter((m) => m.found === 'ambiguous').map((m) => m.task.name),
113
+ unusable: matches.flatMap((m) => (m.candidate && 'unusable' in m.candidate ? [{ task: m.task.name, why: m.candidate.unusable.why }] : [])),
114
+ unused: registry.resolved.filter((e) => !used.has(e)).map((e) => e.task),
115
+ };
116
+ }
117
+ /**
118
+ * A resource task whose name or folder differs from the resource the SDD
119
+ * resolved it to. Tasks are matched as {@link matchTasks} says; a task with no
120
+ * usable entry is not judged ({@link registryResolvedCoverage} counts it).
121
+ */
122
+ export function registryResolvedLint(built, registry) {
123
+ const file = registry.file ?? DEFAULT_REGISTRY_RESOLVED;
124
+ const findings = [];
125
+ for (const m of matchTasks(built, registry)) {
126
+ const entry = usableOf(m);
127
+ if (!entry)
128
+ continue;
129
+ const { stage, task } = m;
130
+ const { name, names, folder, inSolution } = entry.selected;
131
+ const authoredFolder = task.ref.folderPath === '' ? SOLUTION_FOLDER : task.ref.folderPath;
132
+ const nameOk = names.includes(task.ref.name);
133
+ const folderOk = comparableFolder(authoredFolder) === comparableFolder(folder);
134
+ if (nameOk && folderOk)
135
+ continue;
136
+ const differs = [
137
+ ...(nameOk ? [] : [`name "${task.ref.name}" (resolved: "${name}")`]),
138
+ ...(folderOk ? [] : [`folder "${authoredFolder}" (resolved: "${folder}")`]),
139
+ ].join(' and ');
140
+ findings.push({
141
+ code: 'RESOURCE_NOT_AS_RESOLVED',
142
+ where: task.name,
143
+ message: `Task "${task.name}" in stage "${stage}" binds ${differs}, `
144
+ + `but ${file} resolved it to "${name}" in "${folder}"${inSolution ? ' (a project in this solution)' : ''}. `
145
+ + `Compile would bind "${authoredFolder}.${task.ref.name}", which is not the resource the SDD names.`,
146
+ suggestion: (inSolution
147
+ ? `Use the resolved name with no folder: ("${name}"), so compile binds it in this solution. `
148
+ : `Use the resolved name and folder: ("${name}", { folder: "${folder}" }). `)
149
+ + 'The name is the resource\'s own name (selected.name), not its folder or package. '
150
+ + `If the SDD changed, resolve the task again (\`${RESOLVE_COMMAND}\` writes the whole file again). `
151
+ + 'If you chose another resource on purpose, run check with --no-registry-resolved.',
152
+ });
153
+ }
154
+ return findings;
155
+ }
@@ -38,7 +38,7 @@ import { CompileRefusal } from '../core/compile-refusal.js';
38
38
  import { expressionBindingId } from '../core/expression-binding-id.js';
39
39
  import { implicitInArgBuiltTrigger, unboundInArgMessage } from './in-arg-binding.js';
40
40
  import { jsonClone } from '../core/json-clone.js';
41
- import { savedDocumentExtractionData } from './document-extraction-saved.js';
41
+ import { carriedDocumentExtractionTasks, pairSavedDocumentExtractions, savedDocumentExtractionData, savedRowMappings } from './document-extraction-saved.js';
42
42
  import { taskShapeProblems } from './task-shape.js';
43
43
  import { SCRIPT_INPUTS, scriptOutputMappings, scriptOutputs, storedScript } from './script.js';
44
44
  import { DOCUMENT_EXTRACTION_NAME, DOCUMENT_EXTRACTION_RESOURCE, DOCUMENT_EXTRACTION_SERVICE_TYPE, DOCUMENT_EXTRACTION_VERSION, documentExtractionContext, documentExtractionInputs, documentExtractionOutputMappings, documentExtractionOutputs, documentExtractionRefusal, } from './document-extraction.js';
@@ -220,9 +220,14 @@ function serializeCase(built, opts) {
220
220
  ownNameRows: new Map(),
221
221
  // A carried task's saved output rows keep their ids: no other row takes one.
222
222
  outputIds: new Set(savedOutputIds(caseJsonPreservation(built)?.documentExtractionData)),
223
- savedDocumentExtractions: caseJsonPreservation(built)?.documentExtractionData ?? [],
223
+ savedDocumentExtractions: pairSavedDocumentExtractions(carriedDocumentExtractionTasks(built), caseJsonPreservation(built)?.documentExtractionData),
224
224
  ownOutputVars: ownOutputVars(built),
225
- caseVarNames: new Set([...built.vars.map((v) => v.name), ...mappedFixedOutputVars(built)]),
225
+ caseVarNames: new Set([
226
+ ...built.vars.map((v) => v.name),
227
+ ...mappedFixedOutputVars(built),
228
+ // A carried task's mapped rows write these, declared or not.
229
+ ...(caseJsonPreservation(built)?.documentExtractionData ?? []).flatMap((entry) => [...savedRowMappings(entry.data).values()]),
230
+ ]),
226
231
  slaId: new Map(),
227
232
  slaIdByName: new Map(),
228
233
  escalationId: new Map(),
@@ -30,6 +30,9 @@ export function registerCaseCommands(program) {
30
30
  .option('--connectors-local <dir>', 'connection-resolved connector overlay')
31
31
  .option('--bindings <file>', 'bindings.json, for the connection/folder label rules')
32
32
  .option('--resources <file>', 'resource ledger that registry prepare writes (default .flow-sdk/resources.json)')
33
+ .option('--registry-resolved <file>', 'the resources `uip maestro case sdd resolve` resolved each task to (default tasks/registry-resolved.json)')
34
+ // Commander keeps the default undefined when --no-X follows --X: the value is a file, false, or unset.
35
+ .option('--no-registry-resolved', 'do not hold resource tasks to tasks/registry-resolved.json')
33
36
  .addOption(retiredCompiledOption())
34
37
  .action(async (input, options) => {
35
38
  let mode;
@@ -49,6 +52,10 @@ export function registerCaseCommands(program) {
49
52
  addValue(argv, '--connectors-local', options.connectorsLocal);
50
53
  addValue(argv, '--bindings', options.bindings);
51
54
  addValue(argv, '--resources', options.resources);
55
+ if (options.registryResolved === false)
56
+ argv.push('--no-registry-resolved');
57
+ else
58
+ addValue(argv, '--registry-resolved', options.registryResolved);
52
59
  await invoke('case check', () => import('../../case/check-cli.js'), argv);
53
60
  });
54
61
  family.command('decompile')
@@ -170,6 +170,7 @@ export declare const REFUSALS: {
170
170
  readonly DOCUMENT_EXTRACTION_OUTPUT: "lowering";
171
171
  readonly DOCUMENT_EXTRACTION_OLDER_SHAPE: "lint";
172
172
  readonly DOCUMENT_EXTRACTION_SAVED_DATA: "lowering";
173
+ readonly DOCUMENT_EXTRACTION_SAVED_VAR_UNDECLARED: "lint";
173
174
  readonly SCRIPT_BODY_SYNTAX: "lint";
174
175
  readonly SCRIPT_OUTPUT: "lowering";
175
176
  readonly HTTP_REQUEST_CONNECTOR: "lowering";
@@ -623,6 +624,7 @@ export declare const REFUSALS: {
623
624
  readonly RESOURCE_REF_IS_BINDING: "lowering";
624
625
  readonly RESOURCE_ROW_INCOMPLETE: "lowering";
625
626
  readonly RESOURCE_UNRESOLVED: "lowering";
627
+ readonly RESOURCE_NOT_AS_RESOLVED: "lint";
626
628
  readonly RETRY_BASE_WITHOUT_EXPONENTIAL: "lint";
627
629
  readonly RETRY_INVALID_COUNT: "lint";
628
630
  readonly RETRY_INVALID_DURATION: "lint";
@@ -224,9 +224,11 @@ export const REFUSALS = {
224
224
  DOCUMENT_EXTRACTION_OUTPUT: 'lowering',
225
225
  // The older, flat shape, carried as saved (case/document-extraction-saved.ts):
226
226
  // check warns it is not editable (`lint`); compile refuses a carried task with
227
- // no saved data, or with outputs it cannot add to the saved rows (`lowering`).
227
+ // no saved data, or with outputs it cannot add to the saved rows (`lowering`);
228
+ // check warns a saved row writes a variable no .var() declares (`lint`).
228
229
  DOCUMENT_EXTRACTION_OLDER_SHAPE: 'lint',
229
230
  DOCUMENT_EXTRACTION_SAVED_DATA: 'lowering',
231
+ DOCUMENT_EXTRACTION_SAVED_VAR_UNDECLARED: 'lint',
230
232
  // Case script task (case/script.ts). A string body that does not parse is
231
233
  // written as authored (`lint`); an output other than the two has no row to
232
234
  // write it to (`lowering`).
@@ -696,6 +698,9 @@ export const REFUSALS = {
696
698
  RESOURCE_REF_IS_BINDING: 'lowering',
697
699
  RESOURCE_ROW_INCOMPLETE: 'lowering',
698
700
  RESOURCE_UNRESOLVED: 'lowering',
701
+ // Case check (case/registry-resolved.ts): a resource task's name or folder is
702
+ // not the one tasks/registry-resolved.json resolved; compile writes it as authored.
703
+ RESOURCE_NOT_AS_RESOLVED: 'lint',
699
704
  RETRY_BASE_WITHOUT_EXPONENTIAL: 'lint',
700
705
  RETRY_INVALID_COUNT: 'lint',
701
706
  RETRY_INVALID_DURATION: 'lint',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.88.2",
3
+ "version": "6.89.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",
@@ -110,5 +110,5 @@
110
110
  "@types/node": "^22.7.0",
111
111
  "esbuild": "^0.28.1"
112
112
  },
113
- "gitref": "faef29618f27f85fd7476545dd6f0301907d8191"
113
+ "gitref": "92148768a736f13772277dc6523c3145115c4087"
114
114
  }