@unbrained/pm-cli 2026.7.1 → 2026.7.3

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 (625) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +25 -0
  3. package/CONTRIBUTING.md +2 -2
  4. package/README.md +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +110 -86
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/activity.js +79 -57
  9. package/dist/cli/commands/activity.js.map +1 -1
  10. package/dist/cli/commands/aggregate.js +102 -79
  11. package/dist/cli/commands/aggregate.js.map +1 -1
  12. package/dist/cli/commands/calendar.js +278 -243
  13. package/dist/cli/commands/calendar.js.map +1 -1
  14. package/dist/cli/commands/close-many.js +176 -114
  15. package/dist/cli/commands/close-many.js.map +1 -1
  16. package/dist/cli/commands/close.js +157 -129
  17. package/dist/cli/commands/close.js.map +1 -1
  18. package/dist/cli/commands/comments-audit.js +50 -42
  19. package/dist/cli/commands/comments-audit.js.map +1 -1
  20. package/dist/cli/commands/config.d.ts +2 -0
  21. package/dist/cli/commands/config.js +443 -879
  22. package/dist/cli/commands/config.js.map +1 -1
  23. package/dist/cli/commands/context.js +365 -287
  24. package/dist/cli/commands/context.js.map +1 -1
  25. package/dist/cli/commands/contracts.js +352 -238
  26. package/dist/cli/commands/contracts.js.map +1 -1
  27. package/dist/cli/commands/create.js +32 -17
  28. package/dist/cli/commands/create.js.map +1 -1
  29. package/dist/cli/commands/dedupe-audit.js +46 -39
  30. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  31. package/dist/cli/commands/dedupe-merge.js +88 -69
  32. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +56 -67
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/shared.js +21 -15
  36. package/dist/cli/commands/extension/shared.js.map +1 -1
  37. package/dist/cli/commands/get.js +114 -81
  38. package/dist/cli/commands/get.js.map +1 -1
  39. package/dist/cli/commands/health.d.ts +17 -0
  40. package/dist/cli/commands/health.js +545 -417
  41. package/dist/cli/commands/health.js.map +1 -1
  42. package/dist/cli/commands/history-compact.js +209 -140
  43. package/dist/cli/commands/history-compact.js.map +1 -1
  44. package/dist/cli/commands/history-redact.js +162 -119
  45. package/dist/cli/commands/history-redact.js.map +1 -1
  46. package/dist/cli/commands/history-repair.js +120 -85
  47. package/dist/cli/commands/history-repair.js.map +1 -1
  48. package/dist/cli/commands/init-agent-guidance.js +32 -19
  49. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  50. package/dist/cli/commands/init.d.ts +8 -2
  51. package/dist/cli/commands/init.js +263 -162
  52. package/dist/cli/commands/init.js.map +1 -1
  53. package/dist/cli/commands/list.js +152 -102
  54. package/dist/cli/commands/list.js.map +1 -1
  55. package/dist/cli/commands/next.js +60 -40
  56. package/dist/cli/commands/next.js.map +1 -1
  57. package/dist/cli/commands/plan.js +373 -298
  58. package/dist/cli/commands/plan.js.map +1 -1
  59. package/dist/cli/commands/profile.js +23 -15
  60. package/dist/cli/commands/profile.js.map +1 -1
  61. package/dist/cli/commands/recurrence-parsers.js +43 -25
  62. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  63. package/dist/cli/commands/reindex.d.ts +21 -5
  64. package/dist/cli/commands/reindex.js +345 -205
  65. package/dist/cli/commands/reindex.js.map +1 -1
  66. package/dist/cli/commands/restore.d.ts +8 -7
  67. package/dist/cli/commands/restore.js +105 -69
  68. package/dist/cli/commands/restore.js.map +1 -1
  69. package/dist/cli/commands/schema.js +33 -30
  70. package/dist/cli/commands/schema.js.map +1 -1
  71. package/dist/cli/commands/search.d.ts +10 -2
  72. package/dist/cli/commands/search.js +503 -470
  73. package/dist/cli/commands/search.js.map +1 -1
  74. package/dist/cli/commands/telemetry.js +98 -87
  75. package/dist/cli/commands/telemetry.js.map +1 -1
  76. package/dist/cli/commands/test-all.js +237 -168
  77. package/dist/cli/commands/test-all.js.map +1 -1
  78. package/dist/cli/commands/test.d.ts +6 -5
  79. package/dist/cli/commands/test.js +424 -344
  80. package/dist/cli/commands/test.js.map +1 -1
  81. package/dist/cli/commands/update-many.js +57 -42
  82. package/dist/cli/commands/update-many.js.map +1 -1
  83. package/dist/cli/commands/update.d.ts +1 -1
  84. package/dist/cli/commands/update.js +738 -671
  85. package/dist/cli/commands/update.js.map +1 -1
  86. package/dist/cli/commands/validate.d.ts +20 -1
  87. package/dist/cli/commands/validate.js +478 -343
  88. package/dist/cli/commands/validate.js.map +1 -1
  89. package/dist/cli/error-guidance.js +406 -361
  90. package/dist/cli/error-guidance.js.map +1 -1
  91. package/dist/cli/extension-command-help.js +27 -19
  92. package/dist/cli/extension-command-help.js.map +1 -1
  93. package/dist/cli/help-json-payload.js +57 -49
  94. package/dist/cli/help-json-payload.js.map +1 -1
  95. package/dist/cli/main.d.ts +47 -0
  96. package/dist/cli/main.js +474 -371
  97. package/dist/cli/main.js.map +1 -1
  98. package/dist/cli/migration-gates.js +22 -45
  99. package/dist/cli/migration-gates.js.map +1 -1
  100. package/dist/cli/register-list-query.js +299 -310
  101. package/dist/cli/register-list-query.js.map +1 -1
  102. package/dist/cli/register-mutation.js +763 -779
  103. package/dist/cli/register-mutation.js.map +1 -1
  104. package/dist/cli/register-operations.js +386 -362
  105. package/dist/cli/register-operations.js.map +1 -1
  106. package/dist/cli/register-setup.js +120 -101
  107. package/dist/cli/register-setup.js.map +1 -1
  108. package/dist/cli/registration-helpers.d.ts +4 -0
  109. package/dist/cli/registration-helpers.js +45 -56
  110. package/dist/cli/registration-helpers.js.map +1 -1
  111. package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
  112. package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
  113. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
  114. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
  115. package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
  116. package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
  118. package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
  119. package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
  120. package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
  121. package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
  123. package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
  126. package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
  127. package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
  128. package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
  133. package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
  134. package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
  136. package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
  140. package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
  141. package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
  142. package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
  144. package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  146. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  147. package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
  148. package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
  150. package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
  152. package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
  154. package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
  156. package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
  158. package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
  162. package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
  164. package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
  166. package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
  168. package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
  170. package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
  172. package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
  175. package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
  177. package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
  179. package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
  180. package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
  182. package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
  184. package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
  186. package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
  188. package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
  190. package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
  191. package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
  193. package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
  194. package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
  196. package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
  198. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
  199. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
  200. package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
  202. package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
  204. package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
  206. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
  208. package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
  210. package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
  211. package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
  212. package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
  213. package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
  214. package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
  216. package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
  218. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
  219. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
  220. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
  221. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
  222. package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
  223. package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
  225. package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
  226. package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
  227. package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
  228. package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
  229. package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
  230. package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
  232. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
  233. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
  234. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
  235. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
  236. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
  237. package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
  238. package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
  240. package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  242. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  243. package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
  244. package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
  246. package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
  248. package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
  249. package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
  250. package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
  251. package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
  252. package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
  254. package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
  256. package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
  257. package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
  258. package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
  259. package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
  260. package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
  262. package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
  263. package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
  264. package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
  265. package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
  266. package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
  267. package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
  268. package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
  269. package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
  270. package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
  271. package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
  272. package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
  273. package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
  274. package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
  275. package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
  276. package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
  277. package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
  278. package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
  279. package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
  280. package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
  281. package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
  282. package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
  283. package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
  284. package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
  285. package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
  286. package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
  287. package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
  288. package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
  289. package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
  290. package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
  291. package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
  292. package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
  294. package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
  295. package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
  296. package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
  297. package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
  298. package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
  299. package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
  300. package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
  301. package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
  302. package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
  303. package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
  304. package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
  306. package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
  307. package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
  308. package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
  309. package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
  310. package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
  311. package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
  312. package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
  313. package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
  314. package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
  315. package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
  316. package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
  317. package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
  318. package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
  319. package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
  320. package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
  322. package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
  323. package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
  324. package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
  325. package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
  326. package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
  327. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
  328. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
  329. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
  330. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
  331. package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
  332. package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
  333. package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
  334. package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
  335. package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
  336. package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
  337. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
  338. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
  339. package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
  340. package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
  341. package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
  342. package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
  343. package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
  344. package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
  345. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
  346. package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
  347. package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
  348. package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
  349. package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
  350. package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
  351. package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
  352. package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
  353. package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
  354. package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
  355. package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
  356. package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
  357. package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
  358. package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
  359. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
  360. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
  361. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
  362. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
  363. package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
  364. package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
  365. package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
  366. package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
  367. package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
  368. package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
  369. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
  370. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
  371. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
  372. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
  373. package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
  374. package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
  375. package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
  376. package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
  377. package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
  378. package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
  379. package/dist/cli-bundle/main.js +1107 -916
  380. package/dist/cli-bundle/main.js.map +3 -3
  381. package/dist/core/config/nested-settings.js +89 -67
  382. package/dist/core/config/nested-settings.js.map +1 -1
  383. package/dist/core/governance/metadata-coverage.js +20 -28
  384. package/dist/core/governance/metadata-coverage.js.map +1 -1
  385. package/dist/core/history/drift-scan.js +93 -81
  386. package/dist/core/history/drift-scan.js.map +1 -1
  387. package/dist/core/item/item-type-definition.js +14 -14
  388. package/dist/core/item/item-type-definition.js.map +1 -1
  389. package/dist/core/item/type-registry.js +114 -99
  390. package/dist/core/item/type-registry.js.map +1 -1
  391. package/dist/core/output/mutation-projection.js +42 -26
  392. package/dist/core/output/mutation-projection.js.map +1 -1
  393. package/dist/core/schema/runtime-schema.js +97 -80
  394. package/dist/core/schema/runtime-schema.js.map +1 -1
  395. package/dist/core/schema/status-defs-file.js +26 -3
  396. package/dist/core/schema/status-defs-file.js.map +1 -1
  397. package/dist/core/search/corpus.js +25 -19
  398. package/dist/core/search/corpus.js.map +1 -1
  399. package/dist/core/search/semantic-defaults.js +64 -37
  400. package/dist/core/search/semantic-defaults.js.map +1 -1
  401. package/dist/core/search/vector-stores.js +32 -17
  402. package/dist/core/search/vector-stores.js.map +1 -1
  403. package/dist/core/sentry/helpers.js +31 -28
  404. package/dist/core/sentry/helpers.js.map +1 -1
  405. package/dist/core/sentry/instrument.js +54 -43
  406. package/dist/core/sentry/instrument.js.map +1 -1
  407. package/dist/core/shared/memo.d.ts +12 -0
  408. package/dist/core/shared/memo.js +25 -0
  409. package/dist/core/shared/memo.js.map +1 -0
  410. package/dist/core/shared/serialization.js +24 -14
  411. package/dist/core/shared/serialization.js.map +1 -1
  412. package/dist/core/shared/time.js +26 -4
  413. package/dist/core/shared/time.js.map +1 -1
  414. package/dist/core/store/front-matter-cache.d.ts +5 -0
  415. package/dist/core/store/front-matter-cache.js +316 -171
  416. package/dist/core/store/front-matter-cache.js.map +1 -1
  417. package/dist/core/store/item-store.js +33 -26
  418. package/dist/core/store/item-store.js.map +1 -1
  419. package/dist/core/store/settings.js +247 -203
  420. package/dist/core/store/settings.js.map +1 -1
  421. package/dist/core/test/background-runs.js +189 -160
  422. package/dist/core/test/background-runs.js.map +1 -1
  423. package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
  424. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  425. package/dist/sdk/compose.js +51 -42
  426. package/dist/sdk/compose.js.map +1 -1
  427. package/docs/AGENT_GUIDE.md +2 -2
  428. package/docs/ARCHITECTURE.md +2 -2
  429. package/docs/COMMANDS.md +8 -4
  430. package/docs/CONFIGURATION.md +1 -1
  431. package/docs/EXTENSIONS.md +12 -12
  432. package/docs/ONBOARDING.md +4 -2
  433. package/docs/README.md +2 -0
  434. package/docs/examples/starter-extension/README.md +11 -10
  435. package/marketplace.json +3 -3
  436. package/package.json +2 -2
  437. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  438. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  439. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  440. package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
  441. package/plugins/pm-claude/README.md +6 -3
  442. package/plugins/pm-claude/commands/pm-init.md +1 -1
  443. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
  444. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
  445. package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
  478. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
  479. package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
  481. package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
  483. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
  484. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
  485. package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
  486. package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
  487. package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
  488. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
  489. package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
  490. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
  491. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
  492. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
  493. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
  494. package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
  495. package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
  496. package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
  497. package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
  498. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
  499. package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
  500. package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
  501. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
  502. package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
  503. package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
  504. package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
  505. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
  506. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
  507. package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
  508. package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
  509. package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
  510. package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
  511. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
  512. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
  513. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
  514. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
  515. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
  516. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
  517. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
  518. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
  522. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
  523. package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
  525. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
  526. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
  527. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
  528. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
  529. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
  531. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
  532. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
  533. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
  534. /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
