@uipath/flow-tool 1.205.0-preview.276 → 1.206.0-preview.279
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/README.md +14 -12
- package/dist/THIRD-PARTY-NOTICES.md +77 -49
- package/dist/applicationinsights-web-8m26566f.js +17209 -0
- package/dist/authoring-x84r2a2j.js +23 -0
- package/dist/binding-service-s0wvr2xm.js +114 -0
- package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-gnftxwsf.js} +5 -6
- package/dist/connector-library-1yw5r47w.js +99 -0
- package/dist/{connector-service-m08dysc2.js → connector-service-r86mtxwn.js} +270 -275
- package/dist/{conversion-FQTRFHRX-e5wr281j.js → conversion-7O2PDOQB-3wwppx87.js} +477 -472
- package/dist/{de-FGHEJRCI-PK6WALXW-0dnvnmke.js → de-2BEKRUMY-MD7L477H-rj1rmtav.js} +425 -37
- package/dist/{de-WLW6KWOJ-2qnsqdtw.js → de-2BEKRUMY-x4dx0nn9.js} +190 -10
- package/dist/{de-VMMG2MN7-2ecwpg1b.js → de-3CU65EDB-r7r10am9.js} +82 -7
- package/dist/{de-UZI7FJDO-awjpqfz0.js → de-AI7ML6JM-km47f8k4.js} +20 -5
- package/dist/{de-B3EKCNFC-zdwybhh7.js → de-VQWT6L5Y-mch4qwyv.js} +38 -5
- package/dist/{de-XNTCMP5Z-xfkfqg20.js → de-XNTCMP5Z-nd4scb43.js} +1 -4
- package/dist/debug-conversation-trigger-3wzy90kj.js +23 -0
- package/dist/debug-http-client-zydr7tna.js +31 -0
- package/dist/debug-service-hdktqeek.js +60 -0
- package/dist/edge-service-zck3s9ss.js +267 -0
- package/dist/{elk.bundled-vpsbxz0p.js → elk.bundled-phy0zc81.js} +6860 -6860
- package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/en-LAVDF7IQ-ba7wzsxp.js +254 -0
- package/dist/en-LQHKFSEY-zf6a2myg.js +24 -0
- package/dist/en-U2NSIIZN-whenw6wh.js +58 -0
- package/dist/en-WPCQ4JKF-t3x07ggr.js +148 -0
- package/dist/en-X6T4SP2Y-FPGCJIFV-qdfapfzs.js +2756 -0
- package/dist/en-X6T4SP2Y-xe57av1w.js +2752 -0
- package/dist/{es-5THCNRFN-tqwyrdgy.js → es-7ZTQTGKN-11sj0yjx.js} +190 -10
- package/dist/{es-KR3ZSNMP-QLWVVWKJ-5egs0gj9.js → es-7ZTQTGKN-TXQBFYRA-bzh1e1gq.js} +422 -34
- package/dist/{es-EKHIPSW6-ya88nvm0.js → es-EKHIPSW6-asfceac2.js} +1 -4
- package/dist/{es-KEBF3AIM-g5rszh8f.js → es-EP563JWQ-1agj5n4e.js} +38 -5
- package/dist/{es-WY6FZ3HO-zksnn6dp.js → es-KHVY67FO-natcvmmm.js} +82 -7
- package/dist/{es-MX-5RELIXKI-jtjbcxbb.js → es-MX-7KJZPEQN-1fq0a9jr.js} +20 -5
- package/dist/{es-MX-ZP2LJ3V7-k4brnfa9.js → es-MX-F7ZEHSNE-gxpm47vv.js} +82 -7
- package/dist/{es-MX-XXZJGC4R-W6EEIHXR-c2m4yjpj.js → es-MX-IHGRIEWH-23X37OPS-7cqdzpcy.js} +425 -37
- package/dist/{es-MX-TWZBRAXK-gqd9swzw.js → es-MX-IHGRIEWH-g63p0gb4.js} +191 -11
- package/dist/{es-MX-OR6G2SFR-7yykk5ma.js → es-MX-OR6G2SFR-02t13sen.js} +1 -4
- package/dist/{es-MX-EL3CDS3F-sh84yvjr.js → es-MX-S2RFDGDE-x9r0tv30.js} +38 -5
- package/dist/{es-4UBUTCQA-t7hsackg.js → es-SPNKTD5Y-vw5cbgv5.js} +20 -5
- package/dist/filter-engine-dh9s90gb.js +10 -0
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/flow-api-d4dvmadm.js +38 -0
- package/dist/{flow-debug-service-gc2ky1ve.js → flow-debug-service-hy21ddd9.js} +151 -195
- package/dist/flow-eval-node-target-tdrwqca7.js +29 -0
- package/dist/flow-eval-run-api-w4j8ra60.js +9 -0
- package/dist/{flow-eval-run-service-2cbr0jtw.js → flow-eval-run-service-5en4ahyn.js} +125 -149
- package/dist/{flow-eval-service-24jbkhhz.js → flow-eval-service-2j28ect1.js} +57 -81
- package/dist/{flow-init-sdk-source-xvdvkq7d.js → flow-init-sdk-source-xnr4bg25.js} +8 -11
- package/dist/flow-init-service-bj3ev9bz.js +26 -0
- package/dist/flow-io-9q6xk473.js +24 -0
- package/dist/{flow-migrate-service-t3pnd2r3.js → flow-migrate-service-dkx85jj5.js} +33 -54
- package/dist/{flow-pack-service-b910q207.js → flow-pack-service-58m51sp8.js} +79 -103
- package/dist/flow-validate-service-9a3zate4.js +46 -0
- package/dist/{fr-DPD4GHX3-exeypjwk.js → fr-7LK3QUWT-a94yejcs.js} +38 -5
- package/dist/{fr-Y6NPVODW-AS7T42TR-v4qe2tha.js → fr-7ZDL4MVO-CXMRZDOF-qjkg6y2r.js} +425 -37
- package/dist/{fr-CERONSRC-edpxhbmb.js → fr-7ZDL4MVO-pd27vwh6.js} +191 -11
- package/dist/{fr-VBM5WRC2-707ha692.js → fr-AXJGUT53-hdg3pmd4.js} +20 -5
- package/dist/{fr-PRMYCRDC-0bk078by.js → fr-I42FODC5-p80x5v4b.js} +83 -8
- package/dist/{fr-IHD66TVT-vfvmefbx.js → fr-IHD66TVT-eq8h0d6c.js} +1 -4
- package/dist/{governance-fetcher-ffvbtwbd.js → governance-fetcher-h8hpcwyh.js} +17 -21
- package/dist/{headless-4x4v3sy6.js → headless-41t9wwb7.js} +2395 -43269
- package/dist/{hitl-service-3m4ce3mt.js → hitl-service-hccqhm63.js} +22 -42
- package/dist/index-4e3w8x62.js +31 -0
- package/dist/{index-fyc0k5dd.js → index-5pzp2qeb.js} +5350 -3271
- package/dist/index-5xh0cjag.js +82 -0
- package/dist/index-7fet3f0s.js +10 -0
- package/dist/index-d4bdedx3.js +32 -0
- package/dist/index-f5kq7265.js +24 -0
- package/dist/index-g2p2ww34.js +39 -0
- package/dist/index-ng011fzs.js +974 -0
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/{index-1b2je9n2.js → index-px95xmkg.js} +290 -268
- package/dist/index-tdwpejt6.js +22 -0
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +19 -28
- package/dist/index.umd.min-ttg1qc0x.js +7814 -0
- package/dist/init.js +22 -43
- package/dist/inline-entity-resolver-0neh2b43.js +25 -0
- package/dist/input-reader-zqaep7k7.js +11 -0
- package/dist/{ja-43QL7CGO-c3q8gre9.js → ja-C7GZV6YP-hvtbngr5.js} +20 -5
- package/dist/{ja-HFEQKCZF-hb2f25p8.js → ja-GI3OUHPZ-28fy60r0.js} +83 -8
- package/dist/{ja-JE5ZL7EY-hacj2m31.js → ja-JE5ZL7EY-607k4c7p.js} +1 -4
- package/dist/{ja-Q5PXKJ2V-BR5GRIDQ-fgqqpryf.js → ja-LGAM5HKR-NTPKIZEM-nv67917s.js} +422 -34
- package/dist/{ja-U2MCNHGT-gz0ap1jk.js → ja-LGAM5HKR-sgrtjqjh.js} +190 -10
- package/dist/ja-WY2W6733-ayr36h1f.js +71 -0
- package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
- package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/known-types-v9sxcq1c.js +13 -0
- package/dist/{ko-AYBDSRZG-G43C3XUW-kng13fsg.js → ko-7B4SUZB7-2SLI636D-grbtfrcv.js} +424 -36
- package/dist/{ko-XAUYQWDR-zp81gjp4.js → ko-7B4SUZB7-c8wr20sc.js} +190 -10
- package/dist/{ko-DJJRKCG5-5h3k9csc.js → ko-DJJRKCG5-4fekzjn4.js} +1 -4
- package/dist/{ko-LA5OSS5P-mq5h8sbk.js → ko-H2RGQWKJ-9696w762.js} +38 -5
- package/dist/{ko-TLL6Z6CD-wrt3n8a9.js → ko-Q24HSSL4-5vn55pte.js} +20 -5
- package/dist/{ko-B4SEC7QX-thq2wt6a.js → ko-RYKAL74T-10m4z8vw.js} +83 -8
- package/dist/localization-skqjy9nr.js +45 -0
- package/dist/maestro-automate-entry-d1v5q5mv.js +14 -0
- package/dist/{node-xqc0h091.js → node-0jy3qx5b.js} +69 -638
- package/dist/node-service-2nxpk751.js +64 -0
- package/dist/{node-strategy-1dmmhvf3.js → node-strategy-wrjxmbzt.js} +9 -12
- package/dist/node-sync-service-68vq10je.js +56 -0
- package/dist/packager-tool-14rdgz3c.js +55 -0
- package/dist/packager-tool-1rhch6b5.js +496 -0
- package/dist/packager-tool-21t17xzz.js +5073 -0
- package/dist/{packager-tool-pvhx9e12.js → packager-tool-2b0tn4p4.js} +58 -176
- package/dist/{packager-tool-f9jxca9z.js → packager-tool-368bft50.js} +11 -11
- package/dist/{packager-tool-a5afh1dc.js → packager-tool-4fv0sq2h.js} +61 -67
- package/dist/packager-tool-4g87fbz6.js +273 -0
- package/dist/packager-tool-4zt1s51a.js +53 -0
- package/dist/{packager-tool-frjt46rb.js → packager-tool-508ka40b.js} +23 -23
- package/dist/{packager-tool-gbv6f0ac.js → packager-tool-5104bnpv.js} +22 -21
- package/dist/packager-tool-5dgpfh5e.js +1274 -0
- package/dist/packager-tool-5ve5ms3b.js +2393 -0
- package/dist/{packager-tool-dxgrhfq5.js → packager-tool-64r7e4ek.js} +8 -8
- package/dist/{packager-tool-h6pf3qxq.js → packager-tool-65yf8zqb.js} +180 -1237
- package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
- package/dist/{packager-tool-htrt75v4.js → packager-tool-6jpvvxyb.js} +27 -22
- package/dist/packager-tool-6vhefpmq.js +461 -0
- package/dist/{packager-tool-1nfbzy0h.js → packager-tool-72xwbsmw.js} +441 -556
- package/dist/packager-tool-7atc775f.js +30 -0
- package/dist/packager-tool-7mxn3e7j.js +27 -0
- package/dist/{packager-tool-wvmtp8zt.js → packager-tool-7qtnffkc.js} +8 -7
- package/dist/{packager-tool-ymma2s85.js → packager-tool-8ba22j6n.js} +9 -6
- package/dist/{packager-tool-apawc11t.js → packager-tool-8ed52y5r.js} +1584 -1261
- package/dist/{packager-tool-v11fm907.js → packager-tool-8n4bdvke.js} +13 -13
- package/dist/{packager-tool-p8gab24q.js → packager-tool-8qypzm9v.js} +424 -404
- package/dist/packager-tool-9217bxm2.js +6 -0
- package/dist/{packager-tool-zfrp8ecz.js → packager-tool-951nhh3e.js} +82 -82
- package/dist/{packager-tool-ap0zt7de.js → packager-tool-99d2kj94.js} +8 -11
- package/dist/{packager-tool-z21c6mbp.js → packager-tool-a1h0q79w.js} +48 -48
- package/dist/{packager-tool-xk78j7dz.js → packager-tool-ac6rvny7.js} +52 -57
- package/dist/{packager-tool-1d64q5s5.js → packager-tool-b2pkwwj1.js} +1273 -1300
- package/dist/{packager-tool-yetpbbey.js → packager-tool-bbkkxbyq.js} +9 -8
- package/dist/{packager-tool-409n51pv.js → packager-tool-d07g2kpn.js} +7 -7
- package/dist/{packager-tool-8zzmg2f3.js → packager-tool-dx6sjbkd.js} +19 -19
- package/dist/{packager-tool-8g5931fz.js → packager-tool-em4ppegs.js} +36 -43
- package/dist/{packager-tool-zgsvggdr.js → packager-tool-f7rk9xhv.js} +4 -4
- package/dist/{packager-tool-jrnjzs5t.js → packager-tool-fzgfb0jt.js} +32175 -36281
- package/dist/{packager-tool-9rmaeaww.js → packager-tool-gdpw0daf.js} +25211 -11966
- package/dist/packager-tool-hk0fnvz5.js +14 -0
- package/dist/{packager-tool-dbsdy4xx.js → packager-tool-jd3v0bh1.js} +4 -4
- package/dist/{packager-tool-tqjfdpda.js → packager-tool-jmrhzfyj.js} +106 -80
- package/dist/{packager-tool-2px5qqm4.js → packager-tool-kz3t4raw.js} +490 -246
- package/dist/{packager-tool-7bam8cjq.js → packager-tool-mdf7bws6.js} +53255 -27261
- package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
- package/dist/{packager-tool-nkrmjr3a.js → packager-tool-mphfxa9g.js} +125 -125
- package/dist/{packager-tool-kn86394c.js → packager-tool-p123mtfx.js} +66 -692
- package/dist/{packager-tool-t7ahhaer.js → packager-tool-pxq0bwp0.js} +208 -138
- package/dist/{packager-tool-j95w4fj3.js → packager-tool-q0f1dvtd.js} +11 -11
- package/dist/{packager-tool-8qp60s20.js → packager-tool-q2f18crb.js} +3 -3
- package/dist/packager-tool-q2kwk5bf.js +57 -0
- package/dist/{packager-tool-09rvpfjd.js → packager-tool-rxqxza90.js} +192 -183
- package/dist/{packager-tool-3m4ve01f.js → packager-tool-ryds9860.js} +33 -36
- package/dist/{packager-tool-ykbahxma.js → packager-tool-t17t9svg.js} +6 -6
- package/dist/{packager-tool-myhbp761.js → packager-tool-vgrswa8p.js} +53 -8
- package/dist/{packager-tool-7hw344bt.js → packager-tool-xb16e3tz.js} +5 -5
- package/dist/{packager-tool-1frs4sr4.js → packager-tool-yewnsyag.js} +37 -5
- package/dist/packager-tool-zdqbp34f.js +14 -0
- package/dist/{packager-tool-pacrqxv2.js → packager-tool-ze3fnf3s.js} +52 -34
- package/dist/packager-tool.js +12 -32
- package/dist/prepare-uip-ad7mfs8t.js +92 -0
- package/dist/{pt-3KUMINBZ-d0fexmny.js → pt-2RGHDOG4-gwe2ptvg.js} +38 -5
- package/dist/{pt-BR-3LGIH33I-tqbrd89y.js → pt-BR-3LGIH33I-hdf332je.js} +1 -4
- package/dist/{pt-BR-USP2T7GD-pedn77m1.js → pt-BR-BIUJXIPU-2sqzhr8y.js} +20 -5
- package/dist/{pt-BR-6VFBW5QT-hsck9gjj.js → pt-BR-IL3KLBID-m1mvqqzb.js} +83 -8
- package/dist/{pt-BR-WNNZTIMN-6fent688.js → pt-BR-JWHVZE6H-gvkknv49.js} +38 -5
- package/dist/{pt-BR-TKHNHMET-4Z5H4N5G-pzw3328h.js → pt-BR-PHLFHMXZ-JFPKUXIZ-gyb27t6e.js} +425 -37
- package/dist/{pt-BR-GNQNAAZ2-xadharv4.js → pt-BR-PHLFHMXZ-n6de4s7z.js} +191 -11
- package/dist/{pt-RMIAKZB4-t80exmp7.js → pt-MHX6JGAX-xfgvdqwg.js} +20 -5
- package/dist/{pt-ROXU257Y-OWZOS54V-ywap2t39.js → pt-N7ZTJT4W-GVODJMRX-p5b51p0b.js} +424 -36
- package/dist/{pt-TO2DARY2-ftcce1bv.js → pt-N7ZTJT4W-d6c67xcn.js} +190 -10
- package/dist/{pt-PFZXVOQH-qshq0b2m.js → pt-PFZXVOQH-xvcm5b61.js} +1 -4
- package/dist/{pt-WOTPKWPZ-1rxcy8hs.js → pt-VLA5IOHO-8t4pze0h.js} +83 -8
- package/dist/{ro-GHOBYW2S-4zevc9dy.js → ro-3RKJNGJZ-xqj14e3d.js} +20 -5
- package/dist/{ro-KMDT7LYJ-yhpnsdvw.js → ro-53TS7SWG-hnjx1c7b.js} +38 -5
- package/dist/{ro-AN5G62WQ-kcj00jwq.js → ro-AN5G62WQ-fzsv2ymm.js} +1 -4
- package/dist/{ro-AVAWPKOO-6WCG756B-v7pjv1hc.js → ro-FLNXVYJI-ZN43XZKK-2tajkc94.js} +422 -34
- package/dist/{ro-WUYJV6OW-a8d9qy1n.js → ro-FLNXVYJI-ytrwabg2.js} +190 -10
- package/dist/{ro-PB44YXML-zmhhwp5h.js → ro-IRNFX376-mh84zk3n.js} +82 -7
- package/dist/{ru-GSCT4ARZ-FTVCGQTL-gee86v14.js → ru-GSCT4ARZ-FTVCGQTL-v3d4ag31.js} +2 -4
- package/dist/ru-GSCT4ARZ-c2cfq4h1.js +7 -0
- package/dist/{ru-T73OPRTC-4knxw497.js → ru-T73OPRTC-50m7tty9.js} +1 -4
- package/dist/{ru-WBLQ5B2U-wemdzdqd.js → ru-WBLQ5B2U-5qpt0mvh.js} +1 -4
- package/dist/{ru-WBLQ5B2U-8r3c7v6d.js → ru-WBLQ5B2U-bf20yr5y.js} +1 -4
- package/dist/{ru-WBLQ5B2U-kdey8qa4.js → ru-WBLQ5B2U-w2wmp3xb.js} +1 -4
- package/dist/{serialization-BXU6AKAN-vdqyr29x.js → serialization-Z3UYT6BW-y9gb55mp.js} +1638 -761
- package/dist/services/extract-schema/default-schema-document.d.ts +31 -0
- package/dist/services/node-service.d.ts +6 -3
- package/dist/services/node-validators/file-node-connection-validator.d.ts +2 -0
- package/dist/services/node-validators/index.d.ts +1 -0
- package/dist/services/orchestrator-connection-field.d.ts +24 -0
- package/dist/services/packaging-utils.d.ts +2 -2
- package/dist/services/vars-reference-rule.d.ts +4 -3
- package/dist/solution-auth-j8x84n5z.js +11 -0
- package/dist/solution-discovery-vn4q32bf.js +38 -0
- package/dist/{tidy-service-hz61ypyj.js → tidy-service-m33hhtc7.js} +37 -55
- package/dist/tool.js +18 -27
- package/dist/{tr-JMIP7ZSL-G3QYPVT2-gswngwcr.js → tr-7AIZZWZ6-ESAESUPL-77g9b7jb.js} +422 -34
- package/dist/{tr-M3F5A6AU-bb0tg39m.js → tr-7AIZZWZ6-pdzp9n0p.js} +190 -10
- package/dist/{tr-SEC6RGZ4-0ttavjya.js → tr-EJKY7DVQ-rkctqva4.js} +83 -8
- package/dist/{tr-KHOCWWLF-8apf5y44.js → tr-KHOCWWLF-m9t24j5y.js} +1 -4
- package/dist/{tr-SC55DYHY-e4zgcd4t.js → tr-PIQY7JIT-2mkwk0kq.js} +38 -5
- package/dist/{tr-GDTLECMM-kngksm3r.js → tr-PQLUUHPC-qsb7btxn.js} +20 -5
- package/dist/utils/container-ports.d.ts +22 -0
- package/dist/utils/handle-expansion.d.ts +57 -3
- package/dist/utils/workflow-file-format.d.ts +14 -0
- package/dist/validation.js +44 -68
- package/dist/{variable-service-9ex4a93n.js → variable-service-ea1erf93.js} +28 -49
- package/dist/{wait-for-flow-job-b0vj8828.js → wait-for-flow-job-a4xtda36.js} +29 -36
- package/dist/{zh-CN-MX7VIOF2-xznrtchf.js → zh-CN-4FH7E7UL-84y6j2ea.js} +82 -7
- package/dist/{zh-CN-4NI2EGMV-8g027vv3.js → zh-CN-4NI2EGMV-dt0wg0wh.js} +1 -4
- package/dist/{zh-CN-IFFXSEJS-MZQ4HU3Z-ge1ynmtz.js → zh-CN-CN2ARPFS-NIQTWDK2-b5c91fwn.js} +422 -34
- package/dist/{zh-CN-C5G4PC7C-ds9gkptg.js → zh-CN-CN2ARPFS-e0p2qrxf.js} +190 -10
- package/dist/{en-BPJVY3U7-xkpj5xc5.js → zh-CN-NIEVKROA-q4tbbwqz.js} +26 -7
- package/dist/{zh-CN-I5D7WHBD-ge92tbx9.js → zh-CN-OHNTHZRI-b0hjkfqn.js} +20 -5
- package/dist/{zh-TW-53SU6EH4-33x57egq.js → zh-TW-53SU6EH4-w0wz3nwg.js} +1 -4
- package/dist/{zh-TW-5SJ3GZT2-bsg054mw.js → zh-TW-5WQA6QTM-hns69sd4.js} +83 -8
- package/dist/{zh-TW-IYBNYAMG-J7FWTQTK-sx8d4ymg.js → zh-TW-7RUFEVFK-VKVRSVTP-jq2pcmar.js} +421 -33
- package/dist/{zh-TW-62HZIG6O-787kdwex.js → zh-TW-7RUFEVFK-qd7myw31.js} +190 -10
- package/dist/{zh-TW-2AVLM723-288pkc1z.js → zh-TW-E4D3Y6ZR-tn3bmzz5.js} +20 -5
- package/dist/{zh-TW-TN3MPNXL-jcgg2hcs.js → zh-TW-MSQM7YTT-m7r7nwnj.js} +38 -5
- package/package.json +2 -2
- package/dist/authoring-e1k40hyw.js +0 -24
- package/dist/binding-service-0qffbxg7.js +0 -157
- package/dist/de-FGHEJRCI-gn4cf5gh.js +0 -2697
- package/dist/de-MUJPA4EB-209jpeqe.js +0 -173
- package/dist/de-UZI7FJDO-mwvc4cxe.js +0 -200
- package/dist/debug-conversation-trigger-2crr9w4n.js +0 -30
- package/dist/debug-http-client-yqjzsnhw.js +0 -32
- package/dist/debug-service-nra3n02y.js +0 -61
- package/dist/edge-service-y44f2rgd.js +0 -170
- package/dist/en-E454CJNK-ytfw06kj.js +0 -98
- package/dist/en-EJCBA3LK-0wb3b1xy.js +0 -146
- package/dist/en-EJCBA3LK-dtpdghgj.js +0 -146
- package/dist/en-GN2ZGWUE-03z2df4k.js +0 -136
- package/dist/en-LQHKFSEY-vvbe8ve9.js +0 -26
- package/dist/en-M7GQYBV2-5nfmpnfz.js +0 -2018
- package/dist/en-TBNO2WUV-77KTKLDE-4ktf0pqw.js +0 -1942
- package/dist/en-TBNO2WUV-9nan43e5.js +0 -1936
- package/dist/es-4UBUTCQA-m1ytpyx2.js +0 -200
- package/dist/es-7SE7HX2X-qda7whn6.js +0 -173
- package/dist/es-KR3ZSNMP-0cszm2n3.js +0 -2697
- package/dist/es-MX-2MYFZU7X-6v0q5rbn.js +0 -173
- package/dist/es-MX-5RELIXKI-9jhqtddc.js +0 -200
- package/dist/es-MX-XXZJGC4R-b4fbwe9d.js +0 -2697
- package/dist/filter-engine-7ep90g7f.js +0 -11
- package/dist/first-party-service-srxaftkn.js +0 -27
- package/dist/flow-api-sat010z1.js +0 -42
- package/dist/flow-eval-node-target-cwxb4kfe.js +0 -52
- package/dist/flow-eval-run-api-xdygjzfv.js +0 -13
- package/dist/flow-init-service-k7k5vx2z.js +0 -47
- package/dist/flow-io-2qdyj5e0.js +0 -44
- package/dist/flow-validate-service-x2mbk3et.js +0 -70
- package/dist/fr-MDFKNZ4C-qmypp92m.js +0 -173
- package/dist/fr-VBM5WRC2-63z7w4mh.js +0 -200
- package/dist/fr-Y6NPVODW-q5ef3htr.js +0 -2697
- package/dist/index-cg9qhfb1.js +0 -635
- package/dist/index-d090f35d.js +0 -66
- package/dist/index-gxcjq6ns.js +0 -110
- package/dist/index-kmp9fmhb.js +0 -25
- package/dist/index-nsn889vf.js +0 -27
- package/dist/index-sqhbn7ew.js +0 -157
- package/dist/index-wycgq0ff.js +0 -3178
- package/dist/index-y1ym28vg.js +0 -667
- package/dist/index.umd.min-fqefd9kn.js +0 -7814
- package/dist/inline-entity-resolver-c854cqma.js +0 -45
- package/dist/input-reader-n7kzdrev.js +0 -12
- package/dist/ja-43QL7CGO-h6qfxfay.js +0 -200
- package/dist/ja-MDG4BKZQ-gayaca2c.js +0 -38
- package/dist/ja-Q5PXKJ2V-tzf2rvz2.js +0 -2697
- package/dist/ja-UTQEAP34-hvyf683h.js +0 -173
- package/dist/known-types-r51zxb9g.js +0 -19
- package/dist/ko-AXCHW2OK-pkwdcbmx.js +0 -173
- package/dist/ko-AYBDSRZG-am0h0m2r.js +0 -2697
- package/dist/ko-TLL6Z6CD-ag6gjynr.js +0 -200
- package/dist/localization-d6gjmrsw.js +0 -47
- package/dist/maestro-automate-entry-6f9act3w.js +0 -22
- package/dist/node-service-d4xpqs0z.js +0 -92
- package/dist/node-sync-service-76b9e4r5.js +0 -61
- package/dist/packager-tool-0gctz400.js +0 -17
- package/dist/packager-tool-4mna26cc.js +0 -133
- package/dist/packager-tool-4x7tzvv0.js +0 -1176
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-6ejqwbw9.js +0 -26
- package/dist/packager-tool-6z1hsm2h.js +0 -143
- package/dist/packager-tool-7ja1b5hh.js +0 -8809
- package/dist/packager-tool-9era57c0.js +0 -28
- package/dist/packager-tool-9jxzgsxc.js +0 -14
- package/dist/packager-tool-c23zrhj8.js +0 -11
- package/dist/packager-tool-d6qf5qmb.js +0 -49
- package/dist/packager-tool-e3yks66r.js +0 -95
- package/dist/packager-tool-e5hj89zm.js +0 -6
- package/dist/packager-tool-e87tzg4y.js +0 -1937
- package/dist/packager-tool-eypvc2kv.js +0 -23
- package/dist/packager-tool-gbgfwx8f.js +0 -2
- package/dist/packager-tool-hk1gxnth.js +0 -11
- package/dist/packager-tool-hxyjn885.js +0 -24
- package/dist/packager-tool-j78fwwhq.js +0 -16
- package/dist/packager-tool-jgfzfqjm.js +0 -53
- package/dist/packager-tool-jysvpt8p.js +0 -11
- package/dist/packager-tool-m3wkcxf5.js +0 -11
- package/dist/packager-tool-mcaf4ewf.js +0 -46
- package/dist/packager-tool-mgcz986r.js +0 -143
- package/dist/packager-tool-p79yh9ww.js +0 -97
- package/dist/packager-tool-paq9c70w.js +0 -1332
- package/dist/packager-tool-pcvhcn2k.js +0 -2019
- package/dist/packager-tool-qkn0c042.js +0 -1922
- package/dist/packager-tool-qszay16r.js +0 -180
- package/dist/packager-tool-red2crtp.js +0 -5367
- package/dist/packager-tool-rs6jm14d.js +0 -23
- package/dist/packager-tool-s7wb0s9n.js +0 -6297
- package/dist/packager-tool-sc961w0q.js +0 -16
- package/dist/packager-tool-skcjythd.js +0 -22085
- package/dist/packager-tool-t07ev0jj.js +0 -1083
- package/dist/packager-tool-xj0agqpk.js +0 -11
- package/dist/packager-tool-z83pga0z.js +0 -1942
- package/dist/pt-3DIO5QWG-hb763vct.js +0 -173
- package/dist/pt-BR-TKHNHMET-dn6zxk1d.js +0 -2697
- package/dist/pt-BR-USP2T7GD-rppy42ym.js +0 -200
- package/dist/pt-BR-Y6K6XHXK-37a932vp.js +0 -173
- package/dist/pt-RMIAKZB4-67enhx3m.js +0 -200
- package/dist/pt-ROXU257Y-yd80gx6s.js +0 -2697
- package/dist/ro-AVAWPKOO-42m6am1w.js +0 -2697
- package/dist/ro-BWR3ONRR-jmap5ajd.js +0 -173
- package/dist/ro-GHOBYW2S-mhnqsgaa.js +0 -200
- package/dist/ru-GSCT4ARZ-1sa9wbr8.js +0 -10
- package/dist/ru-GSCT4ARZ-jrxwev63.js +0 -10
- package/dist/ru-WBLQ5B2U-dpqvtfwr.js +0 -10
- package/dist/ru-WBLQ5B2U-s4em88p0.js +0 -10
- package/dist/shared-utils-tqnx96mg.js +0 -21
- package/dist/solution-auth-8qz5pw7z.js +0 -14
- package/dist/solution-discovery-6t0z143v.js +0 -44
- package/dist/tr-5IIHSFW5-stsb3dar.js +0 -173
- package/dist/tr-GDTLECMM-k5fhmq13.js +0 -200
- package/dist/tr-JMIP7ZSL-fb67ft9w.js +0 -2696
- package/dist/zh-CN-I5D7WHBD-sr5h0a98.js +0 -200
- package/dist/zh-CN-IFFXSEJS-tke4mzty.js +0 -2697
- package/dist/zh-CN-OUMLDKDS-q3a1rr5c.js +0 -38
- package/dist/zh-CN-R2KU4U5L-q4yhc33t.js +0 -173
- package/dist/zh-TW-2AVLM723-xsmap3gk.js +0 -200
- package/dist/zh-TW-GNKMELBF-r4ay2475.js +0 -173
- package/dist/zh-TW-IYBNYAMG-wcan0qpb.js +0 -2697
- /package/dist/{packager-tool-yc4kw997.js → packager-tool-1qg04b7q.js} +0 -0
- /package/dist/{packager-tool-cqtsj6yh.js → packager-tool-2sazb7th.js} +0 -0
- /package/dist/{packager-tool-s9ff3kk4.js → packager-tool-887wr6jm.js} +0 -0
- /package/dist/{packager-tool-aw9v0raw.js → packager-tool-8c7nddd1.js} +0 -0
- /package/dist/{packager-tool-9cq9atem.js → packager-tool-a9xgmn1q.js} +0 -0
- /package/dist/{packager-tool-4kr6g0zw.js → packager-tool-cvh1a0nm.js} +0 -0
- /package/dist/{packager-tool-27avrkyk.js → packager-tool-k3egwd1m.js} +0 -0
- /package/dist/{packager-tool-qa9gftnj.js → packager-tool-mxgybnmt.js} +0 -0
- /package/dist/{packager-tool-10vc8pq4.js → packager-tool-wr7gn964.js} +0 -0
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
BaseDimensions,
|
|
3
|
+
CommandDimensions,
|
|
4
|
+
GUID_KEY_DIMENSIONS,
|
|
5
|
+
ErrorDimensions,
|
|
6
|
+
SkillsDimensions,
|
|
7
|
+
lowercaseIdDimensionValues,
|
|
8
|
+
projectIdentityProperties,
|
|
9
|
+
PROJECT_IDENTITY_LOOKUP_BUDGET_MS,
|
|
10
|
+
withinProjectIdentityBudget,
|
|
4
11
|
pseudonymize,
|
|
12
|
+
singleton,
|
|
5
13
|
recordSuppliedArgumentValues,
|
|
6
|
-
|
|
14
|
+
releaseSuppliedArgumentValues,
|
|
15
|
+
redactSpanName,
|
|
7
16
|
redactHttpDependencyName,
|
|
17
|
+
redactError,
|
|
8
18
|
redactProperties,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./packager-tool-t7ahhaer.js";
|
|
19
|
+
describeThrownValue,
|
|
20
|
+
catchError2
|
|
21
|
+
} from "./packager-tool-pxq0bwp0.js";
|
|
13
22
|
import {
|
|
14
23
|
getFileSystem
|
|
15
|
-
} from "./packager-tool-
|
|
24
|
+
} from "./packager-tool-vgrswa8p.js";
|
|
16
25
|
import {
|
|
26
|
+
__toESM,
|
|
17
27
|
__commonJS,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./packager-tool-
|
|
28
|
+
__exportCjs,
|
|
29
|
+
__require
|
|
30
|
+
} from "./packager-tool-6an893wm.js";
|
|
21
31
|
|
|
22
32
|
// ../../node_modules/commander/lib/error.js
|
|
23
33
|
var require_error = __commonJS(function(exports) {
|
|
@@ -139,7 +149,7 @@ var require_help = __commonJS(function(exports) {
|
|
|
139
149
|
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
140
150
|
}
|
|
141
151
|
visibleCommands(cmd) {
|
|
142
|
-
const visibleCommands = cmd.commands.filter((
|
|
152
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
143
153
|
const helpCommand = cmd._getHelpCommand();
|
|
144
154
|
if (helpCommand && !helpCommand._hidden) {
|
|
145
155
|
visibleCommands.push(helpCommand);
|
|
@@ -619,8 +629,8 @@ var require_option = __commonJS(function(exports) {
|
|
|
619
629
|
}
|
|
620
630
|
}
|
|
621
631
|
function camelcase(str) {
|
|
622
|
-
return str.split("-").reduce((
|
|
623
|
-
return
|
|
632
|
+
return str.split("-").reduce((str, word) => {
|
|
633
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
624
634
|
});
|
|
625
635
|
}
|
|
626
636
|
function splitOptionFlags(flags) {
|
|
@@ -1191,44 +1201,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1191
1201
|
});
|
|
1192
1202
|
return source;
|
|
1193
1203
|
}
|
|
1194
|
-
_prepareUserArgs(
|
|
1195
|
-
if (
|
|
1204
|
+
_prepareUserArgs(argv2, parseOptions) {
|
|
1205
|
+
if (argv2 !== undefined && !Array.isArray(argv2)) {
|
|
1196
1206
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1197
1207
|
}
|
|
1198
1208
|
parseOptions = parseOptions || {};
|
|
1199
|
-
if (
|
|
1209
|
+
if (argv2 === undefined && parseOptions.from === undefined) {
|
|
1200
1210
|
if (process2.versions?.electron) {
|
|
1201
1211
|
parseOptions.from = "electron";
|
|
1202
1212
|
}
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1213
|
+
const execArgv2 = process2.execArgv ?? [];
|
|
1214
|
+
if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
|
|
1205
1215
|
parseOptions.from = "eval";
|
|
1206
1216
|
}
|
|
1207
1217
|
}
|
|
1208
|
-
if (
|
|
1209
|
-
|
|
1218
|
+
if (argv2 === undefined) {
|
|
1219
|
+
argv2 = process2.argv;
|
|
1210
1220
|
}
|
|
1211
|
-
this.rawArgs =
|
|
1221
|
+
this.rawArgs = argv2.slice();
|
|
1212
1222
|
let userArgs;
|
|
1213
1223
|
switch (parseOptions.from) {
|
|
1214
1224
|
case undefined:
|
|
1215
1225
|
case "node":
|
|
1216
|
-
this._scriptPath =
|
|
1217
|
-
userArgs =
|
|
1226
|
+
this._scriptPath = argv2[1];
|
|
1227
|
+
userArgs = argv2.slice(2);
|
|
1218
1228
|
break;
|
|
1219
1229
|
case "electron":
|
|
1220
1230
|
if (process2.defaultApp) {
|
|
1221
|
-
this._scriptPath =
|
|
1222
|
-
userArgs =
|
|
1231
|
+
this._scriptPath = argv2[1];
|
|
1232
|
+
userArgs = argv2.slice(2);
|
|
1223
1233
|
} else {
|
|
1224
|
-
userArgs =
|
|
1234
|
+
userArgs = argv2.slice(1);
|
|
1225
1235
|
}
|
|
1226
1236
|
break;
|
|
1227
1237
|
case "user":
|
|
1228
|
-
userArgs =
|
|
1238
|
+
userArgs = argv2.slice(0);
|
|
1229
1239
|
break;
|
|
1230
1240
|
case "eval":
|
|
1231
|
-
userArgs =
|
|
1241
|
+
userArgs = argv2.slice(1);
|
|
1232
1242
|
break;
|
|
1233
1243
|
default:
|
|
1234
1244
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
@@ -1751,18 +1761,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1751
1761
|
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1752
1762
|
}
|
|
1753
1763
|
_conflictingOption(option, conflictingOption) {
|
|
1754
|
-
const findBestOptionFromValue = (
|
|
1755
|
-
const optionKey =
|
|
1764
|
+
const findBestOptionFromValue = (option) => {
|
|
1765
|
+
const optionKey = option.attributeName();
|
|
1756
1766
|
const optionValue = this.getOptionValue(optionKey);
|
|
1757
1767
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1758
1768
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1759
1769
|
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1760
1770
|
return negativeOption;
|
|
1761
1771
|
}
|
|
1762
|
-
return positiveOption ||
|
|
1772
|
+
return positiveOption || option;
|
|
1763
1773
|
};
|
|
1764
|
-
const getErrorMessage = (
|
|
1765
|
-
const bestOption = findBestOptionFromValue(
|
|
1774
|
+
const getErrorMessage = (option) => {
|
|
1775
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1766
1776
|
const optionKey = bestOption.attributeName();
|
|
1767
1777
|
const source = this.getOptionValueSource(optionKey);
|
|
1768
1778
|
if (source === "env") {
|
|
@@ -1916,10 +1926,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1916
1926
|
this._name = path.basename(filename, path.extname(filename));
|
|
1917
1927
|
return this;
|
|
1918
1928
|
}
|
|
1919
|
-
executableDir(
|
|
1920
|
-
if (
|
|
1929
|
+
executableDir(path) {
|
|
1930
|
+
if (path === undefined)
|
|
1921
1931
|
return this._executableDir;
|
|
1922
|
-
this._executableDir =
|
|
1932
|
+
this._executableDir = path;
|
|
1923
1933
|
return this;
|
|
1924
1934
|
}
|
|
1925
1935
|
helpInformation(contextOptions) {
|
|
@@ -2016,11 +2026,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2016
2026
|
}
|
|
2017
2027
|
help(contextOptions) {
|
|
2018
2028
|
this.outputHelp(contextOptions);
|
|
2019
|
-
let
|
|
2020
|
-
if (
|
|
2021
|
-
|
|
2029
|
+
let exitCode2 = Number(process2.exitCode ?? 0);
|
|
2030
|
+
if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
2031
|
+
exitCode2 = 1;
|
|
2022
2032
|
}
|
|
2023
|
-
this._exit(
|
|
2033
|
+
this._exit(exitCode2, "commander.help", "(outputHelp)");
|
|
2024
2034
|
}
|
|
2025
2035
|
addHelpText(position, text) {
|
|
2026
2036
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
@@ -2092,25 +2102,62 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2092
2102
|
exports.useColor = useColor;
|
|
2093
2103
|
});
|
|
2094
2104
|
|
|
2095
|
-
//
|
|
2096
|
-
var
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2105
|
+
// ../common/src/error-codes.ts
|
|
2106
|
+
var CLI_ERROR_CODES = [
|
|
2107
|
+
"invalid_argument",
|
|
2108
|
+
"authentication_required",
|
|
2109
|
+
"permission_denied",
|
|
2110
|
+
"local_permission_denied",
|
|
2111
|
+
"not_found",
|
|
2112
|
+
"rate_limited",
|
|
2113
|
+
"network_error",
|
|
2114
|
+
"timeout",
|
|
2115
|
+
"server_error",
|
|
2116
|
+
"method_not_allowed",
|
|
2117
|
+
"not_supported",
|
|
2118
|
+
"configuration_error",
|
|
2119
|
+
"execution_failed",
|
|
2120
|
+
"unknown_error"
|
|
2121
|
+
];
|
|
2122
|
+
var RETRY_HINTS = [
|
|
2123
|
+
"RetryWillNotFix",
|
|
2124
|
+
"RetryLater",
|
|
2125
|
+
"RetryAfter1Second",
|
|
2126
|
+
"RetryAfter10Seconds",
|
|
2127
|
+
"RetryAfter30Seconds",
|
|
2128
|
+
"RetryAfter60Seconds"
|
|
2129
|
+
];
|
|
2130
|
+
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
2131
|
+
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
2132
|
+
function isCliErrorCode(value) {
|
|
2133
|
+
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
2134
|
+
}
|
|
2135
|
+
function isRetryHint(value) {
|
|
2136
|
+
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
2137
|
+
}
|
|
2138
|
+
function carriedErrorCode(error) {
|
|
2139
|
+
if (!error || typeof error !== "object")
|
|
2140
|
+
return;
|
|
2141
|
+
const code = error.errorCode;
|
|
2142
|
+
return isCliErrorCode(code) ? code : undefined;
|
|
2143
|
+
}
|
|
2144
|
+
function carriedRetry(error) {
|
|
2145
|
+
if (!error || typeof error !== "object")
|
|
2146
|
+
return;
|
|
2147
|
+
const retry = error.retry;
|
|
2148
|
+
return isRetryHint(retry) ? retry : undefined;
|
|
2149
|
+
}
|
|
2150
|
+
function defaultRetryForErrorCode(errorCode) {
|
|
2151
|
+
switch (errorCode) {
|
|
2152
|
+
case "network_error":
|
|
2153
|
+
case "rate_limited":
|
|
2154
|
+
case "server_error":
|
|
2155
|
+
case "timeout":
|
|
2156
|
+
return "RetryLater";
|
|
2157
|
+
default:
|
|
2158
|
+
return "RetryWillNotFix";
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2114
2161
|
|
|
2115
2162
|
// ../common/src/error-graph.ts
|
|
2116
2163
|
function* walkErrorGraph(error) {
|
|
@@ -2156,6 +2203,49 @@ function findHttpStatusInGraph(error) {
|
|
|
2156
2203
|
return;
|
|
2157
2204
|
}
|
|
2158
2205
|
|
|
2206
|
+
// ../common/src/http-status.ts
|
|
2207
|
+
function httpStatusOf(error) {
|
|
2208
|
+
if (!error || typeof error !== "object") {
|
|
2209
|
+
return;
|
|
2210
|
+
}
|
|
2211
|
+
if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
|
|
2212
|
+
return error.response.status;
|
|
2213
|
+
}
|
|
2214
|
+
return "status" in error && typeof error.status === "number" ? error.status : undefined;
|
|
2215
|
+
}
|
|
2216
|
+
function classifyHttpStatus(status) {
|
|
2217
|
+
if (status === undefined)
|
|
2218
|
+
return;
|
|
2219
|
+
if (status === 400 || status === 409 || status === 413 || status === 422) {
|
|
2220
|
+
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
2221
|
+
}
|
|
2222
|
+
if (status === 401) {
|
|
2223
|
+
return {
|
|
2224
|
+
errorCode: "authentication_required",
|
|
2225
|
+
retry: "RetryWillNotFix"
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
if (status === 403) {
|
|
2229
|
+
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
2230
|
+
}
|
|
2231
|
+
if (status === 404) {
|
|
2232
|
+
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
2233
|
+
}
|
|
2234
|
+
if (status === 405) {
|
|
2235
|
+
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
2236
|
+
}
|
|
2237
|
+
if (status === 408) {
|
|
2238
|
+
return { errorCode: "timeout", retry: "RetryLater" };
|
|
2239
|
+
}
|
|
2240
|
+
if (status === 429) {
|
|
2241
|
+
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
2242
|
+
}
|
|
2243
|
+
if (status >= 500 && status < 600) {
|
|
2244
|
+
return { errorCode: "server_error", retry: "RetryLater" };
|
|
2245
|
+
}
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2159
2249
|
// ../common/src/local-permission-codes.ts
|
|
2160
2250
|
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
2161
2251
|
"EACCES",
|
|
@@ -2168,6 +2258,8 @@ var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its
|
|
|
2168
2258
|
var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
|
|
2169
2259
|
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
2170
2260
|
var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
|
|
2261
|
+
var CLOUDFLARE_BLOCK_403 = "Forbidden (403) by Cloudflare, in front of the service: the answer is a Cloudflare HTML page, not the service's JSON, so the service did not see the request and did not check the account's roles or the token's scopes. Cloudflare blocks a request when its content matches a firewall rule (text that looks like SQL or script code, for example) or when it comes from a network the firewall does not allow.";
|
|
2262
|
+
var CLOUDFLARE_BLOCK_403_INSTRUCTIONS = "If the request carries text that looks like code, change that text and try again. Otherwise send the time of the request and the Cloudflare Ray ID, when the message gives one, to the owner of the service or UiPath support.";
|
|
2171
2263
|
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
2172
2264
|
var NETWORK_ERROR_CODES = new Set([
|
|
2173
2265
|
"ECONNREFUSED",
|
|
@@ -2259,6 +2351,20 @@ function localPermissionPath(path, message) {
|
|
|
2259
2351
|
return path;
|
|
2260
2352
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
2261
2353
|
}
|
|
2354
|
+
function readHeader(response, name) {
|
|
2355
|
+
const headers = response?.headers;
|
|
2356
|
+
if (!headers || typeof headers !== "object")
|
|
2357
|
+
return;
|
|
2358
|
+
if (typeof headers.get === "function") {
|
|
2359
|
+
const value = headers.get(name);
|
|
2360
|
+
if (value)
|
|
2361
|
+
return value;
|
|
2362
|
+
}
|
|
2363
|
+
const plain = headers;
|
|
2364
|
+
const key = Object.keys(plain).find((k) => k.toLowerCase() === name.toLowerCase());
|
|
2365
|
+
const value = key === undefined ? undefined : plain[key];
|
|
2366
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
2367
|
+
}
|
|
2262
2368
|
function isHtmlDocument(body) {
|
|
2263
2369
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
2264
2370
|
}
|
|
@@ -2275,36 +2381,9 @@ function retryHintForRetryAfter(seconds) {
|
|
|
2275
2381
|
return "RetryAfter60Seconds";
|
|
2276
2382
|
}
|
|
2277
2383
|
function classifyError(status, error) {
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
if (status === 401) {
|
|
2282
|
-
return {
|
|
2283
|
-
errorCode: "authentication_required",
|
|
2284
|
-
retry: "RetryWillNotFix"
|
|
2285
|
-
};
|
|
2286
|
-
}
|
|
2287
|
-
if (status === 403) {
|
|
2288
|
-
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
2289
|
-
}
|
|
2290
|
-
if (status === 404) {
|
|
2291
|
-
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
2292
|
-
}
|
|
2293
|
-
if (status === 405) {
|
|
2294
|
-
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
2295
|
-
}
|
|
2296
|
-
if (status === 413) {
|
|
2297
|
-
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
2298
|
-
}
|
|
2299
|
-
if (status === 408) {
|
|
2300
|
-
return { errorCode: "timeout", retry: "RetryLater" };
|
|
2301
|
-
}
|
|
2302
|
-
if (status === 429) {
|
|
2303
|
-
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
2304
|
-
}
|
|
2305
|
-
if (status !== undefined && status >= 500 && status < 600) {
|
|
2306
|
-
return { errorCode: "server_error", retry: "RetryLater" };
|
|
2307
|
-
}
|
|
2384
|
+
const byStatus = classifyHttpStatus(status);
|
|
2385
|
+
if (byStatus)
|
|
2386
|
+
return byStatus;
|
|
2308
2387
|
if (status === undefined && describePermissionError(error)) {
|
|
2309
2388
|
return {
|
|
2310
2389
|
errorCode: "local_permission_denied",
|
|
@@ -2320,6 +2399,20 @@ function classifyError(status, error) {
|
|
|
2320
2399
|
}
|
|
2321
2400
|
return { errorCode: "unknown_error", retry: "RetryWillNotFix" };
|
|
2322
2401
|
}
|
|
2402
|
+
function withCarriedClass(inferred, error) {
|
|
2403
|
+
const errorCode = carriedErrorCode(error);
|
|
2404
|
+
const retry = carriedRetry(error);
|
|
2405
|
+
if (errorCode === undefined || errorCode === inferred.errorCode) {
|
|
2406
|
+
return {
|
|
2407
|
+
errorCode: inferred.errorCode,
|
|
2408
|
+
retry: retry ?? inferred.retry
|
|
2409
|
+
};
|
|
2410
|
+
}
|
|
2411
|
+
return { errorCode, retry: retry ?? defaultRetryForErrorCode(errorCode) };
|
|
2412
|
+
}
|
|
2413
|
+
function classifyThrownError(error) {
|
|
2414
|
+
return withCarriedClass(classifyError(findHttpStatusInGraph(error), error), error);
|
|
2415
|
+
}
|
|
2323
2416
|
function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus) {
|
|
2324
2417
|
if (extractedMessage) {
|
|
2325
2418
|
return `HTTP ${status}: ${extractedMessage}`;
|
|
@@ -2339,10 +2432,10 @@ async function extractErrorDetails(error, options) {
|
|
|
2339
2432
|
let parsedBody;
|
|
2340
2433
|
const textFn = response?.text?.bind(response);
|
|
2341
2434
|
if (textFn) {
|
|
2342
|
-
const [bodyError, body] = await
|
|
2435
|
+
const [bodyError, body] = await catchError2((async () => textFn())());
|
|
2343
2436
|
if (!bodyError && body) {
|
|
2344
2437
|
rawBody = body;
|
|
2345
|
-
const [parseError, parsed] =
|
|
2438
|
+
const [parseError, parsed] = catchError2(() => JSON.parse(body));
|
|
2346
2439
|
if (!parseError && parsed && typeof parsed === "object") {
|
|
2347
2440
|
parsedBody = parsed;
|
|
2348
2441
|
if (parsedBody.errors && typeof parsedBody.errors === "object") {
|
|
@@ -2375,9 +2468,14 @@ async function extractErrorDetails(error, options) {
|
|
|
2375
2468
|
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
2376
2469
|
const classification = classifyError(classificationStatus, error);
|
|
2377
2470
|
let retry = classification.retry;
|
|
2471
|
+
const htmlForbidden = status === 403 && rawBody !== undefined && isHtmlDocument(rawBody);
|
|
2472
|
+
const rayId = htmlForbidden ? readHeader(response, "cf-ray") : undefined;
|
|
2473
|
+
const cloudflareBlock = htmlForbidden && (rayId !== undefined || /\bcloudflare\b/i.test(readHeader(response, "server") ?? ""));
|
|
2378
2474
|
if (status === 401) {
|
|
2379
2475
|
message = DEFAULT_401;
|
|
2380
2476
|
result = "AuthenticationError";
|
|
2477
|
+
} else if (cloudflareBlock) {
|
|
2478
|
+
message = rayId ? `${CLOUDFLARE_BLOCK_403} Cloudflare Ray ID: ${rayId}.` : CLOUDFLARE_BLOCK_403;
|
|
2381
2479
|
} else if (status === 403) {
|
|
2382
2480
|
message = options?.forbiddenMessage ?? DEFAULT_403;
|
|
2383
2481
|
result = "AuthenticationError";
|
|
@@ -2425,7 +2523,9 @@ async function extractErrorDetails(error, options) {
|
|
|
2425
2523
|
}
|
|
2426
2524
|
}
|
|
2427
2525
|
let details = rawMessage;
|
|
2428
|
-
if (
|
|
2526
|
+
if (htmlForbidden) {
|
|
2527
|
+
details = cloudflareBlock ? CLOUDFLARE_BLOCK_403_INSTRUCTIONS : HTML_RESPONSE_MESSAGE;
|
|
2528
|
+
} else if (rawBody) {
|
|
2429
2529
|
if (parsedBody) {
|
|
2430
2530
|
const extra = {};
|
|
2431
2531
|
if (parsedBody.errorCode)
|
|
@@ -2459,6 +2559,8 @@ async function extractErrorDetails(error, options) {
|
|
|
2459
2559
|
}
|
|
2460
2560
|
if (parsedBody?.requestId && typeof parsedBody.requestId === "string") {
|
|
2461
2561
|
context.requestId = parsedBody.requestId;
|
|
2562
|
+
} else if (cloudflareBlock && rayId) {
|
|
2563
|
+
context.requestId = rayId;
|
|
2462
2564
|
}
|
|
2463
2565
|
if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
|
|
2464
2566
|
context.traceId = parsedBody.traceId;
|
|
@@ -2467,16 +2569,7 @@ async function extractErrorDetails(error, options) {
|
|
|
2467
2569
|
context.path = permission.path;
|
|
2468
2570
|
}
|
|
2469
2571
|
if (status === 429) {
|
|
2470
|
-
const
|
|
2471
|
-
const headersObj = resp?.headers;
|
|
2472
|
-
let retryAfterValue;
|
|
2473
|
-
if (headersObj && typeof headersObj === "object" && typeof headersObj.get === "function") {
|
|
2474
|
-
retryAfterValue = headersObj.get("retry-after") ?? undefined;
|
|
2475
|
-
}
|
|
2476
|
-
if (!retryAfterValue && headersObj && typeof headersObj === "object") {
|
|
2477
|
-
const headers = headersObj;
|
|
2478
|
-
retryAfterValue = headers["retry-after"] ?? headers["Retry-After"];
|
|
2479
|
-
}
|
|
2572
|
+
const retryAfterValue = readHeader(response, "retry-after");
|
|
2480
2573
|
if (retryAfterValue) {
|
|
2481
2574
|
const seconds = Number(retryAfterValue);
|
|
2482
2575
|
if (!Number.isNaN(seconds)) {
|
|
@@ -2510,9 +2603,8 @@ async function extractErrorDetails(error, options) {
|
|
|
2510
2603
|
}
|
|
2511
2604
|
return {
|
|
2512
2605
|
result,
|
|
2513
|
-
errorCode: classification.errorCode,
|
|
2606
|
+
...withCarriedClass({ errorCode: classification.errorCode, retry }, error),
|
|
2514
2607
|
message,
|
|
2515
|
-
retry,
|
|
2516
2608
|
details,
|
|
2517
2609
|
...hasContext ? { context } : {},
|
|
2518
2610
|
...parsedErrors ? { parsedErrors } : {}
|
|
@@ -2537,9 +2629,78 @@ function extractErrorMessageSync(error) {
|
|
|
2537
2629
|
return describeThrownValue(error);
|
|
2538
2630
|
}
|
|
2539
2631
|
|
|
2632
|
+
// ../common/src/result-types.ts
|
|
2633
|
+
var RESULTS = {
|
|
2634
|
+
Success: "Success",
|
|
2635
|
+
Failure: "Failure",
|
|
2636
|
+
ConfigError: "ConfigError",
|
|
2637
|
+
AuthenticationError: "AuthenticationError",
|
|
2638
|
+
ValidationError: "ValidationError",
|
|
2639
|
+
TimeoutError: "TimeoutError"
|
|
2640
|
+
};
|
|
2641
|
+
|
|
2642
|
+
// ../../node_modules/commander/index.js
|
|
2643
|
+
var exports_commander = {};
|
|
2644
|
+
__exportCjs(exports_commander, {
|
|
2645
|
+
program: () => $program,
|
|
2646
|
+
createCommand: () => $createCommand,
|
|
2647
|
+
createOption: () => $createOption,
|
|
2648
|
+
createArgument: () => $createArgument,
|
|
2649
|
+
Command: () => $Command,
|
|
2650
|
+
Option: () => $Option,
|
|
2651
|
+
Argument: () => $Argument,
|
|
2652
|
+
Help: () => $Help,
|
|
2653
|
+
CommanderError: () => $CommanderError,
|
|
2654
|
+
InvalidArgumentError: () => $InvalidArgumentError,
|
|
2655
|
+
InvalidOptionArgumentError: () => $InvalidOptionArgumentError
|
|
2656
|
+
}, {
|
|
2657
|
+
program: (value) => $program = value,
|
|
2658
|
+
createCommand: (value) => $createCommand = value,
|
|
2659
|
+
createOption: (value) => $createOption = value,
|
|
2660
|
+
createArgument: (value) => $createArgument = value,
|
|
2661
|
+
Command: (value) => $Command = value,
|
|
2662
|
+
Option: (value) => $Option = value,
|
|
2663
|
+
Argument: (value) => $Argument = value,
|
|
2664
|
+
Help: (value) => $Help = value,
|
|
2665
|
+
CommanderError: (value) => $CommanderError = value,
|
|
2666
|
+
InvalidArgumentError: (value) => $InvalidArgumentError = value,
|
|
2667
|
+
InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
|
|
2668
|
+
});
|
|
2669
|
+
var { Argument } = require_argument();
|
|
2670
|
+
var { Command: Command2 } = require_command();
|
|
2671
|
+
var { CommanderError, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
2672
|
+
var { Help } = require_help();
|
|
2673
|
+
var { Option: Option2 } = require_option();
|
|
2674
|
+
var $program = new Command2;
|
|
2675
|
+
var $createCommand = (name) => new Command2(name);
|
|
2676
|
+
var $createOption = (flags, description) => new Option2(flags, description);
|
|
2677
|
+
var $createArgument = (name, description) => new Argument(name, description);
|
|
2678
|
+
var $Command = Command2;
|
|
2679
|
+
var $Option = Option2;
|
|
2680
|
+
var $Argument = Argument;
|
|
2681
|
+
var $Help = Help;
|
|
2682
|
+
var $CommanderError = CommanderError;
|
|
2683
|
+
var $InvalidArgumentError = InvalidArgumentError2;
|
|
2684
|
+
var $InvalidOptionArgumentError = InvalidArgumentError2;
|
|
2685
|
+
|
|
2686
|
+
// ../../node_modules/commander/esm.mjs
|
|
2687
|
+
var {
|
|
2688
|
+
program,
|
|
2689
|
+
createCommand,
|
|
2690
|
+
createArgument,
|
|
2691
|
+
createOption,
|
|
2692
|
+
CommanderError: CommanderError2,
|
|
2693
|
+
InvalidArgumentError,
|
|
2694
|
+
InvalidOptionArgumentError,
|
|
2695
|
+
Command,
|
|
2696
|
+
Argument: Argument2,
|
|
2697
|
+
Option,
|
|
2698
|
+
Help: Help2
|
|
2699
|
+
} = exports_commander;
|
|
2700
|
+
|
|
2540
2701
|
// ../common/src/output-context.ts
|
|
2541
2702
|
function createStorage() {
|
|
2542
|
-
const [error, mod] =
|
|
2703
|
+
const [error, mod] = catchError2(() => __require("node:async_hooks"));
|
|
2543
2704
|
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
2544
2705
|
return {
|
|
2545
2706
|
getStore: () => {
|
|
@@ -2608,7 +2769,7 @@ class SimpleLogger {
|
|
|
2608
2769
|
}
|
|
2609
2770
|
return DEFAULT_LOG_LEVEL;
|
|
2610
2771
|
}
|
|
2611
|
-
const [localStorageError, hasDebug] =
|
|
2772
|
+
const [localStorageError, hasDebug] = catchError2(() => typeof localStorage !== "undefined" && !!localStorage.getItem("debug"));
|
|
2612
2773
|
if (!localStorageError && hasDebug) {
|
|
2613
2774
|
return 0 /* DEBUG */;
|
|
2614
2775
|
}
|
|
@@ -2704,7 +2865,7 @@ class SimpleLogger {
|
|
|
2704
2865
|
this.fileLoggingEnabled = true;
|
|
2705
2866
|
const fs = getFileSystem();
|
|
2706
2867
|
this.pendingInit = (async () => {
|
|
2707
|
-
const [error] = await
|
|
2868
|
+
const [error] = await catchError2((async () => {
|
|
2708
2869
|
await fs.mkdir(fs.path.dirname(path));
|
|
2709
2870
|
await fs.writeFile(path, "");
|
|
2710
2871
|
})());
|
|
@@ -2754,702 +2915,377 @@ function getLogFilePath() {
|
|
|
2754
2915
|
return logger.getLogFilePath();
|
|
2755
2916
|
}
|
|
2756
2917
|
|
|
2757
|
-
// ../common/src/
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2918
|
+
// ../common/src/timings.ts
|
|
2919
|
+
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
2920
|
+
function createStorage2() {
|
|
2921
|
+
const [error, mod] = catchError2(() => __require("node:async_hooks"));
|
|
2922
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
2923
|
+
return {
|
|
2924
|
+
getStore: () => {
|
|
2925
|
+
return;
|
|
2926
|
+
},
|
|
2927
|
+
run: (_store, fn) => fn()
|
|
2928
|
+
};
|
|
2764
2929
|
}
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2930
|
+
return new mod.AsyncLocalStorage;
|
|
2931
|
+
}
|
|
2932
|
+
var storageSlot = singleton("TimingStorage");
|
|
2933
|
+
var stateSlot = singleton("Timings");
|
|
2934
|
+
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
2935
|
+
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
2936
|
+
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
2937
|
+
function newState(baseline) {
|
|
2938
|
+
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
2939
|
+
}
|
|
2940
|
+
function getState() {
|
|
2941
|
+
const scoped = storage.getStore();
|
|
2942
|
+
if (scoped) {
|
|
2943
|
+
return scoped;
|
|
2771
2944
|
}
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
durationMs,
|
|
2776
|
-
success
|
|
2777
|
-
}) {
|
|
2778
|
-
logger.debug(`[Telemetry] Dependency: ${name} [${type}] (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
2945
|
+
const pinned = livePinnedState();
|
|
2946
|
+
if (pinned !== undefined) {
|
|
2947
|
+
return pinned;
|
|
2779
2948
|
}
|
|
2949
|
+
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
2780
2950
|
}
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2951
|
+
function livePinnedState() {
|
|
2952
|
+
const pinned = stateSlot.get();
|
|
2953
|
+
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
2954
|
+
}
|
|
2955
|
+
function processStartIsInvocationStart() {
|
|
2956
|
+
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
2957
|
+
}
|
|
2958
|
+
function timingsEnabled() {
|
|
2959
|
+
if (typeof process === "undefined") {
|
|
2960
|
+
return false;
|
|
2789
2961
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2962
|
+
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
2963
|
+
if (value === undefined) {
|
|
2964
|
+
return false;
|
|
2792
2965
|
}
|
|
2966
|
+
const normalized = value.trim().toLowerCase();
|
|
2967
|
+
return normalized === "1" || normalized === "true";
|
|
2793
2968
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
var KNOWN_AGENTS = [
|
|
2797
|
-
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
2798
|
-
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
2799
|
-
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
2800
|
-
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
2801
|
-
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
2802
|
-
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
2803
|
-
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
2804
|
-
];
|
|
2805
|
-
function detectAgentFromEnv(env) {
|
|
2806
|
-
for (const agent of KNOWN_AGENTS) {
|
|
2807
|
-
const envValue = env[agent.envVar];
|
|
2808
|
-
if (agent.value !== undefined) {
|
|
2809
|
-
if (envValue === agent.value)
|
|
2810
|
-
return agent.id;
|
|
2811
|
-
} else {
|
|
2812
|
-
if (envValue)
|
|
2813
|
-
return agent.id;
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
const agentEnv = env.AGENT;
|
|
2817
|
-
if (agentEnv) {
|
|
2818
|
-
if (agentEnv === "1" || agentEnv === "true")
|
|
2819
|
-
return "unknown";
|
|
2820
|
-
if (agentEnv.length <= 32)
|
|
2821
|
-
return agentEnv.toLowerCase();
|
|
2822
|
-
}
|
|
2823
|
-
return;
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
2827
|
-
var BaseDimensions = {
|
|
2828
|
-
ApplicationName: "ApplicationName",
|
|
2829
|
-
ProductVersion: "ProductVersion",
|
|
2830
|
-
InstallationId: "InstallationId",
|
|
2831
|
-
CloudUserId: "CloudUserId",
|
|
2832
|
-
CloudTenantId: "CloudTenantId",
|
|
2833
|
-
CloudOrganizationId: "CloudOrganizationId",
|
|
2834
|
-
IsInternalUser: "IsInternalUser",
|
|
2835
|
-
Environment: "Environment",
|
|
2836
|
-
BaseUrl: "BaseUrl",
|
|
2837
|
-
Region: "Region",
|
|
2838
|
-
Agent: "Agent",
|
|
2839
|
-
AgentVersion: "AgentVersion",
|
|
2840
|
-
AgentModel: "AgentModel",
|
|
2841
|
-
ToolName: "ToolName",
|
|
2842
|
-
ToolVersion: "ToolVersion",
|
|
2843
|
-
ExecutionContext: "ExecutionContext",
|
|
2844
|
-
CiProvider: "CiProvider",
|
|
2845
|
-
SessionIdSource: "SessionIdSource",
|
|
2846
|
-
SessionId: "SessionId"
|
|
2847
|
-
};
|
|
2848
|
-
var CommandDimensions = {
|
|
2849
|
-
IsCommand: "IsCommand",
|
|
2850
|
-
IsReexec: "IsReexec",
|
|
2851
|
-
CommandName: "CommandName",
|
|
2852
|
-
ExitCode: "ExitCode",
|
|
2853
|
-
TerminalOutcome: "TerminalOutcome",
|
|
2854
|
-
ErrorClass: "ErrorClass",
|
|
2855
|
-
TerminalSignal: "TerminalSignal",
|
|
2856
|
-
ErrorMessage: "ErrorMessage",
|
|
2857
|
-
SkillName: "SkillName",
|
|
2858
|
-
ProductArea: "ProductArea",
|
|
2859
|
-
Mode: "Mode"
|
|
2860
|
-
};
|
|
2861
|
-
var ShipDimensions = {
|
|
2862
|
-
ShipKind: "ShipKind",
|
|
2863
|
-
Target: "Target",
|
|
2864
|
-
ProjectType: "ProjectType",
|
|
2865
|
-
ProjectTypes: "ProjectTypes",
|
|
2866
|
-
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
2867
|
-
PackageName: "PackageName",
|
|
2868
|
-
PackageVersion: "PackageVersion",
|
|
2869
|
-
PackageVersionKey: "PackageVersionKey",
|
|
2870
|
-
DeploymentKey: "DeploymentKey",
|
|
2871
|
-
SolutionId: "SolutionId",
|
|
2872
|
-
FolderKey: "FolderKey",
|
|
2873
|
-
FeedId: "FeedId"
|
|
2874
|
-
};
|
|
2875
|
-
var ErrorDimensions = {
|
|
2876
|
-
Result: "Result",
|
|
2877
|
-
ErrorCode: "ErrorCode",
|
|
2878
|
-
Retry: "Retry",
|
|
2879
|
-
ErrorMessage: "ErrorMessage",
|
|
2880
|
-
HttpStatus: "HttpStatus",
|
|
2881
|
-
UpstreamErrorCode: "UpstreamErrorCode"
|
|
2882
|
-
};
|
|
2883
|
-
var AuthDimensions = {
|
|
2884
|
-
AuthenticationMethod: "AuthenticationMethod",
|
|
2885
|
-
Success: "Success",
|
|
2886
|
-
Reason: "Reason"
|
|
2887
|
-
};
|
|
2888
|
-
var SkillsDimensions = {
|
|
2889
|
-
SchemaVersion: "SchemaVersion",
|
|
2890
|
-
AgentType: "AgentType",
|
|
2891
|
-
SkillsVersion: "SkillsVersion",
|
|
2892
|
-
UipSubcommand: "UipSubcommand",
|
|
2893
|
-
FileExtension: "FileExtension",
|
|
2894
|
-
SubagentModel: "SubagentModel",
|
|
2895
|
-
SubagentType: "SubagentType",
|
|
2896
|
-
PermissionMode: "PermissionMode",
|
|
2897
|
-
EffortLevel: "EffortLevel",
|
|
2898
|
-
SessionSource: "SessionSource",
|
|
2899
|
-
Outcome: "Outcome",
|
|
2900
|
-
DurationMs: "DurationMs",
|
|
2901
|
-
Source: "Source"
|
|
2902
|
-
};
|
|
2903
|
-
var PackagerDimensions = {
|
|
2904
|
-
ProjectId: "ProjectId",
|
|
2905
|
-
ProjectType: "ProjectType",
|
|
2906
|
-
SolutionId: "SolutionId"
|
|
2907
|
-
};
|
|
2908
|
-
var ScopeDimensions = {
|
|
2909
|
-
FolderId: "FolderId"
|
|
2910
|
-
};
|
|
2911
|
-
var ID_DIMENSIONS = new Set([
|
|
2912
|
-
BaseDimensions.CloudUserId,
|
|
2913
|
-
BaseDimensions.CloudTenantId,
|
|
2914
|
-
BaseDimensions.CloudOrganizationId,
|
|
2915
|
-
BaseDimensions.InstallationId,
|
|
2916
|
-
ShipDimensions.ArtifactCorrelationKey,
|
|
2917
|
-
ShipDimensions.PackageVersionKey,
|
|
2918
|
-
ShipDimensions.DeploymentKey,
|
|
2919
|
-
ShipDimensions.SolutionId,
|
|
2920
|
-
ShipDimensions.FolderKey,
|
|
2921
|
-
ShipDimensions.FeedId,
|
|
2922
|
-
PackagerDimensions.ProjectId
|
|
2923
|
-
]);
|
|
2924
|
-
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
2925
|
-
var RESERVED_DIMENSION_NAMES = new Set([
|
|
2926
|
-
...Object.values(BaseDimensions),
|
|
2927
|
-
...Object.values(CommandDimensions),
|
|
2928
|
-
...Object.values(ShipDimensions),
|
|
2929
|
-
...Object.values(ErrorDimensions),
|
|
2930
|
-
...Object.values(AuthDimensions),
|
|
2931
|
-
...Object.values(SkillsDimensions),
|
|
2932
|
-
...Object.values(PackagerDimensions),
|
|
2933
|
-
...Object.values(ScopeDimensions)
|
|
2934
|
-
]);
|
|
2935
|
-
var CURATED_DIMENSIONS = new Set([
|
|
2936
|
-
BaseDimensions.ApplicationName,
|
|
2937
|
-
BaseDimensions.ProductVersion,
|
|
2938
|
-
BaseDimensions.InstallationId,
|
|
2939
|
-
BaseDimensions.CloudUserId,
|
|
2940
|
-
BaseDimensions.CloudTenantId,
|
|
2941
|
-
BaseDimensions.CloudOrganizationId,
|
|
2942
|
-
BaseDimensions.IsInternalUser,
|
|
2943
|
-
BaseDimensions.Environment,
|
|
2944
|
-
BaseDimensions.BaseUrl,
|
|
2945
|
-
BaseDimensions.Region,
|
|
2946
|
-
BaseDimensions.Agent,
|
|
2947
|
-
BaseDimensions.AgentVersion,
|
|
2948
|
-
BaseDimensions.ToolVersion,
|
|
2949
|
-
BaseDimensions.ExecutionContext,
|
|
2950
|
-
BaseDimensions.CiProvider,
|
|
2951
|
-
BaseDimensions.SessionIdSource,
|
|
2952
|
-
BaseDimensions.SessionId,
|
|
2953
|
-
...Object.values(CommandDimensions),
|
|
2954
|
-
...Object.values(ShipDimensions)
|
|
2955
|
-
]);
|
|
2956
|
-
function lowercaseIdDimensionValues(properties) {
|
|
2957
|
-
let changed = false;
|
|
2958
|
-
const result = {
|
|
2959
|
-
...properties
|
|
2960
|
-
};
|
|
2961
|
-
for (const key of Object.keys(result)) {
|
|
2962
|
-
const value = result[key];
|
|
2963
|
-
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
2964
|
-
continue;
|
|
2965
|
-
}
|
|
2966
|
-
const lowered = value.toLowerCase();
|
|
2967
|
-
if (lowered !== value) {
|
|
2968
|
-
result[key] = lowered;
|
|
2969
|
-
changed = true;
|
|
2970
|
-
}
|
|
2971
|
-
}
|
|
2972
|
-
return changed ? result : properties;
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
// ../common/src/telemetry/execution-context.ts
|
|
2976
|
-
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
2977
|
-
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
2978
|
-
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
2979
|
-
var CI_SIGNATURES = [
|
|
2980
|
-
{
|
|
2981
|
-
provider: "github_actions",
|
|
2982
|
-
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
2983
|
-
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
2984
|
-
},
|
|
2985
|
-
{
|
|
2986
|
-
provider: "azure_devops",
|
|
2987
|
-
matches: (env) => isTruthy(env.TF_BUILD),
|
|
2988
|
-
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
2989
|
-
},
|
|
2990
|
-
{
|
|
2991
|
-
provider: "gitlab",
|
|
2992
|
-
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
2993
|
-
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
2994
|
-
},
|
|
2995
|
-
{
|
|
2996
|
-
provider: "circleci",
|
|
2997
|
-
matches: (env) => isTruthy(env.CIRCLECI),
|
|
2998
|
-
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
2999
|
-
},
|
|
3000
|
-
{
|
|
3001
|
-
provider: "jenkins",
|
|
3002
|
-
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
3003
|
-
},
|
|
3004
|
-
{
|
|
3005
|
-
provider: "teamcity",
|
|
3006
|
-
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
3007
|
-
},
|
|
3008
|
-
{
|
|
3009
|
-
provider: "buildkite",
|
|
3010
|
-
matches: (env) => isTruthy(env.BUILDKITE),
|
|
3011
|
-
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
3012
|
-
},
|
|
3013
|
-
{
|
|
3014
|
-
provider: "bitbucket",
|
|
3015
|
-
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
3016
|
-
},
|
|
3017
|
-
{
|
|
3018
|
-
provider: "travis",
|
|
3019
|
-
matches: (env) => isTruthy(env.TRAVIS)
|
|
3020
|
-
},
|
|
3021
|
-
{
|
|
3022
|
-
provider: "appveyor",
|
|
3023
|
-
matches: (env) => isTruthy(env.APPVEYOR)
|
|
3024
|
-
},
|
|
3025
|
-
{
|
|
3026
|
-
provider: "generic",
|
|
3027
|
-
matches: (env) => isTruthy(env.CI)
|
|
3028
|
-
}
|
|
3029
|
-
];
|
|
3030
|
-
function currentEnv() {
|
|
3031
|
-
return typeof process === "undefined" ? {} : process.env;
|
|
3032
|
-
}
|
|
3033
|
-
function currentTtyState() {
|
|
3034
|
-
if (typeof process === "undefined")
|
|
3035
|
-
return false;
|
|
3036
|
-
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
3037
|
-
}
|
|
3038
|
-
function detectCi(env) {
|
|
3039
|
-
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
3040
|
-
if (!signature)
|
|
2969
|
+
function recordExitCode(exitCode) {
|
|
2970
|
+
if (!timingsEnabled()) {
|
|
3041
2971
|
return;
|
|
3042
|
-
return {
|
|
3043
|
-
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
3044
|
-
ciProvider: signature.provider
|
|
3045
|
-
};
|
|
3046
|
-
}
|
|
3047
|
-
function detectExecutionContext(options = {}) {
|
|
3048
|
-
const env = options.env ?? currentEnv();
|
|
3049
|
-
const ci = detectCi(env);
|
|
3050
|
-
if (ci)
|
|
3051
|
-
return ci;
|
|
3052
|
-
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
3053
|
-
if (agent) {
|
|
3054
|
-
return { executionContext: "agent" };
|
|
3055
|
-
}
|
|
3056
|
-
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
3057
|
-
if (authSignal === "service_account") {
|
|
3058
|
-
return { executionContext: "service_account" };
|
|
3059
|
-
}
|
|
3060
|
-
const isTty = options.isTty ?? currentTtyState();
|
|
3061
|
-
if (isTty) {
|
|
3062
|
-
return { executionContext: "manual" };
|
|
3063
2972
|
}
|
|
3064
|
-
|
|
3065
|
-
}
|
|
3066
|
-
function getExecutionContextTelemetryProperties() {
|
|
3067
|
-
const detected = detectExecutionContext();
|
|
3068
|
-
return {
|
|
3069
|
-
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
3070
|
-
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3071
|
-
};
|
|
2973
|
+
getState().exitCode = exitCode;
|
|
3072
2974
|
}
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
3076
|
-
function getGlobalTelemetryProperties() {
|
|
3077
|
-
return telemetryPropsSlot.get();
|
|
2975
|
+
function invocationStartedAt() {
|
|
2976
|
+
return new Date(performance.timeOrigin + getState().baseline);
|
|
3078
2977
|
}
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
3082
|
-
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
3083
|
-
function getProcessEnv() {
|
|
3084
|
-
return globalThis.process?.env;
|
|
2978
|
+
function invocationElapsedMs() {
|
|
2979
|
+
return performance.now() - getState().baseline;
|
|
3085
2980
|
}
|
|
3086
|
-
function
|
|
3087
|
-
if (!
|
|
3088
|
-
return;
|
|
3089
|
-
}
|
|
3090
|
-
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
3091
|
-
if (!match) {
|
|
2981
|
+
function markCommandStart() {
|
|
2982
|
+
if (!timingsEnabled()) {
|
|
3092
2983
|
return;
|
|
3093
2984
|
}
|
|
3094
|
-
|
|
3095
|
-
|
|
2985
|
+
getState().commandStart = performance.now();
|
|
2986
|
+
}
|
|
2987
|
+
function recordCommandDuration(durationMs) {
|
|
2988
|
+
if (!timingsEnabled()) {
|
|
3096
2989
|
return;
|
|
3097
2990
|
}
|
|
3098
|
-
|
|
3099
|
-
}
|
|
3100
|
-
function getInboundTraceContext() {
|
|
3101
|
-
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
2991
|
+
getState().commandMs = durationMs;
|
|
3102
2992
|
}
|
|
3103
2993
|
|
|
3104
|
-
// ../common/src/
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
3109
|
-
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
3110
|
-
var INHERITED_SESSION_SOURCES = [
|
|
3111
|
-
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
3112
|
-
{ envVar: "CODEX_THREAD_ID", source: "codex" },
|
|
3113
|
-
{ envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
|
|
3114
|
-
{ envVar: "TERM_SESSION_ID", source: "terminal" },
|
|
3115
|
-
{ envVar: "WT_SESSION", source: "terminal" }
|
|
3116
|
-
];
|
|
3117
|
-
var telemetrySessionSlot = singleton("TelemetrySession");
|
|
3118
|
-
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
3119
|
-
function getProcessEnv2() {
|
|
3120
|
-
return globalThis.process?.env;
|
|
2994
|
+
// ../common/src/exit-code.ts
|
|
2995
|
+
function setExitCode(code) {
|
|
2996
|
+
process.exitCode = code;
|
|
2997
|
+
recordExitCode(code);
|
|
3121
2998
|
}
|
|
3122
|
-
|
|
3123
|
-
|
|
2999
|
+
var GENERIC_FAILURE_EXIT_CODE = 1;
|
|
3000
|
+
function recordCommandExit(code) {
|
|
3001
|
+
if (code === GENERIC_FAILURE_EXIT_CODE && getExitCode() !== 0) {
|
|
3124
3002
|
return;
|
|
3125
3003
|
}
|
|
3126
|
-
|
|
3127
|
-
return cleaned || undefined;
|
|
3004
|
+
setExitCode(code);
|
|
3128
3005
|
}
|
|
3129
|
-
function
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
function getInheritedSession(env) {
|
|
3133
|
-
for (const candidate of INHERITED_SESSION_SOURCES) {
|
|
3134
|
-
const handle = normalizeSessionId(env[candidate.envVar]);
|
|
3135
|
-
if (handle) {
|
|
3136
|
-
return { id: handle, source: candidate.source };
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
return;
|
|
3006
|
+
function getExitCode() {
|
|
3007
|
+
const code = process.exitCode;
|
|
3008
|
+
return typeof code === "number" ? code : 0;
|
|
3140
3009
|
}
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3010
|
+
|
|
3011
|
+
// ../common/src/output-codecs.ts
|
|
3012
|
+
var yamlSlot = singleton("YamlCodec");
|
|
3013
|
+
var jmespathSlot = singleton("JmespathCodec");
|
|
3014
|
+
async function loadOutputCodecsAsync(needed) {
|
|
3015
|
+
const loads = [];
|
|
3016
|
+
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
3017
|
+
loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
|
|
3018
|
+
yamlSlot.set(mod);
|
|
3019
|
+
}));
|
|
3147
3020
|
}
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
if (existing) {
|
|
3153
|
-
return existing;
|
|
3021
|
+
if (needed.filter && jmespathSlot.get() === undefined) {
|
|
3022
|
+
loads.push(import("./jmespath-wwym30dp.js").then((m)=>__toESM(m.default,1)).then((mod) => {
|
|
3023
|
+
jmespathSlot.set(mod);
|
|
3024
|
+
}));
|
|
3154
3025
|
}
|
|
3155
|
-
|
|
3156
|
-
const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
|
|
3157
|
-
telemetrySessionSlot.set(resolved);
|
|
3158
|
-
return resolved;
|
|
3159
|
-
}
|
|
3160
|
-
function getTelemetrySessionId() {
|
|
3161
|
-
return resolveTelemetrySession().id;
|
|
3026
|
+
await Promise.all(loads);
|
|
3162
3027
|
}
|
|
3163
|
-
function
|
|
3164
|
-
return
|
|
3028
|
+
function getYamlCodec() {
|
|
3029
|
+
return yamlSlot.get();
|
|
3165
3030
|
}
|
|
3166
|
-
function
|
|
3167
|
-
|
|
3168
|
-
if (existing) {
|
|
3169
|
-
return existing;
|
|
3170
|
-
}
|
|
3171
|
-
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
3172
|
-
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
3173
|
-
telemetryOperationIdSlot.set(generated);
|
|
3174
|
-
return generated;
|
|
3031
|
+
function getJmespathCodec() {
|
|
3032
|
+
return jmespathSlot.get();
|
|
3175
3033
|
}
|
|
3176
3034
|
|
|
3177
|
-
// ../common/src/
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3035
|
+
// ../common/src/output-format-context.ts
|
|
3036
|
+
var formatSlot = singleton("OutputFormat");
|
|
3037
|
+
var formatExplicitSlot = singleton("OutputFormatExplicit");
|
|
3038
|
+
var helpRequestedSlot = singleton("HelpRequested");
|
|
3039
|
+
var filterSlot = singleton("OutputFilter");
|
|
3040
|
+
function getOutputFormat() {
|
|
3041
|
+
return formatSlot.get("json");
|
|
3042
|
+
}
|
|
3043
|
+
function getOutputFilter() {
|
|
3044
|
+
return filterSlot.get();
|
|
3184
3045
|
}
|
|
3185
3046
|
|
|
3186
|
-
// ../common/src/telemetry/
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3047
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
3048
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
3049
|
+
var AUTH_ERROR_CODES = new Set([
|
|
3050
|
+
"authentication_required",
|
|
3051
|
+
"permission_denied"
|
|
3052
|
+
]);
|
|
3053
|
+
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
3054
|
+
"local_permission_denied"
|
|
3055
|
+
]);
|
|
3056
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
3057
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
3058
|
+
"network_error",
|
|
3059
|
+
"rate_limited",
|
|
3060
|
+
"server_error",
|
|
3061
|
+
"not_found",
|
|
3062
|
+
"method_not_allowed"
|
|
3063
|
+
]);
|
|
3064
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
3065
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
3066
|
+
"ECONNREFUSED",
|
|
3067
|
+
"ECONNRESET",
|
|
3068
|
+
"ENOTFOUND",
|
|
3069
|
+
"EAI_AGAIN",
|
|
3070
|
+
"EPIPE",
|
|
3071
|
+
"EHOSTUNREACH",
|
|
3072
|
+
"ENETUNREACH",
|
|
3073
|
+
"EAI_FAIL"
|
|
3074
|
+
]);
|
|
3075
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
3076
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
3077
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
3078
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
3079
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
3080
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
3081
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
3082
|
+
"CERT_HAS_EXPIRED",
|
|
3083
|
+
"CERT_UNTRUSTED",
|
|
3084
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
3085
|
+
]);
|
|
3086
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
3087
|
+
"MODULE_NOT_FOUND",
|
|
3088
|
+
"ERR_MODULE_NOT_FOUND"
|
|
3089
|
+
]);
|
|
3090
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
3091
|
+
"TypeError",
|
|
3092
|
+
"ReferenceError",
|
|
3093
|
+
"SyntaxError",
|
|
3094
|
+
"RangeError"
|
|
3095
|
+
]);
|
|
3096
|
+
function isRecord(value) {
|
|
3097
|
+
return value !== null && typeof value === "object";
|
|
3098
|
+
}
|
|
3099
|
+
function stringField(value, field) {
|
|
3100
|
+
if (!isRecord(value)) {
|
|
3101
|
+
return;
|
|
3195
3102
|
}
|
|
3196
|
-
|
|
3197
|
-
|
|
3103
|
+
const raw = value[field];
|
|
3104
|
+
return typeof raw === "string" ? raw : undefined;
|
|
3105
|
+
}
|
|
3106
|
+
function numberField(value, field) {
|
|
3107
|
+
if (!isRecord(value)) {
|
|
3108
|
+
return;
|
|
3198
3109
|
}
|
|
3199
|
-
|
|
3200
|
-
|
|
3110
|
+
const raw = value[field];
|
|
3111
|
+
return typeof raw === "number" ? raw : undefined;
|
|
3112
|
+
}
|
|
3113
|
+
function findStringInCauseChain(error, field) {
|
|
3114
|
+
let current = error;
|
|
3115
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
3116
|
+
const value = stringField(current, field);
|
|
3117
|
+
if (value) {
|
|
3118
|
+
return value;
|
|
3119
|
+
}
|
|
3120
|
+
current = current.cause;
|
|
3201
3121
|
}
|
|
3202
|
-
|
|
3203
|
-
|
|
3122
|
+
return;
|
|
3123
|
+
}
|
|
3124
|
+
function findCodeInCauseChain(error) {
|
|
3125
|
+
return findStringInCauseChain(error, "code");
|
|
3126
|
+
}
|
|
3127
|
+
function isSpawnEnoent(error) {
|
|
3128
|
+
const code = findCodeInCauseChain(error);
|
|
3129
|
+
if (code !== "ENOENT") {
|
|
3130
|
+
return false;
|
|
3204
3131
|
}
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3132
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
3133
|
+
return syscall?.startsWith("spawn") === true;
|
|
3134
|
+
}
|
|
3135
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
3136
|
+
if (exitCode === 130) {
|
|
3137
|
+
return true;
|
|
3211
3138
|
}
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
error: redactError(error),
|
|
3215
|
-
properties: this.enrichProperties(properties),
|
|
3216
|
-
...this.leafCorrelation(context)
|
|
3217
|
-
});
|
|
3139
|
+
if (!isRecord(error)) {
|
|
3140
|
+
return false;
|
|
3218
3141
|
}
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
3222
|
-
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
3223
|
-
const clock = startSpanClock();
|
|
3224
|
-
const context = {
|
|
3225
|
-
operationId,
|
|
3226
|
-
...parentId !== undefined ? { parentId } : {},
|
|
3227
|
-
id: this.generateId(),
|
|
3228
|
-
startedAt: clock.startedAt
|
|
3229
|
-
};
|
|
3230
|
-
try {
|
|
3231
|
-
const result = await this.contextStorage.run(context, fn);
|
|
3232
|
-
const durationMs = clock.elapsedMs();
|
|
3233
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, true, properties, context));
|
|
3234
|
-
return result;
|
|
3235
|
-
} catch (error) {
|
|
3236
|
-
const durationMs = clock.elapsedMs();
|
|
3237
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
3238
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
3239
|
-
...properties,
|
|
3240
|
-
[CommandDimensions.ErrorMessage]: err.message
|
|
3241
|
-
}, context));
|
|
3242
|
-
throw error;
|
|
3243
|
-
}
|
|
3142
|
+
if (numberField(error, "exitCode") === 130) {
|
|
3143
|
+
return true;
|
|
3244
3144
|
}
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
id: this.generateId()
|
|
3249
|
-
};
|
|
3250
|
-
this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, success, properties, requestContext));
|
|
3145
|
+
const name = stringField(error, "name");
|
|
3146
|
+
if (name === "ExitPromptError") {
|
|
3147
|
+
return true;
|
|
3251
3148
|
}
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
const parentId = this.inboundParentIdFor(operationId);
|
|
3255
|
-
return {
|
|
3256
|
-
operationId,
|
|
3257
|
-
...parentId !== undefined ? { parentId } : {},
|
|
3258
|
-
id: this.generateId(),
|
|
3259
|
-
startedAt: startSpanClock().startedAt
|
|
3260
|
-
};
|
|
3149
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
3150
|
+
return true;
|
|
3261
3151
|
}
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3152
|
+
const message = stringField(error, "message");
|
|
3153
|
+
return message?.includes("SIGINT") === true;
|
|
3154
|
+
}
|
|
3155
|
+
function terminalSignalFor(input, outcome) {
|
|
3156
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
3157
|
+
return input.recordedFailure.terminalSignal;
|
|
3265
3158
|
}
|
|
3266
|
-
|
|
3267
|
-
|
|
3159
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
3160
|
+
if (explicit) {
|
|
3161
|
+
return explicit;
|
|
3268
3162
|
}
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3163
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
3164
|
+
}
|
|
3165
|
+
function classifyFailingHttpStatus(status) {
|
|
3166
|
+
return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
|
|
3167
|
+
}
|
|
3168
|
+
function classifyFromResult(result) {
|
|
3169
|
+
switch (result) {
|
|
3170
|
+
case "AuthenticationError":
|
|
3171
|
+
return "auth";
|
|
3172
|
+
case "ValidationError":
|
|
3173
|
+
return "validation";
|
|
3174
|
+
case "TimeoutError":
|
|
3175
|
+
return "timeout";
|
|
3176
|
+
default:
|
|
3272
3177
|
return;
|
|
3273
|
-
}
|
|
3274
|
-
return {
|
|
3275
|
-
operationId: parentContext.operationId,
|
|
3276
|
-
parentId: parentContext.id,
|
|
3277
|
-
id: this.generateId(),
|
|
3278
|
-
startedAt: startSpanClock().startedAt
|
|
3279
|
-
};
|
|
3280
|
-
}
|
|
3281
|
-
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
3282
|
-
this.telemetryProvider.trackDependency({
|
|
3283
|
-
...this.spanFor(redactHttpDependencyName(name), durationMs, success, properties, context),
|
|
3284
|
-
type,
|
|
3285
|
-
...resultCode !== undefined ? { resultCode } : {}
|
|
3286
|
-
});
|
|
3287
3178
|
}
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
operationId: parentContext.operationId,
|
|
3293
|
-
parentId: parentContext.id,
|
|
3294
|
-
id: this.generateId(),
|
|
3295
|
-
startedAt: clock.startedAt
|
|
3296
|
-
} : {
|
|
3297
|
-
...this.createRequestContext(),
|
|
3298
|
-
startedAt: clock.startedAt
|
|
3299
|
-
};
|
|
3300
|
-
try {
|
|
3301
|
-
const result = await this.contextStorage.run(childContext, fn);
|
|
3302
|
-
const durationMs = clock.elapsedMs();
|
|
3303
|
-
await this.telemetryProvider.trackDependency({
|
|
3304
|
-
...this.spanFor(name, durationMs, true, properties, childContext),
|
|
3305
|
-
type
|
|
3306
|
-
});
|
|
3307
|
-
return result;
|
|
3308
|
-
} catch (error) {
|
|
3309
|
-
const durationMs = clock.elapsedMs();
|
|
3310
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
3311
|
-
await this.telemetryProvider.trackDependency({
|
|
3312
|
-
...this.spanFor(name, durationMs, false, {
|
|
3313
|
-
...properties,
|
|
3314
|
-
[CommandDimensions.ErrorMessage]: err.message
|
|
3315
|
-
}, childContext),
|
|
3316
|
-
type
|
|
3317
|
-
});
|
|
3318
|
-
throw error;
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
getActiveContext() {
|
|
3322
|
-
return this.contextStorage.getContext();
|
|
3179
|
+
}
|
|
3180
|
+
function classifyFromErrorCode(errorCode) {
|
|
3181
|
+
if (!errorCode) {
|
|
3182
|
+
return;
|
|
3323
3183
|
}
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
return {
|
|
3327
|
-
operationId: context?.operationId ?? this.operationId ?? getTelemetryOperationId(),
|
|
3328
|
-
...context !== undefined ? { parentId: context.id } : {}
|
|
3329
|
-
};
|
|
3184
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
3185
|
+
return "auth";
|
|
3330
3186
|
}
|
|
3331
|
-
|
|
3332
|
-
return
|
|
3333
|
-
name: redactSpanName(name),
|
|
3334
|
-
durationMs,
|
|
3335
|
-
success,
|
|
3336
|
-
properties: this.enrichProperties(properties),
|
|
3337
|
-
operationId: context.operationId,
|
|
3338
|
-
...context.parentId !== undefined ? { parentId: context.parentId } : {},
|
|
3339
|
-
id: context.id,
|
|
3340
|
-
...context.startedAt !== undefined ? { startedAt: context.startedAt } : {}
|
|
3341
|
-
};
|
|
3187
|
+
if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
|
|
3188
|
+
return "local_permission";
|
|
3342
3189
|
}
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
const enriched = {
|
|
3346
|
-
...getExecutionContextTelemetryProperties(),
|
|
3347
|
-
...globalProperties,
|
|
3348
|
-
...this.defaultProperties,
|
|
3349
|
-
...redactProperties(properties ?? {}),
|
|
3350
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
3351
|
-
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
3352
|
-
};
|
|
3353
|
-
return lowercaseIdDimensionValues(enriched);
|
|
3190
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
3191
|
+
return "validation";
|
|
3354
3192
|
}
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
let hex = "";
|
|
3358
|
-
do {
|
|
3359
|
-
crypto.getRandomValues(bytes);
|
|
3360
|
-
hex = "";
|
|
3361
|
-
for (const byte of bytes) {
|
|
3362
|
-
hex += byte.toString(16).padStart(2, "0");
|
|
3363
|
-
}
|
|
3364
|
-
} while (/^0+$/.test(hex));
|
|
3365
|
-
return hex;
|
|
3193
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
3194
|
+
return "timeout";
|
|
3366
3195
|
}
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
3370
|
-
// ../common/src/timings.ts
|
|
3371
|
-
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
3372
|
-
function createStorage2() {
|
|
3373
|
-
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
3374
|
-
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
3375
|
-
return {
|
|
3376
|
-
getStore: () => {
|
|
3377
|
-
return;
|
|
3378
|
-
},
|
|
3379
|
-
run: (_store, fn) => fn()
|
|
3380
|
-
};
|
|
3196
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
3197
|
+
return "network_http";
|
|
3381
3198
|
}
|
|
3382
|
-
return
|
|
3199
|
+
return;
|
|
3383
3200
|
}
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3201
|
+
function hasLocalPermissionCode(error) {
|
|
3202
|
+
for (const node of walkErrorGraph(error)) {
|
|
3203
|
+
const code = node.code;
|
|
3204
|
+
if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
|
|
3205
|
+
return true;
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
return false;
|
|
3391
3209
|
}
|
|
3392
|
-
function
|
|
3393
|
-
const
|
|
3394
|
-
if (
|
|
3395
|
-
|
|
3210
|
+
function classifyFromError(error) {
|
|
3211
|
+
const code = findCodeInCauseChain(error);
|
|
3212
|
+
if (code) {
|
|
3213
|
+
if (code.startsWith("commander.")) {
|
|
3214
|
+
return "validation";
|
|
3215
|
+
}
|
|
3216
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
3217
|
+
return "network_http";
|
|
3218
|
+
}
|
|
3219
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
3220
|
+
return "timeout";
|
|
3221
|
+
}
|
|
3222
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
3223
|
+
return "missing_dependency";
|
|
3224
|
+
}
|
|
3396
3225
|
}
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
return pinned;
|
|
3226
|
+
if (hasLocalPermissionCode(error)) {
|
|
3227
|
+
return "local_permission";
|
|
3400
3228
|
}
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
const pinned = stateSlot.get();
|
|
3405
|
-
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
3406
|
-
}
|
|
3407
|
-
function processStartIsInvocationStart() {
|
|
3408
|
-
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
3409
|
-
}
|
|
3410
|
-
function timingsEnabled() {
|
|
3411
|
-
if (typeof process === "undefined") {
|
|
3412
|
-
return false;
|
|
3229
|
+
const message = stringField(error, "message");
|
|
3230
|
+
if (message?.includes("fetch failed") === true) {
|
|
3231
|
+
return "network_http";
|
|
3413
3232
|
}
|
|
3414
|
-
const
|
|
3415
|
-
if (
|
|
3416
|
-
return
|
|
3233
|
+
const name = stringField(error, "name");
|
|
3234
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
3235
|
+
return "internal";
|
|
3417
3236
|
}
|
|
3418
|
-
|
|
3419
|
-
return normalized === "1" || normalized === "true";
|
|
3237
|
+
return;
|
|
3420
3238
|
}
|
|
3421
|
-
function
|
|
3422
|
-
|
|
3423
|
-
|
|
3239
|
+
function classifyError2(input) {
|
|
3240
|
+
const recorded = input.recordedFailure;
|
|
3241
|
+
if (recorded?.errorClass) {
|
|
3242
|
+
return recorded.errorClass;
|
|
3424
3243
|
}
|
|
3425
|
-
|
|
3244
|
+
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3245
|
+
if (status !== undefined) {
|
|
3246
|
+
return classifyFailingHttpStatus(status);
|
|
3247
|
+
}
|
|
3248
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
3426
3249
|
}
|
|
3427
|
-
function
|
|
3428
|
-
|
|
3250
|
+
function recordCommandFailureTelemetry(failure) {
|
|
3251
|
+
recordedFailureSlot.set(failure);
|
|
3429
3252
|
}
|
|
3430
|
-
function
|
|
3431
|
-
|
|
3253
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
3254
|
+
recordedFailureSlot.clear();
|
|
3432
3255
|
}
|
|
3433
|
-
function
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
getState().commandStart = performance.now();
|
|
3256
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
3257
|
+
const failure = recordedFailureSlot.get();
|
|
3258
|
+
recordedFailureSlot.clear();
|
|
3259
|
+
return failure;
|
|
3438
3260
|
}
|
|
3439
|
-
function
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3261
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
3262
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
3263
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
3264
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
3265
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
3266
|
+
return {
|
|
3267
|
+
[CommandDimensions.ExitCode]: input.exitCode,
|
|
3268
|
+
[CommandDimensions.TerminalOutcome]: outcome,
|
|
3269
|
+
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
3270
|
+
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
3271
|
+
};
|
|
3444
3272
|
}
|
|
3445
3273
|
|
|
3274
|
+
// ../common/src/telemetry/telemetry-events.ts
|
|
3275
|
+
var CommonTelemetryEvents = {
|
|
3276
|
+
Start: "Application.Start",
|
|
3277
|
+
Error: "Application.Error",
|
|
3278
|
+
ProjectActivity: "Cli.ProjectActivity",
|
|
3279
|
+
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3280
|
+
};
|
|
3281
|
+
|
|
3446
3282
|
// ../common/src/registry.ts
|
|
3447
3283
|
import { execFileSync } from "node:child_process";
|
|
3448
3284
|
function readRegistryValue(keyPath, valueName) {
|
|
3449
3285
|
if (process.platform !== "win32") {
|
|
3450
3286
|
return "";
|
|
3451
3287
|
}
|
|
3452
|
-
const [error, output] =
|
|
3288
|
+
const [error, output] = catchError2(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
3453
3289
|
encoding: "utf-8",
|
|
3454
3290
|
stdio: ["pipe", "pipe", "pipe"],
|
|
3455
3291
|
windowsHide: true
|
|
@@ -3523,331 +3359,515 @@ function formatMessage(category, name, properties) {
|
|
|
3523
3359
|
return message;
|
|
3524
3360
|
}
|
|
3525
3361
|
|
|
3526
|
-
// ../common/src/telemetry/
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3362
|
+
// ../common/src/telemetry/debug-telemetry-provider.ts
|
|
3363
|
+
class DebugTelemetryProvider {
|
|
3364
|
+
async trackEvent({ name }) {
|
|
3365
|
+
logger.debug(`[Telemetry] Event: ${name}`);
|
|
3366
|
+
}
|
|
3367
|
+
async trackException({ error }) {
|
|
3368
|
+
logger.error(`[Telemetry] Exception: ${error.message}`);
|
|
3369
|
+
}
|
|
3370
|
+
async trackRequest({
|
|
3371
|
+
name,
|
|
3372
|
+
durationMs,
|
|
3373
|
+
success
|
|
3374
|
+
}) {
|
|
3375
|
+
logger.debug(`[Telemetry] Request: ${name} (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
3376
|
+
}
|
|
3377
|
+
async trackDependency({
|
|
3378
|
+
name,
|
|
3379
|
+
type,
|
|
3380
|
+
durationMs,
|
|
3381
|
+
success
|
|
3382
|
+
}) {
|
|
3383
|
+
logger.debug(`[Telemetry] Dependency: ${name} [${type}] (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
3387
|
+
var KNOWN_AGENTS = [
|
|
3388
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
3389
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
3390
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
3391
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
3392
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
3393
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
3394
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
3395
|
+
];
|
|
3396
|
+
function detectAgentFromEnv(env) {
|
|
3397
|
+
for (const agent of KNOWN_AGENTS) {
|
|
3398
|
+
const envValue = env[agent.envVar];
|
|
3399
|
+
if (agent.value !== undefined) {
|
|
3400
|
+
if (envValue === agent.value)
|
|
3401
|
+
return agent.id;
|
|
3402
|
+
} else {
|
|
3403
|
+
if (envValue)
|
|
3404
|
+
return agent.id;
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
const agentEnv = env.AGENT;
|
|
3408
|
+
if (agentEnv) {
|
|
3409
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
3410
|
+
return "unknown";
|
|
3411
|
+
if (agentEnv.length <= 32)
|
|
3412
|
+
return agentEnv.toLowerCase();
|
|
3413
|
+
}
|
|
3414
|
+
return;
|
|
3415
|
+
}
|
|
3416
|
+
// ../common/src/telemetry/environment-info.ts
|
|
3417
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
3418
|
+
// ../common/src/telemetry/execution-context.ts
|
|
3419
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
3420
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
3421
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
3422
|
+
var CI_SIGNATURES = [
|
|
3423
|
+
{
|
|
3424
|
+
provider: "github_actions",
|
|
3425
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
3426
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
3427
|
+
},
|
|
3428
|
+
{
|
|
3429
|
+
provider: "azure_devops",
|
|
3430
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
3431
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
3432
|
+
},
|
|
3433
|
+
{
|
|
3434
|
+
provider: "gitlab",
|
|
3435
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
3436
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
3437
|
+
},
|
|
3438
|
+
{
|
|
3439
|
+
provider: "circleci",
|
|
3440
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
3441
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
3442
|
+
},
|
|
3443
|
+
{
|
|
3444
|
+
provider: "jenkins",
|
|
3445
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3448
|
+
provider: "teamcity",
|
|
3449
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
3450
|
+
},
|
|
3451
|
+
{
|
|
3452
|
+
provider: "buildkite",
|
|
3453
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
3454
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
provider: "bitbucket",
|
|
3458
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
3459
|
+
},
|
|
3460
|
+
{
|
|
3461
|
+
provider: "travis",
|
|
3462
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
3463
|
+
},
|
|
3464
|
+
{
|
|
3465
|
+
provider: "appveyor",
|
|
3466
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
provider: "generic",
|
|
3470
|
+
matches: (env) => isTruthy(env.CI)
|
|
3543
3471
|
}
|
|
3544
|
-
|
|
3472
|
+
];
|
|
3473
|
+
function currentEnv() {
|
|
3474
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
3545
3475
|
}
|
|
3546
|
-
function
|
|
3547
|
-
|
|
3476
|
+
function currentTtyState() {
|
|
3477
|
+
if (typeof process === "undefined")
|
|
3478
|
+
return false;
|
|
3479
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
3548
3480
|
}
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
}
|
|
3558
|
-
return _localTelemetryInstance;
|
|
3481
|
+
function detectCi(env) {
|
|
3482
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
3483
|
+
if (!signature)
|
|
3484
|
+
return;
|
|
3485
|
+
return {
|
|
3486
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
3487
|
+
ciProvider: signature.provider
|
|
3488
|
+
};
|
|
3559
3489
|
}
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
return
|
|
3490
|
+
function detectExecutionContext(options = {}) {
|
|
3491
|
+
const env = options.env ?? currentEnv();
|
|
3492
|
+
const ci = detectCi(env);
|
|
3493
|
+
if (ci)
|
|
3494
|
+
return ci;
|
|
3495
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
3496
|
+
if (agent) {
|
|
3497
|
+
return { executionContext: "agent" };
|
|
3565
3498
|
}
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
process.exitCode = code;
|
|
3570
|
-
}
|
|
3571
|
-
|
|
3572
|
-
// ../common/src/output-codecs.ts
|
|
3573
|
-
var yamlSlot = singleton("YamlCodec");
|
|
3574
|
-
var jmespathSlot = singleton("JmespathCodec");
|
|
3575
|
-
async function loadOutputCodecsAsync(needed) {
|
|
3576
|
-
const loads = [];
|
|
3577
|
-
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
3578
|
-
loads.push(import("./js-yaml-87cdx6bm.js").then((mod) => {
|
|
3579
|
-
yamlSlot.set(mod);
|
|
3580
|
-
}));
|
|
3499
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
3500
|
+
if (authSignal === "service_account") {
|
|
3501
|
+
return { executionContext: "service_account" };
|
|
3581
3502
|
}
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
}));
|
|
3503
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
3504
|
+
if (isTty) {
|
|
3505
|
+
return { executionContext: "manual" };
|
|
3586
3506
|
}
|
|
3587
|
-
|
|
3588
|
-
}
|
|
3589
|
-
function getYamlCodec() {
|
|
3590
|
-
return yamlSlot.get();
|
|
3507
|
+
return { executionContext: "unknown" };
|
|
3591
3508
|
}
|
|
3592
|
-
function
|
|
3593
|
-
|
|
3509
|
+
function getExecutionContextTelemetryProperties() {
|
|
3510
|
+
const detected = detectExecutionContext();
|
|
3511
|
+
return {
|
|
3512
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
3513
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3514
|
+
};
|
|
3594
3515
|
}
|
|
3516
|
+
// ../common/src/telemetry/node-context-storage.ts
|
|
3517
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3595
3518
|
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
}
|
|
3604
|
-
function getOutputFilter() {
|
|
3605
|
-
return filterSlot.get();
|
|
3519
|
+
class NodeContextStorage {
|
|
3520
|
+
storage = new AsyncLocalStorage;
|
|
3521
|
+
run(context, fn) {
|
|
3522
|
+
return this.storage.run(context, fn);
|
|
3523
|
+
}
|
|
3524
|
+
getContext() {
|
|
3525
|
+
return this.storage.getStore();
|
|
3526
|
+
}
|
|
3606
3527
|
}
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
var
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
"permission_denied"
|
|
3613
|
-
]);
|
|
3614
|
-
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
3615
|
-
"local_permission_denied"
|
|
3616
|
-
]);
|
|
3617
|
-
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
3618
|
-
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
3619
|
-
"network_error",
|
|
3620
|
-
"rate_limited",
|
|
3621
|
-
"server_error",
|
|
3622
|
-
"not_found",
|
|
3623
|
-
"method_not_allowed"
|
|
3624
|
-
]);
|
|
3625
|
-
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
3626
|
-
var NETWORK_OS_ERROR_CODES = new Set([
|
|
3627
|
-
"ECONNREFUSED",
|
|
3628
|
-
"ECONNRESET",
|
|
3629
|
-
"ENOTFOUND",
|
|
3630
|
-
"EAI_AGAIN",
|
|
3631
|
-
"EPIPE",
|
|
3632
|
-
"EHOSTUNREACH",
|
|
3633
|
-
"ENETUNREACH",
|
|
3634
|
-
"EAI_FAIL"
|
|
3635
|
-
]);
|
|
3636
|
-
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
3637
|
-
var TLS_ERROR_CODES2 = new Set([
|
|
3638
|
-
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
3639
|
-
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
3640
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
3641
|
-
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
3642
|
-
"UNABLE_TO_GET_ISSUER_CERT",
|
|
3643
|
-
"CERT_HAS_EXPIRED",
|
|
3644
|
-
"CERT_UNTRUSTED",
|
|
3645
|
-
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
3646
|
-
]);
|
|
3647
|
-
var MISSING_DEPENDENCY_CODES = new Set([
|
|
3648
|
-
"MODULE_NOT_FOUND",
|
|
3649
|
-
"ERR_MODULE_NOT_FOUND"
|
|
3650
|
-
]);
|
|
3651
|
-
var INTERNAL_ERROR_NAMES = new Set([
|
|
3652
|
-
"TypeError",
|
|
3653
|
-
"ReferenceError",
|
|
3654
|
-
"SyntaxError",
|
|
3655
|
-
"RangeError"
|
|
3656
|
-
]);
|
|
3657
|
-
function isRecord(value) {
|
|
3658
|
-
return value !== null && typeof value === "object";
|
|
3528
|
+
// ../common/src/telemetry/trace-context.ts
|
|
3529
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
3530
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
3531
|
+
function getProcessEnv() {
|
|
3532
|
+
return globalThis.process?.env;
|
|
3659
3533
|
}
|
|
3660
|
-
function
|
|
3661
|
-
if (!
|
|
3534
|
+
function parseInboundTraceparent(value) {
|
|
3535
|
+
if (!value) {
|
|
3662
3536
|
return;
|
|
3663
3537
|
}
|
|
3664
|
-
const
|
|
3665
|
-
|
|
3666
|
-
}
|
|
3667
|
-
function numberField(value, field) {
|
|
3668
|
-
if (!isRecord(value)) {
|
|
3538
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
3539
|
+
if (!match) {
|
|
3669
3540
|
return;
|
|
3670
3541
|
}
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
function findStringInCauseChain(error, field) {
|
|
3675
|
-
let current = error;
|
|
3676
|
-
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
3677
|
-
const value = stringField(current, field);
|
|
3678
|
-
if (value) {
|
|
3679
|
-
return value;
|
|
3680
|
-
}
|
|
3681
|
-
current = current.cause;
|
|
3542
|
+
const [, traceId, parentSpanId] = match;
|
|
3543
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
3544
|
+
return;
|
|
3682
3545
|
}
|
|
3683
|
-
return;
|
|
3546
|
+
return { traceId, parentSpanId };
|
|
3684
3547
|
}
|
|
3685
|
-
function
|
|
3686
|
-
return
|
|
3548
|
+
function getInboundTraceContext() {
|
|
3549
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
3687
3550
|
}
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3551
|
+
|
|
3552
|
+
// ../common/src/telemetry/session-id.ts
|
|
3553
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
3554
|
+
var SESSION_ID_MAX_LENGTH = 64;
|
|
3555
|
+
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
3556
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
3557
|
+
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
3558
|
+
var INHERITED_SESSION_SOURCES = [
|
|
3559
|
+
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
3560
|
+
{ envVar: "CODEX_THREAD_ID", source: "codex" },
|
|
3561
|
+
{ envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
|
|
3562
|
+
{ envVar: "TERM_SESSION_ID", source: "terminal" },
|
|
3563
|
+
{ envVar: "WT_SESSION", source: "terminal" }
|
|
3564
|
+
];
|
|
3565
|
+
var telemetrySessionSlot = singleton("TelemetrySession");
|
|
3566
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
3567
|
+
function getProcessEnv2() {
|
|
3568
|
+
return globalThis.process?.env;
|
|
3695
3569
|
}
|
|
3696
|
-
function
|
|
3697
|
-
if (
|
|
3698
|
-
return
|
|
3699
|
-
}
|
|
3700
|
-
if (!isRecord(error)) {
|
|
3701
|
-
return false;
|
|
3702
|
-
}
|
|
3703
|
-
if (numberField(error, "exitCode") === 130) {
|
|
3704
|
-
return true;
|
|
3705
|
-
}
|
|
3706
|
-
const name = stringField(error, "name");
|
|
3707
|
-
if (name === "ExitPromptError") {
|
|
3708
|
-
return true;
|
|
3570
|
+
function normalizeSessionId(value) {
|
|
3571
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
3572
|
+
return;
|
|
3709
3573
|
}
|
|
3710
|
-
|
|
3711
|
-
|
|
3574
|
+
const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
|
|
3575
|
+
return cleaned || undefined;
|
|
3576
|
+
}
|
|
3577
|
+
function getConfiguredTelemetrySessionId() {
|
|
3578
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
3579
|
+
}
|
|
3580
|
+
function getInheritedSession(env) {
|
|
3581
|
+
for (const candidate of INHERITED_SESSION_SOURCES) {
|
|
3582
|
+
const handle = normalizeSessionId(env[candidate.envVar]);
|
|
3583
|
+
if (handle) {
|
|
3584
|
+
return { id: handle, source: candidate.source };
|
|
3585
|
+
}
|
|
3712
3586
|
}
|
|
3713
|
-
|
|
3714
|
-
return message?.includes("SIGINT") === true;
|
|
3587
|
+
return;
|
|
3715
3588
|
}
|
|
3716
|
-
function
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
const
|
|
3721
|
-
|
|
3722
|
-
return explicit;
|
|
3589
|
+
function generateRandomSession() {
|
|
3590
|
+
const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
|
|
3591
|
+
crypto.getRandomValues(bytes);
|
|
3592
|
+
let hex = "";
|
|
3593
|
+
for (const byte of bytes) {
|
|
3594
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
3723
3595
|
}
|
|
3724
|
-
return
|
|
3596
|
+
return { id: hex, source: "random" };
|
|
3725
3597
|
}
|
|
3726
|
-
function
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
3731
|
-
return "validation";
|
|
3732
|
-
}
|
|
3733
|
-
if (status === 408) {
|
|
3734
|
-
return "timeout";
|
|
3598
|
+
function resolveTelemetrySession() {
|
|
3599
|
+
const existing = telemetrySessionSlot.get();
|
|
3600
|
+
if (existing) {
|
|
3601
|
+
return existing;
|
|
3735
3602
|
}
|
|
3736
|
-
|
|
3603
|
+
const declaredHandle = getConfiguredTelemetrySessionId();
|
|
3604
|
+
const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
|
|
3605
|
+
telemetrySessionSlot.set(resolved);
|
|
3606
|
+
return resolved;
|
|
3737
3607
|
}
|
|
3738
|
-
function
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3608
|
+
function getTelemetrySessionId() {
|
|
3609
|
+
return resolveTelemetrySession().id;
|
|
3610
|
+
}
|
|
3611
|
+
function getTelemetrySessionSource() {
|
|
3612
|
+
return resolveTelemetrySession().source;
|
|
3613
|
+
}
|
|
3614
|
+
function getTelemetryOperationId() {
|
|
3615
|
+
const existing = telemetryOperationIdSlot.get();
|
|
3616
|
+
if (existing) {
|
|
3617
|
+
return existing;
|
|
3748
3618
|
}
|
|
3619
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
3620
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
3621
|
+
telemetryOperationIdSlot.set(generated);
|
|
3622
|
+
return generated;
|
|
3749
3623
|
}
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3624
|
+
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
3625
|
+
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
3626
|
+
function getGlobalTelemetryProperties() {
|
|
3627
|
+
return telemetryPropsSlot.get();
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
// ../common/src/telemetry/span-clock.ts
|
|
3631
|
+
function startSpanClock() {
|
|
3632
|
+
const started = performance.now();
|
|
3633
|
+
return {
|
|
3634
|
+
startedAt: new Date(performance.timeOrigin + started),
|
|
3635
|
+
elapsedMs: () => performance.now() - started
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
// ../common/src/telemetry/telemetry-service.ts
|
|
3640
|
+
class TelemetryService {
|
|
3641
|
+
telemetryProvider;
|
|
3642
|
+
contextStorage;
|
|
3643
|
+
operationId;
|
|
3644
|
+
defaultProperties;
|
|
3645
|
+
constructor(telemetryProvider, contextStorage) {
|
|
3646
|
+
this.telemetryProvider = telemetryProvider;
|
|
3647
|
+
this.contextStorage = contextStorage;
|
|
3753
3648
|
}
|
|
3754
|
-
|
|
3755
|
-
|
|
3649
|
+
setOperationId(operationId) {
|
|
3650
|
+
this.operationId = operationId;
|
|
3756
3651
|
}
|
|
3757
|
-
|
|
3758
|
-
|
|
3652
|
+
setProvider(provider) {
|
|
3653
|
+
this.telemetryProvider = provider;
|
|
3759
3654
|
}
|
|
3760
|
-
|
|
3761
|
-
|
|
3655
|
+
setDefaultProperties(properties) {
|
|
3656
|
+
this.defaultProperties = properties === undefined ? undefined : { ...this.defaultProperties, ...properties };
|
|
3762
3657
|
}
|
|
3763
|
-
|
|
3764
|
-
|
|
3658
|
+
trackEvent(name, properties) {
|
|
3659
|
+
this.telemetryProvider.trackEvent({
|
|
3660
|
+
name: redactSpanName(name),
|
|
3661
|
+
properties: this.enrichProperties(properties),
|
|
3662
|
+
...this.leafCorrelation()
|
|
3663
|
+
});
|
|
3765
3664
|
}
|
|
3766
|
-
|
|
3767
|
-
|
|
3665
|
+
trackException(error, properties, context) {
|
|
3666
|
+
this.telemetryProvider.trackException({
|
|
3667
|
+
error: redactError(error),
|
|
3668
|
+
properties: this.enrichProperties(properties),
|
|
3669
|
+
...this.leafCorrelation(context)
|
|
3670
|
+
});
|
|
3768
3671
|
}
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3775
|
-
|
|
3672
|
+
async trackRequest(name, fn, properties) {
|
|
3673
|
+
const parentContext = this.getActiveContext();
|
|
3674
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
3675
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
3676
|
+
const clock = startSpanClock();
|
|
3677
|
+
const context = {
|
|
3678
|
+
operationId,
|
|
3679
|
+
...parentId !== undefined ? { parentId } : {},
|
|
3680
|
+
id: this.generateId(),
|
|
3681
|
+
startedAt: clock.startedAt
|
|
3682
|
+
};
|
|
3683
|
+
try {
|
|
3684
|
+
const result = await this.contextStorage.run(context, fn);
|
|
3685
|
+
const durationMs = clock.elapsedMs();
|
|
3686
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, true, properties, context));
|
|
3687
|
+
return result;
|
|
3688
|
+
} catch (error) {
|
|
3689
|
+
const durationMs = clock.elapsedMs();
|
|
3690
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
3691
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
3692
|
+
...properties,
|
|
3693
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
3694
|
+
}, context));
|
|
3695
|
+
throw error;
|
|
3776
3696
|
}
|
|
3777
3697
|
}
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3698
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
3699
|
+
const requestContext = context ?? {
|
|
3700
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
3701
|
+
id: this.generateId()
|
|
3702
|
+
};
|
|
3703
|
+
this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, success, properties, requestContext));
|
|
3704
|
+
}
|
|
3705
|
+
createRequestContext() {
|
|
3706
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
3707
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
3708
|
+
return {
|
|
3709
|
+
operationId,
|
|
3710
|
+
...parentId !== undefined ? { parentId } : {},
|
|
3711
|
+
id: this.generateId(),
|
|
3712
|
+
startedAt: startSpanClock().startedAt
|
|
3713
|
+
};
|
|
3714
|
+
}
|
|
3715
|
+
inboundParentIdFor(operationId) {
|
|
3716
|
+
const inbound = getInboundTraceContext();
|
|
3717
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
3718
|
+
}
|
|
3719
|
+
runWithContext(context, fn) {
|
|
3720
|
+
return this.contextStorage.run(context, fn);
|
|
3721
|
+
}
|
|
3722
|
+
createDependencyContext() {
|
|
3723
|
+
const parentContext = this.getActiveContext();
|
|
3724
|
+
if (!parentContext) {
|
|
3725
|
+
return;
|
|
3791
3726
|
}
|
|
3792
|
-
|
|
3793
|
-
|
|
3727
|
+
return {
|
|
3728
|
+
operationId: parentContext.operationId,
|
|
3729
|
+
parentId: parentContext.id,
|
|
3730
|
+
id: this.generateId(),
|
|
3731
|
+
startedAt: startSpanClock().startedAt
|
|
3732
|
+
};
|
|
3733
|
+
}
|
|
3734
|
+
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
3735
|
+
this.telemetryProvider.trackDependency({
|
|
3736
|
+
...this.spanFor(redactHttpDependencyName(name), durationMs, success, properties, context),
|
|
3737
|
+
type,
|
|
3738
|
+
...resultCode !== undefined ? { resultCode } : {}
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3741
|
+
async trackDependencyOperation(name, type, fn, properties) {
|
|
3742
|
+
const clock = startSpanClock();
|
|
3743
|
+
const parentContext = this.getActiveContext();
|
|
3744
|
+
const childContext = parentContext !== undefined ? {
|
|
3745
|
+
operationId: parentContext.operationId,
|
|
3746
|
+
parentId: parentContext.id,
|
|
3747
|
+
id: this.generateId(),
|
|
3748
|
+
startedAt: clock.startedAt
|
|
3749
|
+
} : {
|
|
3750
|
+
...this.createRequestContext(),
|
|
3751
|
+
startedAt: clock.startedAt
|
|
3752
|
+
};
|
|
3753
|
+
try {
|
|
3754
|
+
const result = await this.contextStorage.run(childContext, fn);
|
|
3755
|
+
const durationMs = clock.elapsedMs();
|
|
3756
|
+
await this.telemetryProvider.trackDependency({
|
|
3757
|
+
...this.spanFor(name, durationMs, true, properties, childContext),
|
|
3758
|
+
type
|
|
3759
|
+
});
|
|
3760
|
+
return result;
|
|
3761
|
+
} catch (error) {
|
|
3762
|
+
const durationMs = clock.elapsedMs();
|
|
3763
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
3764
|
+
await this.telemetryProvider.trackDependency({
|
|
3765
|
+
...this.spanFor(name, durationMs, false, {
|
|
3766
|
+
...properties,
|
|
3767
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
3768
|
+
}, childContext),
|
|
3769
|
+
type
|
|
3770
|
+
});
|
|
3771
|
+
throw error;
|
|
3794
3772
|
}
|
|
3795
3773
|
}
|
|
3796
|
-
|
|
3797
|
-
return
|
|
3774
|
+
getActiveContext() {
|
|
3775
|
+
return this.contextStorage.getContext();
|
|
3798
3776
|
}
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
return
|
|
3777
|
+
leafCorrelation(explicit) {
|
|
3778
|
+
const context = explicit ?? this.getActiveContext();
|
|
3779
|
+
return {
|
|
3780
|
+
operationId: context?.operationId ?? this.operationId ?? getTelemetryOperationId(),
|
|
3781
|
+
...context !== undefined ? { parentId: context.id } : {}
|
|
3782
|
+
};
|
|
3802
3783
|
}
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3784
|
+
spanFor(name, durationMs, success, properties, context) {
|
|
3785
|
+
return {
|
|
3786
|
+
name: redactSpanName(name),
|
|
3787
|
+
durationMs,
|
|
3788
|
+
success,
|
|
3789
|
+
properties: this.enrichProperties(properties),
|
|
3790
|
+
operationId: context.operationId,
|
|
3791
|
+
...context.parentId !== undefined ? { parentId: context.parentId } : {},
|
|
3792
|
+
id: context.id,
|
|
3793
|
+
...context.startedAt !== undefined ? { startedAt: context.startedAt } : {}
|
|
3794
|
+
};
|
|
3806
3795
|
}
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3796
|
+
enrichProperties(properties) {
|
|
3797
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
3798
|
+
const enriched = {
|
|
3799
|
+
...getExecutionContextTelemetryProperties(),
|
|
3800
|
+
...globalProperties,
|
|
3801
|
+
...this.defaultProperties,
|
|
3802
|
+
...redactProperties(properties ?? {}),
|
|
3803
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
3804
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
3805
|
+
};
|
|
3806
|
+
return lowercaseIdDimensionValues(enriched);
|
|
3813
3807
|
}
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3808
|
+
generateId() {
|
|
3809
|
+
const bytes = new Uint8Array(8);
|
|
3810
|
+
let hex = "";
|
|
3811
|
+
do {
|
|
3812
|
+
crypto.getRandomValues(bytes);
|
|
3813
|
+
hex = "";
|
|
3814
|
+
for (const byte of bytes) {
|
|
3815
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
3816
|
+
}
|
|
3817
|
+
} while (/^0+$/.test(hex));
|
|
3818
|
+
return hex;
|
|
3817
3819
|
}
|
|
3818
|
-
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
3819
|
-
}
|
|
3820
|
-
function recordCommandFailureTelemetry(failure) {
|
|
3821
|
-
recordedFailureSlot.set(failure);
|
|
3822
3820
|
}
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3821
|
+
// ../common/src/telemetry/proxy-http-agent.ts
|
|
3822
|
+
var slot = singleton("ProxyAuthHttpsAgent");
|
|
3823
|
+
|
|
3824
|
+
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
3825
|
+
var providerSlot = singleton("TelemetryProvider");
|
|
3826
|
+
|
|
3827
|
+
// ../common/src/telemetry/telemetry-config.ts
|
|
3828
|
+
function isTelemetryDisabled() {
|
|
3829
|
+
const value = process.env.UIPATH_TELEMETRY_DISABLED;
|
|
3830
|
+
return value === "1" || value === "true";
|
|
3830
3831
|
}
|
|
3831
|
-
function
|
|
3832
|
-
|
|
3833
|
-
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
3834
|
-
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
3835
|
-
const terminalSignal = terminalSignalFor(input, outcome);
|
|
3836
|
-
return {
|
|
3837
|
-
[CommandDimensions.ExitCode]: input.exitCode,
|
|
3838
|
-
[CommandDimensions.TerminalOutcome]: outcome,
|
|
3839
|
-
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
3840
|
-
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
3841
|
-
};
|
|
3832
|
+
function isProjectTelemetryDisabled() {
|
|
3833
|
+
return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
|
|
3842
3834
|
}
|
|
3843
3835
|
|
|
3844
|
-
// ../common/src/telemetry/telemetry-
|
|
3845
|
-
var
|
|
3846
|
-
|
|
3847
|
-
Error: "Application.Error",
|
|
3848
|
-
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3849
|
-
};
|
|
3836
|
+
// ../common/src/telemetry/telemetry-spool.ts
|
|
3837
|
+
var sidecarEntrySlot = singleton("TelemetrySidecarEntry");
|
|
3838
|
+
var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
|
|
3850
3839
|
|
|
3840
|
+
// ../common/src/telemetry/telemetry-init.ts
|
|
3841
|
+
var telemetryInstanceSlot = singleton("TelemetryService");
|
|
3842
|
+
var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
|
|
3843
|
+
function getGlobalTelemetryInstance() {
|
|
3844
|
+
const existing = telemetryInstanceSlot.get();
|
|
3845
|
+
if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
|
|
3846
|
+
return existing;
|
|
3847
|
+
}
|
|
3848
|
+
return;
|
|
3849
|
+
}
|
|
3850
|
+
function setGlobalTelemetryInstance(instance) {
|
|
3851
|
+
telemetryInstanceSlot.set(instance);
|
|
3852
|
+
}
|
|
3853
|
+
var _localTelemetryInstance;
|
|
3854
|
+
function getTelemetryInstance() {
|
|
3855
|
+
const global = getGlobalTelemetryInstance();
|
|
3856
|
+
if (global)
|
|
3857
|
+
return global;
|
|
3858
|
+
if (!_localTelemetryInstance) {
|
|
3859
|
+
_localTelemetryInstance = new TelemetryService(new LoggerTelemetryProvider, new NodeContextStorage);
|
|
3860
|
+
setGlobalTelemetryInstance(_localTelemetryInstance);
|
|
3861
|
+
}
|
|
3862
|
+
return _localTelemetryInstance;
|
|
3863
|
+
}
|
|
3864
|
+
var telemetry = new Proxy({}, {
|
|
3865
|
+
get(_, prop) {
|
|
3866
|
+
const instance = getTelemetryInstance();
|
|
3867
|
+
const value = instance[prop];
|
|
3868
|
+
return typeof value === "function" ? value.bind(instance) : value;
|
|
3869
|
+
}
|
|
3870
|
+
});
|
|
3851
3871
|
// ../common/src/formatter.ts
|
|
3852
3872
|
var ANSI_STYLES = {
|
|
3853
3873
|
red: "\x1B[31m",
|
|
@@ -3857,46 +3877,6 @@ var ANSI_RESET = "\x1B[0m";
|
|
|
3857
3877
|
function styleLine(line, style) {
|
|
3858
3878
|
return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
|
|
3859
3879
|
}
|
|
3860
|
-
var CLI_ERROR_CODES = [
|
|
3861
|
-
"invalid_argument",
|
|
3862
|
-
"authentication_required",
|
|
3863
|
-
"permission_denied",
|
|
3864
|
-
"local_permission_denied",
|
|
3865
|
-
"not_found",
|
|
3866
|
-
"rate_limited",
|
|
3867
|
-
"network_error",
|
|
3868
|
-
"timeout",
|
|
3869
|
-
"server_error",
|
|
3870
|
-
"method_not_allowed",
|
|
3871
|
-
"not_supported",
|
|
3872
|
-
"configuration_error",
|
|
3873
|
-
"execution_failed",
|
|
3874
|
-
"unknown_error"
|
|
3875
|
-
];
|
|
3876
|
-
var RETRY_HINTS = [
|
|
3877
|
-
"RetryWillNotFix",
|
|
3878
|
-
"RetryLater",
|
|
3879
|
-
"RetryAfter1Second",
|
|
3880
|
-
"RetryAfter10Seconds",
|
|
3881
|
-
"RetryAfter30Seconds",
|
|
3882
|
-
"RetryAfter60Seconds"
|
|
3883
|
-
];
|
|
3884
|
-
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
3885
|
-
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
3886
|
-
function isCliErrorCode(value) {
|
|
3887
|
-
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
3888
|
-
}
|
|
3889
|
-
function isRetryHint(value) {
|
|
3890
|
-
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
3891
|
-
}
|
|
3892
|
-
var RESULTS = {
|
|
3893
|
-
Success: "Success",
|
|
3894
|
-
Failure: "Failure",
|
|
3895
|
-
ConfigError: "ConfigError",
|
|
3896
|
-
AuthenticationError: "AuthenticationError",
|
|
3897
|
-
ValidationError: "ValidationError",
|
|
3898
|
-
TimeoutError: "TimeoutError"
|
|
3899
|
-
};
|
|
3900
3880
|
var EXIT_CODES = {
|
|
3901
3881
|
Success: 0,
|
|
3902
3882
|
Failure: 1,
|
|
@@ -3905,6 +3885,9 @@ var EXIT_CODES = {
|
|
|
3905
3885
|
ValidationError: 3,
|
|
3906
3886
|
TimeoutError: 4
|
|
3907
3887
|
};
|
|
3888
|
+
function exitCodeForResult(result) {
|
|
3889
|
+
return EXIT_CODES[result] ?? EXIT_CODES.Failure;
|
|
3890
|
+
}
|
|
3908
3891
|
|
|
3909
3892
|
class Pagination {
|
|
3910
3893
|
Returned;
|
|
@@ -3938,6 +3921,17 @@ function derivePaginationHasMore(returned, limit, offset, total, nextPage) {
|
|
|
3938
3921
|
}
|
|
3939
3922
|
return (offset ?? 0) + returned < total;
|
|
3940
3923
|
}
|
|
3924
|
+
function apiPagination(returned, options) {
|
|
3925
|
+
const { limit, offset } = options;
|
|
3926
|
+
if (limit === undefined && offset === 0) {
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3929
|
+
return new Pagination({
|
|
3930
|
+
returned,
|
|
3931
|
+
limit: limit ?? Math.max(returned, 1),
|
|
3932
|
+
offset
|
|
3933
|
+
});
|
|
3934
|
+
}
|
|
3941
3935
|
function escapeNonAscii(jsonText) {
|
|
3942
3936
|
return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
|
|
3943
3937
|
const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
|
|
@@ -4532,7 +4526,7 @@ function availableFields(data) {
|
|
|
4532
4526
|
return [...keys];
|
|
4533
4527
|
}
|
|
4534
4528
|
function decodeQuotedIdentifier(whole, inner) {
|
|
4535
|
-
const [error, decoded] =
|
|
4529
|
+
const [error, decoded] = catchError2(() => JSON.parse(whole));
|
|
4536
4530
|
if (!error && typeof decoded === "string")
|
|
4537
4531
|
return decoded;
|
|
4538
4532
|
return inner.replace(/\\(.)/g, "$1");
|
|
@@ -4728,7 +4722,7 @@ function filterFailureData(envelope) {
|
|
|
4728
4722
|
if (!filter || data == null)
|
|
4729
4723
|
return;
|
|
4730
4724
|
let note;
|
|
4731
|
-
const [filterError, filtered] =
|
|
4725
|
+
const [filterError, filtered] = catchError2(() => applyFilter(data, filter, (n) => {
|
|
4732
4726
|
note = n;
|
|
4733
4727
|
}));
|
|
4734
4728
|
if (filterError) {
|
|
@@ -4754,40 +4748,11 @@ function defaultErrorCodeForResult(result) {
|
|
|
4754
4748
|
return "unknown_error";
|
|
4755
4749
|
}
|
|
4756
4750
|
}
|
|
4757
|
-
function parseHttpStatusFromMessage2(message) {
|
|
4758
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
4759
|
-
if (!match)
|
|
4760
|
-
return;
|
|
4761
|
-
const status = Number(match[1]);
|
|
4762
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
4763
|
-
}
|
|
4764
|
-
function defaultErrorCodeForHttpStatus(status) {
|
|
4765
|
-
if (status === undefined)
|
|
4766
|
-
return;
|
|
4767
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
4768
|
-
return "invalid_argument";
|
|
4769
|
-
}
|
|
4770
|
-
if (status === 401)
|
|
4771
|
-
return "authentication_required";
|
|
4772
|
-
if (status === 403)
|
|
4773
|
-
return "permission_denied";
|
|
4774
|
-
if (status === 404)
|
|
4775
|
-
return "not_found";
|
|
4776
|
-
if (status === 405)
|
|
4777
|
-
return "method_not_allowed";
|
|
4778
|
-
if (status === 408)
|
|
4779
|
-
return "timeout";
|
|
4780
|
-
if (status === 429)
|
|
4781
|
-
return "rate_limited";
|
|
4782
|
-
if (status >= 500 && status < 600)
|
|
4783
|
-
return "server_error";
|
|
4784
|
-
return;
|
|
4785
|
-
}
|
|
4786
4751
|
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
4787
4752
|
function defaultErrorCodeForFailure(data) {
|
|
4788
4753
|
if (data.Result === RESULTS.Failure) {
|
|
4789
|
-
const status = data.Context?.httpStatus ??
|
|
4790
|
-
const errorCode =
|
|
4754
|
+
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
|
|
4755
|
+
const errorCode = classifyHttpStatus(status)?.errorCode;
|
|
4791
4756
|
if (errorCode)
|
|
4792
4757
|
return errorCode;
|
|
4793
4758
|
if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
|
|
@@ -4796,17 +4761,6 @@ function defaultErrorCodeForFailure(data) {
|
|
|
4796
4761
|
}
|
|
4797
4762
|
return defaultErrorCodeForResult(data.Result);
|
|
4798
4763
|
}
|
|
4799
|
-
function defaultRetryForErrorCode(errorCode) {
|
|
4800
|
-
switch (errorCode) {
|
|
4801
|
-
case "network_error":
|
|
4802
|
-
case "rate_limited":
|
|
4803
|
-
case "server_error":
|
|
4804
|
-
case "timeout":
|
|
4805
|
-
return "RetryLater";
|
|
4806
|
-
default:
|
|
4807
|
-
return "RetryWillNotFix";
|
|
4808
|
-
}
|
|
4809
|
-
}
|
|
4810
4764
|
var OutputFormatter;
|
|
4811
4765
|
((OutputFormatter) => {
|
|
4812
4766
|
function success(data, options) {
|
|
@@ -4838,7 +4792,7 @@ var OutputFormatter;
|
|
|
4838
4792
|
data.Log ??= getLogFilePath() || undefined;
|
|
4839
4793
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
4840
4794
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
4841
|
-
const exitCode =
|
|
4795
|
+
const exitCode = exitCodeForResult(data.Result);
|
|
4842
4796
|
setExitCode(exitCode);
|
|
4843
4797
|
recordCommandFailureTelemetry({
|
|
4844
4798
|
result: data.Result,
|
|
@@ -4883,71 +4837,277 @@ var OutputFormatter;
|
|
|
4883
4837
|
if (opts?.warning) {
|
|
4884
4838
|
data.Warning = opts.warning;
|
|
4885
4839
|
}
|
|
4886
|
-
if (opts?.pagination) {
|
|
4887
|
-
data.Pagination = opts.pagination;
|
|
4840
|
+
if (opts?.pagination) {
|
|
4841
|
+
data.Pagination = opts.pagination;
|
|
4842
|
+
}
|
|
4843
|
+
success(data);
|
|
4844
|
+
}
|
|
4845
|
+
OutputFormatter.emitList = emitList;
|
|
4846
|
+
function log(data) {
|
|
4847
|
+
const format = getOutputFormat();
|
|
4848
|
+
const sink = getOutputSink();
|
|
4849
|
+
const normalized = toPascalCaseData(data);
|
|
4850
|
+
if (format === "json") {
|
|
4851
|
+
const json = JSON.stringify(normalized);
|
|
4852
|
+
const safe = needsAsciiSafeJson(sink) ? escapeNonAscii(json) : json;
|
|
4853
|
+
sink.writeErr(`${safe}
|
|
4854
|
+
`);
|
|
4855
|
+
} else {
|
|
4856
|
+
for (const [key, value] of Object.entries(normalized)) {
|
|
4857
|
+
sink.writeErr(`${key}: ${value}
|
|
4858
|
+
`);
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
OutputFormatter.log = log;
|
|
4863
|
+
function formatToString(data) {
|
|
4864
|
+
const filter = getOutputFilter();
|
|
4865
|
+
const envelope = data;
|
|
4866
|
+
if ("Data" in data && data.Data != null) {
|
|
4867
|
+
data.Data = normalizeDataKeys(data.Data);
|
|
4868
|
+
if (filter) {
|
|
4869
|
+
let note;
|
|
4870
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
4871
|
+
note = n;
|
|
4872
|
+
}));
|
|
4873
|
+
if (note) {
|
|
4874
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
}
|
|
4878
|
+
const output = normalizeOutputKeys(envelope);
|
|
4879
|
+
const lines = [];
|
|
4880
|
+
const sink = getOutputSink();
|
|
4881
|
+
printOutput(output, getOutputFormat(), (msg) => {
|
|
4882
|
+
lines.push(msg);
|
|
4883
|
+
}, needsAsciiSafeJson(sink));
|
|
4884
|
+
return lines.join(`
|
|
4885
|
+
`);
|
|
4886
|
+
}
|
|
4887
|
+
OutputFormatter.formatToString = formatToString;
|
|
4888
|
+
})(OutputFormatter ||= {});
|
|
4889
|
+
|
|
4890
|
+
// ../common/src/pass-through-tail.ts
|
|
4891
|
+
function maybeOption(arg) {
|
|
4892
|
+
return arg.length > 1 && arg[0] === "-";
|
|
4893
|
+
}
|
|
4894
|
+
function tokenizeTail(cmd, tail) {
|
|
4895
|
+
const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
|
|
4896
|
+
const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
|
|
4897
|
+
const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
|
|
4898
|
+
const tokens = [];
|
|
4899
|
+
let firstUnknown = -1;
|
|
4900
|
+
let sentinel = -1;
|
|
4901
|
+
let variadic;
|
|
4902
|
+
let group;
|
|
4903
|
+
let groupIndex = 0;
|
|
4904
|
+
let i = 0;
|
|
4905
|
+
while (i < tail.length || group !== undefined) {
|
|
4906
|
+
const index = group === undefined ? i : groupIndex;
|
|
4907
|
+
const arg = group ?? tail[i++];
|
|
4908
|
+
group = undefined;
|
|
4909
|
+
if (arg === "--") {
|
|
4910
|
+
sentinel = index;
|
|
4911
|
+
tokens.push({ kind: "sentinel", index });
|
|
4912
|
+
for (let j = i;j < tail.length; j++) {
|
|
4913
|
+
tokens.push({
|
|
4914
|
+
kind: "operand",
|
|
4915
|
+
index: j,
|
|
4916
|
+
text: tail[j],
|
|
4917
|
+
literal: true
|
|
4918
|
+
});
|
|
4919
|
+
}
|
|
4920
|
+
break;
|
|
4921
|
+
}
|
|
4922
|
+
if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
|
|
4923
|
+
tokens.push({
|
|
4924
|
+
kind: "option",
|
|
4925
|
+
index,
|
|
4926
|
+
text: arg,
|
|
4927
|
+
option: variadic,
|
|
4928
|
+
value: arg
|
|
4929
|
+
});
|
|
4930
|
+
continue;
|
|
4931
|
+
}
|
|
4932
|
+
variadic = undefined;
|
|
4933
|
+
if (maybeOption(arg)) {
|
|
4934
|
+
const option = find(arg);
|
|
4935
|
+
if (option) {
|
|
4936
|
+
let value;
|
|
4937
|
+
if (option.required) {
|
|
4938
|
+
value = tail[i];
|
|
4939
|
+
if (value !== undefined)
|
|
4940
|
+
i++;
|
|
4941
|
+
} else if (option.optional) {
|
|
4942
|
+
const next = tail[i];
|
|
4943
|
+
if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
|
|
4944
|
+
value = next;
|
|
4945
|
+
i++;
|
|
4946
|
+
}
|
|
4947
|
+
}
|
|
4948
|
+
tokens.push({
|
|
4949
|
+
kind: "option",
|
|
4950
|
+
index,
|
|
4951
|
+
text: arg,
|
|
4952
|
+
option,
|
|
4953
|
+
...value === undefined ? {} : { value }
|
|
4954
|
+
});
|
|
4955
|
+
variadic = option.variadic ? option : undefined;
|
|
4956
|
+
continue;
|
|
4957
|
+
}
|
|
4958
|
+
}
|
|
4959
|
+
if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
4960
|
+
const option = find(`-${arg[1]}`);
|
|
4961
|
+
if (option) {
|
|
4962
|
+
if (option.required || option.optional) {
|
|
4963
|
+
tokens.push({
|
|
4964
|
+
kind: "option",
|
|
4965
|
+
index,
|
|
4966
|
+
text: arg,
|
|
4967
|
+
option,
|
|
4968
|
+
value: arg.slice(2)
|
|
4969
|
+
});
|
|
4970
|
+
} else {
|
|
4971
|
+
tokens.push({ kind: "option", index, text: arg, option });
|
|
4972
|
+
group = `-${arg.slice(2)}`;
|
|
4973
|
+
groupIndex = index;
|
|
4974
|
+
}
|
|
4975
|
+
continue;
|
|
4976
|
+
}
|
|
4977
|
+
}
|
|
4978
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
4979
|
+
const equals = arg.indexOf("=");
|
|
4980
|
+
const option = find(arg.slice(0, equals));
|
|
4981
|
+
if (option && (option.required || option.optional)) {
|
|
4982
|
+
tokens.push({
|
|
4983
|
+
kind: "option",
|
|
4984
|
+
index,
|
|
4985
|
+
text: arg,
|
|
4986
|
+
option,
|
|
4987
|
+
value: arg.slice(equals + 1)
|
|
4988
|
+
});
|
|
4989
|
+
continue;
|
|
4990
|
+
}
|
|
4991
|
+
}
|
|
4992
|
+
if (maybeOption(arg) && !negativeNumber(arg)) {
|
|
4993
|
+
const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
|
|
4994
|
+
if (firstUnknown === -1)
|
|
4995
|
+
firstUnknown = index;
|
|
4996
|
+
tokens.push({
|
|
4997
|
+
kind: "unknown",
|
|
4998
|
+
index,
|
|
4999
|
+
text: arg,
|
|
5000
|
+
flag: equals > 0 ? arg.slice(0, equals) : arg,
|
|
5001
|
+
...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
|
|
5002
|
+
});
|
|
5003
|
+
continue;
|
|
5004
|
+
}
|
|
5005
|
+
tokens.push({ kind: "operand", index, text: arg, literal: false });
|
|
5006
|
+
}
|
|
5007
|
+
return { tokens, firstUnknown, sentinel };
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
// ../common/src/project-telemetry.ts
|
|
5011
|
+
var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
|
|
5012
|
+
var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
|
|
5013
|
+
var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
|
|
5014
|
+
var RULES = Symbol.for("@uipath/common/projectTargetRules");
|
|
5015
|
+
function logSkipped(what, error) {
|
|
5016
|
+
logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
5017
|
+
}
|
|
5018
|
+
function bounded(work, what) {
|
|
5019
|
+
return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
5020
|
+
}
|
|
5021
|
+
async function identityWithContext(command, identity) {
|
|
5022
|
+
const props = projectIdentityProperties(identity);
|
|
5023
|
+
if (!identity.projectDirectory || isProjectTelemetryDisabled())
|
|
5024
|
+
return props;
|
|
5025
|
+
for (let node = command;node; node = node.parent ?? undefined) {
|
|
5026
|
+
const resolver = node[CONTEXT_RESOLVER];
|
|
5027
|
+
if (typeof resolver !== "function")
|
|
5028
|
+
continue;
|
|
5029
|
+
try {
|
|
5030
|
+
return {
|
|
5031
|
+
...await resolver(identity.projectDirectory),
|
|
5032
|
+
...props
|
|
5033
|
+
};
|
|
5034
|
+
} catch (error) {
|
|
5035
|
+
logSkipped("solution context lookup", error);
|
|
5036
|
+
return props;
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
return props;
|
|
5040
|
+
}
|
|
5041
|
+
function getProjectTelemetryResolver(command) {
|
|
5042
|
+
for (let node = command;node; node = node.parent) {
|
|
5043
|
+
const resolver = node[RESOLVER];
|
|
5044
|
+
if (typeof resolver === "function")
|
|
5045
|
+
return resolver;
|
|
5046
|
+
}
|
|
5047
|
+
return;
|
|
5048
|
+
}
|
|
5049
|
+
function attachProjectTelemetryCapture(command, capture) {
|
|
5050
|
+
command[CAPTURE] = capture;
|
|
5051
|
+
}
|
|
5052
|
+
class ProjectTelemetrySession {
|
|
5053
|
+
resolver;
|
|
5054
|
+
command;
|
|
5055
|
+
target;
|
|
5056
|
+
props = {};
|
|
5057
|
+
explicit = false;
|
|
5058
|
+
input;
|
|
5059
|
+
constructor(resolver, command) {
|
|
5060
|
+
this.resolver = resolver;
|
|
5061
|
+
this.command = command;
|
|
5062
|
+
}
|
|
5063
|
+
async setTarget(path) {
|
|
5064
|
+
this.target = path;
|
|
5065
|
+
if (this.input) {
|
|
5066
|
+
await this.resolve({
|
|
5067
|
+
...this.input,
|
|
5068
|
+
phase: "after",
|
|
5069
|
+
success: true
|
|
5070
|
+
});
|
|
5071
|
+
this.explicit = true;
|
|
4888
5072
|
}
|
|
4889
|
-
success(data);
|
|
4890
5073
|
}
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
const safe = needsAsciiSafeJson(sink) ? escapeNonAscii(json) : json;
|
|
4899
|
-
sink.writeErr(`${safe}
|
|
4900
|
-
`);
|
|
4901
|
-
} else {
|
|
4902
|
-
for (const [key, value] of Object.entries(normalized)) {
|
|
4903
|
-
sink.writeErr(`${key}: ${value}
|
|
4904
|
-
`);
|
|
4905
|
-
}
|
|
5074
|
+
async setIdentity(identity) {
|
|
5075
|
+
try {
|
|
5076
|
+
const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
|
|
5077
|
+
if (props !== undefined)
|
|
5078
|
+
this.setProperties(props);
|
|
5079
|
+
} catch (error) {
|
|
5080
|
+
logSkipped("project identity capture", error);
|
|
4906
5081
|
}
|
|
4907
5082
|
}
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
5083
|
+
setProperties(properties) {
|
|
5084
|
+
try {
|
|
5085
|
+
this.props = { ...properties };
|
|
5086
|
+
this.explicit = true;
|
|
5087
|
+
} catch (error) {
|
|
5088
|
+
logSkipped("project identity properties", error);
|
|
5089
|
+
}
|
|
5090
|
+
}
|
|
5091
|
+
properties() {
|
|
5092
|
+
return { ...this.props };
|
|
5093
|
+
}
|
|
5094
|
+
async resolve(input) {
|
|
5095
|
+
this.input = input;
|
|
5096
|
+
if (this.explicit)
|
|
5097
|
+
return;
|
|
5098
|
+
try {
|
|
5099
|
+
const props = await bounded(this.resolver({
|
|
5100
|
+
...input,
|
|
5101
|
+
target: this.target
|
|
5102
|
+
}), `project identity (${input.phase})`);
|
|
5103
|
+
if (props !== undefined) {
|
|
5104
|
+
this.props = props;
|
|
4922
5105
|
}
|
|
5106
|
+
} catch (error) {
|
|
5107
|
+
logSkipped(`project identity (${input.phase})`, error);
|
|
4923
5108
|
}
|
|
4924
|
-
const output = normalizeOutputKeys(envelope);
|
|
4925
|
-
const lines = [];
|
|
4926
|
-
const sink = getOutputSink();
|
|
4927
|
-
printOutput(output, getOutputFormat(), (msg) => {
|
|
4928
|
-
lines.push(msg);
|
|
4929
|
-
}, needsAsciiSafeJson(sink));
|
|
4930
|
-
return lines.join(`
|
|
4931
|
-
`);
|
|
4932
5109
|
}
|
|
4933
|
-
|
|
4934
|
-
})(OutputFormatter ||= {});
|
|
4935
|
-
|
|
4936
|
-
// ../../node_modules/commander/esm.mjs
|
|
4937
|
-
var import__ = __toESM(require_commander(), 1);
|
|
4938
|
-
var {
|
|
4939
|
-
program,
|
|
4940
|
-
createCommand,
|
|
4941
|
-
createArgument,
|
|
4942
|
-
createOption,
|
|
4943
|
-
CommanderError,
|
|
4944
|
-
InvalidArgumentError,
|
|
4945
|
-
InvalidOptionArgumentError,
|
|
4946
|
-
Command,
|
|
4947
|
-
Argument,
|
|
4948
|
-
Option,
|
|
4949
|
-
Help
|
|
4950
|
-
} = import__.default;
|
|
5110
|
+
}
|
|
4951
5111
|
|
|
4952
5112
|
// ../common/src/telemetry/command-attribution.ts
|
|
4953
5113
|
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
@@ -5193,8 +5353,7 @@ var pollSignalSlot = singleton("PollSignal");
|
|
|
5193
5353
|
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
5194
5354
|
var processContext = {
|
|
5195
5355
|
exit: (code) => {
|
|
5196
|
-
|
|
5197
|
-
setExitCode(code);
|
|
5356
|
+
recordCommandExit(code);
|
|
5198
5357
|
},
|
|
5199
5358
|
get pollSignal() {
|
|
5200
5359
|
return pollSignalSlot.get();
|
|
@@ -5219,6 +5378,8 @@ function recordableArgValue(value, choices) {
|
|
|
5219
5378
|
function extractCommandParams(cmd) {
|
|
5220
5379
|
const params = {};
|
|
5221
5380
|
forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
|
|
5381
|
+
if (name === undefined)
|
|
5382
|
+
return;
|
|
5222
5383
|
const recordable = recordableArgValue(value, choices);
|
|
5223
5384
|
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
|
|
5224
5385
|
});
|
|
@@ -5234,7 +5395,8 @@ function isDefaultedPositional(cmd, index) {
|
|
|
5234
5395
|
function forEachSuppliedArgument(cmd, visit) {
|
|
5235
5396
|
const registered = cmd.registeredArguments ?? [];
|
|
5236
5397
|
const processed = cmd.processedArgs ?? [];
|
|
5237
|
-
|
|
5398
|
+
const bound = boundPositionalCount(cmd);
|
|
5399
|
+
for (let i = 0;i < bound; i++) {
|
|
5238
5400
|
const name = registered[i].name();
|
|
5239
5401
|
if (name && processed[i] !== undefined) {
|
|
5240
5402
|
visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
|
|
@@ -5249,6 +5411,71 @@ function forEachSuppliedArgument(cmd, visit) {
|
|
|
5249
5411
|
visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
|
|
5250
5412
|
}
|
|
5251
5413
|
}
|
|
5414
|
+
forEachPassThroughToken(cmd, bound, (name, value) => {
|
|
5415
|
+
visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
|
|
5416
|
+
});
|
|
5417
|
+
}
|
|
5418
|
+
function boundPositionalCount(cmd) {
|
|
5419
|
+
const registered = cmd.registeredArguments ?? [];
|
|
5420
|
+
if (registered.some((argument) => argument.variadic)) {
|
|
5421
|
+
return registered.length;
|
|
5422
|
+
}
|
|
5423
|
+
if ((cmd.args ?? []).length <= registered.length) {
|
|
5424
|
+
return registered.length;
|
|
5425
|
+
}
|
|
5426
|
+
const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
|
|
5427
|
+
return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
|
|
5428
|
+
}
|
|
5429
|
+
function forEachPassThroughToken(cmd, bound, visit) {
|
|
5430
|
+
const registered = cmd.registeredArguments ?? [];
|
|
5431
|
+
const fillsPositionals = !registered.some((argument) => argument.variadic);
|
|
5432
|
+
const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
|
|
5433
|
+
const repeated = new Map;
|
|
5434
|
+
let nextPositional = bound;
|
|
5435
|
+
for (const token of tokens) {
|
|
5436
|
+
const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
|
|
5437
|
+
if (token.kind === "sentinel")
|
|
5438
|
+
continue;
|
|
5439
|
+
if (token.kind === "operand") {
|
|
5440
|
+
const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
|
|
5441
|
+
const name = claimable ? registered[nextPositional++].name() : undefined;
|
|
5442
|
+
visit(name || undefined, token.text);
|
|
5443
|
+
continue;
|
|
5444
|
+
}
|
|
5445
|
+
if (token.kind === "unknown") {
|
|
5446
|
+
const bare = token.flag.replace(/^-+/, "");
|
|
5447
|
+
const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
5448
|
+
const keyable = token.flag.startsWith("--") || token.flag.length === 2;
|
|
5449
|
+
if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
|
|
5450
|
+
visit(key, token.inlineValue ?? true);
|
|
5451
|
+
} else {
|
|
5452
|
+
visit(undefined, token.text);
|
|
5453
|
+
if (token.inlineValue !== undefined) {
|
|
5454
|
+
visit(undefined, token.inlineValue);
|
|
5455
|
+
} else if (!token.flag.startsWith("--") && token.flag.length > 2) {
|
|
5456
|
+
visit(undefined, token.flag.slice(2));
|
|
5457
|
+
}
|
|
5458
|
+
}
|
|
5459
|
+
continue;
|
|
5460
|
+
}
|
|
5461
|
+
if (pastUnknown) {
|
|
5462
|
+
visit(undefined, token.text);
|
|
5463
|
+
if (token.value !== undefined)
|
|
5464
|
+
visit(undefined, token.value);
|
|
5465
|
+
continue;
|
|
5466
|
+
}
|
|
5467
|
+
const option = token.option;
|
|
5468
|
+
const name = option.attributeName();
|
|
5469
|
+
const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
|
|
5470
|
+
const previous = repeated.get(name);
|
|
5471
|
+
if (previous) {
|
|
5472
|
+
previous.push(value);
|
|
5473
|
+
visit(name, previous);
|
|
5474
|
+
} else {
|
|
5475
|
+
repeated.set(name, [value]);
|
|
5476
|
+
visit(name, value);
|
|
5477
|
+
}
|
|
5478
|
+
}
|
|
5252
5479
|
}
|
|
5253
5480
|
function withheldArgumentValues(cmd) {
|
|
5254
5481
|
const values = [];
|
|
@@ -5310,6 +5537,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5310
5537
|
const telemetryName = commandTelemetryName(commandParts);
|
|
5311
5538
|
const commandPath = commandInvocationPath(commandParts);
|
|
5312
5539
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
5540
|
+
const projectResolver = getProjectTelemetryResolver(command);
|
|
5541
|
+
const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
|
|
5313
5542
|
markCommandStart();
|
|
5314
5543
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
5315
5544
|
try {
|
|
@@ -5317,11 +5546,17 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5317
5546
|
let errorMessage;
|
|
5318
5547
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
5319
5548
|
clearRecordedCommandFailureTelemetry();
|
|
5320
|
-
const [error] = await
|
|
5549
|
+
const [error] = await catchError2(ensureInvocationRequestScope(() => {
|
|
5321
5550
|
const violation = implicitLimitViolation(command);
|
|
5322
5551
|
if (violation) {
|
|
5323
5552
|
return Promise.reject(violation);
|
|
5324
5553
|
}
|
|
5554
|
+
if (projectSession) {
|
|
5555
|
+
return projectSession.resolve({ command, args, phase: "before" }).then(() => {
|
|
5556
|
+
attachProjectTelemetryCapture(command, projectSession);
|
|
5557
|
+
return fn(...args);
|
|
5558
|
+
});
|
|
5559
|
+
}
|
|
5325
5560
|
return fn(...args);
|
|
5326
5561
|
}));
|
|
5327
5562
|
if (error) {
|
|
@@ -5330,22 +5565,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5330
5565
|
const typed = error;
|
|
5331
5566
|
const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
|
|
5332
5567
|
const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
|
|
5333
|
-
const
|
|
5568
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
5569
|
+
const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
|
|
5570
|
+
const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
|
|
5334
5571
|
const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
|
|
5335
5572
|
const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
|
|
5336
5573
|
const typedRetry = typed.retry ?? typed.Retry;
|
|
5337
5574
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
5338
5575
|
const typedContext = typed.context ?? typed.Context;
|
|
5339
5576
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
5340
|
-
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
5341
5577
|
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
5578
|
+
const errorCode = customErrorCode ?? classified?.errorCode;
|
|
5579
|
+
const retry = customRetry ?? classified?.retry;
|
|
5580
|
+
const errorContext = customContext ?? classified?.context;
|
|
5342
5581
|
OutputFormatter.error({
|
|
5343
5582
|
Result: finalResult,
|
|
5344
|
-
...
|
|
5583
|
+
...errorCode ? { ErrorCode: errorCode } : {},
|
|
5345
5584
|
Message: errorMessage,
|
|
5346
5585
|
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
5347
|
-
...
|
|
5348
|
-
...
|
|
5586
|
+
...retry ? { Retry: retry } : {},
|
|
5587
|
+
...errorContext ? { Context: errorContext } : {}
|
|
5349
5588
|
});
|
|
5350
5589
|
context.exit(fallbackExitCode);
|
|
5351
5590
|
}
|
|
@@ -5354,6 +5593,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5354
5593
|
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
5355
5594
|
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
5356
5595
|
const success = !error && exitCode === 0;
|
|
5596
|
+
if (projectSession) {
|
|
5597
|
+
await projectSession.resolve({
|
|
5598
|
+
command,
|
|
5599
|
+
args,
|
|
5600
|
+
phase: "after",
|
|
5601
|
+
success
|
|
5602
|
+
});
|
|
5603
|
+
}
|
|
5357
5604
|
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
5358
5605
|
error,
|
|
5359
5606
|
exitCode,
|
|
@@ -5371,6 +5618,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5371
5618
|
}
|
|
5372
5619
|
const baseProperties = redactProperties({
|
|
5373
5620
|
...commandParams,
|
|
5621
|
+
...projectSession?.properties(),
|
|
5374
5622
|
...props,
|
|
5375
5623
|
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
5376
5624
|
...buildAgentSessionTelemetry(process.env),
|
|
@@ -5381,6 +5629,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5381
5629
|
});
|
|
5382
5630
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
5383
5631
|
} finally {
|
|
5632
|
+
if (projectSession)
|
|
5633
|
+
attachProjectTelemetryCapture(command, undefined);
|
|
5384
5634
|
releaseSuppliedArgumentValues(supplied);
|
|
5385
5635
|
}
|
|
5386
5636
|
});
|
|
@@ -5533,11 +5783,31 @@ function interruptibleSleep(ms, signal) {
|
|
|
5533
5783
|
function sanitizeMaxErrors(value) {
|
|
5534
5784
|
if (value === undefined)
|
|
5535
5785
|
return POLL_DEFAULTS.maxConsecutiveErrors;
|
|
5536
|
-
if (
|
|
5786
|
+
if (value < 0)
|
|
5537
5787
|
return 0;
|
|
5538
5788
|
return Math.floor(value);
|
|
5539
5789
|
}
|
|
5790
|
+
function requireFinite(value, field) {
|
|
5791
|
+
if (value !== undefined && !Number.isFinite(value)) {
|
|
5792
|
+
throw new RangeError(`pollUntil: ${field} must be a finite number, got ${String(value)}.`);
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
function assertFiniteSettings(options) {
|
|
5796
|
+
requireFinite(options.timeoutMs, "timeoutMs");
|
|
5797
|
+
if (typeof options.intervalMs === "number") {
|
|
5798
|
+
requireFinite(options.intervalMs, "intervalMs");
|
|
5799
|
+
}
|
|
5800
|
+
requireFinite(options.maxConsecutiveErrors, "maxConsecutiveErrors");
|
|
5801
|
+
requireFinite(options.logIntervalMs, "logIntervalMs");
|
|
5802
|
+
if (typeof options.backoff === "object" && options.backoff !== null) {
|
|
5803
|
+
requireFinite(options.backoff.initialMs, "backoff.initialMs");
|
|
5804
|
+
requireFinite(options.backoff.multiplier, "backoff.multiplier");
|
|
5805
|
+
requireFinite(options.backoff.maxMs, "backoff.maxMs");
|
|
5806
|
+
requireFinite(options.backoff.jitter, "backoff.jitter");
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5540
5809
|
function resolveConfig(options) {
|
|
5810
|
+
assertFiniteSettings(options);
|
|
5541
5811
|
const timeoutMs = Math.max(0, options.timeoutMs ?? POLL_DEFAULTS.timeoutMs);
|
|
5542
5812
|
const startTime = Date.now();
|
|
5543
5813
|
return {
|
|
@@ -5584,7 +5854,7 @@ async function handlePollError(error, errorSource, cfg, state) {
|
|
|
5584
5854
|
state.consecutiveErrors++;
|
|
5585
5855
|
const onError = cfg.onError;
|
|
5586
5856
|
if (onError) {
|
|
5587
|
-
const [callbackErr, decision] = await
|
|
5857
|
+
const [callbackErr, decision] = await catchError2(Promise.resolve().then(() => onError(error, state.consecutiveErrors)));
|
|
5588
5858
|
if (callbackErr) {
|
|
5589
5859
|
if (cfg.label) {
|
|
5590
5860
|
logger.warn(`[${cfg.logPrefix}] ${cfg.label} — onError callback threw: ${callbackErr.message}`);
|
|
@@ -5621,7 +5891,7 @@ function computeErrorSleepMs(cfg, state, ctx) {
|
|
|
5621
5891
|
}
|
|
5622
5892
|
async function doSleep(ms, cfg) {
|
|
5623
5893
|
if (ms > 0) {
|
|
5624
|
-
const [err] = await
|
|
5894
|
+
const [err] = await catchError2(interruptibleSleep(ms, cfg.signal));
|
|
5625
5895
|
if (err) {
|
|
5626
5896
|
if (isAbortError(err))
|
|
5627
5897
|
return;
|
|
@@ -5635,7 +5905,7 @@ function isAbortError(err) {
|
|
|
5635
5905
|
return err.name === "AbortError";
|
|
5636
5906
|
}
|
|
5637
5907
|
async function safeCallback(label, name, fn, prefix) {
|
|
5638
|
-
const [err] = await
|
|
5908
|
+
const [err] = await catchError2(Promise.resolve().then(() => fn()));
|
|
5639
5909
|
if (err && label) {
|
|
5640
5910
|
logger.warn(`[${prefix}] ${label} — ${name} callback threw: ${err.message}`);
|
|
5641
5911
|
}
|
|
@@ -5647,7 +5917,7 @@ async function processSuccessfulPoll(result, cfg, state) {
|
|
|
5647
5917
|
}
|
|
5648
5918
|
if (cfg.getStatus) {
|
|
5649
5919
|
const getStatus = cfg.getStatus;
|
|
5650
|
-
const [statusErr, newStatus] =
|
|
5920
|
+
const [statusErr, newStatus] = catchError2(() => getStatus(result));
|
|
5651
5921
|
if (statusErr) {
|
|
5652
5922
|
if (cfg.label) {
|
|
5653
5923
|
logger.warn(`[${cfg.logPrefix}] ${cfg.label} — getStatus threw: ${statusErr.message}`);
|
|
@@ -5686,7 +5956,7 @@ async function handleCompleted(result, cfg) {
|
|
|
5686
5956
|
let statusStr = "";
|
|
5687
5957
|
if (cfg.getStatus) {
|
|
5688
5958
|
const getStatus = cfg.getStatus;
|
|
5689
|
-
const [, status] =
|
|
5959
|
+
const [, status] = catchError2(() => getStatus(result));
|
|
5690
5960
|
if (status != null)
|
|
5691
5961
|
statusStr = ` ${status}`;
|
|
5692
5962
|
}
|
|
@@ -5749,7 +6019,7 @@ function logStart(options, cfg) {
|
|
|
5749
6019
|
if (typeof options.intervalMs === "function") {
|
|
5750
6020
|
intervalDesc = "dynamic";
|
|
5751
6021
|
} else {
|
|
5752
|
-
const [intervalErr, intervalVal] =
|
|
6022
|
+
const [intervalErr, intervalVal] = catchError2(() => cfg.getInterval({ pollCount: 0, elapsedMs: 0 }));
|
|
5753
6023
|
intervalDesc = intervalErr ? "dynamic" : `${intervalVal}ms`;
|
|
5754
6024
|
}
|
|
5755
6025
|
const backoffDesc = options.backoff ? ", error backoff enabled" : "";
|
|
@@ -5787,7 +6057,7 @@ async function runPollLoop(cfg, state) {
|
|
|
5787
6057
|
}
|
|
5788
6058
|
const ctx = buildContext(cfg, state);
|
|
5789
6059
|
if (cfg.beforePoll) {
|
|
5790
|
-
const [beforePollErr] = await
|
|
6060
|
+
const [beforePollErr] = await catchError2(Promise.resolve().then(() => cfg.beforePoll?.(ctx)));
|
|
5791
6061
|
if (beforePollErr) {
|
|
5792
6062
|
const outcome = await handleErrorAndSleep(beforePollErr, "beforePoll", cfg, state, ctx);
|
|
5793
6063
|
if (outcome)
|
|
@@ -5795,7 +6065,7 @@ async function runPollLoop(cfg, state) {
|
|
|
5795
6065
|
continue;
|
|
5796
6066
|
}
|
|
5797
6067
|
}
|
|
5798
|
-
const [pollErr, result] = await
|
|
6068
|
+
const [pollErr, result] = await catchError2(cfg.fn());
|
|
5799
6069
|
if (pollErr) {
|
|
5800
6070
|
const outcome = await handleErrorAndSleep(pollErr, "poll", cfg, state, ctx);
|
|
5801
6071
|
if (outcome)
|
|
@@ -5803,7 +6073,7 @@ async function runPollLoop(cfg, state) {
|
|
|
5803
6073
|
continue;
|
|
5804
6074
|
}
|
|
5805
6075
|
await processSuccessfulPoll(result, cfg, state);
|
|
5806
|
-
const [untilErr, isTerminal] =
|
|
6076
|
+
const [untilErr, isTerminal] = catchError2(() => cfg.until(result));
|
|
5807
6077
|
if (untilErr) {
|
|
5808
6078
|
const outcome = await handleErrorAndSleep(untilErr, "until", cfg, state, ctx);
|
|
5809
6079
|
if (outcome)
|
|
@@ -5876,7 +6146,7 @@ function quoteForShell(value) {
|
|
|
5876
6146
|
}
|
|
5877
6147
|
|
|
5878
6148
|
// ../common/src/stdin.ts
|
|
5879
|
-
async function
|
|
6149
|
+
async function readStdin2() {
|
|
5880
6150
|
if (process.stdin.isTTY) {
|
|
5881
6151
|
return null;
|
|
5882
6152
|
}
|
|
@@ -5891,31 +6161,6 @@ async function readStdin() {
|
|
|
5891
6161
|
});
|
|
5892
6162
|
}
|
|
5893
6163
|
|
|
5894
|
-
// ../common/src/telemetry/console-telemetry-provider.ts
|
|
5895
|
-
class ConsoleTelemetryProvider {
|
|
5896
|
-
async trackEvent({ name }) {
|
|
5897
|
-
console.debug(`[Telemetry] Event: ${name}`);
|
|
5898
|
-
}
|
|
5899
|
-
async trackException({ error }) {
|
|
5900
|
-
console.error(`[Telemetry] Exception: ${error.message}`);
|
|
5901
|
-
}
|
|
5902
|
-
async trackRequest({
|
|
5903
|
-
name,
|
|
5904
|
-
durationMs,
|
|
5905
|
-
success
|
|
5906
|
-
}) {
|
|
5907
|
-
console.debug(`[Telemetry] Request: ${name} (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
5908
|
-
}
|
|
5909
|
-
async trackDependency({
|
|
5910
|
-
name,
|
|
5911
|
-
type,
|
|
5912
|
-
durationMs,
|
|
5913
|
-
success
|
|
5914
|
-
}) {
|
|
5915
|
-
console.debug(`[Telemetry] Dependency: ${name} [${type}] (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
5916
|
-
}
|
|
5917
|
-
}
|
|
5918
|
-
|
|
5919
6164
|
// ../common/src/attachment-binding.ts
|
|
5920
6165
|
function appendOption(value, previous) {
|
|
5921
6166
|
return [...previous ?? [], value];
|
|
@@ -5959,56 +6204,6 @@ async function resolveAttachmentInputs(specs, upload) {
|
|
|
5959
6204
|
return { name: p.name, path: p.path, reference };
|
|
5960
6205
|
}));
|
|
5961
6206
|
}
|
|
5962
|
-
// ../common/src/classified-failure.ts
|
|
5963
|
-
var MAX_QUOTED_BODY_CHARS = 200;
|
|
5964
|
-
function summarizePlatformBody(body) {
|
|
5965
|
-
const trimmed = body.trim().replace(/\s+/g, " ");
|
|
5966
|
-
return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
|
|
5967
|
-
}
|
|
5968
|
-
// ../common/src/command-examples.ts
|
|
5969
|
-
var examplesByCommand = new WeakMap;
|
|
5970
|
-
Command.prototype.examples = function(examples) {
|
|
5971
|
-
examplesByCommand.set(this, examples);
|
|
5972
|
-
return this;
|
|
5973
|
-
};
|
|
5974
|
-
// ../common/src/preview.ts
|
|
5975
|
-
var previewSlot = singleton("PreviewBuild");
|
|
5976
|
-
function isPreviewBuild() {
|
|
5977
|
-
return previewSlot.get(false) ?? false;
|
|
5978
|
-
}
|
|
5979
|
-
Command.prototype.previewCommand = function(nameAndArgs, opts) {
|
|
5980
|
-
if (isPreviewBuild()) {
|
|
5981
|
-
return this.command(nameAndArgs, opts);
|
|
5982
|
-
}
|
|
5983
|
-
return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
|
|
5984
|
-
};
|
|
5985
|
-
// ../common/src/completer.ts
|
|
5986
|
-
var COMPLETER_SYMBOL = Symbol.for("@uipath/common/completer");
|
|
5987
|
-
// ../common/src/console-guard.ts
|
|
5988
|
-
var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
5989
|
-
var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
5990
|
-
// ../common/src/constants.ts
|
|
5991
|
-
var UIPATH_HOME_DIR = ".uipath";
|
|
5992
|
-
var DEFAULT_PAGE_SIZE = 50;
|
|
5993
|
-
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
5994
|
-
// ../common/src/content-hash.ts
|
|
5995
|
-
function isBrowserRuntime() {
|
|
5996
|
-
const runtime = globalThis;
|
|
5997
|
-
return typeof runtime.window !== "undefined" && typeof runtime.document !== "undefined";
|
|
5998
|
-
}
|
|
5999
|
-
async function hashContent(content) {
|
|
6000
|
-
const encoder = new TextEncoder;
|
|
6001
|
-
const bytes = encoder.encode(content);
|
|
6002
|
-
if (globalThis.crypto?.subtle) {
|
|
6003
|
-
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
6004
|
-
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
6005
|
-
}
|
|
6006
|
-
if (!isBrowserRuntime()) {
|
|
6007
|
-
const crypto2 = await import("node:crypto");
|
|
6008
|
-
return crypto2.createHash("sha256").update(content, "utf-8").digest("hex");
|
|
6009
|
-
}
|
|
6010
|
-
throw new Error("Unable to compute SHA-256 hash in this environment.");
|
|
6011
|
-
}
|
|
6012
6207
|
// ../common/src/error-instructions.ts
|
|
6013
6208
|
function extractHttpStatus(err) {
|
|
6014
6209
|
if (!err || typeof err !== "object")
|
|
@@ -6020,10 +6215,18 @@ function extractHttpStatus(err) {
|
|
|
6020
6215
|
return typeof e.message === "string" ? parseHttpStatusFromMessage(e.message) : undefined;
|
|
6021
6216
|
}
|
|
6022
6217
|
var GENERIC = "Check authentication and parameters";
|
|
6218
|
+
function hasIdentityInstructionContext(err) {
|
|
6219
|
+
return err !== null && typeof err === "object" && "instructionContext" in err && err.instructionContext === "identity";
|
|
6220
|
+
}
|
|
6023
6221
|
function instructionsFor(ctx, err) {
|
|
6222
|
+
if (ctx === "auth" && hasIdentityInstructionContext(err)) {
|
|
6223
|
+
return instructionsFor("identity");
|
|
6224
|
+
}
|
|
6024
6225
|
switch (ctx) {
|
|
6025
6226
|
case "auth":
|
|
6026
6227
|
return "Run 'uip login' to authenticate. To inspect the current session, run 'uip whoami'.";
|
|
6228
|
+
case "auth-configuration":
|
|
6229
|
+
return "Fix the authentication settings named in Message, then retry.";
|
|
6027
6230
|
case "identity":
|
|
6028
6231
|
return "Select an active tenant with 'uip login tenant set <tenant>' and ensure your login includes an organization";
|
|
6029
6232
|
case "input-parse":
|
|
@@ -6078,6 +6281,80 @@ function instructionsFor(ctx, err) {
|
|
|
6078
6281
|
}
|
|
6079
6282
|
}
|
|
6080
6283
|
}
|
|
6284
|
+
|
|
6285
|
+
// ../common/src/classified-failure.ts
|
|
6286
|
+
var MAX_QUOTED_BODY_CHARS = 200;
|
|
6287
|
+
async function classifiedFailure(message, error) {
|
|
6288
|
+
const details = await extractErrorDetails(error);
|
|
6289
|
+
return {
|
|
6290
|
+
Result: details.result,
|
|
6291
|
+
ErrorCode: details.errorCode,
|
|
6292
|
+
Message: message,
|
|
6293
|
+
Instructions: details.message,
|
|
6294
|
+
Retry: details.retry,
|
|
6295
|
+
...details.context ? { Context: details.context } : {}
|
|
6296
|
+
};
|
|
6297
|
+
}
|
|
6298
|
+
async function authContextFailure(error, sessionInstructions) {
|
|
6299
|
+
const details = await extractErrorDetails(error);
|
|
6300
|
+
const missingIdentity = hasIdentityInstructionContext(error);
|
|
6301
|
+
return {
|
|
6302
|
+
Result: details.errorCode === "configuration_error" ? RESULTS.ConfigError : details.errorCode === "authentication_required" ? RESULTS.AuthenticationError : details.result,
|
|
6303
|
+
ErrorCode: details.errorCode,
|
|
6304
|
+
Message: details.message,
|
|
6305
|
+
Instructions: details.errorCode === "configuration_error" ? instructionsFor("auth-configuration") : details.errorCode === "authentication_required" && !missingIdentity && sessionInstructions !== undefined ? sessionInstructions : instructionsFor(details.errorCode === "authentication_required" ? "auth" : "backend", error),
|
|
6306
|
+
Retry: details.retry,
|
|
6307
|
+
...details.context ? { Context: details.context } : {}
|
|
6308
|
+
};
|
|
6309
|
+
}
|
|
6310
|
+
function summarizePlatformBody(body) {
|
|
6311
|
+
const trimmed = body.trim().replace(/\s+/g, " ");
|
|
6312
|
+
return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
|
|
6313
|
+
}
|
|
6314
|
+
// ../common/src/command-examples.ts
|
|
6315
|
+
var examplesByCommand = new WeakMap;
|
|
6316
|
+
Command.prototype.examples = function(examples) {
|
|
6317
|
+
examplesByCommand.set(this, examples);
|
|
6318
|
+
return this;
|
|
6319
|
+
};
|
|
6320
|
+
// ../common/src/preview.ts
|
|
6321
|
+
var previewSlot = singleton("PreviewBuild");
|
|
6322
|
+
function isPreviewBuild() {
|
|
6323
|
+
return previewSlot.get(false) ?? false;
|
|
6324
|
+
}
|
|
6325
|
+
Command.prototype.previewCommand = function(nameAndArgs, opts) {
|
|
6326
|
+
if (isPreviewBuild()) {
|
|
6327
|
+
return this.command(nameAndArgs, opts);
|
|
6328
|
+
}
|
|
6329
|
+
return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
|
|
6330
|
+
};
|
|
6331
|
+
// ../common/src/completer.ts
|
|
6332
|
+
var COMPLETER_SYMBOL = Symbol.for("@uipath/common/completer");
|
|
6333
|
+
// ../common/src/console-guard.ts
|
|
6334
|
+
var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
6335
|
+
var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
6336
|
+
// ../common/src/constants.ts
|
|
6337
|
+
var UIPATH_HOME_DIR2 = ".uipath";
|
|
6338
|
+
var DEFAULT_PAGE_SIZE = 50;
|
|
6339
|
+
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
6340
|
+
// ../common/src/content-hash.ts
|
|
6341
|
+
function isBrowserRuntime() {
|
|
6342
|
+
const runtime = globalThis;
|
|
6343
|
+
return typeof runtime.window !== "undefined" && typeof runtime.document !== "undefined";
|
|
6344
|
+
}
|
|
6345
|
+
async function hashContent(content) {
|
|
6346
|
+
const encoder = new TextEncoder;
|
|
6347
|
+
const bytes = encoder.encode(content);
|
|
6348
|
+
if (globalThis.crypto?.subtle) {
|
|
6349
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
6350
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
6351
|
+
}
|
|
6352
|
+
if (!isBrowserRuntime()) {
|
|
6353
|
+
const crypto2 = await import("node:crypto");
|
|
6354
|
+
return crypto2.createHash("sha256").update(content, "utf-8").digest("hex");
|
|
6355
|
+
}
|
|
6356
|
+
throw new Error("Unable to compute SHA-256 hash in this environment.");
|
|
6357
|
+
}
|
|
6081
6358
|
// ../common/src/guid.ts
|
|
6082
6359
|
var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
6083
6360
|
function isGuid(value) {
|
|
@@ -6098,16 +6375,6 @@ var HOST_GLOBAL_FLAGS = [
|
|
|
6098
6375
|
];
|
|
6099
6376
|
var VALUE_OPTIONS = new Set(HOST_GLOBAL_OPTIONS_WITH_VALUE);
|
|
6100
6377
|
var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
|
|
6101
|
-
// ../common/src/http-status.ts
|
|
6102
|
-
function httpStatusOf(error) {
|
|
6103
|
-
if (!error || typeof error !== "object") {
|
|
6104
|
-
return;
|
|
6105
|
-
}
|
|
6106
|
-
if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
|
|
6107
|
-
return error.response.status;
|
|
6108
|
-
}
|
|
6109
|
-
return "status" in error && typeof error.status === "number" ? error.status : undefined;
|
|
6110
|
-
}
|
|
6111
6378
|
// ../common/src/interactivity-context.ts
|
|
6112
6379
|
var modeSlot = singleton("InteractivityMode");
|
|
6113
6380
|
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
@@ -6154,6 +6421,37 @@ function mimeTypeForFileName(fileName) {
|
|
|
6154
6421
|
const extension = fileName.slice(dot + 1).toLowerCase();
|
|
6155
6422
|
return Object.hasOwn(MIME_TYPES_BY_EXTENSION, extension) ? MIME_TYPES_BY_EXTENSION[extension] : OCTET_STREAM;
|
|
6156
6423
|
}
|
|
6424
|
+
// ../common/src/named-second.ts
|
|
6425
|
+
function namedOrLegacy(spec) {
|
|
6426
|
+
if (spec.named !== undefined && spec.legacy !== undefined) {
|
|
6427
|
+
usageError(`pass ${spec.flag} or a second argument, not both`, spec.usage);
|
|
6428
|
+
}
|
|
6429
|
+
if (spec.named === "") {
|
|
6430
|
+
usageError(`option '${spec.flag}' argument missing`, spec.usage);
|
|
6431
|
+
}
|
|
6432
|
+
if (spec.named !== undefined)
|
|
6433
|
+
return spec.named;
|
|
6434
|
+
if (spec.legacy === undefined) {
|
|
6435
|
+
usageError(`required option '${spec.flag}' not specified`, spec.usage);
|
|
6436
|
+
}
|
|
6437
|
+
getOutputSink().writeErr(`[WARN] The two-argument form is deprecated. Use \`${spec.usage}\` instead.
|
|
6438
|
+
`);
|
|
6439
|
+
return spec.legacy;
|
|
6440
|
+
}
|
|
6441
|
+
function legacySecondArg(args, usage) {
|
|
6442
|
+
if (args.length > 2) {
|
|
6443
|
+
usageError(`unexpected argument '${args[2]}'`, usage);
|
|
6444
|
+
}
|
|
6445
|
+
return args[1];
|
|
6446
|
+
}
|
|
6447
|
+
function usageError(message, usage) {
|
|
6448
|
+
throw Object.assign(new Error(message), {
|
|
6449
|
+
result: RESULTS.ValidationError,
|
|
6450
|
+
errorCode: "invalid_argument",
|
|
6451
|
+
retry: "RetryWillNotFix",
|
|
6452
|
+
instructions: `Usage: ${usage}`
|
|
6453
|
+
});
|
|
6454
|
+
}
|
|
6157
6455
|
// ../common/src/option-aliases.ts
|
|
6158
6456
|
function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
|
|
6159
6457
|
getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
|
|
@@ -6354,18 +6652,43 @@ function withPseudonymizedIdentifiers(payload) {
|
|
|
6354
6652
|
}
|
|
6355
6653
|
};
|
|
6356
6654
|
}
|
|
6357
|
-
function
|
|
6655
|
+
function identityKeysOf(capture) {
|
|
6656
|
+
if (!capture) {
|
|
6657
|
+
return {};
|
|
6658
|
+
}
|
|
6659
|
+
try {
|
|
6660
|
+
const properties = capture.properties?.();
|
|
6661
|
+
if (typeof properties !== "object" || properties === null) {
|
|
6662
|
+
return {};
|
|
6663
|
+
}
|
|
6664
|
+
const keys = {};
|
|
6665
|
+
for (const key of GUID_KEY_DIMENSIONS) {
|
|
6666
|
+
const value = properties[key];
|
|
6667
|
+
if (value !== undefined) {
|
|
6668
|
+
keys[key] = value;
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6671
|
+
return keys;
|
|
6672
|
+
} catch (error) {
|
|
6673
|
+
logSkipped("ship identity", error);
|
|
6674
|
+
return {};
|
|
6675
|
+
}
|
|
6676
|
+
}
|
|
6677
|
+
function trackShipSucceeded(payload, capture) {
|
|
6358
6678
|
const keys = getShippedKeys();
|
|
6359
6679
|
const key = dedupeKey(payload);
|
|
6360
6680
|
if (keys.has(key)) {
|
|
6361
6681
|
return false;
|
|
6362
6682
|
}
|
|
6363
6683
|
keys.add(key);
|
|
6364
|
-
telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties(
|
|
6684
|
+
telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties({
|
|
6685
|
+
...withPseudonymizedIdentifiers(payload),
|
|
6686
|
+
...identityKeysOf(capture)
|
|
6687
|
+
}));
|
|
6365
6688
|
return true;
|
|
6366
6689
|
}
|
|
6367
6690
|
// ../common/src/tool-provider.ts
|
|
6368
6691
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
6369
|
-
export { carriedInstructions, extractErrorMessage, extractErrorMessageSync, appendOption, ATTACHMENT_INSTRUCTIONS, ATTACHMENT_UPLOAD_INSTRUCTIONS, parseAttachmentSpec, resolveAttachmentInputs,
|
|
6692
|
+
export { carriedErrorCode, httpStatusOf, carriedInstructions, classifyThrownError, extractErrorDetails, extractErrorMessage, extractErrorMessageSync, appendOption, ATTACHMENT_INSTRUCTIONS, ATTACHMENT_UPLOAD_INSTRUCTIONS, parseAttachmentSpec, resolveAttachmentInputs, instructionsFor, RESULTS, classifiedFailure, authContextFailure, summarizePlatformBody, InvalidArgumentError, Command, Option, getOutputSink, logger, DebugTelemetryProvider, NodeContextStorage, TelemetryService, isProjectTelemetryDisabled, EXIT_CODES, Pagination, apiPagination, pascalCaseDataKeys, OutputFormatter, tokenizeTail, processContext, UIPATH_HOME_DIR2, DEFAULT_PAGE_SIZE, hashContent, isGuid, mimeTypeForFileName, namedOrLegacy, legacySecondArg, usageError, addDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, msToDuration, PollOutcome, ErrorDecision, MIN_INTERVAL_MS, pollUntil, isTerminalStatus, isFailureStatus, ScreenLogger, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType, readStdin2, splitPackagedName, trackShipSucceeded };
|
|
6370
6693
|
|
|
6371
|
-
//# debugId=
|
|
6694
|
+
//# debugId=E654BD1286F9BBEA64756E2164756E21
|