@unbrained/pm-cli 2026.7.5 → 2026.7.7

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 (597) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/cli/commands/annotation-command.d.ts +1 -0
  3. package/dist/cli/commands/annotation-command.js +29 -2
  4. package/dist/cli/commands/annotation-command.js.map +1 -1
  5. package/dist/cli/commands/comments.js +3 -4
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
  8. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  9. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  10. package/dist/cli/commands/extension/install-sources.js +81 -18
  11. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  12. package/dist/cli/commands/health.js +9 -5
  13. package/dist/cli/commands/health.js.map +1 -1
  14. package/dist/cli/commands/learnings.js +5 -3
  15. package/dist/cli/commands/learnings.js.map +1 -1
  16. package/dist/cli/commands/notes.js +5 -3
  17. package/dist/cli/commands/notes.js.map +1 -1
  18. package/dist/cli/commands/reindex.js +4 -3
  19. package/dist/cli/commands/reindex.js.map +1 -1
  20. package/dist/cli/commands/search.js +3 -3
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/test.d.ts +9 -0
  23. package/dist/cli/commands/test.js +144 -105
  24. package/dist/cli/commands/test.js.map +1 -1
  25. package/dist/cli/extension-command-help.js +10 -2
  26. package/dist/cli/extension-command-help.js.map +1 -1
  27. package/dist/cli/register-list-query.d.ts +1 -1
  28. package/dist/cli/register-list-query.js +18 -27
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.d.ts +0 -8
  31. package/dist/cli/register-operations.js +41 -46
  32. package/dist/cli/register-operations.js.map +1 -1
  33. package/dist/cli/register-setup.js +113 -13
  34. package/dist/cli/register-setup.js.map +1 -1
  35. package/dist/cli/registration-helpers.d.ts +5 -1
  36. package/dist/cli/registration-helpers.js +14 -2
  37. package/dist/cli/registration-helpers.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
  39. package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
  40. package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
  41. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
  42. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
  43. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
  44. package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
  46. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
  47. package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
  48. package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
  49. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
  50. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
  51. package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
  52. package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
  53. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
  54. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
  55. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
  56. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
  57. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
  58. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
  59. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
  60. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
  61. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
  62. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
  64. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
  65. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
  66. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
  67. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
  68. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
  69. package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
  70. package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
  72. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
  73. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
  76. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
  77. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
  78. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
  80. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
  81. package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
  83. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
  84. package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
  85. package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
  86. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
  87. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
  88. package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
  89. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
  90. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
  91. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
  92. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
  93. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
  94. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
  95. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
  96. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
  97. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
  100. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
  101. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
  102. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
  103. package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
  105. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
  106. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
  107. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
  108. package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
  109. package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
  111. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
  112. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
  113. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
  114. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
  115. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
  116. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
  118. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
  119. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
  121. package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
  123. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
  124. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
  125. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
  127. package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
  128. package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
  130. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
  131. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
  133. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
  135. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
  136. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
  137. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
  139. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
  141. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
  142. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
  143. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
  145. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
  146. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
  147. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
  148. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
  149. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
  150. package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
  151. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
  153. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
  154. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
  155. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
  156. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
  157. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
  158. package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
  160. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
  161. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
  162. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
  163. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
  164. package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
  165. package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
  167. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
  169. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
  171. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
  173. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
  174. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
  175. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
  176. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
  177. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
  178. package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
  179. package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
  181. package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
  183. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
  184. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
  185. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
  186. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
  187. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
  188. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
  189. package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
  190. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
  191. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
  192. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
  194. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
  196. package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
  197. package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
  198. package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
  199. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
  200. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
  202. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
  203. package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
  204. package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
  205. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
  206. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
  208. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
  210. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
  212. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
  213. package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
  214. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
  215. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
  216. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
  218. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
  219. package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
  220. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
  221. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
  222. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
  223. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
  224. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
  225. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
  226. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
  230. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
  231. package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
  232. package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
  233. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
  234. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
  235. package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
  236. package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
  237. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
  238. package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
  239. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
  240. package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
  241. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
  242. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
  243. package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
  244. package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
  245. package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
  246. package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
  247. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
  248. package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
  249. package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
  250. package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
  251. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
  252. package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
  253. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
  254. package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
  255. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
  256. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
  257. package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
  258. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
  259. package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
  260. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
  261. package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
  262. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
  263. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
  264. package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
  265. package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
  266. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
  267. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
  268. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
  269. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
  271. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
  272. package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
  273. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
  275. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
  277. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
  279. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
  280. package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
  281. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
  282. package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
  283. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
  284. package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
  285. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
  286. package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
  287. package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
  288. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
  289. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
  291. package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
  292. package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
  293. package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
  294. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
  295. package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
  296. package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
  297. package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
  298. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
  299. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
  300. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
  301. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
  302. package/dist/cli-bundle/main.js +29 -31
  303. package/dist/cli-bundle/main.js.map +2 -2
  304. package/dist/cli-bundle/sdk-runtime.js +136 -54
  305. package/dist/cli-bundle/sdk-testing.js +7 -8
  306. package/dist/cli-bundle/sdk.js +132 -84
  307. package/dist/cli-bundle/sdk.js.map +2 -2
  308. package/dist/core/history/drift-scan.js +3 -8
  309. package/dist/core/history/drift-scan.js.map +1 -1
  310. package/dist/core/output/mutation-projection.js +11 -5
  311. package/dist/core/output/mutation-projection.js.map +1 -1
  312. package/dist/core/search/cache.js +3 -3
  313. package/dist/core/search/cache.js.map +1 -1
  314. package/dist/core/search/semantic-defaults.d.ts +2 -0
  315. package/dist/core/search/semantic-defaults.js +11 -4
  316. package/dist/core/search/semantic-defaults.js.map +1 -1
  317. package/dist/core/search/vector-stores.d.ts +1 -1
  318. package/dist/core/search/vector-stores.js +33 -7
  319. package/dist/core/search/vector-stores.js.map +1 -1
  320. package/dist/mcp/server.d.ts +22 -50
  321. package/dist/mcp/server.js +62 -916
  322. package/dist/mcp/server.js.map +1 -1
  323. package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
  324. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  325. package/dist/sdk/cli-contracts/tool-schema.js +9 -7
  326. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  327. package/dist/sdk/index.d.ts +4 -2
  328. package/dist/sdk/index.js +4 -4
  329. package/dist/sdk/index.js.map +1 -1
  330. package/dist/sdk/runtime.d.ts +312 -5
  331. package/dist/sdk/runtime.js +1391 -26
  332. package/dist/sdk/runtime.js.map +1 -1
  333. package/dist/sdk/start-task-status.d.ts +13 -0
  334. package/dist/sdk/start-task-status.js +19 -0
  335. package/dist/sdk/start-task-status.js.map +1 -0
  336. package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
  337. package/dist/sdk/workspace-contracts-cache.js +36 -0
  338. package/dist/sdk/workspace-contracts-cache.js.map +1 -0
  339. package/docs/COMMANDS.md +10 -1
  340. package/docs/RELEASING.md +3 -1
  341. package/docs/SDK.md +81 -0
  342. package/docs/TESTING.md +3 -0
  343. package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
  344. package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
  345. package/package.json +1 -1
  346. package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
  347. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
  348. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
  349. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
  350. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
  351. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  352. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
  354. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
  356. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  358. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  359. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
  360. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
  362. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
  363. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
  364. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
  365. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
  366. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
  367. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
  368. package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
  369. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
  370. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
  372. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
  373. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  374. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  375. package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
  378. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
  379. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
  380. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
  382. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
  384. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
  385. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
  386. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
  388. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
  389. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
  390. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
  392. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
  393. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
  394. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  396. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  397. package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
  398. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
  399. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
  401. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
  403. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
  405. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
  406. package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
  407. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
  408. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
  409. package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
  410. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
  411. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
  412. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
  413. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
  414. package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
  415. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  416. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  417. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
  418. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
  419. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
  420. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
  421. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
  422. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
  423. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
  424. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
  425. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
  426. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
  427. package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
  428. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  429. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  430. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  431. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  432. package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
  433. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
  434. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
  435. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
  436. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
  437. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
  438. package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
  440. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
  443. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
  445. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  447. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
  449. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
  452. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
  456. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
  458. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
  461. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
  463. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
  464. package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
  465. package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
  466. package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
  467. package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
  468. package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
  469. package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
  470. package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
  471. package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
  472. package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
  473. package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
  474. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
  475. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
  476. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
  477. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
  478. package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
  479. package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
  480. package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
  481. package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
  482. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
  483. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
  484. package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
  485. package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
  486. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
  487. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
  488. package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
  489. package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
  490. package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
  491. package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
  492. package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
  493. package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
  494. package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
  495. package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
  496. package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
  497. package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
  498. package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
  499. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
  500. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
  501. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
  502. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
  503. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
  504. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
  505. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
  506. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
  507. package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
  508. package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
  509. package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
  510. package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
  511. package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
  512. package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
  513. package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
  514. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
  515. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
  516. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
  517. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
  518. package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
  519. package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
  520. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
  521. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
  522. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
  523. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
  525. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
  526. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
  527. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
  529. package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
  530. package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
  531. package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
  533. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
  534. package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
  535. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
  536. package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
  537. package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
  538. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
  539. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
  540. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
  541. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
  542. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
  543. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
  544. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
  545. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
  546. /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
