@unbrained/pm-cli 2026.6.5 → 2026.6.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 (596) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +17 -5
  4. package/dist/cli/commander-usage.js +74 -4
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/aggregate.d.ts +8 -0
  7. package/dist/cli/commands/aggregate.js +84 -7
  8. package/dist/cli/commands/aggregate.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +10 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.js +13 -10
  12. package/dist/cli/commands/close-many.js.map +1 -1
  13. package/dist/cli/commands/close.d.ts +1 -1
  14. package/dist/cli/commands/close.js +20 -10
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/completion.js +87 -18
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +5 -4
  19. package/dist/cli/commands/config.js +50 -2
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/contracts.js +6 -3
  22. package/dist/cli/commands/contracts.js.map +1 -1
  23. package/dist/cli/commands/copy.d.ts +14 -0
  24. package/dist/cli/commands/copy.js +153 -0
  25. package/dist/cli/commands/copy.js.map +1 -0
  26. package/dist/cli/commands/extension/doctor.js +62 -2
  27. package/dist/cli/commands/extension/doctor.js.map +1 -1
  28. package/dist/cli/commands/extension/install-sources.d.ts +8 -0
  29. package/dist/cli/commands/extension/install-sources.js +82 -2
  30. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  31. package/dist/cli/commands/extension.d.ts +29 -0
  32. package/dist/cli/commands/extension.js +61 -2
  33. package/dist/cli/commands/extension.js.map +1 -1
  34. package/dist/cli/commands/gc.d.ts +8 -1
  35. package/dist/cli/commands/gc.js +26 -3
  36. package/dist/cli/commands/gc.js.map +1 -1
  37. package/dist/cli/commands/get.d.ts +9 -0
  38. package/dist/cli/commands/get.js +23 -2
  39. package/dist/cli/commands/get.js.map +1 -1
  40. package/dist/cli/commands/health.js +15 -2
  41. package/dist/cli/commands/health.js.map +1 -1
  42. package/dist/cli/commands/history-compact.d.ts +39 -0
  43. package/dist/cli/commands/history-compact.js +262 -0
  44. package/dist/cli/commands/history-compact.js.map +1 -0
  45. package/dist/cli/commands/history.d.ts +4 -1
  46. package/dist/cli/commands/history.js +12 -24
  47. package/dist/cli/commands/history.js.map +1 -1
  48. package/dist/cli/commands/index.d.ts +3 -0
  49. package/dist/cli/commands/index.js +5 -2
  50. package/dist/cli/commands/index.js.map +1 -1
  51. package/dist/cli/commands/list.d.ts +2 -0
  52. package/dist/cli/commands/list.js +87 -9
  53. package/dist/cli/commands/list.js.map +1 -1
  54. package/dist/cli/commands/reindex.js +8 -4
  55. package/dist/cli/commands/reindex.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +1 -0
  57. package/dist/cli/commands/search.js +232 -35
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/stats.d.ts +8 -1
  60. package/dist/cli/commands/stats.js +18 -17
  61. package/dist/cli/commands/stats.js.map +1 -1
  62. package/dist/cli/commands/telemetry.d.ts +8 -0
  63. package/dist/cli/commands/telemetry.js +253 -0
  64. package/dist/cli/commands/telemetry.js.map +1 -0
  65. package/dist/cli/error-guidance.js +26 -2
  66. package/dist/cli/error-guidance.js.map +1 -1
  67. package/dist/cli/extension-command-help.d.ts +1 -0
  68. package/dist/cli/extension-command-help.js +3 -2
  69. package/dist/cli/extension-command-help.js.map +1 -1
  70. package/dist/cli/help-content.js +19 -2
  71. package/dist/cli/help-content.js.map +1 -1
  72. package/dist/cli/main.d.ts +3 -0
  73. package/dist/cli/main.js +13 -21
  74. package/dist/cli/main.js.map +1 -1
  75. package/dist/cli/register-list-query.js +24 -6
  76. package/dist/cli/register-list-query.js.map +1 -1
  77. package/dist/cli/register-mutation.js +52 -17
  78. package/dist/cli/register-mutation.js.map +1 -1
  79. package/dist/cli/register-operations.js +55 -8
  80. package/dist/cli/register-operations.js.map +1 -1
  81. package/dist/cli/register-setup.js +5 -5
  82. package/dist/cli/register-setup.js.map +1 -1
  83. package/dist/cli/registration-helpers.js +21 -3
  84. package/dist/cli/registration-helpers.js.map +1 -1
  85. package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +16 -0
  86. package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-YVB3QRTE.js} +11 -11
  87. package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-LH66F75F.js} +87 -17
  88. package/dist/cli-bundle/chunks/aggregate-LH66F75F.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-OHSWFQJM.js} +88 -18
  90. package/dist/cli-bundle/chunks/aggregate-OHSWFQJM.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-2PPYFAG5.js} +8 -8
  92. package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-AUGT5W6J.js} +8 -8
  93. package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-2IF7WLB7.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-2IXCHCLM.js} +5 -6
  95. package/dist/cli-bundle/chunks/chunk-2IXCHCLM.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-2OJHLWBZ.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-3A2CMEM7.js} +5 -4
  98. package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-3EOBJOF4.js} +5 -4
  99. package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-42LOFGJS.js} +91 -16
  100. package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +7 -0
  101. package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-4CHEG6UK.js} +108 -21
  102. package/dist/cli-bundle/chunks/chunk-4CHEG6UK.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4GHZR3BA.js} +56 -28
  104. package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +1 -0
  105. package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-5AXMRKN5.js} +8 -8
  106. package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-6J4K6JLA.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-6RZXO5M2.js} +102 -22
  108. package/dist/cli-bundle/chunks/chunk-6RZXO5M2.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-AVJD6VTA.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-B2KZGPM2.js} +39 -8
  111. package/dist/cli-bundle/chunks/chunk-B2KZGPM2.js.map +1 -0
  112. package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-B5RF3IP7.js} +3 -3
  113. package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-C5W2UH56.js} +3 -3
  114. package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-CKLBZHS7.js} +6 -6
  115. package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-CLD3XNCH.js} +124 -20
  116. package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-FHHBD7PN.js} +38 -7
  118. package/dist/cli-bundle/chunks/chunk-FHHBD7PN.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-FY6Z3FYY.js} +3 -3
  120. package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-GNIUOLZ2.js} +7 -7
  121. package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-GPXQBR3H.js} +12 -12
  122. package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-GUZBNB3G.js} +27 -5
  123. package/dist/cli-bundle/chunks/chunk-GUZBNB3G.js.map +1 -0
  124. package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-H7EO3QA3.js} +5 -5
  125. package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-HLC3KTLP.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-HMMMWBK2.js} +2 -2
  127. package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-HRMHZ4RV.js} +26 -4
  128. package/dist/cli-bundle/chunks/chunk-HRMHZ4RV.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-HV5SSZXF.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-IMCJBN2Q.js} +23 -14
  131. package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-KNGVP5WJ.js} +3 -3
  133. package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-KR6R465K.js} +304 -215
  134. package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +7 -0
  135. package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-LI65XLJR.js} +8 -8
  136. package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-LIN2BPJ7.js} +2 -2
  137. package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js +112 -0
  138. package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-LQHBENVW.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-LXO6V66E.js} +14 -14
  141. package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-M2PW7EZU.js} +26 -7
  142. package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-MOYM2C3J.js} +9 -9
  144. package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-MWRS7Z4P.js} +127 -23
  145. package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +7 -0
  146. package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-NHR2QXXZ.js} +24 -15
  147. package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +1 -0
  148. package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-NQL32HQ5.js} +12 -12
  149. package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-O7HSSFCC.js} +65 -16
  150. package/dist/cli-bundle/chunks/chunk-O7HSSFCC.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-OKSKJKHX.js} +9 -9
  152. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js +1572 -0
  153. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +1 -0
  154. package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-R3V3YCMH.js} +9 -9
  155. package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-RVPTZKBC.js} +9 -9
  156. package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-SFFVGNHC.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-SQPKRA54.js} +14 -14
  158. package/dist/cli-bundle/chunks/chunk-THDEID2Z.js +115 -0
  159. package/dist/cli-bundle/chunks/chunk-THDEID2Z.js.map +7 -0
  160. package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-TINUJMWN.js} +92 -17
  161. package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-TNPBPNII.js} +7 -7
  163. package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-TP4DDY27.js} +6 -6
  164. package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-TYJJOTUA.js} +6 -6
  165. package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-UAQOQ7IE.js} +2 -2
  166. package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-UEWA73ZZ.js} +5 -5
  167. package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-UIIQC5YO.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-UJUT6AHZ.js} +314 -39
  169. package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +7 -0
  170. package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-UT6WFXW2.js} +6 -7
  171. package/dist/cli-bundle/chunks/chunk-UT6WFXW2.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-UYQ7HXH4.js} +10 -6
  173. package/dist/cli-bundle/chunks/chunk-UYQ7HXH4.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-V6EYFTRL.js} +7 -7
  175. package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-WAA7UI6M.js} +58 -30
  176. package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +7 -0
  177. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-WCQZBDDH.js} +10 -6
  178. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-WCQZBDDH.js.map} +2 -2
  179. package/dist/cli-bundle/chunks/chunk-WR5567FH.js +1582 -0
  180. package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-WYEXLDDY.js} +3 -3
  182. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-X4IZKYHP.js} +307 -32
  183. package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-X7UHMKPE.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-XS3O2TFJ.js} +27 -8
  186. package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-XYNT7UFP.js} +303 -207
  188. package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-YBZW2QQ7.js} +6 -6
  190. package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-YO3THIJF.js} +7 -7
  191. package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-YPH4ESA2.js} +66 -17
  192. package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-BJ4QMPJC.js} +10 -10
  194. package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-KW743OSW.js} +10 -10
  195. package/dist/cli-bundle/chunks/close-P4ZBKODL.js +13 -0
  196. package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-SYHSRZDC.js} +8 -8
  197. package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-DBLEYFOY.js} +29 -26
  198. package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +7 -0
  199. package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-LAC5VR4G.js} +30 -27
  200. package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +1 -0
  201. package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-JEO6HHVM.js} +10 -10
  202. package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-YT2PQ5DD.js} +10 -10
  203. package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-RZRVS3ZV.js} +127 -11
  204. package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-YJSAAADD.js} +128 -12
  206. package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +7 -0
  207. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-LGYEEKAW.js} +14 -14
  208. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-LGYEEKAW.js.map} +2 -2
  209. package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-ZUH5IOOI.js} +15 -15
  210. package/dist/cli-bundle/chunks/context-ZUH5IOOI.js.map +1 -0
  211. package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-YXJ6NXKH.js} +11 -5
  212. package/dist/cli-bundle/chunks/contracts-YXJ6NXKH.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-ZIBXROPE.js} +12 -6
  214. package/dist/cli-bundle/chunks/contracts-ZIBXROPE.js.map +1 -0
  215. package/dist/cli-bundle/chunks/copy-BZALX5MQ.js +182 -0
  216. package/dist/cli-bundle/chunks/copy-BZALX5MQ.js.map +1 -0
  217. package/dist/cli-bundle/chunks/copy-YPWEIAPD.js +185 -0
  218. package/dist/cli-bundle/chunks/copy-YPWEIAPD.js.map +7 -0
  219. package/dist/cli-bundle/chunks/create-4DS2QWQC.js +27 -0
  220. package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-CF7EVRX7.js} +13 -13
  221. package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-KR4VBWVE.js} +7 -7
  222. package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-XLZRTRKR.js} +7 -7
  223. package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-2YTXD3VM.js} +7 -7
  224. package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-GZMFMTGS.js} +7 -7
  225. package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-SLROFEQ4.js} +9 -9
  226. package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-ZHISRR2D.js} +9 -9
  227. package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-3C7OOI4F.js} +8 -6
  228. package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-XYCUXICD.js} +8 -6
  229. package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-FUWF2FYJ.js} +9 -9
  230. package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-J4I5IU4O.js} +9 -9
  231. package/dist/cli-bundle/chunks/gc-34NXSNSN.js +362 -0
  232. package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +1 -0
  233. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js +372 -0
  234. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +7 -0
  235. package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-SZKNRHMA.js} +34 -12
  236. package/dist/cli-bundle/chunks/get-SZKNRHMA.js.map +1 -0
  237. package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-VITKYP6S.js} +33 -11
  238. package/dist/cli-bundle/chunks/get-VITKYP6S.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-4SNTA2TF.js} +27 -13
  240. package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-7G3EPM57.js} +28 -14
  242. package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +1 -0
  243. package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-SDAWYZR3.js} +10 -10
  244. package/dist/cli-bundle/chunks/history-YDUEILKP.js +20 -0
  245. package/dist/cli-bundle/chunks/history-compact-DMW536VH.js +287 -0
  246. package/dist/cli-bundle/chunks/history-compact-DMW536VH.js.map +1 -0
  247. package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js +290 -0
  248. package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js.map +7 -0
  249. package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-EPJ7GENL.js} +11 -11
  250. package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +19 -0
  251. package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-IJ7LLBET.js} +11 -11
  252. package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-YNESJRT6.js} +11 -11
  253. package/dist/cli-bundle/chunks/init-IGSS4GNH.js +17 -0
  254. package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-YHVBTEET.js} +9 -8
  255. package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-4YBMIVCZ.js} +10 -10
  256. package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-T4PF24YN.js} +10 -10
  257. package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-3KEVBOYW.js} +10 -10
  258. package/dist/cli-bundle/chunks/list-E44O2K64.js +20 -0
  259. package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-FLUCNJSH.js} +10 -10
  260. package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-GJKALVZM.js} +10 -10
  261. package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-T5MMZLI3.js} +13 -13
  262. package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-YYMIL3HV.js} +13 -13
  263. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-I65EZ3HB.js} +33 -27
  264. package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +1 -0
  265. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-OECMHO4G.js} +32 -26
  266. package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +7 -0
  267. package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-2FLXORLR.js} +65 -47
  268. package/dist/cli-bundle/chunks/register-mutation-2FLXORLR.js.map +1 -0
  269. package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-5GPDEKHR.js} +64 -46
  270. package/dist/cli-bundle/chunks/register-mutation-5GPDEKHR.js.map +7 -0
  271. package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-BNGAUMGK.js} +71 -35
  272. package/dist/cli-bundle/chunks/register-operations-BNGAUMGK.js.map +1 -0
  273. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-GQKT35H5.js} +70 -34
  274. package/dist/cli-bundle/chunks/register-operations-GQKT35H5.js.map +7 -0
  275. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-DNDCGZ4O.js} +18 -18
  276. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-DNDCGZ4O.js.map} +1 -1
  277. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-EJY44FPH.js} +17 -17
  278. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-EJY44FPH.js.map} +2 -2
  279. package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-DDJGVZIN.js} +11 -11
  280. package/dist/cli-bundle/chunks/restore-SJSASGZP.js +17 -0
  281. package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-B7NQ6XVP.js} +8 -8
  282. package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-HEGYH6CE.js} +8 -8
  283. package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-DVVQ4UO2.js} +421 -42
  284. package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +1 -0
  285. package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-JNEZJV7H.js} +427 -41
  286. package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +7 -0
  287. package/dist/cli-bundle/chunks/stats-7JDIJRDH.js +202 -0
  288. package/dist/cli-bundle/chunks/stats-7JDIJRDH.js.map +1 -0
  289. package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js +212 -0
  290. package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js.map +7 -0
  291. package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js +251 -0
  292. package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js.map +7 -0
  293. package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js +248 -0
  294. package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js.map +1 -0
  295. package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-IIELLSZX.js} +14 -13
  296. package/dist/cli-bundle/chunks/test-ML5RLWXE.js +32 -0
  297. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-7DNCMML7.js} +14 -13
  298. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-7DNCMML7.js.map} +1 -1
  299. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-IHTUJRRC.js} +16 -15
  300. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-IHTUJRRC.js.map} +1 -1
  301. package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-5FEMBV3A.js} +5 -5
  302. package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-RNKZ37PS.js} +5 -5
  303. package/dist/cli-bundle/chunks/update-6C67X4KS.js +21 -0
  304. package/dist/cli-bundle/chunks/update-VF26YPT3.js +25 -0
  305. package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-BSZZZYXY.js} +22 -22
  306. package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-BWKJJEBF.js} +22 -22
  307. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-RSE5PC44.js} +7 -6
  308. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-RSE5PC44.js.map} +1 -1
  309. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-YWI5DJFA.js} +5 -4
  310. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-YWI5DJFA.js.map} +1 -1
  311. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-NK3WKB7C.js} +18 -17
  312. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-NK3WKB7C.js.map} +1 -1
  313. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-UCEOB7S6.js} +20 -19
  314. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-UCEOB7S6.js.map} +1 -1
  315. package/dist/cli-bundle/main.js +198 -1523
  316. package/dist/cli-bundle/main.js.map +4 -4
  317. package/dist/core/config/nested-settings.d.ts +8 -6
  318. package/dist/core/config/nested-settings.js +71 -5
  319. package/dist/core/config/nested-settings.js.map +1 -1
  320. package/dist/core/config/positional-value.js +4 -2
  321. package/dist/core/config/positional-value.js.map +1 -1
  322. package/dist/core/extensions/extension-types.d.ts +36 -0
  323. package/dist/core/extensions/extension-types.js +2 -2
  324. package/dist/core/extensions/extension-types.js.map +1 -1
  325. package/dist/core/extensions/loader.js +46 -5
  326. package/dist/core/extensions/loader.js.map +1 -1
  327. package/dist/core/history/drift-scan.d.ts +3 -4
  328. package/dist/core/history/drift-scan.js +71 -18
  329. package/dist/core/history/drift-scan.js.map +1 -1
  330. package/dist/core/history/history-diff.d.ts +47 -0
  331. package/dist/core/history/history-diff.js +152 -0
  332. package/dist/core/history/history-diff.js.map +1 -0
  333. package/dist/core/history/history-storage-stats.d.ts +31 -0
  334. package/dist/core/history/history-storage-stats.js +101 -0
  335. package/dist/core/history/history-storage-stats.js.map +1 -0
  336. package/dist/core/item/id.js +4 -5
  337. package/dist/core/item/id.js.map +1 -1
  338. package/dist/core/item/item-format.js +7 -3
  339. package/dist/core/item/item-format.js.map +1 -1
  340. package/dist/core/item/toon-decode.d.ts +7 -0
  341. package/dist/core/item/toon-decode.js +11 -2
  342. package/dist/core/item/toon-decode.js.map +1 -1
  343. package/dist/core/item/type-registry.js +25 -7
  344. package/dist/core/item/type-registry.js.map +1 -1
  345. package/dist/core/lock/lock-gc.d.ts +46 -0
  346. package/dist/core/lock/lock-gc.js +194 -0
  347. package/dist/core/lock/lock-gc.js.map +1 -0
  348. package/dist/core/search/cache.js +5 -3
  349. package/dist/core/search/cache.js.map +1 -1
  350. package/dist/core/search/corpus.d.ts +6 -0
  351. package/dist/core/search/corpus.js +22 -9
  352. package/dist/core/search/corpus.js.map +1 -1
  353. package/dist/core/search/embedding-batches.js +10 -7
  354. package/dist/core/search/embedding-batches.js.map +1 -1
  355. package/dist/core/search/relevance.d.ts +29 -0
  356. package/dist/core/search/relevance.js +226 -0
  357. package/dist/core/search/relevance.js.map +1 -0
  358. package/dist/core/search/vector-stores.d.ts +3 -0
  359. package/dist/core/search/vector-stores.js +23 -10
  360. package/dist/core/search/vector-stores.js.map +1 -1
  361. package/dist/core/shared/constants.js +15 -2
  362. package/dist/core/shared/constants.js.map +1 -1
  363. package/dist/core/shared/errors.d.ts +6 -0
  364. package/dist/core/shared/errors.js +2 -2
  365. package/dist/core/shared/errors.js.map +1 -1
  366. package/dist/core/shared/primitives.d.ts +8 -0
  367. package/dist/core/shared/primitives.js +29 -2
  368. package/dist/core/shared/primitives.js.map +1 -1
  369. package/dist/core/shared/serial-queue.d.ts +12 -0
  370. package/dist/core/shared/serial-queue.js +43 -0
  371. package/dist/core/shared/serial-queue.js.map +1 -0
  372. package/dist/core/shared/time.js +42 -6
  373. package/dist/core/shared/time.js.map +1 -1
  374. package/dist/core/store/paths.js +25 -7
  375. package/dist/core/store/paths.js.map +1 -1
  376. package/dist/core/store/settings-validator.d.ts +11 -0
  377. package/dist/core/store/settings-validator.js +14 -2
  378. package/dist/core/store/settings-validator.js.map +1 -1
  379. package/dist/core/store/settings.d.ts +19 -1
  380. package/dist/core/store/settings.js +199 -17
  381. package/dist/core/store/settings.js.map +1 -1
  382. package/dist/core/telemetry/observability.js +3 -3
  383. package/dist/core/telemetry/observability.js.map +1 -1
  384. package/dist/core/telemetry/runtime.js +99 -6
  385. package/dist/core/telemetry/runtime.js.map +1 -1
  386. package/dist/mcp/server.d.ts +1 -0
  387. package/dist/mcp/server.js +187 -42
  388. package/dist/mcp/server.js.map +1 -1
  389. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  390. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  391. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  392. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  393. package/dist/sdk/cli-contracts/enum-contracts.js +8 -2
  394. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  395. package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
  396. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  397. package/dist/sdk/cli-contracts/tool-parameter-tables.js +39 -7
  398. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  399. package/dist/sdk/cli-contracts.d.ts +26 -1
  400. package/dist/sdk/cli-contracts.js +75 -11
  401. package/dist/sdk/cli-contracts.js.map +1 -1
  402. package/dist/sdk/index.d.ts +2 -2
  403. package/dist/sdk/index.js +3 -3
  404. package/dist/sdk/index.js.map +1 -1
  405. package/dist/sdk/testing.d.ts +51 -1
  406. package/dist/sdk/testing.js +93 -2
  407. package/dist/sdk/testing.js.map +1 -1
  408. package/dist/types.d.ts +14 -0
  409. package/dist/types.js +2 -2
  410. package/dist/types.js.map +1 -1
  411. package/docs/AGENT_GUIDE.md +1 -1
  412. package/docs/ARCHITECTURE.md +11 -1
  413. package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
  414. package/docs/CODEX_PLUGIN.md +1 -1
  415. package/docs/COMMANDS.md +42 -4
  416. package/docs/CONFIGURATION.md +31 -2
  417. package/docs/EXTENSIONS.md +28 -8
  418. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  419. package/docs/ONBOARDING.md +165 -0
  420. package/docs/QUICKSTART.md +2 -2
  421. package/docs/README.md +12 -4
  422. package/docs/RELEASING.md +36 -1
  423. package/docs/SDK.md +66 -0
  424. package/docs/TESTING.md +33 -1
  425. package/package.json +6 -2
  426. package/packages/pm-governance-audit/README.md +14 -0
  427. package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
  428. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
  429. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
  430. package/packages/pm-governance-audit/package.json +4 -2
  431. package/packages/pm-lifecycle-hooks/README.md +21 -0
  432. package/packages/pm-search-advanced/README.md +38 -0
  433. package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
  434. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
  435. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
  436. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
  437. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  438. package/plugins/pm-claude/README.md +11 -8
  439. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  440. package/plugins/pm-claude/commands/pm-init.md +1 -1
  441. package/plugins/pm-codex/README.md +1 -1
  442. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
  443. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +0 -1
  444. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +0 -7
  461. package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +0 -1
  465. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
  470. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
  471. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +0 -1
  472. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +0 -7
  473. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +0 -7
  474. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +0 -1
  475. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +0 -1
  476. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
  477. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +0 -1
  478. package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
  479. package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
  480. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
  481. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
  482. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
  483. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +0 -7
  484. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +0 -1
  485. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
  486. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
  487. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
  488. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
  489. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
  490. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
  491. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +0 -7
  492. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +0 -1
  493. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +0 -1
  494. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +0 -7
  495. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
  496. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +0 -7
  497. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
  498. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +0 -7
  499. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +0 -1
  500. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
  501. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
  502. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
  503. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
  504. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +0 -31
  505. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
  506. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
  507. /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-5UROHJ3D.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-YVB3QRTE.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-2PPYFAG5.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-AUGT5W6J.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-2IF7WLB7.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-2OJHLWBZ.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-3A2CMEM7.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-3EOBJOF4.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-5AXMRKN5.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-6J4K6JLA.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-AVJD6VTA.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-B5RF3IP7.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-C5W2UH56.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-CKLBZHS7.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-FY6Z3FYY.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-GNIUOLZ2.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-GPXQBR3H.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-H7EO3QA3.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-HLC3KTLP.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-HMMMWBK2.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-HV5SSZXF.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-KNGVP5WJ.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-LI65XLJR.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-LIN2BPJ7.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-LQHBENVW.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-LXO6V66E.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-MOYM2C3J.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-NQL32HQ5.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-OKSKJKHX.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-R3V3YCMH.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-RVPTZKBC.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-SFFVGNHC.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-SQPKRA54.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-TNPBPNII.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-TP4DDY27.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-TYJJOTUA.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-UAQOQ7IE.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-UEWA73ZZ.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-UIIQC5YO.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-V6EYFTRL.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-WYEXLDDY.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-X7UHMKPE.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-YBZW2QQ7.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-YO3THIJF.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-BJ4QMPJC.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-KW743OSW.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-P4ZBKODL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-SYHSRZDC.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-JEO6HHVM.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-YT2PQ5DD.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-4DS2QWQC.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-CF7EVRX7.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-KR4VBWVE.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-XLZRTRKR.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-2YTXD3VM.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-GZMFMTGS.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-SLROFEQ4.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-ZHISRR2D.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-3C7OOI4F.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-XYCUXICD.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-FUWF2FYJ.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-J4I5IU4O.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-SDAWYZR3.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-YDUEILKP.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-EPJ7GENL.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-KASLLPE7.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-IJ7LLBET.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-YNESJRT6.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-IGSS4GNH.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-YHVBTEET.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-4YBMIVCZ.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-T4PF24YN.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-3KEVBOYW.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-E44O2K64.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-FLUCNJSH.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-GJKALVZM.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-T5MMZLI3.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-YYMIL3HV.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-DDJGVZIN.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-SJSASGZP.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-B7NQ6XVP.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-HEGYH6CE.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-IIELLSZX.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-ML5RLWXE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-5FEMBV3A.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-RNKZ37PS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-6C67X4KS.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-VF26YPT3.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-BSZZZYXY.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-BWKJJEBF.js.map} +0 -0
