@unbrained/pm-cli 2026.7.14 → 2026.7.16

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 (708) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +54 -0
  3. package/README.md +14 -11
  4. package/dist/cli/argv-utils.d.ts +1 -4
  5. package/dist/cli/argv-utils.js +3 -13
  6. package/dist/cli/argv-utils.js.map +1 -1
  7. package/dist/cli/bootstrap-args.d.ts +6 -4
  8. package/dist/cli/bootstrap-args.js +51 -16
  9. package/dist/cli/bootstrap-args.js.map +1 -1
  10. package/dist/cli/bundle-integrity.d.ts +49 -0
  11. package/dist/cli/bundle-integrity.js +111 -0
  12. package/dist/cli/bundle-integrity.js.map +1 -0
  13. package/dist/cli/commands/completion.js +7 -2
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +6 -163
  16. package/dist/cli/commands/config.js +4 -1133
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/context.d.ts +2 -4
  19. package/dist/cli/commands/context.js +10 -85
  20. package/dist/cli/commands/context.js.map +1 -1
  21. package/dist/cli/commands/create.d.ts +1 -0
  22. package/dist/cli/commands/create.js +3 -2
  23. package/dist/cli/commands/create.js.map +1 -1
  24. package/dist/cli/commands/extension/describe.d.ts +2 -91
  25. package/dist/cli/commands/extension/describe.js +4 -142
  26. package/dist/cli/commands/extension/describe.js.map +1 -1
  27. package/dist/cli/commands/extension/scaffold.d.ts +2 -36
  28. package/dist/cli/commands/extension/scaffold.js +4 -2435
  29. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  30. package/dist/cli/commands/extension/shared.d.ts +2 -28
  31. package/dist/cli/commands/extension/shared.js +4 -130
  32. package/dist/cli/commands/extension/shared.js.map +1 -1
  33. package/dist/cli/commands/extension.d.ts +3 -400
  34. package/dist/cli/commands/extension.js +4 -2183
  35. package/dist/cli/commands/extension.js.map +1 -1
  36. package/dist/cli/commands/gc.d.ts +6 -56
  37. package/dist/cli/commands/gc.js +4 -270
  38. package/dist/cli/commands/gc.js.map +1 -1
  39. package/dist/cli/commands/get.d.ts +18 -5
  40. package/dist/cli/commands/get.js +117 -58
  41. package/dist/cli/commands/get.js.map +1 -1
  42. package/dist/cli/commands/health.d.ts +6 -184
  43. package/dist/cli/commands/health.js +4 -1747
  44. package/dist/cli/commands/health.js.map +1 -1
  45. package/dist/cli/commands/history-compact.d.ts +4 -139
  46. package/dist/cli/commands/history-compact.js +5 -510
  47. package/dist/cli/commands/history-compact.js.map +1 -1
  48. package/dist/cli/commands/history-redact.d.ts +8 -120
  49. package/dist/cli/commands/history-redact.js +6 -581
  50. package/dist/cli/commands/history-redact.js.map +1 -1
  51. package/dist/cli/commands/history-repair.d.ts +7 -89
  52. package/dist/cli/commands/history-repair.js +5 -257
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/history.d.ts +1 -2
  55. package/dist/cli/commands/history.js +6 -48
  56. package/dist/cli/commands/history.js.map +1 -1
  57. package/dist/cli/commands/index.d.ts +1 -0
  58. package/dist/cli/commands/index.js +3 -2
  59. package/dist/cli/commands/index.js.map +1 -1
  60. package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
  61. package/dist/cli/commands/init-agent-guidance.js +4 -431
  62. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  63. package/dist/cli/commands/init.d.ts +6 -181
  64. package/dist/cli/commands/init.js +4 -690
  65. package/dist/cli/commands/init.js.map +1 -1
  66. package/dist/cli/commands/next.js +3 -3
  67. package/dist/cli/commands/next.js.map +1 -1
  68. package/dist/cli/commands/profile.d.ts +4 -174
  69. package/dist/cli/commands/profile.js +4 -425
  70. package/dist/cli/commands/profile.js.map +1 -1
  71. package/dist/cli/commands/restore.d.ts +4 -19
  72. package/dist/cli/commands/restore.js +9 -158
  73. package/dist/cli/commands/restore.js.map +1 -1
  74. package/dist/cli/commands/schema.d.ts +7 -507
  75. package/dist/cli/commands/schema.js +5 -1254
  76. package/dist/cli/commands/schema.js.map +1 -1
  77. package/dist/cli/commands/test.d.ts +2 -4
  78. package/dist/cli/commands/test.js +7 -97
  79. package/dist/cli/commands/test.js.map +1 -1
  80. package/dist/cli/commands/validate.d.ts +9 -249
  81. package/dist/cli/commands/validate.js +9 -2150
  82. package/dist/cli/commands/validate.js.map +1 -1
  83. package/dist/cli/extension-command-help.js +18 -4
  84. package/dist/cli/extension-command-help.js.map +1 -1
  85. package/dist/cli/extension-command-options.js +3 -3
  86. package/dist/cli/extension-command-options.js.map +1 -1
  87. package/dist/cli/help-content.js +7 -3
  88. package/dist/cli/help-content.js.map +1 -1
  89. package/dist/cli/main.js +20 -30
  90. package/dist/cli/main.js.map +1 -1
  91. package/dist/cli/register-list-query.js +4 -2
  92. package/dist/cli/register-list-query.js.map +1 -1
  93. package/dist/cli/register-mutation.js +11 -3
  94. package/dist/cli/register-mutation.js.map +1 -1
  95. package/dist/cli/register-setup.js +4 -2
  96. package/dist/cli/register-setup.js.map +1 -1
  97. package/dist/cli/registration-helpers.js +3 -2
  98. package/dist/cli/registration-helpers.js.map +1 -1
  99. package/dist/cli-bundle/bundle-manifest.json +782 -0
  100. package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
  101. package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
  102. package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
  106. package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
  107. package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
  111. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
  113. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
  115. package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
  116. package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
  118. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
  120. package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
  121. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
  123. package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
  127. package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
  129. package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
  131. package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
  133. package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
  134. package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
  136. package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
  137. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
  138. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
  142. package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
  143. package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
  144. package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
  146. package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
  148. package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
  149. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
  150. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
  155. package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
  156. package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
  158. package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
  160. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
  161. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
  163. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
  165. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
  167. package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
  168. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
  169. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
  170. package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
  172. package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
  175. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
  177. package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
  178. package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
  179. package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
  181. package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
  183. package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
  184. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
  185. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
  188. package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
  190. package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
  191. package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
  192. package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
  194. package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
  195. package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
  196. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
  198. package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
  199. package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
  200. package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
  202. package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
  203. package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
  206. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
  208. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
  209. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
  211. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
  212. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
  214. package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
  216. package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
  217. package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
  218. package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
  219. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
  220. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
  222. package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
  223. package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
  225. package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
  230. package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
  231. package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
  232. package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
  233. package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
  234. package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
  235. package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
  236. package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
  237. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
  238. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
  240. package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
  241. package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
  243. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
  245. package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
  246. package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
  248. package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
  249. package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
  250. package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
  252. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
  254. package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
  255. package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
  257. package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
  258. package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
  259. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
  260. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
  262. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
  263. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
  265. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
  266. package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
  267. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
  268. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
  269. package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
  270. package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
  271. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
  272. package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
  273. package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
  274. package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
  275. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
  276. package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
  277. package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
  278. package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
  279. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
  280. package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
  281. package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
  282. package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
  283. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
  284. package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
  285. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
  286. package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
  287. package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
  288. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
  289. package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
  290. package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
  291. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
  292. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
  293. package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
  294. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
  295. package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
  296. package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
  297. package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
  298. package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
  299. package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
  300. package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
  301. package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
  302. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
  303. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
  304. package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
  305. package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
  306. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
  307. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
  309. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
  311. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
  312. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
  313. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
  314. package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
  315. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
  316. package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
  317. package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
  318. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
  319. package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
  321. package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
  322. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
  323. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
  324. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
  325. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
  326. package/dist/cli-bundle/main.js +826 -43
  327. package/dist/cli-bundle/main.js.map +4 -4
  328. package/dist/cli-bundle/sdk-runtime.js +70 -57
  329. package/dist/cli-bundle/sdk-testing.js +6 -6
  330. package/dist/cli-bundle/sdk.js +876 -74
  331. package/dist/cli-bundle/sdk.js.map +4 -4
  332. package/dist/cli.js +5 -4
  333. package/dist/cli.js.map +1 -1
  334. package/dist/core/diagnostics/remediation.js +12 -2
  335. package/dist/core/diagnostics/remediation.js.map +1 -1
  336. package/dist/core/history/projection.d.ts +39 -0
  337. package/dist/core/history/projection.js +164 -0
  338. package/dist/core/history/projection.js.map +1 -0
  339. package/dist/core/history/read.d.ts +3 -0
  340. package/dist/core/history/read.js +55 -0
  341. package/dist/core/history/read.js.map +1 -0
  342. package/dist/core/output/output-control.d.ts +18 -0
  343. package/dist/core/output/output-control.js +26 -0
  344. package/dist/core/output/output-control.js.map +1 -0
  345. package/dist/core/output/output.js +20 -8
  346. package/dist/core/output/output.js.map +1 -1
  347. package/dist/core/sentry/helpers.js +10 -2
  348. package/dist/core/sentry/helpers.js.map +1 -1
  349. package/dist/core/shared/command-types.d.ts +2 -0
  350. package/dist/core/shared/command-types.js +2 -2
  351. package/dist/core/shared/command-types.js.map +1 -1
  352. package/dist/core/shared/errors.d.ts +11 -0
  353. package/dist/core/shared/errors.js +2 -2
  354. package/dist/core/shared/errors.js.map +1 -1
  355. package/dist/mcp/server.d.ts +2 -2
  356. package/dist/mcp/tool-definitions.js +5 -5
  357. package/dist/mcp/tool-definitions.js.map +1 -1
  358. package/dist/sdk/author-attribution.d.ts +35 -0
  359. package/dist/sdk/author-attribution.js +118 -0
  360. package/dist/sdk/author-attribution.js.map +1 -0
  361. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
  362. package/dist/sdk/cli-contracts/command-aliases.js +17 -0
  363. package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
  364. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  365. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  366. package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
  367. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  368. package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
  369. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  370. package/dist/sdk/cli-contracts/tool-schema.js +3 -3
  371. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  372. package/dist/sdk/cli-contracts.d.ts +1 -0
  373. package/dist/sdk/cli-contracts.js +3 -2
  374. package/dist/sdk/cli-contracts.js.map +1 -1
  375. package/dist/sdk/cli-program.d.ts +8 -0
  376. package/dist/sdk/cli-program.js +39 -0
  377. package/dist/sdk/cli-program.js.map +1 -0
  378. package/dist/sdk/command-line.d.ts +11 -0
  379. package/dist/sdk/command-line.js +40 -0
  380. package/dist/sdk/command-line.js.map +1 -0
  381. package/dist/sdk/config.d.ts +163 -0
  382. package/dist/sdk/config.js +1087 -0
  383. package/dist/sdk/config.js.map +1 -0
  384. package/dist/sdk/context-relevance.d.ts +21 -0
  385. package/dist/sdk/context-relevance.js +70 -2
  386. package/dist/sdk/context-relevance.js.map +1 -1
  387. package/dist/sdk/dependencies.d.ts +15 -2
  388. package/dist/sdk/dependencies.js +97 -8
  389. package/dist/sdk/dependencies.js.map +1 -1
  390. package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
  391. package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
  392. package/dist/sdk/extension/bundled-catalog.js.map +1 -0
  393. package/dist/sdk/extension/concurrency.d.ts +7 -0
  394. package/dist/sdk/extension/concurrency.js +26 -0
  395. package/dist/sdk/extension/concurrency.js.map +1 -0
  396. package/dist/sdk/extension/describe.d.ts +91 -0
  397. package/dist/sdk/extension/describe.js +144 -0
  398. package/dist/sdk/extension/describe.js.map +1 -0
  399. package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
  400. package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
  401. package/dist/sdk/extension/doctor.js.map +1 -0
  402. package/dist/sdk/extension/install-runtime.d.ts +26 -0
  403. package/dist/sdk/extension/install-runtime.js +269 -0
  404. package/dist/sdk/extension/install-runtime.js.map +1 -0
  405. package/dist/sdk/extension/install-snapshot.d.ts +23 -0
  406. package/dist/sdk/extension/install-snapshot.js +66 -0
  407. package/dist/sdk/extension/install-snapshot.js.map +1 -0
  408. package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
  409. package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
  410. package/dist/sdk/extension/install-sources.js.map +1 -0
  411. package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
  412. package/dist/sdk/extension/managed-state.js.map +1 -0
  413. package/dist/sdk/extension/scaffold.d.ts +36 -0
  414. package/dist/sdk/extension/scaffold.js +2436 -0
  415. package/dist/sdk/extension/scaffold.js.map +1 -0
  416. package/dist/sdk/extension/shared.d.ts +28 -0
  417. package/dist/sdk/extension/shared.js +140 -0
  418. package/dist/sdk/extension/shared.js.map +1 -0
  419. package/dist/sdk/extension/update-check.d.ts +15 -0
  420. package/dist/sdk/extension/update-check.js +68 -0
  421. package/dist/sdk/extension/update-check.js.map +1 -0
  422. package/dist/sdk/extension.d.ts +367 -0
  423. package/dist/sdk/extension.js +2174 -0
  424. package/dist/sdk/extension.js.map +1 -0
  425. package/dist/sdk/governance/gc.d.ts +56 -0
  426. package/dist/sdk/governance/gc.js +276 -0
  427. package/dist/sdk/governance/gc.js.map +1 -0
  428. package/dist/sdk/governance/health.d.ts +187 -0
  429. package/dist/sdk/governance/health.js +1796 -0
  430. package/dist/sdk/governance/health.js.map +1 -0
  431. package/dist/sdk/governance/validate.d.ts +255 -0
  432. package/dist/sdk/governance/validate.js +2175 -0
  433. package/dist/sdk/governance/validate.js.map +1 -0
  434. package/dist/sdk/history-compact.d.ts +142 -0
  435. package/dist/sdk/history-compact.js +508 -0
  436. package/dist/sdk/history-compact.js.map +1 -0
  437. package/dist/sdk/history-mcp.d.ts +17 -0
  438. package/dist/sdk/history-mcp.js +68 -0
  439. package/dist/sdk/history-mcp.js.map +1 -0
  440. package/dist/sdk/history-read.d.ts +31 -0
  441. package/dist/sdk/history-read.js +58 -0
  442. package/dist/sdk/history-read.js.map +1 -0
  443. package/dist/sdk/history-redact.d.ts +120 -0
  444. package/dist/sdk/history-redact.js +577 -0
  445. package/dist/sdk/history-redact.js.map +1 -0
  446. package/dist/sdk/history-repair.d.ts +89 -0
  447. package/dist/sdk/history-repair.js +263 -0
  448. package/dist/sdk/history-repair.js.map +1 -0
  449. package/dist/sdk/index.d.ts +25 -1
  450. package/dist/sdk/index.js +27 -3
  451. package/dist/sdk/index.js.map +1 -1
  452. package/dist/sdk/init-agent-guidance.d.ts +113 -0
  453. package/dist/sdk/init-agent-guidance.js +437 -0
  454. package/dist/sdk/init-agent-guidance.js.map +1 -0
  455. package/dist/sdk/init.d.ts +186 -0
  456. package/dist/sdk/init.js +733 -0
  457. package/dist/sdk/init.js.map +1 -0
  458. package/dist/sdk/invocation-author.d.ts +2 -0
  459. package/dist/sdk/invocation-author.js +39 -0
  460. package/dist/sdk/invocation-author.js.map +1 -0
  461. package/dist/sdk/item-children.d.ts +45 -0
  462. package/dist/sdk/item-children.js +75 -0
  463. package/dist/sdk/item-children.js.map +1 -0
  464. package/dist/sdk/item-schedule.d.ts +26 -0
  465. package/dist/sdk/item-schedule.js +28 -0
  466. package/dist/sdk/item-schedule.js.map +1 -0
  467. package/dist/sdk/output.d.ts +7 -0
  468. package/dist/sdk/output.js +11 -0
  469. package/dist/sdk/output.js.map +1 -0
  470. package/dist/sdk/pagination.d.ts +4 -1
  471. package/dist/sdk/pagination.js +13 -5
  472. package/dist/sdk/pagination.js.map +1 -1
  473. package/dist/sdk/profile.d.ts +176 -0
  474. package/dist/sdk/profile.js +431 -0
  475. package/dist/sdk/profile.js.map +1 -0
  476. package/dist/sdk/relationship-analytics.d.ts +108 -0
  477. package/dist/sdk/relationship-analytics.js +292 -0
  478. package/dist/sdk/relationship-analytics.js.map +1 -0
  479. package/dist/sdk/relationship-context.d.ts +67 -0
  480. package/dist/sdk/relationship-context.js +207 -0
  481. package/dist/sdk/relationship-context.js.map +1 -0
  482. package/dist/sdk/relationship-history.d.ts +109 -0
  483. package/dist/sdk/relationship-history.js +401 -0
  484. package/dist/sdk/relationship-history.js.map +1 -0
  485. package/dist/sdk/relationships.d.ts +145 -0
  486. package/dist/sdk/relationships.js +551 -0
  487. package/dist/sdk/relationships.js.map +1 -0
  488. package/dist/sdk/runtime-input.d.ts +10 -0
  489. package/dist/sdk/runtime-input.js +60 -0
  490. package/dist/sdk/runtime-input.js.map +1 -0
  491. package/dist/sdk/runtime.d.ts +31 -8
  492. package/dist/sdk/runtime.js +61 -57
  493. package/dist/sdk/runtime.js.map +1 -1
  494. package/dist/sdk/schema.d.ts +507 -0
  495. package/dist/sdk/schema.js +1269 -0
  496. package/dist/sdk/schema.js.map +1 -0
  497. package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
  498. package/dist/{cli/commands → sdk}/templates.js +9 -9
  499. package/dist/sdk/templates.js.map +1 -0
  500. package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
  501. package/dist/sdk/test/linked-command-detection.js +525 -0
  502. package/dist/sdk/test/linked-command-detection.js.map +1 -0
  503. package/docs/COMMANDS.md +58 -40
  504. package/docs/EXTENSIONS.md +10 -1
  505. package/docs/RELATIONSHIP_GRAPH.md +113 -0
  506. package/docs/RELEASING.md +2 -0
  507. package/docs/SDK.md +156 -9
  508. package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
  509. package/marketplace.json +2 -2
  510. package/package.json +3 -2
  511. package/packages/pm-beads/package.json +1 -1
  512. package/packages/pm-calendar/package.json +1 -1
  513. package/packages/pm-command-kit/package.json +1 -1
  514. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
  515. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
  516. package/packages/pm-governance-audit/package.json +1 -1
  517. package/packages/pm-guide-shell/package.json +1 -1
  518. package/packages/pm-kanban/package.json +1 -1
  519. package/packages/pm-lifecycle-hooks/package.json +1 -1
  520. package/packages/pm-linked-test-adapters/package.json +1 -1
  521. package/packages/pm-search-advanced/package.json +1 -1
  522. package/packages/pm-templates/package.json +1 -1
  523. package/packages/pm-todos/package.json +1 -1
  524. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  525. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  526. package/scripts/bundle-cli.mjs +66 -23
  527. package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
  528. package/dist/cli/commands/extension/doctor.js.map +0 -1
  529. package/dist/cli/commands/extension/install-sources.js.map +0 -1
  530. package/dist/cli/commands/extension/managed-state.js.map +0 -1
  531. package/dist/cli/commands/templates.js.map +0 -1
  532. package/dist/cli/commands/test/linked-command-detection.js +0 -248
  533. package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
  534. package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
  535. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
  536. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
  537. package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
  539. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
  540. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
  541. package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
  542. package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
  543. package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
  544. package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
  545. package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
  546. package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
  547. package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
  548. package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
  549. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
  550. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
  551. package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
  552. package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
  553. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
  554. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
  555. package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
  556. package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
  557. package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
  558. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
  559. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
  560. package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
  561. package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
  562. package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
  563. package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
  564. package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
  565. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
  566. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
  567. package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
  568. package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
  569. package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
  570. package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
  572. package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
  573. package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
  574. package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
  575. package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
  576. package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
  577. package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
  578. package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
  579. package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
  580. package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
  581. package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
  582. package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
  583. package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
  584. package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
  585. package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
  586. package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
  587. package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
  588. package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
  589. package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
  590. package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
  591. package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
  592. package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
  593. package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
  594. package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
  595. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
  596. package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
  597. package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
  598. /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
  667. /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
  668. /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
  669. /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
  670. /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
  671. /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
  672. /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
  673. /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
  674. /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
  675. /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
  676. /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
  677. /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
  678. /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
  679. /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
  680. /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
  681. /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
  682. /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
  683. /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
  684. /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
  685. /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
  686. /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
  687. /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
  688. /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
  689. /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
  690. /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
  691. /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
  692. /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
  693. /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
  694. /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
  695. /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
  696. /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
  697. /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
  698. /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
  699. /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
  700. /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
  701. /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
  702. /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
  703. /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
  704. /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
  705. /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
  706. /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
  707. /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
  708. /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  nowIso
