@unbrained/pm-cli 2026.7.18 → 2026.7.19

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 (497) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -0
  3. package/dist/cli/commands/claim.js +6 -4
  4. package/dist/cli/commands/claim.js.map +1 -1
  5. package/dist/cli/commands/comments.js +5 -2
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/context.d.ts +10 -1
  8. package/dist/cli/commands/context.js +44 -6
  9. package/dist/cli/commands/context.js.map +1 -1
  10. package/dist/cli/commands/create.js +15 -4
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/next.js +13 -3
  13. package/dist/cli/commands/next.js.map +1 -1
  14. package/dist/cli/commands/update.js +14 -3
  15. package/dist/cli/commands/update.js.map +1 -1
  16. package/dist/cli/error-guidance.js +23 -4
  17. package/dist/cli/error-guidance.js.map +1 -1
  18. package/dist/cli/extension-command-help.d.ts +11 -0
  19. package/dist/cli/extension-command-help.js +62 -2
  20. package/dist/cli/extension-command-help.js.map +1 -1
  21. package/dist/cli/main.d.ts +1 -0
  22. package/dist/cli/main.js +16 -11
  23. package/dist/cli/main.js.map +1 -1
  24. package/dist/cli-bundle/bundle-manifest.json +326 -350
  25. package/dist/cli-bundle/chunks/{append-5YF3TO7I.js → append-MBXHNWSX.js} +5 -5
  26. package/dist/cli-bundle/chunks/append-XUYF7NON.js +11 -0
  27. package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js → chunk-2UCG5H6B.js} +3 -3
  28. package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js → chunk-2XPDCXK5.js} +4 -4
  29. package/dist/cli-bundle/chunks/{chunk-I3INI567.js → chunk-3EZZTFL2.js} +909 -124
  30. package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +7 -0
  31. package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js → chunk-3HSRP6T2.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js → chunk-3KPNOZOH.js} +23 -23
  33. package/dist/cli-bundle/chunks/{chunk-MR4SHYR4.js → chunk-3QNUDDY2.js} +104 -23
  34. package/dist/cli-bundle/chunks/chunk-3QNUDDY2.js.map +7 -0
  35. package/dist/cli-bundle/chunks/{chunk-SIPOACV5.js → chunk-46Z6FAVP.js} +888 -124
  36. package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +1 -0
  37. package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js → chunk-4M6RZJXF.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js → chunk-4PSJVGRE.js} +11 -11
  39. package/dist/cli-bundle/chunks/{chunk-ADXDCAKP.js → chunk-5S6IZXK7.js} +146 -32
  40. package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js.map → chunk-5S6IZXK7.js.map} +7 -1
  41. package/dist/cli-bundle/chunks/chunk-66SRNEBK.js +143 -0
  42. package/dist/cli-bundle/chunks/chunk-66SRNEBK.js.map +7 -0
  43. package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js → chunk-6BNV3G6C.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js → chunk-6V4T4RD3.js} +23 -23
  45. package/dist/cli-bundle/chunks/chunk-77XFQRTD.js +140 -0
  46. package/dist/cli-bundle/chunks/chunk-77XFQRTD.js.map +1 -0
  47. package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js → chunk-7B7IHMLH.js} +3 -3
  48. package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js → chunk-7CHWLT2J.js} +2 -2
  49. package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js → chunk-A3GAQLBH.js} +5 -5
  50. package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js → chunk-A4FVWFZY.js} +4 -4
  51. package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js → chunk-A5EQPNV7.js} +2 -2
  52. package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js → chunk-AGEBQRBG.js} +15 -15
  53. package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js → chunk-AQUNTB7G.js} +3 -3
  54. package/dist/cli-bundle/chunks/{chunk-OGVTB5VO.js → chunk-AR24KW26.js} +237 -36
  55. package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +7 -0
  56. package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js → chunk-BBGR4FKQ.js} +4 -4
  57. package/dist/cli-bundle/chunks/{chunk-HTXXXF45.js → chunk-BDC4TW4B.js} +98 -24
  58. package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js → chunk-BFJP4VYC.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-633PKXLT.js → chunk-BZKE2O5V.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-XPUTSGJU.js → chunk-CZA2DXCV.js} +230 -36
  62. package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +1 -0
  63. package/dist/cli-bundle/chunks/{chunk-KX62NMZC.js → chunk-D35WYXWC.js} +626 -5
  64. package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +1 -0
  65. package/dist/cli-bundle/chunks/chunk-DOASIOQR.js +289 -0
  66. package/dist/cli-bundle/chunks/chunk-DOASIOQR.js.map +7 -0
  67. package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js → chunk-DUDLSQFG.js} +5 -5
  68. package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js → chunk-E7KBMWEF.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js → chunk-EAV3P54W.js} +9 -9
  70. package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js.map → chunk-EAV3P54W.js.map} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js → chunk-EEECAV5M.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js → chunk-EI3UIMZM.js} +4 -4
  73. package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js → chunk-EVAN5VJA.js} +8 -5
  74. package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js.map → chunk-EVAN5VJA.js.map} +2 -2
  75. package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js → chunk-FIUTBFC6.js} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js → chunk-FQF6VVPH.js} +4 -4
  77. package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js → chunk-FQO5THHM.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js → chunk-FQODDTE7.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js → chunk-G33XIMRT.js} +6 -6
  80. package/dist/cli-bundle/chunks/{chunk-D53RTYVI.js → chunk-GFZB5CLP.js} +20 -10
  81. package/dist/cli-bundle/chunks/chunk-GFZB5CLP.js.map +7 -0
  82. package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js → chunk-GKCEEXMA.js} +8 -8
  83. package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js → chunk-GRDK25BN.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js → chunk-H3YKUVDR.js} +5 -5
  85. package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js → chunk-IEMXESIS.js} +123 -16
  86. package/dist/cli-bundle/chunks/chunk-IEMXESIS.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js → chunk-IGBBTPM5.js} +2 -2
  88. package/dist/cli-bundle/chunks/{chunk-QPGQNLPI.js → chunk-IR3GOO6E.js} +3842 -4109
  89. package/dist/cli-bundle/chunks/chunk-IR3GOO6E.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js → chunk-IRJ6F23W.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js → chunk-IXG5CMBR.js} +4 -4
  92. package/dist/cli-bundle/chunks/{chunk-F3VC3GOV.js → chunk-JBW2S2C6.js} +2090 -253
  93. package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +7 -0
  94. package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js → chunk-JPWUZOMR.js} +2 -2
  95. package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js → chunk-K2L6FZBX.js} +8 -8
  96. package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js +286 -0
  97. package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-YQEZWI3R.js → chunk-KZ5AC6B5.js} +5 -3
  99. package/dist/cli-bundle/chunks/chunk-KZ5AC6B5.js.map +7 -0
  100. package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js → chunk-LT5UWU7H.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js → chunk-M4B4RK4J.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-QRZNCRNA.js → chunk-MI3346YW.js} +377 -240
  103. package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js → chunk-MQOSMBWV.js} +5 -5
  105. package/dist/cli-bundle/chunks/{chunk-YIIIAKCE.js → chunk-MRXAHR4B.js} +28 -22
  106. package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +1 -0
  107. package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js → chunk-N2TEEOXJ.js} +5 -5
  108. package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js → chunk-N7FCFJ76.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js → chunk-NPEYH6CE.js} +5 -5
  110. package/dist/cli-bundle/chunks/{chunk-GKPCTQYG.js → chunk-NTS2RKHN.js} +3942 -4216
  111. package/dist/cli-bundle/chunks/chunk-NTS2RKHN.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{chunk-6VHUGVNP.js → chunk-ODEIDKGW.js} +2062 -246
  113. package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-2CXL335K.js → chunk-OK7VSX3N.js} +3 -3
  115. package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js → chunk-OKPZDH43.js} +3 -3
  116. package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js → chunk-OKWJUL6F.js} +6 -6
  117. package/dist/cli-bundle/chunks/{chunk-HPAYDSR2.js → chunk-P24ZU5QV.js} +27 -21
  118. package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js → chunk-Q4PSG2GV.js} +13 -4
  120. package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js.map → chunk-Q4PSG2GV.js.map} +1 -1
  121. package/dist/cli-bundle/chunks/{chunk-5UKQLQM2.js → chunk-Q5NHJ6RO.js} +6 -4
  122. package/dist/cli-bundle/chunks/chunk-Q5NHJ6RO.js.map +1 -0
  123. package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js → chunk-Q6JPYR7I.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js → chunk-QFG4MB7P.js} +5 -5
  125. package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js.map → chunk-QFG4MB7P.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js → chunk-QQ77W23U.js} +4 -4
  127. package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js → chunk-QYGK2XQ3.js} +3 -3
  128. package/dist/cli-bundle/chunks/{chunk-646MQXFW.js → chunk-RLLOZAM2.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-646MQXFW.js.map → chunk-RLLOZAM2.js.map} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js → chunk-RWAIRGBC.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js → chunk-RX53WHFI.js} +3 -3
  132. package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js → chunk-SBW7EQC4.js} +5 -5
  133. package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js → chunk-SGJB6PXA.js} +3 -3
  134. package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js → chunk-STBCBDKF.js} +7 -7
  135. package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js → chunk-SUNZKVAH.js} +10 -10
  136. package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js.map → chunk-SUNZKVAH.js.map} +1 -1
  137. package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js → chunk-SVAWG7EE.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-6O44IN44.js → chunk-T6MOTLOJ.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js → chunk-TELI67UP.js} +9 -6
  140. package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js.map → chunk-TELI67UP.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js → chunk-U6RYD446.js} +11 -11
  142. package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js → chunk-UE7LK3RE.js} +5 -5
  143. package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js → chunk-UNNCT5QY.js} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js → chunk-UOIFZ66L.js} +3 -3
  145. package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js → chunk-UU6EP25G.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js → chunk-UW6HCMP2.js} +15 -15
  147. package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js → chunk-UWAQI3B7.js} +3 -3
  148. package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js → chunk-V4QHAMI5.js} +3 -3
  149. package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js → chunk-VA3H7VVC.js} +4 -4
  150. package/dist/cli-bundle/chunks/{chunk-XC2HEEOV.js → chunk-VFA5EIEN.js} +21 -11
  151. package/dist/cli-bundle/chunks/chunk-VFA5EIEN.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js → chunk-VQOG2ETB.js} +4 -4
  153. package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js → chunk-VSQE43NO.js} +8 -8
  154. package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js → chunk-W6IEJXNC.js} +2 -2
  155. package/dist/cli-bundle/chunks/{chunk-WACRQ26A.js → chunk-WCBB6VI3.js} +637 -9
  156. package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js → chunk-XDWXPG2E.js} +4 -4
  158. package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js → chunk-XKVHL3MB.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js → chunk-XVB6BATY.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js → chunk-XXWDEQ6O.js} +4 -4
  161. package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js → chunk-Y2VSGFT4.js} +8 -8
  162. package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js → chunk-YG56M3NE.js} +11 -11
  163. package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js → chunk-YGEA4CLH.js} +4 -4
  164. package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js → chunk-YIC5NGXF.js} +11 -11
  165. package/dist/cli-bundle/chunks/{chunk-DHNG452T.js → chunk-ZF52NVRT.js} +396 -245
  166. package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +7 -0
  167. package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js → chunk-ZUCBPXNA.js} +4 -4
  168. package/dist/cli-bundle/chunks/{close-X3CF6FQP.js → close-7NWA3GLA.js} +5 -5
  169. package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +12 -0
  170. package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +23 -0
  171. package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js → close-many-YALQ7AXS.js} +14 -14
  172. package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +13 -0
  173. package/dist/cli-bundle/chunks/{comments-TMHMALA5.js → comments-SQIQ5WYR.js} +7 -7
  174. package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +9 -0
  175. package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js → copy-YDAMENCP.js} +4 -4
  176. package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js → create-JSL6CXU3.js} +11 -9
  177. package/dist/cli-bundle/chunks/create-LXMLYJNM.js +29 -0
  178. package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +10 -0
  179. package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js → delete-IGVOZEU2.js} +4 -4
  180. package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js → deps-BQAXUQAK.js} +6 -6
  181. package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js → deps-CBPPSS6J.js} +6 -6
  182. package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +14 -0
  183. package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js → docs-NS2AZWCN.js} +7 -7
  184. package/dist/cli-bundle/chunks/{files-3PXGXYDB.js → files-PVWEPT5J.js} +7 -7
  185. package/dist/cli-bundle/chunks/{files-EGLKHD7O.js → files-XUUBQ76I.js} +7 -7
  186. package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +10 -0
  187. package/dist/cli-bundle/chunks/{focus-SRPASFTN.js → focus-DHBHKK3E.js} +5 -5
  188. package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js → history-compact-3TNPYVFG.js} +6 -6
  189. package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +16 -0
  190. package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js → history-redact-ELRL73XN.js} +4 -4
  191. package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js → history-redact-KKFDICCF.js} +4 -4
  192. package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js → history-repair-J7WKZFAG.js} +6 -6
  193. package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +16 -0
  194. package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +13 -0
  195. package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js → learnings-X4D6JCCG.js} +7 -7
  196. package/dist/cli-bundle/chunks/{notes-73JWKWUD.js → notes-UQC6VS6N.js} +7 -7
  197. package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +13 -0
  198. package/dist/cli-bundle/chunks/{plan-AZPMCG37.js → plan-5GKRBJJO.js} +12 -10
  199. package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +26 -0
  200. package/dist/cli-bundle/chunks/{profile-AVCIIZID.js → profile-5PQAPCLF.js} +10 -10
  201. package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js → profile-CW4BD3FO.js} +10 -10
  202. package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js → register-list-query-HTDQE6VI.js} +24 -24
  203. package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js → register-list-query-PHIPDFP2.js} +24 -24
  204. package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js → register-mutation-BLEWM5I6.js} +32 -32
  205. package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js → register-mutation-OTYHR7J6.js} +32 -32
  206. package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js → register-operations-AMCUFYEW.js} +38 -40
  207. package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js.map → register-operations-AMCUFYEW.js.map} +1 -1
  208. package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js → register-operations-MRLHOZYR.js} +36 -38
  209. package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js.map → register-operations-MRLHOZYR.js.map} +1 -1
  210. package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js → register-setup-N2FOSWAG.js} +15 -17
  211. package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js.map → register-setup-N2FOSWAG.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js → register-setup-ZVKTDL4G.js} +17 -19
  213. package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js.map → register-setup-ZVKTDL4G.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/restore-A55MLFAI.js +14 -0
  215. package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js → restore-HEQAG6EK.js} +6 -6
  216. package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js → schema-MAXAIHEC.js} +6 -6
  217. package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js → schema-Q5DAWJ2S.js} +6 -6
  218. package/dist/cli-bundle/chunks/update-5DTSCWVF.js +23 -0
  219. package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js → update-DWFXXJKP.js} +15 -13
  220. package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +34 -0
  221. package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +38 -0
  222. package/dist/cli-bundle/main.js +152 -29
  223. package/dist/cli-bundle/main.js.map +3 -3
  224. package/dist/cli-bundle/sdk-runtime.js +72 -75
  225. package/dist/cli-bundle/sdk-testing.js +8 -8
  226. package/dist/cli-bundle/sdk.js +288 -642
  227. package/dist/cli-bundle/sdk.js.map +4 -4
  228. package/dist/core/extensions/activation-summary.d.ts +2 -0
  229. package/dist/core/extensions/activation-summary.js +7 -2
  230. package/dist/core/extensions/activation-summary.js.map +1 -1
  231. package/dist/core/extensions/capability-usage.d.ts +1 -1
  232. package/dist/core/extensions/capability-usage.js +5 -2
  233. package/dist/core/extensions/capability-usage.js.map +1 -1
  234. package/dist/core/extensions/extension-hook-runtime.js +3 -2
  235. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  236. package/dist/core/extensions/extension-registries.js +3 -2
  237. package/dist/core/extensions/extension-registries.js.map +1 -1
  238. package/dist/core/extensions/extension-types.d.ts +38 -1
  239. package/dist/core/extensions/extension-types.js +3 -2
  240. package/dist/core/extensions/extension-types.js.map +1 -1
  241. package/dist/core/extensions/loader.js +36 -2
  242. package/dist/core/extensions/loader.js.map +1 -1
  243. package/dist/core/store/item-store.d.ts +4 -1
  244. package/dist/core/store/item-store.js +3 -3
  245. package/dist/core/store/item-store.js.map +1 -1
  246. package/dist/core/store/paths.d.ts +2 -0
  247. package/dist/core/store/paths.js +26 -3
  248. package/dist/core/store/paths.js.map +1 -1
  249. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  250. package/dist/sdk/compose.d.ts +3 -0
  251. package/dist/sdk/compose.js +14 -2
  252. package/dist/sdk/compose.js.map +1 -1
  253. package/dist/sdk/dependencies.js +3 -3
  254. package/dist/sdk/dependencies.js.map +1 -1
  255. package/dist/sdk/extension-command-context.d.ts +10 -0
  256. package/dist/sdk/extension-command-context.js +30 -0
  257. package/dist/sdk/extension-command-context.js.map +1 -0
  258. package/dist/sdk/graph/assembly.js +14 -4
  259. package/dist/sdk/graph/assembly.js.map +1 -1
  260. package/dist/sdk/graph/index.d.ts +1 -0
  261. package/dist/sdk/graph/index.js +3 -2
  262. package/dist/sdk/graph/index.js.map +1 -1
  263. package/dist/sdk/graph/mutation-advisory.d.ts +20 -0
  264. package/dist/sdk/graph/mutation-advisory.js +80 -0
  265. package/dist/sdk/graph/mutation-advisory.js.map +1 -0
  266. package/dist/sdk/graph/run.d.ts +5 -1
  267. package/dist/sdk/graph/run.js +11 -3
  268. package/dist/sdk/graph/run.js.map +1 -1
  269. package/dist/sdk/index.d.ts +4 -1
  270. package/dist/sdk/index.js +5 -2
  271. package/dist/sdk/index.js.map +1 -1
  272. package/dist/sdk/ownership-source.d.ts +2 -0
  273. package/dist/sdk/ownership-source.js +22 -0
  274. package/dist/sdk/ownership-source.js.map +1 -0
  275. package/dist/sdk/relationship-history.d.ts +38 -0
  276. package/dist/sdk/relationship-history.js +60 -2
  277. package/dist/sdk/relationship-history.js.map +1 -1
  278. package/dist/sdk/relationships.js +49 -8
  279. package/dist/sdk/relationships.js.map +1 -1
  280. package/dist/sdk/runtime-input.js +3 -2
  281. package/dist/sdk/runtime-input.js.map +1 -1
  282. package/dist/sdk/runtime.d.ts +2 -0
  283. package/dist/sdk/runtime.js +19 -2
  284. package/dist/sdk/runtime.js.map +1 -1
  285. package/dist/sdk/tracker-root-discovery.d.ts +6 -0
  286. package/dist/sdk/tracker-root-discovery.js +10 -0
  287. package/dist/sdk/tracker-root-discovery.js.map +1 -0
  288. package/dist/sdk/workspace-transaction.d.ts +83 -0
  289. package/dist/sdk/workspace-transaction.js +364 -0
  290. package/dist/sdk/workspace-transaction.js.map +1 -0
  291. package/docs/AGENT_UX_CONTRACTS.md +41 -0
  292. package/docs/EXTENSIONS.md +4 -4
  293. package/docs/README.md +1 -0
  294. package/docs/SDK.md +102 -1
  295. package/marketplace.json +2 -2
  296. package/package.json +1 -1
  297. package/packages/pm-beads/package.json +1 -1
  298. package/packages/pm-calendar/package.json +1 -1
  299. package/packages/pm-command-kit/package.json +1 -1
  300. package/packages/pm-governance-audit/package.json +1 -1
  301. package/packages/pm-guide-shell/package.json +1 -1
  302. package/packages/pm-kanban/package.json +1 -1
  303. package/packages/pm-lifecycle-hooks/package.json +1 -1
  304. package/packages/pm-linked-test-adapters/package.json +1 -1
  305. package/packages/pm-search-advanced/package.json +1 -1
  306. package/packages/pm-templates/package.json +1 -1
  307. package/packages/pm-todos/package.json +1 -1
  308. package/packages/pm-vcs/GAP_REPORT.md +31 -0
  309. package/packages/pm-vcs/README.md +62 -0
  310. package/packages/pm-vcs/extensions/vcs/index.ts +745 -0
  311. package/packages/pm-vcs/extensions/vcs/manifest.json +19 -0
  312. package/packages/pm-vcs/extensions/vcs/package.json +3 -0
  313. package/packages/pm-vcs/package.json +55 -0
  314. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  315. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  316. package/dist/cli-bundle/chunks/append-JHO5K6RP.js +0 -11
  317. package/dist/cli-bundle/chunks/chunk-2BX74BAS.js +0 -125
  318. package/dist/cli-bundle/chunks/chunk-2BX74BAS.js.map +0 -7
  319. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js +0 -672
  320. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +0 -7
  321. package/dist/cli-bundle/chunks/chunk-5UKQLQM2.js.map +0 -1
  322. package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +0 -1
  323. package/dist/cli-bundle/chunks/chunk-74FKFFXO.js +0 -172
  324. package/dist/cli-bundle/chunks/chunk-74FKFFXO.js.map +0 -7
  325. package/dist/cli-bundle/chunks/chunk-ADXDCAKP.js.map +0 -7
  326. package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js +0 -178
  327. package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js.map +0 -7
  328. package/dist/cli-bundle/chunks/chunk-D53RTYVI.js.map +0 -7
  329. package/dist/cli-bundle/chunks/chunk-DHNG452T.js.map +0 -7
  330. package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js +0 -1831
  331. package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js.map +0 -1
  332. package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +0 -7
  333. package/dist/cli-bundle/chunks/chunk-FL4D53ND.js +0 -162
  334. package/dist/cli-bundle/chunks/chunk-FL4D53ND.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-HPAYDSR2.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-KX62NMZC.js.map +0 -1
  340. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js +0 -662
  341. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +0 -7
  344. package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-QRZNCRNA.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js +0 -122
  347. package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js.map +0 -1
  348. package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js +0 -1841
  349. package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js.map +0 -7
  350. package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +0 -1
  351. package/dist/cli-bundle/chunks/chunk-WACRQ26A.js.map +0 -7
  352. package/dist/cli-bundle/chunks/chunk-XC2HEEOV.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +0 -1
  354. package/dist/cli-bundle/chunks/chunk-YIIIAKCE.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-YJSURTBB.js +0 -175
  356. package/dist/cli-bundle/chunks/chunk-YJSURTBB.js.map +0 -1
  357. package/dist/cli-bundle/chunks/chunk-YQEZWI3R.js.map +0 -7
  358. package/dist/cli-bundle/chunks/close-GPD7DTJV.js +0 -12
  359. package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +0 -23
  360. package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +0 -13
  361. package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +0 -9
  362. package/dist/cli-bundle/chunks/create-KOGQ3JKD.js +0 -27
  363. package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +0 -10
  364. package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +0 -14
  365. package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +0 -10
  366. package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +0 -16
  367. package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +0 -16
  368. package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +0 -13
  369. package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +0 -13
  370. package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +0 -24
  371. package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +0 -14
  372. package/dist/cli-bundle/chunks/update-XZJYS5X7.js +0 -21
  373. package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +0 -36
  374. package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +0 -32
  375. /package/dist/cli-bundle/chunks/{append-5YF3TO7I.js.map → append-MBXHNWSX.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{append-JHO5K6RP.js.map → append-XUYF7NON.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js.map → chunk-2UCG5H6B.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js.map → chunk-2XPDCXK5.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js.map → chunk-3HSRP6T2.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js.map → chunk-3KPNOZOH.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js.map → chunk-4M6RZJXF.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js.map → chunk-4PSJVGRE.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js.map → chunk-6BNV3G6C.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js.map → chunk-6V4T4RD3.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js.map → chunk-7B7IHMLH.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js.map → chunk-7CHWLT2J.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js.map → chunk-A3GAQLBH.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js.map → chunk-A4FVWFZY.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js.map → chunk-A5EQPNV7.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js.map → chunk-AGEBQRBG.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js.map → chunk-AQUNTB7G.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js.map → chunk-BBGR4FKQ.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js.map → chunk-BFJP4VYC.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-633PKXLT.js.map → chunk-BZKE2O5V.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js.map → chunk-DUDLSQFG.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js.map → chunk-E7KBMWEF.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js.map → chunk-EEECAV5M.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js.map → chunk-EI3UIMZM.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js.map → chunk-FIUTBFC6.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js.map → chunk-FQF6VVPH.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js.map → chunk-FQO5THHM.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js.map → chunk-FQODDTE7.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js.map → chunk-G33XIMRT.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js.map → chunk-GKCEEXMA.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js.map → chunk-GRDK25BN.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js.map → chunk-H3YKUVDR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js.map → chunk-IGBBTPM5.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js.map → chunk-IRJ6F23W.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js.map → chunk-IXG5CMBR.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js.map → chunk-JPWUZOMR.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js.map → chunk-K2L6FZBX.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js.map → chunk-LT5UWU7H.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js.map → chunk-M4B4RK4J.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js.map → chunk-MQOSMBWV.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js.map → chunk-N2TEEOXJ.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js.map → chunk-N7FCFJ76.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js.map → chunk-NPEYH6CE.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-2CXL335K.js.map → chunk-OK7VSX3N.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js.map → chunk-OKPZDH43.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js.map → chunk-OKWJUL6F.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js.map → chunk-Q6JPYR7I.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js.map → chunk-QQ77W23U.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js.map → chunk-QYGK2XQ3.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js.map → chunk-RWAIRGBC.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js.map → chunk-RX53WHFI.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js.map → chunk-SBW7EQC4.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js.map → chunk-SGJB6PXA.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js.map → chunk-STBCBDKF.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js.map → chunk-SVAWG7EE.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-6O44IN44.js.map → chunk-T6MOTLOJ.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js.map → chunk-U6RYD446.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js.map → chunk-UE7LK3RE.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js.map → chunk-UNNCT5QY.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js.map → chunk-UOIFZ66L.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js.map → chunk-UU6EP25G.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js.map → chunk-UW6HCMP2.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js.map → chunk-UWAQI3B7.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js.map → chunk-V4QHAMI5.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js.map → chunk-VA3H7VVC.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js.map → chunk-VQOG2ETB.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js.map → chunk-VSQE43NO.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js.map → chunk-W6IEJXNC.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js.map → chunk-XDWXPG2E.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js.map → chunk-XKVHL3MB.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js.map → chunk-XVB6BATY.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js.map → chunk-XXWDEQ6O.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js.map → chunk-Y2VSGFT4.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js.map → chunk-YG56M3NE.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js.map → chunk-YGEA4CLH.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js.map → chunk-YIC5NGXF.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js.map → chunk-ZUCBPXNA.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{close-X3CF6FQP.js.map → close-7NWA3GLA.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{close-GPD7DTJV.js.map → close-ZZCDDWJT.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{close-many-NQLYGPYW.js.map → close-many-QCZHFCON.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js.map → close-many-YALQ7AXS.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{comments-2AOZQ5D2.js.map → comments-FMQNYPSZ.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{comments-TMHMALA5.js.map → comments-SQIQ5WYR.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{copy-N3LCQBMC.js.map → copy-GI3RCVZP.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js.map → copy-YDAMENCP.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js.map → create-JSL6CXU3.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{create-KOGQ3JKD.js.map → create-LXMLYJNM.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{delete-6G3MBZ6S.js.map → delete-5DFAXJNI.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js.map → delete-IGVOZEU2.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js.map → deps-BQAXUQAK.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js.map → deps-CBPPSS6J.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{docs-OWRGDMNY.js.map → docs-KCWPLQOV.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js.map → docs-NS2AZWCN.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{files-3PXGXYDB.js.map → files-PVWEPT5J.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{files-EGLKHD7O.js.map → files-XUUBQ76I.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{focus-KZLIA6WS.js.map → focus-3EJVFI3D.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{focus-SRPASFTN.js.map → focus-DHBHKK3E.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js.map → history-compact-3TNPYVFG.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{history-compact-HHIUOMZ7.js.map → history-compact-JHYVDYLW.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js.map → history-redact-ELRL73XN.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js.map → history-redact-KKFDICCF.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js.map → history-repair-J7WKZFAG.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{history-repair-KG7SWXI6.js.map → history-repair-REMI7DDI.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{learnings-ZVHSALJY.js.map → learnings-O6V5WDCV.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js.map → learnings-X4D6JCCG.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{notes-73JWKWUD.js.map → notes-UQC6VS6N.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{notes-BAKUL5DJ.js.map → notes-ZSZREWZA.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{plan-AZPMCG37.js.map → plan-5GKRBJJO.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{plan-LEAGLPGP.js.map → plan-EZW2YDDY.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{profile-AVCIIZID.js.map → profile-5PQAPCLF.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js.map → profile-CW4BD3FO.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js.map → register-list-query-HTDQE6VI.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js.map → register-list-query-PHIPDFP2.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js.map → register-mutation-BLEWM5I6.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js.map → register-mutation-OTYHR7J6.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{restore-KIUYTAEJ.js.map → restore-A55MLFAI.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js.map → restore-HEQAG6EK.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js.map → schema-MAXAIHEC.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js.map → schema-Q5DAWJ2S.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{update-XZJYS5X7.js.map → update-5DTSCWVF.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js.map → update-DWFXXJKP.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{update-many-WQ3R3J6N.js.map → update-many-6T4ZLZS7.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{update-many-R24B3GBK.js.map → update-many-MYRK6VBJ.js.map} +0 -0
@@ -0,0 +1,745 @@
1
+ /**
2
+ * @module packages/pm-vcs/extensions/vcs/index
3
+ *
4
+ * A beyond-project-management exemplar that implements a small VCS-style
5
+ * changeset engine entirely through the published pm SDK and extension API.
6
+ */
7
+ import type {
8
+ PmClient,
9
+ RelationshipEventStore,
10
+ BeforeCommandHookContext,
11
+ CommandDefinition,
12
+ CommandHandlerContext,
13
+ ExtensionApi,
14
+ GetResult,
15
+ ItemMetadata,
16
+ ProjectProfileDefinition,
17
+ RelationshipEvent,
18
+ RelationshipEventProjection,
19
+ RelationshipKindDefinition,
20
+ SchemaFieldDefinition,
21
+ SchemaItemTypeDefinition,
22
+ WorkspaceTransactionStep,
23
+ WorkspaceTransactionJsonValue,
24
+ } from "@unbrained/pm-cli/sdk";
25
+
26
+ /** Declarative package manifest consumed by the extension loader. */
27
+ export const manifest = {
28
+ name: "builtin-vcs-exemplar",
29
+ version: "0.1.0",
30
+ entry: "./index.js",
31
+ priority: 0,
32
+ capabilities: ["commands", "schema", "hooks"],
33
+ };
34
+
35
+ /** Domain types contributed by the VCS exemplar. */
36
+ export const VCS_ITEM_TYPES = [
37
+ {
38
+ name: "Changeset",
39
+ folder: "changesets",
40
+ aliases: ["change", "commit"],
41
+ required_create_fields: ["vcs_ref", "vcs_tree_hash"],
42
+ },
43
+ {
44
+ name: "VcsRef",
45
+ folder: "refs",
46
+ aliases: ["branch", "vcs-ref"],
47
+ required_create_fields: ["vcs_ref"],
48
+ },
49
+ ] satisfies Array<
50
+ SchemaItemTypeDefinition & { folder: string; aliases: string[] }
51
+ >;
52
+
53
+ /** Domain metadata stored on changesets and refs without core schema changes. */
54
+ export const VCS_ITEM_FIELDS: SchemaFieldDefinition[] = [
55
+ { name: "vcs_ref", type: "string", optional: false },
56
+ { name: "vcs_tree_hash", type: "string", optional: true },
57
+ { name: "vcs_parent", type: "string", optional: true },
58
+ { name: "vcs_message", type: "string", optional: true },
59
+ ];
60
+
61
+ /** Custom relationship used by the package-owned immutable merge ledger. */
62
+ export const VCS_RELATIONSHIP_KIND: RelationshipKindDefinition = {
63
+ kind: "commits_to",
64
+ direction: "directed",
65
+ inverse: "contains_commit",
66
+ ordering: true,
67
+ precedence: "source_before_target",
68
+ hierarchy: false,
69
+ outgoing: "one",
70
+ incoming: "many",
71
+ lifecycle: "supersedable",
72
+ aliases: ["merged_into"],
73
+ compatibilityVersion: 1,
74
+ allowSelf: false,
75
+ };
76
+
77
+ /** Complete non-PM domain profile staged with `pm profile apply vcs`. */
78
+ export const vcsProfile: ProjectProfileDefinition = {
79
+ name: "vcs",
80
+ title: "VCS changeset workflow",
81
+ summary:
82
+ "Draft, propose, merge, and abandon changesets with immutable history and typed ref relationships.",
83
+ types: VCS_ITEM_TYPES.map((definition) => ({
84
+ name: definition.name,
85
+ folder: definition.folder,
86
+ aliases: [...definition.aliases],
87
+ })),
88
+ statuses: [
89
+ {
90
+ id: "proposed",
91
+ roles: ["active"],
92
+ aliases: ["review"],
93
+ description:
94
+ "Changeset is immutable for review and ready for a merge decision.",
95
+ },
96
+ {
97
+ id: "merged",
98
+ roles: ["terminal"],
99
+ aliases: ["committed"],
100
+ description: "Changeset was accepted into its target ref.",
101
+ },
102
+ {
103
+ id: "abandoned",
104
+ roles: ["terminal"],
105
+ aliases: ["rejected"],
106
+ description: "Changeset was deliberately retired without merging.",
107
+ },
108
+ ],
109
+ fields: VCS_ITEM_FIELDS.map((field) => ({
110
+ key: field.name,
111
+ type: field.type,
112
+ commands: ["create", "update", "list"],
113
+ description: `VCS exemplar field ${field.name}.`,
114
+ })),
115
+ workflows: [
116
+ {
117
+ type: "Changeset",
118
+ allowed_transitions: [
119
+ ["draft", "proposed"],
120
+ ["proposed", "draft"],
121
+ ["proposed", "merged"],
122
+ ["draft", "abandoned"],
123
+ ["proposed", "abandoned"],
124
+ ],
125
+ },
126
+ ],
127
+ config: [],
128
+ templates: [],
129
+ packages: [],
130
+ };
131
+
132
+ interface VcsListResult {
133
+ items: Array<Partial<ItemMetadata>>;
134
+ }
135
+
136
+ interface VcsLogState {
137
+ relationships: string[];
138
+ }
139
+
140
+ /** Structured output shared by VCS domain commands. */
141
+ export interface VcsCommandResult {
142
+ /** Stable domain action name. */
143
+ action: string;
144
+ /** Item or ref identifier affected by the command. */
145
+ id?: string;
146
+ /** Current domain status when one is available. */
147
+ status?: string;
148
+ /** Additional command-specific data. */
149
+ details?: Record<string, unknown>;
150
+ }
151
+
152
+ /** Return one required non-empty string option with a domain-focused error. */
153
+ function requiredOption(options: Record<string, unknown>, key: string): string {
154
+ const value =
155
+ options[key] ??
156
+ options[
157
+ key.replaceAll(/_([a-z])/g, (_match, letter: string) =>
158
+ letter.toUpperCase(),
159
+ )
160
+ ];
161
+ if (typeof value !== "string" || value.trim().length === 0)
162
+ throw new TypeError(`vcs requires --${key.replaceAll("_", "-")}`);
163
+ return value.trim();
164
+ }
165
+
166
+ /** Resolve the first non-empty positional argument. */
167
+ function requiredArgument(
168
+ context: CommandHandlerContext,
169
+ label: string,
170
+ ): string {
171
+ const value = context.args.find((argument) => !argument.startsWith("-"));
172
+ if (!value?.trim()) throw new TypeError(`vcs requires ${label}`);
173
+ return value.trim();
174
+ }
175
+
176
+ /** Require the host-bound public SDK services for one command invocation. */
177
+ function sdkFor(
178
+ context: CommandHandlerContext,
179
+ ): NonNullable<CommandHandlerContext["sdk"]> {
180
+ if (!context.sdk)
181
+ throw new TypeError("vcs requires the extension command SDK runtime");
182
+ return context.sdk;
183
+ }
184
+
185
+ /** Construct a tracker-bound SDK client for one extension command invocation. */
186
+ function clientFor(context: CommandHandlerContext): PmClient {
187
+ return sdkFor(context).client;
188
+ }
189
+
190
+ /** Read and validate one VCS-domain item. */
191
+ async function getVcsItem(
192
+ client: PmClient,
193
+ id: string,
194
+ expectedType: "Changeset" | "VcsRef",
195
+ ): Promise<GetResult> {
196
+ const result = await client.get(id, { depth: "deep" });
197
+ if (result.item.type !== expectedType)
198
+ throw new TypeError(`vcs expected ${expectedType} ${id}`);
199
+ return result;
200
+ }
201
+
202
+ /** Return every active VCS node id so the relationship store validates endpoints. */
203
+ async function listVcsNodes(client: PmClient): Promise<string[]> {
204
+ const results = await Promise.all(
205
+ ["Changeset", "VcsRef"].map(
206
+ async (type) =>
207
+ (await client.list({
208
+ type,
209
+ status: "all",
210
+ noTruncate: true,
211
+ })) as VcsListResult,
212
+ ),
213
+ );
214
+ return results
215
+ .flatMap((result) => result.items)
216
+ .map((item) => item.id)
217
+ .filter((id): id is string => typeof id === "string" && id.length > 0);
218
+ }
219
+
220
+ /** Open the package-owned durable relationship ledger. */
221
+ async function openVcsRelationshipStore(
222
+ context: CommandHandlerContext,
223
+ client: PmClient,
224
+ ): Promise<RelationshipEventStore> {
225
+ return sdkFor(context).openRelationshipEventStore({
226
+ nodes: await listVcsNodes(client),
227
+ definitions: [VCS_RELATIONSHIP_KIND],
228
+ relativePath: "relationships/vcs-events.jsonl",
229
+ });
230
+ }
231
+
232
+ /** Apply one legal VCS lifecycle transition. */
233
+ async function transitionChangeset(
234
+ context: CommandHandlerContext,
235
+ targetStatus: "proposed" | "abandoned",
236
+ ): Promise<VcsCommandResult> {
237
+ const id = requiredArgument(context, "a changeset id");
238
+ const client = clientFor(context);
239
+ const current = await getVcsItem(client, id, "Changeset");
240
+ const allowed =
241
+ targetStatus === "proposed"
242
+ ? current.item.status === "draft"
243
+ : current.item.status === "draft" || current.item.status === "proposed";
244
+ if (!allowed)
245
+ throw new TypeError(
246
+ `vcs cannot move ${id} from ${String(current.item.status)} to ${targetStatus}`,
247
+ );
248
+ await client.update(id, {
249
+ status: targetStatus,
250
+ message: `VCS transition to ${targetStatus}`,
251
+ ...(targetStatus === "abandoned"
252
+ ? { resolution: "Changeset abandoned by domain command" }
253
+ : {}),
254
+ });
255
+ return { action: `vcs-${targetStatus}`, id, status: targetStatus };
256
+ }
257
+
258
+ /** Create one ref item that can receive merged changesets. */
259
+ async function runRefCreate(
260
+ context: CommandHandlerContext,
261
+ ): Promise<VcsCommandResult> {
262
+ const name = requiredArgument(context, "a ref name");
263
+ const result = await clientFor(context).create({
264
+ title: `ref/${name}`,
265
+ type: "VcsRef",
266
+ status: "open",
267
+ field: [`vcs_ref=${name}`],
268
+ body: `# ${name}\n\nVCS exemplar ref.`,
269
+ });
270
+ return {
271
+ action: "vcs-ref-create",
272
+ id: result.item.id,
273
+ status: result.item.status,
274
+ };
275
+ }
276
+
277
+ /** Create one draft changeset through the public lifecycle SDK. */
278
+ async function runChangesetCreate(
279
+ context: CommandHandlerContext,
280
+ ): Promise<VcsCommandResult> {
281
+ const title = requiredArgument(context, "a changeset title");
282
+ const ref = requiredOption(context.options, "ref");
283
+ const treeHash = requiredOption(context.options, "tree_hash");
284
+ const parent =
285
+ typeof context.options.parent === "string" && context.options.parent.trim()
286
+ ? context.options.parent.trim()
287
+ : undefined;
288
+ const client = clientFor(context);
289
+ await getVcsItem(client, ref, "VcsRef");
290
+ const result = await client.create({
291
+ title,
292
+ type: "Changeset",
293
+ status: "draft",
294
+ field: [
295
+ `vcs_ref=${ref}`,
296
+ `vcs_tree_hash=${treeHash}`,
297
+ ...(parent === undefined ? [] : [`vcs_parent=${parent}`]),
298
+ ],
299
+ body: `# Changeset\n\n${title}`,
300
+ });
301
+ return {
302
+ action: "vcs-create",
303
+ id: result.item.id,
304
+ status: result.item.status,
305
+ };
306
+ }
307
+
308
+ /** Find one deterministic event in the durable merge ledger. */
309
+ async function findMergeEvent(
310
+ store: RelationshipEventStore,
311
+ eventId: string,
312
+ ): Promise<RelationshipEvent | undefined> {
313
+ for await (const batch of store.stream()) {
314
+ const event = batch.find((candidate) => candidate.eventId === eventId);
315
+ if (event !== undefined) return event;
316
+ }
317
+ return undefined;
318
+ }
319
+
320
+ /** Return the latest durable event for one logical merge relationship. */
321
+ async function findLatestMergeRelationshipEvent(
322
+ store: RelationshipEventStore,
323
+ relationshipId: string,
324
+ ): Promise<RelationshipEvent | undefined> {
325
+ let latest: RelationshipEvent | undefined;
326
+ for await (const batch of store.stream()) {
327
+ for (const event of batch) {
328
+ if (event.relationshipId === relationshipId) latest = event;
329
+ }
330
+ }
331
+ return latest;
332
+ }
333
+
334
+ /** Confirm that one deterministic event represents the requested VCS merge. */
335
+ function matchesRequestedMerge(
336
+ event: RelationshipEvent,
337
+ relationshipId: string,
338
+ source: string,
339
+ target: string,
340
+ ): boolean {
341
+ return (
342
+ event.action === "add" &&
343
+ event.relationshipId === relationshipId &&
344
+ event.edge?.source === source &&
345
+ event.edge.target === target &&
346
+ event.edge.kind === "commits_to"
347
+ );
348
+ }
349
+
350
+ function isNonEmptyString(value: unknown): value is string {
351
+ return typeof value === "string" && Boolean(value.trim());
352
+ }
353
+
354
+ function requiredChangesetRef(item: Partial<ItemMetadata>, id: string): string {
355
+ if (!isNonEmptyString(item.vcs_ref))
356
+ throw new TypeError(`vcs Changeset ${id} is missing vcs_ref`);
357
+ return item.vcs_ref.trim();
358
+ }
359
+
360
+ function matchesCommittedChangeset(
361
+ item: Partial<ItemMetadata>,
362
+ refId: string,
363
+ resolution: string,
364
+ ): boolean {
365
+ return (
366
+ item.status === "merged" &&
367
+ item.resolution === resolution &&
368
+ item.vcs_ref === refId
369
+ );
370
+ }
371
+
372
+ /** Restore a changeset only when this merge attempt still owns its exact item mutation. */
373
+ async function compensateChangesetMerge(
374
+ client: PmClient,
375
+ id: string,
376
+ refId: string,
377
+ resolution: string,
378
+ data: WorkspaceTransactionJsonValue | undefined,
379
+ ): Promise<void> {
380
+ if (
381
+ data === null ||
382
+ typeof data !== "object" ||
383
+ Array.isArray(data) ||
384
+ !isNonEmptyString(data.originalRef)
385
+ )
386
+ throw new TypeError(`vcs merge compensation data is invalid for ${id}`);
387
+ const current = await getVcsItem(client, id, "Changeset");
388
+ if (!matchesCommittedChangeset(current.item, refId, resolution)) return;
389
+ await client.update(id, {
390
+ status: "proposed",
391
+ unset: ["resolution", "close-reason"],
392
+ message: `Compensate interrupted VCS merge into ${refId}`,
393
+ field: [`vcs_ref=${data.originalRef.trim()}`],
394
+ });
395
+ }
396
+
397
+ /** Append or reconcile one concurrently won deterministic merge event. */
398
+ async function ensureMergeEvent(
399
+ store: RelationshipEventStore,
400
+ id: string,
401
+ refId: string,
402
+ author: string,
403
+ ): Promise<RelationshipEvent> {
404
+ const eventId = `merge-${id}`;
405
+ const relationshipId = `changeset-${id}`;
406
+ try {
407
+ return await store.append({
408
+ eventId,
409
+ relationshipId,
410
+ action: "add",
411
+ edge: { source: id, target: refId, kind: "commits_to" },
412
+ author,
413
+ timestamp: new Date().toISOString(),
414
+ reason: "Reviewed VCS changeset merge",
415
+ });
416
+ } catch (error) {
417
+ if (
418
+ !(error instanceof TypeError) ||
419
+ !error.message.includes(`event already exists: ${eventId}`)
420
+ )
421
+ throw error;
422
+ const winner = await findMergeEvent(store, eventId);
423
+ if (
424
+ winner === undefined ||
425
+ !matchesRequestedMerge(winner, relationshipId, id, refId)
426
+ )
427
+ throw new TypeError(`vcs merge event conflicts with changeset ${id}`, {
428
+ cause: error,
429
+ });
430
+ return winner;
431
+ }
432
+ }
433
+
434
+ /** Merge one proposed changeset and append its attributable ref relationship. */
435
+ async function runChangesetMerge(
436
+ context: CommandHandlerContext,
437
+ ): Promise<VcsCommandResult> {
438
+ const id = requiredArgument(context, "a changeset id");
439
+ const refId = requiredOption(context.options, "ref");
440
+ const client = clientFor(context);
441
+ const changeset = await getVcsItem(client, id, "Changeset");
442
+ await getVcsItem(client, refId, "VcsRef");
443
+ requiredChangesetRef(changeset.item, id);
444
+ const resolution = `Merged into ${refId}`;
445
+ if (
446
+ changeset.item.status !== "proposed" &&
447
+ !matchesCommittedChangeset(changeset.item, refId, resolution)
448
+ )
449
+ throw new TypeError(`vcs merge requires proposed changeset ${id}`);
450
+ const store = await openVcsRelationshipStore(context, client);
451
+ const author = isNonEmptyString(context.global.author)
452
+ ? context.global.author.trim()
453
+ : "pm-vcs";
454
+ const eventId = `merge-${id}`;
455
+ const relationshipId = `changeset-${id}`;
456
+ const steps: WorkspaceTransactionStep[] = [
457
+ {
458
+ id: "merge-item",
459
+ inspect: async () => {
460
+ const current = await getVcsItem(client, id, "Changeset");
461
+ return matchesCommittedChangeset(current.item, refId, resolution)
462
+ ? {
463
+ state: "applied",
464
+ result: { id, status: "merged", resolution },
465
+ }
466
+ : { state: "pending" };
467
+ },
468
+ prepareCompensation: async () => {
469
+ const current = await getVcsItem(client, id, "Changeset");
470
+ if (current.item.status !== "proposed")
471
+ throw new TypeError(`vcs merge requires proposed changeset ${id}`);
472
+ return { originalRef: requiredChangesetRef(current.item, id) };
473
+ },
474
+ apply: async () => {
475
+ await client.update(id, {
476
+ status: "merged",
477
+ resolution,
478
+ message: `VCS merge into ${refId}`,
479
+ field: [`vcs_ref=${refId}`],
480
+ });
481
+ return { id, status: "merged", resolution };
482
+ },
483
+ compensate: (data) =>
484
+ compensateChangesetMerge(client, id, refId, resolution, data),
485
+ },
486
+ {
487
+ id: "merge-relationship",
488
+ inspect: async () => {
489
+ const event = await findLatestMergeRelationshipEvent(
490
+ store,
491
+ relationshipId,
492
+ );
493
+ if (event === undefined) return { state: "pending" };
494
+ if (event.action === "remove") return { state: "compensated" };
495
+ if (!matchesRequestedMerge(event, relationshipId, id, refId))
496
+ throw new TypeError(`vcs merge event conflicts with changeset ${id}`);
497
+ return {
498
+ state: "applied",
499
+ result: {
500
+ eventId: event.eventId,
501
+ relationshipId,
502
+ sequence: event.sequence,
503
+ },
504
+ };
505
+ },
506
+ apply: async () => {
507
+ const latest = await findLatestMergeRelationshipEvent(
508
+ store,
509
+ relationshipId,
510
+ );
511
+ const event =
512
+ latest?.action === "remove"
513
+ ? await store.append({
514
+ eventId: `retry-${eventId}-${latest.sequence}`,
515
+ relationshipId,
516
+ action: "add",
517
+ edge: { source: id, target: refId, kind: "commits_to" },
518
+ author,
519
+ timestamp: new Date().toISOString(),
520
+ reason: "Retry compensated VCS changeset merge",
521
+ })
522
+ : await ensureMergeEvent(store, id, refId, author);
523
+ return {
524
+ eventId: event.eventId,
525
+ relationshipId,
526
+ sequence: event.sequence,
527
+ };
528
+ },
529
+ compensate: async () => {
530
+ const latest = await findLatestMergeRelationshipEvent(
531
+ store,
532
+ relationshipId,
533
+ );
534
+ if (
535
+ latest === undefined ||
536
+ !matchesRequestedMerge(latest, relationshipId, id, refId)
537
+ )
538
+ return;
539
+ await store.append({
540
+ eventId: `rollback-${eventId}-${latest.sequence}`,
541
+ relationshipId,
542
+ action: "remove",
543
+ author,
544
+ timestamp: new Date().toISOString(),
545
+ reason: `Compensate interrupted VCS merge into ${refId}`,
546
+ });
547
+ },
548
+ },
549
+ ];
550
+ await sdkFor(context).commitWorkspaceTransaction({
551
+ transactionId: `vcs-merge-${id}-${refId}`,
552
+ author,
553
+ steps,
554
+ });
555
+ const reconciledChangeset = await getVcsItem(client, id, "Changeset");
556
+ const relationship = await findLatestMergeRelationshipEvent(
557
+ store,
558
+ relationshipId,
559
+ );
560
+ if (
561
+ !matchesCommittedChangeset(reconciledChangeset.item, refId, resolution) ||
562
+ relationship === undefined ||
563
+ !matchesRequestedMerge(relationship, relationshipId, id, refId)
564
+ )
565
+ throw new TypeError(`vcs merge transaction did not commit changeset ${id}`);
566
+ return {
567
+ action: "vcs-merge",
568
+ id,
569
+ status: String(reconciledChangeset.item.status),
570
+ details: { ref: refId, event: relationship },
571
+ };
572
+ }
573
+
574
+ /** Reconstruct one changeset from immutable item history or return current state. */
575
+ async function runChangesetShow(
576
+ context: CommandHandlerContext,
577
+ ): Promise<VcsCommandResult> {
578
+ const id = requiredArgument(context, "a changeset id");
579
+ const target =
580
+ typeof context.options.at === "string" && context.options.at.trim()
581
+ ? context.options.at.trim()
582
+ : undefined;
583
+ if (target === undefined) {
584
+ const result = await getVcsItem(clientFor(context), id, "Changeset");
585
+ return {
586
+ action: "vcs-show",
587
+ id,
588
+ status: result.item.status,
589
+ details: { item: result.item, reconstructed: false },
590
+ };
591
+ }
592
+ const replay = await sdkFor(context).getItemAt(id, target);
593
+ if (replay.document.metadata.type !== "Changeset")
594
+ throw new TypeError(`vcs expected Changeset ${id}`);
595
+ return {
596
+ action: "vcs-show",
597
+ id,
598
+ status: replay.document.metadata.status,
599
+ details: { ...replay },
600
+ };
601
+ }
602
+
603
+ /** Project the immutable merge ledger into a compact ref-to-changeset log. */
604
+ async function runVcsLog(
605
+ context: CommandHandlerContext,
606
+ ): Promise<VcsCommandResult> {
607
+ const client = clientFor(context);
608
+ const store = await openVcsRelationshipStore(context, client);
609
+ const projection: RelationshipEventProjection<VcsLogState> =
610
+ await store.project({ relationships: [] as string[] }, (state, event) => ({
611
+ relationships:
612
+ event.action === "remove" || event.edge === undefined
613
+ ? state.relationships.filter(
614
+ (entry) => !entry.startsWith(`${event.relationshipId}:`),
615
+ )
616
+ : [
617
+ ...state.relationships.filter(
618
+ (entry) => !entry.startsWith(`${event.relationshipId}:`),
619
+ ),
620
+ `${event.relationshipId}:${event.edge.source}->${event.edge.target}`,
621
+ ].sort(),
622
+ }));
623
+ return {
624
+ action: "vcs-log",
625
+ details: {
626
+ version: projection.version,
627
+ processed: projection.processed,
628
+ relationships: projection.state.relationships,
629
+ },
630
+ };
631
+ }
632
+
633
+ const ID_ARGUMENT = [
634
+ { name: "id", required: true, description: "Changeset identifier." },
635
+ ];
636
+
637
+ /** Build every VCS domain command definition from one contract table. */
638
+ export function buildVcsCommands(): CommandDefinition[] {
639
+ return [
640
+ {
641
+ name: "vcs ref-create",
642
+ action: "vcs-ref-create",
643
+ description: "Create a VCS ref through the public pm lifecycle SDK.",
644
+ arguments: [{ name: "name", required: true, description: "Ref name." }],
645
+ run: runRefCreate,
646
+ },
647
+ {
648
+ name: "vcs create",
649
+ action: "vcs-create",
650
+ description: "Create a draft changeset.",
651
+ arguments: [
652
+ { name: "title", required: true, description: "Changeset title." },
653
+ ],
654
+ flags: [
655
+ {
656
+ long: "--ref",
657
+ value_name: "id",
658
+ value_type: "string",
659
+ required: true,
660
+ },
661
+ {
662
+ long: "--tree-hash",
663
+ value_name: "hash",
664
+ value_type: "string",
665
+ required: true,
666
+ },
667
+ { long: "--parent", value_name: "id", value_type: "string" },
668
+ ],
669
+ run: runChangesetCreate,
670
+ },
671
+ {
672
+ name: "vcs propose",
673
+ action: "vcs-propose",
674
+ description: "Move a draft changeset into review.",
675
+ arguments: ID_ARGUMENT,
676
+ run: (context) => transitionChangeset(context, "proposed"),
677
+ },
678
+ {
679
+ name: "vcs merge",
680
+ action: "vcs-merge",
681
+ description: "Merge a reviewed changeset into a ref.",
682
+ arguments: ID_ARGUMENT,
683
+ flags: [
684
+ {
685
+ long: "--ref",
686
+ value_name: "id",
687
+ value_type: "string",
688
+ required: true,
689
+ },
690
+ {
691
+ long: "--reviewed",
692
+ value_type: "boolean",
693
+ required: true,
694
+ description: "Affirm the package hook-enforced review invariant.",
695
+ },
696
+ ],
697
+ run: runChangesetMerge,
698
+ },
699
+ {
700
+ name: "vcs abandon",
701
+ action: "vcs-abandon",
702
+ description: "Retire a draft or proposed changeset.",
703
+ arguments: ID_ARGUMENT,
704
+ run: (context) => transitionChangeset(context, "abandoned"),
705
+ },
706
+ {
707
+ name: "vcs show",
708
+ action: "vcs-show",
709
+ description: "Read current or point-in-time changeset state.",
710
+ arguments: ID_ARGUMENT,
711
+ flags: [
712
+ { long: "--at", value_name: "version-or-time", value_type: "string" },
713
+ ],
714
+ run: runChangesetShow,
715
+ },
716
+ {
717
+ name: "vcs log",
718
+ action: "vcs-log",
719
+ description: "Project the immutable merge relationship stream.",
720
+ run: runVcsLog,
721
+ },
722
+ ];
723
+ }
724
+
725
+ /** Hook-enforced merge rule: domain merges require an explicit review affirmation. */
726
+ export function enforceVcsMergePolicy(context: BeforeCommandHookContext): void {
727
+ if (context.command !== "vcs merge") return;
728
+ if (context.options?.reviewed !== true)
729
+ throw new TypeError("vcs merge requires --reviewed");
730
+ }
731
+
732
+ /** Register schema, profile, domain commands, and merge-policy hook. */
733
+ export function activate(api: ExtensionApi): void {
734
+ api.registerItemFields(VCS_ITEM_FIELDS);
735
+ api.registerItemTypes(VCS_ITEM_TYPES);
736
+ api.registerRelationshipKinds([VCS_RELATIONSHIP_KIND]);
737
+ api.registerProfile(vcsProfile);
738
+ for (const command of buildVcsCommands()) api.registerCommand(command);
739
+ api.hooks.beforeCommand(enforceVcsMergePolicy);
740
+ }
741
+
742
+ /** No process-global resources are retained by the package. */
743
+ export function deactivate(): void {}
744
+
745
+ export default { manifest, activate, deactivate };