@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 +1 @@
1
- {"version":3,"file":"guide.js","sources":["cli/commands/guide.ts"],"sourceRoot":"/","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { resolveConfiguredPmPackageRoot } from \"../../core/packages/root.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 listGuideTopicIds,\n listGuideTopics,\n resolveGuideTopic,\n type GuideTopicDefinition,\n} from \"../guide-topics.js\";\n\nexport const GUIDE_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\nexport type GuideOutputFormat = (typeof GUIDE_OUTPUT_VALUES)[number];\n\nexport const GUIDE_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type GuideDepth = (typeof GUIDE_DEPTH_VALUES)[number];\n\nexport interface GuideOptions {\n topic?: string;\n list?: boolean;\n format?: string;\n depth?: string;\n [key: string]: unknown;\n}\n\nexport interface GuideDocRender {\n path: string;\n purpose: string;\n optional: boolean;\n exists: boolean;\n line_count: number | null;\n content_mode: \"none\" | \"excerpt\" | \"full\";\n content: string | null;\n truncated: boolean;\n}\n\nexport interface GuideIndexResult {\n output_default: \"toon\";\n mode: \"index\";\n depth: GuideDepth;\n topics: Array<{\n id: string;\n aliases: string[];\n title: string;\n summary: string;\n intent: string;\n quick_commands: string[];\n docs: Array<{ path: string; purpose: string }>;\n related: string[];\n }>;\n suggested_next_steps: string[];\n}\n\nexport interface GuideTopicResult {\n output_default: \"toon\";\n mode: \"topic\";\n depth: GuideDepth;\n requested_topic: string;\n topic: GuideTopicDefinition;\n docs: GuideDocRender[];\n warnings: string[];\n}\n\nexport type GuideResult = GuideIndexResult | GuideTopicResult;\n\nfunction parseGuideOutputFormat(raw: string | undefined): GuideOutputFormat | undefined {\n if (!raw) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_OUTPUT_VALUES.includes(normalized as GuideOutputFormat)) {\n throw new PmCliError(\"Guide format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as GuideOutputFormat;\n}\n\nexport function resolveGuideOutputFormat(options: GuideOptions, global: GlobalOptions): GuideOutputFormat {\n const commandFormat = parseGuideOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\nfunction parseGuideDepth(raw: string | undefined): GuideDepth {\n if (!raw) {\n return \"brief\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_DEPTH_VALUES.includes(normalized as GuideDepth)) {\n throw new PmCliError(\"Guide depth must be one of brief|standard|deep\", EXIT_CODE.USAGE);\n }\n return normalized as GuideDepth;\n}\n\nfunction resolvePackageRoot(): string {\n return resolveConfiguredPmPackageRoot(process.env, \"PM_CLI_PACKAGE_ROOT\", import.meta.url, [\"..\", \"..\", \"..\"]);\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replaceAll(\"\\r\\n\", \"\\n\");\n}\n\nfunction toExcerpt(content: string, maxLines: number, maxCharacters: number): { excerpt: string; truncated: boolean; lineCount: number } {\n const normalized = normalizeLineEndings(content);\n const lines = normalized.split(\"\\n\");\n const lineSlice = lines.slice(0, maxLines);\n let excerpt = lineSlice.join(\"\\n\");\n let truncated = lines.length > maxLines;\n if (excerpt.length > maxCharacters) {\n excerpt = excerpt.slice(0, maxCharacters);\n truncated = true;\n }\n return {\n excerpt: excerpt.trimEnd(),\n truncated,\n lineCount: lines.length,\n };\n}\n\nasync function renderGuideDocs(topic: GuideTopicDefinition, depth: GuideDepth, packageRoot: string): Promise<GuideDocRender[]> {\n const includeContent = depth !== \"brief\";\n const contentMode: GuideDocRender[\"content_mode\"] = includeContent ? (depth === \"deep\" ? \"full\" : \"excerpt\") : \"none\";\n const docs: GuideDocRender[] = [];\n for (const doc of topic.docs) {\n const absolutePath = path.resolve(packageRoot, doc.path);\n if (!includeContent) {\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n continue;\n }\n try {\n const rawContent = await readFile(absolutePath, \"utf8\");\n if (depth === \"deep\") {\n const normalized = normalizeLineEndings(rawContent).trimEnd();\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: normalized.length === 0 ? 0 : normalized.split(\"\\n\").length,\n content_mode: \"full\",\n content: normalized,\n truncated: false,\n });\n } else {\n const excerpt = toExcerpt(rawContent, 120, 12_000);\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: excerpt.lineCount,\n content_mode: contentMode,\n content: excerpt.excerpt,\n truncated: excerpt.truncated,\n });\n }\n } catch (error) {\n const code = (error as { code?: string } | null)?.code;\n const missing = code === \"ENOENT\";\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: false,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n if (!missing) {\n throw new PmCliError(`Failed to read guide document \"${doc.path}\".`, EXIT_CODE.GENERIC_FAILURE);\n }\n }\n }\n return docs;\n}\n\nfunction buildGuideIndex(depth: GuideDepth): GuideIndexResult {\n const topics = listGuideTopics().map((topic) => ({\n id: topic.id,\n aliases: topic.aliases,\n title: topic.title,\n summary: topic.summary,\n intent: topic.intent,\n quick_commands: depth === \"brief\" ? topic.commands.slice(0, 3) : topic.commands.slice(0, 6),\n docs: topic.docs.map((doc) => ({ path: doc.path, purpose: doc.purpose })),\n related: topic.related,\n }));\n return {\n output_default: \"toon\",\n mode: \"index\",\n depth,\n topics,\n suggested_next_steps: [\n \"pm guide <topic>\",\n \"pm guide <topic> --depth standard\",\n \"pm guide <topic> --depth deep --format markdown\",\n \"pm guide <topic> --json\",\n ],\n };\n}\n\nfunction ensureGuideTopic(topic: string | undefined): GuideTopicDefinition {\n const resolved = resolveGuideTopic(topic);\n if (resolved) {\n return resolved;\n }\n const available = listGuideTopicIds().join(\", \");\n throw new PmCliError(\n `Unknown guide topic \"${topic ?? \"\"}\". Available topics: ${available}. Use \"pm guide --list\" to browse.`,\n EXIT_CODE.USAGE,\n );\n}\n\nexport async function runGuide(options: GuideOptions, global: GlobalOptions): Promise<GuideResult> {\n const depth = parseGuideDepth(typeof options.depth === \"string\" ? options.depth : undefined);\n const listRequested = options.list === true;\n const topicRaw = typeof options.topic === \"string\" ? options.topic : undefined;\n if (listRequested || !topicRaw) {\n return buildGuideIndex(depth);\n }\n\n const topic = ensureGuideTopic(topicRaw);\n const packageRoot = resolvePackageRoot();\n const docs = await renderGuideDocs(topic, depth, packageRoot);\n const warnings = docs\n .filter((doc) => !doc.exists && !doc.optional)\n .map((doc) => `Missing required guide document: ${doc.path}`);\n\n return {\n output_default: \"toon\",\n mode: \"topic\",\n depth,\n requested_topic: topicRaw,\n topic,\n docs,\n warnings,\n };\n}\n\nfunction markdownCodeFence(content: string): string {\n return content.replaceAll(\"```\", \"``\\\\`\");\n}\n\nexport function renderGuideMarkdown(result: GuideResult): string {\n if (result.mode === \"index\") {\n const lines: string[] = [\n \"# pm guide\",\n \"\",\n \"Token-efficient local documentation index for agent and maintainer workflows.\",\n \"\",\n \"## Topics\",\n ];\n for (const topic of result.topics) {\n lines.push(`- \\`${topic.id}\\` - ${topic.summary}`);\n if (result.depth !== \"brief\") {\n lines.push(` - intent: ${topic.intent}`);\n lines.push(` - docs: ${topic.docs.map((doc) => `\\`${doc.path}\\``).join(\", \")}`);\n }\n }\n lines.push(\"\", \"## Next steps\");\n for (const step of result.suggested_next_steps) {\n lines.push(`- \\`${step}\\``);\n }\n return lines.join(\"\\n\");\n }\n\n const lines: string[] = [\n `# pm guide ${result.topic.id}`,\n \"\",\n result.topic.summary,\n \"\",\n \"## Intent\",\n result.topic.intent,\n \"\",\n \"## Key commands\",\n ...result.topic.commands.map((command) => `- \\`${command}\\``),\n \"\",\n \"## Workflow prompts\",\n ];\n for (const workflow of result.topic.workflows) {\n lines.push(`### ${workflow.name}`);\n lines.push(`goal: ${workflow.goal}`);\n lines.push(`prompt: ${workflow.prompt}`);\n lines.push(\"commands:\");\n lines.push(...workflow.commands.map((command) => `- \\`${command}\\``));\n lines.push(\"\");\n }\n lines.push(\"## Documents\");\n for (const doc of result.docs) {\n const status = doc.exists ? \"available\" : doc.optional ? \"missing (optional)\" : \"missing (required)\";\n lines.push(`- \\`${doc.path}\\` - ${doc.purpose} (${status})`);\n if (doc.exists && doc.content_mode !== \"none\" && doc.content) {\n lines.push(\"\");\n lines.push(`### Excerpt: \\`${doc.path}\\``);\n if (doc.truncated) {\n lines.push(\"_truncated for context efficiency_\");\n }\n lines.push(\"```markdown\");\n lines.push(markdownCodeFence(doc.content));\n lines.push(\"```\");\n }\n }\n if (result.topic.related.length > 0) {\n lines.push(\"\", \"## Related topics\");\n lines.push(...result.topic.related.map((topic) => `- \\`${topic}\\``));\n }\n if (result.warnings.length > 0) {\n lines.push(\"\", \"## Warnings\");\n lines.push(...result.warnings.map((warning) => `- ${warning}`));\n }\n return lines.join(\"\\n\");\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAGzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAmDzE,SAAS,sBAAsB,CAAC,GAAuB;IACrD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAA+B,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,UAAU,CAAC,gDAAgD,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,UAA+B,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAqB,EAAE,MAAqB;IACnF,MAAM,aAAa,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,IAA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C,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","debugId":"8d06806e-bba1-5626-9ff4-b7fda8387582"}
1
+ {"version":3,"file":"guide.js","sources":["cli/commands/guide.ts"],"sourceRoot":"/","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { resolveConfiguredPmPackageRoot } from \"../../core/packages/root.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 listGuideTopicIds,\n listGuideTopics,\n resolveGuideTopic,\n type GuideTopicDefinition,\n} from \"../guide-topics.js\";\n\nexport const GUIDE_OUTPUT_VALUES = [\"markdown\", \"toon\", \"json\"] as const;\nexport type GuideOutputFormat = (typeof GUIDE_OUTPUT_VALUES)[number];\n\nexport const GUIDE_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type GuideDepth = (typeof GUIDE_DEPTH_VALUES)[number];\n\nexport interface GuideOptions {\n topic?: string;\n list?: boolean;\n format?: string;\n depth?: string;\n [key: string]: unknown;\n}\n\nexport interface GuideDocRender {\n path: string;\n purpose: string;\n optional: boolean;\n exists: boolean;\n line_count: number | null;\n content_mode: \"none\" | \"excerpt\" | \"full\";\n content: string | null;\n truncated: boolean;\n}\n\nexport interface GuideIndexResult {\n output_default: \"toon\";\n mode: \"index\";\n depth: GuideDepth;\n topics: Array<{\n id: string;\n aliases: string[];\n title: string;\n summary: string;\n intent: string;\n quick_commands: string[];\n docs: Array<{ path: string; purpose: string }>;\n related: string[];\n }>;\n suggested_next_steps: string[];\n}\n\nexport interface GuideTopicResult {\n output_default: \"toon\";\n mode: \"topic\";\n depth: GuideDepth;\n requested_topic: string;\n topic: GuideTopicDefinition;\n docs: GuideDocRender[];\n warnings: string[];\n}\n\nexport type GuideResult = GuideIndexResult | GuideTopicResult;\n\nfunction parseGuideOutputFormat(raw: string | undefined): GuideOutputFormat | undefined {\n if (!raw) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_OUTPUT_VALUES.includes(normalized as GuideOutputFormat)) {\n throw new PmCliError(\"Guide format must be one of markdown|toon|json\", EXIT_CODE.USAGE);\n }\n return normalized as GuideOutputFormat;\n}\n\nexport function resolveGuideOutputFormat(options: GuideOptions, global: GlobalOptions): GuideOutputFormat {\n const commandFormat = parseGuideOutputFormat(options.format);\n if (global.json && commandFormat && commandFormat !== \"json\") {\n throw new PmCliError(\"Cannot combine --json with --format markdown|toon\", EXIT_CODE.USAGE);\n }\n if (global.json) {\n return \"json\";\n }\n return commandFormat ?? \"toon\";\n}\n\nfunction parseGuideDepth(raw: string | undefined): GuideDepth {\n if (!raw) {\n return \"brief\";\n }\n const normalized = raw.trim().toLowerCase();\n if (!GUIDE_DEPTH_VALUES.includes(normalized as GuideDepth)) {\n throw new PmCliError(\"Guide depth must be one of brief|standard|deep\", EXIT_CODE.USAGE);\n }\n return normalized as GuideDepth;\n}\n\nfunction resolvePackageRoot(): string {\n return resolveConfiguredPmPackageRoot(process.env, \"PM_CLI_PACKAGE_ROOT\", import.meta.url, [\"..\", \"..\", \"..\"]);\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replaceAll(\"\\r\\n\", \"\\n\");\n}\n\nfunction toExcerpt(content: string, maxLines: number, maxCharacters: number): { excerpt: string; truncated: boolean; lineCount: number } {\n const normalized = normalizeLineEndings(content);\n const lines = normalized.split(\"\\n\");\n const lineSlice = lines.slice(0, maxLines);\n let excerpt = lineSlice.join(\"\\n\");\n let truncated = lines.length > maxLines;\n if (excerpt.length > maxCharacters) {\n excerpt = excerpt.slice(0, maxCharacters);\n truncated = true;\n }\n return {\n excerpt: excerpt.trimEnd(),\n truncated,\n lineCount: lines.length,\n };\n}\n\nasync function renderGuideDocs(topic: GuideTopicDefinition, depth: GuideDepth, packageRoot: string): Promise<GuideDocRender[]> {\n const includeContent = depth !== \"brief\";\n const contentMode: GuideDocRender[\"content_mode\"] = includeContent ? (depth === \"deep\" ? \"full\" : \"excerpt\") : \"none\";\n const docs: GuideDocRender[] = [];\n for (const doc of topic.docs) {\n const absolutePath = path.resolve(packageRoot, doc.path);\n if (!includeContent) {\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n continue;\n }\n try {\n const rawContent = await readFile(absolutePath, \"utf8\");\n if (depth === \"deep\") {\n const normalized = normalizeLineEndings(rawContent).trimEnd();\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: normalized.length === 0 ? 0 : normalized.split(\"\\n\").length,\n content_mode: \"full\",\n content: normalized,\n truncated: false,\n });\n } else {\n const excerpt = toExcerpt(rawContent, 120, 12_000);\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: true,\n line_count: excerpt.lineCount,\n content_mode: contentMode,\n content: excerpt.excerpt,\n truncated: excerpt.truncated,\n });\n }\n } catch (error) {\n const code = (error as { code?: string } | null)?.code;\n const missing = code === \"ENOENT\";\n docs.push({\n path: doc.path,\n purpose: doc.purpose,\n optional: doc.optional === true,\n exists: false,\n line_count: null,\n content_mode: \"none\",\n content: null,\n truncated: false,\n });\n if (!missing) {\n throw new PmCliError(`Failed to read guide document \"${doc.path}\".`, EXIT_CODE.GENERIC_FAILURE);\n }\n }\n }\n return docs;\n}\n\nfunction buildGuideIndex(depth: GuideDepth): GuideIndexResult {\n const topics = listGuideTopics().map((topic) => ({\n id: topic.id,\n aliases: topic.aliases,\n title: topic.title,\n summary: topic.summary,\n intent: topic.intent,\n quick_commands: depth === \"brief\" ? topic.commands.slice(0, 3) : topic.commands.slice(0, 6),\n docs: topic.docs.map((doc) => ({ path: doc.path, purpose: doc.purpose })),\n related: topic.related,\n }));\n return {\n output_default: \"toon\",\n mode: \"index\",\n depth,\n topics,\n suggested_next_steps: [\n \"pm guide <topic>\",\n \"pm guide <topic> --depth standard\",\n \"pm guide <topic> --depth deep --format markdown\",\n \"pm guide <topic> --json\",\n ],\n };\n}\n\nfunction ensureGuideTopic(topic: string): GuideTopicDefinition {\n const resolved = resolveGuideTopic(topic);\n if (resolved) {\n return resolved;\n }\n const available = listGuideTopicIds().join(\", \");\n throw new PmCliError(\n `Unknown guide topic \"${topic}\". Available topics: ${available}. Use \"pm guide --list\" to browse.`,\n EXIT_CODE.USAGE,\n );\n}\n\nexport async function runGuide(options: GuideOptions, global: GlobalOptions): Promise<GuideResult> {\n const depth = parseGuideDepth(typeof options.depth === \"string\" ? options.depth : undefined);\n const listRequested = options.list === true;\n const topicRaw = typeof options.topic === \"string\" ? options.topic : undefined;\n if (listRequested || !topicRaw) {\n return buildGuideIndex(depth);\n }\n\n const topic = ensureGuideTopic(topicRaw);\n const packageRoot = resolvePackageRoot();\n const docs = await renderGuideDocs(topic, depth, packageRoot);\n const warnings = docs\n .filter((doc) => !doc.exists && !doc.optional)\n .map((doc) => `Missing required guide document: ${doc.path}`);\n\n return {\n output_default: \"toon\",\n mode: \"topic\",\n depth,\n requested_topic: topicRaw,\n topic,\n docs,\n warnings,\n };\n}\n\nexport const _testOnlyGuide = {\n ensureGuideTopic,\n};\n\nfunction markdownCodeFence(content: string): string {\n return content.replaceAll(\"```\", \"``\\\\`\");\n}\n\nexport function renderGuideMarkdown(result: GuideResult): string {\n if (result.mode === \"index\") {\n const lines: string[] = [\n \"# pm guide\",\n \"\",\n \"Token-efficient local documentation index for agent and maintainer workflows.\",\n \"\",\n \"## Topics\",\n ];\n for (const topic of result.topics) {\n lines.push(`- \\`${topic.id}\\` - ${topic.summary}`);\n if (result.depth !== \"brief\") {\n lines.push(` - intent: ${topic.intent}`);\n lines.push(` - docs: ${topic.docs.map((doc) => `\\`${doc.path}\\``).join(\", \")}`);\n }\n }\n lines.push(\"\", \"## Next steps\");\n for (const step of result.suggested_next_steps) {\n lines.push(`- \\`${step}\\``);\n }\n return lines.join(\"\\n\");\n }\n\n const lines: string[] = [\n `# pm guide ${result.topic.id}`,\n \"\",\n result.topic.summary,\n \"\",\n \"## Intent\",\n result.topic.intent,\n \"\",\n \"## Key commands\",\n ...result.topic.commands.map((command) => `- \\`${command}\\``),\n \"\",\n \"## Workflow prompts\",\n ];\n for (const workflow of result.topic.workflows) {\n lines.push(`### ${workflow.name}`);\n lines.push(`goal: ${workflow.goal}`);\n lines.push(`prompt: ${workflow.prompt}`);\n lines.push(\"commands:\");\n lines.push(...workflow.commands.map((command) => `- \\`${command}\\``));\n lines.push(\"\");\n }\n lines.push(\"## Documents\");\n for (const doc of result.docs) {\n const status = doc.exists ? \"available\" : doc.optional ? \"missing (optional)\" : \"missing (required)\";\n lines.push(`- \\`${doc.path}\\` - ${doc.purpose} (${status})`);\n if (doc.exists && doc.content_mode !== \"none\" && doc.content) {\n lines.push(\"\");\n lines.push(`### Excerpt: \\`${doc.path}\\``);\n if (doc.truncated) {\n lines.push(\"_truncated for context efficiency_\");\n }\n lines.push(\"```markdown\");\n lines.push(markdownCodeFence(doc.content));\n lines.push(\"```\");\n }\n }\n if (result.topic.related.length > 0) {\n lines.push(\"\", \"## Related topics\");\n lines.push(...result.topic.related.map((topic) => `- \\`${topic}\\``));\n }\n if (result.warnings.length > 0) {\n lines.push(\"\", \"## Warnings\");\n lines.push(...result.warnings.map((warning) => `- ${warning}`));\n }\n return lines.join(\"\\n\");\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAA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AAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;YAC3C,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;gBAClB,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;YACnD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,mBAAmB,CAAC,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","debugId":"307416ac-f9a5-5a5c-871c-ea3f91a3d6e6"}
@@ -1,5 +1,7 @@
1
1
  import type { GlobalOptions } from "../../core/shared/command-types.js";
