@unbrained/pm-cli 2026.6.12 → 2026.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (777) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +2 -2
  3. package/dist/cli/bootstrap-args.d.ts +29 -0
  4. package/dist/cli/bootstrap-args.js +11 -4
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.d.ts +12 -0
  7. package/dist/cli/commander-usage.js +18 -7
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/activity.d.ts +19 -0
  10. package/dist/cli/commands/activity.js +12 -2
  11. package/dist/cli/commands/activity.js.map +1 -1
  12. package/dist/cli/commands/aggregate.d.ts +58 -0
  13. package/dist/cli/commands/aggregate.js +48 -15
  14. package/dist/cli/commands/aggregate.js.map +1 -1
  15. package/dist/cli/commands/annotation-command.d.ts +6 -1
  16. package/dist/cli/commands/annotation-command.js +72 -2
  17. package/dist/cli/commands/annotation-command.js.map +1 -1
  18. package/dist/cli/commands/append.js +4 -3
  19. package/dist/cli/commands/append.js.map +1 -1
  20. package/dist/cli/commands/close-many.d.ts +20 -0
  21. package/dist/cli/commands/close-many.js +14 -23
  22. package/dist/cli/commands/close-many.js.map +1 -1
  23. package/dist/cli/commands/close.js +37 -4
  24. package/dist/cli/commands/close.js.map +1 -1
  25. package/dist/cli/commands/comments-audit.js +3 -2
  26. package/dist/cli/commands/comments-audit.js.map +1 -1
  27. package/dist/cli/commands/comments.d.ts +2 -0
  28. package/dist/cli/commands/comments.js +49 -23
  29. package/dist/cli/commands/comments.js.map +1 -1
  30. package/dist/cli/commands/completion.js +269 -8
  31. package/dist/cli/commands/completion.js.map +1 -1
  32. package/dist/cli/commands/config.d.ts +51 -1
  33. package/dist/cli/commands/config.js +50 -12
  34. package/dist/cli/commands/config.js.map +1 -1
  35. package/dist/cli/commands/context.d.ts +79 -1
  36. package/dist/cli/commands/context.js +151 -25
  37. package/dist/cli/commands/context.js.map +1 -1
  38. package/dist/cli/commands/contracts.d.ts +80 -1
  39. package/dist/cli/commands/contracts.js +54 -4
  40. package/dist/cli/commands/contracts.js.map +1 -1
  41. package/dist/cli/commands/create.d.ts +49 -0
  42. package/dist/cli/commands/create.js +112 -7
  43. package/dist/cli/commands/create.js.map +1 -1
  44. package/dist/cli/commands/dedupe-audit.d.ts +33 -0
  45. package/dist/cli/commands/dedupe-audit.js +18 -14
  46. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  47. package/dist/cli/commands/deps.js +7 -4
  48. package/dist/cli/commands/deps.js.map +1 -1
  49. package/dist/cli/commands/event-validation-messages.js +3 -3
  50. package/dist/cli/commands/event-validation-messages.js.map +1 -1
  51. package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
  52. package/dist/cli/commands/extension/bundled-catalog.js +19 -15
  53. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  54. package/dist/cli/commands/extension/install-sources.d.ts +41 -1
  55. package/dist/cli/commands/extension/install-sources.js +26 -8
  56. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  57. package/dist/cli/commands/extension/shared.d.ts +5 -0
  58. package/dist/cli/commands/extension/shared.js +9 -3
  59. package/dist/cli/commands/extension/shared.js.map +1 -1
  60. package/dist/cli/commands/extension.d.ts +133 -1
  61. package/dist/cli/commands/extension.js +127 -9
  62. package/dist/cli/commands/extension.js.map +1 -1
  63. package/dist/cli/commands/files.d.ts +30 -1
  64. package/dist/cli/commands/files.js +21 -2
  65. package/dist/cli/commands/files.js.map +1 -1
  66. package/dist/cli/commands/focus.d.ts +11 -0
  67. package/dist/cli/commands/focus.js +86 -0
  68. package/dist/cli/commands/focus.js.map +1 -0
  69. package/dist/cli/commands/get.d.ts +9 -2
  70. package/dist/cli/commands/get.js +34 -6
  71. package/dist/cli/commands/get.js.map +1 -1
  72. package/dist/cli/commands/guide.d.ts +5 -0
  73. package/dist/cli/commands/guide.js +6 -3
  74. package/dist/cli/commands/guide.js.map +1 -1
  75. package/dist/cli/commands/health.d.ts +109 -0
  76. package/dist/cli/commands/health.js +87 -35
  77. package/dist/cli/commands/health.js.map +1 -1
  78. package/dist/cli/commands/history-compact.js +27 -36
  79. package/dist/cli/commands/history-compact.js.map +1 -1
  80. package/dist/cli/commands/history-redact.d.ts +46 -0
  81. package/dist/cli/commands/history-redact.js +99 -67
  82. package/dist/cli/commands/history-redact.js.map +1 -1
  83. package/dist/cli/commands/history-repair.js +34 -37
  84. package/dist/cli/commands/history-repair.js.map +1 -1
  85. package/dist/cli/commands/history.js +6 -2
  86. package/dist/cli/commands/history.js.map +1 -1
  87. package/dist/cli/commands/index.d.ts +1 -0
  88. package/dist/cli/commands/index.js +3 -2
  89. package/dist/cli/commands/index.js.map +1 -1
  90. package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
  91. package/dist/cli/commands/init-agent-guidance.js +31 -4
  92. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  93. package/dist/cli/commands/init.d.ts +36 -1
  94. package/dist/cli/commands/init.js +38 -5
  95. package/dist/cli/commands/init.js.map +1 -1
  96. package/dist/cli/commands/learnings.js +4 -3
  97. package/dist/cli/commands/learnings.js.map +1 -1
  98. package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
  99. package/dist/cli/commands/linked-test-parsers.js +5 -2
  100. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  101. package/dist/cli/commands/list-filter-shared.d.ts +8 -0
  102. package/dist/cli/commands/list-filter-shared.js +70 -0
  103. package/dist/cli/commands/list-filter-shared.js.map +1 -0
  104. package/dist/cli/commands/list.d.ts +116 -0
  105. package/dist/cli/commands/list.js +194 -6
  106. package/dist/cli/commands/list.js.map +1 -1
  107. package/dist/cli/commands/normalize.js +16 -2
  108. package/dist/cli/commands/normalize.js.map +1 -1
  109. package/dist/cli/commands/notes.js +4 -3
  110. package/dist/cli/commands/notes.js.map +1 -1
  111. package/dist/cli/commands/plan.js +3 -2
  112. package/dist/cli/commands/plan.js.map +1 -1
  113. package/dist/cli/commands/reindex.d.ts +83 -0
  114. package/dist/cli/commands/reindex.js +45 -10
  115. package/dist/cli/commands/reindex.js.map +1 -1
  116. package/dist/cli/commands/restore.d.ts +40 -1
  117. package/dist/cli/commands/restore.js +27 -2
  118. package/dist/cli/commands/restore.js.map +1 -1
  119. package/dist/cli/commands/schema.d.ts +18 -0
  120. package/dist/cli/commands/schema.js +30 -3
  121. package/dist/cli/commands/schema.js.map +1 -1
  122. package/dist/cli/commands/search.d.ts +289 -1
  123. package/dist/cli/commands/search.js +367 -60
  124. package/dist/cli/commands/search.js.map +1 -1
  125. package/dist/cli/commands/stats.d.ts +38 -0
  126. package/dist/cli/commands/stats.js +38 -10
  127. package/dist/cli/commands/stats.js.map +1 -1
  128. package/dist/cli/commands/telemetry.js +5 -3
  129. package/dist/cli/commands/telemetry.js.map +1 -1
  130. package/dist/cli/commands/templates.d.ts +18 -0
  131. package/dist/cli/commands/templates.js +9 -2
  132. package/dist/cli/commands/templates.js.map +1 -1
  133. package/dist/cli/commands/test-all.d.ts +5 -0
  134. package/dist/cli/commands/test-all.js +9 -3
  135. package/dist/cli/commands/test-all.js.map +1 -1
  136. package/dist/cli/commands/test.d.ts +70 -1
  137. package/dist/cli/commands/test.js +84 -3
  138. package/dist/cli/commands/test.js.map +1 -1
  139. package/dist/cli/commands/update-many.d.ts +34 -1
  140. package/dist/cli/commands/update-many.js +60 -31
  141. package/dist/cli/commands/update-many.js.map +1 -1
  142. package/dist/cli/commands/update.d.ts +71 -0
  143. package/dist/cli/commands/update.js +74 -8
  144. package/dist/cli/commands/update.js.map +1 -1
  145. package/dist/cli/commands/upgrade.d.ts +28 -1
  146. package/dist/cli/commands/upgrade.js +17 -4
  147. package/dist/cli/commands/upgrade.js.map +1 -1
  148. package/dist/cli/commands/validate.d.ts +114 -0
  149. package/dist/cli/commands/validate.js +154 -9
  150. package/dist/cli/commands/validate.js.map +1 -1
  151. package/dist/cli/error-guidance.d.ts +30 -0
  152. package/dist/cli/error-guidance.js +68 -6
  153. package/dist/cli/error-guidance.js.map +1 -1
  154. package/dist/cli/extension-command-options.js +9 -7
  155. package/dist/cli/extension-command-options.js.map +1 -1
  156. package/dist/cli/help-content.d.ts +8 -0
  157. package/dist/cli/help-content.js +30 -6
  158. package/dist/cli/help-content.js.map +1 -1
  159. package/dist/cli/help-json-payload.d.ts +19 -1
  160. package/dist/cli/help-json-payload.js +16 -7
  161. package/dist/cli/help-json-payload.js.map +1 -1
  162. package/dist/cli/main.d.ts +223 -0
  163. package/dist/cli/main.js +214 -46
  164. package/dist/cli/main.js.map +1 -1
  165. package/dist/cli/register-list-query.js +62 -5
  166. package/dist/cli/register-list-query.js.map +1 -1
  167. package/dist/cli/register-mutation.d.ts +16 -0
  168. package/dist/cli/register-mutation.js +210 -40
  169. package/dist/cli/register-mutation.js.map +1 -1
  170. package/dist/cli/register-operations.d.ts +8 -0
  171. package/dist/cli/register-operations.js +33 -11
  172. package/dist/cli/register-operations.js.map +1 -1
  173. package/dist/cli/register-setup.js +9 -6
  174. package/dist/cli/register-setup.js.map +1 -1
  175. package/dist/cli/registration-helpers.d.ts +4 -0
  176. package/dist/cli/registration-helpers.js +124 -38
  177. package/dist/cli/registration-helpers.js.map +1 -1
  178. package/dist/cli-bundle/chunks/activity-5P2KQCTH.js +18 -0
  179. package/dist/cli-bundle/chunks/{activity-XADJOG6G.js → activity-MJGTX4LO.js} +13 -11
  180. package/dist/cli-bundle/chunks/{aggregate-OD36DJU5.js → aggregate-MH3GROKB.js} +54 -25
  181. package/dist/cli-bundle/chunks/aggregate-MH3GROKB.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{aggregate-6OTS3AOO.js → aggregate-OUGCDFNC.js} +55 -26
  183. package/dist/cli-bundle/chunks/aggregate-OUGCDFNC.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{append-JYWO4P7W.js → append-2Q4BPUBW.js} +10 -10
  185. package/dist/cli-bundle/chunks/{append-JYWO4P7W.js.map → append-2Q4BPUBW.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{append-KG55G7S3.js → append-VCRUG2W6.js} +11 -11
  187. package/dist/cli-bundle/chunks/append-VCRUG2W6.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js → chunk-2IUJBMKS.js} +10 -9
  189. package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js.map → chunk-2IUJBMKS.js.map} +2 -2
  190. package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js → chunk-2JEGCDYT.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js → chunk-3WAULYOY.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-UIG4TW2H.js → chunk-3XOXWOGA.js} +359 -19
  193. package/dist/cli-bundle/chunks/chunk-3XOXWOGA.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-3KLPFWZ4.js → chunk-4KBK4BA3.js} +16 -34
  195. package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-OLKBSY4N.js → chunk-4VLB4JH2.js} +51 -8
  197. package/dist/cli-bundle/chunks/chunk-4VLB4JH2.js.map +7 -0
  198. package/dist/cli-bundle/chunks/{chunk-ZMW77VWV.js → chunk-656HPQPO.js} +27 -12
  199. package/dist/cli-bundle/chunks/chunk-656HPQPO.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{chunk-CW6E4NAT.js → chunk-667XI4UJ.js} +309 -20
  201. package/dist/cli-bundle/chunks/chunk-667XI4UJ.js.map +1 -0
  202. package/dist/cli-bundle/chunks/{chunk-5SCT2JCT.js → chunk-6BV7ENQL.js} +9 -8
  203. package/dist/cli-bundle/chunks/chunk-6BV7ENQL.js.map +7 -0
  204. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
  205. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
  206. package/dist/cli-bundle/chunks/{chunk-VFUZV5EB.js → chunk-6NQXMGYU.js} +19 -8
  207. package/dist/cli-bundle/chunks/chunk-6NQXMGYU.js.map +7 -0
  208. package/dist/cli-bundle/chunks/{chunk-GKIZW7SM.js → chunk-764O7EUA.js} +223 -50
  209. package/dist/cli-bundle/chunks/chunk-764O7EUA.js.map +7 -0
  210. package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js → chunk-7AGIXLNK.js} +3 -3
  211. package/dist/cli-bundle/chunks/chunk-7EILPFMA.js +404 -0
  212. package/dist/cli-bundle/chunks/chunk-7EILPFMA.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-HI7STVF2.js → chunk-7K2MXFMX.js} +14 -32
  214. package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-TNAP7EJX.js → chunk-7L5VOUYP.js} +6 -17
  216. package/dist/cli-bundle/chunks/chunk-7L5VOUYP.js.map +7 -0
  217. package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js +61 -0
  218. package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-7IYFN5R7.js → chunk-A576QZDL.js} +223 -50
  220. package/dist/cli-bundle/chunks/chunk-A576QZDL.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-KBPQHXWG.js → chunk-AERT7KT3.js} +5 -5
  222. package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js +58 -0
  223. package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-KWAXVAXX.js → chunk-B5Q7XC4K.js} +117 -37
  225. package/dist/cli-bundle/chunks/chunk-B5Q7XC4K.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-EWFY7SLA.js → chunk-BJWTFOZM.js} +74 -14
  227. package/dist/cli-bundle/chunks/chunk-BJWTFOZM.js.map +1 -0
  228. package/dist/cli-bundle/chunks/{chunk-XJDGS74Y.js → chunk-CBMETQ2U.js} +105 -31
  229. package/dist/cli-bundle/chunks/chunk-CBMETQ2U.js.map +1 -0
  230. package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js → chunk-E6J2PEK6.js} +3 -3
  231. package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js → chunk-F2GC6L3N.js} +3 -3
  232. package/dist/cli-bundle/chunks/{chunk-I7NYDZDV.js → chunk-F7WSO5UX.js} +7 -18
  233. package/dist/cli-bundle/chunks/chunk-F7WSO5UX.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js → chunk-FTAZLAR7.js} +8 -5
  235. package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js.map → chunk-FTAZLAR7.js.map} +1 -1
  236. package/dist/cli-bundle/chunks/{chunk-OASDW5UI.js → chunk-FXNT5LPX.js} +77 -9
  237. package/dist/cli-bundle/chunks/chunk-FXNT5LPX.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-WUNFKP7M.js → chunk-G2YVUY7I.js} +14 -9
  239. package/dist/cli-bundle/chunks/chunk-G2YVUY7I.js.map +1 -0
  240. package/dist/cli-bundle/chunks/{chunk-L5EPZQIC.js → chunk-G3CEIXTV.js} +68 -19
  241. package/dist/cli-bundle/chunks/chunk-G3CEIXTV.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{chunk-UUWGCWBU.js → chunk-GAVE4MYM.js} +37 -63
  243. package/dist/cli-bundle/chunks/chunk-GAVE4MYM.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js → chunk-GQ4JKNMV.js} +4 -4
  245. package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js.map → chunk-GQ4JKNMV.js.map} +1 -1
  246. package/dist/cli-bundle/chunks/{chunk-73ZPG2I3.js → chunk-GYMG7AG6.js} +36 -62
  247. package/dist/cli-bundle/chunks/chunk-GYMG7AG6.js.map +7 -0
  248. package/dist/cli-bundle/chunks/{chunk-35P4GT6E.js → chunk-H6EH6ENJ.js} +362 -22
  249. package/dist/cli-bundle/chunks/chunk-H6EH6ENJ.js.map +7 -0
  250. package/dist/cli-bundle/chunks/{chunk-F75JSIOZ.js → chunk-HDIDUME4.js} +45 -13
  251. package/dist/cli-bundle/chunks/chunk-HDIDUME4.js.map +1 -0
  252. package/dist/cli-bundle/chunks/{chunk-XWMF3POR.js → chunk-HPELHUTG.js} +122 -45
  253. package/dist/cli-bundle/chunks/chunk-HPELHUTG.js.map +1 -0
  254. package/dist/cli-bundle/chunks/{chunk-QKW5D45B.js → chunk-II7OGE3V.js} +20 -9
  255. package/dist/cli-bundle/chunks/chunk-II7OGE3V.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js → chunk-ILHLIA47.js} +5 -5
  257. package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js.map → chunk-ILHLIA47.js.map} +1 -1
  258. package/dist/cli-bundle/chunks/{chunk-P5BJOMBB.js → chunk-IMQG4VR3.js} +118 -74
  259. package/dist/cli-bundle/chunks/chunk-IMQG4VR3.js.map +1 -0
  260. package/dist/cli-bundle/chunks/{chunk-AX4GEVQC.js → chunk-IQVB3YDD.js} +88 -22
  261. package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +7 -0
  262. package/dist/cli-bundle/chunks/{chunk-I53JBTJW.js → chunk-KQ3LAMDO.js} +45 -13
  263. package/dist/cli-bundle/chunks/chunk-KQ3LAMDO.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{chunk-A6LXQFO7.js → chunk-KTVETP66.js} +334 -253
  265. package/dist/cli-bundle/chunks/chunk-KTVETP66.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{chunk-DY6C42S6.js → chunk-KZYVTOG5.js} +26 -11
  267. package/dist/cli-bundle/chunks/chunk-KZYVTOG5.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js → chunk-L6FJPOT4.js} +11 -10
  269. package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js.map → chunk-L6FJPOT4.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/{chunk-FY4SPXSC.js → chunk-LV5FFQ7M.js} +354 -266
  271. package/dist/cli-bundle/chunks/chunk-LV5FFQ7M.js.map +7 -0
  272. package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
  273. package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js → chunk-M23HXJL3.js} +2 -2
  275. package/dist/cli-bundle/chunks/{chunk-S26FESD4.js → chunk-MJZUZ2QE.js} +3 -3
  276. package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js → chunk-NCIBNERT.js} +4 -4
  277. package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js.map → chunk-NCIBNERT.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{chunk-TK5VZFHY.js → chunk-NIQHNDBZ.js} +76 -8
  279. package/dist/cli-bundle/chunks/chunk-NIQHNDBZ.js.map +7 -0
  280. package/dist/cli-bundle/chunks/{chunk-C6SAP27O.js → chunk-O46LTCXQ.js} +4 -4
  281. package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js → chunk-OCTQJP42.js} +19 -8
  282. package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js.map → chunk-OCTQJP42.js.map} +2 -2
  283. package/dist/cli-bundle/chunks/{chunk-WPDMBIX6.js → chunk-OLTYNVJR.js} +5 -5
  284. package/dist/cli-bundle/chunks/{chunk-IUKD4W6Z.js → chunk-OY3P2I6B.js} +13 -8
  285. package/dist/cli-bundle/chunks/chunk-OY3P2I6B.js.map +7 -0
  286. package/dist/cli-bundle/chunks/{chunk-SO55HRA5.js → chunk-PZD7WPUC.js} +69 -20
  287. package/dist/cli-bundle/chunks/chunk-PZD7WPUC.js.map +1 -0
  288. package/dist/cli-bundle/chunks/{chunk-HHHJ2GI3.js → chunk-Q5RLUCP3.js} +74 -14
  289. package/dist/cli-bundle/chunks/chunk-Q5RLUCP3.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{chunk-S2ZLDYGS.js → chunk-RKKIH2ZQ.js} +116 -36
  291. package/dist/cli-bundle/chunks/chunk-RKKIH2ZQ.js.map +1 -0
  292. package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js → chunk-SPYPC5CB.js} +3 -3
  293. package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js.map → chunk-SPYPC5CB.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/{chunk-7AMK6DOW.js → chunk-SY4GKIWT.js} +88 -22
  295. package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +1 -0
  296. package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js → chunk-SY4PZWIZ.js} +7 -4
  297. package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js.map → chunk-SY4PZWIZ.js.map} +2 -2
  298. package/dist/cli-bundle/chunks/{chunk-R2OUQVBK.js → chunk-T5VU7ROQ.js} +4 -4
  299. package/dist/cli-bundle/chunks/{chunk-37CYVF73.js → chunk-TIRZIQRP.js} +121 -44
  300. package/dist/cli-bundle/chunks/chunk-TIRZIQRP.js.map +7 -0
  301. package/dist/cli-bundle/chunks/{chunk-7UGSRQCL.js → chunk-TUB3DZAZ.js} +107 -33
  302. package/dist/cli-bundle/chunks/chunk-TUB3DZAZ.js.map +7 -0
  303. package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js +394 -0
  304. package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js → chunk-UBMCSJXX.js} +3 -3
  306. package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js → chunk-UUKORJSN.js} +4 -4
  307. package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
  308. package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
  309. package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js → chunk-WZCQVABQ.js} +2 -2
  310. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
  311. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
  312. package/dist/cli-bundle/chunks/{chunk-4YFAGDRH.js → chunk-XLNNCKTN.js} +322 -19
  313. package/dist/cli-bundle/chunks/chunk-XLNNCKTN.js.map +7 -0
  314. package/dist/cli-bundle/chunks/{chunk-RXAP6JL5.js → chunk-XNOY7TCB.js} +118 -74
  315. package/dist/cli-bundle/chunks/chunk-XNOY7TCB.js.map +7 -0
  316. package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js → chunk-YGRPBFMA.js} +2 -2
  317. package/dist/cli-bundle/chunks/{chunk-QNJSITCX.js → chunk-YXTLI4XP.js} +20 -9
  318. package/dist/cli-bundle/chunks/chunk-YXTLI4XP.js.map +1 -0
  319. package/dist/cli-bundle/chunks/{chunk-FDH2X65L.js → chunk-Z3MUNQRV.js} +52 -9
  320. package/dist/cli-bundle/chunks/chunk-Z3MUNQRV.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js → chunk-ZJRDVYZI.js} +4 -4
  322. package/dist/cli-bundle/chunks/{chunk-CCX4RSYZ.js → chunk-ZONXMSVB.js} +10 -9
  323. package/dist/cli-bundle/chunks/chunk-ZONXMSVB.js.map +1 -0
  324. package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js → claim-4APLUXJW.js} +10 -10
  325. package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js → claim-NEO7AGWH.js} +10 -10
  326. package/dist/cli-bundle/chunks/{close-XLEKIQSW.js → close-3QABBNGU.js} +8 -8
  327. package/dist/cli-bundle/chunks/close-ILMZR3D7.js +13 -0
  328. package/dist/cli-bundle/chunks/{close-many-AOD4HSAZ.js → close-many-MIZLTYGL.js} +32 -20
  329. package/dist/cli-bundle/chunks/close-many-MIZLTYGL.js.map +1 -0
  330. package/dist/cli-bundle/chunks/{close-many-XKAQY5CQ.js → close-many-Q7Y5AHQI.js} +31 -19
  331. package/dist/cli-bundle/chunks/close-many-Q7Y5AHQI.js.map +7 -0
  332. package/dist/cli-bundle/chunks/{comments-RN5TG4ZN.js → comments-DAIQPOMU.js} +55 -31
  333. package/dist/cli-bundle/chunks/comments-DAIQPOMU.js.map +1 -0
  334. package/dist/cli-bundle/chunks/{comments-B4RWWDJT.js → comments-IWFSVM4P.js} +54 -30
  335. package/dist/cli-bundle/chunks/comments-IWFSVM4P.js.map +7 -0
  336. package/dist/cli-bundle/chunks/{config-3JXJ3XZ7.js → config-IOJELD6O.js} +45 -19
  337. package/dist/cli-bundle/chunks/config-IOJELD6O.js.map +1 -0
  338. package/dist/cli-bundle/chunks/{config-FZ4UDC4B.js → config-PXTMAYV3.js} +44 -18
  339. package/dist/cli-bundle/chunks/config-PXTMAYV3.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{context-QBPO3BFM.js → context-QHJSCJW4.js} +128 -39
  341. package/dist/cli-bundle/chunks/context-QHJSCJW4.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{context-L36PIN35.js → context-XZS2VFKU.js} +127 -38
  343. package/dist/cli-bundle/chunks/context-XZS2VFKU.js.map +7 -0
  344. package/dist/cli-bundle/chunks/{contracts-2G66IGIA.js → contracts-B7U4OJTV.js} +54 -10
  345. package/dist/cli-bundle/chunks/contracts-B7U4OJTV.js.map +1 -0
  346. package/dist/cli-bundle/chunks/{contracts-PJCHYSO5.js → contracts-NSBVLXQ3.js} +54 -10
  347. package/dist/cli-bundle/chunks/contracts-NSBVLXQ3.js.map +7 -0
  348. package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js → copy-Q64T5FD4.js} +7 -7
  349. package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js → copy-SG34LCMU.js} +7 -7
  350. package/dist/cli-bundle/chunks/create-F5HZX2S4.js +30 -0
  351. package/dist/cli-bundle/chunks/{create-5433DP3G.js → create-IPAX2SNL.js} +16 -13
  352. package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js → delete-TLXR7LJ2.js} +7 -7
  353. package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js → delete-VH3L7DZ6.js} +7 -7
  354. package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js → deps-J3HBBLDB.js} +9 -10
  355. package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js.map → deps-J3HBBLDB.js.map} +2 -2
  356. package/dist/cli-bundle/chunks/{deps-6TSPOSGU.js → deps-XV6JJ6IN.js} +10 -11
  357. package/dist/cli-bundle/chunks/deps-XV6JJ6IN.js.map +1 -0
  358. package/dist/cli-bundle/chunks/{docs-MXLGZUIT.js → docs-GWDEB7JH.js} +9 -9
  359. package/dist/cli-bundle/chunks/{docs-I3BAF5WH.js → docs-RCLNSKID.js} +9 -9
  360. package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js → extension-5RN65LHT.js} +7 -5
  361. package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js → extension-7KO2NX2A.js} +7 -5
  362. package/dist/cli-bundle/chunks/{files-GUXUM2MB.js → files-3TCQHUHA.js} +25 -11
  363. package/dist/cli-bundle/chunks/files-3TCQHUHA.js.map +1 -0
  364. package/dist/cli-bundle/chunks/{files-FYP3MDPX.js → files-5FDUPSEA.js} +24 -10
  365. package/dist/cli-bundle/chunks/files-5FDUPSEA.js.map +7 -0
  366. package/dist/cli-bundle/chunks/focus-7AQMNRSU.js +109 -0
  367. package/dist/cli-bundle/chunks/focus-7AQMNRSU.js.map +7 -0
  368. package/dist/cli-bundle/chunks/focus-HQXBYPKM.js +106 -0
  369. package/dist/cli-bundle/chunks/focus-HQXBYPKM.js.map +1 -0
  370. package/dist/cli-bundle/chunks/{gc-KGQG66SA.js → gc-2FGKYRJ4.js} +3 -3
  371. package/dist/cli-bundle/chunks/{gc-FENB2ESG.js → gc-5B6ABL3Z.js} +3 -3
  372. package/dist/cli-bundle/chunks/{get-PCHS7RA6.js → get-FUMVOJQD.js} +43 -16
  373. package/dist/cli-bundle/chunks/get-FUMVOJQD.js.map +1 -0
  374. package/dist/cli-bundle/chunks/{get-QARTE6BL.js → get-H5BZTW4A.js} +42 -15
  375. package/dist/cli-bundle/chunks/get-H5BZTW4A.js.map +7 -0
  376. package/dist/cli-bundle/chunks/{health-E4D7KGHD.js → health-JSVOR6B4.js} +75 -49
  377. package/dist/cli-bundle/chunks/health-JSVOR6B4.js.map +1 -0
  378. package/dist/cli-bundle/chunks/{health-7MTXAVR2.js → health-LE2ZQGSM.js} +74 -48
  379. package/dist/cli-bundle/chunks/health-LE2ZQGSM.js.map +7 -0
  380. package/dist/cli-bundle/chunks/{history-7WUAEWHW.js → history-QO4JVJJP.js} +10 -10
  381. package/dist/cli-bundle/chunks/history-SSXGGTVZ.js +20 -0
  382. package/dist/cli-bundle/chunks/{history-compact-LW27IPFK.js → history-compact-ID74DOUI.js} +37 -46
  383. package/dist/cli-bundle/chunks/history-compact-ID74DOUI.js.map +7 -0
  384. package/dist/cli-bundle/chunks/{history-compact-3EJ3L2O7.js → history-compact-SDFRPZ4V.js} +38 -47
  385. package/dist/cli-bundle/chunks/history-compact-SDFRPZ4V.js.map +1 -0
  386. package/dist/cli-bundle/chunks/history-redact-VBH44Y7F.js +21 -0
  387. package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js → history-redact-Z4P5MM3G.js} +13 -11
  388. package/dist/cli-bundle/chunks/{history-repair-OSQOKJ3E.js → history-repair-ANHEYWKF.js} +43 -48
  389. package/dist/cli-bundle/chunks/history-repair-ANHEYWKF.js.map +7 -0
  390. package/dist/cli-bundle/chunks/{history-repair-SBK7P34V.js → history-repair-CKE7GLZR.js} +44 -49
  391. package/dist/cli-bundle/chunks/history-repair-CKE7GLZR.js.map +1 -0
  392. package/dist/cli-bundle/chunks/init-7FBQO77A.js +19 -0
  393. package/dist/cli-bundle/chunks/{init-S5WEGUJY.js → init-K6MSMB37.js} +11 -9
  394. package/dist/cli-bundle/chunks/{learnings-XK3P4ZDR.js → learnings-VIS3NOQV.js} +13 -12
  395. package/dist/cli-bundle/chunks/learnings-VIS3NOQV.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{learnings-HQXSSKZ5.js → learnings-YYNB64GN.js} +14 -13
  397. package/dist/cli-bundle/chunks/learnings-YYNB64GN.js.map +1 -0
  398. package/dist/cli-bundle/chunks/list-7UE44A2R.js +29 -0
  399. package/dist/cli-bundle/chunks/list-UHMA3N2K.js +33 -0
  400. package/dist/cli-bundle/chunks/{notes-5T6P7C5V.js → notes-2HRMV67I.js} +14 -13
  401. package/dist/cli-bundle/chunks/notes-2HRMV67I.js.map +1 -0
  402. package/dist/cli-bundle/chunks/{notes-U5FZCSBT.js → notes-IN3UMA7W.js} +13 -12
  403. package/dist/cli-bundle/chunks/notes-IN3UMA7W.js.map +7 -0
  404. package/dist/cli-bundle/chunks/{plan-2YTQYWGM.js → plan-I3SVH7FV.js} +16 -15
  405. package/dist/cli-bundle/chunks/plan-I3SVH7FV.js.map +1 -0
  406. package/dist/cli-bundle/chunks/{plan-7IVSICR6.js → plan-PAWCCAPW.js} +15 -14
  407. package/dist/cli-bundle/chunks/plan-PAWCCAPW.js.map +7 -0
  408. package/dist/cli-bundle/chunks/{register-list-query-4UPMHONX.js → register-list-query-N7Z7RTDM.js} +31 -22
  409. package/dist/cli-bundle/chunks/register-list-query-N7Z7RTDM.js.map +7 -0
  410. package/dist/cli-bundle/chunks/{register-list-query-7VOW2C3W.js → register-list-query-OTIK4DVA.js} +32 -23
  411. package/dist/cli-bundle/chunks/register-list-query-OTIK4DVA.js.map +1 -0
  412. package/dist/cli-bundle/chunks/{register-mutation-FARSGYRD.js → register-mutation-UFZK6Q57.js} +216 -66
  413. package/dist/cli-bundle/chunks/register-mutation-UFZK6Q57.js.map +7 -0
  414. package/dist/cli-bundle/chunks/{register-mutation-LJDNVREU.js → register-mutation-XFORLS6D.js} +210 -67
  415. package/dist/cli-bundle/chunks/register-mutation-XFORLS6D.js.map +1 -0
  416. package/dist/cli-bundle/chunks/{register-operations-HCJKDUA6.js → register-operations-6ZCLKRBG.js} +53 -39
  417. package/dist/cli-bundle/chunks/register-operations-6ZCLKRBG.js.map +7 -0
  418. package/dist/cli-bundle/chunks/{register-operations-FFTYAL42.js → register-operations-ITE7JTH3.js} +54 -40
  419. package/dist/cli-bundle/chunks/register-operations-ITE7JTH3.js.map +1 -0
  420. package/dist/cli-bundle/chunks/{register-setup-6AVIUOCC.js → register-setup-7RKGE4BQ.js} +18 -21
  421. package/dist/cli-bundle/chunks/register-setup-7RKGE4BQ.js.map +1 -0
  422. package/dist/cli-bundle/chunks/{register-setup-KVNLO5OJ.js → register-setup-7UKEFKT6.js} +17 -20
  423. package/dist/cli-bundle/chunks/register-setup-7UKEFKT6.js.map +7 -0
  424. package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js → restore-NNVPBBVJ.js} +13 -11
  425. package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +19 -0
  426. package/dist/cli-bundle/chunks/{schema-AINZ2IMM.js → schema-3HCLXCFX.js} +27 -9
  427. package/dist/cli-bundle/chunks/schema-3HCLXCFX.js.map +7 -0
  428. package/dist/cli-bundle/chunks/{schema-76HDZJCC.js → schema-3YKCQ3VO.js} +28 -10
  429. package/dist/cli-bundle/chunks/schema-3YKCQ3VO.js.map +1 -0
  430. package/dist/cli-bundle/chunks/{search-JMLFQEPJ.js → search-NQ42NC6A.js} +328 -71
  431. package/dist/cli-bundle/chunks/search-NQ42NC6A.js.map +7 -0
  432. package/dist/cli-bundle/chunks/{search-NL3TSCYB.js → search-V7PZ2ICH.js} +328 -71
  433. package/dist/cli-bundle/chunks/search-V7PZ2ICH.js.map +1 -0
  434. package/dist/cli-bundle/chunks/{stats-BKXCBIGT.js → stats-7KD4PJC5.js} +41 -16
  435. package/dist/cli-bundle/chunks/stats-7KD4PJC5.js.map +7 -0
  436. package/dist/cli-bundle/chunks/{stats-UBD56TGK.js → stats-GRHO6RFB.js} +42 -17
  437. package/dist/cli-bundle/chunks/stats-GRHO6RFB.js.map +1 -0
  438. package/dist/cli-bundle/chunks/{telemetry-ZJXK3H7X.js → telemetry-H5GLXNG5.js} +6 -6
  439. package/dist/cli-bundle/chunks/telemetry-H5GLXNG5.js.map +7 -0
  440. package/dist/cli-bundle/chunks/{telemetry-N454RHG5.js → telemetry-TRRYZXWT.js} +7 -7
  441. package/dist/cli-bundle/chunks/telemetry-TRRYZXWT.js.map +1 -0
  442. package/dist/cli-bundle/chunks/test-6CZNIIGA.js +34 -0
  443. package/dist/cli-bundle/chunks/{test-BQAKIXAT.js → test-7GVQ3VMN.js} +16 -14
  444. package/dist/cli-bundle/chunks/{test-all-7LV3I6S5.js → test-all-3LF2OZD2.js} +23 -16
  445. package/dist/cli-bundle/chunks/test-all-3LF2OZD2.js.map +7 -0
  446. package/dist/cli-bundle/chunks/{test-all-TDYCCBA4.js → test-all-ODVADHV6.js} +24 -17
  447. package/dist/cli-bundle/chunks/test-all-ODVADHV6.js.map +1 -0
  448. package/dist/cli-bundle/chunks/{test-runs-E64M6XS3.js → test-runs-LYT6ZTNQ.js} +62 -65
  449. package/dist/cli-bundle/chunks/test-runs-LYT6ZTNQ.js.map +1 -0
  450. package/dist/cli-bundle/chunks/{test-runs-LXZLULCI.js → test-runs-RVP6VWN7.js} +61 -64
  451. package/dist/cli-bundle/chunks/test-runs-RVP6VWN7.js.map +7 -0
  452. package/dist/cli-bundle/chunks/update-MPGM6SBE.js +28 -0
  453. package/dist/cli-bundle/chunks/update-UN75XW3C.js +24 -0
  454. package/dist/cli-bundle/chunks/{update-many-F4IKDWZB.js → update-many-FCU6RKTO.js} +80 -34
  455. package/dist/cli-bundle/chunks/update-many-FCU6RKTO.js.map +1 -0
  456. package/dist/cli-bundle/chunks/{update-many-NTWZ5YT3.js → update-many-XSEQJ24X.js} +79 -33
  457. package/dist/cli-bundle/chunks/update-many-XSEQJ24X.js.map +7 -0
  458. package/dist/cli-bundle/chunks/{upgrade-37F7JKES.js → upgrade-A6TL3INC.js} +22 -8
  459. package/dist/cli-bundle/chunks/upgrade-A6TL3INC.js.map +7 -0
  460. package/dist/cli-bundle/chunks/{upgrade-L32JA4TZ.js → upgrade-FOB5LHO5.js} +23 -9
  461. package/dist/cli-bundle/chunks/upgrade-FOB5LHO5.js.map +1 -0
  462. package/dist/cli-bundle/chunks/{validate-46KCRHL7.js → validate-7BLDG3AT.js} +222 -31
  463. package/dist/cli-bundle/chunks/validate-7BLDG3AT.js.map +1 -0
  464. package/dist/cli-bundle/chunks/{validate-CRFMPTYD.js → validate-EHL3MI2V.js} +236 -31
  465. package/dist/cli-bundle/chunks/validate-EHL3MI2V.js.map +7 -0
  466. package/dist/cli-bundle/main.js +305 -140
  467. package/dist/cli-bundle/main.js.map +3 -3
  468. package/dist/cli.d.ts +10 -0
  469. package/dist/cli.js +21 -8
  470. package/dist/cli.js.map +1 -1
  471. package/dist/core/diagnostics/remediation.js +7 -2
  472. package/dist/core/diagnostics/remediation.js.map +1 -1
  473. package/dist/core/extensions/extension-capability-aliases.js +7 -33
  474. package/dist/core/extensions/extension-capability-aliases.js.map +1 -1
  475. package/dist/core/extensions/extension-policy.js +14 -15
  476. package/dist/core/extensions/extension-policy.js.map +1 -1
  477. package/dist/core/extensions/item-fields.js +4 -5
  478. package/dist/core/extensions/item-fields.js.map +1 -1
  479. package/dist/core/extensions/loader.d.ts +75 -1
  480. package/dist/core/extensions/loader.js +56 -32
  481. package/dist/core/extensions/loader.js.map +1 -1
  482. package/dist/core/governance/content-fields.d.ts +84 -0
  483. package/dist/core/governance/content-fields.js +182 -0
  484. package/dist/core/governance/content-fields.js.map +1 -0
  485. package/dist/core/governance/issue-codes.d.ts +51 -0
  486. package/dist/core/governance/issue-codes.js +95 -0
  487. package/dist/core/governance/issue-codes.js.map +1 -0
  488. package/dist/core/governance/metadata-coverage.d.ts +168 -0
  489. package/dist/core/governance/metadata-coverage.js +362 -0
  490. package/dist/core/governance/metadata-coverage.js.map +1 -0
  491. package/dist/core/history/history-rewrite.d.ts +22 -0
  492. package/dist/core/history/history-rewrite.js +38 -2
  493. package/dist/core/history/history-rewrite.js.map +1 -1
  494. package/dist/core/history/history.d.ts +7 -0
  495. package/dist/core/history/history.js +6 -2
  496. package/dist/core/history/history.js.map +1 -1
  497. package/dist/core/io/body-file.d.ts +14 -0
  498. package/dist/core/io/body-file.js +47 -0
  499. package/dist/core/io/body-file.js.map +1 -0
  500. package/dist/core/item/item-format.d.ts +46 -1
  501. package/dist/core/item/item-format.js +51 -60
  502. package/dist/core/item/item-format.js.map +1 -1
  503. package/dist/core/item/parse.d.ts +9 -0
  504. package/dist/core/item/parse.js +10 -16
  505. package/dist/core/item/parse.js.map +1 -1
  506. package/dist/core/item/type-registry.d.ts +1 -0
  507. package/dist/core/item/type-registry.js +8 -10
  508. package/dist/core/item/type-registry.js.map +1 -1
  509. package/dist/core/lock/lock.d.ts +26 -0
  510. package/dist/core/lock/lock.js +10 -2
  511. package/dist/core/lock/lock.js.map +1 -1
  512. package/dist/core/output/output.d.ts +7 -0
  513. package/dist/core/output/output.js +6 -2
  514. package/dist/core/output/output.js.map +1 -1
  515. package/dist/core/schema/item-types-file.d.ts +25 -2
  516. package/dist/core/schema/item-types-file.js +78 -6
  517. package/dist/core/schema/item-types-file.js.map +1 -1
  518. package/dist/core/schema/runtime-schema.d.ts +7 -0
  519. package/dist/core/schema/runtime-schema.js +23 -16
  520. package/dist/core/schema/runtime-schema.js.map +1 -1
  521. package/dist/core/search/background-refresh.js +3 -3
  522. package/dist/core/search/background-refresh.js.map +1 -1
  523. package/dist/core/search/cache.d.ts +19 -1
  524. package/dist/core/search/cache.js +11 -3
  525. package/dist/core/search/cache.js.map +1 -1
  526. package/dist/core/search/corpus.d.ts +36 -2
  527. package/dist/core/search/corpus.js +120 -24
  528. package/dist/core/search/corpus.js.map +1 -1
  529. package/dist/core/search/providers.d.ts +19 -0
  530. package/dist/core/search/providers.js +19 -2
  531. package/dist/core/search/providers.js.map +1 -1
  532. package/dist/core/sentry/instrument.d.ts +1 -0
  533. package/dist/core/sentry/instrument.js +6 -2
  534. package/dist/core/sentry/instrument.js.map +1 -1
  535. package/dist/core/session/session-state.d.ts +16 -0
  536. package/dist/core/session/session-state.js +48 -0
  537. package/dist/core/session/session-state.js.map +1 -0
  538. package/dist/core/shared/constants.d.ts +8 -0
  539. package/dist/core/shared/constants.js +11 -2
  540. package/dist/core/shared/constants.js.map +1 -1
  541. package/dist/core/shared/errors.d.ts +3 -0
  542. package/dist/core/shared/errors.js +2 -2
  543. package/dist/core/shared/errors.js.map +1 -1
  544. package/dist/core/shared/text-normalization.js +4 -3
  545. package/dist/core/shared/text-normalization.js.map +1 -1
  546. package/dist/core/shared/time.d.ts +13 -0
  547. package/dist/core/shared/time.js +19 -7
  548. package/dist/core/shared/time.js.map +1 -1
  549. package/dist/core/store/item-store.d.ts +11 -0
  550. package/dist/core/store/item-store.js +16 -23
  551. package/dist/core/store/item-store.js.map +1 -1
  552. package/dist/core/store/settings-validator.d.ts +2 -0
  553. package/dist/core/store/settings-validator.js +25 -2
  554. package/dist/core/store/settings-validator.js.map +1 -1
  555. package/dist/core/store/settings.d.ts +60 -1
  556. package/dist/core/store/settings.js +100 -46
  557. package/dist/core/store/settings.js.map +1 -1
  558. package/dist/core/telemetry/observability.js +10 -8
  559. package/dist/core/telemetry/observability.js.map +1 -1
  560. package/dist/core/telemetry/runtime.d.ts +272 -1
  561. package/dist/core/telemetry/runtime.js +358 -37
  562. package/dist/core/telemetry/runtime.js.map +1 -1
  563. package/dist/core/test/background-runs.d.ts +35 -0
  564. package/dist/core/test/background-runs.js +72 -61
  565. package/dist/core/test/background-runs.js.map +1 -1
  566. package/dist/core/test/run-selectors.js +5 -4
  567. package/dist/core/test/run-selectors.js.map +1 -1
  568. package/dist/core/validate/estimate-defaults.d.ts +39 -0
  569. package/dist/core/validate/estimate-defaults.js +117 -0
  570. package/dist/core/validate/estimate-defaults.js.map +1 -0
  571. package/dist/core/validate/fix-planning.d.ts +21 -3
  572. package/dist/core/validate/fix-planning.js +31 -4
  573. package/dist/core/validate/fix-planning.js.map +1 -1
  574. package/dist/core/validate/missing-link-owners.d.ts +64 -0
  575. package/dist/core/validate/missing-link-owners.js +98 -0
  576. package/dist/core/validate/missing-link-owners.js.map +1 -0
  577. package/dist/mcp/server.d.ts +62 -0
  578. package/dist/mcp/server.js +71 -8
  579. package/dist/mcp/server.js.map +1 -1
  580. package/dist/mcp/tool-definitions.js +17 -4
  581. package/dist/mcp/tool-definitions.js.map +1 -1
  582. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  583. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  584. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  585. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  586. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  587. package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
  588. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  589. package/dist/sdk/cli-contracts/tool-parameter-tables.js +83 -8
  590. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  591. package/dist/sdk/cli-contracts.d.ts +28 -0
  592. package/dist/sdk/cli-contracts.js +164 -11
  593. package/dist/sdk/cli-contracts.js.map +1 -1
  594. package/dist/types.d.ts +17 -1
  595. package/dist/types.js +3 -3
  596. package/dist/types.js.map +1 -1
  597. package/docs/AGENT_GUIDE.md +15 -3
  598. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  599. package/docs/COMMANDS.md +136 -7
  600. package/docs/CONFIGURATION.md +52 -0
  601. package/docs/TESTING.md +6 -4
  602. package/package.json +6 -4
  603. package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
  604. package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
  605. package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
  606. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  607. package/plugins/pm-claude/README.md +6 -14
  608. package/plugins/pm-claude/commands/pm-init.md +1 -1
  609. package/plugins/pm-codex/README.md +1 -1
  610. package/scripts/bundle-cli.mjs +46 -37
  611. package/scripts/finalize-build.mjs +20 -9
  612. package/scripts/prepare-build-cache.mjs +27 -16
  613. package/dist/cli-bundle/chunks/activity-XZIUPGZH.js +0 -16
  614. package/dist/cli-bundle/chunks/aggregate-6OTS3AOO.js.map +0 -1
  615. package/dist/cli-bundle/chunks/aggregate-OD36DJU5.js.map +0 -7
  616. package/dist/cli-bundle/chunks/append-KG55G7S3.js.map +0 -1
  617. package/dist/cli-bundle/chunks/chunk-35P4GT6E.js.map +0 -7
  618. package/dist/cli-bundle/chunks/chunk-37CYVF73.js.map +0 -7
  619. package/dist/cli-bundle/chunks/chunk-3KLPFWZ4.js.map +0 -7
  620. package/dist/cli-bundle/chunks/chunk-4JCSYR6F.js +0 -138
  621. package/dist/cli-bundle/chunks/chunk-4JCSYR6F.js.map +0 -7
  622. package/dist/cli-bundle/chunks/chunk-4YFAGDRH.js.map +0 -7
  623. package/dist/cli-bundle/chunks/chunk-5SCT2JCT.js.map +0 -7
  624. package/dist/cli-bundle/chunks/chunk-73ZPG2I3.js.map +0 -7
  625. package/dist/cli-bundle/chunks/chunk-7AMK6DOW.js.map +0 -1
  626. package/dist/cli-bundle/chunks/chunk-7IYFN5R7.js.map +0 -1
  627. package/dist/cli-bundle/chunks/chunk-7UGSRQCL.js.map +0 -7
  628. package/dist/cli-bundle/chunks/chunk-A6LXQFO7.js.map +0 -1
  629. package/dist/cli-bundle/chunks/chunk-AVGHVVF7.js +0 -128
  630. package/dist/cli-bundle/chunks/chunk-AVGHVVF7.js.map +0 -1
  631. package/dist/cli-bundle/chunks/chunk-AX4GEVQC.js.map +0 -7
  632. package/dist/cli-bundle/chunks/chunk-CCX4RSYZ.js.map +0 -1
  633. package/dist/cli-bundle/chunks/chunk-CW6E4NAT.js.map +0 -1
  634. package/dist/cli-bundle/chunks/chunk-DY6C42S6.js.map +0 -7
  635. package/dist/cli-bundle/chunks/chunk-EWFY7SLA.js.map +0 -1
  636. package/dist/cli-bundle/chunks/chunk-F75JSIOZ.js.map +0 -1
  637. package/dist/cli-bundle/chunks/chunk-FDH2X65L.js.map +0 -1
  638. package/dist/cli-bundle/chunks/chunk-FY4SPXSC.js.map +0 -7
  639. package/dist/cli-bundle/chunks/chunk-GKIZW7SM.js.map +0 -7
  640. package/dist/cli-bundle/chunks/chunk-HHHJ2GI3.js.map +0 -7
  641. package/dist/cli-bundle/chunks/chunk-HI7STVF2.js.map +0 -1
  642. package/dist/cli-bundle/chunks/chunk-I53JBTJW.js.map +0 -7
  643. package/dist/cli-bundle/chunks/chunk-I7NYDZDV.js.map +0 -1
  644. package/dist/cli-bundle/chunks/chunk-IUKD4W6Z.js.map +0 -7
  645. package/dist/cli-bundle/chunks/chunk-KWAXVAXX.js.map +0 -7
  646. package/dist/cli-bundle/chunks/chunk-L5EPZQIC.js.map +0 -7
  647. package/dist/cli-bundle/chunks/chunk-OASDW5UI.js.map +0 -1
  648. package/dist/cli-bundle/chunks/chunk-OLKBSY4N.js.map +0 -7
  649. package/dist/cli-bundle/chunks/chunk-P5BJOMBB.js.map +0 -1
  650. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
  651. package/dist/cli-bundle/chunks/chunk-QKW5D45B.js.map +0 -1
  652. package/dist/cli-bundle/chunks/chunk-QNJSITCX.js.map +0 -1
  653. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
  654. package/dist/cli-bundle/chunks/chunk-RXAP6JL5.js.map +0 -7
  655. package/dist/cli-bundle/chunks/chunk-S2ZLDYGS.js.map +0 -1
  656. package/dist/cli-bundle/chunks/chunk-SO55HRA5.js.map +0 -1
  657. package/dist/cli-bundle/chunks/chunk-TK5VZFHY.js.map +0 -7
  658. package/dist/cli-bundle/chunks/chunk-TNAP7EJX.js.map +0 -7
  659. package/dist/cli-bundle/chunks/chunk-UIG4TW2H.js.map +0 -1
  660. package/dist/cli-bundle/chunks/chunk-UUWGCWBU.js.map +0 -1
  661. package/dist/cli-bundle/chunks/chunk-VFUZV5EB.js.map +0 -7
  662. package/dist/cli-bundle/chunks/chunk-WUNFKP7M.js.map +0 -1
  663. package/dist/cli-bundle/chunks/chunk-XJDGS74Y.js.map +0 -1
  664. package/dist/cli-bundle/chunks/chunk-XWMF3POR.js.map +0 -1
  665. package/dist/cli-bundle/chunks/chunk-ZMW77VWV.js.map +0 -1
  666. package/dist/cli-bundle/chunks/close-4FMAPEMY.js +0 -13
  667. package/dist/cli-bundle/chunks/close-many-AOD4HSAZ.js.map +0 -1
  668. package/dist/cli-bundle/chunks/close-many-XKAQY5CQ.js.map +0 -7
  669. package/dist/cli-bundle/chunks/comments-B4RWWDJT.js.map +0 -7
  670. package/dist/cli-bundle/chunks/comments-RN5TG4ZN.js.map +0 -1
  671. package/dist/cli-bundle/chunks/config-3JXJ3XZ7.js.map +0 -1
  672. package/dist/cli-bundle/chunks/config-FZ4UDC4B.js.map +0 -7
  673. package/dist/cli-bundle/chunks/context-L36PIN35.js.map +0 -7
  674. package/dist/cli-bundle/chunks/context-QBPO3BFM.js.map +0 -1
  675. package/dist/cli-bundle/chunks/contracts-2G66IGIA.js.map +0 -1
  676. package/dist/cli-bundle/chunks/contracts-PJCHYSO5.js.map +0 -7
  677. package/dist/cli-bundle/chunks/create-VWLWS34Z.js +0 -27
  678. package/dist/cli-bundle/chunks/deps-6TSPOSGU.js.map +0 -1
  679. package/dist/cli-bundle/chunks/files-FYP3MDPX.js.map +0 -7
  680. package/dist/cli-bundle/chunks/files-GUXUM2MB.js.map +0 -1
  681. package/dist/cli-bundle/chunks/get-PCHS7RA6.js.map +0 -1
  682. package/dist/cli-bundle/chunks/get-QARTE6BL.js.map +0 -7
  683. package/dist/cli-bundle/chunks/health-7MTXAVR2.js.map +0 -7
  684. package/dist/cli-bundle/chunks/health-E4D7KGHD.js.map +0 -1
  685. package/dist/cli-bundle/chunks/history-L2FQFRTU.js +0 -20
  686. package/dist/cli-bundle/chunks/history-compact-3EJ3L2O7.js.map +0 -1
  687. package/dist/cli-bundle/chunks/history-compact-LW27IPFK.js.map +0 -7
  688. package/dist/cli-bundle/chunks/history-redact-QWQCX5DZ.js +0 -19
  689. package/dist/cli-bundle/chunks/history-repair-OSQOKJ3E.js.map +0 -7
  690. package/dist/cli-bundle/chunks/history-repair-SBK7P34V.js.map +0 -1
  691. package/dist/cli-bundle/chunks/init-4BKRHGWW.js +0 -17
  692. package/dist/cli-bundle/chunks/learnings-HQXSSKZ5.js.map +0 -1
  693. package/dist/cli-bundle/chunks/learnings-XK3P4ZDR.js.map +0 -7
  694. package/dist/cli-bundle/chunks/list-6CL3XFT6.js +0 -23
  695. package/dist/cli-bundle/chunks/list-BYNN4ZEO.js +0 -19
  696. package/dist/cli-bundle/chunks/notes-5T6P7C5V.js.map +0 -1
  697. package/dist/cli-bundle/chunks/notes-U5FZCSBT.js.map +0 -7
  698. package/dist/cli-bundle/chunks/plan-2YTQYWGM.js.map +0 -1
  699. package/dist/cli-bundle/chunks/plan-7IVSICR6.js.map +0 -7
  700. package/dist/cli-bundle/chunks/register-list-query-4UPMHONX.js.map +0 -7
  701. package/dist/cli-bundle/chunks/register-list-query-7VOW2C3W.js.map +0 -1
  702. package/dist/cli-bundle/chunks/register-mutation-FARSGYRD.js.map +0 -7
  703. package/dist/cli-bundle/chunks/register-mutation-LJDNVREU.js.map +0 -1
  704. package/dist/cli-bundle/chunks/register-operations-FFTYAL42.js.map +0 -1
  705. package/dist/cli-bundle/chunks/register-operations-HCJKDUA6.js.map +0 -7
  706. package/dist/cli-bundle/chunks/register-setup-6AVIUOCC.js.map +0 -1
  707. package/dist/cli-bundle/chunks/register-setup-KVNLO5OJ.js.map +0 -7
  708. package/dist/cli-bundle/chunks/restore-CHIOQAQL.js +0 -17
  709. package/dist/cli-bundle/chunks/schema-76HDZJCC.js.map +0 -1
  710. package/dist/cli-bundle/chunks/schema-AINZ2IMM.js.map +0 -7
  711. package/dist/cli-bundle/chunks/search-JMLFQEPJ.js.map +0 -7
  712. package/dist/cli-bundle/chunks/search-NL3TSCYB.js.map +0 -1
  713. package/dist/cli-bundle/chunks/stats-BKXCBIGT.js.map +0 -7
  714. package/dist/cli-bundle/chunks/stats-UBD56TGK.js.map +0 -1
  715. package/dist/cli-bundle/chunks/telemetry-N454RHG5.js.map +0 -1
  716. package/dist/cli-bundle/chunks/telemetry-ZJXK3H7X.js.map +0 -7
  717. package/dist/cli-bundle/chunks/test-O74JFUH5.js +0 -32
  718. package/dist/cli-bundle/chunks/test-all-7LV3I6S5.js.map +0 -7
  719. package/dist/cli-bundle/chunks/test-all-TDYCCBA4.js.map +0 -1
  720. package/dist/cli-bundle/chunks/test-runs-E64M6XS3.js.map +0 -1
  721. package/dist/cli-bundle/chunks/test-runs-LXZLULCI.js.map +0 -7
  722. package/dist/cli-bundle/chunks/update-36JM7YZT.js +0 -21
  723. package/dist/cli-bundle/chunks/update-I246PCLO.js +0 -25
  724. package/dist/cli-bundle/chunks/update-many-F4IKDWZB.js.map +0 -1
  725. package/dist/cli-bundle/chunks/update-many-NTWZ5YT3.js.map +0 -7
  726. package/dist/cli-bundle/chunks/upgrade-37F7JKES.js.map +0 -7
  727. package/dist/cli-bundle/chunks/upgrade-L32JA4TZ.js.map +0 -1
  728. package/dist/cli-bundle/chunks/validate-46KCRHL7.js.map +0 -1
  729. package/dist/cli-bundle/chunks/validate-CRFMPTYD.js.map +0 -7
  730. /package/dist/cli-bundle/chunks/{activity-XZIUPGZH.js.map → activity-5P2KQCTH.js.map} +0 -0
  731. /package/dist/cli-bundle/chunks/{activity-XADJOG6G.js.map → activity-MJGTX4LO.js.map} +0 -0
  732. /package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js.map → chunk-2JEGCDYT.js.map} +0 -0
  733. /package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js.map → chunk-3WAULYOY.js.map} +0 -0
  734. /package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js.map → chunk-7AGIXLNK.js.map} +0 -0
  735. /package/dist/cli-bundle/chunks/{chunk-KBPQHXWG.js.map → chunk-AERT7KT3.js.map} +0 -0
  736. /package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js.map → chunk-E6J2PEK6.js.map} +0 -0
  737. /package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js.map → chunk-F2GC6L3N.js.map} +0 -0
  738. /package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js.map → chunk-M23HXJL3.js.map} +0 -0
  739. /package/dist/cli-bundle/chunks/{chunk-S26FESD4.js.map → chunk-MJZUZ2QE.js.map} +0 -0
  740. /package/dist/cli-bundle/chunks/{chunk-C6SAP27O.js.map → chunk-O46LTCXQ.js.map} +0 -0
  741. /package/dist/cli-bundle/chunks/{chunk-WPDMBIX6.js.map → chunk-OLTYNVJR.js.map} +0 -0
  742. /package/dist/cli-bundle/chunks/{chunk-R2OUQVBK.js.map → chunk-T5VU7ROQ.js.map} +0 -0
  743. /package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js.map → chunk-UBMCSJXX.js.map} +0 -0
  744. /package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js.map → chunk-UUKORJSN.js.map} +0 -0
  745. /package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js.map → chunk-WZCQVABQ.js.map} +0 -0
  746. /package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js.map → chunk-YGRPBFMA.js.map} +0 -0
  747. /package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js.map → chunk-ZJRDVYZI.js.map} +0 -0
  748. /package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js.map → claim-4APLUXJW.js.map} +0 -0
  749. /package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js.map → claim-NEO7AGWH.js.map} +0 -0
  750. /package/dist/cli-bundle/chunks/{close-XLEKIQSW.js.map → close-3QABBNGU.js.map} +0 -0
  751. /package/dist/cli-bundle/chunks/{close-4FMAPEMY.js.map → close-ILMZR3D7.js.map} +0 -0
  752. /package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js.map → copy-Q64T5FD4.js.map} +0 -0
  753. /package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js.map → copy-SG34LCMU.js.map} +0 -0
  754. /package/dist/cli-bundle/chunks/{create-VWLWS34Z.js.map → create-F5HZX2S4.js.map} +0 -0
  755. /package/dist/cli-bundle/chunks/{create-5433DP3G.js.map → create-IPAX2SNL.js.map} +0 -0
  756. /package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js.map → delete-TLXR7LJ2.js.map} +0 -0
  757. /package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js.map → delete-VH3L7DZ6.js.map} +0 -0
  758. /package/dist/cli-bundle/chunks/{docs-MXLGZUIT.js.map → docs-GWDEB7JH.js.map} +0 -0
  759. /package/dist/cli-bundle/chunks/{docs-I3BAF5WH.js.map → docs-RCLNSKID.js.map} +0 -0
  760. /package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js.map → extension-5RN65LHT.js.map} +0 -0
  761. /package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js.map → extension-7KO2NX2A.js.map} +0 -0
  762. /package/dist/cli-bundle/chunks/{gc-KGQG66SA.js.map → gc-2FGKYRJ4.js.map} +0 -0
  763. /package/dist/cli-bundle/chunks/{gc-FENB2ESG.js.map → gc-5B6ABL3Z.js.map} +0 -0
  764. /package/dist/cli-bundle/chunks/{history-7WUAEWHW.js.map → history-QO4JVJJP.js.map} +0 -0
  765. /package/dist/cli-bundle/chunks/{history-L2FQFRTU.js.map → history-SSXGGTVZ.js.map} +0 -0
  766. /package/dist/cli-bundle/chunks/{history-redact-QWQCX5DZ.js.map → history-redact-VBH44Y7F.js.map} +0 -0
  767. /package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js.map → history-redact-Z4P5MM3G.js.map} +0 -0
  768. /package/dist/cli-bundle/chunks/{init-4BKRHGWW.js.map → init-7FBQO77A.js.map} +0 -0
  769. /package/dist/cli-bundle/chunks/{init-S5WEGUJY.js.map → init-K6MSMB37.js.map} +0 -0
  770. /package/dist/cli-bundle/chunks/{list-BYNN4ZEO.js.map → list-7UE44A2R.js.map} +0 -0
  771. /package/dist/cli-bundle/chunks/{list-6CL3XFT6.js.map → list-UHMA3N2K.js.map} +0 -0
  772. /package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js.map → restore-NNVPBBVJ.js.map} +0 -0
  773. /package/dist/cli-bundle/chunks/{restore-CHIOQAQL.js.map → restore-XXXLQ2XC.js.map} +0 -0
  774. /package/dist/cli-bundle/chunks/{test-O74JFUH5.js.map → test-6CZNIIGA.js.map} +0 -0
  775. /package/dist/cli-bundle/chunks/{test-BQAKIXAT.js.map → test-7GVQ3VMN.js.map} +0 -0
  776. /package/dist/cli-bundle/chunks/{update-I246PCLO.js.map → update-MPGM6SBE.js.map} +0 -0
  777. /package/dist/cli-bundle/chunks/{update-36JM7YZT.js.map → update-UN75XW3C.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parseItemDocument,
3
3
  serializeItemDocument
4
- } from "./chunk-73ZPG2I3.js";
4
+ } from "./chunk-GYMG7AG6.js";
5
5
  import {
6
6
  TYPE_TO_FOLDER,
7
7
  getItemFormatFromPath,
@@ -10,7 +10,7 @@ import {
10
10
  removeFileIfExists,
11
11
  runActiveOnWriteHooks,
12
12
  writeFileAtomic
13
- } from "./chunk-FY4SPXSC.js";
13
+ } from "./chunk-LV5FFQ7M.js";
14
14
 
