@unbrained/pm-cli 2026.6.12 → 2026.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (777) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +2 -2
  3. package/dist/cli/bootstrap-args.d.ts +29 -0
  4. package/dist/cli/bootstrap-args.js +11 -4
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.d.ts +12 -0
  7. package/dist/cli/commander-usage.js +18 -7
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/activity.d.ts +19 -0
  10. package/dist/cli/commands/activity.js +12 -2
  11. package/dist/cli/commands/activity.js.map +1 -1
  12. package/dist/cli/commands/aggregate.d.ts +58 -0
  13. package/dist/cli/commands/aggregate.js +48 -15
  14. package/dist/cli/commands/aggregate.js.map +1 -1
  15. package/dist/cli/commands/annotation-command.d.ts +6 -1
  16. package/dist/cli/commands/annotation-command.js +72 -2
  17. package/dist/cli/commands/annotation-command.js.map +1 -1
  18. package/dist/cli/commands/append.js +4 -3
  19. package/dist/cli/commands/append.js.map +1 -1
  20. package/dist/cli/commands/close-many.d.ts +20 -0
  21. package/dist/cli/commands/close-many.js +14 -23
  22. package/dist/cli/commands/close-many.js.map +1 -1
  23. package/dist/cli/commands/close.js +37 -4
  24. package/dist/cli/commands/close.js.map +1 -1
  25. package/dist/cli/commands/comments-audit.js +3 -2
  26. package/dist/cli/commands/comments-audit.js.map +1 -1
  27. package/dist/cli/commands/comments.d.ts +2 -0
  28. package/dist/cli/commands/comments.js +49 -23
  29. package/dist/cli/commands/comments.js.map +1 -1
  30. package/dist/cli/commands/completion.js +269 -8
  31. package/dist/cli/commands/completion.js.map +1 -1
  32. package/dist/cli/commands/config.d.ts +51 -1
  33. package/dist/cli/commands/config.js +50 -12
  34. package/dist/cli/commands/config.js.map +1 -1
  35. package/dist/cli/commands/context.d.ts +79 -1
  36. package/dist/cli/commands/context.js +151 -25
  37. package/dist/cli/commands/context.js.map +1 -1
  38. package/dist/cli/commands/contracts.d.ts +80 -1
  39. package/dist/cli/commands/contracts.js +54 -4
  40. package/dist/cli/commands/contracts.js.map +1 -1
  41. package/dist/cli/commands/create.d.ts +49 -0
  42. package/dist/cli/commands/create.js +112 -7
  43. package/dist/cli/commands/create.js.map +1 -1
  44. package/dist/cli/commands/dedupe-audit.d.ts +33 -0
  45. package/dist/cli/commands/dedupe-audit.js +18 -14
  46. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  47. package/dist/cli/commands/deps.js +7 -4
  48. package/dist/cli/commands/deps.js.map +1 -1
  49. package/dist/cli/commands/event-validation-messages.js +3 -3
  50. package/dist/cli/commands/event-validation-messages.js.map +1 -1
  51. package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
  52. package/dist/cli/commands/extension/bundled-catalog.js +19 -15
  53. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  54. package/dist/cli/commands/extension/install-sources.d.ts +41 -1
  55. package/dist/cli/commands/extension/install-sources.js +26 -8
  56. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  57. package/dist/cli/commands/extension/shared.d.ts +5 -0
  58. package/dist/cli/commands/extension/shared.js +9 -3
  59. package/dist/cli/commands/extension/shared.js.map +1 -1
  60. package/dist/cli/commands/extension.d.ts +133 -1
  61. package/dist/cli/commands/extension.js +127 -9
  62. package/dist/cli/commands/extension.js.map +1 -1
  63. package/dist/cli/commands/files.d.ts +30 -1
  64. package/dist/cli/commands/files.js +21 -2
  65. package/dist/cli/commands/files.js.map +1 -1
  66. package/dist/cli/commands/focus.d.ts +11 -0
  67. package/dist/cli/commands/focus.js +86 -0
  68. package/dist/cli/commands/focus.js.map +1 -0
  69. package/dist/cli/commands/get.d.ts +9 -2
  70. package/dist/cli/commands/get.js +34 -6
  71. package/dist/cli/commands/get.js.map +1 -1
  72. package/dist/cli/commands/guide.d.ts +5 -0
  73. package/dist/cli/commands/guide.js +6 -3
  74. package/dist/cli/commands/guide.js.map +1 -1
  75. package/dist/cli/commands/health.d.ts +109 -0
  76. package/dist/cli/commands/health.js +87 -35
  77. package/dist/cli/commands/health.js.map +1 -1
  78. package/dist/cli/commands/history-compact.js +27 -36
  79. package/dist/cli/commands/history-compact.js.map +1 -1
  80. package/dist/cli/commands/history-redact.d.ts +46 -0
  81. package/dist/cli/commands/history-redact.js +99 -67
  82. package/dist/cli/commands/history-redact.js.map +1 -1
  83. package/dist/cli/commands/history-repair.js +34 -37
  84. package/dist/cli/commands/history-repair.js.map +1 -1
  85. package/dist/cli/commands/history.js +6 -2
  86. package/dist/cli/commands/history.js.map +1 -1
  87. package/dist/cli/commands/index.d.ts +1 -0
  88. package/dist/cli/commands/index.js +3 -2
  89. package/dist/cli/commands/index.js.map +1 -1
  90. package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
  91. package/dist/cli/commands/init-agent-guidance.js +31 -4
  92. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  93. package/dist/cli/commands/init.d.ts +36 -1
  94. package/dist/cli/commands/init.js +38 -5
  95. package/dist/cli/commands/init.js.map +1 -1
  96. package/dist/cli/commands/learnings.js +4 -3
  97. package/dist/cli/commands/learnings.js.map +1 -1
  98. package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
  99. package/dist/cli/commands/linked-test-parsers.js +5 -2
  100. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  101. package/dist/cli/commands/list-filter-shared.d.ts +8 -0
  102. package/dist/cli/commands/list-filter-shared.js +70 -0
  103. package/dist/cli/commands/list-filter-shared.js.map +1 -0
  104. package/dist/cli/commands/list.d.ts +116 -0
  105. package/dist/cli/commands/list.js +194 -6
  106. package/dist/cli/commands/list.js.map +1 -1
  107. package/dist/cli/commands/normalize.js +16 -2
  108. package/dist/cli/commands/normalize.js.map +1 -1
  109. package/dist/cli/commands/notes.js +4 -3
  110. package/dist/cli/commands/notes.js.map +1 -1
  111. package/dist/cli/commands/plan.js +3 -2
  112. package/dist/cli/commands/plan.js.map +1 -1
  113. package/dist/cli/commands/reindex.d.ts +83 -0
  114. package/dist/cli/commands/reindex.js +45 -10
  115. package/dist/cli/commands/reindex.js.map +1 -1
  116. package/dist/cli/commands/restore.d.ts +40 -1
  117. package/dist/cli/commands/restore.js +27 -2
  118. package/dist/cli/commands/restore.js.map +1 -1
  119. package/dist/cli/commands/schema.d.ts +18 -0
  120. package/dist/cli/commands/schema.js +30 -3
  121. package/dist/cli/commands/schema.js.map +1 -1
  122. package/dist/cli/commands/search.d.ts +289 -1
  123. package/dist/cli/commands/search.js +367 -60
  124. package/dist/cli/commands/search.js.map +1 -1
  125. package/dist/cli/commands/stats.d.ts +38 -0
  126. package/dist/cli/commands/stats.js +38 -10
  127. package/dist/cli/commands/stats.js.map +1 -1
  128. package/dist/cli/commands/telemetry.js +5 -3
  129. package/dist/cli/commands/telemetry.js.map +1 -1
  130. package/dist/cli/commands/templates.d.ts +18 -0
  131. package/dist/cli/commands/templates.js +9 -2
  132. package/dist/cli/commands/templates.js.map +1 -1
  133. package/dist/cli/commands/test-all.d.ts +5 -0
  134. package/dist/cli/commands/test-all.js +9 -3
  135. package/dist/cli/commands/test-all.js.map +1 -1
  136. package/dist/cli/commands/test.d.ts +70 -1
  137. package/dist/cli/commands/test.js +84 -3
  138. package/dist/cli/commands/test.js.map +1 -1
  139. package/dist/cli/commands/update-many.d.ts +34 -1
  140. package/dist/cli/commands/update-many.js +60 -31
  141. package/dist/cli/commands/update-many.js.map +1 -1
  142. package/dist/cli/commands/update.d.ts +71 -0
  143. package/dist/cli/commands/update.js +74 -8
  144. package/dist/cli/commands/update.js.map +1 -1
  145. package/dist/cli/commands/upgrade.d.ts +28 -1
  146. package/dist/cli/commands/upgrade.js +17 -4
  147. package/dist/cli/commands/upgrade.js.map +1 -1
  148. package/dist/cli/commands/validate.d.ts +114 -0
  149. package/dist/cli/commands/validate.js +154 -9
  150. package/dist/cli/commands/validate.js.map +1 -1
  151. package/dist/cli/error-guidance.d.ts +30 -0
  152. package/dist/cli/error-guidance.js +68 -6
  153. package/dist/cli/error-guidance.js.map +1 -1
  154. package/dist/cli/extension-command-options.js +9 -7
  155. package/dist/cli/extension-command-options.js.map +1 -1
  156. package/dist/cli/help-content.d.ts +8 -0
  157. package/dist/cli/help-content.js +30 -6
  158. package/dist/cli/help-content.js.map +1 -1
  159. package/dist/cli/help-json-payload.d.ts +19 -1
  160. package/dist/cli/help-json-payload.js +16 -7
  161. package/dist/cli/help-json-payload.js.map +1 -1
  162. package/dist/cli/main.d.ts +223 -0
  163. package/dist/cli/main.js +214 -46
  164. package/dist/cli/main.js.map +1 -1
  165. package/dist/cli/register-list-query.js +62 -5
  166. package/dist/cli/register-list-query.js.map +1 -1
  167. package/dist/cli/register-mutation.d.ts +16 -0
  168. package/dist/cli/register-mutation.js +210 -40
  169. package/dist/cli/register-mutation.js.map +1 -1
  170. package/dist/cli/register-operations.d.ts +8 -0
  171. package/dist/cli/register-operations.js +33 -11
  172. package/dist/cli/register-operations.js.map +1 -1
  173. package/dist/cli/register-setup.js +9 -6
  174. package/dist/cli/register-setup.js.map +1 -1
  175. package/dist/cli/registration-helpers.d.ts +4 -0
  176. package/dist/cli/registration-helpers.js +124 -38
  177. package/dist/cli/registration-helpers.js.map +1 -1
  178. package/dist/cli-bundle/chunks/activity-5P2KQCTH.js +18 -0
  179. package/dist/cli-bundle/chunks/{activity-XADJOG6G.js → activity-MJGTX4LO.js} +13 -11
  180. package/dist/cli-bundle/chunks/{aggregate-OD36DJU5.js → aggregate-MH3GROKB.js} +54 -25
  181. package/dist/cli-bundle/chunks/aggregate-MH3GROKB.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{aggregate-6OTS3AOO.js → aggregate-OUGCDFNC.js} +55 -26
  183. package/dist/cli-bundle/chunks/aggregate-OUGCDFNC.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{append-JYWO4P7W.js → append-2Q4BPUBW.js} +10 -10
  185. package/dist/cli-bundle/chunks/{append-JYWO4P7W.js.map → append-2Q4BPUBW.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{append-KG55G7S3.js → append-VCRUG2W6.js} +11 -11
  187. package/dist/cli-bundle/chunks/append-VCRUG2W6.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js → chunk-2IUJBMKS.js} +10 -9
  189. package/dist/cli-bundle/chunks/{chunk-IGVJRZ6H.js.map → chunk-2IUJBMKS.js.map} +2 -2
  190. package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js → chunk-2JEGCDYT.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js → chunk-3WAULYOY.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-UIG4TW2H.js → chunk-3XOXWOGA.js} +359 -19
  193. package/dist/cli-bundle/chunks/chunk-3XOXWOGA.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-3KLPFWZ4.js → chunk-4KBK4BA3.js} +16 -34
  195. package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-OLKBSY4N.js → chunk-4VLB4JH2.js} +51 -8
  197. package/dist/cli-bundle/chunks/chunk-4VLB4JH2.js.map +7 -0
  198. package/dist/cli-bundle/chunks/{chunk-ZMW77VWV.js → chunk-656HPQPO.js} +27 -12
  199. package/dist/cli-bundle/chunks/chunk-656HPQPO.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{chunk-CW6E4NAT.js → chunk-667XI4UJ.js} +309 -20
  201. package/dist/cli-bundle/chunks/chunk-667XI4UJ.js.map +1 -0
  202. package/dist/cli-bundle/chunks/{chunk-5SCT2JCT.js → chunk-6BV7ENQL.js} +9 -8
  203. package/dist/cli-bundle/chunks/chunk-6BV7ENQL.js.map +7 -0
  204. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
  205. package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
  206. package/dist/cli-bundle/chunks/{chunk-VFUZV5EB.js → chunk-6NQXMGYU.js} +19 -8
  207. package/dist/cli-bundle/chunks/chunk-6NQXMGYU.js.map +7 -0
  208. package/dist/cli-bundle/chunks/{chunk-GKIZW7SM.js → chunk-764O7EUA.js} +223 -50
  209. package/dist/cli-bundle/chunks/chunk-764O7EUA.js.map +7 -0
  210. package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js → chunk-7AGIXLNK.js} +3 -3
  211. package/dist/cli-bundle/chunks/chunk-7EILPFMA.js +404 -0
  212. package/dist/cli-bundle/chunks/chunk-7EILPFMA.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-HI7STVF2.js → chunk-7K2MXFMX.js} +14 -32
  214. package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-TNAP7EJX.js → chunk-7L5VOUYP.js} +6 -17
  216. package/dist/cli-bundle/chunks/chunk-7L5VOUYP.js.map +7 -0
  217. package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js +61 -0
  218. package/dist/cli-bundle/chunks/chunk-7ZGKNHUL.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-7IYFN5R7.js → chunk-A576QZDL.js} +223 -50
  220. package/dist/cli-bundle/chunks/chunk-A576QZDL.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-KBPQHXWG.js → chunk-AERT7KT3.js} +5 -5
  222. package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js +58 -0
  223. package/dist/cli-bundle/chunks/chunk-ASM4DVRW.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-KWAXVAXX.js → chunk-B5Q7XC4K.js} +117 -37
  225. package/dist/cli-bundle/chunks/chunk-B5Q7XC4K.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-EWFY7SLA.js → chunk-BJWTFOZM.js} +74 -14
  227. package/dist/cli-bundle/chunks/chunk-BJWTFOZM.js.map +1 -0
  228. package/dist/cli-bundle/chunks/{chunk-XJDGS74Y.js → chunk-CBMETQ2U.js} +105 -31
  229. package/dist/cli-bundle/chunks/chunk-CBMETQ2U.js.map +1 -0
  230. package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js → chunk-E6J2PEK6.js} +3 -3
  231. package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js → chunk-F2GC6L3N.js} +3 -3
  232. package/dist/cli-bundle/chunks/{chunk-I7NYDZDV.js → chunk-F7WSO5UX.js} +7 -18
  233. package/dist/cli-bundle/chunks/chunk-F7WSO5UX.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js → chunk-FTAZLAR7.js} +8 -5
  235. package/dist/cli-bundle/chunks/{chunk-VAOUX6TK.js.map → chunk-FTAZLAR7.js.map} +1 -1
  236. package/dist/cli-bundle/chunks/{chunk-OASDW5UI.js → chunk-FXNT5LPX.js} +77 -9
  237. package/dist/cli-bundle/chunks/chunk-FXNT5LPX.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-WUNFKP7M.js → chunk-G2YVUY7I.js} +14 -9
  239. package/dist/cli-bundle/chunks/chunk-G2YVUY7I.js.map +1 -0
  240. package/dist/cli-bundle/chunks/{chunk-L5EPZQIC.js → chunk-G3CEIXTV.js} +68 -19
  241. package/dist/cli-bundle/chunks/chunk-G3CEIXTV.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{chunk-UUWGCWBU.js → chunk-GAVE4MYM.js} +37 -63
  243. package/dist/cli-bundle/chunks/chunk-GAVE4MYM.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js → chunk-GQ4JKNMV.js} +4 -4
  245. package/dist/cli-bundle/chunks/{chunk-SXKNJPQ7.js.map → chunk-GQ4JKNMV.js.map} +1 -1
  246. package/dist/cli-bundle/chunks/{chunk-73ZPG2I3.js → chunk-GYMG7AG6.js} +36 -62
  247. package/dist/cli-bundle/chunks/chunk-GYMG7AG6.js.map +7 -0
  248. package/dist/cli-bundle/chunks/{chunk-35P4GT6E.js → chunk-H6EH6ENJ.js} +362 -22
  249. package/dist/cli-bundle/chunks/chunk-H6EH6ENJ.js.map +7 -0
  250. package/dist/cli-bundle/chunks/{chunk-F75JSIOZ.js → chunk-HDIDUME4.js} +45 -13
  251. package/dist/cli-bundle/chunks/chunk-HDIDUME4.js.map +1 -0
  252. package/dist/cli-bundle/chunks/{chunk-XWMF3POR.js → chunk-HPELHUTG.js} +122 -45
  253. package/dist/cli-bundle/chunks/chunk-HPELHUTG.js.map +1 -0
  254. package/dist/cli-bundle/chunks/{chunk-QKW5D45B.js → chunk-II7OGE3V.js} +20 -9
  255. package/dist/cli-bundle/chunks/chunk-II7OGE3V.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js → chunk-ILHLIA47.js} +5 -5
  257. package/dist/cli-bundle/chunks/{chunk-4HFU4UO2.js.map → chunk-ILHLIA47.js.map} +1 -1
  258. package/dist/cli-bundle/chunks/{chunk-P5BJOMBB.js → chunk-IMQG4VR3.js} +118 -74
  259. package/dist/cli-bundle/chunks/chunk-IMQG4VR3.js.map +1 -0
  260. package/dist/cli-bundle/chunks/{chunk-AX4GEVQC.js → chunk-IQVB3YDD.js} +88 -22
  261. package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +7 -0
  262. package/dist/cli-bundle/chunks/{chunk-I53JBTJW.js → chunk-KQ3LAMDO.js} +45 -13
  263. package/dist/cli-bundle/chunks/chunk-KQ3LAMDO.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{chunk-A6LXQFO7.js → chunk-KTVETP66.js} +334 -253
  265. package/dist/cli-bundle/chunks/chunk-KTVETP66.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{chunk-DY6C42S6.js → chunk-KZYVTOG5.js} +26 -11
  267. package/dist/cli-bundle/chunks/chunk-KZYVTOG5.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js → chunk-L6FJPOT4.js} +11 -10
  269. package/dist/cli-bundle/chunks/{chunk-HGLC63AU.js.map → chunk-L6FJPOT4.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/{chunk-FY4SPXSC.js → chunk-LV5FFQ7M.js} +354 -266
  271. package/dist/cli-bundle/chunks/chunk-LV5FFQ7M.js.map +7 -0
  272. package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
  273. package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js → chunk-M23HXJL3.js} +2 -2
  275. package/dist/cli-bundle/chunks/{chunk-S26FESD4.js → chunk-MJZUZ2QE.js} +3 -3
  276. package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js → chunk-NCIBNERT.js} +4 -4
  277. package/dist/cli-bundle/chunks/{chunk-I2IJY2NL.js.map → chunk-NCIBNERT.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{chunk-TK5VZFHY.js → chunk-NIQHNDBZ.js} +76 -8
  279. package/dist/cli-bundle/chunks/chunk-NIQHNDBZ.js.map +7 -0
  280. package/dist/cli-bundle/chunks/{chunk-C6SAP27O.js → chunk-O46LTCXQ.js} +4 -4
  281. package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js → chunk-OCTQJP42.js} +19 -8
  282. package/dist/cli-bundle/chunks/{chunk-YW6Q3RYZ.js.map → chunk-OCTQJP42.js.map} +2 -2
  283. package/dist/cli-bundle/chunks/{chunk-WPDMBIX6.js → chunk-OLTYNVJR.js} +5 -5
  284. package/dist/cli-bundle/chunks/{chunk-IUKD4W6Z.js → chunk-OY3P2I6B.js} +13 -8
  285. package/dist/cli-bundle/chunks/chunk-OY3P2I6B.js.map +7 -0
  286. package/dist/cli-bundle/chunks/{chunk-SO55HRA5.js → chunk-PZD7WPUC.js} +69 -20
  287. package/dist/cli-bundle/chunks/chunk-PZD7WPUC.js.map +1 -0
  288. package/dist/cli-bundle/chunks/{chunk-HHHJ2GI3.js → chunk-Q5RLUCP3.js} +74 -14
  289. package/dist/cli-bundle/chunks/chunk-Q5RLUCP3.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{chunk-S2ZLDYGS.js → chunk-RKKIH2ZQ.js} +116 -36
  291. package/dist/cli-bundle/chunks/chunk-RKKIH2ZQ.js.map +1 -0
  292. package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js → chunk-SPYPC5CB.js} +3 -3
  293. package/dist/cli-bundle/chunks/{chunk-GWZSYR6X.js.map → chunk-SPYPC5CB.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/{chunk-7AMK6DOW.js → chunk-SY4GKIWT.js} +88 -22
  295. package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +1 -0
  296. package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js → chunk-SY4PZWIZ.js} +7 -4
  297. package/dist/cli-bundle/chunks/{chunk-ZLMIWZUG.js.map → chunk-SY4PZWIZ.js.map} +2 -2
  298. package/dist/cli-bundle/chunks/{chunk-R2OUQVBK.js → chunk-T5VU7ROQ.js} +4 -4
  299. package/dist/cli-bundle/chunks/{chunk-37CYVF73.js → chunk-TIRZIQRP.js} +121 -44
  300. package/dist/cli-bundle/chunks/chunk-TIRZIQRP.js.map +7 -0
  301. package/dist/cli-bundle/chunks/{chunk-7UGSRQCL.js → chunk-TUB3DZAZ.js} +107 -33
  302. package/dist/cli-bundle/chunks/chunk-TUB3DZAZ.js.map +7 -0
  303. package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js +394 -0
  304. package/dist/cli-bundle/chunks/chunk-UAR2VNCK.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js → chunk-UBMCSJXX.js} +3 -3
  306. package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js → chunk-UUKORJSN.js} +4 -4
  307. package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
  308. package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
  309. package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js → chunk-WZCQVABQ.js} +2 -2
  310. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
  311. package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
  312. package/dist/cli-bundle/chunks/{chunk-4YFAGDRH.js → chunk-XLNNCKTN.js} +322 -19
  313. package/dist/cli-bundle/chunks/chunk-XLNNCKTN.js.map +7 -0
  314. package/dist/cli-bundle/chunks/{chunk-RXAP6JL5.js → chunk-XNOY7TCB.js} +118 -74
  315. package/dist/cli-bundle/chunks/chunk-XNOY7TCB.js.map +7 -0
  316. package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js → chunk-YGRPBFMA.js} +2 -2
  317. package/dist/cli-bundle/chunks/{chunk-QNJSITCX.js → chunk-YXTLI4XP.js} +20 -9
  318. package/dist/cli-bundle/chunks/chunk-YXTLI4XP.js.map +1 -0
  319. package/dist/cli-bundle/chunks/{chunk-FDH2X65L.js → chunk-Z3MUNQRV.js} +52 -9
  320. package/dist/cli-bundle/chunks/chunk-Z3MUNQRV.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js → chunk-ZJRDVYZI.js} +4 -4
  322. package/dist/cli-bundle/chunks/{chunk-CCX4RSYZ.js → chunk-ZONXMSVB.js} +10 -9
  323. package/dist/cli-bundle/chunks/chunk-ZONXMSVB.js.map +1 -0
  324. package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js → claim-4APLUXJW.js} +10 -10
  325. package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js → claim-NEO7AGWH.js} +10 -10
  326. package/dist/cli-bundle/chunks/{close-XLEKIQSW.js → close-3QABBNGU.js} +8 -8
  327. package/dist/cli-bundle/chunks/close-ILMZR3D7.js +13 -0
  328. package/dist/cli-bundle/chunks/{close-many-AOD4HSAZ.js → close-many-MIZLTYGL.js} +32 -20
  329. package/dist/cli-bundle/chunks/close-many-MIZLTYGL.js.map +1 -0
  330. package/dist/cli-bundle/chunks/{close-many-XKAQY5CQ.js → close-many-Q7Y5AHQI.js} +31 -19
  331. package/dist/cli-bundle/chunks/close-many-Q7Y5AHQI.js.map +7 -0
  332. package/dist/cli-bundle/chunks/{comments-RN5TG4ZN.js → comments-DAIQPOMU.js} +55 -31
  333. package/dist/cli-bundle/chunks/comments-DAIQPOMU.js.map +1 -0
  334. package/dist/cli-bundle/chunks/{comments-B4RWWDJT.js → comments-IWFSVM4P.js} +54 -30
  335. package/dist/cli-bundle/chunks/comments-IWFSVM4P.js.map +7 -0
  336. package/dist/cli-bundle/chunks/{config-3JXJ3XZ7.js → config-IOJELD6O.js} +45 -19
  337. package/dist/cli-bundle/chunks/config-IOJELD6O.js.map +1 -0
  338. package/dist/cli-bundle/chunks/{config-FZ4UDC4B.js → config-PXTMAYV3.js} +44 -18
  339. package/dist/cli-bundle/chunks/config-PXTMAYV3.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{context-QBPO3BFM.js → context-QHJSCJW4.js} +128 -39
  341. package/dist/cli-bundle/chunks/context-QHJSCJW4.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{context-L36PIN35.js → context-XZS2VFKU.js} +127 -38
  343. package/dist/cli-bundle/chunks/context-XZS2VFKU.js.map +7 -0
  344. package/dist/cli-bundle/chunks/{contracts-2G66IGIA.js → contracts-B7U4OJTV.js} +54 -10
  345. package/dist/cli-bundle/chunks/contracts-B7U4OJTV.js.map +1 -0
  346. package/dist/cli-bundle/chunks/{contracts-PJCHYSO5.js → contracts-NSBVLXQ3.js} +54 -10
  347. package/dist/cli-bundle/chunks/contracts-NSBVLXQ3.js.map +7 -0
  348. package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js → copy-Q64T5FD4.js} +7 -7
  349. package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js → copy-SG34LCMU.js} +7 -7
  350. package/dist/cli-bundle/chunks/create-F5HZX2S4.js +30 -0
  351. package/dist/cli-bundle/chunks/{create-5433DP3G.js → create-IPAX2SNL.js} +16 -13
  352. package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js → delete-TLXR7LJ2.js} +7 -7
  353. package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js → delete-VH3L7DZ6.js} +7 -7
  354. package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js → deps-J3HBBLDB.js} +9 -10
  355. package/dist/cli-bundle/chunks/{deps-CZ4PTVXU.js.map → deps-J3HBBLDB.js.map} +2 -2
  356. package/dist/cli-bundle/chunks/{deps-6TSPOSGU.js → deps-XV6JJ6IN.js} +10 -11
  357. package/dist/cli-bundle/chunks/deps-XV6JJ6IN.js.map +1 -0
  358. package/dist/cli-bundle/chunks/{docs-MXLGZUIT.js → docs-GWDEB7JH.js} +9 -9
  359. package/dist/cli-bundle/chunks/{docs-I3BAF5WH.js → docs-RCLNSKID.js} +9 -9
  360. package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js → extension-5RN65LHT.js} +7 -5
  361. package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js → extension-7KO2NX2A.js} +7 -5
  362. package/dist/cli-bundle/chunks/{files-GUXUM2MB.js → files-3TCQHUHA.js} +25 -11
  363. package/dist/cli-bundle/chunks/files-3TCQHUHA.js.map +1 -0
  364. package/dist/cli-bundle/chunks/{files-FYP3MDPX.js → files-5FDUPSEA.js} +24 -10
  365. package/dist/cli-bundle/chunks/files-5FDUPSEA.js.map +7 -0
  366. package/dist/cli-bundle/chunks/focus-7AQMNRSU.js +109 -0
  367. package/dist/cli-bundle/chunks/focus-7AQMNRSU.js.map +7 -0
  368. package/dist/cli-bundle/chunks/focus-HQXBYPKM.js +106 -0
  369. package/dist/cli-bundle/chunks/focus-HQXBYPKM.js.map +1 -0
  370. package/dist/cli-bundle/chunks/{gc-KGQG66SA.js → gc-2FGKYRJ4.js} +3 -3
  371. package/dist/cli-bundle/chunks/{gc-FENB2ESG.js → gc-5B6ABL3Z.js} +3 -3
  372. package/dist/cli-bundle/chunks/{get-PCHS7RA6.js → get-FUMVOJQD.js} +43 -16
  373. package/dist/cli-bundle/chunks/get-FUMVOJQD.js.map +1 -0
  374. package/dist/cli-bundle/chunks/{get-QARTE6BL.js → get-H5BZTW4A.js} +42 -15
  375. package/dist/cli-bundle/chunks/get-H5BZTW4A.js.map +7 -0
  376. package/dist/cli-bundle/chunks/{health-E4D7KGHD.js → health-JSVOR6B4.js} +75 -49
  377. package/dist/cli-bundle/chunks/health-JSVOR6B4.js.map +1 -0
  378. package/dist/cli-bundle/chunks/{health-7MTXAVR2.js → health-LE2ZQGSM.js} +74 -48
  379. package/dist/cli-bundle/chunks/health-LE2ZQGSM.js.map +7 -0
  380. package/dist/cli-bundle/chunks/{history-7WUAEWHW.js → history-QO4JVJJP.js} +10 -10
  381. package/dist/cli-bundle/chunks/history-SSXGGTVZ.js +20 -0
  382. package/dist/cli-bundle/chunks/{history-compact-LW27IPFK.js → history-compact-ID74DOUI.js} +37 -46
  383. package/dist/cli-bundle/chunks/history-compact-ID74DOUI.js.map +7 -0
  384. package/dist/cli-bundle/chunks/{history-compact-3EJ3L2O7.js → history-compact-SDFRPZ4V.js} +38 -47
  385. package/dist/cli-bundle/chunks/history-compact-SDFRPZ4V.js.map +1 -0
  386. package/dist/cli-bundle/chunks/history-redact-VBH44Y7F.js +21 -0
  387. package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js → history-redact-Z4P5MM3G.js} +13 -11
  388. package/dist/cli-bundle/chunks/{history-repair-OSQOKJ3E.js → history-repair-ANHEYWKF.js} +43 -48
  389. package/dist/cli-bundle/chunks/history-repair-ANHEYWKF.js.map +7 -0
  390. package/dist/cli-bundle/chunks/{history-repair-SBK7P34V.js → history-repair-CKE7GLZR.js} +44 -49
  391. package/dist/cli-bundle/chunks/history-repair-CKE7GLZR.js.map +1 -0
  392. package/dist/cli-bundle/chunks/init-7FBQO77A.js +19 -0
  393. package/dist/cli-bundle/chunks/{init-S5WEGUJY.js → init-K6MSMB37.js} +11 -9
  394. package/dist/cli-bundle/chunks/{learnings-XK3P4ZDR.js → learnings-VIS3NOQV.js} +13 -12
  395. package/dist/cli-bundle/chunks/learnings-VIS3NOQV.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{learnings-HQXSSKZ5.js → learnings-YYNB64GN.js} +14 -13
  397. package/dist/cli-bundle/chunks/learnings-YYNB64GN.js.map +1 -0
  398. package/dist/cli-bundle/chunks/list-7UE44A2R.js +29 -0
  399. package/dist/cli-bundle/chunks/list-UHMA3N2K.js +33 -0
  400. package/dist/cli-bundle/chunks/{notes-5T6P7C5V.js → notes-2HRMV67I.js} +14 -13
  401. package/dist/cli-bundle/chunks/notes-2HRMV67I.js.map +1 -0
  402. package/dist/cli-bundle/chunks/{notes-U5FZCSBT.js → notes-IN3UMA7W.js} +13 -12
  403. package/dist/cli-bundle/chunks/notes-IN3UMA7W.js.map +7 -0
  404. package/dist/cli-bundle/chunks/{plan-2YTQYWGM.js → plan-I3SVH7FV.js} +16 -15
  405. package/dist/cli-bundle/chunks/plan-I3SVH7FV.js.map +1 -0
  406. package/dist/cli-bundle/chunks/{plan-7IVSICR6.js → plan-PAWCCAPW.js} +15 -14
  407. package/dist/cli-bundle/chunks/plan-PAWCCAPW.js.map +7 -0
  408. package/dist/cli-bundle/chunks/{register-list-query-4UPMHONX.js → register-list-query-N7Z7RTDM.js} +31 -22
  409. package/dist/cli-bundle/chunks/register-list-query-N7Z7RTDM.js.map +7 -0
  410. package/dist/cli-bundle/chunks/{register-list-query-7VOW2C3W.js → register-list-query-OTIK4DVA.js} +32 -23
  411. package/dist/cli-bundle/chunks/register-list-query-OTIK4DVA.js.map +1 -0
  412. package/dist/cli-bundle/chunks/{register-mutation-FARSGYRD.js → register-mutation-UFZK6Q57.js} +216 -66
  413. package/dist/cli-bundle/chunks/register-mutation-UFZK6Q57.js.map +7 -0
  414. package/dist/cli-bundle/chunks/{register-mutation-LJDNVREU.js → register-mutation-XFORLS6D.js} +210 -67
  415. package/dist/cli-bundle/chunks/register-mutation-XFORLS6D.js.map +1 -0
  416. package/dist/cli-bundle/chunks/{register-operations-HCJKDUA6.js → register-operations-6ZCLKRBG.js} +53 -39
  417. package/dist/cli-bundle/chunks/register-operations-6ZCLKRBG.js.map +7 -0
  418. package/dist/cli-bundle/chunks/{register-operations-FFTYAL42.js → register-operations-ITE7JTH3.js} +54 -40
  419. package/dist/cli-bundle/chunks/register-operations-ITE7JTH3.js.map +1 -0
  420. package/dist/cli-bundle/chunks/{register-setup-6AVIUOCC.js → register-setup-7RKGE4BQ.js} +18 -21
  421. package/dist/cli-bundle/chunks/register-setup-7RKGE4BQ.js.map +1 -0
  422. package/dist/cli-bundle/chunks/{register-setup-KVNLO5OJ.js → register-setup-7UKEFKT6.js} +17 -20
  423. package/dist/cli-bundle/chunks/register-setup-7UKEFKT6.js.map +7 -0
  424. package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js → restore-NNVPBBVJ.js} +13 -11
  425. package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +19 -0
  426. package/dist/cli-bundle/chunks/{schema-AINZ2IMM.js → schema-3HCLXCFX.js} +27 -9
  427. package/dist/cli-bundle/chunks/schema-3HCLXCFX.js.map +7 -0
  428. package/dist/cli-bundle/chunks/{schema-76HDZJCC.js → schema-3YKCQ3VO.js} +28 -10
  429. package/dist/cli-bundle/chunks/schema-3YKCQ3VO.js.map +1 -0
  430. package/dist/cli-bundle/chunks/{search-JMLFQEPJ.js → search-NQ42NC6A.js} +328 -71
  431. package/dist/cli-bundle/chunks/search-NQ42NC6A.js.map +7 -0
  432. package/dist/cli-bundle/chunks/{search-NL3TSCYB.js → search-V7PZ2ICH.js} +328 -71
  433. package/dist/cli-bundle/chunks/search-V7PZ2ICH.js.map +1 -0
  434. package/dist/cli-bundle/chunks/{stats-BKXCBIGT.js → stats-7KD4PJC5.js} +41 -16
  435. package/dist/cli-bundle/chunks/stats-7KD4PJC5.js.map +7 -0
  436. package/dist/cli-bundle/chunks/{stats-UBD56TGK.js → stats-GRHO6RFB.js} +42 -17
  437. package/dist/cli-bundle/chunks/stats-GRHO6RFB.js.map +1 -0
  438. package/dist/cli-bundle/chunks/{telemetry-ZJXK3H7X.js → telemetry-H5GLXNG5.js} +6 -6
  439. package/dist/cli-bundle/chunks/telemetry-H5GLXNG5.js.map +7 -0
  440. package/dist/cli-bundle/chunks/{telemetry-N454RHG5.js → telemetry-TRRYZXWT.js} +7 -7
  441. package/dist/cli-bundle/chunks/telemetry-TRRYZXWT.js.map +1 -0
  442. package/dist/cli-bundle/chunks/test-6CZNIIGA.js +34 -0
  443. package/dist/cli-bundle/chunks/{test-BQAKIXAT.js → test-7GVQ3VMN.js} +16 -14
  444. package/dist/cli-bundle/chunks/{test-all-7LV3I6S5.js → test-all-3LF2OZD2.js} +23 -16
  445. package/dist/cli-bundle/chunks/test-all-3LF2OZD2.js.map +7 -0
  446. package/dist/cli-bundle/chunks/{test-all-TDYCCBA4.js → test-all-ODVADHV6.js} +24 -17
  447. package/dist/cli-bundle/chunks/test-all-ODVADHV6.js.map +1 -0
  448. package/dist/cli-bundle/chunks/{test-runs-E64M6XS3.js → test-runs-LYT6ZTNQ.js} +62 -65
  449. package/dist/cli-bundle/chunks/test-runs-LYT6ZTNQ.js.map +1 -0
  450. package/dist/cli-bundle/chunks/{test-runs-LXZLULCI.js → test-runs-RVP6VWN7.js} +61 -64
  451. package/dist/cli-bundle/chunks/test-runs-RVP6VWN7.js.map +7 -0
  452. package/dist/cli-bundle/chunks/update-MPGM6SBE.js +28 -0
  453. package/dist/cli-bundle/chunks/update-UN75XW3C.js +24 -0
  454. package/dist/cli-bundle/chunks/{update-many-F4IKDWZB.js → update-many-FCU6RKTO.js} +80 -34
  455. package/dist/cli-bundle/chunks/update-many-FCU6RKTO.js.map +1 -0
  456. package/dist/cli-bundle/chunks/{update-many-NTWZ5YT3.js → update-many-XSEQJ24X.js} +79 -33
  457. package/dist/cli-bundle/chunks/update-many-XSEQJ24X.js.map +7 -0
  458. package/dist/cli-bundle/chunks/{upgrade-37F7JKES.js → upgrade-A6TL3INC.js} +22 -8
  459. package/dist/cli-bundle/chunks/upgrade-A6TL3INC.js.map +7 -0
  460. package/dist/cli-bundle/chunks/{upgrade-L32JA4TZ.js → upgrade-FOB5LHO5.js} +23 -9
  461. package/dist/cli-bundle/chunks/upgrade-FOB5LHO5.js.map +1 -0
  462. package/dist/cli-bundle/chunks/{validate-46KCRHL7.js → validate-7BLDG3AT.js} +222 -31
  463. package/dist/cli-bundle/chunks/validate-7BLDG3AT.js.map +1 -0
  464. package/dist/cli-bundle/chunks/{validate-CRFMPTYD.js → validate-EHL3MI2V.js} +236 -31
  465. package/dist/cli-bundle/chunks/validate-EHL3MI2V.js.map +7 -0
  466. package/dist/cli-bundle/main.js +305 -140
  467. package/dist/cli-bundle/main.js.map +3 -3
  468. package/dist/cli.d.ts +10 -0
  469. package/dist/cli.js +21 -8
  470. package/dist/cli.js.map +1 -1
  471. package/dist/core/diagnostics/remediation.js +7 -2
  472. package/dist/core/diagnostics/remediation.js.map +1 -1
  473. package/dist/core/extensions/extension-capability-aliases.js +7 -33
  474. package/dist/core/extensions/extension-capability-aliases.js.map +1 -1
  475. package/dist/core/extensions/extension-policy.js +14 -15
  476. package/dist/core/extensions/extension-policy.js.map +1 -1
  477. package/dist/core/extensions/item-fields.js +4 -5
  478. package/dist/core/extensions/item-fields.js.map +1 -1
  479. package/dist/core/extensions/loader.d.ts +75 -1
  480. package/dist/core/extensions/loader.js +56 -32
  481. package/dist/core/extensions/loader.js.map +1 -1
  482. package/dist/core/governance/content-fields.d.ts +84 -0
  483. package/dist/core/governance/content-fields.js +182 -0
  484. package/dist/core/governance/content-fields.js.map +1 -0
  485. package/dist/core/governance/issue-codes.d.ts +51 -0
  486. package/dist/core/governance/issue-codes.js +95 -0
  487. package/dist/core/governance/issue-codes.js.map +1 -0
  488. package/dist/core/governance/metadata-coverage.d.ts +168 -0
  489. package/dist/core/governance/metadata-coverage.js +362 -0
  490. package/dist/core/governance/metadata-coverage.js.map +1 -0
  491. package/dist/core/history/history-rewrite.d.ts +22 -0
  492. package/dist/core/history/history-rewrite.js +38 -2
  493. package/dist/core/history/history-rewrite.js.map +1 -1
  494. package/dist/core/history/history.d.ts +7 -0
  495. package/dist/core/history/history.js +6 -2
  496. package/dist/core/history/history.js.map +1 -1
  497. package/dist/core/io/body-file.d.ts +14 -0
  498. package/dist/core/io/body-file.js +47 -0
  499. package/dist/core/io/body-file.js.map +1 -0
  500. package/dist/core/item/item-format.d.ts +46 -1
  501. package/dist/core/item/item-format.js +51 -60
  502. package/dist/core/item/item-format.js.map +1 -1
  503. package/dist/core/item/parse.d.ts +9 -0
  504. package/dist/core/item/parse.js +10 -16
  505. package/dist/core/item/parse.js.map +1 -1
  506. package/dist/core/item/type-registry.d.ts +1 -0
  507. package/dist/core/item/type-registry.js +8 -10
  508. package/dist/core/item/type-registry.js.map +1 -1
  509. package/dist/core/lock/lock.d.ts +26 -0
  510. package/dist/core/lock/lock.js +10 -2
  511. package/dist/core/lock/lock.js.map +1 -1
  512. package/dist/core/output/output.d.ts +7 -0
  513. package/dist/core/output/output.js +6 -2
  514. package/dist/core/output/output.js.map +1 -1
  515. package/dist/core/schema/item-types-file.d.ts +25 -2
  516. package/dist/core/schema/item-types-file.js +78 -6
  517. package/dist/core/schema/item-types-file.js.map +1 -1
  518. package/dist/core/schema/runtime-schema.d.ts +7 -0
  519. package/dist/core/schema/runtime-schema.js +23 -16
  520. package/dist/core/schema/runtime-schema.js.map +1 -1
  521. package/dist/core/search/background-refresh.js +3 -3
  522. package/dist/core/search/background-refresh.js.map +1 -1
  523. package/dist/core/search/cache.d.ts +19 -1
  524. package/dist/core/search/cache.js +11 -3
  525. package/dist/core/search/cache.js.map +1 -1
  526. package/dist/core/search/corpus.d.ts +36 -2
  527. package/dist/core/search/corpus.js +120 -24
  528. package/dist/core/search/corpus.js.map +1 -1
  529. package/dist/core/search/providers.d.ts +19 -0
  530. package/dist/core/search/providers.js +19 -2
  531. package/dist/core/search/providers.js.map +1 -1
  532. package/dist/core/sentry/instrument.d.ts +1 -0
  533. package/dist/core/sentry/instrument.js +6 -2
  534. package/dist/core/sentry/instrument.js.map +1 -1
  535. package/dist/core/session/session-state.d.ts +16 -0
  536. package/dist/core/session/session-state.js +48 -0
  537. package/dist/core/session/session-state.js.map +1 -0
  538. package/dist/core/shared/constants.d.ts +8 -0
  539. package/dist/core/shared/constants.js +11 -2
  540. package/dist/core/shared/constants.js.map +1 -1
  541. package/dist/core/shared/errors.d.ts +3 -0
  542. package/dist/core/shared/errors.js +2 -2
  543. package/dist/core/shared/errors.js.map +1 -1
  544. package/dist/core/shared/text-normalization.js +4 -3
  545. package/dist/core/shared/text-normalization.js.map +1 -1
  546. package/dist/core/shared/time.d.ts +13 -0
  547. package/dist/core/shared/time.js +19 -7
  548. package/dist/core/shared/time.js.map +1 -1
  549. package/dist/core/store/item-store.d.ts +11 -0
  550. package/dist/core/store/item-store.js +16 -23
  551. package/dist/core/store/item-store.js.map +1 -1
  552. package/dist/core/store/settings-validator.d.ts +2 -0
  553. package/dist/core/store/settings-validator.js +25 -2
  554. package/dist/core/store/settings-validator.js.map +1 -1
  555. package/dist/core/store/settings.d.ts +60 -1
  556. package/dist/core/store/settings.js +100 -46
  557. package/dist/core/store/settings.js.map +1 -1
  558. package/dist/core/telemetry/observability.js +10 -8
  559. package/dist/core/telemetry/observability.js.map +1 -1
  560. package/dist/core/telemetry/runtime.d.ts +272 -1
  561. package/dist/core/telemetry/runtime.js +358 -37
  562. package/dist/core/telemetry/runtime.js.map +1 -1
  563. package/dist/core/test/background-runs.d.ts +35 -0
  564. package/dist/core/test/background-runs.js +72 -61
  565. package/dist/core/test/background-runs.js.map +1 -1
  566. package/dist/core/test/run-selectors.js +5 -4
  567. package/dist/core/test/run-selectors.js.map +1 -1
  568. package/dist/core/validate/estimate-defaults.d.ts +39 -0
  569. package/dist/core/validate/estimate-defaults.js +117 -0
  570. package/dist/core/validate/estimate-defaults.js.map +1 -0
  571. package/dist/core/validate/fix-planning.d.ts +21 -3
  572. package/dist/core/validate/fix-planning.js +31 -4
  573. package/dist/core/validate/fix-planning.js.map +1 -1
  574. package/dist/core/validate/missing-link-owners.d.ts +64 -0
  575. package/dist/core/validate/missing-link-owners.js +98 -0
  576. package/dist/core/validate/missing-link-owners.js.map +1 -0
  577. package/dist/mcp/server.d.ts +62 -0
  578. package/dist/mcp/server.js +71 -8
  579. package/dist/mcp/server.js.map +1 -1
  580. package/dist/mcp/tool-definitions.js +17 -4
  581. package/dist/mcp/tool-definitions.js.map +1 -1
  582. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  583. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  584. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  585. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  586. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  587. package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
  588. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  589. package/dist/sdk/cli-contracts/tool-parameter-tables.js +83 -8
  590. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  591. package/dist/sdk/cli-contracts.d.ts +28 -0
  592. package/dist/sdk/cli-contracts.js +164 -11
  593. package/dist/sdk/cli-contracts.js.map +1 -1
  594. package/dist/types.d.ts +17 -1
  595. package/dist/types.js +3 -3
  596. package/dist/types.js.map +1 -1
  597. package/docs/AGENT_GUIDE.md +15 -3
  598. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  599. package/docs/COMMANDS.md +136 -7
  600. package/docs/CONFIGURATION.md +52 -0
  601. package/docs/TESTING.md +6 -4
  602. package/package.json +6 -4
  603. package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
  604. package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
  605. package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
  606. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  607. package/plugins/pm-claude/README.md +6 -14
  608. package/plugins/pm-claude/commands/pm-init.md +1 -1
  609. package/plugins/pm-codex/README.md +1 -1
  610. package/scripts/bundle-cli.mjs +46 -37
  611. package/scripts/finalize-build.mjs +20 -9
  612. package/scripts/prepare-build-cache.mjs +27 -16
  613. package/dist/cli-bundle/chunks/activity-XZIUPGZH.js +0 -16
  614. package/dist/cli-bundle/chunks/aggregate-6OTS3AOO.js.map +0 -1
  615. package/dist/cli-bundle/chunks/aggregate-OD36DJU5.js.map +0 -7
  616. package/dist/cli-bundle/chunks/append-KG55G7S3.js.map +0 -1
  617. package/dist/cli-bundle/chunks/chunk-35P4GT6E.js.map +0 -7
  618. package/dist/cli-bundle/chunks/chunk-37CYVF73.js.map +0 -7
  619. package/dist/cli-bundle/chunks/chunk-3KLPFWZ4.js.map +0 -7
  620. package/dist/cli-bundle/chunks/chunk-4JCSYR6F.js +0 -138
  621. package/dist/cli-bundle/chunks/chunk-4JCSYR6F.js.map +0 -7
  622. package/dist/cli-bundle/chunks/chunk-4YFAGDRH.js.map +0 -7
  623. package/dist/cli-bundle/chunks/chunk-5SCT2JCT.js.map +0 -7
  624. package/dist/cli-bundle/chunks/chunk-73ZPG2I3.js.map +0 -7
  625. package/dist/cli-bundle/chunks/chunk-7AMK6DOW.js.map +0 -1
  626. package/dist/cli-bundle/chunks/chunk-7IYFN5R7.js.map +0 -1
  627. package/dist/cli-bundle/chunks/chunk-7UGSRQCL.js.map +0 -7
  628. package/dist/cli-bundle/chunks/chunk-A6LXQFO7.js.map +0 -1
  629. package/dist/cli-bundle/chunks/chunk-AVGHVVF7.js +0 -128
  630. package/dist/cli-bundle/chunks/chunk-AVGHVVF7.js.map +0 -1
  631. package/dist/cli-bundle/chunks/chunk-AX4GEVQC.js.map +0 -7
  632. package/dist/cli-bundle/chunks/chunk-CCX4RSYZ.js.map +0 -1
  633. package/dist/cli-bundle/chunks/chunk-CW6E4NAT.js.map +0 -1
  634. package/dist/cli-bundle/chunks/chunk-DY6C42S6.js.map +0 -7
  635. package/dist/cli-bundle/chunks/chunk-EWFY7SLA.js.map +0 -1
  636. package/dist/cli-bundle/chunks/chunk-F75JSIOZ.js.map +0 -1
  637. package/dist/cli-bundle/chunks/chunk-FDH2X65L.js.map +0 -1
  638. package/dist/cli-bundle/chunks/chunk-FY4SPXSC.js.map +0 -7
  639. package/dist/cli-bundle/chunks/chunk-GKIZW7SM.js.map +0 -7
  640. package/dist/cli-bundle/chunks/chunk-HHHJ2GI3.js.map +0 -7
  641. package/dist/cli-bundle/chunks/chunk-HI7STVF2.js.map +0 -1
  642. package/dist/cli-bundle/chunks/chunk-I53JBTJW.js.map +0 -7
  643. package/dist/cli-bundle/chunks/chunk-I7NYDZDV.js.map +0 -1
  644. package/dist/cli-bundle/chunks/chunk-IUKD4W6Z.js.map +0 -7
  645. package/dist/cli-bundle/chunks/chunk-KWAXVAXX.js.map +0 -7
  646. package/dist/cli-bundle/chunks/chunk-L5EPZQIC.js.map +0 -7
  647. package/dist/cli-bundle/chunks/chunk-OASDW5UI.js.map +0 -1
  648. package/dist/cli-bundle/chunks/chunk-OLKBSY4N.js.map +0 -7
  649. package/dist/cli-bundle/chunks/chunk-P5BJOMBB.js.map +0 -1
  650. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
  651. package/dist/cli-bundle/chunks/chunk-QKW5D45B.js.map +0 -1
  652. package/dist/cli-bundle/chunks/chunk-QNJSITCX.js.map +0 -1
  653. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
  654. package/dist/cli-bundle/chunks/chunk-RXAP6JL5.js.map +0 -7
  655. package/dist/cli-bundle/chunks/chunk-S2ZLDYGS.js.map +0 -1
  656. package/dist/cli-bundle/chunks/chunk-SO55HRA5.js.map +0 -1
  657. package/dist/cli-bundle/chunks/chunk-TK5VZFHY.js.map +0 -7
  658. package/dist/cli-bundle/chunks/chunk-TNAP7EJX.js.map +0 -7
  659. package/dist/cli-bundle/chunks/chunk-UIG4TW2H.js.map +0 -1
  660. package/dist/cli-bundle/chunks/chunk-UUWGCWBU.js.map +0 -1
  661. package/dist/cli-bundle/chunks/chunk-VFUZV5EB.js.map +0 -7
  662. package/dist/cli-bundle/chunks/chunk-WUNFKP7M.js.map +0 -1
  663. package/dist/cli-bundle/chunks/chunk-XJDGS74Y.js.map +0 -1
  664. package/dist/cli-bundle/chunks/chunk-XWMF3POR.js.map +0 -1
  665. package/dist/cli-bundle/chunks/chunk-ZMW77VWV.js.map +0 -1
  666. package/dist/cli-bundle/chunks/close-4FMAPEMY.js +0 -13
  667. package/dist/cli-bundle/chunks/close-many-AOD4HSAZ.js.map +0 -1
  668. package/dist/cli-bundle/chunks/close-many-XKAQY5CQ.js.map +0 -7
  669. package/dist/cli-bundle/chunks/comments-B4RWWDJT.js.map +0 -7
  670. package/dist/cli-bundle/chunks/comments-RN5TG4ZN.js.map +0 -1
  671. package/dist/cli-bundle/chunks/config-3JXJ3XZ7.js.map +0 -1
  672. package/dist/cli-bundle/chunks/config-FZ4UDC4B.js.map +0 -7
  673. package/dist/cli-bundle/chunks/context-L36PIN35.js.map +0 -7
  674. package/dist/cli-bundle/chunks/context-QBPO3BFM.js.map +0 -1
  675. package/dist/cli-bundle/chunks/contracts-2G66IGIA.js.map +0 -1
  676. package/dist/cli-bundle/chunks/contracts-PJCHYSO5.js.map +0 -7
  677. package/dist/cli-bundle/chunks/create-VWLWS34Z.js +0 -27
  678. package/dist/cli-bundle/chunks/deps-6TSPOSGU.js.map +0 -1
  679. package/dist/cli-bundle/chunks/files-FYP3MDPX.js.map +0 -7
  680. package/dist/cli-bundle/chunks/files-GUXUM2MB.js.map +0 -1
  681. package/dist/cli-bundle/chunks/get-PCHS7RA6.js.map +0 -1
  682. package/dist/cli-bundle/chunks/get-QARTE6BL.js.map +0 -7
  683. package/dist/cli-bundle/chunks/health-7MTXAVR2.js.map +0 -7
  684. package/dist/cli-bundle/chunks/health-E4D7KGHD.js.map +0 -1
  685. package/dist/cli-bundle/chunks/history-L2FQFRTU.js +0 -20
  686. package/dist/cli-bundle/chunks/history-compact-3EJ3L2O7.js.map +0 -1
  687. package/dist/cli-bundle/chunks/history-compact-LW27IPFK.js.map +0 -7
  688. package/dist/cli-bundle/chunks/history-redact-QWQCX5DZ.js +0 -19
  689. package/dist/cli-bundle/chunks/history-repair-OSQOKJ3E.js.map +0 -7
  690. package/dist/cli-bundle/chunks/history-repair-SBK7P34V.js.map +0 -1
  691. package/dist/cli-bundle/chunks/init-4BKRHGWW.js +0 -17
  692. package/dist/cli-bundle/chunks/learnings-HQXSSKZ5.js.map +0 -1
  693. package/dist/cli-bundle/chunks/learnings-XK3P4ZDR.js.map +0 -7
  694. package/dist/cli-bundle/chunks/list-6CL3XFT6.js +0 -23
  695. package/dist/cli-bundle/chunks/list-BYNN4ZEO.js +0 -19
  696. package/dist/cli-bundle/chunks/notes-5T6P7C5V.js.map +0 -1
  697. package/dist/cli-bundle/chunks/notes-U5FZCSBT.js.map +0 -7
  698. package/dist/cli-bundle/chunks/plan-2YTQYWGM.js.map +0 -1
  699. package/dist/cli-bundle/chunks/plan-7IVSICR6.js.map +0 -7
  700. package/dist/cli-bundle/chunks/register-list-query-4UPMHONX.js.map +0 -7
  701. package/dist/cli-bundle/chunks/register-list-query-7VOW2C3W.js.map +0 -1
  702. package/dist/cli-bundle/chunks/register-mutation-FARSGYRD.js.map +0 -7
  703. package/dist/cli-bundle/chunks/register-mutation-LJDNVREU.js.map +0 -1
  704. package/dist/cli-bundle/chunks/register-operations-FFTYAL42.js.map +0 -1
  705. package/dist/cli-bundle/chunks/register-operations-HCJKDUA6.js.map +0 -7
  706. package/dist/cli-bundle/chunks/register-setup-6AVIUOCC.js.map +0 -1
  707. package/dist/cli-bundle/chunks/register-setup-KVNLO5OJ.js.map +0 -7
  708. package/dist/cli-bundle/chunks/restore-CHIOQAQL.js +0 -17
  709. package/dist/cli-bundle/chunks/schema-76HDZJCC.js.map +0 -1
  710. package/dist/cli-bundle/chunks/schema-AINZ2IMM.js.map +0 -7
  711. package/dist/cli-bundle/chunks/search-JMLFQEPJ.js.map +0 -7
  712. package/dist/cli-bundle/chunks/search-NL3TSCYB.js.map +0 -1
  713. package/dist/cli-bundle/chunks/stats-BKXCBIGT.js.map +0 -7
  714. package/dist/cli-bundle/chunks/stats-UBD56TGK.js.map +0 -1
  715. package/dist/cli-bundle/chunks/telemetry-N454RHG5.js.map +0 -1
  716. package/dist/cli-bundle/chunks/telemetry-ZJXK3H7X.js.map +0 -7
  717. package/dist/cli-bundle/chunks/test-O74JFUH5.js +0 -32
  718. package/dist/cli-bundle/chunks/test-all-7LV3I6S5.js.map +0 -7
  719. package/dist/cli-bundle/chunks/test-all-TDYCCBA4.js.map +0 -1
  720. package/dist/cli-bundle/chunks/test-runs-E64M6XS3.js.map +0 -1
  721. package/dist/cli-bundle/chunks/test-runs-LXZLULCI.js.map +0 -7
  722. package/dist/cli-bundle/chunks/update-36JM7YZT.js +0 -21
  723. package/dist/cli-bundle/chunks/update-I246PCLO.js +0 -25
  724. package/dist/cli-bundle/chunks/update-many-F4IKDWZB.js.map +0 -1
  725. package/dist/cli-bundle/chunks/update-many-NTWZ5YT3.js.map +0 -7
  726. package/dist/cli-bundle/chunks/upgrade-37F7JKES.js.map +0 -7
  727. package/dist/cli-bundle/chunks/upgrade-L32JA4TZ.js.map +0 -1
  728. package/dist/cli-bundle/chunks/validate-46KCRHL7.js.map +0 -1
  729. package/dist/cli-bundle/chunks/validate-CRFMPTYD.js.map +0 -7
  730. /package/dist/cli-bundle/chunks/{activity-XZIUPGZH.js.map → activity-5P2KQCTH.js.map} +0 -0
  731. /package/dist/cli-bundle/chunks/{activity-XADJOG6G.js.map → activity-MJGTX4LO.js.map} +0 -0
  732. /package/dist/cli-bundle/chunks/{chunk-ATEES5SX.js.map → chunk-2JEGCDYT.js.map} +0 -0
  733. /package/dist/cli-bundle/chunks/{chunk-XUC4C4PT.js.map → chunk-3WAULYOY.js.map} +0 -0
  734. /package/dist/cli-bundle/chunks/{chunk-QJMGRZO2.js.map → chunk-7AGIXLNK.js.map} +0 -0
  735. /package/dist/cli-bundle/chunks/{chunk-KBPQHXWG.js.map → chunk-AERT7KT3.js.map} +0 -0
  736. /package/dist/cli-bundle/chunks/{chunk-ESANVZF4.js.map → chunk-E6J2PEK6.js.map} +0 -0
  737. /package/dist/cli-bundle/chunks/{chunk-VSRZRLG3.js.map → chunk-F2GC6L3N.js.map} +0 -0
  738. /package/dist/cli-bundle/chunks/{chunk-XTKJSVWH.js.map → chunk-M23HXJL3.js.map} +0 -0
  739. /package/dist/cli-bundle/chunks/{chunk-S26FESD4.js.map → chunk-MJZUZ2QE.js.map} +0 -0
  740. /package/dist/cli-bundle/chunks/{chunk-C6SAP27O.js.map → chunk-O46LTCXQ.js.map} +0 -0
  741. /package/dist/cli-bundle/chunks/{chunk-WPDMBIX6.js.map → chunk-OLTYNVJR.js.map} +0 -0
  742. /package/dist/cli-bundle/chunks/{chunk-R2OUQVBK.js.map → chunk-T5VU7ROQ.js.map} +0 -0
  743. /package/dist/cli-bundle/chunks/{chunk-P5U5EOMA.js.map → chunk-UBMCSJXX.js.map} +0 -0
  744. /package/dist/cli-bundle/chunks/{chunk-ZYNJNPYD.js.map → chunk-UUKORJSN.js.map} +0 -0
  745. /package/dist/cli-bundle/chunks/{chunk-VPEAS7PS.js.map → chunk-WZCQVABQ.js.map} +0 -0
  746. /package/dist/cli-bundle/chunks/{chunk-Y3YKK7CY.js.map → chunk-YGRPBFMA.js.map} +0 -0
  747. /package/dist/cli-bundle/chunks/{chunk-XMBI6TNW.js.map → chunk-ZJRDVYZI.js.map} +0 -0
  748. /package/dist/cli-bundle/chunks/{claim-2RDYMCTP.js.map → claim-4APLUXJW.js.map} +0 -0
  749. /package/dist/cli-bundle/chunks/{claim-MJ7DZFC3.js.map → claim-NEO7AGWH.js.map} +0 -0
  750. /package/dist/cli-bundle/chunks/{close-XLEKIQSW.js.map → close-3QABBNGU.js.map} +0 -0
  751. /package/dist/cli-bundle/chunks/{close-4FMAPEMY.js.map → close-ILMZR3D7.js.map} +0 -0
  752. /package/dist/cli-bundle/chunks/{copy-FWIVTLBO.js.map → copy-Q64T5FD4.js.map} +0 -0
  753. /package/dist/cli-bundle/chunks/{copy-ALU5WMHA.js.map → copy-SG34LCMU.js.map} +0 -0
  754. /package/dist/cli-bundle/chunks/{create-VWLWS34Z.js.map → create-F5HZX2S4.js.map} +0 -0
  755. /package/dist/cli-bundle/chunks/{create-5433DP3G.js.map → create-IPAX2SNL.js.map} +0 -0
  756. /package/dist/cli-bundle/chunks/{delete-Y2SGJBGY.js.map → delete-TLXR7LJ2.js.map} +0 -0
  757. /package/dist/cli-bundle/chunks/{delete-IYTIYAJS.js.map → delete-VH3L7DZ6.js.map} +0 -0
  758. /package/dist/cli-bundle/chunks/{docs-MXLGZUIT.js.map → docs-GWDEB7JH.js.map} +0 -0
  759. /package/dist/cli-bundle/chunks/{docs-I3BAF5WH.js.map → docs-RCLNSKID.js.map} +0 -0
  760. /package/dist/cli-bundle/chunks/{extension-Q34OEWO5.js.map → extension-5RN65LHT.js.map} +0 -0
  761. /package/dist/cli-bundle/chunks/{extension-WH2FOIOZ.js.map → extension-7KO2NX2A.js.map} +0 -0
  762. /package/dist/cli-bundle/chunks/{gc-KGQG66SA.js.map → gc-2FGKYRJ4.js.map} +0 -0
  763. /package/dist/cli-bundle/chunks/{gc-FENB2ESG.js.map → gc-5B6ABL3Z.js.map} +0 -0
  764. /package/dist/cli-bundle/chunks/{history-7WUAEWHW.js.map → history-QO4JVJJP.js.map} +0 -0
  765. /package/dist/cli-bundle/chunks/{history-L2FQFRTU.js.map → history-SSXGGTVZ.js.map} +0 -0
  766. /package/dist/cli-bundle/chunks/{history-redact-QWQCX5DZ.js.map → history-redact-VBH44Y7F.js.map} +0 -0
  767. /package/dist/cli-bundle/chunks/{history-redact-G72A4EJ4.js.map → history-redact-Z4P5MM3G.js.map} +0 -0
  768. /package/dist/cli-bundle/chunks/{init-4BKRHGWW.js.map → init-7FBQO77A.js.map} +0 -0
  769. /package/dist/cli-bundle/chunks/{init-S5WEGUJY.js.map → init-K6MSMB37.js.map} +0 -0
  770. /package/dist/cli-bundle/chunks/{list-BYNN4ZEO.js.map → list-7UE44A2R.js.map} +0 -0
  771. /package/dist/cli-bundle/chunks/{list-6CL3XFT6.js.map → list-UHMA3N2K.js.map} +0 -0
  772. /package/dist/cli-bundle/chunks/{restore-M6AFHMV4.js.map → restore-NNVPBBVJ.js.map} +0 -0
  773. /package/dist/cli-bundle/chunks/{restore-CHIOQAQL.js.map → restore-XXXLQ2XC.js.map} +0 -0
  774. /package/dist/cli-bundle/chunks/{test-O74JFUH5.js.map → test-6CZNIIGA.js.map} +0 -0
  775. /package/dist/cli-bundle/chunks/{test-BQAKIXAT.js.map → test-7GVQ3VMN.js.map} +0 -0
  776. /package/dist/cli-bundle/chunks/{update-I246PCLO.js.map → update-MPGM6SBE.js.map} +0 -0
  777. /package/dist/cli-bundle/chunks/{update-36JM7YZT.js.map → update-UN75XW3C.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { GlobalOptions } from "../../core/shared/command-types.js";
2
- import type { LinkedFile, LinkScope } from "../../types/index.js";
2
+ import type { ItemDocument, LinkedFile, LinkScope } from "../../types/index.js";
3
3
  import { type LinkedPathAuditEntry, type LinkedPathValidation } from "./linked-artifacts.js";
4
4
  export interface FilesCommandOptions {
5
5
  add?: string[];
@@ -55,5 +55,34 @@ export interface FilesDiscoverResult {
55
55
  added: LinkedFile[];
56
56
  skipped_existing: FilesDiscoveryCandidate[];
57
57
  }
58
+ interface TextReference {
59
+ field: string;
60
+ value: string;
61
+ }
62
+ interface RawPathReference {
63
+ field: string;
64
+ value: string;
65
+ }
66
+ declare function normalizeCandidatePathForOutput(value: string): string;
67
+ declare function realpathForContainment(inputPath: string): Promise<string>;
68
+ declare function linkedFileResolvedKey(linkedFile: Pick<LinkedFile, "path" | "scope">, projectRoot: string): string;
69
+ declare function collectTextReferences(value: unknown, fieldPath: string, references: TextReference[]): void;
70
+ declare function collectItemTextReferences(document: ItemDocument): TextReference[];
71
+ declare function cleanupPathToken(value: string): string;
72
+ declare function extractRawPathReferences(references: TextReference[]): RawPathReference[];
73
+ declare function resolveDiscoveredFile(rawPath: string, projectRoot: string): Promise<Pick<LinkedFile, "path" | "scope"> | undefined>;
74
+ declare function discoverReferencedFiles(document: ItemDocument, projectRoot: string): Promise<FilesDiscoveryCandidate[]>;
75
+ export declare const _testOnly: {
76
+ normalizeCandidatePathForOutput: typeof normalizeCandidatePathForOutput;
77
+ realpathForContainment: typeof realpathForContainment;
78
+ linkedFileResolvedKey: typeof linkedFileResolvedKey;
79
+ collectTextReferences: typeof collectTextReferences;
80
+ collectItemTextReferences: typeof collectItemTextReferences;
81
+ cleanupPathToken: typeof cleanupPathToken;
82
+ extractRawPathReferences: typeof extractRawPathReferences;
83
+ resolveDiscoveredFile: typeof resolveDiscoveredFile;
84
+ discoverReferencedFiles: typeof discoverReferencedFiles;
85
+ };
58
86
  export declare function runFiles(id: string, options: FilesCommandOptions, global: GlobalOptions): Promise<FilesResult>;
59
87
  export declare function runFilesDiscover(id: string, options: FilesDiscoverOptions, global: GlobalOptions): Promise<FilesDiscoverResult>;
88
+ export {};
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b10d1d4c-80ae-5c19-b212-1f7203d3c0f4")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="028bb95b-db05-54c7-86ee-545b92957f41")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { pathExists } from "../../core/fs/fs-utils.js";
@@ -44,6 +44,7 @@ function collectTextReferences(value, fieldPath, references) {
44
44
  }
45
45
  if (typeof value === "object" && value !== null) {
46
46
  for (const [key, nested] of Object.entries(value)) {
47
+ /* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */
47
48
  collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);
48
49
  }
49
50
  }
@@ -72,6 +73,7 @@ function extractRawPathReferences(references) {
72
73
  for (const pattern of [absolutePattern, relativePattern]) {
73
74
  pattern.lastIndex = 0;
74
75
  for (const match of reference.value.matchAll(pattern)) {
76
+ /* c8 ignore next -- RegExp match arrays always expose capture [0]. */
75
77
  const token = cleanupPathToken(match[0] ?? "");
76
78
  if (!token || seenInField.has(token)) {
77
79
  continue;
@@ -152,9 +154,21 @@ async function discoverReferencedFiles(document, projectRoot) {
152
154
  const byPath = left.path.localeCompare(right.path);
153
155
  if (byPath !== 0)
154
156
  return byPath;
157
+ /* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */
155
158
  return left.scope.localeCompare(right.scope);
156
159
  });
157
160
  }
161
+ export const _testOnly = {
162
+ normalizeCandidatePathForOutput,
163
+ realpathForContainment,
164
+ linkedFileResolvedKey,
165
+ collectTextReferences,
166
+ collectItemTextReferences,
167
+ cleanupPathToken,
168
+ extractRawPathReferences,
169
+ resolveDiscoveredFile,
170
+ discoverReferencedFiles,
171
+ };
158
172
  export async function runFiles(id, options, global) {
159
173
  const result = await runLinkedArtifacts(id, options, global, {
160
174
  metadataKey: "files",
@@ -172,6 +186,7 @@ export async function runFilesDiscover(id, options, global) {
172
186
  const settings = await readSettings(pmRoot);
173
187
  const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
174
188
  const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
189
+ /* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */
175
190
  if (!located) {
176
191
  throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
177
192
  }
@@ -218,6 +233,7 @@ export async function runFilesDiscover(id, options, global) {
218
233
  const appliedAdds = [];
219
234
  for (const add of discoveredAdds) {
220
235
  const resolvedKey = linkedFileResolvedKey(add, process.cwd());
236
+ /* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */
221
237
  if (existingResolvedKeys.has(resolvedKey)) {
222
238
  continue;
223
239
  }
@@ -226,6 +242,7 @@ export async function runFilesDiscover(id, options, global) {
226
242
  appliedAdds.push(add);
227
243
  }
228
244
  const deduped = dedupeLinkedArtifacts(next);
245
+ /* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */
229
246
  const normalized = options.appendStable ? deduped : sortLinkedArtifacts(deduped);
230
247
  if (normalized.length > 0) {
231
248
  document.metadata.files = normalized;
@@ -234,7 +251,9 @@ export async function runFilesDiscover(id, options, global) {
234
251
  delete document.metadata.files;
235
252
  }
236
253
  return {
254
+ /* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */
237
255
  changedFields: appliedAdds.length > 0 ? ["files"] : [],
256
+ /* c8 ignore next -- warning emission is exercised by race-aware integration tests. */
238
257
  warnings: appliedAdds.length !== discoveredAdds.length ? [`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`] : [],
239
258
  };
240
259
  },
@@ -258,4 +277,4 @@ export async function runFilesDiscover(id, options, global) {
258
277
  };
259
278
  }
260
279
  //# sourceMappingURL=files.js.map
261
- //# debugId=b10d1d4c-80ae-5c19-b212-1f7203d3c0f4
280
+ //# debugId=028bb95b-db05-54c7-86ee-545b92957f41
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","sources":["cli/commands/files.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } 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 { 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 { resolveAuthor } from \"../../core/shared/author.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport type { ItemDocument, LinkedFile, LinkScope } from \"../../types/index.js\";\nimport {\n dedupeLinkedArtifacts,\n normalizeLinkedPath,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\nexport interface FilesCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface FilesDiscoverOptions {\n apply?: boolean;\n appendStable?: boolean;\n note?: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface FilesDiscoveryCandidate {\n path: string;\n scope: LinkScope;\n status: \"addable\" | \"already_linked\";\n source_count: number;\n source_fields: string[];\n original_paths: string[];\n}\n\nexport interface FilesResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\nexport interface FilesDiscoverResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n apply: boolean;\n count: number;\n candidate_count: number;\n addable_count: number;\n added_count: number;\n skipped_existing_count: number;\n candidates: FilesDiscoveryCandidate[];\n added: LinkedFile[];\n skipped_existing: FilesDiscoveryCandidate[];\n}\n\ninterface TextReference {\n field: string;\n value: string;\n}\n\ninterface RawPathReference {\n field: string;\n value: string;\n}\n\nfunction normalizeCandidatePathForOutput(value: string): string {\n return normalizeLinkedPath(path.normalize(value));\n}\n\nasync function realpathForContainment(inputPath: string): Promise<string> {\n try {\n return await fs.realpath(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nfunction linkedFileResolvedKey(linkedFile: Pick<LinkedFile, \"path\" | \"scope\">, projectRoot: string): string {\n const resolvedPath = path.isAbsolute(linkedFile.path)\n ? path.resolve(linkedFile.path)\n : path.resolve(projectRoot, linkedFile.path);\n return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;\n}\n\nfunction collectTextReferences(value: unknown, fieldPath: string, references: TextReference[]): void {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n references.push({ field: fieldPath, value: trimmed });\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry, index) => collectTextReferences(entry, `${fieldPath}[${index}]`, references));\n return;\n }\n if (typeof value === \"object\" && value !== null) {\n for (const [key, nested] of Object.entries(value)) {\n collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);\n }\n }\n}\n\nfunction collectItemTextReferences(document: ItemDocument): TextReference[] {\n const references: TextReference[] = [];\n collectTextReferences(document.metadata, \"metadata\", references);\n collectTextReferences(document.body, \"body\", references);\n return references;\n}\n\nfunction cleanupPathToken(value: string): string {\n let next = value.trim();\n next = next.replace(/^[`\"'<([{]+/u, \"\");\n next = next.replace(/[`\"'>)\\]},;!?]+$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n next = next.replace(/:(?:\\d+)(?::\\d+)?$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n return next;\n}\n\nfunction extractRawPathReferences(references: TextReference[]): RawPathReference[] {\n const rawReferences: RawPathReference[] = [];\n const absolutePattern = /(?:[A-Za-z]:[\\\\/]|\\/)[^\\s\"'`<>()\\[\\]{},;]+/gu;\n const relativePattern =\n /(?:\\.{1,2}[\\\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;\n for (const reference of references) {\n const seenInField = new Set<string>();\n for (const pattern of [absolutePattern, relativePattern]) {\n pattern.lastIndex = 0;\n for (const match of reference.value.matchAll(pattern)) {\n const token = cleanupPathToken(match[0] ?? \"\");\n if (!token || seenInField.has(token)) {\n continue;\n }\n seenInField.add(token);\n rawReferences.push({ field: reference.field, value: token });\n }\n }\n }\n return rawReferences;\n}\n\nasync function resolveDiscoveredFile(\n rawPath: string,\n projectRoot: string,\n): Promise<Pick<LinkedFile, \"path\" | \"scope\"> | undefined> {\n const absolutePath = path.isAbsolute(rawPath) ? path.resolve(rawPath) : path.resolve(projectRoot, rawPath);\n let stats;\n try {\n stats = await fs.stat(absolutePath);\n } catch {\n return undefined;\n }\n if (!stats.isFile()) {\n return undefined;\n }\n const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([\n realpathForContainment(projectRoot),\n realpathForContainment(absolutePath),\n ]);\n if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {\n const relativePath = path.relative(canonicalProjectRoot, canonicalAbsolutePath);\n if (!relativePath || relativePath.startsWith(\"..\") || path.isAbsolute(relativePath)) {\n return undefined;\n }\n return {\n path: normalizeCandidatePathForOutput(relativePath),\n scope: \"project\",\n };\n }\n return {\n path: normalizeCandidatePathForOutput(absolutePath),\n scope: \"global\",\n };\n}\n\nasync function discoverReferencedFiles(document: ItemDocument, projectRoot: string): Promise<FilesDiscoveryCandidate[]> {\n const existingResolvedKeys = new Set((document.metadata.files ?? []).map((entry) => linkedFileResolvedKey(entry, projectRoot)));\n const grouped = new Map<\n string,\n {\n path: string;\n scope: LinkScope;\n sourceFields: Set<string>;\n originalPaths: Set<string>;\n sourceCount: number;\n }\n >();\n const rawReferences = extractRawPathReferences(collectItemTextReferences(document));\n for (const reference of rawReferences) {\n const resolved = await resolveDiscoveredFile(reference.value, projectRoot);\n if (!resolved) {\n continue;\n }\n const key = linkedFileResolvedKey(resolved, projectRoot);\n const existing = grouped.get(key) ?? {\n path: resolved.path,\n scope: resolved.scope,\n sourceFields: new Set<string>(),\n originalPaths: new Set<string>(),\n sourceCount: 0,\n };\n existing.sourceFields.add(reference.field);\n existing.originalPaths.add(reference.value);\n existing.sourceCount += 1;\n grouped.set(key, existing);\n }\n return [...grouped.entries()]\n .map(([key, entry]) => ({\n path: entry.path,\n scope: entry.scope,\n status: existingResolvedKeys.has(key) ? (\"already_linked\" as const) : (\"addable\" as const),\n source_count: entry.sourceCount,\n source_fields: [...entry.sourceFields].sort((left, right) => left.localeCompare(right)),\n original_paths: [...entry.originalPaths].sort((left, right) => left.localeCompare(right)),\n }))\n .sort((left, right) => {\n const byStatus = left.status.localeCompare(right.status);\n if (byStatus !== 0) return byStatus;\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n return left.scope.localeCompare(right.scope);\n });\n}\n\nexport async function runFiles(id: string, options: FilesCommandOptions, global: GlobalOptions): Promise<FilesResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"files\",\n op: \"files_add\",\n bareNoun: \"file\",\n supportsAppendStable: true,\n });\n return renameArtifactsResultKey(result, \"files\") as unknown as FilesResult;\n}\n\nexport async function runFilesDiscover(\n id: string,\n options: FilesDiscoverOptions,\n global: GlobalOptions,\n): Promise<FilesDiscoverResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const candidates = await discoverReferencedFiles(loaded.document, process.cwd());\n const addableCandidates = candidates.filter((candidate) => candidate.status === \"addable\");\n const skippedExisting = candidates.filter((candidate) => candidate.status === \"already_linked\");\n const requestedApply = options.apply === true;\n const note = options.note?.trim() || \"discovered from item text\";\n\n if (!requestedApply || addableCandidates.length === 0) {\n const files = loaded.document.metadata.files ?? [];\n return {\n id: located.id,\n files,\n changed: false,\n apply: requestedApply,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: 0,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added: [],\n skipped_existing: skippedExisting,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const discoveredAdds: LinkedFile[] = addableCandidates.map((candidate) => ({\n path: candidate.path,\n scope: candidate.scope,\n note,\n }));\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"files_discover\",\n author,\n message: options.message ?? \"Discover referenced file links\",\n force: options.force,\n mutate(document) {\n const next = [...(document.metadata.files ?? [])];\n const existingResolvedKeys = new Set(next.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const appliedAdds: LinkedFile[] = [];\n for (const add of discoveredAdds) {\n const resolvedKey = linkedFileResolvedKey(add, process.cwd());\n if (existingResolvedKeys.has(resolvedKey)) {\n continue;\n }\n next.push(add);\n existingResolvedKeys.add(resolvedKey);\n appliedAdds.push(add);\n }\n const deduped = dedupeLinkedArtifacts(next);\n const normalized = options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n document.metadata.files = normalized;\n } else {\n delete document.metadata.files;\n }\n return {\n changedFields: appliedAdds.length > 0 ? [\"files\"] : [],\n warnings: appliedAdds.length !== discoveredAdds.length ? [`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`] : [],\n };\n },\n });\n\n const files = result.item.files ?? [];\n const addedResolvedKeys = new Set(discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const added = files.filter((entry) => addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())));\n return {\n id: result.item.id,\n files,\n changed: added.length > 0,\n apply: true,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: added.length,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added,\n skipped_existing: skippedExisting,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,GAIpB,MAAM,uBAAuB,CAAC;AAuE/B,SAAS,+BAA+B,CAAC,KAAa;IACpD,OAAO,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IACrD,IAAI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CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1G,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;QAClB,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;QACzB,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,eAAe,EAAE,UAAU,CAAC,MAAM;QAClC,aAAa,EAAE,iBAAiB,CAAC,MAAM;QACvC,WAAW,EAAE,KAAK,CAAC,MAAM;QACzB,sBAAsB,EAAE,eAAe,CAAC,MAAM;QAC9C,UAAU;QACV,KAAK;QACL,gBAAgB,EAAE,eAAe;KAClC,CAAC;AACJ,CAAC","debugId":"b10d1d4c-80ae-5c19-b212-1f7203d3c0f4"}
1
+ {"version":3,"file":"files.js","sources":["cli/commands/files.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } 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 { 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 { resolveAuthor } from \"../../core/shared/author.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport type { ItemDocument, LinkedFile, LinkScope } from \"../../types/index.js\";\nimport {\n dedupeLinkedArtifacts,\n normalizeLinkedPath,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\nexport interface FilesCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface FilesDiscoverOptions {\n apply?: boolean;\n appendStable?: boolean;\n note?: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\nexport interface FilesDiscoveryCandidate {\n path: string;\n scope: LinkScope;\n status: \"addable\" | \"already_linked\";\n source_count: number;\n source_fields: string[];\n original_paths: string[];\n}\n\nexport interface FilesResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\nexport interface FilesDiscoverResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n apply: boolean;\n count: number;\n candidate_count: number;\n addable_count: number;\n added_count: number;\n skipped_existing_count: number;\n candidates: FilesDiscoveryCandidate[];\n added: LinkedFile[];\n skipped_existing: FilesDiscoveryCandidate[];\n}\n\ninterface TextReference {\n field: string;\n value: string;\n}\n\ninterface RawPathReference {\n field: string;\n value: string;\n}\n\nfunction normalizeCandidatePathForOutput(value: string): string {\n return normalizeLinkedPath(path.normalize(value));\n}\n\nasync function realpathForContainment(inputPath: string): Promise<string> {\n try {\n return await fs.realpath(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nfunction linkedFileResolvedKey(linkedFile: Pick<LinkedFile, \"path\" | \"scope\">, projectRoot: string): string {\n const resolvedPath = path.isAbsolute(linkedFile.path)\n ? path.resolve(linkedFile.path)\n : path.resolve(projectRoot, linkedFile.path);\n return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;\n}\n\nfunction collectTextReferences(value: unknown, fieldPath: string, references: TextReference[]): void {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n references.push({ field: fieldPath, value: trimmed });\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry, index) => collectTextReferences(entry, `${fieldPath}[${index}]`, references));\n return;\n }\n if (typeof value === \"object\" && value !== null) {\n for (const [key, nested] of Object.entries(value)) {\n /* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */\n collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);\n }\n }\n}\n\nfunction collectItemTextReferences(document: ItemDocument): TextReference[] {\n const references: TextReference[] = [];\n collectTextReferences(document.metadata, \"metadata\", references);\n collectTextReferences(document.body, \"body\", references);\n return references;\n}\n\nfunction cleanupPathToken(value: string): string {\n let next = value.trim();\n next = next.replace(/^[`\"'<([{]+/u, \"\");\n next = next.replace(/[`\"'>)\\]},;!?]+$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n next = next.replace(/:(?:\\d+)(?::\\d+)?$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n return next;\n}\n\nfunction extractRawPathReferences(references: TextReference[]): RawPathReference[] {\n const rawReferences: RawPathReference[] = [];\n const absolutePattern = /(?:[A-Za-z]:[\\\\/]|\\/)[^\\s\"'`<>()\\[\\]{},;]+/gu;\n const relativePattern =\n /(?:\\.{1,2}[\\\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;\n for (const reference of references) {\n const seenInField = new Set<string>();\n for (const pattern of [absolutePattern, relativePattern]) {\n pattern.lastIndex = 0;\n for (const match of reference.value.matchAll(pattern)) {\n /* c8 ignore next -- RegExp match arrays always expose capture [0]. */\n const token = cleanupPathToken(match[0] ?? \"\");\n if (!token || seenInField.has(token)) {\n continue;\n }\n seenInField.add(token);\n rawReferences.push({ field: reference.field, value: token });\n }\n }\n }\n return rawReferences;\n}\n\nasync function resolveDiscoveredFile(\n rawPath: string,\n projectRoot: string,\n): Promise<Pick<LinkedFile, \"path\" | \"scope\"> | undefined> {\n const absolutePath = path.isAbsolute(rawPath) ? path.resolve(rawPath) : path.resolve(projectRoot, rawPath);\n let stats;\n try {\n stats = await fs.stat(absolutePath);\n } catch {\n return undefined;\n }\n if (!stats.isFile()) {\n return undefined;\n }\n const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([\n realpathForContainment(projectRoot),\n realpathForContainment(absolutePath),\n ]);\n if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {\n const relativePath = path.relative(canonicalProjectRoot, canonicalAbsolutePath);\n if (!relativePath || relativePath.startsWith(\"..\") || path.isAbsolute(relativePath)) {\n return undefined;\n }\n return {\n path: normalizeCandidatePathForOutput(relativePath),\n scope: \"project\",\n };\n }\n return {\n path: normalizeCandidatePathForOutput(absolutePath),\n scope: \"global\",\n };\n}\n\nasync function discoverReferencedFiles(document: ItemDocument, projectRoot: string): Promise<FilesDiscoveryCandidate[]> {\n const existingResolvedKeys = new Set((document.metadata.files ?? []).map((entry) => linkedFileResolvedKey(entry, projectRoot)));\n const grouped = new Map<\n string,\n {\n path: string;\n scope: LinkScope;\n sourceFields: Set<string>;\n originalPaths: Set<string>;\n sourceCount: number;\n }\n >();\n const rawReferences = extractRawPathReferences(collectItemTextReferences(document));\n for (const reference of rawReferences) {\n const resolved = await resolveDiscoveredFile(reference.value, projectRoot);\n if (!resolved) {\n continue;\n }\n const key = linkedFileResolvedKey(resolved, projectRoot);\n const existing = grouped.get(key) ?? {\n path: resolved.path,\n scope: resolved.scope,\n sourceFields: new Set<string>(),\n originalPaths: new Set<string>(),\n sourceCount: 0,\n };\n existing.sourceFields.add(reference.field);\n existing.originalPaths.add(reference.value);\n existing.sourceCount += 1;\n grouped.set(key, existing);\n }\n return [...grouped.entries()]\n .map(([key, entry]) => ({\n path: entry.path,\n scope: entry.scope,\n status: existingResolvedKeys.has(key) ? (\"already_linked\" as const) : (\"addable\" as const),\n source_count: entry.sourceCount,\n source_fields: [...entry.sourceFields].sort((left, right) => left.localeCompare(right)),\n original_paths: [...entry.originalPaths].sort((left, right) => left.localeCompare(right)),\n }))\n .sort((left, right) => {\n const byStatus = left.status.localeCompare(right.status);\n if (byStatus !== 0) return byStatus;\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n /* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */\n return left.scope.localeCompare(right.scope);\n });\n}\n\nexport const _testOnly = {\n normalizeCandidatePathForOutput,\n realpathForContainment,\n linkedFileResolvedKey,\n collectTextReferences,\n collectItemTextReferences,\n cleanupPathToken,\n extractRawPathReferences,\n resolveDiscoveredFile,\n discoverReferencedFiles,\n};\n\nexport async function runFiles(id: string, options: FilesCommandOptions, global: GlobalOptions): Promise<FilesResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"files\",\n op: \"files_add\",\n bareNoun: \"file\",\n supportsAppendStable: true,\n });\n return renameArtifactsResultKey(result, \"files\") as unknown as FilesResult;\n}\n\nexport async function runFilesDiscover(\n id: string,\n options: FilesDiscoverOptions,\n global: GlobalOptions,\n): Promise<FilesDiscoverResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n /* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const candidates = await discoverReferencedFiles(loaded.document, process.cwd());\n const addableCandidates = candidates.filter((candidate) => candidate.status === \"addable\");\n const skippedExisting = candidates.filter((candidate) => candidate.status === \"already_linked\");\n const requestedApply = options.apply === true;\n const note = options.note?.trim() || \"discovered from item text\";\n\n if (!requestedApply || addableCandidates.length === 0) {\n const files = loaded.document.metadata.files ?? [];\n return {\n id: located.id,\n files,\n changed: false,\n apply: requestedApply,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: 0,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added: [],\n skipped_existing: skippedExisting,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const discoveredAdds: LinkedFile[] = addableCandidates.map((candidate) => ({\n path: candidate.path,\n scope: candidate.scope,\n note,\n }));\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"files_discover\",\n author,\n message: options.message ?? \"Discover referenced file links\",\n force: options.force,\n mutate(document) {\n const next = [...(document.metadata.files ?? [])];\n const existingResolvedKeys = new Set(next.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const appliedAdds: LinkedFile[] = [];\n for (const add of discoveredAdds) {\n const resolvedKey = linkedFileResolvedKey(add, process.cwd());\n /* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */\n if (existingResolvedKeys.has(resolvedKey)) {\n continue;\n }\n next.push(add);\n existingResolvedKeys.add(resolvedKey);\n appliedAdds.push(add);\n }\n const deduped = dedupeLinkedArtifacts(next);\n /* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */\n const normalized = options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n document.metadata.files = normalized;\n } else {\n delete document.metadata.files;\n }\n return {\n /* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */\n changedFields: appliedAdds.length > 0 ? [\"files\"] : [],\n /* c8 ignore next -- warning emission is exercised by race-aware integration tests. */\n warnings: appliedAdds.length !== discoveredAdds.length ? [`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`] : [],\n };\n },\n });\n\n const files = result.item.files ?? [];\n const addedResolvedKeys = new Set(discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const added = files.filter((entry) => addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())));\n return {\n id: result.item.id,\n files,\n changed: added.length > 0,\n apply: true,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: added.length,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added,\n skipped_existing: skippedExisting,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,GAIpB,MAAM,uBAAuB,CAAC;AAuE/B,SAAS,+BAA+B,CAAC,KAAa;IACpD,OAAO,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IACrD,IAAI,CAAC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IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IACtC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9G,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1G,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;QAClB,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;QACzB,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,eAAe,EAAE,UAAU,CAAC,MAAM;QAClC,aAAa,EAAE,iBAAiB,CAAC,MAAM;QACvC,WAAW,EAAE,KAAK,CAAC,MAAM;QACzB,sBAAsB,EAAE,eAAe,CAAC,MAAM;QAC9C,UAAU;QACV,KAAK;QACL,gBAAgB,EAAE,eAAe;KAClC,CAAC;AACJ,CAAC","debugId":"028bb95b-db05-54c7-86ee-545b92957f41"}
@@ -0,0 +1,11 @@
1
+ import type { GlobalOptions } from "../../core/shared/command-types.js";
2
+ export interface FocusOptions {
3
+ clear?: boolean;
4
+ }
5
+ export interface FocusResult {
6
+ action: "set" | "clear" | "show";
7
+ focused_item: string | null;
8
+ title: string | null;
9
+ message: string;
10
+ }
11
+ export declare function runFocus(id: string | undefined, options: FocusOptions, global: GlobalOptions): Promise<FocusResult>;
@@ -0,0 +1,86 @@
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]="a9f88143-71ca-5c00-b285-5ca0640e3e6a")}catch(e){}}();
3
+ import { pathExists } from "../../core/fs/fs-utils.js";
4
+ import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
5
+ import { normalizeItemId } from "../../core/item/id.js";
6
+ import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
7
+ import { EXIT_CODE } from "../../core/shared/constants.js";
8
+ import { PmCliError } from "../../core/shared/errors.js";
9
+ import { clearFocusedItem, getFocusedItem, setFocusedItem, } from "../../core/session/session-state.js";
10
+ import { buildItemNotFoundError, locateItem, readLocatedItem } from "../../core/store/item-store.js";
11
+ import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
12
+ import { readSettings } from "../../core/store/settings.js";
13
+ async function ensureInitialized(pmRoot) {
14
+ if (!(await pathExists(getSettingsPath(pmRoot)))) {
15
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
16
+ }
17
+ }
18
+ export async function runFocus(id, options, global) {
19
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
20
+ await ensureInitialized(pmRoot);
21
+ const clear = options.clear === true;
22
+ if (clear) {
23
+ if (id !== undefined) {
24
+ throw new PmCliError("pm focus --clear does not take an item id. Use 'pm focus --clear' to clear focus or 'pm focus <id>' to set it.", EXIT_CODE.USAGE);
25
+ }
26
+ await clearFocusedItem(pmRoot);
27
+ return {
28
+ action: "clear",
29
+ focused_item: null,
30
+ title: null,
31
+ message: "Focus cleared. New items will not inherit a default parent.",
32
+ };
33
+ }
34
+ if (id === undefined) {
35
+ const current = await getFocusedItem(pmRoot);
36
+ if (current === undefined) {
37
+ return {
38
+ action: "show",
39
+ focused_item: null,
40
+ title: null,
41
+ message: "No focus set. Use 'pm focus <id>' to set a default parent for new items.",
42
+ };
43
+ }
44
+ const title = await resolveFocusedTitle(pmRoot, current);
45
+ return {
46
+ action: "show",
47
+ focused_item: current,
48
+ title,
49
+ message: `Focused on ${current}${title ? ` (${title})` : ""}. New items default --parent to it.`,
50
+ };
51
+ }
52
+ const settings = await readSettings(pmRoot);
53
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
54
+ const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
55
+ if (!located) {
56
+ throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);
57
+ }
58
+ const normalizedId = normalizeItemId(located.id, settings.id_prefix);
59
+ const loaded = await readLocatedItem(located, { schema: settings.schema });
60
+ const title = nonEmptyTitleOrNull(loaded.document.metadata.title);
61
+ await setFocusedItem(pmRoot, normalizedId);
62
+ return {
63
+ action: "set",
64
+ focused_item: normalizedId,
65
+ title,
66
+ message: `Focused on ${normalizedId}${title ? ` (${title})` : ""}. New items default --parent to it (override with --parent or clear via 'pm focus --clear').`,
67
+ };
68
+ }
69
+ async function resolveFocusedTitle(pmRoot, id) {
70
+ // The tracker is already known to be initialized (ensureInitialized ran), so
71
+ // readSettings/locateItem behave like the `pm get` read path: a deleted/stale
72
+ // focused item simply locates to null and yields no title hint.
73
+ const settings = await readSettings(pmRoot);
74
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
75
+ const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
76
+ if (!located) {
77
+ return null;
78
+ }
79
+ const loaded = await readLocatedItem(located, { schema: settings.schema });
80
+ return nonEmptyTitleOrNull(loaded.document.metadata.title);
81
+ }
82
+ function nonEmptyTitleOrNull(title) {
83
+ return title.trim().length > 0 ? title : null;
84
+ }
85
+ //# sourceMappingURL=focus.js.map
86
+ //# debugId=a9f88143-71ca-5c00-b285-5ca0640e3e6a
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.js","sources":["cli/commands/focus.ts"],"sourceRoot":"/","sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { normalizeItemId } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } 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 {\n clearFocusedItem,\n getFocusedItem,\n setFocusedItem,\n} from \"../../core/session/session-state.js\";\nimport { buildItemNotFoundError, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nexport interface FocusOptions {\n clear?: boolean;\n}\n\nexport interface FocusResult {\n action: \"set\" | \"clear\" | \"show\";\n focused_item: string | null;\n title: string | null;\n message: string;\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nexport async function runFocus(\n id: string | undefined,\n options: FocusOptions,\n global: GlobalOptions,\n): Promise<FocusResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const clear = options.clear === true;\n\n if (clear) {\n if (id !== undefined) {\n throw new PmCliError(\n \"pm focus --clear does not take an item id. Use 'pm focus --clear' to clear focus or 'pm focus <id>' to set it.\",\n EXIT_CODE.USAGE,\n );\n }\n await clearFocusedItem(pmRoot);\n return {\n action: \"clear\",\n focused_item: null,\n title: null,\n message: \"Focus cleared. New items will not inherit a default parent.\",\n };\n }\n\n if (id === undefined) {\n const current = await getFocusedItem(pmRoot);\n if (current === undefined) {\n return {\n action: \"show\",\n focused_item: null,\n title: null,\n message: \"No focus set. Use 'pm focus <id>' to set a default parent for new items.\",\n };\n }\n const title = await resolveFocusedTitle(pmRoot, current);\n return {\n action: \"show\",\n focused_item: current,\n title,\n message: `Focused on ${current}${title ? ` (${title})` : \"\"}. New items default --parent to it.`,\n };\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const normalizedId = normalizeItemId(located.id, settings.id_prefix);\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const title = nonEmptyTitleOrNull(loaded.document.metadata.title);\n await setFocusedItem(pmRoot, normalizedId);\n return {\n action: \"set\",\n focused_item: normalizedId,\n title,\n message: `Focused on ${normalizedId}${title ? ` (${title})` : \"\"}. New items default --parent to it (override with --parent or clear via 'pm focus --clear').`,\n };\n}\n\nasync function resolveFocusedTitle(pmRoot: string, id: string): Promise<string | null> {\n // The tracker is already known to be initialized (ensureInitialized ran), so\n // readSettings/locateItem behave like the `pm get` read path: a deleted/stale\n // focused item simply locates to null and yields no title hint.\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n return null;\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n return nonEmptyTitleOrNull(loaded.document.metadata.title);\n}\n\nfunction nonEmptyTitleOrNull(title: string): string | null {\n return title.trim().length > 0 ? title : null;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAA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CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,OAAO;QACL,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,YAAY;QAC1B,KAAK;QACL,OAAO,EAAE,cAAc,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,8FAA8F;KAC/J,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,MAAc,EAAE,EAAU;IAC3D,6EAA6E;IAC7E,8EAA8E;IAC9E,gEAAgE;IAChE,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,uBAAuB,CAAC,QAAQ,EAAE,+BAA+B,EAAE,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IACpH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3E,OAAO,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAChD,CAAC","debugId":"a9f88143-71ca-5c00-b285-5ca0640e3e6a"}
@@ -11,15 +11,22 @@ interface ClaimStateContext {
11
11
  last_claim: ClaimHistoryContext | null;
12
12
  last_release: ClaimHistoryContext | null;
13
13
  }
14
+ interface ChildRollupContext {
15
+ count: number;
16
+ active: number;
17
+ by_status: Record<string, number>;
18
+ }
14
19
  export interface GetResult {
15
- item: Partial<ItemFrontMatter>;
16
- body?: string;
20
+ item: Partial<ItemFrontMatter> & {
21
+ body?: string;
22
+ };
17
23
  linked?: {
18
24
  files: LinkedFile[];
19
25
  tests: LinkedTest[];
20
26
  docs: LinkedDoc[];
21
27
  };
22
28
  claim_state?: ClaimStateContext;
29
+ children?: ChildRollupContext;
23
30
  tree?: {
24
31
  root_id: string;
25
32
  root_title: string | null;
@@ -1,17 +1,21 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a8eb7675-53ef-5cf4-a41e-4eb9f5b44a5c")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3acff4cb-422c-553e-97da-83a2e9007a07")}catch(e){}}();
3
3
  import { pathExists } from "../../core/fs/fs-utils.js";
