@uipath/maestro-builder-sdk 6.71.0 → 6.72.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
@@ -37,7 +37,7 @@ could hand you spans for a version you do not have.
37
37
 
38
38
  ## `@uipath/maestro-builder-sdk`
39
39
 
40
- 245 symbol(s). Import from `@uipath/maestro-builder-sdk`.
40
+ 247 symbol(s). Import from `@uipath/maestro-builder-sdk`.
41
41
 
42
42
  | Symbol | Kind | Declaration | Area | Summary |
43
43
  | --- | --- | --- | --- | --- |
@@ -47,20 +47,20 @@ could hand you spans for a version you do not have.
47
47
  | `ActionSchemaSection` | interface | `dist/nodes/hitl/flow/spec.d.ts:274-280` | Supporting types | One section (`inputs`, `outputs`, `inOuts`, `outcomes`) of an `action-schema.json`. |
48
48
  | `ActionSpec` | type | `dist/core/actions.d.ts:847-855` | Supporting types | One action step's spec: `{ kind }` plus that kind's body from FlowActionSpecs, for every kind there. |
49
49
  | `agent` | function | `dist/nodes/process/flow/factories.d.ts:159-213` | Actions | Invoke an AGENT resource — either one published to Orchestrator or a sibling agent project registered in the same… |
50
- | `AgentFlavour` | type | `dist/nodes/process/flow/spec.d.ts:260-264` | Supporting types | Which KIND of agent project was published behind a `uipath.core.agent.<key>` resource. |
50
+ | `AgentFlavour` | type | `dist/nodes/process/flow/spec.d.ts:286-290` | Supporting types | Which KIND of agent project was published behind a `uipath.core.agent.<key>` resource. |
51
51
  | `AgentGuardrail` | type | `dist/core/actions.d.ts:393` | Supporting types | |
52
52
  | `agenticProcess` | function | `dist/nodes/process/flow/factories.d.ts:113-158` | Actions | Invoke a deployed AGENTIC PROCESS — a Maestro process orchestration published to Orchestrator: a BPMN process that… |
53
- | `AgenticProcessCompletion` | type | `dist/nodes/process/flow/spec.d.ts:219-257` | Supporting types | Whether an Agentic Process step waits for the process's result. |
54
- | `AgenticProcessInputs` | type | `dist/nodes/process/flow/spec.d.ts:258-259` | Option shapes | What `agenticProcess()` takes: the shared fields plus the completion policy. |
55
- | `AgenticProcessInputsBase` | interface | `dist/nodes/process/flow/spec.d.ts:162-218` | Option shapes | 7 field(s) |
56
- | `AgentInputs` | interface | `dist/nodes/process/flow/spec.d.ts:267-362` | Option shapes | What `agent()` takes: the agent resource to start, its arguments, and the output fields a read may name. |
57
- | `AgentLocation` | type | `dist/nodes/process/flow/spec.d.ts:265-266` | Supporting types | Where a published agent lives: deployed to a folder (`'published'`) or a sibling project of the same solution… |
53
+ | `AgenticProcessCompletion` | type | `dist/nodes/process/flow/spec.d.ts:245-283` | Supporting types | Whether an Agentic Process step waits for the process's result. |
54
+ | `AgenticProcessInputs` | type | `dist/nodes/process/flow/spec.d.ts:284-285` | Option shapes | What `agenticProcess()` takes: the shared fields plus the completion policy. |
55
+ | `AgenticProcessInputsBase` | interface | `dist/nodes/process/flow/spec.d.ts:188-244` | Option shapes | 7 field(s) |
56
+ | `AgentInputs` | interface | `dist/nodes/process/flow/spec.d.ts:293-388` | Option shapes | What `agent()` takes: the agent resource to start, its arguments, and the output fields a read may name. |
57
+ | `AgentLocation` | type | `dist/nodes/process/flow/spec.d.ts:291-292` | Supporting types | Where a published agent lives: deployed to a folder (`'published'`) or a sibling project of the same solution… |
58
58
  | `AgentMemoryRef` | interface | `dist/core/actions.d.ts:538-562` | Supporting types | An episodic memory the agent learns from across runs, wired to the agent's own `memory` handle. |
59
59
  | `AgentResourcePlacement` | interface | `dist/core/actions.d.ts:406-441` | Supporting types | Where one of an inline agent's resources (a context index, a tool, an escalation) sits in the `.flow`: the id of its own… |
60
60
  | `Aggregation` | interface | `dist/nodes/transform/flow/spec.d.ts:36-42` | Supporting types | 3 field(s) |
61
61
  | `AggregationOperation` | type | `dist/nodes/transform/flow/spec.d.ts:35` | Supporting types | |
62
62
  | `apiWorkflow` | function | `dist/nodes/process/flow/factories.d.ts:53-87` | Actions | Invoke a deployed API workflow — a coded workflow published to Orchestrator, run as a serverless job rather than by a… |
63
- | `ApiWorkflowInputs` | interface | `dist/nodes/process/flow/spec.d.ts:70-101` | Option shapes | 5 field(s) |
63
+ | `ApiWorkflowInputs` | interface | `dist/nodes/process/flow/spec.d.ts:70-127` | Option shapes | 7 field(s) |
64
64
  | `AppRef` | interface | `dist/nodes/hitl/flow/spec.d.ts:146-254` | Supporting types | A deployed Action App that supplies a human task's form — the `'action-app'` variant's subject. |
65
65
  | `ArmBuilder` | class | `dist/flow-sdk.d.ts:1387-1410` | Builders | The sub-builder an ARM callback receives — a `StepList` that can also name itself with `.label(...)`. |
66
66
  | `AskedField` | interface | `dist/core/actions.d.ts:221-240` | Supporting types | A value the reviewer FILLS IN: read downstream with `out('<step>', '<id>')`. |
@@ -143,10 +143,12 @@ could hand you spans for a version you do not have.
143
143
  | `FlowActionSpecs` | interface | `dist/core/actions.d.ts:813-846` | Supporting types | Every action kind, keyed by kind, to the body of its spec — the arm's fields other than `kind`. |
