@band-app/server 0.13.0 → 0.13.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 (166) hide show
  1. package/dist/client/assets/{DockviewTerminalContainer-CLlvqDbZ.js → DockviewTerminalContainer-DY9YDc8o.js} +2 -2
  2. package/dist/client/assets/{TerminalPanel-BE9r8rEY.js → TerminalPanel-TQGgFc5g.js} +1 -1
  3. package/dist/client/assets/{_basePickBy-Dh2WFRMd.js → _basePickBy-CvS-VtsR.js} +1 -1
  4. package/dist/client/assets/{_baseUniq-2BIwN7J1.js → _baseUniq-DFCKF5vj.js} +1 -1
  5. package/dist/client/assets/{arc-Wsw6SggN.js → arc-BatjPjaN.js} +1 -1
  6. package/dist/client/assets/{architectureDiagram-VXUJARFQ-XSuarAoX.js → architectureDiagram-VXUJARFQ-Cnb8SKvZ.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-VD42YOAC-DSc5TOI1.js → blockDiagram-VD42YOAC-B6-qvfYN.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-YG6GDRKO-DLlwzfnX.js → c4Diagram-YG6GDRKO-DAjB1VyY.js} +1 -1
  9. package/dist/client/assets/channel-DSgmIANq.js +1 -0
  10. package/dist/client/assets/{chunk-4BX2VUAB-CWduv96U.js → chunk-4BX2VUAB-vjmc3quM.js} +1 -1
  11. package/dist/client/assets/{chunk-55IACEB6-D9A39zkK.js → chunk-55IACEB6-DDZjRfYY.js} +1 -1
  12. package/dist/client/assets/{chunk-B4BG7PRW-CUMptYWA.js → chunk-B4BG7PRW-CKceWukV.js} +1 -1
  13. package/dist/client/assets/{chunk-DI55MBZ5-DIwkyxaQ.js → chunk-DI55MBZ5-CRnRm2L0.js} +1 -1
  14. package/dist/client/assets/{chunk-FMBD7UC4-D8F2lei-.js → chunk-FMBD7UC4-Cogf-yAQ.js} +1 -1
  15. package/dist/client/assets/{chunk-QN33PNHL-C83_AULb.js → chunk-QN33PNHL-D72Zq7QV.js} +1 -1
  16. package/dist/client/assets/{chunk-QZHKN3VN-Dtw-3_KI.js → chunk-QZHKN3VN-HUKu5hjd.js} +1 -1
  17. package/dist/client/assets/{chunk-TZMSLE5B-Cg9TlQ9E.js → chunk-TZMSLE5B-I8YlhesW.js} +1 -1
  18. package/dist/client/assets/classDiagram-2ON5EDUG-D57JPCVZ.js +1 -0
  19. package/dist/client/assets/classDiagram-v2-WZHVMYZB-D57JPCVZ.js +1 -0
  20. package/dist/client/assets/clone-DAQJfloD.js +1 -0
  21. package/dist/client/assets/{cose-bilkent-S5V4N54A-Drnoe6yO.js → cose-bilkent-S5V4N54A-CEay61-1.js} +1 -1
  22. package/dist/client/assets/{dagre-6UL2VRFP-BgY7fnyf.js → dagre-6UL2VRFP-BcAohjbk.js} +1 -1
  23. package/dist/client/assets/{diagram-PSM6KHXK-bmxBt_Q-.js → diagram-PSM6KHXK-DdrIOdqS.js} +1 -1
  24. package/dist/client/assets/{diagram-QEK2KX5R-DGUqlb8j.js → diagram-QEK2KX5R-Bn79GyS6.js} +1 -1
  25. package/dist/client/assets/{diagram-S2PKOQOG-DxXpOhvW.js → diagram-S2PKOQOG-g66OM_Vs.js} +1 -1
  26. package/dist/client/assets/{erDiagram-Q2GNP2WA-eZBtaSzD.js → erDiagram-Q2GNP2WA-BD0geyEq.js} +1 -1
  27. package/dist/client/assets/{flowDiagram-NV44I4VS-Dfwd3PGB.js → flowDiagram-NV44I4VS-B2LLnQ89.js} +1 -1
  28. package/dist/client/assets/{ganttDiagram-JELNMOA3-BAMeSthd.js → ganttDiagram-JELNMOA3-DsMjiqCd.js} +1 -1
  29. package/dist/client/assets/{gitGraphDiagram-V2S2FVAM-Dts_Yrpu.js → gitGraphDiagram-V2S2FVAM-BXAPNFr2.js} +1 -1
  30. package/dist/client/assets/{graph-BuNOEI6L.js → graph-CWoXix-C.js} +1 -1
  31. package/dist/client/assets/{highlighted-body-B3W2YXNL-Btj0UZe1.js → highlighted-body-B3W2YXNL-DAdM8cs5.js} +1 -1
  32. package/dist/client/assets/{index-Vaa1H_pP.js → index-6eC517Nz.js} +1 -1
  33. package/dist/client/assets/{index-D7TqJ9RF.js → index-B-RxFKXA.js} +1 -1
  34. package/dist/client/assets/{index-DOb48mtv.js → index-B9fPtAFu.js} +1 -1
  35. package/dist/client/assets/{index-Ktl6P-nc.js → index-BSQYe-ie.js} +1 -1
  36. package/dist/client/assets/{index-B4xvdE9X.js → index-B_aLrZ9l.js} +1 -1
  37. package/dist/client/assets/{index-xEL9mxnj.js → index-BcC597Ty.js} +1 -1
  38. package/dist/client/assets/{index-JytYW91Z.js → index-Bu7btU1P.js} +1 -1
  39. package/dist/client/assets/{index-Qm_HbX1-.js → index-C8jQlbkH.js} +1 -1
  40. package/dist/client/assets/{index-DR-TpUg3.js → index-D-NVfOaX.js} +1 -1
  41. package/dist/client/assets/{index-Bmhh2EB_.js → index-D4Gbu0g1.js} +1 -1
  42. package/dist/client/assets/{index-cErwJT25.js → index-DeUgVu9X.js} +1 -1
  43. package/dist/client/assets/{index-tIReXko0.js → index-DgRC8NQ1.js} +1 -1
  44. package/dist/client/assets/{index-g5xXrehm.js → index-Dkltc6JL.js} +1 -1
  45. package/dist/client/assets/{index-gv6bT0S4.js → index-GgiGfqqJ.js} +1 -1
  46. package/dist/client/assets/{index-CF7iJtA6.js → index-HueLRLHI.js} +1 -1
  47. package/dist/client/assets/{index-BFyseSVV.js → index-U42qt8_H.js} +1 -1
  48. package/dist/client/assets/{index-sMR7WunY.js → index-W_gE5gc5.js} +1 -1
  49. package/dist/client/assets/{index-DaorCZSP.js → index-iloqZ__Z.js} +1 -1
  50. package/dist/client/assets/{infoDiagram-HS3SLOUP-ygUopIDr.js → infoDiagram-HS3SLOUP-DwKN27-C.js} +1 -1
  51. package/dist/client/assets/{journeyDiagram-XKPGCS4Q-C7fCACOj.js → journeyDiagram-XKPGCS4Q-BAhwB5gg.js} +1 -1
  52. package/dist/client/assets/{kanban-definition-3W4ZIXB7-4jf7Ztsb.js → kanban-definition-3W4ZIXB7-OI1AHf6B.js} +1 -1
  53. package/dist/client/assets/{layout-DBEGDIe2.js → layout-CC7J3tBc.js} +1 -1
  54. package/dist/client/assets/{linear-2Gp1gLY9.js → linear-CVYb-eZl.js} +1 -1
  55. package/dist/client/assets/{main-CzHZzsmJ.js → main-CYVBBY3m.js} +183 -176
  56. package/dist/client/assets/{mindmap-definition-VGOIOE7T-CiziEudd.js → mindmap-definition-VGOIOE7T-BPKIWA4L.js} +1 -1
  57. package/dist/client/assets/{pieDiagram-ADFJNKIX-DTFtaGug.js → pieDiagram-ADFJNKIX-DeHQukcp.js} +1 -1
  58. package/dist/client/assets/{quadrantDiagram-AYHSOK5B-fbALF3fd.js → quadrantDiagram-AYHSOK5B-DIA0izdW.js} +1 -1
  59. package/dist/client/assets/{requirementDiagram-UZGBJVZJ-CRl9BPyr.js → requirementDiagram-UZGBJVZJ-DsiZI-w_.js} +1 -1
  60. package/dist/client/assets/{sankeyDiagram-TZEHDZUN-RgshY6u-.js → sankeyDiagram-TZEHDZUN-B3Rxgvvo.js} +1 -1
  61. package/dist/client/assets/{sequenceDiagram-WL72ISMW-BbgPIX0Q.js → sequenceDiagram-WL72ISMW-CdnagSZH.js} +1 -1
  62. package/dist/client/assets/{square-terminal-DCU0c-OS.js → square-terminal-BA_DN1Fj.js} +1 -1
  63. package/dist/client/assets/{stateDiagram-FKZM4ZOC-feRu8oRh.js → stateDiagram-FKZM4ZOC-C9HYyYWO.js} +1 -1
  64. package/dist/client/assets/stateDiagram-v2-4FDKWEC3-Jpp4ZnR3.js +1 -0
  65. package/dist/client/assets/{timeline-definition-IT6M3QCI-BqWKbKID.js → timeline-definition-IT6M3QCI-BQXhdJ4l.js} +1 -1
  66. package/dist/client/assets/{treemap-GDKQZRPO-D0xFOnga.js → treemap-GDKQZRPO-DbtL6I-E.js} +1 -1
  67. package/dist/client/assets/{useSessionListContext-PZqsgbdH.js → useSessionListContext-BDhxj2sp.js} +1 -1
  68. package/dist/client/assets/{workspace._workspaceId-djkhDM0B.js → workspace._workspaceId-DrdBQ3ad.js} +1 -1
  69. package/dist/client/assets/{workspace._workspaceId.changes-InUdTCW0.js → workspace._workspaceId.changes-CV01j_RF.js} +1 -1
  70. package/dist/client/assets/workspace._workspaceId.code-Di11hnHW.js +1 -0
  71. package/dist/client/assets/{workspace._workspaceId.code._-iCOKNXeZ.js → workspace._workspaceId.code._-4eyD4Vu7.js} +1 -1
  72. package/dist/client/assets/{workspace._workspaceId.code.index-DMKkXryF.js → workspace._workspaceId.code.index-BazGXzJC.js} +1 -1
  73. package/dist/client/assets/{workspace._workspaceId.index-BZyamHNS.js → workspace._workspaceId.index-CpmZsM_r.js} +1 -1
  74. package/dist/client/assets/{workspace._workspaceId.terminal-4F7quTy3.js → workspace._workspaceId.terminal-Sx7Ov6J4.js} +2 -2
  75. package/dist/client/assets/{xychartDiagram-PRI3JC2R-DicPcjot.js → xychartDiagram-PRI3JC2R-B9LSl0HQ.js} +1 -1
  76. package/dist/server/assets/{DockviewTerminalContainer-BBQnIZa3.js → DockviewTerminalContainer-DVzWSMti.js} +3 -3
  77. package/dist/server/assets/{TerminalPanel-B1dKqOMK.js → TerminalPanel-BlWVFHNT.js} +1 -1
  78. package/dist/server/assets/{_basePickBy-BoCJVKe_.js → _basePickBy-CTVBF0Kh.js} +2 -2
  79. package/dist/server/assets/{_baseUniq-DCXNOsnI.js → _baseUniq-BF3qFyKL.js} +1 -1
  80. package/dist/server/assets/{_tanstack-start-manifest_v-2CeISY5W.js → _tanstack-start-manifest_v-sqmMCsD8.js} +1 -1
  81. package/dist/server/assets/{arc-BFMEbbxV.js → arc-CKzdlSDJ.js} +1 -1
  82. package/dist/server/assets/{architecture-7HQA4BMR-4b2GJppC.js → architecture-7HQA4BMR-C4KC3q3z.js} +6 -6
  83. package/dist/server/assets/{architectureDiagram-VXUJARFQ-iVW_FQ4S.js → architectureDiagram-VXUJARFQ-ARkeTUdc.js} +6 -6
  84. package/dist/server/assets/{blockDiagram-VD42YOAC-D1iPUb9l.js → blockDiagram-VD42YOAC-lsOOO08K.js} +6 -6
  85. package/dist/server/assets/{c4Diagram-YG6GDRKO-DI4Ztwr3.js → c4Diagram-YG6GDRKO-CrZA0PWP.js} +2 -2
  86. package/dist/server/assets/{channel-VwPrL84U.js → channel-Dd6dv_cn.js} +1 -1
  87. package/dist/server/assets/{chunk-4BX2VUAB-B9WFGVXO.js → chunk-4BX2VUAB-CfcFinva.js} +1 -1
  88. package/dist/server/assets/{chunk-55IACEB6-cnFKsxmn.js → chunk-55IACEB6-C_zn3X68.js} +1 -1
  89. package/dist/server/assets/{chunk-B4BG7PRW-DVIhTopX.js → chunk-B4BG7PRW-WqOdzIwb.js} +4 -4
  90. package/dist/server/assets/{chunk-DI55MBZ5-a2cj65b-.js → chunk-DI55MBZ5-BazpEGnL.js} +3 -3
  91. package/dist/server/assets/{chunk-FMBD7UC4-D79uNYe4.js → chunk-FMBD7UC4-abFXQK9X.js} +1 -1
  92. package/dist/server/assets/{chunk-QN33PNHL-BDbkmWdo.js → chunk-QN33PNHL-mQORkMwR.js} +1 -1
  93. package/dist/server/assets/{chunk-QZHKN3VN-CIC4C0nk.js → chunk-QZHKN3VN-W_mObo75.js} +1 -1
  94. package/dist/server/assets/{chunk-TZMSLE5B-BQBr1RGS.js → chunk-TZMSLE5B-f9JxfLrS.js} +1 -1
  95. package/dist/server/assets/{classDiagram-v2-WZHVMYZB-CtbqESgu.js → classDiagram-2ON5EDUG-D9B26ZaP.js} +5 -5
  96. package/dist/server/assets/{classDiagram-2ON5EDUG-CtbqESgu.js → classDiagram-v2-WZHVMYZB-D9B26ZaP.js} +5 -5
  97. package/dist/server/assets/{clone-Bnbf9Iqg.js → clone-dm3Dgnj4.js} +1 -1
  98. package/dist/server/assets/{cose-bilkent-S5V4N54A-DQl5SFk6.js → cose-bilkent-S5V4N54A-FP17KwdC.js} +1 -1
  99. package/dist/server/assets/{dagre-6UL2VRFP-DWcFImvS.js → dagre-6UL2VRFP-D3G7rpV5.js} +6 -6
  100. package/dist/server/assets/{diagram-PSM6KHXK-CAIVqsc3.js → diagram-PSM6KHXK-CblBgzmP.js} +7 -7
  101. package/dist/server/assets/{diagram-QEK2KX5R-Dc8wo9c1.js → diagram-QEK2KX5R-GC4Djt9A.js} +6 -6
  102. package/dist/server/assets/{diagram-S2PKOQOG-ZNcpDFrx.js → diagram-S2PKOQOG-5B6KDW-y.js} +6 -6
  103. package/dist/server/assets/{erDiagram-Q2GNP2WA-BYLAWy_j.js → erDiagram-Q2GNP2WA-Be8xw8rI.js} +4 -4
  104. package/dist/server/assets/{flowDiagram-NV44I4VS-CzcX8svk.js → flowDiagram-NV44I4VS-jzmSul5A.js} +5 -5
  105. package/dist/server/assets/{ganttDiagram-JELNMOA3-Dxwzox2R.js → ganttDiagram-JELNMOA3-DWzYYJJD.js} +2 -2
  106. package/dist/server/assets/{gitGraph-G5XIXVHT-LK8-a2sz.js → gitGraph-G5XIXVHT-DBh_B9aL.js} +6 -6
  107. package/dist/server/assets/{gitGraphDiagram-V2S2FVAM-DlgLrJB0.js → gitGraphDiagram-V2S2FVAM-DtVbt-rt.js} +7 -7
  108. package/dist/server/assets/{graph-BXmxFNFp.js → graph-DX5yyy2e.js} +2 -2
  109. package/dist/server/assets/{highlighted-body-B3W2YXNL-DsSe47sR.js → highlighted-body-B3W2YXNL-jVL8aR3Z.js} +1 -1
  110. package/dist/server/assets/{index-B-LK0PYZ.js → index-B5nFl_AI.js} +2 -2
  111. package/dist/server/assets/{index-DdVNSMNY.js → index-BAdVYDyw.js} +2 -2
  112. package/dist/server/assets/{index-nKutdysv.js → index-BhOjaygO.js} +2 -2
  113. package/dist/server/assets/{index-CVjIVbLj.js → index-BirnOPeb.js} +2 -2
  114. package/dist/server/assets/{index-5upQdcP2.js → index-BjR3sOAq.js} +2 -2
  115. package/dist/server/assets/{index-oC76KgvT.js → index-BoxcvdZf.js} +4 -4
  116. package/dist/server/assets/{index-BrkgyCV3.js → index-BsKQIZIq.js} +2 -2
  117. package/dist/server/assets/{index-CnLND4um.js → index-CBiZXyl4.js} +1 -1
  118. package/dist/server/assets/{index-CWtvbkAQ.js → index-CD24s2ge.js} +3 -3
  119. package/dist/server/assets/{index-BdNVOcCL.js → index-CJFioIPI.js} +2 -2
  120. package/dist/server/assets/{index-Do1Nx4aA.js → index-CVpPQcdL.js} +1 -1
  121. package/dist/server/assets/{index-CXycOokw.js → index-CeFUhbU-.js} +2 -2
  122. package/dist/server/assets/{index-BbjwIyTa.js → index-DHKWIWry.js} +5 -5
  123. package/dist/server/assets/{index-DM2r-vGW.js → index-DYzy4J8Y.js} +2 -2
  124. package/dist/server/assets/{index-CaaOSPL7.js → index-DiZw5Slc.js} +3 -3
  125. package/dist/server/assets/{index-4YgzFKOD.js → index-fJ18TF5w.js} +5 -5
  126. package/dist/server/assets/{index-BSojqZdf.js → index-icISvAHb.js} +2 -2
  127. package/dist/server/assets/{index-BsoOL_wq.js → index-x1PcD09R.js} +2 -2
  128. package/dist/server/assets/{info-VBDWY6EO-CM7NSJD8.js → info-VBDWY6EO-CgGw-KWo.js} +6 -6
  129. package/dist/server/assets/{infoDiagram-HS3SLOUP-QMxyRHM5.js → infoDiagram-HS3SLOUP-Bm300kuC.js} +5 -5
  130. package/dist/server/assets/{journeyDiagram-XKPGCS4Q-BoA6PlCZ.js → journeyDiagram-XKPGCS4Q-i8WJyl2v.js} +4 -4
  131. package/dist/server/assets/{kanban-definition-3W4ZIXB7-r6KtKaEH.js → kanban-definition-3W4ZIXB7-BxqtaaIr.js} +2 -2
  132. package/dist/server/assets/{layout-D3Do3Tbk.js → layout-C81zgoUj.js} +4 -4
  133. package/dist/server/assets/{linear-CC2CX22M.js → linear-dyZZUN6P.js} +1 -1
  134. package/dist/server/assets/{mermaid-3ZIDBTTL-De3B4GT2.js → mermaid-3ZIDBTTL-bTD72h2_.js} +1 -1
  135. package/dist/server/assets/{mermaid-parser.core-BNbfHMQU.js → mermaid-parser.core-BpodyVoJ.js} +11 -11
  136. package/dist/server/assets/{mindmap-definition-VGOIOE7T-BZA0jx43.js → mindmap-definition-VGOIOE7T-CGVjAsWC.js} +3 -3
  137. package/dist/server/assets/{packet-DYOGHKS2-FVoQy92R.js → packet-DYOGHKS2-BeHd7ss_.js} +6 -6
  138. package/dist/server/assets/{pie-VRWISCQL-BGUPFoed.js → pie-VRWISCQL-CtMn8fFZ.js} +6 -6
  139. package/dist/server/assets/{pieDiagram-ADFJNKIX-6xe9bPcx.js → pieDiagram-ADFJNKIX-CS0mGgZR.js} +7 -7
  140. package/dist/server/assets/{quadrantDiagram-AYHSOK5B-DrjB4XQc.js → quadrantDiagram-AYHSOK5B-C0QMIITK.js} +2 -2
  141. package/dist/server/assets/{radar-ZZBFDIW7-BioEa_Uy.js → radar-ZZBFDIW7-DIYuMHay.js} +6 -6
  142. package/dist/server/assets/{requirementDiagram-UZGBJVZJ-BQUraj5G.js → requirementDiagram-UZGBJVZJ-Cu_xdr4s.js} +3 -3
  143. package/dist/server/assets/{router-Ch9bBOlF.js → router-emaiBwQ1.js} +124 -63
  144. package/dist/server/assets/{sankeyDiagram-TZEHDZUN-qdkVPLba.js → sankeyDiagram-TZEHDZUN-sK1eHAYK.js} +1 -1
  145. package/dist/server/assets/{sequenceDiagram-WL72ISMW-Bh5Gu2_v.js → sequenceDiagram-WL72ISMW-BxdrIxsT.js} +3 -3
  146. package/dist/server/assets/{square-terminal-DVnlJfcM.js → square-terminal-DaamWbdC.js} +1 -1
  147. package/dist/server/assets/{stateDiagram-FKZM4ZOC-BUasl40g.js → stateDiagram-FKZM4ZOC-YKAev_OI.js} +8 -8
  148. package/dist/server/assets/{stateDiagram-v2-4FDKWEC3-BL56MbOT.js → stateDiagram-v2-4FDKWEC3-WXMNfM85.js} +4 -4
  149. package/dist/server/assets/{timeline-definition-IT6M3QCI-oGfd7fF8.js → timeline-definition-IT6M3QCI-DrdVpYke.js} +2 -2
  150. package/dist/server/assets/{treemap-GDKQZRPO-CELUCxyO.js → treemap-GDKQZRPO-DZHSpt06.js} +6 -6
  151. package/dist/server/assets/{workspace._workspaceId-DhJMpGAq.js → workspace._workspaceId-KpmCwO8V.js} +2 -2
  152. package/dist/server/assets/{workspace._workspaceId.changes-5-0MP0m5.js → workspace._workspaceId.changes-DF6oupkK.js} +1 -1
  153. package/dist/server/assets/{workspace._workspaceId.code._-BFbAz_ei.js → workspace._workspaceId.code._-fbsbn7Pa.js} +1 -1
  154. package/dist/server/assets/{workspace._workspaceId.code.index-BepZ481b.js → workspace._workspaceId.code.index-D2dHFGQr.js} +1 -1
  155. package/dist/server/assets/{workspace._workspaceId.index-Cp3_jFDn.js → workspace._workspaceId.index-DpLhp52B.js} +1 -1
  156. package/dist/server/assets/{workspace._workspaceId.terminal-B5beQDh_.js → workspace._workspaceId.terminal-Dk3GXgkq.js} +2 -2
  157. package/dist/server/assets/{xychartDiagram-PRI3JC2R-qDOKCR8M.js → xychartDiagram-PRI3JC2R-BXCdvcf7.js} +2 -2
  158. package/dist/server/server.js +2 -2
  159. package/dist/start-server.mjs +438 -604
  160. package/package.json +6 -5
  161. package/dist/client/assets/channel-C5uboiOE.js +0 -1
  162. package/dist/client/assets/classDiagram-2ON5EDUG-CbG2RU7R.js +0 -1
  163. package/dist/client/assets/classDiagram-v2-WZHVMYZB-CbG2RU7R.js +0 -1
  164. package/dist/client/assets/clone-vDxxg1dv.js +0 -1
  165. package/dist/client/assets/stateDiagram-v2-4FDKWEC3-By7mP9TH.js +0 -1
  166. package/dist/client/assets/workspace._workspaceId.code-B2HMVWnI.js +0 -1
