@uipath/maestro-builder-sdk 6.42.0 → 6.43.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.
Files changed (52) hide show
  1. package/dist/api-index.md +99 -99
  2. package/dist/api-members.md +307 -307
  3. package/dist/check.d.ts +0 -19
  4. package/dist/check.js +40 -1036
  5. package/dist/compile-cli.js +2 -1
  6. package/dist/core/actions.d.ts +1 -713
  7. package/dist/core/actions.js +0 -193
  8. package/dist/core/agent-sidecar.d.ts +186 -0
  9. package/dist/core/agent-sidecar.js +409 -0
  10. package/dist/core/agent-tool-resources.d.ts +62 -0
  11. package/dist/core/agent-tool-resources.js +81 -0
  12. package/dist/{config.js → core/connector-configuration.js} +2 -2
  13. package/dist/core/node-id-placeholder.d.ts +8 -0
  14. package/dist/core/node-id-placeholder.js +10 -0
  15. package/dist/core/ts-literal.d.ts +6 -0
  16. package/dist/core/ts-literal.js +15 -0
  17. package/dist/core/typed-raw-node.js +0 -5
  18. package/dist/decompile.js +34 -822
  19. package/dist/flow-node-registry.js +2 -1
  20. package/dist/flow-node-type.d.ts +130 -6
  21. package/dist/flow-sdk.d.ts +1 -0
  22. package/dist/flow-sdk.js +1 -0
  23. package/dist/nodes/agent/flow/check.d.ts +88 -0
  24. package/dist/nodes/agent/flow/check.js +873 -0
  25. package/dist/nodes/agent/flow/factories.d.ts +134 -0
  26. package/dist/nodes/agent/flow/factories.js +143 -0
  27. package/dist/nodes/agent/flow/family.d.ts +3 -0
  28. package/dist/nodes/agent/flow/family.js +8 -0
  29. package/dist/nodes/agent/flow/index.d.ts +3 -0
  30. package/dist/nodes/agent/flow/index.js +3 -0
  31. package/dist/nodes/agent/flow/inline-agent-lift.d.ts +44 -0
  32. package/dist/nodes/agent/flow/inline-agent-lift.js +572 -0
  33. package/dist/nodes/agent/flow/inline-agent.d.ts +15 -0
  34. package/dist/nodes/agent/flow/inline-agent.js +526 -0
  35. package/dist/nodes/agent/flow/node-type.d.ts +20 -0
  36. package/dist/nodes/agent/flow/node-type.js +422 -0
  37. package/dist/nodes/agent/flow/resources.d.ts +502 -0
  38. package/dist/nodes/agent/flow/resources.js +1409 -0
  39. package/dist/nodes/agent/flow/spec.d.ts +448 -0
  40. package/dist/nodes/agent/flow/spec.js +1 -0
  41. package/dist/nodes/process/flow/check.d.ts +40 -2
  42. package/dist/nodes/process/flow/check.js +156 -0
  43. package/dist/nodes/process/flow/factories.d.ts +58 -3
  44. package/dist/nodes/process/flow/factories.js +59 -2
  45. package/dist/nodes/process/flow/node-type.d.ts +4 -1
  46. package/dist/nodes/process/flow/node-type.js +181 -10
  47. package/dist/nodes/process/flow/spec.d.ts +112 -5
  48. package/dist/serialize.d.ts +9 -54
  49. package/dist/serialize.js +47 -2763
  50. package/package.json +2 -2
  51. /package/dist/{config.d.ts → core/connector-configuration.d.ts} +0 -0
  52. /package/dist/{ixp-definition.json → core/ixp-definition.json} +0 -0
