diffing 0.4.1 → 0.5.1

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 (186) hide show
  1. package/README.md +41 -7
  2. package/dist/cli-agent-BatQgghr.mjs +499 -0
  3. package/dist/cli-agent-BwZE05CQ.mjs +499 -0
  4. package/dist/cli-agent-CKE1Cvor.mjs +513 -0
  5. package/dist/cli-agent-CLvCYpmH.mjs +499 -0
  6. package/dist/cli-agent-CX8Fa1Ph.mjs +499 -0
  7. package/dist/cli-agent-SILzesQP.mjs +513 -0
  8. package/dist/cli-agent-USzLoAit.mjs +499 -0
  9. package/dist/cli-gh-BV5az425.mjs +147 -0
  10. package/dist/cli-gh-Bo6fOHQR.mjs +147 -0
  11. package/dist/cli-gh-D1LoWJl-.mjs +147 -0
  12. package/dist/cli-gh-D1sIZ-jX.mjs +147 -0
  13. package/dist/cli-gh-DROAJlHi.mjs +147 -0
  14. package/dist/cli-gh-DiT8BWwu.mjs +147 -0
  15. package/dist/cli.mjs +97 -3381
  16. package/dist/client/assets/{angular-html-DIKVmS-w.js → angular-html-CDZ9SrQX.js} +1 -1
  17. package/dist/client/assets/{angular-ts-DK13mfBQ.js → angular-ts-CNMbVia5.js} +1 -1
  18. package/dist/client/assets/{apl-NVZUxqwo.js → apl-BqNxQgsm.js} +1 -1
  19. package/dist/client/assets/{arc-kijUuucY.js → arc-BrMp-_55.js} +1 -1
  20. package/dist/client/assets/{architectureDiagram-3BPJPVTR-Dup-CzBS.js → architectureDiagram-3BPJPVTR-BIZJkdXp.js} +1 -1
  21. package/dist/client/assets/{astro-RPdCumat.js → astro-r55-Uy0e.js} +1 -1
  22. package/dist/client/assets/{blade-_ubz_KMD.js → blade-F8SZw05t.js} +1 -1
  23. package/dist/client/assets/{blockDiagram-GPEHLZMM-Cl0-G1MY.js → blockDiagram-GPEHLZMM-DlzFca7z.js} +1 -1
  24. package/dist/client/assets/{c-IEKcSTtW.js → c-DMmuyoXv.js} +1 -1
  25. package/dist/client/assets/{c4Diagram-AAUBKEIU-C3T6FV-K.js → c4Diagram-AAUBKEIU-BqJFYdcn.js} +1 -1
  26. package/dist/client/assets/channel-DVxVbqCb.js +1 -0
  27. package/dist/client/assets/{chunk-2J33WTMH-B5MFxFjX.js → chunk-2J33WTMH-CRN3t_Zt.js} +1 -1
  28. package/dist/client/assets/{chunk-3OPIFGDE-DWxCOZgI.js → chunk-3OPIFGDE-Bb8pGWXE.js} +1 -1
  29. package/dist/client/assets/{chunk-4BX2VUAB-DWdovlBC.js → chunk-4BX2VUAB--s6olL4E.js} +1 -1
  30. package/dist/client/assets/{chunk-55IACEB6-CFSaZijP.js → chunk-55IACEB6-C-iaNYfB.js} +1 -1
  31. package/dist/client/assets/{chunk-5ZQYHXKU-BH_cLkIj.js → chunk-5ZQYHXKU-Bvzi1CUr.js} +1 -1
  32. package/dist/client/assets/{chunk-727SXJPM-BbsJC2PT.js → chunk-727SXJPM-CjoyjZeg.js} +1 -1
  33. package/dist/client/assets/{chunk-AQP2D5EJ-tFAP6fC1.js → chunk-AQP2D5EJ-BJJOqjwm.js} +1 -1
  34. package/dist/client/assets/{chunk-BSJP7CBP-BGuhsdwy.js → chunk-BSJP7CBP-A0UL_0xV.js} +1 -1
  35. package/dist/client/assets/{chunk-CSCIHK7Q-DXSJWhsY.js → chunk-CSCIHK7Q-DW570vKT.js} +1 -1
  36. package/dist/client/assets/{chunk-FMBD7UC4-6vBylg_I.js → chunk-FMBD7UC4-CzNJ-Iy-.js} +1 -1
  37. package/dist/client/assets/{chunk-KSCS5N6A-C7iBFsUg.js → chunk-KSCS5N6A-DCbYTAZg.js} +1 -1
  38. package/dist/client/assets/{chunk-L5ZTLDWV-CRU3nvaK.js → chunk-L5ZTLDWV-BMdyyjjc.js} +1 -1
  39. package/dist/client/assets/{chunk-LZXEDZCA-6ppA-_4h.js → chunk-LZXEDZCA-BENQV-I4.js} +2 -2
  40. package/dist/client/assets/{chunk-ND2GUHAM-D1cTmgHe.js → chunk-ND2GUHAM-C1y3WzOx.js} +1 -1
  41. package/dist/client/assets/{chunk-NZK2D7GU-CpUab6v7.js → chunk-NZK2D7GU-BkBT6O_M.js} +1 -1
  42. package/dist/client/assets/{chunk-O5CBEL6O-cDxBycWe.js → chunk-O5CBEL6O-jdz4J9aA.js} +1 -1
  43. package/dist/client/assets/chunk-QZHKN3VN-mumapnEV.js +1 -0
  44. package/dist/client/assets/chunk-WU5MYG2G-Bsqs8ZKl.js +1 -0
  45. package/dist/client/assets/{chunk-XPW4576I-CI9GEEdy.js → chunk-XPW4576I-Bf8OI8wY.js} +1 -1
  46. package/dist/client/assets/classDiagram-4FO5ZUOK-CKaaw3uU.js +1 -0
  47. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BxwzeqDR.js +1 -0
  48. package/dist/client/assets/{cobol-BVhbHJgp.js → cobol-BanHX5pe.js} +1 -1
  49. package/dist/client/assets/{coffee-gY6asS_B.js → coffee-CACo0LEP.js} +1 -1
  50. package/dist/client/assets/{cose-bilkent-S5V4N54A-BOs7zxZa.js → cose-bilkent-S5V4N54A-7mNCsL0j.js} +1 -1
  51. package/dist/client/assets/{cpp-el3R6exS.js → cpp-4Kwtmkwn.js} +1 -1
  52. package/dist/client/assets/{crystal-D2_0btIo.js → crystal-D1kAaPsE.js} +1 -1
  53. package/dist/client/assets/{css-DtPe7dg4.js → css-CCMEBYEn.js} +1 -1
  54. package/dist/client/assets/{dagre-BM42HDAG-CR_0cBOz.js → dagre-BM42HDAG-BTEYZegB.js} +1 -1
  55. package/dist/client/assets/{diagram-2AECGRRQ-D9um0wp2.js → diagram-2AECGRRQ-Cj_XZNTN.js} +1 -1
  56. package/dist/client/assets/{diagram-5GNKFQAL-Dx0TEfBJ.js → diagram-5GNKFQAL-DVTFfYPd.js} +1 -1
  57. package/dist/client/assets/{diagram-KO2AKTUF-DjBHOuUD.js → diagram-KO2AKTUF-C7BU5Ncp.js} +1 -1
  58. package/dist/client/assets/{diagram-LMA3HP47-CK2MO5Gx.js → diagram-LMA3HP47-06rwT7mb.js} +1 -1
  59. package/dist/client/assets/{diagram-OG6HWLK6-CANQancN.js → diagram-OG6HWLK6-COEuKA9B.js} +1 -1
  60. package/dist/client/assets/{dist-DGlwcsQQ.js → dist-C-G1vI6B.js} +1 -1
  61. package/dist/client/assets/{edge-Ch_PYBsB.js → edge-BV-WbkC9.js} +1 -1
  62. package/dist/client/assets/{elixir-DEJrJATq.js → elixir-C6pMvu6H.js} +1 -1
  63. package/dist/client/assets/{elm-Brlko4-d.js → elm-D8LnUrCG.js} +1 -1
  64. package/dist/client/assets/{erDiagram-TEJ5UH35-Dnfrs6yk.js → erDiagram-TEJ5UH35-SPxPVg85.js} +1 -1
  65. package/dist/client/assets/{erb-DQPphNua.js → erb-C6ADBE0Q.js} +1 -1
  66. package/dist/client/assets/{flowDiagram-I6XJVG4X-BNMdFtjG.js → flowDiagram-I6XJVG4X-DyEhCtUv.js} +1 -1
  67. package/dist/client/assets/{ganttDiagram-6RSMTGT7-X-fPXz_A.js → ganttDiagram-6RSMTGT7-fj-zRHIk.js} +1 -1
  68. package/dist/client/assets/{git-rebase-BpS915SI.js → git-rebase-BhYZ4R3x.js} +1 -1
  69. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-CRN_dRXM.js → gitGraphDiagram-PVQCEYII-CpUJh4CR.js} +1 -1
  70. package/dist/client/assets/{glimmer-js-DZDngVuD.js → glimmer-js-D2CVO-NF.js} +1 -1
  71. package/dist/client/assets/{glimmer-ts-DKNjJvyp.js → glimmer-ts-BjYisPeM.js} +1 -1
  72. package/dist/client/assets/{glsl-C-Y1tHoU.js → glsl-qP0lyfIY.js} +1 -1
  73. package/dist/client/assets/{graphql-DYVBNazO.js → graphql-BZE_lBur.js} +1 -1
  74. package/dist/client/assets/{hack-DewKAtLe.js → hack-C6KM9SLG.js} +1 -1
  75. package/dist/client/assets/{haml-CIA_AeXu.js → haml-BT3JKqL8.js} +1 -1
  76. package/dist/client/assets/{handlebars-Bade6JXX.js → handlebars-SHKYyRQ6.js} +1 -1
  77. package/dist/client/assets/{html-C4hhbuGp.js → html-CAc9HUGa.js} +1 -1
  78. package/dist/client/assets/{html-derivative-BXfztBtv.js → html-derivative-Cu6n_YRN.js} +1 -1
  79. package/dist/client/assets/{http-Cq90-CTl.js → http-o21PuOy8.js} +1 -1
  80. package/dist/client/assets/{hurl-DklQHYoa.js → hurl-ClrxMWQi.js} +1 -1
  81. package/dist/client/assets/{index-j9gqGQit.js → index-BPI8nJUS.js} +98 -98
  82. package/dist/client/assets/index-F_YfUisJ.css +1 -0
  83. package/dist/client/assets/{infoDiagram-5YYISTIA-Ht-AcvP4.js → infoDiagram-5YYISTIA-DDYGwUUs.js} +1 -1
  84. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-k_l70iFb.js → ishikawaDiagram-YF4QCWOH-Benmqbm6.js} +1 -1
  85. package/dist/client/assets/{java-BMUwLm1h.js → java-Bmlmy6B3.js} +1 -1
  86. package/dist/client/assets/{javascript-B8nPCUVp.js → javascript-Bdrc0lyI.js} +1 -1
  87. package/dist/client/assets/{jinja-CkxiRcB3.js → jinja-DBkct7nV.js} +1 -1
  88. package/dist/client/assets/{jison-CFnN5uQs.js → jison-Tb1xkShc.js} +1 -1
  89. package/dist/client/assets/{journeyDiagram-JHISSGLW-C98PUC9Y.js → journeyDiagram-JHISSGLW-CCkv1GnE.js} +1 -1
  90. package/dist/client/assets/{json-B7HNnjIx.js → json-DwLxGyui.js} +1 -1
  91. package/dist/client/assets/{jsx-BfVPuW3i.js → jsx-DWSSTqEB.js} +1 -1
  92. package/dist/client/assets/{julia-Bj0ETGjT.js → julia-LUN3XhcV.js} +1 -1
  93. package/dist/client/assets/{just-CqIe_c9k.js → just-C6LrD5tm.js} +1 -1
  94. package/dist/client/assets/{kanban-definition-UN3LZRKU-BE-uvH7w.js → kanban-definition-UN3LZRKU-CQSBf6Ys.js} +1 -1
  95. package/dist/client/assets/{latex-Cvy8E64e.js → latex-aaU-rirg.js} +1 -1
  96. package/dist/client/assets/{line-BpooNUgm.js → line-DG7hZYkR.js} +1 -1
  97. package/dist/client/assets/{linear-CM6ZoyCp.js → linear-A5s-ps1u.js} +1 -1
  98. package/dist/client/assets/{liquid-x09l8QqE.js → liquid-BhVOoUfG.js} +1 -1
  99. package/dist/client/assets/{lua-BSlDLjt5.js → lua-BTF9vmdD.js} +1 -1
  100. package/dist/client/assets/{marko-CoNMQlTn.js → marko-DlwBrpd_.js} +1 -1
  101. package/dist/client/assets/{mdc-BSzVESPu.js → mdc-H8mdhEag.js} +1 -1
  102. package/dist/client/assets/{mermaid-parser.core-BDXJMxHu.js → mermaid-parser.core-BKvEMhB3.js} +1 -1
  103. package/dist/client/assets/{mermaid.core-Dw-_vXTc.js → mermaid.core-BaDGp29W.js} +3 -3
  104. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BTxGT8rM.js → mindmap-definition-RKZ34NQL-BCrf7cJv.js} +1 -1
  105. package/dist/client/assets/{nginx-CBhJTj0i.js → nginx-DoaqXoFJ.js} +1 -1
  106. package/dist/client/assets/{nim-CtHbOBlO.js → nim-DqoAP4Np.js} +1 -1
  107. package/dist/client/assets/{perl-DLMzG3tu.js → perl-D1ou0isN.js} +1 -1
  108. package/dist/client/assets/{php-KomVR3Hz.js → php-DL6kQj3i.js} +1 -1
  109. package/dist/client/assets/{pieDiagram-4H26LBE5-BBUObAJW.js → pieDiagram-4H26LBE5-CF0X4ECG.js} +1 -1
  110. package/dist/client/assets/{pug-T4SRLx8P.js → pug-Bn3xDPVT.js} +1 -1
  111. package/dist/client/assets/{qml-DJdSRUmU.js → qml-CaA5S6hT.js} +1 -1
  112. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-B7vvauZv.js → quadrantDiagram-W4KKPZXB-A76pK4Cy.js} +1 -1
  113. package/dist/client/assets/{r-CwuTg9lK.js → r-DuUvfJBZ.js} +1 -1
  114. package/dist/client/assets/{razor-Ch4dgsGY.js → razor-DOv4xAWl.js} +1 -1
  115. package/dist/client/assets/{regexp-D2GTwJE0.js → regexp-DXetztjB.js} +1 -1
  116. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DpcNiR3Y.js → requirementDiagram-4Y6WPE33-Cju--fB8.js} +1 -1
  117. package/dist/client/assets/{rst-D78f0DyR.js → rst-CDn5EUee.js} +1 -1
  118. package/dist/client/assets/{ruby-BUcw6ITs.js → ruby-40qcnJX-.js} +1 -1
  119. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-ChzSQD2O.js → sankeyDiagram-5OEKKPKP-CvkQY1O-.js} +1 -1
  120. package/dist/client/assets/{sas-DoT2JDsj.js → sas-D3a9oRtu.js} +1 -1
  121. package/dist/client/assets/{scss-B6G_d-6b.js → scss-BJ8ZKq49.js} +1 -1
  122. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CzkdL8s7.js → sequenceDiagram-3UESZ5HK-DKU8lZlC.js} +1 -1
  123. package/dist/client/assets/{shellscript-DI252Bga.js → shellscript-yTgK8aYT.js} +1 -1
  124. package/dist/client/assets/{shellsession-BuO_s8FQ.js → shellsession-DrVaQSNg.js} +1 -1
  125. package/dist/client/assets/{soy-DZTZJTEE.js → soy-BasCadaZ.js} +1 -1
  126. package/dist/client/assets/{sql-C4isoJr_.js → sql-COJH6ALP.js} +1 -1
  127. package/dist/client/assets/{src-BMvz5HE8.js → src-BokBJ4oL.js} +1 -1
  128. package/dist/client/assets/{stata-Dhu6qITh.js → stata-Ble9lhMp.js} +1 -1
  129. package/dist/client/assets/{stateDiagram-AJRCARHV-DvYcrdap.js → stateDiagram-AJRCARHV-9IU9PT8A.js} +1 -1
  130. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Ce46Lf8G.js +1 -0
  131. package/dist/client/assets/{surrealql-CSDpq5j3.js → surrealql-BZ5cQJLk.js} +1 -1
  132. package/dist/client/assets/{svelte-C4ITAvxr.js → svelte-CLa9l6VK.js} +1 -1
  133. package/dist/client/assets/{templ-BTgKA9-7.js → templ-DVKkE2Tb.js} +1 -1
  134. package/dist/client/assets/{tex-Dg4N9ndP.js → tex-BET3iISl.js} +1 -1
  135. package/dist/client/assets/{timeline-definition-PNZ67QCA-Djt5Lwk2.js → timeline-definition-PNZ67QCA-CkkYIhNz.js} +1 -1
  136. package/dist/client/assets/{ts-tags-BufYnYos.js → ts-tags-D5fPAs5W.js} +1 -1
  137. package/dist/client/assets/{tsx-DmkFP0sw.js → tsx-CfNzz9iB.js} +1 -1
  138. package/dist/client/assets/{twig-BJv_IWYK.js → twig-_Ml9CBGK.js} +1 -1
  139. package/dist/client/assets/{typescript-BKp05Qme.js → typescript-DMiV0dhX.js} +1 -1
  140. package/dist/client/assets/{vennDiagram-CIIHVFJN-DDVADTIa.js → vennDiagram-CIIHVFJN-HUv6L4Dt.js} +1 -1
  141. package/dist/client/assets/{vue-BsHXCXzh.js → vue-BcbmWIQt.js} +1 -1
  142. package/dist/client/assets/{vue-html-CCsH-lmo.js → vue-html-CcUgk6WA.js} +1 -1
  143. package/dist/client/assets/{vue-vine-B5P1JXxo.js → vue-vine-BbIBT3jy.js} +1 -1
  144. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-yeVKWvtX.js → wardleyDiagram-YWT4CUSO-avUfWkuC.js} +1 -1
  145. package/dist/client/assets/{xml-CFkhYff0.js → xml-9mtlBTUG.js} +1 -1
  146. package/dist/client/assets/{xsl-Dc5XRzm6.js → xsl-Dm8BN5j0.js} +1 -1
  147. package/dist/client/assets/{xychartDiagram-2RQKCTM6--8Ik-9v0.js → xychartDiagram-2RQKCTM6-BSZPOH7-.js} +1 -1
  148. package/dist/client/assets/{yaml-BTCCxCxi.js → yaml-Ccz1qKlL.js} +1 -1
  149. package/dist/client/index.html +2 -2
  150. package/dist/mcp-B6mCC7D3.mjs +1047 -0
  151. package/dist/mcp-BMTZLQuB.mjs +758 -0
  152. package/dist/mcp-BUF2nEL7.mjs +1036 -0
  153. package/dist/mcp-Bpx76OGU.mjs +945 -0
  154. package/dist/mcp-C1T7LI0H.mjs +1036 -0
  155. package/dist/mcp-C4Bjmf9m.mjs +1047 -0
  156. package/dist/mcp-CFxcdEcJ.mjs +733 -0
  157. package/dist/mcp-CwjThGi2.mjs +913 -0
  158. package/dist/mcp-D4OsB9lt.mjs +1047 -0
  159. package/dist/mcp-DJ2batvt.mjs +913 -0
  160. package/dist/mcp-D_LGvBTw.mjs +1047 -0
  161. package/dist/mcp-Ds_lPX_o.mjs +913 -0
  162. package/dist/plan-format-B6nbAw_c.mjs +132 -0
  163. package/dist/server-95UE5bgh.mjs +3367 -0
  164. package/dist/server-B0cS95Lf.mjs +3488 -0
  165. package/dist/server-Bj-6KlK5.mjs +3367 -0
  166. package/dist/server-Bpf84Il0.mjs +3367 -0
  167. package/dist/server-CYSpLbdA.mjs +3360 -0
  168. package/dist/server-ChT2DCaR.mjs +3701 -0
  169. package/dist/server-DJxysGxV.mjs +3701 -0
  170. package/dist/server-Dov7jbV3.mjs +3367 -0
  171. package/dist/server-eQ2E4Axo.mjs +3367 -0
  172. package/dist/server-lock-C_wPtEsH.mjs +909 -0
  173. package/dist/server-lock-Cbu3qHdu.mjs +924 -0
  174. package/dist/server-lock-D32inEn9.mjs +924 -0
  175. package/dist/server-lock-Ddcat0HF.mjs +851 -0
  176. package/dist/server-lock-Dq_1CJaF.mjs +1047 -0
  177. package/dist/server-lock-Ujbcgq28.mjs +954 -0
  178. package/dist/update-check-CXeSZANo.mjs +129 -0
  179. package/package.json +3 -2
  180. package/dist/client/assets/channel-CpWSvbvQ.js +0 -1
  181. package/dist/client/assets/chunk-QZHKN3VN-HhMIifwl.js +0 -1
  182. package/dist/client/assets/chunk-WU5MYG2G-CvIzXEms.js +0 -1
  183. package/dist/client/assets/classDiagram-4FO5ZUOK-DFu-dNVy.js +0 -1
  184. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-D7Xcgo6q.js +0 -1
  185. package/dist/client/assets/index-CMyunQt6.css +0 -1
  186. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-D5igY81I.js +0 -1