@@ -5648,7 +5648,7 @@ var require_thread_stream = __commonJS({
5648
5648
  var { version: version2 } = require_package();
5649
5649
  var { EventEmitter } = __require("events");
5650
5650
  var { Worker } = __require("worker_threads");
5651
- var { join: join25 } = __require("path");
5651
+ var { join: join24 } = __require("path");
5652
5652
  var { pathToFileURL } = __require("url");
5653
5653
  var { wait } = require_wait();
5654
5654
  var {
@@ -5684,7 +5684,7 @@ var require_thread_stream = __commonJS({
5684
5684
  function createWorker(stream, opts) {
5685
5685
  const { filename, workerData } = opts;
5686
5686
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
5687
- const toExecute = bundlerOverrides["thread-stream-worker"] || join25(__dirname, "lib", "worker.js");
5687
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join24(__dirname, "lib", "worker.js");
5688
5688
  const worker = new Worker(toExecute, {
5689
5689
  ...opts.workerOpts,
5690
5690
  trackUnmanagedFds: false,
@@ -6070,7 +6070,7 @@ var require_transport = __commonJS({
6070
6070
  "use strict";
6071
6071
  var { createRequire: createRequire2 } = __require("module");
6072
6072
  var getCallers = require_caller();
6073
- var { join: join25, isAbsolute, sep: sep3 } = __require("node:path");
6073
+ var { join: join24, isAbsolute, sep: sep3 } = __require("node:path");
6074
6074
  var sleep2 = require_atomic_sleep();
6075
6075
  var onExit = require_on_exit_leak_free();
6076
6076
  var ThreadStream = require_thread_stream();
@@ -6133,7 +6133,7 @@ var require_transport = __commonJS({
6133
6133
  throw new Error("only one of target or targets can be specified");
6134
6134
  }
6135
6135
  if (targets) {
6136
- target = bundlerOverrides["pino-worker"] || join25(__dirname, "worker.js");
6136
+ target = bundlerOverrides["pino-worker"] || join24(__dirname, "worker.js");
6137
6137
  options2.targets = targets.filter((dest) => dest.target).map((dest) => {
6138
6138
  return {
6139
6139
  ...dest,
@@ -6151,7 +6151,7 @@ var require_transport = __commonJS({
6151
6151
  });
6152
6152
  });
6153
6153
  } else if (pipeline) {
6154
- target = bundlerOverrides["pino-worker"] || join25(__dirname, "worker.js");
6154
+ target = bundlerOverrides["pino-worker"] || join24(__dirname, "worker.js");
6155
6155
  options2.pipelines = [pipeline.map((dest) => {
6156
6156
  return {
6157
6157
  ...dest,
@@ -6173,7 +6173,7 @@ var require_transport = __commonJS({
6173
6173
  return origin;
6174
6174
  }
6175
6175
  if (origin === "pino/file") {
6176
- return join25(__dirname, "..", "file.js");
6176
+ return join24(__dirname, "..", "file.js");
6177
6177
  }
6178
6178
  let fixTarget2;
6179
6179
  for (const filePath of callers) {
@@ -6501,11 +6501,11 @@ var require_tools = __commonJS({
6501
6501
  }
6502
6502
  }
6503
6503
  }
6504
- function buildFormatters(level, bindings, log27) {
6504
+ function buildFormatters(level, bindings, log26) {
6505
6505
  return {
6506
6506
  level,
6507
6507
  bindings,
6508
- log: log27
6508
+ log: log26
6509
6509
  };
6510
6510
  }
6511
6511
  function normalizeDestFileDescriptor(destination) {
@@ -6888,11 +6888,11 @@ var require_proto = __commonJS({
6888
6888
  }
6889
6889
  } else instance[serializersSym] = serializers;
6890
6890
  if (options2.hasOwnProperty("formatters")) {
6891
- const { level, bindings: chindings, log: log27 } = options2.formatters;
6891
+ const { level, bindings: chindings, log: log26 } = options2.formatters;
6892
6892
  instance[formattersSym] = buildFormatters(
6893
6893
  level || formatters.level,
6894
6894
  chindings || resetChildingsFormatter,
6895
- log27 || formatters.log
6895
+ log26 || formatters.log
6896
6896
  );
6897
6897
  } else {
6898
6898
  instance[formattersSym] = buildFormatters(
@@ -7162,7 +7162,7 @@ var require_safe_stable_stringify = __commonJS({
7162
7162
  return circularValue;
7163
7163
  }
7164
7164
  let res = "";
7165
- let join25 = ",";
7165
+ let join24 = ",";
7166
7166
  const originalIndentation = indentation;
7167
7167
  if (Array.isArray(value)) {
7168
7168
  if (value.length === 0) {
@@ -7176,7 +7176,7 @@ var require_safe_stable_stringify = __commonJS({
7176
7176
  indentation += spacer;
7177
7177
  res += `
7178
7178
  ${indentation}`;
7179
- join25 = `,
7179
+ join24 = `,
7180
7180
  ${indentation}`;
7181
7181
  }
7182
7182
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -7184,13 +7184,13 @@ ${indentation}`;
7184
7184
  for (; i2 < maximumValuesToStringify - 1; i2++) {
7185
7185
  const tmp2 = stringifyFnReplacer(String(i2), value, stack, replacer, spacer, indentation);
7186
7186
  res += tmp2 !== void 0 ? tmp2 : "null";
7187
- res += join25;
7187
+ res += join24;
7188
7188
  }
7189
7189
  const tmp = stringifyFnReplacer(String(i2), value, stack, replacer, spacer, indentation);
7190
7190
  res += tmp !== void 0 ? tmp : "null";
7191
7191
  if (value.length - 1 > maximumBreadth) {
7192
7192
  const removedKeys = value.length - maximumBreadth - 1;
7193
- res += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
7193
+ res += `${join24}"... ${getItemCount(removedKeys)} not stringified"`;
7194
7194
  }
7195
7195
  if (spacer !== "") {
7196
7196
  res += `
@@ -7211,7 +7211,7 @@ ${originalIndentation}`;
7211
7211
  let separator = "";
7212
7212
  if (spacer !== "") {
7213
7213
  indentation += spacer;
7214
- join25 = `,
7214
+ join24 = `,
7215
7215
  ${indentation}`;
7216
7216
  whitespace = " ";
7217
7217
  }
@@ -7225,13 +7225,13 @@ ${indentation}`;
7225
7225
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
7226
7226
  if (tmp !== void 0) {
7227
7227
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7228
- separator = join25;
7228
+ separator = join24;
7229
7229
  }
7230
7230
  }
7231
7231
  if (keyLength > maximumBreadth) {
7232
7232
  const removedKeys = keyLength - maximumBreadth;
7233
7233
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
7234
- separator = join25;
7234
+ separator = join24;
7235
7235
  }
7236
7236
  if (spacer !== "" && separator.length > 1) {
7237
7237
  res = `
@@ -7272,7 +7272,7 @@ ${originalIndentation}`;
7272
7272
  }
7273
7273
  const originalIndentation = indentation;
7274
7274
  let res = "";
7275
- let join25 = ",";
7275
+ let join24 = ",";
7276
7276
  if (Array.isArray(value)) {
7277
7277
  if (value.length === 0) {
7278
7278
  return "[]";
@@ -7285,7 +7285,7 @@ ${originalIndentation}`;
7285
7285
  indentation += spacer;
7286
7286
  res += `
7287
7287
  ${indentation}`;
7288
- join25 = `,
7288
+ join24 = `,
7289
7289
  ${indentation}`;
7290
7290
  }
7291
7291
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -7293,13 +7293,13 @@ ${indentation}`;
7293
7293
  for (; i2 < maximumValuesToStringify - 1; i2++) {
7294
7294
  const tmp2 = stringifyArrayReplacer(String(i2), value[i2], stack, replacer, spacer, indentation);
7295
7295
  res += tmp2 !== void 0 ? tmp2 : "null";
7296
- res += join25;
7296
+ res += join24;
7297
7297
  }
7298
7298
  const tmp = stringifyArrayReplacer(String(i2), value[i2], stack, replacer, spacer, indentation);
7299
7299
  res += tmp !== void 0 ? tmp : "null";
7300
7300
  if (value.length - 1 > maximumBreadth) {
7301
7301
  const removedKeys = value.length - maximumBreadth - 1;
7302
- res += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
7302
+ res += `${join24}"... ${getItemCount(removedKeys)} not stringified"`;
7303
7303
  }
7304
7304
  if (spacer !== "") {
7305
7305
  res += `
@@ -7312,7 +7312,7 @@ ${originalIndentation}`;
7312
7312
  let whitespace = "";
7313
7313
  if (spacer !== "") {
7314
7314
  indentation += spacer;
7315
- join25 = `,
7315
+ join24 = `,
7316
7316
  ${indentation}`;
7317
7317
  whitespace = " ";
7318
7318
  }
@@ -7321,7 +7321,7 @@ ${indentation}`;
7321
7321
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
7322
7322
  if (tmp !== void 0) {
7323
7323
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7324
- separator = join25;
7324
+ separator = join24;
7325
7325
  }
7326
7326
  }
7327
7327
  if (spacer !== "" && separator.length > 1) {
@@ -7379,20 +7379,20 @@ ${originalIndentation}`;
7379
7379
  indentation += spacer;
7380
7380
  let res2 = `
7381
7381
  ${indentation}`;
7382
- const join26 = `,
7382
+ const join25 = `,
7383
7383
  ${indentation}`;
7384
7384
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
7385
7385
  let i2 = 0;
7386
7386
  for (; i2 < maximumValuesToStringify - 1; i2++) {
7387
7387
  const tmp2 = stringifyIndent(String(i2), value[i2], stack, spacer, indentation);
7388
7388
  res2 += tmp2 !== void 0 ? tmp2 : "null";
7389
- res2 += join26;
7389
+ res2 += join25;
7390
7390
  }
7391
7391
  const tmp = stringifyIndent(String(i2), value[i2], stack, spacer, indentation);
7392
7392
  res2 += tmp !== void 0 ? tmp : "null";
7393
7393
  if (value.length - 1 > maximumBreadth) {
7394
7394
  const removedKeys = value.length - maximumBreadth - 1;
7395
- res2 += `${join26}"... ${getItemCount(removedKeys)} not stringified"`;
7395
+ res2 += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
7396
7396
  }
7397
7397
  res2 += `
7398
7398
  ${originalIndentation}`;
@@ -7408,16 +7408,16 @@ ${originalIndentation}`;
7408
7408
  return '"[Object]"';
7409
7409
  }
7410
7410
  indentation += spacer;
7411
- const join25 = `,
7411
+ const join24 = `,
7412
7412
  ${indentation}`;
7413
7413
  let res = "";
7414
7414
  let separator = "";
7415
7415
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
7416
7416
  if (isTypedArrayWithEntries(value)) {
7417
- res += stringifyTypedArray(value, join25, maximumBreadth);
7417
+ res += stringifyTypedArray(value, join24, maximumBreadth);
7418
7418
  keys = keys.slice(value.length);
7419
7419
  maximumPropertiesToStringify -= value.length;
7420
- separator = join25;
7420
+ separator = join24;
7421
7421
  }
7422
7422
  if (deterministic) {
7423
7423
  keys = sort(keys, comparator);
@@ -7428,13 +7428,13 @@ ${indentation}`;
7428
7428
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
7429
7429
  if (tmp !== void 0) {
7430
7430
  res += `${separator}${strEscape(key2)}: ${tmp}`;
7431
- separator = join25;
7431
+ separator = join24;
7432
7432
  }
7433
7433
  }
7434
7434
  if (keyLength > maximumBreadth) {
7435
7435
  const removedKeys = keyLength - maximumBreadth;
7436
7436
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
7437
- separator = join25;
7437
+ separator = join24;
7438
7438
  }
7439
7439
  if (separator !== "") {
7440
7440
  res = `
@@ -30908,205 +30908,6 @@ var init_cursor_cli = __esm({
30908
30908
  }
30909
30909
  });
30910
30910
 
30911
- // ../../packages/coding-agent/src/adapters/openai-codex.ts
30912
- var openai_codex_exports = {};
30913
- __export(openai_codex_exports, {
30914
- OPENAI_CODEX_DEFAULT_BINARY: () => OPENAI_CODEX_DEFAULT_BINARY,
30915
- OpenAICodexAdapter: () => OpenAICodexAdapter,
30916
- getOpenAICodexInstallSkillsDir: () => getOpenAICodexInstallSkillsDir
30917
- });
30918
- import { homedir as homedir2 } from "node:os";
30919
- import { join as join5 } from "node:path";
30920
- function getOpenAICodexInstallSkillsDir(home = homedir2()) {
30921
- const codexHome = process.env.CODEX_HOME || join5(home, ".codex");
30922
- return join5(codexHome, "skills");
30923
- }
30924
- function discoverCodexSkills(workspaceDir) {
30925
- const globalSkillsDir = join5(CODEX_HOME, "skills");
30926
- const systemSkillsDir = join5(CODEX_HOME, "skills", ".system");
30927
- const projectSkillsDir = join5(workspaceDir, ".codex", "skills");
30928
- const systemSkills = readSkillsFromDir(systemSkillsDir);
30929
- const globalSkills = readSkillsFromDir(globalSkillsDir);
30930
- const projectSkills = readSkillsFromDir(projectSkillsDir);
30931
- const skillMap = /* @__PURE__ */ new Map();
30932
- for (const skill of systemSkills) {
30933
- skillMap.set(skill.name, skill);
30934
- }
30935
- for (const skill of globalSkills) {
30936
- skillMap.set(skill.name, skill);
30937
- }
30938
- for (const skill of projectSkills) {
30939
- skillMap.set(skill.name, skill);
30940
- }
30941
- return Array.from(skillMap.values()).sort((a6, b10) => a6.name.localeCompare(b10.name));
30942
- }
30943
- function parseInput(args) {
30944
- if (typeof args === "string") {
30945
- try {
30946
- return JSON.parse(args);
30947
- } catch {
30948
- return { raw: args };
30949
- }
30950
- }
30951
- if (typeof args === "object" && args !== null) {
30952
- return args;
30953
- }
30954
- return {};
30955
- }
30956
- var log4, OpenAICodexAdapter, CODEX_HOME, OPENAI_CODEX_DEFAULT_BINARY;
30957
- var init_openai_codex = __esm({
30958
- "../../packages/coding-agent/src/adapters/openai-codex.ts"() {
30959
- init_src();
30960
- init_skills();
30961
- log4 = createLogger("coding-agent:openai-codex");
30962
- OpenAICodexAdapter = class {
30963
- name = "OpenAI Codex";
30964
- supportedFeatures = {
30965
- costTracking: true,
30966
- sessionListing: false
30967
- };
30968
- workspaceDir;
30969
- maxTurns;
30970
- model;
30971
- sandboxMode;
30972
- activeIterator = null;
30973
- constructor(config2) {
30974
- this.workspaceDir = config2.workspaceDir;
30975
- this.maxTurns = config2.maxTurns;
30976
- this.model = config2.options.model ?? "codex-mini";
30977
- this.sandboxMode = config2.options.sandboxMode ?? "docker";
30978
- }
30979
- abort() {
30980
- if (this.activeIterator) {
30981
- log4.info("aborting active codex stream");
30982
- this.activeIterator.return?.(void 0);
30983
- this.activeIterator = null;
30984
- }
30985
- }
30986
- async *runSession(prompt, sessionId, options2) {
30987
- const effectiveMaxTurns = options2?.maxTurns ?? this.maxTurns;
30988
- const effectiveModel = options2?.model ?? this.model;
30989
- log4.info(
30990
- {
30991
- prompt: prompt.slice(0, 100),
30992
- sessionId,
30993
- model: effectiveModel,
30994
- cwd: this.workspaceDir,
30995
- maxTurns: effectiveMaxTurns
30996
- },
30997
- "runSession starting"
30998
- );
30999
- const moduleName = ["@openai", "codex-sdk"].join("/");
31000
- const sdk = await import(moduleName);
31001
- const codex = new sdk.Codex({ model: effectiveModel });
31002
- const startMs = Date.now();
31003
- let turnCount = 0;
31004
- const thread = sessionId ? codex.resumeThread(sessionId) : codex.startThread();
31005
- const stream = thread.runStreamed(prompt, {
31006
- cwd: this.workspaceDir,
31007
- maxTurns: effectiveMaxTurns,
31008
- sandbox: this.sandboxMode
31009
- });
31010
- const iterator = stream[Symbol.asyncIterator]();
31011
- this.activeIterator = iterator;
31012
- try {
31013
- for await (const event of { [Symbol.asyncIterator]: () => iterator }) {
31014
- const type = event.type;
31015
- log4.debug({ eventType: type }, "codex event");
31016
- switch (type) {
31017
- case "thread.started": {
31018
- yield {
31019
- type: "session-start",
31020
- sessionId: String(event.thread_id ?? sessionId ?? "")
31021
- };
31022
- break;
31023
- }
31024
- case "agent_message": {
31025
- const text4 = event.content;
31026
- if (text4) {
31027
- yield { type: "text-delta", text: text4 };
31028
- }
31029
- break;
31030
- }
31031
- case "item.started": {
31032
- const item = event.item;
31033
- if (item?.type === "function_call") {
31034
- turnCount++;
31035
- yield {
31036
- type: "tool-use",
31037
- toolCallId: String(item.call_id ?? crypto.randomUUID()),
31038
- toolName: String(item.name ?? "unknown"),
31039
- input: parseInput(item.arguments)
31040
- };
31041
- }
31042
- break;
31043
- }
31044
- case "item.completed": {
31045
- const item = event.item;
31046
- if (item?.type === "function_call_output" || item?.type === "function_call") {
31047
- yield {
31048
- type: "tool-result",
31049
- toolCallId: String(item.call_id ?? crypto.randomUUID()),
31050
- output: String(item.output ?? ""),
31051
- isError: false
31052
- };
31053
- }
31054
- break;
31055
- }
31056
- case "turn.completed": {
31057
- yield {
31058
- type: "session-result",
31059
- success: true,
31060
- sessionId: String(event.thread_id ?? sessionId ?? ""),
31061
- durationMs: Date.now() - startMs,
31062
- numTurns: turnCount,
31063
- costUsd: event.usage_usd ?? 0,
31064
- errors: []
31065
- };
31066
- break;
31067
- }
31068
- case "turn.failed": {
31069
- yield {
31070
- type: "session-result",
31071
- success: false,
31072
- sessionId: String(event.thread_id ?? sessionId ?? ""),
31073
- durationMs: Date.now() - startMs,
31074
- numTurns: turnCount,
31075
- costUsd: 0,
31076
- errors: [String(event.error ?? "Codex turn failed")]
31077
- };
31078
- break;
31079
- }
31080
- }
31081
- }
31082
- log4.info("codex stream done");
31083
- } catch (err) {
31084
- log4.error({ err }, "codex error");
31085
- throw err;
31086
- } finally {
31087
- this.activeIterator = null;
31088
- }
31089
- }
31090
- async listSkills() {
31091
- return discoverCodexSkills(this.workspaceDir);
31092
- }
31093
- listModels() {
31094
- return [
31095
- {
31096
- id: "codex-mini",
31097
- name: "Codex Mini",
31098
- description: "Fast and efficient",
31099
- contextWindow: 2e5
31100
- },
31101
- { id: "o4-mini", name: "o4-mini", contextWindow: 2e5 }
31102
- ];
31103
- }
31104
- };
31105
- CODEX_HOME = process.env.CODEX_HOME || join5(homedir2(), ".codex");
31106
- OPENAI_CODEX_DEFAULT_BINARY = "codex";
31107
- }
31108
- });
31109
-
31110
30911
  // ../../node_modules/.pnpm/@openai+codex-sdk@0.128.0/node_modules/@openai/codex-sdk/dist/index.js
31111
30912
  import { promises as fs2 } from "fs";
31112
30913
  import os from "os";
@@ -31579,8 +31380,8 @@ __export(codex_exports, {
31579
31380
  import { execFileSync } from "node:child_process";
31580
31381
  import { createReadStream as createReadStream2 } from "node:fs";
31581
31382
  import { readdir, stat as stat2 } from "node:fs/promises";
31582
- import { homedir as homedir3 } from "node:os";
31583
- import { join as join6 } from "node:path";
31383
+ import { homedir as homedir2 } from "node:os";
31384
+ import { join as join5 } from "node:path";
31584
31385
  import { createInterface } from "node:readline";
31585
31386
  function lruSet2(map2, key, value, cap) {
31586
31387
  if (map2.has(key)) map2.delete(key);
@@ -31599,14 +31400,14 @@ function resolveCodexBinary() {
31599
31400
  return void 0;
31600
31401
  }
31601
31402
  }
31602
- function getCodexInstallSkillsDir(home = homedir3()) {
31603
- const codexHome = process.env.CODEX_HOME || join6(home, ".codex");
31604
- return join6(codexHome, "skills");
31403
+ function getCodexInstallSkillsDir(home = homedir2()) {
31404
+ const codexHome = process.env.CODEX_HOME || join5(home, ".codex");
31405
+ return join5(codexHome, "skills");
31605
31406
  }
31606
- function discoverCodexSkills2(workspaceDir) {
31607
- const globalSkillsDir = join6(CODEX_HOME2, "skills");
31608
- const systemSkillsDir = join6(CODEX_HOME2, "skills", ".system");
31609
- const projectSkillsDir = join6(workspaceDir, ".codex", "skills");
31407
+ function discoverCodexSkills(workspaceDir) {
31408
+ const globalSkillsDir = join5(CODEX_HOME, "skills");
31409
+ const systemSkillsDir = join5(CODEX_HOME, "skills", ".system");
31410
+ const projectSkillsDir = join5(workspaceDir, ".codex", "skills");
31610
31411
  const systemSkills = readSkillsFromDir(systemSkillsDir);
31611
31412
  const globalSkills = readSkillsFromDir(globalSkillsDir);
31612
31413
  const projectSkills = readSkillsFromDir(projectSkillsDir);
@@ -31622,7 +31423,7 @@ function discoverCodexSkills2(workspaceDir) {
31622
31423
  }
31623
31424
  return Array.from(skillMap.values()).sort((a6, b10) => a6.name.localeCompare(b10.name));
31624
31425
  }
31625
- function parseInput2(args) {
31426
+ function parseInput(args) {
31626
31427
  if (typeof args === "string") {
31627
31428
  try {
31628
31429
  return JSON.parse(args);
@@ -31672,7 +31473,7 @@ function* handleItemStarted(item, toolNames) {
31672
31473
  type: "tool-use",
31673
31474
  toolCallId: item.id,
31674
31475
  toolName: name24,
31675
- input: parseInput2(item.arguments)
31476
+ input: parseInput(item.arguments)
31676
31477
  };
31677
31478
  break;
31678
31479
  }
@@ -31799,7 +31600,7 @@ async function findSessionFiles() {
31799
31600
  return;
31800
31601
  }
31801
31602
  for (const entry of entries) {
31802
- const full = join6(dir, entry);
31603
+ const full = join5(dir, entry);
31803
31604
  const s6 = await stat2(full).catch(() => null);
31804
31605
  if (!s6) continue;
31805
31606
  if (s6.isDirectory()) {
@@ -31853,7 +31654,7 @@ async function readCodexSessions() {
31853
31654
  });
31854
31655
  }
31855
31656
  } catch (err) {
31856
- log5.debug({ err, file: file2 }, "failed to parse codex session file");
31657
+ log4.debug({ err, file: file2 }, "failed to parse codex session file");
31857
31658
  }
31858
31659
  }
31859
31660
  return sessions;
@@ -31941,13 +31742,13 @@ async function readCodexSessionMessages(sessionId, options2) {
31941
31742
  const slice = hasMore ? collected.slice(0, requested) : collected;
31942
31743
  return { messages: slice, hasMore, firstOffset: offset4 };
31943
31744
  }
31944
- var log5, cumulativeUsageBySession2, MAX_CUMULATIVE_SESSIONS2, CodexAdapter, CODEX_CTX, CODEX_MODELS, CODEX_DEFAULT_BINARY, CODEX_HOME2, SESSIONS_DIR;
31745
+ var log4, cumulativeUsageBySession2, MAX_CUMULATIVE_SESSIONS2, CodexAdapter, CODEX_CTX, CODEX_MODELS, CODEX_DEFAULT_BINARY, CODEX_HOME, SESSIONS_DIR;
31945
31746
  var init_codex = __esm({
31946
31747
  "../../packages/coding-agent/src/adapters/codex.ts"() {
31947
31748
  init_src();
31948
31749
  init_dist2();
31949
31750
  init_skills();
31950
- log5 = createLogger("coding-agent:codex");
31751
+ log4 = createLogger("coding-agent:codex");
31951
31752
  cumulativeUsageBySession2 = /* @__PURE__ */ new Map();
31952
31753
  MAX_CUMULATIVE_SESSIONS2 = 500;
31953
31754
  CodexAdapter = class {
@@ -31969,7 +31770,7 @@ var init_codex = __esm({
31969
31770
  }
31970
31771
  abort() {
31971
31772
  if (this.activeIterator) {
31972
- log5.info("aborting active codex stream");
31773
+ log4.info("aborting active codex stream");
31973
31774
  this.activeIterator.return?.(void 0);
31974
31775
  this.activeIterator = null;
31975
31776
  }
@@ -31980,7 +31781,7 @@ var init_codex = __esm({
31980
31781
  const knownModelIds = new Set(CODEX_MODELS.map((m11) => m11.id));
31981
31782
  const effectiveModel = requestedModel && knownModelIds.has(requestedModel) ? requestedModel : void 0;
31982
31783
  const mode = options2?.mode ?? "edit";
31983
- log5.info(
31784
+ log4.info(
31984
31785
  {
31985
31786
  prompt: prompt.slice(0, 100),
31986
31787
  sessionId,
@@ -32046,17 +31847,17 @@ var init_codex = __esm({
32046
31847
  persistCumulative();
32047
31848
  };
32048
31849
  const runStreamedStartMs = Date.now();
32049
- log5.info("calling thread.runStreamed");
31850
+ log4.info("calling thread.runStreamed");
32050
31851
  let result;
32051
31852
  try {
32052
31853
  result = await thread.runStreamed(prompt);
32053
- log5.info(
31854
+ log4.info(
32054
31855
  { elapsedMs: Date.now() - runStreamedStartMs },
32055
31856
  "thread.runStreamed returned successfully"
32056
31857
  );
32057
31858
  } catch (err) {
32058
31859
  const msg = err instanceof Error ? err.message : String(err);
32059
- log5.error({ err, cwd: this.workspaceDir, model: effectiveModel }, "codex runStreamed failed");
31860
+ log4.error({ err, cwd: this.workspaceDir, model: effectiveModel }, "codex runStreamed failed");
32060
31861
  yield { type: "error", message: msg };
32061
31862
  yield {
32062
31863
  type: "session-result",
@@ -32077,13 +31878,13 @@ var init_codex = __esm({
32077
31878
  let lastTurnError = null;
32078
31879
  try {
32079
31880
  for await (const event of { [Symbol.asyncIterator]: () => iterator }) {
32080
- log5.debug({ eventType: event.type }, "codex event");
31881
+ log4.debug({ eventType: event.type }, "codex event");
32081
31882
  switch (event.type) {
32082
31883
  // ── Session lifecycle ──────────────────────────────────────────
32083
31884
  case "thread.started": {
32084
31885
  const resolvedSid = event.thread_id ?? sessionId ?? "";
32085
31886
  adoptSessionId(resolvedSid);
32086
- log5.info(
31887
+ log4.info(
32087
31888
  { threadId: event.thread_id, sessionIdParam: sessionId, actualSessionId },
32088
31889
  "codex thread.started"
32089
31890
  );
@@ -32127,7 +31928,7 @@ var init_codex = __esm({
32127
31928
  totalOutputTokens += outputTokens;
32128
31929
  totalReasoningOutputTokens += reasoningOutputTokens;
32129
31930
  persistCumulative();
32130
- log5.debug(
31931
+ log4.debug(
32131
31932
  {
32132
31933
  inputTokens,
32133
31934
  outputTokens,
@@ -32167,7 +31968,7 @@ var init_codex = __esm({
32167
31968
  }
32168
31969
  }
32169
31970
  }
32170
- log5.info(
31971
+ log4.info(
32171
31972
  {
32172
31973
  turnCount,
32173
31974
  totalInputTokens,
@@ -32191,7 +31992,7 @@ var init_codex = __esm({
32191
31992
  }
32192
31993
  } catch (err) {
32193
31994
  const msg = err instanceof Error ? err.message : String(err);
32194
- log5.error({ err, cwd: this.workspaceDir }, "codex stream error");
31995
+ log4.error({ err, cwd: this.workspaceDir }, "codex stream error");
32195
31996
  yield { type: "error", message: msg };
32196
31997
  yield {
32197
31998
  type: "session-result",
@@ -32207,7 +32008,7 @@ var init_codex = __esm({
32207
32008
  }
32208
32009
  }
32209
32010
  async listSkills() {
32210
- return discoverCodexSkills2(this.workspaceDir);
32011
+ return discoverCodexSkills(this.workspaceDir);
32211
32012
  }
32212
32013
  listModes() {
32213
32014
  return [
@@ -32219,12 +32020,12 @@ var init_codex = __esm({
32219
32020
  return CODEX_MODELS;
32220
32021
  }
32221
32022
  async listSessions(dir) {
32222
- log5.info({ dir }, "listSessions");
32023
+ log4.info({ dir }, "listSessions");
32223
32024
  const sessions = await readCodexSessions();
32224
32025
  return sessions.filter((s6) => s6.cwd === dir).sort((a6, b10) => b10.lastModified - a6.lastModified);
32225
32026
  }
32226
32027
  async getSessionMessages(sessionId, dir, options2) {
32227
- log5.info({ sessionId, dir, ...options2 }, "getSessionMessages");
32028
+ log4.info({ sessionId, dir, ...options2 }, "getSessionMessages");
32228
32029
  return readCodexSessionMessages(sessionId, options2);
32229
32030
  }
32230
32031
  };
@@ -32262,8 +32063,8 @@ var init_codex = __esm({
32262
32063
  }
32263
32064
  ];
32264
32065
  CODEX_DEFAULT_BINARY = "codex";
32265
- CODEX_HOME2 = process.env.CODEX_HOME || join6(homedir3(), ".codex");
32266
- SESSIONS_DIR = join6(CODEX_HOME2, "sessions");
32066
+ CODEX_HOME = process.env.CODEX_HOME || join5(homedir2(), ".codex");
32067
+ SESSIONS_DIR = join5(CODEX_HOME, "sessions");
32267
32068
  }
32268
32069
  });
32269
32070
 
@@ -32275,15 +32076,15 @@ __export(gemini_cli_exports, {
32275
32076
  getGeminiCliInstallSkillsDir: () => getGeminiCliInstallSkillsDir
32276
32077
  });
32277
32078
  import { spawn as spawn3 } from "node:child_process";
32278
- import { homedir as homedir4 } from "node:os";
32279
- import { join as join7 } from "node:path";
32079
+ import { homedir as homedir3 } from "node:os";
32080
+ import { join as join6 } from "node:path";
32280
32081
  import { createInterface as createInterface2 } from "node:readline";
32281
- function getGeminiCliInstallSkillsDir(home = homedir4()) {
32282
- return join7(home, ".gemini", "skills");
32082
+ function getGeminiCliInstallSkillsDir(home = homedir3()) {
32083
+ return join6(home, ".gemini", "skills");
32283
32084
  }
32284
32085
  function discoverGeminiSkills(workspaceDir) {
32285
- const globalSkillsDir = join7(homedir4(), ".gemini", "skills");
32286
- const projectSkillsDir = join7(workspaceDir, ".gemini", "skills");
32086
+ const globalSkillsDir = join6(homedir3(), ".gemini", "skills");
32087
+ const projectSkillsDir = join6(workspaceDir, ".gemini", "skills");
32287
32088
  const globalSkills = readSkillsFromDir(globalSkillsDir);
32288
32089
  const projectSkills = readSkillsFromDir(projectSkillsDir);
32289
32090
  const skillMap = /* @__PURE__ */ new Map();
@@ -32295,12 +32096,12 @@ function discoverGeminiSkills(workspaceDir) {
32295
32096
  }
32296
32097
  return Array.from(skillMap.values()).sort((a6, b10) => a6.name.localeCompare(b10.name));
32297
32098
  }
32298
- var log6, GeminiCliAdapter, GEMINI_CLI_DEFAULT_BINARY;
32099
+ var log5, GeminiCliAdapter, GEMINI_CLI_DEFAULT_BINARY;
32299
32100
  var init_gemini_cli = __esm({
32300
32101
  "../../packages/coding-agent/src/adapters/gemini-cli.ts"() {
32301
32102
  init_src();
32302
32103
  init_skills();
32303
- log6 = createLogger("coding-agent:gemini-cli");
32104
+ log5 = createLogger("coding-agent:gemini-cli");
32304
32105
  GeminiCliAdapter = class {
32305
32106
  name = "Gemini CLI";
32306
32107
  supportedFeatures = {
@@ -32320,7 +32121,7 @@ var init_gemini_cli = __esm({
32320
32121
  }
32321
32122
  abort() {
32322
32123
  if (this.activeChild) {
32323
- log6.info("aborting active gemini process");
32124
+ log5.info("aborting active gemini process");
32324
32125
  this.activeChild.kill();
32325
32126
  this.activeChild = null;
32326
32127
  }
@@ -32330,7 +32131,7 @@ var init_gemini_cli = __esm({
32330
32131
  const requestedModel = options2?.model ?? this.model;
32331
32132
  const knownGeminiModels = new Set(this.listModels().map((m11) => m11.id));
32332
32133
  const effectiveModel = requestedModel && knownGeminiModels.has(requestedModel) ? requestedModel : void 0;
32333
- log6.info(
32134
+ log5.info(
32334
32135
  {
32335
32136
  prompt: prompt.slice(0, 100),
32336
32137
  model: effectiveModel,
@@ -32353,7 +32154,7 @@ var init_gemini_cli = __esm({
32353
32154
  let spawnError = null;
32354
32155
  child.on("error", (err) => {
32355
32156
  spawnError = err;
32356
- log6.error({ err, executable: this.executablePath }, "gemini spawn error");
32157
+ log5.error({ err, executable: this.executablePath }, "gemini spawn error");
32357
32158
  });
32358
32159
  const startMs = Date.now();
32359
32160
  let turnCount = 0;
@@ -32367,11 +32168,11 @@ var init_gemini_cli = __esm({
32367
32168
  try {
32368
32169
  parsed = JSON.parse(line2);
32369
32170
  } catch {
32370
- log6.warn({ line: line2 }, "failed to parse NDJSON line");
32171
+ log5.warn({ line: line2 }, "failed to parse NDJSON line");
32371
32172
  continue;
32372
32173
  }
32373
32174
  const type = parsed.type;
32374
- log6.debug({ eventType: type }, "gemini event");
32175
+ log5.debug({ eventType: type }, "gemini event");
32375
32176
  switch (type) {
32376
32177
  case "message": {
32377
32178
  const text4 = parsed.text;
@@ -32437,11 +32238,11 @@ var init_gemini_cli = __esm({
32437
32238
  errors: [errMsg]
32438
32239
  };
32439
32240
  } else if (exitCode !== 0) {
32440
- log6.warn({ exitCode }, "gemini process exited with non-zero code");
32241
+ log5.warn({ exitCode }, "gemini process exited with non-zero code");
32441
32242
  }
32442
- log6.info("gemini stream done");
32243
+ log5.info("gemini stream done");
32443
32244
  } catch (err) {
32444
- log6.error({ err }, "gemini error");
32245
+ log5.error({ err }, "gemini error");
32445
32246
  child.kill();
32446
32247
  throw err;
32447
32248
  } finally {
@@ -32480,8 +32281,8 @@ __export(opencode_exports, {
32480
32281
  getOpenCodeInstallSkillsDir: () => getOpenCodeInstallSkillsDir
32481
32282
  });
32482
32283
  import { execFile, spawn as spawn4 } from "node:child_process";
32483
- import { homedir as homedir5 } from "node:os";
32484
- import { join as join8 } from "node:path";
32284
+ import { homedir as homedir4 } from "node:os";
32285
+ import { join as join7 } from "node:path";
32485
32286
  import { createInterface as createInterface3 } from "node:readline";
32486
32287
  function fetchOpenCodeModels(executablePath) {
32487
32288
  return new Promise((resolve8, reject) => {
@@ -32575,7 +32376,7 @@ async function fetchOpenCodeSessionMessages(executablePath, sessionId, options2)
32575
32376
  try {
32576
32377
  session = JSON.parse(raw.slice(jsonStart));
32577
32378
  } catch {
32578
- log7.warn({ sessionId }, "failed to parse exported session");
32379
+ log6.warn({ sessionId }, "failed to parse exported session");
32579
32380
  return { messages: [], hasMore: false, firstOffset: 0 };
32580
32381
  }
32581
32382
  const tail = options2?.tail;
@@ -32643,20 +32444,20 @@ async function fetchOpenCodeSessionMessages(executablePath, sessionId, options2)
32643
32444
  const slice = hasMore ? collected.slice(0, requested) : collected;
32644
32445
  return { messages: slice, hasMore, firstOffset: offset4 };
32645
32446
  }
32646
- function getOpenCodeInstallSkillsDir(home = homedir5()) {
32647
- return join8(home, ".config", "opencode", "skills");
32447
+ function getOpenCodeInstallSkillsDir(home = homedir4()) {
32448
+ return join7(home, ".config", "opencode", "skills");
32648
32449
  }
32649
32450
  function discoverOpenCodeSkills(workspaceDir) {
32650
- const home = homedir5();
32451
+ const home = homedir4();
32651
32452
  const dirs = [
32652
32453
  // Global (lowest priority first)
32653
- join8(home, ".agents", "skills"),
32654
- join8(home, ".claude", "skills"),
32655
- join8(home, ".config", "opencode", "skills"),
32454
+ join7(home, ".agents", "skills"),
32455
+ join7(home, ".claude", "skills"),
32456
+ join7(home, ".config", "opencode", "skills"),
32656
32457
  // Project-level (overrides global)
32657
- join8(workspaceDir, ".agents", "skills"),
32658
- join8(workspaceDir, ".claude", "skills"),
32659
- join8(workspaceDir, ".opencode", "skills")
32458
+ join7(workspaceDir, ".agents", "skills"),
32459
+ join7(workspaceDir, ".claude", "skills"),
32460
+ join7(workspaceDir, ".opencode", "skills")
32660
32461
  ];
32661
32462
  const skillMap = /* @__PURE__ */ new Map();
32662
32463
  for (const dir of dirs) {
@@ -32666,12 +32467,12 @@ function discoverOpenCodeSkills(workspaceDir) {
32666
32467
  }
32667
32468
  return Array.from(skillMap.values()).sort((a6, b10) => a6.name.localeCompare(b10.name));
32668
32469
  }
32669
- var log7, OpenCodeAdapter, DEFAULT_MODELS, OPENCODE_DEFAULT_BINARY;
32470
+ var log6, OpenCodeAdapter, DEFAULT_MODELS, OPENCODE_DEFAULT_BINARY;
32670
32471
  var init_opencode = __esm({
32671
32472
  "../../packages/coding-agent/src/adapters/opencode.ts"() {
32672
32473
  init_src();
32673
32474
  init_skills();
32674
- log7 = createLogger("coding-agent:opencode");
32475
+ log6 = createLogger("coding-agent:opencode");
32675
32476
  OpenCodeAdapter = class {
32676
32477
  name = "OpenCode";
32677
32478
  supportedFeatures = {
@@ -32690,7 +32491,7 @@ var init_opencode = __esm({
32690
32491
  }
32691
32492
  abort() {
32692
32493
  if (this.activeChild) {
32693
- log7.info("aborting active opencode process");
32494
+ log6.info("aborting active opencode process");
32694
32495
  this.activeChild.kill();
32695
32496
  this.activeChild = null;
32696
32497
  }
@@ -32699,7 +32500,7 @@ var init_opencode = __esm({
32699
32500
  const requestedModel = options2?.model ?? this.model;
32700
32501
  const knownModelIds = new Set((this.cachedModels ?? DEFAULT_MODELS).map((m11) => m11.id));
32701
32502
  const effectiveModel = requestedModel && knownModelIds.has(requestedModel) ? requestedModel : void 0;
32702
- log7.info(
32503
+ log6.info(
32703
32504
  {
32704
32505
  prompt: prompt.slice(0, 100),
32705
32506
  model: effectiveModel,
@@ -32735,7 +32536,7 @@ var init_opencode = __esm({
32735
32536
  this.activeChild = child;
32736
32537
  child.on("error", (err) => {
32737
32538
  spawnError = err;
32738
- log7.error({ err, executable: this.executablePath }, "opencode spawn error");
32539
+ log6.error({ err, executable: this.executablePath }, "opencode spawn error");
32739
32540
  });
32740
32541
  const stderrChunks = [];
32741
32542
  child.stderr.on("data", (chunk) => {
@@ -32752,12 +32553,12 @@ var init_opencode = __esm({
32752
32553
  try {
32753
32554
  parsed = JSON.parse(line2);
32754
32555
  } catch {
32755
- log7.warn({ line: line2 }, "failed to parse NDJSON line");
32556
+ log6.warn({ line: line2 }, "failed to parse NDJSON line");
32756
32557
  continue;
32757
32558
  }
32758
32559
  const eventType = parsed.type;
32759
32560
  const part = parsed.part;
32760
- log7.debug({ eventType }, "opencode event");
32561
+ log6.debug({ eventType }, "opencode event");
32761
32562
  switch (eventType) {
32762
32563
  case "text": {
32763
32564
  const text4 = part?.text;
@@ -32793,7 +32594,7 @@ var init_opencode = __esm({
32793
32594
  const errMsg = String(
32794
32595
  parsed.message ?? parsed.error ?? part?.text ?? part?.message ?? ""
32795
32596
  );
32796
- log7.error({ event: parsed }, "opencode error event");
32597
+ log6.error({ event: parsed }, "opencode error event");
32797
32598
  yield {
32798
32599
  type: "error",
32799
32600
  message: errMsg || `OpenCode error (raw: ${JSON.stringify(parsed)})`
@@ -32805,14 +32606,14 @@ var init_opencode = __esm({
32805
32606
  lastExitCode = await exitCodePromise;
32806
32607
  lastStderr = stderrChunks.join("");
32807
32608
  if (!gotOutput && effectiveSessionId && attempt < maxAttempts) {
32808
- log7.warn(
32609
+ log6.warn(
32809
32610
  { sessionId: effectiveSessionId, exitCode: lastExitCode, stderr: lastStderr },
32810
32611
  "opencode produced no output with session ID, retrying without session"
32811
32612
  );
32812
32613
  effectiveSessionId = void 0;
32813
32614
  }
32814
32615
  } catch (err) {
32815
- log7.error({ err }, "opencode error");
32616
+ log6.error({ err }, "opencode error");
32816
32617
  child.kill();
32817
32618
  throw err;
32818
32619
  } finally {
@@ -32829,20 +32630,20 @@ var init_opencode = __esm({
32829
32630
  };
32830
32631
  }
32831
32632
  if (lastExitCode !== 0) {
32832
- log7.warn({ exitCode: lastExitCode }, "opencode process exited with non-zero code");
32633
+ log6.warn({ exitCode: lastExitCode }, "opencode process exited with non-zero code");
32833
32634
  }
32834
32635
  let resolvedSessionId = generatedSessionId;
32835
32636
  if (!sessionId) {
32836
32637
  try {
32837
32638
  const sessions = await fetchOpenCodeSessions(this.executablePath, this.workspaceDir);
32838
32639
  const sorted = sessions.sort((a6, b10) => b10.updated - a6.updated);
32839
- log7.info(
32640
+ log6.info(
32840
32641
  { placeholder: generatedSessionId, sessionCount: sessions.length },
32841
32642
  "resolving OpenCode session ID"
32842
32643
  );
32843
32644
  if (sorted.length > 0 && sorted[0].id) {
32844
32645
  resolvedSessionId = sorted[0].id;
32845
- log7.info(
32646
+ log6.info(
32846
32647
  { placeholder: generatedSessionId, resolved: resolvedSessionId },
32847
32648
  "resolved real OpenCode session ID"
32848
32649
  );
@@ -32852,13 +32653,13 @@ var init_opencode = __esm({
32852
32653
  resolvedSessionId
32853
32654
  };
32854
32655
  } else {
32855
- log7.warn(
32656
+ log6.warn(
32856
32657
  { placeholder: generatedSessionId, workspaceDir: this.workspaceDir },
32857
32658
  "could NOT resolve real OpenCode session ID \u2014 no matching sessions found"
32858
32659
  );
32859
32660
  }
32860
32661
  } catch (err) {
32861
- log7.warn({ err }, "failed to resolve real OpenCode session ID");
32662
+ log6.warn({ err }, "failed to resolve real OpenCode session ID");
32862
32663
  }
32863
32664
  }
32864
32665
  const success2 = lastExitCode === 0 && gotOutput && !spawnError;
@@ -32881,7 +32682,7 @@ var init_opencode = __esm({
32881
32682
  costUsd: 0,
32882
32683
  errors
32883
32684
  };
32884
- log7.info("opencode stream done");
32685
+ log6.info("opencode stream done");
32885
32686
  }
32886
32687
  async listSkills() {
32887
32688
  return discoverOpenCodeSkills(this.workspaceDir);
@@ -32897,13 +32698,13 @@ var init_opencode = __esm({
32897
32698
  return models;
32898
32699
  }
32899
32700
  } catch (err) {
32900
- log7.warn({ err }, "failed to fetch models from opencode CLI, using defaults");
32701
+ log6.warn({ err }, "failed to fetch models from opencode CLI, using defaults");
32901
32702
  }
32902
32703
  return DEFAULT_MODELS;
32903
32704
  }
32904
32705
  async listSessions(dir) {
32905
32706
  const sessions = await fetchOpenCodeSessions(this.executablePath, dir);
32906
- log7.info({ dir, count: sessions.length }, "listSessions");
32707
+ log6.info({ dir, count: sessions.length }, "listSessions");
32907
32708
  return sessions.map((s6) => ({
32908
32709
  sessionId: s6.id,
32909
32710
  summary: s6.title || "Untitled session",
@@ -32912,7 +32713,7 @@ var init_opencode = __esm({
32912
32713
  })).sort((a6, b10) => b10.lastModified - a6.lastModified);
32913
32714
  }
32914
32715
  async getSessionMessages(sessionId, _dir, options2) {
32915
- log7.info({ sessionId, ...options2 }, "getSessionMessages");
32716
+ log6.info({ sessionId, ...options2 }, "getSessionMessages");
32916
32717
  return fetchOpenCodeSessionMessages(this.executablePath, sessionId, options2);
32917
32718
  }
32918
32719
  };
@@ -86773,11 +86574,11 @@ var require_core = __commonJS({
86773
86574
  Ajv2.ValidationError = validation_error_1.default;
86774
86575
  Ajv2.MissingRefError = ref_error_1.default;
86775
86576
  exports.default = Ajv2;
86776
- function checkOptions(checkOpts, options2, msg, log27 = "error") {
86577
+ function checkOptions(checkOpts, options2, msg, log26 = "error") {
86777
86578
  for (const key in checkOpts) {
86778
86579
  const opt = key;
86779
86580
  if (opt in options2)
86780
- this.logger[log27](`${msg}: option ${key}. ${checkOpts[opt]}`);
86581
+ this.logger[log26](`${msg}: option ${key}. ${checkOpts[opt]}`);
86781
86582
  }
86782
86583
  }
86783
86584
  function getSchEnv(keyRef) {
@@ -89261,7 +89062,7 @@ var require_dist5 = __commonJS({
89261
89062
  // start-server.ts
89262
89063
  import { appendFileSync as appendFileSync2, createReadStream as createReadStream3, mkdirSync as mkdirSync8, readFileSync as readFileSync9, statSync as statSync7 } from "node:fs";
89263
89064
  import { createServer } from "node:http";
89264
- import { basename as basename2, join as join24, resolve as resolve7 } from "node:path";
89065
+ import { basename as basename2, join as join23, resolve as resolve7 } from "node:path";
89265
89066
 
89266
89067
  // ../../node_modules/.pnpm/@trpc+server@11.12.0_typescript@5.9.3/node_modules/@trpc/server/dist/codes-DagpWZLc.mjs
89267
89068
  function mergeWithoutOverrides(obj1, ...objs) {
@@ -108431,8 +108232,8 @@ init_src();
108431
108232
 
108432
108233
  // src/lib/agent-pool.ts
108433
108234
  import { readFileSync as readFileSync5 } from "node:fs";
108434
- import { homedir as homedir8 } from "node:os";
108435
- import { join as join13 } from "node:path";
108235
+ import { homedir as homedir7 } from "node:os";
108236
+ import { join as join12 } from "node:path";
108436
108237
 
108437
108238
  // ../../packages/coding-agent/src/config.ts
108438
108239
  init_zod();
@@ -108461,15 +108262,6 @@ var cursorCliConfigSchema = external_exports2.object({
108461
108262
  model: external_exports2.string().default("auto")
108462
108263
  }).default({})
108463
108264
  });
108464
- var openaiCodexConfigSchema = external_exports2.object({
108465
- type: external_exports2.literal("openai-codex"),
108466
- workspaceDir: external_exports2.string().default(process.cwd()),
108467
- maxTurns: external_exports2.number().int().positive().default(3),
108468
- options: external_exports2.object({
108469
- model: external_exports2.string().optional(),
108470
- sandboxMode: external_exports2.enum(["docker", "firecracker"]).optional()
108471
- }).default({})
108472
- });
108473
108265
  var codexConfigSchema = external_exports2.object({
108474
108266
  type: external_exports2.literal("codex"),
108475
108267
  workspaceDir: external_exports2.string().default(process.cwd()),
@@ -108500,7 +108292,6 @@ var opencodeConfigSchema = external_exports2.object({
108500
108292
  var codingAgentConfigSchema = external_exports2.discriminatedUnion("type", [
108501
108293
  claudeCodeConfigSchema,
108502
108294
  cursorCliConfigSchema,
108503
- openaiCodexConfigSchema,
108504
108295
  codexConfigSchema,
108505
108296
  geminiCliConfigSchema,
108506
108297
  opencodeConfigSchema
@@ -108517,10 +108308,6 @@ async function createCodingAgent(config2) {
108517
108308
  const { CursorCliAdapter: CursorCliAdapter2 } = await Promise.resolve().then(() => (init_cursor_cli(), cursor_cli_exports));
108518
108309
  return new CursorCliAdapter2(config2);
108519
108310
  }
108520
- case "openai-codex": {
108521
- const { OpenAICodexAdapter: OpenAICodexAdapter2 } = await Promise.resolve().then(() => (init_openai_codex(), openai_codex_exports));
108522
- return new OpenAICodexAdapter2(config2);
108523
- }
108524
108311
  case "codex": {
108525
108312
  const { CodexAdapter: CodexAdapter2 } = await Promise.resolve().then(() => (init_codex(), codex_exports));
108526
108313
  return new CodexAdapter2(config2);
@@ -108539,9 +108326,9 @@ async function createCodingAgent(config2) {
108539
108326
  }
108540
108327
 
108541
108328
  // ../../packages/coding-agent/src/install-skills.ts
108542
- import { homedir as homedir6 } from "node:os";
108543
- import { join as join9 } from "node:path";
108544
- async function getInstallSkillsDir(type, home = homedir6()) {
108329
+ import { homedir as homedir5 } from "node:os";
108330
+ import { join as join8 } from "node:path";
108331
+ async function getInstallSkillsDir(type, home = homedir5()) {
108545
108332
  switch (type) {
108546
108333
  case "claude-code": {
108547
108334
  const { getClaudeCodeInstallSkillsDir: getClaudeCodeInstallSkillsDir2 } = await Promise.resolve().then(() => (init_claude_code(), claude_code_exports));
@@ -108551,10 +108338,6 @@ async function getInstallSkillsDir(type, home = homedir6()) {
108551
108338
  const { getCodexInstallSkillsDir: getCodexInstallSkillsDir2 } = await Promise.resolve().then(() => (init_codex(), codex_exports));
108552
108339
  return getCodexInstallSkillsDir2(home);
108553
108340
  }
108554
- case "openai-codex": {
108555
- const { getOpenAICodexInstallSkillsDir: getOpenAICodexInstallSkillsDir2 } = await Promise.resolve().then(() => (init_openai_codex(), openai_codex_exports));
108556
- return getOpenAICodexInstallSkillsDir2(home);
108557
- }
108558
108341
  case "gemini-cli": {
108559
108342
  const { getGeminiCliInstallSkillsDir: getGeminiCliInstallSkillsDir2 } = await Promise.resolve().then(() => (init_gemini_cli(), gemini_cli_exports));
108560
108343
  return getGeminiCliInstallSkillsDir2(home);
@@ -108567,27 +108350,20 @@ async function getInstallSkillsDir(type, home = homedir6()) {
108567
108350
  return null;
108568
108351
  }
108569
108352
  }
108570
- function getSharedSkillsDir(home = homedir6()) {
108571
- return join9(home, ".agents", "skills");
108353
+ function getSharedSkillsDir(home = homedir5()) {
108354
+ return join8(home, ".agents", "skills");
108572
108355
  }
108573
- var SUPPORTED_AGENT_TYPES = [
108574
- "claude-code",
108575
- "codex",
108576
- "openai-codex",
108577
- "gemini-cli",
108578
- "opencode"
108579
- ];
108580
- function getAgentConfigDir(type, home = homedir6()) {
108356
+ var SUPPORTED_AGENT_TYPES = ["claude-code", "codex", "gemini-cli", "opencode"];
108357
+ function getAgentConfigDir(type, home = homedir5()) {
108581
108358
  switch (type) {
108582
108359
  case "claude-code":
108583
- return join9(home, ".claude");
108360
+ return join8(home, ".claude");
108584
108361
  case "codex":
108585
- case "openai-codex":
108586
- return process.env.CODEX_HOME || join9(home, ".codex");
108362
+ return process.env.CODEX_HOME || join8(home, ".codex");
108587
108363
  case "gemini-cli":
108588
- return join9(home, ".gemini");
108364
+ return join8(home, ".gemini");
108589
108365
  case "opencode":
108590
- return join9(home, ".config", "opencode");
108366
+ return join8(home, ".config", "opencode");
108591
108367
  default:
108592
108368
  return null;
108593
108369
  }
@@ -108599,8 +108375,8 @@ init_src();
108599
108375
  // src/lib/state.ts
108600
108376
  import { randomBytes } from "node:crypto";
108601
108377
  import { mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync } from "node:fs";
108602
- import { homedir as homedir7 } from "node:os";
108603
- import { dirname, join as join12 } from "node:path";
108378
+ import { homedir as homedir6 } from "node:os";
108379
+ import { dirname, join as join11 } from "node:path";
108604
108380
 
108605
108381
  // ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_fa89646d7248b32d1762bf88948f6339/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
108606
108382
  var React4 = __toESM(require_react(), 1);
@@ -124828,7 +124604,7 @@ function sql(strings, ...params) {
124828
124604
  return new SQL([new StringChunk(str)]);
124829
124605
  }
124830
124606
  _sql.raw = raw;
124831
- function join25(chunks, separator) {
124607
+ function join24(chunks, separator) {
124832
124608
  const result = [];
124833
124609
  for (const [i2, chunk] of chunks.entries()) {
124834
124610
  if (i2 > 0 && separator !== void 0) result.push(separator);
@@ -124836,7 +124612,7 @@ function sql(strings, ...params) {
124836
124612
  }
124837
124613
  return new SQL(result);
124838
124614
  }
124839
- _sql.join = join25;
124615
+ _sql.join = join24;
124840
124616
  function identifier(value) {
124841
124617
  return new Name(value);
124842
124618
  }
@@ -126109,7 +125885,7 @@ function getTableAsAliasSQL(table) {
126109
125885
 
126110
125886
  // src/lib/db/connection.ts
126111
125887
  import { mkdirSync as mkdirSync2 } from "node:fs";
126112
- import { join as join11 } from "node:path";
125888
+ import { join as join10 } from "node:path";
126113
125889
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
126114
125890
 
126115
125891
  // ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.1_@opentelemetry+api@1.9.0_@types+better-sqlite3@7.6.13_better-sql_95478898f63cc8c3fbbd0c5f8c1e464f/node_modules/drizzle-orm/pg-core/foreign-keys.js
@@ -129338,7 +129114,7 @@ var SQLiteSelectQueryBuilderBase = class extends TypedQueryBuilder {
129338
129114
  const baseTableName = this.tableName;
129339
129115
  const tableName = getTableLikeName(table);
129340
129116
  for (const item of extractUsedTable(table)) this.usedTables.add(item);
129341
- if (typeof tableName === "string" && this.config.joins?.some((join25) => join25.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
129117
+ if (typeof tableName === "string" && this.config.joins?.some((join24) => join24.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
129342
129118
  if (!this.isPartialSelect) {
129343
129119
  if (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === "string") this.config.fields = { [baseTableName]: this.config.fields };
129344
129120
  if (typeof tableName === "string" && !is(table, SQL)) {
@@ -130546,7 +130322,7 @@ var SQLiteDialect = class {
130546
130322
  if (!joins2) return;
130547
130323
  const withEntries = Object.entries(joins2).filter(([_4, v4]) => v4);
130548
130324
  if (!withEntries.length) return;
130549
- return sql.join(withEntries.map(([k4, join25]) => {
130325
+ return sql.join(withEntries.map(([k4, join24]) => {
130550
130326
  const relation = tableConfig.relations[k4];
130551
130327
  const isSingle2 = is(relation, One);
130552
130328
  const targetTable = aliasedTable(relation.targetTable, `d${currentDepth + 1}`);
@@ -130557,7 +130333,7 @@ var SQLiteDialect = class {
130557
130333
  table: targetTable,
130558
130334
  mode: isSingle2 ? "first" : "many",
130559
130335
  schema,
130560
- queryConfig: join25,
130336
+ queryConfig: join24,
130561
130337
  tableConfig: schema[relation.targetTableName],
130562
130338
  relationWhere: filter2,
130563
130339
  isNested: true,
@@ -130571,7 +130347,7 @@ var SQLiteDialect = class {
130571
130347
  key: k4,
130572
130348
  selection: innerQuery.selection,
130573
130349
  isArray: !isSingle2,
130574
- isOptional: (relation.optional ?? false) || join25 !== true && !!join25.where
130350
+ isOptional: (relation.optional ?? false) || join24 !== true && !!join24.where
130575
130351
  });
130576
130352
  const jsonColumns = sql.join(innerQuery.selection.map((s6) => {
130577
130353
  return sql`${sql.raw(this.escapeString(s6.key))}, ${s6.selection ? sql`${jsonb2}(${sql.identifier(s6.key)})` : sql.identifier(s6.key)}`;
@@ -131040,7 +130816,7 @@ var SQLiteUpdateBase = class extends QueryPromise {
131040
130816
  createJoin(joinType) {
131041
130817
  return ((table, on) => {
131042
130818
  const tableName = getTableLikeName(table);
131043
- if (typeof tableName === "string" && this.config.joins.some((join25) => join25.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
130819
+ if (typeof tableName === "string" && this.config.joins.some((join24) => join24.alias === tableName)) throw new Error(`Alias "${tableName}" is already used in this query`);
131044
130820
  if (typeof on === "function") {
131045
130821
  const from = this.config.from ? is(table, SQLiteTable) ? table[Table.Symbol.Columns] : is(table, Subquery) ? table._.selectedFields : is(table, SQLiteViewBase) ? table[ViewBaseConfig].selectedFields : void 0 : void 0;
131046
130822
  on = on(new Proxy(this.config.table[Table.Symbol.Columns], new SelectionProxyHandler({
@@ -131783,13 +131559,13 @@ function drizzle(...params) {
131783
131559
  // ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.1_@opentelemetry+api@1.9.0_@types+better-sqlite3@7.6.13_better-sql_95478898f63cc8c3fbbd0c5f8c1e464f/node_modules/drizzle-orm/migrator.js
131784
131560
  import crypto2 from "node:crypto";
131785
131561
  import fs3, { existsSync as existsSync3, readdirSync as readdirSync5 } from "node:fs";
131786
- import { join as join10 } from "node:path";
131562
+ import { join as join9 } from "node:path";
131787
131563
  function readMigrationFiles(config2) {
131788
131564
  if (fs3.existsSync(`${config2.migrationsFolder}/meta/_journal.json`)) throw Error('We detected that you have old drizzle-kit migration folders. You must upgrade drizzle-kit and run "drizzle-kit up"');
131789
131565
  const migrationFolderTo = config2.migrationsFolder;
131790
131566
  const migrationQueries = [];
131791
131567
  const migrations = readdirSync5(migrationFolderTo).map((subdir) => ({
131792
- path: join10(migrationFolderTo, subdir, "migration.sql"),
131568
+ path: join9(migrationFolderTo, subdir, "migration.sql"),
131793
131569
  name: subdir
131794
131570
  })).filter((it) => existsSync3(it.path));
131795
131571
  migrations.sort((a6, b10) => a6.name.localeCompare(b10.name));
@@ -131924,14 +131700,14 @@ var browserHistory = sqliteTable(
131924
131700
  );
131925
131701
 
131926
131702
  // src/lib/db/connection.ts
131927
- var migrationsFolder = join11(import.meta.dirname, "migrations");
131703
+ var migrationsFolder = join10(import.meta.dirname, "migrations");
131928
131704
  var _db = null;
131929
131705
  var _sqlite = null;
131930
131706
  function getDb() {
131931
131707
  if (_db) return _db;
131932
131708
  const home = bandHome();
131933
131709
  mkdirSync2(home, { recursive: true });
131934
- const dbPath = join11(home, "band.db");
131710
+ const dbPath = join10(home, "band.db");
131935
131711
  _sqlite = new DatabaseSync2(dbPath);
131936
131712
  _sqlite.exec("PRAGMA journal_mode = WAL");
131937
131713
  _sqlite.exec("PRAGMA foreign_keys = ON");
@@ -131950,7 +131726,7 @@ function closeDb() {
131950
131726
  // src/lib/state.ts
131951
131727
  function bandHome() {
131952
131728
  if (process.env.BAND_HOME) return process.env.BAND_HOME;
131953
- return join12(homedir7(), ".band");
131729
+ return join11(homedir6(), ".band");
131954
131730
  }
131955
131731
  function loadState() {
131956
131732
  const db2 = getDb();
@@ -132004,7 +131780,7 @@ function saveState(state2) {
132004
131780
  });
132005
131781
  }
132006
131782
  function settingsFile() {
132007
- return join12(bandHome(), "settings.json");
131783
+ return join11(bandHome(), "settings.json");
132008
131784
  }
132009
131785
  function loadSettings() {
132010
131786
  try {
@@ -132054,7 +131830,7 @@ function getOrCreateToken() {
132054
131830
  }
132055
131831
  function worktreesDir() {
132056
131832
  const settings = loadSettings();
132057
- return settings.worktreesDir ?? join12(bandHome(), "worktrees");
131833
+ return settings.worktreesDir ?? join11(bandHome(), "worktrees");
132058
131834
  }
132059
131835
  function loadCurrentStatuses() {
132060
131836
  const db2 = getDb();
@@ -132148,7 +131924,7 @@ function deleteBranchStatus(workspaceId) {
132148
131924
  }
132149
131925
 
132150
131926
  // src/lib/agent-pool.ts
132151
- var log8 = createLogger("agent-pool");
131927
+ var log7 = createLogger("agent-pool");
132152
131928
  var POOL_KEY = Symbol.for("band.agent-pool.v2");
132153
131929
  var PENDING_KEY = Symbol.for("band.agent-pool.pending");
132154
131930
  var g2 = globalThis;
@@ -132158,7 +131934,7 @@ var pool = g2[POOL_KEY];
132158
131934
  var pending = g2[PENDING_KEY];
132159
131935
  function loadClaudeSettingsModel() {
132160
131936
  try {
132161
- const data = readFileSync5(join13(homedir8(), ".claude", "settings.json"), "utf-8");
131937
+ const data = readFileSync5(join12(homedir7(), ".claude", "settings.json"), "utf-8");
132162
131938
  const parsed = JSON.parse(data);
132163
131939
  return typeof parsed.model === "string" ? parsed.model : void 0;
132164
131940
  } catch {
@@ -132177,7 +131953,7 @@ function getAgentConfig(worktreePath, agentId) {
132177
131953
  type: agentDef.type,
132178
131954
  workspaceDir: worktreePath,
132179
131955
  maxTurns: 100,
132180
- additionalDirectories: [join13(bandHome(), "uploads"), join13(bandHome(), "shared")],
131956
+ additionalDirectories: [join12(bandHome(), "uploads"), join12(bandHome(), "shared")],
132181
131957
  options: {
132182
131958
  executablePath: agentDef.command,
132183
131959
  model,
@@ -132193,7 +131969,7 @@ function getAgent(chatId) {
132193
131969
  return pool.get(chatId)?.agent;
132194
131970
  }
132195
131971
  function removeAgent(chatId) {
132196
- log8.info({ chatId }, "removing agent from pool");
131972
+ log7.info({ chatId }, "removing agent from pool");
132197
131973
  return pool.delete(chatId);
132198
131974
  }
132199
131975
  async function getOrCreateAgent(chatId, worktreePath, agentId) {
@@ -132201,7 +131977,7 @@ async function getOrCreateAgent(chatId, worktreePath, agentId) {
132201
131977
  if (existing) {
132202
131978
  const requestedDefId = resolveAgentDefId(agentId);
132203
131979
  if (existing.agentDefId !== requestedDefId) {
132204
- log8.info(
131980
+ log7.info(
132205
131981
  { chatId, cached: existing.agentDefId, requested: requestedDefId },
132206
131982
  "cached agent definition mismatch, replacing"
132207
131983
  );
@@ -132215,7 +131991,7 @@ async function getOrCreateAgent(chatId, worktreePath, agentId) {
132215
131991
  return inFlight.promise;
132216
131992
  }
132217
131993
  const config2 = getAgentConfig(worktreePath, agentId);
132218
- log8.info({ chatId, type: config2.type, defId, cwd: worktreePath }, "creating agent");
131994
+ log7.info({ chatId, type: config2.type, defId, cwd: worktreePath }, "creating agent");
132219
131995
  const promise2 = createCodingAgent(config2).then(
132220
131996
  (agent) => {
132221
131997
  pool.set(chatId, { agent, agentDefId: defId });
@@ -132494,7 +132270,7 @@ function removeChatFromLayout(workspaceId, chatId) {
132494
132270
  // src/lib/git.ts
132495
132271
  import { execFile as execFile2 } from "node:child_process";
132496
132272
  import { readFile, stat as stat3 } from "node:fs/promises";
132497
- import { join as join14 } from "node:path";
132273
+ import { join as join13 } from "node:path";
132498
132274
  function parseGitRemoteUrl(url2) {
132499
132275
  const sshMatch = url2.match(/^[\w.-]+@([^:]+):([^/]+)\/(.+?)(?:\.git)?$/);
132500
132276
  if (sshMatch) {
@@ -132604,7 +132380,7 @@ async function listWorktrees(repoPath) {
132604
132380
  return worktrees2;
132605
132381
  }
132606
132382
  async function resolveDetachedBranch(worktreePath) {
132607
- const dotGit = join14(worktreePath, ".git");
132383
+ const dotGit = join13(worktreePath, ".git");
132608
132384
  let gitdir;
132609
132385
  try {
132610
132386
  const st = await stat3(dotGit);
@@ -132621,7 +132397,7 @@ async function resolveDetachedBranch(worktreePath) {
132621
132397
  }
132622
132398
  for (const rebaseDir of ["rebase-merge", "rebase-apply"]) {
132623
132399
  try {
132624
- const headName = await readFile(join14(gitdir, rebaseDir, "head-name"), "utf-8");
132400
+ const headName = await readFile(join13(gitdir, rebaseDir, "head-name"), "utf-8");
132625
132401
  const name24 = headName.trim();
132626
132402
  return name24.startsWith("refs/heads/") ? name24.slice("refs/heads/".length) : name24;
132627
132403
  } catch {
@@ -133065,10 +132841,10 @@ import { spawn as spawn5 } from "node:child_process";
133065
132841
 
133066
132842
  // src/lib/project-config.ts
133067
132843
  import { existsSync as existsSync4, readFileSync as readFileSync6 } from "node:fs";
133068
- import { join as join15 } from "node:path";
132844
+ import { join as join14 } from "node:path";
133069
132845
  function loadProjectConfig(worktreePath, projectPath) {
133070
132846
  for (const base2 of [worktreePath, projectPath]) {
133071
- const configPath = join15(base2, ".band", "config.json");
132847
+ const configPath = join14(base2, ".band", "config.json");
133072
132848
  if (existsSync4(configPath)) {
133073
132849
  try {
133074
132850
  return JSON.parse(readFileSync6(configPath, "utf-8"));
@@ -133188,7 +132964,7 @@ function subscribe(listener) {
133188
132964
  }
133189
132965
 
133190
132966
  // src/lib/chat-manager.ts
133191
- var log9 = createLogger("chat-manager");
132967
+ var log8 = createLogger("chat-manager");
133192
132968
  var PANEL_TYPE = "chat";
133193
132969
  var chatSessions = /* @__PURE__ */ new Map();
133194
132970
  var workspaceChats = /* @__PURE__ */ new Map();
@@ -133259,7 +133035,7 @@ function createChat(workspaceId, options2) {
133259
133035
  addToIndex(session);
133260
133036
  addChatToLayout(workspaceId, session.id, { title: session.name });
133261
133037
  emit({ kind: "chat-created", workspaceId, chatId: session.id });
133262
- log9.info({ chatId: session.id, workspaceId, agent: session.agent }, "chat pane created");
133038
+ log8.info({ chatId: session.id, workspaceId, agent: session.agent }, "chat pane created");
133263
133039
  return session;
133264
133040
  }
133265
133041
  function getChat(chatId) {
@@ -133288,7 +133064,7 @@ function updateChat(chatId, updates) {
133288
133064
  state: serializeState(session),
133289
133065
  updatedAt: Date.now()
133290
133066
  });
133291
- log9.info({ chatId, updates }, "chat pane updated");
133067
+ log8.info({ chatId, updates }, "chat pane updated");
133292
133068
  return session;
133293
133069
  }
133294
133070
  function updateChatStatus(chatId, status) {
@@ -133340,7 +133116,7 @@ function removeChat(chatId) {
133340
133116
  removeChatFromLayout(session.workspaceId, chatId);
133341
133117
  removeFromIndex(chatId);
133342
133118
  emit({ kind: "chat-removed", workspaceId: session.workspaceId, chatId });
133343
- log9.info({ chatId, workspaceId: session.workspaceId }, "chat pane removed");
133119
+ log8.info({ chatId, workspaceId: session.workspaceId }, "chat pane removed");
133344
133120
  return true;
133345
133121
  }
133346
133122
  function removeWorkspaceChats(workspaceId) {
@@ -133352,7 +133128,7 @@ function removeWorkspaceChats(workspaceId) {
133352
133128
  }
133353
133129
  deletePanelStatesForWorkspace(workspaceId, PANEL_TYPE);
133354
133130
  workspaceChats.delete(workspaceId);
133355
- log9.info({ workspaceId }, "all chat panes removed for workspace");
133131
+ log8.info({ workspaceId }, "all chat panes removed for workspace");
133356
133132
  }
133357
133133
  function loadChatsFromDb() {
133358
133134
  _initialized = true;
@@ -133380,7 +133156,7 @@ function loadChatsFromDb() {
133380
133156
  addToIndex(session);
133381
133157
  }
133382
133158
  if (rows.length > 0) {
133383
- log9.info({ count: rows.length }, "loaded chat panes from database");
133159
+ log8.info({ count: rows.length }, "loaded chat panes from database");
133384
133160
  }
133385
133161
  return rows.length;
133386
133162
  }
@@ -133495,7 +133271,7 @@ function clearQueuedMessages(chatId) {
133495
133271
  // src/lib/task-runner.ts
133496
133272
  init_src();
133497
133273
  import { mkdirSync as mkdirSync4, readdirSync as readdirSync6 } from "node:fs";
133498
- import { join as join17 } from "node:path";
133274
+ import { join as join16 } from "node:path";
133499
133275
 
133500
133276
  // src/lib/mime-types.ts
133501
133277
  import { extname } from "node:path";
@@ -133560,7 +133336,7 @@ function hasPendingInputForWorkspace(workspaceId) {
133560
133336
 
133561
133337
  // src/lib/task-store.ts
133562
133338
  init_src();
133563
- var log10 = createLogger("task-store");
133339
+ var log9 = createLogger("task-store");
133564
133340
  function generateTaskId() {
133565
133341
  return `tsk_${Date.now()}`;
133566
133342
  }
@@ -133633,7 +133409,7 @@ function cleanupStaleTasks() {
133633
133409
  const result = db2.update(tasks).set({ status: "failed", completedAt: now }).where(eq2(tasks.status, "running")).run();
133634
133410
  const count3 = result.changes;
133635
133411
  if (count3 > 0) {
133636
- log10.info({ count: count3 }, "cleaned up stale tasks on startup");
133412
+ log9.info({ count: count3 }, "cleaned up stale tasks on startup");
133637
133413
  }
133638
133414
  return count3;
133639
133415
  }
@@ -133670,7 +133446,7 @@ function pruneOldTasks(retentionMs = TASK_RETENTION_MS) {
133670
133446
  const cutoff = Date.now() - retentionMs;
133671
133447
  const count3 = deleteTasksOlderThan(cutoff);
133672
133448
  if (count3 > 0) {
133673
- log10.info({ count: count3, retentionMs }, "pruned tasks older than retention window");
133449
+ log9.info({ count: count3, retentionMs }, "pruned tasks older than retention window");
133674
133450
  }
133675
133451
  return count3;
133676
133452
  }
@@ -133681,13 +133457,13 @@ function startTaskPruneScheduler(options2 = {}) {
133681
133457
  try {
133682
133458
  pruneOldTasks(retentionMs);
133683
133459
  } catch (err) {
133684
- log10.error({ err }, "initial task prune on boot failed");
133460
+ log9.error({ err }, "initial task prune on boot failed");
133685
133461
  }
133686
133462
  const timer = setInterval(() => {
133687
133463
  try {
133688
133464
  pruneOldTasks(retentionMs);
133689
133465
  } catch (err) {
133690
- log10.error({ err }, "scheduled task prune failed");
133466
+ log9.error({ err }, "scheduled task prune failed");
133691
133467
  }
133692
133468
  }, intervalMs);
133693
133469
  timer.unref();
@@ -133730,9 +133506,9 @@ function rowToRecord(row) {
133730
133506
 
133731
133507
  // src/lib/upload-utils.ts
133732
133508
  import { mkdir, writeFile } from "node:fs/promises";
133733
- import { join as join16 } from "node:path";
133509
+ import { join as join15 } from "node:path";
133734
133510
  async function saveUploadedFilesDetailed(fileParts) {
133735
- const uploadDir = join16(bandHome(), "uploads");
133511
+ const uploadDir = join15(bandHome(), "uploads");
133736
133512
  await mkdir(uploadDir, { recursive: true });
133737
133513
  const baseTimestamp = Date.now();
133738
133514
  const saved = [];
@@ -133744,7 +133520,7 @@ async function saveUploadedFilesDetailed(fileParts) {
133744
133520
  const filename = part.filename || `file-${baseTimestamp}`;
133745
133521
  const safeOriginal = filename.replace(/[^a-zA-Z0-9._-]/g, "_");
133746
133522
  const storedName = `${baseTimestamp}-${i2}-${safeOriginal}`;
133747
- const filePath = join16(uploadDir, storedName);
133523
+ const filePath = join15(uploadDir, storedName);
133748
133524
  await writeFile(filePath, buffer);
133749
133525
  saved.push({
133750
133526
  path: filePath,
@@ -133774,7 +133550,7 @@ function resolveWorkspace(workspaceId) {
133774
133550
  }
133775
133551
 
133776
133552
  // src/lib/task-runner.ts
133777
- var log11 = createLogger("task-runner");
133553
+ var log10 = createLogger("task-runner");
133778
133554
  function listFiles(dir) {
133779
133555
  try {
133780
133556
  return new Set(readdirSync6(dir));
@@ -133833,7 +133609,7 @@ function persistTask(task) {
133833
133609
  chatId: task.chatId
133834
133610
  });
133835
133611
  } catch (err) {
133836
- log11.warn({ err, taskId: task.taskRecordId }, "failed to persist task");
133612
+ log10.warn({ err, taskId: task.taskRecordId }, "failed to persist task");
133837
133613
  }
133838
133614
  }
133839
133615
  function broadcast(chatId, chunk) {
@@ -133857,7 +133633,7 @@ function broadcast(chatId, chunk) {
133857
133633
  }
133858
133634
  const subs = listeners2.get(chatId);
133859
133635
  if (!subs || subs.size === 0) {
133860
- log11.warn({ chatId, chunkType: chunk.type }, "broadcast: no listeners");
133636
+ log10.warn({ chatId, chunkType: chunk.type }, "broadcast: no listeners");
133861
133637
  return;
133862
133638
  }
133863
133639
  for (const listener of subs) {
@@ -133908,7 +133684,7 @@ function submitTask(options2) {
133908
133684
  tasks2.set(chatId, task);
133909
133685
  persistTask(task);
133910
133686
  runTask(chatId, task).catch((err) => {
133911
- log11.error({ chatId, err }, "task execution failed");
133687
+ log10.error({ chatId, err }, "task execution failed");
133912
133688
  if (task.status === "running") {
133913
133689
  task.status = "failed";
133914
133690
  task.completedAt = Date.now();
@@ -133942,7 +133718,7 @@ function abortTask(chatId) {
133942
133718
  updateChatStatus(chatId, "idle");
133943
133719
  const updated = upsertWorkspaceStatus(task.workspaceId, { status: "waiting" });
133944
133720
  emit({ kind: "update", status: updated });
133945
- log11.info({ chatId }, "task aborted by user");
133721
+ log10.info({ chatId }, "task aborted by user");
133946
133722
  return true;
133947
133723
  }
133948
133724
  function cancelTask(taskId) {
@@ -133962,7 +133738,7 @@ function cancelTask(taskId) {
133962
133738
  updateChatStatus(chatId, "idle");
133963
133739
  const updated = upsertWorkspaceStatus(task.workspaceId, { status: "waiting" });
133964
133740
  emit({ kind: "update", status: updated });
133965
- log11.info({ chatId, taskId }, "task cancelled (was running in-memory)");
133741
+ log10.info({ chatId, taskId }, "task cancelled (was running in-memory)");
133966
133742
  return { cancelled: true, workspaceId: task.workspaceId };
133967
133743
  }
133968
133744
  }
@@ -133970,7 +133746,7 @@ function cancelTask(taskId) {
133970
133746
  if (record2) {
133971
133747
  const updated = upsertWorkspaceStatus(record2.workspaceId, { status: "waiting" });
133972
133748
  emit({ kind: "update", status: updated });
133973
- log11.info({ taskId, workspaceId: record2.workspaceId }, "orphaned task cancelled");
133749
+ log10.info({ taskId, workspaceId: record2.workspaceId }, "orphaned task cancelled");
133974
133750
  return { cancelled: true, workspaceId: record2.workspaceId };
133975
133751
  }
133976
133752
  return { cancelled: false };
@@ -133990,7 +133766,7 @@ async function runTask(chatId, task) {
133990
133766
  const taskAgentId = task.codingAgentId;
133991
133767
  const resolvedAgentId = taskAgentId ?? chatSession?.agent;
133992
133768
  const needsReplace = taskAgentId && taskAgentId !== chatSession?.agent;
133993
- log11.info(
133769
+ log10.info(
133994
133770
  { chatId, taskAgentId, chatAgent: chatSession?.agent, resolvedAgentId, needsReplace },
133995
133771
  "resolving agent for task"
133996
133772
  );
@@ -133998,7 +133774,7 @@ async function runTask(chatId, task) {
133998
133774
  updateChatStatus(chatId, "running");
133999
133775
  const working = upsertWorkspaceStatus(task.workspaceId, { status: "working" });
134000
133776
  emit({ kind: "update", status: working });
134001
- const sharedDir = join17(bandHome(), "shared", task.workspaceId);
133777
+ const sharedDir = join16(bandHome(), "shared", task.workspaceId);
134002
133778
  mkdirSync4(sharedDir, { recursive: true });
134003
133779
  const INTERACTIVE_TOOLS = /* @__PURE__ */ new Set(["AskUserQuestion", "ExitPlanMode"]);
134004
133780
  let textPartId = "";
@@ -134039,7 +133815,7 @@ async function runTask(chatId, task) {
134039
133815
  [File sharing: to send a file to the user, write or copy it to ${sharedDir}/ and it will appear as a downloadable file card in the chat.]`;
134040
133816
  const effectivePrompt = task.sessionId ? task.agentPrompt : task.agentPrompt + fileSharingHint;
134041
133817
  for await (const event of agent.runSession(effectivePrompt, task.sessionId, sessionOptions)) {
134042
- log11.info({ chatId, eventType: event.type }, "task event");
133818
+ log10.info({ chatId, eventType: event.type }, "task event");
134043
133819
  switch (event.type) {
134044
133820
  case "session-start": {
134045
133821
  task.sessionId = event.sessionId;
@@ -134220,7 +133996,7 @@ async function runTask(chatId, task) {
134220
133996
  break;
134221
133997
  }
134222
133998
  case "session-id-resolved": {
134223
- log11.info(
133999
+ log10.info(
134224
134000
  { chatId, previous: event.previousSessionId, resolved: event.resolvedSessionId },
134225
134001
  "session ID resolved"
134226
134002
  );
@@ -134315,7 +134091,7 @@ ${queued.text}`;
134315
134091
  });
134316
134092
  autoStarted = true;
134317
134093
  } catch (err) {
134318
- log11.warn({ chatId, err }, "failed to auto-start queued task");
134094
+ log10.warn({ chatId, err }, "failed to auto-start queued task");
134319
134095
  }
134320
134096
  }
134321
134097
  }
@@ -134415,7 +134191,7 @@ function getSessionEventsAfter(sessionId, afterEventId) {
134415
134191
  }
134416
134192
 
134417
134193
  // src/api/task-stream.ts
134418
- var log12 = createLogger("task-stream");
134194
+ var log11 = createLogger("task-stream");
134419
134195
  var INTERNAL_CHUNK_TYPES = /* @__PURE__ */ new Set(["user-message"]);
134420
134196
  function toUIChunk(chunk) {
134421
134197
  if (INTERNAL_CHUNK_TYPES.has(chunk.type)) return null;
@@ -134470,7 +134246,7 @@ function streamTask(res, chatId, sessionId, afterEventId) {
134470
134246
  const buf = getSessionBuffer(task.sessionId);
134471
134247
  if (buf && buf.events.length > 0) {
134472
134248
  const taskStartEventId = task.firstEventId ?? Number.POSITIVE_INFINITY;
134473
- log12.info(
134249
+ log11.info(
134474
134250
  {
134475
134251
  chatId,
134476
134252
  sessionId: task.sessionId,
@@ -134494,7 +134270,7 @@ function streamTask(res, chatId, sessionId, afterEventId) {
134494
134270
  }
134495
134271
  }
134496
134272
  if (queue.length === 0 && !caughtUp && (!task || task.status !== "running")) {
134497
- log12.warn(
134273
+ log11.warn(
134498
134274
  { chatId, taskStatus: task?.status, queueLen: queue.length },
134499
134275
  "task-stream: no running task and no events \u2014 closing stream early"
134500
134276
  );
@@ -134592,7 +134368,7 @@ ${prompt}`;
134592
134368
  }
134593
134369
  throw err;
134594
134370
  }
134595
- log12.info({ chatId, workspaceId }, "task-stream: POST \u2014 task submitted, opening SSE stream");
134371
+ log11.info({ chatId, workspaceId }, "task-stream: POST \u2014 task submitted, opening SSE stream");
134596
134372
  streamTask(res, chatId, sessionId, void 0);
134597
134373
  }
134598
134374
  function handleGet(req, res, chatId) {
@@ -134606,13 +134382,13 @@ function handleGet(req, res, chatId) {
134606
134382
  res.end();
134607
134383
  return;
134608
134384
  }
134609
- log12.info({ chatId, sessionId, afterEventId }, "task-stream: GET \u2014 reconnecting to active stream");
134385
+ log11.info({ chatId, sessionId, afterEventId }, "task-stream: GET \u2014 reconnecting to active stream");
134610
134386
  streamTask(res, chatId, sessionId ?? task.sessionId, afterEventId);
134611
134387
  }
134612
134388
  function handleTaskStream(req, res, chatId) {
134613
134389
  if (req.method === "POST") {
134614
134390
  handlePost(req, res, chatId).catch((err) => {
134615
- log12.error({ chatId, err }, "task-stream: POST handler error");
134391
+ log11.error({ chatId, err }, "task-stream: POST handler error");
134616
134392
  if (!res.headersSent) {
134617
134393
  res.writeHead(500, { "Content-Type": "application/json" });
134618
134394
  res.end(JSON.stringify({ error: "Internal server error" }));
@@ -134657,7 +134433,7 @@ function removeBrowserFromLayout(workspaceId, browserId) {
134657
134433
  }
134658
134434
 
134659
134435
  // src/lib/browser-manager.ts
134660
- var log13 = createLogger("browser-manager");
134436
+ var log12 = createLogger("browser-manager");
134661
134437
  var PANEL_TYPE2 = "browser";
134662
134438
  var browserTabs = /* @__PURE__ */ new Map();
134663
134439
  var workspaceBrowsers = /* @__PURE__ */ new Map();
@@ -134718,7 +134494,7 @@ function createBrowser(workspaceId, options2) {
134718
134494
  title: tab.name,
134719
134495
  initialUrl: tab.url || void 0
134720
134496
  });
134721
- log13.info({ browserId: tab.id, workspaceId, url: tab.url }, "browser tab created");
134497
+ log12.info({ browserId: tab.id, workspaceId, url: tab.url }, "browser tab created");
134722
134498
  return tab;
134723
134499
  }
134724
134500
  function getBrowser(browserId) {
@@ -134745,7 +134521,7 @@ function updateBrowser(browserId, updates) {
134745
134521
  state: serializeState2(tab),
134746
134522
  updatedAt: Date.now()
134747
134523
  });
134748
- log13.info({ browserId, updates }, "browser tab updated");
134524
+ log12.info({ browserId, updates }, "browser tab updated");
134749
134525
  return tab;
134750
134526
  }
134751
134527
  function updateBrowserUrl(browserId, url2) {
@@ -134762,7 +134538,7 @@ function removeBrowser(browserId) {
134762
134538
  if (!tab) return false;
134763
134539
  deletePanelState(browserId);
134764
134540
  removeFromIndex2(browserId);
134765
- log13.info({ browserId, workspaceId: tab.workspaceId }, "browser tab removed");
134541
+ log12.info({ browserId, workspaceId: tab.workspaceId }, "browser tab removed");
134766
134542
  return true;
134767
134543
  }
134768
134544
  function removeWorkspaceBrowsers(workspaceId) {
@@ -134773,7 +134549,7 @@ function removeWorkspaceBrowsers(workspaceId) {
134773
134549
  }
134774
134550
  deletePanelStatesForWorkspace(workspaceId, PANEL_TYPE2);
134775
134551
  workspaceBrowsers.delete(workspaceId);
134776
- log13.info({ workspaceId }, "all browser tabs removed for workspace");
134552
+ log12.info({ workspaceId }, "all browser tabs removed for workspace");
134777
134553
  }
134778
134554
  function loadBrowsersFromDb() {
134779
134555
  _initialized2 = true;
@@ -134796,13 +134572,13 @@ function loadBrowsersFromDb() {
134796
134572
  addToIndex2(tab);
134797
134573
  }
134798
134574
  if (rows.length > 0) {
134799
- log13.info({ count: rows.length }, "loaded browser tabs from database");
134575
+ log12.info({ count: rows.length }, "loaded browser tabs from database");
134800
134576
  }
134801
134577
  return rows.length;
134802
134578
  }
134803
134579
 
134804
134580
  // src/lib/browser-host.ts
134805
- var log14 = createLogger("browser-host");
134581
+ var log13 = createLogger("browser-host");
134806
134582
  var DESKTOP_CDP_HOST = "127.0.0.1";
134807
134583
  var DESKTOP_CDP_PORT = 9223;
134808
134584
  var globalAny = globalThis;
@@ -134853,7 +134629,7 @@ async function ensureCdpTargetId(bandTabId) {
134853
134629
  reject: rejectFn,
134854
134630
  timeoutId
134855
134631
  });
134856
- log14.info(
134632
+ log13.info(
134857
134633
  "ensureCdpTargetId emitting ensureView for %s (url=%s, listeners=%d)",
134858
134634
  bandTabId,
134859
134635
  tab.url,
@@ -134867,13 +134643,13 @@ async function ensureCdpTargetId(bandTabId) {
134867
134643
  url: tab.url
134868
134644
  });
134869
134645
  } catch (err) {
134870
- log14.warn("ensureView listener threw: %s", err instanceof Error ? err.message : err);
134646
+ log13.warn("ensureView listener threw: %s", err instanceof Error ? err.message : err);
134871
134647
  }
134872
134648
  }
134873
134649
  return promise2;
134874
134650
  }
134875
134651
  function resolveTargetReady(bandTabId, cdpTargetId) {
134876
- log14.info("resolveTargetReady %s \u2192 %s", bandTabId, cdpTargetId);
134652
+ log13.info("resolveTargetReady %s \u2192 %s", bandTabId, cdpTargetId);
134877
134653
  targetIdByBandTabId.set(bandTabId, cdpTargetId);
134878
134654
  const pending2 = pendingEnsures.get(bandTabId);
134879
134655
  if (pending2) {
@@ -134883,7 +134659,7 @@ function resolveTargetReady(bandTabId, cdpTargetId) {
134883
134659
  }
134884
134660
  }
134885
134661
  function markTargetDestroyed(bandTabId) {
134886
- log14.info("markTargetDestroyed %s", bandTabId);
134662
+ log13.info("markTargetDestroyed %s", bandTabId);
134887
134663
  targetIdByBandTabId.delete(bandTabId);
134888
134664
  const pending2 = pendingEnsures.get(bandTabId);
134889
134665
  if (pending2) {
@@ -134894,10 +134670,10 @@ function markTargetDestroyed(bandTabId) {
134894
134670
  }
134895
134671
  function onEnsureView(listener) {
134896
134672
  ensureListeners.add(listener);
134897
- log14.info("onEnsureView subscriber added (total=%d)", ensureListeners.size);
134673
+ log13.info("onEnsureView subscriber added (total=%d)", ensureListeners.size);
134898
134674
  return () => {
134899
134675
  ensureListeners.delete(listener);
134900
- log14.info("onEnsureView subscriber removed (total=%d)", ensureListeners.size);
134676
+ log13.info("onEnsureView subscriber removed (total=%d)", ensureListeners.size);
134901
134677
  if (ensureListeners.size === 0) {
134902
134678
  for (const [bandTabId, pending2] of pendingEnsures) {
134903
134679
  clearTimeout(pending2.timeoutId);
@@ -134914,7 +134690,7 @@ function isDesktopHostConnected() {
134914
134690
 
134915
134691
  // src/lib/cdp-proxy.ts
134916
134692
  init_src();
134917
- var log15 = createLogger("cdp-proxy");
134693
+ var log14 = createLogger("cdp-proxy");
134918
134694
  async function handleCdpConnection(ws, req) {
134919
134695
  const url2 = new URL(req.url ?? "", `http://${req.headers.host}`);
134920
134696
  const bandTabId = url2.searchParams.get("bandTabId");
@@ -134937,17 +134713,17 @@ async function handleCdpConnection(ws, req) {
134937
134713
  cdpTargetId = await ensureCdpTargetId(bandTabId);
134938
134714
  } catch (err) {
134939
134715
  const message = err instanceof Error ? err.message : String(err);
134940
- log15.debug("ensureCdpTargetId failed for %s: %s", bandTabId, message);
134716
+ log14.debug("ensureCdpTargetId failed for %s: %s", bandTabId, message);
134941
134717
  if (ws.readyState === ws.OPEN) {
134942
134718
  ws.close(4001, message.slice(0, 123));
134943
134719
  }
134944
134720
  return;
134945
134721
  }
134946
134722
  const upstreamUrl = `ws://${DESKTOP_CDP_HOST}:${DESKTOP_CDP_PORT}/devtools/page/${encodeURIComponent(cdpTargetId)}`;
134947
- log15.info("CDP proxy connecting bandTabId=%s upstream=%s", bandTabId, upstreamUrl);
134723
+ log14.info("CDP proxy connecting bandTabId=%s upstream=%s", bandTabId, upstreamUrl);
134948
134724
  upstream = new wrapper_default(upstreamUrl);
134949
134725
  upstream.on("open", () => {
134950
- log15.info("CDP upstream open bandTabId=%s pending=%d", bandTabId, pending2.length);
134726
+ log14.info("CDP upstream open bandTabId=%s pending=%d", bandTabId, pending2.length);
134951
134727
  for (const msg of pending2) {
134952
134728
  upstream?.send(msg);
134953
134729
  }
@@ -134959,20 +134735,20 @@ async function handleCdpConnection(ws, req) {
134959
134735
  }
134960
134736
  });
134961
134737
  upstream.on("error", (err) => {
134962
- log15.warn("CDP upstream error bandTabId=%s: %s", bandTabId, err.message);
134738
+ log14.warn("CDP upstream error bandTabId=%s: %s", bandTabId, err.message);
134963
134739
  markTargetDestroyed(bandTabId);
134964
134740
  if (ws.readyState === ws.OPEN) {
134965
134741
  ws.close(4001, `Desktop CDP error: ${err.message}`.slice(0, 123));
134966
134742
  }
134967
134743
  });
134968
134744
  upstream.on("close", (code) => {
134969
- log15.info("CDP upstream closed bandTabId=%s code=%d", bandTabId, code);
134745
+ log14.info("CDP upstream closed bandTabId=%s code=%d", bandTabId, code);
134970
134746
  if (ws.readyState === ws.OPEN) {
134971
134747
  ws.close(1e3, "Upstream closed");
134972
134748
  }
134973
134749
  });
134974
134750
  ws.on("close", () => {
134975
- log15.debug("CDP client closed bandTabId=%s", bandTabId);
134751
+ log14.debug("CDP client closed bandTabId=%s", bandTabId);
134976
134752
  if (upstream && (upstream.readyState === wrapper_default.OPEN || upstream.readyState === wrapper_default.CONNECTING)) {
134977
134753
  try {
134978
134754
  upstream.close();
@@ -134981,7 +134757,7 @@ async function handleCdpConnection(ws, req) {
134981
134757
  }
134982
134758
  });
134983
134759
  ws.on("error", (err) => {
134984
- log15.debug("CDP client error bandTabId=%s: %s", bandTabId, err.message);
134760
+ log14.debug("CDP client error bandTabId=%s: %s", bandTabId, err.message);
134985
134761
  try {
134986
134762
  upstream?.close();
134987
134763
  } catch {
@@ -134991,7 +134767,7 @@ async function handleCdpConnection(ws, req) {
134991
134767
 
134992
134768
  // src/lib/cdp-targets.ts
134993
134769
  init_src();
134994
- var log16 = createLogger("cdp-targets");
134770
+ var log15 = createLogger("cdp-targets");
134995
134771
  var CdpUnreachableError = class extends Error {
134996
134772
  constructor(message) {
134997
134773
  super(message);
@@ -135047,7 +134823,7 @@ async function captureSnapshot(bandTabId) {
135047
134823
  });
135048
134824
  ws.on("error", (err) => {
135049
134825
  clearTimeout(timeout);
135050
- log16.debug("captureSnapshot ws error for tab %s: %s", bandTabId, err.message);
134826
+ log15.debug("captureSnapshot ws error for tab %s: %s", bandTabId, err.message);
135051
134827
  markTargetDestroyed(bandTabId);
135052
134828
  settle(new CdpUnreachableError(err.message));
135053
134829
  });
@@ -135767,7 +135543,7 @@ function rowToDefinition(row) {
135767
135543
  }
135768
135544
 
135769
135545
  // src/lib/cronjob-scheduler.ts
135770
- var log17 = createLogger("cronjob-scheduler");
135546
+ var log16 = createLogger("cronjob-scheduler");
135771
135547
  var SCHEDULER_KEY = Symbol.for("band.cronjob-scheduler");
135772
135548
  var g14 = globalThis;
135773
135549
  if (!g14[SCHEDULER_KEY]) {
@@ -135787,16 +135563,16 @@ function scheduleJob(job, fileKey) {
135787
135563
  try {
135788
135564
  const cronInstance = new E2(job.cronExpression, () => {
135789
135565
  executeCronjob(job, fileKey).catch((err) => {
135790
- log17.error({ jobId: job.id, err }, "unhandled error in cronjob execution");
135566
+ log16.error({ jobId: job.id, err }, "unhandled error in cronjob execution");
135791
135567
  });
135792
135568
  });
135793
135569
  state.jobs.set(job.id, cronInstance);
135794
- log17.info(
135570
+ log16.info(
135795
135571
  { jobId: job.id, name: job.name, cron: job.cronExpression, scope: job.scope },
135796
135572
  "scheduled cronjob"
135797
135573
  );
135798
135574
  } catch (err) {
135799
- log17.error(
135575
+ log16.error(
135800
135576
  { jobId: job.id, cronExpression: job.cronExpression, err },
135801
135577
  "invalid cron expression, skipping job"
135802
135578
  );
@@ -135810,24 +135586,24 @@ async function executeCronjob(job, fileKey) {
135810
135586
  const appState = loadState();
135811
135587
  const project = appState.projects.find((p6) => p6.name === fileKey);
135812
135588
  if (!project) {
135813
- log17.warn({ jobId: job.id, fileKey }, "project not found for cronjob, skipping");
135589
+ log16.warn({ jobId: job.id, fileKey }, "project not found for cronjob, skipping");
135814
135590
  updateLastRun(job.id, "failed");
135815
135591
  return;
135816
135592
  }
135817
135593
  workspaceId = toWorkspaceId(project.name, project.defaultBranch);
135818
135594
  }
135819
- log17.info({ jobId: job.id, name: job.name, workspaceId }, "executing cronjob");
135595
+ log16.info({ jobId: job.id, name: job.name, workspaceId }, "executing cronjob");
135820
135596
  try {
135821
135597
  const chat = getOrCreateDefaultChat(workspaceId);
135822
135598
  submitTask({ workspaceId, chatId: chat.id, prompt: job.prompt });
135823
135599
  updateLastRun(job.id, "completed");
135824
135600
  } catch (err) {
135825
135601
  if (err instanceof TaskConflictError) {
135826
- log17.info({ jobId: job.id, workspaceId }, "task already running, skipping cronjob execution");
135602
+ log16.info({ jobId: job.id, workspaceId }, "task already running, skipping cronjob execution");
135827
135603
  updateLastRun(job.id, "skipped");
135828
135604
  return;
135829
135605
  }
135830
- log17.error({ jobId: job.id, err }, "cronjob execution failed");
135606
+ log16.error({ jobId: job.id, err }, "cronjob execution failed");
135831
135607
  updateLastRun(job.id, "failed");
135832
135608
  }
135833
135609
  }
@@ -135836,7 +135612,7 @@ function updateLastRun(jobId, status) {
135836
135612
  const db2 = getDb();
135837
135613
  db2.update(cronjobs).set({ lastRunAt: (/* @__PURE__ */ new Date()).toISOString(), lastRunStatus: status }).where(eq2(cronjobs.id, jobId)).run();
135838
135614
  } catch (err) {
135839
- log17.warn({ jobId, err }, "failed to update lastRun on cronjob");
135615
+ log16.warn({ jobId, err }, "failed to update lastRun on cronjob");
135840
135616
  }
135841
135617
  }
135842
135618
  function loadAndScheduleAll() {
@@ -135847,13 +135623,13 @@ function loadAndScheduleAll() {
135847
135623
  for (const job of listAllCronjobs()) {
135848
135624
  scheduleJob(job, job.fileKey);
135849
135625
  }
135850
- log17.info({ count: state.jobs.size }, "loaded cronjob schedules");
135626
+ log16.info({ count: state.jobs.size }, "loaded cronjob schedules");
135851
135627
  }
135852
135628
  function startCronjobScheduler() {
135853
135629
  if (state.started) return;
135854
135630
  state.started = true;
135855
135631
  loadAndScheduleAll();
135856
- log17.info("cronjob scheduler started");
135632
+ log16.info("cronjob scheduler started");
135857
135633
  }
135858
135634
  function stopCronjobScheduler() {
135859
135635
  for (const [, cron] of state.jobs) {
@@ -135861,7 +135637,7 @@ function stopCronjobScheduler() {
135861
135637
  }
135862
135638
  state.jobs.clear();
135863
135639
  state.started = false;
135864
- log17.info("cronjob scheduler stopped");
135640
+ log16.info("cronjob scheduler stopped");
135865
135641
  }
135866
135642
  function reloadSchedules() {
135867
135643
  if (!state.started) return;
@@ -135874,7 +135650,7 @@ function stopJobsForKey(key) {
135874
135650
  if (cron) {
135875
135651
  cron.stop();
135876
135652
  state.jobs.delete(job.id);
135877
- log17.info({ jobId: job.id, key }, "stopped cronjob");
135653
+ log16.info({ jobId: job.id, key }, "stopped cronjob");
135878
135654
  }
135879
135655
  }
135880
135656
  }
@@ -135887,7 +135663,7 @@ function runMigrations() {
135887
135663
  // src/lib/lsp-manager.ts
135888
135664
  init_src();
135889
135665
  import { spawn as spawn6 } from "node:child_process";
135890
- import { dirname as dirname2, join as join18, resolve as resolve4 } from "node:path";
135666
+ import { dirname as dirname2, join as join17, resolve as resolve4 } from "node:path";
135891
135667
  import { fileURLToPath } from "node:url";
135892
135668
 
135893
135669
  // src/lib/process-utils.ts
@@ -135940,7 +135716,7 @@ async function checkPrereqs() {
135940
135716
 
135941
135717
  // src/lib/lsp-manager.ts
135942
135718
  var __dirname2 = dirname2(fileURLToPath(import.meta.url));
135943
- var log18 = createLogger("lsp");
135719
+ var log17 = createLogger("lsp");
135944
135720
  var LANG_SERVER_CONFIG = {
135945
135721
  typescript: { command: "typescript-language-server", args: ["--stdio"] }
135946
135722
  };
@@ -135965,10 +135741,10 @@ async function getOrSpawnServer(workspaceId, lang) {
135965
135741
  const cwd = workspace.worktree.path;
135966
135742
  const appBin = resolve4(__dirname2, "../../node_modules/.bin");
135967
135743
  const bundledBin = resolve4(__dirname2, "node_modules/.bin");
135968
- const workspaceBin = join18(cwd, "node_modules/.bin");
135744
+ const workspaceBin = join17(cwd, "node_modules/.bin");
135969
135745
  const pathSep = process.platform === "win32" ? ";" : ":";
135970
135746
  const combinedPath = [bundledBin, appBin, workspaceBin, resolvedPath].join(pathSep);
135971
- log18.debug("Spawning %s language server in %s for workspace %s", lang, cwd, workspaceId);
135747
+ log17.debug("Spawning %s language server in %s for workspace %s", lang, cwd, workspaceId);
135972
135748
  const child = spawn6(config2.command, config2.args, {
135973
135749
  cwd,
135974
135750
  stdio: ["pipe", "pipe", "pipe"],
@@ -135996,15 +135772,15 @@ async function getOrSpawnServer(workspaceId, lang) {
135996
135772
  }
135997
135773
  ids.add(serverId);
135998
135774
  child.on("exit", (code) => {
135999
- log18.debug("Language server exited: %s (code %s)", serverId, String(code));
135775
+ log17.debug("Language server exited: %s (code %s)", serverId, String(code));
136000
135776
  removeSession();
136001
135777
  });
136002
135778
  child.on("error", (err) => {
136003
- log18.error("Language server error: %s \u2014 %s", serverId, err.message);
135779
+ log17.error("Language server error: %s \u2014 %s", serverId, err.message);
136004
135780
  removeSession();
136005
135781
  });
136006
135782
  child.stderr?.on("data", (chunk) => {
136007
- log18.debug("LSP stderr [%s]: %s", serverId, chunk.toString().trimEnd());
135783
+ log17.debug("LSP stderr [%s]: %s", serverId, chunk.toString().trimEnd());
136008
135784
  });
136009
135785
  await new Promise((resolve8, reject) => {
136010
135786
  child.once("spawn", resolve8);
@@ -136034,7 +135810,7 @@ function killAllServers() {
136034
135810
 
136035
135811
  // src/lib/lsp-proxy.ts
136036
135812
  init_src();
136037
- var log19 = createLogger("lsp-proxy");
135813
+ var log18 = createLogger("lsp-proxy");
136038
135814
  function frameMessage(json4) {
136039
135815
  const body = Buffer.from(json4, "utf-8");
136040
135816
  const header = `Content-Length: ${body.byteLength}\r
@@ -136052,7 +135828,7 @@ function createFrameParser(onMessage) {
136052
135828
  const headerStr = buffer.subarray(0, separatorIdx).toString("ascii");
136053
135829
  const match = headerStr.match(/Content-Length:\s*(\d+)/i);
136054
135830
  if (!match) {
136055
- log19.warn("Malformed LSP header: %s", headerStr);
135831
+ log18.warn("Malformed LSP header: %s", headerStr);
136056
135832
  buffer = buffer.subarray(separatorIdx + 4);
136057
135833
  continue;
136058
135834
  }
@@ -136085,7 +135861,7 @@ async function handleLspConnection(ws, req) {
136085
135861
  session = await getOrSpawnServer(workspaceId, lang);
136086
135862
  } catch (err) {
136087
135863
  const message = err instanceof Error ? err.message : String(err);
136088
- log19.error(
135864
+ log18.error(
136089
135865
  "Failed to spawn %s language server for workspace %s: %s",
136090
135866
  lang,
136091
135867
  workspaceId,
@@ -136099,12 +135875,12 @@ async function handleLspConnection(ws, req) {
136099
135875
  ws.close(4002, "Language server stdio not available");
136100
135876
  return;
136101
135877
  }
136102
- log19.debug("LSP client connected: %s/%s", workspaceId, lang);
135878
+ log18.debug("LSP client connected: %s/%s", workspaceId, lang);
136103
135879
  const pendingRequests = /* @__PURE__ */ new Map();
136104
135880
  const retriedIds = /* @__PURE__ */ new Set();
136105
135881
  const RETRY_DELAY_MS = 2e3;
136106
135882
  const parseFrame = createFrameParser((json4) => {
136107
- log19.debug(
135883
+ log18.debug(
136108
135884
  "LSP stdout [%s/%s]: %s",
136109
135885
  workspaceId,
136110
135886
  lang,
@@ -136116,7 +135892,7 @@ async function handleLspConnection(ws, req) {
136116
135892
  const originalRequest = pendingRequests.get(msg.id);
136117
135893
  retriedIds.add(msg.id);
136118
135894
  pendingRequests.delete(msg.id);
136119
- log19.debug(
135895
+ log18.debug(
136120
135896
  "LSP retrying request %d after 'No Project' error [%s/%s]",
136121
135897
  msg.id,
136122
135898
  workspaceId,
@@ -136138,14 +135914,14 @@ async function handleLspConnection(ws, req) {
136138
135914
  const onStdoutData = (chunk) => parseFrame(chunk);
136139
135915
  lspProcess.stdout.on("data", onStdoutData);
136140
135916
  const onExit = (code) => {
136141
- log19.debug("LSP server exited (code %s), closing WebSocket", String(code));
135917
+ log18.debug("LSP server exited (code %s), closing WebSocket", String(code));
136142
135918
  if (ws.readyState === ws.OPEN) {
136143
135919
  ws.close(1e3, "Language server exited");
136144
135920
  }
136145
135921
  };
136146
135922
  lspProcess.on("exit", onExit);
136147
135923
  function forwardToStdin(json4) {
136148
- log19.debug(
135924
+ log18.debug(
136149
135925
  "LSP stdin [%s/%s]: %s",
136150
135926
  workspaceId,
136151
135927
  lang,
@@ -136172,7 +135948,7 @@ async function handleLspConnection(ws, req) {
136172
135948
  ws.on("close", () => {
136173
135949
  lspProcess.stdout?.off("data", onStdoutData);
136174
135950
  lspProcess.off("exit", onExit);
136175
- log19.debug("LSP client disconnected: %s/%s (server kept alive)", workspaceId, lang);
135951
+ log18.debug("LSP client disconnected: %s/%s (server kept alive)", workspaceId, lang);
136176
135952
  });
136177
135953
  }
136178
135954
 
@@ -136182,20 +135958,21 @@ init_src();
136182
135958
  // src/lib/cli.ts
136183
135959
  import { accessSync, constants, lstatSync as lstatSync2, realpathSync as realpathSync2, symlinkSync as symlinkSync2, unlinkSync as unlinkSync2 } from "node:fs";
136184
135960
  import { platform as platform2 } from "node:os";
136185
- import { dirname as dirname3, join as join19, resolve as resolve5 } from "node:path";
135961
+ import { dirname as dirname3, join as join18, resolve as resolve5 } from "node:path";
136186
135962
  var SYMLINK_PATH = "/usr/local/bin/band";
136187
- function findCliBinary() {
135963
+ function findCliBinaryAt(opts) {
135964
+ const { cwd, dirname: dirname7 } = opts;
136188
135965
  const appsStrategies = [
136189
135966
  // cwd = apps/web/ (Vite dev and production server)
136190
- resolve5(process.cwd(), ".."),
135967
+ resolve5(cwd, ".."),
136191
135968
  // cwd = project root (fallback)
136192
- resolve5(process.cwd(), "apps"),
135969
+ resolve5(cwd, "apps"),
136193
135970
  // From this source file (apps/web/src/lib/ → apps/)
136194
- resolve5(import.meta.dirname, "..", "..", "..")
135971
+ resolve5(dirname7, "..", "..", "..")
136195
135972
  ];
136196
135973
  for (const appsDir of appsStrategies) {
136197
135974
  for (const profile of ["release", "debug"]) {
136198
- const p6 = join19(appsDir, "cli", "target", profile, "band");
135975
+ const p6 = join18(appsDir, "cli", "target", profile, "band");
136199
135976
  try {
136200
135977
  lstatSync2(p6);
136201
135978
  return p6;
@@ -136205,10 +135982,11 @@ function findCliBinary() {
136205
135982
  }
136206
135983
  const exe = platform2() === "win32" ? "band.exe" : "band";
136207
135984
  const electronCandidates = [
136208
- // From cwd (<Resources>/web/dist) → <Resources>/binaries/band
136209
- resolve5(process.cwd(), "..", "..", "binaries", exe),
136210
- // From the bundled dist file (<Resources>/web/dist/...) → <Resources>/binaries/band
136211
- resolve5(import.meta.dirname, "..", "..", "..", "binaries", exe)
135985
+ // From cwd (<Resources>/web) → <Resources>/binaries/band
135986
+ resolve5(cwd, "..", "binaries", exe),
135987
+ // From the bundled dist file (<Resources>/web/dist/start-server.mjs)
135988
+ // <Resources>/binaries/band
135989
+ resolve5(dirname7, "..", "..", "binaries", exe)
136212
135990
  ];
136213
135991
  for (const p6 of electronCandidates) {
136214
135992
  try {
@@ -136219,6 +135997,9 @@ function findCliBinary() {
136219
135997
  }
136220
135998
  return null;
136221
135999
  }
136000
+ function findCliBinary() {
136001
+ return findCliBinaryAt({ cwd: process.cwd(), dirname: import.meta.dirname });
136002
+ }
136222
136003
  async function checkCli() {
136223
136004
  try {
136224
136005
  const stat5 = lstatSync2(SYMLINK_PATH);
@@ -136231,8 +136012,8 @@ async function checkCli() {
136231
136012
  } catch {
136232
136013
  return "NotInstalled";
136233
136014
  }
136234
- const isCargoBuild = target.includes(join19("apps", "cli", "target"));
136235
- const isElectronSidecar = target.endsWith(join19("binaries", "band"));
136015
+ const isCargoBuild = target.includes(join18("apps", "cli", "target"));
136016
+ const isElectronSidecar = target.endsWith(join18("binaries", "band"));
136236
136017
  if (isCargoBuild || isElectronSidecar) {
136237
136018
  return "Installed";
136238
136019
  }
@@ -136265,12 +136046,18 @@ function isDirWritable(dir) {
136265
136046
  return false;
136266
136047
  }
136267
136048
  }
136049
+ function noBinaryError(env = process.env) {
136050
+ if (env.BAND_PACKAGED === "1") {
136051
+ return new Error("Bundled CLI binary missing - try reinstalling Band");
136052
+ }
136053
+ return new Error(
136054
+ "Could not find band CLI binary. Build it first with: cargo build --release -p band-cli"
136055
+ );
136056
+ }
136268
136057
  async function installCli(_opts = {}) {
136269
136058
  const binaryPath = findCliBinary();
136270
136059
  if (!binaryPath) {
136271
- throw new Error(
136272
- "Could not find band CLI binary. Build it first with: cargo build --release -p band-cli"
136273
- );
136060
+ throw noBinaryError();
136274
136061
  }
136275
136062
  const dir = dirname3(SYMLINK_PATH);
136276
136063
  if (isDirWritable(dir)) {
@@ -136310,8 +136097,8 @@ import {
136310
136097
  symlinkSync as symlinkSync3,
136311
136098
  writeFileSync as writeFileSync2
136312
136099
  } from "node:fs";
136313
- import { homedir as homedir9, tmpdir } from "node:os";
136314
- import { dirname as dirname4, join as join20 } from "node:path";
136100
+ import { homedir as homedir8, tmpdir } from "node:os";
136101
+ import { dirname as dirname4, join as join19 } from "node:path";
136315
136102
  var BAND_SKILL_NAMES = [
136316
136103
  "band",
136317
136104
  "band-chat",
@@ -136321,7 +136108,7 @@ var BAND_SKILL_NAMES = [
136321
136108
  "band-loop"
136322
136109
  ];
136323
136110
  var SKILL_FILE = "SKILL.md";
136324
- async function resolveSkillTargets(home = homedir9()) {
136111
+ async function resolveSkillTargets(home = homedir8()) {
136325
136112
  const seen = /* @__PURE__ */ new Set();
136326
136113
  const out = [];
136327
136114
  for (const type of SUPPORTED_AGENT_TYPES) {
@@ -136378,7 +136165,7 @@ async function installSkills(opts = {}) {
136378
136165
  conflicts: [],
136379
136166
  skipped: []
136380
136167
  };
136381
- const home = opts.home ?? homedir9();
136168
+ const home = opts.home ?? homedir8();
136382
136169
  const sharedDir = getSharedSkillsDir(home);
136383
136170
  const targets = await resolveSkillTargets(home);
136384
136171
  const bandPath = await findBandBinary();
@@ -136387,16 +136174,16 @@ async function installSkills(opts = {}) {
136387
136174
  "Skipping CLI skills sync \u2014 band binary not found (no symlink, not on PATH, no bundled sidecar)"
136388
136175
  );
136389
136176
  for (const name24 of BAND_SKILL_NAMES) {
136390
- result.skipped.push(join20(sharedDir, name24, SKILL_FILE));
136177
+ result.skipped.push(join19(sharedDir, name24, SKILL_FILE));
136391
136178
  }
136392
136179
  return result;
136393
136180
  }
136394
- const stagingDir = mkdtempSync(join20(tmpdir(), "band-skills-"));
136181
+ const stagingDir = mkdtempSync(join19(tmpdir(), "band-skills-"));
136395
136182
  try {
136396
136183
  await generateSkills(bandPath, stagingDir);
136397
136184
  for (const name24 of BAND_SKILL_NAMES) {
136398
- const sourcePath = join20(stagingDir, name24, SKILL_FILE);
136399
- const destPath = join20(sharedDir, name24, SKILL_FILE);
136185
+ const sourcePath = join19(stagingDir, name24, SKILL_FILE);
136186
+ const destPath = join19(sharedDir, name24, SKILL_FILE);
136400
136187
  if (!existsSync5(sourcePath)) {
136401
136188
  opts.log?.warn("Generated skill missing from staging dir: %s (skipping)", sourcePath);
136402
136189
  result.skipped.push(destPath);
@@ -136443,8 +136230,8 @@ async function installSkills(opts = {}) {
136443
136230
  }
136444
136231
  for (const target of targets) {
136445
136232
  for (const name24 of BAND_SKILL_NAMES) {
136446
- const shared2 = join20(sharedDir, name24);
136447
- const link2 = join20(target.skillsDir, name24);
136233
+ const shared2 = join19(sharedDir, name24);
136234
+ const link2 = join19(target.skillsDir, name24);
136448
136235
  if (!existsSync5(shared2)) {
136449
136236
  result.skipped.push(link2);
136450
136237
  continue;
@@ -136563,11 +136350,11 @@ function readlinkSafe(p6) {
136563
136350
 
136564
136351
  // src/lib/hooks.ts
136565
136352
  import { mkdirSync as mkdirSync6, readFileSync as readFileSync8, writeFileSync as writeFileSync3 } from "node:fs";
136566
- import { homedir as homedir10 } from "node:os";
136567
- import { dirname as dirname5, join as join21 } from "node:path";
136353
+ import { homedir as homedir9 } from "node:os";
136354
+ import { dirname as dirname5, join as join20 } from "node:path";
136568
136355
  var HOOK_EVENTS = ["PreToolUse", "PermissionRequest", "UserPromptSubmit", "PostToolUse", "Stop"];
136569
136356
  function claudeSettingsPath() {
136570
- return join21(homedir10(), ".claude", "settings.json");
136357
+ return join20(homedir9(), ".claude", "settings.json");
136571
136358
  }
136572
136359
  function loadClaudeSettings() {
136573
136360
  try {
@@ -136657,7 +136444,7 @@ async function installHooks() {
136657
136444
  }
136658
136445
 
136659
136446
  // src/lib/setup.ts
136660
- var log20 = createLogger("setup");
136447
+ var log19 = createLogger("setup");
136661
136448
  var AGENT_CHECKS = [
136662
136449
  { id: "claude-code", type: "claude-code", label: "Claude Code", binary: "claude" },
136663
136450
  { id: "codex", type: "codex", label: "Codex", binary: "codex" },
@@ -136675,22 +136462,22 @@ async function ensureCliInstalled() {
136675
136462
  try {
136676
136463
  cliStatus = await checkCli();
136677
136464
  } catch (err) {
136678
- log20.warn("Could not check CLI status: %s", err instanceof Error ? err.message : String(err));
136465
+ log19.warn("Could not check CLI status: %s", err instanceof Error ? err.message : String(err));
136679
136466
  return;
136680
136467
  }
136681
136468
  if (cliStatus === "Installed") {
136682
136469
  return;
136683
136470
  }
136684
136471
  if (cliStatus !== "NotInstalled") {
136685
- log20.warn("CLI not auto-installed (status: %s)", cliStatus);
136472
+ log19.warn("CLI not auto-installed (status: %s)", cliStatus);
136686
136473
  return;
136687
136474
  }
136688
- log20.info("Installing band CLI...");
136475
+ log19.info("Installing band CLI...");
136689
136476
  try {
136690
136477
  await installCli();
136691
- log20.info("CLI installed to /usr/local/bin/band");
136478
+ log19.info("CLI installed to /usr/local/bin/band");
136692
136479
  } catch (err) {
136693
- log20.warn("CLI installation failed: %s", err instanceof Error ? err.message : String(err));
136480
+ log19.warn("CLI installation failed: %s", err instanceof Error ? err.message : String(err));
136694
136481
  }
136695
136482
  }
136696
136483
  async function ensureDefaultCodingAgents() {
@@ -136699,17 +136486,17 @@ async function ensureDefaultCodingAgents() {
136699
136486
  if (Array.isArray(existing) && existing.length > 0) {
136700
136487
  return;
136701
136488
  }
136702
- log20.info("Detecting installed coding agents...");
136489
+ log19.info("Detecting installed coding agents...");
136703
136490
  const detected = [];
136704
136491
  for (const check2 of AGENT_CHECKS) {
136705
136492
  const path3 = await whichBinary(check2.binary);
136706
136493
  if (path3) {
136707
- log20.info("Detected coding agent: %s (%s)", check2.id, path3);
136494
+ log19.info("Detected coding agent: %s (%s)", check2.id, path3);
136708
136495
  detected.push({ id: check2.id, type: check2.type, label: check2.label });
136709
136496
  }
136710
136497
  }
136711
136498
  if (detected.length === 0) {
136712
- log20.info("No coding agent CLIs detected on PATH");
136499
+ log19.info("No coding agent CLIs detected on PATH");
136713
136500
  return;
136714
136501
  }
136715
136502
  const current = loadSettings();
@@ -136718,7 +136505,7 @@ async function ensureDefaultCodingAgents() {
136718
136505
  current.defaultCodingAgent = detected[0].id;
136719
136506
  }
136720
136507
  saveSettings(current);
136721
- log20.info("Enabled %d coding agent(s); default = %s", detected.length, current.defaultCodingAgent);
136508
+ log19.info("Enabled %d coding agent(s); default = %s", detected.length, current.defaultCodingAgent);
136722
136509
  }
136723
136510
  function ensureNotificationDefaults() {
136724
136511
  const settings = loadSettings();
@@ -136730,7 +136517,7 @@ function ensureNotificationDefaults() {
136730
136517
  ...settings,
136731
136518
  notifications: { ...notifications, soundOnNeedsAttention: true }
136732
136519
  });
136733
- log20.info("Set default notifications.soundOnNeedsAttention = true");
136520
+ log19.info("Set default notifications.soundOnNeedsAttention = true");
136734
136521
  }
136735
136522
  async function ensureClaudeHooks() {
136736
136523
  try {
@@ -136739,9 +136526,9 @@ async function ensureClaudeHooks() {
136739
136526
  return;
136740
136527
  }
136741
136528
  await installHooks();
136742
- log20.info("Installed Claude Code hooks");
136529
+ log19.info("Installed Claude Code hooks");
136743
136530
  } catch (err) {
136744
- log20.warn(
136531
+ log19.warn(
136745
136532
  "Failed to install Claude Code hooks: %s",
136746
136533
  err instanceof Error ? err.message : String(err)
136747
136534
  );
@@ -136749,11 +136536,11 @@ async function ensureClaudeHooks() {
136749
136536
  }
136750
136537
  async function ensureSkillsInstalled() {
136751
136538
  try {
136752
- const result = await installSkills({ log: log20 });
136539
+ const result = await installSkills({ log: log19 });
136753
136540
  const wrote = result.written.length + result.updated.length;
136754
136541
  const linkChange = result.linked.length;
136755
136542
  if (wrote > 0 || linkChange > 0 || result.conflicts.length > 0) {
136756
- log20.info(
136543
+ log19.info(
136757
136544
  "Synced CLI skills (shared: %d written, %d updated, %d unchanged; symlinks: %d created, %d already-linked, %d conflicts, %d skipped)",
136758
136545
  result.written.length,
136759
136546
  result.updated.length,
@@ -136765,14 +136552,14 @@ async function ensureSkillsInstalled() {
136765
136552
  );
136766
136553
  }
136767
136554
  } catch (err) {
136768
- log20.warn("Failed to sync CLI skills: %s", err instanceof Error ? err.message : String(err));
136555
+ log19.warn("Failed to sync CLI skills: %s", err instanceof Error ? err.message : String(err));
136769
136556
  }
136770
136557
  }
136771
136558
 
136772
136559
  // src/lib/terminal-manager.ts
136773
136560
  init_src();
136774
136561
  import { existsSync as existsSync6 } from "node:fs";
136775
- import { join as join22 } from "node:path";
136562
+ import { join as join21 } from "node:path";
136776
136563
 
136777
136564
  // src/lib/terminal-layout-manager.ts
136778
136565
  var manager3 = new DockviewLayoutManager("terminal_layout");
@@ -136799,7 +136586,7 @@ function removeTerminalFromLayout(workspaceId, terminalId) {
136799
136586
  }
136800
136587
 
136801
136588
  // src/lib/terminal-manager.ts
136802
- var log21 = createLogger("terminal");
136589
+ var log20 = createLogger("terminal");
136803
136590
  var MAX_SCROLLBACK_SIZE = 1e5;
136804
136591
  var terminals = /* @__PURE__ */ new Map();
136805
136592
  var workspaceTerminals = /* @__PURE__ */ new Map();
@@ -136828,13 +136615,13 @@ async function spawnTerminal(workspaceId, terminalId, options2) {
136828
136615
  const workspaceRoot = workspace.worktree.path;
136829
136616
  let cwd = workspaceRoot;
136830
136617
  if (options2?.cwd) {
136831
- const resolved = join22(workspaceRoot, options2.cwd);
136618
+ const resolved = join21(workspaceRoot, options2.cwd);
136832
136619
  if (!resolved.startsWith(workspaceRoot)) {
136833
- log21.warn("Ignoring cwd %s \u2014 resolves outside workspace root %s", options2.cwd, workspaceRoot);
136620
+ log20.warn("Ignoring cwd %s \u2014 resolves outside workspace root %s", options2.cwd, workspaceRoot);
136834
136621
  } else if (existsSync6(resolved)) {
136835
136622
  cwd = resolved;
136836
136623
  } else {
136837
- log21.warn("Ignoring cwd %s \u2014 directory does not exist", options2.cwd);
136624
+ log20.warn("Ignoring cwd %s \u2014 directory does not exist", options2.cwd);
136838
136625
  }
136839
136626
  }
136840
136627
  if (!existsSync6(cwd)) {
@@ -136843,7 +136630,7 @@ async function spawnTerminal(workspaceId, terminalId, options2) {
136843
136630
  if (!existsSync6(shell)) {
136844
136631
  throw new Error(`Shell not found: ${shell}`);
136845
136632
  }
136846
- log21.debug(
136633
+ log20.debug(
136847
136634
  "Spawning shell %s in %s for terminal %s (PATH=%s)",
136848
136635
  shell,
136849
136636
  cwd,
@@ -136862,7 +136649,7 @@ async function spawnTerminal(workspaceId, terminalId, options2) {
136862
136649
  });
136863
136650
  } catch (err) {
136864
136651
  const msg = err instanceof Error ? err.message : String(err);
136865
- log21.error("pty.spawn failed: %s (shell=%s, cwd=%s)", msg, shell, cwd);
136652
+ log20.error("pty.spawn failed: %s (shell=%s, cwd=%s)", msg, shell, cwd);
136866
136653
  throw err;
136867
136654
  }
136868
136655
  const session = { pty: ptyProcess, scrollback: "", workspaceId };
@@ -136898,7 +136685,7 @@ async function spawnTerminal(workspaceId, terminalId, options2) {
136898
136685
  }
136899
136686
  });
136900
136687
  ptyProcess.onExit(() => {
136901
- log21.debug("Terminal exited: %s (workspace %s)", terminalId, workspaceId);
136688
+ log20.debug("Terminal exited: %s (workspace %s)", terminalId, workspaceId);
136902
136689
  terminals.delete(terminalId);
136903
136690
  outputListeners.delete(terminalId);
136904
136691
  const set2 = workspaceTerminals.get(workspaceId);
@@ -137006,7 +136793,7 @@ function killAllTerminals() {
137006
136793
 
137007
136794
  // src/lib/terminal-ws.ts
137008
136795
  init_src();
137009
- var log22 = createLogger("terminal-ws");
136796
+ var log21 = createLogger("terminal-ws");
137010
136797
  async function handleTerminalConnection(ws, req) {
137011
136798
  const url2 = new URL(req.url, `http://${req.headers.host}`);
137012
136799
  const workspaceId = url2.searchParams.get("workspaceId");
@@ -137047,7 +136834,7 @@ async function handleTerminalConnection(ws, req) {
137047
136834
  session = await spawnTerminal(workspaceId, terminalId, spawnOpts);
137048
136835
  } catch (err) {
137049
136836
  const msg = err instanceof Error ? err.message : String(err);
137050
- log22.error("Failed to spawn terminal %s for workspace %s: %s", terminalId, workspaceId, msg);
136837
+ log21.error("Failed to spawn terminal %s for workspace %s: %s", terminalId, workspaceId, msg);
137051
136838
  ws.close(4001, msg);
137052
136839
  return;
137053
136840
  }
@@ -137061,7 +136848,7 @@ async function handleTerminalConnection(ws, req) {
137061
136848
  });
137062
136849
  }
137063
136850
  function attachSession(ws, terminalId, workspaceId, session, isNew) {
137064
- log22.debug(
136851
+ log21.debug(
137065
136852
  "Terminal %s: %s (workspace %s)",
137066
136853
  isNew ? "connected" : "reconnected",
137067
136854
  terminalId,
@@ -137090,7 +136877,7 @@ function attachSession(ws, terminalId, workspaceId, session, isNew) {
137090
136877
  }, 3e3);
137091
136878
  const exitDisposable = session.pty.onExit(({ exitCode }) => {
137092
136879
  clearInterval(processInterval);
137093
- log22.debug("PTY exited with code %d for terminal %s", exitCode, terminalId);
136880
+ log21.debug("PTY exited with code %d for terminal %s", exitCode, terminalId);
137094
136881
  if (ws.readyState === ws.OPEN) {
137095
136882
  ws.close(1e3, "Terminal exited");
137096
136883
  }
@@ -137102,7 +136889,7 @@ function attachSession(ws, terminalId, workspaceId, session, isNew) {
137102
136889
  clearInterval(processInterval);
137103
136890
  dataDisposable.dispose();
137104
136891
  exitDisposable.dispose();
137105
- log22.debug("Terminal disconnected: %s (PTY kept alive)", terminalId);
136892
+ log21.debug("Terminal disconnected: %s (PTY kept alive)", terminalId);
137106
136893
  });
137107
136894
  }
137108
136895
  function handleMessage(ws, terminalId, session, message) {
@@ -137140,7 +136927,7 @@ function getToken() {
137140
136927
  }
137141
136928
 
137142
136929
  // src/lib/tunnel.ts
137143
- var log23 = createLogger("tunnel");
136930
+ var log22 = createLogger("tunnel");
137144
136931
  var tunnelProcess = null;
137145
136932
  var tunnelUrl = null;
137146
136933
  var startInProgress = null;
@@ -137154,7 +136941,7 @@ function appendToken(baseUrl, token) {
137154
136941
  }
137155
136942
  function spawnTunnel(options2, resolvedPath) {
137156
136943
  const args = ["tunnel", "--config", "/dev/null", "--url", `http://localhost:${options2.port}`];
137157
- log23.debug("spawning cloudflared %s", args.join(" "));
136944
+ log22.debug("spawning cloudflared %s", args.join(" "));
137158
136945
  return new Promise((resolve8, reject) => {
137159
136946
  const child = spawn7("cloudflared", args, {
137160
136947
  env: { ...process.env, PATH: resolvedPath },
@@ -137168,12 +136955,12 @@ function spawnTunnel(options2, resolvedPath) {
137168
136955
  for (const line2 of text4.split("\n")) {
137169
136956
  const trimmed = line2.trim();
137170
136957
  if (!trimmed) continue;
137171
- log23.debug("output: %s", trimmed);
136958
+ log22.debug("output: %s", trimmed);
137172
136959
  const url2 = extractUrl(trimmed);
137173
136960
  if (url2) {
137174
136961
  const token = getToken();
137175
136962
  tunnelUrl = appendToken(url2, token);
137176
- log23.debug("detected URL: %s", tunnelUrl);
136963
+ log22.debug("detected URL: %s", tunnelUrl);
137177
136964
  emit({ kind: "tunnel-url", url: tunnelUrl });
137178
136965
  if (!settled) {
137179
136966
  settled = true;
@@ -137188,7 +136975,7 @@ function spawnTunnel(options2, resolvedPath) {
137188
136975
  handleOutput(data);
137189
136976
  });
137190
136977
  child.on("error", (err) => {
137191
- log23.debug("process error: %s", err.message);
136978
+ log22.debug("process error: %s", err.message);
137192
136979
  tunnelProcess = null;
137193
136980
  tunnelUrl = null;
137194
136981
  emit({ kind: "tunnel-error", error: err.message });
@@ -137198,7 +136985,7 @@ function spawnTunnel(options2, resolvedPath) {
137198
136985
  }
137199
136986
  });
137200
136987
  child.on("exit", (code) => {
137201
- log23.debug("process exited with code: %d", code ?? -1);
136988
+ log22.debug("process exited with code: %d", code ?? -1);
137202
136989
  const wasRunning = tunnelProcess !== null && settled;
137203
136990
  tunnelProcess = null;
137204
136991
  tunnelUrl = null;
@@ -137220,7 +137007,7 @@ function spawnTunnel(options2, resolvedPath) {
137220
137007
  });
137221
137008
  setTimeout(() => {
137222
137009
  if (!settled) {
137223
- log23.debug("30s timeout reached, resolving without URL");
137010
+ log22.debug("30s timeout reached, resolving without URL");
137224
137011
  settled = true;
137225
137012
  resolve8();
137226
137013
  }
@@ -137229,12 +137016,12 @@ function spawnTunnel(options2, resolvedPath) {
137229
137016
  }
137230
137017
  async function startTunnel(options2) {
137231
137018
  if (startInProgress) {
137232
- log23.debug("startTunnel: start already in progress, waiting...");
137019
+ log22.debug("startTunnel: start already in progress, waiting...");
137233
137020
  await startInProgress;
137234
137021
  return;
137235
137022
  }
137236
137023
  if (tunnelProcess) {
137237
- log23.debug("startTunnel: already running, re-emitting URL");
137024
+ log22.debug("startTunnel: already running, re-emitting URL");
137238
137025
  if (tunnelUrl) {
137239
137026
  emit({ kind: "tunnel-url", url: tunnelUrl });
137240
137027
  }
@@ -144158,13 +143945,14 @@ function createContext8() {
144158
143945
  }
144159
143946
 
144160
143947
  // src/trpc/router.ts
144161
- import { execFile as execFile5, execFileSync as execFileSync2 } from "node:child_process";
143948
+ import { execFile as execFile5, execFileSync as execFileSync2, spawn as spawn8 } from "node:child_process";
144162
143949
  import { randomUUID as randomUUID2 } from "node:crypto";
144163
143950
  import { existsSync as existsSync7, mkdirSync as mkdirSync7, unlinkSync as unlinkSync3 } from "node:fs";
144164
143951
  import { cp, mkdir as mkdir2, readdir as readdir2, readFile as readFile2, rename, rm, stat as stat4, writeFile as writeFile2 } from "node:fs/promises";
144165
- import { basename, dirname as dirname6, extname as extname2, join as join23, resolve as resolve6, sep as sep2 } from "node:path";
143952
+ import { basename, dirname as dirname6, extname as extname2, join as join22, resolve as resolve6, sep as sep2 } from "node:path";
144166
143953
  import { promisify } from "node:util";
144167
143954
  init_src();
143955
+ import { rgPath } from "@vscode/ripgrep";
144168
143956
  init_zod();
144169
143957
 
144170
143958
  // src/lib/browser-history-store.ts
@@ -144264,7 +144052,7 @@ function clearHistory(workspaceId, range, now = Date.now()) {
144264
144052
 
144265
144053
  // src/lib/chat-session-summary.ts
144266
144054
  init_src();
144267
- var log24 = createLogger("chat-session-summary");
144055
+ var log23 = createLogger("chat-session-summary");
144268
144056
  var REFRESH_KEY = Symbol.for("band.chat-session-summary.refresh");
144269
144057
  var g15 = globalThis;
144270
144058
  if (!g15[REFRESH_KEY]) g15[REFRESH_KEY] = /* @__PURE__ */ new Map();
@@ -144294,7 +144082,7 @@ async function ensureActiveSessionSummary(chatId, worktreePath) {
144294
144082
  });
144295
144083
  return getChat(chatId);
144296
144084
  } catch (err) {
144297
- log24.warn({ chatId, err }, "ensureActiveSessionSummary failed");
144085
+ log23.warn({ chatId, err }, "ensureActiveSessionSummary failed");
144298
144086
  return chat;
144299
144087
  }
144300
144088
  }
@@ -144331,7 +144119,7 @@ async function doRefresh(chatId, worktreePath) {
144331
144119
  lastModified: latest.lastModified
144332
144120
  });
144333
144121
  } catch (err) {
144334
- log24.warn({ chatId, err }, "active session refresh failed");
144122
+ log23.warn({ chatId, err }, "active session refresh failed");
144335
144123
  }
144336
144124
  }
144337
144125
 
@@ -144741,7 +144529,7 @@ function fuzzyScore(query, filePath) {
144741
144529
  // src/lib/terminal-config.ts
144742
144530
  init_src();
144743
144531
  init_zod();
144744
- var log25 = createLogger("terminal-config");
144532
+ var log24 = createLogger("terminal-config");
144745
144533
  var TerminalPaneConfigSchema = external_exports2.object({
144746
144534
  name: external_exports2.string().optional(),
144747
144535
  command: external_exports2.string().optional(),
@@ -144772,7 +144560,7 @@ function loadWorkspaceTerminalConfig(worktreePath, projectPath) {
144772
144560
  if (!terminalBlock) return null;
144773
144561
  const result = WorkspaceTerminalConfigSchema.safeParse(terminalBlock);
144774
144562
  if (!result.success) {
144775
- log25.warn(
144563
+ log24.warn(
144776
144564
  "Invalid workspace.terminal config: %s",
144777
144565
  result.error.issues.map((i2) => `${i2.path.join(".")}: ${i2.message}`).join("; ")
144778
144566
  );
@@ -144783,7 +144571,7 @@ function loadWorkspaceTerminalConfig(worktreePath, projectPath) {
144783
144571
 
144784
144572
  // src/trpc/router.ts
144785
144573
  var execFileAsync = promisify(execFile5);
144786
- var log26 = createLogger("trpc");
144574
+ var log25 = createLogger("trpc");
144787
144575
  var t2 = initTRPC.context().create();
144788
144576
  var publicProcedure = t2.procedure;
144789
144577
  var projectsRouter = t2.router({
@@ -144828,7 +144616,7 @@ var projectsRouter = t2.router({
144828
144616
  }),
144829
144617
  checkPath: publicProcedure.input(external_exports2.object({ path: external_exports2.string() })).query(({ input }) => {
144830
144618
  const resolvedPath = resolve6(input.path);
144831
- const isGitRepo = existsSync7(join23(resolvedPath, ".git"));
144619
+ const isGitRepo = existsSync7(join22(resolvedPath, ".git"));
144832
144620
  return { isGitRepo };
144833
144621
  }),
144834
144622
  gitInit: publicProcedure.input(external_exports2.object({ path: external_exports2.string() })).mutation(async ({ input }) => {
@@ -144937,8 +144725,8 @@ var workspacesRouter = t2.router({
144937
144725
  return { ok: true, path: existing.path };
144938
144726
  }
144939
144727
  const wtDir = worktreesDir();
144940
- const worktreePath = join23(wtDir, input.project, input.branch);
144941
- mkdirSync7(join23(wtDir, input.project), { recursive: true });
144728
+ const worktreePath = join22(wtDir, input.project, input.branch);
144729
+ mkdirSync7(join22(wtDir, input.project), { recursive: true });
144942
144730
  const { command, env } = gitCmd();
144943
144731
  const args = ["worktree", "add"];
144944
144732
  if (input.base) {
@@ -145002,7 +144790,7 @@ var workspacesRouter = t2.router({
145002
144790
  saveState(state2);
145003
144791
  const workspaceId = toWorkspaceId(input.project, input.branch);
145004
144792
  try {
145005
- unlinkSync3(join23(bandHome(), "workspace-prompts", `${workspaceId}.json`));
144793
+ unlinkSync3(join22(bandHome(), "workspace-prompts", `${workspaceId}.json`));
145006
144794
  } catch {
145007
144795
  }
145008
144796
  deleteWorkspaceStatus(workspaceId);
@@ -145019,13 +144807,13 @@ var workspacesRouter = t2.router({
145019
144807
  try {
145020
144808
  const deletedTasks = deleteWorkspaceTasks(workspaceId);
145021
144809
  if (deletedTasks > 0) {
145022
- log26.info(
144810
+ log25.info(
145023
144811
  { workspaceId, count: deletedTasks },
145024
144812
  "deleted workspace tasks on removal"
145025
144813
  );
145026
144814
  }
145027
144815
  } catch (err) {
145028
- log26.error({ workspaceId, err }, "failed to delete workspace tasks on removal");
144816
+ log25.error({ workspaceId, err }, "failed to delete workspace tasks on removal");
145029
144817
  }
145030
144818
  emit({ kind: "remove", workspaceId });
145031
144819
  const projPath = proj.path;
@@ -145043,7 +144831,7 @@ var workspacesRouter = t2.router({
145043
144831
  timeout: 6e4
145044
144832
  });
145045
144833
  } catch (err) {
145046
- log26.warn({ err, workspaceId }, "teardown script failed");
144834
+ log25.warn({ err, workspaceId }, "teardown script failed");
145047
144835
  }
145048
144836
  }
145049
144837
  try {
@@ -145061,7 +144849,7 @@ var workspacesRouter = t2.router({
145061
144849
  encoding: "utf-8"
145062
144850
  });
145063
144851
  } catch (err) {
145064
- log26.warn({ err, workspaceId }, "git worktree prune failed");
144852
+ log25.warn({ err, workspaceId }, "git worktree prune failed");
145065
144853
  }
145066
144854
  }
145067
144855
  try {
@@ -145073,7 +144861,7 @@ var workspacesRouter = t2.router({
145073
144861
  } catch {
145074
144862
  }
145075
144863
  })().catch((err) => {
145076
- log26.error({ err, workspaceId }, "background workspace cleanup failed");
144864
+ log25.error({ err, workspaceId }, "background workspace cleanup failed");
145077
144865
  });
145078
144866
  });
145079
144867
  return { ok: true };
@@ -145131,7 +144919,7 @@ var workspacesRouter = t2.router({
145131
144919
  return { ok: true };
145132
144920
  }),
145133
144921
  runScript: publicProcedure.input(external_exports2.object({ path: external_exports2.string(), scriptType: external_exports2.string() })).mutation(({ input }) => {
145134
- const scriptPath = join23(input.path, ".band", input.scriptType);
144922
+ const scriptPath = join22(input.path, ".band", input.scriptType);
145135
144923
  if (!existsSync7(scriptPath)) {
145136
144924
  throw new Error(`Script "${input.scriptType}" not found`);
145137
144925
  }
@@ -145269,7 +145057,7 @@ function parseFileStatuses(nameStatusOutput) {
145269
145057
  }
145270
145058
  async function readUntrackedFileLines(cwd, file2) {
145271
145059
  try {
145272
- const content2 = await readFile2(join23(cwd, file2), "utf-8");
145060
+ const content2 = await readFile2(join22(cwd, file2), "utf-8");
145273
145061
  const lines = content2.split("\n");
145274
145062
  if (lines.length > 0 && lines[lines.length - 1] === "") {
145275
145063
  lines.pop();
@@ -145358,7 +145146,7 @@ var workspaceRouter = t2.router({
145358
145146
  );
145359
145147
  branches = output.trim().split("\n").map((b10) => b10.trim()).filter(Boolean);
145360
145148
  } catch (err) {
145361
- log26.error(
145149
+ log25.error(
145362
145150
  `listBranches: for-each-ref failed for ${cwd}: ${err instanceof Error ? err.message : err}`
145363
145151
  );
145364
145152
  }
@@ -145495,7 +145283,7 @@ var workspaceRouter = t2.router({
145495
145283
  const untrackedFiles = untrackedOutput.trim().split("\n").filter(Boolean);
145496
145284
  if (untrackedFiles.includes(input.filePath)) {
145497
145285
  try {
145498
- const content2 = await readFile2(join23(cwd, input.filePath), "utf-8");
145286
+ const content2 = await readFile2(join22(cwd, input.filePath), "utf-8");
145499
145287
  const lines = content2.split("\n");
145500
145288
  if (lines.length > 0 && lines[lines.length - 1] === "") {
145501
145289
  lines.pop();
@@ -145540,7 +145328,7 @@ var workspaceRouter = t2.router({
145540
145328
  const untrackedOutput = await execGit(["ls-files", "--others", "--exclude-standard"], cwd);
145541
145329
  const untrackedFiles = untrackedOutput.trim().split("\n").filter(Boolean);
145542
145330
  if (untrackedFiles.includes(filePath)) {
145543
- await rm(join23(cwd, filePath), { force: true });
145331
+ await rm(join22(cwd, filePath), { force: true });
145544
145332
  return { ok: true };
145545
145333
  }
145546
145334
  const { mergeBase: ref } = await resolveDiffContext(
@@ -145703,7 +145491,7 @@ var workspaceRouter = t2.router({
145703
145491
  throw new Error("Workspace not found");
145704
145492
  }
145705
145493
  const root = workspace.worktree.path;
145706
- const target = resolve6(join23(root, input.path));
145494
+ const target = resolve6(join22(root, input.path));
145707
145495
  if (!target.startsWith(root)) {
145708
145496
  throw new Error("Invalid path");
145709
145497
  }
@@ -145726,7 +145514,7 @@ var workspaceRouter = t2.router({
145726
145514
  throw new Error("Path is required");
145727
145515
  }
145728
145516
  const root = workspace.worktree.path;
145729
- const target = resolve6(join23(root, input.path));
145517
+ const target = resolve6(join22(root, input.path));
145730
145518
  if (!target.startsWith(root)) {
145731
145519
  throw new Error("Invalid path");
145732
145520
  }
@@ -145760,7 +145548,7 @@ var workspaceRouter = t2.router({
145760
145548
  throw new Error("Workspace not found");
145761
145549
  }
145762
145550
  const root = workspace.worktree.path;
145763
- const target = resolve6(join23(root, input.path));
145551
+ const target = resolve6(join22(root, input.path));
145764
145552
  if (!target.startsWith(root)) {
145765
145553
  throw new Error("Invalid path");
145766
145554
  }
@@ -145783,7 +145571,7 @@ var workspaceRouter = t2.router({
145783
145571
  throw new Error("Workspace not found");
145784
145572
  }
145785
145573
  const root = workspace.worktree.path;
145786
- const target = resolve6(join23(root, input.path));
145574
+ const target = resolve6(join22(root, input.path));
145787
145575
  if (!target.startsWith(root) || target === root) {
145788
145576
  throw new Error("Invalid path");
145789
145577
  }
@@ -145812,7 +145600,7 @@ var workspaceRouter = t2.router({
145812
145600
  throw new Error("Workspace not found");
145813
145601
  }
145814
145602
  const root = workspace.worktree.path;
145815
- const target = resolve6(join23(root, input.path));
145603
+ const target = resolve6(join22(root, input.path));
145816
145604
  if (!target.startsWith(root) || target === root) {
145817
145605
  throw new Error("Invalid path");
145818
145606
  }
@@ -145841,7 +145629,7 @@ var workspaceRouter = t2.router({
145841
145629
  throw new Error("Workspace not found");
145842
145630
  }
145843
145631
  const root = workspace.worktree.path;
145844
- const target = resolve6(join23(root, input.path));
145632
+ const target = resolve6(join22(root, input.path));
145845
145633
  if (!target.startsWith(root) || target === root) {
145846
145634
  throw new Error("Invalid path");
145847
145635
  }
@@ -145873,8 +145661,8 @@ var workspaceRouter = t2.router({
145873
145661
  throw new Error("Workspace not found");
145874
145662
  }
145875
145663
  const root = workspace.worktree.path;
145876
- const fromTarget = resolve6(join23(root, input.fromPath));
145877
- const toTarget = resolve6(join23(root, input.toPath));
145664
+ const fromTarget = resolve6(join22(root, input.fromPath));
145665
+ const toTarget = resolve6(join22(root, input.toPath));
145878
145666
  if (!fromTarget.startsWith(root) || fromTarget === root) {
145879
145667
  throw new Error("Invalid source path");
145880
145668
  }
@@ -145924,8 +145712,8 @@ var workspaceRouter = t2.router({
145924
145712
  throw new Error("Workspace not found");
145925
145713
  }
145926
145714
  const root = workspace.worktree.path;
145927
- const fromTarget = resolve6(join23(root, input.fromPath));
145928
- const toTarget = resolve6(join23(root, input.toPath));
145715
+ const fromTarget = resolve6(join22(root, input.fromPath));
145716
+ const toTarget = resolve6(join22(root, input.toPath));
145929
145717
  if (!fromTarget.startsWith(root) || fromTarget === root) {
145930
145718
  throw new Error("Invalid source path");
145931
145719
  }
@@ -146012,35 +145800,81 @@ var workspaceRouter = t2.router({
146012
145800
  throw new Error("Workspace not found");
146013
145801
  }
146014
145802
  const cwd = workspace.worktree.path;
146015
- const args = ["grep", "-n", "--no-color", "-I"];
146016
- if (input.regex) {
146017
- args.push("-E");
146018
- } else {
146019
- args.push("-F");
146020
- }
146021
- if (!input.caseSensitive) args.push("-i");
146022
- if (input.wholeWord) args.push("-w");
146023
- args.push("--", input.query);
146024
- let output;
146025
- try {
146026
- output = await execGit(args, cwd);
146027
- } catch {
146028
- return { results: [] };
146029
- }
146030
- const lines = output.trim().split("\n").filter(Boolean);
146031
- const results = [];
146032
- for (const raw of lines) {
146033
- if (results.length >= input.limit) break;
146034
- const colonIdx1 = raw.indexOf(":");
146035
- if (colonIdx1 === -1) continue;
146036
- const colonIdx2 = raw.indexOf(":", colonIdx1 + 1);
146037
- if (colonIdx2 === -1) continue;
146038
- const file2 = raw.slice(0, colonIdx1);
146039
- const line2 = Number.parseInt(raw.slice(colonIdx1 + 1, colonIdx2), 10);
146040
- const content2 = raw.slice(colonIdx2 + 1);
146041
- results.push({ file: file2, line: line2, content: content2 });
146042
- }
146043
- return { results };
145803
+ const args = [];
145804
+ if (!input.caseSensitive) args.push("--ignore-case");
145805
+ if (input.wholeWord) args.push("--word-regexp");
145806
+ if (!input.regex) args.push("--fixed-strings");
145807
+ args.push("--json");
145808
+ args.push("--", input.query, "./");
145809
+ return await new Promise((resolvePromise, rejectPromise) => {
145810
+ const results = [];
145811
+ const child = spawn8(rgPath, args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
145812
+ let stdoutBuf = "";
145813
+ let stderrBuf = "";
145814
+ let settled = false;
145815
+ let killed = false;
145816
+ const finish = (value) => {
145817
+ if (settled) return;
145818
+ settled = true;
145819
+ resolvePromise({ results: value });
145820
+ };
145821
+ const fail = (err) => {
145822
+ if (settled) return;
145823
+ settled = true;
145824
+ rejectPromise(err);
145825
+ };
145826
+ child.stdout.setEncoding("utf-8");
145827
+ child.stdout.on("data", (chunk) => {
145828
+ if (settled) return;
145829
+ stdoutBuf += chunk;
145830
+ while (true) {
145831
+ const nlIdx = stdoutBuf.indexOf("\n");
145832
+ if (nlIdx === -1) break;
145833
+ const line2 = stdoutBuf.slice(0, nlIdx);
145834
+ stdoutBuf = stdoutBuf.slice(nlIdx + 1);
145835
+ if (!line2) continue;
145836
+ let event;
145837
+ try {
145838
+ event = JSON.parse(line2);
145839
+ } catch {
145840
+ continue;
145841
+ }
145842
+ if (event.type !== "match") continue;
145843
+ const data = event.data;
145844
+ if (!data) continue;
145845
+ const rawFile = data.path?.text;
145846
+ const lineNumber = data.line_number;
145847
+ const rawContent = data.lines?.text;
145848
+ if (!rawFile || typeof lineNumber !== "number" || rawContent === void 0) {
145849
+ continue;
145850
+ }
145851
+ const file2 = rawFile.startsWith("./") ? rawFile.slice(2) : rawFile;
145852
+ const content2 = rawContent.endsWith("\n") ? rawContent.slice(0, -1) : rawContent;
145853
+ results.push({ file: file2, line: lineNumber, content: content2 });
145854
+ if (results.length >= input.limit) {
145855
+ killed = true;
145856
+ child.kill("SIGTERM");
145857
+ finish(results);
145858
+ return;
145859
+ }
145860
+ }
145861
+ });
145862
+ child.stderr.setEncoding("utf-8");
145863
+ child.stderr.on("data", (chunk) => {
145864
+ stderrBuf += chunk;
145865
+ });
145866
+ child.on("error", (err) => {
145867
+ fail(err);
145868
+ });
145869
+ child.on("close", (code) => {
145870
+ if (settled) return;
145871
+ if (code === 0 || code === 1 || killed) {
145872
+ finish(results);
145873
+ } else {
145874
+ fail(new Error(`ripgrep exited with code ${code}: ${stderrBuf.trim()}`));
145875
+ }
145876
+ });
145877
+ });
146044
145878
  }),
146045
145879
  switchAgent: publicProcedure.input(
146046
145880
  external_exports2.object({
@@ -146071,21 +145905,21 @@ var tunnelRouter = t2.router({
146071
145905
  return getTunnelStatus();
146072
145906
  }),
146073
145907
  start: publicProcedure.input(external_exports2.object({}).optional()).mutation(async () => {
146074
- log26.debug("tunnel.start called");
145908
+ log25.debug("tunnel.start called");
146075
145909
  const port2 = parseInt(process.env.BAND_PORT || "3456", 10);
146076
- log26.debug("tunnel.start: port=%d", port2);
145910
+ log25.debug("tunnel.start: port=%d", port2);
146077
145911
  try {
146078
145912
  await startTunnel({ port: port2 });
146079
145913
  } catch (err) {
146080
- log26.debug({ err }, "tunnel.start: startTunnel failed");
145914
+ log25.debug({ err }, "tunnel.start: startTunnel failed");
146081
145915
  return { ok: true, url: null };
146082
145916
  }
146083
145917
  const status = getTunnelStatus();
146084
- log26.debug({ status }, "tunnel.start: after startTunnel");
145918
+ log25.debug({ status }, "tunnel.start: after startTunnel");
146085
145919
  if (status.url) {
146086
145920
  return { ok: true, url: status.url };
146087
145921
  }
146088
- log26.debug("tunnel.start: no URL available");
145922
+ log25.debug("tunnel.start: no URL available");
146089
145923
  return { ok: true, url: null };
146090
145924
  }),
146091
145925
  stop: publicProcedure.mutation(async () => {
@@ -146411,15 +146245,15 @@ async function loadJsonlPage(opts) {
146411
146245
  }
146412
146246
  var servicesRouter = t2.router({
146413
146247
  health: publicProcedure.query(() => {
146414
- log26.debug("services.health called");
146248
+ log25.debug("services.health called");
146415
146249
  const tunnel = getTunnelStatus();
146416
- log26.debug({ tunnel }, "services.health: tunnel status");
146250
+ log25.debug({ tunnel }, "services.health: tunnel status");
146417
146251
  const result = {
146418
146252
  webserver: true,
146419
146253
  tunnel: tunnel.running,
146420
146254
  tunnel_url: tunnel.url
146421
146255
  };
146422
- log26.debug({ result }, "services.health result");
146256
+ log25.debug({ result }, "services.health result");
146423
146257
  return result;
146424
146258
  }),
146425
146259
  // Activity level controls how often the branch-status poller fires.
@@ -146813,7 +146647,7 @@ var chatsRouter = t2.router({
146813
146647
  summary = info?.summary;
146814
146648
  lastModified = info?.lastModified;
146815
146649
  } catch (err) {
146816
- log26.warn(
146650
+ log25.warn(
146817
146651
  { chatId: input.chatId, sessionId: input.sessionId, err },
146818
146652
  "setActiveSession: getSessionInfo failed"
146819
146653
  );
@@ -146933,7 +146767,7 @@ var browserHostRouter = t2.router({
146933
146767
  // can confirm in the server log that the bridge component actually
146934
146768
  // executed. Drop once the experiment is stable.
146935
146769
  ping: publicProcedure.input(external_exports2.object({ where: external_exports2.string() })).mutation(({ input }) => {
146936
- log26.info("browserHost.ping from %s", input.where);
146770
+ log25.info("browserHost.ping from %s", input.where);
146937
146771
  return { ok: true };
146938
146772
  }),
146939
146773
  ensureView: publicProcedure.subscription(async function* (opts) {
@@ -147398,7 +147232,7 @@ function getScalarHtml(specUrl) {
147398
147232
  function logCrash(message) {
147399
147233
  try {
147400
147234
  mkdirSync8(bandHome(), { recursive: true });
147401
- appendFileSync2(join24(bandHome(), "server.log"), message, "utf-8");
147235
+ appendFileSync2(join23(bandHome(), "server.log"), message, "utf-8");
147402
147236
  } catch {
147403
147237
  }
147404
147238
  }
@@ -147423,7 +147257,7 @@ ${error40.stack || error40.message}
147423
147257
  `);
147424
147258
  process.exit(1);
147425
147259
  });
147426
- var clientDir = join24(import.meta.dirname, "client");
147260
+ var clientDir = join23(import.meta.dirname, "client");
147427
147261
  var port = parseInt(process.env.PORT || "3456", 10);
147428
147262
  delete process.env.PORT;
147429
147263
  process.env.BAND_PORT = String(port);
@@ -147435,7 +147269,7 @@ var assets = build_default(clientDir, {
147435
147269
  gzip: true,
147436
147270
  etag: true
147437
147271
  });
147438
- var openApiDoc = JSON.parse(readFileSync9(join24(import.meta.dirname, "openapi.json"), "utf-8"));
147272
+ var openApiDoc = JSON.parse(readFileSync9(join23(import.meta.dirname, "openapi.json"), "utf-8"));
147439
147273
  openApiDoc.servers = [{ url: "/trpc" }];
147440
147274
  var openApiSpec = JSON.stringify(openApiDoc, null, 2);
147441
147275
  var scalarHtml = getScalarHtml("/api/openapi.json");
@@ -147446,7 +147280,7 @@ function serveStaticFile(res, root, subdir, rawFilename) {
147446
147280
  res.end("Bad request");
147447
147281
  return;
147448
147282
  }
147449
- const filePath = join24(root, subdir, filename);
147283
+ const filePath = join23(root, subdir, filename);
147450
147284
  try {
147451
147285
  const fileStat = statSync7(filePath);
147452
147286
  const contentType = mimeTypeFromFilename(filename);
@@ -147469,7 +147303,7 @@ function serveWorkspaceFile(res, workspaceId, rawPath) {
147469
147303
  return;
147470
147304
  }
147471
147305
  const root = workspace.worktree.path;
147472
- const target = resolve7(join24(root, rawPath));
147306
+ const target = resolve7(join23(root, rawPath));
147473
147307
  if (!target.startsWith(`${root}/`) && target !== root) {
147474
147308
  res.writeHead(400);
147475
147309
  res.end("Bad request");
@@ -147522,7 +147356,7 @@ async function main() {
147522
147356
  res.end("Bad request");
147523
147357
  return;
147524
147358
  }
147525
- serveStaticFile(res, bandHome(), join24("shared", partition), rest.slice(slashIdx + 1));
147359
+ serveStaticFile(res, bandHome(), join23("shared", partition), rest.slice(slashIdx + 1));
147526
147360
  return;
147527
147361
  }
147528
147362
  if (req.url?.startsWith("/api/workspace-file/")) {