@unbrained/pm-cli 2026.7.20 → 2026.7.21

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 (421) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +11 -0
  3. package/dist/cli/commander-usage.d.ts +1 -1
  4. package/dist/cli/commander-usage.js +5 -5
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/completion.js +13 -5
  7. package/dist/cli/commands/completion.js.map +1 -1
  8. package/dist/cli/commands/contracts.js +4 -3
  9. package/dist/cli/commands/contracts.js.map +1 -1
  10. package/dist/cli/error-guidance.d.ts +2 -0
  11. package/dist/cli/error-guidance.js +7 -2
  12. package/dist/cli/error-guidance.js.map +1 -1
  13. package/dist/cli/main.d.ts +1 -5
  14. package/dist/cli/main.js +12 -50
  15. package/dist/cli/main.js.map +1 -1
  16. package/dist/cli/register-list-query.js +13 -3
  17. package/dist/cli/register-list-query.js.map +1 -1
  18. package/dist/cli/register-mutation.js +45 -3
  19. package/dist/cli/register-mutation.js.map +1 -1
  20. package/dist/cli/register-structured-mutation.d.ts +14 -0
  21. package/dist/cli/register-structured-mutation.js +62 -0
  22. package/dist/cli/register-structured-mutation.js.map +1 -0
  23. package/dist/cli/registration-helpers.js +5 -3
  24. package/dist/cli/registration-helpers.js.map +1 -1
  25. package/dist/cli-bundle/bundle-manifest.json +280 -296
  26. package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
  27. package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
  28. package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
  29. package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
  30. package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
  31. package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
  32. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
  33. package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
  34. package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
  35. package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
  36. package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
  38. package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
  39. package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
  40. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
  41. package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
  42. package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
  43. package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
  44. package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
  45. package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
  46. package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
  47. package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
  48. package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
  49. package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
  51. package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
  53. package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
  57. package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
  58. package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
  59. package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
  60. package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
  61. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
  62. package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
  65. package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
  67. package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
  69. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
  70. package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
  72. package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
  73. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
  76. package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
  77. package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
  78. package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
  80. package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
  84. package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
  85. package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
  86. package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
  89. package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
  91. package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
  92. package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
  95. package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
  99. package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
  101. package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
  102. package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
  104. package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
  105. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
  106. package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
  109. package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
  110. package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
  113. package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
  115. package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
  116. package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
  117. package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
  119. package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
  121. package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
  127. package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
  130. package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
  132. package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
  135. package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
  136. package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
  138. package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
  140. package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
  142. package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
  143. package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
  144. package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
  145. package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
  146. package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
  147. package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
  148. package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
  149. package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
  150. package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
  151. package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
  152. package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
  153. package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
  154. package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
  155. package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
  156. package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
  157. package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
  158. package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
  159. package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
  160. package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
  161. package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
  162. package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
  163. package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
  164. package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
  165. package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
  166. package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
  167. package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
  168. package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
  169. package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
  170. package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
  171. package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
  173. package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
  174. package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
  175. package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
  177. package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
  179. package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
  180. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
  181. package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
  182. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
  183. package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
  184. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
  185. package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
  186. package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
  187. package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
  188. package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
  189. package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
  190. package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
  191. package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
  192. package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
  193. package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
  194. package/dist/cli-bundle/main.js +60 -85
  195. package/dist/cli-bundle/main.js.map +2 -2
  196. package/dist/cli-bundle/sdk-runtime.js +37 -37
  197. package/dist/cli-bundle/sdk.js +126 -291
  198. package/dist/cli-bundle/sdk.js.map +4 -4
  199. package/dist/core/item/parse.d.ts +1 -1
  200. package/dist/core/item/parse.js +13 -7
  201. package/dist/core/item/parse.js.map +1 -1
  202. package/dist/core/output/mutation-projection.d.ts +2 -0
  203. package/dist/core/output/mutation-projection.js +33 -2
  204. package/dist/core/output/mutation-projection.js.map +1 -1
  205. package/dist/core/output/output.d.ts +4 -0
  206. package/dist/core/output/output.js +18 -13
  207. package/dist/core/output/output.js.map +1 -1
  208. package/dist/core/shared/command-types.d.ts +4 -0
  209. package/dist/core/shared/command-types.js +2 -2
  210. package/dist/core/shared/command-types.js.map +1 -1
  211. package/dist/mcp/server.js +39 -4
  212. package/dist/mcp/server.js.map +1 -1
  213. package/dist/mcp/tool-definitions.js +45 -4
  214. package/dist/mcp/tool-definitions.js.map +1 -1
  215. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  216. package/dist/sdk/cli-bootstrap.js +20 -27
  217. package/dist/sdk/cli-bootstrap.js.map +1 -1
  218. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  219. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  220. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  221. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  222. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  223. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  224. package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
  225. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  226. package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
  227. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  228. package/dist/sdk/cli-contracts/tool-schema.js +6 -2
  229. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  230. package/dist/sdk/cli-contracts.d.ts +1 -1
  231. package/dist/sdk/cli-contracts.js +3 -3
  232. package/dist/sdk/cli-contracts.js.map +1 -1
  233. package/dist/sdk/cli-program.js +4 -2
  234. package/dist/sdk/cli-program.js.map +1 -1
  235. package/dist/sdk/dependencies.d.ts +3 -2
  236. package/dist/sdk/dependencies.js +13 -12
  237. package/dist/sdk/dependencies.js.map +1 -1
  238. package/dist/sdk/error-runtime.d.ts +10 -0
  239. package/dist/sdk/error-runtime.js +59 -0
  240. package/dist/sdk/error-runtime.js.map +1 -0
  241. package/dist/sdk/graph/analytics.d.ts +9 -0
  242. package/dist/sdk/graph/analytics.js +24 -13
  243. package/dist/sdk/graph/analytics.js.map +1 -1
  244. package/dist/sdk/graph/assembly.d.ts +39 -0
  245. package/dist/sdk/graph/assembly.js +92 -12
  246. package/dist/sdk/graph/assembly.js.map +1 -1
  247. package/dist/sdk/graph/cache.d.ts +4 -1
  248. package/dist/sdk/graph/cache.js +17 -4
  249. package/dist/sdk/graph/cache.js.map +1 -1
  250. package/dist/sdk/graph/centrality.d.ts +82 -0
  251. package/dist/sdk/graph/centrality.js +259 -0
  252. package/dist/sdk/graph/centrality.js.map +1 -0
  253. package/dist/sdk/graph/durable-cache.d.ts +71 -0
  254. package/dist/sdk/graph/durable-cache.js +205 -0
  255. package/dist/sdk/graph/durable-cache.js.map +1 -0
  256. package/dist/sdk/graph/governance.d.ts +69 -1
  257. package/dist/sdk/graph/governance.js +143 -35
  258. package/dist/sdk/graph/governance.js.map +1 -1
  259. package/dist/sdk/graph/index.d.ts +7 -4
  260. package/dist/sdk/graph/index.js +8 -5
  261. package/dist/sdk/graph/index.js.map +1 -1
  262. package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
  263. package/dist/sdk/graph/mutation-advisory.js +124 -35
  264. package/dist/sdk/graph/mutation-advisory.js.map +1 -1
  265. package/dist/sdk/graph/remediation.js +12 -2
  266. package/dist/sdk/graph/remediation.js.map +1 -1
  267. package/dist/sdk/graph/run.d.ts +133 -2
  268. package/dist/sdk/graph/run.js +217 -8
  269. package/dist/sdk/graph/run.js.map +1 -1
  270. package/dist/sdk/graph/scheduling.d.ts +59 -0
  271. package/dist/sdk/graph/scheduling.js +125 -0
  272. package/dist/sdk/graph/scheduling.js.map +1 -0
  273. package/dist/sdk/graph/traversal.d.ts +11 -0
  274. package/dist/sdk/graph/traversal.js +16 -2
  275. package/dist/sdk/graph/traversal.js.map +1 -1
  276. package/dist/sdk/index.d.ts +4 -0
  277. package/dist/sdk/index.js +6 -2
  278. package/dist/sdk/index.js.map +1 -1
  279. package/dist/sdk/runtime-input.js +7 -2
  280. package/dist/sdk/runtime-input.js.map +1 -1
  281. package/dist/sdk/runtime-primitives.d.ts +10 -0
  282. package/dist/sdk/runtime-primitives.js +14 -0
  283. package/dist/sdk/runtime-primitives.js.map +1 -0
  284. package/dist/sdk/runtime.d.ts +15 -0
  285. package/dist/sdk/runtime.js +16 -3
  286. package/dist/sdk/runtime.js.map +1 -1
  287. package/dist/sdk/structured-mutations.d.ts +21 -0
  288. package/dist/sdk/structured-mutations.js +375 -0
  289. package/dist/sdk/structured-mutations.js.map +1 -0
  290. package/docs/COMMANDS.md +85 -5
  291. package/docs/RELATIONSHIP_GRAPH.md +48 -7
  292. package/docs/SDK.md +78 -3
  293. package/marketplace.json +2 -2
  294. package/package.json +1 -1
  295. package/packages/pm-beads/package.json +1 -1
  296. package/packages/pm-calendar/package.json +1 -1
  297. package/packages/pm-command-kit/package.json +1 -1
  298. package/packages/pm-governance-audit/package.json +1 -1
  299. package/packages/pm-guide-shell/package.json +1 -1
  300. package/packages/pm-kanban/package.json +1 -1
  301. package/packages/pm-lifecycle-hooks/package.json +1 -1
  302. package/packages/pm-linked-test-adapters/package.json +1 -1
  303. package/packages/pm-search-advanced/package.json +1 -1
  304. package/packages/pm-templates/package.json +1 -1
  305. package/packages/pm-todos/package.json +1 -1
  306. package/packages/pm-vcs/package.json +1 -1
  307. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  308. package/plugins/pm-claude/README.md +5 -3
  309. package/plugins/pm-claude/commands/pm-init.md +1 -1
  310. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  311. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
  312. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
  313. package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
  314. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
  315. package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
  316. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
  317. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
  318. package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
  319. package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
  320. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
  321. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
  322. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
  323. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
  324. package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
  325. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
  326. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
  327. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
  328. package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
  329. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
  331. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
  339. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
  340. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
  342. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
  347. package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
  348. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
  350. package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
  351. package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
  352. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
  353. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
  354. /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
