@unbrained/pm-cli 2026.7.11 → 2026.7.12

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 (436) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +36 -2
  3. package/README.md +0 -33
  4. package/dist/cli/commands/claim.d.ts +32 -1
  5. package/dist/cli/commands/claim.js +52 -15
  6. package/dist/cli/commands/claim.js.map +1 -1
  7. package/dist/cli/commands/completion.js +11 -2
  8. package/dist/cli/commands/completion.js.map +1 -1
  9. package/dist/cli/commands/create.js +4 -65
  10. package/dist/cli/commands/create.js.map +1 -1
  11. package/dist/cli/commands/index.d.ts +1 -1
  12. package/dist/cli/commands/index.js +3 -3
  13. package/dist/cli/commands/index.js.map +1 -1
  14. package/dist/cli/commands/init.js +18 -2
  15. package/dist/cli/commands/init.js.map +1 -1
  16. package/dist/cli/commands/legacy-none-tokens.d.ts +49 -1
  17. package/dist/cli/commands/legacy-none-tokens.js +73 -2
  18. package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
  19. package/dist/cli/commands/next.d.ts +14 -2
  20. package/dist/cli/commands/next.js +39 -11
  21. package/dist/cli/commands/next.js.map +1 -1
  22. package/dist/cli/commands/plan.d.ts +5 -0
  23. package/dist/cli/commands/plan.js +44 -2
  24. package/dist/cli/commands/plan.js.map +1 -1
  25. package/dist/cli/commands/update.js +7 -67
  26. package/dist/cli/commands/update.js.map +1 -1
  27. package/dist/cli/extension-command-help.d.ts +13 -1
  28. package/dist/cli/extension-command-help.js +79 -5
  29. package/dist/cli/extension-command-help.js.map +1 -1
  30. package/dist/cli/main.js +9 -6
  31. package/dist/cli/main.js.map +1 -1
  32. package/dist/cli/register-list-query.js +3 -2
  33. package/dist/cli/register-list-query.js.map +1 -1
  34. package/dist/cli/register-mutation.js +3 -2
  35. package/dist/cli/register-mutation.js.map +1 -1
  36. package/dist/cli/register-operations.js +24 -3
  37. package/dist/cli/register-operations.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-RH3G5RAV.js +11 -0
  39. package/dist/cli-bundle/chunks/{append-464PHZ65.js → append-T5DTS4NU.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js → chunk-2XWRFOPR.js} +3 -3
  41. package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js → chunk-2Z36LSAT.js} +6 -6
  42. package/dist/cli-bundle/chunks/{chunk-WQ5227PH.js → chunk-33O5P6KT.js} +135 -41
  43. package/dist/cli-bundle/chunks/chunk-33O5P6KT.js.map +7 -0
  44. package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js → chunk-3KJ3FG5O.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js → chunk-3M5BWYUA.js} +3 -3
  46. package/dist/cli-bundle/chunks/{chunk-GPBKJERW.js → chunk-3WASQS5G.js} +42 -6
  47. package/dist/cli-bundle/chunks/chunk-3WASQS5G.js.map +1 -0
  48. package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js → chunk-47TKJR3D.js} +4 -4
  49. package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js → chunk-4MO4PPR2.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js → chunk-546WPG33.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js → chunk-5754C5XS.js} +3 -3
  52. package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js → chunk-5V746BN3.js} +2 -2
  53. package/dist/cli-bundle/chunks/{chunk-7324AI5M.js → chunk-66YL6RR5.js} +30 -20
  54. package/dist/cli-bundle/chunks/{chunk-7324AI5M.js.map → chunk-66YL6RR5.js.map} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js → chunk-6OK5QSGH.js} +4 -4
  56. package/dist/cli-bundle/chunks/{chunk-ROH64TST.js → chunk-6XNMSLBT.js} +78 -72
  57. package/dist/cli-bundle/chunks/chunk-6XNMSLBT.js.map +1 -0
  58. package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js → chunk-7SHFQB2A.js} +4 -4
  59. package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js → chunk-7SIWW7C3.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js → chunk-7TYZTBEV.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js → chunk-A2HZUSEA.js} +8 -6
  62. package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js.map → chunk-A2HZUSEA.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js → chunk-A6AK7W5M.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js → chunk-A6AVSYRJ.js} +5 -5
  65. package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js → chunk-ACDIA6NP.js} +5 -5
  66. package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js → chunk-ACRC3HI4.js} +2 -2
  67. package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js → chunk-AHIEDSW2.js} +30 -20
  68. package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js.map → chunk-AHIEDSW2.js.map} +1 -1
  69. package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js → chunk-ANLHBXAE.js} +5 -5
  70. package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js → chunk-AS62PEJE.js} +4 -4
  71. package/dist/cli-bundle/chunks/{chunk-OJ64VYGO.js → chunk-BAK2VLTQ.js} +62 -33
  72. package/dist/cli-bundle/chunks/chunk-BAK2VLTQ.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js → chunk-BLRO2POO.js} +3 -3
  74. package/dist/cli-bundle/chunks/{chunk-KDNZSVCK.js → chunk-CDR2A3VI.js} +15 -74
  75. package/dist/cli-bundle/chunks/chunk-CDR2A3VI.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js → chunk-DJI5IS46.js} +42 -20
  77. package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js.map → chunk-DJI5IS46.js.map} +1 -1
  78. package/dist/cli-bundle/chunks/{chunk-VOXOXART.js → chunk-DLZ3RXAL.js} +5 -5
  79. package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js → chunk-DNH44IKP.js} +4 -4
  80. package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js → chunk-EBBROE54.js} +9 -9
  81. package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js → chunk-FF523THY.js} +4 -4
  82. package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js → chunk-FIZUJWXQ.js} +3 -3
  83. package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js → chunk-FVWQFTTW.js} +6 -6
  84. package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js → chunk-FVZEIWTL.js} +10 -10
  85. package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js → chunk-G6B5XGNV.js} +97 -32
  86. package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js.map → chunk-G6B5XGNV.js.map} +4 -4
  87. package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js → chunk-GFBV2254.js} +5 -5
  88. package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js → chunk-GRB3TFOC.js} +3 -3
  89. package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js → chunk-GVGFLZQS.js} +4 -4
  90. package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js → chunk-HLZXQKGZ.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js → chunk-HO6CDURZ.js} +2 -2
  92. package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js → chunk-HOE3UV3G.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-XQLLRYOX.js → chunk-HRCJGQXL.js} +134 -40
  94. package/dist/cli-bundle/chunks/chunk-HRCJGQXL.js.map +1 -0
  95. package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js → chunk-IS6M4ETF.js} +4 -4
  96. package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js → chunk-J2XEW4YL.js} +3 -3
  97. package/dist/cli-bundle/chunks/{chunk-GZNB5V5J.js → chunk-J2ZDZG4A.js} +44 -12
  98. package/dist/cli-bundle/chunks/chunk-J2ZDZG4A.js.map +7 -0
  99. package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js → chunk-J7XSQCJO.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js → chunk-JM4Z53DN.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js → chunk-JNNPTGXR.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js → chunk-K7CGOZK5.js} +6 -6
  103. package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js → chunk-KDH62ECD.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-LIY2ILWI.js → chunk-KXFY6AI4.js} +41 -5
  105. package/dist/cli-bundle/chunks/chunk-KXFY6AI4.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js → chunk-L23NAJHL.js} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js → chunk-LEXFDABF.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js → chunk-LNAGQRIL.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js → chunk-LU4Z7POS.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js → chunk-LX265XY7.js} +6 -6
  111. package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js → chunk-MQAGSAMS.js} +4 -4
  112. package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js → chunk-N4NKVLPY.js} +4 -4
  113. package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js → chunk-ND3MDD6L.js} +9 -9
  114. package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js → chunk-NEJKKTCG.js} +2 -2
  115. package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js → chunk-NGL3X3XM.js} +3 -3
  116. package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js → chunk-NK54BSL7.js} +8 -8
  117. package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js → chunk-NN57FRRN.js} +3 -3
  118. package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js → chunk-NNRXTZ7Y.js} +4 -4
  119. package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js → chunk-NOIIRLCO.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-CTAPVM6C.js → chunk-O5ELBOEJ.js} +14 -73
  121. package/dist/cli-bundle/chunks/chunk-O5ELBOEJ.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js → chunk-OC2CLNMS.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js → chunk-OKUFGORG.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js → chunk-OOK6V7BF.js} +3 -3
  125. package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js → chunk-OUQ4I6HC.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-C4FIA5U6.js → chunk-OYCZDDUC.js} +61 -32
  127. package/dist/cli-bundle/chunks/chunk-OYCZDDUC.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js → chunk-PDOJRPYR.js} +7 -7
  129. package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js → chunk-PHQPQNAT.js} +4 -4
  130. package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js → chunk-PTJ7NVUU.js} +4 -4
  131. package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js → chunk-PUMGO764.js} +7 -7
  132. package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js → chunk-QFCCN4JO.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-RAC2UXLT.js → chunk-QPWXNK56.js} +43 -11
  134. package/dist/cli-bundle/chunks/chunk-QPWXNK56.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js → chunk-QYIDXRRX.js} +7 -7
  136. package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js → chunk-RFDT674H.js} +4 -4
  137. package/dist/cli-bundle/chunks/{chunk-2BUNV627.js → chunk-SJ2DADDH.js} +8 -8
  138. package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js → chunk-SV7PEWKW.js} +41 -19
  139. package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js.map → chunk-SV7PEWKW.js.map} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js → chunk-TKD4NESJ.js} +3 -3
  141. package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js → chunk-TMNQV4EK.js} +2 -2
  142. package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js → chunk-TWELUDDF.js} +2 -2
  143. package/dist/cli-bundle/chunks/{chunk-A3AIKEYC.js → chunk-TYCM65DJ.js} +78 -72
  144. package/dist/cli-bundle/chunks/chunk-TYCM65DJ.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js → chunk-U3S22BOJ.js} +4 -4
  146. package/dist/cli-bundle/chunks/{chunk-MORRAQXQ.js → chunk-UAZ6W3H3.js} +91 -33
  147. package/dist/cli-bundle/chunks/chunk-UAZ6W3H3.js.map +1 -0
  148. package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js → chunk-UFY4ETU6.js} +3 -3
  149. package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js → chunk-UGQENMKM.js} +2 -2
  150. package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js → chunk-UGSHP6SR.js} +4 -4
  151. package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js → chunk-VF24O6TV.js} +4 -4
  152. package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js → chunk-VLVTXEGG.js} +4 -4
  153. package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js → chunk-VMGK6ESD.js} +7 -5
  154. package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js.map → chunk-VMGK6ESD.js.map} +2 -2
  155. package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js → chunk-VXUWCJS7.js} +2 -2
  156. package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js → chunk-WBMARQCV.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js → chunk-WZDABROA.js} +5 -5
  158. package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js → chunk-XG5GVZRX.js} +4 -4
  159. package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js → chunk-XGCPTS6L.js} +10 -10
  160. package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js → chunk-Y44B5FBE.js} +3 -3
  161. package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js → chunk-YP6DWEWQ.js} +3 -3
  162. package/dist/cli-bundle/chunks/{chunk-TB6364F7.js → chunk-Z7XTVIN5.js} +5 -5
  163. package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js → chunk-ZEKVLV6P.js} +4 -4
  164. package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js → chunk-ZFPOBSPC.js} +3 -3
  165. package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js → chunk-ZUB725AA.js} +7 -7
  166. package/dist/cli-bundle/chunks/{close-A77IGXNC.js → close-CQHW3WMK.js} +5 -5
  167. package/dist/cli-bundle/chunks/close-ZZW5FLTB.js +12 -0
  168. package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js → close-many-AR2YH3SJ.js} +12 -12
  169. package/dist/cli-bundle/chunks/close-many-IKCEGBLQ.js +21 -0
  170. package/dist/cli-bundle/chunks/comments-NV4SIY5Z.js +13 -0
  171. package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js → comments-UV4HMI2K.js} +7 -7
  172. package/dist/cli-bundle/chunks/{copy-U6H22S7E.js → copy-OUFWOHVG.js} +4 -4
  173. package/dist/cli-bundle/chunks/copy-X7HJFWIH.js +9 -0
  174. package/dist/cli-bundle/chunks/{create-HS64DHTL.js → create-QEDL4KKT.js} +9 -9
  175. package/dist/cli-bundle/chunks/create-R6MMMMJS.js +25 -0
  176. package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js → delete-MJGZFDHZ.js} +4 -4
  177. package/dist/cli-bundle/chunks/delete-OOJRG4HF.js +10 -0
  178. package/dist/cli-bundle/chunks/{deps-TMOF765V.js → deps-4OP6Q76N.js} +4 -4
  179. package/dist/cli-bundle/chunks/{deps-R44LVZTU.js → deps-Y5X6NFT5.js} +4 -4
  180. package/dist/cli-bundle/chunks/docs-SILTBWSO.js +14 -0
  181. package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js → docs-UKTQVUHS.js} +6 -6
  182. package/dist/cli-bundle/chunks/{files-RNFWG435.js → files-2QEI2V3C.js} +6 -6
  183. package/dist/cli-bundle/chunks/{files-NX4LNOPL.js → files-7OIKZPI3.js} +6 -6
  184. package/dist/cli-bundle/chunks/focus-3YC5LFCG.js +10 -0
  185. package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js → focus-FFWH32BF.js} +5 -5
  186. package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js → history-compact-AAA4W6LY.js} +8 -8
  187. package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js → history-compact-PIURAPW5.js} +8 -8
  188. package/dist/cli-bundle/chunks/history-redact-KWZ7LKQB.js +16 -0
  189. package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js → history-redact-NTO74EIV.js} +6 -6
  190. package/dist/cli-bundle/chunks/history-repair-QWZJYYOJ.js +18 -0
  191. package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js → history-repair-ROV5TD3L.js} +8 -8
  192. package/dist/cli-bundle/chunks/learnings-25TJCVON.js +13 -0
  193. package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js → learnings-3WJFJT7E.js} +7 -7
  194. package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js → notes-FM53JJ5C.js} +7 -7
  195. package/dist/cli-bundle/chunks/notes-IAHGNCYQ.js +13 -0
  196. package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js → plan-EJ4USP2S.js} +10 -10
  197. package/dist/cli-bundle/chunks/plan-WHV4H2RW.js +24 -0
  198. package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js → profile-SZQVKHUQ.js} +9 -9
  199. package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js → profile-TXE673DR.js} +9 -9
  200. package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js → register-list-query-LSR2G2SJ.js} +16 -16
  201. package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js.map → register-list-query-LSR2G2SJ.js.map} +1 -1
  202. package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js → register-list-query-S6I73L5W.js} +15 -15
  203. package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js.map → register-list-query-S6I73L5W.js.map} +2 -2
  204. package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js → register-mutation-77GYER52.js} +32 -32
  205. package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js.map → register-mutation-77GYER52.js.map} +1 -1
  206. package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js → register-mutation-A2SC3K5G.js} +31 -31
  207. package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js.map → register-mutation-A2SC3K5G.js.map} +2 -2
  208. package/dist/cli-bundle/chunks/{register-operations-3TYKCKEZ.js → register-operations-KSAIBSZH.js} +43 -33
  209. package/dist/cli-bundle/chunks/register-operations-KSAIBSZH.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{register-operations-WKZSX4QP.js → register-operations-W6Z5LVI5.js} +42 -32
  211. package/dist/cli-bundle/chunks/register-operations-W6Z5LVI5.js.map +7 -0
  212. package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js → register-setup-KB5U3RES.js} +15 -15
  213. package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js → register-setup-ZG7YXPHJ.js} +15 -15
  214. package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js → restore-F5HPTRBR.js} +6 -6
  215. package/dist/cli-bundle/chunks/restore-LN57EB5H.js +14 -0
  216. package/dist/cli-bundle/chunks/{schema-AJCAANMB.js → schema-3DKXA4KR.js} +6 -6
  217. package/dist/cli-bundle/chunks/{schema-2B37DMM2.js → schema-QLTOK23S.js} +6 -6
  218. package/dist/cli-bundle/chunks/update-2T5EWMXD.js +21 -0
  219. package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js → update-IKMNH3W4.js} +12 -12
  220. package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js → update-many-3Q6Z2Q4Y.js} +19 -19
  221. package/dist/cli-bundle/chunks/update-many-OTAS4BWH.js +30 -0
  222. package/dist/cli-bundle/main.js +75 -20
  223. package/dist/cli-bundle/main.js.map +2 -2
  224. package/dist/cli-bundle/sdk-runtime.js +63 -52
  225. package/dist/cli-bundle/sdk-testing.js +6 -6
  226. package/dist/cli-bundle/sdk.js +63 -54
  227. package/dist/cli-bundle/sdk.js.map +2 -2
  228. package/dist/core/extensions/item-fields.js +3 -3
  229. package/dist/core/extensions/item-fields.js.map +1 -1
  230. package/dist/core/extensions/loader.js +29 -20
  231. package/dist/core/extensions/loader.js.map +1 -1
  232. package/dist/core/schema/fields-file.js +5 -3
  233. package/dist/core/schema/fields-file.js.map +1 -1
  234. package/dist/sdk/cli-contracts/flag-contracts.js +12 -2
  235. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  236. package/dist/sdk/cli-contracts/tool-parameter-tables.js +14 -2
  237. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  238. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  239. package/dist/sdk/cli-contracts/tool-schema.js +18 -6
  240. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  241. package/dist/sdk/index.d.ts +3 -1
  242. package/dist/sdk/index.js +4 -3
  243. package/dist/sdk/index.js.map +1 -1
  244. package/dist/sdk/runtime.d.ts +51 -1
  245. package/dist/sdk/runtime.js +91 -4
  246. package/dist/sdk/runtime.js.map +1 -1
  247. package/dist/sdk/workspace.d.ts +15 -0
  248. package/dist/sdk/workspace.js +50 -0
  249. package/dist/sdk/workspace.js.map +1 -0
  250. package/docs/AGENT_GUIDE.md +1 -0
  251. package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +775 -0
  252. package/docs/CODEX_PLUGIN.md +11 -1
  253. package/docs/COMMANDS.md +3 -1
  254. package/docs/README.md +3 -0
  255. package/docs/SDK.md +204 -71
  256. package/marketplace.json +2 -2
  257. package/package.json +3 -2
  258. package/packages/pm-beads/extensions/beads/runtime-loader.ts +3 -0
  259. package/packages/pm-beads/package.json +1 -1
  260. package/packages/pm-calendar/package.json +1 -1
  261. package/packages/pm-command-kit/package.json +1 -1
  262. package/packages/pm-governance-audit/package.json +1 -1
  263. package/packages/pm-guide-shell/package.json +1 -1
  264. package/packages/pm-kanban/package.json +1 -1
  265. package/packages/pm-lifecycle-hooks/package.json +1 -1
  266. package/packages/pm-linked-test-adapters/package.json +1 -1
  267. package/packages/pm-search-advanced/package.json +1 -1
  268. package/packages/pm-templates/package.json +1 -1
  269. package/packages/pm-todos/extensions/todos/runtime-loader.ts +3 -0
  270. package/packages/pm-todos/package.json +1 -1
  271. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  272. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  273. package/dist/cli-bundle/chunks/append-425YGJMY.js +0 -11
  274. package/dist/cli-bundle/chunks/chunk-A3AIKEYC.js.map +0 -7
  275. package/dist/cli-bundle/chunks/chunk-C4FIA5U6.js.map +0 -7
  276. package/dist/cli-bundle/chunks/chunk-CTAPVM6C.js.map +0 -7
  277. package/dist/cli-bundle/chunks/chunk-GPBKJERW.js.map +0 -1
  278. package/dist/cli-bundle/chunks/chunk-GZNB5V5J.js.map +0 -7
  279. package/dist/cli-bundle/chunks/chunk-KDNZSVCK.js.map +0 -1
  280. package/dist/cli-bundle/chunks/chunk-LIY2ILWI.js.map +0 -7
  281. package/dist/cli-bundle/chunks/chunk-MORRAQXQ.js.map +0 -1
  282. package/dist/cli-bundle/chunks/chunk-OJ64VYGO.js.map +0 -1
  283. package/dist/cli-bundle/chunks/chunk-RAC2UXLT.js.map +0 -1
  284. package/dist/cli-bundle/chunks/chunk-ROH64TST.js.map +0 -1
  285. package/dist/cli-bundle/chunks/chunk-WQ5227PH.js.map +0 -7
  286. package/dist/cli-bundle/chunks/chunk-XQLLRYOX.js.map +0 -1
  287. package/dist/cli-bundle/chunks/close-II7JKV32.js +0 -12
  288. package/dist/cli-bundle/chunks/close-many-FD46X4WK.js +0 -21
  289. package/dist/cli-bundle/chunks/comments-OAU2E7RK.js +0 -13
  290. package/dist/cli-bundle/chunks/copy-5MOERABQ.js +0 -9
  291. package/dist/cli-bundle/chunks/create-DOMKSBHN.js +0 -25
  292. package/dist/cli-bundle/chunks/delete-BMOQWZRQ.js +0 -10
  293. package/dist/cli-bundle/chunks/docs-J4OI4PWM.js +0 -14
  294. package/dist/cli-bundle/chunks/focus-7H5B4PKZ.js +0 -10
  295. package/dist/cli-bundle/chunks/history-redact-ZNS2QTMI.js +0 -16
  296. package/dist/cli-bundle/chunks/history-repair-LQ5IU4ZX.js +0 -18
  297. package/dist/cli-bundle/chunks/learnings-AHMJNIQZ.js +0 -13
  298. package/dist/cli-bundle/chunks/notes-GJI26GJR.js +0 -13
  299. package/dist/cli-bundle/chunks/plan-ZHJH6VMF.js +0 -24
  300. package/dist/cli-bundle/chunks/register-operations-3TYKCKEZ.js.map +0 -1
  301. package/dist/cli-bundle/chunks/register-operations-WKZSX4QP.js.map +0 -7
  302. package/dist/cli-bundle/chunks/restore-AR77QSO6.js +0 -14
  303. package/dist/cli-bundle/chunks/update-D3ZZ2V7Z.js +0 -21
  304. package/dist/cli-bundle/chunks/update-many-2Q2PRSSB.js +0 -30
  305. /package/dist/cli-bundle/chunks/{append-425YGJMY.js.map → append-RH3G5RAV.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{append-464PHZ65.js.map → append-T5DTS4NU.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js.map → chunk-2XWRFOPR.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js.map → chunk-2Z36LSAT.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js.map → chunk-3KJ3FG5O.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js.map → chunk-3M5BWYUA.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js.map → chunk-47TKJR3D.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js.map → chunk-4MO4PPR2.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js.map → chunk-546WPG33.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js.map → chunk-5754C5XS.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js.map → chunk-5V746BN3.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js.map → chunk-6OK5QSGH.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js.map → chunk-7SHFQB2A.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js.map → chunk-7SIWW7C3.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js.map → chunk-7TYZTBEV.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js.map → chunk-A6AK7W5M.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js.map → chunk-A6AVSYRJ.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js.map → chunk-ACDIA6NP.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js.map → chunk-ACRC3HI4.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js.map → chunk-ANLHBXAE.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js.map → chunk-AS62PEJE.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js.map → chunk-BLRO2POO.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-VOXOXART.js.map → chunk-DLZ3RXAL.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js.map → chunk-DNH44IKP.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js.map → chunk-EBBROE54.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js.map → chunk-FF523THY.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js.map → chunk-FIZUJWXQ.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js.map → chunk-FVWQFTTW.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js.map → chunk-FVZEIWTL.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js.map → chunk-GFBV2254.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js.map → chunk-GRB3TFOC.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js.map → chunk-GVGFLZQS.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js.map → chunk-HLZXQKGZ.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js.map → chunk-HO6CDURZ.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js.map → chunk-HOE3UV3G.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js.map → chunk-IS6M4ETF.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js.map → chunk-J2XEW4YL.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js.map → chunk-J7XSQCJO.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js.map → chunk-JM4Z53DN.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js.map → chunk-JNNPTGXR.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js.map → chunk-K7CGOZK5.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js.map → chunk-KDH62ECD.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js.map → chunk-L23NAJHL.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js.map → chunk-LEXFDABF.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js.map → chunk-LNAGQRIL.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js.map → chunk-LU4Z7POS.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js.map → chunk-LX265XY7.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js.map → chunk-MQAGSAMS.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js.map → chunk-N4NKVLPY.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js.map → chunk-ND3MDD6L.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js.map → chunk-NEJKKTCG.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js.map → chunk-NGL3X3XM.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js.map → chunk-NK54BSL7.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js.map → chunk-NN57FRRN.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js.map → chunk-NNRXTZ7Y.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js.map → chunk-NOIIRLCO.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js.map → chunk-OC2CLNMS.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js.map → chunk-OKUFGORG.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js.map → chunk-OOK6V7BF.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js.map → chunk-OUQ4I6HC.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js.map → chunk-PDOJRPYR.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js.map → chunk-PHQPQNAT.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js.map → chunk-PTJ7NVUU.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js.map → chunk-PUMGO764.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js.map → chunk-QFCCN4JO.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js.map → chunk-QYIDXRRX.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js.map → chunk-RFDT674H.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-2BUNV627.js.map → chunk-SJ2DADDH.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js.map → chunk-TKD4NESJ.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js.map → chunk-TMNQV4EK.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js.map → chunk-TWELUDDF.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js.map → chunk-U3S22BOJ.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js.map → chunk-UFY4ETU6.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js.map → chunk-UGQENMKM.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js.map → chunk-UGSHP6SR.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js.map → chunk-VF24O6TV.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js.map → chunk-VLVTXEGG.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js.map → chunk-VXUWCJS7.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js.map → chunk-WBMARQCV.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js.map → chunk-WZDABROA.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js.map → chunk-XG5GVZRX.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js.map → chunk-XGCPTS6L.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js.map → chunk-Y44B5FBE.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js.map → chunk-YP6DWEWQ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-TB6364F7.js.map → chunk-Z7XTVIN5.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js.map → chunk-ZEKVLV6P.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js.map → chunk-ZFPOBSPC.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js.map → chunk-ZUB725AA.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{close-A77IGXNC.js.map → close-CQHW3WMK.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{close-II7JKV32.js.map → close-ZZW5FLTB.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js.map → close-many-AR2YH3SJ.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{close-many-FD46X4WK.js.map → close-many-IKCEGBLQ.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{comments-OAU2E7RK.js.map → comments-NV4SIY5Z.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js.map → comments-UV4HMI2K.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{copy-U6H22S7E.js.map → copy-OUFWOHVG.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{copy-5MOERABQ.js.map → copy-X7HJFWIH.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{create-HS64DHTL.js.map → create-QEDL4KKT.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{create-DOMKSBHN.js.map → create-R6MMMMJS.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js.map → delete-MJGZFDHZ.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{delete-BMOQWZRQ.js.map → delete-OOJRG4HF.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{deps-TMOF765V.js.map → deps-4OP6Q76N.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{deps-R44LVZTU.js.map → deps-Y5X6NFT5.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{docs-J4OI4PWM.js.map → docs-SILTBWSO.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js.map → docs-UKTQVUHS.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{files-RNFWG435.js.map → files-2QEI2V3C.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{files-NX4LNOPL.js.map → files-7OIKZPI3.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{focus-7H5B4PKZ.js.map → focus-3YC5LFCG.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js.map → focus-FFWH32BF.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js.map → history-compact-AAA4W6LY.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js.map → history-compact-PIURAPW5.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{history-redact-ZNS2QTMI.js.map → history-redact-KWZ7LKQB.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js.map → history-redact-NTO74EIV.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{history-repair-LQ5IU4ZX.js.map → history-repair-QWZJYYOJ.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js.map → history-repair-ROV5TD3L.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{learnings-AHMJNIQZ.js.map → learnings-25TJCVON.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js.map → learnings-3WJFJT7E.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js.map → notes-FM53JJ5C.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{notes-GJI26GJR.js.map → notes-IAHGNCYQ.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js.map → plan-EJ4USP2S.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{plan-ZHJH6VMF.js.map → plan-WHV4H2RW.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js.map → profile-SZQVKHUQ.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js.map → profile-TXE673DR.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js.map → register-setup-KB5U3RES.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js.map → register-setup-ZG7YXPHJ.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js.map → restore-F5HPTRBR.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{restore-AR77QSO6.js.map → restore-LN57EB5H.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{schema-AJCAANMB.js.map → schema-3DKXA4KR.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{schema-2B37DMM2.js.map → schema-QLTOK23S.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{update-D3ZZ2V7Z.js.map → update-2T5EWMXD.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js.map → update-IKMNH3W4.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js.map → update-many-3Q6Z2Q4Y.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{update-many-2Q2PRSSB.js.map → update-many-OTAS4BWH.js.map} +0 -0
@@ -2,11 +2,11 @@
2
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]="0293afd9-6db0-5680-83bc-e16c04838b33")}catch(e){}}();
3
3
  import {
4
4
  lintProjectProfile
5
- } from "./chunk-6APTSPP5.js";
5
+ } from "./chunk-7SIWW7C3.js";
6
6
  import {
7
7
  describeExtensionActivation,
8
8
  renderExtensionSurfaceMarkdown
9
- } from "./chunk-RA2LPP6E.js";
9
+ } from "./chunk-JM4Z53DN.js";
10
10
  import {
11
11
  getMigrationRuntimeDefinition,
12
12
  resolveRegisteredSearchProvider,
@@ -36,7 +36,7 @@ import {
36
36
  runPreflightOverride,
37
37
  runRendererOverride,
38
38
  runServiceOverride
39
- } from "./chunk-QCKPSFII.js";
39
+ } from "./chunk-AHIEDSW2.js";
40
40
 
41
41
  // dist/sdk/compose.js
42
42
  function defineExtension(module) {
@@ -1454,6 +1454,6 @@ export {
1454
1454
  assertExtensionPreflight,
1455
1455
  createExtensionTestHarness
1456
1456
  };
1457
- //# sourceMappingURL=chunk-2HNZKLHV.js.map
1457
+ //# sourceMappingURL=chunk-7SHFQB2A.js.map
1458
1458
 
1459
1459
  //# debugId=0293afd9-6db0-5680-83bc-e16c04838b33
@@ -11,15 +11,15 @@ import {
11
11
  TYPE_PRESET_DEFINITIONS,
12
12
  normalizeAddFieldInput,
13
13
  normalizeAddStatusInput
14
- } from "./chunk-VTOQH22Y.js";
14
+ } from "./chunk-A2HZUSEA.js";
15
15
  import {
16
16
  normalizeAddTypeInput
17
- } from "./chunk-EEUIIDWF.js";
17
+ } from "./chunk-UGQENMKM.js";
18
18
  import {
19
19
  BUILTIN_ITEM_TYPE_VALUES,
20
20
  DEFAULT_RUNTIME_STATUS_DEFINITIONS,
21
21
  toErrorMessage
22
- } from "./chunk-QCKPSFII.js";
22
+ } from "./chunk-AHIEDSW2.js";
23
23
 
24
24
  // dist/core/profile/profile-presets.js
25
25
  var PROFILE_NAMES = ["agile", "ops", "research"];
@@ -668,6 +668,6 @@ export {
668
668
  PROFILE_LINT_CODES,
669
669
  lintProjectProfile
670
670
  };
671
- //# sourceMappingURL=chunk-6APTSPP5.js.map
671
+ //# sourceMappingURL=chunk-7SIWW7C3.js.map
672
672
 
673
673
  //# debugId=7d0a5087-e290-5a6c-9641-82badd28de0c
@@ -4,7 +4,7 @@ import {
4
4
  nowIso,
5
5
  readSettings,
6
6
  writeSettings
7
- } from "./chunk-NAGOH4YJ.js";
7
+ } from "./chunk-VXUWCJS7.js";
8
8
  import {
9
9
  EXIT_CODE,
10
10
  appendLineAtomic,
@@ -13,7 +13,7 @@ import {
13
13
  resolvePmPackageRootFromModule,
14
14
  resolveTelemetryErrorCategory,
15
15
  writeFileAtomic
16
- } from "./chunk-QCKPSFII.js";
16
+ } from "./chunk-AHIEDSW2.js";
17
17
 
18
18
  // dist/core/telemetry/observability.js
19
19
  var SETUP_ROOT_COMMANDS = /* @__PURE__ */ new Set([
@@ -1828,6 +1828,6 @@ export {
1828
1828
  finishTelemetryCommand,
1829
1829
  emitTelemetryErrorEvent
1830
1830
  };
1831
- //# sourceMappingURL=chunk-7HQQT6AT.js.map
1831
+ //# sourceMappingURL=chunk-7TYZTBEV.js.map
1832
1832
 
1833
1833
  //# debugId=494a8428-0a48-5a0c-b53f-182ebda2ea6d
@@ -1,15 +1,16 @@
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]="b50a9692-fc32-5944-8b60-b0734ec2b1f2")}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]="530967bb-33df-5861-80bf-b398d42eab3a")}catch(e){}}();
3
3
  import {
4
4
  normalizeAddTypeInput
5
- } from "./chunk-EEUIIDWF.js";
5
+ } from "./chunk-UGQENMKM.js";
6
6
  import {
7
7
  DEFAULT_RUNTIME_STATUS_DEFINITIONS,
8
+ FRONT_MATTER_KEY_ORDER,
8
9
  RUNTIME_FIELD_COMMAND_VALUES,
9
10
  RUNTIME_FIELD_TYPE_VALUES,
10
11
  RUNTIME_STATUS_ROLE_VALUES,
11
12
  evictOldestMemoEntries
12
- } from "./chunk-QCKPSFII.js";
13
+ } from "./chunk-AHIEDSW2.js";
13
14
 
14
15
  // dist/core/schema/status-defs-file.js
15
16
  var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
@@ -204,6 +205,7 @@ function assertStatusTokensAvailable(input, resolvedAliasToId) {
204
205
  var RUNTIME_FIELD_TYPE_SET = new Set(RUNTIME_FIELD_TYPE_VALUES);
205
206
  var RUNTIME_FIELD_COMMAND_SET = new Set(RUNTIME_FIELD_COMMAND_VALUES);
206
207
  var BUILTIN_FIELD_KEYS = /* @__PURE__ */ new Set([
208
+ ...FRONT_MATTER_KEY_ORDER.filter((key) => key !== "severity"),
207
209
  "id",
208
210
  "title",
209
211
  "type",
@@ -287,7 +289,7 @@ function normalizeAddFieldInput(raw) {
287
289
  throw new Error("Field key must not be empty.");
288
290
  }
289
291
  if (BUILTIN_FIELD_KEYS.has(key)) {
290
- throw new Error(`Cannot define custom field "${key}": it shadows a built-in field. Built-in fields are reserved.`);
292
+ throw new Error(`Cannot define custom field "${key}": custom schema field "${key}" collides with built-in item metadata "${key}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...BUILTIN_FIELD_KEYS].sort((left, right) => left.localeCompare(right)).join(", ")}.`);
291
293
  }
292
294
  const typeCandidate = typeof raw.type === "string" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : "string";
293
295
  if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {
@@ -526,6 +528,6 @@ export {
526
528
  normalizeTypePresetName,
527
529
  resolveTypePresetDefinitions
528
530
  };
529
- //# sourceMappingURL=chunk-VTOQH22Y.js.map
531
+ //# sourceMappingURL=chunk-A2HZUSEA.js.map
530
532
 
531
- //# debugId=b50a9692-fc32-5944-8b60-b0734ec2b1f2
533
+ //# debugId=530967bb-33df-5861-80bf-b398d42eab3a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../core/schema/status-defs-file.ts","../../../../../../../../core/schema/fields-file.ts","../../../../../../../../core/schema/type-presets.ts"],"sourcesContent":["/**\n * @module core/schema/status-defs-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Status Defs File.\n */\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\nimport { evictOldestMemoEntries } from \"../shared/memo.js\";\n\nexport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * Memo for {@link normalizeStatusToken}. Status ranking inside sort comparators\n * normalizes the same handful of status strings O(n log n) times per corpus scan, and\n * the trim/lowercase/regex pipeline shows up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts against unbounded arbitrary inputs; half-eviction keeps the\n * newest-inserted half when the cap is hit. Declared before\n * BUILTIN_STATUS_IDS, whose module-level initializer already normalizes tokens.\n */\nconst STATUS_TOKEN_MEMO_MAX_ENTRIES = 2_000;\nconst statusTokenMemo = new Map<string, string>();\n\n/** The 5 lifecycle status ids that ship as built-in defaults and may never be removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS: open/in_progress/blocked/closed/canceled). `draft` is also a default but the acceptance criteria enumerate the 5 terminal/active ids explicitly, so the guard derives the full set from the canonical defaults to stay in sync. */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) =>\n normalizeStatusToken(definition.id),\n ).filter((id) => id.length > 0),\n);\n\n/** The shape persisted at `.agents/pm/schema/statuses.json`. */\nexport interface StatusDefsFile {\n /** Value that configures or reports statuses for this contract. */\n statuses: RuntimeStatusDefinition[];\n}\n\n/** Documents the raw add status input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string | undefined;\n /** Value that configures or reports roles for this contract. */\n roles?: string[];\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the normalized add status input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Normalized roles, or `undefined` when the raw input did not supply a roles field at all. `undefined` means \"leave existing roles untouched\" on upsert; an explicit empty array means \"clear roles\". This distinction is what keeps `add-status review --description x` from wiping a previously-set role. */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the upsert status def result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove status def result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/** Normalizes a status token using the same rules as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeStatusToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const memoized = statusTokenMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const normalized = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\");\n if (statusTokenMemo.size >= STATUS_TOKEN_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(statusTokenMemo);\n }\n statusTokenMemo.set(value, normalized);\n return normalized;\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(\n raw: RawAddStatusInput,\n): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role =\n typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined\n ? undefined\n : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order)\n ? Math.trunc(raw.order)\n : undefined;\n return {\n id,\n roles,\n aliases,\n description:\n description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile. Accepts the canonical `{ statuses: [...] }` shape, a bare array of definitions, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty statuses list. */\nexport function parseStatusDefsFile(\n raw: string | null | undefined,\n): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/** Serializes the status definitions file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a status definition into the parsed file. Matching is by normalized id. When a definition already exists, fields supplied in `input` override the previous values (roles/aliases replace when a non-empty array is given, clear when an explicit empty array is given, and are left UNTOUCHED when the field is `undefined` — i.e. the add-status flag was omitted); description/order override when provided. Fields not addressed by add-status flags are preserved untouched, so `add-status <id> --description x` keeps any previously-set roles/aliases. */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing =\n existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...existing,\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/** Removes a status definition from the parsed file by id (normalized). Throws a plain Error when `id` is empty or matches a reserved built-in default status (those are never stored in the file and must never be deletable). Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeStatusDef(\n file: StatusDefsFile,\n id: string | undefined,\n): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/** Throws when the new status id or any explicitly-supplied alias collides with a DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized token to its owning status id (the runtime status registry's alias_to_id map, which stores ids and aliases in one namespace). Re-adding the same status (matching id) is allowed — only cross-status collisions throw. This prevents a custom status from shadowing a built-in lifecycle token (for example `add-status review --alias open`, or a custom id `cancelled` that aliases the built-in `canceled`), which would make `pm update --status open` resolve to the wrong status. The CLI layer maps the thrown Error to a USAGE exit code. */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n","/**\n * @module core/schema/fields-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Fields File.\n */\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\nexport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/** Built-in front-matter field names a custom field key must never shadow. A custom key that collides with one of these would let `pm create --<key>` write over reserved metadata, so add-field rejects them up front (symmetric with the built-in-type guard in item-types-file.ts). */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/** The default commands a field is wired onto when `--commands` is omitted, matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition). */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/** The shape persisted at `.agents/pm/schema/fields.json`. */\nexport interface FieldsFile {\n /** Value that configures or reports fields for this contract. */\n fields: RuntimeFieldDefinition[];\n}\n\n/** Documents the raw add field input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string | undefined;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate?: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset?: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes?: string[];\n}\n\n/** Documents the normalized add field input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: RuntimeFieldType;\n /** Value that configures or reports commands for this contract. */\n commands: RuntimeFieldCommand[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports cli aliases for this contract. */\n cliAliases: string[];\n /** Value that configures or reports required for this contract. */\n required: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes: string[];\n}\n\n/** Documents the upsert field result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove field result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/** Normalizes a field key using the same rule as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\"\n ? value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\")\n : \"\";\n}\n\n/** Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse whitespace/underscore runs to a single hyphen (matches normalizeCliToken in runtime-schema.ts). */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/** Normalizes the command allow-list stored for a custom field definition. */\nfunction normalizeFieldCommands(\n rawCommands: string[] | undefined,\n): RuntimeFieldCommand[] {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of rawCommands ?? []) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(\n `Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`,\n );\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n return rawCommands === undefined || normalized.length === 0\n ? [...DEFAULT_FIELD_COMMANDS]\n : normalized;\n}\n\n/** Validates and normalizes raw add-field CLI input. Throws a plain Error with a stable message when the key is missing/empty, collides with a built-in field, or carries an invalid type/command; the CLI layer maps these to PmCliError exit codes. A `string_array` type implies a repeatable field downstream (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is exposed. */\nexport function normalizeAddFieldInput(\n raw: RawAddFieldInput,\n): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": it shadows a built-in field. Built-in fields are reserved.`,\n );\n }\n\n const typeCandidate =\n typeof raw.type === \"string\" && raw.type.trim().length > 0\n ? raw.type.trim().toLowerCase()\n : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(\n `Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const type = typeCandidate as RuntimeFieldType;\n\n const commands = normalizeFieldCommands(raw.commands);\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag =\n cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key)\n ? cliFlagToken\n : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description:\n description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty fields list. */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/** Serializes the fields file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a custom field into the parsed file. Matching is by normalized key. When a definition already exists, the supplied input fully replaces its add-field-managed attributes (type/commands/description/flags/ required flags) while preserving any unrelated keys the file may carry; any `metadata_key` already stored is preserved so existing item data keeps mapping to the same front-matter column. */\nexport function upsertField(\n file: FieldsFile,\n input: NormalizedAddFieldInput,\n): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find(\n (definition) => normalizeFieldKey(definition.key) === input.key,\n );\n const replaced = existing !== undefined;\n const fields = file.fields.filter(\n (definition) => normalizeFieldKey(definition.key) !== input.key,\n );\n\n const next: RuntimeFieldDefinition = {\n ...existing,\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) =>\n normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)),\n );\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/** Removes a custom field definition from the parsed file by key (normalized). Throws a plain Error when `key` is empty. Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeField(\n file: FieldsFile,\n key: string | undefined,\n): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(\n definition: RuntimeFieldDefinition,\n key: string,\n value: string | undefined,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(\n definition: RuntimeFieldDefinition,\n key: string,\n value: boolean,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n","/**\n * @module core/schema/type-presets\n *\n * Resolves configurable schema, fields, statuses, and workflows for Type Presets.\n */\nimport {\n normalizeAddTypeInput,\n type NormalizedAddTypeInput,\n type RawAddTypeInput,\n} from \"./item-types-file.js\";\n\n/** Shared domain item-type presets. These power both `pm init --type-preset` (registered during initialization) and the standalone `pm schema apply-preset` subcommand (adopting a preset into an already-initialized project). Keeping the raw definitions and the preset-name normalizer in one place guarantees init and schema register byte-identical types. */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\n/** Restricts type preset name values accepted by command, SDK, and storage contracts. */\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<\n TypePresetName,\n RawAddTypeInput[]\n> = {\n agile: [\n {\n name: \"Story\",\n description:\n \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description:\n \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description:\n \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description:\n \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description:\n \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description:\n \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/** Validates and normalizes a raw preset-name CLI value. Returns `undefined` when the value is omitted (no preset requested). Throws a plain Error with a stable message for an empty or unknown preset; CLI layers map it to a USAGE exit code. Accepts hyphen/underscore-insensitive casing for ergonomics. */\nexport function normalizeTypePresetName(\n rawValue: string | undefined,\n): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (\n normalized === \"agile\" ||\n normalized === \"ops\" ||\n normalized === \"research\"\n ) {\n return normalized;\n }\n throw new Error(\n `Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`,\n );\n}\n\n/** Returns the normalized add-type inputs for a preset, in the order they should be upserted. Each raw definition is run through normalizeAddTypeInput so callers get the same validated shape as an individual `add-type` invocation. */\nexport function resolveTypePresetDefinitions(\n preset: TypePresetName,\n): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) =>\n normalizeAddTypeInput(rawDefinition),\n );\n}\n"],"names":["definition"],"mappings":";;;;;;;;;;;;;;AA8BA,IAAM,0BAA0B,IAAI,IAAY,0BAA0B;AAU1E,IAAM,gCAAgC;AACtC,IAAM,kBAAkB,oBAAI,IAAG;AAGxB,IAAM,qBAA0C,IAAI,IACzD,mCAAmC,IAAI,CAAC,eACtC,qBAAqB,WAAW,EAAE,CAAC,EACnC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;AA0D3B,SAAU,qBAAqB,OAAc;AACjD,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,QAAM,WAAW,gBAAgB,IAAI,KAAK;AAC1C,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,aAAa,MAChB,KAAI,EACJ,YAAW,EACX,WAAW,WAAW,GAAG;AAC5B,MAAI,gBAAgB,QAAQ,+BAA+B;AACzD,2BAAuB,eAAe;EACxC;AACA,kBAAgB,IAAI,OAAO,UAAU;AACrC,SAAO;AACT;AAEA,SAAS,aAAa,QAAwB;AAC5C,QAAM,OAAO,oBAAI,IAAG;AACpB,aAAW,SAAS,QAAQ;AAC1B,UAAM,QAAQ,qBAAqB,KAAK;AACxC,QAAI,MAAM,SAAS,GAAG;AACpB,WAAK,IAAI,KAAK;IAChB;EACF;AACA,SAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAClE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gB;;;EAG9B,KAAK;IACH;MACE,MAAM;MACN,aACE;MACF,eAAe;MACf,QAAQ;MACR,SAAS,CAAC,QAAQ;;IAEpB;MACE,MAAM;MACN,aACE;MACF,eAAe;MACf,QAAQ;MACR,SAAS,CAAC,UAAU;;;EAGxB,UAAU;IACR;MACE,MAAM;MACN,aACE;MACF,eAAe;MACf,QAAQ;MACR,SAAS,CAAC,OAAO;;IAEnB;MACE,MAAM;MACN,aACE;MACF,eAAe;MACf,QAAQ;MACR,SAAS,CAAC,YAAY;;;;AAMtB,SAAU,wBACd,UAA4B;AAE5B,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,aAAa,SAAS,KAAI,EAAG,YAAW,EAAG,WAAW,KAAK,GAAG;AACpE,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI,MAAM,qCAAqC;EACvD;AACA,MACE,eAAe,WACf,eAAe,SACf,eAAe,YACf;AACA,WAAO;EACT;AACA,QAAM,IAAI,MACR,wBAAwB,QAAQ,eAAe,kBAAkB,KAAK,IAAI,CAAC,GAAG;AAElF;AAGM,SAAU,6BACd,QAAsB;AAEtB,SAAO,wBAAwB,MAAM,EAAE,IAAI,CAAC,kBAC1C,sBAAsB,aAAa,CAAC;AAExC","debugId":"b50a9692-fc32-5944-8b60-b0734ec2b1f2"}
1
+ {"version":3,"sources":["../../../../../../../../core/schema/status-defs-file.ts","../../../../../../../../core/schema/fields-file.ts","../../../../../../../../core/schema/type-presets.ts"],"sourcesContent":["/**\n * @module core/schema/status-defs-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Status Defs File.\n */\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\nimport { evictOldestMemoEntries } from \"../shared/memo.js\";\n\nexport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * Memo for {@link normalizeStatusToken}. Status ranking inside sort comparators\n * normalizes the same handful of status strings O(n log n) times per corpus scan, and\n * the trim/lowercase/regex pipeline shows up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts against unbounded arbitrary inputs; half-eviction keeps the\n * newest-inserted half when the cap is hit. Declared before\n * BUILTIN_STATUS_IDS, whose module-level initializer already normalizes tokens.\n */\nconst STATUS_TOKEN_MEMO_MAX_ENTRIES = 2_000;\nconst statusTokenMemo = new Map<string, string>();\n\n/** The 5 lifecycle status ids that ship as built-in defaults and may never be removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS: open/in_progress/blocked/closed/canceled). `draft` is also a default but the acceptance criteria enumerate the 5 terminal/active ids explicitly, so the guard derives the full set from the canonical defaults to stay in sync. */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) =>\n normalizeStatusToken(definition.id),\n ).filter((id) => id.length > 0),\n);\n\n/** The shape persisted at `.agents/pm/schema/statuses.json`. */\nexport interface StatusDefsFile {\n /** Value that configures or reports statuses for this contract. */\n statuses: RuntimeStatusDefinition[];\n}\n\n/** Documents the raw add status input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string | undefined;\n /** Value that configures or reports roles for this contract. */\n roles?: string[];\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the normalized add status input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Normalized roles, or `undefined` when the raw input did not supply a roles field at all. `undefined` means \"leave existing roles untouched\" on upsert; an explicit empty array means \"clear roles\". This distinction is what keeps `add-status review --description x` from wiping a previously-set role. */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the upsert status def result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove status def result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/** Normalizes a status token using the same rules as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeStatusToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const memoized = statusTokenMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const normalized = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\");\n if (statusTokenMemo.size >= STATUS_TOKEN_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(statusTokenMemo);\n }\n statusTokenMemo.set(value, normalized);\n return normalized;\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(\n raw: RawAddStatusInput,\n): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role =\n typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined\n ? undefined\n : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order)\n ? Math.trunc(raw.order)\n : undefined;\n return {\n id,\n roles,\n aliases,\n description:\n description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile. Accepts the canonical `{ statuses: [...] }` shape, a bare array of definitions, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty statuses list. */\nexport function parseStatusDefsFile(\n raw: string | null | undefined,\n): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/** Serializes the status definitions file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a status definition into the parsed file. Matching is by normalized id. When a definition already exists, fields supplied in `input` override the previous values (roles/aliases replace when a non-empty array is given, clear when an explicit empty array is given, and are left UNTOUCHED when the field is `undefined` — i.e. the add-status flag was omitted); description/order override when provided. Fields not addressed by add-status flags are preserved untouched, so `add-status <id> --description x` keeps any previously-set roles/aliases. */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing =\n existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...existing,\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/** Removes a status definition from the parsed file by id (normalized). Throws a plain Error when `id` is empty or matches a reserved built-in default status (those are never stored in the file and must never be deletable). Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeStatusDef(\n file: StatusDefsFile,\n id: string | undefined,\n): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/** Throws when the new status id or any explicitly-supplied alias collides with a DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized token to its owning status id (the runtime status registry's alias_to_id map, which stores ids and aliases in one namespace). Re-adding the same status (matching id) is allowed — only cross-status collisions throw. This prevents a custom status from shadowing a built-in lifecycle token (for example `add-status review --alias open`, or a custom id `cancelled` that aliases the built-in `canceled`), which would make `pm update --status open` resolve to the wrong status. The CLI layer maps the thrown Error to a USAGE exit code. */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n","/**\n * @module core/schema/fields-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Fields File.\n */\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\nimport { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\n\nexport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/** Built-in front-matter field names a custom field key must never shadow. A custom key that collides with one of these would let `pm create --<key>` write over reserved metadata, so add-field rejects them up front (symmetric with the built-in-type guard in item-types-file.ts). */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => key !== \"severity\"),\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/** The default commands a field is wired onto when `--commands` is omitted, matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition). */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/** The shape persisted at `.agents/pm/schema/fields.json`. */\nexport interface FieldsFile {\n /** Value that configures or reports fields for this contract. */\n fields: RuntimeFieldDefinition[];\n}\n\n/** Documents the raw add field input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string | undefined;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate?: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset?: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes?: string[];\n}\n\n/** Documents the normalized add field input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: RuntimeFieldType;\n /** Value that configures or reports commands for this contract. */\n commands: RuntimeFieldCommand[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports cli aliases for this contract. */\n cliAliases: string[];\n /** Value that configures or reports required for this contract. */\n required: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes: string[];\n}\n\n/** Documents the upsert field result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove field result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/** Normalizes a field key using the same rule as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\"\n ? value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\")\n : \"\";\n}\n\n/** Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse whitespace/underscore runs to a single hyphen (matches normalizeCliToken in runtime-schema.ts). */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/** Normalizes the command allow-list stored for a custom field definition. */\nfunction normalizeFieldCommands(\n rawCommands: string[] | undefined,\n): RuntimeFieldCommand[] {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of rawCommands ?? []) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(\n `Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`,\n );\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n return rawCommands === undefined || normalized.length === 0\n ? [...DEFAULT_FIELD_COMMANDS]\n : normalized;\n}\n\n/** Validates and normalizes raw add-field CLI input. Throws a plain Error with a stable message when the key is missing/empty, collides with a built-in field, or carries an invalid type/command; the CLI layer maps these to PmCliError exit codes. A `string_array` type implies a repeatable field downstream (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is exposed. */\nexport function normalizeAddFieldInput(\n raw: RawAddFieldInput,\n): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": custom schema field \"${key}\" collides with built-in item metadata \"${key}\". Rename the custom field with a project-specific prefix. Reserved fields: ${[...BUILTIN_FIELD_KEYS].sort((left, right) => left.localeCompare(right)).join(\", \")}.`,\n );\n }\n\n const typeCandidate =\n typeof raw.type === \"string\" && raw.type.trim().length > 0\n ? raw.type.trim().toLowerCase()\n : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(\n `Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const type = typeCandidate as RuntimeFieldType;\n\n const commands = normalizeFieldCommands(raw.commands);\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag =\n cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key)\n ? cliFlagToken\n : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description:\n description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty fields list. */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/** Serializes the fields file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a custom field into the parsed file. Matching is by normalized key. When a definition already exists, the supplied input fully replaces its add-field-managed attributes (type/commands/description/flags/ required flags) while preserving any unrelated keys the file may carry; any `metadata_key` already stored is preserved so existing item data keeps mapping to the same front-matter column. */\nexport function upsertField(\n file: FieldsFile,\n input: NormalizedAddFieldInput,\n): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find(\n (definition) => normalizeFieldKey(definition.key) === input.key,\n );\n const replaced = existing !== undefined;\n const fields = file.fields.filter(\n (definition) => normalizeFieldKey(definition.key) !== input.key,\n );\n\n const next: RuntimeFieldDefinition = {\n ...existing,\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) =>\n normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)),\n );\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/** Removes a custom field definition from the parsed file by key (normalized). Throws a plain Error when `key` is empty. Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeField(\n file: FieldsFile,\n key: string | undefined,\n): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(\n definition: RuntimeFieldDefinition,\n key: string,\n value: string | undefined,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(\n definition: RuntimeFieldDefinition,\n key: string,\n value: boolean,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n","/**\n * @module core/schema/type-presets\n *\n * Resolves configurable schema, fields, statuses, and workflows for Type Presets.\n */\nimport {\n normalizeAddTypeInput,\n type NormalizedAddTypeInput,\n type RawAddTypeInput,\n} from \"./item-types-file.js\";\n\n/** Shared domain item-type presets. These power both `pm init --type-preset` (registered during initialization) and the standalone `pm schema apply-preset` subcommand (adopting a preset into an already-initialized project). Keeping the raw definitions and the preset-name normalizer in one place guarantees init and schema register byte-identical types. */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\n/** Restricts type preset name values accepted by command, SDK, and storage contracts. */\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<\n TypePresetName,\n RawAddTypeInput[]\n> = {\n agile: [\n {\n name: \"Story\",\n description:\n \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description:\n \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description:\n \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description:\n \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description:\n \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description:\n \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/** Validates and normalizes a raw preset-name CLI value. Returns `undefined` when the value is omitted (no preset requested). Throws a plain Error with a stable message for an empty or unknown preset; CLI layers map it to a USAGE exit code. Accepts hyphen/underscore-insensitive casing for ergonomics. */\nexport function normalizeTypePresetName(\n rawValue: string | undefined,\n): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (\n normalized === \"agile\" ||\n normalized === \"ops\" ||\n normalized === \"research\"\n ) {\n return normalized;\n }\n throw new Error(\n `Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`,\n );\n}\n\n/** Returns the normalized add-type inputs for a preset, in the order they should be upserted. Each raw definition is run through normalizeAddTypeInput so callers get the same validated shape as an individual `add-type` invocation. */\nexport function resolveTypePresetDefinitions(\n preset: TypePresetName,\n): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) =>\n normalizeAddTypeInput(rawDefinition),\n );\n}\n"],"names":["definition"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAM,0BAA0B,IA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ACR,SAAS,CAAC,OAAO;;IAEnB;MACE,MAAM;MACN,aACE;MACF,eAAe;MACf,QAAQ;MACR,SAAS,CAAC,YAAY;;;;AAMtB,SAAU,wBACd,UAA4B;AAE5B,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,aAAa,SAAS,KAAI,EAAG,YAAW,EAAG,WAAW,KAAK,GAAG;AACpE,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI,MAAM,qCAAqC;EACvD;AACA,MACE,eAAe,WACf,eAAe,SACf,eAAe,YACf;AACA,WAAO;EACT;AACA,QAAM,IAAI,MACR,wBAAwB,QAAQ,eAAe,kBAAkB,KAAK,IAAI,CAAC,GAAG;AAElF;AAGM,SAAU,6BACd,QAAsB;AAEtB,SAAO,wBAAwB,MAAM,EAAE,IAAI,CAAC,kBAC1C,sBAAsB,aAAa,CAAC;AAExC","debugId":"530967bb-33df-5861-80bf-b398d42eab3a"}
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  renameArtifactsResultKey,
5
5
  runLinkedArtifacts
6
- } from "./chunk-MRMS62WQ.js";
6
+ } from "./chunk-N4NKVLPY.js";
7
7
 
8
8
  // dist/cli/commands/docs.js
9
9
  async function runDocs(id, options, global) {
@@ -19,6 +19,6 @@ async function runDocs(id, options, global) {
19
19
  export {
20
20
  runDocs
21
21
  };
22
- //# sourceMappingURL=chunk-YCHJLOO2.js.map
22
+ //# sourceMappingURL=chunk-A6AK7W5M.js.map
23
23
 
24
24
  //# debugId=44d979f8-f7b4-51e3-8fa9-14deff99d846
@@ -13,11 +13,11 @@ import {
13
13
  readFirstStringFromCommanderOptions,
14
14
  readFirstValueFromCommanderOptions,
15
15
  readStringArrayFromCommanderOptions
16
- } from "./chunk-RAC2UXLT.js";
16
+ } from "./chunk-QPWXNK56.js";
17
17
  import {
18
18
  printError,
19
19
  writeStdout
20
- } from "./chunk-KHQYX2QB.js";
20
+ } from "./chunk-NN57FRRN.js";
21
21
  import {
22
22
  getActiveExtensionRegistrations,
23
23
  locateItem,
@@ -25,7 +25,7 @@ import {
25
25
  readLocatedItem,
26
26
  readSettings,
27
27
  setActiveCommandResult
28
- } from "./chunk-NAGOH4YJ.js";
28
+ } from "./chunk-VXUWCJS7.js";
29
29
  import {
30
30
  EXIT_CODE,
31
31
  PmCliError,
@@ -42,7 +42,7 @@ import {
42
42
  toNonEmptyString,
43
43
  trimTrailingSlashes,
44
44
  writeFileAtomic
45
- } from "./chunk-QCKPSFII.js";
45
+ } from "./chunk-AHIEDSW2.js";
46
46
 
47
47
  // dist/cli/registration-helpers.js
48
48
  import { Option } from "commander";
@@ -2952,6 +2952,6 @@ export {
2952
2952
  normalizeNextOptions,
2953
2953
  invalidateSearchCachesForMutation
2954
2954
  };
2955
- //# sourceMappingURL=chunk-WBKZAO3P.js.map
2955
+ //# sourceMappingURL=chunk-A6AVSYRJ.js.map
2956
2956
 
2957
2957
  //# debugId=032faa13-18ae-5f7a-857d-2fdaae69e061
@@ -18,7 +18,7 @@ import {
18
18
  serializeStatusDefsFile,
19
19
  upsertField,
20
20
  upsertStatusDef
21
- } from "./chunk-VTOQH22Y.js";
21
+ } from "./chunk-A2HZUSEA.js";
22
22
  import {
23
23
  assertAliasesAvailable,
24
24
  assertTypeFolderAvailable,
@@ -29,7 +29,7 @@ import {
29
29
  removeItemType,
30
30
  serializeItemTypesFile,
31
31
  upsertItemType
32
- } from "./chunk-EEUIIDWF.js";
32
+ } from "./chunk-UGQENMKM.js";
33
33
  import {
34
34
  acquireLock,
35
35
  getActiveExtensionRegistrations,
@@ -38,7 +38,7 @@ import {
38
38
  readSettings,
39
39
  resolveGovernanceKnobs,
40
40
  runActiveOnWriteHooks
41
- } from "./chunk-NAGOH4YJ.js";
41
+ } from "./chunk-VXUWCJS7.js";
42
42
  import {
43
43
  DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
44
44
  EXIT_CODE,
@@ -54,7 +54,7 @@ import {
54
54
  resolveRuntimeStatusRegistry,
55
55
  toDefaultFolder,
56
56
  writeFileAtomic
57
- } from "./chunk-QCKPSFII.js";
57
+ } from "./chunk-AHIEDSW2.js";
58
58
 
59
59
  // dist/cli/commands/schema.js
60
60
  import path from "node:path";
@@ -1234,6 +1234,6 @@ export {
1234
1234
  formatSchemaInferTypesHuman,
1235
1235
  _testOnlySchemaCommand
1236
1236
  };
1237
- //# sourceMappingURL=chunk-L7C6RTGH.js.map
1237
+ //# sourceMappingURL=chunk-ACDIA6NP.js.map
1238
1238
 
1239
1239
  //# debugId=fc95baf3-54c2-5083-a7ff-1d7109f317f7
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  getRuntimePath,
5
5
  writeFileAtomic
6
- } from "./chunk-QCKPSFII.js";
6
+ } from "./chunk-AHIEDSW2.js";
7
7
 
8
8
  // dist/core/session/session-state.js
9
9
  import { promises as fs } from "node:fs";
@@ -53,6 +53,6 @@ export {
53
53
  setFocusedItem,
54
54
  clearFocusedItem
55
55
  };
56
- //# sourceMappingURL=chunk-AX3BJLPV.js.map
56
+ //# sourceMappingURL=chunk-ACRC3HI4.js.map
57
57
 
58
58
  //# debugId=fe0c58a0-d285-583a-abd6-66aa25b9b668
@@ -1,6 +1,6 @@
1
1
  // dist/core/fs/fs-utils.js
2
2
 
3
- !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]="8b0bcf40-ba69-5567-9b6e-bdb3f26a7310")}catch(e){}}();
3
+ !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]="4f2ff373-1138-591c-a14c-08dc453352cc")}catch(e){}}();
4
4
  import * as fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import crypto from "node:crypto";
@@ -4714,28 +4714,38 @@ var ExtensionApiRegistrar = class {
4714
4714
  });
4715
4715
  }
4716
4716
  applyImportExportCommandMetadata(method, commandPath, options) {
4717
- if (options === void 0) {
4718
- return;
4719
- }
4720
- if (typeof options !== "object" || options === null || Array.isArray(options)) {
4717
+ if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) {
4721
4718
  throw new TypeError(`${method} options must be an object when provided`);
4722
4719
  }
4723
- assertOptionalStringField(`${method} options.action`, options.action);
4724
- assertOptionalStringField(`${method} options.description`, options.description);
4725
- assertOptionalStringField(`${method} options.intent`, options.intent);
4726
- const action = resolveCommandDefinitionAction(commandPath, options.action);
4727
- const examples = normalizeOptionalStringArrayField(`${method} options.examples`, options.examples);
4728
- const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, options.failure_hints);
4729
- const argumentsDefinition = normalizeCommandDefinitionArguments(options.arguments);
4730
- if (options.flags !== void 0) {
4720
+ const defaultDescription = `${method === "registerImporter" ? "Import" : "Export"} items with the registered extension adapter.`;
4721
+ const defaultArguments = [
4722
+ {
4723
+ name: "file",
4724
+ required: false,
4725
+ description: "Optional input or output file path."
4726
+ }
4727
+ ];
4728
+ const resolvedOptions = {
4729
+ ...options,
4730
+ description: options?.description ?? defaultDescription,
4731
+ arguments: options?.arguments ?? defaultArguments
4732
+ };
4733
+ assertOptionalStringField(`${method} options.action`, resolvedOptions.action);
4734
+ assertOptionalStringField(`${method} options.description`, resolvedOptions.description);
4735
+ assertOptionalStringField(`${method} options.intent`, resolvedOptions.intent);
4736
+ const action = resolveCommandDefinitionAction(commandPath, resolvedOptions.action);
4737
+ const examples = normalizeOptionalStringArrayField(`${method} options.examples`, resolvedOptions.examples);
4738
+ const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, resolvedOptions.failure_hints);
4739
+ const argumentsDefinition = normalizeCommandDefinitionArguments(resolvedOptions.arguments);
4740
+ if (resolvedOptions.flags !== void 0) {
4731
4741
  assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
4732
4742
  if (this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
4733
- validateFlagDefinitions(options.flags);
4743
+ validateFlagDefinitions(resolvedOptions.flags);
4734
4744
  this.#registrationRegistry.flags.push({
4735
4745
  layer: this.#loadedExtension.layer,
4736
4746
  name: this.#loadedExtension.name,
4737
4747
  target_command: commandPath,
4738
- flags: normalizeRegistrationRecordList(`${method} options.flags`, options.flags)
4748
+ flags: normalizeRegistrationRecordList(`${method} options.flags`, resolvedOptions.flags)
4739
4749
  });
4740
4750
  }
