@unbrained/pm-cli 2026.6.30 → 2026.7.2

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 (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"error-guidance.js","sources":["cli/error-guidance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/error-guidance\n *\n * Provides CLI runtime support for Error Guidance.\n */\nimport type { PmCliErrorContext, PmCliErrorRecoveryPayload } from \"../core/shared/errors.js\";\nimport { renderPmCommand } from \"./argv-utils.js\";\n\ninterface GuidanceMessage {\n code: string;\n type: string;\n title: string;\n happened: string;\n required: string;\n why?: string;\n examples?: string[];\n nextSteps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the json error envelope payload exchanged by command, SDK, and package integrations.\n */\nexport interface JsonErrorEnvelope {\n type: string;\n code: string;\n title: string;\n detail: string;\n required: string;\n exit_code: number;\n why?: string;\n examples?: string[];\n next_steps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the error classification payload exchanged by command, SDK, and package integrations.\n */\nexport interface ErrorClassification {\n type: string;\n code: string;\n title: string;\n detail: string;\n required: string;\n why?: string;\n examples?: string[];\n next_steps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the commander guidance context payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommanderGuidanceContext {\n unknownCommandExamples?: string[];\n unknownCommandNextSteps?: string[];\n attemptedCommand?: string;\n normalizedInvocationArgs?: string[];\n providedOptionFlags?: string[];\n unknownOptionSuggestions?: string[];\n unknownOptionOtherCommands?: string[];\n suggestedRetryCommand?: string;\n}\n\n// JSON/classification payloads are consumed heavily by agents; suppress common\n// boilerplate rationale text there to reduce token overhead. Human display\n// guidance still renders \"Why\" unchanged.\nconst STRUCTURED_WHY_SUPPRESSION_CODES = new Set<string>([\n \"unknown_command\",\n \"unknown_option\",\n \"missing_required_option\",\n \"missing_required_argument\",\n \"invalid_argument_value\",\n \"invalid_command_usage\",\n \"command_failed\",\n]);\n\nfunction includeWhyInStructuredGuidance(message: GuidanceMessage): boolean {\n if (!message.why) {\n return false;\n }\n if (message.recovery?.recovery_mode === \"compact\") {\n return false;\n }\n return !STRUCTURED_WHY_SUPPRESSION_CODES.has(message.code);\n}\n\nfunction errorType(code: string): string {\n return `urn:pm-cli:error:${code}`;\n}\n\nfunction makeGuidanceMessage(params: Omit<GuidanceMessage, \"type\">): GuidanceMessage {\n return {\n ...params,\n type: errorType(params.code),\n };\n}\n\ninterface PackageCommandHint {\n /** Published package name shown to the user (e.g. @unbrained/pm-guide-shell). */\n packageName: string;\n /** Exact CLI command that installs the bundled package by its install alias. */\n installCommand: string;\n}\n\n// Catalog of command tokens that are provided by optional first-party packages\n// rather than core. When an unknown-command error names one of these, we surface\n// a concrete install hint so agents/humans aren't left guessing. The install\n// command uses the bundled alias accepted by `pm install <alias>` (see\n// packages/pm-*/package.json `pm.aliases` and extension.ts install_command).\nconst KNOWN_PACKAGE_COMMAND_HINTS: Readonly<Record<string, PackageCommandHint>> = {\n guide: { packageName: \"@unbrained/pm-guide-shell\", installCommand: \"pm install guide-shell\" },\n templates: { packageName: \"@unbrained/pm-templates\", installCommand: \"pm install templates\" },\n calendar: { packageName: \"@unbrained/pm-calendar\", installCommand: \"pm install calendar\" },\n cal: { packageName: \"@unbrained/pm-calendar\", installCommand: \"pm install calendar\" },\n};\n\nfunction resolveKnownPackageCommandHint(commandToken: string): PackageCommandHint | undefined {\n const primary = commandToken.trim().split(/\\s+/)[0]?.toLowerCase();\n if (!primary) {\n return undefined;\n }\n return KNOWN_PACKAGE_COMMAND_HINTS[primary];\n}\n\nfunction renderList(title: string, entries: string[]): string[] {\n if (entries.length === 0) {\n return [];\n }\n return [title, ...entries.map((entry) => ` - ${entry}`)];\n}\n\nfunction normalizeRecoveryPayload(payload: PmCliErrorRecoveryPayload | undefined): PmCliErrorRecoveryPayload | undefined {\n if (!payload || typeof payload !== \"object\") {\n return undefined;\n }\n const normalizeStringArray = (values: unknown): string[] | undefined => {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values\n .filter((entry): entry is string => typeof entry === \"string\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n };\n const normalized: PmCliErrorRecoveryPayload = {};\n if (payload.recovery_mode === \"compact\") {\n normalized.recovery_mode = \"compact\";\n }\n if (typeof payload.attempted_command === \"string\" && payload.attempted_command.trim().length > 0) {\n normalized.attempted_command = payload.attempted_command.trim();\n }\n if (Array.isArray(payload.normalized_args)) {\n const args = payload.normalized_args.map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n if (args.length > 0) {\n normalized.normalized_args = args;\n }\n }\n if (Array.isArray(payload.provided_fields)) {\n const fields = payload.provided_fields.map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n if (fields.length > 0) {\n normalized.provided_fields = fields;\n }\n }\n if (Array.isArray(payload.missing)) {\n const missing = payload.missing.map((entry) => entry.trim()).filter((entry) => entry.length > 0);\n if (missing.length > 0) {\n normalized.missing = missing;\n }\n }\n const missingRequiredFields = normalizeStringArray(payload.missing_required_fields);\n if (missingRequiredFields) {\n normalized.missing_required_fields = missingRequiredFields;\n }\n const suggestedFlags = normalizeStringArray(payload.suggested_flags);\n if (suggestedFlags) {\n normalized.suggested_flags = suggestedFlags;\n }\n if (typeof payload.suggested_retry === \"string\" && payload.suggested_retry.trim().length > 0) {\n normalized.suggested_retry = payload.suggested_retry.trim();\n }\n if (Array.isArray(payload.fallback_candidates)) {\n const fallbackCandidates = payload.fallback_candidates\n .map((entry) => ({\n source: typeof entry?.source === \"string\" ? entry.source.trim() : \"\",\n command: typeof entry?.command === \"string\" ? entry.command.trim() : \"\",\n reason: typeof entry?.reason === \"string\" ? entry.reason.trim() : \"\",\n }))\n .filter((entry) => entry.source.length > 0 && entry.command.length > 0 && entry.reason.length > 0);\n if (fallbackCandidates.length > 0) {\n normalized.fallback_candidates = fallbackCandidates;\n }\n }\n if (typeof payload.next_best_command === \"string\" && payload.next_best_command.trim().length > 0) {\n normalized.next_best_command = payload.next_best_command.trim();\n }\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n}\n\nfunction renderRecoveryBundle(recovery: PmCliErrorRecoveryPayload | undefined): string[] {\n const normalized = normalizeRecoveryPayload(recovery);\n if (!normalized) {\n return [];\n }\n const lines = [\"Recovery bundle:\"];\n if (normalized.attempted_command) {\n lines.push(` attempted_command: ${normalized.attempted_command}`);\n }\n if (normalized.normalized_args && normalized.normalized_args.length > 0) {\n lines.push(` normalized_args: ${normalized.normalized_args.join(\" \")}`);\n }\n if (normalized.provided_fields && normalized.provided_fields.length > 0) {\n lines.push(` provided_fields: ${normalized.provided_fields.join(\", \")}`);\n }\n if (normalized.missing && normalized.missing.length > 0) {\n lines.push(` missing: ${normalized.missing.join(\", \")}`);\n }\n if (normalized.missing_required_fields && normalized.missing_required_fields.length > 0) {\n lines.push(` missing_required_fields: ${normalized.missing_required_fields.join(\", \")}`);\n }\n if (normalized.suggested_flags && normalized.suggested_flags.length > 0) {\n lines.push(` suggested_flags: ${normalized.suggested_flags.join(\", \")}`);\n }\n if (normalized.suggested_retry) {\n lines.push(` suggested_retry: ${normalized.suggested_retry}`);\n }\n if (normalized.next_best_command) {\n lines.push(` next_best_command: ${normalized.next_best_command}`);\n }\n if (normalized.fallback_candidates && normalized.fallback_candidates.length > 0) {\n lines.push(\" fallback_candidates:\");\n for (const candidate of normalized.fallback_candidates) {\n lines.push(` - ${candidate.source}: ${candidate.command} (${candidate.reason})`);\n }\n }\n return lines;\n}\n\n/**\n * Implements render guidance message for the public runtime surface of this module.\n */\nexport function renderGuidanceMessage(message: GuidanceMessage): string {\n const lines: string[] = [\n `Error: ${message.title}`,\n \"\",\n \"What happened:\",\n ` ${message.happened}`,\n \"\",\n \"What is required:\",\n ` ${message.required}`,\n ];\n if (message.why) {\n lines.push(\"\", \"Why:\");\n lines.push(` ${message.why}`);\n }\n if (message.examples && message.examples.length > 0) {\n lines.push(\"\");\n lines.push(...renderList(\"Examples:\", message.examples));\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n lines.push(\"\");\n lines.push(...renderList(\"Next steps:\", message.nextSteps));\n }\n const recoveryLines = renderRecoveryBundle(message.recovery);\n if (recoveryLines.length > 0) {\n lines.push(\"\");\n lines.push(...recoveryLines);\n }\n return lines.join(\"\\n\");\n}\n\nfunction guidanceToJsonEnvelope(message: GuidanceMessage, exitCode: number): JsonErrorEnvelope {\n const payload: JsonErrorEnvelope = {\n type: message.type,\n code: message.code,\n title: message.title,\n detail: message.happened,\n required: message.required,\n exit_code: exitCode,\n };\n if (includeWhyInStructuredGuidance(message)) {\n payload.why = message.why;\n }\n if (message.examples && message.examples.length > 0) {\n payload.examples = message.examples;\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n payload.next_steps = message.nextSteps;\n }\n if (message.recovery) {\n payload.recovery = message.recovery;\n }\n return payload;\n}\n\nfunction guidanceToClassification(message: GuidanceMessage): ErrorClassification {\n const payload: ErrorClassification = {\n type: message.type,\n code: message.code,\n title: message.title,\n detail: message.happened,\n required: message.required,\n };\n if (includeWhyInStructuredGuidance(message)) {\n payload.why = message.why;\n }\n if (message.examples && message.examples.length > 0) {\n payload.examples = message.examples;\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n payload.next_steps = message.nextSteps;\n }\n if (message.recovery) {\n payload.recovery = message.recovery;\n }\n return payload;\n}\n\nfunction normalizeMessage(message: string): string {\n return message.replace(/\\(outputHelp\\)/g, \"\").trim();\n}\n\nfunction isModuleResolutionErrorMessage(message: string): boolean {\n const normalized = message.toLowerCase();\n return (\n normalized.includes(\"cannot find module\") ||\n normalized.includes(\"cannot find package\") ||\n normalized.includes(\"err_module_not_found\") ||\n normalized.includes(\"module_not_found\")\n );\n}\n\nfunction normalizeContextList(values: string[] | undefined): string[] | undefined {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n if (seen.has(value)) {\n continue;\n }\n seen.add(value);\n result.push(value);\n }\n return result;\n}\n\nfunction inferCommandNameFromRecovery(recovery: PmCliErrorRecoveryPayload | undefined): string | undefined {\n const args = recovery?.normalized_args;\n if (!Array.isArray(args) || args.length === 0) {\n return undefined;\n }\n const firstCommandArg = args.find((arg) => arg.trim().length > 0 && !arg.startsWith(\"-\"));\n return firstCommandArg?.trim();\n}\n\nfunction inferAllowedValuesFromMessage(message: string): string[] {\n const match = message.match(/\\bmust be one of:?\\s+([A-Za-z0-9_.|,\\- ]+)/i);\n if (!match) {\n return [];\n }\n return match[1]\n .split(/[|,]/)\n .map((entry) => entry.trim())\n .filter((entry) => /^[A-Za-z0-9_.-]+$/.test(entry));\n}\n\nfunction buildAllowedValueRetryCommand(recovery: PmCliErrorRecoveryPayload | undefined, allowedValues: string[]): string | undefined {\n const args = recovery?.normalized_args;\n const fields = recovery?.provided_fields;\n const replacement = allowedValues[0];\n if (!Array.isArray(args) || !Array.isArray(fields) || !replacement) {\n return undefined;\n }\n for (const field of fields) {\n const index = args.findIndex((arg) => arg === field);\n if (index >= 0 && index < args.length - 1 && !args[index + 1]?.startsWith(\"-\")) {\n const nextArgs = [...args];\n nextArgs[index + 1] = replacement;\n return renderPmCommand(nextArgs);\n }\n }\n return undefined;\n}\n\nfunction buildFallbackTitleFromMessage(message: string): string | undefined {\n const firstLine = message.split(/\\r?\\n/)[0].trim();\n if (firstLine.length === 0) {\n return undefined;\n }\n if (firstLine.length <= 120) {\n return firstLine;\n }\n return `${firstLine.slice(0, 117)}...`;\n}\n\nfunction applyPmCliErrorContext(\n guidance: GuidanceMessage,\n rawMessage: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage {\n if (!context) {\n return guidance;\n }\n const normalizedRawMessage = normalizeMessage(rawMessage);\n const code = typeof context.code === \"string\" && context.code.trim().length > 0 ? context.code.trim() : guidance.code;\n const type = typeof context.type === \"string\" && context.type.trim().length > 0 ? context.type.trim() : errorType(code);\n const examples = normalizeContextList(context.examples) ?? guidance.examples;\n const nextSteps = normalizeContextList(context.nextSteps) ?? guidance.nextSteps;\n const fallbackTitle = guidance.code === \"command_failed\" && context.code ? buildFallbackTitleFromMessage(normalizedRawMessage) : undefined;\n const recovery = normalizeRecoveryPayload(context.recovery) ?? guidance.recovery;\n return {\n ...guidance,\n code,\n type,\n title: fallbackTitle ?? guidance.title,\n happened: normalizedRawMessage.length > 0 ? normalizedRawMessage : guidance.happened,\n required: typeof context.required === \"string\" && context.required.trim().length > 0 ? context.required.trim() : guidance.required,\n why: typeof context.why === \"string\" && context.why.trim().length > 0 ? context.why.trim() : guidance.why,\n examples,\n nextSteps,\n recovery,\n };\n}\n\nfunction buildPmCliErrorGuidance(rawMessage: string, context?: PmCliErrorContext): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n\n const trackerNotInitialized = message.match(/^Tracker is not initialized at (.+)\\. Run pm init first\\.$/);\n if (trackerNotInitialized) {\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"tracker_not_initialized\",\n title: \"Tracker is not initialized\",\n happened: `pm data path does not contain initialized tracker metadata (${trackerNotInitialized[1]}).`,\n required: \"Initialize tracker storage before running this command.\",\n why: \"Most commands require settings and tracker directories created by pm init.\",\n examples: [\"pm init\", \"pm init acme\"],\n nextSteps: ['Run \"pm init\", then rerun your original command.'],\n }),\n rawMessage,\n context,\n );\n }\n\n const itemNotFound = message.match(/^Item ([^ ]+) not found$/);\n if (itemNotFound) {\n const badId = itemNotFound[1];\n const isPlaceholder = /^(undefined|null|<.*>|\\[.*\\]|{.*}|)$/.test(badId);\n const happened = isPlaceholder\n ? `The item ID \"${badId}\" looks like a placeholder or unresolved variable. Ensure the ID argument is resolved before calling pm.`\n : `No item with id \"${badId}\" exists in the active tracker scope.`;\n const nextSteps = isPlaceholder\n ? [\n \"Check that the variable holding the item ID is defined before passing it to pm.\",\n 'Use \"pm list-open --limit 20\" to find valid IDs.',\n ]\n : [\"Confirm the active --path/PM_PATH scope, then retry with a valid id.\"];\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"item_not_found\",\n title: \"Item ID not found\",\n happened,\n required: \"Use an existing item ID from current tracker data.\",\n why: \"Mutation and read commands operate only on known IDs.\",\n examples: ['pm list-open --limit 20', 'pm search \"<keyword>\" --limit 10'],\n nextSteps,\n }),\n rawMessage,\n context,\n );\n }\n\n if (message.includes(\"is assigned to\") && message.includes(\"Use --force to override\")) {\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"ownership_conflict\",\n title: \"Ownership conflict\",\n happened: message,\n required:\n \"Run as assigned owner, use audit flags for safe non-owner updates, or use --force only for approved override scenarios.\",\n why: \"Ownership checks prevent accidental concurrent mutations on claimed items and protect against conflicting writes.\",\n examples: [\n 'pm update pm-a1b2 --allow-audit-update --description \"...\" --author \"audit-agent\"',\n 'pm update pm-a1b2 --allow-audit-dep-update --dep \"...\" --author \"audit-agent\"',\n 'pm comments pm-a1b2 \"...\" --allow-audit-comment --author \"audit-agent\"',\n 'pm claim pm-a1b2 --author \"codex-agent\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\"',\n 'pm update pm-a1b2 --status in_progress --force',\n ],\n nextSteps: [\n \"Use --allow-audit-update for metadata-only non-owner updates (excludes lifecycle/ownership fields).\",\n \"Use --allow-audit-dep-update for dependency-only non-owner additions.\",\n \"Use --allow-audit-comment on comments/notes/learnings for append-only audit entries.\",\n \"Use --force for PM audits and systematic metadata updates performed by leads/maintainers.\",\n \"Use --force when correcting known stale metadata after coordinating ownership changes.\",\n 'For non-terminal reassignment, prefer \"pm claim <ID> --author <you>\" before running other mutations.',\n 'For assignee handoff release workflows, prefer \"pm release <ID> --allow-audit-release --author <you>\" before using --force.',\n ],\n }),\n rawMessage,\n context,\n );\n }\n\n if (message.includes(\"is locked\")) {\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"lock_conflict\",\n title: \"Lock conflict\",\n happened: message,\n required: \"Wait for lock release, or use --force where supported if lock is stale and safe to override.\",\n why: \"Locking protects item files from concurrent write races.\",\n examples: ['pm update pm-a1b2 --status in_progress --force --author \"codex-agent\"'],\n }),\n rawMessage,\n context,\n );\n }\n\n const missingRequiredOption = message.match(/^Missing required option /);\n const missingRequiredOptions = message.match(/^Missing required options /);\n if (missingRequiredOption || missingRequiredOptions) {\n const plural = Boolean(missingRequiredOptions);\n const missingOptionFlag = !plural ? message.replace(/^Missing required option\\s+/, \"\").trim() : null;\n const missingOptionLabel = missingOptionFlag ?? \"\";\n const missingOptionRequired = missingOptionFlag\n ? `Pass ${missingOptionFlag} with a valid value before running the command.`\n : \"Provide the required option for this command invocation.\";\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"missing_required_option\",\n title: plural ? \"Missing required options\" : `Missing required option ${missingOptionLabel}`,\n happened: message,\n required: plural\n ? \"Provide every required option for this command invocation.\"\n : missingOptionRequired,\n why: \"Required options define command intent and enforce deterministic write contracts.\",\n examples: [\n 'pm create --title \"Task title\" --description \"Task details\" --type Task --create-mode progressive',\n 'pm create --title \"Task title\" --description \"Task details\" --type Task --status open --priority 1 --message \"Create task\" --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this task exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/example.ts,scope=project\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project\"',\n ],\n nextSteps: [\n 'Run \"pm <command> --help\" to view required and recommended flags.',\n \"For staged triage without placeholder linkage values, use --create-mode progressive.\",\n ],\n }),\n rawMessage,\n context,\n );\n }\n\n if (message.startsWith(\"No update flags provided\")) {\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"no_update_fields\",\n title: \"No update fields supplied\",\n happened: \"The update command was called without any field-changing flags.\",\n required:\n \"Provide at least one field-changing flag such as --status, --priority, --title, --tags, --description, or --body. Use --message only to label a real mutation.\",\n why: \"pm update mutates existing item fields; no-op invocations are rejected to avoid ambiguous history.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --description \"Clarified implementation scope\" --message \"Clarify task intent\"',\n 'pm append pm-a1b2 --body \"Detailed progress notes\" --message \"Append progress notes\"',\n ],\n nextSteps: [\n \"Choose the item field you intend to change, then pair that change with --message for history context.\",\n \"Use pm comments, pm notes, pm learnings, or pm append when you only need to add narrative context.\",\n ],\n }),\n rawMessage,\n context,\n );\n }\n\n if (message.startsWith(\"Invalid \") || message.includes(\" must be \") || message.includes(\" requires \")) {\n const recovery = normalizeRecoveryPayload(context?.recovery);\n const commandName = inferCommandNameFromRecovery(recovery);\n const helpExample = commandName ? `pm ${commandName} --help` : \"pm <command> --help\";\n const allowedValues = inferAllowedValuesFromMessage(message);\n const retryExample = buildAllowedValueRetryCommand(recovery, allowedValues);\n const examples = retryExample ? [retryExample, helpExample] : [helpExample, \"pm contracts --command <command> --flags-only --json\"];\n const nextSteps = allowedValues.length > 0\n ? [`Allowed values: ${allowedValues.join(\"|\")}`, `Run \"${helpExample}\" to confirm command-specific constraints.`]\n : [\"Check allowed values in command help, then rerun with corrected input.\"];\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"invalid_argument_value\",\n title: \"Invalid argument value\",\n happened: message,\n required: \"Use values that match documented command constraints.\",\n why: \"Validation protects data consistency and deterministic behavior across commands.\",\n examples,\n nextSteps,\n }),\n rawMessage,\n context,\n );\n }\n\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"command_failed\",\n title: \"Command failed\",\n happened: message,\n required: \"Adjust command input or tracker state and retry.\",\n why: \"pm enforces explicit, deterministic contracts for data and command semantics.\",\n examples: [\"pm --help\", \"pm <command> --help\"],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction commandExampleForRequiredOption(commandName: string | undefined, optionFlag: string, allowedTypes: string): string[] {\n if (commandName === \"create\" && optionFlag.startsWith(\"--type\")) {\n const firstAllowed = allowedTypes.split(\"|\")[0] || \"Task\";\n return [\n `pm create --title \"Example title\" --description \"Example description\" --type ${firstAllowed} --status open --priority 1 --message \"Create item\" --create-mode progressive`,\n ];\n }\n if (commandName === \"update\") {\n return ['pm update pm-a1b2 --status in_progress --message \"Start implementation\"'];\n }\n return [`pm ${commandName ?? \"<command>\"} --help`];\n}\n\nfunction normalizeRequiredOptionLabel(rawValue: string): string {\n const normalized = rawValue.trim();\n const firstLongFlag = normalized.match(/--[A-Za-z0-9][A-Za-z0-9_-]*/)?.[0];\n return firstLongFlag ?? normalized;\n}\n\nfunction renderPmCommandFromArgs(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv) || argv.length === 0) {\n return undefined;\n }\n return renderPmCommand(argv);\n}\n\nfunction normalizeOptionFlags(values: string[] | undefined): string[] | undefined {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction buildCommanderRecoveryPayload(\n context: CommanderGuidanceContext | undefined,\n overrides: Partial<PmCliErrorRecoveryPayload> = {},\n): PmCliErrorRecoveryPayload | undefined {\n const providedFields = normalizeOptionFlags(context?.providedOptionFlags);\n const normalizedArgs =\n Array.isArray(context?.normalizedInvocationArgs) && context?.normalizedInvocationArgs.length > 0\n ? context.normalizedInvocationArgs\n : undefined;\n const attemptedCommand = typeof context?.attemptedCommand === \"string\" ? context.attemptedCommand : renderPmCommandFromArgs(normalizedArgs);\n const retryCommand = typeof context?.suggestedRetryCommand === \"string\" ? context.suggestedRetryCommand : undefined;\n return normalizeRecoveryPayload({\n attempted_command: attemptedCommand,\n normalized_args: normalizedArgs,\n provided_fields: providedFields,\n suggested_retry: retryCommand,\n ...overrides,\n });\n}\n\nfunction appendIfMissing(entries: string[], value: string | undefined): string[] {\n if (!value || entries.includes(value)) {\n return entries;\n }\n return [...entries, value];\n}\n\n// Linked-test mutation flags on `pm test` whose values commonly contain spaces and\n// nested \"--\" tokens (GH-191). Used to recognise the \"too many arguments\" failure\n// shape produced when such a value is not quoted into a single shell token.\nconst LINKED_TEST_MUTATION_FLAGS = new Set([\"--add\", \"--add-json\", \"--remove\"]);\n// Entry-identity keys eligible for the two-token form; mirrors\n// LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG in bootstrap-args.ts.\nconst LINKED_TEST_RETRY_KEYS = new Set([\"command\", \"cmd\", \"path\"]);\n\nfunction findLinkedTestMutationFlag(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv)) {\n return undefined;\n }\n for (const token of argv) {\n if (!token.startsWith(\"--\")) {\n continue;\n }\n const equalsIndex = token.indexOf(\"=\");\n const flag = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n if (LINKED_TEST_MUTATION_FLAGS.has(flag)) {\n return flag;\n }\n }\n return undefined;\n}\n\n/**\n * Synthesize a copy-pasteable retry for the unquoted linked-test value shape\n * `pm test <id> --add command npm test -- parser` by re-joining the shell-split\n * value tokens into the documented quoted `key=value` form. Only fires when the\n * item id already precedes the flag (so trailing tokens unambiguously belong to\n * the value) and the token after `--add`/`--remove` is an entry-identity key.\n */\nexport function buildLinkedTestQuotedRetryCommand(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv)) {\n return undefined;\n }\n const commandIndex = argv.indexOf(\"test\");\n if (commandIndex < 0) {\n return undefined;\n }\n const idToken = argv[commandIndex + 1];\n if (typeof idToken !== \"string\" || idToken.startsWith(\"-\")) {\n return undefined;\n }\n for (let index = commandIndex + 2; index < argv.length; index += 1) {\n const token = argv[index];\n if (token !== \"--add\" && token !== \"--remove\") {\n continue;\n }\n const key = argv[index + 1];\n if (typeof key !== \"string\" || !LINKED_TEST_RETRY_KEYS.has(key)) {\n return undefined;\n }\n const valueTokens: string[] = [];\n for (let cursor = index + 2; cursor < argv.length; cursor += 1) {\n const candidate = argv[cursor];\n // A bare \"--\" belongs to the re-joined command value; real long flags end it.\n if (candidate.startsWith(\"--\") && candidate.length > 2) {\n break;\n }\n valueTokens.push(candidate);\n }\n if (valueTokens.length < 2) {\n // Single-token values are auto-merged at bootstrap; nothing to repair here.\n return undefined;\n }\n const merged = `${key}=${valueTokens.join(\" \")}`;\n const rewritten = [\n ...argv.slice(0, index + 1),\n merged,\n ...argv.slice(index + 2 + valueTokens.length),\n ];\n return renderPmCommand(rewritten);\n }\n return undefined;\n}\n\nfunction buildCommanderErrorGuidance(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n\n const requiredOption = message.match(/required option '([^']+)' not specified/);\n if (requiredOption) {\n const optionFlag = normalizeRequiredOptionLabel(requiredOption[1]);\n const isType = optionFlag.startsWith(\"--type\");\n const retryCommand = context?.suggestedRetryCommand;\n const providedFlags = normalizeOptionFlags(context?.providedOptionFlags);\n const missing = [optionFlag];\n const examples = commandExampleForRequiredOption(commandName, optionFlag, allowedTypes);\n const examplesWithRetry = retryCommand ? appendIfMissing(examples, retryCommand) : examples;\n const nextStepsBase = isType\n ? [`Allowed type values: ${allowedTypes}`, `Run \"pm ${commandName ?? \"create\"} --help --type <value>\" for type-aware policy details.`]\n : [`Run \"pm ${commandName ?? \"<command>\"} --help\" for required option guidance.`];\n const nextStepsWithRetry = retryCommand\n ? appendIfMissing(nextStepsBase, `Replay with preserved arguments: ${retryCommand}`)\n : nextStepsBase;\n const nextSteps =\n providedFlags && providedFlags.length > 0\n ? appendIfMissing(nextStepsWithRetry, `Already provided options: ${providedFlags.join(\", \")}`)\n : nextStepsWithRetry;\n return makeGuidanceMessage({\n code: \"missing_required_option\",\n title: `Missing required option ${optionFlag}`,\n happened: `Commander rejected the command because ${optionFlag} was not provided.`,\n required: `Pass ${optionFlag} with a valid value before running the command.`,\n why: isType\n ? \"--type selects item contract and policy routing, including required/disabled option rules.\"\n : \"Required flags define mandatory command intent and prevent ambiguous execution.\",\n examples: examplesWithRetry,\n nextSteps,\n recovery: buildCommanderRecoveryPayload(context, { missing }),\n });\n }\n\n const missingArgument = message.match(/missing required argument '([^']+)'/);\n if (missingArgument) {\n const argumentName = missingArgument[1];\n return makeGuidanceMessage({\n code: \"missing_required_argument\",\n title: `Missing required argument ${argumentName}`,\n happened: `Command invocation omitted positional argument ${argumentName}.`,\n required: `Provide ${argumentName} in the expected command position.`,\n why: \"Positional arguments identify the target entity or action context for the command.\",\n examples: [`pm ${commandName ?? \"<command>\"} --help`],\n recovery: buildCommanderRecoveryPayload(context, { missing: [argumentName] }),\n });\n }\n\n const unknownOption = message.match(/unknown option '([^']+)'/);\n if (unknownOption) {\n const optionName = unknownOption[1];\n const suggestions = normalizeOptionFlags(context?.unknownOptionSuggestions);\n const retryCommand = context?.suggestedRetryCommand;\n if (commandName === \"update\" && (optionName === \"--file\" || optionName === \"--doc\")) {\n return makeGuidanceMessage({\n code: \"unsupported_update_option\",\n title: `Unsupported option ${optionName} for update`,\n happened: `pm update does not accept ${optionName} for linked artifact mutations.`,\n required: \"Use dedicated linked-artifact commands instead of pm update for files/docs changes.\",\n why: \"pm update manages scalar item metadata, while linked files/docs are managed by pm files and pm docs.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=implementation surface\"',\n 'pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing contract\"',\n ],\n nextSteps: ['Run \"pm files --help\" and \"pm docs --help\" for add/remove payload formats.'],\n recovery: buildCommanderRecoveryPayload(context, {\n missing: suggestions,\n }),\n });\n }\n const otherCommands = normalizeContextList(context?.unknownOptionOtherCommands);\n const nextSteps = [\n \"Run command help to confirm the exact option contracts for this command path.\",\n ...(suggestions && suggestions.length > 0 ? [`Nearest supported options: ${suggestions.join(\", \")}`] : []),\n ...(otherCommands && otherCommands.length > 0\n ? [`${optionName} is a valid option on: ${otherCommands.join(\", \")}. If you meant one of those, run that command instead.`]\n : []),\n ...(retryCommand ? [`Replay with suggested correction: ${retryCommand}`] : []),\n ];\n const examples = [\n ...(retryCommand ? [retryCommand] : []),\n `pm ${commandName ?? \"<command>\"} --help`,\n ];\n return makeGuidanceMessage({\n code: \"unknown_option\",\n title: `Unknown option ${optionName}`,\n happened: `Commander does not recognize option ${optionName} for this command path.`,\n required: \"Use supported options only, or move option to the correct subcommand.\",\n why: \"Option contracts are command-specific and intentionally validated.\",\n examples,\n nextSteps,\n recovery: buildCommanderRecoveryPayload(context, {\n missing: suggestions,\n }),\n });\n }\n\n const unknownCommand = message.match(/unknown command '([^']+)'/);\n if (unknownCommand) {\n const commandToken = unknownCommand[1];\n const runtimeExamples = normalizeContextList(context?.unknownCommandExamples);\n const runtimeNextSteps = normalizeContextList(context?.unknownCommandNextSteps);\n const packageHint = resolveKnownPackageCommandHint(commandToken);\n const baseExamples = runtimeExamples ?? [\"pm --help\"];\n const baseNextSteps = runtimeNextSteps ?? [\"Verify spelling and active extensions, then rerun.\"];\n if (packageHint) {\n const installStep = `\"${commandToken}\" is provided by the ${packageHint.packageName} package. Install it with: ${packageHint.installCommand}`;\n return makeGuidanceMessage({\n code: \"unknown_command\",\n title: `Unknown command ${commandToken}`,\n happened: `pm does not expose command path \"${commandToken}\" in current runtime configuration. It is shipped by the optional ${packageHint.packageName} package.`,\n required: `Install the ${packageHint.packageName} package, or use a valid command name or subcommand path.`,\n why: \"Command registry includes core commands plus active extension command handlers; package-provided commands appear only after the package is installed.\",\n examples: dedupeStrings([packageHint.installCommand, ...baseExamples]),\n nextSteps: dedupeStrings([installStep, ...baseNextSteps]),\n recovery: buildCommanderRecoveryPayload(context),\n });\n }\n return makeGuidanceMessage({\n code: \"unknown_command\",\n title: `Unknown command ${commandToken}`,\n happened: `pm does not expose command path \"${commandToken}\" in current runtime configuration.`,\n required: \"Use a valid command name or subcommand path.\",\n why: \"Command registry includes core commands plus active extension command handlers.\",\n examples: baseExamples,\n nextSteps: baseNextSteps,\n recovery: buildCommanderRecoveryPayload(context),\n });\n }\n\n if (/too many arguments/i.test(message) && commandName === \"test\") {\n const argv = context?.normalizedInvocationArgs;\n const mutationFlag = findLinkedTestMutationFlag(argv);\n if (mutationFlag) {\n const retryCommand = buildLinkedTestQuotedRetryCommand(argv);\n return makeGuidanceMessage({\n code: \"linked_test_value_not_quoted\",\n title: `Linked-test ${mutationFlag} value must be one argument`,\n happened: `Commander saw extra positional tokens after the item id — usually a ${mutationFlag} value containing spaces (for example a command with \" -- \") that the shell split into multiple tokens.`,\n required: `Quote the whole ${mutationFlag} value as a single argument. Accepted forms: --add \"command=npm test -- parser\", --add command \"npm test -- parser\" (two-token form with the value quoted), or --add-json for complex commands.`,\n why: \"The shell splits unquoted values before pm can see them, so pm cannot reassemble the intended command unambiguously.\",\n examples: [\n ...(retryCommand ? [retryCommand] : []),\n 'pm test pm-a1b2 --add \"command=npm test -- parser\"',\n 'pm test pm-a1b2 --add command \"npm test -- parser\"',\n `pm test pm-a1b2 --add-json '{\"command\":\"npm test -- parser\"}'`,\n ],\n nextSteps: [\n ...(retryCommand ? [`Replay with the value re-joined into one argument: ${retryCommand}`] : []),\n \"Prefer --add-json for commands containing commas, equals signs, or quotes.\",\n 'Run \"pm test --help\" for linked-test entry contracts.',\n ],\n recovery: buildCommanderRecoveryPayload(context, retryCommand ? { suggested_retry: retryCommand } : {}),\n });\n }\n }\n\n return makeGuidanceMessage({\n code: \"invalid_command_usage\",\n title: \"Invalid command usage\",\n happened: message,\n required: \"Use the command with valid arguments and options.\",\n why: \"Commander validates CLI contracts before execution.\",\n examples: [\"pm --help\", `pm ${commandName ?? \"<command>\"} --help`],\n recovery: buildCommanderRecoveryPayload(context),\n });\n}\n\n/**\n * Implements format pm cli error for display for the public runtime surface of this module.\n */\nexport function formatPmCliErrorForDisplay(rawMessage: string, context?: PmCliErrorContext): string {\n return renderGuidanceMessage(buildPmCliErrorGuidance(rawMessage, context));\n}\n\n/**\n * Implements classify pm cli error for the public runtime surface of this module.\n */\nexport function classifyPmCliError(rawMessage: string, context?: PmCliErrorContext): ErrorClassification {\n return guidanceToClassification(buildPmCliErrorGuidance(rawMessage, context));\n}\n\n/**\n * Implements format pm cli error for json for the public runtime surface of this module.\n */\nexport function formatPmCliErrorForJson(rawMessage: string, exitCode: number, context?: PmCliErrorContext): JsonErrorEnvelope {\n return guidanceToJsonEnvelope(buildPmCliErrorGuidance(rawMessage, context), exitCode);\n}\n\n/**\n * Implements format commander error for display for the public runtime surface of this module.\n */\nexport function formatCommanderErrorForDisplay(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): string {\n return renderGuidanceMessage(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context));\n}\n\n/**\n * Implements classify commander error for the public runtime surface of this module.\n */\nexport function classifyCommanderError(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): ErrorClassification {\n return guidanceToClassification(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context));\n}\n\n/**\n * Implements format commander error for json for the public runtime surface of this module.\n */\nexport function formatCommanderErrorForJson(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n exitCode: number,\n context?: CommanderGuidanceContext,\n): JsonErrorEnvelope {\n return guidanceToJsonEnvelope(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context), exitCode);\n}\n\n/**\n * Implements format unknown error for json for the public runtime surface of this module.\n */\nexport function formatUnknownErrorForJson(rawMessage: string, exitCode: number): JsonErrorEnvelope {\n const guidance = buildUnknownErrorGuidance(rawMessage);\n return guidanceToJsonEnvelope(guidance, exitCode);\n}\n\nfunction buildUnknownErrorGuidance(rawMessage: string): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n if (isModuleResolutionErrorMessage(message)) {\n return makeGuidanceMessage({\n code: \"module_import_failed\",\n title: \"Module import failed\",\n happened: message,\n required: \"Ensure the active checkout is built and any package or extension entry file exists before retrying.\",\n why: \"Node could not resolve an imported module. In pm this usually means an extension/package entrypoint, build artifact, or dependency is missing from the active runtime.\",\n examples: [\"pnpm build\", \"pm package manage --doctor --project\", \"pm health --check-only --json\"],\n nextSteps: [\n \"Rebuild the checkout or package that provides the missing module.\",\n \"Run package doctor for installed extensions when the failure follows package installation or activation.\",\n \"Rerun the original pm command after the runtime files are present.\",\n ],\n });\n }\n\n return makeGuidanceMessage({\n code: \"unknown_error\",\n title: \"Unhandled error\",\n happened: message,\n required: \"Inspect command input and runtime state, then retry.\",\n why: \"Unexpected runtime failures can occur from environment or extension-level issues.\",\n examples: [\"pm --help\", \"pm health --json\"],\n });\n}\n\n/**\n * Implements classify unknown error for the public runtime surface of this module.\n */\nexport function classifyUnknownError(rawMessage: string): ErrorClassification {\n return guidanceToClassification(buildUnknownErrorGuidance(rawMessage));\n}\n\nexport const _testOnly = {\n applyPmCliErrorContext,\n appendIfMissing,\n buildCommanderRecoveryPayload,\n buildFallbackTitleFromMessage,\n commandExampleForRequiredOption,\n dedupeStrings,\n guidanceToClassification,\n guidanceToJsonEnvelope,\n normalizeRecoveryPayload,\n renderList,\n resolveKnownPackageCommandHint,\n};\n"],"names":[],"mappings":";;AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA2DlD,+EAA+E;AAC/E,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAS;IACvD,iBAAiB;IACjB,gBAAgB;IAChB,yBAAyB;IACzB,2BAA2B;IAC3B,wBAAwB;IACxB,uBAAuB;IACvB,gBAAgB;CACjB,CAAC,CAAC;AAEH,SAAS,8BAA8B,CAAC,OAAwB;IAC9D,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,gCAAgC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,oBAAoB,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAqC;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BAAyB,CAAC,UAAU,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,eAAe;IACf,6BAA6B;IAC7B,6BAA6B;IAC7B,+BAA+B;IAC/B,aAAa;IACb,wBAAwB;IACxB,sBAAsB;IACtB,wBAAwB;IACxB,UAAU;IACV,8BAA8B;CAC/B,CAAC","debugId":"4fdf7d5d-e4c8-5f0c-a969-2ed905b3a5dc"}
1
+ {"version":3,"file":"error-guidance.js","sources":["cli/error-guidance.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/error-guidance\n *\n * Provides CLI runtime support for Error Guidance.\n */\nimport type { PmCliErrorContext, PmCliErrorRecoveryPayload } from \"../core/shared/errors.js\";\nimport { renderPmCommand } from \"./argv-utils.js\";\n\ninterface GuidanceMessage {\n code: string;\n type: string;\n title: string;\n happened: string;\n required: string;\n why?: string;\n examples?: string[];\n nextSteps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the json error envelope payload exchanged by command, SDK, and package integrations.\n */\nexport interface JsonErrorEnvelope {\n type: string;\n code: string;\n title: string;\n detail: string;\n required: string;\n exit_code: number;\n why?: string;\n examples?: string[];\n next_steps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the error classification payload exchanged by command, SDK, and package integrations.\n */\nexport interface ErrorClassification {\n type: string;\n code: string;\n title: string;\n detail: string;\n required: string;\n why?: string;\n examples?: string[];\n next_steps?: string[];\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/**\n * Documents the commander guidance context payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommanderGuidanceContext {\n unknownCommandExamples?: string[];\n unknownCommandNextSteps?: string[];\n attemptedCommand?: string;\n normalizedInvocationArgs?: string[];\n providedOptionFlags?: string[];\n unknownOptionSuggestions?: string[];\n unknownOptionOtherCommands?: string[];\n suggestedRetryCommand?: string;\n}\n\n// JSON/classification payloads are consumed heavily by agents; suppress common\n// boilerplate rationale text there to reduce token overhead. Human display\n// guidance still renders \"Why\" unchanged.\nconst STRUCTURED_WHY_SUPPRESSION_CODES = new Set<string>([\n \"unknown_command\",\n \"unknown_option\",\n \"missing_required_option\",\n \"missing_required_argument\",\n \"invalid_argument_value\",\n \"invalid_command_usage\",\n \"command_failed\",\n]);\n\nfunction includeWhyInStructuredGuidance(message: GuidanceMessage): boolean {\n if (!message.why) {\n return false;\n }\n if (message.recovery?.recovery_mode === \"compact\") {\n return false;\n }\n return !STRUCTURED_WHY_SUPPRESSION_CODES.has(message.code);\n}\n\nfunction errorType(code: string): string {\n return `urn:pm-cli:error:${code}`;\n}\n\nfunction makeGuidanceMessage(params: Omit<GuidanceMessage, \"type\">): GuidanceMessage {\n return {\n ...params,\n type: errorType(params.code),\n };\n}\n\ninterface PackageCommandHint {\n /** Published package name shown to the user (e.g. @unbrained/pm-guide-shell). */\n packageName: string;\n /** Exact CLI command that installs the bundled package by its install alias. */\n installCommand: string;\n}\n\n// Catalog of command tokens that are provided by optional first-party packages\n// rather than core. When an unknown-command error names one of these, we surface\n// a concrete install hint so agents/humans aren't left guessing. The install\n// command uses the bundled alias accepted by `pm install <alias>` (see\n// packages/pm-*/package.json `pm.aliases` and extension.ts install_command).\nconst KNOWN_PACKAGE_COMMAND_HINTS: Readonly<Record<string, PackageCommandHint>> = {\n guide: { packageName: \"@unbrained/pm-guide-shell\", installCommand: \"pm install guide-shell\" },\n templates: { packageName: \"@unbrained/pm-templates\", installCommand: \"pm install templates\" },\n calendar: { packageName: \"@unbrained/pm-calendar\", installCommand: \"pm install calendar\" },\n cal: { packageName: \"@unbrained/pm-calendar\", installCommand: \"pm install calendar\" },\n};\n\nfunction resolveKnownPackageCommandHint(commandToken: string): PackageCommandHint | undefined {\n const primary = commandToken.trim().split(/\\s+/)[0]?.toLowerCase();\n if (!primary) {\n return undefined;\n }\n return KNOWN_PACKAGE_COMMAND_HINTS[primary];\n}\n\nfunction renderList(title: string, entries: string[]): string[] {\n if (entries.length === 0) {\n return [];\n }\n return [title, ...entries.map((entry) => ` - ${entry}`)];\n}\n\nfunction normalizeStringArray(values: unknown): string[] | undefined {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values\n .filter((entry): entry is string => typeof entry === \"string\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeRecoveryCandidates(\n candidates: PmCliErrorRecoveryPayload[\"fallback_candidates\"],\n): PmCliErrorRecoveryPayload[\"fallback_candidates\"] | undefined {\n if (!Array.isArray(candidates)) {\n return undefined;\n }\n const normalized = candidates\n .map((entry) => ({\n source: typeof entry?.source === \"string\" ? entry.source.trim() : \"\",\n command: typeof entry?.command === \"string\" ? entry.command.trim() : \"\",\n reason: typeof entry?.reason === \"string\" ? entry.reason.trim() : \"\",\n }))\n .filter((entry) => entry.source.length > 0 && entry.command.length > 0 && entry.reason.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction assignRecoveryString(\n normalized: PmCliErrorRecoveryPayload,\n key: \"attempted_command\" | \"suggested_retry\" | \"next_best_command\",\n value: unknown,\n): void {\n if (typeof value === \"string\" && value.trim().length > 0) {\n normalized[key] = value.trim();\n }\n}\n\nfunction assignRecoveryStringArray(\n normalized: PmCliErrorRecoveryPayload,\n key: \"normalized_args\" | \"provided_fields\" | \"missing\" | \"missing_required_fields\" | \"suggested_flags\",\n value: unknown,\n): void {\n const values = normalizeStringArray(value);\n if (values) {\n normalized[key] = values;\n }\n}\n\nfunction normalizeRecoveryPayload(payload: PmCliErrorRecoveryPayload | undefined): PmCliErrorRecoveryPayload | undefined {\n if (!payload || typeof payload !== \"object\") {\n return undefined;\n }\n const normalized: PmCliErrorRecoveryPayload = {};\n if (payload.recovery_mode === \"compact\") {\n normalized.recovery_mode = \"compact\";\n }\n assignRecoveryString(normalized, \"attempted_command\", payload.attempted_command);\n assignRecoveryStringArray(normalized, \"normalized_args\", payload.normalized_args);\n assignRecoveryStringArray(normalized, \"provided_fields\", payload.provided_fields);\n assignRecoveryStringArray(normalized, \"missing\", payload.missing);\n assignRecoveryStringArray(normalized, \"missing_required_fields\", payload.missing_required_fields);\n assignRecoveryStringArray(normalized, \"suggested_flags\", payload.suggested_flags);\n assignRecoveryString(normalized, \"suggested_retry\", payload.suggested_retry);\n const fallbackCandidates = normalizeRecoveryCandidates(payload.fallback_candidates);\n if (fallbackCandidates) {\n normalized.fallback_candidates = fallbackCandidates;\n }\n assignRecoveryString(normalized, \"next_best_command\", payload.next_best_command);\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n}\n\nfunction appendRecoveryTextLine(lines: string[], label: string, value: string | undefined): void {\n if (value) {\n lines.push(` ${label}: ${value}`);\n }\n}\n\nfunction appendRecoveryListLine(lines: string[], label: string, values: string[] | undefined, separator: string): void {\n if (values && values.length > 0) {\n lines.push(` ${label}: ${values.join(separator)}`);\n }\n}\n\nfunction renderRecoveryBundle(recovery: PmCliErrorRecoveryPayload | undefined): string[] {\n const normalized = normalizeRecoveryPayload(recovery);\n if (!normalized) {\n return [];\n }\n const lines = [\"Recovery bundle:\"];\n appendRecoveryTextLine(lines, \"attempted_command\", normalized.attempted_command);\n appendRecoveryListLine(lines, \"normalized_args\", normalized.normalized_args, \" \");\n appendRecoveryListLine(lines, \"provided_fields\", normalized.provided_fields, \", \");\n appendRecoveryListLine(lines, \"missing\", normalized.missing, \", \");\n appendRecoveryListLine(lines, \"missing_required_fields\", normalized.missing_required_fields, \", \");\n appendRecoveryListLine(lines, \"suggested_flags\", normalized.suggested_flags, \", \");\n appendRecoveryTextLine(lines, \"suggested_retry\", normalized.suggested_retry);\n appendRecoveryTextLine(lines, \"next_best_command\", normalized.next_best_command);\n if (normalized.fallback_candidates && normalized.fallback_candidates.length > 0) {\n lines.push(\" fallback_candidates:\");\n for (const candidate of normalized.fallback_candidates) {\n lines.push(` - ${candidate.source}: ${candidate.command} (${candidate.reason})`);\n }\n }\n return lines;\n}\n\n/**\n * Implements render guidance message for the public runtime surface of this module.\n */\nexport function renderGuidanceMessage(message: GuidanceMessage): string {\n const lines: string[] = [\n `Error: ${message.title}`,\n \"\",\n \"What happened:\",\n ` ${message.happened}`,\n \"\",\n \"What is required:\",\n ` ${message.required}`,\n ];\n if (message.why) {\n lines.push(\"\", \"Why:\");\n lines.push(` ${message.why}`);\n }\n if (message.examples && message.examples.length > 0) {\n lines.push(\"\");\n lines.push(...renderList(\"Examples:\", message.examples));\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n lines.push(\"\");\n lines.push(...renderList(\"Next steps:\", message.nextSteps));\n }\n const recoveryLines = renderRecoveryBundle(message.recovery);\n if (recoveryLines.length > 0) {\n lines.push(\"\");\n lines.push(...recoveryLines);\n }\n return lines.join(\"\\n\");\n}\n\nfunction guidanceToJsonEnvelope(message: GuidanceMessage, exitCode: number): JsonErrorEnvelope {\n const payload: JsonErrorEnvelope = {\n type: message.type,\n code: message.code,\n title: message.title,\n detail: message.happened,\n required: message.required,\n exit_code: exitCode,\n };\n if (includeWhyInStructuredGuidance(message)) {\n payload.why = message.why;\n }\n if (message.examples && message.examples.length > 0) {\n payload.examples = message.examples;\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n payload.next_steps = message.nextSteps;\n }\n if (message.recovery) {\n payload.recovery = message.recovery;\n }\n return payload;\n}\n\nfunction guidanceToClassification(message: GuidanceMessage): ErrorClassification {\n const payload: ErrorClassification = {\n type: message.type,\n code: message.code,\n title: message.title,\n detail: message.happened,\n required: message.required,\n };\n if (includeWhyInStructuredGuidance(message)) {\n payload.why = message.why;\n }\n if (message.examples && message.examples.length > 0) {\n payload.examples = message.examples;\n }\n if (message.nextSteps && message.nextSteps.length > 0) {\n payload.next_steps = message.nextSteps;\n }\n if (message.recovery) {\n payload.recovery = message.recovery;\n }\n return payload;\n}\n\nfunction normalizeMessage(message: string): string {\n return message.replace(/\\(outputHelp\\)/g, \"\").trim();\n}\n\nfunction isModuleResolutionErrorMessage(message: string): boolean {\n const normalized = message.toLowerCase();\n return (\n normalized.includes(\"cannot find module\") ||\n normalized.includes(\"cannot find package\") ||\n normalized.includes(\"err_module_not_found\") ||\n normalized.includes(\"module_not_found\")\n );\n}\n\nfunction normalizeContextList(values: string[] | undefined): string[] | undefined {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction dedupeStrings(values: string[]): string[] {\n const seen = new Set<string>();\n const result: string[] = [];\n for (const value of values) {\n if (seen.has(value)) {\n continue;\n }\n seen.add(value);\n result.push(value);\n }\n return result;\n}\n\nfunction inferCommandNameFromRecovery(recovery: PmCliErrorRecoveryPayload | undefined): string | undefined {\n const args = recovery?.normalized_args;\n if (!Array.isArray(args) || args.length === 0) {\n return undefined;\n }\n const firstCommandArg = args.find((arg) => arg.trim().length > 0 && !arg.startsWith(\"-\"));\n return firstCommandArg?.trim();\n}\n\nfunction inferAllowedValuesFromMessage(message: string): string[] {\n const match = message.match(/\\bmust be one of:?\\s+([A-Za-z0-9_.|,\\- ]+)/i);\n if (!match) {\n return [];\n }\n return match[1]\n .split(/[|,]/)\n .map((entry) => entry.trim())\n .filter((entry) => /^[A-Za-z0-9_.-]+$/.test(entry));\n}\n\nfunction buildAllowedValueRetryCommand(recovery: PmCliErrorRecoveryPayload | undefined, allowedValues: string[]): string | undefined {\n const args = recovery?.normalized_args;\n const fields = recovery?.provided_fields;\n const replacement = allowedValues[0];\n if (!Array.isArray(args) || !Array.isArray(fields) || !replacement) {\n return undefined;\n }\n for (const field of fields) {\n const index = args.findIndex((arg) => arg === field);\n if (index >= 0 && index < args.length - 1 && !args[index + 1]?.startsWith(\"-\")) {\n const nextArgs = [...args];\n nextArgs[index + 1] = replacement;\n return renderPmCommand(nextArgs);\n }\n }\n return undefined;\n}\n\nfunction buildFallbackTitleFromMessage(message: string): string | undefined {\n const firstLine = message.split(/\\r?\\n/)[0].trim();\n if (firstLine.length === 0) {\n return undefined;\n }\n if (firstLine.length <= 120) {\n return firstLine;\n }\n return `${firstLine.slice(0, 117)}...`;\n}\n\nfunction applyPmCliErrorContext(\n guidance: GuidanceMessage,\n rawMessage: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage {\n if (!context) {\n return guidance;\n }\n const normalizedRawMessage = normalizeMessage(rawMessage);\n const code = typeof context.code === \"string\" && context.code.trim().length > 0 ? context.code.trim() : guidance.code;\n const type = typeof context.type === \"string\" && context.type.trim().length > 0 ? context.type.trim() : errorType(code);\n const examples = normalizeContextList(context.examples) ?? guidance.examples;\n const nextSteps = normalizeContextList(context.nextSteps) ?? guidance.nextSteps;\n const fallbackTitle = guidance.code === \"command_failed\" && context.code ? buildFallbackTitleFromMessage(normalizedRawMessage) : undefined;\n const recovery = normalizeRecoveryPayload(context.recovery) ?? guidance.recovery;\n return {\n ...guidance,\n code,\n type,\n title: fallbackTitle ?? guidance.title,\n happened: normalizedRawMessage.length > 0 ? normalizedRawMessage : guidance.happened,\n required: typeof context.required === \"string\" && context.required.trim().length > 0 ? context.required.trim() : guidance.required,\n why: typeof context.why === \"string\" && context.why.trim().length > 0 ? context.why.trim() : guidance.why,\n examples,\n nextSteps,\n recovery,\n };\n}\n\nfunction buildTrackerNotInitializedGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n const trackerNotInitialized = message.match(/^Tracker is not initialized at (.+)\\. Run pm init first\\.$/);\n if (!trackerNotInitialized) {\n return null;\n }\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"tracker_not_initialized\",\n title: \"Tracker is not initialized\",\n happened: `pm data path does not contain initialized tracker metadata (${trackerNotInitialized[1]}).`,\n required: \"Initialize tracker storage before running this command.\",\n why: \"Most commands require settings and tracker directories created by pm init.\",\n examples: [\"pm init\", \"pm init acme\"],\n nextSteps: ['Run \"pm init\", then rerun your original command.'],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildItemNotFoundGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n const itemNotFound = message.match(/^Item ([^ ]+) not found$/);\n if (!itemNotFound) {\n return null;\n }\n const badId = itemNotFound[1];\n const isPlaceholder = /^(undefined|null|<.*>|\\[.*\\]|{.*}|)$/.test(badId);\n const happened = isPlaceholder\n ? `The item ID \"${badId}\" looks like a placeholder or unresolved variable. Ensure the ID argument is resolved before calling pm.`\n : `No item with id \"${badId}\" exists in the active tracker scope.`;\n const nextSteps = isPlaceholder\n ? [\n \"Check that the variable holding the item ID is defined before passing it to pm.\",\n 'Use \"pm list-open --limit 20\" to find valid IDs.',\n ]\n : [\"Confirm the active --path/PM_PATH scope, then retry with a valid id.\"];\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"item_not_found\",\n title: \"Item ID not found\",\n happened,\n required: \"Use an existing item ID from current tracker data.\",\n why: \"Mutation and read commands operate only on known IDs.\",\n examples: ['pm list-open --limit 20', 'pm search \"<keyword>\" --limit 10'],\n nextSteps,\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildOwnershipConflictGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n if (!message.includes(\"is assigned to\") || !message.includes(\"Use --force to override\")) {\n return null;\n }\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"ownership_conflict\",\n title: \"Ownership conflict\",\n happened: message,\n required:\n \"Run as assigned owner, use audit flags for safe non-owner updates, or use --force only for approved override scenarios.\",\n why: \"Ownership checks prevent accidental concurrent mutations on claimed items and protect against conflicting writes.\",\n examples: [\n 'pm update pm-a1b2 --allow-audit-update --description \"...\" --author \"audit-agent\"',\n 'pm update pm-a1b2 --allow-audit-dep-update --dep \"...\" --author \"audit-agent\"',\n 'pm comments pm-a1b2 \"...\" --allow-audit-comment --author \"audit-agent\"',\n 'pm claim pm-a1b2 --author \"codex-agent\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\"',\n 'pm update pm-a1b2 --status in_progress --force',\n ],\n nextSteps: [\n \"Use --allow-audit-update for metadata-only non-owner updates (excludes lifecycle/ownership fields).\",\n \"Use --allow-audit-dep-update for dependency-only non-owner additions.\",\n \"Use --allow-audit-comment on comments/notes/learnings for append-only audit entries.\",\n \"Use --force for PM audits and systematic metadata updates performed by leads/maintainers.\",\n \"Use --force when correcting known stale metadata after coordinating ownership changes.\",\n 'For non-terminal reassignment, prefer \"pm claim <ID> --author <you>\" before running other mutations.',\n 'For assignee handoff release workflows, prefer \"pm release <ID> --allow-audit-release --author <you>\" before using --force.',\n ],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildLockConflictGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n if (!message.includes(\"is locked\")) {\n return null;\n }\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"lock_conflict\",\n title: \"Lock conflict\",\n happened: message,\n required: \"Wait for lock release, or use --force where supported if lock is stale and safe to override.\",\n why: \"Locking protects item files from concurrent write races.\",\n examples: ['pm update pm-a1b2 --status in_progress --force --author \"codex-agent\"'],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildPmMissingRequiredOptionGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n const missingRequiredOption = message.match(/^Missing required option /);\n const missingRequiredOptions = message.match(/^Missing required options /);\n if (!missingRequiredOption && !missingRequiredOptions) {\n return null;\n }\n const plural = Boolean(missingRequiredOptions);\n const missingOptionFlag = !plural ? message.replace(/^Missing required option\\s+/, \"\").trim() : null;\n const missingOptionLabel = missingOptionFlag ?? \"\";\n const missingOptionRequired = missingOptionFlag\n ? `Pass ${missingOptionFlag} with a valid value before running the command.`\n : \"Provide the required option for this command invocation.\";\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"missing_required_option\",\n title: plural ? \"Missing required options\" : `Missing required option ${missingOptionLabel}`,\n happened: message,\n required: plural ? \"Provide every required option for this command invocation.\" : missingOptionRequired,\n why: \"Required options define command intent and enforce deterministic write contracts.\",\n examples: [\n 'pm create --title \"Task title\" --description \"Task details\" --type Task --create-mode progressive',\n 'pm create --title \"Task title\" --description \"Task details\" --type Task --status open --priority 1 --message \"Create task\" --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this task exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/example.ts,scope=project\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project\"',\n ],\n nextSteps: [\n 'Run \"pm <command> --help\" to view required and recommended flags.',\n \"For staged triage without placeholder linkage values, use --create-mode progressive.\",\n ],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildNoUpdateFieldsGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n if (!message.startsWith(\"No update flags provided\")) {\n return null;\n }\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"no_update_fields\",\n title: \"No update fields supplied\",\n happened: \"The update command was called without any field-changing flags.\",\n required:\n \"Provide at least one field-changing flag such as --status, --priority, --title, --tags, --description, or --body. Use --message only to label a real mutation.\",\n why: \"pm update mutates existing item fields; no-op invocations are rejected to avoid ambiguous history.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --description \"Clarified implementation scope\" --message \"Clarify task intent\"',\n 'pm append pm-a1b2 --body \"Detailed progress notes\" --message \"Append progress notes\"',\n ],\n nextSteps: [\n \"Choose the item field you intend to change, then pair that change with --message for history context.\",\n \"Use pm comments, pm notes, pm learnings, or pm append when you only need to add narrative context.\",\n ],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildInvalidArgumentGuidance(\n rawMessage: string,\n message: string,\n context: PmCliErrorContext | undefined,\n): GuidanceMessage | null {\n if (!message.startsWith(\"Invalid \") && !message.includes(\" must be \") && !message.includes(\" requires \")) {\n return null;\n }\n const recovery = normalizeRecoveryPayload(context?.recovery);\n const commandName = inferCommandNameFromRecovery(recovery);\n const helpExample = commandName ? `pm ${commandName} --help` : \"pm <command> --help\";\n const allowedValues = inferAllowedValuesFromMessage(message);\n const retryExample = buildAllowedValueRetryCommand(recovery, allowedValues);\n const examples = retryExample ? [retryExample, helpExample] : [helpExample, \"pm contracts --command <command> --flags-only --json\"];\n const nextSteps = allowedValues.length > 0\n ? [`Allowed values: ${allowedValues.join(\"|\")}`, `Run \"${helpExample}\" to confirm command-specific constraints.`]\n : [\"Check allowed values in command help, then rerun with corrected input.\"];\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"invalid_argument_value\",\n title: \"Invalid argument value\",\n happened: message,\n required: \"Use values that match documented command constraints.\",\n why: \"Validation protects data consistency and deterministic behavior across commands.\",\n examples,\n nextSteps,\n }),\n rawMessage,\n context,\n );\n}\n\nfunction buildPmCliErrorGuidance(rawMessage: string, context?: PmCliErrorContext): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n const guidance =\n buildTrackerNotInitializedGuidance(rawMessage, message, context) ??\n buildItemNotFoundGuidance(rawMessage, message, context) ??\n buildOwnershipConflictGuidance(rawMessage, message, context) ??\n buildLockConflictGuidance(rawMessage, message, context) ??\n buildPmMissingRequiredOptionGuidance(rawMessage, message, context) ??\n buildNoUpdateFieldsGuidance(rawMessage, message, context) ??\n buildInvalidArgumentGuidance(rawMessage, message, context);\n if (guidance) {\n return guidance;\n }\n\n return applyPmCliErrorContext(\n makeGuidanceMessage({\n code: \"command_failed\",\n title: \"Command failed\",\n happened: message,\n required: \"Adjust command input or tracker state and retry.\",\n why: \"pm enforces explicit, deterministic contracts for data and command semantics.\",\n examples: [\"pm --help\", \"pm <command> --help\"],\n }),\n rawMessage,\n context,\n );\n}\n\nfunction commandExampleForRequiredOption(commandName: string | undefined, optionFlag: string, allowedTypes: string): string[] {\n if (commandName === \"create\" && optionFlag.startsWith(\"--type\")) {\n const firstAllowed = allowedTypes.split(\"|\")[0] || \"Task\";\n return [\n `pm create --title \"Example title\" --description \"Example description\" --type ${firstAllowed} --status open --priority 1 --message \"Create item\" --create-mode progressive`,\n ];\n }\n if (commandName === \"update\") {\n return ['pm update pm-a1b2 --status in_progress --message \"Start implementation\"'];\n }\n return [`pm ${commandName ?? \"<command>\"} --help`];\n}\n\nfunction normalizeRequiredOptionLabel(rawValue: string): string {\n const normalized = rawValue.trim();\n const firstLongFlag = normalized.match(/--[A-Za-z0-9][A-Za-z0-9_-]*/)?.[0];\n return firstLongFlag ?? normalized;\n}\n\nfunction renderPmCommandFromArgs(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv) || argv.length === 0) {\n return undefined;\n }\n return renderPmCommand(argv);\n}\n\nfunction normalizeOptionFlags(values: string[] | undefined): string[] | undefined {\n if (!Array.isArray(values)) {\n return undefined;\n }\n const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction buildCommanderRecoveryPayload(\n context: CommanderGuidanceContext | undefined,\n overrides: Partial<PmCliErrorRecoveryPayload> = {},\n): PmCliErrorRecoveryPayload | undefined {\n const providedFields = normalizeOptionFlags(context?.providedOptionFlags);\n const normalizedArgs =\n Array.isArray(context?.normalizedInvocationArgs) && context?.normalizedInvocationArgs.length > 0\n ? context.normalizedInvocationArgs\n : undefined;\n const attemptedCommand = typeof context?.attemptedCommand === \"string\" ? context.attemptedCommand : renderPmCommandFromArgs(normalizedArgs);\n const retryCommand = typeof context?.suggestedRetryCommand === \"string\" ? context.suggestedRetryCommand : undefined;\n return normalizeRecoveryPayload({\n attempted_command: attemptedCommand,\n normalized_args: normalizedArgs,\n provided_fields: providedFields,\n suggested_retry: retryCommand,\n ...overrides,\n });\n}\n\nfunction appendIfMissing(entries: string[], value: string | undefined): string[] {\n if (!value || entries.includes(value)) {\n return entries;\n }\n return [...entries, value];\n}\n\n// Linked-test mutation flags on `pm test` whose values commonly contain spaces and\n// nested \"--\" tokens (GH-191). Used to recognise the \"too many arguments\" failure\n// shape produced when such a value is not quoted into a single shell token.\nconst LINKED_TEST_MUTATION_FLAGS = new Set([\"--add\", \"--add-json\", \"--remove\"]);\n// Entry-identity keys eligible for the two-token form; mirrors\n// LINKED_TEST_TWO_TOKEN_KEYS_BY_FLAG in bootstrap-args.ts.\nconst LINKED_TEST_RETRY_KEYS = new Set([\"command\", \"cmd\", \"path\"]);\n\nfunction findLinkedTestMutationFlag(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv)) {\n return undefined;\n }\n for (const token of argv) {\n if (!token.startsWith(\"--\")) {\n continue;\n }\n const equalsIndex = token.indexOf(\"=\");\n const flag = equalsIndex >= 0 ? token.slice(0, equalsIndex) : token;\n if (LINKED_TEST_MUTATION_FLAGS.has(flag)) {\n return flag;\n }\n }\n return undefined;\n}\n\n/**\n * Synthesize a copy-pasteable retry for the unquoted linked-test value shape\n * `pm test <id> --add command npm test -- parser` by re-joining the shell-split\n * value tokens into the documented quoted `key=value` form. Only fires when the\n * item id already precedes the flag (so trailing tokens unambiguously belong to\n * the value) and the token after `--add`/`--remove` is an entry-identity key.\n */\nexport function buildLinkedTestQuotedRetryCommand(argv: string[] | undefined): string | undefined {\n if (!Array.isArray(argv)) {\n return undefined;\n }\n const commandIndex = argv.indexOf(\"test\");\n if (commandIndex < 0) {\n return undefined;\n }\n const idToken = argv[commandIndex + 1];\n if (typeof idToken !== \"string\" || idToken.startsWith(\"-\")) {\n return undefined;\n }\n for (let index = commandIndex + 2; index < argv.length; index += 1) {\n const token = argv[index];\n if (token !== \"--add\" && token !== \"--remove\") {\n continue;\n }\n const key = argv[index + 1];\n if (typeof key !== \"string\" || !LINKED_TEST_RETRY_KEYS.has(key)) {\n return undefined;\n }\n const valueTokens: string[] = [];\n for (let cursor = index + 2; cursor < argv.length; cursor += 1) {\n const candidate = argv[cursor];\n // A bare \"--\" belongs to the re-joined command value; real long flags end it.\n if (candidate.startsWith(\"--\") && candidate.length > 2) {\n break;\n }\n valueTokens.push(candidate);\n }\n if (valueTokens.length < 2) {\n // Single-token values are auto-merged at bootstrap; nothing to repair here.\n return undefined;\n }\n const merged = `${key}=${valueTokens.join(\" \")}`;\n const rewritten = [\n ...argv.slice(0, index + 1),\n merged,\n ...argv.slice(index + 2 + valueTokens.length),\n ];\n return renderPmCommand(rewritten);\n }\n return undefined;\n}\n\nfunction buildMissingRequiredOptionGuidance(\n message: string,\n commandName: string | undefined,\n allowedTypes: string,\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage | null {\n const requiredOption = message.match(/required option '([^']+)' not specified/);\n if (!requiredOption) {\n return null;\n }\n const optionFlag = normalizeRequiredOptionLabel(requiredOption[1]);\n const isType = optionFlag.startsWith(\"--type\");\n const retryCommand = context?.suggestedRetryCommand;\n const providedFlags = normalizeOptionFlags(context?.providedOptionFlags);\n const missing = [optionFlag];\n const examples = commandExampleForRequiredOption(commandName, optionFlag, allowedTypes);\n const examplesWithRetry = retryCommand ? appendIfMissing(examples, retryCommand) : examples;\n const nextStepsBase = isType\n ? [`Allowed type values: ${allowedTypes}`, `Run \"pm ${commandName ?? \"create\"} --help --type <value>\" for type-aware policy details.`]\n : [`Run \"pm ${commandName ?? \"<command>\"} --help\" for required option guidance.`];\n const nextStepsWithRetry = retryCommand\n ? appendIfMissing(nextStepsBase, `Replay with preserved arguments: ${retryCommand}`)\n : nextStepsBase;\n const nextSteps =\n providedFlags && providedFlags.length > 0\n ? appendIfMissing(nextStepsWithRetry, `Already provided options: ${providedFlags.join(\", \")}`)\n : nextStepsWithRetry;\n return makeGuidanceMessage({\n code: \"missing_required_option\",\n title: `Missing required option ${optionFlag}`,\n happened: `Commander rejected the command because ${optionFlag} was not provided.`,\n required: `Pass ${optionFlag} with a valid value before running the command.`,\n why: isType\n ? \"--type selects item contract and policy routing, including required/disabled option rules.\"\n : \"Required flags define mandatory command intent and prevent ambiguous execution.\",\n examples: examplesWithRetry,\n nextSteps,\n recovery: buildCommanderRecoveryPayload(context, { missing }),\n });\n}\n\nfunction buildMissingRequiredArgumentGuidance(\n message: string,\n commandName: string | undefined,\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage | null {\n const missingArgument = message.match(/missing required argument '([^']+)'/);\n if (!missingArgument) {\n return null;\n }\n const argumentName = missingArgument[1];\n return makeGuidanceMessage({\n code: \"missing_required_argument\",\n title: `Missing required argument ${argumentName}`,\n happened: `Command invocation omitted positional argument ${argumentName}.`,\n required: `Provide ${argumentName} in the expected command position.`,\n why: \"Positional arguments identify the target entity or action context for the command.\",\n examples: [`pm ${commandName ?? \"<command>\"} --help`],\n recovery: buildCommanderRecoveryPayload(context, { missing: [argumentName] }),\n });\n}\n\nfunction buildUnsupportedUpdateOptionGuidance(\n optionName: string,\n context: CommanderGuidanceContext | undefined,\n suggestions: string[] | undefined,\n): GuidanceMessage {\n return makeGuidanceMessage({\n code: \"unsupported_update_option\",\n title: `Unsupported option ${optionName} for update`,\n happened: `pm update does not accept ${optionName} for linked artifact mutations.`,\n required: \"Use dedicated linked-artifact commands instead of pm update for files/docs changes.\",\n why: \"pm update manages scalar item metadata, while linked files/docs are managed by pm files and pm docs.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=implementation surface\"',\n 'pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing contract\"',\n ],\n nextSteps: ['Run \"pm files --help\" and \"pm docs --help\" for add/remove payload formats.'],\n recovery: buildCommanderRecoveryPayload(context, {\n suggested_flags: suggestions,\n }),\n });\n}\n\nfunction buildUnknownOptionGuidance(\n message: string,\n commandName: string | undefined,\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage | null {\n const unknownOption = message.match(/unknown option '([^']+)'/);\n if (!unknownOption) {\n return null;\n }\n const optionName = unknownOption[1];\n const suggestions = normalizeOptionFlags(context?.unknownOptionSuggestions);\n const retryCommand = context?.suggestedRetryCommand;\n if (commandName === \"update\" && (optionName === \"--file\" || optionName === \"--doc\")) {\n return buildUnsupportedUpdateOptionGuidance(optionName, context, suggestions);\n }\n const otherCommands = normalizeContextList(context?.unknownOptionOtherCommands);\n const nextSteps = [\n \"Run command help to confirm the exact option contracts for this command path.\",\n ...(suggestions && suggestions.length > 0 ? [`Nearest supported options: ${suggestions.join(\", \")}`] : []),\n ...(otherCommands && otherCommands.length > 0\n ? [`${optionName} is a valid option on: ${otherCommands.join(\", \")}. If you meant one of those, run that command instead.`]\n : []),\n ...(retryCommand ? [`Replay with suggested correction: ${retryCommand}`] : []),\n ];\n const examples = [\n ...(retryCommand ? [retryCommand] : []),\n `pm ${commandName ?? \"<command>\"} --help`,\n ];\n return makeGuidanceMessage({\n code: \"unknown_option\",\n title: `Unknown option ${optionName}`,\n happened: `Commander does not recognize option ${optionName} for this command path.`,\n required: \"Use supported options only, or move option to the correct subcommand.\",\n why: \"Option contracts are command-specific and intentionally validated.\",\n examples,\n nextSteps,\n recovery: buildCommanderRecoveryPayload(context, {\n suggested_flags: suggestions,\n }),\n });\n}\n\nfunction buildKnownPackageCommandGuidance(\n commandToken: string,\n packageHint: PackageCommandHint,\n baseExamples: string[],\n baseNextSteps: string[],\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage {\n const installStep = `\"${commandToken}\" is provided by the ${packageHint.packageName} package. Install it with: ${packageHint.installCommand}`;\n return makeGuidanceMessage({\n code: \"unknown_command\",\n title: `Unknown command ${commandToken}`,\n happened: `pm does not expose command path \"${commandToken}\" in current runtime configuration. It is shipped by the optional ${packageHint.packageName} package.`,\n required: `Install the ${packageHint.packageName} package, or use a valid command name or subcommand path.`,\n why: \"Command registry includes core commands plus active extension command handlers; package-provided commands appear only after the package is installed.\",\n examples: dedupeStrings([packageHint.installCommand, ...baseExamples]),\n nextSteps: dedupeStrings([installStep, ...baseNextSteps]),\n recovery: buildCommanderRecoveryPayload(context),\n });\n}\n\nfunction buildUnknownCommandGuidance(\n message: string,\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage | null {\n const unknownCommand = message.match(/unknown command '([^']+)'/);\n if (!unknownCommand) {\n return null;\n }\n const commandToken = unknownCommand[1];\n const runtimeExamples = normalizeContextList(context?.unknownCommandExamples);\n const runtimeNextSteps = normalizeContextList(context?.unknownCommandNextSteps);\n const packageHint = resolveKnownPackageCommandHint(commandToken);\n const baseExamples = runtimeExamples ?? [\"pm --help\"];\n const baseNextSteps = runtimeNextSteps ?? [\"Verify spelling and active extensions, then rerun.\"];\n if (packageHint) {\n return buildKnownPackageCommandGuidance(commandToken, packageHint, baseExamples, baseNextSteps, context);\n }\n return makeGuidanceMessage({\n code: \"unknown_command\",\n title: `Unknown command ${commandToken}`,\n happened: `pm does not expose command path \"${commandToken}\" in current runtime configuration.`,\n required: \"Use a valid command name or subcommand path.\",\n why: \"Command registry includes core commands plus active extension command handlers.\",\n examples: baseExamples,\n nextSteps: baseNextSteps,\n recovery: buildCommanderRecoveryPayload(context),\n });\n}\n\nfunction buildLinkedTestValueNotQuotedGuidance(\n message: string,\n commandName: string | undefined,\n allowedTypes: string,\n context: CommanderGuidanceContext | undefined,\n): GuidanceMessage | null {\n if (!/too many arguments/i.test(message) || commandName !== \"test\") {\n return null;\n }\n const argv = context?.normalizedInvocationArgs;\n const mutationFlag = findLinkedTestMutationFlag(argv);\n if (!mutationFlag) {\n return null;\n }\n const retryCommand = buildLinkedTestQuotedRetryCommand(argv);\n return makeGuidanceMessage({\n code: \"linked_test_value_not_quoted\",\n title: `Linked-test ${mutationFlag} value must be one argument`,\n happened: `Commander saw extra positional tokens after the item id — usually a ${mutationFlag} value containing spaces (for example a command with \" -- \") that the shell split into multiple tokens.`,\n required: `Quote the whole ${mutationFlag} value as a single argument. Accepted forms: --add \"command=npm test -- parser\", --add command \"npm test -- parser\" (two-token form with the value quoted), or --add-json for complex commands.`,\n why: \"The shell splits unquoted values before pm can see them, so pm cannot reassemble the intended command unambiguously.\",\n examples: [\n ...(retryCommand ? [retryCommand] : []),\n 'pm test pm-a1b2 --add \"command=npm test -- parser\"',\n 'pm test pm-a1b2 --add command \"npm test -- parser\"',\n `pm test pm-a1b2 --add-json '{\"command\":\"npm test -- parser\"}'`,\n ],\n nextSteps: [\n ...(retryCommand ? [`Replay with the value re-joined into one argument: ${retryCommand}`] : []),\n \"Prefer --add-json for commands containing commas, equals signs, or quotes.\",\n 'Run \"pm test --help\" for linked-test entry contracts.',\n ],\n recovery: buildCommanderRecoveryPayload(context, retryCommand ? { suggested_retry: retryCommand } : {}),\n });\n}\n\nfunction buildCommanderErrorGuidance(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n const guidance =\n buildMissingRequiredOptionGuidance(message, commandName, allowedTypes, context) ??\n buildMissingRequiredArgumentGuidance(message, commandName, context) ??\n buildUnknownOptionGuidance(message, commandName, context) ??\n buildUnknownCommandGuidance(message, context) ??\n buildLinkedTestValueNotQuotedGuidance(message, commandName, allowedTypes, context);\n if (guidance) {\n return guidance;\n }\n\n return makeGuidanceMessage({\n code: \"invalid_command_usage\",\n title: \"Invalid command usage\",\n happened: message,\n required: \"Use the command with valid arguments and options.\",\n why: \"Commander validates CLI contracts before execution.\",\n examples: [\"pm --help\", `pm ${commandName ?? \"<command>\"} --help`],\n recovery: buildCommanderRecoveryPayload(context),\n });\n}\n\n/**\n * Implements format pm cli error for display for the public runtime surface of this module.\n */\nexport function formatPmCliErrorForDisplay(rawMessage: string, context?: PmCliErrorContext): string {\n return renderGuidanceMessage(buildPmCliErrorGuidance(rawMessage, context));\n}\n\n/**\n * Implements classify pm cli error for the public runtime surface of this module.\n */\nexport function classifyPmCliError(rawMessage: string, context?: PmCliErrorContext): ErrorClassification {\n return guidanceToClassification(buildPmCliErrorGuidance(rawMessage, context));\n}\n\n/**\n * Implements format pm cli error for json for the public runtime surface of this module.\n */\nexport function formatPmCliErrorForJson(rawMessage: string, exitCode: number, context?: PmCliErrorContext): JsonErrorEnvelope {\n return guidanceToJsonEnvelope(buildPmCliErrorGuidance(rawMessage, context), exitCode);\n}\n\n/**\n * Implements format commander error for display for the public runtime surface of this module.\n */\nexport function formatCommanderErrorForDisplay(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): string {\n return renderGuidanceMessage(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context));\n}\n\n/**\n * Implements classify commander error for the public runtime surface of this module.\n */\nexport function classifyCommanderError(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n context?: CommanderGuidanceContext,\n): ErrorClassification {\n return guidanceToClassification(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context));\n}\n\n/**\n * Implements format commander error for json for the public runtime surface of this module.\n */\nexport function formatCommanderErrorForJson(\n rawMessage: string,\n commandName: string | undefined,\n allowedTypes: string,\n exitCode: number,\n context?: CommanderGuidanceContext,\n): JsonErrorEnvelope {\n return guidanceToJsonEnvelope(buildCommanderErrorGuidance(rawMessage, commandName, allowedTypes, context), exitCode);\n}\n\n/**\n * Implements format unknown error for json for the public runtime surface of this module.\n */\nexport function formatUnknownErrorForJson(rawMessage: string, exitCode: number): JsonErrorEnvelope {\n const guidance = buildUnknownErrorGuidance(rawMessage);\n return guidanceToJsonEnvelope(guidance, exitCode);\n}\n\nfunction buildUnknownErrorGuidance(rawMessage: string): GuidanceMessage {\n const message = normalizeMessage(rawMessage);\n if (isModuleResolutionErrorMessage(message)) {\n return makeGuidanceMessage({\n code: \"module_import_failed\",\n title: \"Module import failed\",\n happened: message,\n required: \"Ensure the active checkout is built and any package or extension entry file exists before retrying.\",\n why: \"Node could not resolve an imported module. In pm this usually means an extension/package entrypoint, build artifact, or dependency is missing from the active runtime.\",\n examples: [\"pnpm build\", \"pm package manage --doctor --project\", \"pm health --check-only --json\"],\n nextSteps: [\n \"Rebuild the checkout or package that provides the missing module.\",\n \"Run package doctor for installed extensions when the failure follows package installation or activation.\",\n \"Rerun the original pm command after the runtime files are present.\",\n ],\n });\n }\n\n return makeGuidanceMessage({\n code: \"unknown_error\",\n title: \"Unhandled error\",\n happened: message,\n required: \"Inspect command input and runtime state, then retry.\",\n why: \"Unexpected runtime failures can occur from environment or extension-level issues.\",\n examples: [\"pm --help\", \"pm health --json\"],\n });\n}\n\n/**\n * Implements classify unknown error for the public runtime surface of this module.\n */\nexport function classifyUnknownError(rawMessage: string): ErrorClassification {\n return guidanceToClassification(buildUnknownErrorGuidance(rawMessage));\n}\n\nexport const _testOnly = {\n applyPmCliErrorContext,\n appendIfMissing,\n buildCommanderRecoveryPayload,\n buildFallbackTitleFromMessage,\n commandExampleForRequiredOption,\n dedupeStrings,\n guidanceToClassification,\n guidanceToJsonEnvelope,\n normalizeRecoveryPayload,\n renderList,\n resolveKnownPackageCommandHint,\n};\n"],"names":[],"mappings":";;AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA2DlD,+EAA+E;AAC/E,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAS;IACvD,iBAAiB;IACjB,gBAAgB;IAChB,yBAAyB;IACzB,2BAA2B;IAC3B,wBAAwB;IACxB,uBAAuB;IACvB,gBAAgB;CACjB,CAAC,CAAC;AAEH,SAAS,8BAA8B,CAAC,OAAwB;IAC9D,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,gCAAgC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,oBAAoB,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,SAA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CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,eAAe;IACf,6BAA6B;IAC7B,6BAA6B;IAC7B,+BAA+B;IAC/B,aAAa;IACb,wBAAwB;IACxB,sBAAsB;IACtB,wBAAwB;IACxB,UAAU;IACV,8BAA8B;CAC/B,CAAC","debugId":"594fd898-5ce1-5e77-8731-5bcd90c16f9a"}
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Extension Command Options.
5
5
  */
