@uipath/maestro-builder-sdk 6.96.6 → 6.96.7

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.
@@ -168,12 +168,24 @@ export declare function promptPlaceholders(s: {
168
168
  /** Which writer produced an `agent.json`: the inline, conversational or voice agent's. */
169
169
  export type AgentSidecarDialect = 'inline' | 'conversational' | 'voice';
170
170
  /**
171
- * The agent configuration a SHELL agent node keeps in its sidecar, read from
171
+ * The agent configuration an agent node keeps in its sidecar, read from
172
172
  * `<source>/agent.json` in the node's own input names: the prompts, the model,
173
173
  * the run settings (`temperature`, `maxTokenPerResponse`, `maxIterations`,
174
- * `mode`), the `guardrails` and (voice) the `voice` settings. Empty when the
175
- * node carries prompts itself (an embedded node, e.g. a `.flow` saved by Studio
176
- * Web with the self-contained flag on), or when no sidecar can be read.
174
+ * `mode`), the `guardrails` and (voice) the `voice` settings. Empty when no
175
+ * sidecar can be read. The caller spreads the node's own inputs over this, so
176
+ * a key on the node wins.
177
+ *
178
+ * The sidecar is read for an EMBEDDED node too (one that carries prompts
179
+ * itself, e.g. a `.flow` saved by Studio Web with the self-contained flag on,
180
+ * or a hand-built one): such a node often carries its prompts and no `model`,
181
+ * and the model is then only in `settings.model`. That is how the platform
182
+ * reads it as well: `uip maestro flow validate` and `flow pack` copy each
183
+ * sidecar value onto the node unless the node already has that key
184
+ * (`hydrateAgentNodeInputs`, uipath-cli `packager-tool-flow/src/flow-validation.ts`),
185
+ * and the packaged agent is built from `agent.json`. Skipping the sidecar for
186
+ * such a node decompiled `model: ""`, and compile then wrote `"model": ""`
187
+ * over the sidecar's real model. For an embedded node a missing sidecar is
188
+ * normal (a self-contained `.flow` needs none), so it is not warned about.
177
189
  *
178
190
  * A run setting equal to the default a sidecar writer fills in (`temperature`
179
191
  * 0, `maxTokens` 16384, `mode` `'standard'`) is not recovered: recompiling
@@ -324,12 +324,24 @@ function promptTokens(content) {
324
324
  /** The `maxIterations` Studio Web writes into every inline agent's `agent.json` (flow-workbench `getDefaultAgentContent()`). */
325
325
  const STUDIO_WEB_DEFAULT_MAX_ITERATIONS = 25;
326
326
  /**
327
- * The agent configuration a SHELL agent node keeps in its sidecar, read from
327
+ * The agent configuration an agent node keeps in its sidecar, read from
328
328
  * `<source>/agent.json` in the node's own input names: the prompts, the model,
329
329
  * the run settings (`temperature`, `maxTokenPerResponse`, `maxIterations`,
330
- * `mode`), the `guardrails` and (voice) the `voice` settings. Empty when the
331
- * node carries prompts itself (an embedded node, e.g. a `.flow` saved by Studio
332
- * Web with the self-contained flag on), or when no sidecar can be read.
330
+ * `mode`), the `guardrails` and (voice) the `voice` settings. Empty when no
331
+ * sidecar can be read. The caller spreads the node's own inputs over this, so
332
+ * a key on the node wins.
333
+ *
334
+ * The sidecar is read for an EMBEDDED node too (one that carries prompts
335
+ * itself, e.g. a `.flow` saved by Studio Web with the self-contained flag on,
336
+ * or a hand-built one): such a node often carries its prompts and no `model`,
337
+ * and the model is then only in `settings.model`. That is how the platform
338
+ * reads it as well: `uip maestro flow validate` and `flow pack` copy each
339
+ * sidecar value onto the node unless the node already has that key
340
+ * (`hydrateAgentNodeInputs`, uipath-cli `packager-tool-flow/src/flow-validation.ts`),
341
+ * and the packaged agent is built from `agent.json`. Skipping the sidecar for
342
+ * such a node decompiled `model: ""`, and compile then wrote `"model": ""`
343
+ * over the sidecar's real model. For an embedded node a missing sidecar is
344
+ * normal (a self-contained `.flow` needs none), so it is not warned about.
333
345
  *
334
346
  * A run setting equal to the default a sidecar writer fills in (`temperature`
335
347
  * 0, `maxTokens` 16384, `mode` `'standard'`) is not recovered: recompiling
@@ -342,13 +354,14 @@ const STUDIO_WEB_DEFAULT_MAX_ITERATIONS = 25;
342
354
  */
343
355
  export function agentSidecarInputs(o) {
344
356
  const { inputs, source, dialect } = o;
345
- if (typeof inputs.systemPrompt === 'string' || typeof inputs.userPrompt === 'string')
346
- return {};
357
+ const embedded = typeof inputs.systemPrompt === 'string' || typeof inputs.userPrompt === 'string';
347
358
  if (!source)
348
359
  return {};
349
360
  const path = `${source}/agent.json`;
350
361
  const raw = o.read?.(path);
351
362
  if (raw === undefined) {
363
+ if (embedded)
364
+ return {};
352
365
  o.warn(`agent step "${o.nodeId}" carries no prompts and ${path} was not found beside the .flow, `
353
366
  + 'so its prompts, model and run settings decompile empty. Keep <source>/agent.json beside the .flow '
354
367
  + '(download the whole project, not just the .flow).');
@@ -359,7 +372,7 @@ export function agentSidecarInputs(o) {
359
372
  agent = JSON.parse(raw);
360
373
  }
361
374
  catch {
362
- o.warn(`agent step "${o.nodeId}": ${path} is not valid JSON, so its prompts, model and run settings decompile empty.`);
375
+ o.warn(`agent step "${o.nodeId}": ${path} is not valid JSON, so its ${embedded ? '' : 'prompts, '}model and run settings decompile empty.`);
363
376
  return {};
364
377
  }
365
378
  const messages = (Array.isArray(agent?.messages) ? agent.messages : []);
@@ -540,9 +540,20 @@ export function checkInlineAgent(inputs, ctx) {
540
540
  }
541
541
  // The definition's own `required`: systemPrompt, userPrompt, model — each with
542
542
  // `minLength: 1`, so a blank string is as invalid as a missing key.
543
+ //
544
+ // `model` is the whole truth here, not only the node's copy: compile writes it
545
+ // into the agent's `<source>/agent.json` (`settings.model`), and decompile
546
+ // fills it from that file when the node carries none (`agentSidecarInputs`).
547
+ // So a blank one means no model anywhere: compile would write
548
+ // `"model": ""`. `uip maestro flow validate` accepts that (uip 1.205.0, with
549
+ // and without the sidecar beside the .flow), so this check is the only place
550
+ // it is said.
543
551
  if (blank(inputs?.model)) {
544
- at('INLINE_AGENT_NO_MODEL', `Inline agent step "${step}" has no \`model\`. The node's definition requires one (\`minLength: 1\`), so `
545
- + `a flow without it does not validate. \`uip agent model list\` shows what the tenant offers.`, `model: 'gpt-5.4'`);
552
+ at('INLINE_AGENT_NO_MODEL', `Inline agent step "${step}" has no \`model\`. The node's definition requires one (\`minLength: 1\`), and `
553
+ + `compile writes it as the agent's \`settings.model\` in \`<source>/agent.json\`, so the agent would be `
554
+ + `saved with \`"model": ""\`. \`uip maestro flow validate\` does not catch this. If the flow came from `
555
+ + `decompile, its agent project (\`<source>/agent.json\`) was not beside the .flow: decompile reads the `
556
+ + `model from there. \`uip agent model list\` shows what the tenant offers.`, `model: 'gpt-5.4'`);
546
557
  }
547
558
  if (blank(inputs?.systemPrompt)) {
548
559
  at('INLINE_AGENT_NO_SYSTEM_PROMPT', `Inline agent step "${step}" has no \`systemPrompt\`. The node's definition requires one `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.96.6",
3
+ "version": "6.96.7",
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",
@@ -113,5 +113,5 @@
113
113
  "@types/node": "^22.7.0",
114
114
  "esbuild": "^0.28.1"
115
115
  },
116
- "gitref": "d9bc41712e2b48a217958488517e21449bdd9ded"
116
+ "gitref": "0f0cc58b2213886cb7060dda81ed3193235c9d10"
117
117
  }