@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
@@ -7,7 +7,7 @@ import {
7
7
  !(function() {
8
8
  try {
9
9
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
10
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "bef9b240-c34d-5d8b-a08f-e0fb77fceef5");
10
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9aa996e2-ed73-50ce-9e1b-6ab181513082");
11
11
  } catch (e2) {
12
12
  }
13
13
  })();
@@ -39,8 +39,8 @@ function parseTags(raw) {
39
39
  if (trimmed === "") {
40
40
  return [];
41
41
  }
42
- const source = coerceJsonTagArray(trimmed) ?? trimmed;
43
- const tags = source.split(",").map((tag) => tag.trim()).filter(Boolean).map((tag) => tag.toLowerCase());
42
+ const source = coerceJsonTagArray(trimmed) ?? trimmed.split(",");
43
+ const tags = source.map((tag) => tag.trim()).filter(Boolean).map((tag) => tag.toLowerCase());
44
44
  return Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));
45
45
  }
46
46
  function collectTagFlagValues(values) {
@@ -136,7 +136,7 @@ function coerceJsonTagArray(trimmed) {
136
136
  return null;
137
137
  }
138
138
  const parsedArray = parsed;
139
- return parsedArray.map((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean" ? String(entry).replace(/,/g, " ") : "").filter((entry) => entry.length > 0).join(",");
139
+ return parsedArray.map((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean" ? String(entry) : "").filter((entry) => entry.length > 0);
140
140
  }
141
141
  function normalizeLineEndings(value) {
142
142
  return value.replace(/\r\n/g, "\n");
@@ -191,6 +191,12 @@ function splitCsvSegments(raw) {
191
191
  function unquoteValue(value) {
192
192
  const trimmed = value.trim();
193
193
  if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
194
+ try {
195
+ const parsed = JSON.parse(trimmed);
196
+ if (typeof parsed === "string")
197
+ return parsed;
198
+ } catch {
199
+ }
194
200
  return trimmed.slice(1, -1).replace(/\\"/g, '"');
195
201
  }
196
202
  return value;
@@ -406,4 +412,4 @@ export {
406
412
  parseOptionalNumber,
407
413
  parseOptionalNonNegativeInteger
408
414
  };
409
- //# sourceMappingURL=chunk-GVT754PX.js.map
415
+ //# sourceMappingURL=chunk-YCIUJJOD.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../core/item/parse.ts"],
4
+ "sourcesContent": ["/**\n * @module core/item/parse\n *\n * Defines item parsing, formatting, and lifecycle helpers for Parse.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\nconst STDIN_TOKEN = \"-\";\nconst CONTINUABLE_VALUE_KEYS = new Set([\n \"actual_result\",\n \"body\",\n \"cmd\",\n \"command\",\n \"customer_impact\",\n \"description\",\n \"environment\",\n \"expected_result\",\n \"impact\",\n \"location\",\n \"message\",\n \"note\",\n \"outcome\",\n \"repro_steps\",\n \"resolution\",\n \"text\",\n \"title\",\n \"unblock_note\",\n \"value\",\n \"why_now\",\n]);\n\n/** Implements parse tags for the public runtime surface of this module. */\nexport function parseTags(raw: string): string[] {\n const trimmed = raw.trim();\n if (trimmed === \"\") {\n return [];\n }\n const source = coerceJsonTagArray(trimmed) ?? trimmed.split(\",\");\n const tags = source\n .map((tag) => tag.trim())\n .filter(Boolean)\n .map((tag) => tag.toLowerCase());\n return Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Merge repeated `--add-tags` / `--remove-tags` values into a single normalized tag list. Each entry can itself be CSV or a JSON array, mirroring the format accepted by `--tags`. Returns a deterministically sorted, deduped list. */\nexport function collectTagFlagValues(\n values: readonly string[] | undefined,\n): string[] {\n if (!Array.isArray(values) || values.length === 0) {\n return [];\n }\n const collected: string[] = [];\n for (const raw of values) {\n if (typeof raw !== \"string\") {\n continue;\n }\n for (const tag of parseTags(raw)) {\n collected.push(tag);\n }\n }\n return Array.from(new Set(collected)).sort((a, b) => a.localeCompare(b));\n}\n\n/** Normalize a base tag list to the canonical form pm stores: trimmed, lowercased, non-empty. Existing item-metadata tags are almost always already canonical (parseTags lowercases on write), but legacy or hand-edited `.toon` files can carry mixed-case entries — normalizing here keeps additive and subtractive mutations case-insensitive (so `--add-tags beta` dedupes against an existing `Beta`, and `--remove-tags alpha` removes an existing `Alpha`). */\nfunction normalizeBaseTags(baseTags: readonly string[]): string[] {\n // Defensive: item-metadata parsed from corrupted/hand-edited `.toon` (or an\n // external SDK caller) could pass a non-array or non-string entries despite\n // the `string[]` type — guard the array and skip non-strings rather than\n // throwing on `.filter`/`.trim()`.\n if (!Array.isArray(baseTags)) {\n return [];\n }\n return baseTags\n .filter((tag): tag is string => typeof tag === \"string\")\n .map((tag) => tag.trim().toLowerCase())\n .filter(Boolean);\n}\n\n/** Split a stored `acceptance_criteria` value into its individual criteria. Criteria are stored as one string joined with `\"; \"` (repeated `--ac` values accumulate that way), so the semicolon is the criterion boundary and cannot appear inside one criterion; entries are trimmed and blanks dropped. Non-string/absent values yield an empty list. */\nexport function splitAcceptanceCriteria(value: unknown): string[] {\n if (typeof value !== \"string\") {\n return [];\n }\n return value\n .split(\";\")\n .map((criterion) => criterion.trim())\n .filter(Boolean);\n}\n\n/** Apply additive/subtractive acceptance-criteria mutations to a base criteria list. Used by `pm update --add-ac/--remove-ac` so individual semicolon-free criteria can be edited without replacing the whole `acceptance_criteria` value (tag-API parity; disjoint additions merge cleanly across branches). Additions append in argv order and dedupe on exact trimmed text; removals match exact trimmed text and report unmatched selectors so a typo never becomes a silent no-op. */\nexport function applyAcceptanceCriteriaMutations(\n baseCriteria: readonly string[],\n add: readonly string[] | undefined,\n remove: readonly string[] | undefined,\n): { criteria: string[]; unmatchedRemovals: string[] } {\n const criteria = baseCriteria\n .map((criterion) => criterion.trim())\n .filter(Boolean);\n for (const raw of add ?? []) {\n const criterion = raw.trim();\n if (criterion.includes(\";\")) {\n throw new PmCliError(\n 'Acceptance criteria added with --add-ac cannot contain \";\" because semicolons delimit stored criteria',\n EXIT_CODE.USAGE,\n {\n code: \"acceptance_criteria_semicolon_forbidden\",\n required: \"Pass one semicolon-free criterion per --add-ac value\",\n why: \"A semicolon inside one criterion would be re-read as multiple criteria\",\n nextSteps: [\n \"Split the text into repeated --add-ac values, or replace the semicolon with punctuation that is not the storage delimiter\",\n ],\n },\n );\n }\n if (criterion.length > 0 && !criteria.includes(criterion)) {\n criteria.push(criterion);\n }\n }\n const unmatchedRemovals: string[] = [];\n let remaining = criteria;\n for (const raw of remove ?? []) {\n const criterion = raw.trim();\n if (criterion.length === 0) {\n continue;\n }\n if (!remaining.includes(criterion)) {\n unmatchedRemovals.push(criterion);\n continue;\n }\n remaining = remaining.filter((entry) => entry !== criterion);\n }\n return { criteria: remaining, unmatchedRemovals };\n}\n\n/** Apply an additive tag mutation to a base tag list. Used by `pm create` and `pm update` so `--add-tags` extends `--tags` (or the existing tags) without replacing them. Output is sorted + deduped lowercase, matching `parseTags`. */\nexport function mergeAdditiveTags(\n baseTags: readonly string[],\n add: readonly string[] | undefined,\n): string[] {\n const normalizedBase = normalizeBaseTags(baseTags);\n if (!add || add.length === 0) {\n return Array.from(new Set(normalizedBase)).sort((a, b) =>\n a.localeCompare(b),\n );\n }\n const merged = new Set<string>(normalizedBase);\n for (const tag of collectTagFlagValues(add)) {\n merged.add(tag);\n }\n return Array.from(merged).sort((a, b) => a.localeCompare(b));\n}\n\n/** Apply a subtractive tag mutation to a base tag list. Used by `pm update` so `--remove-tags x,y` prunes those entries without rewriting the full set. Removal is case-insensitive: both the base list and the removal selectors are normalized to canonical lowercase before matching. */\nexport function applyTagRemovals(\n baseTags: readonly string[],\n remove: readonly string[] | undefined,\n): string[] {\n const normalizedBase = Array.from(new Set(normalizeBaseTags(baseTags))).sort(\n (a, b) => a.localeCompare(b),\n );\n if (!remove || remove.length === 0) {\n return normalizedBase;\n }\n const removeSet = new Set(collectTagFlagValues(remove));\n if (removeSet.size === 0) {\n return normalizedBase;\n }\n return normalizedBase.filter((tag) => !removeSet.has(tag));\n}\n\n// Agents and MCP callers frequently pass --tags as a JSON array (e.g.\n// `--tags '[\"a\",\"b\"]'`). The MCP server normalizes that upstream, but direct\n// CLI invocations used to write the raw bracket string into item metadata,\n// silently corrupting tags. Accept JSON arrays of primitives transparently.\nfunction coerceJsonTagArray(trimmed: string): string[] | null {\n if (!trimmed.startsWith(\"[\")) {\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return null;\n }\n const parsedArray = parsed as unknown[];\n return parsedArray\n .map((entry) =>\n typeof entry === \"string\" ||\n typeof entry === \"number\" ||\n typeof entry === \"boolean\"\n ? String(entry)\n : \"\",\n )\n .filter((entry) => entry.length > 0);\n}\n\nfunction normalizeLineEndings(value: string): string {\n return value.replace(/\\r\\n/g, \"\\n\");\n}\n\nfunction stripCodeFenceEnvelope(value: string): string {\n const normalized = normalizeLineEndings(value).trim();\n if (!normalized.startsWith(\"```\")) {\n return value;\n }\n const lines = normalized.split(\"\\n\");\n if (lines.length < 2) {\n return value;\n }\n if (lines.at(-1)?.trim() !== \"```\") {\n return value;\n }\n return lines.slice(1, -1).join(\"\\n\");\n}\n\nfunction splitCsvSegments(raw: string): string[] {\n const segments: string[] = [];\n let current = \"\";\n let inQuotes = false;\n let escaped = false;\n\n for (const char of raw) {\n if (escaped) {\n current += char;\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n current += char;\n escaped = true;\n continue;\n }\n if (char === '\"') {\n inQuotes = !inQuotes;\n current += char;\n continue;\n }\n if (char === \",\" && !inQuotes) {\n segments.push(current.trim());\n current = \"\";\n continue;\n }\n current += char;\n }\n if (current.trim()) {\n segments.push(current.trim());\n }\n return segments;\n}\n\nfunction unquoteValue(value: string): string {\n const trimmed = value.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) {\n try {\n const parsed = JSON.parse(trimmed) as unknown;\n if (typeof parsed === \"string\") return parsed;\n } catch {\n // Preserve the legacy permissive quoted-value parser for non-JSON input.\n }\n return trimmed.slice(1, -1).replace(/\\\\\"/g, '\"');\n }\n return value;\n}\n\nfunction findKeyValueDelimiter(segment: string): number {\n const equalsIndex = segment.indexOf(\"=\");\n const colonIndex = segment.indexOf(\":\");\n const hasEquals = equalsIndex > 0;\n const hasColon = colonIndex > 0;\n if (hasEquals && hasColon) {\n return Math.min(equalsIndex, colonIndex);\n }\n if (hasEquals) {\n return equalsIndex;\n }\n if (hasColon) {\n return colonIndex;\n }\n return -1;\n}\n\nfunction buildOptionSpecificKvGuidance(\n raw: string,\n optionName: string,\n): string {\n if (optionName === \"--add\" || optionName === \"--add-glob\") {\n const looksLikePath =\n /[./\\\\]/.test(raw) || /\\.[a-z]{1,6}$/i.test(raw.trim());\n if (looksLikePath) {\n return \"For file/doc paths use: path=<file-path>[,scope=project|global]. The scope field is optional and defaults to project (example: path=src/api.ts or path=README.md,scope=project). \";\n }\n }\n if (optionName !== \"--event\") {\n return \"\";\n }\n const lowered = raw.toLowerCase();\n const recurrenceHint =\n lowered.includes(\"recur_\") || lowered.includes(\"recurrence\")\n ? ' Recurrence list values must stay in one field and use \"|\" delimiters (for example recur_by_weekday=mon|wed or recur_by_month_day=1|15).'\n : \"\";\n const weekdayAliasHint = lowered.includes(\"recur_byweekday\")\n ? \" Use recur_by_weekday (with underscores) for weekday recurrence filters.\"\n : \"\";\n return `${recurrenceHint}${weekdayAliasHint}`;\n}\n\nfunction buildInvalidKvMessage(raw: string, optionName: string): string {\n const condensed = raw.replaceAll(/\\s+/g, \" \").trim();\n const preview =\n condensed.length > 160 ? `${condensed.slice(0, 157)}...` : condensed;\n const optionSpecificGuidance = buildOptionSpecificKvGuidance(raw, optionName);\n return (\n `Invalid ${optionName} value \"${preview}\". Expected key=value entries separated by commas. ` +\n optionSpecificGuidance +\n 'Also accepts markdown-style key/value lines (for example \"- path: README.md\"). ' +\n `Use ${optionName} ${STDIN_TOKEN} to read piped stdin input.`\n );\n}\n\nfunction parseMarkdownKeyValueLines(\n raw: string,\n): Record<string, string> | null {\n const normalized = stripCodeFenceEnvelope(raw).trim();\n if (normalized.length === 0) {\n return null;\n }\n if (\n !normalized.includes(\"\\n\") &&\n !normalized.startsWith(\"-\") &&\n !normalized.startsWith(\"*\") &&\n !normalized.startsWith(\"+\")\n ) {\n return null;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const lines = normalizeLineEndings(normalized)\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n for (const line of lines) {\n const match = line.match(/^(?:[-*+]\\s+)?([a-zA-Z0-9_.-]+)\\s*(=|:)\\s*(.*)$/);\n if (match) {\n const key = match[1].trim();\n result[key] = unquoteValue(match[3].trim());\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]}\\n${line}`;\n continue;\n }\n return null;\n }\n\n return result;\n}\n\n/** Implements parse csv kv for the public runtime surface of this module. */\nexport function parseCsvKv(\n raw: string,\n optionName: string,\n): Record<string, string> {\n const trimmed = stripCodeFenceEnvelope(raw).trim();\n if (!trimmed) {\n throw new PmCliError(`${optionName} cannot be empty`, EXIT_CODE.USAGE);\n }\n\n const markdownStyle = parseMarkdownKeyValueLines(trimmed);\n if (markdownStyle) {\n return markdownStyle;\n }\n\n const result: Record<string, string> = {};\n let activeKey: string | undefined;\n const segments = splitCsvSegments(trimmed);\n\n for (const segment of segments) {\n const delimiterIndex = findKeyValueDelimiter(segment);\n if (delimiterIndex > 0) {\n const key = segment.slice(0, delimiterIndex).trim();\n const value = unquoteValue(segment.slice(delimiterIndex + 1).trim());\n result[key] = value;\n activeKey = key;\n continue;\n }\n if (activeKey && CONTINUABLE_VALUE_KEYS.has(activeKey.toLowerCase())) {\n result[activeKey] = `${result[activeKey]},${segment.trim()}`;\n continue;\n }\n throw new PmCliError(\n buildInvalidKvMessage(raw, optionName),\n EXIT_CODE.USAGE,\n );\n }\n\n return result;\n}\n\nconst WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\\\/]/;\nconst GENERIC_LEADING_KV_KEY_PATTERN =\n /^(?:[-*+]\\s+)?[A-Za-z_][A-Za-z0-9_.-]*\\s*=/;\n\n/**\n * Detect a CSV/markdown entry that opens with a generic `key=` token even when\n * that key is unknown (e.g. a typo like `lable=main,path=README.md`). Callers\n * combine this with their known-key prefix check so a first-key typo is routed\n * through structured parsing and rejected by {@link assertNoUnknownCsvKeys}\n * (GH-258) instead of being silently swallowed as a bare path/value.\n *\n * Windows absolute paths (`C:\\…`) are excluded so a drive-lettered bare path is\n * never misread as a `C=…` key/value entry.\n */\nexport function looksLikeGenericKeyValueEntry(raw: string): boolean {\n const trimmed = raw.trim();\n if (WINDOWS_ABSOLUTE_PATH_PATTERN.test(trimmed)) {\n return false;\n }\n return GENERIC_LEADING_KV_KEY_PATTERN.test(trimmed);\n}\n\n/**\n * Reject any key in a parsed CSV/markdown key/value map that is not part of the\n * caller's allowed-key contract, mirroring the strict `test --add` behavior\n * (see linked-test-parsers). This closes the cross-command consistency defect\n * (GH-258) where structured link/metadata parsers silently DROPPED typoed keys\n * (e.g. `lable=` instead of `label=`), storing data the author never intended.\n *\n * Comparison is case-insensitive so a key the downstream reader would accept\n * (e.g. `Path`) is never falsely rejected; the emitted \"Allowed keys\" list\n * preserves the canonical casing the caller passes in. Recognized keys are then\n * normalized in-place to their lowercase canonical form so downstream readers\n * (`kv.path`, `kv.id`, `kv.at`, …) see the value even when the input used mixed\n * casing — otherwise `Path=README.md` would pass validation yet read back as an\n * undefined `path` and surface a confusing \"requires path\" error. A key that\n * collides with another after normalization (e.g. `path=a,Path=b`) is rejected.\n *\n * Parsers with an intentional plaintext fallback (`--comment`/`--note`/\n * `--learning`, annotation `--add`) deliberately do NOT call this — there an\n * unrecognized key means \"treat the whole entry as plaintext\", not an error.\n */\nexport function assertNoUnknownCsvKeys(\n kv: Record<string, string>,\n optionName: string,\n allowedKeys: readonly string[],\n): void {\n const allowed = new Set(allowedKeys.map((key) => key.toLowerCase()));\n const unknownKeys = Object.keys(kv).filter(\n (key) => !allowed.has(key.toLowerCase()),\n );\n if (unknownKeys.length > 0) {\n throw new PmCliError(\n `${optionName} does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Allowed keys: ${allowedKeys.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n for (const key of Object.keys(kv)) {\n const normalizedKey = key.toLowerCase();\n if (normalizedKey === key) {\n continue;\n }\n if (Object.hasOwn(kv, normalizedKey)) {\n throw new PmCliError(\n `${optionName} provides key \"${key}\" more than once after case normalization.`,\n EXIT_CODE.USAGE,\n );\n }\n kv[normalizedKey] = kv[key];\n delete kv[key];\n }\n}\n\nasync function readStdinText(optionName: string): Promise<string> {\n if (process.stdin.isTTY === true) {\n throw new PmCliError(\n `${optionName} value \"${STDIN_TOKEN}\" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,\n EXIT_CODE.USAGE,\n );\n }\n process.stdin.setEncoding(\"utf8\");\n return await new Promise<string>((resolve, reject) => {\n let input = \"\";\n process.stdin.on(\"data\", (chunk: string) => {\n input += chunk;\n });\n process.stdin.on(\"end\", () => {\n resolve(normalizeLineEndings(input));\n });\n process.stdin.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\n/** Documents the stdin token resolver payload exchanged by command, SDK, and package integrations. */\nexport interface StdinTokenResolver {\n /** Value that configures or reports resolve value for this contract. */\n resolveValue(\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined>;\n /** Value that configures or reports resolve list for this contract. */\n resolveList(\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined>;\n}\n\n/** Implements create stdin token resolver for the public runtime surface of this module. */\nexport function createStdinTokenResolver(): StdinTokenResolver {\n let stdinValuePromise: Promise<string> | undefined;\n let stdinConsumerOption: string | undefined;\n\n const consumeStdin = async (optionName: string): Promise<string> => {\n if (stdinConsumerOption && stdinConsumerOption !== optionName) {\n throw new PmCliError(\n `Only one option may use \"${STDIN_TOKEN}\" stdin token per command invocation. Already used by ${stdinConsumerOption}.`,\n EXIT_CODE.USAGE,\n );\n }\n stdinConsumerOption = optionName;\n if (!stdinValuePromise) {\n stdinValuePromise = readStdinText(optionName);\n }\n return await stdinValuePromise;\n };\n\n const resolveValue = async (\n value: string | undefined,\n optionName: string,\n ): Promise<string | undefined> => {\n if (value === undefined) {\n return undefined;\n }\n if (value.trim() !== STDIN_TOKEN) {\n return value;\n }\n return await consumeStdin(optionName);\n };\n\n const resolveList = async (\n values: string[] | undefined,\n optionName: string,\n ): Promise<string[] | undefined> => {\n if (!values) {\n return undefined;\n }\n const tokenIndexes = values\n .map((entry, index) => (entry.trim() === STDIN_TOKEN ? index : -1))\n .filter((index) => index >= 0);\n if (tokenIndexes.length === 0) {\n return values;\n }\n if (tokenIndexes.length > 1) {\n throw new PmCliError(\n `${optionName} accepts \"${STDIN_TOKEN}\" stdin token at most once per command invocation`,\n EXIT_CODE.USAGE,\n );\n }\n const stdinValue = await consumeStdin(optionName);\n const next = [...values];\n next[tokenIndexes[0]] = stdinValue;\n return next;\n };\n\n return {\n resolveValue,\n resolveList,\n };\n}\n\n/** Implements parse optional number for the public runtime surface of this module. */\nexport function parseOptionalNumber(raw: string, optionName: string): number {\n const value = Number(raw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(\n `Invalid ${optionName} value \"${raw}\"`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/** Parse a non-negative integer option such as an item duration estimate. */\nexport function parseOptionalNonNegativeInteger(\n raw: string,\n optionName: string,\n): number {\n const trimmed = raw.trim();\n const value = Number(trimmed);\n if (trimmed === \"\" || !Number.isInteger(value) || value < 0) {\n throw new PmCliError(\n `Invalid ${optionName} value \"${raw}\". Expected a non-negative integer.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/** Public contract for test only, shared by SDK and presentation-layer consumers. */\nexport const _testOnly = {\n coerceJsonTagArray,\n stripCodeFenceEnvelope,\n parseMarkdownKeyValueLines,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAQA,IAAM,cAAc;AACpB,IAAM,yBAAyB,oBAAI,IAAI;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AAGK,SAAU,UAAU,KAAW;AACnC,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,YAAY,IAAI;AAClB,WAAO,CAAA;EACT;AACA,QAAM,SAAS,mBAAmB,OAAO,KAAK,QAAQ,MAAM,GAAG;AAC/D,QAAM,OAAO,OACV,IAAI,CAAC,QAAQ,IAAI,KAAI,CAAE,EACvB,OAAO,OAAO,EACd,IAAI,CAAC,QAAQ,IAAI,YAAW,CAAE;AACjC,SAAO,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;AACpE;AAGM,SAAU,qBACd,QAAqC;AAErC,MAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,GAAG;AACjD,WAAO,CAAA;EACT;AACA,QAAM,YAAsB,CAAA;AAC5B,aAAW,OAAO,QAAQ;AACxB,QAAI,OAAO,QAAQ,UAAU;AAC3B;IACF;AACA,eAAW,OAAO,UAAU,G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;AACxB,WAAO;EACT;AAEA,SAAO;IACL;IACA;;AAEJ;AAGM,SAAU,oBAAoB,KAAa,YAAkB;AACjE,QAAM,QAAQ,OAAO,GAAG;AACxB,MAAI,CAAC,OAAO,SAAS,KAAK,GAAG;AAC3B,UAAM,IAAI,WACR,WAAW,UAAU,WAAW,GAAG,KACnC,UAAU,KAAK;EAEnB;AACA,SAAO;AACT;AAGM,SAAU,gCACd,KACA,YAAkB;AAElB,QAAM,UAAU,IAAI,KAAI;AACxB,QAAM,QAAQ,OAAO,OAAO;AAC5B,MAAI,YAAY,MAAM,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GAAG;AAC3D,UAAM,IAAI,WACR,WAAW,UAAU,WAAW,GAAG,uCACnC,UAAU,KAAK;EAEnB;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -10,7 +10,7 @@ import {
10
10
  !(function() {
11
11
  try {
12
12
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
13
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "987f91a5-6f98-55f4-b39b-5fb8b816c95a");
13
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "208d0dcd-c6b6-5959-acdb-6969b1005edd");
14
14
  } catch (e2) {
15
15
  }
16
16
  })();
@@ -26,6 +26,71 @@ function normalizeDependencyGraphTarget(target) {
26
26
  const normalized = normalizeDependencyReferenceTarget(target);
27
27
  return normalized?.toLowerCase() === "no-active-blocker" ? void 0 : normalized;
28
28
  }
29
+ function resolveWorkspaceRelationshipKindRegistry() {
30
+ const registry = createRelationshipKindRegistry();
31
+ for (const registration of getActiveExtensionRegistrations()?.relationship_kinds ?? []) {
32
+ for (const definition of registration.definitions) {
33
+ registry.register(definition);
34
+ }
35
+ }
36
+ return registry;
37
+ }
38
+ function compareCaseFoldedText(left, right) {
39
+ const normalizedLeft = left.toLowerCase();
40
+ const normalizedRight = right.toLowerCase();
41
+ if (normalizedLeft !== normalizedRight)
42
+ return normalizedLeft < normalizedRight ? -1 : 1;
43
+ if (left !== right)
44
+ return left < right ? -1 : 1;
45
+ return 0;
46
+ }
47
+ function countDependencyRowIdentities(item) {
48
+ const occurrences = /* @__PURE__ */ new Map();
49
+ for (const dependency of item.dependencies ?? []) {
50
+ if (typeof dependency !== "object" || dependency === null)
51
+ continue;
52
+ const legacyDependency = dependency;
53
+ const target = normalizeDependencyReferenceTarget(legacyDependency.id);
54
+ if (!target)
55
+ continue;
56
+ const kind = typeof legacyDependency.kind === "string" ? legacyDependency.kind : "related";
57
+ const key = `${kind}\0${target.toLowerCase()}`;
58
+ const existing = occurrences.get(key);
59
+ if (existing)
60
+ existing.count += 1;
61
+ else
62
+ occurrences.set(key, { target_id: target, kind, count: 1 });
63
+ }
64
+ return occurrences;
65
+ }
66
+ function collectDuplicateDependencyRows(items, isTerminal = (status) => status === "closed" || status === "canceled") {
67
+ const rows = [];
68
+ for (const item of items) {
69
+ if (typeof item?.id !== "string" || item.id.trim().length === 0)
70
+ continue;
71
+ for (const entry of countDependencyRowIdentities(item).values()) {
72
+ if (entry.count < 2)
73
+ continue;
74
+ rows.push({
75
+ holder_id: item.id.trim(),
76
+ target_id: entry.target_id,
77
+ kind: entry.kind,
78
+ occurrences: entry.count,
79
+ holder_status: item.status,
80
+ legacy_terminal: isTerminal(item.status)
81
+ });
82
+ }
83
+ }
84
+ return rows.sort((left, right) => {
85
+ const holderCompare = compareCaseFoldedText(left.holder_id, right.holder_id);
86
+ if (holderCompare !== 0)
87
+ return holderCompare;
88
+ const targetCompare = compareCaseFoldedText(left.target_id, right.target_id);
89
+ if (targetCompare !== 0)
90
+ return targetCompare;
91
+ return compareCaseFoldedText(left.kind, right.kind);
92
+ });
93
+ }
29
94
  function collectDanglingDependencyReferences(items, isTerminal = (status) => status === "closed" || status === "canceled") {
30
95
  const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
31
96
  const knownIds = new Set(safeItems.map((item) => item.id.trim().toLowerCase()));
@@ -78,14 +143,7 @@ function collectMissingDependencyTargetIds(dangling) {
78
143
  return [...targets.values()].sort((left, right) => left.localeCompare(right));
79
144
  }
80
145
  function assembleWorkspaceRelationshipGraph(items, isTerminal, registry) {
81
- const relationshipRegistry = registry ?? createRelationshipKindRegistry();
82
- if (registry === void 0) {
83
- for (const registration of getActiveExtensionRegistrations()?.relationship_kinds ?? []) {
84
- for (const definition of registration.definitions) {
85
- relationshipRegistry.register(definition);
86
- }
87
- }
88
- }
146
+ const relationshipRegistry = registry ?? resolveWorkspaceRelationshipKindRegistry();
89
147
  const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
90
148
  const canonicalIds = new Map(safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
91
149
  const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);
@@ -122,7 +180,8 @@ function assembleWorkspaceRelationshipGraph(items, isTerminal, registry) {
122
180
  ...safeItems.map((item) => ({
123
181
  id: item.id.trim(),
124
182
  title: item.title,
125
- status: item.status
183
+ status: item.status,
184
+ ...typeof item.type === "string" && item.type.trim().length > 0 ? { type: item.type.trim() } : {}
126
185
  })),
127
186
  ...missingIds.map((id) => ({
128
187
  id,
@@ -131,13 +190,17 @@ function assembleWorkspaceRelationshipGraph(items, isTerminal, registry) {
131
190
  }))
132
191
  ],
133
192
  missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),
134
- dangling
193
+ dangling,
194
+ duplicateRows: collectDuplicateDependencyRows(safeItems, isTerminal)
135
195
  };
136
196
  }
137
197
 
138
198
  export {
199
+ normalizeDependencyGraphTarget,
200
+ resolveWorkspaceRelationshipKindRegistry,
201
+ collectDuplicateDependencyRows,
139
202
  collectDanglingDependencyReferences,
140
203
  collectMissingDependencyTargetIds,
141
204
  assembleWorkspaceRelationshipGraph
142
205
  };
143
- //# sourceMappingURL=chunk-IJNK6WW2.js.map
206
+ //# sourceMappingURL=chunk-Z75ONV25.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../sdk/graph/assembly.ts"],
4
+ "sourcesContent": ["/**\n * @module sdk/graph/assembly\n *\n * Builds the shared workspace relationship graph consumed by dependency\n * queries, bounded context packets, impact analysis, and governance audits.\n * Assembly normalizes hierarchy, legacy scalar blockers, and structured\n * dependency edges into one deterministic {@link RelationshipGraph}, classifies\n * dangling references without mutating their holders, and materializes missing\n * endpoints as placeholder nodes so bounded traversals can explain absent work\n * instead of silently dropping it.\n */\nimport type { Dependency, ItemStatus } from \"../../types/index.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport {\n RelationshipGraph,\n createRelationshipKindRegistry,\n type RelationshipKindRegistry,\n} from \"../relationships.js\";\n\n/** Minimal item shape inspected by dependency-reference governance. */\nexport interface DependencyReferenceHolder {\n /** Stable item identifier. */\n id: string;\n /** Lifecycle status used to separate actionable work from historical debt. */\n status: ItemStatus;\n /** Optional hierarchy parent reference. */\n parent?: string;\n /** Optional legacy scalar blocker reference. */\n blocked_by?: string;\n /** Structured dependency edges. */\n dependencies?: Dependency[];\n}\n\n/** Storage surface that contributed a normalized dependency reference. */\nexport type DependencyReferenceSource = \"parent\" | \"blocked_by\" | \"dependency\";\n\n/** One normalized dependency reference whose target is absent from the tracker. */\nexport interface DanglingDependencyReference {\n /** Item that owns the reference. */\n holder_id: string;\n /** Missing referenced item id or legacy sentinel. */\n target_id: string;\n /** Relationship field or dependency kind. */\n kind: string;\n /** Storage surface that owns the reference and determines its remediation. */\n source: DependencyReferenceSource;\n /** Current lifecycle status of the holder. */\n holder_status: ItemStatus;\n /** Whether the holder is terminal and therefore historical, non-actionable debt. */\n legacy_terminal: boolean;\n /** Whether the target is the pre-structured-dependency `no-active-blocker` sentinel. */\n no_active_blocker_sentinel: boolean;\n}\n\n/** Actionable and historical partitions returned by dependency-reference governance. */\nexport interface DanglingDependencyReferenceSummary {\n /** Missing references held by active items; these may affect scheduling and should gate validation. */\n active: DanglingDependencyReference[];\n /** Missing references held only by terminal items; retained as informational history debt. */\n legacy_terminal: DanglingDependencyReference[];\n /** Legacy sentinel rows across active and terminal holders, called out separately from typo-like ids. */\n no_active_blocker_sentinels: DanglingDependencyReference[];\n}\n\n/** Normalize a decoded reference target and reject empty legacy placeholders. */\nfunction normalizeDependencyReferenceTarget(\n target: unknown,\n): string | undefined {\n if (typeof target !== \"string\") return undefined;\n const normalized = target.trim();\n if (\n !normalized ||\n [\"none\", \"null\", \"n/a\", \"na\"].includes(normalized.toLowerCase())\n )\n return undefined;\n return normalized;\n}\n\n/** Normalize a graph target while removing the historical no-blocker marker. */\nexport function normalizeDependencyGraphTarget(\n target: unknown,\n): string | undefined {\n const normalized = normalizeDependencyReferenceTarget(target);\n return normalized?.toLowerCase() === \"no-active-blocker\"\n ? undefined\n : normalized;\n}\n\n/**\n * Resolve the default workspace relationship-kind registry: the built-in kinds\n * merged with every active extension-contributed relationship-kind\n * registration. Assembly, mutation advisories, and standalone graph consumers\n * share this resolution so custom ordering semantics apply identically on\n * every surface.\n */\nexport function resolveWorkspaceRelationshipKindRegistry(): RelationshipKindRegistry {\n const registry = createRelationshipKindRegistry();\n for (const registration of getActiveExtensionRegistrations()\n ?.relationship_kinds ?? []) {\n for (const definition of registration.definitions) {\n registry.register(definition);\n }\n }\n return registry;\n}\n\n/** One raw stored dependency row duplicated verbatim on a single holder. */\nexport interface DuplicateDependencyRow {\n /** Item that stores the duplicated row. */\n holder_id: string;\n /** Referenced target id in its first stored spelling. */\n target_id: string;\n /** Stored relationship kind shared by every duplicate occurrence. */\n kind: string;\n /** Total stored occurrences of the identical row (always >= 2). */\n occurrences: number;\n /** Current lifecycle status of the holder. */\n holder_status: ItemStatus;\n /** Whether the holder is terminal and the duplication is historical debt. */\n legacy_terminal: boolean;\n}\n\n/** Compare text case-insensitively with an exact-spelling deterministic tie-breaker. */\nfunction compareCaseFoldedText(left: string, right: string): number {\n const normalizedLeft = left.toLowerCase();\n const normalizedRight = right.toLowerCase();\n if (normalizedLeft !== normalizedRight)\n return normalizedLeft < normalizedRight ? -1 : 1;\n if (left !== right) return left < right ? -1 : 1;\n return 0;\n}\n\n/** Count one holder's dependency rows by their case-insensitive kind-plus-target identity. */\nfunction countDependencyRowIdentities(\n item: DependencyReferenceHolder,\n): Map<string, { target_id: string; kind: string; count: number }> {\n const occurrences = new Map<\n string,\n { target_id: string; kind: string; count: number }\n >();\n for (const dependency of item.dependencies ?? []) {\n if (typeof dependency !== \"object\" || dependency === null) continue;\n const legacyDependency = dependency as Partial<Dependency>;\n const target = normalizeDependencyReferenceTarget(legacyDependency.id);\n if (!target) continue;\n const kind =\n typeof legacyDependency.kind === \"string\"\n ? legacyDependency.kind\n : \"related\";\n const key = `${kind}\\u0000${target.toLowerCase()}`;\n const existing = occurrences.get(key);\n if (existing) existing.count += 1;\n else occurrences.set(key, { target_id: target, kind, count: 1 });\n }\n return occurrences;\n}\n\n/**\n * Collect raw stored dependency rows whose exact identity — holder, kind, and\n * case-insensitive target — appears more than once on one item. Graph\n * construction deduplicates these by edge identity, so the assembled graph and\n * every projection built on it cannot see them; this pre-assembly scan is the\n * only surface that reports the storage-layer defect.\n */\nexport function collectDuplicateDependencyRows(\n items: readonly DependencyReferenceHolder[],\n isTerminal: (status: ItemStatus) => boolean = (status) =>\n status === \"closed\" || status === \"canceled\",\n): DuplicateDependencyRow[] {\n const rows: DuplicateDependencyRow[] = [];\n for (const item of items) {\n if (typeof item?.id !== \"string\" || item.id.trim().length === 0) continue;\n for (const entry of countDependencyRowIdentities(item).values()) {\n if (entry.count < 2) continue;\n rows.push({\n holder_id: item.id.trim(),\n target_id: entry.target_id,\n kind: entry.kind,\n occurrences: entry.count,\n holder_status: item.status,\n legacy_terminal: isTerminal(item.status),\n });\n }\n }\n return rows.sort((left, right) => {\n const holderCompare = compareCaseFoldedText(\n left.holder_id,\n right.holder_id,\n );\n if (holderCompare !== 0) return holderCompare;\n const targetCompare = compareCaseFoldedText(\n left.target_id,\n right.target_id,\n );\n if (targetCompare !== 0) return targetCompare;\n return compareCaseFoldedText(left.kind, right.kind);\n });\n}\n\n/**\n * Classify missing hierarchy and dependency targets without mutating their holders.\n *\n * Consumers provide the workspace's terminal-status predicate so custom lifecycle\n * schemas receive the same active-versus-historical behavior as the built-in\n * closed/canceled statuses.\n */\nexport function collectDanglingDependencyReferences(\n items: readonly DependencyReferenceHolder[],\n isTerminal: (status: ItemStatus) => boolean = (status) =>\n status === \"closed\" || status === \"canceled\",\n): DanglingDependencyReferenceSummary {\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const knownIds = new Set(\n safeItems.map((item) => item.id.trim().toLowerCase()),\n );\n const rows = new Map<string, DanglingDependencyReference>();\n const addReference = (\n item: DependencyReferenceHolder,\n target: unknown,\n kind: string,\n source: DependencyReferenceSource,\n ): void => {\n const normalized = normalizeDependencyReferenceTarget(target);\n if (!normalized || knownIds.has(normalized.toLowerCase())) {\n return;\n }\n const row: DanglingDependencyReference = {\n holder_id: item.id.trim(),\n target_id: normalized,\n kind,\n source,\n holder_status: item.status,\n legacy_terminal: isTerminal(item.status),\n no_active_blocker_sentinel:\n normalized.toLowerCase() === \"no-active-blocker\",\n };\n rows.set(\n `${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`,\n row,\n );\n };\n for (const item of safeItems) {\n addReference(item, item.parent, \"parent\", \"parent\");\n addReference(item, item.blocked_by, \"blocked_by\", \"blocked_by\");\n for (const dependency of item.dependencies ?? []) {\n // Public SDK callers may supply legacy or JSON-decoded payloads that do\n // not yet satisfy the current structured dependency contract.\n if (typeof dependency !== \"object\" || dependency === null) {\n continue;\n }\n const legacyDependency = dependency as Partial<Dependency>;\n addReference(\n item,\n legacyDependency.id,\n typeof legacyDependency.kind === \"string\"\n ? legacyDependency.kind\n : \"related\",\n \"dependency\",\n );\n }\n }\n const sorted = [...rows.values()].sort(\n (left, right) =>\n left.holder_id.localeCompare(right.holder_id) ||\n left.target_id.localeCompare(right.target_id) ||\n left.kind.localeCompare(right.kind) ||\n left.source.localeCompare(right.source),\n );\n const legacyTerminal = sorted.filter((row) => row.legacy_terminal);\n return {\n active: sorted.filter((row) => !row.legacy_terminal),\n legacy_terminal: legacyTerminal,\n no_active_blocker_sentinels: sorted.filter(\n (row) => row.no_active_blocker_sentinel,\n ),\n };\n}\n\n/** Return unique real missing targets while excluding the legacy no-blocker sentinel. */\nexport function collectMissingDependencyTargetIds(\n dangling: DanglingDependencyReferenceSummary,\n): string[] {\n const targets = new Map<string, string>();\n for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {\n if (reference.no_active_blocker_sentinel) continue;\n const target = reference.target_id.trim();\n const key = target.toLowerCase();\n if (!targets.has(key)) targets.set(key, target);\n }\n return [...targets.values()].sort((left, right) => left.localeCompare(right));\n}\n\n/** Item shape accepted by workspace relationship-graph assembly. */\nexport interface WorkspaceRelationshipItem extends DependencyReferenceHolder {\n /** Human-readable title projected into per-node details. */\n title: string;\n /** Optional item type powering per-type coverage profiles and policies. */\n type?: string;\n}\n\n/** Compact node projection paired with the assembled graph. */\nexport interface WorkspaceRelationshipNodeDetails {\n /** Stable node identifier. */\n id: string;\n /** Human-readable node title, or a `[missing]` marker for absent endpoints. */\n title: string;\n /** Lifecycle status, or the `missing` marker status for absent endpoints. */\n status: string;\n /** Item type when the source item declared one; absent on missing placeholders. */\n type?: string;\n}\n\n/** Assembled workspace relationship graph with governance side-products. */\nexport interface WorkspaceRelationshipAssembly {\n /** Deterministic relationship graph including missing placeholder nodes. */\n graph: RelationshipGraph;\n /** Per-node compact details covering real and missing nodes. */\n details: WorkspaceRelationshipNodeDetails[];\n /** Lowercased identifiers of materialized missing endpoints. */\n missingIdSet: Set<string>;\n /** Dangling-reference classification computed during assembly. */\n dangling: DanglingDependencyReferenceSummary;\n /** Raw same-identity duplicated dependency rows found before graph dedup. */\n duplicateRows: DuplicateDependencyRow[];\n}\n\n/**\n * Build the shared workspace relationship graph including missing placeholder\n * nodes. One assembly serves every bounded query in an invocation — dependency\n * trees, context packets, impact analysis, path enumeration, and governance\n * audits — so the full-workspace normalization cost is paid once instead of\n * once per query surface.\n */\nexport function assembleWorkspaceRelationshipGraph(\n items: readonly WorkspaceRelationshipItem[],\n isTerminal?: (status: ItemStatus) => boolean,\n registry?: RelationshipKindRegistry,\n): WorkspaceRelationshipAssembly {\n const relationshipRegistry =\n registry ?? resolveWorkspaceRelationshipKindRegistry();\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const canonicalIds = new Map(\n safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]),\n );\n const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);\n const missingIds = collectMissingDependencyTargetIds(dangling);\n for (const id of missingIds) canonicalIds.set(id.toLowerCase(), id);\n const graphItems = safeItems.map((item) => {\n const parent = normalizeDependencyGraphTarget(item.parent);\n const blocker = normalizeDependencyGraphTarget(item.blocked_by);\n const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {\n if (typeof rawDependency !== \"object\" || rawDependency === null)\n return [];\n const dependency = rawDependency as Partial<Dependency>;\n const target = normalizeDependencyGraphTarget(dependency.id);\n if (!target) return [];\n return [\n {\n id: canonicalIds.get(target.toLowerCase())!,\n kind:\n typeof dependency.kind === \"string\" ? dependency.kind : \"related\",\n },\n ];\n });\n return {\n id: item.id.trim(),\n ...(parent ? { parent: canonicalIds.get(parent.toLowerCase())! } : {}),\n ...(blocker\n ? { blocked_by: canonicalIds.get(blocker.toLowerCase())! }\n : {}),\n dependencies,\n };\n });\n return {\n graph: RelationshipGraph.fromItems(\n [...graphItems, ...missingIds.map((id) => ({ id }))],\n relationshipRegistry,\n ),\n details: [\n ...safeItems.map((item) => ({\n id: item.id.trim(),\n title: item.title,\n status: item.status,\n ...(typeof item.type === \"string\" && item.type.trim().length > 0\n ? { type: item.type.trim() }\n : {}),\n })),\n ...missingIds.map((id) => ({\n id,\n title: `[missing] ${id}`,\n status: \"missing\",\n })),\n ],\n missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),\n dangling,\n duplicateRows: collectDuplicateDependencyRows(safeItems, isTerminal),\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAiEA,SAAS,mCACP,QAAe;AAEf,MAAI,OAAO,WAAW;AAAU,WAAO;AACvC,QAAM,aAAa,OAAO,KAAI;AAC9B,MACE,CAAC,cACD,CAAC,QAAQ,QAAQ,OAAO,IAAI,EAAE,SAAS,WAAW,YAAW,CAAE;AAE/D,WAAO;AACT,SAAO;AACT;AAGM,SAAU,+BACd,QAAe;AAEf,QAAM,aAAa,mCAAmC,MAAM;AAC5D,SAAO,YAAY,YAAW,MAAO,sBACjC,SACA;AACN;AASM,SAAU,2CAAwC;AACtD,QAAM,WAAW,+BAA8B;AAC/C,aAAW,gBAAgB,gCAA+B,GACtD,sBAAsB,CAAA,GAAI;AAC5B,eAAW,cAAc,aAAa,aAAa;AACjD,eAAS,SAAS,UAAU;IAC9B;EACF;AACA,SAAO;AACT;AAmBA,SAAS,sBAAsB,MAAc,OAAa;AACxD,QAAM,iBAAiB,KAAK,YAAW;AACvC,QAAM,kBAAkB,MAAM,YAAW;AACzC,MAAI,mBAAmB;AACrB,WAAO,iBAAiB,kBAAkB,KAAK;AACjD,MAAI,SAAS;AAAO,WAAO,OAAO,QAAQ,KAAK;AAC/C,SAAO;AACT;AAGA,SAAS,6BACP,MAA+B;AAE/B,QAAM,cAAc,oBAAI,IAAG;AAI3B,aAAW,cAAc,KAAK,gBAAgB,CAAA,GAAI;AAChD,QAAI,OAAO,eAAe,YAAY,eAAe;AAAM;AAC3D,UAAM,mBAAmB;AACzB,UAAM,SAAS,mCAAmC,iBAAiB,EAAE;AACrE,QAAI,CAAC;AAAQ;AACb,UAAM,OACJ,OAAO,iBAAiB,SAAS,WAC7B,iBAAiB,OACjB;AACN,UAAM,MAAM,GAAG,I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AG,KAAI;MAChB,GAAI,SAAS,EAAE,QAAQ,aAAa,IAAI,OAAO,YAAW,CAAE,EAAE,IAAK,CAAA;MACnE,GAAI,UACA,EAAE,YAAY,aAAa,IAAI,QAAQ,YAAW,CAAE,EAAE,IACtD,CAAA;MACJ;;EAEJ,CAAC;AACD,SAAO;IACL,OAAO,kBAAkB,UACvB,CAAC,GAAG,YAAY,GAAG,WAAW,IAAI,CAAC,QAAQ,EAAE,GAAE,EAAG,CAAC,GACnD,oBAAoB;IAEtB,SAAS;MACP,GAAG,UAAU,IAAI,CAAC,UAAU;QAC1B,IAAI,KAAK,GAAG,KAAI;QAChB,OAAO,KAAK;QACZ,QAAQ,KAAK;QACb,GAAI,OAAO,KAAK,SAAS,YAAY,KAAK,KAAK,KAAI,EAAG,SAAS,IAC3D,EAAE,MAAM,KAAK,KAAK,KAAI,EAAE,IACxB,CAAA;QACJ;MACF,GAAG,WAAW,IAAI,CAAC,QAAQ;QACzB;QACA,OAAO,aAAa,EAAE;QACtB,QAAQ;QACR;;IAEJ,cAAc,IAAI,IAAI,WAAW,IAAI,CAAC,OAAO,GAAG,YAAW,CAAE,CAAC;IAC9D;IACA,eAAe,+BAA+B,WAAW,UAAU;;AAEvE;",
6
+ "names": []
7
+ }
@@ -1,15 +1,13 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="39fa5c19-48c3-5dc7-a02e-1e3edffb0668")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1c0accd8-e100-5cf8-9144-fd399be61d5a")}catch(e){}}();
3
3
  import {
4
4
  ensureMaterializedHistoryTarget,
5
5
  readHistoryEntries,
6
6
  replayHistoryToTarget,
7
+ replayToCanonicalItemDocument,
7
8
  resolveHistorySubject,
8
9
  resolveHistoryTarget
9
- } from "./chunk-2BO4CA46.js";
10
- import {
11
- replayToCanonicalItemDocument
12
- } from "./chunk-P7JTWYLH.js";
10
+ } from "./chunk-PFNHX655.js";
13
11
  import {
14
12
  getActiveExtensionRegistrations,
15
13
  readSettings
@@ -58,6 +56,6 @@ async function getItemAt(id, target, options = {}) {
58
56
  export {
59
57
  getItemAt
60
58
  };
61
- //# sourceMappingURL=chunk-4L23AGQ7.js.map
59
+ //# sourceMappingURL=chunk-Z7VWXXJM.js.map
62
60
 
63
- //# debugId=39fa5c19-48c3-5dc7-a02e-1e3edffb0668
61
+ //# debugId=1c0accd8-e100-5cf8-9144-fd399be61d5a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../sdk/history-read.ts"],"sourcesContent":["/**\n * @module sdk/history-read\n *\n * Public, mutation-free item time-travel reads backed by the same verified\n * replay kernel used by `pm restore`. Integrators can use this primitive as a\n * building block for provenance browsers, immutable records, and VCS-like\n * systems without acquiring locks or appending history.\n */\nimport { getActiveExtensionRegistrations } from \"../core/extensions/index.js\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport {\n applyHistoryPatch,\n ensureMaterializedHistoryTarget,\n extractPatchFailureContext,\n replayHistoryToTarget,\n resolveHistoryTarget,\n type ResolvedHistoryTarget,\n} from \"../core/history/projection.js\";\nimport { readHistoryEntries } from \"../core/history/read.js\";\nimport { replayToCanonicalItemDocument } from \"../core/history/replay.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport type { ItemDocument } from \"../types/index.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/** Workspace resolution controls accepted by {@link getItemAt}. */\nexport interface GetItemAtOptions {\n /** Explicit tracker root, equivalent to the CLI global `--pm-path`. */\n pmRoot?: string;\n /** Working directory used when discovering the nearest tracker. */\n cwd?: string;\n}\n\n/** Verified historical item projection returned by {@link getItemAt}. */\nexport interface GetItemAtResult {\n /** Reconstructed canonical item document at the selected version. */\n document: ItemDocument;\n /** Always true, preventing consumers from confusing this with current state. */\n reconstructed: true;\n /** One-based version included in the projection. */\n as_of_version: number;\n /** Timestamp of the final included history entry. */\n as_of_timestamp: string;\n /** Normalized target resolution metadata shared with restore. */\n target: ResolvedHistoryTarget;\n /** Total number of entries currently available in the stream. */\n history_length: number;\n}\n\n/**\n * Reconstruct one item at a one-based version or ISO timestamp without locks,\n * item writes, history writes, or derived-index mutations.\n */\nexport async function getItemAt(\n id: string,\n target: string,\n options: GetItemAtOptions = {},\n): Promise<GetItemAtResult> {\n const pmRoot = resolvePmRoot(options.cwd ?? process.cwd(), options.pmRoot);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const subject = await resolveHistorySubject(\n pmRoot,\n id,\n settings,\n typeRegistry.type_to_folder,\n );\n const history = await readHistoryEntries(subject.historyPath, subject.id);\n if (history.length === 0) {\n throw new PmCliError(\n `No history exists for ${subject.id}; point-in-time reads are unavailable.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const resolvedTarget = resolveHistoryTarget(target, history);\n const replay = ensureMaterializedHistoryTarget(\n replayHistoryToTarget(history, resolvedTarget.historyIndex),\n resolvedTarget,\n );\n const document = replayToCanonicalItemDocument(replay, {\n schema: settings.schema,\n });\n if (document.metadata.id !== subject.id) {\n throw new PmCliError(\n `History target resolved to item ${document.metadata.id}, expected ${subject.id}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const targetEntry = history[resolvedTarget.historyIndex];\n return {\n document,\n reconstructed: true,\n as_of_version: resolvedTarget.historyIndex + 1,\n as_of_timestamp: targetEntry.ts,\n target: resolvedTarget,\n history_length: history.length,\n };\n}\n\nexport {\n applyHistoryPatch,\n ensureMaterializedHistoryTarget,\n extractPatchFailureContext,\n readHistoryEntries,\n replayHistoryToTarget,\n resolveHistoryTarget,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,eAAsB,UACpB,IACA,QACA,UAA4B,CAAA,GAAE;AAE9B,QAAM,SAAS,cAAc,QAAQ,OAAO,QAAQ,IAAG,GAAI,QAAQ,MAAM;AACzE,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WACR,iCAAiC,MAAM,wBACvC,UAAU,SAAS;EAEvB;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,eAAe,wBACnB,UACA,gCAA+B,CAAE;AAEnC,QAAM,UAAU,MAAM,sBACpB,QACA,IACA,UACA,aAAa,cAAc;AAE7B,QAAM,UAAU,MAAM,mBAAmB,QAAQ,aAAa,QAAQ,EAAE;AACxE,MAAI,QAAQ,WAAW,GAAG;AACxB,UAAM,IAAI,WACR,yBAAyB,QAAQ,EAAE,0CACnC,UAAU,SAAS;EAEvB;AACA,QAAM,iBAAiB,qBAAqB,QAAQ,OAAO;AAC3D,QAAM,SAAS,gCACb,sBAAsB,SAAS,eAAe,YAAY,GAC1D,cAAc;AAEhB,QAAM,WAAW,8BAA8B,QAAQ;IACrD,QAAQ,SAAS;GAClB;AACD,MAAI,SAAS,SAAS,OAAO,QAAQ,IAAI;AACvC,UAAM,IAAI,WACR,mCAAmC,SAAS,SAAS,EAAE,cAAc,QAAQ,EAAE,KAC/E,UAAU,eAAe;EAE7B;AACA,QAAM,cAAc,QAAQ,eAAe,YAAY;AACvD,SAAO;IACL;IACA,eAAe;IACf,eAAe,eAAe,eAAe;IAC7C,iBAAiB,YAAY;IAC7B,QAAQ;IACR,gBAAgB,QAAQ;;AAE5B","debugId":"39fa5c19-48c3-5dc7-a02e-1e3edffb0668"}
1
+ {"version":3,"sources":["../../../../../../../../sdk/history-read.ts"],"sourcesContent":["/**\n * @module sdk/history-read\n *\n * Public, mutation-free item time-travel reads backed by the same verified\n * replay kernel used by `pm restore`. Integrators can use this primitive as a\n * building block for provenance browsers, immutable records, and VCS-like\n * systems without acquiring locks or appending history.\n */\nimport { getActiveExtensionRegistrations } from \"../core/extensions/index.js\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport {\n applyHistoryPatch,\n ensureMaterializedHistoryTarget,\n extractPatchFailureContext,\n replayHistoryToTarget,\n resolveHistoryTarget,\n type ResolvedHistoryTarget,\n} from \"../core/history/projection.js\";\nimport { readHistoryEntries } from \"../core/history/read.js\";\nimport { replayToCanonicalItemDocument } from \"../core/history/replay.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport type { ItemDocument } from \"../types/index.js\";\nimport { resolveHistorySubject } from \"./history-redact.js\";\n\n/** Workspace resolution controls accepted by {@link getItemAt}. */\nexport interface GetItemAtOptions {\n /** Explicit tracker root, equivalent to the CLI global `--pm-path`. */\n pmRoot?: string;\n /** Working directory used when discovering the nearest tracker. */\n cwd?: string;\n}\n\n/** Verified historical item projection returned by {@link getItemAt}. */\nexport interface GetItemAtResult {\n /** Reconstructed canonical item document at the selected version. */\n document: ItemDocument;\n /** Always true, preventing consumers from confusing this with current state. */\n reconstructed: true;\n /** One-based version included in the projection. */\n as_of_version: number;\n /** Timestamp of the final included history entry. */\n as_of_timestamp: string;\n /** Normalized target resolution metadata shared with restore. */\n target: ResolvedHistoryTarget;\n /** Total number of entries currently available in the stream. */\n history_length: number;\n}\n\n/**\n * Reconstruct one item at a one-based version or ISO timestamp without locks,\n * item writes, history writes, or derived-index mutations.\n */\nexport async function getItemAt(\n id: string,\n target: string,\n options: GetItemAtOptions = {},\n): Promise<GetItemAtResult> {\n const pmRoot = resolvePmRoot(options.cwd ?? process.cwd(), options.pmRoot);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const subject = await resolveHistorySubject(\n pmRoot,\n id,\n settings,\n typeRegistry.type_to_folder,\n );\n const history = await readHistoryEntries(subject.historyPath, subject.id);\n if (history.length === 0) {\n throw new PmCliError(\n `No history exists for ${subject.id}; point-in-time reads are unavailable.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const resolvedTarget = resolveHistoryTarget(target, history);\n const replay = ensureMaterializedHistoryTarget(\n replayHistoryToTarget(history, resolvedTarget.historyIndex),\n resolvedTarget,\n );\n const document = replayToCanonicalItemDocument(replay, {\n schema: settings.schema,\n });\n if (document.metadata.id !== subject.id) {\n throw new PmCliError(\n `History target resolved to item ${document.metadata.id}, expected ${subject.id}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const targetEntry = history[resolvedTarget.historyIndex];\n return {\n document,\n reconstructed: true,\n as_of_version: resolvedTarget.historyIndex + 1,\n as_of_timestamp: targetEntry.ts,\n target: resolvedTarget,\n history_length: history.length,\n };\n}\n\nexport {\n applyHistoryPatch,\n ensureMaterializedHistoryTarget,\n extractPatchFailureContext,\n readHistoryEntries,\n replayHistoryToTarget,\n resolveHistoryTarget,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwDA,eAAsB,UACpB,IACA,QACA,UAA4B,CAAA,GAAE;AAE9B,QAAM,SAAS,cAAc,QAAQ,OAAO,QAAQ,IAAG,GAAI,QAAQ,MAAM;AACzE,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WACR,iCAAiC,MAAM,wBACvC,UAAU,SAAS;EAEvB;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,eAAe,wBACnB,UACA,gCAA+B,CAAE;AAEnC,QAAM,UAAU,MAAM,sBACpB,QACA,IACA,UACA,aAAa,cAAc;AAE7B,QAAM,UAAU,MAAM,mBAAmB,QAAQ,aAAa,QAAQ,EAAE;AACxE,MAAI,QAAQ,WAAW,GAAG;AACxB,UAAM,IAAI,WACR,yBAAyB,QAAQ,EAAE,0CACnC,UAAU,SAAS;EAEvB;AACA,QAAM,iBAAiB,qBAAqB,QAAQ,OAAO;AAC3D,QAAM,SAAS,gCACb,sBAAsB,SAAS,eAAe,YAAY,GAC1D,cAAc;AAEhB,QAAM,WAAW,8BAA8B,QAAQ;IACrD,QAAQ,SAAS;GAClB;AACD,MAAI,SAAS,SAAS,OAAO,QAAQ,IAAI;AACvC,UAAM,IAAI,WACR,mCAAmC,SAAS,SAAS,EAAE,cAAc,QAAQ,EAAE,KAC/E,UAAU,eAAe;EAE7B;AACA,QAAM,cAAc,QAAQ,eAAe,YAAY;AACvD,SAAO;IACL;IACA,eAAe;IACf,eAAe,eAAe,eAAe;IAC7C,iBAAiB,YAAY;IAC7B,QAAQ;IACR,gBAAgB,QAAQ;;AAE5B","debugId":"1c0accd8-e100-5cf8-9144-fd399be61d5a"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computeHistoryDiff,
3
3
  patchPathToChangedField
4
- } from "./chunk-TYHJDFYW.js";
4
+ } from "./chunk-ZVZGXPQ5.js";
5
5
  import {
6
6
  collectRuntimeFilterValues,
7
7
  matchesRuntimeFilters,
@@ -24,13 +24,11 @@ import {
24
24
  computeActionabilityReport,
25
25
  resolveItemBlockers
26
26
  } from "./chunk-TVYYO5A7.js";
27
- import {
28
- readHistoryEntries
29
- } from "./chunk-C3KD7U3T.js";
30
27
  import {
31
28
  normalizeReplayPatchOps,
29
+ readHistoryEntries,
32
30
  verifyHistoryChain
33
- } from "./chunk-E6LEMURX.js";
31
+ } from "./chunk-2L6ZP22J.js";
34
32
  import {
35
33
  acquireLock,
36
34
  compareTimestampStrings,
@@ -3629,4 +3627,4 @@ export {
3629
3627
  renderNextMarkdown,
3630
3628
  collectStaleVectorizationIds
3631
3629
  };
3632
- //# sourceMappingURL=chunk-YBT7O4KT.js.map
3630
+ //# sourceMappingURL=chunk-ZTVA4KLN.js.map