@uipath/maestro-builder-sdk 6.117.4 → 6.118.1

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
@@ -135,8 +135,8 @@ could hand you spans for a version you do not have.
135
135
  | `DocumentClassifyInputs` | interface | `dist/nodes/document/flow/spec.d.ts:10-39` | Option shapes | What `documentClassify()` takes: the document, and how to split and classify it. |
136
136
  | `DocValidationInputs` | interface | `dist/nodes/hitl/flow/spec.d.ts:76-99` | Option shapes | The Document Validation task's subject — `variant: 'document-validation'` only. |
137
137
  | `DoWhileOptions` | interface | `dist/flow-sdk.d.ts:451-460` | Option shapes | Do-while options. |
138
- | `dynamicExtract` | function | `dist/nodes/document/flow/factories.d.ts:20-30` | Actions | Extract fields from a document with an INLINE schema — Dynamic Extract (`uipath.ixp.extract-document-builder`), the… |
139
- | `DynamicExtractInputs` | interface | `dist/nodes/document/flow/spec.d.ts:56-91` | Option shapes | What `dynamicExtract()` takes: the document and the fields to extract from it. |
138
+ | `dynamicExtract` | function | `dist/nodes/document/flow/factories.d.ts:20-90` | Actions | Extract fields from a document with an INLINE schema — Dynamic Extract (`uipath.ixp.extract-document-builder`), the… |
139
+ | `DynamicExtractInputs` | interface | `dist/nodes/document/flow/spec.d.ts:56-131` | Option shapes | What `dynamicExtract()` takes: the document and the fields to extract from it. |
140
140
  | `EdgeRoute` | interface | `dist/flow-sdk.d.ts:651-665` | Supporting types | One edge's route: user-dragged bends and/or the auto-router's waypoints. |
141
141
  | `endCall` | function | `dist/nodes/agent/flow/factories.d.ts:32-39` | Actions | Hang up (`uipath.conversational.voice.end-call`). |
142
142
  | `EndCallInputs` | interface | `dist/nodes/agent/flow/spec.d.ts:113-121` | Option shapes | What `endCall()` takes: the call to hang up. |
