@uipath/maestro-builder-sdk 6.42.0 → 6.44.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 +104 -103
- package/dist/api-members.md +319 -317
- package/dist/check.d.ts +0 -19
- package/dist/check.js +140 -1042
- package/dist/compile-cli.js +2 -1
- package/dist/core/actions.d.ts +10 -713
- package/dist/core/actions.js +0 -193
- package/dist/core/agent-sidecar.d.ts +186 -0
- package/dist/core/agent-sidecar.js +409 -0
- package/dist/core/agent-tool-resources.d.ts +62 -0
- package/dist/core/agent-tool-resources.js +81 -0
- package/dist/{config.js → core/connector-configuration.js} +2 -2
- package/dist/core/form-field-type.d.ts +7 -0
- package/dist/core/form-field-type.js +12 -2
- package/dist/core/node-id-placeholder.d.ts +8 -0
- package/dist/core/node-id-placeholder.js +10 -0
- package/dist/core/ts-literal.d.ts +6 -0
- package/dist/core/ts-literal.js +15 -0
- package/dist/core/typed-raw-node.js +0 -5
- package/dist/decompile.js +239 -857
- package/dist/flow-expr-check.js +5 -0
- package/dist/flow-node-registry.js +2 -1
- package/dist/flow-node-type.d.ts +139 -6
- package/dist/flow-sdk.d.ts +41 -5
- package/dist/flow-sdk.js +15 -1
- package/dist/flow-step-variables.d.ts +4 -0
- package/dist/flow-step-variables.js +22 -0
- package/dist/loop-version.d.ts +23 -6
- package/dist/loop-version.js +37 -15
- package/dist/nodes/agent/flow/check.d.ts +88 -0
- package/dist/nodes/agent/flow/check.js +873 -0
- package/dist/nodes/agent/flow/factories.d.ts +134 -0
- package/dist/nodes/agent/flow/factories.js +143 -0
- package/dist/nodes/agent/flow/family.d.ts +3 -0
- package/dist/nodes/agent/flow/family.js +8 -0
- package/dist/nodes/agent/flow/index.d.ts +3 -0
- package/dist/nodes/agent/flow/index.js +3 -0
- package/dist/nodes/agent/flow/inline-agent-lift.d.ts +44 -0
- package/dist/nodes/agent/flow/inline-agent-lift.js +572 -0
- package/dist/nodes/agent/flow/inline-agent.d.ts +15 -0
- package/dist/nodes/agent/flow/inline-agent.js +526 -0
- package/dist/nodes/agent/flow/node-type.d.ts +20 -0
- package/dist/nodes/agent/flow/node-type.js +422 -0
- package/dist/nodes/agent/flow/resources.d.ts +502 -0
- package/dist/nodes/agent/flow/resources.js +1409 -0
- package/dist/nodes/agent/flow/spec.d.ts +448 -0
- package/dist/nodes/agent/flow/spec.js +1 -0
- package/dist/nodes/hitl/flow/check.js +15 -0
- package/dist/nodes/hitl/flow/node-type.js +18 -3
- package/dist/nodes/process/flow/check.d.ts +40 -2
- package/dist/nodes/process/flow/check.js +156 -0
- package/dist/nodes/process/flow/factories.d.ts +58 -3
- package/dist/nodes/process/flow/factories.js +59 -2
- package/dist/nodes/process/flow/node-type.d.ts +4 -1
- package/dist/nodes/process/flow/node-type.js +198 -12
- package/dist/nodes/process/flow/spec.d.ts +112 -5
- package/dist/serialize.d.ts +9 -54
- package/dist/serialize.js +102 -2777
- package/package.json +2 -2
- /package/dist/{config.d.ts → core/connector-configuration.d.ts} +0 -0
- /package/dist/{ixp-definition.json → core/ixp-definition.json} +0 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agents family's authoring types — the text conversational agent
|
|
3
|
+
* (`uipath.agent.conversational`), the voice agent (`uipath.agent.voice`) and
|
|
4
|
+
* the two voice call steps (`uipath.conversational.voice.create-outgoing-call`,
|
|
5
|
+
* `.end-call`) and the inline agent (`uipath.agent.autonomous`) — and their
|
|
6
|
+
* kinds' entries in `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
7
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md. The guardrails and the resource refs
|
|
8
|
+
* (`ToolRef`, `ContextIndexRef`, `EscalationRef`, `AgentMemoryRef`) stay in
|
|
9
|
+
* core: the resource identities and the bindings writers read them.
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentGuardrail, AgentMemoryRef, ContextIndexRef, EscalationRef, InlineAgentFieldType, ToolRef } from '../../../core/actions.js';
|
|
12
|
+
import type { Expr } from '../../../core/expr.js';
|
|
13
|
+
/**
|
|
14
|
+
* How a conversational agent gets its turn — the node's own
|
|
15
|
+
* `conversationalAgentSettings` sub-object.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* `'simple'` (the default) derives everything from ONE conversation-context
|
|
19
|
+
* binding: `context` is the whole context object, and the platform reads
|
|
20
|
+
* `conversationId` / `latestExchangeId` / `messages` / `userSettings` out of
|
|
21
|
+
* it. `'custom'` binds each field yourself — for a flow that assembles a turn
|
|
22
|
+
* from more than one source.
|
|
23
|
+
*/
|
|
24
|
+
export interface ConversationalAgentSettings {
|
|
25
|
+
/** `'simple'` (the default) binds the whole context once; `'custom'` binds each field. */
|
|
26
|
+
mode?: 'simple' | 'custom';
|
|
27
|
+
/** The whole conversation context — `'simple'` mode's single binding. */
|
|
28
|
+
context?: Expr | string;
|
|
29
|
+
/** `'custom'` mode: the conversation id. */
|
|
30
|
+
conversationId?: Expr | string;
|
|
31
|
+
/** `'custom'` mode: the exchange id. */
|
|
32
|
+
exchangeId?: Expr | string;
|
|
33
|
+
/** `'custom'` mode: the chat history array. */
|
|
34
|
+
messages?: Expr | string;
|
|
35
|
+
/** `'custom'` mode: the caller's per-user settings object. */
|
|
36
|
+
userSettings?: Expr | string;
|
|
37
|
+
}
|
|
38
|
+
/** What `conversationalAgent()` takes: the agent's instructions and model, and how it gets its turn. */
|
|
39
|
+
export interface ConversationalAgentInputs {
|
|
40
|
+
/**
|
|
41
|
+
* The agent's standing instructions for the conversation. Plain text — a
|
|
42
|
+
* conversational agent's turn comes from the transcript, not from flow
|
|
43
|
+
* arguments, so there is no `{{input.…}}` templating.
|
|
44
|
+
*/
|
|
45
|
+
systemPrompt: string;
|
|
46
|
+
/** The MODEL to run, e.g. `'gpt-5.4'`. Required by the node's definition. */
|
|
47
|
+
model: string;
|
|
48
|
+
/**
|
|
49
|
+
* How the agent gets its turn. The common case is
|
|
50
|
+
* `{ context: out('<waitStep>', 'conversationContext') }` — one binding the
|
|
51
|
+
* platform reads conversation id, exchange id, history and user settings out
|
|
52
|
+
* of. See {@link ConversationalAgentSettings}.
|
|
53
|
+
*/
|
|
54
|
+
settings: ConversationalAgentSettings;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the agent's reply CLOSES the exchange.
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Has no effect and is not emitted. The platform retired the input:
|
|
59
|
+
* the conversational agent's v1.7 node migration removes it, and the converter
|
|
60
|
+
* always sends `conversationalService.endExchange = ''`. Wait-for-message and
|
|
61
|
+
* the end of the conversation close open exchanges.
|
|
62
|
+
*/
|
|
63
|
+
endExchange?: boolean;
|
|
64
|
+
/** Sampling temperature, 0–1. */
|
|
65
|
+
temperature?: number;
|
|
66
|
+
/** Max tokens in one response. */
|
|
67
|
+
maxTokenPerResponse?: number;
|
|
68
|
+
/**
|
|
69
|
+
* The model's own context ceiling.
|
|
70
|
+
*
|
|
71
|
+
* @deprecated Has no effect and is not emitted. Studio Web derives it from the
|
|
72
|
+
* selected model.
|
|
73
|
+
*/
|
|
74
|
+
modelMaxTokens?: number;
|
|
75
|
+
/** How many tool-calling rounds one turn may take, 1–100. */
|
|
76
|
+
maxIterations?: number;
|
|
77
|
+
/** Safety rails, the same array `inlineAgent` takes. */
|
|
78
|
+
guardrails?: AgentGuardrail[];
|
|
79
|
+
/**
|
|
80
|
+
* The agent's own directory name (a UUID) — the node carries it as `source`
|
|
81
|
+
* and the compiler writes `<source>/agent.json` beside the flow. Derived from
|
|
82
|
+
* the flow id + step name when omitted.
|
|
83
|
+
*/
|
|
84
|
+
source?: string;
|
|
85
|
+
}
|
|
86
|
+
/** What `createOutgoingCall()` takes: the two numbers, in E.164. */
|
|
87
|
+
export interface CreateOutgoingCallInputs {
|
|
88
|
+
/**
|
|
89
|
+
* The number to call FROM — a provisioned number on the tenant's telephony
|
|
90
|
+
* provider, in E.164 (`'+15551234567'`). Required.
|
|
91
|
+
*/
|
|
92
|
+
from: string | Expr;
|
|
93
|
+
/** The number to call, in E.164. Required. */
|
|
94
|
+
to: string | Expr;
|
|
95
|
+
}
|
|
96
|
+
/** What `endCall()` takes: the call to hang up. */
|
|
97
|
+
export interface EndCallInputs {
|
|
98
|
+
/**
|
|
99
|
+
* The call to hang up — bind the `callContext` published by the incoming-call
|
|
100
|
+
* trigger (`out('start', 'callContext')`) or by `createOutgoingCall`
|
|
101
|
+
* (`out('<step>', 'callContext')`). Required.
|
|
102
|
+
*/
|
|
103
|
+
callContext: Expr | string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The audio settings a voice agent speaks with.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* `model` is a VOICE model (a live/realtime one — not the text models
|
|
110
|
+
* `inlineAgent` takes), and `persona` is one of that model's own voices, so the
|
|
111
|
+
* two travel together. The platform's catalog today is
|
|
112
|
+
* `'gemini-3.1-flash-live-preview'` (personas Aoede, Charon, Fenrir, Kore,
|
|
113
|
+
* Leda, Orus, Puck, Zephyr) and `'gpt-realtime-2'` (alloy, ash, ballad, coral,
|
|
114
|
+
* echo, sage, shimmer, verse); omit both for the platform default.
|
|
115
|
+
*/
|
|
116
|
+
export interface VoiceSettings {
|
|
117
|
+
/** The voice model, e.g. `'gemini-3.1-flash-live-preview'`. */
|
|
118
|
+
model?: string;
|
|
119
|
+
/** One of that model's personas, e.g. `'Kore'`. */
|
|
120
|
+
persona?: string;
|
|
121
|
+
/** Sampling temperature, 0–1. */
|
|
122
|
+
temperature?: number;
|
|
123
|
+
/** Max tokens per response. */
|
|
124
|
+
maxTokens?: number;
|
|
125
|
+
/** The model's own context ceiling — informational. */
|
|
126
|
+
modelMaxTokens?: number;
|
|
127
|
+
}
|
|
128
|
+
/** What `voiceAgent()` takes: the agent's instructions, the call it joins, and how it sounds. */
|
|
129
|
+
export interface VoiceAgentInputs {
|
|
130
|
+
/**
|
|
131
|
+
* The agent's standing instructions — who it is on the call and what it must
|
|
132
|
+
* do. Use `{{input.<name>}}` placeholders for values declared in `inputs`;
|
|
133
|
+
* the caller's audio remains the conversational turn.
|
|
134
|
+
*/
|
|
135
|
+
systemPrompt: string;
|
|
136
|
+
/**
|
|
137
|
+
* Flow values made available to `systemPrompt` placeholders. Each key must
|
|
138
|
+
* be referenced as `{{input.<key>}}`; the compiler emits the node's runtime
|
|
139
|
+
* argument binding and the matching agent.json input contract together.
|
|
140
|
+
*/
|
|
141
|
+
inputs?: Record<string, unknown>;
|
|
142
|
+
/**
|
|
143
|
+
* The call to attach the agent to — the `callContext` from the incoming-call
|
|
144
|
+
* trigger or `createOutgoingCall`. Required: without it the agent has no
|
|
145
|
+
* audio channel to join.
|
|
146
|
+
*/
|
|
147
|
+
callContext: Expr | string;
|
|
148
|
+
/** How the agent sounds. Omit for the platform default voice. */
|
|
149
|
+
voice?: VoiceSettings;
|
|
150
|
+
/**
|
|
151
|
+
* How many tool-calling rounds the agent may take in one turn. The node's
|
|
152
|
+
* schema allows **1–8** — a tighter ceiling than a text agent's, because a
|
|
153
|
+
* caller is waiting.
|
|
154
|
+
*/
|
|
155
|
+
maxIterations?: number;
|
|
156
|
+
/**
|
|
157
|
+
* The agent's own directory name (a UUID) — the node carries it as `source`
|
|
158
|
+
* and the compiler writes `<source>/agent.json` beside the flow. Omit and one
|
|
159
|
+
* is derived from the flow id + step name, so a recompile is not a diff.
|
|
160
|
+
*/
|
|
161
|
+
source?: string;
|
|
162
|
+
}
|
|
163
|
+
/** What `inlineAgent()` takes: the model and prompts, the inputs and `returns`, the run settings, and the resources the agent attaches. */
|
|
164
|
+
export interface InlineAgentInputs {
|
|
165
|
+
/**
|
|
166
|
+
* The MODEL to run, e.g. `'gpt-5.4'`. Required by the node's definition, and
|
|
167
|
+
* worth a thought rather than a default: the platform's own scaffold ships
|
|
168
|
+
* `gpt-4o-2024-11-20`, which is stale, and v1's own smoke check for this node
|
|
169
|
+
* type FAILS a flow that keeps it. List what the tenant has with
|
|
170
|
+
* `uip agent model list`.
|
|
171
|
+
*/
|
|
172
|
+
model: string;
|
|
173
|
+
/**
|
|
174
|
+
* The agent's standing instructions — who it is, and what each `returns` field
|
|
175
|
+
* should hold. Required by the definition (`minLength: 1`).
|
|
176
|
+
*
|
|
177
|
+
* **Write it as plain text, and reference a value as `{{input.<name>}}`** — the
|
|
178
|
+
* agent's own template syntax, and the same names `inputs` declares:
|
|
179
|
+
*
|
|
180
|
+
* ```ts
|
|
181
|
+
* systemPrompt: 'You classify support email. Return a result conforming to the output '
|
|
182
|
+
* + 'schema. category: billing | technical | account. priority: low | normal | high.',
|
|
183
|
+
* userPrompt: 'Classify this email:\n{{input.body}}',
|
|
184
|
+
* inputs: { body: input('body') },
|
|
185
|
+
* returns: { category: 'string', priority: 'string' },
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* Why a placeholder rather than an interpolated expression: an inline agent is two
|
|
189
|
+
* artifacts, and its prompt exists in TWO dialects. You write one; the compiler
|
|
190
|
+
* emits the other into the `agent.json` sidecar. The `.flow` node carries no copy
|
|
191
|
+
* of the prompt: it is a shell, so Studio Web reads the sidecar.
|
|
192
|
+
*
|
|
193
|
+
* 1. yours `{{input.claim}}`
|
|
194
|
+
* 2. the AGENT.JSON `{{input.prepare__output__claimRef}}` ← what the runtime SENDS
|
|
195
|
+
*
|
|
196
|
+
* The second exists because the platform does not send an agent the names you
|
|
197
|
+
* declared: it names each argument after the bound reference PATH, `__`-joined.
|
|
198
|
+
* For a flow input the two coincide (`$vars.notes` → `notes`); for a step output
|
|
199
|
+
* they do not, and a sidecar still saying `{{input.claim}}` templates against a key
|
|
200
|
+
* that is not there — the literal text reaches the model. See the inline-agent
|
|
201
|
+
* node reference (`website/reference/inline-agent.md`) §"The prompt dialects".
|
|
202
|
+
*
|
|
203
|
+
* **The answer's shape is `returns`, not the prompt.** `returns` becomes the node's
|
|
204
|
+
* `agentOutputVariables` and the `agent.json` `outputSchema` — what Studio Web's
|
|
205
|
+
* Outputs editor writes — and the platform's agent runtime ends each run with a
|
|
206
|
+
* built-in structured call (`end_execution`) that fills exactly those fields. So
|
|
207
|
+
* `out('<step>', '<field>')` reads a typed value, not text to parse. Describe what
|
|
208
|
+
* each field holds, in the product's own wording, as the example above does:
|
|
209
|
+
* `Return a result conforming to the output schema. <field>: <how to fill it>.`
|
|
210
|
+
*
|
|
211
|
+
* Never ask for JSON TEXT as well ("Return ONLY a JSON object with keys …"). The
|
|
212
|
+
* model then packs its whole answer, serialized, into ONE string field: a writer
|
|
213
|
+
* declaring `{ subject, body }` came back on 2026-09-23 with
|
|
214
|
+
* `body: '{"subject":"…","body":"Dear …"}'` in 3 of 3 debug runs, and the flow sent
|
|
215
|
+
* that text on. A field that should carry structure is declared `'object'` or
|
|
216
|
+
* `'array'` instead.
|
|
217
|
+
*
|
|
218
|
+
* @enforcedBy INLINE_AGENT_PROMPT_JSON_TEXT A prompt that asks for JSON text while
|
|
219
|
+
* `returns` declares fields is refused; the platform accepts it and the run returns
|
|
220
|
+
* the packed value.
|
|
221
|
+
*/
|
|
222
|
+
systemPrompt: string;
|
|
223
|
+
/**
|
|
224
|
+
* The per-run request. Required by the definition (`minLength: 1`). Same
|
|
225
|
+
* `{{input.<name>}}` placeholders as `systemPrompt`.
|
|
226
|
+
*/
|
|
227
|
+
userPrompt: string;
|
|
228
|
+
/**
|
|
229
|
+
* The values the agent gets, by YOUR name for each one — e.g.
|
|
230
|
+
* `{ body: input('body') }`. These become the node's `agentInputVariables`
|
|
231
|
+
* descriptor array (`{ id, type, binding }`, the shape 48 of 53 deployed instances
|
|
232
|
+
* carry) and the `agent.json`'s `inputSchema`.
|
|
233
|
+
*
|
|
234
|
+
* **The name is yours only in this file.** Both emitted artifacts carry the
|
|
235
|
+
* PLATFORM's name — the bound reference's path, `__`-joined
|
|
236
|
+
* (`out('prepare','claimRef')` → `prepare__output__claimRef`) — because that is what
|
|
237
|
+
* the runtime keys the agent's JobArguments by, and an `agent.json` speaking any
|
|
238
|
+
* other name templates against nothing. You never write the long form.
|
|
239
|
+
*
|
|
240
|
+
* **Reference each one in a prompt as `{{input.<name>}}`.** Not decoration: the
|
|
241
|
+
* platform's deployed input list is not necessarily this array. flow-v1's
|
|
242
|
+
* `preDeriveAgentInputDefinitions` pre-pass scans the node's PROMPTS for `$vars.*`
|
|
243
|
+
* references, merges what it finds with this list, and — when its caller asks for
|
|
244
|
+
* pruning — DROPS an entry no prompt reference points at. A referenced entry
|
|
245
|
+
* survives every one of those paths; an unreferenced one survives only some.
|
|
246
|
+
* `check` warns when none of them is referenced, which is the case where the agent
|
|
247
|
+
* would arrive with no arguments at all.
|
|
248
|
+
*
|
|
249
|
+
* Two shapes have no platform name and are handled rather than renamed:
|
|
250
|
+
*
|
|
251
|
+
* - a **literal** (`{ tier: 'Enterprise' }`) is INLINED into both prompts — there
|
|
252
|
+
* is no argument for one, so a token could never substitute;
|
|
253
|
+
* - a **computed expression** is refused by `check`
|
|
254
|
+
* (`INLINE_AGENT_COMPOSITE_INPUT`): the platform names one argument per
|
|
255
|
+
* reference, so an expression spanning several has none. Compute it in a
|
|
256
|
+
* `script` step first and bind that step's output.
|
|
257
|
+
*/
|
|
258
|
+
inputs?: Record<string, unknown>;
|
|
259
|
+
/**
|
|
260
|
+
* The fields the agent must return, and their types — e.g.
|
|
261
|
+
* `{ category: 'string', priority: 'string' }`. These become the node's
|
|
262
|
+
* `agentOutputVariables` descriptor array AND the emitted `agent.json`'s
|
|
263
|
+
* `outputSchema`, and they are what makes `out('<step>', 'category')` a checkable
|
|
264
|
+
* read.
|
|
265
|
+
*
|
|
266
|
+
* Defaults to the definition's own default, `{ content: 'string' }` — which is
|
|
267
|
+
* the toy scaffold shape, so declare something real if the flow reads fields.
|
|
268
|
+
*
|
|
269
|
+
* @enforcedBy INLINE_AGENT_READ_UNKNOWN_FIELD A read outside the declared set is
|
|
270
|
+
* undefined on every rung and on the platform.
|
|
271
|
+
*/
|
|
272
|
+
returns?: Record<string, InlineAgentFieldType>;
|
|
273
|
+
/**
|
|
274
|
+
* The agent's own directory name — a UUID. The node carries it as `source`, and
|
|
275
|
+
* the platform resolves the agent's configuration at `<source>/agent.json`
|
|
276
|
+
* relative to the project (flow-v1 emits `entryPoint: <source>/agent.json`), so
|
|
277
|
+
* the compiler writes that file next to the `.flow`.
|
|
278
|
+
*
|
|
279
|
+
* Omit it and one is derived from the flow id + step name, so a given flow emits
|
|
280
|
+
* the same uuid every time (a random one would make every compile a diff).
|
|
281
|
+
*/
|
|
282
|
+
source?: string;
|
|
283
|
+
/** Sampling temperature, 0–1. The definition's range; omit for the model's default. */
|
|
284
|
+
temperature?: number;
|
|
285
|
+
/** Max tokens in one response, 0–16384. */
|
|
286
|
+
maxTokenPerResponse?: number;
|
|
287
|
+
/**
|
|
288
|
+
* The model's own context ceiling, e.g. `128000`.
|
|
289
|
+
*
|
|
290
|
+
* @deprecated Has no effect and is not emitted. Studio Web derives it from the
|
|
291
|
+
* selected model each time the agent is opened, and the sidecar has no field
|
|
292
|
+
* for it.
|
|
293
|
+
*/
|
|
294
|
+
modelMaxTokens?: number;
|
|
295
|
+
/** How many tool-calling rounds the agent may take, 1–100. */
|
|
296
|
+
maxIterations?: number;
|
|
297
|
+
/**
|
|
298
|
+
* The harness the agent runs on — `'standard'` (the default) or
|
|
299
|
+
* `'advanced'`, written to the `agent.json`'s `settings.mode`. It does not
|
|
300
|
+
* change the node's version: every inline agent emits the bundle's newest
|
|
301
|
+
* `uipath.agent.autonomous` definition (1.4).
|
|
302
|
+
*/
|
|
303
|
+
mode?: 'standard' | 'advanced';
|
|
304
|
+
/**
|
|
305
|
+
* Safety rails over the agent's inputs, outputs, LLM calls and tools — the
|
|
306
|
+
* platform's own array shape ({@link AgentGuardrail}), carried in the
|
|
307
|
+
* `agent.json` (every bundled definition declares the input).
|
|
308
|
+
*
|
|
309
|
+
* ```ts
|
|
310
|
+
* guardrails: [{
|
|
311
|
+
* id: 'no-pii', $guardrailType: 'custom', name: 'Block PII',
|
|
312
|
+
* selector: { scopes: ['Agent'] },
|
|
313
|
+
* action: { $actionType: 'block', reason: 'PII detected' },
|
|
314
|
+
* enabledForEvals: true,
|
|
315
|
+
* rules: [{ $ruleType: 'word', fieldSelector: { $selectorType: 'all' },
|
|
316
|
+
* operator: 'matchesRegex', value: '\\d{3}-\\d{2}-\\d{4}' }],
|
|
317
|
+
* }]
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
guardrails?: AgentGuardrail[];
|
|
321
|
+
/**
|
|
322
|
+
* Attach an episodic memory so the agent learns from past runs — one
|
|
323
|
+
* {@link AgentMemoryRef}, wired to the agent's `memory` handle (declared by
|
|
324
|
+
* the bundled 1.4 definition, which every inline agent uses).
|
|
325
|
+
*/
|
|
326
|
+
memory?: AgentMemoryRef;
|
|
327
|
+
/**
|
|
328
|
+
* GROUND the agent on tenant knowledge — one or more Context Grounding
|
|
329
|
+
* (semantic) indexes, wired to the agent's own `context` handle.
|
|
330
|
+
*
|
|
331
|
+
* ```ts
|
|
332
|
+
* inlineAgent({
|
|
333
|
+
* model: 'gpt-5.4',
|
|
334
|
+
* systemPrompt: 'You decide billing disputes from the SOPs. Return a result conforming to the output '
|
|
335
|
+
* + 'schema. determination: valid | invalid | needs_review. rationale: the SOP rule that decided it.',
|
|
336
|
+
* userPrompt: 'Dispute: {{input.description}}',
|
|
337
|
+
* inputs: { description: input('disputeDescription') },
|
|
338
|
+
* returns: { determination: 'string', rationale: 'string' },
|
|
339
|
+
* context: [{
|
|
340
|
+
* name: 'Billing Dispute SOP Index',
|
|
341
|
+
* id: 'cc45b9b4-dbf6-47b3-40ac-08debc0cec5b',
|
|
342
|
+
* folderPath: 'Shared/uipath-maestro-flow/BillingDispute',
|
|
343
|
+
* query: 'billing dispute resolution policy',
|
|
344
|
+
* }],
|
|
345
|
+
* })
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* Each entry becomes its own NODE —
|
|
349
|
+
* `uipath.agent.resource.context.index.<slug>.<id>` — joined to the agent by an
|
|
350
|
+
* edge out of the agent's `context` port. That is the platform's own shape: the
|
|
351
|
+
* agent definition declares the handle with
|
|
352
|
+
* `allowedTargets: [{ nodeType: 'uipath.agent.resource.context.*' }]`, and the
|
|
353
|
+
* index's definition declares the mirror
|
|
354
|
+
* (`allowedSources: [{ nodeType: 'uipath.agent.autonomous', handleId: 'context' }]`,
|
|
355
|
+
* `maxConnections: 1`). Nothing is a binding: the index's identity is IN the node
|
|
356
|
+
* type, exactly as a published agent's release key is.
|
|
357
|
+
*
|
|
358
|
+
* **Both identifiers are needed and neither is derivable.** The node type carries
|
|
359
|
+
* a slug of the name AND the index's uuid; the node's inputs carry `indexName` +
|
|
360
|
+
* `indexId` again, because the designer reads one and the runtime the other. Find
|
|
361
|
+
* them together — the uuid is the tail of the registry node type:
|
|
362
|
+
*
|
|
363
|
+
* ```bash
|
|
364
|
+
* uip maestro flow registry search "<index name>" --output json
|
|
365
|
+
* ```
|
|
366
|
+
*
|
|
367
|
+
* **Grounding is a CLOUD-side capability.** An offline run has no retrieval
|
|
368
|
+
* service to reach, so its answer is ungrounded
|
|
369
|
+
* however this is configured — which is why an offline rung can only assert the
|
|
370
|
+
* WIRING and a live rung only that the agent answered. Say so in a task rather
|
|
371
|
+
* than letting a green rung imply retrieval happened.
|
|
372
|
+
*/
|
|
373
|
+
context?: ContextIndexRef | ContextIndexRef[];
|
|
374
|
+
/**
|
|
375
|
+
* Give the agent TOOLS — capabilities it may call while reasoning, wired to
|
|
376
|
+
* the agent's own `tool` handle. Each entry becomes its own resource NODE
|
|
377
|
+
* (`uipath.agent.resource.tool.<kind>…`), joined to the agent by an edge out
|
|
378
|
+
* of its `tool` port — the same artifact shape as `context`.
|
|
379
|
+
*
|
|
380
|
+
* ```ts
|
|
381
|
+
* tools: [
|
|
382
|
+
* { kind: 'builtin', tool: 'summarize' },
|
|
383
|
+
* { kind: 'connector', connector: 'uipath-atlassian-jira', operation: 'create-issue',
|
|
384
|
+
* connection: 'jira', folder: 'shared' }, // bindings.json labels, both required
|
|
385
|
+
* { kind: 'process', key: '6235d64e-b190-4b7a-8918-723df964c068',
|
|
386
|
+
* name: 'Create TestCase', folderPath: 'Shared',
|
|
387
|
+
* inputs: { title: 'string' }, returns: { id: 'string' } },
|
|
388
|
+
* ]
|
|
389
|
+
* ```
|
|
390
|
+
*
|
|
391
|
+
* WHEN a tool runs is the model's decision at run time — nothing in the flow
|
|
392
|
+
* calls it. Locally that means tool nodes are never stepped through (they are
|
|
393
|
+
* artifacts, not steps), so no local rung proves a tool was USED — only that
|
|
394
|
+
* the wiring and shapes are right. Say so in any task that scores this.
|
|
395
|
+
*/
|
|
396
|
+
tools?: ToolRef | ToolRef[];
|
|
397
|
+
/**
|
|
398
|
+
* Let the agent ESCALATE to a human mid-run — an Action Center app task,
|
|
399
|
+
* wired to the agent's own `escalation` handle (its TOP port).
|
|
400
|
+
*
|
|
401
|
+
* ```ts
|
|
402
|
+
* escalation: {
|
|
403
|
+
* name: 'ContentReview',
|
|
404
|
+
* description: 'Escalate uncertain content to a human reviewer',
|
|
405
|
+
* app: {
|
|
406
|
+
* key: '454921d6-137f-4897-943a-1ebf29b15f80',
|
|
407
|
+
* name: 'ContentReviewApp',
|
|
408
|
+
* folderPath: 'Shared',
|
|
409
|
+
* inputs: { ContentText: 'string' },
|
|
410
|
+
* outputs: { ReviewDecision: 'string' },
|
|
411
|
+
* },
|
|
412
|
+
* recipients: ['reviewer@example.com'],
|
|
413
|
+
* outcomes: ['approve', 'reject'],
|
|
414
|
+
* }
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
417
|
+
* The emitted node type is `uipath.agent.resource.escalation.coded-action-app`
|
|
418
|
+
* — the registry's CURRENT spelling (the bare `….escalation` is the pre-split
|
|
419
|
+
* era; the agent's handle accepts both, and `registry get` resolves only the
|
|
420
|
+
* suffixed one). The other variant, `escalation.quick-form`, is feature-gated
|
|
421
|
+
* off on this tenant and not authorable.
|
|
422
|
+
*/
|
|
423
|
+
escalation?: EscalationRef | EscalationRef[];
|
|
424
|
+
}
|
|
425
|
+
declare module '../../../core/actions.js' {
|
|
426
|
+
interface FlowActionSpecs {
|
|
427
|
+
/** The spec {@link createOutgoingCall} builds. */
|
|
428
|
+
createOutgoingCall: {
|
|
429
|
+
inputs: CreateOutgoingCallInputs;
|
|
430
|
+
};
|
|
431
|
+
/** The spec {@link endCall} builds. */
|
|
432
|
+
endCall: {
|
|
433
|
+
inputs: EndCallInputs;
|
|
434
|
+
};
|
|
435
|
+
/** The spec {@link voiceAgent} builds. */
|
|
436
|
+
voiceAgent: {
|
|
437
|
+
inputs: VoiceAgentInputs;
|
|
438
|
+
};
|
|
439
|
+
/** The spec {@link conversationalAgent} builds. */
|
|
440
|
+
conversationalAgent: {
|
|
441
|
+
inputs: ConversationalAgentInputs;
|
|
442
|
+
};
|
|
443
|
+
/** The spec {@link inlineAgent} builds. */
|
|
444
|
+
inlineAgent: {
|
|
445
|
+
inputs: InlineAgentInputs;
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -30,6 +30,7 @@ export const HITL_DIAGNOSTICS = {
|
|
|
30
30
|
HITL_FIELD_VALUE_NOT_REF: { severity: 'error', summary: 'a shown field filled from a literal' },
|
|
31
31
|
HITL_FIELD_VALUE_NOT_PATH: { severity: 'error', summary: 'a shown field filled from a computed expression' },
|
|
32
32
|
HITL_FIELD_DIRECTION: { severity: 'error', summary: 'a field direction that is not input, output or inOut' },
|
|
33
|
+
HITL_FIELD_VARIABLE: { severity: 'error', summary: "an asked field's variable that is not one identifier, or sits on a shown field" },
|
|
33
34
|
HITL_NO_OUTCOMES: { severity: 'error', summary: 'no outcomes, so the task never completes' },
|
|
34
35
|
HITL_OUTCOME_BAD_ID: { severity: 'error', summary: 'an outcome id that is not a non-empty string' },
|
|
35
36
|
HITL_DUP_OUTCOME_ID: { severity: 'error', summary: 'two outcomes on one id' },
|
|
@@ -225,6 +226,20 @@ export function checkHitl(inputs, ctx) {
|
|
|
225
226
|
for (const problem of formFieldSettingProblems(f)) {
|
|
226
227
|
at('HITL_FIELD_SETTING_INVALID', `Human task "${step}" gives the form field "${id}" ${problem}. The platform refuses the form.`);
|
|
227
228
|
}
|
|
229
|
+
// The landing variable is read as `$vars.<variable>`, so it has to be one
|
|
230
|
+
// identifier — not a path, not a `vars.` prefix — and only an asked field
|
|
231
|
+
// has one: a shown field's row is written without it (#1309).
|
|
232
|
+
const variable = f?.variable;
|
|
233
|
+
if (variable !== undefined) {
|
|
234
|
+
if (f?.direction !== 'output') {
|
|
235
|
+
at('HITL_FIELD_VARIABLE', `Human task "${step}"'s form field "${id}" sets \`variable\` on a ${f?.direction === 'inOut' ? 'pre-filled' : 'shown'} field. `
|
|
236
|
+
+ `Only an asked field (direction 'output') lands its answer in a variable; the SDK writes the row without one.`, 'Drop `variable`, or make the field direction: \'output\'.');
|
|
237
|
+
}
|
|
238
|
+
else if (typeof variable !== 'string' || !/^[A-Za-z_$][\w$]*$/.test(variable)) {
|
|
239
|
+
at('HITL_FIELD_VARIABLE', `Human task "${step}"'s form field "${id}" has variable ${JSON.stringify(variable)}, which is not one identifier. `
|
|
240
|
+
+ `It is read as $vars.<variable>, so give the name only — no \`vars.\` prefix, no dots.`, typeof variable === 'string' && variable.startsWith('vars.') ? `variable: '${variable.slice(5)}'` : `variable: '${step}_${id}'`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
228
243
|
if (isAnswerField(f))
|
|
229
244
|
answers++; // an `output`, or an `inOut` whose reviewed value comes back
|
|
230
245
|
if (f?.direction === 'input' || f?.direction === 'inOut') {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* every edge out of an outcome-handle node to.
|
|
14
14
|
*/
|
|
15
15
|
import { Expr, toExpr } from '../../../core/expr.js';
|
|
16
|
-
import { formFieldJsonSchema, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, formFieldSettingsWire, liftFormFieldSettings, sourceFormFieldType, wireFormFieldType, } from '../../../core/form-field-type.js';
|
|
16
|
+
import { formFieldJsonSchema, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, formFieldSettingsWire, formFieldVariableName, liftFormFieldSettings, sourceFormFieldType, wireFormFieldType, } from '../../../core/form-field-type.js';
|
|
17
17
|
import { isAnswerField } from '../../../core/hitl-answers.js';
|
|
18
18
|
import { OUTCOME_HANDLE_NODE_TYPES, hitlExitModel, outcomeIdOf, outcomeSlug } from '../../../core/hitl-routing.js';
|
|
19
19
|
import { jsonClone } from '../../../core/json-clone.js';
|
|
@@ -82,8 +82,9 @@ function hitlInputs(inputs, nodeType, ctx) {
|
|
|
82
82
|
else {
|
|
83
83
|
// The answer's landing variable. The platform falls back to the field id
|
|
84
84
|
// when this is absent; naming it keeps the emitted flow explicit and
|
|
85
|
-
// matches what the designer writes
|
|
86
|
-
|
|
85
|
+
// matches what the designer writes — `vars.<Step>_<field>` when the author
|
|
86
|
+
// (or the canvas) named one, else the field's own id (#1309).
|
|
87
|
+
base.variable = `vars.${f.variable ?? f.id}`;
|
|
87
88
|
const required = f.required;
|
|
88
89
|
if (typeof required === 'boolean')
|
|
89
90
|
base.required = required;
|
|
@@ -331,6 +332,11 @@ function liftHitl(node, typeName, ctx) {
|
|
|
331
332
|
const id = String(f.id ?? '');
|
|
332
333
|
const direction = String(f.direction ?? 'output');
|
|
333
334
|
const value = direction === 'input' || direction === 'inOut' ? bindingExpr(f.binding) : undefined;
|
|
335
|
+
// An asked field's landing variable comes back when it is not the field's
|
|
336
|
+
// own id — the designer's `vars.<Step>_<field>` (#1309); `formFieldRowLoss`
|
|
337
|
+
// reports any other spelling.
|
|
338
|
+
const landing = direction === 'output' ? formFieldVariableName(f.variable) : undefined;
|
|
339
|
+
const variable = landing !== undefined && landing !== id ? landing : undefined;
|
|
334
340
|
// Every row key the source cannot carry is reported, never dropped
|
|
335
341
|
// silently: a warning, an error under --strict (#1250).
|
|
336
342
|
const loss = formFieldRowLoss(f, 'human task');
|
|
@@ -346,6 +352,7 @@ function liftHitl(node, typeName, ctx) {
|
|
|
346
352
|
direction,
|
|
347
353
|
...(value !== undefined ? { value } : {}),
|
|
348
354
|
...(typeof f.required === 'boolean' && direction !== 'input' ? { required: f.required } : {}),
|
|
355
|
+
...(variable !== undefined ? { variable } : {}),
|
|
349
356
|
...liftFormFieldSettings(f),
|
|
350
357
|
};
|
|
351
358
|
});
|
|
@@ -509,6 +516,7 @@ function printHitl({ inputs }, ctx) {
|
|
|
509
516
|
['direction', ctx.string(f.direction)],
|
|
510
517
|
['value', f.value !== undefined ? ctx.value(f.value) : undefined],
|
|
511
518
|
['required', f.required !== undefined ? String(f.required) : undefined],
|
|
519
|
+
['variable', f.variable !== undefined ? ctx.string(f.variable) : undefined],
|
|
512
520
|
...formFieldSettingsSource(f, ctx.value),
|
|
513
521
|
], ctx));
|
|
514
522
|
const outcomes = h.outcomes.map((o) => (typeof o === 'string' ? ctx.string(o) : obj([
|
|
@@ -596,6 +604,13 @@ function hitlAt(typeName, version, factory) {
|
|
|
596
604
|
.filter((f) => f?.direction === 'input')
|
|
597
605
|
.map((f) => ({ value: f.value })),
|
|
598
606
|
output: ({ inputs }) => ({ kind: 'reader', read: (read, report) => checkHitlRead(read, inputs, report) }),
|
|
607
|
+
// An asked field's answer lands in its `variable` (`vars.<Step>_<field>` as
|
|
608
|
+
// the designer names it), else in `vars.<id>` — serialize writes one or the
|
|
609
|
+
// other on every asked row — and later steps read it as `$vars.<name>`: the
|
|
610
|
+
// task declares that variable (#1309).
|
|
611
|
+
declares: ({ inputs }) => (inputs?.fields ?? [])
|
|
612
|
+
.map((f) => (f?.direction === 'output' ? (f.variable ?? f.id) : undefined))
|
|
613
|
+
.filter((v) => typeof v === 'string' && v !== ''),
|
|
599
614
|
exits: hitlExits,
|
|
600
615
|
// The base node and quick-form draw one `outcome-<id>` handle per outcome,
|
|
601
616
|
// whatever the version; their definitions declare only `completed`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The process family's rules: what is decidable from the call to `rpaWorkflow()`,
|
|
3
|
-
* `apiWorkflow()`, `publishedFunction()` or `
|
|
3
|
+
* `apiWorkflow()`, `publishedFunction()`, `agenticProcess()` or `agent()` (the three
|
|
4
4
|
* identifiers, the in-solution location, `returns`), and a read of each one's
|
|
5
5
|
* result. Moved from check.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md;
|
|
6
6
|
* codes and messages unchanged. Whether the process exists, takes these
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { DiagnosticCatalog } from '../../../core/nodes/family.js';
|
|
10
10
|
import type { FieldsRead, OutputPathRead } from '../../../core/nodes/node-type.js';
|
|
11
11
|
import type { FlowCheckContext } from '../../../flow-node-type.js';
|
|
12
|
-
import type { AgenticProcessInputs, ApiWorkflowInputs, PublishedFunctionInputs, RpaWorkflowInputs } from './spec.js';
|
|
12
|
+
import type { AgentInputs, AgenticProcessInputs, ApiWorkflowInputs, PublishedFunctionInputs, RpaWorkflowInputs } from './spec.js';
|
|
13
13
|
export declare const PROCESS_DIAGNOSTICS: DiagnosticCatalog;
|
|
14
14
|
/**
|
|
15
15
|
* Check an `rpaWorkflow(...)` call.
|
|
@@ -110,3 +110,41 @@ export declare function checkApiWorkflowRead({ node: name, field, rest, reader:
|
|
|
110
110
|
* non-empty VALUE is not something any offline gate can promise.
|
|
111
111
|
*/
|
|
112
112
|
export declare function checkAgenticProcessRead({ node: name, field, rest, reader: step }: OutputPathRead, spec: AgenticProcessInputs, report: (code: string, message: string, suggestion?: string) => void): void;
|
|
113
|
+
/**
|
|
114
|
+
* Check an `agent(...)` call — a published or in-solution agent (coded or
|
|
115
|
+
* low-code).
|
|
116
|
+
*
|
|
117
|
+
* WHAT THESE RULES CAN AND CANNOT SEE. Whether the agent exists, which kind it is,
|
|
118
|
+
* and what it returns all live on the tenant. So these cover what is decidable from
|
|
119
|
+
* the call — and two of them are the exact classes v1's own baseline on this family
|
|
120
|
+
* fails on, which is why they are errors rather than warnings:
|
|
121
|
+
*
|
|
122
|
+
* - **A reference to nothing.** 5 of 16 `skill-flow-coded-agent` runs in the
|
|
123
|
+
* 06-29 → 07-20 window emitted an agent node whose `resourceKey` was a LOCAL
|
|
124
|
+
* project id and whose `folderPath` was `""`, and faulted at job start with
|
|
125
|
+
* `[170007] … HTTP 404 "The job's associated process could not be found"`. A
|
|
126
|
+
* blank `name` or `folderPath` is that flow, caught before a tenant round trip.
|
|
127
|
+
* - **The empty-input floor.** `inputs` is required by the type, so `{}` is the only
|
|
128
|
+
* way to reach it, and it is worth saying what the platform then does — see
|
|
129
|
+
* `AGENT_EMPTY_INPUT_FLOOR`.
|
|
130
|
+
*
|
|
131
|
+
* What no rule here can see: whether the agent's ANSWER is right. That is CP-3's
|
|
132
|
+
* ruling — a green live rung means a model responded with the declared shape — and
|
|
133
|
+
* the gate that does cover a flow FAKING an answer is an offline `replays:` seed
|
|
134
|
+
* asserting the exact unfixtured value, not a check.
|
|
135
|
+
*/
|
|
136
|
+
export declare function checkAgent(inputs: AgentInputs | undefined, ctx: FlowCheckContext): void;
|
|
137
|
+
/**
|
|
138
|
+
* A read of a published agent's output: `out('<step>', '<field>')`.
|
|
139
|
+
*
|
|
140
|
+
* The three mistakes are api-workflow's and agentic-process's, plus a fourth this
|
|
141
|
+
* family owns: a read whose CASE differs from the declared field. That is worth its
|
|
142
|
+
* own message because for a while it was a live-only defect rather than a mistake —
|
|
143
|
+
* a poller that read the job through `uip agent run status` got a PascalCased
|
|
144
|
+
* envelope, so `output.Count` was right live and wrong offline while
|
|
145
|
+
* `output.count` was the reverse (flow-builder-sdk #122). Now the agent's own field
|
|
146
|
+
* names arrive verbatim and the wrong case is simply undefined; naming it as a CASE
|
|
147
|
+
* problem rather than an unknown field is the difference between a two-second fix and
|
|
148
|
+
* a re-read of the registry.
|
|
149
|
+
*/
|
|
150
|
+
export declare function checkAgentRead({ node: name, field, rest, reader: step }: OutputPathRead, spec: AgentInputs, report: (code: string, message: string, suggestion?: string) => void): void;
|