15
15
  // dist/core/store/item-format-migration.js
16
16
  import fs from "node:fs/promises";
@@ -119,4 +119,4 @@ async function migrateItemFilesToFormat(pmRoot, targetFormat, op = "item_format:
119
119
  export {
120
120
  migrateItemFilesToFormat
121
121
  };
122
- //# sourceMappingURL=chunk-VSRZRLG3.js.map
122
+ //# sourceMappingURL=chunk-F2GC6L3N.js.map
@@ -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]="782e6b42-6c10-51ac-b9b8-088e686821d0")}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]="deeae01d-5fdc-5e0f-8c6c-a5477429ac0c")}catch(e){}}();
3
3
  import {
4
4
  EXIT_CODE,
5
5
  PmCliError
6
- } from "./chunk-A6LXQFO7.js";
6
+ } from "./chunk-KTVETP66.js";
7
7
 
8
8
  // dist/core/item/parse.js
9
9
  var STDIN_TOKEN = "-";
@@ -91,10 +91,8 @@ function coerceJsonTagArray(trimmed) {
91
91
  } catch {
92
92
  return null;
93
93
  }
94
- if (!Array.isArray(parsed)) {
95
- return null;
96
- }
97
- return parsed.map((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean" ? String(entry).replace(/,/g, " ") : "").filter((entry) => entry.length > 0).join(",");
94
+ const parsedArray = parsed;
95
+ return parsedArray.map((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean" ? String(entry).replace(/,/g, " ") : "").filter((entry) => entry.length > 0).join(",");
98
96
  }
99
97
  function normalizeLineEndings(value) {
100
98
  return value.replace(/\r\n/g, "\n");
@@ -108,9 +106,6 @@ function stripCodeFenceEnvelope(value) {
108
106
  if (lines.length < 2) {
109
107
  return value;
110
108
  }
111
- if (!lines[0].startsWith("```")) {
112
- return value;
113
- }
114
109
  if (lines.at(-1)?.trim() !== "```") {
115
110
  return value;
116
111
  }
@@ -219,7 +214,7 @@ ${line}`;
219
214
  }
220
215
  return null;
221
216
  }
222
- return Object.keys(result).length > 0 ? result : null;
217
+ return result;
223
218
  }
224
219
  function parseCsvKv(raw, optionName) {
225
220
  const trimmed = stripCodeFenceEnvelope(raw).trim();
@@ -237,9 +232,6 @@ function parseCsvKv(raw, optionName) {
237
232
  const delimiterIndex = findKeyValueDelimiter(segment);
238
233
  if (delimiterIndex > 0) {
239
234
  const key = segment.slice(0, delimiterIndex).trim();
240
- if (!key) {
241
- throw new PmCliError(buildInvalidKvMessage(raw, optionName), EXIT_CODE.USAGE);
242
- }
243
235
  const value = unquoteValue(segment.slice(delimiterIndex + 1).trim());
244
236
  result[key] = value;
245
237
  activeKey = key;
@@ -251,9 +243,6 @@ function parseCsvKv(raw, optionName) {
251
243
  }
252
244
  throw new PmCliError(buildInvalidKvMessage(raw, optionName), EXIT_CODE.USAGE);
253
245
  }
254
- if (Object.keys(result).length === 0) {
255
- throw new PmCliError(buildInvalidKvMessage(raw, optionName), EXIT_CODE.USAGE);
256
- }
257
246
  return result;
258
247
  }
259
248
  async function readStdinText(optionName) {
@@ -333,6 +322,6 @@ export {
333
322
  createStdinTokenResolver,
334
323
  parseOptionalNumber
335
324
  };
336
- //# sourceMappingURL=chunk-I7NYDZDV.js.map
325
+ //# sourceMappingURL=chunk-F7WSO5UX.js.map
337
326
 
338
- //# debugId=782e6b42-6c10-51ac-b9b8-088e686821d0
327
+ //# debugId=deeae01d-5fdc-5e0f-8c6c-a5477429ac0c
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/item/parse.ts"],"sourcesContent":["import { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\nconst STDIN_TOKEN = \"-\";\nconst CONTINUABLE_VALUE_KEYS = new Set([\n \"actual_result\",\n \"body\",\n \"cmd\",\n \"command\",\n \"customer_impact\",\n \"description\",\n \"environment\",\n \"expected_result\",\n \"impact\",\n \"location\",\n \"message\",\n \"note\",\n \"outcome\",\n \"repro_steps\",\n \"resolution\",\n \"text\",\n \"title\",\n \"unblock_note\",\n \"value\",\n \"why_now\",\n]);\n\nexport function parseTags(raw: string): string[] {\n const trimmed = raw.trim();\n if (trimmed === \"\") {\n return [];\n }\n const source = coerceJsonTagArray(trimmed) ?? trimmed;\n const tags = source\n .split(\",\")\n .map((tag) => tag.trim())\n .filter(Boolean)\n .map((tag) => tag.toLowerCase());\n return Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));\n}\n\n/**\n * Merge repeated `--add-tags` / `--remove-tags` values into a single normalized\n * tag list. Each entry can itself be CSV or a JSON array, mirroring the format\n * accepted by `--tags`. Returns a deterministically sorted, deduped list.\n */\nexport function collectTagFlagValues(values: readonly string[] | undefined): string[] {\n if (!Array.isArray(values) || values.length === 0) {\n return [];\n }\n const collected: string[] = [];\n for (const raw of values) {\n if (typeof raw !== \"string\") {\n continue;\n }\n for (const tag of parseTags(raw)) {\n collected.push(tag);\n }\n }\n return Array.from(new Set(collected)).sort((a, b) => a.localeCompare(b));\n}\n\n/**\n * Normalize a base tag list to the canonical form pm stores: trimmed,\n * lowercased, non-empty. Existing front-matter tags are almost always already\n * canonical (parseTags lowercases on write), but legacy or hand-edited `.toon`\n * files can carry mixed-case entries — normalizing here keeps additive and\n * subtractive mutations case-insensitive (so `--add-tags beta` dedupes against\n * an existing `Beta`, and `--remove-tags alpha` removes an existing `Alpha`).\n */\nfunction normalizeBaseTags(baseTags: readonly string[]): string[] {\n // Defensive: front-matter parsed from corrupted/hand-edited `.toon` (or an\n // external SDK caller) could pass a non-array or non-string entries despite\n // the `string[]` type — guard the array and skip non-strings rather than\n // throwing on `.filter`/`.trim()`.\n if (!Array.isArray(baseTags)) {\n return [];\n }\n return baseTags\n .filter((tag): tag is string => typeof tag === \"string\")\n .map((tag) => tag.trim().toLowerCase())\n .filter(Boolean);\n}\n\n/**\n * Apply an additive tag mutation to a base tag list. Used by `pm create` and\n * `pm update` so `--add-tags` extends `--tags` (or the existing tags) without\n * replacing them. Output is sorted + deduped lowercase, matching `parseTags`.\n */\nexport function mergeAdditiveTags(baseTags: readonly string[], add: readonly string[] | undefined): string[] {\n const normalizedBase = normalizeBaseTags(baseTags);\n if (!add || add.length === 0) {\n return Array.from(new Set(normalizedBase)).sort((a, b) => a.localeCompare(b));\n }\n const merged = new Set<string>(normalizedBase);\n for (const tag of collectTagFlagValues(add)) {\n merged.add(tag);\n }\n return Array.from(merged).sort((a, b) => a.localeCompare(b));\n}\n\n/**\n * Apply a subtractive tag mutation to a base tag list. Used by `pm update` so\n * `--remove-tags x,y` prunes those entries without rewriting the full set.\n * Removal is case-insensitive: both the base list and the removal selectors are\n * normalized to canonical lowercase before matching.\n */\nexport function applyTagRemovals(baseTags: readonly string[], remove: readonly string[] | undefined): string[] {\n const normalizedBase = Array.from(new Set(normalizeBaseTags(baseTags))).sort((a, b) => a.localeCompare(b));\n if (!remove || remove.length === 0) {\n return normalizedBase;\n }\n const removeSet = new Set(collectTagFlagValues(remove));\n if (removeSet.size === 0) {\n return normalizedBase;\n }\n return normalizedBase.filter((tag) => !removeSet.has(tag));\n}\n\n// Agents and MCP callers frequently pass --tags as a JSON array (e.g.\n// `--tags '[\"a\",\"b\"]'`). The MCP server normalizes that upstream, but direct\n// CLI invocations used to write the raw bracket string into front matter,\n// silently corrupting tags. Accept JSON arrays of primitives transparently.\nfunction coerceJsonTagArray(trimmed: string): string | null {\n if (!trimmed.startsWith(\"[\")) {\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return null;\n }\n const parsedArray = parsed as unknown[];\n return parsedArray\n .map((entry) =>\n typeof entry === \"string\" || typeof entry === \"number\" || typeof entry === \"boolean\"\n ? String(entry).replace(/,/g, \" \")\n : \"\",\n )\n .filter((entry) => entry.length > 0)\n .join(\",\");\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replace(/\\r\\n/g, \"\\n\");\n}\n\nfunction stripCodeFenceEnvelope(value: string): string {\n const normalized = normalizeLineEndings(value).trim();\n if (!normalized.startsWith(\"```\")) {\n return value;\n }\n const lines = normalized.split(\"\\n\");\n if (lines.length < 2) {\n return value;\n }\n if (lines.at(-1)?.trim() !== \"```\") {\n return value;\n }\n return lines.slice(1, -1).join(\"\\n\");\n}\n\nfunction splitCsvSegments(raw: string): string[] {\n const segments: string[] = [];\n let current = \"\";\n let inQuotes = false;\n let escaped = false;\n\n for (const char of raw) {\n if (escaped) {\n current += char;\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n current += char;\n escaped = true;\n continue;\n }\n if (char === \"\\\"\") {\n inQuotes = !inQuotes;\n current += char;\n continue;\n }\n if (char === \",\" && !inQuotes) {\n segments.push(current.trim());\n current = \"\";\n continue;\n }\n current += char;\n }\n if (current.trim()) {\n segments.push(current.trim());\n }\n return segments;\n}\n\nfunction unquoteValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed.startsWith(\"\\\"\") && trimmed.endsWith(\"\\\"\")) {\n return trimmed.slice(1, -1).replace(/\\\\\"/g, \"\\\"\");\n }\n return value;\n}\n\nfunction findKeyValueDelimiter(segment: string): number {\n const equalsIndex = segment.indexOf(\"=\");\n const colonIndex = segment.indexOf(\":\");\n const hasEquals = equalsIndex > 0;\n const hasColon = colonIndex > 0;\n if (hasEquals && hasColon) {\n return Math.min(equalsIndex, colonIndex);\n }\n if (hasEquals) {\n return equalsIndex;\n }\n if (hasColon) {\n return colonIndex;\n }\n return -1;\n}\n\nfunction buildOptionSpecificKvGuidance(raw: string, optionName: string): string {\n if (optionName === \"--add\" || optionName === \"--add-glob\") {\n const looksLikePath = /[./\\\\]/.test(raw) || /\\.[a-z]{1,6}$/i.test(raw.trim());\n if (looksLikePath) {\n return 'For file/doc paths use: path=<file-path>[,scope=project|global]. The scope field is optional and defaults to project (example: path=src/api.ts or path=README.md,scope=project). ';\n }\n }\n if (optionName !== \"--event\") {\n return \"\";\n }\n const lowered = raw.toLowerCase();\n const recurrenceHint =\n lowered.includes(\"recur_\") || lowered.includes(\"recurrence\")\n ? ' Recurrence list values must stay in one field and use \"|\" delimiters (for example recur_by_weekday=mon|wed or recur_by_month_day=1|15).'\n : \"\";\n const weekdayAliasHint = lowered.includes(\"recur_byweekday\")\n ? \" Use recur_by_weekday (with underscores) for weekday recurrence filters.\"\n : \"\";\n return `${recurrenceHint}${weekdayAliasHint}`;\n}\n\nfunction buildInvalidKvMessage(raw: string, optionName: string): string {\n const condensed = raw.replaceAll(/\\s+/g, \" \").trim();\n const preview = condensed.length > 160 ? `${condensed.slice(0, 157)}...` : condensed;\n const optionSpecificGuidance = buildOptionSpecificKvGuidance(raw, optionName);\n return (\n `Invalid ${optionName} value \"${preview}\". Expected key=value entries separated by commas. ` +\n optionSpecificGuidance +\n 'Also accepts markdown-style key/value lines (for example \"- path: README.md\"). ' +\n `Use ${optionName} ${STDIN_TOKEN} to read piped stdin input.`\n );\n}\n\nfunction parseMarkdownKeyValueLines(raw: string): Record<string, string> | null {\n const normalized = stripCodeFenceEnvelope(raw).trim();\n if (normalized.length === 0) {\n return null;\n }\n if (!normalized.includes(\"\\n\") && !normalized.startsWith(\"-\") && !normalized.startsWith(\"*\") && !normalized.startsWith(\"+\")) {\n return null;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const lines = normalizeLineEndings(normalized)\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n for (const line of lines) {\n const match = line.match(/^(?:[-*+]\\s+)?([a-zA-Z0-9_.-]+)\\s*(=|:)\\s*(.*)$/);\n if (match) {\n const key = match[1].trim();\n result[key] = unquoteValue(match[3].trim());\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]}\\n${line}`;\n continue;\n }\n return null;\n }\n\n return result;\n}\n\nexport function parseCsvKv(raw: string, optionName: string): Record<string, string> {\n const trimmed = stripCodeFenceEnvelope(raw).trim();\n if (!trimmed) {\n throw new PmCliError(`${optionName} cannot be empty`, EXIT_CODE.USAGE);\n }\n\n const markdownStyle = parseMarkdownKeyValueLines(trimmed);\n if (markdownStyle) {\n return markdownStyle;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const segments = splitCsvSegments(trimmed);\n\n for (const segment of segments) {\n const delimiterIndex = findKeyValueDelimiter(segment);\n if (delimiterIndex > 0) {\n const key = segment.slice(0, delimiterIndex).trim();\n const value = unquoteValue(segment.slice(delimiterIndex + 1).trim());\n result[key] = value;\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]},${segment.trim()}`;\n continue;\n }\n throw new PmCliError(buildInvalidKvMessage(raw, optionName), EXIT_CODE.USAGE);\n }\n\n return result;\n}\n\nasync function readStdinText(optionName: string): Promise<string> {\n if (process.stdin.isTTY === true) {\n throw new PmCliError(\n `${optionName} value \"${STDIN_TOKEN}\" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,\n EXIT_CODE.USAGE,\n );\n }\n process.stdin.setEncoding(\"utf8\");\n return await new Promise<string>((resolve, reject) => {\n let input = \"\";\n process.stdin.on(\"data\", (chunk: string) => {\n input += chunk;\n });\n process.stdin.on(\"end\", () => {\n resolve(normalizeLineEndings(input));\n });\n process.stdin.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\nexport interface StdinTokenResolver {\n resolveValue(value: string | undefined, optionName: string): Promise<string | undefined>;\n resolveList(values: string[] | undefined, optionName: string): Promise<string[] | undefined>;\n}\n\nexport function createStdinTokenResolver(): StdinTokenResolver {\n let stdinValuePromise: Promise<string> | undefined;\n let stdinConsumerOption: string | undefined;\n\n const consumeStdin = async (optionName: string): Promise<string> => {\n if (stdinConsumerOption && stdinConsumerOption !== optionName) {\n throw new PmCliError(\n `Only one option may use \"${STDIN_TOKEN}\" stdin token per command invocation. Already used by ${stdinConsumerOption}.`,\n EXIT_CODE.USAGE,\n );\n }\n stdinConsumerOption = optionName;\n if (!stdinValuePromise) {\n stdinValuePromise = readStdinText(optionName);\n }\n return await stdinValuePromise;\n };\n\n const resolveValue = async (value: string | undefined, optionName: string): Promise<string | undefined> => {\n if (value === undefined) {\n return undefined;\n }\n if (value.trim() !== STDIN_TOKEN) {\n return value;\n }\n return await consumeStdin(optionName);\n };\n\n const resolveList = async (values: string[] | undefined, optionName: string): Promise<string[] | undefined> => {\n if (!values) {\n return undefined;\n }\n const tokenIndexes = values\n .map((entry, index) => (entry.trim() === STDIN_TOKEN ? index : -1))\n .filter((index) => index >= 0);\n if (tokenIndexes.length === 0) {\n return values;\n }\n if (tokenIndexes.length > 1) {\n throw new PmCliError(\n `${optionName} accepts \"${STDIN_TOKEN}\" stdin token at most once per command invocation`,\n EXIT_CODE.USAGE,\n );\n }\n const stdinValue = await consumeStdin(optionName);\n const next = [...values];\n next[tokenIndexes[0]] = stdinValue;\n return next;\n };\n\n return {\n resolveValue,\n resolveList,\n };\n}\n\nexport function parseOptionalNumber(raw: string, optionName: string): number {\n const value = Number(raw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(`Invalid ${optionName} value \"${raw}\"`, EXIT_CODE.USAGE);\n }\n return value;\n}\n\nexport const _testOnly = {\n coerceJsonTagArray,\n stripCodeFenceEnvelope,\n parseMarkdownKeyValueLines,\n};\n"],"names":[],"mappings":";;;;;;;;AAGA,IAAM,cAAc;AACpB,IAAM,yBAAyB,oBAAI,IAAI;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AAEK,SAAU,UAAU,KAAW;AACnC,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,YAAY,IAAI;AAClB,WAAO,CAAA;EACT;AACA,QAAM,SAAS,mBAAmB,OAAO,KAAK;AAC9C,QAAM,OAAO,OACV,MAAM,GAAG,EACT,IAAI,CAAC,QAAQ,IAAI,KAAI,CAAE,EACvB,OAAO,OAAO,EACd,IAAI,CAAC,QAAQ,IAAI,YAAW,CAAE;AACj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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]="537a6d63-6806-5bdc-ae0f-3e84cf25eb7e")}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]="b6f39b42-b30d-556c-b72b-86fa0bc7f26a")}catch(e){}}();
3
3
  import {
4
4
  EXIT_CODE,
5
5
  PmCliError,
6
6
  isPathWithinDirectory,
7
7
  pathExists
8
- } from "./chunk-A6LXQFO7.js";
8
+ } from "./chunk-KTVETP66.js";
9
9
 
10
10
  // dist/cli/commands/extension/shared.js
11
11
  import fs from "node:fs/promises";
@@ -76,7 +76,7 @@ async function validateExtensionDirectory(directory) {
76
76
  try {
77
77
  parsedManifest = JSON.parse(await fs.readFile(manifestPath, "utf8"));
78
78
  } catch (error) {
79
- throw new PmCliError(`Failed to parse extension manifest at "${manifestPath}": ${error instanceof Error ? error.message : String(error)}`, EXIT_CODE.USAGE);
79
+ throw new PmCliError(`Failed to parse extension manifest at "${manifestPath}": ${formatManifestReadError(error)}`, EXIT_CODE.USAGE);
80
80
  }
81
81
  const manifest = parseExtensionManifest(parsedManifest);
82
82
  if (!manifest) {
@@ -99,6 +99,9 @@ async function validateExtensionDirectory(directory) {
99
99
  manifest
100
100
  };
101
101
  }
102
+ function formatManifestReadError(error) {
103
+ return error instanceof Error ? error.message : String(error);
104
+ }
102
105
 
103
106
  export {
104
107
  normalizeStringList,
@@ -107,6 +110,6 @@ export {
107
110
  parseExtensionManifest,
108
111
  validateExtensionDirectory
109
112
  };
110
- //# sourceMappingURL=chunk-VAOUX6TK.js.map
113
+ //# sourceMappingURL=chunk-FTAZLAR7.js.map
111
114
 
112
- //# debugId=537a6d63-6806-5bdc-ae0f-3e84cf25eb7e
115
+ //# debugId=b6f39b42-b30d-556c-b72b-86fa0bc7f26a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/extension/shared.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport type { ExtensionManifest } from \"../../../core/extensions/loader.js\";\n\nexport const DEFAULT_EXTENSION_PRIORITY = 100;\n\nexport interface ValidatedExtensionDirectory {\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\nexport function normalizeStringList(values: readonly string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\nexport function normalizeExtensionNameForMatch(value: string): string {\n return value.trim().toLowerCase();\n}\n\nexport function normalizeManagedDirectoryName(name: string): string {\n const normalized = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (normalized.length === 0) {\n throw new PmCliError(\"Extension manifest name must resolve to a non-empty directory name.\", EXIT_CODE.USAGE);\n }\n if (normalized === \".\" || normalized === \"..\") {\n // Manifest-controlled input must resolve to a dedicated child directory, never\n // the extensions root itself or its parent (path-traversal guard).\n throw new PmCliError(\"Extension manifest name must not resolve to \\\".\\\" or \\\"..\\\".\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nexport function parseExtensionManifest(raw: unknown): ExtensionManifest | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const candidate = raw as Record<string, unknown>;\n if (typeof candidate.name !== \"string\" || candidate.name.trim().length === 0) {\n return null;\n }\n if (typeof candidate.version !== \"string\" || candidate.version.trim().length === 0) {\n return null;\n }\n if (typeof candidate.entry !== \"string\" || candidate.entry.trim().length === 0) {\n return null;\n }\n\n let priority = DEFAULT_EXTENSION_PRIORITY;\n if (candidate.priority !== undefined && candidate.priority !== null) {\n if (typeof candidate.priority !== \"number\" || !Number.isInteger(candidate.priority)) {\n return null;\n }\n priority = candidate.priority;\n }\n\n let capabilities: string[] = [];\n if (candidate.capabilities !== undefined && candidate.capabilities !== null) {\n if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== \"string\")) {\n return null;\n }\n capabilities = normalizeStringList(candidate.capabilities.map((value) => String(value).toLowerCase()));\n }\n\n return {\n name: candidate.name.trim(),\n version: candidate.version.trim(),\n entry: candidate.entry.trim(),\n priority,\n capabilities,\n };\n}\n\nexport async function isCanonicalPathWithinDirectory(directory: string, targetPath: string): Promise<boolean> {\n const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);\n return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);\n}\n\nexport async function validateExtensionDirectory(directory: string): Promise<ValidatedExtensionDirectory> {\n const manifestPath = path.join(directory, \"manifest.json\");\n if (!(await pathExists(manifestPath))) {\n throw new PmCliError(`Extension manifest is missing at \"${manifestPath}\".`, EXIT_CODE.USAGE);\n }\n\n let parsedManifest: unknown;\n try {\n parsedManifest = JSON.parse(await fs.readFile(manifestPath, \"utf8\")) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse extension manifest at \"${manifestPath}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n const manifest = parseExtensionManifest(parsedManifest);\n if (!manifest) {\n throw new PmCliError(`Extension manifest at \"${manifestPath}\" is invalid.`, EXIT_CODE.USAGE);\n }\n\n const entryPath = path.resolve(directory, manifest.entry);\n if (!isPathWithinDirectory(directory, entryPath)) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory \"${directory}\".`,\n EXIT_CODE.USAGE,\n );\n }\n if (!(await pathExists(entryPath))) {\n throw new PmCliError(`Extension entry file is missing at \"${entryPath}\".`, EXIT_CODE.USAGE);\n }\n if (!(await isCanonicalPathWithinDirectory(directory, entryPath))) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory after symlink resolution.`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n directory,\n manifest_path: manifestPath,\n entry_path: entryPath,\n manifest,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAOV,IAAM,6BAA6B;AASpC,SAAU,oBAAoB,QAAyB;AAC3D,SAAO,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,MAAM,KAAI,CAAE,EAAE,OAAO,CAAC,UAAU,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,UACvG,KAAK,cAAc,KAAK,CAAC;AAE7B;AAEM,SAAU,+BAA+B,OAAa;AAC1D,SAAO,MAAM,KAAI,EAAG,YAAW;AACjC;AAEM,SAAU,8BAA8B,MAAY;AACxD,QAAM,aAAa,KAChB,KAAI,EACJ,YAAW,EACX,QAAQ,kBAAkB,GAAG,EAC7B,QAAQ,YAAY,EAAE;AACzB,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI,WAAW,uEAAuE,UAAU,KAAK;EAC7G;AACA,MAAI,eAAe,OAAO,eAAe,MAAM;AAG7C,UAAM,IAAI,WAAW,4DAAgE,UAAU,KAAK;EACtG;AACA,SAAO;AACT;AAEM,SAAU,uBAAuB,KAAY;AACjD,MAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM;AAC3C,WAAO;EACT;AACA,QAAM,YAAY;AAClB,MAAI,OAAO,UAAU,SAAS,YAAY,UAAU,KAAK,KAAI,EAAG,WAAW,GAAG;AAC5E,WAAO;EACT;AACA,MAAI,OAAO,UAAU,YAAY,YAAY,UAAU,QAAQ,KAAI,EAA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AAY,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,IAClH,UAAU,KAAK;EAEnB;AAEA,QAAM,WAAW,uBAAuB,cAAc;AACtD,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,WAAW,0BAA0B,YAAY,iBAAiB,UAAU,KAAK;EAC7F;AAEA,QAAM,YAAY,KAAK,QAAQ,WAAW,SAAS,KAAK;AACxD,MAAI,CAAC,sBAAsB,WAAW,SAAS,GAAG;AAChD,UAAM,IAAI,WACR,oBAAoB,SAAS,KAAK,2CAA2C,SAAS,MACtF,UAAU,KAAK;EAEnB;AACA,MAAI,CAAE,MAAM,WAAW,SAAS,GAAI;AAClC,UAAM,IAAI,WAAW,uCAAuC,SAAS,MAAM,UAAU,KAAK;EAC5F;AACA,MAAI,CAAE,MAAM,+BAA+B,WAAW,SAAS,GAAI;AACjE,UAAM,IAAI,WACR,oBAAoB,SAAS,KAAK,oEAClC,UAAU,KAAK;EAEnB;AAEA,SAAO;IACL;IACA,eAAe;IACf,YAAY;IACZ;;AAEJ","debugId":"537a6d63-6806-5bdc-ae0f-3e84cf25eb7e"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/extension/shared.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport type { ExtensionManifest } from \"../../../core/extensions/loader.js\";\n\nexport const DEFAULT_EXTENSION_PRIORITY = 100;\n\nexport interface ValidatedExtensionDirectory {\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\nexport function normalizeStringList(values: readonly string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\nexport function normalizeExtensionNameForMatch(value: string): string {\n return value.trim().toLowerCase();\n}\n\nexport function normalizeManagedDirectoryName(name: string): string {\n const normalized = name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (normalized.length === 0) {\n throw new PmCliError(\"Extension manifest name must resolve to a non-empty directory name.\", EXIT_CODE.USAGE);\n }\n if (normalized === \".\" || normalized === \"..\") {\n // Manifest-controlled input must resolve to a dedicated child directory, never\n // the extensions root itself or its parent (path-traversal guard).\n throw new PmCliError(\"Extension manifest name must not resolve to \\\".\\\" or \\\"..\\\".\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nexport function parseExtensionManifest(raw: unknown): ExtensionManifest | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const candidate = raw as Record<string, unknown>;\n if (typeof candidate.name !== \"string\" || candidate.name.trim().length === 0) {\n return null;\n }\n if (typeof candidate.version !== \"string\" || candidate.version.trim().length === 0) {\n return null;\n }\n if (typeof candidate.entry !== \"string\" || candidate.entry.trim().length === 0) {\n return null;\n }\n\n let priority = DEFAULT_EXTENSION_PRIORITY;\n if (candidate.priority !== undefined && candidate.priority !== null) {\n if (typeof candidate.priority !== \"number\" || !Number.isInteger(candidate.priority)) {\n return null;\n }\n priority = candidate.priority;\n }\n\n let capabilities: string[] = [];\n if (candidate.capabilities !== undefined && candidate.capabilities !== null) {\n if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== \"string\")) {\n return null;\n }\n capabilities = normalizeStringList(candidate.capabilities.map((value) => String(value).toLowerCase()));\n }\n\n return {\n name: candidate.name.trim(),\n version: candidate.version.trim(),\n entry: candidate.entry.trim(),\n priority,\n capabilities,\n };\n}\n\nexport async function isCanonicalPathWithinDirectory(directory: string, targetPath: string): Promise<boolean> {\n const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);\n return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);\n}\n\nexport async function validateExtensionDirectory(directory: string): Promise<ValidatedExtensionDirectory> {\n const manifestPath = path.join(directory, \"manifest.json\");\n if (!(await pathExists(manifestPath))) {\n throw new PmCliError(`Extension manifest is missing at \"${manifestPath}\".`, EXIT_CODE.USAGE);\n }\n\n let parsedManifest: unknown;\n try {\n parsedManifest = JSON.parse(await fs.readFile(manifestPath, \"utf8\")) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Failed to parse extension manifest at \"${manifestPath}\": ${formatManifestReadError(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n const manifest = parseExtensionManifest(parsedManifest);\n if (!manifest) {\n throw new PmCliError(`Extension manifest at \"${manifestPath}\" is invalid.`, EXIT_CODE.USAGE);\n }\n\n const entryPath = path.resolve(directory, manifest.entry);\n if (!isPathWithinDirectory(directory, entryPath)) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory \"${directory}\".`,\n EXIT_CODE.USAGE,\n );\n }\n if (!(await pathExists(entryPath))) {\n throw new PmCliError(`Extension entry file is missing at \"${entryPath}\".`, EXIT_CODE.USAGE);\n }\n if (!(await isCanonicalPathWithinDirectory(directory, entryPath))) {\n throw new PmCliError(\n `Extension entry \"${manifest.entry}\" resolves outside extension directory after symlink resolution.`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n directory,\n manifest_path: manifestPath,\n entry_path: entryPath,\n manifest,\n };\n}\n\nfunction formatManifestReadError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport const _testOnlyExtensionShared = {\n formatManifestReadError,\n};\n"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAOV,IAAM,6BAA6B;AASpC,SAAU,oBAAoB,QAAyB;AAC3D,SAAO,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,MAAM,KAAI,CAAE,EAAE,OAAO,CAAC,UAAU,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,KA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AAK,oEAClC,UAAU,KAAK;EAEnB;AAEA,SAAO;IACL;IACA,eAAe;IACf,YAAY;IACZ;;AAEJ;AAEA,SAAS,wBAAwB,OAAc;AAC7C,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D","debugId":"b6f39b42-b30d-556c-b72b-86fa0bc7f26a"}
@@ -1,25 +1,25 @@
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]="2663dc72-ebe4-5c50-8d4c-28022abebefe")}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]="6aed002b-03c4-5e39-8efe-9832d16940dd")}catch(e){}}();
3
3
  import {
4
4
  resolveAuthor
5
5
  } from "./chunk-J27KIHTG.js";
