@uipath/flow-tool 1.206.0-preview.301 → 1.207.0-preview.305

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 (254) hide show
  1. package/README.md +2 -1
  2. package/dist/THIRD-PARTY-NOTICES.md +10 -10
  3. package/dist/{applicationinsights-web-8m26566f.js → applicationinsights-web-c6epsatg.js} +1 -1
  4. package/dist/{authoring-az69rn0j.js → authoring-f5ttjy3d.js} +5 -5
  5. package/dist/{binding-service-cp1mj80n.js → binding-service-qfbtg6qy.js} +37 -34
  6. package/dist/{browser-strategy-gnftxwsf.js → browser-strategy-1nk8hgcf.js} +1 -1
  7. package/dist/case-catalog-h4fjn6q3.js +304 -0
  8. package/dist/{connector-library-1yw5r47w.js → connector-library-844myxz2.js} +20 -6
  9. package/dist/{connector-service-40wy8yrq.js → connector-service-8t5swsf9.js} +156 -76
  10. package/dist/{conversion-7O2PDOQB-gk051hmr.js → conversion-A2KZVSOA-s70m4p50.js} +256 -90
  11. package/dist/{de-AI7ML6JM-km47f8k4.js → de-B6IFKV43-9sk50xx0.js} +164 -2
  12. package/dist/{de-2BEKRUMY-x4dx0nn9.js → de-HF4GJ4EK-NX7YTOSY-4f0r23sx.js} +1282 -10
  13. package/dist/{de-2BEKRUMY-MD7L477H-21ytyk41.js → de-HF4GJ4EK-xrrajtht.js} +1277 -15
  14. package/dist/{de-VQWT6L5Y-mch4qwyv.js → de-IQ44WEAK-ayb953tp.js} +19 -4
  15. package/dist/{de-3CU65EDB-r7r10am9.js → de-T4OCQPNU-hrqdjart.js} +6 -6
  16. package/dist/{debug-conversation-trigger-62ebex43.js → debug-conversation-trigger-j20ms2xc.js} +4 -9
  17. package/dist/{debug-http-client-ykzhg1zx.js → debug-http-client-fypqjmfs.js} +6 -5
  18. package/dist/{debug-service-xq8vhrkq.js → debug-service-zv5hj0cx.js} +11 -6
  19. package/dist/{edge-service-y9zbshpm.js → edge-service-706zfmyb.js} +41 -31
  20. package/dist/{elk.bundled-phy0zc81.js → elk.bundled-pfmz610v.js} +1 -1
  21. package/dist/{en-LAVDF7IQ-ba7wzsxp.js → en-5JIPZTS5-v0f9wmd2.js} +4 -2
  22. package/dist/{en-X6T4SP2Y-FPGCJIFV-nxx09kc3.js → en-ETY46SDS-RI6EZCN6-g3n0v4ff.js} +67 -3
  23. package/dist/{en-X6T4SP2Y-xe57av1w.js → en-ETY46SDS-yfqhqvbx.js} +66 -2
  24. package/dist/{en-WPCQ4JKF-5ep5egek.js → en-JZXY3PYE-9q1q9w7h.js} +4 -4
  25. package/dist/{en-LQHKFSEY-sb41hszq.js → en-LQHKFSEY-j7gk3aaw.js} +1 -1
  26. package/dist/{en-U2NSIIZN-whenw6wh.js → en-T6VSEF3E-1hq4zfrt.js} +5 -3
  27. package/dist/{es-SPNKTD5Y-vw5cbgv5.js → es-AQW6PFIU-q2mz247f.js} +164 -2
  28. package/dist/{es-7ZTQTGKN-TXQBFYRA-5xa3wrpt.js → es-IYP2OLUY-7SKYGF6A-jp5kcwrd.js} +1272 -11
  29. package/dist/{es-7ZTQTGKN-11sj0yjx.js → es-IYP2OLUY-98xsbyd5.js} +1271 -10
  30. package/dist/{es-MX-S2RFDGDE-x9r0tv30.js → es-MX-A2DFN7CA-q5m62f60.js} +19 -4
  31. package/dist/{es-MX-IHGRIEWH-23X37OPS-3c1tv7qa.js → es-MX-D2MN3U37-0y5q0nbe.js} +1276 -15
  32. package/dist/{es-MX-IHGRIEWH-g63p0gb4.js → es-MX-D2MN3U37-D74A6FRL-1r3g7760.js} +1281 -10
  33. package/dist/{es-MX-7KJZPEQN-1fq0a9jr.js → es-MX-KWITVBWE-w49gknha.js} +164 -2
  34. package/dist/{es-MX-F7ZEHSNE-gxpm47vv.js → es-MX-YQNHSXDT-fd5ybreb.js} +6 -6
  35. package/dist/{es-EP563JWQ-1agj5n4e.js → es-TNUPGHGG-886me0sq.js} +19 -4
  36. package/dist/{es-KHVY67FO-natcvmmm.js → es-YHECPVFB-7jsrxa01.js} +6 -6
  37. package/dist/extraction-availability-service-h08mngty.js +343 -0
  38. package/dist/{flow-api-1hr7z6qc.js → flow-api-bmg7beey.js} +15 -12
  39. package/dist/{flow-debug-service-2m1mkq5s.js → flow-debug-service-bppp59pe.js} +232 -156
  40. package/dist/flow-eval-node-target-hc9n1913.js +31 -0
  41. package/dist/flow-eval-run-api-g6sphtf3.js +11 -0
  42. package/dist/{flow-eval-run-service-c18ma0n5.js → flow-eval-run-service-qdtz7ec7.js} +116 -119
  43. package/dist/{flow-eval-service-t2k2jk08.js → flow-eval-service-mg7gveh3.js} +141 -337
  44. package/dist/{flow-init-sdk-source-vg1ckdrf.js → flow-init-sdk-source-t2q2w6v7.js} +5 -5
  45. package/dist/flow-init-service-0m5yp9fe.js +27 -0
  46. package/dist/flow-io-c8b17vbx.js +29 -0
  47. package/dist/{flow-migrate-service-6mnnm5sy.js → flow-migrate-service-a8s4rmq6.js} +20 -20
  48. package/dist/{flow-pack-service-dhjq3p0y.js → flow-pack-service-jhr4rmsy.js} +89 -90
  49. package/dist/flow-validate-service-hpt8dqyr.js +49 -0
  50. package/dist/{fr-7LK3QUWT-a94yejcs.js → fr-EPBGOBOP-rs7qy97k.js} +19 -4
  51. package/dist/{fr-7ZDL4MVO-pd27vwh6.js → fr-NISALSPL-3ANDQPI3-993fw1pz.js} +1282 -10
  52. package/dist/{fr-7ZDL4MVO-CXMRZDOF-ye0hwncb.js → fr-NISALSPL-vzfmygd7.js} +1277 -15
  53. package/dist/{fr-AXJGUT53-hdg3pmd4.js → fr-RNWK2TMC-dpyzj366.js} +164 -2
  54. package/dist/{fr-I42FODC5-p80x5v4b.js → fr-W3AFCEDL-cjfr0xqp.js} +6 -6
  55. package/dist/{governance-fetcher-41s8tnja.js → governance-fetcher-hkm1hvn0.js} +7 -7
  56. package/dist/{headless-41t9wwb7.js → headless-23ywyx9h.js} +390 -195
  57. package/dist/{hitl-service-sqkjfm9c.js → hitl-service-hs54d6tt.js} +11 -11
  58. package/dist/index-7enyyjxr.js +161 -0
  59. package/dist/{index-wss1mf5j.js → index-b02kt4sx.js} +114 -68
  60. package/dist/{index-zfkp2s1d.js → index-cg965dhq.js} +34 -27
  61. package/dist/{index-t2f7scza.js → index-db1djbzm.js} +12 -8
  62. package/dist/{index-r44xc976.js → index-eyjrdzgx.js} +5 -5
  63. package/dist/{index-7fet3f0s.js → index-h67w2p9p.js} +3 -3
  64. package/dist/{index-f5kq7265.js → index-r6crd7tx.js} +6 -4
  65. package/dist/{index-ng011fzs.js → index-r6y07e14.js} +94 -74
  66. package/dist/{index-5pzp2qeb.js → index-v3w1930f.js} +18 -18
  67. package/dist/{index-d4bdedx3.js → index-ynw2efd8.js} +6 -4
  68. package/dist/{index-p0hgkhy2.js → index-zemcat7k.js} +13 -11
  69. package/dist/index.js +16 -14
  70. package/dist/{index.umd.min-ttg1qc0x.js → index.umd.min-5yxdz5j3.js} +1 -1
  71. package/dist/init.js +18 -17
  72. package/dist/{inline-entity-resolver-vjmjd3zd.js → inline-entity-resolver-9esjm2e7.js} +11 -11
  73. package/dist/input-reader-3zvbsn6a.js +12 -0
  74. package/dist/integration-service-fetcher-h6er48b7.js +65 -0
  75. package/dist/{ja-C7GZV6YP-hvtbngr5.js → ja-DH4I3GEF-ywyhhppa.js} +164 -2
  76. package/dist/{ja-LGAM5HKR-sgrtjqjh.js → ja-HTS2Q4YG-4ahnq47y.js} +1277 -10
  77. package/dist/{ja-LGAM5HKR-NTPKIZEM-yrx5rnw2.js → ja-HTS2Q4YG-7Q6WUI6H-6e5nzy0t.js} +1278 -11
  78. package/dist/{ja-WY2W6733-ayr36h1f.js → ja-HWFIXC2V-gg9xvhsv.js} +19 -4
  79. package/dist/{ja-GI3OUHPZ-28fy60r0.js → ja-WOANIGX4-qnyzk2t8.js} +6 -6
  80. package/dist/{jmespath-wwym30dp.js → jmespath-dbsejrwn.js} +1 -1
  81. package/dist/json-input-pj18qjt0.js +17 -0
  82. package/dist/{known-types-v9sxcq1c.js → known-types-pen5h5kz.js} +4 -4
  83. package/dist/{ko-7B4SUZB7-2SLI636D-wxg003p8.js → ko-3JFGTMNY-VT6UQ3IS-5a2hnf97.js} +1272 -11
  84. package/dist/{ko-7B4SUZB7-c8wr20sc.js → ko-3JFGTMNY-qnf1bnef.js} +1271 -10
  85. package/dist/{ko-H2RGQWKJ-9696w762.js → ko-L3BMYD3Q-exfhqfbh.js} +19 -4
  86. package/dist/{ko-Q24HSSL4-5vn55pte.js → ko-R5BCWVO7-whzgmh6q.js} +164 -2
  87. package/dist/{ko-RYKAL74T-10m4z8vw.js → ko-RMOVRC7M-whyynn7n.js} +6 -6
  88. package/dist/library-option-9fqvdh8v.js +14 -0
  89. package/dist/localization-axzmx1mb.js +45 -0
  90. package/dist/{maestro-automate-entry-d1v5q5mv.js → maestro-automate-entry-mrap5xmt.js} +2 -2
  91. package/dist/manifest-hmeqvk74.js +60 -0
  92. package/dist/node-service-bq7m24js.js +65 -0
  93. package/dist/{node-strategy-wrjxmbzt.js → node-strategy-2r78gtca.js} +2 -2
  94. package/dist/{node-sync-service-z6tzver4.js → node-sync-service-6v7j8m4p.js} +22 -15
  95. package/dist/node-xzwyr0mf.js +172 -0
  96. package/dist/{packager-tool-rca9gsx5.js → packager-tool-0g2grsn8.js} +2 -2
  97. package/dist/packager-tool-0x8g8b5r.js +25 -0
  98. package/dist/packager-tool-13mmsykc.js +125 -0
  99. package/dist/{packager-tool-vgrswa8p.js → packager-tool-1db1wqdy.js} +30 -8
  100. package/dist/packager-tool-1yew22sn.js +9 -0
  101. package/dist/packager-tool-2devymwf.js +423 -0
  102. package/dist/{packager-tool-14rdgz3c.js → packager-tool-3sxg16ft.js} +7 -7
  103. package/dist/packager-tool-40bxn7j2.js +63 -0
  104. package/dist/{packager-tool-6an893wm.js → packager-tool-4f4jp7ez.js} +3 -3
  105. package/dist/{packager-tool-pxq0bwp0.js → packager-tool-4hn7v05x.js} +16 -9
  106. package/dist/packager-tool-4skf6ak1.js +31 -0
  107. package/dist/{packager-tool-951nhh3e.js → packager-tool-5n1v6y3q.js} +1 -1
  108. package/dist/{packager-tool-2b0tn4p4.js → packager-tool-6azsz9h8.js} +7 -7
  109. package/dist/{packager-tool-54jdtyk4.js → packager-tool-7d6y5paj.js} +11 -11
  110. package/dist/{packager-tool-ac6rvny7.js → packager-tool-7re5d8aq.js} +1139 -466
  111. package/dist/{packager-tool-6an563h8.js → packager-tool-7wpb19zf.js} +10 -3
  112. package/dist/packager-tool-9tv5cyhr.js +16 -0
  113. package/dist/{packager-tool-7atc775f.js → packager-tool-ajx79m52.js} +1 -1
  114. package/dist/{packager-tool-17af18dp.js → packager-tool-asfftv7z.js} +330 -902
  115. package/dist/{packager-tool-xfjgm8hc.js → packager-tool-b0prefcm.js} +489 -118
  116. package/dist/packager-tool-bbq5kbb9.js +318 -0
  117. package/dist/{packager-tool-xhrm7cgz.js → packager-tool-bcsjm5hv.js} +470 -315
  118. package/dist/{packager-tool-xdaxdc00.js → packager-tool-bn09xgy8.js} +14 -14
  119. package/dist/{packager-tool-1qg04b7q.js → packager-tool-bzcphfa8.js} +4 -2
  120. package/dist/{node-2my5q788.js → packager-tool-cpbsp04w.js} +189 -285
  121. package/dist/{packager-tool-gdpw0daf.js → packager-tool-dmhmcav3.js} +3773 -2625
  122. package/dist/{packager-tool-m1y5ah6s.js → packager-tool-f3htkspn.js} +215 -233
  123. package/dist/{packager-tool-1dbnq9ja.js → packager-tool-f4pvpaw2.js} +1123 -295
  124. package/dist/packager-tool-geh2qybm.js +179 -0
  125. package/dist/{packager-tool-1rhch6b5.js → packager-tool-gjjr2a2w.js} +66 -19
  126. package/dist/packager-tool-h0gzqmya.js +224 -0
  127. package/dist/packager-tool-h9f2vjwg.js +40 -0
  128. package/dist/{packager-tool-pa5s7k5n.js → packager-tool-jf4m7sqc.js} +23 -9
  129. package/dist/{packager-tool-5ymna6e6.js → packager-tool-jghqgdmm.js} +228 -487
  130. package/dist/{packager-tool-64r7e4ek.js → packager-tool-jjnfwfd4.js} +2 -2
  131. package/dist/packager-tool-kh1taypp.js +41 -0
  132. package/dist/{packager-tool-pdt4jmnw.js → packager-tool-m2h98d2z.js} +246 -61
  133. package/dist/packager-tool-m8avdf10.js +1060 -0
  134. package/dist/{packager-tool-kj5yj5hj.js → packager-tool-ma1z6nqe.js} +2 -2
  135. package/dist/{packager-tool-9m5vba43.js → packager-tool-md1vcqh4.js} +233 -14
  136. package/dist/{packager-tool-4g87fbz6.js → packager-tool-mm6a12y4.js} +8 -8
  137. package/dist/{packager-tool-2n6eg5eq.js → packager-tool-mvzswn9n.js} +134 -68
  138. package/dist/packager-tool-p8ncdnsj.js +30 -0
  139. package/dist/{packager-tool-zcb3xrfw.js → packager-tool-px52tjy2.js} +9 -7
  140. package/dist/{packager-tool-vh1hxa0j.js → packager-tool-qf08dexq.js} +584 -651
  141. package/dist/{packager-tool-m126jzdd.js → packager-tool-qkdbfkev.js} +14 -11
  142. package/dist/{packager-tool-7mxn3e7j.js → packager-tool-qtz83h01.js} +4 -2
  143. package/dist/{packager-tool-hk0fnvz5.js → packager-tool-qx8wvedy.js} +1 -1
  144. package/dist/{packager-tool-q2kwk5bf.js → packager-tool-qyhvgenw.js} +6 -4
  145. package/dist/{packager-tool-6pyaaxzk.js → packager-tool-rcjtmknf.js} +351 -42
  146. package/dist/packager-tool-swvgkcq7.js +5973 -0
  147. package/dist/{packager-tool-fzgfb0jt.js → packager-tool-t0e7fvqz.js} +1228 -759
  148. package/dist/{packager-tool-p123mtfx.js → packager-tool-tgawhrva.js} +58 -16
  149. package/dist/{packager-tool-q4trv6y6.js → packager-tool-tm4d12jb.js} +15328 -7171
  150. package/dist/{packager-tool-c7xq0z3e.js → packager-tool-v7gxvkpx.js} +13 -13
  151. package/dist/{packager-tool-yewnsyag.js → packager-tool-vg16h3pk.js} +80 -6
  152. package/dist/packager-tool-w2eqf95v.js +16 -0
  153. package/dist/packager-tool-wvf6b31h.js +50 -0
  154. package/dist/{packager-tool-q55qgk3p.js → packager-tool-wz5zmx67.js} +10 -10
  155. package/dist/packager-tool-xgh2t48c.js +255 -0
  156. package/dist/{packager-tool-w9bkq7zb.js → packager-tool-xgvp8a8g.js} +10 -10
  157. package/dist/{packager-tool-dszagpmx.js → packager-tool-y84mhf89.js} +8 -8
  158. package/dist/packager-tool-ys7jsqhg.js +184 -0
  159. package/dist/{packager-tool-ze3fnf3s.js → packager-tool-zap4kd3z.js} +7 -2
  160. package/dist/{packager-tool-0vsqvfq1.js → packager-tool-zgm6kh18.js} +21 -21
  161. package/dist/{packager-tool-dr3zc9n9.js → packager-tool-zgzpqfcs.js} +13 -6
  162. package/dist/packager-tool.js +9 -9
  163. package/dist/{prepare-uip-ad7mfs8t.js → prepare-uip-8frvq826.js} +39 -6
  164. package/dist/provision-node-service-sxnfgrwy.js +86 -0
  165. package/dist/{pt-2RGHDOG4-gwe2ptvg.js → pt-6RCFX6CY-v42k92ey.js} +19 -4
  166. package/dist/{pt-BR-BIUJXIPU-2sqzhr8y.js → pt-BR-6TBBEDQS-y3f2vg5d.js} +164 -2
  167. package/dist/{pt-BR-PHLFHMXZ-JFPKUXIZ-5c7jp2r1.js → pt-BR-7H7BP5DT-IOHWNCIU-pbdnhe7r.js} +1277 -11
  168. package/dist/{pt-BR-PHLFHMXZ-n6de4s7z.js → pt-BR-7H7BP5DT-z2e5aaj1.js} +1276 -10
  169. package/dist/{pt-BR-JWHVZE6H-gvkknv49.js → pt-BR-HDVM5NFA-azfx4gg9.js} +19 -4
  170. package/dist/{pt-BR-IL3KLBID-m1mvqqzb.js → pt-BR-HJIMGPPX-s18rb4vg.js} +6 -6
  171. package/dist/{pt-VLA5IOHO-8t4pze0h.js → pt-DZG5FPWK-6czrqk2t.js} +6 -6
  172. package/dist/{pt-N7ZTJT4W-GVODJMRX-4yqpkc4n.js → pt-QWGSZKMD-RTKSQCYA-80hp6e1q.js} +1272 -11
  173. package/dist/{pt-N7ZTJT4W-d6c67xcn.js → pt-QWGSZKMD-m50nrkx8.js} +1271 -10
  174. package/dist/{pt-MHX6JGAX-xfgvdqwg.js → pt-ZSQC5RZ3-8kp3g1z5.js} +164 -2
  175. package/dist/{ro-FLNXVYJI-ZN43XZKK-q29q8pj0.js → ro-B7G474JK-9k2jjk88.js} +1271 -15
  176. package/dist/{ro-FLNXVYJI-ytrwabg2.js → ro-B7G474JK-Q3BAA4S3-t47bbx2a.js} +1276 -10
  177. package/dist/{ro-53TS7SWG-hnjx1c7b.js → ro-EEKX2X3R-tz9prn67.js} +19 -4
  178. package/dist/{ro-3RKJNGJZ-xqj14e3d.js → ro-P33AQ6ZL-s92z1mgg.js} +164 -2
  179. package/dist/{ro-IRNFX376-mh84zk3n.js → ro-SX7RUXGR-kknxsr3g.js} +6 -6
  180. package/dist/ru-FNRVPXE5-7q150qf8.js +7 -0
  181. package/dist/ru-GSCT4ARZ-6OTD7JLB-cdcpfwx0.js +12 -0
  182. package/dist/schema-document-service-mknqzg7e.js +30 -0
  183. package/dist/{serialization-Z3UYT6BW-g3gtam7g.js → serialization-7CB4AREI-6b7ng26y.js} +482 -6161
  184. package/dist/services/binding-id-rule.d.ts +13 -0
  185. package/dist/services/binding-resource-types.d.ts +12 -0
  186. package/dist/services/extract-schema/default-schema-document.d.ts +9 -4
  187. package/dist/services/extract-schema/types.d.ts +73 -0
  188. package/dist/services/extract-schema/validate-schema-document.d.ts +75 -0
  189. package/dist/services/flow-scopes.d.ts +15 -0
  190. package/dist/services/flow-structure-checks.d.ts +8 -0
  191. package/dist/services/flow-validate-service.d.ts +44 -11
  192. package/dist/services/idp-processor-provisioning.d.ts +35 -0
  193. package/dist/services/node-service.d.ts +17 -23
  194. package/dist/services/node-validators/extract-schema-validator.d.ts +13 -0
  195. package/dist/services/node-validators/index.d.ts +1 -0
  196. package/dist/services/node-validators/js-expression-syntax-validator.d.ts +2 -1
  197. package/dist/services/node-validators/types.d.ts +2 -7
  198. package/dist/services/vars-reference-rule.d.ts +6 -0
  199. package/dist/solution-auth-k0s83ake.js +11 -0
  200. package/dist/{solution-discovery-wwwynadq.js → solution-discovery-v5qatmz2.js} +7 -7
  201. package/dist/taggable-variables-nc8td6er.js +134 -0
  202. package/dist/{tidy-service-qm6h620p.js → tidy-service-rsxb2h63.js} +17 -18
  203. package/dist/tool.js +16 -14
  204. package/dist/{tr-PIQY7JIT-2mkwk0kq.js → tr-B6TLBSLH-1797wxkh.js} +19 -4
  205. package/dist/{tr-7AIZZWZ6-pdzp9n0p.js → tr-FX7WCKK2-CEOTUJRD-5ctjnkng.js} +1276 -10
  206. package/dist/{tr-7AIZZWZ6-ESAESUPL-td09ft0v.js → tr-FX7WCKK2-x3rx9fjt.js} +1271 -15
  207. package/dist/{tr-EJKY7DVQ-rkctqva4.js → tr-OUB57VJ6-52t7zdzb.js} +6 -6
  208. package/dist/{tr-PQLUUHPC-qsb7btxn.js → tr-XD73CQAA-tb2nrpyp.js} +164 -2
  209. package/dist/utils/handle-expansion.d.ts +2 -2
  210. package/dist/validation.js +42 -39
  211. package/dist/{variable-service-yxbkns3a.js → variable-service-95j5nyjh.js} +17 -12
  212. package/dist/{wait-for-flow-job-vy4t4tbj.js → wait-for-flow-job-k990nmdn.js} +15 -12
  213. package/dist/{zh-CN-NIEVKROA-q4tbbwqz.js → zh-CN-7KN22KSH-mwvgyym6.js} +19 -4
  214. package/dist/{zh-CN-4FH7E7UL-84y6j2ea.js → zh-CN-FKWWWLFR-n15rj6p8.js} +6 -6
  215. package/dist/{zh-CN-OHNTHZRI-b0hjkfqn.js → zh-CN-GWP3B2EM-c07fm17a.js} +164 -2
  216. package/dist/{zh-CN-CN2ARPFS-e0p2qrxf.js → zh-CN-NCMB6YM5-BB2LRIMQ-phrmedm3.js} +1276 -10
  217. package/dist/{zh-CN-CN2ARPFS-NIQTWDK2-n74g1tfv.js → zh-CN-NCMB6YM5-drw9bnxg.js} +1271 -15
  218. package/dist/{zh-TW-E4D3Y6ZR-tn3bmzz5.js → zh-TW-2DLUOA7C-9khqnr4r.js} +164 -2
  219. package/dist/{zh-TW-5WQA6QTM-hns69sd4.js → zh-TW-52QTEYIZ-2mj7hy3e.js} +6 -6
  220. package/dist/{zh-TW-MSQM7YTT-m7r7nwnj.js → zh-TW-I7BH3XP2-7rb4xpzg.js} +19 -4
  221. package/dist/{zh-TW-7RUFEVFK-VKVRSVTP-cxe7jt1n.js → zh-TW-UNIEJPLE-4vxzbphe.js} +1272 -16
  222. package/dist/{zh-TW-7RUFEVFK-qd7myw31.js → zh-TW-UNIEJPLE-ECGOEPYS-xxye2kfv.js} +1277 -11
  223. package/package.json +2 -2
  224. package/dist/flow-eval-node-target-g6wtfw4w.js +0 -29
  225. package/dist/flow-eval-run-api-w4j8ra60.js +0 -9
  226. package/dist/flow-init-service-qvhyvq3k.js +0 -26
  227. package/dist/flow-io-tsxhjvk6.js +0 -24
  228. package/dist/flow-validate-service-dpjp0yv2.js +0 -46
  229. package/dist/input-reader-jjq3r7ry.js +0 -11
  230. package/dist/localization-erchshqr.js +0 -45
  231. package/dist/node-service-4392jxr2.js +0 -64
  232. package/dist/packager-tool-2sazb7th.js +0 -2
  233. package/dist/packager-tool-91kj5ry7.js +0 -18
  234. package/dist/packager-tool-9217bxm2.js +0 -6
  235. package/dist/packager-tool-cvh1a0nm.js +0 -16
  236. package/dist/packager-tool-d07g2kpn.js +0 -25
  237. package/dist/packager-tool-f2g3pea6.js +0 -461
  238. package/dist/packager-tool-f7rk9xhv.js +0 -50
  239. package/dist/packager-tool-jd3v0bh1.js +0 -26
  240. package/dist/packager-tool-k3egwd1m.js +0 -15
  241. package/dist/packager-tool-n0y4dhj1.js +0 -56
  242. package/dist/packager-tool-q0f1dvtd.js +0 -40
  243. package/dist/packager-tool-wr7gn964.js +0 -2
  244. package/dist/ru-GSCT4ARZ-FTVCGQTL-vjy6j6vk.js +0 -12
  245. package/dist/ru-T73OPRTC-50m7tty9.js +0 -7
  246. package/dist/services/connector-request-buckets.d.ts +0 -1
  247. package/dist/services/flow-eval-file-store.d.ts +0 -1
  248. package/dist/services/inline-entity-resolver.d.ts +0 -22
  249. package/dist/services/packaging-utils.d.ts +0 -130
  250. package/dist/services/preview-id-rule.d.ts +0 -33
  251. package/dist/services/ui-only-node-types.d.ts +0 -1
  252. package/dist/solution-auth-j8x84n5z.js +0 -11
  253. package/dist/utils/flow-io.d.ts +0 -19
  254. package/dist/utils/workflow-file-format.d.ts +0 -14