2
+ import { buildCapabilityContractMetadata, collectUnknownCapabilityGuidance } from "./extension/doctor.js";
2
3
  type HealthStatus = "ok" | "warn";
4
+ type MigrationRuntimeStatus = "pending" | "failed" | "applied";
3
5
  export interface HealthCheck {
4
6
  name: "settings" | "directories" | "settings_values" | "telemetry" | "extensions" | "storage" | "locks" | "integrity" | "history_drift" | "vectorization";
5
7
  status: HealthStatus;
@@ -33,5 +35,112 @@ export interface RunHealthOptions {
33
35
  brief?: boolean;
34
36
  summary?: boolean;
35
37
  }
38
+ interface MigrationStatusEntry {
39
+ layer: "global" | "project";
40
+ name: string;
41
+ id: string;
42
+ status: MigrationRuntimeStatus;
43
+ reason?: string;
44
+ }
45
+ interface MigrationStatusSummary {
46
+ applied: MigrationStatusEntry[];
47
+ pending: MigrationStatusEntry[];
48
+ failed: MigrationStatusEntry[];
49
+ applied_count: number;
50
+ pending_count: number;
51
+ failed_count: number;
52
+ }
53
+ interface ExtensionHealthTriageSummary {
54
+ status: "ok" | "warn";
55
+ warning_count: number;
56
+ warning_codes: string[];
57
+ load_failure_count: number;
58
+ activation_failure_count: number;
59
+ migration_failed_count: number;
60
+ migration_pending_count: number;
61
+ managed_state_warning_count: number;
62
+ managed_extension_entries_count: number;
63
+ unmanaged_loaded_extension_count: number;
64
+ unmanaged_loaded_extensions: string[];
65
+ unmanaged_expected_extension_count: number;
66
+ unmanaged_expected_extensions: string[];
67
+ unmanaged_action_required_extension_count: number;
68
+ unmanaged_action_required_extensions: string[];
69
+ update_health_coverage: "full" | "partial";
70
+ update_health_partial: boolean;
71
+ unknown_capability_count: number;
72
+ top_warnings: string[];
73
+ remediation: string[];
74
+ }
75
+ /**
76
+ * Advisory warnings are surfaced for visibility but never flip overall health to
77
+ * not-ok. Telemetry is opt-out, non-critical observability: a queued/unreachable
78
+ * telemetry endpoint or corrupt local telemetry state is not a project-health
79
+ * failure and must not block agents that gate on `pm health` `ok`.
80
+ */
81
+ declare function isAdvisoryHealthWarning(warning: string): boolean;
82
+ declare function warningCode(value: string): string;
83
+ declare function normalizeExtensionNameForMatch(value: string): string;
84
+ declare function isExpectedUnmanagedExtension(name: string, directory: string): boolean;
85
+ declare function isDirectory(targetPath: string): Promise<boolean>;
86
+ declare function listItemDocumentPaths(pmRoot: string, typeToFolder: Record<string, string>): Promise<string[]>;
87
+ declare function buildExtensionHealthTriageSummary(warnings: string[], loadFailureCount: number, activationFailureCount: number, migrationStatus: MigrationStatusSummary, managedStateWarningCount: number, managedExtensionEntriesCount: number, unmanagedLoadedExtensions: string[], unmanagedExpectedExtensions: string[], unmanagedActionRequiredExtensions: string[]): ExtensionHealthTriageSummary;
88
+ declare function summarizeRecordList(value: unknown, limit: number): {
89
+ count: number;
90
+ sample: unknown[];
91
+ truncated: boolean;
92
+ };
93
+ declare function summarizeExtensionList(value: unknown, limit: number): {
94
+ count: number;
95
+ sample: unknown[];
96
+ truncated: boolean;
97
+ };
98
+ declare function summarizeStringList(value: unknown, limit: number): {
99
+ count: number;
100
+ sample: string[];
101
+ truncated: boolean;
102
+ };
103
+ declare function summarizeHealthCheckDetails(check: HealthCheck, limit: number): Record<string, unknown>;
104
+ declare function selectStaleItemDetail(values: string[], verboseStaleItems: boolean): {
105
+ values: string[];
106
+ truncated: boolean;
107
+ total: number;
108
+ };
109
+ declare function telemetryEnvFlagEnabled(envKey: "PM_TELEMETRY_DISABLED" | "PM_TELEMETRY_OTEL_DISABLED" | "PM_NO_TELEMETRY" | "PM_TELEMETRY_INLINE_FLUSH"): boolean;
110
+ declare function normalizeEndpointForDisplay(rawEndpoint: string): string;
111
+ declare function parseTelemetryQueue(raw: string): {
112
+ validEntries: number;
113
+ invalidRows: number;
114
+ totalRows: number;
115
+ highRetryEntries: number;
116
+ maxAttempts: number;
117
+ };
118
+ declare function probeTelemetryEndpointHealth(endpoint: string): Promise<{
119
+ probe_url: string;
120
+ ok: boolean;
121
+ status?: number;
122
+ max_schema_version?: string;
123
+ error?: string;
124
+ }>;
36
125
  export declare function runHealth(global: GlobalOptions, options?: RunHealthOptions): Promise<HealthResult>;
126
+ export declare const _testOnlyHealthCommand: {
127
+ buildExtensionHealthTriageSummary: typeof buildExtensionHealthTriageSummary;
128
+ buildCapabilityContractMetadata: typeof buildCapabilityContractMetadata;
129
+ collectUnknownCapabilityGuidance: typeof collectUnknownCapabilityGuidance;
130
+ isAdvisoryHealthWarning: typeof isAdvisoryHealthWarning;
131
+ isDirectory: typeof isDirectory;
132
+ isExpectedUnmanagedExtension: typeof isExpectedUnmanagedExtension;
133
+ listItemDocumentPaths: typeof listItemDocumentPaths;
134
+ normalizeEndpointForDisplay: typeof normalizeEndpointForDisplay;
135
+ normalizeExtensionNameForMatch: typeof normalizeExtensionNameForMatch;
136
+ parseTelemetryQueue: typeof parseTelemetryQueue;
137
+ probeTelemetryEndpointHealth: typeof probeTelemetryEndpointHealth;
138
+ selectStaleItemDetail: typeof selectStaleItemDetail;
139
+ summarizeHealthCheckDetails: typeof summarizeHealthCheckDetails;
140
+ summarizeExtensionList: typeof summarizeExtensionList;
141
+ summarizeRecordList: typeof summarizeRecordList;
142
+ summarizeStringList: typeof summarizeStringList;
143
+ telemetryEnvFlagEnabled: typeof telemetryEnvFlagEnabled;
144
+ warningCode: typeof warningCode;
145
+ };
37
146
  export {};
@@ -1,17 +1,17 @@
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]="aea76476-f15d-5223-8832-76e396aceb72")}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]="af7fc4b9-7974-50ca-844a-847d6fce2989")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
6
6
  import { pathExists, readFileIfExists } from "../../core/fs/fs-utils.js";
