@uipath/maestro-builder-sdk 6.104.0 → 6.105.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 +50 -49
- package/dist/api-members.md +158 -157
- package/dist/check.js +3 -2
- package/dist/core/actions.d.ts +23 -3
- package/dist/core/form-field-type.d.ts +55 -1
- package/dist/core/form-field-type.js +101 -29
- package/dist/core/refusals.d.ts +3 -0
- package/dist/core/refusals.js +3 -0
- package/dist/flow-node-type.d.ts +2 -0
- package/dist/nodes/agent/flow/check.js +1 -0
- package/dist/nodes/agent/flow/inline-agent-lift.js +4 -1
- package/dist/nodes/agent/flow/inline-agent.js +12 -1
- package/dist/nodes/data-fabric/flow/check.d.ts +14 -0
- package/dist/nodes/data-fabric/flow/check.js +65 -0
- package/dist/nodes/data-fabric/flow/family.js +5 -2
- package/dist/nodes/hitl/flow/check.js +2 -1
- package/dist/nodes/hitl/flow/node-type.js +16 -4
- package/package.json +2 -2
package/dist/check.js
CHANGED
|
@@ -798,7 +798,7 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
reportUnreachableHitlOutcomes(hitlChoiceNoPorts, exprs, diags);
|
|
801
|
-
checkRegisteredFamilies(registeredSteps, unresolvedSteps, stepNames, diags);
|
|
801
|
+
checkRegisteredFamilies(registeredSteps, unresolvedSteps, stepNames, diags, opts);
|
|
802
802
|
checkPackageNodes(registeredSteps, diags);
|
|
803
803
|
// Entry points: valid triggers. An id that collides with a step, the trigger
|
|
804
804
|
// or another entry point (or is `start` while `.triggerId()` renames the
|
|
@@ -2547,7 +2547,7 @@ function checkPackageNodes(steps, diags) {
|
|
|
2547
2547
|
});
|
|
2548
2548
|
}
|
|
2549
2549
|
/** Run each registered family's own rules over all of its placements in this flow. */
|
|
2550
|
-
function checkRegisteredFamilies(steps, unresolved, stepNames, diags) {
|
|
2550
|
+
function checkRegisteredFamilies(steps, unresolved, stepNames, diags, opts) {
|
|
2551
2551
|
const byFamily = new Map();
|
|
2552
2552
|
for (const placed of steps.values()) {
|
|
2553
2553
|
const list = byFamily.get(placed.entry.family.id) ?? [];
|
|
@@ -2563,6 +2563,7 @@ function checkRegisteredFamilies(steps, unresolved, stepNames, diags) {
|
|
|
2563
2563
|
hasStep: (step) => stepNames.has(step),
|
|
2564
2564
|
placementOf: (step) => steps.get(step)?.placement,
|
|
2565
2565
|
versionUnresolved: (step) => unresolved.has(step),
|
|
2566
|
+
options: opts,
|
|
2566
2567
|
};
|
|
2567
2568
|
family.check(placed.map((p) => p.placement), ctx);
|
|
2568
2569
|
}
|
package/dist/core/actions.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
503
|
-
if (
|
|
504
|
-
say(key, `${
|
|
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
|
-
|
|
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
|
-
|
|
515
|
+
carry(key);
|
|
520
516
|
}
|
|
521
517
|
else if (key === 'binding') {
|
|
522
|
-
if (site === 'escalation')
|
|
523
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
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.
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -269,6 +269,7 @@ export declare const REFUSALS: {
|
|
|
269
269
|
readonly DATAFABRIC_FROMREAD_UNKNOWN: "lint";
|
|
270
270
|
readonly DATAFABRIC_IN_REQUIRES_MULTIPLE: "lint";
|
|
271
271
|
readonly DATAFABRIC_LIMIT_RANGE: "lint";
|
|
272
|
+
readonly DATAFABRIC_LONG_TEXT_PREVIEW: "lint";
|
|
272
273
|
readonly DATAFABRIC_NO_ENTITY: "lint";
|
|
273
274
|
readonly DATAFABRIC_NULL_REQUIRED: "lint";
|
|
274
275
|
readonly DATAFABRIC_QUERY_OPTS_WITHOUT_MULTIPLE: "lint";
|
|
@@ -412,6 +413,7 @@ export declare const REFUSALS: {
|
|
|
412
413
|
readonly HITL_EXPOSE_ERROR_VERSION: "lowering";
|
|
413
414
|
readonly HITL_FAN_OUT_INTO_JOIN: "lowering";
|
|
414
415
|
readonly HITL_FIELD_DIRECTION: "lint";
|
|
416
|
+
readonly HITL_FIELD_EXTRA_CONFLICT: "lowering";
|
|
415
417
|
readonly HITL_FIELD_NO_ID: "lowering";
|
|
416
418
|
readonly HITL_FIELD_NO_VALUE: "lint";
|
|
417
419
|
readonly HITL_FIELD_OPTIONS: "lint";
|
|
@@ -481,6 +483,7 @@ export declare const REFUSALS: {
|
|
|
481
483
|
readonly INLINE_AGENT_EMPTY_RETURNS: "lint";
|
|
482
484
|
readonly FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: "lint";
|
|
483
485
|
readonly FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: "lowering";
|
|
486
|
+
readonly FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT: "lowering";
|
|
484
487
|
readonly FLOW_AGENT_ESCALATION_FIELD_OPTIONS: "lint";
|
|
485
488
|
readonly FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: "lint";
|
|
486
489
|
readonly FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: "lint";
|
package/dist/core/refusals.js
CHANGED
|
@@ -343,6 +343,7 @@ export const REFUSALS = {
|
|
|
343
343
|
DATAFABRIC_FROMREAD_UNKNOWN: 'lint',
|
|
344
344
|
DATAFABRIC_IN_REQUIRES_MULTIPLE: 'lint',
|
|
345
345
|
DATAFABRIC_LIMIT_RANGE: 'lint',
|
|
346
|
+
DATAFABRIC_LONG_TEXT_PREVIEW: 'lint',
|
|
346
347
|
DATAFABRIC_NO_ENTITY: 'lint',
|
|
347
348
|
DATAFABRIC_NULL_REQUIRED: 'lint',
|
|
348
349
|
DATAFABRIC_QUERY_OPTS_WITHOUT_MULTIPLE: 'lint',
|
|
@@ -488,6 +489,7 @@ export const REFUSALS = {
|
|
|
488
489
|
HITL_EXPOSE_ERROR_VERSION: 'lowering',
|
|
489
490
|
HITL_FAN_OUT_INTO_JOIN: 'lowering',
|
|
490
491
|
HITL_FIELD_DIRECTION: 'lint',
|
|
492
|
+
HITL_FIELD_EXTRA_CONFLICT: 'lowering',
|
|
491
493
|
HITL_FIELD_NO_ID: 'lowering',
|
|
492
494
|
HITL_FIELD_NO_VALUE: 'lint',
|
|
493
495
|
HITL_FIELD_OPTIONS: 'lint',
|
|
@@ -557,6 +559,7 @@ export const REFUSALS = {
|
|
|
557
559
|
INLINE_AGENT_EMPTY_RETURNS: 'lint',
|
|
558
560
|
FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: 'lint',
|
|
559
561
|
FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: 'lowering',
|
|
562
|
+
FLOW_AGENT_ESCALATION_FIELD_EXTRA_CONFLICT: 'lowering',
|
|
560
563
|
FLOW_AGENT_ESCALATION_FIELD_OPTIONS: 'lint',
|
|
561
564
|
FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: 'lint',
|
|
562
565
|
FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: 'lint',
|
package/dist/flow-node-type.d.ts
CHANGED
|
@@ -517,6 +517,8 @@ export interface FlowFamilyCheckContext {
|
|
|
517
517
|
* reports it, so a rule about it should stay silent rather than say it is missing.
|
|
518
518
|
*/
|
|
519
519
|
versionUnresolved(step: string): boolean;
|
|
520
|
+
/** The options `check` was called with (the resource ledger among them). */
|
|
521
|
+
readonly options: CheckOpts;
|
|
520
522
|
}
|
|
521
523
|
export interface FlowContexts extends ArtifactContexts {
|
|
522
524
|
serialize: FlowSerializeContext;
|
|
@@ -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) {
|
|
@@ -11,3 +11,17 @@ export declare function checkWrite(inputs: DataFabricDeleteInputs, ctx: FlowChec
|
|
|
11
11
|
* selector, so they share the check: the step must be a read, and not a list.
|
|
12
12
|
*/
|
|
13
13
|
export declare function checkFromRead(placements: readonly Placement[], ctx: FlowFamilyCheckContext): void;
|
|
14
|
+
/**
|
|
15
|
+
* DATAFABRIC_LONG_TEXT_PREVIEW: a write whose value is a long-text column read
|
|
16
|
+
* from a native Data Fabric step.
|
|
17
|
+
*
|
|
18
|
+
* Every native path that publishes a record — a read (one or many, `Id` filter
|
|
19
|
+
* included) and a create's own output — is a Data Service QUERY, and a query
|
|
20
|
+
* returns a long-text value as its first 10,000 characters plus
|
|
21
|
+
* `...[Truncated]`, with no flag (#954: 15,551 characters written, 10,014 read
|
|
22
|
+
* back). Writing that value into a create or an update stores the cut text over
|
|
23
|
+
* the whole one, and the run passes. Only the column's type says it can happen,
|
|
24
|
+
* so the rule needs the schema `prepare --entity` records for the SOURCE step's
|
|
25
|
+
* entity (#1980). A warning: a value that is in fact short is written whole.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkLongTextWriteback(placements: readonly Placement[], ctx: FlowFamilyCheckContext): void;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { entityPrepareCommand, } from '../../../core/resource-resolution.js';
|
|
8
8
|
import { Expr } from '../../../core/expr.js';
|
|
9
9
|
import { nearestName } from '../../../core/edit-distance.js';
|
|
10
|
+
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
10
11
|
import { entityField, recordedEntitySchema, } from '../../../core/entity-schema.js';
|
|
11
12
|
export const DATA_FABRIC_DIAGNOSTICS = {
|
|
12
13
|
DATAFABRIC_NO_ENTITY: { severity: 'error', summary: 'a verb names no entity' },
|
|
@@ -28,6 +29,7 @@ export const DATA_FABRIC_DIAGNOSTICS = {
|
|
|
28
29
|
DATAFABRIC_CHOICE_WRITE_VALUE: { severity: 'warning', summary: "a choice-set write literal that is not one of the set's numberIds" },
|
|
29
30
|
DATAFABRIC_NULL_REQUIRED: { severity: 'error', summary: 'an update that blanks a non-nullable column' },
|
|
30
31
|
DATAFABRIC_REQUIRED_MISSING: { severity: 'error', summary: 'a create that leaves a mandatory column out' },
|
|
32
|
+
DATAFABRIC_LONG_TEXT_PREVIEW: { severity: 'warning', summary: 'a long-text value read from a Data Fabric step written back' },
|
|
31
33
|
};
|
|
32
34
|
function checkEntity(inputs, ctx) {
|
|
33
35
|
// An object is `{ name, folder }`, whose shape the serializer judges
|
|
@@ -385,3 +387,66 @@ function checkValue(field, value, where, operator, schema, ctx) {
|
|
|
385
387
|
: 'Data Fabric rejects the value and the engine only logs the rejection, so the write runs green without it.')
|
|
386
388
|
+ provenance(schema), `a literal like ${shape.example}, or an expression that produces one`);
|
|
387
389
|
}
|
|
390
|
+
// ─── Long text written back (#954) ─────────────────────────────────────────────
|
|
391
|
+
/** The length a Data Service query cuts a long-text value to, before it appends `...[Truncated]`. */
|
|
392
|
+
const PREVIEW_LENGTH = 10_000;
|
|
393
|
+
/**
|
|
394
|
+
* A long-text column whose value can be longer than the query preview:
|
|
395
|
+
* `MULTILINE_TEXT` above 10,000 characters, or `MULTILINE_MAX`.
|
|
396
|
+
*/
|
|
397
|
+
function previewedColumn(field) {
|
|
398
|
+
return field.type.startsWith('MULTILINE') && (field.lengthLimit === undefined || field.lengthLimit > PREVIEW_LENGTH);
|
|
399
|
+
}
|
|
400
|
+
/** `$vars.<step>.output.<field>`, `.output[0].<field>` and `.output.results[i].<field>`, as `[step, field]`. */
|
|
401
|
+
const OUTPUT_FIELD = /\$vars\.([A-Za-z_$][\w$]*)\.output(?:\.results)?(?:\[[^\]]*\])?\.([A-Za-z_$][\w$]*)/g;
|
|
402
|
+
/**
|
|
403
|
+
* DATAFABRIC_LONG_TEXT_PREVIEW: a write whose value is a long-text column read
|
|
404
|
+
* from a native Data Fabric step.
|
|
405
|
+
*
|
|
406
|
+
* Every native path that publishes a record — a read (one or many, `Id` filter
|
|
407
|
+
* included) and a create's own output — is a Data Service QUERY, and a query
|
|
408
|
+
* returns a long-text value as its first 10,000 characters plus
|
|
409
|
+
* `...[Truncated]`, with no flag (#954: 15,551 characters written, 10,014 read
|
|
410
|
+
* back). Writing that value into a create or an update stores the cut text over
|
|
411
|
+
* the whole one, and the run passes. Only the column's type says it can happen,
|
|
412
|
+
* so the rule needs the schema `prepare --entity` records for the SOURCE step's
|
|
413
|
+
* entity (#1980). A warning: a value that is in fact short is written whole.
|
|
414
|
+
*/
|
|
415
|
+
export function checkLongTextWriteback(placements, ctx) {
|
|
416
|
+
for (const p of placements) {
|
|
417
|
+
if (p.kind !== 'dataFabricUpdate' && p.kind !== 'dataFabricCreate')
|
|
418
|
+
continue;
|
|
419
|
+
const inputs = p.spec.inputs;
|
|
420
|
+
const option = p.kind === 'dataFabricUpdate' ? 'set' : 'values';
|
|
421
|
+
const values = (p.kind === 'dataFabricUpdate' ? inputs?.set : inputs?.values) ?? {};
|
|
422
|
+
for (const [column, value] of Object.entries(values)) {
|
|
423
|
+
if (!(value instanceof Expr))
|
|
424
|
+
continue;
|
|
425
|
+
for (const [, source, name] of value.js.matchAll(OUTPUT_FIELD)) {
|
|
426
|
+
const from = ctx.placementOf(source);
|
|
427
|
+
if (from?.kind !== 'dataFabricRead' && from?.kind !== 'dataFabricCreate')
|
|
428
|
+
continue;
|
|
429
|
+
const fromInputs = from.spec.inputs;
|
|
430
|
+
if (fromInputs?.entity === undefined)
|
|
431
|
+
continue;
|
|
432
|
+
const schema = recordedEntitySchema(ctx.options.resources, {
|
|
433
|
+
entity: fromInputs.entity, ...(fromInputs.folderKey !== undefined ? { folderKey: fromInputs.folderKey } : {}),
|
|
434
|
+
});
|
|
435
|
+
const field = schema && entityField(schema.fields, name);
|
|
436
|
+
if (field === undefined || !previewedColumn(field))
|
|
437
|
+
continue;
|
|
438
|
+
const entity = String(fromInputs.entity.name ?? fromInputs.entity);
|
|
439
|
+
ctx.report(p.step, 'DATAFABRIC_LONG_TEXT_PREVIEW', `"${p.step}" writes { ${option} } ${JSON.stringify(column)} from "${source}"'s ${JSON.stringify(name)}, a long-text `
|
|
440
|
+
+ `(${field.type}${field.lengthLimit !== undefined ? `, up to ${field.lengthLimit} characters` : ''}) column of entity ${JSON.stringify(entity)}. `
|
|
441
|
+
+ `A native Data Fabric ${from.kind === 'dataFabricRead' ? 'read' : 'create'} publishes the record as a query returns it, `
|
|
442
|
+
+ `which cuts a long-text value to its first ${PREVIEW_LENGTH.toLocaleString('en-US')} characters and appends "...[Truncated]", with no flag — `
|
|
443
|
+
+ 'so a longer value is written back cut, and the run passes.', from.kind === 'dataFabricCreate'
|
|
444
|
+
? `write the value "${source}" was given instead of its output`
|
|
445
|
+
// The operation is not in the shipped library and its fields depend
|
|
446
|
+
// on `entityName`, so the connector call needs its prepare first.
|
|
447
|
+
: `read the record whole: run ${prepareCommand('uipath-uipath-dataservice', 'get-entity-record-by-id', '-f', `entityName=${entity}`)}, `
|
|
448
|
+
+ `then connector('uipath-uipath-dataservice', 'get-entity-record-by-id', { entityName: '${entity}', recordId: … }, BIND), and write from that step`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { checkFromRead, DATA_FABRIC_DIAGNOSTICS } from './check.js';
|
|
1
|
+
import { checkFromRead, checkLongTextWriteback, DATA_FABRIC_DIAGNOSTICS } from './check.js';
|
|
2
2
|
import { dataFabricCreate, dataFabricDelete, dataFabricRead, dataFabricUpdate } from './verbs.js';
|
|
3
3
|
export const dataFabricFlowFamily = {
|
|
4
4
|
id: 'data-fabric',
|
|
5
5
|
title: 'Data Fabric',
|
|
6
6
|
types: [dataFabricRead, dataFabricCreate, dataFabricUpdate, dataFabricDelete],
|
|
7
7
|
diagnostics: DATA_FABRIC_DIAGNOSTICS,
|
|
8
|
-
check:
|
|
8
|
+
check: (placements, ctx) => {
|
|
9
|
+
checkFromRead(placements, ctx);
|
|
10
|
+
checkLongTextWriteback(placements, ctx);
|
|
11
|
+
},
|
|
9
12
|
};
|
|
@@ -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;
|