4
4
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
5
5
  import { toItemRecord } from "../../core/item/item-record.js";
6
6
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
7
- import { resolveRuntimeFieldRegistry } from "../../core/schema/runtime-schema.js";
7
+ import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from "../../core/schema/runtime-schema.js";
8
+ import { isTerminalStatus } from "../../core/item/status.js";
8
9
  import { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from "../../core/shared/constants.js";
9
10
  import { PmCliError } from "../../core/shared/errors.js";
10
- import { buildItemNotFoundError, locateItem, readLocatedItem } from "../../core/store/item-store.js";
11
+ import { buildItemNotFoundError, listAllFrontMatterLight, locateItem, readLocatedItem } from "../../core/store/item-store.js";
11
12
  import { getHistoryPath, getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
12
13
  import { readSettings } from "../../core/store/settings.js";
13
14
  import { parseIntegerLimit } from "../shared-parsers.js";
14
15
  import { readHistoryEntries } from "./history.js";
16
+ // GH-155 (pm-gcm3): only container types get the inline child rollup so leaf
17
+ // item reads keep avoiding the corpus scan that the rollup requires.
18
+ const CHILD_ROLLUP_TYPES = new Set(["milestone", "epic"]);
15
19
  const GET_DEPTH_VALUES = ["brief", "standard", "deep"];
16
20
  function toClaimHistoryContext(entry) {
17
21
  return {
@@ -73,7 +77,7 @@ function validateGetFields(fields, runtimeMetadataKeys) {
73
77
  return;
74
78
  }
75
79
  const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);
76
- const allowedRootFields = new Set(["body", "linked", "claim_state"]);
80
+ const allowedRootFields = new Set(["body", "linked", "claim_state", "children"]);
77
81
  const allowedLinkedFields = new Set(["linked.files", "linked.tests", "linked.docs"]);
78
82
  const allowedClaimStateFields = new Set(["claim_state.claimed", "claim_state.assignee", "claim_state.last_claim", "claim_state.last_release"]);
79
83
  const unknown = fields.filter((field) => {
@@ -166,7 +170,7 @@ export async function runGet(id, global, options = {}) {
166
170
  : projectItemForDepth(loaded.document.metadata, depth),
167
171
  };
168
172
  if (includeBody) {
169
- result.body = loaded.document.body;
173
+ result.item.body = loaded.document.body;
170
174
  }
171
175
  if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {
172
176
  result.linked = {
@@ -178,6 +182,30 @@ export async function runGet(id, global, options = {}) {
178
182
  if (claimState) {
179
183
  result.claim_state = claimState;
180
184
  }
185
+ const itemType = loaded.document.metadata.type.trim().toLowerCase();
186
+ const includeChildren = fieldProjection
187
+ ? fieldsIncludeRoot(fields, "children")
188
+ : depth !== "brief" && CHILD_ROLLUP_TYPES.has(itemType);
189
+ if (includeChildren) {
190
+ const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
191
+ const corpus = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);
192
+ const byStatus = {};
193
+ let active = 0;
194
+ let count = 0;
195
+ const locatedId = located.id.trim().toLowerCase();
196
+ for (const candidate of corpus) {
197
+ const parentId = typeof candidate.parent === "string" ? candidate.parent.trim().toLowerCase() : "";
198
+ if (parentId !== locatedId)
199
+ continue;
200
+ const candidateStatus = candidate.status.trim().toLowerCase();
201
+ count += 1;
202
+ byStatus[candidateStatus] = (byStatus[candidateStatus] ?? 0) + 1;
203
+ if (!isTerminalStatus(candidateStatus, statusRegistry)) {
204
+ active += 1;
205
+ }
206
+ }
207
+ result.children = { count, active, by_status: byStatus };
208
+ }
181
209
  if (options.tree === true) {
182
210
  const { runList } = await import("./list.js");
183
211
  const subtree = await runList(undefined, {
@@ -197,4 +225,4 @@ export async function runGet(id, global, options = {}) {
197
225
  return result;
198
226
  }
199
227
  //# sourceMappingURL=get.js.map
200
- //# debugId=a8eb7675-53ef-5cf4-a41e-4eb9f5b44a5c
228
+ //# debugId=3acff4cb-422c-553e-97da-83a2e9007a07
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sources":["cli/commands/get.ts"],"sourceRoot":"/","sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { buildItemNotFoundError, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport type { ItemFrontMatter, LinkedDoc, LinkedFile, LinkedTest } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\nexport interface GetResult {\n item: Partial<ItemFrontMatter>;\n body?: string;\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n claim_state?: ClaimStateContext;\n tree?: {\n root_id: string;\n root_title: string | null;\n depth_limit: number | null;\n count: number;\n items: Record<string, unknown>[];\n };\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\nexport interface GetOptions {\n depth?: string;\n fields?: string;\n full?: boolean;\n tree?: boolean;\n treeDepth?: string;\n}\n\nfunction toClaimHistoryContext(\n entry: ClaimHistoryEntry,\n): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history].reverse().find((entry) => entry.op === \"claim\");\n const lastRelease = [...history].reverse().find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\"Get --depth must be one of brief|standard|deep|full\", EXIT_CODE.USAGE);\n}\n\nfunction projectItemForDepth(item: ItemFrontMatter, depth: GetDepth): Partial<ItemFrontMatter> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(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(\"Get --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(fields: string[] | null, runtimeMetadataKeys: Iterable<string>): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);\n const allowedRootFields = new Set([\"body\", \"linked\", \"claim_state\"]);\n const allowedLinkedFields = new Set([\"linked.files\", \"linked.tests\", \"linked.docs\"]);\n const allowedClaimStateFields = new Set([\"claim_state.claimed\", \"claim_state.assignee\", \"claim_state.last_claim\", \"claim_state.last_release\"]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown get --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n });\n }\n}\n\nfunction projectItemForFields(item: ItemFrontMatter, fields: string[]): Partial<ItemFrontMatter> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n if (normalized === \"body\" || normalized === \"linked\" || normalized.startsWith(\"linked.\")) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemFrontMatter>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return fields?.some((field) => field === name || field === `item.${name}`) ?? false;\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\nexport async function runGet(id: string, global: GlobalOptions, options: GetOptions = {}): Promise<GetResult> {\n if (options.full && (options.fields !== undefined || options.depth !== undefined)) {\n throw new PmCliError(\"Get projection options are mutually exclusive; remove the extra projection flag and retry.\", EXIT_CODE.USAGE);\n }\n if (options.tree !== true && options.treeDepth !== undefined) {\n throw new PmCliError(\"Get --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n const depth = options.full ? \"deep\" : parseGetDepth(options.depth);\n const treeDepth = options.tree === true ? parseIntegerLimit(options.treeDepth, \"--tree-depth\") : undefined;\n const fields = parseGetFields(options.fields);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const runtimeMetadataKeys: string[] = [];\n for (const field of resolveRuntimeFieldRegistry(settings.schema).definitions) {\n runtimeMetadataKeys.push(field.metadata_key);\n }\n validateGetFields(fields, runtimeMetadataKeys);\n const files = loaded.document.metadata.files ?? [];\n const tests = loaded.document.metadata.tests ?? [];\n const docs = loaded.document.metadata.docs ?? [];\n const fieldProjection = fields !== null;\n const includeBody = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"body\");\n const includeLinked = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"linked\");\n const includeLinkedFiles = includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests = includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs = includeLinked || fieldsInclude(fields, \"linked.docs\");\n const includeClaimState = !fieldProjection ? depth !== \"brief\" : fieldsIncludeRoot(fields, \"claim_state\");\n let claimState: ClaimStateContext | undefined;\n if (includeClaimState) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n let history: ClaimHistoryEntry[] = [];\n try {\n history = await readHistoryEntries(historyPath, located.id);\n } catch {\n history = [];\n }\n claimState = resolveClaimStateContext(loaded.document.metadata.assignee, history);\n }\n const result: GetResult = {\n item: fieldProjection\n ? projectItemForFields(loaded.document.metadata, fields)\n : projectItemForDepth(loaded.document.metadata, depth),\n };\n if (includeBody) {\n result.body = loaded.document.body;\n }\n if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {\n result.linked = {\n files: includeLinkedFiles ? files : [],\n tests: includeLinkedTests ? tests : [],\n docs: includeLinkedDocs ? docs : [],\n };\n }\n if (claimState) {\n result.claim_state = claimState;\n }\n if (options.tree === true) {\n const { runList } = await import(\"./list.js\");\n const subtree = await runList(\n undefined,\n {\n parent: located.id,\n tree: true,\n treeDepth: treeDepth === undefined ? undefined : String(treeDepth),\n full: true,\n },\n global,\n );\n result.tree = {\n root_id: located.id,\n root_title: loaded.document.metadata.title,\n depth_limit: treeDepth ?? null,\n count: subtree.count,\n items: subtree.items.map((entry) => toItemRecord(entry)),\n };\n }\n return result;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAwClD,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAYhE,SAAS,qBAAqB,CAC5B,KAAwB;IAExB,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,aAAiC,EACjC,OAA4B;IAE5B,MAAM,QAAQ,GAAG,aAAa,EAAE,IAAI,EAAE,CAAC;IACvC,MAAM,kBAAkB,GAAG,QAAQ,IAAI,QAAQ,CA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AAI,EAAE,CAAC;QAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,MAAM,OAAO,CAC3B,SAAS,EACT;YACE,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;YAClE,IAAI,EAAE,IAAI;SACX,EACD,MAAM,CACP,CAAC;QACF,MAAM,CAAC,IAAI,GAAG;YACZ,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK;YAC1C,WAAW,EAAE,SAAS,IAAI,IAAI;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SACzD,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"a8eb7675-53ef-5cf4-a41e-4eb9f5b44a5c"}
1
+ {"version":3,"file":"get.js","sources":["cli/commands/get.ts"],"sourceRoot":"/","sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { buildItemNotFoundError, listAllFrontMatterLight, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport type { ItemFrontMatter, LinkedDoc, LinkedFile, LinkedTest } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\ninterface ChildRollupContext {\n count: number;\n active: number;\n by_status: Record<string, number>;\n}\n\n// GH-155 (pm-gcm3): only container types get the inline child rollup so leaf\n// item reads keep avoiding the corpus scan that the rollup requires.\nconst CHILD_ROLLUP_TYPES = new Set([\"milestone\", \"epic\"]);\n\nexport interface GetResult {\n // `body` lives inside `item` (alongside `description`/`acceptance_criteria`)\n // for parity with `pm list --include-body`, so agents reliably find it at\n // `.item.body` in JSON output instead of a top-level sibling.\n item: Partial<ItemFrontMatter> & { body?: string };\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n claim_state?: ClaimStateContext;\n children?: ChildRollupContext;\n tree?: {\n root_id: string;\n root_title: string | null;\n depth_limit: number | null;\n count: number;\n items: Record<string, unknown>[];\n };\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\nexport interface GetOptions {\n depth?: string;\n fields?: string;\n full?: boolean;\n tree?: boolean;\n treeDepth?: string;\n}\n\nfunction toClaimHistoryContext(\n entry: ClaimHistoryEntry,\n): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history].reverse().find((entry) => entry.op === \"claim\");\n const lastRelease = [...history].reverse().find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\"Get --depth must be one of brief|standard|deep|full\", EXIT_CODE.USAGE);\n}\n\nfunction projectItemForDepth(item: ItemFrontMatter, depth: GetDepth): Partial<ItemFrontMatter> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(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(\"Get --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(fields: string[] | null, runtimeMetadataKeys: Iterable<string>): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);\n const allowedRootFields = new Set([\"body\", \"linked\", \"claim_state\", \"children\"]);\n const allowedLinkedFields = new Set([\"linked.files\", \"linked.tests\", \"linked.docs\"]);\n const allowedClaimStateFields = new Set([\"claim_state.claimed\", \"claim_state.assignee\", \"claim_state.last_claim\", \"claim_state.last_release\"]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown get --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n });\n }\n}\n\nfunction projectItemForFields(item: ItemFrontMatter, fields: string[]): Partial<ItemFrontMatter> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n if (normalized === \"body\" || normalized === \"linked\" || normalized.startsWith(\"linked.\")) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemFrontMatter>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return fields?.some((field) => field === name || field === `item.${name}`) ?? false;\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\nexport async function runGet(id: string, global: GlobalOptions, options: GetOptions = {}): Promise<GetResult> {\n if (options.full && (options.fields !== undefined || options.depth !== undefined)) {\n throw new PmCliError(\"Get projection options are mutually exclusive; remove the extra projection flag and retry.\", EXIT_CODE.USAGE);\n }\n if (options.tree !== true && options.treeDepth !== undefined) {\n throw new PmCliError(\"Get --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n const depth = options.full ? \"deep\" : parseGetDepth(options.depth);\n const treeDepth = options.tree === true ? parseIntegerLimit(options.treeDepth, \"--tree-depth\") : undefined;\n const fields = parseGetFields(options.fields);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const runtimeMetadataKeys: string[] = [];\n for (const field of resolveRuntimeFieldRegistry(settings.schema).definitions) {\n runtimeMetadataKeys.push(field.metadata_key);\n }\n validateGetFields(fields, runtimeMetadataKeys);\n const files = loaded.document.metadata.files ?? [];\n const tests = loaded.document.metadata.tests ?? [];\n const docs = loaded.document.metadata.docs ?? [];\n const fieldProjection = fields !== null;\n const includeBody = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"body\");\n const includeLinked = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"linked\");\n const includeLinkedFiles = includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests = includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs = includeLinked || fieldsInclude(fields, \"linked.docs\");\n const includeClaimState = !fieldProjection ? depth !== \"brief\" : fieldsIncludeRoot(fields, \"claim_state\");\n let claimState: ClaimStateContext | undefined;\n if (includeClaimState) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n let history: ClaimHistoryEntry[] = [];\n try {\n history = await readHistoryEntries(historyPath, located.id);\n } catch {\n history = [];\n }\n claimState = resolveClaimStateContext(loaded.document.metadata.assignee, history);\n }\n const result: GetResult = {\n item: fieldProjection\n ? projectItemForFields(loaded.document.metadata, fields)\n : projectItemForDepth(loaded.document.metadata, depth),\n };\n if (includeBody) {\n result.item.body = loaded.document.body;\n }\n if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {\n result.linked = {\n files: includeLinkedFiles ? files : [],\n tests: includeLinkedTests ? tests : [],\n docs: includeLinkedDocs ? docs : [],\n };\n }\n if (claimState) {\n result.claim_state = claimState;\n }\n const itemType = loaded.document.metadata.type.trim().toLowerCase();\n const includeChildren = fieldProjection\n ? fieldsIncludeRoot(fields, \"children\")\n : depth !== \"brief\" && CHILD_ROLLUP_TYPES.has(itemType);\n if (includeChildren) {\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const corpus = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema);\n const byStatus: Record<string, number> = {};\n let active = 0;\n let count = 0;\n const locatedId = located.id.trim().toLowerCase();\n for (const candidate of corpus) {\n const parentId = typeof candidate.parent === \"string\" ? candidate.parent.trim().toLowerCase() : \"\";\n if (parentId !== locatedId) continue;\n const candidateStatus = candidate.status.trim().toLowerCase();\n count += 1;\n byStatus[candidateStatus] = (byStatus[candidateStatus] ?? 0) + 1;\n if (!isTerminalStatus(candidateStatus, statusRegistry)) {\n active += 1;\n }\n }\n result.children = { count, active, by_status: byStatus };\n }\n if (options.tree === true) {\n const { runList } = await import(\"./list.js\");\n const subtree = await runList(\n undefined,\n {\n parent: located.id,\n tree: true,\n treeDepth: treeDepth === undefined ? undefined : String(treeDepth),\n full: true,\n },\n global,\n );\n result.tree = {\n root_id: located.id,\n root_title: loaded.document.metadata.title,\n depth_limit: treeDepth ?? null,\n count: subtree.count,\n items: subtree.items.map((entry) => toItemRecord(entry)),\n };\n }\n return result;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EA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vD,MAAM,IAAI,CAAC,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,CAAC,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC3D,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,MAAM,OAAO,CAC3B,SAAS,EACT;YACE,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;YAClE,IAAI,EAAE,IAAI;SACX,EACD,MAAM,CACP,CAAC;QACF,MAAM,CAAC,IAAI,GAAG;YACZ,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK;YAC1C,WAAW,EAAE,SAAS,IAAI,IAAI;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SACzD,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"3acff4cb-422c-553e-97da-83a2e9007a07"}
@@ -51,5 +51,10 @@ export interface GuideTopicResult {
51
51
  }
52
52
  export type GuideResult = GuideIndexResult | GuideTopicResult;
53
53
  export declare function resolveGuideOutputFormat(options: GuideOptions, global: GlobalOptions): GuideOutputFormat;
54
+ declare function ensureGuideTopic(topic: string): GuideTopicDefinition;
54
55
  export declare function runGuide(options: GuideOptions, global: GlobalOptions): Promise<GuideResult>;
56
+ export declare const _testOnlyGuide: {
57
+ ensureGuideTopic: typeof ensureGuideTopic;
58
+ };
55
59
  export declare function renderGuideMarkdown(result: GuideResult): string;
60
+ export {};
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8d06806e-bba1-5626-9ff4-b7fda8387582")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="307416ac-f9a5-5a5c-871c-ea3f91a3d6e6")}catch(e){}}();
3
3
  import { readFile } from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { resolveConfiguredPmPackageRoot } from "../../core/packages/root.js";
@@ -158,7 +158,7 @@ function ensureGuideTopic(topic) {
158
158
  return resolved;
159
159
  }
160
160
  const available = listGuideTopicIds().join(", ");
161
- throw new PmCliError(`Unknown guide topic "${topic ?? ""}". Available topics: ${available}. Use "pm guide --list" to browse.`, EXIT_CODE.USAGE);
161
+ throw new PmCliError(`Unknown guide topic "${topic}". Available topics: ${available}. Use "pm guide --list" to browse.`, EXIT_CODE.USAGE);
162
162
  }
163
163
  export async function runGuide(options, global) {
164
164
  const depth = parseGuideDepth(typeof options.depth === "string" ? options.depth : undefined);
@@ -183,6 +183,9 @@ export async function runGuide(options, global) {
183
183
  warnings,
184
184
  };
185
185
  }
186
+ export const _testOnlyGuide = {
187
+ ensureGuideTopic,
188
+ };
186
189
  function markdownCodeFence(content) {
187
190
  return content.replaceAll("```", "``\\`");
188
191
  }
@@ -255,4 +258,4 @@ export function renderGuideMarkdown(result) {
255
258
  return lines.join("\n");
256
259
  }
257
260
  //# sourceMappingURL=guide.js.map
258
- //# debugId=8d06806e-bba1-5626-9ff4-b7fda8387582
261
+ //# debugId=307416ac-f9a5-5a5c-871c-ea3f91a3d6e6