7
7
  import { activateExtensions, getActiveExtensionRegistrations, loadExtensions, runActiveOnReadHooks } from "../../core/extensions/index.js";
8
8
  import { collectRegisteredItemFieldNames } from "../../core/extensions/item-fields.js";
9
- import { EXTENSION_CAPABILITY_CONTRACT, KNOWN_EXTENSION_CAPABILITIES, parseLegacyExtensionCapabilityAliasWarning, parseUnknownExtensionCapabilityWarning, } from "../../core/extensions/loader.js";
9
+ import { KNOWN_EXTENSION_CAPABILITIES, } from "../../core/extensions/loader.js";
10
10
  import { enforceHistoryStreamPolicyForItems } from "../../core/history/history-stream-policy.js";
11
11
  import { scanHistoryDrift } from "../../core/history/drift-scan.js";
12
12
  import { scanLockHealth } from "../../core/lock/lock-gc.js";
13
13
  import { readVectorizationStatusLedger, refreshSemanticEmbeddingsForMutatedItems, } from "../../core/search/cache.js";
14
- import { resolveEmbeddingProviders } from "../../core/search/providers.js";
14
+ import { resolveEmbeddingProviders, resolveProviderConfigSource } from "../../core/search/providers.js";
15
15
  import { resolveSettingsWithSemanticRuntimeDefaults } from "../../core/search/semantic-defaults.js";