@@ -0,0 +1,147 @@
1
+ import { n as isLockAlive, o as formatComments, r as readServerLock } from "./server-lock-Ddcat0HF.mjs";
2
+ import { parseArgs } from "node:util";
3
+ //#region src/cli-gh.ts
4
+ /**
5
+ * `diffing gh …` — the headless / port-agnostic surface for the PR review
6
+ * mode. Mirrors the shape of the local review CLI: each subcommand resolves
7
+ * the running server from the per-repo lockfile and talks to it via
8
+ * localhost HTTP. No port ever leaves the lockfile.
9
+ *
10
+ * diffing gh pr-fetch <ref> → GET /api/gh/pr/init then dump
11
+ * diffing gh pr-review → POST /api/gh/submit (current session)
12
+ * diffing gh pr-list-comments → GET /api/gh/pr-session/comments (XML)
13
+ * diffing gh status → GET /api/gh/session (one-line summary)
14
+ */
15
+ const EXIT_OK = 0;
16
+ const EXIT_NO_SERVER = 3;
17
+ const EXIT_NOT_FOUND = 4;
18
+ const EXIT_USAGE = 5;
19
+ function baseUrl() {
20
+ const lock = readServerLock();
21
+ if (!lock || !isLockAlive(lock)) {
22
+ console.error("No diffing server running for this repo. Start one with `diffing \"gh pr <ref>\"`.");
23
+ process.exit(EXIT_NO_SERVER);
24
+ }
25
+ return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
26
+ }
27
+ async function ghStatus() {
28
+ const base = baseUrl();
29
+ const res = await fetch(`${base}/api/gh/session`);
30
+ if (res.status === 404) {
31
+ console.error("No active PR session. Start one with `diffing \"gh pr <ref>\"`.");
32
+ return EXIT_NOT_FOUND;
33
+ }
34
+ const s = await res.json();
35
+ const submittedLine = s.submittedAt ? `submitted at ${new Date(s.submittedAt).toISOString()} → ${s.submittedReviewUrl ?? "(no url)"}` : "not submitted yet";
36
+ console.log(`${s.owner}/${s.repo}#${s.pullNumber} ${s.title}`);
37
+ console.log(` url: ${s.url}`);
38
+ console.log(` author: ${s.author?.login ?? "(unknown)"}`);
39
+ console.log(` +${s.additions} -${s.deletions} (${s.changedFiles} files)`);
40
+ console.log(` head: ${s.headSha.slice(0, 7)}`);
41
+ console.log(` base: ${s.baseSha.slice(0, 7)}`);
42
+ console.log(` existing: ${s.existingComments?.length ?? 0} review comments (read-only context)`);
43
+ console.log(` new: ${s.comments?.length ?? 0} comments in this session`);
44
+ console.log(` status: ${submittedLine}`);
45
+ return EXIT_OK;
46
+ }
47
+ async function ghPrFetch(args) {
48
+ const { values, positionals } = parseArgs({
49
+ args,
50
+ options: { json: { type: "boolean" } },
51
+ allowPositionals: true
52
+ });
53
+ const ref = positionals[0];
54
+ if (!ref) {
55
+ console.error("Usage: diffing gh pr-fetch <ref> [--json]");
56
+ return EXIT_USAGE;
57
+ }
58
+ const base = baseUrl();
59
+ const res = await fetch(`${base}/api/gh/pr/init`, {
60
+ method: "POST",
61
+ headers: { "Content-Type": "application/json" },
62
+ body: JSON.stringify({ ref })
63
+ });
64
+ if (!res.ok) {
65
+ const err = await res.json().catch(() => ({}));
66
+ console.error(`Failed to fetch PR: ${err.error ?? res.statusText}`);
67
+ return 1;
68
+ }
69
+ const result = await res.json();
70
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
71
+ else console.log(`${result.owner}/${result.repo}#${result.pullNumber} ${result.url}`);
72
+ return EXIT_OK;
73
+ }
74
+ async function ghPrListComments() {
75
+ const base = baseUrl();
76
+ const res = await fetch(`${base}/api/gh/pr-session/comments`);
77
+ if (res.status === 404) {
78
+ console.error("No active PR session.");
79
+ return EXIT_NOT_FOUND;
80
+ }
81
+ const comments = await res.json();
82
+ process.stdout.write(formatComments(comments) + "\n");
83
+ return EXIT_OK;
84
+ }
85
+ async function ghPrReview(args) {
86
+ const { values } = parseArgs({
87
+ args,
88
+ options: {
89
+ decision: {
90
+ type: "string",
91
+ short: "d"
92
+ },
93
+ body: {
94
+ type: "string",
95
+ short: "b"
96
+ },
97
+ "dry-run": { type: "boolean" },
98
+ json: { type: "boolean" }
99
+ },
100
+ allowPositionals: false
101
+ });
102
+ const decision = values.decision;
103
+ if (decision !== "approve" && decision !== "comment" && decision !== "request-changes") {
104
+ console.error("Usage: diffing gh pr-review --decision <approve|comment|request-changes> [--body <text>] [--dry-run]");
105
+ return EXIT_USAGE;
106
+ }
107
+ const base = baseUrl();
108
+ const payload = {
109
+ decision,
110
+ body: values.body ?? "",
111
+ dryRun: values["dry-run"] === true
112
+ };
113
+ const res = await fetch(`${base}/api/gh/submit`, {
114
+ method: "POST",
115
+ headers: { "Content-Type": "application/json" },
116
+ body: JSON.stringify(payload)
117
+ });
118
+ if (!res.ok) {
119
+ const err = await res.json().catch(() => ({}));
120
+ console.error(`Failed to submit review: ${err.error ?? res.statusText}`);
121
+ return 1;
122
+ }
123
+ const result = await res.json();
124
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
125
+ else if (result.ok) if (result.dryRun) console.log("Dry run OK — payload would have been accepted by GitHub.");
126
+ else console.log(`Review submitted via ${result.authSource}: ${result.reviewUrl ?? `#${result.reviewId}`}`);
127
+ else {
128
+ console.error(`Submit failed (auth=${result.authSource}): ${result.error ?? "unknown error"}`);
129
+ return 1;
130
+ }
131
+ return EXIT_OK;
132
+ }
133
+ async function runGhSubcommand(args) {
134
+ const action = args[0];
135
+ const rest = args.slice(1);
136
+ switch (action) {
137
+ case "status": return ghStatus();
138
+ case "pr-fetch": return ghPrFetch(rest);
139
+ case "pr-review": return ghPrReview(rest);
140
+ case "pr-list-comments": return ghPrListComments();
141
+ default:
142
+ console.error("Usage: diffing gh <status|pr-fetch|pr-review|pr-list-comments> [...]");
143
+ return EXIT_USAGE;
144
+ }
145
+ }
146
+ //#endregion
147
+ export { runGhSubcommand };
@@ -0,0 +1,147 @@
1
+ import { i as readServerLock, r as isLockAlive, s as formatComments } from "./server-lock-D32inEn9.mjs";
2
+ import { parseArgs } from "node:util";
3
+ //#region src/cli-gh.ts
4
+ /**
5
+ * `diffing gh …` — the headless / port-agnostic surface for the PR review
6
+ * mode. Mirrors the shape of the local review CLI: each subcommand resolves
7
+ * the running server from the per-repo lockfile and talks to it via
8
+ * localhost HTTP. No port ever leaves the lockfile.
9
+ *
10
+ * diffing gh pr-fetch <ref> → GET /api/gh/pr/init then dump
11
+ * diffing gh pr-review → POST /api/gh/submit (current session)
12
+ * diffing gh pr-list-comments → GET /api/gh/pr-session/comments (XML)
13
+ * diffing gh status → GET /api/gh/session (one-line summary)
14
+ */
15
+ const EXIT_OK = 0;
16
+ const EXIT_NO_SERVER = 3;
17
+ const EXIT_NOT_FOUND = 4;
18
+ const EXIT_USAGE = 5;
19
+ function baseUrl() {
20
+ const lock = readServerLock();
21
+ if (!lock || !isLockAlive(lock)) {
22
+ console.error("No diffing server running for this repo. Start one with `diffing \"gh pr <ref>\"`.");
23
+ process.exit(EXIT_NO_SERVER);
24
+ }
25
+ return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
26
+ }
27
+ async function ghStatus() {
28
+ const base = baseUrl();
29
+ const res = await fetch(`${base}/api/gh/session`);
30
+ if (res.status === 404) {
31
+ console.error("No active PR session. Start one with `diffing \"gh pr <ref>\"`.");
32
+ return EXIT_NOT_FOUND;
33
+ }
34
+ const s = await res.json();
35
+ const submittedLine = s.submittedAt ? `submitted at ${new Date(s.submittedAt).toISOString()} → ${s.submittedReviewUrl ?? "(no url)"}` : "not submitted yet";
36
+ console.log(`${s.owner}/${s.repo}#${s.pullNumber} ${s.title}`);
37
+ console.log(` url: ${s.url}`);
38
+ console.log(` author: ${s.author?.login ?? "(unknown)"}`);
39
+ console.log(` +${s.additions} -${s.deletions} (${s.changedFiles} files)`);
40
+ console.log(` head: ${s.headSha.slice(0, 7)}`);
41
+ console.log(` base: ${s.baseSha.slice(0, 7)}`);
42
+ console.log(` existing: ${s.existingComments?.length ?? 0} review comments (read-only context)`);
43
+ console.log(` new: ${s.comments?.length ?? 0} comments in this session`);
44
+ console.log(` status: ${submittedLine}`);
45
+ return EXIT_OK;
46
+ }
47
+ async function ghPrFetch(args) {
48
+ const { values, positionals } = parseArgs({
49
+ args,
50
+ options: { json: { type: "boolean" } },
51
+ allowPositionals: true
52
+ });
53
+ const ref = positionals[0];
54
+ if (!ref) {
55
+ console.error("Usage: diffing gh pr-fetch <ref> [--json]");
56
+ return EXIT_USAGE;
57
+ }
58
+ const base = baseUrl();
59
+ const res = await fetch(`${base}/api/gh/pr/init`, {
60
+ method: "POST",
61
+ headers: { "Content-Type": "application/json" },
62
+ body: JSON.stringify({ ref })
63
+ });
64
+ if (!res.ok) {
65
+ const err = await res.json().catch(() => ({}));
66
+ console.error(`Failed to fetch PR: ${err.error ?? res.statusText}`);
67
+ return 1;
68
+ }
69
+ const result = await res.json();
70
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
71
+ else console.log(`${result.owner}/${result.repo}#${result.pullNumber} ${result.url}`);
72
+ return EXIT_OK;
73
+ }
74
+ async function ghPrListComments() {
75
+ const base = baseUrl();
76
+ const res = await fetch(`${base}/api/gh/pr-session/comments`);
77
+ if (res.status === 404) {
78
+ console.error("No active PR session.");
79
+ return EXIT_NOT_FOUND;
80
+ }
81
+ const comments = await res.json();
82
+ process.stdout.write(formatComments(comments) + "\n");
83
+ return EXIT_OK;
84
+ }
85
+ async function ghPrReview(args) {
86
+ const { values } = parseArgs({
87
+ args,
88
+ options: {
89
+ decision: {
90
+ type: "string",
91
+ short: "d"
92
+ },
93
+ body: {
94
+ type: "string",
95
+ short: "b"
96
+ },
97
+ "dry-run": { type: "boolean" },
98
+ json: { type: "boolean" }
99
+ },
100
+ allowPositionals: false
101
+ });
102
+ const decision = values.decision;
103
+ if (decision !== "approve" && decision !== "comment" && decision !== "request-changes") {
104
+ console.error("Usage: diffing gh pr-review --decision <approve|comment|request-changes> [--body <text>] [--dry-run]");
105
+ return EXIT_USAGE;
106
+ }
107
+ const base = baseUrl();
108
+ const payload = {
109
+ decision,
110
+ body: values.body ?? "",
111
+ dryRun: values["dry-run"] === true
112
+ };
113
+ const res = await fetch(`${base}/api/gh/submit`, {
114
+ method: "POST",
115
+ headers: { "Content-Type": "application/json" },
116
+ body: JSON.stringify(payload)
117
+ });
118
+ if (!res.ok) {
119
+ const err = await res.json().catch(() => ({}));
120
+ console.error(`Failed to submit review: ${err.error ?? res.statusText}`);
121
+ return 1;
122
+ }
123
+ const result = await res.json();
124
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
125
+ else if (result.ok) if (result.dryRun) console.log("Dry run OK — payload would have been accepted by GitHub.");
126
+ else console.log(`Review submitted via ${result.authSource}: ${result.reviewUrl ?? `#${result.reviewId}`}`);
127
+ else {
128
+ console.error(`Submit failed (auth=${result.authSource}): ${result.error ?? "unknown error"}`);
129
+ return 1;
130
+ }
131
+ return EXIT_OK;
132
+ }
133
+ async function runGhSubcommand(args) {
134
+ const action = args[0];
135
+ const rest = args.slice(1);
136
+ switch (action) {
137
+ case "status": return ghStatus();
138
+ case "pr-fetch": return ghPrFetch(rest);
139
+ case "pr-review": return ghPrReview(rest);
140
+ case "pr-list-comments": return ghPrListComments();
141
+ default:
142
+ console.error("Usage: diffing gh <status|pr-fetch|pr-review|pr-list-comments> [...]");
143
+ return EXIT_USAGE;
144
+ }
145
+ }
146
+ //#endregion
147
+ export { runGhSubcommand };
@@ -0,0 +1,147 @@
1
+ import { c as formatComments, i as readServerLock, r as isLockAlive } from "./server-lock-Dq_1CJaF.mjs";
2
+ import { parseArgs } from "node:util";
3
+ //#region src/cli-gh.ts
4
+ /**
5
+ * `diffing gh …` — the headless / port-agnostic surface for the PR review
6
+ * mode. Mirrors the shape of the local review CLI: each subcommand resolves
7
+ * the running server from the per-repo lockfile and talks to it via
8
+ * localhost HTTP. No port ever leaves the lockfile.
9
+ *
10
+ * diffing gh pr-fetch <ref> → GET /api/gh/pr/init then dump
11
+ * diffing gh pr-review → POST /api/gh/submit (current session)
12
+ * diffing gh pr-list-comments → GET /api/gh/pr-session/comments (XML)
13
+ * diffing gh status → GET /api/gh/session (one-line summary)
14
+ */
15
+ const EXIT_OK = 0;
16
+ const EXIT_NO_SERVER = 3;
17
+ const EXIT_NOT_FOUND = 4;
18
+ const EXIT_USAGE = 5;
19
+ function baseUrl() {
20
+ const lock = readServerLock();
21
+ if (!lock || !isLockAlive(lock)) {
22
+ console.error("No diffing server running for this repo. Start one with `diffing \"gh pr <ref>\"`.");
23
+ process.exit(EXIT_NO_SERVER);
24
+ }
25
+ return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
26
+ }
27
+ async function ghStatus() {
28
+ const base = baseUrl();
29
+ const res = await fetch(`${base}/api/gh/session`);
30
+ if (res.status === 404) {
31
+ console.error("No active PR session. Start one with `diffing \"gh pr <ref>\"`.");
32
+ return EXIT_NOT_FOUND;
33
+ }
34
+ const s = await res.json();
35
+ const submittedLine = s.submittedAt ? `submitted at ${new Date(s.submittedAt).toISOString()} → ${s.submittedReviewUrl ?? "(no url)"}` : "not submitted yet";
36
+ console.log(`${s.owner}/${s.repo}#${s.pullNumber} ${s.title}`);
37
+ console.log(` url: ${s.url}`);
38
+ console.log(` author: ${s.author?.login ?? "(unknown)"}`);
39
+ console.log(` +${s.additions} -${s.deletions} (${s.changedFiles} files)`);
40
+ console.log(` head: ${s.headSha.slice(0, 7)}`);
41
+ console.log(` base: ${s.baseSha.slice(0, 7)}`);
42
+ console.log(` existing: ${s.existingComments?.length ?? 0} review comments (read-only context)`);
43
+ console.log(` new: ${s.comments?.length ?? 0} comments in this session`);
44
+ console.log(` status: ${submittedLine}`);
45
+ return EXIT_OK;
46
+ }
47
+ async function ghPrFetch(args) {
48
+ const { values, positionals } = parseArgs({
49
+ args,
50
+ options: { json: { type: "boolean" } },
51
+ allowPositionals: true
52
+ });
53
+ const ref = positionals[0];
54
+ if (!ref) {
55
+ console.error("Usage: diffing gh pr-fetch <ref> [--json]");
56
+ return EXIT_USAGE;
57
+ }
58
+ const base = baseUrl();
59
+ const res = await fetch(`${base}/api/gh/pr/init`, {
60
+ method: "POST",
61
+ headers: { "Content-Type": "application/json" },
62
+ body: JSON.stringify({ ref })
63
+ });
64
+ if (!res.ok) {
65
+ const err = await res.json().catch(() => ({}));
66
+ console.error(`Failed to fetch PR: ${err.error ?? res.statusText}`);
67
+ return 1;
68
+ }
69
+ const result = await res.json();
70
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
71
+ else console.log(`${result.owner}/${result.repo}#${result.pullNumber} ${result.url}`);
72
+ return EXIT_OK;
73
+ }
74
+ async function ghPrListComments() {
75
+ const base = baseUrl();
76
+ const res = await fetch(`${base}/api/gh/pr-session/comments`);
77
+ if (res.status === 404) {
78
+ console.error("No active PR session.");
79
+ return EXIT_NOT_FOUND;
80
+ }
81
+ const comments = await res.json();
82
+ process.stdout.write(formatComments(comments) + "\n");
83
+ return EXIT_OK;
84
+ }
85
+ async function ghPrReview(args) {
86
+ const { values } = parseArgs({
87
+ args,
88
+ options: {
89
+ decision: {
90
+ type: "string",
91
+ short: "d"
92
+ },
93
+ body: {
94
+ type: "string",
95
+ short: "b"
96
+ },
97
+ "dry-run": { type: "boolean" },
98
+ json: { type: "boolean" }
99
+ },
100
+ allowPositionals: false
101
+ });
102
+ const decision = values.decision;
103
+ if (decision !== "approve" && decision !== "comment" && decision !== "request-changes") {
104
+ console.error("Usage: diffing gh pr-review --decision <approve|comment|request-changes> [--body <text>] [--dry-run]");
105
+ return EXIT_USAGE;
106
+ }
107
+ const base = baseUrl();
108
+ const payload = {
109
+ decision,
110
+ body: values.body ?? "",
111
+ dryRun: values["dry-run"] === true
112
+ };
113
+ const res = await fetch(`${base}/api/gh/submit`, {
114
+ method: "POST",
115
+ headers: { "Content-Type": "application/json" },
116
+ body: JSON.stringify(payload)
117
+ });
118
+ if (!res.ok) {
119
+ const err = await res.json().catch(() => ({}));
120
+ console.error(`Failed to submit review: ${err.error ?? res.statusText}`);
121
+ return 1;
122
+ }
123
+ const result = await res.json();
124
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
125
+ else if (result.ok) if (result.dryRun) console.log("Dry run OK — payload would have been accepted by GitHub.");
126
+ else console.log(`Review submitted via ${result.authSource}: ${result.reviewUrl ?? `#${result.reviewId}`}`);
127
+ else {
128
+ console.error(`Submit failed (auth=${result.authSource}): ${result.error ?? "unknown error"}`);
129
+ return 1;
130
+ }
131
+ return EXIT_OK;
132
+ }
133
+ async function runGhSubcommand(args) {
134
+ const action = args[0];
135
+ const rest = args.slice(1);
136
+ switch (action) {
137
+ case "status": return ghStatus();
138
+ case "pr-fetch": return ghPrFetch(rest);
139
+ case "pr-review": return ghPrReview(rest);
140
+ case "pr-list-comments": return ghPrListComments();
141
+ default:
142
+ console.error("Usage: diffing gh <status|pr-fetch|pr-review|pr-list-comments> [...]");
143
+ return EXIT_USAGE;
144
+ }
145
+ }
146
+ //#endregion
147
+ export { runGhSubcommand };
@@ -0,0 +1,147 @@
1
+ import { i as readServerLock, r as isLockAlive, s as formatComments } from "./server-lock-Cbu3qHdu.mjs";
2
+ import { parseArgs } from "node:util";
3
+ //#region src/cli-gh.ts
4
+ /**
5
+ * `diffing gh …` — the headless / port-agnostic surface for the PR review
6
+ * mode. Mirrors the shape of the local review CLI: each subcommand resolves
7
+ * the running server from the per-repo lockfile and talks to it via
8
+ * localhost HTTP. No port ever leaves the lockfile.
9
+ *
10
+ * diffing gh pr-fetch <ref> → GET /api/gh/pr/init then dump
11
+ * diffing gh pr-review → POST /api/gh/submit (current session)
12
+ * diffing gh pr-list-comments → GET /api/gh/pr-session/comments (XML)
13
+ * diffing gh status → GET /api/gh/session (one-line summary)
14
+ */
15
+ const EXIT_OK = 0;
16
+ const EXIT_NO_SERVER = 3;
17
+ const EXIT_NOT_FOUND = 4;
18
+ const EXIT_USAGE = 5;
19
+ function baseUrl() {
20
+ const lock = readServerLock();
21
+ if (!lock || !isLockAlive(lock)) {
22
+ console.error("No diffing server running for this repo. Start one with `diffing \"gh pr <ref>\"`.");
23
+ process.exit(EXIT_NO_SERVER);
24
+ }
25
+ return `http://${lock.host === "0.0.0.0" || lock.host === "::" ? "127.0.0.1" : lock.host}:${lock.port}`;
26
+ }
27
+ async function ghStatus() {
28
+ const base = baseUrl();
29
+ const res = await fetch(`${base}/api/gh/session`);
30
+ if (res.status === 404) {
31
+ console.error("No active PR session. Start one with `diffing \"gh pr <ref>\"`.");
32
+ return EXIT_NOT_FOUND;
33
+ }
34
+ const s = await res.json();
35
+ const submittedLine = s.submittedAt ? `submitted at ${new Date(s.submittedAt).toISOString()} → ${s.submittedReviewUrl ?? "(no url)"}` : "not submitted yet";
36
+ console.log(`${s.owner}/${s.repo}#${s.pullNumber} ${s.title}`);
37
+ console.log(` url: ${s.url}`);
38
+ console.log(` author: ${s.author?.login ?? "(unknown)"}`);
39
+ console.log(` +${s.additions} -${s.deletions} (${s.changedFiles} files)`);
40
+ console.log(` head: ${s.headSha.slice(0, 7)}`);
41
+ console.log(` base: ${s.baseSha.slice(0, 7)}`);
42
+ console.log(` existing: ${s.existingComments?.length ?? 0} review comments (read-only context)`);
43
+ console.log(` new: ${s.comments?.length ?? 0} comments in this session`);
44
+ console.log(` status: ${submittedLine}`);
45
+ return EXIT_OK;
46
+ }
47
+ async function ghPrFetch(args) {
48
+ const { values, positionals } = parseArgs({
49
+ args,
50
+ options: { json: { type: "boolean" } },
51
+ allowPositionals: true
52
+ });
53
+ const ref = positionals[0];
54
+ if (!ref) {
55
+ console.error("Usage: diffing gh pr-fetch <ref> [--json]");
56
+ return EXIT_USAGE;
57
+ }
58
+ const base = baseUrl();
59
+ const res = await fetch(`${base}/api/gh/pr/init`, {
60
+ method: "POST",
61
+ headers: { "Content-Type": "application/json" },
62
+ body: JSON.stringify({ ref })
63
+ });
64
+ if (!res.ok) {
65
+ const err = await res.json().catch(() => ({}));
66
+ console.error(`Failed to fetch PR: ${err.error ?? res.statusText}`);
67
+ return 1;
68
+ }
69
+ const result = await res.json();
70
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
71
+ else console.log(`${result.owner}/${result.repo}#${result.pullNumber} ${result.url}`);
72
+ return EXIT_OK;
73
+ }
74
+ async function ghPrListComments() {
75
+ const base = baseUrl();
76
+ const res = await fetch(`${base}/api/gh/pr-session/comments`);
77
+ if (res.status === 404) {
78
+ console.error("No active PR session.");
79
+ return EXIT_NOT_FOUND;
80
+ }
81
+ const comments = await res.json();
82
+ process.stdout.write(formatComments(comments) + "\n");
83
+ return EXIT_OK;
84
+ }
85
+ async function ghPrReview(args) {
86
+ const { values } = parseArgs({
87
+ args,
88
+ options: {
89
+ decision: {
90
+ type: "string",
91
+ short: "d"
92
+ },
93
+ body: {
94
+ type: "string",
95
+ short: "b"
96
+ },
97
+ "dry-run": { type: "boolean" },
98
+ json: { type: "boolean" }
99
+ },
100
+ allowPositionals: false
101
+ });
102
+ const decision = values.decision;
103
+ if (decision !== "approve" && decision !== "comment" && decision !== "request-changes") {
104
+ console.error("Usage: diffing gh pr-review --decision <approve|comment|request-changes> [--body <text>] [--dry-run]");
105
+ return EXIT_USAGE;
106
+ }
107
+ const base = baseUrl();
108
+ const payload = {
109
+ decision,
110
+ body: values.body ?? "",
111
+ dryRun: values["dry-run"] === true
112
+ };
113
+ const res = await fetch(`${base}/api/gh/submit`, {
114
+ method: "POST",
115
+ headers: { "Content-Type": "application/json" },
116
+ body: JSON.stringify(payload)
117
+ });
118
+ if (!res.ok) {
119
+ const err = await res.json().catch(() => ({}));
120
+ console.error(`Failed to submit review: ${err.error ?? res.statusText}`);
121
+ return 1;
122
+ }
123
+ const result = await res.json();
124
+ if (values.json) process.stdout.write(JSON.stringify(result, null, 2) + "\n");
125
+ else if (result.ok) if (result.dryRun) console.log("Dry run OK — payload would have been accepted by GitHub.");
126
+ else console.log(`Review submitted via ${result.authSource}: ${result.reviewUrl ?? `#${result.reviewId}`}`);
127
+ else {
128
+ console.error(`Submit failed (auth=${result.authSource}): ${result.error ?? "unknown error"}`);
129
+ return 1;
130
+ }
131
+ return EXIT_OK;
132
+ }
133
+ async function runGhSubcommand(args) {
134
+ const action = args[0];
135
+ const rest = args.slice(1);
136
+ switch (action) {
137
+ case "status": return ghStatus();
138
+ case "pr-fetch": return ghPrFetch(rest);
139
+ case "pr-review": return ghPrReview(rest);
140
+ case "pr-list-comments": return ghPrListComments();
141
+ default:
142
+ console.error("Usage: diffing gh <status|pr-fetch|pr-review|pr-list-comments> [...]");
143
+ return EXIT_USAGE;
144
+ }
145
+ }
146
+ //#endregion
147
+ export { runGhSubcommand };