144
144
  | `FlowBuilder` | class | `dist/flow-sdk.d.ts:1411-1791` | Builders | 15 member(s) |
145
145
  | `FlowLayout` | interface | `dist/flow-sdk.d.ts:830-843` | Supporting types | Designer layout for a flow, keyed by AUTHOR-level ids: node entries by step name (plus the trigger id and `end`), edge… |
146
+ | `FlowMetadata` | interface | `dist/nodes/script/flow/spec.d.ts:63-95` | Actions | The instance metadata, as a script function's second parameter sees it. |
146
147
  | `FlowNode` | class | `dist/core/node-classes.d.ts:126-161` | Supporting types | The abstract root of every definition-backed node the builder can place. |
147
148
  | `FlowResource` | class | `dist/core/node-classes.d.ts:176-183` | Supporting types | A node attached to another semantic node — an inline agent's tool, context, memory, or escalation. |
148
149
  | `FlowTrigger` | class | `dist/core/node-classes.d.ts:169-175` | Supporting types | A node that starts the flow — pass an instance to `.trigger(…)`. |
149
150
  | `FlowTypeDesc` | type | `dist/flow-types.d.ts:45-51` | Supporting types | A `types.*` descriptor a Flow variable may declare: every member of `types` but the Case-only `float`, `double`, `date`,… |
151
+ | `FlowVars` | type | `dist/nodes/script/flow/spec.d.ts:45-62` | Actions | The runtime's variable scope, as a script function's parameter sees it. |
150
152
  | `FormField` | type | `dist/core/actions.d.ts:259` | Supporting types | |
151
153
  | `FormFieldCondition` | interface | `dist/core/actions.d.ts:113-133` | Supporting types | One condition of a form-field rule (`@uipath/hitl-schema-types` `fieldConditionSchema`): `when` names the field it… |
152
154
  | `FormFieldControlType` | type | `dist/core/actions.d.ts:105-112` | Supporting types | How a form field renders (`@uipath/hitl-schema-types` `controlType`). |
@@ -216,7 +218,7 @@ could hand you spans for a version you do not have.
216
218
  | `ProcessToolKind` | type | `dist/core/actions.d.ts:622-635` | Supporting types | The tool kinds that wrap a DEPLOYED tenant resource. |
217
219
  | `ProcessToolRef` | interface | `dist/core/actions.d.ts:636-665` | Supporting types | A deployed tenant resource the agent may invoke. |
