@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.
Files changed (350) hide show
  1. package/README.md +14 -12
  2. package/dist/THIRD-PARTY-NOTICES.md +77 -49
  3. package/dist/applicationinsights-web-8m26566f.js +17209 -0
  4. package/dist/authoring-x84r2a2j.js +23 -0
  5. package/dist/binding-service-s0wvr2xm.js +114 -0
  6. package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-gnftxwsf.js} +5 -6
  7. package/dist/connector-library-1yw5r47w.js +99 -0
  8. package/dist/{connector-service-m08dysc2.js → connector-service-r86mtxwn.js} +270 -275
  9. package/dist/{conversion-FQTRFHRX-e5wr281j.js → conversion-7O2PDOQB-3wwppx87.js} +477 -472
  10. package/dist/{de-FGHEJRCI-PK6WALXW-0dnvnmke.js → de-2BEKRUMY-MD7L477H-rj1rmtav.js} +425 -37
  11. package/dist/{de-WLW6KWOJ-2qnsqdtw.js → de-2BEKRUMY-x4dx0nn9.js} +190 -10
  12. package/dist/{de-VMMG2MN7-2ecwpg1b.js → de-3CU65EDB-r7r10am9.js} +82 -7
  13. package/dist/{de-UZI7FJDO-awjpqfz0.js → de-AI7ML6JM-km47f8k4.js} +20 -5
  14. package/dist/{de-B3EKCNFC-zdwybhh7.js → de-VQWT6L5Y-mch4qwyv.js} +38 -5
  15. package/dist/{de-XNTCMP5Z-xfkfqg20.js → de-XNTCMP5Z-nd4scb43.js} +1 -4
  16. package/dist/debug-conversation-trigger-3wzy90kj.js +23 -0
  17. package/dist/debug-http-client-zydr7tna.js +31 -0
  18. package/dist/debug-service-hdktqeek.js +60 -0
  19. package/dist/edge-service-zck3s9ss.js +267 -0
  20. package/dist/{elk.bundled-vpsbxz0p.js → elk.bundled-phy0zc81.js} +6860 -6860
  21. package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
  22. package/dist/en-LAVDF7IQ-ba7wzsxp.js +254 -0
  23. package/dist/en-LQHKFSEY-zf6a2myg.js +24 -0
  24. package/dist/en-U2NSIIZN-whenw6wh.js +58 -0
  25. package/dist/en-WPCQ4JKF-t3x07ggr.js +148 -0
  26. package/dist/en-X6T4SP2Y-FPGCJIFV-qdfapfzs.js +2756 -0
  27. package/dist/en-X6T4SP2Y-xe57av1w.js +2752 -0
  28. package/dist/{es-5THCNRFN-tqwyrdgy.js → es-7ZTQTGKN-11sj0yjx.js} +190 -10
  29. package/dist/{es-KR3ZSNMP-QLWVVWKJ-5egs0gj9.js → es-7ZTQTGKN-TXQBFYRA-bzh1e1gq.js} +422 -34
  30. package/dist/{es-EKHIPSW6-ya88nvm0.js → es-EKHIPSW6-asfceac2.js} +1 -4
  31. package/dist/{es-KEBF3AIM-g5rszh8f.js → es-EP563JWQ-1agj5n4e.js} +38 -5
  32. package/dist/{es-WY6FZ3HO-zksnn6dp.js → es-KHVY67FO-natcvmmm.js} +82 -7
  33. package/dist/{es-MX-5RELIXKI-jtjbcxbb.js → es-MX-7KJZPEQN-1fq0a9jr.js} +20 -5
  34. package/dist/{es-MX-ZP2LJ3V7-k4brnfa9.js → es-MX-F7ZEHSNE-gxpm47vv.js} +82 -7
  35. package/dist/{es-MX-XXZJGC4R-W6EEIHXR-c2m4yjpj.js → es-MX-IHGRIEWH-23X37OPS-7cqdzpcy.js} +425 -37
  36. package/dist/{es-MX-TWZBRAXK-gqd9swzw.js → es-MX-IHGRIEWH-g63p0gb4.js} +191 -11
  37. package/dist/{es-MX-OR6G2SFR-7yykk5ma.js → es-MX-OR6G2SFR-02t13sen.js} +1 -4
  38. package/dist/{es-MX-EL3CDS3F-sh84yvjr.js → es-MX-S2RFDGDE-x9r0tv30.js} +38 -5
  39. package/dist/{es-4UBUTCQA-t7hsackg.js → es-SPNKTD5Y-vw5cbgv5.js} +20 -5
  40. package/dist/filter-engine-dh9s90gb.js +10 -0
  41. package/dist/first-party-service-ahcc6xc6.js +8 -0
  42. package/dist/flow-api-d4dvmadm.js +38 -0
  43. package/dist/{flow-debug-service-gc2ky1ve.js → flow-debug-service-hy21ddd9.js} +151 -195
  44. package/dist/flow-eval-node-target-tdrwqca7.js +29 -0
  45. package/dist/flow-eval-run-api-w4j8ra60.js +9 -0
  46. package/dist/{flow-eval-run-service-2cbr0jtw.js → flow-eval-run-service-5en4ahyn.js} +125 -149
  47. package/dist/{flow-eval-service-24jbkhhz.js → flow-eval-service-2j28ect1.js} +57 -81
  48. package/dist/{flow-init-sdk-source-xvdvkq7d.js → flow-init-sdk-source-xnr4bg25.js} +8 -11
  49. package/dist/flow-init-service-bj3ev9bz.js +26 -0
  50. package/dist/flow-io-9q6xk473.js +24 -0
  51. package/dist/{flow-migrate-service-t3pnd2r3.js → flow-migrate-service-dkx85jj5.js} +33 -54
  52. package/dist/{flow-pack-service-b910q207.js → flow-pack-service-58m51sp8.js} +79 -103
  53. package/dist/flow-validate-service-9a3zate4.js +46 -0
  54. package/dist/{fr-DPD4GHX3-exeypjwk.js → fr-7LK3QUWT-a94yejcs.js} +38 -5
  55. package/dist/{fr-Y6NPVODW-AS7T42TR-v4qe2tha.js → fr-7ZDL4MVO-CXMRZDOF-qjkg6y2r.js} +425 -37
  56. package/dist/{fr-CERONSRC-edpxhbmb.js → fr-7ZDL4MVO-pd27vwh6.js} +191 -11
  57. package/dist/{fr-VBM5WRC2-707ha692.js → fr-AXJGUT53-hdg3pmd4.js} +20 -5
  58. package/dist/{fr-PRMYCRDC-0bk078by.js → fr-I42FODC5-p80x5v4b.js} +83 -8
  59. package/dist/{fr-IHD66TVT-vfvmefbx.js → fr-IHD66TVT-eq8h0d6c.js} +1 -4
  60. package/dist/{governance-fetcher-ffvbtwbd.js → governance-fetcher-h8hpcwyh.js} +17 -21
  61. package/dist/{headless-4x4v3sy6.js → headless-41t9wwb7.js} +2395 -43269
  62. package/dist/{hitl-service-3m4ce3mt.js → hitl-service-hccqhm63.js} +22 -42
  63. package/dist/index-4e3w8x62.js +31 -0
  64. package/dist/{index-fyc0k5dd.js → index-5pzp2qeb.js} +5350 -3271
  65. package/dist/index-5xh0cjag.js +82 -0
  66. package/dist/index-7fet3f0s.js +10 -0
  67. package/dist/index-d4bdedx3.js +32 -0
  68. package/dist/index-f5kq7265.js +24 -0
  69. package/dist/index-g2p2ww34.js +39 -0
  70. package/dist/index-ng011fzs.js +974 -0
  71. package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
  72. package/dist/{index-1b2je9n2.js → index-px95xmkg.js} +290 -268
  73. package/dist/index-tdwpejt6.js +22 -0
  74. package/dist/index-z2qk2qn6.js +24 -0
  75. package/dist/index.js +19 -28
  76. package/dist/index.umd.min-ttg1qc0x.js +7814 -0
  77. package/dist/init.js +22 -43
  78. package/dist/inline-entity-resolver-0neh2b43.js +25 -0
  79. package/dist/input-reader-zqaep7k7.js +11 -0
  80. package/dist/{ja-43QL7CGO-c3q8gre9.js → ja-C7GZV6YP-hvtbngr5.js} +20 -5
  81. package/dist/{ja-HFEQKCZF-hb2f25p8.js → ja-GI3OUHPZ-28fy60r0.js} +83 -8
  82. package/dist/{ja-JE5ZL7EY-hacj2m31.js → ja-JE5ZL7EY-607k4c7p.js} +1 -4
  83. package/dist/{ja-Q5PXKJ2V-BR5GRIDQ-fgqqpryf.js → ja-LGAM5HKR-NTPKIZEM-nv67917s.js} +422 -34
  84. package/dist/{ja-U2MCNHGT-gz0ap1jk.js → ja-LGAM5HKR-sgrtjqjh.js} +190 -10
  85. package/dist/ja-WY2W6733-ayr36h1f.js +71 -0
  86. package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
  87. package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
  88. package/dist/known-types-v9sxcq1c.js +13 -0
  89. package/dist/{ko-AYBDSRZG-G43C3XUW-kng13fsg.js → ko-7B4SUZB7-2SLI636D-grbtfrcv.js} +424 -36
  90. package/dist/{ko-XAUYQWDR-zp81gjp4.js → ko-7B4SUZB7-c8wr20sc.js} +190 -10
  91. package/dist/{ko-DJJRKCG5-5h3k9csc.js → ko-DJJRKCG5-4fekzjn4.js} +1 -4
  92. package/dist/{ko-LA5OSS5P-mq5h8sbk.js → ko-H2RGQWKJ-9696w762.js} +38 -5
  93. package/dist/{ko-TLL6Z6CD-wrt3n8a9.js → ko-Q24HSSL4-5vn55pte.js} +20 -5
  94. package/dist/{ko-B4SEC7QX-thq2wt6a.js → ko-RYKAL74T-10m4z8vw.js} +83 -8
  95. package/dist/localization-skqjy9nr.js +45 -0
  96. package/dist/maestro-automate-entry-d1v5q5mv.js +14 -0
  97. package/dist/{node-xqc0h091.js → node-0jy3qx5b.js} +69 -638
  98. package/dist/node-service-2nxpk751.js +64 -0
  99. package/dist/{node-strategy-1dmmhvf3.js → node-strategy-wrjxmbzt.js} +9 -12
  100. package/dist/node-sync-service-68vq10je.js +56 -0
  101. package/dist/packager-tool-14rdgz3c.js +55 -0
  102. package/dist/packager-tool-1rhch6b5.js +496 -0
  103. package/dist/packager-tool-21t17xzz.js +5073 -0
  104. package/dist/{packager-tool-pvhx9e12.js → packager-tool-2b0tn4p4.js} +58 -176
  105. package/dist/{packager-tool-f9jxca9z.js → packager-tool-368bft50.js} +11 -11
  106. package/dist/{packager-tool-a5afh1dc.js → packager-tool-4fv0sq2h.js} +61 -67
  107. package/dist/packager-tool-4g87fbz6.js +273 -0
  108. package/dist/packager-tool-4zt1s51a.js +53 -0
  109. package/dist/{packager-tool-frjt46rb.js → packager-tool-508ka40b.js} +23 -23
  110. package/dist/{packager-tool-gbv6f0ac.js → packager-tool-5104bnpv.js} +22 -21
  111. package/dist/packager-tool-5dgpfh5e.js +1274 -0
  112. package/dist/packager-tool-5ve5ms3b.js +2393 -0
  113. package/dist/{packager-tool-dxgrhfq5.js → packager-tool-64r7e4ek.js} +8 -8
  114. package/dist/{packager-tool-h6pf3qxq.js → packager-tool-65yf8zqb.js} +180 -1237
  115. package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
  116. package/dist/{packager-tool-htrt75v4.js → packager-tool-6jpvvxyb.js} +27 -22
  117. package/dist/packager-tool-6vhefpmq.js +461 -0
  118. package/dist/{packager-tool-1nfbzy0h.js → packager-tool-72xwbsmw.js} +441 -556
  119. package/dist/packager-tool-7atc775f.js +30 -0
  120. package/dist/packager-tool-7mxn3e7j.js +27 -0
  121. package/dist/{packager-tool-wvmtp8zt.js → packager-tool-7qtnffkc.js} +8 -7
  122. package/dist/{packager-tool-ymma2s85.js → packager-tool-8ba22j6n.js} +9 -6
  123. package/dist/{packager-tool-apawc11t.js → packager-tool-8ed52y5r.js} +1584 -1261
  124. package/dist/{packager-tool-v11fm907.js → packager-tool-8n4bdvke.js} +13 -13
  125. package/dist/{packager-tool-p8gab24q.js → packager-tool-8qypzm9v.js} +424 -404
  126. package/dist/packager-tool-9217bxm2.js +6 -0
  127. package/dist/{packager-tool-zfrp8ecz.js → packager-tool-951nhh3e.js} +82 -82
  128. package/dist/{packager-tool-ap0zt7de.js → packager-tool-99d2kj94.js} +8 -11
  129. package/dist/{packager-tool-z21c6mbp.js → packager-tool-a1h0q79w.js} +48 -48
  130. package/dist/{packager-tool-xk78j7dz.js → packager-tool-ac6rvny7.js} +52 -57
  131. package/dist/{packager-tool-1d64q5s5.js → packager-tool-b2pkwwj1.js} +1273 -1300
  132. package/dist/{packager-tool-yetpbbey.js → packager-tool-bbkkxbyq.js} +9 -8
  133. package/dist/{packager-tool-409n51pv.js → packager-tool-d07g2kpn.js} +7 -7
  134. package/dist/{packager-tool-8zzmg2f3.js → packager-tool-dx6sjbkd.js} +19 -19
  135. package/dist/{packager-tool-8g5931fz.js → packager-tool-em4ppegs.js} +36 -43
  136. package/dist/{packager-tool-zgsvggdr.js → packager-tool-f7rk9xhv.js} +4 -4
  137. package/dist/{packager-tool-jrnjzs5t.js → packager-tool-fzgfb0jt.js} +32175 -36281
  138. package/dist/{packager-tool-9rmaeaww.js → packager-tool-gdpw0daf.js} +25211 -11966
  139. package/dist/packager-tool-hk0fnvz5.js +14 -0
  140. package/dist/{packager-tool-dbsdy4xx.js → packager-tool-jd3v0bh1.js} +4 -4
  141. package/dist/{packager-tool-tqjfdpda.js → packager-tool-jmrhzfyj.js} +106 -80
  142. package/dist/{packager-tool-2px5qqm4.js → packager-tool-kz3t4raw.js} +490 -246
  143. package/dist/{packager-tool-7bam8cjq.js → packager-tool-mdf7bws6.js} +53255 -27261
  144. package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
  145. package/dist/{packager-tool-nkrmjr3a.js → packager-tool-mphfxa9g.js} +125 -125
  146. package/dist/{packager-tool-kn86394c.js → packager-tool-p123mtfx.js} +66 -692
  147. package/dist/{packager-tool-t7ahhaer.js → packager-tool-pxq0bwp0.js} +208 -138
  148. package/dist/{packager-tool-j95w4fj3.js → packager-tool-q0f1dvtd.js} +11 -11
  149. package/dist/{packager-tool-8qp60s20.js → packager-tool-q2f18crb.js} +3 -3
  150. package/dist/packager-tool-q2kwk5bf.js +57 -0
  151. package/dist/{packager-tool-09rvpfjd.js → packager-tool-rxqxza90.js} +192 -183
  152. package/dist/{packager-tool-3m4ve01f.js → packager-tool-ryds9860.js} +33 -36
  153. package/dist/{packager-tool-ykbahxma.js → packager-tool-t17t9svg.js} +6 -6
  154. package/dist/{packager-tool-myhbp761.js → packager-tool-vgrswa8p.js} +53 -8
  155. package/dist/{packager-tool-7hw344bt.js → packager-tool-xb16e3tz.js} +5 -5
  156. package/dist/{packager-tool-1frs4sr4.js → packager-tool-yewnsyag.js} +37 -5
  157. package/dist/packager-tool-zdqbp34f.js +14 -0
  158. package/dist/{packager-tool-pacrqxv2.js → packager-tool-ze3fnf3s.js} +52 -34
  159. package/dist/packager-tool.js +12 -32
  160. package/dist/prepare-uip-ad7mfs8t.js +92 -0
  161. package/dist/{pt-3KUMINBZ-d0fexmny.js → pt-2RGHDOG4-gwe2ptvg.js} +38 -5
  162. package/dist/{pt-BR-3LGIH33I-tqbrd89y.js → pt-BR-3LGIH33I-hdf332je.js} +1 -4
  163. package/dist/{pt-BR-USP2T7GD-pedn77m1.js → pt-BR-BIUJXIPU-2sqzhr8y.js} +20 -5
  164. package/dist/{pt-BR-6VFBW5QT-hsck9gjj.js → pt-BR-IL3KLBID-m1mvqqzb.js} +83 -8
  165. package/dist/{pt-BR-WNNZTIMN-6fent688.js → pt-BR-JWHVZE6H-gvkknv49.js} +38 -5
  166. package/dist/{pt-BR-TKHNHMET-4Z5H4N5G-pzw3328h.js → pt-BR-PHLFHMXZ-JFPKUXIZ-gyb27t6e.js} +425 -37
  167. package/dist/{pt-BR-GNQNAAZ2-xadharv4.js → pt-BR-PHLFHMXZ-n6de4s7z.js} +191 -11
  168. package/dist/{pt-RMIAKZB4-t80exmp7.js → pt-MHX6JGAX-xfgvdqwg.js} +20 -5
  169. package/dist/{pt-ROXU257Y-OWZOS54V-ywap2t39.js → pt-N7ZTJT4W-GVODJMRX-p5b51p0b.js} +424 -36
  170. package/dist/{pt-TO2DARY2-ftcce1bv.js → pt-N7ZTJT4W-d6c67xcn.js} +190 -10
  171. package/dist/{pt-PFZXVOQH-qshq0b2m.js → pt-PFZXVOQH-xvcm5b61.js} +1 -4
  172. package/dist/{pt-WOTPKWPZ-1rxcy8hs.js → pt-VLA5IOHO-8t4pze0h.js} +83 -8
  173. package/dist/{ro-GHOBYW2S-4zevc9dy.js → ro-3RKJNGJZ-xqj14e3d.js} +20 -5
  174. package/dist/{ro-KMDT7LYJ-yhpnsdvw.js → ro-53TS7SWG-hnjx1c7b.js} +38 -5
  175. package/dist/{ro-AN5G62WQ-kcj00jwq.js → ro-AN5G62WQ-fzsv2ymm.js} +1 -4
  176. package/dist/{ro-AVAWPKOO-6WCG756B-v7pjv1hc.js → ro-FLNXVYJI-ZN43XZKK-2tajkc94.js} +422 -34
  177. package/dist/{ro-WUYJV6OW-a8d9qy1n.js → ro-FLNXVYJI-ytrwabg2.js} +190 -10
  178. package/dist/{ro-PB44YXML-zmhhwp5h.js → ro-IRNFX376-mh84zk3n.js} +82 -7
  179. package/dist/{ru-GSCT4ARZ-FTVCGQTL-gee86v14.js → ru-GSCT4ARZ-FTVCGQTL-v3d4ag31.js} +2 -4
  180. package/dist/ru-GSCT4ARZ-c2cfq4h1.js +7 -0
  181. package/dist/{ru-T73OPRTC-4knxw497.js → ru-T73OPRTC-50m7tty9.js} +1 -4
  182. package/dist/{ru-WBLQ5B2U-wemdzdqd.js → ru-WBLQ5B2U-5qpt0mvh.js} +1 -4
  183. package/dist/{ru-WBLQ5B2U-8r3c7v6d.js → ru-WBLQ5B2U-bf20yr5y.js} +1 -4
  184. package/dist/{ru-WBLQ5B2U-kdey8qa4.js → ru-WBLQ5B2U-w2wmp3xb.js} +1 -4
  185. package/dist/{serialization-BXU6AKAN-vdqyr29x.js → serialization-Z3UYT6BW-y9gb55mp.js} +1638 -761
  186. package/dist/services/extract-schema/default-schema-document.d.ts +31 -0
  187. package/dist/services/node-service.d.ts +6 -3
  188. package/dist/services/node-validators/file-node-connection-validator.d.ts +2 -0
  189. package/dist/services/node-validators/index.d.ts +1 -0
  190. package/dist/services/orchestrator-connection-field.d.ts +24 -0
  191. package/dist/services/packaging-utils.d.ts +2 -2
  192. package/dist/services/vars-reference-rule.d.ts +4 -3
  193. package/dist/solution-auth-j8x84n5z.js +11 -0
  194. package/dist/solution-discovery-vn4q32bf.js +38 -0
  195. package/dist/{tidy-service-hz61ypyj.js → tidy-service-m33hhtc7.js} +37 -55
  196. package/dist/tool.js +18 -27
  197. package/dist/{tr-JMIP7ZSL-G3QYPVT2-gswngwcr.js → tr-7AIZZWZ6-ESAESUPL-77g9b7jb.js} +422 -34
  198. package/dist/{tr-M3F5A6AU-bb0tg39m.js → tr-7AIZZWZ6-pdzp9n0p.js} +190 -10
  199. package/dist/{tr-SEC6RGZ4-0ttavjya.js → tr-EJKY7DVQ-rkctqva4.js} +83 -8
  200. package/dist/{tr-KHOCWWLF-8apf5y44.js → tr-KHOCWWLF-m9t24j5y.js} +1 -4
  201. package/dist/{tr-SC55DYHY-e4zgcd4t.js → tr-PIQY7JIT-2mkwk0kq.js} +38 -5
  202. package/dist/{tr-GDTLECMM-kngksm3r.js → tr-PQLUUHPC-qsb7btxn.js} +20 -5
  203. package/dist/utils/container-ports.d.ts +22 -0
  204. package/dist/utils/handle-expansion.d.ts +57 -3
  205. package/dist/utils/workflow-file-format.d.ts +14 -0
  206. package/dist/validation.js +44 -68
  207. package/dist/{variable-service-9ex4a93n.js → variable-service-ea1erf93.js} +28 -49
  208. package/dist/{wait-for-flow-job-b0vj8828.js → wait-for-flow-job-a4xtda36.js} +29 -36
  209. package/dist/{zh-CN-MX7VIOF2-xznrtchf.js → zh-CN-4FH7E7UL-84y6j2ea.js} +82 -7
  210. package/dist/{zh-CN-4NI2EGMV-8g027vv3.js → zh-CN-4NI2EGMV-dt0wg0wh.js} +1 -4
  211. package/dist/{zh-CN-IFFXSEJS-MZQ4HU3Z-ge1ynmtz.js → zh-CN-CN2ARPFS-NIQTWDK2-b5c91fwn.js} +422 -34
  212. package/dist/{zh-CN-C5G4PC7C-ds9gkptg.js → zh-CN-CN2ARPFS-e0p2qrxf.js} +190 -10
  213. package/dist/{en-BPJVY3U7-xkpj5xc5.js → zh-CN-NIEVKROA-q4tbbwqz.js} +26 -7
  214. package/dist/{zh-CN-I5D7WHBD-ge92tbx9.js → zh-CN-OHNTHZRI-b0hjkfqn.js} +20 -5
  215. package/dist/{zh-TW-53SU6EH4-33x57egq.js → zh-TW-53SU6EH4-w0wz3nwg.js} +1 -4
  216. package/dist/{zh-TW-5SJ3GZT2-bsg054mw.js → zh-TW-5WQA6QTM-hns69sd4.js} +83 -8
  217. package/dist/{zh-TW-IYBNYAMG-J7FWTQTK-sx8d4ymg.js → zh-TW-7RUFEVFK-VKVRSVTP-jq2pcmar.js} +421 -33
  218. package/dist/{zh-TW-62HZIG6O-787kdwex.js → zh-TW-7RUFEVFK-qd7myw31.js} +190 -10
  219. package/dist/{zh-TW-2AVLM723-288pkc1z.js → zh-TW-E4D3Y6ZR-tn3bmzz5.js} +20 -5
  220. package/dist/{zh-TW-TN3MPNXL-jcgg2hcs.js → zh-TW-MSQM7YTT-m7r7nwnj.js} +38 -5
  221. package/package.json +2 -2
  222. package/dist/authoring-e1k40hyw.js +0 -24
  223. package/dist/binding-service-0qffbxg7.js +0 -157
  224. package/dist/de-FGHEJRCI-gn4cf5gh.js +0 -2697
  225. package/dist/de-MUJPA4EB-209jpeqe.js +0 -173
  226. package/dist/de-UZI7FJDO-mwvc4cxe.js +0 -200
  227. package/dist/debug-conversation-trigger-2crr9w4n.js +0 -30
  228. package/dist/debug-http-client-yqjzsnhw.js +0 -32
  229. package/dist/debug-service-nra3n02y.js +0 -61
  230. package/dist/edge-service-y44f2rgd.js +0 -170
  231. package/dist/en-E454CJNK-ytfw06kj.js +0 -98
  232. package/dist/en-EJCBA3LK-0wb3b1xy.js +0 -146
  233. package/dist/en-EJCBA3LK-dtpdghgj.js +0 -146
  234. package/dist/en-GN2ZGWUE-03z2df4k.js +0 -136
  235. package/dist/en-LQHKFSEY-vvbe8ve9.js +0 -26
  236. package/dist/en-M7GQYBV2-5nfmpnfz.js +0 -2018
  237. package/dist/en-TBNO2WUV-77KTKLDE-4ktf0pqw.js +0 -1942
  238. package/dist/en-TBNO2WUV-9nan43e5.js +0 -1936
  239. package/dist/es-4UBUTCQA-m1ytpyx2.js +0 -200
  240. package/dist/es-7SE7HX2X-qda7whn6.js +0 -173
  241. package/dist/es-KR3ZSNMP-0cszm2n3.js +0 -2697
  242. package/dist/es-MX-2MYFZU7X-6v0q5rbn.js +0 -173
  243. package/dist/es-MX-5RELIXKI-9jhqtddc.js +0 -200
  244. package/dist/es-MX-XXZJGC4R-b4fbwe9d.js +0 -2697
  245. package/dist/filter-engine-7ep90g7f.js +0 -11
  246. package/dist/first-party-service-srxaftkn.js +0 -27
  247. package/dist/flow-api-sat010z1.js +0 -42
  248. package/dist/flow-eval-node-target-cwxb4kfe.js +0 -52
  249. package/dist/flow-eval-run-api-xdygjzfv.js +0 -13
  250. package/dist/flow-init-service-k7k5vx2z.js +0 -47
  251. package/dist/flow-io-2qdyj5e0.js +0 -44
  252. package/dist/flow-validate-service-x2mbk3et.js +0 -70
  253. package/dist/fr-MDFKNZ4C-qmypp92m.js +0 -173
  254. package/dist/fr-VBM5WRC2-63z7w4mh.js +0 -200
  255. package/dist/fr-Y6NPVODW-q5ef3htr.js +0 -2697
  256. package/dist/index-cg9qhfb1.js +0 -635
  257. package/dist/index-d090f35d.js +0 -66
  258. package/dist/index-gxcjq6ns.js +0 -110
  259. package/dist/index-kmp9fmhb.js +0 -25
  260. package/dist/index-nsn889vf.js +0 -27
  261. package/dist/index-sqhbn7ew.js +0 -157
  262. package/dist/index-wycgq0ff.js +0 -3178
  263. package/dist/index-y1ym28vg.js +0 -667
  264. package/dist/index.umd.min-fqefd9kn.js +0 -7814
  265. package/dist/inline-entity-resolver-c854cqma.js +0 -45
  266. package/dist/input-reader-n7kzdrev.js +0 -12
  267. package/dist/ja-43QL7CGO-h6qfxfay.js +0 -200
  268. package/dist/ja-MDG4BKZQ-gayaca2c.js +0 -38
  269. package/dist/ja-Q5PXKJ2V-tzf2rvz2.js +0 -2697
  270. package/dist/ja-UTQEAP34-hvyf683h.js +0 -173
  271. package/dist/known-types-r51zxb9g.js +0 -19
  272. package/dist/ko-AXCHW2OK-pkwdcbmx.js +0 -173
  273. package/dist/ko-AYBDSRZG-am0h0m2r.js +0 -2697
  274. package/dist/ko-TLL6Z6CD-ag6gjynr.js +0 -200
  275. package/dist/localization-d6gjmrsw.js +0 -47
  276. package/dist/maestro-automate-entry-6f9act3w.js +0 -22
  277. package/dist/node-service-d4xpqs0z.js +0 -92
  278. package/dist/node-sync-service-76b9e4r5.js +0 -61
  279. package/dist/packager-tool-0gctz400.js +0 -17
  280. package/dist/packager-tool-4mna26cc.js +0 -133
  281. package/dist/packager-tool-4x7tzvv0.js +0 -1176
  282. package/dist/packager-tool-53w8skv5.js +0 -262
  283. package/dist/packager-tool-6ejqwbw9.js +0 -26
  284. package/dist/packager-tool-6z1hsm2h.js +0 -143
  285. package/dist/packager-tool-7ja1b5hh.js +0 -8809
  286. package/dist/packager-tool-9era57c0.js +0 -28
  287. package/dist/packager-tool-9jxzgsxc.js +0 -14
  288. package/dist/packager-tool-c23zrhj8.js +0 -11
  289. package/dist/packager-tool-d6qf5qmb.js +0 -49
  290. package/dist/packager-tool-e3yks66r.js +0 -95
  291. package/dist/packager-tool-e5hj89zm.js +0 -6
  292. package/dist/packager-tool-e87tzg4y.js +0 -1937
  293. package/dist/packager-tool-eypvc2kv.js +0 -23
  294. package/dist/packager-tool-gbgfwx8f.js +0 -2
  295. package/dist/packager-tool-hk1gxnth.js +0 -11
  296. package/dist/packager-tool-hxyjn885.js +0 -24
  297. package/dist/packager-tool-j78fwwhq.js +0 -16
  298. package/dist/packager-tool-jgfzfqjm.js +0 -53
  299. package/dist/packager-tool-jysvpt8p.js +0 -11
  300. package/dist/packager-tool-m3wkcxf5.js +0 -11
  301. package/dist/packager-tool-mcaf4ewf.js +0 -46
  302. package/dist/packager-tool-mgcz986r.js +0 -143
  303. package/dist/packager-tool-p79yh9ww.js +0 -97
  304. package/dist/packager-tool-paq9c70w.js +0 -1332
  305. package/dist/packager-tool-pcvhcn2k.js +0 -2019
  306. package/dist/packager-tool-qkn0c042.js +0 -1922
  307. package/dist/packager-tool-qszay16r.js +0 -180
  308. package/dist/packager-tool-red2crtp.js +0 -5367
  309. package/dist/packager-tool-rs6jm14d.js +0 -23
  310. package/dist/packager-tool-s7wb0s9n.js +0 -6297
  311. package/dist/packager-tool-sc961w0q.js +0 -16
  312. package/dist/packager-tool-skcjythd.js +0 -22085
  313. package/dist/packager-tool-t07ev0jj.js +0 -1083
  314. package/dist/packager-tool-xj0agqpk.js +0 -11
  315. package/dist/packager-tool-z83pga0z.js +0 -1942
  316. package/dist/pt-3DIO5QWG-hb763vct.js +0 -173
  317. package/dist/pt-BR-TKHNHMET-dn6zxk1d.js +0 -2697
  318. package/dist/pt-BR-USP2T7GD-rppy42ym.js +0 -200
  319. package/dist/pt-BR-Y6K6XHXK-37a932vp.js +0 -173
  320. package/dist/pt-RMIAKZB4-67enhx3m.js +0 -200
  321. package/dist/pt-ROXU257Y-yd80gx6s.js +0 -2697
  322. package/dist/ro-AVAWPKOO-42m6am1w.js +0 -2697
  323. package/dist/ro-BWR3ONRR-jmap5ajd.js +0 -173
  324. package/dist/ro-GHOBYW2S-mhnqsgaa.js +0 -200
  325. package/dist/ru-GSCT4ARZ-1sa9wbr8.js +0 -10
  326. package/dist/ru-GSCT4ARZ-jrxwev63.js +0 -10
  327. package/dist/ru-WBLQ5B2U-dpqvtfwr.js +0 -10
  328. package/dist/ru-WBLQ5B2U-s4em88p0.js +0 -10
  329. package/dist/shared-utils-tqnx96mg.js +0 -21
  330. package/dist/solution-auth-8qz5pw7z.js +0 -14
  331. package/dist/solution-discovery-6t0z143v.js +0 -44
  332. package/dist/tr-5IIHSFW5-stsb3dar.js +0 -173
  333. package/dist/tr-GDTLECMM-k5fhmq13.js +0 -200
  334. package/dist/tr-JMIP7ZSL-fb67ft9w.js +0 -2696
  335. package/dist/zh-CN-I5D7WHBD-sr5h0a98.js +0 -200
  336. package/dist/zh-CN-IFFXSEJS-tke4mzty.js +0 -2697
  337. package/dist/zh-CN-OUMLDKDS-q3a1rr5c.js +0 -38
  338. package/dist/zh-CN-R2KU4U5L-q4yhc33t.js +0 -173
  339. package/dist/zh-TW-2AVLM723-xsmap3gk.js +0 -200
  340. package/dist/zh-TW-GNKMELBF-r4ay2475.js +0 -173
  341. package/dist/zh-TW-IYBNYAMG-wcan0qpb.js +0 -2697
  342. /package/dist/{packager-tool-yc4kw997.js → packager-tool-1qg04b7q.js} +0 -0
  343. /package/dist/{packager-tool-cqtsj6yh.js → packager-tool-2sazb7th.js} +0 -0
  344. /package/dist/{packager-tool-s9ff3kk4.js → packager-tool-887wr6jm.js} +0 -0
  345. /package/dist/{packager-tool-aw9v0raw.js → packager-tool-8c7nddd1.js} +0 -0
  346. /package/dist/{packager-tool-9cq9atem.js → packager-tool-a9xgmn1q.js} +0 -0
  347. /package/dist/{packager-tool-4kr6g0zw.js → packager-tool-cvh1a0nm.js} +0 -0
  348. /package/dist/{packager-tool-27avrkyk.js → packager-tool-k3egwd1m.js} +0 -0
  349. /package/dist/{packager-tool-qa9gftnj.js → packager-tool-mxgybnmt.js} +0 -0
  350. /package/dist/{packager-tool-10vc8pq4.js → packager-tool-wr7gn964.js} +0 -0