@@ -1,32 +1,29 @@
1
1
  import {
2
2
  catchError2
3
- } from "./packager-tool-pxq0bwp0.js";
3
+ } from "./packager-tool-4hn7v05x.js";
4
4
  import {
5
- extractErrorMessage,
6
5
  RESULTS,
6
+ extractErrorMessage,
7
+ instructionsFor,
7
8
  classifiedFailure,
8
9
  authContextFailure,
9
- InvalidArgumentError,
10
+ Option,
10
11
  logger,
11
12
  EXIT_CODES,
12
13
  Pagination,
13
14
  OutputFormatter,
14
15
  processContext,
15
16
  DEFAULT_PAGE_SIZE,
16
- isGuid,
17
17
  parseLimit,
18
18
  parseOffset,
19
19
  parseBoundedInt
20
- } from "./packager-tool-xhrm7cgz.js";
20
+ } from "./packager-tool-bcsjm5hv.js";
21
21
  import {
22
- getAuthContext2
23
- } from "./packager-tool-p123mtfx.js";
22
+ normalizeTimestamps
23
+ } from "./packager-tool-wvf6b31h.js";
24
24
  import {
25
- debugPimsGet2,
26
- debugPimsPost2,
27
- debugPimsPut2,
28
- debugPimsPatch2
29
- } from "./packager-tool-dr3zc9n9.js";
25
+ getAuthContext2
26
+ } from "./packager-tool-tgawhrva.js";
30
27
  import {
31
28
  getPersonalFolderKey2,
32
29
  beginDebugSession2,
@@ -34,12 +31,22 @@ import {
34
31
  SIMULATION_MODE_MAP2,
35
32
  createDebugInstance2,
36
33
  fetchDebugInstanceVariables2
37
- } from "./packager-tool-6pyaaxzk.js";
34
+ } from "./packager-tool-rcjtmknf.js";
35
+ import {
36
+ debugPimsGet2,
37
+ debugPimsPost2,
38
+ debugPimsPut2,
39
+ debugPimsPatch2
40
+ } from "./packager-tool-zgzpqfcs.js";
38
41
  import {
39
- resolveJsonInput
40
- } from "./packager-tool-w9bkq7zb.js";
42
+ resolveJsonInput2
43
+ } from "./packager-tool-xgvp8a8g.js";
44
+ import {
45
+ isGuid
46
+ } from "./packager-tool-1yew22sn.js";
41
47
 
42
48
  // ../maestro-sdk/src/client.ts