218
220
  | `publishedFunction` | function | `dist/nodes/process/flow/factories.d.ts:88-112` | Actions | Invoke a published Orchestrator **Function** — a deployed unit of code run as one step (`uipath.core.function.<key>`,… |
219
- | `PublishedFunctionInputs` | interface | `dist/nodes/process/flow/spec.d.ts:102-161` | Option shapes | A published Orchestrator **Function** — a small, single-purpose unit of code deployed as its own resource and invoked as… |
221
+ | `PublishedFunctionInputs` | interface | `dist/nodes/process/flow/spec.d.ts:128-187` | Option shapes | A published Orchestrator **Function** — a small, single-purpose unit of code deployed as its own resource and invoked as… |
220
222
  | `queueItem` | function | `dist/nodes/queue/flow/factories.d.ts:4-49` | Actions | Declare an Orchestrator QUEUE ITEM step. |
221
223
  | `QueueItemInputs` | interface | `dist/nodes/queue/flow/spec.d.ts:11-84` | Option shapes | 10 field(s) |
222
224
  | `QueuePriority` | type | `dist/nodes/queue/flow/spec.d.ts:9-10` | Supporting types | The three priorities an Orchestrator queue item can carry. |
@@ -236,14 +238,14 @@ could hand you spans for a version you do not have.
236
238
  | `ScheduledInputs` | interface | `dist/flow-sdk.d.ts:153-165` | Option shapes | 1 field(s) |
237
239
  | `ScheduleEvery` | type | `dist/flow-sdk.d.ts:141-152` | Supporting types | How often a scheduled flow runs, as an ISO-8601 repeating interval: `R/` followed by a duration. |
238
240
  | `SchedulePreset` | type | `dist/flow-sdk.d.ts:140` | Supporting types | |
239
- | `script` | function | `dist/nodes/script/flow/factories.d.ts:8-36` | Actions | Declare an inline script action, as a TypeScript function the compiler checks. |
240
- | `script` | function | `dist/nodes/script/flow/factories.d.ts:37-47` | Actions | Declare an inline script action, as a TypeScript function, with no declared return: the body's type is inferred as it is… |
241
- | `script` | function | `dist/nodes/script/flow/factories.d.ts:48-55` | Actions | Declare an inline script action. |
242
- | `ScriptInputs` | interface | `dist/nodes/script/flow/spec.d.ts:7-44` | Option shapes | 2 field(s) |
241
+ | `script` | function | `dist/nodes/script/flow/factories.d.ts:8-38` | Actions | Declare an inline script action, as a TypeScript function the compiler checks. |
242
+ | `script` | function | `dist/nodes/script/flow/factories.d.ts:39-49` | Actions | Declare an inline script action, as a TypeScript function, with no declared return: the body's type is inferred as it is… |
243
+ | `script` | function | `dist/nodes/script/flow/factories.d.ts:50-57` | Actions | Declare an inline script action. |
244
+ | `ScriptInputs` | interface | `dist/nodes/script/flow/spec.d.ts:7-44` | Actions | 2 field(s) |
243
245
  | `ScriptReturns` | type | `dist/core/script-return.d.ts:42-48` | Supporting types | What an author may write for `script({ returns })`: the type outright, or — for an object return — the FIELDS, which is… |
244
246
  | `ScriptReturnType` | type | `dist/core/script-return.d.ts:31-41` | Supporting types | The vocabulary a script's output can be declared as. |
245
- | `ScriptValue` | type | `dist/nodes/script/flow/spec.d.ts:65-75` | Supporting types | What a script function must return for a given `returns`: the type a name stands for, or, for a field map, an object… |
246
- | `ScriptValueOf` | type | `dist/nodes/script/flow/spec.d.ts:63-64` | Supporting types | The TypeScript type one of ScriptReturnType's names stands for. |
247
+ | `ScriptValue` | type | `dist/nodes/script/flow/spec.d.ts:98-108` | Actions | What a script function must return for a given `returns`: the type a name stands for, or, for a field map, an object… |
248
+ | `ScriptValueOf` | type | `dist/nodes/script/flow/spec.d.ts:96-97` | Actions | The TypeScript type one of ScriptReturnType's names stands for. |
247
249
  | `sendMessage` | function | `dist/nodes/conversation/flow/factories.d.ts:8-26` | Actions | Post an assistant message into a live conversation (`uipath.conversational.send-message`). |
248
250
  | `SendMessageInputs` | interface | `dist/nodes/conversation/flow/spec.d.ts:8-27` | Option shapes | 4 field(s) |
249
251
  | `ShownField` | interface | `dist/core/actions.d.ts:205-220` | Supporting types | A value the reviewer READS: shown on the form, filled in from the flow. |
@@ -5,13 +5,13 @@
5
5
 
6
6
  # Maestro Builder SDK — member index
7
7
 
8
- **A lookup table of 1236 rows — match one name in it, do not read it.**
8
+ **A lookup table of 1243 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 — 1236 across
14
- 228 interfaces and classes — keyed by the MEMBER's own name.
13
+ Every field and method of every exported shape — 1243 across
14
+ 229 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
17
17
  the case: the reference pages are "one line per field", so you arrive holding
@@ -28,7 +28,7 @@ truncated summary would, for less. Read the span.
28
28
  Member names repeat across shapes (`name` is declared on 69 of them), so the
29
29
  `Declared on` column is what makes a match actionable. For the whole shape
30
30
  rather than the one field, look that name up in [`api-index.md`](api-index.md) —
31
- which is why its span is not repeated on all 1236 rows here.
31
+ which is why its span is not repeated on all 1243 rows here.
32
32
 
33
33
  **A name that misses both indexes is probably not part of the API.** The one
34
34
  that comes up is a RUNTIME output key — a human task's `Action`, a step's
@@ -53,15 +53,15 @@ not find it either.
53
53
  | `actionSchema` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:220-244` |
54
54
  | `activity` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2998-3031` |
55
55
  | `additionalOutputs` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:98-102` |
56
- | `agent` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:381-384` |
56
+ | `agent` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:407-410` |
57
57
  | `agent` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:997-1006` |
58
- | `agenticProcess` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:377-380` |
58
+ | `agenticProcess` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:403-406` |
59
59
  | `alias` | property | `Aggregation` | `dist/nodes/transform/flow/spec.d.ts:38-39` |
60
60
  | `aliases` | property | `LookupSpec` | `dist/core/lookups.d.ts:31-32` |
61
61
  | `allErrors` | property | `RetrySpec` | `dist/bpmn/bpmn-sdk.d.ts:837-838` |
62
62
  | `allowAdhocOptionalStageTasks` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:875-876` |
63
63
  | `allowAdhocTasks` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1509-1516` |
64
- | `apiWorkflow` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:369-372` |
64
+ | `apiWorkflow` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:395-398` |
65
65
  | `apiWorkflow` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1017-1026` |
66
66
  | `app` | property | `EscalationRef` | `dist/core/actions.d.ts:729-756` |
67
67
  | `app` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:326-330` |
@@ -299,6 +299,7 @@ not find it either.
299
299
  | `effects` | property | `FormFieldRule` | `dist/core/actions.d.ts:159-160` |
300
300
  | `element` | property | `PlainTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1712-1713` |
301
301
  | `element` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:87-88` |
302
+ | `ElementCount` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:93-94` |
302
303
  | `elementId` | property | `BpmnVarDecl` | `dist/bpmn/bpmn-sdk.d.ts:396-403` |
303
304
  | `elementId` | property | `VarOpts` | `dist/bpmn/bpmn-sdk.d.ts:1741-1764` |
304
305
  | `enabledForEvals` | property | `BuiltInValidatorGuardrail` | `dist/core/actions.d.ts:360` |
@@ -372,6 +373,7 @@ not find it either.
372
373
  | `external` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:720-721` |
373
374
  | `externalAgent` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2942-2978` |
374
375
  | `externalAgent` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1095-1102` |
376
+ | `ExternalId` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:91-92` |
375
377
  | `externalWorkflow` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2979-2995` |
376
378
  | `externalWorkflow` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1103-1110` |
377
379
  | `extractionResult` | property | `DocValidationInputs` | `dist/nodes/hitl/flow/spec.d.ts:82-87` |
@@ -395,7 +397,7 @@ not find it either.
395
397
  | `filters` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:79-80` |
396
398
  | `filters` | property | `EventSubscription` | `dist/core/actions.d.ts:1046-1047` |
397
399
  | `filters` | property | `TriggerOptions` | `dist/core/actions.d.ts:1003-1004` |
398
- | `flavour` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:347-361` |
400
+ | `flavour` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:373-387` |
399
401
  | `flowIds` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3195-3238` |
400
402
  | `flowMode` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2181-2220` |
401
403
  | `flowProcess` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1039-1048` |
@@ -424,10 +426,11 @@ not find it either.
424
426
  | `folderKey` | property | `McpToolRef` | `dist/core/actions.d.ts:457-458` |
425
427
  | `folderKey` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1300-1308` |
426
428
  | `folderKey` | property | `RemoteA2aToolRef` | `dist/core/actions.d.ts:489` |
429
+ | `FolderKey` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:85-86` |
427
430
  | `folderName` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:108-114` |
428
- | `folderPath` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:188-195` |
429
- | `folderPath` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:291-302` |
430
- | `folderPath` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:81-82` |
431
+ | `folderPath` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:214-221` |
432
+ | `folderPath` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:317-328` |
433
+ | `folderPath` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:92-99` |
431
434
  | `folderPath` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:198-204` |
432
435
  | `folderPath` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1515-1516` |
433
436
  | `folderPath` | property | `ContextIndexRef` | `dist/core/actions.d.ts:789-790` |
@@ -435,14 +438,14 @@ not find it either.
435
438
  | `folderPath` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:134-140` |
436
439
  | `folderPath` | property | `McpToolRef` | `dist/core/actions.d.ts:455-456` |
437
440
  | `folderPath` | property | `ProcessToolRef` | `dist/core/actions.d.ts:653-654` |
438
- | `folderPath` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:130-140` |
441
+ | `folderPath` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:156-166` |
439
442
  | `folderPath` | property | `QueueItemInputs` | `dist/nodes/queue/flow/spec.d.ts:14-15` |
440
443
  | `folderPath` | property | `RemoteA2aToolRef` | `dist/core/actions.d.ts:488` |
441
444
  | `folderPath` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:31-38` |
442
445
  | `folderPath` | property | `TaskRef` | `dist/case/case-sdk.d.ts:568` |
443
446
  | `fork` | property | `ParallelOptions` | `dist/flow-sdk.d.ts:475-492` |
444
447
  | `fork` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3138-3163` |
445
- | `form` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:210-217` |
448
+ | `form` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:236-243` |
446
449
  | `form` | property | `HumanTaskAppOpts` | `dist/bpmn/bpmn-sdk.d.ts:1406-1407` |
447
450
  | `form` | property | `HumanTaskFormOpts` | `dist/bpmn/bpmn-sdk.d.ts:1440-1441` |
448
451
  | `format` | property | `ActionSchemaProperty` | `dist/nodes/hitl/flow/spec.d.ts:267-268` |
@@ -518,9 +521,9 @@ not find it either.
518
521
  | `inputs` | property | `ActionSchemaFile` | `dist/nodes/hitl/flow/spec.d.ts:283-284` |
519
522
  | `inputs` | property | `ActionSpecData` | `dist/case/case-sdk.d.ts:665-666` |
520
523
  | `inputs` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1623-1624` |
521
- | `inputs` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:204-209` |
522
- | `inputs` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:309-326` |
523
- | `inputs` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:83-87` |
524
+ | `inputs` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:230-235` |
525
+ | `inputs` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:335-352` |
526
+ | `inputs` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:109-113` |
524
527
  | `inputs` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:211-219` |
525
528
  | `inputs` | property | `BuiltEntryPoint` | `dist/flow-sdk.d.ts:852-853` |
526
529
  | `inputs` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:870` |
@@ -531,7 +534,7 @@ not find it either.
531
534
  | `inputs` | property | `NodeContribution` | `dist/core/node-classes.d.ts:113-117` |
532
535
  | `inputs` | property | `PlatformActionSchema` | `dist/nodes/hitl/flow/spec.d.ts:307-308` |
533
536
  | `inputs` | property | `ProcessToolRef` | `dist/core/actions.d.ts:661-662` |
534
- | `inputs` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:150-151` |
537
+ | `inputs` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:176-177` |
535
538
  | `inputs` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:95-96` |
536
539
  | `inputs` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:47-52` |
537
540
  | `inputs` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:913-927` |
@@ -542,6 +545,7 @@ not find it either.
542
545
  | `inputSchema` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:245-253` |
543
546
  | `inputSchema` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:953-964` |
544
547
  | `inputTarget` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:93` |
548
+ | `InstanceId` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:87-88` |
545
549
  | `intermediateCatchEvent` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2326-2333` |
546
550
  | `intermediateThrowEvent` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2334-2341` |
547
551
  | `internal` | property | `BpmnVarDecl` | `dist/bpmn/bpmn-sdk.d.ts:410-411` |
@@ -564,15 +568,15 @@ not find it either.
564
568
  | `join` | property | `ChooseOpts` | `dist/bpmn/bpmn-sdk.d.ts:1918-1919` |
565
569
  | `join` | property | `SplitOpts` | `dist/bpmn/bpmn-sdk.d.ts:1925-1926` |
566
570
  | `js` | property | `Expr` | `dist/core/expr.d.ts:17` |
567
- | `key` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:163-174` |
568
- | `key` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:269-282` |
569
- | `key` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:71-78` |
571
+ | `key` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:189-200` |
572
+ | `key` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:295-308` |
573
+ | `key` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:71-82` |
570
574
  | `key` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:179-185` |
571
575
  | `key` | property | `HitlConnection` | `dist/nodes/hitl/flow/spec.d.ts:28-29` |
572
576
  | `key` | property | `HumanTaskAppOpts` | `dist/bpmn/bpmn-sdk.d.ts:1420-1421` |
573
577
  | `key` | property | `McpToolRef` | `dist/core/actions.d.ts:452-453` |
574
578
  | `key` | property | `ProcessToolRef` | `dist/core/actions.d.ts:645-650` |
575
- | `key` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:109-119` |
579
+ | `key` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:135-145` |
576
580
  | `key` | property | `QueueItemInputs` | `dist/nodes/queue/flow/spec.d.ts:16-25` |
577
581
  | `key` | property | `RemoteA2aToolRef` | `dist/core/actions.d.ts:480-481` |
578
582
  | `key` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:12-22` |
@@ -614,11 +618,12 @@ not find it either.
614
618
  | `limit` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:95-100` |
615
619
  | `limit` | property | `DoWhileOptions` | `dist/flow-sdk.d.ts:575-576` |
616
620
  | `literal` | property | `Expr` | `dist/core/expr.d.ts:18` |
617
- | `location` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:177-187` |
618
- | `location` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:285-290` |
621
+ | `location` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:203-213` |
622
+ | `location` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:311-316` |
623
+ | `location` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:85-91` |
619
624
  | `location` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:186-197` |
620
625
  | `location` | property | `CarriedConnectorField` | `dist/core/carried-connector-fields.d.ts:43-44` |
621
- | `location` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:122-129` |
626
+ | `location` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:148-155` |
622
627
  | `location` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:25-30` |
623
628
  | `lookups` | property | `ConnectorMeta` | `dist/core/connectors.d.ts:76-87` |
624
629
  | `loop` | property | `ActivityNodeFields` | `dist/bpmn/bpmn-sdk.d.ts:353-354` |
@@ -681,10 +686,10 @@ not find it either.
681
686
  | `name` | property | `ActionAppRef` | `dist/case/case-sdk.d.ts:642-643` |
682
687
  | `name` | property | `ActionField` | `dist/case/case-sdk.d.ts:615-616` |
683
688
  | `name` | property | `ActivityNodeOpts` | `dist/bpmn/bpmn-sdk.d.ts:1611-1612` |
684
- | `name` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:175-176` |
685
- | `name` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:283-284` |
689
+ | `name` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:201-202` |
690
+ | `name` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:309-310` |
686
691
  | `name` | property | `AgentMemoryRef` | `dist/core/actions.d.ts:547-548` |
687
- | `name` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:79-80` |
692
+ | `name` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:83-84` |
688
693
  | `name` | property | `AppRef` | `dist/nodes/hitl/flow/spec.d.ts:177-178` |
689
694
  | `name` | property | `BindingContribution` | `dist/core/node-classes.d.ts:87-88` |
690
695
  | `name` | property | `BindingDecl` | `dist/bpmn/bpmn-sdk.d.ts:423-424` |
@@ -740,7 +745,7 @@ not find it either.
740
745
  | `name` | property | `PlainTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1710-1711` |
741
746
  | `name` | property | `PlatformActionSchemaArg` | `dist/nodes/hitl/flow/spec.d.ts:294-295` |
742
747
  | `name` | property | `ProcessToolRef` | `dist/core/actions.d.ts:651-652` |
743
- | `name` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:120-121` |
748
+ | `name` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:146-147` |
744
749
  | `name` | property | `QueueItemOpts` | `dist/bpmn/bpmn-sdk.d.ts:1343-1344` |
745
750
  | `name` | property | `ReceiveMessageOpts` | `dist/bpmn/bpmn-sdk.d.ts:1466-1467` |
746
751
  | `name` | property | `RegistryContextField` | `dist/bpmn/typed-node.d.ts:22` |
@@ -882,11 +887,13 @@ not find it either.
882
887
  | `process` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1267-1285` |
883
888
  | `process` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:959-968` |
884
889
  | `processId` | property | `SugarRegistry` | `dist/bpmn/bpmn-sdk.d.ts:2060-2065` |
890
+ | `ProcessKey` | property | `FlowMetadata` | `dist/nodes/script/flow/spec.d.ts:89-90` |
885
891
  | `project` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:76-89` |
886
- | `projectId` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:196-203` |
887
- | `projectId` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:303-308` |
892
+ | `projectId` | property | `AgenticProcessInputsBase` | `dist/nodes/process/flow/spec.d.ts:222-229` |
893
+ | `projectId` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:329-334` |
894
+ | `projectId` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:100-108` |
888
895
  | `projectId` | property | `IxpToolRef` | `dist/core/actions.d.ts:678-688` |
889
- | `projectId` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:141-149` |
896
+ | `projectId` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:167-175` |
890
897
  | `projectId` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:39-46` |
891
898
  | `prompt` | property | `BatchTransformInputs` | `dist/nodes/ai-patterns/flow/spec.d.ts:54-55` |
892
899
  | `prompt` | property | `SummarizeInputs` | `dist/nodes/ai-patterns/flow/spec.d.ts:32-33` |
@@ -895,7 +902,7 @@ not find it either.
895
902
  | `propertyAttribute` | property | `BindingContribution` | `dist/core/node-classes.d.ts:97-98` |
896
903
  | `propertyAttribute` | property | `BindingDecl` | `dist/bpmn/bpmn-sdk.d.ts:427-428` |
897
904
  | `propertyAttribute` | property | `BindingOpts` | `dist/bpmn/bpmn-sdk.d.ts:1069-1070` |
898
- | `publishedFunction` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:373-376` |
905
+ | `publishedFunction` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:399-402` |
899
906
  | `query` | property | `BuiltinToolRef` | `dist/core/actions.d.ts:573-578` |
900
907
  | `query` | property | `ContextIndexRef` | `dist/core/actions.d.ts:793-798` |
901
908
  | `query` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:34` |
@@ -964,13 +971,13 @@ not find it either.
964
971
  | `retryCount` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:109-123` |
965
972
  | `return` | method | `StepList` | `dist/flow-sdk.d.ts:1376-1385` |
966
973
  | `returnCitations` | property | `SummarizeInputs` | `dist/nodes/ai-patterns/flow/spec.d.ts:34-39` |
967
- | `returns` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:327-346` |
968
- | `returns` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:88-100` |
974
+ | `returns` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:353-372` |
975
+ | `returns` | property | `ApiWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:114-126` |
969
976
  | `returns` | property | `ClientSideToolRef` | `dist/core/actions.d.ts:505-506` |
970
977
  | `returns` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:68-90` |
971
978
  | `returns` | property | `InlineAgentInputs` | `dist/nodes/agent/flow/spec.d.ts:259-272` |
972
979
  | `returns` | property | `ProcessToolRef` | `dist/core/actions.d.ts:663-664` |
973
- | `returns` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:152-160` |
980
+ | `returns` | property | `PublishedFunctionInputs` | `dist/nodes/process/flow/spec.d.ts:178-186` |
974
981
  | `returns` | property | `QueueItemInputs` | `dist/nodes/queue/flow/spec.d.ts:63-83` |
975
982
  | `returns` | property | `RpaWorkflowInputs` | `dist/nodes/process/flow/spec.d.ts:53-68` |
976
983
  | `returns` | property | `ScriptInputs` | `dist/nodes/script/flow/spec.d.ts:10-43` |
@@ -980,7 +987,7 @@ not find it either.
980
987
  | `role` | property | `FlowTrigger` | `dist/core/node-classes.d.ts:173-174` |
981
988
  | `routedWaypoints` | property | `EdgeRoute` | `dist/flow-sdk.d.ts:776-781` |
982
989
  | `rpa` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1007-1016` |
983
- | `rpaWorkflow` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:365-368` |
990
+ | `rpaWorkflow` | property | `FlowActionSpecs` | `dist/nodes/process/flow/spec.d.ts:391-394` |
984
991
  | `rule` | property | `CaseRule` | `dist/case/case-sdk.d.ts:90` |
985
992
  | `rules` | property | `BuiltCaseExitCondition` | `dist/case/case-sdk.d.ts:412` |
986
993
  | `rules` | property | `BuiltEntryCondition` | `dist/case/case-sdk.d.ts:354` |
@@ -1008,7 +1015,7 @@ not find it either.
1008
1015
  | `schemaVersion` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1604-1643` |
1009
1016
  | `scope` | property | `EscalationRecipient` | `dist/case/case-sdk.d.ts:160` |
1010
1017
  | `scopes` | property | `GuardrailSelector` | `dist/core/actions.d.ts:290` |
1011
- | `script` | property | `FlowActionSpecs` | `dist/nodes/script/flow/spec.d.ts:78-81` |
1018
+ | `script` | property | `FlowActionSpecs` | `dist/nodes/script/flow/spec.d.ts:111-114` |
1012
1019
  | `script` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:880-896` |
1013
1020
  | `scriptFormat` | property | `ScriptTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:897-898` |
1014
1021
  | `scriptTask` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2387-2395` |
package/dist/check.js CHANGED
@@ -24,6 +24,7 @@ import { FLOW_SCHEMA_VERSIONS } from './format-profile.js';
24
24
  import { compareSchemaVersions, schemaVersionRefusal } from './schema-version.js';
25
25
  import { planSharedInputs, sharedInputRoots } from './flow-variables.js';
26
26
  import { VARS_READ_RE } from './core/vars-read.js';
27
+ import { FLOW_METADATA_KEYS, unknownMetadataKeys } from './core/flow-metadata.js';
27
28
  import { endContentKey } from './flow-end-content.js';
28
29
  import { FLOW_NODE_TYPES } from './flow-node-registry.js';
29
30
  import { stepExits } from './flow-step-exits.js';
@@ -942,6 +943,24 @@ function checkFlow(built, ancestors, opts = {}) {
942
943
  }
943
944
  }
