@uipath/maestro-builder-sdk 6.100.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/README.md +3 -0
- package/dist/api-index.md +14 -14
- package/dist/api-members.md +16 -16
- package/dist/cli/commands/capabilities.d.ts +10 -0
- package/dist/cli/commands/capabilities.js +24 -0
- package/dist/cli/common.d.ts +17 -17
- package/dist/cli/common.js +114 -20
- package/dist/cli/index.js +2 -0
- 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/index.d.ts +2 -0
- package/dist/index.js +3 -0
- 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/sdk-capabilities.d.ts +57 -0
- package/dist/sdk-capabilities.js +76 -0
- package/dist/serialize.js +73 -1
- package/package.json +9 -3
|
@@ -174,6 +174,55 @@ export function bindingMissingMessage(where, missing, target) {
|
|
|
174
174
|
+ `with nothing real to bind yet, declare both labels in bindings.json with a placeholder resourceKey (a `
|
|
175
175
|
+ `CONNECTION_STUB warning, never an invented GUID).`;
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* BINDING_CONNECTION_IS_FOLDER (#1968): a node whose connection and folder are
|
|
179
|
+
* the same value. The node then sends one id as both its `connectionId` and its
|
|
180
|
+
* `connectionFolderKey`, and no tenant has a connection whose id is its folder's
|
|
181
|
+
* key. `check`, `compile` and `flow validate` used to pass it; the run faulted
|
|
182
|
+
* at dispatch with `401 Invalid Organization or User secret`.
|
|
183
|
+
*
|
|
184
|
+
* Two routes in, both refused:
|
|
185
|
+
*
|
|
186
|
+
* - ONE LABEL for both (`connection: 'slack', folder: 'slack'`). bindings.json
|
|
187
|
+
* answers a label with one `resourceKey`, so the two halves cannot differ.
|
|
188
|
+
* `prepare` with such a source also writes one row for the label, the
|
|
189
|
+
* `FolderKey` row last, so the connection resolves to the folder key. Refused
|
|
190
|
+
* with or without a bindings.json: the labels alone decide it. Except when
|
|
191
|
+
* the label is itself a placeholder (an all-zero GUID or an `<angle>` value,
|
|
192
|
+
* as decompile writes for a node saved with a stub in both keys): that is
|
|
193
|
+
* offline authoring, and `CONNECTION_STUB` warns about it.
|
|
194
|
+
* - TWO LABELS, ONE KEY (`slack` and `shared` both carry the same GUID, say the
|
|
195
|
+
* connection's `Id` pasted into the folder row). Refused only when that key
|
|
196
|
+
* could be a real tenant id: two placeholder rows that share an all-zero GUID
|
|
197
|
+
* or an `<angle>` value are offline authoring, which `CONNECTION_STUB` already
|
|
198
|
+
* warns about.
|
|
199
|
+
*
|
|
200
|
+
* Call it with the labels the node names; `undefined` when either is absent
|
|
201
|
+
* (that is `BINDING_MISSING`'s) or the pair is fine.
|
|
202
|
+
*/
|
|
203
|
+
export function bindingPairRefusal(bindings, labels, where, target) {
|
|
204
|
+
const { connection, folder } = labels;
|
|
205
|
+
if (typeof connection !== 'string' || typeof folder !== 'string' || connection === '' || folder === '')
|
|
206
|
+
return undefined;
|
|
207
|
+
const remedy = `A connection and its folder are two bindings.json entries: a \`ConnectionId\` row whose resourceKey `
|
|
208
|
+
+ `is the connection's \`Id\`, and a \`FolderKey\` row whose resourceKey is its \`FolderKey\` (both from `
|
|
209
|
+
+ `\`uip is connections list --all-folders --output json\`). Give \`folder:\` its own label (for example `
|
|
210
|
+
+ `\`folder: 'shared'\`) and re-run \`${prepareFor(target)}\`, which writes both entries.`;
|
|
211
|
+
const fault = 'the run faults at dispatch with "401 Invalid Organization or User secret"';
|
|
212
|
+
if (connection === folder) {
|
|
213
|
+
if (STUB_GUID_RE.test(connection) || ANGLE_PLACEHOLDER_RE.test(connection))
|
|
214
|
+
return undefined;
|
|
215
|
+
return new BindingRefusal('BINDING_CONNECTION_IS_FOLDER', `${where}: \`connection\` and \`folder\` are both "${connection}". One label resolves to one resource key, so `
|
|
216
|
+
+ `the node would send the same id as its connection id and its folder key, and ${fault} (check, compile and `
|
|
217
|
+
+ `\`flow validate\` cannot tell). ${remedy}`);
|
|
218
|
+
}
|
|
219
|
+
const key = bindings?.resolve(connection) ?? connection;
|
|
220
|
+
if (key !== (bindings?.resolve(folder) ?? folder) || !GUID_RE.test(key) || STUB_GUID_RE.test(key))
|
|
221
|
+
return undefined;
|
|
222
|
+
return new BindingRefusal('BINDING_CONNECTION_IS_FOLDER', `${where}: connection "${connection}" and folder "${folder}" both resolve to "${key}", so the node would send the `
|
|
223
|
+
+ `same id as its connection id and its folder key, and ${fault}. One of the two bindings.json entries carries `
|
|
224
|
+
+ `the wrong resourceKey. ${remedy}`);
|
|
225
|
+
}
|
|
177
226
|
/**
|
|
178
227
|
* The all-zero prefix authors reach for when they need "a GUID" and have none:
|
|
179
228
|
* `00000000-0000-0000-0000-000000000001`. No tenant issues these. The same
|
|
@@ -181,6 +230,8 @@ export function bindingMissingMessage(where, missing, target) {
|
|
|
181
230
|
* agree on what a stub is.
|
|
182
231
|
*/
|
|
183
232
|
export const STUB_GUID_RE = /^0{8}-0{4}-0{4}-0{4}-/;
|
|
233
|
+
/** An `<angle-bracket>` placeholder copied from an example (`<id>`, `<connection-id>`). */
|
|
234
|
+
const ANGLE_PLACEHOLDER_RE = /^<[^<>]*>$/;
|
|
184
235
|
/**
|
|
185
236
|
* Why `value` can never be a tenant resource key, or `undefined` when it could be.
|
|
186
237
|
* Measured on 369 archived `bindings.json` files (2026-09-02): all-zero GUIDs,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Every key of `connector()`'s options. */
|
|
2
|
+
export declare const CONNECTOR_OPTION_KEYS: readonly string[];
|
|
3
|
+
/** Every key of an event subscription, as the stringly `waitForEvent({ … })` / `onEvent({ … })` take it. */
|
|
4
|
+
export declare const EVENT_SUBSCRIPTION_KEYS: readonly string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { declareKeys } from './option-keys.js';
|
|
2
|
+
/** Every key of `connector()`'s options. */
|
|
3
|
+
export const CONNECTOR_OPTION_KEYS = declareKeys({
|
|
4
|
+
version: true, connection: true, folder: true, object: true, carried: true,
|
|
5
|
+
});
|
|
6
|
+
/** Every key of an event subscription, as the stringly `waitForEvent({ … })` / `onEvent({ … })` take it. */
|
|
7
|
+
export const EVENT_SUBSCRIPTION_KEYS = declareKeys({
|
|
8
|
+
connector: true, event: true, where: true, object: true, filters: true, connection: true, folder: true, version: true,
|
|
9
|
+
});
|
|
@@ -21,6 +21,14 @@ export interface EventEmitEnv {
|
|
|
21
21
|
readonly bindings?: BindingsView;
|
|
22
22
|
/** A connection or folder label to the key the node carries, with compile's refusals and warnings. */
|
|
23
23
|
resolveBinding(name: string | undefined, attribute: 'connection' | 'folder', where: string, target?: PrepareTarget): string | undefined;
|
|
24
|
+
/** Both labels of a subscription's pair, resolved and judged as one (BINDING_CONNECTION_IS_FOLDER). */
|
|
25
|
+
resolveBindingPair(labels: {
|
|
26
|
+
connection?: string;
|
|
27
|
+
folder?: string;
|
|
28
|
+
}, where: string, target?: PrepareTarget): {
|
|
29
|
+
connectionId: string | undefined;
|
|
30
|
+
folderKey: string | undefined;
|
|
31
|
+
};
|
|
24
32
|
}
|
|
25
33
|
/** What `registry prepare` takes for an event subscription: its connector key and curated event name. */
|
|
26
34
|
export declare function eventTarget(sub: {
|
|
@@ -79,8 +79,7 @@ export function libraryRequiredForEvent(env, sub, nodeId, site, call) {
|
|
|
79
79
|
}
|
|
80
80
|
eventFilterReads(sub.filters, nodeId);
|
|
81
81
|
requireBindingPair(site, sub, eventTarget(sub));
|
|
82
|
-
const connection = env.
|
|
83
|
-
env.resolveBinding(sub.folder, 'folder', `event node "${nodeId}"`, eventTarget(sub));
|
|
82
|
+
const { connectionId: connection } = env.resolveBindingPair(sub, `event node "${nodeId}"`, eventTarget(sub));
|
|
84
83
|
const connector = eventTarget(sub)?.key;
|
|
85
84
|
if (connection !== undefined && connector !== undefined)
|
|
86
85
|
use = { connector, connection };
|
|
@@ -271,8 +270,7 @@ export function eventDetail(rc, sub, nodeId, env, site, opts = {}) {
|
|
|
271
270
|
// An unbound draft the canvas saved (`opts.unbound`, a draft compile) is written with no connection, as the file has it.
|
|
272
271
|
if (!opts.unbound)
|
|
273
272
|
requireBindingPair(site, sub, eventTarget(sub));
|
|
274
|
-
const conn = env.
|
|
275
|
-
const folder = env.resolveBinding(sub.folder, 'folder', `event node "${nodeId}"`, eventTarget(sub));
|
|
273
|
+
const { connectionId: conn, folderKey: folder } = env.resolveBindingPair(sub, `event node "${nodeId}"`, eventTarget(sub));
|
|
276
274
|
const op = (rc.entry?.operation ?? {});
|
|
277
275
|
// A GENERIC event with no `object` would carry `objectName: ""`: it validates
|
|
278
276
|
// and the platform's dispatcher refuses it. Refused here, at the layer that
|
|
@@ -141,6 +141,13 @@ export interface ErrorHandlerCheckContext {
|
|
|
141
141
|
readonly step: string;
|
|
142
142
|
report(code: string, message: string, suggestion?: string): void;
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* The option objects of a spec (`inputs`, a trigger's `appearance`) and every key
|
|
146
|
+
* each may carry. See {@link NodeType.optionKeys}.
|
|
147
|
+
*/
|
|
148
|
+
export type OptionKeyLists<Spec> = {
|
|
149
|
+
readonly [F in keyof Spec]?: readonly string[];
|
|
150
|
+
};
|
|
144
151
|
/** One node type at one version, for one artifact. See the module header. */
|
|
145
152
|
export interface NodeType<Spec, Serialized, Ctx extends ArtifactContexts> {
|
|
146
153
|
/** The spec discriminator, e.g. `'dataFabricRead'`. Unique within the artifact's registry. */
|
|
@@ -151,6 +158,24 @@ export interface NodeType<Spec, Serialized, Ctx extends ArtifactContexts> {
|
|
|
151
158
|
readonly version: string;
|
|
152
159
|
/** The public factory that produces this spec, e.g. `'dataFabricRead'`. */
|
|
153
160
|
readonly factory: string;
|
|
161
|
+
/**
|
|
162
|
+
* The option objects of this type's spec, each with every key it may carry
|
|
163
|
+
* (builder-sdk#1990). The artifact's serializer refuses any other key (Flow:
|
|
164
|
+
* FLOW_UNKNOWN_OPTION), because it would drop it: for instance
|
|
165
|
+
* `http({ url, managed: true, retryCont: 2 })` would compile with no retry.
|
|
166
|
+
* Build each list with `declareKeys<T>()` (`core/option-keys.ts`), which `tsc`
|
|
167
|
+
* holds to the option type, so the list cannot drift from it:
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* optionKeys: { inputs: declareKeys<HttpInputs>({ url: true, method: true, ... }) }
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* Omit it, or a field, and that object stays open: a connector's `inputs` (the
|
|
174
|
+
* connector's own fields, which its library checks), or a node-type
|
|
175
|
+
* package's spec. On a versioned type, declare it once on the
|
|
176
|
+
* `VersionedNodeType`: the option types are the kind's, not a version's.
|
|
177
|
+
*/
|
|
178
|
+
readonly optionKeys?: OptionKeyLists<Spec>;
|
|
154
179
|
/** Where the definition comes from; decides who answers `errorPort` (see below). */
|
|
155
180
|
readonly definition: DefinitionSource;
|
|
156
181
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* is a new entry (usually a subclass of the previous one), so adding it cannot
|
|
8
8
|
* change how a node at an older version serializes, deserializes or prints.
|
|
9
9
|
*/
|
|
10
|
-
import type { ArtifactContexts, NodeType } from './node-type.js';
|
|
10
|
+
import type { ArtifactContexts, NodeType, OptionKeyLists } from './node-type.js';
|
|
11
11
|
export interface VersionedNodeType<Spec, Serialized, Ctx extends ArtifactContexts,
|
|
12
12
|
/** The implementation type: an artifact's own extension of NodeType, when it has one. */
|
|
13
13
|
Impl extends NodeType<Spec, Serialized, Ctx> = NodeType<Spec, Serialized, Ctx>> {
|
|
@@ -45,6 +45,8 @@ Impl extends NodeType<Spec, Serialized, Ctx> = NodeType<Spec, Serialized, Ctx>>
|
|
|
45
45
|
readonly defaultVersion: string;
|
|
46
46
|
/** Every registered version → its implementation. Keys equal each entry's `version`. */
|
|
47
47
|
readonly versions: Readonly<Record<string, Impl>>;
|
|
48
|
+
/** The option keys of the kind's spec, for every version (see NodeType.optionKeys). */
|
|
49
|
+
readonly optionKeys?: OptionKeyLists<Spec>;
|
|
48
50
|
/**
|
|
49
51
|
* The version a spec needs when the author named none (`requested` undefined),
|
|
50
52
|
* e.g. a read that sets `resultMode` needs `core.datafabric.read@1.4`. Omit it
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
/** Every key of every member of a union: `keyof (A | B)` is only the keys they share. */
|
|
29
|
+
export type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
|
30
|
+
/**
|
|
31
|
+
* An object literal that names each option key of `T` once, as `true`: no key
|
|
32
|
+
* missing (the mapped keys are required) and no key extra (an object literal's
|
|
33
|
+
* excess-property check). For instance, for `{ a: string; b?: number }`:
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* declareKeys<{ a: string; b?: number }>({ a: true, b: true }) // ok
|
|
37
|
+
* declareKeys<{ a: string; b?: number }>({ a: true }) // tsc: 'b' is missing
|
|
38
|
+
* declareKeys<{ a: string; b?: number }>({ a: true, b: true, c: true }) // tsc: 'c' is not a key
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export type OptionKeySet<T> = {
|
|
42
|
+
readonly [K in KeysOfUnion<T> & string]-?: true;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The option keys of `T`, as a list, checked against `T` by `tsc` (see
|
|
46
|
+
* {@link OptionKeySet}). Declare a family's list with it, never by hand.
|
|
47
|
+
*/
|
|
48
|
+
export declare function declareKeys<T>(keys: OptionKeySet<T>): readonly string[];
|
|
49
|
+
/**
|
|
50
|
+
* The FLOW_UNKNOWN_OPTION refusal for the first key of `bag` that is not in
|
|
51
|
+
* `known`, or `undefined` when every key is known. A key whose value is
|
|
52
|
+
* `undefined` is skipped: it sets nothing, so nothing is dropped. Anything that
|
|
53
|
+
* is not a plain object (an array, an `Expr`, a missing bag) is not judged here.
|
|
54
|
+
*
|
|
55
|
+
* `call` names the option object as the author wrote it, e.g. `http()` or
|
|
56
|
+
* `.loop() options`; `where` places it, e.g. `step "fetch"`.
|
|
57
|
+
*
|
|
58
|
+
* For instance `unknownOptionRefusal({ url: 'x', retryCont: 2 }, HTTP_KEYS, 'http()', 'step "fetch"')`
|
|
59
|
+
* reads `step "fetch": http() has no option "retryCont". This SDK knows: …`, with the
|
|
60
|
+
* suggestion `retryCount` (the CLI prints it as `(did you mean "retryCount"?)`).
|
|
61
|
+
*/
|
|
62
|
+
export declare function unknownOptionRefusal(bag: unknown, known: readonly string[], call: string, where: string): CompileRefusal | undefined;
|
|
@@ -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
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export { Library } from './library.js';
|
|
|
21
21
|
export { Bindings } from './bindings.js';
|
|
22
22
|
export { check } from './check.js';
|
|
23
23
|
export type { Diagnostic } from './check.js';
|
|
24
|
+
export { sdkCapabilities, sdkVersionSatisfies, isSdkVersionFloor } from './sdk-capabilities.js';
|
|
25
|
+
export type { SdkCapabilities } from './sdk-capabilities.js';
|
|
24
26
|
export { casePlan, preserveCaseJson, rule, when } from './case/case-sdk.js';
|
|
25
27
|
export type { CaseRule, CaseRuleInput, CaseRuleGrid, WhenExpression, CaseJsonPreservation, CaseLayout, CaseNodeLayout, PreservedCaseNode, PreservedTaskFields, PreservedVariableLane, CaseRuleType, RuleOpts, BuiltCase, BuiltStage, BuiltTask, TaskKind, UnresolvedReferenceTaskKind, ExternalEventPair, ExternalExecutionMode, ExternalTaskOptions, } from './case/case-sdk.js';
|
|
26
28
|
export { serialize as serializeCase } from './case/serialize.js';
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,9 @@ export { MergeRefusedError as FlowMergeRefusedError } from './merge.js';
|
|
|
24
24
|
export { Library } from './library.js';
|
|
25
25
|
export { Bindings } from './bindings.js';
|
|
26
26
|
export { check } from './check.js';
|
|
27
|
+
// What this installed copy supports, and the version test behind the project
|
|
28
|
+
// floor (`flowSdk.minVersion`) that `flow-sdk` enforces (#1991).
|
|
29
|
+
export { sdkCapabilities, sdkVersionSatisfies, isSdkVersionFloor } from './sdk-capabilities.js';
|
|
27
30
|
// Case authoring API (reference-mode). `casePlan()` exposes only case methods.
|
|
28
31
|
export { casePlan, preserveCaseJson, rule, when } from './case/case-sdk.js';
|
|
29
32
|
export { serialize as serializeCase } from './case/serialize.js';
|
|
@@ -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) => ({
|