3
- } from "./chunk-T4BRCB6Z.js";
3
+ } from "./chunk-XSJUSQAE.js";
4
4
  import {
5
5
  EXIT_CODE,
6
6
  PmCliError,
7
7
  pathExists,
8
8
  toErrorMessage,
9
9
  writeFileAtomic
10
- } from "./chunk-AFWZRL7M.js";
10
+ } from "./chunk-BSEQUTQP.js";
11
11
 
12
12
  // dist/core/checkpoint/mutation-checkpoint.js
13
13
  import { mkdir, readFile } from "node:fs/promises";
@@ -135,4 +135,4 @@ export {
135
135
  loadMutationCheckpoint,
136
136
  restoreCheckpointItems
137
137
  };
138
- //# sourceMappingURL=chunk-RA5AIAMP.js.map
138
+ //# sourceMappingURL=chunk-UOHFKBUV.js.map
@@ -1,20 +1,17 @@
1
- import {
2
- resolveAuthor
3
- } from "./chunk-YRYYFGV3.js";
4
1
  import {
5
2
  lintProjectProfile,
6
3
  resolveProfileCatalog,
7
4
  resolveProfileEntry
8
- } from "./chunk-UKUIIBDW.js";
5
+ } from "./chunk-YAQEBNY7.js";
6
+ import {
7
+ ensureTypeFolderScaffold
8
+ } from "./chunk-GM5QHQU6.js";
9
9
  import {
10
10
  parseNestedSettingValue,
11
11
  readNestedSettingValue,
12
12
  resolveNestedSettingDescriptor,
13
13
  writeNestedSettingValue
14
14
  } from "./chunk-Q3K5XPAQ.js";
