@uipath/maestro-builder-sdk 6.17.2 → 6.17.3

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/decompile.js CHANGED
@@ -1710,6 +1710,27 @@ function emitEventSubscription(node, imp, inputNames) {
1710
1710
  ['folder', folder !== undefined ? str(folder) : undefined],
1711
1711
  ]) + unboundMarker(node, { connection: conn, folder }, connector, event);
1712
1712
  }
1713
+ /**
1714
+ * Read back the expression template older SDK builds emitted on an in-solution
1715
+ * `agent()` input (#1013): `{ type: 'literal', expression: '{{ <js> }}' }`.
1716
+ * serialize now emits the platform's `{ type: 'jsExpression', expression }`
1717
+ * instead, but `.flow` files written between 2026-08-10 and the fix still carry
1718
+ * the template, and the runtime evaluates it (the agent receives the value, not
1719
+ * the braces). So on an in-solution agent node a literal that is exactly one
1720
+ * `{{ … }}` is that expression, and it decompiles to the reference it was
1721
+ * written from rather than to a string. Anything else is returned unchanged.
1722
+ */
1723
+ function legacyAgentTemplateInput(v) {
1724
+ if (!v || typeof v !== 'object' || Array.isArray(v))
1725
+ return v;
1726
+ const o = v;
1727
+ if (o.type !== 'literal' || typeof o.expression !== 'string')
1728
+ return v;
1729
+ const m = /^\{\{\s*([\s\S]+?)\s*\}\}$/.exec(o.expression);
1730
+ if (!m || m[1].includes('}}') || m[1].includes('{{'))
1731
+ return v;
1732
+ return { ...o, type: 'jsExpression', expression: m[1] };
1733
+ }
1713
1734
  function emitPublishedResource(node, imp, inputNames) {
1714
1735
  const FAMILIES = [
1715
1736
  { prefix: 'uipath.core.rpa-workflow.', factory: 'rpaWorkflow' },
@@ -1751,6 +1772,10 @@ function emitPublishedResource(node, imp, inputNames) {
1751
1772
  // author's map, so it comes back off here.
1752
1773
  const fireAndForget = unwrapPlain(inputs.fireAndForget) === true;
1753
1774
  delete inputs.fireAndForget;
1775
+ if (family.factory === 'agent' && (def?.model?.isInSolution === true || def?.model?.projectId !== undefined)) {
1776
+ for (const [k, v] of Object.entries(inputs))
1777
+ inputs[k] = legacyAgentTemplateInput(v);
1778
+ }
1754
1779
  const inputRows = Object.entries(inputs)
1755
1780
  .map(([k, v]) => [k, emitVal(v, imp, inputNames)]);
1756
1781
  const schema = def?.outputDefinition?.output?.schema?.properties;
package/dist/serialize.js CHANGED
@@ -5284,18 +5284,15 @@ export function serialize(built, opts = {}) {
5284
5284
  // three published families — 58 of 61 deployed agent instances carry no
5285
5285
  // node-level `model` at all.
5286
5286
  delete node.model;
5287
+ // Expression inputs stay `=js:` strings here, published or in-solution, and
5288
+ // the format migration wraps them as `{ type: 'jsExpression', expression }`
5289
+ // — the shape flow-core writes for an in-solution agent (52 of 54 v1
5290
+ // expression inputs, 09-01 → 10-08; the other 2 are bare `=js:` strings,
5291
+ // none is a `{{ }}` template). A `{ type: 'literal',
5292
+ // expression: '{{ … }}' }` template used to be emitted instead (#1013): it
5293
+ // ran, but it is the same envelope as a literal string, so decompile read
5294
+ // it back as one.
5287
5295
  node.inputs = renderMap(s.inputs, scope.rename);
5288
- if (inSolution) {
5289
- for (const [name, value] of Object.entries(node.inputs)) {
5290
- if (typeof value === 'string' && value.startsWith('=js:')) {
5291
- node.inputs[name] = {
5292
- type: 'literal',
5293
- expression: `{{ ${value.slice(4)} }}`,
5294
- fieldType: def.inputDefinition?.properties?.[name]?.type ?? 'string',
5295
- };
5296
- }
5297
- }
5298
- }
5299
5296
  scope.nodes.push(node);
5300
5297
  for (const t of tails)
5301
5298
  addEdge(scope, t, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.17.2",
3
+ "version": "6.17.3",
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",
@@ -92,5 +92,5 @@
92
92
  "@types/node": "^22.7.0",
93
93
  "esbuild": "^0.28.1"
94
94
  },
95
- "gitref": "629eba0e7332894902dec4cd1ef5c7072c02adf6"
95
+ "gitref": "8da4aeeb1592a342b2ac705939e646cd77baa891"
96
96
  }