@uipath/maestro-builder-sdk 6.101.0 → 6.102.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 +14 -14
- package/dist/api-members.md +16 -16
- package/dist/core/actions.d.ts +6 -0
- package/dist/core/actions.js +7 -0
- package/dist/core/binding-messages.d.ts +33 -1
- package/dist/core/binding-messages.js +51 -0
- package/dist/core/connector-option-keys.d.ts +4 -0
- package/dist/core/connector-option-keys.js +9 -0
- package/dist/core/event-subscription.d.ts +8 -0
- package/dist/core/event-subscription.js +2 -4
- package/dist/core/nodes/node-type.d.ts +25 -0
- package/dist/core/nodes/versioned.d.ts +3 -1
- package/dist/core/nodes/versioned.js +1 -0
- package/dist/core/option-keys.d.ts +62 -0
- package/dist/core/option-keys.js +66 -0
- package/dist/core/refusals.d.ts +3 -0
- package/dist/core/refusals.js +5 -0
- package/dist/flow-node-type.d.ts +31 -1
- package/dist/flow-option-keys.d.ts +22 -0
- package/dist/flow-option-keys.js +33 -0
- package/dist/flow-sdk.js +5 -9
- package/dist/nodes/agent/flow/inline-agent.js +2 -4
- package/dist/nodes/agent/flow/node-type.js +12 -0
- package/dist/nodes/ai-patterns/flow/node-type.js +6 -0
- package/dist/nodes/connector/flow/event-trigger.js +4 -2
- package/dist/nodes/connector/flow/event-wait.js +4 -2
- package/dist/nodes/connector/flow/node-type.js +5 -4
- package/dist/nodes/connector/flow/raw-node.js +1 -1
- package/dist/nodes/conversation/flow/node-type.js +9 -0
- package/dist/nodes/data-fabric/flow/verbs.js +10 -0
- package/dist/nodes/delay/flow/node-type.js +4 -0
- package/dist/nodes/document/flow/ixp.js +4 -0
- package/dist/nodes/document/flow/node-type.js +6 -0
- package/dist/nodes/hitl/flow/node-type.js +4 -0
- package/dist/nodes/http/flow/check.js +55 -0
- package/dist/nodes/http/flow/node-type.js +7 -4
- package/dist/nodes/process/flow/node-type.js +10 -0
- package/dist/nodes/queue/flow/node-type.js +4 -0
- package/dist/nodes/script/flow/node-type.js +4 -0
- package/dist/nodes/transform/flow/node-type.js +4 -0
- package/dist/nodes/trigger/flow/node-type.js +6 -0
- package/dist/serialize.js +73 -1
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Option keys: the keys an author may put in a builder's option object, and the
|
|
3
|
+
* refusal for any other key (builder-sdk#1990).
|
|
4
|
+
*
|
|
5
|
+
* Why it exists: an authored `.flow.ts` runs with its types erased
|
|
6
|
+
* (`--experimental-strip-types`), so TypeScript's own "Object literal may only
|
|
7
|
+
* specify known properties" never fires. Without this, a key the SDK does not
|
|
8
|
+
* know was dropped with no word: `http({ url, managed: true, retryCont: 2 })`
|
|
9
|
+
* compiled with no retry, and an option a NEWER SDK added (`inlineAgent({ tools })`
|
|
10
|
+
* on an SDK that predates `tools`) compiled the node without the feature.
|
|
11
|
+
*
|
|
12
|
+
* Two halves:
|
|
13
|
+
*
|
|
14
|
+
* - {@link declareKeys} turns an object literal into the key list. Its parameter
|
|
15
|
+
* type requires EVERY key of the option type and admits NO other, so the list
|
|
16
|
+
* cannot drift from the type: adding `retryDelay?: string` to `HttpInputs`
|
|
17
|
+
* and not to the list is a `tsc` error in `npm run build`.
|
|
18
|
+
* - {@link unknownOptionRefusal} compares one option object with its list and
|
|
19
|
+
* returns the `FLOW_UNKNOWN_OPTION` refusal, with the nearest known key as
|
|
20
|
+
* the suggestion.
|
|
21
|
+
*
|
|
22
|
+
* The refusal is class `lowering` (core/refusals.ts): the serializer would drop
|
|
23
|
+
* the key, so `compile` must not write the file without it
|
|
24
|
+
* (docs/CHECK_COMPILE_CONTRACT_DESIGN.md §3.1), and `check` reports it through
|
|
25
|
+
* the serializer's collect mode, on the step that carries it.
|
|
26
|
+
*/
|
|
27
|
+
import { CompileRefusal } from './compile-refusal.js';
|
|
28
|
+
import { nearestName } from './edit-distance.js';
|
|
29
|
+
import { PACKAGE_NAME } from '../package-name.js';
|
|
30
|
+
/**
|
|
31
|
+
* The option keys of `T`, as a list, checked against `T` by `tsc` (see
|
|
32
|
+
* {@link OptionKeySet}). Declare a family's list with it, never by hand.
|
|
33
|
+
*/
|
|
34
|
+
export function declareKeys(keys) {
|
|
35
|
+
return Object.freeze(Object.keys(keys));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The FLOW_UNKNOWN_OPTION refusal for the first key of `bag` that is not in
|
|
39
|
+
* `known`, or `undefined` when every key is known. A key whose value is
|
|
40
|
+
* `undefined` is skipped: it sets nothing, so nothing is dropped. Anything that
|
|
41
|
+
* is not a plain object (an array, an `Expr`, a missing bag) is not judged here.
|
|
42
|
+
*
|
|
43
|
+
* `call` names the option object as the author wrote it, e.g. `http()` or
|
|
44
|
+
* `.loop() options`; `where` places it, e.g. `step "fetch"`.
|
|
45
|
+
*
|
|
46
|
+
* For instance `unknownOptionRefusal({ url: 'x', retryCont: 2 }, HTTP_KEYS, 'http()', 'step "fetch"')`
|
|
47
|
+
* reads `step "fetch": http() has no option "retryCont". This SDK knows: …`, with the
|
|
48
|
+
* suggestion `retryCount` (the CLI prints it as `(did you mean "retryCount"?)`).
|
|
49
|
+
*/
|
|
50
|
+
export function unknownOptionRefusal(bag, known, call, where) {
|
|
51
|
+
if (bag === null || typeof bag !== 'object' || Array.isArray(bag))
|
|
52
|
+
return undefined;
|
|
53
|
+
const proto = Object.getPrototypeOf(bag);
|
|
54
|
+
if (proto !== Object.prototype && proto !== null)
|
|
55
|
+
return undefined;
|
|
56
|
+
const unknown = Object.keys(bag).filter((k) => !known.includes(k) && bag[k] !== undefined);
|
|
57
|
+
if (unknown.length === 0)
|
|
58
|
+
return undefined;
|
|
59
|
+
const key = unknown[0];
|
|
60
|
+
const nearest = nearestName(key, [...known]);
|
|
61
|
+
const others = unknown.length > 1 ? ` (and ${unknown.slice(1).map((k) => `"${k}"`).join(', ')})` : '';
|
|
62
|
+
return new CompileRefusal('FLOW_UNKNOWN_OPTION', `${where}: ${call} has no option "${key}"${others}.`
|
|
63
|
+
+ ` This SDK knows: ${known.length > 0 ? known.join(', ') : '(none)'}. An unknown option would be dropped `
|
|
64
|
+
+ 'from the compiled flow, so it is refused: fix the spelling, remove it, or, if a newer SDK added it, '
|
|
65
|
+
+ `upgrade ${PACKAGE_NAME}.`, nearest);
|
|
66
|
+
}
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export declare const REFUSALS: {
|
|
|
57
57
|
readonly ARM_SCOPED_OUTPUT_READ: "lint";
|
|
58
58
|
readonly ASSIGNMENT_NOT_ALLOWED: "lint";
|
|
59
59
|
readonly BAD_DEFAULT: "lint";
|
|
60
|
+
readonly BINDING_CONNECTION_IS_FOLDER: "draft";
|
|
60
61
|
readonly BINDING_CONNECTION_TWO_FOLDERS: "lowering";
|
|
61
62
|
readonly BINDING_MISSING: "draft";
|
|
62
63
|
readonly BINDING_PLACEHOLDER_UNRESOLVED: "draft";
|
|
@@ -360,6 +361,7 @@ export declare const REFUSALS: {
|
|
|
360
361
|
readonly FLOW_OUT_OF_END: "lint";
|
|
361
362
|
readonly FLOW_PROCESS_EMPTY_DATA: "lint";
|
|
362
363
|
readonly FLOW_SOURCE_NOT_FOUND: "lowering";
|
|
364
|
+
readonly FLOW_UNKNOWN_OPTION: "lowering";
|
|
363
365
|
readonly FOLDER_BINDING_KEYED_BY_FOLDER: "lint";
|
|
364
366
|
readonly FOLDER_BINDING_UNPAIRED: "lint";
|
|
365
367
|
readonly FORM_TRIGGER_NO_INPUTS: "lint";
|
|
@@ -447,6 +449,7 @@ export declare const REFUSALS: {
|
|
|
447
449
|
readonly HTTP_BRANCH_UNKNOWN: "lint";
|
|
448
450
|
readonly HTTP_MANAGED_BINDING_INCOMPLETE: "lowering";
|
|
449
451
|
readonly HTTP_MANAGED_REQUIRED: "lowering";
|
|
452
|
+
readonly HTTP_LITERAL_SECRET_HEADER: "lint";
|
|
450
453
|
readonly HTTP_MANUAL_V1: "lint";
|
|
451
454
|
readonly HTTP_ONERROR_V1: "lint";
|
|
452
455
|
readonly HTTP_READ_NOT_OUTPUT: "lint";
|
package/dist/core/refusals.js
CHANGED
|
@@ -106,6 +106,7 @@ export const REFUSALS = {
|
|
|
106
106
|
ARM_SCOPED_OUTPUT_READ: 'lint',
|
|
107
107
|
ASSIGNMENT_NOT_ALLOWED: 'lint',
|
|
108
108
|
BAD_DEFAULT: 'lint',
|
|
109
|
+
BINDING_CONNECTION_IS_FOLDER: 'draft',
|
|
109
110
|
BINDING_CONNECTION_TWO_FOLDERS: 'lowering',
|
|
110
111
|
BINDING_MISSING: 'draft',
|
|
111
112
|
BINDING_PLACEHOLDER_UNRESOLVED: 'draft',
|
|
@@ -434,6 +435,9 @@ export const REFUSALS = {
|
|
|
434
435
|
FLOW_OUT_OF_END: 'lint',
|
|
435
436
|
FLOW_PROCESS_EMPTY_DATA: 'lint',
|
|
436
437
|
FLOW_SOURCE_NOT_FOUND: 'lowering',
|
|
438
|
+
// A builder option key the SDK does not know (builder-sdk#1990): the
|
|
439
|
+
// serializer would drop it, so it is refused (core/option-keys.ts).
|
|
440
|
+
FLOW_UNKNOWN_OPTION: 'lowering',
|
|
437
441
|
FOLDER_BINDING_KEYED_BY_FOLDER: 'lint',
|
|
438
442
|
FOLDER_BINDING_UNPAIRED: 'lint',
|
|
439
443
|
FORM_TRIGGER_NO_INPUTS: 'lint',
|
|
@@ -521,6 +525,7 @@ export const REFUSALS = {
|
|
|
521
525
|
HTTP_BRANCH_UNKNOWN: 'lint',
|
|
522
526
|
HTTP_MANAGED_BINDING_INCOMPLETE: 'lowering',
|
|
523
527
|
HTTP_MANAGED_REQUIRED: 'lowering',
|
|
528
|
+
HTTP_LITERAL_SECRET_HEADER: 'lint',
|
|
524
529
|
HTTP_MANUAL_V1: 'lint',
|
|
525
530
|
HTTP_ONERROR_V1: 'lint',
|
|
526
531
|
HTTP_READ_NOT_OUTPUT: 'lint',
|
package/dist/flow-node-type.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* each context below is the whole of what a node type can see.
|
|
11
11
|
*/
|
|
12
12
|
import type { ResourceResolutions } from './core/resource-resolution.js';
|
|
13
|
-
import type { ArtifactContexts, FactoryCall, NodeType } from './core/nodes/node-type.js';
|
|
13
|
+
import type { ArtifactContexts, FactoryCall, NodeType, OptionKeyLists } from './core/nodes/node-type.js';
|
|
14
14
|
import type { VersionedNodeType } from './core/nodes/versioned.js';
|
|
15
15
|
import type { DiagnosticCatalog, NodeFamily, Placement } from './core/nodes/family.js';
|
|
16
16
|
import type { DefinitionReference, NodeContribution } from './core/node-classes.js';
|
|
@@ -187,6 +187,23 @@ export interface FlowSerializeContext {
|
|
|
187
187
|
key: string;
|
|
188
188
|
action?: string;
|
|
189
189
|
}): string | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Both halves of a node's `{ connection, folder }` pair, each resolved as
|
|
192
|
+
* {@link resolveBinding} does, and then the pair itself judged: one label for
|
|
193
|
+
* both, or two labels that resolve to one real key, throws
|
|
194
|
+
* `BINDING_CONNECTION_IS_FOLDER` (#1968). Resolve a pair through here rather
|
|
195
|
+
* than two `resolveBinding` calls, so no site can skip that rule.
|
|
196
|
+
*/
|
|
197
|
+
resolveBindingPair(labels: {
|
|
198
|
+
connection?: string;
|
|
199
|
+
folder?: string;
|
|
200
|
+
}, where: string, target?: {
|
|
201
|
+
key: string;
|
|
202
|
+
action?: string;
|
|
203
|
+
}): {
|
|
204
|
+
connectionId: string | undefined;
|
|
205
|
+
folderKey: string | undefined;
|
|
206
|
+
};
|
|
190
207
|
/**
|
|
191
208
|
* Hoist the Integration Service connection pair a definition's `model`
|
|
192
209
|
* references (`<bindings.NAME>` for its connection id and folder key), deduped
|
|
@@ -709,6 +726,17 @@ export interface FlowTriggerSerializeContext {
|
|
|
709
726
|
key: string;
|
|
710
727
|
action?: string;
|
|
711
728
|
}): string | undefined;
|
|
729
|
+
/** A node's connection and folder labels resolved as a pair, as `FlowSerializeContext.resolveBindingPair`. */
|
|
730
|
+
resolveBindingPair(labels: {
|
|
731
|
+
connection?: string;
|
|
732
|
+
folder?: string;
|
|
733
|
+
}, where: string, target?: {
|
|
734
|
+
key: string;
|
|
735
|
+
action?: string;
|
|
736
|
+
}): {
|
|
737
|
+
connectionId: string | undefined;
|
|
738
|
+
folderKey: string | undefined;
|
|
739
|
+
};
|
|
712
740
|
/** Hoist the connection pair a definition's `model` references, as `FlowSerializeContext.bindConnection`. */
|
|
713
741
|
bindConnection(o: {
|
|
714
742
|
model: unknown;
|
|
@@ -776,6 +804,8 @@ export interface FlowTriggerType<Spec> {
|
|
|
776
804
|
/** The factory call an author writes; `.trigger()`'s `{ version, label }` are the pipeline's. */
|
|
777
805
|
print(spec: Spec, ctx: FlowPrintContext): FactoryCall;
|
|
778
806
|
check?(spec: Spec, ctx: FlowTriggerCheckContext): void;
|
|
807
|
+
/** As a step's `optionKeys` (core/nodes/node-type.ts): for instance `scheduled()`'s `inputs`, `conversationTrigger()`'s `appearance`. */
|
|
808
|
+
readonly optionKeys?: OptionKeyLists<Spec>;
|
|
779
809
|
}
|
|
780
810
|
/** A family's start triggers, registered apart from its steps (FLOW_TRIGGER_TYPES). */
|
|
781
811
|
export interface FlowTriggerFamily {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Step } from './flow-sdk.js';
|
|
2
|
+
/** Every `Step` kind that carries an `options` object. */
|
|
3
|
+
type KindWithOptions = {
|
|
4
|
+
[K in Step['kind']]: 'options' extends keyof Extract<Step, {
|
|
5
|
+
kind: K;
|
|
6
|
+
}> ? K : never;
|
|
7
|
+
}[Step['kind']];
|
|
8
|
+
/** One builder method's options: how a message names it, and its keys. */
|
|
9
|
+
export interface StepOptionKeys {
|
|
10
|
+
/** The method as the author calls it, e.g. `.loop()`. */
|
|
11
|
+
readonly call: string;
|
|
12
|
+
readonly keys: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/** The option keys of each builder method, by the kind of step it makes. */
|
|
15
|
+
export declare const STEP_OPTION_KEYS: {
|
|
16
|
+
readonly [K in KindWithOptions]: StepOptionKeys;
|
|
17
|
+
};
|
|
18
|
+
/** The option keys of `.trigger(spec, options)`. */
|
|
19
|
+
export declare const TRIGGER_OPTION_KEYS: readonly string[];
|
|
20
|
+
/** The option keys of `.entryPoint(id, trigger, options)`. */
|
|
21
|
+
export declare const ENTRY_POINT_OPTION_KEYS: readonly string[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The option keys of the Flow builder's own methods: `.step()`, `.branch()`,
|
|
3
|
+
* `.loop()`, `.parallel()`, … and `.trigger()` (builder-sdk#1990). A node type's
|
|
4
|
+
* spec objects (`http()`'s inputs) declare theirs on the type (`optionKeys`,
|
|
5
|
+
* flow-node-type.ts); these are the structural steps', which no family owns.
|
|
6
|
+
*
|
|
7
|
+
* Each list is a `declareKeys<T>()` of the method's options type, so `tsc` holds
|
|
8
|
+
* the list to the type: a new `LoopOptions` field that is not listed here fails
|
|
9
|
+
* `npm run build`. The table is keyed by every `Step` kind that has `options`,
|
|
10
|
+
* so a new step kind with options needs a row too.
|
|
11
|
+
*/
|
|
12
|
+
import { declareKeys } from './core/option-keys.js';
|
|
13
|
+
/** The option keys of each builder method, by the kind of step it makes. */
|
|
14
|
+
export const STEP_OPTION_KEYS = {
|
|
15
|
+
action: { call: '.step()', keys: declareKeys({ version: true, updates: true, label: true, draft: true }) },
|
|
16
|
+
branch: { call: '.branch()', keys: declareKeys({ version: true, updates: true, label: true, draft: true }) },
|
|
17
|
+
switch: { call: '.switch()', keys: declareKeys({ version: true, updates: true, label: true }) },
|
|
18
|
+
stepSwitch: { call: '.stepSwitch()', keys: declareKeys({ version: true, updates: true, label: true }) },
|
|
19
|
+
loop: {
|
|
20
|
+
call: '.loop()',
|
|
21
|
+
keys: declareKeys({ version: true, updates: true, label: true, parallel: true, completionCondition: true, breakEnabled: true }),
|
|
22
|
+
},
|
|
23
|
+
doWhile: { call: '.doWhile()', keys: declareKeys({ version: true, updates: true, label: true, limit: true, breakEnabled: true }) },
|
|
24
|
+
parallel: { call: '.parallel()', keys: declareKeys({ version: true, updates: true, label: true, fork: true }) },
|
|
25
|
+
terminate: { call: '.terminate()', keys: declareKeys({ version: true, updates: true, label: true }) },
|
|
26
|
+
return: { call: '.return()', keys: declareKeys({ version: true, updates: true, label: true, name: true }) },
|
|
27
|
+
};
|
|
28
|
+
/** The option keys of `.trigger(spec, options)`. */
|
|
29
|
+
export const TRIGGER_OPTION_KEYS = declareKeys({ version: true, updates: true, label: true });
|
|
30
|
+
/** The option keys of `.entryPoint(id, trigger, options)`. */
|
|
31
|
+
export const ENTRY_POINT_OPTION_KEYS = declareKeys({
|
|
32
|
+
version: true, updates: true, label: true, inputs: true,
|
|
33
|
+
});
|
package/dist/flow-sdk.js
CHANGED
|
@@ -1041,18 +1041,14 @@ class FlowBuilder extends StepList {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
const b = new StepList();
|
|
1043
1043
|
prefixFn?.(b);
|
|
1044
|
+
// A key the options type does not name is kept as written, so the
|
|
1045
|
+
// serializer refuses it (FLOW_UNKNOWN_OPTION) instead of dropping it.
|
|
1046
|
+
const { inputs: _inputs, version, label, updates, ...unknown } = options ?? {};
|
|
1047
|
+
const kept = { ...(version !== undefined ? { version } : {}), ...(label !== undefined ? { label } : {}), ...(updates !== undefined ? { updates } : {}), ...unknown };
|
|
1044
1048
|
this._entryPoints.push({
|
|
1045
1049
|
id,
|
|
1046
1050
|
trigger: trigger,
|
|
1047
|
-
...(
|
|
1048
|
-
? {
|
|
1049
|
-
options: {
|
|
1050
|
-
...(options.version !== undefined ? { version: options.version } : {}),
|
|
1051
|
-
...(options.label !== undefined ? { label: options.label } : {}),
|
|
1052
|
-
...(options.updates !== undefined ? { updates: options.updates } : {}),
|
|
1053
|
-
},
|
|
1054
|
-
}
|
|
1055
|
-
: {}),
|
|
1051
|
+
...(Object.keys(kept).length > 0 ? { options: kept } : {}),
|
|
1056
1052
|
inputs,
|
|
1057
1053
|
steps: b.steps,
|
|
1058
1054
|
});
|
|
@@ -433,8 +433,7 @@ export function attachAgentResources(s, ctx, source, who, toolVariables = new Ma
|
|
|
433
433
|
// Its labels are bindings.json's to judge, as a connector step's are:
|
|
434
434
|
// refused ahead of the library, so a run without one still hears about them.
|
|
435
435
|
const where = `${who.toLowerCase()} "${step}"'s connector tool "${tr.connector}/${tr.operation}"`;
|
|
436
|
-
ctx.
|
|
437
|
-
ctx.resolveBinding(tr.folder, 'folder', where, { key: tr.connector, action: tr.operation });
|
|
436
|
+
ctx.resolveBindingPair(tr, where, { key: tr.connector, action: tr.operation });
|
|
438
437
|
// Its node id is still claimed, as with a library, so the ids derived
|
|
439
438
|
// for the tools after it, and another resource's `nodeId` that takes
|
|
440
439
|
// one, are judged as compile with a library judges them.
|
|
@@ -464,8 +463,7 @@ export function attachAgentResources(s, ctx, source, who, toolVariables = new Ma
|
|
|
464
463
|
// Emitting none of them left the tool with no connection anywhere.
|
|
465
464
|
const where = `${who.toLowerCase()} "${step}"'s connector tool "${tr.connector}/${tr.operation}"`;
|
|
466
465
|
const target = { key: tr.connector, action: tr.operation };
|
|
467
|
-
const conn = ctx.
|
|
468
|
-
const folder = ctx.resolveBinding(tr.folder, 'folder', where, target);
|
|
466
|
+
const { connectionId: conn, folderKey: folder } = ctx.resolveBindingPair(tr, where, target);
|
|
469
467
|
ctx.bindConnection({
|
|
470
468
|
model: rc.v1def?.model, connectorKey: rc.connectorKey, connectionId: conn,
|
|
471
469
|
...(folder !== undefined ? { folderKey: folder } : {}),
|
|
@@ -18,6 +18,7 @@ import { checkAgentResources, checkConversationalAgent, checkInlineAgent, checkI
|
|
|
18
18
|
import { INLINE_AGENT_DEFAULT_VERSION, INLINE_AGENT_VERSIONS, attachAgentResources, toolArguments, serializeInlineAgent, } from './inline-agent.js';
|
|
19
19
|
import { liftAgentResources, liftInlineAgent, printInlineAgent } from './inline-agent-lift.js';
|
|
20
20
|
import { INLINE_AGENT } from './resources.js';
|
|
21
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
21
22
|
const CREATE_OUTGOING_CALL = 'uipath.conversational.voice.create-outgoing-call';
|
|
22
23
|
const END_CALL = 'uipath.conversational.voice.end-call';
|
|
23
24
|
const VOICE_AGENT = 'uipath.agent.voice';
|
|
@@ -380,8 +381,15 @@ function createOutgoingCallAt(version) {
|
|
|
380
381
|
output: opaque,
|
|
381
382
|
};
|
|
382
383
|
}
|
|
384
|
+
/** Every key of each agent factory's options (builder-sdk#1990); `tsc` holds each list to its type. */
|
|
385
|
+
const CALL_OPTIONS = { inputs: declareKeys({ from: true, to: true }) };
|
|
386
|
+
const END_CALL_OPTIONS = { inputs: declareKeys({ callContext: true }) };
|
|
387
|
+
const VOICE_AGENT_OPTIONS = { inputs: declareKeys({ systemPrompt: true, inputs: true, callContext: true, voice: true, maxIterations: true, source: true, context: true, tools: true, escalation: true }) };
|
|
388
|
+
const CONVERSATIONAL_AGENT_OPTIONS = { inputs: declareKeys({ systemPrompt: true, model: true, settings: true, endExchange: true, temperature: true, maxTokenPerResponse: true, modelMaxTokens: true, maxIterations: true, guardrails: true, source: true, context: true, tools: true, escalation: true }) };
|
|
389
|
+
const INLINE_AGENT_OPTIONS = { inputs: declareKeys({ model: true, systemPrompt: true, userPrompt: true, inputs: true, returns: true, source: true, temperature: true, maxTokenPerResponse: true, modelMaxTokens: true, maxIterations: true, mode: true, guardrails: true, memory: true, context: true, tools: true, escalation: true }) };
|
|
383
390
|
const createOutgoingCall = {
|
|
384
391
|
kind: 'createOutgoingCall', typeName: CREATE_OUTGOING_CALL, factory: 'createOutgoingCall',
|
|
392
|
+
optionKeys: CALL_OPTIONS,
|
|
385
393
|
// 1.1 is definition-only: its output's `callContext` also declares `from` and
|
|
386
394
|
// `to` (the two numbers). The node itself is the same at both versions. An
|
|
387
395
|
// unpinned step writes 1.1; `{ version: '1.0' }`, which decompile prints for
|
|
@@ -391,6 +399,7 @@ const createOutgoingCall = {
|
|
|
391
399
|
};
|
|
392
400
|
const endCall10 = {
|
|
393
401
|
kind: 'endCall', typeName: END_CALL, version: '1.0', factory: 'endCall', definition: 'bundled',
|
|
402
|
+
optionKeys: END_CALL_OPTIONS,
|
|
394
403
|
rawNode: { factory: 'endCall()' },
|
|
395
404
|
serialize: (spec, ctx) => serializeCall(spec, ctx, END_CALL),
|
|
396
405
|
deserialize: (node) => liftCall(node, 'endCall'),
|
|
@@ -431,6 +440,7 @@ function conversationalAgentAt(version) {
|
|
|
431
440
|
}
|
|
432
441
|
const voiceAgent = {
|
|
433
442
|
kind: 'voiceAgent', typeName: VOICE_AGENT, factory: 'voiceAgent',
|
|
443
|
+
optionKeys: VOICE_AGENT_OPTIONS,
|
|
434
444
|
// 1.0 is the first bundled entry, which is what the node was emitted at before
|
|
435
445
|
// the port; 1.1 adds the error port and is reached by `{ version: '1.1' }`.
|
|
436
446
|
defaultVersion: '1.0',
|
|
@@ -438,6 +448,7 @@ const voiceAgent = {
|
|
|
438
448
|
};
|
|
439
449
|
const conversationalAgent = {
|
|
440
450
|
kind: 'conversationalAgent', typeName: CONVERSATIONAL_AGENT, factory: 'conversationalAgent',
|
|
451
|
+
optionKeys: CONVERSATIONAL_AGENT_OPTIONS,
|
|
441
452
|
defaultVersion: '1.6',
|
|
442
453
|
versions: { '1.6': conversationalAgentAt('1.6'), '1.7': conversationalAgentAt('1.7') },
|
|
443
454
|
};
|
|
@@ -464,6 +475,7 @@ function inlineAgentAt(version) {
|
|
|
464
475
|
}
|
|
465
476
|
const inlineAgent = {
|
|
466
477
|
kind: 'inlineAgent', typeName: INLINE_AGENT, factory: 'inlineAgent',
|
|
478
|
+
optionKeys: INLINE_AGENT_OPTIONS,
|
|
467
479
|
// The NEWEST bundled version, not the first (#956): `mode` and `memory` no
|
|
468
480
|
// longer pick one, so every call shape gets the current definition.
|
|
469
481
|
defaultVersion: INLINE_AGENT_DEFAULT_VERSION,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* serialized output and printed source unchanged.
|
|
7
7
|
*/
|
|
8
8
|
import { Expr } from '../../../core/expr.js';
|
|
9
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
9
10
|
/**
|
|
10
11
|
* Both definitions list `attachment` and `prompt` in `inputDefinition.required`,
|
|
11
12
|
* as the designer's form does, so `uip maestro flow validate` refuses a node
|
|
@@ -91,12 +92,17 @@ function summarizeAt(version) {
|
|
|
91
92
|
output: () => ({ kind: 'opaque' }),
|
|
92
93
|
};
|
|
93
94
|
}
|
|
95
|
+
/** Every key of each factory's options (builder-sdk#1990); `tsc` holds each list to its type. */
|
|
96
|
+
const SUMMARIZE_OPTIONS = { inputs: declareKeys({ attachment: true, prompt: true, returnCitations: true }) };
|
|
97
|
+
const BATCH_TRANSFORM_OPTIONS = { inputs: declareKeys({ attachment: true, prompt: true, outputColumns: true, enableWebSearchGrounding: true }) };
|
|
94
98
|
const summarizeType = {
|
|
95
99
|
kind: 'summarize', typeName: 'uipath.pattern.deep-rag', factory: 'summarize', defaultVersion: '1.1',
|
|
100
|
+
optionKeys: SUMMARIZE_OPTIONS,
|
|
96
101
|
versions: { '1.1': summarizeAt('1.1'), '1.0': summarizeAt('1.0') },
|
|
97
102
|
};
|
|
98
103
|
const batchTransformType = {
|
|
99
104
|
kind: 'batchTransform', typeName: 'uipath.pattern.batch-transform', version: '1.0', factory: 'batchTransform',
|
|
105
|
+
optionKeys: BATCH_TRANSFORM_OPTIONS,
|
|
100
106
|
definition: 'bundled',
|
|
101
107
|
rawNode: { factory: 'batchTransform()' },
|
|
102
108
|
serialize: ({ inputs }, ctx) => ({
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
17
17
|
*/
|
|
18
18
|
import { eventDetail, eventTarget, libraryRequiredForEvent, refuseUnverifiedByoa, resolveEvent } from '../../../core/event-subscription.js';
|
|
19
|
+
import { EVENT_SUBSCRIPTION_KEYS } from '../../../core/connector-option-keys.js';
|
|
19
20
|
import { liftSubscription, printSubscription, splitEvent } from './event-wait.js';
|
|
20
21
|
const CONNECTOR_PREFIX = 'uipath.connector.';
|
|
21
22
|
const PREFIXES = [`${CONNECTOR_PREFIX}trigger.`, `${CONNECTOR_PREFIX}event.`];
|
|
@@ -32,8 +33,7 @@ function serializeEventTrigger(spec, ctx) {
|
|
|
32
33
|
// mid-flow connector's does, so the pair goes into the flow's `bindings[]` (G-19).
|
|
33
34
|
const target = eventTarget(sub);
|
|
34
35
|
const bindingSite = root.isDefault ? 'event trigger' : 'onEvent() entry point';
|
|
35
|
-
const connectionId = ctx.
|
|
36
|
-
const folderKey = ctx.resolveBinding(sub.folder, 'folder', bindingSite, target);
|
|
36
|
+
const { connectionId, folderKey } = ctx.resolveBindingPair(sub, bindingSite, target);
|
|
37
37
|
ctx.bindConnection({
|
|
38
38
|
model: rc.v1def?.model,
|
|
39
39
|
connectorKey: rc.connectorKey, connectionId,
|
|
@@ -53,6 +53,8 @@ function serializeEventTrigger(spec, ctx) {
|
|
|
53
53
|
}
|
|
54
54
|
export const eventTriggerType = {
|
|
55
55
|
kind: 'event',
|
|
56
|
+
// The stringly form's subscription is the author's own object; the descriptor form's is built by the factory.
|
|
57
|
+
optionKeys: { subscription: EVENT_SUBSCRIPTION_KEYS },
|
|
56
58
|
typeName: `${CONNECTOR_PREFIX}*`,
|
|
57
59
|
typeNamePrefix: CONNECTOR_PREFIX,
|
|
58
60
|
// Any name under the two prefixes, an eventless one included: a root of that
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EVENT_SUBSCRIPTION_KEYS } from '../../../core/connector-option-keys.js';
|
|
1
2
|
import { bindingMissingMessage, missingBindingLabels } from '../../../core/binding-messages.js';
|
|
2
3
|
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
3
4
|
import { commentText } from '../../../core/comment-text.js';
|
|
@@ -62,8 +63,7 @@ function serializeEventWait(spec, ctx) {
|
|
|
62
63
|
// The platform reaches the connection through the flow's `bindings[]`, as for
|
|
63
64
|
// a connector operation (board G-19). `eventDetail` refused a node without
|
|
64
65
|
// both labels, so both resolve here.
|
|
65
|
-
const connectionId = ctx.
|
|
66
|
-
const folderKey = ctx.resolveBinding(sub.folder, 'folder', site, target);
|
|
66
|
+
const { connectionId, folderKey } = ctx.resolveBindingPair(sub, site, target);
|
|
67
67
|
ctx.bindConnection({
|
|
68
68
|
model: rc.v1def?.model,
|
|
69
69
|
connectorKey: rc.connectorKey, connectionId: connectionId,
|
|
@@ -191,6 +191,8 @@ const eventWait10 = {
|
|
|
191
191
|
};
|
|
192
192
|
export const eventWaitNodeType = {
|
|
193
193
|
kind: 'waitEvent', typeName: `${EVENT_PREFIX}*`, typeNamePrefix: EVENT_PREFIX, factory: 'waitForEvent',
|
|
194
|
+
// The stringly form's subscription is the author's own object; the descriptor form's is built by the factory.
|
|
195
|
+
optionKeys: { subscription: EVENT_SUBSCRIPTION_KEYS },
|
|
194
196
|
typeNameMatches: (typeName) => splitEvent(typeName) !== undefined,
|
|
195
197
|
versionedByDefinition: true,
|
|
196
198
|
defaultVersion: eventWait10.version,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONNECTOR_OPTION_KEYS } from '../../../core/connector-option-keys.js';
|
|
1
2
|
import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../../../core/binding-messages.js';
|
|
2
3
|
import { PULL_COMMAND, prepareCommand } from '../../../core/cli-spelling.js';
|
|
3
4
|
import { carriedConnector, carriedDefinitionMismatch, carriedOperationOf, carriedOperationRefusal, } from '../../../core/carried-connector-operation.js';
|
|
@@ -119,8 +120,7 @@ function serializeConnector(spec, ctx) {
|
|
|
119
120
|
const missing = missingBindingLabels(spec);
|
|
120
121
|
if (missing.length > 0 && !ctx.drafting)
|
|
121
122
|
throw new BindingRefusal('BINDING_MISSING', bindingMissingMessage(where, missing, target));
|
|
122
|
-
const connection = ctx.
|
|
123
|
-
ctx.resolveBinding(spec.folder, 'folder', where, target);
|
|
123
|
+
const { connectionId: connection } = ctx.resolveBindingPair(spec, where, target);
|
|
124
124
|
// The connection rides on the refusal, so check's stand-in for this step
|
|
125
125
|
// still takes part in the file-wide CONNECTION_CONNECTOR_CONFLICT rule.
|
|
126
126
|
throw new LibraryRequiredRefusal(`connector "${step}" needs a library (pass --library / set $FLOW_SDK_LIBRARY_JSON).`, connection !== undefined && typeof spec.key === 'string' && spec.key !== '' ? { connector: spec.key, connection } : undefined);
|
|
@@ -201,8 +201,7 @@ function serializeConnector(spec, ctx) {
|
|
|
201
201
|
ctx.draft(refusal.code, refusal.message);
|
|
202
202
|
unbound = true;
|
|
203
203
|
}
|
|
204
|
-
const conn = ctx.
|
|
205
|
-
const folder = ctx.resolveBinding(spec.folder, 'folder', where, target);
|
|
204
|
+
const { connectionId: conn, folderKey: folder } = ctx.resolveBindingPair(spec, where, target);
|
|
206
205
|
// The platform reaches the connection through the flow's `bindings[]`, never
|
|
207
206
|
// through `inputs.detail` — without this pair the run faults with `[102010]`
|
|
208
207
|
// (board G-19).
|
|
@@ -443,6 +442,8 @@ const connector10 = {
|
|
|
443
442
|
};
|
|
444
443
|
export const connectorNodeType = {
|
|
445
444
|
kind: 'connector', typeName: `${CONNECTOR_PREFIX}*`, typeNamePrefix: CONNECTOR_PREFIX, factory: 'connector',
|
|
445
|
+
// `inputs` are the connector's own fields, which the library checks (CONNECTOR_INPUT); only the options object is closed here.
|
|
446
|
+
optionKeys: { options: CONNECTOR_OPTION_KEYS },
|
|
446
447
|
typeNameMatches: (typeName) => splitOperation(typeName) !== undefined,
|
|
447
448
|
versionedByDefinition: true,
|
|
448
449
|
defaultVersion: connector10.version,
|
|
@@ -41,7 +41,7 @@ export function connectorRawNodeRefusal(nodeType) {
|
|
|
41
41
|
return (`rawNode("${nodeType}") names a connector operation. A raw node keeps its inputs verbatim, so the `
|
|
42
42
|
+ `emitted node would have no inputs.detail and no connection binding: \`validate\` only warns `
|
|
43
43
|
+ `("Connector is not configured") and the run can never reach Integration Service. `
|
|
44
|
-
+ `Author it as connector('${key}', '${action}', { ...inputs }, { connection: '<
|
|
44
|
+
+ `Author it as connector('${key}', '${action}', { ...inputs }, { connection: '<connection-label>', folder: '<folder-label>' }). `
|
|
45
45
|
+ `If compile then refuses an input the static library does not carry, run `
|
|
46
46
|
+ `\`${prepareCommand(key, action)}\` — it discovers the connection, writes bindings.json `
|
|
47
47
|
+ `and loads the connection-resolved fields into ./.flow-sdk/connectors-local/ (add \`-f <parent>=<value>\`, e.g. `
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import { Expr, toExpr } from '../../../core/expr.js';
|
|
9
9
|
import { jsonClone } from '../../../core/json-clone.js';
|
|
10
10
|
import { checkConversational } from './check.js';
|
|
11
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
12
|
+
import { ownEntry } from '../../../core/own-entry.js';
|
|
11
13
|
/**
|
|
12
14
|
* The definition's `inputDefaults`, which supply the fixed fields the platform's
|
|
13
15
|
* schema requires (`role: 'assistant'` and `mimeType: 'text/markdown'` on send,
|
|
@@ -104,9 +106,16 @@ function conversationAt(kind, typeName, version) {
|
|
|
104
106
|
output: () => ({ kind: 'opaque' }),
|
|
105
107
|
};
|
|
106
108
|
}
|
|
109
|
+
/** Every key of each factory's options (builder-sdk#1990), by kind; `tsc` holds each list to its type. */
|
|
110
|
+
const CONVERSATION_OPTIONS = {
|
|
111
|
+
sendMessage: { inputs: declareKeys({ conversationId: true, exchangeId: true, content: true, endExchange: true }) },
|
|
112
|
+
waitForMessage: { inputs: declareKeys({ conversationId: true, numExchanges: true }) },
|
|
113
|
+
conversationContext: { inputs: declareKeys({ conversationId: true, exchangeLimit: true }) },
|
|
114
|
+
};
|
|
107
115
|
function conversationType(kind, typeName, versions) {
|
|
108
116
|
return {
|
|
109
117
|
kind, typeName, factory: kind, defaultVersion: '1.0',
|
|
118
|
+
optionKeys: ownEntry(CONVERSATION_OPTIONS, kind),
|
|
110
119
|
versions: Object.fromEntries(versions.map((v) => [v, conversationAt(kind, typeName, v)])),
|
|
111
120
|
};
|
|
112
121
|
}
|
|
@@ -2,6 +2,7 @@ import { applyScope, baseConfig, entityConfigOf, fieldRows, filterRows, liftFiel
|
|
|
2
2
|
import { checkCreate, checkRead, checkUpdate, checkWrite } from './check.js';
|
|
3
3
|
import { rawNodeAdvice } from './raw.js';
|
|
4
4
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
5
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
5
6
|
/**
|
|
6
7
|
* Every Data Fabric node carries no node-level `model`, whichever path emits it
|
|
7
8
|
* (a verb, or a rawNode of its definition). Studio Web never writes one
|
|
@@ -143,14 +144,21 @@ function liftFilters(q) {
|
|
|
143
144
|
}
|
|
144
145
|
return [];
|
|
145
146
|
}
|
|
147
|
+
/** Every key of each verb's options (builder-sdk#1990); `tsc` holds each list to its type. */
|
|
148
|
+
const READ_OPTIONS = { inputs: declareKeys({ entity: true, filters: true, resultMode: true, limit: true, skip: true, sort: true, fields: true, folderKey: true, resourceKey: true }) };
|
|
149
|
+
const CREATE_OPTIONS = { inputs: declareKeys({ entity: true, values: true, folderKey: true, resourceKey: true }) };
|
|
150
|
+
const UPDATE_OPTIONS = { inputs: declareKeys({ entity: true, record: true, set: true, folderKey: true, resourceKey: true }) };
|
|
151
|
+
const DELETE_OPTIONS = { inputs: declareKeys({ entity: true, record: true, folderKey: true, resourceKey: true }) };
|
|
146
152
|
export const dataFabricRead = {
|
|
147
153
|
kind: 'dataFabricRead', typeName: 'core.datafabric.read', factory: 'dataFabricRead', defaultVersion: '1.0',
|
|
154
|
+
optionKeys: READ_OPTIONS,
|
|
148
155
|
versions: { '1.0': readAt('1.0'), '1.4': readAt('1.4') },
|
|
149
156
|
select: ({ inputs }) => (inputs?.resultMode !== undefined ? '1.4' : '1.0'),
|
|
150
157
|
};
|
|
151
158
|
// ─── create ────────────────────────────────────────────────────────────────────
|
|
152
159
|
export const dataFabricCreate = {
|
|
153
160
|
kind: 'dataFabricCreate', typeName: 'core.datafabric.create', version: '1.3', factory: 'dataFabricCreate',
|
|
161
|
+
optionKeys: CREATE_OPTIONS,
|
|
154
162
|
definition: 'bundled', nodeModel: NODE_MODEL, rawNode: CREATE_ADVICE,
|
|
155
163
|
serialize: ({ inputs }, ctx) => {
|
|
156
164
|
const scope = resolvedScope(inputs, ctx);
|
|
@@ -207,11 +215,13 @@ function updateAt(version) {
|
|
|
207
215
|
}
|
|
208
216
|
export const dataFabricUpdate = {
|
|
209
217
|
kind: 'dataFabricUpdate', typeName: 'core.datafabric.update', factory: 'dataFabricUpdate', defaultVersion: '1.0',
|
|
218
|
+
optionKeys: UPDATE_OPTIONS,
|
|
210
219
|
versions: { '1.0': updateAt('1.0'), '1.3': updateAt('1.3') },
|
|
211
220
|
};
|
|
212
221
|
// ─── delete ────────────────────────────────────────────────────────────────────
|
|
213
222
|
export const dataFabricDelete = {
|
|
214
223
|
kind: 'dataFabricDelete', typeName: 'core.datafabric.delete', version: '1.3', factory: 'dataFabricDelete',
|
|
224
|
+
optionKeys: DELETE_OPTIONS,
|
|
215
225
|
definition: 'bundled', nodeModel: NODE_MODEL, rawNode: DELETE_ADVICE,
|
|
216
226
|
serialize: ({ inputs }, ctx) => {
|
|
217
227
|
const scope = resolvedScope(inputs, ctx);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DELAY_PRESETS } from './spec.js';
|
|
2
2
|
import { checkDelay } from './check.js';
|
|
3
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
3
4
|
/**
|
|
4
5
|
* Encode a delay's single `duration` into the two inputs the platform's node
|
|
5
6
|
* carries — the SAME split as the scheduled trigger above, on the same field
|
|
@@ -69,7 +70,10 @@ function delayAt(version) {
|
|
|
69
70
|
}),
|
|
70
71
|
};
|
|
71
72
|
}
|
|
73
|
+
/** Every key of `delay()`'s options (builder-sdk#1990); `tsc` holds the list to `DelayInputs`. */
|
|
74
|
+
const DELAY_OPTIONS = { inputs: declareKeys({ duration: true, until: true }) };
|
|
72
75
|
export const delayNodeType = {
|
|
73
76
|
kind: 'delay', typeName: 'core.logic.delay', factory: 'delay', defaultVersion: '1.0.0',
|
|
77
|
+
optionKeys: DELAY_OPTIONS,
|
|
74
78
|
versions: { '1.0.0': delayAt('1.0.0'), '1.0': delayAt('1.0') },
|
|
75
79
|
};
|
|
@@ -15,6 +15,7 @@ import { Expr } from '../../../core/expr.js';
|
|
|
15
15
|
import { jsonClone } from '../../../core/json-clone.js';
|
|
16
16
|
import { parseIxpProjectType } from './spec.js';
|
|
17
17
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
18
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
18
19
|
const IXP_PREFIX = 'uipath.ixp.';
|
|
19
20
|
export const IXP_DIAGNOSTICS = {
|
|
20
21
|
IXP_FORBIDDEN_INPUT: { severity: 'error', summary: 'an IxP step setting an input the current node does not declare' },
|
|
@@ -390,8 +391,11 @@ const ixpExtract10 = {
|
|
|
390
391
|
expressions: () => [],
|
|
391
392
|
output: () => ({ kind: 'opaque' }),
|
|
392
393
|
};
|
|
394
|
+
/** Every key of `ixpExtract()`'s options (builder-sdk#1990); `tsc` holds the list to `IxpExtractInputs`. */
|
|
395
|
+
const IXP_EXTRACT_OPTIONS = { inputs: declareKeys({ project: true, modelName: true, name: true, folderName: true, fileRef: true, pageRange: true, versionTag: true, folderPath: true, description: true }) };
|
|
393
396
|
export const ixpExtractNodeType = {
|
|
394
397
|
kind: 'ixpExtract', typeName: `${IXP_PREFIX}*`, typeNamePrefix: IXP_PREFIX, factory: 'ixpExtract',
|
|
398
|
+
optionKeys: IXP_EXTRACT_OPTIONS,
|
|
395
399
|
// An extractor is a tail of two uuids; Dynamic Extract's
|
|
396
400
|
// `uipath.ixp.extract-document-builder` and the older tails are not.
|
|
397
401
|
typeNameMatches: (typeName) => parseIxpProjectType(typeName) !== undefined,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { toExpr } from '../../../core/expr.js';
|
|
11
11
|
import { jsonClone } from '../../../core/json-clone.js';
|
|
12
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
12
13
|
export const DOCUMENT_DIAGNOSTICS = {
|
|
13
14
|
DOC_NO_FILEREF: { severity: 'error', summary: 'no fileRef, so nothing to classify or extract from' },
|
|
14
15
|
EXTRACT_SCHEMA_SHAPE: { severity: 'error', summary: 'a Dynamic Extract schema that is not an object' },
|
|
@@ -96,8 +97,12 @@ function liftClassificationSchema(node, ctx) {
|
|
|
96
97
|
}
|
|
97
98
|
return raw;
|
|
98
99
|
}
|
|
100
|
+
/** Every key of each factory's options (builder-sdk#1990); `tsc` holds each list to its type. */
|
|
101
|
+
const CLASSIFY_OPTIONS = { inputs: declareKeys({ fileRef: true, pageRange: true, splitPages: true, modelConfig: true, classificationSchema: true }) };
|
|
102
|
+
const DYNAMIC_EXTRACT_OPTIONS = { inputs: declareKeys({ fileRef: true, model: true, schema: true, pageRange: true, modelConfig: true }) };
|
|
99
103
|
export const documentClassifyNodeType = {
|
|
100
104
|
kind: 'documentClassify', typeName: 'uipath.document.classify', version: '1.0', factory: 'documentClassify',
|
|
105
|
+
optionKeys: CLASSIFY_OPTIONS,
|
|
101
106
|
definition: 'bundled', rawNode: { factory: 'documentClassify()' },
|
|
102
107
|
serialize: ({ inputs }, ctx) => {
|
|
103
108
|
const d = defaults('uipath.document.classify', '1.0', ctx);
|
|
@@ -149,6 +154,7 @@ export const documentClassifyNodeType = {
|
|
|
149
154
|
};
|
|
150
155
|
export const dynamicExtractNodeType = {
|
|
151
156
|
kind: 'dynamicExtract', typeName: 'uipath.ixp.extract-document-builder', version: '1.0.0', factory: 'dynamicExtract',
|
|
157
|
+
optionKeys: DYNAMIC_EXTRACT_OPTIONS,
|
|
152
158
|
definition: 'bundled', rawNode: { factory: 'dynamicExtract()' },
|
|
153
159
|
serialize: ({ inputs }, ctx) => {
|
|
154
160
|
const d = defaults('uipath.ixp.extract-document-builder', '1.0.0', ctx);
|
|
@@ -24,6 +24,7 @@ import { appAnswerSchemas, appContract, appInputSchema, liftActionSchema, normal
|
|
|
24
24
|
import { checkHitl, checkHitlRead } from './check.js';
|
|
25
25
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
26
26
|
import { processResourceBindings } from '../../../core/process-resource.js';
|
|
27
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
27
28
|
const BASE = 'uipath.human-in-the-loop';
|
|
28
29
|
const QUICK_FORM = 'uipath.human-in-the-loop.quick-form';
|
|
29
30
|
const ACTION_APP = 'uipath.human-in-the-loop.coded-action-app';
|
|
@@ -948,9 +949,12 @@ function hitlAt(typeName, version, factory) {
|
|
|
948
949
|
&& (inputs?.outcomes ?? []).some((o, i) => port === `outcome-${outcomeIdOf(o, i)}`),
|
|
949
950
|
};
|
|
950
951
|
}
|
|
952
|
+
/** Every key of `hitl()`'s options (builder-sdk#1990); `tsc` holds the list to `HitlInputs`. */
|
|
953
|
+
const HITL_OPTIONS = { inputs: declareKeys({ variant: true, app: true, title: true, priority: true, fields: true, outcomes: true, recipient: true, labels: true, outcomePorts: true, exposeError: true, legacyCompleted: true, document: true }) };
|
|
951
954
|
function hitlType(typeName, versions, factory, variant) {
|
|
952
955
|
return {
|
|
953
956
|
kind: 'hitl', typeName, factory: 'hitl', defaultVersion: '1.0',
|
|
957
|
+
optionKeys: HITL_OPTIONS,
|
|
954
958
|
versions: Object.fromEntries(versions.map((v) => [v, hitlAt(typeName, v, factory)])),
|
|
955
959
|
// The base node is the one an absent or UNKNOWN variant resolves to, as it
|
|
956
960
|
// always has: its serialize refuses the unknown one (HITL_VARIANT_UNKNOWN).
|