@@ -145,199 +145,6 @@ export function builtinTriggerSpec(spec) {
145
145
  export function ixpExtract(inputs) {
146
146
  return builtinActionSpec({ kind: 'ixpExtract', inputs });
147
147
  }
148
- /**
149
- * Place an outgoing phone call
150
- * (`uipath.conversational.voice.create-outgoing-call`) and get back the
151
- * `callContext` every other voice step is keyed by.
152
- *
153
- * ```ts
154
- * .step('dial', createOutgoingCall({ from: '+15550001111', to: input('customerPhone') }))
155
- * .step('talk', voiceAgent({
156
- * systemPrompt: 'Confirm the delivery window, then thank them.',
157
- * callContext: out('dial', 'callContext'),
158
- * }))
159
- * ```
160
- *
161
- * @param inputs - The provisioned `from` number and the `to` number to dial.
162
- * @returns An action spec to pass to `.step(...)`.
163
- */
164
- export function createOutgoingCall(inputs) {
165
- return builtinActionSpec({ kind: 'createOutgoingCall', inputs });
166
- }
167
- /**
168
- * Hang up (`uipath.conversational.voice.end-call`). Reads
169
- * `out('<step>', 'ended')`.
170
- *
171
- * @param inputs - The `callContext` of the call to end.
172
- * @returns An action spec to pass to `.step(...)`.
173
- */
174
- export function endCall(inputs) {
175
- return builtinActionSpec({ kind: 'endCall', inputs });
176
- }
177
- /**
178
- * Put a VOICE agent on a live call (`uipath.agent.voice`) — it speaks and
179
- * listens for one turn, then the flow continues.
180
- *
181
- * ```ts
182
- * .trigger(voiceTrigger())
183
- * .step('greet', voiceAgent({
184
- * systemPrompt: 'Greet {{input.customerName}} and find out why they called.',
185
- * inputs: { customerName: input('customerName') },
186
- * callContext: out('start', 'callContext'),
187
- * voice: { model: 'gemini-3.1-flash-live-preview', persona: 'Kore' },
188
- * }))
189
- * ```
190
- *
191
- * Like `inlineAgent`, compile emits the node PLUS a stable
192
- * `<source>/agent.json` sidecar. Unlike it, the turn's content comes from the
193
- * call rather than from a user-prompt argument. Flow context can still be
194
- * supplied through `inputs` and referenced from the system prompt. There are no
195
- * declared `returns`: read the turn back as
196
- * `out('<step>', 'uipath__agent_response_messages')`.
197
- *
198
- * @param inputs - The instructions, the call to join, and how the agent sounds.
199
- * @returns An action spec to pass to `.step(...)`.
200
- */
201
- export function voiceAgent(inputs) {
202
- return builtinActionSpec({ kind: 'voiceAgent', inputs });
203
- }
204
- /**
205
- * A CONVERSATIONAL agent (`uipath.agent.conversational`) — it answers one turn
206
- * of a live chat, reading the transcript rather than flow arguments.
207
- *
208
- * ```ts
209
- * .trigger(conversationTrigger())
210
- * .step('listen', waitForMessage({ conversationId: out('start', 'conversationId') }))
211
- * .step('reply', conversationalAgent({
212
- * model: 'gpt-5.4',
213
- * systemPrompt: 'You are a support agent. Be brief.',
214
- * settings: { context: out('listen', 'conversationContext') },
215
- * }))
216
- * ```
217
- *
218
- * The reply is `out('<step>', 'uipath__agent_response_messages')` — the
219
- * platform's own field name. Like `inlineAgent`, compile emits the node plus a
220
- * stable `<source>/agent.json` sidecar.
221
- *
222
- * `sendMessage` is the alternative when the flow (not a model) decides what to
223
- * say; this factory is for when the model does.
224
- *
225
- * @param inputs - The model, the instructions, and how the turn is bound.
226
- * @returns An action spec to pass to `.step(...)`.
227
- */
228
- export function conversationalAgent(inputs) {
229
- return builtinActionSpec({ kind: 'conversationalAgent', inputs });
230
- }
231
- /**
232
- * Invoke an AGENT resource — either one published to Orchestrator or a sibling
233
- * agent project registered in the same solution. Both start through
234
- * `Orchestrator.StartAgentJob`.
235
- *
236
- * @remarks
237
- * **Coded and low-code agents are the same node.** This one factory authors both.
238
- * `registry get` on a coded agent and on a low-code one returns the same node type,
239
- * the same service type, the same `sortOrder` and the same bindings shape; the
240
- * only difference is the icon, which is what `flavour` sets. Which kind a resource
241
- * is a property of what somebody published, not of the flow — so if a task asks for
242
- * "a coded agent", what it is asking you to get right is the RESOURCE you point at.
243
- *
244
- * **What this factory cannot do, said plainly:** it does not create an agent. A
245
- * published resource must already be deployed. An in-solution resource must first
246
- * be scaffolded and registered with `uip solution projects add`; this factory then
247
- * authors the local reference from the registered resource key and project id.
248
- *
249
- * The three identifiers are separate for `rpaWorkflow`'s reason: `agent` is the key
250
- * the node's TYPE carries (`uipath.core.agent.<agent>`), while `name` +
251
- * `folderPath` are what the runtime resolves the job by and together are the
252
- * `resourceKey`, `"<folderPath>.<name>"`. `folderPath` earns its keep twice here —
253
- * see {@link AgentInputs.folderPath} for the two-agents-called-CountLetters case.
254
- *
255
- * The step WAITS for the job and publishes its output arguments under `output`, so
256
- * `out('<step>', '<field>')` reads a field `returns` declares — using the names the
257
- * agent's own definition declares, case included.
258
- *
259
- * ── the live bar, stated ─────────────────────────────────────────────────────────
260
- * A green live rung here means **a model responded with the declared output shape**,
261
- * not that the answer was right. A real Orchestrator job runs, the flow's input
262
- * reaches it, and its answer reaches the flow's output — all four independently
263
- * checkable (`ladder.sh job`). Whether the number it returned is the correct number
264
- * is the model's business, and no rung asserts it. What CAN be asserted is that the
265
- * flow did not fake it: the offline seeds assert the exact UNFIXTURED value, which a
266
- * hardcoded answer cannot produce.
267
- *
268
- * @example
269
- * **Start a published agent and read one declared output**
270
- * ```ts
271
- * .step('countLetters', agent({
272
- * key: '6a47dc5b-5fd4-461f-b97d-6c1817abcaaa',
273
- * name: 'CountLetters LowCode Agent',
274
- * folderPath: 'Shared/uipath-maestro-flow/CountLetters LowCode',
275
- * inputs: { inputString: input('word') },
276
- * returns: { count: 'integer', inputString: 'string' },
277
- * }))
278
- * .return({ rs: out('countLetters', 'count') })
279
- * ```
280
- *
281
- * @param inputs - The agent to start (`name`, `folderPath`, and `key` or
282
- * `projectId`), its `inputs`, and the fields you read back via `returns`.
283
- * @returns An action spec to pass to `.step(name, …)`.
284
- */
285
- export function agent(inputs) {
286
- return builtinActionSpec({ kind: 'agent', inputs });
287
- }
288
- /**
289
- * Declare an INLINE AUTONOMOUS AGENT — an agent defined inside this flow's own
290
- * project rather than published to Orchestrator (`uipath.agent.autonomous`,
291
- * `Orchestrator.StartInlineAgentJob`).
292
- *
293
- * @remarks
294
- * **Two artifacts, not one.** The node carries the prompts and the variable
295
- * descriptors, and it points at a directory — `source` — where the platform expects
296
- * the agent's own configuration (flow-v1 emits `entryPoint: <source>/agent.json`).
297
- * So `compile` writes `<source>/agent.json` beside the `.flow`, built from the same
298
- * fields. Nothing to assemble by hand; `source` defaults to a uuid derived from the
299
- * flow id and step name so a recompile is not a diff.
300
- *
301
- * **How this differs from `agent()`.** That one references something already
302
- * published and started as an Orchestrator job; this one IS the definition, and the
303
- * platform runs it inside the flow's own debug/publish context. The practical
304
- * consequences: there is no folder, no release key and no binding pair here — and
305
- * no `uip` verb that starts one headlessly either.
306
- *
307
- * ── the live bar, stated ─────────────────────────────────────────────────────────
308
- * Weaker than `agent()`'s, and in a specific way. `Orchestrator.StartInlineAgentJob`
309
- * is Studio-Web-debug-only, so there is no Orchestrator job to point at and no
310
- * headless verb that starts one. No local runner currently calls a model for this
311
- * node either — an offline run asserts the WIRING and the declared `returns` shape,
312
- * never that a model answered. Two differences would remain for any runner that did
313
- * call one: knowledge grounding (a context handle) is a cloud-side index an offline
314
- * path does not have, so the call would be ungrounded; and the node's `model` would
315
- * have to be substituted for one reachable headlessly. Answer quality stays on the
316
- * offline `expect` seeds; real behaviour needs a Studio Web debug run.
317
- *
318
- * @example
319
- * **Classify an email with an agent defined inline**
320
- * ```ts
321
- * .step('triage', inlineAgent({
322
- * model: 'gpt-5.4',
323
- * systemPrompt:
324
- * 'You are a support triage assistant. Classify the email into exactly one ' +
325
- * 'category and one priority. Return a result conforming to the output schema. ' +
326
- * 'category: billing | technical | account. priority: low | normal | high.',
327
- * userPrompt: 'Classify this email:\n{{input.body}}',
328
- * inputs: { body: input('body') },
329
- * returns: { category: 'string', priority: 'string' },
330
- * }))
331
- * .return({ category: out('triage', 'category') })
332
- * ```
333
- *
334
- * @param inputs - The agent defined in this project: its `model`,
335
- * `systemPrompt`, `userPrompt`, and the `returns` fields it must produce.
336
- * @returns An action spec to pass to `.step(name, …)`.
337
- */
338
- export function inlineAgent(inputs) {
339
- return builtinActionSpec({ kind: 'inlineAgent', inputs });
340
- }
341
148
  export function connector(a, b, c, d) {
342
149
  if (typeof a === 'string') {
343
150
  const opts = (d ?? {});
@@ -0,0 +1,186 @@
1
+ /** One agent's declared inputs as the platform sees them — see {@link agentInputPlan}. */
2
+ export interface AgentInputPlan {
3
+ byName: Map<string, AgentInputBinding>;
4
+ refs: Array<{
5
+ flatName: string;
6
+ binding: string;
7
+ }>;
8
+ }
9
+ /**
10
+ * What one declared agent input turns into on the platform.
11
+ *
12
+ * - `ref` — a single source reference. It gets a JobArgument named `flatName`,
13
+ * so it gets a descriptor entry, an `inputSchema` key and a prompt token.
14
+ * - `literal` — a constant. There is NO JobArgument for one: v1 prunes a literal
15
+ * binding as un-re-derivable (`deriveAgentInputVariables`'s doc block,
16
+ * `:477-481`), so an `{{input.x}}` token for it would never substitute. The
17
+ * value is INLINED into the agent.json prompt instead.
18
+ * - `expression` — a computed expression spanning zero or several references.
19
+ * No single JobArgument can exist, so there is no honest name to emit, and
20
+ * the author's placeholder has nothing to point at — `check`'s
21
+ * `INLINE_AGENT_COMPOSITE_INPUT` says so and names the fix (compute it in a
22
+ * script step first).
23
+ */
24
+ export type AgentInputBinding = {
25
+ kind: 'ref';
26
+ flatName: string;
27
+ binding: string;
28
+ } | {
29
+ kind: 'literal';
30
+ text: string;
31
+ } | {
32
+ kind: 'expression';
33
+ binding: string;
34
+ };
35
+ /**
36
+ * The platform-facing plan for one inline agent's declared inputs.
37
+ *
38
+ * Built once and used by all three agent-facing sites (the node's
39
+ * `agentInputVariables`, the sidecar's `inputSchema`, and both prompts), so they
40
+ * cannot drift apart.
41
+ *
42
+ * `refs` is DEDUPED BY FLAT NAME and keeps author order. Two logical names bound
43
+ * to the same reference are one JobArgument on the platform (v1 dedupes on a
44
+ * seen-set, `:490-522`), so emitting two descriptors would claim an argument that
45
+ * will not exist.
46
+ */
47
+ export declare function agentInputPlan(inputs: Record<string, unknown>, render: (value: unknown) => unknown): AgentInputPlan;
48
+ /**
49
+ * The `agent.json` sidecar for a text CONVERSATIONAL agent.
50
+ *
51
+ * The inline agent's shape minus the argument plumbing: the turn arrives as the
52
+ * conversation transcript, so there is no `inputSchema` keyed by flat names and
53
+ * no `outputSchema` (the definition declares
54
+ * `uipath__agent_response_messages`). `metadata.isConversational` is what tells
55
+ * the platform's own storage layer which kind of agent this is.
56
+ */
57
+ export declare function conversationalAgentJson(spec: {
58
+ model: string;
59
+ systemPrompt: string;
60
+ temperature?: number;
61
+ maxTokenPerResponse?: number;
62
+ maxIterations?: number;
63
+ guardrails?: unknown[];
64
+ source: string;
65
+ name: string;
66
+ }): any;
67
+ /**
68
+ * The `agent.json` sidecar for a VOICE agent.
69
+ *
70
+ * The text agent's shape with voice-specific settings. The turn arrives as
71
+ * audio, while optional flow context is delivered through `inputSchema` and
72
+ * `{{input.…}}` system-prompt placeholders. There is no `outputSchema` (the
73
+ * definition declares what comes back), and `settings.voice` carries the
74
+ * audio configuration in the storage layer's own `StoredVoiceSettings` shape
75
+ * (`model` / `maxTokens` / `temperature` / `persona`) — with the platform's
76
+ * catalog defaults filled in, because its own writer treats a partial voice
77
+ * block as incomplete.
78
+ */
79
+ export declare function voiceAgentJson(spec: {
80
+ systemPrompt: string;
81
+ plan: AgentInputPlan;
82
+ voice?: {
83
+ model?: string;
84
+ persona?: string;
85
+ temperature?: number;
86
+ maxTokens?: number;
87
+ };
88
+ maxIterations?: number;
89
+ source: string;
90
+ name: string;
91
+ }): any;
92
+ /**
93
+ * The `agent.json` an inline agent's `source` directory must hold.
94
+ *
95
+ * The node is only half of an inline agent. flow-v1's `handleInlineAgentJob` emits
96
+ * `entryPoint: "<source>/agent.json"` into the BPMN context, and the runtime
97
+ * resolves the agent's real configuration — model settings, the message list, the
98
+ * input/output schemas — from that file relative to the project. A `.flow` with an
99
+ * inline-agent node and no such file references a definition that is not there.
100
+ *
101
+ * Shape transcribed from deployed agents under `runs/` (e.g. the four DevCon
102
+ * billing agents, `type: 'lowCode'`), which is also what
103
+ * `uip agent init --inline-in-flow` scaffolds. The `version` is
104
+ * {@link AGENT_DEFINITION_VERSION}, not the `1.1.0` those older agents carry. `contentTokens` mirrors `content` as
105
+ * one `simpleText` run: the designer uses those tokens to render a prompt with
106
+ * inline variable chips, and a single run is the faithful encoding of a plain
107
+ * string.
108
+ */
109
+ export declare function inlineAgentJson(spec: {
110
+ model: string;
111
+ systemPrompt: string;
112
+ userPrompt: string;
113
+ /**
114
+ * The platform-facing plan for `inputs` — see {@link agentInputPlan}. The
115
+ * sidecar speaks FLAT NAMES throughout (schema keys, prompt text, tokens);
116
+ * the author's logical names never appear in this file.
117
+ */
118
+ plan: AgentInputPlan;
119
+ returns: Record<string, string>;
120
+ temperature?: number;
121
+ maxTokenPerResponse?: number;
122
+ maxIterations?: number;
123
+ /** Harness mode; the sidecar's `settings.mode` (`'standard'` when omitted). */
124
+ mode?: string;
125
+ /** Guardrail array, stored verbatim as the sidecar's own `guardrails`. */
126
+ guardrails?: unknown[];
127
+ /** The agent's own directory uuid — its `projectId`/`id`, and the node's `inputs.source`. */
128
+ source: string;
129
+ /** The agent's display name (the step's label). */
130
+ name: string;
131
+ }): any;
132
+ /** Which writer produced an `agent.json`: the inline, conversational or voice agent's. */
133
+ export type AgentSidecarDialect = 'inline' | 'conversational' | 'voice';
134
+ /**
135
+ * The agent configuration a SHELL agent node keeps in its sidecar, read from
136
+ * `<source>/agent.json` in the node's own input names: the prompts, the model,
137
+ * the run settings (`temperature`, `maxTokenPerResponse`, `maxIterations`,
138
+ * `mode`), the `guardrails` and (voice) the `voice` settings. Empty when the
139
+ * node carries prompts itself (an embedded node, e.g. a `.flow` saved by Studio
140
+ * Web with the self-contained flag on), or when no sidecar can be read.
141
+ *
142
+ * A run setting equal to the default a sidecar writer fills in (`temperature`
143
+ * 0, `maxTokens` 16384, `mode` `'standard'`) is not recovered: recompiling
144
+ * without it writes the same sidecar, and recovering it would add an argument
145
+ * the author never wrote to every agent. `mode: 'standard'` is the exception on
146
+ * a 1.3 node, where naming it is what selected that definition. The same goes
147
+ * for the inline agent's `maxIterations` 25: the SDK omits it when unset, but
148
+ * Studio Web always writes it (its `getDefaultAgentContent()` default), so
149
+ * every Studio Web-saved agent would otherwise decompile with `maxIterations: 25`.
150
+ */
151
+ export declare function agentSidecarInputs(o: {
152
+ /** The node's id, for the warnings. */
153
+ nodeId: string;
154
+ /** The node's own `inputs`. */
155
+ inputs: Record<string, unknown>;
156
+ /** The node's `inputs.source`, unwrapped from its envelope. */
157
+ source: string | undefined;
158
+ /** Which writer produced the sidecar. */
159
+ dialect: AgentSidecarDialect;
160
+ /** A file beside the `.flow`, by its path relative to it; undefined when it is not there. */
161
+ read: ((path: string) => string | undefined) | undefined;
162
+ warn(message: string): void;
163
+ }): Record<string, unknown>;
164
+ /**
165
+ * Where an agent schema property points to declare "this is a FILE":
166
+ * `{ $ref: JOB_ATTACHMENT_REF }`, with {@link jobAttachmentDefinition} under the
167
+ * same schema's `definitions['job-attachment']`.
168
+ */
169
+ export declare const JOB_ATTACHMENT_REF = "#/definitions/job-attachment";
170
+ /**
171
+ * The canonical `job-attachment` definition an agent schema's file field
172
+ * `$ref`s into — the uipath-agents skill's `agent-definition.md` § File
173
+ * Attachments ("Schema is fixed — copy verbatim"), and the same block the
174
+ * platform's own analyze-attachments tool contract carries.
175
+ *
176
+ * It tells the agent runtime that an input is an Orchestrator attachment, so a
177
+ * file tool (Analyze Files) can resolve the attachment's `ID`.
178
+ *
179
+ * A function, not a shared object: each schema gets its own copy, so an edit
180
+ * to one emitted file cannot reach another.
181
+ *
182
+ * (The case serializer keeps its own copy in `case/entry-points.ts`: that one
183
+ * mirrors the platform's `entry-points.json` packager byte for byte, and its
184
+ * `MimeType` description differs.)
185
+ */
186
+ export declare function jobAttachmentDefinition(): Record<string, unknown>;