16
16
  import { collectStaleVectorizationIds } from "../../core/search/staleness.js";
17
17
  import { buildVectorizationEmbeddingIdentity, hasVectorizationEmbeddingIdentityChanged, } from "../../core/search/vectorization-metadata.js";
@@ -23,12 +23,13 @@ import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
23
23
  import { nowIso } from "../../core/shared/time.js";
24
24
  import { parseItemDocument } from "../../core/item/item-format.js";
25
25
  import { listAllFrontMatter, listAllFrontMatterWithBody } from "../../core/store/item-store.js";
26
- import { TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION } from "../../core/telemetry/runtime.js";
26
+ import { PM_TELEMETRY_SOURCE_CONTEXT_VALUES, TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION, } from "../../core/telemetry/runtime.js";
27
+ const PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
27
28
  import { getItemFormatFromPath, getSettingsPath, ITEM_FILE_EXTENSIONS, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
28
29
  import { readSettingsWithMetadata } from "../../core/store/settings.js";
29
30
  import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
30
31
  import { readManagedExtensionState } from "./extension.js";
31
- import { buildRegistrationCollisionRemediation } from "./extension/doctor.js";
32
+ import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "./extension/doctor.js";
32
33
  const STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
33
34
  const BRIEF_HEALTH_DETAIL_LIMIT = 8;
34
35
  const TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
@@ -57,35 +58,6 @@ function warningCode(value) {
57
58
  }
58
59
  return normalized.slice(0, separator);
59
60
  }