15
- import {
16
- ensureTypeFolderScaffold
17
- } from "./chunk-5CT5BW6E.js";
18
15
  import {
19
16
  normalizeAddFieldInput,
20
17
  normalizeAddStatusInput,
@@ -24,16 +21,19 @@ import {
24
21
  serializeStatusDefsFile,
25
22
  upsertField,
26
23
  upsertStatusDef
27
- } from "./chunk-DO5RGJXT.js";
24
+ } from "./chunk-APRVSW2O.js";
25
+ import {
26
+ resolveAuthor
27
+ } from "./chunk-YRYYFGV3.js";
28
28
  import {
29
29
  CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS
30
- } from "./chunk-2QIQGYPW.js";
30
+ } from "./chunk-H5APFTHZ.js";
31
31
  import {
32
32
  normalizeAddTypeInput,
33
33
  parseItemTypesFile,
34
34
  serializeItemTypesFile,
35
35
  upsertItemType
36
- } from "./chunk-ANSJHDOZ.js";
36
+ } from "./chunk-SELVXEZK.js";
37
37
  import {
38
38
  acquireLock,
39
39
  getActiveExtensionRegistrations,
@@ -42,7 +42,7 @@ import {
42
42
  resolveGovernanceKnobs,
43
43
  runActiveOnWriteHooks,
44
44
  writeSettings
45
- } from "./chunk-T4BRCB6Z.js";
45
+ } from "./chunk-XSJUSQAE.js";
46
46
  import {
47
47
  DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
48
48
  EXIT_CODE,
@@ -54,9 +54,9 @@ import {
54
54
  readFileIfExists,
55
55
  resolvePmRoot,
56
56
  writeFileAtomic
57
- } from "./chunk-AFWZRL7M.js";
57
+ } from "./chunk-BSEQUTQP.js";
58
58
 
59
- // dist/cli/commands/profile.js
59
+ // dist/sdk/profile.js
60
60
  import path2 from "node:path";
61
61
 
62
62
  // dist/core/profile/profile-describe.js
@@ -235,13 +235,13 @@ function planProfileApplication(profile, current) {
235
235
  };
236
236
  }
237
237
 
238
- // dist/cli/commands/templates.js
238
+ // dist/sdk/templates.js
239
239
  import fs from "node:fs/promises";
240
240
  import path from "node:path";
241
241
  !(function() {
242
242
  try {
243
243
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
244
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7f0126a2-7994-5a69-a8ae-59fbe151b326");
244
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fd7f571a-fcdc-5924-8710-7ac302e32ef5");
245
245
  } catch (e2) {
246
246
  }
247
247
  })();
@@ -285,6 +285,13 @@ var BUILTIN_TEMPLATES = {
285
285
  body: "## What\n\n## Why\n"
286
286
  }
287
287
  };
288
+ var _testOnly = {
289
+ normalizeTemplateName,
290
+ extractTemplateOptions,
291
+ parseStoredTemplateDocument,
292
+ builtinTemplateDocument,
293
+ readStoredTemplateDocument
294
+ };
288
295
  function normalizeTemplateName(rawName) {
289
296
  const name = rawName.trim();
290
297
  if (!TEMPLATE_NAME_PATTERN.test(name)) {
@@ -488,11 +495,11 @@ async function runTemplatesShow(rawTemplateName, global2) {
488
495
  };
489
496
  }
490
497
 
491
- // dist/cli/commands/profile.js
498
+ // dist/sdk/profile.js
492
499
  !(function() {
493
500
  try {
494
501
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
495
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "475c64a1-b819-5538-bddd-512f1c43fdde");
502
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5ec91a0b-d2fa-5ce8-af93-ce6e6db6c12b");
496
503
  } catch (e2) {
497
504
  }
498
505
  })();
@@ -840,10 +847,20 @@ function formatProfileApplyHuman(result) {
840
847
  return lines.join("\n");
841
848
  }
842
849
 
