@unbrained/pm-cli 2026.6.19 → 2026.6.21

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 (545) hide show
  1. package/CHANGELOG.md +328 -258
  2. package/README.md +1 -1
  3. package/dist/cli/bootstrap-args.d.ts +12 -1
  4. package/dist/cli/bootstrap-args.js +20 -9
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.js +31 -25
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/completion.js +3 -3
  9. package/dist/cli/commands/completion.js.map +1 -1
  10. package/dist/cli/commands/contracts.js +4 -3
  11. package/dist/cli/commands/contracts.js.map +1 -1
  12. package/dist/cli/commands/eval.d.ts +62 -0
  13. package/dist/cli/commands/eval.js +158 -0
  14. package/dist/cli/commands/eval.js.map +1 -0
  15. package/dist/cli/commands/extension/install-sources.d.ts +12 -0
  16. package/dist/cli/commands/extension/install-sources.js +77 -10
  17. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  18. package/dist/cli/commands/extension/scaffold.js +49 -3
  19. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  20. package/dist/cli/commands/extension.js +9 -2
  21. package/dist/cli/commands/extension.js.map +1 -1
  22. package/dist/cli/commands/gc.d.ts +12 -1
  23. package/dist/cli/commands/gc.js +53 -6
  24. package/dist/cli/commands/gc.js.map +1 -1
  25. package/dist/cli/commands/health.js +27 -9
  26. package/dist/cli/commands/health.js.map +1 -1
  27. package/dist/cli/commands/index.d.ts +1 -0
  28. package/dist/cli/commands/index.js +3 -2
  29. package/dist/cli/commands/index.js.map +1 -1
  30. package/dist/cli/commands/linked-artifacts.js +13 -3
  31. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  32. package/dist/cli/commands/list.js +12 -9
  33. package/dist/cli/commands/list.js.map +1 -1
  34. package/dist/cli/commands/plan.js +2 -2
  35. package/dist/cli/commands/plan.js.map +1 -1
  36. package/dist/cli/commands/restore.js +5 -11
  37. package/dist/cli/commands/restore.js.map +1 -1
  38. package/dist/cli/commands/search.d.ts +39 -1
  39. package/dist/cli/commands/search.js +89 -12
  40. package/dist/cli/commands/search.js.map +1 -1
  41. package/dist/cli/commands/update.js +96 -58
  42. package/dist/cli/commands/update.js.map +1 -1
  43. package/dist/cli/commands/validate.d.ts +1 -1
  44. package/dist/cli/commands/validate.js +44 -2
  45. package/dist/cli/commands/validate.js.map +1 -1
  46. package/dist/cli/extension-command-help.d.ts +9 -0
  47. package/dist/cli/extension-command-help.js +13 -2
  48. package/dist/cli/extension-command-help.js.map +1 -1
  49. package/dist/cli/extension-command-options.d.ts +8 -0
  50. package/dist/cli/extension-command-options.js +27 -2
  51. package/dist/cli/extension-command-options.js.map +1 -1
  52. package/dist/cli/help-content.js +15 -2
  53. package/dist/cli/help-content.js.map +1 -1
  54. package/dist/cli/main.d.ts +12 -0
  55. package/dist/cli/main.js +49 -9
  56. package/dist/cli/main.js.map +1 -1
  57. package/dist/cli/register-list-query.js +34 -4
  58. package/dist/cli/register-list-query.js.map +1 -1
  59. package/dist/cli/register-operations.js +3 -3
  60. package/dist/cli/register-operations.js.map +1 -1
  61. package/dist/cli-bundle/chunks/activity-CIHV64UC.js +18 -0
  62. package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js → activity-KW3IRP44.js} +11 -11
  63. package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js → aggregate-3ZKQG5SW.js} +10 -10
  64. package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js → aggregate-FIGQEIL3.js} +10 -10
  65. package/dist/cli-bundle/chunks/{append-BP2ARHOK.js → append-EWJYJ7CH.js} +8 -8
  66. package/dist/cli-bundle/chunks/{append-5U3XR5SD.js → append-QEOLX3XB.js} +8 -8
  67. package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js → chunk-2EIMPCE4.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-MAKOMXVM.js → chunk-2GCDRRIF.js} +106 -67
  69. package/dist/cli-bundle/chunks/chunk-2GCDRRIF.js.map +1 -0
  70. package/dist/cli-bundle/chunks/{search-AZR2JITW.js → chunk-2PKHRP6G.js} +190 -22
  71. package/dist/cli-bundle/chunks/chunk-2PKHRP6G.js.map +7 -0
  72. package/dist/cli-bundle/chunks/{chunk-YWAYOWDQ.js → chunk-32R4PIC6.js} +118 -15
  73. package/dist/cli-bundle/chunks/chunk-32R4PIC6.js.map +1 -0
  74. package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js → chunk-37QXHBIB.js} +3 -3
  75. package/dist/cli-bundle/chunks/{chunk-UCNEPMPY.js → chunk-3EWSGA7N.js} +105 -66
  76. package/dist/cli-bundle/chunks/chunk-3EWSGA7N.js.map +7 -0
  77. package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js → chunk-3MDHREEV.js} +3 -3
  78. package/dist/cli-bundle/chunks/{chunk-I2VJM36R.js → chunk-434HM6Z5.js} +21 -21
  79. package/dist/cli-bundle/chunks/chunk-434HM6Z5.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{chunk-Y4IBSEQ2.js → chunk-52OCIDPG.js} +20 -8
  81. package/dist/cli-bundle/chunks/chunk-52OCIDPG.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js → chunk-5FIEHKEX.js} +5 -5
  83. package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js → chunk-5IDI42VV.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-UA4ANRJY.js → chunk-5PCI3UBT.js} +119 -16
  85. package/dist/cli-bundle/chunks/chunk-5PCI3UBT.js.map +7 -0
  86. package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js → chunk-5QICDWMV.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js → chunk-6CJWZAN7.js} +7 -7
  88. package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js → chunk-6H4LF7AO.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js → chunk-6M4RJS4M.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-4BFNWAMQ.js → chunk-6ZXM2XNF.js} +29 -12
  91. package/dist/cli-bundle/chunks/chunk-6ZXM2XNF.js.map +7 -0
  92. package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js → chunk-76Z3YSHV.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js → chunk-7D3SAQXM.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-DVUU3AHP.js → chunk-A4Z7ZOL5.js} +17 -6
  95. package/dist/cli-bundle/chunks/chunk-A4Z7ZOL5.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js → chunk-AIS5PGI3.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js → chunk-AZMOLBN3.js} +7 -7
  98. package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js → chunk-B473GZWW.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js → chunk-C3AZ5ZML.js} +15 -15
  100. package/dist/cli-bundle/chunks/{chunk-S673PVHD.js → chunk-C4N5I7ZW.js} +3 -3
  101. package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js → chunk-CF55WVVS.js} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js → chunk-CZPXY7UW.js} +3 -3
  103. package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js → chunk-CZUB4XWO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js → chunk-D7FYS6PG.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-5SRID7DV.js → chunk-EBH56IXK.js} +29 -12
  106. package/dist/cli-bundle/chunks/chunk-EBH56IXK.js.map +1 -0
  107. package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js → chunk-F5NZWFSW.js} +7 -7
  108. package/dist/cli-bundle/chunks/{chunk-PSWSQHM7.js → chunk-F7K5GWP3.js} +15 -19
  109. package/dist/cli-bundle/chunks/chunk-F7K5GWP3.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js → chunk-FKBDKV7Y.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js → chunk-FRUFKWNK.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js → chunk-FWPDUYEY.js} +7 -7
  113. package/dist/cli-bundle/chunks/{search-2JX776KX.js → chunk-GMHPNNYG.js} +184 -23
  114. package/dist/cli-bundle/chunks/chunk-GMHPNNYG.js.map +1 -0
  115. package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js → chunk-GOZUHWFD.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js → chunk-H7NJZWG2.js} +15 -15
  117. package/dist/cli-bundle/chunks/{chunk-FPQA4ZMA.js → chunk-HC4AWIKT.js} +18 -7
  118. package/dist/cli-bundle/chunks/chunk-HC4AWIKT.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js → chunk-HCU6WUSY.js} +9 -9
  120. package/dist/cli-bundle/chunks/{chunk-2RI3BDFK.js → chunk-HIP7WVTL.js} +10 -9
  121. package/dist/cli-bundle/chunks/chunk-HIP7WVTL.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-5QLHQK7V.js → chunk-HMOADQVT.js} +26 -26
  123. package/dist/cli-bundle/chunks/chunk-HMOADQVT.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-K5TD74VU.js → chunk-J4MYYSOL.js} +19 -7
  125. package/dist/cli-bundle/chunks/chunk-J4MYYSOL.js.map +7 -0
  126. package/dist/cli-bundle/chunks/{chunk-GDOTTY2S.js → chunk-JINYH2DB.js} +40 -2
  127. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-EMFDZ7N3.js → chunk-LEU5GHRC.js} +55 -5
  129. package/dist/cli-bundle/chunks/chunk-LEU5GHRC.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js → chunk-LUWW7L4B.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js → chunk-M5XALUSL.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js → chunk-N5ZJACJ6.js} +8 -8
  133. package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js → chunk-NB3PYLQ6.js} +7 -5
  134. package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js → chunk-NIGXMNNI.js} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js → chunk-NIUEXCFS.js} +6 -6
  136. package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js → chunk-NJHMAJ6N.js} +8 -8
  137. package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js → chunk-NJN7LL7U.js} +5 -5
  138. package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js → chunk-NSBZ2CKF.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-ZZEM2PH7.js → chunk-NXS7ZKAK.js} +19 -14
  140. package/dist/cli-bundle/chunks/chunk-NXS7ZKAK.js.map +1 -0
  141. package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js → chunk-O47BPOPC.js} +2 -2
  142. package/dist/cli-bundle/chunks/{chunk-X26ODPU4.js → chunk-OFYMIDF2.js} +14 -18
  143. package/dist/cli-bundle/chunks/chunk-OFYMIDF2.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js → chunk-OTHIWLMB.js} +7 -5
  145. package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js → chunk-PFSRUHDH.js} +9 -9
  146. package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js → chunk-PP2U4NMT.js} +5 -5
  147. package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js → chunk-PUH4D67U.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js → chunk-Q2J2HJUN.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-QSH34DSQ.js → chunk-QGG32QHW.js} +61 -4
  150. package/dist/cli-bundle/chunks/chunk-QGG32QHW.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js → chunk-QQHISQBJ.js} +3 -3
  152. package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js → chunk-QZTWBFXJ.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-COHNQLB2.js → chunk-R2EMWY7Q.js} +41 -3
  154. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js → chunk-RLK7P77C.js} +5 -5
  156. package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js → chunk-RVHYI7SL.js} +8 -8
  157. package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js → chunk-SBGXDO7A.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js → chunk-SRYYRVPB.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js → chunk-SX75ADBK.js} +6 -6
  160. package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js → chunk-TKBHZPKD.js} +3 -3
  161. package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js → chunk-UEMNL33O.js} +8 -8
  162. package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js → chunk-UPE3CDD7.js} +7 -7
  163. package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js → chunk-UV6IYE5U.js} +2 -2
  164. package/dist/cli-bundle/chunks/{chunk-YOGXK3ON.js → chunk-WQ7NIVDK.js} +18 -13
  165. package/dist/cli-bundle/chunks/chunk-WQ7NIVDK.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js → chunk-YCJX76PW.js} +2 -2
  167. package/dist/cli-bundle/chunks/{chunk-FP7YLQ52.js → chunk-Z6T4PQI2.js} +11 -10
  168. package/dist/cli-bundle/chunks/chunk-Z6T4PQI2.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js → claim-RC56YUWG.js} +10 -10
  170. package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js → claim-THOJ6CMV.js} +10 -10
  171. package/dist/cli-bundle/chunks/close-DNMHGOCX.js +15 -0
  172. package/dist/cli-bundle/chunks/{close-3TSX6BYF.js → close-SG5MNCVQ.js} +8 -8
  173. package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js → close-many-3L3AQZBU.js} +15 -15
  174. package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js → close-many-DKQLBGLV.js} +15 -15
  175. package/dist/cli-bundle/chunks/{comments-M7PAINZT.js → comments-M7ZOZNBX.js} +10 -10
  176. package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js → comments-SKWMDWCW.js} +10 -10
  177. package/dist/cli-bundle/chunks/{config-YICACPHA.js → config-7CK62S7T.js} +30 -10
  178. package/dist/cli-bundle/chunks/config-7CK62S7T.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{config-UWF3KRP5.js → config-OZCUABPB.js} +29 -9
  180. package/dist/cli-bundle/chunks/config-OZCUABPB.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{context-EGUGU4K7.js → context-OEC366TO.js} +13 -13
  182. package/dist/cli-bundle/chunks/{context-V32ZAPL6.js → context-PUG2A7RC.js} +13 -13
  183. package/dist/cli-bundle/chunks/{contracts-B2YWYUV5.js → contracts-3THOLA7L.js} +10 -8
  184. package/dist/cli-bundle/chunks/contracts-3THOLA7L.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{contracts-7G553BHP.js → contracts-N65FXEOL.js} +10 -8
  186. package/dist/cli-bundle/chunks/contracts-N65FXEOL.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js → copy-6QLHILAC.js} +7 -7
  188. package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js → copy-JPX7VZCH.js} +7 -7
  189. package/dist/cli-bundle/chunks/create-NNP6TSFO.js +30 -0
  190. package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js → create-Y54ZVVZH.js} +14 -14
  191. package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js → delete-63PCMQAJ.js} +7 -7
  192. package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js → delete-GDSMGAGJ.js} +7 -7
  193. package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js → deps-T4ZF5G54.js} +7 -7
  194. package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js → deps-XYQ73XRH.js} +7 -7
  195. package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js → docs-C75YIXHC.js} +10 -9
  196. package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js.map → docs-C75YIXHC.js.map} +1 -1
  197. package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js → docs-EHNPDWUL.js} +12 -11
  198. package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js.map → docs-EHNPDWUL.js.map} +1 -1
  199. package/dist/cli-bundle/chunks/eval-3WKDTRMH.js +276 -0
  200. package/dist/cli-bundle/chunks/eval-3WKDTRMH.js.map +1 -0
  201. package/dist/cli-bundle/chunks/eval-GTENKE24.js +286 -0
  202. package/dist/cli-bundle/chunks/eval-GTENKE24.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js → extension-46NWACO3.js} +5 -5
  204. package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js → extension-D5FDZ2CO.js} +5 -5
  205. package/dist/cli-bundle/chunks/{files-TXEQOA7C.js → files-DSZBOSSN.js} +12 -11
  206. package/dist/cli-bundle/chunks/{files-TXEQOA7C.js.map → files-DSZBOSSN.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{files-UAZFB3EA.js → files-X3H7CCBQ.js} +10 -9
  208. package/dist/cli-bundle/chunks/{files-UAZFB3EA.js.map → files-X3H7CCBQ.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{focus-UGROAMAX.js → focus-5STQXDPU.js} +8 -8
  210. package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js → focus-MDVPOWB5.js} +8 -8
  211. package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js +395 -0
  212. package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js.map +7 -0
  213. package/dist/cli-bundle/chunks/gc-ZMST3WQP.js +385 -0
  214. package/dist/cli-bundle/chunks/gc-ZMST3WQP.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{get-OTXPLWYW.js → get-J2IPJRZW.js} +11 -11
  216. package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js → get-NT7L2HUZ.js} +11 -11
  217. package/dist/cli-bundle/chunks/{health-PPTJ7XKW.js → health-IVMA3XQC.js} +38 -26
  218. package/dist/cli-bundle/chunks/health-IVMA3XQC.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{health-JEBESKID.js → health-WOYBR3KU.js} +37 -25
  220. package/dist/cli-bundle/chunks/health-WOYBR3KU.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{history-HNWBUDMI.js → history-RLH2QCRO.js} +10 -10
  222. package/dist/cli-bundle/chunks/history-WX3MGFS2.js +20 -0
  223. package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js → history-compact-UXDIFC33.js} +12 -12
  224. package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js → history-compact-ZBEBGJM7.js} +12 -12
  225. package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js → history-redact-P7I7AWMB.js} +11 -11
  226. package/dist/cli-bundle/chunks/history-redact-YQGU3XRA.js +21 -0
  227. package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js → history-repair-52KINVIK.js} +12 -12
  228. package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js → history-repair-RM5ITLU5.js} +12 -12
  229. package/dist/cli-bundle/chunks/{init-QGK4JFF6.js → init-2BNZOO6F.js} +10 -10
  230. package/dist/cli-bundle/chunks/init-SC2P6CHP.js +20 -0
  231. package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js → learnings-W6F3FIPL.js} +10 -10
  232. package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js → learnings-YGYVHWJK.js} +10 -10
  233. package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js → list-K6FPV4J4.js} +10 -10
  234. package/dist/cli-bundle/chunks/{list-KOJN23UL.js → list-KPAYU5KZ.js} +10 -10
  235. package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js → notes-PU74EPKV.js} +10 -10
  236. package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js → notes-YTD6ZILW.js} +10 -10
  237. package/dist/cli-bundle/chunks/{plan-X3STKLED.js → plan-FNXHXRCI.js} +15 -15
  238. package/dist/cli-bundle/chunks/plan-FNXHXRCI.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{plan-BK3OMLGP.js → plan-GEQYUCBW.js} +16 -16
  240. package/dist/cli-bundle/chunks/plan-GEQYUCBW.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{register-list-query-XDLFESU7.js → register-list-query-PHWYHENI.js} +43 -22
  242. package/dist/cli-bundle/chunks/register-list-query-PHWYHENI.js.map +1 -0
  243. package/dist/cli-bundle/chunks/{register-list-query-FUMXPWZ4.js → register-list-query-QI45RMKN.js} +42 -21
  244. package/dist/cli-bundle/chunks/register-list-query-QI45RMKN.js.map +7 -0
  245. package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js → register-mutation-X3BUOQEL.js} +33 -33
  246. package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js → register-mutation-YINRTS7L.js} +33 -33
  247. package/dist/cli-bundle/chunks/{register-operations-DGSHCS75.js → register-operations-E5JEASRK.js} +35 -35
  248. package/dist/cli-bundle/chunks/register-operations-E5JEASRK.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js → register-operations-MIDTRW7S.js} +34 -34
  250. package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js.map → register-operations-MIDTRW7S.js.map} +2 -2
  251. package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js → register-setup-DYBFLEZX.js} +15 -15
  252. package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js → register-setup-EG2U6CEU.js} +15 -15
  253. package/dist/cli-bundle/chunks/restore-5KHR2YYQ.js +19 -0
  254. package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js → restore-XQYSWBV7.js} +11 -11
  255. package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js → scheduling-shortcuts-HJMTEXKE.js} +14 -14
  256. package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js → scheduling-shortcuts-NNT5ASZR.js} +14 -14
  257. package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js → schema-263RI4WW.js} +9 -9
  258. package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js → schema-TZXW6XWD.js} +9 -9
  259. package/dist/cli-bundle/chunks/search-LECJYSXE.js +33 -0
  260. package/dist/cli-bundle/chunks/search-SFRJOVDG.js +37 -0
  261. package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js → stats-N7ER2PNK.js} +8 -8
  262. package/dist/cli-bundle/chunks/{stats-J563NJBY.js → stats-VPBGSRQH.js} +8 -8
  263. package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js → telemetry-L6K3BUIQ.js} +4 -4
  264. package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js → telemetry-PP3FUNBU.js} +4 -4
  265. package/dist/cli-bundle/chunks/{test-47UQGEXE.js → test-3EGNS3T5.js} +15 -15
  266. package/dist/cli-bundle/chunks/{test-55RJCGRU.js → test-RQCTSWUK.js} +15 -15
  267. package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js → test-all-NJ5V2QFS.js} +15 -15
  268. package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js → test-all-ZHFAWNC3.js} +15 -15
  269. package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js → test-runs-AJHR6IQF.js} +5 -5
  270. package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js → test-runs-GN3C6GOI.js} +5 -5
  271. package/dist/cli-bundle/chunks/update-6YXOGHRT.js +24 -0
  272. package/dist/cli-bundle/chunks/update-6YXOGHRT.js.map +7 -0
  273. package/dist/cli-bundle/chunks/update-V33YUBRP.js +28 -0
  274. package/dist/cli-bundle/chunks/update-V33YUBRP.js.map +1 -0
  275. package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js → update-many-N2AN6ZDH.js} +23 -23
  276. package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js → update-many-RYQ64CFW.js} +23 -23
  277. package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js → upgrade-TJXFLZIX.js} +5 -5
  278. package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js → upgrade-VPCIYAVW.js} +5 -5
  279. package/dist/cli-bundle/chunks/{validate-GVY4VE43.js → validate-JMNWEUYF.js} +62 -24
  280. package/dist/cli-bundle/chunks/validate-JMNWEUYF.js.map +1 -0
  281. package/dist/cli-bundle/chunks/{validate-ADKGN37M.js → validate-PHKIYGSY.js} +61 -23
  282. package/dist/cli-bundle/chunks/validate-PHKIYGSY.js.map +7 -0
  283. package/dist/cli-bundle/main.js +133 -55
  284. package/dist/cli-bundle/main.js.map +2 -2
  285. package/dist/core/checkpoint/checkpoint-gc.d.ts +69 -0
  286. package/dist/core/checkpoint/checkpoint-gc.js +175 -0
  287. package/dist/core/checkpoint/checkpoint-gc.js.map +1 -0
  288. package/dist/core/config/nested-settings.js +22 -2
  289. package/dist/core/config/nested-settings.js.map +1 -1
  290. package/dist/core/diagnostics/remediation.js +40 -2
  291. package/dist/core/diagnostics/remediation.js.map +1 -1
  292. package/dist/core/extensions/extension-types.d.ts +0 -9
  293. package/dist/core/extensions/extension-types.js +2 -27
  294. package/dist/core/extensions/extension-types.js.map +1 -1
  295. package/dist/core/fs/fs-utils.d.ts +17 -1
  296. package/dist/core/fs/fs-utils.js +19 -3
  297. package/dist/core/fs/fs-utils.js.map +1 -1
  298. package/dist/core/history/drift-scan.d.ts +17 -5
  299. package/dist/core/history/drift-scan.js +22 -14
  300. package/dist/core/history/drift-scan.js.map +1 -1
  301. package/dist/core/history/replay.d.ts +7 -0
  302. package/dist/core/history/replay.js +11 -6
  303. package/dist/core/history/replay.js.map +1 -1
  304. package/dist/core/item/item-format-version.d.ts +87 -0
  305. package/dist/core/item/item-format-version.js +85 -0
  306. package/dist/core/item/item-format-version.js.map +1 -0
  307. package/dist/core/item/item-format.js +8 -2
  308. package/dist/core/item/item-format.js.map +1 -1
  309. package/dist/core/item/status-filter.d.ts +7 -3
  310. package/dist/core/item/status-filter.js +26 -5
  311. package/dist/core/item/status-filter.js.map +1 -1
  312. package/dist/core/search/bm25.d.ts +113 -0
  313. package/dist/core/search/bm25.js +178 -0
  314. package/dist/core/search/bm25.js.map +1 -0
  315. package/dist/core/search/eval.d.ts +114 -0
  316. package/dist/core/search/eval.js +217 -0
  317. package/dist/core/search/eval.js.map +1 -0
  318. package/dist/core/sentry/instrument.d.ts +14 -0
  319. package/dist/core/sentry/instrument.js +43 -3
  320. package/dist/core/sentry/instrument.js.map +1 -1
  321. package/dist/core/shared/constants.js +6 -2
  322. package/dist/core/shared/constants.js.map +1 -1
  323. package/dist/core/store/paths.js +4 -3
  324. package/dist/core/store/paths.js.map +1 -1
  325. package/dist/core/store/settings-validator.d.ts +7 -0
  326. package/dist/core/store/settings-validator.js +10 -2
  327. package/dist/core/store/settings-validator.js.map +1 -1
  328. package/dist/core/store/settings.js +6 -2
  329. package/dist/core/store/settings.js.map +1 -1
  330. package/dist/mcp/tool-definitions.js +4 -3
  331. package/dist/mcp/tool-definitions.js.map +1 -1
  332. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  333. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  334. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  335. package/dist/sdk/cli-contracts/tool-parameter-tables.js +4 -4
  336. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  337. package/dist/sdk/cli-contracts.d.ts +1 -0
  338. package/dist/sdk/cli-contracts.js +11 -2
  339. package/dist/sdk/cli-contracts.js.map +1 -1
  340. package/dist/sdk/index.d.ts +2 -2
  341. package/dist/sdk/index.js +3 -3
  342. package/dist/sdk/index.js.map +1 -1
  343. package/dist/sdk/runtime.d.ts +1 -0
  344. package/dist/sdk/runtime.js +3 -2
  345. package/dist/sdk/runtime.js.map +1 -1
  346. package/dist/sdk/testing.d.ts +48 -1
  347. package/dist/sdk/testing.js +98 -2
  348. package/dist/sdk/testing.js.map +1 -1
  349. package/dist/types.d.ts +26 -0
  350. package/dist/types.js +2 -2
  351. package/dist/types.js.map +1 -1
  352. package/docs/AGENT_GUIDE.md +1 -0
  353. package/docs/ARCHITECTURE.md +126 -11
  354. package/docs/CLAUDE_CODE_PLUGIN.md +5 -13
  355. package/docs/COMMANDS.md +57 -5
  356. package/docs/CONFIGURATION.md +39 -0
  357. package/docs/EXTENSIONS.md +2 -2
  358. package/docs/MIGRATION_CLI_SIMPLIFICATION.md +9 -2
  359. package/docs/QUICKSTART.md +2 -0
  360. package/docs/README.md +2 -0
  361. package/docs/RELEASING.md +2 -1
  362. package/docs/SDK.md +80 -1
  363. package/docs/TESTING.md +18 -0
  364. package/package.json +4 -3
  365. package/packages/pm-command-kit/README.md +4 -0
  366. package/packages/pm-todos/extensions/todos/index.js +2 -0
  367. package/packages/pm-todos/extensions/todos/index.ts +2 -0
  368. package/packages/pm-todos/extensions/todos/runtime.js +192 -9
  369. package/packages/pm-todos/extensions/todos/runtime.ts +211 -8
  370. package/dist/cli-bundle/chunks/activity-62I26XZB.js +0 -18
  371. package/dist/cli-bundle/chunks/chunk-2RI3BDFK.js.map +0 -7
  372. package/dist/cli-bundle/chunks/chunk-4BFNWAMQ.js.map +0 -7
  373. package/dist/cli-bundle/chunks/chunk-5QLHQK7V.js.map +0 -7
  374. package/dist/cli-bundle/chunks/chunk-5SRID7DV.js.map +0 -1
  375. package/dist/cli-bundle/chunks/chunk-COHNQLB2.js.map +0 -1
  376. package/dist/cli-bundle/chunks/chunk-DVUU3AHP.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-EMFDZ7N3.js.map +0 -1
  378. package/dist/cli-bundle/chunks/chunk-FP7YLQ52.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-FPQA4ZMA.js.map +0 -7
  380. package/dist/cli-bundle/chunks/chunk-GDOTTY2S.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-I2VJM36R.js.map +0 -1
  382. package/dist/cli-bundle/chunks/chunk-K5TD74VU.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-MAKOMXVM.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-PSWSQHM7.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-QSH34DSQ.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-UA4ANRJY.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-UCNEPMPY.js.map +0 -7
  388. package/dist/cli-bundle/chunks/chunk-X26ODPU4.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-Y4IBSEQ2.js.map +0 -1
  390. package/dist/cli-bundle/chunks/chunk-YOGXK3ON.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-YWAYOWDQ.js.map +0 -1
  392. package/dist/cli-bundle/chunks/chunk-ZZEM2PH7.js.map +0 -1
  393. package/dist/cli-bundle/chunks/close-TQZK43Z5.js +0 -15
  394. package/dist/cli-bundle/chunks/config-UWF3KRP5.js.map +0 -7
  395. package/dist/cli-bundle/chunks/config-YICACPHA.js.map +0 -1
  396. package/dist/cli-bundle/chunks/contracts-7G553BHP.js.map +0 -1
  397. package/dist/cli-bundle/chunks/contracts-B2YWYUV5.js.map +0 -7
  398. package/dist/cli-bundle/chunks/create-UZLJXHLA.js +0 -30
  399. package/dist/cli-bundle/chunks/gc-5RTYXLQU.js +0 -211
  400. package/dist/cli-bundle/chunks/gc-5RTYXLQU.js.map +0 -7
  401. package/dist/cli-bundle/chunks/gc-FK5732EK.js +0 -208
  402. package/dist/cli-bundle/chunks/gc-FK5732EK.js.map +0 -1
  403. package/dist/cli-bundle/chunks/health-JEBESKID.js.map +0 -7
  404. package/dist/cli-bundle/chunks/health-PPTJ7XKW.js.map +0 -1
  405. package/dist/cli-bundle/chunks/history-TKTULEVE.js +0 -20
  406. package/dist/cli-bundle/chunks/history-redact-SPIFIXVY.js +0 -21
  407. package/dist/cli-bundle/chunks/init-A6FTZ5UC.js +0 -20
  408. package/dist/cli-bundle/chunks/plan-BK3OMLGP.js.map +0 -1
  409. package/dist/cli-bundle/chunks/plan-X3STKLED.js.map +0 -7
  410. package/dist/cli-bundle/chunks/register-list-query-FUMXPWZ4.js.map +0 -7
  411. package/dist/cli-bundle/chunks/register-list-query-XDLFESU7.js.map +0 -1
  412. package/dist/cli-bundle/chunks/register-operations-DGSHCS75.js.map +0 -1
  413. package/dist/cli-bundle/chunks/restore-PI3WM4GK.js +0 -19
  414. package/dist/cli-bundle/chunks/search-2JX776KX.js.map +0 -1
  415. package/dist/cli-bundle/chunks/search-AZR2JITW.js.map +0 -7
  416. package/dist/cli-bundle/chunks/update-2BZEAI7B.js +0 -24
  417. package/dist/cli-bundle/chunks/update-GCNLER2H.js +0 -28
  418. package/dist/cli-bundle/chunks/validate-ADKGN37M.js.map +0 -7
  419. package/dist/cli-bundle/chunks/validate-GVY4VE43.js.map +0 -1
  420. /package/dist/cli-bundle/chunks/{activity-62I26XZB.js.map → activity-CIHV64UC.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js.map → activity-KW3IRP44.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js.map → aggregate-3ZKQG5SW.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js.map → aggregate-FIGQEIL3.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{append-BP2ARHOK.js.map → append-EWJYJ7CH.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{append-5U3XR5SD.js.map → append-QEOLX3XB.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js.map → chunk-2EIMPCE4.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js.map → chunk-37QXHBIB.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js.map → chunk-3MDHREEV.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js.map → chunk-5FIEHKEX.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js.map → chunk-5IDI42VV.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js.map → chunk-5QICDWMV.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js.map → chunk-6CJWZAN7.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js.map → chunk-6H4LF7AO.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js.map → chunk-6M4RJS4M.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js.map → chunk-76Z3YSHV.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js.map → chunk-7D3SAQXM.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js.map → chunk-AIS5PGI3.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js.map → chunk-AZMOLBN3.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js.map → chunk-B473GZWW.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js.map → chunk-C3AZ5ZML.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-S673PVHD.js.map → chunk-C4N5I7ZW.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js.map → chunk-CF55WVVS.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js.map → chunk-CZPXY7UW.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js.map → chunk-CZUB4XWO.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js.map → chunk-D7FYS6PG.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js.map → chunk-F5NZWFSW.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js.map → chunk-FKBDKV7Y.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js.map → chunk-FRUFKWNK.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js.map → chunk-FWPDUYEY.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js.map → chunk-GOZUHWFD.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js.map → chunk-H7NJZWG2.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js.map → chunk-HCU6WUSY.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js.map → chunk-LUWW7L4B.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js.map → chunk-M5XALUSL.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js.map → chunk-N5ZJACJ6.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js.map → chunk-NB3PYLQ6.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js.map → chunk-NIGXMNNI.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js.map → chunk-NIUEXCFS.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js.map → chunk-NJHMAJ6N.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js.map → chunk-NJN7LL7U.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js.map → chunk-NSBZ2CKF.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js.map → chunk-O47BPOPC.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js.map → chunk-OTHIWLMB.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js.map → chunk-PFSRUHDH.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js.map → chunk-PP2U4NMT.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js.map → chunk-PUH4D67U.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js.map → chunk-Q2J2HJUN.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js.map → chunk-QQHISQBJ.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js.map → chunk-QZTWBFXJ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js.map → chunk-RLK7P77C.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js.map → chunk-RVHYI7SL.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js.map → chunk-SBGXDO7A.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js.map → chunk-SRYYRVPB.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js.map → chunk-SX75ADBK.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js.map → chunk-TKBHZPKD.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js.map → chunk-UEMNL33O.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js.map → chunk-UPE3CDD7.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js.map → chunk-UV6IYE5U.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js.map → chunk-YCJX76PW.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js.map → claim-RC56YUWG.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js.map → claim-THOJ6CMV.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{close-TQZK43Z5.js.map → close-DNMHGOCX.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{close-3TSX6BYF.js.map → close-SG5MNCVQ.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js.map → close-many-3L3AQZBU.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js.map → close-many-DKQLBGLV.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{comments-M7PAINZT.js.map → comments-M7ZOZNBX.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js.map → comments-SKWMDWCW.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{context-EGUGU4K7.js.map → context-OEC366TO.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{context-V32ZAPL6.js.map → context-PUG2A7RC.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js.map → copy-6QLHILAC.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js.map → copy-JPX7VZCH.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{create-UZLJXHLA.js.map → create-NNP6TSFO.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js.map → create-Y54ZVVZH.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js.map → delete-63PCMQAJ.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js.map → delete-GDSMGAGJ.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js.map → deps-T4ZF5G54.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js.map → deps-XYQ73XRH.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js.map → extension-46NWACO3.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js.map → extension-D5FDZ2CO.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{focus-UGROAMAX.js.map → focus-5STQXDPU.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js.map → focus-MDVPOWB5.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{get-OTXPLWYW.js.map → get-J2IPJRZW.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js.map → get-NT7L2HUZ.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{history-HNWBUDMI.js.map → history-RLH2QCRO.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{history-TKTULEVE.js.map → history-WX3MGFS2.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js.map → history-compact-UXDIFC33.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js.map → history-compact-ZBEBGJM7.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js.map → history-redact-P7I7AWMB.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{history-redact-SPIFIXVY.js.map → history-redact-YQGU3XRA.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js.map → history-repair-52KINVIK.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js.map → history-repair-RM5ITLU5.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{init-QGK4JFF6.js.map → init-2BNZOO6F.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{init-A6FTZ5UC.js.map → init-SC2P6CHP.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js.map → learnings-W6F3FIPL.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js.map → learnings-YGYVHWJK.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js.map → list-K6FPV4J4.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{list-KOJN23UL.js.map → list-KPAYU5KZ.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js.map → notes-PU74EPKV.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js.map → notes-YTD6ZILW.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js.map → register-mutation-X3BUOQEL.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js.map → register-mutation-YINRTS7L.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js.map → register-setup-DYBFLEZX.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js.map → register-setup-EG2U6CEU.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{restore-PI3WM4GK.js.map → restore-5KHR2YYQ.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js.map → restore-XQYSWBV7.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js.map → scheduling-shortcuts-HJMTEXKE.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js.map → scheduling-shortcuts-NNT5ASZR.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js.map → schema-263RI4WW.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js.map → schema-TZXW6XWD.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{test-55RJCGRU.js.map → search-LECJYSXE.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{test-47UQGEXE.js.map → search-SFRJOVDG.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js.map → stats-N7ER2PNK.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{stats-J563NJBY.js.map → stats-VPBGSRQH.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js.map → telemetry-L6K3BUIQ.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js.map → telemetry-PP3FUNBU.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{update-GCNLER2H.js.map → test-3EGNS3T5.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{update-2BZEAI7B.js.map → test-RQCTSWUK.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js.map → test-all-NJ5V2QFS.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js.map → test-all-ZHFAWNC3.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js.map → test-runs-AJHR6IQF.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js.map → test-runs-GN3C6GOI.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js.map → update-many-N2AN6ZDH.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js.map → update-many-RYQ64CFW.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js.map → upgrade-TJXFLZIX.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js.map → upgrade-VPCIYAVW.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- !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]="b8752893-d53b-5427-b307-3eebeed7bc1e")}catch(e){}}();
2
+ !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]="6d31ea9e-2717-5784-9868-be6e4ccfeaeb")}catch(e){}}();
3
3
  import {
4
4
  resolveAuthor
5
5
  } from "./chunk-T5RRNDA7.js";
@@ -8,16 +8,19 @@ import {
8
8
  createStdinTokenResolver,
9
9
  looksLikeGenericKeyValueEntry,
10
10
  parseCsvKv
11
- } from "./chunk-LEC57E7K.js";
11
+ } from "./chunk-Q2J2HJUN.js";
12
+ import {
13
+ splitCommaList
14
+ } from "./chunk-P4SESZGT.js";
12
15
  import {
13
16
  listAllFrontMatter,
14
17
  locateItem,
15
18
  mutateItem,
16
19
  readLocatedItem
17
- } from "./chunk-GL3QKIET.js";
20
+ } from "./chunk-NIUEXCFS.js";
18
21
  import {
19
22
  resolveItemTypeRegistry
20
- } from "./chunk-BQVESTOG.js";
23
+ } from "./chunk-QZTWBFXJ.js";
21
24
  import {
22
25
  EXIT_CODE,
23
26
  PmCliError,
@@ -27,7 +30,7 @@ import {
27
30
  pathExists,
28
31
  readSettings,
29
32
  resolvePmRoot
30
- } from "./chunk-I2VJM36R.js";
33
+ } from "./chunk-434HM6Z5.js";
31
34
 
32
35
  // dist/cli/commands/linked-artifacts.js
33
36
  import fs from "node:fs/promises";
@@ -54,10 +57,19 @@ function looksLikeStructuredPathEntry(raw) {
54
57
  }
55
58
  return looksLikeGenericKeyValueEntry(raw);
56
59
  }
60
+ function expandBareCommaSeparatedAddEntries(raw) {
61
+ return raw.flatMap((entry) => {
62
+ const trimmed = entry.trim();
63
+ if (trimmed.length === 0 || looksLikeStructuredPathEntry(trimmed) || !trimmed.includes(",")) {
64
+ return [entry];
65
+ }
66
+ return splitCommaList(trimmed);
67
+ });
68
+ }
57
69
  function parseAddEntries(raw, bareNoun) {
58
70
  if (!raw)
59
71
  return [];
60
- return raw.map((entry) => {
72
+ return expandBareCommaSeparatedAddEntries(raw).map((entry) => {
61
73
  const trimmed = entry.trim();
62
74
  const kv = looksLikeStructuredPathEntry(trimmed) ? parseCsvKv(entry, "--add") : { path: trimmed };
63
75
  assertNoUnknownCsvKeys(kv, "--add", LINKED_ARTIFACT_ADD_KEYS);
@@ -372,6 +384,6 @@ export {
372
384
  runLinkedArtifacts,
373
385
  renameArtifactsResultKey
374
386
  };
375
- //# sourceMappingURL=chunk-Y4IBSEQ2.js.map
387
+ //# sourceMappingURL=chunk-52OCIDPG.js.map
376
388
 
377
- //# debugId=b8752893-d53b-5427-b307-3eebeed7bc1e
389
+ //# debugId=6d31ea9e-2717-5784-9868-be6e4ccfeaeb
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/linked-artifacts.ts"],"sourcesContent":["/**\n * @module cli/commands/linked-artifacts\n *\n * Implements the pm linked artifacts command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport fg from \"fast-glob\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport {\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n parseCsvKv,\n} from \"../../core/item/parse.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { listAllFrontMatter, locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { SCOPE_VALUES } from \"../../types/index.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { LinkScope } from \"../../types/index.js\";\n\n/**\n * Restricts linked artifact values accepted by command, SDK, and storage contracts.\n */\nexport type LinkedArtifact = {\n path: string;\n scope: LinkScope;\n note?: string;\n};\n\n/** Allowed CSV/markdown keys for each structured linked-artifact option (GH-258). */\nexport const LINKED_ARTIFACT_ADD_KEYS = [\"path\", \"scope\", \"note\"] as const;\nexport const LINKED_ARTIFACT_ADD_GLOB_KEYS = [\"pattern\", \"glob\", \"path\", \"scope\", \"note\"] as const;\nexport const LINKED_ARTIFACT_REMOVE_KEYS = [\"path\"] as const;\nexport const LINKED_ARTIFACT_MIGRATE_KEYS = [\"from\", \"to\"] as const;\n/**\n * Keys that are valid on --add but meaningless on --remove (GH-277). Rejected\n * with audit-trail guidance (--message) rather than the generic unknown-key\n * error so agents are not left believing a removal note was recorded.\n */\nconst LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS: ReadonlySet<string> = new Set([\"note\", \"scope\"]);\n\n/**\n * Documents the linked artifact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedArtifactCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /**\n * GH-170 (pm-pfnx): standalone note applied to every link added by --add /\n * --add-glob in the same invocation. A per-entry embedded note (the\n * `path=...,note=...` pair syntax) takes precedence over this flag.\n * Requires at least one --add/--add-glob; rejected otherwise.\n */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the path migration payload exchanged by command, SDK, and package integrations.\n */\nexport interface PathMigration {\n from: string;\n to: string;\n}\n\n/**\n * Documents the add glob entry payload exchanged by command, SDK, and package integrations.\n */\nexport interface AddGlobEntry {\n pattern: string;\n scope: LinkScope;\n note?: string;\n}\n\n/**\n * Documents the linked path validation payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedPathValidation {\n checked: number;\n existing_files: string[];\n missing_paths: string[];\n non_file_paths: string[];\n}\n\n/**\n * Documents the linked path audit entry payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedPathAuditEntry {\n path: string;\n linked_by_count: number;\n linked_item_ids: string[];\n}\n\n/**\n * Documents the linked artifact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedArtifactResult {\n id: string;\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n artifacts: LinkedArtifact[];\n}\n\n/**\n * Configuration that adapts the shared linked-artifact command core to a\n * specific resource kind (files or docs) while preserving every behavioral\n * detail of the original twin implementations.\n */\nexport interface LinkedArtifactKindConfig {\n /** Metadata key under which the artifacts are stored (e.g. \"files\" | \"docs\"). */\n metadataKey: \"files\" | \"docs\";\n /** Mutation op recorded in history (e.g. \"files_add\" | \"docs_add\"). */\n op: \"files_add\" | \"docs_add\";\n /** Noun used in the \"bare <noun> path\" --add usage error (e.g. \"file\" | \"doc\"). */\n bareNoun: \"file\" | \"doc\";\n /**\n * Whether this kind honors the append-stable option. files supports it;\n * docs always sorts and must never expose append-stable behavior.\n */\n supportsAppendStable: boolean;\n}\n\n/**\n * Implements ensure scope for the public runtime surface of this module.\n */\nexport function ensureScope(raw: string | undefined): LinkScope {\n const value = (raw ?? \"project\") as LinkScope;\n if (!SCOPE_VALUES.includes(value)) {\n throw new PmCliError(\n `Invalid scope \"${raw}\". Valid scopes: ${SCOPE_VALUES.join(\", \")} (default: project).`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/**\n * Implements looks like structured path entry for the public runtime surface of this module.\n */\nexport function looksLikeStructuredPathEntry(raw: string): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n if (/^(?:[-*+]\\s+)?(?:path|scope|note)\\s*[:=]/i.test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `lable=main,path=…`) must still be parsed so the\n // unknown key is rejected rather than swallowed as a bare path (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\nfunction expandBareCommaSeparatedAddEntries(raw: string[]): string[] {\n return raw.flatMap((entry) => {\n const trimmed = entry.trim();\n if (trimmed.length === 0 || looksLikeStructuredPathEntry(trimmed) || !trimmed.includes(\",\")) {\n return [entry];\n }\n return splitCommaList(trimmed);\n });\n}\n\n/**\n * Implements parse add entries for the public runtime surface of this module.\n */\nexport function parseAddEntries(raw: string[] | undefined, bareNoun: \"file\" | \"doc\"): LinkedArtifact[] {\n if (!raw) return [];\n return expandBareCommaSeparatedAddEntries(raw).map((entry) => {\n const trimmed = entry.trim();\n const kv = looksLikeStructuredPathEntry(trimmed) ? parseCsvKv(entry, \"--add\") : { path: trimmed };\n assertNoUnknownCsvKeys(kv, \"--add\", LINKED_ARTIFACT_ADD_KEYS);\n if (!kv.path) {\n throw new PmCliError(`--add requires path=<value> or a bare ${bareNoun} path`, EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureScope(kv.scope),\n note: kv.note?.trim() || undefined,\n };\n });\n}\n\n/**\n * Implements parse add glob entries for the public runtime surface of this module.\n */\nexport function parseAddGlobEntries(raw: string[] | undefined): AddGlobEntry[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) {\n throw new PmCliError(\"--add-glob requires a glob pattern value\", EXIT_CODE.USAGE);\n }\n if (trimmed.includes(\"=\") || /^(?:[-*+]\\s+)?(?:pattern|glob|path)\\s*[:=]/i.test(trimmed) || trimmed.startsWith(\"```\")) {\n const kv = parseCsvKv(trimmed, \"--add-glob\");\n assertNoUnknownCsvKeys(kv, \"--add-glob\", LINKED_ARTIFACT_ADD_GLOB_KEYS);\n const pattern = kv.pattern?.trim() || kv.glob?.trim() || kv.path?.trim();\n if (!pattern) {\n throw new PmCliError(\"--add-glob key/value form requires pattern=<glob>\", EXIT_CODE.USAGE);\n }\n return {\n pattern,\n scope: ensureScope(kv.scope),\n note: kv.note?.trim() || undefined,\n };\n }\n return {\n pattern: trimmed,\n scope: \"project\",\n };\n });\n}\n\n/**\n * Implements parse remove entries for the public runtime surface of this module.\n */\nexport function parseRemoveEntries(raw: string[] | undefined): string[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) {\n throw new PmCliError(\"--remove requires a path value\", EXIT_CODE.USAGE);\n }\n if (trimmed.includes(\"=\") || /^(?:[-*+]\\s+)?path\\s*[:=]/i.test(trimmed) || trimmed.startsWith(\"```\")) {\n const kv = parseCsvKv(trimmed, \"--remove\");\n // GH-277: --remove identifies an existing link by path only; it does not\n // attach per-link metadata. Reject the --add-only keys with guidance toward\n // the audit-trail path (--message) rather than the generic \"unrecognized\n // key\" error, which left agents believing they had recorded a removal note.\n const unsupportedRemoveKeys = Object.keys(kv).filter((key) =>\n LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS.has(key.toLowerCase()),\n );\n if (unsupportedRemoveKeys.length > 0) {\n throw new PmCliError(\n `--remove identifies a linked artifact by path only and does not accept ${unsupportedRemoveKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message \"<why removed>\".`,\n EXIT_CODE.USAGE,\n );\n }\n assertNoUnknownCsvKeys(kv, \"--remove\", LINKED_ARTIFACT_REMOVE_KEYS);\n if (!kv.path) {\n throw new PmCliError(\"--remove key/value form requires path=<value>\", EXIT_CODE.USAGE);\n }\n return kv.path;\n }\n return trimmed;\n });\n}\n\n/**\n * Implements parse migrate entries for the public runtime surface of this module.\n */\nexport function parseMigrateEntries(raw: string[] | undefined): PathMigration[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--migrate\");\n assertNoUnknownCsvKeys(kv, \"--migrate\", LINKED_ARTIFACT_MIGRATE_KEYS);\n const from = kv.from?.trim();\n const to = kv.to?.trim();\n if (!from || !to) {\n throw new PmCliError(\"--migrate requires from=<value> and to=<value>\", EXIT_CODE.USAGE);\n }\n return { from, to };\n });\n}\n\n/**\n * Implements apply path migrations for the public runtime surface of this module.\n */\nexport function applyPathMigrations(artifactPath: string, migrations: PathMigration[]): string {\n let next = artifactPath;\n for (const migration of migrations) {\n if (next.startsWith(migration.from)) {\n next = `${migration.to}${next.slice(migration.from.length)}`;\n }\n }\n return next;\n}\n\n/**\n * Implements normalize linked path for the public runtime surface of this module.\n */\nexport function normalizeLinkedPath(value: string): string {\n return value.split(path.sep).join(\"/\");\n}\n\n/**\n * Implements expand add glob entries for the public runtime surface of this module.\n */\nexport async function expandAddGlobEntries(entries: AddGlobEntry[]): Promise<LinkedArtifact[]> {\n const expanded: LinkedArtifact[] = [];\n for (const entry of entries) {\n const absolutePattern = path.isAbsolute(entry.pattern);\n const matches = await fg(entry.pattern, {\n cwd: process.cwd(),\n absolute: absolutePattern,\n onlyFiles: true,\n dot: true,\n unique: true,\n followSymbolicLinks: true,\n });\n const sortedMatches = [...new Set(matches.map((match) => normalizeLinkedPath(path.normalize(match))))].sort((left, right) =>\n left.localeCompare(right),\n );\n for (const matchedPath of sortedMatches) {\n expanded.push({\n path: matchedPath,\n scope: entry.scope,\n note: entry.note,\n });\n }\n }\n return expanded;\n}\n\n/**\n * GH-170 (pm-pfnx): apply a standalone --note to the links added in this\n * invocation. Semantics (documented on pm-pfnx): the note is attached to EVERY\n * entry added via --add/--add-glob so a single flag annotates the whole batch\n * predictably; a per-entry embedded `note=` wins over the standalone flag; and\n * --note without any --add/--add-glob flag is a usage error because there is\n * nothing to annotate (it never retro-edits existing links). `hasAddFlags`\n * reflects flag presence, not match count, so a glob that legitimately matches\n * zero files is not an error.\n */\nexport function applyStandaloneNote(\n adds: LinkedArtifact[],\n note: string | undefined,\n hasAddFlags: boolean,\n): LinkedArtifact[] {\n if (note === undefined) {\n return adds;\n }\n if (!hasAddFlags) {\n throw new PmCliError(\n \"--note requires --add or --add-glob in the same invocation (the note annotates the links being added)\",\n EXIT_CODE.USAGE,\n );\n }\n const trimmed = note.trim();\n if (trimmed.length === 0) {\n return adds;\n }\n return adds.map((entry) => (entry.note === undefined ? { ...entry, note: trimmed } : entry));\n}\n\n/**\n * Implements artifact key for the public runtime surface of this module.\n */\nexport function artifactKey(value: Pick<LinkedArtifact, \"path\" | \"scope\">): string {\n return `${value.path}::${value.scope}`;\n}\n\n/**\n * Implements sort linked artifacts for the public runtime surface of this module.\n */\nexport function sortLinkedArtifacts(artifacts: LinkedArtifact[]): LinkedArtifact[] {\n return [...artifacts].sort((left, right) => {\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n return left.scope.localeCompare(right.scope);\n });\n}\n\n/**\n * Implements dedupe linked artifacts for the public runtime surface of this module.\n */\nexport function dedupeLinkedArtifacts(artifacts: LinkedArtifact[]): LinkedArtifact[] {\n return [...new Map(artifacts.map((entry) => [artifactKey(entry), entry])).values()].map((entry) => ({\n ...entry,\n note: entry.note?.trim() || undefined,\n }));\n}\n\n/**\n * Implements validate linked paths for the public runtime surface of this module.\n */\nexport async function validateLinkedPaths(paths: string[]): Promise<LinkedPathValidation> {\n const uniquePaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));\n const existingFiles: string[] = [];\n const missingPaths: string[] = [];\n const nonFilePaths: string[] = [];\n for (const relativePath of uniquePaths) {\n const resolvedPath = path.isAbsolute(relativePath) ? relativePath : path.resolve(process.cwd(), relativePath);\n try {\n const stats = await fs.stat(resolvedPath);\n if (stats.isFile()) {\n existingFiles.push(relativePath);\n } else {\n nonFilePaths.push(relativePath);\n }\n } catch (error: unknown) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === \"ENOENT\") {\n missingPaths.push(relativePath);\n continue;\n }\n nonFilePaths.push(relativePath);\n }\n }\n return {\n checked: uniquePaths.length,\n existing_files: existingFiles,\n missing_paths: missingPaths,\n non_file_paths: nonFilePaths,\n };\n}\n\n/**\n * Implements build linked path audit for the public runtime surface of this module.\n */\nexport function buildLinkedPathAudit(\n paths: string[],\n allItems: Array<{ id: string; artifacts?: LinkedArtifact[] }>,\n): LinkedPathAuditEntry[] {\n const index = new Map<string, Set<string>>();\n for (const item of allItems) {\n for (const linkedArtifact of item.artifacts ?? []) {\n const seen = index.get(linkedArtifact.path) ?? new Set<string>();\n seen.add(item.id);\n index.set(linkedArtifact.path, seen);\n }\n }\n return [...new Set(paths)]\n .sort((left, right) => left.localeCompare(right))\n .map((linkedPath) => {\n const linkedIds = [...(index.get(linkedPath) ?? new Set<string>())].sort((left, right) => left.localeCompare(right));\n return {\n path: linkedPath,\n linked_by_count: linkedIds.length,\n linked_item_ids: linkedIds,\n };\n });\n}\n\n/**\n * Shared linked-artifact list/mutate command core used by runFiles and runDocs.\n * The kind config selects metadata key, op, bare-path noun, and whether\n * append-stable ordering is honored, preserving each twin's exact semantics.\n */\nexport async function runLinkedArtifacts(\n id: string,\n options: LinkedArtifactCommandOptions,\n global: GlobalOptions,\n config: LinkedArtifactKindConfig,\n): Promise<LinkedArtifactResult> {\n const { metadataKey } = config;\n const stdinResolver = createStdinTokenResolver();\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const resolvedAdds = await stdinResolver.resolveList(options.add, \"--add\");\n const resolvedAddGlobs = await stdinResolver.resolveList(options.addGlob, \"--add-glob\");\n const resolvedRemoves = await stdinResolver.resolveList(options.remove, \"--remove\");\n const resolvedMigrations = await stdinResolver.resolveList(options.migrate, \"--migrate\");\n const parsedAdds = parseAddEntries(resolvedAdds, config.bareNoun);\n const addGlobs = parseAddGlobEntries(resolvedAddGlobs);\n const expandedGlobAdds = await expandAddGlobEntries(addGlobs);\n const adds = applyStandaloneNote(\n [...parsedAdds, ...expandedGlobAdds],\n options.note,\n parsedAdds.length > 0 || addGlobs.length > 0,\n );\n const removes = parseRemoveEntries(resolvedRemoves);\n const migrations = parseMigrateEntries(resolvedMigrations);\n const shouldMutate = adds.length > 0 || removes.length > 0 || migrations.length > 0;\n\n const collectAuditItems = async (): Promise<Array<{ id: string; artifacts?: LinkedArtifact[] }>> =>\n (await listAllFrontMatter(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)).map((entry) => ({\n id: entry.id,\n artifacts: (entry as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined,\n }));\n\n if (!shouldMutate) {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const artifacts = ((loaded.document.metadata as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined) ?? [];\n return {\n id: located.id,\n artifacts,\n changed: false,\n count: artifacts.length,\n validation: options.validatePaths ? await validateLinkedPaths(artifacts.map((entry) => entry.path)) : undefined,\n audit: options.audit ? buildLinkedPathAudit(artifacts.map((entry) => entry.path), await collectAuditItems()) : undefined,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n const metadata = document.metadata as Record<string, unknown>;\n const next = [...((metadata[metadataKey] as LinkedArtifact[] | undefined) ?? [])];\n let migrationCount = 0;\n if (migrations.length > 0) {\n for (let index = 0; index < next.length; index += 1) {\n const migratedPath = applyPathMigrations(next[index].path, migrations);\n if (migratedPath !== next[index].path) {\n next[index] = { ...next[index], path: migratedPath };\n migrationCount += 1;\n }\n }\n }\n const migratedAdds = adds.map((entry) => {\n const migratedPath = applyPathMigrations(entry.path, migrations);\n if (migratedPath !== entry.path) {\n migrationCount += 1;\n }\n return {\n ...entry,\n path: migratedPath,\n };\n });\n const migratedRemoves = removes.map((entry) => applyPathMigrations(entry, migrations));\n for (const add of migratedAdds) {\n const exists = next.some((entry) => entry.path === add.path && entry.scope === add.scope);\n if (!exists) {\n next.push(add);\n }\n }\n if (migratedRemoves.length > 0) {\n for (let i = next.length - 1; i >= 0; i -= 1) {\n if (migratedRemoves.includes(next[i].path)) {\n next.splice(i, 1);\n }\n }\n }\n const deduped = dedupeLinkedArtifacts(next);\n const normalized = config.supportsAppendStable && options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n metadata[metadataKey] = normalized;\n } else {\n delete metadata[metadataKey];\n }\n return { changedFields: [metadataKey], warnings: migrationCount > 0 ? [`path_migrations_applied:${migrationCount}`] : [] };\n },\n });\n\n const artifacts = ((result.item as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined) ?? [];\n const migrationWarning = result.warnings.find((warning) => warning.startsWith(\"path_migrations_applied:\"));\n const migrationCount = migrationWarning ? Number(migrationWarning.slice(\"path_migrations_applied:\".length)) : 0;\n const allItems = options.audit ? await collectAuditItems() : [];\n return {\n id: result.item.id,\n artifacts,\n changed: true,\n count: artifacts.length,\n migrations_applied: migrationCount > 0 ? migrationCount : undefined,\n validation: options.validatePaths ? await validateLinkedPaths(artifacts.map((entry) => entry.path)) : undefined,\n audit: options.audit ? buildLinkedPathAudit(artifacts.map((entry) => entry.path), allItems) : undefined,\n };\n}\n\n/**\n * Re-key the generic `artifacts` field to the resource-specific name (files/docs)\n * while preserving the original key order and presence so kind-specific result\n * shapes (and their deterministic JSON key ordering) stay byte-identical.\n */\nexport function renameArtifactsResultKey(result: LinkedArtifactResult, key: \"files\" | \"docs\"): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(result)) {\n out[field === \"artifacts\" ? key : field] = value;\n }\n return out;\n}\n"],"names":["artifacts","migrationCount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AA+BR,IAAM,2BAA2B,CAAC,QAAQ,SAAS,MAAM;AACzD,IAAM,gCAAgC,CAAC,WAAW,QAAQ,QAAQ,SAAS,MAAM;AACjF,IAAM,8BAA8B,CAAC,MAAM;AAC3C,IAAM,+BAA+B,CAAC,QAAQ,IAAI;AAMzD,IAAM,0CAA+D,oBAAI,IAAI,CAAC,QAAQ,OAAO,CAAC;AAiGxF,SAAU,YAAY,KAAuB;AACjD,QAAM,QAAS,OAAO;AACtB,MAAI,CAAC,aAAa,SAAS,KAAK,GAAG;AACjC,UAAM,IAAI,WACR,kBAAkB,GAAG,oBAAoB,aAAa,KAAK,IAAI,CAAC,wBAChE,UAAU,KAAK;EAEnB;AACA,SAAO;AACT;AAKM,SAAU,6BAA6B,KAAW;AACtD,MAAI,IAAI,WAAW,KAAK,KAAK,IAAI,SAAS,IAAI,GAAG;AAC/C,WAAO;EACT;AACA,MAAI,4CAA4C,KAAK,GAAG,GAAG;AACzD,WAAO;EACT;AAGA,SAAO,8BAA8B,GAAG;AAC1C;AAEA,SAAS,mCAAmC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AAG;AACzB,iBAAS,WAAW,IAAI;MAC1B,OAAO;AACL,eAAO,SAAS,WAAW;MAC7B;AACA,aAAO,EAAE,eAAe,CAAC,WAAW,GAAG,UAAUA,kBAAiB,IAAI,CAAC,2BAA2BA,eAAc,EAAE,IAAI,CAAA,EAAE;IAC1H;GACD;AAED,QAAM,YAAc,OAAO,KAAiC,WAAW,KAAsC,CAAA;AAC7G,QAAM,mBAAmB,OAAO,SAAS,KAAK,CAAC,YAAY,QAAQ,WAAW,0BAA0B,CAAC;AACzG,QAAM,iBAAiB,mBAAmB,OAAO,iBAAiB,MAAM,2BAA2B,MAAM,CAAC,IAAI;AAC9G,QAAM,WAAW,QAAQ,QAAQ,MAAM,kBAAiB,IAAK,CAAA;AAC7D,SAAO;IACL,IAAI,OAAO,KAAK;IAChB;IACA,SAAS;IACT,OAAO,UAAU;IACjB,oBAAoB,iBAAiB,IAAI,iBAAiB;IAC1D,YAAY,QAAQ,gBAAgB,MAAM,oBAAoB,UAAU,IAAI,CAAC,UAAU,MAAM,IAAI,CAAC,IAAI;IACtG,OAAO,QAAQ,QAAQ,qBAAqB,UAAU,IAAI,CAAC,UAAU,MAAM,IAAI,GAAG,QAAQ,IAAI;;AAElG;AAOM,SAAU,yBAAyB,QAA8B,KAAqB;AAC1F,QAAM,MAA+B,CAAA;AACrC,aAAW,CAAC,OAAO,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACnD,QAAI,UAAU,cAAc,MAAM,KAAK,IAAI;EAC7C;AACA,SAAO;AACT","debugId":"6d31ea9e-2717-5784-9868-be6e4ccfeaeb"}
@@ -12,15 +12,15 @@ import {
12
12
  readFirstStringFromCommanderOptions,
13
13
  readFirstValueFromCommanderOptions,
14
14
  readStringArrayFromCommanderOptions
15
- } from "./chunk-DVUU3AHP.js";
15
+ } from "./chunk-A4Z7ZOL5.js";
16
16
  import {
17
17
  refreshSearchArtifactsForMutation,
18
18
  shouldRunSearchRefreshInForeground
19
- } from "./chunk-QCHNPN24.js";
19
+ } from "./chunk-OTHIWLMB.js";
20
20
  import {
21
21
  printError,
22
22
  writeStdout
23
- } from "./chunk-2E3KSWFG.js";
23
+ } from "./chunk-AIS5PGI3.js";
24
24
  import {
25
25
  EXIT_CODE,
26
26
  PmCliError,
@@ -29,7 +29,7 @@ import {
29
29
  readSettings,
30
30
  resolvePmRoot,
31
31
  setActiveCommandResult
32
- } from "./chunk-I2VJM36R.js";
32
+ } from "./chunk-434HM6Z5.js";
33
33
 
34
34
  // dist/cli/registration-helpers.js
35
35
  var RESOLVED_GLOBAL_OPTIONS = /* @__PURE__ */ Symbol("pm.resolvedGlobalOptions");
@@ -798,6 +798,6 @@ export {
798
798
  normalizeContextOptions,
799
799
  invalidateSearchCachesForMutation
800
800
  };
801
- //# sourceMappingURL=chunk-DJ3YYLHG.js.map
801
+ //# sourceMappingURL=chunk-5FIEHKEX.js.map
802
802
 
803
803
  //# debugId=b1b728b2-f5eb-5eb5-9515-7dee4ec31118
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  readHistoryEntries
3
- } from "./chunk-QTWWHFI3.js";
3
+ } from "./chunk-RVHYI7SL.js";
4
4
  import {
5
5
  parseLimit
6
- } from "./chunk-DYZKSIVX.js";
6
+ } from "./chunk-B473GZWW.js";
7
7
  import {
8
8
  enforceHistoryStreamPolicyForItems,
9
9
  listAllFrontMatterLight
10
- } from "./chunk-X7RKOJXL.js";
10
+ } from "./chunk-SX75ADBK.js";
11
11
  import {
12
12
  resolveItemTypeRegistry
13
- } from "./chunk-SO2IOH37.js";
13
+ } from "./chunk-FRUFKWNK.js";
14
14
  import {
15
15
  compareTimestampStrings,
16
16
  nowIso,
17
17
  resolveIsoOrRelative
18
- } from "./chunk-MTGMNUMJ.js";
18
+ } from "./chunk-YCJX76PW.js";
19
19
  import {
20
20
  EXIT_CODE,
21
21
  PmCliError,
@@ -25,7 +25,7 @@ import {
25
25
  readSettings,
26
26
  resolvePmRoot,
27
27
  runActiveOnReadHooks
28
- } from "./chunk-5QLHQK7V.js";
28
+ } from "./chunk-HMOADQVT.js";
29
29
 
30
30
  // dist/cli/commands/activity.js
31
31
  import fs from "node:fs/promises";
@@ -193,4 +193,4 @@ export {
193
193
  _testOnly,
194
194
  runActivity
195
195
  };
196
- //# sourceMappingURL=chunk-OURX4WVG.js.map
196
+ //# sourceMappingURL=chunk-5IDI42VV.js.map
@@ -4,13 +4,13 @@ import {
4
4
  normalizeStringList,
5
5
  parseExtensionManifest,
6
6
  validateExtensionDirectory
7
- } from "./chunk-TYQBGXH2.js";
7
+ } from "./chunk-CF55WVVS.js";
8
8
  import {
9
9
  splitCommaList
10
10
  } from "./chunk-5HIZDR5A.js";
11
11
  import {
12
12
  nowIso
13
- } from "./chunk-MTGMNUMJ.js";
13
+ } from "./chunk-YCJX76PW.js";
14
14
  import {
15
15
  EXIT_CODE,
16
16
  EXTENSION_CAPABILITY_CONTRACT,
@@ -29,7 +29,7 @@ import {
29
29
  resolvePmPackageRootFromModule,
30
30
  resolvePmRoot,
31
31
  writeSettings
32
- } from "./chunk-5QLHQK7V.js";
32
+ } from "./chunk-HMOADQVT.js";
33
33
 
34
34
  // dist/cli/commands/extension.js
35
35
  import { execFile as execFile2 } from "node:child_process";
@@ -431,11 +431,12 @@ async function collectPackageExtensionDirectories(packageRoot) {
431
431
  !(function() {
432
432
  try {
433
433
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
434
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8d64f224-2711-543f-8c95-dc6517478217");
434
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "76ef9a1c-698d-5324-a677-794b015787d5");
435
435
  } catch (e2) {
436
436
  }
437
437
  })();
438
438
  var execFileAsync = promisify(execFile);
439
+ var PM_CLI_PACKAGE_NAME = "@unbrained/pm-cli";
439
440
  function parseGithubPathSpec(pathSpec, input, refOverride) {
440
441
  const segments = pathSpec.split("/").map((segment) => segment.trim()).filter((segment) => segment.length > 0);
441
442
  if (segments.length < 2) {
@@ -759,18 +760,75 @@ async function installNpmPackageRuntimeDependencies(packageRoot) {
759
760
  }
760
761
  const manifest = parsed;
761
762
  const dependencySpecs = runtimeDependencyInstallSpecs(manifest);
762
- if (dependencySpecs.length === 0) {
763
+ const shouldLinkHostedPmCli = hasHostedPmCliDependency(manifest);
764
+ if (dependencySpecs.length === 0 && !shouldLinkHostedPmCli) {
763
765
  return;
764
766
  }
765
767
  const runtimeOnlyManifest = { ...parsed };
766
768
  delete runtimeOnlyManifest.devDependencies;
767
- await fs3.writeFile(packageJsonPath, `${JSON.stringify(runtimeOnlyManifest, null, 2)}
769
+ const installManifest = { ...runtimeOnlyManifest };
770
+ removeHostedPmCliDependency(installManifest);
771
+ await fs3.writeFile(packageJsonPath, `${JSON.stringify(installManifest, null, 2)}
768
772
  `, "utf8");
769
- await Promise.all([
770
- fs3.rm(path3.join(packageRoot, "package-lock.json"), { force: true }),
771
- fs3.rm(path3.join(packageRoot, "npm-shrinkwrap.json"), { force: true })
772
- ]);
773
- await runNpmCommand(["install", "--ignore-scripts", "--no-audit", "--fund=false", "--package-lock=false", "--no-save", ...dependencySpecs], packageRoot);
773
+ try {
774
+ await Promise.all([
775
+ fs3.rm(path3.join(packageRoot, "package-lock.json"), { force: true }),
776
+ fs3.rm(path3.join(packageRoot, "npm-shrinkwrap.json"), { force: true })
777
+ ]);
778
+ if (dependencySpecs.length > 0) {
779
+ await runNpmCommand([
780
+ "install",
781
+ "--ignore-scripts",
782
+ "--no-audit",
783
+ "--fund=false",
784
+ "--package-lock=false",
785
+ "--no-save",
786
+ "--omit=peer",
787
+ ...dependencySpecs
788
+ ], packageRoot);
789
+ }
790
+ if (shouldLinkHostedPmCli) {
791
+ await linkHostedPmCliDependency(packageRoot);
792
+ }
793
+ } finally {
794
+ await fs3.writeFile(packageJsonPath, `${JSON.stringify(runtimeOnlyManifest, null, 2)}
795
+ `, "utf8");
796
+ }
797
+ }
798
+ function hasHostedPmCliDependency(manifest) {
799
+ for (const dependencyMap of [manifest.dependencies, manifest.optionalDependencies, manifest.peerDependencies]) {
800
+ if (typeof dependencyMap === "object" && dependencyMap !== null && PM_CLI_PACKAGE_NAME in dependencyMap) {
801
+ return true;
802
+ }
803
+ }
804
+ return false;
805
+ }
806
+ function removeHostedPmCliDependency(manifest) {
807
+ for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
808
+ const dependencyMap = manifest[field];
809
+ if (typeof dependencyMap !== "object" || dependencyMap === null) {
810
+ continue;
811
+ }
812
+ const nextMap = { ...dependencyMap };
813
+ delete nextMap[PM_CLI_PACKAGE_NAME];
814
+ if (Object.keys(nextMap).length === 0) {
815
+ delete manifest[field];
816
+ } else {
817
+ manifest[field] = nextMap;
818
+ }
819
+ }
820
+ }
821
+ async function linkHostedPmCliDependency(packageRoot) {
822
+ const hostPackageRoot = resolvePmPackageRootFromModule(import.meta.url, ["../../../.."]);
823
+ const [scope, packageName] = PM_CLI_PACKAGE_NAME.split("/");
824
+ const scopedDirectory = path3.join(packageRoot, "node_modules", scope);
825
+ const linkPath = path3.join(scopedDirectory, packageName);
826
+ await fs3.mkdir(scopedDirectory, { recursive: true });
827
+ await fs3.rm(linkPath, { recursive: true, force: true });
828
+ await fs3.symlink(hostPackageRoot, linkPath, resolveDirectorySymlinkType(process.platform));
829
+ }
830
+ function resolveDirectorySymlinkType(platform) {
831
+ return platform === "win32" ? "junction" : "dir";
774
832
  }
775
833
  function runtimeDependencyInstallSpecs(manifest) {
776
834
  const specs = /* @__PURE__ */ new Map();
@@ -779,7 +837,7 @@ function runtimeDependencyInstallSpecs(manifest) {
779
837
  continue;
780
838
  }
781
839
  for (const [name, version] of Object.entries(dependencyMap)) {
782
- if (typeof version !== "string" || version.trim().length === 0 || specs.has(name)) {
840
+ if (name === PM_CLI_PACKAGE_NAME || typeof version !== "string" || version.trim().length === 0 || specs.has(name)) {
783
841
  continue;
784
842
  }
785
843
  specs.set(name, `${name}@${version.trim()}`);
@@ -1126,7 +1184,7 @@ import path5 from "node:path";
1126
1184
  !(function() {
1127
1185
  try {
1128
1186
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1129
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c6f7e50f-9cce-50a2-97ec-7c06be6d85a1");
1187
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3abac9c3-3fc0-575e-8f5d-d2624fe7a20c");
1130
1188
  } catch (e2) {
1131
1189
  }
1132
1190
  })();
@@ -1170,6 +1228,11 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
1170
1228
  private: true,
1171
1229
  type: "module",
1172
1230
  keywords: ["pm-package"],
1231
+ // `node --test` runs the colocated *.test.js sample against the peer SDK
1232
+ // testing helpers; no extra dev-dependency or test runner is required.
1233
+ scripts: {
1234
+ test: "node --test"
1235
+ },
1173
1236
  peerDependencies: {
1174
1237
  "@unbrained/pm-cli": "*"
1175
1238
  },
@@ -1187,15 +1250,42 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
1187
1250
  }
1188
1251
  }, null, 2)}
1189
1252
  `;
1253
+ const sampleTest = [
1254
+ 'import assert from "node:assert/strict";',
1255
+ 'import { test } from "node:test";',
1256
+ 'import { activateExtensionForTest, assertRegisteredCommandContract } from "@unbrained/pm-cli/sdk/testing";',
1257
+ 'import extension from "./index.js";',
1258
+ "",
1259
+ `test(${JSON.stringify(`${extensionName} registers its starter command`)}, async () => {`,
1260
+ " // `capabilities` mirrors manifest.json so the in-memory activation grants",
1261
+ " // the `commands` capability the entrypoint relies on.",
1262
+ " const activation = await activateExtensionForTest(extension, {",
1263
+ ` name: ${JSON.stringify(extensionName)},`,
1264
+ ' capabilities: ["commands"],',
1265
+ " });",
1266
+ " // assertRegisteredCommandContract throws if the command is not",
1267
+ " // registered, so reaching here already proves the wiring; assert on the",
1268
+ " // returned definition to demonstrate inspecting registered metadata.",
1269
+ " const registered = assertRegisteredCommandContract(activation.registrations, {",
1270
+ ` command: ${JSON.stringify(commandName)},`,
1271
+ ` extensionName: ${JSON.stringify(extensionName)},`,
1272
+ " });",
1273
+ ' assert.equal(typeof registered.command.description, "string");',
1274
+ "});",
1275
+ ""
1276
+ ].join("\n");
1277
+ const gitignore = ["node_modules/", "*.log", ""].join("\n");
1190
1278
  const packageReadme = [
1191
1279
  `# ${packageName}`,
1192
1280
  "",
1193
1281
  "Generated by `pm package init`.",
1194
1282
  "",
1195
1283
  "## Included Files",
1196
- "- `package.json`: package metadata and `pm` resource manifest.",
1284
+ "- `package.json`: package metadata, `test` script, and `pm` resource manifest.",
1197
1285
  "- `manifest.json`: extension metadata and capabilities.",
1198
1286
  "- `index.js`: starter command registration using the `commands` capability.",
1287
+ "- `index.test.js`: sample `node:test` suite using the SDK testing helpers.",
1288
+ "- `.gitignore`: ignores `node_modules/` and log files.",
1199
1289
  "",
1200
1290
  "## Quick Start",
1201
1291
  "```bash",
@@ -1204,6 +1294,15 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
1204
1294
  "pm package doctor --project --detail summary",
1205
1295
  "```",
1206
1296
  "",
1297
+ "## Validate the Package",
1298
+ "Install the peer SDK once, then run the colocated sample test:",
1299
+ "```bash",
1300
+ "npm install",
1301
+ "npm test",
1302
+ "```",
1303
+ "`npm test` runs `node --test`, which executes `index.test.js` against the",
1304
+ "`@unbrained/pm-cli/sdk/testing` helpers \u2014 no extra test runner required.",
1305
+ "",
1207
1306
  "## Compatibility Bounds",
1208
1307
  "`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:",
1209
1308
  `- \`manifest_version\` (integer): manifest schema generation. Leave at \`${SCAFFOLD_MANIFEST_VERSION}\` unless you adopt a newer manifest schema.`,
@@ -1221,6 +1320,8 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
1221
1320
  "package.json": packageJson,
1222
1321
  "manifest.json": manifest,
1223
1322
  "index.js": entrypoint,
1323
+ "index.test.js": sampleTest,
1324
+ ".gitignore": gitignore,
1224
1325
  "README.md": packageReadme
1225
1326
  };
1226
1327
  }
@@ -1771,7 +1872,7 @@ function buildDoctorConsistencySummary(scope, installedExtensions, loadedExtensi
1771
1872
  !(function() {
1772
1873
  try {
1773
1874
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1774
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4c40a0ee-f2c1-5329-a52d-355491472f77");
1875
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b0b28569-ac5e-5484-8ffb-a578de22fd15");
1775
1876
  } catch (e2) {
1776
1877
  }
1777
1878
  })();
@@ -2478,6 +2579,7 @@ async function runExtension(target, options, global2) {
2478
2579
  const scaffoldTarget = requireTarget(normalizedTarget, action);
2479
2580
  const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension");
2480
2581
  const quotedTargetPath = JSON.stringify(scaffold.target_path);
2582
+ const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
2481
2583
  return withResult({
2482
2584
  scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
2483
2585
  extension: {
@@ -2490,6 +2592,7 @@ async function runExtension(target, options, global2) {
2490
2592
  next_steps: [
2491
2593
  `Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
2492
2594
  `Smoke-test command path: pm ${scaffold.command_name}`,
2595
+ ...options.vocabulary === "package" ? [`Validate the sample test: cd ${quotedShellTargetPath}, then run "npm install" and "npm test"`] : [],
2493
2596
  `Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
2494
2597
  ]
2495
2598
  });
@@ -3218,4 +3321,4 @@ export {
3218
3321
  runExtension,
3219
3322
  _testOnly
3220
3323
  };
3221
- //# sourceMappingURL=chunk-UA4ANRJY.js.map
3324
+ //# sourceMappingURL=chunk-5PCI3UBT.js.map