@@ -0,0 +1,991 @@
1
+ // dist/sdk/graph/traversal.js
2
+ !(function() {
3
+ try {
4
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8b7a0e24-8ead-5b79-a83b-6d2bb32f807f");
6
+ } catch (e2) {
7
+ }
8
+ })();
9
+ var DEFAULT_MAX_PATHS = 5;
10
+ var DEFAULT_MAX_VISITED_PATHS = 1e4;
11
+ var DEFAULT_PATH_MAX_DEPTH = 8;
12
+ function assertPathBound(name, value) {
13
+ if (!Number.isFinite(value) || !Number.isInteger(value) || value < 0)
14
+ throw new TypeError(`Invalid path ${name} bound: ${String(value)}`);
15
+ }
16
+ function hierarchyParentEndpoint(edge, definition) {
17
+ return definition.hierarchyDirection === "target_parent" ? edge.target : edge.source;
18
+ }
19
+ function orderingPredecessorEndpoint(edge, definition) {
20
+ return (definition.precedence ?? "source_before_target") === "target_before_source" ? edge.target : edge.source;
21
+ }
22
+ function orientOrderingEdge(edge, definition) {
23
+ const predecessor = orderingPredecessorEndpoint(edge, definition);
24
+ return {
25
+ predecessor,
26
+ successor: predecessor === edge.source ? edge.target : edge.source
27
+ };
28
+ }
29
+ function resolveFamilyKinds(graph, kinds, family) {
30
+ if (kinds === void 0)
31
+ return void 0;
32
+ const registry = graph.registry();
33
+ const resolved = /* @__PURE__ */ new Set();
34
+ for (const kind of kinds) {
35
+ const definition = registry.require(kind);
36
+ if (!definition[family])
37
+ throw new TypeError(`Relationship kind ${definition.kind} is not a ${family} kind`);
38
+ resolved.add(definition.kind);
39
+ }
40
+ return resolved;
41
+ }
42
+ function expandSemanticNeighbors(graph, nodeId, familyKinds, family, matches) {
43
+ const registry = graph.registry();
44
+ const rows = graph.neighborEdges(nodeId, {
45
+ direction: "both",
46
+ ...familyKinds === void 0 ? {} : { kinds: [...familyKinds] }
47
+ });
48
+ const neighbors = [];
49
+ const seen = /* @__PURE__ */ new Set();
50
+ for (const row of rows.value) {
51
+ const definition = registry.require(row.edge.kind);
52
+ if (!definition[family])
53
+ continue;
54
+ if (!matches(row, definition, nodeId))
55
+ continue;
56
+ if (seen.has(row.id))
57
+ continue;
58
+ seen.add(row.id);
59
+ neighbors.push(row.id);
60
+ }
61
+ return { neighbors, inspectedEdges: rows.meta.inspectedEdges };
62
+ }
63
+ function appendSemanticExpansion(expansion, currentDepth, maxDepth, limit, after, state) {
64
+ if (currentDepth >= maxDepth) {
65
+ if (expansion.neighbors.some((neighbor) => !state.seen.has(neighbor)))
66
+ state.truncated = true;
67
+ return false;
68
+ }
69
+ for (const neighbor of expansion.neighbors) {
70
+ if (state.seen.has(neighbor))
71
+ continue;
72
+ state.seen.add(neighbor);
73
+ state.queue.push({ id: neighbor, depth: currentDepth + 1 });
74
+ if (!state.resumed) {
75
+ if (neighbor === after)
76
+ state.resumed = true;
77
+ continue;
78
+ }
79
+ if (state.value.length >= limit) {
80
+ state.truncated = true;
81
+ return true;
82
+ }
83
+ state.value.push(neighbor);
84
+ }
85
+ return false;
86
+ }
87
+ function boundedSemanticWalk(graph, start, options, family, matches) {
88
+ if (!graph.hasNode(start))
89
+ throw new TypeError(`Relationship node not found: ${start}`);
90
+ const familyKinds = resolveFamilyKinds(graph, options.kinds, family);
91
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
92
+ const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
93
+ const after = options.after;
94
+ const state = {
95
+ seen: /* @__PURE__ */ new Set([start]),
96
+ value: [],
97
+ queue: [{ id: start, depth: 0 }],
98
+ resumed: after === void 0,
99
+ truncated: false
100
+ };
101
+ let visitedNodes = 0;
102
+ let inspectedEdges = 0;
103
+ for (let index = 0; index < state.queue.length; index += 1) {
104
+ options.signal?.throwIfAborted();
105
+ const current = state.queue[index];
106
+ visitedNodes += 1;
107
+ const expansion = expandSemanticNeighbors(graph, current.id, familyKinds, family, matches);
108
+ inspectedEdges += expansion.inspectedEdges;
109
+ if (appendSemanticExpansion(expansion, current.depth, maxDepth, limit, after, state))
110
+ break;
111
+ }
112
+ if (!state.resumed)
113
+ throw new TypeError(`Traversal cursor not found in sequence: ${after}`);
114
+ return {
115
+ value: state.value,
116
+ meta: {
117
+ visitedNodes,
118
+ inspectedEdges,
119
+ truncated: state.truncated,
120
+ nextCursor: state.value.at(-1)
121
+ }
122
+ };
123
+ }
124
+ function assertPathEndpoint(graph, id) {
125
+ if (!graph.hasNode(id))
126
+ throw new TypeError(`Relationship node not found: ${id}`);
127
+ }
128
+ function readPathContinuations(graph, partial, options, direction, state) {
129
+ const rows = graph.neighborEdges(partial.nodes.at(-1), {
130
+ direction,
131
+ ...options.kinds === void 0 ? {} : { kinds: options.kinds }
132
+ });
133
+ state.inspectedEdges += rows.meta.inspectedEdges;
134
+ return rows.value.filter((row) => !partial.nodeSet.has(row.id));
135
+ }
136
+ function expandPartialPath(graph, partial, target, options, direction, probeLimit, state) {
137
+ for (const row of readPathContinuations(graph, partial, options, direction, state)) {
138
+ const nodes = [...partial.nodes, row.id];
139
+ const nodeSet = new Set(partial.nodeSet).add(row.id);
140
+ const edges = [...partial.edges, row.edge];
141
+ if (row.id === target) {
142
+ state.value.push({ nodes, edges, length: edges.length });
143
+ if (state.value.length >= probeLimit)
144
+ return true;
145
+ } else {
146
+ state.queue.push({ nodes, nodeSet, edges });
147
+ }
148
+ }
149
+ return false;
150
+ }
151
+ function hierarchyAncestors(graph, id, options = {}) {
152
+ return boundedSemanticWalk(graph, id, options, "hierarchy", (row, definition) => hierarchyParentEndpoint(row.edge, definition) === row.id);
153
+ }
154
+ function hierarchyDescendants(graph, id, options = {}) {
155
+ return boundedSemanticWalk(graph, id, options, "hierarchy", (row, definition, nodeId) => hierarchyParentEndpoint(row.edge, definition) === nodeId);
156
+ }
157
+ function orderingPredecessors(graph, id, options = {}) {
158
+ return boundedSemanticWalk(graph, id, options, "ordering", (row, definition) => orderingPredecessorEndpoint(row.edge, definition) === row.id);
159
+ }
160
+ function orderingSuccessors(graph, id, options = {}) {
161
+ return boundedSemanticWalk(graph, id, options, "ordering", (row, definition, nodeId) => orderingPredecessorEndpoint(row.edge, definition) === nodeId);
162
+ }
163
+ function enumerateNonZeroRelationshipPaths(graph, source, target, options, maxPaths, maxVisitedPaths, maxDepth, direction) {
164
+ const state = {
165
+ value: [],
166
+ queue: [{ nodes: [source], nodeSet: /* @__PURE__ */ new Set([source]), edges: [] }],
167
+ inspectedEdges: 0
168
+ };
169
+ let visitedNodes = 0;
170
+ let truncated = false;
171
+ const probeLimit = maxPaths + 1;
172
+ for (let index = 0; index < state.queue.length; index += 1) {
173
+ options.signal?.throwIfAborted();
174
+ if (state.value.length >= probeLimit || visitedNodes >= maxVisitedPaths) {
175
+ truncated = true;
176
+ break;
177
+ }
178
+ const partial = state.queue[index];
179
+ visitedNodes += 1;
180
+ if (partial.edges.length >= maxDepth) {
181
+ if (readPathContinuations(graph, partial, options, direction, state).length > 0)
182
+ truncated = true;
183
+ continue;
184
+ }
185
+ if (expandPartialPath(graph, partial, target, options, direction, probeLimit, state)) {
186
+ truncated = true;
187
+ break;
188
+ }
189
+ }
190
+ return {
191
+ value: state.value.slice(0, maxPaths),
192
+ meta: { visitedNodes, inspectedEdges: state.inspectedEdges, truncated }
193
+ };
194
+ }
195
+ function enumerateRelationshipPaths(graph, source, target, options = {}) {
196
+ assertPathEndpoint(graph, source);
197
+ assertPathEndpoint(graph, target);
198
+ const maxPaths = options.maxPaths ?? DEFAULT_MAX_PATHS;
199
+ const maxVisitedPaths = options.maxVisitedPaths ?? DEFAULT_MAX_VISITED_PATHS;
200
+ const maxDepth = options.maxDepth ?? DEFAULT_PATH_MAX_DEPTH;
201
+ assertPathBound("maxPaths", maxPaths);
202
+ assertPathBound("maxVisitedPaths", maxVisitedPaths);
203
+ assertPathBound("maxDepth", maxDepth);
204
+ const direction = options.direction ?? "outgoing";
205
+ options.signal?.throwIfAborted();
206
+ for (const kind of options.kinds ?? [])
207
+ graph.registry().require(kind);
208
+ if (source === target) {
209
+ if (maxPaths === 0) {
210
+ return {
211
+ value: [],
212
+ meta: { visitedNodes: 1, inspectedEdges: 0, truncated: true }
213
+ };
214
+ }
215
+ return {
216
+ value: [{ nodes: [source], edges: [], length: 0 }],
217
+ meta: { visitedNodes: 1, inspectedEdges: 0, truncated: false }
218
+ };
219
+ }
220
+ return enumerateNonZeroRelationshipPaths(graph, source, target, options, maxPaths, maxVisitedPaths, maxDepth, direction);
221
+ }
222
+
223
+ // dist/sdk/graph/analytics.js
224
+ !(function() {
225
+ try {
226
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
227
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e7884ad6-98e5-5ed6-93a0-ffba254fe174");
228
+ } catch (e2) {
229
+ }
230
+ })();
231
+ var DEFAULT_MAX_ITERATIONS = 16;
232
+ var DEFAULT_MIN_COMMUNITY_SIZE = 2;
233
+ var DEFAULT_REDUNDANCY_MAX_DEPTH = 8;
234
+ function assertPositiveBound(name, value) {
235
+ if (!Number.isInteger(value) || value < 1)
236
+ throw new TypeError(`Invalid ${name} bound: ${String(value)}`);
237
+ }
238
+ function forEachMatchedRelationshipEdge(graph, kinds, visit) {
239
+ const registry = graph.registry();
240
+ const wanted = kinds === void 0 ? void 0 : new Set(kinds.map((kind) => registry.require(kind).kind));
241
+ for (const edge of graph.edges()) {
242
+ if (edge.source === edge.target)
243
+ continue;
244
+ const definition = registry.require(edge.kind);
245
+ if (wanted !== void 0 && !(wanted.has(definition.kind) || definition.inverse !== void 0 && wanted.has(definition.inverse)))
246
+ continue;
247
+ visit(edge, definition);
248
+ }
249
+ }
250
+ function buildUndirectedAdjacency(graph, kinds) {
251
+ const adjacency = /* @__PURE__ */ new Map();
252
+ forEachMatchedRelationshipEdge(graph, kinds, (edge) => {
253
+ appendAdjacency(adjacency, edge.source, edge.target);
254
+ appendAdjacency(adjacency, edge.target, edge.source);
255
+ });
256
+ for (const neighbors of adjacency.values())
257
+ neighbors.sort();
258
+ return adjacency;
259
+ }
260
+ function appendAdjacency(adjacency, from, to) {
261
+ const neighbors = adjacency.get(from);
262
+ if (neighbors === void 0)
263
+ adjacency.set(from, [to]);
264
+ else
265
+ neighbors.push(to);
266
+ }
267
+ function dominantNeighborLabel(neighbors, labels) {
268
+ const counts = /* @__PURE__ */ new Map();
269
+ for (const neighbor of neighbors) {
270
+ const label = labels.get(neighbor);
271
+ counts.set(label, (counts.get(label) ?? 0) + 1);
272
+ }
273
+ let best;
274
+ let bestCount = 0;
275
+ for (const [label, count] of counts) {
276
+ if (count > bestCount || count === bestCount && label < best) {
277
+ best = label;
278
+ bestCount = count;
279
+ }
280
+ }
281
+ return best;
282
+ }
283
+ function collectCommunities(labels, minSize) {
284
+ const groups = /* @__PURE__ */ new Map();
285
+ for (const [id, label] of labels) {
286
+ const members = groups.get(label);
287
+ if (members === void 0)
288
+ groups.set(label, [id]);
289
+ else
290
+ members.push(id);
291
+ }
292
+ const communities = [];
293
+ for (const members of groups.values()) {
294
+ if (members.length < minSize)
295
+ continue;
296
+ members.sort();
297
+ communities.push({
298
+ representative: members[0],
299
+ size: members.length,
300
+ members
301
+ });
302
+ }
303
+ return communities.sort((left, right) => right.size - left.size || left.representative.localeCompare(right.representative));
304
+ }
305
+ function detectRelationshipCommunities(graph, options = {}) {
306
+ const maxIterations = options.maxIterations ?? DEFAULT_MAX_ITERATIONS;
307
+ const minSize = options.minSize ?? DEFAULT_MIN_COMMUNITY_SIZE;
308
+ assertPositiveBound("maxIterations", maxIterations);
309
+ assertPositiveBound("minSize", minSize);
310
+ const adjacency = buildUndirectedAdjacency(graph, options.kinds);
311
+ const nodes = graph.nodes();
312
+ const labels = new Map(nodes.map((id) => [id, id]));
313
+ let iterations = 0;
314
+ let converged = false;
315
+ let visitedNodes = 0;
316
+ let inspectedEdges = 0;
317
+ while (iterations < maxIterations && !converged) {
318
+ options.signal?.throwIfAborted();
319
+ iterations += 1;
320
+ converged = true;
321
+ for (const id of nodes) {
322
+ visitedNodes += 1;
323
+ const neighbors = adjacency.get(id);
324
+ if (neighbors === void 0)
325
+ continue;
326
+ inspectedEdges += neighbors.length;
327
+ const dominant = dominantNeighborLabel(neighbors, labels);
328
+ if (dominant !== labels.get(id)) {
329
+ labels.set(id, dominant);
330
+ converged = false;
331
+ }
332
+ }
333
+ }
334
+ return {
335
+ value: {
336
+ communities: collectCommunities(labels, minSize),
337
+ iterations,
338
+ converged
339
+ },
340
+ meta: { visitedNodes, inspectedEdges, truncated: !converged }
341
+ };
342
+ }
343
+ function isTransitiveKind(definition) {
344
+ return definition.direction === "directed" && (definition.ordering || definition.hierarchy);
345
+ }
346
+ function transitiveFamilyKey(definition) {
347
+ return definition.inverse !== void 0 && definition.inverse < definition.kind ? definition.inverse : definition.kind;
348
+ }
349
+ function orientTransitiveEdge(edge, definition) {
350
+ const head = definition.hierarchy ? hierarchyParentEndpoint(edge, definition) : edge.source === orderingPredecessorEndpoint(edge, definition) ? edge.target : edge.source;
351
+ return head === edge.target ? { from: edge.source, to: edge.target } : { from: edge.target, to: edge.source };
352
+ }
353
+ function resolveRedundancyFamilies(graph, kinds) {
354
+ if (kinds === void 0)
355
+ return void 0;
356
+ const registry = graph.registry();
357
+ const families = /* @__PURE__ */ new Set();
358
+ for (const kind of kinds) {
359
+ const definition = registry.require(kind);
360
+ if (!isTransitiveKind(definition))
361
+ throw new TypeError(`Relationship kind ${definition.kind} is not a directed ordering or hierarchy kind`);
362
+ families.add(transitiveFamilyKey(definition));
363
+ }
364
+ return families;
365
+ }
366
+ function collectTransitiveFamilies(graph, wanted) {
367
+ const registry = graph.registry();
368
+ const families = /* @__PURE__ */ new Map();
369
+ for (const edge of graph.edges()) {
370
+ const definition = registry.require(edge.kind);
371
+ if (!isTransitiveKind(definition))
372
+ continue;
373
+ const key = transitiveFamilyKey(definition);
374
+ if (wanted !== void 0 && !wanted.has(key))
375
+ continue;
376
+ const oriented = orientTransitiveEdge(edge, definition);
377
+ if (oriented.from === oriented.to)
378
+ continue;
379
+ let family = families.get(key);
380
+ if (family === void 0) {
381
+ family = { adjacency: /* @__PURE__ */ new Map(), records: [] };
382
+ families.set(key, family);
383
+ }
384
+ const targets = family.adjacency.get(oriented.from);
385
+ if (targets === void 0)
386
+ family.adjacency.set(oriented.from, /* @__PURE__ */ new Set([oriented.to]));
387
+ else
388
+ targets.add(oriented.to);
389
+ family.records.push({ ...oriented, edge });
390
+ }
391
+ return families;
392
+ }
393
+ function sortedFamilyAdjacency(family) {
394
+ const sorted = /* @__PURE__ */ new Map();
395
+ for (const [from, targets] of family.adjacency)
396
+ sorted.set(from, [...targets].sort());
397
+ return sorted;
398
+ }
399
+ function reconstructWitness(parents, from, tail, head) {
400
+ const witness = [head];
401
+ for (let node = tail; node !== from; node = parents.get(node))
402
+ witness.push(node);
403
+ witness.push(from);
404
+ return witness.reverse();
405
+ }
406
+ function expandWitnessFrontier(adjacency, record, current, parents, queue, cost) {
407
+ for (const next of adjacency.get(current.id) ?? []) {
408
+ cost.inspectedEdges += 1;
409
+ if (current.depth === 0 && next === record.to)
410
+ continue;
411
+ if (parents.has(next))
412
+ continue;
413
+ parents.set(next, current.id);
414
+ if (next === record.to)
415
+ return reconstructWitness(parents, record.from, current.id, next);
416
+ queue.push({ id: next, depth: current.depth + 1 });
417
+ }
418
+ return void 0;
419
+ }
420
+ function findWitnessPath(adjacency, record, maxDepth, cost) {
421
+ const parents = /* @__PURE__ */ new Map([[record.from, record.from]]);
422
+ const queue = [{ id: record.from, depth: 0 }];
423
+ for (let index = 0; index < queue.length; index += 1) {
424
+ const current = queue[index];
425
+ cost.visitedNodes += 1;
426
+ if (current.depth >= maxDepth)
427
+ continue;
428
+ const witness = expandWitnessFrontier(adjacency, record, current, parents, queue, cost);
429
+ if (witness !== void 0)
430
+ return witness;
431
+ }
432
+ return void 0;
433
+ }
434
+ function findRedundantRelationshipEdges(graph, options = {}) {
435
+ const maxDepth = options.maxDepth ?? DEFAULT_REDUNDANCY_MAX_DEPTH;
436
+ assertPositiveBound("maxDepth", maxDepth);
437
+ if (options.limit !== void 0)
438
+ assertPositiveBound("limit", options.limit);
439
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
440
+ const wanted = resolveRedundancyFamilies(graph, options.kinds);
441
+ const families = collectTransitiveFamilies(graph, wanted);
442
+ const value = [];
443
+ const cost = { visitedNodes: 0, inspectedEdges: 0 };
444
+ let truncated = false;
445
+ scan: for (const key of [...families.keys()].sort()) {
446
+ const family = families.get(key);
447
+ const adjacency = sortedFamilyAdjacency(family);
448
+ for (const record of family.records) {
449
+ options.signal?.throwIfAborted();
450
+ const witness = findWitnessPath(adjacency, record, maxDepth, cost);
451
+ if (witness === void 0)
452
+ continue;
453
+ if (value.length >= limit) {
454
+ truncated = true;
455
+ break scan;
456
+ }
457
+ value.push({ edge: record.edge, witness });
458
+ }
459
+ }
460
+ return {
461
+ value,
462
+ meta: {
463
+ visitedNodes: cost.visitedNodes,
464
+ inspectedEdges: cost.inspectedEdges,
465
+ truncated
466
+ }
467
+ };
468
+ }
469
+ function expandReachableNode(id, depth, rows, maxDepth, state) {
470
+ const nextSet = /* @__PURE__ */ new Set();
471
+ const nexts = [];
472
+ for (const row of rows) {
473
+ if (row.id === id || nextSet.has(row.id))
474
+ continue;
475
+ if (!state.seen.has(row.id)) {
476
+ if (depth >= maxDepth) {
477
+ state.truncated = true;
478
+ continue;
479
+ }
480
+ state.seen.add(row.id);
481
+ state.queue.push({ id: row.id, depth: depth + 1 });
482
+ }
483
+ nextSet.add(row.id);
484
+ nexts.push(row.id);
485
+ let incoming = state.predecessors.get(row.id);
486
+ if (incoming === void 0) {
487
+ incoming = /* @__PURE__ */ new Set();
488
+ state.predecessors.set(row.id, incoming);
489
+ }
490
+ incoming.add(id);
491
+ }
492
+ return nexts;
493
+ }
494
+ function indexReachableSubgraph(graph, root, options) {
495
+ const direction = options.direction ?? "outgoing";
496
+ const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
497
+ const order = [];
498
+ const successors = /* @__PURE__ */ new Map();
499
+ const state = {
500
+ seen: /* @__PURE__ */ new Set([root]),
501
+ queue: [{ id: root, depth: 0 }],
502
+ predecessors: /* @__PURE__ */ new Map(),
503
+ truncated: false
504
+ };
505
+ let inspectedEdges = 0;
506
+ for (let index = 0; index < state.queue.length; index += 1) {
507
+ options.signal?.throwIfAborted();
508
+ const { id, depth } = state.queue[index];
509
+ order.push(id);
510
+ const rows = graph.neighborEdges(id, {
511
+ direction,
512
+ ...options.kinds === void 0 ? {} : { kinds: options.kinds }
513
+ });
514
+ inspectedEdges += rows.meta.inspectedEdges;
515
+ successors.set(id, expandReachableNode(id, depth, rows.value, maxDepth, state));
516
+ }
517
+ return {
518
+ order,
519
+ successors,
520
+ predecessors: state.predecessors,
521
+ inspectedEdges,
522
+ truncated: state.truncated
523
+ };
524
+ }
525
+ function reversePostorder(subgraph, root) {
526
+ const postorder = [];
527
+ const visited = /* @__PURE__ */ new Set([root]);
528
+ const stack = [{ id: root, index: 0 }];
529
+ while (stack.length > 0) {
530
+ const frame = stack.at(-1);
531
+ const nexts = subgraph.successors.get(frame.id);
532
+ if (frame.index < nexts.length) {
533
+ const next = nexts[frame.index];
534
+ frame.index += 1;
535
+ if (!visited.has(next)) {
536
+ visited.add(next);
537
+ stack.push({ id: next, index: 0 });
538
+ }
539
+ } else {
540
+ postorder.push(frame.id);
541
+ stack.pop();
542
+ }
543
+ }
544
+ return postorder.reverse();
545
+ }
546
+ function intersectDominators(left, right, idom, ordinal) {
547
+ let first = left;
548
+ let second = right;
549
+ while (first !== second) {
550
+ while (ordinal.get(first) > ordinal.get(second))
551
+ first = idom.get(first);
552
+ while (ordinal.get(second) > ordinal.get(first))
553
+ second = idom.get(second);
554
+ }
555
+ return first;
556
+ }
557
+ function dominatorCandidate(predecessors, idom, ordinal) {
558
+ let candidate;
559
+ for (const pred of [...predecessors].sort()) {
560
+ if (!idom.has(pred))
561
+ continue;
562
+ candidate = candidate === void 0 ? pred : intersectDominators(candidate, pred, idom, ordinal);
563
+ }
564
+ return candidate;
565
+ }
566
+ function solveImmediateDominators(subgraph, root, order, ordinal, signal) {
567
+ const idom = /* @__PURE__ */ new Map([[root, root]]);
568
+ let changed = true;
569
+ while (changed) {
570
+ changed = false;
571
+ for (const id of order) {
572
+ signal?.throwIfAborted();
573
+ if (id === root)
574
+ continue;
575
+ const candidate = dominatorCandidate(subgraph.predecessors.get(id), idom, ordinal);
576
+ if (candidate !== void 0 && idom.get(id) !== candidate) {
577
+ idom.set(id, candidate);
578
+ changed = true;
579
+ }
580
+ }
581
+ }
582
+ return idom;
583
+ }
584
+ function computeRelationshipDominators(graph, root, options = {}) {
585
+ if (!graph.hasNode(root))
586
+ throw new TypeError(`Relationship node not found: ${root}`);
587
+ if (options.maxDepth !== void 0 && (!Number.isInteger(options.maxDepth) || options.maxDepth < 0))
588
+ throw new TypeError(`Invalid maxDepth bound: ${String(options.maxDepth)}`);
589
+ const subgraph = indexReachableSubgraph(graph, root, options);
590
+ const order = reversePostorder(subgraph, root);
591
+ const ordinal = new Map(order.map((id, index) => [id, index]));
592
+ const idom = solveImmediateDominators(subgraph, root, order, ordinal, options.signal);
593
+ const subtreeSizes = new Map(order.map((id) => [id, 1]));
594
+ for (let index = order.length - 1; index >= 0; index -= 1) {
595
+ const id = order[index];
596
+ if (id === root)
597
+ continue;
598
+ const parent = idom.get(id);
599
+ subtreeSizes.set(parent, subtreeSizes.get(parent) + subtreeSizes.get(id));
600
+ }
601
+ const rows = order.filter((id) => id !== root).map((id) => ({
602
+ id,
603
+ idom: idom.get(id),
604
+ dominatedCount: subtreeSizes.get(id) - 1
605
+ })).sort((left, right) => right.dominatedCount - left.dominatedCount || left.id.localeCompare(right.id));
606
+ return {
607
+ value: { root, reachableCount: subgraph.order.length, rows },
608
+ meta: {
609
+ visitedNodes: subgraph.order.length,
610
+ inspectedEdges: subgraph.inspectedEdges,
611
+ truncated: subgraph.truncated
612
+ }
613
+ };
614
+ }
615
+
616
+ // dist/sdk/graph/governance.js
617
+ !(function() {
618
+ try {
619
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
620
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4b36a9d4-2621-5560-831f-7fd026072cf1");
621
+ } catch (e2) {
622
+ }
623
+ })();
624
+ var DEFAULT_MAX_SAMPLE_SIZE = 25;
625
+ var SEVERITY_RANK = {
626
+ error: 0,
627
+ warning: 1,
628
+ info: 2
629
+ };
630
+ function buildFinding(code, severity, policy, describe, subjects, maxSampleSize, remediation) {
631
+ const sorted = [...subjects].sort((left, right) => left.localeCompare(right));
632
+ return {
633
+ code,
634
+ severity,
635
+ policy,
636
+ message: describe(sorted.length),
637
+ count: sorted.length,
638
+ sample: sorted.slice(0, maxSampleSize),
639
+ sample_truncated: sorted.length > maxSampleSize,
640
+ remediation
641
+ };
642
+ }
643
+ function buildOrderingAdjacency(assembly) {
644
+ const registry = assembly.graph.registry();
645
+ const successors = /* @__PURE__ */ new Map();
646
+ for (const edge of assembly.graph.edges()) {
647
+ const definition = registry.require(edge.kind);
648
+ if (!definition.ordering)
649
+ continue;
650
+ const [predecessor, successor] = (definition.precedence ?? "source_before_target") === "target_before_source" ? [edge.target, edge.source] : [edge.source, edge.target];
651
+ const adjacent = successors.get(predecessor);
652
+ if (adjacent)
653
+ adjacent.push(successor);
654
+ else
655
+ successors.set(predecessor, [successor]);
656
+ }
657
+ for (const adjacent of successors.values())
658
+ adjacent.sort((left, right) => left.localeCompare(right));
659
+ return successors;
660
+ }
661
+ function registerTarjanNode(node, state) {
662
+ state.indexes.set(node, state.nextIndex);
663
+ state.lowLinks.set(node, state.nextIndex);
664
+ state.nextIndex += 1;
665
+ state.stack.push(node);
666
+ state.onStack.add(node);
667
+ }
668
+ function visitNextTarjanNeighbor(frame, frames, successors, state) {
669
+ const neighbors = successors.get(frame.node) ?? [];
670
+ if (frame.neighborIndex >= neighbors.length)
671
+ return false;
672
+ const neighbor = neighbors[frame.neighborIndex];
673
+ frame.neighborIndex += 1;
674
+ if (!state.indexes.has(neighbor)) {
675
+ registerTarjanNode(neighbor, state);
676
+ frames.push({ node: neighbor, neighborIndex: 0 });
677
+ } else if (state.onStack.has(neighbor)) {
678
+ state.lowLinks.set(frame.node, Math.min(state.lowLinks.get(frame.node), state.indexes.get(neighbor)));
679
+ }
680
+ return true;
681
+ }
682
+ function completeTarjanFrame(frame, frames, successors, state) {
683
+ frames.pop();
684
+ const parent = frames.at(-1);
685
+ if (parent)
686
+ state.lowLinks.set(parent.node, Math.min(state.lowLinks.get(parent.node), state.lowLinks.get(frame.node)));
687
+ if (state.lowLinks.get(frame.node) !== state.indexes.get(frame.node))
688
+ return;
689
+ const component = [];
690
+ while (true) {
691
+ const member = state.stack.pop();
692
+ state.onStack.delete(member);
693
+ component.push(member);
694
+ if (member === frame.node)
695
+ break;
696
+ }
697
+ if (component.length > 1 || component.length === 1 && successors.get(component[0])?.includes(component[0]))
698
+ state.components.push(component.sort((left, right) => left.localeCompare(right)));
699
+ }
700
+ function collectOrderingCycles(successors) {
701
+ const state = {
702
+ indexes: /* @__PURE__ */ new Map(),
703
+ lowLinks: /* @__PURE__ */ new Map(),
704
+ onStack: /* @__PURE__ */ new Set(),
705
+ stack: [],
706
+ components: [],
707
+ nextIndex: 0
708
+ };
709
+ const roots = [...successors.keys()].sort((left, right) => left.localeCompare(right));
710
+ for (const root of roots) {
711
+ if (state.indexes.has(root))
712
+ continue;
713
+ const frames = [{ node: root, neighborIndex: 0 }];
714
+ registerTarjanNode(root, state);
715
+ while (frames.length > 0) {
716
+ const frame = frames.at(-1);
717
+ if (visitNextTarjanNeighbor(frame, frames, successors, state))
718
+ continue;
719
+ completeTarjanFrame(frame, frames, successors, state);
720
+ }
721
+ }
722
+ return state.components.sort((left, right) => left[0].localeCompare(right[0]));
723
+ }
724
+ function formatDanglingReference(reference) {
725
+ return `${reference.holder_id} -> ${reference.target_id} (${reference.kind})`;
726
+ }
727
+ function appendFinding(findings, subjects, maxSampleSize, code, severity, policy, describe, remediation) {
728
+ if (subjects.length === 0)
729
+ return;
730
+ findings.push(buildFinding(code, severity, policy, describe, subjects, maxSampleSize, remediation));
731
+ }
732
+ function collectIntegrityFindings(assembly, isTerminal, maxSampleSize) {
733
+ const findings = [];
734
+ const references = [
735
+ ...assembly.dangling.active,
736
+ ...assembly.dangling.legacy_terminal
737
+ ].filter((reference) => !reference.no_active_blocker_sentinel);
738
+ appendFinding(findings, references.filter((reference) => !isTerminal(reference.holder_status)).map(formatDanglingReference), maxSampleSize, "missing_reference_active", "error", "Active items must not reference absent targets; missing prerequisites distort scheduling.", (count) => `${count} active dangling reference(s) to absent items`, "Restore or re-create the referenced item, or remove/retype the reference on the holder.");
739
+ appendFinding(findings, references.filter((reference) => isTerminal(reference.holder_status)).map(formatDanglingReference), maxSampleSize, "missing_reference_terminal", "info", "Terminal items may retain historical references, but absent targets remain unexplainable context.", (count) => `${count} terminal dangling reference(s) to absent items`, "Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.");
740
+ appendFinding(findings, assembly.dangling.no_active_blocker_sentinels.map(formatDanglingReference), maxSampleSize, "legacy_no_blocker_sentinel", "info", "The pre-structured-dependency no-active-blocker sentinel is retired; real edges carry blocker state.", (count) => `${count} legacy no-active-blocker sentinel reference(s)`, "Delete the sentinel reference; blocker state is derived from blocked_by edges.");
741
+ return findings;
742
+ }
743
+ function isActiveAuditMember(member, nodeStates) {
744
+ const state = nodeStates.get(member);
745
+ if (!state)
746
+ return true;
747
+ return !state.terminal;
748
+ }
749
+ function collectOrderingFindings(assembly, nodeStates, isBlocked, maxSampleSize) {
750
+ const findings = [];
751
+ const orderingAdjacency = buildOrderingAdjacency(assembly);
752
+ for (const cycle of collectOrderingCycles(orderingAdjacency)) {
753
+ const active = cycle.some((member) => isActiveAuditMember(member, nodeStates));
754
+ findings.push(active ? buildFinding("ordering_cycle", "error", "Order-bearing relationship kinds must stay acyclic; a cycle makes every member unschedulable.", (count) => `execution-order cycle across ${count} item(s)`, cycle, maxSampleSize, "Remove or retype one ordering edge inside the cycle, or split the work so precedence is linear.") : buildFinding("legacy_ordering_cycle", "info", "Ordering cycles between exclusively terminal items are historical contradictions with no scheduling effect.", (count) => `terminal-only execution-order cycle across ${count} item(s)`, cycle, maxSampleSize, "Leave as history debt, or clean up in a dedicated changelog-safe closed-item batch; never repair closed items ad hoc."));
755
+ }
756
+ const predecessorsByNode = /* @__PURE__ */ new Map();
757
+ for (const [predecessor, adjacent] of orderingAdjacency)
758
+ for (const successor of adjacent) {
759
+ const predecessors = predecessorsByNode.get(successor);
760
+ if (predecessors)
761
+ predecessors.push(predecessor);
762
+ else
763
+ predecessorsByNode.set(successor, [predecessor]);
764
+ }
765
+ const staleLifecycleBlocks = [...nodeStates.values()].filter((state) => !state.missing && !state.terminal && isBlocked(state.status) && !(predecessorsByNode.get(state.id) ?? []).some((predecessor) => {
766
+ const predecessorState = nodeStates.get(predecessor);
767
+ return predecessorState === void 0 || !predecessorState.terminal;
768
+ })).map((state) => state.id);
769
+ appendFinding(findings, staleLifecycleBlocks, maxSampleSize, "stale_lifecycle_block", "warning", "A blocked lifecycle status must be backed by at least one open ordering predecessor.", (count) => `${count} status-blocked item(s) with no open blocker edge`, "Re-open the missing prerequisite as an edge, or move the item back to an active status.");
770
+ return findings;
771
+ }
772
+ function formatDuplicateEdgeGroup(group) {
773
+ const kinds = group.edges.map((edge) => edge.kind).sort((left, right) => left.localeCompare(right));
774
+ return `${group.from} -> ${group.to} (${kinds.join(" + ")})`;
775
+ }
776
+ function collectDuplicateRelationshipEdgeGroups(assembly) {
777
+ const registry = assembly.graph.registry();
778
+ const groups = /* @__PURE__ */ new Map();
779
+ for (const edge of assembly.graph.edges()) {
780
+ const definition = registry.require(edge.kind);
781
+ if (!isTransitiveKind(definition))
782
+ continue;
783
+ const oriented = orientTransitiveEdge(edge, definition);
784
+ if (oriented.from === oriented.to)
785
+ continue;
786
+ const key = `${transitiveFamilyKey(definition)}::${oriented.from}::${oriented.to}`;
787
+ const group = groups.get(key);
788
+ if (group)
789
+ group.edges.push(edge);
790
+ else
791
+ groups.set(key, { ...oriented, edges: [edge] });
792
+ }
793
+ const duplicated = [...groups.values()].filter((group) => group.edges.length >= 2);
794
+ for (const group of duplicated)
795
+ group.edges.sort((left, right) => left.kind.localeCompare(right.kind));
796
+ return duplicated.sort((left, right) => left.from.localeCompare(right.from) || left.to.localeCompare(right.to));
797
+ }
798
+ function collectDuplicateEdgeFindings(assembly, nodeStates, maxSampleSize) {
799
+ const active = [];
800
+ const legacy = [];
801
+ for (const group of collectDuplicateRelationshipEdgeGroups(assembly)) {
802
+ const subjects = isActiveAuditMember(group.from, nodeStates) || isActiveAuditMember(group.to, nodeStates) ? active : legacy;
803
+ subjects.push(formatDuplicateEdgeGroup(group));
804
+ }
805
+ const findings = [];
806
+ appendFinding(findings, active, maxSampleSize, "duplicate_edge", "info", "One semantic relationship should be stored once; parallel same-family spellings (reciprocal inverse pairs included) add no information and skew degree metrics.", (count) => `${count} duplicated relationship(s) between active endpoints`, "Remove all but one stored spelling of the relationship; keep the canonical direction the holder declared first.");
807
+ appendFinding(findings, legacy, maxSampleSize, "legacy_duplicate_edge", "info", "Duplicated spellings between exclusively terminal items are historical noise with no scheduling effect.", (count) => `${count} duplicated relationship(s) between terminal endpoints`, "Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.");
808
+ return findings;
809
+ }
810
+ function collectDuplicateRowFindings(assembly, maxSampleSize) {
811
+ const active = [];
812
+ const legacy = [];
813
+ for (const row of assembly.duplicateRows ?? []) {
814
+ (row.legacy_terminal ? legacy : active).push(`${row.holder_id} -> ${row.target_id} (${row.kind} x${row.occurrences})`);
815
+ }
816
+ const findings = [];
817
+ appendFinding(findings, active, maxSampleSize, "duplicate_dependency_row", "warning", "One dependency row must be stored once per holder; identical repeated rows are a storage-layer defect invisible to the assembled graph.", (count) => `${count} exactly duplicated stored dependency row(s) on active holder(s)`, "Remove the repeated rows so the dependency is stored exactly once; graph semantics are unchanged.");
818
+ appendFinding(findings, legacy, maxSampleSize, "legacy_duplicate_dependency_row", "info", "Identical repeated dependency rows on terminal holders are historical storage noise with no scheduling effect.", (count) => `${count} exactly duplicated stored dependency row(s) on terminal holder(s)`, "Leave as history debt or clean up in a dedicated changelog-safe closed-item batch.");
819
+ return findings;
820
+ }
821
+ function tallyActiveCoverageNode(tallies, state, degree, exemptIsolates, isolateExemptTypes) {
822
+ tallies.active += 1;
823
+ const typeKey = state.type ?? "(untyped)";
824
+ let typeProfile = tallies.byType.get(typeKey);
825
+ if (!typeProfile) {
826
+ typeProfile = { active: 0, isolated: 0, degree_leq_one: 0 };
827
+ tallies.byType.set(typeKey, typeProfile);
828
+ }
829
+ typeProfile.active += 1;
830
+ if (degree > 1)
831
+ return;
832
+ tallies.degreeLeqOne += 1;
833
+ typeProfile.degree_leq_one += 1;
834
+ if (degree === 0) {
835
+ tallies.isolated += 1;
836
+ typeProfile.isolated += 1;
837
+ }
838
+ if (exemptIsolates.has(state.id.toLowerCase()) || isolateExemptTypes.has(typeKey.toLowerCase()))
839
+ return;
840
+ if (degree === 0)
841
+ tallies.isolates.push(state.id);
842
+ else
843
+ tallies.sparse.push(state.id);
844
+ }
845
+ function collectCoverageReport(assembly, nodeStates, exemptIsolates, isolateExemptTypes, maxSampleSize, edgesByKind) {
846
+ const tallies = {
847
+ active: 0,
848
+ missing: 0,
849
+ isolated: 0,
850
+ degreeLeqOne: 0,
851
+ isolates: [],
852
+ sparse: [],
853
+ byType: /* @__PURE__ */ new Map()
854
+ };
855
+ for (const id of assembly.graph.nodes()) {
856
+ const state = nodeStates.get(id);
857
+ if (!state)
858
+ continue;
859
+ if (state.missing) {
860
+ tallies.missing += 1;
861
+ continue;
862
+ }
863
+ if (state.terminal)
864
+ continue;
865
+ tallyActiveCoverageNode(tallies, state, assembly.graph.incidentEdges(id).length, exemptIsolates, isolateExemptTypes);
866
+ }
867
+ const { isolates, sparse } = tallies;
868
+ const findings = [];
869
+ appendFinding(findings, isolates, maxSampleSize, "isolated_active_node", "warning", "Active work should be reachable from the graph unless explicitly declared a valid isolate.", (count) => `${count} active item(s) with no relationships`, "Link the item to its parent, prerequisite, or origin \u2014 or register it as an exempt isolate.");
870
+ appendFinding(findings, sparse, maxSampleSize, "sparse_active_node", "info", "Active items with a single edge often miss an honest semantic partner; sparse is not automatically defective.", (count) => `${count} active item(s) with exactly one relationship`, "Investigate for an honest second edge (story->task, defect family, cross-epic complement); do not fabricate one.");
871
+ return {
872
+ findings,
873
+ profile: {
874
+ nodes: assembly.graph.nodes().length,
875
+ edges: assembly.graph.edges().length,
876
+ edges_by_kind: Object.fromEntries(Object.entries(edgesByKind).sort(([left], [right]) => left.localeCompare(right))),
877
+ active_nodes: tallies.active,
878
+ missing_nodes: tallies.missing,
879
+ isolated_active_nodes: tallies.isolated,
880
+ degree_leq_one_active_nodes: tallies.degreeLeqOne,
881
+ coverage_by_type: Object.fromEntries([...tallies.byType.entries()].sort(([left], [right]) => left < right ? -1 : 1))
882
+ }
883
+ };
884
+ }
885
+ function auditWorkspaceRelationshipGraph(assembly, options = {}) {
886
+ const isTerminal = options.isTerminal ?? ((status) => status === "closed" || status === "canceled");
887
+ const isBlocked = options.isBlocked ?? ((status) => status === "blocked");
888
+ const maxSampleSize = options.maxSampleSize ?? DEFAULT_MAX_SAMPLE_SIZE;
889
+ if (!Number.isInteger(maxSampleSize) || maxSampleSize < 1)
890
+ throw new TypeError(`Invalid audit sample bound: ${String(options.maxSampleSize)}`);
891
+ const exemptIsolates = new Set((options.exemptIsolates ?? []).filter((id) => typeof id === "string").map((id) => id.trim().toLowerCase()));
892
+ const isolateExemptTypes = new Set((options.isolateExemptTypes ?? []).filter((type) => typeof type === "string").map((type) => type.trim().toLowerCase()));
893
+ const nodeStates = new Map(assembly.details.map((detail) => [
894
+ detail.id,
895
+ {
896
+ id: detail.id,
897
+ status: detail.status,
898
+ missing: assembly.missingIdSet.has(detail.id.toLowerCase()),
899
+ terminal: isTerminal(detail.status),
900
+ ...detail.type === void 0 ? {} : { type: detail.type }
901
+ }
902
+ ]));
903
+ options.signal?.throwIfAborted();
904
+ const edgesByKind = {};
905
+ for (const edge of assembly.graph.edges())
906
+ edgesByKind[edge.kind] = (edgesByKind[edge.kind] ?? 0) + 1;
907
+ const findings = collectIntegrityFindings(assembly, isTerminal, maxSampleSize);
908
+ options.signal?.throwIfAborted();
909
+ findings.push(...collectOrderingFindings(assembly, nodeStates, isBlocked, maxSampleSize));
910
+ options.signal?.throwIfAborted();
911
+ findings.push(...collectDuplicateEdgeFindings(assembly, nodeStates, maxSampleSize), ...collectDuplicateRowFindings(assembly, maxSampleSize));
912
+ options.signal?.throwIfAborted();
913
+ const coverage = collectCoverageReport(assembly, nodeStates, exemptIsolates, isolateExemptTypes, maxSampleSize, edgesByKind);
914
+ findings.push(...coverage.findings);
915
+ findings.sort((left, right) => SEVERITY_RANK[left.severity] - SEVERITY_RANK[right.severity] || left.code.localeCompare(right.code) || left.sample[0].localeCompare(right.sample[0]));
916
+ return {
917
+ findings,
918
+ profile: coverage.profile
919
+ };
920
+ }
921
+ function diffCountRecords(baseline, current) {
922
+ const keys = [
923
+ .../* @__PURE__ */ new Set([...Object.keys(baseline), ...Object.keys(current)])
924
+ ].sort();
925
+ const deltas = {};
926
+ for (const key of keys) {
927
+ const delta = (current[key] ?? 0) - (baseline[key] ?? 0);
928
+ if (delta !== 0)
929
+ deltas[key] = delta;
930
+ }
931
+ return deltas;
932
+ }
933
+ function readSnapshotCoverageByType(snapshot) {
934
+ return snapshot.profile.coverage_by_type ?? {};
935
+ }
936
+ function diffRelationshipAuditSnapshots(baseline, current) {
937
+ const coverageByType = {};
938
+ const baselineCoverageByType = readSnapshotCoverageByType(baseline);
939
+ const currentCoverageByType = readSnapshotCoverageByType(current);
940
+ const typeKeys = [
941
+ .../* @__PURE__ */ new Set([
942
+ ...Object.keys(baselineCoverageByType),
943
+ ...Object.keys(currentCoverageByType)
944
+ ])
945
+ ].sort();
946
+ for (const type of typeKeys) {
947
+ const before = baselineCoverageByType[type];
948
+ const after = currentCoverageByType[type];
949
+ const delta = {
950
+ active: (after?.active ?? 0) - (before?.active ?? 0),
951
+ isolated: (after?.isolated ?? 0) - (before?.isolated ?? 0),
952
+ degree_leq_one: (after?.degree_leq_one ?? 0) - (before?.degree_leq_one ?? 0)
953
+ };
954
+ if (Object.values(delta).some((value) => value !== 0))
955
+ coverageByType[type] = delta;
956
+ }
957
+ return {
958
+ baseline_saved_at: baseline.saved_at,
959
+ same_snapshot: baseline.fingerprint === current.fingerprint,
960
+ affected_subjects_by_code: diffCountRecords(baseline.affected_subjects_by_code, current.affected_subjects_by_code),
961
+ profile: {
962
+ nodes: current.profile.nodes - baseline.profile.nodes,
963
+ edges: current.profile.edges - baseline.profile.edges,
964
+ active_nodes: current.profile.active_nodes - baseline.profile.active_nodes,
965
+ missing_nodes: current.profile.missing_nodes - baseline.profile.missing_nodes,
966
+ isolated_active_nodes: current.profile.isolated_active_nodes - baseline.profile.isolated_active_nodes,
967
+ degree_leq_one_active_nodes: current.profile.degree_leq_one_active_nodes - baseline.profile.degree_leq_one_active_nodes,
968
+ edges_by_kind: diffCountRecords(baseline.profile.edges_by_kind, current.profile.edges_by_kind),
969
+ coverage_by_type: coverageByType
970
+ }
971
+ };
972
+ }
973
+
974
+ export {
975
+ orientOrderingEdge,
976
+ hierarchyAncestors,
977
+ hierarchyDescendants,
978
+ orderingPredecessors,
979
+ orderingSuccessors,
980
+ enumerateRelationshipPaths,
981
+ forEachMatchedRelationshipEdge,
982
+ detectRelationshipCommunities,
983
+ findRedundantRelationshipEdges,
984
+ computeRelationshipDominators,
985
+ collectOrderingCycles,
986
+ formatDuplicateEdgeGroup,
987
+ collectDuplicateRelationshipEdgeGroups,
988
+ auditWorkspaceRelationshipGraph,
989
+ diffRelationshipAuditSnapshots
990
+ };
991
+ //# sourceMappingURL=chunk-PWDEHT3L.js.map