6
6
  import {
7
7
  parseCsvKv
8
- } from "./chunk-I7NYDZDV.js";
8
+ } from "./chunk-F7WSO5UX.js";
9
9
  import {
10
10
  parseLimit
11
- } from "./chunk-P5U5EOMA.js";
11
+ } from "./chunk-UBMCSJXX.js";
12
12
  import {
13
13
  locateItem,
14
14
  mutateItem,
15
15
  readLocatedItem
16
- } from "./chunk-HI7STVF2.js";
16
+ } from "./chunk-7K2MXFMX.js";
17
17
  import {
18
18
  resolveItemTypeRegistry
19
- } from "./chunk-CCX4RSYZ.js";
19
+ } from "./chunk-ZONXMSVB.js";
20
20
  import {
21
21
  nowIso
22
- } from "./chunk-WUNFKP7M.js";
22
+ } from "./chunk-G2YVUY7I.js";
23
23
  import {
24
24
  EXIT_CODE,
25
25
  PmCliError,
@@ -28,7 +28,7 @@ import {
28
28
  pathExists,
29
29
  readSettings,
30
30
  resolvePmRoot
31
- } from "./chunk-A6LXQFO7.js";
31
+ } from "./chunk-KTVETP66.js";
32
32
 
33
33
  // dist/cli/commands/annotation-command.js
