@uipath/flow-tool 1.201.0 → 1.202.0-preview.136

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 (234) hide show
  1. package/dist/{authoring-7r6g06c7.js → authoring-wpa6d0vf.js} +74 -48
  2. package/dist/binding-service-dh91hw9e.js +141 -0
  3. package/dist/{browser-strategy-rkcvc6tn.js → browser-strategy-6atc7v8s.js} +3 -3
  4. package/dist/connector-service-d9ph9kx1.js +948 -0
  5. package/dist/{conversion-H2VEEYLB-ng48mbf7.js → conversion-QANACVCM-zs0hhfjv.js} +39 -33
  6. package/dist/{de-5KVP66U6-f7knj511.js → de-5KVP66U6-1bnf4zt5.js} +52 -52
  7. package/dist/de-6U7ECGHH-xwsw33fk.js +35 -0
  8. package/dist/{de-5HU6GFWV-4EZK6G7N-yrh21f52.js → de-7XQXX2DK-IDWR6CAR-n4z245kt.js} +857 -845
  9. package/dist/{de-5HU6GFWV-zheyw6d2.js → de-7XQXX2DK-tqdy5n2b.js} +857 -845
  10. package/dist/{de-HKTOVV4H-d5yw5j21.js → de-HKTOVV4H-pe9w0xn8.js} +46 -46
  11. package/dist/{de-XLT4QPIP-0rtw349w.js → de-XLT4QPIP-kj81dxjc.js} +9 -9
  12. package/dist/debug-conversation-trigger-452frzyz.js +41 -0
  13. package/dist/debug-http-client-wd6xb8v4.js +31 -0
  14. package/dist/debug-service-fvyexnb1.js +58 -0
  15. package/dist/edge-service-e77bndbe.js +162 -0
  16. package/dist/{elk.bundled-pydbzeez.js → elk.bundled-vpsbxz0p.js} +3 -3
  17. package/dist/{en-MABQK6C4-REWE2WG2-8dp4cqdg.js → en-5ZGC5VQ3-EWX7ILY7-rmtj70fk.js} +898 -898
  18. package/dist/{en-MABQK6C4-nkzq2j8t.js → en-5ZGC5VQ3-h581y30k.js} +897 -897
  19. package/dist/en-EPWMLP2N-2wvge238.js +28 -0
  20. package/dist/{en-UNT7BE26-rhh65jry.js → en-LQHKFSEY-vvbe8ve9.js} +13 -11
  21. package/dist/{en-P4AS26D7-szrzfxz1.js → en-P4AS26D7-zptp77bm.js} +45 -45
  22. package/dist/{en-4KXU7N7B-66fntxa2.js → en-X3S6IZ5J-nhkg6pwn.js} +54 -60
  23. package/dist/{es-MX-H2EAXLYI-qwnqt48x.js → es-MX-H2EAXLYI-j42kfkxy.js} +46 -46
  24. package/dist/es-MX-NHTIP5YM-ar6zfx95.js +35 -0
  25. package/dist/{es-MX-OKNDG2NH-c1k1s1tg.js → es-MX-OKNDG2NH-tcac6j4g.js} +9 -9
  26. package/dist/{es-MX-POESXYP2-UW6VP5QI-cd3a79g9.js → es-MX-U2VN3SZW-KYAJ2ONK-kdram1g1.js} +857 -845
  27. package/dist/{es-MX-POESXYP2-9538722k.js → es-MX-U2VN3SZW-anynsmd8.js} +857 -845
  28. package/dist/{es-MX-XAVLOQW3-9b3cp9n8.js → es-MX-XAVLOQW3-q00km2y7.js} +52 -52
  29. package/dist/{es-NQICVYSQ-aa9z3nhs.js → es-NQICVYSQ-3dtqgget.js} +9 -9
  30. package/dist/{es-O4PAV2CR-jwfaawwk.js → es-O4PAV2CR-0g23ve3v.js} +46 -46
  31. package/dist/es-PQ3RA33Q-y4kxhjfr.js +35 -0
  32. package/dist/{es-VFPNVMP5-thm0z9sr.js → es-VFPNVMP5-bx2c337j.js} +52 -52
  33. package/dist/{es-LUTYN7U7-IY5QWOUF-k2aefzc0.js → es-ZGCPPOME-24PJEGPV-rn86z9kn.js} +857 -845
  34. package/dist/{es-LUTYN7U7-ye5zn4sn.js → es-ZGCPPOME-8gazspjj.js} +857 -845
  35. package/dist/flow-api-wv8p8xbd.js +36 -0
  36. package/dist/flow-debug-service-tfbefas6.js +741 -0
  37. package/dist/flow-eval-node-target-c6wea7rz.js +44 -0
  38. package/dist/flow-eval-run-service-01kdky72.js +961 -0
  39. package/dist/flow-eval-service-ft8e16jz.js +1338 -0
  40. package/dist/flow-init-service-mva4crty.js +35 -0
  41. package/dist/flow-io-r318sjrw.js +36 -0
  42. package/dist/flow-migrate-service-rwcdx60q.js +119 -0
  43. package/dist/flow-pack-service-p4hxyj9e.js +280 -0
  44. package/dist/flow-validate-service-j25pxpwz.js +57 -0
  45. package/dist/{fr-5YRGHXF5-q6b63yg0.js → fr-5YRGHXF5-kz1ywpv6.js} +46 -46
  46. package/dist/{fr-E5MDO4EG-exvrs7ge.js → fr-E5MDO4EG-c3mkty2t.js} +52 -52
  47. package/dist/{fr-PFHIL7YZ-cxnshwa8.js → fr-PFHIL7YZ-2n589p47.js} +9 -9
  48. package/dist/fr-R4L3OAWI-30khpsmn.js +35 -0
  49. package/dist/{fr-LJIK56LW-STG6QR3T-cextvv8q.js → fr-T3G5GZCT-TU4IKBEG-k6xz1s1f.js} +857 -845
  50. package/dist/{fr-LJIK56LW-xf3xf2kh.js → fr-T3G5GZCT-y3f7xb1q.js} +857 -845
  51. package/dist/governance-fetcher-j9cx4f1d.js +391 -0
  52. package/dist/headless-h1myzz32.js +177196 -0
  53. package/dist/hitl-service-kvt5wms4.js +256 -0
  54. package/dist/index-1kgxzh8x.js +143 -0
  55. package/dist/index-4zrwgb3c.js +111 -0
  56. package/dist/index-ev4mdg5y.js +4801 -0
  57. package/dist/{index-er6vy3jk.js → index-eybzsdcc.js} +295 -317
  58. package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
  59. package/dist/{index-p50kx6jv.js → index-k5tbd184.js} +276 -276
  60. package/dist/index-n33np76r.js +630 -0
  61. package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
  62. package/dist/{index-dhcd9b82.js → index-w0z4s69j.js} +166 -81
  63. package/dist/index.js +29 -32
  64. package/dist/{index.umd.min-drpc57vn.js → index.umd.min-fqefd9kn.js} +3 -3
  65. package/dist/init.js +24 -25
  66. package/dist/input-reader-6pwhtp8v.js +11 -0
  67. package/dist/{ja-FGEGLBJ3-w9byjhze.js → ja-BI5K3JDZ-77zat4z2.js} +857 -845
  68. package/dist/{ja-FGEGLBJ3-MG3BSWXD-vq19zt2p.js → ja-BI5K3JDZ-GTIHISTZ-s6n3r2ab.js} +857 -845
  69. package/dist/{ja-DPO5PPLO-s2a7j3nj.js → ja-DPO5PPLO-mysfmznx.js} +52 -52
  70. package/dist/{ja-P4OSE367-8ywxep9a.js → ja-P4OSE367-srr3qypg.js} +9 -9
  71. package/dist/{ja-SDAPAVCR-943p5gx7.js → ja-SDAPAVCR-kg39dfap.js} +46 -46
  72. package/dist/ja-ZHKCBE5W-x73w6x3e.js +35 -0
  73. package/dist/{js-yaml-cggj6w7q.js → js-yaml-87cdx6bm.js} +27 -19
  74. package/dist/known-types-a20evmmg.js +20 -0
  75. package/dist/ko-6W7OGLLB-mnmqc584.js +35 -0
  76. package/dist/{ko-ITOPNIYI-qz39kamf.js → ko-ITOPNIYI-hmxd2asd.js} +52 -52
  77. package/dist/{ko-TUAK3G3A-s25w0ckg.js → ko-JOBF5V7N-4bv0mjje.js} +857 -845
  78. package/dist/{ko-TUAK3G3A-TBEBKOTM-ns78t2rv.js → ko-JOBF5V7N-O7T4HKIE-ape840y0.js} +857 -845
  79. package/dist/{ko-NAGOZLC3-wb3y9yhh.js → ko-NAGOZLC3-gaxxsnd2.js} +46 -46
  80. package/dist/{ko-PYOS2KJP-5sbj5bp8.js → ko-PYOS2KJP-e7dshyxy.js} +9 -9
  81. package/dist/localization-h8a53z6p.js +47 -0
  82. package/dist/{node-gd4469ea.js → node-cnrcrrb0.js} +7973 -7166
  83. package/dist/node-service-8g5x5d2y.js +70 -0
  84. package/dist/{node-strategy-8gzp67xs.js → node-strategy-gc4sg6a2.js} +132 -16
  85. package/dist/node-sync-service-e2reh33c.js +42 -0
  86. package/dist/{packager-tool-9qecd4wb.js → packager-tool-0gctz400.js} +5 -2
  87. package/dist/{packager-tool-1cb0d5e0.js → packager-tool-0v3s8r01.js} +2 -2
  88. package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
  89. package/dist/packager-tool-27avrkyk.js +15 -0
  90. package/dist/packager-tool-2wefykg9.js +106 -0
  91. package/dist/packager-tool-4fhgws0x.js +757 -0
  92. package/dist/{packager-tool-7yjpwj92.js → packager-tool-4hx14snw.js} +49 -48
  93. package/dist/{packager-tool-3wygxefb.js → packager-tool-58q3tvh7.js} +10 -10
  94. package/dist/{packager-tool-cvwr40ax.js → packager-tool-5qaxht3k.js} +1425 -550
  95. package/dist/packager-tool-5z1eg3ea.js +33289 -0
  96. package/dist/{packager-tool-17cn3xb7.js → packager-tool-6m078z5s.js} +13388 -19366
  97. package/dist/packager-tool-7b6tpg7y.js +77 -0
  98. package/dist/packager-tool-7exrv6w7.js +23 -0
  99. package/dist/packager-tool-8dszjcg5.js +4892 -0
  100. package/dist/packager-tool-8j92afwp.js +58 -0
  101. package/dist/packager-tool-94w17vf8.js +85 -0
  102. package/dist/{packager-tool-vdd02vns.js → packager-tool-9bec251q.js} +543 -1493
  103. package/dist/packager-tool-a1hbfmws.js +399 -0
  104. package/dist/{packager-tool-tq9q9m77.js → packager-tool-a42jnpy5.js} +3 -9
  105. package/dist/packager-tool-abbtfk2v.js +54 -0
  106. package/dist/packager-tool-cdwpc9fh.js +4945 -0
  107. package/dist/packager-tool-e0p2zsyc.js +97 -0
  108. package/dist/packager-tool-eebq62fq.js +540 -0
  109. package/dist/{packager-tool-m6x5sczh.js → packager-tool-em5r6g6j.js} +14 -21
  110. package/dist/packager-tool-eypvc2kv.js +23 -0
  111. package/dist/packager-tool-f0kd5kq4.js +2327 -0
  112. package/dist/packager-tool-fjaa8d3v.js +289 -0
  113. package/dist/packager-tool-g0eha8ge.js +121 -0
  114. package/dist/packager-tool-g9y14b10.js +54 -0
  115. package/dist/packager-tool-gbgfwx8f.js +2 -0
  116. package/dist/packager-tool-jc34wvrw.js +64 -0
  117. package/dist/packager-tool-k99nf3pq.js +25 -0
  118. package/dist/{packager-tool-hr0xg6q8.js → packager-tool-kn91khp6.js} +17 -13
  119. package/dist/{packager-tool-jysvpt8p.js → packager-tool-m3wkcxf5.js} +2 -2
  120. package/dist/{packager-tool-78a3szsp.js → packager-tool-m5qfverj.js} +1720 -2014
  121. package/dist/packager-tool-mwvbq6ef.js +79 -0
  122. package/dist/packager-tool-nq4rcqqg.js +87 -0
  123. package/dist/packager-tool-nxx8naxv.js +4234 -0
  124. package/dist/{packager-tool-3y0k15sv.js → packager-tool-p9stswjj.js} +2858 -19342
  125. package/dist/packager-tool-r0xpcqwg.js +188 -0
  126. package/dist/packager-tool-raq2wbwp.js +18 -0
  127. package/dist/{packager-tool-y3dezh8k.js → packager-tool-rs6jm14d.js} +6 -4
  128. package/dist/packager-tool-s9ff3kk4.js +6 -0
  129. package/dist/{packager-tool-pbsghbmj.js → packager-tool-sykgshez.js} +2 -2
  130. package/dist/packager-tool-tf3d2y8z.js +31 -0
  131. package/dist/packager-tool-tn5e7wnb.js +384 -0
  132. package/dist/packager-tool-v2rkcehq.js +457 -0
  133. package/dist/packager-tool-v86fdwvs.js +262 -0
  134. package/dist/packager-tool-v9psxdy5.js +8185 -0
  135. package/dist/packager-tool-v9rrz038.js +602 -0
  136. package/dist/packager-tool-vpqyvh4c.js +304 -0
  137. package/dist/packager-tool-wcha0e5r.js +443 -0
  138. package/dist/{packager-tool-1gt6js73.js → packager-tool-xhzfwa5p.js} +6 -4
  139. package/dist/{packager-tool-5arsyj36.js → packager-tool-yc4kw997.js} +4 -2
  140. package/dist/{packager-tool-pkq70dec.js → packager-tool-ywqc9rtf.js} +31 -3
  141. package/dist/{packager-tool-0567pxpm.js → packager-tool-z9bfhmm5.js} +10 -10
  142. package/dist/{packager-tool-gmrwvnyh.js → packager-tool-zfrp8ecz.js} +8 -58
  143. package/dist/{packager-tool-3vdpx9ng.js → packager-tool-zke08y39.js} +1121 -1846
  144. package/dist/packager-tool.js +17 -17
  145. package/dist/{pt-7TR74ZMB-1g8my56g.js → pt-7TR74ZMB-bmphh4x2.js} +46 -46
  146. package/dist/{pt-BR-7XGDXRDJ-TR5D7JYL-533wvy7p.js → pt-BR-7DYX2YPT-LZYH4YFD-bx43vx3z.js} +857 -845
  147. package/dist/{pt-BR-7XGDXRDJ-espnkgrj.js → pt-BR-7DYX2YPT-fqxqzqtf.js} +857 -845
  148. package/dist/{pt-BR-BXURWX4W-dqr4dnf9.js → pt-BR-BXURWX4W-bwfcwhk1.js} +52 -52
  149. package/dist/{pt-BR-DXXSYJDO-bn84ewp7.js → pt-BR-DXXSYJDO-a2tp13v7.js} +46 -46
  150. package/dist/pt-BR-UQCYHKMJ-q78n7q70.js +35 -0
  151. package/dist/{pt-BR-Z3TUDJHM-n7ngej6s.js → pt-BR-Z3TUDJHM-8v73x9s7.js} +9 -9
  152. package/dist/pt-D6A6MVB2-yvxca8vz.js +35 -0
  153. package/dist/{pt-TMVOOITK-myha14p9.js → pt-HTXGGX6Y-97t21dty.js} +857 -845
  154. package/dist/{pt-TMVOOITK-H2ADYHSD-ezpggv33.js → pt-HTXGGX6Y-ZHQSDFKI-vehfxadc.js} +857 -845
  155. package/dist/{pt-KSBWHAVQ-hd52bpsz.js → pt-KSBWHAVQ-mhvhgr2p.js} +9 -9
  156. package/dist/{pt-YI4VE4YQ-v7gjeg82.js → pt-YI4VE4YQ-wdkn2dcf.js} +52 -52
  157. package/dist/ro-4TMBHS5M-jz0anpt6.js +35 -0
  158. package/dist/{ro-BJFER5OI-334n28rj.js → ro-BJFER5OI-83tq8vxh.js} +46 -46
  159. package/dist/{ro-2VALF3S5-NXBJUEZN-nqw1zs33.js → ro-KTNQ3MNU-XIE6YPQN-gen8p82z.js} +857 -845
  160. package/dist/{ro-2VALF3S5-cdz5afkr.js → ro-KTNQ3MNU-y08n1x5g.js} +857 -845
  161. package/dist/{ro-RKXZUG7Z-cm3xn3fj.js → ro-RKXZUG7Z-nndrrsq7.js} +52 -52
  162. package/dist/{ro-VZUZTAMR-tccygznf.js → ro-VZUZTAMR-f4q0g3em.js} +9 -9
  163. package/dist/{ru-GSCT4ARZ-qj8dm4dp.js → ru-GSCT4ARZ-1sa9wbr8.js} +1 -1
  164. package/dist/{ru-GSCT4ARZ-FTVCGQTL-5nh4jf2e.js → ru-GSCT4ARZ-FTVCGQTL-gee86v14.js} +1 -1
  165. package/dist/{ru-T73OPRTC-mp5gn7gs.js → ru-T73OPRTC-4knxw497.js} +1 -1
  166. package/dist/{ru-WBLQ5B2U-awt245ky.js → ru-WBLQ5B2U-8r3c7v6d.js} +1 -1
  167. package/dist/ru-WBLQ5B2U-kdey8qa4.js +10 -0
  168. package/dist/{ru-WBLQ5B2U-57ezmxzz.js → ru-WBLQ5B2U-wemdzdqd.js} +1 -1
  169. package/dist/{serialization-GAW7UFOK-9hkdmmd2.js → serialization-J5QK3HPY-bgewpt6f.js} +158 -152
  170. package/dist/services/expression-validator.d.ts +28 -0
  171. package/dist/services/flow-eval-schema/types.d.ts +17 -0
  172. package/dist/services/flow-validate-service.d.ts +26 -0
  173. package/dist/services/node-validators/js-expression-syntax-validator.d.ts +6 -3
  174. package/dist/services/tidy-service.d.ts +26 -0
  175. package/dist/services/vars-reference-rule.d.ts +156 -0
  176. package/dist/shared-utils-8xdq6f04.js +20 -0
  177. package/dist/tidy-service-ashgyfwj.js +34 -0
  178. package/dist/tool.js +30 -33
  179. package/dist/{tr-AA6O2WSR-ga1xnymp.js → tr-AA6O2WSR-86ba4bdf.js} +52 -52
  180. package/dist/tr-GSQQ6SOT-hv1gyeaa.js +35 -0
  181. package/dist/{tr-RQTZ2DMS-bpgd4kma.js → tr-RQTZ2DMS-w3cwv8s4.js} +46 -46
  182. package/dist/{tr-W4AVRSQ4-bt3qqqdy.js → tr-W4AVRSQ4-hjr81xzk.js} +9 -9
  183. package/dist/{tr-RIFCEXFH-BZS7S7QK-q465b62g.js → tr-XHSSPNK7-GW5KVXR3-2w3f1ss6.js} +857 -845
  184. package/dist/{tr-RIFCEXFH-hgkb4g8y.js → tr-XHSSPNK7-cmqyc4wd.js} +857 -845
  185. package/dist/utils/handle-expansion.d.ts +16 -0
  186. package/dist/validation.js +47 -27
  187. package/dist/variable-service-er7ph4br.js +152 -0
  188. package/dist/wait-for-flow-job-45p1a444.js +134 -0
  189. package/dist/{zh-CN-IP3FMXWM-H3JI2XUM-ta4yac7h.js → zh-CN-2EHQT23P-T5XRQCVS-ac17dpc1.js} +857 -845
  190. package/dist/{zh-CN-IP3FMXWM-1cfarhcp.js → zh-CN-2EHQT23P-mr63c4xz.js} +857 -845
  191. package/dist/{zh-CN-6YRAN57T-j7jp34ws.js → zh-CN-6YRAN57T-rd7x2tqs.js} +9 -9
  192. package/dist/zh-CN-EDFRBU32-vvj7tmaq.js +35 -0
  193. package/dist/{zh-CN-R2KLHXQV-wttmznep.js → zh-CN-R2KLHXQV-agqr45ds.js} +52 -52
  194. package/dist/{zh-CN-ZC6LT4IN-vty9mvv8.js → zh-CN-ZC6LT4IN-kbzvvzz5.js} +46 -46
  195. package/dist/zh-TW-HAICM6DE-rh7k3cq7.js +35 -0
  196. package/dist/{zh-TW-AGIDXIPF-R4XZRDJZ-cgxxz5k4.js → zh-TW-MGZCE5BT-P6FLIUAR-zmq07vhs.js} +857 -845
  197. package/dist/{zh-TW-AGIDXIPF-n6r6w7vy.js → zh-TW-MGZCE5BT-c4ekmrz9.js} +857 -845
  198. package/dist/{zh-TW-R7Y5KVMU-q81f4z2p.js → zh-TW-R7Y5KVMU-m61y07e3.js} +46 -46
  199. package/dist/{zh-TW-RJGCQANM-gqn0aca0.js → zh-TW-RJGCQANM-w0x3qc1p.js} +52 -52
  200. package/dist/{zh-TW-SO2245GN-m5kh88bg.js → zh-TW-SO2245GN-n2bn1gg4.js} +9 -9
  201. package/package.json +2 -2
  202. package/dist/de-5KVP66U6-t37qr521.js +0 -161
  203. package/dist/de-WMKOGI7B-6dc1zdnp.js +0 -143
  204. package/dist/en-4KXU7N7B-24v330b5.js +0 -118
  205. package/dist/en-X4DLPKLJ-1h9gj5c1.js +0 -110
  206. package/dist/es-BVPGJUWA-0k59eqfv.js +0 -143
  207. package/dist/es-MX-U6YL5KQX-k4qvpgd4.js +0 -143
  208. package/dist/es-MX-XAVLOQW3-47a405kf.js +0 -161
  209. package/dist/es-VFPNVMP5-6sftsdxe.js +0 -161
  210. package/dist/fr-E5MDO4EG-f3x1jeqw.js +0 -161
  211. package/dist/fr-EKTTDR7Z-m2t68j0m.js +0 -143
  212. package/dist/ja-DPO5PPLO-fmbg7zt2.js +0 -161
  213. package/dist/ja-Y2YBTXNN-5sszk2zv.js +0 -143
  214. package/dist/ko-ITOPNIYI-aqy82jk8.js +0 -161
  215. package/dist/ko-S33XAV26-rfsv9myd.js +0 -143
  216. package/dist/packager-tool-0sz8se22.js +0 -10671
  217. package/dist/packager-tool-8mqydhz8.js +0 -9850
  218. package/dist/packager-tool-p9j43p8h.js +0 -115
  219. package/dist/packager-tool-v74yk918.js +0 -107
  220. package/dist/packager-tool-xj0agqpk.js +0 -11
  221. package/dist/pt-BR-BXURWX4W-xzyndmrx.js +0 -161
  222. package/dist/pt-BR-JO45SCNI-mt93s33c.js +0 -143
  223. package/dist/pt-W3NA4LIZ-fwd1q4j0.js +0 -143
  224. package/dist/pt-YI4VE4YQ-521681zf.js +0 -161
  225. package/dist/ro-RKXZUG7Z-pdztdafr.js +0 -161
  226. package/dist/ro-WLKX6HF5-b9tj8q67.js +0 -143
  227. package/dist/ru-WBLQ5B2U-8xd4gpv2.js +0 -10
  228. package/dist/ru-WBLQ5B2U-mswqs9wc.js +0 -10
  229. package/dist/tr-3U2W2XCA-43ptfc0m.js +0 -143
  230. package/dist/tr-AA6O2WSR-bj9n80k8.js +0 -161
  231. package/dist/zh-CN-IPZYQR3P-egjmvyjf.js +0 -143
  232. package/dist/zh-CN-R2KLHXQV-x6gnk2n0.js +0 -161
  233. package/dist/zh-TW-RJGCQANM-tt8j5wv2.js +0 -161
  234. package/dist/zh-TW-YPVSQVGT-b378ztph.js +0 -143
