@uipath/maestro-builder-sdk 6.104.0 → 6.104.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.
@@ -219,8 +219,28 @@ export interface FormFieldSettings {
219
219
  /** Guidance for an agent that pre-fills the field. */
220
220
  description?: string;
221
221
  }
222
+ /**
223
+ * The form-row keys a field carries that the SDK has no option for (#1989).
224
+ */
225
+ export interface FormFieldRowExtra {
226
+ /**
227
+ * Keys written onto the field's row as they are, after the ones the SDK
228
+ * writes itself. A key the SDK writes from one of the field's own options
229
+ * (`id`, `label`, `type`, `direction`, a setting, a `required` or
230
+ * `variable` also set as an option, a shown field's `binding`) is refused:
231
+ * `HITL_FIELD_EXTRA_CONFLICT`. An asked field's `variable` with no typed
232
+ * `variable` replaces the SDK's default `vars.<id>`. Decompile fills
233
+ * it from a `.flow` row the designer wrote, so an edit to the node keeps what
234
+ * the SDK cannot model: a key the platform's field schema does not define, a
235
+ * `variable` other than `vars.<name>`, a `binding` on an asked field. The SDK
236
+ * does not check what is inside. For instance
237
+ * `{ id: 'note', type: 'string', direction: 'output', extra: { variable: 'vars.order.note' } }`
238
+ * writes `"variable": "vars.order.note"` in place of `"vars.note"`.
239
+ */
240
+ extra?: Record<string, unknown>;
241
+ }
222
242
  /** A value the reviewer READS: shown on the form, filled in from the flow. */
