@uipath/maestro-builder-sdk 6.96.4 → 6.96.5

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/check.js CHANGED
@@ -18,8 +18,8 @@ import { endContentKey } from './flow-end-content.js';
18
18
  import { FLOW_NODE_TYPES, FLOW_TRIGGER_TYPES } from './flow-node-registry.js';
19
19
  import { stepExits, stepRouting } from './flow-step-exits.js';
20
20
  import { stepDeclaredVariables } from './flow-step-variables.js';
21
- import { plainHttpOnErrorMessage } from './nodes/http/flow/family.js';
22
21
  import { resolveVersion, resolveVersionCarried } from './core/nodes/versioned.js';
22
+ import { registeredRawType } from './raw-node-advice.js';
23
23
  import { loopParallelWarning, resolveLoopDefinition, loopVersion } from './loop-version.js';
24
24
  import { refusalClass } from './core/refusals.js';
25
25
  import { classifyDrafts, findingCounts, placeDiagnostics, splitUnplaced } from './edit-scope.js';
@@ -330,9 +330,9 @@ function checkFlow(built, ancestors, opts = {}) {
330
330
  // readable result (see TERMINATE_HAS_NO_OUTPUT below) — and it stops the RUN,
331
331
  // so anything after it is unreachable (TERMINATE_UNREACHABLE_AFTER).
332
332
  const terminateNames = new Set();
333
- // Agentic-process step name → its call, for the form-field rules below. Its
334
- // output READS go through OUTPUT_READ_RULES like every `returns` family.
335
- const agenticProcesses = new Map();
333
+ // Step name → the option that makes it wait, for a step that dispatches
334
+ // without waiting (`FlowNodeType.fireAndForget`): FIRE_AND_FORGET_READ below.
335
+ const fireAndForgetSteps = new Map();
336
336
  // Step name → the read rule for its output, bound to its inputs. Filled from
337
337
  // OUTPUT_READ_RULES for every kind whose inputs take a `returns`.
338
338
  const outputReaders = new Map();
@@ -487,6 +487,11 @@ function checkFlow(built, ancestors, opts = {}) {
487
487
  if (registered) {
488
488
  const { placed, checked } = checkRegisteredStep(registered, s, exprs, errorSource, opts, diags, typeOf, triggerId, carriedLookup([built, ...ancestors]));
489
489
  checkedSteps.set(s.name, checked);
490
+ // The flow-level fire-and-forget read rule below needs to know which
491
+ // steps dispatch without waiting.
492
+ const dispatchOnly = checked.impl.fireAndForget?.(checked.spec);
493
+ if (dispatchOnly)
494
+ fireAndForgetSteps.set(s.name, dispatchOnly.fix);
490
495
  if (placed)
491
496
  registeredSteps.set(s.name, checked);
492
497
  else
@@ -521,10 +526,6 @@ function checkFlow(built, ancestors, opts = {}) {
521
526
  // as an arm, so it never belongs there.
522
527
  if (routing?.unsplit && s0.kind !== 'stepSwitch')
523
528
  hitlChoiceNoPorts.set(s.name, routing.unsplit);
524
- // The process family checks the step itself; the flow-level fire-and-forget
525
- // read rule below needs to know which steps dispatch without waiting.
526
- if (s.spec.kind === 'agenticProcess')
527
- agenticProcesses.set(s.name, s.spec.inputs);
528
529
  {
529
530
  const rule = OUTPUT_READ_RULES[s.spec.kind];
530
531
  if (typeof rule === 'function') {
@@ -883,16 +884,16 @@ function checkFlow(built, ancestors, opts = {}) {
883
884
  // A fire-and-forget dispatch publishes no output: any read of it would wait
884
885
  // on a value the run will never produce. Error reads stay legal — dispatch
885
886
  // failures still route (design §2.2).
886
- const fireAndForget = new Set([...agenticProcesses.entries()].filter(([, i]) => i.completion === 'fire-and-forget').map(([n]) => n));
887
887
  for (const { js, step } of exprs) {
888
888
  for (const m of js.matchAll(/\$vars\.([A-Za-z0-9_]+)\.output\b/g)) {
889
- if (fireAndForget.has(m[1])) {
889
+ const fix = fireAndForgetSteps.get(m[1]);
890
+ if (fix !== undefined) {
890
891
  diags.push({
891
892
  level: 'error',
892
893
  code: 'FIRE_AND_FORGET_READ',
893
894
  step,
894
895
  message: `"${step}" reads $vars.${m[1]}.output, but "${m[1]}" is fire-and-forget — it dispatches `
895
- + `and publishes no output. Use completion: 'wait' on "${m[1]}", or stop reading its result.`,
896
+ + `and publishes no output. Use ${fix} on "${m[1]}", or stop reading its result.`,
896
897
  });
897
898
  }
898
899
  }
@@ -2527,8 +2528,8 @@ placed, opts) {
2527
2528
  // is left here is a node type's own refusal of a handler on a port it has.
2528
2529
  if (!step || step.kind === 'loop' || step.kind === 'doWhile')
2529
2530
  return;
2530
- // A custom node backed by a typed family's bundled definition gets that
2531
- // family's refusals: the rules are about the node type, not the SDK kind.
2531
+ // A custom node built on a registered type's definition gets that type's
2532
+ // handler rules: they are about the node type, not the SDK kind.
2532
2533
  const maybeCustom = step.spec;
2533
2534
  if (!('kind' in maybeCustom) && maybeCustom instanceof FlowNode) {
2534
2535
  let def;
@@ -2540,8 +2541,15 @@ placed, opts) {
2540
2541
  // A contribution compile cannot lower is the serializer's CONTRIBUTION_INVALID.
2541
2542
  return;
2542
2543
  }
2543
- if (def?.nodeType === 'core.action.http')
2544
- diags.push(plainHttpOnErrorRefusal(step.name));
2544
+ // As for a registered step, the type's rules apply only to a port that exists;
2545
+ // a definition with none is the serializer's ONERROR_NO_ERROR_PORT.
2546
+ if (!definitionHasErrorPort(def))
2547
+ return;
2548
+ const found = registeredRawType(def?.nodeType, String(def?.version ?? ''));
2549
+ found?.impl.checkCustomErrorHandler?.({
2550
+ step: step.name,
2551
+ report: (code, message, suggestion) => diags.push(catalogued(found.entry, step.name, code, message, suggestion)),
2552
+ });
2545
2553
  return;
2546
2554
  }
2547
2555
  // A registered node type (an unregistered pin still has a record, with the
@@ -2563,11 +2571,6 @@ placed, opts) {
2563
2571
  if (hasPort)
2564
2572
  impl.checkErrorHandler?.(placed.spec, placed.ctx);
2565
2573
  }
2566
- /** `.onError` after a custom node built on the plain `core.action.http` definition (the http family's refusal). */
2567
- function plainHttpOnErrorRefusal(stepName) {
2568
- const { message, suggestion } = plainHttpOnErrorMessage(stepName);
2569
- return { level: 'error', code: 'HTTP_ONERROR_V1', message, step: stepName, suggestion };
2570
- }
2571
2574
  /**
2572
2575
  * Reading a value that only ONE arm produces (flow-builder-sdk#200).
2573
2576
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * `connection` resources are out of scope: a connector definition's entries are
24
24
  * keyed by the tenant connection id, which the definition does not carry. A raw
25
- * connector node is refused for that reason (`connector-raw-node.ts`).
25
+ * connector node is refused for that reason (`nodes/connector/flow/raw-node.ts`).
26
26
  *
27
27
  * Pure: `serialize` lowers with it, and `check` runs it dry so the two agree.
28
28
  */
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * `connection` resources are out of scope: a connector definition's entries are
24
24
  * keyed by the tenant connection id, which the definition does not carry. A raw
25
- * connector node is refused for that reason (`connector-raw-node.ts`).
25
+ * connector node is refused for that reason (`nodes/connector/flow/raw-node.ts`).
26
26
  *
27
27
  * Pure: `serialize` lowers with it, and `check` runs it dry so the two agree.
28
28
  */
@@ -135,6 +135,12 @@ export interface ArtifactContexts {
135
135
  check: unknown;
136
136
  familyCheck: unknown;
137
137
  }
138
+ /** What {@link NodeType.checkCustomErrorHandler} reports through: the step and the report, and no spec. */
139
+ export interface ErrorHandlerCheckContext {
140
+ /** The step name the author gave the node. */
141
+ readonly step: string;
142
+ report(code: string, message: string, suggestion?: string): void;
143
+ }
138
144
  /** One node type at one version, for one artifact. See the module header. */
139
145
  export interface NodeType<Spec, Serialized, Ctx extends ArtifactContexts> {
140
146
  /** The spec discriminator, e.g. `'dataFabricRead'`. Unique within the artifact's registry. */
@@ -172,6 +178,13 @@ export interface NodeType<Spec, Serialized, Ctx extends ArtifactContexts> {
172
178
  * 4xx/5xx and publishes no envelope. Reported through `ctx` like `check`.
173
179
  */
174
180
  checkErrorHandler?(spec: Spec, ctx: Ctx['check']): void;
181
+ /**
182
+ * The same rules for a custom node built on this type's definition, run only
183
+ * when that definition has an error port. Such a node has no spec of this type,
184
+ * so the rule is about the node type alone, and `ctx` carries only the step and
185
+ * the report. Omit it and a custom node gets no handler rules from this type.
186
+ */
187
+ checkCustomErrorHandler?(ctx: ErrorHandlerCheckContext): void;
175
188
  /**
176
189
  * Every authored value evaluated against the artifact's scope. Required: a type
177
190
  * with none returns `[]`, by decision, because an omitted hook would silently
package/dist/extend.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  import type { NodeFamily, DiagnosticCatalog, PackageOrigin } from './core/nodes/family.js';
26
26
  import type { FlowAction } from './core/node-classes.js';
27
27
  import type { FlowContexts, FlowNodeFamily } from './flow-node-type.js';
28
- export type { NodeType, FactoryCall, OutputContract, ExprSite, DefinitionSource, ArtifactContexts, FieldsRead, OutputRead, OutputPathRead, } from './core/nodes/node-type.js';
28
+ export type { NodeType, FactoryCall, OutputContract, ExprSite, DefinitionSource, ArtifactContexts, ErrorHandlerCheckContext, FieldsRead, OutputRead, OutputPathRead, } from './core/nodes/node-type.js';
29
29
  export type { VersionedNodeType } from './core/nodes/versioned.js';
30
30
  export type { NodeFamily, Placement, DiagnosticCatalog, PackageOrigin } from './core/nodes/family.js';
31
31
  export type { DefinitionReference } from './core/node-classes.js';
@@ -602,6 +602,16 @@ export interface FlowNodeType<Spec> extends NodeType<Spec, FlowNodeContribution,
602
602
  * node has no such exits, and a fully wired one forks over its `exits`.
603
603
  */
604
604
  savedExits?(node: unknown): FlowSavedExits;
605
+ /**
606
+ * Set when a step of this spec dispatches without waiting, so it publishes no
607
+ * output: `check`'s flow-level FIRE_AND_FORGET_READ refuses every read of the
608
+ * step's output, and names `fix`, the option that makes it wait. Its error
609
+ * reads stay legal, since a failed dispatch still routes. Omitted, or
610
+ * `undefined`: the step waits.
611
+ */
612
+ fireAndForget?(spec: Spec): {
613
+ readonly fix: string;
614
+ } | undefined;
605
615
  /**
606
616
  * The flow variables a step of this type DECLARES by running: names a later
607
617
  * `$vars.<name>` read resolves to that are neither a `.var()` nor a step
@@ -1,3 +1,4 @@
1
1
  /** The agents node family, as flow-node-registry.ts lists it: the inline, conversational and voice agents and the voice call steps. */
2
2
  import type { FlowNodeFamily } from '../../../flow-node-type.js';
3
3
  export declare const agentFlowFamily: FlowNodeFamily;
4
+ export { isAgentResourceType } from './resources.js';
@@ -6,3 +6,4 @@ export const agentFlowFamily = {
6
6
  types: agentNodeTypes,
7
7
  diagnostics: AGENT_DIAGNOSTICS,
8
8
  };
9
+ export { isAgentResourceType } from './resources.js';
@@ -2,6 +2,16 @@ import type { ContextIndexRef, EscalationRef, ProcessToolKind, ToolArgument } fr
2
2
  import { CompileRefusal } from '../../../core/compile-refusal.js';
3
3
  import type { ResolvedConnector } from '../../../core/library.js';
4
4
  import type { ProcessResourceSubType } from '../../../core/process-resource.js';
5
+ /**
6
+ * Whether a saved node's type is one of an agent's resource nodes
7
+ * (`uipath.agent.resource.tool.connector.…`, a context index, an escalation, a
8
+ * memory). Their binding placeholders are resolved through the AGENT project —
9
+ * `uip agent refresh` generates a connector tool's resource — and the deployed
10
+ * corpus carries no flow `bindings[]` entry for them, so serialize's placeholder
11
+ * check passes them by. By type name, not by what attached them: a raw resource
12
+ * node reaches that check too (decompile keeps an orphaned one as a `rawNode`).
13
+ */
14
+ export declare function isAgentResourceType(typeName: string): boolean;
5
15
  /** The inline (autonomous) agent's node type — fixed, not per-instance. */
6
16
  export declare const INLINE_AGENT = "uipath.agent.autonomous";
7
17
  /**
@@ -19,6 +19,18 @@ import { formFieldJsonSchema } from '../../../core/form-field-type.js';
19
19
  import { jsonClone } from '../../../core/json-clone.js';
20
20
  import { ownEntry } from '../../../core/own-entry.js';
21
21
  import { argumentTypes, jsonPathKey, promptOf, toolArgumentProperties } from '../../../core/tool-argument.js';
22
+ /**
23
+ * Whether a saved node's type is one of an agent's resource nodes
24
+ * (`uipath.agent.resource.tool.connector.…`, a context index, an escalation, a
25
+ * memory). Their binding placeholders are resolved through the AGENT project —
26
+ * `uip agent refresh` generates a connector tool's resource — and the deployed
27
+ * corpus carries no flow `bindings[]` entry for them, so serialize's placeholder
28
+ * check passes them by. By type name, not by what attached them: a raw resource
29
+ * node reaches that check too (decompile keeps an orphaned one as a `rawNode`).
30
+ */
31
+ export function isAgentResourceType(typeName) {
32
+ return typeName.startsWith('uipath.agent.resource.');
33
+ }
22
34
  /** The inline (autonomous) agent's node type — fixed, not per-instance. */
23
35
  export const INLINE_AGENT = 'uipath.agent.autonomous';
24
36
  const IXP_DEF = ixpDefinition;
@@ -6,3 +6,4 @@
6
6
  import type { FlowNodeFamily, FlowTriggerFamily } from '../../../flow-node-type.js';
7
7
  export declare const connectorFlowFamily: FlowNodeFamily;
8
8
  export declare const connectorTriggerFamily: FlowTriggerFamily;
9
+ export { connectorRawNodeRefusal } from './raw-node.js';
@@ -15,3 +15,4 @@ export const connectorTriggerFamily = {
15
15
  // Its rules' codes are the pipeline's (ctx.eventSubscription).
16
16
  diagnostics: {},
17
17
  };
18
+ export { connectorRawNodeRefusal } from './raw-node.js';
@@ -1,8 +1,10 @@
1
1
  /**
2
- * Internal: the one rule that keeps `rawNode` from standing in for `connector()`.
2
+ * Internal: the one rule that keeps `rawNode` from standing in for `connector()`,
3
+ * `onEvent()` or `waitForEvent()`, the connector family's three types, for
4
+ * every name under `uipath.connector.` (one no type claims included).
3
5
  * Not re-exported from the package entry point.
4
6
  */
5
- import { prepareCommand } from './cli-spelling.js';
7
+ import { prepareCommand } from '../../../core/cli-spelling.js';
6
8
  /**
7
9
  * Why a `rawNode` may not carry a connector node type, or `undefined` when the
8
10
  * type is not a connector's.
@@ -1,8 +1,3 @@
1
1
  /** The HTTP node family, as flow-node-registry.ts lists it: `core.action.http` and `core.action.http.v2`. */
2
2
  import type { FlowNodeFamily } from '../../../flow-node-type.js';
3
3
  export declare const httpFlowFamily: FlowNodeFamily;
4
- /**
5
- * The plain node's `.onError` refusal, for check.ts: a custom node built on the
6
- * `core.action.http` definition gets the same answer as an `http()` step.
7
- */
8
- export { plainHttpOnErrorMessage } from './check.js';
@@ -6,8 +6,3 @@ export const httpFlowFamily = {
6
6
  types: httpNodeTypes,
7
7
  diagnostics: HTTP_DIAGNOSTICS,
8
8
  };
9
- /**
10
- * The plain node's `.onError` refusal, for check.ts: a custom node built on the
11
- * `core.action.http` definition gets the same answer as an `http()` step.
12
- */
13
- export { plainHttpOnErrorMessage } from './check.js';
@@ -16,6 +16,11 @@ import { CompileRefusal } from '../../../core/compile-refusal.js';
16
16
  const PLAIN = 'core.action.http';
17
17
  const MANAGED = 'core.action.http.v2';
18
18
  /** The definition's `inputDefaults` at the version being emitted. */
19
+ /** `.onError` on a plain HTTP node, typed or custom: the port exists but catches nothing a handler can read. */
20
+ function refusePlainHttpHandler(ctx) {
21
+ const { message, suggestion } = plainHttpOnErrorMessage(ctx.step);
22
+ ctx.report('HTTP_ONERROR_V1', message, suggestion);
23
+ }
19
24
  function defaults(ctx, typeName) {
20
25
  return jsonClone(ctx.definition(typeName, ctx.version)?.inputDefaults ?? {});
21
26
  }
@@ -391,10 +396,8 @@ function httpAt(typeName, version, managed) {
391
396
  // The plain node's port exists (its definition declares it) but catches
392
397
  // nothing a handler can read; see plainHttpOnErrorMessage.
393
398
  ...(managed ? {} : {
394
- checkErrorHandler: (_spec, ctx) => {
395
- const { message, suggestion } = plainHttpOnErrorMessage(ctx.step);
396
- ctx.report('HTTP_ONERROR_V1', message, suggestion);
397
- },
399
+ checkErrorHandler: (_spec, ctx) => refusePlainHttpHandler(ctx),
400
+ checkCustomErrorHandler: refusePlainHttpHandler,
398
401
  }),
399
402
  expressions: ({ inputs }) => [
400
403
  { value: inputs.url },
@@ -844,6 +844,11 @@ function processType(kind, prefix, factory, form) {
844
844
  // check collected no expressions for a process step before the port; unchanged by it.
845
845
  expressions: () => [],
846
846
  output: processOutput,
847
+ ...(kind === 'agenticProcess' ? {
848
+ fireAndForget: ({ inputs }) => inputs?.completion === 'fire-and-forget'
849
+ ? { fix: "completion: 'wait'" }
850
+ : undefined,
851
+ } : {}),
847
852
  };
848
853
  return {
849
854
  kind, typeName: `${prefix}*`, typeNamePrefix: prefix, factory, defaultVersion: '1.0.0',
@@ -1,10 +1,12 @@
1
- import type { FlowNodeType } from './flow-node-type.js';
1
+ import type { FlowContexts, FlowNodeType } from './flow-node-type.js';
2
+ import type { Registered } from './core/nodes/registry.js';
2
3
  /**
3
4
  * The registered node type a raw node of `nodeType@version` is, at that version
4
5
  * when it is registered and at the default otherwise (a raw node is often how an
5
6
  * author reaches an unregistered version); undefined for an unregistered type.
6
7
  */
7
8
  export declare function registeredRawType(nodeType: unknown, version: string): {
9
+ entry: Registered<FlowContexts>;
8
10
  impl: FlowNodeType<unknown>;
9
11
  } | undefined;
10
12
  /** An input a registered node type never reads, as RAW_NODE_UNKNOWN_INPUT reports it; undefined otherwise. */
@@ -18,7 +18,7 @@ export function registeredRawType(nodeType, version) {
18
18
  return undefined;
19
19
  const registered = Object.hasOwn(entry.type.versions, version);
20
20
  const impl = (registered ? entry.type.versions[version] : entry.type.versions[entry.type.defaultVersion]);
21
- return { impl };
21
+ return { entry, impl };
22
22
  }
23
23
  /** An input a registered node type never reads, as RAW_NODE_UNKNOWN_INPUT reports it; undefined otherwise. */
24
24
  export function rawNodeInputProblem(nodeType, version, inputs) {
package/dist/raw-node.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * re-exports it, so authors import it exactly as before.
7
7
  */
8
8
  import { FlowAction, } from './core/node-classes.js';
9
- import { connectorRawNodeRefusal } from './core/connector-raw-node.js';
9
+ import { connectorRawNodeRefusal } from './nodes/connector/flow/family.js';
10
10
  import { rawNodeInputProblem, rawNodeTypedFamilyWarning } from './raw-node-advice.js';
11
11
  import { forwardFanOut } from './core/definition-handles.js';
12
12
  import { RAW_NODE_EXITS } from './core/raw-node-exits.js';
package/dist/serialize.js CHANGED
@@ -11,7 +11,8 @@ import { BUNDLED_DEFINITIONS, bundledVersions } from './flow-definitions.js';
11
11
  import { LOOP_DEFAULT_VERSION, bodyUsesBreak, loopDeclaredInputs, loopHasInnerHandles, loopVersion, loopVersionRefusal } from './loop-version.js';
12
12
  import { Expr, toExpr, flatNameSegmentsOf, parallelFork } from './flow-sdk.js';
13
13
  import { FlowAction, FlowTrigger } from './core/node-classes.js';
14
- import { connectorRawNodeRefusal } from './core/connector-raw-node.js';
14
+ import { connectorRawNodeRefusal } from './nodes/connector/flow/family.js';
15
+ import { isAgentResourceType } from './nodes/agent/flow/family.js';
15
16
  import { CompileRefusal, LibraryRequiredRefusal } from './core/compile-refusal.js';
16
17
  import { nearestName } from './core/edit-distance.js';
17
18
  import { rawNodeInputProblem, registeredRawType } from './raw-node-advice.js';
@@ -3737,11 +3738,9 @@ export function assertBindingPlaceholdersResolve(flow, unbound = new Set()) {
3737
3738
  }
3738
3739
  const dangling = [];
3739
3740
  for (const node of nodes) {
3740
- // An agent's resource nodes (`uipath.agent.resource.tool.connector.…`) carry
3741
- // the same placeholders, but they are resolved through the AGENT project —
3742
- // `uip agent refresh` generates the connector tool's resource — and the
3743
- // deployed corpus carries no flow `bindings[]` entry for them.
3744
- if (typeof node?.type !== 'string' || node.type.startsWith('uipath.agent.resource.'))
3741
+ // An agent's resource nodes carry the same placeholders, but resolve them
3742
+ // through the agent project (`isAgentResourceType`).
3743
+ if (typeof node?.type !== 'string' || isAgentResourceType(node.type))
3745
3744
  continue;
3746
3745
  if (unbound.has(node.id))
3747
3746
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.96.4",
3
+ "version": "6.96.5",
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",
@@ -113,5 +113,5 @@
113
113
  "@types/node": "^22.7.0",
114
114
  "esbuild": "^0.28.1"
115
115
  },
116
- "gitref": "0439ae5d0fdb447fb350759a56d3ffd7f8c859dd"
116
+ "gitref": "84f00bcf8f2a3adc95f7eb70b55234d80023c0f9"
117
117
  }