49
+ var PIMS_PROBLEM_TYPE = /^PIMS-\d+$/;
43
50
  function parseBackendErrorBody(body) {
44
51
  if (!body)
45
52
  return {};
@@ -51,6 +58,8 @@ function parseBackendErrorBody(body) {
51
58
  result.message = parsed.message;
52
59
  if (typeof parsed.errorCode === "number" || typeof parsed.errorCode === "string") {
53
60
  result.errorCode = String(parsed.errorCode);
61
+ } else if (typeof parsed.type === "string" && PIMS_PROBLEM_TYPE.test(parsed.type)) {
62
+ result.errorCode = parsed.type;
54
63
  }
55
64
  if (typeof parsed.traceId === "string")
56
65
  result.traceId = parsed.traceId;
@@ -130,7 +139,7 @@ async function pimsGet(config, path, options) {
130
139
  const [parseErr, parsed] = catchError2(() => JSON.parse(text));
131
140
  if (parseErr)
132
141
  throw new Error(`Failed to parse API response body: ${parseErr.message}`);
133
- return parsed;
142
+ return normalizeTimestamps(parsed);
134
143
  }
135
144
  async function pimsRequest(config, method, path, body, options) {
136
145
  const url = buildPimsUrl(config, path);
@@ -158,7 +167,7 @@ async function pimsRequest(config, method, path, body, options) {
158
167
  if (parseErr) {
159
168
  throw new Error(`Failed to parse API response body: ${parseErr.message}`);
160
169
  }
161
- return parsed;
170
+ return normalizeTimestamps(parsed);
162
171
  }
163
172
  async function pimsPost(config, path, body, options) {
164
173
  return pimsRequest(config, "POST", path, body, options);
@@ -252,6 +261,33 @@ async function withDebugPimsCall(fn, errorMessage) {
252
261
  return result;
253
262
  }
254
263
 
264
+ // ../maestro-sdk/src/variables-patch.ts
265
+ var PATCH_SHAPE_EXAMPLE = '{"globals":[{"op":"replace","path":"/flag","value":true}],"elements":[]}';
266
+ var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
267
+ var readKey = (value, name) => {
268
+ const key = Object.keys(value).reverse().find((k) => k.toLowerCase() === name);
269
+ return key === undefined ? undefined : value[key];
270
+ };
271
+ function isVariablesPatch(data) {
272
+ if (!isPlainObject(data))
273
+ return false;
274
+ const globals = readKey(data, "globals");
275
+ const elements = readKey(data, "elements");
276
+ if (globals == null && elements == null)
277
+ return false;
278
+ if (globals != null && !Array.isArray(globals))
279
+ return false;
280
+ return elements == null || Array.isArray(elements);
281
+ }
282
+ function failBadVariablesPatch() {
283
+ OutputFormatter.error({
284
+ Result: RESULTS.ValidationError,
285
+ Message: "Invalid variables payload",
286
+ Instructions: `--inputs must be an object whose "globals" is a JSON Patch array and/or whose "elements" is an array of {"elementId":"<id>","inputs":[JSON Patch ops]}. The server ignores or rejects any other shape. Example: ${PATCH_SHAPE_EXAMPLE}`
287
+ });
288
+ processContext.exit(EXIT_CODES.ValidationError);
289
+ }
290
+
255
291
  // ../maestro-sdk/src/shared-commands/examples.ts
256
292
  var INSTANCE = "f4a1c2b3-0000-4000-8000-000000000001";
257
293
  var FOLDER = "b2c3d4e5-0000-4000-8000-000000000002";
@@ -356,8 +392,8 @@ var EXAMPLES = {
356
392
  }
357
393
  }),
358
394
  "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`,
395
+ Description: "Replace a global variable on a running instance with a JSON Patch",
396
+ Command: `${prefix} instances variables-set ${INSTANCE} --folder-key ${FOLDER} --inputs '{"globals":[{"op":"replace","path":"/flag","value":true}],"elements":[]}'`,
361
397
  Output: {
362
398
  Code: "InstanceVariablesSet",
363
399
  Data: {}
@@ -511,49 +547,58 @@ var EXAMPLES = {
511
547
  Data: {}
512
548
  }
513
549
  }),
514
- "process variable-tags get": (prefix) => ({
515
- Description: "Read which variables are tagged for instance search",
516
- Command: `${prefix} process variable-tags get ${PROCESS} --folder-key ${FOLDER}`,
550
+ "process variable-tags list": (prefix) => ({
551
+ Description: "List the variables you can tag for instance search, and which are tagged",
552
+ Command: `${prefix} process variable-tags list ${PROCESS} --folder-key ${FOLDER}`,
517
553
  Output: {
518
- Code: "ProcessVariableTagsGet",
519
- Data: {
520
- Elements: {},
521
- SourcePackageVersion: "1.0.3",
522
- LastUpdateTimeUtc: "2026-10-12T15:00:00Z"
523
- }
554
+ Code: "ProcessVariableTagsList",
555
+ Data: [
556
+ {
557
+ Element: "Review claim",
558
+ Variable: "claimAmount",
559
+ Id: `${ELEMENT}.claimAmount`,
560
+ Tagged: true,
561
+ Label: "Claim amount",
562
+ Stale: false,
563
+ Note: ""
564
+ }
565
+ ]
524
566
  }
525
567
  }),
526
- "process variable-tags set": (prefix) => ({
527
- Description: "Make a variable searchable when filtering instances",
528
- Command: `${prefix} process variable-tags set ${PROCESS} --folder-key ${FOLDER} --variable claimAmount --searchable true`,
568
+ "process variable-tags create": (prefix) => ({
569
+ Description: "Tag a variable so instances can be filtered by it",
570
+ Command: `${prefix} process variable-tags create ${PROCESS} --folder-key ${FOLDER} --variables claimAmount="Claim amount"`,
529
571
  Output: {
530
- Code: "ProcessVariableTagsSet",
531
- Data: {
532
- Updated: [
533
- {
534
- ElementId: ELEMENT,
535
- Name: "claimAmount",
536
- Tags: ["Searchable"]
537
- }
538
- ],
539
- VariableTags: {
540
- Elements: {
541
- [ELEMENT]: {
542
- Outputs: [
543
- {
544
- Name: "claimAmount",
545
- Tags: ["Searchable"],
546
- ExtractPath: "claimAmount",
547
- Label: "Claim amount",
548
- ExtractedValueType: "number"
549
- }
550
- ]
551
- }
552
- },
553
- SourcePackageVersion: "1.0.3",
554
- LastUpdateTimeUtc: "2026-10-12T15:00:00Z"
572
+ Code: "ProcessVariableTagsCreated",
573
+ Data: [
574
+ {
575
+ Element: "Review claim",
576
+ Variable: "claimAmount",
577
+ Id: `${ELEMENT}.claimAmount`,
578
+ Tagged: true,
579
+ Label: "Claim amount",
580
+ Stale: false,
581
+ Note: ""
555
582
  }
556
- }
583
+ ]
584
+ }
585
+ }),
586
+ "process variable-tags delete": (prefix) => ({
587
+ Description: "Stop tagging a variable",
588
+ Command: `${prefix} process variable-tags delete ${PROCESS} --folder-key ${FOLDER} --variables claimAmount`,
589
+ Output: {
590
+ Code: "ProcessVariableTagsDeleted",
591
+ Data: [
592
+ {
593
+ Element: "Review claim",
594
+ Variable: "claimAmount",
595
+ Id: `${ELEMENT}.claimAmount`,
596
+ Tagged: false,
597
+ Label: "",
598
+ Stale: false,
599
+ Note: ""
600
+ }
601
+ ]
557
602
  }
558
603
  }),
559
604
  "processes list": (prefix) => ({
@@ -705,8 +750,8 @@ var EXAMPLES = {
705
750
  }
706
751
  }),
707
752
  "debug-instances variables-set": (prefix) => ({
708
- Description: "Patch a paused debug run's variables from a file",
709
- Command: `${prefix} debug-instances variables-set ${INSTANCE} --inputs @patch.json`,
753
+ Description: "Replace a global variable on a paused debug run with a JSON Patch",
754
+ Command: `${prefix} debug-instances variables-set ${INSTANCE} --inputs '{"globals":[{"op":"replace","path":"/flag","value":true}],"elements":[]}'`,
710
755
  Output: {
711
756
  Code: "DebugInstanceVariablesSet",
712
757
  Data: {}
@@ -841,7 +886,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
841
886
  });
842
887
  });
843
888
  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) => {
844
- const [readError, data] = await catchError2(resolveJsonInput({
889
+ const [readError, data] = await catchError2(resolveJsonInput2({
845
890
  inline: options.inputs,
846
891
  allowStdin: true
847
892
  }));
@@ -877,7 +922,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
877
922
  });
878
923
  });
879
924
  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) => {
880
- const [readError, data] = await catchError2(resolveJsonInput({
925
+ const [readError, data] = await catchError2(resolveJsonInput2({
881
926
  inline: options.inputs,
882
927
  allowStdin: true
883
928
  }));
@@ -938,7 +983,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
938
983
  });
939
984
  });
940
985
  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) => {
941
- const [readError, data] = await catchError2(resolveJsonInput({
986
+ const [readError, data] = await catchError2(resolveJsonInput2({
942
987
  inline: options.inputs,
943
988
  allowStdin: true
944
989
  }));
@@ -960,6 +1005,10 @@ var registerSharedDebugInstanceCommands = (program, config) => {
960
1005
  processContext.exit(1);
961
1006
  return;
962
1007
  }
1008
+ if (!isVariablesPatch(data)) {
1009
+ failBadVariablesPatch();
1010
+ return;
1011
+ }
963
1012
  const body = data;
964
1013
  const query = buildQueryString({
965
1014
  parentElementId: options.parentElementId
@@ -987,6 +1036,7 @@ var registerSharedDebugInstanceCommands = (program, config) => {
987
1036
  };
988
1037
 
989
1038
  // ../maestro-sdk/src/with-pims-call.ts
1039
+ var PIMS_VARIABLES_TOO_LARGE = "PIMS-100079";
990
1040
  var NETWORK_ERROR_CODES = new Set([
991
1041
  "ECONNREFUSED",
992
1042
  "ECONNRESET",
@@ -1050,10 +1100,16 @@ function pimsFailureInstructions(error) {
1050
1100
  } else if (error.parsedRequestId) {
1051
1101
  lines.push(`Request ID: ${error.parsedRequestId}`);
1052
1102
  }
1053
- lines.push("Remediation: verify the folder scope and identifiers, then retry. If the error persists, contact UiPath support with the status, resource, and trace/request ID.");
1103
+ lines.push(pimsRemediation(error));
1054
1104
  return lines.join(`
1055
1105
  `);
1056
1106
  }
1107
+ function pimsRemediation(error) {
1108
+ if (error.parsedErrorCode === PIMS_VARIABLES_TOO_LARGE) {
1109
+ return "Remediation: the instance's variables are over the size PIMS can return, so retrying will not help and the folder and identifiers are not the cause. Reduce the size of the largest variables the process stores. To read this instance's variables, contact UiPath support with the trace/request ID.";
1110
+ }
1111
+ return "Remediation: verify the folder scope and identifiers, then retry. If the error persists, contact UiPath support with the status, resource, and trace/request ID.";
1112
+ }
1057
1113
  function compactPimsErrorBody(body) {
1058
1114
  const text = body.split(/\s+/).filter(Boolean).join(" ");
1059
1115
  return text.length <= 700 ? text : `${text.slice(0, 699)}...`;
@@ -1145,17 +1201,31 @@ async function withPimsCall(fn, errorMessage, hint) {
1145
1201
  return result;
1146
1202
  }
1147
1203
 
1204
+ // ../maestro-sdk/src/folder-scope.ts
1205
+ var inFolder = (row, folderKey) => row.folderKey?.toLowerCase() === folderKey.toLowerCase();
1206
+ var filterByFolder = (rows, folderKey) => folderKey === undefined ? rows : rows.filter((row) => inFolder(row, folderKey));
1207
+
1208
+ // ../maestro-sdk/src/row-window.ts
1209
+ var windowRows = (rows, offset, limit) => rows.slice(offset, limit === undefined ? undefined : offset + limit);
1210
+
1148
1211
  // ../maestro-sdk/src/shared-commands/incidents.ts
1212
+ var UNSUPPORTED_FILTER_MESSAGE = "--status and --severity are not supported: the server ignores them and the incident summary rows carry neither field.";
1149
1213
  var registerSharedIncidentCommands = (program, config) => {
1150
- const { toolLabel } = config;
1214
+ const { toolLabel, processType } = config;
1151
1215
  const incident = program.command("incidents").alias("incident").description(`Manage ${toolLabel} incidents`);
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) => {
1216
+ incident.command("summary").description(`Get ${toolLabel} incident summaries across processes. The CLI ` + "applies --folder-key, --offset and --limit to the full list.").option("--folder-key <key>", "Keep only incidents of this folder (applied by the CLI)").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").addOption(new Option("--status <status>").hideHelp()).addOption(new Option("--severity <severity>").hideHelp()).trackedAction(processContext, async (options) => {
1217
+ if (options.status !== undefined || options.severity !== undefined) {
1218
+ OutputFormatter.error({
1219
+ Result: RESULTS.ValidationError,
1220
+ Message: UNSUPPORTED_FILTER_MESSAGE,
1221
+ Instructions: "Drop the option. Use --process-key and --folder-key to narrow the list."
1222
+ });
1223
+ processContext.exit(EXIT_CODES.ValidationError);
1224
+ return;
1225
+ }
1153
1226
  const query = buildQueryString({
1154
- processKey: options.processKey,
1155
- incidentStatus: options.status,
1156
- incidentSeverity: options.severity,
1157
- $top: options.limit,
1158
- $skip: options.offset !== 0 ? options.offset : undefined
1227
+ processType,
1228
+ processKey: options.processKey
1159
1229
  });
1160
1230
  const reqOptions = { folderKey: options.folderKey };
1161
1231
  const result = await withPimsCall((config) => pimsGet(config, `/incidents/summary${query}`, reqOptions), "Error listing incidents");
@@ -1164,7 +1234,7 @@ var registerSharedIncidentCommands = (program, config) => {
1164
1234
  OutputFormatter.success({
1165
1235
  Result: RESULTS.Success,
1166
1236
  Code: "IncidentSummary",
1167
- Data: result
1237
+ Data: windowRows(filterByFolder(result, options.folderKey), options.offset, options.limit)
1168
1238
  });
1169
1239
  });
1170
1240
  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) => {
@@ -1222,7 +1292,135 @@ function resolveInstanceStatuses(raw) {
1222
1292
  return { statuses, invalid };
1223
1293
  }
1224
1294
 
1295
+ // ../maestro-sdk/src/shared-commands/debug-folder.ts
1296
+ var FOLDER_ID_INSTRUCTIONS = "Provide --folder-id as a positive integer (the Orchestrator folder Id, e.g. 12345).";
1297
+ var FOLDER_TARGETING_INSTRUCTIONS = "Pass at most one of --folder-id, --folder-key, or --folder-path. Use 'uip or folders list' to discover values.";
1298
+ var FOLDER_RESOLUTION_INSTRUCTIONS = "Provide a valid --folder-key (UUID) or --folder-path. Use 'uip or folders list' to confirm the key or path.";
1299
+ var FOLDER_RESOLUTION_NETWORK_INSTRUCTIONS = "The folder lookup itself failed (network / Orchestrator API). Re-authenticate with 'uip login', verify connectivity, and retry.";
1300
+ var VALIDATION_EXIT_CODE = 3;
1301
+ var FAILURE_EXIT_CODE = 1;
1302
+ var responseStatus = (err) => err.response?.status;
1303
+ var NOT_FOUND_STATUS = 404;
1304
+ var isFolderInputError = (err) => {
1305
+ if (responseStatus(err) === NOT_FOUND_STATUS)
1306
+ return true;
1307
+ if ("response" in err)
1308
+ return false;
1309
+ if (err.name === "FetchError")
1310
+ return false;
1311
+ return true;
1312
+ };
1313
+ var parsePositiveInteger = (value) => {
1314
+ const parsed = Number(value);
1315
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : undefined;
1316
+ };
1317
+ var folderMessage = (options, err) => {
1318
+ if (err === undefined) {
1319
+ return "Folder targeting requested but no folder resolved.";
1320
+ }
1321
+ if (responseStatus(err) === NOT_FOUND_STATUS) {
1322
+ return `Could not resolve folder: no folder with key '${options.folderKey}'.`;
1323
+ }
1324
+ return `Could not resolve folder: ${err.message}`;
1325
+ };
1326
+ var resolveDebugFolder = async (options) => {
1327
+ const flags = [
1328
+ options.folderId !== undefined ? "--folder-id" : undefined,
1329
+ options.folderKey !== undefined ? "--folder-key" : undefined,
1330
+ options.folderPath !== undefined ? "--folder-path" : undefined
1331
+ ].filter((flag) => flag !== undefined);
1332
+ if (flags.length > 1) {
1333
+ OutputFormatter.error({
1334
+ Result: RESULTS.ValidationError,
1335
+ Message: `Cannot combine ${flags.join(", ")}.`,
1336
+ Instructions: FOLDER_TARGETING_INSTRUCTIONS
1337
+ });
1338
+ processContext.exit(VALIDATION_EXIT_CODE);
1339
+ return { kind: "failed" };
1340
+ }
1341
+ if (options.folderId !== undefined) {
1342
+ const folderId = parsePositiveInteger(options.folderId);
1343
+ if (folderId === undefined) {
1344
+ OutputFormatter.error({
1345
+ Result: RESULTS.ValidationError,
1346
+ Message: "--folder-id must be a positive integer.",
1347
+ Instructions: FOLDER_ID_INSTRUCTIONS
1348
+ });
1349
+ processContext.exit(VALIDATION_EXIT_CODE);
1350
+ return { kind: "failed" };
1351
+ }
1352
+ return { kind: "resolved", folderId };
1353
+ }
1354
+ if (options.folderKey === undefined && options.folderPath === undefined) {
1355
+ return { kind: "resolved", folderId: undefined };
1356
+ }
1357
+ const { resolveFolder } = await import("./index-db1djbzm.js");
1358
+ const [folderError, folder] = await catchError2(resolveFolder({ folderKey: options.folderKey, folderPath: options.folderPath }, { loginValidity: options.loginValidity }));
1359
+ if (folderError) {
1360
+ const classified = await classifiedFailure(folderMessage(options, folderError), folderError);
1361
+ if (classified.Result === RESULTS.AuthenticationError) {
1362
+ OutputFormatter.error({
1363
+ ...classified,
1364
+ Instructions: instructionsFor("backend", folderError)
1365
+ });
1366
+ processContext.exit(EXIT_CODES[RESULTS.AuthenticationError]);
1367
+ return { kind: "failed" };
1368
+ }
1369
+ }
1370
+ if (folderError || !folder) {
1371
+ const inputProblem = !folderError || isFolderInputError(folderError);
1372
+ OutputFormatter.error({
1373
+ Result: inputProblem ? RESULTS.ValidationError : RESULTS.Failure,
1374
+ Message: folderMessage(options, folderError),
1375
+ Instructions: inputProblem ? FOLDER_RESOLUTION_INSTRUCTIONS : FOLDER_RESOLUTION_NETWORK_INSTRUCTIONS
1376
+ });
1377
+ processContext.exit(inputProblem ? VALIDATION_EXIT_CODE : FAILURE_EXIT_CODE);
1378
+ return { kind: "failed" };
1379
+ }
1380
+ logger.info(`Resolved folder '${folder.path}' to ID ${folder.id} (key ${folder.key}).`);
1381
+ return { kind: "resolved", folderId: folder.id, folderKey: folder.key };
1382
+ };
1383
+
1384
+ // ../maestro-sdk/src/shared-commands/folder-key.ts
1385
+ var FOLDER_PATH_FLAG = "--folder-path <path>";
1386
+ var FOLDER_PATH_HELP = "Folder path (e.g. 'Shared/Sub'), resolved to its key. Alternative to --folder-key";
1387
+ var failFolder = (message, instructions) => {
1388
+ OutputFormatter.error({
1389
+ Result: RESULTS.ValidationError,
1390
+ Message: message,
1391
+ Instructions: instructions
1392
+ });
1393
+ processContext.exit(EXIT_CODES.ValidationError);
1394
+ return false;
1395
+ };
1396
+ var resolveFolderKey = async (options, requirement = 0 /* Required */) => {
1397
+ const { folderKey, folderPath } = options;
1398
+ if (folderKey !== undefined && folderPath !== undefined) {
1399
+ return failFolder("Cannot combine --folder-key and --folder-path.", "Pass one of them.");
1400
+ }
1401
+ if (folderPath === undefined) {
1402
+ if (folderKey !== undefined)
1403
+ return true;
1404
+ if (requirement === 1 /* Optional */)
1405
+ return true;
1406
+ return failFolder("Missing folder: pass -f, --folder-key <key> or --folder-path <path>.", "Use 'uip or folders list' to find a folder's key or path.");
1407
+ }
1408
+ const outcome = await resolveDebugFolder({ folderPath });
1409
+ if (outcome.kind === "failed")
1410
+ return false;
1411
+ options.folderKey = outcome.folderKey;
1412
+ return true;
1413
+ };
1414
+
1225
1415
  // ../maestro-sdk/src/shared-commands/instances.ts
1416
+ var VARIABLE_VALUE_FIELDS = [
1417
+ "Globals",
1418
+ "GlobalDefinitions",
1419
+ "Inputs",
1420
+ "InputDefinitions",
1421
+ "Outputs",
1422
+ "Value"
1423
+ ];
1226
1424
  var collectStatus = (raw, prev) => [...prev, raw];
1227
1425
  var MAX_INSTANCE_PAGE_SIZE = 500;
1228
1426
  var parseInstanceLimit = (raw) => parseBoundedInt(raw, "--limit", { min: 1, max: MAX_INSTANCE_PAGE_SIZE });
@@ -1242,6 +1440,58 @@ function extractInstanceCursor(result) {
1242
1440
  hasMore: result.hasMoreResults ?? nextPage !== undefined
1243
1441
  };
1244
1442
  }
1443
+ var MAX_FOLDER_SCAN_PAGES = 20;
1444
+ async function listInstancePage(options, statuses, processType) {
1445
+ const { folderKey } = options;
1446
+ const fetchPage = (pageSize, nextPage) => {
1447
+ const query = buildQueryString({
1448
+ processKey: options.processKey,
1449
+ packageId: options.packageId,
1450
+ errorCode: options.errorCode,
1451
+ statuses: statuses?.join(","),
1452
+ startedTimeUtcStart: options.fromDate,
1453
+ startedTimeUtcEnd: options.toDate,
1454
+ processType,
1455
+ pageSize,
1456
+ nextPage
1457
+ });
1458
+ return withPimsCall((config) => pimsGet(config, `/instances${query}`, { folderKey }), "Error listing instances");
1459
+ };
1460
+ const instanceList = [];
1461
+ let nextPage = options.nextPage;
1462
+ let cursor = {};
1463
+ for (let scanned = 0;scanned < MAX_FOLDER_SCAN_PAGES; scanned++) {
1464
+ let result = await fetchPage(options.limit, nextPage);
1465
+ if (!result)
1466
+ return;
1467
+ let rows = extractProcessInstances(result);
1468
+ if (folderKey === undefined) {
1469
+ instanceList.push(...rows);
1470
+ return { instanceList, cursor: extractInstanceCursor(result) };
1471
+ }
1472
+ let matches = rows.filter((row) => inFolder(row, folderKey));
1473
+ const missing = options.limit - instanceList.length;
1474
+ if (matches.length > missing) {
1475
+ const keptEnd = rows.indexOf(matches[missing - 1]) + 1;
1476
+ if (keptEnd < rows.length) {
1477
+ result = await fetchPage(keptEnd, nextPage);
1478
+ if (!result)
1479
+ return;
1480
+ rows = extractProcessInstances(result);
1481
+ matches = rows.filter((row) => inFolder(row, folderKey));
1482
+ }
1483
+ matches = matches.slice(0, missing);
1484
+ }
1485
+ instanceList.push(...matches);
1486
+ cursor = extractInstanceCursor(result);
1487
+ nextPage = cursor.nextPage;
1488
+ if (!cursor.hasMore || !nextPage)
1489
+ break;
1490
+ if (instanceList.length >= options.limit)
1491
+ break;
1492
+ }
1493
+ return { instanceList, cursor };
1494
+ }
1245
1495
  var failListFilter = (message, instructions) => {
1246
1496
  OutputFormatter.error({
1247
1497
  Result: RESULTS.ValidationError,
@@ -1270,33 +1520,21 @@ var registerSharedInstanceCommands = (program, config) => {
1270
1520
  assetType,
1271
1521
  processType,
1272
1522
  includeElementExecutions = true,
1273
- folderKeyRequired = true,
1274
- listFolderKeyRequired = folderKeyRequired
1523
+ variablesHelpNote
1275
1524
  } = config;
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)");
1525
+ const withFolderKey = (cmd) => cmd.option("-f, --folder-key <key>", "Folder key (GUID) of the instance, from FolderKey in 'instances list'. Required unless --folder-path is given").option(FOLDER_PATH_FLAG, FOLDER_PATH_HELP);
1277
1526
  const instances = program.command("instances").alias("instance").description(`Manage ${toolLabel} process instances`);
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.");
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) => {
1527
+ 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. " + "--folder-key and --folder-path are applied by the CLI, so a page can hold fewer " + "rows than --limit: keep paging while Pagination.HasMore is true.");
1528
+ listCmd.option("-f, --folder-key <key>", "Only list instances in this folder (GUID). Optional here; every other instance command requires a folder").option(FOLDER_PATH_FLAG, FOLDER_PATH_HELP).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) => {
1529
+ if (!await resolveFolderKey(options, 1 /* Optional */))
1530
+ return;
1280
1531
  const filters = resolveListFilters(options);
1281
1532
  if (!filters)
1282
1533
  return;
1283
- const query = buildQueryString({
1284
- processKey: options.processKey,
1285
- packageId: options.packageId,
1286
- errorCode: options.errorCode,
1287
- statuses: filters.statuses?.join(","),
1288
- startedTimeUtcStart: options.fromDate,
1289
- startedTimeUtcEnd: options.toDate,
1290
- processType,
1291
- pageSize: options.limit,
1292
- nextPage: options.nextPage
1293
- });
1294
- const reqOptions = { folderKey: options.folderKey };
1295
- const result = await withPimsCall((config) => pimsGet(config, `/instances${query}`, reqOptions), "Error listing instances");
1296
- if (!result)
1534
+ const page = await listInstancePage(options, filters.statuses, processType);
1535
+ if (!page)
1297
1536
  return;
1298
- const instanceList = extractProcessInstances(result);
1299
- const cursor = extractInstanceCursor(result);
1537
+ const { instanceList, cursor } = page;
1300
1538
  OutputFormatter.success({
1301
1539
  Result: RESULTS.Success,
1302
1540
  Code: "InstanceList",
@@ -1311,6 +1549,8 @@ var registerSharedInstanceCommands = (program, config) => {
1311
1549
  });
1312
1550
  const getCmd = instances.command("get").description(`Get a ${toolLabel} process instance by ID`).argument("<instance-id>", "Process instance ID");
1313
1551
  withFolderKey(getCmd).trackedAction(processContext, async (instanceId, options) => {
1552
+ if (!await resolveFolderKey(options))
1553
+ return;
1314
1554
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}`, { folderKey: options.folderKey }), "Error getting instance", { resource: "instance", id: instanceId });
1315
1555
  if (!result)
1316
1556
  return;
@@ -1322,6 +1562,8 @@ var registerSharedInstanceCommands = (program, config) => {
1322
1562
  });
1323
1563
  const pauseCmd = instances.command("pause").description(`Pause a running ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1324
1564
  withFolderKey(pauseCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1565
+ if (!await resolveFolderKey(options))
1566
+ return;
1325
1567
  const body = { comment: options.comment || "" };
1326
1568
  const reqOptions = { folderKey: options.folderKey };
1327
1569
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/pause`, body, reqOptions), "Error pausing instance");
@@ -1335,6 +1577,8 @@ var registerSharedInstanceCommands = (program, config) => {
1335
1577
  });
1336
1578
  const resumeCmd = instances.command("resume").description(`Resume a paused ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1337
1579
  withFolderKey(resumeCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1580
+ if (!await resolveFolderKey(options))
1581
+ return;
1338
1582
  const body = { comment: options.comment || "" };
1339
1583
  const reqOptions = { folderKey: options.folderKey };
1340
1584
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/resume`, body, reqOptions), "Error resuming instance");
@@ -1348,6 +1592,8 @@ var registerSharedInstanceCommands = (program, config) => {
1348
1592
  });
1349
1593
  const cancelCmd = instances.command("cancel").description(`Cancel a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1350
1594
  withFolderKey(cancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1595
+ if (!await resolveFolderKey(options))
1596
+ return;
1351
1597
  const body = { comment: options.comment || "" };
1352
1598
  const reqOptions = { folderKey: options.folderKey };
1353
1599
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/cancel`, body, reqOptions), "Error canceling instance");
@@ -1359,8 +1605,10 @@ var registerSharedInstanceCommands = (program, config) => {
1359
1605
  Data: result
1360
1606
  });
1361
1607
  });
1362
- const variablesCmd = instances.command("variables").description(`Get variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1608
+ const variablesCmd = instances.command("variables").description(`Get variables for a ${toolLabel} process instance${variablesHelpNote ? `. ${variablesHelpNote}` : ""}`).argument("<instance-id>", "Process instance ID");
1363
1609
  withFolderKey(variablesCmd).option("--parent-element-id <id>", "Filter variables by parent element ID").trackedAction(processContext, async (instanceId, options) => {
1610
+ if (!await resolveFolderKey(options))
1611
+ return;
1364
1612
  const query = buildQueryString({
1365
1613
  parentElementId: options.parentElementId
1366
1614
  });
@@ -1372,10 +1620,12 @@ var registerSharedInstanceCommands = (program, config) => {
1372
1620
  Result: RESULTS.Success,
1373
1621
  Code: "InstanceVariables",
1374
1622
  Data: result
1375
- });
1623
+ }, { preserveDataKeys: VARIABLE_VALUE_FIELDS });
1376
1624
  });
1377
1625
  const incidentsCmd = instances.command("incidents").description(`Get incidents for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1378
1626
  withFolderKey(incidentsCmd).trackedAction(processContext, async (instanceId, options) => {
1627
+ if (!await resolveFolderKey(options))
1628
+ return;
1379
1629
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/incidents`, { folderKey: options.folderKey }), "Error getting incidents");
1380
1630
  if (!result)
1381
1631
  return;
@@ -1387,6 +1637,8 @@ var registerSharedInstanceCommands = (program, config) => {
1387
1637
  });
1388
1638
  const assetCmd = instances.command("asset").description(`Get the ${toolLabel} definition for a process instance`).argument("<instance-id>", "Process instance ID");
1389
1639
  withFolderKey(assetCmd).trackedAction(processContext, async (instanceId, options) => {
1640
+ if (!await resolveFolderKey(options))
1641
+ return;
1390
1642
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/asset?type=${assetType}`, { folderKey: options.folderKey }), "Error getting asset");
1391
1643
  if (!result)
1392
1644
  return;
@@ -1398,6 +1650,8 @@ var registerSharedInstanceCommands = (program, config) => {
1398
1650
  });
1399
1651
  const retryCmd = instances.command("retry").description(`Retry a faulted ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1400
1652
  withFolderKey(retryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, options) => {
1653
+ if (!await resolveFolderKey(options))
1654
+ return;
1401
1655
  const body = { comment: options.comment || "" };
1402
1656
  const reqOptions = { folderKey: options.folderKey };
1403
1657
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/retry`, body, reqOptions), "Error retrying instance");
@@ -1411,6 +1665,8 @@ var registerSharedInstanceCommands = (program, config) => {
1411
1665
  });
1412
1666
  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
1667
  withFolderKey(migrateCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, newVersion, options) => {
1668
+ if (!await resolveFolderKey(options))
1669
+ return;
1414
1670
  const body = {
1415
1671
  newVersion,
1416
1672
  comment: options.comment || ""
@@ -1427,6 +1683,8 @@ var registerSharedInstanceCommands = (program, config) => {
1427
1683
  });
1428
1684
  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
1685
  withFolderKey(gotoCmd).trackedAction(processContext, async (instanceId, transitionsJson, options) => {
1686
+ if (!await resolveFolderKey(options))
1687
+ return;
1430
1688
  const [parseError, transitions] = catchError2(() => JSON.parse(transitionsJson));
1431
1689
  const isValidShape = !parseError && Array.isArray(transitions) && transitions.every((t) => t?.sourceElementId != null && t?.targetElementId != null);
1432
1690
  if (!isValidShape) {
@@ -1451,6 +1709,8 @@ var registerSharedInstanceCommands = (program, config) => {
1451
1709
  });
1452
1710
  const cursorsCmd = instances.command("cursors").description(`Get current execution cursor positions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1453
1711
  withFolderKey(cursorsCmd).trackedAction(processContext, async (instanceId, options) => {
1712
+ if (!await resolveFolderKey(options))
1713
+ return;
1454
1714
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/goto/cursors`, { folderKey: options.folderKey }), "Error getting cursors");
1455
1715
  if (!result)
1456
1716
  return;
@@ -1461,8 +1721,10 @@ var registerSharedInstanceCommands = (program, config) => {
1461
1721
  });
1462
1722
  });
1463
1723
  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({
1724
+ messageCmd.command("send").description(`Send a message to ${toolLabel} workflow subscriptions`).option("-f, --folder-key <key>", "Folder key (GUID). Required unless --folder-path is given").option(FOLDER_PATH_FLAG, FOLDER_PATH_HELP).option("--inputs <value>", "Message payload as JSON string, @file path, or piped via stdin").trackedAction(processContext, async (options) => {
1725
+ if (!await resolveFolderKey(options))
1726
+ return;
1727
+ const [readError, body] = await catchError2(resolveJsonInput2({
1466
1728
  inline: options.inputs,
1467
1729
  allowStdin: true
1468
1730
  }));
@@ -1497,6 +1759,8 @@ var registerSharedInstanceCommands = (program, config) => {
1497
1759
  if (includeElementExecutions) {
1498
1760
  const elementExeCmd = instances.command("element-executions").description(`Get element executions for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1499
1761
  withFolderKey(elementExeCmd).trackedAction(processContext, async (instanceId, options) => {
1762
+ if (!await resolveFolderKey(options))
1763
+ return;
1500
1764
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/element-executions`, { folderKey: options.folderKey }), "Error getting element executions");
1501
1765
  if (!result)
1502
1766
  return;
@@ -1509,7 +1773,9 @@ var registerSharedInstanceCommands = (program, config) => {
1509
1773
  }
1510
1774
  const variablesSetCmd = instances.command("variables-set").description(`Update variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1511
1775
  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({
1776
+ if (!await resolveFolderKey(options))
1777
+ return;
1778
+ const [readError, data] = await catchError2(resolveJsonInput2({
1513
1779
  inline: options.inputs,
1514
1780
  allowStdin: true
1515
1781
  }));
@@ -1531,6 +1797,10 @@ var registerSharedInstanceCommands = (program, config) => {
1531
1797
  processContext.exit(1);
1532
1798
  return;
1533
1799
  }
1800
+ if (!isVariablesPatch(data)) {
1801
+ failBadVariablesPatch();
1802
+ return;
1803
+ }
1534
1804
  const body = data;
1535
1805
  const reqOptions = { folderKey: options.folderKey };
1536
1806
  const result = await withPimsCall((config) => pimsPatch(config, `/instances/${instanceId}/variables`, body, reqOptions), "Error updating variables");
@@ -1544,6 +1814,8 @@ var registerSharedInstanceCommands = (program, config) => {
1544
1814
  });
1545
1815
  const variablesAllCmd = instances.command("variables-all").description(`Get all variables (including subprocesses) for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1546
1816
  withFolderKey(variablesAllCmd).trackedAction(processContext, async (instanceId, options) => {
1817
+ if (!await resolveFolderKey(options))
1818
+ return;
1547
1819
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/variables-all`, { folderKey: options.folderKey }), "Error getting all variables");
1548
1820
  if (!result)
1549
1821
  return;
@@ -1551,10 +1823,12 @@ var registerSharedInstanceCommands = (program, config) => {
1551
1823
  Result: RESULTS.Success,
1552
1824
  Code: "InstanceVariablesAll",
1553
1825
  Data: result
1554
- });
1826
+ }, { preserveDataKeys: VARIABLE_VALUE_FIELDS });
1555
1827
  });
1556
1828
  const globalVarsCmd = instances.command("global-variables").description(`Get global variables for a ${toolLabel} process instance`).argument("<instance-id>", "Process instance ID");
1557
1829
  withFolderKey(globalVarsCmd).trackedAction(processContext, async (instanceId, options) => {
1830
+ if (!await resolveFolderKey(options))
1831
+ return;
1558
1832
  const result = await withPimsCall((config) => pimsGet(config, `/instances/${instanceId}/global-variables`, { folderKey: options.folderKey }), "Error getting global variables");
1559
1833
  if (!result)
1560
1834
  return;
@@ -1562,11 +1836,13 @@ var registerSharedInstanceCommands = (program, config) => {
1562
1836
  Result: RESULTS.Success,
1563
1837
  Code: "InstanceGlobalVariables",
1564
1838
  Data: result
1565
- });
1839
+ }, { preserveDataKeys: VARIABLE_VALUE_FIELDS });
1566
1840
  });
1567
1841
  const element = instances.command("elements").alias("element").description(`Manage elements within a ${toolLabel} process instance`);
1568
1842
  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
1843
  withFolderKey(elementCancelCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
1844
+ if (!await resolveFolderKey(options))
1845
+ return;
1570
1846
  const body = { comment: options.comment || "" };
1571
1847
  const reqOptions = { folderKey: options.folderKey };
1572
1848
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/cancel`, body, reqOptions), "Error canceling element");
@@ -1580,6 +1856,8 @@ var registerSharedInstanceCommands = (program, config) => {
1580
1856
  });
1581
1857
  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
1858
  withFolderKey(elementRetryCmd).option("--comment <text>", "Optional comment for the operation").trackedAction(processContext, async (instanceId, elementId, options) => {
1859
+ if (!await resolveFolderKey(options))
1860
+ return;
1583
1861
  const body = { comment: options.comment || "" };
1584
1862
  const reqOptions = { folderKey: options.folderKey };
1585
1863
  const result = await withPimsCall((config) => pimsPost(config, `/instances/${instanceId}/element/${elementId}/retry`, body, reqOptions), "Error retrying element");
@@ -1594,160 +1872,673 @@ var registerSharedInstanceCommands = (program, config) => {
1594
1872
  attachSharedExamples(instances);
1595
1873
  };
1596
1874
 
1597
- // ../maestro-sdk/src/shared-commands/process.ts
1875
+ // ../maestro-sdk/src/shared-commands/variable-tags-release.ts
1876
+ async function lookupRelease(processKey, folderKey) {
1877
+ const {
1878
+ createOrchestratorConfig,
1879
+ quoteODataStringLiteral,
1880
+ ReleaseNotFoundError,
1881
+ ReleasesApi
1882
+ } = await import("./index-db1djbzm.js");
1883
+ const config = await createOrchestratorConfig({ folderKey });
1884
+ const [listError, result] = await catchError2(new ReleasesApi(config).releasesListReleases({
1885
+ $filter: `Key eq ${quoteODataStringLiteral(processKey)}`,
1886
+ $top: 1
1887
+ }));
1888
+ if (listError) {
1889
+ throw new Error(`Failed to look up process '${processKey}': ${await extractErrorMessage(listError)}`, { cause: listError });
1890
+ }
1891
+ const release = result.value?.[0];
1892
+ if (!release) {
1893
+ throw new ReleaseNotFoundError(`Process '${processKey}' not found in folder '${folderKey}'.`, true);
1894
+ }
1895
+ return {
1896
+ processVersion: release.processVersion ?? undefined,
1897
+ processType: release.processType
1898
+ };
1899
+ }
1900
+
1901
+ // ../maestro-sdk/src/shared-commands/variable-tags-payload.ts
1598
1902
  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
- }
1903
+ function splitVariableIdentity(id) {
1904
+ const [elementId, name, ...rest] = id.split(".");
1905
+ if (!elementId || !name) {
1906
+ throw new Error(`Variable identity "${id}" must be "<elementId>.<name>" with an optional ".<extractPath>".`);
1907
+ }
1908
+ return { elementId, name, extractPath: rest.join(".") };
1909
+ }
1910
+ function buildVariableTagsElements(selection) {
1911
+ const elements = Object.create(null);
1912
+ const seen = new Set;
1913
+ for (const variable of selection) {
1914
+ if (seen.has(variable.id))
1915
+ continue;
1916
+ seen.add(variable.id);
1917
+ const { elementId, name, extractPath } = splitVariableIdentity(variable.id);
1918
+ const row = {
1919
+ tags: [SEARCHABLE_TAG],
1920
+ name,
1921
+ label: variable.label,
1922
+ extractedValueType: variable.extractedValueType,
1923
+ extractPath
1924
+ };
1925
+ elements[elementId] ??= { outputs: [] };
1926
+ elements[elementId].outputs.push(row);
1927
+ }
1928
+ return elements;
1929
+ }
1930
+
1931
+ // ../maestro-sdk/src/shared-commands/variable-tags-selection.ts
1932
+ class SelectionError extends Error {
1933
+ instructions;
1934
+ errorCode;
1935
+ retry = "RetryWillNotFix";
1936
+ constructor(message, instructions, errorCode = "invalid_argument") {
1937
+ super(message);
1938
+ this.instructions = instructions;
1939
+ this.errorCode = errorCode;
1940
+ this.name = "SelectionError";
1941
+ }
1942
+ }
1943
+ var describeEntry = (entry) => entry.elementLabel && entry.elementLabel !== entry.id.split(".")[0] ? `${entry.id} (element "${entry.elementLabel}")` : entry.id;
1944
+ function rankMatch(token, id) {
1945
+ if (id === token)
1946
+ return 3;
1947
+ const segments = id.split(".");
1948
+ if (segments.slice(1).join(".") === token)
1949
+ return 2;
1950
+ return id.endsWith(`.${token}`) ? 1 : 0;
1951
+ }
1952
+ function bestMatches(token, catalog) {
1953
+ let best = 0;
1954
+ for (const one of [...catalog.variables, ...catalog.containers]) {
1955
+ best = Math.max(best, rankMatch(token, one.id));
1956
+ }
1957
+ if (best === 0)
1958
+ return { variables: [], objects: [] };
1959
+ const variables = catalog.variables.filter((one) => rankMatch(token, one.id) === best);
1960
+ const variableIds = new Set(variables.map((one) => one.id));
1961
+ const objects = catalog.containers.filter((one) => rankMatch(token, one.id) === best && !variableIds.has(one.id));
1962
+ return { variables, objects };
1963
+ }
1964
+ var list = (ids) => ids.map((entry) => ` ${describeEntry(entry)}`).join(`
1965
+ `);
1966
+ var SUGGESTION_LIMIT = 5;
1967
+ function resolveVariableToken(token, catalog, options) {
1968
+ const { listCommand, mode, prefer } = options;
1969
+ const best = bestMatches(token, catalog);
1970
+ const { objects } = best;
1971
+ const preferred = best.variables.filter((one) => prefer?.has(one.id));
1972
+ const matches = best.variables.length > 1 && objects.length === 0 && preferred.length === 1 ? preferred : best.variables;
1973
+ if (matches.length + objects.length > 1) {
1974
+ const everyMatch = [
1975
+ ...matches,
1976
+ ...objects.map((one) => ({
1977
+ id: `${one.id} (object)`,
1978
+ elementLabel: ""
1979
+ }))
1980
+ ];
1981
+ throw new SelectionError(`"${token}" matches more than one variable:
1982
+ ${list(everyMatch)}`, `Use the full id from the list above, or run '${listCommand}'.`);
1983
+ }
1984
+ if (matches.length === 1) {
1985
+ const [entry] = matches;
1986
+ if (!entry.taggable) {
1987
+ throw mode === "delete" ? new SelectionError(`"${entry.id}" is not tagged.`, `Run '${listCommand}' to see which variables are tagged.`, "not_found") : new SelectionError(`"${entry.id}" cannot be tagged: ${entry.reason ?? "not supported"}.`, `Run '${listCommand}' to see the variables you can tag.`);
1639
1988
  }
1989
+ return entry;
1990
+ }
1991
+ const [container] = objects;
1992
+ if (container) {
1993
+ const fields = container.leafIds.map((id) => catalog.variables.find((entry) => entry.id === id)).filter((entry) => entry !== undefined);
1994
+ throw new SelectionError(fields.length > 0 ? `"${token}" is an object, not a field:
1995
+ ${list(fields)}` : `"${token}" is an object with no fields to tag.`, fields.length > 0 ? "Name one of its fields, with the full id from the list above." : `Run '${listCommand}' to see the variables you can tag.`);
1996
+ }
1997
+ const needle = token.toLowerCase();
1998
+ const similar = catalog.variables.filter((entry) => entry.id.toLowerCase().includes(needle)).slice(0, SUGGESTION_LIMIT);
1999
+ throw new SelectionError(`No variable matches "${token}".${similar.length > 0 ? `
2000
+ Did you mean:
2001
+ ${list(similar)}` : ""}`, `Run '${listCommand}' to see the variables you can tag.`, "not_found");
2002
+ }
2003
+ function computeDefaultLabels(selection) {
2004
+ const byTitle = new Map;
2005
+ for (const entry of selection) {
2006
+ byTitle.set(entry.defaultLabel, [
2007
+ ...byTitle.get(entry.defaultLabel) ?? [],
2008
+ entry
2009
+ ]);
1640
2010
  }
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 };
2011
+ const labels = new Map;
2012
+ for (const [title, group] of byTitle) {
2013
+ if (group.length === 1) {
2014
+ labels.set(group[0].id, title);
2015
+ continue;
2016
+ }
2017
+ const seen = new Map;
2018
+ for (const entry of group) {
2019
+ const base = entry.source ? `${entry.source} ${title}` : title;
2020
+ const count = (seen.get(base) ?? 0) + 1;
2021
+ seen.set(base, count);
2022
+ labels.set(entry.id, count > 1 ? `${base} (${count})` : base);
2023
+ }
2024
+ }
2025
+ return labels;
2026
+ }
2027
+ var savedRowId = (elementId, row) => [elementId, row.name, ...row.extractPath ? [row.extractPath] : []].join(".");
2028
+ function readSavedRows(elements) {
2029
+ return Object.entries(elements ?? {}).flatMap(([elementId, element]) => (element.outputs ?? []).map((row) => ({
2030
+ id: savedRowId(elementId, row),
2031
+ elementId,
2032
+ row
2033
+ })));
2034
+ }
2035
+ var comparable = (row) => ({
2036
+ tags: [...row.tags ?? []].sort((a, b) => a.localeCompare(b)),
2037
+ label: row.label,
2038
+ type: row.extractedValueType
2039
+ });
2040
+ function canonical(elements) {
2041
+ return JSON.stringify(readSavedRows(elements).map(({ id, row }) => [id, comparable(row)]).sort((a, b) => a[0].localeCompare(b[0])));
2042
+ }
2043
+ function describeRewrite(before, after) {
2044
+ const was = comparable(before);
2045
+ const now = comparable(after);
2046
+ const parts = [
2047
+ ...was.type === now.type ? [] : [`type ${was.type} -> ${now.type}`],
2048
+ ...was.tags.join() === now.tags.join() ? [] : [`tags [${was.tags.join(", ")}] -> [${now.tags.join(", ")}]`]
2049
+ ];
2050
+ return parts.length > 0 ? parts.join(", ") : undefined;
2051
+ }
2052
+ function buildElements(selection, stale) {
2053
+ const elements = buildVariableTagsElements(selection.map(({ entry, label }) => ({
2054
+ id: entry.id,
2055
+ label,
2056
+ extractedValueType: entry.extractedValueType
2057
+ })));
2058
+ for (const { elementId, row } of stale) {
2059
+ elements[elementId] ??= { outputs: [] };
2060
+ elements[elementId].outputs.push(structuredClone(row));
2061
+ }
2062
+ return elements;
2063
+ }
2064
+ var finish = (current, elements, next, stale) => {
2065
+ const before = new Map(current.map((one) => [one.id, one.row]));
2066
+ const nextIds = new Set([
2067
+ ...next.map((one) => one.id),
2068
+ ...stale.map((one) => one.id)
2069
+ ]);
2070
+ const currentElements = Object.create(null);
2071
+ for (const { elementId, row } of current) {
2072
+ currentElements[elementId] ??= { outputs: [] };
2073
+ currentElements[elementId].outputs.push(row);
2074
+ }
2075
+ const rewritten = readSavedRows(elements).flatMap(({ id, row }) => {
2076
+ const was = before.get(id);
2077
+ const change = was && describeRewrite(was, row);
2078
+ return change ? [{ id, change }] : [];
1648
2079
  });
2080
+ return {
2081
+ elements,
2082
+ changed: canonical(elements) !== canonical(currentElements),
2083
+ added: next.filter((one) => !before.has(one.id)).map((one) => one.id),
2084
+ removed: current.filter((one) => !nextIds.has(one.id)).map((one) => one.id),
2085
+ relabeled: next.filter((one) => before.has(one.id) && before.get(one.id)?.label !== one.label).map((one) => one.id),
2086
+ rewritten,
2087
+ collapsed: before.size < current.length
2088
+ };
1649
2089
  };
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.";
2090
+ function splitSaved(variables, saved) {
2091
+ const taggable = new Set(variables.filter((one) => one.taggable).map((one) => one.id));
2092
+ const live = new Map;
2093
+ const stale = [];
2094
+ const seen = new Set;
2095
+ for (const one of saved) {
2096
+ if (seen.has(one.id))
2097
+ continue;
2098
+ seen.add(one.id);
2099
+ if (taggable.has(one.id))
2100
+ live.set(one.id, one);
2101
+ else
2102
+ stale.push(one);
1655
2103
  }
1656
- if (variableCount === 0 && !options.all) {
1657
- return "Specify the target with --variable <name> (repeatable, plus optional --element-id) or --all.";
2104
+ return { live, stale };
2105
+ }
2106
+ function checkRequests(requests) {
2107
+ const explicit = new Map;
2108
+ for (const { id, label } of requests) {
2109
+ if (label === undefined)
2110
+ continue;
2111
+ const trimmed = label.trim();
2112
+ if (trimmed === "") {
2113
+ throw new SelectionError(`The label for "${id}" is empty.`, "Give a label after '=', or leave the '=' out to use the default label.");
2114
+ }
2115
+ const earlier = explicit.get(id);
2116
+ if (earlier !== undefined && earlier !== trimmed) {
2117
+ throw new SelectionError(`"${id}" was given two different labels ("${earlier}" and "${trimmed}").`, "Give each variable one label.");
2118
+ }
2119
+ explicit.set(id, trimmed);
1658
2120
  }
1659
- if (variableCount > 1 && options.elementId !== undefined) {
1660
- return "--element-id only works with a single --variable; pass one --variable, or drop --element-id.";
2121
+ return explicit;
2122
+ }
2123
+ function planAdd(input) {
2124
+ const { variables, saved, requests } = input;
2125
+ const { live, stale } = splitSaved(variables, saved);
2126
+ const wanted = new Set(requests === "all" ? variables.filter((one) => one.taggable).map((one) => one.id) : requests.map((one) => one.id));
2127
+ const explicit = checkRequests(requests === "all" ? [] : requests);
2128
+ const selected = variables.filter((one) => one.taggable && (live.has(one.id) || wanted.has(one.id)));
2129
+ const defaults = computeDefaultLabels(selected);
2130
+ const labelled = selected.map((entry) => ({
2131
+ entry,
2132
+ label: explicit.get(entry.id) ?? live.get(entry.id)?.row.label ?? defaults.get(entry.id) ?? entry.name
2133
+ }));
2134
+ const owners = new Map;
2135
+ const everyLabel = [
2136
+ ...labelled.map(({ entry, label }) => ({ id: entry.id, label })),
2137
+ ...stale.map((one) => ({ id: one.id, label: one.row.label }))
2138
+ ];
2139
+ for (const { id, label } of everyLabel) {
2140
+ const trimmed = label.trim();
2141
+ if (trimmed === "") {
2142
+ throw new SelectionError(`The saved label of "${id}" is empty.`, `Give it a label, as '<variable>=<label>'.`);
2143
+ }
2144
+ const owner = owners.get(trimmed);
2145
+ if (owner !== undefined && owner !== id) {
2146
+ throw new SelectionError(`The label "${trimmed}" would be used by both "${owner}" and "${id}"; labels must be unique.`, "Give one of them another label, as '<variable>=<label>'.");
2147
+ }
2148
+ owners.set(trimmed, id);
1661
2149
  }
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.";
2150
+ const elements = buildElements(labelled.map(({ entry, label }) => ({ entry, label: label.trim() })), stale);
2151
+ return finish(saved, elements, labelled.map(({ entry, label }) => ({
2152
+ id: entry.id,
2153
+ label: label.trim()
2154
+ })), stale);
2155
+ }
2156
+ function planRemove(input) {
2157
+ const { variables, saved, ids } = input;
2158
+ const drop = ids === "all" ? undefined : new Set(ids);
2159
+ const { live, stale } = splitSaved(variables, saved);
2160
+ const keptStale = drop ? stale.filter((one) => !drop.has(one.id)) : [];
2161
+ const kept = variables.filter((one) => one.taggable && live.has(one.id) && (drop === undefined ? false : !drop.has(one.id))).map((entry) => ({
2162
+ entry,
2163
+ label: live.get(entry.id)?.row.label ?? entry.name
2164
+ }));
2165
+ return finish(saved, buildElements(kept, keptStale), kept.map(({ entry, label }) => ({ id: entry.id, label })), keptStale);
2166
+ }
2167
+ function removableCatalog(catalog, saved) {
2168
+ const savedIds = new Set(saved.map((one) => one.id));
2169
+ const known = new Set(catalog.variables.map((one) => one.id));
2170
+ const added = new Set;
2171
+ const savedOnly = [];
2172
+ for (const one of saved) {
2173
+ if (known.has(one.id) || added.has(one.id))
2174
+ continue;
2175
+ added.add(one.id);
2176
+ savedOnly.push({
2177
+ id: one.id,
2178
+ name: one.row.name,
2179
+ elementId: one.elementId,
2180
+ extractPath: one.row.extractPath,
2181
+ extractedValueType: "String",
2182
+ defaultLabel: one.row.label,
2183
+ elementLabel: one.elementId,
2184
+ source: one.elementId,
2185
+ taggable: true
2186
+ });
2187
+ }
2188
+ return {
2189
+ containers: catalog.containers,
2190
+ variables: [
2191
+ ...catalog.variables.map((entry) => ({
2192
+ ...entry,
2193
+ taggable: entry.taggable || savedIds.has(entry.id)
2194
+ })),
2195
+ ...savedOnly
2196
+ ]
2197
+ };
2198
+ }
2199
+ function buildListRows(variables, saved) {
2200
+ const savedById = new Map(saved.map((one) => [one.id, one]));
2201
+ const rows = groupByElement(variables).map((entry) => {
2202
+ const row = savedById.get(entry.id);
2203
+ return {
2204
+ Element: entry.elementLabel,
2205
+ Variable: entry.extractPath ? `${entry.name}.${entry.extractPath}` : entry.name,
2206
+ Id: entry.id,
2207
+ Tagged: row !== undefined,
2208
+ Label: row?.row.label ?? "",
2209
+ Stale: row !== undefined && !entry.taggable,
2210
+ Note: entry.taggable ? entry.note ?? "" : entry.reason ?? "not taggable"
2211
+ };
2212
+ });
2213
+ const known = new Set(variables.map((one) => one.id));
2214
+ const arrays = variables.filter((one) => one.array);
2215
+ for (const one of saved) {
2216
+ if (known.has(one.id))
2217
+ continue;
2218
+ known.add(one.id);
2219
+ const underArray = arrays.some((array) => one.id.startsWith(`${array.id}.`));
2220
+ rows.push({
2221
+ Element: one.elementId,
2222
+ Variable: one.row.extractPath ? `${one.row.name}.${one.row.extractPath}` : one.row.name,
2223
+ Id: one.id,
2224
+ Tagged: true,
2225
+ Label: one.row.label,
2226
+ Stale: !underArray,
2227
+ Note: underArray ? "saved in the Maestro UI on an array field; the CLI cannot edit it yet" : "saved, but this version no longer declares it"
2228
+ });
1667
2229
  }
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.";
2230
+ return rows;
2231
+ }
2232
+ function groupByElement(variables) {
2233
+ const groups = new Map;
2234
+ for (const entry of variables) {
2235
+ const group = groups.get(entry.elementLabel);
2236
+ if (group)
2237
+ group.push(entry);
2238
+ else
2239
+ groups.set(entry.elementLabel, [entry]);
1670
2240
  }
1671
- if (hasReplace && hasIncremental) {
1672
- return "Use --tags to replace tags, or --add-tags/--remove-tags to adjust them — not both.";
2241
+ return [...groups.values()].flat();
2242
+ }
2243
+
2244
+ // ../maestro-sdk/src/shared-commands/variable-tags-commands.ts
2245
+ var PROCESS_TYPES = {
2246
+ ProcessOrchestration: {
2247
+ label: "Maestro BPMN",
2248
+ tool: () => "uip maestro bpmn"
2249
+ },
2250
+ Flow: {
2251
+ label: "Flow",
2252
+ tool: (mount) => mount === "maestro" /* Maestro */ ? "uip maestro flow" : "uip flow"
2253
+ },
2254
+ CaseManagement: {
2255
+ label: "Case Management",
2256
+ tool: (mount) => mount === "maestro" /* Maestro */ ? "uip maestro case" : "uip case"
1673
2257
  }
1674
- return null;
1675
2258
  };
1676
- var resolveTagFlags = (options) => {
1677
- if (options.searchable === undefined)
1678
- return options;
2259
+ var isMaestroProcessType = (type) => Object.hasOwn(PROCESS_TYPES, type);
2260
+ function mountedPrefix(group) {
2261
+ const names = [];
2262
+ for (let at = group;at?.parent; at = at.parent) {
2263
+ names.unshift(at.name());
2264
+ }
2265
+ const tool = names.slice(0, -2);
2266
+ return tool.length > 0 ? ["uip", ...tool].join(" ") : undefined;
2267
+ }
2268
+ var FLOW_NOTE = "Filtering instances by these values in the Maestro UI needs Flow variable filtering to be enabled on the tenant.";
2269
+ async function fail(nextStep, error) {
2270
+ if (error instanceof SelectionError) {
2271
+ if (error.errorCode === "invalid_argument") {
2272
+ failInvalid(error.message, error.instructions);
2273
+ return;
2274
+ }
2275
+ failNotFound(error.message, error.instructions);
2276
+ return;
2277
+ }
2278
+ const failure = await classifiedFailure(nextStep, error);
2279
+ OutputFormatter.error({
2280
+ ...failure,
2281
+ Message: failure.Instructions,
2282
+ Instructions: nextStep
2283
+ });
2284
+ processContext.exit(1);
2285
+ }
2286
+ function failInvalid(message, instructions) {
2287
+ OutputFormatter.error({
2288
+ Result: RESULTS.ValidationError,
2289
+ ErrorCode: "invalid_argument",
2290
+ Message: message,
2291
+ Instructions: instructions,
2292
+ Retry: "RetryWillNotFix"
2293
+ });
2294
+ processContext.exit(EXIT_CODES.ValidationError);
2295
+ }
2296
+ function failNotFound(message, instructions) {
2297
+ OutputFormatter.error({
2298
+ Result: RESULTS.Failure,
2299
+ ErrorCode: "not_found",
2300
+ Message: message,
2301
+ Instructions: instructions,
2302
+ Retry: "RetryWillNotFix"
2303
+ });
2304
+ processContext.exit(1);
2305
+ }
2306
+ var settingsPath = (processKey) => `/processes/${encodeURIComponent(processKey)}/settings`;
2307
+ var shellWord = (value) => /^[\w.-]+$/.test(value) ? value : `"${value.replace(/(["\\$`])/g, "\\$1")}"`;
2308
+ function wrongToolFailure(config, mount, processKey, folderKey, processType) {
2309
+ if (!processType || processType === "Undefined" || processType === config.expectedProcessType) {
2310
+ return;
2311
+ }
2312
+ const expected = PROCESS_TYPES[config.expectedProcessType];
2313
+ const key = `${shellWord(processKey)} -f ${shellWord(folderKey)}`;
2314
+ if (isMaestroProcessType(processType)) {
2315
+ const owner = PROCESS_TYPES[processType];
2316
+ return {
2317
+ message: `Process '${processKey}' is a ${owner.label} process, not a ${expected.label} process.`,
2318
+ instructions: `Use '${owner.tool(mount)} process variable-tags list ${key}' instead.`
2319
+ };
2320
+ }
2321
+ const lists = Object.values(PROCESS_TYPES).map((one) => `'${one.tool(mount)} process list -f ${shellWord(folderKey)}'`);
1679
2322
  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
2323
+ message: `Process '${processKey}' has process type '${processType}'; only Maestro BPMN, Flow and Case Management processes have variables to tag.`,
2324
+ instructions: `Pick a process of one of those types: ${lists.slice(0, -1).join(", ")} or ${lists.at(-1)}.`
1685
2325
  };
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);
2326
+ }
2327
+ async function deriveCatalog(assetType, definition) {
2328
+ if (assetType === "bpmn") {
2329
+ if (typeof definition !== "string")
2330
+ return;
2331
+ const { deriveTaggableVariables } = await import("./taggable-variables-nc8td6er.js");
2332
+ return deriveTaggableVariables(definition);
2333
+ }
2334
+ if (typeof definition !== "string" && typeof definition !== "object") {
1696
2335
  return;
1697
2336
  }
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."
1703
- });
1704
- processContext.exit(1);
2337
+ if (definition === null)
2338
+ return;
2339
+ const { deriveCaseTaggableVariables } = await import("./case-catalog-h4fjn6q3.js");
2340
+ return deriveCaseTaggableVariables(definition);
2341
+ }
2342
+ async function loadProcess(config, mount, prefix, processKey, options) {
2343
+ const { folderKey } = options;
2344
+ const reqOptions = { folderKey };
2345
+ const listCommand = `${prefix} process variable-tags list ${shellWord(processKey)} -f ${shellWord(folderKey)}`;
2346
+ const [releaseError, release] = await catchError2(lookupRelease(processKey, folderKey));
2347
+ if (releaseError) {
2348
+ await fail(`Check both keys with '${prefix} process list -f ${shellWord(folderKey)}'.`, releaseError);
1705
2349
  return;
1706
2350
  }
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)
2351
+ const wrongTool = wrongToolFailure(config, mount, processKey, folderKey, release.processType);
2352
+ if (wrongTool) {
2353
+ failInvalid(wrongTool.message, wrongTool.instructions);
1710
2354
  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)
2355
+ }
2356
+ const version = options.processVersion ?? release.processVersion;
2357
+ if (!version) {
2358
+ failNotFound(`Process '${processKey}' has no version on record.`, "Pass --process-version <version>.");
1714
2359
  return;
1715
- OutputFormatter.success({
1716
- Result: RESULTS.Success,
1717
- Code: "ProcessVariableTagsSet",
1718
- Data: result
1719
- });
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)
2360
+ }
2361
+ const settings = await withPimsCall((pims) => pimsGet(pims, settingsPath(processKey), reqOptions), `Could not read the settings of process '${processKey}'`, { resource: "process", id: processKey });
2362
+ if (!settings)
2363
+ return;
2364
+ const definition = await withPimsCall((pims) => pimsGet(pims, `/processes/${encodeURIComponent(processKey)}/asset?type=${config.assetType}&processVersion=${encodeURIComponent(version)}`, reqOptions), `Could not read version ${version} of process '${processKey}'`, { resource: "process version", id: version });
2365
+ if (definition === undefined)
2366
+ return;
2367
+ const [parseError, catalog] = await catchError2(deriveCatalog(config.assetType, definition));
2368
+ if (parseError) {
2369
+ await fail(`Check the version with --process-version, or run '${listCommand}' on another one.`, parseError);
2370
+ return;
2371
+ }
2372
+ if (!catalog) {
2373
+ failNotFound(`Version ${version} of process '${processKey}' did not return a ${config.assetType === "bpmn" ? "BPMN" : "case"} document.`, "Pass --process-version with a version that exists.");
1725
2374
  return;
1726
- const variableTags = currentSettings.variableTags ?? {
1727
- elements: {},
1728
- sourcePackageVersion: "",
1729
- lastUpdateTimeUtc: ""
2375
+ }
2376
+ return {
2377
+ processKey,
2378
+ folderKey,
2379
+ settings,
2380
+ catalog,
2381
+ saved: readSavedRows(settings.variableTags?.elements)
1730
2382
  };
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
2383
+ }
2384
+ function parseVariableArgument(raw) {
2385
+ const at = raw.indexOf("=");
2386
+ return at < 0 ? { token: raw.trim() } : { token: raw.slice(0, at).trim(), label: raw.slice(at + 1) };
2387
+ }
2388
+ async function applyPlan(config, loaded, plan, options, codes) {
2389
+ const rows = buildListRows(loaded.catalog.variables, readSavedRows(plan.elements)).filter((row) => row.Tagged);
2390
+ const changes = [
2391
+ ...plan.added.map((id) => `added ${id}`),
2392
+ ...plan.relabeled.map((id) => `relabeled ${id}`),
2393
+ ...plan.removed.map((id) => `removed ${id}`),
2394
+ ...plan.rewritten.map(({ id, change }) => `rewrote ${id} (${change})`),
2395
+ ...plan.collapsed ? ["collapsed a row saved twice"] : []
2396
+ ].join(", ") || "rewrote the saved selection";
2397
+ const flowNote = config.expectedProcessType === "Flow" ? ` ${FLOW_NOTE}` : "";
2398
+ if (!plan.changed) {
2399
+ OutputFormatter.success({
2400
+ Result: RESULTS.Success,
2401
+ Code: codes.done,
2402
+ Data: rows,
2403
+ Instructions: "Nothing to change; the saved selection already matches."
1737
2404
  });
1738
- processContext.exit(1);
1739
2405
  return;
1740
2406
  }
1741
- const merged = { ...currentSettings, variableTags };
1742
- const result = await withPimsCall((config) => pimsPut(config, buildSettingsPath(processKey), merged, reqOptions), "Error updating variable tags");
1743
- if (!result)
2407
+ if (options.dryRun) {
2408
+ OutputFormatter.success({
2409
+ Result: RESULTS.Success,
2410
+ Code: "ProcessVariableTagsDryRun",
2411
+ Data: rows,
2412
+ Instructions: `Dry run, nothing saved. Would have ${changes}. Run again without --dry-run to apply.`
2413
+ });
2414
+ return;
2415
+ }
2416
+ const body = {
2417
+ ...loaded.settings,
2418
+ variableTags: {
2419
+ elements: plan.elements,
2420
+ lastUpdateTimeUtc: new Date().toISOString(),
2421
+ sourcePackageVersion: loaded.processKey.toLowerCase()
2422
+ }
2423
+ };
2424
+ const saved = await withPimsCall((pims) => pimsPut(pims, settingsPath(loaded.processKey), body, { folderKey: loaded.folderKey }), `Error ${codes.verb} variable tags`);
2425
+ if (!saved)
1744
2426
  return;
1745
2427
  OutputFormatter.success({
1746
2428
  Result: RESULTS.Success,
1747
- Code: "ProcessVariableTagsSet",
1748
- Data: { updated, variableTags }
2429
+ Code: codes.done,
2430
+ Data: rows,
2431
+ Instructions: `Saved: ${changes}.${flowNote}`
2432
+ });
2433
+ }
2434
+ function checkTargets(listCommand, variables, options, verb) {
2435
+ if (variables.length > 0 && options.all) {
2436
+ failInvalid("Both --variables and --all were given.", "Pass --variables, or --all, not both.");
2437
+ return false;
2438
+ }
2439
+ if (variables.length === 0 && !options.all) {
2440
+ failInvalid("No variable given.", `Pass --variables with one or more variables to ${verb}, or --all. Run '${listCommand}' to see them.`);
2441
+ return false;
2442
+ }
2443
+ return true;
2444
+ }
2445
+ var PROCESS_ARGUMENT = "Process key (GUID)";
2446
+ var FOLDER_KEY_OPTION = "Folder key (GUID)";
2447
+ var VERSION_OPTION = "Process version whose variables are offered (default: the version new instances run)";
2448
+ var registerVariableTagsCommands = (variableTagsCmd, config) => {
2449
+ const { toolLabel } = config;
2450
+ const prefixNow = () => mountedPrefix(variableTagsCmd) ?? config.commandPrefix;
2451
+ const mountNow = () => mountedPrefix(variableTagsCmd)?.startsWith("uip maestro") ? "maestro" /* Maestro */ : "tool" /* Tool */;
2452
+ const flowDescription = config.expectedProcessType === "Flow" ? " Flow instances can only be filtered by these values where the tenant has Flow variable filtering enabled." : "";
2453
+ const listCommandFor = (processKey, folderKey) => `${prefixNow()} process variable-tags list ${shellWord(processKey)} -f ${shellWord(folderKey)}`;
2454
+ const scope = (command) => command.requiredOption("-f, --folder-key <key>", FOLDER_KEY_OPTION).option("--process-version <version>", VERSION_OPTION);
2455
+ const removed = (name, replacement) => variableTagsCmd.command(name, { hidden: true }).allowUnknownOption(true).allowExcessArguments(true).trackedAction(processContext, async () => {
2456
+ failInvalid(`'variable-tags ${name}' was removed.`, replacement(prefixNow()));
2457
+ });
2458
+ const KEYS = "<process-key> -f <folder-key>";
2459
+ removed("get", (prefix) => `Use '${prefix} process variable-tags list ${KEYS}' to see which variables are tagged.`);
2460
+ removed("set", (prefix) => `Use '${prefix} process variable-tags create ${KEYS} --variables <variable>' to tag a variable, or 'delete' to untag one; 'list' shows the variables.`);
2461
+ scope(variableTagsCmd.command("list").description(`List the variables a ${toolLabel} process lets you tag for instance filtering, and which are tagged.${flowDescription}`).argument("<process-key>", PROCESS_ARGUMENT)).trackedAction(processContext, async (processKey, options) => {
2462
+ const loaded = await loadProcess(config, mountNow(), prefixNow(), processKey, options);
2463
+ if (!loaded)
2464
+ return;
2465
+ const empty = loaded.catalog.variables.length === 0 && loaded.saved.length === 0;
2466
+ OutputFormatter.success({
2467
+ Result: RESULTS.Success,
2468
+ Code: "ProcessVariableTagsList",
2469
+ Data: buildListRows(loaded.catalog.variables, loaded.saved),
2470
+ ...empty && {
2471
+ Instructions: "This version of the process declares no variables that can be tagged."
2472
+ }
2473
+ });
2474
+ });
2475
+ scope(variableTagsCmd.command("create").description(`Tag variables so ${toolLabel} process instances can be filtered by them. Name a variable as <name>, <element>.<name> or <element>.<name>.<field>, or by the id 'list' shows; append =<label> to set its label.${flowDescription}`).argument("<process-key>", PROCESS_ARGUMENT).option("--variables <variable...>", "Variables to tag, as <variable>[=<label>]").option("--all", "Tag every variable that can be tagged").option("--dry-run", "Show the result without saving it")).trackedAction(processContext, async (processKey, options) => {
2476
+ const listCommand = listCommandFor(processKey, options.folderKey);
2477
+ const variables = options.variables ?? [];
2478
+ if (!checkTargets(listCommand, variables, options, "tag"))
2479
+ return;
2480
+ const loaded = await loadProcess(config, mountNow(), prefixNow(), processKey, options);
2481
+ if (!loaded)
2482
+ return;
2483
+ const [planError, plan] = catchError2(() => {
2484
+ const requests = variables.map((raw) => {
2485
+ const { token, label } = parseVariableArgument(raw);
2486
+ const entry = resolveVariableToken(token, loaded.catalog, {
2487
+ listCommand,
2488
+ mode: "create"
2489
+ });
2490
+ return { id: entry.id, label };
2491
+ });
2492
+ return planAdd({
2493
+ variables: loaded.catalog.variables,
2494
+ saved: loaded.saved,
2495
+ requests: options.all ? "all" : requests
2496
+ });
2497
+ });
2498
+ if (planError) {
2499
+ await fail(`Run '${listCommand}' to see the variables you can tag.`, planError);
2500
+ return;
2501
+ }
2502
+ await applyPlan(config, loaded, plan, options, {
2503
+ done: "ProcessVariableTagsCreated",
2504
+ verb: "creating"
2505
+ });
2506
+ });
2507
+ scope(variableTagsCmd.command("delete").description(`Stop tagging variables. Name a variable as <name>, <element>.<name> or <element>.<name>.<field>, or by the id 'list' shows; a saved variable the process no longer declares can be untagged too.${flowDescription}`).argument("<process-key>", PROCESS_ARGUMENT).option("--variables <variable...>", "Variables to untag").option("--all", "Untag every variable, including ones the process no longer declares").option("--yes", "Confirm --all").option("--dry-run", "Show the result without saving it")).trackedAction(processContext, async (processKey, options) => {
2508
+ const listCommand = listCommandFor(processKey, options.folderKey);
2509
+ const variables = options.variables ?? [];
2510
+ if (!checkTargets(listCommand, variables, options, "untag")) {
2511
+ return;
2512
+ }
2513
+ if (options.all && !options.yes && !options.dryRun) {
2514
+ failInvalid("--all untags every variable and needs confirmation.", "Add --yes to confirm, or --dry-run to preview it.");
2515
+ return;
2516
+ }
2517
+ const loaded = await loadProcess(config, mountNow(), prefixNow(), processKey, options);
2518
+ if (!loaded)
2519
+ return;
2520
+ const [planError, plan] = catchError2(() => {
2521
+ const savedIds = new Set(loaded.saved.map((one) => one.id));
2522
+ const resolvable = removableCatalog(loaded.catalog, loaded.saved);
2523
+ const ids = variables.map((raw) => resolveVariableToken(parseVariableArgument(raw).token, resolvable, { listCommand, mode: "delete", prefer: savedIds }).id);
2524
+ return planRemove({
2525
+ variables: loaded.catalog.variables,
2526
+ saved: loaded.saved,
2527
+ ids: options.all ? "all" : ids
2528
+ });
2529
+ });
2530
+ if (planError) {
2531
+ await fail(`Run '${listCommand}' to see which variables are tagged.`, planError);
2532
+ return;
2533
+ }
2534
+ await applyPlan(config, loaded, plan, options, {
2535
+ done: "ProcessVariableTagsDeleted",
2536
+ verb: "deleting"
2537
+ });
1749
2538
  });
1750
2539
  };
2540
+
2541
+ // ../maestro-sdk/src/shared-commands/process.ts
1751
2542
  var registerSharedProcessCommands = (processCmd, config) => {
1752
2543
  const { toolLabel } = config;
1753
2544
  const settingsCmd = processCmd.command("settings").description(`Manage ${toolLabel} process settings`);
@@ -1760,10 +2551,10 @@ var registerSharedProcessCommands = (processCmd, config) => {
1760
2551
  Result: RESULTS.Success,
1761
2552
  Code: "ProcessSettingsGet",
1762
2553
  Data: result
1763
- });
2554
+ }, { preserveDataKeys: ["elements"] });
1764
2555
  });
1765
2556
  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({
2557
+ const [fileError, body] = await catchError2(resolveJsonInput2({
1767
2558
  inline: options.inputs,
1768
2559
  allowStdin: true
1769
2560
  }));
@@ -1793,52 +2584,19 @@ var registerSharedProcessCommands = (processCmd, config) => {
1793
2584
  Result: RESULTS.Success,
1794
2585
  Code: "ProcessSettingsSet",
1795
2586
  Data: result
1796
- });
2587
+ }, { preserveDataKeys: ["elements"] });
1797
2588
  });