@@ -1,9 +1,9 @@
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]="95c77953-dcc7-513b-bd0c-92f373166023")}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]="fee16454-2fff-5dc9-8e3e-374148e3e18f")}catch(e){}}();
3
3
  import {
4
4
  TYPE_TO_FOLDER,
5
5
  pathExists
6
- } from "./chunk-4LTBNUYT.js";
6
+ } from "./chunk-X4IZKYHP.js";
7
7
 
8
8
  // dist/core/item/id.js
9
9
  import crypto from "node:crypto";
@@ -30,10 +30,9 @@ function normalizeItemId(input, prefix) {
30
30
  return `${canonicalPrefix}${normalized}`;
31
31
  }
32
32
  function randomToken(length) {
33
- const bytes = crypto.randomBytes(length);
34
33
  let token = "";
35
- for (const byte of bytes) {
36
- token += (byte % 36).toString(36);
34
+ for (let index = 0; index < length; index += 1) {
35
+ token += crypto.randomInt(0, 36).toString(36);
37
36
  }
38
37
  return token;
39
38
  }
@@ -71,6 +70,6 @@ export {
71
70
  normalizeItemId,
72
71
  generateItemId
73
72
  };
74
- //# sourceMappingURL=chunk-SSFMJCPF.js.map
73
+ //# sourceMappingURL=chunk-UT6WFXW2.js.map
75
74
 
76
- //# debugId=95c77953-dcc7-513b-bd0c-92f373166023
75
+ //# debugId=fee16454-2fff-5dc9-8e3e-374148e3e18f
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/item/id.ts"],"sourcesContent":["import crypto from \"node:crypto\";\nimport path from \"node:path\";\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport { pathExists } from \"../fs/fs-utils.js\";\n\nexport function normalizePrefix(input: string | undefined): string {\n const normalized = (input ?? \"\").trim().toLowerCase();\n if (!normalized) return \"pm-\";\n return normalized.endsWith(\"-\") ? normalized : `${normalized}-`;\n}\n\nexport function normalizeRawItemId(input: string): string {\n let normalized = input.trim().toLowerCase();\n if (normalized.startsWith(\"#\")) {\n normalized = normalized.slice(1);\n }\n return normalized;\n}\n\nexport function normalizeItemId(input: string, prefix: string): string {\n const canonicalPrefix = normalizePrefix(prefix);\n const normalized = normalizeRawItemId(input);\n if (normalized.startsWith(canonicalPrefix)) {\n return normalized;\n }\n return `${canonicalPrefix}${normalized}`;\n}\n\nfunction randomToken(length: number): string {\n let token = \"\";\n for (let index = 0; index < length; index += 1) {\n token += crypto.randomInt(0, 36).toString(36);\n }\n return token;\n}\n\nasync function idExists(pmRoot: string, id: string): Promise<boolean> {\n const checks = Object.values(TYPE_TO_FOLDER).flatMap((folder) => [\n path.join(pmRoot, folder, `${id}.md`),\n path.join(pmRoot, folder, `${id}.toon`),\n ]);\n for (const target of checks) {\n if (await pathExists(target)) {\n return true;\n }\n }\n return false;\n}\n\nexport async function generateItemId(pmRoot: string, prefix: string): Promise<string> {\n let tokenLength = 4;\n let attempts = 0;\n\n while (tokenLength <= 10) {\n for (let i = 0; i < 32; i += 1) {\n const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;\n if (!(await idExists(pmRoot, id))) {\n return id;\n }\n attempts += 1;\n }\n tokenLength += 1;\n }\n\n throw new Error(`Unable to generate unique id after ${attempts} attempts`);\n}\n"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,UAAU;AAIX,SAAU,gBAAgB,OAAyB;AACvD,QAAM,cAAc,SAAS,IAAI,KAAI,EAAG,YAAW;AACnD,MAAI,CAAC;AAAY,WAAO;AACxB,SAAO,WAAW,SAAS,GAAG,IAAI,aAAa,GAAG,UAAU;AAC9D;AAEM,SAAU,mBAAmB,OAAa;AAC9C,MAAI,aAAa,MAAM,KAAI,EAAG,YAAW;AACzC,MAAI,WAAW,WAAW,GAAG,GAAG;AAC9B,iBAAa,WAAW,MAAM,CAAC;EACjC;AACA,SAAO;AACT;AAEM,SAAU,gBAAgB,OAAe,QAAc;AAC3D,QAAM,kBAAkB,gBAAgB,MAAM;AAC9C,QAAM,aAAa,mBAAmB,KAAK;AAC3C,MAAI,WAAW,WAAW,eAAe,GAAG;AAC1C,WAAO;EACT;AACA,SAAO,GAAG,eAAe,GAAG,UAAU;AACxC;AAEA,SAAS,YAAY,QAAc;AACjC,MAAI,QAAQ;AACZ,WAAS,QAAQ,GAAG,QAAQ,QAAQ,SAAS,GAAG;AAC9C,aAAS,OAAO,UAAU,GAAG,EAAE,EAAE,SAAS,EAAE;EAC9C;AACA,SAAO;AACT;AAEA,eAAe,SAAS,QAAgB,IAAU;AAChD,QAAM,SAAS,OAAO,OAAO,cAAc,EAAE,QAAQ,CAAC,WAAW;IAC/D,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;IACpC,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,OAAO;GACvC;AACD,aAAW,UAAU,QAAQ;AAC3B,QAAI,MAAM,WAAW,MAAM,GAAG;AAC5B,aAAO;IACT;EACF;AACA,SAAO;AACT;AAEA,eAAsB,eAAe,QAAgB,QAAc;AACjE,MAAI,cAAc;AAClB,MAAI,WAAW;AAEf,SAAO,eAAe,IAAI;AACxB,aAAS,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG;AAC9B,YAAM,KAAK,GAAG,gBAAgB,MAAM,CAAC,GAAG,YAAY,WAAW,CAAC;AAChE,UAAI,CAAE,MAAM,SAAS,QAAQ,EAAE,GAAI;AACjC,eAAO;MACT;AACA,kBAAY;IACd;AACA,mBAAe;EACjB;AAEA,QAAM,IAAI,MAAM,sCAAsC,QAAQ,WAAW;AAC3E","debugId":"fee16454-2fff-5dc9-8e3e-374148e3e18f"}
@@ -1,9 +1,9 @@
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]="b9b7439e-7986-5a85-9356-8d54578b038a")}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]="8e6380db-298c-5343-b79e-9939444e8ad2")}catch(e){}}();
3
3
  import {
4
4
  compareTimestampStrings,
5
5
  isTimestampLiteral
6
- } from "./chunk-NQP3ECKF.js";
6
+ } from "./chunk-B2KZGPM2.js";
7
7
  import {
8
8
  CONFIDENCE_TEXT_VALUES,
9
9
  EXIT_CODE,
@@ -19,7 +19,7 @@ import {
19
19
  resolveRuntimeStatusRegistry,
20
20
  runtimeFieldOptionTarget,
21
21
  weekdayOrderIndex
22
- } from "./chunk-4LTBNUYT.js";
22
+ } from "./chunk-X4IZKYHP.js";
23
23
 
