@unbrained/pm-cli 2026.7.14 → 2026.7.15

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 (708) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +48 -0
  3. package/README.md +14 -11
  4. package/dist/cli/argv-utils.d.ts +1 -4
  5. package/dist/cli/argv-utils.js +3 -13
  6. package/dist/cli/argv-utils.js.map +1 -1
  7. package/dist/cli/bootstrap-args.d.ts +6 -4
  8. package/dist/cli/bootstrap-args.js +51 -16
  9. package/dist/cli/bootstrap-args.js.map +1 -1
  10. package/dist/cli/bundle-integrity.d.ts +49 -0
  11. package/dist/cli/bundle-integrity.js +111 -0
  12. package/dist/cli/bundle-integrity.js.map +1 -0
  13. package/dist/cli/commands/completion.js +7 -2
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +6 -163
  16. package/dist/cli/commands/config.js +4 -1133
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/context.d.ts +2 -4
  19. package/dist/cli/commands/context.js +10 -85
  20. package/dist/cli/commands/context.js.map +1 -1
  21. package/dist/cli/commands/create.d.ts +1 -0
  22. package/dist/cli/commands/create.js +3 -2
  23. package/dist/cli/commands/create.js.map +1 -1
  24. package/dist/cli/commands/extension/describe.d.ts +2 -91
  25. package/dist/cli/commands/extension/describe.js +4 -142
  26. package/dist/cli/commands/extension/describe.js.map +1 -1
  27. package/dist/cli/commands/extension/scaffold.d.ts +2 -36
  28. package/dist/cli/commands/extension/scaffold.js +4 -2435
  29. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  30. package/dist/cli/commands/extension/shared.d.ts +2 -28
  31. package/dist/cli/commands/extension/shared.js +4 -130
  32. package/dist/cli/commands/extension/shared.js.map +1 -1
  33. package/dist/cli/commands/extension.d.ts +3 -400
  34. package/dist/cli/commands/extension.js +4 -2183
  35. package/dist/cli/commands/extension.js.map +1 -1
  36. package/dist/cli/commands/gc.d.ts +6 -56
  37. package/dist/cli/commands/gc.js +4 -270
  38. package/dist/cli/commands/gc.js.map +1 -1
  39. package/dist/cli/commands/get.d.ts +18 -5
  40. package/dist/cli/commands/get.js +117 -58
  41. package/dist/cli/commands/get.js.map +1 -1
  42. package/dist/cli/commands/health.d.ts +6 -184
  43. package/dist/cli/commands/health.js +4 -1747
  44. package/dist/cli/commands/health.js.map +1 -1
  45. package/dist/cli/commands/history-compact.d.ts +4 -139
  46. package/dist/cli/commands/history-compact.js +5 -510
  47. package/dist/cli/commands/history-compact.js.map +1 -1
  48. package/dist/cli/commands/history-redact.d.ts +8 -120
  49. package/dist/cli/commands/history-redact.js +6 -581
  50. package/dist/cli/commands/history-redact.js.map +1 -1
  51. package/dist/cli/commands/history-repair.d.ts +7 -89
  52. package/dist/cli/commands/history-repair.js +5 -257
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/history.d.ts +1 -2
  55. package/dist/cli/commands/history.js +6 -48
  56. package/dist/cli/commands/history.js.map +1 -1
  57. package/dist/cli/commands/index.d.ts +1 -0
  58. package/dist/cli/commands/index.js +3 -2
  59. package/dist/cli/commands/index.js.map +1 -1
  60. package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
  61. package/dist/cli/commands/init-agent-guidance.js +4 -431
  62. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  63. package/dist/cli/commands/init.d.ts +6 -181
  64. package/dist/cli/commands/init.js +4 -690
  65. package/dist/cli/commands/init.js.map +1 -1
  66. package/dist/cli/commands/next.js +3 -3
  67. package/dist/cli/commands/next.js.map +1 -1
  68. package/dist/cli/commands/profile.d.ts +4 -174
  69. package/dist/cli/commands/profile.js +4 -425
  70. package/dist/cli/commands/profile.js.map +1 -1
  71. package/dist/cli/commands/restore.d.ts +4 -19
  72. package/dist/cli/commands/restore.js +9 -158
  73. package/dist/cli/commands/restore.js.map +1 -1
  74. package/dist/cli/commands/schema.d.ts +7 -507
  75. package/dist/cli/commands/schema.js +5 -1254
  76. package/dist/cli/commands/schema.js.map +1 -1
  77. package/dist/cli/commands/test.d.ts +2 -4
  78. package/dist/cli/commands/test.js +7 -97
  79. package/dist/cli/commands/test.js.map +1 -1
  80. package/dist/cli/commands/validate.d.ts +9 -249
  81. package/dist/cli/commands/validate.js +9 -2150
  82. package/dist/cli/commands/validate.js.map +1 -1
  83. package/dist/cli/extension-command-help.js +18 -4
  84. package/dist/cli/extension-command-help.js.map +1 -1
  85. package/dist/cli/extension-command-options.js +3 -3
  86. package/dist/cli/extension-command-options.js.map +1 -1
  87. package/dist/cli/help-content.js +7 -3
  88. package/dist/cli/help-content.js.map +1 -1
  89. package/dist/cli/main.js +20 -30
  90. package/dist/cli/main.js.map +1 -1
  91. package/dist/cli/register-list-query.js +4 -2
  92. package/dist/cli/register-list-query.js.map +1 -1
  93. package/dist/cli/register-mutation.js +11 -3
  94. package/dist/cli/register-mutation.js.map +1 -1
  95. package/dist/cli/register-setup.js +4 -2
  96. package/dist/cli/register-setup.js.map +1 -1
  97. package/dist/cli/registration-helpers.js +3 -2
  98. package/dist/cli/registration-helpers.js.map +1 -1
  99. package/dist/cli-bundle/bundle-manifest.json +782 -0
  100. package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
  101. package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
  102. package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
  106. package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
  107. package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
  111. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
  113. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
  115. package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
  116. package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
  118. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
  120. package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
  121. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
  123. package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
  127. package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
  129. package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
  131. package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
  133. package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
  134. package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
  136. package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
  137. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
  138. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
  142. package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
  143. package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
  144. package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
  146. package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
  148. package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
  149. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
  150. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
  155. package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
  156. package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
  158. package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
  160. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
  161. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
  163. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
  165. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
  167. package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
  168. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
  169. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
  170. package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
  172. package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
  175. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
  177. package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
  178. package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
  179. package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
  181. package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
  183. package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
  184. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
  185. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
  188. package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
  190. package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
  191. package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
  192. package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
  194. package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
  195. package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
  196. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
  198. package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
  199. package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
  200. package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
  202. package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
  203. package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
  206. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
  208. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
  209. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
  211. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
  212. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
  214. package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
  216. package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
  217. package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
  218. package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
  219. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
  220. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
  222. package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
  223. package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
  225. package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
  230. package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
  231. package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
  232. package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
  233. package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
  234. package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
  235. package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
  236. package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
  237. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
  238. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
  240. package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
  241. package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
  243. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
  245. package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
  246. package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
  248. package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
  249. package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
  250. package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
  252. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
  254. package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
  255. package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
  257. package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
  258. package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
  259. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
  260. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
  262. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
  263. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
  265. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
  266. package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
  267. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
  268. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
  269. package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
  270. package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
  271. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
  272. package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
  273. package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
  274. package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
  275. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
  276. package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
  277. package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
  278. package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
  279. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
  280. package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
  281. package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
  282. package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
  283. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
  284. package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
  285. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
  286. package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
  287. package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
  288. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
  289. package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
  290. package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
  291. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
  292. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
  293. package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
  294. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
  295. package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
  296. package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
  297. package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
  298. package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
  299. package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
  300. package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
  301. package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
  302. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
  303. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
  304. package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
  305. package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
  306. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
  307. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
  309. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
  311. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
  312. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
  313. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
  314. package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
  315. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
  316. package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
  317. package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
  318. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
  319. package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
  321. package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
  322. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
  323. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
  324. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
  325. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
  326. package/dist/cli-bundle/main.js +826 -43
  327. package/dist/cli-bundle/main.js.map +4 -4
  328. package/dist/cli-bundle/sdk-runtime.js +70 -57
  329. package/dist/cli-bundle/sdk-testing.js +6 -6
  330. package/dist/cli-bundle/sdk.js +876 -74
  331. package/dist/cli-bundle/sdk.js.map +4 -4
  332. package/dist/cli.js +5 -4
  333. package/dist/cli.js.map +1 -1
  334. package/dist/core/diagnostics/remediation.js +12 -2
  335. package/dist/core/diagnostics/remediation.js.map +1 -1
  336. package/dist/core/history/projection.d.ts +39 -0
  337. package/dist/core/history/projection.js +164 -0
  338. package/dist/core/history/projection.js.map +1 -0
  339. package/dist/core/history/read.d.ts +3 -0
  340. package/dist/core/history/read.js +55 -0
  341. package/dist/core/history/read.js.map +1 -0
  342. package/dist/core/output/output-control.d.ts +18 -0
  343. package/dist/core/output/output-control.js +26 -0
  344. package/dist/core/output/output-control.js.map +1 -0
  345. package/dist/core/output/output.js +20 -8
  346. package/dist/core/output/output.js.map +1 -1
  347. package/dist/core/sentry/helpers.js +10 -2
  348. package/dist/core/sentry/helpers.js.map +1 -1
  349. package/dist/core/shared/command-types.d.ts +2 -0
  350. package/dist/core/shared/command-types.js +2 -2
  351. package/dist/core/shared/command-types.js.map +1 -1
  352. package/dist/core/shared/errors.d.ts +11 -0
  353. package/dist/core/shared/errors.js +2 -2
  354. package/dist/core/shared/errors.js.map +1 -1
  355. package/dist/mcp/server.d.ts +2 -2
  356. package/dist/mcp/tool-definitions.js +5 -5
  357. package/dist/mcp/tool-definitions.js.map +1 -1
  358. package/dist/sdk/author-attribution.d.ts +35 -0
  359. package/dist/sdk/author-attribution.js +118 -0
  360. package/dist/sdk/author-attribution.js.map +1 -0
  361. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
  362. package/dist/sdk/cli-contracts/command-aliases.js +17 -0
  363. package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
  364. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  365. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  366. package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
  367. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  368. package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
  369. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  370. package/dist/sdk/cli-contracts/tool-schema.js +3 -3
  371. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  372. package/dist/sdk/cli-contracts.d.ts +1 -0
  373. package/dist/sdk/cli-contracts.js +3 -2
  374. package/dist/sdk/cli-contracts.js.map +1 -1
  375. package/dist/sdk/cli-program.d.ts +8 -0
  376. package/dist/sdk/cli-program.js +39 -0
  377. package/dist/sdk/cli-program.js.map +1 -0
  378. package/dist/sdk/command-line.d.ts +11 -0
  379. package/dist/sdk/command-line.js +40 -0
  380. package/dist/sdk/command-line.js.map +1 -0
  381. package/dist/sdk/config.d.ts +163 -0
  382. package/dist/sdk/config.js +1087 -0
  383. package/dist/sdk/config.js.map +1 -0
  384. package/dist/sdk/context-relevance.d.ts +21 -0
  385. package/dist/sdk/context-relevance.js +70 -2
  386. package/dist/sdk/context-relevance.js.map +1 -1
  387. package/dist/sdk/dependencies.d.ts +15 -2
  388. package/dist/sdk/dependencies.js +97 -8
  389. package/dist/sdk/dependencies.js.map +1 -1
  390. package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
  391. package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
  392. package/dist/sdk/extension/bundled-catalog.js.map +1 -0
  393. package/dist/sdk/extension/concurrency.d.ts +7 -0
  394. package/dist/sdk/extension/concurrency.js +26 -0
  395. package/dist/sdk/extension/concurrency.js.map +1 -0
  396. package/dist/sdk/extension/describe.d.ts +91 -0
  397. package/dist/sdk/extension/describe.js +144 -0
  398. package/dist/sdk/extension/describe.js.map +1 -0
  399. package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
  400. package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
  401. package/dist/sdk/extension/doctor.js.map +1 -0
  402. package/dist/sdk/extension/install-runtime.d.ts +26 -0
  403. package/dist/sdk/extension/install-runtime.js +269 -0
  404. package/dist/sdk/extension/install-runtime.js.map +1 -0
  405. package/dist/sdk/extension/install-snapshot.d.ts +23 -0
  406. package/dist/sdk/extension/install-snapshot.js +66 -0
  407. package/dist/sdk/extension/install-snapshot.js.map +1 -0
  408. package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
  409. package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
  410. package/dist/sdk/extension/install-sources.js.map +1 -0
  411. package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
  412. package/dist/sdk/extension/managed-state.js.map +1 -0
  413. package/dist/sdk/extension/scaffold.d.ts +36 -0
  414. package/dist/sdk/extension/scaffold.js +2436 -0
  415. package/dist/sdk/extension/scaffold.js.map +1 -0
  416. package/dist/sdk/extension/shared.d.ts +28 -0
  417. package/dist/sdk/extension/shared.js +140 -0
  418. package/dist/sdk/extension/shared.js.map +1 -0
  419. package/dist/sdk/extension/update-check.d.ts +15 -0
  420. package/dist/sdk/extension/update-check.js +68 -0
  421. package/dist/sdk/extension/update-check.js.map +1 -0
  422. package/dist/sdk/extension.d.ts +367 -0
  423. package/dist/sdk/extension.js +2174 -0
  424. package/dist/sdk/extension.js.map +1 -0
  425. package/dist/sdk/governance/gc.d.ts +56 -0
  426. package/dist/sdk/governance/gc.js +276 -0
  427. package/dist/sdk/governance/gc.js.map +1 -0
  428. package/dist/sdk/governance/health.d.ts +187 -0
  429. package/dist/sdk/governance/health.js +1796 -0
  430. package/dist/sdk/governance/health.js.map +1 -0
  431. package/dist/sdk/governance/validate.d.ts +255 -0
  432. package/dist/sdk/governance/validate.js +2175 -0
  433. package/dist/sdk/governance/validate.js.map +1 -0
  434. package/dist/sdk/history-compact.d.ts +142 -0
  435. package/dist/sdk/history-compact.js +508 -0
  436. package/dist/sdk/history-compact.js.map +1 -0
  437. package/dist/sdk/history-mcp.d.ts +17 -0
  438. package/dist/sdk/history-mcp.js +68 -0
  439. package/dist/sdk/history-mcp.js.map +1 -0
  440. package/dist/sdk/history-read.d.ts +31 -0
  441. package/dist/sdk/history-read.js +58 -0
  442. package/dist/sdk/history-read.js.map +1 -0
  443. package/dist/sdk/history-redact.d.ts +120 -0
  444. package/dist/sdk/history-redact.js +577 -0
  445. package/dist/sdk/history-redact.js.map +1 -0
  446. package/dist/sdk/history-repair.d.ts +89 -0
  447. package/dist/sdk/history-repair.js +263 -0
  448. package/dist/sdk/history-repair.js.map +1 -0
  449. package/dist/sdk/index.d.ts +25 -1
  450. package/dist/sdk/index.js +27 -3
  451. package/dist/sdk/index.js.map +1 -1
  452. package/dist/sdk/init-agent-guidance.d.ts +113 -0
  453. package/dist/sdk/init-agent-guidance.js +437 -0
  454. package/dist/sdk/init-agent-guidance.js.map +1 -0
  455. package/dist/sdk/init.d.ts +186 -0
  456. package/dist/sdk/init.js +733 -0
  457. package/dist/sdk/init.js.map +1 -0
  458. package/dist/sdk/invocation-author.d.ts +2 -0
  459. package/dist/sdk/invocation-author.js +39 -0
  460. package/dist/sdk/invocation-author.js.map +1 -0
  461. package/dist/sdk/item-children.d.ts +45 -0
  462. package/dist/sdk/item-children.js +75 -0
  463. package/dist/sdk/item-children.js.map +1 -0
  464. package/dist/sdk/item-schedule.d.ts +26 -0
  465. package/dist/sdk/item-schedule.js +28 -0
  466. package/dist/sdk/item-schedule.js.map +1 -0
  467. package/dist/sdk/output.d.ts +7 -0
  468. package/dist/sdk/output.js +11 -0
  469. package/dist/sdk/output.js.map +1 -0
  470. package/dist/sdk/pagination.d.ts +4 -1
  471. package/dist/sdk/pagination.js +13 -5
  472. package/dist/sdk/pagination.js.map +1 -1
  473. package/dist/sdk/profile.d.ts +176 -0
  474. package/dist/sdk/profile.js +431 -0
  475. package/dist/sdk/profile.js.map +1 -0
  476. package/dist/sdk/relationship-analytics.d.ts +108 -0
  477. package/dist/sdk/relationship-analytics.js +292 -0
  478. package/dist/sdk/relationship-analytics.js.map +1 -0
  479. package/dist/sdk/relationship-context.d.ts +67 -0
  480. package/dist/sdk/relationship-context.js +207 -0
  481. package/dist/sdk/relationship-context.js.map +1 -0
  482. package/dist/sdk/relationship-history.d.ts +109 -0
  483. package/dist/sdk/relationship-history.js +401 -0
  484. package/dist/sdk/relationship-history.js.map +1 -0
  485. package/dist/sdk/relationships.d.ts +145 -0
  486. package/dist/sdk/relationships.js +551 -0
  487. package/dist/sdk/relationships.js.map +1 -0
  488. package/dist/sdk/runtime-input.d.ts +10 -0
  489. package/dist/sdk/runtime-input.js +60 -0
  490. package/dist/sdk/runtime-input.js.map +1 -0
  491. package/dist/sdk/runtime.d.ts +31 -8
  492. package/dist/sdk/runtime.js +61 -57
  493. package/dist/sdk/runtime.js.map +1 -1
  494. package/dist/sdk/schema.d.ts +507 -0
  495. package/dist/sdk/schema.js +1269 -0
  496. package/dist/sdk/schema.js.map +1 -0
  497. package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
  498. package/dist/{cli/commands → sdk}/templates.js +9 -9
  499. package/dist/sdk/templates.js.map +1 -0
  500. package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
  501. package/dist/sdk/test/linked-command-detection.js +525 -0
  502. package/dist/sdk/test/linked-command-detection.js.map +1 -0
  503. package/docs/COMMANDS.md +58 -40
  504. package/docs/EXTENSIONS.md +10 -1
  505. package/docs/RELATIONSHIP_GRAPH.md +113 -0
  506. package/docs/RELEASING.md +2 -0
  507. package/docs/SDK.md +156 -9
  508. package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
  509. package/marketplace.json +2 -2
  510. package/package.json +3 -2
  511. package/packages/pm-beads/package.json +1 -1
  512. package/packages/pm-calendar/package.json +1 -1
  513. package/packages/pm-command-kit/package.json +1 -1
  514. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
  515. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
  516. package/packages/pm-governance-audit/package.json +1 -1
  517. package/packages/pm-guide-shell/package.json +1 -1
  518. package/packages/pm-kanban/package.json +1 -1
  519. package/packages/pm-lifecycle-hooks/package.json +1 -1
  520. package/packages/pm-linked-test-adapters/package.json +1 -1
  521. package/packages/pm-search-advanced/package.json +1 -1
  522. package/packages/pm-templates/package.json +1 -1
  523. package/packages/pm-todos/package.json +1 -1
  524. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  525. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  526. package/scripts/bundle-cli.mjs +66 -23
  527. package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
  528. package/dist/cli/commands/extension/doctor.js.map +0 -1
  529. package/dist/cli/commands/extension/install-sources.js.map +0 -1
  530. package/dist/cli/commands/extension/managed-state.js.map +0 -1
  531. package/dist/cli/commands/templates.js.map +0 -1
  532. package/dist/cli/commands/test/linked-command-detection.js +0 -248
  533. package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
  534. package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
  535. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
  536. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
  537. package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
  539. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
  540. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
  541. package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
  542. package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
  543. package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
  544. package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
  545. package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
  546. package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
  547. package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
  548. package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
  549. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
  550. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
  551. package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
  552. package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
  553. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
  554. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
  555. package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
  556. package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
  557. package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
  558. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
  559. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
  560. package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
  561. package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
  562. package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
  563. package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
  564. package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
  565. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
  566. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
  567. package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
  568. package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
  569. package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
  570. package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
  572. package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
  573. package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
  574. package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
  575. package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
  576. package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
  577. package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
  578. package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
  579. package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
  580. package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
  581. package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
  582. package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
  583. package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
  584. package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
  585. package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
  586. package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
  587. package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
  588. package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
  589. package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
  590. package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
  591. package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
  592. package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
  593. package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
  594. package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
  595. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
  596. package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
  597. package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
  598. /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
  667. /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
  668. /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
  669. /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
  670. /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
  671. /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
  672. /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
  673. /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
  674. /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
  675. /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
  676. /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
  677. /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
  678. /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
  679. /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
  680. /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
  681. /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
  682. /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
  683. /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
  684. /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
  685. /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
  686. /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
  687. /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
  688. /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
  689. /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
  690. /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
  691. /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
  692. /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
  693. /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
  694. /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
  695. /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
  696. /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
  697. /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
  698. /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
  699. /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
  700. /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
  701. /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
  702. /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
  703. /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
  704. /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
  705. /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
  706. /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
  707. /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
  708. /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../../sdk/define.ts", "../../../../../../../sdk/index.ts"],
