@uipath/flow-tool 1.203.0-preview.205 → 1.204.0-preview.206

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 (117) hide show
  1. package/README.md +4 -0
  2. package/dist/THIRD-PARTY-NOTICES.md +237 -2
  3. package/dist/authoring-4kyzh1tf.js +23 -0
  4. package/dist/{binding-service-ft8mabkr.js → binding-service-815skxfx.js} +28 -30
  5. package/dist/{connector-service-qnpnwzpv.js → connector-service-xw4f8a7v.js} +34 -31
  6. package/dist/{conversion-FQTRFHRX-xh98wp2q.js → conversion-FQTRFHRX-1q7rk0te.js} +5 -5
  7. package/dist/{debug-conversation-trigger-fy19ygsm.js → debug-conversation-trigger-qdgvrekh.js} +14 -16
  8. package/dist/{debug-http-client-53qk6pc5.js → debug-http-client-s78gbtbn.js} +3 -3
  9. package/dist/{debug-service-nyk0s6mc.js → debug-service-0ppdzgzv.js} +4 -4
  10. package/dist/{edge-service-an71q4ry.js → edge-service-ttzfnxkf.js} +13 -14
  11. package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
  12. package/dist/{flow-api-2phdajnk.js → flow-api-b7k5dtpm.js} +8 -8
  13. package/dist/{flow-debug-service-bnzgj53b.js → flow-debug-service-4we602jx.js} +38 -35
  14. package/dist/{flow-eval-node-target-2mjben3g.js → flow-eval-node-target-331vzbkw.js} +14 -15
  15. package/dist/{flow-eval-run-api-1bw5e0k4.js → flow-eval-run-api-yq18x5rb.js} +4 -4
  16. package/dist/{flow-eval-run-service-qv8j8fd1.js → flow-eval-run-service-36h1bnm8.js} +40 -37
  17. package/dist/{flow-eval-service-amd02ctw.js → flow-eval-service-ndtk9f9j.js} +19 -20
  18. package/dist/flow-init-sdk-source-9fy9p8ap.js +58 -0
  19. package/dist/{flow-init-service-rnygj5f8.js → flow-init-service-kwhbdtpc.js} +19 -18
  20. package/dist/{flow-io-hddhkve5.js → flow-io-pt392xct.js} +13 -14
  21. package/dist/{flow-migrate-service-e3hm99gp.js → flow-migrate-service-xvz8pbmp.js} +14 -15
  22. package/dist/{flow-pack-service-g8jebcts.js → flow-pack-service-wg1kt2bt.js} +72 -39
  23. package/dist/flow-validate-service-xbhrj47n.js +64 -0
  24. package/dist/{governance-fetcher-cswx2cw7.js → governance-fetcher-5yy89pfd.js} +6 -5
  25. package/dist/{headless-mmnrkzve.js → headless-1pdmae01.js} +2 -2
  26. package/dist/{hitl-service-a4fmjrzh.js → hitl-service-q2d39v5s.js} +13 -14
  27. package/dist/{index-3ts7y9d3.js → index-2s8rmmw6.js} +5 -3
  28. package/dist/index-3jpjaq1g.js +26 -0
  29. package/dist/{index-t5zedby6.js → index-41vyzws2.js} +59 -27
  30. package/dist/{index-b46bavh7.js → index-5yw15y73.js} +2 -2
  31. package/dist/{index-212q16sv.js → index-7qw3ttge.js} +416 -87
  32. package/dist/{index-t8e0ft8r.js → index-c1q6mnw1.js} +3 -3
  33. package/dist/{index-xa7gm52r.js → index-dqqg54v6.js} +601 -61
  34. package/dist/index.js +10 -10
  35. package/dist/init.d.ts +1 -1
  36. package/dist/init.js +19 -18
  37. package/dist/{input-reader-tw0j373f.js → input-reader-bv7kt19c.js} +2 -2
  38. package/dist/{known-types-b64as10y.js → known-types-jhyhnkt6.js} +4 -4
  39. package/dist/{maestro-automate-entry-pqy9xqm3.js → maestro-automate-entry-qak46eg0.js} +2 -2
  40. package/dist/node-2whm5wkf.js +4823 -0
  41. package/dist/{node-service-qnny15cm.js → node-service-js01ft95.js} +31 -30
  42. package/dist/{node-strategy-gc4sg6a2.js → node-strategy-fdnkvq4a.js} +1 -1
  43. package/dist/{node-sync-service-f1x1ak6q.js → node-sync-service-pb3m4dp2.js} +9 -9
  44. package/dist/{packager-tool-et7wj8kr.js → packager-tool-0w4es6rz.js} +2 -2
  45. package/dist/{packager-tool-dph5p2f5.js → packager-tool-1mnq1c97.js} +1 -1
  46. package/dist/packager-tool-225z77w9.js +52 -0
  47. package/dist/{packager-tool-de2txaxx.js → packager-tool-2hzsf1rc.js} +5 -5
  48. package/dist/{packager-tool-vbser1d9.js → packager-tool-2qr8z5ke.js} +4 -4
  49. package/dist/{packager-tool-0egkaa38.js → packager-tool-32czz9mq.js} +2 -2
  50. package/dist/{packager-tool-0v3s8r01.js → packager-tool-3h2ktz6q.js} +2 -2
  51. package/dist/{packager-tool-h9d8c9rf.js → packager-tool-4zdhy0c3.js} +2 -2
  52. package/dist/{packager-tool-afd1wwf2.js → packager-tool-53c81nnr.js} +440 -29
  53. package/dist/{packager-tool-2c688mdj.js → packager-tool-57fak54h.js} +4 -4
  54. package/dist/{packager-tool-qa2xzxez.js → packager-tool-59s95scr.js} +1 -1
  55. package/dist/{packager-tool-n8p9cay6.js → packager-tool-6azk3rex.js} +1 -1
  56. package/dist/{packager-tool-26ydwf12.js → packager-tool-6h69pd2a.js} +23 -8
  57. package/dist/{packager-tool-mnrbdn6a.js → packager-tool-6scjsgh6.js} +55 -17
  58. package/dist/{packager-tool-xzf4xc65.js → packager-tool-70cta0be.js} +4 -4
  59. package/dist/{packager-tool-tw3j5h3z.js → packager-tool-8hj7w7em.js} +5 -5
  60. package/dist/{packager-tool-795gzq9k.js → packager-tool-8pmgk4f6.js} +1 -1
  61. package/dist/{packager-tool-321a1806.js → packager-tool-8vmx4j2w.js} +1 -1
  62. package/dist/{packager-tool-cnftzx4c.js → packager-tool-a6ph7149.js} +40 -11
  63. package/dist/{packager-tool-s0mzv3sx.js → packager-tool-aw60v0et.js} +1 -1
  64. package/dist/{packager-tool-e89k4pjj.js → packager-tool-c0rtxezv.js} +1 -1
  65. package/dist/{packager-tool-1w4f09cq.js → packager-tool-d0ny3x3b.js} +141 -96
  66. package/dist/{packager-tool-gzpvdcnw.js → packager-tool-da1cmt0q.js} +2 -2
  67. package/dist/{packager-tool-p8j4zvrq.js → packager-tool-dp8vjby4.js} +4829 -1364
  68. package/dist/packager-tool-e5hj89zm.js +6 -0
  69. package/dist/{packager-tool-fwp34rqp.js → packager-tool-ev80vk13.js} +8 -8
  70. package/dist/{packager-tool-gctpkdzs.js → packager-tool-hhy1gr2k.js} +1 -1
  71. package/dist/{packager-tool-sf9f6jft.js → packager-tool-hygq2wy6.js} +1 -1
  72. package/dist/{packager-tool-0v3tzseq.js → packager-tool-jeb6xmgw.js} +2 -2
  73. package/dist/packager-tool-krzxg3ga.js +804 -0
  74. package/dist/{packager-tool-1r5dnt9q.js → packager-tool-mv4jav1h.js} +1 -1
  75. package/dist/{packager-tool-pppzgwfw.js → packager-tool-n4vdjmjx.js} +18079 -18079
  76. package/dist/{packager-tool-t9c77psy.js → packager-tool-p1tb6d4f.js} +955 -150
  77. package/dist/{packager-tool-gs28y1eq.js → packager-tool-qhhrq12s.js} +2 -2
  78. package/dist/{packager-tool-6k8s7pt9.js → packager-tool-r7xy9sew.js} +1090 -545
  79. package/dist/{packager-tool-b1xs6aty.js → packager-tool-stq8800d.js} +902 -897
  80. package/dist/{packager-tool-61r38k4d.js → packager-tool-t57d6pzz.js} +320 -200
  81. package/dist/{packager-tool-a7t9v5ss.js → packager-tool-v9v9ch04.js} +2 -2
  82. package/dist/{packager-tool-cdn59g60.js → packager-tool-ve5t7317.js} +2 -2
  83. package/dist/{packager-tool-yxv9mm8s.js → packager-tool-vtaqtf7f.js} +10 -10
  84. package/dist/{packager-tool-t39edv0g.js → packager-tool-w3dy6vnj.js} +184 -193
  85. package/dist/{packager-tool-9kx94sj5.js → packager-tool-x5qafkb7.js} +2 -2
  86. package/dist/{packager-tool-s841bbkr.js → packager-tool-yednpbbw.js} +2 -2
  87. package/dist/{packager-tool-yxnepq2j.js → packager-tool-ysbskrta.js} +1 -1
  88. package/dist/packager-tool-zgsvggdr.js +50 -0
  89. package/dist/packager-tool.js +12 -13
  90. package/dist/{serialization-BXU6AKAN-rhgmwp06.js → serialization-BXU6AKAN-c2ge8yvb.js} +5 -5
  91. package/dist/services/flow-init-sdk-source.d.ts +28 -0
  92. package/dist/services/flow-init-service.d.ts +25 -0
  93. package/dist/services/inline-activity-service.d.ts +135 -0
  94. package/dist/services/node-service.d.ts +14 -0
  95. package/dist/services/node-validators/index.d.ts +2 -0
  96. package/dist/services/node-validators/inline-activity-validator.d.ts +18 -0
  97. package/dist/services/node-validators/types.d.ts +6 -0
  98. package/dist/services/node-validators/unresolved-binding-placeholder-validator.d.ts +2 -0
  99. package/dist/services/preview-id-rule.d.ts +33 -0
  100. package/dist/services/ui-only-node-types.d.ts +1 -0
  101. package/dist/{shared-utils-wv356cvj.js → shared-utils-9vfmrxtx.js} +2 -2
  102. package/dist/{packager-tool-es0a755k.js → tidy-service-q2wwwans.js} +33 -7
  103. package/dist/tool.js +10 -10
  104. package/dist/utils/flow-io.d.ts +3 -16
  105. package/dist/validation.js +35 -36
  106. package/dist/{variable-service-bc7920kx.js → variable-service-nm9fdwsw.js} +13 -14
  107. package/dist/{wait-for-flow-job-v0njb0dk.js → wait-for-flow-job-yzyamptd.js} +8 -8
  108. package/package.json +2 -2
  109. package/dist/authoring-tv4dh80p.js +0 -360
  110. package/dist/flow-validate-service-x9dtdrc7.js +0 -65
  111. package/dist/node-xdgxafqs.js +0 -15600
  112. package/dist/packager-tool-2513jrxr.js +0 -898
  113. package/dist/packager-tool-5kt8tsq4.js +0 -85
  114. package/dist/packager-tool-w0kr4mbc.js +0 -996
  115. package/dist/services/tidy-service.d.ts +0 -26
  116. package/dist/tidy-service-8y2tjmb5.js +0 -39
  117. /package/dist/{localization-y790z9vm.js → localization-xecwjpe2.js} +0 -0