24
24
  // dist/core/schema/runtime-field-values.js
25
25
  function toCamelToken(value) {
@@ -1001,7 +1001,11 @@ function normalizeTypeOptions(values) {
1001
1001
  return Object.fromEntries(normalizedEntries);
1002
1002
  }
1003
1003
  function normalizeBody(body) {
1004
- return body.replace(/^\n+/, "").replace(/\s+$/, "");
1004
+ let start = 0;
1005
+ while (start < body.length && body[start] === "\n") {
1006
+ start += 1;
1007
+ }
1008
+ return body.slice(start).trimEnd();
1005
1009
  }
1006
1010
  function normalizeConfidenceValue(value) {
1007
1011
  if (value === void 0) {
@@ -1320,6 +1324,6 @@ export {
1320
1324
  serializeItemDocument,
1321
1325
  canonicalDocument
1322
1326
  };
1323
- //# sourceMappingURL=chunk-KBG47ZOY.js.map
1327
+ //# sourceMappingURL=chunk-UYQ7HXH4.js.map
1324
1328
 
1325
- //# debugId=b9b7439e-7986-5a85-9356-8d54578b038a
1329
+ //# debugId=8e6380db-298c-5343-b79e-9939444e8ad2
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/schema/runtime-field-values.ts","../../../../../../../../core/item/status.ts","../../../../../../../../core/shared/conflict-markers.ts","../../../../../../../../core/item/item-format.ts","../../../../../../../../core/item/toon-decode.ts"],"sourcesContent":["import { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { runtimeFieldOptionTarget, type RuntimeFieldDefinitionResolved, type RuntimeFieldRegistry } from \"./runtime-schema.js\";\n\nfunction toCamelToken(value: string): string {\n const segments = value\n .trim()\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return value;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction resolveCandidateOptionKeys(definition: RuntimeFieldDefinitionResolved): string[] {\n return [...new Set([\n runtimeFieldOptionTarget(definition),\n toCamelToken(definition.key),\n toCamelToken(definition.cli_flag),\n ...definition.cli_aliases.map((alias) => toCamelToken(alias)),\n ])];\n}\n\nexport function readRuntimeFieldOptionValue(\n options: Record<string, unknown>,\n definition: RuntimeFieldDefinitionResolved,\n): unknown {\n for (const candidateKey of resolveCandidateOptionKeys(definition)) {\n if (!Object.hasOwn(options, candidateKey)) {\n continue;\n }\n const value = options[candidateKey];\n if (value !== undefined) {\n return value;\n }\n }\n return undefined;\n}\n\nfunction normalizeStringArrayValue(value: unknown): string[] {\n if (Array.isArray(value)) {\n return value\n .flatMap((entry) => normalizeStringArrayValue(entry))\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (typeof value === \"string\") {\n return value\n .split(/[,\\n|]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (value === undefined || value === null) {\n return [];\n }\n return [String(value).trim()].filter((entry) => entry.length > 0);\n}\n\nfunction parseBooleanValue(raw: unknown, label: string): boolean {\n if (typeof raw === \"boolean\") {\n return raw;\n }\n if (typeof raw === \"number\") {\n if (raw === 1) {\n return true;\n }\n if (raw === 0) {\n return false;\n }\n }\n if (typeof raw === \"string\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n }\n throw new PmCliError(`${label} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\nfunction parseNumberValue(raw: unknown, label: string): number {\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n const candidate = typeof raw === \"string\" ? raw.trim() : String(raw);\n const parsed = Number(candidate);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`${label} must be a number`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nexport function coerceRuntimeFieldValue(\n definition: RuntimeFieldDefinitionResolved,\n rawValue: unknown,\n labelOverride?: string,\n): unknown {\n const label = labelOverride ?? `--${definition.cli_flag}`;\n if (definition.repeatable || definition.type === \"string_array\") {\n const values = normalizeStringArrayValue(rawValue);\n if (definition.type === \"number\") {\n return values.map((value) => parseNumberValue(value, label));\n }\n if (definition.type === \"boolean\") {\n return values.map((value) => parseBooleanValue(value, label));\n }\n return values;\n }\n\n const scalarRaw = Array.isArray(rawValue) ? rawValue[rawValue.length - 1] : rawValue;\n if (scalarRaw === undefined) {\n return undefined;\n }\n if (definition.type === \"number\") {\n return parseNumberValue(scalarRaw, label);\n }\n if (definition.type === \"boolean\") {\n return parseBooleanValue(scalarRaw, label);\n }\n return typeof scalarRaw === \"string\" ? scalarRaw : String(scalarRaw);\n}\n\nfunction shouldRequireFieldOnCreate(definition: RuntimeFieldDefinitionResolved, itemTypeName: string | undefined): boolean {\n if (!definition.required && !definition.required_on_create) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n if (!itemTypeName) {\n return false;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(itemTypeName.trim().toLowerCase());\n}\n\nexport function collectRuntimeCreateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n itemTypeName: string | undefined,\n): { values: Record<string, unknown>; missing_required_flags: string[] } {\n const values: Record<string, unknown> = {};\n const missingRequiredFlags: string[] = [];\n for (const definition of fieldRegistry.command_to_fields.get(\"create\") ?? []) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n if (shouldRequireFieldOnCreate(definition, itemTypeName)) {\n missingRequiredFlags.push(`--${definition.cli_flag}`);\n }\n continue;\n }\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return {\n values,\n missing_required_flags: [...new Set(missingRequiredFlags)].sort((left, right) => left.localeCompare(right)),\n };\n}\n\nexport function collectRuntimeUpdateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n commands: Array<\"update\" | \"update_many\"> | null | undefined = [\"update\"],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n const definitions = (commands ?? [\"update\"]).flatMap((command) => fieldRegistry.command_to_fields.get(command) ?? []);\n const seen = new Set<string>();\n for (const definition of definitions) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n continue;\n }\n if (seen.has(definition.metadata_key)) {\n continue;\n }\n seen.add(definition.metadata_key);\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return values;\n}\n","import { STATUS_VALUES } from \"../../types/index.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { normalizeStatusInputWithRegistry, type RuntimeStatusRegistry } from \"../schema/runtime-schema.js\";\n\nconst STATUS_ALIAS_MAP: Readonly<Record<string, ItemStatus>> = {\n \"in-progress\": \"in_progress\",\n cancelled: \"canceled\",\n};\n\nexport function normalizeStatusInput(value: unknown, registry?: RuntimeStatusRegistry): ItemStatus | undefined {\n if (registry) {\n const normalizedFromRegistry = normalizeStatusInputWithRegistry(value, registry);\n if (normalizedFromRegistry) {\n return normalizedFromRegistry;\n }\n }\n if (typeof value !== \"string\") {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (!normalized) {\n return undefined;\n }\n const canonical = STATUS_ALIAS_MAP[normalized] ?? normalized;\n if (!(STATUS_VALUES as readonly string[]).includes(canonical)) {\n return undefined;\n }\n return canonical as ItemStatus;\n}\n\n/**\n * Normalize a status against the runtime registry, falling back to the original\n * value when normalization does not resolve to a known status. This preserves\n * the long-standing `normalizeStatusInput(status, registry) ?? status` pattern\n * used by query commands so that unknown/custom statuses still compare against\n * registry sets by their raw value.\n */\nexport function normalizeStatusForRegistry(status: ItemStatus, registry: RuntimeStatusRegistry): ItemStatus {\n return normalizeStatusInput(status, registry) ?? status;\n}\n\n/**\n * Determine whether a status is terminal according to the runtime status\n * registry, applying registry-aware normalization first (with raw fallback).\n */\nexport function isTerminalStatus(status: ItemStatus, registry: RuntimeStatusRegistry): boolean {\n return registry.terminal_statuses.has(normalizeStatusForRegistry(status, registry));\n}\n","export interface ConflictMarkerMatch {\n line: number;\n marker: \"<<<<<<<\" | \"=======\" | \">>>>>>>\";\n text: string;\n}\n\nconst CONFLICT_MARKER_PATTERN = /^\\s*(<<<<<<<|=======|>>>>>>>)(?:\\s.*)?$/;\n\nexport function findMergeConflictMarkers(content: string): ConflictMarkerMatch[] {\n if (content.length === 0) {\n return [];\n }\n const lines = content.split(/\\r?\\n/);\n const matches: ConflictMarkerMatch[] = [];\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index] ?? \"\";\n const markerMatch = line.match(CONFLICT_MARKER_PATTERN);\n if (!markerMatch) {\n continue;\n }\n const marker = markerMatch[1] as ConflictMarkerMatch[\"marker\"];\n matches.push({\n line: index + 1,\n marker,\n text: line,\n });\n }\n return matches;\n}\n\nexport function findFirstMergeConflictMarker(content: string): ConflictMarkerMatch | undefined {\n const matches = findMergeConflictMarkers(content);\n return matches[0];\n}\n","import { encode as encodeToon } from \"@toon-format/toon\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n RuntimeSchemaSettings,\n ItemTestRunSummary,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PlanDecision,\n PlanDiscovery,\n PlanStep,\n PlanStepDoc,\n PlanStepFile,\n PlanStepLink,\n PlanStepStatus,\n PlanValidationCheck,\n RecurrenceRule,\n Reminder,\n} from \"../../types/index.js\";\nimport type { ItemFormat } from \"../../types/index.js\";\nimport {\n CONFIDENCE_TEXT_VALUES,\n ISSUE_SEVERITY_VALUES,\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n STATUS_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport { coerceRuntimeFieldValue } from \"../schema/runtime-field-values.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../schema/runtime-schema.js\";\nimport { normalizeStatusInput } from \"./status.js\";\nimport { decodeToonItemContent } from \"./toon-decode.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../shared/conflict-markers.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { orderObject } from \"../shared/serialization.js\";\nimport { compareTimestampStrings, isTimestampLiteral } from \"../shared/time.js\";\n\nconst LINKED_TEST_PM_CONTEXT_MODE_VALUES = new Set([\"schema\", \"tracker\", \"auto\"]);\n\nfunction normalizePathValue(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\");\n}\n\nconst REQUIRED_STRING_FIELDS = [\n \"id\",\n \"title\",\n \"description\",\n \"created_at\",\n \"updated_at\",\n] as const;\n\nconst STATIC_FRONT_MATTER_FIELD_SET = new Set(FRONT_MATTER_KEY_ORDER);\n\ninterface RuntimeSchemaValidationContext {\n statusRegistry?: RuntimeStatusRegistry;\n fieldRegistry?: RuntimeFieldRegistry;\n unknownFieldPolicy: \"allow\" | \"warn\" | \"reject\";\n extensionFieldNames: ReadonlySet<string>;\n onWarning?: (warning: string) => void;\n}\n\nexport interface ItemDocumentFormatOptions {\n format?: ItemFormat;\n schema?: RuntimeSchemaSettings;\n extensionFieldNames?: readonly string[];\n onWarning?: (warning: string) => void;\n}\n\nfunction resolveRuntimeSchemaValidationContext(\n options: ItemDocumentFormatOptions | undefined,\n): RuntimeSchemaValidationContext | undefined {\n if (!options?.schema) {\n return undefined;\n }\n return {\n statusRegistry: resolveRuntimeStatusRegistry(options.schema),\n fieldRegistry: resolveRuntimeFieldRegistry(options.schema),\n unknownFieldPolicy: options.schema.unknown_field_policy ?? \"allow\",\n extensionFieldNames: new Set(options.extensionFieldNames ?? []),\n onWarning: options.onWarning,\n };\n}\n\nfunction runtimeFieldRequiredForType(definition: RuntimeFieldRegistry[\"definitions\"][number], typeName: string): boolean {\n if (!definition.required) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(typeName.trim().toLowerCase());\n}\n\nfunction validationError(message: string): never {\n throw new PmCliError(`Invalid item front matter: ${message}`, EXIT_CODE.GENERIC_FAILURE);\n}\n\nfunction buildKnownFrontMatterKeys(runtimeContext: RuntimeSchemaValidationContext): Set<string> {\n const knownKeys = new Set(STATIC_FRONT_MATTER_FIELD_SET);\n for (const definition of runtimeContext.fieldRegistry?.definitions ?? []) {\n knownKeys.add(definition.metadata_key);\n }\n for (const fieldName of runtimeContext.extensionFieldNames) {\n knownKeys.add(fieldName);\n }\n return knownKeys;\n}\n\nfunction assertFrontMatterCondition(condition: boolean, message: string): void {\n if (!condition) {\n validationError(message);\n }\n}\n\nfunction assertTimestampField(record: Record<string, unknown>, fieldName: \"created_at\" | \"updated_at\" | \"deadline\"): void {\n const rawValue = record[fieldName];\n assertFrontMatterCondition(typeof rawValue === \"string\", `${fieldName} must be a string`);\n const timestamp = rawValue as string;\n assertFrontMatterCondition(isTimestampLiteral(timestamp), `${fieldName} must be a valid ISO timestamp`);\n}\n\nfunction assertValidRecurrenceRule(recurrence: unknown): void {\n assertFrontMatterCondition(\n typeof recurrence === \"object\" && recurrence !== null && !Array.isArray(recurrence),\n \"event.recurrence must be an object\",\n );\n const recurrenceRecord = recurrence as Record<string, unknown>;\n assertFrontMatterCondition(typeof recurrenceRecord.freq === \"string\", \"event.recurrence.freq must be a string\");\n const frequency = (recurrenceRecord.freq as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_FREQUENCY_VALUES.includes(frequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number]),\n `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(\", \")}`,\n );\n\n if (recurrenceRecord.interval !== undefined) {\n assertFrontMatterCondition(\n typeof recurrenceRecord.interval === \"number\" &&\n Number.isInteger(recurrenceRecord.interval) &&\n (recurrenceRecord.interval as number) >= 1,\n \"event.recurrence.interval must be an integer >= 1\",\n );\n }\n\n if (recurrenceRecord.count !== undefined) {\n assertFrontMatterCondition(\n typeof recurrenceRecord.count === \"number\" && Number.isInteger(recurrenceRecord.count) && (recurrenceRecord.count as number) >= 1,\n \"event.recurrence.count must be an integer >= 1\",\n );\n }\n\n if (recurrenceRecord.until !== undefined) {\n assertFrontMatterCondition(typeof recurrenceRecord.until === \"string\", \"event.recurrence.until must be a string\");\n assertFrontMatterCondition(\n isTimestampLiteral(recurrenceRecord.until as string),\n \"event.recurrence.until must be a valid ISO timestamp\",\n );\n }\n\n if (recurrenceRecord.by_weekday !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_weekday), \"event.recurrence.by_weekday must be an array\");\n for (const weekday of recurrenceRecord.by_weekday as unknown[]) {\n assertFrontMatterCondition(typeof weekday === \"string\", \"event.recurrence.by_weekday entries must be strings\");\n const normalizedWeekday = (weekday as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_WEEKDAY_VALUES.includes(normalizedWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n `event.recurrence.by_weekday entries must be one of: ${RECURRENCE_WEEKDAY_VALUES.join(\", \")}`,\n );\n }\n }\n\n if (recurrenceRecord.by_month_day !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_month_day), \"event.recurrence.by_month_day must be an array\");\n for (const day of recurrenceRecord.by_month_day as unknown[]) {\n assertFrontMatterCondition(\n typeof day === \"number\" && Number.isInteger(day) && day >= 1 && day <= 31,\n \"event.recurrence.by_month_day entries must be integers 1..31\",\n );\n }\n }\n\n if (recurrenceRecord.exdates !== undefined) {\n assertFrontMatterCondition(Array.isArray(recurrenceRecord.exdates), \"event.recurrence.exdates must be an array\");\n for (const exdate of recurrenceRecord.exdates as unknown[]) {\n assertFrontMatterCondition(typeof exdate === \"string\", \"event.recurrence.exdates entries must be strings\");\n assertFrontMatterCondition(isTimestampLiteral(exdate as string), \"event.recurrence.exdates entries must be valid ISO timestamps\");\n }\n }\n}\n\nfunction assertValidFrontMatter(\n frontMatter: unknown,\n runtimeContext?: RuntimeSchemaValidationContext,\n): asserts frontMatter is ItemMetadata {\n assertFrontMatterCondition(\n typeof frontMatter === \"object\" && frontMatter !== null && !Array.isArray(frontMatter),\n \"front matter must be an object\",\n );\n\n const record = frontMatter as Record<string, unknown>;\n for (const fieldName of REQUIRED_STRING_FIELDS) {\n assertFrontMatterCondition(typeof record[fieldName] === \"string\", `${fieldName} is required and must be a string`);\n }\n\n const itemType = record.type;\n assertFrontMatterCondition(typeof itemType === \"string\" && itemType.trim().length > 0, \"type must be a non-empty string\");\n\n const status = record.status;\n assertFrontMatterCondition(\n typeof status === \"string\" && status.trim().length > 0,\n \"status must be a non-empty string\",\n );\n const statusRegistry = runtimeContext?.statusRegistry;\n const normalizedStatus = normalizeStatusInput(status as string, statusRegistry);\n const statusDomain = statusRegistry\n ? statusRegistry.definitions.map((definition) => definition.id)\n : [...STATUS_VALUES];\n assertFrontMatterCondition(normalizedStatus !== undefined, `status must be one of: ${statusDomain.join(\", \")}`);\n\n const priority = record.priority;\n assertFrontMatterCondition(\n typeof priority === \"number\" && Number.isInteger(priority) && [0, 1, 2, 3, 4].includes(priority),\n \"priority must be an integer 0..4\",\n );\n\n const tags = record.tags;\n assertFrontMatterCondition(Array.isArray(tags), \"tags must be an array\");\n for (const tag of tags as unknown[]) {\n assertFrontMatterCondition(typeof tag === \"string\", \"tags entries must be strings\");\n }\n\n const confidence = record.confidence;\n if (confidence !== undefined) {\n if (typeof confidence === \"number\") {\n assertFrontMatterCondition(\n Number.isInteger(confidence) && confidence >= 0 && confidence <= 100,\n \"confidence number value must be an integer 0..100\",\n );\n } else if (typeof confidence === \"string\") {\n const normalizedConfidence = confidence.trim().toLowerCase();\n const isKnownTextConfidence =\n normalizedConfidence === \"med\" || CONFIDENCE_TEXT_VALUES.includes(normalizedConfidence as (typeof CONFIDENCE_TEXT_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownTextConfidence,\n `confidence string value must be one of: ${[...CONFIDENCE_TEXT_VALUES, \"med\"].join(\", \")}`,\n );\n } else {\n assertFrontMatterCondition(false, \"confidence must be a number or string\");\n }\n }\n\n const severity = record.severity;\n if (severity !== undefined) {\n if (typeof severity !== \"string\") {\n validationError(\"severity must be a string\");\n }\n const normalizedSeverity = severity.trim().toLowerCase();\n const isKnownSeverity =\n normalizedSeverity === \"med\" || ISSUE_SEVERITY_VALUES.includes(normalizedSeverity as (typeof ISSUE_SEVERITY_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownSeverity,\n `severity value must be one of: ${[...ISSUE_SEVERITY_VALUES, \"med\"].join(\", \")}`,\n );\n }\n\n const regression = record.regression;\n if (regression !== undefined) {\n if (typeof regression !== \"boolean\") {\n validationError(\"regression must be a boolean\");\n }\n }\n\n assertTimestampField(record, \"created_at\");\n assertTimestampField(record, \"updated_at\");\n if (record.deadline !== undefined) {\n assertTimestampField(record, \"deadline\");\n }\n if (record.reminders !== undefined) {\n const reminders = record.reminders;\n assertFrontMatterCondition(Array.isArray(reminders), \"reminders must be an array\");\n for (const reminder of reminders as unknown[]) {\n assertFrontMatterCondition(typeof reminder === \"object\" && reminder !== null && !Array.isArray(reminder), \"reminders entries must be objects\");\n const reminderRecord = reminder as Record<string, unknown>;\n assertFrontMatterCondition(typeof reminderRecord.at === \"string\", \"reminder.at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(reminderRecord.at as string), \"reminder.at must be a valid ISO timestamp\");\n assertFrontMatterCondition(typeof reminderRecord.text === \"string\", \"reminder.text must be a string\");\n assertFrontMatterCondition((reminderRecord.text as string).trim().length > 0, \"reminder.text must not be empty\");\n }\n }\n if (record.events !== undefined) {\n const events = record.events;\n assertFrontMatterCondition(Array.isArray(events), \"events must be an array\");\n for (const event of events as unknown[]) {\n assertFrontMatterCondition(typeof event === \"object\" && event !== null && !Array.isArray(event), \"events entries must be objects\");\n const eventRecord = event as Record<string, unknown>;\n assertFrontMatterCondition(typeof eventRecord.start_at === \"string\", \"event.start_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.start_at as string), \"event.start_at must be a valid ISO timestamp\");\n\n if (eventRecord.end_at !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.end_at === \"string\", \"event.end_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.end_at as string), \"event.end_at must be a valid ISO timestamp\");\n assertFrontMatterCondition(\n compareTimestampStrings(eventRecord.end_at as string, eventRecord.start_at as string) > 0,\n \"event.end_at must be after event.start_at\",\n );\n }\n\n for (const stringField of [\"title\", \"description\", \"location\", \"timezone\"] as const) {\n if (eventRecord[stringField] !== undefined) {\n assertFrontMatterCondition(typeof eventRecord[stringField] === \"string\", `event.${stringField} must be a string`);\n assertFrontMatterCondition(\n (eventRecord[stringField] as string).trim().length > 0,\n `event.${stringField} must not be empty`,\n );\n }\n }\n\n if (eventRecord.all_day !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.all_day === \"boolean\", \"event.all_day must be a boolean\");\n }\n\n if (eventRecord.recurrence !== undefined) {\n assertValidRecurrenceRule(eventRecord.recurrence);\n if ((eventRecord.recurrence as Record<string, unknown>).until !== undefined) {\n assertFrontMatterCondition(\n compareTimestampStrings(\n (eventRecord.recurrence as Record<string, unknown>).until as string,\n eventRecord.start_at as string,\n ) >= 0,\n \"event.recurrence.until must be at or after event.start_at\",\n );\n }\n }\n }\n }\n if (record.closed_at !== undefined) {\n const closedAt = record.closed_at;\n assertFrontMatterCondition(typeof closedAt === \"string\", \"closed_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(closedAt as string), \"closed_at must be a valid ISO timestamp\");\n }\n for (const fieldName of [\"source_type\", \"source_owner\", \"design\", \"external_ref\"] as const) {\n const value = record[fieldName];\n if (value !== undefined) {\n assertFrontMatterCondition(typeof value === \"string\", `${fieldName} must be a string`);\n }\n }\n const typeOptions = record.type_options;\n if (typeOptions !== undefined) {\n assertFrontMatterCondition(\n typeof typeOptions === \"object\" && typeOptions !== null && !Array.isArray(typeOptions),\n \"type_options must be an object\",\n );\n for (const [optionKey, optionValue] of Object.entries(typeOptions as Record<string, unknown>)) {\n assertFrontMatterCondition(optionKey.trim().length > 0, \"type_options keys must be non-empty\");\n assertFrontMatterCondition(typeof optionValue === \"string\", \"type_options values must be strings\");\n const optionText = optionValue as string;\n assertFrontMatterCondition(optionText.trim().length > 0, \"type_options values must be non-empty strings\");\n }\n }\n\n if (runtimeContext?.fieldRegistry) {\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const fieldValue = record[definition.metadata_key];\n if (fieldValue === undefined) {\n if (runtimeFieldRequiredForType(definition, itemType as string)) {\n validationError(`missing required schema field: ${definition.metadata_key}`);\n }\n continue;\n }\n try {\n record[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n fieldValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n } catch (error: unknown) {\n validationError(\n error instanceof Error ? error.message.replace(/^Invalid\\s+/u, \"\") : `invalid ${definition.metadata_key} value`,\n );\n }\n }\n }\n\n if (runtimeContext && runtimeContext.unknownFieldPolicy !== \"allow\") {\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length > 0) {\n if (runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n } else {\n runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(\",\")}`);\n }\n }\n }\n}\n\nfunction sortDependencies(values: Dependency[] | undefined): Dependency[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n id: value.id.trim().toLowerCase(),\n kind: value.kind,\n created_at: value.created_at,\n author: value.author?.trim() || undefined,\n source_kind: value.source_kind?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byId = a.id.localeCompare(b.id);\n if (byId !== 0) return byId;\n const byKind = a.kind.localeCompare(b.kind);\n if (byKind !== 0) return byKind;\n return (a.source_kind ?? \"\").localeCompare(b.source_kind ?? \"\");\n });\n}\n\nfunction sortLogValues<T extends Comment | LogNote>(values: T[] | undefined): T[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values].sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byText = a.text.localeCompare(b.text);\n if (byText !== 0) return byText;\n return a.author.localeCompare(b.author);\n });\n}\n\nfunction sortReminders(values: Reminder[] | undefined): Reminder[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = [...values]\n .map((value) => ({\n at: value.at,\n text: value.text.trim(),\n }))\n .filter((value) => value.text.length > 0)\n .sort((a, b) => {\n const byAt = compareTimestampStrings(a.at, b.at);\n if (byAt !== 0) return byAt;\n return a.text.localeCompare(b.text);\n });\n return normalized.length === 0 ? undefined : normalized;\n}\n\nfunction normalizeRecurrenceRule(value: RecurrenceRule | undefined): RecurrenceRule | undefined {\n if (!value) {\n return undefined;\n }\n const normalizedFrequency = value.freq.trim().toLowerCase();\n if (!RECURRENCE_FREQUENCY_VALUES.includes(normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number])) {\n return undefined;\n }\n\n const byWeekday = Array.from(\n new Set(\n (value.by_weekday ?? [])\n .map((weekday) => weekday.trim().toLowerCase())\n .filter((weekday) => RECURRENCE_WEEKDAY_VALUES.includes(weekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number])),\n ),\n ).sort(\n (a, b) =>\n weekdayOrderIndex(a as (typeof RECURRENCE_WEEKDAY_VALUES)[number]) -\n weekdayOrderIndex(b as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n );\n\n const byMonthDay = Array.from(\n new Set(\n (value.by_month_day ?? [])\n .filter((day) => Number.isInteger(day) && day >= 1 && day <= 31)\n .map((day) => day as number),\n ),\n ).sort((a, b) => a - b);\n\n const exdates = Array.from(\n new Set(\n (value.exdates ?? [])\n .map((timestamp) => timestamp.trim())\n .filter((timestamp) => isTimestampLiteral(timestamp)),\n ),\n ).sort((a, b) => compareTimestampStrings(a, b));\n\n const normalized: RecurrenceRule = {\n freq: normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number],\n interval: value.interval !== undefined && value.interval > 1 ? value.interval : undefined,\n count: value.count,\n until: value.until?.trim() || undefined,\n by_weekday: byWeekday.length > 0 ? (byWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number][]) : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n for (const [key, fieldValue] of Object.entries(normalized)) {\n if (fieldValue === undefined) {\n delete (normalized as unknown as Record<string, unknown>)[key];\n }\n }\n return normalized;\n}\n\nfunction sortEvents(values: CalendarEvent[] | undefined): CalendarEvent[] | undefined {\n if (!values || values.length === 0) {\n return undefined;\n }\n const normalized = [...values]\n .map((value) => {\n const event: CalendarEvent = {\n start_at: value.start_at,\n end_at: value.end_at || undefined,\n title: value.title?.trim() || undefined,\n description: value.description?.trim() || undefined,\n location: value.location?.trim() || undefined,\n all_day: value.all_day,\n timezone: value.timezone?.trim() || undefined,\n recurrence: normalizeRecurrenceRule(value.recurrence),\n };\n for (const [key, fieldValue] of Object.entries(event)) {\n if (fieldValue === undefined) {\n delete (event as unknown as Record<string, unknown>)[key];\n }\n }\n return event;\n })\n .sort((a, b) => {\n const byStart = compareTimestampStrings(a.start_at, b.start_at);\n if (byStart !== 0) return byStart;\n const byEnd = (a.end_at ?? \"\").localeCompare(b.end_at ?? \"\");\n if (byEnd !== 0) return byEnd;\n const byTitle = (a.title ?? \"\").localeCompare(b.title ?? \"\");\n if (byTitle !== 0) return byTitle;\n const byAllDay = Number(Boolean(a.all_day)) - Number(Boolean(b.all_day));\n if (byAllDay !== 0) return byAllDay;\n const byTimezone = (a.timezone ?? \"\").localeCompare(b.timezone ?? \"\");\n if (byTimezone !== 0) return byTimezone;\n const byLocation = (a.location ?? \"\").localeCompare(b.location ?? \"\");\n if (byLocation !== 0) return byLocation;\n const byDescription = (a.description ?? \"\").localeCompare(b.description ?? \"\");\n if (byDescription !== 0) return byDescription;\n return JSON.stringify(a.recurrence ?? {}).localeCompare(JSON.stringify(b.recurrence ?? {}));\n });\n return normalized;\n}\n\nfunction normalizeFiles(values: LinkedFile[] | undefined): LinkedFile[] | undefined {\n if (!values || values.length === 0) return undefined;\n return values\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }));\n}\n\nfunction normalizeTestRunSummaries(values: ItemTestRunSummary[] | undefined): ItemTestRunSummary[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = values\n .map((value) => {\n const runId = typeof value.run_id === \"string\" ? value.run_id.trim() : \"\";\n const kind = value.kind === \"test\" || value.kind === \"test-all\" ? value.kind : \"test\";\n const status =\n value.status === \"passed\" || value.status === \"failed\" || value.status === \"stopped\" || value.status === \"canceled\"\n ? value.status\n : \"failed\";\n const startedAt = typeof value.started_at === \"string\" ? value.started_at : \"\";\n const finishedAt = typeof value.finished_at === \"string\" ? value.finished_at : \"\";\n const recordedAt = typeof value.recorded_at === \"string\" ? value.recorded_at : \"\";\n const passed = typeof value.passed === \"number\" && Number.isFinite(value.passed) ? Math.max(0, Math.floor(value.passed)) : 0;\n const failed = typeof value.failed === \"number\" && Number.isFinite(value.failed) ? Math.max(0, Math.floor(value.failed)) : 0;\n const skipped = typeof value.skipped === \"number\" && Number.isFinite(value.skipped) ? Math.max(0, Math.floor(value.skipped)) : 0;\n return {\n run_id: runId,\n kind,\n status,\n started_at: startedAt,\n finished_at: finishedAt,\n recorded_at: recordedAt,\n attempt:\n typeof value.attempt === \"number\" && Number.isFinite(value.attempt) && value.attempt >= 1\n ? Math.floor(value.attempt)\n : undefined,\n resumed_from: value.resumed_from?.trim() || undefined,\n passed,\n failed,\n skipped,\n items:\n typeof value.items === \"number\" && Number.isFinite(value.items) && value.items >= 0\n ? Math.floor(value.items)\n : undefined,\n linked_tests:\n typeof value.linked_tests === \"number\" && Number.isFinite(value.linked_tests) && value.linked_tests >= 0\n ? Math.floor(value.linked_tests)\n : undefined,\n fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : undefined,\n };\n })\n .filter((value) => value.run_id.length > 0 && value.started_at.length > 0 && value.finished_at.length > 0 && value.recorded_at.length > 0)\n .sort((a, b) => {\n const byRecorded = compareTimestampStrings(a.recorded_at, b.recorded_at);\n if (byRecorded !== 0) return byRecorded;\n const byRunId = a.run_id.localeCompare(b.run_id);\n if (byRunId !== 0) return byRunId;\n return a.kind.localeCompare(b.kind);\n });\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction sortTests(values: LinkedTest[] | undefined): LinkedTest[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n command: value.command?.trim() || undefined,\n path: value.path ? normalizePathValue(value.path) : undefined,\n scope: value.scope,\n timeout_seconds:\n typeof value.timeout_seconds === \"number\" && Number.isFinite(value.timeout_seconds) && value.timeout_seconds > 0\n ? value.timeout_seconds\n : undefined,\n pm_context_mode: (() => {\n const normalized = value.pm_context_mode?.trim().toLowerCase();\n if (!normalized || !LINKED_TEST_PM_CONTEXT_MODE_VALUES.has(normalized)) {\n return undefined;\n }\n return normalized as LinkedTest[\"pm_context_mode\"];\n })(),\n env_set: value.env_set\n ? Object.fromEntries(\n Object.entries(value.env_set)\n .map(([key, envValue]) => [key.trim(), String(envValue).trim()] as const)\n .filter(([key, envValue]) => key.length > 0 && envValue.length > 0)\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n env_clear: value.env_clear\n ? [...new Set(value.env_clear.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n shared_host_safe: value.shared_host_safe === true ? true : undefined,\n assert_stdout_contains: value.assert_stdout_contains\n ? [...new Set(value.assert_stdout_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stdout_regex: value.assert_stdout_regex\n ? [...new Set(value.assert_stdout_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stderr_contains: value.assert_stderr_contains\n ? [...new Set(value.assert_stderr_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stderr_regex: value.assert_stderr_regex\n ? [...new Set(value.assert_stderr_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n )\n : undefined,\n assert_stdout_min_lines:\n typeof value.assert_stdout_min_lines === \"number\" &&\n Number.isFinite(value.assert_stdout_min_lines) &&\n value.assert_stdout_min_lines >= 0\n ? Math.floor(value.assert_stdout_min_lines)\n : undefined,\n assert_json_field_equals: value.assert_json_field_equals\n ? Object.fromEntries(\n Object.entries(value.assert_json_field_equals)\n .map(([key, expectedValue]) => [key.trim(), String(expectedValue).trim()] as const)\n .filter(([key, expectedValue]) => key.length > 0 && expectedValue.length > 0)\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n assert_json_field_gte: value.assert_json_field_gte\n ? Object.fromEntries(\n Object.entries(value.assert_json_field_gte)\n .map(([key, expectedValue]) => [key.trim(), Number(expectedValue)] as const)\n .filter(([key, expectedValue]) => key.length > 0 && Number.isFinite(expectedValue))\n .sort(([left], [right]) => left.localeCompare(right)),\n )\n : undefined,\n note: value.note?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byScope = a.scope.localeCompare(b.scope);\n if (byScope !== 0) return byScope;\n const byPath = (a.path ?? \"\").localeCompare(b.path ?? \"\");\n if (byPath !== 0) return byPath;\n const byCommand = (a.command ?? \"\").localeCompare(b.command ?? \"\");\n if (byCommand !== 0) return byCommand;\n const byTimeout = (a.timeout_seconds ?? 0) - (b.timeout_seconds ?? 0);\n if (byTimeout !== 0) return byTimeout;\n const byPmContext = (a.pm_context_mode ?? \"\").localeCompare(b.pm_context_mode ?? \"\");\n if (byPmContext !== 0) return byPmContext;\n const bySharedHostSafe = Number(Boolean(a.shared_host_safe)) - Number(Boolean(b.shared_host_safe));\n if (bySharedHostSafe !== 0) return bySharedHostSafe;\n const byEnvClear = JSON.stringify(a.env_clear ?? []).localeCompare(JSON.stringify(b.env_clear ?? []));\n if (byEnvClear !== 0) return byEnvClear;\n const byEnvSet = JSON.stringify(a.env_set ?? {}).localeCompare(JSON.stringify(b.env_set ?? {}));\n if (byEnvSet !== 0) return byEnvSet;\n const byStdoutContains = JSON.stringify(a.assert_stdout_contains ?? []).localeCompare(\n JSON.stringify(b.assert_stdout_contains ?? []),\n );\n if (byStdoutContains !== 0) return byStdoutContains;\n const byStdoutRegex = JSON.stringify(a.assert_stdout_regex ?? []).localeCompare(\n JSON.stringify(b.assert_stdout_regex ?? []),\n );\n if (byStdoutRegex !== 0) return byStdoutRegex;\n const byStderrContains = JSON.stringify(a.assert_stderr_contains ?? []).localeCompare(\n JSON.stringify(b.assert_stderr_contains ?? []),\n );\n if (byStderrContains !== 0) return byStderrContains;\n const byStderrRegex = JSON.stringify(a.assert_stderr_regex ?? []).localeCompare(\n JSON.stringify(b.assert_stderr_regex ?? []),\n );\n if (byStderrRegex !== 0) return byStderrRegex;\n const byStdoutMinLines = (a.assert_stdout_min_lines ?? 0) - (b.assert_stdout_min_lines ?? 0);\n if (byStdoutMinLines !== 0) return byStdoutMinLines;\n const byJsonFieldEquals = JSON.stringify(a.assert_json_field_equals ?? {}).localeCompare(\n JSON.stringify(b.assert_json_field_equals ?? {}),\n );\n if (byJsonFieldEquals !== 0) return byJsonFieldEquals;\n const byJsonFieldGte = JSON.stringify(a.assert_json_field_gte ?? {}).localeCompare(\n JSON.stringify(b.assert_json_field_gte ?? {}),\n );\n if (byJsonFieldGte !== 0) return byJsonFieldGte;\n return (a.note ?? \"\").localeCompare(b.note ?? \"\");\n });\n}\n\nfunction sortDocs(values: LinkedDoc[] | undefined): LinkedDoc[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byScope = a.scope.localeCompare(b.scope);\n if (byScope !== 0) return byScope;\n const byPath = a.path.localeCompare(b.path);\n if (byPath !== 0) return byPath;\n return (a.note ?? \"\").localeCompare(b.note ?? \"\");\n });\n}\n\nfunction trimStringOrUndefined(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction normalizePlanStepLinks(value: unknown): PlanStepLink[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepLink[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const kind = trimStringOrUndefined(record.kind);\n if (!id || !kind) continue;\n const link: PlanStepLink = { id, kind: kind as PlanStepLink[\"kind\"] };\n const note = trimStringOrUndefined(record.note);\n if (note) link.note = note;\n if (record.required_before_step === true) link.required_before_step = true;\n out.push(link);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepFiles(value: unknown): PlanStepFile[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepFile[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const file: PlanStepFile = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") file.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) file.note = note;\n out.push(file);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepTests(value: unknown): { command?: string; path?: string; note?: string }[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: { command?: string; path?: string; note?: string }[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const command = trimStringOrUndefined(record.command);\n const path = trimStringOrUndefined(record.path);\n if (!command && !path) continue;\n const test: { command?: string; path?: string; note?: string } = {};\n if (command) test.command = command;\n if (path) test.path = normalizePathValue(path);\n const note = trimStringOrUndefined(record.note);\n if (note) test.note = note;\n out.push(test);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepDocs(value: unknown): PlanStepDoc[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepDoc[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const doc: PlanStepDoc = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") doc.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) doc.note = note;\n out.push(doc);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanSteps(value: unknown): PlanStep[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStep[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const title = trimStringOrUndefined(record.title);\n const status = trimStringOrUndefined(record.status);\n const orderRaw = record.order;\n const order = typeof orderRaw === \"number\" && Number.isFinite(orderRaw) ? orderRaw : Number(orderRaw);\n if (!id || !title || !status || !Number.isFinite(order)) continue;\n const created_at = typeof record.created_at === \"string\" ? record.created_at : \"\";\n const updated_at = typeof record.updated_at === \"string\" ? record.updated_at : \"\";\n if (!created_at || !updated_at) continue;\n const step: PlanStep = {\n id,\n order,\n title,\n status: status as PlanStepStatus,\n created_at,\n updated_at,\n };\n const body = trimStringOrUndefined(record.body);\n if (body) step.body = body;\n const owner = trimStringOrUndefined(record.owner);\n if (owner) step.owner = owner;\n const evidence = trimStringOrUndefined(record.evidence);\n if (evidence) step.evidence = evidence;\n const blockedReason = trimStringOrUndefined(record.blocked_reason);\n if (blockedReason) step.blocked_reason = blockedReason;\n const supersededBy = trimStringOrUndefined(record.superseded_by);\n if (supersededBy) step.superseded_by = supersededBy;\n const completedAt = typeof record.completed_at === \"string\" ? record.completed_at : undefined;\n if (completedAt && completedAt.length > 0) step.completed_at = completedAt;\n const links = normalizePlanStepLinks(record.linked_items);\n if (links) step.linked_items = links;\n const files = normalizePlanStepFiles(record.files);\n if (files) step.files = files;\n const tests = normalizePlanStepTests(record.tests);\n if (tests) step.tests = tests;\n const docs = normalizePlanStepDocs(record.docs);\n if (docs) step.docs = docs;\n out.push(step);\n }\n out.sort((left, right) => left.order - right.order);\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDecisions(value: unknown): PlanDecision[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDecision[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const decision = trimStringOrUndefined(record.decision);\n if (!ts || !author || !decision) continue;\n const item: PlanDecision = { ts, author, decision };\n const rationale = trimStringOrUndefined(record.rationale);\n if (rationale) item.rationale = rationale;\n const evidence = trimStringOrUndefined(record.evidence);\n if (evidence) item.evidence = evidence;\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDiscoveries(value: unknown): PlanDiscovery[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDiscovery[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const text = trimStringOrUndefined(record.text);\n if (!ts || !author || !text) continue;\n const item: PlanDiscovery = { ts, author, text };\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanValidation(value: unknown): PlanValidationCheck[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanValidationCheck[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const text = trimStringOrUndefined(record.text);\n if (!text) continue;\n const item: PlanValidationCheck = { text };\n const command = trimStringOrUndefined(record.command);\n if (command) item.command = command;\n const expected = trimStringOrUndefined(record.expected);\n if (expected) item.expected = expected;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizeTypeOptions(values: Record<string, string> | undefined): Record<string, string> | undefined {\n if (!values) {\n return undefined;\n }\n const normalizedEntries = Object.entries(values)\n .map(([key, value]) => [key.trim(), value.trim()] as const)\n .filter(([key, value]) => key.length > 0 && value.length > 0)\n .sort((left, right) => left[0].localeCompare(right[0]));\n if (normalizedEntries.length === 0) {\n return undefined;\n }\n return Object.fromEntries(normalizedEntries);\n}\n\nfunction normalizeBody(body: string): string {\n let start = 0;\n while (start < body.length && body[start] === \"\\n\") {\n start += 1;\n }\n return body.slice(start).trimEnd();\n}\n\nfunction normalizeConfidenceValue(value: ItemMetadata[\"confidence\"] | undefined): ItemMetadata[\"confidence\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === \"number\") {\n return value;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(normalized as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return normalized as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n return undefined;\n}\n\nfunction normalizeSeverityValue(value: ItemMetadata[\"severity\"] | undefined): ItemMetadata[\"severity\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (ISSUE_SEVERITY_VALUES.includes(normalized as (typeof ISSUE_SEVERITY_VALUES)[number])) {\n return normalized as (typeof ISSUE_SEVERITY_VALUES)[number];\n }\n return undefined;\n}\n\nexport function normalizeFrontMatter(\n frontMatter: ItemMetadata,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemMetadata {\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n const normalizedStatus = normalizeStatusInput(frontMatter.status, runtimeContext?.statusRegistry) ?? frontMatter.status;\n const tags = Array.from(new Set(frontMatter.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean))).sort((a, b) =>\n a.localeCompare(b),\n );\n const normalized: ItemMetadata = {\n id: frontMatter.id,\n title: frontMatter.title,\n description: frontMatter.description,\n type: frontMatter.type,\n source_type: frontMatter.source_type?.trim() || undefined,\n type_options: normalizeTypeOptions(frontMatter.type_options),\n status: normalizedStatus,\n priority: frontMatter.priority,\n tags,\n created_at: frontMatter.created_at,\n updated_at: frontMatter.updated_at,\n dependencies: sortDependencies(frontMatter.dependencies),\n comments: sortLogValues(frontMatter.comments),\n notes: sortLogValues(frontMatter.notes),\n learnings: sortLogValues(frontMatter.learnings),\n files: normalizeFiles(frontMatter.files),\n tests: sortTests(frontMatter.tests),\n test_runs: normalizeTestRunSummaries(frontMatter.test_runs),\n docs: sortDocs(frontMatter.docs),\n deadline: frontMatter.deadline || undefined,\n reminders: sortReminders(frontMatter.reminders),\n events: sortEvents(frontMatter.events),\n closed_at: frontMatter.closed_at || undefined,\n assignee: frontMatter.assignee?.trim() || undefined,\n source_owner: frontMatter.source_owner?.trim() || undefined,\n author: frontMatter.author || undefined,\n estimated_minutes: frontMatter.estimated_minutes,\n acceptance_criteria: frontMatter.acceptance_criteria ?? undefined,\n design: frontMatter.design ?? undefined,\n external_ref: frontMatter.external_ref ?? undefined,\n definition_of_ready: frontMatter.definition_of_ready?.trim() || undefined,\n order: frontMatter.order,\n goal: frontMatter.goal?.trim() || undefined,\n objective: frontMatter.objective?.trim() || undefined,\n value: frontMatter.value?.trim() || undefined,\n impact: frontMatter.impact?.trim() || undefined,\n outcome: frontMatter.outcome?.trim() || undefined,\n why_now: frontMatter.why_now?.trim() || undefined,\n parent: frontMatter.parent?.trim() || undefined,\n reviewer: frontMatter.reviewer?.trim() || undefined,\n risk: frontMatter.risk ?? undefined,\n confidence: normalizeConfidenceValue(frontMatter.confidence),\n sprint: frontMatter.sprint?.trim() || undefined,\n release: frontMatter.release?.trim() || undefined,\n blocked_by: frontMatter.blocked_by?.trim() || undefined,\n blocked_reason: frontMatter.blocked_reason?.trim() || undefined,\n unblock_note: frontMatter.unblock_note?.trim() || undefined,\n reporter: frontMatter.reporter?.trim() || undefined,\n severity: normalizeSeverityValue(frontMatter.severity),\n environment: frontMatter.environment?.trim() || undefined,\n repro_steps: frontMatter.repro_steps?.trim() || undefined,\n resolution: frontMatter.resolution?.trim() || undefined,\n expected_result: frontMatter.expected_result?.trim() || undefined,\n actual_result: frontMatter.actual_result?.trim() || undefined,\n affected_version: frontMatter.affected_version?.trim() || undefined,\n fixed_version: frontMatter.fixed_version?.trim() || undefined,\n component: frontMatter.component?.trim() || undefined,\n regression: frontMatter.regression,\n customer_impact: frontMatter.customer_impact?.trim() || undefined,\n close_reason: frontMatter.close_reason || undefined,\n plan_mode: trimStringOrUndefined(frontMatter.plan_mode) as ItemMetadata[\"plan_mode\"],\n plan_scope: trimStringOrUndefined(frontMatter.plan_scope),\n plan_harness: trimStringOrUndefined(frontMatter.plan_harness) as ItemMetadata[\"plan_harness\"],\n plan_resume_context: trimStringOrUndefined(frontMatter.plan_resume_context),\n plan_steps: normalizePlanSteps(frontMatter.plan_steps),\n plan_decisions: normalizePlanDecisions(frontMatter.plan_decisions),\n plan_discoveries: normalizePlanDiscoveries(frontMatter.plan_discoveries),\n plan_validation: normalizePlanValidation(frontMatter.plan_validation),\n };\n const sourceRecord = frontMatter as unknown as Record<string, unknown>;\n for (const [key, value] of Object.entries(sourceRecord)) {\n if (Object.prototype.hasOwnProperty.call(normalized, key) || value === undefined) {\n continue;\n }\n (normalized as unknown as Record<string, unknown>)[key] = value;\n }\n\n if (runtimeContext?.fieldRegistry) {\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const currentValue = (normalized as unknown as Record<string, unknown>)[definition.metadata_key];\n if (currentValue === undefined) {\n continue;\n }\n (normalized as unknown as Record<string, unknown>)[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n currentValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n }\n }\n\n if (runtimeContext && runtimeContext.unknownFieldPolicy !== \"allow\") {\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const unknownKeys = Object.keys(normalized as unknown as Record<string, unknown>)\n .filter((key) => !knownKeys.has(key))\n .sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length > 0) {\n if (runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n }\n }\n }\n\n for (const [key, value] of Object.entries(normalized)) {\n if (value === undefined) {\n delete (normalized as unknown as Record<string, unknown>)[key];\n }\n }\n return normalized;\n}\n\nfunction orderFrontMatter(frontMatter: ItemMetadata): Record<string, unknown> {\n return orderObject(frontMatter as unknown as Record<string, unknown>, FRONT_MATTER_KEY_ORDER);\n}\n\nfunction findJsonObjectEnd(content: string): number {\n let depth = 0;\n let inString = false;\n let escaped = false;\n\n for (let i = 0; i < content.length; i += 1) {\n const char = content[i];\n if (inString) {\n if (escaped) {\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n escaped = true;\n continue;\n }\n if (char === \"\\\"\") {\n inString = false;\n }\n continue;\n }\n if (char === \"\\\"\") {\n inString = true;\n continue;\n }\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) {\n return i;\n }\n }\n }\n\n return -1;\n}\n\nexport function splitFrontMatter(content: string): { frontMatter: string; body: string } {\n if (!content.startsWith(\"{\")) {\n return { frontMatter: \"\", body: content };\n }\n const end = findJsonObjectEnd(content);\n if (end < 0) {\n return { frontMatter: \"\", body: content };\n }\n const frontMatter = content.slice(0, end + 1);\n const body = content.slice(end + 1).replace(/^\\r?\\n+/, \"\");\n return { frontMatter, body };\n}\n\nfunction stripLeadingYamlDocument(content: string): { content: string; stripped: boolean } {\n const normalizedContent = content.charCodeAt(0) === 0xfeff ? content.slice(1) : content;\n const opener = normalizedContent.match(/^[ \\t]*---[ \\t]*(?:\\r?\\n|$)/);\n if (!opener) {\n return { content: normalizedContent, stripped: false };\n }\n\n let cursor = opener[0].length;\n while (cursor < normalizedContent.length) {\n const nextNewline = normalizedContent.indexOf(\"\\n\", cursor);\n const lineEnd = nextNewline === -1 ? normalizedContent.length : nextNewline;\n const line = normalizedContent.slice(cursor, lineEnd).replace(/\\r$/, \"\");\n const afterLine = nextNewline === -1 ? lineEnd : lineEnd + 1;\n if (line.trim() === \"---\") {\n return { content: normalizedContent.slice(afterLine).replace(/^\\s+/, \"\"), stripped: true };\n }\n cursor = afterLine;\n }\n\n return { content: normalizedContent, stripped: false };\n}\n\nfunction parseJsonMarkdownItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n const normalized = stripLeadingYamlDocument(content);\n if (normalized.stripped) {\n options.onWarning?.(\"json_markdown_leading_yaml_frontmatter_ignored\");\n }\n const { frontMatter, body } = splitFrontMatter(normalized.content);\n if (!frontMatter) {\n const trimmed = content.trimStart();\n if (trimmed.startsWith(\"{\")) {\n validationError(\"JSON front matter is not valid JSON\");\n }\n validationError(\"missing JSON front matter\");\n }\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(frontMatter);\n } catch {\n validationError(\"JSON front matter is not valid JSON\");\n }\n assertValidFrontMatter(parsed, runtimeContext);\n\n return {\n metadata: normalizeFrontMatter(parsed, options),\n body: normalizeBody(body),\n };\n}\n\nfunction parseToonItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n let parsed: unknown;\n try {\n // decodeToonItemContent transparently recovers documents that the upstream\n // strict decoder rejects (bracketed-token-then-colon inside a quoted value;\n // see toon-decode.ts). The recovery is lossless, so it stays silent rather\n // than emitting a per-read warning that would perpetually flip pm health\n // red for legacy files. The behavior is pinned by toon-decode.spec.ts.\n parsed = decodeToonItemContent(content).value;\n } catch {\n validationError(\"TOON item document is not valid TOON\");\n }\n assertFrontMatterCondition(\n typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed),\n \"TOON item document must be an object\",\n );\n const record = parsed as Record<string, unknown>;\n\n if (Object.prototype.hasOwnProperty.call(record, \"front_matter\")) {\n assertValidFrontMatter(record.front_matter, runtimeContext);\n assertFrontMatterCondition(\n record.body === undefined || typeof record.body === \"string\",\n \"TOON item document body must be a string\",\n );\n return {\n metadata: normalizeFrontMatter(record.front_matter, options),\n body: normalizeBody(typeof record.body === \"string\" ? record.body : \"\"),\n };\n }\n\n const { body, ...frontMatterRecord } = record;\n assertFrontMatterCondition(\n body === undefined || typeof body === \"string\",\n \"TOON item document body must be a string\",\n );\n assertValidFrontMatter(frontMatterRecord, runtimeContext);\n return {\n metadata: normalizeFrontMatter(frontMatterRecord, options),\n body: normalizeBody(typeof body === \"string\" ? body : \"\"),\n };\n}\n\nfunction serializeJsonMarkdownItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const serializedFrontMatter = JSON.stringify(orderedFrontMatter, null, 2);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n if (!normalizedBody) {\n return `${serializedFrontMatter}\\n`;\n }\n return `${serializedFrontMatter}\\n\\n${normalizedBody}\\n`;\n}\n\nfunction serializeToonItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n return `${encodeToon({ ...orderedFrontMatter, body: normalizedBody })}\\n`;\n}\n\nexport function parseItemDocument(content: string, options: ItemDocumentFormatOptions = {}): ItemDocument {\n const conflictMarker = findFirstMergeConflictMarker(content);\n if (conflictMarker) {\n throw new PmCliError(\n `Merge conflict markers detected in item document at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"merge_conflict_markers_detected\",\n required: \"Resolve merge-conflict markers in the item file before parsing or mutation commands.\",\n why: \"Partially merged documents can corrupt item metadata and history integrity.\",\n examples: [\"git status\", \"git add <resolved-file> && git commit\"],\n nextSteps: [\"Resolve conflicts, save the file, then rerun the pm command.\"],\n },\n );\n }\n const format = options.format ?? \"toon\";\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n return format === \"toon\"\n ? parseToonItemDocument(content, runtimeContext, options)\n : parseJsonMarkdownItemDocument(content, runtimeContext, options);\n}\n\nexport function serializeItemDocument(document: ItemDocument, options: ItemDocumentFormatOptions = {}): string {\n const format = options.format ?? \"toon\";\n return format === \"toon\" ? serializeToonItemDocument(document, options) : serializeJsonMarkdownItemDocument(document, options);\n}\n\nexport function canonicalDocument(document: ItemDocument, options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {}): ItemDocument {\n return {\n metadata: normalizeFrontMatter(document.metadata, options),\n body: normalizeBody(document.body ?? \"\"),\n };\n}\n","import { decode as decodeToon } from \"@toon-format/toon\";\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR = \"https://github.com/toon-format/toon/pull/314\" as const;\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_TRACKING = {\n dependency: \"@toon-format/toon\",\n affected_versions: \"<=2.3.0\",\n upstream_pr: TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR,\n removal_condition:\n \"Remove escapeBracketsInQuotedScalars retry once the upstream strict decoder fix ships in a released @toon-format/toon version and this repository upgrades to it.\",\n} as const;\n\nexport interface ToonDecodeResult {\n /** The decoded TOON document. */\n value: unknown;\n /** True when the strict decode required the scalar-bracket escape workaround. */\n usedScalarBracketEscape: boolean;\n}\n\n/**\n * Escape `[` as `\\u005b` inside quoted scalar values so the upstream\n * `@toon-format/toon` strict decoder cannot mis-read them.\n *\n * The upstream bug: the strict decoder's array-header detection scans the whole\n * line for an opening bracket when the key is unquoted, so a quoted scalar value\n * that contains a bracketed token followed (anywhere later on the line) by a\n * colon, e.g. `body: \"POST [redacted]: ok\"` or `desc: \"sntr[ysu]_ ... :\"`, is\n * mis-detected as a `key`+bracket+colon array header and throws. The library's\n * own `encode()` emits exactly this otherwise-correctly-quoted form, so strict\n * decode cannot read the encoder's own output for such values.\n *\n * A line is treated as a scalar `key: value` (not an array header) only when its\n * `\": \"` key/value separator occurs before the first `[`; array-header lines\n * (`tags[3]:`, `comments[6]{...}:`) have the bracket first and are left\n * untouched, as are non-string (unquoted) values. Within a matched quoted value\n * every `[` becomes `\\u005b`, which the decoder unescapes back to `[`, so the\n * decoded value is byte-for-byte identical. Crucially, this neutralises only the\n * bracket trigger and nothing else, so the retry stays in strict mode and every\n * other strict invariant (duplicate sibling keys, array-count mismatches, tabs\n * in indentation, ...) is still enforced.\n *\n * Upstream tracking metadata lives in {@link TOON_SCALAR_BRACKET_ESCAPE_TRACKING}.\n */\nfunction escapeBracketsInQuotedScalars(content: string): string {\n return content\n .split(\"\\n\")\n .map((line) => {\n const separatorIndex = line.indexOf(\": \");\n const bracketIndex = line.indexOf(\"[\");\n if (separatorIndex === -1 || bracketIndex === -1 || bracketIndex < separatorIndex) {\n return line;\n }\n const key = line.slice(0, separatorIndex + 2);\n const value = line.slice(separatorIndex + 2);\n if (!value.startsWith('\"')) {\n return line;\n }\n return key + value.replaceAll(\"[\", \"\\\\u005b\");\n })\n .join(\"\\n\");\n}\n\n/**\n * Decode a TOON item document, working around the upstream bracket mis-parse\n * bug described in {@link escapeBracketsInQuotedScalars}.\n *\n * Strict decode is attempted first (the fast path for all well-formed\n * documents). Only if it fails is the scalar-bracket escape applied and strict\n * decode retried, so the workaround never relaxes strict validation; it only\n * removes the specific trigger. If the escaped content is identical to the\n * original (no quoted-scalar bracket to neutralise) the original strict error is\n * surfaced unchanged; if the retry itself fails the document has a genuine\n * problem beyond the bracket bug and that error propagates.\n */\nexport function decodeToonItemContent(content: string): ToonDecodeResult {\n try {\n return { value: decodeToon(content), usedScalarBracketEscape: false };\n } catch (strictError) {\n const escaped = escapeBracketsInQuotedScalars(content);\n if (escaped === content) {\n throw strictError;\n }\n return { value: decodeToon(escaped), usedScalarBracketEscape: true };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAAS,aAAa,OAAa;AACjC,QAAM,WAAW,MACd,KAAI,EACJ,WAAW,kBAAkB,GAAG,EAChC,MAAM,KAAK,EACX,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC,EACtC,IAAI,CAAC,YAAY,QAAQ,YAAW,CAAE;AACzC,MAAI,SAAS,WAAW,GAAG;AACzB,WAAO;EACT;AACA,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AACzB,SAAO,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC,YAAY,GAAG,QAAQ,MAAM,GAAG,CAAC,EAAE,YAAW,CAA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EAAO,cAAc;;AACtD;AAEA,SAAS,0BACP,UACA,UAA2F,CAAA,GAAE;AAE7F,QAAM,wBAAwB,qBAAqB,SAAS,UAAU,OAAO;AAC7E,QAAM,qBAAqB,iBAAiB,qBAAqB;AACjE,QAAM,iBAAiB,cAAc,SAAS,QAAQ,EAAE;AACxD,SAAO,GAAG,WAAW,EAAE,GAAG,oBAAoB,MAAM,eAAc,CAAE,CAAC;;AACvE;AAEM,SAAU,kBAAkB,SAAiB,UAAqC,CAAA,GAAE;AACxF,QAAM,iBAAiB,6BAA6B,OAAO;AAC3D,MAAI,gBAAgB;AAClB,UAAM,IAAI,WACR,4DAA4D,eAAe,IAAI,KAAK,eAAe,MAAM,yDACzG,UAAU,iBACV;MACE,MAAM;MACN,UAAU;MACV,KAAK;MACL,UAAU,CAAC,cAAc,uCAAuC;MAChE,WAAW,CAAC,8DAA8D;KAC3E;EAEL;AACA,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,iBAAiB,sCAAsC,OAAO;AACpE,SAAO,WAAW,SACd,sBAAsB,SAAS,gBAAgB,OAAO,IACtD,8BAA8B,SAAS,gBAAgB,OAAO;AACpE;AAEM,SAAU,sBAAsB,UAAwB,UAAqC,CAAA,GAAE;AACnG,QAAM,SAAS,QAAQ,UAAU;AACjC,SAAO,WAAW,SAAS,0BAA0B,UAAU,OAAO,IAAI,kCAAkC,UAAU,OAAO;AAC/H;AAEM,SAAU,kBAAkB,UAAwB,UAA2F,CAAA,GAAE;AACrJ,SAAO;IACL,UAAU,qBAAqB,SAAS,UAAU,OAAO;IACzD,MAAM,cAAc,SAAS,QAAQ,EAAE;;AAE3C","debugId":"8e6380db-298c-5343-b79e-9939444e8ad2"}
@@ -3,21 +3,21 @@ import {
3
3
  } from "./chunk-O7IWB35H.js";
4
4
  import {
5
5
  parseCsvKv
6
- } from "./chunk-CJDQB2ED.js";
6
+ } from "./chunk-HV5SSZXF.js";
7
7
  import {
8
8
  parseLimit
9
- } from "./chunk-K47WAYQV.js";
9
+ } from "./chunk-SFFVGNHC.js";
10
10
  import {
11
11
  locateItem,
12
12
  mutateItem,
13
13
  readLocatedItem
14
- } from "./chunk-XG7RJYHV.js";
14
+ } from "./chunk-TP4DDY27.js";
15
15
  import {
16
16
  resolveItemTypeRegistry
17
- } from "./chunk-4PJQSECJ.js";
17
+ } from "./chunk-HRMHZ4RV.js";
18
18
  import {
19
19
  nowIso
20
- } from "./chunk-RANZIID5.js";
20
+ } from "./chunk-FHHBD7PN.js";
21
21
  import {
22
22
  EXIT_CODE,
23
23
  PmCliError,
@@ -26,7 +26,7 @@ import {
26
26
  pathExists,
27
27
  readSettings,
28
28
  resolvePmRoot
29
- } from "./chunk-SRVKTWPR.js";
29
+ } from "./chunk-UJUT6AHZ.js";
30
30
 