4741
4751
  }
@@ -4749,11 +4759,11 @@ var ExtensionApiRegistrar = class {
4749
4759
  failure_hints: failureHints,
4750
4760
  arguments: argumentsDefinition
4751
4761
  };
4752
- const description = options.description?.trim();
4762
+ const description = resolvedOptions.description?.trim();
4753
4763
  if (description) {
4754
4764
  registration.description = description;
4755
4765
  }
4756
- const intent = options.intent?.trim();
4766
+ const intent = resolvedOptions.intent?.trim();
4757
4767
  if (intent) {
4758
4768
  registration.intent = intent;
4759
4769
  }
@@ -5964,7 +5974,7 @@ function assertNotReservedItemFieldName(fieldName) {
5964
5974
  if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {
5965
5975
  return;
5966
5976
  }
5967
- throw new PmCliError(`Extension item field "${fieldName}" collides with reserved item metadata`, EXIT_CODE.USAGE, {
5977
+ throw new PmCliError(`Extension item field "${fieldName}" collides with built-in item metadata "${fieldName}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...RESERVED_ITEM_FIELD_NAMES].sort((left, right) => left.localeCompare(right)).join(", ")}.`, EXIT_CODE.USAGE, {
5968
5978
  code: "extension_item_field_reserved",
5969
5979
  nextSteps: [
5970
5980
  "Rename the extension item field, preferably with an extension-specific prefix."
@@ -6219,6 +6229,6 @@ export {
6219
6229
  parseRegisteredItemFieldAssignments,
6220
6230
  applyRegisteredItemFieldDefaultsAndValidation
6221
6231
  };
6222
- //# sourceMappingURL=chunk-QCKPSFII.js.map
6232
+ //# sourceMappingURL=chunk-AHIEDSW2.js.map
6223
6233
 
6224
- //# debugId=8b0bcf40-ba69-5567-9b6e-bdb3f26a7310
6234
+ //# debugId=4f2ff373-1138-591c-a14c-08dc453352cc