diffing 0.10.5 → 0.11.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 (177) hide show
  1. package/README.md +77 -32
  2. package/dist/{cli-agent-BJiATn11.mjs → cli-agent-DkwGxuy2.mjs} +40 -11
  3. package/dist/{cli-gh-_bkDCxhh.mjs → cli-gh-D0NfKpOp.mjs} +4 -4
  4. package/dist/cli.mjs +150 -221
  5. package/dist/client/assets/{angular-html-CBcwKYDC.js → angular-html-Dl53kkiy.js} +1 -1
  6. package/dist/client/assets/{angular-ts-DRBYUaJA.js → angular-ts-wNJFFkey.js} +1 -1
  7. package/dist/client/assets/{apl-BM0X8jeL.js → apl-BxtQST-h.js} +1 -1
  8. package/dist/client/assets/{arc-DTkmmKl3.js → arc-CBmZuzPB.js} +1 -1
  9. package/dist/client/assets/{architectureDiagram-3BPJPVTR-Cw75ay7q.js → architectureDiagram-3BPJPVTR-CEci_K9f.js} +1 -1
  10. package/dist/client/assets/{astro-DKTNkoRZ.js → astro-BpADD5rh.js} +1 -1
  11. package/dist/client/assets/{blade-DaM7a9Zp.js → blade-B4I5SQmP.js} +1 -1
  12. package/dist/client/assets/{blockDiagram-GPEHLZMM-DAzINMr_.js → blockDiagram-GPEHLZMM-DcKhDtnE.js} +1 -1
  13. package/dist/client/assets/{c-B3C0Or4o.js → c-C3VtOgg8.js} +1 -1
  14. package/dist/client/assets/{c4Diagram-AAUBKEIU-C7SsS28g.js → c4Diagram-AAUBKEIU-CaHozoxF.js} +1 -1
  15. package/dist/client/assets/channel-Ct4-oSQN.js +1 -0
  16. package/dist/client/assets/{chunk-2J33WTMH-DHOUGWx8.js → chunk-2J33WTMH-tvuzKhdK.js} +1 -1
  17. package/dist/client/assets/{chunk-3OPIFGDE-D8d2scLX.js → chunk-3OPIFGDE-D_nBoD9w.js} +1 -1
  18. package/dist/client/assets/{chunk-4BX2VUAB-BSC-E5yg.js → chunk-4BX2VUAB-yHPdy1G8.js} +1 -1
  19. package/dist/client/assets/{chunk-55IACEB6-27pC5pKn.js → chunk-55IACEB6-yXpL8wjV.js} +1 -1
  20. package/dist/client/assets/{chunk-5ZQYHXKU-BM60x82y.js → chunk-5ZQYHXKU-DZ5cvCDV.js} +1 -1
  21. package/dist/client/assets/{chunk-727SXJPM-CHCF96vE.js → chunk-727SXJPM-CJjgOWmY.js} +1 -1
  22. package/dist/client/assets/{chunk-AQP2D5EJ-BoVsvmTa.js → chunk-AQP2D5EJ-CQYQKXSE.js} +1 -1
  23. package/dist/client/assets/{chunk-BSJP7CBP-Iip4uSio.js → chunk-BSJP7CBP-CP_f908b.js} +1 -1
  24. package/dist/client/assets/{chunk-CSCIHK7Q-DuIWPyay.js → chunk-CSCIHK7Q-tcgA8jR0.js} +1 -1
  25. package/dist/client/assets/{chunk-FMBD7UC4-Du6rtd2k.js → chunk-FMBD7UC4-DlpmhBYg.js} +1 -1
  26. package/dist/client/assets/{chunk-KSCS5N6A-BBq105vI.js → chunk-KSCS5N6A-BkfieXpV.js} +1 -1
  27. package/dist/client/assets/{chunk-L5ZTLDWV-0DmB5Qp8.js → chunk-L5ZTLDWV-BjVXSZnt.js} +1 -1
  28. package/dist/client/assets/{chunk-LZXEDZCA-CoRsjUfr.js → chunk-LZXEDZCA-CaAWmy4Q.js} +2 -2
  29. package/dist/client/assets/{chunk-ND2GUHAM-tX8cKEls.js → chunk-ND2GUHAM-kWh41zUn.js} +1 -1
  30. package/dist/client/assets/{chunk-NZK2D7GU-BoJGgPic.js → chunk-NZK2D7GU-CDrIi44_.js} +1 -1
  31. package/dist/client/assets/{chunk-O5CBEL6O-mlwCWs97.js → chunk-O5CBEL6O-CbNGK3Te.js} +1 -1
  32. package/dist/client/assets/chunk-QZHKN3VN-BXhKFVX7.js +1 -0
  33. package/dist/client/assets/chunk-WU5MYG2G-_EwuC51_.js +1 -0
  34. package/dist/client/assets/{chunk-XPW4576I-B5efww8M.js → chunk-XPW4576I-Cca0fTtG.js} +1 -1
  35. package/dist/client/assets/classDiagram-4FO5ZUOK-C8bdx9R4.js +1 -0
  36. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-B26wrQuH.js +1 -0
  37. package/dist/client/assets/{cobol-De9QR_Td.js → cobol-j-6eG2UQ.js} +1 -1
  38. package/dist/client/assets/{coffee-Ct_GvuHP.js → coffee-CZLH0dtt.js} +1 -1
  39. package/dist/client/assets/{cose-bilkent-S5V4N54A-ATaJZGF7.js → cose-bilkent-S5V4N54A-DlxESVex.js} +1 -1
  40. package/dist/client/assets/{cpp-Dw52w9cj.js → cpp-j6Bp24RI.js} +1 -1
  41. package/dist/client/assets/{crystal-Dx8ADdsd.js → crystal-DW7wcFUs.js} +1 -1
  42. package/dist/client/assets/{css-CZ13XvDU.js → css-C43BDU2i.js} +1 -1
  43. package/dist/client/assets/{dagre-BM42HDAG-aDltuYut.js → dagre-BM42HDAG-BaemEJFh.js} +1 -1
  44. package/dist/client/assets/{diagram-2AECGRRQ-DGWnHVMJ.js → diagram-2AECGRRQ-BaM-bkJ3.js} +1 -1
  45. package/dist/client/assets/{diagram-5GNKFQAL-Dd7eZBKe.js → diagram-5GNKFQAL-BOH04DJO.js} +1 -1
  46. package/dist/client/assets/{diagram-KO2AKTUF-DWThXREf.js → diagram-KO2AKTUF-BP5MyqDZ.js} +1 -1
  47. package/dist/client/assets/{diagram-LMA3HP47-CXR4Bjtc.js → diagram-LMA3HP47-Dt4gKMYF.js} +1 -1
  48. package/dist/client/assets/{diagram-OG6HWLK6-D4Cbf0nW.js → diagram-OG6HWLK6-DoT1VshN.js} +1 -1
  49. package/dist/client/assets/{dist-CUDhrHNw.js → dist-DEAxvC4F.js} +1 -1
  50. package/dist/client/assets/{edge-CQCjdJKj.js → edge-D9ySFlnD.js} +1 -1
  51. package/dist/client/assets/{elixir-bkjwPazA.js → elixir-CoJz_LQ5.js} +1 -1
  52. package/dist/client/assets/{elm-CCweX5Cq.js → elm-CvedWh_e.js} +1 -1
  53. package/dist/client/assets/{erDiagram-TEJ5UH35-BmAyt7SU.js → erDiagram-TEJ5UH35-CMP78FsQ.js} +1 -1
  54. package/dist/client/assets/{erb-D-Z-KBLp.js → erb-lD_yYZsm.js} +1 -1
  55. package/dist/client/assets/{flowDiagram-I6XJVG4X-C6nIFUVc.js → flowDiagram-I6XJVG4X-Dp0s5BFj.js} +1 -1
  56. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DMlxThBf.js → ganttDiagram-6RSMTGT7-GmSG31U-.js} +1 -1
  57. package/dist/client/assets/{git-rebase-BdoFdenB.js → git-rebase-DwZABzof.js} +1 -1
  58. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-JaIFkAIT.js → gitGraphDiagram-PVQCEYII-C1SXShag.js} +1 -1
  59. package/dist/client/assets/{glimmer-js-CZQrBJKq.js → glimmer-js-CWcs3w1Z.js} +1 -1
  60. package/dist/client/assets/{glimmer-ts-CBYW46D4.js → glimmer-ts-CrzGN4lJ.js} +1 -1
  61. package/dist/client/assets/{glsl-wxixKkY_.js → glsl-DRCtwX7h.js} +1 -1
  62. package/dist/client/assets/{graphql-CqZ0Lo5a.js → graphql-rpmrismS.js} +1 -1
  63. package/dist/client/assets/{hack-rqWymQRV.js → hack-Ba02RnuQ.js} +1 -1
  64. package/dist/client/assets/{haml-DFw_IoGM.js → haml-BHBACStm.js} +1 -1
  65. package/dist/client/assets/{handlebars-3VmTVMYt.js → handlebars-BtlQ1SCa.js} +1 -1
  66. package/dist/client/assets/{html-C0Li76jB.js → html-BkVU3Dge.js} +1 -1
  67. package/dist/client/assets/{html-derivative-CO-RQW8y.js → html-derivative-DoK92vwi.js} +1 -1
  68. package/dist/client/assets/{http-sPrZOeBY.js → http-CJAwKSPH.js} +1 -1
  69. package/dist/client/assets/{hurl-DUoPe4Lc.js → hurl-kaX5jwuN.js} +1 -1
  70. package/dist/client/assets/{index-BN_-di_r.js → index-BHeNiC07.js} +261 -199
  71. package/dist/client/assets/index-D8hOoJCg.css +1 -0
  72. package/dist/client/assets/{infoDiagram-5YYISTIA-B6AZ5SCV.js → infoDiagram-5YYISTIA-B0i3BlNR.js} +1 -1
  73. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CytMrpo8.js → ishikawaDiagram-YF4QCWOH-BN8sEei4.js} +1 -1
  74. package/dist/client/assets/{java-Cj0G6QRg.js → java-BvrigIoq.js} +1 -1
  75. package/dist/client/assets/{javascript-d5SUuyWD.js → javascript-DZkPTYAi.js} +1 -1
  76. package/dist/client/assets/{jinja-BTw9k0vO.js → jinja-Ceg7ui1S.js} +1 -1
  77. package/dist/client/assets/{jison-9xSVvR1q.js → jison-iE1GaOyN.js} +1 -1
  78. package/dist/client/assets/{journeyDiagram-JHISSGLW-Bd4jZUYI.js → journeyDiagram-JHISSGLW-CE6O3NhU.js} +1 -1
  79. package/dist/client/assets/{json-DjAt53ka.js → json-C0j8rEcg.js} +1 -1
  80. package/dist/client/assets/{jsx-BX5KmQ7d.js → jsx-B7eXljgz.js} +1 -1
  81. package/dist/client/assets/{julia-CLLx1dHC.js → julia-DMDw0aMP.js} +1 -1
  82. package/dist/client/assets/{just-C0v80bKe.js → just-BryMKRJ_.js} +1 -1
  83. package/dist/client/assets/{kanban-definition-UN3LZRKU-Ds4pXHJa.js → kanban-definition-UN3LZRKU-j-aU6Yzp.js} +1 -1
  84. package/dist/client/assets/{latex-DY-oQfwO.js → latex-BNC9-sjr.js} +1 -1
  85. package/dist/client/assets/{line-BbSLfOl6.js → line-CyEqpEDp.js} +1 -1
  86. package/dist/client/assets/{linear-BMIZJAAR.js → linear-CXeaA9km.js} +1 -1
  87. package/dist/client/assets/{liquid-DDHDgbZx.js → liquid-D-fQw-oJ.js} +1 -1
  88. package/dist/client/assets/{lua-CXymerKS.js → lua-CD2aJ_rS.js} +1 -1
  89. package/dist/client/assets/{marko-DoPFsptl.js → marko-BQ37hu6z.js} +1 -1
  90. package/dist/client/assets/{mdc-BxSmTphd.js → mdc-B5NUi3zZ.js} +1 -1
  91. package/dist/client/assets/{mermaid-parser.core-CcYSvN4q.js → mermaid-parser.core-BxHF_XbX.js} +1 -1
  92. package/dist/client/assets/{mermaid.core-COTNtqgQ.js → mermaid.core-BUtaf4P1.js} +3 -3
  93. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BTxraRzn.js → mindmap-definition-RKZ34NQL-D13tPu2o.js} +1 -1
  94. package/dist/client/assets/{nginx-Bma0jNOT.js → nginx-1W1E03Rg.js} +1 -1
  95. package/dist/client/assets/{nim-DMBpjygU.js → nim-C5A88bFP.js} +1 -1
  96. package/dist/client/assets/{perl-CrnrV-AJ.js → perl-BYoP0wNt.js} +1 -1
  97. package/dist/client/assets/{php-CDYxzX6t.js → php-CFxna09e.js} +1 -1
  98. package/dist/client/assets/{pieDiagram-4H26LBE5-DglRmzer.js → pieDiagram-4H26LBE5-CHL7Ml5w.js} +1 -1
  99. package/dist/client/assets/{pug-DNewy3GU.js → pug-BR4JgWAk.js} +1 -1
  100. package/dist/client/assets/{qml-COjcnZ-W.js → qml-D1U1EFEe.js} +1 -1
  101. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-BjSmyES7.js → quadrantDiagram-W4KKPZXB-BnYtv-HY.js} +1 -1
  102. package/dist/client/assets/{r-CrCaMxLS.js → r-ChE6X060.js} +1 -1
  103. package/dist/client/assets/{razor-jeuOZIar.js → razor-B5iVfQMe.js} +1 -1
  104. package/dist/client/assets/{regexp-DSHVUX08.js → regexp-Dz2drUIf.js} +1 -1
  105. package/dist/client/assets/{requirementDiagram-4Y6WPE33-B4f430jS.js → requirementDiagram-4Y6WPE33-D8QEGLKB.js} +1 -1
  106. package/dist/client/assets/{review-export-Cen1WEcX.js → review-export-CvFFbCAB.js} +1 -1
  107. package/dist/client/assets/{rst-CIDgytzc.js → rst-DZM3RGRs.js} +1 -1
  108. package/dist/client/assets/{ruby-DtuseoNq.js → ruby-DkXnm-J8.js} +1 -1
  109. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-TQPPlxc6.js → sankeyDiagram-5OEKKPKP-wVaks6lB.js} +1 -1
  110. package/dist/client/assets/{sas-C72Theia.js → sas-DMbpc71c.js} +1 -1
  111. package/dist/client/assets/{scss-ClECtwRk.js → scss-IwVMMp22.js} +1 -1
  112. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-D1tx07Wg.js → sequenceDiagram-3UESZ5HK-Cg31TB-R.js} +1 -1
  113. package/dist/client/assets/{shellscript-BCwBsi2k.js → shellscript-CIStAKx3.js} +1 -1
  114. package/dist/client/assets/{shellsession-BrOddEl5.js → shellsession-uLtzHhlo.js} +1 -1
  115. package/dist/client/assets/{soy-Dcs0GWFW.js → soy-BkxBYigm.js} +1 -1
  116. package/dist/client/assets/{sql-BAjA7Gv7.js → sql-Ba9y9EvJ.js} +1 -1
  117. package/dist/client/assets/{src-CYYhkqTK.js → src-9MKexpFu.js} +1 -1
  118. package/dist/client/assets/{stata-19ngQtzR.js → stata-CrPCbiIZ.js} +1 -1
  119. package/dist/client/assets/{stateDiagram-AJRCARHV-BZRCEzb5.js → stateDiagram-AJRCARHV-BbvNjVF6.js} +1 -1
  120. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-B5BbZkU5.js +1 -0
  121. package/dist/client/assets/{surrealql-Ce2TBRjE.js → surrealql-Dvip5u_o.js} +1 -1
  122. package/dist/client/assets/{svelte-DQ_1eGZz.js → svelte-xBLD60Zd.js} +1 -1
  123. package/dist/client/assets/{templ-Cw2DDxWF.js → templ-CWv68xbP.js} +1 -1
  124. package/dist/client/assets/{tex-myDSO2eP.js → tex-CHqz-fYs.js} +1 -1
  125. package/dist/client/assets/{timeline-definition-PNZ67QCA-CP0OZhBT.js → timeline-definition-PNZ67QCA-CWKkJ3QZ.js} +1 -1
  126. package/dist/client/assets/{ts-tags-rh39ZwVs.js → ts-tags-DS82EDuE.js} +1 -1
  127. package/dist/client/assets/{tsx-B0-26jrU.js → tsx-B2GBjp2F.js} +1 -1
  128. package/dist/client/assets/{twig-CgasHzPb.js → twig-CC8x9pG0.js} +1 -1
  129. package/dist/client/assets/{typescript-Dq3T0c-m.js → typescript-g7i13lnC.js} +1 -1
  130. package/dist/client/assets/{vennDiagram-CIIHVFJN-DHaKHj0j.js → vennDiagram-CIIHVFJN-OLItKWeg.js} +1 -1
  131. package/dist/client/assets/{vue-html-Bv2uFkTH.js → vue-html-D9GQtYub.js} +1 -1
  132. package/dist/client/assets/{vue-CzFVh92-.js → vue-rFbe7luB.js} +1 -1
  133. package/dist/client/assets/{vue-vine-DzieBk9Y.js → vue-vine-mrNtQtY5.js} +1 -1
  134. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-Dky7jxlZ.js → wardleyDiagram-YWT4CUSO-Dy1yfeb4.js} +1 -1
  135. package/dist/client/assets/{xml-wcdHRHN8.js → xml-CHfMjyAM.js} +1 -1
  136. package/dist/client/assets/{xsl-CXrwsLG9.js → xsl-BFkNSogJ.js} +1 -1
  137. package/dist/client/assets/{xychartDiagram-2RQKCTM6-BQ2hG60h.js → xychartDiagram-2RQKCTM6-DfSnfjVL.js} +1 -1
  138. package/dist/client/assets/{yaml-lO6lK6Xe.js → yaml-BfSgHc04.js} +1 -1
  139. package/dist/client/index.html +2 -2
  140. package/dist/{completions-3UF8uzhx.mjs → completions-BO2DUM-8.mjs} +21 -1
  141. package/dist/{doctor-BGYZNIYP.mjs → doctor-D0Y3kOY7.mjs} +5 -4
  142. package/dist/{find-tui-binary-CRpbYXLC.mjs → find-tui-binary-B71xiwWu.mjs} +33 -15
  143. package/dist/{github-DKT0lJXv.mjs → github-CErBub2y.mjs} +1 -1
  144. package/dist/{github-CEjtGd41.mjs → github-DBsZ0h_l.mjs} +3 -3
  145. package/dist/{github-attachments-Cf17YWp4.mjs → github-attachments-plDeB0iE.mjs} +1 -1
  146. package/dist/{mcp-Dq7J5QOP.mjs → mcp-DtVrMR2S.mjs} +13 -7
  147. package/dist/native/tui-darwin-arm64/diffing-tui +0 -0
  148. package/dist/native/tui-darwin-x64/diffing-tui +0 -0
  149. package/dist/native/tui-linux-arm64-gnu/diffing-tui +0 -0
  150. package/dist/native/tui-linux-arm64-musl/diffing-tui +0 -0
  151. package/dist/native/tui-linux-x64-gnu/diffing-tui +0 -0
  152. package/dist/native/tui-linux-x64-musl/diffing-tui +0 -0
  153. package/dist/native/tui-win32-x64-msvc/diffing-tui.exe +0 -0
  154. package/dist/{review-export-BBDWvftT.mjs → review-export-B63eRAVa.mjs} +1 -1
  155. package/dist/{settings-bwe7yQ8U.mjs → search-BMPY_ZW8.mjs} +117 -97
  156. package/dist/search-BO9Im7eu.mjs +2 -0
  157. package/dist/{server-C9i4V36o.mjs → server-j0PnTVX1.mjs} +146 -75
  158. package/dist/server-lock-CY0_1mcS.mjs +275 -0
  159. package/dist/session-conflict-C6V9ZKo7.mjs +96 -0
  160. package/dist/session-manager-CYNchhVA.mjs +159 -0
  161. package/dist/settings-yK0GYpbn.mjs +60 -0
  162. package/dist/tui-search-bridge-Bfb2ktdA.mjs +133 -0
  163. package/package.json +6 -4
  164. package/dist/client/assets/channel-lsVHTuYR.js +0 -1
  165. package/dist/client/assets/chunk-QZHKN3VN-AHUiTM0z.js +0 -1
  166. package/dist/client/assets/chunk-WU5MYG2G-D41j4yxb.js +0 -1
  167. package/dist/client/assets/classDiagram-4FO5ZUOK-D1Eo3kly.js +0 -1
  168. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-bAMsbsfB.js +0 -1
  169. package/dist/client/assets/index-B42c0TyV.css +0 -1
  170. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Da-mGMA2.js +0 -1
  171. package/dist/server-lock-Dd_ss_Il.mjs +0 -153
  172. /package/dist/{apply-suggestion-DNNsC5gx.mjs → apply-suggestion-CHYnw68I.mjs} +0 -0
  173. /package/dist/{comment-format-B5AcGcR-.mjs → comment-format-B85NHZnG.mjs} +0 -0
  174. /package/dist/{diff-fingerprint-C8YO3TTE.mjs → diff-fingerprint-BgR0tu1o.mjs} +0 -0
  175. /package/dist/{handoff-DPoIyeWn.mjs → handoff-LAFtmnHf.mjs} +0 -0
  176. /package/dist/{plan-format-BQyx--mp.mjs → plan-format-BwJh5JSE.mjs} +0 -0
  177. /package/dist/{update-check-DUuHmPeZ.mjs → update-check-Copcz9eb.mjs} +0 -0
