diffing 0.10.5 → 0.12.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 (182) hide show
  1. package/README.md +76 -41
  2. package/dist/{cli-agent-BJiATn11.mjs → cli-agent-CWsOHN-j.mjs} +198 -57
  3. package/dist/{cli-gh-_bkDCxhh.mjs → cli-gh-DI69gJGo.mjs} +27 -17
  4. package/dist/cli.mjs +189 -229
  5. package/dist/client/assets/{angular-html-CBcwKYDC.js → angular-html-PLPuQo0k.js} +1 -1
  6. package/dist/client/assets/{angular-ts-DRBYUaJA.js → angular-ts-CE02Ij4b.js} +1 -1
  7. package/dist/client/assets/{apl-BM0X8jeL.js → apl-CsuUKZoi.js} +1 -1
  8. package/dist/client/assets/{arc-DTkmmKl3.js → arc-CgL5kFe-.js} +1 -1
  9. package/dist/client/assets/{architectureDiagram-3BPJPVTR-Cw75ay7q.js → architectureDiagram-3BPJPVTR-DxZQWGnx.js} +1 -1
  10. package/dist/client/assets/{astro-DKTNkoRZ.js → astro-DkFc7sbz.js} +1 -1
  11. package/dist/client/assets/{blade-DaM7a9Zp.js → blade-BkY07kcC.js} +1 -1
  12. package/dist/client/assets/{blockDiagram-GPEHLZMM-DAzINMr_.js → blockDiagram-GPEHLZMM-D5a2KZV2.js} +1 -1
  13. package/dist/client/assets/{c-B3C0Or4o.js → c-T1BrPfJ6.js} +1 -1
  14. package/dist/client/assets/{c4Diagram-AAUBKEIU-C7SsS28g.js → c4Diagram-AAUBKEIU-mpMH4kFC.js} +1 -1
  15. package/dist/client/assets/channel-D3niKhl0.js +1 -0
  16. package/dist/client/assets/{chunk-2J33WTMH-DHOUGWx8.js → chunk-2J33WTMH-vMtgRLFH.js} +1 -1
  17. package/dist/client/assets/{chunk-3OPIFGDE-D8d2scLX.js → chunk-3OPIFGDE-Dx-FqyO2.js} +1 -1
  18. package/dist/client/assets/{chunk-4BX2VUAB-BSC-E5yg.js → chunk-4BX2VUAB-CUrPd8Kv.js} +1 -1
  19. package/dist/client/assets/{chunk-55IACEB6-27pC5pKn.js → chunk-55IACEB6-DHg3Nr8A.js} +1 -1
  20. package/dist/client/assets/{chunk-5ZQYHXKU-BM60x82y.js → chunk-5ZQYHXKU-CpDPvbGs.js} +1 -1
  21. package/dist/client/assets/{chunk-727SXJPM-CHCF96vE.js → chunk-727SXJPM-3VOGMxwk.js} +1 -1
  22. package/dist/client/assets/{chunk-AQP2D5EJ-BoVsvmTa.js → chunk-AQP2D5EJ-4dbfbIS6.js} +1 -1
  23. package/dist/client/assets/{chunk-BSJP7CBP-Iip4uSio.js → chunk-BSJP7CBP-Dfyn0Uwp.js} +1 -1
  24. package/dist/client/assets/{chunk-CSCIHK7Q-DuIWPyay.js → chunk-CSCIHK7Q-VTpSKo0F.js} +1 -1
  25. package/dist/client/assets/{chunk-FMBD7UC4-Du6rtd2k.js → chunk-FMBD7UC4-kXD1MyOL.js} +1 -1
  26. package/dist/client/assets/{chunk-KSCS5N6A-BBq105vI.js → chunk-KSCS5N6A-BrVoWOAb.js} +1 -1
  27. package/dist/client/assets/{chunk-L5ZTLDWV-0DmB5Qp8.js → chunk-L5ZTLDWV-wZEQDPsa.js} +1 -1
  28. package/dist/client/assets/{chunk-LZXEDZCA-CoRsjUfr.js → chunk-LZXEDZCA-D3i0B0eg.js} +2 -2
  29. package/dist/client/assets/{chunk-ND2GUHAM-tX8cKEls.js → chunk-ND2GUHAM-hDVHT0bN.js} +1 -1
  30. package/dist/client/assets/{chunk-NZK2D7GU-BoJGgPic.js → chunk-NZK2D7GU-jQUfhp9h.js} +1 -1
  31. package/dist/client/assets/{chunk-O5CBEL6O-mlwCWs97.js → chunk-O5CBEL6O-CX_vPWhk.js} +1 -1
  32. package/dist/client/assets/chunk-QZHKN3VN-CZLFuGpt.js +1 -0
  33. package/dist/client/assets/chunk-WU5MYG2G-BhcpjkaB.js +1 -0
  34. package/dist/client/assets/{chunk-XPW4576I-B5efww8M.js → chunk-XPW4576I-Co_-vDB4.js} +1 -1
  35. package/dist/client/assets/classDiagram-4FO5ZUOK-DK5KJNIt.js +1 -0
  36. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-y5K9t6Se.js +1 -0
  37. package/dist/client/assets/{cobol-De9QR_Td.js → cobol-8-qBLs-a.js} +1 -1
  38. package/dist/client/assets/{coffee-Ct_GvuHP.js → coffee-Bjz5lkyW.js} +1 -1
  39. package/dist/client/assets/{cose-bilkent-S5V4N54A-ATaJZGF7.js → cose-bilkent-S5V4N54A-BljJ0FSA.js} +1 -1
  40. package/dist/client/assets/{cpp-Dw52w9cj.js → cpp-5BVQCBXT.js} +1 -1
  41. package/dist/client/assets/{crystal-Dx8ADdsd.js → crystal-CCkY93GS.js} +1 -1
  42. package/dist/client/assets/{css-CZ13XvDU.js → css-BTM7Tp2a.js} +1 -1
  43. package/dist/client/assets/{dagre-BM42HDAG-aDltuYut.js → dagre-BM42HDAG-BSynd_2D.js} +1 -1
  44. package/dist/client/assets/{diagram-2AECGRRQ-DGWnHVMJ.js → diagram-2AECGRRQ-K3E2CVdy.js} +1 -1
  45. package/dist/client/assets/{diagram-5GNKFQAL-Dd7eZBKe.js → diagram-5GNKFQAL-BQHIrfKc.js} +1 -1
  46. package/dist/client/assets/{diagram-KO2AKTUF-DWThXREf.js → diagram-KO2AKTUF-Bqs8sNN4.js} +1 -1
  47. package/dist/client/assets/{diagram-LMA3HP47-CXR4Bjtc.js → diagram-LMA3HP47-C9K4bpQe.js} +1 -1
  48. package/dist/client/assets/{diagram-OG6HWLK6-D4Cbf0nW.js → diagram-OG6HWLK6-DK6wIXY2.js} +1 -1
  49. package/dist/client/assets/{dist-CUDhrHNw.js → dist-1nkZYMRy.js} +1 -1
  50. package/dist/client/assets/{edge-CQCjdJKj.js → edge-DqN2FJce.js} +1 -1
  51. package/dist/client/assets/{elixir-bkjwPazA.js → elixir-BiAgRUFF.js} +1 -1
  52. package/dist/client/assets/{elm-CCweX5Cq.js → elm-N1IbY8sz.js} +1 -1
  53. package/dist/client/assets/{erDiagram-TEJ5UH35-BmAyt7SU.js → erDiagram-TEJ5UH35-jsHCiP02.js} +1 -1
  54. package/dist/client/assets/{erb-D-Z-KBLp.js → erb-B-yYlWAZ.js} +1 -1
  55. package/dist/client/assets/{flowDiagram-I6XJVG4X-C6nIFUVc.js → flowDiagram-I6XJVG4X-DOB1dAWG.js} +1 -1
  56. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DMlxThBf.js → ganttDiagram-6RSMTGT7-BYIewcY5.js} +1 -1
  57. package/dist/client/assets/{git-rebase-BdoFdenB.js → git-rebase-CVkPxOAF.js} +1 -1
  58. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-JaIFkAIT.js → gitGraphDiagram-PVQCEYII-VNQzbpv2.js} +1 -1
  59. package/dist/client/assets/{glimmer-js-CZQrBJKq.js → glimmer-js-BmG1xm72.js} +1 -1
  60. package/dist/client/assets/{glimmer-ts-CBYW46D4.js → glimmer-ts-CvTgwZsg.js} +1 -1
  61. package/dist/client/assets/{glsl-wxixKkY_.js → glsl-DwjNNCbW.js} +1 -1
  62. package/dist/client/assets/{graphql-CqZ0Lo5a.js → graphql-BvgkyF8E.js} +1 -1
  63. package/dist/client/assets/{hack-rqWymQRV.js → hack-DH3188x2.js} +1 -1
  64. package/dist/client/assets/{haml-DFw_IoGM.js → haml-B0GTfMhX.js} +1 -1
  65. package/dist/client/assets/{handlebars-3VmTVMYt.js → handlebars-he7hLDd9.js} +1 -1
  66. package/dist/client/assets/{html-C0Li76jB.js → html-DIYgdTBq.js} +1 -1
  67. package/dist/client/assets/{html-derivative-CO-RQW8y.js → html-derivative-2s6MXlci.js} +1 -1
  68. package/dist/client/assets/{http-sPrZOeBY.js → http-COS23XJP.js} +1 -1
  69. package/dist/client/assets/{hurl-DUoPe4Lc.js → hurl-BlZPjeJt.js} +1 -1
  70. package/dist/client/assets/index-BrEVVQOB.js +4021 -0
  71. package/dist/client/assets/index-BsuX6HVI.css +1 -0
  72. package/dist/client/assets/{infoDiagram-5YYISTIA-B6AZ5SCV.js → infoDiagram-5YYISTIA-DQRqk24I.js} +1 -1
  73. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CytMrpo8.js → ishikawaDiagram-YF4QCWOH-DU1rqrLx.js} +1 -1
  74. package/dist/client/assets/{java-Cj0G6QRg.js → java-BAa5w-Qd.js} +1 -1
  75. package/dist/client/assets/{javascript-d5SUuyWD.js → javascript-C9e02ssI.js} +1 -1
  76. package/dist/client/assets/{jinja-BTw9k0vO.js → jinja-Bx37xXwq.js} +1 -1
  77. package/dist/client/assets/{jison-9xSVvR1q.js → jison-m_DEf8Jo.js} +1 -1
  78. package/dist/client/assets/{journeyDiagram-JHISSGLW-Bd4jZUYI.js → journeyDiagram-JHISSGLW-CoHlfevf.js} +1 -1
  79. package/dist/client/assets/{json-DjAt53ka.js → json-DtN5AWRW.js} +1 -1
  80. package/dist/client/assets/{jsx-BX5KmQ7d.js → jsx-BlPpu8bR.js} +1 -1
  81. package/dist/client/assets/{julia-CLLx1dHC.js → julia-BAOmCbHl.js} +1 -1
  82. package/dist/client/assets/{just-C0v80bKe.js → just-C_bvVjwE.js} +1 -1
  83. package/dist/client/assets/{kanban-definition-UN3LZRKU-Ds4pXHJa.js → kanban-definition-UN3LZRKU-BiqYI7_m.js} +1 -1
  84. package/dist/client/assets/{latex-DY-oQfwO.js → latex-81pMfNMt.js} +1 -1
  85. package/dist/client/assets/{line-BbSLfOl6.js → line-DCovs9My.js} +1 -1
  86. package/dist/client/assets/{linear-BMIZJAAR.js → linear-cJF5XHE7.js} +1 -1
  87. package/dist/client/assets/{liquid-DDHDgbZx.js → liquid-sKRTk6dT.js} +1 -1
  88. package/dist/client/assets/{lua-CXymerKS.js → lua-C1uZL4IF.js} +1 -1
  89. package/dist/client/assets/{marko-DoPFsptl.js → marko-BKEzP1CL.js} +1 -1
  90. package/dist/client/assets/{mdc-BxSmTphd.js → mdc-CLkfm94H.js} +1 -1
  91. package/dist/client/assets/{mermaid-parser.core-CcYSvN4q.js → mermaid-parser.core-CTsTbvb2.js} +1 -1
  92. package/dist/client/assets/{mermaid.core-COTNtqgQ.js → mermaid.core-D86HJEwL.js} +3 -3
  93. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BTxraRzn.js → mindmap-definition-RKZ34NQL-CL3heUmL.js} +1 -1
  94. package/dist/client/assets/{nginx-Bma0jNOT.js → nginx-eDGm66pc.js} +1 -1
  95. package/dist/client/assets/{nim-DMBpjygU.js → nim-CoWZPv8-.js} +1 -1
  96. package/dist/client/assets/{perl-CrnrV-AJ.js → perl-MoMqtMVr.js} +1 -1
  97. package/dist/client/assets/{php-CDYxzX6t.js → php-DXXVMAtN.js} +1 -1
  98. package/dist/client/assets/{pieDiagram-4H26LBE5-DglRmzer.js → pieDiagram-4H26LBE5-CWV3TMu4.js} +1 -1
  99. package/dist/client/assets/{pug-DNewy3GU.js → pug-CPWaB94J.js} +1 -1
  100. package/dist/client/assets/{qml-COjcnZ-W.js → qml-lhvpx8vk.js} +1 -1
  101. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-BjSmyES7.js → quadrantDiagram-W4KKPZXB-QV25BYos.js} +1 -1
  102. package/dist/client/assets/{r-CrCaMxLS.js → r-DYbUnmmK.js} +1 -1
  103. package/dist/client/assets/{razor-jeuOZIar.js → razor-DcyOLv96.js} +1 -1
  104. package/dist/client/assets/{regexp-DSHVUX08.js → regexp-BdY10jm0.js} +1 -1
  105. package/dist/client/assets/{requirementDiagram-4Y6WPE33-B4f430jS.js → requirementDiagram-4Y6WPE33-BPMsmU6J.js} +1 -1
  106. package/dist/client/assets/{review-export-Cen1WEcX.js → review-export-CMwjJURs.js} +1 -1
  107. package/dist/client/assets/{rst-CIDgytzc.js → rst-6ShFOzgH.js} +1 -1
  108. package/dist/client/assets/{ruby-DtuseoNq.js → ruby-B04DeVbi.js} +1 -1
  109. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-TQPPlxc6.js → sankeyDiagram-5OEKKPKP-DQJeroPp.js} +1 -1
  110. package/dist/client/assets/{sas-C72Theia.js → sas-Dj26ftNa.js} +1 -1
  111. package/dist/client/assets/{scss-ClECtwRk.js → scss-BOHpBkgl.js} +1 -1
  112. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-D1tx07Wg.js → sequenceDiagram-3UESZ5HK-DdV0Y6Sz.js} +1 -1
  113. package/dist/client/assets/{shellscript-BCwBsi2k.js → shellscript-CpHwjRcU.js} +1 -1
  114. package/dist/client/assets/{shellsession-BrOddEl5.js → shellsession-BJAvf4GN.js} +1 -1
  115. package/dist/client/assets/{soy-Dcs0GWFW.js → soy-B67bZJnL.js} +1 -1
  116. package/dist/client/assets/{sql-BAjA7Gv7.js → sql-8MzOqSsK.js} +1 -1
  117. package/dist/client/assets/{src-CYYhkqTK.js → src-AaoRSmFl.js} +1 -1
  118. package/dist/client/assets/{stata-19ngQtzR.js → stata-aCME945h.js} +1 -1
  119. package/dist/client/assets/{stateDiagram-AJRCARHV-BZRCEzb5.js → stateDiagram-AJRCARHV-CMD_Xj2M.js} +1 -1
  120. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-vLl7D4ue.js +1 -0
  121. package/dist/client/assets/{surrealql-Ce2TBRjE.js → surrealql-B_V_HxAi.js} +1 -1
  122. package/dist/client/assets/{svelte-DQ_1eGZz.js → svelte-BcQvTlqz.js} +1 -1
  123. package/dist/client/assets/{templ-Cw2DDxWF.js → templ-DZCQ2blz.js} +1 -1
  124. package/dist/client/assets/{tex-myDSO2eP.js → tex-BfeQ5Wuu.js} +1 -1
  125. package/dist/client/assets/{timeline-definition-PNZ67QCA-CP0OZhBT.js → timeline-definition-PNZ67QCA-CyIS7Zoe.js} +1 -1
  126. package/dist/client/assets/{ts-tags-rh39ZwVs.js → ts-tags-DVWE0E87.js} +1 -1
  127. package/dist/client/assets/{tsx-B0-26jrU.js → tsx-DdJ7Sfqf.js} +1 -1
  128. package/dist/client/assets/{twig-CgasHzPb.js → twig-_gVgaha5.js} +1 -1
  129. package/dist/client/assets/{typescript-Dq3T0c-m.js → typescript-Bj0_LzZV.js} +1 -1
  130. package/dist/client/assets/{vennDiagram-CIIHVFJN-DHaKHj0j.js → vennDiagram-CIIHVFJN-C-J2kWyk.js} +1 -1
  131. package/dist/client/assets/{vue-CzFVh92-.js → vue-Dnt_GBRb.js} +1 -1
  132. package/dist/client/assets/{vue-html-Bv2uFkTH.js → vue-html-ClVA5__5.js} +1 -1
  133. package/dist/client/assets/{vue-vine-DzieBk9Y.js → vue-vine-BCcz4SVP.js} +1 -1
  134. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-Dky7jxlZ.js → wardleyDiagram-YWT4CUSO-Dzt4EPh8.js} +1 -1
  135. package/dist/client/assets/{xml-wcdHRHN8.js → xml-BYeUHEti.js} +1 -1
  136. package/dist/client/assets/{xsl-CXrwsLG9.js → xsl-Vsx0SZEV.js} +1 -1
  137. package/dist/client/assets/{xychartDiagram-2RQKCTM6-BQ2hG60h.js → xychartDiagram-2RQKCTM6-BAWZKvwP.js} +1 -1
  138. package/dist/client/assets/{yaml-lO6lK6Xe.js → yaml-C6L1khMK.js} +1 -1
  139. package/dist/client/index.html +2 -2
  140. package/dist/{completions-3UF8uzhx.mjs → completions-DvyV49HY.mjs} +22 -1
  141. package/dist/{doctor-BGYZNIYP.mjs → doctor-Bz9VHuBI.mjs} +7 -6
  142. package/dist/find-tui-binary-DVQADOSF.mjs +101 -0
  143. package/dist/{git-Czo96ymM.mjs → git-BGj31GX-.mjs} +71 -7
  144. package/dist/git-CfDSkUcE.mjs +2 -0
  145. package/dist/{github-DKT0lJXv.mjs → github-DXiEeHzk.mjs} +1 -1
  146. package/dist/{github-CEjtGd41.mjs → github-DpzqNrUh.mjs} +3 -3
  147. package/dist/{github-attachments-Cf17YWp4.mjs → github-attachments-DgOf7BhP.mjs} +2 -2
  148. package/dist/{mcp-Dq7J5QOP.mjs → mcp-zDVzU1vl.mjs} +42 -33
  149. package/dist/native/tui-darwin-arm64/diffing-tui +0 -0
  150. package/dist/native/tui-darwin-x64/diffing-tui +0 -0
  151. package/dist/native/tui-linux-arm64-gnu/diffing-tui +0 -0
  152. package/dist/native/tui-linux-arm64-musl/diffing-tui +0 -0
  153. package/dist/native/tui-linux-x64-gnu/diffing-tui +0 -0
  154. package/dist/native/tui-linux-x64-musl/diffing-tui +0 -0
  155. package/dist/native/tui-win32-x64-msvc/diffing-tui.exe +0 -0
  156. package/dist/{review-export-BBDWvftT.mjs → review-export-B63eRAVa.mjs} +1 -1
  157. package/dist/{settings-bwe7yQ8U.mjs → search-3R2E5xxr.mjs} +133 -98
  158. package/dist/search-CQ4nsjBX.mjs +2 -0
  159. package/dist/{server-C9i4V36o.mjs → server-Dw3lkQ5q.mjs} +296 -110
  160. package/dist/server-lock-BNI8FKV1.mjs +427 -0
  161. package/dist/session-conflict-Bqt1M4Mp.mjs +96 -0
  162. package/dist/session-manager-BKSZQqDJ.mjs +159 -0
  163. package/dist/session-url-sr7lXXVc.mjs +100 -0
  164. package/dist/tui-search-bridge-BGgLCwMF.mjs +133 -0
  165. package/dist/{update-check-DUuHmPeZ.mjs → update-check-BUfh4Y6c.mjs} +16 -15
  166. package/package.json +9 -4
  167. package/dist/client/assets/channel-lsVHTuYR.js +0 -1
  168. package/dist/client/assets/chunk-QZHKN3VN-AHUiTM0z.js +0 -1
  169. package/dist/client/assets/chunk-WU5MYG2G-D41j4yxb.js +0 -1
  170. package/dist/client/assets/classDiagram-4FO5ZUOK-D1Eo3kly.js +0 -1
  171. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-bAMsbsfB.js +0 -1
  172. package/dist/client/assets/index-B42c0TyV.css +0 -1
  173. package/dist/client/assets/index-BN_-di_r.js +0 -3959
  174. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Da-mGMA2.js +0 -1
  175. package/dist/find-tui-binary-CRpbYXLC.mjs +0 -52
  176. package/dist/git-DaP_1rVy.mjs +0 -2
  177. package/dist/server-lock-Dd_ss_Il.mjs +0 -153
  178. /package/dist/{apply-suggestion-DNNsC5gx.mjs → apply-suggestion-CHYnw68I.mjs} +0 -0
  179. /package/dist/{comment-format-B5AcGcR-.mjs → comment-format-B85NHZnG.mjs} +0 -0
  180. /package/dist/{diff-fingerprint-C8YO3TTE.mjs → diff-fingerprint-BgR0tu1o.mjs} +0 -0
  181. /package/dist/{handoff-DPoIyeWn.mjs → handoff-LAFtmnHf.mjs} +0 -0
  182. /package/dist/{plan-format-BQyx--mp.mjs → plan-format-BwJh5JSE.mjs} +0 -0