1798
2589
  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 ?? {}
1808
- });
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) {
1813
- OutputFormatter.error({
1814
- Result: RESULTS.Failure,
1815
- Message: "Error updating variable tags",
1816
- Instructions: "Provide either --inputs (full JSON payload) or the --searchable/--variable/--all flags, not both."
1817
- });
1818
- processContext.exit(1);
1819
- return;
1820
- }
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);
1833
- return;
1834
- }
1835
- await setVariableTagsFromPayload(processKey, options);
1836
- });
2590
+ registerVariableTagsCommands(variableTagsCmd, config);
1837
2591
  attachSharedExamples(settingsCmd);
1838
2592
  attachSharedExamples(variableTagsCmd);
1839
2593
  };
1840
2594
 
1841
2595
  // ../maestro-sdk/src/shared-commands/processes.ts
2596
+ var hasStatus = (row, status) => {
2597
+ const key = `${status.charAt(0).toLowerCase()}${status.slice(1)}Count`;
2598
+ return Number(row[key]) > 0;
2599
+ };
1842
2600
  async function findProcessSummary(config, processKey, folderKey, processType) {
1843
2601
  const page = await pimsGet(config, `/processes/summary${buildQueryString({ processType, processKey })}`, { folderKey });
1844
2602
  const summaries = Array.isArray(page?.processes) ? page.processes : [];
@@ -1848,21 +2606,31 @@ var registerSharedProcessesCommands = (program, config) => {
1848
2606
  const { toolLabel, processType } = config;
1849
2607
  const incidentsQuery = buildQueryString({ processType });
1850
2608
  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
- });
2609
+ processes.command("list").description(`List ${toolLabel} process summaries. The CLI applies --folder-key, ` + "--status (keeps processes with at least one instance in that " + "status), --offset and --limit to the full list.").option("--folder-key <key>", "Keep only processes of this folder (applied by the CLI)").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>", `Keep processes with an instance in this status: ${INSTANCE_STATUS_LIST} (applied by the CLI)`).trackedAction(processContext, async (options) => {
2610
+ const { statuses, invalid } = resolveInstanceStatuses(options.status === undefined ? [] : [options.status]);
2611
+ if (invalid.length > 0) {
2612
+ OutputFormatter.error({
2613
+ Result: RESULTS.ValidationError,
2614
+ Message: `Invalid --status value: ${invalid.join(", ")}`,
2615
+ Instructions: `Valid values: ${INSTANCE_STATUS_LIST}.`
2616
+ });
2617
+ processContext.exit(EXIT_CODES.ValidationError);
2618
+ return;
2619
+ }
2620
+ const query = buildQueryString({ processType });
1858
2621
  const reqOptions = { folderKey: options.folderKey };