34
34
  function limitAnnotationEntries(values, limit) {
@@ -97,10 +97,69 @@ async function runAnnotationCommand(id, options, global, config) {
97
97
  return renderAnnotationResult(located.id, config.collectionKey, allEntries2, limit, options.includeMeta === true);
98
98
  }
99
99
  const author = resolveAuthor(options.author, settings.author_default);
100
+ if (config.input.mode === "delete") {
101
+ const op = config.deleteOp ?? config.op;
102
+ let result2;
103
+ try {
104
+ result2 = await mutateItem({
105
+ pmRoot,
106
+ settings,
107
+ id,
108
+ op,
109
+ author,
110
+ message: options.message,
111
+ force: options.force,
112
+ bypassAssigneeConflict: config.allowAuditBypass,
113
+ mutate(document) {
114
+ const entries = readAnnotationEntries(document.metadata, config.collectionKey);
115
+ const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);
116
+ entries.splice(arrayIndex, 1);
117
+ document.metadata[config.collectionKey] = entries;
118
+ return { changedFields: [config.collectionKey] };
119
+ }
120
+ });
121
+ } catch (error) {
122
+ wrapOwnershipConflict(error, config.conflictGuidance);
123
+ }
124
+ const allEntries2 = readAnnotationEntries(result2.item, config.collectionKey);
125
+ return renderAnnotationResult(result2.item.id, config.collectionKey, allEntries2, limit, options.includeMeta === true);
126
+ }
100
127
  const text = config.parseText(config.input.value ?? "");