package/dist/cli.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { a as intoShowMode, n as runTerminalDiff, o as parseDiffOptions, r as validateEnvironment, s as printHelp, t as startServer } from "./server-C9i4V36o.mjs";
3
- import { p as getRepoRoot } from "./git-Czo96ymM.mjs";
4
- import { t as loadSettings } from "./settings-bwe7yQ8U.mjs";
5
- import { a as removeServerLock, i as readServerLock, n as diffScopeKey, o as removeServerLockIfOwned, r as isLockAlive, s as writeServerLock, t as acquireServerStartupLease } from "./server-lock-Dd_ss_Il.mjs";
6
- import { t as findTuiBinary$1 } from "./find-tui-binary-CRpbYXLC.mjs";
7
- import { spawn } from "node:child_process";
2
+ import { a as buildTuiGitDiffArgs, c as printHelp, n as runTerminalDiff, o as intoShowMode, r as validateEnvironment, s as parseDiffOptions, t as startServer } from "./server-j0PnTVX1.mjs";
3
+ import { p as getRepoRoot, r as getBranchName } from "./git-Czo96ymM.mjs";
4
+ import { t as loadSettings } from "./settings-yK0GYpbn.mjs";
5
+ import { c as removeServerLockIfOwned, p as writeServerLock, r as diffScopeKey, t as acquireServerStartupLease, u as resolveActiveServerLock } from "./server-lock-CY0_1mcS.mjs";
6
+ import { n as openExistingSession, r as stopLockOwner } from "./session-conflict-C6V9ZKo7.mjs";
7
+ import { n as findTuiBinary$1, t as findTuiBinaries } from "./find-tui-binary-B71xiwWu.mjs";
8
+ import { execFileSync, spawn } from "node:child_process";
8
9
  import { randomUUID } from "node:crypto";
