@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sources":["sdk/profile.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/profile\n *\n * Implements the `pm profile` command surface: listing the built-in project\n * archetypes, showing a profile's full composition, and applying a profile to an\n * initialized tracker. Apply stages item types, custom statuses, custom fields,\n * per-type workflows, config knobs, and create templates idempotently, and\n * surfaces advisory package recommendations. The pure diff lives in\n * {@link module:core/profile/profile-plan}; this module is the I/O orchestration\n * and human formatting around it.\n */\nimport path from \"node:path\";\nimport {\n pathExists,\n readFileIfExists,\n writeFileAtomic,\n} from \"../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { resolveAuthor } from \"../core/shared/author.js\";\nimport { nowIso } from \"../core/shared/time.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport {\n readSettings,\n resolveGovernanceKnobs,\n writeSettings,\n} from \"../core/store/settings.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../core/schema/runtime-schema.js\";\nimport {\n normalizeAddTypeInput,\n serializeItemTypesFile,\n} from \"../core/schema/item-types-file.js\";\nimport { serializeStatusDefsFile } from \"../core/schema/status-defs-file.js\";\nimport { serializeFieldsFile } from \"../core/schema/fields-file.js\";\nimport {\n resolveNestedSettingDescriptor,\n writeNestedSettingValue,\n} from \"../core/config/nested-settings.js\";\nimport {\n getActiveExtensionRegistrations,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nimport {\n resolveProfileCatalog,\n resolveProfileEntry,\n type ExtensionProfileContribution,\n type ProfileSourceKind,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ResolveProfileEntryResult,\n} from \"../core/profile/profile-presets.js\";\nimport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n} from \"../core/profile/profile-describe.js\";\nimport {\n lintProjectProfile,\n type ProjectProfileLintFinding,\n} from \"../core/profile/profile-lint.js\";\nimport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileCurrentState,\n} from \"../core/profile/profile-plan.js\";\nimport { ensureTypeFolderScaffold } from \"./schema.js\";\nimport { runTemplatesSave } from \"./templates.js\";\n\n/** Ordered `pm profile` subcommands. */\nexport const PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"apply\", \"lint\"] as const;\n/** Restricts profile subcommand values accepted by command, SDK, and storage contracts. */\nexport type ProfileSubcommand = (typeof PROFILE_SUBCOMMANDS)[number];\n\nconst PROFILE_TYPES_LOCK_ID = \"schema-types\";\nconst PROFILE_STATUSES_LOCK_ID = \"schema-statuses\";\nconst PROFILE_FIELDS_LOCK_ID = \"schema-fields\";\n\n/**\n * Per-dimension counts summarizing how much a profile stages. Aliases the shared\n * {@link ProjectProfileComposition} so the CLI result shape and the core describe\n * primitive never drift.\n */\nexport type ProfileComposition = ProjectProfileComposition;\n\n/** A single profile entry in the `pm profile list` payload. */\nexport interface ProfileListEntry {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n}\n\n/** Result of `pm profile list`. */\nexport interface ProfileListResult {\n /** Discriminant for the profile result union. */\n action: \"list\";\n /** Built-in profiles in canonical order followed by active extension profiles. */\n profiles: ProfileListEntry[];\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile show <name>`. */\nexport interface ProfileShowResult {\n /** Discriminant for the profile result union. */\n action: \"show\";\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n /** Item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: Array<{ spec: string; reason: string }>;\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Per-dimension change summary in an apply result. */\nexport interface ProfileApplyDimension {\n /** Entry keys that were newly created. */\n added: string[];\n /** Entry keys whose stored value was overwritten. */\n updated: string[];\n /** Entry keys already current (no write). */\n unchanged: string[];\n}\n\n/** Result of `pm profile apply <name>`. */\nexport interface ProfileApplyResult {\n /** Discriminant for the profile result union. */\n action: \"apply\";\n /** Applied profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** True when changes were persisted; false for `--dry-run` or a no-op. */\n applied: boolean;\n /** True when `--dry-run` previewed without writing. */\n dry_run: boolean;\n /** True when at least one dimension stages an add/update. */\n changed: boolean;\n /** Item-type change summary. */\n types: ProfileApplyDimension;\n /** Status change summary. */\n statuses: ProfileApplyDimension;\n /** Field change summary. */\n fields: ProfileApplyDimension;\n /** Workflow change summary. */\n workflows: ProfileApplyDimension;\n /** Config-knob change summary. */\n config: ProfileApplyDimension;\n /** Template change summary. */\n templates: ProfileApplyDimension;\n /** Advisory package recommendations with install status. */\n packages: Array<{\n spec: string;\n reason: string;\n status: \"installed\" | \"recommended\";\n }>;\n /** Deduped on-write hook + advisory warnings. */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile lint [name]`. */\nexport interface ProfileLintResult {\n /** Discriminant for the profile result union. */\n action: \"lint\";\n /** Linted profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** True when the profile produced no error-severity findings. */\n ok: boolean;\n /** Count of error-severity findings. */\n error_count: number;\n /** Count of warning-severity findings. */\n warning_count: number;\n /** Every graded consistency finding in dimension order. */\n findings: ProjectProfileLintFinding[];\n /** Non-fatal catalog merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Discriminated union of every `pm profile` result shape. */\nexport type ProfileResult =\n | ProfileListResult\n | ProfileShowResult\n | ProfileApplyResult\n | ProfileLintResult;\n\n/* c8 ignore start -- profile command I/O orchestration and formatting is covered by profile integration workflows; the idempotent diff is unit-tested in core/profile/profile-plan. */\n\n/** Collects the profiles contributed by active extensions, mapping the live registration registry onto the resolver's contribution shape. Returns an empty list when extensions are disabled or none registered a profile. */\nfunction collectExtensionProfileContributions(): ExtensionProfileContribution[] {\n const registrations = getActiveExtensionRegistrations();\n if (registrations === null) {\n return [];\n }\n return registrations.profiles.map((entry) => ({\n name: entry.name,\n profile: entry.profile,\n }));\n}\n\n/** Lists every available profile — the built-in archetypes followed by profiles contributed by active extensions — with per-dimension composition counts and the source each came from. Surfaces any non-fatal merge collisions as warnings. */\nexport function runProfileList(): ProfileListResult {\n const { profiles, warnings } = resolveProfileCatalog(\n collectExtensionProfileContributions(),\n );\n return {\n action: \"list\",\n profiles: profiles.map((resolved) => ({\n name: resolved.definition.name,\n title: resolved.definition.title,\n summary: resolved.definition.summary,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n composition: describeProfileComposition(resolved.definition),\n })),\n warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Shows the full composition of a single profile, resolved across built-in and extension-contributed archetypes. Throws a USAGE error for a missing or unknown profile name. */\nexport function runProfileShow(name: string | undefined): ProfileShowResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n const { resolved } = entry;\n return {\n action: \"show\",\n ...describeProjectProfile(resolved.definition),\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Lints a single profile, resolved across built-in and extension-contributed archetypes, returning every graded consistency finding plus any catalog merge warnings. Throws a USAGE error for a missing or unknown profile name. This is the read-only author-time validation surface; it never writes to the tracker. */\nexport function runProfileLint(name: string | undefined): ProfileLintResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n const { resolved } = entry;\n const report = lintProjectProfile(resolved.definition);\n return {\n action: \"lint\",\n name: resolved.definition.name,\n title: resolved.definition.title,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n ok: report.ok,\n error_count: report.errorCount,\n warning_count: report.warningCount,\n findings: report.findings,\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Options accepted by {@link runProfileApply}. */\nexport interface ProfileApplyCommandOptions {\n /** Preview the diff without writing any files. */\n dryRun?: boolean;\n /** Mutation author override. */\n author?: string;\n /** Force ownership/lock override. */\n force?: boolean;\n}\n\nfunction templateFilePath(pmRoot: string, name: string): string {\n return path.join(pmRoot, \"templates\", `${name}.json`);\n}\n\nasync function readStoredTemplateOptions(\n pmRoot: string,\n name: string,\n): Promise<ProfileTemplateOptions | undefined> {\n const raw = await readFileIfExists(templateFilePath(pmRoot, name));\n if (raw === null) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (\n parsed !== null &&\n typeof parsed === \"object\" &&\n !Array.isArray(parsed)\n ) {\n const options = (parsed as { options?: unknown }).options;\n if (\n options !== null &&\n typeof options === \"object\" &&\n !Array.isArray(options)\n ) {\n return options as ProfileTemplateOptions;\n }\n }\n } catch {\n // A malformed template file is treated as absent so apply re-stages it.\n }\n return undefined;\n}\n\nasync function loadProfileCurrentState(\n pmRoot: string,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n profile: ProjectProfileDefinition,\n): Promise<ProfileCurrentState> {\n const templates = new Map<string, ProfileTemplateOptions>();\n for (const template of profile.templates) {\n const stored = await readStoredTemplateOptions(pmRoot, template.name);\n if (stored !== undefined) {\n templates.set(template.name, stored);\n }\n }\n return {\n typesRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.types,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types,\n ),\n ),\n statusesRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n ),\n ),\n fieldsRaw: await readFileIfExists(\n filePathForSchemaSection(\n pmRoot,\n schema.files.fields,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields,\n ),\n ),\n workflows: settings.schema.type_workflows ?? [],\n settings,\n templates,\n // Package recommendations are advisory: apply never installs and never\n // inspects install state, so every recommendation surfaces as \"recommended\".\n // The planner still supports an install-state set for SDK consumers that want\n // richer reporting.\n installedPackages: new Set<string>(),\n };\n}\n\nfunction dimensionFrom(\n changes: ReadonlyArray<{ key: string; status: ProfileChangeStatus }>,\n): ProfileApplyDimension {\n const added: string[] = [];\n const updated: string[] = [];\n const unchanged: string[] = [];\n for (const change of changes) {\n (change.status === \"add\"\n ? added\n : change.status === \"update\"\n ? updated\n : unchanged\n ).push(change.key);\n }\n return { added, updated, unchanged };\n}\n\nfunction buildApplyResult(\n profile: ProjectProfileDefinition,\n plan: ProfileApplicationPlan,\n applied: boolean,\n dryRun: boolean,\n warnings: string[],\n): ProfileApplyResult {\n return {\n action: \"apply\",\n name: profile.name,\n title: profile.title,\n applied,\n dry_run: dryRun,\n changed: plan.changed,\n types: dimensionFrom(plan.types.changes),\n statuses: dimensionFrom(plan.statuses.changes),\n fields: dimensionFrom(plan.fields.changes),\n workflows: dimensionFrom(\n plan.workflows.changes.map((change) => ({\n key: change.type,\n status: change.status,\n })),\n ),\n config: dimensionFrom(plan.config.changes),\n templates: dimensionFrom(\n plan.templates.changes.map((change) => ({\n key: change.name,\n status: change.status,\n })),\n ),\n packages: plan.packages,\n warnings: [...new Set(warnings)].sort((left, right) =>\n left.localeCompare(right),\n ),\n generated_at: nowIso(),\n };\n}\n\nasync function assertProfileTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n}\n\nfunction resolveProfileForCommand(name: string | undefined): {\n profile: ProjectProfileDefinition;\n warnings: string[];\n} {\n try {\n const entry = resolveProfileEntry(\n name,\n collectExtensionProfileContributions(),\n );\n return {\n profile: entry.resolved.definition,\n warnings: entry.warnings,\n };\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/** Applies a profile to the initialized tracker, or previews the idempotent diff when `dryRun` is set. Schema files are written under their respective locks; config and workflows are persisted to settings; templates are staged via the shared template writer. Re-applying an already-applied profile performs zero writes. Throws a USAGE error for an unknown profile or an invalid config knob, and a NOT_FOUND error when the tracker is not initialized. */\nexport async function runProfileApply(\n name: string | undefined,\n options: ProfileApplyCommandOptions,\n global: GlobalOptions,\n): Promise<ProfileApplyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await assertProfileTrackerInitialized(pmRoot);\n\n // Catalog-level merge warnings (e.g. an extension profile shadowed by a\n // built-in) seed the result so `apply` surfaces them the same way `list`\n // does, rather than silently swallowing them.\n const resolvedProfile = resolveProfileForCommand(name);\n const profile = resolvedProfile.profile;\n const mergeWarnings = resolvedProfile.warnings;\n\n const dryRun = options.dryRun === true;\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n\n if (dryRun) {\n const state = await loadProfileCurrentState(\n pmRoot,\n schema,\n settings,\n profile,\n );\n const plan = planProfile(profile, state);\n return buildApplyResult(profile, plan, false, true, [...mergeWarnings]);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n const force = Boolean(options.force);\n const warnings: string[] = [...mergeWarnings];\n\n // Acquire all three schema locks inside the try so a later acquisition that\n // throws (held/stale lock without --force) still releases the earlier ones in\n // finally rather than stranding them until TTL expiry.\n const releasers: Array<() => Promise<void>> = [];\n const acquire = async (lockId: string): Promise<void> => {\n releasers.push(\n await acquireLock(\n pmRoot,\n lockId,\n settings.locks.ttl_seconds,\n author,\n force,\n governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n ),\n );\n };\n let plan: ProfileApplicationPlan;\n try {\n await acquire(PROFILE_TYPES_LOCK_ID);\n await acquire(PROFILE_STATUSES_LOCK_ID);\n await acquire(PROFILE_FIELDS_LOCK_ID);\n const state = await loadProfileCurrentState(\n pmRoot,\n schema,\n settings,\n profile,\n );\n plan = planProfile(profile, state);\n\n if (plan.types.changed) {\n const typesPath = filePathForSchemaSection(\n pmRoot,\n schema.files.types,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types,\n );\n await writeFileAtomic(typesPath, serializeItemTypesFile(plan.types.file));\n const stagedNames = new Set(\n profile.types.map((type) => normalizeAddTypeInput(type).name),\n );\n const stagedDefinitions = plan.types.file.definitions.filter(\n (definition) => stagedNames.has(definition.name),\n );\n await ensureTypeFolderScaffold(\n pmRoot,\n stagedDefinitions,\n warnings,\n \"profile:apply-type-folder\",\n );\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"profile:apply-types\",\n })),\n );\n }\n if (plan.statuses.changed) {\n const statusesPath = filePathForSchemaSection(\n pmRoot,\n schema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n await writeFileAtomic(\n statusesPath,\n serializeStatusDefsFile(plan.statuses.file),\n );\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"profile:apply-statuses\",\n })),\n );\n }\n if (plan.fields.changed) {\n const fieldsPath = filePathForSchemaSection(\n pmRoot,\n schema.files.fields,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields,\n );\n await writeFileAtomic(fieldsPath, serializeFieldsFile(plan.fields.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: fieldsPath,\n scope: \"project\",\n op: \"profile:apply-fields\",\n })),\n );\n }\n if (plan.config.changed || plan.workflows.changed) {\n for (const change of plan.config.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n const descriptor = resolveNestedSettingDescriptor(change.key);\n if (descriptor !== undefined) {\n writeNestedSettingValue(\n settings as unknown as Record<string, unknown>,\n descriptor,\n change.value,\n );\n }\n }\n settings.schema.type_workflows = plan.workflows.result;\n await writeSettings(pmRoot, settings, \"profile:apply-config\");\n }\n for (const change of plan.templates.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n await runTemplatesSave(change.name, { ...change.options }, global);\n }\n } finally {\n // Release in reverse acquisition order; only locks actually acquired are\n // present. Each release is best-effort so one rejecting release never strands\n // the remaining locks (a failed release falls back to TTL expiry).\n for (const release of releasers.reverse()) {\n try {\n await release();\n } catch {\n // Ignore: a failed lock release is non-fatal and self-heals at TTL.\n }\n }\n }\n\n return buildApplyResult(profile, plan, plan.changed, false, warnings);\n}\n\n// planProfileApplication can throw a plain Error for an invalid config knob; map\n// it to a USAGE exit code consistently across the dry-run and apply paths.\nfunction planProfile(\n profile: ProjectProfileDefinition,\n state: ProfileCurrentState,\n): ProfileApplicationPlan {\n try {\n return planProfileApplication(profile, state);\n } catch (error) {\n throw new PmCliError(\n error instanceof Error ? error.message : String(error),\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction formatDimensionLine(\n label: string,\n dimension: ProfileApplyDimension,\n): string | undefined {\n const segments: string[] = [];\n if (dimension.added.length > 0) {\n segments.push(`+${dimension.added.join(\", \")}`);\n }\n if (dimension.updated.length > 0) {\n segments.push(`~${dimension.updated.join(\", \")}`);\n }\n if (segments.length === 0) {\n return undefined;\n }\n return ` ${label}: ${segments.join(\" \")}`;\n}\n\n/** Renders the `pm profile list` result as human-readable text. */\nexport function formatProfileListHuman(result: ProfileListResult): string {\n const lines = [\"Project profiles:\"];\n for (const profile of result.profiles) {\n const origin =\n profile.source === \"extension\"\n ? ` [${profile.package ?? \"extension\"}]`\n : \"\";\n lines.push(\n ` ${profile.name} — ${profile.title}: ${profile.summary}${origin}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile show` result as human-readable text. */\nexport function formatProfileShowHuman(result: ProfileShowResult): string {\n const origin =\n result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n const lines = [\n `${result.name} — ${result.title}${origin}`,\n result.summary,\n \"\",\n ];\n lines.push(`types: ${result.types.join(\", \") || \"(none)\"}`);\n lines.push(`statuses: ${result.statuses.join(\", \") || \"(none)\"}`);\n lines.push(`fields: ${result.fields.join(\", \") || \"(none)\"}`);\n lines.push(`workflows: ${result.workflows.join(\", \") || \"(none)\"}`);\n lines.push(`config: ${result.config.join(\", \") || \"(none)\"}`);\n lines.push(`templates: ${result.templates.join(\", \") || \"(none)\"}`);\n lines.push(\n `packages: ${result.packages.map((pkg) => pkg.spec).join(\", \") || \"(none)\"}`,\n );\n for (const warning of result.warnings) {\n lines.push(`warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile lint` result as human-readable text: a one-line verdict followed by each finding prefixed with its severity, code, and dimension. */\nexport function formatProfileLintHuman(result: ProfileLintResult): string {\n const origin =\n result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n // Catalog merge warnings are rendered below alongside lint-finding warnings, so\n // fold them into the headline count to avoid an \"ok (0 warnings)\" verdict that\n // is immediately followed by `warning:` lines.\n const totalWarningCount = result.warning_count + result.warnings.length;\n const verdict = result.ok\n ? `Profile ${result.name}${origin}: ok (${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"})`\n : `Profile ${result.name}${origin}: ${result.error_count} error${result.error_count === 1 ? \"\" : \"s\"}, ${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"}`;\n const lines = [verdict];\n for (const finding of result.findings) {\n const target = finding.target !== undefined ? ` (${finding.target})` : \"\";\n lines.push(\n ` ${finding.severity} [${finding.code}] ${finding.dimension}${target}: ${finding.message}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Renders the `pm profile apply` result as human-readable text, including the staged diff and any package recommendations. */\nexport function formatProfileApplyHuman(result: ProfileApplyResult): string {\n const mode = result.dry_run\n ? \"dry-run\"\n : result.applied\n ? \"applied\"\n : \"no changes\";\n const lines = [`Profile ${result.name} (${mode})`];\n if (!result.changed) {\n lines.push(\" already up to date\");\n } else {\n for (const [label, dimension] of [\n [\"types\", result.types],\n [\"statuses\", result.statuses],\n [\"fields\", result.fields],\n [\"workflows\", result.workflows],\n [\"config\", result.config],\n [\"templates\", result.templates],\n ] as const) {\n const line = formatDimensionLine(label, dimension);\n if (line !== undefined) {\n lines.push(line);\n }\n }\n }\n const recommended = result.packages.filter(\n (pkg) => pkg.status === \"recommended\",\n );\n if (recommended.length > 0) {\n lines.push(\n ` recommended packages: ${recommended.map((pkg) => pkg.spec).join(\", \")}`,\n );\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,mCAAmC,CAAC;A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,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CACR,2BAA2B,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,oBAAoB","debugId":"5ec91a0b-d2fa-5ce8-af93-ce6e6db6c12b"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @module sdk/relationship-analytics
3
+ *
4
+ * Provides exact, deterministic graph analytics with explicit semantics and
5
+ * provenance suitable for planning, impact analysis, and context selection.
6
+ */
7
+ import type { RelationshipSnapshot } from "./relationship-history.js";
8
+ import { RelationshipGraph, RelationshipKindRegistry, type RelationshipEdge, type RelationshipQueryOptions } from "./relationships.js";
9
+ /** Exact execution-graph analysis over registered ordering kinds. */
10
+ export interface RelationshipExecutionAnalysis {
11
+ /** Whether the result is exact rather than sampled or approximate. */
12
+ exact: true;
13
+ /** Whether the order-bearing graph is acyclic. */
14
+ acyclic: boolean;
15
+ /** Deterministic topological order for acyclic nodes. */
16
+ order: string[];
17
+ /** Parallelizable topological layers. */
18
+ layers: string[][];
19
+ /** Nodes with no prerequisites. */
20
+ frontier: string[];
21
+ /** Longest prerequisite distance for each acyclic node. */
22
+ depth: Record<string, number>;
23
+ /** Longest deterministic execution path. */
24
+ criticalPath: string[];
25
+ /** Edge count of the critical path. */
26
+ criticalPathLength: number;
27
+ /** Strongly connected order-bearing components that represent cycles. */
28
+ cycles: string[][];
29
+ /** Semantic provenance for the analysis. */
30
+ provenance: {
31
+ algorithm: "kahn-longest-path";
32
+ edgeFamily: "ordering";
33
+ };
34
+ }
35
+ /** One affected node with its exact shortest explanation path. */
36
+ export interface RelationshipImpactRow {
37
+ /** Affected node identifier. */
38
+ id: string;
39
+ /** Shortest relationship distance from the root. */
40
+ distance: number;
41
+ /** Exact path explaining why the node is affected. */
42
+ path: string[];
43
+ }
44
+ /** Bounded reverse- or forward-impact result. */
45
+ export interface RelationshipImpactAnalysis {
46
+ /** Impact origin. */
47
+ root: string;
48
+ /** Deterministic affected-node rows. */
49
+ affected: RelationshipImpactRow[];
50
+ /** Returned rows are exact even when the bounded result is incomplete. */
51
+ exact: true;
52
+ /** Whether configured traversal bounds omitted reachable work. */
53
+ truncated: boolean;
54
+ /** Query work retained for performance and explainability. */
55
+ cost: {
56
+ visitedNodes: number;
57
+ inspectedEdges: number;
58
+ };
59
+ }
60
+ /** Exact structural summary of the complete graph snapshot. */
61
+ export interface RelationshipKnowledgeAnalysis {
62
+ /** Weakly connected components, largest then lexicographic. */
63
+ components: string[][];
64
+ /** Strongly connected components over directed stored edges. */
65
+ stronglyConnected: string[][];
66
+ /** Nodes with no relationship edges. */
67
+ orphans: string[];
68
+ /** Maximum-degree nodes and their unique-neighbor degree. */
69
+ hubs: {
70
+ id: string;
71
+ degree: number;
72
+ }[];
73
+ /** Whether the result is exact. */
74
+ exact: true;
75
+ /** Semantic provenance for the analysis. */
76
+ provenance: {
77
+ algorithm: "component-degree";
78
+ edgeFamily: "all";
79
+ };
80
+ }
81
+ /** Edge-level delta between two immutable snapshots. */
82
+ export interface RelationshipSnapshotComparison {
83
+ /** Earlier snapshot version. */
84
+ fromVersion: number;
85
+ /** Later snapshot version. */
86
+ toVersion: number;
87
+ /** Edges introduced in the later snapshot. */
88
+ added: RelationshipEdge[];
89
+ /** Edges absent from the later snapshot. */
90
+ removed: RelationshipEdge[];
91
+ /** Number of byte-equivalent edges retained. */
92
+ unchangedCount: number;
93
+ /** Whether the comparison is exact. */
94
+ exact: true;
95
+ }
96
+ /** Registry override for custom domain semantics. */
97
+ export interface RelationshipAnalyticsOptions {
98
+ /** Registry used to interpret ordering direction and custom kinds. */
99
+ registry?: RelationshipKindRegistry;
100
+ }
101
+ /** Analyze registered order-bearing relationships without treating associative cycles as blockers. */
102
+ export declare function analyzeRelationshipExecution(graph: RelationshipGraph, options?: RelationshipAnalyticsOptions): RelationshipExecutionAnalysis;
103
+ /** Compute bounded impact rows and exact shortest explanation paths. */
104
+ export declare function analyzeGraphImpact(graph: RelationshipGraph, root: string, options?: RelationshipQueryOptions): RelationshipImpactAnalysis;
105
+ /** Analyze weak/strong components, isolates, and exact unique-neighbor hubs. */
106
+ export declare function analyzeKnowledgeGraph(graph: RelationshipGraph): RelationshipKnowledgeAnalysis;
107
+ /** Compare two immutable relationship snapshots by full normalized edge value. */
108
+ export declare function compareRelationshipSnapshots(before: RelationshipSnapshot, after: RelationshipSnapshot): RelationshipSnapshotComparison;
@@ -0,0 +1,292 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0a54b889-6d5c-565c-85ff-47e5cce68a32")}catch(e){}}();
3
+ import { createRelationshipKindRegistry, } from "./relationships.js";
4
+ function appendNeighbor(adjacency, source, target) {
5
+ adjacency.get(source).add(target);
6
+ }
7
+ function createAdjacency(nodes) {
8
+ return new Map(nodes.map((node) => [node, new Set()]));
9
+ }
10
+ function sortComponents(components) {
11
+ for (const component of components)
12
+ component.sort();
13
+ return components.sort((left, right) => right.length - left.length || left[0].localeCompare(right[0]));
14
+ }
15
+ function stableJsonValue(value) {
16
+ if (Array.isArray(value))
17
+ return value.map((entry) => stableJsonValue(entry));
18
+ if (value === null || typeof value !== "object")
19
+ return value;
20
+ const toJSON = value.toJSON;
21
+ if (typeof toJSON === "function")
22
+ return stableJsonValue(toJSON.call(value));
23
+ return Object.fromEntries(Object.entries(value)
24
+ .sort(([left], [right]) => left.localeCompare(right))
25
+ .map(([key, entry]) => [key, stableJsonValue(entry)]));
26
+ }
27
+ function relationshipEdgeKey(edge) {
28
+ return JSON.stringify(stableJsonValue(edge));
29
+ }
30
+ function appendFinishingOrder(start, adjacency, visited, order) {
31
+ const stack = [{ id: start, expanded: false }];
32
+ while (stack.length > 0) {
33
+ const current = stack.pop();
34
+ if (current.expanded) {
35
+ order.push(current.id);
36
+ continue;
37
+ }
38
+ if (visited.has(current.id))
39
+ continue;
40
+ visited.add(current.id);
41
+ stack.push({ id: current.id, expanded: true });
42
+ const neighbors = [...adjacency.get(current.id)].sort().reverse();
43
+ for (const neighbor of neighbors)
44
+ if (!visited.has(neighbor))
45
+ stack.push({ id: neighbor, expanded: false });
46
+ }
47
+ }
48
+ function computeFinishingOrder(nodes, adjacency) {
49
+ const visited = new Set();
50
+ const order = [];
51
+ for (const start of nodes)
52
+ if (!visited.has(start))
53
+ appendFinishingOrder(start, adjacency, visited, order);
54
+ return order;
55
+ }
56
+ function collectReverseComponents(order, reverse) {
57
+ const visited = new Set();
58
+ const components = [];
59
+ for (const start of [...order].reverse()) {
60
+ if (visited.has(start))
61
+ continue;
62
+ const component = [];
63
+ const stack = [start];
64
+ visited.add(start);
65
+ while (stack.length > 0) {
66
+ const current = stack.pop();
67
+ component.push(current);
68
+ for (const neighbor of reverse.get(current)) {
69
+ if (visited.has(neighbor))
70
+ continue;
71
+ visited.add(neighbor);
72
+ stack.push(neighbor);
73
+ }
74
+ }
75
+ components.push(component);
76
+ }
77
+ return sortComponents(components);
78
+ }
79
+ function stronglyConnectedComponents(nodes, adjacency) {
80
+ const reverse = createAdjacency(nodes);
81
+ for (const [source, targets] of adjacency)
82
+ for (const target of targets)
83
+ appendNeighbor(reverse, target, source);
84
+ return collectReverseComponents(computeFinishingOrder(nodes, adjacency), reverse);
85
+ }
86
+ function buildExecutionAdjacency(graph, registry) {
87
+ const adjacency = createAdjacency(graph.nodes());
88
+ for (const edge of graph.edges()) {
89
+ const definition = registry.require(edge.kind);
90
+ if (!definition.ordering)
91
+ continue;
92
+ // Legacy and JSON-parsed definitions may predate explicit precedence.
93
+ const sourceFirst = (definition.precedence ?? "source_before_target") ===
94
+ "source_before_target";
95
+ appendNeighbor(adjacency, sourceFirst ? edge.source : edge.target, sourceFirst ? edge.target : edge.source);
96
+ }
97
+ return adjacency;
98
+ }
99
+ function topologicalLayers(nodes, adjacency) {
100
+ const indegree = new Map(nodes.map((node) => [node, 0]));
101
+ for (const targets of adjacency.values())
102
+ for (const target of targets)
103
+ indegree.set(target, indegree.get(target) + 1);
104
+ let frontier = nodes.filter((node) => indegree.get(node) === 0).sort();
105
+ const layers = [];
106
+ while (frontier.length > 0) {
107
+ layers.push(frontier);
108
+ const next = [];
109
+ for (const source of frontier) {
110
+ for (const target of adjacency.get(source)) {
111
+ const remaining = indegree.get(target) - 1;
112
+ indegree.set(target, remaining);
113
+ if (remaining === 0)
114
+ next.push(target);
115
+ }
116
+ }
117
+ frontier = next.sort();
118
+ }
119
+ return layers;
120
+ }
121
+ function longestPath(order, adjacency) {
122
+ const depth = new Map(order.map((node) => [node, 0]));
123
+ const parent = new Map();
124
+ for (const source of order) {
125
+ for (const target of adjacency.get(source)) {
126
+ if (!depth.has(target))
127
+ continue;
128
+ const candidate = depth.get(source) + 1;
129
+ const currentParent = parent.get(target);
130
+ if (candidate > depth.get(target) ||
131
+ (candidate === depth.get(target) &&
132
+ (currentParent === undefined ||
133
+ source.localeCompare(currentParent) < 0))) {
134
+ depth.set(target, candidate);
135
+ parent.set(target, source);
136
+ }
137
+ }
138
+ }
139
+ const end = [...order].sort((left, right) => depth.get(right) - depth.get(left) || left.localeCompare(right))[0];
140
+ const path = end === undefined ? [] : [end];
141
+ while (path[0] !== undefined && parent.has(path[0]))
142
+ path.unshift(parent.get(path[0]));
143
+ return { depth: Object.fromEntries(depth), path };
144
+ }
145
+ function reconstructImpactPath(root, target, parents) {
146
+ const path = [target];
147
+ let cursor = target;
148
+ while (cursor !== root) {
149
+ cursor = parents.get(cursor);
150
+ path.push(cursor);
151
+ }
152
+ return path.reverse();
153
+ }
154
+ /** Analyze registered order-bearing relationships without treating associative cycles as blockers. */
155
+ export function analyzeRelationshipExecution(graph, options = {}) {
156
+ const registry = options.registry ?? createRelationshipKindRegistry();
157
+ const nodes = [...graph.nodes()];
158
+ const adjacency = buildExecutionAdjacency(graph, registry);
159
+ const layers = topologicalLayers(nodes, adjacency);
160
+ const order = layers.flat();
161
+ const acyclic = order.length === nodes.length;
162
+ const cycles = acyclic
163
+ ? []
164
+ : stronglyConnectedComponents(nodes, adjacency).filter((component) => component.length > 1 ||
165
+ adjacency.get(component[0]).has(component[0]));
166
+ const longest = longestPath(order, adjacency);
167
+ return {
168
+ exact: true,
169
+ acyclic,
170
+ order,
171
+ layers,
172
+ frontier: layers[0] ?? [],
173
+ depth: longest.depth,
174
+ criticalPath: longest.path,
175
+ criticalPathLength: Math.max(0, longest.path.length - 1),
176
+ cycles,
177
+ provenance: { algorithm: "kahn-longest-path", edgeFamily: "ordering" },
178
+ };
179
+ }
180
+ /** Compute bounded impact rows and exact shortest explanation paths. */
181
+ export function analyzeGraphImpact(graph, root, options = {}) {
182
+ const direction = options.direction ?? "outgoing";
183
+ const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
184
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
185
+ const queue = [{ id: root, depth: 0 }];
186
+ const seen = new Set([root]);
187
+ const parents = new Map();
188
+ const affected = [];
189
+ let visitedNodes = 0;
190
+ let inspectedEdges = 0;
191
+ let truncated = false;
192
+ traversal: for (let index = 0; index < queue.length; index += 1) {
193
+ options.signal?.throwIfAborted();
194
+ const current = queue[index];
195
+ visitedNodes += 1;
196
+ const adjacent = graph.adjacency(current.id, {
197
+ direction,
198
+ kinds: options.kinds,
199
+ signal: options.signal,
200
+ });
201
+ inspectedEdges += adjacent.meta.inspectedEdges;
202
+ if (current.depth >= maxDepth) {
203
+ if (adjacent.value.some((id) => !seen.has(id)))
204
+ truncated = true;
205
+ continue;
206
+ }
207
+ for (const id of adjacent.value) {
208
+ if (seen.has(id))
209
+ continue;
210
+ if (affected.length >= limit) {
211
+ truncated = true;
212
+ break traversal;
213
+ }
214
+ seen.add(id);
215
+ parents.set(id, current.id);
216
+ const depth = current.depth + 1;
217
+ affected.push({
218
+ id,
219
+ distance: depth,
220
+ path: reconstructImpactPath(root, id, parents),
221
+ });
222
+ queue.push({ id, depth });
223
+ }
224
+ }
225
+ return {
226
+ root,
227
+ affected,
228
+ exact: true,
229
+ truncated,
230
+ cost: { visitedNodes, inspectedEdges },
231
+ };
232
+ }
233
+ /** Analyze weak/strong components, isolates, and exact unique-neighbor hubs. */
234
+ export function analyzeKnowledgeGraph(graph) {
235
+ const nodes = [...graph.nodes()];
236
+ const weak = createAdjacency(nodes);
237
+ const directed = createAdjacency(nodes);
238
+ for (const edge of graph.edges()) {
239
+ appendNeighbor(weak, edge.source, edge.target);
240
+ appendNeighbor(weak, edge.target, edge.source);
241
+ appendNeighbor(directed, edge.source, edge.target);
242
+ }
243
+ const components = [];
244
+ const visited = new Set();
245
+ for (const start of nodes) {
246
+ if (visited.has(start))
247
+ continue;
248
+ const component = [];
249
+ const stack = [start];
250
+ visited.add(start);
251
+ while (stack.length > 0) {
252
+ const current = stack.pop();
253
+ component.push(current);
254
+ for (const neighbor of weak.get(current)) {
255
+ if (visited.has(neighbor))
256
+ continue;
257
+ visited.add(neighbor);
258
+ stack.push(neighbor);
259
+ }
260
+ }
261
+ components.push(component);
262
+ }
263
+ const degrees = nodes.map((id) => ({ id, degree: weak.get(id).size }));
264
+ const maximum = Math.max(0, ...degrees.map(({ degree }) => degree));
265
+ return {
266
+ components: sortComponents(components),
267
+ stronglyConnected: stronglyConnectedComponents(nodes, directed),
268
+ orphans: degrees.filter(({ degree }) => degree === 0).map(({ id }) => id),
269
+ hubs: degrees.filter(({ degree }) => degree > 0 && degree === maximum),
270
+ exact: true,
271
+ provenance: { algorithm: "component-degree", edgeFamily: "all" },
272
+ };
273
+ }
274
+ /** Compare two immutable relationship snapshots by full normalized edge value. */
275
+ export function compareRelationshipSnapshots(before, after) {
276
+ const earlier = new Map(before.edges.map((edge) => [relationshipEdgeKey(edge), edge]));
277
+ const later = new Map(after.edges.map((edge) => [relationshipEdgeKey(edge), edge]));
278
+ return {
279
+ fromVersion: before.version,
280
+ toVersion: after.version,
281
+ added: [...later]
282
+ .filter(([key]) => !earlier.has(key))
283
+ .map(([, edge]) => edge),
284
+ removed: [...earlier]
285
+ .filter(([key]) => !later.has(key))
286
+ .map(([, edge]) => edge),
287
+ unchangedCount: [...earlier.keys()].filter((key) => later.has(key)).length,
288
+ exact: true,
289
+ };
290
+ }
291
+ //# sourceMappingURL=relationship-analytics.js.map
292
+ //# debugId=0a54b889-6d5c-565c-85ff-47e5cce68a32
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-analytics.js","sources":["sdk/relationship-analytics.ts"],"sourceRoot":"/","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"],"names":[],"mappings":";;AAOA,OAAO,EAGL,8BAA8B,GAG/B,MAAM,oBAAoB,CAAC;AAwF5B,SAAS,cAAc,CACrB,SAAmC,EACnC,MAAc,EACd,MAAc;IAEd,SAAS,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,eAAe,CAAC,KAAwB;IAC/C,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,cAAc,CAAC,UAAsB;IAC5C,KAAK,MAAM,SAAS,IAAI,UAAU;QAAE,SAAS,CAAC,IAAI,EAAE,CAAC;IACrD,OAAO,UAAU,CAAC,IAAI,CACpB,CAAC,I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,CAAC,CAAC,CAC9D,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAC7D,CAAC;IACF,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,OAAO;QAC3B,SAAS,EAAE,KAAK,CAAC,OAAO;QACxB,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;aACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACpC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;aAClB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAClC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;QAC1B,cAAc,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;QAC1E,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC","debugId":"0a54b889-6d5c-565c-85ff-47e5cce68a32"}
@@ -0,0 +1,67 @@
1
+ import { RelationshipGraph, RelationshipKindRegistry, type RelationshipEdge, type RelationshipTraversalDirection } from "./relationships.js";
2
+ /** Caller-owned compact node details joined into graph context. */
3
+ export interface RelationshipContextNodeDetails {
4
+ /** Stable graph node identifier. */
5
+ id: string;
6
+ /** Optional display title. */
7
+ title?: string;
8
+ /** Optional lifecycle status. */
9
+ status?: string;
10
+ /** Optional evidence pointers such as files, tests, or history ids. */
11
+ evidence?: readonly string[];
12
+ }
13
+ /** One selected graph-context node with explainable inclusion. */
14
+ export interface RelationshipContextNode extends RelationshipContextNodeDetails {
15
+ /** Shortest bounded distance from the root. */
16
+ distance: number;
17
+ /** Concise deterministic reasons the node was selected. */
18
+ reasons: string[];
19
+ }
20
+ /** Controls for bounded graph-context assembly. */
21
+ export interface RelationshipContextOptions {
22
+ /** Traversal direction relative to each visited node. */
23
+ direction?: RelationshipTraversalDirection;
24
+ /** Optional registered kind filter. */
25
+ kinds?: readonly string[];
26
+ /** Maximum traversal depth. */
27
+ maxDepth?: number;
28
+ /** Maximum nodes returned in this page. */
29
+ nodeLimit?: number;
30
+ /** Maximum edges returned in this page. */
31
+ edgeLimit?: number;
32
+ /** Maximum estimated output tokens charged to rows and edges. */
33
+ tokenBudget?: number;
34
+ /** Opaque continuation from an equivalent query. */
35
+ cursor?: string;
36
+ /** Registry used to explain custom relationship semantics. */
37
+ registry?: RelationshipKindRegistry;
38
+ /** Abort signal checked during traversal. */
39
+ signal?: AbortSignal;
40
+ }
41
+ /** Explainable graph context packet. */
42
+ export interface RelationshipContextResult {
43
+ /** Root node details. */
44
+ root: RelationshipContextNodeDetails;
45
+ /** Bounded related-node page. */
46
+ nodes: RelationshipContextNode[];
47
+ /** Bounded edges whose endpoints are present in the packet. */
48
+ edges: RelationshipEdge[];
49
+ /** Root evidence pointers promoted for immediate consumption. */
50
+ evidence: string[];
51
+ /** Completeness, continuation, and cost envelope. */
52
+ meta: {
53
+ exact: true;
54
+ truncated: boolean;
55
+ nodeLimit: number;
56
+ edgeLimit: number;
57
+ tokenBudget: number;
58
+ usedTokens: number;
59
+ visitedNodes: number;
60
+ inspectedEdges: number;
61
+ omittedNodes: number;
62
+ omittedEdges: number;
63
+ nextCursor?: string;
64
+ };
65
+ }
66
+ /** Build one deterministic bounded graph-context packet with continuation. */
67
+ export declare function buildRelationshipContext(graph: RelationshipGraph, rootId: string, details: readonly RelationshipContextNodeDetails[], options?: RelationshipContextOptions): RelationshipContextResult;