101
128
  if (!text.trim()) {
102
129
  throw new PmCliError(`${config.input.emptyFlag ?? "--add"} text cannot be empty`, EXIT_CODE.USAGE);
103
130
  }
131
+ if (config.input.mode === "edit") {
132
+ const op = config.editOp ?? config.op;
133
+ let result2;
134
+ try {
135
+ result2 = await mutateItem({
136
+ pmRoot,
137
+ settings,
138
+ id,
139
+ op,
140
+ author,
141
+ message: options.message,
142
+ force: options.force,
143
+ bypassAssigneeConflict: config.allowAuditBypass,
144
+ mutate(document) {
145
+ const entries = readAnnotationEntries(document.metadata, config.collectionKey);
146
+ const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);
147
+ const existing = entries[arrayIndex];
148
+ entries[arrayIndex] = {
149
+ ...existing,
150
+ text,
151
+ edited_at: nowIso()
152
+ };
153
+ document.metadata[config.collectionKey] = entries;
154
+ return { changedFields: [config.collectionKey] };
155
+ }
156
+ });
157
+ } catch (error) {
158
+ wrapOwnershipConflict(error, config.conflictGuidance);
159
+ }
160
+ const allEntries2 = readAnnotationEntries(result2.item, config.collectionKey);
161
+ return renderAnnotationResult(result2.item.id, config.collectionKey, allEntries2, limit, options.includeMeta === true);
162
+ }
104
163
  let result;