package/dist/cli/main.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Provides CLI runtime support for Main.
6
6
  */
7
7
 
8
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9f13a662-73c4-5ffa-99bc-4edee2b7a7fb")}catch(e){}}();
8
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa682568-77f6-5659-a6dd-3a69dd4e1fc0")}catch(e){}}();
9
9
  import { Command } from "commander";
10
10
  import { activateExtensions, clearActiveExtensionHooks, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
11
11
  import { pathExists } from "../core/fs/fs-utils.js";
@@ -132,6 +132,59 @@ function inferMissingFieldsFromErrorMessage(message) {
132
132
  /* c8 ignore next */
133
133
  return normalized.length > 0 ? normalized : undefined;
134
134
  }
135
+ function inferMissingFieldsForRecovery(rawMessage, invocationArgv, existingRecovery) {
136
+ if (existingRecovery?.suggested_retry) {
137
+ return undefined;
138
+ }
139
+ const providedFields = extractProvidedOptionFlags(invocationArgv);
140
+ const providedSet = new Set(providedFields.map((flag) => normalizeLongOptionFlag(flag) ?? flag));
141
+ const rawInferred = inferMissingFieldsFromErrorMessage(rawMessage);
142
+ const trulyMissing = rawInferred?.filter((flag) => !providedSet.has(normalizeLongOptionFlag(flag) ?? flag));
143
+ return trulyMissing && trulyMissing.length > 0 ? trulyMissing : undefined;
144
+ }
145
+ function resolveRecoverySuggestedRetry(invocationArgv, attemptedCommand, inferredMissing, existingRecovery) {
146
+ if (existingRecovery?.suggested_retry) {
147
+ return existingRecovery.suggested_retry;
148
+ }
149
+ const missingFlag = inferredMissing?.[0];
150
+ const normalizedMissing = missingFlag ? normalizeLongOptionFlag(missingFlag) : undefined;
151
+ const suggestedRetry = normalizedMissing
152
+ ? renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"])
153
+ : attemptedCommand;
154
+ return suggestedRetry === attemptedCommand ? undefined : suggestedRetry;
155
+ }
156
+ function projectExistingRecoveryOptionalFields(existingRecovery) {
157
+ if (!existingRecovery) {
158
+ return {};
159
+ }
160
+ const optionalFields = [
161
+ "recovery_mode",
162
+ "missing_required_fields",
163
+ "suggested_flags",
164
+ "fallback_candidates",
165
+ "next_best_command",
166
+ ];
167
+ const projected = {};
168
+ for (const field of optionalFields) {
169
+ const value = existingRecovery[field];
170
+ if (value !== undefined && value !== null) {
171
+ projected[field] = value;
172
+ }
173
+ }
174
+ return projected;
175
+ }
176
+ function buildRecoveryPayload(params) {
177
+ const existingRecovery = params.existingRecovery;
178
+ return {
179
+ attempted_command: existingRecovery?.attempted_command ?? params.attemptedCommand,
180
+ normalized_args: existingRecovery?.normalized_args ?? [...params.invocationArgv],
181
+ /* c8 ignore next */
182
+ provided_fields: existingRecovery?.provided_fields ?? (params.providedFields.length > 0 ? params.providedFields : undefined),
183
+ missing: existingRecovery?.missing ?? params.inferredMissing,
184
+ ...projectExistingRecoveryOptionalFields(existingRecovery),
185
+ ...(params.suggestedRetry ? { suggested_retry: params.suggestedRetry } : {}),
186
+ };
187
+ }
135
188
  function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
136
189
  const explainRequested = invocationArgv.includes("--explain");
137
190
  const existingRecovery = context?.recovery;
@@ -144,40 +197,16 @@ function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
144
197
  }
