@uipath/maestro-builder-sdk 6.93.8 → 6.94.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 +73 -72
- package/dist/api-members.md +285 -283
- package/dist/bpmn/bpmn-sdk.d.ts +61 -41
- package/dist/bpmn/bpmn-sdk.js +94 -68
- package/dist/bpmn/check.js +18 -1
- package/dist/bpmn/managed-http.d.ts +46 -5
- package/dist/bpmn/managed-http.js +55 -15
- package/dist/bpmn/serialize.js +3 -1
- package/dist/bpmn/typed-node.d.ts +2 -2
- package/dist/bpmn/typed-node.js +3 -3
- package/dist/bpmn-api.md +5 -5
- package/dist/core/actions.d.ts +43 -4
- package/dist/core/agent-resource-identity.d.ts +17 -0
- package/dist/core/agent-resource-identity.js +23 -0
- package/dist/core/refusals.d.ts +10 -0
- package/dist/core/refusals.js +10 -0
- package/dist/decompile.d.ts +4 -1
- package/dist/merge-sidecars.js +13 -4
- package/dist/nodes/agent/flow/builtin-tool-lift.d.ts +60 -0
- package/dist/nodes/agent/flow/builtin-tool-lift.js +255 -0
- package/dist/nodes/agent/flow/check.d.ts +1 -1
- package/dist/nodes/agent/flow/check.js +115 -11
- package/dist/nodes/agent/flow/inline-agent-lift.js +52 -40
- package/dist/nodes/agent/flow/inline-agent.d.ts +13 -7
- package/dist/nodes/agent/flow/inline-agent.js +66 -18
- package/dist/nodes/agent/flow/node-type.js +5 -5
- package/dist/nodes/agent/flow/resource-sidecar.d.ts +22 -0
- package/dist/nodes/agent/flow/resource-sidecar.js +25 -0
- package/dist/nodes/agent/flow/resources.d.ts +76 -8
- package/dist/nodes/agent/flow/resources.js +345 -39
- package/dist/nodes/ai-patterns/flow/spec.d.ts +1 -7
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContextIndexRef, EscalationRef, ProcessToolKind, ToolArgument } from '../../../core/actions.js';
|
|
2
|
+
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
2
3
|
import type { ResolvedConnector } from '../../../core/library.js';
|
|
3
4
|
import type { ProcessResourceSubType } from '../../../core/process-resource.js';
|
|
4
5
|
/** The inline (autonomous) agent's node type — fixed, not per-instance. */
|
|
@@ -45,6 +46,68 @@ export declare function contextIndexDef(spec: {
|
|
|
45
46
|
* `mode: 'text-builder'` by default.
|
|
46
47
|
*/
|
|
47
48
|
export declare function renderContextQuery(query: unknown, render: (value: unknown) => unknown): Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* Render a built-in tool's task (`summarize`, `batchtransform`) into the node's
|
|
51
|
+
* MODE-TAGGED `query`, from the canvas's sources (`BuiltinToolQuery`):
|
|
52
|
+
* - omitted: Empty, `{ mode: 'prompt' }` with every value empty;
|
|
53
|
+
* - a string or `{ prompt }`: Prompt, its text the `promptValue`;
|
|
54
|
+
* - `{ value }`: Fixed value, `{ mode: 'text-builder' }` with the task as the
|
|
55
|
+
* `textValue`;
|
|
56
|
+
* - `{ variable }` holding a single reference: Variable, `{ mode: 'variable' }`
|
|
57
|
+
* with the reference as the `argumentPath`, in the canvas's own `$vars.<path>`
|
|
58
|
+
* form (what its variable picker stores, and what its load path rewrites a
|
|
59
|
+
* sidecar's `{{<flatName>}}` back to). Its agent input is
|
|
60
|
+
* {@link builtinToolQueryRef}'s.
|
|
61
|
+
*
|
|
62
|
+
* Only a plain object whose single key is `prompt`, `value` or `variable` is a
|
|
63
|
+
* named form. A string or a flow expression keeps the meaning
|
|
64
|
+
* {@link renderContextQuery} gives it, so a flow that compiled before compiles
|
|
65
|
+
* the same: a bare expression is still a `text-builder` query with the
|
|
66
|
+
* expression's text.
|
|
67
|
+
*
|
|
68
|
+
* A plain object compile cannot write, and a `{ variable }` that is not one
|
|
69
|
+
* reference, are {@link builtinToolQueryRefusal}'s, which the agent holds and
|
|
70
|
+
* throws before anything is written; they render here as Empty, so the tool
|
|
71
|
+
* is attached like any other while the rest of the agent is judged.
|
|
72
|
+
*/
|
|
73
|
+
export declare function renderBuiltinToolQuery(query: unknown, render: (value: unknown) => unknown): Record<string, unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* The agent input a built-in tool's task Variable binds: the single reference in
|
|
76
|
+
* `{ variable }`, under its flat name, as `agentInputPlan` takes a tool's
|
|
77
|
+
* references. Undefined for every other source, and for a `{ variable }` that is
|
|
78
|
+
* not one reference.
|
|
79
|
+
*/
|
|
80
|
+
export declare function builtinToolQueryRef(query: unknown, render: (value: unknown) => unknown): {
|
|
81
|
+
flatName: string;
|
|
82
|
+
binding: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The refusal for a built-in's task compile cannot write (a lowering refusal:
|
|
86
|
+
* `compile` runs no lint), or undefined for one it can:
|
|
87
|
+
* - FLOW_AGENT_BUILTIN_QUERY_SOURCE: a plain object that is not exactly
|
|
88
|
+
* `{ prompt }`, `{ value }` or `{ variable }` (no source key, more than one,
|
|
89
|
+
* or a key beside its source), which would otherwise reach the model as its
|
|
90
|
+
* JSON in a Prompt;
|
|
91
|
+
* - FLOW_AGENT_BUILTIN_COMPOSITE_REF: a `{ variable }` that is not one
|
|
92
|
+
* reference, a computed expression or a constant, which has no agent input
|
|
93
|
+
* to name, so the task would never reach the tool.
|
|
94
|
+
* A string or a flow expression is always writable. `where` names the tool.
|
|
95
|
+
*/
|
|
96
|
+
export declare function builtinToolQueryRefusal(query: unknown, where: string, render: (value: unknown) => unknown): CompileRefusal | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* The Batch Transform settings compile cannot write on a built-in, or
|
|
99
|
+
* undefined: FLOW_AGENT_BUILTIN_SETTING_NOT_APPLICABLE for `outputColumns` or
|
|
100
|
+
* `webSearchGrounding` on a built-in whose definition (`defaults`, its
|
|
101
|
+
* `inputDefaults`) does not declare them, which the .flow would drop; and
|
|
102
|
+
* FLOW_AGENT_BATCH_TRANSFORM_GROUNDING for a grounding the node's select does
|
|
103
|
+
* not offer, which `resource.json`'s capitalized `Enabled`/`Disabled` would
|
|
104
|
+
* rewrite. Both are lowering refusals. `where` names the tool.
|
|
105
|
+
*/
|
|
106
|
+
export declare function builtinToolSettingRefusal(tool: {
|
|
107
|
+
tool: string;
|
|
108
|
+
outputColumns?: unknown;
|
|
109
|
+
webSearchGrounding?: unknown;
|
|
110
|
+
}, defaults: Record<string, unknown>, where: string): CompileRefusal | undefined;
|
|
48
111
|
/**
|
|
49
112
|
* The `resources/<id>/resource.json` an inline agent's context index needs.
|
|
50
113
|
*
|
|
@@ -144,11 +207,13 @@ export declare const enumValue: (v: unknown) => string;
|
|
|
144
207
|
* resource `query` is VARIANT-tagged where the node's is MODE-tagged, and its
|
|
145
208
|
* enums are capitalized (`Inline`, `Enabled`). `analyze-attachments` declares
|
|
146
209
|
* the model-facing call contract (`attachments` + `analysisTask` → `analysis`);
|
|
147
|
-
* `deep-rag`
|
|
148
|
-
*
|
|
210
|
+
* `deep-rag` declares empty schemas and carries its configuration in
|
|
211
|
+
* `properties.settings`. `batch-transform` is written as the canvas writes it
|
|
212
|
+
* instead ({@link batchTransformResourceJson}).
|
|
149
213
|
*/
|
|
150
214
|
export declare function builtinToolResourceJson(tool: string, label: string, inputs: Record<string, any>, spec: {
|
|
151
215
|
id: string;
|
|
216
|
+
canvasNodeId: string;
|
|
152
217
|
}): Record<string, unknown> | undefined;
|
|
153
218
|
/**
|
|
154
219
|
* The six request fields of the HTTP-request tool, in the node's (and the
|
|
@@ -232,9 +297,10 @@ export declare function escalationResourceJson(esc: EscalationRef, spec: {
|
|
|
232
297
|
* `allowedTargets: [{ nodeType: 'uipath.agent.resource.tool.*' }]`.
|
|
233
298
|
*
|
|
234
299
|
* `withVoice` adds the voice agent as a source, which the designer writes on
|
|
235
|
-
* every tool it places today (#1670). The bundled built-in tools at 1.1
|
|
236
|
-
* the exception: flow-core froze that
|
|
237
|
-
* the same definition with it
|
|
300
|
+
* every tool it places today (#1670). The bundled built-in tools at 1.1
|
|
301
|
+
* (`analyzefiles`, `summarize`) are the exception: flow-core froze that
|
|
302
|
+
* version's handle without it, and 1.2 is the same definition with it
|
|
303
|
+
* (`voiceAgentRevision`). `batchtransform` is bundled at 1.2, with it.
|
|
238
304
|
*/
|
|
239
305
|
export declare function toolInputHandle(withVoice?: boolean): any;
|
|
240
306
|
/**
|
|
@@ -243,6 +309,8 @@ export declare function toolInputHandle(withVoice?: boolean): any;
|
|
|
243
309
|
* voice agent as a source, and its 1.2 of each is that definition with the
|
|
244
310
|
* voice agent added (`addVoiceAgentToInputHandleSources`, flow-core's
|
|
245
311
|
* migration-helpers.ts). For instance `builtin.analyzefiles` 1.1 becomes 1.2.
|
|
312
|
+
* A definition whose input handle already lists the voice agent
|
|
313
|
+
* (`builtin.batchtransform`, bundled at 1.2) is its own revision.
|
|
246
314
|
*/
|
|
247
315
|
export declare function voiceAgentRevision(def: any): any;
|
|
248
316
|
/** A `{ name: type }` field map as the JSON-schema object the platform stores. */
|
|
@@ -250,9 +318,9 @@ export declare function fieldSchema(fields: Record<string, string> | undefined):
|
|
|
250
318
|
/**
|
|
251
319
|
* The definitions for the three platform BUILT-IN tools, transcribed from
|
|
252
320
|
* `uip maestro flow registry get uipath.agent.resource.tool.builtin.<name>`
|
|
253
|
-
* (2026-07-31, version 1.1
|
|
254
|
-
*
|
|
255
|
-
* bundled.
|
|
321
|
+
* (2026-07-31, version 1.1; `batchtransform` 1.2 since 2026-11-02, see its
|
|
322
|
+
* entry). These are fixed types — no tenant resource behind them — so unlike
|
|
323
|
+
* every other tool kind the def CAN be bundled.
|
|
256
324
|
*
|
|
257
325
|
* One wrinkle carried faithfully rather than smoothed over: the three defs
|
|
258
326
|
* disagree about where the node's `source` identity lives. `analyzefiles`
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
* definition and file is unchanged.
|
|
8
8
|
*/
|
|
9
9
|
import ixpDefinition from '../../../core/ixp-definition.json' with { type: 'json' };
|
|
10
|
-
import { JOB_ATTACHMENT_REF, jobAttachmentDefinition } from '../../../core/agent-sidecar.js';
|
|
10
|
+
import { JOB_ATTACHMENT_REF, agentInputRef, jobAttachmentDefinition } from '../../../core/agent-sidecar.js';
|
|
11
11
|
import { BUILTIN_TOOL_TYPE, CONNECTOR_TOOL_RESOURCE_TYPE, HTTP_REQUEST_TOOL_TYPE, INTERNAL_TOOL_RESOURCE_TYPE, TOOL_RESOURCE_TYPE, } from '../../../core/agent-tool-resources.js';
|
|
12
|
+
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
12
13
|
import { buildConfiguration } from '../../../core/connector-configuration.js';
|
|
13
14
|
import { ESCALATION_DOTNET_TYPE } from '../../../core/dotnet-types.js';
|
|
14
15
|
import { multipartBodyFieldName, transportHttpMethod } from '../../../core/connector-inputs.js';
|
|
15
16
|
import { CONTEXT_INDEX_DEFAULTS, CONTEXT_INDEX_DEFAULT_FILE_EXTENSION, contextIndexType } from '../../../core/context-index.js';
|
|
17
|
+
import { flatNameOf } from '../../../core/expr.js';
|
|
16
18
|
import { formFieldJsonSchema } from '../../../core/form-field-type.js';
|
|
17
19
|
import { jsonClone } from '../../../core/json-clone.js';
|
|
18
20
|
import { ownEntry } from '../../../core/own-entry.js';
|
|
@@ -124,6 +126,176 @@ export function renderContextQuery(query, render) {
|
|
|
124
126
|
}
|
|
125
127
|
return { ...base, promptValue: asText };
|
|
126
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Render a built-in tool's task (`summarize`, `batchtransform`) into the node's
|
|
131
|
+
* MODE-TAGGED `query`, from the canvas's sources (`BuiltinToolQuery`):
|
|
132
|
+
* - omitted: Empty, `{ mode: 'prompt' }` with every value empty;
|
|
133
|
+
* - a string or `{ prompt }`: Prompt, its text the `promptValue`;
|
|
134
|
+
* - `{ value }`: Fixed value, `{ mode: 'text-builder' }` with the task as the
|
|
135
|
+
* `textValue`;
|
|
136
|
+
* - `{ variable }` holding a single reference: Variable, `{ mode: 'variable' }`
|
|
137
|
+
* with the reference as the `argumentPath`, in the canvas's own `$vars.<path>`
|
|
138
|
+
* form (what its variable picker stores, and what its load path rewrites a
|
|
139
|
+
* sidecar's `{{<flatName>}}` back to). Its agent input is
|
|
140
|
+
* {@link builtinToolQueryRef}'s.
|
|
141
|
+
*
|
|
142
|
+
* Only a plain object whose single key is `prompt`, `value` or `variable` is a
|
|
143
|
+
* named form. A string or a flow expression keeps the meaning
|
|
144
|
+
* {@link renderContextQuery} gives it, so a flow that compiled before compiles
|
|
145
|
+
* the same: a bare expression is still a `text-builder` query with the
|
|
146
|
+
* expression's text.
|
|
147
|
+
*
|
|
148
|
+
* A plain object compile cannot write, and a `{ variable }` that is not one
|
|
149
|
+
* reference, are {@link builtinToolQueryRefusal}'s, which the agent holds and
|
|
150
|
+
* throws before anything is written; they render here as Empty, so the tool
|
|
151
|
+
* is attached like any other while the rest of the agent is judged.
|
|
152
|
+
*/
|
|
153
|
+
export function renderBuiltinToolQuery(query, render) {
|
|
154
|
+
const named = namedQuerySource(query);
|
|
155
|
+
if (named === undefined)
|
|
156
|
+
return renderContextQuery(isPlainObject(query) ? undefined : query, render);
|
|
157
|
+
const base = { mode: 'prompt', textValue: '', promptValue: '', argumentPath: '' };
|
|
158
|
+
if (named.source === 'variable') {
|
|
159
|
+
const ref = agentInputRef(render(named.text));
|
|
160
|
+
if (ref === undefined)
|
|
161
|
+
return base;
|
|
162
|
+
return { ...base, mode: 'variable', argumentPath: ref.binding.slice('=js:'.length).trim() };
|
|
163
|
+
}
|
|
164
|
+
const rendered = render(named.text);
|
|
165
|
+
const text = typeof rendered === 'string' ? rendered : JSON.stringify(rendered);
|
|
166
|
+
return named.source === 'value'
|
|
167
|
+
? { ...base, mode: 'text-builder', textValue: text }
|
|
168
|
+
: { ...base, promptValue: text };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The agent input a built-in tool's task Variable binds: the single reference in
|
|
172
|
+
* `{ variable }`, under its flat name, as `agentInputPlan` takes a tool's
|
|
173
|
+
* references. Undefined for every other source, and for a `{ variable }` that is
|
|
174
|
+
* not one reference.
|
|
175
|
+
*/
|
|
176
|
+
export function builtinToolQueryRef(query, render) {
|
|
177
|
+
const named = namedQuerySource(query);
|
|
178
|
+
return named?.source === 'variable' ? agentInputRef(render(named.text)) : undefined;
|
|
179
|
+
}
|
|
180
|
+
/** `{ prompt }`, `{ value }` or `{ variable }` as a `BuiltinToolQuery` spells it, or undefined for any other value. */
|
|
181
|
+
function namedQuerySource(query) {
|
|
182
|
+
if (!isPlainObject(query))
|
|
183
|
+
return undefined;
|
|
184
|
+
const keys = Object.keys(query);
|
|
185
|
+
if (keys.length !== 1 || (keys[0] !== 'prompt' && keys[0] !== 'value' && keys[0] !== 'variable'))
|
|
186
|
+
return undefined;
|
|
187
|
+
return { source: keys[0], text: query[keys[0]] };
|
|
188
|
+
}
|
|
189
|
+
/** An object literal: not an array, and not a flow expression (an `Expr` is a class instance). */
|
|
190
|
+
function isPlainObject(value) {
|
|
191
|
+
if (value === null || typeof value !== 'object')
|
|
192
|
+
return false;
|
|
193
|
+
const proto = Object.getPrototypeOf(value);
|
|
194
|
+
return proto === Object.prototype || proto === null;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The refusal for a built-in's task compile cannot write (a lowering refusal:
|
|
198
|
+
* `compile` runs no lint), or undefined for one it can:
|
|
199
|
+
* - FLOW_AGENT_BUILTIN_QUERY_SOURCE: a plain object that is not exactly
|
|
200
|
+
* `{ prompt }`, `{ value }` or `{ variable }` (no source key, more than one,
|
|
201
|
+
* or a key beside its source), which would otherwise reach the model as its
|
|
202
|
+
* JSON in a Prompt;
|
|
203
|
+
* - FLOW_AGENT_BUILTIN_COMPOSITE_REF: a `{ variable }` that is not one
|
|
204
|
+
* reference, a computed expression or a constant, which has no agent input
|
|
205
|
+
* to name, so the task would never reach the tool.
|
|
206
|
+
* A string or a flow expression is always writable. `where` names the tool.
|
|
207
|
+
*/
|
|
208
|
+
export function builtinToolQueryRefusal(query, where, render) {
|
|
209
|
+
if (!isPlainObject(query))
|
|
210
|
+
return undefined;
|
|
211
|
+
const named = namedQuerySource(query);
|
|
212
|
+
if (named?.source === 'variable') {
|
|
213
|
+
const rendered = render(named.text);
|
|
214
|
+
return agentInputRef(rendered) === undefined ? compositeQueryRef(rendered, where) : undefined;
|
|
215
|
+
}
|
|
216
|
+
if (named !== undefined)
|
|
217
|
+
return undefined;
|
|
218
|
+
const keys = Object.keys(query);
|
|
219
|
+
return new CompileRefusal('FLOW_AGENT_BUILTIN_QUERY_SOURCE', `${where}: a task object names exactly one source, \`prompt\`, \`value\` or \`variable\`, and nothing beside `
|
|
220
|
+
+ `it; this one has ${keys.length === 0 ? 'no keys' : `the keys ${keys.map((k) => JSON.stringify(k)).join(', ')}`}. `
|
|
221
|
+
+ `Write the task as a string or \`{ prompt: '…' }\` (Prompt: the model writes it, guided by the text), `
|
|
222
|
+
+ `\`{ value: '…' }\` (Fixed value: the task itself) or \`{ variable: <reference> }\` (Variable: a flow value, `
|
|
223
|
+
+ `read at run time), or leave \`query\` out (Empty).`, `query: { value: 'Classify each row' }`);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The Batch Transform settings compile cannot write on a built-in, or
|
|
227
|
+
* undefined: FLOW_AGENT_BUILTIN_SETTING_NOT_APPLICABLE for `outputColumns` or
|
|
228
|
+
* `webSearchGrounding` on a built-in whose definition (`defaults`, its
|
|
229
|
+
* `inputDefaults`) does not declare them, which the .flow would drop; and
|
|
230
|
+
* FLOW_AGENT_BATCH_TRANSFORM_GROUNDING for a grounding the node's select does
|
|
231
|
+
* not offer, which `resource.json`'s capitalized `Enabled`/`Disabled` would
|
|
232
|
+
* rewrite. Both are lowering refusals. `where` names the tool.
|
|
233
|
+
*/
|
|
234
|
+
export function builtinToolSettingRefusal(tool, defaults, where) {
|
|
235
|
+
const misplaced = ['outputColumns', 'webSearchGrounding']
|
|
236
|
+
.filter((k) => !(k in defaults) && tool[k] !== undefined);
|
|
237
|
+
if (misplaced.length) {
|
|
238
|
+
const them = misplaced.length > 1 ? 'them' : 'it';
|
|
239
|
+
return new CompileRefusal('FLOW_AGENT_BUILTIN_SETTING_NOT_APPLICABLE', `${where} sets ${misplaced.map((k) => `\`${k}\``).join(' and ')}, which its node's definition does not `
|
|
240
|
+
+ `declare (only batchtransform has them), so the .flow would drop ${them}. Remove ${them}, or use `
|
|
241
|
+
+ `{ kind: 'builtin', tool: 'batchtransform' } to add columns to a CSV file.`);
|
|
242
|
+
}
|
|
243
|
+
const grounding = tool.webSearchGrounding;
|
|
244
|
+
if ('webSearchGrounding' in defaults && grounding !== undefined && grounding !== 'enabled' && grounding !== 'disabled') {
|
|
245
|
+
return new CompileRefusal('FLOW_AGENT_BATCH_TRANSFORM_GROUNDING', `${where} sets \`webSearchGrounding\` to ${JSON.stringify(grounding) ?? String(grounding)}, which the node's `
|
|
246
|
+
+ `select does not offer. resource.json writes the setting as 'Enabled' or 'Disabled', so it has no value for `
|
|
247
|
+
+ `this one. Write 'enabled' or 'disabled', or leave it out for the default, 'enabled'.`, `webSearchGrounding: 'disabled'`);
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Why a `{ variable }` task cannot be written: its value is not one reference,
|
|
253
|
+
* so it has no agent input to name (`check`'s `FLOW_AGENT_BUILTIN_COMPOSITE_REF`,
|
|
254
|
+
* the twin of `INLINE_AGENT_COMPOSITE_INPUT`). `rendered` is the value as
|
|
255
|
+
* serialize renders it: a computed expression's `=js:` text, or a constant.
|
|
256
|
+
*/
|
|
257
|
+
function compositeQueryRef(rendered, where) {
|
|
258
|
+
const computed = typeof rendered === 'string' && rendered.startsWith('=js:');
|
|
259
|
+
const what = computed
|
|
260
|
+
? `the computed expression \`${rendered.slice('=js:'.length).trim()}\``
|
|
261
|
+
: `the constant ${JSON.stringify(rendered) ?? String(rendered)}`;
|
|
262
|
+
return new CompileRefusal('FLOW_AGENT_BUILTIN_COMPOSITE_REF', `${where}: the task's \`variable\` is ${what}, not a single flow reference. A Variable task is bound to `
|
|
263
|
+
+ `the agent input named after the one reference path it reads (\`$vars.a.output.b\` → \`a__output__b\`), `
|
|
264
|
+
+ `so this one has no input to name and the task would never reach the tool. `
|
|
265
|
+
+ (computed
|
|
266
|
+
? 'Compute the task in a script step first and bind that step\'s output.'
|
|
267
|
+
: 'A task known when the flow is written is a fixed `value`.'), computed
|
|
268
|
+
? `query: { variable: out('task') }`
|
|
269
|
+
: typeof rendered === 'string' ? `query: { value: ${JSON.stringify(rendered)} }` : `query: { variable: out('<step>', '<field>') }`);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* A built-in's node `query` as the resource's VARIANT-tagged one, as the
|
|
273
|
+
* canvas's `mapContextQueryToWire` writes it: `text-builder` is `static` with
|
|
274
|
+
* the `textValue`, `variable` is `argument` with the agent input's name in
|
|
275
|
+
* `{{…}}` ({@link argumentPathWireValue}), anything else `dynamic` with the
|
|
276
|
+
* `promptValue`. Keys in the order the storage schema's parse emits
|
|
277
|
+
* (`value`/`description` first), which is the order a canvas-saved file has.
|
|
278
|
+
*/
|
|
279
|
+
function builtinResourceQuery(query) {
|
|
280
|
+
if (query?.mode === 'variable')
|
|
281
|
+
return { value: argumentPathWireValue(String(query.argumentPath ?? '')), variant: 'argument' };
|
|
282
|
+
return query?.mode === 'text-builder'
|
|
283
|
+
? { value: String(query.textValue ?? ''), variant: 'static' }
|
|
284
|
+
: { description: String(query?.promptValue ?? ''), variant: 'dynamic' };
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* A Variable task's `argumentPath` as the resource's `{{<name>}}`, as the canvas
|
|
288
|
+
* writes it: its storage sync first rewrites the node's `$vars.<path>` to the
|
|
289
|
+
* agent input's `$agent.<flatName>` (`rewriteSourceTokensToInput`), then
|
|
290
|
+
* `argumentPathToWireValue` drops the `$<scope>.` prefix and wraps the rest. A
|
|
291
|
+
* path that is no single reference skips the first step, as there.
|
|
292
|
+
*/
|
|
293
|
+
function argumentPathWireValue(path) {
|
|
294
|
+
if (/^\{\{.*\}\}$/.test(path))
|
|
295
|
+
return path;
|
|
296
|
+
const name = flatNameOf(path) ?? path.replace(/^\$[^.]+\./, '');
|
|
297
|
+
return name ? `{{${name}}}` : '';
|
|
298
|
+
}
|
|
127
299
|
/**
|
|
128
300
|
* The `resources/<id>/resource.json` an inline agent's context index needs.
|
|
129
301
|
*
|
|
@@ -321,8 +493,9 @@ export const enumValue = (v) => {
|
|
|
321
493
|
* resource `query` is VARIANT-tagged where the node's is MODE-tagged, and its
|
|
322
494
|
* enums are capitalized (`Inline`, `Enabled`). `analyze-attachments` declares
|
|
323
495
|
* the model-facing call contract (`attachments` + `analysisTask` → `analysis`);
|
|
324
|
-
* `deep-rag`
|
|
325
|
-
*
|
|
496
|
+
* `deep-rag` declares empty schemas and carries its configuration in
|
|
497
|
+
* `properties.settings`. `batch-transform` is written as the canvas writes it
|
|
498
|
+
* instead ({@link batchTransformResourceJson}).
|
|
326
499
|
*/
|
|
327
500
|
export function builtinToolResourceJson(tool, label, inputs, spec) {
|
|
328
501
|
const toolType = ownEntry(BUILTIN_TOOL_TYPE, tool);
|
|
@@ -342,9 +515,9 @@ export function builtinToolResourceJson(tool, label, inputs, spec) {
|
|
|
342
515
|
guardrail: { policies: [] },
|
|
343
516
|
argumentProperties: {},
|
|
344
517
|
};
|
|
345
|
-
const query = inputs.query
|
|
346
|
-
|
|
347
|
-
|
|
518
|
+
const query = builtinResourceQuery(inputs.query);
|
|
519
|
+
if (toolType === 'batch-transform')
|
|
520
|
+
return batchTransformResourceJson(label, inputs, spec, query);
|
|
348
521
|
if (toolType === 'analyze-attachments') {
|
|
349
522
|
return {
|
|
350
523
|
...common,
|
|
@@ -374,24 +547,7 @@ export function builtinToolResourceJson(tool, label, inputs, spec) {
|
|
|
374
547
|
properties: { toolType, exampleCalls: [] },
|
|
375
548
|
};
|
|
376
549
|
}
|
|
377
|
-
|
|
378
|
-
return {
|
|
379
|
-
...common,
|
|
380
|
-
inputSchema: empty,
|
|
381
|
-
outputSchema: empty,
|
|
382
|
-
properties: {
|
|
383
|
-
toolType,
|
|
384
|
-
exampleCalls: [],
|
|
385
|
-
settings: {
|
|
386
|
-
contextType: 'attachments',
|
|
387
|
-
query,
|
|
388
|
-
folderPathPrefix: { variant: 'static' },
|
|
389
|
-
fileExtension: { value: String(inputs.fileExtension?.value ?? 'pdf') },
|
|
390
|
-
citationMode: { value: enumValue(inputs.citationMode?.value ?? 'inline') },
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
}
|
|
550
|
+
// deep-rag
|
|
395
551
|
return {
|
|
396
552
|
...common,
|
|
397
553
|
inputSchema: empty,
|
|
@@ -403,10 +559,76 @@ export function builtinToolResourceJson(tool, label, inputs, spec) {
|
|
|
403
559
|
contextType: 'attachments',
|
|
404
560
|
query,
|
|
405
561
|
folderPathPrefix: { variant: 'static' },
|
|
406
|
-
|
|
562
|
+
fileExtension: { value: String(inputs.fileExtension?.value ?? 'pdf') },
|
|
563
|
+
citationMode: { value: enumValue(inputs.citationMode?.value ?? 'inline') },
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Batch Transform's model-facing input: the one CSV file, as an inline object
|
|
570
|
+
* rather than a `job-attachment` `$ref`. Verbatim from a canvas-saved
|
|
571
|
+
* `resource.json` (docs/INLINE_AGENT_BATCH_TRANSFORM_DESIGN.md, "The reference
|
|
572
|
+
* solution"; the canvas's `BATCH_TRANSFORM_SCHEMA`), so the file carries no
|
|
573
|
+
* `definitions` block.
|
|
574
|
+
*/
|
|
575
|
+
const BATCH_TRANSFORM_INPUT_SCHEMA = {
|
|
576
|
+
type: 'object',
|
|
577
|
+
properties: {
|
|
578
|
+
attachment: {
|
|
579
|
+
type: 'object',
|
|
580
|
+
title: 'Source',
|
|
581
|
+
description: 'CSV file to transform',
|
|
582
|
+
required: ['ID'],
|
|
583
|
+
properties: {
|
|
584
|
+
ID: { type: 'string', description: 'Orchestrator attachment key' },
|
|
585
|
+
FullName: { type: 'string', description: 'File name' },
|
|
586
|
+
MimeType: { type: 'string', description: 'The MIME type of the content, such as "application/json" or "image/png"' },
|
|
587
|
+
Metadata: { type: 'object', description: 'Dictionary of metadata', additionalProperties: { type: 'string' } },
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
required: ['attachment'],
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* The `batch-transform` resource, as the canvas writes it (the reference
|
|
595
|
+
* solution's second save, D4/D6/D7 of docs/INLINE_AGENT_BATCH_TRANSFORM_DESIGN.md),
|
|
596
|
+
* key for key in that file's order — the order the storage schema's parse
|
|
597
|
+
* emits, with `canvasNodeId` last — so a compiled file and a canvas-saved one
|
|
598
|
+
* diff cleanly:
|
|
599
|
+
* - `name` is the 1.2 definition's label, "Batch transform";
|
|
600
|
+
* - no `referenceKey` and no `properties.exampleCalls`: the canvas writes neither;
|
|
601
|
+
* - `canvasNodeId` is the tool node's id, as for the HTTP-request tool;
|
|
602
|
+
* - the input schema is the fixed `attachment` one; the output is the empty
|
|
603
|
+
* object the canvas's `normalizeResourceSchemas` leaves of its array output;
|
|
604
|
+
* - `fileExtension` is always `csv`, `folderPathPrefix` the empty static one;
|
|
605
|
+
* - the columns are the node's, and the grounding its value capitalized.
|
|
606
|
+
*/
|
|
607
|
+
function batchTransformResourceJson(label, inputs, spec, query) {
|
|
608
|
+
return {
|
|
609
|
+
$resourceType: 'tool',
|
|
610
|
+
id: spec.id,
|
|
611
|
+
name: label,
|
|
612
|
+
description: String(inputs.description ?? ''),
|
|
613
|
+
type: INTERNAL_TOOL_RESOURCE_TYPE,
|
|
614
|
+
inputSchema: jsonClone(BATCH_TRANSFORM_INPUT_SCHEMA),
|
|
615
|
+
settings: {},
|
|
616
|
+
properties: {
|
|
617
|
+
toolType: 'batch-transform',
|
|
618
|
+
settings: {
|
|
619
|
+
contextType: 'attachments',
|
|
620
|
+
query,
|
|
621
|
+
folderPathPrefix: { variant: 'static', value: '' },
|
|
622
|
+
fileExtension: { value: 'csv' },
|
|
623
|
+
outputColumns: Array.isArray(inputs.outputColumns) ? jsonClone(inputs.outputColumns) : [],
|
|
407
624
|
webSearchGrounding: { value: enumValue(inputs.webSearchGrounding?.value ?? 'enabled') },
|
|
408
625
|
},
|
|
409
626
|
},
|
|
627
|
+
guardrail: { policies: [] },
|
|
628
|
+
isEnabled: true,
|
|
629
|
+
argumentProperties: {},
|
|
630
|
+
outputSchema: { type: 'object', properties: {} },
|
|
631
|
+
canvasNodeId: spec.canvasNodeId,
|
|
410
632
|
};
|
|
411
633
|
}
|
|
412
634
|
/**
|
|
@@ -593,9 +815,10 @@ export function escalationResourceJson(esc, spec) {
|
|
|
593
815
|
* `allowedTargets: [{ nodeType: 'uipath.agent.resource.tool.*' }]`.
|
|
594
816
|
*
|
|
595
817
|
* `withVoice` adds the voice agent as a source, which the designer writes on
|
|
596
|
-
* every tool it places today (#1670). The bundled built-in tools at 1.1
|
|
597
|
-
* the exception: flow-core froze that
|
|
598
|
-
* the same definition with it
|
|
818
|
+
* every tool it places today (#1670). The bundled built-in tools at 1.1
|
|
819
|
+
* (`analyzefiles`, `summarize`) are the exception: flow-core froze that
|
|
820
|
+
* version's handle without it, and 1.2 is the same definition with it
|
|
821
|
+
* (`voiceAgentRevision`). `batchtransform` is bundled at 1.2, with it.
|
|
599
822
|
*/
|
|
600
823
|
export function toolInputHandle(withVoice = true) {
|
|
601
824
|
return {
|
|
@@ -620,8 +843,12 @@ export function toolInputHandle(withVoice = true) {
|
|
|
620
843
|
* voice agent as a source, and its 1.2 of each is that definition with the
|
|
621
844
|
* voice agent added (`addVoiceAgentToInputHandleSources`, flow-core's
|
|
622
845
|
* migration-helpers.ts). For instance `builtin.analyzefiles` 1.1 becomes 1.2.
|
|
846
|
+
* A definition whose input handle already lists the voice agent
|
|
847
|
+
* (`builtin.batchtransform`, bundled at 1.2) is its own revision.
|
|
623
848
|
*/
|
|
624
849
|
export function voiceAgentRevision(def) {
|
|
850
|
+
if (acceptsVoiceAgent(def))
|
|
851
|
+
return jsonClone(def);
|
|
625
852
|
if (def.version !== '1.1')
|
|
626
853
|
throw new Error(`internal SDK error: no voice revision of ${def.nodeType}@${def.version}.`);
|
|
627
854
|
const next = jsonClone(def);
|
|
@@ -638,6 +865,11 @@ export function voiceAgentRevision(def) {
|
|
|
638
865
|
}
|
|
639
866
|
return next;
|
|
640
867
|
}
|
|
868
|
+
/** Whether a definition's `input` handle already lists the voice agent among its sources. */
|
|
869
|
+
function acceptsVoiceAgent(def) {
|
|
870
|
+
return (def.handleConfiguration ?? []).some((group) => (group.handles ?? []).some((handle) => handle.id === 'input' && Array.isArray(handle.constraints?.allowedSources)
|
|
871
|
+
&& handle.constraints.allowedSources.some((x) => x.nodeType === 'uipath.agent.voice')));
|
|
872
|
+
}
|
|
641
873
|
/** A `{ name: type }` field map as the JSON-schema object the platform stores. */
|
|
642
874
|
export function fieldSchema(fields) {
|
|
643
875
|
return {
|
|
@@ -648,9 +880,9 @@ export function fieldSchema(fields) {
|
|
|
648
880
|
/**
|
|
649
881
|
* The definitions for the three platform BUILT-IN tools, transcribed from
|
|
650
882
|
* `uip maestro flow registry get uipath.agent.resource.tool.builtin.<name>`
|
|
651
|
-
* (2026-07-31, version 1.1
|
|
652
|
-
*
|
|
653
|
-
* bundled.
|
|
883
|
+
* (2026-07-31, version 1.1; `batchtransform` 1.2 since 2026-11-02, see its
|
|
884
|
+
* entry). These are fixed types — no tenant resource behind them — so unlike
|
|
885
|
+
* every other tool kind the def CAN be bundled.
|
|
654
886
|
*
|
|
655
887
|
* One wrinkle carried faithfully rather than smoothed over: the three defs
|
|
656
888
|
* disagree about where the node's `source` identity lives. `analyzefiles`
|
|
@@ -726,27 +958,49 @@ export const BUILTIN_TOOL_DEFS = {
|
|
|
726
958
|
citationMode: { value: 'inline' },
|
|
727
959
|
},
|
|
728
960
|
},
|
|
961
|
+
// 1.2, copied from the canvas: flow-workbench's ootb manifest
|
|
962
|
+
// (`uipath-agent-resource-tool-builtin-batchtransform/v1.2.ts`), which is the
|
|
963
|
+
// registry's 1.2 and the definition a canvas-saved `.flow` carries, key for key.
|
|
964
|
+
// It differs from 1.1 only in the voice agent among the input handle's sources
|
|
965
|
+
// (and the "Batch transform" label, which names the resource).
|
|
729
966
|
batchtransform: {
|
|
730
967
|
nodeType: 'uipath.agent.resource.tool.builtin.batchtransform',
|
|
731
|
-
version: '1.
|
|
968
|
+
version: '1.2',
|
|
732
969
|
category: 'agent.tool.builtin',
|
|
733
|
-
tags: ['agent-tool', 'builtin', 'batch-transform', 'csv', 'transform'],
|
|
734
970
|
description: 'Process and transform CSV files',
|
|
735
|
-
|
|
971
|
+
tags: ['agent-tool', 'builtin', 'batch-transform', 'csv', 'transform'],
|
|
972
|
+
sortOrder: 40,
|
|
736
973
|
display: {
|
|
737
|
-
label: 'Batch
|
|
974
|
+
label: 'Batch transform',
|
|
738
975
|
description: 'Process and transform CSV files.',
|
|
739
|
-
icon: 'table',
|
|
976
|
+
icon: 'table',
|
|
977
|
+
shape: 'circle',
|
|
740
978
|
},
|
|
741
|
-
handleConfiguration: [toolInputHandle(
|
|
979
|
+
handleConfiguration: [toolInputHandle()],
|
|
742
980
|
inputDefinition: {
|
|
743
981
|
type: 'object',
|
|
744
982
|
properties: {
|
|
745
983
|
description: { type: 'string' },
|
|
746
984
|
source: { type: 'string' },
|
|
747
985
|
query: { type: 'object' },
|
|
748
|
-
outputColumns: {
|
|
749
|
-
|
|
986
|
+
outputColumns: {
|
|
987
|
+
type: 'array',
|
|
988
|
+
minItems: 1,
|
|
989
|
+
errorMessage: 'At least one output column is required',
|
|
990
|
+
items: {
|
|
991
|
+
type: 'object',
|
|
992
|
+
properties: {
|
|
993
|
+
name: { type: 'string' },
|
|
994
|
+
description: { type: 'string' },
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
|
+
},
|
|
998
|
+
webSearchGrounding: {
|
|
999
|
+
type: 'object',
|
|
1000
|
+
properties: {
|
|
1001
|
+
value: { type: 'string' },
|
|
1002
|
+
},
|
|
1003
|
+
},
|
|
750
1004
|
},
|
|
751
1005
|
},
|
|
752
1006
|
inputDefaults: {
|
|
@@ -756,6 +1010,58 @@ export const BUILTIN_TOOL_DEFS = {
|
|
|
756
1010
|
outputColumns: [],
|
|
757
1011
|
webSearchGrounding: { value: 'enabled' },
|
|
758
1012
|
},
|
|
1013
|
+
form: {
|
|
1014
|
+
id: 'batchtransform-tool-form',
|
|
1015
|
+
title: 'Batch transform',
|
|
1016
|
+
mode: 'onChange',
|
|
1017
|
+
reValidateMode: 'onChange',
|
|
1018
|
+
sections: [
|
|
1019
|
+
{
|
|
1020
|
+
id: 'batchtransform-settings',
|
|
1021
|
+
title: 'Batch transform settings',
|
|
1022
|
+
collapsible: false,
|
|
1023
|
+
defaultExpanded: true,
|
|
1024
|
+
fields: [
|
|
1025
|
+
{
|
|
1026
|
+
name: 'inputs.source',
|
|
1027
|
+
type: 'file',
|
|
1028
|
+
label: 'Source (file)',
|
|
1029
|
+
placeholder: 'CSV file to transform',
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
name: 'inputs.query',
|
|
1033
|
+
type: 'custom',
|
|
1034
|
+
component: 'context-query-editor',
|
|
1035
|
+
label: 'Batch transform task',
|
|
1036
|
+
componentProps: {
|
|
1037
|
+
placeholder: 'Describe the task for each row: what to analyze, what to extract, and how to populate the output columns',
|
|
1038
|
+
},
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
name: 'inputs.outputColumns',
|
|
1042
|
+
type: 'custom',
|
|
1043
|
+
component: 'output-columns-editor',
|
|
1044
|
+
label: 'Output columns',
|
|
1045
|
+
componentProps: {
|
|
1046
|
+
maxColumns: 10,
|
|
1047
|
+
namePlaceholder: 'Column name',
|
|
1048
|
+
descriptionPlaceholder: 'Company name or Renewal date',
|
|
1049
|
+
},
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
name: 'inputs.webSearchGrounding.value',
|
|
1053
|
+
type: 'select',
|
|
1054
|
+
label: 'Web search grounding',
|
|
1055
|
+
options: [
|
|
1056
|
+
{ label: 'Enabled', value: 'enabled' },
|
|
1057
|
+
{ label: 'Disabled', value: 'disabled' },
|
|
1058
|
+
],
|
|
1059
|
+
},
|
|
1060
|
+
],
|
|
1061
|
+
},
|
|
1062
|
+
],
|
|
1063
|
+
},
|
|
1064
|
+
runtimeConstraints: { exclude: ['api-function'] },
|
|
759
1065
|
},
|
|
760
1066
|
};
|
|
761
1067
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
5
5
|
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
6
6
|
*/
|
|
7
|
+
import type { OutputColumn } from '../../../core/actions.js';
|
|
7
8
|
import type { Expr } from '../../../core/expr.js';
|
|
8
9
|
export interface SummarizeInputs {
|
|
9
10
|
/**
|
|
@@ -38,13 +39,6 @@ export interface SummarizeInputs {
|
|
|
38
39
|
*/
|
|
39
40
|
returnCitations?: boolean;
|
|
40
41
|
}
|
|
41
|
-
/** One column Batch Transform appends to the CSV. */
|
|
42
|
-
export interface OutputColumn {
|
|
43
|
-
/** The new column's header, e.g. `'Category'`. */
|
|
44
|
-
name: string;
|
|
45
|
-
/** What the model should put in it, e.g. `'One of: Utility, Software, Travel, Other'`. */
|
|
46
|
-
description: string;
|
|
47
|
-
}
|
|
48
42
|
export interface BatchTransformInputs {
|
|
49
43
|
/**
|
|
50
44
|
* The CSV to enrich — a whole **Flow Attachment** object, same shape and same
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.94.0",
|
|
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",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"@types/node": "^22.7.0",
|
|
112
112
|
"esbuild": "^0.28.1"
|
|
113
113
|
},
|
|
114
|
-
"gitref": "
|
|
114
|
+
"gitref": "808fd636b0e0f9c1ece12d2937015b5915f42971"
|
|
115
115
|
}
|