105
164
  try {
106
165
  result = await mutateItem({
@@ -129,6 +188,15 @@ async function runAnnotationCommand(id, options, global, config) {
129
188
  const allEntries = readAnnotationEntries(result.item, config.collectionKey);
130
189
  return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);
131
190
  }
191
+ function resolveAnnotationIndex(oneBasedIndex, count, collectionKey) {
192
+ if (oneBasedIndex === void 0 || !Number.isInteger(oneBasedIndex) || oneBasedIndex < 1 || oneBasedIndex > count) {
193
+ const singular = collectionKey.replace(/s$/, "");
194
+ const label = `${singular.charAt(0).toUpperCase()}${singular.slice(1)}`;
195
+ const noun = count === 1 ? `1 ${singular}` : `${count} ${collectionKey}`;
196
+ throw new PmCliError(`${label} index ${oneBasedIndex ?? "(missing)"} out of range (item has ${noun})`, EXIT_CODE.USAGE);
197
+ }
198
+ return oneBasedIndex - 1;
199
+ }
132
200
  function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMeta) {
133
201
  const entries = limitAnnotationEntries(allEntries, limit);
134
202
  return {
@@ -149,6 +217,6 @@ export {
149
217
  wrapOwnershipConflict,
150
218
  runAnnotationCommand
151
219
  };
152
- //# sourceMappingURL=chunk-OASDW5UI.js.map
220
+ //# sourceMappingURL=chunk-FXNT5LPX.js.map
153
221
 
154
- //# debugId=2663dc72-ebe4-5c50-8d4c-28022abebefe
222
+ //# debugId=6aed002b-03c4-5e39-8efe-9832d16940dd
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/annotation-command.ts"],"sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { parseCsvKv } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\ninterface AnnotationEntry {\n created_at: string;\n author: string;\n text: string;\n edited_at?: string;\n}\n\ninterface AnnotationCommandOptions {\n limit?: string;\n author?: string;\n message?: string;\n force?: boolean;\n includeMeta?: boolean;\n}\n\ninterface AnnotationInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n emptyFlag?: string;\n index?: number;\n}\n\ninterface OwnershipConflictGuidance {\n required: string;\n examples: string[];\n nextSteps: string[];\n}\n\ninterface AnnotationCommandConfig<TKey extends string> {\n input: AnnotationInput;\n collectionKey: TKey;\n op: Parameters<typeof mutateItem>[0][\"op\"];\n editOp?: Parameters<typeof mutateItem>[0][\"op\"];\n deleteOp?: Parameters<typeof mutateItem>[0][\"op\"];\n parseText: (raw: string) => string;\n allowAuditBypass: boolean;\n conflictGuidance: OwnershipConflictGuidance;\n}\n\ntype AnnotationCommandResult<TKey extends string, TEntry extends AnnotationEntry> = {\n id: string;\n count: number;\n} & Record<TKey, TEntry[]> & {\n total_count?: number;\n returned_count?: number;\n has_more?: boolean;\n limit?: number;\n };\n\nexport function limitAnnotationEntries<TEntry>(values: TEntry[], limit: number | undefined): TEntry[] {\n if (limit === undefined) return values;\n if (limit === 0) return [];\n return values.slice(Math.max(0, values.length - limit));\n}\n\nexport function readAnnotationEntries<TEntry>(source: Record<string, unknown>, collectionKey: string): TEntry[] {\n const value = source[collectionKey];\n return Array.isArray(value) ? (value as TEntry[]) : [];\n}\n\nexport function parseAnnotationTextInput(raw: string, options: { stripPlainTextPrefix?: boolean } = {}): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n return \"\";\n }\n const textPrefixMatch = /^(?:[-*+]\\s*)?text\\s*[:=]/i.exec(trimmed);\n if (options.stripPlainTextPrefix === true && textPrefixMatch && !trimmed.startsWith(\"```\")) {\n const text = trimmed.slice(textPrefixMatch[0].length).trim();\n return text || trimmed;\n }\n const looksStructured = /^(?:[-*+]\\s*)?text\\s*[:=]/im.test(trimmed) || trimmed.startsWith(\"```\");\n if (!looksStructured) {\n return trimmed;\n }\n try {\n const kv = parseCsvKv(trimmed, \"--add\");\n const keys = Object.keys(kv).map((key) => key.trim().toLowerCase());\n if (keys.some((key) => key !== \"text\")) {\n return trimmed;\n }\n const text = kv.text?.trim();\n return text || trimmed;\n } catch {\n return trimmed;\n }\n}\n\nexport function wrapOwnershipConflict(error: unknown, guidance: OwnershipConflictGuidance): never {\n if (\n error instanceof PmCliError &&\n error.exitCode === EXIT_CODE.CONFLICT &&\n error.message.includes(\"is assigned to\") &&\n error.message.includes(\"Use --force to override\")\n ) {\n throw new PmCliError(error.message, error.exitCode, {\n code: \"ownership_conflict\",\n required: guidance.required,\n examples: guidance.examples,\n nextSteps: guidance.nextSteps,\n });\n }\n throw error;\n}\n\nexport async function runAnnotationCommand<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n options: AnnotationCommandOptions,\n global: GlobalOptions,\n config: AnnotationCommandConfig<TKey>,\n): Promise<AnnotationCommandResult<TKey, TEntry>> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const limit = parseLimit(options.limit);\n\n if (config.input.mode === \"list\") {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const allEntries = readAnnotationEntries<TEntry>(loaded.document.metadata, config.collectionKey);\n return renderAnnotationResult(located.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n\n if (config.input.mode === \"delete\") {\n const op = config.deleteOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n entries.splice(arrayIndex, 1);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const text = config.parseText(config.input.value ?? \"\");\n if (!text.trim()) {\n throw new PmCliError(`${config.input.emptyFlag ?? \"--add\"} text cannot be empty`, EXIT_CODE.USAGE);\n }\n\n if (config.input.mode === \"edit\") {\n const op = config.editOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n const existing = entries[arrayIndex];\n entries[arrayIndex] = {\n ...existing,\n text,\n edited_at: nowIso(),\n } as TEntry;\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n entries.push({\n created_at: nowIso(),\n author,\n text,\n } as TEntry);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n}\n\nexport function resolveAnnotationIndex(\n oneBasedIndex: number | undefined,\n count: number,\n collectionKey: string,\n): number {\n if (oneBasedIndex === undefined || !Number.isInteger(oneBasedIndex) || oneBasedIndex < 1 || oneBasedIndex > count) {\n const singular = collectionKey.replace(/s$/, \"\");\n const label = `${singular.charAt(0).toUpperCase()}${singular.slice(1)}`;\n const noun = count === 1 ? `1 ${singular}` : `${count} ${collectionKey}`;\n throw new PmCliError(\n `${label} index ${oneBasedIndex ?? \"(missing)\"} out of range (item has ${noun})`,\n EXIT_CODE.USAGE,\n );\n }\n return oneBasedIndex - 1;\n}\n\nfunction renderAnnotationResult<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n collectionKey: TKey,\n allEntries: TEntry[],\n limit: number | undefined,\n includeMeta: boolean,\n): AnnotationCommandResult<TKey, TEntry> {\n const entries = limitAnnotationEntries(allEntries, limit);\n return {\n id,\n [collectionKey]: entries,\n count: entries.length,\n ...(includeMeta\n ? {\n total_count: allEntries.length,\n returned_count: entries.length,\n has_more: entries.length < allEntries.length,\n ...(limit !== undefined ? { limit } : {}),\n }\n : {}),\n } as AnnotationCommandResult<TKey, TEntry>;\n}\n"],"names":["allEntries","result"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DM,SAAU,uBAA+B,QAAkB,OAAyB;AACxF,MAAI,UAAU;AAAW,WAAO;AAChC,MAAI,UAAU;AAAG,WAAO,CAAA;AACxB,SAAO,OAAO,MAAM,KAAK,IAAI,GAAG,OAAO,SAAS,KAAK,CAAC;AACxD;AAEM,SAAU,sBAA8B,QAAiC,eAAqB;AAClG,QAAM,QAAQ,OAAO,aAAa;AAClC,SAAO,MAAM,QAAQ,KAAK,IAAK,QAAqB,CAAA;AACtD;AAEM,SAAU,yBAAyB,KAAa,UAA8C,CAAA,GAAE;AACpG,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,CAAC,SAAS;AACZ,WAAO;EACT;AACA,QAAM,kBAAkB,6BAA6B,KAAK,OAAO;AACjE,MAAI,QAAQ,yBAAyB,QAAQ,mBAAmB,CAAC,QAAQ,WAAW,KAAK,GAAG;AAC1F,UAAM,OAAO,QAAQ,MAAM,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAI;AAC1D,WAAO,QAAQ;EACjB;AACA,QAAM,kBAAkB,8BAA8B,KAAK,OAAO,KAAK,QAAQ,WAAW,KAAK;AAC/F,MAAI,CAAC,iBAAiB;AACpB,WAAO;EACT;AACA,MAAI;AACF,UAAM,KAAK,WAAW,SAAS,OA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C,UAAM,QAAQ,GAAG,SAAS,OAAO,CAAC,EAAE,YAAW,CAAE,GAAG,SAAS,MAAM,CAAC,CAAC;AACrE,UAAM,OAAO,UAAU,IAAI,KAAK,QAAQ,KAAK,GAAG,KAAK,IAAI,aAAa;AACtE,UAAM,IAAI,WACR,GAAG,KAAK,UAAU,iBAAiB,WAAW,2BAA2B,IAAI,KAC7E,UAAU,KAAK;EAEnB;AACA,SAAO,gBAAgB;AACzB;AAEA,SAAS,uBACP,IACA,eACA,YACA,OACA,aAAoB;AAEpB,QAAM,UAAU,uBAAuB,YAAY,KAAK;AACxD,SAAO;IACL;IACA,CAAC,aAAa,GAAG;IACjB,OAAO,QAAQ;IACf,GAAI,cACA;MACE,aAAa,WAAW;MACxB,gBAAgB,QAAQ;MACxB,UAAU,QAAQ,SAAS,WAAW;MACtC,GAAI,UAAU,SAAY,EAAE,MAAK,IAAK,CAAA;QAExC,CAAA;;AAER","debugId":"6aed002b-03c4-5e39-8efe-9832d16940dd"}
@@ -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]="849dc628-ad6f-57cc-974c-36ea67ca2d07")}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]="a8989c20-78b3-55e9-b999-850f1fcf9070")}catch(e){}}();
3
3
  import {
4
4
  EXIT_CODE,
5
5
  PmCliError
6
- } from "./chunk-A6LXQFO7.js";
6
+ } from "./chunk-KTVETP66.js";
7
7
 