4
- "sourcesContent": ["/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(\n manifest: TManifest,\n): TManifest {\n return manifest;\n}\n\n/**\n * Type a project-profile definition for the profile registry.\n *\n * A profile bundles item types, statuses, fields, per-type workflows, config\n * knobs, create templates, and package recommendations into one declarative\n * archetype that `pm profile apply` stages idempotently. This builder checks the\n * object against {@link ProjectProfileDefinition} where it is authored — catching\n * an invalid field type or a malformed workflow at edit time — while preserving\n * the literal `name`/`types`/`statuses` so a package's archetype stays strongly\n * typed at the definition site, mirroring {@link defineItemType}. It is the\n * authoring anchor a first-party or third-party profile package builds on.\n */\nexport function defineProjectProfile<TProfile extends ProjectProfileDefinition>(\n profile: TProfile,\n): TProfile {\n return profile;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(\n definition: TDefinition,\n): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(\n type: TType,\n): TType {\n return type;\n}\n\n/**\n * Type a custom item-metadata field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(\n field: TField,\n): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(\n migration: TMigration,\n): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<\n TProvider extends SearchProviderDefinition,\n>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<\n TAdapter extends VectorStoreAdapterDefinition,\n>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(\n override: CommandOverride,\n): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(\n override: PreflightOverride,\n): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(\n override: ServiceOverride,\n): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(\n renderer: RendererOverride,\n): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(\n hook: BeforeCommandHook,\n): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(\n hook: AfterCommandHook,\n): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n", "/**\n * @module sdk/index\n *\n * Defines public SDK APIs and package-author helpers for Index.\n */\nexport {\n isErrnoError,\n limitAnnotationEntries,\n parseAnnotationTextInput,\n readAnnotationEntries,\n resolveAnnotationInput,\n resolveAnnotationIndex,\n runAnnotationCommand,\n wrapOwnershipConflict,\n type AnnotationCommandConfig,\n type AnnotationCommandOptions,\n type AnnotationCommandResult,\n type AnnotationEntry,\n type AnnotationInput,\n type AnnotationSourceOptions,\n type OwnershipConflictGuidance,\n} from \"./annotations.js\";\nimport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n} from \"../core/extensions/loader.js\";\nexport { RESERVED_ITEM_FIELD_NAMES } from \"../core/extensions/item-fields.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageCatalogLinkMap,\n type PmPackageCatalogMediaMap,\n type PmPackageCatalogMetadata,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport type {\n CommanderOptionAliasContract,\n CommanderOptionRegistrationContract,\n} from \"./cli-contracts.js\";\nexport {\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,\n APPEND_FLAG_CONTRACTS,\n CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,\n CALENDAR_FLAG_CONTRACTS,\n CLAIM_FLAG_CONTRACTS,\n CLOSE_FLAG_CONTRACTS,\n CLOSE_MANY_FLAG_CONTRACTS,\n CLOSE_TASK_FLAG_CONTRACTS,\n COMMENTS_FLAG_CONTRACTS,\n COMPLETION_FLAG_CONTRACTS,\n CONFIG_FLAG_CONTRACTS,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n CONTEXT_FLAG_CONTRACTS,\n CONTRACTS_FLAG_CONTRACTS,\n COPY_FLAG_CONTRACTS,\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS,\n CREATE_FLAG_CONTRACTS,\n DELETE_FLAG_CONTRACTS,\n DEPS_FLAG_CONTRACTS,\n DOCS_FLAG_CONTRACTS,\n EVAL_FLAG_CONTRACTS,\n EXTENSION_ACTIVATE_FLAG_CONTRACTS,\n EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,\n EXTENSION_ADOPT_FLAG_CONTRACTS,\n EXTENSION_CATALOG_FLAG_CONTRACTS,\n EXTENSION_DEACTIVATE_FLAG_CONTRACTS,\n EXTENSION_DESCRIBE_FLAG_CONTRACTS,\n EXTENSION_DOCTOR_FLAG_CONTRACTS,\n EXTENSION_EXPLORE_FLAG_CONTRACTS,\n EXTENSION_FLAG_CONTRACTS,\n EXTENSION_INIT_FLAG_CONTRACTS,\n EXTENSION_INSTALL_FLAG_CONTRACTS,\n EXTENSION_MANAGE_FLAG_CONTRACTS,\n EXTENSION_RELOAD_FLAG_CONTRACTS,\n EXTENSION_SCOPE_FLAG_CONTRACTS,\n EXTENSION_UNINSTALL_FLAG_CONTRACTS,\n FILES_FLAG_CONTRACTS,\n FOCUS_FLAG_CONTRACTS,\n GC_FLAG_CONTRACTS,\n GET_FLAG_CONTRACTS,\n GLOBAL_FLAG_CONTRACTS,\n GUIDE_FLAG_CONTRACTS,\n HEALTH_FLAG_CONTRACTS,\n HISTORY_COMPACT_FLAG_CONTRACTS,\n HISTORY_FLAG_CONTRACTS,\n HISTORY_REDACT_FLAG_CONTRACTS,\n HISTORY_REPAIR_FLAG_CONTRACTS,\n INIT_FLAG_CONTRACTS,\n INSTALL_FLAG_CONTRACTS,\n LEARNINGS_FLAG_CONTRACTS,\n LIST_COMMANDER_STRING_OPTION_CONTRACTS,\n LIST_FILTER_FLAG_CONTRACTS,\n MEET_FLAG_CONTRACTS,\n NEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n NEXT_FLAG_CONTRACTS,\n NOTES_FLAG_CONTRACTS,\n PACKAGE_FLAG_CONTRACTS,\n PACKAGE_INIT_FLAG_CONTRACTS,\n PAUSE_TASK_FLAG_CONTRACTS,\n PLAN_FLAG_CONTRACTS,\n PM_CORE_COMMAND_NAMES,\n PM_EXTENSION_CAPABILITY_CONTRACTS,\n PM_EXTENSION_POLICY_MODE_CONTRACTS,\n PM_EXTENSION_POLICY_SURFACE_CONTRACTS,\n PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,\n PM_EXTENSION_SERVICE_NAME_CONTRACTS,\n PM_EXTENSION_TRUST_MODE_CONTRACTS,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,\n PM_TOOL_ACTIONS,\n PM_TOOL_ACTION_PARAMETER_CONTRACTS,\n PM_TOOL_PARAMETERS_SCHEMA,\n PM_TOOL_PARAMETERS_SCHEMA_MAJOR,\n PM_TOOL_PARAMETERS_SCHEMA_VERSION,\n PROFILE_FLAG_CONTRACTS,\n REINDEX_FLAG_CONTRACTS,\n RELEASE_FLAG_CONTRACTS,\n REMIND_FLAG_CONTRACTS,\n RESTORE_FLAG_CONTRACTS,\n SCHEMA_FLAG_CONTRACTS,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,\n SEARCH_FLAG_CONTRACTS,\n START_TASK_FLAG_CONTRACTS,\n STATS_FLAG_CONTRACTS,\n SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,\n TELEMETRY_FLAG_CONTRACTS,\n TEST_ALL_FLAG_CONTRACTS,\n TEST_FLAG_CONTRACTS,\n TEST_RUNS_FLAG_CONTRACTS,\n TOOL_ACTIVITY_OPTION_CONTRACTS,\n TOOL_AGGREGATE_OPTION_CONTRACTS,\n TOOL_CALENDAR_OPTION_CONTRACTS,\n TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_CONTEXT_OPTION_CONTRACTS,\n TOOL_CREATE_OPTION_CONTRACTS,\n TOOL_DEPS_OPTION_CONTRACTS,\n TOOL_LIST_FILTER_OPTION_CONTRACTS,\n TOOL_SEARCH_FILTER_OPTION_CONTRACTS,\n TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,\n TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_UPDATE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,\n UPDATE_FLAG_CONTRACTS,\n UPDATE_MANY_FLAG_CONTRACTS,\n UPGRADE_FLAG_CONTRACTS,\n compactFlagAliasContracts,\n isPmExtensionCapabilityContract,\n isPmExtensionPolicyModeContract,\n isPmExtensionPolicySurfaceContract,\n isPmExtensionServiceNameContract,\n isPmToolAction,\n readFirstStringFromCommanderOptions,\n readFirstValueFromCommanderOptions,\n readStringArrayFromCommanderOptions,\n resolveSubcommandFlagContractsForCommand,\n toCompletionFlagString,\n withFlagAliasMetadata,\n} from \"./cli-contracts.js\";\nexport type {\n CliFlagContract,\n PmActionSchemaContract,\n PmExtensionCapabilityContract,\n PmExtensionPolicyModeContract,\n PmExtensionPolicySurfaceContract,\n PmExtensionSandboxProfileContract,\n PmExtensionServiceNameContract,\n PmExtensionTrustModeContract,\n PmToolAction,\n ToolOptionFlagContract,\n} from \"./cli-contracts.js\";\nexport * from \"./compose.js\";\nexport * from \"./context-relevance.js\";\nexport * from \"./context-packing.js\";\nexport * from \"./context-usage.js\";\nexport {\n collectDanglingDependencyReferences,\n runDeps,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DepsCollapseMode,\n type DepsFormat,\n type DepsGraphEdge,\n type DepsGraphNode,\n type DepsGraphResult,\n type DepsTreeNode,\n} from \"./dependencies.js\";\nexport { runDocs } from \"./docs.js\";\nexport {\n runFiles,\n runFilesDiscover,\n type FilesDiscoveryCandidate,\n} from \"./files.js\";\nexport {\n applyPathMigrations,\n applyStandaloneNote,\n artifactKey,\n dedupeLinkedArtifacts,\n ensureScope,\n expandAddGlobEntries,\n normalizeLinkedPath,\n parseAddEntries,\n parseAddGlobEntries,\n parseMigrateEntries,\n parseRemoveEntries,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n validateLinkedPaths,\n type AddGlobEntry,\n type LinkedArtifact,\n type LinkedArtifactCommandOptions,\n type LinkedArtifactKindConfig,\n type LinkedArtifactResult,\n type LinkedPathValidation,\n type PathMigration,\n} from \"./linked-artifacts.js\";\nexport * from \"./pagination.js\";\nexport type {\n PlanCommandOptions,\n PlanCommandResult,\n PlanDispatchInput,\n PlanResultPlan,\n PlanShowDepth,\n PlanStepSummary,\n PlanSubcommand,\n PlanTemplateName,\n} from \"../cli/commands/plan.js\";\nexport {\n PLAN_SHOW_DEPTH_VALUES,\n PLAN_SUBCOMMANDS,\n PLAN_TEMPLATE_NAMES,\n} from \"../cli/commands/plan.js\";\nexport * from \"./define.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n BUILTIN_ITEM_TYPE_VALUES,\n CONFIDENCE_TEXT_VALUES,\n CURRENT_ITEM_FORMAT_VERSION,\n DEPENDENCY_KIND_VALUES,\n EXIT_CODE,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n PM_CLI_EXPECTED_ERROR_NAME,\n PmCliError,\n PmClient,\n RISK_VALUES,\n STATUS_VALUES,\n acquireLock,\n appendHistoryEntry,\n canonicalDocument,\n classifyItemFormatVersion,\n clearWorkspaceContractsCache,\n commitImportedItem,\n createHistoryEntry,\n createPmCliExpectedError,\n effectiveItemFormatVersion,\n emptyImportedDocument,\n ensureTrackerInitialized,\n generateItemId,\n getActiveExtensionRegistrations,\n getContracts,\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n getWorkspaceContracts,\n isPmCliExpectedError,\n isTimestampLiteral,\n listAllItemMetadata,\n loadCreateTemplateOptions,\n locateItem,\n normalizeItemMetadata,\n normalizeItemFormatVersion,\n normalizeItemId,\n normalizeRawItemId,\n normalizeStatusInput,\n nowIso,\n parseTags,\n pathExists,\n readBooleanOption,\n readCsvListOption,\n readFileIfExists,\n readLocatedItem,\n readRequiredString,\n readSettings,\n readStringOption,\n removeFileIfExists,\n renderCalendarMarkdown,\n renderCalendarToon,\n renderGuideMarkdown,\n resolveCalendarOutputFormat,\n resolveGuideOutputFormat,\n resolveItemTypeRegistry,\n resolvePmRoot,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n runAction,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n runCalendar,\n runCompletion,\n runGuide,\n runReindex,\n runSearch,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n scanItemFormatVersions,\n selectImportAuthor,\n serializeItemDocument,\n splitFrontMatter,\n toEstimatedMinutesValue,\n toImportBoolean,\n toImportConfidence,\n toImportInteger,\n toImportLinkedDocs,\n toImportLinkedFiles,\n toImportLinkedTests,\n toImportLogEntries,\n toImportNormalizedEnum,\n toImportNumberMap,\n toImportPriority,\n toImportStatus,\n toImportStringList,\n toImportStringMap,\n toImportTags,\n toNonEmptyImportString,\n writeFileAtomic,\n aggregate,\n append,\n claim,\n claimNext,\n close,\n closeTask,\n comments,\n config,\n context,\n copy,\n create,\n deleteItem,\n deps,\n docs,\n extension,\n extensionActivate,\n extensionDeactivate,\n extensionList,\n files,\n filesDiscover,\n focus,\n gc,\n get,\n health,\n init,\n learnings,\n list,\n next,\n notes,\n packageActivate,\n packageCatalog,\n packageDeactivate,\n packageDescribe,\n packageDoctor,\n packageInstall,\n packageLifecycle,\n packageList,\n packageManage,\n packageReload,\n packageUninstall,\n pauseTask,\n profile,\n profileApply,\n profileLint,\n profileList,\n profileShow,\n release,\n restore,\n schema,\n schemaAddField,\n schemaAddStatus,\n schemaAddType,\n schemaApplyPreset,\n schemaInferTypes,\n schemaList,\n schemaListFields,\n schemaRemoveField,\n schemaRemoveStatus,\n schemaRemoveType,\n schemaShow,\n schemaShowField,\n schemaShowStatus,\n search,\n startTask,\n stats,\n update,\n upgrade,\n validate,\n type AggregateOptions,\n type AggregateResult,\n type AggregateRow,\n type AppendCommandOptions,\n type AppendResult,\n type BlockerEntry,\n type CalendarOptions,\n type CalendarResult,\n type ClaimResult,\n type CloseResult,\n type CloseTaskResult,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n type CommentsCommandOptions,\n type CommentsResult,\n type ConfigCommandOptions,\n type ConfigResult,\n type CompletionResult,\n type CompletionShell,\n type ContractsCommandOptions,\n type ContractsResult,\n type ContextFocusItem,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n type CopyResult,\n type CreatePmCliExpectedErrorOptions,\n type CreateResult,\n type CreateTemplateOptions,\n type Dependency,\n type DeleteResult,\n type DepsCommandOptions,\n type DepsResult,\n type DocsCommandOptions,\n type DocsResult,\n type ExtensionCommandOptions,\n type ExtensionCommandResult,\n type FilesCommandOptions,\n type FilesDiscoverOptions,\n type FilesDiscoverResult,\n type FilesResult,\n type FocusResult,\n type GcCommandOptions,\n type GcResult,\n type GetContractsOptions,\n type GetOptions,\n type GetResult,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n type HealthResult,\n type ImportLinkedScope,\n type InitCommandOptions,\n type InitResult,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n type LearningsCommandOptions,\n type LearningsResult,\n type LinkedDoc,\n type LinkedFile,\n type LinkedTest,\n type ListedItem,\n type ListCompactResult,\n type ListOptions,\n type ListResult,\n type ListSortField,\n type ListSortOrder,\n type ListVerboseResult,\n type LogNote,\n type NextActionableItem,\n type NextBlockerRef,\n type NextOptions,\n type NextOutputFormat,\n type NextRecommendation,\n type NextResult,\n type NotesCommandOptions,\n type NotesResult,\n type PackageCommandOptions,\n type PackageCommandResult,\n type PauseTaskResult,\n type PmActionInput,\n type PmActionName,\n type PmActionOptions,\n type PmClientFullMutationOptions,\n type PmClientMutationOptions,\n type PmClientOptions,\n type PmClientRunArgs,\n type PmCliExpectedError,\n type ProfileApplyCommandOptions,\n type ProfileApplyResult,\n type ProfileLintResult,\n type ProfileListResult,\n type ProfileResult,\n type ProfileShowResult,\n type ProfileSubcommand,\n type ReindexOptions,\n type ReindexResult,\n type ReleaseResult,\n type RestoreResult,\n type RunHealthOptions,\n type SchemaAddFieldCommandOptions,\n type SchemaAddFieldResult,\n type SchemaAddStatusCommandOptions,\n type SchemaAddStatusResult,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeInferCommandOptions,\n type SchemaAddTypeInferResult,\n type SchemaAddTypeResult,\n type SchemaApplyPresetCommandOptions,\n type SchemaApplyPresetResult,\n type SchemaInspectResult,\n type SchemaListFieldsResult,\n type SchemaListResult,\n type SchemaRemoveFieldCommandOptions,\n type SchemaRemoveFieldResult,\n type SchemaRemoveStatusCommandOptions,\n type SchemaRemoveStatusResult,\n type SchemaRemoveTypeCommandOptions,\n type SchemaRemoveTypeResult,\n type SchemaShowFieldResult,\n type SchemaShowResult,\n type SchemaShowStatusResult,\n type SchemaResult,\n type SchemaSubcommand,\n type SearchCompactResult,\n type SearchHit,\n type SearchHitHighlight,\n type SearchMatchMode,\n type SearchOptions,\n type ClaimNextOptions,\n type SearchResult,\n type SearchResultItem,\n type SearchVerboseResult,\n type StartTaskResult,\n type StatsCommandOptions,\n type StatsResult,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n type ToImportLinkedArtifactsOptions,\n type ToImportLinkedTestsOptions,\n type ToImportLogEntriesOptions,\n type UpdateResult,\n type UpgradeCommandOptions,\n type UpgradeResult,\n type ValidateCommandOptions,\n type ValidateResult,\n type WorkspaceContracts,\n type WorkspaceContractsOptions,\n} from \"./runtime.js\";\nexport {\n BUILTIN_PROFILES,\n listProfiles,\n normalizeProfileName,\n PROFILE_NAMES,\n resolveProfile,\n type ProfileConfigEntry,\n type ProfileName,\n type ProfilePackageRecommendation,\n type ProfileTemplateEntry,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ProjectProfileRegistrationInput,\n} from \"../core/profile/profile-presets.js\";\nexport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileComponentChange,\n type ProfileConfigChange,\n type ProfileConfigPlan,\n type ProfileCurrentState,\n type ProfilePackagePlan,\n type ProfileSchemaPlan,\n type ProfileTemplateChange,\n type ProfileTemplatePlan,\n type ProfileWorkflowChange,\n type ProfileWorkflowPlan,\n} from \"../core/profile/profile-plan.js\";\nexport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n type ProjectProfileDescription,\n type ProjectProfilePackageSummary,\n} from \"../core/profile/profile-describe.js\";\nexport {\n lintProjectProfile,\n PROFILE_LINT_CODES,\n PROFILE_LINT_DIMENSIONS,\n type ProfileLintCode,\n type ProfileLintDimension,\n type ProfileLintSeverity,\n type ProjectProfileLintFinding,\n type ProjectProfileLintReport,\n} from \"../core/profile/profile-lint.js\";\nexport {\n assertExtensionBlueprint,\n assertExtensionCapabilityUsage,\n assertExtensionDeactivated,\n assertExtensionManifestCompatible,\n assertExtensionManifestMatchesBlueprint,\n assertExtensionPreflight,\n assertPackageManifest,\n assertProjectProfile,\n assertRegisteredCommandContract,\n assertRegisteredCommandOverride,\n assertRegisteredExporter,\n assertRegisteredFlags,\n assertRegisteredHook,\n assertRegisteredImporter,\n assertRegisteredItemField,\n assertRegisteredItemType,\n assertRegisteredMigration,\n assertRegisteredParserOverride,\n assertRegisteredPreflightOverride,\n assertRegisteredProfile,\n assertRegisteredRendererOverride,\n assertRegisteredSearchProvider,\n assertRegisteredServiceOverride,\n assertRegisteredVectorStoreAdapter,\n activateExtensionForTest,\n createExtensionTestHarness,\n deactivateExtensionForTest,\n describeExtensionActivation,\n runRegisteredCommandForTest,\n runRegisteredCommandOverrideForTest,\n runRegisteredExporterForTest,\n runRegisteredHookForTest,\n runRegisteredImporterForTest,\n runRegisteredMigrationForTest,\n runRegisteredParserOverrideForTest,\n runRegisteredPreflightOverrideForTest,\n runRegisteredRendererOverrideForTest,\n runRegisteredSearchProviderForTest,\n runRegisteredServiceOverrideForTest,\n runRegisteredVectorStoreAdapterForTest,\n type ActivateExtensionForTestOptions,\n type AssertProjectProfileOptions,\n type DeactivateExtensionForTestOptions,\n type DescribeExtensionActivationOptions,\n type ExtensionActivationSummary,\n type RenderExtensionHarnessMarkdownOptions,\n type RunRegisteredCommandForTestOptions,\n type RunRegisteredExporterForTestOptions,\n type RunRegisteredHookForTestOptions,\n type RunRegisteredImporterForTestOptions,\n type RunRegisteredMigrationForTestOptions,\n type RunRegisteredSearchProviderForTestOptions,\n type RunRegisteredVectorStoreAdapterForTestOptions,\n type SearchProviderOperationContexts,\n type SearchProviderOperationResults,\n type VectorStoreAdapterOperationContexts,\n type VectorStoreAdapterOperationResults,\n type ExtensionCapabilityUsageAssertion,\n type ExtensionCapabilityUsageExpectation,\n type ExtensionDeactivationExpectation,\n type ExtensionManifestBlueprintMatch,\n type ExtensionTestHarness,\n type PackageManifestExpectation,\n type PackageManifestResourceExpectation,\n type RegisteredCommandContractAssertion,\n type RegisteredCommandContractExpectation,\n type RegisteredCommandOverrideExpectation,\n type RegisteredExporterExpectation,\n type RegisteredFlagsExpectation,\n type RegisteredHookExpectation,\n type RegisteredHookKind,\n type RegisteredImporterExpectation,\n type RegisteredItemFieldAssertion,\n type RegisteredItemFieldExpectation,\n type RegisteredItemTypeAssertion,\n type RegisteredItemTypeExpectation,\n type RegisteredMigrationExpectation,\n type RegisteredParserOverrideExpectation,\n type RegisteredPreflightOverrideExpectation,\n type RegisteredProfileAssertion,\n type RegisteredProfileExpectation,\n type RegisteredRendererOverrideExpectation,\n type RegisteredSearchProviderExpectation,\n type RegisteredServiceOverrideExpectation,\n type RegisteredVectorStoreAdapterExpectation,\n} from \"./testing.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/** Canonical extension governance policy modes and registration surfaces. */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\n/** Public contract for extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\n/** Public contract for extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\n/** Public contract for extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Versioned capability contract metadata emitted by runtime diagnostics. */\nexport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n};\n\n/** Least-privilege capability reconciliation helpers: map declared capabilities against the registration surfaces a package actually exercises at activation. */\nexport {\n EXTENSION_CAPABILITY_REGISTRATION_SURFACES,\n collectUsedExtensionCapabilities,\n reconcileExtensionCapabilityUsage,\n type CollectUsedExtensionCapabilitiesOptions,\n type ExtensionCapabilityUsageReconciliation,\n} from \"../core/extensions/capability-usage.js\";\n\n/**\n * Render an extension/package activation summary\n * ({@link describeExtensionActivation} / {@link describeExtensionBlueprint}) to a\n * deterministic Markdown reference document — the author-facing *render* leg of\n * the describe verb, for drift-free package READMEs.\n */\nexport {\n renderExtensionSurfaceMarkdown,\n type ExtensionSurfaceMarkdownOptions,\n} from \"../core/extensions/activation-summary-markdown.js\";\n\nexport type {\n AfterCommandAffectedItem,\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandHandlerResult,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDeactivationFailure,\n ExtensionDeactivationOptions,\n ExtensionDeactivationResult,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionHookRegistry,\n ExtensionSelfIdentity,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionManifestEngines,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RegisteredExtensionExporter,\n RegisteredExtensionFlagDefinitions,\n RegisteredExtensionHook,\n RegisteredExtensionImporter,\n RegisteredExtensionProjectProfile,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionServiceOverride,\n RegisteredExtensionVectorStoreAdapter,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n PmSettings,\n} from \"../types/index.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEM,SAAU,wBACd,UAAmB;AAEnB,SAAO;AACT;AAcM,SAAU,qBACdA,UAAiB;AAEjB,SAAOA;AACT;AAUM,SAAU,cACd,YAAuB;AAEvB,SAAO;AACT;AAUM,SAAU,WAAyC,MAAW;AAClE,SAAO;AACT;AAQM,SAAU,eACd,MAAW;AAEX,SAAO;AACT;AASM,SAAU,gBACd,OAAa;AAEb,SAAO;AACT;AASM,SAAU,gBACd,WAAqB;AAErB,SAAO;AACT;AASM,SAAU,qBAEd,UAAmB;AACnB,SAAO;AACT;AASM,SAAU,yBAEd,SAAiB;AACjB,SAAO;AACT;AASM,SAAU,sBACd,UAAyB;AAEzB,SAAO;AACT;AASM,SAAU,qBAAqB,UAAwB;AAC3D,SAAO;AACT;AAQM,SAAU,wBACd,UAA2B;AAE3B,SAAO;AACT;AASM,SAAU,sBACd,UAAyB;AAEzB,SAAO;AACT;AAQM,SAAU,uBACd,UAA0B;AAE1B,SAAO;AACT;AASM,SAAU,eAAe,UAAkB;AAC/C,SAAO;AACT;AASM,SAAU,eAAe,UAAkB;AAC/C,SAAO;AACT;AASM,SAAU,wBACd,MAAuB;AAEvB,SAAO;AACT;AASM,SAAU,uBACd,MAAsB;AAEtB,SAAO;AACT;AAQM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;AAQM,SAAU,iBAAiB,MAAgB;AAC/C,SAAO;AACT;AASM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;;;;;;;;;;ACuYO,IAAM,yBAAyB;AAK/B,IAAM,yBAAyB;AAE/B,IAAM,4BAA4B;AAElC,IAAM,wBAAwB;AAE9B,IAAM,6BAA6B;",
6
- "names": ["profile"]
3
+ "sources": ["../../../../../../../sdk/relationship-analytics.ts", "../../../../../../../sdk/relationship-history.ts", "../../../../../../../sdk/define.ts", "../../../../../../../sdk/index.ts"],
4
+ "sourcesContent": ["/**\n * @module sdk/relationship-analytics\n *\n * Provides exact, deterministic graph analytics with explicit semantics and\n * provenance suitable for planning, impact analysis, and context selection.\n */\nimport type { RelationshipSnapshot } from \"./relationship-history.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n type RelationshipQueryOptions,\n} from \"./relationships.js\";\n\n/** Exact execution-graph analysis over registered ordering kinds. */\nexport interface RelationshipExecutionAnalysis {\n /** Whether the result is exact rather than sampled or approximate. */\n exact: true;\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Deterministic topological order for acyclic nodes. */\n order: string[];\n /** Parallelizable topological layers. */\n layers: string[][];\n /** Nodes with no prerequisites. */\n frontier: string[];\n /** Longest prerequisite distance for each acyclic node. */\n depth: Record<string, number>;\n /** Longest deterministic execution path. */\n criticalPath: string[];\n /** Edge count of the critical path. */\n criticalPathLength: number;\n /** Strongly connected order-bearing components that represent cycles. */\n cycles: string[][];\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"kahn-longest-path\"; edgeFamily: \"ordering\" };\n}\n\n/** One affected node with its exact shortest explanation path. */\nexport interface RelationshipImpactRow {\n /** Affected node identifier. */\n id: string;\n /** Shortest relationship distance from the root. */\n distance: number;\n /** Exact path explaining why the node is affected. */\n path: string[];\n}\n\n/** Bounded reverse- or forward-impact result. */\nexport interface RelationshipImpactAnalysis {\n /** Impact origin. */\n root: string;\n /** Deterministic affected-node rows. */\n affected: RelationshipImpactRow[];\n /** Returned rows are exact even when the bounded result is incomplete. */\n exact: true;\n /** Whether configured traversal bounds omitted reachable work. */\n truncated: boolean;\n /** Query work retained for performance and explainability. */\n cost: { visitedNodes: number; inspectedEdges: number };\n}\n\n/** Exact structural summary of the complete graph snapshot. */\nexport interface RelationshipKnowledgeAnalysis {\n /** Weakly connected components, largest then lexicographic. */\n components: string[][];\n /** Strongly connected components over directed stored edges. */\n stronglyConnected: string[][];\n /** Nodes with no relationship edges. */\n orphans: string[];\n /** Maximum-degree nodes and their unique-neighbor degree. */\n hubs: { id: string; degree: number }[];\n /** Whether the result is exact. */\n exact: true;\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"component-degree\"; edgeFamily: \"all\" };\n}\n\n/** Edge-level delta between two immutable snapshots. */\nexport interface RelationshipSnapshotComparison {\n /** Earlier snapshot version. */\n fromVersion: number;\n /** Later snapshot version. */\n toVersion: number;\n /** Edges introduced in the later snapshot. */\n added: RelationshipEdge[];\n /** Edges absent from the later snapshot. */\n removed: RelationshipEdge[];\n /** Number of byte-equivalent edges retained. */\n unchangedCount: number;\n /** Whether the comparison is exact. */\n exact: true;\n}\n\n/** Registry override for custom domain semantics. */\nexport interface RelationshipAnalyticsOptions {\n /** Registry used to interpret ordering direction and custom kinds. */\n registry?: RelationshipKindRegistry;\n}\n\nfunction appendNeighbor(\n adjacency: Map<string, Set<string>>,\n source: string,\n target: string,\n): void {\n adjacency.get(source)!.add(target);\n}\n\nfunction createAdjacency(nodes: readonly string[]): Map<string, Set<string>> {\n return new Map(nodes.map((node) => [node, new Set<string>()]));\n}\n\nfunction sortComponents(components: string[][]): string[][] {\n for (const component of components) component.sort();\n return components.sort(\n (left, right) =>\n right.length - left.length || left[0]!.localeCompare(right[0]!),\n );\n}\n\nfunction stableJsonValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map((entry) => stableJsonValue(entry));\n if (value === null || typeof value !== \"object\") return value;\n const toJSON = (value as { toJSON?: (this: object) => unknown }).toJSON;\n if (typeof toJSON === \"function\") return stableJsonValue(toJSON.call(value));\n return Object.fromEntries(\n Object.entries(value)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, stableJsonValue(entry)]),\n );\n}\n\nfunction relationshipEdgeKey(edge: RelationshipEdge): string {\n return JSON.stringify(stableJsonValue(edge));\n}\n\nfunction appendFinishingOrder(\n start: string,\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n visited: Set<string>,\n order: string[],\n): void {\n const stack = [{ id: start, expanded: false }];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current.expanded) {\n order.push(current.id);\n continue;\n }\n if (visited.has(current.id)) continue;\n visited.add(current.id);\n stack.push({ id: current.id, expanded: true });\n const neighbors = [...adjacency.get(current.id)!].sort().reverse();\n for (const neighbor of neighbors)\n if (!visited.has(neighbor)) stack.push({ id: neighbor, expanded: false });\n }\n}\n\nfunction computeFinishingOrder(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n const visited = new Set<string>();\n const order: string[] = [];\n for (const start of nodes)\n if (!visited.has(start))\n appendFinishingOrder(start, adjacency, visited, order);\n return order;\n}\n\nfunction collectReverseComponents(\n order: readonly string[],\n reverse: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const visited = new Set<string>();\n const components: string[][] = [];\n for (const start of [...order].reverse()) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of reverse.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n return sortComponents(components);\n}\n\nfunction stronglyConnectedComponents(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const reverse = createAdjacency(nodes);\n for (const [source, targets] of adjacency)\n for (const target of targets) appendNeighbor(reverse, target, source);\n return collectReverseComponents(\n computeFinishingOrder(nodes, adjacency),\n reverse,\n );\n}\n\nfunction buildExecutionAdjacency(\n graph: RelationshipGraph,\n registry: RelationshipKindRegistry,\n): Map<string, Set<string>> {\n const adjacency = createAdjacency(graph.nodes());\n for (const edge of graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n // Legacy and JSON-parsed definitions may predate explicit precedence.\n const sourceFirst =\n (definition.precedence ?? \"source_before_target\") ===\n \"source_before_target\";\n appendNeighbor(\n adjacency,\n sourceFirst ? edge.source : edge.target,\n sourceFirst ? edge.target : edge.source,\n );\n }\n return adjacency;\n}\n\nfunction topologicalLayers(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const indegree = new Map(nodes.map((node) => [node, 0]));\n for (const targets of adjacency.values())\n for (const target of targets)\n indegree.set(target, indegree.get(target)! + 1);\n let frontier = nodes.filter((node) => indegree.get(node) === 0).sort();\n const layers: string[][] = [];\n while (frontier.length > 0) {\n layers.push(frontier);\n const next: string[] = [];\n for (const source of frontier) {\n for (const target of adjacency.get(source)!) {\n const remaining = indegree.get(target)! - 1;\n indegree.set(target, remaining);\n if (remaining === 0) next.push(target);\n }\n }\n frontier = next.sort();\n }\n return layers;\n}\n\nfunction longestPath(\n order: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): { depth: Record<string, number>; path: string[] } {\n const depth = new Map(order.map((node) => [node, 0]));\n const parent = new Map<string, string>();\n for (const source of order) {\n for (const target of adjacency.get(source)!) {\n if (!depth.has(target)) continue;\n const candidate = depth.get(source)! + 1;\n const currentParent = parent.get(target);\n if (\n candidate > depth.get(target)! ||\n (candidate === depth.get(target)! &&\n (currentParent === undefined ||\n source.localeCompare(currentParent) < 0))\n ) {\n depth.set(target, candidate);\n parent.set(target, source);\n }\n }\n }\n const end = [...order].sort(\n (left, right) =>\n depth.get(right)! - depth.get(left)! || left.localeCompare(right),\n )[0];\n const path = end === undefined ? [] : [end];\n while (path[0] !== undefined && parent.has(path[0]!))\n path.unshift(parent.get(path[0]!)!);\n return { depth: Object.fromEntries(depth), path };\n}\n\nfunction reconstructImpactPath(\n root: string,\n target: string,\n parents: ReadonlyMap<string, string>,\n): string[] {\n const path = [target];\n let cursor = target;\n while (cursor !== root) {\n cursor = parents.get(cursor)!;\n path.push(cursor);\n }\n return path.reverse();\n}\n\n/** Analyze registered order-bearing relationships without treating associative cycles as blockers. */\nexport function analyzeRelationshipExecution(\n graph: RelationshipGraph,\n options: RelationshipAnalyticsOptions = {},\n): RelationshipExecutionAnalysis {\n const registry = options.registry ?? createRelationshipKindRegistry();\n const nodes = [...graph.nodes()];\n const adjacency = buildExecutionAdjacency(graph, registry);\n const layers = topologicalLayers(nodes, adjacency);\n const order = layers.flat();\n const acyclic = order.length === nodes.length;\n const cycles = acyclic\n ? []\n : stronglyConnectedComponents(nodes, adjacency).filter(\n (component) =>\n component.length > 1 ||\n adjacency.get(component[0]!)!.has(component[0]!),\n );\n const longest = longestPath(order, adjacency);\n return {\n exact: true,\n acyclic,\n order,\n layers,\n frontier: layers[0] ?? [],\n depth: longest.depth,\n criticalPath: longest.path,\n criticalPathLength: Math.max(0, longest.path.length - 1),\n cycles,\n provenance: { algorithm: \"kahn-longest-path\", edgeFamily: \"ordering\" },\n };\n}\n\n/** Compute bounded impact rows and exact shortest explanation paths. */\nexport function analyzeGraphImpact(\n graph: RelationshipGraph,\n root: string,\n options: RelationshipQueryOptions = {},\n): RelationshipImpactAnalysis {\n const direction = options.direction ?? \"outgoing\";\n const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const queue = [{ id: root, depth: 0 }];\n const seen = new Set([root]);\n const parents = new Map<string, string>();\n const affected: RelationshipImpactRow[] = [];\n let visitedNodes = 0;\n let inspectedEdges = 0;\n let truncated = false;\n traversal: for (let index = 0; index < queue.length; index += 1) {\n options.signal?.throwIfAborted();\n const current = queue[index]!;\n visitedNodes += 1;\n const adjacent = graph.adjacency(current.id, {\n direction,\n kinds: options.kinds,\n signal: options.signal,\n });\n inspectedEdges += adjacent.meta.inspectedEdges;\n if (current.depth >= maxDepth) {\n if (adjacent.value.some((id) => !seen.has(id))) truncated = true;\n continue;\n }\n for (const id of adjacent.value) {\n if (seen.has(id)) continue;\n if (affected.length >= limit) {\n truncated = true;\n break traversal;\n }\n seen.add(id);\n parents.set(id, current.id);\n const depth = current.depth + 1;\n affected.push({\n id,\n distance: depth,\n path: reconstructImpactPath(root, id, parents),\n });\n queue.push({ id, depth });\n }\n }\n return {\n root,\n affected,\n exact: true,\n truncated,\n cost: { visitedNodes, inspectedEdges },\n };\n}\n\n/** Analyze weak/strong components, isolates, and exact unique-neighbor hubs. */\nexport function analyzeKnowledgeGraph(\n graph: RelationshipGraph,\n): RelationshipKnowledgeAnalysis {\n const nodes = [...graph.nodes()];\n const weak = createAdjacency(nodes);\n const directed = createAdjacency(nodes);\n for (const edge of graph.edges()) {\n appendNeighbor(weak, edge.source, edge.target);\n appendNeighbor(weak, edge.target, edge.source);\n appendNeighbor(directed, edge.source, edge.target);\n }\n const components: string[][] = [];\n const visited = new Set<string>();\n for (const start of nodes) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of weak.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n const degrees = nodes.map((id) => ({ id, degree: weak.get(id)!.size }));\n const maximum = Math.max(0, ...degrees.map(({ degree }) => degree));\n return {\n components: sortComponents(components),\n stronglyConnected: stronglyConnectedComponents(nodes, directed),\n orphans: degrees.filter(({ degree }) => degree === 0).map(({ id }) => id),\n hubs: degrees.filter(({ degree }) => degree > 0 && degree === maximum),\n exact: true,\n provenance: { algorithm: \"component-degree\", edgeFamily: \"all\" },\n };\n}\n\n/** Compare two immutable relationship snapshots by full normalized edge value. */\nexport function compareRelationshipSnapshots(\n before: RelationshipSnapshot,\n after: RelationshipSnapshot,\n): RelationshipSnapshotComparison {\n const earlier = new Map(\n before.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n const later = new Map(\n after.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n return {\n fromVersion: before.version,\n toVersion: after.version,\n added: [...later]\n .filter(([key]) => !earlier.has(key))\n .map(([, edge]) => edge),\n removed: [...earlier]\n .filter(([key]) => !later.has(key))\n .map(([, edge]) => edge),\n unchangedCount: [...earlier.keys()].filter((key) => later.has(key)).length,\n exact: true,\n };\n}\n", "/**\n * @module sdk/relationship-history\n *\n * Provides an append-only, storage-independent relationship event ledger with\n * optimistic concurrency, deterministic replay, snapshots, and cursor pages.\n */\nimport {\n createQueryFingerprint,\n decodeQueryCursorState,\n paginateQueryRows,\n} from \"./pagination.js\";\nimport { constants } from \"node:fs\";\nimport { lstat, mkdir, open, type FileHandle } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n} from \"./relationships.js\";\n\n/** Mutation kinds retained in the immutable relationship event stream. */\nexport type RelationshipEventAction = \"add\" | \"remove\" | \"supersede\";\n\n/** Caller-authored relationship mutation before its sequence is assigned. */\nexport interface RelationshipEventInput {\n /** Globally unique idempotency key for this event. */\n eventId: string;\n /** Stable logical relationship identifier across superseding events. */\n relationshipId: string;\n /** Append, remove, or replace the logical relationship. */\n action: RelationshipEventAction;\n /** Edge required for add and supersede actions. */\n edge?: RelationshipEdge;\n /** Attributable actor responsible for the mutation. */\n author: string;\n /** Valid event-time timestamp. */\n timestamp: string;\n /** Optional optimistic concurrency precondition. */\n expectedVersion?: number;\n /** Optional human-readable mutation rationale. */\n reason?: string;\n}\n\n/** One immutable sequenced relationship mutation. */\nexport interface RelationshipEvent extends Omit<\n RelationshipEventInput,\n \"expectedVersion\"\n> {\n /** One-based append sequence assigned by the ledger. */\n sequence: number;\n}\n\n/** Point-in-time materialized relationship view. */\nexport interface RelationshipSnapshot {\n /** Final event sequence included in this snapshot. */\n version: number;\n /** Timestamp of the final included event, when one exists. */\n asOf?: string;\n /** Deterministic active edge materialization. */\n edges: readonly RelationshipEdge[];\n /** Immutable graph query view over the active edges. */\n graph: RelationshipGraph;\n}\n\n/** Stable cursor page over a fixed relationship event-log version. */\nexport interface RelationshipEventPage {\n /** Log version against which this page was produced. */\n version: number;\n /** Events in append order. */\n events: RelationshipEvent[];\n /** Whether another event page exists. */\n hasMore: boolean;\n /** Opaque continuation cursor when another page exists. */\n nextCursor?: string;\n}\n\n/** Construction controls for the in-memory reference ledger. */\nexport interface RelationshipEventLogOptions {\n /** Registry defining edge semantics and cardinality. */\n registry?: RelationshipKindRegistry;\n}\n\n/** Filesystem controls for the durable relationship event store. */\nexport interface RelationshipEventStoreOptions extends RelationshipEventLogOptions {\n /** Tracker root that owns the relationship history directory. */\n pmRoot: string;\n /** Fixed node universe validated by every replay and append. */\n nodes: Iterable<string>;\n /** Optional JSONL path relative to the tracker root. */\n relativePath?: string;\n}\n\ninterface RelationshipCardinalityIndexes {\n identities: Map<string, string>;\n outgoingOne: Map<string, string>;\n incomingOne: Map<string, string>;\n}\n\nfunction requiredText(value: unknown, field: string): string {\n if (typeof value !== \"string\" || value.trim().length === 0)\n throw new TypeError(`Relationship event ${field} must be non-empty`);\n return value.trim();\n}\n\nfunction edgeIdentity(\n edge: RelationshipEdge,\n registry: RelationshipKindRegistry,\n): string {\n const definition = registry.require(edge.kind);\n const endpoints =\n definition.direction === \"undirected\"\n ? [edge.source, edge.target].sort().join(\"\\u0000\")\n : `${edge.source}\\u0000${edge.target}`;\n return `${definition.kind}\\u0000${endpoints}`;\n}\n\nfunction freezeEdge(edge: RelationshipEdge): RelationshipEdge {\n return Object.freeze({\n ...edge,\n ...(edge.payload === undefined\n ? {}\n : { payload: Object.freeze(structuredClone(edge.payload)) }),\n });\n}\n\nfunction assertCardinality(\n candidate: RelationshipEdge,\n excludeRelationshipId: string,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): void {\n const definition = registry.require(candidate.kind);\n const outgoingOwner = indexes.outgoingOne.get(\n `${definition.kind}\\u0000${candidate.source}`,\n );\n if (outgoingOwner !== undefined && outgoingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship outgoing cardinality exceeded for ${definition.kind}`,\n );\n const incomingOwner = indexes.incomingOne.get(\n `${definition.kind}\\u0000${candidate.target}`,\n );\n if (incomingOwner !== undefined && incomingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship incoming cardinality exceeded for ${definition.kind}`,\n );\n const identity = edgeIdentity(candidate, registry);\n const identityOwner = indexes.identities.get(identity);\n if (identityOwner !== undefined && identityOwner !== excludeRelationshipId)\n throw new TypeError(`Relationship edge already active: ${identity}`);\n}\n\nfunction replayEvents(\n events: readonly RelationshipEvent[],\n): Map<string, RelationshipEdge> {\n const active = new Map<string, RelationshipEdge>();\n for (const event of events) {\n if (event.action === \"remove\") active.delete(event.relationshipId);\n else active.set(event.relationshipId, event.edge!);\n }\n return active;\n}\n\nfunction normalizeEventHeader(\n input: RelationshipEventInput,\n currentVersion: number,\n eventIds: ReadonlySet<string>,\n): {\n eventId: string;\n relationshipId: string;\n author: string;\n timestamp: string;\n} {\n if (\n input.expectedVersion !== undefined &&\n input.expectedVersion !== currentVersion\n )\n throw new TypeError(\n `Relationship event version conflict: expected ${input.expectedVersion}, current ${currentVersion}`,\n );\n const eventId = requiredText(input.eventId, \"eventId\");\n if (eventIds.has(eventId))\n throw new TypeError(`Relationship event already exists: ${eventId}`);\n if (\n input.action !== \"add\" &&\n input.action !== \"remove\" &&\n input.action !== \"supersede\"\n )\n throw new TypeError(`Unknown relationship event action: ${input.action}`);\n if (!Number.isFinite(Date.parse(input.timestamp)))\n throw new TypeError(\"Relationship event timestamp must be valid\");\n return {\n eventId,\n relationshipId: requiredText(input.relationshipId, \"relationshipId\"),\n author: requiredText(input.author, \"author\"),\n timestamp: new Date(input.timestamp).toISOString(),\n };\n}\n\nfunction resolveMutationEdge(\n input: RelationshipEventInput,\n relationshipId: string,\n active: ReadonlyMap<string, RelationshipEdge>,\n nodes: ReadonlySet<string>,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): RelationshipEdge | undefined {\n const isActive = active.has(relationshipId);\n if (input.action === \"add\" && isActive)\n throw new TypeError(`Relationship is already active: ${relationshipId}`);\n if (input.action !== \"add\" && !isActive)\n throw new TypeError(`Relationship is not active: ${relationshipId}`);\n if (input.action === \"remove\") return undefined;\n if (!input.edge)\n throw new TypeError(`Relationship ${input.action} event requires an edge`);\n const source =\n typeof input.edge.source === \"string\" ? input.edge.source.trim() : \"\";\n const target =\n typeof input.edge.target === \"string\" ? input.edge.target.trim() : \"\";\n if (!nodes.has(source) || !nodes.has(target))\n throw new TypeError(\n `Relationship endpoint not found: ${source} -> ${target}`,\n );\n const canonical = new RelationshipGraph(\n [source, target],\n [input.edge],\n registry,\n ).edges()[0]!;\n assertCardinality(canonical, relationshipId, registry, indexes);\n return freezeEdge(canonical);\n}\n\n/**\n * Append-only in-memory reference ledger. Durable adapters can persist the\n * returned immutable events while reusing the same replay and validation model.\n */\nexport class RelationshipEventLog {\n readonly #nodes: ReadonlySet<string>;\n readonly #registry: RelationshipKindRegistry;\n readonly #events: RelationshipEvent[] = [];\n readonly #eventIds = new Set<string>();\n readonly #active = new Map<string, RelationshipEdge>();\n readonly #cardinalityIndexes: RelationshipCardinalityIndexes = {\n identities: new Map(),\n outgoingOne: new Map(),\n incomingOne: new Map(),\n };\n\n /** Create an empty relationship ledger for a fixed node universe. */\n public constructor(\n nodes: Iterable<string>,\n options: RelationshipEventLogOptions = {},\n ) {\n this.#nodes = new Set(\n [...nodes]\n .filter((node): node is string => typeof node === \"string\")\n .map((node) => node.trim())\n .filter(Boolean),\n );\n this.#registry = options.registry ?? createRelationshipKindRegistry();\n }\n\n /** Current append sequence. */\n public get version(): number {\n return this.#events.length;\n }\n\n /** Return an immutable copy of the full event stream. */\n public events(): readonly RelationshipEvent[] {\n return Object.freeze([...this.#events]);\n }\n\n /** Add one active relationship to constant-time validation indexes. */\n #indexActive(relationshipId: string, edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.set(\n edgeIdentity(edge, this.#registry),\n relationshipId,\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.set(\n `${definition.kind}\\u0000${edge.source}`,\n relationshipId,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.set(\n `${definition.kind}\\u0000${edge.target}`,\n relationshipId,\n );\n }\n\n /** Remove one superseded or deleted relationship from validation indexes. */\n #unindexActive(edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.delete(\n edgeIdentity(edge, this.#registry),\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.delete(\n `${definition.kind}\\u0000${edge.source}`,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.delete(\n `${definition.kind}\\u0000${edge.target}`,\n );\n }\n\n /** Validate and append one attributable relationship mutation. */\n public append(input: RelationshipEventInput): RelationshipEvent {\n const header = normalizeEventHeader(input, this.version, this.#eventIds);\n const previous = this.#active.get(header.relationshipId);\n const edge = resolveMutationEdge(\n input,\n header.relationshipId,\n this.#active,\n this.#nodes,\n this.#registry,\n this.#cardinalityIndexes,\n );\n\n const event = Object.freeze({\n eventId: header.eventId,\n relationshipId: header.relationshipId,\n action: input.action,\n ...(edge === undefined ? {} : { edge }),\n author: header.author,\n timestamp: header.timestamp,\n ...(input.reason?.trim() ? { reason: input.reason.trim() } : {}),\n sequence: this.version + 1,\n }) satisfies RelationshipEvent;\n this.#events.push(event);\n this.#eventIds.add(header.eventId);\n if (previous) this.#unindexActive(previous);\n if (input.action === \"remove\") this.#active.delete(header.relationshipId);\n else {\n this.#active.set(header.relationshipId, edge!);\n this.#indexActive(header.relationshipId, edge!);\n }\n return event;\n }\n\n /** Materialize an exact point-in-time graph without mutating the ledger. */\n public snapshot(\n options: {\n atVersion?: number;\n atTimestamp?: string;\n } = {},\n ): RelationshipSnapshot {\n if (options.atVersion !== undefined && options.atTimestamp !== undefined)\n throw new TypeError(\"Relationship snapshot accepts one target\");\n let included: RelationshipEvent[];\n if (options.atTimestamp !== undefined) {\n const timestamp = Date.parse(options.atTimestamp);\n if (!Number.isFinite(timestamp))\n throw new TypeError(\"Relationship snapshot timestamp must be valid\");\n let lastIndex = -1;\n for (let index = this.#events.length - 1; index >= 0; index -= 1) {\n if (Date.parse(this.#events[index]!.timestamp) > timestamp) continue;\n lastIndex = index;\n break;\n }\n included = lastIndex === -1 ? [] : this.#events.slice(0, lastIndex + 1);\n } else {\n const version = options.atVersion ?? this.version;\n if (!Number.isInteger(version) || version < 0 || version > this.version)\n throw new TypeError(\n `Relationship snapshot version out of range: ${version}`,\n );\n included = this.#events.slice(0, version);\n }\n const active = replayEvents(included);\n const graph = new RelationshipGraph(\n this.#nodes,\n active.values(),\n this.#registry,\n );\n return Object.freeze({\n version: included.length,\n ...(included.at(-1) ? { asOf: included.at(-1)!.timestamp } : {}),\n edges: graph.edges(),\n graph,\n });\n }\n\n /** Page the immutable event stream with a cursor bound to this log version. */\n public page(options: {\n limit: number;\n cursor?: string;\n }): RelationshipEventPage {\n if (!Number.isInteger(options.limit) || options.limit < 1)\n throw new TypeError(\"Relationship event page limit must be positive\");\n const fingerprint = createQueryFingerprint(\"relationship-events\", {\n order: \"append-sequence\",\n });\n const snapshot =\n options.cursor === undefined\n ? this.version\n : Number(decodeQueryCursorState(options.cursor, fingerprint).snapshot);\n if (\n !Number.isSafeInteger(snapshot) ||\n snapshot < 0 ||\n snapshot > this.version\n )\n throw new TypeError(\n \"Relationship event cursor snapshot version is invalid\",\n );\n const page = paginateQueryRows(this.#events.slice(0, snapshot), {\n cursor: options.cursor,\n fingerprint,\n limit: options.limit,\n readId: (event) => event.eventId,\n snapshot: String(snapshot),\n });\n return {\n version: snapshot,\n events: page.rows,\n hasMore: page.has_more,\n ...(page.next_cursor ? { nextCursor: page.next_cursor } : {}),\n };\n }\n}\n\nconst RELATIONSHIP_STORE_LOCK_ID = \"relationship-event-store\";\nconst RELATIONSHIP_NOFOLLOW_FLAG = constants.O_NOFOLLOW;\n\nfunction acquireRelationshipStoreLock(\n pmRoot: string,\n): Promise<() => Promise<void>> {\n return acquireLock(\n pmRoot,\n RELATIONSHIP_STORE_LOCK_ID,\n 30,\n `relationship-store:${process.pid}`,\n false,\n false,\n 3_000,\n );\n}\n\nasync function resolveRelationshipEventStorePath(\n pmRoot: string,\n relativePath = \"relationships/events.jsonl\",\n): Promise<string> {\n const root = path.resolve(pmRoot);\n const target = path.resolve(root, relativePath);\n const relative = path.relative(root, target);\n if (relative.length === 0)\n throw new TypeError(\n \"Relationship event path must name a file within the tracker root\",\n );\n if (\n relative === \"..\" ||\n relative.startsWith(`..${path.sep}`) ||\n path.isAbsolute(relative)\n )\n throw new TypeError(\n \"Relationship event path must stay within the tracker root\",\n );\n await mkdir(root, { recursive: true });\n const rootStats = await lstat(root);\n if (rootStats.isSymbolicLink())\n throw new TypeError(\n \"Relationship event tracker root must not be a symbolic link\",\n );\n let current = root;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n try {\n if ((await lstat(current)).isSymbolicLink())\n throw new TypeError(\n \"Relationship event path must not contain symbolic links\",\n );\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") break;\n throw error;\n }\n }\n return target;\n}\n\nasync function loadRelationshipEventLog(\n target: string,\n nodes: readonly string[],\n registry: RelationshipKindRegistry | undefined,\n): Promise<RelationshipEventLog> {\n const log = new RelationshipEventLog(nodes, { registry });\n let raw: string;\n let handle: FileHandle | undefined;\n try {\n handle = await open(\n target,\n constants.O_RDONLY | RELATIONSHIP_NOFOLLOW_FLAG,\n );\n raw = await handle.readFile(\"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return log;\n throw error;\n } finally {\n await handle?.close();\n }\n const lines = raw.split(\"\\n\");\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]!.trim();\n if (!line) continue;\n let stored: RelationshipEvent;\n try {\n stored = JSON.parse(line) as RelationshipEvent;\n } catch {\n throw new TypeError(\n `Invalid relationship event JSONL at line ${index + 1}`,\n );\n }\n if (stored.sequence !== log.version + 1)\n throw new TypeError(\n `Invalid relationship event sequence at line ${index + 1}`,\n );\n log.append({\n eventId: stored.eventId,\n relationshipId: stored.relationshipId,\n action: stored.action,\n ...(stored.edge === undefined ? {} : { edge: stored.edge }),\n author: stored.author,\n timestamp: stored.timestamp,\n ...(stored.reason === undefined ? {} : { reason: stored.reason }),\n expectedVersion: log.version,\n });\n }\n return log;\n}\n\n/**\n * Lock-serialized durable JSONL adapter for {@link RelationshipEventLog}.\n * Every append replays the current stream while holding the workspace lock, so\n * independent processes share optimistic versions without lost updates.\n */\nexport class RelationshipEventStore {\n readonly #pmRoot: string;\n readonly #nodes: readonly string[];\n readonly #registry: RelationshipKindRegistry | undefined;\n readonly #path: string;\n #log: RelationshipEventLog;\n\n private constructor(\n options: RelationshipEventStoreOptions,\n nodes: readonly string[],\n target: string,\n log: RelationshipEventLog,\n ) {\n this.#pmRoot = options.pmRoot;\n this.#nodes = nodes;\n this.#registry = options.registry;\n this.#path = target;\n this.#log = log;\n }\n\n /** Open and validate an existing stream or create an empty store view. */\n public static async open(\n options: RelationshipEventStoreOptions,\n ): Promise<RelationshipEventStore> {\n const nodes = Object.freeze([...options.nodes]);\n const target = await resolveRelationshipEventStorePath(\n options.pmRoot,\n options.relativePath,\n );\n const release = await acquireRelationshipStoreLock(options.pmRoot);\n try {\n await resolveRelationshipEventStorePath(options.pmRoot, target);\n const log = await loadRelationshipEventLog(\n target,\n nodes,\n options.registry,\n );\n return new RelationshipEventStore(options, nodes, target, log);\n } finally {\n await release();\n }\n }\n\n /** Absolute JSONL path, exposed for diagnostics and backup tooling. */\n public get path(): string {\n return this.#path;\n }\n\n /** Refresh from durable history and return the current validated append sequence. */\n public async currentVersion(): Promise<number> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.version;\n }\n\n /** Append one event after refreshing under the shared workspace lock. */\n public async append(\n input: RelationshipEventInput,\n ): Promise<RelationshipEvent> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n const refreshed = await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n const event = refreshed.append(input);\n await mkdir(path.dirname(target), { recursive: true });\n await resolveRelationshipEventStorePath(this.#pmRoot, target);\n const handle = await open(\n target,\n constants.O_APPEND |\n constants.O_CREAT |\n constants.O_WRONLY |\n RELATIONSHIP_NOFOLLOW_FLAG,\n );\n try {\n await handle.appendFile(`${JSON.stringify(event)}\\n`, \"utf8\");\n } finally {\n await handle.close();\n }\n this.#log = refreshed;\n return event;\n } finally {\n await release();\n }\n }\n\n /** Refresh from durable history and materialize an exact validated snapshot. */\n public async snapshot(\n options: Parameters<RelationshipEventLog[\"snapshot\"]>[0] = {},\n ): Promise<RelationshipSnapshot> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.snapshot(options);\n }\n\n /** Refresh from durable history and page immutable events. */\n public async page(\n options: Parameters<RelationshipEventLog[\"page\"]>[0],\n ): Promise<RelationshipEventPage> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.page(options);\n }\n\n /** Serialize a durable refresh with writers so readers never observe a torn JSONL tail. */\n async #refreshFromDurableHistory(): Promise<RelationshipEventLog> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n return await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n } finally {\n await release();\n }\n }\n}\n", "/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(\n manifest: TManifest,\n): TManifest {\n return manifest;\n}\n\n/**\n * Type a project-profile definition for the profile registry.\n *\n * A profile bundles item types, statuses, fields, per-type workflows, config\n * knobs, create templates, and package recommendations into one declarative\n * archetype that `pm profile apply` stages idempotently. This builder checks the\n * object against {@link ProjectProfileDefinition} where it is authored — catching\n * an invalid field type or a malformed workflow at edit time — while preserving\n * the literal `name`/`types`/`statuses` so a package's archetype stays strongly\n * typed at the definition site, mirroring {@link defineItemType}. It is the\n * authoring anchor a first-party or third-party profile package builds on.\n */\nexport function defineProjectProfile<TProfile extends ProjectProfileDefinition>(\n profile: TProfile,\n): TProfile {\n return profile;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(\n definition: TDefinition,\n): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(\n type: TType,\n): TType {\n return type;\n}\n\n/**\n * Type a custom item-metadata field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(\n field: TField,\n): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(\n migration: TMigration,\n): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<\n TProvider extends SearchProviderDefinition,\n>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<\n TAdapter extends VectorStoreAdapterDefinition,\n>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(\n override: CommandOverride,\n): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(\n override: PreflightOverride,\n): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(\n override: ServiceOverride,\n): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(\n renderer: RendererOverride,\n): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(\n hook: BeforeCommandHook,\n): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(\n hook: AfterCommandHook,\n): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n", "/**\n * @module sdk/index\n *\n * Defines public SDK APIs and package-author helpers for Index.\n */\nexport {\n isErrnoError,\n limitAnnotationEntries,\n parseAnnotationTextInput,\n readAnnotationEntries,\n resolveAnnotationInput,\n resolveAnnotationIndex,\n runAnnotationCommand,\n wrapOwnershipConflict,\n type AnnotationCommandConfig,\n type AnnotationCommandOptions,\n type AnnotationCommandResult,\n type AnnotationEntry,\n type AnnotationInput,\n type AnnotationSourceOptions,\n type OwnershipConflictGuidance,\n} from \"./annotations.js\";\nexport {\n inspectHistoryAuthorStream,\n scanHistoryAuthorAttribution,\n type HistoryAuthorAttributionScan,\n type UnknownAuthorHistoryEvent,\n} from \"./author-attribution.js\";\nexport { createPmCliProgram } from \"./cli-program.js\";\nexport {\n quoteCommandArg,\n quoteWindowsCommandArg,\n renderPmCommand,\n} from \"./command-line.js\";\nexport * from \"./governance/gc.js\";\nexport * from \"./governance/health.js\";\nexport * from \"./governance/validate.js\";\nexport { runExtension } from \"./extension.js\";\nexport { applyInvocationAuthorOverride } from \"./invocation-author.js\";\nexport {\n _testOnly as _testOnlyTemplates,\n type TemplateSource,\n} from \"./templates.js\";\nexport {\n runConfig,\n _testOnlyConfigCommand,\n type NestedSettingResultValue,\n} from \"./config.js\";\nexport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n _testOnly as _testOnlyInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n type RunInitAgentGuidanceOptions,\n type RunInitAgentGuidanceResult,\n} from \"./init-agent-guidance.js\";\nexport {\n runInit,\n summarizeInitResult,\n _testOnly as _testOnlyInit,\n type InitAgentGuidanceResult,\n type InitConciseResult,\n type InitInstalledPackagesSummary,\n type InitRegisteredTypePresetSummary,\n type InitTargetResolution,\n type InitTypePresetName,\n} from \"./init.js\";\nexport {\n PROFILE_SUBCOMMANDS,\n formatProfileApplyHuman,\n formatProfileLintHuman,\n formatProfileListHuman,\n formatProfileShowHuman,\n runProfileApply,\n runProfileLint,\n runProfileList,\n runProfileShow,\n type ProfileApplyDimension,\n type ProfileComposition,\n type ProfileListEntry,\n} from \"./profile.js\";\nimport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n} from \"../core/extensions/loader.js\";\nexport { RESERVED_ITEM_FIELD_NAMES } from \"../core/extensions/item-fields.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageCatalogLinkMap,\n type PmPackageCatalogMediaMap,\n type PmPackageCatalogMetadata,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport type {\n CommanderOptionAliasContract,\n CommanderOptionRegistrationContract,\n} from \"./cli-contracts.js\";\nexport {\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,\n APPEND_FLAG_CONTRACTS,\n CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,\n CALENDAR_FLAG_CONTRACTS,\n CLAIM_FLAG_CONTRACTS,\n CLOSE_FLAG_CONTRACTS,\n CLOSE_MANY_FLAG_CONTRACTS,\n CLOSE_TASK_FLAG_CONTRACTS,\n COMMENTS_FLAG_CONTRACTS,\n COMPLETION_FLAG_CONTRACTS,\n CONFIG_FLAG_CONTRACTS,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n CONTEXT_FLAG_CONTRACTS,\n CONTRACTS_FLAG_CONTRACTS,\n COPY_FLAG_CONTRACTS,\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS,\n CREATE_FLAG_CONTRACTS,\n DELETE_FLAG_CONTRACTS,\n DEPS_FLAG_CONTRACTS,\n DOCS_FLAG_CONTRACTS,\n EVAL_FLAG_CONTRACTS,\n EXTENSION_ACTIVATE_FLAG_CONTRACTS,\n EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,\n EXTENSION_ADOPT_FLAG_CONTRACTS,\n EXTENSION_CATALOG_FLAG_CONTRACTS,\n EXTENSION_DEACTIVATE_FLAG_CONTRACTS,\n EXTENSION_DESCRIBE_FLAG_CONTRACTS,\n EXTENSION_DOCTOR_FLAG_CONTRACTS,\n EXTENSION_EXPLORE_FLAG_CONTRACTS,\n EXTENSION_FLAG_CONTRACTS,\n EXTENSION_INIT_FLAG_CONTRACTS,\n EXTENSION_INSTALL_FLAG_CONTRACTS,\n EXTENSION_MANAGE_FLAG_CONTRACTS,\n EXTENSION_RELOAD_FLAG_CONTRACTS,\n EXTENSION_SCOPE_FLAG_CONTRACTS,\n EXTENSION_UNINSTALL_FLAG_CONTRACTS,\n FILES_FLAG_CONTRACTS,\n FOCUS_FLAG_CONTRACTS,\n GC_FLAG_CONTRACTS,\n GET_FLAG_CONTRACTS,\n GLOBAL_FLAG_CONTRACTS,\n GUIDE_FLAG_CONTRACTS,\n HEALTH_FLAG_CONTRACTS,\n HISTORY_COMPACT_FLAG_CONTRACTS,\n HISTORY_FLAG_CONTRACTS,\n HISTORY_REDACT_FLAG_CONTRACTS,\n HISTORY_REPAIR_FLAG_CONTRACTS,\n INIT_FLAG_CONTRACTS,\n INSTALL_FLAG_CONTRACTS,\n LEARNINGS_FLAG_CONTRACTS,\n LIST_COMMANDER_STRING_OPTION_CONTRACTS,\n LIST_FILTER_FLAG_CONTRACTS,\n MEET_FLAG_CONTRACTS,\n NEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n NEXT_FLAG_CONTRACTS,\n NOTES_FLAG_CONTRACTS,\n PACKAGE_FLAG_CONTRACTS,\n PACKAGE_INIT_FLAG_CONTRACTS,\n PAUSE_TASK_FLAG_CONTRACTS,\n PLAN_FLAG_CONTRACTS,\n PM_CORE_COMMAND_NAMES,\n PM_EXTENSION_CAPABILITY_CONTRACTS,\n PM_EXTENSION_POLICY_MODE_CONTRACTS,\n PM_EXTENSION_POLICY_SURFACE_CONTRACTS,\n PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,\n PM_EXTENSION_SERVICE_NAME_CONTRACTS,\n PM_EXTENSION_TRUST_MODE_CONTRACTS,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,\n PM_TOOL_ACTIONS,\n PM_TOOL_ACTION_PARAMETER_CONTRACTS,\n PM_TOOL_PARAMETERS_SCHEMA,\n PM_TOOL_PARAMETERS_SCHEMA_MAJOR,\n PM_TOOL_PARAMETERS_SCHEMA_VERSION,\n PROFILE_FLAG_CONTRACTS,\n REINDEX_FLAG_CONTRACTS,\n RELEASE_FLAG_CONTRACTS,\n REMIND_FLAG_CONTRACTS,\n RESTORE_FLAG_CONTRACTS,\n SCHEMA_FLAG_CONTRACTS,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,\n SEARCH_FLAG_CONTRACTS,\n START_TASK_FLAG_CONTRACTS,\n STATS_FLAG_CONTRACTS,\n SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,\n TELEMETRY_FLAG_CONTRACTS,\n TEST_ALL_FLAG_CONTRACTS,\n TEST_FLAG_CONTRACTS,\n TEST_RUNS_FLAG_CONTRACTS,\n TOOL_ACTIVITY_OPTION_CONTRACTS,\n TOOL_AGGREGATE_OPTION_CONTRACTS,\n TOOL_CALENDAR_OPTION_CONTRACTS,\n TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_CONTEXT_OPTION_CONTRACTS,\n TOOL_CREATE_OPTION_CONTRACTS,\n TOOL_DEPS_OPTION_CONTRACTS,\n TOOL_LIST_FILTER_OPTION_CONTRACTS,\n TOOL_SEARCH_FILTER_OPTION_CONTRACTS,\n TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,\n TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_UPDATE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,\n UPDATE_FLAG_CONTRACTS,\n UPDATE_MANY_FLAG_CONTRACTS,\n UPGRADE_FLAG_CONTRACTS,\n compactFlagAliasContracts,\n isPmExtensionCapabilityContract,\n isPmExtensionPolicyModeContract,\n isPmExtensionPolicySurfaceContract,\n isPmExtensionServiceNameContract,\n isPmToolAction,\n readFirstStringFromCommanderOptions,\n readFirstValueFromCommanderOptions,\n readStringArrayFromCommanderOptions,\n resolveSubcommandFlagContractsForCommand,\n toCompletionFlagString,\n withFlagAliasMetadata,\n} from \"./cli-contracts.js\";\nexport type {\n CliFlagContract,\n PmActionSchemaContract,\n PmExtensionCapabilityContract,\n PmExtensionPolicyModeContract,\n PmExtensionPolicySurfaceContract,\n PmExtensionSandboxProfileContract,\n PmExtensionServiceNameContract,\n PmExtensionTrustModeContract,\n PmToolAction,\n ToolOptionFlagContract,\n} from \"./cli-contracts.js\";\nexport * from \"./compose.js\";\nexport * from \"./context-relevance.js\";\nexport * from \"./context-packing.js\";\nexport * from \"./context-usage.js\";\nexport * from \"./history-compact.js\";\nexport * from \"./history-read.js\";\nexport * from \"./history-redact.js\";\nexport * from \"./history-repair.js\";\nexport * from \"./item-children.js\";\nexport * from \"./item-schedule.js\";\nexport {\n collectDanglingDependencyReferences,\n runDeps,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DepsCollapseMode,\n type DepsFormat,\n type DepsGraphEdge,\n type DepsGraphNode,\n type DepsGraphResult,\n type DepsTreeNode,\n} from \"./dependencies.js\";\nexport { runDocs } from \"./docs.js\";\nexport {\n runFiles,\n runFilesDiscover,\n type FilesDiscoveryCandidate,\n} from \"./files.js\";\nexport {\n applyPathMigrations,\n applyStandaloneNote,\n artifactKey,\n dedupeLinkedArtifacts,\n ensureScope,\n expandAddGlobEntries,\n normalizeLinkedPath,\n parseAddEntries,\n parseAddGlobEntries,\n parseMigrateEntries,\n parseRemoveEntries,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n validateLinkedPaths,\n type AddGlobEntry,\n type LinkedArtifact,\n type LinkedArtifactCommandOptions,\n type LinkedArtifactKindConfig,\n type LinkedArtifactResult,\n type LinkedPathValidation,\n type PathMigration,\n} from \"./linked-artifacts.js\";\nexport * from \"./pagination.js\";\nexport * from \"./output.js\";\nexport * from \"./relationship-analytics.js\";\nexport * from \"./relationship-context.js\";\nexport * from \"./relationship-history.js\";\nexport * from \"./relationships.js\";\nexport type {\n PlanCommandOptions,\n PlanCommandResult,\n PlanDispatchInput,\n PlanResultPlan,\n PlanShowDepth,\n PlanStepSummary,\n PlanSubcommand,\n PlanTemplateName,\n} from \"../cli/commands/plan.js\";\nexport {\n PLAN_SHOW_DEPTH_VALUES,\n PLAN_SUBCOMMANDS,\n PLAN_TEMPLATE_NAMES,\n} from \"../cli/commands/plan.js\";\nexport * from \"./define.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n BUILTIN_ITEM_TYPE_VALUES,\n CONFIDENCE_TEXT_VALUES,\n CURRENT_ITEM_FORMAT_VERSION,\n DEPENDENCY_KIND_VALUES,\n EXIT_CODE,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n PM_CLI_EXPECTED_ERROR_NAME,\n PmCliError,\n PmClient,\n RISK_VALUES,\n STATUS_VALUES,\n acquireLock,\n appendHistoryEntry,\n canonicalDocument,\n classifyItemFormatVersion,\n clearWorkspaceContractsCache,\n commitImportedItem,\n createHistoryEntry,\n createPmCliExpectedError,\n effectiveItemFormatVersion,\n emptyImportedDocument,\n ensureTrackerInitialized,\n generateItemId,\n getActiveExtensionRegistrations,\n getContracts,\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n getWorkspaceContracts,\n isPmCliExpectedError,\n isTimestampLiteral,\n listAllItemMetadata,\n loadCreateTemplateOptions,\n locateItem,\n normalizeItemMetadata,\n normalizeItemFormatVersion,\n normalizeItemId,\n normalizeRawItemId,\n normalizeStatusInput,\n nowIso,\n parseTags,\n pathExists,\n readBooleanOption,\n readCsvListOption,\n readFileIfExists,\n readLocatedItem,\n readRequiredString,\n readSettings,\n readStringOption,\n removeFileIfExists,\n renderCalendarMarkdown,\n renderCalendarToon,\n renderGuideMarkdown,\n resolveCalendarOutputFormat,\n resolveGuideOutputFormat,\n resolveItemTypeRegistry,\n resolvePmRoot,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n runAction,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n runCalendar,\n runCompletion,\n runGuide,\n runReindex,\n runSearch,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n scanItemFormatVersions,\n selectImportAuthor,\n serializeItemDocument,\n splitFrontMatter,\n toEstimatedMinutesValue,\n toImportBoolean,\n toImportConfidence,\n toImportInteger,\n toImportLinkedDocs,\n toImportLinkedFiles,\n toImportLinkedTests,\n toImportLogEntries,\n toImportNormalizedEnum,\n toImportNumberMap,\n toImportPriority,\n toImportStatus,\n toImportStringList,\n toImportStringMap,\n toImportTags,\n toNonEmptyImportString,\n writeFileAtomic,\n aggregate,\n append,\n claim,\n claimNext,\n close,\n closeTask,\n comments,\n config,\n context,\n copy,\n create,\n deleteItem,\n deps,\n docs,\n extension,\n extensionActivate,\n extensionDeactivate,\n extensionList,\n files,\n filesDiscover,\n focus,\n gc,\n get,\n health,\n historyCompact,\n historyCompactBulk,\n historyRedact,\n historyRepair,\n historyRepairAll,\n init,\n learnings,\n list,\n next,\n notes,\n packageActivate,\n packageCatalog,\n packageDeactivate,\n packageDescribe,\n packageDoctor,\n packageInstall,\n packageLifecycle,\n packageList,\n packageManage,\n packageReload,\n packageUninstall,\n pauseTask,\n profile,\n profileApply,\n profileLint,\n profileList,\n profileShow,\n release,\n restore,\n schema,\n schemaAddField,\n schemaAddStatus,\n schemaAddType,\n schemaApplyPreset,\n schemaInferTypes,\n schemaList,\n schemaListFields,\n schemaRemoveField,\n schemaRemoveStatus,\n schemaRemoveType,\n schemaShow,\n schemaShowField,\n schemaShowStatus,\n search,\n startTask,\n stats,\n update,\n upgrade,\n validate,\n type AggregateOptions,\n type AggregateResult,\n type AggregateRow,\n type AppendCommandOptions,\n type AppendResult,\n type BlockerEntry,\n type CalendarOptions,\n type CalendarResult,\n type ClaimResult,\n type CloseResult,\n type CloseTaskResult,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n type CommentsCommandOptions,\n type CommentsResult,\n type ConfigCommandOptions,\n type ConfigResult,\n type CompletionResult,\n type CompletionShell,\n type ContractsCommandOptions,\n type ContractsResult,\n type ContextFocusItem,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n type CopyResult,\n type CreatePmCliExpectedErrorOptions,\n type CreateResult,\n type CreateTemplateOptions,\n type Dependency,\n type DeleteResult,\n type DepsCommandOptions,\n type DepsResult,\n type DocsCommandOptions,\n type DocsResult,\n type ExtensionCommandOptions,\n type ExtensionCommandResult,\n type FilesCommandOptions,\n type FilesDiscoverOptions,\n type FilesDiscoverResult,\n type FilesResult,\n type FocusResult,\n type GcCommandOptions,\n type GcResult,\n type GetContractsOptions,\n type GetOptions,\n type GetResult,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n type HealthResult,\n type ImportLinkedScope,\n type InitCommandOptions,\n type InitResult,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n type LearningsCommandOptions,\n type LearningsResult,\n type LinkedDoc,\n type LinkedFile,\n type LinkedTest,\n type ListedItem,\n type ListCompactResult,\n type ListOptions,\n type ListResult,\n type ListSortField,\n type ListSortOrder,\n type ListVerboseResult,\n type LogNote,\n type NextActionableItem,\n type NextBlockerRef,\n type NextOptions,\n type NextOutputFormat,\n type NextRecommendation,\n type NextResult,\n type NotesCommandOptions,\n type NotesResult,\n type PackageCommandOptions,\n type PackageCommandResult,\n type PauseTaskResult,\n type PmActionInput,\n type PmActionName,\n type PmActionOptions,\n type PmClientFullMutationOptions,\n type PmClientMutationOptions,\n type PmClientOptions,\n type PmClientRunArgs,\n type PmCliExpectedError,\n type ProfileApplyCommandOptions,\n type ProfileApplyResult,\n type ProfileLintResult,\n type ProfileListResult,\n type ProfileResult,\n type ProfileShowResult,\n type ProfileSubcommand,\n type ReindexOptions,\n type ReindexResult,\n type ReleaseResult,\n type RestoreResult,\n type RunHealthOptions,\n type SchemaAddFieldCommandOptions,\n type SchemaAddFieldResult,\n type SchemaAddStatusCommandOptions,\n type SchemaAddStatusResult,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeInferCommandOptions,\n type SchemaAddTypeInferResult,\n type SchemaAddTypeResult,\n type SchemaApplyPresetCommandOptions,\n type SchemaApplyPresetResult,\n type SchemaInspectResult,\n type SchemaListFieldsResult,\n type SchemaListResult,\n type SchemaRemoveFieldCommandOptions,\n type SchemaRemoveFieldResult,\n type SchemaRemoveStatusCommandOptions,\n type SchemaRemoveStatusResult,\n type SchemaRemoveTypeCommandOptions,\n type SchemaRemoveTypeResult,\n type SchemaShowFieldResult,\n type SchemaShowResult,\n type SchemaShowStatusResult,\n type SchemaResult,\n type SchemaSubcommand,\n type SearchCompactResult,\n type SearchHit,\n type SearchHitHighlight,\n type SearchMatchMode,\n type SearchOptions,\n type ClaimNextOptions,\n type SearchResult,\n type SearchResultItem,\n type SearchVerboseResult,\n type StartTaskResult,\n type StatsCommandOptions,\n type StatsResult,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n type ToImportLinkedArtifactsOptions,\n type ToImportLinkedTestsOptions,\n type ToImportLogEntriesOptions,\n type UpdateResult,\n type UpgradeCommandOptions,\n type UpgradeResult,\n type ValidateCommandOptions,\n type ValidateResult,\n type WorkspaceContracts,\n type WorkspaceContractsOptions,\n} from \"./runtime.js\";\nexport {\n BUILTIN_PROFILES,\n listProfiles,\n normalizeProfileName,\n PROFILE_NAMES,\n resolveProfile,\n type ProfileConfigEntry,\n type ProfileName,\n type ProfilePackageRecommendation,\n type ProfileTemplateEntry,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ProjectProfileRegistrationInput,\n} from \"../core/profile/profile-presets.js\";\nexport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileComponentChange,\n type ProfileConfigChange,\n type ProfileConfigPlan,\n type ProfileCurrentState,\n type ProfilePackagePlan,\n type ProfileSchemaPlan,\n type ProfileTemplateChange,\n type ProfileTemplatePlan,\n type ProfileWorkflowChange,\n type ProfileWorkflowPlan,\n} from \"../core/profile/profile-plan.js\";\nexport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n type ProjectProfileDescription,\n type ProjectProfilePackageSummary,\n} from \"../core/profile/profile-describe.js\";\nexport {\n lintProjectProfile,\n PROFILE_LINT_CODES,\n PROFILE_LINT_DIMENSIONS,\n type ProfileLintCode,\n type ProfileLintDimension,\n type ProfileLintSeverity,\n type ProjectProfileLintFinding,\n type ProjectProfileLintReport,\n} from \"../core/profile/profile-lint.js\";\nexport {\n assertExtensionBlueprint,\n assertExtensionCapabilityUsage,\n assertExtensionDeactivated,\n assertExtensionManifestCompatible,\n assertExtensionManifestMatchesBlueprint,\n assertExtensionPreflight,\n assertPackageManifest,\n assertProjectProfile,\n assertRegisteredCommandContract,\n assertRegisteredCommandOverride,\n assertRegisteredExporter,\n assertRegisteredFlags,\n assertRegisteredHook,\n assertRegisteredImporter,\n assertRegisteredItemField,\n assertRegisteredItemType,\n assertRegisteredMigration,\n assertRegisteredParserOverride,\n assertRegisteredPreflightOverride,\n assertRegisteredProfile,\n assertRegisteredRendererOverride,\n assertRegisteredSearchProvider,\n assertRegisteredServiceOverride,\n assertRegisteredVectorStoreAdapter,\n activateExtensionForTest,\n createExtensionTestHarness,\n deactivateExtensionForTest,\n describeExtensionActivation,\n runRegisteredCommandForTest,\n runRegisteredCommandOverrideForTest,\n runRegisteredExporterForTest,\n runRegisteredHookForTest,\n runRegisteredImporterForTest,\n runRegisteredMigrationForTest,\n runRegisteredParserOverrideForTest,\n runRegisteredPreflightOverrideForTest,\n runRegisteredRendererOverrideForTest,\n runRegisteredSearchProviderForTest,\n runRegisteredServiceOverrideForTest,\n runRegisteredVectorStoreAdapterForTest,\n type ActivateExtensionForTestOptions,\n type AssertProjectProfileOptions,\n type DeactivateExtensionForTestOptions,\n type DescribeExtensionActivationOptions,\n type ExtensionActivationSummary,\n type RenderExtensionHarnessMarkdownOptions,\n type RunRegisteredCommandForTestOptions,\n type RunRegisteredExporterForTestOptions,\n type RunRegisteredHookForTestOptions,\n type RunRegisteredImporterForTestOptions,\n type RunRegisteredMigrationForTestOptions,\n type RunRegisteredSearchProviderForTestOptions,\n type RunRegisteredVectorStoreAdapterForTestOptions,\n type SearchProviderOperationContexts,\n type SearchProviderOperationResults,\n type VectorStoreAdapterOperationContexts,\n type VectorStoreAdapterOperationResults,\n type ExtensionCapabilityUsageAssertion,\n type ExtensionCapabilityUsageExpectation,\n type ExtensionDeactivationExpectation,\n type ExtensionManifestBlueprintMatch,\n type ExtensionTestHarness,\n type PackageManifestExpectation,\n type PackageManifestResourceExpectation,\n type RegisteredCommandContractAssertion,\n type RegisteredCommandContractExpectation,\n type RegisteredCommandOverrideExpectation,\n type RegisteredExporterExpectation,\n type RegisteredFlagsExpectation,\n type RegisteredHookExpectation,\n type RegisteredHookKind,\n type RegisteredImporterExpectation,\n type RegisteredItemFieldAssertion,\n type RegisteredItemFieldExpectation,\n type RegisteredItemTypeAssertion,\n type RegisteredItemTypeExpectation,\n type RegisteredMigrationExpectation,\n type RegisteredParserOverrideExpectation,\n type RegisteredPreflightOverrideExpectation,\n type RegisteredProfileAssertion,\n type RegisteredProfileExpectation,\n type RegisteredRendererOverrideExpectation,\n type RegisteredSearchProviderExpectation,\n type RegisteredServiceOverrideExpectation,\n type RegisteredVectorStoreAdapterExpectation,\n} from \"./testing.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/** Canonical extension governance policy modes and registration surfaces. */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\n/** Public contract for extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\n/** Public contract for extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\n/** Public contract for extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Versioned capability contract metadata emitted by runtime diagnostics. */\nexport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n};\n\n/** Least-privilege capability reconciliation helpers: map declared capabilities against the registration surfaces a package actually exercises at activation. */\nexport {\n EXTENSION_CAPABILITY_REGISTRATION_SURFACES,\n collectUsedExtensionCapabilities,\n reconcileExtensionCapabilityUsage,\n type CollectUsedExtensionCapabilitiesOptions,\n type ExtensionCapabilityUsageReconciliation,\n} from \"../core/extensions/capability-usage.js\";\n\n/**\n * Render an extension/package activation summary\n * ({@link describeExtensionActivation} / {@link describeExtensionBlueprint}) to a\n * deterministic Markdown reference document — the author-facing *render* leg of\n * the describe verb, for drift-free package READMEs.\n */\nexport {\n renderExtensionSurfaceMarkdown,\n type ExtensionSurfaceMarkdownOptions,\n} from \"../core/extensions/activation-summary-markdown.js\";\n\nexport type {\n AfterCommandAffectedItem,\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandHandlerResult,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDeactivationFailure,\n ExtensionDeactivationOptions,\n ExtensionDeactivationResult,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionHookRegistry,\n ExtensionSelfIdentity,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionManifestEngines,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RegisteredExtensionExporter,\n RegisteredExtensionFlagDefinitions,\n RegisteredExtensionHook,\n RegisteredExtensionImporter,\n RegisteredExtensionProjectProfile,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionServiceOverride,\n RegisteredExtensionVectorStoreAdapter,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n PmSettings,\n} from \"../types/index.js\";\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGA,SAAS,eACP,WACA,QACA,QAAc;AAEd,YAAU,IAAI,MAAM,EAAG,IAAI,MAAM;AACnC;AAEA,SAAS,gBAAgB,OAAwB;AAC/C,SAAO,IAAI,IAAI,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,oBAAI,IAAG,CAAU,CAAC,CAAC;AAC/D;AAEA,SAAS,eAAe,YAAsB;AAC5C,aAAW,aAAa;AAAY,cAAU,KAAI;AAClD,SAAO,WAAW,KAChB,CAAC,MA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ElB;AACE,YAAMA,SAAO;IACf;EACF;;;;;;;;;;;AChlBI,SAAU,wBACd,UAAmB;AAEnB,SAAO;AACT;AAcM,SAAU,qBACdC,UAAiB;AAEjB,SAAOA;AACT;AAUM,SAAU,cACd,YAAuB;AAEvB,SAAO;AACT;AAUM,SAAU,WAAyC,MAAW;AAClE,SAAO;AACT;AAQM,SAAU,eACd,MAAW;AAEX,SAAO;AACT;AASM,SAAU,gBACd,OAAa;AAEb,SAAO;AACT;AASM,SAAU,gBACd,WAAqB;AAErB,SAAO;AACT;AASM,SAAU,qBAEd,UAAmB;AACnB,SAAO;AACT;AASM,SAAU,yBAEd,SAAiB;AACjB,SAAO;AACT;AASM,SAAU,sBACd,UAAyB;AAEzB,SAAO;AACT;AASM,SAAU,qBAAqB,UAAwB;AAC3D,SAAO;AACT;AAQM,SAAU,wBACd,UAA2B;AAE3B,SAAO;AACT;AASM,SAAU,sBACd,UAAyB;AAEzB,SAAO;AACT;AAQM,SAAU,uBACd,UAA0B;AAE1B,SAAO;AACT;AASM,SAAU,eAAe,UAAkB;AAC/C,SAAO;AACT;AASM,SAAU,eAAe,UAAkB;AAC/C,SAAO;AACT;AASM,SAAU,wBACd,MAAuB;AAEvB,SAAO;AACT;AASM,SAAU,uBACd,MAAsB;AAEtB,SAAO;AACT;AAQM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;AAQM,SAAU,iBAAiB,MAAgB;AAC/C,SAAO;AACT;AASM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;;;;;;;;;;ACmdO,IAAM,yBAAyB;AAK/B,IAAM,yBAAyB;AAE/B,IAAM,4BAA4B;AAElC,IAAM,wBAAwB;AAE9B,IAAM,6BAA6B;",
6
+ "names": ["next", "path", "release", "profile"]
7
7
  }
package/dist/cli.js CHANGED
@@ -5,12 +5,13 @@
5
5
  * Bootstraps the executable pm CLI entrypoint and startup optimizations.
6
6
  */
7
7
 
8
- !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]="617cd5de-c6c6-5a05-8d30-331bb556d9ee")}catch(e){}}();
8
+ !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]="075ca281-c433-52c9-bb4f-4add8c1e3d3a")}catch(e){}}();
9
9
  import fs from "node:fs";
