@unbrained/pm-cli 2026.7.14 → 2026.7.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (708) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +54 -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,1114 @@
1
+ import {
2
+ createQueryFingerprint,
3
+ encodeQueryCursor,
4
+ resolveQueryCursorStart
5
+ } from "./chunk-4223PVZT.js";
6
+ import {
7
+ getActiveExtensionRegistrations,
8
+ isTerminalStatus,
9
+ listAllItemMetadataLight,
10
+ readSettings
11
+ } from "./chunk-XSJUSQAE.js";
12
+ import {
13
+ EXIT_CODE,
14
+ PmCliError,
15
+ getSettingsPath,
16
+ pathExists,
17
+ resolveItemTypeRegistry,
18
+ resolvePmRoot,
19
+ resolveRuntimeStatusRegistry
20
+ } from "./chunk-BSEQUTQP.js";
21
+
22
+ // dist/sdk/relationships.js
23
+ !(function() {
24
+ try {
25
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
26
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f5e9e0a6-4550-5e55-9fef-ee54ec06a495");
27
+ } catch (e2) {
28
+ }
29
+ })();
30
+ var BUILTIN_RELATIONSHIP_KINDS = [
31
+ {
32
+ kind: "blocked_by",
33
+ direction: "directed",
34
+ inverse: "blocks",
35
+ ordering: true,
36
+ precedence: "target_before_source",
37
+ hierarchy: false,
38
+ outgoing: "many",
39
+ incoming: "many",
40
+ lifecycle: "persistent",
41
+ aliases: ["depends_on"],
42
+ compatibilityVersion: 1,
43
+ allowSelf: false
44
+ },
45
+ {
46
+ kind: "blocks",
47
+ direction: "directed",
48
+ inverse: "blocked_by",
49
+ ordering: true,
50
+ precedence: "source_before_target",
51
+ hierarchy: false,
52
+ outgoing: "many",
53
+ incoming: "many",
54
+ lifecycle: "persistent",
55
+ compatibilityVersion: 1,
56
+ allowSelf: false
57
+ },
58
+ {
59
+ kind: "parent",
60
+ direction: "directed",
61
+ inverse: "child",
62
+ ordering: false,
63
+ hierarchy: true,
64
+ hierarchyDirection: "target_parent",
65
+ outgoing: "one",
66
+ incoming: "many",
67
+ lifecycle: "supersedable",
68
+ aliases: ["child_of", "epic"],
69
+ compatibilityVersion: 1,
70
+ allowSelf: false
71
+ },
72
+ {
73
+ kind: "child",
74
+ direction: "directed",
75
+ inverse: "parent",
76
+ ordering: false,
77
+ hierarchy: true,
78
+ hierarchyDirection: "source_parent",
79
+ outgoing: "many",
80
+ incoming: "one",
81
+ lifecycle: "supersedable",
82
+ aliases: ["parent_child", "task"],
83
+ compatibilityVersion: 1,
84
+ allowSelf: false
85
+ },
86
+ {
87
+ kind: "related",
88
+ direction: "undirected",
89
+ ordering: false,
90
+ hierarchy: false,
91
+ outgoing: "many",
92
+ incoming: "many",
93
+ lifecycle: "persistent",
94
+ aliases: ["related_to"],
95
+ compatibilityVersion: 1,
96
+ allowSelf: false
97
+ },
98
+ {
99
+ kind: "discovered_from",
100
+ direction: "directed",
101
+ ordering: false,
102
+ hierarchy: false,
103
+ outgoing: "many",
104
+ incoming: "many",
105
+ lifecycle: "persistent",
106
+ compatibilityVersion: 1,
107
+ allowSelf: false
108
+ },
109
+ {
110
+ kind: "incident_from",
111
+ direction: "directed",
112
+ ordering: false,
113
+ hierarchy: false,
114
+ outgoing: "many",
115
+ incoming: "many",
116
+ lifecycle: "persistent",
117
+ compatibilityVersion: 1,
118
+ allowSelf: false
119
+ },
120
+ {
121
+ kind: "supersedes",
122
+ direction: "directed",
123
+ ordering: false,
124
+ hierarchy: false,
125
+ outgoing: "many",
126
+ incoming: "many",
127
+ lifecycle: "supersedable",
128
+ compatibilityVersion: 1,
129
+ allowSelf: false
130
+ }
131
+ ];
132
+ function normalizeKind(kind) {
133
+ return kind.trim().toLowerCase().replaceAll("-", "_");
134
+ }
135
+ function normalizeInverseKind(inverse) {
136
+ if (inverse === void 0)
137
+ return void 0;
138
+ const normalized = normalizeKind(inverse);
139
+ if (!/^[a-z][a-z0-9_]*$/.test(normalized))
140
+ throw new TypeError(`Invalid inverse relationship kind: ${inverse}`);
141
+ return normalized;
142
+ }
143
+ function freezeValue(value, visited = /* @__PURE__ */ new Set()) {
144
+ if (value === null || typeof value !== "object")
145
+ return value;
146
+ if (visited.has(value))
147
+ return value;
148
+ visited.add(value);
149
+ if (Array.isArray(value)) {
150
+ for (const entry of value)
151
+ freezeValue(entry, visited);
152
+ return Object.freeze(value);
153
+ }
154
+ for (const entry of Object.values(value))
155
+ freezeValue(entry, visited);
156
+ return Object.freeze(value);
157
+ }
158
+ function assertRelationshipPrecedence(definition, kind) {
159
+ if (definition.precedence !== void 0 && definition.precedence !== "source_before_target" && definition.precedence !== "target_before_source")
160
+ throw new TypeError(`Invalid relationship precedence for ${kind}`);
161
+ if (!definition.ordering && definition.precedence !== void 0)
162
+ throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${kind}`);
163
+ }
164
+ function assertRelationshipHierarchyDirection(definition, kind) {
165
+ if (definition.hierarchyDirection !== void 0 && definition.hierarchyDirection !== "source_parent" && definition.hierarchyDirection !== "target_parent")
166
+ throw new TypeError(`Invalid relationship hierarchy direction for ${kind}`);
167
+ if (!definition.hierarchy && definition.hierarchyDirection !== void 0)
168
+ throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${kind}`);
169
+ }
170
+ var RelationshipKindRegistry = class {
171
+ #definitions = /* @__PURE__ */ new Map();
172
+ #aliases = /* @__PURE__ */ new Map();
173
+ /** Create a registry initialized with the stable built-in ontology by default. */
174
+ constructor(definitions = BUILTIN_RELATIONSHIP_KINDS) {
175
+ for (const definition of definitions)
176
+ this.register(definition);
177
+ }
178
+ /** Register one definition after validating its identifier, version, and aliases. */
179
+ register(definition) {
180
+ const kind = normalizeKind(definition.kind);
181
+ if (!/^[a-z][a-z0-9_]*$/.test(kind))
182
+ throw new TypeError(`Invalid relationship kind: ${definition.kind}`);
183
+ if (!Number.isInteger(definition.compatibilityVersion) || definition.compatibilityVersion < 1)
184
+ throw new TypeError(`Invalid compatibility version for ${kind}`);
185
+ assertRelationshipPrecedence(definition, kind);
186
+ assertRelationshipHierarchyDirection(definition, kind);
187
+ if (this.#definitions.has(kind) || this.#aliases.has(kind))
188
+ throw new TypeError(`Relationship kind already registered: ${kind}`);
189
+ const inverse = normalizeInverseKind(definition.inverse);
190
+ const aliases = [
191
+ ...new Set((definition.aliases ?? []).map(normalizeKind))
192
+ ].sort();
193
+ for (const alias of aliases) {
194
+ if (!/^[a-z][a-z0-9_]*$/.test(alias))
195
+ throw new TypeError(`Invalid relationship alias: ${alias}`);
196
+ if (alias === kind || this.#definitions.has(alias) || this.#aliases.has(alias))
197
+ throw new TypeError(`Relationship alias already registered: ${alias}`);
198
+ }
199
+ const normalized = Object.freeze({
200
+ ...definition,
201
+ kind,
202
+ inverse,
203
+ aliases: Object.freeze(aliases),
204
+ payloadSchema: definition.payloadSchema ? freezeValue(structuredClone(definition.payloadSchema)) : void 0
205
+ });
206
+ this.#definitions.set(kind, normalized);
207
+ for (const alias of aliases)
208
+ this.#aliases.set(alias, kind);
209
+ return this;
210
+ }
211
+ /** Resolve a canonical kind or compatibility alias. */
212
+ resolve(kind) {
213
+ if (typeof kind !== "string")
214
+ return void 0;
215
+ const normalized = normalizeKind(kind);
216
+ return this.#definitions.get(this.#aliases.get(normalized) ?? normalized);
217
+ }
218
+ /** Resolve a kind or throw a precise error suitable for command adapters. */
219
+ require(kind) {
220
+ const definition = this.resolve(kind);
221
+ if (!definition)
222
+ throw new TypeError(`Unknown relationship kind: ${kind}`);
223
+ return definition;
224
+ }
225
+ /** Return a deterministic immutable registry snapshot. */
226
+ list() {
227
+ return Object.freeze([...this.#definitions.values()].sort((left, right) => left.kind.localeCompare(right.kind)));
228
+ }
229
+ };
230
+ function createRelationshipKindRegistry() {
231
+ return new RelationshipKindRegistry();
232
+ }
233
+ var defaultRegistry = createRelationshipKindRegistry();
234
+ function isOrderingRelationshipKind(kind, registry = defaultRegistry) {
235
+ return registry.resolve(kind)?.ordering === true;
236
+ }
237
+ function compareEdges(left, right) {
238
+ return left.source.localeCompare(right.source) || left.target.localeCompare(right.target) || left.kind.localeCompare(right.kind);
239
+ }
240
+ function normalizeRelationshipEdge(candidate, nodes, registry) {
241
+ const source = typeof candidate.source === "string" ? candidate.source.trim() : "";
242
+ const target = typeof candidate.target === "string" ? candidate.target.trim() : "";
243
+ const definition = registry.require(candidate.kind);
244
+ if (!nodes.has(source) || !nodes.has(target))
245
+ throw new TypeError(`Relationship endpoint not found: ${source} -> ${target}`);
246
+ if (source === target && !definition.allowSelf)
247
+ throw new TypeError(`Self relationship is not allowed for ${definition.kind}`);
248
+ const edge = Object.freeze({
249
+ ...candidate,
250
+ source,
251
+ target,
252
+ kind: definition.kind
253
+ });
254
+ const endpoints = definition.direction === "undirected" ? [source, target].sort().join("\0") : `${source}\0${target}`;
255
+ return { edge, identity: `${definition.kind}\0${endpoints}` };
256
+ }
257
+ function appendIndexedEdge(index, node, edge) {
258
+ const indexed = index.get(node);
259
+ if (indexed)
260
+ indexed.push(edge);
261
+ else
262
+ index.set(node, [edge]);
263
+ }
264
+ function normalizeNodeId(value) {
265
+ return typeof value === "string" ? value.trim() : "";
266
+ }
267
+ function resolveExistingNodeId(value, ids) {
268
+ const id = normalizeNodeId(value);
269
+ return id && ids.has(id) ? id : void 0;
270
+ }
271
+ function reconstructPath(source, target, parents) {
272
+ const path = [target];
273
+ let cursor = target;
274
+ while (cursor !== source) {
275
+ cursor = parents.get(cursor);
276
+ path.push(cursor);
277
+ }
278
+ return path.reverse();
279
+ }
280
+ var RelationshipGraph = class _RelationshipGraph {
281
+ #registry;
282
+ #nodes;
283
+ #nodeSnapshot;
284
+ #edges;
285
+ #outgoing = /* @__PURE__ */ new Map();
286
+ #incoming = /* @__PURE__ */ new Map();
287
+ /** Validate and index nodes and edges without reading tracker storage. */
288
+ constructor(nodes, edges, registry = defaultRegistry) {
289
+ this.#registry = registry;
290
+ this.#nodes = new Set([...nodes].filter((id) => typeof id === "string").map((id) => id.trim()).filter(Boolean));
291
+ this.#nodeSnapshot = Object.freeze([...this.#nodes].sort());
292
+ const deduped = /* @__PURE__ */ new Map();
293
+ for (const candidate of edges) {
294
+ const { edge, identity } = normalizeRelationshipEdge(candidate, this.#nodes, registry);
295
+ deduped.set(identity, edge);
296
+ }
297
+ this.#edges = Object.freeze([...deduped.values()].sort(compareEdges));
298
+ for (const edge of this.#edges) {
299
+ appendIndexedEdge(this.#outgoing, edge.source, edge);
300
+ appendIndexedEdge(this.#incoming, edge.target, edge);
301
+ if (registry.require(edge.kind).direction === "undirected") {
302
+ appendIndexedEdge(this.#outgoing, edge.target, edge);
303
+ appendIndexedEdge(this.#incoming, edge.source, edge);
304
+ }
305
+ }
306
+ }
307
+ /** Build the graph directly from item metadata, including hierarchy and legacy blocker fields. */
308
+ static fromItems(items, registry = defaultRegistry) {
309
+ const ids = new Set(items.map((item) => normalizeNodeId(item.id)).filter(Boolean));
310
+ const edges = [];
311
+ for (const item of items) {
312
+ const source = normalizeNodeId(item.id);
313
+ if (!source)
314
+ continue;
315
+ const parent = resolveExistingNodeId(item.parent, ids);
316
+ if (parent)
317
+ edges.push({ source, target: parent, kind: "parent" });
318
+ const blockedBy = resolveExistingNodeId(item.blocked_by, ids);
319
+ if (blockedBy)
320
+ edges.push({
321
+ source,
322
+ target: blockedBy,
323
+ kind: "blocked_by"
324
+ });
325
+ for (const dependency of item.dependencies ?? []) {
326
+ const dependencyId = resolveExistingNodeId(dependency.id, ids);
327
+ if (dependencyId && registry.resolve(dependency.kind))
328
+ edges.push({
329
+ source,
330
+ target: dependencyId,
331
+ kind: dependency.kind,
332
+ createdAt: dependency.created_at,
333
+ author: dependency.author
334
+ });
335
+ }
336
+ }
337
+ return new _RelationshipGraph(ids, edges, registry);
338
+ }
339
+ /** Return the deterministic immutable edge snapshot. */
340
+ edges() {
341
+ return this.#edges;
342
+ }
343
+ /** Return the deterministic immutable edges incident to one node. */
344
+ incidentEdges(id) {
345
+ this.#assertNode(id);
346
+ const outgoing = this.#outgoing.get(id) ?? [];
347
+ const incoming = this.#incoming.get(id) ?? [];
348
+ if (outgoing.length === 0)
349
+ return Object.freeze([...incoming]);
350
+ if (incoming.length === 0)
351
+ return Object.freeze([...outgoing]);
352
+ const edges = [];
353
+ let outgoingIndex = 0;
354
+ let incomingIndex = 0;
355
+ while (outgoingIndex < outgoing.length || incomingIndex < incoming.length) {
356
+ const outgoingEdge = outgoing[outgoingIndex];
357
+ const incomingEdge = incoming[incomingIndex];
358
+ const edge = outgoingEdge === void 0 ? incomingEdge : incomingEdge === void 0 || compareEdges(outgoingEdge, incomingEdge) <= 0 ? outgoingEdge : incomingEdge;
359
+ if (edges.at(-1) !== edge)
360
+ edges.push(edge);
361
+ if (outgoingEdge === edge)
362
+ outgoingIndex += 1;
363
+ if (incomingEdge === edge)
364
+ incomingIndex += 1;
365
+ }
366
+ return Object.freeze(edges);
367
+ }
368
+ /** Return the deterministic immutable node snapshot. */
369
+ nodes() {
370
+ return this.#nodeSnapshot;
371
+ }
372
+ #assertNode(id) {
373
+ if (!this.#nodes.has(id))
374
+ throw new TypeError(`Relationship node not found: ${id}`);
375
+ }
376
+ #matchesKinds(edge, kinds) {
377
+ if (!kinds)
378
+ return true;
379
+ const definition = this.#registry.require(edge.kind);
380
+ return kinds.has(edge.kind) || definition.inverse !== void 0 && kinds.has(definition.inverse);
381
+ }
382
+ #neighbors(id, direction, kinds) {
383
+ const candidates = [
384
+ ...direction === "incoming" ? [] : this.#outgoing.get(id) ?? [],
385
+ ...direction === "outgoing" ? [] : this.#incoming.get(id) ?? []
386
+ ];
387
+ return [...new Set(candidates)].filter((edge) => this.#matchesKinds(edge, kinds)).map((edge) => ({
388
+ id: edge.source === id ? edge.target : edge.source,
389
+ edge
390
+ })).sort((left, right) => left.id.localeCompare(right.id) || compareEdges(left.edge, right.edge));
391
+ }
392
+ /** Return one-hop adjacent node identifiers. */
393
+ adjacency(id, options = {}) {
394
+ this.#assertNode(id);
395
+ options.signal?.throwIfAborted();
396
+ const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
397
+ const rows = this.#neighbors(id, options.direction ?? "outgoing", kinds);
398
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
399
+ const uniqueNeighbors = [...new Set(rows.map((row) => row.id))];
400
+ const value = uniqueNeighbors.slice(0, limit);
401
+ return {
402
+ value,
403
+ meta: {
404
+ visitedNodes: 1,
405
+ inspectedEdges: rows.length,
406
+ truncated: value.length < uniqueNeighbors.length,
407
+ nextCursor: value.at(-1)
408
+ }
409
+ };
410
+ }
411
+ /** Return bounded transitive closure in breadth-first discovery order. */
412
+ closure(id, options = {}) {
413
+ this.#assertNode(id);
414
+ const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
415
+ const direction = options.direction ?? "outgoing";
416
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
417
+ const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
418
+ const seen = /* @__PURE__ */ new Set([id]);
419
+ const value = [];
420
+ const queue = [{ id, depth: 0 }];
421
+ let visitedNodes = 0;
422
+ let inspectedEdges = 0;
423
+ let truncated = false;
424
+ traversal: for (let index = 0; index < queue.length; index += 1) {
425
+ options.signal?.throwIfAborted();
426
+ const current = queue[index];
427
+ visitedNodes += 1;
428
+ const neighbors = this.#neighbors(current.id, direction, kinds);
429
+ inspectedEdges += neighbors.length;
430
+ if (current.depth >= maxDepth) {
431
+ if (neighbors.some((neighbor) => !seen.has(neighbor.id)))
432
+ truncated = true;
433
+ continue;
434
+ }
435
+ for (const neighbor of neighbors) {
436
+ if (seen.has(neighbor.id))
437
+ continue;
438
+ if (value.length >= limit) {
439
+ truncated = true;
440
+ break traversal;
441
+ }
442
+ seen.add(neighbor.id);
443
+ value.push(neighbor.id);
444
+ queue.push({ id: neighbor.id, depth: current.depth + 1 });
445
+ }
446
+ }
447
+ return {
448
+ value,
449
+ meta: {
450
+ visitedNodes,
451
+ inspectedEdges,
452
+ truncated,
453
+ nextCursor: value.at(-1)
454
+ }
455
+ };
456
+ }
457
+ /** Return a deterministic shortest path, or an empty array when disconnected. */
458
+ shortestPath(source, target, options = {}) {
459
+ this.#assertNode(source);
460
+ this.#assertNode(target);
461
+ if (source === target)
462
+ return {
463
+ value: [source],
464
+ meta: { visitedNodes: 1, inspectedEdges: 0, truncated: false }
465
+ };
466
+ const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
467
+ const direction = options.direction ?? "outgoing";
468
+ const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
469
+ const queue = [{ id: source, depth: 0 }];
470
+ const parents = /* @__PURE__ */ new Map();
471
+ const seen = /* @__PURE__ */ new Set([source]);
472
+ let visitedNodes = 0;
473
+ let inspectedEdges = 0;
474
+ let truncated = false;
475
+ for (let index = 0; index < queue.length; index += 1) {
476
+ options.signal?.throwIfAborted();
477
+ const current = queue[index];
478
+ visitedNodes += 1;
479
+ const neighbors = this.#neighbors(current.id, direction, kinds);
480
+ inspectedEdges += neighbors.length;
481
+ if (current.depth >= maxDepth) {
482
+ if (neighbors.some((neighbor) => !seen.has(neighbor.id)))
483
+ truncated = true;
484
+ continue;
485
+ }
486
+ for (const neighbor of neighbors) {
487
+ if (seen.has(neighbor.id))
488
+ continue;
489
+ parents.set(neighbor.id, current.id);
490
+ if (neighbor.id === target)
491
+ return {
492
+ value: reconstructPath(source, target, parents),
493
+ meta: { visitedNodes, inspectedEdges, truncated: false }
494
+ };
495
+ seen.add(neighbor.id);
496
+ queue.push({ id: neighbor.id, depth: current.depth + 1 });
497
+ }
498
+ }
499
+ return {
500
+ value: [],
501
+ meta: { visitedNodes, inspectedEdges, truncated }
502
+ };
503
+ }
504
+ /** Return the induced subgraph over a bounded closure including the root. */
505
+ subgraph(id, options = {}) {
506
+ const closure = this.closure(id, options);
507
+ const nodes = [id, ...closure.value].sort();
508
+ const included = new Set(nodes);
509
+ const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
510
+ const edges = /* @__PURE__ */ new Set();
511
+ for (const node of nodes) {
512
+ for (const edge of this.#outgoing.get(node) ?? []) {
513
+ if (included.has(edge.source) && included.has(edge.target) && this.#matchesKinds(edge, kinds))
514
+ edges.add(edge);
515
+ }
516
+ }
517
+ return {
518
+ value: {
519
+ nodes,
520
+ edges: [...edges].sort(compareEdges)
521
+ },
522
+ meta: closure.meta
523
+ };
524
+ }
525
+ };
526
+ function dependencyToRelationship(source, dependency, registry = defaultRegistry) {
527
+ return {
528
+ source,
529
+ target: dependency.id,
530
+ kind: registry.require(dependency.kind).kind,
531
+ createdAt: dependency.created_at,
532
+ author: dependency.author
533
+ };
534
+ }
535
+
536
+ // dist/sdk/relationship-context.js
537
+ !(function() {
538
+ try {
539
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
540
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "dfd47ca8-a68d-50e1-9aba-638d974a0027");
541
+ } catch (e2) {
542
+ }
543
+ })();
544
+ var tokenEncoder = new TextEncoder();
545
+ function positiveInteger(value, fallback, field) {
546
+ const resolved = value ?? fallback;
547
+ if (!Number.isInteger(resolved) || resolved < 1)
548
+ throw new TypeError(`Relationship context ${field} must be positive`);
549
+ return resolved;
550
+ }
551
+ function estimateTokens(value) {
552
+ return Math.max(1, Math.ceil(tokenEncoder.encode(JSON.stringify(value)).byteLength / 4));
553
+ }
554
+ function explainDirectEdge(edge, root, node, registry) {
555
+ const definition = registry.require(edge.kind);
556
+ if (definition.ordering) {
557
+ const sourceFirst = (definition.precedence ?? "source_before_target") === "source_before_target";
558
+ const before = sourceFirst ? edge.source : edge.target;
559
+ return node === before ? "prerequisite" : "dependent";
560
+ }
561
+ if (definition.hierarchy) {
562
+ const sourceIsParent = (definition.hierarchyDirection ?? "source_parent") === "source_parent";
563
+ const parent = sourceIsParent ? edge.source : edge.target;
564
+ return node === parent ? "ancestor" : "descendant";
565
+ }
566
+ if (edge.kind === "discovered_from" || edge.kind === "incident_from")
567
+ return "provenance";
568
+ return "related";
569
+ }
570
+ function directReasons(rootEdges, root, node, registry) {
571
+ const reasons = rootEdges.filter((edge) => edge.source === root && edge.target === node || edge.target === root && edge.source === node).map((edge) => explainDirectEdge(edge, root, node, registry));
572
+ return [...new Set(reasons)].sort();
573
+ }
574
+ function discoverNodes(graph, root, options) {
575
+ const direction = options.direction ?? "both";
576
+ const maxDepth = options.maxDepth ?? 3;
577
+ if (!Number.isInteger(maxDepth) || maxDepth < 0)
578
+ throw new TypeError("Relationship context maxDepth must be non-negative");
579
+ const seen = /* @__PURE__ */ new Set([root]);
580
+ const queue = [{ id: root, distance: 0 }];
581
+ const rows = [];
582
+ let inspectedEdges = 0;
583
+ let depthTruncated = false;
584
+ for (let index = 0; index < queue.length; index += 1) {
585
+ options.signal?.throwIfAborted();
586
+ const current = queue[index];
587
+ if (current.distance >= maxDepth && depthTruncated)
588
+ continue;
589
+ const adjacent = graph.adjacency(current.id, {
590
+ direction,
591
+ kinds: options.kinds,
592
+ signal: options.signal
593
+ });
594
+ inspectedEdges += adjacent.meta.inspectedEdges;
595
+ if (current.distance >= maxDepth) {
596
+ if (adjacent.value.some((id) => !seen.has(id)))
597
+ depthTruncated = true;
598
+ continue;
599
+ }
600
+ for (const id of adjacent.value) {
601
+ if (seen.has(id))
602
+ continue;
603
+ seen.add(id);
604
+ const row = { id, distance: current.distance + 1 };
605
+ rows.push(row);
606
+ queue.push(row);
607
+ }
608
+ }
609
+ rows.sort((left, right) => left.distance - right.distance || left.id.localeCompare(right.id));
610
+ return {
611
+ rows,
612
+ visitedNodes: queue.length,
613
+ inspectedEdges,
614
+ depthTruncated
615
+ };
616
+ }
617
+ function selectContextNodes(params) {
618
+ const nodes = [];
619
+ let usedTokens = params.initialTokens;
620
+ const rootEdges = params.graph.incidentEdges(params.rootId);
621
+ for (const candidate of params.candidates) {
622
+ if (nodes.length >= params.nodeLimit)
623
+ break;
624
+ const node = {
625
+ ...params.details.get(candidate.id) ?? { id: candidate.id },
626
+ distance: candidate.distance,
627
+ reasons: candidate.distance === 1 ? directReasons(rootEdges, params.rootId, candidate.id, params.registry) : [`reachable at depth ${candidate.distance}`]
628
+ };
629
+ const cost = estimateTokens(node);
630
+ if (usedTokens + cost > params.tokenBudget)
631
+ break;
632
+ nodes.push(node);
633
+ usedTokens += cost;
634
+ }
635
+ if (params.candidates.length > 0 && nodes.length === 0)
636
+ throw new TypeError("Relationship context tokenBudget cannot fit one node");
637
+ return { nodes, usedTokens };
638
+ }
639
+ function selectContextEdges(params) {
640
+ const candidates = params.graph.edges().filter((edge) => params.included.has(edge.source) && params.included.has(edge.target));
641
+ const edges = [];
642
+ let usedTokens = params.initialTokens;
643
+ for (const edge of candidates) {
644
+ if (edges.length >= params.edgeLimit)
645
+ break;
646
+ const cost = estimateTokens(edge);
647
+ if (usedTokens + cost > params.tokenBudget)
648
+ break;
649
+ edges.push(edge);
650
+ usedTokens += cost;
651
+ }
652
+ return { edges, usedTokens, candidateCount: candidates.length };
653
+ }
654
+ function buildRelationshipContext(graph, rootId, details, options = {}) {
655
+ if (!graph.nodes().includes(rootId))
656
+ throw new TypeError(`Relationship node not found: ${rootId}`);
657
+ const nodeLimit = positiveInteger(options.nodeLimit, 20, "nodeLimit");
658
+ const edgeLimit = positiveInteger(options.edgeLimit, 40, "edgeLimit");
659
+ const tokenBudget = positiveInteger(options.tokenBudget, 1200, "tokenBudget");
660
+ const registry = options.registry ?? createRelationshipKindRegistry();
661
+ const byId = new Map(details.map((detail) => [detail.id, detail]));
662
+ const rootDetails = byId.get(rootId) ?? {
663
+ id: rootId
664
+ };
665
+ const { evidence: rootEvidence = [], ...root } = rootDetails;
666
+ const evidence = [...rootEvidence];
667
+ const discovery = discoverNodes(graph, rootId, options);
668
+ const fingerprint = createQueryFingerprint("relationship-context", {
669
+ rootId,
670
+ direction: options.direction ?? "both",
671
+ kinds: [...options.kinds ?? []].sort(),
672
+ maxDepth: options.maxDepth ?? 3
673
+ });
674
+ const pageStart = resolveQueryCursorStart(discovery.rows, options.cursor, fingerprint, ({ id }) => id);
675
+ const candidates = discovery.rows.slice(pageStart);
676
+ const initialTokens = estimateTokens(root) + estimateTokens(evidence);
677
+ if (initialTokens > tokenBudget)
678
+ throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");
679
+ const nodeSelection = selectContextNodes({
680
+ candidates,
681
+ details: byId,
682
+ graph,
683
+ rootId,
684
+ registry,
685
+ nodeLimit,
686
+ tokenBudget,
687
+ initialTokens
688
+ });
689
+ const { nodes } = nodeSelection;
690
+ const included = /* @__PURE__ */ new Set([rootId, ...nodes.map(({ id }) => id)]);
691
+ const edgeSelection = selectContextEdges({
692
+ graph,
693
+ included,
694
+ edgeLimit,
695
+ tokenBudget,
696
+ initialTokens: nodeSelection.usedTokens
697
+ });
698
+ const { edges, usedTokens } = edgeSelection;
699
+ const consumed = pageStart + nodes.length;
700
+ const hasMoreNodes = consumed < discovery.rows.length;
701
+ const lastNode = nodes.at(-1);
702
+ const omittedEdges = edgeSelection.candidateCount - edges.length;
703
+ const truncated = discovery.depthTruncated || hasMoreNodes || omittedEdges > 0;
704
+ return {
705
+ root,
706
+ nodes,
707
+ edges,
708
+ evidence,
709
+ meta: {
710
+ exact: true,
711
+ truncated,
712
+ nodeLimit,
713
+ edgeLimit,
714
+ tokenBudget,
715
+ usedTokens,
716
+ visitedNodes: discovery.visitedNodes,
717
+ inspectedEdges: discovery.inspectedEdges,
718
+ omittedNodes: discovery.rows.length - consumed,
719
+ omittedEdges,
720
+ ...hasMoreNodes && lastNode ? {
721
+ nextCursor: encodeQueryCursor(fingerprint, lastNode.id, consumed - 1)
722
+ } : {}
723
+ }
724
+ };
725
+ }
726
+
727
+ // dist/sdk/dependencies.js
728
+ !(function() {
729
+ try {
730
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
731
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f44a0567-53d9-5c87-b01f-15fb84782227");
732
+ } catch (e2) {
733
+ }
734
+ })();
735
+ var DEPS_FORMAT_VALUES = ["tree", "graph", "context"];
736
+ var DEPS_COLLAPSE_VALUES = ["none", "repeated"];
737
+ function normalizeDependencyReferenceTarget(target) {
738
+ if (typeof target !== "string")
739
+ return void 0;
740
+ const normalized = target.trim();
741
+ if (!normalized || ["none", "null", "n/a", "na"].includes(normalized.toLowerCase()))
742
+ return void 0;
743
+ return normalized;
744
+ }
745
+ function normalizeDependencyGraphTarget(target) {
746
+ const normalized = normalizeDependencyReferenceTarget(target);
747
+ return normalized?.toLowerCase() === "no-active-blocker" ? void 0 : normalized;
748
+ }
749
+ function collectDanglingDependencyReferences(items, isTerminal = (status) => status === "closed" || status === "canceled") {
750
+ const knownIds = new Set(items.map((item) => item.id.trim().toLowerCase()));
751
+ const rows = /* @__PURE__ */ new Map();
752
+ const addReference = (item, target, kind, source) => {
753
+ const normalized = normalizeDependencyReferenceTarget(target);
754
+ if (!normalized || knownIds.has(normalized.toLowerCase())) {
755
+ return;
756
+ }
757
+ const row = {
758
+ holder_id: item.id,
759
+ target_id: normalized,
760
+ kind,
761
+ source,
762
+ holder_status: item.status,
763
+ legacy_terminal: isTerminal(item.status),
764
+ no_active_blocker_sentinel: normalized.toLowerCase() === "no-active-blocker"
765
+ };
766
+ rows.set(`${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`, row);
767
+ };
768
+ for (const item of items) {
769
+ addReference(item, item.parent, "parent", "parent");
770
+ addReference(item, item.blocked_by, "blocked_by", "blocked_by");
771
+ for (const dependency of item.dependencies ?? []) {
772
+ if (typeof dependency !== "object" || dependency === null) {
773
+ continue;
774
+ }
775
+ const legacyDependency = dependency;
776
+ addReference(item, legacyDependency.id, typeof legacyDependency.kind === "string" ? legacyDependency.kind : "related", "dependency");
777
+ }
778
+ }
779
+ const sorted = [...rows.values()].sort((left, right) => left.holder_id.localeCompare(right.holder_id) || left.target_id.localeCompare(right.target_id) || left.kind.localeCompare(right.kind) || left.source.localeCompare(right.source));
780
+ const legacyTerminal = sorted.filter((row) => row.legacy_terminal);
781
+ return {
782
+ active: sorted.filter((row) => !row.legacy_terminal),
783
+ legacy_terminal: legacyTerminal,
784
+ no_active_blocker_sentinels: sorted.filter((row) => row.no_active_blocker_sentinel)
785
+ };
786
+ }
787
+ function collectMissingDependencyTargetIds(dangling) {
788
+ const targets = /* @__PURE__ */ new Map();
789
+ for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {
790
+ if (reference.no_active_blocker_sentinel)
791
+ continue;
792
+ const target = reference.target_id.trim();
793
+ const key = target.toLowerCase();
794
+ if (!targets.has(key))
795
+ targets.set(key, target);
796
+ }
797
+ return [...targets.values()].sort((left, right) => left.localeCompare(right));
798
+ }
799
+ function parseFormat(raw) {
800
+ const candidate = raw?.trim().toLowerCase() ?? "tree";
801
+ if (DEPS_FORMAT_VALUES.includes(candidate)) {
802
+ return candidate;
803
+ }
804
+ throw new PmCliError(`Invalid --format value "${raw}". Use "tree", "graph", or "context".`, EXIT_CODE.USAGE);
805
+ }
806
+ function parsePositiveInteger(raw, flag) {
807
+ if (raw === void 0)
808
+ return void 0;
809
+ const value = typeof raw === "number" ? raw : Number(raw.trim());
810
+ if (!Number.isInteger(value) || value < 1)
811
+ throw new PmCliError(`Invalid --${flag} value "${raw}". Use a positive integer.`, EXIT_CODE.USAGE);
812
+ return value;
813
+ }
814
+ function parseMaxDepth(raw) {
815
+ if (raw === void 0) {
816
+ return void 0;
817
+ }
818
+ const normalized = typeof raw === "number" ? raw : Number(raw.trim());
819
+ if (!Number.isInteger(normalized) || normalized < 0) {
820
+ throw new PmCliError(`Invalid --max-depth value "${raw}". Use a non-negative integer.`, EXIT_CODE.USAGE);
821
+ }
822
+ return normalized;
823
+ }
824
+ function parseCollapse(raw) {
825
+ const candidate = raw?.trim().toLowerCase() ?? "none";
826
+ if (DEPS_COLLAPSE_VALUES.includes(candidate)) {
827
+ return candidate;
828
+ }
829
+ throw new PmCliError(`Invalid --collapse value "${raw}". Use "none" or "repeated".`, EXIT_CODE.USAGE);
830
+ }
831
+ function normalizeDependencies(dependencies) {
832
+ if (!dependencies || dependencies.length === 0) {
833
+ return [];
834
+ }
835
+ const sorted = dependencies.map(({ id, kind }) => ({
836
+ id: id.trim(),
837
+ kind: kind.trim().toLowerCase()
838
+ })).sort((left, right) => {
839
+ const byKind = left.kind.localeCompare(right.kind);
840
+ if (byKind !== 0)
841
+ return byKind;
842
+ return left.id.localeCompare(right.id);
843
+ });
844
+ const deduped = /* @__PURE__ */ new Map();
845
+ for (const dependency of sorted) {
846
+ const key = `${dependency.kind.toLowerCase()}::${dependency.id.toLowerCase()}`;
847
+ if (!deduped.has(key)) {
848
+ deduped.set(key, { id: dependency.id, kind: dependency.kind });
849
+ }
850
+ }
851
+ return [...deduped.values()];
852
+ }
853
+ function toIndexedItem(item) {
854
+ return {
855
+ id: item.id,
856
+ title: item.title,
857
+ type: item.type,
858
+ status: item.status,
859
+ dependencies: normalizeDependencies(item.dependencies)
860
+ };
861
+ }
862
+ function toTreeNode(id, index, lineage, maxDepth, collapse, expanded, depth = 0, via) {
863
+ const lookupId = id.trim().toLowerCase();
864
+ const item = index.get(lookupId);
865
+ const baseNode = {
866
+ id: item?.id ?? id,
867
+ title: item?.title,
868
+ type: item?.type,
869
+ status: item?.status,
870
+ via,
871
+ missing: !item,
872
+ cycle: lineage.has(lookupId),
873
+ dependencies: []
874
+ };
875
+ if (!item || baseNode.cycle) {
876
+ return baseNode;
877
+ }
878
+ if (maxDepth !== void 0 && depth >= maxDepth) {
879
+ if (item.dependencies.length > 0) {
880
+ baseNode.truncated = true;
881
+ }
882
+ return baseNode;
883
+ }
884
+ if (collapse === "repeated" && expanded.has(lookupId)) {
885
+ baseNode.collapsed = true;
886
+ return baseNode;
887
+ }
888
+ if (collapse === "repeated") {
889
+ expanded.add(lookupId);
890
+ }
891
+ const nextLineage = new Set(lineage);
892
+ nextLineage.add(lookupId);
893
+ baseNode.dependencies = item.dependencies.map((dependency) => toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind));
894
+ return baseNode;
895
+ }
896
+ function mergeGraphNode(existing, candidate) {
897
+ if (!existing) {
898
+ return candidate;
899
+ }
900
+ if (existing.missing && !candidate.missing)
901
+ return candidate;
902
+ return {
903
+ ...existing,
904
+ title: existing.title ?? candidate.title,
905
+ type: existing.type ?? candidate.type,
906
+ status: existing.status ?? candidate.status
907
+ };
908
+ }
909
+ function toGraph(root) {
910
+ const nodesById = /* @__PURE__ */ new Map();
911
+ const edgesByKey = /* @__PURE__ */ new Map();
912
+ const visit = (node) => {
913
+ nodesById.set(node.id, mergeGraphNode(nodesById.get(node.id), {
914
+ id: node.id,
915
+ title: node.title,
916
+ type: node.type,
917
+ status: node.status,
918
+ missing: node.missing
919
+ }));
920
+ for (const child of node.dependencies) {
921
+ nodesById.set(child.id, mergeGraphNode(nodesById.get(child.id), {
922
+ id: child.id,
923
+ title: child.title,
924
+ type: child.type,
925
+ status: child.status,
926
+ missing: child.missing
927
+ }));
928
+ const relationKind = child.via ?? "related";
929
+ const edgeKey = `${node.id}::${child.id}::${relationKind}`;
930
+ if (!edgesByKey.has(edgeKey)) {
931
+ edgesByKey.set(edgeKey, {
932
+ from: node.id,
933
+ to: child.id,
934
+ kind: relationKind
935
+ });
936
+ }
937
+ if (!child.cycle) {
938
+ visit(child);
939
+ }
940
+ }
941
+ };
942
+ visit(root);
943
+ const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));
944
+ const edges = [...edgesByKey.values()].sort((left, right) => {
945
+ const byFrom = left.from.localeCompare(right.from);
946
+ if (byFrom !== 0)
947
+ return byFrom;
948
+ const byTo = left.to.localeCompare(right.to);
949
+ if (byTo !== 0)
950
+ return byTo;
951
+ return left.kind.localeCompare(right.kind);
952
+ });
953
+ const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);
954
+ return {
955
+ root_id: root.id,
956
+ nodes,
957
+ edges,
958
+ missing_ids: missingIds
959
+ };
960
+ }
961
+ function countDependencyGraph(rootId, index, maxDepth) {
962
+ const nodeIds = /* @__PURE__ */ new Set();
963
+ const edgeKeys = /* @__PURE__ */ new Set();
964
+ const missingIds = /* @__PURE__ */ new Set();
965
+ const expanded = /* @__PURE__ */ new Set();
966
+ const pending = [{ id: rootId, depth: 0 }];
967
+ let pendingIndex = 0;
968
+ while (pendingIndex < pending.length) {
969
+ const current = pending[pendingIndex++];
970
+ const lookupId = current.id.trim().toLowerCase();
971
+ nodeIds.add(lookupId);
972
+ const item = index.get(lookupId);
973
+ if (!item) {
974
+ missingIds.add(lookupId);
975
+ continue;
976
+ }
977
+ if (maxDepth !== void 0 && current.depth >= maxDepth) {
978
+ continue;
979
+ }
980
+ if (expanded.has(lookupId)) {
981
+ continue;
982
+ }
983
+ expanded.add(lookupId);
984
+ for (const dependency of item.dependencies) {
985
+ edgeKeys.add(`${lookupId}::${dependency.id.trim().toLowerCase()}::${dependency.kind}`);
986
+ pending.push({ id: dependency.id, depth: current.depth + 1 });
987
+ }
988
+ }
989
+ return {
990
+ node_count: nodeIds.size,
991
+ edge_count: edgeKeys.size,
992
+ missing_count: missingIds.size
993
+ };
994
+ }
995
+ function buildDepsRelationshipContext(rootId, items, options) {
996
+ const maxDepth = parseMaxDepth(options.maxDepth);
997
+ const nodeLimit = parsePositiveInteger(options.nodeLimit, "node-limit");
998
+ const edgeLimit = parsePositiveInteger(options.edgeLimit, "edge-limit");
999
+ const tokenBudget = parsePositiveInteger(options.tokenBudget, "token-budget");
1000
+ const canonicalIds = new Map(items.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
1001
+ const dangling = collectDanglingDependencyReferences(items);
1002
+ const missingIds = collectMissingDependencyTargetIds(dangling);
1003
+ const graphItems = items.map((item) => {
1004
+ const parent = normalizeDependencyGraphTarget(item.parent);
1005
+ const blocker = normalizeDependencyGraphTarget(item.blocked_by);
1006
+ const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {
1007
+ if (typeof rawDependency !== "object" || rawDependency === null)
1008
+ return [];
1009
+ const dependency = rawDependency;
1010
+ const target = normalizeDependencyGraphTarget(dependency.id);
1011
+ if (!target)
1012
+ return [];
1013
+ return [{
1014
+ id: canonicalIds.get(target.toLowerCase()) ?? target,
1015
+ kind: typeof dependency.kind === "string" ? dependency.kind : "related"
1016
+ }];
1017
+ });
1018
+ return {
1019
+ id: item.id,
1020
+ ...parent ? { parent: canonicalIds.get(parent.toLowerCase()) ?? parent } : {},
1021
+ ...blocker ? { blocked_by: canonicalIds.get(blocker.toLowerCase()) ?? blocker } : {},
1022
+ dependencies
1023
+ };
1024
+ });
1025
+ return buildRelationshipContext(RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))]), rootId, [
1026
+ ...items.map((item) => ({ id: item.id, title: item.title, status: item.status })),
1027
+ ...missingIds.map((id) => ({ id, title: `[missing] ${id}`, status: "missing" }))
1028
+ ], {
1029
+ ...maxDepth === void 0 ? {} : { maxDepth },
1030
+ ...nodeLimit === void 0 ? {} : { nodeLimit },
1031
+ ...edgeLimit === void 0 ? {} : { edgeLimit },
1032
+ ...tokenBudget === void 0 ? {} : { tokenBudget },
1033
+ ...options.cursor?.trim() ? { cursor: options.cursor.trim() } : {}
1034
+ });
1035
+ }
1036
+ async function runDeps(id, options, global2) {
1037
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
1038
+ if (!await pathExists(getSettingsPath(pmRoot))) {
1039
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
1040
+ }
1041
+ const format = parseFormat(options.format);
1042
+ const maxDepth = parseMaxDepth(options.maxDepth);
1043
+ const collapse = parseCollapse(options.collapse);
1044
+ const summaryOnly = options.summary === true;
1045
+ const settings = await readSettings(pmRoot);
1046
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1047
+ const items = await listAllItemMetadataLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
1048
+ const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1049
+ const index = new Map(items.map((item) => [item.id.trim().toLowerCase(), toIndexedItem(item)]));
1050
+ const dangling = collectDanglingDependencyReferences(items, (status) => isTerminalStatus(status, statusRegistry));
1051
+ for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {
1052
+ const holder = index.get(reference.holder_id.trim().toLowerCase());
1053
+ const referenceKind = reference.kind.trim().toLowerCase();
1054
+ if (holder && !holder.dependencies.some((dependency) => dependency.id.trim().toLowerCase() === reference.target_id.trim().toLowerCase() && dependency.kind === referenceKind)) {
1055
+ holder.dependencies.push({ id: reference.target_id, kind: referenceKind });
1056
+ }
1057
+ }
1058
+ if (!index.has(id.trim().toLowerCase())) {
1059
+ throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
1060
+ }
1061
+ if (format === "context") {
1062
+ const canonicalId = index.get(id.trim().toLowerCase()).id;
1063
+ const context = buildDepsRelationshipContext(canonicalId, items, options);
1064
+ return {
1065
+ id: canonicalId,
1066
+ format,
1067
+ node_count: context.nodes.length + 1,
1068
+ edge_count: context.edges.length,
1069
+ missing_count: collectMissingDependencyTargetIds(dangling).length,
1070
+ ...summaryOnly ? {} : { context }
1071
+ };
1072
+ }
1073
+ if (summaryOnly) {
1074
+ return {
1075
+ id,
1076
+ format,
1077
+ ...countDependencyGraph(id, index, maxDepth)
1078
+ };
1079
+ }
1080
+ const tree = toTreeNode(id, index, /* @__PURE__ */ new Set(), maxDepth, collapse, /* @__PURE__ */ new Set());
1081
+ const graph = toGraph(tree);
1082
+ const baseResult = {
1083
+ id,
1084
+ format,
1085
+ node_count: graph.nodes.length,
1086
+ edge_count: graph.edges.length,
1087
+ missing_count: graph.missing_ids.length
1088
+ };
1089
+ if (format === "tree") {
1090
+ return {
1091
+ ...baseResult,
1092
+ tree
1093
+ };
1094
+ }
1095
+ return {
1096
+ ...baseResult,
1097
+ graph
1098
+ };
1099
+ }
1100
+
1101
+ export {
1102
+ RelationshipKindRegistry,
1103
+ createRelationshipKindRegistry,
1104
+ isOrderingRelationshipKind,
1105
+ RelationshipGraph,
1106
+ dependencyToRelationship,
1107
+ buildRelationshipContext,
1108
+ DEPS_FORMAT_VALUES,
1109
+ DEPS_COLLAPSE_VALUES,
1110
+ collectDanglingDependencyReferences,
1111
+ buildDepsRelationshipContext,
1112
+ runDeps
1113
+ };
1114
+ //# sourceMappingURL=chunk-BKVG6XOA.js.map