1859
2622
  const result = await withPimsCall((config) => pimsGet(config, `/processes/summary${query}`, reqOptions), "Error listing processes");
1860
2623
  if (!result)
1861
2624
  return;
2625
+ const scoped = filterByFolder(result.processes ?? [], options.folderKey);
2626
+ const matching = statuses.length === 0 ? scoped : scoped.filter((row) => hasStatus(row, statuses[0]));
1862
2627
  OutputFormatter.success({
1863
2628
  Result: RESULTS.Success,
1864
2629
  Code: "ProcessList",
1865
- Data: result
2630
+ Data: {
2631
+ ...result,
2632
+ processes: windowRows(matching, options.offset, options.limit)
2633
+ }
1866
2634
  });
1867
2635
  });
1868
2636
  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) => {
@@ -1879,6 +2647,9 @@ var registerSharedProcessesCommands = (program, config) => {
1879
2647
  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
2648
  const result = await withPimsCall(async (config) => {
1881
2649
  const summary = await findProcessSummary(config, processKey, options.folderKey, processType);
2650
+ if (summary?.folderKey && !inFolder(summary, options.folderKey)) {
2651
+ return { wrongFolder: summary.folderKey };
2652
+ }
1882
2653
  const incidents = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}${incidentsQuery}`, { folderKey: options.folderKey });
1883
2654
  const errorCodes = await pimsGet(config, `/incidents/process/${encodeURIComponent(processKey)}/error-codes`, { folderKey: options.folderKey });
1884
2655
  return {
@@ -1889,6 +2660,15 @@ var registerSharedProcessesCommands = (program, config) => {
1889
2660
  }, "Error diagnosing process");
1890
2661
  if (!result)
1891
2662
  return;
2663
+ if ("wrongFolder" in result) {
2664
+ OutputFormatter.error({
2665
+ Result: RESULTS.ValidationError,
2666
+ Message: `Process ${processKey} is in folder ${result.wrongFolder}, not ${options.folderKey}.`,
2667
+ Instructions: `Rerun with --folder-key ${result.wrongFolder}.`
2668
+ });
2669
+ processContext.exit(EXIT_CODES.ValidationError);
2670
+ return;
2671
+ }
1892
2672
  OutputFormatter.success({
1893
2673
  Result: RESULTS.Success,
1894
2674
  Code: "ProcessDiagnostics",
@@ -2007,6 +2787,9 @@ function isValidOperator(operator) {
2007
2787
  }
2008
2788
 
2009
2789
  // ../maestro-sdk/src/registry/command.ts
2790
+ function unenrichedTriggerWarning(nodeType) {
2791
+ return `Trigger returned without its event parameters, filter fields, and outputs, so its required event parameters are not listed. Do not configure it from this alone. Get a connection id with 'uip is connections list <connector-key>', then run: uip maestro flow registry get ${nodeType} --connection-id <id>`;
2792
+ }
2010
2793
  function flattenNodeForDisplay(n) {
2011
2794
  return {
2012
2795
  NodeType: n.nodeType,
@@ -2022,7 +2805,7 @@ async function missingProcessResourceHint() {
2022
2805
  describeProjectsWithoutProcessResource,
2023
2806
  findProjectsWithoutProcessResource,
2024
2807
  findSolutionFromCwd
2025
- } = await import("./solution-discovery-wwwynadq.js");
2808
+ } = await import("./solution-discovery-v5qatmz2.js");
2026
2809
  const ctx = await findSolutionFromCwd();
2027
2810
  if (!ctx)
2028
2811
  return {};
@@ -2036,8 +2819,13 @@ async function localResultNotes(contractWarning) {
2036
2819
  ...warnings.length > 0 ? { Warning: warnings.join(" ") } : {}
2037
2820
  };
2038
2821
  }
2822
+ function missingSourcesNote(sources, subject, cmd) {
2823
+ if (sources.length === 0)
2824
+ return;
2825
+ return `The cached node manifest is missing these node sources, so ${subject} may exist on the tenant: ${sources.join(", ")}. Run '${cmd} pull' for the reasons.`;
2826
+ }
2039
2827
  async function explainNodeTypeWithoutProcessResource(nodeType) {
2040
- const discovery = await import("./solution-discovery-wwwynadq.js");
2828
+ const discovery = await import("./solution-discovery-v5qatmz2.js");
2041
2829
  const [, explanation] = await catchError2(discovery.explainNodeTypeWithoutProcessResource(nodeType));
2042
2830
  return explanation;
2043
2831
  }
@@ -2048,7 +2836,7 @@ function flattenNodeWithAvailability(n, availableOnTenant) {
2048
2836
  };
2049
2837
  }
2050
2838
  async function mergeWithKnownSdkNodes(tenantNodes) {
2051
- const { listKnownSdkNodes } = await import("./known-types-v9sxcq1c.js");
2839
+ const { listKnownSdkNodes } = await import("./known-types-pen5h5kz.js");
2052
2840
  const tenantTypes = new Set(tenantNodes.map((n) => n.nodeType?.toLowerCase()).filter((t) => typeof t === "string"));
2053
2841
  const merged = tenantNodes.map((node) => ({ node, availableOnTenant: true }));
2054
2842
  for (const known of listKnownSdkNodes()) {
@@ -2176,7 +2964,7 @@ Subcommands:
2176
2964
  }
2177
2965
  ];
2178
2966
  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-z6tzver4.js");
2967
+ const { MANIFEST_VALIDATION_NEXT_STEP, pullNodes } = await import("./node-sync-service-6v7j8m4p.js");
2180
2968
  const [error, result] = await catchError2(pullNodes({
2181
2969
  force: options.force
2182
2970
  }));
@@ -2242,9 +3030,9 @@ In-solution (--local):
2242
3030
  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
3031
  const {
2244
3032
  getLocalSolutionSnapshot,
2245
- listNodes,
3033
+ listNodesWithDiagnostics,
2246
3034
  localContractWarning
2247
- } = await import("./node-sync-service-z6tzver4.js");
3035
+ } = await import("./node-sync-service-6v7j8m4p.js");
2248
3036
  const showAll = options.limit === ALL_NODES;
2249
3037
  if (options.local) {
2250
3038
  const [error, snapshot] = await catchError2(getLocalSolutionSnapshot());
@@ -2280,18 +3068,20 @@ In-solution (--local):
2280
3068
  }
2281
3069
  return;
2282
3070
  }
2283
- const [error, tenantNodes] = await catchError2(listNodes());
3071
+ const [error, snapshot] = await catchError2(listNodesWithDiagnostics());
2284
3072
  if (error) {
2285
3073
  OutputFormatter.error(await classifiedFailure("Error listing nodes", error));
2286
3074
  processContext.exit(1);
2287
3075
  return;
2288
3076
  }
3077
+ const tenantNodes = snapshot.result;
2289
3078
  const merged = await mergeWithKnownSdkNodes(tenantNodes);
2290
3079
  const totalCount = merged.length;
2291
3080
  const effectiveLimit = showAll ? totalCount : options.limit;
2292
3081
  const slice = merged.slice(options.offset, options.offset + effectiveLimit);
2293
3082
  const truncated = options.offset + slice.length < totalCount;
2294
3083
  const gatedCount = merged.filter((m) => !m.availableOnTenant).length;
3084
+ const warning = missingSourcesNote(snapshot.missingSources, "more nodes", cmd);
2295
3085
  OutputFormatter.success({
2296
3086
  Result: RESULTS.Success,
2297
3087
  Code: "NodeListSuccess",
@@ -2301,7 +3091,8 @@ In-solution (--local):
2301
3091
  limit: effectiveLimit,
2302
3092
  offset: options.offset,
2303
3093
  total: totalCount
2304
- })
3094
+ }),
3095
+ ...warning ? { Warning: warning } : {}
2305
3096
  });
2306
3097
  if (truncated) {
2307
3098
  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.`);
@@ -2373,10 +3164,10 @@ In-solution (--local):
2373
3164
  filterNodesByKeyword,
2374
3165
  getLocalSolutionSnapshot,
2375
3166
  localContractWarning,
2376
- searchNodeSummariesWithAvailability,
3167
+ searchNodeSummariesWithAvailabilityAndDiagnostics,
2377
3168
  searchNodes,
2378
3169
  searchNodesWithFilters
2379
- } = await import("./node-sync-service-z6tzver4.js");
3170
+ } = await import("./node-sync-service-6v7j8m4p.js");
2380
3171
  const searchLocal = () => parsedFilters ? searchNodesWithFilters(keyword, parsedFilters, {
2381
3172
  local: true
2382
3173
  }) : searchNodes(keyword, { local: true });