9
10
  import { fileURLToPath } from "node:url";
10
11
  import { dirname, isAbsolute, resolve } from "node:path";
11
12
  import { existsSync, readFileSync } from "node:fs";
12
13
  import getPort from "get-port";
13
14
  import { stdout } from "node:process";
14
- import { createInterface } from "node:readline";
15
15
  //#region src/lib/startup-display.ts
16
16
  const R = "\x1B[0m";
17
17
  const B = "\x1B[1m";
@@ -395,163 +395,61 @@ function playStartupDisplay() {
395
395
  })();
396
396
  }
397
397
  //#endregion
398
- //#region src/lib/session-conflict.ts
399
- function sleepMs(ms) {
400
- return new Promise((resolve) => setTimeout(resolve, ms));
401
- }
402
- /** Loopback-safe review URL for web / gh-pr locks; null for TUI or invalid ports. */
403
- function existingSessionUrl(lock) {
404
- const mode = lock.mode ?? "web";
405
- if (mode === "tui" || !(lock.port > 0)) return null;
406
- const host = lock.host === "0.0.0.0" ? "127.0.0.1" : lock.host;
407
- const path = mode === "gh-pr" ? "/gh/pr" : "";
408
- return `http://${host}:${lock.port}${path}`;
409
- }
410
- function formatExistingSession(lock) {
411
- const mode = lock.mode ?? "web";
412
- const url = existingSessionUrl(lock);
413
- return [
414
- "A diffing review is already running for this repository",
415
- url ? ` url: ${url}` : " url: (TUI session — no browser URL)",
416
- ` mode: ${mode}`,
417
- ` pid: ${lock.pid}`
418
- ].join("\n");
419
- }
420
- function conflictFailMessage(lock) {
421
- return `A diffing review is already running for this repository at ${existingSessionUrl(lock) ?? (lock.mode === "tui" || lock.port <= 0 ? "a TUI session" : `http://${lock.host}:${lock.port}`)}. End it before starting another scope.`;
422
- }
423
- /**
424
- * Resolve how to handle a live session conflict.
425
- * Flags win over the prompt; non-interactive callers get `cancel`.
426
- */
427
- async function resolveSessionConflictAction(options) {
428
- if (options.reuseSession && options.replaceSession) throw new Error("Cannot combine --reuse-session and --replace-session.");
429
- if (options.reuseSession) return "open";
430
- if (options.replaceSession) return "replace";
431
- if (!options.canPrompt) return "cancel";
432
- return (options.prompt ?? promptSessionConflict)(options.lock);
433
- }
398
+ //#region src/lib/tui-diff-context.ts
434
399
  /**
435
- * Interactive o/r/c prompt. Empty input defaults to open. Ctrl+C cancel.
400
+ * Build the compact "what is this diff?" label consumed by the native TUI.
401
+ *
402
+ * This deliberately uses the options the CLI already parsed instead of
403
+ * executing the diff a second time just to reproduce the web overview.
404
+ * File and line counts are added by the TUI from its live sparse index.
436
405
  */