223
- export interface ShownField extends FormFieldSettings {
243
+ export interface ShownField extends FormFieldSettings, FormFieldRowExtra {
224
244
  /** Field id — the key the answer object uses. Must be unique on the form. */
225
245
  id: string;
226
246
  /** Label the reviewer sees. Defaults to `id`. */
@@ -236,7 +256,7 @@ export interface ShownField extends FormFieldSettings {
236
256
  value: Expr;
237
257
  }
238
258
  /** A value the reviewer FILLS IN: read downstream with `out('<step>', '<id>')`. */
239
- export interface AskedField extends FormFieldSettings {
259
+ export interface AskedField extends FormFieldSettings, FormFieldRowExtra {
240
260
  /** Field id — the key the answer object uses. Must be unique on the form. */
241
261
  id: string;
242
262
  /** Label the reviewer sees. Defaults to `id`. */
@@ -261,7 +281,7 @@ export interface AskedField extends FormFieldSettings {
261
281
  * answer. Read it downstream with `out('<step>', '<id>')` — the write target is
262
282
  * the field's own id, deliberately decoupled from where the pre-fill came from.
263
283
  */
264
- export interface InOutField extends FormFieldSettings {
284
+ export interface InOutField extends FormFieldSettings, FormFieldRowExtra {
265
285
  /** Field id — the key the answer object uses. Must be unique on the form. */
266
286
  id: string;
267
287
  /** Label the reviewer sees. Defaults to `id`. */
@@ -216,13 +216,67 @@ export declare function formFieldVariableName(variable: unknown): string | undef
216
216
  * The keys of a form row the SDK cannot carry into source, each with why.
217
217
  * Empty when decompile → compile writes the row back as it was. The lifts
218
218
  * report a non-empty list as a warning (an error under `--strict`), so no key
219
- * is dropped silently.
219
+ * is dropped silently. What is left is a value the platform refuses or drops
220
+ * itself: a setting of the wrong shape, an unknown key inside `options` or
221
+ * `rules`, a label or `required` of the wrong type. Every other key the SDK
222
+ * has no option for is carried in the field's `extra` (`formFieldRowExtra`).
220
223
  *
221
224
  * @example
222
225
  * formFieldRowLoss({ id: 'a', label: 'A', type: 'string', direction: 'output', colSpan: 13 }, 'human task')
223
226
  * // ['colSpan: 13 (not the platform\'s shape for it)']
224
227
  */
225
228
  export declare function formFieldRowLoss(row: Record<string, unknown>, site: FormRowSite): string[];
229
+ /**
230
+ * The keys of a form row the SDK has no option for, which decompile lifts into
231
+ * the field's `extra` so compile writes them back as they were (#1989): a key
232
+ * the platform's field schema does not define, a `variable` other than the
233
+ * `vars.<name>` the SDK writes on an asked field, a `binding` or `variable`
234
+ * where the SDK writes none, the form editor's `value`, `required: true` on a
235
+ * shown field. Empty when there is none.
236
+ *
237
+ * @example
238
+ * formFieldRowExtra({ id: 'a', type: 'string', direction: 'output', variable: 'vars.order.note', hint: 'x' }, 'human task')
239
+ * // { variable: 'vars.order.note', hint: 'x' }
240
+ */
241
+ export declare function formFieldRowExtra(row: Record<string, unknown>, site: FormRowSite): Record<string, unknown>;
242
+ /**
243
+ * The `extra` keys that would replace a row key the SDK writes from one of the
244
+ * field's typed options, in `extra`'s order. Empty when there is none.
245
+ *
246
+ * The serializers refuse a field with one (`HITL_FIELD_EXTRA_CONFLICT`,
247
+ * `FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT`): with `extra` spread last, the
248
+ * row would say one thing and the rest of the node another. For instance
249
+ * `{ id: 'amt', type: 'string', direction: 'output', extra: { type: 'number' } }`
250
+ * would write a number row while the task's outputs still say `amt: string`.
251
+ * The keys:
252
+ * - `id`, `label`, `type`, `direction` and every settings key, always;
253
+ * - `required`, when the typed `required` is set too;
254
+ * - on a human task, `variable` when the typed `variable` is set too, and
255
+ * `binding` on a shown or pre-filled field, whose `binding` the SDK writes
256
+ * from `value`.
257
+ * What decompile carries never conflicts (`formFieldRowExtra`): each key it
258
+ * lifts into `extra` is one the SDK did not write for that row.
259
+ *
260
+ * @example
261
+ * formFieldExtraConflicts({ id: 'a', direction: 'output', variable: 'v', extra: { variable: 'vars.x', hint: 1 } }, 'human task') // ['variable']
262
+ */
263
+ export declare function formFieldExtraConflicts(f: {
264
+ direction?: unknown;
265
+ required?: unknown;
266
+ variable?: unknown;
267
+ extra?: Record<string, unknown>;
268
+ }, site: FormRowSite): string[];
269
+ /**
270
+ * A field's `extra` as the form row carries it: each key copied, so the wire
271
+ * never aliases the author's objects. The serializers spread it LAST, so a key
272
+ * the SDK also writes (an asked field's `variable`) takes the `extra` value.
273
+ *
274
+ * @example
275
+ * formFieldExtraWire({ extra: { hint: 'x' } }) // { hint: 'x' }
276
+ */
277
+ export declare function formFieldExtraWire(f: {
278
+ extra?: Record<string, unknown>;
279
+ }): Record<string, unknown>;
226
280
  /**
227
281
  * The warning (or `--strict` error) for a row `formFieldRowLoss` reported.
228
282
  * `where` names the form, e.g. `human task "review"`.
@@ -472,36 +472,31 @@ export function formFieldVariableName(variable) {
472
472
  const m = typeof variable === 'string' ? /^vars\.([A-Za-z_$][\w$]*)$/.exec(variable) : null;
473
473
  return m ? m[1] : undefined;
474
474
  }
475
- /**
476
- * The keys of a form row the SDK cannot carry into source, each with why.
477
- * Empty when decompile → compile writes the row back as it was. The lifts
478
- * report a non-empty list as a warning (an error under `--strict`), so no key
479
- * is dropped silently.
480
- *
481
- * @example
482
- * formFieldRowLoss({ id: 'a', label: 'A', type: 'string', direction: 'output', colSpan: 13 }, 'human task')
483
- * // ['colSpan: 13 (not the platform\'s shape for it)']
484
- */
485
- export function formFieldRowLoss(row, site) {
475
+ /** A form row's keys sorted by what decompile can do with them (`formFieldRowLoss`, `formFieldRowExtra`). */
476
+ function sortRowKeys(row, site) {
486
477
  const loss = [];
487
- const id = String(row.id ?? '');
478
+ const extra = {};
488
479
  const direction = row.direction;
489
480
  const say = (key, why) => {
490
481
  loss.push(`${key}: ${JSON.stringify(row[key])} (${why})`);
491
482
  };
483
+ // A key the SDK has no option for, written back as it is (#1989).
484
+ const carry = (key) => {
485
+ extra[key] = jsonClone(row[key]);
486
+ };
492
487
  for (const key of Object.keys(row)) {
493
488
  if (row[key] === undefined)
494
489
  continue;
495
490
  if (!FORM_FIELD_ROW_KEYS.includes(key)) {
496
- say(key, 'not a key of the platform\'s field schema');
491
+ carry(key);
497
492
  }
498
493
  else if (Object.hasOwn(SETTINGS, key)) {
499
494
  if (!validSetting(key, row[key]))
500
495
  say(key, 'not the platform\'s shape for it');
501
496
  else {
502
- const extra = settingExtraKeys(key, row[key]);
503
- if (extra.length > 0)
504
- say(key, `${extra.join(', ')}: not in the platform's schema, which drops it too`);
497
+ const extraKeys = settingExtraKeys(key, row[key]);
498
+ if (extraKeys.length > 0)
499
+ say(key, `${extraKeys.join(', ')}: not in the platform's schema, which drops it too`);
505
500
  }
506
501
  }
507
502
  else if (key === 'label') {
@@ -509,33 +504,110 @@ export function formFieldRowLoss(row, site) {
509
504
  say(key, 'not a string');
510
505
  }
511
506
  else if (key === 'value') {
512
- say(key, 'the form editor\'s structured binding; a .flow stores it as `binding`, which is all the SDK reads');
507
+ // The form editor's structured binding: a .flow stores it as `binding`, which is all the SDK reads.
508
+ carry(key);
513
509
  }
514
510
  else if (key === 'required') {
515
511
  // `required: false` is the default: compile omits it, and the form behaves the same.
516
512
  if (typeof row.required !== 'boolean')
517
513
  say(key, 'not a boolean');
518
514
  else if (direction === 'input' && row.required)
519
- say(key, 'on a shown field, which the SDK does not model');
515
+ carry(key);
520
516
  }
521
517
  else if (key === 'binding') {
522
- if (site === 'escalation')
523
- say(key, 'on an escalation form, which the SDK writes without bindings');
524
- else if (direction === 'output')
525
- say(key, 'on an asked field, which the SDK writes without one');
518
+ if (site === 'escalation' || direction === 'output')
519
+ carry(key);
526
520
  else if (!isString(row.binding))
527
521
  say(key, 'not a string');
528
522
  }
529
523
  else if (key === 'variable') {
530
- if (site === 'escalation')
531
- say(key, 'on an escalation form, which the SDK writes without variables');
532
- else if (direction !== 'output')
533
- say(key, 'on a shown or pre-filled field, which the SDK writes without one');
534
- else if (formFieldVariableName(row.variable) === undefined)
535
- say(key, `not a 'vars.<name>' path, which is what the SDK writes ('vars.${id}' by default)`);
524
+ // The SDK writes `vars.<variable or id>` on an asked field and nothing elsewhere; any other spelling is carried.
525
+ if (site === 'escalation' || direction !== 'output' || formFieldVariableName(row.variable) === undefined)
526
+ carry(key);
536
527
  }
537
528
  }
538
- return loss;
529
+ return { loss, extra };
530
+ }
531
+ /**
532
+ * The keys of a form row the SDK cannot carry into source, each with why.
533
+ * Empty when decompile → compile writes the row back as it was. The lifts
534
+ * report a non-empty list as a warning (an error under `--strict`), so no key
535
+ * is dropped silently. What is left is a value the platform refuses or drops
536
+ * itself: a setting of the wrong shape, an unknown key inside `options` or
537
+ * `rules`, a label or `required` of the wrong type. Every other key the SDK
538
+ * has no option for is carried in the field's `extra` (`formFieldRowExtra`).
539
+ *
540
+ * @example
541
+ * formFieldRowLoss({ id: 'a', label: 'A', type: 'string', direction: 'output', colSpan: 13 }, 'human task')
542
+ * // ['colSpan: 13 (not the platform\'s shape for it)']
543
+ */
544
+ export function formFieldRowLoss(row, site) {
545
+ return sortRowKeys(row, site).loss;
546
+ }
547
+ /**
548
+ * The keys of a form row the SDK has no option for, which decompile lifts into
549
+ * the field's `extra` so compile writes them back as they were (#1989): a key
550
+ * the platform's field schema does not define, a `variable` other than the
551
+ * `vars.<name>` the SDK writes on an asked field, a `binding` or `variable`
552
+ * where the SDK writes none, the form editor's `value`, `required: true` on a
553
+ * shown field. Empty when there is none.
554
+ *
555
+ * @example
556
+ * formFieldRowExtra({ id: 'a', type: 'string', direction: 'output', variable: 'vars.order.note', hint: 'x' }, 'human task')
557
+ * // { variable: 'vars.order.note', hint: 'x' }
558
+ */
559
+ export function formFieldRowExtra(row, site) {
560
+ return sortRowKeys(row, site).extra;
561
+ }
562
+ /**
563
+ * The `extra` keys that would replace a row key the SDK writes from one of the
564
+ * field's typed options, in `extra`'s order. Empty when there is none.
565
+ *
566
+ * The serializers refuse a field with one (`HITL_FIELD_EXTRA_CONFLICT`,
567
+ * `FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT`): with `extra` spread last, the
568
+ * row would say one thing and the rest of the node another. For instance
569
+ * `{ id: 'amt', type: 'string', direction: 'output', extra: { type: 'number' } }`
570
+ * would write a number row while the task's outputs still say `amt: string`.
571
+ * The keys:
572
+ * - `id`, `label`, `type`, `direction` and every settings key, always;
573
+ * - `required`, when the typed `required` is set too;
574
+ * - on a human task, `variable` when the typed `variable` is set too, and
575
+ * `binding` on a shown or pre-filled field, whose `binding` the SDK writes
576
+ * from `value`.
577
+ * What decompile carries never conflicts (`formFieldRowExtra`): each key it
578
+ * lifts into `extra` is one the SDK did not write for that row.
579
+ *
580
+ * @example
581
+ * formFieldExtraConflicts({ id: 'a', direction: 'output', variable: 'v', extra: { variable: 'vars.x', hint: 1 } }, 'human task') // ['variable']
582
+ */
583
+ export function formFieldExtraConflicts(f, site) {
584
+ if (f.extra === undefined || f.extra === null || typeof f.extra !== 'object')
585
+ return [];
586
+ const always = ['id', 'label', 'type', 'direction', ...FORM_FIELD_SETTINGS_KEYS];
587
+ return Object.keys(f.extra).filter((key) => {
588
+ if (always.includes(key))
589
+ return true;
590
+ if (key === 'required')
591
+ return f.required !== undefined;
592
+ if (site !== 'human task')
593
+ return false;
594
+ if (key === 'variable')
595
+ return f.variable !== undefined;
596
+ if (key === 'binding')
597
+ return f.direction === 'input' || f.direction === 'inOut';
598
+ return false;
599
+ });
600
+ }
601
+ /**
602
+ * A field's `extra` as the form row carries it: each key copied, so the wire
603
+ * never aliases the author's objects. The serializers spread it LAST, so a key
604
+ * the SDK also writes (an asked field's `variable`) takes the `extra` value.
605
+ *
606
+ * @example
607
+ * formFieldExtraWire({ extra: { hint: 'x' } }) // { hint: 'x' }
608
+ */
609
+ export function formFieldExtraWire(f) {
610
+ return f.extra !== undefined && f.extra !== null && typeof f.extra === 'object' ? jsonClone(f.extra) : {};
539
611
  }
540
612
  /**
541
613
  * The warning (or `--strict` error) for a row `formFieldRowLoss` reported.
@@ -412,6 +412,7 @@ export declare const REFUSALS: {
412
412
  readonly HITL_EXPOSE_ERROR_VERSION: "lowering";
413
413
  readonly HITL_FAN_OUT_INTO_JOIN: "lowering";
414
414
  readonly HITL_FIELD_DIRECTION: "lint";
415
+ readonly HITL_FIELD_EXTRA_CONFLICT: "lowering";
415
416
  readonly HITL_FIELD_NO_ID: "lowering";
416
417
  readonly HITL_FIELD_NO_VALUE: "lint";
417
418
  readonly HITL_FIELD_OPTIONS: "lint";
@@ -481,6 +482,7 @@ export declare const REFUSALS: {
481
482
  readonly INLINE_AGENT_EMPTY_RETURNS: "lint";
482
483
  readonly FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: "lint";
483
484
  readonly FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: "lowering";
485
+ readonly FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT: "lowering";
484
486
  readonly FLOW_AGENT_ESCALATION_FIELD_OPTIONS: "lint";
485
487
  readonly FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: "lint";
486
488
  readonly FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: "lint";
@@ -488,6 +488,7 @@ export const REFUSALS = {
488
488
  HITL_EXPOSE_ERROR_VERSION: 'lowering',
489
489
  HITL_FAN_OUT_INTO_JOIN: 'lowering',
490
490
  HITL_FIELD_DIRECTION: 'lint',
491
+ HITL_FIELD_EXTRA_CONFLICT: 'lowering',
491
492
  HITL_FIELD_NO_ID: 'lowering',
492
493
  HITL_FIELD_NO_VALUE: 'lint',
493
494
  HITL_FIELD_OPTIONS: 'lint',
@@ -557,6 +558,7 @@ export const REFUSALS = {
557
558
  INLINE_AGENT_EMPTY_RETURNS: 'lint',
558
559
  FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: 'lint',
559
560
  FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: 'lowering',
561
+ FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT: 'lowering',
560
562
  FLOW_AGENT_ESCALATION_FIELD_OPTIONS: 'lint',
561
563
  FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: 'lint',
562
564
  FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: 'lint',
@@ -36,6 +36,7 @@ export const AGENT_DIAGNOSTICS = {
36
36
  INLINE_AGENT_EMPTY_RETURNS: { severity: 'warning', summary: 'an inline agent with returns: {}' },
37
37
  FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: { severity: 'error', summary: 'an app escalation whose app key is not a GUID' },
38
38
  FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: { severity: 'error', summary: 'an app escalation that also lists quick-form fields' },
39
+ FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT: { severity: 'error', summary: "a quick-form escalation field's extra that sets a key the SDK writes from a typed option" },
39
40
  FLOW_AGENT_ESCALATION_FIELD_OPTIONS: { severity: 'error', summary: 'a quick-form escalation field whose options are invalid' },
40
41
  FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: { severity: 'warning', summary: 'a quick-form escalation field with options its type ignores' },
41
42
  FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: { severity: 'error', summary: 'a quick-form escalation field with an invalid setting' },
@@ -17,7 +17,7 @@ import { agentInputRef, agentSidecarInputs, promptPlaceholders } from '../../../
17
17
  import { derivedContextSource, derivedEscalationSource, derivedResourceNodeId, derivedToolSource, } from '../../../core/agent-resource-identity.js';
18
18
  import { CONTEXT_INDEX_DEFAULTS, CONTEXT_INDEX_DEFAULT_FILE_EXTENSION, contextIndexSlug, parseContextIndexType, } from '../../../core/context-index.js';
19
19
  import { Expr, flatNameOf, flatNameReference } from '../../../core/expr.js';
20
- import { formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, liftFormFieldSettings, sourceFormFieldType, } from '../../../core/form-field-type.js';
20
+ import { formFieldRowExtra, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, liftFormFieldSettings, sourceFormFieldType, } from '../../../core/form-field-type.js';
21
21
  import { ownEntry } from '../../../core/own-entry.js';
22
22
  import { isInlineAgentFieldType, jsonPathKey, jsonPathSegments } from '../../../core/tool-argument.js';
23
23
  import { tsKey as key, tsLiteral, tsNumber, tsObject as objLit, tsOptions as opts, tsText } from '../../../core/ts-literal.js';
@@ -920,6 +920,7 @@ export function liftAgentResources(node, ctx, withMemory, agentInputs = []) {
920
920
  const message = formFieldRowLossMessage(`quick-form escalation ${JSON.stringify(rPlain(e, 'name') ?? e.id)} on agent ${JSON.stringify(node.id)}`, id, loss);
921
921
  ctx.lossy(message);
922
922
  }
923
+ const extra = formFieldRowExtra(f, 'escalation');
923
924
  return opts([
924
925
  ['id', tsText(f.id)],
925
926
  // serialize defaults a row's label to its id.
@@ -928,6 +929,8 @@ export function liftAgentResources(node, ctx, withMemory, agentInputs = []) {
928
929
  ['direction', tsLiteral(direction)],
929
930
  ['required', typeof f.required === 'boolean' && direction !== 'input' ? String(f.required) : undefined],
930
931
  ...formFieldSettingsSource(liftFormFieldSettings(f), dataSource),
932
+ // The row keys the SDK has no option for, written back as they are (#1989).
933
+ ['extra', Object.keys(extra).length > 0 ? dataSource(extra) : undefined],
931
934
  ]);
932
935
  }).join(', ')}]` : undefined],
933
936
  ['app', app === undefined ? undefined : opts([
@@ -2,7 +2,7 @@ import { agentInputPlan, inlineAgentJson, promptPlaceholders } from '../../../co
2
2
  import { Expr } from '../../../core/expr.js';
3
3
  import { derivedContextSource, derivedEscalationSource, derivedToolSource } from '../../../core/agent-resource-identity.js';
4
4
  import { GUID_RE } from '../../../core/binding-messages.js';
5
- import { formFieldSettingsWire, wireFormFieldType } from '../../../core/form-field-type.js';
5
+ import { formFieldExtraConflicts, formFieldExtraWire, formFieldSettingsWire, wireFormFieldType } from '../../../core/form-field-type.js';
6
6
  import { outcomeSlug } from '../../../core/hitl-routing.js';
7
7
  import { jsonClone } from '../../../core/json-clone.js';
8
8
  import { subNodeId } from '../../../core/node-id-placeholder.js';
@@ -613,6 +613,8 @@ export function attachAgentResources(s, ctx, source, who, toolVariables = new Ma
613
613
  // `defaultValue`, `colSpan`, …), as the human task's rows carry them
614
614
  // (#1235, #1250).
615
615
  ...formFieldSettingsWire(f),
616
+ // The row keys the SDK has no option for, as decompile found them (#1989).
617
+ ...formFieldExtraWire(f),
616
618
  };
617
619
  });
618
620
  const qsource = esc.source ?? derivedEscalationSource(ctx.flowId, step, esc.name);
@@ -750,6 +752,15 @@ function refuseLossyEscalation(e, step, who) {
750
752
  throw new CompileRefusal('FLOW_AGENT_ESCALATION_QUICKFORM_WITH_APP', `${who} step "${step}"'s quick-form escalation also names an app. The form lives in the flow — `
751
753
  + `drop \`app\`, or drop the variant for the app-backed escalation.`);
752
754
  }
755
+ // An `extra` key may not replace a key the SDK writes from a typed option (#1989).
756
+ for (const f of Array.isArray(esc.fields) ? esc.fields : []) {
757
+ const conflicts = formFieldExtraConflicts(f, 'escalation');
758
+ if (conflicts.length === 0)
759
+ continue;
760
+ throw new CompileRefusal('FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT', `${who} step "${step}"'s quick-form escalation field ${JSON.stringify(f.id)} sets `
761
+ + `${conflicts.map((k) => `\`${k}\``).join(', ')} in \`extra\`, which the SDK writes from the field's own options. `
762
+ + `\`extra\` carries only the row keys the SDK has no option for: set ${conflicts.length === 1 ? 'it' : 'them'} with the typed option and drop ${conflicts.length === 1 ? 'it' : 'them'} from \`extra\`.`);
763
+ }
753
764
  return;
754
765
  }
755
766
  if (esc.fields !== undefined) {
@@ -38,6 +38,7 @@ export const HITL_DIAGNOSTICS = {
38
38
  HITL_FIELD_VALUE_NOT_PATH: { severity: 'error', summary: 'a shown field filled from a lit(...) literal' },
39
39
  HITL_FIELD_DIRECTION: { severity: 'error', summary: 'a field direction that is not input, output or inOut' },
40
40
  HITL_FIELD_VARIABLE: { severity: 'error', summary: "an asked field's variable that is not one identifier, or sits on a shown field" },
41
+ HITL_FIELD_EXTRA_CONFLICT: { severity: 'error', summary: "a form field's extra that sets a key the SDK writes from a typed option" },
41
42
  HITL_NO_OUTCOMES: { severity: 'error', summary: 'no outcomes, so the task never completes' },
42
43
  HITL_OUTCOME_BAD_ID: { severity: 'error', summary: 'an outcome id that is not a non-empty string' },
43
44
  HITL_DUP_OUTCOME_ID: { severity: 'error', summary: 'two outcomes on one id' },
@@ -90,7 +91,7 @@ export function checkHitl(inputs, ctx) {
90
91
  // HITL_DOCUMENT_WITHOUT_VARIANT, DOCVAL_NO_EXTRACTION, DOCVAL_TAXONOMY_REQUIRED,
91
92
  // DOCVAL_RENDER_UNKNOWN, HITL_APP_WITHOUT_VARIANT, HITL_APP_INCOMPLETE,
92
93
  // HITL_APP_SCHEMA_INVALID, HITL_APP_OUTCOME_UNKNOWN, HITL_APP_LOCAL_HAS_FOLDER,
93
- // HITL_FIELD_NO_ID, HITL_FIELD_VARIABLE, HITL_FIELD_VALUE_NOT_REF,
94
+ // HITL_FIELD_NO_ID, HITL_FIELD_VARIABLE, HITL_FIELD_EXTRA_CONFLICT, HITL_FIELD_VALUE_NOT_REF,
94
95
  // HITL_FIELD_VALUE_NOT_PATH and HITL_OUTCOME_BAD_ID. The rules below still stop
95
96
  // where those used to, so a task they refuse gets no follow-on findings.
96
97
  const variant = inputs?.variant;
@@ -13,7 +13,7 @@
13
13
  * every edge out of an outcome-handle node to.
14
14
  */
15
15
  import { Expr, toExpr } from '../../../core/expr.js';
16
- import { formFieldJsonSchema, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, formFieldSettingsWire, formFieldVariableName, liftFormFieldSettings, sourceFormFieldType, wireFormFieldType, } from '../../../core/form-field-type.js';
16
+ import { formFieldExtraConflicts, formFieldExtraWire, formFieldJsonSchema, formFieldRowExtra, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, formFieldSettingsWire, formFieldVariableName, liftFormFieldSettings, sourceFormFieldType, wireFormFieldType, } from '../../../core/form-field-type.js';
17
17
  import { isAnswerField } from '../../../core/hitl-answers.js';
18
18
  import { OUTCOME_HANDLE_NODE_TYPES, hitlDerivesOutcomeHandles, hitlExitModel, outcomeIdOf, outcomeSlug } from '../../../core/hitl-routing.js';
19
19
  import { jsonClone } from '../../../core/json-clone.js';
@@ -97,7 +97,8 @@ function hitlInputs(inputs, nodeType, ctx) {
97
97
  // The field's settings — `controlType`, a picker's `options`,
98
98
  // `defaultValue`, `colSpan`, `rules`, … — as the canvas stores them on the
99
99
  // row, in the platform's key order (#1235, #1250).
100
- return { ...base, ...formFieldSettingsWire(f) };
100
+ // Then the row keys the SDK has no option for, as decompile found them (#1989).
101
+ return { ...base, ...formFieldSettingsWire(f), ...formFieldExtraWire(f) };
101
102
  });
102
103
  const outcomes = (inputs?.outcomes ?? []).map((o, i) => {
103
104
  const name = typeof o === 'string' ? o : o?.name;
@@ -434,6 +435,13 @@ function refuseUnwritable(inputs, typeName, step) {
434
435
  throw new CompileRefusal('HITL_FIELD_NO_ID', `Human task "${step}" has a form field with no id (fields[${i}]). The id is the key the `
435
436
  + `reviewer's answer comes back under, so a field without one is dropped.`, `id: 'amount'`);
436
437
  }
438
+ // An `extra` key may not replace a key the SDK writes from a typed option (#1989).
439
+ const conflicts = formFieldExtraConflicts(f, 'human task');
440
+ if (conflicts.length > 0) {
441
+ throw new CompileRefusal('HITL_FIELD_EXTRA_CONFLICT', `Human task "${step}"'s form field "${id}" sets ${conflicts.map((k) => `\`${k}\``).join(', ')} in \`extra\`, `
442
+ + `which the SDK writes from the field's own options. \`extra\` carries only the row keys the SDK has no option for.`, `Set ${conflicts.length === 1 ? 'it' : 'them'} with the field's own option${conflicts.length === 1 ? '' : 's'} and drop ${conflicts.length === 1 ? 'it' : 'them'} from \`extra\`, `
443
+ + `or, for a key decompile put in \`extra\`, change it there and drop the typed one.`);
444
+ }
437
445
  // Only an asked row is written with a `variable`, as `vars.<variable>`.
438
446
  const variable = f.variable;
439
447
  if (variable !== undefined) {
@@ -644,11 +652,13 @@ function liftHitl(node, typeName, ctx) {
644
652
  // reports any other spelling.
645
653
  const landing = direction === 'output' ? formFieldVariableName(f.variable) : undefined;
646
654
  const variable = landing !== undefined && landing !== id ? landing : undefined;
647
- // Every row key the source cannot carry is reported, never dropped
648
- // silently: a warning, an error under --strict (#1250).
655
+ // A row key the SDK has no option for rides in `extra` (#1989); one it
656
+ // cannot write back at all is reported, never dropped silently: a
657
+ // warning, an error under --strict (#1250).
649
658
  const loss = formFieldRowLoss(f, 'human task');
650
659
  if (loss.length > 0)
651
660
  ctx.lossy(formFieldRowLossMessage(`human task ${JSON.stringify(n.id)}`, id, loss));
661
+ const extra = formFieldRowExtra(f, 'human task');
652
662
  return {
653
663
  id,
654
664
  // serialize defaults a row's label to its id.
@@ -661,6 +671,7 @@ function liftHitl(node, typeName, ctx) {
661
671
  ...(typeof f.required === 'boolean' && direction !== 'input' ? { required: f.required } : {}),
662
672
  ...(variable !== undefined ? { variable } : {}),
663
673
  ...liftFormFieldSettings(f),
674
+ ...(Object.keys(extra).length > 0 ? { extra } : {}),
664
675
  };
665
676
  });
666
677
  const outcomeRows = (Array.isArray(schema.outcomes) ? schema.outcomes : []);
@@ -837,6 +848,7 @@ function printHitl({ inputs }, ctx) {
837
848
  ['required', f.required !== undefined ? String(f.required) : undefined],
838
849
  ['variable', f.variable !== undefined ? ctx.string(f.variable) : undefined],
839
850
  ...formFieldSettingsSource(f, ctx.value),
851
+ ['extra', f.extra !== undefined ? ctx.value(f.extra) : undefined],
840
852
  ], ctx));
841
853
  const outcomes = h.outcomes.map((o) => (typeof o === 'string' ? ctx.string(o) : obj([
842
854
  ['name', ctx.string(o.name)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.104.0",
3
+ "version": "6.104.1",
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",
@@ -121,5 +121,5 @@
121
121
  "@types/node": "^22.7.0",
122
122
  "esbuild": "^0.28.1"
123
123
  },
124
- "gitref": "c14960c0ecf77fc1f041006b84a3d96c887163e3"
124
+ "gitref": "f09831fd9c245f1fc9615d848e9ca87eb7a3dca5"
125
125
  }