145
198
  const attemptedCommand = renderAttemptedCommand(invocationArgv);
146
199
  const providedFields = extractProvidedOptionFlags(invocationArgv);
147
- /* c8 ignore next */
148
- const providedSet = new Set(providedFields.map((flag) => normalizeLongOptionFlag(flag) ?? flag));
149
- const rawInferred = existingRecovery?.suggested_retry ? undefined : inferMissingFieldsFromErrorMessage(rawMessage);
150
- /* c8 ignore next */
151
- const trulyMissing = rawInferred?.filter((flag) => !providedSet.has(normalizeLongOptionFlag(flag) ?? flag));
152
- const inferredMissing = trulyMissing && trulyMissing.length > 0 ? trulyMissing : undefined;
153
- let suggestedRetry = existingRecovery?.suggested_retry;
154
- if (!suggestedRetry && inferredMissing && inferredMissing.length > 0) {
155
- const missingFlag = inferredMissing[0];
156
- const normalizedMissing = normalizeLongOptionFlag(missingFlag);
157
- /* c8 ignore next */
158
- if (normalizedMissing) {
159
- suggestedRetry = renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"]);
160
- }
161
- }
162
- if (!suggestedRetry) {
163
- suggestedRetry = attemptedCommand;
164
- }
165
- if (!existingRecovery?.suggested_retry && suggestedRetry === attemptedCommand) {
166
- suggestedRetry = undefined;
167
- }
168
- const recovery = {
169
- attempted_command: existingRecovery?.attempted_command ?? attemptedCommand,
170
- normalized_args: existingRecovery?.normalized_args ?? [...invocationArgv],
171
- /* c8 ignore next */
172
- provided_fields: existingRecovery?.provided_fields ?? (providedFields.length > 0 ? providedFields : undefined),
173
- missing: existingRecovery?.missing ?? inferredMissing,
174
- ...(existingRecovery?.recovery_mode ? { recovery_mode: existingRecovery.recovery_mode } : {}),
175
- ...(existingRecovery?.missing_required_fields ? { missing_required_fields: existingRecovery.missing_required_fields } : {}),
176
- ...(existingRecovery?.suggested_flags ? { suggested_flags: existingRecovery.suggested_flags } : {}),
177
- ...(suggestedRetry ? { suggested_retry: suggestedRetry } : {}),
178
- ...(existingRecovery?.fallback_candidates ? { fallback_candidates: existingRecovery.fallback_candidates } : {}),
179
- ...(existingRecovery?.next_best_command ? { next_best_command: existingRecovery.next_best_command } : {}),
180
- };
200
+ const inferredMissing = inferMissingFieldsForRecovery(rawMessage, invocationArgv, existingRecovery);
201
+ const suggestedRetry = resolveRecoverySuggestedRetry(invocationArgv, attemptedCommand, inferredMissing, existingRecovery);
202
+ const recovery = buildRecoveryPayload({
203
+ invocationArgv,
204
+ attemptedCommand,
205
+ providedFields,
206
+ inferredMissing,
207
+ suggestedRetry,
208
+ existingRecovery,
209
+ });
181
210
  return {
182
211
  ...context,
183
212
  recovery,
@@ -536,8 +565,11 @@ function collectExtensionFlagDefinitionsForInvocation(registrations, commandPath
536
565
  }
537
566
  return nestedMatch.length > 0 ? nestedMatch : exact;
538
567
  }