437
- async function promptSessionConflict(lock) {
438
- const rl = createInterface({
439
- input: process.stdin,
440
- output: process.stderr
441
- });
442
- try {
443
- console.error(formatExistingSession(lock));
444
- console.error("");
445
- console.error("What do you want to do?");
446
- console.error(" [o] Open the existing session (default)");
447
- console.error(` [r] Replace it (stop pid ${lock.pid}, start a new review)`);
448
- console.error(" [c] Cancel");
449
- console.error("");
450
- while (true) {
451
- const choice = (await new Promise((resolve, reject) => {
452
- const onSigInt = () => {
453
- cleanup();
454
- reject(/* @__PURE__ */ new Error("cancelled"));
455
- };
456
- const cleanup = () => {
457
- process.off("SIGINT", onSigInt);
458
- };
459
- process.on("SIGINT", onSigInt);
460
- rl.question("Choice [o/r/c]: ", (raw) => {
461
- cleanup();
462
- resolve(raw);
463
- });
464
- })).trim().toLowerCase();
465
- if (choice === "" || choice === "o" || choice === "open") return "open";
466
- if (choice === "r" || choice === "replace") return "replace";
467
- if (choice === "c" || choice === "cancel" || choice === "q" || choice === "quit") return "cancel";
468
- console.error("Please enter o, r, or c.");
469
- }
470
- } catch {
471
- return "cancel";
472
- } finally {
473
- rl.close();
474
- }
406
+ function buildTuiDiffContext(opts, branch) {
407
+ const onBranch = branch ? ` on ${branch}` : "";
408
+ const detail = pathspecDetail(opts.pathspecs);
409
+ if (opts.showMode) {
410
+ const label = opts.showRevspecs.join(" ");
411
+ return {
412
+ kind: "commit",
413
+ headline: label ? `Showing ${label}` : "Commit changes",
414
+ ...detail ? { detail } : {}
415
+ };
416
+ }
417
+ if (opts.revisions.length > 0) {
418
+ const current = branch ? ` (current: ${branch})` : "";
419
+ return {
420
+ kind: "range",
421
+ headline: `Comparing ${opts.revisions.join(" ")}${current}`,
422
+ ...detail ? { detail } : {}
423
+ };
424
+ }
425
+ if (opts.staged) return {
426
+ kind: "staged-only",
427
+ headline: `Staged changes${onBranch}`,
428
+ ...detail ? { detail } : {}
429
+ };
430
+ return {
431
+ kind: "working-tree",
432
+ headline: `Working-tree changes${onBranch}`,
433
+ ...detail ? { detail } : {}
434
+ };
475
435
  }
476
- function defaultClearLock(lock) {
477
- const current = readServerLock(lock.repoRoot);
478
- if (current && current.pid === lock.pid) removeServerLock(lock.repoRoot);
479
- }
480
- function pidAlive(pid, kill) {
481
- try {
482
- kill(pid, 0);
483
- return true;
484
- } catch {
485
- return false;
486
- }
436
+ function pathspecDetail(pathspecs) {
437
+ if (pathspecs.length === 0) return void 0;
438
+ if (pathspecs.length === 1) return `Path: ${pathspecs[0]}`;
439
+ return `${pathspecs.length} path filters`;
487
440
  }
441
+ //#endregion
442
+ //#region src/lib/tui-child-lifecycle.ts
488
443
  /**
489
- * Gracefully stop the process that owns `lock`, then clear a matching lockfile.
490
- * SIGTERM wait SIGKILL wait throw.
444
+ * Release optional TUI-side resources without leaving the CLI's launch
445
+ * promise pending. Cleanup failures must not replace the native process's
446
+ * exit code.
491
447
  */
492
- async function stopLockOwner(lock, options = {}) {
493
- const timeoutMs = options.timeoutMs ?? 5e3;
494
- const killDeadlineMs = options.killDeadlineMs ?? 2e3;
495
- const pollMs = options.pollMs ?? 100;
496
- const kill = options.kill ?? ((pid, signal) => process.kill(pid, signal));
497
- const sleep = options.sleep ?? sleepMs;
498
- const now = options.now ?? Date.now;
499
- const isAlive = options.isAlive ?? ((candidate) => pidAlive(candidate.pid, kill));
500
- const clearLock = options.clearLock ?? defaultClearLock;
501
- if (!isAlive(lock)) {
502
- clearLock(lock);
503
- return;
504
- }
448
+ async function finishTuiChild(resource, settle) {
505
449
  try {
506
- kill(lock.pid, "SIGTERM");
507
- } catch {}
508
- const termDeadline = now() + timeoutMs;
509
- while (now() < termDeadline) {
510
- if (!isAlive(lock)) {
511
- clearLock(lock);
512
- return;
513
- }
514
- await sleep(pollMs);
515
- }
516
- try {
517
- kill(lock.pid, "SIGKILL");
518
- } catch {}
519
- const killDeadline = now() + killDeadlineMs;
520
- while (now() < killDeadline) {
521
- if (!isAlive(lock)) {
522
- clearLock(lock);
523
- return;
524
- }
525
- await sleep(pollMs);
526
- }
527
- throw new Error(`Timed out waiting for diffing pid ${lock.pid} to exit after SIGTERM/SIGKILL. End that process manually and try again.`);
528
- }
529
- /** Print and optionally open the existing web/gh-pr session; message-only for TUI. */
530
- async function openExistingSession(lock, options) {
531
- if ((lock.mode ?? "web") === "tui") {
532
- console.log(`A diffing TUI session is already open for this repository (pid ${lock.pid}). Use that terminal, or replace it with --replace-session.`);
533
- return;
534
- }
535
- const url = existingSessionUrl(lock);
536
- if (!url) {
537
- console.log(`A diffing review is already running for this repository (pid ${lock.pid}).`);
538
- return;
539
- }
540
- console.log(`Opening existing diffing session at ${url}`);
541
- if (options.noOpen) return;
542
- if (options.openUrl) {
543
- await options.openUrl(url);
544
- return;
545
- }
546
- try {
547
- const settings = loadSettings();
548
- const openModule = await import("open");
549
- let appName;
550
- if (settings.browser) appName = openModule.apps[settings.browser] || settings.browser;
551
- const openOptions = appName ? { app: { name: appName } } : {};
552
- await openModule.default(url, openOptions);
553
- } catch (err) {
554
- console.error("Failed to open browser:", err instanceof Error ? err.message : err);
450
+ await resource?.close();
451
+ } catch {} finally {
452
+ settle();
555
453
  }
556
454
  }
557
455
  //#endregion
@@ -585,7 +483,9 @@ if (new Set([
585
483
  "doctor",
586
484
  "completion",
587
485
  "progress",
588
- "inspect"
486
+ "inspect",
487
+ "mode",
488
+ "sessions"
589
489
  ]).has(args[0])) {
590
490
  if (args[0] === "mcp") {
591
491
  const mcpArgs = args.slice(1);
@@ -636,19 +536,27 @@ See docs/cli.md §5 (MCP) for the full tool table.`);
636
536
  console.error("diffing mcp: --repo must be an absolute path");
637
537
  process.exit(5);
638
538
  }
639
- const { startMcpServer } = await import("./mcp-Dq7J5QOP.mjs");
539
+ const { startMcpServer } = await import("./mcp-DtVrMR2S.mjs");
640
540
  await startMcpServer({ repoPath });
641
541
  await new Promise(() => {});
642
542
  }
643
- const { runSubcommand } = await import("./cli-agent-BJiATn11.mjs");
543
+ const { runSubcommand } = await import("./cli-agent-DkwGxuy2.mjs");
644
544
  process.exit(await runSubcommand(args[0], args.slice(1)));
645
545
  }
546
+ if (args[0] === "view") {
547
+ args.shift();
548
+ args.unshift("--view");
549
+ }
646
550
  let showSubcommand = false;
647
551
  if (args[0] === "show") {
648
552
  showSubcommand = true;
649
553
  args.shift();
650
554
  }
651
- const opts = parseDiffOptions(args);
555
+ const opts = parseDiffOptions(args, prRef ? "web" : loadSettings().defaultMode);
556
+ if (opts.reuseSession && opts.replaceSession) {
557
+ console.error("Cannot combine --reuse-session and --replace-session.");
558
+ process.exit(5);
559
+ }
652
560
  if (!prRef && opts.ghPr) prRef = opts.ghPr;
653
561
  if (showSubcommand) {
654
562
  if (opts.revisions.length === 0 && !opts.help && !opts.version) {
@@ -673,7 +581,7 @@ if (envErr) {
673
581
  process.exit(1);
674
582
  }
675
583
  if (opts.outputMode === "tui") {
676
- const tuiResult = await launchTui(args);
584
+ const tuiResult = await launchTui(args, opts);
677
585
  process.exit(tuiResult);
678
586
  }
679
587
  if (opts.outputMode === "terminal") {
@@ -684,7 +592,7 @@ const __pkgDir = dirname(fileURLToPath(import.meta.url));
684
592
  const currentVersion = JSON.parse(readFileSync(resolve(__pkgDir, "..", "package.json"), "utf-8")).version;
685
593
  const updateCheckPromise = (async () => {
686
594
  try {
687
- const { checkForUpdates } = await import("./update-check-DUuHmPeZ.mjs");
595
+ const { checkForUpdates } = await import("./update-check-Copcz9eb.mjs");
688
596
  return await checkForUpdates(currentVersion);
689
597
  } catch {
690
598
  return null;
@@ -707,51 +615,21 @@ if (!startupLease) {
707
615
  console.error("Another diffing process is starting a review for this repository. Retry in a moment.");
708
616
  process.exit(3);
709
617
  }
710
- const existingLock = readServerLock(repoRoot);
711
- if (existingLock && isLockAlive(existingLock, repoRoot)) {
618
+ const activeSession = opts.reuseSession || opts.replaceSession ? resolveActiveServerLock(repoRoot) : null;
619
+ if (activeSession && opts.reuseSession) {
712
620
  startupLease.release();
713
621
  startupLease = null;
714
- if (opts.reuseSession && opts.replaceSession) {
715
- console.error("Cannot combine --reuse-session and --replace-session.");
716
- process.exit(5);
717
- }
718
- let action;
719
- try {
720
- action = await resolveSessionConflictAction({
721
- lock: existingLock,
722
- reuseSession: opts.reuseSession,
723
- replaceSession: opts.replaceSession,
724
- canPrompt: Boolean(process.stdin.isTTY && process.stdout.isTTY)
725
- });
726
- } catch (error) {
727
- const detail = error instanceof Error ? error.message : String(error);
728
- console.error(detail);
729
- process.exit(5);
730
- }
731
- if (action === "cancel") {
732
- console.error(conflictFailMessage(existingLock));
733
- process.exit(3);
734
- }
735
- if (action === "open") {
736
- const live = readServerLock(repoRoot);
737
- await openExistingSession(live && isLockAlive(live, repoRoot) ? live : existingLock, { noOpen: opts.noOpen });
738
- process.exit(0);
739
- }
740
- startupLease = acquireServerStartupLease(repoRoot, sessionOwnerId);
741
- if (!startupLease) {
742
- console.error("Another diffing process is starting a review for this repository. Retry in a moment.");
743
- process.exit(3);
744
- }
745
- const afterLease = readServerLock(repoRoot);
746
- if (afterLease && isLockAlive(afterLease, repoRoot)) try {
747
- console.error(`Stopping existing diffing session (pid ${afterLease.pid})…`);
748
- await stopLockOwner(afterLease);
749
- } catch (error) {
750
- startupLease.release();
751
- const detail = error instanceof Error ? error.message : String(error);
752
- console.error(detail);
753
- process.exit(1);
754
- }
622
+ await openExistingSession(activeSession, { noOpen: opts.noOpen });
623
+ process.exit(0);
624
+ }
625
+ if (activeSession && opts.replaceSession) try {
626
+ console.error(`Stopping active diffing session (pid ${activeSession.pid})…`);
627
+ await stopLockOwner(activeSession);
628
+ } catch (error) {
629
+ startupLease.release();
630
+ const detail = error instanceof Error ? error.message : String(error);
631
+ console.error(detail);
632
+ process.exit(1);
755
633
  }
756
634
  let actualPort;
757
635
  let prMode;
@@ -775,7 +653,8 @@ try {
775
653
  mode: prMode ? "gh-pr" : "web",
776
654
  prRef: prMode ? prRef ?? void 0 : void 0,
777
655
  scope: diffScopeKey(opts),
778
- ownerId: sessionOwnerId
656
+ ownerId: sessionOwnerId,
657
+ sessionId: sessionOwnerId
779
658
  });
780
659
  } catch (error) {
781
660
  startupLease?.release();
@@ -802,7 +681,7 @@ playStartupDisplay();
802
681
  try {
803
682
  const updateInfo = await updateCheckPromise;
804
683
  if (updateInfo?.hasUpdate) {
805
- const { printUpdateDisclaimer } = await import("./update-check-DUuHmPeZ.mjs");
684
+ const { printUpdateDisclaimer } = await import("./update-check-Copcz9eb.mjs");
806
685
  printUpdateDisclaimer(currentVersion, updateInfo.latestVersion);
807
686
  }
808
687
  } catch {}
@@ -818,8 +697,23 @@ process.on("SIGTERM", shutdown);
818
697
  * so the search paths anchor to the bundled CLI's directory. The real
819
698
  * implementation lives in `lib/find-tui-binary.ts` and is unit-tested there.
820
699
  */
821
- function findTuiBinary() {
822
- return findTuiBinary$1(import.meta.url);
700
+ function findTuiBinary(requireViewer = false) {
701
+ if (!requireViewer) return findTuiBinary$1(import.meta.url);
702
+ return findTuiBinaries(import.meta.url).find((candidate) => {
703
+ try {
704
+ return execFileSync(candidate, ["--help"], {
705
+ encoding: "utf-8",
706
+ stdio: [
707
+ "ignore",
708
+ "pipe",
709
+ "ignore"
710
+ ],
711
+ timeout: 5e3
712
+ }).includes("--view-only");
713
+ } catch {
714
+ return false;
715
+ }
716
+ }) ?? null;
823
717
  }
824
718
  /**
825
719
  * Fall back to default `git diff` output when the TUI cannot run.
@@ -827,9 +721,10 @@ function findTuiBinary() {
827
721
  * in a non-TTY context.
828
722
  */
829
723
  function runTerminalFallback(args) {
830
- const terminalOpts = parseDiffOptions(args.filter((a) => a !== "--tui"));
724
+ const terminalOpts = parseDiffOptions(args.filter((a) => a !== "--tui" && a !== "--view"));
831
725
  terminalOpts.outputMode = "terminal";
832
726
  terminalOpts.tui = false;
727
+ terminalOpts.viewOnly = false;
833
728
  return runTerminalDiff(terminalOpts);
834
729
  }
835
730
  /**
@@ -837,38 +732,72 @@ function runTerminalFallback(args) {
837
732
  * exit code. If the TUI cannot start (no TTY, missing binary), prints a
838
733
  * single stderr line and falls back to the default `git diff` output.
839
734
  */
840
- async function launchTui(args) {
735
+ async function launchTui(args, opts) {
736
+ const viewOnly = args.includes("--view");
737
+ const requestedMode = viewOnly ? "diffing view" : "diffing --tui";
841
738
  if (!process.stdout.isTTY || !process.stdin.isTTY) {
842
- console.error("diffing --tui requires a TTY; falling back to git diff");
739
+ console.error(`${requestedMode} requires a TTY; falling back to git diff`);
843
740
  return runTerminalFallback(args);
844
741
  }
845
- const bin = findTuiBinary();
742
+ const bin = findTuiBinary(viewOnly);
846
743
  if (!bin) {
847
- console.error("diffing-tui binary not found; build it with `pnpm build:tui`; falling back to git diff");
744
+ console.error(`${viewOnly ? "compatible " : ""}diffing-tui binary not found; reinstall with \`npm i -g diffing@latest\` or build it with \`pnpm build:tui\`; falling back to git diff`);
848
745
  return runTerminalFallback(args);
849
746
  }
850
- const forwarded = args.filter((a) => a !== "--tui");
747
+ const forwarded = buildTuiGitDiffArgs(opts);
851
748
  let repoRoot;
852
749
  try {
853
750
  repoRoot = getRepoRoot();
854
751
  } catch {
855
752
  repoRoot = process.cwd();
856
753
  }
857
- console.log(`diffing TUI starting (binary: ${bin})`);
858
- await playStartupDisplay();
754
+ const activeSession = opts.reuseSession || opts.replaceSession ? resolveActiveServerLock(repoRoot) : null;
755
+ if (activeSession && opts.reuseSession) {
756
+ await openExistingSession(activeSession, { noOpen: opts.noOpen });
757
+ return 0;
758
+ }
759
+ if (activeSession && opts.replaceSession) try {
760
+ console.error(`Stopping active diffing session (pid ${activeSession.pid})…`);
761
+ await stopLockOwner(activeSession);
762
+ } catch (error) {
763
+ console.error(error instanceof Error ? error.message : String(error));
764
+ return 1;
765
+ }
766
+ let searchBridge = null;
767
+ try {
768
+ const { startTuiSearchBridge } = await import("./tui-search-bridge-Bfb2ktdA.mjs");
769
+ searchBridge = await startTuiSearchBridge();
770
+ } catch (error) {
771
+ console.error(`diffing: fff search unavailable in TUI: ${error?.message ?? error}`);
772
+ }
773
+ const diffContext = buildTuiDiffContext(opts, getBranchName());
774
+ const sessionId = randomUUID();
859
775
  return new Promise((resolveP) => {
860
776
  const child = spawn(bin, [
861
777
  "--repo",
862
778
  repoRoot,
779
+ ...viewOnly ? ["--view-only"] : [],
863
780
  ...forwarded
864
781
  ], {
865
782
  stdio: "inherit",
866
- env: process.env
783
+ env: {
784
+ ...process.env,
785
+ DIFFING_TUI_DIFF_CONTEXT: JSON.stringify(diffContext),
786
+ DIFFING_TUI_SESSION_ID: sessionId,
787
+ DIFFING_TUI_SESSION_SCOPE: diffScopeKey(opts),
788
+ DIFFING_TUI_SESSION_ARGS: JSON.stringify(forwarded),
789
+ ...searchBridge ? {
790
+ DIFFING_TUI_SEARCH_ENDPOINT: searchBridge.endpoint,
791
+ DIFFING_TUI_SEARCH_CAPABILITY: searchBridge.capability
792
+ } : {}
793
+ }
794
+ });
795
+ child.on("exit", (code) => {
796
+ finishTuiChild(searchBridge, () => resolveP(code ?? 0));
867
797
  });
868
- child.on("exit", (code) => resolveP(code ?? 0));
869
798
  child.on("error", (err) => {
870
799
  console.error(`diffing-tui failed to start: ${err.message}; falling back to git diff`);
871
- resolveP(runTerminalFallback(args));
800
+ finishTuiChild(searchBridge, () => resolveP(runTerminalFallback(args)));
872
801
  });
873
802
  });
874
803
  }