10
10
  import * as nodeModule from "node:module";
11
11
  import os from "node:os";
12
12
  import path from "node:path";
13
13
  import { fileURLToPath } from "node:url";
14
+ import { runCliWithBundleIntegrity, } from "./cli/bundle-integrity.js";
14
15
  function enableNodeCompileCache() {
15
16
  const { enableCompileCache } = nodeModule;
16
17
  if (typeof enableCompileCache !== "function" ||
@@ -82,8 +83,8 @@ export const _testOnly = {
82
83
  };
83
84
  if (!printFastVersionIfRequested()) {
84
85
  enableNodeCompileCache();
85
- const { runPmCli } = await import("./cli-bundle/main.js");
86
- await runPmCli(process.argv.slice(2));
86
+ const cliEntrypointPath = fileURLToPath(import.meta.url);
87
+ await runCliWithBundleIntegrity(process.argv.slice(2), cliEntrypointPath, () => import("./cli-bundle/main.js"), process.stderr.write.bind(process.stderr));
87
88
  }
88
89
  //# sourceMappingURL=cli.js.map
89
- //# debugId=617cd5de-c6c6-5a05-8d30-331bb556d9ee
90
+ //# debugId=075ca281-c433-52c9-bb4f-4add8c1e3d3a
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module cli\n *\n * Bootstraps the executable pm CLI entrypoint and startup optimizations.\n */\nimport fs from \"node:fs\";\nimport * as nodeModule from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ntype NodeModuleWithCompileCache = typeof nodeModule & {\n enableCompileCache?: (cacheDir?: string) => {\n status?: number;\n message?: string;\n };\n};\n\nfunction enableNodeCompileCache(): void {\n const { enableCompileCache } = nodeModule as NodeModuleWithCompileCache;\n if (\n typeof enableCompileCache !== \"function\" ||\n process.env.PM_CLI_DISABLE_COMPILE_CACHE === \"1\"\n ) {\n return;\n }\n const userCacheKey =\n typeof process.getuid === \"function\"\n ? String(process.getuid())\n : os.userInfo().username.replace(/[^a-zA-Z0-9._-]/g, \"_\");\n const cacheDir =\n process.env.PM_CLI_COMPILE_CACHE_DIR ??\n path.join(os.tmpdir(), `pm-cli-node-compile-cache-${userCacheKey}`);\n try {\n enableCompileCache(cacheDir);\n } catch {\n // Compile caching is a startup optimization only; never block CLI execution.\n }\n}\n\nfunction findPackageJson(startPath: string): string | undefined {\n let current = path.dirname(path.resolve(startPath));\n while (true) {\n const candidate = path.join(current, \"package.json\");\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nfunction printFastVersionIfRequested(): boolean {\n const args = process.argv.slice(2);\n const versionArgs = args.filter((arg) => arg !== \"--no-extensions\");\n if (\n versionArgs.length !== 1 ||\n (versionArgs[0] !== \"--version\" && versionArgs[0] !== \"-V\")\n ) {\n return false;\n }\n const version = readPackageVersionForPath(fileURLToPath(import.meta.url));\n if (version === undefined) {\n return false;\n }\n console.log(version);\n return true;\n}\n\nfunction readPackageVersionForPath(startPath: string): string | undefined {\n const packageJsonPath = findPackageJson(startPath);\n if (!packageJsonPath) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as {\n version?: unknown;\n };\n if (typeof parsed.version !== \"string\") {\n return undefined;\n }\n return parsed.version;\n } catch {\n return undefined;\n }\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n enableNodeCompileCache,\n findPackageJson,\n printFastVersionIfRequested,\n readPackageVersionForPath,\n};\n\nif (!printFastVersionIfRequested()) {\n enableNodeCompileCache();\n const { runPmCli } = await import(\"./cli/main.js\");\n await runPmCli(process.argv.slice(2));\n}\n"],"names":[],"mappings":";AACA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AASzC,SAAS,sBAAsB;IAC7B,MAAM,EAAE,kBAAkB,EAAE,GAAG,UAAwC,CAAC;IACxE,IACE,OAAO,kBAAkB,KAAK,UAAU;QACxC,OAAO,CAAC,GAAG,CAAC,4BAA4B,KAAK,GAAG,EAChD,CAAC;QACD,OAAO;IACT,CAAC;IACD,MAAM,YAAY,GAChB,OAAO,OAAO,CAAC,MAAM,KAAK,UAAU;QAClC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAC1B,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,wBAAwB;QACpC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,6BAA6B,YAAY,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC;QACH,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,6EAA6E;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,SAAiB;IACxC,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,OAAO,IAAI,EAA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I,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAEjE,CAAC;QACF,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,eAAe;IACf,2BAA2B;IAC3B,yBAAyB;CAC1B,CAAC;AAEF,IAAI,CAAC,2BAA2B,EAAE,EAAE,CAAC;IACnC,sBAAsB,EAAE,CAAC;IACzB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IACnD,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC","debugId":"617cd5de-c6c6-5a05-8d30-331bb556d9ee"}
1
+ {"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module cli\n *\n * Bootstraps the executable pm CLI entrypoint and startup optimizations.\n */\nimport fs from \"node:fs\";\nimport * as nodeModule from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n runCliWithBundleIntegrity,\n} from \"./cli/bundle-integrity.js\";\n\ntype NodeModuleWithCompileCache = typeof nodeModule & {\n enableCompileCache?: (cacheDir?: string) => {\n status?: number;\n message?: string;\n };\n};\n\nfunction enableNodeCompileCache(): void {\n const { enableCompileCache } = nodeModule as NodeModuleWithCompileCache;\n if (\n typeof enableCompileCache !== \"function\" ||\n process.env.PM_CLI_DISABLE_COMPILE_CACHE === \"1\"\n ) {\n return;\n }\n const userCacheKey =\n typeof process.getuid === \"function\"\n ? String(process.getuid())\n : os.userInfo().username.replace(/[^a-zA-Z0-9._-]/g, \"_\");\n const cacheDir =\n process.env.PM_CLI_COMPILE_CACHE_DIR ??\n path.join(os.tmpdir(), `pm-cli-node-compile-cache-${userCacheKey}`);\n try {\n enableCompileCache(cacheDir);\n } catch {\n // Compile caching is a startup optimization only; never block CLI execution.\n }\n}\n\nfunction findPackageJson(startPath: string): string | undefined {\n let current = path.dirname(path.resolve(startPath));\n while (true) {\n const candidate = path.join(current, \"package.json\");\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nfunction printFastVersionIfRequested(): boolean {\n const args = process.argv.slice(2);\n const versionArgs = args.filter((arg) => arg !== \"--no-extensions\");\n if (\n versionArgs.length !== 1 ||\n (versionArgs[0] !== \"--version\" && versionArgs[0] !== \"-V\")\n ) {\n return false;\n }\n const version = readPackageVersionForPath(fileURLToPath(import.meta.url));\n if (version === undefined) {\n return false;\n }\n console.log(version);\n return true;\n}\n\nfunction readPackageVersionForPath(startPath: string): string | undefined {\n const packageJsonPath = findPackageJson(startPath);\n if (!packageJsonPath) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as {\n version?: unknown;\n };\n if (typeof parsed.version !== \"string\") {\n return undefined;\n }\n return parsed.version;\n } catch {\n return undefined;\n }\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n enableNodeCompileCache,\n findPackageJson,\n printFastVersionIfRequested,\n readPackageVersionForPath,\n};\n\nif (!printFastVersionIfRequested()) {\n enableNodeCompileCache();\n const cliEntrypointPath = fileURLToPath(import.meta.url);\n await runCliWithBundleIntegrity(\n process.argv.slice(2),\n cliEntrypointPath,\n () => import(\"./cli/main.js\"),\n process.stderr.write.bind(process.stderr),\n );\n}\n"],"names":[],"mappings":";AACA;;;;GAIG;;;AACH,OAAO,EAAE,MA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O,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,eAAe;IACf,2BAA2B;IAC3B,yBAAyB;CAC1B,CAAC;AAEF,IAAI,CAAC,2BAA2B,EAAE,EAAE,CAAC;IACnC,sBAAsB,EAAE,CAAC;IACzB,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,yBAAyB,CAC7B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACrB,iBAAiB,EACjB,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAC1C,CAAC;AACJ,CAAC","debugId":"075ca281-c433-52c9-bb4f-4add8c1e3d3a"}
@@ -19,7 +19,7 @@
19
19
  */