31
31
  // dist/cli/commands/annotation-command.js
32
32
  !(function() {
@@ -154,4 +154,4 @@ export {
154
154
  wrapOwnershipConflict,
155
155
  runAnnotationCommand
156
156
  };
157
- //# sourceMappingURL=chunk-LDJK7SHN.js.map
157
+ //# sourceMappingURL=chunk-V6EYFTRL.js.map
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  locateItem,
3
3
  readLocatedItem
4
- } from "./chunk-XG7RJYHV.js";
4
+ } from "./chunk-TP4DDY27.js";
5
5
  import {
6
6
  resolveItemTypeRegistry
7
- } from "./chunk-4PJQSECJ.js";
7
+ } from "./chunk-HRMHZ4RV.js";
8
8
  import {
9
9
  nowIso
10
- } from "./chunk-RANZIID5.js";
10
+ } from "./chunk-FHHBD7PN.js";
11
11
  import {
12
+ coercePositiveInteger,
12
13
  getActiveExtensionRegistrations,
13
14
  getSettingsPath,
14
15
  isFiniteNumberArray,
@@ -21,7 +22,7 @@ import {
21
22
  toNonEmptyString,
22
23
  trimTrailingSlashes,
23
24
  writeFileAtomic
24
- } from "./chunk-SRVKTWPR.js";
25
+ } from "./chunk-UJUT6AHZ.js";
25
26
 