60
- function collectUnknownCapabilityGuidance(warnings) {
61
- const seen = new Set();
62
- const guidance = [];
63
- for (const warning of warnings) {
64
- const parsedDetails = (() => {
65
- const unknownWarning = parseUnknownExtensionCapabilityWarning(warning);
66
- if (unknownWarning) {
67
- return [unknownWarning];
68
- }
69
- return parseLegacyExtensionCapabilityAliasWarning(warning);
70
- })();
71
- for (const parsed of parsedDetails) {
72
- const key = `${parsed.layer}:${parsed.name}:${parsed.capability}`;
73
- if (seen.has(key)) {
74
- continue;
75
- }
76
- seen.add(key);
77
- guidance.push(parsed);
78
- }
79
- }
80
- return guidance;
81
- }
82
- function buildCapabilityContractMetadata() {
83
- return {
84
- version: EXTENSION_CAPABILITY_CONTRACT.version,
85
- capabilities: [...EXTENSION_CAPABILITY_CONTRACT.capabilities],
86
- legacy_aliases: { ...EXTENSION_CAPABILITY_CONTRACT.legacy_aliases },
87
- };
88
- }
89
61
  function normalizeExtensionNameForMatch(value) {
90
62
  return value.trim().toLowerCase();
91
63
  }