944
945
  }
946
+ // A `$metadata` key the engine does not set. Its shape is fixed, unlike
947
+ // `$vars` (core/flow-metadata.ts), so a typo (`$metadata.instanceId`) reads
948
+ // `undefined`. A warning, not an error: a case can set other keys on an
949
+ // instance it starts, and the flow cannot tell whether one does. Read from
950
+ // the parsed code, so a local `$metadata` or a comment is not a read.
951
+ for (const { js, step } of exprs) {
952
+ for (const key of unknownMetadataKeys(js)) {
953
+ const near = FLOW_METADATA_KEYS.find((k) => k.toLowerCase() === key.toLowerCase());
954
+ diags.push({
955
+ level: 'warning',
956
+ code: 'UNKNOWN_METADATA_KEY',
957
+ step,
958
+ message: `"${step}" reads $metadata.${key}, which the engine does not set: it sets ${FLOW_METADATA_KEYS.join(', ')}. `
959
+ + 'Unless a case that starts this flow sets it, it reads undefined.',
960
+ ...(near ? { suggestion: `$metadata.${near}` } : {}),
961
+ });
962
+ }
963
+ }
945
964
  // A reference that reaches a step through a BRACKET instead of a dot.
946
965
  //
947
966
  // Both forms resolve at run time — measured, `$vars.call["output"].x` and