@@ -0,0 +1,1338 @@
1
+ import {
2
+ FlowEvalPathResolver,
3
+ findEvalSet,
4
+ findEvaluator,
5
+ getLinkedEvaluators,
6
+ removeEvaluatorRefFromSet
7
+ } from "./packager-tool-r0xpcqwg.js";
8
+ import {
9
+ FlowAgentNodeSchemaReader,
10
+ findFlowNode,
11
+ isDocumentEvalNode,
12
+ isNodeEvalTarget,
13
+ readNodeTargetId
14
+ } from "./packager-tool-g0eha8ge.js";
15
+ import {
16
+ buildDefaultCriteria,
17
+ buildEvaluatorConfig,
18
+ isRecord,
19
+ slugify
20
+ } from "./packager-tool-8j92afwp.js";
21
+ import {
22
+ FlowEvalFileStore
23
+ } from "./packager-tool-jc34wvrw.js";
24
+ import {
25
+ evaluatorTypeAliases,
26
+ resolveEvaluatorType
27
+ } from "./packager-tool-a1hbfmws.js";
28
+ import"./packager-tool-8dszjcg5.js";
29
+ import"./packager-tool-eebq62fq.js";
30
+ import"./packager-tool-6m078z5s.js";
31
+ import"./packager-tool-tn5e7wnb.js";
32
+ import"./packager-tool-xhzfwa5p.js";
33
+ import"./packager-tool-nkrmjr3a.js";
34
+ import"./packager-tool-rs6jm14d.js";
35
+ import"./packager-tool-hk1gxnth.js";
36
+ import"./packager-tool-em5r6g6j.js";
37
+ import"./packager-tool-9bec251q.js";
38
+ import"./packager-tool-z9bfhmm5.js";
39
+ import"./packager-tool-6ejqwbw9.js";
40
+ import"./packager-tool-mcaf4ewf.js";
41
+ import {
42
+ catchError
43
+ } from "./packager-tool-5qaxht3k.js";
44
+ import {
45
+ getFileSystem
46
+ } from "./packager-tool-0v3s8r01.js";
47
+ import"./packager-tool-vpqyvh4c.js";
48
+ import"./packager-tool-gbgfwx8f.js";
49
+ import"./packager-tool-58q3tvh7.js";
50
+ import"./packager-tool-sc961w0q.js";
51
+ import"./packager-tool-m5qfverj.js";
52
+ import"./packager-tool-e0p2zsyc.js";
53
+ import"./packager-tool-a42jnpy5.js";
54
+ import"./packager-tool-c23zrhj8.js";
55
+ import {
56
+ __require
57
+ } from "./packager-tool-1yh8g550.js";
58
+
59
+ // src/services/flow-child-simulation-schema.ts
60
+ var AGENT_TOOL_NODE_TYPE_PREFIX = "uipath.agent.resource.tool.";
61
+ function nameMatchesId(name, id) {
62
+ return name === id || sanitizeToolName(name) === id;
63
+ }
64
+ function readStringField(obj, ...keys) {
65
+ for (const key of keys) {
66
+ if (typeof obj[key] === "string")
67
+ return obj[key];
68
+ }
69
+ return;
70
+ }
71
+
72
+ class ChildSimulationSchemaReader {
73
+ fs;
74
+ pathResolver;
75
+ constructor(fs, pathResolver) {
76
+ this.fs = fs;
77
+ this.pathResolver = pathResolver;
78
+ }
79
+ async read(projectPath, parentComponentId, childComponentId, authConfig) {
80
+ const root = await this.pathResolver.resolveFlowProjectPath(projectPath);
81
+ const [flowError, flowFilePath] = await catchError(this.pathResolver.findFlowFile(root));
82
+ if (flowError || !flowFilePath) {
83
+ return { parentFound: false };
84
+ }
85
+ const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
86
+ let parsed;
87
+ try {
88
+ parsed = JSON.parse(flowContent);
89
+ } catch {
90
+ return { parentFound: false };
91
+ }
92
+ if (!isRecord(parsed)) {
93
+ return { parentFound: false };
94
+ }
95
+ const subflows = isRecord(parsed.subflows) ? Object.values(parsed.subflows) : [];
96
+ const subflowNodes = subflows.flatMap((s) => isRecord(s) && Array.isArray(s.nodes) ? s.nodes : []);
97
+ const subflowEdges = subflows.flatMap((s) => isRecord(s) && Array.isArray(s.edges) ? s.edges : []);
98
+ const nodes = [
99
+ ...Array.isArray(parsed.nodes) ? parsed.nodes : [],
100
+ ...subflowNodes
101
+ ];
102
+ const edges = [
103
+ ...Array.isArray(parsed.edges) ? parsed.edges : [],
104
+ ...subflowEdges
105
+ ];
106
+ const definitions = Array.isArray(parsed.definitions) ? parsed.definitions : [];
107
+ const parentNode = nodes.find((n) => isRecord(n) && n.id === parentComponentId);
108
+ if (!parentNode) {
109
+ return { parentFound: false };
110
+ }
111
+ const agentKind = getAgentKind(parentNode, definitions);
112
+ switch (agentKind.kind) {
113
+ case "inlineCanvas":
114
+ return resolveInlineCanvasSchema(parentComponentId, childComponentId, nodes, edges, definitions);
115
+ case "sameSolution":
116
+ return this.resolveSameSolutionSchema(flowFilePath, agentKind.projectId, childComponentId);
117
+ case "published":
118
+ return this.resolvePublishedAgentSchema(agentKind.processKey, agentKind.processVersion, childComponentId, authConfig);
119
+ case "unsupported":
120
+ return { parentFound: true };
121
+ }
122
+ }
123
+ async resolveSameSolutionSchema(flowFilePath, projectId, childComponentId) {
124
+ if (/[/\\.]/.test(projectId)) {
125
+ return { parentFound: true };
126
+ }
127
+ const agentJsonPath = this.fs.path.join(this.fs.path.dirname(flowFilePath), projectId, "agent.json");
128
+ const [readError, raw] = await catchError(this.fs.readFile(agentJsonPath, "utf-8"));
129
+ if (readError) {
130
+ return { parentFound: true };
131
+ }
132
+ let agent;
133
+ try {
134
+ agent = JSON.parse(String(raw));
135
+ } catch {
136
+ return { parentFound: true };
137
+ }
138
+ if (!isRecord(agent)) {
139
+ return { parentFound: true };
140
+ }
141
+ const resources = Array.isArray(agent.resources) ? agent.resources : [];
142
+ const schema = findToolSchemaInResources(resources, childComponentId);
143
+ return { parentFound: true, schema };
144
+ }
145
+ async resolvePublishedAgentSchema(processKey, processVersion, childComponentId, authConfig) {
146
+ if (!authConfig) {
147
+ const [authError, resolved] = await catchError(resolveAuthFromLogin());
148
+ if (authError || !resolved) {
149
+ return { parentFound: true };
150
+ }
151
+ authConfig = resolved;
152
+ }
153
+ const [fetchError, components] = await catchError(fetchSimulatableComponents(authConfig, processKey, processVersion));
154
+ if (fetchError || !components) {
155
+ return { parentFound: true };
156
+ }
157
+ const match = components.find((c) => c.id === childComponentId || nameMatchesId(c.name, childComponentId));
158
+ if (!match?.outputSchema) {
159
+ return { parentFound: true };
160
+ }
161
+ return { parentFound: true, schema: match.outputSchema };
162
+ }
163
+ }
164
+ async function resolveAuthFromLogin() {
165
+ const { getLoginStatusAsync } = await import("./index-1kgxzh8x.js");
166
+ const login = await getLoginStatusAsync();
167
+ if (login.loginStatus !== "Logged in" || !login.baseUrl || !login.organizationId || !login.tenantId || !login.tenantName || !login.accessToken) {
168
+ throw new Error("Not logged in");
169
+ }
170
+ return {
171
+ baseUrl: login.baseUrl,
172
+ organizationId: login.organizationId,
173
+ tenantId: login.tenantId,
174
+ tenantName: login.tenantName,
175
+ authToken: login.accessToken
176
+ };
177
+ }
178
+ async function fetchSimulatableComponents(config, processKey, processVersion) {
179
+ const base = `${config.baseUrl}/${config.organizationId}/${config.tenantName}/agentsruntime_/api`;
180
+ const params = new URLSearchParams({ workloadType: "Agents" });
181
+ if (processVersion) {
182
+ params.set("processVersion", processVersion);
183
+ }
184
+ const url = `${base}/unifiedEvals/processes/${encodeURIComponent(processKey)}/simulatableComponents?${params.toString()}`;
185
+ const response = await fetch(url, {
186
+ method: "GET",
187
+ headers: {
188
+ Authorization: `Bearer ${config.authToken}`,
189
+ Accept: "application/json",
190
+ "X-UiPath-Internal-TenantId": config.tenantId,
191
+ "X-UiPath-Internal-AccountId": config.organizationId
192
+ }
193
+ });
194
+ if (!response.ok) {
195
+ throw new Error(`Simulatable components API returned ${response.status}`);
196
+ }
197
+ const data = await response.json();
198
+ const components = Array.isArray(data.components) ? data.components : [];
199
+ return components.filter((c) => isRecord(c) && typeof c.id === "string" && typeof c.name === "string" && c.isEnabled === true);
200
+ }
201
+ function isAgentNodeType(nodeType) {
202
+ if (!nodeType)
203
+ return false;
204
+ const lower = nodeType.toLowerCase();
205
+ if (lower.startsWith("uipath.agent.resource.tool."))
206
+ return false;
207
+ return lower === "agent" || lower.startsWith("uipath.agent") || lower.startsWith("uipath.core.agent");
208
+ }
209
+ function getAgentKind(node, definitions) {
210
+ const nodeType = typeof node.type === "string" ? node.type : undefined;
211
+ const definition = findDefinitionForNode(node, definitions);
212
+ const defType = isRecord(definition) && typeof definition.nodeType === "string" ? definition.nodeType : undefined;
213
+ const isAgent = isAgentNodeType(nodeType) || isAgentNodeType(defType);
214
+ if (!isAgent) {
215
+ return { kind: "unsupported" };
216
+ }
217
+ const projectId = readProjectId(node, definition);
218
+ if (projectId) {
219
+ return { kind: "sameSolution", projectId };
220
+ }
221
+ if (nodeType?.startsWith("uipath.agent")) {
222
+ return { kind: "inlineCanvas" };
223
+ }
224
+ if (nodeType?.startsWith("uipath.core.agent.")) {
225
+ const processKey = nodeType.split(".").at(-1) ?? "";
226
+ if (!processKey)
227
+ return { kind: "unsupported" };
228
+ const defRecord = isRecord(definition) ? definition : undefined;
229
+ const processVersion = typeof defRecord?.version === "string" ? defRecord.version : undefined;
230
+ return { kind: "published", processKey, processVersion };
231
+ }
232
+ return { kind: "unsupported" };
233
+ }
234
+ function readProjectId(node, definition) {
235
+ const inputs = isRecord(node.inputs) ? node.inputs : undefined;
236
+ if (typeof inputs?.source === "string" && inputs.source.trim()) {
237
+ return inputs.source.trim();
238
+ }
239
+ const model = isRecord(node.model) ? node.model : undefined;
240
+ const defRecord = isRecord(definition) ? definition : undefined;
241
+ const defModel = isRecord(defRecord?.model) ? defRecord.model : undefined;
242
+ for (const candidate of [
243
+ model?.projectId,
244
+ defModel?.projectId,
245
+ node.projectId,
246
+ defRecord?.projectId
247
+ ]) {
248
+ if (typeof candidate === "string" && candidate.trim()) {
249
+ return candidate.trim();
250
+ }
251
+ }
252
+ return;
253
+ }
254
+ function findDefinitionForNode(node, definitions) {
255
+ const nodeType = typeof node.type === "string" ? node.type : undefined;
256
+ if (!nodeType)
257
+ return;
258
+ return definitions.find((def) => isRecord(def) && def.nodeType === nodeType);
259
+ }
260
+ function resolveInlineCanvasSchema(parentComponentId, childComponentId, nodes, edges, definitions) {
261
+ const childNodeIds = new Set;
262
+ for (const edge of edges) {
263
+ if (!isRecord(edge))
264
+ continue;
265
+ const source = readStringField(edge, "sourceNodeId", "source");
266
+ if (source !== parentComponentId)
267
+ continue;
268
+ const target = readStringField(edge, "targetNodeId", "target");
269
+ if (target) {
270
+ childNodeIds.add(target);
271
+ }
272
+ }
273
+ for (const n of nodes) {
274
+ if (!isRecord(n))
275
+ continue;
276
+ if (typeof n.id !== "string" || !childNodeIds.has(n.id))
277
+ continue;
278
+ if (n.id !== childComponentId && !matchesComponentId(n, childComponentId)) {
279
+ continue;
280
+ }
281
+ const definition = findDefinitionForNode(n, definitions);
282
+ const schema = extractToolOutputSchema(n, definition);
283
+ if (schema) {
284
+ return { parentFound: true, schema };
285
+ }
286
+ }
287
+ return { parentFound: true };
288
+ }
289
+ function matchesComponentId(node, componentId) {
290
+ const display = isRecord(node.display) ? node.display : undefined;
291
+ const label = typeof display?.label === "string" ? display.label : undefined;
292
+ if (label && nameMatchesId(label, componentId))
293
+ return true;
294
+ const inputs = isRecord(node.inputs) ? node.inputs : undefined;
295
+ const name = typeof inputs?.name === "string" ? inputs.name : undefined;
296
+ if (name && nameMatchesId(name, componentId))
297
+ return true;
298
+ return false;
299
+ }
300
+ function sanitizeToolName(name) {
301
+ return name.replace(/\s+/g, "_").replace(/[^\w-]/g, "").slice(0, 64);
302
+ }
303
+ function extractToolOutputSchema(node, definition) {
304
+ const nodeType = typeof node.type === "string" ? node.type : "";
305
+ const outputs = isRecord(node.outputs) ? node.outputs : undefined;
306
+ if (outputs) {
307
+ const output = isRecord(outputs.output) ? outputs.output : undefined;
308
+ if (output?.schema)
309
+ return output.schema;
310
+ if (Object.keys(outputs).length > 0) {
311
+ return { type: "object", properties: outputs };
312
+ }
313
+ }
314
+ const inputs = isRecord(node.inputs) ? node.inputs : undefined;
315
+ if (inputs?.outputSchema)
316
+ return inputs.outputSchema;
317
+ if (nodeType.startsWith("uipath.connector.") || nodeType.startsWith(AGENT_TOOL_NODE_TYPE_PREFIX)) {
318
+ const schema = extractConnectorOutputSchema(inputs);
319
+ if (schema)
320
+ return schema;
321
+ }
322
+ if (isRecord(definition)) {
323
+ const outputDef = isRecord(definition.outputDefinition) ? definition.outputDefinition : undefined;
324
+ if (outputDef) {
325
+ const outputEntry = isRecord(outputDef.output) ? outputDef.output : undefined;
326
+ if (outputEntry?.schema)
327
+ return outputEntry.schema;
328
+ if (outputEntry)
329
+ return outputEntry;
330
+ if (Object.keys(outputDef).length > 0) {
331
+ return { type: "object", properties: outputDef };
332
+ }
333
+ }
334
+ }
335
+ return;
336
+ }
337
+ function extractConnectorOutputSchema(inputs) {
338
+ if (!inputs)
339
+ return;
340
+ const detail = inputs.detail;
341
+ let detailObj;
342
+ if (typeof detail === "string") {
343
+ try {
344
+ const parsed = JSON.parse(detail);
345
+ detailObj = isRecord(parsed) ? parsed : undefined;
346
+ } catch {
347
+ return;
348
+ }
349
+ } else if (isRecord(detail)) {
350
+ detailObj = detail;
351
+ }
352
+ if (!detailObj)
353
+ return;
354
+ const config = isRecord(detailObj.configuration) ? detailObj.configuration : undefined;
355
+ if (!config)
356
+ return;
357
+ const fieldsContainer = isRecord(config.fieldsContainer) ? config.fieldsContainer : undefined;
358
+ if (!fieldsContainer)
359
+ return;
360
+ const schema = fieldsContainer.outputJsonSchema;
361
+ return isRecord(schema) ? schema : undefined;
362
+ }
363
+ function findToolSchemaInResources(resources, childComponentId) {
364
+ for (const resource of resources) {
365
+ if (!isRecord(resource))
366
+ continue;
367
+ const availableTools = resource.availableTools ?? (isRecord(resource.inputs) ? resource.inputs.selectedTools : undefined);
368
+ if (Array.isArray(availableTools)) {
369
+ for (const tool of availableTools) {
370
+ if (!isRecord(tool))
371
+ continue;
372
+ const toolName = typeof tool.name === "string" ? tool.name : undefined;
373
+ if (!toolName)
374
+ continue;
375
+ if (nameMatchesId(toolName, childComponentId)) {
376
+ if (tool.outputSchema)
377
+ return tool.outputSchema;
378
+ }
379
+ }
380
+ }
381
+ const resourceType = typeof resource.$resourceType === "string" ? resource.$resourceType : undefined;
382
+ const nodeType = readStringField(resource, "nodeType", "type");
383
+ const isToolLike = nodeType?.startsWith(AGENT_TOOL_NODE_TYPE_PREFIX) || resourceType === "tool" || resourceType === "mcp";
384
+ if (!isToolLike)
385
+ continue;
386
+ const display = isRecord(resource.display) ? resource.display : undefined;
387
+ const label = typeof display?.label === "string" ? display.label : undefined;
388
+ const inputs = isRecord(resource.inputs) ? resource.inputs : undefined;
389
+ const name = (inputs ? readStringField(inputs, "name") : undefined) ?? readStringField(resource, "name");
390
+ const candidateName = name ?? label;
391
+ if (!candidateName)
392
+ continue;
393
+ if (nameMatchesId(candidateName, childComponentId)) {
394
+ if (inputs?.outputSchema)
395
+ return inputs.outputSchema;
396
+ if (resource.outputSchema)
397
+ return resource.outputSchema;
398
+ }
399
+ }
400
+ return;
401
+ }
402
+
403
+ // src/services/flow-eval-files.ts
404
+ import { randomUUID } from "node:crypto";
405
+ var EVAL_FILES_DIR = "eval-files";
406
+ var TOKEN_LENGTH = 12;
407
+ var EVALUATION_BINARY_PREFIX = "BINARY_FILE:";
408
+ var EVALUATION_BINARY_DELIMITER = `
409
+ ---BASE64---
410
+ `;
411
+ var TEXT_EXTENSIONS = new Set([
412
+ ".json",
413
+ ".csv",
414
+ ".tsv",
415
+ ".txt",
416
+ ".md",
417
+ ".log",
418
+ ".xml",
419
+ ".html",
420
+ ".htm",
421
+ ".yaml",
422
+ ".yml"
423
+ ]);
424
+ var MIME_BY_EXT = {
425
+ ".jpg": "image/jpeg",
426
+ ".jpeg": "image/jpeg",
427
+ ".png": "image/png",
428
+ ".gif": "image/gif",
429
+ ".bmp": "image/bmp",
430
+ ".webp": "image/webp",
431
+ ".tif": "image/tiff",
432
+ ".tiff": "image/tiff",
433
+ ".svg": "image/svg+xml",
434
+ ".pdf": "application/pdf",
435
+ ".doc": "application/msword",
436
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
437
+ ".xls": "application/vnd.ms-excel",
438
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
439
+ ".ppt": "application/vnd.ms-powerpoint",
440
+ ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
441
+ ".csv": "text/csv",
442
+ ".tsv": "text/tab-separated-values",
443
+ ".json": "application/json",
444
+ ".txt": "text/plain",
445
+ ".md": "text/markdown",
446
+ ".log": "text/plain",
447
+ ".xml": "application/xml",
448
+ ".html": "text/html",
449
+ ".htm": "text/html",
450
+ ".yaml": "application/yaml",
451
+ ".yml": "application/yaml"
452
+ };
453
+
454
+ class FlowEvalFiles {
455
+ fs;
456
+ pathResolver;
457
+ constructor(fs, pathResolver) {
458
+ this.fs = fs;
459
+ this.pathResolver = pathResolver;
460
+ }
461
+ async materialize(projectPath, sourcePath) {
462
+ const projectRoot = await this.pathResolver.resolveFlowProjectPath(projectPath);
463
+ const sourceAbsolute = this.fs.path.resolve(sourcePath);
464
+ if (!await this.fs.exists(sourceAbsolute)) {
465
+ throw new Error(`Input file not found: ${sourcePath}`);
466
+ }
467
+ const content = await this.fs.readFile(sourceAbsolute);
468
+ if (content === null) {
469
+ throw new Error(`Could not read input file: ${sourcePath}`);
470
+ }
471
+ const fullName = this.fs.path.basename(sourceAbsolute);
472
+ const evalRoot = await this.pathResolver.resolveEvalRoot(projectPath, true);
473
+ const dir = this.fs.path.join(evalRoot, EVAL_FILES_DIR);
474
+ await this.fs.mkdir(dir);
475
+ const targetName = await this.resolveTargetName(dir, fullName);
476
+ const targetPath = this.fs.path.join(dir, targetName);
477
+ const mimeType = mimeFromExt(extOf(fullName));
478
+ if (TEXT_EXTENSIONS.has(extOf(fullName))) {
479
+ await this.fs.writeFile(targetPath, content);
480
+ } else {
481
+ await this.fs.writeFile(targetPath, encodeBinaryEnvelope(content, mimeType));
482
+ }
483
+ const relative = this.fs.path.relative(projectRoot, targetPath).replaceAll("\\", "/");
484
+ return {
485
+ ID: `/${relative}`,
486
+ FullName: fullName,
487
+ MimeType: mimeType
488
+ };
489
+ }
490
+ async resolveTargetName(dir, fullName) {
491
+ if (!await this.fs.exists(this.fs.path.join(dir, fullName))) {
492
+ return fullName;
493
+ }
494
+ const ext = extOf(fullName);
495
+ const stem = ext ? fullName.slice(0, -ext.length) : fullName;
496
+ const token = randomUUID().replaceAll("-", "").slice(0, TOKEN_LENGTH);
497
+ return `${stem}_${token}${ext}`;
498
+ }
499
+ }
500
+ function encodeBinaryEnvelope(content, mimeType) {
501
+ const base64Content = Buffer.from(content).toString("base64");
502
+ return `${EVALUATION_BINARY_PREFIX}${mimeType}:${content.byteLength}${EVALUATION_BINARY_DELIMITER}${base64Content}`;
503
+ }
504
+ function extOf(name) {
505
+ const dot = name.lastIndexOf(".");
506
+ if (dot <= 0) {
507
+ return "";
508
+ }
509
+ return name.slice(dot).toLowerCase();
510
+ }
511
+ function mimeFromExt(ext) {
512
+ return MIME_BY_EXT[ext] ?? "application/octet-stream";
513
+ }
514
+
515
+ // src/services/flow-eval-input-schema.ts
516
+ class FlowEvalInputSchema {
517
+ fs;
518
+ pathResolver;
519
+ constructor(fs, pathResolver) {
520
+ this.fs = fs;
521
+ this.pathResolver = pathResolver;
522
+ }
523
+ async read(projectPath) {
524
+ const root = await this.pathResolver.resolveFlowProjectPath(projectPath);
525
+ const [flowError, flowFilePath] = await catchError(this.pathResolver.findFlowFile(root));
526
+ if (flowError || !flowFilePath) {
527
+ return {
528
+ flowFound: false,
529
+ bpmnFound: false,
530
+ inputs: new Map
531
+ };
532
+ }
533
+ const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
534
+ const inputs = readFlowGlobalsAsInputs(flowContent);
535
+ const bpmnFilePath = flowFilePath.replace(/\.flow$/i, ".bpmn");
536
+ if (!await this.fs.exists(bpmnFilePath)) {
537
+ return { flowFound: true, bpmnFound: false, inputs };
538
+ }
539
+ const bpmnContent = String(await this.fs.readFile(bpmnFilePath, "utf-8"));
540
+ annotateBpmnState(inputs, bpmnContent);
541
+ return { flowFound: true, bpmnFound: true, inputs };
542
+ }
543
+ }
544
+ function readFlowGlobalsAsInputs(flowContent) {
545
+ const inputs = new Map;
546
+ let parsed;
547
+ try {
548
+ parsed = JSON.parse(flowContent);
549
+ } catch {
550
+ return inputs;
551
+ }
552
+ if (!isRecord(parsed)) {
553
+ return inputs;
554
+ }
555
+ const variables = isRecord(parsed.variables) ? parsed.variables : undefined;
556
+ const globals = Array.isArray(variables?.globals) ? variables.globals : [];
557
+ for (const entry of globals) {
558
+ if (!isRecord(entry)) {
559
+ continue;
560
+ }
561
+ if (entry.direction !== "in" || typeof entry.id !== "string") {
562
+ continue;
563
+ }
564
+ const type = typeof entry.type === "string" ? entry.type : "unknown";
565
+ inputs.set(entry.id, {
566
+ type,
567
+ inBpmn: false,
568
+ bpmnHasJobAttachmentTarget: false
569
+ });
570
+ }
571
+ return inputs;
572
+ }
573
+ function annotateBpmnState(inputs, bpmnContent) {
574
+ for (const [key, value] of inputs) {
575
+ const declared = new RegExp(`<uipath:input\\b[^>]*\\bid="${escapeRegex(key)}"`).test(bpmnContent);
576
+ const jobAttachment = new RegExp(`<uipath:output\\b[^>]*\\bsource="=vars\\.${escapeRegex(key)}"[^>]*\\btarget="=orchestrator\\.JobAttachments"`).test(bpmnContent);
577
+ inputs.set(key, {
578
+ ...value,
579
+ inBpmn: declared,
580
+ bpmnHasJobAttachmentTarget: jobAttachment
581
+ });
582
+ }
583
+ }
584
+ function escapeRegex(value) {
585
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
586
+ }
587
+
588
+ // src/services/flow-eval-set-crud.ts
589
+ var DATASET_SCHEMA_VERSION = 4;
590
+
591
+ class FlowEvalSetCrud {
592
+ fs;
593
+ store;
594
+ pathResolver;
595
+ constructor(fs, store, pathResolver) {
596
+ this.fs = fs;
597
+ this.store = store;
598
+ this.pathResolver = pathResolver;
599
+ }
600
+ async list(projectPath) {
601
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
602
+ if (!root) {
603
+ return [];
604
+ }
605
+ return this.store.readJsonFiles(this.fs.path.join(root, "eval-sets"));
606
+ }
607
+ async add(projectPath, options) {
608
+ const resolvedProjectPath = await this.pathResolver.resolveFlowProjectPath(projectPath);
609
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, true);
610
+ const id = crypto.randomUUID();
611
+ const fileName = `evaluation-set-${slugify(options.name)}-${id.slice(0, 8)}.json`;
612
+ const evaluators = await this.store.readJsonFiles(this.fs.path.join(root, "evaluators"));
613
+ const now = new Date().toISOString();
614
+ const agentNodeId = await this.resolveAgentNodeTarget(resolvedProjectPath, options.entryPoint);
615
+ const selectedEntrypoint = options.entryPoint ?? await this.pathResolver.readDefaultEntryPointNodeId(resolvedProjectPath);
616
+ const evalSet = {
617
+ version: "1.0",
618
+ ...agentNodeId !== undefined ? { schemaVersion: DATASET_SCHEMA_VERSION } : {},
619
+ id,
620
+ name: options.name,
621
+ evaluatorRefs: options.evaluatorRefs ?? evaluators.map((evaluator) => evaluator.fileName ?? `${evaluator.id}.json`),
622
+ evaluations: [],
623
+ ...agentNodeId !== undefined ? {
624
+ target: {
625
+ kind: "agentNode",
626
+ nodeId: agentNodeId
627
+ },
628
+ nodeEval: true
629
+ } : {},
630
+ ...selectedEntrypoint !== undefined ? { selectedEntrypoint } : {},
631
+ fileName,
632
+ createdAt: now,
633
+ updatedAt: now
634
+ };
635
+ await this.store.writeJsonFile(this.fs.path.join(root, "eval-sets", fileName), evalSet);
636
+ return evalSet;
637
+ }
638
+ async resolveAgentNodeTarget(resolvedProjectPath, entryPoint) {
639
+ if (entryPoint === undefined || entryPoint.includes("/") || entryPoint.includes("#")) {
640
+ return;
641
+ }
642
+ const [findError, flowFilePath] = await catchError(this.pathResolver.findFlowFile(resolvedProjectPath));
643
+ if (findError || !flowFilePath) {
644
+ return;
645
+ }
646
+ const [readError, flowContent] = await catchError(this.fs.readFile(flowFilePath, "utf-8"));
647
+ if (readError) {
648
+ return;
649
+ }
650
+ const lookup = findFlowNode(String(flowContent), entryPoint);
651
+ if (!lookup.flowParsed) {
652
+ return;
653
+ }
654
+ if (!lookup.node) {
655
+ throw new Error(`Entry point "${entryPoint}" does not match any node in the flow. Pass a node id from the .flow file (an agent node id creates a node-scoped eval set), or omit --entry-point to use the default start node.`);
656
+ }
657
+ if (isDocumentEvalNode(lookup.node)) {
658
+ throw new Error(`Entry point "${entryPoint}" is a document node — document-scoped eval sets are not supported by the CLI yet. Create them in Studio Web, or target the flow or an agent node instead.`);
659
+ }
660
+ return isNodeEvalTarget(lookup.node) ? entryPoint : undefined;
661
+ }
662
+ async remove(projectPath, idOrName) {
663
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
664
+ if (!root) {
665
+ return false;
666
+ }
667
+ const evalSet = findEvalSet(await this.list(projectPath), idOrName);
668
+ if (!evalSet?.fileName) {
669
+ return false;
670
+ }
671
+ await this.store.remove(this.fs.path.join(root, "eval-sets", evalSet.fileName));
672
+ return true;
673
+ }
674
+ }
675
+
676
+ // src/services/flow-evaluation-crud.ts
677
+ class FlowEvaluationCrud {
678
+ fs;
679
+ store;
680
+ pathResolver;
681
+ constructor(fs, store, pathResolver) {
682
+ this.fs = fs;
683
+ this.store = store;
684
+ this.pathResolver = pathResolver;
685
+ }
686
+ async add(projectPath, setIdOrName, options) {
687
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, true);
688
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
689
+ const evaluators = getLinkedEvaluators(await this.listEvaluators(root), evalSet);
690
+ const now = new Date().toISOString();
691
+ const evaluation = {
692
+ id: crypto.randomUUID(),
693
+ name: options.name,
694
+ inputs: options.inputs,
695
+ expectedOutput: options.expectedOutput,
696
+ evaluationCriterias: options.criteria ?? buildDefaultCriteria(evaluators, options.expectedOutput, options.searchText),
697
+ createdAt: now,
698
+ updatedAt: now
699
+ };
700
+ evalSet.evaluations.push(evaluation);
701
+ evalSet.updatedAt = now;
702
+ await this.writeEvalSet(root, evalSet);
703
+ return evaluation;
704
+ }
705
+ async list(projectPath, setIdOrName) {
706
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
707
+ return evalSet.evaluations;
708
+ }
709
+ async addSimulation(projectPath, setIdOrName, evaluationIdOrName, simulation) {
710
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, true);
711
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
712
+ const evaluation = evalSet.evaluations.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
713
+ if (!evaluation) {
714
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
715
+ }
716
+ if (!evaluation.simulations) {
717
+ evaluation.simulations = [];
718
+ }
719
+ const existing = evaluation.simulations.findIndex((s) => s.componentId === simulation.componentId);
720
+ const now = new Date().toISOString();
721
+ if (existing !== -1) {
722
+ evaluation.simulations[existing] = simulation;
723
+ } else {
724
+ evaluation.simulations.push(simulation);
725
+ }
726
+ evaluation.updatedAt = now;
727
+ evalSet.updatedAt = now;
728
+ await this.writeEvalSet(root, evalSet);
729
+ return simulation;
730
+ }
731
+ async listSimulations(projectPath, setIdOrName, evaluationIdOrName) {
732
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
733
+ const evaluation = evalSet.evaluations.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
734
+ if (!evaluation) {
735
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
736
+ }
737
+ return evaluation.simulations ?? [];
738
+ }
739
+ async addChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childSimulation) {
740
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, true);
741
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
742
+ const evaluation = evalSet.evaluations.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
743
+ if (!evaluation) {
744
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
745
+ }
746
+ if (!evaluation.simulations) {
747
+ evaluation.simulations = [];
748
+ }
749
+ let parent = evaluation.simulations.find((s) => s.componentId === parentComponentId);
750
+ if (!parent) {
751
+ parent = {
752
+ componentId: parentComponentId,
753
+ componentType: "agent",
754
+ simulationStrategy: "Llm",
755
+ childSimulations: []
756
+ };
757
+ evaluation.simulations.push(parent);
758
+ }
759
+ if (!parent.childSimulations) {
760
+ parent.childSimulations = [];
761
+ }
762
+ const existing = parent.childSimulations.findIndex((s) => s.componentId === childSimulation.componentId);
763
+ const now = new Date().toISOString();
764
+ if (existing !== -1) {
765
+ parent.childSimulations[existing] = childSimulation;
766
+ } else {
767
+ parent.childSimulations.push(childSimulation);
768
+ }
769
+ evaluation.updatedAt = now;
770
+ evalSet.updatedAt = now;
771
+ await this.writeEvalSet(root, evalSet);
772
+ return childSimulation;
773
+ }
774
+ listChildSimulations(evaluation, parentComponentId) {
775
+ const parent = (evaluation.simulations ?? []).find((s) => s.componentId === parentComponentId);
776
+ if (!parent) {
777
+ throw new Error(`Simulation for component "${parentComponentId}" not found`);
778
+ }
779
+ return parent.childSimulations ?? [];
780
+ }
781
+ async removeChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childComponentId) {
782
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
783
+ if (!root) {
784
+ return false;
785
+ }
786
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
787
+ const evaluation = evalSet.evaluations.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
788
+ if (!evaluation) {
789
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
790
+ }
791
+ const parent = (evaluation.simulations ?? []).find((s) => s.componentId === parentComponentId);
792
+ if (!parent) {
793
+ throw new Error(`Simulation for component "${parentComponentId}" not found`);
794
+ }
795
+ const index = (parent.childSimulations ?? []).findIndex((s) => s.componentId === childComponentId);
796
+ if (index === -1) {
797
+ return false;
798
+ }
799
+ parent.childSimulations?.splice(index, 1);
800
+ evalSet.updatedAt = new Date().toISOString();
801
+ await this.writeEvalSet(root, evalSet);
802
+ return true;
803
+ }
804
+ async removeSimulation(projectPath, setIdOrName, evaluationIdOrName, componentId) {
805
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
806
+ if (!root) {
807
+ return false;
808
+ }
809
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
810
+ const evaluation = evalSet.evaluations.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
811
+ if (!evaluation) {
812
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
813
+ }
814
+ const index = (evaluation.simulations ?? []).findIndex((s) => s.componentId === componentId);
815
+ if (index === -1) {
816
+ return false;
817
+ }
818
+ evaluation.simulations?.splice(index, 1);
819
+ evalSet.updatedAt = new Date().toISOString();
820
+ await this.writeEvalSet(root, evalSet);
821
+ return true;
822
+ }
823
+ async remove(projectPath, setIdOrName, evaluationIdOrName) {
824
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
825
+ if (!root) {
826
+ return false;
827
+ }
828
+ const evalSet = await this.requireEvalSet(projectPath, setIdOrName);
829
+ const index = evalSet.evaluations.findIndex((evaluation) => evaluation.id === evaluationIdOrName || evaluation.name === evaluationIdOrName);
830
+ if (index === -1) {
831
+ return false;
832
+ }
833
+ evalSet.evaluations.splice(index, 1);
834
+ evalSet.updatedAt = new Date().toISOString();
835
+ await this.writeEvalSet(root, evalSet);
836
+ return true;
837
+ }
838
+ async requireEvalSet(projectPath, idOrName) {
839
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
840
+ const evalSet = root ? findEvalSet(await this.listEvalSets(root), idOrName) : null;
841
+ if (!evalSet) {
842
+ throw new Error(`Evaluation set "${idOrName}" not found`);
843
+ }
844
+ return evalSet;
845
+ }
846
+ async listEvalSets(root) {
847
+ return this.store.readJsonFiles(this.fs.path.join(root, "eval-sets"));
848
+ }
849
+ async listEvaluators(root) {
850
+ return this.store.readJsonFiles(this.fs.path.join(root, "evaluators"));
851
+ }
852
+ async writeEvalSet(root, evalSet) {
853
+ await this.store.writeJsonFile(this.fs.path.join(root, "eval-sets", evalSet.fileName ?? `${evalSet.id}.json`), evalSet);
854
+ }
855
+ }
856
+
857
+ // src/services/flow-evaluator-crud.ts
858
+ class FlowEvaluatorCrud {
859
+ fs;
860
+ store;
861
+ pathResolver;
862
+ constructor(fs, store, pathResolver) {
863
+ this.fs = fs;
864
+ this.store = store;
865
+ this.pathResolver = pathResolver;
866
+ }
867
+ async list(projectPath) {
868
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
869
+ if (!root) {
870
+ return [];
871
+ }
872
+ return this.store.readJsonFiles(this.fs.path.join(root, "evaluators"));
873
+ }
874
+ async add(projectPath, options) {
875
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, true);
876
+ const typeId = resolveEvaluatorType(options.type);
877
+ const id = `${slugify(options.name)}-${crypto.randomUUID().slice(0, 8)}`;
878
+ const now = new Date().toISOString();
879
+ const fileName = `${id}.json`;
880
+ const evaluator = {
881
+ version: "1.0",
882
+ id,
883
+ name: options.name,
884
+ description: options.description ?? `${options.name} evaluator`,
885
+ evaluatorTypeId: typeId,
886
+ evaluatorConfig: buildEvaluatorConfig(typeId, options),
887
+ fileName,
888
+ createdAt: now,
889
+ updatedAt: now
890
+ };
891
+ await this.store.writeJsonFile(this.fs.path.join(root, "evaluators", fileName), evaluator);
892
+ return evaluator;
893
+ }
894
+ async remove(projectPath, idOrName) {
895
+ const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
896
+ if (!root) {
897
+ return false;
898
+ }
899
+ const evaluator = findEvaluator(await this.list(projectPath), idOrName);
900
+ if (!evaluator?.fileName) {
901
+ return false;
902
+ }
903
+ await this.store.remove(this.fs.path.join(root, "evaluators", evaluator.fileName));
904
+ await this.removeEvaluatorRefs(root, evaluator);
905
+ return true;
906
+ }
907
+ async removeEvaluatorRefs(root, evaluator) {
908
+ const sets = await this.store.readJsonFiles(this.fs.path.join(root, "eval-sets"));
909
+ for (const set of sets) {
910
+ if (removeEvaluatorRefFromSet(set, evaluator) && set.fileName) {
911
+ await this.writeEvalSet(root, set);
912
+ }
913
+ }
914
+ }
915
+ async writeEvalSet(root, evalSet) {
916
+ await this.store.writeJsonFile(this.fs.path.join(root, "eval-sets", evalSet.fileName ?? `${evalSet.id}.json`), evalSet);
917
+ }
918
+ }
919
+
920
+ // src/services/flow-node-output-schema.ts
921
+ class FlowEvalOutputSchema {
922
+ fs;
923
+ pathResolver;
924
+ constructor(fs, pathResolver) {
925
+ this.fs = fs;
926
+ this.pathResolver = pathResolver;
927
+ }
928
+ async read(projectPath) {
929
+ const root = await this.pathResolver.resolveFlowProjectPath(projectPath);
930
+ const [flowError, flowFilePath] = await catchError(this.pathResolver.findFlowFile(root));
931
+ if (flowError || !flowFilePath) {
932
+ return { flowFound: false, outputs: new Map };
933
+ }
934
+ const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
935
+ return {
936
+ flowFound: true,
937
+ flowFilePath,
938
+ outputs: readFlowGlobalsAsOutputs(flowContent)
939
+ };
940
+ }
941
+ }
942
+ function readFlowGlobalsAsOutputs(flowContent) {
943
+ const outputs = new Map;
944
+ let parsed;
945
+ try {
946
+ parsed = JSON.parse(flowContent);
947
+ } catch {
948
+ return outputs;
949
+ }
950
+ if (!isRecord(parsed))
951
+ return outputs;
952
+ const variables = isRecord(parsed.variables) ? parsed.variables : undefined;
953
+ const globals = Array.isArray(variables?.globals) ? variables.globals : [];
954
+ for (const entry of globals) {
955
+ if (!isRecord(entry))
956
+ continue;
957
+ if (entry.direction !== "out")
958
+ continue;
959
+ if (typeof entry.id !== "string")
960
+ continue;
961
+ const type = typeof entry.type === "string" ? entry.type : "unknown";
962
+ outputs.set(entry.id, { type });
963
+ }
964
+ return outputs;
965
+ }
966
+
967
+ class FlowNodeOutputSchemaReader {
968
+ fs;
969
+ pathResolver;
970
+ constructor(fs, pathResolver) {
971
+ this.fs = fs;
972
+ this.pathResolver = pathResolver;
973
+ }
974
+ async read(projectPath, componentId) {
975
+ const root = await this.pathResolver.resolveFlowProjectPath(projectPath);
976
+ const [flowError, flowFilePath] = await catchError(this.pathResolver.findFlowFile(root));
977
+ if (flowError || !flowFilePath) {
978
+ return { schema: undefined, nodeFound: false };
979
+ }
980
+ const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
981
+ return this.extract(flowContent, componentId);
982
+ }
983
+ extract(flowContent, componentId) {
984
+ return extractNodeOutputSchema(flowContent, componentId, false);
985
+ }
986
+ }
987
+
988
+ class SimulateFlowOutputSchemaReader extends FlowNodeOutputSchemaReader {
989
+ extract(flowContent, componentId) {
990
+ const result = extractNodeOutputSchema(flowContent, componentId, true);
991
+ if (!result.nodeFound || result.schema === undefined) {
992
+ return result;
993
+ }
994
+ return { ...result, schema: cleanOutputSchema(result.schema) };
995
+ }
996
+ }
997
+ function extractNodeOutputSchema(flowContent, componentId, wrapAllOutputs) {
998
+ let parsed;
999
+ try {
1000
+ parsed = JSON.parse(flowContent);
1001
+ } catch {
1002
+ return { schema: undefined, nodeFound: false };
1003
+ }
1004
+ if (!isRecord(parsed)) {
1005
+ return { schema: undefined, nodeFound: false };
1006
+ }
1007
+ const nodes = Array.isArray(parsed.nodes) ? parsed.nodes : [];
1008
+ const node = nodes.find((n) => isRecord(n) && n.id === componentId);
1009
+ if (!node) {
1010
+ return { schema: undefined, nodeFound: false };
1011
+ }
1012
+ const nodeType = typeof node.type === "string" ? node.type : "";
1013
+ if (nodeType.startsWith("uipath.connector.")) {
1014
+ const schema = extractConnectorOutputSchema2(node);
1015
+ if (schema) {
1016
+ return { schema, nodeFound: true };
1017
+ }
1018
+ }
1019
+ if (nodeType.startsWith("uipath.agent.")) {
1020
+ const schema = extractAgentOutputSchema(node);
1021
+ if (schema) {
1022
+ return { schema, nodeFound: true };
1023
+ }
1024
+ }
1025
+ const outputs = isRecord(node.outputs) ? node.outputs : undefined;
1026
+ if (outputs && Object.keys(outputs).length > 0) {
1027
+ if (!wrapAllOutputs && "output" in outputs) {
1028
+ return { schema: outputs.output, nodeFound: true };
1029
+ }
1030
+ return {
1031
+ schema: { type: "object", properties: outputs },
1032
+ nodeFound: true
1033
+ };
1034
+ }
1035
+ return { schema: undefined, nodeFound: true };
1036
+ }
1037
+ function extractConnectorOutputSchema2(node) {
1038
+ if (!isRecord(node.inputs))
1039
+ return;
1040
+ const detail = node.inputs.detail;
1041
+ let detailObj;
1042
+ if (typeof detail === "string") {
1043
+ try {
1044
+ const parsed = JSON.parse(detail);
1045
+ if (!isRecord(parsed))
1046
+ return;
1047
+ detailObj = parsed;
1048
+ } catch {
1049
+ return;
1050
+ }
1051
+ } else if (isRecord(detail)) {
1052
+ detailObj = detail;
1053
+ } else {
1054
+ return;
1055
+ }
1056
+ const config = isRecord(detailObj.configuration) ? detailObj.configuration : undefined;
1057
+ if (!config)
1058
+ return;
1059
+ const fieldsContainer = isRecord(config.fieldsContainer) ? config.fieldsContainer : undefined;
1060
+ if (!fieldsContainer)
1061
+ return;
1062
+ const schema = fieldsContainer.outputJsonSchema;
1063
+ if (!schema || !isRecord(schema))
1064
+ return;
1065
+ return schema;
1066
+ }
1067
+ function extractAgentOutputSchema(node) {
1068
+ if (!isRecord(node.inputs))
1069
+ return;
1070
+ const agentOutputVariables = node.inputs.agentOutputVariables;
1071
+ if (!Array.isArray(agentOutputVariables) || agentOutputVariables.length === 0) {
1072
+ return;
1073
+ }
1074
+ const properties = {};
1075
+ for (const v of agentOutputVariables) {
1076
+ if (!isRecord(v) || typeof v.id !== "string")
1077
+ continue;
1078
+ const type = typeof v.type === "string" ? v.type : "string";
1079
+ if (isRecord(v.schema)) {
1080
+ properties[v.id] = v.schema;
1081
+ } else {
1082
+ properties[v.id] = { type };
1083
+ }
1084
+ }
1085
+ if (Object.keys(properties).length === 0)
1086
+ return;
1087
+ return { type: "object", properties };
1088
+ }
1089
+ var ANNOTATION_KEYS = new Set([
1090
+ "title",
1091
+ "description",
1092
+ "default",
1093
+ "source",
1094
+ "var"
1095
+ ]);
1096
+ function cleanOutputSchema(schema) {
1097
+ const stripped = stripAnnotations(schema);
1098
+ return unwrapOutputProperty(stripped);
1099
+ }
1100
+ function stripAnnotations(value) {
1101
+ if (!isRecord(value))
1102
+ return value;
1103
+ const result = {};
1104
+ for (const [k, v] of Object.entries(value)) {
1105
+ if (ANNOTATION_KEYS.has(k))
1106
+ continue;
1107
+ result[k] = Array.isArray(v) ? v.map(stripAnnotations) : isRecord(v) ? stripAnnotations(v) : v;
1108
+ }
1109
+ return result;
1110
+ }
1111
+ function unwrapOutputProperty(schema) {
1112
+ if (!isRecord(schema))
1113
+ return schema;
1114
+ const props = isRecord(schema.properties) ? schema.properties : undefined;
1115
+ if (!props || !("output" in props))
1116
+ return schema;
1117
+ return props.output;
1118
+ }
1119
+
1120
+ // src/services/flow-eval-service.ts
1121
+ class FlowEvalService {
1122
+ fs;
1123
+ evaluators;
1124
+ evalSets;
1125
+ evaluations;
1126
+ files;
1127
+ inputSchema;
1128
+ outputSchema;
1129
+ nodeOutputSchema;
1130
+ agentNodeSchema;
1131
+ childSimulationSchema;
1132
+ constructor(fs = getFileSystem()) {
1133
+ this.fs = fs;
1134
+ const store = new FlowEvalFileStore(fs);
1135
+ const pathResolver = new FlowEvalPathResolver(fs);
1136
+ this.evaluators = new FlowEvaluatorCrud(fs, store, pathResolver);
1137
+ this.evalSets = new FlowEvalSetCrud(fs, store, pathResolver);
1138
+ this.evaluations = new FlowEvaluationCrud(fs, store, pathResolver);
1139
+ this.files = new FlowEvalFiles(fs, pathResolver);
1140
+ this.inputSchema = new FlowEvalInputSchema(fs, pathResolver);
1141
+ this.outputSchema = new FlowEvalOutputSchema(fs, pathResolver);
1142
+ this.nodeOutputSchema = new SimulateFlowOutputSchemaReader(fs, pathResolver);
1143
+ this.agentNodeSchema = new FlowAgentNodeSchemaReader(fs, pathResolver);
1144
+ this.childSimulationSchema = new ChildSimulationSchemaReader(fs, pathResolver);
1145
+ }
1146
+ listEvalSets(projectPath) {
1147
+ return this.evalSets.list(projectPath);
1148
+ }
1149
+ listEvaluators(projectPath) {
1150
+ return this.evaluators.list(projectPath);
1151
+ }
1152
+ addEvaluator(projectPath, options) {
1153
+ return this.evaluators.add(projectPath, options);
1154
+ }
1155
+ removeEvaluator(projectPath, idOrName) {
1156
+ return this.evaluators.remove(projectPath, idOrName);
1157
+ }
1158
+ addEvalSet(projectPath, options) {
1159
+ return this.evalSets.add(projectPath, options);
1160
+ }
1161
+ removeEvalSet(projectPath, idOrName) {
1162
+ return this.evalSets.remove(projectPath, idOrName);
1163
+ }
1164
+ async addEvaluation(projectPath, setIdOrName, options) {
1165
+ const inputFiles = options.inputFiles ?? [];
1166
+ for (const file of inputFiles) {
1167
+ if (file.key in options.inputs) {
1168
+ throw new Error(`Input "${file.key}" was provided in both --inputs and --input-file`);
1169
+ }
1170
+ }
1171
+ const evalSet = findEvalSet(await this.evalSets.list(projectPath), setIdOrName);
1172
+ const nodeTargetId = evalSet ? readNodeTargetId(evalSet) : undefined;
1173
+ if (nodeTargetId !== undefined) {
1174
+ if (inputFiles.length > 0) {
1175
+ throw new Error(`File inputs (--input-file) are not supported for node-scoped eval sets yet. Pass the value inline via --inputs, or use a flow-scoped eval set.`);
1176
+ }
1177
+ await this.validateAgentInputKeys(projectPath, nodeTargetId, options.inputs);
1178
+ if (options.expectedOutput) {
1179
+ await this.validateAgentOutputKeys(projectPath, nodeTargetId, options.expectedOutput);
1180
+ }
1181
+ } else {
1182
+ await this.validateInputKeys(projectPath, options.inputs, inputFiles);
1183
+ if (options.expectedOutput) {
1184
+ await this.validateOutputKeys(projectPath, options.expectedOutput);
1185
+ }
1186
+ }
1187
+ const inputs = { ...options.inputs };
1188
+ for (const file of inputFiles) {
1189
+ inputs[file.key] = await this.files.materialize(projectPath, file.sourcePath);
1190
+ }
1191
+ return this.evaluations.add(projectPath, setIdOrName, {
1192
+ ...options,
1193
+ inputs
1194
+ });
1195
+ }
1196
+ async validateInputKeys(projectPath, inputs, inputFiles) {
1197
+ const schema = await this.inputSchema.read(projectPath);
1198
+ if (!schema.flowFound) {
1199
+ return;
1200
+ }
1201
+ for (const key of Object.keys(inputs)) {
1202
+ const declared = schema.inputs.get(key);
1203
+ if (!declared) {
1204
+ throw new Error(`Input "${key}" is not declared as an input variable in the flow. Add it to variables.globals (direction: "in") in new.flow.`);
1205
+ }
1206
+ if (schema.bpmnFound && !declared.inBpmn) {
1207
+ throw new Error(`Input "${key}" is declared in new.flow but missing from new.bpmn. Re-save the project in Studio Web so the BPMN is regenerated.`);
1208
+ }
1209
+ }
1210
+ for (const file of inputFiles) {
1211
+ const declared = schema.inputs.get(file.key);
1212
+ if (!declared) {
1213
+ throw new Error(`Input "${file.key}" is not declared as an input variable in the flow. Add it to variables.globals (direction: "in", type: "file") in new.flow.`);
1214
+ }
1215
+ if (declared.type !== "file") {
1216
+ throw new Error(`Input "${file.key}" is declared with type "${declared.type}" but --input-file requires type "file".`);
1217
+ }
1218
+ if (schema.bpmnFound && !declared.inBpmn) {
1219
+ throw new Error(`Input "${file.key}" is declared in new.flow but missing from new.bpmn. Re-save the project in Studio Web so the BPMN is regenerated.`);
1220
+ }
1221
+ if (schema.bpmnFound && !declared.bpmnHasJobAttachmentTarget) {
1222
+ throw new Error(`Input "${file.key}" is missing the orchestrator.JobAttachments mapping in new.bpmn. Re-save the project in Studio Web so the BPMN is regenerated.`);
1223
+ }
1224
+ }
1225
+ }
1226
+ async validateAgentInputKeys(projectPath, nodeTargetId, inputs) {
1227
+ const schema = await this.agentNodeSchema.read(projectPath, nodeTargetId);
1228
+ if (!schema.agentFound || schema.inputs.length === 0) {
1229
+ return;
1230
+ }
1231
+ const declaredKeys = new Set(schema.inputs.flatMap((leaf) => [leaf.flatKey, leaf.path]));
1232
+ for (const key of Object.keys(inputs)) {
1233
+ if (!declaredKeys.has(key)) {
1234
+ throw new Error(`Input "${key}" is not an input of agent node "${nodeTargetId}". Declared agent inputs: ${schema.inputs.map((leaf) => leaf.flatKey).join(", ")}.`);
1235
+ }
1236
+ }
1237
+ }
1238
+ async validateAgentOutputKeys(projectPath, nodeTargetId, expectedOutput) {
1239
+ const schema = await this.agentNodeSchema.read(projectPath, nodeTargetId);
1240
+ if (!schema.agentFound || schema.outputs.size === 0) {
1241
+ return;
1242
+ }
1243
+ for (const key of Object.keys(expectedOutput)) {
1244
+ if (!schema.outputs.has(key)) {
1245
+ throw new Error(`Output key "${key}" is not an output of agent node "${nodeTargetId}". Declared agent outputs: ${[...schema.outputs].join(", ")}.`);
1246
+ }
1247
+ }
1248
+ }
1249
+ async validateOutputKeys(projectPath, expectedOutput) {
1250
+ const schema = await this.outputSchema.read(projectPath);
1251
+ if (!schema.flowFound || schema.outputs.size === 0) {
1252
+ return;
1253
+ }
1254
+ const flowFile = schema.flowFilePath ? this.fs.path.basename(schema.flowFilePath) : "the .flow file";
1255
+ for (const key of Object.keys(expectedOutput)) {
1256
+ if (!schema.outputs.has(key)) {
1257
+ throw new Error(`Output key "${key}" is not declared as an output variable in the flow. Add it to variables.globals (direction: "out") in ${flowFile}.`);
1258
+ }
1259
+ }
1260
+ }
1261
+ listEvaluations(projectPath, setIdOrName) {
1262
+ return this.evaluations.list(projectPath, setIdOrName);
1263
+ }
1264
+ removeEvaluation(projectPath, setIdOrName, evaluationIdOrName) {
1265
+ return this.evaluations.remove(projectPath, setIdOrName, evaluationIdOrName);
1266
+ }
1267
+ async addSimulation(projectPath, setIdOrName, evaluationIdOrName, simulation) {
1268
+ if (simulation.simulationStrategy === "Llm" && simulation.outputSchema === undefined) {
1269
+ const resolved = await this.nodeOutputSchema.read(projectPath, simulation.componentId);
1270
+ if (!resolved.nodeFound) {
1271
+ throw new Error(`Component "${simulation.componentId}" not found in the flow. Verify the component ID.`);
1272
+ }
1273
+ if (!resolved.schema) {
1274
+ throw new Error(`Could not auto-resolve output schema for component "${simulation.componentId}". The node has no declared outputs.`);
1275
+ }
1276
+ simulation = { ...simulation, outputSchema: resolved.schema };
1277
+ }
1278
+ return this.evaluations.addSimulation(projectPath, setIdOrName, evaluationIdOrName, simulation);
1279
+ }
1280
+ listSimulations(projectPath, setIdOrName, evaluationIdOrName) {
1281
+ return this.evaluations.listSimulations(projectPath, setIdOrName, evaluationIdOrName);
1282
+ }
1283
+ removeSimulation(projectPath, setIdOrName, evaluationIdOrName, componentId) {
1284
+ return this.evaluations.removeSimulation(projectPath, setIdOrName, evaluationIdOrName, componentId);
1285
+ }
1286
+ async addChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childSimulation) {
1287
+ if (childSimulation.outputSchema === undefined) {
1288
+ const resolved = await this.childSimulationSchema.read(projectPath, parentComponentId, childSimulation.componentId);
1289
+ if (resolved.schema) {
1290
+ childSimulation = {
1291
+ ...childSimulation,
1292
+ outputSchema: resolved.schema
1293
+ };
1294
+ } else if (childSimulation.simulationStrategy === "Llm") {
1295
+ if (!resolved.parentFound) {
1296
+ throw new Error(`Parent agent "${parentComponentId}" not found in the flow. Verify the parent component ID.`);
1297
+ }
1298
+ throw new Error(`Could not auto-resolve output schema for "${childSimulation.componentId}" inside agent "${parentComponentId}". ` + `Check that the tool exists on the agent and, for published agents, that you are logged in (uip login).`);
1299
+ }
1300
+ }
1301
+ if (childSimulation.simulationStrategy === "Static" && childSimulation.outputSchema !== undefined && childSimulation.mockValue !== undefined) {
1302
+ validateMockValueKeys(childSimulation.mockValue, childSimulation.outputSchema, childSimulation.componentId);
1303
+ }
1304
+ return this.evaluations.addChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childSimulation);
1305
+ }
1306
+ async listChildSimulations(projectPath, setIdOrName, evaluationIdOrName, parentComponentId) {
1307
+ const evalSet = await this.evaluations.list(projectPath, setIdOrName);
1308
+ const evaluation = evalSet.find((e) => e.id === evaluationIdOrName || e.name === evaluationIdOrName);
1309
+ if (!evaluation) {
1310
+ throw new Error(`Data point "${evaluationIdOrName}" not found`);
1311
+ }
1312
+ return this.evaluations.listChildSimulations(evaluation, parentComponentId);
1313
+ }
1314
+ removeChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childComponentId) {
1315
+ return this.evaluations.removeChildSimulation(projectPath, setIdOrName, evaluationIdOrName, parentComponentId, childComponentId);
1316
+ }
1317
+ static evaluatorTypeAliases() {
1318
+ return evaluatorTypeAliases();
1319
+ }
1320
+ }
1321
+ function validateMockValueKeys(mockValue, outputSchema, componentId) {
1322
+ if (!isRecord(mockValue) || !isRecord(outputSchema))
1323
+ return;
1324
+ const properties = isRecord(outputSchema.properties) ? outputSchema.properties : undefined;
1325
+ if (!properties)
1326
+ return;
1327
+ const schemaKeys = new Set(Object.keys(properties));
1328
+ const mockKeys = Object.keys(mockValue);
1329
+ const unexpected = mockKeys.filter((k) => !schemaKeys.has(k));
1330
+ if (unexpected.length > 0) {
1331
+ throw new Error(`Mock value for "${componentId}" has keys not in the output schema: ${unexpected.join(", ")}. ` + `Expected keys: ${[...schemaKeys].join(", ")}`);
1332
+ }
1333
+ }
1334
+ export {
1335
+ FlowEvalService
1336
+ };
1337
+
1338
+ //# debugId=E80A5885C51852BD64756E2164756E21