6
6
 
7
- !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]="006c671c-d2fc-5908-8431-08bc7e418184")}catch(e){}}();
7
+ !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]="23023585-f2dc-5ec7-a046-cc39355aaf59")}catch(e){}}();
8
8
  import { EXIT_CODE } from "../core/shared/constants.js";
9
9
  import { PmCliError } from "../core/shared/errors.js";
10
10
  import { flattenFlagListValue, resolveFlagValueKind } from "../core/extensions/flag-value-types.js";
@@ -191,29 +191,42 @@ export function validateLooseCommandOptionsWithFlagDefinitions(options, definiti
191
191
  }
192
192
  }
193
193
  }
194
- function coerceLooseOptionValue(value, kind) {
195
- if (Array.isArray(value)) {
196
- return value.map((entry) => coerceLooseOptionValue(entry, kind));
194
+ /**
195
+ * Coerce a scalar value to a string. Existing strings pass through untouched and
196
+ * the `null`/`undefined` sentinels are preserved so an explicitly-cleared flag
197
+ * stays distinguishable from an omitted one; every other primitive is stringified.
198
+ */
199
+ function coerceLooseStringOptionValue(value) {
200
+ if (typeof value === "string") {
201
+ return value;
197
202
  }
198
- if (kind === "string") {
199
- if (typeof value === "string") {
200
- return value;
201
- }
202
- if (value === null || value === undefined) {
203
- return value;
204
- }
205
- return String(value);
203
+ if (value === null || value === undefined) {
204
+ return value;
206
205
  }
207
- if (kind === "number") {
208
- if (typeof value === "number") {
209
- return Number.isFinite(value) ? value : value;
210
- }
211
- if (typeof value === "string" && value.trim().length > 0) {
212
- const parsed = Number(value);
213
- return Number.isFinite(parsed) ? parsed : value;
214
- }
206
+ return String(value);
207
+ }
208
+ /**
209
+ * Coerce a scalar value to a number. Existing numbers pass through; a non-blank
210
+ * numeric string is parsed and adopted only when it yields a finite number,
211
+ * otherwise the original value is returned unchanged so malformed input reaches
212
+ * validation rather than silently degrading to `NaN`.
213
+ */
214
+ function coerceLooseNumberOptionValue(value) {
215
+ if (typeof value === "number") {
215
216
  return value;
216
217
  }
218
+ if (typeof value === "string" && value.trim().length > 0) {
219
+ const parsed = Number(value);
220
+ return Number.isFinite(parsed) ? parsed : value;
221
+ }
222
+ return value;
223
+ }
224
+ /**
225
+ * Coerce a scalar value to a boolean. Booleans pass through; the case-insensitive
226
+ * tokens `true`/`1` and `false`/`0` map to their boolean values and any other
227
+ * input is returned unchanged for validation to reject.
228
+ */
229
+ function coerceLooseBooleanOptionValue(value) {
217
230
  if (typeof value === "boolean") {
218
231
  return value;
219
232
  }
@@ -228,6 +241,20 @@ function coerceLooseOptionValue(value, kind) {
228
241
  }
229
242
  return value;
230
243
  }
244
+ // Per-kind scalar coercers dispatched by the declared flag value type. The table
245
+ // keeps `coerceLooseOptionValue` a flat array-or-scalar branch instead of a
246
+ // per-kind `if` ladder.
247
+ const LOOSE_OPTION_VALUE_COERCERS = {
248
+ string: coerceLooseStringOptionValue,
249
+ number: coerceLooseNumberOptionValue,
250
+ boolean: coerceLooseBooleanOptionValue,
251
+ };
252
+ function coerceLooseOptionValue(value, kind) {
253
+ if (Array.isArray(value)) {
254
+ return value.map((entry) => coerceLooseOptionValue(entry, kind));
255
+ }
256
+ return LOOSE_OPTION_VALUE_COERCERS[kind](value);
257
+ }
231
258
  /**
232
259
  * Flatten a (possibly repeated and/or comma-joined) value into a list, applying
233
260
  * the declared coercion kind per element. Mirrors how core list flags such as
@@ -386,4 +413,4 @@ export function stripLooseCommandOptionTokens(args, definitions) {
386
413
  return stripped;
387
414
  }
388
415
  //# sourceMappingURL=extension-command-options.js.map
389
- //# debugId=006c671c-d2fc-5908-8431-08bc7e418184
416
+ //# debugId=23023585-f2dc-5ec7-a046-cc39355aaf59