@unbrained/pm-cli 2026.6.13 → 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 (770) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +1 -1
  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 +105 -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 +153 -8
  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 +41 -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 +203 -45
  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-PPO7QWJF.js → activity-MJGTX4LO.js} +13 -11
  180. package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.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-IRHJWEKG.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-N2AWXKZC.js → append-2Q4BPUBW.js} +10 -10
  185. package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-2Q4BPUBW.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{append-NL67JNJU.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-GRZGHGRG.js → chunk-2IUJBMKS.js} +10 -9
  189. package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-2IUJBMKS.js.map} +2 -2
  190. package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-2JEGCDYT.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-3WAULYOY.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-AGG32LKL.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-XXLMJDUB.js → chunk-4KBK4BA3.js} +13 -15
  195. package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.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-BVL5KGVA.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-LYNQ3NGI.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-W6KNFAMZ.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-7SM7VA5I.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-AAUYXSFF.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-VYZNX4C5.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-L6YQONLM.js → chunk-7K2MXFMX.js} +11 -13
  214. package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.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-TOX7YQ7X.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-RFR2YQGO.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-SQDKAEKG.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-RHYBR6G7.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-4ZKKZMLH.js → chunk-CBMETQ2U.js} +104 -30
  229. package/dist/cli-bundle/chunks/chunk-CBMETQ2U.js.map +1 -0
  230. package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-E6J2PEK6.js} +3 -3
  231. package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-F2GC6L3N.js} +3 -3
  232. package/dist/cli-bundle/chunks/{chunk-3VULHQNS.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-JCTZV7TO.js → chunk-FTAZLAR7.js} +8 -5
  235. package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-FTAZLAR7.js.map} +1 -1
  236. package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.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-IZHCCG4S.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-5HSAHRYA.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-QQG4HEX7.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-3FMQMHAG.js → chunk-GQ4JKNMV.js} +4 -4
  245. package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-GQ4JKNMV.js.map} +1 -1
  246. package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.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-7CRFV6JR.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-2J2AH4V5.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-2ANTZBYF.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-VNC2HBL4.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-CEGUH2E5.js → chunk-ILHLIA47.js} +5 -5
  257. package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-ILHLIA47.js.map} +1 -1
  258. package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.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-MGAQ6KZG.js → chunk-IQVB3YDD.js} +82 -21
  261. package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +7 -0
  262. package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.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-S2CDTRJ6.js → chunk-KTVETP66.js} +379 -271
  265. package/dist/cli-bundle/chunks/chunk-KTVETP66.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{chunk-36BCSMKP.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-XWDZVCBJ.js → chunk-L6FJPOT4.js} +11 -10
  269. package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-L6FJPOT4.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-LV5FFQ7M.js} +405 -290
  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-QU3OPNVV.js → chunk-M23HXJL3.js} +2 -2
  275. package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-MJZUZ2QE.js} +3 -3
  276. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-NCIBNERT.js} +4 -4
  277. package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-NCIBNERT.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.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-Z647PYLD.js → chunk-O46LTCXQ.js} +4 -4
  281. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-OCTQJP42.js} +19 -8
  282. package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-OCTQJP42.js.map} +2 -2
  283. package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-OLTYNVJR.js} +5 -5
  284. package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.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-KHGTYCJ6.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-4FHLNNW7.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-SOHXUA2Q.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-O3YCJOVX.js → chunk-SPYPC5CB.js} +3 -3
  293. package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-SPYPC5CB.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-SY4GKIWT.js} +82 -21
  295. package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +1 -0
  296. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-SY4PZWIZ.js} +7 -4
  297. package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-SY4PZWIZ.js.map} +2 -2
  298. package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-T5VU7ROQ.js} +4 -4
  299. package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.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-PEH7SZD2.js → chunk-TUB3DZAZ.js} +105 -31
  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-NN6RKGFW.js → chunk-UBMCSJXX.js} +3 -3
  306. package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.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-LGOXXQUW.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-M3SI2REU.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-4JHJ7YG2.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-DWG4FHPY.js → chunk-YGRPBFMA.js} +2 -2
  317. package/dist/cli-bundle/chunks/{chunk-JW7D6437.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-TSXWFN3L.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-GOO4UXBI.js → chunk-ZJRDVYZI.js} +4 -4
  322. package/dist/cli-bundle/chunks/{chunk-32XSW44C.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-QJOQBH7J.js → claim-4APLUXJW.js} +10 -10
  325. package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-NEO7AGWH.js} +10 -10
  326. package/dist/cli-bundle/chunks/{close-SPUFW5QR.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-GKAJX54X.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-GL6NRUU5.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-5FPT6L7N.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-TOLOYWNI.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-4MN45TIH.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-7N6D7YJE.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-AQSLE7DZ.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-U3PUJMVN.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-ITSJXO3O.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-H7KCQXLY.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-EB3MUCSW.js → copy-Q64T5FD4.js} +7 -7
  349. package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SG34LCMU.js} +7 -7
  350. package/dist/cli-bundle/chunks/create-F5HZX2S4.js +30 -0
  351. package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-IPAX2SNL.js} +16 -13
  352. package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-TLXR7LJ2.js} +7 -7
  353. package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-VH3L7DZ6.js} +7 -7
  354. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-J3HBBLDB.js} +9 -10
  355. package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-J3HBBLDB.js.map} +2 -2
  356. package/dist/cli-bundle/chunks/{deps-HV2C2L46.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-SRTLCQOL.js → docs-GWDEB7JH.js} +9 -9
  359. package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-RCLNSKID.js} +9 -9
  360. package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-5RN65LHT.js} +7 -5
  361. package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-7KO2NX2A.js} +7 -5
  362. package/dist/cli-bundle/chunks/{files-OIFN3DQX.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-LIFDKNCN.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-DL6AVOX5.js → gc-2FGKYRJ4.js} +3 -3
  371. package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-5B6ABL3Z.js} +3 -3
  372. package/dist/cli-bundle/chunks/{get-SAB7CRBG.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-K7UULTQF.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-NUVZYIEV.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-VJWH3ZFK.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-GYFD2DJW.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-WQZQ6KXM.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-SLL6ESXH.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-SDTDR6WM.js → history-redact-Z4P5MM3G.js} +13 -11
  388. package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.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-BJCGM6Q3.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-MXV57LKL.js → init-K6MSMB37.js} +11 -9
  394. package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.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-L6KTZGOT.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-3NLK7WTZ.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-HMCB7TK6.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-DWBYI5C6.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-NANUWH4T.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-PWQ5F2VI.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-SMMMLSWW.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-QKFPTIZG.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-ZYJQ4DVP.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-2FMZ6WEF.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-BAFQURZG.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-QN2XV7UL.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-DQEIKBIP.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-FJQWXMPY.js → restore-NNVPBBVJ.js} +13 -11
  425. package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +19 -0
  426. package/dist/cli-bundle/chunks/{schema-RNVJ55V2.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-ZZ7ZDM2X.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-BJ457C2A.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-FQDZXX7P.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-DUQWCVOS.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-CUG3ZHOI.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-33MRGX4Z.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-RK2VX75A.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-Y3CTFMEC.js → test-7GVQ3VMN.js} +16 -14
  444. package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.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-ARSMX33Q.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-5URSD34O.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-XNACGSNQ.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-6B7PJ33I.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-724JCVDE.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-ALBEZAI7.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-QHRGDBSA.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-IQRYFXIV.js → validate-7BLDG3AT.js} +221 -30
  463. package/dist/cli-bundle/chunks/validate-7BLDG3AT.js.map +1 -0
  464. package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-EHL3MI2V.js} +235 -30
  465. package/dist/cli-bundle/chunks/validate-EHL3MI2V.js.map +7 -0
  466. package/dist/cli-bundle/main.js +270 -139
  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-policy.js +14 -15
  474. package/dist/core/extensions/extension-policy.js.map +1 -1
  475. package/dist/core/extensions/item-fields.js +4 -5
  476. package/dist/core/extensions/item-fields.js.map +1 -1
  477. package/dist/core/extensions/loader.d.ts +75 -1
  478. package/dist/core/extensions/loader.js +56 -32
  479. package/dist/core/extensions/loader.js.map +1 -1
  480. package/dist/core/governance/content-fields.d.ts +84 -0
  481. package/dist/core/governance/content-fields.js +182 -0
  482. package/dist/core/governance/content-fields.js.map +1 -0
  483. package/dist/core/governance/issue-codes.d.ts +51 -0
  484. package/dist/core/governance/issue-codes.js +95 -0
  485. package/dist/core/governance/issue-codes.js.map +1 -0
  486. package/dist/core/governance/metadata-coverage.d.ts +168 -0
  487. package/dist/core/governance/metadata-coverage.js +362 -0
  488. package/dist/core/governance/metadata-coverage.js.map +1 -0
  489. package/dist/core/history/history-rewrite.d.ts +22 -0
  490. package/dist/core/history/history-rewrite.js +38 -2
  491. package/dist/core/history/history-rewrite.js.map +1 -1
  492. package/dist/core/history/history.d.ts +7 -0
  493. package/dist/core/history/history.js +6 -2
  494. package/dist/core/history/history.js.map +1 -1
  495. package/dist/core/io/body-file.d.ts +14 -0
  496. package/dist/core/io/body-file.js +47 -0
  497. package/dist/core/io/body-file.js.map +1 -0
  498. package/dist/core/item/item-format.d.ts +46 -1
  499. package/dist/core/item/item-format.js +51 -60
  500. package/dist/core/item/item-format.js.map +1 -1
  501. package/dist/core/item/parse.d.ts +9 -0
  502. package/dist/core/item/parse.js +10 -16
  503. package/dist/core/item/parse.js.map +1 -1
  504. package/dist/core/item/type-registry.d.ts +1 -0
  505. package/dist/core/item/type-registry.js +8 -10
  506. package/dist/core/item/type-registry.js.map +1 -1
  507. package/dist/core/lock/lock.d.ts +26 -0
  508. package/dist/core/lock/lock.js +10 -2
  509. package/dist/core/lock/lock.js.map +1 -1
  510. package/dist/core/output/output.d.ts +7 -0
  511. package/dist/core/output/output.js +6 -2
  512. package/dist/core/output/output.js.map +1 -1
  513. package/dist/core/schema/item-types-file.d.ts +25 -2
  514. package/dist/core/schema/item-types-file.js +78 -6
  515. package/dist/core/schema/item-types-file.js.map +1 -1
  516. package/dist/core/schema/runtime-schema.d.ts +7 -0
  517. package/dist/core/schema/runtime-schema.js +23 -16
  518. package/dist/core/schema/runtime-schema.js.map +1 -1
  519. package/dist/core/search/cache.d.ts +19 -1
  520. package/dist/core/search/cache.js +11 -3
  521. package/dist/core/search/cache.js.map +1 -1
  522. package/dist/core/search/corpus.d.ts +36 -2
  523. package/dist/core/search/corpus.js +120 -24
  524. package/dist/core/search/corpus.js.map +1 -1
  525. package/dist/core/search/providers.d.ts +19 -0
  526. package/dist/core/search/providers.js +19 -2
  527. package/dist/core/search/providers.js.map +1 -1
  528. package/dist/core/sentry/instrument.d.ts +1 -0
  529. package/dist/core/sentry/instrument.js +6 -2
  530. package/dist/core/sentry/instrument.js.map +1 -1
  531. package/dist/core/session/session-state.d.ts +16 -0
  532. package/dist/core/session/session-state.js +48 -0
  533. package/dist/core/session/session-state.js.map +1 -0
  534. package/dist/core/shared/constants.d.ts +8 -0
  535. package/dist/core/shared/constants.js +11 -2
  536. package/dist/core/shared/constants.js.map +1 -1
  537. package/dist/core/shared/text-normalization.js +4 -3
  538. package/dist/core/shared/text-normalization.js.map +1 -1
  539. package/dist/core/shared/time.d.ts +13 -0
  540. package/dist/core/shared/time.js +19 -7
  541. package/dist/core/shared/time.js.map +1 -1
  542. package/dist/core/store/item-store.d.ts +11 -0
  543. package/dist/core/store/item-store.js +12 -3
  544. package/dist/core/store/item-store.js.map +1 -1
  545. package/dist/core/store/settings-validator.d.ts +2 -0
  546. package/dist/core/store/settings-validator.js +25 -2
  547. package/dist/core/store/settings-validator.js.map +1 -1
  548. package/dist/core/store/settings.d.ts +60 -1
  549. package/dist/core/store/settings.js +100 -46
  550. package/dist/core/store/settings.js.map +1 -1
  551. package/dist/core/telemetry/observability.js +10 -8
  552. package/dist/core/telemetry/observability.js.map +1 -1
  553. package/dist/core/telemetry/runtime.d.ts +272 -1
  554. package/dist/core/telemetry/runtime.js +358 -37
  555. package/dist/core/telemetry/runtime.js.map +1 -1
  556. package/dist/core/test/background-runs.d.ts +35 -0
  557. package/dist/core/test/background-runs.js +72 -61
  558. package/dist/core/test/background-runs.js.map +1 -1
  559. package/dist/core/test/run-selectors.js +5 -4
  560. package/dist/core/test/run-selectors.js.map +1 -1
  561. package/dist/core/validate/estimate-defaults.d.ts +39 -0
  562. package/dist/core/validate/estimate-defaults.js +117 -0
  563. package/dist/core/validate/estimate-defaults.js.map +1 -0
  564. package/dist/core/validate/fix-planning.d.ts +21 -3
  565. package/dist/core/validate/fix-planning.js +31 -4
  566. package/dist/core/validate/fix-planning.js.map +1 -1
  567. package/dist/core/validate/missing-link-owners.d.ts +64 -0
  568. package/dist/core/validate/missing-link-owners.js +98 -0
  569. package/dist/core/validate/missing-link-owners.js.map +1 -0
  570. package/dist/mcp/server.d.ts +61 -0
  571. package/dist/mcp/server.js +50 -7
  572. package/dist/mcp/server.js.map +1 -1
  573. package/dist/mcp/tool-definitions.js +17 -4
  574. package/dist/mcp/tool-definitions.js.map +1 -1
  575. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  576. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  577. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  578. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  579. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  580. package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
  581. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  582. package/dist/sdk/cli-contracts/tool-parameter-tables.js +83 -8
  583. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  584. package/dist/sdk/cli-contracts.d.ts +28 -0
  585. package/dist/sdk/cli-contracts.js +164 -11
  586. package/dist/sdk/cli-contracts.js.map +1 -1
  587. package/dist/types.d.ts +17 -1
  588. package/dist/types.js +3 -3
  589. package/dist/types.js.map +1 -1
  590. package/docs/AGENT_GUIDE.md +15 -3
  591. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  592. package/docs/COMMANDS.md +136 -7
  593. package/docs/CONFIGURATION.md +52 -0
  594. package/docs/TESTING.md +6 -4
  595. package/package.json +6 -4
  596. package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
  597. package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
  598. package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
  599. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  600. package/plugins/pm-claude/README.md +3 -3
  601. package/plugins/pm-claude/commands/pm-init.md +1 -1
  602. package/plugins/pm-codex/README.md +1 -1
  603. package/scripts/bundle-cli.mjs +46 -37
  604. package/scripts/finalize-build.mjs +20 -9
  605. package/scripts/prepare-build-cache.mjs +27 -16
  606. package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
  607. package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
  608. package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
  609. package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
  610. package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
  611. package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
  612. package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
  613. package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
  614. package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
  615. package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
  616. package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
  617. package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
  618. package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
  619. package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
  620. package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
  621. package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
  622. package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
  623. package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
  624. package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
  625. package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
  626. package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
  627. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
  628. package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
  629. package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
  630. package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
  631. package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
  632. package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
  633. package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
  634. package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
  635. package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
  636. package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
  637. package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
  638. package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
  639. package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
  640. package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
  641. package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
  642. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
  643. package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
  644. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
  645. package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
  646. package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
  647. package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
  648. package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
  649. package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
  650. package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
  651. package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
  652. package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
  653. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
  654. package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
  655. package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
  656. package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
  657. package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
  658. package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
  659. package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
  660. package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
  661. package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
  662. package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
  663. package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
  664. package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
  665. package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
  666. package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
  667. package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
  668. package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
  669. package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
  670. package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
  671. package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
  672. package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
  673. package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
  674. package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
  675. package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
  676. package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
  677. package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
  678. package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
  679. package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
  680. package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
  681. package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
  682. package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
  683. package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
  684. package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
  685. package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
  686. package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
  687. package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
  688. package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
  689. package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
  690. package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
  691. package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
  692. package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
  693. package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
  694. package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
  695. package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
  696. package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
  697. package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
  698. package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
  699. package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
  700. package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
  701. package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
  702. package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
  703. package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
  704. package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
  705. package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
  706. package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
  707. package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
  708. package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
  709. package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
  710. package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
  711. package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
  712. package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
  713. package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
  714. package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
  715. package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
  716. package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
  717. package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
  718. package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
  719. package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
  720. package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
  721. package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
  722. package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
  723. /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-5P2KQCTH.js.map} +0 -0
  724. /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-MJGTX4LO.js.map} +0 -0
  725. /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-2JEGCDYT.js.map} +0 -0
  726. /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-3WAULYOY.js.map} +0 -0
  727. /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-7AGIXLNK.js.map} +0 -0
  728. /package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js.map → chunk-AERT7KT3.js.map} +0 -0
  729. /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-E6J2PEK6.js.map} +0 -0
  730. /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-F2GC6L3N.js.map} +0 -0
  731. /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-M23HXJL3.js.map} +0 -0
  732. /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-MJZUZ2QE.js.map} +0 -0
  733. /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-O46LTCXQ.js.map} +0 -0
  734. /package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js.map → chunk-OLTYNVJR.js.map} +0 -0
  735. /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-T5VU7ROQ.js.map} +0 -0
  736. /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-UBMCSJXX.js.map} +0 -0
  737. /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-UUKORJSN.js.map} +0 -0
  738. /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-WZCQVABQ.js.map} +0 -0
  739. /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-YGRPBFMA.js.map} +0 -0
  740. /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-ZJRDVYZI.js.map} +0 -0
  741. /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-4APLUXJW.js.map} +0 -0
  742. /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-NEO7AGWH.js.map} +0 -0
  743. /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-3QABBNGU.js.map} +0 -0
  744. /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-ILMZR3D7.js.map} +0 -0
  745. /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q64T5FD4.js.map} +0 -0
  746. /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SG34LCMU.js.map} +0 -0
  747. /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-F5HZX2S4.js.map} +0 -0
  748. /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-IPAX2SNL.js.map} +0 -0
  749. /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-TLXR7LJ2.js.map} +0 -0
  750. /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-VH3L7DZ6.js.map} +0 -0
  751. /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-GWDEB7JH.js.map} +0 -0
  752. /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-RCLNSKID.js.map} +0 -0
  753. /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-5RN65LHT.js.map} +0 -0
  754. /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-7KO2NX2A.js.map} +0 -0
  755. /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-2FGKYRJ4.js.map} +0 -0
  756. /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-5B6ABL3Z.js.map} +0 -0
  757. /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-QO4JVJJP.js.map} +0 -0
  758. /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-SSXGGTVZ.js.map} +0 -0
  759. /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-VBH44Y7F.js.map} +0 -0
  760. /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-Z4P5MM3G.js.map} +0 -0
  761. /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-7FBQO77A.js.map} +0 -0
  762. /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-K6MSMB37.js.map} +0 -0
  763. /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-7UE44A2R.js.map} +0 -0
  764. /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-UHMA3N2K.js.map} +0 -0
  765. /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-NNVPBBVJ.js.map} +0 -0
  766. /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XXXLQ2XC.js.map} +0 -0
  767. /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-6CZNIIGA.js.map} +0 -0
  768. /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-7GVQ3VMN.js.map} +0 -0
  769. /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-MPGM6SBE.js.map} +0 -0
  770. /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-UN75XW3C.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/history-repair.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport jsonPatch from \"fast-json-patch\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport {\n checkHistoryRewriteOwnership,\n verifyHistoryRewriteNoDrift,\n} from \"../../core/history/history-rewrite.js\";\nimport {\n historyEntriesToRaw,\n reanchorHistoryEntries,\n replayHash,\n toReplayDocument,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { scanHistoryDrift } from \"../../core/history/drift-scan.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.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 { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { listAllFrontMatterWithBody, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemMetadata } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\nexport interface HistoryRepairCommandOptions {\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface HistoryRepairResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\n history: {\n path: string;\n entries_scanned: number;\n chain_drift_before: boolean;\n entries_rehashed: number;\n entries_patch_repaired: number;\n converted_replace_to_add: number;\n skipped_ops: number;\n reconciled_with_item: boolean;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n warnings: string[];\n generated_at: string;\n}\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nexport async function runHistoryRepair(\n id: string,\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to repair.`, EXIT_CODE.USAGE);\n }\n\n const chainBefore = verifyHistoryChain(historyEntries);\n const reanchor = reanchorHistoryEntries(historyEntries);\n\n // Reconcile the replayed chain with the current on-disk item document so the\n // latest after_hash matches what pm validate/health compute for the item.\n let currentItemReplay: ReplayDocument | null = null;\n const currentItemPath: string | null = subject.located?.itemPath ?? null;\n let matchedChainBefore: boolean | null = null;\n const loadedItem = subject.located\n ? await readLocatedItem(subject.located, { schema: settings.schema })\n : null;\n const currentItemRawBeforeLock = loadedItem?.raw ?? null;\n if (loadedItem) {\n // Use the shared canonical replay form so reconciliation hashing matches the\n // semantics pm validate/health use for the on-disk item (avoids hash divergence).\n currentItemReplay = toReplayDocument(loadedItem.document);\n const lastOriginalAfterHash = historyEntries[historyEntries.length - 1]?.after_hash;\n matchedChainBefore = replayHash(currentItemReplay) === lastOriginalAfterHash;\n }\n\n const finalReplay = reanchor.finalDocument;\n const reconcileNeeded =\n currentItemReplay !== null && replayHash(finalReplay) !== replayHash(currentItemReplay);\n\n const changed = reanchor.entriesRehashed > 0 || reanchor.entriesPatchRepaired > 0 || reconcileNeeded;\n const author = toAuthor(options.author, settings.author_default);\n const dryRun = Boolean(options.dryRun);\n\n const repairMessage =\n typeof options.message === \"string\" && options.message.trim().length > 0\n ? options.message\n : `history-repair re-anchored ${reanchor.entriesRehashed} entr${\n reanchor.entriesRehashed === 1 ? \"y\" : \"ies\"\n }${reanchor.entriesPatchRepaired > 0 ? `, repaired ${reanchor.entriesPatchRepaired} patch(es)` : \"\"}${\n reconcileNeeded ? \", reconciled chain with on-disk item\" : \"\"\n }.`;\n\n const rewrittenEntries: HistoryEntry[] = [...reanchor.entries];\n let auditEntryAdded = false;\n if (changed) {\n if (reconcileNeeded && currentItemReplay) {\n rewrittenEntries.push({\n ts: nowIso(),\n author,\n op: \"history_repair\",\n patch: jsonPatch.compare(finalReplay, currentItemReplay) as HistoryPatchOp[],\n before_hash: replayHash(finalReplay),\n after_hash: replayHash(currentItemReplay),\n message: repairMessage,\n });\n } else {\n rewrittenEntries.push({\n ts: nowIso(),\n author,\n op: \"history_repair\",\n patch: [],\n before_hash: replayHash(finalReplay),\n after_hash: replayHash(finalReplay),\n message: repairMessage,\n });\n }\n auditEntryAdded = true;\n }\n\n const historyVerify = verifyHistoryChain(rewrittenEntries);\n if (!historyVerify.ok) {\n throw new PmCliError(\n `history-repair produced an invalid rewritten chain (${historyVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n const warnings: string[] = [];\n if (!changed) {\n warnings.push(\"history_repair_no_changes\");\n }\n if (reanchor.skippedOps > 0) {\n warnings.push(`history_repair_skipped_unresolvable_ops:${reanchor.skippedOps}`);\n }\n\n if (changed && !dryRun) {\n warnings.push(\n ...checkHistoryRewriteOwnership({\n itemDocument: loadedItem?.document ?? null,\n subjectId: subject.id,\n author,\n force: options.force,\n settings,\n }),\n );\n\n const releaseLock = await acquireLock(\n pmRoot,\n subject.id,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n settings.governance.force_required_for_stale_lock,\n );\n try {\n const { historyRawUnderLock } = await verifyHistoryRewriteNoDrift({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock,\n operation: \"history-repair\",\n });\n try {\n await writeFileAtomic(subject.historyPath, historyEntriesToRaw(rewrittenEntries));\n } catch (error) {\n if (historyRawUnderLock === null) {\n await fs.rm(subject.historyPath, { force: true });\n } else {\n await writeFileAtomic(subject.historyPath, historyRawUnderLock);\n }\n throw error;\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: subject.historyPath,\n scope: \"project\",\n op: \"history_repair:history\",\n })),\n );\n } finally {\n await releaseLock();\n }\n }\n\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n history: {\n path: subject.historyPath,\n entries_scanned: historyEntries.length,\n chain_drift_before: !chainBefore.ok,\n entries_rehashed: reanchor.entriesRehashed,\n entries_patch_repaired: reanchor.entriesPatchRepaired,\n converted_replace_to_add: reanchor.convertedReplaceToAdd,\n skipped_ops: reanchor.skippedOps,\n reconciled_with_item: reconcileNeeded,\n audit_entry_added: auditEntryAdded,\n verify_ok: historyVerify.ok,\n verify_errors: historyVerify.errors,\n },\n item: {\n exists: currentItemPath !== null,\n path: currentItemPath,\n matched_chain_before: matchedChainBefore,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport interface HistoryRepairAllStreamResult {\n id: string;\n outcome: \"repaired\" | \"skipped_clean\" | \"failed\";\n entries_rehashed?: number;\n entries_patch_repaired?: number;\n reconciled_with_item?: boolean;\n error?: string;\n}\n\nexport interface HistoryRepairAllResult {\n all: true;\n dry_run: boolean;\n scanned_streams: number;\n drifted_streams: number;\n /** One compact row per drifted stream (clean streams are summarized by the counts only). */\n streams: HistoryRepairAllStreamResult[];\n totals: { repaired: number; skipped_clean: number; failed: number };\n warnings: string[];\n generated_at: string;\n}\n\n/**\n * Enforce the `pm history-repair` target contract shared by the CLI and MCP\n * surfaces: exactly one of an item `<id>` or `--all` must be provided.\n */\nexport function assertHistoryRepairTarget(id: string | undefined, all: boolean): void {\n if (all && id !== undefined) {\n throw new PmCliError(\n \"history-repair: <id> and --all are mutually exclusive; pass an item id to repair one stream or --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n if (!all && id === undefined) {\n throw new PmCliError(\n \"history-repair: provide an item <id> or pass --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/**\n * Bulk drift repair: scan every item's history stream with the same drift scan\n * `pm health` uses, then run the audited single-stream repair (ownership check,\n * lock, no-drift verification, audit marker) for each drifted stream. One\n * failing stream never aborts the rest; failures are collected per row and the\n * caller decides the exit code from `totals.failed`.\n */\nexport async function runHistoryRepairAll(\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairAllResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const itemReadWarnings: string[] = [];\n const items = await listAllFrontMatterWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n itemReadWarnings,\n settings.schema,\n );\n const drift = await scanHistoryDrift(pmRoot, items as Array<ItemMetadata & { body: string }>);\n\n const streams: HistoryRepairAllStreamResult[] = [];\n const totals = { repaired: 0, skipped_clean: 0, failed: 0 };\n for (const driftedId of drift.driftedItems) {\n try {\n const result = await runHistoryRepair(driftedId, options, global);\n const outcome = result.changed ? \"repaired\" : \"skipped_clean\";\n totals[outcome] += 1;\n streams.push({\n id: driftedId,\n outcome,\n entries_rehashed: result.history.entries_rehashed,\n entries_patch_repaired: result.history.entries_patch_repaired,\n reconciled_with_item: result.history.reconciled_with_item,\n });\n } catch (error) {\n totals.failed += 1;\n streams.push({\n id: driftedId,\n outcome: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n return {\n all: true,\n dry_run: Boolean(options.dryRun),\n scanned_streams: items.length,\n drifted_streams: drift.driftedItems.length,\n streams,\n totals,\n warnings: [...new Set(itemReadWarnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,eAAe;AA8DtB,SAAS,SAAS,WAA+B,eAAqB;AACpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,eAAsB,iBACpB,IACA,SACA,QAAqB;AAErB,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IA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7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../cli/commands/history-repair.ts"],