850
+ // dist/cli/commands/profile.js
851
+ !(function() {
852
+ try {
853
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
854
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "93676982-06c1-54a9-85e9-452df3aebe93");
855
+ } catch (e2) {
856
+ }
857
+ })();
858
+
843
859
  export {
844
860
  describeProfileComposition,
845
861
  describeProjectProfile,
846
862
  planProfileApplication,
863
+ _testOnly,
847
864
  loadCreateTemplateOptions,
848
865
  runTemplatesSave,
849
866
  runTemplatesList,
@@ -858,4 +875,4 @@ export {
858
875
  formatProfileLintHuman,
859
876
  formatProfileApplyHuman
860
877
  };
861
- //# sourceMappingURL=chunk-PHKP3AGR.js.map
878
+ //# sourceMappingURL=chunk-UWQHLMEB.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../sdk/profile.ts", "../../../../../../../../core/profile/profile-describe.ts", "../../../../../../../../core/profile/profile-plan.ts", "../../../../../../../../sdk/templates.ts"],
4
+ "sourcesContent": ["/**\n * @module sdk/profile\n *\n * Implements the `pm profile` command surface: listing the built-in project\n * archetypes, showing a profile's full composition, and applying a profile to an\n * initialized tracker. Apply stages item types, custom statuses, custom fields,\n * per-type workflows, config knobs, and create templates idempotently, and\n * surfaces advisory package recommendations. The pure diff lives in\n * {@link module:core/profile/profile-plan}; this module is the I/O orchestration\n * and human formatting around it.\n */\nimport path from \"node:path\";\nimport {\n pathExists,\n readFileIfExists,\n writeFileAtomic,\n} from \"../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { resolveAuthor } from \"../core/shared/author.js\";\nimport { nowIso } from \"../core/shared/time.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport {\n readSettings,\n resolveGovernanceKnobs,\n writeSettings,\n} from \"../core/store/settings.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../core/schema/runtime-schema.js\";\nimport {\n normalizeAddTypeInput,\n serializeItemTypesFile,\n} from \"../core/schema/item-types-file.js\";\nimport { serializeStatusDefsFile } from \"../core/schema/status-defs-file.js\";\nimport { serializeFieldsFile } from \"../core/schema/fields-file.js\";\nimport {\n resolveNestedSettingDescriptor,\n writeNestedSettingValue,\n} from \"../core/config/nested-settings.js\";\nimport {\n getActiveExtensionRegistrations,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nimport {\n resolveProfileCatalog,\n resolveProfileEntry,\n type ExtensionProfileContribution,\n type ProfileSourceKind,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ResolveProfileEntryResult,\n} from \"../core/profile/profile-presets.js\";\nimport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n} from \"../core/profile/profile-describe.js\";\nimport {\n lintProjectProfile,\n type ProjectProfileLintFinding,\n} from \"../core/profile/profile-lint.js\";\nimport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileCurrentState,\n} from \"../core/profile/profile-plan.js\";\nimport { ensureTypeFolderScaffold } from \"./schema.js\";\nimport { runTemplatesSave } from \"./templates.js\";\n\n/** Ordered `pm profile` subcommands. */\nexport const PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"apply\", \"lint\"] as const;\n/** Restricts profile subcommand values accepted by command, SDK, and storage contracts. */\nexport type ProfileSubcommand = (typeof PROFILE_SUBCOMMANDS)[number];\n\nconst PROFILE_TYPES_LOCK_ID = \"schema-types\";\nconst PROFILE_STATUSES_LOCK_ID = \"schema-statuses\";\nconst PROFILE_FIELDS_LOCK_ID = \"schema-fields\";\n\n/**\n * Per-dimension counts summarizing how much a profile stages. Aliases the shared\n * {@link ProjectProfileComposition} so the CLI result shape and the core describe\n * primitive never drift.\n */\nexport type ProfileComposition = ProjectProfileComposition;\n\n/** A single profile entry in the `pm profile list` payload. */\nexport interface ProfileListEntry {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n}\n\n/** Result of `pm profile list`. */\nexport interface ProfileListResult {\n /** Discriminant for the profile result union. */\n action: \"list\";\n /** Built-in profiles in canonical order followed by active extension profiles. */\n profiles: ProfileListEntry[];\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile show <name>`. */\nexport interface ProfileShowResult {\n /** Discriminant for the profile result union. */\n action: \"show\";\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n /** Item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: Array<{ spec: string; reason: string }>;\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Per-dimension change summary in an apply result. */\nexport interface ProfileApplyDimension {\n /** Entry keys that were newly created. */\n added: string[];\n /** Entry keys whose stored value was overwritten. */\n updated: string[];\n /** Entry keys already current (no write). */\n unchanged: string[];\n}\n\n/** Result of `pm profile apply <name>`. */\nexport interface ProfileApplyResult {\n /** Discriminant for the profile result union. */\n action: \"apply\";\n /** Applied profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** True when changes were persisted; false for `--dry-run` or a no-op. */\n applied: boolean;\n /** True when `--dry-run` previewed without writing. */\n dry_run: boolean;\n /** True when at least one dimension stages an add/update. */\n changed: boolean;\n /** Item-type change summary. */\n types: ProfileApplyDimension;\n /** Status change summary. */\n statuses: ProfileApplyDimension;\n /** Field change summary. */\n fields: ProfileApplyDimension;\n /** Workflow change summary. */\n workflows: ProfileApplyDimension;\n /** Config-knob change summary. */\n config: ProfileApplyDimension;\n /** Template change summary. */\n templates: ProfileApplyDimension;\n /** Advisory package recommendations with install status. */\n packages: Array<{\n spec: string;\n reason: string;\n status: \"installed\" | \"recommended\";\n }>;\n /** Deduped on-write hook + advisory warnings. */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile lint [name]`. */\nexport interface ProfileLintResult {\n /** Discriminant for the profile result union. */\n action: \"lint\";\n /** Linted profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** True when the profile produced no error-severity findings. */\n ok: boolean;\n /** Count of error-severity findings. */\n error_count: number;\n /** Count of warning-severity findings. */\n warning_count: number;\n /** Every graded consistency finding in dimension order. */\n findings: ProjectProfileLintFinding[];\n /** Non-fatal catalog merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Discriminated union of every `pm profile` result shape. */\nexport type ProfileResult =\n | ProfileListResult\n | ProfileShowResult\n | ProfileApplyResult\n | ProfileLintResult;\n\n/* c8 ignore start -- profile command I/O orchestration and formatting is covered by profile integration workflows; the idempotent diff is unit-tested in core/profile/profile-plan. */\n\n/** Collects the profiles contributed by active extensions, mapping the live registration registry onto the resolver's contribution shape. Returns an empty list when extensions are disabled or none registered a profile. */\nfunction collectExtensionProfileContributions(): ExtensionProfileContribution[] {\n const registrations = getActiveExtensionRegistrations();\n if (registrations === null) {\n return [];\n }\n return registrations.profiles.map((entry) => ({\n name: entry.name,\n profile: entry.profile,\n }));\n}\n\n/** Lists every available profile — the built-in archetypes followed by profiles contributed by active extensions — with per-dimension composition counts and the source each came from. Surfaces any non-fatal merge collisions as warnings. */\nexport function runProfileList(): ProfileListResult {\n const { profiles, warnings } = resolveProfileCatalog(\n collectExtensionProfileContributions(),\n );\n return {\n action: \"list\",\n profiles: profiles.map((resolved) => ({\n name: resolved.definition.name,\n title: resolved.definition.title,\n summary: resolved.definition.summary,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n composition: describeProfileComposition(resolved.definition),\n })),\n warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Shows the full composition of a single profile, resolved across built-in and extension-contributed archetypes. Throws a USAGE error for a missing or unknown profile name. */\nexport function runProfileShow(name: string | undefined): ProfileShowResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n const { resolved } = entry;\n return {\n action: \"show\",\n ...describeProjectProfile(resolved.definition),\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Lints a single profile, resolved across built-in and extension-contributed archetypes, returning every graded consistency finding plus any catalog merge warnings. Throws a USAGE error for a missing or unknown profile name. This is the read-only author-time validation surface; it never writes to the tracker. */\nexport function runProfileLint(name: string | undefined): ProfileLintResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n const { resolved } = entry;\n const report = lintProjectProfile(resolved.definition);\n return {\n action: \"lint\",\n name: resolved.definition.name,\n title: resolved.definition.title,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n ok: report.ok,\n error_count: report.errorCount,\n warning_count: report.warningCount,\n findings: report.findings,\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Options accepted by {@link runProfileApply}. */\nexport interface ProfileApplyCommandOptions {\n /** Preview the diff without writing any files. */\n dryRun?: boolean;\n /** Mutation author override. */\n author?: string;\n /** Force ownership/lock override. */\n force?: boolean;\n}\n\nfunction templateFilePath(pmRoot: string, name: string): string {\n return path.join(pmRoot, \"templates\", `${name}.json`);\n}\n\nasync function readStoredTemplateOptions(\n pmRoot: string,\n name: string,\n): Promise<ProfileTemplateOptions | undefined> {\n const raw = await readFileIfExists(templateFilePath(pmRoot, name));\n if (raw === null) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (\n parsed !== null &&\n typeof parsed === \"object\" &&\n !Array.isArray(parsed)\n ) {\n const options = (parsed as { options?: unknown }).options;\n if (\n options !== null &&\n typeof options === \"object\" &&\n !Array.isArray(options)\n ) {\n return options as ProfileTemplateOptions;\n }\n }\n } catch {\n // A malformed template file is treated as absent so apply re-stages it.\n }\n return undefined;\n}\n\nasync function loadProfileCurrentState(\n pmRoot: string,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n profile: ProjectProfileDefinition,\n): Promise<ProfileCurrentState> {\n const templates = new Map<string, ProfileTemplateOptions>();\n for (const template of profile.templates) {\n const stored = await readStoredTemplateOptions(pmRoot, template.name);\n if (stored !== undefined) {\n templates.set(template.name, stored);\n }\n }\n return {\n typesRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.types,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types,\n ),\n ),\n statusesRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n ),\n ),\n fieldsRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.fields,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields,\n ),\n ),\n workflows: settings.schema.type_workflows ?? [],\n settings,\n templates,\n // Package recommendations are advisory: apply never installs and never\n // inspects install state, so every recommendation surfaces as \"recommended\".\n // The planner still supports an install-state set for SDK consumers that want\n // richer reporting.\n installedPackages: new Set<string>(),\n };\n}\n\nfunction dimensionFrom(\n changes: ReadonlyArray<{ key: string; status: ProfileChangeStatus }>,\n): ProfileApplyDimension {\n const added: string[] = [];\n const updated: string[] = [];\n const unchanged: string[] = [];\n for (const change of changes) {\n (change.status === \"add\"\n ? added\n : change.status === \"update\"\n ? updated\n : unchanged\n ).push(change.key);\n }\n return { added, updated, unchanged };\n}\n\nfunction buildApplyResult(\n profile: ProjectProfileDefinition,\n plan: ProfileApplicationPlan,\n applied: boolean,\n dryRun: boolean,\n warnings: string[],\n): ProfileApplyResult {\n return {\n action: \"apply\",\n name: profile.name,\n title: profile.title,\n applied,\n dry_run: dryRun,\n changed: plan.changed,\n types: dimensionFrom(plan.types.changes),\n statuses: dimensionFrom(plan.statuses.changes),\n fields: dimensionFrom(plan.fields.changes),\n workflows: dimensionFrom(\n plan.workflows.changes.map((change) => ({\n key: change.type,\n status: change.status,\n })),\n ),\n config: dimensionFrom(plan.config.changes),\n templates: dimensionFrom(\n plan.templates.changes.map((change) => ({\n key: change.name,\n status: change.status,\n })),\n ),\n packages: plan.packages,\n warnings: [...new Set(warnings)].sort((left, right) =>\n left.localeCompare(right),\n ),\n generated_at: nowIso(),\n };\n}\n\nasync function assertProfileTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n}\n\nfunction resolveProfileForCommand(name: string | undefined): {\n profile: ProjectProfileDefinition;\n warnings: string[];\n} {\n try {\n const entry = resolveProfileEntry(\n name,\n collectExtensionProfileContributions(),\n );\n return {\n profile: entry.resolved.definition,\n warnings: entry.warnings,\n };\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/** Applies a profile to the initialized tracker, or previews the idempotent diff when `dryRun` is set. Schema files are written under their respective locks; config and workflows are persisted to settings; templates are staged via the shared template writer. Re-applying an already-applied profile performs zero writes. Throws a USAGE error for an unknown profile or an invalid config knob, and a NOT_FOUND error when the tracker is not initialized. */\nexport async function runProfileApply(\n name: string | undefined,\n options: ProfileApplyCommandOptions,\n global: GlobalOptions,\n): Promise<ProfileApplyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await assertProfileTrackerInitialized(pmRoot);\n\n // Catalog-level merge warnings (e.g. an extension profile shadowed by a\n // built-in) seed the result so `apply` surfaces them the same way `list`\n // does, rather than silently swallowing them.\n const resolvedProfile = resolveProfileForCommand(name);\n const profile = resolvedProfile.profile;\n const mergeWarnings = resolvedProfile.warnings;\n\n const dryRun = options.dryRun === true;\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n\n if (dryRun) {\n const state = await loadProfileCurrentState(\n pmRoot,\n schema,\n settings,\n profile,\n );\n const plan = planProfile(profile, state);\n return buildApplyResult(profile, plan, false, true, [...mergeWarnings]);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n const force = Boolean(options.force);\n const warnings: string[] = [...mergeWarnings];\n\n // Acquire all three schema locks inside the try so a later acquisition that\n // throws (held/stale lock without --force) still releases the earlier ones in\n // finally rather than stranding them until TTL expiry.\n const releasers: Array<() => Promise<void>> = [];\n const acquire = async (lockId: string): Promise<void> => {\n releasers.push(\n await acquireLock(\n pmRoot,\n lockId,\n settings.locks.ttl_seconds,\n author,\n force,\n governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n ),\n );\n };\n let plan: ProfileApplicationPlan;\n try {\n await acquire(PROFILE_TYPES_LOCK_ID);\n await acquire(PROFILE_STATUSES_LOCK_ID);\n await acquire(PROFILE_FIELDS_LOCK_ID);\n const state = await loadProfileCurrentState(\n pmRoot,\n schema,\n settings,\n profile,\n );\n plan = planProfile(profile, state);\n\n if (plan.types.changed) {\n const typesPath = filePathForSchemaSection(\n pmRoot,\n schema.files.types,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types,\n );\n await writeFileAtomic(typesPath, serializeItemTypesFile(plan.types.file));\n const stagedNames = new Set(\n profile.types.map((type) => normalizeAddTypeInput(type).name),\n );\n const stagedDefinitions = plan.types.file.definitions.filter(\n (definition) => stagedNames.has(definition.name),\n );\n await ensureTypeFolderScaffold(\n pmRoot,\n stagedDefinitions,\n warnings,\n \"profile:apply-type-folder\",\n );\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"profile:apply-types\",\n })),\n );\n }\n if (plan.statuses.changed) {\n const statusesPath = filePathForSchemaSection(\n pmRoot,\n schema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n await writeFileAtomic(\n statusesPath,\n serializeStatusDefsFile(plan.statuses.file),\n );\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"profile:apply-statuses\",\n })),\n );\n }\n if (plan.fields.changed) {\n const fieldsPath = filePathForSchemaSection(\n pmRoot,\n schema.files.fields,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields,\n );\n await writeFileAtomic(fieldsPath, serializeFieldsFile(plan.fields.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: fieldsPath,\n scope: \"project\",\n op: \"profile:apply-fields\",\n })),\n );\n }\n if (plan.config.changed || plan.workflows.changed) {\n for (const change of plan.config.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n const descriptor = resolveNestedSettingDescriptor(change.key);\n if (descriptor !== undefined) {\n writeNestedSettingValue(\n settings as unknown as Record<string, unknown>,\n descriptor,\n change.value,\n );\n }\n }\n settings.schema.type_workflows = plan.workflows.result;\n await writeSettings(pmRoot, settings, \"profile:apply-config\");\n }\n for (const change of plan.templates.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n await runTemplatesSave(change.name, { ...change.options }, global);\n }\n } finally {\n // Release in reverse acquisition order; only locks actually acquired are\n // present. Each release is best-effort so one rejecting release never strands\n // the remaining locks (a failed release falls back to TTL expiry).\n for (const release of releasers.reverse()) {\n try {\n await release();\n } catch {\n // Ignore: a failed lock release is non-fatal and self-heals at TTL.\n }\n }\n }\n\n return buildApplyResult(profile, plan, plan.changed, false, warnings);\n}\n\n// planProfileApplication can throw a plain Error for an invalid config knob; map\n// it to a USAGE exit code consistently across the dry-run and apply paths.\nfunction planProfile(\n profile: ProjectProfileDefinition,\n state: ProfileCurrentState,\n): ProfileApplicationPlan {\n try {\n return planProfileApplication(profile, state);\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction formatDimensionLine(\n label: string,\n dimension: ProfileApplyDimension,\n): string | undefined {\n const segments: string[] = [];\n if (dimension.added.length > 0) {\n segments.push(`+${dimension.added.join(\", \")}`);\n }\n if (dimension.updated.length > 0) {\n segments.push(`~${dimension.updated.join(\", \")}`);\n }\n if (segments.length === 0) {\n return undefined;\n }\n return ` ${label}: ${segments.join(\" \")}`;\n}\n\n/** Renders the `pm profile list` result as human-readable text. */\nexport function formatProfileListHuman(result: ProfileListResult): string {\n const lines = [\"Project profiles:\"];\n for (const profile of result.profiles) {\n const origin =\n profile.source === \"extension\"\n ? ` [${profile.package ?? \"extension\"}]`\n : \"\";\n lines.push(\n ` ${profile.name} — ${profile.title}: ${profile.summary}${origin}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile show` result as human-readable text. */\nexport function formatProfileShowHuman(result: ProfileShowResult): string {\n const origin =\n result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n const lines = [\n `${result.name} — ${result.title}${origin}`,\n result.summary,\n \"\",\n ];\n lines.push(`types: ${result.types.join(\", \") || \"(none)\"}`);\n lines.push(`statuses: ${result.statuses.join(\", \") || \"(none)\"}`);\n lines.push(`fields: ${result.fields.join(\", \") || \"(none)\"}`);\n lines.push(`workflows: ${result.workflows.join(\", \") || \"(none)\"}`);\n lines.push(`config: ${result.config.join(\", \") || \"(none)\"}`);\n lines.push(`templates: ${result.templates.join(\", \") || \"(none)\"}`);\n lines.push(\n `packages: ${result.packages.map((pkg) => pkg.spec).join(\", \") || \"(none)\"}`,\n );\n for (const warning of result.warnings) {\n lines.push(`warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile lint` result as human-readable text: a one-line verdict followed by each finding prefixed with its severity, code, and dimension. */\nexport function formatProfileLintHuman(result: ProfileLintResult): string {\n const origin =\n result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n // Catalog merge warnings are rendered below alongside lint-finding warnings, so\n // fold them into the headline count to avoid an \"ok (0 warnings)\" verdict that\n // is immediately followed by `warning:` lines.\n const totalWarningCount = result.warning_count + result.warnings.length;\n const verdict = result.ok\n ? `Profile ${result.name}${origin}: ok (${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"})`\n : `Profile ${result.name}${origin}: ${result.error_count} error${result.error_count === 1 ? \"\" : \"s\"}, ${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"}`;\n const lines = [verdict];\n for (const finding of result.findings) {\n const target = finding.target !== undefined ? ` (${finding.target})` : \"\";\n lines.push(\n ` ${finding.severity} [${finding.code}] ${finding.dimension}${target}: ${finding.message}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile apply` result as human-readable text, including the staged diff and any package recommendations. */\nexport function formatProfileApplyHuman(result: ProfileApplyResult): string {\n const mode = result.dry_run\n ? \"dry-run\"\n : result.applied\n ? \"applied\"\n : \"no changes\";\n const lines = [`Profile ${result.name} (${mode})`];\n if (!result.changed) {\n lines.push(\" already up to date\");\n } else {\n for (const [label, dimension] of [\n [\"types\", result.types],\n [\"statuses\", result.statuses],\n [\"fields\", result.fields],\n [\"workflows\", result.workflows],\n [\"config\", result.config],\n [\"templates\", result.templates],\n ] as const) {\n const line = formatDimensionLine(label, dimension);\n if (line !== undefined) {\n lines.push(line);\n }\n }\n }\n const recommended = result.packages.filter(\n (pkg) => pkg.status === \"recommended\",\n );\n if (recommended.length > 0) {\n lines.push(\n ` recommended packages: ${recommended.map((pkg) => pkg.spec).join(\", \")}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n", "/**\n * @module core/profile/profile-describe\n *\n * Author-time *describe* primitive for a {@link ProjectProfileDefinition}: the\n * project-profile analogue of the extension surface's `describeExtensionBlueprint`.\n * It distills a profile into a deterministic, side-effect-free summary — the\n * per-dimension counts plus the resolved entry identifiers — so the CLI\n * `pm profile show`/`list` formatters and SDK consumers share one source of truth\n * for \"what does this profile stage?\" rather than each recomputing it inline.\n *\n * Identifier derivation deliberately mirrors what {@link module:core/profile/profile-plan}\n * upserts: item type names, status ids, and field keys all flow through the same\n * `normalizeAddTypeInput` / `normalizeAddStatusInput` / `normalizeAddFieldInput`\n * canonicalization the planner uses, so describe reports the exact ids/keys\n * `pm profile apply` stages (not the author's raw casing/spelling). Workflows,\n * config, templates, and packages surface their authored identity verbatim.\n *\n * Describe is intentionally lenient: it feeds read-only `pm profile show`/`list`,\n * so a semantically-invalid entry from an untrusted extension-contributed profile\n * (a built-in-named or empty type/status/field the normalizer rejects) falls back\n * to its raw identifier rather than throwing — surfacing the actual defect is the\n * job of {@link module:core/profile/profile-lint lintProjectProfile}, not describe.\n */\nimport { normalizeAddFieldInput } from \"../schema/fields-file.js\";\nimport { normalizeAddStatusInput } from \"../schema/status-defs-file.js\";\nimport { normalizeAddTypeInput } from \"../schema/item-types-file.js\";\nimport type { ProjectProfileDefinition } from \"./profile-presets.js\";\n\n/** Per-dimension counts summarizing how much a profile stages. */\nexport interface ProjectProfileComposition {\n /** Number of item types the profile registers. */\n types: number;\n /** Number of custom statuses. */\n statuses: number;\n /** Number of custom fields. */\n fields: number;\n /** Number of per-type workflows. */\n workflows: number;\n /** Number of config knobs. */\n config: number;\n /** Number of create templates. */\n templates: number;\n /** Number of recommended packages. */\n packages: number;\n}\n\n/** A package recommendation distilled to its spec and rationale. */\nexport interface ProjectProfilePackageSummary {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n}\n\n/** Deterministic summary of a profile's composition produced by {@link describeProjectProfile}. */\nexport interface ProjectProfileDescription {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Per-dimension counts. */\n composition: ProjectProfileComposition;\n /** Canonical item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: ProjectProfilePackageSummary[];\n}\n\n/** Computes the per-dimension counts for a profile. */\nexport function describeProfileComposition(\n profile: ProjectProfileDefinition,\n): ProjectProfileComposition {\n return {\n types: profile.types.length,\n statuses: profile.statuses.length,\n fields: profile.fields.length,\n workflows: profile.workflows.length,\n config: profile.config.length,\n templates: profile.templates.length,\n packages: profile.packages.length,\n };\n}\n\n/**\n * Distills a profile definition into a deterministic composition summary. Pure\n * and tracker-independent; the resolved identifiers match exactly what\n * `pm profile apply` stages for each dimension.\n *\n * @param profile The profile definition to describe.\n * @returns The profile's metadata, per-dimension counts, and resolved entry\n * identifiers.\n */\nexport function describeProjectProfile(\n profile: ProjectProfileDefinition,\n): ProjectProfileDescription {\n return {\n name: profile.name,\n title: profile.title,\n summary: profile.summary,\n composition: describeProfileComposition(profile),\n types: profile.types.map((type) =>\n lenientIdentifier(\n () => normalizeAddTypeInput(type).name,\n () => String(type.name ?? \"\"),\n ),\n ),\n statuses: profile.statuses.map((status) =>\n lenientIdentifier(\n () => normalizeAddStatusInput(status).id,\n () => String(status.id ?? \"\"),\n ),\n ),\n fields: profile.fields.map((field) =>\n lenientIdentifier(\n () => normalizeAddFieldInput(field).key,\n () => String(field.key ?? \"\"),\n ),\n ),\n workflows: profile.workflows.map((workflow) => workflow.type),\n config: profile.config.map((entry) => `${entry.key}=${entry.value}`),\n templates: profile.templates.map((template) => template.name),\n packages: profile.packages.map((recommendation) => ({\n spec: recommendation.spec,\n reason: recommendation.reason,\n })),\n };\n}\n\n/**\n * Resolves a dimension entry's identifier through the planner's canonicalizing\n * normalizer so describe reports exactly what `pm profile apply` stages, falling\n * back to the entry's raw identifier when the normalizer rejects a semantically\n * invalid value (a built-in-named or empty type/status/field) — surfacing the\n * defect is the job of {@link module:core/profile/profile-lint}, not describe.\n */\nfunction lenientIdentifier(normalize: () => string, raw: () => string): string {\n try {\n return normalize();\n } catch {\n return raw();\n }\n}\n", "/**\n * @module core/profile/profile-plan\n *\n * Pure planning for `pm profile apply`. Given a {@link ProjectProfileDefinition}\n * and a snapshot of the current tracker state, computes an idempotent diff across\n * every profile dimension (item types, statuses, fields, per-type workflows,\n * config knobs, templates, and package recommendations) without touching disk.\n *\n * Idempotency is structural: each schema component is upserted onto a clone and\n * the canonical serialization is compared before/after, so re-running `apply`\n * against an already-applied profile reports every entry as `unchanged` and the\n * command performs zero writes. The resulting files/settings the planner returns\n * are exactly what the apply step persists, guaranteeing the dry-run preview and\n * the real mutation never diverge.\n */\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n type ItemTypesFile,\n} from \"../schema/item-types-file.js\";\nimport {\n normalizeAddStatusInput,\n parseStatusDefsFile,\n serializeStatusDefsFile,\n upsertStatusDef,\n type StatusDefsFile,\n} from \"../schema/status-defs-file.js\";\nimport {\n normalizeAddFieldInput,\n parseFieldsFile,\n serializeFieldsFile,\n upsertField,\n type FieldsFile,\n} from \"../schema/fields-file.js\";\nimport {\n parseNestedSettingValue,\n readNestedSettingValue,\n resolveNestedSettingDescriptor,\n} from \"../config/nested-settings.js\";\nimport type { TypeWorkflowDefinition } from \"../../types.js\";\nimport type {\n ProfileTemplateOptions,\n ProjectProfileDefinition,\n} from \"./profile-presets.js\";\n\n/** Per-entry change classification used across every profile dimension. */\nexport type ProfileChangeStatus = \"add\" | \"update\" | \"unchanged\";\n\n/** A single staged change keyed by its component identifier. */\nexport interface ProfileComponentChange {\n /** Component identity (type name, status id, field key, etc.). */\n key: string;\n /** Whether the entry is new, an overwrite, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for a file-backed schema component (types/statuses/fields). */\nexport interface ProfileSchemaPlan<TFile> {\n /** Serialized file content to persist when `changed`. */\n file: TFile;\n /** Per-entry classifications in profile order. */\n changes: ProfileComponentChange[];\n /** True when at least one entry is add/update. */\n changed: boolean;\n}\n\n/** A staged per-type workflow change plus the merged result list. */\nexport interface ProfileWorkflowChange {\n /** Item type the workflow governs. */\n type: string;\n /** Whether the workflow is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the `schema.type_workflows` settings subtree. */\nexport interface ProfileWorkflowPlan {\n /** Per-workflow classifications in profile order. */\n changes: ProfileWorkflowChange[];\n /** Full merged workflow list to persist when `changed`. */\n result: TypeWorkflowDefinition[];\n /** True when at least one workflow is add/update. */\n changed: boolean;\n}\n\n/** A staged config knob plus the resolved settings path and typed value. */\nexport interface ProfileConfigChange {\n /** Descriptor key (snake_case). */\n key: string;\n /** Dotted PmSettings path the value writes to. */\n path: string;\n /** Typed leaf value to persist. */\n value: string | number | boolean;\n /** Whether the leaf is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the nested-settings knobs a profile stages. */\nexport interface ProfileConfigPlan {\n /** Per-knob classifications in profile order. */\n changes: ProfileConfigChange[];\n /** True when at least one knob is add/update. */\n changed: boolean;\n}\n\n/** A staged create-template change. */\nexport interface ProfileTemplateChange {\n /** Template name. */\n name: string;\n /** Option payload to persist for the template. */\n options: ProfileTemplateOptions;\n /** Whether the template is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the create templates a profile stages. */\nexport interface ProfileTemplatePlan {\n /** Per-template classifications in profile order. */\n changes: ProfileTemplateChange[];\n /** True when at least one template is add/update. */\n changed: boolean;\n}\n\n/** Advisory package recommendation with install status. */\nexport interface ProfilePackagePlan {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n /** `installed` when already present, otherwise `recommended`. */\n status: \"installed\" | \"recommended\";\n}\n\n/** Current tracker state the planner diffs the profile against. */\nexport interface ProfileCurrentState {\n /** Raw `schema/types.json` content (or null when absent). */\n typesRaw: string | null;\n /** Raw status-defs file content (or null when absent). */\n statusesRaw: string | null;\n /** Raw fields file content (or null when absent). */\n fieldsRaw: string | null;\n /** Current `schema.type_workflows` entries. */\n workflows: readonly TypeWorkflowDefinition[];\n /** Settings object used to read current config leaf values. */\n settings: unknown;\n /** Existing stored template options keyed by template name. */\n templates: ReadonlyMap<string, ProfileTemplateOptions>;\n /** Install specs/aliases already present in the project. */\n installedPackages: ReadonlySet<string>;\n}\n\n/** Complete idempotent plan for applying a profile. */\nexport interface ProfileApplicationPlan {\n /** Identifying metadata for the planned profile. */\n profile: { name: string; title: string; summary: string };\n /** Item-type plan. */\n types: ProfileSchemaPlan<ItemTypesFile>;\n /** Status plan. */\n statuses: ProfileSchemaPlan<StatusDefsFile>;\n /** Field plan. */\n fields: ProfileSchemaPlan<FieldsFile>;\n /** Per-type workflow plan. */\n workflows: ProfileWorkflowPlan;\n /** Config-knob plan. */\n config: ProfileConfigPlan;\n /** Template plan. */\n templates: ProfileTemplatePlan;\n /** Advisory package recommendations. */\n packages: ProfilePackagePlan[];\n /** True when any dimension stages an add/update. */\n changed: boolean;\n}\n\n/**\n * Plans a file-backed schema component by upserting each normalized input onto a\n * working clone and comparing canonical serializations to classify add/update/\n * unchanged. Shared by the type, status, and field planners.\n */\nfunction planSchemaComponent<TInput, TFile>(\n initialFile: TFile,\n inputs: readonly TInput[],\n keyOf: (input: TInput) => string,\n serialize: (file: TFile) => string,\n upsert: (file: TFile, input: TInput) => { file: TFile; replaced: boolean },\n): ProfileSchemaPlan<TFile> {\n let file = initialFile;\n const changes: ProfileComponentChange[] = [];\n for (const input of inputs) {\n const before = serialize(file);\n const result = upsert(file, input);\n const after = serialize(result.file);\n file = result.file;\n const status: ProfileChangeStatus =\n before === after ? \"unchanged\" : result.replaced ? \"update\" : \"add\";\n changes.push({ key: keyOf(input), status });\n }\n return {\n file,\n changes,\n changed: changes.some((change) => change.status !== \"unchanged\"),\n };\n}\n\n/**\n * Canonicalizes an allowed-transition list to an order-independent string. The\n * transitions are a set of `[from, to]` pairs, so a stored list that merely\n * reorders the same pairs must not register as a spurious `update`.\n */\nfunction canonicalTransitions(\n transitions: readonly [string, string][],\n): string {\n return JSON.stringify(transitions.map((pair) => pair.join(\"\u0000\")).sort());\n}\n\n/**\n * Plans the per-type workflow merge. A workflow whose transition set matches the\n * current entry (order-independent) is `unchanged`; a new type is `add`; a\n * changed transition set is `update`. The merged result preserves untouched\n * entries.\n */\nfunction planWorkflows(\n current: readonly TypeWorkflowDefinition[],\n desired: readonly TypeWorkflowDefinition[],\n): ProfileWorkflowPlan {\n const result = current.map((entry) => ({ ...entry }));\n const changes: ProfileWorkflowChange[] = [];\n for (const workflow of desired) {\n const index = result.findIndex((entry) => entry.type === workflow.type);\n const next: TypeWorkflowDefinition = {\n type: workflow.type,\n allowed_transitions: workflow.allowed_transitions,\n };\n if (index < 0) {\n result.push(next);\n changes.push({ type: workflow.type, status: \"add\" });\n } else if (\n canonicalTransitions(result[index].allowed_transitions) ===\n canonicalTransitions(workflow.allowed_transitions)\n ) {\n changes.push({ type: workflow.type, status: \"unchanged\" });\n } else {\n result[index] = next;\n changes.push({ type: workflow.type, status: \"update\" });\n }\n }\n return {\n changes,\n result,\n changed: changes.some((change) => change.status !== \"unchanged\"),\n };\n}\n\n/**\n * Plans config knobs by resolving each descriptor, coercing the value, and\n * comparing it against the current settings leaf. Throws a plain Error for an\n * unknown key or invalid value so the CLI can map it to a USAGE exit code.\n */\nfunction planConfig(\n profile: ProjectProfileDefinition,\n settings: unknown,\n): ProfileConfigPlan {\n const changes: ProfileConfigChange[] = [];\n for (const entry of profile.config) {\n const descriptor = resolveNestedSettingDescriptor(entry.key);\n if (descriptor === undefined) {\n throw new Error(\n `Profile \"${profile.name}\" references unknown config key \"${entry.key}\".`,\n );\n }\n const parsed = parseNestedSettingValue(descriptor, entry.value);\n if (!parsed.ok) {\n throw new Error(\n `Profile \"${profile.name}\" config ${entry.key}: ${parsed.error.message}`,\n );\n }\n // readNestedSettingValue returns `null` (never `undefined`) when the leaf is\n // absent, so a null current is an unambiguous \"add\".\n const current = readNestedSettingValue(settings, descriptor);\n const status: ProfileChangeStatus =\n current === null\n ? \"add\"\n : current === parsed.parsed.value\n ? \"unchanged\"\n : \"update\";\n changes.push({\n key: descriptor.key,\n path: descriptor.path,\n value: parsed.parsed.value,\n status,\n });\n }\n return {\n changes,\n changed: changes.some((change) => change.status !== \"unchanged\"),\n };\n}\n\n/**\n * Canonicalizes a template option payload to a key-order-independent string so a\n * profile's authored option order never produces a spurious `update` against the\n * key-sorted form `pm templates save` persists.\n */\nfunction canonicalTemplateOptions(options: ProfileTemplateOptions): string {\n const sorted = Object.entries(options).sort(([left], [right]) =>\n left.localeCompare(right),\n );\n return JSON.stringify(sorted);\n}\n\n/**\n * Plans create templates by comparing each profile template's option payload\n * against the stored template (if any). Equality is canonical so option key\n * ordering never produces a spurious `update`.\n */\nfunction planTemplates(\n profile: ProjectProfileDefinition,\n existing: ReadonlyMap<string, ProfileTemplateOptions>,\n): ProfileTemplatePlan {\n const changes: ProfileTemplateChange[] = [];\n for (const template of profile.templates) {\n const current = existing.get(template.name);\n let status: ProfileChangeStatus;\n if (current === undefined) {\n status = \"add\";\n } else if (\n canonicalTemplateOptions(current) ===\n canonicalTemplateOptions(template.options)\n ) {\n status = \"unchanged\";\n } else {\n status = \"update\";\n }\n changes.push({ name: template.name, options: template.options, status });\n }\n return {\n changes,\n changed: changes.some((change) => change.status !== \"unchanged\"),\n };\n}\n\n/**\n * Computes the complete idempotent application plan for a profile against the\n * supplied tracker snapshot. The returned files/settings are exactly what the\n * apply step persists; nothing here touches disk.\n */\nexport function planProfileApplication(\n profile: ProjectProfileDefinition,\n current: ProfileCurrentState,\n): ProfileApplicationPlan {\n const types = planSchemaComponent(\n parseItemTypesFile(current.typesRaw),\n profile.types,\n (input) => normalizeAddTypeInput(input).name,\n serializeItemTypesFile,\n (file, input) => upsertItemType(file, normalizeAddTypeInput(input)),\n );\n const statuses = planSchemaComponent(\n parseStatusDefsFile(current.statusesRaw),\n profile.statuses,\n (input) => normalizeAddStatusInput(input).id,\n serializeStatusDefsFile,\n (file, input) => upsertStatusDef(file, normalizeAddStatusInput(input)),\n );\n const fields = planSchemaComponent(\n parseFieldsFile(current.fieldsRaw),\n profile.fields,\n (input) => normalizeAddFieldInput(input).key,\n serializeFieldsFile,\n (file, input) => upsertField(file, normalizeAddFieldInput(input)),\n );\n const workflows = planWorkflows(current.workflows, profile.workflows);\n const config = planConfig(profile, current.settings);\n const templates = planTemplates(profile, current.templates);\n const packages = profile.packages.map((recommendation) => ({\n spec: recommendation.spec,\n reason: recommendation.reason,\n status: current.installedPackages.has(recommendation.spec)\n ? (\"installed\" as const)\n : (\"recommended\" as const),\n }));\n const changed =\n types.changed ||\n statuses.changed ||\n fields.changed ||\n workflows.changed ||\n config.changed ||\n templates.changed;\n return {\n profile: {\n name: profile.name,\n title: profile.title,\n summary: profile.summary,\n },\n types,\n statuses,\n fields,\n workflows,\n config,\n templates,\n packages,\n changed,\n };\n}\n", "/**\n * @module sdk/templates\n *\n * Implements the pm templates command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n pathExists,\n readFileIfExists,\n writeFileAtomic,\n} from \"../core/fs/fs-utils.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 { nowIso } from \"../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS } from \"./cli-contracts.js\";\n\nconst TEMPLATE_DIRECTORY_NAME = \"templates\";\nconst TEMPLATE_FILE_EXTENSION = \".json\";\nconst TEMPLATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\n\nconst TEMPLATE_OPTION_REPEATABLE_KEYS =\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.map(\n (entry) => entry.target,\n ).filter((target) => target !== \"acceptanceCriteria\");\nconst TEMPLATE_OPTION_REPEATABLE_KEY_SET = new Set<string>(\n TEMPLATE_OPTION_REPEATABLE_KEYS,\n);\n\ntype TemplateOptionValue = string | string[];\n/** Restricts create template options values accepted by command, SDK, and storage contracts. */\nexport type CreateTemplateOptions = Record<string, TemplateOptionValue>;\n/** Restricts template source values accepted by command, SDK, and storage contracts. */\nexport type TemplateSource = \"builtin\" | \"user\";\n\nconst BUILTIN_TEMPLATE_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst BUILTIN_TEMPLATES: Readonly<Record<string, CreateTemplateOptions>> = {\n bug: {\n type: \"Issue\",\n priority: \"1\",\n tags: \"bug\",\n acceptanceCriteria:\n \"Bug no longer reproduces with the steps below and a regression test guards it.\",\n expectedResult: \"Describe the correct behavior.\",\n actualResult: \"Describe the observed (buggy) behavior.\",\n body: \"## Repro steps\\n1. \\n2. \\n3. \\n\\n## Expected\\n\\n## Actual\\n\",\n },\n feature: {\n type: \"Feature\",\n priority: \"2\",\n tags: \"feature\",\n acceptanceCriteria:\n \"Feature is shipped behind agreed scope with tests and docs updated.\",\n whyNow: \"Explain why this is worth doing now (impact / urgency).\",\n body: \"## Goal\\n\\n## Why now\\n\\n## Out of scope\\n\",\n },\n spike: {\n type: \"Task\",\n priority: \"2\",\n tags: \"spike\",\n estimatedMinutes: \"120\",\n acceptanceCriteria:\n \"Timeboxed investigation complete; findings and a recommendation are recorded.\",\n body: \"## Question to answer\\n\\n## Timebox\\n2h\\n\\n## Findings\\n\\n## Recommendation\\n\",\n },\n chore: {\n type: \"Chore\",\n priority: \"3\",\n tags: \"chore\",\n acceptanceCriteria:\n \"Maintenance task done with no behavior change and green checks.\",\n body: \"## What\\n\\n## Why\\n\",\n },\n};\n\ninterface StoredCreateTemplateDocument {\n name: string;\n created_at: string;\n updated_at: string;\n options: CreateTemplateOptions;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n normalizeTemplateName,\n extractTemplateOptions,\n parseStoredTemplateDocument,\n builtinTemplateDocument,\n readStoredTemplateDocument,\n};\n\n/** Documents the templates save result payload exchanged by command, SDK, and package integrations. */\nexport interface TemplatesSaveResult {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** ISO 8601 timestamp recording when created occurred. */\n created_at: string;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports options for this contract. */\n options: CreateTemplateOptions;\n}\n\n/** Documents the templates list result payload exchanged by command, SDK, and package integrations. */\nexport interface TemplatesListResult {\n /** Value that configures or reports templates for this contract. */\n templates: string[];\n /** Value that configures or reports count for this contract. */\n count: number;\n /** Value that configures or reports builtin templates for this contract. */\n builtin_templates: string[];\n /** Value that configures or reports user templates for this contract. */\n user_templates: string[];\n}\n\n/** Documents the templates show result payload exchanged by command, SDK, and package integrations. */\nexport interface TemplatesShowResult {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports source for this contract. */\n source: TemplateSource;\n /** ISO 8601 timestamp recording when created occurred. */\n created_at: string;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports options for this contract. */\n options: CreateTemplateOptions;\n}\n\nfunction normalizeTemplateName(rawName: string): string {\n const name = rawName.trim();\n if (!TEMPLATE_NAME_PATTERN.test(name)) {\n throw new PmCliError(\n `Invalid template name \"${rawName}\". Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._-]*.`,\n EXIT_CODE.USAGE,\n );\n }\n return name;\n}\n\nfunction templatesDirectory(pmRoot: string): string {\n return path.join(pmRoot, TEMPLATE_DIRECTORY_NAME);\n}\n\nfunction templatePath(pmRoot: string, normalizedName: string): string {\n return path.join(\n templatesDirectory(pmRoot),\n `${normalizedName}${TEMPLATE_FILE_EXTENSION}`,\n );\n}\n\nasync function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n}\n\nfunction sortTemplateOptions(\n options: CreateTemplateOptions,\n): CreateTemplateOptions {\n return Object.fromEntries(\n Object.entries(options).sort(([left], [right]) =>\n left.localeCompare(right),\n ),\n ) as CreateTemplateOptions;\n}\n\nfunction extractTemplateOptions(\n rawOptions: Record<string, unknown>,\n): CreateTemplateOptions {\n const next: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(rawOptions)) {\n if (value === undefined) {\n continue;\n }\n if (TEMPLATE_OPTION_REPEATABLE_KEY_SET.has(key)) {\n if (typeof value === \"string\") {\n next[key] = [value];\n continue;\n }\n if (!Array.isArray(value)) {\n continue;\n }\n const values = value.filter(\n (entry): entry is string => typeof entry === \"string\",\n );\n if (values.length > 0) {\n next[key] = values;\n }\n continue;\n }\n if (typeof value === \"string\") {\n next[key] = value;\n continue;\n }\n if (\n Array.isArray(value) &&\n value.every((entry) => typeof entry === \"string\")\n ) {\n next[key] = [...value];\n }\n }\n return sortTemplateOptions(next);\n}\n\nfunction parseStoredTemplateOptions(\n rawOptions: unknown,\n templateName: string,\n): CreateTemplateOptions {\n if (\n typeof rawOptions !== \"object\" ||\n rawOptions === null ||\n Array.isArray(rawOptions)\n ) {\n throw new PmCliError(\n `Template \"${templateName}\" has invalid options payload.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const optionsRecord = rawOptions as Record<string, unknown>;\n const normalized: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(optionsRecord)) {\n const normalizedKey = key.trim();\n if (normalizedKey.length === 0) {\n throw new PmCliError(\n `Template \"${templateName}\" contains an empty option key.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (typeof value === \"string\") {\n normalized[normalizedKey] = value;\n continue;\n }\n if (\n Array.isArray(value) &&\n value.every((entry) => typeof entry === \"string\")\n ) {\n normalized[normalizedKey] = [...value];\n continue;\n }\n throw new PmCliError(\n `Template \"${templateName}\" contains invalid value for option \"${normalizedKey}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return sortTemplateOptions(normalized);\n}\n\nfunction parseStoredTemplateDocument(\n raw: string,\n normalizedName: string,\n): StoredCreateTemplateDocument {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new PmCliError(\n `Template \"${normalizedName}\" contains invalid JSON.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw new PmCliError(\n `Template \"${normalizedName}\" has invalid document shape.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const record = parsed as Record<string, unknown>;\n const options = parseStoredTemplateOptions(record.options, normalizedName);\n const now = nowIso();\n return {\n name:\n typeof record.name === \"string\" && record.name.trim().length > 0\n ? record.name.trim()\n : normalizedName,\n created_at: typeof record.created_at === \"string\" ? record.created_at : now,\n updated_at: typeof record.updated_at === \"string\" ? record.updated_at : now,\n options,\n };\n}\n\nfunction builtinTemplateDocument(\n normalizedName: string,\n): StoredCreateTemplateDocument | null {\n const options = BUILTIN_TEMPLATES[normalizedName];\n if (!options) {\n return null;\n }\n return {\n name: normalizedName,\n created_at: BUILTIN_TEMPLATE_TIMESTAMP,\n updated_at: BUILTIN_TEMPLATE_TIMESTAMP,\n options: sortTemplateOptions({ ...options }),\n };\n}\n\ninterface ResolvedTemplateDocument {\n document: StoredCreateTemplateDocument;\n source: TemplateSource;\n}\n\nasync function resolveTemplateDocument(\n pmRoot: string,\n normalizedName: string,\n): Promise<ResolvedTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw !== null) {\n return {\n document: parseStoredTemplateDocument(raw, normalizedName),\n source: \"user\",\n };\n }\n const builtin = builtinTemplateDocument(normalizedName);\n if (builtin) {\n return { document: builtin, source: \"builtin\" };\n }\n throw new PmCliError(\n `Template \"${normalizedName}\" not found`,\n EXIT_CODE.NOT_FOUND,\n );\n}\n\nasync function readStoredTemplateDocument(\n pmRoot: string,\n normalizedName: string,\n): Promise<StoredCreateTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw === null) {\n throw new PmCliError(\n `Template \"${normalizedName}\" not found`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n return parseStoredTemplateDocument(raw, normalizedName);\n}\n\n/** Implements load create template options for the public runtime surface of this module. */\nexport async function loadCreateTemplateOptions(\n pmRoot: string,\n rawTemplateName: string,\n): Promise<CreateTemplateOptions> {\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document } = await resolveTemplateDocument(pmRoot, normalizedName);\n return document.options;\n}\n\n/** Implements run templates save for the public runtime surface of this module. */\nexport async function runTemplatesSave(\n rawTemplateName: string,\n options: Record<string, unknown>,\n global: GlobalOptions,\n): Promise<TemplatesSaveResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const nextOptions = extractTemplateOptions(options);\n if (Object.keys(nextOptions).length === 0) {\n throw new PmCliError(\n \"templates save requires at least one create option flag\",\n EXIT_CODE.USAGE,\n );\n }\n\n const now = nowIso();\n const storedPath = templatePath(pmRoot, normalizedName);\n let createdAt = now;\n if (await pathExists(storedPath)) {\n const existing = await readStoredTemplateDocument(pmRoot, normalizedName);\n createdAt = existing.created_at;\n }\n\n const document: StoredCreateTemplateDocument = {\n name: normalizedName,\n created_at: createdAt,\n updated_at: now,\n options: nextOptions,\n };\n await fs.mkdir(templatesDirectory(pmRoot), { recursive: true });\n await writeFileAtomic(storedPath, `${JSON.stringify(document, null, 2)}\\n`);\n return {\n name: document.name,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: storedPath,\n options: document.options,\n };\n}\n\nasync function readUserTemplateNames(pmRoot: string): Promise<string[]> {\n const dirPath = templatesDirectory(pmRoot);\n if (!(await pathExists(dirPath))) {\n return [];\n }\n const entries = await fs.readdir(dirPath);\n return entries\n .filter((entry) => entry.toLowerCase().endsWith(TEMPLATE_FILE_EXTENSION))\n .map((entry) => entry.slice(0, -TEMPLATE_FILE_EXTENSION.length))\n .filter((entry) => TEMPLATE_NAME_PATTERN.test(entry));\n}\n\n/** Implements run templates list for the public runtime surface of this module. */\nexport async function runTemplatesList(\n global: GlobalOptions,\n): Promise<TemplatesListResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const userTemplates = await readUserTemplateNames(pmRoot);\n const userTemplateSet = new Set<string>(userTemplates);\n const builtinTemplates = Object.keys(BUILTIN_TEMPLATES).filter(\n (name) => !userTemplateSet.has(name),\n );\n const sortedUser = [...userTemplates].sort((left, right) =>\n left.localeCompare(right),\n );\n const sortedBuiltin = [...builtinTemplates].sort((left, right) =>\n left.localeCompare(right),\n );\n const templates = [...new Set([...sortedUser, ...sortedBuiltin])].sort(\n (left, right) => left.localeCompare(right),\n );\n return {\n templates,\n count: templates.length,\n builtin_templates: sortedBuiltin,\n user_templates: sortedUser,\n };\n}\n\n/** Implements run templates show for the public runtime surface of this module. */\nexport async function runTemplatesShow(\n rawTemplateName: string,\n global: GlobalOptions,\n): Promise<TemplatesShowResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document, source } = await resolveTemplateDocument(\n pmRoot,\n normalizedName,\n );\n return {\n name: document.name,\n source,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path:\n source === \"builtin\"\n ? `builtin:${normalizedName}`\n : templatePath(pmRoot, normalizedName),\n options: document.options,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,OAAOA,WAAU;;;;;;;;;;ACsEX,SAAU,2BACd,SAAiC;AAEjC,SAAO;IACL,OAAO,QAAQ,MAAM;IACrB,UAAU,QAAQ,SAAS;IAC3B,QAAQ,QAAQ,OAAO;IACvB,WAAW,QAAQ,UAAU;IAC7B,QAAQ,QAAQ,OAAO;IACvB,WAAW,QAAQ,UAAU;IAC7B,UAAU,QAAQ,SAAS;;AAE/B;AAWM,SAAU,uBACd,SAAiC;AAEjC,SAAO;IACL,MAAM,QAAQ;IACd,OAAO,QAAQ;IACf,SAAS,QAAQ;IACjB,aAAa,2BAA2B,OAAO;IAC/C,OAAO,QAAQ,MAAM,IAAI,CAAC,SACxB,kBACE,MAAM,sBAAsB,IAAI,EAAE,MAClC,MAAM,OAAO,KAAK,QAAQ,EAAE,CAAC,CAC9B;IAEH,UAAU,QAAQ,SAAS,IAAI,CAAC,WAC9B,kBACE,MAAM,wBAAwB,MAAM,EAAE,IACtC,MAAM,OAAO,OAAO,MAAM,EAAE,CAAC,CAC9B;IAEH,QAAQ,QAAQ,OAAO,IAAI,C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AK,IAAI,GAAG;AACjD,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,KAAK,sBAAsB;EACnC,OAAO;AACL,eAAW,CAAC,OAAO,SAAS,KAAK;MAC/B,CAAC,SAAS,OAAO,KAAK;MACtB,CAAC,YAAY,OAAO,QAAQ;MAC5B,CAAC,UAAU,OAAO,MAAM;MACxB,CAAC,aAAa,OAAO,SAAS;MAC9B,CAAC,UAAU,OAAO,MAAM;MACxB,CAAC,aAAa,OAAO,SAAS;OACpB;AACV,YAAM,OAAO,oBAAoB,OAAO,SAAS;AACjD,UAAI,SAAS,QAAW;AACtB,cAAM,KAAK,IAAI;MACjB;IACF;EACF;AACA,QAAM,cAAc,OAAO,SAAS,OAClC,CAAC,QAAQ,IAAI,WAAW,aAAa;AAEvC,MAAI,YAAY,SAAS,GAAG;AAC1B,UAAM,KACJ,2BAA2B,YAAY,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE;EAE9E;AACA,aAAW,WAAW,OAAO,UAAU;AACrC,UAAM,KAAK,cAAc,OAAO,EAAE;EACpC;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;A",
6
+ "names": ["path", "global", "path", "global", "plan"]
7
+ }
@@ -1,15 +1,15 @@
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]="597a0cab-8450-538c-9b77-3f15c9f3987c")}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]="6b9c4bf0-3077-54b4-84ae-edb129b03182")}catch(e){}}();
3
+ import {
4
+ createQueryFingerprint,
5
+ encodeQueryCursor,
6
+ resolveQueryCursorStart
7
+ } from "./chunk-HDH3JUGG.js";
3
8
  import {
4
9
  hasMissingMetadataFilter,
5
10
  itemMatchesMissingMetadata,
6
11
  lifecycleClassifierFromStatusRegistry
7
- } from "./chunk-Q7E6OYZK.js";
8
- import {
9
- parseIntegerLimit,
10
- parsePriority,
11
- parseType
12
- } from "./chunk-2GA3NK35.js";
12
+ } from "./chunk-2VPAVL7O.js";
13
13
  import {
14
14
  HEAVY_METADATA_KEYS,
15
15
  coerceRuntimeFieldValue,
@@ -25,10 +25,9 @@ import {
25
25
  readRuntimeFieldOptionValue,
26
26
  readSettings,
27
27
  resolveIsoOrRelative,
28
- stableStringify,
29
28
  stableValueEquals,
30
29
  toItemRecord
31
- } from "./chunk-GSEADLRH.js";
30
+ } from "./chunk-Q7A43DS4.js";
32
31
  import {
33
32
  EXIT_CODE,
34
33
  ITEM_METADATA_KEY_ORDER,
@@ -39,100 +38,9 @@ import {
39
38
  resolveItemTypeRegistry,
40
39
  resolvePmRoot,
41
40
  resolveRuntimeFieldRegistry,
42
- resolveRuntimeStatusRegistry
43
- } from "./chunk-GXXC7QSK.js";
44
-
45
- // dist/sdk/pagination.js
46
- import { createHash } from "node:crypto";
47
- var QUERY_CURSOR_VERSION = 1;
48
- var MAX_CURSOR_LENGTH = 4096;
49
- var BASE64URL_PATTERN = /^[A-Za-z0-9_-]+$/;
50
- function createQueryFingerprint(command, contract) {
51
- return createHash("sha256").update(command).update("\0").update(stableStringify(contract)).digest("hex").slice(0, 24);
52
- }
53
- function encodeQueryCursor(fingerprint, afterId, afterIndex) {
54
- return Buffer.from(JSON.stringify({
55
- version: QUERY_CURSOR_VERSION,
56
- fingerprint,
57
- after_id: afterId,
58
- ...afterIndex === void 0 ? {} : { after_index: afterIndex }
59
- })).toString("base64url");
60
- }
61
- function invalidCursor(message) {
62
- return new PmCliError(message, EXIT_CODE.USAGE, {
63
- code: "invalid_query_cursor",
64
- nextSteps: [
65
- "Repeat the original query without --after to obtain a fresh cursor."
66
- ]
67
- });
68
- }
69
- function isQueryCursorEnvelope(value) {
70
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
71
- return false;
72
- }
73
- const envelope = value;
74
- return envelope.version === QUERY_CURSOR_VERSION && typeof envelope.fingerprint === "string" && typeof envelope.after_id === "string" && envelope.after_id.length > 0 && (envelope.after_index === void 0 || Number.isSafeInteger(envelope.after_index) && envelope.after_index >= 0);
75
- }
76
- function decodeQueryCursorState(cursor, expectedFingerprint) {
77
- if (typeof cursor !== "string") {
78
- throw invalidCursor("Query cursor is malformed.");
79
- }
80
- const normalized = cursor.trim();
81
- if (normalized.length === 0 || normalized.length > MAX_CURSOR_LENGTH || !BASE64URL_PATTERN.test(normalized)) {
82
- throw invalidCursor("Query cursor is malformed.");
83
- }
84
- let parsed;
85
- try {
86
- parsed = JSON.parse(Buffer.from(normalized, "base64url").toString("utf8"));
87
- } catch {
88
- throw invalidCursor("Query cursor is malformed.");
89
- }
90
- if (!isQueryCursorEnvelope(parsed)) {
91
- throw invalidCursor("Query cursor version or payload is unsupported.");
92
- }
93
- const envelope = parsed;
94
- if (envelope.fingerprint !== expectedFingerprint) {
95
- throw invalidCursor(`Query cursor does not match the current filters, sort, or query (${envelope.fingerprint} != ${expectedFingerprint}).`);
96
- }
97
- return {
98
- after_id: envelope.after_id,
99
- ...envelope.after_index === void 0 ? {} : { after_index: envelope.after_index }
100
- };
101
- }
102
- function decodeQueryCursor(cursor, expectedFingerprint) {
103
- return decodeQueryCursorState(cursor, expectedFingerprint).after_id;
104
- }
105
- function resolveQueryCursorStart(rows, cursor, fingerprint, readId) {
106
- if (cursor === void 0) {
107
- return 0;
108
- }
109
- const state = decodeQueryCursorState(cursor, fingerprint);
110
- const index = rows.findIndex((row) => readId(row) === state.after_id);
111
- if (index < 0) {
112
- if (state.after_index !== void 0) {
113
- return Math.min(state.after_index, rows.length);
114
- }
115
- throw invalidCursor(`Query cursor item ${state.after_id} is no longer present in this result set.`);
116
- }
117
- return index + 1;
118
- }
119
- function paginateQueryRows(rows, options) {
120
- const pageStart = resolveQueryCursorStart(rows, options.cursor, options.fingerprint, options.readId);
121
- const pageRows = rows.slice(pageStart, pageStart + options.limit);
122
- const hasMore = pageRows.length > 0 && pageStart + pageRows.length < rows.length;
123
- const lastRow = pageRows.at(-1);
124
- return {
125
- rows: pageRows,
126
- has_more: hasMore,
127
- ...hasMore && lastRow !== void 0 ? {
128
- next_cursor: encodeQueryCursor(options.fingerprint, options.readId(lastRow), pageStart + pageRows.length - 1)
129
- } : {}
130
- };
131
- }
132
- var QUERY_CURSOR_CONTRACT = Object.freeze({
133
- version: QUERY_CURSOR_VERSION,
134
- max_length: MAX_CURSOR_LENGTH
135
- });
41
+ resolveRuntimeStatusRegistry,
42
+ resolveTypeName
43
+ } from "./chunk-QKECXBBG.js";
136
44
 
