@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.
- package/dist/{authoring-7r6g06c7.js → authoring-wpa6d0vf.js} +74 -48
- package/dist/binding-service-dh91hw9e.js +141 -0
- package/dist/{browser-strategy-rkcvc6tn.js → browser-strategy-6atc7v8s.js} +3 -3
- package/dist/connector-service-d9ph9kx1.js +948 -0
- package/dist/{conversion-H2VEEYLB-ng48mbf7.js → conversion-QANACVCM-zs0hhfjv.js} +39 -33
- package/dist/{de-5KVP66U6-f7knj511.js → de-5KVP66U6-1bnf4zt5.js} +52 -52
- package/dist/de-6U7ECGHH-xwsw33fk.js +35 -0
- package/dist/{de-5HU6GFWV-4EZK6G7N-yrh21f52.js → de-7XQXX2DK-IDWR6CAR-n4z245kt.js} +857 -845
- package/dist/{de-5HU6GFWV-zheyw6d2.js → de-7XQXX2DK-tqdy5n2b.js} +857 -845
- package/dist/{de-HKTOVV4H-d5yw5j21.js → de-HKTOVV4H-pe9w0xn8.js} +46 -46
- package/dist/{de-XLT4QPIP-0rtw349w.js → de-XLT4QPIP-kj81dxjc.js} +9 -9
- package/dist/debug-conversation-trigger-452frzyz.js +41 -0
- package/dist/debug-http-client-wd6xb8v4.js +31 -0
- package/dist/debug-service-fvyexnb1.js +58 -0
- package/dist/edge-service-e77bndbe.js +162 -0
- package/dist/{elk.bundled-pydbzeez.js → elk.bundled-vpsbxz0p.js} +3 -3
- package/dist/{en-MABQK6C4-REWE2WG2-8dp4cqdg.js → en-5ZGC5VQ3-EWX7ILY7-rmtj70fk.js} +898 -898
- package/dist/{en-MABQK6C4-nkzq2j8t.js → en-5ZGC5VQ3-h581y30k.js} +897 -897
- package/dist/en-EPWMLP2N-2wvge238.js +28 -0
- package/dist/{en-UNT7BE26-rhh65jry.js → en-LQHKFSEY-vvbe8ve9.js} +13 -11
- package/dist/{en-P4AS26D7-szrzfxz1.js → en-P4AS26D7-zptp77bm.js} +45 -45
- package/dist/{en-4KXU7N7B-66fntxa2.js → en-X3S6IZ5J-nhkg6pwn.js} +54 -60
- package/dist/{es-MX-H2EAXLYI-qwnqt48x.js → es-MX-H2EAXLYI-j42kfkxy.js} +46 -46
- package/dist/es-MX-NHTIP5YM-ar6zfx95.js +35 -0
- package/dist/{es-MX-OKNDG2NH-c1k1s1tg.js → es-MX-OKNDG2NH-tcac6j4g.js} +9 -9
- package/dist/{es-MX-POESXYP2-UW6VP5QI-cd3a79g9.js → es-MX-U2VN3SZW-KYAJ2ONK-kdram1g1.js} +857 -845
- package/dist/{es-MX-POESXYP2-9538722k.js → es-MX-U2VN3SZW-anynsmd8.js} +857 -845
- package/dist/{es-MX-XAVLOQW3-9b3cp9n8.js → es-MX-XAVLOQW3-q00km2y7.js} +52 -52
- package/dist/{es-NQICVYSQ-aa9z3nhs.js → es-NQICVYSQ-3dtqgget.js} +9 -9
- package/dist/{es-O4PAV2CR-jwfaawwk.js → es-O4PAV2CR-0g23ve3v.js} +46 -46
- package/dist/es-PQ3RA33Q-y4kxhjfr.js +35 -0
- package/dist/{es-VFPNVMP5-thm0z9sr.js → es-VFPNVMP5-bx2c337j.js} +52 -52
- package/dist/{es-LUTYN7U7-IY5QWOUF-k2aefzc0.js → es-ZGCPPOME-24PJEGPV-rn86z9kn.js} +857 -845
- package/dist/{es-LUTYN7U7-ye5zn4sn.js → es-ZGCPPOME-8gazspjj.js} +857 -845
- package/dist/flow-api-wv8p8xbd.js +36 -0
- package/dist/flow-debug-service-tfbefas6.js +741 -0
- package/dist/flow-eval-node-target-c6wea7rz.js +44 -0
- package/dist/flow-eval-run-service-01kdky72.js +961 -0
- package/dist/flow-eval-service-ft8e16jz.js +1338 -0
- package/dist/flow-init-service-mva4crty.js +35 -0
- package/dist/flow-io-r318sjrw.js +36 -0
- package/dist/flow-migrate-service-rwcdx60q.js +119 -0
- package/dist/flow-pack-service-p4hxyj9e.js +280 -0
- package/dist/flow-validate-service-j25pxpwz.js +57 -0
- package/dist/{fr-5YRGHXF5-q6b63yg0.js → fr-5YRGHXF5-kz1ywpv6.js} +46 -46
- package/dist/{fr-E5MDO4EG-exvrs7ge.js → fr-E5MDO4EG-c3mkty2t.js} +52 -52
- package/dist/{fr-PFHIL7YZ-cxnshwa8.js → fr-PFHIL7YZ-2n589p47.js} +9 -9
- package/dist/fr-R4L3OAWI-30khpsmn.js +35 -0
- package/dist/{fr-LJIK56LW-STG6QR3T-cextvv8q.js → fr-T3G5GZCT-TU4IKBEG-k6xz1s1f.js} +857 -845
- package/dist/{fr-LJIK56LW-xf3xf2kh.js → fr-T3G5GZCT-y3f7xb1q.js} +857 -845
- package/dist/governance-fetcher-j9cx4f1d.js +391 -0
- package/dist/headless-h1myzz32.js +177196 -0
- package/dist/hitl-service-kvt5wms4.js +256 -0
- package/dist/index-1kgxzh8x.js +143 -0
- package/dist/index-4zrwgb3c.js +111 -0
- package/dist/index-ev4mdg5y.js +4801 -0
- package/dist/{index-er6vy3jk.js → index-eybzsdcc.js} +295 -317
- package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
- package/dist/{index-p50kx6jv.js → index-k5tbd184.js} +276 -276
- package/dist/index-n33np76r.js +630 -0
- package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
- package/dist/{index-dhcd9b82.js → index-w0z4s69j.js} +166 -81
- package/dist/index.js +29 -32
- package/dist/{index.umd.min-drpc57vn.js → index.umd.min-fqefd9kn.js} +3 -3
- package/dist/init.js +24 -25
- package/dist/input-reader-6pwhtp8v.js +11 -0
- package/dist/{ja-FGEGLBJ3-w9byjhze.js → ja-BI5K3JDZ-77zat4z2.js} +857 -845
- package/dist/{ja-FGEGLBJ3-MG3BSWXD-vq19zt2p.js → ja-BI5K3JDZ-GTIHISTZ-s6n3r2ab.js} +857 -845
- package/dist/{ja-DPO5PPLO-s2a7j3nj.js → ja-DPO5PPLO-mysfmznx.js} +52 -52
- package/dist/{ja-P4OSE367-8ywxep9a.js → ja-P4OSE367-srr3qypg.js} +9 -9
- package/dist/{ja-SDAPAVCR-943p5gx7.js → ja-SDAPAVCR-kg39dfap.js} +46 -46
- package/dist/ja-ZHKCBE5W-x73w6x3e.js +35 -0
- package/dist/{js-yaml-cggj6w7q.js → js-yaml-87cdx6bm.js} +27 -19
- package/dist/known-types-a20evmmg.js +20 -0
- package/dist/ko-6W7OGLLB-mnmqc584.js +35 -0
- package/dist/{ko-ITOPNIYI-qz39kamf.js → ko-ITOPNIYI-hmxd2asd.js} +52 -52
- package/dist/{ko-TUAK3G3A-s25w0ckg.js → ko-JOBF5V7N-4bv0mjje.js} +857 -845
- package/dist/{ko-TUAK3G3A-TBEBKOTM-ns78t2rv.js → ko-JOBF5V7N-O7T4HKIE-ape840y0.js} +857 -845
- package/dist/{ko-NAGOZLC3-wb3y9yhh.js → ko-NAGOZLC3-gaxxsnd2.js} +46 -46
- package/dist/{ko-PYOS2KJP-5sbj5bp8.js → ko-PYOS2KJP-e7dshyxy.js} +9 -9
- package/dist/localization-h8a53z6p.js +47 -0
- package/dist/{node-gd4469ea.js → node-cnrcrrb0.js} +7973 -7166
- package/dist/node-service-8g5x5d2y.js +70 -0
- package/dist/{node-strategy-8gzp67xs.js → node-strategy-gc4sg6a2.js} +132 -16
- package/dist/node-sync-service-e2reh33c.js +42 -0
- package/dist/{packager-tool-9qecd4wb.js → packager-tool-0gctz400.js} +5 -2
- package/dist/{packager-tool-1cb0d5e0.js → packager-tool-0v3s8r01.js} +2 -2
- package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
- package/dist/packager-tool-27avrkyk.js +15 -0
- package/dist/packager-tool-2wefykg9.js +106 -0
- package/dist/packager-tool-4fhgws0x.js +757 -0
- package/dist/{packager-tool-7yjpwj92.js → packager-tool-4hx14snw.js} +49 -48
- package/dist/{packager-tool-3wygxefb.js → packager-tool-58q3tvh7.js} +10 -10
- package/dist/{packager-tool-cvwr40ax.js → packager-tool-5qaxht3k.js} +1425 -550
- package/dist/packager-tool-5z1eg3ea.js +33289 -0
- package/dist/{packager-tool-17cn3xb7.js → packager-tool-6m078z5s.js} +13388 -19366
- package/dist/packager-tool-7b6tpg7y.js +77 -0
- package/dist/packager-tool-7exrv6w7.js +23 -0
- package/dist/packager-tool-8dszjcg5.js +4892 -0
- package/dist/packager-tool-8j92afwp.js +58 -0
- package/dist/packager-tool-94w17vf8.js +85 -0
- package/dist/{packager-tool-vdd02vns.js → packager-tool-9bec251q.js} +543 -1493
- package/dist/packager-tool-a1hbfmws.js +399 -0
- package/dist/{packager-tool-tq9q9m77.js → packager-tool-a42jnpy5.js} +3 -9
- package/dist/packager-tool-abbtfk2v.js +54 -0
- package/dist/packager-tool-cdwpc9fh.js +4945 -0
- package/dist/packager-tool-e0p2zsyc.js +97 -0
- package/dist/packager-tool-eebq62fq.js +540 -0
- package/dist/{packager-tool-m6x5sczh.js → packager-tool-em5r6g6j.js} +14 -21
- package/dist/packager-tool-eypvc2kv.js +23 -0
- package/dist/packager-tool-f0kd5kq4.js +2327 -0
- package/dist/packager-tool-fjaa8d3v.js +289 -0
- package/dist/packager-tool-g0eha8ge.js +121 -0
- package/dist/packager-tool-g9y14b10.js +54 -0
- package/dist/packager-tool-gbgfwx8f.js +2 -0
- package/dist/packager-tool-jc34wvrw.js +64 -0
- package/dist/packager-tool-k99nf3pq.js +25 -0
- package/dist/{packager-tool-hr0xg6q8.js → packager-tool-kn91khp6.js} +17 -13
- package/dist/{packager-tool-jysvpt8p.js → packager-tool-m3wkcxf5.js} +2 -2
- package/dist/{packager-tool-78a3szsp.js → packager-tool-m5qfverj.js} +1720 -2014
- package/dist/packager-tool-mwvbq6ef.js +79 -0
- package/dist/packager-tool-nq4rcqqg.js +87 -0
- package/dist/packager-tool-nxx8naxv.js +4234 -0
- package/dist/{packager-tool-3y0k15sv.js → packager-tool-p9stswjj.js} +2858 -19342
- package/dist/packager-tool-r0xpcqwg.js +188 -0
- package/dist/packager-tool-raq2wbwp.js +18 -0
- package/dist/{packager-tool-y3dezh8k.js → packager-tool-rs6jm14d.js} +6 -4
- package/dist/packager-tool-s9ff3kk4.js +6 -0
- package/dist/{packager-tool-pbsghbmj.js → packager-tool-sykgshez.js} +2 -2
- package/dist/packager-tool-tf3d2y8z.js +31 -0
- package/dist/packager-tool-tn5e7wnb.js +384 -0
- package/dist/packager-tool-v2rkcehq.js +457 -0
- package/dist/packager-tool-v86fdwvs.js +262 -0
- package/dist/packager-tool-v9psxdy5.js +8185 -0
- package/dist/packager-tool-v9rrz038.js +602 -0
- package/dist/packager-tool-vpqyvh4c.js +304 -0
- package/dist/packager-tool-wcha0e5r.js +443 -0
- package/dist/{packager-tool-1gt6js73.js → packager-tool-xhzfwa5p.js} +6 -4
- package/dist/{packager-tool-5arsyj36.js → packager-tool-yc4kw997.js} +4 -2
- package/dist/{packager-tool-pkq70dec.js → packager-tool-ywqc9rtf.js} +31 -3
- package/dist/{packager-tool-0567pxpm.js → packager-tool-z9bfhmm5.js} +10 -10
- package/dist/{packager-tool-gmrwvnyh.js → packager-tool-zfrp8ecz.js} +8 -58
- package/dist/{packager-tool-3vdpx9ng.js → packager-tool-zke08y39.js} +1121 -1846
- package/dist/packager-tool.js +17 -17
- package/dist/{pt-7TR74ZMB-1g8my56g.js → pt-7TR74ZMB-bmphh4x2.js} +46 -46
- package/dist/{pt-BR-7XGDXRDJ-TR5D7JYL-533wvy7p.js → pt-BR-7DYX2YPT-LZYH4YFD-bx43vx3z.js} +857 -845
- package/dist/{pt-BR-7XGDXRDJ-espnkgrj.js → pt-BR-7DYX2YPT-fqxqzqtf.js} +857 -845
- package/dist/{pt-BR-BXURWX4W-dqr4dnf9.js → pt-BR-BXURWX4W-bwfcwhk1.js} +52 -52
- package/dist/{pt-BR-DXXSYJDO-bn84ewp7.js → pt-BR-DXXSYJDO-a2tp13v7.js} +46 -46
- package/dist/pt-BR-UQCYHKMJ-q78n7q70.js +35 -0
- package/dist/{pt-BR-Z3TUDJHM-n7ngej6s.js → pt-BR-Z3TUDJHM-8v73x9s7.js} +9 -9
- package/dist/pt-D6A6MVB2-yvxca8vz.js +35 -0
- package/dist/{pt-TMVOOITK-myha14p9.js → pt-HTXGGX6Y-97t21dty.js} +857 -845
- package/dist/{pt-TMVOOITK-H2ADYHSD-ezpggv33.js → pt-HTXGGX6Y-ZHQSDFKI-vehfxadc.js} +857 -845
- package/dist/{pt-KSBWHAVQ-hd52bpsz.js → pt-KSBWHAVQ-mhvhgr2p.js} +9 -9
- package/dist/{pt-YI4VE4YQ-v7gjeg82.js → pt-YI4VE4YQ-wdkn2dcf.js} +52 -52
- package/dist/ro-4TMBHS5M-jz0anpt6.js +35 -0
- package/dist/{ro-BJFER5OI-334n28rj.js → ro-BJFER5OI-83tq8vxh.js} +46 -46
- package/dist/{ro-2VALF3S5-NXBJUEZN-nqw1zs33.js → ro-KTNQ3MNU-XIE6YPQN-gen8p82z.js} +857 -845
- package/dist/{ro-2VALF3S5-cdz5afkr.js → ro-KTNQ3MNU-y08n1x5g.js} +857 -845
- package/dist/{ro-RKXZUG7Z-cm3xn3fj.js → ro-RKXZUG7Z-nndrrsq7.js} +52 -52
- package/dist/{ro-VZUZTAMR-tccygznf.js → ro-VZUZTAMR-f4q0g3em.js} +9 -9
- package/dist/{ru-GSCT4ARZ-qj8dm4dp.js → ru-GSCT4ARZ-1sa9wbr8.js} +1 -1
- package/dist/{ru-GSCT4ARZ-FTVCGQTL-5nh4jf2e.js → ru-GSCT4ARZ-FTVCGQTL-gee86v14.js} +1 -1
- package/dist/{ru-T73OPRTC-mp5gn7gs.js → ru-T73OPRTC-4knxw497.js} +1 -1
- package/dist/{ru-WBLQ5B2U-awt245ky.js → ru-WBLQ5B2U-8r3c7v6d.js} +1 -1
- package/dist/ru-WBLQ5B2U-kdey8qa4.js +10 -0
- package/dist/{ru-WBLQ5B2U-57ezmxzz.js → ru-WBLQ5B2U-wemdzdqd.js} +1 -1
- package/dist/{serialization-GAW7UFOK-9hkdmmd2.js → serialization-J5QK3HPY-bgewpt6f.js} +158 -152
- package/dist/services/expression-validator.d.ts +28 -0
- package/dist/services/flow-eval-schema/types.d.ts +17 -0
- package/dist/services/flow-validate-service.d.ts +26 -0
- package/dist/services/node-validators/js-expression-syntax-validator.d.ts +6 -3
- package/dist/services/tidy-service.d.ts +26 -0
- package/dist/services/vars-reference-rule.d.ts +156 -0
- package/dist/shared-utils-8xdq6f04.js +20 -0
- package/dist/tidy-service-ashgyfwj.js +34 -0
- package/dist/tool.js +30 -33
- package/dist/{tr-AA6O2WSR-ga1xnymp.js → tr-AA6O2WSR-86ba4bdf.js} +52 -52
- package/dist/tr-GSQQ6SOT-hv1gyeaa.js +35 -0
- package/dist/{tr-RQTZ2DMS-bpgd4kma.js → tr-RQTZ2DMS-w3cwv8s4.js} +46 -46
- package/dist/{tr-W4AVRSQ4-bt3qqqdy.js → tr-W4AVRSQ4-hjr81xzk.js} +9 -9
- package/dist/{tr-RIFCEXFH-BZS7S7QK-q465b62g.js → tr-XHSSPNK7-GW5KVXR3-2w3f1ss6.js} +857 -845
- package/dist/{tr-RIFCEXFH-hgkb4g8y.js → tr-XHSSPNK7-cmqyc4wd.js} +857 -845
- package/dist/utils/handle-expansion.d.ts +16 -0
- package/dist/validation.js +47 -27
- package/dist/variable-service-er7ph4br.js +152 -0
- package/dist/wait-for-flow-job-45p1a444.js +134 -0
- package/dist/{zh-CN-IP3FMXWM-H3JI2XUM-ta4yac7h.js → zh-CN-2EHQT23P-T5XRQCVS-ac17dpc1.js} +857 -845
- package/dist/{zh-CN-IP3FMXWM-1cfarhcp.js → zh-CN-2EHQT23P-mr63c4xz.js} +857 -845
- package/dist/{zh-CN-6YRAN57T-j7jp34ws.js → zh-CN-6YRAN57T-rd7x2tqs.js} +9 -9
- package/dist/zh-CN-EDFRBU32-vvj7tmaq.js +35 -0
- package/dist/{zh-CN-R2KLHXQV-wttmznep.js → zh-CN-R2KLHXQV-agqr45ds.js} +52 -52
- package/dist/{zh-CN-ZC6LT4IN-vty9mvv8.js → zh-CN-ZC6LT4IN-kbzvvzz5.js} +46 -46
- package/dist/zh-TW-HAICM6DE-rh7k3cq7.js +35 -0
- package/dist/{zh-TW-AGIDXIPF-R4XZRDJZ-cgxxz5k4.js → zh-TW-MGZCE5BT-P6FLIUAR-zmq07vhs.js} +857 -845
- package/dist/{zh-TW-AGIDXIPF-n6r6w7vy.js → zh-TW-MGZCE5BT-c4ekmrz9.js} +857 -845
- package/dist/{zh-TW-R7Y5KVMU-q81f4z2p.js → zh-TW-R7Y5KVMU-m61y07e3.js} +46 -46
- package/dist/{zh-TW-RJGCQANM-gqn0aca0.js → zh-TW-RJGCQANM-w0x3qc1p.js} +52 -52
- package/dist/{zh-TW-SO2245GN-m5kh88bg.js → zh-TW-SO2245GN-n2bn1gg4.js} +9 -9
- package/package.json +2 -2
- package/dist/de-5KVP66U6-t37qr521.js +0 -161
- package/dist/de-WMKOGI7B-6dc1zdnp.js +0 -143
- package/dist/en-4KXU7N7B-24v330b5.js +0 -118
- package/dist/en-X4DLPKLJ-1h9gj5c1.js +0 -110
- package/dist/es-BVPGJUWA-0k59eqfv.js +0 -143
- package/dist/es-MX-U6YL5KQX-k4qvpgd4.js +0 -143
- package/dist/es-MX-XAVLOQW3-47a405kf.js +0 -161
- package/dist/es-VFPNVMP5-6sftsdxe.js +0 -161
- package/dist/fr-E5MDO4EG-f3x1jeqw.js +0 -161
- package/dist/fr-EKTTDR7Z-m2t68j0m.js +0 -143
- package/dist/ja-DPO5PPLO-fmbg7zt2.js +0 -161
- package/dist/ja-Y2YBTXNN-5sszk2zv.js +0 -143
- package/dist/ko-ITOPNIYI-aqy82jk8.js +0 -161
- package/dist/ko-S33XAV26-rfsv9myd.js +0 -143
- package/dist/packager-tool-0sz8se22.js +0 -10671
- package/dist/packager-tool-8mqydhz8.js +0 -9850
- package/dist/packager-tool-p9j43p8h.js +0 -115
- package/dist/packager-tool-v74yk918.js +0 -107
- package/dist/packager-tool-xj0agqpk.js +0 -11
- package/dist/pt-BR-BXURWX4W-xzyndmrx.js +0 -161
- package/dist/pt-BR-JO45SCNI-mt93s33c.js +0 -143
- package/dist/pt-W3NA4LIZ-fwd1q4j0.js +0 -143
- package/dist/pt-YI4VE4YQ-521681zf.js +0 -161
- package/dist/ro-RKXZUG7Z-pdztdafr.js +0 -161
- package/dist/ro-WLKX6HF5-b9tj8q67.js +0 -143
- package/dist/ru-WBLQ5B2U-8xd4gpv2.js +0 -10
- package/dist/ru-WBLQ5B2U-mswqs9wc.js +0 -10
- package/dist/tr-3U2W2XCA-43ptfc0m.js +0 -143
- package/dist/tr-AA6O2WSR-bj9n80k8.js +0 -161
- package/dist/zh-CN-IPZYQR3P-egjmvyjf.js +0 -143
- package/dist/zh-CN-R2KLHXQV-x6gnk2n0.js +0 -161
- package/dist/zh-TW-RJGCQANM-tt8j5wv2.js +0 -161
- package/dist/zh-TW-YPVSQVGT-b378ztph.js +0 -143
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FlowEvalPathResolver,
|
|
3
|
+
findEvalSet,
|
|
4
|
+
getLinkedEvaluators,
|
|
5
|
+
readStartNodeId,
|
|
6
|
+
readWorkflowId
|
|
7
|
+
} from "./packager-tool-r0xpcqwg.js";
|
|
8
|
+
import {
|
|
9
|
+
readNodeTargetId
|
|
10
|
+
} from "./packager-tool-g0eha8ge.js";
|
|
11
|
+
import {
|
|
12
|
+
writeResolvedFlow
|
|
13
|
+
} from "./packager-tool-raq2wbwp.js";
|
|
14
|
+
import {
|
|
15
|
+
package_default
|
|
16
|
+
} from "./packager-tool-7b6tpg7y.js";
|
|
17
|
+
import {
|
|
18
|
+
isRecord,
|
|
19
|
+
isUUID
|
|
20
|
+
} from "./packager-tool-8j92afwp.js";
|
|
21
|
+
import {
|
|
22
|
+
ensureProcessBindings
|
|
23
|
+
} from "./packager-tool-v2rkcehq.js";
|
|
24
|
+
import {
|
|
25
|
+
fileNodesToPackagingNodes,
|
|
26
|
+
packageInlineAgents,
|
|
27
|
+
stageInlineAgentPackageFiles,
|
|
28
|
+
writePackagingArtifactsDetailed
|
|
29
|
+
} from "./packager-tool-v86fdwvs.js";
|
|
30
|
+
import {
|
|
31
|
+
FlowEvalFileStore,
|
|
32
|
+
ensureDirectory
|
|
33
|
+
} from "./packager-tool-jc34wvrw.js";
|
|
34
|
+
import"./packager-tool-4hx14snw.js";
|
|
35
|
+
import"./packager-tool-a1hbfmws.js";
|
|
36
|
+
import"./packager-tool-cdwpc9fh.js";
|
|
37
|
+
import"./packager-tool-g9y14b10.js";
|
|
38
|
+
import"./packager-tool-5z1eg3ea.js";
|
|
39
|
+
import {
|
|
40
|
+
extractStartEventId,
|
|
41
|
+
getPersonalFolderInfo,
|
|
42
|
+
getPersonalFolderKey,
|
|
43
|
+
patchConnectionOverwrites,
|
|
44
|
+
prepareForCustomDebug
|
|
45
|
+
} from "./packager-tool-v9rrz038.js";
|
|
46
|
+
import"./packager-tool-fjaa8d3v.js";
|
|
47
|
+
import"./packager-tool-v9psxdy5.js";
|
|
48
|
+
import"./packager-tool-ywqc9rtf.js";
|
|
49
|
+
import"./packager-tool-f0kd5kq4.js";
|
|
50
|
+
import"./packager-tool-0gctz400.js";
|
|
51
|
+
import"./packager-tool-qa9gftnj.js";
|
|
52
|
+
import"./packager-tool-yc4kw997.js";
|
|
53
|
+
import"./packager-tool-7exrv6w7.js";
|
|
54
|
+
import {
|
|
55
|
+
buildSolutionPackageFromDir,
|
|
56
|
+
getStudioWebSolutionProjects,
|
|
57
|
+
uploadOrOverwriteSolution
|
|
58
|
+
} from "./packager-tool-8dszjcg5.js";
|
|
59
|
+
import {
|
|
60
|
+
findSolutionFile,
|
|
61
|
+
readUipxFile,
|
|
62
|
+
updateSolutionFile
|
|
63
|
+
} from "./packager-tool-eebq62fq.js";
|
|
64
|
+
import {
|
|
65
|
+
readFlowWorkflow,
|
|
66
|
+
resolveProjectFlowFile,
|
|
67
|
+
writeFlowWorkflow
|
|
68
|
+
} from "./packager-tool-94w17vf8.js";
|
|
69
|
+
import {
|
|
70
|
+
convertFlowToBpmn,
|
|
71
|
+
replaceExporterVersion,
|
|
72
|
+
setPublishIntentOnInlineAgents
|
|
73
|
+
} from "./packager-tool-6m078z5s.js";
|
|
74
|
+
import"./packager-tool-tn5e7wnb.js";
|
|
75
|
+
import"./packager-tool-xhzfwa5p.js";
|
|
76
|
+
import"./packager-tool-nkrmjr3a.js";
|
|
77
|
+
import"./packager-tool-rs6jm14d.js";
|
|
78
|
+
import"./packager-tool-hk1gxnth.js";
|
|
79
|
+
import"./packager-tool-em5r6g6j.js";
|
|
80
|
+
import"./packager-tool-9bec251q.js";
|
|
81
|
+
import"./packager-tool-z9bfhmm5.js";
|
|
82
|
+
import"./packager-tool-6ejqwbw9.js";
|
|
83
|
+
import"./packager-tool-mcaf4ewf.js";
|
|
84
|
+
import"./packager-tool-eypvc2kv.js";
|
|
85
|
+
import {
|
|
86
|
+
catchError,
|
|
87
|
+
logger
|
|
88
|
+
} from "./packager-tool-5qaxht3k.js";
|
|
89
|
+
import {
|
|
90
|
+
getFileSystem
|
|
91
|
+
} from "./packager-tool-0v3s8r01.js";
|
|
92
|
+
import"./packager-tool-p9stswjj.js";
|
|
93
|
+
import"./packager-tool-vpqyvh4c.js";
|
|
94
|
+
import"./packager-tool-gbgfwx8f.js";
|
|
95
|
+
import"./packager-tool-58q3tvh7.js";
|
|
96
|
+
import"./packager-tool-sc961w0q.js";
|
|
97
|
+
import {
|
|
98
|
+
inMemoryWorkflowToFileFormat,
|
|
99
|
+
isVoiceAgentNodeType
|
|
100
|
+
} from "./packager-tool-m5qfverj.js";
|
|
101
|
+
import"./packager-tool-e0p2zsyc.js";
|
|
102
|
+
import"./packager-tool-a42jnpy5.js";
|
|
103
|
+
import"./packager-tool-c23zrhj8.js";
|
|
104
|
+
import"./packager-tool-1yh8g550.js";
|
|
105
|
+
|
|
106
|
+
// src/services/flow-eval-run-readers.ts
|
|
107
|
+
function asRecordArray(value, label) {
|
|
108
|
+
if (!Array.isArray(value)) {
|
|
109
|
+
throw new Error(`${label} response must be an array`);
|
|
110
|
+
}
|
|
111
|
+
return value.map((item, index) => {
|
|
112
|
+
if (!isRecord(item)) {
|
|
113
|
+
throw new Error(`${label} response item ${index} must be an object`);
|
|
114
|
+
}
|
|
115
|
+
return item;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function readRecord(value) {
|
|
119
|
+
return isRecord(value) ? value : undefined;
|
|
120
|
+
}
|
|
121
|
+
function readRecordArray(value) {
|
|
122
|
+
if (!Array.isArray(value)) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
return value.filter(isRecord);
|
|
126
|
+
}
|
|
127
|
+
function optionalNumber(value) {
|
|
128
|
+
return typeof value === "number" ? value : null;
|
|
129
|
+
}
|
|
130
|
+
function optionalString(value) {
|
|
131
|
+
return typeof value === "string" ? value : "";
|
|
132
|
+
}
|
|
133
|
+
function statusString(value) {
|
|
134
|
+
if (typeof value === "string") {
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
if (typeof value === "number") {
|
|
138
|
+
const statusByCode = {
|
|
139
|
+
0: "Pending",
|
|
140
|
+
1: "Running",
|
|
141
|
+
2: "Completed",
|
|
142
|
+
3: "PartiallyCompleted",
|
|
143
|
+
4: "Failed"
|
|
144
|
+
};
|
|
145
|
+
return statusByCode[value] ?? String(value);
|
|
146
|
+
}
|
|
147
|
+
return "";
|
|
148
|
+
}
|
|
149
|
+
function readEvaluatorScores(value) {
|
|
150
|
+
const records = readRecordArray(value);
|
|
151
|
+
if (!records) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return records.flatMap((score) => {
|
|
155
|
+
const evaluatorId = score.evaluatorId;
|
|
156
|
+
const scoreValue = score.value;
|
|
157
|
+
if (typeof evaluatorId !== "string" || typeof scoreValue !== "number") {
|
|
158
|
+
return [];
|
|
159
|
+
}
|
|
160
|
+
return [{ evaluatorId, value: scoreValue }];
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function readRemoteEvalSetRun(record) {
|
|
164
|
+
return {
|
|
165
|
+
id: optionalString(record.id),
|
|
166
|
+
workloadId: optionalString(record.workloadId),
|
|
167
|
+
evalSetId: typeof record.evalSetId === "string" ? record.evalSetId : null,
|
|
168
|
+
status: statusString(record.status),
|
|
169
|
+
score: optionalNumber(record.score),
|
|
170
|
+
evaluatorScores: readEvaluatorScores(record.evaluatorScores),
|
|
171
|
+
config: readRecord(record.config) ?? {},
|
|
172
|
+
numberOfEvalsExecuted: optionalNumber(record.numberOfEvalsExecuted),
|
|
173
|
+
durationMilliseconds: optionalNumber(record.durationMilliseconds),
|
|
174
|
+
createdAt: optionalString(record.createdAt),
|
|
175
|
+
updatedAt: optionalString(record.updatedAt)
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function readRemoteEvalRun(record) {
|
|
179
|
+
const snapshot = readRecord(record.evalSnapshot);
|
|
180
|
+
const result = readRecord(record.result);
|
|
181
|
+
return {
|
|
182
|
+
id: optionalString(record.id),
|
|
183
|
+
evalSetRunId: optionalString(record.evalSetRunId),
|
|
184
|
+
evalSnapshot: snapshot ? {
|
|
185
|
+
id: typeof snapshot.id === "string" ? snapshot.id : undefined,
|
|
186
|
+
name: typeof snapshot.name === "string" ? snapshot.name : undefined,
|
|
187
|
+
inputs: readRecord(snapshot.inputs),
|
|
188
|
+
evaluationCriterias: readRecord(snapshot.evaluationCriterias),
|
|
189
|
+
expectedOutput: readRecord(snapshot.expectedOutput) ?? (snapshot.expectedOutput === null ? null : undefined)
|
|
190
|
+
} : undefined,
|
|
191
|
+
status: statusString(record.status),
|
|
192
|
+
result: result ? {
|
|
193
|
+
output: readRecord(result.output),
|
|
194
|
+
scores: readEvaluatorScores(result.scores) ?? undefined,
|
|
195
|
+
score: readRecord(result.score)
|
|
196
|
+
} : null,
|
|
197
|
+
completionMetrics: readRecord(record.completionMetrics),
|
|
198
|
+
evaluatorRuns: readRecordArray(record.evaluatorRuns)?.flatMap((evaluatorRun) => {
|
|
199
|
+
const evaluatorId = evaluatorRun.evaluatorId;
|
|
200
|
+
if (typeof evaluatorId !== "string") {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
const evaluatorResult = readRecord(evaluatorRun.result);
|
|
204
|
+
return [
|
|
205
|
+
{
|
|
206
|
+
evaluatorId,
|
|
207
|
+
evaluatorSnapshot: evaluatorRun.evaluatorSnapshot,
|
|
208
|
+
status: typeof evaluatorRun.status === "string" ? evaluatorRun.status : undefined,
|
|
209
|
+
result: evaluatorResult ? {
|
|
210
|
+
output: readRecord(evaluatorResult.output),
|
|
211
|
+
score: readRecord(evaluatorResult.score)
|
|
212
|
+
} : null,
|
|
213
|
+
completionMetrics: readRecord(evaluatorRun.completionMetrics)
|
|
214
|
+
}
|
|
215
|
+
];
|
|
216
|
+
}),
|
|
217
|
+
error: typeof record.error === "string" || isRecord(record.error) ? record.error : null,
|
|
218
|
+
errorMessage: typeof record.errorMessage === "string" ? record.errorMessage : null,
|
|
219
|
+
createdAt: typeof record.createdAt === "string" ? record.createdAt : undefined,
|
|
220
|
+
updatedAt: typeof record.updatedAt === "string" ? record.updatedAt : undefined
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/services/flow-eval-run-api.ts
|
|
225
|
+
class FlowEvalRunApi {
|
|
226
|
+
async executeAndEvaluate(config, payload) {
|
|
227
|
+
return this.requestJson(config, "/unifiedEvals/workloads/executeAndEvaluate", {
|
|
228
|
+
method: "POST",
|
|
229
|
+
body: JSON.stringify(payload)
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async listEvalSetRuns(config, workloadId) {
|
|
233
|
+
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns?workloadType=Flow`, { method: "GET" });
|
|
234
|
+
return asRecordArray(response, "Eval set runs").map(readRemoteEvalSetRun);
|
|
235
|
+
}
|
|
236
|
+
async getEvalSetRun(config, workloadId, evalSetRunId) {
|
|
237
|
+
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns/${encodeURIComponent(evalSetRunId)}?workloadType=Flow`, { method: "GET" });
|
|
238
|
+
if (!isRecord(response)) {
|
|
239
|
+
throw new Error("Eval set run response must be an object");
|
|
240
|
+
}
|
|
241
|
+
return readRemoteEvalSetRun(response);
|
|
242
|
+
}
|
|
243
|
+
async getEvalRuns(config, workloadId, evalSetRunId) {
|
|
244
|
+
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns/${encodeURIComponent(evalSetRunId)}/evalRuns?workloadType=Flow`, { method: "GET" });
|
|
245
|
+
return asRecordArray(response, "Eval runs").map(readRemoteEvalRun);
|
|
246
|
+
}
|
|
247
|
+
apiBase(config) {
|
|
248
|
+
return `${config.baseUrl}/${config.organizationId}/${config.tenantName}/agentsruntime_/api`;
|
|
249
|
+
}
|
|
250
|
+
headers(config) {
|
|
251
|
+
return {
|
|
252
|
+
Authorization: `Bearer ${config.authToken}`,
|
|
253
|
+
Accept: "application/json",
|
|
254
|
+
"Content-Type": "application/json",
|
|
255
|
+
"X-UiPath-Internal-TenantId": config.tenantId,
|
|
256
|
+
"X-UiPath-Internal-AccountId": config.organizationId
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
async requestJson(config, path, request) {
|
|
260
|
+
const response = await fetch(`${this.apiBase(config)}${path}`, {
|
|
261
|
+
method: request.method,
|
|
262
|
+
headers: {
|
|
263
|
+
...this.headers(config),
|
|
264
|
+
...request.headers
|
|
265
|
+
},
|
|
266
|
+
body: request.body
|
|
267
|
+
});
|
|
268
|
+
const text = await response.text();
|
|
269
|
+
if (!response.ok) {
|
|
270
|
+
throw new Error(`Unified eval API returned ${response.status}: ${text}`);
|
|
271
|
+
}
|
|
272
|
+
if (!text) {
|
|
273
|
+
throw new Error(`Unified eval API returned ${response.status} with empty body`);
|
|
274
|
+
}
|
|
275
|
+
return JSON.parse(text);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// src/services/flow-local-workspace-eval-preparer.ts
|
|
280
|
+
function toForwardSlash(path) {
|
|
281
|
+
return path.replace(/\\/g, "/");
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
class FlowLocalWorkspaceEvalPreparer {
|
|
285
|
+
fs;
|
|
286
|
+
constructor(fs) {
|
|
287
|
+
this.fs = fs;
|
|
288
|
+
}
|
|
289
|
+
async prepare(projectPath, config, existingSolutionIdOverride, options = {}) {
|
|
290
|
+
const absoluteProjectPath = this.fs.path.resolve(projectPath);
|
|
291
|
+
const projectFilePath = this.fs.path.join(absoluteProjectPath, "project.uiproj");
|
|
292
|
+
if (!await this.fs.exists(projectFilePath)) {
|
|
293
|
+
throw new Error(`Not a valid flow project directory: missing project.uiproj in ${absoluteProjectPath}`);
|
|
294
|
+
}
|
|
295
|
+
const projectFileContent = await this.fs.readFile(projectFilePath, "utf-8");
|
|
296
|
+
if (projectFileContent === null) {
|
|
297
|
+
throw new Error(`Failed to read project.uiproj in ${absoluteProjectPath}`);
|
|
298
|
+
}
|
|
299
|
+
const projectFile = JSON.parse(String(projectFileContent));
|
|
300
|
+
if (!projectFile.Name) {
|
|
301
|
+
throw new Error(`Invalid project.uiproj in ${absoluteProjectPath}: missing Name`);
|
|
302
|
+
}
|
|
303
|
+
const projectName = projectFile.Name;
|
|
304
|
+
const safeProjectName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
305
|
+
const flowFilePath = await resolveProjectFlowFile(absoluteProjectPath);
|
|
306
|
+
const flowFileName = this.fs.path.basename(flowFilePath);
|
|
307
|
+
const flowBaseName = flowFileName.replace(/\.flow$/i, "");
|
|
308
|
+
const bpmnFileName = `${flowBaseName}.bpmn`;
|
|
309
|
+
const { workflow } = await readFlowWorkflow(flowFilePath);
|
|
310
|
+
ensureProcessBindings(workflow);
|
|
311
|
+
logger.info("Found .flow file, converting to BPMN for eval debug...");
|
|
312
|
+
const bpmnXml = await this.convertToBpmn(workflow);
|
|
313
|
+
const solutionDir = this.fs.path.resolve(absoluteProjectPath, "..");
|
|
314
|
+
const stagingDir = this.fs.path.join(this.fs.env.tmpdir(), `.flow-eval-staging-${safeProjectName}-${Date.now()}`);
|
|
315
|
+
await this.fs.mkdir(stagingDir);
|
|
316
|
+
let uisPath;
|
|
317
|
+
try {
|
|
318
|
+
const [uipxError, uipxResult] = await catchError(readUipxFile(this.fs, solutionDir));
|
|
319
|
+
if (uipxError) {
|
|
320
|
+
logger.warn(`Could not read .uipx: ${uipxError.message}. Falling back to flow-only upload.`);
|
|
321
|
+
}
|
|
322
|
+
const flowProjectRelDir = this.resolveProjectRelativeDir(solutionDir, absoluteProjectPath, uipxResult?.uipx.Projects ?? []);
|
|
323
|
+
if (uipxResult) {
|
|
324
|
+
await this.fs.writeFile(this.fs.path.join(stagingDir, uipxResult.uipxFileName), JSON.stringify(uipxResult.uipx, null, 4));
|
|
325
|
+
} else {
|
|
326
|
+
await this.writeSingleProjectSolutionMetadata(stagingDir, safeProjectName, flowProjectRelDir);
|
|
327
|
+
}
|
|
328
|
+
await this.copySolutionResources(solutionDir, stagingDir);
|
|
329
|
+
await this.copySiblingProjects(solutionDir, stagingDir, flowProjectRelDir, uipxResult?.uipx.Projects ?? []);
|
|
330
|
+
const stagingProjectDir = this.fs.path.join(stagingDir, flowProjectRelDir);
|
|
331
|
+
await ensureDirectory(this.fs, stagingProjectDir);
|
|
332
|
+
await this.writeFlowProjectArtifacts(stagingProjectDir, projectFileContent, workflow, flowFileName, bpmnFileName, bpmnXml, flowBaseName, absoluteProjectPath);
|
|
333
|
+
logger.info("Building solution package for eval debug...");
|
|
334
|
+
uisPath = await buildSolutionPackageFromDir(this.fs, stagingDir);
|
|
335
|
+
const solutionInfo = await findSolutionFile(this.fs, absoluteProjectPath);
|
|
336
|
+
const apiConfig = this.createApiConfig(config);
|
|
337
|
+
const folder = await getPersonalFolderInfo(apiConfig);
|
|
338
|
+
const importResult = await uploadOrOverwriteSolution(apiConfig, config.organizationName, uisPath, existingSolutionIdOverride ?? solutionInfo?.solutionId, this.fs);
|
|
339
|
+
if (options.persistLocalMetadata ?? true) {
|
|
340
|
+
await updateSolutionFile(this.fs, absoluteProjectPath, importResult.id);
|
|
341
|
+
await this.updateLocalWorkspaceMarker(solutionDir, importResult.id);
|
|
342
|
+
}
|
|
343
|
+
const patchedCount = await patchConnectionOverwrites(apiConfig, config.organizationName, importResult.id, solutionDir, folder, this.fs);
|
|
344
|
+
if (patchedCount > 0) {
|
|
345
|
+
logger.info(`Patched ${patchedCount} connection overwrite(s) on Studio Web`);
|
|
346
|
+
}
|
|
347
|
+
const matchedProject = this.resolveImportedProject(importResult, projectName);
|
|
348
|
+
return {
|
|
349
|
+
solutionId: importResult.id,
|
|
350
|
+
studioWebProjectId: matchedProject.id,
|
|
351
|
+
folderKey: folder.key,
|
|
352
|
+
projects: importResult.projects
|
|
353
|
+
};
|
|
354
|
+
} finally {
|
|
355
|
+
const [cleanupErr] = await catchError((async () => {
|
|
356
|
+
if (uisPath) {
|
|
357
|
+
await this.fs.rm(uisPath);
|
|
358
|
+
}
|
|
359
|
+
await this.fs.rm(stagingDir, { recursive: true });
|
|
360
|
+
})());
|
|
361
|
+
if (cleanupErr) {
|
|
362
|
+
logger.warn(`Cleanup failed: ${cleanupErr.message}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
async convertToBpmn(workflow) {
|
|
367
|
+
const hasVoiceAgent = (workflow.nodes ?? []).some((node) => isVoiceAgentNodeType(node.type));
|
|
368
|
+
if (hasVoiceAgent) {
|
|
369
|
+
throw new Error("Evaluation runs are not supported for flows with voice agent nodes.");
|
|
370
|
+
}
|
|
371
|
+
const fileFormat = inMemoryWorkflowToFileFormat(workflow);
|
|
372
|
+
setPublishIntentOnInlineAgents(fileFormat);
|
|
373
|
+
const { bpmn } = await convertFlowToBpmn(JSON.stringify(fileFormat, null, 2));
|
|
374
|
+
return replaceExporterVersion(bpmn, package_default.version);
|
|
375
|
+
}
|
|
376
|
+
resolveProjectRelativeDir(solutionDir, projectPath, projects) {
|
|
377
|
+
const projectRelativePath = toForwardSlash(this.fs.path.relative(solutionDir, this.fs.path.join(projectPath, "project.uiproj")));
|
|
378
|
+
const matchedProject = projects.find((project) => toForwardSlash(project.ProjectRelativePath) === projectRelativePath);
|
|
379
|
+
return toForwardSlash(this.fs.path.dirname(matchedProject?.ProjectRelativePath ?? projectRelativePath));
|
|
380
|
+
}
|
|
381
|
+
async writeSingleProjectSolutionMetadata(stagingDir, projectName, projectRelativeDir) {
|
|
382
|
+
const solutionId = crypto.randomUUID();
|
|
383
|
+
const projectId = crypto.randomUUID();
|
|
384
|
+
const projectRelativePath = `${projectRelativeDir}/project.uiproj`;
|
|
385
|
+
await this.fs.writeFile(this.fs.path.join(stagingDir, "SolutionStorage.json"), JSON.stringify({
|
|
386
|
+
SolutionId: solutionId,
|
|
387
|
+
Projects: [
|
|
388
|
+
{
|
|
389
|
+
ProjectId: projectId,
|
|
390
|
+
ProjectRelativePath: projectRelativePath
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}, null, 4));
|
|
394
|
+
await this.fs.writeFile(this.fs.path.join(stagingDir, `${projectName}Solution.uipx`), JSON.stringify({
|
|
395
|
+
SolutionId: solutionId,
|
|
396
|
+
Projects: [
|
|
397
|
+
{
|
|
398
|
+
Type: "Flow",
|
|
399
|
+
ProjectRelativePath: projectRelativePath,
|
|
400
|
+
Id: projectId
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}, null, 4));
|
|
404
|
+
}
|
|
405
|
+
async copySolutionResources(solutionDir, stagingDir) {
|
|
406
|
+
const resourcesDir = this.fs.path.join(solutionDir, "resources");
|
|
407
|
+
if (await this.fs.exists(resourcesDir)) {
|
|
408
|
+
await this.fs.copyDirectory(resourcesDir, this.fs.path.join(stagingDir, "resources"));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
async copySiblingProjects(solutionDir, stagingDir, flowProjectRelDir, projects) {
|
|
412
|
+
for (const project of projects) {
|
|
413
|
+
const projectDir = toForwardSlash(this.fs.path.dirname(project.ProjectRelativePath));
|
|
414
|
+
if (projectDir === flowProjectRelDir) {
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
const srcProjectPath = this.fs.path.join(solutionDir, projectDir);
|
|
418
|
+
if (await this.fs.exists(srcProjectPath)) {
|
|
419
|
+
await this.fs.copyDirectory(srcProjectPath, this.fs.path.join(stagingDir, projectDir));
|
|
420
|
+
logger.info(`Included project "${projectDir}" (${project.Type}) in eval debug solution package`);
|
|
421
|
+
} else {
|
|
422
|
+
logger.warn(`Project directory not found: ${srcProjectPath} - skipping`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
async writeFlowProjectArtifacts(stagingProjectDir, projectFileContent, flowData, flowFileName, bpmnFileName, bpmnXml, flowBaseName, sourceProjectPath) {
|
|
427
|
+
await this.fs.writeFile(this.fs.path.join(stagingProjectDir, "project.uiproj"), projectFileContent);
|
|
428
|
+
await writeFlowWorkflow(this.fs.path.join(stagingProjectDir, flowFileName), flowData);
|
|
429
|
+
await this.fs.writeFile(this.fs.path.join(stagingProjectDir, bpmnFileName), bpmnXml);
|
|
430
|
+
const startEventId = extractStartEventId(bpmnXml);
|
|
431
|
+
const packagingNodes = fileNodesToPackagingNodes(flowData.nodes);
|
|
432
|
+
const bindings = flowData.bindings ?? [];
|
|
433
|
+
const workflowVariables = flowData.variables ?? {};
|
|
434
|
+
const definitions = flowData.definitions ?? [];
|
|
435
|
+
const inlineAgentPackages = await packageInlineAgents(this.fs, sourceProjectPath, flowData.nodes);
|
|
436
|
+
await writePackagingArtifactsDetailed(this.fs, stagingProjectDir, flowData.id, packagingNodes, bindings, workflowVariables, bpmnFileName, startEventId, flowFileName, definitions, {
|
|
437
|
+
additionalEntryPoints: inlineAgentPackages.map((agent) => agent.entryPoint),
|
|
438
|
+
additionalBindingsJsons: inlineAgentPackages.map((agent) => agent.bindingsJson)
|
|
439
|
+
});
|
|
440
|
+
await writeResolvedFlow(this.fs, stagingProjectDir, flowBaseName, flowData);
|
|
441
|
+
await stageInlineAgentPackageFiles(this.fs, sourceProjectPath, stagingProjectDir, inlineAgentPackages, (source) => `Staged inline agent "${source}" for eval debug`);
|
|
442
|
+
}
|
|
443
|
+
createApiConfig(config) {
|
|
444
|
+
return {
|
|
445
|
+
baseUrl: config.baseUrl,
|
|
446
|
+
organizationId: config.organizationId,
|
|
447
|
+
tenantName: config.tenantName,
|
|
448
|
+
tenantId: config.tenantId,
|
|
449
|
+
authToken: config.authToken,
|
|
450
|
+
organizationUnitId: config.organizationUnitId
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
resolveImportedProject(importResult, projectName) {
|
|
454
|
+
const exactProject = importResult.projects.find((project) => project.name === projectName);
|
|
455
|
+
if (exactProject?.id) {
|
|
456
|
+
return exactProject;
|
|
457
|
+
}
|
|
458
|
+
const [onlyProject] = importResult.projects;
|
|
459
|
+
if (importResult.projects.length === 1 && onlyProject?.id) {
|
|
460
|
+
return onlyProject;
|
|
461
|
+
}
|
|
462
|
+
throw new Error(`Upload response had ${importResult.projects.length} projects and none matched "${projectName}"; refusing to guess.`);
|
|
463
|
+
}
|
|
464
|
+
async updateLocalWorkspaceMarker(solutionDir, solutionId) {
|
|
465
|
+
const markerPath = this.fs.path.join(solutionDir, ".sw-path-marker");
|
|
466
|
+
if (await this.fs.exists(markerPath)) {
|
|
467
|
+
await this.fs.writeFile(markerPath, solutionId);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// src/services/flow-eval-run-context.ts
|
|
473
|
+
var VSIX_LOCAL_SOLUTION_PREFIX = "uip-sw-local://Folder/";
|
|
474
|
+
var AGENT_TARGET_RUNTIME = "pythonAgent";
|
|
475
|
+
var INLINE_AGENT_PROJECT_TYPE = "Agent";
|
|
476
|
+
var INLINE_AGENT_DEBUG_EXECUTOR_COMMAND = "debug";
|
|
477
|
+
var INLINE_AGENT_DEBUG_ATTACH_NONE_ARG = "--attach=none";
|
|
478
|
+
function toForwardSlash2(path) {
|
|
479
|
+
return path.replace(/\\/g, "/");
|
|
480
|
+
}
|
|
481
|
+
function projectDirFromRelativePath(fs, relativePath) {
|
|
482
|
+
return toForwardSlash2(fs.path.dirname(relativePath ?? ""));
|
|
483
|
+
}
|
|
484
|
+
function projectMatchesDir(fs, projectRelativePath, projectRelDir, absoluteProjectPath) {
|
|
485
|
+
const projectDir = projectDirFromRelativePath(fs, projectRelativePath);
|
|
486
|
+
return projectDir === projectRelDir || fs.path.basename(projectDir) === fs.path.basename(absoluteProjectPath);
|
|
487
|
+
}
|
|
488
|
+
function readRecordValue(record, key) {
|
|
489
|
+
return record?.[key];
|
|
490
|
+
}
|
|
491
|
+
function firstString(values) {
|
|
492
|
+
return values.find((value) => typeof value === "string" && value !== "");
|
|
493
|
+
}
|
|
494
|
+
function readFlowStringProperty(flowContent, property) {
|
|
495
|
+
const [parseError, parsed] = catchError(() => JSON.parse(flowContent));
|
|
496
|
+
if (parseError || !isRecord(parsed)) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
const value = parsed[property];
|
|
500
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
501
|
+
}
|
|
502
|
+
function readFlowProjectId(flowContent) {
|
|
503
|
+
const projectId = readFlowStringProperty(flowContent, "projectId");
|
|
504
|
+
return projectId && isUUID(projectId) ? projectId : undefined;
|
|
505
|
+
}
|
|
506
|
+
function readVsixLocalSolutionId(flowContent) {
|
|
507
|
+
const solutionId = readFlowStringProperty(flowContent, "solutionId");
|
|
508
|
+
if (!solutionId?.startsWith(VSIX_LOCAL_SOLUTION_PREFIX)) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
const localSolutionId = solutionId.slice(VSIX_LOCAL_SOLUTION_PREFIX.length);
|
|
512
|
+
return isUUID(localSolutionId) ? localSolutionId : undefined;
|
|
513
|
+
}
|
|
514
|
+
function isConversationalAgentNodeType(nodeType) {
|
|
515
|
+
return nodeType === "uipath.agent.conversational" || nodeType.startsWith("uipath.agent.conversational.");
|
|
516
|
+
}
|
|
517
|
+
function getInlineAgentDebugExecutorEntryPoint(project) {
|
|
518
|
+
const entryPointPath = project.entryPointPath?.replace(/^\/+/, "");
|
|
519
|
+
if (!entryPointPath) {
|
|
520
|
+
return "agent.json";
|
|
521
|
+
}
|
|
522
|
+
const safeProjectPath = project.id.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
523
|
+
const prefixes = [
|
|
524
|
+
`content/${project.id}/`,
|
|
525
|
+
`${project.id}/`,
|
|
526
|
+
`content/${safeProjectPath}/`,
|
|
527
|
+
`${safeProjectPath}/`
|
|
528
|
+
];
|
|
529
|
+
for (const prefix of prefixes) {
|
|
530
|
+
if (entryPointPath.startsWith(prefix)) {
|
|
531
|
+
return entryPointPath.slice(prefix.length) || "agent.json";
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return entryPointPath;
|
|
535
|
+
}
|
|
536
|
+
function withInlineAgentExecutorInfo(project) {
|
|
537
|
+
if (project.type.toLowerCase() !== INLINE_AGENT_PROJECT_TYPE.toLowerCase() || !project.entryPointPath) {
|
|
538
|
+
return project;
|
|
539
|
+
}
|
|
540
|
+
return {
|
|
541
|
+
...project,
|
|
542
|
+
executorInfo: JSON.stringify({
|
|
543
|
+
projectId: project.id,
|
|
544
|
+
command: INLINE_AGENT_DEBUG_EXECUTOR_COMMAND,
|
|
545
|
+
entryPoint: getInlineAgentDebugExecutorEntryPoint(project),
|
|
546
|
+
args: [INLINE_AGENT_DEBUG_ATTACH_NONE_ARG]
|
|
547
|
+
})
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function extractInlineAgentProjects(flowContent, currentProjectId) {
|
|
551
|
+
const parsed = JSON.parse(flowContent);
|
|
552
|
+
if (!isRecord(parsed) || !Array.isArray(parsed.nodes)) {
|
|
553
|
+
return [];
|
|
554
|
+
}
|
|
555
|
+
const seen = new Set;
|
|
556
|
+
return parsed.nodes.filter(isRecord).flatMap((node) => {
|
|
557
|
+
const nodeType = typeof node.type === "string" ? node.type : "";
|
|
558
|
+
const model = isRecord(node.model) ? node.model : undefined;
|
|
559
|
+
const inputs = isRecord(node.inputs) ? node.inputs : undefined;
|
|
560
|
+
const display = isRecord(node.display) ? node.display : undefined;
|
|
561
|
+
const serviceType = typeof model?.serviceType === "string" ? model.serviceType.toLowerCase() : "";
|
|
562
|
+
const lowerType = nodeType.toLowerCase();
|
|
563
|
+
const isAgent = lowerType.startsWith("uipath.agent") || serviceType.includes("agent");
|
|
564
|
+
if (!isAgent) {
|
|
565
|
+
return [];
|
|
566
|
+
}
|
|
567
|
+
const agentProjectId = firstString([
|
|
568
|
+
readRecordValue(inputs, "source"),
|
|
569
|
+
readRecordValue(model, "source"),
|
|
570
|
+
readRecordValue(inputs, "agentProjectId"),
|
|
571
|
+
readRecordValue(model, "agentProjectId")
|
|
572
|
+
]);
|
|
573
|
+
if (!agentProjectId || agentProjectId === currentProjectId || seen.has(agentProjectId)) {
|
|
574
|
+
return [];
|
|
575
|
+
}
|
|
576
|
+
seen.add(agentProjectId);
|
|
577
|
+
return [
|
|
578
|
+
withInlineAgentExecutorInfo({
|
|
579
|
+
id: agentProjectId,
|
|
580
|
+
name: typeof display?.label === "string" ? display.label : "Agent",
|
|
581
|
+
type: "Agent",
|
|
582
|
+
entryPointPath: `${agentProjectId}/agent.json`,
|
|
583
|
+
targetRuntime: AGENT_TARGET_RUNTIME,
|
|
584
|
+
targetFramework: "Portable",
|
|
585
|
+
isConversational: isConversationalAgentNodeType(nodeType),
|
|
586
|
+
requiresUserInteraction: false
|
|
587
|
+
})
|
|
588
|
+
];
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
class FlowEvalRunContextResolver {
|
|
593
|
+
fs;
|
|
594
|
+
pathResolver;
|
|
595
|
+
localWorkspacePreparer;
|
|
596
|
+
constructor(fs, pathResolver, localWorkspacePreparer = new FlowLocalWorkspaceEvalPreparer(fs)) {
|
|
597
|
+
this.fs = fs;
|
|
598
|
+
this.pathResolver = pathResolver;
|
|
599
|
+
this.localWorkspacePreparer = localWorkspacePreparer;
|
|
600
|
+
}
|
|
601
|
+
async resolveTarget(projectPath, evalSet, options, requireSolutionId, config) {
|
|
602
|
+
const absoluteProjectPath = await this.pathResolver.resolveFlowProjectPath(projectPath);
|
|
603
|
+
const solutionDir = this.fs.path.dirname(absoluteProjectPath);
|
|
604
|
+
const projectRelDir = toForwardSlash2(this.fs.path.relative(solutionDir, absoluteProjectPath));
|
|
605
|
+
const [uipxError, uipxResult] = await catchError(readUipxFile(this.fs, solutionDir));
|
|
606
|
+
const solutionStorage = await this.readSolutionStorage(solutionDir);
|
|
607
|
+
const localWorkspaceMarker = await this.readLocalWorkspaceMarker(solutionDir);
|
|
608
|
+
const uipxProject = uipxResult?.uipx.Projects.find((project) => projectMatchesDir(this.fs, project.ProjectRelativePath, projectRelDir, absoluteProjectPath));
|
|
609
|
+
const storageProject = solutionStorage?.Projects?.find((project) => projectMatchesDir(this.fs, project.ProjectRelativePath, projectRelDir, absoluteProjectPath));
|
|
610
|
+
const flowFilePath = await this.pathResolver.findFlowFile(absoluteProjectPath);
|
|
611
|
+
const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
|
|
612
|
+
const vsixLocalSolutionId = readVsixLocalSolutionId(flowContent);
|
|
613
|
+
const isVsixLocalProject = localWorkspaceMarker === undefined && vsixLocalSolutionId !== undefined;
|
|
614
|
+
const flowProjectId = readFlowProjectId(flowContent);
|
|
615
|
+
if (uipxError && !solutionStorage && !options.projectId && !isVsixLocalProject) {
|
|
616
|
+
throw new Error("Could not resolve Flow project metadata from a parent .uipx or SolutionStorage.json file. Use a flow project extracted with 'uip solution download --extract', or provide --project-id.");
|
|
617
|
+
}
|
|
618
|
+
const localProjectDebugId = await this.readLocalProjectId(absoluteProjectPath);
|
|
619
|
+
let studioWebProjectId = options.projectId ?? (localWorkspaceMarker ? storageProject?.CloudProjectId ?? storageProject?.ProjectId ?? uipxProject?.Id ?? localProjectDebugId : isVsixLocalProject ? flowProjectId ?? localProjectDebugId ?? storageProject?.CloudProjectId ?? storageProject?.ProjectId ?? uipxProject?.Id : localProjectDebugId ?? storageProject?.CloudProjectId ?? storageProject?.ProjectId ?? uipxProject?.Id);
|
|
620
|
+
const projectIdFromUipxManifest = options.projectId === undefined && localWorkspaceMarker === undefined && !isVsixLocalProject && localProjectDebugId === undefined && storageProject?.CloudProjectId === undefined && storageProject?.ProjectId === undefined && uipxProject?.Id !== undefined;
|
|
621
|
+
const isLocalWorkspace = localWorkspaceMarker !== undefined;
|
|
622
|
+
const solutionId = options.solutionId ?? (isLocalWorkspace ? localWorkspaceMarker.SolutionId ?? solutionStorage?.SolutionId ?? uipxResult?.uipx.SolutionId : isVsixLocalProject ? vsixLocalSolutionId ?? solutionStorage?.SolutionId ?? uipxResult?.uipx.SolutionId : solutionStorage?.SolutionId ?? uipxResult?.uipx.SolutionId);
|
|
623
|
+
if (!studioWebProjectId) {
|
|
624
|
+
throw new Error("Could not resolve Flow project ID. Provide --project-id or run from a project listed in the parent .uipx or SolutionStorage.json file.");
|
|
625
|
+
}
|
|
626
|
+
let cloudProjects;
|
|
627
|
+
if (projectIdFromUipxManifest && config && solutionId) {
|
|
628
|
+
cloudProjects = await this.fetchCloudProjects(config, solutionId);
|
|
629
|
+
studioWebProjectId = this.mapDesignIdToCloudProjectId(cloudProjects, studioWebProjectId, this.fs.path.basename(absoluteProjectPath), solutionId);
|
|
630
|
+
}
|
|
631
|
+
const workloadId = readWorkflowId(flowContent) ?? studioWebProjectId;
|
|
632
|
+
if (requireSolutionId && !solutionId) {
|
|
633
|
+
throw new Error("Could not resolve solution ID. Provide --solution-id or run from a project whose parent directory contains a .uipx or SolutionStorage.json file.");
|
|
634
|
+
}
|
|
635
|
+
const additionalProjects = await this.resolveAdditionalProjects(studioWebProjectId, flowContent, uipxResult?.uipx.Projects ?? [], solutionStorage, uipxProject?.Id, cloudProjects);
|
|
636
|
+
return {
|
|
637
|
+
projectPath: absoluteProjectPath,
|
|
638
|
+
evalSet,
|
|
639
|
+
workloadId,
|
|
640
|
+
studioWebProjectId,
|
|
641
|
+
solutionId,
|
|
642
|
+
solutionName: this.resolveSolutionName(solutionDir, uipxResult),
|
|
643
|
+
...isLocalWorkspace ? { isLocalWorkspace } : {},
|
|
644
|
+
...isVsixLocalProject ? { isVsixLocalProject } : {},
|
|
645
|
+
...additionalProjects.length > 0 ? { additionalProjects } : {}
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
async buildExecutionContext(target, config, options) {
|
|
649
|
+
if (!target.solutionId) {
|
|
650
|
+
throw new Error("Could not resolve solution ID.");
|
|
651
|
+
}
|
|
652
|
+
const shouldPrepareLocalProject = (target.isLocalWorkspace || target.isVsixLocalProject) && !options.projectId && !options.solutionId;
|
|
653
|
+
const resolvedIds = shouldPrepareLocalProject ? await this.resolvePreparedDebugIds(target, config, options.folderKey) : {
|
|
654
|
+
studioWebProjectId: target.studioWebProjectId,
|
|
655
|
+
solutionId: target.solutionId,
|
|
656
|
+
folderKey: options.folderKey ?? (await getPersonalFolderKey({
|
|
657
|
+
baseUrl: config.baseUrl,
|
|
658
|
+
organizationId: config.organizationId,
|
|
659
|
+
tenantName: config.tenantName,
|
|
660
|
+
tenantId: config.tenantId,
|
|
661
|
+
authToken: config.authToken,
|
|
662
|
+
organizationUnitId: config.organizationUnitId
|
|
663
|
+
})).key
|
|
664
|
+
};
|
|
665
|
+
const additionalProjects = resolvedIds.additionalProjects ?? target.additionalProjects;
|
|
666
|
+
return {
|
|
667
|
+
workloadId: target.workloadId,
|
|
668
|
+
studioWebProjectId: resolvedIds.studioWebProjectId,
|
|
669
|
+
solutionId: resolvedIds.solutionId,
|
|
670
|
+
folderKey: resolvedIds.folderKey,
|
|
671
|
+
entrypoint: await this.resolveEntrypoint(target.projectPath, target.evalSet, options.entryPoint),
|
|
672
|
+
...additionalProjects ? { additionalProjects } : {},
|
|
673
|
+
debugMode: options.debugMode ?? (readNodeTargetId(target.evalSet) !== undefined ? 3 : 1)
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
async resolvePreparedDebugIds(target, config, folderKeyOverride) {
|
|
677
|
+
const preparedProject = target.isVsixLocalProject ? await this.localWorkspacePreparer.prepare(target.projectPath, config, target.solutionId, { persistLocalMetadata: false }) : await this.localWorkspacePreparer.prepare(target.projectPath, config, target.solutionId);
|
|
678
|
+
const folderKey = folderKeyOverride ?? preparedProject.folderKey;
|
|
679
|
+
if (target.isVsixLocalProject) {
|
|
680
|
+
return {
|
|
681
|
+
studioWebProjectId: preparedProject.studioWebProjectId,
|
|
682
|
+
solutionId: preparedProject.solutionId,
|
|
683
|
+
folderKey,
|
|
684
|
+
...target.additionalProjects ? {
|
|
685
|
+
additionalProjects: this.remapUploadedAdditionalProjects(target.additionalProjects, preparedProject.projects, preparedProject.studioWebProjectId)
|
|
686
|
+
} : {}
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
const debugIds = await prepareForCustomDebug({
|
|
690
|
+
config,
|
|
691
|
+
solutionId: preparedProject.solutionId,
|
|
692
|
+
projectId: preparedProject.studioWebProjectId,
|
|
693
|
+
solutionName: target.solutionName ?? "Solution",
|
|
694
|
+
folderKey
|
|
695
|
+
});
|
|
696
|
+
return {
|
|
697
|
+
studioWebProjectId: debugIds.projectDebugId,
|
|
698
|
+
solutionId: debugIds.solutionDebugId,
|
|
699
|
+
folderKey,
|
|
700
|
+
...target.additionalProjects ? {
|
|
701
|
+
additionalProjects: this.remapUploadedAdditionalProjects(target.additionalProjects, preparedProject.projects, preparedProject.studioWebProjectId)
|
|
702
|
+
} : {}
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
remapUploadedAdditionalProjects(additionalProjects, uploadedProjects, currentProjectId) {
|
|
706
|
+
return additionalProjects.map((project) => {
|
|
707
|
+
if (project.entryPointPath) {
|
|
708
|
+
return project;
|
|
709
|
+
}
|
|
710
|
+
const uploadedProject = uploadedProjects.find((candidate) => candidate.name === project.name && candidate.id !== currentProjectId);
|
|
711
|
+
if (!uploadedProject) {
|
|
712
|
+
return project;
|
|
713
|
+
}
|
|
714
|
+
return {
|
|
715
|
+
...project,
|
|
716
|
+
id: uploadedProject.id
|
|
717
|
+
};
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
async fetchCloudProjects(config, solutionId) {
|
|
721
|
+
const cloudProjects = await getStudioWebSolutionProjects(config, config.organizationName, solutionId);
|
|
722
|
+
if (cloudProjects === undefined) {
|
|
723
|
+
throw new Error(`Solution ${solutionId} was not found in Studio Web. Upload it first with 'uip solution upload', or pass --solution-id and --project-id explicitly.`);
|
|
724
|
+
}
|
|
725
|
+
return cloudProjects;
|
|
726
|
+
}
|
|
727
|
+
mapDesignIdToCloudProjectId(cloudProjects, designProjectId, projectName, solutionId) {
|
|
728
|
+
const match = cloudProjects.find((project) => project.designId === designProjectId) ?? cloudProjects.find((project) => project.name === projectName);
|
|
729
|
+
if (!match) {
|
|
730
|
+
const available = cloudProjects.map((project) => `${project.name ?? "?"} (${project.id})`).join(", ");
|
|
731
|
+
throw new Error(`Project "${projectName}" (design ID ${designProjectId}) is not part of solution ${solutionId} in Studio Web. Available projects: ${available || "none"}. Re-upload the solution with 'uip solution upload' or pass --project-id.`);
|
|
732
|
+
}
|
|
733
|
+
return match.id;
|
|
734
|
+
}
|
|
735
|
+
async resolveAdditionalProjects(currentProjectId, flowContent, uipxProjects, solutionStorage, currentDesignProjectId, cloudProjects) {
|
|
736
|
+
const byId = new Map;
|
|
737
|
+
for (const project of extractInlineAgentProjects(flowContent, currentProjectId)) {
|
|
738
|
+
byId.set(project.id, project);
|
|
739
|
+
}
|
|
740
|
+
for (const project of uipxProjects) {
|
|
741
|
+
if (project.Id === currentDesignProjectId) {
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
const storageProject = solutionStorage?.Projects?.find((storage) => storage.ProjectId === project.Id || storage.ProjectRelativePath === project.ProjectRelativePath);
|
|
745
|
+
const id = storageProject?.CloudProjectId ?? storageProject?.ProjectId ?? cloudProjects?.find((cloudProject) => cloudProject.designId === project.Id)?.id ?? project.Id;
|
|
746
|
+
if (id === currentProjectId || byId.has(id)) {
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
byId.set(id, {
|
|
750
|
+
id,
|
|
751
|
+
name: this.fs.path.basename(this.fs.path.dirname(project.ProjectRelativePath)),
|
|
752
|
+
type: project.Type
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
return Array.from(byId.values()).filter((p) => isUUID(p.id));
|
|
756
|
+
}
|
|
757
|
+
async resolveEntrypoint(projectPath, evalSet, entryPointOverride) {
|
|
758
|
+
if (entryPointOverride && (entryPointOverride.startsWith("/") || entryPointOverride.includes("#"))) {
|
|
759
|
+
return entryPointOverride;
|
|
760
|
+
}
|
|
761
|
+
const flowFilePath = await this.pathResolver.findFlowFile(projectPath);
|
|
762
|
+
const flowFileName = this.fs.path.basename(flowFilePath);
|
|
763
|
+
const bpmnFileName = flowFileName.replace(/\.flow$/i, ".bpmn");
|
|
764
|
+
const flowContent = String(await this.fs.readFile(flowFilePath, "utf-8"));
|
|
765
|
+
const nodeId = entryPointOverride ?? evalSet.selectedEntrypoint ?? readStartNodeId(flowContent) ?? "start";
|
|
766
|
+
return `/${bpmnFileName}#${nodeId}`;
|
|
767
|
+
}
|
|
768
|
+
async readLocalProjectId(projectPath) {
|
|
769
|
+
const localIdPath = this.fs.path.join(projectPath, ".uipath", "local-project-id.json");
|
|
770
|
+
if (!await this.fs.exists(localIdPath)) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
const [readError, content] = await catchError(this.fs.readFile(localIdPath, "utf-8"));
|
|
774
|
+
if (readError) {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const [parseError, parsed] = catchError(() => JSON.parse(String(content)));
|
|
778
|
+
if (parseError || !isRecord(parsed)) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
return typeof parsed.projectId === "string" && isUUID(parsed.projectId) ? parsed.projectId : undefined;
|
|
782
|
+
}
|
|
783
|
+
async readLocalWorkspaceMarker(solutionDir) {
|
|
784
|
+
const markerPath = this.fs.path.join(solutionDir, ".sw-path-marker");
|
|
785
|
+
if (!await this.fs.exists(markerPath)) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
const content = String(await this.fs.readFile(markerPath, "utf-8"));
|
|
789
|
+
const solutionId = content.trim();
|
|
790
|
+
return {
|
|
791
|
+
SolutionId: isUUID(solutionId) ? solutionId : undefined
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
resolveSolutionName(solutionDir, uipxResult) {
|
|
795
|
+
if (uipxResult?.uipxFileName) {
|
|
796
|
+
return uipxResult.uipxFileName.replace(/\.uipx$/i, "");
|
|
797
|
+
}
|
|
798
|
+
return this.fs.path.basename(solutionDir);
|
|
799
|
+
}
|
|
800
|
+
async readSolutionStorage(solutionDir) {
|
|
801
|
+
const storagePath = this.fs.path.join(solutionDir, "SolutionStorage.json");
|
|
802
|
+
if (!await this.fs.exists(storagePath)) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
const content = await this.fs.readFile(storagePath, "utf-8");
|
|
806
|
+
const parsed = JSON.parse(String(content));
|
|
807
|
+
if (!isRecord(parsed)) {
|
|
808
|
+
throw new Error("SolutionStorage.json must be a JSON object");
|
|
809
|
+
}
|
|
810
|
+
const projects = Array.isArray(parsed.Projects) ? parsed.Projects.filter(isRecord).map((project) => ({
|
|
811
|
+
ProjectId: typeof project.ProjectId === "string" ? project.ProjectId : undefined,
|
|
812
|
+
ProjectRelativePath: typeof project.ProjectRelativePath === "string" ? project.ProjectRelativePath : undefined,
|
|
813
|
+
CloudProjectId: typeof project.CloudProjectId === "string" ? project.CloudProjectId : undefined
|
|
814
|
+
})) : undefined;
|
|
815
|
+
return {
|
|
816
|
+
SolutionId: typeof parsed.SolutionId === "string" ? parsed.SolutionId : undefined,
|
|
817
|
+
...projects ? { Projects: projects } : {}
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// src/services/inject-workload-id.ts
|
|
823
|
+
function injectWorkloadId(simulation, defaultWorkloadId) {
|
|
824
|
+
const workloadId = typeof simulation.workloadId === "string" ? simulation.workloadId : defaultWorkloadId;
|
|
825
|
+
const childSimulations = Array.isArray(simulation.childSimulations) ? simulation.childSimulations.map((child) => injectWorkloadId(child, workloadId)) : undefined;
|
|
826
|
+
return {
|
|
827
|
+
...simulation,
|
|
828
|
+
workloadId,
|
|
829
|
+
...childSimulations ? { childSimulations } : {}
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// src/services/flow-eval-run-service.ts
|
|
834
|
+
class FlowEvalRunService {
|
|
835
|
+
fs;
|
|
836
|
+
api;
|
|
837
|
+
store;
|
|
838
|
+
pathResolver;
|
|
839
|
+
contextResolver;
|
|
840
|
+
constructor(fs = getFileSystem(), api = new FlowEvalRunApi) {
|
|
841
|
+
this.fs = fs;
|
|
842
|
+
this.api = api;
|
|
843
|
+
this.store = new FlowEvalFileStore(fs);
|
|
844
|
+
this.pathResolver = new FlowEvalPathResolver(fs);
|
|
845
|
+
this.contextResolver = new FlowEvalRunContextResolver(fs, this.pathResolver);
|
|
846
|
+
}
|
|
847
|
+
async resolveRemoteEvalTarget(projectPath, setIdOrName, options = {}, requireSolutionId = false, config) {
|
|
848
|
+
const absoluteProjectPath = await this.pathResolver.resolveFlowProjectPath(projectPath);
|
|
849
|
+
const evalSet = await this.requireEvalSet(absoluteProjectPath, setIdOrName);
|
|
850
|
+
return this.contextResolver.resolveTarget(absoluteProjectPath, evalSet, options, requireSolutionId, config);
|
|
851
|
+
}
|
|
852
|
+
async resolveRemoteEvalContext(projectPath, setIdOrName, config, options = {}) {
|
|
853
|
+
const target = await this.resolveRemoteEvalTarget(projectPath, setIdOrName, options, true, config);
|
|
854
|
+
const context = await this.contextResolver.buildExecutionContext(target, config, options);
|
|
855
|
+
return {
|
|
856
|
+
evalSet: target.evalSet,
|
|
857
|
+
target,
|
|
858
|
+
context
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
async startRemoteEvalRun(projectPath, setIdOrName, config, options = {}) {
|
|
862
|
+
const absoluteProjectPath = await this.pathResolver.resolveFlowProjectPath(projectPath);
|
|
863
|
+
const evalSet = await this.requireEvalSet(absoluteProjectPath, setIdOrName);
|
|
864
|
+
if (evalSet.evaluations.length === 0) {
|
|
865
|
+
throw new Error(`Evaluation set "${evalSet.name}" has no data points. Add some with 'maestro flow eval add'.`);
|
|
866
|
+
}
|
|
867
|
+
const evaluators = await this.getLinkedEvaluators(absoluteProjectPath, evalSet);
|
|
868
|
+
if (evaluators.length === 0) {
|
|
869
|
+
throw new Error("No evaluators found for this evaluation set. Add evaluators first.");
|
|
870
|
+
}
|
|
871
|
+
const { context } = await this.resolveRemoteEvalContext(absoluteProjectPath, setIdOrName, config, options);
|
|
872
|
+
const response = await this.api.executeAndEvaluate(config, {
|
|
873
|
+
workloadId: context.workloadId,
|
|
874
|
+
context: {
|
|
875
|
+
type: "Offline",
|
|
876
|
+
evalSetId: evalSet.id
|
|
877
|
+
},
|
|
878
|
+
evaluatorConfigs: evaluators.map((evaluator) => ({
|
|
879
|
+
id: evaluator.id,
|
|
880
|
+
version: evaluator.version,
|
|
881
|
+
evaluatorTypeId: evaluator.evaluatorTypeId,
|
|
882
|
+
evaluatorConfig: evaluator.evaluatorConfig ?? {}
|
|
883
|
+
})),
|
|
884
|
+
items: evalSet.evaluations.map((evaluation) => ({
|
|
885
|
+
id: evaluation.id,
|
|
886
|
+
name: evaluation.name,
|
|
887
|
+
inputs: evaluation.inputs,
|
|
888
|
+
expectedOutput: evaluation.expectedOutput,
|
|
889
|
+
evaluationCriterias: evaluation.evaluationCriterias ?? {},
|
|
890
|
+
simulations: evaluation.simulations?.map((simulation) => injectWorkloadId(simulation, context.workloadId))
|
|
891
|
+
})),
|
|
892
|
+
batchSize: evalSet.batchSize ?? 1,
|
|
893
|
+
...evalSet.timeoutMinutes !== undefined ? { timeoutMinutes: evalSet.timeoutMinutes } : {},
|
|
894
|
+
executionConfig: {
|
|
895
|
+
workloadType: "Flow",
|
|
896
|
+
tenantId: config.tenantId,
|
|
897
|
+
folderKey: context.folderKey,
|
|
898
|
+
entrypoint: context.entrypoint,
|
|
899
|
+
solutionId: context.solutionId,
|
|
900
|
+
studioWebProjectId: context.studioWebProjectId,
|
|
901
|
+
...context.additionalProjects ? { additionalProjects: context.additionalProjects } : {},
|
|
902
|
+
...context.debugMode !== undefined ? { debugMode: context.debugMode } : {}
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
const evalSetRunId = response.evalSetRunId;
|
|
906
|
+
if (typeof evalSetRunId !== "string") {
|
|
907
|
+
throw new Error("Unified eval API response did not include evalSetRunId.");
|
|
908
|
+
}
|
|
909
|
+
return {
|
|
910
|
+
evalSetRunId,
|
|
911
|
+
evalSetName: evalSet.name,
|
|
912
|
+
status: typeof response.status === "string" ? response.status : "Pending",
|
|
913
|
+
dataPoints: evalSet.evaluations.length,
|
|
914
|
+
evaluators: evaluators.length,
|
|
915
|
+
context
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
async listRemoteEvalSetRuns(config, workloadId, evalSetId) {
|
|
919
|
+
const runs = await this.api.listEvalSetRuns(config, workloadId);
|
|
920
|
+
return evalSetId ? runs.filter((run) => run.evalSetId === evalSetId) : runs;
|
|
921
|
+
}
|
|
922
|
+
getRemoteEvalSetRun(config, workloadId, evalSetRunId) {
|
|
923
|
+
return this.api.getEvalSetRun(config, workloadId, evalSetRunId);
|
|
924
|
+
}
|
|
925
|
+
getRemoteEvalRuns(config, workloadId, evalSetRunId) {
|
|
926
|
+
return this.api.getEvalRuns(config, workloadId, evalSetRunId);
|
|
927
|
+
}
|
|
928
|
+
async listEvaluators(projectPath) {
|
|
929
|
+
const absoluteProjectPath = await this.pathResolver.resolveFlowProjectPath(projectPath);
|
|
930
|
+
return this.listEvaluatorsForResolvedPath(absoluteProjectPath);
|
|
931
|
+
}
|
|
932
|
+
async listEvalSets(projectPath) {
|
|
933
|
+
const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
|
|
934
|
+
if (!root) {
|
|
935
|
+
return [];
|
|
936
|
+
}
|
|
937
|
+
return this.store.readJsonFiles(this.fs.path.join(root, "eval-sets"));
|
|
938
|
+
}
|
|
939
|
+
async listEvaluatorsForResolvedPath(projectPath) {
|
|
940
|
+
const root = await this.pathResolver.resolveEvalRoot(projectPath, false);
|
|
941
|
+
if (!root) {
|
|
942
|
+
return [];
|
|
943
|
+
}
|
|
944
|
+
return this.store.readJsonFiles(this.fs.path.join(root, "evaluators"));
|
|
945
|
+
}
|
|
946
|
+
async requireEvalSet(projectPath, idOrName) {
|
|
947
|
+
const evalSet = findEvalSet(await this.listEvalSets(projectPath), idOrName);
|
|
948
|
+
if (!evalSet) {
|
|
949
|
+
throw new Error(`Evaluation set "${idOrName}" not found`);
|
|
950
|
+
}
|
|
951
|
+
return evalSet;
|
|
952
|
+
}
|
|
953
|
+
async getLinkedEvaluators(projectPath, evalSet) {
|
|
954
|
+
return getLinkedEvaluators(await this.listEvaluatorsForResolvedPath(projectPath), evalSet);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
export {
|
|
958
|
+
FlowEvalRunService
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
//# debugId=F5732D840B9EB53664756E2164756E21
|