@uipath/maestro-builder-sdk 6.120.30 → 6.120.32
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 +51 -51
- package/dist/api-members.md +172 -171
- package/dist/bpmn/bpmn-sdk.d.ts +4 -3
- package/dist/bpmn/declared-vars.d.ts +1 -1
- package/dist/bpmn/declared-vars.js +4 -4
- package/dist/bpmn/decompile.js +3 -3
- package/dist/core/actions.d.ts +16 -0
- package/dist/core/connector-configuration.d.ts +15 -0
- package/dist/core/connector-configuration.js +22 -0
- package/dist/core/refusals.d.ts +1 -0
- package/dist/core/refusals.js +1 -0
- package/dist/decompile.js +10 -0
- package/dist/flow-node-type.d.ts +9 -0
- package/dist/nodes/agent/flow/check.js +1 -0
- package/dist/nodes/agent/flow/inline-agent-lift.js +94 -1
- package/dist/nodes/agent/flow/inline-agent.js +22 -0
- package/dist/nodes/connector/flow/node-type.js +1 -22
- package/package.json +2 -2
package/dist/bpmn/bpmn-sdk.d.ts
CHANGED
|
@@ -1949,10 +1949,11 @@ export interface VarOpts {
|
|
|
1949
1949
|
* Left out, the declaration is written where the platform's own tools put one of
|
|
1950
1950
|
* its kind. A `.var()` belongs to the scope it is declared in — the process id at
|
|
1951
1951
|
* the top level, the sub-process id inside one. A top-level `.input()` belongs to
|
|
1952
|
-
* the process's manual START event and a top-level `.output()` to the END
|
|
1953
|
-
* whose mapping writes it (or the only end event): that is how every Studio Web
|
|
1952
|
+
* the process's manual START event and a top-level `.output()` to the first END
|
|
1953
|
+
* event whose mapping writes it (or the only end event): that is how every Studio Web
|
|
1954
1954
|
* export and converter output declares a process's public contract, and what the
|
|
1955
|
-
* canvas, the entry-point derivation and the graders read it from.
|
|
1955
|
+
* canvas, the entry-point derivation and the graders read it from. When several ends
|
|
1956
|
+
* write an output, reordering them changes its scope unless `elementId` is set. It also decides
|
|
1956
1957
|
* who may READ it: an input scoped to the start event is readable only by that start
|
|
1957
1958
|
* event's own mapping, and an output by nobody. The engine resolves `vars.<id>` by id
|
|
1958
1959
|
* whatever the scope, so a direct read runs, but Studio Web shows "A variable is
|
|
@@ -80,7 +80,7 @@ export declare function nodeDeclaredVars(n: BpmnNode): string[];
|
|
|
80
80
|
* an explicit `elementId`:
|
|
81
81
|
* - `input` → the one root start event with no event definition and no trigger,
|
|
82
82
|
* when there is exactly one; else the process.
|
|
83
|
-
* - `output` → the
|
|
83
|
+
* - `output` → the first root end event whose payload writes `var="<id>"`; else the one
|
|
84
84
|
* root end event, when there is exactly one; else the process.
|
|
85
85
|
* - `inputOutput` → the process (an internal variable is process-level state; the
|
|
86
86
|
* engine's debug variables report lists exactly those).
|
|
@@ -122,7 +122,7 @@ function ownDeclaredVars(n) {
|
|
|
122
122
|
* an explicit `elementId`:
|
|
123
123
|
* - `input` → the one root start event with no event definition and no trigger,
|
|
124
124
|
* when there is exactly one; else the process.
|
|
125
|
-
* - `output` → the
|
|
125
|
+
* - `output` → the first root end event whose payload writes `var="<id>"`; else the one
|
|
126
126
|
* root end event, when there is exactly one; else the process.
|
|
127
127
|
* - `inputOutput` → the process (an internal variable is process-level state; the
|
|
128
128
|
* engine's debug variables report lists exactly those).
|
|
@@ -135,9 +135,9 @@ export function publicDeclarationScope(nodes, processId) {
|
|
|
135
135
|
if (v.direction === 'input')
|
|
136
136
|
return manualStarts.length === 1 ? manualStarts[0].id : processId;
|
|
137
137
|
if (v.direction === 'output') {
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
return
|
|
138
|
+
const writer = ends.find((e) => (e.payload?.outputRows ?? []).some((r) => r.var === v.id));
|
|
139
|
+
if (writer)
|
|
140
|
+
return writer.id;
|
|
141
141
|
return ends.length === 1 ? ends[0].id : processId;
|
|
142
142
|
}
|
|
143
143
|
return processId;
|
package/dist/bpmn/decompile.js
CHANGED
|
@@ -1201,9 +1201,9 @@ function publicDeclarationScopeOf(process, processId) {
|
|
|
1201
1201
|
if (kind === 'input')
|
|
1202
1202
|
return manualStarts.length === 1 ? manualStarts[0].id : processId;
|
|
1203
1203
|
if (kind === 'output') {
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1206
|
-
return
|
|
1204
|
+
const writer = ends.find((el) => (payloadOf(el)?.output ?? []).some((row) => row.var === v.id));
|
|
1205
|
+
if (writer)
|
|
1206
|
+
return writer.id;
|
|
1207
1207
|
return ends.length === 1 ? ends[0].id : processId;
|
|
1208
1208
|
}
|
|
1209
1209
|
return processId;
|
package/dist/core/actions.d.ts
CHANGED
|
@@ -694,6 +694,22 @@ export interface ConnectorToolRef {
|
|
|
694
694
|
version?: string;
|
|
695
695
|
/** Disambiguate a generic operation by OBJECT, exactly as `connector()` does. */
|
|
696
696
|
object?: string;
|
|
697
|
+
/**
|
|
698
|
+
* Values for the operation's fields, by field name, written over what compile
|
|
699
|
+
* derives for each: a body field the model decides (a `{{prompt: "..."}}`
|
|
700
|
+
* chip), a single-value enum's one value, or a query parameter's default. A
|
|
701
|
+
* value is written as given, so a fixed value pins the field, and a chip with
|
|
702
|
+
* other text changes what the model is told.
|
|
703
|
+
*
|
|
704
|
+
* ```ts
|
|
705
|
+
* { kind: 'connector', connector: 'uipath-uipath-airdk', operation: 'web-search',
|
|
706
|
+
* inputs: { num: 10 }, connection: 'genai', folder: 'shared' }
|
|
707
|
+
* ```
|
|
708
|
+
*
|
|
709
|
+
* A name the operation has no field for is refused
|
|
710
|
+
* (`FLOW_AGENT_TOOL_CONNECTOR_INPUT`).
|
|
711
|
+
*/
|
|
712
|
+
inputs?: Record<string, unknown>;
|
|
697
713
|
/** Display label; defaults to the library's own (e.g. `'Create Issue'`). */
|
|
698
714
|
name?: string;
|
|
699
715
|
/**
|
|
@@ -186,3 +186,18 @@ export interface ConfigurationIdentity {
|
|
|
186
186
|
* @returns The object name and activity type, each only when it is a string.
|
|
187
187
|
*/
|
|
188
188
|
export declare function readConfigurationIdentity(configuration: unknown): ConfigurationIdentity;
|
|
189
|
+
/**
|
|
190
|
+
* The object a connector node (a `connector()` step, or an agent's connector
|
|
191
|
+
* tool, which saves the same `inputs.detail`) addresses, when it is the author's choice: a
|
|
192
|
+
* GENERIC operation (`get-record` on `curated_issue`) names only the verb in its
|
|
193
|
+
* node type, so `compile` needs the object back as the `object` option
|
|
194
|
+
* (CONNECTOR_OBJECT_REQUIRED without it, #1614). A CURATED operation's node type
|
|
195
|
+
* is its object, so it gets none. A node whose configuration records no
|
|
196
|
+
* activity type keeps the object it names: compile accepts an object that
|
|
197
|
+
* matches a curated entry, and refuses one that does not, by name.
|
|
198
|
+
*
|
|
199
|
+
* The configuration is read by `readConfigurationIdentity`, which lives beside
|
|
200
|
+
* the writer (`buildConfiguration`); the node's sibling `objectName` is the
|
|
201
|
+
* fallback, as compile writes both.
|
|
202
|
+
*/
|
|
203
|
+
export declare function liftedObject(detail: Record<string, unknown>): string | undefined;
|
|
@@ -433,3 +433,25 @@ export function readConfigurationIdentity(configuration) {
|
|
|
433
433
|
...(activityType !== undefined ? { activityType } : {}),
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* The object a connector node (a `connector()` step, or an agent's connector
|
|
438
|
+
* tool, which saves the same `inputs.detail`) addresses, when it is the author's choice: a
|
|
439
|
+
* GENERIC operation (`get-record` on `curated_issue`) names only the verb in its
|
|
440
|
+
* node type, so `compile` needs the object back as the `object` option
|
|
441
|
+
* (CONNECTOR_OBJECT_REQUIRED without it, #1614). A CURATED operation's node type
|
|
442
|
+
* is its object, so it gets none. A node whose configuration records no
|
|
443
|
+
* activity type keeps the object it names: compile accepts an object that
|
|
444
|
+
* matches a curated entry, and refuses one that does not, by name.
|
|
445
|
+
*
|
|
446
|
+
* The configuration is read by `readConfigurationIdentity`, which lives beside
|
|
447
|
+
* the writer (`buildConfiguration`); the node's sibling `objectName` is the
|
|
448
|
+
* fallback, as compile writes both.
|
|
449
|
+
*/
|
|
450
|
+
export function liftedObject(detail) {
|
|
451
|
+
const identity = readConfigurationIdentity(detail.configuration);
|
|
452
|
+
if (identity.activityType === 'Curated')
|
|
453
|
+
return undefined;
|
|
454
|
+
if (identity.objectName !== undefined)
|
|
455
|
+
return identity.objectName;
|
|
456
|
+
return typeof detail.objectName === 'string' && detail.objectName !== '' ? detail.objectName : undefined;
|
|
457
|
+
}
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -542,6 +542,7 @@ export declare const REFUSALS: {
|
|
|
542
542
|
readonly FLOW_AGENT_TOOL_CLIENTSIDE_NO_NAME: "lint";
|
|
543
543
|
readonly FLOW_AGENT_TOOL_CLIENTSIDE_SCHEMA_TWICE: "lowering";
|
|
544
544
|
readonly FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION: "lint";
|
|
545
|
+
readonly FLOW_AGENT_TOOL_CONNECTOR_INPUT: "lowering";
|
|
545
546
|
readonly FLOW_AGENT_TOOL_HTTP_METHOD: "lint";
|
|
546
547
|
readonly FLOW_AGENT_TOOL_IXP_NO_NAME: "lint";
|
|
547
548
|
readonly FLOW_AGENT_TOOL_IXP_PROJECT_NOT_GUID: "lint";
|
package/dist/core/refusals.js
CHANGED
|
@@ -618,6 +618,7 @@ export const REFUSALS = {
|
|
|
618
618
|
FLOW_AGENT_TOOL_CLIENTSIDE_NO_NAME: 'lint',
|
|
619
619
|
FLOW_AGENT_TOOL_CLIENTSIDE_SCHEMA_TWICE: 'lowering',
|
|
620
620
|
FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION: 'lint',
|
|
621
|
+
FLOW_AGENT_TOOL_CONNECTOR_INPUT: 'lowering',
|
|
621
622
|
FLOW_AGENT_TOOL_HTTP_METHOD: 'lint',
|
|
622
623
|
FLOW_AGENT_TOOL_IXP_NO_NAME: 'lint',
|
|
623
624
|
FLOW_AGENT_TOOL_IXP_PROJECT_NOT_GUID: 'lint',
|
package/dist/decompile.js
CHANGED
|
@@ -827,6 +827,16 @@ function liftRegistered(node, impl = registeredImpl(node), graph) {
|
|
|
827
827
|
flowId: runFlowId,
|
|
828
828
|
definitionOf: (n) => runDefs.get(`${n.type}@${n.typeVersion}`) ?? runDefs.get(n.type),
|
|
829
829
|
carriesOperation: () => runCarriedOperations.has(`${node.type}@${version}`),
|
|
830
|
+
connectorOperation: (key, action, v, object) => {
|
|
831
|
+
if (runLibrary === undefined || !runLibrary.indexes(`uipath.connector.${key}.${action}`, object))
|
|
832
|
+
return undefined;
|
|
833
|
+
try {
|
|
834
|
+
return runLibrary.resolve(key, action, v, object);
|
|
835
|
+
}
|
|
836
|
+
catch {
|
|
837
|
+
return undefined;
|
|
838
|
+
}
|
|
839
|
+
},
|
|
830
840
|
attached: (port, limit = Infinity, accept = () => true) => {
|
|
831
841
|
const found = [];
|
|
832
842
|
for (const e of graph?.outEdges(node.id) ?? []) {
|
package/dist/flow-node-type.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type { CheckOpts } from './check.js';
|
|
|
19
19
|
import type { SerializeOpts } from './serialize.js';
|
|
20
20
|
import type { DeclaredExit, ExitRouting, NoExits } from './core/step-ports.js';
|
|
21
21
|
import type { EventEmitEnv } from './core/event-subscription.js';
|
|
22
|
+
import type { ResolvedConnector } from './core/library.js';
|
|
22
23
|
/**
|
|
23
24
|
* What a Flow node type's `serialize` returns: the node's type-owned fields.
|
|
24
25
|
*
|
|
@@ -352,6 +353,14 @@ export interface FlowDeserializeContext {
|
|
|
352
353
|
* other node.
|
|
353
354
|
*/
|
|
354
355
|
carriesOperation(): boolean;
|
|
356
|
+
/**
|
|
357
|
+
* The connector operation decompile's library resolves `key` / `action` to,
|
|
358
|
+
* at `version` and for `object`: the entry compile resolves the same names
|
|
359
|
+
* against. `undefined` when decompile has no library, or the library has no
|
|
360
|
+
* such entry. For instance an agent's connector tool lift reads which field
|
|
361
|
+
* values compile derives, to print only the ones the file changed.
|
|
362
|
+
*/
|
|
363
|
+
connectorOperation?(key: string, action: string, version?: string, object?: string): ResolvedConnector | undefined;
|
|
355
364
|
/**
|
|
356
365
|
* The nodes attached to this one on an artifact handle (`tool`, `context`,
|
|
357
366
|
* `escalation`, `memory`), in edge order, at most `limit` of them. Their edges
|
|
@@ -66,6 +66,7 @@ export const AGENT_DIAGNOSTICS = {
|
|
|
66
66
|
FLOW_AGENT_TOOL_CLIENTSIDE_NO_NAME: { severity: 'error', summary: 'a client-side tool with no name' },
|
|
67
67
|
FLOW_AGENT_TOOL_CLIENTSIDE_SCHEMA_TWICE: { severity: 'error', summary: 'a client-side tool given both inputs and inputSchema (or returns and outputSchema)' },
|
|
68
68
|
FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION: { severity: 'error', summary: 'a connector tool with no connection or folder' },
|
|
69
|
+
FLOW_AGENT_TOOL_CONNECTOR_INPUT: { severity: 'error', summary: 'a connector tool input naming a field the operation does not have' },
|
|
69
70
|
FLOW_AGENT_TOOL_HTTP_METHOD: { severity: 'error', summary: 'an HTTP-request tool with an unknown method' },
|
|
70
71
|
FLOW_AGENT_TOOL_IXP_NO_NAME: { severity: 'error', summary: 'an IxP tool with no name' },
|
|
71
72
|
FLOW_AGENT_TOOL_IXP_PROJECT_NOT_GUID: { severity: 'error', summary: 'an IxP tool whose projectId is not a uuid' },
|
|
@@ -18,16 +18,49 @@ import { derivedContextSource, derivedEscalationSource, derivedResourceNodeId, d
|
|
|
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
20
|
import { formFieldRowExtra, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, liftFormFieldSettings, sourceFormFieldType, } from '../../../core/form-field-type.js';
|
|
21
|
+
import { missingBindingLabels } from '../../../core/binding-messages.js';
|
|
22
|
+
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
23
|
+
import { liftedObject } from '../../../core/connector-configuration.js';
|
|
21
24
|
import { ownEntry } from '../../../core/own-entry.js';
|
|
22
25
|
import { isInlineAgentFieldType, jsonPathKey, jsonPathSegments } from '../../../core/tool-argument.js';
|
|
23
26
|
import { tsKey as key, tsLiteral, tsNumber, tsObject as objLit, tsOptions as opts, tsText } from '../../../core/ts-literal.js';
|
|
24
27
|
import { wireExprBody } from '../../../core/wire-expr.js';
|
|
25
28
|
import { liftBatchTransformTool, reportUnreadBuiltinTask } from './builtin-tool-lift.js';
|
|
26
29
|
import { resourceSidecar } from './resource-sidecar.js';
|
|
27
|
-
import { BUILTIN_TOOL_DEFS, builtinToolRevision, escalationDef, voiceAgentRevision } from './resources.js';
|
|
30
|
+
import { BUILTIN_TOOL_DEFS, builtinToolRevision, connectorToolDetail, escalationDef, voiceAgentRevision } from './resources.js';
|
|
28
31
|
/** Where the agent's own `inputs` go in the option list: the printer writes them, as expressions. */
|
|
29
32
|
const INPUT_ROWS = Symbol('inputs');
|
|
30
33
|
const isObject = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
34
|
+
/**
|
|
35
|
+
* A connector tool's `inputs`: the field values in its saved `inputs.detail`
|
|
36
|
+
* that compile would not write on its own. With the library entry compile
|
|
37
|
+
* resolves (`rc`), only the values that differ from what it derives
|
|
38
|
+
* (`connectorToolDetail`) are printed, so a compile-written tool prints none.
|
|
39
|
+
* Without one every saved value is printed, so nothing is lost. A saved field
|
|
40
|
+
* the entry does not have is reported, since compile refuses it.
|
|
41
|
+
* For instance a Web Search saved with `num: 10` prints `inputs: { num: 10 }`.
|
|
42
|
+
*/
|
|
43
|
+
function connectorToolInputs(t, detail, rc, ctx) {
|
|
44
|
+
const derived = rc === undefined ? undefined : connectorToolDetail(rc, undefined, undefined, '');
|
|
45
|
+
const entries = [];
|
|
46
|
+
for (const bucket of ['bodyParameters', 'queryParameters', 'pathParameters']) {
|
|
47
|
+
const saved = detail[bucket];
|
|
48
|
+
if (!saved || typeof saved !== 'object' || Array.isArray(saved))
|
|
49
|
+
continue;
|
|
50
|
+
const own = derived?.[bucket];
|
|
51
|
+
for (const [name, value] of Object.entries(saved)) {
|
|
52
|
+
if (derived !== undefined && (own === undefined || !Object.prototype.hasOwnProperty.call(own, name))) {
|
|
53
|
+
ctx.lossy(`connector tool ${JSON.stringify(t.id)} sets ${bucket}.${name}, a field its library entry does not have; `
|
|
54
|
+
+ 'the source leaves it out, and a recompile drops it.');
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (own !== undefined && JSON.stringify(own[name]) === JSON.stringify(value))
|
|
58
|
+
continue;
|
|
59
|
+
entries.push([name, dataSource(value)]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return entries.length === 0 ? undefined : objLit(entries);
|
|
63
|
+
}
|
|
31
64
|
/** The per-instance resource tool kinds (process / api / flow / maestro / agent / function), by node-type prefix. */
|
|
32
65
|
const PROCESS_NS = [
|
|
33
66
|
['uipath.agent.resource.tool.processorchestration.', 'maestro'],
|
|
@@ -56,6 +89,7 @@ function liftableToolFor(agentType) {
|
|
|
56
89
|
return def !== undefined && builtinToolRevision(def, hostOf(agentType), String(n.typeVersion ?? '')) !== undefined;
|
|
57
90
|
}
|
|
58
91
|
return t === 'uipath.agent.resource.tool.clientside'
|
|
92
|
+
|| connectorToolOperation(t) !== undefined
|
|
59
93
|
|| ['mcp.', 'a2a.', 'ixp.'].some((k) => t.startsWith(`uipath.agent.resource.tool.${k}`))
|
|
60
94
|
|| PROCESS_NS.some(([prefix]) => t.startsWith(prefix));
|
|
61
95
|
};
|
|
@@ -76,6 +110,21 @@ function liftableEscalationFor(agentType) {
|
|
|
76
110
|
};
|
|
77
111
|
}
|
|
78
112
|
const QUICK_FORM_ESCALATION = 'uipath.agent.resource.escalation.quick-form';
|
|
113
|
+
const CONNECTOR_TOOL_PREFIX = 'uipath.agent.resource.tool.connector.';
|
|
114
|
+
/**
|
|
115
|
+
* The connector key and operation a connector tool's node type names, the
|
|
116
|
+
* inverse of `connectorToolDef` (`uipath.agent.resource.tool.connector.<key>.<op>`,
|
|
117
|
+
* the same tail as a `connector()` step's `uipath.connector.<key>.<op>`). For
|
|
118
|
+
* instance `….connector.uipath-uipath-airdk.web-search` is
|
|
119
|
+
* `{ connector: 'uipath-uipath-airdk', operation: 'web-search' }`.
|
|
120
|
+
*/
|
|
121
|
+
function connectorToolOperation(type) {
|
|
122
|
+
if (!type.startsWith(CONNECTOR_TOOL_PREFIX))
|
|
123
|
+
return undefined;
|
|
124
|
+
const rest = type.slice(CONNECTOR_TOOL_PREFIX.length);
|
|
125
|
+
const dot = rest.lastIndexOf('.');
|
|
126
|
+
return dot <= 0 || dot === rest.length - 1 ? undefined : { connector: rest.slice(0, dot), operation: rest.slice(dot + 1) };
|
|
127
|
+
}
|
|
79
128
|
const BUILTIN_PREFIX = 'uipath.agent.resource.tool.builtin.';
|
|
80
129
|
const VOICE_AGENT_TYPE = 'uipath.agent.voice';
|
|
81
130
|
/** The resource host an agent of node type `agentType` is. */
|
|
@@ -860,6 +909,50 @@ export function liftAgentResources(node, ctx, withMemory, agentInputs = []) {
|
|
|
860
909
|
['name', tsLiteral(rPlain(t, 'name') ?? '')],
|
|
861
910
|
]);
|
|
862
911
|
}
|
|
912
|
+
const op = connectorToolOperation(type);
|
|
913
|
+
if (op !== undefined) {
|
|
914
|
+
// A connector tool: the operation is the node type's tail, the revision its
|
|
915
|
+
// `typeVersion`, and the connection and folder the ones its `inputs.detail`
|
|
916
|
+
// names, read as a `connector()` step's lift reads them.
|
|
917
|
+
const detail = (ti.detail !== null && typeof ti.detail === 'object' && !Array.isArray(ti.detail)
|
|
918
|
+
? ti.detail : {});
|
|
919
|
+
const label = (v) => (typeof v === 'string' && v !== '' ? v : undefined);
|
|
920
|
+
const connection = label(detail.connectionId);
|
|
921
|
+
const folder = label(detail.connectionFolderKey);
|
|
922
|
+
const missing = missingBindingLabels({ connection, folder });
|
|
923
|
+
if (missing.length > 0) {
|
|
924
|
+
ctx.warn(`connector tool ${JSON.stringify(t.id)} on agent ${JSON.stringify(node.id)} has no ${missing.join(' or ')} `
|
|
925
|
+
+ `in the .flow. The source leaves ${missing.length > 1 ? 'them' : 'it'} out, and check refuses the tool `
|
|
926
|
+
+ `(FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION) until it names both labels: run `
|
|
927
|
+
+ `\`${prepareCommand(op.connector, op.operation)}\`, then pass \`connection\` and \`folder\`.`);
|
|
928
|
+
}
|
|
929
|
+
// Compile labels the node with the library's label and describes it with
|
|
930
|
+
// the library's text (`connectorToolDef`, `connectorToolDescription`); the
|
|
931
|
+
// definition the file carries for the node is that library entry, so a
|
|
932
|
+
// label or description that differs from it is the author's.
|
|
933
|
+
const def = ctx.definitionOf(t);
|
|
934
|
+
const defLabel = label(def?.display?.label);
|
|
935
|
+
const defDescription = label(def?.display?.description)?.replace(/^\([^)]*\) /, '');
|
|
936
|
+
const name = label(t.display?.label);
|
|
937
|
+
const description = label(t.display?.description);
|
|
938
|
+
// Always pinned: compile resolves an unpinned tool against the library's
|
|
939
|
+
// current revision, which need not be the one the file saved.
|
|
940
|
+
const version = label(t.typeVersion);
|
|
941
|
+
const object = liftedObject(detail);
|
|
942
|
+
const inputs = connectorToolInputs(t, detail, ctx.connectorOperation?.(op.connector, op.operation, version, object), ctx);
|
|
943
|
+
return toolOpts(t, { kind: 'connector', ...op }, [
|
|
944
|
+
['kind', tsLiteral('connector')],
|
|
945
|
+
['connector', tsLiteral(op.connector)],
|
|
946
|
+
['operation', tsLiteral(op.operation)],
|
|
947
|
+
['version', version !== undefined ? tsLiteral(version) : undefined],
|
|
948
|
+
['object', object !== undefined ? tsLiteral(object) : undefined],
|
|
949
|
+
['inputs', inputs],
|
|
950
|
+
['name', name !== undefined && name !== defLabel ? tsLiteral(name) : undefined],
|
|
951
|
+
['description', description !== undefined && description !== defDescription ? tsLiteral(description) : undefined],
|
|
952
|
+
['connection', connection !== undefined ? tsLiteral(connection) : undefined],
|
|
953
|
+
['folder', folder !== undefined ? tsLiteral(folder) : undefined],
|
|
954
|
+
]);
|
|
955
|
+
}
|
|
863
956
|
// The per-instance resource kinds (process / api / flow / maestro / agent /
|
|
864
957
|
// function): the key is the node type's tail, the rest is a binding pair.
|
|
865
958
|
const ns = PROCESS_NS.find(([prefix]) => type.startsWith(prefix));
|
|
@@ -182,6 +182,27 @@ export function serializeInlineAgent(s, ctx) {
|
|
|
182
182
|
attach,
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Write a connector tool's `inputs` over the request buckets compile derived
|
|
187
|
+
* (`connectorToolDetail`), each into the bucket its field lives in. A name no
|
|
188
|
+
* bucket holds is a field the operation does not have, refused rather than
|
|
189
|
+
* dropped. For instance `{ num: 10 }` on Web Search sets
|
|
190
|
+
* `detail.bodyParameters.num` to `10` in place of its prompt chip.
|
|
191
|
+
*/
|
|
192
|
+
function applyConnectorToolInputs(detail, inputs, where) {
|
|
193
|
+
if (inputs === undefined)
|
|
194
|
+
return;
|
|
195
|
+
const buckets = ['bodyParameters', 'queryParameters', 'pathParameters'].filter((b) => detail[b] && typeof detail[b] === 'object');
|
|
196
|
+
for (const [name, value] of Object.entries(inputs)) {
|
|
197
|
+
const bucket = buckets.find((b) => Object.prototype.hasOwnProperty.call(detail[b], name));
|
|
198
|
+
if (bucket === undefined) {
|
|
199
|
+
const known = buckets.flatMap((b) => Object.keys(detail[b]));
|
|
200
|
+
throw new CompileRefusal('FLOW_AGENT_TOOL_CONNECTOR_INPUT', `${where} sets input ${JSON.stringify(name)}, which the operation has no field for. `
|
|
201
|
+
+ `Its fields: ${known.length ? known.map((k) => JSON.stringify(k)).join(', ') : '(none)'}.`);
|
|
202
|
+
}
|
|
203
|
+
detail[bucket][name] = jsonClone(value);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
185
206
|
/**
|
|
186
207
|
* Each process tool's arguments, and each built-in's task and settings, judged
|
|
187
208
|
* before the agent's resources are attached: `toolArgument` is the first one
|
|
@@ -480,6 +501,7 @@ export function attachAgentResources(s, ctx, source, who, toolVariables = new Ma
|
|
|
480
501
|
...(folder !== undefined ? { folderKey: folder } : {}),
|
|
481
502
|
});
|
|
482
503
|
const detail = connectorToolDetail(rc, conn, folder, `${step}Tool`);
|
|
504
|
+
applyConnectorToolInputs(detail, tr.inputs, where);
|
|
483
505
|
extraInputs = { detail };
|
|
484
506
|
connectorTool = {
|
|
485
507
|
rc, detail, name: label,
|
|
@@ -2,7 +2,7 @@ import { CONNECTOR_OPTION_KEYS } from '../../../core/connector-option-keys.js';
|
|
|
2
2
|
import { BindingRefusal, bindingMissingMessage, missingBindingLabels } from '../../../core/binding-messages.js';
|
|
3
3
|
import { PULL_COMMAND, prepareCommand } from '../../../core/cli-spelling.js';
|
|
4
4
|
import { carriedConnector, carriedDefinitionMismatch, carriedOperationOf, carriedOperationRefusal, } from '../../../core/carried-connector-operation.js';
|
|
5
|
-
import { buildConfiguration,
|
|
5
|
+
import { buildConfiguration, liftedObject } from '../../../core/connector-configuration.js';
|
|
6
6
|
import { libraryExecution } from '../../../core/external-execution.js';
|
|
7
7
|
import { CONNECTOR_INPUT_MISSING, FLOW_EXPR_DIALECT, buildConnectorInputs, replayInputsOf, transportHttpMethod } from '../../../core/connector-inputs.js';
|
|
8
8
|
import { ConnectorResolveError } from '../../../core/connector-resolve-error.js';
|
|
@@ -297,27 +297,6 @@ function liftValue(v, ctx) {
|
|
|
297
297
|
return v;
|
|
298
298
|
return raw.startsWith('=js:') ? new Expr(raw.slice(4)) : raw;
|
|
299
299
|
}
|
|
300
|
-
/**
|
|
301
|
-
* The object a connector node addresses, when it is the author's choice: a
|
|
302
|
-
* GENERIC operation (`get-record` on `curated_issue`) names only the verb in its
|
|
303
|
-
* node type, so `compile` needs the object back as the `object` option
|
|
304
|
-
* (CONNECTOR_OBJECT_REQUIRED without it, #1614). A CURATED operation's node type
|
|
305
|
-
* is its object, so it gets none. A node whose configuration records no
|
|
306
|
-
* activity type keeps the object it names: compile accepts an object that
|
|
307
|
-
* matches a curated entry, and refuses one that does not, by name.
|
|
308
|
-
*
|
|
309
|
-
* The configuration is read by `readConfigurationIdentity`, which lives beside
|
|
310
|
-
* the writer (`buildConfiguration`); the node's sibling `objectName` is the
|
|
311
|
-
* fallback, as compile writes both.
|
|
312
|
-
*/
|
|
313
|
-
function liftedObject(detail) {
|
|
314
|
-
const identity = readConfigurationIdentity(detail.configuration);
|
|
315
|
-
if (identity.activityType === 'Curated')
|
|
316
|
-
return undefined;
|
|
317
|
-
if (identity.objectName !== undefined)
|
|
318
|
-
return identity.objectName;
|
|
319
|
-
return typeof detail.objectName === 'string' && detail.objectName !== '' ? detail.objectName : undefined;
|
|
320
|
-
}
|
|
321
300
|
function liftConnector(node, ctx) {
|
|
322
301
|
const n = node;
|
|
323
302
|
const split = splitOperation(n.type);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.120.
|
|
3
|
+
"version": "6.120.32",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"@types/node": "^22.7.0",
|
|
125
125
|
"esbuild": "^0.28.1"
|
|
126
126
|
},
|
|
127
|
-
"gitref": "
|
|
127
|
+
"gitref": "d7c435b08129ee788a1ece08f4ac3dd75e725a9e"
|
|
128
128
|
}
|