137
45
  // dist/core/item/status-filter.js
138
46
  var STATUS_GROUP_ALIASES = {
@@ -216,6 +124,35 @@ function parseStatusFilterCsv(raw, registry, options) {
216
124
  return [...new Set(resolved)];
217
125
  }
218
126
 
127
+ // dist/cli/shared-parsers.js
128
+ function parseIntegerLimit(raw, label = "--limit") {
129
+ if (raw === void 0)
130
+ return void 0;
131
+ const parsed = Number(raw);
132
+ if (!Number.isInteger(parsed) || parsed < 0) {
133
+ throw new PmCliError(`${label} must be a non-negative integer`, EXIT_CODE.USAGE);
134
+ }
135
+ return parsed;
136
+ }
137
+ function parsePriority(raw, label = "--priority") {
138
+ if (raw === void 0)
139
+ return void 0;
140
+ const parsed = Number(raw);
141
+ if (!Number.isInteger(parsed) || parsed < 0 || parsed > 4) {
142
+ throw new PmCliError(`${label} filter must be 0..4`, EXIT_CODE.USAGE);
143
+ }
144
+ return parsed;
145
+ }
146
+ function parseType(raw, typeRegistry, label = "--type") {
147
+ if (raw === void 0)
148
+ return void 0;
149
+ const parsed = resolveTypeName(raw, typeRegistry);
150
+ if (!parsed) {
151
+ throw new PmCliError(`${label} filter must be one of ${typeRegistry.types.join("|")}`, EXIT_CODE.USAGE);
152
+ }
153
+ return parsed;
154
+ }
155
+
219
156
  // dist/core/schema/runtime-field-filters.js
220
157
  function valuesEqual(left, right) {
221
158
  return stableValueEquals(left, right);
@@ -1307,19 +1244,15 @@ async function runList(status, options, global) {
1307
1244
  }
1308
1245
 
1309
1246
  export {
1247
+ parseIntegerLimit,
1248
+ parsePriority,
1249
+ parseType,
1310
1250
  parseStatusFilterCsv,
1311
1251
  collectRuntimeFilterValues,
1312
1252
  matchesRuntimeFilters,
1313
1253
  hasContentFieldFilter,
1314
1254
  itemMatchesContentFilters,
1315
1255
  computeContentFieldUtilization,
1316
- createQueryFingerprint,
1317
- encodeQueryCursor,
1318
- decodeQueryCursorState,
1319
- decodeQueryCursor,
1320
- resolveQueryCursorStart,
1321
- paginateQueryRows,
1322
- QUERY_CURSOR_CONTRACT,
1323
1256
  resolveMissingMetadataFilters,
1324
1257
  resolveContentFieldFilters,
1325
1258
  applyFilterValueEcho,
@@ -1327,6 +1260,6 @@ export {
1327
1260
  buildGovernanceMissingFilterEcho,
1328
1261
  runList
1329
1262
  };
1330
- //# sourceMappingURL=chunk-6TTOHMTB.js.map
1263
+ //# sourceMappingURL=chunk-UXONS674.js.map
1331
1264
 
1332
- //# debugId=597a0cab-8450-538c-9b77-3f15c9f3987c
1265
+ //# debugId=6b9c4bf0-3077-54b4-84ae-edb129b03182