@@ -1,28 +1,23 @@
1
1
  import {
2
2
  addBinding,
3
3
  createBinding
4
- } from "./packager-tool-n8p9cay6.js";
4
+ } from "./packager-tool-6azk3rex.js";
5
5
  import {
6
6
  isMaestroAutomateSentinel,
7
7
  resolveRuntimeProfile,
8
8
  withRuntimeProfile
9
- } from "./packager-tool-gctpkdzs.js";
10
- import {
11
- getFileSystem
12
- } from "./packager-tool-2513jrxr.js";
9
+ } from "./packager-tool-hhy1gr2k.js";
13
10
  import {
14
11
  NugetConstants,
15
12
  NugetPackager,
16
13
  Path,
17
14
  ProjectTool,
18
- ProjectTypes,
19
15
  TemporaryStorageService,
20
- ToolErrorCodes,
21
16
  ToolResult,
22
17
  ensureProjectId,
23
18
  toolsFactoryRepository,
24
19
  writeContentOperateFile
25
- } from "./packager-tool-b1xs6aty.js";
20
+ } from "./packager-tool-stq8800d.js";
26
21
  import {
27
22
  en_default
28
23
  } from "./packager-tool-rs6jm14d.js";
@@ -36,21 +31,24 @@ import {
36
31
  encodeFlatName,
37
32
  getContainerChildProps,
38
33
  isSyntheticAgentInputId
39
- } from "./packager-tool-et7wj8kr.js";
34
+ } from "./packager-tool-0w4es6rz.js";
40
35
  import {
41
36
  AGENT_PREFIX,
42
37
  VARIABLE_PATH_IDENTIFIER_PATTERN,
43
38
  VARIABLE_PATH_SELECTOR_PATTERN
44
- } from "./packager-tool-qa2xzxez.js";
39
+ } from "./packager-tool-59s95scr.js";
45
40
  import {
41
+ AGENT_NODE_TYPES,
46
42
  FLAT_SEP,
47
43
  JS_EXPRESSION_PREFIX,
48
44
  MINIMUM_SUPPORTED_SCHEMA_VERSION,
49
45
  ProjectType,
50
46
  VALID_IDENTIFIER_PATTERN,
47
+ cliRules,
51
48
  coerceInputsViaSchema,
52
49
  coerceToExpressionValue,
53
50
  compareVersions,
51
+ conditionExpressionRule,
54
52
  decodeLiteral,
55
53
  deepEqual,
56
54
  fileFormatToInMemoryWorkflow,
@@ -62,9 +60,13 @@ import {
62
60
  inMemoryWorkflowToFileFormat,
63
61
  isAgentNodeType,
64
62
  isAgentResourceNodeType,
63
+ isBlockingSeverity,
65
64
  isExpressionValue,
66
65
  isVoiceAgentNodeType,
66
+ parseWorkflowJson,
67
67
  resolveRefs,
68
+ runRules,
69
+ toSerializedNodes,
68
70
  workflowSchemaV1_0,
69
71
  workflowSchemaV1_0_0,
70
72
  workflowSchemaV1_1,
@@ -77,9 +79,10 @@ import {
77
79
  workflowSchemaV1_7,
78
80
  workflowSchemaV1_8,
79
81
  workflowSchemaV1_9
80
- } from "./packager-tool-yxnepq2j.js";
82
+ } from "./packager-tool-ysbskrta.js";
81
83
  import {
82
- createI18nRegistrar
84
+ createI18nRegistrar,
85
+ registerFlowSchemaI18n
83
86
  } from "./packager-tool-p79yh9ww.js";
84
87
  import {
85
88
  applyMigrations,
@@ -90,7 +93,7 @@ import {
90
93
  getLatestVersion,
91
94
  instance,
92
95
  migrations
93
- } from "./packager-tool-pppzgwfw.js";
96
+ } from "./packager-tool-n4vdjmjx.js";
94
97
  import {
95
98
  init_esm_shims
96
99
  } from "./packager-tool-6ejqwbw9.js";
@@ -98,6 +101,9 @@ import {
98
101
  __commonJS as __commonJS2,
99
102
  __toESM as __toESM2
100
103
  } from "./packager-tool-mcaf4ewf.js";
104
+ import {
105
+ getFileSystem
106
+ } from "./packager-tool-3h2ktz6q.js";
101
107
  import {
102
108
  __commonJS,
103
109
  __export,
@@ -3717,7 +3723,7 @@ var require_semver2 = __commonJS2({
3717
3723
  init_esm_shims();
3718
3724
  init_esm_shims();
3719
3725
  async function convert(flowJson, options) {
3720
- const { flowJsonToBpmnXml } = await import("./conversion-FQTRFHRX-xh98wp2q.js");
3726
+ const { flowJsonToBpmnXml } = await import("./conversion-FQTRFHRX-1q7rk0te.js");
3721
3727
  return flowJsonToBpmnXml(flowJson, options);
3722
3728
  }
3723
3729
  init_esm_shims();
@@ -5559,6 +5565,18 @@ async function resolveWorkflowRefs(parsed, resolver, baseUri) {
5559
5565
  }
5560
5566
  return { resolved, refMap };
5561
5567
  }
5568
+ async function inlineFlowRefs(fs, content, filePath, logger) {
5569
+ if (!content.includes('"$ref"'))
5570
+ return content;
5571
+ let parsed;
5572
+ try {
5573
+ parsed = JSON.parse(content);
5574
+ } catch {
5575
+ return content;
5576
+ }
5577
+ const { resolved } = await resolveWorkflowRefs(parsed, createFlowRefResolver(fs, logger), filePath);
5578
+ return JSON.stringify(resolved);
5579
+ }
5562
5580
  async function resolveAndMigrateWorkflow(parsed, resolver, baseUri, logger) {
5563
5581
  const { resolved, refMap } = await resolveWorkflowRefs(parsed, resolver, baseUri);
5564
5582
  const migrated = migrateRawWorkflow(resolved, logger);
@@ -5587,6 +5605,65 @@ async function readUtf8OrNull(fs, filePath) {
5587
5605
  return null;
5588
5606
  return typeof buffer === "string" ? buffer : new TextDecoder().decode(buffer);
5589
5607
  }
5608
+ async function resolveProjectFlowFile(fs, projectPath) {
5609
+ const found = await tryResolveProjectFlowFile(fs, projectPath);
5610
+ if (!found) {
5611
+ throw new Error(`Missing .flow file in ${projectPath}`);
5612
+ }
5613
+ return found;
5614
+ }
5615
+ async function tryResolveProjectFlowFile(fs, projectPath) {
5616
+ let uiproj;
5617
+ try {
5618
+ const raw = await fs.readFile(fs.path.join(projectPath, "project.uiproj"), "utf-8");
5619
+ uiproj = JSON.parse(raw);
5620
+ } catch {
5621
+ uiproj = undefined;
5622
+ }
5623
+ const safeName = uiproj?.Name?.replace(/[^a-zA-Z0-9_-]/g, "_");
5624
+ return tryFindProjectFlowFile(fs, projectPath, uiproj?.MainFile, safeName);
5625
+ }
5626
+ async function findProjectFlowFile(fs, projectPath, mainFile, preferredBaseName) {
5627
+ const found = await tryFindProjectFlowFile(fs, projectPath, mainFile, preferredBaseName);
5628
+ if (!found) {
5629
+ throw new Error(`Missing .flow file in ${projectPath}`);
5630
+ }
5631
+ return found;
5632
+ }
5633
+ async function tryFindProjectFlowFile(fs, projectPath, mainFile, preferredBaseName) {
5634
+ if (mainFile?.endsWith(".flow")) {
5635
+ const mainFilePath = fs.path.join(projectPath, mainFile);
5636
+ if (isInsideDirectory(fs, projectPath, mainFilePath) && await fs.exists(mainFilePath)) {
5637
+ return mainFilePath;
5638
+ }
5639
+ }
5640
+ const preferred = preferredBaseName ? `${preferredBaseName}.flow`.toLowerCase() : undefined;
5641
+ const candidateDirs = [
5642
+ projectPath,
5643
+ fs.path.join(projectPath, "content"),
5644
+ fs.path.join(projectPath, "flow_files")
5645
+ ];
5646
+ for (const dir of candidateDirs) {
5647
+ if (!await fs.exists(dir)) {
5648
+ continue;
5649
+ }
5650
+ const stat = await fs.stat(dir);
5651
+ if (!stat?.isDirectory()) {
5652
+ continue;
5653
+ }
5654
+ const flowFiles = (await fs.readdir(dir)).filter((entry) => entry.endsWith(".flow"));
5655
+ if (flowFiles.length === 0) {
5656
+ continue;
5657
+ }
5658
+ const chosen = (preferred && flowFiles.find((f) => f.toLowerCase() === preferred)) ?? flowFiles[0];
5659
+ return fs.path.join(dir, chosen);
5660
+ }
5661
+ return;
5662
+ }
5663
+ function isInsideDirectory(fs, directory, candidate) {
5664
+ const relative = fs.path.relative(directory, candidate);
5665
+ return relative !== "" && !/^\.\.(?:[\\/]|$)/.test(relative) && !fs.path.isAbsolute(relative);
5666
+ }
5590
5667
 
5591
5668
  // ../packager/packager-tool-flow/src/agent-input-encoding-utils.ts
5592
5669
  var SCHEMA_CONTAINER_MARKER2 = "x-uipath-container";
@@ -5651,6 +5728,19 @@ function readInlineAgentSource(node) {
5651
5728
  }
5652
5729
  return;
5653
5730
  }
5731
+ function agentJsonReader(fs, flowDir) {
5732
+ return async (sourceId) => {
5733
+ try {
5734
+ const raw = await fs.readFile(fs.path.join(flowDir, sourceId, "agent.json"), "utf-8");
5735
+ if (!raw)
5736
+ return;
5737
+ const agent = JSON.parse(raw);
5738
+ return typeof agent === "object" && agent !== null && !Array.isArray(agent) ? agent : undefined;
5739
+ } catch {
5740
+ return;
5741
+ }
5742
+ };
5743
+ }
5654
5744
  function isInlineAgentNodeType(type) {
5655
5745
  return isAgentNodeType(type);
5656
5746
  }
@@ -5715,6 +5805,245 @@ function setPublishIntentOnInlineAgents(fileFormat) {
5715
5805
  }
5716
5806
  }
5717
5807
 
5808
+ // ../packager/packager-tool-flow/src/flow-validation.ts
5809
+ var validationMessagesRegistered = false;
5810
+ function ensureValidationMessages() {
5811
+ if (validationMessagesRegistered)
5812
+ return;
5813
+ if (!instance.isInitialized) {
5814
+ instance.init({
5815
+ lng: "en",
5816
+ fallbackLng: "en",
5817
+ defaultNS: "validation",
5818
+ resources: {},
5819
+ interpolation: { escapeValue: false }
5820
+ });
5821
+ }
5822
+ registerFlowSchemaI18n(instance);
5823
+ validationMessagesRegistered = true;
5824
+ }
5825
+ function hydrateAgentNodeInputs(node, agent) {
5826
+ if (!node.inputs)
5827
+ node.inputs = {};
5828
+ const inputs = node.inputs;
5829
+ const settings = agent.settings;
5830
+ if (isVoiceAgentNodeType(node.type)) {
5831
+ const voiceSettings = isRecord7(settings) ? settings.voice : undefined;
5832
+ if (isRecord7(voiceSettings) && inputs.voice === undefined) {
5833
+ inputs.voice = voiceSettings;
5834
+ }
5835
+ }
5836
+ const messages = agent.messages;
5837
+ if (!Array.isArray(messages))
5838
+ return;
5839
+ for (const msg of messages) {
5840
+ if (!msg || typeof msg !== "object")
5841
+ continue;
5842
+ const m = msg;
5843
+ if (m.role === "system" && typeof m.content === "string") {
5844
+ inputs.systemPrompt ??= m.content;
5845
+ }
5846
+ if (m.role === "user" && typeof m.content === "string") {
5847
+ inputs.userPrompt ??= m.content;
5848
+ }
5849
+ }
5850
+ if (settings && typeof settings === "object") {
5851
+ const s = settings;
5852
+ if (typeof s.temperature === "number" && inputs.temperature === undefined) {
5853
+ inputs.temperature = s.temperature;
5854
+ }
5855
+ if (typeof s.maxTokens === "number" && inputs.maxTokenPerResponse === undefined) {
5856
+ inputs.maxTokenPerResponse = s.maxTokens;
5857
+ }
5858
+ if (typeof s.model === "string" && inputs.model === undefined) {
5859
+ inputs.model = s.model;
5860
+ }
5861
+ }
5862
+ }
5863
+ async function hydrateInlineAgents(nodes, readAgentJson) {
5864
+ for (const node of nodes) {
5865
+ if (!AGENT_NODE_TYPES.includes(node.type)) {
5866
+ continue;
5867
+ }
5868
+ const source = readInlineAgentSource(node);
5869
+ if (source === undefined || /[/\\.]/.test(source))
5870
+ continue;
5871
+ const agent = await readAgentJson(source);
5872
+ if (agent)
5873
+ hydrateAgentNodeInputs(node, agent);
5874
+ }
5875
+ }
5876
+ function isRecord7(value) {
5877
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5878
+ }
5879
+ function parseFlowSource(content) {
5880
+ ensureValidationMessages();
5881
+ const parsed = parseWorkflowJson(content);
5882
+ const { workflow, parseError, parseIssues } = parsed;
5883
+ if (parseError || !workflow) {
5884
+ const recoveredIssues = parseIssues && parseIssues.length > 0 ? parseIssues : parseError ? splitSchemaParseError(parseError) : null;
5885
+ const fallback = [
5886
+ {
5887
+ path: "(root)",
5888
+ message: parseError ?? "File is not valid JSON",
5889
+ severity: "error"
5890
+ }
5891
+ ];
5892
+ return {
5893
+ ok: false,
5894
+ issues: recoveredIssues && recoveredIssues.length > 0 ? recoveredIssues.map((pi) => ({
5895
+ path: pi.path,
5896
+ message: pi.message,
5897
+ severity: "error"
5898
+ })) : fallback
5899
+ };
5900
+ }
5901
+ return {
5902
+ ok: true,
5903
+ workflow,
5904
+ rawDefErrorHandling: extractSupportsErrorHandling(content)
5905
+ };
5906
+ }
5907
+ function runDesignerRules(graph, options = {}) {
5908
+ ensureValidationMessages();
5909
+ const ctx = buildValidationContext(graph);
5910
+ if (options.governanceEnforcements) {
5911
+ ctx.governanceEnforcements = options.governanceEnforcements;
5912
+ }
5913
+ if (options.availableModelNames) {
5914
+ ctx.availableModelNames = options.availableModelNames;
5915
+ }
5916
+ const dropped = new Set(["expression-ref"]);
5917
+ if (options.isSubflow)
5918
+ dropped.add("trigger-required");
5919
+ const rules = cliRules.filter((r) => !dropped.has(r.id));
5920
+ const ruleErrors = runRules([...rules, conditionExpressionRule, ...options.extraRules ?? []], ctx);
5921
+ return ruleErrors.map(validationErrorToIssue);
5922
+ }
5923
+ async function validateFlowSource(content, readAgentJson) {
5924
+ const parsed = parseFlowSource(content);
5925
+ if (!parsed.ok) {
5926
+ return parsed.issues;
5927
+ }
5928
+ const { workflow } = parsed;
5929
+ const subflows = workflow.subflows ?? {};
5930
+ if (readAgentJson) {
5931
+ await hydrateInlineAgents(workflow.nodes, readAgentJson);
5932
+ for (const entry of Object.values(subflows)) {
5933
+ await hydrateInlineAgents(entry.nodes, readAgentJson);
5934
+ }
5935
+ }
5936
+ const issues = runDesignerRules(workflow);
5937
+ for (const [subflowId, entry] of Object.entries(subflows)) {
5938
+ const subGraph = {
5939
+ nodes: entry.nodes,
5940
+ edges: entry.edges,
5941
+ definitions: workflow.definitions,
5942
+ variables: entry.variables
5943
+ };
5944
+ const prefix = `subflows[${subflowId}].`;
5945
+ issues.push(...runDesignerRules(subGraph, { isSubflow: true }).map((issue) => ({
5946
+ ...issue,
5947
+ path: `${prefix}${issue.path}`
5948
+ })));
5949
+ }
5950
+ return issues;
5951
+ }
5952
+ function extractSupportsErrorHandling(content) {
5953
+ const map = new Map;
5954
+ let raw;
5955
+ try {
5956
+ raw = JSON.parse(content);
5957
+ } catch {
5958
+ return map;
5959
+ }
5960
+ if (!raw || typeof raw !== "object")
5961
+ return map;
5962
+ const defs = raw.definitions;
5963
+ if (!Array.isArray(defs))
5964
+ return map;
5965
+ for (const def of defs) {
5966
+ if (!def || typeof def !== "object")
5967
+ continue;
5968
+ const d = def;
5969
+ if (typeof d.nodeType === "string" && typeof d.version === "string" && d.supportsErrorHandling === true) {
5970
+ map.set(`${d.nodeType}:${d.version}`, true);
5971
+ }
5972
+ }
5973
+ return map;
5974
+ }
5975
+ function validationErrorToIssue(error) {
5976
+ let path;
5977
+ if (error.nodeId) {
5978
+ path = error.fieldPath ? `nodes[${error.nodeId}].${error.fieldPath}` : `nodes[${error.nodeId}]`;
5979
+ } else {
5980
+ path = error.fieldPath ?? "(workflow)";
5981
+ }
5982
+ return {
5983
+ path,
5984
+ message: `[${error.code}] ${error.message}`,
5985
+ severity: isBlockingSeverity(error.severity) ? "error" : "warning"
5986
+ };
5987
+ }
5988
+ function buildValidationContext(flow) {
5989
+ const nodes = toSerializedNodes(flow.nodes);
5990
+ const edges = flow.edges.map((e) => ({
5991
+ id: e.id,
5992
+ source: e.sourceNodeId,
5993
+ sourceHandle: e.sourcePort ?? null,
5994
+ target: e.targetNodeId,
5995
+ targetHandle: e.targetPort ?? null
5996
+ }));
5997
+ const manifests = new Map;
5998
+ for (const def of flow.definitions) {
5999
+ manifests.set(`${def.nodeType}:${def.version}`, {
6000
+ nodeType: def.nodeType,
6001
+ version: def.version,
6002
+ category: def.category,
6003
+ display: def.display,
6004
+ handleConfiguration: def.handleConfiguration,
6005
+ inputDefinition: def.inputDefinition,
6006
+ outputDefinition: def.outputDefinition,
6007
+ tags: def.tags
6008
+ });
6009
+ }
6010
+ const outputVariableIds = [];
6011
+ const variables = flow.variables;
6012
+ if (variables?.globals) {
6013
+ for (const v of variables.globals) {
6014
+ if (v.direction === "out" || v.direction === "inout") {
6015
+ outputVariableIds.push(v.id);
6016
+ }
6017
+ }
6018
+ }
6019
+ return {
6020
+ nodes,
6021
+ edges,
6022
+ manifests,
6023
+ outputVariableIds
6024
+ };
6025
+ }
6026
+ function splitSchemaParseError(parseError) {
6027
+ const header = "Schema validation failed:";
6028
+ if (!parseError.startsWith(header)) {
6029
+ return null;
6030
+ }
6031
+ const body = parseError.slice(header.length);
6032
+ const lines = body.split(`
6033
+ `);
6034
+ const issues = [];
6035
+ for (const rawLine of lines) {
6036
+ const match = /^\s*-\s+(.+?):\s(.*)$/.exec(rawLine);
6037
+ if (!match)
6038
+ continue;
6039
+ const [, path, message] = match;
6040
+ if (!path || !message)
6041
+ continue;
6042
+ issues.push({ path, message });
6043
+ }
6044
+ return issues.length > 0 ? issues : null;
6045
+ }
6046
+
5718
6047
  // ../packager/packager-tool-flow/src/voice-agent-definitions.ts
5719
6048
  function nodeLabel(node) {
5720
6049
  const label = node.display?.label;
@@ -5784,7 +6113,7 @@ function assertVoiceAgentDefinitionsEmbedded(bpmn, nodes) {
5784
6113
  // ../packager/packager-tool-flow/package.json
5785
6114
  var package_default = {
5786
6115
  name: "@uipath/packager-tool-flow",
5787
- version: "1.203.0-preview.205",
6116
+ version: "1.204.0-preview.206",
5788
6117
  description: "UiPath Flow tool implementation",
5789
6118
  type: "module",
5790
6119
  exports: {
@@ -5801,8 +6130,9 @@ var package_default = {
5801
6130
  },
5802
6131
  types: "./dist/index.d.ts",
5803
6132
  scripts: {
5804
- build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --sourcemap=linked && bun build ./src/maestro-automate-entry.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --sourcemap=linked && tsc --emitDeclarationOnly --outDir dist",
5805
- dev: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --watch",
6133
+ build: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --external i18next --sourcemap=linked && bun build ./src/maestro-automate-entry.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --sourcemap=linked && tsc -p tsconfig.build.json --emitDeclarationOnly --noCheck --outDir dist",
6134
+ typecheck: "tsc --noEmit",
6135
+ dev: "bun build ./src/index.ts --outdir dist --format esm --target browser --external @uipath/filesystem --external @uipath/solutionpackager-tool-core --external @uipath/tool-agent --external @uipath/flow-core --external @uipath/flow-converter --external @uipath/flow-migrations --external @uipath/flow-schema --external i18next --watch",
5806
6136
  test: "vitest run",
5807
6137
  "test:browser": "vitest run --config=vitest.browser.config.ts",
5808
6138
  "test:coverage": "vitest run --coverage",
@@ -5829,7 +6159,8 @@ var package_default = {
5829
6159
  "@uipath/flow-migrations": "0.56.2",
5830
6160
  "@uipath/flow-schema": "0.68.0",
5831
6161
  "@uipath/solutionpackager-tool-core": "workspace:*",
5832
- "@uipath/tool-agent": "^2.0.0"
6162
+ "@uipath/tool-agent": "^2.0.0",
6163
+ i18next: "^23.16.8"
5833
6164
  },
5834
6165
  devDependencies: {
5835
6166
  "@types/node": "^25.5.2",
@@ -5841,6 +6172,7 @@ var package_default = {
5841
6172
  "@vitest/browser": "^4.1.11",
5842
6173
  "@vitest/browser-playwright": "^4.1.11",
5843
6174
  "@vitest/coverage-v8": "^4.1.11",
6175
+ i18next: "^23.16.8",
5844
6176
  playwright: "^1.57.0",
5845
6177
  typescript: "^7.0.2",
5846
6178
  vitest: "^4.1.11"
@@ -17682,6 +18014,21 @@ var processAgents = async (fileSystem, logger, projectPath, contentFolder) => {
17682
18014
  return builtAgents;
17683
18015
  };
17684
18016
 
18017
+ // ../packager/packager-tool-flow/src/flow-validation-hook.ts
18018
+ function splitIssueMessage(message) {
18019
+ const match = /^\[([A-Z][A-Z0-9_]*)\]\s+(.*)$/s.exec(message);
18020
+ return match?.[2] ? { code: match[1], description: match[2] } : { description: message };
18021
+ }
18022
+ function nodeIdFromIssuePath(path) {
18023
+ let nodeId;
18024
+ for (const match of path.matchAll(/nodes\[([^\]]+)\]/g)) {
18025
+ if (match[1] !== undefined && !/^\d+$/.test(match[1])) {
18026
+ nodeId = match[1];
18027
+ }
18028
+ }
18029
+ return nodeId;
18030
+ }
18031
+
17685
18032
  // ../packager/packager-tool-flow/src/operate-runtime-options.ts
17686
18033
  var CONVERSATION_TRIGGER_NODE_TYPE = "core.trigger.conversation";
17687
18034
  function operateRuntimeOptions(nodes) {
@@ -17693,6 +18040,9 @@ var FlowConstants = {
17693
18040
  EntryPointsFileName: "entry-points.json",
17694
18041
  BindingsV2FileName: "bindings_v2.json"
17695
18042
  };
18043
+ var FLOW_VALIDATION_FAILED = "FLOW_VALIDATION_FAILED";
18044
+ var FLOW_VALIDATION_SOURCE = "Validator";
18045
+ var SUBFLOW_PATH_SEGMENT = "subflows[";
17696
18046
 
17697
18047
  class FlowTool extends ProjectTool {
17698
18048
  _temporaryStorage;
@@ -17704,11 +18054,59 @@ class FlowTool extends ProjectTool {
17704
18054
  this.logger.info("Restore operation is not required for Flow projects");
17705
18055
  return ToolResult.success();
17706
18056
  }
17707
- async validateAsync(_options, _cancellationToken) {
17708
- this.logger.info("Validate operation is not required for Flow projects");
17709
- return ToolResult.success();
18057
+ async validateAsync(options, _cancellationToken) {
18058
+ return this.runValidation(options.projectPath);
18059
+ }
18060
+ async runValidation(projectPath) {
18061
+ let flowFile;
18062
+ let issues;
18063
+ try {
18064
+ flowFile = await tryResolveProjectFlowFile(this.fileSystem, projectPath);
18065
+ if (flowFile === undefined) {
18066
+ this.logger.info("Flow project has no .flow file; skipping Flow validation");
18067
+ return ToolResult.success();
18068
+ }
18069
+ const content = await this.fileSystem.readFile(flowFile, "utf-8");
18070
+ if (content === null) {
18071
+ throw new Error(`Could not read ${flowFile}`);
18072
+ }
18073
+ this.logger.progress("Validating Flow project...");
18074
+ const source = await inlineFlowRefs(this.fileSystem, content, flowFile, this.logger);
18075
+ issues = await validateFlowSource(source, agentJsonReader(this.fileSystem, projectPath));
18076
+ } catch (error40) {
18077
+ const message = error40 instanceof Error ? error40.message : String(error40);
18078
+ this.logger.warn(`Could not validate the Flow project, continuing without validation: ${message}`);
18079
+ return ToolResult.success();
18080
+ }
18081
+ const flowFilePath = this.toProjectRelative(projectPath, flowFile);
18082
+ const findings = issues.map((issue2) => toFlowFinding(issue2, flowFilePath));
18083
+ const errors3 = issues.filter((issue2) => issue2.severity === "error");
18084
+ for (const issue2 of issues) {
18085
+ const line = `[${issue2.path}] ${issue2.message}`;
18086
+ if (issue2.severity === "error") {
18087
+ this.logger.error(line);
18088
+ } else {
18089
+ this.logger.warn(line);
18090
+ }
18091
+ }
18092
+ const result = errors3.length === 0 ? ToolResult.success() : ToolResult.error(FLOW_VALIDATION_FAILED, `Flow validation failed for ${flowFilePath}: ${errors3.length} error(s).`, "Open the flow in the designer and fix the reported errors, " + "or run 'uip maestro flow validate <project-path>' for the full list.");
18093
+ if (findings.length > 0) {
18094
+ result.details = { ...result.details, findings };
18095
+ }
18096
+ return result;
18097
+ }
18098
+ toProjectRelative(projectPath, filePath) {
18099
+ const root = `${Path.normalize(projectPath).replace(/\/$/, "")}/`;
18100
+ const file2 = Path.normalize(filePath);
18101
+ return file2.toLowerCase().startsWith(root.toLowerCase()) ? file2.slice(root.length) : Path.basename(file2);
17710
18102
  }
17711
18103
  async buildAsync(options, _cancellationToken) {
18104
+ if (!options.skipValidate) {
18105
+ const validationResult = await this.runValidation(options.projectPath);
18106
+ if (!validationResult.isSuccess) {
18107
+ return validationResult;
18108
+ }
18109
+ }
17712
18110
  const tempFolder = await this._temporaryStorage.getTempFolderPath();
17713
18111
  const localBuildFolder = Path.join(tempFolder, NugetConstants.OutputFolderName);
17714
18112
  const contentFolder = Path.join(localBuildFolder, NugetConstants.ContentFolderName);
@@ -17727,13 +18125,13 @@ class FlowTool extends ProjectTool {
17727
18125
  await this.createOperateFile(contentFolder, projectId, profile);
17728
18126
  this.logger.progress("Creating package-descriptor.json file...");
17729
18127
  await this.createPackageDescriptor(localBuildFolder, contentFolder);
17730
- return new ToolResult(ToolErrorCodes.Success, "done", [
18128
+ return new ToolResult("SUCCESS" /* Success */, "done", [
17731
18129
  localBuildFolder
17732
18130
  ]);
17733
18131
  } catch (error40) {
17734
18132
  const errorMessage = error40 instanceof Error ? error40.toString() : String(error40);
17735
18133
  this.logger.error(errorMessage);
17736
- return ToolResult.error(ToolErrorCodes.InternalError, "An error occurred while building Flow project files");
18134
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "An error occurred while building Flow project files");
17737
18135
  }
17738
18136
  }
17739
18137
  async packAsync(options, cancellationToken) {
@@ -17749,13 +18147,13 @@ class FlowTool extends ProjectTool {
17749
18147
  const packager = new NugetPackager(this.fileSystem);
17750
18148
  const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
17751
18149
  this.logger.progress("Package created successfully");
17752
- return new ToolResult(ToolErrorCodes.Success, "done", [
18150
+ return new ToolResult("SUCCESS" /* Success */, "done", [
17753
18151
  result.outputPath
17754
18152
  ]);
17755
18153
  } catch (error40) {
17756
18154
  const errorMessage = error40 instanceof Error ? error40.toString() : String(error40);
17757
18155
  this.logger.error(errorMessage);
17758
- return ToolResult.error(ToolErrorCodes.InternalError, "An error occurred while packing Flow project");
18156
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "An error occurred while packing Flow project");
17759
18157
  }
17760
18158
  }
17761
18159
  async dispose() {
@@ -17962,7 +18360,7 @@ class FlowTool extends ProjectTool {
17962
18360
  await writeContentOperateFile(this.fileSystem, {
17963
18361
  contentFolder,
17964
18362
  projectId,
17965
- contentType: ProjectTypes.Flow
18363
+ contentType: "Flow" /* Flow */
17966
18364
  });
17967
18365
  const operatePath = Path.join(contentFolder, NugetConstants.OperateFileName);
17968
18366
  const raw = await this.fileSystem.readFile(operatePath);
@@ -18002,10 +18400,23 @@ class FlowTool extends ProjectTool {
18002
18400
  await this.fileSystem.writeFile(packageDescriptorPath, packageDescriptorJson);
18003
18401
  }
18004
18402
  }
18403
+ function toFlowFinding(issue2, flowFilePath) {
18404
+ const { code, description } = splitIssueMessage(issue2.message);
18405
+ const nodeId = nodeIdFromIssuePath(issue2.path);
18406
+ const pathAddsLocation = nodeId === undefined || issue2.path.includes(SUBFLOW_PATH_SEGMENT);
18407
+ return {
18408
+ Level: issue2.severity === "warning" ? "Warning" : "Error",
18409
+ Source: FLOW_VALIDATION_SOURCE,
18410
+ ...code !== undefined && { ErrorCode: code },
18411
+ Description: pathAddsLocation ? `${issue2.path}: ${description}` : description,
18412
+ FilePath: flowFilePath,
18413
+ ...nodeId !== undefined && { ActivityIdRef: nodeId }
18414
+ };
18415
+ }
18005
18416
 
18006
18417
  // ../packager/packager-tool-flow/src/flow-tool-factory.ts
18007
18418
  class FlowToolFactory {
18008
- supportedTypes = [ProjectTypes.Flow];
18419
+ supportedTypes = ["Flow" /* Flow */];
18009
18420
  async createAsync(logger, fileSystem) {
18010
18421
  return new FlowTool(fileSystem, logger);
18011
18422
  }
@@ -18014,6 +18425,6 @@ class FlowToolFactory {
18014
18425
  // ../packager/packager-tool-flow/src/index.ts
18015
18426
  toolsFactoryRepository.registerProjectToolFactory(new FlowToolFactory);
18016
18427
 
18017
- export { convertFlowToBpmn, buildInlineAgentContract, extractProcessGuid, createProcessBindings, replaceExporterVersion, registerFlowMigrationsI18n, getMigrationChain, migrateWorkflowToFloor, minimumSupportedVersion, runtimeVersion, runtimeMigrations, checkNodeMigrations, applyNodeMigrations, createFlowRefResolver, resolveWorkflowRefs, resolveAndMigrateWorkflow, canonicalAgentInputPath, collectAgentInputLeaves, readInlineAgentSource, isInlineAgentNodeType, hydrateInlineAgentInputVariables, setPublishIntentOnInlineAgents, operateRuntimeOptions, voiceConvertOptions, assertVoiceAgentDefinitionsEmbedded, FlowToolFactory };
18428
+ export { convertFlowToBpmn, buildInlineAgentContract, extractProcessGuid, createProcessBindings, replaceExporterVersion, registerFlowMigrationsI18n, getMigrationChain, migrateWorkflowToFloor, minimumSupportedVersion, runtimeVersion, runtimeMigrations, checkNodeMigrations, applyNodeMigrations, createFlowRefResolver, resolveWorkflowRefs, inlineFlowRefs, resolveAndMigrateWorkflow, resolveProjectFlowFile, findProjectFlowFile, canonicalAgentInputPath, collectAgentInputLeaves, readInlineAgentSource, isInlineAgentNodeType, hydrateInlineAgentInputVariables, setPublishIntentOnInlineAgents, hydrateAgentNodeInputs, parseFlowSource, runDesignerRules, operateRuntimeOptions, voiceConvertOptions, assertVoiceAgentDefinitionsEmbedded, FlowToolFactory };
18018
18429
 
18019
- //# debugId=85413FF4B019362064756E2164756E21
18430
+ //# debugId=C8763BF0747ACD3064756E2164756E21
@@ -3,13 +3,13 @@ import {
3
3
  ReleasesApi,
4
4
  createOrchestratorConfig,
5
5
  resolveFolder
6
- } from "./packager-tool-p8j4zvrq.js";
6
+ } from "./packager-tool-dp8vjby4.js";
7
7
  import {
8
8
  parseJsonInputOrFile
9
- } from "./packager-tool-h9d8c9rf.js";
9
+ } from "./packager-tool-4zdhy0c3.js";
10
10
  import {
11
11
  getPersonalFolderKey
12
- } from "./packager-tool-9kx94sj5.js";
12
+ } from "./packager-tool-x5qafkb7.js";
13
13
  import {
14
14
  ErrorDecision,
15
15
  MIN_INTERVAL_MS,
@@ -18,7 +18,7 @@ import {
18
18
  logger,
19
19
  pollUntil,
20
20
  processContext
21
- } from "./packager-tool-6k8s7pt9.js";
21
+ } from "./packager-tool-r7xy9sew.js";
22
22
 
23
23
  // src/services/http-client.ts
24
24
  function buildCommonHeaders(config, options) {