26
27
  // dist/core/search/http-client.js
27
28
  !(function() {
@@ -303,13 +304,14 @@ async function executeEmbeddingRequest(provider, input, options = {}) {
303
304
  !(function() {
304
305
  try {
305
306
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
306
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7313bc13-6a82-501a-9415-96d797cfb917");
307
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b06becd9-0d3b-5afb-94d7-86fbc9b9f82f");
307
308
  } catch (e2) {
308
309
  }
309
310
  })();
310
311
  var DEFAULT_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS = 8e3;
311
312
  var OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS = 3200;
312
313
  var SEMANTIC_CORPUS_TRUNCATION_SUFFIX = "...[semantic corpus truncated]";
314
+ var SEARCH_EMBEDDING_CORPUS_MAX_CHARACTERS_INVALID_WARNING = "search_embedding_corpus_max_characters_invalid:using_provider_default";
313
315
  function compactParts(parts) {
314
316
  return parts.map((part) => part === void 0 || part === null ? "" : String(part).trim()).filter((part) => part.length > 0).join(" ");
315
317
  }
@@ -418,21 +420,29 @@ function buildSearchCorpus(document) {
418
420
  }
419
421
  return corpus;
420
422
  }
421
- function resolveSemanticCorpusInputMaxCharacters(candidate) {
422
- if (Number.isFinite(candidate) && Number(candidate) > 0) {
423
- return Math.floor(Number(candidate));
424
- }
425
- return DEFAULT_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS;
426
- }
427
423
  function resolveSemanticCorpusInputCharacterLimit(providerName) {
428
424
  if (providerName?.trim().toLowerCase() === "ollama") {
429
425
  return OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS;
430
426
  }
431
427
  return DEFAULT_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS;
432
428
  }
429
+ function resolveSemanticCorpusCharacterLimit(providerName, configuredMaxCharacters) {
430
+ const providerDefaultLimit = resolveSemanticCorpusInputCharacterLimit(providerName);
431
+ const parsed = coercePositiveInteger(configuredMaxCharacters);
432
+ if (parsed !== null) {
433
+ return {
434
+ maxCharacters: parsed,
435
+ warning: null
436
+ };
437
+ }
438
+ return {
439
+ maxCharacters: providerDefaultLimit,
440
+ warning: configuredMaxCharacters === void 0 || configuredMaxCharacters === null ? null : SEARCH_EMBEDDING_CORPUS_MAX_CHARACTERS_INVALID_WARNING
441
+ };
442
+ }
433
443
  function buildSemanticCorpusInput(document, options = {}) {
434
444
  const serialized = JSON.stringify(buildSearchCorpus(document));
435
- const maxCharacters = resolveSemanticCorpusInputMaxCharacters(options.maxCharacters ?? resolveSemanticCorpusInputCharacterLimit(options.providerName));
445
+ const maxCharacters = resolveSemanticCorpusCharacterLimit(options.providerName, options.maxCharacters).maxCharacters;
436
446
  if (serialized.length <= maxCharacters) {
437
447
  return serialized;
438
448
  }
@@ -594,14 +604,20 @@ import { basename, dirname, join, resolve } from "node:path";
594
604
  !(function() {
595
605
  try {
596
606
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
597
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d7830a17-8330-53f9-8d7b-b978e22febf8");
607
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "aa5558e1-7599-5645-b5e6-02dad2937f2c");
598
608
  } catch (e2) {
599
609
  }
600
610
  })();
601
611
  var DEFAULT_COLLECTION = "pm_items";
612
+ var COLLECTION_SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
613
+ var MAX_COLLECTION_NAME_LENGTH = 128;
602
614
  var LANCE_DB_LOCAL_SNAPSHOT_DIR = ".pm-cli-local-vectors";
603
615
  var LANCE_DB_LOCAL_SNAPSHOT_VERSION = 1;
604
616
  var lanceDbLocalTables = /* @__PURE__ */ new Map();
617
+ function resolveStoreCollectionName(store) {
618
+ const candidate = toNonEmptyString(store.collection_name) ?? DEFAULT_COLLECTION;
619
+ return candidate.replaceAll(COLLECTION_SANITIZE_PATTERN, "_").slice(0, MAX_COLLECTION_NAME_LENGTH);
620
+ }
605
621
  function normalizeVector(value) {
606
622
  if (!isFiniteNumberArray(value) || value.length === 0) {
607
623
  throw new Error("Vector values must be a non-empty numeric array");
@@ -676,10 +692,12 @@ function resolveQdrantStore(settings) {
676
692
  if (!url) {
677
693
  return null;
678
694
  }
695
+ const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
679
696
  const apiKey = toNonEmptyString(settings.vector_store?.qdrant?.api_key);
680
697
  return {
681
698
  name: "qdrant",
682
699
  url,
700
+ ...collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {},
683
701
  ...apiKey ? { api_key: apiKey } : {}
684
702
  };
685
703
  }
@@ -688,9 +706,11 @@ function resolveLanceDbStore(settings) {
688
706
  if (!lancedbPath) {
689
707
  return null;
690
708
  }
709
+ const collectionName = toNonEmptyString(settings.vector_store?.collection_name);
691
710
  return {
692
711
  name: "lancedb",
693
- path: lancedbPath
712
+ path: lancedbPath,
713
+ ...collectionName && collectionName !== DEFAULT_COLLECTION ? { collection_name: collectionName } : {}
694
714
  };
695
715
  }
696
716
  function normalizeVectorRecords(records) {
@@ -917,19 +937,22 @@ function resolveVectorStores(settings) {
917
937
  };
918
938
  }
919
939
  function resolveVectorStoreRequestTarget(store) {
940
+ const collectionName = resolveStoreCollectionName(store);
920
941
  if (store.name === "qdrant") {
921
942
  const baseUrl = trimTrailingSlashes(store.url);
943
+ const encodedCollection2 = encodeURIComponent(collectionName);
922
944
  return {
923
945
  store: "qdrant",
924
- query_target: `${baseUrl}/collections/${DEFAULT_COLLECTION}/points/search`,
925
- upsert_target: `${baseUrl}/collections/${DEFAULT_COLLECTION}/points?wait=true`
946
+ query_target: `${baseUrl}/collections/${encodedCollection2}/points/search`,
947
+ upsert_target: `${baseUrl}/collections/${encodedCollection2}/points?wait=true`
926
948
  };
927
949
  }
928
950
  const encodedPath = encodeURIComponent(store.path);
951
+ const encodedCollection = encodeURIComponent(collectionName);
929
952
  return {
930
953
  store: "lancedb",
931
- query_target: `lancedb://${encodedPath}#${DEFAULT_COLLECTION}`,
932
- upsert_target: `lancedb://${encodedPath}#${DEFAULT_COLLECTION}`
954
+ query_target: `lancedb://${encodedPath}#${encodedCollection}`,
955
+ upsert_target: `lancedb://${encodedPath}#${encodedCollection}`
933
956
  };
934
957
  }
935
958
  function buildVectorQueryPlan(store, vector, limit) {
@@ -953,7 +976,7 @@ function buildVectorQueryPlan(store, vector, limit) {
953
976
  method: "LOCAL",
954
977
  headers: {},
955
978
  body: {
956
- table: DEFAULT_COLLECTION,
979
+ table: resolveStoreCollectionName(store),
957
980
  vector: normalizedVector,
958
981
  limit: normalizedLimit
959
982
  }
@@ -977,7 +1000,7 @@ function buildVectorUpsertPlan(store, records) {
977
1000
  method: "LOCAL",
978
1001
  headers: {},
979
1002
  body: {
980
- table: DEFAULT_COLLECTION,
1003
+ table: resolveStoreCollectionName(store),
981
1004
  records: normalizedRecords
982
1005
  }
983
1006
  };
@@ -1000,7 +1023,7 @@ function buildVectorDeletePlan(store, ids) {
1000
1023
  method: "LOCAL",
1001
1024
  headers: {},
1002
1025
  body: {
1003
- table: DEFAULT_COLLECTION,
1026
+ table: resolveStoreCollectionName(store),
1004
1027
  ids: normalizedIds
1005
1028
  }
1006
1029
  };
@@ -1122,11 +1145,11 @@ import path2 from "node:path";
1122
1145
  !(function() {
1123
1146
  try {
1124
1147
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1125
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cb3bf8c3-a4d6-5e02-878f-1a7c18fb9438");
1148
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1475194b-b67b-529f-8a83-c67f1d77908b");
1126
1149
  } catch (e2) {
1127
1150
  }
1128
1151
  })();
1129
- function resolveBatchRuntime(settings) {
1152
+ function resolveBatchRuntime(settings, maxInputCharacters) {
1130
1153
  const batchSizeCandidate = settings.search.embedding_batch_size;
1131
1154
  const timeoutMsCandidate = settings.search.embedding_timeout_ms;
1132
1155
  const maxRetriesCandidate = settings.search.scanner_max_batch_retries;
@@ -1138,7 +1161,7 @@ function resolveBatchRuntime(settings) {
1138
1161
  timeoutMs,
1139
1162
  maxRetries,
1140
1163
  maxBatchInputCharacters: Number.POSITIVE_INFINITY,
1141
- maxInputCharacters: DEFAULT_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS
1164
+ maxInputCharacters
1142
1165
  };
1143
1166
  }
1144
1167
  function createBatches(inputs, batchSize, maxBatchInputCharacters) {
@@ -1165,8 +1188,7 @@ function resolveProviderBatchRuntime(provider, runtime) {
1165
1188
  }
1166
1189
  return {
1167
1190
  ...runtime,
1168
- maxBatchInputCharacters: OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS,
1169
- maxInputCharacters: OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS
1191
+ maxBatchInputCharacters: OLLAMA_SEMANTIC_CORPUS_INPUT_MAX_CHARACTERS
1170
1192
  };
1171
1193
  }
1172
1194
  function truncateInputForRuntime(input, maxInputCharacters) {
@@ -1224,8 +1246,12 @@ async function executeEmbeddingBatchesWithRetry(provider, settings, inputs, opti
1224
1246
  warnings: []
1225
1247
  };
1226
1248
  }
1227
- const runtime = resolveProviderBatchRuntime(provider, resolveBatchRuntime(settings));
1228
1249
  const warnings = [];
1250
+ const corpusLimitResolution = resolveSemanticCorpusCharacterLimit(provider.name, settings.search.embedding_corpus_max_characters);
1251
+ if (corpusLimitResolution.warning) {
1252
+ warnings.push(corpusLimitResolution.warning);
1253
+ }
1254
+ const runtime = resolveProviderBatchRuntime(provider, resolveBatchRuntime(settings, corpusLimitResolution.maxCharacters));
1229
1255
  let truncatedInputCount = 0;
1230
1256
  const normalizedInputs = inputs.map((input) => {
1231
1257
  const normalized = truncateInputForRuntime(input, runtime.maxInputCharacters);
@@ -1482,7 +1508,7 @@ function inferConsistentVectorDimension(vectors, context) {
1482
1508
  !(function() {
1483
1509
  try {
1484
1510
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1485
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5d698c95-b557-5c29-bc3f-caf70b5d6d0f");
1511
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "639e41e7-594f-5eec-bef8-80e83500c08a");
1486
1512
  } catch (e2) {
1487
1513
  }
1488
1514
  })();
@@ -1665,8 +1691,10 @@ async function collectSemanticRefreshWorkload(pmRoot, idPrefix, preferredFormat,
1665
1691
  };
1666
1692
  }
1667
1693
  async function embedLocatedSemanticVectors(settings, provider, documents) {
1694
+ const corpusCharacterLimit = resolveSemanticCorpusCharacterLimit(provider.name, settings.search.embedding_corpus_max_characters).maxCharacters;
1668
1695
  const corpusInputs = documents.map((entry) => buildSemanticCorpusInput(entry.document, {
1669
- providerName: provider.name
1696
+ providerName: provider.name,
1697
+ maxCharacters: corpusCharacterLimit
1670
1698
  }));
1671
1699
  const embeddingResult = await executeEmbeddingBatchesWithRetry(provider, settings, corpusInputs);
1672
1700
  return {
@@ -1888,4 +1916,4 @@ export {
1888
1916
  refreshSemanticEmbeddingsForMutatedItems,
1889
1917
  refreshSearchArtifactsForMutation
1890
1918
  };
1891
- //# sourceMappingURL=chunk-5IRA6IYD.js.map
1919
+ //# sourceMappingURL=chunk-WAA7UI6M.js.map