@@ -1,275 +0,0 @@
1
- import {
2
- CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS
3
- } from "./chunk-UI5BJ6DO.js";
4
- import {
5
- nowIso
6
- } from "./chunk-DRBV5UC2.js";
7
- import {
8
- PmCliError
9
- } from "./chunk-P5YORJRH.js";
10
- import {
11
- EXIT_CODE,
12
- getSettingsPath,
13
- pathExists,
14
- readFileIfExists,
15
- resolvePmRoot,
16
- writeFileAtomic
17
- } from "./chunk-5VVUKE3U.js";
18
-
19
- // dist/cli/commands/templates.js
20
- import fs from "node:fs/promises";
21
- import path from "node:path";
22
- !(function() {
23
- try {
24
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
25
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4ac1eb25-6b3f-549e-b7f5-6b4c53071b9a");
26
- } catch (e2) {
27
- }
28
- })();
29
- var TEMPLATE_DIRECTORY_NAME = "templates";
30
- var TEMPLATE_FILE_EXTENSION = ".json";
31
- var TEMPLATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
32
- var TEMPLATE_OPTION_REPEATABLE_KEYS = CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.map((entry) => entry.target);
33
- var TEMPLATE_OPTION_REPEATABLE_KEY_SET = new Set(TEMPLATE_OPTION_REPEATABLE_KEYS);
34
- var BUILTIN_TEMPLATE_TIMESTAMP = "1970-01-01T00:00:00.000Z";
35
- var BUILTIN_TEMPLATES = {
36
- bug: {
37
- type: "Issue",
38
- priority: "1",
39
- tags: "bug",
40
- acceptanceCriteria: "Bug no longer reproduces with the steps below and a regression test guards it.",
41
- expectedResult: "Describe the correct behavior.",
42
- actualResult: "Describe the observed (buggy) behavior.",
43
- body: "## Repro steps\n1. \n2. \n3. \n\n## Expected\n\n## Actual\n"
44
- },
45
- feature: {
46
- type: "Feature",
47
- priority: "2",
48
- tags: "feature",
49
- acceptanceCriteria: "Feature is shipped behind agreed scope with tests and docs updated.",
50
- whyNow: "Explain why this is worth doing now (impact / urgency).",
51
- body: "## Goal\n\n## Why now\n\n## Out of scope\n"
52
- },
53
- spike: {
54
- type: "Task",
55
- priority: "2",
56
- tags: "spike",
57
- estimatedMinutes: "120",
58
- acceptanceCriteria: "Timeboxed investigation complete; findings and a recommendation are recorded.",
59
- body: "## Question to answer\n\n## Timebox\n2h\n\n## Findings\n\n## Recommendation\n"
60
- },
61
- chore: {
62
- type: "Chore",
63
- priority: "3",
64
- tags: "chore",
65
- acceptanceCriteria: "Maintenance task done with no behavior change and green checks.",
66
- body: "## What\n\n## Why\n"
67
- }
68
- };
69
- function normalizeTemplateName(rawName) {
70
- const name = rawName.trim();
71
- if (!TEMPLATE_NAME_PATTERN.test(name)) {
72
- throw new PmCliError(`Invalid template name "${rawName}". Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._-]*.`, EXIT_CODE.USAGE);
73
- }
74
- return name;
75
- }
76
- function templatesDirectory(pmRoot) {
77
- return path.join(pmRoot, TEMPLATE_DIRECTORY_NAME);
78
- }
79
- function templatePath(pmRoot, normalizedName) {
80
- return path.join(templatesDirectory(pmRoot), `${normalizedName}${TEMPLATE_FILE_EXTENSION}`);
81
- }
82
- async function ensureTrackerInitialized(pmRoot) {
83
- if (!await pathExists(getSettingsPath(pmRoot))) {
84
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
85
- }
86
- }
87
- function sortTemplateOptions(options) {
88
- return Object.fromEntries(Object.entries(options).sort(([left], [right]) => left.localeCompare(right)));
89
- }
90
- function extractTemplateOptions(rawOptions) {
91
- const next = {};
92
- for (const [key, value] of Object.entries(rawOptions)) {
93
- if (value === void 0) {
94
- continue;
95
- }
96
- if (TEMPLATE_OPTION_REPEATABLE_KEY_SET.has(key)) {
97
- if (typeof value === "string") {
98
- next[key] = [value];
99
- continue;
100
- }
101
- if (!Array.isArray(value)) {
102
- continue;
103
- }
104
- const values = value.filter((entry) => typeof entry === "string");
105
- if (values.length > 0) {
106
- next[key] = values;
107
- }
108
- continue;
109
- }
110
- if (typeof value === "string") {
111
- next[key] = value;
112
- continue;
113
- }
114
- if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) {
115
- next[key] = [...value];
116
- }
117
- }
118
- return sortTemplateOptions(next);
119
- }
120
- function parseStoredTemplateOptions(rawOptions, templateName) {
121
- if (typeof rawOptions !== "object" || rawOptions === null || Array.isArray(rawOptions)) {
122
- throw new PmCliError(`Template "${templateName}" has invalid options payload.`, EXIT_CODE.GENERIC_FAILURE);
123
- }
124
- const optionsRecord = rawOptions;
125
- const normalized = {};
126
- for (const [key, value] of Object.entries(optionsRecord)) {
127
- const normalizedKey = key.trim();
128
- if (normalizedKey.length === 0) {
129
- throw new PmCliError(`Template "${templateName}" contains an empty option key.`, EXIT_CODE.GENERIC_FAILURE);
130
- }
131
- if (typeof value === "string") {
132
- normalized[normalizedKey] = value;
133
- continue;
134
- }
135
- if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) {
136
- normalized[normalizedKey] = [...value];
137
- continue;
138
- }
139
- throw new PmCliError(`Template "${templateName}" contains invalid value for option "${normalizedKey}".`, EXIT_CODE.GENERIC_FAILURE);
140
- }
141
- return sortTemplateOptions(normalized);
142
- }
143
- function parseStoredTemplateDocument(raw, normalizedName) {
144
- let parsed;
145
- try {
146
- parsed = JSON.parse(raw);
147
- } catch {
148
- throw new PmCliError(`Template "${normalizedName}" contains invalid JSON.`, EXIT_CODE.GENERIC_FAILURE);
149
- }
150
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
151
- throw new PmCliError(`Template "${normalizedName}" has invalid document shape.`, EXIT_CODE.GENERIC_FAILURE);
152
- }
153
- const record = parsed;
154
- const options = parseStoredTemplateOptions(record.options, normalizedName);
155
- const now = nowIso();
156
- return {
157
- name: typeof record.name === "string" && record.name.trim().length > 0 ? record.name.trim() : normalizedName,
158
- created_at: typeof record.created_at === "string" ? record.created_at : now,
159
- updated_at: typeof record.updated_at === "string" ? record.updated_at : now,
160
- options
161
- };
162
- }
163
- function builtinTemplateDocument(normalizedName) {
164
- const options = BUILTIN_TEMPLATES[normalizedName];
165
- if (!options) {
166
- return null;
167
- }
168
- return {
169
- name: normalizedName,
170
- created_at: BUILTIN_TEMPLATE_TIMESTAMP,
171
- updated_at: BUILTIN_TEMPLATE_TIMESTAMP,
172
- options: sortTemplateOptions({ ...options })
173
- };
174
- }
175
- async function resolveTemplateDocument(pmRoot, normalizedName) {
176
- const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));
177
- if (raw !== null) {
178
- return { document: parseStoredTemplateDocument(raw, normalizedName), source: "user" };
179
- }
180
- const builtin = builtinTemplateDocument(normalizedName);
181
- if (builtin) {
182
- return { document: builtin, source: "builtin" };
183
- }
184
- throw new PmCliError(`Template "${normalizedName}" not found`, EXIT_CODE.NOT_FOUND);
185
- }
186
- async function readStoredTemplateDocument(pmRoot, normalizedName) {
187
- const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));
188
- if (raw === null) {
189
- throw new PmCliError(`Template "${normalizedName}" not found`, EXIT_CODE.NOT_FOUND);
190
- }
191
- return parseStoredTemplateDocument(raw, normalizedName);
192
- }
193
- async function loadCreateTemplateOptions(pmRoot, rawTemplateName) {
194
- const normalizedName = normalizeTemplateName(rawTemplateName);
195
- const { document } = await resolveTemplateDocument(pmRoot, normalizedName);
196
- return document.options;
197
- }
198
- async function runTemplatesSave(rawTemplateName, options, global2) {
199
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
200
- await ensureTrackerInitialized(pmRoot);
201
- const normalizedName = normalizeTemplateName(rawTemplateName);
202
- const nextOptions = extractTemplateOptions(options);
203
- if (Object.keys(nextOptions).length === 0) {
204
- throw new PmCliError("templates save requires at least one create option flag", EXIT_CODE.USAGE);
205
- }
206
- const now = nowIso();
207
- const storedPath = templatePath(pmRoot, normalizedName);
208
- let createdAt = now;
209
- if (await pathExists(storedPath)) {
210
- const existing = await readStoredTemplateDocument(pmRoot, normalizedName);
211
- createdAt = existing.created_at;
212
- }
213
- const document = {
214
- name: normalizedName,
215
- created_at: createdAt,
216
- updated_at: now,
217
- options: nextOptions
218
- };
219
- await fs.mkdir(templatesDirectory(pmRoot), { recursive: true });
220
- await writeFileAtomic(storedPath, `${JSON.stringify(document, null, 2)}
221
- `);
222
- return {
223
- name: document.name,
224
- created_at: document.created_at,
225
- updated_at: document.updated_at,
226
- path: storedPath,
227
- options: document.options
228
- };
229
- }
230
- async function readUserTemplateNames(pmRoot) {
231
- const dirPath = templatesDirectory(pmRoot);
232
- if (!await pathExists(dirPath)) {
233
- return [];
234
- }
235
- const entries = await fs.readdir(dirPath);
236
- return entries.filter((entry) => entry.toLowerCase().endsWith(TEMPLATE_FILE_EXTENSION)).map((entry) => entry.slice(0, -TEMPLATE_FILE_EXTENSION.length)).filter((entry) => TEMPLATE_NAME_PATTERN.test(entry));
237
- }
238
- async function runTemplatesList(global2) {
239
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
240
- await ensureTrackerInitialized(pmRoot);
241
- const userTemplates = await readUserTemplateNames(pmRoot);
242
- const userTemplateSet = new Set(userTemplates);
243
- const builtinTemplates = Object.keys(BUILTIN_TEMPLATES).filter((name) => !userTemplateSet.has(name));
244
- const sortedUser = [...userTemplates].sort((left, right) => left.localeCompare(right));
245
- const sortedBuiltin = [...builtinTemplates].sort((left, right) => left.localeCompare(right));
246
- const templates = [.../* @__PURE__ */ new Set([...sortedUser, ...sortedBuiltin])].sort((left, right) => left.localeCompare(right));
247
- return {
248
- templates,
249
- count: templates.length,
250
- builtin_templates: sortedBuiltin,
251
- user_templates: sortedUser
252
- };
253
- }
254
- async function runTemplatesShow(rawTemplateName, global2) {
255
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
256
- await ensureTrackerInitialized(pmRoot);
257
- const normalizedName = normalizeTemplateName(rawTemplateName);
258
- const { document, source } = await resolveTemplateDocument(pmRoot, normalizedName);
259
- return {
260
- name: document.name,
261
- source,
262
- created_at: document.created_at,
263
- updated_at: document.updated_at,
264
- path: source === "builtin" ? `builtin:${normalizedName}` : templatePath(pmRoot, normalizedName),
265
- options: document.options
266
- };
267
- }
268
-
269
- export {
270
- loadCreateTemplateOptions,
271
- runTemplatesSave,
272
- runTemplatesList,
273
- runTemplatesShow
274
- };
275
- //# sourceMappingURL=chunk-DC3QJQWI.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../cli/commands/templates.ts"],
4
- "sourcesContent": ["/**\n * @module cli/commands/templates\n *\n * Implements the pm templates command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport {\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n} from \"../../sdk/cli-contracts.js\";\n\nconst TEMPLATE_DIRECTORY_NAME = \"templates\";\nconst TEMPLATE_FILE_EXTENSION = \".json\";\nconst TEMPLATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\n\nconst TEMPLATE_OPTION_REPEATABLE_KEYS = CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.map((entry) => entry.target);\nconst TEMPLATE_OPTION_REPEATABLE_KEY_SET = new Set<string>(TEMPLATE_OPTION_REPEATABLE_KEYS);\n\ntype TemplateOptionValue = string | string[];\n/**\n * Restricts create template options values accepted by command, SDK, and storage contracts.\n */\nexport type CreateTemplateOptions = Record<string, TemplateOptionValue>;\n/**\n * Restricts template source values accepted by command, SDK, and storage contracts.\n */\nexport type TemplateSource = \"builtin\" | \"user\";\n\nconst BUILTIN_TEMPLATE_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst BUILTIN_TEMPLATES: Readonly<Record<string, CreateTemplateOptions>> = {\n bug: {\n type: \"Issue\",\n priority: \"1\",\n tags: \"bug\",\n acceptanceCriteria: \"Bug no longer reproduces with the steps below and a regression test guards it.\",\n expectedResult: \"Describe the correct behavior.\",\n actualResult: \"Describe the observed (buggy) behavior.\",\n body: \"## Repro steps\\n1. \\n2. \\n3. \\n\\n## Expected\\n\\n## Actual\\n\",\n },\n feature: {\n type: \"Feature\",\n priority: \"2\",\n tags: \"feature\",\n acceptanceCriteria: \"Feature is shipped behind agreed scope with tests and docs updated.\",\n whyNow: \"Explain why this is worth doing now (impact / urgency).\",\n body: \"## Goal\\n\\n## Why now\\n\\n## Out of scope\\n\",\n },\n spike: {\n type: \"Task\",\n priority: \"2\",\n tags: \"spike\",\n estimatedMinutes: \"120\",\n acceptanceCriteria: \"Timeboxed investigation complete; findings and a recommendation are recorded.\",\n body: \"## Question to answer\\n\\n## Timebox\\n2h\\n\\n## Findings\\n\\n## Recommendation\\n\",\n },\n chore: {\n type: \"Chore\",\n priority: \"3\",\n tags: \"chore\",\n acceptanceCriteria: \"Maintenance task done with no behavior change and green checks.\",\n body: \"## What\\n\\n## Why\\n\",\n },\n};\n\ninterface StoredCreateTemplateDocument {\n name: string;\n created_at: string;\n updated_at: string;\n options: CreateTemplateOptions;\n}\n\nexport const _testOnly = {\n normalizeTemplateName,\n extractTemplateOptions,\n parseStoredTemplateDocument,\n builtinTemplateDocument,\n readStoredTemplateDocument,\n};\n\n/**\n * Documents the templates save result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesSaveResult {\n name: string;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\n/**\n * Documents the templates list result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesListResult {\n templates: string[];\n count: number;\n builtin_templates: string[];\n user_templates: string[];\n}\n\n/**\n * Documents the templates show result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesShowResult {\n name: string;\n source: TemplateSource;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\nfunction normalizeTemplateName(rawName: string): string {\n const name = rawName.trim();\n if (!TEMPLATE_NAME_PATTERN.test(name)) {\n throw new PmCliError(\n `Invalid template name \"${rawName}\". Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._-]*.`,\n EXIT_CODE.USAGE,\n );\n }\n return name;\n}\n\nfunction templatesDirectory(pmRoot: string): string {\n return path.join(pmRoot, TEMPLATE_DIRECTORY_NAME);\n}\n\nfunction templatePath(pmRoot: string, normalizedName: string): string {\n return path.join(templatesDirectory(pmRoot), `${normalizedName}${TEMPLATE_FILE_EXTENSION}`);\n}\n\nasync function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nfunction sortTemplateOptions(options: CreateTemplateOptions): CreateTemplateOptions {\n return Object.fromEntries(\n Object.entries(options).sort(([left], [right]) => left.localeCompare(right)),\n ) as CreateTemplateOptions;\n}\n\nfunction extractTemplateOptions(rawOptions: Record<string, unknown>): CreateTemplateOptions {\n const next: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(rawOptions)) {\n if (value === undefined) {\n continue;\n }\n if (TEMPLATE_OPTION_REPEATABLE_KEY_SET.has(key)) {\n if (typeof value === \"string\") {\n next[key] = [value];\n continue;\n }\n if (!Array.isArray(value)) {\n continue;\n }\n const values = value.filter((entry): entry is string => typeof entry === \"string\");\n if (values.length > 0) {\n next[key] = values;\n }\n continue;\n }\n if (typeof value === \"string\") {\n next[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n next[key] = [...value];\n }\n }\n return sortTemplateOptions(next);\n}\n\nfunction parseStoredTemplateOptions(rawOptions: unknown, templateName: string): CreateTemplateOptions {\n if (typeof rawOptions !== \"object\" || rawOptions === null || Array.isArray(rawOptions)) {\n throw new PmCliError(`Template \"${templateName}\" has invalid options payload.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const optionsRecord = rawOptions as Record<string, unknown>;\n const normalized: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(optionsRecord)) {\n const normalizedKey = key.trim();\n if (normalizedKey.length === 0) {\n throw new PmCliError(\n `Template \"${templateName}\" contains an empty option key.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (typeof value === \"string\") {\n normalized[normalizedKey] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[normalizedKey] = [...value];\n continue;\n }\n throw new PmCliError(\n `Template \"${templateName}\" contains invalid value for option \"${normalizedKey}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return sortTemplateOptions(normalized);\n}\n\nfunction parseStoredTemplateDocument(raw: string, normalizedName: string): StoredCreateTemplateDocument {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new PmCliError(`Template \"${normalizedName}\" contains invalid JSON.`, EXIT_CODE.GENERIC_FAILURE);\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw new PmCliError(`Template \"${normalizedName}\" has invalid document shape.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const record = parsed as Record<string, unknown>;\n const options = parseStoredTemplateOptions(record.options, normalizedName);\n const now = nowIso();\n return {\n name: typeof record.name === \"string\" && record.name.trim().length > 0 ? record.name.trim() : normalizedName,\n created_at: typeof record.created_at === \"string\" ? record.created_at : now,\n updated_at: typeof record.updated_at === \"string\" ? record.updated_at : now,\n options,\n };\n}\n\nfunction builtinTemplateDocument(normalizedName: string): StoredCreateTemplateDocument | null {\n const options = BUILTIN_TEMPLATES[normalizedName];\n if (!options) {\n return null;\n }\n return {\n name: normalizedName,\n created_at: BUILTIN_TEMPLATE_TIMESTAMP,\n updated_at: BUILTIN_TEMPLATE_TIMESTAMP,\n options: sortTemplateOptions({ ...options }),\n };\n}\n\ninterface ResolvedTemplateDocument {\n document: StoredCreateTemplateDocument;\n source: TemplateSource;\n}\n\nasync function resolveTemplateDocument(pmRoot: string, normalizedName: string): Promise<ResolvedTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw !== null) {\n return { document: parseStoredTemplateDocument(raw, normalizedName), source: \"user\" };\n }\n const builtin = builtinTemplateDocument(normalizedName);\n if (builtin) {\n return { document: builtin, source: \"builtin\" };\n }\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n}\n\nasync function readStoredTemplateDocument(pmRoot: string, normalizedName: string): Promise<StoredCreateTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw === null) {\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n }\n return parseStoredTemplateDocument(raw, normalizedName);\n}\n\n/**\n * Implements load create template options for the public runtime surface of this module.\n */\nexport async function loadCreateTemplateOptions(pmRoot: string, rawTemplateName: string): Promise<CreateTemplateOptions> {\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document } = await resolveTemplateDocument(pmRoot, normalizedName);\n return document.options;\n}\n\n/**\n * Implements run templates save for the public runtime surface of this module.\n */\nexport async function runTemplatesSave(\n rawTemplateName: string,\n options: Record<string, unknown>,\n global: GlobalOptions,\n): Promise<TemplatesSaveResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const nextOptions = extractTemplateOptions(options);\n if (Object.keys(nextOptions).length === 0) {\n throw new PmCliError(\"templates save requires at least one create option flag\", EXIT_CODE.USAGE);\n }\n\n const now = nowIso();\n const storedPath = templatePath(pmRoot, normalizedName);\n let createdAt = now;\n if (await pathExists(storedPath)) {\n const existing = await readStoredTemplateDocument(pmRoot, normalizedName);\n createdAt = existing.created_at;\n }\n\n const document: StoredCreateTemplateDocument = {\n name: normalizedName,\n created_at: createdAt,\n updated_at: now,\n options: nextOptions,\n };\n await fs.mkdir(templatesDirectory(pmRoot), { recursive: true });\n await writeFileAtomic(storedPath, `${JSON.stringify(document, null, 2)}\\n`);\n return {\n name: document.name,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: storedPath,\n options: document.options,\n };\n}\n\nasync function readUserTemplateNames(pmRoot: string): Promise<string[]> {\n const dirPath = templatesDirectory(pmRoot);\n if (!(await pathExists(dirPath))) {\n return [];\n }\n const entries = await fs.readdir(dirPath);\n return entries\n .filter((entry) => entry.toLowerCase().endsWith(TEMPLATE_FILE_EXTENSION))\n .map((entry) => entry.slice(0, -TEMPLATE_FILE_EXTENSION.length))\n .filter((entry) => TEMPLATE_NAME_PATTERN.test(entry));\n}\n\n/**\n * Implements run templates list for the public runtime surface of this module.\n */\nexport async function runTemplatesList(global: GlobalOptions): Promise<TemplatesListResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const userTemplates = await readUserTemplateNames(pmRoot);\n const userTemplateSet = new Set<string>(userTemplates);\n const builtinTemplates = Object.keys(BUILTIN_TEMPLATES).filter((name) => !userTemplateSet.has(name));\n const sortedUser = [...userTemplates].sort((left, right) => left.localeCompare(right));\n const sortedBuiltin = [...builtinTemplates].sort((left, right) => left.localeCompare(right));\n const templates = [...new Set([...sortedUser, ...sortedBuiltin])].sort((left, right) => left.localeCompare(right));\n return {\n templates,\n count: templates.length,\n builtin_templates: sortedBuiltin,\n user_templates: sortedUser,\n };\n}\n\n/**\n * Implements run templates show for the public runtime surface of this module.\n */\nexport async function runTemplatesShow(rawTemplateName: string, global: GlobalOptions): Promise<TemplatesShowResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document, source } = await resolveTemplateDocument(pmRoot, normalizedName);\n return {\n name: document.name,\n source,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: source === \"builtin\" ? `builtin:${normalizedName}` : templatePath(pmRoot, normalizedName),\n options: document.options,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;AAWjB,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAE9B,IAAM,kCAAkC,6CAA6C,IAAI,CAAC,UAAU,MAAM,MAAM;AAChH,IAAM,qCAAqC,IAAI,IAAY,+BAA+B;AAY1F,IAAM,6BAA6B;AACnC,IAAM,oBAAqE;EACzE,KAAK;IACH,MAAM;IACN,UAAU;IACV,MAAM;IACN,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,MAAM;;EAER,SAAS;IACP,MAAM;IACN,UAAU;IACV,MAAM;IACN,oBAAoB;IACpB,QAAQ;IACR,MAAM;;EAER,OAAO;IACL,MAAM;IACN,UAAU;IACV,MAAM;IACN,kBAAkB;IAClB,oBAAoB;IACpB,MAAM;;EAER,OAAO;IACL,MAAM;IACN,UAAU;IACV,MAAM;IACN,oBAAoB;IACpB,MAAM;;;AAoDV,SAAS,sBAAsB,SAAe;AAC5C,QAAM,OAAO,QAAQ,KAAI;AACzB,MAAI,CAAC,sBAAsB,KAAK,IAAI,GAAG;AACrC,UAAM,IAAI,WACR,0BAA0B,OAAO,oEACjC,UAAU,KAAK;EAEnB;AACA,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,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AACrF,QAAM,gBAAgB,CAAC,GAAG,gBAAgB,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAC3F,QAAM,YAAY,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AACjH,SAAO;IACL;IACA,OAAO,UAAU;IACjB,mBAAmB;IACnB,gBAAgB;;AAEpB;AAKA,eAAsB,iBAAiB,iBAAyBA,SAAqB;AACnF,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAIA,QAAO,IAAI;AACvD,QAAM,yBAAyB,MAAM;AACrC,QAAM,iBAAiB,sBAAsB,eAAe;AAC5D,QAAM,EAAE,UAAU,OAAM,IAAK,MAAM,wBAAwB,QAAQ,cAAc;AACjF,SAAO;IACL,MAAM,SAAS;IACf;IACA,YAAY,SAAS;IACrB,YAAY,SAAS;IACrB,MAAM,WAAW,YAAY,WAAW,cAAc,KAAK,aAAa,QAAQ,cAAc;IAC9F,SAAS,SAAS;;AAEtB;",
6
- "names": ["global"]
7
- }
@@ -1,231 +0,0 @@
1
- import {
2
- PmCliError
3
- } from "./chunk-P5YORJRH.js";
4
- import {
5
- evictOldestMemoEntries
6
- } from "./chunk-7C2O74AE.js";
7
- import {
8
- EXIT_CODE
9
- } from "./chunk-5VVUKE3U.js";
10
-
11
- // dist/core/shared/time.js
12
- !(function() {
13
- try {
14
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
15
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e10e1e6b-1d12-59cc-86e8-3e9c6415782a");
16
- } catch (e2) {
17
- }
18
- })();
19
- var RELATIVE_DEADLINE = /^([+-]?)(\d+)([hdwm])$/i;
20
- var COMPOUND_RELATIVE_DEADLINE = /^[+-]?\d+[hdwm](?:[+-]\d+[hdwm])+$/i;
21
- var COMPACT_DATE = /^(\d{4})(\d{2})(\d{2})$/;
22
- var COMPACT_DATETIME = /^(\d{4})(\d{2})(\d{2})(?:[T\s]?)(\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i;
23
- var HYPHEN_TIME = /^(\d{4}-\d{2}-\d{2})[T\s](\d{2})-(\d{2})(?:-(\d{2}))?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i;
24
- var COMPACT_TIME = /^(\d{4}-\d{2}-\d{2})[T\s](\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i;
25
- function nowIso() {
26
- return (/* @__PURE__ */ new Date()).toISOString();
27
- }
28
- function isTimestampLiteral(input) {
29
- return Number.isFinite(Date.parse(input));
30
- }
31
- var TIMESTAMP_PARSE_MEMO_MAX_ENTRIES = 1e4;
32
- var timestampParseMemo = /* @__PURE__ */ new Map();
33
- function parseTimestampMsMemoized(value) {
34
- const memoized = timestampParseMemo.get(value);
35
- if (memoized !== void 0) {
36
- return memoized;
37
- }
38
- const parsed = Date.parse(value);
39
- if (timestampParseMemo.size >= TIMESTAMP_PARSE_MEMO_MAX_ENTRIES) {
40
- evictOldestMemoEntries(timestampParseMemo);
41
- }
42
- timestampParseMemo.set(value, parsed);
43
- return parsed;
44
- }
45
- function compareTimestampStrings(left, right) {
46
- const leftMs = parseTimestampMsMemoized(left);
47
- const rightMs = parseTimestampMsMemoized(right);
48
- if (Number.isFinite(leftMs) && Number.isFinite(rightMs) && leftMs !== rightMs) {
49
- return leftMs - rightMs;
50
- }
51
- return left.localeCompare(right);
52
- }
53
- function normalizeFraction(raw) {
54
- if (!raw)
55
- return "";
56
- const digits = raw.slice(1);
57
- return `.${digits.padEnd(3, "0").slice(0, 3)}`;
58
- }
59
- function normalizeOffset(raw) {
60
- if (!raw)
61
- return "";
62
- if (raw.toUpperCase() === "Z")
63
- return "Z";
64
- const compact = /^([+-]\d{2})(\d{2})$/.exec(raw);
65
- if (compact)
66
- return `${compact[1]}:${compact[2]}`;
67
- return raw;
68
- }
69
- function pushTimestampCandidate(candidates, input, value) {
70
- if (!value)
71
- return;
72
- if (value === input)
73
- return;
74
- if (candidates.includes(value))
75
- return;
76
- candidates.push(value);
77
- }
78
- function normalizeTimestampCandidates(input) {
79
- const candidates = [];
80
- const push = (value) => pushTimestampCandidate(candidates, input, value);
81
- const compactDate = COMPACT_DATE.exec(input);
82
- if (compactDate) {
83
- const [, year, month, day] = compactDate;
84
- push(`${year}-${month}-${day}`);
85
- }
86
- const compactDateTime = COMPACT_DATETIME.exec(input);
87
- if (compactDateTime) {
88
- const [, year, month, day, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactDateTime;
89
- const second = secondRaw ? `:${secondRaw}` : "";
90
- push(`${year}-${month}-${day}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);
91
- }
92
- const hyphenTime = HYPHEN_TIME.exec(input);
93
- if (hyphenTime) {
94
- const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = hyphenTime;
95
- const second = secondRaw ? `:${secondRaw}` : "";
96
- push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);
97
- }
98
- const compactTime = COMPACT_TIME.exec(input);
99
- if (compactTime) {
100
- const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactTime;
101
- const second = secondRaw ? `:${secondRaw}` : "";
102
- push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);
103
- }
104
- const datePrefixLength = 10;
105
- const datePrefix = input.slice(0, datePrefixLength);
106
- if (isHyphenDatePrefix(datePrefix)) {
107
- let index = datePrefixLength;
108
- while (index < input.length && isWhitespaceCharacter(input[index])) {
109
- index += 1;
110
- }
111
- if (index < input.length) {
112
- push(`${datePrefix}T${input.slice(index)}`);
113
- }
114
- }
115
- return candidates;
116
- }
117
- function parseTimestampWithFallbacks(input) {
118
- const direct = Date.parse(input);
119
- if (Number.isFinite(direct))
120
- return direct;
121
- for (const candidate of normalizeTimestampCandidates(input)) {
122
- const parsed = Date.parse(candidate);
123
- if (Number.isFinite(parsed))
124
- return parsed;
125
- }
126
- return Number.NaN;
127
- }
128
- function isHyphenDatePrefix(value) {
129
- if (value.length !== 10) {
130
- return false;
131
- }
132
- for (let index = 0; index < value.length; index += 1) {
133
- const character = value[index];
134
- if (index === 4 || index === 7) {
135
- if (character !== "-") {
136
- return false;
137
- }
138
- continue;
139
- }
140
- const code = character.charCodeAt(0);
141
- if (code < 48 || code > 57) {
142
- return false;
143
- }
144
- }
145
- return true;
146
- }
147
- function isWhitespaceCharacter(character) {
148
- if (!character) {
149
- return false;
150
- }
151
- return character === " " || character === " " || character === "\n" || character === "\r" || character === "\f" || character === "\v";
152
- }
153
- function daysInUtcMonth(year, monthIndex) {
154
- return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();
155
- }
156
- var MONTH_NAMES = [
157
- "January",
158
- "February",
159
- "March",
160
- "April",
161
- "May",
162
- "June",
163
- "July",
164
- "August",
165
- "September",
166
- "October",
167
- "November",
168
- "December"
169
- ];
170
- var LEADING_HYPHEN_DATE = /^(\d{4})-(\d{2})-(\d{2})/;
171
- var LEADING_COMPACT_DATE = /^(\d{4})(\d{2})(\d{2})(?:[T ]?\d{2}|$)/;
172
- function assertRealCalendarDate(originalInput, trimmed, fieldLabel) {
173
- const match = LEADING_HYPHEN_DATE.exec(trimmed) ?? LEADING_COMPACT_DATE.exec(trimmed);
174
- if (!match) {
175
- return;
176
- }
177
- const year = Number.parseInt(match[1], 10);
178
- const month = Number.parseInt(match[2], 10);
179
- const day = Number.parseInt(match[3], 10);
180
- const label = fieldLabel?.trim() || "deadline";
181
- if (month < 1 || month > 12) {
182
- throw new PmCliError(`Invalid ${label} value "${originalInput}". Month "${match[2]}" is out of range \u2014 use a month between 01 and 12.`, EXIT_CODE.USAGE);
183
- }
184
- const maxDay = daysInUtcMonth(year, month - 1);
185
- if (day < 1 || day > maxDay) {
186
- throw new PmCliError(`Invalid ${label} value "${originalInput}". ${MONTH_NAMES[month - 1]} ${year} has ${maxDay} days, so day "${match[3]}" does not exist. Use a real YYYY-MM-DD calendar date.`, EXIT_CODE.USAGE);
187
- }
188
- }
189
- function addUtcMonths(now, amount) {
190
- const result = new Date(now.getTime());
191
- const startDay = result.getUTCDate();
192
- const targetMonthIndex = result.getUTCMonth() + amount;
193
- const targetYear = result.getUTCFullYear() + Math.floor(targetMonthIndex / 12);
194
- const targetMonth = (targetMonthIndex % 12 + 12) % 12;
195
- const day = Math.min(startDay, daysInUtcMonth(targetYear, targetMonth));
196
- result.setUTCFullYear(targetYear, targetMonth, day);
197
- return result;
198
- }
199
- function resolveIsoOrRelative(input, now = /* @__PURE__ */ new Date(), fieldLabel = "deadline") {
200
- const trimmed = input.trim();
201
- if (trimmed.toLowerCase() === "now") {
202
- return now.toISOString();
203
- }
204
- const relative = RELATIVE_DEADLINE.exec(trimmed);
205
- if (relative) {
206
- const sign = relative[1] === "-" ? -1 : 1;
207
- const amount = Number.parseInt(relative[2], 10) * sign;
208
- const unit = relative[3].toLowerCase();
209
- if (unit === "m") {
210
- return addUtcMonths(now, amount).toISOString();
211
- }
212
- const msPerUnit = unit === "h" ? 60 * 60 * 1e3 : unit === "d" ? 24 * 60 * 60 * 1e3 : 7 * 24 * 60 * 60 * 1e3;
213
- return new Date(now.getTime() + amount * msPerUnit).toISOString();
214
- }
215
- assertRealCalendarDate(input, trimmed, fieldLabel);
216
- const timestamp = parseTimestampWithFallbacks(trimmed);
217
- if (!Number.isFinite(timestamp)) {
218
- const normalizedLabel = fieldLabel.trim().length > 0 ? fieldLabel.trim() : "deadline";
219
- const guidance = COMPOUND_RELATIVE_DEADLINE.test(trimmed) ? "Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string." : 'Use ISO/date string input, "now", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';
220
- throw new PmCliError(`Invalid ${normalizedLabel} value "${input}". ${guidance}`, EXIT_CODE.USAGE);
221
- }
222
- return new Date(timestamp).toISOString();
223
- }
224
-
225
- export {
226
- nowIso,
227
- isTimestampLiteral,
228
- compareTimestampStrings,
229
- resolveIsoOrRelative
230
- };
231
- //# sourceMappingURL=chunk-DRBV5UC2.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../core/shared/time.ts"],
4
- "sourcesContent": ["/**\n * @module core/shared/time\n *\n * Provides shared primitives and utilities for Time.\n */\nimport { PmCliError } from \"./errors.js\";\nimport { evictOldestMemoEntries } from \"./memo.js\";\nimport { EXIT_CODE } from \"./constants.js\";\n\nconst RELATIVE_DEADLINE = /^([+-]?)(\\d+)([hdwm])$/i;\nconst COMPOUND_RELATIVE_DEADLINE = /^[+-]?\\d+[hdwm](?:[+-]\\d+[hdwm])+$/i;\nconst COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})$/;\nconst COMPACT_DATETIME = /^(\\d{4})(\\d{2})(\\d{2})(?:[T\\s]?)(\\d{2})(\\d{2})(\\d{2})?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\nconst HYPHEN_TIME = /^(\\d{4}-\\d{2}-\\d{2})[T\\s](\\d{2})-(\\d{2})(?:-(\\d{2}))?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\nconst COMPACT_TIME = /^(\\d{4}-\\d{2}-\\d{2})[T\\s](\\d{2})(\\d{2})(\\d{2})?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\n\n/**\n * Implements now iso for the public runtime surface of this module.\n */\nexport function nowIso(): string {\n return new Date().toISOString();\n}\n\n/**\n * Implements check whether timestamp literal for the public runtime surface of this module.\n */\nexport function isTimestampLiteral(input: string): boolean {\n return Number.isFinite(Date.parse(input));\n}\n\n/**\n * Memoized `Date.parse` for {@link compareTimestampStrings}. Sort comparators call it\n * O(n log n) times over a corpus whose timestamp strings repeat heavily, and\n * `Date.parse` is expensive enough to show up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts (the MCP server); half-eviction keeps the\n * newest-inserted half when the cap is hit.\n */\nconst TIMESTAMP_PARSE_MEMO_MAX_ENTRIES = 10_000;\nconst timestampParseMemo = new Map<string, number>();\n\nfunction parseTimestampMsMemoized(value: string): number {\n const memoized = timestampParseMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const parsed = Date.parse(value);\n if (timestampParseMemo.size >= TIMESTAMP_PARSE_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(timestampParseMemo);\n }\n timestampParseMemo.set(value, parsed);\n return parsed;\n}\n\n/**\n * Implements compare timestamp strings for the public runtime surface of this module.\n */\nexport function compareTimestampStrings(left: string, right: string): number {\n const leftMs = parseTimestampMsMemoized(left);\n const rightMs = parseTimestampMsMemoized(right);\n if (Number.isFinite(leftMs) && Number.isFinite(rightMs) && leftMs !== rightMs) {\n return leftMs - rightMs;\n }\n return left.localeCompare(right);\n}\n\nfunction normalizeFraction(raw: string | undefined): string {\n if (!raw) return \"\";\n const digits = raw.slice(1);\n return `.${digits.padEnd(3, \"0\").slice(0, 3)}`;\n}\n\nfunction normalizeOffset(raw: string | undefined): string {\n if (!raw) return \"\";\n if (raw.toUpperCase() === \"Z\") return \"Z\";\n const compact = /^([+-]\\d{2})(\\d{2})$/.exec(raw);\n if (compact) return `${compact[1]}:${compact[2]}`;\n return raw;\n}\n\nfunction pushTimestampCandidate(candidates: string[], input: string, value: string | undefined): void {\n if (!value) return;\n if (value === input) return;\n if (candidates.includes(value)) return;\n candidates.push(value);\n}\n\nfunction normalizeTimestampCandidates(input: string): string[] {\n const candidates: string[] = [];\n const push = (value: string | undefined): void => pushTimestampCandidate(candidates, input, value);\n\n const compactDate = COMPACT_DATE.exec(input);\n if (compactDate) {\n const [, year, month, day] = compactDate;\n push(`${year}-${month}-${day}`);\n }\n\n const compactDateTime = COMPACT_DATETIME.exec(input);\n if (compactDateTime) {\n const [, year, month, day, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactDateTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(\n `${year}-${month}-${day}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`,\n );\n }\n\n const hyphenTime = HYPHEN_TIME.exec(input);\n if (hyphenTime) {\n const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = hyphenTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);\n }\n\n const compactTime = COMPACT_TIME.exec(input);\n if (compactTime) {\n const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);\n }\n\n const datePrefixLength = 10;\n const datePrefix = input.slice(0, datePrefixLength);\n if (isHyphenDatePrefix(datePrefix)) {\n let index = datePrefixLength;\n while (index < input.length && isWhitespaceCharacter(input[index])) {\n index += 1;\n }\n if (index < input.length) {\n push(`${datePrefix}T${input.slice(index)}`);\n }\n }\n\n return candidates;\n}\n\nfunction parseTimestampWithFallbacks(input: string): number {\n const direct = Date.parse(input);\n if (Number.isFinite(direct)) return direct;\n for (const candidate of normalizeTimestampCandidates(input)) {\n const parsed = Date.parse(candidate);\n if (Number.isFinite(parsed)) return parsed;\n }\n return Number.NaN;\n}\n\nfunction isHyphenDatePrefix(value: string): boolean {\n if (value.length !== 10) {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index];\n if (index === 4 || index === 7) {\n if (character !== \"-\") {\n return false;\n }\n continue;\n }\n const code = character.charCodeAt(0);\n if (code < 48 || code > 57) {\n return false;\n }\n }\n return true;\n}\n\nfunction isWhitespaceCharacter(character: string | undefined): boolean {\n if (!character) {\n return false;\n }\n return (\n character === \" \" ||\n character === \"\\t\" ||\n character === \"\\n\" ||\n character === \"\\r\" ||\n character === \"\\f\" ||\n character === \"\\v\"\n );\n}\n\nfunction daysInUtcMonth(year: number, monthIndex: number): number {\n return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();\n}\n\nconst MONTH_NAMES = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n] as const;\n\n// Leading literal calendar date in either hyphenated (`2026-02-30`) or compact\n// (`20260230`) form, optionally followed by any time/zone component. We validate\n// the digits the caller actually typed — not the parsed instant — so timezone\n// offsets never produce a false \"impossible date\" rejection. The hyphenated form\n// is unambiguous, so anything may follow (`T`/space time, `Z`, `+/-` offset). The\n// compact form must be followed by end-of-string or a time digit (with an optional\n// `T`/space separator) so a no-separator compact datetime like `20260230135900Z`\n// is still guarded and a 7-digit non-date is not misread as a date.\nconst LEADING_HYPHEN_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})/;\nconst LEADING_COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})(?:[T ]?\\d{2}|$)/;\n\n/**\n * Reject literal calendar dates whose day cannot exist (e.g. `2026-02-30`, which JS\n * `Date` silently rolls forward to March 2). Without this, agents that pass an\n * impossible deadline get a silently-wrong stored date instead of an actionable\n * error. Only triggers on a leading literal date; relative tokens, \"now\", and pure\n * times are untouched. Month 00 / >12 is also rejected with a clear message rather\n * than falling through to the generic \"invalid value\" path.\n */\nfunction assertRealCalendarDate(originalInput: string, trimmed: string, fieldLabel: string): void {\n const match = LEADING_HYPHEN_DATE.exec(trimmed) ?? LEADING_COMPACT_DATE.exec(trimmed);\n if (!match) {\n return;\n }\n const year = Number.parseInt(match[1], 10);\n const month = Number.parseInt(match[2], 10);\n const day = Number.parseInt(match[3], 10);\n const label = fieldLabel?.trim() || \"deadline\";\n if (month < 1 || month > 12) {\n throw new PmCliError(\n `Invalid ${label} value \"${originalInput}\". Month \"${match[2]}\" is out of range — use a month between 01 and 12.`,\n EXIT_CODE.USAGE,\n );\n }\n const maxDay = daysInUtcMonth(year, month - 1);\n if (day < 1 || day > maxDay) {\n throw new PmCliError(\n `Invalid ${label} value \"${originalInput}\". ${MONTH_NAMES[month - 1]} ${year} has ${maxDay} days, so day \"${match[3]}\" does not exist. Use a real YYYY-MM-DD calendar date.`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction addUtcMonths(now: Date, amount: number): Date {\n const result = new Date(now.getTime());\n const startDay = result.getUTCDate();\n const targetMonthIndex = result.getUTCMonth() + amount;\n const targetYear = result.getUTCFullYear() + Math.floor(targetMonthIndex / 12);\n const targetMonth = ((targetMonthIndex % 12) + 12) % 12;\n const day = Math.min(startDay, daysInUtcMonth(targetYear, targetMonth));\n result.setUTCFullYear(targetYear, targetMonth, day);\n return result;\n}\n\n/**\n * Implements resolve iso or relative for the public runtime surface of this module.\n */\nexport function resolveIsoOrRelative(\n input: string,\n now: Date = new Date(),\n fieldLabel = \"deadline\",\n): string {\n const trimmed = input.trim();\n if (trimmed.toLowerCase() === \"now\") {\n return now.toISOString();\n }\n const relative = RELATIVE_DEADLINE.exec(trimmed);\n if (relative) {\n const sign = relative[1] === \"-\" ? -1 : 1;\n const amount = Number.parseInt(relative[2], 10) * sign;\n const unit = relative[3].toLowerCase();\n if (unit === \"m\") {\n return addUtcMonths(now, amount).toISOString();\n }\n const msPerUnit = unit === \"h\" ? 60 * 60 * 1000 : unit === \"d\" ? 24 * 60 * 60 * 1000 : 7 * 24 * 60 * 60 * 1000;\n return new Date(now.getTime() + amount * msPerUnit).toISOString();\n }\n\n assertRealCalendarDate(input, trimmed, fieldLabel);\n\n const timestamp = parseTimestampWithFallbacks(trimmed);\n if (!Number.isFinite(timestamp)) {\n const normalizedLabel = fieldLabel.trim().length > 0 ? fieldLabel.trim() : \"deadline\";\n const guidance = COMPOUND_RELATIVE_DEADLINE.test(trimmed)\n ? \"Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string.\"\n : 'Use ISO/date string input, \"now\", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';\n throw new PmCliError(\n `Invalid ${normalizedLabel} value \"${input}\". ${guidance}`,\n EXIT_CODE.USAGE,\n );\n }\n return new Date(timestamp).toISOString();\n}\n\nexport const _testOnly = {\n normalizeOffset,\n pushTimestampCandidate,\n normalizeTimestampCandidates,\n parseTimestampWithFallbacks,\n isWhitespaceCharacter,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AASA,IAAM,oBAAoB;AAC1B,IAAM,6BAA6B;AACnC,IAAM,eAAe;AACrB,IAAM,mBAAmB;AACzB,IAAM,cAAc;AACpB,IAAM,eAAe;AAKf,SAAU,SAAM;AACpB,UAAO,oBAAI,KAAI,GAAG,YAAW;AAC/B;AAKM,SAAU,mBAAmB,OAAa;AAC9C,SAAO,OAAO,SAAS,KAAK,MAAM,KAAK,CAAC;AAC1C;AASA,IAAM,mCAAmC;AACzC,IAAM,qBAAqB,oBAAI,IAAG;AAElC,SAAS,yBAAyB,OAAa;AAC7C,QAAM,WAAW,mBAAmB,IAAI,KAAK;AAC7C,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,SAAS,KAAK,MAAM,KAAK;AAC/B,MAAI,mBAAmB,QAAQ,kCAAkC;AAC/D,2BAAuB,kBAAkB;EAC3C;AACA,qBAAmB,IAAI,OAAO,MAAM;AACpC,SAAO;AACT;AAKM,SAAU,wBAAwB,MAAc,OAAa;AACjE,QAAM,SAAS,yBAAyB,IAAI;AAC5C,QAAM,UAAU,yBAAyB,KAAK;AAC9C,MAAI,OAAO,SAAS,MAAM,KAAK,OAAO,SAAS,OAAO,KAAK,WAAW,SAAS;AAC7E,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