diffing 0.7.0 → 0.9.0

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 (241) hide show
  1. package/README.md +52 -18
  2. package/dist/{cli-agent-D71pq2ep.mjs → cli-agent-CLrK54k2.mjs} +2 -2
  3. package/dist/{cli-gh-D5OCnjNe.mjs → cli-gh-8YC1NzyM.mjs} +6 -1
  4. package/dist/cli.mjs +3 -3
  5. package/dist/client/assets/{angular-html-Dh86jUvr.js → angular-html-DdAR2u-k.js} +1 -1
  6. package/dist/client/assets/{angular-ts-Bh4wRJtT.js → angular-ts-Dz_vWKSu.js} +1 -1
  7. package/dist/client/assets/{apl-BSXBHduT.js → apl-BJ5QXrIk.js} +1 -1
  8. package/dist/client/assets/{arc-CRQlhBrV.js → arc-D9erSW6x.js} +1 -1
  9. package/dist/client/assets/{architectureDiagram-3BPJPVTR-BXq3UvEv.js → architectureDiagram-3BPJPVTR-CCQWZLXR.js} +1 -1
  10. package/dist/client/assets/{astro-Bh00klUw.js → astro-BQAej5a5.js} +1 -1
  11. package/dist/client/assets/{blade-CisA3zhm.js → blade-DkAmuwDx.js} +1 -1
  12. package/dist/client/assets/{blockDiagram-GPEHLZMM-Bw-PTAJr.js → blockDiagram-GPEHLZMM-vwjxNybI.js} +1 -1
  13. package/dist/client/assets/{c-D-pHVWrf.js → c-DG5p-ChJ.js} +1 -1
  14. package/dist/client/assets/{c4Diagram-AAUBKEIU-C0XyiqC_.js → c4Diagram-AAUBKEIU-DJ_hVlh4.js} +1 -1
  15. package/dist/client/assets/channel-DmZgR6r0.js +1 -0
  16. package/dist/client/assets/{chunk-2J33WTMH-DekjZXNj.js → chunk-2J33WTMH-CiLowxCo.js} +1 -1
  17. package/dist/client/assets/{chunk-3OPIFGDE-BtROpcL8.js → chunk-3OPIFGDE-H3jjMR5Y.js} +1 -1
  18. package/dist/client/assets/{chunk-4BX2VUAB-C92XLTlx.js → chunk-4BX2VUAB-Dk0dk4n5.js} +1 -1
  19. package/dist/client/assets/{chunk-55IACEB6-CceUgh8N.js → chunk-55IACEB6-nbLiUMJS.js} +1 -1
  20. package/dist/client/assets/{chunk-5ZQYHXKU-DSbYPAe7.js → chunk-5ZQYHXKU-DZ8RgHg8.js} +1 -1
  21. package/dist/client/assets/{chunk-727SXJPM-DVzUJa-9.js → chunk-727SXJPM-DDe5dqJV.js} +1 -1
  22. package/dist/client/assets/{chunk-AQP2D5EJ-6n3Z_IFa.js → chunk-AQP2D5EJ-DmpNclOr.js} +1 -1
  23. package/dist/client/assets/{chunk-BSJP7CBP-BgVLnkxr.js → chunk-BSJP7CBP-BKQKvtIj.js} +1 -1
  24. package/dist/client/assets/{chunk-CSCIHK7Q-CkGMXntp.js → chunk-CSCIHK7Q-D27t4cyv.js} +1 -1
  25. package/dist/client/assets/{chunk-FMBD7UC4-BM8lrLBo.js → chunk-FMBD7UC4-Bu3LA663.js} +1 -1
  26. package/dist/client/assets/{chunk-KSCS5N6A-Bm2pjMQg.js → chunk-KSCS5N6A-Ed5HNXRW.js} +1 -1
  27. package/dist/client/assets/{chunk-L5ZTLDWV-VL17ikXM.js → chunk-L5ZTLDWV-DLjJZgf8.js} +1 -1
  28. package/dist/client/assets/{chunk-LZXEDZCA-B629g67M.js → chunk-LZXEDZCA-B-cs89SM.js} +2 -2
  29. package/dist/client/assets/{chunk-ND2GUHAM-CjZGwhKA.js → chunk-ND2GUHAM-D_kPSuUA.js} +1 -1
  30. package/dist/client/assets/{chunk-NZK2D7GU-DGsLjESY.js → chunk-NZK2D7GU-D1u3pjq-.js} +1 -1
  31. package/dist/client/assets/{chunk-O5CBEL6O-EyUrGY3l.js → chunk-O5CBEL6O-Mt0cnPSf.js} +1 -1
  32. package/dist/client/assets/chunk-QZHKN3VN-BrYnBs7h.js +1 -0
  33. package/dist/client/assets/chunk-WU5MYG2G-CdBcsQs_.js +1 -0
  34. package/dist/client/assets/{chunk-XPW4576I-C2TeAQmQ.js → chunk-XPW4576I-Bt8a8x28.js} +1 -1
  35. package/dist/client/assets/classDiagram-4FO5ZUOK-CCpp3t5M.js +1 -0
  36. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-B1aV1sYb.js +1 -0
  37. package/dist/client/assets/{cobol-DsRZMP16.js → cobol-Daidj_5Y.js} +1 -1
  38. package/dist/client/assets/{coffee-DP0-MMsE.js → coffee-DUMdB2Cr.js} +1 -1
  39. package/dist/client/assets/{cose-bilkent-S5V4N54A-DMmK0b0W.js → cose-bilkent-S5V4N54A-DVUDLXie.js} +1 -1
  40. package/dist/client/assets/{cpp-B6XYbbze.js → cpp-C2FeX1Mc.js} +1 -1
  41. package/dist/client/assets/{crystal-dBLPFLMp.js → crystal-D4yb9blJ.js} +1 -1
  42. package/dist/client/assets/{css-tgwuSZL0.js → css-B5cr0U9F.js} +1 -1
  43. package/dist/client/assets/{dagre-BM42HDAG-CgNkf0TR.js → dagre-BM42HDAG-DdZWb-Ee.js} +1 -1
  44. package/dist/client/assets/{diagram-2AECGRRQ-ocAqn0LV.js → diagram-2AECGRRQ-C9DOZt92.js} +1 -1
  45. package/dist/client/assets/{diagram-5GNKFQAL-CB1Yo4Gc.js → diagram-5GNKFQAL-Bbc07UKr.js} +1 -1
  46. package/dist/client/assets/{diagram-KO2AKTUF-B2vpMBRT.js → diagram-KO2AKTUF-C-lUzY3m.js} +1 -1
  47. package/dist/client/assets/{diagram-LMA3HP47-DuxZOaQS.js → diagram-LMA3HP47-D-OjEFhp.js} +1 -1
  48. package/dist/client/assets/{diagram-OG6HWLK6-CkShDmcv.js → diagram-OG6HWLK6-BjtWGvrf.js} +1 -1
  49. package/dist/client/assets/{dist-BgZIvk5w.js → dist-BXZygPdX.js} +1 -1
  50. package/dist/client/assets/{edge-Bokubn8E.js → edge-RCQWcWNp.js} +1 -1
  51. package/dist/client/assets/{elixir-BEzcf3Xg.js → elixir-DwKyVg2X.js} +1 -1
  52. package/dist/client/assets/{elm-vJyLTAER.js → elm-DjR33IVs.js} +1 -1
  53. package/dist/client/assets/{erDiagram-TEJ5UH35-BFV1NQAH.js → erDiagram-TEJ5UH35-C5T4ywLG.js} +1 -1
  54. package/dist/client/assets/{erb-DDkAmjBS.js → erb-BnhUH1Hk.js} +1 -1
  55. package/dist/client/assets/{flowDiagram-I6XJVG4X-DU8xbFdO.js → flowDiagram-I6XJVG4X-BJmjm7Kx.js} +1 -1
  56. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DCb7Qh0c.js → ganttDiagram-6RSMTGT7-DREPnzu5.js} +1 -1
  57. package/dist/client/assets/{git-rebase-DWcifAdK.js → git-rebase-DzXoSDXA.js} +1 -1
  58. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C_Tw-piE.js → gitGraphDiagram-PVQCEYII-DIR4G_-_.js} +1 -1
  59. package/dist/client/assets/{glimmer-js--HDru5ys.js → glimmer-js-HKnZpCn_.js} +1 -1
  60. package/dist/client/assets/{glimmer-ts-DAdXisHh.js → glimmer-ts-DedV7rWs.js} +1 -1
  61. package/dist/client/assets/{glsl-CmIRlJht.js → glsl-Bz-0Alp2.js} +1 -1
  62. package/dist/client/assets/{graphql-tx4-7I3U.js → graphql-DSKkDYCD.js} +1 -1
  63. package/dist/client/assets/{hack-yA0XjhF7.js → hack-CnaHZm8k.js} +1 -1
  64. package/dist/client/assets/{haml-BR5MUE1b.js → haml-huGFYKlj.js} +1 -1
  65. package/dist/client/assets/{handlebars-BPOF7iOf.js → handlebars-CKmgzfWY.js} +1 -1
  66. package/dist/client/assets/{html-BbteRk96.js → html-B9Ih_dUU.js} +1 -1
  67. package/dist/client/assets/{html-derivative-59NNrcMm.js → html-derivative-YabD-M5d.js} +1 -1
  68. package/dist/client/assets/{http-D3odGQI4.js → http-Bdu12JYX.js} +1 -1
  69. package/dist/client/assets/{hurl-BLTj8fPj.js → hurl-twZzDTNs.js} +1 -1
  70. package/dist/client/assets/{index-DHXpO7eS.js → index-BktdZRWB.js} +122 -118
  71. package/dist/client/assets/{index-BZcKS8Sb.css → index-YlwaPTSG.css} +1 -1
  72. package/dist/client/assets/{infoDiagram-5YYISTIA-CI6hJyRl.js → infoDiagram-5YYISTIA-D2ty2R-i.js} +1 -1
  73. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-gMS1P1LQ.js → ishikawaDiagram-YF4QCWOH-Ccnc9xlE.js} +1 -1
  74. package/dist/client/assets/{java-CsViuzs_.js → java-_5trO-p9.js} +1 -1
  75. package/dist/client/assets/{javascript-DQgsl2Dh.js → javascript-BOQn0ikE.js} +1 -1
  76. package/dist/client/assets/{jinja-DQNp2NUA.js → jinja-BgY-0IBz.js} +1 -1
  77. package/dist/client/assets/{jison-CDDOZQdc.js → jison-BLNTmT1_.js} +1 -1
  78. package/dist/client/assets/{journeyDiagram-JHISSGLW-BTQ_Ws_h.js → journeyDiagram-JHISSGLW-W7eWXlw0.js} +1 -1
  79. package/dist/client/assets/{json-DP4TqCuE.js → json-BLbH8rZf.js} +1 -1
  80. package/dist/client/assets/{jsx-Df5hn0Tf.js → jsx-CxteptsJ.js} +1 -1
  81. package/dist/client/assets/{julia--u33yGLi.js → julia-B__Ncp_z.js} +1 -1
  82. package/dist/client/assets/{just-BCpMmSOD.js → just-DBsHUGW1.js} +1 -1
  83. package/dist/client/assets/{kanban-definition-UN3LZRKU-CvqGbLR_.js → kanban-definition-UN3LZRKU-Z_AFL-rd.js} +1 -1
  84. package/dist/client/assets/{latex-D8D4jZGw.js → latex-DFF_0wxo.js} +1 -1
  85. package/dist/client/assets/{line-DBgaS_RW.js → line-aAv8TyOs.js} +1 -1
  86. package/dist/client/assets/{linear-RQVzKNVU.js → linear-BOvEZKH8.js} +1 -1
  87. package/dist/client/assets/{liquid-CkH85f12.js → liquid-kDWCO6d7.js} +1 -1
  88. package/dist/client/assets/{lua-iKoV7WE3.js → lua-CYTFayq-.js} +1 -1
  89. package/dist/client/assets/{marko-N8ScQSqT.js → marko-Dpmz3Pdx.js} +1 -1
  90. package/dist/client/assets/{mdc-BvHTOxsp.js → mdc-BsxHyM1i.js} +1 -1
  91. package/dist/client/assets/{mermaid-parser.core-CwDRwMR7.js → mermaid-parser.core-D8z_CWL1.js} +1 -1
  92. package/dist/client/assets/{mermaid.core-D2LDJgXO.js → mermaid.core-DNKchnly.js} +3 -3
  93. package/dist/client/assets/{mindmap-definition-RKZ34NQL-FRnPh642.js → mindmap-definition-RKZ34NQL-xQKMV4Kw.js} +1 -1
  94. package/dist/client/assets/{nginx-DGgvASuI.js → nginx-CcdTDme-.js} +1 -1
  95. package/dist/client/assets/{nim-D-v9hzvR.js → nim-B5wWDskL.js} +1 -1
  96. package/dist/client/assets/{perl-CG8leJ8K.js → perl-Ce2_iKLz.js} +1 -1
  97. package/dist/client/assets/{php-DvkeSP10.js → php-DuLCFERd.js} +1 -1
  98. package/dist/client/assets/{pieDiagram-4H26LBE5-CepOg38Y.js → pieDiagram-4H26LBE5-CBSCJnUr.js} +1 -1
  99. package/dist/client/assets/{pug-B4T7-xaL.js → pug-BfQJoQj1.js} +1 -1
  100. package/dist/client/assets/{qml-BE6D5Bxn.js → qml-DYeovlVl.js} +1 -1
  101. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-DOFAsP60.js → quadrantDiagram-W4KKPZXB-uEcgb0Rm.js} +1 -1
  102. package/dist/client/assets/{r-BKZg9Mcq.js → r-DgHSP56L.js} +1 -1
  103. package/dist/client/assets/{razor-D-02oaxL.js → razor-B00x7W-i.js} +1 -1
  104. package/dist/client/assets/{regexp-BDFvAR1k.js → regexp-CmWVupmd.js} +1 -1
  105. package/dist/client/assets/{requirementDiagram-4Y6WPE33-BBVNH-2W.js → requirementDiagram-4Y6WPE33-Q4yY_ALe.js} +1 -1
  106. package/dist/client/assets/{review-export-D5iIl46_.js → review-export-pcqDKNqx.js} +1 -1
  107. package/dist/client/assets/{rst-BcT26OSj.js → rst-B3VARbTX.js} +1 -1
  108. package/dist/client/assets/{ruby-Cq_YQvFT.js → ruby-CaxKSSbT.js} +1 -1
  109. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BQfCTbBX.js → sankeyDiagram-5OEKKPKP-B-GLzFGa.js} +1 -1
  110. package/dist/client/assets/{sas-DN9oTxKY.js → sas-Ue0rHUIk.js} +1 -1
  111. package/dist/client/assets/{scss-BK_sp3z2.js → scss-BJJ7_L6c.js} +1 -1
  112. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CKAW2eyx.js → sequenceDiagram-3UESZ5HK-DW0em0D_.js} +1 -1
  113. package/dist/client/assets/{shellscript-CvNpOu0J.js → shellscript-C6LkZs1u.js} +1 -1
  114. package/dist/client/assets/{shellsession-8-yj2cJj.js → shellsession-CkZu1e84.js} +1 -1
  115. package/dist/client/assets/{soy-C6Q9atPF.js → soy-CDaZV57J.js} +1 -1
  116. package/dist/client/assets/{sql-CBL3BuHb.js → sql-CLfMGH4x.js} +1 -1
  117. package/dist/client/assets/{src-D-VUWIK5.js → src-C27zxuNO.js} +1 -1
  118. package/dist/client/assets/{stata-B2Q7Vqzu.js → stata-B0kNMHc9.js} +1 -1
  119. package/dist/client/assets/{stateDiagram-AJRCARHV-BGJiv0qO.js → stateDiagram-AJRCARHV-CrO_D3m4.js} +1 -1
  120. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-C9KDGD7R.js +1 -0
  121. package/dist/client/assets/{surrealql-C-A2N8vk.js → surrealql-D9os_yZO.js} +1 -1
  122. package/dist/client/assets/{svelte-VAut_-uy.js → svelte-2SxVToeO.js} +1 -1
  123. package/dist/client/assets/{templ-mUetM--K.js → templ-DzmZB67T.js} +1 -1
  124. package/dist/client/assets/{tex-BT53mWGp.js → tex-BMPk3nHk.js} +1 -1
  125. package/dist/client/assets/{timeline-definition-PNZ67QCA-lVwMt1rk.js → timeline-definition-PNZ67QCA-C9FBevHv.js} +1 -1
  126. package/dist/client/assets/{ts-tags-VkIOkgLN.js → ts-tags-CG14Bplc.js} +1 -1
  127. package/dist/client/assets/{tsx-D_aaGHTf.js → tsx-D6NK461A.js} +1 -1
  128. package/dist/client/assets/{twig-CufwqKkk.js → twig-Agh0j5sD.js} +1 -1
  129. package/dist/client/assets/{typescript-osFD2CEV.js → typescript-_AkeziZ2.js} +1 -1
  130. package/dist/client/assets/{vennDiagram-CIIHVFJN-_K9NtpA5.js → vennDiagram-CIIHVFJN-2H9HfhhR.js} +1 -1
  131. package/dist/client/assets/{vue-Bub1rXmL.js → vue-C1z3QGG9.js} +1 -1
  132. package/dist/client/assets/{vue-html-CN3x2pYg.js → vue-html-C1RMzLZk.js} +1 -1
  133. package/dist/client/assets/{vue-vine-C0csYkGm.js → vue-vine-oOixA6ge.js} +1 -1
  134. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-B2jTMfra.js → wardleyDiagram-YWT4CUSO-BJxrQhTf.js} +1 -1
  135. package/dist/client/assets/{xml-my6OjeGb.js → xml-okuDZ7vq.js} +1 -1
  136. package/dist/client/assets/{xsl-Bx0YVn26.js → xsl-S_n3XrKb.js} +1 -1
  137. package/dist/client/assets/{xychartDiagram-2RQKCTM6-DfZ4YYXU.js → xychartDiagram-2RQKCTM6-BGdee7KG.js} +1 -1
  138. package/dist/client/assets/{yaml-DanwOypk.js → yaml-BoX-kqX1.js} +1 -1
  139. package/dist/client/index.html +2 -2
  140. package/dist/{doctor-q6oA64hm.mjs → doctor-CmP0u7-d.mjs} +1 -1
  141. package/dist/github-BjZZcSKV.mjs +2 -0
  142. package/dist/{github-HfIlIS-J.mjs → github-oCZx5aim.mjs} +270 -29
  143. package/dist/{mcp-eor39qmD.mjs → mcp-CqxXILYL.mjs} +1 -1
  144. package/dist/{server-C105rwQw.mjs → server-CczuXSWo.mjs} +164 -11
  145. package/package.json +3 -3
  146. package/dist/cli-agent-B4hU6Xay.mjs +0 -499
  147. package/dist/cli-agent-B_PHd635.mjs +0 -499
  148. package/dist/cli-agent-BatQgghr.mjs +0 -499
  149. package/dist/cli-agent-BkkRbKqq.mjs +0 -513
  150. package/dist/cli-agent-BlMtx1Tx.mjs +0 -736
  151. package/dist/cli-agent-BwZE05CQ.mjs +0 -499
  152. package/dist/cli-agent-C4Fb90GL.mjs +0 -728
  153. package/dist/cli-agent-CKE1Cvor.mjs +0 -513
  154. package/dist/cli-agent-CLvCYpmH.mjs +0 -499
  155. package/dist/cli-agent-CX8Fa1Ph.mjs +0 -499
  156. package/dist/cli-agent-ChALuNbw.mjs +0 -841
  157. package/dist/cli-agent-KxNAFIPf.mjs +0 -450
  158. package/dist/cli-agent-SILzesQP.mjs +0 -513
  159. package/dist/cli-agent-USzLoAit.mjs +0 -499
  160. package/dist/cli-agent-qBT8clNM.mjs +0 -841
  161. package/dist/cli-gh-6qiblgj7.mjs +0 -150
  162. package/dist/cli-gh-BV5az425.mjs +0 -147
  163. package/dist/cli-gh-Bo6fOHQR.mjs +0 -147
  164. package/dist/cli-gh-CDGSpndZ.mjs +0 -147
  165. package/dist/cli-gh-D1LoWJl-.mjs +0 -147
  166. package/dist/cli-gh-D1sIZ-jX.mjs +0 -147
  167. package/dist/cli-gh-DROAJlHi.mjs +0 -147
  168. package/dist/cli-gh-DgqscIkg.mjs +0 -147
  169. package/dist/cli-gh-DiT8BWwu.mjs +0 -147
  170. package/dist/cli-gh-KjPnyST6.mjs +0 -150
  171. package/dist/cli-gh-abs-IJrz.mjs +0 -147
  172. package/dist/client/assets/channel-CDxgOu-3.js +0 -1
  173. package/dist/client/assets/chunk-QZHKN3VN-DJCeMpP8.js +0 -1
  174. package/dist/client/assets/chunk-WU5MYG2G-BbuOkMaH.js +0 -1
  175. package/dist/client/assets/classDiagram-4FO5ZUOK-D5oJbiED.js +0 -1
  176. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-5MJt5ZxQ.js +0 -1
  177. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CdUgMghp.js +0 -1
  178. package/dist/comment-format-CKTt0fzi.mjs +0 -113
  179. package/dist/comment-format-DG_PAehC.mjs +0 -117
  180. package/dist/github-C9GLNak7.mjs +0 -2
  181. package/dist/mcp-7eXATtez.mjs +0 -1334
  182. package/dist/mcp-B6mCC7D3.mjs +0 -1047
  183. package/dist/mcp-BBk8AIO4.mjs +0 -1334
  184. package/dist/mcp-BJxrW9dS.mjs +0 -1334
  185. package/dist/mcp-BMTZLQuB.mjs +0 -758
  186. package/dist/mcp-BUF2nEL7.mjs +0 -1036
  187. package/dist/mcp-BWeWR4yd.mjs +0 -255
  188. package/dist/mcp-BgZO-iXI.mjs +0 -1047
  189. package/dist/mcp-BhT5GgYF.mjs +0 -1334
  190. package/dist/mcp-Bpx76OGU.mjs +0 -945
  191. package/dist/mcp-BsGdNA88.mjs +0 -1334
  192. package/dist/mcp-BxBm3d5l.mjs +0 -1047
  193. package/dist/mcp-C1T7LI0H.mjs +0 -1036
  194. package/dist/mcp-C4Bjmf9m.mjs +0 -1047
  195. package/dist/mcp-CFxcdEcJ.mjs +0 -733
  196. package/dist/mcp-Ca9QAlJ0.mjs +0 -1334
  197. package/dist/mcp-CphIUJUg.mjs +0 -1047
  198. package/dist/mcp-CtKRXQRC.mjs +0 -1047
  199. package/dist/mcp-CwjThGi2.mjs +0 -913
  200. package/dist/mcp-D4OsB9lt.mjs +0 -1047
  201. package/dist/mcp-DJ2batvt.mjs +0 -913
  202. package/dist/mcp-DNZQvKKF.mjs +0 -298
  203. package/dist/mcp-DO4zfNZX.mjs +0 -298
  204. package/dist/mcp-D_LGvBTw.mjs +0 -1047
  205. package/dist/mcp-Ds_lPX_o.mjs +0 -913
  206. package/dist/plan-format-B6nbAw_c.mjs +0 -132
  207. package/dist/plan-format-Bi46QS0m.mjs +0 -132
  208. package/dist/plan-format-DVnF8xrq.mjs +0 -126
  209. package/dist/plan-format-f62JWFI-.mjs +0 -117
  210. package/dist/plan-format-mSDtsPcC.mjs +0 -132
  211. package/dist/review-export-BoV0884M.mjs +0 -66
  212. package/dist/review-export-CKTI5Od_.mjs +0 -66
  213. package/dist/server-95UE5bgh.mjs +0 -3367
  214. package/dist/server-AisDKkpW.mjs +0 -3227
  215. package/dist/server-B0cS95Lf.mjs +0 -3488
  216. package/dist/server-BUsRhL1B.mjs +0 -3283
  217. package/dist/server-BZBFquG8.mjs +0 -3875
  218. package/dist/server-Bc2m9R5-.mjs +0 -3263
  219. package/dist/server-Bj-6KlK5.mjs +0 -3367
  220. package/dist/server-Bmt57wV5.mjs +0 -3875
  221. package/dist/server-Bpf84Il0.mjs +0 -3367
  222. package/dist/server-C15WRRnS.mjs +0 -3740
  223. package/dist/server-CYSpLbdA.mjs +0 -3360
  224. package/dist/server-ChT2DCaR.mjs +0 -3701
  225. package/dist/server-D0Ni8PKP.mjs +0 -3252
  226. package/dist/server-D2xEbakj.mjs +0 -3874
  227. package/dist/server-DJxysGxV.mjs +0 -3701
  228. package/dist/server-Dov7jbV3.mjs +0 -3367
  229. package/dist/server-TOElOuNP.mjs +0 -3258
  230. package/dist/server-eQ2E4Axo.mjs +0 -3367
  231. package/dist/server-lock-C_wPtEsH.mjs +0 -909
  232. package/dist/server-lock-Cbu3qHdu.mjs +0 -924
  233. package/dist/server-lock-D32inEn9.mjs +0 -924
  234. package/dist/server-lock-D73NKKbn.mjs +0 -842
  235. package/dist/server-lock-DaSx7DjW.mjs +0 -1049
  236. package/dist/server-lock-Ddcat0HF.mjs +0 -851
  237. package/dist/server-lock-Dj9fG9md.mjs +0 -838
  238. package/dist/server-lock-Dq_1CJaF.mjs +0 -1047
  239. package/dist/server-lock-Ujbcgq28.mjs +0 -954
  240. package/dist/update-check-CXeSZANo.mjs +0 -129
  241. package/dist/update-check-DAPFCqpF.mjs +0 -129