@@ -1,51 +1,49 @@
1
1
  import {
2
- resolveJsonInput
3
- } from "./packager-tool-ymma2s85.js";
4
- import {
5
- DEBUG_MODE_MAP,
6
- SIMULATION_MODE_MAP,
7
- beginDebugSession,
8
- createDebugInstance,
9
- fetchDebugInstanceVariables,
10
- getPersonalFolderKey
11
- } from "./packager-tool-tqjfdpda.js";
12
- import {
13
- debugPimsGet,
14
- debugPimsPatch,
15
- debugPimsPost,
16
- debugPimsPut
17
- } from "./packager-tool-frjt46rb.js";
18
- import {
19
- getAuthContext,
20
- getLoginStatusAsync
21
- } from "./packager-tool-kn86394c.js";
2
+ catchError2
3
+ } from "./packager-tool-pxq0bwp0.js";
22
4
  import {
23
- DEFAULT_PAGE_SIZE,
24
- EXIT_CODES,
5
+ extractErrorMessage,
6
+ RESULTS,
7
+ classifiedFailure,
8
+ authContextFailure,
25
9
  InvalidArgumentError,
26
- OutputFormatter,
10
+ logger,
11
+ EXIT_CODES,
27
12
  Pagination,
28
- RESULTS,
29
- extractErrorMessage,
13
+ OutputFormatter,
14
+ processContext,
15
+ DEFAULT_PAGE_SIZE,
30
16
  isGuid,
31
- logger,
32
- parseBoundedInt,
33
17
  parseLimit,
34
18
  parseOffset,
35
- processContext
36
- } from "./packager-tool-apawc11t.js";
19
+ parseBoundedInt
20
+ } from "./packager-tool-8ed52y5r.js";
37
21
  import {
38
- catchError
39
- } from "./packager-tool-t7ahhaer.js";
22
+ getAuthContext2
23
+ } from "./packager-tool-p123mtfx.js";
40
24
  import {
41
- __require
42
- } from "./packager-tool-1yh8g550.js";
25
+ debugPimsGet2,
26
+ debugPimsPost2,
27
+ debugPimsPut2,
28
+ debugPimsPatch2
29
+ } from "./packager-tool-508ka40b.js";
30
+ import {
31
+ getPersonalFolderKey2,
32
+ beginDebugSession2,
33
+ DEBUG_MODE_MAP2,
34
+ SIMULATION_MODE_MAP2,
35
+ createDebugInstance2,
36
+ fetchDebugInstanceVariables2
37
+ } from "./packager-tool-jmrhzfyj.js";
38
+ import {
39
+ resolveJsonInput
40
+ } from "./packager-tool-8ba22j6n.js";
43
41
 
44
42
  // ../maestro-sdk/src/client.ts