4
- "sourcesContent": ["import fs from \"node:fs/promises\";\nimport jsonPatch from \"fast-json-patch\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport {\n checkHistoryRewriteOwnership,\n verifyHistoryRewriteNoDrift,\n} from \"../../core/history/history-rewrite.js\";\nimport {\n historyEntriesToRaw,\n reanchorHistoryEntries,\n replayHash,\n toReplayDocument,\n verifyHistoryChain,\n type ReplayDocument,\n} from \"../../core/history/replay.js\";\nimport { scanHistoryDrift } from \"../../core/history/drift-scan.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.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 { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { listAllFrontMatterWithBody, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemMetadata } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\nexport interface HistoryRepairCommandOptions {\n dryRun?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface HistoryRepairResult {\n id: string;\n dry_run: boolean;\n changed: boolean;\n history: {\n path: string;\n entries_scanned: number;\n chain_drift_before: boolean;\n entries_rehashed: number;\n entries_patch_repaired: number;\n converted_replace_to_add: number;\n skipped_ops: number;\n reconciled_with_item: boolean;\n audit_entry_added: boolean;\n verify_ok: boolean;\n verify_errors: string[];\n };\n item: {\n exists: boolean;\n path: string | null;\n matched_chain_before: boolean | null;\n };\n warnings: string[];\n generated_at: string;\n}\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nexport async function runHistoryRepair(\n id: string,\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const subject = await resolveHistorySubject(pmRoot, id, settings, typeRegistry.type_to_folder);\n\n if (!(await pathExists(subject.historyPath))) {\n throw new PmCliError(`No history stream exists for ${subject.id}.`, EXIT_CODE.NOT_FOUND);\n }\n const historyRawBeforeLock = await readFileIfExists(subject.historyPath);\n const historyEntries = await readHistoryEntries(subject.historyPath, subject.id);\n if (historyEntries.length === 0) {\n throw new PmCliError(`No history entries exist for ${subject.id}; nothing to repair.`, EXIT_CODE.USAGE);\n }\n\n const chainBefore = verifyHistoryChain(historyEntries);\n const reanchor = reanchorHistoryEntries(historyEntries);\n\n // Reconcile the replayed chain with the current on-disk item document so the\n // latest after_hash matches what pm validate/health compute for the item.\n let currentItemReplay: ReplayDocument | null = null;\n const currentItemPath: string | null = subject.located?.itemPath ?? null;\n let matchedChainBefore: boolean | null = null;\n const loadedItem = subject.located\n ? await readLocatedItem(subject.located, { schema: settings.schema })\n : null;\n const currentItemRawBeforeLock = loadedItem?.raw ?? null;\n if (loadedItem) {\n // Use the shared canonical replay form so reconciliation hashing matches the\n // semantics pm validate/health use for the on-disk item (avoids hash divergence).\n currentItemReplay = toReplayDocument(loadedItem.document);\n const lastOriginalAfterHash = historyEntries[historyEntries.length - 1]?.after_hash;\n matchedChainBefore = replayHash(currentItemReplay) === lastOriginalAfterHash;\n }\n\n const finalReplay = reanchor.finalDocument;\n const reconcileNeeded =\n currentItemReplay !== null && replayHash(finalReplay) !== replayHash(currentItemReplay);\n\n const changed = reanchor.entriesRehashed > 0 || reanchor.entriesPatchRepaired > 0 || reconcileNeeded;\n const author = toAuthor(options.author, settings.author_default);\n const dryRun = Boolean(options.dryRun);\n\n const repairMessage =\n typeof options.message === \"string\" && options.message.trim().length > 0\n ? options.message\n : `history-repair re-anchored ${reanchor.entriesRehashed} entr${\n reanchor.entriesRehashed === 1 ? \"y\" : \"ies\"\n }${reanchor.entriesPatchRepaired > 0 ? `, repaired ${reanchor.entriesPatchRepaired} patch(es)` : \"\"}${\n reconcileNeeded ? \", reconciled chain with on-disk item\" : \"\"\n }.`;\n\n const rewrittenEntries: HistoryEntry[] = [...reanchor.entries];\n let auditEntryAdded = false;\n if (changed) {\n if (reconcileNeeded && currentItemReplay) {\n rewrittenEntries.push({\n ts: nowIso(),\n author,\n op: \"history_repair\",\n patch: jsonPatch.compare(finalReplay, currentItemReplay) as HistoryPatchOp[],\n before_hash: replayHash(finalReplay),\n after_hash: replayHash(currentItemReplay),\n message: repairMessage,\n });\n } else {\n rewrittenEntries.push({\n ts: nowIso(),\n author,\n op: \"history_repair\",\n patch: [],\n before_hash: replayHash(finalReplay),\n after_hash: replayHash(finalReplay),\n message: repairMessage,\n });\n }\n auditEntryAdded = true;\n }\n\n const historyVerify = verifyHistoryChain(rewrittenEntries);\n if (!historyVerify.ok) {\n throw new PmCliError(\n `history-repair produced an invalid rewritten chain (${historyVerify.errors.join(\", \")}).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n\n const warnings: string[] = [];\n if (!changed) {\n warnings.push(\"history_repair_no_changes\");\n }\n if (reanchor.skippedOps > 0) {\n warnings.push(`history_repair_skipped_unresolvable_ops:${reanchor.skippedOps}`);\n }\n\n if (changed && !dryRun) {\n warnings.push(\n ...checkHistoryRewriteOwnership({\n itemDocument: loadedItem?.document ?? null,\n subjectId: subject.id,\n author,\n force: options.force,\n settings,\n }),\n );\n\n const releaseLock = await acquireLock(\n pmRoot,\n subject.id,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n settings.governance.force_required_for_stale_lock,\n );\n try {\n const { historyRawUnderLock } = await verifyHistoryRewriteNoDrift({\n pmRoot,\n subject,\n settings,\n typeRegistry,\n historyRawBeforeLock,\n currentItemRawBeforeLock,\n operation: \"history-repair\",\n });\n try {\n await writeFileAtomic(subject.historyPath, historyEntriesToRaw(rewrittenEntries));\n } catch (error) {\n if (historyRawUnderLock === null) {\n await fs.rm(subject.historyPath, { force: true });\n } else {\n await writeFileAtomic(subject.historyPath, historyRawUnderLock);\n }\n throw error;\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: subject.historyPath,\n scope: \"project\",\n op: \"history_repair:history\",\n })),\n );\n } finally {\n await releaseLock();\n }\n }\n\n return {\n id: subject.id,\n dry_run: dryRun,\n changed,\n history: {\n path: subject.historyPath,\n entries_scanned: historyEntries.length,\n chain_drift_before: !chainBefore.ok,\n entries_rehashed: reanchor.entriesRehashed,\n entries_patch_repaired: reanchor.entriesPatchRepaired,\n converted_replace_to_add: reanchor.convertedReplaceToAdd,\n skipped_ops: reanchor.skippedOps,\n reconciled_with_item: reconcileNeeded,\n audit_entry_added: auditEntryAdded,\n verify_ok: historyVerify.ok,\n verify_errors: historyVerify.errors,\n },\n item: {\n exists: currentItemPath !== null,\n path: currentItemPath,\n matched_chain_before: matchedChainBefore,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport interface HistoryRepairAllStreamResult {\n id: string;\n outcome: \"repaired\" | \"skipped_clean\" | \"failed\";\n entries_rehashed?: number;\n entries_patch_repaired?: number;\n reconciled_with_item?: boolean;\n error?: string;\n}\n\nexport interface HistoryRepairAllResult {\n all: true;\n dry_run: boolean;\n scanned_streams: number;\n drifted_streams: number;\n /** One compact row per drifted stream (clean streams are summarized by the counts only). */\n streams: HistoryRepairAllStreamResult[];\n totals: { repaired: number; skipped_clean: number; failed: number };\n warnings: string[];\n generated_at: string;\n}\n\n/**\n * Enforce the `pm history-repair` target contract shared by the CLI and MCP\n * surfaces: exactly one of an item `<id>` or `--all` must be provided.\n */\nexport function assertHistoryRepairTarget(id: string | undefined, all: boolean): void {\n if (all && id !== undefined) {\n throw new PmCliError(\n \"history-repair: <id> and --all are mutually exclusive; pass an item id to repair one stream or --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n if (!all && id === undefined) {\n throw new PmCliError(\n \"history-repair: provide an item <id> or pass --all to repair every drifted stream.\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/**\n * Bulk drift repair: scan every item's history stream with the same drift scan\n * `pm health` uses, then run the audited single-stream repair (ownership check,\n * lock, no-drift verification, audit marker) for each drifted stream. One\n * failing stream never aborts the rest; failures are collected per row and the\n * caller decides the exit code from `totals.failed`.\n */\nexport async function runHistoryRepairAll(\n options: HistoryRepairCommandOptions,\n global: GlobalOptions,\n): Promise<HistoryRepairAllResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const itemReadWarnings: string[] = [];\n const items = await listAllFrontMatterWithBody(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n itemReadWarnings,\n settings.schema,\n );\n const drift = await scanHistoryDrift(pmRoot, items as Array<ItemMetadata & { body: string }>);\n\n const streams: HistoryRepairAllStreamResult[] = [];\n const totals = { repaired: 0, skipped_clean: 0, failed: 0 };\n for (const driftedId of drift.driftedItems) {\n try {\n const result = await runHistoryRepair(driftedId, options, global);\n const outcome = result.changed ? \"repaired\" : \"skipped_clean\";\n totals[outcome] += 1;\n streams.push({\n id: driftedId,\n outcome,\n entries_rehashed: result.history.entries_rehashed,\n entries_patch_repaired: result.history.entries_patch_repaired,\n reconciled_with_item: result.history.reconciled_with_item,\n });\n } catch (error) {\n totals.failed += 1;\n streams.push({\n id: driftedId,\n outcome: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n return {\n all: true,\n dry_run: Boolean(options.dryRun),\n scanned_streams: items.length,\n drifted_streams: drift.driftedItems.length,\n streams,\n totals,\n warnings: [...new Set(itemReadWarnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,eAAe;;;;;;;;AA8DtB,SAAS,SAAS,WAA+B,eAAqB;AACpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,eAAsB,iBACpB,IACA,SACAA,SAAqB;AAErB,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAIA,QAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AAEA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,eAAe,wBAAwB,UAAU,gCAA+B,CAAE;AACxF,QAAM,UAAU,MAAM,sBAAsB,QAAQ,IAAI,UAAU,aAAa,cAAc;AAE7F,MAAI,CAAE,MAAM,WAAW,QAAQ,WAAW,GAAI;AAC5C,UAAM,IAAI,WAAW,gCAAgC,QAAQ,EAAE,KAAK,UAAU,SAAS;EACzF;AACA,QAAM,uBAAuB,MAAM,iBAAiB,QAAQ,WAAW;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AM,UAA0C,CAAA;AAChD,QAAM,SAAS,EAAE,UAAU,GAAG,eAAe,GAAG,QAAQ,EAAC;AACzD,aAAW,aAAa,MAAM,cAAc;AAC1C,QAAI;AACF,YAAM,SAAS,MAAM,iBAAiB,WAAW,SAASA,OAAM;AAChE,YAAM,UAAU,OAAO,UAAU,aAAa;AAC9C,aAAO,OAAO,KAAK;AACnB,cAAQ,KAAK;QACX,IAAI;QACJ;QACA,kBAAkB,OAAO,QAAQ;QACjC,wBAAwB,OAAO,QAAQ;QACvC,sBAAsB,OAAO,QAAQ;OACtC;IACH,SAAS,OAAO;AACd,aAAO,UAAU;AACjB,cAAQ,KAAK;QACX,IAAI;QACJ,SAAS;QACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;OAC7D;IACH;EACF;AAEA,SAAO;IACL,KAAK;IACL,SAAS,QAAQ,QAAQ,MAAM;IAC/B,iBAAiB,MAAM;IACvB,iBAAiB,MAAM,aAAa;IACpC;IACA;IACA,UAAU,CAAC,GAAG,IAAI,IAAI,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;IACxF,cAAc,OAAM;;AAExB;",
6
- "names": ["global"]
7
- }
@@ -1,17 +0,0 @@
1
- import {
2
- runInit,
3
- summarizeInitResult
4
- } from "./chunk-WLH7X4RN.js";
5
- import "./chunk-UCVJP4JL.js";
6
- import "./chunk-SQDKAEKG.js";
7
- import "./chunk-5LMF75Q7.js";
8
- import "./chunk-3HUE7XOF.js";
9
- import "./chunk-LGOXXQUW.js";
10
- import "./chunk-W6KNFAMZ.js";
11
- import "./chunk-IXVSSHGV.js";
12
- import "./chunk-LFW5NQUP.js";
13
- export {
14
- runInit,
15
- summarizeInitResult
16
- };
17
- //# sourceMappingURL=init-JJFYRUKG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/learnings.ts"],"sourcesContent":["import type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\nexport interface LearningsCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditLearning?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\nexport interface LearningsResult {\n id: string;\n learnings: LogNote[];\n count: number;\n}\n\nexport async function runLearnings(\n id: string,\n options: LearningsCommandOptions,\n global: GlobalOptions,\n): Promise<LearningsResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"learnings\", LogNote>(id, options, global, {\n input: options.add === undefined ? { mode: \"list\" } : { mode: \"add\", value: addInput ?? \"\", emptyFlag: \"--add\" },\n collectionKey: \"learnings\",\n op: \"learning_add\",\n parseText: (raw) => parseAnnotationTextInput(raw),\n allowAuditBypass: Boolean(options.allowAuditLearning || options.allowAuditComment),\n conflictGuidance: {\n required:\n \"For append-only learning audits on another owner's item, prefer --allow-audit-learning (legacy alias: --allow-audit-comment) before considering --force.\",\n examples: ['pm learnings pm-a1b2 --add \"audit learning\" --author \"reviewer\" --allow-audit-learning'],\n nextSteps: [\n \"Retry with --allow-audit-learning (or legacy --allow-audit-comment) for append-only learning audits that do not mutate item metadata beyond learnings.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,eAAsB,aACpB,IACA,SACA,QAAqB;AAErB,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAA2C,IAAI,SAAS,QAAQ;IACrE,OAAO,QAAQ,QAAQ,SAAY,EAAE,MAAM,OAAM,IAAK,EAAE,MAAM,OAAO,OAAO,YAAY,IAAI,WAAW,QAAO;IAC9G,eAAe;IACf,IAAI;IACJ,WAAW,CAAC,QAAQ,yBAAyB,GAAG;IAChD,kBAAkB,QAAQ,QAAQ,sBAAsB,QAAQ,iBAAiB;IACjF,kBAAkB;MAChB,UACE;MACF,UAAU,CAAC,wFAAwF;MACnG,WAAW;QACT;QACA;;;GAGL;AACH","debugId":"ba6067a5-4bff-5ab2-ae61-451511221c4d"}
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../cli/commands/learnings.ts"],
4
- "sourcesContent": ["import type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\nexport interface LearningsCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditLearning?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\nexport interface LearningsResult {\n id: string;\n learnings: LogNote[];\n count: number;\n}\n\nexport async function runLearnings(\n id: string,\n options: LearningsCommandOptions,\n global: GlobalOptions,\n): Promise<LearningsResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"learnings\", LogNote>(id, options, global, {\n input: options.add === undefined ? { mode: \"list\" } : { mode: \"add\", value: addInput ?? \"\", emptyFlag: \"--add\" },\n collectionKey: \"learnings\",\n op: \"learning_add\",\n parseText: (raw) => parseAnnotationTextInput(raw),\n allowAuditBypass: Boolean(options.allowAuditLearning || options.allowAuditComment),\n conflictGuidance: {\n required:\n \"For append-only learning audits on another owner's item, prefer --allow-audit-learning (legacy alias: --allow-audit-comment) before considering --force.\",\n examples: ['pm learnings pm-a1b2 --add \"audit learning\" --author \"reviewer\" --allow-audit-learning'],\n nextSteps: [\n \"Retry with --allow-audit-learning (or legacy --allow-audit-comment) for append-only learning audits that do not mutate item metadata beyond learnings.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,eAAsB,aACpB,IACA,SACAA,SAAqB;AAErB,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAA2C,IAAI,SAASA,SAAQ;IACrE,OAAO,QAAQ,QAAQ,SAAY,EAAE,MAAM,OAAM,IAAK,EAAE,MAAM,OAAO,OAAO,YAAY,IAAI,WAAW,QAAO;IAC9G,eAAe;IACf,IAAI;IACJ,WAAW,CAAC,QAAQ,yBAAyB,GAAG;IAChD,kBAAkB,QAAQ,QAAQ,sBAAsB,QAAQ,iBAAiB;IACjF,kBAAkB;MAChB,UACE;MACF,UAAU,CAAC,wFAAwF;MACnG,WAAW;QACT;QACA;;;GAGL;AACH;",
6
- "names": ["global"]
7
- }
@@ -1,23 +0,0 @@
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]="45eac7fa-f181-5cca-93b7-cfb58909dbb3")}catch(e){}}();
3
- import {
4
- LIST_SORT_FIELDS,
5
- LIST_SORT_ORDER_VALUES,
6
- runList
7
- } from "./chunk-LYNQ3NGI.js";
8
- import "./chunk-V4KP3TCN.js";
9
- import "./chunk-NN6RKGFW.js";
10
- import "./chunk-L6YQONLM.js";
11
- import "./chunk-6ZFTM65G.js";
12
- import "./chunk-QQG4HEX7.js";
13
- import "./chunk-32XSW44C.js";
14
- import "./chunk-IZHCCG4S.js";
15
- import "./chunk-S2CDTRJ6.js";
16
- export {
17
- LIST_SORT_FIELDS,
18
- LIST_SORT_ORDER_VALUES,
19
- runList
20
- };
21
- //# sourceMappingURL=list-GGVPXEV6.js.map
22
-
23
- //# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
@@ -1,19 +0,0 @@
1
- import {
2
- LIST_SORT_FIELDS,
3
- LIST_SORT_ORDER_VALUES,
4
- runList
5
- } from "./chunk-M3SI2REU.js";
6
- import "./chunk-C24PWDFG.js";
7
- import "./chunk-VYZNX4C5.js";
8
- import "./chunk-XXLMJDUB.js";
9
- import "./chunk-LGOXXQUW.js";
10
- import "./chunk-MACCNKSZ.js";
11
- import "./chunk-W6KNFAMZ.js";
12
- import "./chunk-IXVSSHGV.js";
13
- import "./chunk-LFW5NQUP.js";
14
- export {
15
- LIST_SORT_FIELDS,
16
- LIST_SORT_ORDER_VALUES,
17
- runList
18
- };
19
- //# sourceMappingURL=list-VOQDQHA4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/notes.ts"],"sourcesContent":["import type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\nexport interface NotesCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditNote?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\nexport interface NotesResult {\n id: string;\n notes: LogNote[];\n count: number;\n}\n\nexport async function runNotes(id: string, options: NotesCommandOptions, global: GlobalOptions): Promise<NotesResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"notes\", LogNote>(id, options, global, {\n input: options.add === undefined ? { mode: \"list\" } : { mode: \"add\", value: addInput ?? \"\", emptyFlag: \"--add\" },\n collectionKey: \"notes\",\n op: \"note_add\",\n parseText: (raw) => parseAnnotationTextInput(raw),\n allowAuditBypass: Boolean(options.allowAuditNote || options.allowAuditComment),\n conflictGuidance: {\n required:\n \"For append-only note audits on another owner's item, prefer --allow-audit-note (legacy alias: --allow-audit-comment) before considering --force.\",\n examples: ['pm notes pm-a1b2 --add \"audit note\" --author \"reviewer\" --allow-audit-note'],\n nextSteps: [\n \"Retry with --allow-audit-note (or legacy --allow-audit-comment) for append-only note audits that do not mutate item metadata beyond notes.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,eAAsB,SAAS,IAAY,SAA8B,QAAqB;AAC5F,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAAuC,IAAI,SAAS,QAAQ;IACjE,OAAO,QAAQ,QAAQ,SAAY,EAAE,MAAM,OAAM,IAAK,EAAE,MAAM,OAAO,OAAO,YAAY,IAAI,WAAW,QAAO;IAC9G,eAAe;IACf,IAAI;IACJ,WAAW,CAAC,QAAQ,yBAAyB,GAAG;IAChD,kBAAkB,QAAQ,QAAQ,kBAAkB,QAAQ,iBAAiB;IAC7E,kBAAkB;MAChB,UACE;MACF,UAAU,CAAC,4EAA4E;MACvF,WAAW;QACT;QACA;;;GAGL;AACH","debugId":"110ed0ca-0531-5471-a668-b58dfbd092cd"}
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../cli/commands/notes.ts"],
4
- "sourcesContent": ["import type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\nexport interface NotesCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditNote?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\nexport interface NotesResult {\n id: string;\n notes: LogNote[];\n count: number;\n}\n\nexport async function runNotes(id: string, options: NotesCommandOptions, global: GlobalOptions): Promise<NotesResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"notes\", LogNote>(id, options, global, {\n input: options.add === undefined ? { mode: \"list\" } : { mode: \"add\", value: addInput ?? \"\", emptyFlag: \"--add\" },\n collectionKey: \"notes\",\n op: \"note_add\",\n parseText: (raw) => parseAnnotationTextInput(raw),\n allowAuditBypass: Boolean(options.allowAuditNote || options.allowAuditComment),\n conflictGuidance: {\n required:\n \"For append-only note audits on another owner's item, prefer --allow-audit-note (legacy alias: --allow-audit-comment) before considering --force.\",\n examples: ['pm notes pm-a1b2 --add \"audit note\" --author \"reviewer\" --allow-audit-note'],\n nextSteps: [\n \"Retry with --allow-audit-note (or legacy --allow-audit-comment) for append-only note audits that do not mutate item metadata beyond notes.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,eAAsB,SAAS,IAAY,SAA8BA,SAAqB;AAC5F,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAAuC,IAAI,SAASA,SAAQ;IACjE,OAAO,QAAQ,QAAQ,SAAY,EAAE,MAAM,OAAM,IAAK,EAAE,MAAM,OAAO,OAAO,YAAY,IAAI,WAAW,QAAO;IAC9G,eAAe;IACf,IAAI;IACJ,WAAW,CAAC,QAAQ,yBAAyB,GAAG;IAChD,kBAAkB,QAAQ,QAAQ,kBAAkB,QAAQ,iBAAiB;IAC7E,kBAAkB;MAChB,UACE;MACF,UAAU,CAAC,4EAA4E;MACvF,WAAW;QACT;QACA;;;GAGL;AACH;",
6
- "names": ["global"]
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/plan.ts"],"sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry, resolveTypeName } from \"../../core/item/type-registry.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 { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { nowIso } from \"../../core/shared/time.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 type {\n DependencyKind,\n ItemDocument,\n ItemMetadata,\n PlanDecision,\n PlanDiscovery,\n PlanHarness,\n PlanMode,\n PlanStep,\n PlanStepDoc,\n PlanStepFile,\n PlanStepLink,\n PlanStepLinkKind,\n PlanStepStatus,\n PlanStepTest,\n PlanValidationCheck,\n} from \"../../types/index.js\";\nimport {\n PLAN_HARNESS_VALUES,\n PLAN_MODE_VALUES,\n PLAN_STEP_LINK_KIND_VALUES,\n PLAN_STEP_STATUS_VALUES,\n} from \"../../types/index.js\";\nimport { runCreate, type CreateCommandOptions, type CreateResult } from \"./create.js\";\n\nexport const PLAN_SUBCOMMANDS = [\n \"create\",\n \"show\",\n \"add-step\",\n \"update-step\",\n \"complete-step\",\n \"block-step\",\n \"reorder-step\",\n \"remove-step\",\n \"link\",\n \"unlink\",\n \"decision\",\n \"discovery\",\n \"validation\",\n \"resume\",\n \"approve\",\n \"materialize\",\n] as const;\nexport type PlanSubcommand = (typeof PLAN_SUBCOMMANDS)[number];\n\nexport const PLAN_SHOW_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type PlanShowDepth = (typeof PLAN_SHOW_DEPTH_VALUES)[number];\n\nexport interface PlanCommandOptions {\n title?: string;\n description?: string;\n scope?: string;\n parent?: string;\n related?: string | string[];\n blocks?: string | string[];\n blockedBy?: string | string[];\n harness?: string;\n mode?: string;\n resumeContext?: string;\n tags?: string;\n priority?: string;\n body?: string;\n claim?: boolean;\n fromSearch?: string;\n stepTitle?: string;\n /**\n * pm-6mit: repeatable --step values. On create each value seeds one ordered\n * step (argv order; values are never comma-split so titles may contain\n * commas). On other subcommands a single value aliases stepTitle.\n */\n step?: string | string[];\n stepBody?: string;\n stepOwner?: string;\n stepStatus?: string;\n stepEvidence?: string;\n stepBlockedReason?: string;\n stepReplacement?: string;\n dependsOn?: string | string[];\n link?: string | string[];\n linkKind?: string;\n linkNote?: string;\n promoteToItemDep?: boolean;\n allowMultipleActive?: boolean;\n file?: string | string[];\n test?: string | string[];\n doc?: string | string[];\n decisionText?: string;\n decision?: string;\n decisionRationale?: string;\n decisionEvidence?: string;\n discoveryText?: string;\n discovery?: string;\n validationText?: string;\n validation?: string;\n validationCommand?: string;\n validationExpected?: string;\n depth?: string;\n fields?: string;\n steps?: string;\n materializeType?: string;\n materializeParent?: string;\n materializeTags?: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface PlanCommandResult {\n action: PlanSubcommand;\n plan: PlanResultPlan;\n step?: PlanStep;\n current_step?: PlanStep | undefined;\n next_actions?: string[];\n materialized?: { id: string; type: string; from_step: string }[];\n // pm-fl0c #10 (2026-05-28): steps that pm plan materialize intentionally\n // skipped (already-completed or already-materialized via an `implements`\n // link). Surfacing these makes `--steps all` idempotent without users\n // having to read history to find out what was done.\n materialize_skipped?: { from_step: string; reason: \"already_completed\" | \"already_materialized\"; existing_id?: string }[];\n warnings: string[];\n generated_at: string;\n}\n\nexport interface PlanResultPlan {\n id: string;\n title: string;\n status: string;\n mode: PlanMode;\n scope?: string;\n harness?: PlanHarness;\n parent?: string;\n resume_context?: string;\n steps_summary: PlanStepSummary;\n current_step?: { id: string; order: number; title: string; status: PlanStepStatus } | undefined;\n blocked_steps?: { id: string; order: number; title: string; blocked_reason?: string }[];\n steps?: PlanStep[];\n decisions?: PlanDecision[];\n discoveries?: PlanDiscovery[];\n validation?: PlanValidationCheck[];\n linked_items?: { id: string; kind: DependencyKind }[];\n}\n\nexport interface PlanStepSummary {\n total: number;\n pending: number;\n in_progress: number;\n blocked: number;\n completed: number;\n skipped: number;\n superseded: number;\n}\n\nconst STEP_ID_PREFIX = \"plan-step-\";\nconst DEFAULT_PLAN_MODE: PlanMode = \"draft\";\n\nfunction resolveAuthor(candidate: string | undefined, fallback: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? fallback;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\n/**\n * pm-6mit: ordered step titles from repeated --step values. Unlike toArray\n * this NEVER comma-splits — each --step value is one full step title, so\n * titles containing commas survive intact (also why --step must not be\n * list:true in contracts: the bootstrap coalescer would comma-join values).\n */\nfunction toOrderedStepTitles(value: unknown): string[] {\n const values = Array.isArray(value) ? value : value === undefined || value === null ? [] : [value];\n return values\n .filter((entry) => entry !== undefined && entry !== null)\n .map((entry) => (typeof entry === \"string\" ? entry : String(entry)).trim())\n .filter((entry) => entry.length > 0);\n}\n\nfunction toArray(value: string | string[] | undefined): string[] {\n if (Array.isArray(value)) return value.flatMap((entry) => splitCommaList(entry, { unique: false }));\n if (typeof value === \"string\" && value.trim().length > 0) {\n return splitCommaList(value, { unique: false });\n }\n return [];\n}\n\nfunction toSpecArray(value: string | string[] | undefined): string[] {\n if (Array.isArray(value)) return value.map((entry) => entry.trim()).filter(Boolean);\n if (typeof value === \"string\" && value.trim().length > 0) return [value.trim()];\n return [];\n}\n\nfunction asPlanMode(value: string | undefined, fallback: PlanMode = DEFAULT_PLAN_MODE): PlanMode {\n if (value === undefined) return fallback;\n const normalized = value.trim().toLowerCase();\n const found = PLAN_MODE_VALUES.find((entry) => entry === normalized);\n if (!found) {\n throw new PmCliError(\n `Invalid plan mode \"${value}\". Allowed: ${PLAN_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return found;\n}\n\nfunction asStepStatus(value: string | undefined, fallback: PlanStepStatus = \"pending\"): PlanStepStatus {\n if (value === undefined) return fallback;\n const normalized = value.trim().toLowerCase();\n const found = PLAN_STEP_STATUS_VALUES.find((entry) => entry === normalized);\n if (!found) {\n throw new PmCliError(\n `Invalid step status \"${value}\". Allowed: ${PLAN_STEP_STATUS_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return found;\n}\n\nfunction asLinkKind(value: string | undefined, fallback: PlanStepLinkKind = \"related\"): PlanStepLinkKind {\n if (value === undefined) return fallback;\n const normalized = value.trim().toLowerCase();\n const found = PLAN_STEP_LINK_KIND_VALUES.find((entry) => entry === normalized);\n if (!found) {\n throw new PmCliError(\n `Invalid step link kind \"${value}\". Allowed: ${PLAN_STEP_LINK_KIND_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return found;\n}\n\nfunction asHarness(value: string | undefined): PlanHarness | undefined {\n if (value === undefined) return undefined;\n const normalized = value.trim().toLowerCase();\n if (normalized.length === 0) return undefined;\n const found = PLAN_HARNESS_VALUES.find((entry) => entry === normalized);\n if (!found) {\n throw new PmCliError(\n `Invalid plan harness \"${value}\". Allowed: ${PLAN_HARNESS_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return found;\n}\n\nfunction asDepth(value: string | undefined): PlanShowDepth {\n if (value === undefined) return \"brief\";\n const normalized = value.trim().toLowerCase();\n const found = PLAN_SHOW_DEPTH_VALUES.find((entry) => entry === normalized);\n if (!found) {\n throw new PmCliError(\n `Invalid --depth \"${value}\". Allowed: ${PLAN_SHOW_DEPTH_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return found;\n}\n\nfunction parsePlanFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\"Plan --fields requires a comma-separated list of plan field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nconst PLAN_FIELD_KEYS = new Set<keyof PlanResultPlan>([\n \"id\",\n \"title\",\n \"status\",\n \"mode\",\n \"scope\",\n \"harness\",\n \"parent\",\n \"resume_context\",\n \"steps_summary\",\n \"current_step\",\n \"blocked_steps\",\n \"steps\",\n \"decisions\",\n \"discoveries\",\n \"validation\",\n \"linked_items\",\n]);\n\nfunction projectPlanForFields(plan: PlanResultPlan, fields: string[]): PlanResultPlan {\n const source = plan as unknown as Record<string, unknown>;\n const projected: Record<string, unknown> = {};\n const unknownFields: string[] = [];\n for (const field of fields) {\n const normalized = field.startsWith(\"plan.\") ? field.slice(\"plan.\".length) : field;\n if (normalized.length === 0) {\n continue;\n }\n if (!PLAN_FIELD_KEYS.has(normalized as keyof PlanResultPlan)) {\n unknownFields.push(field);\n continue;\n }\n if (Object.prototype.hasOwnProperty.call(source, normalized)) {\n projected[normalized] = source[normalized];\n }\n }\n if (unknownFields.length > 0) {\n throw new PmCliError(`Unknown Plan --fields value(s): ${unknownFields.join(\", \")}`, EXIT_CODE.USAGE, {\n nextSteps: [\n `Use --fields ${[...PLAN_FIELD_KEYS].join(\",\")}`,\n \"Run pm plan show <id> --depth brief for compact default fields.\",\n ],\n recovery: {\n provided_fields: unknownFields,\n suggested_retry: `pm plan show <id> --fields ${[...PLAN_FIELD_KEYS].join(\",\")}`,\n },\n });\n }\n return projected as unknown as PlanResultPlan;\n}\n\nfunction parsePairList(raw: string, label: string): Record<string, string> {\n const out: Record<string, string> = {};\n for (const entry of raw.split(\",\")) {\n const trimmed = entry.trim();\n if (trimmed.length === 0) continue;\n const equalsIndex = trimmed.indexOf(\"=\");\n if (equalsIndex <= 0) {\n throw new PmCliError(`Invalid ${label} entry \"${trimmed}\"; expected key=value`, EXIT_CODE.USAGE);\n }\n out[trimmed.slice(0, equalsIndex).trim().toLowerCase()] = trimmed.slice(equalsIndex + 1).trim();\n }\n return out;\n}\n\nfunction parseStepFile(spec: string): PlanStepFile {\n const fields = parsePairList(spec, \"--file\");\n if (!fields.path) {\n throw new PmCliError(\"--file requires path=<value>\", EXIT_CODE.USAGE);\n }\n const file: PlanStepFile = { path: fields.path };\n if (fields.scope === \"global\" || fields.scope === \"project\") file.scope = fields.scope;\n if (fields.note) file.note = fields.note;\n return file;\n}\n\nfunction parseStepTest(spec: string): PlanStepTest {\n const fields = parsePairList(spec, \"--test\");\n if (!fields.command && !fields.path) {\n throw new PmCliError(\"--test requires at least command=<value> or path=<value>\", EXIT_CODE.USAGE);\n }\n const test: PlanStepTest = {};\n if (fields.command) test.command = fields.command;\n if (fields.path) test.path = fields.path;\n if (fields.note) test.note = fields.note;\n return test;\n}\n\nfunction parseStepDoc(spec: string): PlanStepDoc {\n const fields = parsePairList(spec, \"--doc\");\n if (!fields.path) {\n throw new PmCliError(\"--doc requires path=<value>\", EXIT_CODE.USAGE);\n }\n const doc: PlanStepDoc = { path: fields.path };\n if (fields.scope === \"global\" || fields.scope === \"project\") doc.scope = fields.scope;\n if (fields.note) doc.note = fields.note;\n return doc;\n}\n\nfunction summarizeSteps(steps: PlanStep[]): PlanStepSummary {\n const summary: PlanStepSummary = {\n total: steps.length,\n pending: 0,\n in_progress: 0,\n blocked: 0,\n completed: 0,\n skipped: 0,\n superseded: 0,\n };\n for (const step of steps) {\n summary[step.status] += 1;\n }\n return summary;\n}\n\nfunction newStepId(existing: PlanStep[]): string {\n const used = new Set(existing.map((step) => step.id));\n for (let cursor = existing.length + 1; cursor < existing.length + 1024; cursor += 1) {\n const candidate = `${STEP_ID_PREFIX}${String(cursor).padStart(3, \"0\")}`;\n if (!used.has(candidate)) return candidate;\n }\n /* c8 ignore next -- step id allocation only fails if 1024 consecutive ids are taken. */\n throw new PmCliError(\"Could not allocate step id (limit reached)\", EXIT_CODE.GENERIC_FAILURE);\n}\n\nfunction resolveStepRef(steps: PlanStep[], ref: string): PlanStep {\n const trimmed = ref.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\"Step reference cannot be empty\", EXIT_CODE.USAGE);\n }\n const direct = steps.find((step) => step.id === trimmed);\n if (direct) return direct;\n if (/^\\d+$/.test(trimmed)) {\n const order = Number.parseInt(trimmed, 10);\n const byOrder = steps.find((step) => step.order === order);\n if (byOrder) return byOrder;\n }\n throw new PmCliError(`Step \"${ref}\" not found in plan`, EXIT_CODE.NOT_FOUND);\n}\n\ninterface MaterializeTargetResolution {\n targets: PlanStep[];\n skipped: { from_step: string; reason: \"already_completed\" | \"already_materialized\"; existing_id?: string }[];\n}\n\n// pm-fl0c #10 (2026-05-28): skip steps whose status is \"completed\" and steps\n// that already have an `implements` link from a prior materialize run, so\n// `pm plan materialize --steps all` is idempotent and never re-creates fresh\n// Tasks for work already tracked. Explicit step refs are still allowed\n// through (the user asked by ID) but the skip-reason is recorded.\nfunction classifyMaterializeSkip(\n step: PlanStep,\n): { reason: \"already_completed\" | \"already_materialized\"; existing_id?: string } | undefined {\n if (step.status === \"completed\") {\n return { reason: \"already_completed\" };\n }\n const existingImplements = (step.linked_items ?? []).find((link) => link.kind === \"implements\");\n if (existingImplements) {\n return { reason: \"already_materialized\", existing_id: existingImplements.id };\n }\n return undefined;\n}\n\nfunction resolveMaterializeTargets(steps: PlanStep[], refs: string[]): MaterializeTargetResolution {\n const allRefs = refs.filter((ref) => ref.trim().toLowerCase() === \"all\");\n const targets: PlanStep[] = [];\n const skipped: { from_step: string; reason: \"already_completed\" | \"already_materialized\"; existing_id?: string }[] = [];\n if (allRefs.length > 0) {\n if (refs.length > allRefs.length) {\n throw new PmCliError(\"pm plan materialize --steps all cannot be combined with other step refs\", EXIT_CODE.USAGE);\n }\n for (const step of steps.slice().sort((left, right) => left.order - right.order)) {\n const skip = classifyMaterializeSkip(step);\n if (skip) {\n skipped.push({ from_step: step.id, ...skip });\n continue;\n }\n targets.push(step);\n }\n return { targets, skipped };\n }\n const seen = new Set<string>();\n for (const ref of refs) {\n const step = resolveStepRef(steps, ref);\n if (seen.has(step.id)) continue;\n seen.add(step.id);\n const skip = classifyMaterializeSkip(step);\n if (skip) {\n skipped.push({ from_step: step.id, ...skip });\n continue;\n }\n targets.push(step);\n }\n return { targets, skipped };\n}\n\nfunction resolvePlanLogText(kind: \"decision\" | \"discovery\" | \"validation\", options: PlanCommandOptions): string | undefined {\n const canonical =\n kind === \"decision\"\n ? options.decisionText\n : kind === \"discovery\"\n ? options.discoveryText\n : options.validationText;\n const shorthand =\n kind === \"decision\"\n ? options.decision\n : kind === \"discovery\"\n ? options.discovery\n : options.validation;\n return canonical?.trim() || shorthand?.trim() || undefined;\n}\n\nfunction findCurrentStep(steps: PlanStep[]): PlanStep | undefined {\n return steps.find((step) => step.status === \"in_progress\")\n ?? steps.find((step) => step.status === \"pending\");\n}\n\nfunction blockedSteps(steps: PlanStep[]): { id: string; order: number; title: string; blocked_reason?: string }[] {\n return steps\n .filter((step) => step.status === \"blocked\")\n .map((step) => ({ id: step.id, order: step.order, title: step.title, blocked_reason: step.blocked_reason }));\n}\n\nfunction projectPlan(item: ItemMetadata, depth: PlanShowDepth = \"brief\"): PlanResultPlan {\n const steps = (item.plan_steps ?? []).slice().sort((left, right) => left.order - right.order);\n const summary = summarizeSteps(steps);\n const current = findCurrentStep(steps);\n const projection: PlanResultPlan = {\n id: item.id,\n title: item.title,\n status: item.status,\n mode: (item.plan_mode ?? DEFAULT_PLAN_MODE) as PlanMode,\n scope: item.plan_scope,\n harness: item.plan_harness,\n parent: item.parent,\n resume_context: item.plan_resume_context,\n steps_summary: summary,\n current_step: current\n ? { id: current.id, order: current.order, title: current.title, status: current.status }\n : undefined,\n blocked_steps: blockedSteps(steps),\n linked_items: (item.dependencies ?? []).map((dep) => ({ id: dep.id, kind: dep.kind })),\n };\n if (depth === \"standard\" || depth === \"deep\") {\n projection.steps = steps;\n }\n if (depth === \"deep\") {\n projection.decisions = item.plan_decisions ?? [];\n projection.discoveries = item.plan_discoveries ?? [];\n projection.validation = item.plan_validation ?? [];\n }\n return projection;\n}\n\nfunction nextActionsFor(planId: string, plan: PlanResultPlan): string[] {\n const tips: string[] = [];\n if (plan.steps_summary.total === 0) {\n tips.push(`pm plan add-step ${planId} --step-title \"First step\"`);\n }\n if (plan.current_step) {\n tips.push(\n `pm plan update-step ${planId} ${plan.current_step.id} --step-status in_progress`,\n `pm plan complete-step ${planId} ${plan.current_step.id} --step-evidence \"...\"`,\n );\n }\n if (plan.steps_summary.blocked > 0) {\n tips.push(`pm plan show ${planId} --depth standard`);\n }\n if (plan.mode === \"draft\" || plan.mode === \"research\") {\n tips.push(`pm plan approve ${planId} --message \"ready to execute\"`);\n }\n if (plan.steps_summary.completed === plan.steps_summary.total && plan.steps_summary.total > 0) {\n tips.push(`pm close ${planId} \"plan complete\"`);\n }\n return tips;\n}\n\nfunction ensurePlanItem(item: ItemMetadata): void {\n const normalizedType = (item.type ?? \"\").trim().toLowerCase();\n if (normalizedType !== \"plan\") {\n throw new PmCliError(\n `Item ${item.id} is type ${item.type}; pm plan commands require type=Plan. Use pm plan create or pm create --type Plan first.`,\n EXIT_CODE.USAGE,\n {\n code: \"wrong_item_type\",\n required: \"Use pm plan commands only with items whose type is Plan.\",\n why: \"Plan commands read and mutate Plan-specific step, decision, discovery, and validation fields.\",\n examples: [\n `pm get ${item.id} --depth brief`,\n 'pm plan create --title \"Execution plan\" --scope \"<goal>\"',\n ],\n },\n );\n }\n}\n\ninterface PlanWriteContext {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n}\n\nasync function loadContext(global: GlobalOptions): Promise<PlanWriteContext> {\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 return { pmRoot, settings };\n}\n\nasync function readPlanItem(ctx: PlanWriteContext, id: string): Promise<{ document: ItemDocument; itemId: string }> {\n const typeRegistry = resolveItemTypeRegistry(ctx.settings, getActiveExtensionRegistrations());\n const located = await locateItem(ctx.pmRoot, id, ctx.settings.id_prefix, ctx.settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Plan ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: ctx.settings.schema });\n ensurePlanItem(loaded.document.metadata);\n return { document: loaded.document, itemId: located.id };\n}\n\nasync function planCreate(\n options: PlanCommandOptions,\n global: GlobalOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const title = options.title?.trim();\n if (!title) {\n throw new PmCliError(\"pm plan create requires --title\", EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n examples: ['pm plan create --title \"Refactor lock retry\" --scope pm-a1b2'],\n });\n }\n const mode = asPlanMode(options.mode, DEFAULT_PLAN_MODE);\n const harness = asHarness(options.harness);\n const fromSearch = options.fromSearch?.trim();\n\n const related = toArray(options.related);\n const blocks = toArray(options.blocks);\n const blockedBy = toArray(options.blockedBy);\n\n const deps: string[] = [];\n if (options.parent) {\n deps.push(`id=${options.parent.trim()},kind=parent`);\n }\n for (const ref of related) deps.push(`id=${ref},kind=related`);\n for (const ref of blocks) deps.push(`id=${ref},kind=blocks`);\n for (const ref of blockedBy) deps.push(`id=${ref},kind=blocked_by`);\n\n const description = options.description?.trim() ?? options.scope?.trim() ?? title;\n const createOptions: CreateCommandOptions = {\n title,\n description,\n type: \"Plan\",\n body: options.body,\n tags: options.tags,\n priority: options.priority,\n parent: options.parent,\n dep: deps.length > 0 ? deps : undefined,\n author: options.author,\n message: options.message ?? (fromSearch ? `plan create (search: ${fromSearch})` : `plan create`),\n };\n\n const createResult: CreateResult = await runCreate(createOptions, global);\n\n // The create command stores type_options. To use real metadata keys, run a follow-up mutate.\n const seedResult = await mutateItem({\n pmRoot: ctx.pmRoot,\n settings: ctx.settings,\n id: createResult.item.id,\n op: \"plan_create_metadata\",\n author: resolveAuthor(options.author, ctx.settings.author_default),\n message: \"seed plan metadata\",\n mutate(doc) {\n const changed: string[] = [];\n doc.metadata.plan_mode = mode;\n changed.push(\"plan_mode\");\n if (harness) {\n doc.metadata.plan_harness = harness;\n changed.push(\"plan_harness\");\n }\n if (options.scope?.trim()) {\n doc.metadata.plan_scope = options.scope.trim();\n changed.push(\"plan_scope\");\n }\n if (options.resumeContext?.trim()) {\n doc.metadata.plan_resume_context = options.resumeContext.trim();\n changed.push(\"plan_resume_context\");\n }\n doc.metadata.plan_steps = doc.metadata.plan_steps ?? [];\n return { changedFields: changed };\n },\n });\n\n let finalMetadata: ItemMetadata = seedResult.item as unknown as ItemMetadata;\n let initialStep: PlanStep | undefined;\n const initialValidationText = options.validationText?.trim();\n const initialValidationCommand = options.validationCommand?.trim();\n const initialValidationExpected = options.validationExpected?.trim();\n const initialValidation =\n initialValidationText || initialValidationCommand || initialValidationExpected\n ? ({\n text: initialValidationText || initialValidationCommand || \"Validation check\",\n command: initialValidationCommand || undefined,\n expected: initialValidationExpected || undefined,\n } satisfies PlanValidationCheck)\n : undefined;\n // pm-6mit: collect ordered initial-step titles. Mixed-usage semantics\n // (documented on pm-6mit): --step-title (when present) is the FIRST step,\n // followed by each repeated --step value in argv order.\n const stepTitleFlag = options.stepTitle?.trim();\n const repeatedStepTitles = toOrderedStepTitles(options.step);\n const stepTitles = stepTitleFlag ? [stepTitleFlag, ...repeatedStepTitles] : repeatedStepTitles;\n const hasPerStepDetailOptions =\n Boolean(options.stepBody?.trim()) ||\n Boolean(options.stepOwner?.trim()) ||\n Boolean(options.stepStatus?.trim()) ||\n Boolean(options.stepEvidence?.trim()) ||\n Boolean(options.stepBlockedReason?.trim()) ||\n Boolean(options.stepReplacement?.trim()) ||\n toArray(options.dependsOn).length > 0 ||\n toArray(options.link).length > 0 ||\n toSpecArray(options.file).length > 0 ||\n toSpecArray(options.test).length > 0 ||\n toSpecArray(options.doc).length > 0;\n if (stepTitles.length > 1 && hasPerStepDetailOptions) {\n // Per-step detail flags target exactly one step; silently attaching them to\n // the first (or all) of several seeded steps would be unpredictable.\n throw new PmCliError(\n \"pm plan create per-step options apply to a single initial step; with multiple --step values create the plan first, then refine steps individually\",\n EXIT_CODE.USAGE,\n {\n code: \"ambiguous_option_combination\",\n examples: [\n 'pm plan create --title \"Execution plan\" --step \"Read the code\" --step \"Write the fix\"',\n 'pm plan update-step <plan-id> plan-step-001 --step-body \"Inspect retry path\"',\n ],\n },\n );\n }\n let initialSteps: PlanStep[] = [];\n if (stepTitles.length === 1) {\n const status = asStepStatus(options.stepStatus, \"pending\");\n const linkedItems = buildLinkInputs(options, \"depends_on\");\n const files = toSpecArray(options.file).map(parseStepFile);\n const tests = toSpecArray(options.test).map(parseStepTest);\n const docs = toSpecArray(options.doc).map(parseStepDoc);\n const now = nowIso();\n initialSteps = [{\n id: \"plan-step-001\",\n order: 1,\n title: stepTitles[0],\n body: options.stepBody?.trim() || undefined,\n status,\n owner: options.stepOwner?.trim() || undefined,\n evidence: options.stepEvidence?.trim() || undefined,\n blocked_reason: status === \"blocked\" ? options.stepBlockedReason?.trim() || \"\" : undefined,\n linked_items: linkedItems.length > 0 ? linkedItems : undefined,\n files: files.length > 0 ? files : undefined,\n tests: tests.length > 0 ? tests : undefined,\n docs: docs.length > 0 ? docs : undefined,\n created_at: now,\n updated_at: now,\n completed_at: status === \"completed\" ? now : undefined,\n }];\n } else if (stepTitles.length > 1) {\n const now = nowIso();\n initialSteps = stepTitles.map((stepTitle, index) => ({\n id: `${STEP_ID_PREFIX}${String(index + 1).padStart(3, \"0\")}`,\n order: index + 1,\n title: stepTitle,\n status: \"pending\" as const,\n created_at: now,\n updated_at: now,\n }));\n }\n if (initialSteps.length > 0) {\n initialStep = initialSteps[0];\n const stepped = await mutateItem({\n pmRoot: ctx.pmRoot,\n settings: ctx.settings,\n id: createResult.item.id,\n op: \"plan_create_initial_step\",\n author: resolveAuthor(options.author, ctx.settings.author_default),\n message:\n initialSteps.length === 1\n ? `plan create initial step \"${initialSteps[0].title}\"`\n : `plan create ${initialSteps.length} initial steps`,\n mutate(doc) {\n ensurePlanItem(doc.metadata);\n doc.metadata.plan_steps = initialSteps;\n if (initialValidation) {\n doc.metadata.plan_validation = [...(doc.metadata.plan_validation ?? []), initialValidation];\n }\n return { changedFields: initialValidation ? [\"plan_steps\", \"plan_validation\"] : [\"plan_steps\"] };\n },\n });\n finalMetadata = stepped.item as unknown as ItemMetadata;\n } else if (initialValidation) {\n const validated = await mutateItem({\n pmRoot: ctx.pmRoot,\n settings: ctx.settings,\n id: createResult.item.id,\n op: \"plan_create_initial_validation\",\n author: resolveAuthor(options.author, ctx.settings.author_default),\n message: \"plan create initial validation\",\n mutate(doc) {\n ensurePlanItem(doc.metadata);\n doc.metadata.plan_validation = [...(doc.metadata.plan_validation ?? []), initialValidation];\n return { changedFields: [\"plan_validation\"] };\n },\n });\n finalMetadata = validated.item as unknown as ItemMetadata;\n } else if (hasPerStepDetailOptions) {\n throw new PmCliError(\"pm plan create step options require --step-title (or a single --step)\", EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n examples: ['pm plan create --title \"Execution plan\" --step-title \"Read the code\"'],\n });\n }\n if (options.claim) {\n const claimed = await mutateItem({\n pmRoot: ctx.pmRoot,\n settings: ctx.settings,\n id: createResult.item.id,\n op: \"claim\",\n author: resolveAuthor(options.author, ctx.settings.author_default),\n message: \"plan claim by author\",\n mutate(doc) {\n doc.metadata.assignee = resolveAuthor(options.author, ctx.settings.author_default);\n return { changedFields: [\"assignee\"] };\n },\n });\n finalMetadata = claimed.item as unknown as ItemMetadata;\n }\n\n const plan = projectPlan(finalMetadata, \"brief\");\n return {\n action: \"create\",\n plan,\n step: initialStep,\n next_actions: nextActionsFor(createResult.item.id, plan),\n warnings: [...createResult.warnings],\n generated_at: nowIso(),\n };\n}\n\nasync function planShow(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const depth = asDepth(options.depth);\n const fields = parsePlanFields(options.fields);\n const { document, itemId } = await readPlanItem(ctx, id);\n const fullPlan = projectPlan(document.metadata, fields === null ? depth : \"deep\");\n const plan = fields === null ? fullPlan : projectPlanForFields(fullPlan, fields);\n return {\n action: \"show\",\n plan,\n next_actions: nextActionsFor(itemId, fullPlan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\ninterface MutateStepArgs {\n id: string;\n options: PlanCommandOptions;\n ctx: PlanWriteContext;\n op: string;\n message: string;\n mutator(steps: PlanStep[], doc: ItemDocument): { changedSteps: string[]; current?: PlanStep; resultStep?: PlanStep };\n}\n\nasync function mutatePlanSteps(args: MutateStepArgs): Promise<{ document: ItemDocument; resultStep?: PlanStep; itemId: string }> {\n const author = resolveAuthor(args.options.author, args.ctx.settings.author_default);\n let resultStep: PlanStep | undefined;\n const result = await mutateItem({\n pmRoot: args.ctx.pmRoot,\n settings: args.ctx.settings,\n id: args.id,\n op: args.op,\n author,\n message: args.options.message ?? args.message,\n force: args.options.force,\n mutate(doc) {\n ensurePlanItem(doc.metadata);\n const steps = (doc.metadata.plan_steps ?? []).slice();\n const before = JSON.stringify(steps);\n const outcome = args.mutator(steps, doc);\n resultStep = outcome.resultStep;\n const sorted = steps\n .slice()\n .sort((left, right) => left.order - right.order)\n .map((step, index) => ({ ...step, order: index + 1 }));\n doc.metadata.plan_steps = sorted;\n const after = JSON.stringify(sorted);\n const changedFields = before === after ? [] : [\"plan_steps\"];\n if (changedFields.length === 0 && outcome.changedSteps.length === 0) {\n return { changedFields: [] };\n }\n return { changedFields: changedFields.length > 0 ? changedFields : [\"plan_steps\"] };\n },\n });\n return {\n document: { metadata: result.item as unknown as ItemMetadata, body: result.body },\n resultStep,\n itemId: result.item.id,\n };\n}\n\nasync function planAddStep(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const title = options.stepTitle?.trim();\n if (!title) {\n throw new PmCliError(\"pm plan add-step requires --step-title\", EXIT_CODE.USAGE);\n }\n const status = asStepStatus(options.stepStatus, \"pending\");\n const allowMultipleActive = options.allowMultipleActive === true;\n\n const linkedItems = buildLinkInputs(options, \"depends_on\");\n\n const files = toSpecArray(options.file).map(parseStepFile);\n const tests = toSpecArray(options.test).map(parseStepTest);\n const docs = toSpecArray(options.doc).map(parseStepDoc);\n\n const { document, resultStep, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_add_step\",\n message: `plan add-step \"${title}\"`,\n mutator(steps) {\n const order = steps.length + 1;\n if (status === \"in_progress\" && !allowMultipleActive) {\n for (const step of steps) {\n if (step.status === \"in_progress\") {\n throw new PmCliError(\n `Plan already has step ${step.id} in_progress. Pass --allow-multiple-active or update that step first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n }\n const now = nowIso();\n const step: PlanStep = {\n id: newStepId(steps),\n order,\n title,\n body: options.stepBody?.trim() || undefined,\n status,\n owner: options.stepOwner?.trim() || undefined,\n evidence: options.stepEvidence?.trim() || undefined,\n blocked_reason: status === \"blocked\" ? options.stepBlockedReason?.trim() || \"\" : undefined,\n linked_items: linkedItems.length > 0 ? linkedItems : undefined,\n files: files.length > 0 ? files : undefined,\n tests: tests.length > 0 ? tests : undefined,\n docs: docs.length > 0 ? docs : undefined,\n created_at: now,\n updated_at: now,\n completed_at: status === \"completed\" ? now : undefined,\n };\n steps.push(step);\n return { changedSteps: [step.id], resultStep: step };\n },\n });\n\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"add-step\",\n plan,\n step: resultStep,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nfunction buildLinkInputs(options: PlanCommandOptions, fallbackKind: PlanStepLinkKind): PlanStepLink[] {\n const dependsOn = toArray(options.dependsOn).map((id) => ({ id, kind: fallbackKind } as PlanStepLink));\n const related = toArray(options.related).map((id) => ({ id, kind: \"related\" } as PlanStepLink));\n const blocks = toArray(options.blocks).map((id) => ({ id, kind: \"blocks\" } as PlanStepLink));\n const blockedBy = toArray(options.blockedBy).map((id) => ({ id, kind: \"blocked_by\" } as PlanStepLink));\n const explicit = toArray(options.link);\n const explicitKind = asLinkKind(options.linkKind, fallbackKind);\n const note = options.linkNote?.trim();\n const explicitLinks = explicit.map((id) => {\n const link: PlanStepLink = { id, kind: explicitKind };\n if (note) link.note = note;\n return link;\n });\n return [...dependsOn, ...related, ...blocks, ...blockedBy, ...explicitLinks];\n}\n\nasync function planUpdateStep(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n args: { stepRef: string; finalStatus?: PlanStepStatus; op: string; allowMultipleActive?: boolean },\n): Promise<PlanCommandResult> {\n const { document, resultStep, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: args.op,\n message: options.message ?? `${args.op} ${args.stepRef}`,\n mutator(steps, doc) {\n const step = resolveStepRef(steps, args.stepRef);\n const now = nowIso();\n const desiredStatus = args.finalStatus ?? asStepStatus(options.stepStatus, step.status);\n if (desiredStatus === \"in_progress\" && step.status !== \"in_progress\" && !options.allowMultipleActive && !args.allowMultipleActive) {\n for (const other of steps) {\n if (other.id !== step.id && other.status === \"in_progress\") {\n throw new PmCliError(\n `Plan already has step ${other.id} in_progress. Pass --allow-multiple-active or update that step first.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n }\n if (desiredStatus === \"blocked\" && !options.stepBlockedReason?.trim() && !step.blocked_reason) {\n throw new PmCliError(\n \"Blocking a step requires --step-blocked-reason or an already-recorded blocked_reason.\",\n EXIT_CODE.USAGE,\n );\n }\n if (options.stepTitle?.trim()) step.title = options.stepTitle.trim();\n if (options.stepBody !== undefined) step.body = options.stepBody.trim() || undefined;\n if (options.stepOwner !== undefined) step.owner = options.stepOwner.trim() || undefined;\n if (options.stepEvidence !== undefined) step.evidence = options.stepEvidence.trim() || undefined;\n if (options.stepBlockedReason !== undefined) step.blocked_reason = options.stepBlockedReason.trim() || undefined;\n if (options.stepReplacement !== undefined) step.superseded_by = options.stepReplacement.trim() || undefined;\n step.status = desiredStatus;\n step.updated_at = now;\n if (desiredStatus === \"completed\" && !step.completed_at) {\n step.completed_at = now;\n } else if (desiredStatus !== \"completed\") {\n step.completed_at = undefined;\n }\n doc.metadata.updated_at = now;\n return { changedSteps: [step.id], resultStep: step };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: args.op === \"plan_complete_step\" ? \"complete-step\" : args.op === \"plan_block_step\" ? \"block-step\" : \"update-step\",\n plan,\n step: resultStep,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planReorderStep(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n stepRef: string,\n newOrder: number,\n): Promise<PlanCommandResult> {\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_reorder_step\",\n message: options.message ?? `plan reorder-step ${stepRef} -> ${newOrder}`,\n mutator(steps) {\n const step = resolveStepRef(steps, stepRef);\n const filtered = steps.filter((entry) => entry.id !== step.id);\n const clamped = Math.max(1, Math.min(newOrder, filtered.length + 1));\n filtered.splice(clamped - 1, 0, step);\n filtered.forEach((entry, index) => {\n entry.order = index + 1;\n entry.updated_at = nowIso();\n });\n steps.length = 0;\n steps.push(...filtered);\n return { changedSteps: [step.id], resultStep: step };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"reorder-step\",\n plan,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planRemoveStep(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n stepRef: string,\n): Promise<PlanCommandResult> {\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_remove_step\",\n message: options.message ?? `plan remove-step ${stepRef}`,\n mutator(steps) {\n const step = resolveStepRef(steps, stepRef);\n const remaining = steps.filter((entry) => entry.id !== step.id);\n remaining.forEach((entry, index) => {\n entry.order = index + 1;\n });\n steps.length = 0;\n steps.push(...remaining);\n return { changedSteps: [step.id] };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"remove-step\",\n plan,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planLink(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n stepRef: string,\n): Promise<PlanCommandResult> {\n const newLinks = buildLinkInputs(options, asLinkKind(options.linkKind, \"related\"));\n if (newLinks.length === 0) {\n throw new PmCliError(\"pm plan link requires at least one --link/--related/--blocks/--blocked-by/--depends-on id\", EXIT_CODE.USAGE);\n }\n const promoteToItemDep = options.promoteToItemDep === true;\n const { document, itemId, resultStep } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_link_step\",\n message: options.message ?? `plan link ${stepRef}`,\n mutator(steps, doc) {\n const step = resolveStepRef(steps, stepRef);\n const existing = step.linked_items ?? [];\n const dedupKey = (link: PlanStepLink) => `${link.kind}:${link.id}`;\n const seen = new Set(existing.map(dedupKey));\n for (const link of newLinks) {\n const key = dedupKey(link);\n if (seen.has(key)) continue;\n existing.push(link);\n seen.add(key);\n }\n step.linked_items = existing;\n step.updated_at = nowIso();\n if (promoteToItemDep) {\n const deps = doc.metadata.dependencies ?? [];\n const depKey = (dep: { id: string; kind: string }) => `${dep.kind}:${dep.id}`;\n const seenDeps = new Set(deps.map(depKey));\n for (const link of newLinks) {\n const candidate = {\n id: link.id,\n kind: link.kind as DependencyKind,\n created_at: nowIso(),\n author: resolveAuthor(options.author, ctx.settings.author_default),\n };\n if (seenDeps.has(depKey(candidate))) continue;\n deps.push(candidate);\n seenDeps.add(depKey(candidate));\n }\n doc.metadata.dependencies = deps;\n }\n return { changedSteps: [step.id], resultStep: step };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"link\",\n plan,\n step: resultStep,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planUnlink(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n stepRef: string,\n): Promise<PlanCommandResult> {\n const removeIds = toArray(options.link);\n if (removeIds.length === 0) {\n throw new PmCliError(\"pm plan unlink requires --link <id> to remove\", EXIT_CODE.USAGE);\n }\n const { document, itemId, resultStep } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_unlink_step\",\n message: options.message ?? `plan unlink ${stepRef}`,\n mutator(steps) {\n const step = resolveStepRef(steps, stepRef);\n const filtered = (step.linked_items ?? []).filter((link) => !removeIds.includes(link.id));\n step.linked_items = filtered.length > 0 ? filtered : undefined;\n step.updated_at = nowIso();\n return { changedSteps: [step.id], resultStep: step };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"unlink\",\n plan,\n step: resultStep,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planAppendLog(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n kind: \"decision\" | \"discovery\" | \"validation\",\n): Promise<PlanCommandResult> {\n const logText = resolvePlanLogText(kind, options);\n if (!logText) {\n const canonical = `--${kind}-text`;\n const shorthand = `--${kind}`;\n throw new PmCliError(`pm plan ${kind} requires ${canonical}`, EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n examples: [\n `pm plan ${kind} <plan-id> ${canonical} \"...\"`,\n `pm plan ${kind} <plan-id> ${shorthand} \"...\"`,\n ],\n recovery: {\n suggested_retry: `pm plan ${kind} <plan-id> ${canonical} <value>`,\n },\n });\n }\n const author = resolveAuthor(options.author, ctx.settings.author_default);\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: `plan_append_${kind}`,\n message: options.message ?? `plan ${kind} append`,\n mutator(_steps, doc) {\n const now = nowIso();\n if (kind === \"decision\") {\n const list = doc.metadata.plan_decisions ?? [];\n list.push({\n ts: now,\n author,\n decision: logText,\n rationale: options.decisionRationale?.trim() || undefined,\n evidence: options.decisionEvidence?.trim() || undefined,\n });\n doc.metadata.plan_decisions = list;\n return { changedSteps: [] };\n }\n if (kind === \"discovery\") {\n const list = doc.metadata.plan_discoveries ?? [];\n list.push({ ts: now, author, text: logText });\n doc.metadata.plan_discoveries = list;\n return { changedSteps: [] };\n }\n const list = doc.metadata.plan_validation ?? [];\n list.push({\n text: logText,\n command: options.validationCommand?.trim() || undefined,\n expected: options.validationExpected?.trim() || undefined,\n });\n doc.metadata.plan_validation = list;\n return { changedSteps: [] };\n },\n });\n const plan = projectPlan(document.metadata, \"deep\");\n return {\n action: kind,\n plan,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planResume(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const text = options.resumeContext?.trim();\n if (!text) {\n throw new PmCliError(\"pm plan resume requires --resume-context <text>\", EXIT_CODE.USAGE);\n }\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_resume\",\n message: options.message ?? \"plan resume context update\",\n mutator(_steps, doc) {\n doc.metadata.plan_resume_context = text;\n return { changedSteps: [] };\n },\n });\n const plan = projectPlan(document.metadata, \"brief\");\n return {\n action: \"resume\",\n plan,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planApprove(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const mode = asPlanMode(options.mode ?? \"approved\", \"approved\");\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_approve\",\n message: options.message ?? `plan approve mode=${mode}`,\n mutator(_steps, doc) {\n doc.metadata.plan_mode = mode;\n return { changedSteps: [] };\n },\n });\n const plan = projectPlan(document.metadata, \"brief\");\n return {\n action: \"approve\",\n plan,\n next_actions: nextActionsFor(itemId, plan),\n warnings: [],\n generated_at: nowIso(),\n };\n}\n\nasync function planMaterialize(\n id: string,\n options: PlanCommandOptions,\n ctx: PlanWriteContext,\n): Promise<PlanCommandResult> {\n const stepRefs = toArray(options.steps);\n if (stepRefs.length === 0) {\n throw new PmCliError(\"pm plan materialize requires --steps <ids|orders|all>\", EXIT_CODE.USAGE);\n }\n const targetType = options.materializeType?.trim() || \"Task\";\n const typeRegistry = resolveItemTypeRegistry(ctx.settings, getActiveExtensionRegistrations());\n const resolvedTypeName = resolveTypeName(targetType, typeRegistry);\n if (!resolvedTypeName) {\n throw new PmCliError(`Invalid --materialize-type \"${targetType}\"`, EXIT_CODE.USAGE);\n }\n const parent = options.materializeParent?.trim() || id;\n const tags = options.materializeTags;\n\n const planRead = await readPlanItem(ctx, id);\n const steps = (planRead.document.metadata.plan_steps ?? []).slice();\n const { targets, skipped: materializeSkipped } = resolveMaterializeTargets(steps, stepRefs);\n if (targets.length === 0) {\n if (materializeSkipped.length > 0) {\n // PR #78 / Gemini medium follow-up: when every selected step was\n // already materialized or completed, return a successful no-op\n // result (exit 0) instead of throwing NOT_FOUND. This makes\n // `pm plan materialize --steps all` truly idempotent for CI/agent\n // workflows; the skip reasons + warnings still surface what was\n // intentionally not redone.\n const plan = projectPlan(planRead.document.metadata, \"standard\");\n return {\n action: \"materialize\",\n plan,\n materialized: [],\n materialize_skipped: materializeSkipped,\n next_actions: nextActionsFor(planRead.itemId, plan),\n warnings: materializeSkipped.map(\n (entry) =>\n `plan_materialize_skipped:${entry.from_step}:${entry.reason}${entry.existing_id ? `:${entry.existing_id}` : \"\"}`,\n ),\n generated_at: nowIso(),\n };\n }\n throw new PmCliError(\"No matching plan steps found for --steps\", EXIT_CODE.NOT_FOUND);\n }\n\n const materialized: { id: string; type: string; from_step: string }[] = [];\n for (const step of targets) {\n const deps = [\n `id=${parent},kind=parent`,\n `id=${planRead.itemId},kind=discovered_from`,\n ];\n for (const link of step.linked_items ?? []) {\n const realKind: DependencyKind =\n link.kind === \"blocked_by\" || link.kind === \"blocks\" || link.kind === \"related\" || link.kind === \"discovered_from\"\n ? link.kind\n : \"related\";\n deps.push(`id=${link.id},kind=${realKind}`);\n }\n const created = await runCreate(\n {\n title: step.title,\n description: step.body?.trim() || step.title,\n type: resolvedTypeName,\n parent,\n tags,\n author: options.author,\n message: options.message ?? `materialized from plan ${planRead.itemId} step ${step.id}`,\n dep: deps,\n },\n ctx.settings ? { ...({} as GlobalOptions), path: ctx.pmRoot } as GlobalOptions : ({} as GlobalOptions),\n );\n materialized.push({ id: created.item.id, type: resolvedTypeName, from_step: step.id });\n }\n\n const { document, itemId } = await mutatePlanSteps({\n id,\n options,\n ctx,\n op: \"plan_materialize\",\n message: options.message ?? `plan materialize ${stepRefs.join(\",\")}`,\n mutator(currentSteps, doc) {\n for (const target of targets) {\n const matched = materialized.find((entry) => entry.from_step === target.id);\n if (!matched) continue;\n const step = currentSteps.find((entry) => entry.id === target.id);\n if (!step) continue;\n const links = step.linked_items ?? [];\n links.push({ id: matched.id, kind: \"implements\", note: `materialized as ${matched.type}` });\n step.linked_items = links;\n step.updated_at = nowIso();\n }\n return { changedSteps: targets.map((entry) => entry.id) };\n },\n });\n const plan = projectPlan(document.metadata, \"standard\");\n return {\n action: \"materialize\",\n plan,\n materialized,\n ...(materializeSkipped.length > 0 ? { materialize_skipped: materializeSkipped } : {}),\n next_actions: nextActionsFor(itemId, plan),\n warnings: materializeSkipped.map(\n (entry) =>\n `plan_materialize_skipped:${entry.from_step}:${entry.reason}${entry.existing_id ? `:${entry.existing_id}` : \"\"}`,\n ),\n generated_at: nowIso(),\n };\n}\n\nexport interface PlanDispatchInput {\n subcommand: PlanSubcommand;\n id?: string;\n stepRef?: string;\n reorderTo?: number;\n options: PlanCommandOptions;\n global: GlobalOptions;\n}\n\nexport async function runPlan(input: PlanDispatchInput): Promise<PlanCommandResult> {\n const ctx = await loadContext(input.global);\n // pm-6mit: --step accumulates ordered step titles on create. For every other\n // subcommand a single --step value keeps its historical alias-of---step-title\n // behavior; multiple values would be ambiguous there (one step is targeted),\n // so they are rejected instead of silently dropping all but the last.\n if (input.subcommand !== \"create\") {\n const stepValues = toOrderedStepTitles(input.options.step);\n if (stepValues.length > 1) {\n throw new PmCliError(\n `pm plan ${input.subcommand} accepts a single --step/--step-title value (repeated --step seeds ordered steps only on pm plan create)`,\n EXIT_CODE.USAGE,\n );\n }\n if (stepValues.length === 1 && !input.options.stepTitle?.trim()) {\n input = { ...input, options: { ...input.options, stepTitle: stepValues[0] } };\n }\n }\n switch (input.subcommand) {\n case \"create\":\n return planCreate(input.options, input.global, ctx);\n case \"show\":\n if (!input.id) throw new PmCliError(\"pm plan show requires a plan id\", EXIT_CODE.USAGE);\n return planShow(input.id, input.options, ctx);\n case \"add-step\":\n if (!input.id) throw new PmCliError(\"pm plan add-step requires a plan id\", EXIT_CODE.USAGE);\n return planAddStep(input.id, input.options, ctx);\n case \"update-step\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan update-step requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planUpdateStep(input.id, input.options, ctx, { stepRef: input.stepRef, op: \"plan_update_step\" });\n case \"complete-step\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan complete-step requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planUpdateStep(input.id, input.options, ctx, { stepRef: input.stepRef, finalStatus: \"completed\", op: \"plan_complete_step\" });\n case \"block-step\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan block-step requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planUpdateStep(input.id, input.options, ctx, { stepRef: input.stepRef, finalStatus: \"blocked\", op: \"plan_block_step\" });\n case \"reorder-step\":\n if (!input.id || !input.stepRef || input.reorderTo === undefined)\n throw new PmCliError(\"pm plan reorder-step requires <plan-id> <step> <new-order>\", EXIT_CODE.USAGE);\n return planReorderStep(input.id, input.options, ctx, input.stepRef, input.reorderTo);\n case \"remove-step\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan remove-step requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planRemoveStep(input.id, input.options, ctx, input.stepRef);\n case \"link\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan link requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planLink(input.id, input.options, ctx, input.stepRef);\n case \"unlink\":\n if (!input.id || !input.stepRef) throw new PmCliError(\"pm plan unlink requires <plan-id> <step>\", EXIT_CODE.USAGE);\n return planUnlink(input.id, input.options, ctx, input.stepRef);\n case \"decision\":\n if (!input.id) throw new PmCliError(\"pm plan decision requires a plan id\", EXIT_CODE.USAGE);\n return planAppendLog(input.id, input.options, ctx, \"decision\");\n case \"discovery\":\n if (!input.id) throw new PmCliError(\"pm plan discovery requires a plan id\", EXIT_CODE.USAGE);\n return planAppendLog(input.id, input.options, ctx, \"discovery\");\n case \"validation\":\n if (!input.id) throw new PmCliError(\"pm plan validation requires a plan id\", EXIT_CODE.USAGE);\n return planAppendLog(input.id, input.options, ctx, \"validation\");\n case \"resume\":\n if (!input.id) throw new PmCliError(\"pm plan resume requires a plan id\", EXIT_CODE.USAGE);\n return planResume(input.id, input.options, ctx);\n case \"approve\":\n if (!input.id) throw new PmCliError(\"pm plan approve requires a plan id\", EXIT_CODE.USAGE);\n return planApprove(input.id, input.options, ctx);\n case \"materialize\":\n if (!input.id) throw new PmCliError(\"pm plan materialize requires a plan id\", EXIT_CODE.USAGE);\n return planMaterialize(input.id, input.options, ctx);\n default:\n throw new PmCliError(`Unknown pm plan subcommand \"${input.subcommand}\"`, EXIT_CODE.USAGE);\n }\n}\n"],"names":["step","list","plan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAM,mBAAmB;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIK,IAAM,yBAAyB,CAAC,SAAS,YAAY,MAAM;AA2GlE,IAAM,iBAAiB;AACvB,IAAM,oBAA8B;AAEpC,SAAS,cAAc,WAA+B,UAAgB;AACpE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