@@ -197,8 +197,8 @@ could hand you spans for a version you do not have.
197
197
  | `InOutField` | interface | `dist/core/actions.d.ts:278-295` | Supporting types | A value the reviewer READS **and can correct**: pre-filled from the flow, editable on the form, and the (possibly… |
198
198
  | `input` | function | `dist/core/expr.d.ts:44-61` | Expressions and types | Reference a flow input by name → `$vars.<triggerId>.output.<name>`. |
199
199
  | `isLookupToken` | function | `dist/core/lookups.d.ts:53-54` | Generated descriptors | True when `v` is an unresolved LookupToken. |
200
- | `ixpExtract` | function | `dist/nodes/document/flow/factories.d.ts:31-85` | Actions | Extract fields from a document with a published IxP project — the platform's **Extract** node (`uipath.ixp.*`, service… |
201
- | `IxpExtractInputs` | interface | `dist/nodes/document/flow/spec.d.ts:109-184` | Option shapes | What `ixpExtract()` takes: the IxP project's extractor, its identity on the tenant, and the document. |
200
+ | `ixpExtract` | function | `dist/nodes/document/flow/factories.d.ts:91-145` | Actions | Extract fields from a document with a published IxP project — the platform's **Extract** node (`uipath.ixp.*`, service… |
201
+ | `IxpExtractInputs` | interface | `dist/nodes/document/flow/spec.d.ts:149-224` | Option shapes | What `ixpExtract()` takes: the IxP project's extractor, its identity on the tenant, and the document. |
202
202
  | `IxpToolRef` | interface | `dist/core/actions.d.ts:789-827` | Supporting types | A published IxP (Intelligent eXtraction Platform) project as a tool — the agent decides when to extract a document and… |
203
203
  | `js` | function | `dist/core/expr.d.ts:247-282` | Expressions and types | Build a raw JS *expression* (a condition or computation). |
204
204
  | `lit` | function | `dist/core/expr.d.ts:22-28` | Expressions and types | A constant value baked directly into a node input. |
@@ -5,12 +5,12 @@
5
5
 
6
6
  # Maestro Builder SDK — member index
7
7
 
8
- **A lookup table of 1352 rows — match one name in it, do not read it.**
8
+ **A lookup table of 1356 rows — match one name in it, do not read it.**
9
9
  Grep or search for the member you have; the row it lands on is the whole
10
10
  answer. Reading top to bottom costs ~20x what the one row does and tells you
11
11
  nothing you asked for.
12
12
 
13
- Every field and method of every exported shape — 1352 across
13
+ Every field and method of every exported shape — 1356 across
14
14
  250 interfaces and classes — keyed by the MEMBER's own name.
15
15
 
16
16
  **Use this when the name you have is a field or a method**, which is usually
@@ -32,7 +32,7 @@ truncated summary would, for less. Read the span.
32
32
  Member names repeat across shapes (`name` is declared on 69 of them), so the
33
33
  `Declared on` column is what makes a match actionable. For the whole shape
34
34
  rather than the one field, look that name up in [`api-index.md`](api-index.md) —
35
- which is why its span is not repeated on all 1352 rows here.
35
+ which is why its span is not repeated on all 1356 rows here.
36
36
 
37
37
  **A name that misses both indexes is probably not part of the API.** The one
38
38
  that comes up is a RUNTIME output key — a human task's `Action`, a step's
@@ -275,7 +275,7 @@ not find it either.
275
275
  | `description` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1323-1330` |
276
276
  | `description` | property | `FormFieldSettings` | `dist/core/actions.d.ts:219-220` |
277
277
  | `description` | property | `HttpRequestToolRef` | `dist/core/actions.d.ts:569` |
278
- | `description` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:176-183` |
278
+ | `description` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:216-223` |
279
279
  | `description` | property | `IxpToolRef` | `dist/core/actions.d.ts:814-815` |
280
280
  | `description` | property | `ManualTriggerOpts` | `dist/case/case-sdk.d.ts:297` |
281
281
  | `description` | property | `McpToolRef` | `dist/core/actions.d.ts:491` |
@@ -317,7 +317,7 @@ not find it either.
317
317
  | `displayName` | property | `TriggerMeta` | `dist/core/connectors.d.ts:140-141` |
318
318
  | `displayPrompt` | property | `StartingPrompt` | `dist/nodes/trigger/flow/spec.d.ts:57-58` |
319
319
  | `document` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:419-423` |
320
- | `documentClassify` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:187-190` |
320
+ | `documentClassify` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:227-230` |
321
321
  | `documentExtraction` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:1004-1005` |
322
322
  | `documentExtraction` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1521-1539` |
323
323
  | `documentExtractionSaved` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:1006-1007` |
@@ -327,7 +327,7 @@ not find it either.
327
327
  | `draft` | property | `StepOptions` | `dist/flow-sdk.d.ts:318-332` |
328
328
  | `dueDate` | property | `QueueItemInputs` | `dist/nodes/queue/flow/spec.d.ts:50-51` |
329
329
  | `duration` | property | `TimerSpec` | `dist/bpmn/bpmn-sdk.d.ts:35-36` |
330
- | `dynamicExtract` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:191-194` |
330
+ | `dynamicExtract` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:231-234` |
331
331
  | `dynamicFewShotLearning` | property | `AgentMemoryRef` | `dist/core/actions.d.ts:605-606` |
332
332
  | `edges` | property | `FlowLayout` | `dist/flow-sdk.d.ts:724-725` |
333
333
  | `effects` | property | `FormFieldRule` | `dist/core/actions.d.ts:176-177` |
@@ -434,7 +434,7 @@ not find it either.
434
434
  | `fileExtension` | property | `ContextIndexRef` | `dist/core/actions.d.ts:928-929` |
435
435
  | `fileRef` | property | `DocumentClassifyInputs` | `dist/nodes/document/flow/spec.d.ts:12-13` |
436
436
  | `fileRef` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:58-59` |
437
- | `fileRef` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:150-164` |
437
+ | `fileRef` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:190-204` |
438
438
  | `filter` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1682-1697` |
439
439
  | `filters` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1698-1713` |
440
440
  | `filters` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:85-86` |
@@ -475,7 +475,7 @@ not find it either.
475
475
  | `folderKey` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1438-1446` |
476
476
  | `folderKey` | property | `RemoteA2aToolRef` | `dist/core/actions.d.ts:526` |
477
477
  | `FolderKey` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:85-86` |
478
- | `folderName` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:143-149` |
478
+ | `folderName` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:183-189` |
479
479
  | `folderPath` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:340-347` |
480
480
  | `folderPath` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:476-487` |
481
481
  | `folderPath` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:153-160` |
@@ -483,7 +483,7 @@ not find it either.
483
483
  | `folderPath` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1663-1669` |
484
484
  | `folderPath` | property | `ContextIndexRef` | `dist/core/actions.d.ts:912-913` |
485
485
  | `folderPath` | property | `HitlConnection` | `dist/nodes/hitl/flow/spec.d.ts:30-31` |
486
- | `folderPath` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:169-175` |
486
+ | `folderPath` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:209-215` |
487
487
  | `folderPath` | property | `McpToolRef` | `dist/core/actions.d.ts:492-493` |
488
488
  | `folderPath` | property | `ProcessToolRef` | `dist/core/actions.d.ts:772-773` |
489
489
  | `folderPath` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:250-260` |
@@ -625,7 +625,7 @@ not find it either.
625
625
  | `item` | property | `QueueItemOpts` | `dist/bpmn/bpmn-sdk.d.ts:1492-1493` |
626
626
  | `items` | property | `ActionSchemaProperty` | `dist/nodes/hitl/flow/spec.d.ts:269-270` |
627
627
  | `itemVar` | property | `LoopSpec` | `dist/bpmn/bpmn-sdk.d.ts:83-84` |
628
- | `ixpExtract` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:195-198` |
628
+ | `ixpExtract` | property | `FlowActionSpecs` | `dist/nodes/document/flow/spec.d.ts:235-238` |
629
629
  | `join` | property | `ChooseOpts` | `dist/bpmn/bpmn-sdk.d.ts:2082-2083` |
630
630
  | `join` | property | `SplitOpts` | `dist/bpmn/bpmn-sdk.d.ts:2089-2090` |
631
631
  | `js` | property | `Expr` | `dist/core/expr.d.ts:17` |
@@ -741,15 +741,15 @@ not find it either.
741
741
  | `mode` | property | `InlineAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:318-324` |
742
742
  | `model` | property | `CaseDocumentExtractionSpec` | `dist/case/case-sdk.d.ts:637-638` |
743
743
  | `model` | property | `ConversationalAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:63-64` |
744
- | `model` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:60-79` |
744
+ | `model` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:60-84` |
745
745
  | `model` | property | `InlineAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:186-193` |
746
746
  | `model` | property | `VoiceSettings` | `dist/nodes/agent/flow/spec.d.ts:134-135` |
747
747
  | `modelConfig` | property | `DocumentClassifyInputs` | `dist/nodes/document/flow/spec.d.ts:18-19` |
748
- | `modelConfig` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:89-90` |
748
+ | `modelConfig` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:96-97` |
749
749
  | `modelMaxTokens` | property | `ConversationalAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:85-91` |
750
750
  | `modelMaxTokens` | property | `InlineAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:308-315` |
751
751
  | `modelMaxTokens` | property | `VoiceSettings` | `dist/nodes/agent/flow/spec.d.ts:142-143` |
752
- | `modelName` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:125-136` |
752
+ | `modelName` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:165-176` |
753
753
  | `mustClose` | property | `ScopeStorage` | `dist/bpmn/bpmn-sdk.d.ts:2202-2206` |
754
754
  | `name` | property | `ActionAppRef` | `dist/case/case-sdk.d.ts:834-835` |
755
755
  | `name` | property | `ActionField` | `dist/case/case-sdk.d.ts:795-796` |
@@ -803,7 +803,7 @@ not find it either.
803
803
  | `name` | property | `HttpOpts` | `dist/bpmn/bpmn-sdk.d.ts:1310-1311` |
804
804
  | `name` | property | `HttpRequestToolRef` | `dist/core/actions.d.ts:567-568` |
805
805
  | `name` | property | `HumanTaskCommonOpts` | `dist/bpmn/bpmn-sdk.d.ts:1523-1524` |
806
- | `name` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:137-142` |
806
+ | `name` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:177-182` |
807
807
  | `name` | property | `IxpToolRef` | `dist/core/actions.d.ts:812-813` |
808
808
  | `name` | property | `JoinOpts` | `dist/bpmn/bpmn-sdk.d.ts:2070-2071` |
809
809
  | `name` | property | `ManualTriggerOpts` | `dist/case/case-sdk.d.ts:296` |
@@ -928,8 +928,8 @@ not find it either.
928
928
  | `outputVar` | property | `ReceiveMessageOpts` | `dist/bpmn/bpmn-sdk.d.ts:1626-1627` |
929
929
  | `pageRange` | property | `CaseDocumentExtractionSpec` | `dist/case/case-sdk.d.ts:663-664` |
930
930
  | `pageRange` | property | `DocumentClassifyInputs` | `dist/nodes/document/flow/spec.d.ts:14-15` |
931
- | `pageRange` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:87-88` |
932
- | `pageRange` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:165-166` |
931
+ | `pageRange` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:94-95` |
932
+ | `pageRange` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:205-206` |
933
933
  | `parallel` | property | `LoopOptions` | `dist/flow-sdk.d.ts:438-439` |
934
934
  | `parallel` | method | `StepList` | `dist/flow-sdk.d.ts:1052-1094` |
935
935
  | `parallelGateway` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2525-2534` |
@@ -967,10 +967,14 @@ not find it either.
967
967
  | `process` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1288-1297` |
968
968
  | `processId` | property | `SugarRegistry` | `dist/bpmn/bpmn-sdk.d.ts:2226-2231` |
969
969
  | `ProcessKey` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:89-90` |
970
+ | `processorFolderPath` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:123-130` |
971
+ | `processorKey` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:98-109` |
972
+ | `processorName` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:110-116` |
973
+ | `processorReadOnly` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:117-122` |
970
974
  | `project` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:321-339` |
971
975
  | `project` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:457-475` |
972
976
  | `project` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:134-152` |
973
- | `project` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:111-124` |
977
+ | `project` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:151-164` |
974
978
  | `project` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:231-249` |
975
979
  | `project` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:39-57` |
976
980
  | `projectId` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:348-357` |
@@ -1097,7 +1101,7 @@ not find it either.
1097
1101
  | `schema` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3837-3862` |
1098
1102
  | `schema` | property | `BpmnVarDecl` | `dist/bpmn/bpmn-sdk.d.ts:449-450` |
1099
1103
  | `schema` | property | `DataServiceOpts` | `dist/bpmn/bpmn-sdk.d.ts:1291-1296` |
1100
- | `schema` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:80-86` |
1104
+ | `schema` | property | `DynamicExtractInputs` | `dist/nodes/document/flow/spec.d.ts:85-93` |
1101
1105
  | `schema` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:300-301` |
1102
1106
  | `schema` | property | `VarDecl` | `dist/flow-sdk.d.ts:75-76` |
1103
1107
  | `schema` | property | `VarOpts` | `dist/bpmn/bpmn-sdk.d.ts:1929-1942` |
@@ -1369,7 +1373,7 @@ not find it either.
1369
1373
  | `version` | property | `TriggerMeta` | `dist/core/connectors.d.ts:139` |
1370
1374
  | `version` | property | `TriggerOptions` | `dist/core/actions.d.ts:1178-1179` |
1371
1375
  | `versions` | method | `NodeCatalog` | `dist/core/node-catalog.d.ts:15-16` |
1372
- | `versionTag` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:167-168` |
1376
+ | `versionTag` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:207-208` |
1373
1377
  | `versionTag` | property | `IxpToolRef` | `dist/core/actions.d.ts:816-817` |
1374
1378
  | `voice` | property | `VoiceAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:169-170` |
1375
1379
  | `voiceAgent` | property | `FlowActionSpecs` | `dist/nodes/agent/flow/spec.d.ts:456-459` |
package/dist/check.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- /**
2
- * check — static validation of a BuiltFlow before serialization.
3
- *
4
- * Produces structured, actionable diagnostics (the kind an agent can act on):
5
- * references to undeclared variables/steps, empty branch arms, missing
6
- * terminals, and every refusal `compile` would raise (duplicate step names, an
7
- * input a connector does not declare, …), which it gets by running the
8
- * serializer in collect mode (`serializerRefusals`), so each of those rules
9
- * lives in the serializer alone.
10
- */
11
1
  import type { SolutionProjects } from './core/solution-projects.js';
12
2
  import { type ResourceResolutions } from './core/resource-resolution.js';
13
3
  import type { NodeCatalog } from './core/node-catalog.js';
package/dist/check.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { typescript } from './core/typescript-module.js';
1
2
  import { isResourceToken } from './core/resource-resolution.js';
2
3
  import { isLookupToken } from './core/lookups.js';
3
4
  import { prepareCommand } from './core/cli-spelling.js';
@@ -1140,7 +1141,12 @@ function checkFlow(built, ancestors, opts = {}) {
1140
1141
  }
1141
1142
  // A registered node type declares what its output is; `none` reports here,
1142
1143
  // at the same point as the per-family no-output rules below.
1143
- const placed = checkedSteps.get(name);
1144
+ //
1145
+ // Only a READ reaches a node type's output contract: the same text in a
1146
+ // string literal or a comment (`'see $vars.extract.output.ExtractionResult'`)
1147
+ // is a mention, which the contracts' rules must not judge.
1148
+ const isRead = code.startsWith('$vars', m.index ?? 0);
1149
+ const placed = isRead ? checkedSteps.get(name) : undefined;
1144
1150
  if (placed) {
1145
1151
  const contract = placed.impl.checkOutput?.(placed.spec, opts)
1146
1152
  ?? placed.impl.output(placed.spec, { resources: opts.resources });
@@ -1217,7 +1223,7 @@ function checkFlow(built, ancestors, opts = {}) {
1217
1223
  }
1218
1224
  // A registered node type that states its output's fields: the same read
1219
1225
  // rule, worded by its contract and reported through its family's catalog.
1220
- const fieldsPlaced = checkedSteps.get(name);
1226
+ const fieldsPlaced = isRead ? checkedSteps.get(name) : undefined;
1221
1227
  const fieldsContract = fieldsPlaced
1222
1228
  && (fieldsPlaced.impl.checkOutput?.(fieldsPlaced.spec, opts)
1223
1229
  ?? fieldsPlaced.impl.output(fieldsPlaced.spec, { resources: opts.resources }));
@@ -2019,17 +2025,73 @@ function declaredRefName(js, triggerId) {
2019
2025
  return viaTrigger?.[1];
2020
2026
  }
2021
2027
  /**
2022
- * The JavaScript text with `//` and `/* *\/` comments and the text of string and
2023
- * template literals replaced by spaces — same length, so a match offset in the
2024
- * original indexes the same character here. A template's `${…}` bodies are code
2025
- * and are kept (nested templates and strings inside them are blanked in turn).
2028
+ * The JavaScript text with `//` and `/* *\/` comments and the text of string,
2029
+ * template and regular-expression literals replaced by spaces — same length, so
2030
+ * a match offset in the original indexes the same character here. A template's
2031
+ * `${…}` bodies are code and are kept (nested templates and strings inside them
2032
+ * are blanked in turn).
2026
2033
  *
2027
2034
  * This is the read-versus-mention line `uip maestro flow validate` draws in its
2028
2035
  * `$vars` extraction (`collectVarsRefs`, `inProse`): a rule that fires on a VALID
2029
- * name must not fire on `"pass $vars.x here"` or a commented-out line. Regex
2030
- * literals are not recognised; a `$vars` reference inside one is vanishingly rare.
2036
+ * name must not fire on `"pass $vars.x here"` or a commented-out line.
2037
+ *
2038
+ * The literals come from the TypeScript parser, because only a parser tells a
2039
+ * regular expression from a division: in `const q = /['"]/; return $vars.a.output;`
2040
+ * the quote inside the regexp opens no string, so the read after it stays code.
2041
+ * Comments are then found by {@link maskComments} on the text with the literals
2042
+ * already blank, where a `//` or `/*` can only be a comment. Text that parses
2043
+ * neither as an expression nor as a script body falls back to that scanner alone.
2031
2044
  */
2032
2045
  function codeOnly(src) {
2046
+ // Only the offsets of `$vars` matches are consulted, so text without one needs no parse.
2047
+ if (!src.includes('$vars'))
2048
+ return src;
2049
+ return maskComments(maskLiterals(src) ?? src);
2050
+ }
2051
+ /** `src` with every string, template-text and regexp literal's contents blanked, from a parse; undefined when it does not parse. */
2052
+ function maskLiterals(src) {
2053
+ const ts = typescript();
2054
+ const attempts = [['(', '\n)'], ['function __body() {\n', '\n}']];
2055
+ for (const [prefix, suffix] of attempts) {
2056
+ const sf = ts.createSourceFile('code-only.js', `${prefix}${src}${suffix}`, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
2057
+ if ((sf.parseDiagnostics ?? []).length > 0)
2058
+ continue;
2059
+ const out = src.split('');
2060
+ const blank = (from, to) => {
2061
+ for (let k = Math.max(from, 0); k < to && k < out.length; k++)
2062
+ if (out[k] !== '\n')
2063
+ out[k] = ' ';
2064
+ };
2065
+ const visit = (node) => {
2066
+ const start = node.getStart(sf) - prefix.length;
2067
+ const end = node.end - prefix.length;
2068
+ switch (node.kind) {
2069
+ case ts.SyntaxKind.StringLiteral:
2070
+ case ts.SyntaxKind.NoSubstitutionTemplateLiteral:
2071
+ case ts.SyntaxKind.RegularExpressionLiteral:
2072
+ case ts.SyntaxKind.TemplateTail:
2073
+ blank(start + 1, end - 1);
2074
+ break;
2075
+ case ts.SyntaxKind.TemplateHead:
2076
+ case ts.SyntaxKind.TemplateMiddle:
2077
+ blank(start + 1, end - 2);
2078
+ break;
2079
+ default: break;
2080
+ }
2081
+ ts.forEachChild(node, visit);
2082
+ };
2083
+ visit(sf);
2084
+ return out.join('');
2085
+ }
2086
+ return undefined;
2087
+ }
2088
+ /**
2089
+ * The hand scanner: blanks `//` and `/* *\/` comments and the text of string
2090
+ * and template literals. On text whose literals {@link maskLiterals} already
2091
+ * blanked it finds only comments; on its own (text that does not parse) it does
2092
+ * not know regular expressions, so a quote inside one opens a string.
2093
+ */
2094
+ function maskComments(src) {
2033
2095
  const out = src.split('');
2034
2096
  const n = src.length;
2035
2097
  let i = 0;
@@ -41,6 +41,9 @@ import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
41
41
  import { connectionResources, inlineAgentResources, mergeBindingsV2, projectBindingRows, refreshInlineAgentRows } from './bindings-v2.js';
42
42
  import { readBindingsV2, readInlineAgentFiles } from './bindings-v2-files.js';
43
43
  import { readSolutionProjects } from './solution-projects-files.js';
44
+ import { provisionIdpProcessors } from './idp-processor-files.js';
45
+ import { idpProcessorBindingRows, withIdpProcessorRows } from './nodes/document/flow/family.js';
46
+ import { isRecord } from './core/node-envelope.js';
44
47
  import { ensureTypeScriptRuntime } from './node-runtime.js';
45
48
  import { defaultBindingsFile, defaultResourcesFile } from './workdir.js';
46
49
  import { readCliResources } from './registry/prepare/resources.js';
@@ -49,7 +52,7 @@ import { flowSources, projectMainFlow, resourceSourcesOfOtherFlows } from './pro
49
52
  import { fnv1aX4Uuid } from './core/stable-id.js';
50
53
  import { cliSpelling } from './core/cli-spelling.js';
51
54
  import { readNodeCatalog } from './node-catalog-files.js';
52
- import { secondFlowWarning } from './project-flows.js';
55
+ import { flowProjectOf, secondFlowWarning } from './project-flows.js';
53
56
  /** An agent folder name: a uuid, any case. */
54
57
  const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
55
58
  export async function run(argv) {
@@ -222,6 +225,19 @@ export async function run(argv) {
222
225
  }
223
226
  // Reported before the first write, so a write that throws still carries it.
224
227
  reportDiagnostics(diagnostics);
228
+ // Each Extract document step's IDP processor (#1984): its resource file in the
229
+ // solution, and the processor's name on the node — what `nodes create` leaves.
230
+ // Only for the flow the project packs: a candidate compiled beside the project
231
+ // (the brownfield loop's baseline/edited files) or a second `.flow` is not
232
+ // deployed, and must not rewrite the solution's processors.
233
+ // The project is the nearest folder holding `project.uiproj`, so a main flow
234
+ // under `content/` counts; a flow the project does not name as its main one
235
+ // only counts when it sits at the project's root and the project names none.
236
+ const projectDir = flowProjectOf(resolve(out));
237
+ const mainFlow = projectDir !== undefined ? projectMainFlow(projectDir).file : undefined;
238
+ const packsThisFlow = projectDir !== undefined
239
+ && (mainFlow !== undefined ? resolve(mainFlow) === resolve(out) : projectDir === outDir);
240
+ const processors = packsThisFlow ? provisionIdpProcessors(flowJson, projectDir) : undefined;
225
241
  writeJsonFile(out, flowJson);
226
242
  console.log(`compile: wrote ${out} (${flowJson.nodes.length} nodes, ${flowJson.edges.length} edges)`);
227
243
  const written = [];
@@ -231,6 +247,12 @@ export async function run(argv) {
231
247
  console.log(`compile: wrote ${sidecar.path}`);
232
248
  written.push(target);
233
249
  }
250
+ for (const path of processors?.written ?? [])
251
+ console.log(`compile: wrote ${path} (IDP processor)`);
252
+ for (const why of processors?.skipped ?? [])
253
+ console.error(`compile: did not write the IDP processor ${why}`);
254
+ if (processors?.pending !== undefined)
255
+ console.log(`compile: ${processors.pending}`);
234
256
  // A re-homed agent's folder starts as a copy of the folder it came from, minus
235
257
  // what this compile just wrote (its `agent.json`, the resources it derives)
236
258
  // and minus every `resources/<id>/` this flow's nodes do not name — copying
@@ -323,7 +345,10 @@ export async function run(argv) {
323
345
  // `project.uiproj` is what makes the output directory a project rather than
324
346
  // somewhere a `.flow` was merely dropped, and littering a scratch directory
325
347
  // with a resource declaration nothing reads would be worse than not writing it.
326
- if (existsSync(join(outDir, 'project.uiproj'))) {
348
+ // Also for a project's main flow below its root (`MainFile: "content/Intake.flow"`),
349
+ // whose sidecar sits beside it, as the CLI's `regenerateBindingsFile` writes it.
350
+ const nestedMain = packsThisFlow && !inProject;
351
+ if (inProject || nestedMain) {
327
352
  const sidecarPath = join(outDir, 'bindings_v2.json');
328
353
  // A connection two of this flow's nodes type differently is refused here,
329
354
  // whichever flow the sidecar declares.
@@ -337,7 +362,8 @@ export async function run(argv) {
337
362
  // pack would take whichever the file system lists first.
338
363
  const self = resolve(out);
339
364
  const ownFile = basename(self);
340
- const main = projectMainFlow(outDir);
365
+ // A nested main flow is the one flow declared: it is its project's main one.
366
+ const main = nestedMain ? { file: resolve(out), ambiguous: [] } : projectMainFlow(outDir);
341
367
  const flowAt = (path) => ({
342
368
  file: relative(outDir, path),
343
369
  flow: resolve(path) === self ? flowJson : readJsonOrUndefined(path),
@@ -362,6 +388,9 @@ export async function run(argv) {
362
388
  console.error(`compile: could not read the connections of ${file}; keeping the bindings_v2.json rows this compile does not derive, `
363
389
  + 'since some may be its. Fix or recompile that flow to re-derive them.');
364
390
  }
391
+ // The `idpProcessor` row of each processor the declared flows' Extract
392
+ // document steps name, as pack derives it (#1984).
393
+ const processorRows = rowFlows.flatMap((f) => idpProcessorBindingRows(isRecord(f.flow) ? f.flow : {}, processors?.namesByKey));
365
394
  const existing = readBindingsV2(sidecarPath);
366
395
  // Each inline agent's own rows (process, index, app, … — #962), derived from
367
396
  // the agent directory as it now stands on disk, the way `uip agent refresh
@@ -388,15 +417,16 @@ export async function run(argv) {
388
417
  const agentRows = agentFiles.map((files) => inlineAgentResources(files));
389
418
  // Nothing to declare and nothing already declared — do not create an empty
390
419
  // file for a flow that has no resources at all.
391
- if (connections.length > 0 || entityRows.length > 0 || existing !== undefined || agentRows.some((rows) => rows.length > 0)) {
420
+ if (connections.length > 0 || entityRows.length > 0 || processorRows.length > 0 || existing !== undefined || agentRows.some((rows) => rows.length > 0)) {
392
421
  const merged = mergeBindingsV2(existing, connections, entityRows, { keepUnderived: unreadable.length > 0 });
393
- merged.resources = refreshInlineAgentRows(merged.resources, agentFiles, removedResources);
422
+ merged.resources = withIdpProcessorRows(refreshInlineAgentRows(merged.resources, agentFiles, removedResources), processorRows, { keepUnderived: unreadable.length > 0 });
394
423
  writeJsonFile(sidecarPath, merged);
395
- const derived = new Set([...connections, ...entityRows, ...agentRows.flat()].map((r) => `${r.resource}\u0000${r.key}`));
396
- const agentCount = merged.resources.filter((r) => r.resource !== 'connection' && r.resource !== 'Entity' && derived.has(`${r.resource}\u0000${r.key}`)).length;
424
+ const derived = new Set([...connections, ...entityRows, ...processorRows, ...agentRows.flat()].map((r) => `${r.resource}\u0000${r.key}`));
425
+ const agentCount = merged.resources.filter((r) => r.resource !== 'connection' && r.resource !== 'Entity' && r.resource !== 'idpProcessor' && derived.has(`${r.resource}\u0000${r.key}`)).length;
397
426
  const kept = merged.resources.filter((r) => !derived.has(`${r.resource}\u0000${r.key}`)).length;
398
427
  console.log(`compile: wrote bindings_v2.json (${connections.length} connection resource(s)`
399
428
  + `${entityRows.length > 0 ? `, ${entityRows.length} entity resource(s)` : ''}`
429
+ + `${processorRows.length > 0 ? `, ${processorRows.length} IDP processor resource(s)` : ''}`
400
430
  + `${agentCount > 0 ? `, ${agentCount} inline-agent resource(s)` : ''}`
401
431
  + `${kept > 0 ? `, ${kept} other resource(s) preserved` : ''})`);
402
432
  }
@@ -1 +1,3 @@
1
- export declare function writeJsonFile(path: string, value: unknown): void;
1
+ export declare function writeJsonFile(path: string, value: unknown, options?: {
2
+ exclusive?: boolean;
3
+ }): void;
@@ -7,6 +7,8 @@
7
7
  * JSON writes to this function. Creating the parent directory stays the caller's job.
8
8
  */
9
9
  import { writeFileSync } from 'node:fs';
10
- export function writeJsonFile(path, value) {
11
- writeFileSync(path, JSON.stringify(value, null, 2) + '\n');
10
+ export function writeJsonFile(path, value, options = {}) {
11
+ // `exclusive` creates the file and fails when anything is at `path`, a link
12
+ // included (O_CREAT | O_EXCL never follows one).
13
+ writeFileSync(path, JSON.stringify(value, null, 2) + '\n', options.exclusive === true ? { flag: 'wx' } : undefined);
12
14
  }
@@ -364,6 +364,8 @@ export declare const REFUSALS: {
364
364
  readonly EXTERNAL_TASK_FOLDER: "lowering";
365
365
  readonly EXTERNAL_TASK_MODE: "lowering";
366
366
  readonly EXTERNAL_TASK_MODE_MISMATCH: "lowering";
367
+ readonly EXTRACT_READ_NOT_OUTPUT: "lint";
368
+ readonly EXTRACT_READ_UNKNOWN_FIELD: "lint";
367
369
  readonly EXTRACT_SCHEMA_SHAPE: "lint";
368
370
  readonly FAKE_JOIN: "lint";
369
371
  readonly FILE_NOT_FOUND: "lowering";
@@ -438,6 +438,8 @@ export const REFUSALS = {
438
438
  EXTERNAL_TASK_FOLDER: 'lowering',
439
439
  EXTERNAL_TASK_MODE: 'lowering',
440
440
  EXTERNAL_TASK_MODE_MISMATCH: 'lowering',
441
+ EXTRACT_READ_NOT_OUTPUT: 'lint',
442
+ EXTRACT_READ_UNKNOWN_FIELD: 'lint',
441
443
  EXTRACT_SCHEMA_SHAPE: 'lint',
442
444
  FAKE_JOIN: 'lint',
443
445
  FILE_NOT_FOUND: 'lowering',