20
20
  /** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: "all non-extension checks"). */
21
21
 
22
- !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]="f2d1dec6-35b4-57af-a2a8-64dc798c734c")}catch(e){}}();
22
+ !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]="1bdd780e-bbbd-5c62-8fb9-9668f942f4d6")}catch(e){}}();
23
23
  export const REMEDIATION_REGISTRY = Object.freeze([
24
24
  // --- pm health: directories ---
25
25
  {
@@ -166,6 +166,11 @@ export const REMEDIATION_REGISTRY = Object.freeze([
166
166
  command: "pm history-compact <id>",
167
167
  summary: "The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).",
168
168
  },
169
+ {
170
+ code: "history_unknown_author_events",
171
+ command: "pm validate --check-history-drift --fix-hints",
172
+ summary: "Historical mutations lack attributable authorship. Configure PM_AUTHOR, pass global --author, or set author_default so future audit events are attributable.",
173
+ },
169
174
  // --- pm health: locks ---
170
175
  {
171
176
  code: "locks_stale_count",
@@ -335,6 +340,11 @@ export const REMEDIATION_REGISTRY = Object.freeze([
335
340
  command: "pm history-repair <id>",
336
341
  summary: "Re-anchor the history chains of the items with a broken history chain.",
337
342
  },
343
+ {
344
+ code: "validate_history_unknown_author_events",
345
+ command: "pm config project set author_default <stable-agent-id>",
346
+ summary: "Historical mutations lack attributable authorship. Set a stable default or use invocation-wide --author for future events; existing audit history remains append-only.",
347
+ },
338
348
  // --- pm validate: command_references ---
339
349
  {
340
350
  code: "validate_command_references_stale_pm_ids",
@@ -398,4 +408,4 @@ export function buildRemediationCommands(warnings) {
398
408
  return Object.values(buildRemediationMap(warnings));
399
409
  }
400
410
  //# sourceMappingURL=remediation.js.map
401
- //# debugId=f2d1dec6-35b4-57af-a2a8-64dc798c734c
411
+ //# debugId=1bdd780e-bbbd-5c62-8fb9-9668f942f4d6
@@ -1 +1 @@
1
- {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /** Stable warning-code prefix this entry resolves. A warning matches when it equals this code or begins with `<code>:`. Registry codes are mutually exclusive under that colon-boundary rule (no code is a `:`-delimited prefix of another — e.g. `settings:id_prefix_empty` is distinct from a bare `settings`, which is intentionally not registered), so `resolveRemediation` uses first-match with no ordering dependency. */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: \"all non-extension checks\"). */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary:\n \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary:\n \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary:\n 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary:\n 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file failed to parse; fix the malformed item metadata at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health (integrity) + pm validate (format_version): item format version ---\n {\n code: \"integrity_item_outdated_format_version\",\n command: \"pm validate --verbose-diagnostics\",\n summary:\n \"An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"integrity_item_ahead_format_version\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary:\n \"An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary:\n \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary:\n \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary:\n \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` item-metadata field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary:\n \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary:\n \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary:\n \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary:\n \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary:\n \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary:\n \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary:\n \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command:\n 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n {\n code: \"validate_format_version_outdated_items\",\n command: \"pm validate --verbose-diagnostics\",\n summary:\n \"One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"validate_format_version_ahead_items\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary:\n \"One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(\n warning: string,\n): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/** Build a compact `remediation_map` (code -> command) for a set of warning tokens. First match wins per code; unknown codes are skipped. Used by `pm health --json` per-check details and as the source of deduped executable commands for `pm validate --fix-hints`. */\nexport function buildRemediationMap(\n warnings: Iterable<string>,\n): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (\n entry !== undefined &&\n !Object.prototype.hasOwnProperty.call(map, entry.code)\n ) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/** Build a deduped, ordered list of executable remediation commands for a set of warning tokens (one command per distinct matched code). Used by `pm validate --fix-hints` for checks that do not already emit per-row remediation commands. */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,ySAAyS;;;AACzS,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EACL,yFAAyF;KAC5F;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OA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AA0B;IAE1B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IACE,KAAK,KAAK,SAAS;YACnB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EACtD,CAAC;YACD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gPAAgP;AAChP,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"f2d1dec6-35b4-57af-a2a8-64dc798c734c"}
1
+ {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /** Stable warning-code prefix this entry resolves. A warning matches when it equals this code or begins with `<code>:`. Registry codes are mutually exclusive under that colon-boundary rule (no code is a `:`-delimited prefix of another — e.g. `settings:id_prefix_empty` is distinct from a bare `settings`, which is intentionally not registered), so `resolveRemediation` uses first-match with no ordering dependency. */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: \"all non-extension checks\"). */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary:\n \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary:\n \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary:\n 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary:\n 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary:\n \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary:\n \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file failed to parse; fix the malformed item metadata at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary:\n \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary:\n \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health (integrity) + pm validate (format_version): item format version ---\n {\n code: \"integrity_item_outdated_format_version\",\n command: \"pm validate --verbose-diagnostics\",\n summary:\n \"An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"integrity_item_ahead_format_version\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary:\n \"An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary:\n \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary:\n \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n {\n code: \"history_unknown_author_events\",\n command: \"pm validate --check-history-drift --fix-hints\",\n summary:\n \"Historical mutations lack attributable authorship. Configure PM_AUTHOR, pass global --author, or set author_default so future audit events are attributable.\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary:\n \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary:\n \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` item-metadata field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary:\n \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary:\n \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary:\n \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary:\n \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary:\n \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary:\n \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary:\n \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary:\n \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n {\n code: \"validate_history_unknown_author_events\",\n command: \"pm config project set author_default <stable-agent-id>\",\n summary:\n \"Historical mutations lack attributable authorship. Set a stable default or use invocation-wide --author for future events; existing audit history remains append-only.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command:\n 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n {\n code: \"validate_format_version_outdated_items\",\n command: \"pm validate --verbose-diagnostics\",\n summary:\n \"One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"validate_format_version_ahead_items\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary:\n \"One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(\n warning: string,\n): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/** Build a compact `remediation_map` (code -> command) for a set of warning tokens. First match wins per code; unknown codes are skipped. Used by `pm health --json` per-check details and as the source of deduped executable commands for `pm validate --fix-hints`. */\nexport function buildRemediationMap(\n warnings: Iterable<string>,\n): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (\n entry !== undefined &&\n !Object.prototype.hasOwnProperty.call(map, entry.code)\n ) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/** Build a deduped, ordered list of executable remediation commands for a set of warning tokens (one command per distinct matched code). Used by `pm validate --fix-hints` for checks that do not already emit per-row remediation commands. */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,ySAAyS;;;AACzS,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EACL,yFAAyF;KAC5F;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAA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