45
43
  function parseBackendErrorBody(body) {
46
44
  if (!body)
47
45
  return {};
48
- const [parseErr, parsed] = catchError(() => JSON.parse(body));
46
+ const [parseErr, parsed] = catchError2(() => JSON.parse(body));
49
47
  if (parseErr || !parsed || typeof parsed !== "object")
50
48
  return {};
51
49
  const result = {};
@@ -129,7 +127,7 @@ async function pimsGet(config, path, options) {
129
127
  const text = await response.text();
130
128
  if (!text)
131
129
  return {};
132
- const [parseErr, parsed] = catchError(() => JSON.parse(text));
130
+ const [parseErr, parsed] = catchError2(() => JSON.parse(text));
133
131
  if (parseErr)
134
132
  throw new Error(`Failed to parse API response body: ${parseErr.message}`);
135
133
  return parsed;
@@ -156,7 +154,7 @@ async function pimsRequest(config, method, path, body, options) {
156
154
  const text = await response.text();
157
155
  if (!text)
158
156
  return {};
159
- const [parseErr, parsed] = catchError(() => JSON.parse(text));
157
+ const [parseErr, parsed] = catchError2(() => JSON.parse(text));
160
158
  if (parseErr) {
161
159
  throw new Error(`Failed to parse API response body: ${parseErr.message}`);
162
160
  }
@@ -174,7 +172,7 @@ async function pimsPatch(config, path, body, options) {
174
172
 
175
173
  // ../maestro-sdk/src/client-factory.ts
176
174
  async function createPimsConfig() {
177
- const ctx = await getAuthContext({
175
+ const ctx = await getAuthContext2({
178
176
  ensureTokenValidityMinutes: 10,
179
177
  requireOrganizationId: true,
180
178
  requireTenantId: true
@@ -206,846 +204,261 @@ function buildQueryString(params) {
206
204
  return `?${new URLSearchParams(entries).toString()}`;
207
205
  }
208
206
 
209
- // ../maestro-sdk/src/registry/filter-parser.ts
210
- class FilterParseError extends Error {
211
- code;
212
- token;
213
- constructor(message, code, token) {
214
- super(message);
215
- this.code = code;
216
- this.token = token;
217
- this.name = "FilterParseError";
218
- }
219
- }
220
- function parseFilterString(filterString) {
221
- if (!filterString || filterString.trim() === "") {
222
- return { filters: [], logic: "AND" };
223
- }
224
- const parts = filterString.split(/,(?=[a-zA-Z_][a-zA-Z0-9_]*(?::[a-zA-Z]+)?=)/);
225
- const conditions = [];
226
- for (const part of parts) {
227
- const condition = parseFilterCondition(part.trim());
228
- conditions.push(condition);
229
- }
207
+ // ../maestro-sdk/src/with-debug-pims-call.ts
208
+ async function createDebugPimsConfig() {
209
+ const auth = await getAuthContext2({
210
+ ensureTokenValidityMinutes: 10,
211
+ requireOrganizationId: true,
212
+ requireTenantId: true,
213
+ requireTenantName: true
214
+ });
230
215
  return {
231
- filters: conditions,
232
- logic: "AND"
216
+ baseUrl: auth.baseUrl,
217
+ organizationId: auth.organizationId,
218
+ tenantName: auth.tenantName,
219
+ tenantId: auth.tenantId,
220
+ authToken: auth.accessToken
233
221
  };
234
222
  }
235
- function parseFilterCondition(conditionString) {
236
- const match = conditionString.match(/^([^:=]+)(?::([^=]+))?=(.+)$/);
237
- if (!match) {
238
- throw new FilterParseError(`Invalid filter format: '${conditionString}'. Expected 'field=value' or 'field:operator=value'.`, "INVALID_FORMAT", conditionString);
239
- }
240
- const [, fieldStr, operatorStr, valueStr] = match;
241
- const field = normalizeField(fieldStr.trim());
242
- const operator = operatorStr?.trim() || "equals";
243
- const value = valueStr.trim();
244
- if (!isValidField(field)) {
245
- throw new FilterParseError(`Invalid filter field: '${field}'. Supported fields: category, type, tags, displayname, nodetype, description.`, "INVALID_FIELD", field);
223
+ async function withDebugPimsCall(fn, errorMessage) {
224
+ const [configError, config] = await catchError2(createDebugPimsConfig());
225
+ if (configError) {
226
+ logger.warn(`${errorMessage}: ${configError.message}`);
227
+ OutputFormatter.error(await authContextFailure(configError));
228
+ processContext.exit(1);
229
+ return;
246
230
  }
247
- if (!isValidOperator(operator)) {
248
- throw new FilterParseError(`Invalid filter operator: '${operator}'. Supported operators: equals, contains, in, startsWith, endsWith.`, "INVALID_OPERATOR", operator);
231
+ if (!config.folderKey) {
232
+ const [folderError, folder] = await catchError2(getPersonalFolderKey2(config));
233
+ if (folderError) {
234
+ logger.warn(`Could not resolve personal folder: ${folderError.message}`);
235
+ } else {
236
+ config.folderKey = folder.key;
237
+ config.organizationUnitId = folder.id;
238
+ }
249
239
  }
250
- return {
251
- field,
252
- operator,
253
- value
254
- };
255
- }
256
- function normalizeField(field) {
257
- const fieldMap = {
258
- category: "category",
259
- cat: "category",
260
- type: "type",
261
- nodetype: "nodetype",
262
- node_type: "nodetype",
263
- tags: "tags",
264
- tag: "tags",
265
- displayname: "displayname",
266
- display_name: "displayname",
267
- displayName: "displayname",
268
- name: "displayname",
269
- label: "displayname"
270
- };
271
- const normalized = field.toLowerCase().replace(/[-_\s]/g, "");
272
- return fieldMap[normalized] || field;
273
- }
274
- function isValidField(field) {
275
- const validFields = [
276
- "category",
277
- "type",
278
- "tags",
279
- "displayname",
280
- "nodetype",
281
- "description"
282
- ];
283
- return validFields.includes(field);
284
- }
285
- function isValidOperator(operator) {
286
- const validOperators = [
287
- "equals",
288
- "contains",
289
- "in",
290
- "startsWith",
291
- "endsWith"
292
- ];
293
- return validOperators.includes(operator);
294
- }
295
-
296
- // ../maestro-sdk/src/registry/command.ts
297
- function flattenNodeForDisplay(n) {
298
- return {
299
- NodeType: n.nodeType,
300
- Category: n.category ?? "",
301
- DisplayName: n.display?.label ?? "",
302
- Description: n.description ?? n.display?.description ?? "",
303
- Version: n.version ?? "",
304
- Tags: (n.tags ?? []).join(", ")
305
- };
306
- }
307
- async function missingProcessResourceHint() {
308
- const {
309
- describeProjectsWithoutProcessResource,
310
- findProjectsWithoutProcessResource,
311
- findSolutionFromCwd
312
- } = await import("./solution-discovery-6t0z143v.js");
313
- const ctx = await findSolutionFromCwd();
314
- if (!ctx)
315
- return {};
316
- return describeProjectsWithoutProcessResource(await findProjectsWithoutProcessResource(ctx), ctx.solutionDir);
317
- }
318
- async function localResultNotes(contractWarning) {
319
- const hint = await missingProcessResourceHint();
320
- const warnings = [hint.Warning, contractWarning].filter((w) => typeof w === "string");
321
- return {
322
- ...hint,
323
- ...warnings.length > 0 ? { Warning: warnings.join(" ") } : {}
324
- };
325
- }
326
- async function explainNodeTypeWithoutProcessResource(nodeType) {
327
- const discovery = await import("./solution-discovery-6t0z143v.js");
328
- const [, explanation] = await catchError(discovery.explainNodeTypeWithoutProcessResource(nodeType));
329
- return explanation;
330
- }
331
- function flattenNodeWithAvailability(n, availableOnTenant) {
332
- return {
333
- ...flattenNodeForDisplay(n),
334
- AvailableOnTenant: availableOnTenant
335
- };
336
- }
337
- async function mergeWithKnownSdkNodes(tenantNodes) {
338
- const { listKnownSdkNodes } = await import("./known-types-r51zxb9g.js");
339
- const tenantTypes = new Set(tenantNodes.map((n) => n.nodeType?.toLowerCase()).filter((t) => typeof t === "string"));
340
- const merged = tenantNodes.map((node) => ({ node, availableOnTenant: true }));
341
- for (const known of listKnownSdkNodes()) {
342
- const type = known.nodeType?.toLowerCase();
343
- if (typeof type !== "string")
344
- continue;
345
- if (tenantTypes.has(type))
346
- continue;
347
- merged.push({ node: known, availableOnTenant: false });
240
+ const [error, result] = await catchError2(fn(config));
241
+ if (error) {
242
+ const msg = await extractErrorMessage(error);
243
+ logger.warn(`${errorMessage}: ${msg}`);
244
+ OutputFormatter.error({
245
+ Result: RESULTS.Failure,
246
+ Message: errorMessage,
247
+ Instructions: msg
248
+ });
249
+ processContext.exit(1);
250
+ return;
348
251
  }
349
- return merged;
350
- }
351
- var ALL_NODES = -1;
352
- function parseListLimit(raw) {
353
- return raw.trim() === String(ALL_NODES) ? ALL_NODES : parseLimit(raw);
354
- }
355
- function shownRows(count, offset) {
356
- return offset === 0 ? `first ${count}` : `${count} from offset ${offset}`;
252
+ return result;
357
253
  }
358
- var registerRegistryCommand = (program, commandPrefix) => {
359
- const cmd = `uip ${commandPrefix} registry`;
360
- const registry = program.command("registry").description(`Browse and search the ${commandPrefix} node registry to discover available activities and connectors (OOTB + authenticated). Use 'pull' to sync, 'search' to find nodes, 'get' to inspect a node's full input/output schema.`).addHelpText("after", `
361
- Typical workflow:
362
- 0. Login for full registry (optional, OOTB nodes available without login):
363
- uip login
364
- 1. Sync the registry: ${cmd} pull
365
- 2. Search for a node: ${cmd} search slack
366
- 3. Inspect its schema: ${cmd} get <node-type>
367
- 4. Extract input fields: ${cmd} get <node-type> --output-filter "Node.inputDefinition.fields"
368
-
369
- Note: Without login, only built-in (OOTB) nodes are available. Login to access the full node registry including custom connectors.
370
-
371
- In-solution discovery (--local):
372
- Run from inside a solution project directory (with a .uipx file in CWD, parent, or grandparent).
373
- Shows sibling projects (Agent, Process, Flow, Api) as invokable nodes.
374
- cd MySolution/MyFlow && ${cmd} list --local
375
254
 
376
- Subcommands:
377
- pull Fetch and cache the full node registry (run once per session)
378
- list List cached nodes (default: first 20, --limit -1 for everything)
379
- search Find nodes by keyword and/or field filters ← start here
380
- get Get full schema for a single node (with connector input/output enrichment)`);
381
- const pullExamples = [
382
- {
383
- Description: "Sync the node registry",
384
- Command: `${cmd} pull`,
385
- Output: {
386
- Code: "NodePullSuccess",
387
- Data: {
388
- NodesCount: 184,
389
- FromCache: false,
390
- Source: "authenticated",
391
- CacheWritten: true,
392
- Message: "Synced fresh nodes"
255
+ // ../maestro-sdk/src/shared-commands/examples.ts
256
+ var INSTANCE = "f4a1c2b3-0000-4000-8000-000000000001";
257
+ var FOLDER = "b2c3d4e5-0000-4000-8000-000000000002";
258
+ var PROCESS = "c3d4e5f6-0000-4000-8000-000000000003";
259
+ var INCIDENT = "d4e5f6a7-0000-4000-8000-000000000004";
260
+ var ELEMENT = "Task_Review";
261
+ var SOLUTION = "e5f6a7b8-0000-4000-8000-000000000009";
262
+ var PROJECT = "f6a7b8c9-0000-4000-8000-00000000000a";
263
+ var operation = (verb, code, description, status) => (prefix) => ({
264
+ Description: description,
265
+ Command: `${prefix} instances ${verb} ${INSTANCE} --folder-key ${FOLDER}`,
266
+ Output: { Code: code, Data: { InstanceId: INSTANCE, Status: status } }
267
+ });
268
+ var EXAMPLES = {
269
+ "instances list": (prefix) => ({
270
+ Description: "List the faulted instances in a folder",
271
+ Command: `${prefix} instances list --folder-key ${FOLDER} --status Faulted --limit 2`,
272
+ Output: {
273
+ Code: "InstanceList",
274
+ Data: [
275
+ {
276
+ InstanceId: INSTANCE,
277
+ InstanceDisplayName: "Claim 1042",
278
+ ProcessKey: PROCESS,
279
+ PackageVersion: "1.0.3",
280
+ LatestRunStatus: "Faulted",
281
+ StartedTime: "2026-10-13T09:12:00Z"
393
282
  }
394
- }
283
+ ]
395
284
  }
396
- ];
397
- const listExamples = [
398
- {
399
- Description: "List cached nodes (every row carries AvailableOnTenant; FF-gated SDK-known nodes are included)",
400
- Command: `${cmd} list --limit 2`,
401
- Output: {
402
- Code: "NodeListSuccess",
403
- Data: [
404
- {
405
- NodeType: "uipath.slack.connector.send-message",
406
- Category: "connector",
407
- DisplayName: "Send Message",
408
- Description: "Post a message to a Slack channel",
409
- Version: "1.0.0",
410
- Tags: "slack, messaging",
411
- AvailableOnTenant: true
412
- },
285
+ }),
286
+ "instances get": (prefix) => ({
287
+ Description: "Get one instance and its latest run",
288
+ Command: `${prefix} instances get ${INSTANCE} --folder-key ${FOLDER}`,
289
+ Output: {
290
+ Code: "InstanceGet",
291
+ Data: {
292
+ InstanceId: INSTANCE,
293
+ InstanceDisplayName: "Claim 1042",
294
+ ProcessKey: PROCESS,
295
+ PackageVersion: "1.0.3",
296
+ LatestRunStatus: "Running",
297
+ StartedTime: "2026-10-13T09:12:00Z",
298
+ CompletedTime: null
299
+ }
300
+ }
301
+ }),
302
+ "instances pause": operation("pause", "InstancePaused", "Pause a running instance", "Paused"),
303
+ "instances resume": operation("resume", "InstanceResumed", "Resume a paused instance", "Running"),
304
+ "instances cancel": operation("cancel", "InstanceCanceled", "Cancel an instance", "Canceling"),
305
+ "instances retry": operation("retry", "InstanceRetried", "Retry a faulted instance from where it failed", "Running"),
306
+ "instances variables": (prefix) => ({
307
+ Description: "Read an instance's variables",
308
+ Command: `${prefix} instances variables ${INSTANCE} --folder-key ${FOLDER}`,
309
+ Output: {
310
+ Code: "InstanceVariables",
311
+ Data: {
312
+ InstanceId: INSTANCE,
313
+ ParentElementId: null,
314
+ GlobalVariables: [
413
315
  {
414
- NodeType: "uipath.human-in-the-loop",
415
- Category: "human-task",
416
- DisplayName: "Human in the Loop",
417
- Description: "Assign a task to a human and wait for completion",
418
- Version: "1.0.0",
419
- Tags: "human-task, hitl, human-in-the-loop, approval",
420
- AvailableOnTenant: false
316
+ Id: "claimAmount",
317
+ Name: "claimAmount",
318
+ Type: "number",
319
+ Value: 1200,
320
+ ElementId: "root",
321
+ Source: "=vars.claimAmount"
421
322
  }
422
- ]
323
+ ],
324
+ Elements: []
423
325
  }
424
326
  }
425
- ];
426
- const searchExamples = [
427
- {
428
- Description: "Search nodes by keyword (every row carries AvailableOnTenant; FF-gated SDK-known nodes are included)",
429
- Command: `${cmd} search slack`,
430
- Output: {
431
- Code: "NodeSearchSuccess",
432
- Data: [
327
+ }),
328
+ "instances variables-all": (prefix) => ({
329
+ Description: "Read the variables of every scope in an instance",
330
+ Command: `${prefix} instances variables-all ${INSTANCE} --folder-key ${FOLDER}`,
331
+ Output: {
332
+ Code: "InstanceVariablesAll",
333
+ Data: {
334
+ Variables: [
433
335
  {
434
- NodeType: "uipath.slack.connector.send-message",
435
- Category: "connector",
436
- DisplayName: "Send Message",
437
- Description: "Post a message to a Slack channel",
438
- Version: "1.0.0",
439
- Tags: "slack, messaging",
440
- AvailableOnTenant: true
336
+ InstanceId: INSTANCE,
337
+ ParentElementId: null,
338
+ GlobalVariables: [],
339
+ Elements: []
441
340
  }
442
341
  ]
443
342
  }
444
343
  }
445
- ];
446
- const getExamples = [
447
- {
448
- Description: "Get the full schema for a node",
449
- Command: `${cmd} get uipath.slack.connector.send-message`,
450
- Output: {
451
- Code: "NodeGetSuccess",
452
- Data: {
453
- Node: {
454
- nodeType: "uipath.slack.connector.send-message",
455
- category: "connector",
456
- display: { label: "Send Message" },
457
- inputDefinition: {
458
- fields: [{ name: "channel", required: true }]
459
- }
460
- }
461
- }
344
+ }),
345
+ "instances global-variables": (prefix) => ({
346
+ Description: "Read an instance's global variables",
347
+ Command: `${prefix} instances global-variables ${INSTANCE} --folder-key ${FOLDER}`,
348
+ Output: {
349
+ Code: "InstanceGlobalVariables",
350
+ Data: {
351
+ InstanceId: INSTANCE,
352
+ Globals: { claimAmount: 1200 },
353
+ Count: 1,
354
+ RetrievedAt: "2026-10-13T09:20:00Z"
462
355
  }
463
356
  }
464
- ];
465
- registry.command("pull").description(`Pull and sync node data from ${commandPrefix} registry (login first for full registry)`).option("-f, --force", "Force refresh, ignore cache").examples(pullExamples).trackedAction(processContext, async (options) => {
466
- const { MANIFEST_VALIDATION_NEXT_STEP, pullNodes } = await import("./node-sync-service-76b9e4r5.js");
467
- const [error, result] = await catchError(pullNodes({
468
- force: options.force
469
- }));
470
- if (error) {
471
- OutputFormatter.error({
472
- Result: RESULTS.Failure,
473
- Message: "Error pulling nodes",
474
- Instructions: error.message
475
- });
476
- processContext.exit(1);
477
- return;
357
+ }),
358
+ "instances variables-set": (prefix) => ({
359
+ Description: "Patch variables on a running instance from a file",
360
+ Command: `${prefix} instances variables-set ${INSTANCE} --folder-key ${FOLDER} --inputs @patch.json`,
361
+ Output: {
362
+ Code: "InstanceVariablesSet",
363
+ Data: {}
478
364
  }
479
- if (result.failures?.length) {
480
- OutputFormatter.error({
481
- Result: RESULTS.Failure,
482
- Message: `The tenant manifest failed validation, so the pull returned only ${result.syncedCount} OOTB nodes; the cache was not updated`,
483
- Instructions: `registry get/search keep serving the previous cache, if there is one. ${MANIFEST_VALIDATION_NEXT_STEP} The validation error is in Data.Failures.`,
484
- Retry: "RetryWillNotFix",
485
- Data: {
486
- NodesCount: result.syncedCount,
487
- Source: result.source,
488
- CacheWritten: false,
489
- Failures: result.failures.map((f) => ({
490
- Source: f.source,
491
- Reason: f.reason
492
- }))
365
+ }),
366
+ "instances incidents": (prefix) => ({
367
+ Description: "List the incidents an instance raised",
368
+ Command: `${prefix} instances incidents ${INSTANCE} --folder-key ${FOLDER}`,
369
+ Output: {
370
+ Code: "InstanceIncidents",
371
+ Data: [
372
+ {
373
+ IncidentId: INCIDENT,
374
+ InstanceId: INSTANCE,
375
+ ElementId: ELEMENT,
376
+ IncidentStatus: "Open",
377
+ ErrorCode: "TaskFailed",
378
+ ErrorMessage: "The action app returned an error"
493
379
  }
494
- });
495
- processContext.exit(1);
496
- return;
380
+ ]
497
381
  }
498
- const missing = result.missingSources ?? [];
499
- const base = result.fromCache ? `Using cached nodes (age: ${result.ageMinutes}m)` : "Synced fresh nodes";
500
- const message = missing.length ? `${base}; missing node sources: ${missing.map((m) => m.source).join(", ")}` : base;
501
- const finalMessage = result.info ? `${message}. ${result.info}` : message;
502
- OutputFormatter.success({
503
- Result: RESULTS.Success,
504
- Code: "NodePullSuccess",
382
+ }),
383
+ "instances asset": (prefix) => ({
384
+ Description: "Get the asset an instance runs",
385
+ Command: `${prefix} instances asset ${INSTANCE} --folder-key ${FOLDER}`,
386
+ Output: { Code: "InstanceAsset", Data: {} }
387
+ }),
388
+ "instances migrate": (prefix) => ({
389
+ Description: "Move an instance to a newer package version",
390
+ Command: `${prefix} instances migrate ${INSTANCE} 1.0.4 --folder-key ${FOLDER} --comment "Fix review step"`,
391
+ Output: {
392
+ Code: "InstanceMigrated",
393
+ Data: { InstanceId: INSTANCE, Status: "Running" }
394
+ }
395
+ }),
396
+ "instances goto": (prefix) => ({
397
+ Description: "Move an instance's cursor from one element to another",
398
+ Command: `${prefix} instances goto ${INSTANCE} '[{"sourceElementId":"${ELEMENT}","targetElementId":"Task_Approve"}]' --folder-key ${FOLDER}`,
399
+ Output: {
400
+ Code: "InstanceGoto",
401
+ Data: { InstanceId: INSTANCE, Status: "Running" }
402
+ }
403
+ }),
404
+ "instances cursors": (prefix) => ({
405
+ Description: "List the elements an instance is currently at",
406
+ Command: `${prefix} instances cursors ${INSTANCE} --folder-key ${FOLDER}`,
407
+ Output: {
408
+ Code: "InstanceCursors",
409
+ Data: { ElementIds: [ELEMENT] }
410
+ }
411
+ }),
412
+ "instances messages send": (prefix) => ({
413
+ Description: "Send a message to the instances waiting for it",
414
+ Command: `${prefix} instances messages send --folder-key ${FOLDER} --inputs @message.json`,
415
+ Output: {
416
+ Code: "MessageSent",
505
417
  Data: {
506
- NodesCount: result.syncedCount,
507
- FromCache: result.fromCache,
508
- AgeMinutes: result.ageMinutes,
509
- Source: result.source,
510
- CacheWritten: result.cacheWritten,
511
- Message: finalMessage,
512
- Info: result.info,
513
- ...missing.length > 0 && {
514
- MissingSources: missing.map((m) => ({
515
- Source: m.source,
516
- Reason: m.reason
517
- }))
518
- }
519
- }
520
- });
521
- });
522
- registry.command("list").description("Sample cached nodes to inspect their config structure (default: first 20). Output merges tenant nodes with the SDK-known catalog; every row carries `AvailableOnTenant` so callers can filter FF-gated rows. Use 'search' to find nodes — use --limit -1 only if you need the full list (the result can be huge and unreadable).").addHelpText("after", `
523
- Examples:
524
- ${cmd} list
525
- ${cmd} list --limit 200
526
- ${cmd} list --limit -1
527
-
528
- In-solution (--local):
529
- cd MySolution/MyFlow && ${cmd} list --local`).option("-l, --limit <n>", "Number of nodes to return (1-10000, default: 20, -1 for all)", parseListLimit, 20).option("--offset <number>", "Number of nodes to skip (0-1000000)", parseOffset, 0).option("--local", "Show only in-solution project nodes (requires .uipx in CWD, parent, or grandparent). Omits `AvailableOnTenant` (no tenant lookup).").examples(listExamples).trackedAction(processContext, async (options) => {
530
- const {
531
- getLocalSolutionSnapshot,
532
- listNodes,
533
- localContractWarning
534
- } = await import("./node-sync-service-76b9e4r5.js");
535
- const showAll = options.limit === ALL_NODES;
536
- if (options.local) {
537
- const [error2, snapshot] = await catchError(getLocalSolutionSnapshot());
538
- if (error2) {
539
- OutputFormatter.error({
540
- Result: RESULTS.Failure,
541
- Message: "Error listing nodes",
542
- Instructions: error2.message
543
- });
544
- processContext.exit(1);
545
- return;
418
+ Id: "e5f6a7b8-0000-4000-8000-000000000005",
419
+ JobId: "f6a7b8c9-0000-4000-8000-000000000006"
546
420
  }
547
- const localNodes = snapshot.manifests;
548
- const totalCount2 = localNodes.length;
549
- const effectiveLimit2 = showAll ? totalCount2 : options.limit;
550
- const nodes = localNodes.slice(options.offset, options.offset + effectiveLimit2);
551
- const truncated2 = options.offset + nodes.length < totalCount2;
552
- const warning = localContractWarning(snapshot, nodes);
553
- OutputFormatter.success({
554
- Result: RESULTS.Success,
555
- Code: "NodeListSuccess",
556
- Data: nodes.map(flattenNodeForDisplay),
557
- Pagination: new Pagination({
558
- returned: nodes.length,
559
- limit: effectiveLimit2,
560
- offset: options.offset,
561
- total: totalCount2
562
- }),
563
- ...await localResultNotes(warning)
564
- });
565
- if (truncated2) {
566
- logger.info(`Showing ${shownRows(nodes.length, options.offset)} of ${totalCount2}. Use --limit, --offset or --limit -1 to get more, or use 'search' to filter.`);
421
+ }
422
+ }),
423
+ "instances element-executions": (prefix) => ({
424
+ Description: "List how each element of an instance ran",
425
+ Command: `${prefix} instances element-executions ${INSTANCE} --folder-key ${FOLDER}`,
426
+ Output: {
427
+ Code: "InstanceElementExecutions",
428
+ Data: {
429
+ InstanceId: INSTANCE,
430
+ ProcessKey: PROCESS,
431
+ Status: "Running",
432
+ ElementExecutions: [
433
+ {
434
+ ElementId: ELEMENT,
435
+ ElementType: "UserTask",
436
+ Status: "Completed",
437
+ StartedTimeUtc: "2026-10-13T09:12:05Z"
438
+ }
439
+ ]
567
440
  }
568
- return;
569
441
  }
570
- const [error, tenantNodes] = await catchError(listNodes());
571
- if (error) {
572
- OutputFormatter.error({
573
- Result: RESULTS.Failure,
574
- Message: "Error listing nodes",
575
- Instructions: error.message
576
- });
577
- processContext.exit(1);
578
- return;
579
- }
580
- const merged = await mergeWithKnownSdkNodes(tenantNodes);
581
- const totalCount = merged.length;
582
- const effectiveLimit = showAll ? totalCount : options.limit;
583
- const slice = merged.slice(options.offset, options.offset + effectiveLimit);
584
- const truncated = options.offset + slice.length < totalCount;
585
- const gatedCount = merged.filter((m) => !m.availableOnTenant).length;
586
- OutputFormatter.success({
587
- Result: RESULTS.Success,
588
- Code: "NodeListSuccess",
589
- Data: slice.map((m) => flattenNodeWithAvailability(m.node, m.availableOnTenant)),
590
- Pagination: new Pagination({
591
- returned: slice.length,
592
- limit: effectiveLimit,
593
- offset: options.offset,
594
- total: totalCount
595
- })
596
- });
597
- if (truncated) {
598
- logger.info(`Showing ${shownRows(slice.length, options.offset)} of ${totalCount} (${gatedCount} not enabled on this tenant). Use --limit, --offset or --limit -1 to get more.`);
599
- } else if (gatedCount > 0) {
600
- logger.info(`${gatedCount} of ${totalCount} node type(s) are not enabled on this tenant (AvailableOnTenant=false).`);
601
- }
602
- });
603
- registry.command("search").description("Find nodes by keyword and/or field filters").addHelpText("after", `
604
- Filter syntax:
605
- field=value equality (default operator)
606
- field:contains=value field contains value
607
- field:startsWith=value field starts with value
608
- field:endsWith=value field ends with value
609
- field:in=value1,value2 field matches any of the values
610
- field1=v1,field2=v2 multiple conditions (AND logic)
611
-
612
- Filterable fields:
613
- category / cat e.g. "connector", "agent"
614
- type / nodetype node type identifier
615
- tags / tag node tags
616
- displayname / name / label human-readable display name
617
-
618
- Examples:
619
- ${cmd} search slack
620
- ${cmd} search --filter "category=connector"
621
- ${cmd} search --filter "displayname:contains=send message"
622
- ${cmd} search slack --filter "category=connector"
623
- ${cmd} search --filter "tags:in=ai,automation"
624
- ${cmd} search --filter "category=connector,displayname:contains=slack"
625
-
626
- Tip: pipe through --output-filter to extract just the nodeType values:
627
- ${cmd} search slack --output-filter "[*].NodeType"
628
-
629
- In-solution (--local):
630
- cd MySolution/MyFlow && ${cmd} search agent --local`).argument("[keyword]", "Search term matched against nodeType, category, tags, display name, and description").option("-f, --filter <filter>", "Structured field filter: field=value or field:operator=value. Comma-separated = AND. Fields: category, type, tags, displayname, description.").option("--local", "Search only in-solution project nodes (requires .uipx in CWD, parent, or grandparent). Omits `AvailableOnTenant` (no tenant lookup).").examples(searchExamples).trackedAction(processContext, async (keyword, options) => {
631
- let parsedFilters;
632
- if (options.filter) {
633
- const [parseError, parsed] = catchError(() => parseFilterString(options.filter));
634
- if (parseError) {
635
- if (parseError instanceof FilterParseError) {
636
- OutputFormatter.error({
637
- Result: RESULTS.Failure,
638
- Message: "Invalid filter syntax",
639
- Instructions: `${parseError.message} Examples: category=agent, displayname:contains=http, tags:in=ai,automation.`
640
- });
641
- processContext.exit(1);
642
- return;
643
- }
644
- OutputFormatter.error({
645
- Result: RESULTS.Failure,
646
- Message: "Error searching nodes",
647
- Instructions: parseError.message
648
- });
649
- processContext.exit(1);
650
- return;
651
- }
652
- parsedFilters = parsed;
653
- }
654
- if (!keyword && !parsedFilters) {
655
- OutputFormatter.error({
656
- Result: RESULTS.Failure,
657
- Message: "Search requires either a keyword or filters",
658
- Instructions: "Provide a keyword or use --filter flag"
659
- });
660
- processContext.exit(1);
661
- return;
662
- }
663
- const {
664
- filterNodesByKeyword,
665
- getLocalSolutionSnapshot,
666
- localContractWarning,
667
- searchNodeSummariesWithAvailability,
668
- searchNodes,
669
- searchNodesWithFilters
670
- } = await import("./node-sync-service-76b9e4r5.js");
671
- const searchLocal = () => parsedFilters ? searchNodesWithFilters(keyword, parsedFilters, {
672
- local: true
673
- }) : searchNodes(keyword, { local: true });
674
- if (options.local) {
675
- const [searchError2, snapshot] = await catchError(getLocalSolutionSnapshot());
676
- if (searchError2) {
677
- OutputFormatter.error({
678
- Result: RESULTS.Failure,
679
- Message: "Error searching nodes",
680
- Instructions: searchError2.message
681
- });
682
- processContext.exit(1);
683
- return;
684
- }
685
- const { searchWithFilters } = await import("./filter-engine-7ep90g7f.js");
686
- const results2 = parsedFilters ? searchWithFilters(snapshot.manifests, keyword, parsedFilters) : filterNodesByKeyword(snapshot.manifests, keyword);
687
- const warning2 = localContractWarning(snapshot, results2);
688
- OutputFormatter.success({
689
- Result: RESULTS.Success,
690
- Code: "NodeSearchSuccess",
691
- Data: results2.map(flattenNodeForDisplay),
692
- ...await localResultNotes(warning2)
693
- });
694
- return;
695
- }
696
- const [searchError, results] = await catchError(searchNodeSummariesWithAvailability(keyword, parsedFilters));
697
- if (searchError) {
698
- OutputFormatter.error({
699
- Result: RESULTS.Failure,
700
- Message: "Error searching nodes",
701
- Instructions: searchError.message
702
- });
703
- processContext.exit(1);
704
- return;
705
- }
706
- let warning;
707
- if (results.length === 0) {
708
- const [, localMatches] = await catchError(searchLocal());
709
- if (localMatches && localMatches.length > 0) {
710
- warning = `No tenant node matches, but ${localMatches.length} node(s) from projects in this solution do. Re-run the same search with --local.`;
711
- }
712
- }
713
- OutputFormatter.success({
714
- Result: RESULTS.Success,
715
- Code: "NodeSearchSuccess",
716
- Data: results.map((result) => flattenNodeWithAvailability(result.node, result.availableOnTenant)),
717
- ...warning ? { Warning: warning } : {}
718
- });
719
- });
720
- registry.command("get").description("Get the full schema for a single node. For connector nodes (uipath.connector.*), the base manifest is automatically enriched with live metadata from Integration Service.").addHelpText("after", `
721
- IS-enriched fields (connector nodes only, fetched live from Integration Service):
722
-
723
- Activity nodes (uipath.connector.*, not trigger):
724
- inputDefinition.fields Fields to configure. Each field has: name, displayName, type, required, and optionally reference (lookup: objectName, path, lookupValue, lookupNames, childPath; 4.0.0 activities carry scriptRef instead of objectName — resolve with 'uip is resources run script --script-ref') or enum.
725
- outputResponseDefinition Fields produced after the node runs.
726
- connectorMethodInfo HTTP details (method, path, operationId).
727
- --connection-id optional — adds custom fields specific to that account.
728
-
729
- Trigger nodes (uipath.connector.trigger.*):
730
- eventParameters Fields that configure the trigger (e.g. which folder to watch).
731
- filterFields Fields used to filter which events fire the trigger.
732
- outputResponseDefinition Fields produced by the trigger event payload.
733
- eventMode "webhooks" or "polling".
734
- login + --connection-id required — without both, no enrichment is returned.
735
-
736
- Examples:
737
- ${cmd} get uipath.slack.connector.send-message
738
- ${cmd} get uipath.connector.uipath-salesforce-slack.send-message --connection-id <id>
739
- ${cmd} get uipath.connector.trigger.uipath-microsoft-outlook365.email-received --connection-id <id>
740
-
741
- In-solution (--local):
742
- cd MySolution/MyFlow && ${cmd} get <node-type> --local`).argument("<node-type>", `Node type identifier — get it from '${cmd} search'`).option("--connection-id <id>", "Connection ID for Integration Service connector node enrichment. Required for connector trigger nodes; optional for connector activity nodes.").option("--local", "Get node from in-solution projects only (requires .uipx in CWD, parent, or grandparent)").examples(getExamples).trackedAction(processContext, async (nodeType, options) => {
743
- const { getLocalNodeEnriched, getNode, getNodeEnriched } = await import("./node-sync-service-76b9e4r5.js");
744
- const [error, lookedUp] = await catchError(options.local ? getLocalNodeEnriched(nodeType, options.connectionId) : getNodeEnriched(nodeType, options.connectionId, {
745
- local: options.local
746
- }).then((node) => ({ node, warning: undefined })));
747
- if (error) {
748
- OutputFormatter.error({
749
- Result: RESULTS.Failure,
750
- Message: "Error retrieving node",
751
- Instructions: error.message
752
- });
753
- processContext.exit(1);
754
- return;
755
- }
756
- const result = lookedUp?.node;
757
- const warning = lookedUp?.warning;
758
- if (!result) {
759
- const [, inSolution] = options.local ? [undefined, null] : await catchError(getNode(nodeType, { local: true }));
760
- const withoutProcessResource = inSolution ? undefined : await explainNodeTypeWithoutProcessResource(nodeType);
761
- OutputFormatter.error({
762
- Result: RESULTS.Failure,
763
- Message: withoutProcessResource?.message ?? "Node not found",
764
- Instructions: withoutProcessResource?.instructions ?? (inSolution ? `'${nodeType}' is a node of a project in this solution, which only --local looks up. Run: ${cmd} get ${nodeType} --local` : `No node found with node type: ${nodeType}`),
765
- ErrorCode: "not_found"
766
- });
767
- processContext.exit(1);
768
- return;
769
- }
770
- OutputFormatter.success({
771
- Result: RESULTS.Success,
772
- Code: "NodeGetSuccess",
773
- Data: {
774
- Node: result
775
- },
776
- ...warning ? { Warning: warning } : {}
777
- }, { preserveDataKeys: true });
778
- });
779
- };
780
-
781
- // ../maestro-sdk/src/with-debug-pims-call.ts
782
- async function createDebugPimsConfig() {
783
- const status = await getLoginStatusAsync({
784
- ensureTokenValidityMinutes: 10
785
- });
786
- if (status.loginStatus !== "Logged in" || !status.baseUrl || !status.accessToken) {
787
- throw new Error(status.hint ? `Not logged in. ${status.hint}` : "Not logged in. Run 'uip login' first.");
788
- }
789
- if (!status.organizationId) {
790
- throw new Error("Organization ID not available. Ensure you are logged in with an organization context.");
791
- }
792
- if (!status.tenantId) {
793
- throw new Error("Tenant ID not available. Ensure UIPATH_TENANT_ID is set.");
794
- }
795
- if (!status.tenantName) {
796
- throw new Error("Tenant name not available. Ensure you are logged in with a tenant context.");
797
- }
798
- return {
799
- baseUrl: status.baseUrl,
800
- organizationId: status.organizationId,
801
- tenantName: status.tenantName,
802
- tenantId: status.tenantId,
803
- authToken: status.accessToken
804
- };
805
- }
806
- async function withDebugPimsCall(fn, errorMessage) {
807
- const [configError, config] = await catchError(createDebugPimsConfig());
808
- if (configError) {
809
- logger.warn(`${errorMessage}: ${configError.message}`);
810
- OutputFormatter.error({
811
- Result: RESULTS.Failure,
812
- Message: errorMessage,
813
- Instructions: configError.message
814
- });
815
- processContext.exit(1);
816
- return;
817
- }
818
- if (!config.folderKey) {
819
- const [folderError, folder] = await catchError(getPersonalFolderKey(config));
820
- if (folderError) {
821
- logger.warn(`Could not resolve personal folder: ${folderError.message}`);
822
- } else {
823
- config.folderKey = folder.key;
824
- config.organizationUnitId = folder.id;
825
- }
826
- }
827
- const [error, result] = await catchError(fn(config));
828
- if (error) {
829
- const msg = await extractErrorMessage(error);
830
- logger.warn(`${errorMessage}: ${msg}`);
831
- OutputFormatter.error({
832
- Result: RESULTS.Failure,
833
- Message: errorMessage,
834
- Instructions: msg
835
- });
836
- processContext.exit(1);
837
- return;
838
- }
839
- return result;
840
- }
841
-
842
- // ../maestro-sdk/src/shared-commands/examples.ts
843
- var INSTANCE = "f4a1c2b3-0000-4000-8000-000000000001";
844
- var FOLDER = "b2c3d4e5-0000-4000-8000-000000000002";
845
- var PROCESS = "c3d4e5f6-0000-4000-8000-000000000003";
846
- var INCIDENT = "d4e5f6a7-0000-4000-8000-000000000004";
847
- var ELEMENT = "Task_Review";
848
- var SOLUTION = "e5f6a7b8-0000-4000-8000-000000000009";
849
- var PROJECT = "f6a7b8c9-0000-4000-8000-00000000000a";
850
- var operation = (verb, code, description, status) => (prefix) => ({
851
- Description: description,
852
- Command: `${prefix} instance ${verb} ${INSTANCE} --folder-key ${FOLDER}`,
853
- Output: { Code: code, Data: { InstanceId: INSTANCE, Status: status } }
854
- });
855
- var EXAMPLES = {
856
- "instance list": (prefix) => ({
857
- Description: "List the faulted instances in a folder",
858
- Command: `${prefix} instance list --folder-key ${FOLDER} --status Faulted --limit 2`,
859
- Output: {
860
- Code: "InstanceList",
861
- Data: [
862
- {
863
- InstanceId: INSTANCE,
864
- InstanceDisplayName: "Claim 1042",
865
- ProcessKey: PROCESS,
866
- PackageVersion: "1.0.3",
867
- LatestRunStatus: "Faulted",
868
- StartedTime: "2026-10-13T09:12:00Z"
869
- }
870
- ]
871
- }
872
- }),
873
- "instance get": (prefix) => ({
874
- Description: "Get one instance and its latest run",
875
- Command: `${prefix} instance get ${INSTANCE} --folder-key ${FOLDER}`,
876
- Output: {
877
- Code: "InstanceGet",
878
- Data: {
879
- InstanceId: INSTANCE,
880
- InstanceDisplayName: "Claim 1042",
881
- ProcessKey: PROCESS,
882
- PackageVersion: "1.0.3",
883
- LatestRunStatus: "Running",
884
- StartedTime: "2026-10-13T09:12:00Z",
885
- CompletedTime: null
886
- }
887
- }
888
- }),
889
- "instance pause": operation("pause", "InstancePaused", "Pause a running instance", "Paused"),
890
- "instance resume": operation("resume", "InstanceResumed", "Resume a paused instance", "Running"),
891
- "instance cancel": operation("cancel", "InstanceCanceled", "Cancel an instance", "Canceling"),
892
- "instance retry": operation("retry", "InstanceRetried", "Retry a faulted instance from where it failed", "Running"),
893
- "instance variables": (prefix) => ({
894
- Description: "Read an instance's variables",
895
- Command: `${prefix} instance variables ${INSTANCE} --folder-key ${FOLDER}`,
896
- Output: {
897
- Code: "InstanceVariables",
898
- Data: {
899
- InstanceId: INSTANCE,
900
- ParentElementId: null,
901
- GlobalVariables: [
902
- {
903
- Id: "claimAmount",
904
- Name: "claimAmount",
905
- Type: "number",
906
- Value: 1200,
907
- ElementId: "root",
908
- Source: "=vars.claimAmount"
909
- }
910
- ],
911
- Elements: []
912
- }
913
- }
914
- }),
915
- "instance variables-all": (prefix) => ({
916
- Description: "Read the variables of every scope in an instance",
917
- Command: `${prefix} instance variables-all ${INSTANCE} --folder-key ${FOLDER}`,
918
- Output: {
919
- Code: "InstanceVariablesAll",
920
- Data: {
921
- Variables: [
922
- {
923
- InstanceId: INSTANCE,
924
- ParentElementId: null,
925
- GlobalVariables: [],
926
- Elements: []
927
- }
928
- ]
929
- }
930
- }
931
- }),
932
- "instance global-variables": (prefix) => ({
933
- Description: "Read an instance's global variables",
934
- Command: `${prefix} instance global-variables ${INSTANCE} --folder-key ${FOLDER}`,
935
- Output: {
936
- Code: "InstanceGlobalVariables",
937
- Data: {
938
- InstanceId: INSTANCE,
939
- Globals: { claimAmount: 1200 },
940
- Count: 1,
941
- RetrievedAt: "2026-10-13T09:20:00Z"
942
- }
943
- }
944
- }),
945
- "instance variables-set": (prefix) => ({
946
- Description: "Patch variables on a running instance from a file",
947
- Command: `${prefix} instance variables-set ${INSTANCE} --folder-key ${FOLDER} --inputs @patch.json`,
948
- Output: {
949
- Code: "InstanceVariablesSet",
950
- Data: {}
951
- }
952
- }),
953
- "instance incidents": (prefix) => ({
954
- Description: "List the incidents an instance raised",
955
- Command: `${prefix} instance incidents ${INSTANCE} --folder-key ${FOLDER}`,
956
- Output: {
957
- Code: "InstanceIncidents",
958
- Data: [
959
- {
960
- IncidentId: INCIDENT,
961
- InstanceId: INSTANCE,
962
- ElementId: ELEMENT,
963
- IncidentStatus: "Open",
964
- ErrorCode: "TaskFailed",
965
- ErrorMessage: "The action app returned an error"
966
- }
967
- ]
968
- }
969
- }),
970
- "instance asset": (prefix) => ({
971
- Description: "Get the asset an instance runs",
972
- Command: `${prefix} instance asset ${INSTANCE} --folder-key ${FOLDER}`,
973
- Output: { Code: "InstanceAsset", Data: {} }
974
- }),
975
- "instance migrate": (prefix) => ({
976
- Description: "Move an instance to a newer package version",
977
- Command: `${prefix} instance migrate ${INSTANCE} 1.0.4 --folder-key ${FOLDER} --comment "Fix review step"`,
978
- Output: {
979
- Code: "InstanceMigrated",
980
- Data: { InstanceId: INSTANCE, Status: "Running" }
981
- }
982
- }),
983
- "instance goto": (prefix) => ({
984
- Description: "Move an instance's cursor from one element to another",
985
- Command: `${prefix} instance goto ${INSTANCE} '[{"sourceElementId":"${ELEMENT}","targetElementId":"Task_Approve"}]' --folder-key ${FOLDER}`,
986
- Output: {
987
- Code: "InstanceGoto",
988
- Data: { InstanceId: INSTANCE, Status: "Running" }
989
- }
990
- }),
991
- "instance cursors": (prefix) => ({
992
- Description: "List the elements an instance is currently at",
993
- Command: `${prefix} instance cursors ${INSTANCE} --folder-key ${FOLDER}`,
994
- Output: {
995
- Code: "InstanceCursors",
996
- Data: { ElementIds: [ELEMENT] }
997
- }
998
- }),
999
- "instance message send": (prefix) => ({
1000
- Description: "Send a message to the instances waiting for it",
1001
- Command: `${prefix} instance message send --folder-key ${FOLDER} --inputs @message.json`,
1002
- Output: {
1003
- Code: "MessageSent",
1004
- Data: {
1005
- Id: "e5f6a7b8-0000-4000-8000-000000000005",
1006
- JobId: "f6a7b8c9-0000-4000-8000-000000000006"
1007
- }
1008
- }
1009
- }),
1010
- "instance element-executions": (prefix) => ({
1011
- Description: "List how each element of an instance ran",
1012
- Command: `${prefix} instance element-executions ${INSTANCE} --folder-key ${FOLDER}`,
1013
- Output: {
1014
- Code: "InstanceElementExecutions",
1015
- Data: {
1016
- InstanceId: INSTANCE,
1017
- ProcessKey: PROCESS,
1018
- Status: "Running",
1019
- ElementExecutions: [
1020
- {
1021
- ElementId: ELEMENT,
1022
- ElementType: "UserTask",
1023
- Status: "Completed",
1024
- StartedTimeUtc: "2026-10-13T09:12:05Z"
1025
- }
1026
- ]
1027
- }
1028
- }
1029
- }),
1030
- "instance element cancel": (prefix) => ({
1031
- Description: "Cancel one running element of an instance",
1032
- Command: `${prefix} instance element cancel ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
1033
- Output: {
1034
- Code: "ElementCanceled",
1035
- Data: { InstanceId: INSTANCE, Status: "Running" }
442
+ }),
443
+ "instances elements cancel": (prefix) => ({
444
+ Description: "Cancel one running element of an instance",
445
+ Command: `${prefix} instances elements cancel ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
446
+ Output: {
447
+ Code: "ElementCanceled",
448
+ Data: { InstanceId: INSTANCE, Status: "Running" }
1036
449
  }
1037
450
  }),
1038
- "instance element retry": (prefix) => ({
451
+ "instances elements retry": (prefix) => ({
1039
452
  Description: "Retry one faulted element of an instance",
1040
- Command: `${prefix} instance element retry ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
453
+ Command: `${prefix} instances elements retry ${INSTANCE} ${ELEMENT} --folder-key ${FOLDER}`,
1041
454
  Output: {
1042
455
  Code: "ElementRetried",
1043
456
  Data: { InstanceId: INSTANCE, Status: "Running" }
1044
457
  }
1045
458
  }),
1046
- "incident summary": (prefix) => ({
459
+ "incidents summary": (prefix) => ({
1047
460
  Description: "Summarize the open incidents in a folder by error",
1048
- Command: `${prefix} incident summary --folder-key ${FOLDER} --limit 2`,
461
+ Command: `${prefix} incidents summary --folder-key ${FOLDER} --limit 2`,
1049
462
  Output: {
1050
463
  Code: "IncidentSummary",
1051
464
  Data: [
@@ -1059,9 +472,9 @@ var EXAMPLES = {
1059
472
  ]
1060
473
  }
1061
474
  }),
1062
- "incident get": (prefix) => ({
475
+ "incidents get": (prefix) => ({
1063
476
  Description: "Get one incident with its error details",
1064
- Command: `${prefix} incident get ${INCIDENT} --folder-key ${FOLDER}`,
477
+ Command: `${prefix} incidents get ${INCIDENT} --folder-key ${FOLDER}`,
1065
478
  Output: {
1066
479
  Code: "IncidentGet",
1067
480
  Data: {
@@ -1220,9 +633,9 @@ var EXAMPLES = {
1220
633
  ]
1221
634
  }
1222
635
  }),
1223
- "debug-instance create": (prefix) => ({
636
+ "debug-instances create": (prefix) => ({
1224
637
  Description: "Start a debug run of an uploaded solution's entry point",
1225
- Command: `${prefix} debug-instance create --solution-id ${SOLUTION} --project-id ${PROJECT} --entry-point "/Main.bpmn#start" --debug-mode StepByStep`,
638
+ Command: `${prefix} debug-instances create --solution-id ${SOLUTION} --project-id ${PROJECT} --entry-point "/Main.bpmn#start" --debug-mode StepByStep`,
1226
639
  Output: {
1227
640
  Code: "DebugInstanceCreated",
1228
641
  Data: {
@@ -1232,9 +645,9 @@ var EXAMPLES = {
1232
645
  }
1233
646
  }
1234
647
  }),
1235
- "debug-instance status": (prefix) => ({
648
+ "debug-instances status": (prefix) => ({
1236
649
  Description: "Check where a debug run is",
1237
- Command: `${prefix} debug-instance status ${INSTANCE}`,
650
+ Command: `${prefix} debug-instances status ${INSTANCE}`,
1238
651
  Output: {
1239
652
  Code: "DebugInstanceStatus",
1240
653
  Data: {
@@ -1245,33 +658,33 @@ var EXAMPLES = {
1245
658
  }
1246
659
  }
1247
660
  }),
1248
- "debug-instance breakpoints": (prefix) => ({
661
+ "debug-instances breakpoints": (prefix) => ({
1249
662
  Description: "Replace a debug run's breakpoints from a file",
1250
- Command: `${prefix} debug-instance breakpoints ${INSTANCE} --inputs @breakpoints.json`,
663
+ Command: `${prefix} debug-instances breakpoints ${INSTANCE} --inputs @breakpoints.json`,
1251
664
  Output: {
1252
665
  Code: "DebugInstanceBreakpointsUpdated",
1253
666
  Data: {}
1254
667
  }
1255
668
  }),
1256
- "debug-instance cancel": (prefix) => ({
669
+ "debug-instances cancel": (prefix) => ({
1257
670
  Description: "Stop a debug run",
1258
- Command: `${prefix} debug-instance cancel ${INSTANCE}`,
671
+ Command: `${prefix} debug-instances cancel ${INSTANCE}`,
1259
672
  Output: {
1260
673
  Code: "DebugInstanceCanceled",
1261
674
  Data: {}
1262
675
  }
1263
676
  }),
1264
- "debug-instance continue": (prefix) => ({
677
+ "debug-instances continue": (prefix) => ({
1265
678
  Description: "Continue a paused debug run",
1266
- Command: `${prefix} debug-instance continue ${INSTANCE}`,
679
+ Command: `${prefix} debug-instances continue ${INSTANCE}`,
1267
680
  Output: {
1268
681
  Code: "DebugInstanceContinued",
1269
682
  Data: {}
1270
683
  }
1271
684
  }),
1272
- "debug-instance incidents": (prefix) => ({
685
+ "debug-instances incidents": (prefix) => ({
1273
686
  Description: "List the incidents a debug run raised",
1274
- Command: `${prefix} debug-instance incidents ${INSTANCE}`,
687
+ Command: `${prefix} debug-instances incidents ${INSTANCE}`,
1275
688
  Output: {
1276
689
  Code: "DebugInstanceIncidents",
1277
690
  Data: [
@@ -1283,25 +696,25 @@ var EXAMPLES = {
1283
696
  ]
1284
697
  }
1285
698
  }),
1286
- "debug-instance variables": (prefix) => ({
699
+ "debug-instances variables": (prefix) => ({
1287
700
  Description: "Read a paused debug run's variables",
1288
- Command: `${prefix} debug-instance variables ${INSTANCE}`,
701
+ Command: `${prefix} debug-instances variables ${INSTANCE}`,
1289
702
  Output: {
1290
703
  Code: "DebugInstanceVariables",
1291
704
  Data: { InstanceId: INSTANCE, Globals: {}, Elements: [] }
1292
705
  }
1293
706
  }),
1294
- "debug-instance variables-set": (prefix) => ({
707
+ "debug-instances variables-set": (prefix) => ({
1295
708
  Description: "Patch a paused debug run's variables from a file",
1296
- Command: `${prefix} debug-instance variables-set ${INSTANCE} --inputs @patch.json`,
709
+ Command: `${prefix} debug-instances variables-set ${INSTANCE} --inputs @patch.json`,
1297
710
  Output: {
1298
711
  Code: "DebugInstanceVariablesSet",
1299
712
  Data: {}
1300
713
  }
1301
714
  }),
1302
- "debug-instance variables-all": (prefix) => ({
715
+ "debug-instances variables-all": (prefix) => ({
1303
716
  Description: "Read the variables of every scope in a debug run",
1304
- Command: `${prefix} debug-instance variables-all ${INSTANCE}`,
717
+ Command: `${prefix} debug-instances variables-all ${INSTANCE}`,
1305
718
  Output: {
1306
719
  Code: "DebugInstanceVariablesAll",
1307
720
  Data: { Variables: [] }
@@ -1340,11 +753,11 @@ var attachSharedExamples = (group) => {
1340
753
 
1341
754
  // ../maestro-sdk/src/shared-commands/debug-instances.ts
1342
755
  var DEBUG_API_PREFIX = "/api/v1/debug-instances";
1343
- var VALID_DEBUG_MODES = Object.keys(DEBUG_MODE_MAP);
1344
- var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP);
756
+ var VALID_DEBUG_MODES = Object.keys(DEBUG_MODE_MAP2);
757
+ var VALID_SIMULATION_MODES = Object.keys(SIMULATION_MODE_MAP2);
1345
758
  var registerSharedDebugInstanceCommands = (program, config) => {
1346
759
  const { toolLabel } = config;
1347
- const debugInstance = program.command("debug-instance").description(`Manage ${toolLabel} debug instance operations`);
760
+ const debugInstance = program.command("debug-instances").alias("debug-instance").description(`Manage ${toolLabel} debug instance operations`);
1348
761
  debugInstance.command("create").description(`Create a ${toolLabel} debug instance from an already-uploaded solution`).requiredOption("--solution-id <id>", "Solution ID (from a previous upload or Studio Web)").requiredOption("--project-id <id>", "Studio Web project ID within the solution").requiredOption("--entry-point <path>", 'Entry point path (e.g. "/Main.bpmn#start")').option("--process-type <type>", "Process type", "processOrchestration").option("--debug-mode <mode>", "Debug mode: Default (pause at breakpoints), StepByStep (pause at every step), SingleStep (one step only)", "Default").option("--simulation-mode <mode>", "Simulation mode: None, All (simulate all elements), Selective (simulate except opt-outs)", "None").option("-i, --inputs <json>", "Input arguments as JSON string", "{}").trackedAction(processContext, async (options) => {
1349
762
  if (!VALID_DEBUG_MODES.includes(options.debugMode)) {
1350
763
  OutputFormatter.error({
@@ -1364,7 +777,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1364
777
  processContext.exit(1);
1365
778
  return;
1366
779
  }
1367
- const [configError, config2] = await catchError(createDebugPimsConfig());
780
+ const [configError, config] = await catchError2(createDebugPimsConfig());
1368
781
  if (configError) {
1369
782
  OutputFormatter.error({
1370
783
  Result: RESULTS.Failure,
@@ -1374,7 +787,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1374
787
  processContext.exit(1);
1375
788
  return;
1376
789
  }
1377
- const [folderError, folder] = await catchError(getPersonalFolderKey(config2));
790
+ const [folderError, folder] = await catchError2(getPersonalFolderKey2(config));
1378
791
  if (folderError) {
1379
792
  OutputFormatter.error({
1380
793
  Result: RESULTS.Failure,
@@ -1384,9 +797,9 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1384
797
  processContext.exit(1);
1385
798
  return;
1386
799
  }
1387
- config2.folderKey = folder.key;
1388
- config2.organizationUnitId = folder.id;
1389
- const [sessionError, session] = await catchError(beginDebugSession(config2, options.inputs));
800
+ config.folderKey = folder.key;
801
+ config.organizationUnitId = folder.id;
802
+ const [sessionError, session] = await catchError2(beginDebugSession2(config, options.inputs));
1390
803
  if (sessionError) {
1391
804
  OutputFormatter.error({
1392
805
  Result: RESULTS.Failure,
@@ -1396,7 +809,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1396
809
  processContext.exit(1);
1397
810
  return;
1398
811
  }
1399
- const [createError, result] = await catchError(createDebugInstance(config2, session.jobKey, options.solutionId, options.projectId, options.entryPoint, options.processType, options.debugMode, options.simulationMode));
812
+ const [createError, result] = await catchError2(createDebugInstance2(config, session.jobKey, options.solutionId, options.projectId, options.entryPoint, options.processType, options.debugMode, options.simulationMode));
1400
813
  if (createError) {
1401
814
  OutputFormatter.error({
1402
815
  Result: RESULTS.Failure,
@@ -1414,11 +827,11 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1414
827
  runId: result.runId,
1415
828
  jobKey: session.jobKey
1416
829
  },
1417
- Instructions: "Use 'debug-instance status <instance-id>' to check the run. Use 'debug-instance incidents <instance-id>' or 'debug-instance variables <instance-id>' to inspect it."
830
+ Instructions: "Use 'debug-instances status <instance-id>' to check the run. Use 'debug-instances incidents <instance-id>' or 'debug-instances variables <instance-id>' to inspect it."
1418
831
  });
1419
832
  });
1420
833
  debugInstance.command("status").description(`Get the current status of a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
1421
- const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/element-executions`, "get-debug-instance-status"), "Error getting debug instance status");
834
+ const result = await withDebugPimsCall((cfg) => debugPimsGet2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/element-executions`, "get-debug-instance-status"), "Error getting debug instance status");
1422
835
  if (!result)
1423
836
  return;
1424
837
  OutputFormatter.success({
@@ -1428,7 +841,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1428
841
  });
1429
842
  });
1430
843
  debugInstance.command("breakpoints").description(`Update breakpoints for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Breakpoints payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
1431
- const [readError, data] = await catchError(resolveJsonInput({
844
+ const [readError, data] = await catchError2(resolveJsonInput({
1432
845
  inline: options.inputs,
1433
846
  allowStdin: true
1434
847
  }));
@@ -1444,7 +857,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1444
857
  const body = data ?? {
1445
858
  breakpoints: []
1446
859
  };
1447
- const result = await withDebugPimsCall((cfg) => debugPimsPut(cfg, `${DEBUG_API_PREFIX}/${instanceId}/breakpoints`, body), "Error updating breakpoints");
860
+ const result = await withDebugPimsCall((cfg) => debugPimsPut2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/breakpoints`, body), "Error updating breakpoints");
1448
861
  if (!result)
1449
862
  return;
1450
863
  OutputFormatter.success({
@@ -1454,7 +867,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1454
867
  });
1455
868
  });
1456
869
  debugInstance.command("cancel").description(`Cancel a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
1457
- const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/cancel`, { comment: "" }), "Error canceling debug instance");
870
+ const result = await withDebugPimsCall((cfg) => debugPimsPost2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/cancel`, { comment: "" }), "Error canceling debug instance");
1458
871
  if (!result)
1459
872
  return;
1460
873
  OutputFormatter.success({
@@ -1464,7 +877,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1464
877
  });
1465
878
  });
1466
879
  debugInstance.command("continue").description(`Continue execution on a paused ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Continue payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
1467
- const [readError, data] = await catchError(resolveJsonInput({
880
+ const [readError, data] = await catchError2(resolveJsonInput({
1468
881
  inline: options.inputs,
1469
882
  allowStdin: true
1470
883
  }));
@@ -1480,7 +893,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1480
893
  const body = data ?? {
1481
894
  nextStep: false
1482
895
  };
1483
- const result = await withDebugPimsCall((cfg) => debugPimsPost(cfg, `${DEBUG_API_PREFIX}/${instanceId}/continue`, body), "Error continuing debug instance");
896
+ const result = await withDebugPimsCall((cfg) => debugPimsPost2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/continue`, body), "Error continuing debug instance");
1484
897
  if (!result)
1485
898
  return;
1486
899
  OutputFormatter.success({
@@ -1490,7 +903,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1490
903
  });
1491
904
  });
1492
905
  debugInstance.command("incidents").description(`Get incidents for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
1493
- const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/incidents`), "Error getting debug instance incidents");
906
+ const result = await withDebugPimsCall((cfg) => debugPimsGet2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/incidents`), "Error getting debug instance incidents");
1494
907
  if (!result)
1495
908
  return;
1496
909
  OutputFormatter.success({
@@ -1513,9 +926,9 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1513
926
  const query = buildQueryString({
1514
927
  parentElementId: options.parentElementId
1515
928
  });
1516
- const result = await withDebugPimsCall((cfg) => expectGlobals.length > 0 ? fetchDebugInstanceVariables(cfg, instanceId, {
929
+ const result = await withDebugPimsCall((cfg) => expectGlobals.length > 0 ? fetchDebugInstanceVariables2(cfg, instanceId, {
1517
930
  expectGlobals
1518
- }) : debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`), "Error getting debug instance variables");
931
+ }) : debugPimsGet2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`), "Error getting debug instance variables");
1519
932
  if (!result)
1520
933
  return;
1521
934
  OutputFormatter.success({
@@ -1525,7 +938,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1525
938
  });
1526
939
  });
1527
940
  debugInstance.command("variables-set").description(`Update variables for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").option("--parent-element-id <id>", "Filter by parent element ID").trackedAction(processContext, async (instanceId, options) => {
1528
- const [readError, data] = await catchError(resolveJsonInput({
941
+ const [readError, data] = await catchError2(resolveJsonInput({
1529
942
  inline: options.inputs,
1530
943
  allowStdin: true
1531
944
  }));
@@ -1551,7 +964,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1551
964
  const query = buildQueryString({
1552
965
  parentElementId: options.parentElementId
1553
966
  });
1554
- const result = await withDebugPimsCall((cfg) => debugPimsPatch(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`, body), "Error updating debug instance variables");
967
+ const result = await withDebugPimsCall((cfg) => debugPimsPatch2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables${query}`, body), "Error updating debug instance variables");
1555
968
  if (!result)
1556
969
  return;
1557
970
  OutputFormatter.success({
@@ -1561,7 +974,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
1561
974
  });
1562
975
  });
1563
976
  debugInstance.command("variables-all").description(`Get all variables including subprocesses for a ${toolLabel} debug instance`).argument("<instance-id>", "Debug instance ID").trackedAction(processContext, async (instanceId) => {
1564
- const result = await withDebugPimsCall((cfg) => debugPimsGet(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables-all`), "Error getting all debug instance variables");
977
+ const result = await withDebugPimsCall((cfg) => debugPimsGet2(cfg, `${DEBUG_API_PREFIX}/${instanceId}/variables-all`), "Error getting all debug instance variables");
1565
978
  if (!result)
1566
979
  return;
1567
980
  OutputFormatter.success({
@@ -1679,7 +1092,7 @@ function resolvePimsEnvelope(error, errorMessage, hint) {
1679
1092
  };
1680
1093
  }
1681
1094
  async function withPimsCall(fn, errorMessage, hint) {
1682
- const [configError, config] = await catchError(createPimsConfig());
1095
+ const [configError, config] = await catchError2(createPimsConfig());
1683
1096
  if (configError) {
1684
1097
  logger.warn(`${errorMessage}: ${configError.message}`);
1685
1098
  OutputFormatter.error({
@@ -1691,16 +1104,16 @@ async function withPimsCall(fn, errorMessage, hint) {
1691
1104
  processContext.exit(1);
1692
1105
  return;
1693
1106
  }
1694
- const [error, result] = await catchError(fn(config));
1107
+ const [error, result] = await catchError2(fn(config));
1695
1108
  if (error) {
1696
1109
  if (isNetworkError(error)) {
1697
- const msg2 = await extractErrorMessage(error);
1698
- logger.warn(`${errorMessage}: ${msg2}`);
1110
+ const msg = await extractErrorMessage(error);
1111
+ logger.warn(`${errorMessage}: ${msg}`);
1699
1112
  OutputFormatter.error({
1700
1113
  Result: RESULTS.Failure,
1701
1114
  Code: "NetworkError",
1702
1115
  Message: errorMessage,
1703
- Instructions: msg2
1116
+ Instructions: msg
1704
1117
  });
1705
1118
  processContext.exit(1);
1706
1119
  return;
@@ -1735,7 +1148,7 @@ async function withPimsCall(fn, errorMessage, hint) {
1735
1148
  // ../maestro-sdk/src/shared-commands/incidents.ts
1736
1149
  var registerSharedIncidentCommands = (program, config) => {
1737
1150
  const { toolLabel } = config;
1738
- const incident = program.command("incident").description(`Manage ${toolLabel} incidents`);
1151
+ const incident = program.command("incidents").alias("incident").description(`Manage ${toolLabel} incidents`);
1739
1152
  incident.command("summary").description(`Get ${toolLabel} incident summaries across processes`).option("--folder-key <key>", "Folder key").option("-l, --limit <number>", "Number of items to return (1-10000)", parseLimit).option("--offset <number>", "Number of items to skip (0-1000000)", parseOffset, 0).option("--process-key <process-key>", "Filter by process key").option("--status <status>", "Filter by incident status").option("--severity <severity>", "Filter by incident severity").trackedAction(processContext, async (options) => {
1740
1153
  const query = buildQueryString({
1741
1154
  processKey: options.processKey,
@@ -1745,7 +1158,7 @@ var registerSharedIncidentCommands = (program, config) => {
1745
1158
  $skip: options.offset !== 0 ? options.offset : undefined
1746
1159
  });
1747
1160
  const reqOptions = { folderKey: options.folderKey };
1748
- const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/summary${query}`, reqOptions), "Error listing incidents");
1161
+ const result = await withPimsCall((config) => pimsGet(config, `/incidents/summary${query}`, reqOptions), "Error listing incidents");
1749
1162
  if (!result)
1750
1163
  return;
1751
1164
  OutputFormatter.success({
@@ -1756,7 +1169,7 @@ var registerSharedIncidentCommands = (program, config) => {
1756
1169
  });
1757
1170
  incident.command("get").description(`Get a single ${toolLabel} incident by ID`).argument("<incident-id>", "Incident ID").requiredOption("-f, --folder-key <key>", "Folder key").trackedAction(processContext, async (incidentId, options) => {
1758
1171
  const reqOptions = { folderKey: options.folderKey };
1759
- const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/${encodeURIComponent(incidentId)}`, reqOptions), "Error getting incident", { resource: "incident", id: incidentId });
1172
+ const result = await withPimsCall((config) => pimsGet(config, `/incidents/${encodeURIComponent(incidentId)}`, reqOptions), "Error getting incident", { resource: "incident", id: incidentId });
1760
1173
  if (!result)
1761
1174
  return;
1762
1175
  OutputFormatter.success({
@@ -1861,7 +1274,7 @@ var registerSharedInstanceCommands = (program, config) => {
1861
1274
  listFolderKeyRequired = folderKeyRequired
1862
1275
  } = config;
1863
1276
  const withFolderKey = (cmd, required = folderKeyRequired) => required ? cmd.requiredOption("-f, --folder-key <key>", "Folder key (GUID)") : cmd.option("-f, --folder-key <key>", "Folder key (GUID)");
1864
- const instances = program.command("instance").description(`Manage ${toolLabel} process instances`);
1277
+ const instances = program.command("instances").alias("instance").description(`Manage ${toolLabel} process instances`);
1865
1278
  const listCmd = instances.command("list").description(`List ${toolLabel} process instances. Filters are applied by the ` + "server: --status narrows by run status, --process-key by " + "process key (GUID), --package-id by package identifier, and " + "--from-date/--to-date by start time. Results page by cursor " + "— read Pagination.NextPage and pass it back via --next-page.");
1866
1279
  withFolderKey(listCmd, listFolderKeyRequired).option("-l, --limit <number>", `Number of items to return (1-${MAX_INSTANCE_PAGE_SIZE})`, parseInstanceLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Not supported by the instances API — use --next-page instead").option("--next-page <cursor>", "Cursor from a previous response's Pagination.NextPage").option("--process-key <process-key>", "Filter by process key (GUID). For the dotted package " + "identifier use --package-id.").option("--package-id <id>", "Filter by package ID").option("--error-code <code>", "Filter by error code").option("--status <status>", "Filter by instance status (repeatable; OR-semantics). " + `Values: ${INSTANCE_STATUS_LIST}.`, collectStatus, []).option("--from-date <iso-8601>", "Only include instances started at or after this ISO-8601 " + "timestamp (e.g. 2026-01-01T00:00:00Z).").option("--to-date <iso-8601>", "Only include instances started at or before this ISO-8601 " + "timestamp (e.g. 2026-02-01T00:00:00Z).").trackedAction(processContext, async (options) => {
1867
1280
  const filters = resolveListFilters(options);
@@ -1879,7 +1292,7 @@ var registerSharedInstanceCommands = (program, config) => {
1879
1292
  nextPage: options.nextPage
1880
1293
  });
1881
1294
  const reqOptions = { folderKey: options.folderKey };
1882
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances${query}`, reqOptions), "Error listing instances");
1295
+ const result = await withPimsCall((config) => pimsGet(config, `/instances${query}`, reqOptions), "Error listing instances");
1883
1296
  if (!result)
1884
1297
  return;
1885
1298
  const instanceList = extractProcessInstances(result);
@@ -1898,7 +1311,7 @@ var registerSharedInstanceCommands = (program, config) => {
1898
1311
  });
1899
1312
  const getCmd = instances.command("get").description(`Get a ${toolLabel} process instance by ID`).argument("<instance-id>", "Process instance ID");
1900
1313
  withFolderKey(getCmd).trackedAction(processContext, async (instanceId, options) => {
1901
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}`, { folderKey: options.folderKey }), "Error getting instance", { resource: "instance", id: instanceId });
1314
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}`, { folderKey: options.folderKey }), "Error getting instance", { resource: "instance", id: instanceId });
1902
1315
  if (!result)
1903
1316
  return;
1904
1317
  OutputFormatter.success({
@@ -1911,7 +1324,7 @@ var registerSharedInstanceCommands = (program, config) => {
1911
1324
  withFolderKey(pauseCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1912
1325
  const body = { comment: options.comment || "" };
1913
1326
  const reqOptions = { folderKey: options.folderKey };
1914
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/pause`, body, reqOptions), "Error pausing instance");
1327
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/pause`, body, reqOptions), "Error pausing instance");
1915
1328
  if (!result)
1916
1329
  return;
1917
1330
  OutputFormatter.success({
@@ -1924,7 +1337,7 @@ var registerSharedInstanceCommands = (program, config) => {
1924
1337
  withFolderKey(resumeCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1925
1338
  const body = { comment: options.comment || "" };
1926
1339
  const reqOptions = { folderKey: options.folderKey };
1927
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/resume`, body, reqOptions), "Error resuming instance");
1340
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/resume`, body, reqOptions), "Error resuming instance");
1928
1341
  if (!result)
1929
1342
  return;
1930
1343
  OutputFormatter.success({
@@ -1937,7 +1350,7 @@ var registerSharedInstanceCommands = (program, config) => {
1937
1350
  withFolderKey(cancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1938
1351
  const body = { comment: options.comment || "" };
1939
1352
  const reqOptions = { folderKey: options.folderKey };
1940
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/cancel`, body, reqOptions), "Error canceling instance");
1353
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/cancel`, body, reqOptions), "Error canceling instance");
1941
1354
  if (!result)
1942
1355
  return;
1943
1356
  OutputFormatter.success({
@@ -1952,7 +1365,7 @@ var registerSharedInstanceCommands = (program, config) => {
1952
1365
  parentElementId: options.parentElementId
1953
1366
  });
1954
1367
  const reqOptions = { folderKey: options.folderKey };
1955
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/variables${query}`, reqOptions), "Error getting variables");
1368
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/variables${query}`, reqOptions), "Error getting variables");
1956
1369
  if (!result)
1957
1370
  return;
1958
1371
  OutputFormatter.success({
@@ -1963,7 +1376,7 @@ var registerSharedInstanceCommands = (program, config) => {
1963
1376
  });
1964
1377
  const incidentsCmd = instances.command("incidents").description(`Get incidents for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1965
1378
  withFolderKey(incidentsCmd).trackedAction(processContext, async (instanceId, options) => {
1966
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/incidents`, { folderKey: options.folderKey }), "Error getting incidents");
1379
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/incidents`, { folderKey: options.folderKey }), "Error getting incidents");
1967
1380
  if (!result)
1968
1381
  return;
1969
1382
  OutputFormatter.success({
@@ -1974,7 +1387,7 @@ var registerSharedInstanceCommands = (program, config) => {
1974
1387
  });
1975
1388
  const assetCmd = instances.command("asset").description(`Get the ${toolLabel} definition for a process instance`).argument("<instance-id>", "Process instance ID");
1976
1389
  withFolderKey(assetCmd).trackedAction(processContext, async (instanceId, options) => {
1977
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/asset?type=${assetType}`, { folderKey: options.folderKey }), "Error getting asset");
1390
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/asset?type=${assetType}`, { folderKey: options.folderKey }), "Error getting asset");
1978
1391
  if (!result)
1979
1392
  return;
1980
1393
  OutputFormatter.success({
@@ -1982,82 +1395,383 @@ var registerSharedInstanceCommands = (program, config) => {
1982
1395
  Code: "InstanceAsset",
1983
1396
  Data: result
1984
1397
  });
1985
- });
1986
- const retryCmd = instances.command("retry").description(`Retry a faulted ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1987
- withFolderKey(retryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1988
- const body = { comment: options.comment || "" };
1989
- const reqOptions = { folderKey: options.folderKey };
1990
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/retry`, body, reqOptions), "Error retrying instance");
1991
- if (!result)
1992
- return;
1993
- OutputFormatter.success({
1994
- Result: RESULTS.Success,
1995
- Code: "InstanceRetried",
1996
- Data: result
1398
+ });
1399
+ const retryCmd = instances.command("retry").description(`Retry a faulted ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1400
+ withFolderKey(retryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1401
+ const body = { comment: options.comment || "" };
1402
+ const reqOptions = { folderKey: options.folderKey };
1403
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/retry`, body, reqOptions), "Error retrying instance");
1404
+ if (!result)
1405
+ return;
1406
+ OutputFormatter.success({
1407
+ Result: RESULTS.Success,
1408
+ Code: "InstanceRetried",
1409
+ Data: result
1410
+ });
1411
+ });
1412
+ const migrateCmd = instances.command("migrate").description(`Migrate a ${toolLabel} process instance to a different package version`).argument("<instance-id>", "Process instance ID").argument("<new-version>", "Target package version");
1413
+ withFolderKey(migrateCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, newVersion, options) => {
1414
+ const body = {
1415
+ newVersion,
1416
+ comment: options.comment || ""
1417
+ };
1418
+ const reqOptions = { folderKey: options.folderKey };
1419
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/upgrade`, body, reqOptions), "Error migrating instance");
1420
+ if (!result)
1421
+ return;
1422
+ OutputFormatter.success({
1423
+ Result: RESULTS.Success,
1424
+ Code: "InstanceMigrated",
1425
+ Data: result
1426
+ });
1427
+ });
1428
+ const gotoCmd = instances.command("goto").description("Move execution cursor from one element to another").argument("<instance-id>", "Process instance ID").argument("<transitions>", `JSON array of transitions, e.g. '[{"sourceElementId":"A","targetElementId":"B"}]'`);
1429
+ withFolderKey(gotoCmd).trackedAction(processContext, async (instanceId, transitionsJson, options) => {
1430
+ const [parseError, transitions] = catchError2(() => JSON.parse(transitionsJson));
1431
+ const isValidShape = !parseError && Array.isArray(transitions) && transitions.every((t) => t?.sourceElementId != null && t?.targetElementId != null);
1432
+ if (!isValidShape) {
1433
+ OutputFormatter.error({
1434
+ Result: RESULTS.Failure,
1435
+ Message: "Error applying goto",
1436
+ Instructions: parseError ? `Invalid transitions JSON: ${parseError.message}` : 'Each transition must have "sourceElementId" and "targetElementId"'
1437
+ });
1438
+ processContext.exit(1);
1439
+ return;
1440
+ }
1441
+ const body = { transitions };
1442
+ const reqOptions = { folderKey: options.folderKey };
1443
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/goto`, body, reqOptions), "Error applying goto");
1444
+ if (!result)
1445
+ return;
1446
+ OutputFormatter.success({
1447
+ Result: RESULTS.Success,
1448
+ Code: "InstanceGoto",
1449
+ Data: result
1450
+ });
1451
+ });
1452
+ const cursorsCmd = instances.command("cursors").description(`Get current execution cursor positions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1453
+ withFolderKey(cursorsCmd).trackedAction(processContext, async (instanceId, options) => {
1454
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/goto/cursors`, { folderKey: options.folderKey }), "Error getting cursors");
1455
+ if (!result)
1456
+ return;
1457
+ OutputFormatter.success({
1458
+ Result: RESULTS.Success,
1459
+ Code: "InstanceCursors",
1460
+ Data: result
1461
+ });
1462
+ });
1463
+ const messageCmd = instances.command("messages").alias("message").description(`Manage ${toolLabel} instance messages`);
1464
+ messageCmd.command("send").description(`Send a message to ${toolLabel} workflow subscriptions`).requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Message payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (options) => {
1465
+ const [readError, body] = await catchError2(resolveJsonInput({
1466
+ inline: options.inputs,
1467
+ allowStdin: true
1468
+ }));
1469
+ if (readError) {
1470
+ OutputFormatter.error({
1471
+ Result: RESULTS.Failure,
1472
+ Message: "Error reading message input",
1473
+ Instructions: readError.message
1474
+ });
1475
+ processContext.exit(1);
1476
+ return;
1477
+ }
1478
+ if (body === undefined) {
1479
+ OutputFormatter.error({
1480
+ Result: RESULTS.Failure,
1481
+ Message: "Missing message payload",
1482
+ Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
1483
+ });
1484
+ processContext.exit(1);
1485
+ return;
1486
+ }
1487
+ const reqOptions = { folderKey: options.folderKey };
1488
+ const result = await withPimsCall((config) => pimsPost(config, "/instances/messages/send", body, reqOptions), "Error sending message");
1489
+ if (!result)
1490
+ return;
1491
+ OutputFormatter.success({
1492
+ Result: RESULTS.Success,
1493
+ Code: "MessageSent",
1494
+ Data: result
1495
+ });
1496
+ });
1497
+ if (includeElementExecutions) {
1498
+ const elementExeCmd = instances.command("element-executions").description(`Get element executions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1499
+ withFolderKey(elementExeCmd).trackedAction(processContext, async (instanceId, options) => {
1500
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/element-executions`, { folderKey: options.folderKey }), "Error getting element executions");
1501
+ if (!result)
1502
+ return;
1503
+ OutputFormatter.success({
1504
+ Result: RESULTS.Success,
1505
+ Code: "InstanceElementExecutions",
1506
+ Data: result
1507
+ });
1508
+ });
1509
+ }
1510
+ const variablesSetCmd = instances.command("variables-set").description(`Update variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1511
+ withFolderKey(variablesSetCmd).option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
1512
+ const [readError, data] = await catchError2(resolveJsonInput({
1513
+ inline: options.inputs,
1514
+ allowStdin: true
1515
+ }));
1516
+ if (readError) {
1517
+ OutputFormatter.error({
1518
+ Result: RESULTS.Failure,
1519
+ Message: "Error reading variables input",
1520
+ Instructions: readError.message
1521
+ });
1522
+ processContext.exit(1);
1523
+ return;
1524
+ }
1525
+ if (data === undefined) {
1526
+ OutputFormatter.error({
1527
+ Result: RESULTS.Failure,
1528
+ Message: "Missing variables payload",
1529
+ Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
1530
+ });
1531
+ processContext.exit(1);
1532
+ return;
1533
+ }
1534
+ const body = data;
1535
+ const reqOptions = { folderKey: options.folderKey };
1536
+ const result = await withPimsCall((config) => pimsPatch(config, `/instances/${instanceId}/variables`, body, reqOptions), "Error updating variables");
1537
+ if (!result)
1538
+ return;
1539
+ OutputFormatter.success({
1540
+ Result: RESULTS.Success,
1541
+ Code: "InstanceVariablesSet",
1542
+ Data: result
1543
+ });
1544
+ });
1545
+ const variablesAllCmd = instances.command("variables-all").description(`Get all variables (including subprocesses) for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1546
+ withFolderKey(variablesAllCmd).trackedAction(processContext, async (instanceId, options) => {
1547
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/variables-all`, { folderKey: options.folderKey }), "Error getting all variables");
1548
+ if (!result)
1549
+ return;
1550
+ OutputFormatter.success({
1551
+ Result: RESULTS.Success,
1552
+ Code: "InstanceVariablesAll",
1553
+ Data: result
1554
+ });
1555
+ });
1556
+ const globalVarsCmd = instances.command("global-variables").description(`Get global variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1557
+ withFolderKey(globalVarsCmd).trackedAction(processContext, async (instanceId, options) => {
1558
+ const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/global-variables`, { folderKey: options.folderKey }), "Error getting global variables");
1559
+ if (!result)
1560
+ return;
1561
+ OutputFormatter.success({
1562
+ Result: RESULTS.Success,
1563
+ Code: "InstanceGlobalVariables",
1564
+ Data: result
1565
+ });
1566
+ });
1567
+ const element = instances.command("elements").alias("element").description(`Manage elements within a ${toolLabel} process instance`);
1568
+ const elementCancelCmd = element.command("cancel").description(`Cancel a specific element in a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID").argument("<element-id>", "Element ID");
1569
+ withFolderKey(elementCancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
1570
+ const body = { comment: options.comment || "" };
1571
+ const reqOptions = { folderKey: options.folderKey };
1572
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/cancel`, body, reqOptions), "Error canceling element");
1573
+ if (!result)
1574
+ return;
1575
+ OutputFormatter.success({
1576
+ Result: RESULTS.Success,
1577
+ Code: "ElementCanceled",
1578
+ Data: result
1579
+ });
1580
+ });
1581
+ const elementRetryCmd = element.command("retry").description(`Retry a faulted element in a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID").argument("<element-id>", "Element ID");
1582
+ withFolderKey(elementRetryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
1583
+ const body = { comment: options.comment || "" };
1584
+ const reqOptions = { folderKey: options.folderKey };
1585
+ const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/retry`, body, reqOptions), "Error retrying element");
1586
+ if (!result)
1587
+ return;
1588
+ OutputFormatter.success({
1589
+ Result: RESULTS.Success,
1590
+ Code: "ElementRetried",
1591
+ Data: result
1592
+ });
1593
+ });
1594
+ attachSharedExamples(instances);
1595
+ };
1596
+
1597
+ // ../maestro-sdk/src/shared-commands/process.ts
1598
+ var SEARCHABLE_TAG = "Searchable";
1599
+ var parseBooleanFlag = (value) => {
1600
+ if (value === "true")
1601
+ return true;
1602
+ if (value === "false")
1603
+ return false;
1604
+ throw new InvalidArgumentError(`Expected 'true' or 'false', got '${value}'.`);
1605
+ };
1606
+ var collectValue = (value, previous) => [
1607
+ ...previous,
1608
+ value
1609
+ ];
1610
+ var parseTagList = (csv) => csv === undefined ? [] : csv.split(",").map((tag) => tag.trim()).filter((tag) => tag.length > 0);
1611
+ var applyFriendlyVariableTags = (variableTags, flags) => {
1612
+ const elements = variableTags.elements ?? {};
1613
+ const allOutputs = Object.entries(elements).flatMap(([elementId, el]) => (el.outputs ?? []).map((output) => ({ elementId, output })));
1614
+ const available = allOutputs.map((o) => `${o.output.name} (element ${o.elementId})`).join(", ");
1615
+ let targets;
1616
+ if (flags.all) {
1617
+ if (allOutputs.length === 0) {
1618
+ throw new Error("This process has no taggable variables.");
1619
+ }
1620
+ targets = allOutputs;
1621
+ } else {
1622
+ const seen = new Set;
1623
+ targets = [];
1624
+ for (const name of flags.variable ?? []) {
1625
+ const matches = allOutputs.filter((o) => o.output.name === name && (flags.elementId === undefined || o.elementId === flags.elementId));
1626
+ if (matches.length === 0) {
1627
+ throw new Error(available ? `No variable matched "${name}"${flags.elementId ? ` in element ${flags.elementId}` : ""}. Available: ${available}.` : "This process has no taggable variables.");
1628
+ }
1629
+ if (flags.elementId === undefined && new Set(matches.map((m) => m.elementId)).size > 1) {
1630
+ const where = matches.map((m) => m.elementId).join(", ");
1631
+ throw new Error(`Variable "${name}" exists in multiple elements (${where}). Pass --element-id to disambiguate (one --variable at a time), or --all to tag every occurrence.`);
1632
+ }
1633
+ for (const m of matches) {
1634
+ if (!seen.has(m.output)) {
1635
+ seen.add(m.output);
1636
+ targets.push(m);
1637
+ }
1638
+ }
1639
+ }
1640
+ }
1641
+ const replaceTags = flags.tags !== undefined ? parseTagList(flags.tags) : undefined;
1642
+ const addTags = parseTagList(flags.addTags);
1643
+ const removeSet = new Set(parseTagList(flags.removeTags));
1644
+ return targets.map(({ elementId, output }) => {
1645
+ const next = replaceTags !== undefined ? [...new Set(replaceTags)] : [...new Set([...output.tags ?? [], ...addTags])].filter((tag) => !removeSet.has(tag));
1646
+ output.tags = next;
1647
+ return { elementId, name: output.name, tags: next };
1648
+ });
1649
+ };
1650
+ var buildSettingsPath = (processKey) => `/processes/${encodeURIComponent(processKey)}/settings`;
1651
+ var validateFriendlyTagFlags = (options) => {
1652
+ const variableCount = options.variable.length;
1653
+ if (variableCount > 0 && options.all) {
1654
+ return "Use either --variable or --all, not both.";
1655
+ }
1656
+ if (variableCount === 0 && !options.all) {
1657
+ return "Specify the target with --variable <name> (repeatable, plus optional --element-id) or --all.";
1658
+ }
1659
+ if (variableCount > 1 && options.elementId !== undefined) {
1660
+ return "--element-id only works with a single --variable; pass one --variable, or drop --element-id.";
1661
+ }
1662
+ const hasSearchable = options.searchable !== undefined;
1663
+ const hasReplace = options.tags !== undefined;
1664
+ const hasIncremental = options.addTags !== undefined || options.removeTags !== undefined;
1665
+ if (hasSearchable && (hasReplace || hasIncremental)) {
1666
+ return "Use --searchable <true|false>, or the low-level --tags/--add-tags/--remove-tags flags — not both.";
1667
+ }
1668
+ if (!hasSearchable && !hasReplace && !hasIncremental) {
1669
+ return "Specify --searchable <true|false> to mark the variable searchable, or --tags/--add-tags/--remove-tags for other tags.";
1670
+ }
1671
+ if (hasReplace && hasIncremental) {
1672
+ return "Use --tags to replace tags, or --add-tags/--remove-tags to adjust them — not both.";
1673
+ }
1674
+ return null;
1675
+ };
1676
+ var resolveTagFlags = (options) => {
1677
+ if (options.searchable === undefined)
1678
+ return options;
1679
+ return {
1680
+ variable: options.variable,
1681
+ elementId: options.elementId,
1682
+ all: options.all,
1683
+ addTags: options.searchable ? SEARCHABLE_TAG : undefined,
1684
+ removeTags: options.searchable ? undefined : SEARCHABLE_TAG
1685
+ };
1686
+ };
1687
+ var setVariableTagsFromPayload = async (processKey, options) => {
1688
+ const [fileError, variableTags] = await catchError2(resolveJsonInput({ inline: options.inputs, allowStdin: true }));
1689
+ if (fileError) {
1690
+ OutputFormatter.error({
1691
+ Result: RESULTS.Failure,
1692
+ Message: "Error reading variable tags input",
1693
+ Instructions: fileError.message
1694
+ });
1695
+ processContext.exit(1);
1696
+ return;
1697
+ }
1698
+ if (variableTags === undefined) {
1699
+ OutputFormatter.error({
1700
+ Result: RESULTS.Failure,
1701
+ Message: "Missing variable tags payload",
1702
+ Instructions: "Provide --inputs <json|@file>, pipe JSON via stdin, or use the --variable/--all flags."
1997
1703
  });
1704
+ processContext.exit(1);
1705
+ return;
1706
+ }
1707
+ const reqOptions = { folderKey: options.folderKey };
1708
+ const currentSettings = await withPimsCall((config) => pimsGet(config, buildSettingsPath(processKey), reqOptions), "Error reading current process settings");
1709
+ if (!currentSettings)
1710
+ return;
1711
+ const merged = { ...currentSettings, variableTags };
1712
+ const result = await withPimsCall((config) => pimsPut(config, buildSettingsPath(processKey), merged, reqOptions), "Error updating variable tags");
1713
+ if (!result)
1714
+ return;
1715
+ OutputFormatter.success({
1716
+ Result: RESULTS.Success,
1717
+ Code: "ProcessVariableTagsSet",
1718
+ Data: result
1998
1719
  });
1999
- const migrateCmd = instances.command("migrate").description(`Migrate a ${toolLabel} process instance to a different package version`).argument("<instance-id>", "Process instance ID").argument("<new-version>", "Target package version");
2000
- withFolderKey(migrateCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, newVersion, options) => {
2001
- const body = {
2002
- newVersion,
2003
- comment: options.comment || ""
2004
- };
2005
- const reqOptions = { folderKey: options.folderKey };
2006
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/upgrade`, body, reqOptions), "Error migrating instance");
2007
- if (!result)
2008
- return;
2009
- OutputFormatter.success({
2010
- Result: RESULTS.Success,
2011
- Code: "InstanceMigrated",
2012
- Data: result
1720
+ };
1721
+ var setVariableTagsFromFlags = async (processKey, options) => {
1722
+ const reqOptions = { folderKey: options.folderKey };
1723
+ const currentSettings = await withPimsCall((config) => pimsGet(config, buildSettingsPath(processKey), reqOptions), "Error reading current process settings");
1724
+ if (!currentSettings)
1725
+ return;
1726
+ const variableTags = currentSettings.variableTags ?? {
1727
+ elements: {},
1728
+ sourcePackageVersion: "",
1729
+ lastUpdateTimeUtc: ""
1730
+ };
1731
+ const [mutateError, updated] = catchError2(() => applyFriendlyVariableTags(variableTags, resolveTagFlags(options)));
1732
+ if (mutateError) {
1733
+ OutputFormatter.error({
1734
+ Result: RESULTS.Failure,
1735
+ Message: "Error updating variable tags",
1736
+ Instructions: mutateError.message
2013
1737
  });
1738
+ processContext.exit(1);
1739
+ return;
1740
+ }
1741
+ const merged = { ...currentSettings, variableTags };
1742
+ const result = await withPimsCall((config) => pimsPut(config, buildSettingsPath(processKey), merged, reqOptions), "Error updating variable tags");
1743
+ if (!result)
1744
+ return;
1745
+ OutputFormatter.success({
1746
+ Result: RESULTS.Success,
1747
+ Code: "ProcessVariableTagsSet",
1748
+ Data: { updated, variableTags }
2014
1749
  });
2015
- const gotoCmd = instances.command("goto").description("Move execution cursor from one element to another").argument("<instance-id>", "Process instance ID").argument("<transitions>", `JSON array of transitions, e.g. '[{"sourceElementId":"A","targetElementId":"B"}]'`);
2016
- withFolderKey(gotoCmd).trackedAction(processContext, async (instanceId, transitionsJson, options) => {
2017
- const [parseError, transitions] = catchError(() => JSON.parse(transitionsJson));
2018
- const isValidShape = !parseError && Array.isArray(transitions) && transitions.every((t) => t?.sourceElementId != null && t?.targetElementId != null);
2019
- if (!isValidShape) {
2020
- OutputFormatter.error({
2021
- Result: RESULTS.Failure,
2022
- Message: "Error applying goto",
2023
- Instructions: parseError ? `Invalid transitions JSON: ${parseError.message}` : 'Each transition must have "sourceElementId" and "targetElementId"'
2024
- });
2025
- processContext.exit(1);
2026
- return;
2027
- }
2028
- const body = { transitions };
1750
+ };
1751
+ var registerSharedProcessCommands = (processCmd, config) => {
1752
+ const { toolLabel } = config;
1753
+ const settingsCmd = processCmd.command("settings").description(`Manage ${toolLabel} process settings`);
1754
+ settingsCmd.command("get").description(`Get settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
2029
1755
  const reqOptions = { folderKey: options.folderKey };
2030
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/goto`, body, reqOptions), "Error applying goto");
2031
- if (!result)
2032
- return;
2033
- OutputFormatter.success({
2034
- Result: RESULTS.Success,
2035
- Code: "InstanceGoto",
2036
- Data: result
2037
- });
2038
- });
2039
- const cursorsCmd = instances.command("cursors").description(`Get current execution cursor positions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
2040
- withFolderKey(cursorsCmd).trackedAction(processContext, async (instanceId, options) => {
2041
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/goto/cursors`, { folderKey: options.folderKey }), "Error getting cursors");
1756
+ const result = await withPimsCall((config) => pimsGet(config, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting process settings", { resource: "process", id: processKey });
2042
1757
  if (!result)
2043
1758
  return;
2044
1759
  OutputFormatter.success({
2045
1760
  Result: RESULTS.Success,
2046
- Code: "InstanceCursors",
1761
+ Code: "ProcessSettingsGet",
2047
1762
  Data: result
2048
1763
  });
2049
1764
  });
2050
- const messageCmd = instances.command("message").description(`Manage ${toolLabel} instance messages`);
2051
- messageCmd.command("send").description(`Send a message to ${toolLabel} workflow subscriptions`).requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Message payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (options) => {
2052
- const [readError, body] = await catchError(resolveJsonInput({
1765
+ settingsCmd.command("set").description(`Update settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Settings payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (processKey, options) => {
1766
+ const [fileError, body] = await catchError2(resolveJsonInput({
2053
1767
  inline: options.inputs,
2054
1768
  allowStdin: true
2055
1769
  }));
2056
- if (readError) {
1770
+ if (fileError) {
2057
1771
  OutputFormatter.error({
2058
1772
  Result: RESULTS.Failure,
2059
- Message: "Error reading message input",
2060
- Instructions: readError.message
1773
+ Message: "Error reading settings input",
1774
+ Instructions: fileError.message
2061
1775
  });
2062
1776
  processContext.exit(1);
2063
1777
  return;
@@ -2065,447 +1779,706 @@ var registerSharedInstanceCommands = (program, config) => {
2065
1779
  if (body === undefined) {
2066
1780
  OutputFormatter.error({
2067
1781
  Result: RESULTS.Failure,
2068
- Message: "Missing message payload",
1782
+ Message: "Missing settings payload",
2069
1783
  Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
2070
1784
  });
2071
1785
  processContext.exit(1);
2072
1786
  return;
2073
1787
  }
2074
1788
  const reqOptions = { folderKey: options.folderKey };
2075
- const result = await withPimsCall((config2) => pimsPost(config2, "/instances/messages/send", body, reqOptions), "Error sending message");
1789
+ const result = await withPimsCall((config) => pimsPut(config, `/processes/${encodeURIComponent(processKey)}/settings`, body, reqOptions), "Error updating process settings");
2076
1790
  if (!result)
2077
1791
  return;
2078
1792
  OutputFormatter.success({
2079
1793
  Result: RESULTS.Success,
2080
- Code: "MessageSent",
1794
+ Code: "ProcessSettingsSet",
2081
1795
  Data: result
2082
1796
  });
2083
1797
  });
2084
- if (includeElementExecutions) {
2085
- const elementExeCmd = instances.command("element-executions").description(`Get element executions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
2086
- withFolderKey(elementExeCmd).trackedAction(processContext, async (instanceId, options) => {
2087
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/element-executions`, { folderKey: options.folderKey }), "Error getting element executions");
2088
- if (!result)
2089
- return;
2090
- OutputFormatter.success({
2091
- Result: RESULTS.Success,
2092
- Code: "InstanceElementExecutions",
2093
- Data: result
2094
- });
1798
+ const variableTagsCmd = processCmd.command("variable-tags").description(`Manage ${toolLabel} process variable tags`);
1799
+ variableTagsCmd.command("get").description(`Get variable tags for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
1800
+ const reqOptions = { folderKey: options.folderKey };
1801
+ const result = await withPimsCall((config) => pimsGet(config, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting variable tags", { resource: "process", id: processKey });
1802
+ if (!result)
1803
+ return;
1804
+ OutputFormatter.success({
1805
+ Result: RESULTS.Success,
1806
+ Code: "ProcessVariableTagsGet",
1807
+ Data: result.variableTags ?? {}
2095
1808
  });
2096
- }
2097
- const variablesSetCmd = instances.command("variables-set").description(`Update variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
2098
- withFolderKey(variablesSetCmd).option("--inputs <value>", "Patch variables payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (instanceId, options) => {
2099
- const [readError, data] = await catchError(resolveJsonInput({
2100
- inline: options.inputs,
2101
- allowStdin: true
2102
- }));
2103
- if (readError) {
1809
+ });
1810
+ variableTagsCmd.command("set").description(`Update variable tags for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--variable <name>", "Name of a variable (output) to tag. Repeatable — pass it multiple times to tag several variables in one call.", collectValue, []).option("--element-id <id>", "Element that owns the variable (disambiguates when the same name appears in multiple elements). Only valid with a single --variable.").option("--all", "Apply the change to every taggable variable").option("--searchable <boolean>", "Mark the variable searchable for instance filtering ('true' or 'false')", parseBooleanFlag).option("--tags <list>", "Advanced: comma-separated tags to set, replacing the variable's current tags (empty value clears them)").option("--add-tags <list>", "Comma-separated tags to add to the variable's current tags").option("--remove-tags <list>", "Comma-separated tags to remove from the variable's current tags").option("--inputs <value>", "Full variable tags payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (processKey, options) => {
1811
+ const friendlyRequested = options.variable.length > 0 || options.elementId !== undefined || options.all === true || options.searchable !== undefined || options.tags !== undefined || options.addTags !== undefined || options.removeTags !== undefined;
1812
+ if (options.inputs !== undefined && friendlyRequested) {
2104
1813
  OutputFormatter.error({
2105
1814
  Result: RESULTS.Failure,
2106
- Message: "Error reading variables input",
2107
- Instructions: readError.message
1815
+ Message: "Error updating variable tags",
1816
+ Instructions: "Provide either --inputs (full JSON payload) or the --searchable/--variable/--all flags, not both."
2108
1817
  });
2109
1818
  processContext.exit(1);
2110
1819
  return;
2111
1820
  }
2112
- if (data === undefined) {
2113
- OutputFormatter.error({
2114
- Result: RESULTS.Failure,
2115
- Message: "Missing variables payload",
2116
- Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
2117
- });
2118
- processContext.exit(1);
1821
+ if (friendlyRequested) {
1822
+ const validationError = validateFriendlyTagFlags(options);
1823
+ if (validationError) {
1824
+ OutputFormatter.error({
1825
+ Result: RESULTS.Failure,
1826
+ Message: "Error updating variable tags",
1827
+ Instructions: validationError
1828
+ });
1829
+ processContext.exit(1);
1830
+ return;
1831
+ }
1832
+ await setVariableTagsFromFlags(processKey, options);
2119
1833
  return;
2120
1834
  }
2121
- const body = data;
2122
- const reqOptions = { folderKey: options.folderKey };
2123
- const result = await withPimsCall((config2) => pimsPatch(config2, `/instances/${instanceId}/variables`, body, reqOptions), "Error updating variables");
2124
- if (!result)
2125
- return;
2126
- OutputFormatter.success({
2127
- Result: RESULTS.Success,
2128
- Code: "InstanceVariablesSet",
2129
- Data: result
2130
- });
1835
+ await setVariableTagsFromPayload(processKey, options);
2131
1836
  });
2132
- const variablesAllCmd = instances.command("variables-all").description(`Get all variables (including subprocesses) for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
2133
- withFolderKey(variablesAllCmd).trackedAction(processContext, async (instanceId, options) => {
2134
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/variables-all`, { folderKey: options.folderKey }), "Error getting all variables");
1837
+ attachSharedExamples(settingsCmd);
1838
+ attachSharedExamples(variableTagsCmd);
1839
+ };
1840
+
1841
+ // ../maestro-sdk/src/shared-commands/processes.ts
1842
+ async function findProcessSummary(config, processKey, folderKey, processType) {
1843
+ const page = await pimsGet(config, `/processes/summary${buildQueryString({ processType, processKey })}`, { folderKey });
1844
+ const summaries = Array.isArray(page?.processes) ? page.processes : [];
1845
+ return summaries.find((summary) => summary.processKey === processKey) ?? null;
1846
+ }
1847
+ var registerSharedProcessesCommands = (program, config) => {
1848
+ const { toolLabel, processType } = config;
1849
+ const incidentsQuery = buildQueryString({ processType });
1850
+ const processes = program.command("processes").description(`Manage ${toolLabel} process summaries`);
1851
+ processes.command("list").description(`List all ${toolLabel} process summaries`).option("--folder-key <key>", "Folder key").option("-l, --limit <number>", "Number of items to return (1-10000)", parseLimit).option("--offset <number>", "Number of items to skip (0-1000000)", parseOffset, 0).option("--status <status>", "Filter by process status").trackedAction(processContext, async (options) => {
1852
+ const query = buildQueryString({
1853
+ processType,
1854
+ status: options.status,
1855
+ $top: options.limit,
1856
+ $skip: options.offset !== 0 ? options.offset : undefined
1857
+ });
1858
+ const reqOptions = { folderKey: options.folderKey };
1859
+ const result = await withPimsCall((config) => pimsGet(config, `/processes/summary${query}`, reqOptions), "Error listing processes");
2135
1860
  if (!result)
2136
1861
  return;
2137
1862
  OutputFormatter.success({
2138
1863
  Result: RESULTS.Success,
2139
- Code: "InstanceVariablesAll",
1864
+ Code: "ProcessList",
2140
1865
  Data: result
2141
1866
  });
2142
1867
  });
2143
- const globalVarsCmd = instances.command("global-variables").description(`Get global variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
2144
- withFolderKey(globalVarsCmd).trackedAction(processContext, async (instanceId, options) => {
2145
- const result = await withPimsCall((config2) => pimsGet(config2, `/instances/${instanceId}/global-variables`, { folderKey: options.folderKey }), "Error getting global variables");
1868
+ processes.command("incidents").description(`Get incidents for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
1869
+ const reqOptions = { folderKey: options.folderKey };
1870
+ const result = await withPimsCall((config) => pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, reqOptions), "Error getting process incidents", { resource: "process", id: processKey });
2146
1871
  if (!result)
2147
1872
  return;
2148
1873
  OutputFormatter.success({
2149
1874
  Result: RESULTS.Success,
2150
- Code: "InstanceGlobalVariables",
1875
+ Code: "ProcessIncidents",
2151
1876
  Data: result
2152
1877
  });
2153
1878
  });
2154
- const element = instances.command("element").description(`Manage elements within a ${toolLabel} process instance`);
2155
- const elementCancelCmd = element.command("cancel").description(`Cancel a specific element in a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID").argument("<element-id>", "Element ID");
2156
- withFolderKey(elementCancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
2157
- const body = { comment: options.comment || "" };
2158
- const reqOptions = { folderKey: options.folderKey };
2159
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/element/${elementId}/cancel`, body, reqOptions), "Error canceling element");
1879
+ processes.command("diagnose").description(`Correlate ${toolLabel} process summary, incidents, and error codes`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
1880
+ const result = await withPimsCall(async (config) => {
1881
+ const summary = await findProcessSummary(config, processKey, options.folderKey, processType);
1882
+ const incidents = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, { folderKey: options.folderKey });
1883
+ const errorCodes = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, { folderKey: options.folderKey });
1884
+ return {
1885
+ summary,
1886
+ incidents,
1887
+ errorCodes: errorCodes.errorCodes || []
1888
+ };
1889
+ }, "Error diagnosing process");
2160
1890
  if (!result)
2161
1891
  return;
2162
1892
  OutputFormatter.success({
2163
1893
  Result: RESULTS.Success,
2164
- Code: "ElementCanceled",
2165
- Data: result
1894
+ Code: "ProcessDiagnostics",
1895
+ Data: {
1896
+ ProcessKey: processKey,
1897
+ FolderKey: options.folderKey,
1898
+ Summary: result.summary,
1899
+ FaultedCount: result.summary?.faultedCount ?? null,
1900
+ RunningCount: result.summary?.runningCount ?? null,
1901
+ Incidents: result.incidents,
1902
+ IncidentCount: result.incidents.length,
1903
+ ErrorCodes: result.errorCodes,
1904
+ ErrorCodeCount: result.errorCodes.length
1905
+ }
2166
1906
  });
2167
1907
  });
2168
- const elementRetryCmd = element.command("retry").description(`Retry a faulted element in a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID").argument("<element-id>", "Element ID");
2169
- withFolderKey(elementRetryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
2170
- const body = { comment: options.comment || "" };
1908
+ processes.command("error-codes").description(`Get unique error codes for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
2171
1909
  const reqOptions = { folderKey: options.folderKey };
2172
- const result = await withPimsCall((config2) => pimsPost(config2, `/instances/${instanceId}/element/${elementId}/retry`, body, reqOptions), "Error retrying element");
1910
+ const result = await withPimsCall((config) => pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, reqOptions), "Error getting process error codes", { resource: "process", id: processKey });
2173
1911
  if (!result)
2174
1912
  return;
2175
1913
  OutputFormatter.success({
2176
1914
  Result: RESULTS.Success,
2177
- Code: "ElementRetried",
2178
- Data: result
1915
+ Code: "ProcessIncidentErrorCodes",
1916
+ Data: result.errorCodes || []
2179
1917
  });
2180
1918
  });
2181
- attachSharedExamples(instances);
1919
+ attachSharedExamples(processes);
2182
1920
  };
2183
1921
 
2184
- // ../maestro-sdk/src/shared-commands/process.ts
2185
- var SEARCHABLE_TAG = "Searchable";
2186
- var parseBooleanFlag = (value) => {
2187
- if (value === "true")
2188
- return true;
2189
- if (value === "false")
2190
- return false;
2191
- throw new InvalidArgumentError(`Expected 'true' or 'false', got '${value}'.`);
2192
- };
2193
- var collectValue = (value, previous) => [
2194
- ...previous,
2195
- value
2196
- ];
2197
- var parseTagList = (csv) => csv === undefined ? [] : csv.split(",").map((tag) => tag.trim()).filter((tag) => tag.length > 0);
2198
- var applyFriendlyVariableTags = (variableTags, flags) => {
2199
- const elements = variableTags.elements ?? {};
2200
- const allOutputs = Object.entries(elements).flatMap(([elementId, el]) => (el.outputs ?? []).map((output) => ({ elementId, output })));
2201
- const available = allOutputs.map((o) => `${o.output.name} (element ${o.elementId})`).join(", ");
2202
- let targets;
2203
- if (flags.all) {
2204
- if (allOutputs.length === 0) {
2205
- throw new Error("This process has no taggable variables.");
1922
+ // ../maestro-sdk/src/registry/filter-parser.ts
1923
+ class FilterParseError extends Error {
1924
+ code;
1925
+ token;
1926
+ constructor(message, code, token) {
1927
+ super(message);
1928
+ this.code = code;
1929
+ this.token = token;
1930
+ this.name = "FilterParseError";
1931
+ }
1932
+ }
1933
+ function parseFilterString(filterString) {
1934
+ if (!filterString || filterString.trim() === "") {
1935
+ return { filters: [], logic: "AND" };
1936
+ }
1937
+ const parts = filterString.split(/,(?=[a-zA-Z_][a-zA-Z0-9_]*(?::[a-zA-Z]+)?=)/);
1938
+ const conditions = [];
1939
+ for (const part of parts) {
1940
+ const condition = parseFilterCondition(part.trim());
1941
+ conditions.push(condition);
1942
+ }
1943
+ return {
1944
+ filters: conditions,
1945
+ logic: "AND"
1946
+ };
1947
+ }
1948
+ function parseFilterCondition(conditionString) {
1949
+ const match = conditionString.match(/^([^:=]+)(?::([^=]+))?=(.+)$/);
1950
+ if (!match) {
1951
+ throw new FilterParseError(`Invalid filter format: '${conditionString}'. Expected 'field=value' or 'field:operator=value'.`, "INVALID_FORMAT", conditionString);
1952
+ }
1953
+ const [, fieldStr, operatorStr, valueStr] = match;
1954
+ const field = normalizeField(fieldStr.trim());
1955
+ const operator = operatorStr?.trim() || "equals";
1956
+ const value = valueStr.trim();
1957
+ if (!isValidField(field)) {
1958
+ throw new FilterParseError(`Invalid filter field: '${field}'. Supported fields: category, type, tags, displayname, nodetype, description.`, "INVALID_FIELD", field);
1959
+ }
1960
+ if (!isValidOperator(operator)) {
1961
+ throw new FilterParseError(`Invalid filter operator: '${operator}'. Supported operators: equals, contains, in, startsWith, endsWith.`, "INVALID_OPERATOR", operator);
1962
+ }
1963
+ return {
1964
+ field,
1965
+ operator,
1966
+ value
1967
+ };
1968
+ }
1969
+ function normalizeField(field) {
1970
+ const fieldMap = {
1971
+ category: "category",
1972
+ cat: "category",
1973
+ type: "type",
1974
+ nodetype: "nodetype",
1975
+ node_type: "nodetype",
1976
+ tags: "tags",
1977
+ tag: "tags",
1978
+ displayname: "displayname",
1979
+ display_name: "displayname",
1980
+ displayName: "displayname",
1981
+ name: "displayname",
1982
+ label: "displayname"
1983
+ };
1984
+ const normalized = field.toLowerCase().replace(/[-_\s]/g, "");
1985
+ return fieldMap[normalized] || field;
1986
+ }
1987
+ function isValidField(field) {
1988
+ const validFields = [
1989
+ "category",
1990
+ "type",
1991
+ "tags",
1992
+ "displayname",
1993
+ "nodetype",
1994
+ "description"
1995
+ ];
1996
+ return validFields.includes(field);
1997
+ }
1998
+ function isValidOperator(operator) {
1999
+ const validOperators = [
2000
+ "equals",
2001
+ "contains",
2002
+ "in",
2003
+ "startsWith",
2004
+ "endsWith"
2005
+ ];
2006
+ return validOperators.includes(operator);
2007
+ }
2008
+
2009
+ // ../maestro-sdk/src/registry/command.ts
2010
+ function flattenNodeForDisplay(n) {
2011
+ return {
2012
+ NodeType: n.nodeType,
2013
+ Category: n.category ?? "",
2014
+ DisplayName: n.display?.label ?? "",
2015
+ Description: n.description ?? n.display?.description ?? "",
2016
+ Version: n.version ?? "",
2017
+ Tags: (n.tags ?? []).join(", ")
2018
+ };
2019
+ }
2020
+ async function missingProcessResourceHint() {
2021
+ const {
2022
+ describeProjectsWithoutProcessResource,
2023
+ findProjectsWithoutProcessResource,
2024
+ findSolutionFromCwd
2025
+ } = await import("./solution-discovery-vn4q32bf.js");
2026
+ const ctx = await findSolutionFromCwd();
2027
+ if (!ctx)
2028
+ return {};
2029
+ return describeProjectsWithoutProcessResource(await findProjectsWithoutProcessResource(ctx), ctx.solutionDir);
2030
+ }
2031
+ async function localResultNotes(contractWarning) {
2032
+ const hint = await missingProcessResourceHint();
2033
+ const warnings = [hint.Warning, contractWarning].filter((w) => typeof w === "string");
2034
+ return {
2035
+ ...hint,
2036
+ ...warnings.length > 0 ? { Warning: warnings.join(" ") } : {}
2037
+ };
2038
+ }
2039
+ async function explainNodeTypeWithoutProcessResource(nodeType) {
2040
+ const discovery = await import("./solution-discovery-vn4q32bf.js");
2041
+ const [, explanation] = await catchError2(discovery.explainNodeTypeWithoutProcessResource(nodeType));
2042
+ return explanation;
2043
+ }
2044
+ function flattenNodeWithAvailability(n, availableOnTenant) {
2045
+ return {
2046
+ ...flattenNodeForDisplay(n),
2047
+ AvailableOnTenant: availableOnTenant
2048
+ };
2049
+ }
2050
+ async function mergeWithKnownSdkNodes(tenantNodes) {
2051
+ const { listKnownSdkNodes } = await import("./known-types-v9sxcq1c.js");
2052
+ const tenantTypes = new Set(tenantNodes.map((n) => n.nodeType?.toLowerCase()).filter((t) => typeof t === "string"));
2053
+ const merged = tenantNodes.map((node) => ({ node, availableOnTenant: true }));
2054
+ for (const known of listKnownSdkNodes()) {
2055
+ const type = known.nodeType?.toLowerCase();
2056
+ if (typeof type !== "string")
2057
+ continue;
2058
+ if (tenantTypes.has(type))
2059
+ continue;
2060
+ merged.push({ node: known, availableOnTenant: false });
2061
+ }
2062
+ return merged;
2063
+ }
2064
+ var ALL_NODES = -1;
2065
+ function parseListLimit(raw) {
2066
+ return raw.trim() === String(ALL_NODES) ? ALL_NODES : parseLimit(raw);
2067
+ }
2068
+ function shownRows(count, offset) {
2069
+ return offset === 0 ? `first ${count}` : `${count} from offset ${offset}`;
2070
+ }
2071
+ var registerRegistryCommand = (program, commandPrefix) => {
2072
+ const cmd = `uip ${commandPrefix} registry`;
2073
+ const registry = program.command("registry").description(`Browse and search the ${commandPrefix} node registry to discover available activities and connectors (OOTB + authenticated). Use 'pull' to sync, 'search' to find nodes, 'get' to inspect a node's full input/output schema.`).addHelpText("after", `
2074
+ Typical workflow:
2075
+ 0. Login for full registry (optional, OOTB nodes available without login):
2076
+ uip login
2077
+ 1. Sync the registry: ${cmd} pull
2078
+ 2. Search for a node: ${cmd} search slack
2079
+ 3. Inspect its schema: ${cmd} get <node-type>
2080
+ 4. Extract input fields: ${cmd} get <node-type> --output-filter "Node.inputDefinition.fields"
2081
+
2082
+ Note: Without login, only built-in (OOTB) nodes are available. Login to access the full node registry including custom connectors.
2083
+
2084
+ In-solution discovery (--local):
2085
+ Run from inside a solution project directory (with a .uipx file in CWD, parent, or grandparent).
2086
+ Shows sibling projects (Agent, Process, Flow, Api) as invokable nodes.
2087
+ cd MySolution/MyFlow && ${cmd} list --local
2088
+
2089
+ Subcommands:
2090
+ pull Fetch and cache the full node registry (run once per session)
2091
+ list List cached nodes (default: first 20, --limit -1 for everything)
2092
+ search Find nodes by keyword and/or field filters ← start here
2093
+ get Get full schema for a single node (with connector input/output enrichment)`);
2094
+ const pullExamples = [
2095
+ {
2096
+ Description: "Sync the node registry",
2097
+ Command: `${cmd} pull`,
2098
+ Output: {
2099
+ Code: "NodePullSuccess",
2100
+ Data: {
2101
+ NodesCount: 184,
2102
+ FromCache: false,
2103
+ Source: "authenticated",
2104
+ CacheWritten: true,
2105
+ Message: "Synced fresh nodes"
2106
+ }
2107
+ }
2206
2108
  }
2207
- targets = allOutputs;
2208
- } else {
2209
- const seen = new Set;
2210
- targets = [];
2211
- for (const name of flags.variable ?? []) {
2212
- const matches = allOutputs.filter((o) => o.output.name === name && (flags.elementId === undefined || o.elementId === flags.elementId));
2213
- if (matches.length === 0) {
2214
- throw new Error(available ? `No variable matched "${name}"${flags.elementId ? ` in element ${flags.elementId}` : ""}. Available: ${available}.` : "This process has no taggable variables.");
2109
+ ];
2110
+ const listExamples = [
2111
+ {
2112
+ Description: "List cached nodes (every row carries AvailableOnTenant; FF-gated SDK-known nodes are included)",
2113
+ Command: `${cmd} list --limit 2`,
2114
+ Output: {
2115
+ Code: "NodeListSuccess",
2116
+ Data: [
2117
+ {
2118
+ NodeType: "uipath.slack.connector.send-message",
2119
+ Category: "connector",
2120
+ DisplayName: "Send Message",
2121
+ Description: "Post a message to a Slack channel",
2122
+ Version: "1.0.0",
2123
+ Tags: "slack, messaging",
2124
+ AvailableOnTenant: true
2125
+ },
2126
+ {
2127
+ NodeType: "uipath.human-in-the-loop",
2128
+ Category: "human-task",
2129
+ DisplayName: "Human in the Loop",
2130
+ Description: "Assign a task to a human and wait for completion",
2131
+ Version: "1.0.0",
2132
+ Tags: "human-task, hitl, human-in-the-loop, approval",
2133
+ AvailableOnTenant: false
2134
+ }
2135
+ ]
2215
2136
  }
2216
- if (flags.elementId === undefined && new Set(matches.map((m) => m.elementId)).size > 1) {
2217
- const where = matches.map((m) => m.elementId).join(", ");
2218
- throw new Error(`Variable "${name}" exists in multiple elements (${where}). Pass --element-id to disambiguate (one --variable at a time), or --all to tag every occurrence.`);
2137
+ }
2138
+ ];
2139
+ const searchExamples = [
2140
+ {
2141
+ Description: "Search nodes by keyword (every row carries AvailableOnTenant; FF-gated SDK-known nodes are included)",
2142
+ Command: `${cmd} search slack`,
2143
+ Output: {
2144
+ Code: "NodeSearchSuccess",
2145
+ Data: [
2146
+ {
2147
+ NodeType: "uipath.slack.connector.send-message",
2148
+ Category: "connector",
2149
+ DisplayName: "Send Message",
2150
+ Description: "Post a message to a Slack channel",
2151
+ Version: "1.0.0",
2152
+ Tags: "slack, messaging",
2153
+ AvailableOnTenant: true
2154
+ }
2155
+ ]
2219
2156
  }
2220
- for (const m of matches) {
2221
- if (!seen.has(m.output)) {
2222
- seen.add(m.output);
2223
- targets.push(m);
2157
+ }
2158
+ ];
2159
+ const getExamples = [
2160
+ {
2161
+ Description: "Get the full schema for a node",
2162
+ Command: `${cmd} get uipath.slack.connector.send-message`,
2163
+ Output: {
2164
+ Code: "NodeGetSuccess",
2165
+ Data: {
2166
+ Node: {
2167
+ nodeType: "uipath.slack.connector.send-message",
2168
+ category: "connector",
2169
+ display: { label: "Send Message" },
2170
+ inputDefinition: {
2171
+ fields: [{ name: "channel", required: true }]
2172
+ }
2173
+ }
2224
2174
  }
2225
2175
  }
2226
2176
  }
2227
- }
2228
- const replaceTags = flags.tags !== undefined ? parseTagList(flags.tags) : undefined;
2229
- const addTags = parseTagList(flags.addTags);
2230
- const removeSet = new Set(parseTagList(flags.removeTags));
2231
- return targets.map(({ elementId, output }) => {
2232
- const next = replaceTags !== undefined ? [...new Set(replaceTags)] : [...new Set([...output.tags ?? [], ...addTags])].filter((tag) => !removeSet.has(tag));
2233
- output.tags = next;
2234
- return { elementId, name: output.name, tags: next };
2235
- });
2236
- };
2237
- var buildSettingsPath = (processKey) => `/processes/${encodeURIComponent(processKey)}/settings`;
2238
- var validateFriendlyTagFlags = (options) => {
2239
- const variableCount = options.variable.length;
2240
- if (variableCount > 0 && options.all) {
2241
- return "Use either --variable or --all, not both.";
2242
- }
2243
- if (variableCount === 0 && !options.all) {
2244
- return "Specify the target with --variable <name> (repeatable, plus optional --element-id) or --all.";
2245
- }
2246
- if (variableCount > 1 && options.elementId !== undefined) {
2247
- return "--element-id only works with a single --variable; pass one --variable, or drop --element-id.";
2248
- }
2249
- const hasSearchable = options.searchable !== undefined;
2250
- const hasReplace = options.tags !== undefined;
2251
- const hasIncremental = options.addTags !== undefined || options.removeTags !== undefined;
2252
- if (hasSearchable && (hasReplace || hasIncremental)) {
2253
- return "Use --searchable <true|false>, or the low-level --tags/--add-tags/--remove-tags flags — not both.";
2254
- }
2255
- if (!hasSearchable && !hasReplace && !hasIncremental) {
2256
- return "Specify --searchable <true|false> to mark the variable searchable, or --tags/--add-tags/--remove-tags for other tags.";
2257
- }
2258
- if (hasReplace && hasIncremental) {
2259
- return "Use --tags to replace tags, or --add-tags/--remove-tags to adjust them — not both.";
2260
- }
2261
- return null;
2262
- };
2263
- var resolveTagFlags = (options) => {
2264
- if (options.searchable === undefined)
2265
- return options;
2266
- return {
2267
- variable: options.variable,
2268
- elementId: options.elementId,
2269
- all: options.all,
2270
- addTags: options.searchable ? SEARCHABLE_TAG : undefined,
2271
- removeTags: options.searchable ? undefined : SEARCHABLE_TAG
2272
- };
2273
- };
2274
- var setVariableTagsFromPayload = async (processKey, options) => {
2275
- const [fileError, variableTags] = await catchError(resolveJsonInput({ inline: options.inputs, allowStdin: true }));
2276
- if (fileError) {
2277
- OutputFormatter.error({
2278
- Result: RESULTS.Failure,
2279
- Message: "Error reading variable tags input",
2280
- Instructions: fileError.message
2281
- });
2282
- processContext.exit(1);
2283
- return;
2284
- }
2285
- if (variableTags === undefined) {
2286
- OutputFormatter.error({
2287
- Result: RESULTS.Failure,
2288
- Message: "Missing variable tags payload",
2289
- Instructions: "Provide --inputs <json|@file>, pipe JSON via stdin, or use the --variable/--all flags."
2290
- });
2291
- processContext.exit(1);
2292
- return;
2293
- }
2294
- const reqOptions = { folderKey: options.folderKey };
2295
- const currentSettings = await withPimsCall((config) => pimsGet(config, buildSettingsPath(processKey), reqOptions), "Error reading current process settings");
2296
- if (!currentSettings)
2297
- return;
2298
- const merged = { ...currentSettings, variableTags };
2299
- const result = await withPimsCall((config) => pimsPut(config, buildSettingsPath(processKey), merged, reqOptions), "Error updating variable tags");
2300
- if (!result)
2301
- return;
2302
- OutputFormatter.success({
2303
- Result: RESULTS.Success,
2304
- Code: "ProcessVariableTagsSet",
2305
- Data: result
2306
- });
2307
- };
2308
- var setVariableTagsFromFlags = async (processKey, options) => {
2309
- const reqOptions = { folderKey: options.folderKey };
2310
- const currentSettings = await withPimsCall((config) => pimsGet(config, buildSettingsPath(processKey), reqOptions), "Error reading current process settings");
2311
- if (!currentSettings)
2312
- return;
2313
- const variableTags = currentSettings.variableTags ?? {
2314
- elements: {},
2315
- sourcePackageVersion: "",
2316
- lastUpdateTimeUtc: ""
2317
- };
2318
- const [mutateError, updated] = catchError(() => applyFriendlyVariableTags(variableTags, resolveTagFlags(options)));
2319
- if (mutateError) {
2320
- OutputFormatter.error({
2321
- Result: RESULTS.Failure,
2322
- Message: "Error updating variable tags",
2323
- Instructions: mutateError.message
2324
- });
2325
- processContext.exit(1);
2326
- return;
2327
- }
2328
- const merged = { ...currentSettings, variableTags };
2329
- const result = await withPimsCall((config) => pimsPut(config, buildSettingsPath(processKey), merged, reqOptions), "Error updating variable tags");
2330
- if (!result)
2331
- return;
2332
- OutputFormatter.success({
2333
- Result: RESULTS.Success,
2334
- Code: "ProcessVariableTagsSet",
2335
- Data: { updated, variableTags }
2336
- });
2337
- };
2338
- var registerSharedProcessCommands = (processCmd, config) => {
2339
- const { toolLabel } = config;
2340
- const settingsCmd = processCmd.command("settings").description(`Manage ${toolLabel} process settings`);
2341
- settingsCmd.command("get").description(`Get settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
2342
- const reqOptions = { folderKey: options.folderKey };
2343
- const result = await withPimsCall((config2) => pimsGet(config2, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting process settings", { resource: "process", id: processKey });
2344
- if (!result)
2177
+ ];
2178
+ registry.command("pull").description(`Pull and sync node data from ${commandPrefix} registry (login first for full registry)`).option("-f, --force", "Force refresh, ignore cache").examples(pullExamples).trackedAction(processContext, async (options) => {
2179
+ const { MANIFEST_VALIDATION_NEXT_STEP, pullNodes } = await import("./node-sync-service-68vq10je.js");
2180
+ const [error, result] = await catchError2(pullNodes({
2181
+ force: options.force
2182
+ }));
2183
+ if (error) {
2184
+ OutputFormatter.error({
2185
+ Result: RESULTS.Failure,
2186
+ Message: "Error pulling nodes",
2187
+ Instructions: error.message
2188
+ });
2189
+ processContext.exit(1);
2190
+ return;
2191
+ }
2192
+ if (result.failures?.length) {
2193
+ OutputFormatter.error({
2194
+ Result: RESULTS.Failure,
2195
+ Message: `The tenant manifest failed validation, so the pull returned only ${result.syncedCount} OOTB nodes; the cache was not updated`,
2196
+ Instructions: `registry get/search keep serving this tenant's previous cache, if there is one, until it is 30 minutes old. ${MANIFEST_VALIDATION_NEXT_STEP} The validation error is in Data.Failures.`,
2197
+ Retry: "RetryWillNotFix",
2198
+ Data: {
2199
+ NodesCount: result.syncedCount,
2200
+ Source: result.source,
2201
+ CacheWritten: false,
2202
+ Failures: result.failures.map((f) => ({
2203
+ Source: f.source,
2204
+ Reason: f.reason
2205
+ }))
2206
+ }
2207
+ });
2208
+ processContext.exit(1);
2345
2209
  return;
2210
+ }
2211
+ const missing = result.missingSources ?? [];
2212
+ const base = result.fromCache ? `Using cached nodes (age: ${result.ageMinutes}m)` : "Synced fresh nodes";
2213
+ const message = missing.length ? `${base}; missing node sources: ${missing.map((m) => m.source).join(", ")}` : base;
2214
+ const finalMessage = result.info ? `${message}. ${result.info}` : message;
2346
2215
  OutputFormatter.success({
2347
2216
  Result: RESULTS.Success,
2348
- Code: "ProcessSettingsGet",
2349
- Data: result
2217
+ Code: "NodePullSuccess",
2218
+ Data: {
2219
+ NodesCount: result.syncedCount,
2220
+ FromCache: result.fromCache,
2221
+ AgeMinutes: result.ageMinutes,
2222
+ Source: result.source,
2223
+ CacheWritten: result.cacheWritten,
2224
+ Message: finalMessage,
2225
+ Info: result.info,
2226
+ ...missing.length > 0 && {
2227
+ MissingSources: missing.map((m) => ({
2228
+ Source: m.source,
2229
+ Reason: m.reason
2230
+ }))
2231
+ }
2232
+ }
2350
2233
  });
2351
2234
  });
2352
- settingsCmd.command("set").description(`Update settings for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--inputs <value>", "Settings payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (processKey, options) => {
2353
- const [fileError, body] = await catchError(resolveJsonInput({
2354
- inline: options.inputs,
2355
- allowStdin: true
2356
- }));
2357
- if (fileError) {
2358
- OutputFormatter.error({
2359
- Result: RESULTS.Failure,
2360
- Message: "Error reading settings input",
2361
- Instructions: fileError.message
2235
+ registry.command("list").description("Sample cached nodes to inspect their config structure (default: first 20). Output merges tenant nodes with the SDK-known catalog; every row carries `AvailableOnTenant` so callers can filter FF-gated rows. Use 'search' to find nodes — use --limit -1 only if you need the full list (the result can be huge and unreadable).").addHelpText("after", `
2236
+ Examples:
2237
+ ${cmd} list
2238
+ ${cmd} list --limit 200
2239
+ ${cmd} list --limit -1
2240
+
2241
+ In-solution (--local):
2242
+ cd MySolution/MyFlow && ${cmd} list --local`).option("-l, --limit <n>", "Number of nodes to return (1-10000, default: 20, -1 for all)", parseListLimit, 20).option("--offset <number>", "Number of nodes to skip (0-1000000)", parseOffset, 0).option("--local", "Show only in-solution project nodes (requires .uipx in CWD, parent, or grandparent). Omits `AvailableOnTenant` (no tenant lookup).").examples(listExamples).trackedAction(processContext, async (options) => {
2243
+ const {
2244
+ getLocalSolutionSnapshot,
2245
+ listNodes,
2246
+ localContractWarning
2247
+ } = await import("./node-sync-service-68vq10je.js");
2248
+ const showAll = options.limit === ALL_NODES;
2249
+ if (options.local) {
2250
+ const [error, snapshot] = await catchError2(getLocalSolutionSnapshot());
2251
+ if (error) {
2252
+ OutputFormatter.error({
2253
+ Result: RESULTS.Failure,
2254
+ Message: "Error listing nodes",
2255
+ Instructions: error.message
2256
+ });
2257
+ processContext.exit(1);
2258
+ return;
2259
+ }
2260
+ const localNodes = snapshot.manifests;
2261
+ const totalCount = localNodes.length;
2262
+ const effectiveLimit = showAll ? totalCount : options.limit;
2263
+ const nodes = localNodes.slice(options.offset, options.offset + effectiveLimit);
2264
+ const truncated = options.offset + nodes.length < totalCount;
2265
+ const warning = localContractWarning(snapshot, nodes);
2266
+ OutputFormatter.success({
2267
+ Result: RESULTS.Success,
2268
+ Code: "NodeListSuccess",
2269
+ Data: nodes.map(flattenNodeForDisplay),
2270
+ Pagination: new Pagination({
2271
+ returned: nodes.length,
2272
+ limit: effectiveLimit,
2273
+ offset: options.offset,
2274
+ total: totalCount
2275
+ }),
2276
+ ...await localResultNotes(warning)
2362
2277
  });
2363
- processContext.exit(1);
2278
+ if (truncated) {
2279
+ logger.info(`Showing ${shownRows(nodes.length, options.offset)} of ${totalCount}. Use --limit, --offset or --limit -1 to get more, or use 'search' to filter.`);
2280
+ }
2364
2281
  return;
2365
2282
  }
2366
- if (body === undefined) {
2367
- OutputFormatter.error({
2368
- Result: RESULTS.Failure,
2369
- Message: "Missing settings payload",
2370
- Instructions: "Provide --inputs <json|@file> or pipe JSON via stdin."
2371
- });
2283
+ const [error, tenantNodes] = await catchError2(listNodes());
2284
+ if (error) {
2285
+ OutputFormatter.error(await classifiedFailure("Error listing nodes", error));
2372
2286
  processContext.exit(1);
2373
2287
  return;
2374
2288
  }
2375
- const reqOptions = { folderKey: options.folderKey };
2376
- const result = await withPimsCall((config2) => pimsPut(config2, `/processes/${encodeURIComponent(processKey)}/settings`, body, reqOptions), "Error updating process settings");
2377
- if (!result)
2378
- return;
2379
- OutputFormatter.success({
2380
- Result: RESULTS.Success,
2381
- Code: "ProcessSettingsSet",
2382
- Data: result
2383
- });
2384
- });
2385
- const variableTagsCmd = processCmd.command("variable-tags").description(`Manage ${toolLabel} process variable tags`);
2386
- variableTagsCmd.command("get").description(`Get variable tags for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").trackedAction(processContext, async (processKey, options) => {
2387
- const reqOptions = { folderKey: options.folderKey };
2388
- const result = await withPimsCall((config2) => pimsGet(config2, `/processes/${encodeURIComponent(processKey)}/settings`, reqOptions), "Error getting variable tags", { resource: "process", id: processKey });
2389
- if (!result)
2390
- return;
2289
+ const merged = await mergeWithKnownSdkNodes(tenantNodes);
2290
+ const totalCount = merged.length;
2291
+ const effectiveLimit = showAll ? totalCount : options.limit;
2292
+ const slice = merged.slice(options.offset, options.offset + effectiveLimit);
2293
+ const truncated = options.offset + slice.length < totalCount;
2294
+ const gatedCount = merged.filter((m) => !m.availableOnTenant).length;
2391
2295
  OutputFormatter.success({
2392
2296
  Result: RESULTS.Success,
2393
- Code: "ProcessVariableTagsGet",
2394
- Data: result.variableTags ?? {}
2297
+ Code: "NodeListSuccess",
2298
+ Data: slice.map((m) => flattenNodeWithAvailability(m.node, m.availableOnTenant)),
2299
+ Pagination: new Pagination({
2300
+ returned: slice.length,
2301
+ limit: effectiveLimit,
2302
+ offset: options.offset,
2303
+ total: totalCount
2304
+ })
2395
2305
  });
2306
+ if (truncated) {
2307
+ logger.info(`Showing ${shownRows(slice.length, options.offset)} of ${totalCount} (${gatedCount} not enabled on this tenant). Use --limit, --offset or --limit -1 to get more.`);
2308
+ } else if (gatedCount > 0) {
2309
+ logger.info(`${gatedCount} of ${totalCount} node type(s) are not enabled on this tenant (AvailableOnTenant=false).`);
2310
+ }
2396
2311
  });
2397
- variableTagsCmd.command("set").description(`Update variable tags for a ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("-f, --folder-key <key>", "Folder key (GUID)").option("--variable <name>", "Name of a variable (output) to tag. Repeatable — pass it multiple times to tag several variables in one call.", collectValue, []).option("--element-id <id>", "Element that owns the variable (disambiguates when the same name appears in multiple elements). Only valid with a single --variable.").option("--all", "Apply the change to every taggable variable").option("--searchable <boolean>", "Mark the variable searchable for instance filtering ('true' or 'false')", parseBooleanFlag).option("--tags <list>", "Advanced: comma-separated tags to set, replacing the variable's current tags (empty value clears them)").option("--add-tags <list>", "Comma-separated tags to add to the variable's current tags").option("--remove-tags <list>", "Comma-separated tags to remove from the variable's current tags").option("--inputs <value>", "Full variable tags payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (processKey, options) => {
2398
- const friendlyRequested = options.variable.length > 0 || options.elementId !== undefined || options.all === true || options.searchable !== undefined || options.tags !== undefined || options.addTags !== undefined || options.removeTags !== undefined;
2399
- if (options.inputs !== undefined && friendlyRequested) {
2312
+ registry.command("search").description("Find nodes by keyword and/or field filters").addHelpText("after", `
2313
+ Filter syntax:
2314
+ field=value equality (default operator)
2315
+ field:contains=value field contains value
2316
+ field:startsWith=value field starts with value
2317
+ field:endsWith=value field ends with value
2318
+ field:in=value1,value2 field matches any of the values
2319
+ field1=v1,field2=v2 multiple conditions (AND logic)
2320
+
2321
+ Filterable fields:
2322
+ category / cat e.g. "connector", "agent"
2323
+ type / nodetype node type identifier
2324
+ tags / tag node tags
2325
+ displayname / name / label human-readable display name
2326
+
2327
+ Examples:
2328
+ ${cmd} search slack
2329
+ ${cmd} search --filter "category=connector"
2330
+ ${cmd} search --filter "displayname:contains=send message"
2331
+ ${cmd} search slack --filter "category=connector"
2332
+ ${cmd} search --filter "tags:in=ai,automation"
2333
+ ${cmd} search --filter "category=connector,displayname:contains=slack"
2334
+
2335
+ Tip: pipe through --output-filter to extract just the nodeType values:
2336
+ ${cmd} search slack --output-filter "[*].NodeType"
2337
+
2338
+ In-solution (--local):
2339
+ cd MySolution/MyFlow && ${cmd} search agent --local`).argument("[keyword]", "Search term matched against nodeType, category, tags, display name, and description").option("-f, --filter <filter>", "Structured field filter: field=value or field:operator=value. Comma-separated = AND. Fields: category, type, tags, displayname, description.").option("--local", "Search only in-solution project nodes (requires .uipx in CWD, parent, or grandparent). Omits `AvailableOnTenant` (no tenant lookup).").examples(searchExamples).trackedAction(processContext, async (keyword, options) => {
2340
+ let parsedFilters;
2341
+ if (options.filter) {
2342
+ const [parseError, parsed] = catchError2(() => parseFilterString(options.filter));
2343
+ if (parseError) {
2344
+ if (parseError instanceof FilterParseError) {
2345
+ OutputFormatter.error({
2346
+ Result: RESULTS.Failure,
2347
+ Message: "Invalid filter syntax",
2348
+ Instructions: `${parseError.message} Examples: category=agent, displayname:contains=http, tags:in=ai,automation.`
2349
+ });
2350
+ processContext.exit(1);
2351
+ return;
2352
+ }
2353
+ OutputFormatter.error({
2354
+ Result: RESULTS.Failure,
2355
+ Message: "Error searching nodes",
2356
+ Instructions: parseError.message
2357
+ });
2358
+ processContext.exit(1);
2359
+ return;
2360
+ }
2361
+ parsedFilters = parsed;
2362
+ }
2363
+ if (!keyword && !parsedFilters) {
2400
2364
  OutputFormatter.error({
2401
2365
  Result: RESULTS.Failure,
2402
- Message: "Error updating variable tags",
2403
- Instructions: "Provide either --inputs (full JSON payload) or the --searchable/--variable/--all flags, not both."
2366
+ Message: "Search requires either a keyword or filters",
2367
+ Instructions: "Provide a keyword or use --filter flag"
2404
2368
  });
2405
2369
  processContext.exit(1);
2406
2370
  return;
2407
2371
  }
2408
- if (friendlyRequested) {
2409
- const validationError = validateFriendlyTagFlags(options);
2410
- if (validationError) {
2372
+ const {
2373
+ filterNodesByKeyword,
2374
+ getLocalSolutionSnapshot,
2375
+ localContractWarning,
2376
+ searchNodeSummariesWithAvailability,
2377
+ searchNodes,
2378
+ searchNodesWithFilters
2379
+ } = await import("./node-sync-service-68vq10je.js");
2380
+ const searchLocal = () => parsedFilters ? searchNodesWithFilters(keyword, parsedFilters, {
2381
+ local: true
2382
+ }) : searchNodes(keyword, { local: true });
2383
+ if (options.local) {
2384
+ const [searchError, snapshot] = await catchError2(getLocalSolutionSnapshot());
2385
+ if (searchError) {
2411
2386
  OutputFormatter.error({
2412
2387
  Result: RESULTS.Failure,
2413
- Message: "Error updating variable tags",
2414
- Instructions: validationError
2388
+ Message: "Error searching nodes",
2389
+ Instructions: searchError.message
2415
2390
  });
2416
2391
  processContext.exit(1);
2417
2392
  return;
2418
2393
  }
2419
- await setVariableTagsFromFlags(processKey, options);
2394
+ const { searchWithFilters } = await import("./filter-engine-dh9s90gb.js");
2395
+ const results = parsedFilters ? searchWithFilters(snapshot.manifests, keyword, parsedFilters) : filterNodesByKeyword(snapshot.manifests, keyword);
2396
+ const warning = localContractWarning(snapshot, results);
2397
+ OutputFormatter.success({
2398
+ Result: RESULTS.Success,
2399
+ Code: "NodeSearchSuccess",
2400
+ Data: results.map(flattenNodeForDisplay),
2401
+ ...await localResultNotes(warning)
2402
+ });
2420
2403
  return;
2421
2404
  }
2422
- await setVariableTagsFromPayload(processKey, options);
2423
- });
2424
- attachSharedExamples(settingsCmd);
2425
- attachSharedExamples(variableTagsCmd);
2426
- };
2427
-
2428
- // ../maestro-sdk/src/shared-commands/processes.ts
2429
- async function findProcessSummary(config, processKey, folderKey, processType) {
2430
- const page = await pimsGet(config, `/processes/summary${buildQueryString({ processType, processKey })}`, { folderKey });
2431
- const summaries = Array.isArray(page?.processes) ? page.processes : [];
2432
- return summaries.find((summary) => summary.processKey === processKey) ?? null;
2433
- }
2434
- var registerSharedProcessesCommands = (program, config) => {
2435
- const { toolLabel, processType } = config;
2436
- const incidentsQuery = buildQueryString({ processType });
2437
- const processes = program.command("processes").description(`Manage ${toolLabel} process summaries`);
2438
- processes.command("list").description(`List all ${toolLabel} process summaries`).option("--folder-key <key>", "Folder key").option("-l, --limit <number>", "Number of items to return (1-10000)", parseLimit).option("--offset <number>", "Number of items to skip (0-1000000)", parseOffset, 0).option("--status <status>", "Filter by process status").trackedAction(processContext, async (options) => {
2439
- const query = buildQueryString({
2440
- processType,
2441
- status: options.status,
2442
- $top: options.limit,
2443
- $skip: options.offset !== 0 ? options.offset : undefined
2444
- });
2445
- const reqOptions = { folderKey: options.folderKey };
2446
- const result = await withPimsCall((config2) => pimsGet(config2, `/processes/summary${query}`, reqOptions), "Error listing processes");
2447
- if (!result)
2405
+ const [searchError, results] = await catchError2(searchNodeSummariesWithAvailability(keyword, parsedFilters));
2406
+ if (searchError) {
2407
+ OutputFormatter.error(await classifiedFailure("Error searching nodes", searchError));
2408
+ processContext.exit(1);
2448
2409
  return;
2410
+ }
2411
+ let warning;
2412
+ if (results.length === 0) {
2413
+ const [, localMatches] = await catchError2(searchLocal());
2414
+ if (localMatches && localMatches.length > 0) {
2415
+ warning = `No tenant node matches, but ${localMatches.length} node(s) from projects in this solution do. Re-run the same search with --local.`;
2416
+ }
2417
+ }
2449
2418
  OutputFormatter.success({
2450
2419
  Result: RESULTS.Success,
2451
- Code: "ProcessList",
2452
- Data: result
2420
+ Code: "NodeSearchSuccess",
2421
+ Data: results.map((result) => flattenNodeWithAvailability(result.node, result.availableOnTenant)),
2422
+ ...warning ? { Warning: warning } : {}
2453
2423
  });
2454
2424
  });
2455
- processes.command("incidents").description(`Get incidents for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
2456
- const reqOptions = { folderKey: options.folderKey };
2457
- const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, reqOptions), "Error getting process incidents", { resource: "process", id: processKey });
2458
- if (!result)
2425
+ registry.command("get").description("Get the full schema for a single node. For connector nodes (uipath.connector.*), the base manifest is automatically enriched with live metadata from Integration Service.").addHelpText("after", `
2426
+ IS-enriched fields (connector nodes only, fetched live from Integration Service):
2427
+
2428
+ Activity nodes (uipath.connector.*, not trigger):
2429
+ inputDefinition.fields Fields to configure. Each field has: name, displayName, type, required, and optionally reference (lookup: objectName, path, lookupValue, lookupNames, childPath; 4.0.0 activities carry scriptRef instead of objectName — resolve with 'uip is resources run script --script-ref') or enum.
2430
+ outputResponseDefinition Fields produced after the node runs.
2431
+ connectorMethodInfo HTTP details (method, path, operationId).
2432
+ --connection-id optional — adds custom fields specific to that account.
2433
+
2434
+ Trigger nodes (uipath.connector.trigger.*):
2435
+ eventParameters Fields that configure the trigger (e.g. which folder to watch).
2436
+ filterFields Fields used to filter which events fire the trigger.
2437
+ outputResponseDefinition Fields produced by the trigger event payload.
2438
+ eventMode "webhooks" or "polling".
2439
+ login + --connection-id required — without both, no enrichment is returned.
2440
+
2441
+ Examples:
2442
+ ${cmd} get uipath.slack.connector.send-message
2443
+ ${cmd} get uipath.connector.uipath-salesforce-slack.send-message --connection-id <id>
2444
+ ${cmd} get uipath.connector.trigger.uipath-microsoft-outlook365.email-received --connection-id <id>
2445
+
2446
+ In-solution (--local):
2447
+ cd MySolution/MyFlow && ${cmd} get <node-type> --local`).argument("<node-type>", `Node type identifier — get it from '${cmd} search'`).option("--connection-id <id>", "Connection ID for Integration Service connector node enrichment. Required for connector trigger nodes; optional for connector activity nodes.").option("--local", "Get node from in-solution projects only (requires .uipx in CWD, parent, or grandparent)").examples(getExamples).trackedAction(processContext, async (nodeType, options) => {
2448
+ const { getLocalNodeEnriched, getNode, getNodeEnriched } = await import("./node-sync-service-68vq10je.js");
2449
+ const [error, lookedUp] = await catchError2(options.local ? getLocalNodeEnriched(nodeType, options.connectionId) : getNodeEnriched(nodeType, options.connectionId, {
2450
+ local: options.local
2451
+ }).then((node) => ({ node, warning: undefined })));
2452
+ if (error) {
2453
+ OutputFormatter.error(await classifiedFailure("Error retrieving node", error));
2454
+ processContext.exit(1);
2459
2455
  return;
2460
- OutputFormatter.success({
2461
- Result: RESULTS.Success,
2462
- Code: "ProcessIncidents",
2463
- Data: result
2464
- });
2465
- });
2466
- processes.command("diagnose").description(`Correlate ${toolLabel} process summary, incidents, and error codes`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
2467
- const result = await withPimsCall(async (config2) => {
2468
- const summary = await findProcessSummary(config2, processKey, options.folderKey, processType);
2469
- const incidents = await pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, { folderKey: options.folderKey });
2470
- const errorCodes = await pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, { folderKey: options.folderKey });
2471
- return {
2472
- summary,
2473
- incidents,
2474
- errorCodes: errorCodes.errorCodes || []
2475
- };
2476
- }, "Error diagnosing process");
2477
- if (!result)
2456
+ }
2457
+ const result = lookedUp?.node;
2458
+ const warning = lookedUp?.warning;
2459
+ if (!result) {
2460
+ const [, inSolution] = options.local ? [undefined, null] : await catchError2(getNode(nodeType, { local: true }));
2461
+ const withoutProcessResource = inSolution ? undefined : await explainNodeTypeWithoutProcessResource(nodeType);
2462
+ OutputFormatter.error({
2463
+ Result: RESULTS.Failure,
2464
+ Message: withoutProcessResource?.message ?? "Node not found",
2465
+ Instructions: withoutProcessResource?.instructions ?? (inSolution ? `'${nodeType}' is a node of a project in this solution, which only --local looks up. Run: ${cmd} get ${nodeType} --local` : `No node found with node type: ${nodeType}`),
2466
+ ErrorCode: "not_found"
2467
+ });
2468
+ processContext.exit(1);
2478
2469
  return;
2470
+ }
2479
2471
  OutputFormatter.success({
2480
2472
  Result: RESULTS.Success,
2481
- Code: "ProcessDiagnostics",
2473
+ Code: "NodeGetSuccess",
2482
2474
  Data: {
2483
- ProcessKey: processKey,
2484
- FolderKey: options.folderKey,
2485
- Summary: result.summary,
2486
- FaultedCount: result.summary?.faultedCount ?? null,
2487
- RunningCount: result.summary?.runningCount ?? null,
2488
- Incidents: result.incidents,
2489
- IncidentCount: result.incidents.length,
2490
- ErrorCodes: result.errorCodes,
2491
- ErrorCodeCount: result.errorCodes.length
2492
- }
2493
- });
2494
- });
2495
- processes.command("error-codes").description(`Get unique error codes for a specific ${toolLabel} process`).argument("<process-key>", "Process definition key").requiredOption("--folder-key <key>", "Folder key").trackedAction(processContext, async (processKey, options) => {
2496
- const reqOptions = { folderKey: options.folderKey };
2497
- const result = await withPimsCall((config2) => pimsGet(config2, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, reqOptions), "Error getting process error codes", { resource: "process", id: processKey });
2498
- if (!result)
2499
- return;
2500
- OutputFormatter.success({
2501
- Result: RESULTS.Success,
2502
- Code: "ProcessIncidentErrorCodes",
2503
- Data: result.errorCodes || []
2504
- });
2475
+ Node: result
2476
+ },
2477
+ ...warning ? { Warning: warning } : {}
2478
+ }, { preserveDataKeys: true });
2505
2479
  });
2506
- attachSharedExamples(processes);
2507
2480
  };
2508
2481
 
2509
2482
  export { registerRegistryCommand, registerSharedDebugInstanceCommands, registerSharedIncidentCommands, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
2510
2483
 
2511
- //# debugId=7138755E22A0856964756E2164756E21
2484
+ //# debugId=2A3CACF7B45A0E8E64756E2164756E21