@@ -198,9 +170,11 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
198
170
  historyFiles = (await fs.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
199
171
  }
200
172
  catch (error) {
173
+ /* c8 ignore start -- ENOENT/non-ENOENT differentiation requires filesystem fault injection */
201
174
  if (!(typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")) {
202
175
  historyUnreadable.push("history");
203
176
  }
177
+ /* c8 ignore stop */
204
178
  }
205
179
  for (const fileName of historyFiles) {
206
180
  const itemId = fileName.slice(0, -".jsonl".length);
@@ -274,6 +248,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
274
248
  warnings: normalizedWarnings,
275
249
  };
276
250
  }
251
+ /* c8 ignore start -- activate export shape variants are exercised through integration load tests */
277
252
  function hasActivateExport(moduleRecord) {
278
253
  if (typeof moduleRecord.activate === "function") {
279
254
  return true;
@@ -284,6 +259,7 @@ function hasActivateExport(moduleRecord) {
284
259
  }
285
260
  return typeof defaultExport.activate === "function";
286
261
  }
262
+ /* c8 ignore stop */
287
263
  function summarizeLoadedExtension(extension) {
288
264
  const summary = {
289
265
  layer: extension.layer,
@@ -296,9 +272,11 @@ function summarizeLoadedExtension(extension) {
296
272
  entry_path: extension.entry_path,
297
273
  has_activate: hasActivateExport(extension.module),
298
274
  };
275
+ /* c8 ignore start -- capability list optionality is exercised by extension load integration suites */
299
276
  if (Array.isArray(extension.capabilities)) {
300
277
  summary.capabilities = [...extension.capabilities];
301
278
  }
279
+ /* c8 ignore stop */
302
280
  return summary;
303
281
  }
304
282
  function resolveMigrationId(definition, fallbackIndex) {
@@ -322,6 +300,7 @@ function resolveMigrationStatus(definition) {
322
300
  function resolveMigrationFailureReason(definition) {
323
301
  return toNonEmptyStringOrUndefined(definition.reason) ?? toNonEmptyStringOrUndefined(definition.error) ?? toNonEmptyStringOrUndefined(definition.message);
324
302
  }
303
+ /* c8 ignore start -- comparator tie-break branches are deterministic ordering glue exercised via migration integration tests */
325
304
  function compareMigrationEntries(left, right) {
326
305
  const byLayer = (left.layer ?? "").localeCompare(right.layer ?? "");
327
306
  if (byLayer !== 0) {
@@ -333,6 +312,7 @@ function compareMigrationEntries(left, right) {
333
312
  }
334
313
  return (left.id ?? "").localeCompare(right.id ?? "");
335
314
  }
315
+ /* c8 ignore stop */
336
316
  function summarizeMigrationStatuses(migrations) {
337
317
  const applied = [];
338
318
  const pending = [];
@@ -498,6 +478,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
498
478
  },
499
479
  },
500
480
  };
481
+ /* c8 ignore start -- unmanaged/expected grouping matrices are exercised in doctor + extension integration suites */
501
482
  const managedProjectNames = new Set(projectManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
502
483
  const managedGlobalNames = new Set(globalManagedState.state.entries.map((entry) => normalizeExtensionNameForMatch(entry.name)));
503
484
  const unmanagedLoadedEntries = [
@@ -530,6 +511,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
530
511
  .filter((entry) => !isExpectedUnmanagedExtension(entry.name, entry.directory))
531
512
  .map((entry) => `${entry.layer}:${entry.name}`)
532
513
  .sort((left, right) => left.localeCompare(right));
514
+ /* c8 ignore stop */
533
515
  const updateCoverageWarnings = unmanagedActionRequiredExtensions.length > 0
534
516
  ? [`extension_update_health_partial_coverage:skipped_unmanaged:${unmanagedActionRequiredExtensions.length}`]
535
517
  : [];
@@ -622,6 +604,7 @@ function summarizeStringList(value, limit) {
622
604
  truncated: strings.length > limit,
623
605
  };
624
606
  }
607
+ /* c8 ignore start -- brief/summary projection matrix branches are validated in projection integration tests */
625
608
  function summarizeHealthCheckDetails(check, limit) {
626
609
  const details = check.details;
627
610
  if (check.name === "settings") {
@@ -754,6 +737,7 @@ function summarizeHealthCheckDetails(check, limit) {
754
737
  }
755
738
  return details;
756
739
  }
740
+ /* c8 ignore stop */
757
741
  function applyBriefHealthProjection(result) {
758
742
  const warningsSummary = summarizeStringList(result.warnings, BRIEF_HEALTH_DETAIL_LIMIT);
759
743
  return {
@@ -819,6 +803,15 @@ function telemetryEnvFlagEnabled(envKey) {
819
803
  const value = (process.env[envKey] ?? "").trim().toLowerCase();
820
804
  return value === "1" || value === "true" || value === "yes" || value === "on";
821
805
  }
806
+ /* c8 ignore start -- environment override permutations are covered by runtime integration tests */
807
+ function telemetrySourceContextOverride() {
808
+ // Only report an override the runtime actually honours: runtime.ts ignores any
809
+ // value outside the enum and falls back to the inferred context, so health must
810
+ // report null for an unrecognized value rather than implying it took effect.
811
+ const value = (process.env.PM_TELEMETRY_SOURCE_CONTEXT ?? "").trim().toLowerCase();
812
+ return PM_TELEMETRY_SOURCE_CONTEXT_SET.has(value) ? value : null;
813
+ }
814
+ /* c8 ignore stop */
822
815
  function normalizeEndpointForDisplay(rawEndpoint) {
823
816
  const trimmed = rawEndpoint.trim();
824
817
  if (trimmed.length === 0) {
@@ -862,6 +855,7 @@ function parseTelemetryQueue(raw) {
862
855
  }
863
856
  }
864
857
  else {
858
+ /* c8 ignore next -- invalid queue rows are covered by end-to-end telemetry fixtures */
865
859
  invalidRows += 1;
866
860
  }
867
861
  }
@@ -913,6 +907,7 @@ async function probeTelemetryEndpointHealth(endpoint) {
913
907
  return {
914
908
  probe_url: normalizeEndpointForDisplay(probeUrl),
915
909
  ok: false,
910
+ /* c8 ignore next -- non-Error throwables require transport-layer fault injection */
916
911
  error: error instanceof Error ? error.message : "probe_failed",
917
912
  };
918
913
  }
@@ -930,6 +925,7 @@ async function buildTelemetryCheck(settings, options) {
930
925
  const stateRaw = await readFileIfExists(statePath);
931
926
  let runtimeState = {};
932
927
  let stateParseFailed = false;
928
+ /* c8 ignore start -- telemetry state corruption and otel-failure branches require runtime-coordinated fixture mutation */
933
929
  if (stateRaw && stateRaw.trim().length > 0) {
934
930
  try {
935
931
  const parsed = JSON.parse(stateRaw);
@@ -937,6 +933,7 @@ async function buildTelemetryCheck(settings, options) {
937
933
  runtimeState = parsed;
938
934
  }
939
935
  else {
936
+ /* c8 ignore next -- malformed runtime-state payloads are integration-only corruption cases */
940
937
  stateParseFailed = true;
941
938
  }
942
939
  }
@@ -991,6 +988,19 @@ async function buildTelemetryCheck(settings, options) {
991
988
  parsedMaxSchemaVersion > TELEMETRY_SCHEMA_VERSION) {
992
989
  warnings.push(`telemetry_schema_version_behind:${parsedMaxSchemaVersion}`);
993
990
  }
991
+ const pendingOtelSpans = typeof runtimeState.pending_otel_spans === "number" ? runtimeState.pending_otel_spans : 0;
992
+ const lastOtelSuccess = runtimeState.last_otel_success_at;
993
+ const lastOtelFailure = runtimeState.last_otel_failure_at;
994
+ const otelExportFailing = settings.telemetry.enabled &&
995
+ pendingOtelSpans > 0 &&
996
+ Boolean(lastOtelFailure) &&
997
+ // >= so a mixed-outcome batch (success + failure share the same attempt
998
+ // timestamp) still surfaces the warning rather than being masked by the tie.
999
+ (!lastOtelSuccess || lastOtelFailure >= lastOtelSuccess);
1000
+ if (otelExportFailing) {
1001
+ warnings.push(`telemetry_otel_export_failing:${pendingOtelSpans}`);
1002
+ }
1003
+ /* c8 ignore stop */
994
1004
  return {
995
1005
  check: {
996
1006
  name: "telemetry",
@@ -1016,14 +1026,23 @@ async function buildTelemetryCheck(settings, options) {
1016
1026
  last_successful_flush_at: runtimeState.last_successful_flush_at ?? null,
1017
1027
  last_failed_flush_at: runtimeState.last_failed_flush_at ?? null,
1018
1028
  last_failed_flush_error: runtimeState.last_failed_flush_error ?? null,
1029
+ pending_otel_spans: pendingOtelSpans,
1030
+ last_otel_attempt_at: runtimeState.last_otel_attempt_at ?? null,
1031
+ last_otel_success_at: runtimeState.last_otel_success_at ?? null,
1032
+ last_otel_failure_at: runtimeState.last_otel_failure_at ?? null,
1033
+ last_otel_failure_error: runtimeState.last_otel_failure_error ?? null,
1019
1034
  endpoint_probe: endpointProbe ?? {
1020
1035
  attempted: false,
1021
1036
  },
1037
+ /* c8 ignore start -- env-override combinations are validated through runtime integration suites */
1022
1038
  env_overrides: {
1023
1039
  telemetry_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_DISABLED") || telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
1024
1040
  pm_no_telemetry: telemetryEnvFlagEnabled("PM_NO_TELEMETRY"),
1025
1041
  telemetry_otel_disabled: telemetryEnvFlagEnabled("PM_TELEMETRY_OTEL_DISABLED"),
1042
+ telemetry_inline_flush: telemetryEnvFlagEnabled("PM_TELEMETRY_INLINE_FLUSH"),
1043
+ telemetry_source_context: telemetrySourceContextOverride(),
1026
1044
  },
1045
+ /* c8 ignore stop */
1027
1046
  },
1028
1047
  },
1029
1048
  warnings,
@@ -1035,6 +1054,7 @@ async function buildTelemetryCheck(settings, options) {
1035
1054
  * agents can gate on stale item-claim locks before running gc speculatively.
1036
1055
  */
1037
1056
  async function buildLocksCheck(pmRoot) {
1057
+ /* c8 ignore start -- scan failure branches require filesystem-level fault injection */
1038
1058
  let scan;
1039
1059
  try {
1040
1060
  scan = await scanLockHealth(pmRoot);
@@ -1065,6 +1085,7 @@ async function buildLocksCheck(pmRoot) {
1065
1085
  if (scan.unreadable_lock_count > 0) {
1066
1086
  warnings.push(`locks_unreadable:${scan.unreadable_lock_count}`);
1067
1087
  }
1088
+ /* c8 ignore stop */
1068
1089
  return {
1069
1090
  check: {
1070
1091
  name: "locks",
@@ -1139,6 +1160,7 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
1139
1160
  Boolean(ledgerBefore.embedding &&
1140
1161
  runtimeEmbeddingIdentity &&
1141
1162
  hasVectorizationEmbeddingIdentityChanged(ledgerBefore.embedding, runtimeEmbeddingIdentity));
1163
+ /* c8 ignore start -- strict-vectorization warning synthesis branches are integration-only policy permutations */
1142
1164
  const warningSet = new Set([...ledgerBefore.warnings, ...ledgerAfter.warnings]);
1143
1165
  if (strictVectorizationWarnings) {
1144
1166
  for (const warning of refreshResult.warnings) {
@@ -1169,7 +1191,15 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
1169
1191
  refresh_vectors: refreshPolicy.refreshVectors,
1170
1192
  },
1171
1193
  provider_active: providerResolution.active?.name ?? null,
1194
+ // GH-244: surface the persisted (possibly empty) configured value and
1195
+ // how the active resolution was sourced, so a config audit can tell
1196
+ // "auto-detected" apart from a genuine misconfiguration when
1197
+ // settings.search.provider / vector_store.adapter are empty strings.
1198
+ provider_configured: typeof settings.search?.provider === "string" ? settings.search.provider : null,
1199
+ provider_source: resolveProviderConfigSource(providerResolution.active?.name ?? null, settings.search?.provider ?? null),
1172
1200
  vector_store_active: vectorStoreResolution.active?.name ?? null,
1201
+ vector_store_configured: typeof settings.vector_store?.adapter === "string" ? settings.vector_store.adapter : null,
1202
+ vector_store_source: resolveProviderConfigSource(vectorStoreResolution.active?.name ?? null, settings.vector_store?.adapter ?? null),
1173
1203
  embedding_identity_changed: embeddingIdentityChanged,
1174
1204
  embedding_identity_before: ledgerBefore.embedding ?? null,
1175
1205
  embedding_identity_runtime: runtimeEmbeddingIdentity ?? null,
@@ -1197,6 +1227,7 @@ async function buildVectorizationCheck(pmRoot, settings, items, refreshPolicy, v
1197
1227
  },
1198
1228
  warnings,
1199
1229
  };
1230
+ /* c8 ignore stop */
1200
1231
  }
1201
1232
  function validateSettingsValues(settings) {
1202
1233
  const warnings = [];
@@ -1305,6 +1336,7 @@ export async function runHealth(global, options = {}) {
1305
1336
  const checks = [
1306
1337
  {
1307
1338
  name: "settings",
1339
+ /* c8 ignore next -- settings read-warning status split is covered in broader read-settings integration tests */
1308
1340
  status: normalizedSettingsReadWarnings.length === 0 ? "ok" : "warn",
1309
1341
  details: {
1310
1342
  path: settingsPath,
@@ -1416,5 +1448,25 @@ export async function runHealth(global, options = {}) {
1416
1448
  }
1417
1449
  return options.brief === true ? applyBriefHealthProjection(result) : result;
1418
1450
  }
1451
+ export const _testOnlyHealthCommand = {
1452
+ buildExtensionHealthTriageSummary,
1453
+ buildCapabilityContractMetadata,
1454
+ collectUnknownCapabilityGuidance,
1455
+ isAdvisoryHealthWarning,
1456
+ isDirectory,
1457
+ isExpectedUnmanagedExtension,
1458
+ listItemDocumentPaths,
1459
+ normalizeEndpointForDisplay,
1460
+ normalizeExtensionNameForMatch,
1461
+ parseTelemetryQueue,
1462
+ probeTelemetryEndpointHealth,
1463
+ selectStaleItemDetail,
1464
+ summarizeHealthCheckDetails,
1465
+ summarizeExtensionList,
1466
+ summarizeRecordList,
1467
+ summarizeStringList,
1468
+ telemetryEnvFlagEnabled,
1469
+ warningCode,
1470
+ };
1419
1471
  //# sourceMappingURL=health.js.map
1420
- //# debugId=aea76476-f15d-5223-8832-76e396aceb72
1472
+ //# debugId=af7fc4b9-7974-50ca-844a-847d6fce2989