@@ -2402,19 +3193,25 @@ In-solution (--local):
2402
3193
  });
2403
3194
  return;
2404
3195
  }
2405
- const [searchError, results] = await catchError2(searchNodeSummariesWithAvailability(keyword, parsedFilters));
3196
+ const [searchError, snapshot] = await catchError2(searchNodeSummariesWithAvailabilityAndDiagnostics(keyword, parsedFilters));
2406
3197
  if (searchError) {
2407
3198
  OutputFormatter.error(await classifiedFailure("Error searching nodes", searchError));
2408
3199
  processContext.exit(1);
2409
3200
  return;
2410
3201
  }
2411
- let warning;
3202
+ const results = snapshot.result;
3203
+ let localHint;
2412
3204
  if (results.length === 0) {
2413
3205
  const [, localMatches] = await catchError2(searchLocal());
2414
3206
  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.`;
3207
+ localHint = `No tenant node matches, but ${localMatches.length} node(s) from projects in this solution do. Re-run the same search with --local.`;
2416
3208
  }
2417
3209
  }
3210
+ const warnings = [
3211
+ localHint,
3212
+ missingSourcesNote(snapshot.missingSources, "more matching nodes", cmd)
3213
+ ].filter((w) => typeof w === "string");
3214
+ const warning = warnings.length > 0 ? warnings.join(" ") : undefined;
2418
3215
  OutputFormatter.success({
2419
3216
  Result: RESULTS.Success,
2420
3217
  Code: "NodeSearchSuccess",
@@ -2436,7 +3233,7 @@ IS-enriched fields (connector nodes only, fetched live from Integration Service)
2436
3233
  filterFields Fields used to filter which events fire the trigger.
2437
3234
  outputResponseDefinition Fields produced by the trigger event payload.
2438
3235
  eventMode "webhooks" or "polling".
2439
- login + --connection-id required — without both, no enrichment is returned.
3236
+ login + --connection-id required for enrichment — without --connection-id, the trigger is returned without these fields, with a Warning.
2440
3237
 
2441
3238
  Examples:
2442
3239
  ${cmd} get uipath.slack.connector.send-message
@@ -2444,25 +3241,56 @@ Examples:
2444
3241
  ${cmd} get uipath.connector.trigger.uipath-microsoft-outlook365.email-received --connection-id <id>
2445
3242
 
2446
3243
  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-z6tzver4.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 })));
3244
+ 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. Adds connection-specific fields: required for a connector trigger node to include its event parameters, filter fields, and outputs; 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) => {
3245
+ const {
3246
+ gatedNodeFailure,
3247
+ getNodeEnrichedWithDiagnostics,
3248
+ getLocalNodeEnriched,
3249
+ getNode
3250
+ } = await import("./node-sync-service-6v7j8m4p.js");
3251
+ const lookup = options.local ? getLocalNodeEnriched(nodeType, options.connectionId).then(({ node, warning }) => ({
3252
+ node,
3253
+ warning,
3254
+ missingSources: []
3255
+ })) : getNodeEnrichedWithDiagnostics(nodeType, options.connectionId, { local: options.local }).then(({ result, missingSources }) => ({
3256
+ node: result,
3257
+ warning: undefined,
3258
+ missingSources
3259
+ }));
3260
+ const [error, lookedUp] = await catchError2(lookup);
2452
3261
  if (error) {
2453
3262
  OutputFormatter.error(await classifiedFailure("Error retrieving node", error));
2454
3263
  processContext.exit(1);
2455
3264
  return;
2456
3265
  }
2457
3266
  const result = lookedUp?.node;
2458
- const warning = lookedUp?.warning;
3267
+ const { isConnectorTriggerNode } = await import("./integration-service-fetcher-h6er48b7.js");
3268
+ const unenrichedTrigger = result && !options.connectionId && isConnectorTriggerNode(result);
3269
+ const warning = [
3270
+ lookedUp?.warning,
3271
+ unenrichedTrigger ? unenrichedTriggerWarning(nodeType) : undefined
3272
+ ].filter((w) => typeof w === "string").join(" ");
2459
3273
  if (!result) {
3274
+ const { isKnownSdkNodeType } = await import("./known-types-pen5h5kz.js");
3275
+ const { DYNAMIC_EXTRACT_NODE_TYPE } = await import("./manifest-hmeqvk74.js");
3276
+ if (!options.local && isKnownSdkNodeType(nodeType) && nodeType.toLowerCase() !== DYNAMIC_EXTRACT_NODE_TYPE.toLowerCase()) {
3277
+ const gated = await gatedNodeFailure(nodeType);
3278
+ OutputFormatter.error({
3279
+ Result: RESULTS.Failure,
3280
+ Message: gated.message,
3281
+ Instructions: gated.instructions,
3282
+ ErrorCode: gated.errorCode
3283
+ });
3284
+ processContext.exit(1);
3285
+ return;
3286
+ }
2460
3287
  const [, inSolution] = options.local ? [undefined, null] : await catchError2(getNode(nodeType, { local: true }));
2461
3288
  const withoutProcessResource = inSolution ? undefined : await explainNodeTypeWithoutProcessResource(nodeType);
3289
+ const missingNote = options.local || inSolution || withoutProcessResource ? undefined : missingSourcesNote(lookedUp.missingSources, "the node", cmd);
2462
3290
  OutputFormatter.error({
2463
3291
  Result: RESULTS.Failure,
2464
3292
  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}`),
3293
+ Instructions: withoutProcessResource?.instructions ?? (inSolution ? `'${nodeType}' is a node of a project in this solution, which only --local looks up. Run: ${cmd} get ${nodeType} --local` : missingNote ? `No node found with node type: ${nodeType}. ${missingNote}` : `No node found with node type: ${nodeType}`),
2466
3294
  ErrorCode: "not_found"
2467
3295
  });
2468
3296
  processContext.exit(1);
@@ -2479,6 +3307,6 @@ In-solution (--local):
2479
3307
  });
2480
3308
  };
2481
3309
 
2482
- export { registerRegistryCommand, registerSharedDebugInstanceCommands, registerSharedIncidentCommands, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
3310
+ export { registerRegistryCommand, registerSharedDebugInstanceCommands, registerSharedIncidentCommands, resolveDebugFolder, registerSharedInstanceCommands, registerSharedProcessCommands, registerSharedProcessesCommands };
2483
3311
 
2484
- //# debugId=2A3CACF7B45A0E8E64756E2164756E21
3312
+ //# debugId=2E4CCA914B29D06464756E2164756E21