568
+ function dynamicCommandArguments(descriptor) {
569
+ return descriptor.arguments ?? [];
570
+ }
539
571
  function formatDynamicCommandUsage(descriptor) {
540
- const argumentSuffix = descriptor.arguments
572
+ const argumentSuffix = dynamicCommandArguments(descriptor)
541
573
  .map((argument) => {
542
574
  const label = argument.variadic ? `${argument.name}...` : argument.name;
543
575
  return argument.required ? `<${label}>` : `[${label}]`;
@@ -562,10 +594,12 @@ function isImporterOrExporterCommandPath(registrations, commandPath) {
562
594
  registrations.exporters.some((entry) => normalizeExtensionCommandPath(`${entry.exporter} export`) === normalized));
563
595
  }
564
596
  function validateDynamicExtensionCommandArgs(descriptor, args) {
565
- const requiredCount = descriptor.arguments.filter((argument) => argument.required).length;
566
- const variadic = descriptor.arguments.some((argument) => argument.variadic);
567
- const maxCount = variadic ? Number.POSITIVE_INFINITY : descriptor.arguments.length;
568
- const hintSuffix = descriptor.failure_hints.length > 0 ? ` ${descriptor.failure_hints.join(" ")}` : "";
597
+ const descriptorArguments = dynamicCommandArguments(descriptor);
598
+ const requiredCount = descriptorArguments.filter((argument) => argument.required).length;
599
+ const variadic = descriptorArguments.some((argument) => argument.variadic);
600
+ const maxCount = variadic ? Number.POSITIVE_INFINITY : descriptorArguments.length;
601
+ const failureHints = descriptor.failure_hints ?? [];
602
+ const hintSuffix = failureHints.length > 0 ? ` ${failureHints.join(" ")}` : "";
569
603
  if (args.length < requiredCount) {
570
604
  throw new PmCliError(`Missing required argument for extension command '${descriptor.command}'. Usage: ${formatDynamicCommandUsage(descriptor)}${hintSuffix}`, EXIT_CODE.USAGE);
571
605
  }
@@ -1210,15 +1244,44 @@ async function runRequiredExtensionCommand(command, options, globalOptions, exte
1210
1244
  return extensionCommandResult.result;
1211
1245
  }
1212
1246
  const WRAPPED_ACTION_HANDLER = Symbol("pm.wrappedActionHandler");
1247
+ function resolveActionCommand(actionArgs, fallback) {
1248
+ const possibleCommand = actionArgs[actionArgs.length - 1];
1249
+ /* c8 ignore next */
1250
+ return possibleCommand instanceof Command ? possibleCommand : fallback;
1251
+ }
1252
+ function maybePrintExtensionProfileWarnings(enabled, label, warnings) {
1253
+ if (enabled && warnings.length > 0) {
1254
+ printError(`profile:extensions ${label}=${formatHookWarnings(warnings)}`);
1255
+ }
1256
+ }
1257
+ function validateDynamicInvocationArgs(params) {
1258
+ const dynamicDescriptor = activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(params.commandPath));
1259
+ if (!dynamicDescriptor || !isImporterOrExporterCommandPath(params.activeRegistrations, params.commandPath)) {
1260
+ return;
1261
+ }
1262
+ const positionalArgs = dynamicCommandArguments(dynamicDescriptor).length === 0
1263
+ ? collectLoosePositionalArgs(params.commandArgs)
1264
+ : stripLooseCommandOptionTokens(params.commandArgs, params.extensionFlagDefinitions);
1265
+ validateDynamicExtensionCommandArgs(dynamicDescriptor, positionalArgs);
1266
+ }
1267
+ function syncCommanderActionArgs(actionCommand, actionArgs, commandArgs) {
1268
+ actionCommand.args = [...commandArgs];
1269
+ /* c8 ignore next */
1270
+ if ("_processArguments" in actionCommand && typeof actionCommand._processArguments === "function") {
1271
+ actionCommand._processArguments();
1272
+ }
1273
+ /* c8 ignore next */
1274
+ if (actionArgs.length > 0 && Array.isArray(actionArgs[0])) {
1275
+ actionArgs[0] = [...actionCommand.processedArgs];
1276
+ }
1277
+ }
1213
1278
  function wrapProgramActionsForExtensionHandlers(rootProgram) {
1214
1279
  const visit = (entry) => {
1215
1280
  const actionEntry = entry;
1216
1281
  if (typeof actionEntry._actionHandler === "function" && actionEntry[WRAPPED_ACTION_HANDLER] !== true) {
1217
1282
  const originalAction = actionEntry._actionHandler;
1218
1283
  actionEntry._actionHandler = async function wrappedActionHandler(...actionArgs) {
1219
- const possibleCommand = actionArgs[actionArgs.length - 1];
1220
- /* c8 ignore next */
1221
- const actionCommand = possibleCommand instanceof Command ? possibleCommand : entry;
1284
+ const actionCommand = resolveActionCommand(actionArgs, entry);
1222
1285
  const startedAt = Date.now();
1223
1286
  clearResolvedGlobalOptions(actionCommand);
1224
1287
  let globalOptions = getGlobalOptions(actionCommand);
@@ -1241,9 +1304,7 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
1241
1304
  global: globalOptions,
1242
1305
  pm_root: pmRoot,
1243
1306
  });
1244
- if (globalOptions.profile && parserOverride.warnings.length > 0) {
1245
- printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`);
1246
- }
1307
+ maybePrintExtensionProfileWarnings(globalOptions.profile, "parser_warnings", parserOverride.warnings);
1247
1308
  commandArgs = parserOverride.context.args;
1248
1309
  commandOptions = parserOverride.context.options;
1249
1310
  globalOptions = parserOverride.context.global;
@@ -1252,24 +1313,10 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
1252
1313
  // only arity validation, so excess positionals could reach handlers.
1253
1314
  // Free-form `registerCommand` commands intentionally accept positionals
1254
1315
  // via context.args, and core commands have no descriptor.
1255
- const dynamicDescriptor = activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(commandPath));
1256
- if (dynamicDescriptor && isImporterOrExporterCommandPath(activeRegistrations, commandPath)) {
1257
- const positionalArgs = dynamicDescriptor.arguments.length === 0
1258
- ? collectLoosePositionalArgs(commandArgs)
1259
- : stripLooseCommandOptionTokens(commandArgs, extensionFlagDefinitions);
1260
- validateDynamicExtensionCommandArgs(dynamicDescriptor, positionalArgs);
1261
- }
1316
+ validateDynamicInvocationArgs({ activeRegistrations, commandPath, commandArgs, extensionFlagDefinitions });
1262
1317
  globalOptions = await applyDefaultOutputFormat(globalOptions);
1263
1318
  setResolvedGlobalOptions(actionCommand, globalOptions);
1264
- actionCommand.args = [...commandArgs];
1265
- /* c8 ignore next */
1266
- if ("_processArguments" in actionCommand && typeof actionCommand._processArguments === "function") {
1267
- actionCommand._processArguments();
1268
- }
1269
- /* c8 ignore next */
1270
- if (actionArgs.length > 0 && Array.isArray(actionArgs[0])) {
1271
- actionArgs[0] = [...actionCommand.processedArgs];
1272
- }
1319
+ syncCommanderActionArgs(actionCommand, actionArgs, commandArgs);
1273
1320
  for (const [key, value] of Object.entries(commandOptions)) {
1274
1321
  actionCommand.setOptionValueWithSource(key, value, "cli");
1275
1322
  }
@@ -1288,9 +1335,7 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
1288
1335
  global: globalOptions,
1289
1336
  pm_root: pmRoot,
1290
1337
  });
1291
- if (globalOptions.profile && extensionCommandResult.warnings.length > 0) {
1292
- printError(`profile:extensions command_handler_warnings=${formatHookWarnings(extensionCommandResult.warnings)}`);
1293
- }
1338
+ maybePrintExtensionProfileWarnings(globalOptions.profile, "command_handler_warnings", extensionCommandResult.warnings);
1294
1339
  if (extensionCommandResult.handled) {
1295
1340
  setActiveCommandResult(extensionCommandResult.result);
1296
1341
  printResult(extensionCommandResult.result, {
@@ -1316,36 +1361,67 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
1316
1361
  visit(rootProgram);
1317
1362
  }
1318
1363
  /* c8 ignore stop */
1364
+ async function clearDynamicExtensionCommandState(params) {
1365
+ activeRuntimeExtensionCommandDescriptors = new Map();
1366
+ setActiveExtensionServices({ overrides: [] });
1367
+ if (params) {
1368
+ await maybeAttachCreateUpdatePolicyHelpText(params.rootProgram, params.pmRoot, params.invocationArgv, createEmptyExtensionRegistrationRegistry(), params.settings);
1369
+ }
1370
+ }
1371
+ /* v8 ignore start -- dynamic help fallback variants are exercised through registration integration tests; residual legacy branches are defensive */
1372
+ function attachDynamicExtensionHelp(command, descriptor, flagHelp, metadataHelp) {
1373
+ if (descriptor?.flags && descriptor.flags.length > 0) {
1374
+ applyDynamicExtensionFlagOptions(command, descriptor.flags);
1375
+ const residualFlagHelp = buildResidualDynamicExtensionFlagHelp(command, descriptor.flags);
1376
+ if (residualFlagHelp) {
1377
+ command.addHelpText("after", residualFlagHelp);
1378
+ }
1379
+ }
1380
+ else if (flagHelp) {
1381
+ command.addHelpText("after", flagHelp);
1382
+ }
1383
+ if (metadataHelp) {
1384
+ command.addHelpText("after", metadataHelp);
1385
+ }
1386
+ }
1387
+ /* v8 ignore stop */
1319
1388
  /* c8 ignore start */
1320
1389
  async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
1321
1390
  const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
1322
1391
  const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
1323
1392
  if (bootstrapGlobalOptions.noExtensions) {
1324
- activeRuntimeExtensionCommandDescriptors = new Map();
1325
- setActiveExtensionServices({ overrides: [] });
1326
- await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry());
1393
+ await clearDynamicExtensionCommandState({
1394
+ rootProgram,
1395
+ pmRoot,
1396
+ invocationArgv,
1397
+ });
1327
1398
  return;
1328
1399
  }
1329
1400
  const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(pmRoot);
1330
1401
  const probe = buildBootstrapActivationProbe(invocationArgv);
1331
1402
  if (!discoverySnapshot) {
1332
- activeRuntimeExtensionCommandDescriptors = new Map();
1333
- setActiveExtensionServices({ overrides: [] });
1403
+ await clearDynamicExtensionCommandState();
1334
1404
  return;
1335
1405
  }
1336
1406
  if (!discoveryNeedsActivationForProbe(discoverySnapshot.discovery, probe)) {
1337
- activeRuntimeExtensionCommandDescriptors = new Map();
1338
- setActiveExtensionServices({ overrides: [] });
1339
- await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry(), discoverySnapshot.settings);
1407
+ await clearDynamicExtensionCommandState({
1408
+ rootProgram,
1409
+ pmRoot,
1410
+ invocationArgv,
1411
+ settings: discoverySnapshot.settings,
1412
+ });
1340
1413
  emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, probe);
1341
1414
  return;
1342
1415
  }
1343
1416
  const snapshot = await loadRuntimeExtensionSnapshot(pmRoot);
1344
1417
  /* c8 ignore next */
1345
1418
  if (!snapshot) {
1346
- activeRuntimeExtensionCommandDescriptors = new Map();
1347
- setActiveExtensionServices({ overrides: [] });
1348
- await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, createEmptyExtensionRegistrationRegistry(), discoverySnapshot.settings);
1419
+ await clearDynamicExtensionCommandState({
1420
+ rootProgram,
1421
+ pmRoot,
1422
+ invocationArgv,
1423
+ settings: discoverySnapshot.settings,
1424
+ });
1349
1425
  return;
1350
1426
  }
1351
1427
  // Ensure usage/help/error formatting overrides are available even when parse
@@ -1364,20 +1440,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
1364
1440
  const flagHelp = snapshot.commandFlagHelp.get(commandPath);
1365
1441
  const metadataHelp = descriptor ? buildDynamicExtensionCommandMetadataHelp(descriptor) : null;
1366
1442
  if (existingCommand) {
1367
- if (descriptor?.flags && descriptor.flags.length > 0) {
1368
- applyDynamicExtensionFlagOptions(existingCommand, descriptor.flags);
1369
- const residualFlagHelp = buildResidualDynamicExtensionFlagHelp(existingCommand, descriptor.flags);
1370
- if (residualFlagHelp) {
1371
- existingCommand.addHelpText("after", residualFlagHelp);
1372
- }
1373
- }
1374
- else if (flagHelp) {
1375
- existingCommand.addHelpText("after", flagHelp);
1376
- }
1377
- /* c8 ignore next */
1378
- if (metadataHelp) {
1379
- existingCommand.addHelpText("after", metadataHelp);
1380
- }
1443
+ attachDynamicExtensionHelp(existingCommand, descriptor, flagHelp, metadataHelp);
1381
1444
  continue;
1382
1445
  }
1383
1446
  const dynamicCommand = ensureCommandPath(rootProgram, pathParts);
@@ -1861,6 +1924,315 @@ function enforceExplicitRetryForFlagTypos(bootstrapInvocation) {
1861
1924
  },
1862
1925
  });
1863
1926
  }
1927
+ function createTelemetryCommandErrorEmitter(params) {
1928
+ return async (event) => {
1929
+ const errorCategory = resolveTelemetryErrorCategory(event.errorCode);
1930
+ const commandResolution = deriveTelemetryCommandResolution({
1931
+ ok: false,
1932
+ errorCode: event.errorCode,
1933
+ errorCategory,
1934
+ });
1935
+ await emitTelemetryErrorEvent({
1936
+ command: event.command,
1937
+ args: params.invocationArgv,
1938
+ options: event.options,
1939
+ global: params.bootstrapGlobal,
1940
+ pm_version: CLI_VERSION,
1941
+ pm_root: params.bootstrapPmRoot,
1942
+ error_code: event.errorCode,
1943
+ error_message: event.errorMessage,
1944
+ exit_code: event.exitCode,
1945
+ error_category: errorCategory,
1946
+ command_resolution: commandResolution,
1947
+ resolution_stage: event.resolutionStage,
1948
+ });
1949
+ return {
1950
+ errorCategory,
1951
+ commandResolution,
1952
+ };
1953
+ };
1954
+ }
1955
+ async function prepareExtensionServicesForRunPmCliError(params) {
1956
+ if (params.bootstrapGlobal.noExtensions) {
1957
+ return;
1958
+ }
1959
+ const bootstrapProbe = buildBootstrapActivationProbe(params.invocationArgv);
1960
+ const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(params.bootstrapPmRoot);
1961
+ if (discoverySnapshot && discoveryNeedsActivationForProbe(discoverySnapshot.discovery, bootstrapProbe)) {
1962
+ const bootstrapSnapshot = await loadRuntimeExtensionSnapshot(params.bootstrapPmRoot);
1963
+ setRecoveredExtensionServices(bootstrapSnapshot);
1964
+ return;
1965
+ }
1966
+ if (discoverySnapshot) {
1967
+ emitExtensionSkippedProfile(bootstrapProfileEnabled(params.invocationArgv), discoverySnapshot, bootstrapProbe);
1968
+ }
1969
+ setActiveExtensionServices({ overrides: [] });
1970
+ }
1971
+ function setRecoveredExtensionServices(bootstrapSnapshot) {
1972
+ if (!bootstrapSnapshot) {
1973
+ setActiveExtensionServices({ overrides: [] });
1974
+ return;
1975
+ }
1976
+ setActiveExtensionServices(bootstrapSnapshot.services);
1977
+ }
1978
+ async function finishRunPmCliFailure(params) {
1979
+ sentryFinishCommandSpan(false, params.errorMessage, {
1980
+ error_code: params.classificationCode,
1981
+ error_category: params.errorCategory,
1982
+ exit_code: params.exitCode,
1983
+ command_resolution: params.commandResolution,
1984
+ resolution_stage: params.resolutionStage,
1985
+ });
1986
+ await runAndClearAfterCommandHooks({
1987
+ ok: false,
1988
+ error: params.errorMessage,
1989
+ exit_code: params.exitCode,
1990
+ error_code: params.classificationCode,
1991
+ error_category: params.errorCategory,
1992
+ command_resolution: params.commandResolution,
1993
+ resolution_stage: params.resolutionStage,
1994
+ });
1995
+ }
1996
+ async function finishRunPmCliSuccessParse() {
1997
+ sentryFinishCommandSpan(true, undefined, {
1998
+ exit_code: EXIT_CODE.SUCCESS,
1999
+ command_resolution: "success",
2000
+ resolution_stage: "parse",
2001
+ });
2002
+ await runAndClearAfterCommandHooks({
2003
+ ok: true,
2004
+ exit_code: EXIT_CODE.SUCCESS,
2005
+ command_resolution: "success",
2006
+ resolution_stage: "parse",
2007
+ });
2008
+ process.exitCode = EXIT_CODE.SUCCESS;
2009
+ }
2010
+ async function handleRunPmCliKnownError(context, numericExitCode) {
2011
+ const hasExplicitExitCode = typeof numericExitCode === "number" && Number.isFinite(numericExitCode);
2012
+ if (!(context.error instanceof PmCliError) &&
2013
+ (isCommanderError(context.error) || !hasExplicitExitCode)) {
2014
+ return false;
2015
+ }
2016
+ const errorMessage = describeUnknownError(context.error);
2017
+ const exitCode = context.error instanceof PmCliError ? context.error.exitCode : normalizeThrownExitCode(numericExitCode);
2018
+ const rawContext = context.error instanceof PmCliError ? context.error.context : undefined;
2019
+ const enrichedContext = buildPmCliRecoveryContext(rawContext, context.invocationArgv, errorMessage);
2020
+ const classification = classifyPmCliError(errorMessage, enrichedContext);
2021
+ const renderedError = context.jsonErrors
2022
+ ? JSON.stringify(formatPmCliErrorForJson(errorMessage, exitCode, enrichedContext), null, 2)
2023
+ : formatPmCliErrorForDisplay(errorMessage, enrichedContext);
2024
+ printError(renderedError);
2025
+ const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
2026
+ command: context.attemptedCommand,
2027
+ errorCode: classification.code,
2028
+ errorMessage: classification.detail,
2029
+ exitCode,
2030
+ options: {
2031
+ bootstrap_global_options: context.bootstrapGlobal,
2032
+ },
2033
+ resolutionStage: "execute",
2034
+ });
2035
+ const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
2036
+ command: context.attemptedCommand,
2037
+ error_code: classification.code,
2038
+ error_category: errorCategory,
2039
+ exit_code: exitCode,
2040
+ error_message: classification.detail,
2041
+ command_resolution: commandResolution,
2042
+ resolution_stage: "execute",
2043
+ source_context: activeTelemetryCommandContext?.source_context,
2044
+ });
2045
+ await finishRunPmCliFailure({
2046
+ errorMessage,
2047
+ exitCode,
2048
+ classificationCode: classification.code,
2049
+ errorCategory,
2050
+ commandResolution,
2051
+ resolutionStage: "execute",
2052
+ });
2053
+ if (loggedHandledErrorToSentry) {
2054
+ sentryCaptureCliError(wrapThrownErrorForSentry(context.error, errorMessage));
2055
+ await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2056
+ }
2057
+ process.exitCode = exitCode;
2058
+ return true;
2059
+ }
2060
+ function resolveUnknownHelpToken(invocationArgv) {
2061
+ const helpRequest = parseBootstrapHelpRequest(invocationArgv);
2062
+ return helpRequest.commandPathTokens[0] ?? parseBootstrapCommandName(invocationArgv) ?? "<command>";
2063
+ }
2064
+ async function handleUnknownHelpCommandError(context, code) {
2065
+ const unknownToken = resolveUnknownHelpToken(context.invocationArgv);
2066
+ const unknownMessage = `unknown command '${unknownToken}'`;
2067
+ const recoveryCommandDescriptors = await loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(), context.bootstrapGlobal.path));
2068
+ const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, recoveryCommandDescriptors);
2069
+ const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
2070
+ unknownCommandExamples: usageContext.unknownCommandExamples,
2071
+ unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
2072
+ attemptedCommand: usageContext.attemptedCommand,
2073
+ normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
2074
+ providedOptionFlags: usageContext.providedOptionFlags,
2075
+ unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
2076
+ suggestedRetryCommand: usageContext.suggestedRetryCommand,
2077
+ });
2078
+ const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
2079
+ command: unknownToken,
2080
+ errorCode: classification.code,
2081
+ errorMessage: classification.detail,
2082
+ exitCode: EXIT_CODE.USAGE,
2083
+ options: {
2084
+ bootstrap_global_options: context.bootstrapGlobal,
2085
+ commander_code: code ?? "commander.helpDisplayed",
2086
+ },
2087
+ resolutionStage: "parse",
2088
+ });
2089
+ const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
2090
+ command: unknownToken,
2091
+ error_code: classification.code,
2092
+ error_category: errorCategory,
2093
+ exit_code: EXIT_CODE.USAGE,
2094
+ error_message: classification.detail,
2095
+ command_resolution: commandResolution,
2096
+ resolution_stage: "parse",
2097
+ source_context: activeTelemetryCommandContext?.source_context,
2098
+ });
2099
+ const renderedUsage = context.jsonErrors
2100
+ ? await formatCommanderUsageJson({ message: unknownMessage }, program, recoveryCommandDescriptors)
2101
+ : await formatCommanderUsageMessage({ message: unknownMessage }, program, recoveryCommandDescriptors);
2102
+ await finishRunPmCliFailure({
2103
+ errorMessage: unknownMessage,
2104
+ exitCode: EXIT_CODE.USAGE,
2105
+ classificationCode: classification.code,
2106
+ errorCategory,
2107
+ commandResolution,
2108
+ resolutionStage: "parse",
2109
+ });
2110
+ printError(renderedUsage);
2111
+ if (loggedHandledErrorToSentry) {
2112
+ await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2113
+ }
2114
+ process.exitCode = EXIT_CODE.USAGE;
2115
+ }
2116
+ async function handleRunPmCliHelpDisplayError(context, code, rawMessage) {
2117
+ const isHelpDisplayCode = code === "commander.helpDisplayed" || code === "commander.help" || code === "commander.helpCommand";
2118
+ if (!isHelpDisplayCode && !rawMessage.includes("(outputHelp)")) {
2119
+ return false;
2120
+ }
2121
+ const helpRequest = parseBootstrapHelpRequest(context.invocationArgv);
2122
+ if (helpRequest.requested && !isKnownHelpCommandPath(program, helpRequest.commandPathTokens)) {
2123
+ await handleUnknownHelpCommandError(context, code);
2124
+ return true;
2125
+ }
2126
+ await finishRunPmCliSuccessParse();
2127
+ return true;
2128
+ }
2129
+ async function handleRunPmCliCommanderUsageError(context, code) {
2130
+ const usageContext = await resolveCommanderUsageContext(context.error, program, activeRuntimeExtensionCommandDescriptors);
2131
+ const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
2132
+ unknownCommandExamples: usageContext.unknownCommandExamples,
2133
+ unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
2134
+ attemptedCommand: usageContext.attemptedCommand,
2135
+ normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
2136
+ providedOptionFlags: usageContext.providedOptionFlags,
2137
+ unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
2138
+ suggestedRetryCommand: usageContext.suggestedRetryCommand,
2139
+ });
2140
+ const { errorCategory, commandResolution } = await context.emitTelemetryCommandError({
2141
+ command: context.attemptedCommand,
2142
+ errorCode: classification.code,
2143
+ errorMessage: classification.detail,
2144
+ exitCode: EXIT_CODE.USAGE,
2145
+ options: {
2146
+ bootstrap_global_options: context.bootstrapGlobal,
2147
+ commander_code: code,
2148
+ },
2149
+ resolutionStage: "parse",
2150
+ });
2151
+ const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
2152
+ command: context.attemptedCommand,
2153
+ error_code: classification.code,
2154
+ error_category: errorCategory,
2155
+ exit_code: EXIT_CODE.USAGE,
2156
+ error_message: classification.detail,
2157
+ command_resolution: commandResolution,
2158
+ resolution_stage: "parse",
2159
+ source_context: activeTelemetryCommandContext?.source_context,
2160
+ });
2161
+ const renderedUsage = context.jsonErrors
2162
+ ? await formatCommanderUsageJson(context.error, program, activeRuntimeExtensionCommandDescriptors)
2163
+ : await formatCommanderUsageMessage(context.error, program, activeRuntimeExtensionCommandDescriptors);
2164
+ await finishRunPmCliFailure({
2165
+ errorMessage: usageContext.message,
2166
+ exitCode: EXIT_CODE.USAGE,
2167
+ classificationCode: classification.code,
2168
+ errorCategory,
2169
+ commandResolution,
2170
+ resolutionStage: "parse",
2171
+ });
2172
+ printError(renderedUsage);
2173
+ if (loggedHandledErrorToSentry) {
2174
+ await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2175
+ }
2176
+ process.exitCode = EXIT_CODE.USAGE;
2177
+ }
2178
+ function shouldHandleRunPmCliCommanderError(error) {
2179
+ if (typeof error !== "object" || error === null || !("code" in error)) {
2180
+ return false;
2181
+ }
2182
+ const code = error.code;
2183
+ if (typeof code === "string" && (code === "commander.version" || code.startsWith("commander."))) {
2184
+ return true;
2185
+ }
2186
+ const rawMessage = String(error.message ?? "");
2187
+ return rawMessage.includes("(outputHelp)");
2188
+ }
2189
+ async function handleRunPmCliCommanderError(context) {
2190
+ const code = context.error.code;
2191
+ const rawMessage = String(context.error.message ?? "");
2192
+ if (await handleRunPmCliHelpDisplayError(context, code, rawMessage)) {
2193
+ return;
2194
+ }
2195
+ if (code === "commander.version") {
2196
+ await finishRunPmCliSuccessParse();
2197
+ return;
2198
+ }
2199
+ await handleRunPmCliCommanderUsageError(context, code);
2200
+ }
2201
+ async function handleRunPmCliError(params) {
2202
+ const bootstrapGlobal = parseBootstrapGlobalOptions(params.invocationArgv);
2203
+ const bootstrapPmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);
2204
+ const context = {
2205
+ error: params.error,
2206
+ invocationArgv: params.invocationArgv,
2207
+ bootstrapGlobal,
2208
+ jsonErrors: bootstrapGlobal.json,
2209
+ bootstrapPmRoot,
2210
+ attemptedCommand: parseBootstrapCommandName(params.invocationArgv) ?? "<unknown>",
2211
+ emitTelemetryCommandError: createTelemetryCommandErrorEmitter({
2212
+ invocationArgv: params.invocationArgv,
2213
+ bootstrapGlobal,
2214
+ bootstrapPmRoot,
2215
+ }),
2216
+ };
2217
+ await prepareExtensionServicesForRunPmCliError({
2218
+ invocationArgv: params.invocationArgv,
2219
+ bootstrapGlobal,
2220
+ bootstrapPmRoot,
2221
+ });
2222
+ if (await handleRunPmCliKnownError(context, readThrownExitCode(params.error))) {
2223
+ return;
2224
+ }
2225
+ if (shouldHandleRunPmCliCommanderError(params.error)) {
2226
+ await handleRunPmCliCommanderError(context);
2227
+ return;
2228
+ }
2229
+ await handleGenericRunPmCliError({
2230
+ error: params.error,
2231
+ attemptedCommand: context.attemptedCommand,
2232
+ bootstrapGlobal,
2233
+ emitTelemetryCommandError: context.emitTelemetryCommandError,
2234
+ });
2235
+ }
1864
2236
  /**
1865
2237
  * Implements run pm cli for the public runtime surface of this module.
1866
2238
  */
@@ -1900,286 +2272,7 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
1900
2272
  await program.parseAsync(invocationProcessArgv);
1901
2273
  }
1902
2274
  catch (error) {
1903
- /* c8 ignore start */
1904
- const bootstrapGlobal = parseBootstrapGlobalOptions(invocationArgv);
1905
- const jsonErrors = bootstrapGlobal.json;
1906
- const bootstrapPmRoot = resolvePmRoot(process.cwd(), bootstrapGlobal.path);
1907
- const attemptedCommand = parseBootstrapCommandName(invocationArgv) ?? "<unknown>";
1908
- const emitTelemetryCommandError = async (params) => {
1909
- const errorCategory = resolveTelemetryErrorCategory(params.errorCode);
1910
- const commandResolution = deriveTelemetryCommandResolution({
1911
- ok: false,
1912
- errorCode: params.errorCode,
1913
- errorCategory,
1914
- });
1915
- await emitTelemetryErrorEvent({
1916
- command: params.command,
1917
- args: invocationArgv,
1918
- options: params.options,
1919
- global: bootstrapGlobal,
1920
- pm_version: CLI_VERSION,
1921
- pm_root: bootstrapPmRoot,
1922
- error_code: params.errorCode,
1923
- error_message: params.errorMessage,
1924
- exit_code: params.exitCode,
1925
- error_category: errorCategory,
1926
- command_resolution: commandResolution,
1927
- resolution_stage: params.resolutionStage,
1928
- });
1929
- return {
1930
- errorCategory,
1931
- commandResolution,
1932
- };
1933
- };
1934
- if (!bootstrapGlobal.noExtensions) {
1935
- const bootstrapProbe = buildBootstrapActivationProbe(invocationArgv);
1936
- const discoverySnapshot = await loadRuntimeExtensionDiscoverySnapshot(bootstrapPmRoot);
1937
- if (discoverySnapshot && discoveryNeedsActivationForProbe(discoverySnapshot.discovery, bootstrapProbe)) {
1938
- const bootstrapSnapshot = await loadRuntimeExtensionSnapshot(bootstrapPmRoot);
1939
- /* c8 ignore next */
1940
- setActiveExtensionServices(bootstrapSnapshot?.services ?? { overrides: [] });
1941
- }
1942
- else {
1943
- /* c8 ignore next */
1944
- if (discoverySnapshot) {
1945
- emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv), discoverySnapshot, bootstrapProbe);
1946
- }
1947
- setActiveExtensionServices({ overrides: [] });
1948
- }
1949
- }
1950
- const numericExitCode = readThrownExitCode(error);
1951
- if (error instanceof PmCliError ||
1952
- (!isCommanderError(error) && typeof numericExitCode === "number" && Number.isFinite(numericExitCode))) {
1953
- const errorMessage = describeUnknownError(error);
1954
- const exitCode = error instanceof PmCliError ? error.exitCode : normalizeThrownExitCode(numericExitCode);
1955
- const context = error instanceof PmCliError ? error.context : undefined;
1956
- const enrichedContext = buildPmCliRecoveryContext(context, invocationArgv, errorMessage);
1957
- const classification = classifyPmCliError(errorMessage, enrichedContext);
1958
- const renderedError = jsonErrors
1959
- ? JSON.stringify(formatPmCliErrorForJson(errorMessage, exitCode, enrichedContext), null, 2)
1960
- : formatPmCliErrorForDisplay(errorMessage, enrichedContext);
1961
- printError(renderedError);
1962
- const { errorCategory, commandResolution } = await emitTelemetryCommandError({
1963
- command: attemptedCommand,
1964
- errorCode: classification.code,
1965
- errorMessage: classification.detail,
1966
- exitCode,
1967
- options: {
1968
- bootstrap_global_options: bootstrapGlobal,
1969
- },
1970
- resolutionStage: "execute",
1971
- });
1972
- const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
1973
- command: attemptedCommand,
1974
- error_code: classification.code,
1975
- error_category: errorCategory,
1976
- exit_code: exitCode,
1977
- error_message: classification.detail,
1978
- command_resolution: commandResolution,
1979
- resolution_stage: "execute",
1980
- source_context: activeTelemetryCommandContext?.source_context,
1981
- });
1982
- sentryFinishCommandSpan(false, errorMessage, {
1983
- error_code: classification.code,
1984
- error_category: errorCategory,
1985
- exit_code: exitCode,
1986
- command_resolution: commandResolution,
1987
- resolution_stage: "execute",
1988
- });
1989
- await runAndClearAfterCommandHooks({
1990
- ok: false,
1991
- error: errorMessage,
1992
- exit_code: exitCode,
1993
- error_code: classification.code,
1994
- error_category: errorCategory,
1995
- command_resolution: commandResolution,
1996
- resolution_stage: "execute",
1997
- });
1998
- if (loggedHandledErrorToSentry) {
1999
- sentryCaptureCliError(wrapThrownErrorForSentry(error, errorMessage));
2000
- }
2001
- if (loggedHandledErrorToSentry) {
2002
- await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2003
- }
2004
- process.exitCode = exitCode;
2005
- return;
2006
- }
2007
- if (typeof error === "object" && error !== null && "code" in error) {
2008
- const code = error.code;
2009
- /* c8 ignore next */
2010
- const rawMessage = typeof error.message === "string" ? (error.message ?? "") : "";
2011
- const isHelpDisplayCode = code === "commander.helpDisplayed" || code === "commander.help" || code === "commander.helpCommand";
2012
- if (isHelpDisplayCode || rawMessage.includes("(outputHelp)")) {
2013
- const helpRequest = parseBootstrapHelpRequest(invocationArgv);
2014
- if (helpRequest.requested && !isKnownHelpCommandPath(program, helpRequest.commandPathTokens)) {
2015
- /* c8 ignore next */
2016
- const unknownToken = helpRequest.commandPathTokens[0] ?? parseBootstrapCommandName(invocationArgv) ?? "<command>";
2017
- const unknownMessage = `unknown command '${unknownToken}'`;
2018
- const recoveryCommandDescriptors = await loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(), bootstrapGlobal.path));
2019
- const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, recoveryCommandDescriptors);
2020
- const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
2021
- unknownCommandExamples: usageContext.unknownCommandExamples,
2022
- unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
2023
- attemptedCommand: usageContext.attemptedCommand,
2024
- normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
2025
- providedOptionFlags: usageContext.providedOptionFlags,
2026
- unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
2027
- suggestedRetryCommand: usageContext.suggestedRetryCommand,
2028
- });
2029
- const { errorCategory, commandResolution } = await emitTelemetryCommandError({
2030
- command: unknownToken,
2031
- errorCode: classification.code,
2032
- errorMessage: classification.detail,
2033
- exitCode: EXIT_CODE.USAGE,
2034
- options: {
2035
- bootstrap_global_options: bootstrapGlobal,
2036
- commander_code: code ?? "commander.helpDisplayed",
2037
- },
2038
- resolutionStage: "parse",
2039
- });
2040
- const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
2041
- command: unknownToken,
2042
- error_code: classification.code,
2043
- error_category: errorCategory,
2044
- exit_code: EXIT_CODE.USAGE,
2045
- error_message: classification.detail,
2046
- command_resolution: commandResolution,
2047
- resolution_stage: "parse",
2048
- source_context: activeTelemetryCommandContext?.source_context,
2049
- });
2050
- const renderedUsage = jsonErrors
2051
- ? await formatCommanderUsageJson({ message: unknownMessage }, program, recoveryCommandDescriptors)
2052
- : await formatCommanderUsageMessage({ message: unknownMessage }, program, recoveryCommandDescriptors);
2053
- sentryFinishCommandSpan(false, unknownMessage, {
2054
- error_code: classification.code,
2055
- error_category: errorCategory,
2056
- exit_code: EXIT_CODE.USAGE,
2057
- command_resolution: commandResolution,
2058
- resolution_stage: "parse",
2059
- });
2060
- await runAndClearAfterCommandHooks({
2061
- ok: false,
2062
- error: unknownMessage,
2063
- exit_code: EXIT_CODE.USAGE,
2064
- error_code: classification.code,
2065
- error_category: errorCategory,
2066
- command_resolution: commandResolution,
2067
- resolution_stage: "parse",
2068
- });
2069
- if (jsonErrors) {
2070
- printError(renderedUsage);
2071
- }
2072
- else {
2073
- printError(renderedUsage);
2074
- }
2075
- if (loggedHandledErrorToSentry) {
2076
- await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2077
- }
2078
- process.exitCode = EXIT_CODE.USAGE;
2079
- return;
2080
- }
2081
- sentryFinishCommandSpan(true, undefined, {
2082
- exit_code: EXIT_CODE.SUCCESS,
2083
- command_resolution: "success",
2084
- resolution_stage: "parse",
2085
- });
2086
- await runAndClearAfterCommandHooks({
2087
- ok: true,
2088
- exit_code: EXIT_CODE.SUCCESS,
2089
- command_resolution: "success",
2090
- resolution_stage: "parse",
2091
- });
2092
- process.exitCode = EXIT_CODE.SUCCESS;
2093
- return;
2094
- }
2095
- if (code === "commander.version") {
2096
- sentryFinishCommandSpan(true, undefined, {
2097
- exit_code: EXIT_CODE.SUCCESS,
2098
- command_resolution: "success",
2099
- resolution_stage: "parse",
2100
- });
2101
- await runAndClearAfterCommandHooks({
2102
- ok: true,
2103
- exit_code: EXIT_CODE.SUCCESS,
2104
- command_resolution: "success",
2105
- resolution_stage: "parse",
2106
- });
2107
- process.exitCode = EXIT_CODE.SUCCESS;
2108
- return;
2109
- }
2110
- /* c8 ignore next */
2111
- if (code?.startsWith("commander.")) {
2112
- const usageContext = await resolveCommanderUsageContext(error, program, activeRuntimeExtensionCommandDescriptors);
2113
- const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
2114
- unknownCommandExamples: usageContext.unknownCommandExamples,
2115
- unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
2116
- attemptedCommand: usageContext.attemptedCommand,
2117
- normalizedInvocationArgs: usageContext.normalizedInvocationArgs,
2118
- providedOptionFlags: usageContext.providedOptionFlags,
2119
- unknownOptionSuggestions: usageContext.unknownOptionSuggestions,
2120
- suggestedRetryCommand: usageContext.suggestedRetryCommand,
2121
- });
2122
- const { errorCategory, commandResolution } = await emitTelemetryCommandError({
2123
- command: attemptedCommand,
2124
- errorCode: classification.code,
2125
- errorMessage: classification.detail,
2126
- exitCode: EXIT_CODE.USAGE,
2127
- options: {
2128
- bootstrap_global_options: bootstrapGlobal,
2129
- commander_code: code,
2130
- },
2131
- resolutionStage: "parse",
2132
- });
2133
- const loggedHandledErrorToSentry = await maybeLogHandledCliErrorToSentry({
2134
- command: attemptedCommand,
2135
- error_code: classification.code,
2136
- error_category: errorCategory,
2137
- exit_code: EXIT_CODE.USAGE,
2138
- error_message: classification.detail,
2139
- command_resolution: commandResolution,
2140
- resolution_stage: "parse",
2141
- source_context: activeTelemetryCommandContext?.source_context,
2142
- });
2143
- const renderedUsage = jsonErrors
2144
- ? await formatCommanderUsageJson(error, program, activeRuntimeExtensionCommandDescriptors)
2145
- : await formatCommanderUsageMessage(error, program, activeRuntimeExtensionCommandDescriptors);
2146
- sentryFinishCommandSpan(false, usageContext.message, {
2147
- error_code: classification.code,
2148
- error_category: errorCategory,
2149
- exit_code: EXIT_CODE.USAGE,
2150
- command_resolution: commandResolution,
2151
- resolution_stage: "parse",
2152
- });
2153
- await runAndClearAfterCommandHooks({
2154
- ok: false,
2155
- error: usageContext.message,
2156
- exit_code: EXIT_CODE.USAGE,
2157
- error_code: classification.code,
2158
- error_category: errorCategory,
2159
- command_resolution: commandResolution,
2160
- resolution_stage: "parse",
2161
- });
2162
- if (jsonErrors) {
2163
- printError(renderedUsage);
2164
- }
2165
- else {
2166
- printError(renderedUsage);
2167
- }
2168
- if (loggedHandledErrorToSentry) {
2169
- await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS);
2170
- }
2171
- process.exitCode = EXIT_CODE.USAGE;
2172
- return;
2173
- }
2174
- }
2175
- /* c8 ignore next */
2176
- await handleGenericRunPmCliError({
2177
- error,
2178
- attemptedCommand,
2179
- bootstrapGlobal,
2180
- emitTelemetryCommandError,
2181
- });
2182
- /* c8 ignore stop */
2275
+ await handleRunPmCliError({ error, invocationArgv });
2183
2276
  }
2184
2277
  }
2185
2278
  export const _testOnly = {
@@ -2218,6 +2311,12 @@ export const _testOnly = {
2218
2311
  extensionProvidesTemplatesRuntime,
2219
2312
  hasAnyCapability,
2220
2313
  handleGenericRunPmCliError,
2314
+ handleRunPmCliCommanderError,
2315
+ handleRunPmCliError,
2316
+ handleRunPmCliHelpDisplayError,
2317
+ handleRunPmCliKnownError,
2318
+ handleRunPmCliCommanderUsageError,
2319
+ handleUnknownHelpCommandError,
2221
2320
  inferMissingFieldsFromErrorMessage,
2222
2321
  inferPostActionErrorCode,
2223
2322
  inferPostActionFailureMessage,
@@ -2234,12 +2333,14 @@ export const _testOnly = {
2234
2333
  normalizeTelemetryResolutionStage,
2235
2334
  normalizeThrownExitCode,
2236
2335
  probeUsesAnyFlag,
2336
+ prepareExtensionServicesForRunPmCliError,
2237
2337
  readRecordBoolean,
2238
2338
  readRecordNumber,
2239
2339
  readRecordString,
2240
2340
  registerDynamicExtensionCommandPaths,
2241
2341
  registerRuntimeSchemaFieldFlags,
2242
2342
  resolveCoreCommandRegistrationSelection,
2343
+ resolveUnknownHelpToken,
2243
2344
  readThrownExitCode,
2244
2345
  runAndClearAfterCommandHooks,
2245
2346
  runRequiredExtensionCommand,
@@ -2247,8 +2348,10 @@ export const _testOnly = {
2247
2348
  shouldLogHandledErrorToSentry,
2248
2349
  shouldRegisterDynamicExtensionPaths,
2249
2350
  shouldRegisterRuntimeSchemaFlags,
2351
+ shouldHandleRunPmCliCommanderError,
2250
2352
  setActiveExtensionHookContextForTest,
2251
2353
  setActiveRuntimeExtensionCommandDescriptorsForTest,
2354
+ setRecoveredExtensionServices,
2252
2355
  toLooseFieldDefinitionType,
2253
2356
  isImporterOrExporterCommandPath,
2254
2357
  validateDynamicExtensionCommandInvocation,
@@ -2256,4 +2359,4 @@ export const _testOnly = {
2256
2359
  wrapThrownErrorForSentry,
2257
2360
  };
2258
2361
  //# sourceMappingURL=main.js.map
2259
- //# debugId=9f13a662-73c4-5ffa-99bc-4edee2b7a7fb
2362
+ //# debugId=aa682568-77f6-5659-a6dd-3a69dd4e1fc0