8
8
  // dist/core/shared/time.js
9
9
  var RELATIVE_DEADLINE = /^([+-]?)(\d+)([hdwm])$/i;
@@ -42,13 +42,18 @@ function normalizeOffset(raw) {
42
42
  return `${compact[1]}:${compact[2]}`;
43
43
  return raw;
44
44
  }
45
+ function pushTimestampCandidate(candidates, input, value) {
46
+ if (!value)
47
+ return;
48
+ if (value === input)
49
+ return;
50
+ if (candidates.includes(value))
51
+ return;
52
+ candidates.push(value);
53
+ }
45
54
  function normalizeTimestampCandidates(input) {
46
55
  const candidates = [];
47
- const push = (value) => {
48
- if (!value || value === input || candidates.includes(value))
49
- return;
50
- candidates.push(value);
51
- };
56
+ const push = (value) => pushTimestampCandidate(candidates, input, value);
52
57
  const compactDate = COMPACT_DATE.exec(input);
53
58
  if (compactDate) {
54
59
  const [, year, month, day] = compactDate;
@@ -199,6 +204,6 @@ export {
199
204
  compareTimestampStrings,
200
205
  resolveIsoOrRelative
201
206
  };
202
- //# sourceMappingURL=chunk-WUNFKP7M.js.map
207
+ //# sourceMappingURL=chunk-G2YVUY7I.js.map
203
208
 
204
- //# debugId=849dc628-ad6f-57cc-974c-36ea67ca2d07
209
+ //# debugId=a8989c20-78b3-55e9-b999-850f1fcf9070
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/shared/time.ts"],"sourcesContent":["import { PmCliError } from \"./errors.js\";\nimport { EXIT_CODE } from \"./constants.js\";\n\nconst RELATIVE_DEADLINE = /^([+-]?)(\\d+)([hdwm])$/i;\nconst COMPOUND_RELATIVE_DEADLINE = /^[+-]?\\d+[hdwm](?:[+-]\\d+[hdwm])+$/i;\nconst COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})$/;\nconst COMPACT_DATETIME = /^(\\d{4})(\\d{2})(\\d{2})(?:[T\\s]?)(\\d{2})(\\d{2})(\\d{2})?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\nconst HYPHEN_TIME = /^(\\d{4}-\\d{2}-\\d{2})[T\\s](\\d{2})-(\\d{2})(?:-(\\d{2}))?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\nconst COMPACT_TIME = /^(\\d{4}-\\d{2}-\\d{2})[T\\s](\\d{2})(\\d{2})(\\d{2})?([.,]\\d{1,3})?(Z|[+-]\\d{2}:?\\d{2})?$/i;\n\nexport function nowIso(): string {\n return new Date().toISOString();\n}\n\nexport function isTimestampLiteral(input: string): boolean {\n return Number.isFinite(Date.parse(input));\n}\n\nexport function compareTimestampStrings(left: string, right: string): number {\n const leftMs = Date.parse(left);\n const rightMs = Date.parse(right);\n if (Number.isFinite(leftMs) && Number.isFinite(rightMs) && leftMs !== rightMs) {\n return leftMs - rightMs;\n }\n return left.localeCompare(right);\n}\n\nfunction normalizeFraction(raw: string | undefined): string {\n if (!raw) return \"\";\n const digits = raw.slice(1);\n return `.${digits.padEnd(3, \"0\").slice(0, 3)}`;\n}\n\nfunction normalizeOffset(raw: string | undefined): string {\n if (!raw) return \"\";\n if (raw.toUpperCase() === \"Z\") return \"Z\";\n const compact = /^([+-]\\d{2})(\\d{2})$/.exec(raw);\n if (compact) return `${compact[1]}:${compact[2]}`;\n return raw;\n}\n\nfunction pushTimestampCandidate(candidates: string[], input: string, value: string | undefined): void {\n if (!value) return;\n if (value === input) return;\n if (candidates.includes(value)) return;\n candidates.push(value);\n}\n\nfunction normalizeTimestampCandidates(input: string): string[] {\n const candidates: string[] = [];\n const push = (value: string | undefined): void => pushTimestampCandidate(candidates, input, value);\n\n const compactDate = COMPACT_DATE.exec(input);\n if (compactDate) {\n const [, year, month, day] = compactDate;\n push(`${year}-${month}-${day}`);\n }\n\n const compactDateTime = COMPACT_DATETIME.exec(input);\n if (compactDateTime) {\n const [, year, month, day, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactDateTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(\n `${year}-${month}-${day}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`,\n );\n }\n\n const hyphenTime = HYPHEN_TIME.exec(input);\n if (hyphenTime) {\n const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = hyphenTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);\n }\n\n const compactTime = COMPACT_TIME.exec(input);\n if (compactTime) {\n const [, datePart, hour, minute, secondRaw, fractionRaw, offsetRaw] = compactTime;\n const second = secondRaw ? `:${secondRaw}` : \"\";\n push(`${datePart}T${hour}:${minute}${second}${normalizeFraction(fractionRaw)}${normalizeOffset(offsetRaw)}`);\n }\n\n const datePrefixLength = 10;\n const datePrefix = input.slice(0, datePrefixLength);\n if (isHyphenDatePrefix(datePrefix)) {\n let index = datePrefixLength;\n while (index < input.length && isWhitespaceCharacter(input[index])) {\n index += 1;\n }\n if (index < input.length) {\n push(`${datePrefix}T${input.slice(index)}`);\n }\n }\n\n return candidates;\n}\n\nfunction parseTimestampWithFallbacks(input: string): number {\n const direct = Date.parse(input);\n if (Number.isFinite(direct)) return direct;\n for (const candidate of normalizeTimestampCandidates(input)) {\n const parsed = Date.parse(candidate);\n if (Number.isFinite(parsed)) return parsed;\n }\n return Number.NaN;\n}\n\nfunction isHyphenDatePrefix(value: string): boolean {\n if (value.length !== 10) {\n return false;\n }\n for (let index = 0; index < value.length; index += 1) {\n const character = value[index];\n if (index === 4 || index === 7) {\n if (character !== \"-\") {\n return false;\n }\n continue;\n }\n const code = character.charCodeAt(0);\n if (code < 48 || code > 57) {\n return false;\n }\n }\n return true;\n}\n\nfunction isWhitespaceCharacter(character: string | undefined): boolean {\n if (!character) {\n return false;\n }\n return (\n character === \" \" ||\n character === \"\\t\" ||\n character === \"\\n\" ||\n character === \"\\r\" ||\n character === \"\\f\" ||\n character === \"\\v\"\n );\n}\n\nfunction daysInUtcMonth(year: number, monthIndex: number): number {\n return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();\n}\n\nconst MONTH_NAMES = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n] as const;\n\n// Leading literal calendar date in either hyphenated (`2026-02-30`) or compact\n// (`20260230`) form, optionally followed by any time/zone component. We validate\n// the digits the caller actually typed — not the parsed instant — so timezone\n// offsets never produce a false \"impossible date\" rejection. The hyphenated form\n// is unambiguous, so anything may follow (`T`/space time, `Z`, `+/-` offset). The\n// compact form must be followed by end-of-string or a time digit (with an optional\n// `T`/space separator) so a no-separator compact datetime like `20260230135900Z`\n// is still guarded and a 7-digit non-date is not misread as a date.\nconst LEADING_HYPHEN_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})/;\nconst LEADING_COMPACT_DATE = /^(\\d{4})(\\d{2})(\\d{2})(?:[T ]?\\d{2}|$)/;\n\n/**\n * Reject literal calendar dates whose day cannot exist (e.g. `2026-02-30`, which JS\n * `Date` silently rolls forward to March 2). Without this, agents that pass an\n * impossible deadline get a silently-wrong stored date instead of an actionable\n * error. Only triggers on a leading literal date; relative tokens, \"now\", and pure\n * times are untouched. Month 00 / >12 is also rejected with a clear message rather\n * than falling through to the generic \"invalid value\" path.\n */\nfunction assertRealCalendarDate(originalInput: string, trimmed: string, fieldLabel: string): void {\n const match = LEADING_HYPHEN_DATE.exec(trimmed) ?? LEADING_COMPACT_DATE.exec(trimmed);\n if (!match) {\n return;\n }\n const year = Number.parseInt(match[1], 10);\n const month = Number.parseInt(match[2], 10);\n const day = Number.parseInt(match[3], 10);\n const label = fieldLabel?.trim() || \"deadline\";\n if (month < 1 || month > 12) {\n throw new PmCliError(\n `Invalid ${label} value \"${originalInput}\". Month \"${match[2]}\" is out of range — use a month between 01 and 12.`,\n EXIT_CODE.USAGE,\n );\n }\n const maxDay = daysInUtcMonth(year, month - 1);\n if (day < 1 || day > maxDay) {\n throw new PmCliError(\n `Invalid ${label} value \"${originalInput}\". ${MONTH_NAMES[month - 1]} ${year} has ${maxDay} days, so day \"${match[3]}\" does not exist. Use a real YYYY-MM-DD calendar date.`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction addUtcMonths(now: Date, amount: number): Date {\n const result = new Date(now.getTime());\n const startDay = result.getUTCDate();\n const targetMonthIndex = result.getUTCMonth() + amount;\n const targetYear = result.getUTCFullYear() + Math.floor(targetMonthIndex / 12);\n const targetMonth = ((targetMonthIndex % 12) + 12) % 12;\n const day = Math.min(startDay, daysInUtcMonth(targetYear, targetMonth));\n result.setUTCFullYear(targetYear, targetMonth, day);\n return result;\n}\n\nexport function resolveIsoOrRelative(\n input: string,\n now: Date = new Date(),\n fieldLabel = \"deadline\",\n): string {\n const trimmed = input.trim();\n if (trimmed.toLowerCase() === \"now\") {\n return now.toISOString();\n }\n const relative = RELATIVE_DEADLINE.exec(trimmed);\n if (relative) {\n const sign = relative[1] === \"-\" ? -1 : 1;\n const amount = Number.parseInt(relative[2], 10) * sign;\n const unit = relative[3].toLowerCase();\n if (unit === \"m\") {\n return addUtcMonths(now, amount).toISOString();\n }\n const msPerUnit = unit === \"h\" ? 60 * 60 * 1000 : unit === \"d\" ? 24 * 60 * 60 * 1000 : 7 * 24 * 60 * 60 * 1000;\n return new Date(now.getTime() + amount * msPerUnit).toISOString();\n }\n\n assertRealCalendarDate(input, trimmed, fieldLabel);\n\n const timestamp = parseTimestampWithFallbacks(trimmed);\n if (!Number.isFinite(timestamp)) {\n const normalizedLabel = fieldLabel.trim().length > 0 ? fieldLabel.trim() : \"deadline\";\n const guidance = COMPOUND_RELATIVE_DEADLINE.test(trimmed)\n ? \"Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string.\"\n : 'Use ISO/date string input, \"now\", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';\n throw new PmCliError(\n `Invalid ${normalizedLabel} value \"${input}\". ${guidance}`,\n EXIT_CODE.USAGE,\n );\n }\n return new Date(timestamp).toISOString();\n}\n\nexport const _testOnly = {\n normalizeOffset,\n pushTimestampCandidate,\n normalizeTimestampCandidates,\n parseTimestampWithFallbacks,\n isW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