@@ -1,298 +0,0 @@
1
- import { a as formatComments, n as readServerLock, t as isLockAlive } from "./server-lock-D73NKKbn.mjs";
2
- import { n as formatPlanReview } from "./plan-format-mSDtsPcC.mjs";
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
- //#region src/mcp.ts
7
- /**
8
- * MCP server exposing diffing's review handoff as cross-vendor tools, so any
9
- * MCP-capable agent (Claude, Cursor, Codex, Gemini, …) can drive the same loop
10
- * the CLI does. Launched via `diffing mcp` over stdio. The port is discovered
11
- * per call from the per-repo lockfile, so the MCP server works whether it
12
- * starts before or after the diffing web server.
13
- *
14
- * Client config (no port needed):
15
- * { "mcpServers": { "diffing": { "command": "diffing", "args": ["mcp"] } } }
16
- */
17
- /** Resolve the running server's base URL, throwing a tool-friendly error. */
18
- function baseUrl() {
19
- const lock = readServerLock();
20
- if (!lock || !isLockAlive(lock)) throw new Error("No diffing server running for this repo. Start one with `diffing` in the repository, then retry.");
21
- return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
22
- }
23
- function textResult(text, structuredContent) {
24
- return {
25
- content: [{
26
- type: "text",
27
- text
28
- }],
29
- ...structuredContent ? { structuredContent } : {}
30
- };
31
- }
32
- async function startMcpServer() {
33
- const server = new McpServer({
34
- name: "diffing",
35
- version: "0.1.0"
36
- });
37
- server.registerTool("await_review", {
38
- title: "Await review",
39
- description: "Block until the human clicks \"Send to agent\" in the diffing UI, then return the review comments as XML. Re-poll-safe: returns the next review batch.",
40
- inputSchema: { timeoutSeconds: z.number().optional() }
41
- }, async ({ timeoutSeconds }, extra) => {
42
- const base = baseUrl();
43
- const totalBudgetMs = (timeoutSeconds ?? 570) * 1e3;
44
- const progressToken = extra?._meta?.progressToken;
45
- let sinceRound = 0;
46
- try {
47
- sinceRound = (await fetch(`${base}/api/review/status`).then((r) => r.json())).round ?? 0;
48
- } catch {}
49
- const deadline = Date.now() + totalBudgetMs;
50
- let cycle = 0;
51
- while (Date.now() < deadline) {
52
- const result = await (await fetch(`${base}/api/review/await?timeoutMs=25000&sinceRound=${sinceRound}`, { signal: extra?.signal })).json();
53
- if (result.status === "released") return textResult(result.payload.commentXml, {
54
- round: result.payload.round,
55
- openCount: result.payload.openCount,
56
- decision: result.payload.decision,
57
- comments: result.payload.comments
58
- });
59
- sinceRound = result.round ?? sinceRound;
60
- cycle += 1;
61
- if (progressToken !== void 0) await extra?.sendNotification?.({
62
- method: "notifications/progress",
63
- params: {
64
- progressToken,
65
- progress: cycle,
66
- message: "Waiting for the human to send their review…"
67
- }
68
- }).catch(() => {});
69
- }
70
- return textResult("No review was sent within the timeout. Call await_review again to keep waiting.");
71
- });
72
- server.registerTool("list_comments", {
73
- title: "List comments",
74
- description: "Fetch the current review comments as XML (and structured data). Set openOnly to skip resolved comments.",
75
- inputSchema: { openOnly: z.boolean().optional() }
76
- }, async ({ openOnly }) => {
77
- const all = await fetch(`${baseUrl()}/api/comments`).then((r) => r.json());
78
- const selected = openOnly ? all.filter((c) => c.status === "open") : all;
79
- return textResult(formatComments(selected), { comments: selected });
80
- });
81
- server.registerTool("reply_to_comment", {
82
- title: "Reply to comment",
83
- description: "Post an agent reply to a review comment. Shows up in the diffing UI in real time.",
84
- inputSchema: {
85
- commentId: z.string(),
86
- body: z.string(),
87
- model: z.string().optional()
88
- }
89
- }, async ({ commentId, body, model }) => {
90
- const res = await fetch(`${baseUrl()}/api/comments/${commentId}/replies`, {
91
- method: "POST",
92
- headers: { "Content-Type": "application/json" },
93
- body: JSON.stringify({
94
- body,
95
- role: "agent",
96
- model
97
- })
98
- });
99
- if (res.status === 404) throw new Error(`Comment ${commentId} not found.`);
100
- if (!res.ok) throw new Error(`Failed to reply: HTTP ${res.status}`);
101
- return textResult(`Replied to ${commentId}.`);
102
- });
103
- server.registerTool("resolve_comment", {
104
- title: "Resolve comment",
105
- description: "Mark a review comment as resolved.",
106
- inputSchema: { commentId: z.string() }
107
- }, async ({ commentId }) => {
108
- const res = await fetch(`${baseUrl()}/api/comments/${commentId}`, {
109
- method: "PUT",
110
- headers: { "Content-Type": "application/json" },
111
- body: JSON.stringify({ status: "resolved" })
112
- });
113
- if (res.status === 404) throw new Error(`Comment ${commentId} not found.`);
114
- if (!res.ok) throw new Error(`Failed to resolve: HTTP ${res.status}`);
115
- return textResult(`Resolved ${commentId}.`);
116
- });
117
- server.registerTool("submit_plan", {
118
- title: "Submit plan for review",
119
- description: "Submit a markdown plan for the human to review in the diffing UI. Returns the plan id and review URL. Pass an existing planId to resubmit a revised version for another review round.",
120
- inputSchema: {
121
- title: z.string().optional(),
122
- body: z.string(),
123
- source: z.string().optional(),
124
- model: z.string().optional(),
125
- planId: z.string().optional()
126
- }
127
- }, async ({ title, body, source, model, planId }) => {
128
- const base = baseUrl();
129
- const res = await fetch(`${base}/api/plans`, {
130
- method: "POST",
131
- headers: { "Content-Type": "application/json" },
132
- body: JSON.stringify({
133
- id: planId,
134
- title,
135
- body,
136
- source,
137
- model
138
- })
139
- });
140
- if (!res.ok) throw new Error(`Failed to submit plan: HTTP ${res.status}`);
141
- const plan = await res.json();
142
- return textResult(`Submitted plan ${plan.id} (v${plan.version}). The human can review it at ${base}/plan/${plan.id}. Call await_plan_review to block until they decide.`, {
143
- planId: plan.id,
144
- version: plan.version,
145
- url: `${base}/plan/${plan.id}`
146
- });
147
- });
148
- server.registerTool("await_plan_review", {
149
- title: "Await plan review",
150
- description: "Block until the human approves, rejects, or requests changes on a plan in the diffing UI, then return the verdict and inline comments as XML. Re-poll-safe.",
151
- inputSchema: { timeoutSeconds: z.number().optional() }
152
- }, async ({ timeoutSeconds }, extra) => {
153
- const base = baseUrl();
154
- const totalBudgetMs = (timeoutSeconds ?? 570) * 1e3;
155
- const progressToken = extra?._meta?.progressToken;
156
- let sinceRound = 0;
157
- try {
158
- sinceRound = (await fetch(`${base}/api/plan-review/status`).then((r) => r.json())).round ?? 0;
159
- } catch {}
160
- const deadline = Date.now() + totalBudgetMs;
161
- let cycle = 0;
162
- while (Date.now() < deadline) {
163
- const result = await (await fetch(`${base}/api/plan-review/await?timeoutMs=25000&sinceRound=${sinceRound}`, { signal: extra?.signal })).json();
164
- if (result.status === "released") return textResult(result.payload.reviewXml, {
165
- round: result.payload.round,
166
- planId: result.payload.planId,
167
- decision: result.payload.decision,
168
- decisionComment: result.payload.decisionComment,
169
- openCommentCount: result.payload.openCommentCount,
170
- plan: result.payload.plan
171
- });
172
- sinceRound = result.round ?? sinceRound;
173
- cycle += 1;
174
- if (progressToken !== void 0) await extra?.sendNotification?.({
175
- method: "notifications/progress",
176
- params: {
177
- progressToken,
178
- progress: cycle,
179
- message: "Waiting for the human to review the plan…"
180
- }
181
- }).catch(() => {});
182
- }
183
- return textResult("No plan decision within the timeout. Call await_plan_review again to keep waiting.");
184
- });
185
- server.registerTool("list_plans", {
186
- title: "List plans",
187
- description: "Fetch all submitted plans with their current decision and open-comment counts.",
188
- inputSchema: {}
189
- }, async () => {
190
- const all = await fetch(`${baseUrl()}/api/plans`).then((r) => r.json());
191
- return textResult(all.map((p) => {
192
- const open = (p.comments ?? []).filter((c) => c.status === "open").length;
193
- return `${p.id} [${p.decision}] v${p.version} — ${open} open comment(s) — ${p.title}`;
194
- }).join("\n") || "No plans submitted yet.", { plans: all });
195
- });
196
- server.registerTool("get_plan", {
197
- title: "Get plan",
198
- description: "Fetch a single plan as the <plan-review> XML (and structured data), including its decision and inline comments.",
199
- inputSchema: { planId: z.string() }
200
- }, async ({ planId }) => {
201
- const res = await fetch(`${baseUrl()}/api/plans/${planId}`);
202
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
203
- if (!res.ok) throw new Error(`Failed to fetch plan: HTTP ${res.status}`);
204
- const plan = await res.json();
205
- return textResult(formatPlanReview(plan), { plan });
206
- });
207
- server.registerTool("get_plan_versions", {
208
- title: "List plan versions",
209
- description: "List every version of a plan the agent has submitted, oldest-first. The current version is marked with a `*`.",
210
- inputSchema: { planId: z.string() }
211
- }, async ({ planId }) => {
212
- const res = await fetch(`${baseUrl()}/api/plans/${planId}/versions`);
213
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
214
- if (!res.ok) throw new Error(`Failed to fetch versions: HTTP ${res.status}`);
215
- const versions = await res.json();
216
- return textResult(versions.map((v) => {
217
- const date = new Date(v.createdAt).toISOString().slice(0, 16).replace("T", " ");
218
- return `v${v.version} — ${date} — ${v.title}`;
219
- }).join("\n") || "No versions recorded.", { versions });
220
- });
221
- server.registerTool("get_plan_version", {
222
- title: "Get a specific plan version",
223
- description: "Fetch a single historical version of a plan as the <plan-review> XML, with comments filtered to those anchored to that version. Pass `version` to choose which version to read (omit for the current one).",
224
- inputSchema: {
225
- planId: z.string(),
226
- version: z.number().int().positive().optional()
227
- }
228
- }, async ({ planId, version }) => {
229
- const base = baseUrl();
230
- if (version === void 0) {
231
- const res = await fetch(`${base}/api/plans/${planId}`);
232
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
233
- if (!res.ok) throw new Error(`Failed to fetch plan: HTTP ${res.status}`);
234
- const plan = await res.json();
235
- return textResult(formatPlanReview(plan), { plan });
236
- }
237
- const res = await fetch(`${base}/api/plans/${planId}/versions/${version}`);
238
- if (res.status === 404) throw new Error(`Plan ${planId} v${version} not found.`);
239
- if (!res.ok) throw new Error(`Failed to fetch version: HTTP ${res.status}`);
240
- const data = await res.json();
241
- const planRes = await fetch(`${base}/api/plans/${planId}`);
242
- if (!planRes.ok) throw new Error(`Plan ${planId} not found.`);
243
- const plan = await planRes.json();
244
- return textResult(formatPlanReview(plan, { viewingVersion: data.version.version }), {
245
- plan,
246
- version: data.version,
247
- currentVersion: data.plan.currentVersion
248
- });
249
- });
250
- /** Resolve which plan owns a comment id, for the reply/resolve tools. */
251
- async function findPlanForComment(base, commentId) {
252
- return (await fetch(`${base}/api/plans`).then((r) => r.json())).find((p) => (p.comments ?? []).some((c) => c.id === commentId)) ?? null;
253
- }
254
- server.registerTool("reply_to_plan_comment", {
255
- title: "Reply to plan comment",
256
- description: "Post an agent reply to a plan review comment. Shows up in the diffing UI in real time.",
257
- inputSchema: {
258
- commentId: z.string(),
259
- body: z.string(),
260
- model: z.string().optional()
261
- }
262
- }, async ({ commentId, body, model }) => {
263
- const base = baseUrl();
264
- const plan = await findPlanForComment(base, commentId);
265
- if (!plan) throw new Error(`Plan comment ${commentId} not found.`);
266
- const res = await fetch(`${base}/api/plans/${plan.id}/comments/${commentId}/replies`, {
267
- method: "POST",
268
- headers: { "Content-Type": "application/json" },
269
- body: JSON.stringify({
270
- body,
271
- role: "agent",
272
- model
273
- })
274
- });
275
- if (!res.ok) throw new Error(`Failed to reply: HTTP ${res.status}`);
276
- return textResult(`Replied to plan comment ${commentId}.`);
277
- });
278
- server.registerTool("resolve_plan_comment", {
279
- title: "Resolve plan comment",
280
- description: "Mark a plan review comment as resolved.",
281
- inputSchema: { commentId: z.string() }
282
- }, async ({ commentId }) => {
283
- const base = baseUrl();
284
- const plan = await findPlanForComment(base, commentId);
285
- if (!plan) throw new Error(`Plan comment ${commentId} not found.`);
286
- const res = await fetch(`${base}/api/plans/${plan.id}/comments/${commentId}`, {
287
- method: "PUT",
288
- headers: { "Content-Type": "application/json" },
289
- body: JSON.stringify({ status: "resolved" })
290
- });
291
- if (!res.ok) throw new Error(`Failed to resolve: HTTP ${res.status}`);
292
- return textResult(`Resolved plan comment ${commentId}.`);
293
- });
294
- const transport = new StdioServerTransport();
295
- await server.connect(transport);
296
- }
297
- //#endregion
298
- export { startMcpServer };
@@ -1,298 +0,0 @@
1
- import { a as formatComments, n as readServerLock, t as isLockAlive } from "./server-lock-Dj9fG9md.mjs";
2
- import { n as formatPlanReview } from "./plan-format-DVnF8xrq.mjs";
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
- //#region src/mcp.ts
7
- /**
8
- * MCP server exposing diffing's review handoff as cross-vendor tools, so any
9
- * MCP-capable agent (Claude, Cursor, Codex, Gemini, …) can drive the same loop
10
- * the CLI does. Launched via `diffing mcp` over stdio. The port is discovered
11
- * per call from the per-repo lockfile, so the MCP server works whether it
12
- * starts before or after the diffing web server.
13
- *
14
- * Client config (no port needed):
15
- * { "mcpServers": { "diffing": { "command": "diffing", "args": ["mcp"] } } }
16
- */
17
- /** Resolve the running server's base URL, throwing a tool-friendly error. */
18
- function baseUrl() {
19
- const lock = readServerLock();
20
- if (!lock || !isLockAlive(lock)) throw new Error("No diffing server running for this repo. Start one with `diffing` in the repository, then retry.");
21
- return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
22
- }
23
- function textResult(text, structuredContent) {
24
- return {
25
- content: [{
26
- type: "text",
27
- text
28
- }],
29
- ...structuredContent ? { structuredContent } : {}
30
- };
31
- }
32
- async function startMcpServer() {
33
- const server = new McpServer({
34
- name: "diffing",
35
- version: "0.1.0"
36
- });
37
- server.registerTool("await_review", {
38
- title: "Await review",
39
- description: "Block until the human clicks \"Send to agent\" in the diffing UI, then return the review comments as XML. Re-poll-safe: returns the next review batch.",
40
- inputSchema: { timeoutSeconds: z.number().optional() }
41
- }, async ({ timeoutSeconds }, extra) => {
42
- const base = baseUrl();
43
- const totalBudgetMs = (timeoutSeconds ?? 570) * 1e3;
44
- const progressToken = extra?._meta?.progressToken;
45
- let sinceRound = 0;
46
- try {
47
- sinceRound = (await fetch(`${base}/api/review/status`).then((r) => r.json())).round ?? 0;
48
- } catch {}
49
- const deadline = Date.now() + totalBudgetMs;
50
- let cycle = 0;
51
- while (Date.now() < deadline) {
52
- const result = await (await fetch(`${base}/api/review/await?timeoutMs=25000&sinceRound=${sinceRound}`, { signal: extra?.signal })).json();
53
- if (result.status === "released") return textResult(result.payload.commentXml, {
54
- round: result.payload.round,
55
- openCount: result.payload.openCount,
56
- decision: result.payload.decision,
57
- comments: result.payload.comments
58
- });
59
- sinceRound = result.round ?? sinceRound;
60
- cycle += 1;
61
- if (progressToken !== void 0) await extra?.sendNotification?.({
62
- method: "notifications/progress",
63
- params: {
64
- progressToken,
65
- progress: cycle,
66
- message: "Waiting for the human to send their review…"
67
- }
68
- }).catch(() => {});
69
- }
70
- return textResult("No review was sent within the timeout. Call await_review again to keep waiting.");
71
- });
72
- server.registerTool("list_comments", {
73
- title: "List comments",
74
- description: "Fetch the current review comments as XML (and structured data). Set openOnly to skip resolved comments.",
75
- inputSchema: { openOnly: z.boolean().optional() }
76
- }, async ({ openOnly }) => {
77
- const all = await fetch(`${baseUrl()}/api/comments`).then((r) => r.json());
78
- const selected = openOnly ? all.filter((c) => c.status === "open") : all;
79
- return textResult(formatComments(selected), { comments: selected });
80
- });
81
- server.registerTool("reply_to_comment", {
82
- title: "Reply to comment",
83
- description: "Post an agent reply to a review comment. Shows up in the diffing UI in real time.",
84
- inputSchema: {
85
- commentId: z.string(),
86
- body: z.string(),
87
- model: z.string().optional()
88
- }
89
- }, async ({ commentId, body, model }) => {
90
- const res = await fetch(`${baseUrl()}/api/comments/${commentId}/replies`, {
91
- method: "POST",
92
- headers: { "Content-Type": "application/json" },
93
- body: JSON.stringify({
94
- body,
95
- role: "agent",
96
- model
97
- })
98
- });
99
- if (res.status === 404) throw new Error(`Comment ${commentId} not found.`);
100
- if (!res.ok) throw new Error(`Failed to reply: HTTP ${res.status}`);
101
- return textResult(`Replied to ${commentId}.`);
102
- });
103
- server.registerTool("resolve_comment", {
104
- title: "Resolve comment",
105
- description: "Mark a review comment as resolved.",
106
- inputSchema: { commentId: z.string() }
107
- }, async ({ commentId }) => {
108
- const res = await fetch(`${baseUrl()}/api/comments/${commentId}`, {
109
- method: "PUT",
110
- headers: { "Content-Type": "application/json" },
111
- body: JSON.stringify({ status: "resolved" })
112
- });
113
- if (res.status === 404) throw new Error(`Comment ${commentId} not found.`);
114
- if (!res.ok) throw new Error(`Failed to resolve: HTTP ${res.status}`);
115
- return textResult(`Resolved ${commentId}.`);
116
- });
117
- server.registerTool("submit_plan", {
118
- title: "Submit plan for review",
119
- description: "Submit a markdown plan for the human to review in the diffing UI. Returns the plan id and review URL. Pass an existing planId to resubmit a revised version for another review round.",
120
- inputSchema: {
121
- title: z.string().optional(),
122
- body: z.string(),
123
- source: z.string().optional(),
124
- model: z.string().optional(),
125
- planId: z.string().optional()
126
- }
127
- }, async ({ title, body, source, model, planId }) => {
128
- const base = baseUrl();
129
- const res = await fetch(`${base}/api/plans`, {
130
- method: "POST",
131
- headers: { "Content-Type": "application/json" },
132
- body: JSON.stringify({
133
- id: planId,
134
- title,
135
- body,
136
- source,
137
- model
138
- })
139
- });
140
- if (!res.ok) throw new Error(`Failed to submit plan: HTTP ${res.status}`);
141
- const plan = await res.json();
142
- return textResult(`Submitted plan ${plan.id} (v${plan.version}). The human can review it at ${base}/plan/${plan.id}. Call await_plan_review to block until they decide.`, {
143
- planId: plan.id,
144
- version: plan.version,
145
- url: `${base}/plan/${plan.id}`
146
- });
147
- });
148
- server.registerTool("await_plan_review", {
149
- title: "Await plan review",
150
- description: "Block until the human approves, rejects, or requests changes on a plan in the diffing UI, then return the verdict and inline comments as XML. Re-poll-safe.",
151
- inputSchema: { timeoutSeconds: z.number().optional() }
152
- }, async ({ timeoutSeconds }, extra) => {
153
- const base = baseUrl();
154
- const totalBudgetMs = (timeoutSeconds ?? 570) * 1e3;
155
- const progressToken = extra?._meta?.progressToken;
156
- let sinceRound = 0;
157
- try {
158
- sinceRound = (await fetch(`${base}/api/plan-review/status`).then((r) => r.json())).round ?? 0;
159
- } catch {}
160
- const deadline = Date.now() + totalBudgetMs;
161
- let cycle = 0;
162
- while (Date.now() < deadline) {
163
- const result = await (await fetch(`${base}/api/plan-review/await?timeoutMs=25000&sinceRound=${sinceRound}`, { signal: extra?.signal })).json();
164
- if (result.status === "released") return textResult(result.payload.reviewXml, {
165
- round: result.payload.round,
166
- planId: result.payload.planId,
167
- decision: result.payload.decision,
168
- decisionComment: result.payload.decisionComment,
169
- openCommentCount: result.payload.openCommentCount,
170
- plan: result.payload.plan
171
- });
172
- sinceRound = result.round ?? sinceRound;
173
- cycle += 1;
174
- if (progressToken !== void 0) await extra?.sendNotification?.({
175
- method: "notifications/progress",
176
- params: {
177
- progressToken,
178
- progress: cycle,
179
- message: "Waiting for the human to review the plan…"
180
- }
181
- }).catch(() => {});
182
- }
183
- return textResult("No plan decision within the timeout. Call await_plan_review again to keep waiting.");
184
- });
185
- server.registerTool("list_plans", {
186
- title: "List plans",
187
- description: "Fetch all submitted plans with their current decision and open-comment counts.",
188
- inputSchema: {}
189
- }, async () => {
190
- const all = await fetch(`${baseUrl()}/api/plans`).then((r) => r.json());
191
- return textResult(all.map((p) => {
192
- const open = (p.comments ?? []).filter((c) => c.status === "open").length;
193
- return `${p.id} [${p.decision}] v${p.version} — ${open} open comment(s) — ${p.title}`;
194
- }).join("\n") || "No plans submitted yet.", { plans: all });
195
- });
196
- server.registerTool("get_plan", {
197
- title: "Get plan",
198
- description: "Fetch a single plan as the <plan-review> XML (and structured data), including its decision and inline comments.",
199
- inputSchema: { planId: z.string() }
200
- }, async ({ planId }) => {
201
- const res = await fetch(`${baseUrl()}/api/plans/${planId}`);
202
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
203
- if (!res.ok) throw new Error(`Failed to fetch plan: HTTP ${res.status}`);
204
- const plan = await res.json();
205
- return textResult(formatPlanReview(plan), { plan });
206
- });
207
- server.registerTool("get_plan_versions", {
208
- title: "List plan versions",
209
- description: "List every version of a plan the agent has submitted, oldest-first. The current version is marked with a `*`.",
210
- inputSchema: { planId: z.string() }
211
- }, async ({ planId }) => {
212
- const res = await fetch(`${baseUrl()}/api/plans/${planId}/versions`);
213
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
214
- if (!res.ok) throw new Error(`Failed to fetch versions: HTTP ${res.status}`);
215
- const versions = await res.json();
216
- return textResult(versions.map((v) => {
217
- const date = new Date(v.createdAt).toISOString().slice(0, 16).replace("T", " ");
218
- return `v${v.version} — ${date} — ${v.title}`;
219
- }).join("\n") || "No versions recorded.", { versions });
220
- });
221
- server.registerTool("get_plan_version", {
222
- title: "Get a specific plan version",
223
- description: "Fetch a single historical version of a plan as the <plan-review> XML, with comments filtered to those anchored to that version. Pass `version` to choose which version to read (omit for the current one).",
224
- inputSchema: {
225
- planId: z.string(),
226
- version: z.number().int().positive().optional()
227
- }
228
- }, async ({ planId, version }) => {
229
- const base = baseUrl();
230
- if (version === void 0) {
231
- const res = await fetch(`${base}/api/plans/${planId}`);
232
- if (res.status === 404) throw new Error(`Plan ${planId} not found.`);
233
- if (!res.ok) throw new Error(`Failed to fetch plan: HTTP ${res.status}`);
234
- const plan = await res.json();
235
- return textResult(formatPlanReview(plan), { plan });
236
- }
237
- const res = await fetch(`${base}/api/plans/${planId}/versions/${version}`);
238
- if (res.status === 404) throw new Error(`Plan ${planId} v${version} not found.`);
239
- if (!res.ok) throw new Error(`Failed to fetch version: HTTP ${res.status}`);
240
- const data = await res.json();
241
- const planRes = await fetch(`${base}/api/plans/${planId}`);
242
- if (!planRes.ok) throw new Error(`Plan ${planId} not found.`);
243
- const plan = await planRes.json();
244
- return textResult(formatPlanReview(plan, { viewingVersion: data.version.version }), {
245
- plan,
246
- version: data.version,
247
- currentVersion: data.plan.currentVersion
248
- });
249
- });
250
- /** Resolve which plan owns a comment id, for the reply/resolve tools. */
251
- async function findPlanForComment(base, commentId) {
252
- return (await fetch(`${base}/api/plans`).then((r) => r.json())).find((p) => (p.comments ?? []).some((c) => c.id === commentId)) ?? null;
253
- }
254
- server.registerTool("reply_to_plan_comment", {
255
- title: "Reply to plan comment",
256
- description: "Post an agent reply to a plan review comment. Shows up in the diffing UI in real time.",
257
- inputSchema: {
258
- commentId: z.string(),
259
- body: z.string(),
260
- model: z.string().optional()
261
- }
262
- }, async ({ commentId, body, model }) => {
263
- const base = baseUrl();
264
- const plan = await findPlanForComment(base, commentId);
265
- if (!plan) throw new Error(`Plan comment ${commentId} not found.`);
266
- const res = await fetch(`${base}/api/plans/${plan.id}/comments/${commentId}/replies`, {
267
- method: "POST",
268
- headers: { "Content-Type": "application/json" },
269
- body: JSON.stringify({
270
- body,
271
- role: "agent",
272
- model
273
- })
274
- });
275
- if (!res.ok) throw new Error(`Failed to reply: HTTP ${res.status}`);
276
- return textResult(`Replied to plan comment ${commentId}.`);
277
- });
278
- server.registerTool("resolve_plan_comment", {
279
- title: "Resolve plan comment",
280
- description: "Mark a plan review comment as resolved.",
281
- inputSchema: { commentId: z.string() }
282
- }, async ({ commentId }) => {
283
- const base = baseUrl();
284
- const plan = await findPlanForComment(base, commentId);
285
- if (!plan) throw new Error(`Plan comment ${commentId} not found.`);
286
- const res = await fetch(`${base}/api/plans/${plan.id}/comments/${commentId}`, {
287
- method: "PUT",
288
- headers: { "Content-Type": "application/json" },
289
- body: JSON.stringify({ status: "resolved" })
290
- });
291
- if (!res.ok) throw new Error(`Failed to resolve: HTTP ${res.status}`);
292
- return textResult(`Resolved plan comment ${commentId}.`);
293
- });
294
- const transport = new StdioServerTransport();
295
- await server.connect(transport);
296
- }
297
- //#endregion
298
- export { startMcpServer };