@@ -1,2 +1,2 @@
1
- import { C as replyToPrComment, d as fetchPrChecks, n as buildReviewPayload, w as resolvedFromSession } from "./github-CEjtGd41.mjs";
1
+ import { C as replyToPrComment, d as fetchPrChecks, n as buildReviewPayload, w as resolvedFromSession } from "./github-DpzqNrUh.mjs";
2
2
  export { buildReviewPayload, fetchPrChecks, replyToPrComment, resolvedFromSession };
@@ -533,7 +533,7 @@ async function submitReview(input) {
533
533
  async function prepareSubmitInputWithAttachments(input) {
534
534
  const comments = input.comments ?? [];
535
535
  const bodies = [input.body ?? "", ...comments.map((c) => c.body ?? "")];
536
- const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-Cf17YWp4.mjs");
536
+ const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-DgOf7BhP.mjs");
537
537
  const result = await rewriteLocalAttachmentsInBodies(input.resolved, bodies);
538
538
  if (result.error) return { error: result.error };
539
539
  if (result.uploaded === 0 && Object.keys(result.urlMap).length === 0) return { input };
@@ -740,7 +740,7 @@ async function fetchPrChecks(resolved, headSha) {
740
740
  * POST /repos/{owner}/{repo}/pulls/{pull_number}/comments with in_reply_to.
741
741
  */
742
742
  async function replyToPrComment(input) {
743
- const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-Cf17YWp4.mjs");
743
+ const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-DgOf7BhP.mjs");
744
744
  const rewritten = await rewriteLocalAttachmentsInBodies(input.resolved, [input.body]);
745
745
  if (rewritten.error) return {
746
746
  ok: false,
@@ -793,7 +793,7 @@ async function replyToPrComment(input) {
793
793
  }
794
794
  }
795
795
  async function updatePrReviewComment(input) {
796
- const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-Cf17YWp4.mjs");
796
+ const { rewriteLocalAttachmentsInBodies } = await import("./github-attachments-DgOf7BhP.mjs");
797
797
  const rewritten = await rewriteLocalAttachmentsInBodies(input.resolved, [input.body]);
798
798
  if (rewritten.error) return {
799
799
  ok: false,
@@ -1,5 +1,5 @@
1
- import { d as getProjectStorageDir, w as toSafeRelativePath } from "./git-Czo96ymM.mjs";
2
- import { _ as isGithubDotCom, g as githubApiBase, m as ghHostnameArgs, o as detectGhCli, s as execWithInput, x as readGithubToken } from "./github-CEjtGd41.mjs";
1
+ import { D as toSafeRelativePath, f as getProjectStorageDir } from "./git-BGj31GX-.mjs";
2
+ import { _ as isGithubDotCom, g as githubApiBase, m as ghHostnameArgs, o as detectGhCli, s as execWithInput, x as readGithubToken } from "./github-DpzqNrUh.mjs";
3
3
  import { createHash } from "node:crypto";
4
4
  import { extname, join } from "node:path";
5
5
  import { readFile, stat } from "node:fs/promises";
@@ -1,8 +1,9 @@
1
- import { i as buildGitDiffArgs, o as parseDiffOptions, t as startServer } from "./server-C9i4V36o.mjs";
2
- import { t as formatComments } from "./comment-format-B5AcGcR-.mjs";
3
- import { n as formatPlanReview } from "./plan-format-BQyx--mp.mjs";
4
- 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";
5
- import { n as AWAIT_REVIEW_TIMEOUT_NEXT_ACTION, r as AWAIT_TOOL_DESCRIPTION_SUFFIX, s as PLAN_SUBMIT_NEXT_ACTION, t as AWAIT_PLAN_TIMEOUT_NEXT_ACTION } from "./handoff-DPoIyeWn.mjs";
1
+ import { i as buildGitDiffArgs, s as parseDiffOptions, t as startServer } from "./server-Dw3lkQ5q.mjs";
2
+ import { i as reviewSessionUrl, n as joinSessionApiUrl, r as reviewSessionBaseUrl, t as appendSessionToken } from "./session-url-sr7lXXVc.mjs";
3
+ import { t as formatComments } from "./comment-format-B85NHZnG.mjs";
4
+ import { n as formatPlanReview } from "./plan-format-BwJh5JSE.mjs";
5
+ import { c as removeServerLockIfOwned, h as SESSION_TOKEN_HEADER, i as isLockAlive, p as writeServerLock, r as diffScopeKey, s as removeServerLock, t as acquireServerStartupLease, u as resolveActiveServerLock, x as isLoopbackHost, y as generateSessionToken } from "./server-lock-BNI8FKV1.mjs";
6
+ import { n as AWAIT_REVIEW_TIMEOUT_NEXT_ACTION, r as AWAIT_TOOL_DESCRIPTION_SUFFIX, s as PLAN_SUBMIT_NEXT_ACTION, t as AWAIT_PLAN_TIMEOUT_NEXT_ACTION } from "./handoff-LAFtmnHf.mjs";
6
7
  import { execFileSync } from "node:child_process";
7
8
  import { randomUUID } from "node:crypto";
8
9
  import { fileURLToPath } from "node:url";
@@ -105,25 +106,18 @@ function resolveMcpRepository(repoPath = process.cwd(), explicit = false) {
105
106
  throw new Error(`diffing mcp: path is not inside a Git repository: ${candidate}`);
106
107
  }
107
108
  }
108
- function isLoopbackHost(host) {
109
- const normalized = host.toLowerCase();
110
- if (normalized === "localhost" || normalized === "::1" || normalized === "[::1]") return true;
111
- const octets = normalized.split(".");
112
- return octets.length === 4 && octets[0] === "127" && octets.every((part) => {
113
- if (!/^\d{1,3}$/.test(part)) return false;
114
- const value = Number(part);
115
- return value >= 0 && value <= 255;
116
- });
117
- }
118
109
  function lockUrl(lock) {
119
- if (lock.port <= 0) return null;
120
- if (!isLoopbackHost(lock.host)) return null;
121
- return `http://${lock.host === "::1" ? "[::1]" : lock.host}:${lock.port}`;
110
+ return reviewSessionUrl(lock);
122
111
  }
123
- async function requestJson(base, path, init) {
112
+ async function requestJson(base, path, init, authToken) {
124
113
  let response;
125
114
  try {
126
- response = await fetch(`${base}${path}`, init);
115
+ const headers = new Headers(init?.headers);
116
+ if (authToken) headers.set(SESSION_TOKEN_HEADER, authToken);
117
+ response = await fetch(joinSessionApiUrl(base, path), {
118
+ ...init,
119
+ headers
120
+ });
127
121
  } catch (error) {
128
122
  if (error instanceof Error && error.name === "AbortError") throw new Error(`Request to ${path} was cancelled. Retry the MCP tool when ready.`);
129
123
  const detail = error instanceof Error ? error.message : String(error);
@@ -338,7 +332,7 @@ function createMcpServer(options) {
338
332
  const repoRoot = resolveMcpRepository(options.repoRoot, true);
339
333
  const startServerFn = options.startServerFn ?? startServer;
340
334
  const now = options.now ?? Date.now;
341
- const readLock = options.readLock ?? readServerLock;
335
+ const readLock = options.readLock ?? resolveActiveServerLock;
342
336
  const writeLock = options.writeLock ?? writeServerLock;
343
337
  const removeLock = options.removeLock ?? removeServerLock;
344
338
  const lockIsAlive = options.lockIsAlive ?? isLockAlive;
@@ -353,7 +347,10 @@ function createMcpServer(options) {
353
347
  }, { instructions });
354
348
  let reviewCursor = null;
355
349
  let planCursor = null;
350
+ let selectedLock = null;
356
351
  function liveLock() {
352
+ if (selectedLock && lockIsAlive(selectedLock, repoRoot)) return selectedLock;
353
+ selectedLock = null;
357
354
  const lock = readLock(repoRoot);
358
355
  return lock && lockIsAlive(lock, repoRoot) ? lock : null;
359
356
  }
@@ -365,11 +362,11 @@ function createMcpServer(options) {
365
362
  const lock = liveLock();
366
363
  if (!lock) throw new Error(`No diffing review session is running for ${repoRoot}. Start one with start_review_session, \`diffing --web\`, or \`diffing "gh pr <ref>"\`, then retry.`);
367
364
  ensureReusableLock(lock);
368
- const url = lockUrl(lock);
369
- if (!url) throw new Error("The active diffing session does not expose a reachable loopback API.");
365
+ const apiOrigin = reviewSessionBaseUrl(lock);
366
+ if (!apiOrigin) throw new Error("The active diffing session does not expose a reachable loopback API.");
370
367
  return {
371
368
  lock,
372
- url,
369
+ apiOrigin,
373
370
  identity: `${lock.pid}:${lock.startedAt}:${lock.port}:${lock.ownerId ?? ""}`
374
371
  };
375
372
  }
@@ -388,11 +385,11 @@ function createMcpServer(options) {
388
385
  if (session.lock.mode === "tui") {
389
386
  if (!session.lock.capability) throw new Error("The TUI lock is missing its API capability.");
390
387
  headers.set("X-Diffing-Capability", session.lock.capability);
391
- }
392
- return requestJson(session.url, path, {
388
+ } else if (session.lock.authToken) headers.set(SESSION_TOKEN_HEADER, session.lock.authToken);
389
+ return requestJson(session.apiOrigin, path, {
393
390
  ...init,
394
391
  headers
395
- });
392
+ }, session.lock.authToken);
396
393
  }
397
394
  function requestBaseJson(path, init) {
398
395
  return requestSessionJson(requireWebSession(), path, init);
@@ -509,6 +506,7 @@ function createMcpServer(options) {
509
506
  if (!sameScope(existing, requestedScope, diffArgs)) throw new Error(`A live diffing web session already shows a different diff scope. Requested arguments: ${JSON.stringify(diffArgs)}. Use the existing session or end it manually; diffing will not replace it.`);
510
507
  const url = lockUrl(existing);
511
508
  if (!url) throw new Error("The active diffing web session has no safe loopback URL.");
509
+ selectedLock = existing;
512
510
  return {
513
511
  status: "reused",
514
512
  repository: repoRoot,
@@ -526,12 +524,17 @@ function createMcpServer(options) {
526
524
  try {
527
525
  const afterLease = liveLock();
528
526
  if (afterLease) return reuse(afterLease);
527
+ const authToken = generateSessionToken();
529
528
  const lock = {
530
529
  port: (await startServerFn({
531
530
  port: 0,
532
531
  host: "127.0.0.1",
533
532
  clientDir,
534
- diffOpts: parsed
533
+ diffOpts: parsed,
534
+ security: {
535
+ bindHost: "127.0.0.1",
536
+ authToken
537
+ }
535
538
  })).port,
536
539
  host: "127.0.0.1",
537
540
  pid: process.pid,
@@ -542,7 +545,9 @@ function createMcpServer(options) {
542
545
  scope: requestedScope,
543
546
  diffArgs: [...diffArgs],
544
547
  owner: "mcp",
545
- ownerId
548
+ ownerId,
549
+ sessionId: ownerId,
550
+ authToken
546
551
  };
547
552
  try {
548
553
  writeLock(lock);
@@ -552,6 +557,7 @@ function createMcpServer(options) {
552
557
  const detail = error instanceof Error ? error.message : String(error);
553
558
  throw new Error(`The review server bound locally but its discovery lock could not be written: ${detail}. No MCP session was claimed; retry after fixing lock storage. The unadvertised loopback listener will close when this MCP process exits.`);
554
559
  }
560
+ selectedLock = lock;
555
561
  return {
556
562
  status: "started",
557
563
  repository: repoRoot,
@@ -743,7 +749,9 @@ function createMcpServer(options) {
743
749
  if (author) params.set("author", author);
744
750
  if (fullBody) params.set("fullBody", "true");
745
751
  if (format === "xml") {
746
- const res = await fetch(`${session.url}/api/gh/threads?${params}`);
752
+ const headers = new Headers();
753
+ if (session.lock.authToken) headers.set(SESSION_TOKEN_HEADER, session.lock.authToken);
754
+ const res = await fetch(joinSessionApiUrl(session.apiOrigin, `/api/gh/threads?${params}`), { headers });
747
755
  const text = await res.text();
748
756
  if (!res.ok) throw new Error(text || res.statusText);
749
757
  return textResult(text, { result: {
@@ -778,7 +786,9 @@ function createMcpServer(options) {
778
786
  if (fullBody) params.set("fullBody", "true");
779
787
  if (state) params.set("state", state);
780
788
  if (format === "xml") {
781
- const res = await fetch(`${session.url}/api/gh/reviews?${params}`);
789
+ const headers = new Headers();
790
+ if (session.lock.authToken) headers.set(SESSION_TOKEN_HEADER, session.lock.authToken);
791
+ const res = await fetch(joinSessionApiUrl(session.apiOrigin, `/api/gh/reviews?${params}`), { headers });
782
792
  const text = await res.text();
783
793
  if (!res.ok) throw new Error(text || res.statusText);
784
794
  return textResult(text, { result: {
@@ -1247,7 +1257,6 @@ function createMcpServer(options) {
1247
1257
  annotations: MUTATING
1248
1258
  }, async ({ title, body, source, model, planId }) => {
1249
1259
  const session = requireWebSession();
1250
- const base = session.url;
1251
1260
  await seedPlanCursor(session, void 0, true);
1252
1261
  const plan = await requestSessionJson(session, "/api/plans", {
1253
1262
  method: "POST",
@@ -1260,7 +1269,7 @@ function createMcpServer(options) {
1260
1269
  model
1261
1270
  })
1262
1271
  });
1263
- const url = `${base}/plan/${plan.id}`;
1272
+ const url = appendSessionToken(`${session.apiOrigin}/plan/${plan.id}`, session.lock.authToken);
1264
1273
  return textResult(`Submitted plan ${plan.id} (v${plan.version}) at ${url}. ${PLAN_SUBMIT_NEXT_ACTION}`, {
1265
1274
  status: "submitted",
1266
1275
  planId: plan.id,
@@ -1,4 +1,4 @@
1
- import { n as reviewDecisionSummary } from "./comment-format-B5AcGcR-.mjs";
1
+ import { n as reviewDecisionSummary } from "./comment-format-B85NHZnG.mjs";
2
2
  //#region src/lib/review-export.ts
3
3
  /**
4
4
  * Export a review as human-readable Markdown (clipboard / download / CLI).
@@ -1,16 +1,15 @@
1
- import { d as getProjectStorageDir, p as getRepoRoot } from "./git-Czo96ymM.mjs";
1
+ import { f as getProjectStorageDir, h as getRepoRoot } from "./git-BGj31GX-.mjs";
2
2
  import { join } from "node:path";
3
- import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
- import { homedir } from "node:os";
3
+ import { mkdirSync } from "node:fs";
5
4
  //#region src/lib/symbols.ts
6
5
  const SYMBOL_PATTERNS = [
7
6
  {
8
- pattern: /^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,
7
+ pattern: /^\s*(?:(?:export|declare)\s+)*(?:default\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,
9
8
  kind: "function",
10
9
  nameGroup: 1
11
10
  },
12
11
  {
13
- pattern: /^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,
12
+ pattern: /^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?(?:\([^)]*\)|\w[\w$]*)\s*=>/i,
14
13
  kind: "function",
15
14
  nameGroup: 1
16
15
  },
@@ -20,58 +19,108 @@ const SYMBOL_PATTERNS = [
20
19
  nameGroup: 1
21
20
  },
22
21
  {
23
- pattern: /^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,
22
+ pattern: /^\s*(?:(?:export|declare)\s+)*(?:default\s+)?(?:abstract\s+)?class\s+(\w[\w$]*)/i,
24
23
  kind: "class",
25
24
  nameGroup: 1
26
25
  },
27
26
  {
28
- pattern: /^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,
27
+ pattern: /^\s*(?:(?:export|declare)\s+)*interface\s+(\w[\w$]*)/i,
29
28
  kind: "interface",
30
29
  nameGroup: 1
31
30
  },
32
31
  {
33
- pattern: /^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,
32
+ pattern: /^\s*(?:(?:export|declare)\s+)*type\s+(\w[\w$]*)\s*=/i,
34
33
  kind: "type",
35
34
  nameGroup: 1
36
35
  },
37
36
  {
38
- pattern: /^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,
37
+ pattern: /^\s*(?:(?:export|declare)\s+)*(?:const\s+)?enum\s+(\w[\w$]*)/i,
39
38
  kind: "enum",
40
39
  nameGroup: 1
41
40
  },
41
+ {
42
+ pattern: /^\s*namespace\s+((?:\w[\w$]*(?:\\\w[\w$]*)*)+)\s*;/i,
43
+ kind: "namespace",
44
+ nameGroup: 1
45
+ },
46
+ {
47
+ pattern: /^\s*(?:(?:export|declare)\s+)*namespace\s+(\w[\w$]*)/i,
48
+ kind: "namespace",
49
+ nameGroup: 1
50
+ },
42
51
  {
43
52
  pattern: /^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,
44
53
  kind: "variable",
45
54
  nameGroup: 1
46
55
  },
47
56
  {
48
- pattern: /^\s*def\s+(\w[\w$]*)\s*\(/i,
57
+ pattern: /^\s*(?:(?:public|private|protected|static|abstract|final)\s+)+function\s+(\w[\w$]*)\s*\(/i,
49
58
  kind: "function",
50
59
  nameGroup: 1
51
60
  },
52
61
  {
53
- pattern: /^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,
62
+ pattern: /^\s*(?:(?:abstract|final|readonly)\s+)+class\s+(\w[\w$]*)/i,
63
+ kind: "class",
64
+ nameGroup: 1
65
+ },
66
+ {
67
+ pattern: /^\s*(?!(?:if|for|while|switch|catch)\b)(?:(?:public|private|protected|static|async|abstract|readonly|override|get|set)\s+)*(\w[\w$]*)\s*(?:<[^>]+>)?\s*\([^)]*\)\s*(?:\{|:[^={]+[;{])/i,
68
+ kind: "method",
69
+ nameGroup: 1
70
+ },
71
+ {
72
+ pattern: /^\s*(?:async\s+)?def\s+(\w[\w$]*)\s*\(/i,
54
73
  kind: "function",
55
74
  nameGroup: 1
56
75
  },
57
76
  {
58
- pattern: /^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,
77
+ pattern: /^\s*class\s+(\w[\w$]*)\s*(?:\(|:)/i,
78
+ kind: "class",
79
+ nameGroup: 1
80
+ },
81
+ {
82
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?(?:(?:async|const|unsafe)\s+|extern(?:\s+"[^"]+")?\s+)*fn\s+(\w[\w$]*)\s*[<(]/i,
83
+ kind: "function",
84
+ nameGroup: 1
85
+ },
86
+ {
87
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?struct\s+(\w[\w$]*)/i,
59
88
  kind: "struct",
60
89
  nameGroup: 1
61
90
  },
62
91
  {
63
- pattern: /^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,
92
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?enum\s+(\w[\w$]*)/i,
64
93
  kind: "enum",
65
94
  nameGroup: 1
66
95
  },
67
96
  {
68
- pattern: /^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,
97
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?trait\s+(\w[\w$]*)/i,
98
+ kind: "trait",
99
+ nameGroup: 1
100
+ },
101
+ {
102
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?(?:type|mod)\s+(\w[\w$]*)/i,
103
+ kind: "type",
104
+ nameGroup: 1
105
+ },
106
+ {
107
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?impl(?:<[^>]+>)?\s+[^\s]+\s+for\s+(\w[\w$]*)/i,
69
108
  kind: "impl",
70
109
  nameGroup: 1
71
110
  },
72
111
  {
73
- pattern: /^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,
74
- kind: "trait",
112
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?impl(?:<[^>]+>)?\s+(\w[\w$]*)/i,
113
+ kind: "impl",
114
+ nameGroup: 1
115
+ },
116
+ {
117
+ pattern: /^\s*(?:pub(?:\s*\([^)]*\))?\s+)?(?:const|static)\s+(\w[\w$]*)\s*[:=]/i,
118
+ kind: "variable",
119
+ nameGroup: 1
120
+ },
121
+ {
122
+ pattern: /^\s*func\s+\([^)]*\)\s+(\w[\w$]*)\s*\(/i,
123
+ kind: "method",
75
124
  nameGroup: 1
76
125
  },
77
126
  {
@@ -80,9 +129,14 @@ const SYMBOL_PATTERNS = [
80
129
  nameGroup: 1
81
130
  },
82
131
  {
83
- pattern: /^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,
84
- kind: "method",
85
- nameGroup: 2
132
+ pattern: /^\s*type\s+(\w[\w$]*)\s+(?:struct|interface|=)/i,
133
+ kind: "type",
134
+ nameGroup: 1
135
+ },
136
+ {
137
+ pattern: /^\s*(?:var|const)\s+(\w[\w$]*)\b/i,
138
+ kind: "variable",
139
+ nameGroup: 1
86
140
  }
87
141
  ];
88
142
  /**
@@ -206,10 +260,13 @@ async function searchFiles(query, opts = {}) {
206
260
  error: res.error
207
261
  };
208
262
  const items = [];
263
+ let filteredTotal = 0;
209
264
  const { items: raw, scores } = res.value;
210
- for (let i = 0; i < raw.length && items.length < limit; i++) {
265
+ for (let i = 0; i < raw.length; i++) {
211
266
  const it = raw[i];
212
267
  if (pathSet && !pathSet.has(it.relativePath)) continue;
268
+ filteredTotal++;
269
+ if (items.length >= limit) continue;
213
270
  const score = scores[i];
214
271
  items.push({
215
272
  path: it.relativePath,
@@ -222,7 +279,7 @@ async function searchFiles(query, opts = {}) {
222
279
  return {
223
280
  scope: "files",
224
281
  items,
225
- total: res.value.totalMatched,
282
+ total: pathSet ? filteredTotal : res.value.totalMatched,
226
283
  indexing: isIndexing(f)
227
284
  };
228
285
  }
@@ -259,15 +316,17 @@ async function searchContent(query, opts = {}) {
259
316
  error: res.error
260
317
  };
261
318
  const items = [];
319
+ let filteredTotal = 0;
262
320
  for (const m of res.value.items) {
263
- if (items.length >= limit) break;
264
321
  if (pathSet && !pathSet.has(m.relativePath)) continue;
322
+ filteredTotal++;
323
+ if (items.length >= limit) continue;
265
324
  items.push(toContentHit(m));
266
325
  }
267
326
  return {
268
327
  scope: "text",
269
328
  items,
270
- total: res.value.totalMatched,
329
+ total: pathSet ? filteredTotal : res.value.totalMatched,
271
330
  indexing: isIndexing(f),
272
331
  regexError: res.value.regexFallbackError || void 0
273
332
  };
@@ -318,8 +377,8 @@ async function searchSymbols(query, opts = {}) {
318
377
  const items = [];
319
378
  const ql = query.toLowerCase();
320
379
  const seen = /* @__PURE__ */ new Set();
380
+ let total = 0;
321
381
  for (const m of res.value.items) {
322
- if (items.length >= limit) break;
323
382
  if (pathSet && !pathSet.has(m.relativePath)) continue;
324
383
  const sym = classifySymbolLine(m.lineContent);
325
384
  if (!sym) continue;
@@ -327,6 +386,8 @@ async function searchSymbols(query, opts = {}) {
327
386
  const key = `${m.relativePath}:${m.lineNumber}:${sym.name}`;
328
387
  if (seen.has(key)) continue;
329
388
  seen.add(key);
389
+ total++;
390
+ if (items.length >= limit) continue;
330
391
  const nameIdx = m.lineContent.indexOf(sym.name);
331
392
  const matchRanges = nameIdx >= 0 ? [[nameIdx, nameIdx + sym.name.length]] : m.matchRanges ?? [];
332
393
  items.push({
@@ -343,7 +404,7 @@ async function searchSymbols(query, opts = {}) {
343
404
  return {
344
405
  scope: "symbols",
345
406
  items,
346
- total: items.length,
407
+ total,
347
408
  indexing: isIndexing(f)
348
409
  };
349
410
  }
@@ -363,30 +424,57 @@ async function searchAll(query, opts = {}) {
363
424
  limit
364
425
  })
365
426
  ]);
366
- const items = [];
367
- for (const hit of filesRes.items) items.push({
427
+ return mergeSearchResponses(filesRes, contentRes, symbolsRes, limit);
428
+ }
429
+ /** Merge the three engines into the All scope without duplicating definition
430
+ * lines as both Symbol and Text rows. Exported to keep the result contract
431
+ * independently testable without loading the native fff addon. */
432
+ function mergeSearchResponses(filesRes, contentRes, symbolsRes, limit = DEFAULT_LIMIT) {
433
+ const boundedLimit = clampLimit(limit);
434
+ const fileItems = filesRes.items.map((hit) => ({
368
435
  kind: "file",
369
436
  hit
437
+ }));
438
+ const symbolLocations = /* @__PURE__ */ new Set();
439
+ const symbolItems = symbolsRes.items.map((hit) => {
440
+ symbolLocations.add(`${hit.path}:${hit.line}`);
441
+ return {
442
+ kind: "symbol",
443
+ hit
444
+ };
370
445
  });
371
- for (const hit of symbolsRes.items) items.push({
372
- kind: "symbol",
373
- hit
374
- });
375
- for (const hit of contentRes.items) items.push({
376
- kind: "text",
377
- hit
378
- });
379
- const total = (filesRes.total || 0) + (contentRes.total || 0) + (symbolsRes.total || 0);
380
- const indexing = filesRes.indexing || contentRes.indexing || symbolsRes.indexing;
381
- const error = filesRes.error || contentRes.error || symbolsRes.error;
382
- const regexError = contentRes.regexError;
446
+ const textItems = [];
447
+ for (const hit of contentRes.items) {
448
+ if (symbolLocations.has(`${hit.path}:${hit.line}`)) continue;
449
+ textItems.push({
450
+ kind: "text",
451
+ hit
452
+ });
453
+ }
454
+ const items = [];
455
+ const groups = [
456
+ fileItems,
457
+ symbolItems,
458
+ textItems
459
+ ];
460
+ for (let row = 0; items.length < boundedLimit; row++) {
461
+ let appended = false;
462
+ for (const group of groups) {
463
+ const item = group[row];
464
+ if (!item) continue;
465
+ items.push(item);
466
+ appended = true;
467
+ if (items.length === boundedLimit) break;
468
+ }
469
+ if (!appended) break;
470
+ }
383
471
  return {
384
472
  scope: "all",
385
- items: items.slice(0, limit),
386
- total,
387
- indexing,
388
- error,
389
- regexError
473
+ items,
474
+ total: (filesRes.total || 0) + (contentRes.total || 0),
475
+ indexing: filesRes.indexing || contentRes.indexing || symbolsRes.indexing,
476
+ error: filesRes.error || contentRes.error || symbolsRes.error,
477
+ regexError: contentRes.regexError
390
478
  };
391
479
  }
392
480
  async function getSearchStatus() {
@@ -422,57 +510,4 @@ async function trackSelection(query, path) {
422
510
  } catch {}
423
511
  }
424
512
  //#endregion
425
- //#region src/lib/settings.ts
426
- const CONFIG_DIR = join(homedir(), ".config", "diffing");
427
- const SETTINGS_FILE = join(CONFIG_DIR, "settings.json");
428
- const DEFAULTS = {
429
- staged: true,
430
- untracked: true,
431
- diffStyle: "split",
432
- defaultTabSize: 4,
433
- theme: "rose-pine",
434
- editorIDE: "default",
435
- lineDiffType: "word",
436
- lineWrap: false,
437
- diffIndicators: "classic",
438
- showLineNumbers: true,
439
- hunkSeparators: "line-info",
440
- lineHoverHighlight: "both",
441
- fontSize: 13,
442
- expandContextByDefault: false,
443
- collapsedContextThreshold: 10,
444
- expansionLineCount: 20,
445
- haptics: true,
446
- sounds: true,
447
- uiFont: null,
448
- monoFont: null,
449
- density: "comfortable",
450
- autoCollapseLineThreshold: 400,
451
- requireViewAllBeforeSend: false,
452
- showStatusBar: true,
453
- savedReplies: [],
454
- ignoreSpaceChange: false,
455
- ignoreAllSpace: false
456
- };
457
- function loadSettings() {
458
- try {
459
- const data = readFileSync(SETTINGS_FILE, "utf-8");
460
- return {
461
- ...DEFAULTS,
462
- ...JSON.parse(data)
463
- };
464
- } catch {
465
- return { ...DEFAULTS };
466
- }
467
- }
468
- function saveSettings(settings) {
469
- const merged = {
470
- ...loadSettings(),
471
- ...settings
472
- };
473
- mkdirSync(CONFIG_DIR, { recursive: true });
474
- writeFileSync(SETTINGS_FILE, JSON.stringify(merged, null, 2));
475
- return merged;
476
- }
477
- //#endregion
478
- export { searchContent as a, trackSelection as c, searchAll as i, saveSettings as n, searchFiles as o, getSearchStatus as r, searchSymbols as s, loadSettings as t };
513
+ export { searchFiles as a, searchContent as i, mergeSearchResponses as n, searchSymbols as o, searchAll as r, trackSelection as s, getSearchStatus as t };
@@ -0,0 +1,2 @@
1
+ import { a as searchFiles, i as searchContent, o as searchSymbols, r as searchAll, s as trackSelection } from "./search-3R2E5xxr.mjs";
2
+ export { searchAll, searchContent, searchFiles, searchSymbols, trackSelection };