@@ -0,0 +1,18 @@
1
+ /** The keys the engine sets on every instance's `$metadata`. */
2
+ export declare const FLOW_METADATA_KEYS: readonly string[];
3
+ /**
4
+ * Every `$metadata` key `code` reads by name, in source order: a property
5
+ * access (`$metadata.InstanceId`, `?.`, with any whitespace or comment around
6
+ * the dot) or a string-literal element access (`$metadata['InstanceId']`).
7
+ *
8
+ * Read from the parsed code, with names resolved by a one-file checker, so only
9
+ * the runtime's own global counts: a local or parameter named `$metadata`, a
10
+ * member of that name (`o.$metadata.Region`), and text in a comment or string
11
+ * are not reads. A computed key reads nothing knowable and is skipped.
12
+ *
13
+ * `code` is a script body (top-level `return` allowed) or an expression; one
14
+ * that parses as neither is read as far as the parser recovers.
15
+ */
16
+ export declare function metadataReads(code: string): string[];
17
+ /** The keys `code` reads that the engine does not set, each once, in order of first read. */
18
+ export declare function unknownMetadataKeys(code: string): string[];
@@ -0,0 +1,63 @@
1
+ import { typescript } from './typescript-module.js';
2
+ import { isReference, isUndefinedSymbol, oneFileChecker } from './script-function.js';
3
+ /** The keys the engine sets on every instance's `$metadata`. */
4
+ export const FLOW_METADATA_KEYS = ['FolderKey', 'InstanceId', 'ProcessKey', 'ExternalId', 'ElementCount'];
5
+ const METADATA = '$metadata';
6
+ /**
7
+ * Every `$metadata` key `code` reads by name, in source order: a property
8
+ * access (`$metadata.InstanceId`, `?.`, with any whitespace or comment around
9
+ * the dot) or a string-literal element access (`$metadata['InstanceId']`).
10
+ *
11
+ * Read from the parsed code, with names resolved by a one-file checker, so only
12
+ * the runtime's own global counts: a local or parameter named `$metadata`, a
13
+ * member of that name (`o.$metadata.Region`), and text in a comment or string
14
+ * are not reads. A computed key reads nothing knowable and is skipped.
15
+ *
16
+ * `code` is a script body (top-level `return` allowed) or an expression; one
17
+ * that parses as neither is read as far as the parser recovers.
18
+ */
19
+ export function metadataReads(code) {
20
+ if (!code.includes(METADATA))
21
+ return [];
22
+ const ts = typescript();
23
+ const sf = parseBodyOrExpression(ts, code);
24
+ const checker = oneFileChecker(ts, sf);
25
+ const out = [];
26
+ const visit = (n) => {
27
+ if (ts.isIdentifier(n) && n.text === METADATA && isReference(ts, n)) {
28
+ const symbol = checker.getSymbolAtLocation(n);
29
+ const key = symbol && !isUndefinedSymbol(symbol) ? undefined : keyRead(ts, n);
30
+ if (key !== undefined)
31
+ out.push(key);
32
+ }
33
+ ts.forEachChild(n, visit);
34
+ };
35
+ visit(sf);
36
+ return out;
37
+ }
38
+ /** The keys `code` reads that the engine does not set, each once, in order of first read. */
39
+ export function unknownMetadataKeys(code) {
40
+ return [...new Set(metadataReads(code).filter((k) => !FLOW_METADATA_KEYS.includes(k)))];
41
+ }
42
+ /** The key `id` (the global) is read with: `.key`, `?.key`, or `['key']`. */
43
+ function keyRead(ts, id) {
44
+ const p = id.parent;
45
+ if (ts.isPropertyAccessExpression(p) && p.expression === id && ts.isIdentifier(p.name))
46
+ return p.name.text;
47
+ if (ts.isElementAccessExpression(p) && p.expression === id && ts.isStringLiteralLike(p.argumentExpression))
48
+ return p.argumentExpression.text;
49
+ return undefined;
50
+ }
51
+ /**
52
+ * `code` as a function body, or, when that does not parse and the expression
53
+ * does (a bare `{ a: $metadata.X }` is a block otherwise), as an expression.
54
+ */
55
+ function parseBodyOrExpression(ts, code) {
56
+ const parse = (text) => ts.createSourceFile('metadata-reads.ts', text, ts.ScriptTarget.ES2020, true, ts.ScriptKind.TS);
57
+ const errors = (sf) => (sf.parseDiagnostics ?? []).length;
58
+ const body = parse(`function __body() {\n${code}\n}`);
59
+ if (errors(body) === 0)
60
+ return body;
61
+ const expression = parse(`(${code}\n)`);
62
+ return errors(expression) === 0 ? expression : body;
63
+ }
@@ -43,6 +43,9 @@ export declare const REFUSALS: {
43
43
  readonly AGENT_READ_WRONG_CASE: "lint";
44
44
  readonly APIWF_EMPTY_RETURNS: "lint";
45
45
  readonly APIWF_KEY_NOT_KEY: "lint";
46
+ readonly APIWF_LOCAL_HAS_FOLDER: "lowering";
47
+ readonly APIWF_LOCAL_NO_PROJECT_ID: "lint";
48
+ readonly APIWF_LOCAL_PROJECT_ID_NOT_GUID: "lint";
46
49
  readonly APIWF_NAME_IS_PATH: "lint";
47
50
  readonly APIWF_NO_FOLDER: "lint";
48
51
  readonly APIWF_NO_KEY: "lowering";
@@ -680,6 +683,7 @@ export declare const REFUSALS: {
680
683
  readonly UNKNOWN_ESCALATION_REF: "lowering";
681
684
  readonly UNKNOWN_EXIT_STAGE: "lowering";
682
685
  readonly UNKNOWN_LOOP_FIELD: "lint";
686
+ readonly UNKNOWN_METADATA_KEY: "lint";
683
687
  readonly UNKNOWN_REF: "lint";
684
688
  readonly UNKNOWN_RULE: "lowering";
685
689
  readonly UNKNOWN_SLA_REF: "lowering";
@@ -92,6 +92,9 @@ export const REFUSALS = {
92
92
  AGENT_READ_WRONG_CASE: 'lint',
93
93
  APIWF_EMPTY_RETURNS: 'lint',
94
94
  APIWF_KEY_NOT_KEY: 'lint',
95
+ APIWF_LOCAL_HAS_FOLDER: 'lowering',
96
+ APIWF_LOCAL_NO_PROJECT_ID: 'lint',
97
+ APIWF_LOCAL_PROJECT_ID_NOT_GUID: 'lint',
95
98
  APIWF_NAME_IS_PATH: 'lint',
96
99
  APIWF_NO_FOLDER: 'lint',
97
100
  APIWF_NO_KEY: 'lowering',
@@ -732,6 +735,7 @@ export const REFUSALS = {
732
735
  UNKNOWN_ESCALATION_REF: 'lowering',
733
736
  UNKNOWN_EXIT_STAGE: 'lowering',
734
737
  UNKNOWN_LOOP_FIELD: 'lint',
738
+ UNKNOWN_METADATA_KEY: 'lint',
735
739
  UNKNOWN_REF: 'lint',
736
740
  UNKNOWN_RULE: 'lowering',
737
741
  UNKNOWN_SLA_REF: 'lowering',
@@ -10,27 +10,46 @@
10
10
  * artifact goes to a designer, and the author expects to see the script they
11
11
  * wrote. Only two edits are made, both because the runtime requires them:
12
12
  *
13
- * 1. the parameter is renamed to the runtime's own scope global (`$vars` in
14
- * Flow). The parameter is an authoring-time name for that global; the SDK
15
- * never calls the function or passes it anything.
13
+ * 1. each parameter is renamed to the runtime's own global for its scope
14
+ * (`$vars`, then `$metadata`, in Flow). A parameter is an authoring-time
15
+ * name for that global; the SDK never calls the function or passes it
16
+ * anything.
16
17
  * 2. esbuild's `keepNames` wrappers (`__name(fn, "fn")`) are removed. A loader
17
18
  * such as tsx adds them, and the script runtime has no `__name`.
18
19
  *
19
20
  * Everything else that would make the lowered body behave differently from the
20
21
  * function is refused rather than rewritten: a name the runtime does not
21
- * provide, a `$vars` binding that would capture the rename, a destructured
22
- * parameter whose step reads `renameRefs` could not see, a reference to the
23
- * function's own name, which only the body loses.
22
+ * provide, a `$vars` (or `$metadata`) binding that would capture the rename, a
23
+ * destructured parameter whose step reads `renameRefs` could not see, a
24
+ * reference to the function's own name, which only the body loses.
24
25
  *
25
26
  * Names are resolved with the checker of a one-file program over the function's
26
27
  * source, not by text: `a.vars`, `{ vars: 1 }` and an inner `(vars) => …` are
27
28
  * not references to the parameter, and only a checker knows that.
28
29
  */
29
30
  import type * as TS from 'typescript';
30
- /** How a runtime receives a lowered script: its scope global, and every other name it provides. */
31
+ /** One scope a runtime binds to a global, which a script function takes as a parameter. */
32
+ export interface ScriptScope {
33
+ /** The identifier the runtime binds it to: `$vars`. */
34
+ global: string;
35
+ /** The plain parameter name errors suggest for it: `vars`. */
36
+ param: string;
37
+ /** What it holds, as errors name it: `the variable scope`. */
38
+ holds: string;
39
+ /** What a dotted read of it names, as errors name it: `step` (`$vars.<step>`). */
40
+ reads: string;
41
+ /** A dotted read's tail, as errors show it: `start.output.x`. */
42
+ example: string;
43
+ /** What sees only a dotted read, as errors name it: `the step renaming and reference checks`. */
44
+ checkedBy: string;
45
+ }
46
+ /** How a runtime receives a lowered script: its scope globals, and every other name it provides. */
31
47
  export interface ScriptRuntime {
32
- /** The identifier the runtime binds the variable scope to (`$vars` in Flow). */
33
- scopeGlobal: string;
48
+ /**
49
+ * The scopes the runtime binds, in parameter order (`$vars`, then `$metadata`,
50
+ * in Flow): a script function takes one parameter per scope, or fewer.
51
+ */
52
+ scopes: readonly ScriptScope[];
34
53
  /** Every other global name the runtime provides: the language built-ins it has, `console`. */
35
54
  globals: ReadonlySet<string>;
36
55
  /**
@@ -75,19 +94,30 @@ export declare function scriptFunctionLowerings(): readonly string[];
75
94
  /** Options for {@link tryLowerScriptFunction}. */
76
95
  export interface LowerOptions {
77
96
  /**
78
- * Refuse any use of the parameter other than a dotted read (`vars.start…`):
97
+ * Refuse any use of a parameter other than a dotted read (`vars.start…`):
79
98
  * an alias (`const v = vars`), a computed read (`vars['start']`), an optional
80
99
  * read (`vars?.start`), or passing it on (`pick(vars)`, `{ vars }`) each hides
81
100
  * the step it reads from `renameRefs` and the reference check, which see only
82
- * `$vars.<name>`. Authoring (`script(fn)`) sets it; decompile's gate does not,
83
- * because there the text is the node's own either way.
101
+ * `$vars.<name>` (and, for `$metadata`, the key it reads from the key check).
102
+ * Authoring (`script(fn)`) sets it; decompile's gate does not, because there
103
+ * the text is the node's own either way.
84
104
  */
85
105
  scopeReadsOnly?: boolean;
86
106
  }
87
107
  /** What lowering a function's source produced: its body, or every problem with it. */
88
- export type LoweredScript = {
108
+ export type LoweredScript =
109
+ /**
110
+ * `scopesRead` is the scope globals whose parameter the body reads, and
111
+ * `scopesDeclared` the ones the body binds in the function's own scope (a
112
+ * top-level `let`, `const`, `class` or `function`, or a `var` outside a nested
113
+ * function), each in scope order. A body that binds one reads its own local,
114
+ * and a parameter of that name printed beside it would clash.
115
+ */
116
+ {
89
117
  ok: true;
90
118
  code: string;
119
+ scopesRead: string[];
120
+ scopesDeclared: string[];
91
121
  }
92
122
  /**
93
123
  * `free` is the names the runtime would not have, also described in `problems`;
@@ -111,18 +141,18 @@ export declare function tryLowerScriptFunction(source: string, runtime: ScriptRu
111
141
  export declare function scriptBodySyntaxError(code: string): string | undefined;
112
142
  /**
113
143
  * The JavaScript engine's early error for a body run as
114
- * `function (<scopeGlobal>) { "use strict"; <code> }`, or undefined when it has
144
+ * `function (<params>) { "use strict"; <code> }`, or undefined when it has
115
145
  * none.
116
146
  *
117
147
  * TypeScript's parser does not report early errors (a duplicate `let`, a
118
- * `const $vars` that clashes with the parameter, an octal literal in strict
148
+ * `const $vars` that clashes with a parameter, an octal literal in strict
119
149
  * code), and the printed function lives in an ES module, which is strict. A body
120
150
  * with one would make the whole module unloadable, so decompile asks the engine.
121
151
  * The body is compiled, never called. A host without the `Function`
122
152
  * constructor (a strict content-security policy) cannot answer, which is
123
153
  * reported as an error too, so the caller keeps the string form.
124
154
  */
125
- export declare function scriptBodyEarlyError(code: string, runtime: ScriptRuntime): string | undefined;
155
+ export declare function scriptBodyEarlyError(code: string, params: readonly string[]): string | undefined;
126
156
  /**
127
157
  * The first piece of TypeScript-only syntax in a body, described, or undefined.
128
158
  *
@@ -134,5 +164,9 @@ export declare function scriptBodyEarlyError(code: string, runtime: ScriptRuntim
134
164
  * string form.
135
165
  */
136
166
  export declare function scriptBodyTypeScriptSyntax(code: string): string | undefined;
167
+ /** The checker of a one-file program over `sf`, with no default library: globals resolve to nothing. */
168
+ export declare function oneFileChecker(ts: typeof TS, sf: TS.SourceFile): TS.TypeChecker;
169
+ /** The checker's own symbol for `undefined`, which a no-lib program still binds. */
170
+ export declare function isUndefinedSymbol(s: TS.Symbol): boolean;
137
171
  /** Whether `id` is read as a value, not a property name, label, or type. */
138
172
  export declare function isReference(ts: typeof TS, id: TS.Identifier): boolean;