@qwen-code/qwen-code 0.20.0-nightly.20260722.b98306b7e → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +1 -1
  2. package/bundled/qc-helper/docs/features/auto-mode.md +16 -19
  3. package/bundled/qc-helper/docs/features/commands.md +0 -54
  4. package/bundled/qc-helper/docs/features/sub-agents.md +7 -16
  5. package/bundled/qc-helper/docs/integration-github-action.md +10 -10
  6. package/bundled/qc-helper/docs/qwen-serve.md +1 -2
  7. package/bundled/review/DESIGN.md +2 -2
  8. package/bundled/review/SKILL.md +4 -4
  9. package/chunks/{MaxSizedBox-YO432SD4.js → MaxSizedBox-B5YGZSYE.js} +34 -41
  10. package/chunks/{StandaloneSessionPicker-525JBPXC.js → StandaloneSessionPicker-CEGO2AZX.js} +50 -57
  11. package/chunks/{acpAgent-FORCZCBG.js → acpAgent-YUR43TLG.js} +496 -1487
  12. package/chunks/{agent-OZCWHX2J.js → agent-H4JIDL7S.js} +30 -37
  13. package/chunks/agent-headless-TTBEREQV.js +61 -0
  14. package/chunks/{anthropicContentGenerator-NMSS7IMV.js → anthropicContentGenerator-HVKLXOOU.js} +12 -13
  15. package/chunks/{artifact-tool-56T5IMBP.js → artifact-tool-WBCAMD3O.js} +3 -3
  16. package/chunks/{askUserQuestion-E25OBIC2.js → askUserQuestion-6DZC4UV5.js} +3 -3
  17. package/chunks/{bridge-HUUBAUDS.js → bridge-VL7ITBU5.js} +35 -42
  18. package/chunks/{build-GHIZ4MSZ.js → build-SSCNEHZZ.js} +1 -1
  19. package/chunks/{ca-N6VVUFVB.js → ca-2SL2BXTK.js} +201 -611
  20. package/chunks/{channel-worker-group-LFBT7K64.js → channel-worker-group-53CMOPFT.js} +5 -5
  21. package/chunks/{channel-worker-manager-3RUPERG2.js → channel-worker-manager-UTXILKC2.js} +5 -5
  22. package/chunks/{channel-worker-supervisor-A3KVATD3.js → channel-worker-supervisor-ZGO2W2MD.js} +4 -4
  23. package/chunks/{chunk-2LI23QA6.js → chunk-2HOVDT7W.js} +1 -1
  24. package/chunks/{chunk-QSZOJHCQ.js → chunk-2LL7TXB4.js} +2 -2
  25. package/chunks/{chunk-EGMNITTR.js → chunk-333CXMNJ.js} +5 -5
  26. package/chunks/{chunk-DGKZ6QL3.js → chunk-33XUAINQ.js} +21 -61
  27. package/chunks/{chunk-DKT6SIJC.js → chunk-4EP2PYYL.js} +5 -5
  28. package/chunks/{chunk-QW3QUYG5.js → chunk-4ILMYHEI.js} +3 -3
  29. package/chunks/{chunk-B5KE3KNO.js → chunk-4N3KMAIL.js} +32 -128
  30. package/chunks/{chunk-6ZBPS62S.js → chunk-4ODB7WIB.js} +1 -1
  31. package/chunks/{chunk-5XPUJM4N.js → chunk-4XNLIGVA.js} +298 -576
  32. package/chunks/{chunk-67SZUDUH.js → chunk-542SK7KV.js} +1608 -243
  33. package/chunks/{chunk-RZZNAWTE.js → chunk-5JBR5XIK.js} +2 -2
  34. package/chunks/{chunk-E4IMU4Y5.js → chunk-5SCI6E3E.js} +1 -1
  35. package/chunks/{chunk-ZKY7USAE.js → chunk-6AFUCL3D.js} +1 -1
  36. package/chunks/{chunk-5I5BM454.js → chunk-6EFTQYW7.js} +1 -1
  37. package/chunks/{chunk-BXCXDT2T.js → chunk-7PZ2ATFZ.js} +29 -54
  38. package/chunks/{chunk-FJZPCXZM.js → chunk-7RMOXZTC.js} +4 -4
  39. package/chunks/{chunk-XPWXDCW5.js → chunk-7SXZC7ID.js} +6 -7
  40. package/chunks/{chunk-O2WEV2LS.js → chunk-A5LYNIW7.js} +8 -8
  41. package/chunks/{chunk-SEHBVG2S.js → chunk-AJSJ5TTU.js} +1 -1
  42. package/chunks/{chunk-422RQSNN.js → chunk-AKX4WPPP.js} +86 -307
  43. package/chunks/{chunk-QVQCCBMW.js → chunk-ANPINBOF.js} +5 -5
  44. package/chunks/{chunk-JJEFX6U5.js → chunk-AQIEINAY.js} +1766 -28
  45. package/chunks/{chunk-7Z6JQEL6.js → chunk-AYCDXHZB.js} +1 -1
  46. package/chunks/{chunk-BKZEHVPV.js → chunk-B3KGZCQN.js} +169 -177
  47. package/chunks/{chunk-6X4GWOPW.js → chunk-BDBMYST4.js} +1 -1
  48. package/chunks/{chunk-25WFJZL5.js → chunk-BMWMT5Y2.js} +373 -3
  49. package/chunks/{chunk-EDANOBFR.js → chunk-BRRF37CO.js} +6 -6
  50. package/chunks/{chunk-QLJUC7TG.js → chunk-BVLROR2T.js} +1 -1
  51. package/chunks/{chunk-OQB4EXO4.js → chunk-C27BYUX6.js} +11 -14
  52. package/chunks/{chunk-GDBCCE2J.js → chunk-CB2HFGRV.js} +6 -31
  53. package/chunks/chunk-CPCVCKKF.js +358 -0
  54. package/chunks/{chunk-K6YXJ3J5.js → chunk-CV63PP6U.js} +1 -1
  55. package/chunks/{chunk-BWGIRN4Z.js → chunk-CZF3E5GF.js} +1 -1
  56. package/chunks/{chunk-6NAAGP57.js → chunk-D22SX43D.js} +1 -1
  57. package/chunks/{chunk-X6N25LXS.js → chunk-D2VIDMVM.js} +2 -2
  58. package/chunks/{chunk-E7O22QBU.js → chunk-DBE4QFZS.js} +23 -27
  59. package/chunks/{chunk-4ZAHUGSC.js → chunk-DP5GXXNZ.js} +1 -5
  60. package/chunks/{chunk-Q2YKNMLS.js → chunk-EAUYY7SS.js} +3 -3
  61. package/chunks/{chunk-KHOVYUHX.js → chunk-EIAK6Q2B.js} +2 -2
  62. package/chunks/{chunk-NPQDJGKU.js → chunk-EZVDJFZ7.js} +1 -1
  63. package/chunks/{chunk-FODK6UMO.js → chunk-FEOZBUMT.js} +27 -0
  64. package/chunks/{chunk-6NHK6HS7.js → chunk-FLSVD6BS.js} +3 -3
  65. package/chunks/{chunk-LLJNFFFT.js → chunk-FQD7GFSV.js} +3 -3
  66. package/chunks/{chunk-T2L47JJK.js → chunk-FSL5W5TI.js} +3 -3
  67. package/chunks/{chunk-JCW2R7WC.js → chunk-G45X5TRN.js} +72 -1
  68. package/chunks/{chunk-ZHERRXZJ.js → chunk-GKY2OJ7R.js} +1 -1
  69. package/chunks/{chunk-6IL7KRLE.js → chunk-GMGDLUC7.js} +1 -1
  70. package/chunks/{chunk-N2HDLRGT.js → chunk-HZPN55E5.js} +1 -1
  71. package/chunks/{chunk-NTC7J4X7.js → chunk-I2PYAYFM.js} +3 -3
  72. package/chunks/{chunk-RVWSD6GI.js → chunk-IR46U7RB.js} +3 -3
  73. package/chunks/{chunk-W6E7KTQL.js → chunk-IVPSS6EL.js} +4 -4
  74. package/chunks/{chunk-4K56OJFJ.js → chunk-JD3MKVKL.js} +1 -1
  75. package/chunks/{chunk-SP5WRGVG.js → chunk-JNWZQ27S.js} +3 -3
  76. package/chunks/{chunk-VAUDHMX6.js → chunk-KDC6GNQR.js} +4 -4
  77. package/chunks/{chunk-5TSCAYXT.js → chunk-KG3XV6FH.js} +2 -29
  78. package/chunks/{chunk-HCQ2Q3KF.js → chunk-KOR3XKCA.js} +4 -10
  79. package/chunks/{chunk-52Y2T4L3.js → chunk-KQNM4EO7.js} +5 -137
  80. package/chunks/{chunk-4K7VDKAD.js → chunk-KTUQMDEP.js} +1 -1
  81. package/chunks/{chunk-Z2FTZM4Z.js → chunk-KX6UK4VJ.js} +19929 -22391
  82. package/chunks/{chunk-JYS55H6Z.js → chunk-MAQQGNQ5.js} +7 -66
  83. package/chunks/{chunk-7FNV372W.js → chunk-MJ6S23WZ.js} +4 -4
  84. package/chunks/{chunk-D7WXIW7H.js → chunk-NBMIC7DR.js} +4 -4
  85. package/chunks/{chunk-HGGEN2SC.js → chunk-NDMQLV4Y.js} +4 -4
  86. package/chunks/{chunk-FFFM6NJV.js → chunk-NEEB7UEN.js} +2 -1
  87. package/chunks/{chunk-WKGGZF7Z.js → chunk-NGFEPAE6.js} +6 -8
  88. package/chunks/{chunk-RVLZCXEE.js → chunk-NIJEXGV6.js} +10 -79
  89. package/chunks/{chunk-LMY4HCMA.js → chunk-O3OCNYY5.js} +2 -2
  90. package/chunks/{chunk-RIEABAJC.js → chunk-O3Z73NBP.js} +7 -7
  91. package/chunks/{chunk-VBZBVAQ3.js → chunk-OEO2ERWK.js} +33 -54
  92. package/chunks/{chunk-KQQ757OQ.js → chunk-OLMETXLX.js} +2 -2
  93. package/chunks/{chunk-LIZRAKPB.js → chunk-OOCI5VVU.js} +1 -1
  94. package/chunks/{chunk-GPSKDNEE.js → chunk-OONJNQ42.js} +3 -3
  95. package/chunks/{chunk-YM3SZTH4.js → chunk-OP4MOGXF.js} +1 -8
  96. package/chunks/{chunk-FCPNARPD.js → chunk-OWCALFEG.js} +1 -1
  97. package/chunks/{chunk-MPZ34JE7.js → chunk-OYZWQNWG.js} +2 -2
  98. package/chunks/{chunk-QBUDF33N.js → chunk-PBATSWUQ.js} +1 -1
  99. package/chunks/{chunk-6MNDXSG6.js → chunk-PBWEWI4N.js} +69 -76
  100. package/chunks/{chunk-OCCDRJIS.js → chunk-PF4CHQOJ.js} +6 -6
  101. package/chunks/{chunk-BH32VITB.js → chunk-PGEPSDJI.js} +8 -13
  102. package/chunks/{chunk-4LVZNIDO.js → chunk-QKYTTBYW.js} +1 -1
  103. package/chunks/{chunk-VYPFXUCB.js → chunk-R3VWUU2E.js} +1 -1
  104. package/chunks/{chunk-RV4C2ZFG.js → chunk-RFIAR4YL.js} +1 -1
  105. package/chunks/{chunk-P4B4SXDS.js → chunk-S2PD3EZD.js} +1 -1
  106. package/chunks/{chunk-H6T65C7O.js → chunk-S2W2LVDU.js} +3 -3
  107. package/chunks/{chunk-VJ4P64ID.js → chunk-S2XVRHDN.js} +1 -1
  108. package/chunks/chunk-SEKHYHMS.js +45 -0
  109. package/chunks/{chunk-JNEA3NW7.js → chunk-SJMV7ZBK.js} +8 -8
  110. package/chunks/{chunk-THJNPLI4.js → chunk-TB6UDU4T.js} +16 -16
  111. package/chunks/{chunk-R3D7SK6L.js → chunk-TIH2ZTOC.js} +2 -2
  112. package/chunks/{chunk-3FML67YK.js → chunk-TKLLK6XQ.js} +11 -11
  113. package/chunks/{chunk-SMVDDPEJ.js → chunk-TMQ6XQCX.js} +53 -170
  114. package/chunks/{chunk-QNLNLENL.js → chunk-UEY4AYUL.js} +2 -2
  115. package/chunks/{chunk-BLTELXOK.js → chunk-VDWBQ5AW.js} +1 -1
  116. package/chunks/{chunk-WGBLCAVW.js → chunk-VEXFOTEO.js} +3 -3
  117. package/chunks/{chunk-4RAFVWW2.js → chunk-VZQUV7VK.js} +1 -1
  118. package/chunks/chunk-W7FJ3N32.js +49 -0
  119. package/chunks/{chunk-UGYMA4EI.js → chunk-W7H223ZZ.js} +1 -1
  120. package/chunks/{chunk-UH3WSE5L.js → chunk-X6YQWCIJ.js} +1 -13
  121. package/chunks/{chunk-H4AR2JQF.js → chunk-XVVH63JG.js} +3 -3
  122. package/chunks/{chunk-QKTHJXCS.js → chunk-Y2ENGUD6.js} +1 -1
  123. package/chunks/{chunk-QD6BRERJ.js → chunk-YWEW33JY.js} +7 -7
  124. package/chunks/{chunk-57FIIFJN.js → chunk-ZEOZL37W.js} +1 -1
  125. package/chunks/chunk-ZFKNWQGQ.js +74639 -0
  126. package/chunks/{computer-use-XPLRRVJM.js → computer-use-NIWQNUZF.js} +35 -42
  127. package/chunks/{config-utils-WYUQ7II4.js → config-utils-AHQ6YZ66.js} +3 -3
  128. package/chunks/contextCommand-L2COEUHS.js +66 -0
  129. package/chunks/{create-sub-session-5YJR5PAM.js → create-sub-session-MGNX52P3.js} +30 -37
  130. package/chunks/{create-sub-session-AZ77LBL3.js → create-sub-session-P26FE5GG.js} +3 -3
  131. package/chunks/{cron-create-KTWJM7QT.js → cron-create-JWFHBDRQ.js} +5 -5
  132. package/chunks/{cron-delete-2P3I5ULL.js → cron-delete-GDX4E26G.js} +5 -5
  133. package/chunks/{cron-list-PXDPGEDQ.js → cron-list-USMAIWPT.js} +5 -5
  134. package/chunks/{daemon-KLPTQIE4.js → daemon-RG2MAI6T.js} +81 -138
  135. package/chunks/daemon-status-provider-NL4IAG7B.js +74 -0
  136. package/chunks/{de-4IBXM7CN.js → de-I7ZIYXZC.js} +1 -5
  137. package/chunks/{dist-HMU6CYS4.js → dist-2BHAYBKP.js} +2 -2
  138. package/chunks/{dist-PJLG2XYX.js → dist-2MIU4UUH.js} +1 -1
  139. package/chunks/{dist-UIFWIFRO.js → dist-53PZYC5B.js} +2 -2
  140. package/chunks/{dist-OAV7LJGJ.js → dist-AU7NQQRP.js} +1 -1
  141. package/chunks/{dist-OMW6WDEO.js → dist-FUTEXY6A.js} +1 -1
  142. package/chunks/{dist-XRYV6TJP.js → dist-WGTQO7F2.js} +25 -65
  143. package/chunks/{earlyInputCapture-XMECIN6Y.js → earlyInputCapture-L6I2A22T.js} +31 -38
  144. package/chunks/{edit-MMPLBVZU.js → edit-3QV3JZJL.js} +37 -42
  145. package/chunks/{en-USMCCJAJ.js → en-XE34GKAA.js} +1 -5
  146. package/chunks/{enter-worktree-BD7MCCG7.js → enter-worktree-4GMMF7EG.js} +35 -42
  147. package/chunks/{enterPlanMode-BQNJC23R.js → enterPlanMode-L5UWBAUC.js} +36 -48
  148. package/chunks/{environment-F3KL5Z5S.js → environment-3OV7UQOT.js} +32 -39
  149. package/chunks/{errors-VJ544HIS.js → errors-LEOF5QG4.js} +32 -39
  150. package/chunks/{exit-worktree-RDIQXZMI.js → exit-worktree-DDP57JLV.js} +35 -42
  151. package/chunks/{exitPlanMode-UNCZQPTX.js → exitPlanMode-CJBLGPIP.js} +35 -42
  152. package/chunks/{fast-path-H7N32H7D.js → fast-path-M6RP2ING.js} +3 -4
  153. package/chunks/{fast-path-settings-XB3CPUJT.js → fast-path-settings-DAOVFADC.js} +2 -2
  154. package/chunks/{fr-WVHEBDDB.js → fr-X7KDVZIY.js} +1 -5
  155. package/chunks/{gemini-G4VKT5DQ.js → gemini-H4PHBJTL.js} +89 -97
  156. package/chunks/{geminiContentGenerator-MDAL2B4C.js → geminiContentGenerator-VURJYPWP.js} +5 -5
  157. package/chunks/{getMachineId-bsd-QFVLPUPT.js → getMachineId-bsd-EXV7SWPA.js} +1 -1
  158. package/chunks/{getMachineId-darwin-DGMQQE2E.js → getMachineId-darwin-IUOMFXU3.js} +1 -1
  159. package/chunks/{getMachineId-linux-R4Z6CSWC.js → getMachineId-linux-K7XJYFHL.js} +1 -1
  160. package/chunks/{getMachineId-unsupported-Z3SBVBUV.js → getMachineId-unsupported-EA5FDRJ6.js} +1 -1
  161. package/chunks/{getMachineId-win-SCK5UFDT.js → getMachineId-win-KBA6RAI5.js} +1 -1
  162. package/chunks/{glob-JBT6FGZL.js → glob-2KUSRAVQ.js} +35 -42
  163. package/chunks/{grep-5NUIQ63X.js → grep-B5RXVESV.js} +35 -42
  164. package/chunks/handleAutoUpdate-QQVIWXKT.js +67 -0
  165. package/chunks/{i18n-IPHO7BGL.js → i18n-N6OBDORT.js} +31 -38
  166. package/chunks/initializer-6WCFNDLL.js +72 -0
  167. package/chunks/installationInfo-6J3WPXNS.js +64 -0
  168. package/chunks/{ja-KY4ROZTE.js → ja-2ICT3KXF.js} +1 -5
  169. package/chunks/{keychain-token-storage-6ACJDYIB.js → keychain-token-storage-DWRJMNH3.js} +3 -3
  170. package/chunks/list-HOWQSWP6.js +75 -0
  171. package/chunks/loadedSettingsAdapter-AO4YBRXZ.js +69 -0
  172. package/chunks/{loop-wakeup-RNMRVA66.js → loop-wakeup-5GLTUBHA.js} +6 -6
  173. package/chunks/{ls-J2ZI5XYK.js → ls-FHBY3Y7I.js} +5 -5
  174. package/chunks/{lsp-UMS3NUB5.js → lsp-B6VMEW6Y.js} +3 -3
  175. package/chunks/mcp-QH7QNXOH.js +69 -0
  176. package/chunks/{monitor-SIX5LMEK.js → monitor-GLJZDNPS.js} +35 -42
  177. package/chunks/nonInteractiveCli-TI7EMPXD.js +126 -0
  178. package/chunks/{notebook-edit-CWVOTW3I.js → notebook-edit-AVCIWS4F.js} +38 -43
  179. package/chunks/{openaiContentGenerator-FELHHJAN.js → openaiContentGenerator-B7W24G3D.js} +17 -22
  180. package/chunks/{pidfile-2ZQGHGPJ.js → pidfile-UEHAT6DH.js} +31 -38
  181. package/chunks/{processUtils-M3RKQCI4.js → processUtils-XZPY2PBB.js} +2 -2
  182. package/chunks/{pt-OK455PLH.js → pt-JJ4XPIBP.js} +1 -5
  183. package/chunks/{qwenContentGenerator-RBFIZMBC.js → qwenContentGenerator-6GUTWJIC.js} +35 -44
  184. package/chunks/{qwenOAuth2-S2BUDQM3.js → qwenOAuth2-GASEEWGU.js} +15 -18
  185. package/chunks/{read-file-WQCCV6HY.js → read-file-SQJONF6A.js} +11 -13
  186. package/chunks/{read-mcp-resource-F6HYMDUY.js → read-mcp-resource-AKCL7I43.js} +3 -3
  187. package/chunks/{record-artifact-7GCFLDD7.js → record-artifact-PEUB7727.js} +3 -3
  188. package/chunks/{resumeHistoryUtils-NDYMU2WO.js → resumeHistoryUtils-PFQ2A23X.js} +36 -43
  189. package/chunks/ripGrep-QCK22GDU.js +59 -0
  190. package/chunks/{ru-7SPDGMGD.js → ru-STR4KTW7.js} +1 -5
  191. package/chunks/{run-qwen-serve-FY5MMHPN.js → run-qwen-serve-OZGR3FQA.js} +82 -104
  192. package/chunks/{runtime-LONMMWKO.js → runtime-SNVAP6EH.js} +40 -49
  193. package/chunks/{scheduler-KYNL2MHI.js → scheduler-Z7QLMUWA.js} +30 -37
  194. package/chunks/{send-message-PYIJ2PZL.js → send-message-3RHE7HSM.js} +4 -6
  195. package/chunks/{serve-VNORFL4H.js → serve-BT7KS6SC.js} +36 -43
  196. package/chunks/{server-X2KCJKA3.js → server-SO64U3X5.js} +284 -988
  197. package/chunks/{session-CSYW4ELX.js → session-2KL2WQAH.js} +173 -92
  198. package/chunks/{settings-QZJ4XWS3.js → settings-KITVOUSV.js} +39 -46
  199. package/chunks/{shell-ELMKOZKP.js → shell-BITUVH2R.js} +30 -37
  200. package/chunks/{skill-IBUGJX5S.js → skill-SOQHY455.js} +20 -24
  201. package/chunks/{spawnChannel-SWCGOB2N.js → spawnChannel-2BU3AULL.js} +32 -39
  202. package/chunks/{src-FOUKVFPZ.js → src-43LM7JLB.js} +209 -279
  203. package/chunks/{standalone-update-5U5IRIN5.js → standalone-update-YG5JUYCM.js} +32 -39
  204. package/chunks/{startInteractiveUI-B3KIQ363.js → startInteractiveUI-3RGTGEX5.js} +895 -1092
  205. package/chunks/{syntheticOutput-H7RTI5KL.js → syntheticOutput-FG5PQKIR.js} +4 -4
  206. package/chunks/{task-create-7474AJJD.js → task-create-HX32YXO7.js} +8 -10
  207. package/chunks/{task-list-633HGOIB.js → task-list-QWSY4ZIU.js} +6 -6
  208. package/chunks/{task-stop-MNUGHPIA.js → task-stop-GWC6UWAL.js} +3 -3
  209. package/chunks/{task-update-66GQB5LI.js → task-update-NCTAB73Q.js} +8 -10
  210. package/chunks/{team-create-AT3OPBS4.js → team-create-FXN3PEBP.js} +35 -42
  211. package/chunks/{team-delete-BB3CG3QF.js → team-delete-KK37HTOG.js} +6 -6
  212. package/chunks/{team-plan-approval-6AYAQ3KG.js → team-plan-approval-GEIZ356Q.js} +35 -42
  213. package/chunks/theme-manager-IAETOI25.js +63 -0
  214. package/chunks/{todoWrite-KRAUN54W.js → todoWrite-ERCAMLFS.js} +5 -5
  215. package/chunks/{tool-search-2ZFYIVVW.js → tool-search-XKK7DNOK.js} +17 -21
  216. package/chunks/total-session-admission-BJLDHKJN.js +69 -0
  217. package/chunks/{trustedFolders-VHGVDSZU.js → trustedFolders-5XCVNEUU.js} +31 -38
  218. package/chunks/{update-relaunch-RM5E3W4P.js → update-relaunch-FMVZK6XF.js} +17 -17
  219. package/chunks/updateCheck-YZZB7YBU.js +70 -0
  220. package/chunks/{useAutoAcceptIndicator-AAPKHC46.js → useAutoAcceptIndicator-ZSQX4I2H.js} +40 -47
  221. package/chunks/{validateNonInterActiveAuth-7WGVSFOZ.js → validateNonInterActiveAuth-PRVEB6GG.js} +72 -79
  222. package/chunks/{version-M7BDNXTT.js → version-AZMG6KWL.js} +1 -1
  223. package/chunks/{web-fetch-UZSKXY3L.js → web-fetch-EPGJ5OQQ.js} +41 -100
  224. package/chunks/{workflow-OCSRM2L2.js → workflow-UTNVPW22.js} +39 -47
  225. package/chunks/workspace-providers-status-EADV364W.js +72 -0
  226. package/chunks/{workspace-registration-store-QDOLWEMY.js → workspace-registration-store-F3ZX3YHT.js} +2 -8
  227. package/chunks/workspace-registry-W6VMFYZU.js +73 -0
  228. package/chunks/workspace-service-F3KIN2UN.js +84 -0
  229. package/chunks/workspace-skills-status-YVICUR5Y.js +71 -0
  230. package/chunks/write-file-CVGF2OKV.js +596 -0
  231. package/chunks/{zh-WY5DWYZD.js → zh-6ANG2HTL.js} +1 -5
  232. package/chunks/{zh-TW-BM47YBFH.js → zh-TW-4RR3YHNN.js} +1 -5
  233. package/cli-entry.js +12 -164
  234. package/cli.js +11 -18
  235. package/locales/ca.js +203 -772
  236. package/locales/de.js +2 -8
  237. package/locales/en.js +2 -8
  238. package/locales/fr.js +2 -8
  239. package/locales/ja.js +2 -8
  240. package/locales/pt.js +2 -8
  241. package/locales/ru.js +2 -8
  242. package/locales/zh-TW.js +2 -8
  243. package/locales/zh.js +2 -8
  244. package/package.json +3 -3
  245. package/web-shell/assets/{arc-ByltRugA.js → arc-Buk1besA.js} +1 -1
  246. package/web-shell/assets/{architectureDiagram-3BPJPVTR-CCRTto5d.js → architectureDiagram-3BPJPVTR-B1aUKYDC.js} +1 -1
  247. package/web-shell/assets/{blockDiagram-GPEHLZMM-Jfy36u1L.js → blockDiagram-GPEHLZMM-CRTdg3Zx.js} +1 -1
  248. package/web-shell/assets/{c4Diagram-AAUBKEIU-4d5FfEZ0.js → c4Diagram-AAUBKEIU-DFdRMp5g.js} +1 -1
  249. package/web-shell/assets/channel-04R0vLbG.js +1 -0
  250. package/web-shell/assets/{chunk-2J33WTMH-BPwxCEro.js → chunk-2J33WTMH-4rYQdkEI.js} +1 -1
  251. package/web-shell/assets/{chunk-4BX2VUAB-jY7ZmJWY.js → chunk-4BX2VUAB-Coi-pQJy.js} +1 -1
  252. package/web-shell/assets/{chunk-55IACEB6-C98HgCsS.js → chunk-55IACEB6-BtBjz02t.js} +1 -1
  253. package/web-shell/assets/{chunk-727SXJPM-cDu-ge-q.js → chunk-727SXJPM-CGYOWorl.js} +1 -1
  254. package/web-shell/assets/{chunk-AQP2D5EJ-BKdJwxXK.js → chunk-AQP2D5EJ-CH5AKhqx.js} +1 -1
  255. package/web-shell/assets/{chunk-FMBD7UC4-DnuxqwMu.js → chunk-FMBD7UC4-Cd50-w85.js} +1 -1
  256. package/web-shell/assets/{chunk-ND2GUHAM-C4fZNPv0.js → chunk-ND2GUHAM-C2wF3KCK.js} +1 -1
  257. package/web-shell/assets/{chunk-QZHKN3VN-Cf4XWOmz.js → chunk-QZHKN3VN-pCeRTaWi.js} +1 -1
  258. package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +1 -0
  259. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +1 -0
  260. package/web-shell/assets/{cose-bilkent-S5V4N54A-C82mFiqj.js → cose-bilkent-S5V4N54A-B-_fAB6D.js} +1 -1
  261. package/web-shell/assets/{dagre-BM42HDAG-Df8KACER.js → dagre-BM42HDAG-ChSPNHpL.js} +1 -1
  262. package/web-shell/assets/{diagram-2AECGRRQ-EzNs7s_2.js → diagram-2AECGRRQ-BX7cFOF3.js} +1 -1
  263. package/web-shell/assets/{diagram-5GNKFQAL-BRLNvreg.js → diagram-5GNKFQAL-BQUTW92n.js} +1 -1
  264. package/web-shell/assets/{diagram-KO2AKTUF-2HLYHRjC.js → diagram-KO2AKTUF-BkYPh3e4.js} +1 -1
  265. package/web-shell/assets/{diagram-LMA3HP47-DeH0NzSp.js → diagram-LMA3HP47-Cl6jsNyx.js} +1 -1
  266. package/web-shell/assets/{diagram-OG6HWLK6-k5Gn47-G.js → diagram-OG6HWLK6-DRWoHz8n.js} +1 -1
  267. package/web-shell/assets/{erDiagram-TEJ5UH35-gPHFo79f.js → erDiagram-TEJ5UH35-CGvFcZco.js} +1 -1
  268. package/web-shell/assets/{flowDiagram-I6XJVG4X-DYBOiTRW.js → flowDiagram-I6XJVG4X-vms6oVdv.js} +1 -1
  269. package/web-shell/assets/{ganttDiagram-6RSMTGT7-cxjAuic9.js → ganttDiagram-6RSMTGT7-ukT_sfmi.js} +1 -1
  270. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-3nPqpmCP.js → gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js} +1 -1
  271. package/web-shell/assets/index-DgkKrjw3.js +1187 -0
  272. package/web-shell/assets/index-Rv6mOAN9.css +5 -0
  273. package/web-shell/assets/{index-Cl8d-1bK.js → index-wFXp7W68.js} +1 -1
  274. package/web-shell/assets/{infoDiagram-5YYISTIA-Dph21pR5.js → infoDiagram-5YYISTIA-DHJdSi7x.js} +1 -1
  275. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-Cjg1hSaG.js → ishikawaDiagram-YF4QCWOH-DOvd2Wph.js} +1 -1
  276. package/web-shell/assets/{journeyDiagram-JHISSGLW-CR-IzvnU.js → journeyDiagram-JHISSGLW-CH_urMCT.js} +1 -1
  277. package/web-shell/assets/{kanban-definition-UN3LZRKU-BYmuybuC.js → kanban-definition-UN3LZRKU-FKiBdgbH.js} +1 -1
  278. package/web-shell/assets/{linear-CngEEoy8.js → linear-0ZVQFVKf.js} +1 -1
  279. package/web-shell/assets/{mermaid.core-G6fbZRPf.js → mermaid.core-DJ05ZZIK.js} +5 -5
  280. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BtnqnUwJ.js → mindmap-definition-RKZ34NQL-BPuUhkUm.js} +1 -1
  281. package/web-shell/assets/{pieDiagram-4H26LBE5-XTq6UHIA.js → pieDiagram-4H26LBE5-yLFKcXyG.js} +1 -1
  282. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-D1J5PrsS.js → quadrantDiagram-W4KKPZXB-irWqc1pE.js} +1 -1
  283. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CLcBUy3t.js → requirementDiagram-4Y6WPE33-B_4uMoIV.js} +1 -1
  284. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-iwKV02_6.js → sankeyDiagram-5OEKKPKP-ciA4GPwk.js} +1 -1
  285. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-7NFYQcEX.js → sequenceDiagram-3UESZ5HK-CRdZvy0U.js} +1 -1
  286. package/web-shell/assets/{stateDiagram-AJRCARHV-Bvm4Wih6.js → stateDiagram-AJRCARHV-DaYIkCCn.js} +1 -1
  287. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +1 -0
  288. package/web-shell/assets/{timeline-definition-PNZ67QCA-B4FZFE9O.js → timeline-definition-PNZ67QCA-oBUKv6iH.js} +1 -1
  289. package/web-shell/assets/{vennDiagram-CIIHVFJN-CvMBpmtL.js → vennDiagram-CIIHVFJN-CGW9Sdmb.js} +1 -1
  290. package/web-shell/assets/{wardley-L42UT6IY-E3ag2327.js → wardley-L42UT6IY-CvwKJOCm.js} +1 -1
  291. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BEXWlgxC.js → wardleyDiagram-YWT4CUSO-Ipc260sN.js} +1 -1
  292. package/web-shell/assets/{xychartDiagram-2RQKCTM6-CICK05gI.js → xychartDiagram-2RQKCTM6-D6-CM7pK.js} +1 -1
  293. package/web-shell/index.html +2 -2
  294. package/chunks/agent-headless-QTKDKVED.js +0 -68
  295. package/chunks/chunk-2RFKHEXL.js +0 -74
  296. package/chunks/chunk-43T5WDQ7.js +0 -127
  297. package/chunks/chunk-6PVPNMXU.js +0 -29
  298. package/chunks/chunk-7362QS5B.js +0 -2256
  299. package/chunks/chunk-D7ZI5C7O.js +0 -20600
  300. package/chunks/chunk-GLNBDYUX.js +0 -38
  301. package/chunks/chunk-GMLTZG4O.js +0 -391
  302. package/chunks/chunk-HTR4WV6U.js +0 -327
  303. package/chunks/chunk-KWK7UE6L.js +0 -6194
  304. package/chunks/chunk-M7WBGLYP.js +0 -151
  305. package/chunks/chunk-MMT6IQCT.js +0 -121
  306. package/chunks/chunk-NABLFI57.js +0 -82
  307. package/chunks/chunk-OQ5SYCPE.js +0 -10017
  308. package/chunks/chunk-PI6ECBP3.js +0 -1780
  309. package/chunks/chunk-U7ZFW55U.js +0 -2098
  310. package/chunks/chunk-WHGVTP7Q.js +0 -1049
  311. package/chunks/chunk-XHATNRQA.js +0 -1500
  312. package/chunks/contextCommand-2W675HYY.js +0 -73
  313. package/chunks/daemon-status-provider-QZCVTG6N.js +0 -81
  314. package/chunks/handleAutoUpdate-EF3LY7MI.js +0 -74
  315. package/chunks/initializer-HCOCXGBI.js +0 -79
  316. package/chunks/installationInfo-UEBNCLFW.js +0 -73
  317. package/chunks/list-4SKXTNSD.js +0 -82
  318. package/chunks/loadedSettingsAdapter-EQWK5CG6.js +0 -76
  319. package/chunks/managed-npm-update-ZUZU4UFM.js +0 -333
  320. package/chunks/mcp-4Z3EC4SI.js +0 -76
  321. package/chunks/nonInteractiveCli-FTUKIU5R.js +0 -133
  322. package/chunks/ripGrep-K2E3F5ED.js +0 -66
  323. package/chunks/sdk-exporters-grpc-ETLH47EP.js +0 -23214
  324. package/chunks/sdk-exporters-http-T3POX73F.js +0 -563
  325. package/chunks/sdk-impl-NSLPDH6I.js +0 -9193
  326. package/chunks/theme-manager-733OBN7I.js +0 -70
  327. package/chunks/total-session-admission-TZ4NVA6B.js +0 -76
  328. package/chunks/updateCheck-DGY3LFKB.js +0 -89
  329. package/chunks/web-search-EG64C5VB.js +0 -731
  330. package/chunks/workspace-providers-status-HZLYOFRA.js +0 -79
  331. package/chunks/workspace-registry-EVSTTG3G.js +0 -80
  332. package/chunks/workspace-service-DNQMT6FN.js +0 -91
  333. package/chunks/workspace-skills-status-ICGPGD6F.js +0 -78
  334. package/chunks/write-file-K6R5F3IZ.js +0 -66
  335. package/web-shell/assets/channel-4N2UIFcG.js +0 -1
  336. package/web-shell/assets/classDiagram-4FO5ZUOK-Q4dYOtsh.js +0 -1
  337. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Q4dYOtsh.js +0 -1
  338. package/web-shell/assets/index-B7jzUZ_s.css +0 -5
  339. package/web-shell/assets/index-gE8OWwj_.js +0 -1197
  340. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-xXU_zO2Z.js +0 -1
  341. package/chunks/{chunk-QZJY47IE.js → chunk-PEJWA3QQ.js} +5 -5
@@ -1,5 +1,10 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ openQwenAsrRealtimeStream,
5
+ openVoiceStream,
6
+ openVoiceStreamWithRetry
7
+ } from "./chunk-GKY2OJ7R.js";
3
8
  import {
4
9
  GENERATION_MAX_PROMPT_BYTES,
5
10
  MAX_REMEMBER_CONTENT_BYTES,
@@ -14,12 +19,7 @@ import {
14
19
  shouldSuppressRememberErrorDetails,
15
20
  workspaceMemoryFailureCode,
16
21
  workspaceMemoryFailureDiagnostics
17
- } from "./chunk-RZZNAWTE.js";
18
- import {
19
- openQwenAsrRealtimeStream,
20
- openVoiceStream,
21
- openVoiceStreamWithRetry
22
- } from "./chunk-ZHERRXZJ.js";
22
+ } from "./chunk-5JBR5XIK.js";
23
23
  import {
24
24
  SetupGithubError,
25
25
  collectSessionData,
@@ -30,17 +30,21 @@ import {
30
30
  toJson,
31
31
  toJsonl,
32
32
  toMarkdown
33
- } from "./chunk-BH32VITB.js";
33
+ } from "./chunk-PGEPSDJI.js";
34
34
  import {
35
35
  OBSERVED_CONTACT_MAX_FRESH_WITHIN_SECONDS,
36
36
  ObservedChannelContactStore
37
- } from "./chunk-4K7VDKAD.js";
37
+ } from "./chunk-KTUQMDEP.js";
38
+ import "./chunk-D22SX43D.js";
38
39
  import "./chunk-RS7MT2QG.js";
39
- import "./chunk-6NAAGP57.js";
40
40
  import "./chunk-H2XVO6NE.js";
41
41
  import "./chunk-QHTIBUWB.js";
42
42
  import "./chunk-QTERJVPZ.js";
43
43
  import "./chunk-L573Z2QZ.js";
44
+ import {
45
+ createSingleWorkspaceRegistry,
46
+ createWorkspaceSessionOwnerIndex
47
+ } from "./chunk-W7H223ZZ.js";
44
48
  import {
45
49
  CAPABILITIES_SCHEMA_VERSION,
46
50
  CLIENT_ID_HEADER,
@@ -96,29 +100,29 @@ import {
96
100
  setRateLimiter,
97
101
  unsafeRevealSecret,
98
102
  validateMcpRuntimeServerName
99
- } from "./chunk-BKZEHVPV.js";
103
+ } from "./chunk-B3KGZCQN.js";
100
104
  import {
101
105
  isLoopbackBind
102
106
  } from "./chunk-RXFQM6FQ.js";
103
107
  import {
104
108
  createDaemonStatusProvider
105
- } from "./chunk-FJZPCXZM.js";
109
+ } from "./chunk-7RMOXZTC.js";
106
110
  import "./chunk-LXXMOYPL.js";
107
- import "./chunk-HGGEN2SC.js";
111
+ import "./chunk-NDMQLV4Y.js";
108
112
  import "./chunk-E5Z2AVNV.js";
109
113
  import {
110
114
  createWorkspaceProvidersStatusProvider
111
- } from "./chunk-JNEA3NW7.js";
115
+ } from "./chunk-SJMV7ZBK.js";
112
116
  import {
113
117
  getAuthTypeFromEnv,
114
118
  resolveCliGenerationConfig
115
- } from "./chunk-WKGGZF7Z.js";
119
+ } from "./chunk-NGFEPAE6.js";
116
120
  import {
117
121
  snapshotProcessEnv
118
- } from "./chunk-MPZ34JE7.js";
122
+ } from "./chunk-OYZWQNWG.js";
119
123
  import {
120
124
  createWorkspaceSkillsStatusProvider
121
- } from "./chunk-QW3QUYG5.js";
125
+ } from "./chunk-4ILMYHEI.js";
122
126
  import "./chunk-2W3OOD4W.js";
123
127
  import {
124
128
  EMPTY_WORKSPACE_VOICE_UPDATE_ERROR,
@@ -133,14 +137,14 @@ import {
133
137
  validateWorkspaceSkillName,
134
138
  validateWorkspaceVoiceState,
135
139
  voiceSettingsScopeToWire
136
- } from "./chunk-BXCXDT2T.js";
140
+ } from "./chunk-7PZ2ATFZ.js";
137
141
  import {
138
142
  PermissionRulesValidationError,
139
143
  buildPermissionSettings,
140
144
  isPermissionRuleType,
141
145
  normalizePermissionRules,
142
146
  readPermissionRuleSet
143
- } from "./chunk-VJ4P64ID.js";
147
+ } from "./chunk-S2XVRHDN.js";
144
148
  import {
145
149
  assertVoiceBaseUrlNetworkAllowed,
146
150
  isStreamingVoiceModel,
@@ -148,13 +152,13 @@ import {
148
152
  resolveVoiceTranscriptionConfig,
149
153
  sanitizeVoiceErrorMessage,
150
154
  transcribeVoiceAudio
151
- } from "./chunk-RVWSD6GI.js";
155
+ } from "./chunk-IR46U7RB.js";
152
156
  import {
153
157
  isVoiceEnabled,
154
158
  isVoiceMode,
155
159
  readVoiceModel
156
- } from "./chunk-P4B4SXDS.js";
157
- import "./chunk-QLJUC7TG.js";
160
+ } from "./chunk-S2PD3EZD.js";
161
+ import "./chunk-BVLROR2T.js";
158
162
  import {
159
163
  WorkspacePermissionRulesSessionRequiredError,
160
164
  WorkspaceSettingsPartialPersistError,
@@ -163,35 +167,21 @@ import {
163
167
  } from "./chunk-OA4JVLSA.js";
164
168
  import {
165
169
  createTotalSessionAdmissionController
166
- } from "./chunk-VYPFXUCB.js";
167
- import {
168
- createSingleWorkspaceRegistry,
169
- createWorkspaceSessionOwnerIndex
170
- } from "./chunk-UGYMA4EI.js";
170
+ } from "./chunk-R3VWUU2E.js";
171
171
  import "./chunk-GRC5HGPI.js";
172
- import {
173
- daemonObservedContactsPath,
174
- loadChannelsConfig
175
- } from "./chunk-GDBCCE2J.js";
176
- import "./chunk-7FNV372W.js";
177
- import "./chunk-57OAHC2Y.js";
178
- import {
179
- parseChannelWebhookConfigLenient
180
- } from "./chunk-QD6BRERJ.js";
181
- import "./chunk-6ZBPS62S.js";
182
- import "./chunk-V6WHFGST.js";
183
172
  import {
184
173
  SessionArtifactAuthorizationError,
185
174
  SessionArtifactValidationError,
186
175
  createAcpSessionBridge,
187
176
  parseSessionSource
188
- } from "./chunk-422RQSNN.js";
177
+ } from "./chunk-AKX4WPPP.js";
189
178
  import {
190
179
  EVENT_SCHEMA_VERSION,
191
180
  SubscriberLimitExceededError
192
181
  } from "./chunk-6RLROE6G.js";
193
182
  import "./chunk-COH43MRJ.js";
194
183
  import "./chunk-QR6U5QPP.js";
184
+ import "./chunk-CV63PP6U.js";
195
185
  import {
196
186
  BranchWhilePromptActiveError,
197
187
  CancelSentinelCollisionError,
@@ -205,7 +195,6 @@ import {
205
195
  McpServerRestartFailedError,
206
196
  PermissionForbiddenError,
207
197
  PermissionPolicyNotImplementedError,
208
- PromptDeadlineExceededError,
209
198
  PromptQueueFullError,
210
199
  RestoreInProgressError,
211
200
  SessionArchivedError,
@@ -224,13 +213,35 @@ import {
224
213
  WorkspaceInitRaceError,
225
214
  WorkspaceInitSymlinkError,
226
215
  WorkspaceMismatchError
227
- } from "./chunk-UH3WSE5L.js";
228
- import "./chunk-K6YXJ3J5.js";
216
+ } from "./chunk-X6YQWCIJ.js";
229
217
  import {
230
218
  STATUS_SCHEMA_VERSION,
231
219
  createIdleWorkspaceMemoryStatus,
232
220
  mapDomainErrorToErrorKind
233
- } from "./chunk-BLTELXOK.js";
221
+ } from "./chunk-VDWBQ5AW.js";
222
+ import "./chunk-WBL3FJEU.js";
223
+ import {
224
+ daemonObservedContactsPath,
225
+ loadChannelsConfig
226
+ } from "./chunk-CB2HFGRV.js";
227
+ import "./chunk-MJ6S23WZ.js";
228
+ import "./chunk-57OAHC2Y.js";
229
+ import {
230
+ parseChannelWebhookConfigLenient
231
+ } from "./chunk-YWEW33JY.js";
232
+ import "./chunk-4ODB7WIB.js";
233
+ import "./chunk-V6WHFGST.js";
234
+ import {
235
+ MAX_REGISTERED_WORKSPACES,
236
+ WorkspaceRegistrationStoreCommittedError,
237
+ WorkspaceRegistrationStoreLimitError,
238
+ workspaceRegistrationId
239
+ } from "./chunk-KQNM4EO7.js";
240
+ import {
241
+ MAX_WORKSPACE_PATH_LENGTH,
242
+ canonicalizeWorkspace,
243
+ canonicalizeWorkspaces
244
+ } from "./chunk-W7FJ3N32.js";
234
245
  import {
235
246
  MAX_CHANNEL_STARTUP_FAILURES,
236
247
  MAX_CHANNEL_STARTUP_FAILURE_CHANNEL_LENGTH,
@@ -239,18 +250,18 @@ import {
239
250
  QWEN_SERVER_TOKEN_ENV,
240
251
  isChannelWebhookEnqueueError,
241
252
  normalizeWorkerDiagnostic
242
- } from "./chunk-QKTHJXCS.js";
253
+ } from "./chunk-Y2ENGUD6.js";
243
254
  import {
244
255
  normalizeServeChannelSelection
245
256
  } from "./chunk-TJTKSVIV.js";
246
257
  import {
247
258
  redactLogCredentials
248
259
  } from "./chunk-M5GB774H.js";
249
- import "./chunk-WBL3FJEU.js";
260
+ import "./chunk-5HBA2Z7V.js";
250
261
  import "./chunk-T2NCM2ET.js";
251
262
  import {
252
263
  sanitizeLogText
253
- } from "./chunk-RVLZCXEE.js";
264
+ } from "./chunk-NIJEXGV6.js";
254
265
  import "./chunk-UDXSXLER.js";
255
266
  import {
256
267
  getDialogSettingKeys,
@@ -261,38 +272,20 @@ import {
261
272
  getWritableScopes,
262
273
  loadSettings,
263
274
  validateSettingValue
264
- } from "./chunk-DGKZ6QL3.js";
275
+ } from "./chunk-33XUAINQ.js";
265
276
  import "./chunk-RKUWKYED.js";
266
- import {
267
- SUPPORTED_LANGUAGES,
268
- detectSystemLanguage,
269
- resolveLanguageSetting,
270
- resolveSupportedLanguage
271
- } from "./chunk-3FML67YK.js";
272
- import "./chunk-R3D7SK6L.js";
273
277
  import "./chunk-GOXKNSDZ.js";
274
- import "./chunk-QRUIS3DN.js";
275
- import {
276
- MAX_REGISTERED_WORKSPACES,
277
- WorkspaceDisplayNameValidationError,
278
- WorkspaceRegistrationStoreCommittedError,
279
- WorkspaceRegistrationStoreLimitError,
280
- normalizeWorkspaceDisplayName,
281
- workspaceRegistrationId
282
- } from "./chunk-52Y2T4L3.js";
283
- import {
284
- MAX_WORKSPACE_PATH_LENGTH,
285
- canonicalizeWorkspace,
286
- canonicalizeWorkspaces,
287
- translateAndCheckAbsoluteWorkspacePath
288
- } from "./chunk-2RFKHEXL.js";
289
- import "./chunk-5HBA2Z7V.js";
290
278
  import "./chunk-IDS7MSUP.js";
291
- import "./chunk-FCPNARPD.js";
279
+ import {
280
+ SUPPORTED_LANGUAGES
281
+ } from "./chunk-TKLLK6XQ.js";
282
+ import "./chunk-TIH2ZTOC.js";
283
+ import "./chunk-QRUIS3DN.js";
284
+ import "./chunk-OWCALFEG.js";
292
285
  import "./chunk-VJNBRRZG.js";
293
286
  import {
294
287
  getWorkspaceTrustStatus
295
- } from "./chunk-NTC7J4X7.js";
288
+ } from "./chunk-I2PYAYFM.js";
296
289
  import "./chunk-ALGGS7UH.js";
297
290
  import {
298
291
  isWithinRoot as isWithinRoot2
@@ -306,19 +299,15 @@ import {
306
299
  BuiltinAgentRegistry,
307
300
  Client,
308
301
  ClientMcpRegistrar,
309
- DEFAULT_LOG_LIMIT,
310
302
  ExtensionManager,
311
303
  GROUP_COLOR_OPTIONS,
312
- GitWorktreeService,
313
304
  IMAGE_CAPABILITY,
314
305
  InvalidSessionTranscriptCursorError,
315
- MAX_LOG_LIMIT,
316
306
  ModelsConfig,
317
307
  RUNTIME_MCP_IF_ABSENT_CONFIG_FLAG,
318
308
  SESSION_TRANSCRIPT_MAX_INDEX_BYTES,
319
309
  SESSION_TRANSCRIPT_MAX_LIMIT,
320
310
  SESSION_TRANSCRIPT_MAX_PAGE_BYTES,
321
- SESSION_WRITER_RPC_CODES,
322
311
  SessionOrganizationError,
323
312
  SessionOrganizationService,
324
313
  SessionService,
@@ -327,7 +316,6 @@ import {
327
316
  SessionTranscriptReader,
328
317
  SessionTranscriptSnapshotUnavailableError,
329
318
  SessionTranscriptTooLargeError,
330
- SessionWriterError,
331
319
  StandardFileSystemService,
332
320
  StdioClientTransport,
333
321
  StreamableHTTPClientTransport,
@@ -338,16 +326,13 @@ import {
338
326
  buildUsageDashboard,
339
327
  detectLineEnding,
340
328
  encodeTextFileContent,
341
- fetchGitCommitDetail,
342
329
  fetchGitDiff,
343
330
  fetchGitDiffHunksForFile,
344
- fetchGitLog,
345
331
  getGitWorkingTreeStatus,
346
332
  glob,
347
333
  loadIgnoreRules,
348
334
  loadUsageHistoryWithLive,
349
335
  parseInstallSource,
350
- readWorktreeSession,
351
336
  redactUrlCredentials,
352
337
  resolveBranchName,
353
338
  resolveProviderProtocol,
@@ -355,21 +340,19 @@ import {
355
340
  stripAnsiAndControl,
356
341
  stripTerminalControlSequences,
357
342
  watchRepoBranch,
358
- writeWorkspaceContextFile,
359
- writeWorktreeSession,
360
- writeWorktreeSessionMarker
361
- } from "./chunk-Z2FTZM4Z.js";
343
+ writeWorkspaceContextFile
344
+ } from "./chunk-KX6UK4VJ.js";
345
+ import "./chunk-5M6IDOMF.js";
362
346
  import "./chunk-T4TZQJ7W.js";
363
347
  import "./chunk-H6XPXXMH.js";
364
- import "./chunk-5M6IDOMF.js";
365
- import "./chunk-T2L47JJK.js";
366
- import "./chunk-GPSKDNEE.js";
367
- import "./chunk-X6N25LXS.js";
368
- import "./chunk-E2UVIFI2.js";
369
348
  import {
370
349
  MAX_JOBS,
371
350
  nextDurableFireMs
372
- } from "./chunk-Q2YKNMLS.js";
351
+ } from "./chunk-EAUYY7SS.js";
352
+ import "./chunk-FSL5W5TI.js";
353
+ import "./chunk-OONJNQ42.js";
354
+ import "./chunk-D2VIDMVM.js";
355
+ import "./chunk-E2UVIFI2.js";
373
356
  import {
374
357
  nextFireTime,
375
358
  parseCron
@@ -382,27 +365,20 @@ import {
382
365
  readCronTasks,
383
366
  taskHasLegacyCondition,
384
367
  updateCronTasks
385
- } from "./chunk-KHOVYUHX.js";
368
+ } from "./chunk-EIAK6Q2B.js";
386
369
  import "./chunk-SZRN75WQ.js";
387
- import "./chunk-6PVPNMXU.js";
388
- import "./chunk-MMT6IQCT.js";
370
+ import "./chunk-HTO4JFDZ.js";
389
371
  import "./chunk-CPBF7KYF.js";
390
- import "./chunk-NABLFI57.js";
391
- import "./chunk-QBUDF33N.js";
392
- import "./chunk-LIZRAKPB.js";
393
372
  import {
394
373
  APPROVAL_MODES,
395
374
  SubagentError,
396
375
  SubagentErrorCode
397
- } from "./chunk-WHGVTP7Q.js";
376
+ } from "./chunk-CPCVCKKF.js";
398
377
  import "./chunk-6AM5D4ME.js";
399
- import "./chunk-JCW2R7WC.js";
400
- import "./chunk-57FIIFJN.js";
401
- import "./chunk-HTO4JFDZ.js";
402
- import "./chunk-XVNQMZ2I.js";
403
- import "./chunk-CR3C7WXL.js";
404
- import "./chunk-FODK6UMO.js";
405
- import "./chunk-GLNBDYUX.js";
378
+ import "./chunk-G45X5TRN.js";
379
+ import "./chunk-PBATSWUQ.js";
380
+ import "./chunk-ZEOZL37W.js";
381
+ import "./chunk-OOCI5VVU.js";
406
382
  import {
407
383
  QwenOAuth2Client,
408
384
  QwenOAuthPollError,
@@ -411,12 +387,9 @@ import {
411
387
  isDeviceAuthorizationSuccess,
412
388
  isDeviceTokenPending,
413
389
  isDeviceTokenSuccess
414
- } from "./chunk-EDANOBFR.js";
390
+ } from "./chunk-BRRF37CO.js";
391
+ import "./chunk-BMWMT5Y2.js";
415
392
  import "./chunk-JESCGQM3.js";
416
- import "./chunk-GMLTZG4O.js";
417
- import "./chunk-25WFJZL5.js";
418
- import "./chunk-DJ2GSRLV.js";
419
- import "./chunk-5I5BM454.js";
420
393
  import {
421
394
  addDaemonRequestAttribute,
422
395
  decodeBufferWithEncodingInfo,
@@ -430,35 +403,37 @@ import {
430
403
  recordDaemonHttpRequest,
431
404
  recordDaemonHttpResponse,
432
405
  withDaemonRequestSpan
433
- } from "./chunk-D7ZI5C7O.js";
406
+ } from "./chunk-ZFKNWQGQ.js";
407
+ import "./chunk-4WKAA4KS.js";
408
+ import "./chunk-CR3C7WXL.js";
434
409
  import "./chunk-VGC4I5JJ.js";
435
- import "./chunk-4K56OJFJ.js";
436
- import "./chunk-JYS55H6Z.js";
410
+ import "./chunk-JD3MKVKL.js";
411
+ import "./chunk-UEY4AYUL.js";
412
+ import "./chunk-BDBMYST4.js";
413
+ import "./chunk-EZVDJFZ7.js";
414
+ import "./chunk-OP4MOGXF.js";
415
+ import "./chunk-XVNQMZ2I.js";
416
+ import "./chunk-FEOZBUMT.js";
417
+ import "./chunk-DJ2GSRLV.js";
418
+ import "./chunk-6EFTQYW7.js";
419
+ import "./chunk-MAQQGNQ5.js";
437
420
  import "./chunk-A4UCTEB5.js";
438
421
  import "./chunk-XWRJCPHC.js";
439
- import "./chunk-QNLNLENL.js";
440
- import "./chunk-6X4GWOPW.js";
441
422
  import "./chunk-TYQMGACW.js";
442
423
  import {
443
424
  import_websocket_server
444
425
  } from "./chunk-TYAMGABM.js";
445
426
  import "./chunk-FCMNKVXT.js";
446
- import "./chunk-7362QS5B.js";
447
- import "./chunk-HTR4WV6U.js";
448
- import "./chunk-M7WBGLYP.js";
449
- import "./chunk-U7ZFW55U.js";
450
- import "./chunk-NPQDJGKU.js";
451
- import "./chunk-YM3SZTH4.js";
452
427
  import {
453
428
  FatalConfigError,
454
429
  Storage,
455
430
  createDebugLogger,
456
431
  runWithoutDebugLogSession
457
- } from "./chunk-OQB4EXO4.js";
432
+ } from "./chunk-C27BYUX6.js";
458
433
  import "./chunk-75DOP5OR.js";
459
434
  import "./chunk-DMTGGOSA.js";
460
435
  import "./chunk-YQ3U5MUC.js";
461
- import "./chunk-THJNPLI4.js";
436
+ import "./chunk-TB6UDU4T.js";
462
437
  import {
463
438
  init_esbuild_shims
464
439
  } from "./chunk-5O2XNYP6.js";
@@ -477,6 +452,7 @@ import { createHash as createHash3, timingSafeEqual } from "node:crypto";
477
452
 
478
453
  // packages/cli/src/serve/acp-http/dispatch.ts
479
454
  init_esbuild_shims();
455
+ import path9 from "node:path";
480
456
 
481
457
  // packages/cli/src/serve/fs/errors.ts
482
458
  init_esbuild_shims();
@@ -1767,17 +1743,17 @@ var WorkspaceFileSystemImpl = class {
1767
1743
  * for their `sendFsError` serializer.
1768
1744
  */
1769
1745
  recordAndWrap(err, intent, input) {
1770
- const fs5 = wrapAsFsError(err);
1746
+ const fs3 = wrapAsFsError(err);
1771
1747
  this.deps.audit.recordDenied(this.deps.ctx, {
1772
1748
  intent,
1773
1749
  input,
1774
- errorKind: fs5.kind,
1775
- hint: fs5.hint,
1750
+ errorKind: fs3.kind,
1751
+ hint: fs3.hint,
1776
1752
  // Quote the underlying OS / FsError message so audit
1777
1753
  // consumers debugging a production incident can see the
1778
1754
  // actual cause (errno text, byte counts, glob pattern,
1779
1755
  // etc.) rather than just `errorKind` + `hint`.
1780
- message: fs5.message,
1756
+ message: fs3.message,
1781
1757
  // For glob denials (parse_error pattern rejection,
1782
1758
  // catastrophic walk failures) the input IS the pattern
1783
1759
  // already; surfacing it on the dedicated `pattern` field
@@ -1786,7 +1762,7 @@ var WorkspaceFileSystemImpl = class {
1786
1762
  // branching on intent.
1787
1763
  pattern: intent === "glob" ? input : void 0
1788
1764
  });
1789
- return fs5;
1765
+ return fs3;
1790
1766
  }
1791
1767
  };
1792
1768
  var CONTENT_HASH_RE = /^sha256:[0-9a-f]{64}$/;
@@ -2268,7 +2244,7 @@ async function renameWithRetryLocal(src, dest, retries, delayMs) {
2268
2244
  const retryable = code === "EPERM" || code === "EACCES";
2269
2245
  if (!retryable || attempt === retries) throw err;
2270
2246
  await new Promise(
2271
- (resolve6) => setTimeout(resolve6, delayMs * 2 ** attempt)
2247
+ (resolve5) => setTimeout(resolve5, delayMs * 2 ** attempt)
2272
2248
  );
2273
2249
  }
2274
2250
  }
@@ -2523,12 +2499,12 @@ __name(applyReadHeaders, "applyReadHeaders");
2523
2499
  function sendFsError(res, err, route) {
2524
2500
  applyReadHeaders(res);
2525
2501
  if (isFsError(err)) {
2526
- const fs5 = err;
2527
- res.status(fs5.status).json({
2528
- errorKind: fs5.kind,
2529
- error: fs5.message,
2530
- hint: fs5.hint,
2531
- status: fs5.status
2502
+ const fs3 = err;
2503
+ res.status(fs3.status).json({
2504
+ errorKind: fs3.kind,
2505
+ error: fs3.message,
2506
+ hint: fs3.hint,
2507
+ status: fs3.status
2532
2508
  });
2533
2509
  return;
2534
2510
  }
@@ -2630,13 +2606,13 @@ async function handleGetFile(req, res, deps) {
2630
2606
  });
2631
2607
  return;
2632
2608
  }
2633
- const fs5 = factory.forRequest({
2609
+ const fs3 = factory.forRequest({
2634
2610
  originatorClientId: clientId ?? void 0,
2635
2611
  route: ROUTE2
2636
2612
  });
2637
2613
  try {
2638
- const resolved = await fs5.resolve(queryPath, "read");
2639
- const out = await fs5.readText(resolved, { maxBytes, line, limit });
2614
+ const resolved = await fs3.resolve(queryPath, "read");
2615
+ const out = await fs3.readText(resolved, { maxBytes, line, limit });
2640
2616
  const returnedBytes = Buffer.byteLength(out.content, "utf-8");
2641
2617
  applyReadHeaders(res);
2642
2618
  res.status(200).json({
@@ -2690,13 +2666,13 @@ async function handleGetFileBytes(req, res, deps) {
2690
2666
  });
2691
2667
  return;
2692
2668
  }
2693
- const fs5 = factory.forRequest({
2669
+ const fs3 = factory.forRequest({
2694
2670
  originatorClientId: clientId ?? void 0,
2695
2671
  route: ROUTE2
2696
2672
  });
2697
2673
  try {
2698
- const resolved = await fs5.resolve(queryPath, "read");
2699
- const out = await fs5.readBytesWindow(resolved, {
2674
+ const resolved = await fs3.resolve(queryPath, "read");
2675
+ const out = await fs3.readBytesWindow(resolved, {
2700
2676
  offset: offset ?? 0,
2701
2677
  maxBytes: maxBytes ?? DEFAULT_FILE_BYTES_MAX_BYTES
2702
2678
  });
@@ -2724,13 +2700,13 @@ async function handleGetStat(req, res, deps) {
2724
2700
  if (clientId === null) return;
2725
2701
  const queryPath = requireStringQuery(res, req.query["path"], "path", ROUTE2);
2726
2702
  if (queryPath === null) return;
2727
- const fs5 = factory.forRequest({
2703
+ const fs3 = factory.forRequest({
2728
2704
  originatorClientId: clientId ?? void 0,
2729
2705
  route: ROUTE2
2730
2706
  });
2731
2707
  try {
2732
- const resolved = await fs5.resolve(queryPath, "stat");
2733
- const st = await fs5.stat(resolved);
2708
+ const resolved = await fs3.resolve(queryPath, "stat");
2709
+ const st = await fs3.stat(resolved);
2734
2710
  applyReadHeaders(res);
2735
2711
  res.status(200).json({
2736
2712
  kind: "stat",
@@ -2753,13 +2729,13 @@ async function handleGetList(req, res, deps) {
2753
2729
  const queryPath = requireStringQuery(res, req.query["path"], "path", ROUTE2);
2754
2730
  if (queryPath === null) return;
2755
2731
  const includeIgnored = parseBoolFlag(req.query["includeIgnored"]);
2756
- const fs5 = factory.forRequest({
2732
+ const fs3 = factory.forRequest({
2757
2733
  originatorClientId: clientId ?? void 0,
2758
2734
  route: ROUTE2
2759
2735
  });
2760
2736
  try {
2761
- const resolved = await fs5.resolve(queryPath, "list");
2762
- const entries = await fs5.list(resolved, {
2737
+ const resolved = await fs3.resolve(queryPath, "list");
2738
+ const entries = await fs3.list(resolved, {
2763
2739
  includeIgnored,
2764
2740
  maxEntries: MAX_LIST_ENTRIES + 1
2765
2741
  });
@@ -2812,15 +2788,15 @@ async function handleGetGlob(req, res, deps) {
2812
2788
  }
2813
2789
  const cwdRaw = req.query["cwd"];
2814
2790
  const cwdString = typeof cwdRaw === "string" && cwdRaw.length > 0 ? cwdRaw : void 0;
2815
- const fs5 = factory.forRequest({
2791
+ const fs3 = factory.forRequest({
2816
2792
  originatorClientId: clientId ?? void 0,
2817
2793
  route: ROUTE2
2818
2794
  });
2819
2795
  const start = performance.now();
2820
2796
  try {
2821
- const cwdResolved = cwdString ? await fs5.resolve(cwdString, "list") : void 0;
2797
+ const cwdResolved = cwdString ? await fs3.resolve(cwdString, "list") : void 0;
2822
2798
  const cap = maxResults ?? DEFAULT_GLOB_MAX_RESULTS;
2823
- const probe = await fs5.glob(pattern, {
2799
+ const probe = await fs3.glob(pattern, {
2824
2800
  cwd: cwdResolved,
2825
2801
  includeIgnored,
2826
2802
  maxResults: cap + 1
@@ -2882,7 +2858,7 @@ function registerWorkspaceFileReadRoutes(app, deps) {
2882
2858
  }
2883
2859
  __name(registerWorkspaceFileReadRoutes, "registerWorkspaceFileReadRoutes");
2884
2860
  function registerWorkspaceQualifiedFileReadRoutes(app, deps) {
2885
- const resolve6 = /* @__PURE__ */ __name((req, res) => {
2861
+ const resolve5 = /* @__PURE__ */ __name((req, res) => {
2886
2862
  const runtime = resolveWorkspaceRuntimeFromParam(
2887
2863
  deps.workspaceRegistry,
2888
2864
  req,
@@ -2896,23 +2872,23 @@ function registerWorkspaceQualifiedFileReadRoutes(app, deps) {
2896
2872
  return true;
2897
2873
  }, "resolve");
2898
2874
  app.get("/workspaces/:workspace/file", (req, res) => {
2899
- if (!resolve6(req, res)) return;
2875
+ if (!resolve5(req, res)) return;
2900
2876
  void handleGetFile(req, res, deps);
2901
2877
  });
2902
2878
  app.get("/workspaces/:workspace/file/bytes", (req, res) => {
2903
- if (!resolve6(req, res)) return;
2879
+ if (!resolve5(req, res)) return;
2904
2880
  void handleGetFileBytes(req, res, deps);
2905
2881
  });
2906
2882
  app.get("/workspaces/:workspace/stat", (req, res) => {
2907
- if (!resolve6(req, res)) return;
2883
+ if (!resolve5(req, res)) return;
2908
2884
  void handleGetStat(req, res, deps);
2909
2885
  });
2910
2886
  app.get("/workspaces/:workspace/list", (req, res) => {
2911
- if (!resolve6(req, res)) return;
2887
+ if (!resolve5(req, res)) return;
2912
2888
  void handleGetList(req, res, deps);
2913
2889
  });
2914
2890
  app.get("/workspaces/:workspace/glob", (req, res) => {
2915
- if (!resolve6(req, res)) return;
2891
+ if (!resolve5(req, res)) return;
2916
2892
  void handleGetGlob(req, res, deps);
2917
2893
  });
2918
2894
  }
@@ -2994,7 +2970,7 @@ function validateClientId(clientId, deps, res) {
2994
2970
  }
2995
2971
  __name(validateClientId, "validateClientId");
2996
2972
  function createSetupGithubFileOps(factory, route, originatorClientId) {
2997
- const fs5 = factory.forRequest({
2973
+ const fs3 = factory.forRequest({
2998
2974
  route,
2999
2975
  ...originatorClientId ? { originatorClientId } : {}
3000
2976
  });
@@ -3017,14 +2993,14 @@ function createSetupGithubFileOps(factory, route, originatorClientId) {
3017
2993
  ]);
3018
2994
  },
3019
2995
  async writeTextFile(_gitRepoRoot, relativePath, content) {
3020
- const resolved = await fs5.resolve(relativePath, "write");
3021
- const out = await fs5.writeTextOverwrite(resolved, content);
2996
+ const resolved = await fs3.resolve(relativePath, "write");
2997
+ const out = await fs3.writeTextOverwrite(resolved, content);
3022
2998
  return { sizeBytes: out.sizeBytes };
3023
2999
  },
3024
3000
  async readTextFile(_gitRepoRoot, relativePath) {
3025
3001
  try {
3026
- const resolved = await fs5.resolve(relativePath, "read");
3027
- const out = await fs5.readText(resolved);
3002
+ const resolved = await fs3.resolve(relativePath, "read");
3003
+ const out = await fs3.readText(resolved);
3028
3004
  return out.content;
3029
3005
  } catch (error2) {
3030
3006
  if (isFsError(error2) && error2.kind === "path_not_found") {
@@ -6584,43 +6560,6 @@ function errMsg(err) {
6584
6560
  return err instanceof Error ? err.message : String(err);
6585
6561
  }
6586
6562
  __name(errMsg, "errMsg");
6587
- var SESSION_WRITER_RPC_ERRORS = {
6588
- session_writer_conflict: {
6589
- code: SESSION_WRITER_RPC_CODES.session_writer_conflict,
6590
- message: "This session is already open in another Qwen process."
6591
- },
6592
- session_writer_lost: {
6593
- code: SESSION_WRITER_RPC_CODES.session_writer_lost,
6594
- message: "Write ownership for this session was lost."
6595
- },
6596
- session_transcript_changed: {
6597
- code: SESSION_WRITER_RPC_CODES.session_transcript_changed,
6598
- message: "The session transcript changed outside its active writer."
6599
- },
6600
- session_writer_unavailable: {
6601
- code: SESSION_WRITER_RPC_CODES.session_writer_unavailable,
6602
- message: "Session write ownership could not be verified."
6603
- }
6604
- };
6605
- function sessionWriterRpcError(err) {
6606
- if (!err || typeof err !== "object") return void 0;
6607
- const candidate = err;
6608
- const data = isObject(candidate["data"]) ? candidate["data"] : void 0;
6609
- const errorKind = data?.["errorKind"] ?? candidate["errorKind"];
6610
- if (typeof errorKind !== "string" || !(errorKind in SESSION_WRITER_RPC_ERRORS)) {
6611
- return void 0;
6612
- }
6613
- const typedKind = errorKind;
6614
- const expected = SESSION_WRITER_RPC_ERRORS[typedKind];
6615
- const code = candidate["code"] ?? candidate["rpcCode"];
6616
- if (code !== expected.code) return void 0;
6617
- return {
6618
- code: expected.code,
6619
- message: expected.message,
6620
- data: { errorKind: typedKind }
6621
- };
6622
- }
6623
- __name(sessionWriterRpcError, "sessionWriterRpcError");
6624
6563
  var debugLogger2 = createDebugLogger("ACP_HTTP_DISPATCH");
6625
6564
  var SESSION_SHELL_METHOD = `${QWEN_METHOD_NS}session/shell`;
6626
6565
  var INVALID_PERMISSION_OUTCOME_ERROR = '`outcome` must be `{ outcome: "cancelled" }` or `{ outcome: "selected", optionId: string }`';
@@ -6753,11 +6692,10 @@ function parseOptionalWorkspaceCwd2(params, boundWorkspace) {
6753
6692
  `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`
6754
6693
  );
6755
6694
  }
6756
- const sandboxCwd = translateAndCheckAbsoluteWorkspacePath(cwd);
6757
- if (sandboxCwd === null) {
6695
+ if (!path9.isAbsolute(cwd)) {
6758
6696
  throw new AcpParamError("`cwd` must be an absolute path when provided");
6759
6697
  }
6760
- return sandboxCwd;
6698
+ return cwd;
6761
6699
  }
6762
6700
  __name(parseOptionalWorkspaceCwd2, "parseOptionalWorkspaceCwd");
6763
6701
  function validatePrompt(params) {
@@ -6834,8 +6772,6 @@ function pickSessionArtifactInput(params) {
6834
6772
  }
6835
6773
  __name(pickSessionArtifactInput, "pickSessionArtifactInput");
6836
6774
  function toRpcError(err) {
6837
- const writerError = sessionWriterRpcError(err);
6838
- if (writerError) return writerError;
6839
6775
  if (err instanceof AcpParamError || err instanceof InvalidCursorError) {
6840
6776
  return { code: RPC.INVALID_PARAMS, message: err.message };
6841
6777
  }
@@ -7572,21 +7508,22 @@ var AcpDispatcher = class {
7572
7508
  conn.ownedSessions.delete(sessionId);
7573
7509
  conn.closingSessions.add(sessionId);
7574
7510
  let closeStarted = false;
7575
- const closeLocalSessionStream = /* @__PURE__ */ __name(() => {
7511
+ const closeSession = /* @__PURE__ */ __name(async () => {
7512
+ closeStarted = true;
7576
7513
  try {
7577
- conn.closeSessionStream(sessionId);
7578
- } catch (teardownErr) {
7579
- writeStderrLine(
7580
- `qwen serve: /acp session/close local teardown failed (${logSafe(sessionId)}): ${logSafe(errMsg(teardownErr))}`
7514
+ await this.bridge.closeSession(
7515
+ sessionId,
7516
+ this.sessionCtx(conn, sessionId, loopback)
7581
7517
  );
7518
+ } finally {
7519
+ try {
7520
+ conn.closeSessionStream(sessionId);
7521
+ } catch (teardownErr) {
7522
+ writeStderrLine(
7523
+ `qwen serve: /acp session/close local teardown failed (${logSafe(sessionId)}): ${logSafe(errMsg(teardownErr))}`
7524
+ );
7525
+ }
7582
7526
  }
7583
- }, "closeLocalSessionStream");
7584
- const closeSession = /* @__PURE__ */ __name(async () => {
7585
- closeStarted = true;
7586
- await this.bridge.closeSession(
7587
- sessionId,
7588
- this.sessionCtx(conn, sessionId, loopback)
7589
- );
7590
7527
  }, "closeSession");
7591
7528
  try {
7592
7529
  try {
@@ -7608,19 +7545,11 @@ var AcpDispatcher = class {
7608
7545
  } catch (err) {
7609
7546
  if (!closeStarted) {
7610
7547
  conn.ownedSessions.add(sessionId);
7611
- } else {
7612
- try {
7613
- this.bridge.getSessionSummary(sessionId);
7614
- conn.ownedSessions.add(sessionId);
7615
- } catch {
7616
- closeLocalSessionStream();
7617
- }
7618
7548
  }
7619
7549
  throw err;
7620
7550
  } finally {
7621
7551
  conn.closingSessions.delete(sessionId);
7622
7552
  }
7623
- closeLocalSessionStream();
7624
7553
  this.replyConn(conn, id, {});
7625
7554
  return;
7626
7555
  }
@@ -9045,7 +8974,7 @@ var AcpDispatcher = class {
9045
8974
  );
9046
8975
  return;
9047
8976
  }
9048
- const fs5 = this.fsFactory.forRequest({
8977
+ const fs3 = this.fsFactory.forRequest({
9049
8978
  originatorClientId: conn.clientId,
9050
8979
  route: `ACP ${method}`
9051
8980
  });
@@ -9097,8 +9026,8 @@ var AcpDispatcher = class {
9097
9026
  );
9098
9027
  return;
9099
9028
  }
9100
- const resolved = await fs5.resolve(p, "read");
9101
- const out = await fs5.readText(resolved, { maxBytes, line, limit });
9029
+ const resolved = await fs3.resolve(p, "read");
9030
+ const out = await fs3.readText(resolved, { maxBytes, line, limit });
9102
9031
  this.replyConn(conn, id, {
9103
9032
  path: p,
9104
9033
  content: out.content,
@@ -9120,7 +9049,7 @@ var AcpDispatcher = class {
9120
9049
  conn.sendConn(error(id, RPC.INVALID_PARAMS, "`path` required"));
9121
9050
  return;
9122
9051
  }
9123
- const fs5 = this.fsFactory.forRequest({
9052
+ const fs3 = this.fsFactory.forRequest({
9124
9053
  originatorClientId: conn.clientId,
9125
9054
  route: `ACP ${method}`
9126
9055
  });
@@ -9156,8 +9085,8 @@ var AcpDispatcher = class {
9156
9085
  );
9157
9086
  return;
9158
9087
  }
9159
- const resolved = await fs5.resolve(p, "read");
9160
- const buf = await fs5.readBytesWindow(resolved, { offset, maxBytes });
9088
+ const resolved = await fs3.resolve(p, "read");
9089
+ const buf = await fs3.readBytesWindow(resolved, { offset, maxBytes });
9161
9090
  this.replyConn(conn, id, { path: p, ...buf });
9162
9091
  return;
9163
9092
  }
@@ -9175,12 +9104,12 @@ var AcpDispatcher = class {
9175
9104
  conn.sendConn(error(id, RPC.INVALID_PARAMS, "`path` required"));
9176
9105
  return;
9177
9106
  }
9178
- const fs5 = this.fsFactory.forRequest({
9107
+ const fs3 = this.fsFactory.forRequest({
9179
9108
  originatorClientId: conn.clientId,
9180
9109
  route: `ACP ${method}`
9181
9110
  });
9182
- const resolved = await fs5.resolve(p, "read");
9183
- const result = await fs5.stat(resolved);
9111
+ const resolved = await fs3.resolve(p, "read");
9112
+ const result = await fs3.stat(resolved);
9184
9113
  this.replyConn(conn, id, { path: p, ...result });
9185
9114
  return;
9186
9115
  }
@@ -9198,13 +9127,13 @@ var AcpDispatcher = class {
9198
9127
  conn.sendConn(error(id, RPC.INVALID_PARAMS, "`path` required"));
9199
9128
  return;
9200
9129
  }
9201
- const fs5 = this.fsFactory.forRequest({
9130
+ const fs3 = this.fsFactory.forRequest({
9202
9131
  originatorClientId: conn.clientId,
9203
9132
  route: `ACP ${method}`
9204
9133
  });
9205
- const resolved = await fs5.resolve(p, "read");
9134
+ const resolved = await fs3.resolve(p, "read");
9206
9135
  const MAX_LIST = 2e3;
9207
- const entries = await fs5.list(resolved, { maxEntries: MAX_LIST + 1 });
9136
+ const entries = await fs3.list(resolved, { maxEntries: MAX_LIST + 1 });
9208
9137
  const truncated = entries.length > MAX_LIST;
9209
9138
  this.replyConn(conn, id, {
9210
9139
  path: p,
@@ -9229,7 +9158,7 @@ var AcpDispatcher = class {
9229
9158
  );
9230
9159
  return;
9231
9160
  }
9232
- const fs5 = this.fsFactory.forRequest({
9161
+ const fs3 = this.fsFactory.forRequest({
9233
9162
  originatorClientId: conn.clientId,
9234
9163
  route: `ACP ${method}`
9235
9164
  });
@@ -9249,7 +9178,7 @@ var AcpDispatcher = class {
9249
9178
  );
9250
9179
  return;
9251
9180
  }
9252
- const matches = await fs5.glob(pattern, {
9181
+ const matches = await fs3.glob(pattern, {
9253
9182
  maxResults: maxResults + 1
9254
9183
  });
9255
9184
  const truncated = matches.length > maxResults;
@@ -9281,11 +9210,11 @@ var AcpDispatcher = class {
9281
9210
  );
9282
9211
  return;
9283
9212
  }
9284
- const fs5 = this.fsFactory.forRequest({
9213
+ const fs3 = this.fsFactory.forRequest({
9285
9214
  originatorClientId: conn.clientId,
9286
9215
  route: `ACP ${method}`
9287
9216
  });
9288
- const resolved = await fs5.resolve(p, "write");
9217
+ const resolved = await fs3.resolve(p, "write");
9289
9218
  if (Buffer.byteLength(params["content"], "utf8") > 10 * 1024 * 1024) {
9290
9219
  if (id !== void 0)
9291
9220
  conn.sendConn(
@@ -9293,7 +9222,7 @@ var AcpDispatcher = class {
9293
9222
  );
9294
9223
  return;
9295
9224
  }
9296
- await fs5.writeTextOverwrite(resolved, params["content"]);
9225
+ await fs3.writeTextOverwrite(resolved, params["content"]);
9297
9226
  this.replyConn(conn, id, { ok: true, path: p });
9298
9227
  return;
9299
9228
  }
@@ -9322,12 +9251,12 @@ var AcpDispatcher = class {
9322
9251
  );
9323
9252
  return;
9324
9253
  }
9325
- const fs5 = this.fsFactory.forRequest({
9254
+ const fs3 = this.fsFactory.forRequest({
9326
9255
  originatorClientId: conn.clientId,
9327
9256
  route: `ACP ${method}`
9328
9257
  });
9329
- const resolved = await fs5.resolve(p, "write");
9330
- const result = await fs5.edit(
9258
+ const resolved = await fs3.resolve(p, "write");
9259
+ const result = await fs3.edit(
9331
9260
  resolved,
9332
9261
  params["oldText"],
9333
9262
  params["newText"]
@@ -10870,9 +10799,9 @@ var SseStream = class {
10870
10799
  return next;
10871
10800
  }
10872
10801
  doWrite(chunk) {
10873
- return new Promise((resolve6, reject) => {
10802
+ return new Promise((resolve5, reject) => {
10874
10803
  if (this.closed || this.res.writableEnded) {
10875
- resolve6();
10804
+ resolve5();
10876
10805
  return;
10877
10806
  }
10878
10807
  let ok;
@@ -10883,7 +10812,7 @@ var SseStream = class {
10883
10812
  return;
10884
10813
  }
10885
10814
  if (ok) {
10886
- resolve6();
10815
+ resolve5();
10887
10816
  return;
10888
10817
  }
10889
10818
  const cleanup = /* @__PURE__ */ __name(() => {
@@ -10893,11 +10822,11 @@ var SseStream = class {
10893
10822
  }, "cleanup");
10894
10823
  const onDrain = /* @__PURE__ */ __name(() => {
10895
10824
  cleanup();
10896
- resolve6();
10825
+ resolve5();
10897
10826
  }, "onDrain");
10898
10827
  const onCloseEv = /* @__PURE__ */ __name(() => {
10899
10828
  cleanup();
10900
- resolve6();
10829
+ resolve5();
10901
10830
  }, "onCloseEv");
10902
10831
  const onErrorEv = /* @__PURE__ */ __name((err) => {
10903
10832
  cleanup();
@@ -10959,14 +10888,14 @@ var WsStream = class {
10959
10888
  send(message, _id) {
10960
10889
  const data = JSON.stringify(message);
10961
10890
  const next = this.writeChain.then(
10962
- () => new Promise((resolve6, reject) => {
10891
+ () => new Promise((resolve5, reject) => {
10963
10892
  if (this._closed) {
10964
- resolve6();
10893
+ resolve5();
10965
10894
  return;
10966
10895
  }
10967
10896
  this.ws.send(data, (err) => {
10968
10897
  if (err) reject(err);
10969
- else resolve6();
10898
+ else resolve5();
10970
10899
  });
10971
10900
  })
10972
10901
  );
@@ -11271,7 +11200,7 @@ var CdpReverseLink = class {
11271
11200
  throw { code: -32e3, message: "CDP tunnel closed" };
11272
11201
  }
11273
11202
  await this.attach();
11274
- return new Promise((resolve6, reject) => {
11203
+ return new Promise((resolve5, reject) => {
11275
11204
  if (this.disposed) {
11276
11205
  reject({ code: -32e3, message: "CDP tunnel closed" });
11277
11206
  return;
@@ -11282,7 +11211,7 @@ var CdpReverseLink = class {
11282
11211
  `CDP command id=${id} method=${method} timed out after ${this.commandTimeoutMs}ms`
11283
11212
  );
11284
11213
  const progressTimer = this.armProgressLog(id, method);
11285
- this.pending.set(id, { resolve: resolve6, reject, timer, progressTimer });
11214
+ this.pending.set(id, { resolve: resolve5, reject, timer, progressTimer });
11286
11215
  try {
11287
11216
  this.log?.(
11288
11217
  `qwen serve: /cdp forwarded command id=${id} method=${method} to extension`
@@ -11309,7 +11238,7 @@ var CdpReverseLink = class {
11309
11238
  if (this.attached) return Promise.resolve({});
11310
11239
  if (this.attachPromise) return this.attachPromise;
11311
11240
  this.attachPromise = new Promise(
11312
- (resolve6, reject) => {
11241
+ (resolve5, reject) => {
11313
11242
  if (this.disposed) {
11314
11243
  reject({ code: -32e3, message: "CDP tunnel closed" });
11315
11244
  return;
@@ -11319,7 +11248,7 @@ var CdpReverseLink = class {
11319
11248
  this.pendingAttach = {
11320
11249
  id,
11321
11250
  pending: {
11322
- resolve: /* @__PURE__ */ __name((result) => resolve6(result ?? {}), "resolve"),
11251
+ resolve: /* @__PURE__ */ __name((result) => resolve5(result ?? {}), "resolve"),
11323
11252
  reject,
11324
11253
  timer
11325
11254
  }
@@ -11887,7 +11816,7 @@ function isAcpChannelUnavailable(err) {
11887
11816
  }
11888
11817
  __name(isAcpChannelUnavailable, "isAcpChannelUnavailable");
11889
11818
  function delay(ms) {
11890
- return new Promise((resolve6) => setTimeout(resolve6, ms));
11819
+ return new Promise((resolve5) => setTimeout(resolve5, ms));
11891
11820
  }
11892
11821
  __name(delay, "delay");
11893
11822
  function buildChromeDevToolsMcpRuntimeConfig(localPort, hostname, env) {
@@ -13768,7 +13697,7 @@ var CdpTunnelRegistry = class {
13768
13697
  // packages/cli/src/serve/web-shell-static.ts
13769
13698
  init_esbuild_shims();
13770
13699
  var import_express2 = __toESM(require_express(), 1);
13771
- import * as path9 from "node:path";
13700
+ import * as path10 from "node:path";
13772
13701
  var WEB_SHELL_CSP_DIRECTIVES = [
13773
13702
  "default-src 'self'",
13774
13703
  "script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",
@@ -13796,7 +13725,7 @@ function isDocumentNavigation(req) {
13796
13725
  }
13797
13726
  __name(isDocumentNavigation, "isDocumentNavigation");
13798
13727
  function createSendIndex(webShellDir, frameAncestors = []) {
13799
- const indexPath = path9.join(webShellDir, "index.html");
13728
+ const indexPath = path10.join(webShellDir, "index.html");
13800
13729
  const csp = buildWebShellCsp(frameAncestors);
13801
13730
  return (res) => {
13802
13731
  res.status(200).set("Content-Security-Policy", csp).set("X-Content-Type-Options", "nosniff").set("Referrer-Policy", "no-referrer").set(
@@ -13832,7 +13761,7 @@ function mountWebShellAssets(app, webShellDir, frameAncestors = []) {
13832
13761
  const sendIndex = createSendIndex(webShellDir, frameAncestors);
13833
13762
  app.use(
13834
13763
  "/assets",
13835
- import_express2.default.static(path9.join(webShellDir, "assets"), {
13764
+ import_express2.default.static(path10.join(webShellDir, "assets"), {
13836
13765
  index: false,
13837
13766
  immutable: true,
13838
13767
  maxAge: "1y"
@@ -15177,7 +15106,7 @@ function createFifoTaskQueue(limit) {
15177
15106
  Promise.resolve().then(() => item.task(release)).then(item.resolve, item.reject).finally(release);
15178
15107
  }
15179
15108
  }, "pump");
15180
- const enqueue = /* @__PURE__ */ __name((task, options = {}) => new Promise((resolve6, reject) => {
15109
+ const enqueue = /* @__PURE__ */ __name((task, options = {}) => new Promise((resolve5, reject) => {
15181
15110
  if (options.signal?.aborted) {
15182
15111
  reject(abortReason(options.signal));
15183
15112
  return;
@@ -15186,7 +15115,7 @@ function createFifoTaskQueue(limit) {
15186
15115
  task,
15187
15116
  ...options.signal ? { signal: options.signal } : {},
15188
15117
  ...options.onStart ? { onStart: options.onStart } : {},
15189
- resolve: resolve6,
15118
+ resolve: resolve5,
15190
15119
  reject
15191
15120
  };
15192
15121
  if (options.signal) {
@@ -15228,14 +15157,6 @@ var redactExtensionDisplaySource = /* @__PURE__ */ __name((source) => {
15228
15157
  var EXTENSION_PREPARATION_CONCURRENCY = 2;
15229
15158
  var EXTENSION_REFRESH_TIMEOUT_MS = 3e4;
15230
15159
  var RECONCILE_SLOW_MS = 3e4;
15231
- var resolveExtensionLocale = /* @__PURE__ */ __name((workspaceDir) => {
15232
- const configuredLanguage = loadSettings(workspaceDir).merged.general?.language;
15233
- const requestedLocale = resolveLanguageSetting(configuredLanguage);
15234
- if (requestedLocale === "auto") {
15235
- return detectSystemLanguage();
15236
- }
15237
- return resolveSupportedLanguage(requestedLocale) ?? requestedLocale;
15238
- }, "resolveExtensionLocale");
15239
15160
  var EXTENSION_QUEUE_FULL_MESSAGE = "Extension operation queue is full";
15240
15161
  function createExtensionsController(deps) {
15241
15162
  const { boundWorkspace, bridge, workspace } = deps;
@@ -15263,7 +15184,6 @@ function createExtensionsController(deps) {
15263
15184
  }, "acquireOperationSlot");
15264
15185
  const createExtensionManager = /* @__PURE__ */ __name((workspaceDir = boundWorkspace, trustedOverride, interactions) => new ExtensionManager({
15265
15186
  workspaceDir,
15266
- locale: resolveExtensionLocale(workspaceDir),
15267
15187
  isWorkspaceTrusted: trustedOverride ?? getWorkspaceTrustStatus(loadSettings(workspaceDir).merged, workspaceDir).effective.state === "trusted",
15268
15188
  requestConsent: /* @__PURE__ */ __name(() => Promise.resolve(), "requestConsent"),
15269
15189
  networkPolicy: "public",
@@ -15791,9 +15711,8 @@ function createExtensionsController(deps) {
15791
15711
  })();
15792
15712
  }, "runQueuedExtensionMutation");
15793
15713
  const buildLocalExtensionsStatus = /* @__PURE__ */ __name(async () => {
15794
- const locale = resolveExtensionLocale(boundWorkspace);
15795
15714
  const now = Date.now();
15796
- if (extensionsStatusCache?.locale === locale && extensionsStatusCache.expiresAt > now) {
15715
+ if (extensionsStatusCache && extensionsStatusCache.expiresAt > now) {
15797
15716
  return extensionsStatusCache.value;
15798
15717
  }
15799
15718
  const extensionManager = createExtensionManager();
@@ -15849,7 +15768,6 @@ function createExtensionsController(deps) {
15849
15768
  extensions: entries
15850
15769
  };
15851
15770
  extensionsStatusCache = {
15852
- locale,
15853
15771
  expiresAt: Date.now() + 2e3,
15854
15772
  value: status
15855
15773
  };
@@ -16018,7 +15936,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16018
15936
  ...interaction,
16019
15937
  id: crypto2.randomUUID()
16020
15938
  };
16021
- return new Promise((resolve6, reject) => {
15939
+ return new Promise((resolve5, reject) => {
16022
15940
  const timeout = setTimeout(() => {
16023
15941
  pendingExtensionInteractions.delete(operationId);
16024
15942
  controller.updateOperation(operationId, {
@@ -16032,7 +15950,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16032
15950
  timeout.unref?.();
16033
15951
  pendingExtensionInteractions.set(operationId, {
16034
15952
  interaction: pendingInteraction,
16035
- resolve: resolve6,
15953
+ resolve: resolve5,
16036
15954
  reject,
16037
15955
  timeout
16038
15956
  });
@@ -16077,8 +15995,8 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16077
15995
  const reserveRuntimeReconciliation = /* @__PURE__ */ __name(() => {
16078
15996
  let provideTask;
16079
15997
  const task = new Promise(
16080
- (resolve6) => {
16081
- provideTask = resolve6;
15998
+ (resolve5) => {
15999
+ provideTask = resolve5;
16082
16000
  }
16083
16001
  );
16084
16002
  const queued = runtimeReconciliationQueue.run(async () => {
@@ -16179,9 +16097,9 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16179
16097
  generationPoller.unref();
16180
16098
  app.locals.stopExtensionGenerationReconciler = () => clearInterval(generationPoller);
16181
16099
  }
16182
- const registerFor = /* @__PURE__ */ __name((base, resolve6) => {
16100
+ const registerFor = /* @__PURE__ */ __name((base, resolve5) => {
16183
16101
  app.get(base, async (req, res) => {
16184
- const ctrl = resolve6(req, res, false);
16102
+ const ctrl = resolve5(req, res, false);
16185
16103
  if (!ctrl) return;
16186
16104
  try {
16187
16105
  res.status(200).json(await ctrl.buildLocalExtensionsStatus());
@@ -16190,12 +16108,12 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16190
16108
  }
16191
16109
  });
16192
16110
  app.get(`${base}/operations`, async (req, res) => {
16193
- const ctrl = resolve6(req, res, false);
16111
+ const ctrl = resolve5(req, res, false);
16194
16112
  if (!ctrl) return;
16195
16113
  res.status(200).json({ v: 1, operations: ctrl.getActiveOperations() });
16196
16114
  });
16197
16115
  app.get(`${base}/operations/:operationId`, async (req, res) => {
16198
- const ctrl = resolve6(req, res, false);
16116
+ const ctrl = resolve5(req, res, false);
16199
16117
  if (!ctrl) return;
16200
16118
  try {
16201
16119
  const operationId = req.params["operationId"];
@@ -16239,7 +16157,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16239
16157
  `${base}/operations/:operationId/interactions/:interactionId`,
16240
16158
  mutate({ strict: true }),
16241
16159
  async (req, res) => {
16242
- const ctrl = resolve6(req, res, false);
16160
+ const ctrl = resolve5(req, res, false);
16243
16161
  if (!ctrl) return;
16244
16162
  try {
16245
16163
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16308,7 +16226,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16308
16226
  }
16309
16227
  );
16310
16228
  app.post(`${base}/install`, mutate({ strict: true }), async (req, res) => {
16311
- const ctrl = resolve6(req, res, true);
16229
+ const ctrl = resolve5(req, res, true);
16312
16230
  if (!ctrl) return;
16313
16231
  try {
16314
16232
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16491,7 +16409,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16491
16409
  `${base}/check-updates`,
16492
16410
  mutate({ strict: true }),
16493
16411
  async (req, res) => {
16494
- const ctrl = resolve6(req, res, true);
16412
+ const ctrl = resolve5(req, res, true);
16495
16413
  if (!ctrl) return;
16496
16414
  let timer;
16497
16415
  let releaseOperationSlot;
@@ -16555,7 +16473,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16555
16473
  }
16556
16474
  );
16557
16475
  app.post(`${base}/refresh`, mutate({ strict: true }), async (req, res) => {
16558
- const ctrl = resolve6(req, res, true);
16476
+ const ctrl = resolve5(req, res, true);
16559
16477
  if (!ctrl) return;
16560
16478
  try {
16561
16479
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16579,7 +16497,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16579
16497
  `${base}/:name/enable`,
16580
16498
  mutate({ strict: true }),
16581
16499
  async (req, res) => {
16582
- const ctrl = resolve6(req, res, true);
16500
+ const ctrl = resolve5(req, res, true);
16583
16501
  if (!ctrl) return;
16584
16502
  try {
16585
16503
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16626,7 +16544,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16626
16544
  `${base}/:name/disable`,
16627
16545
  mutate({ strict: true }),
16628
16546
  async (req, res) => {
16629
- const ctrl = resolve6(req, res, true);
16547
+ const ctrl = resolve5(req, res, true);
16630
16548
  if (!ctrl) return;
16631
16549
  try {
16632
16550
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16673,7 +16591,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16673
16591
  `${base}/:name/update`,
16674
16592
  mutate({ strict: true }),
16675
16593
  async (req, res) => {
16676
- const ctrl = resolve6(req, res, true);
16594
+ const ctrl = resolve5(req, res, true);
16677
16595
  if (!ctrl) return;
16678
16596
  try {
16679
16597
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -16756,7 +16674,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
16756
16674
  }
16757
16675
  );
16758
16676
  app.delete(`${base}/:name`, mutate({ strict: true }), async (req, res) => {
16759
- const ctrl = resolve6(req, res, true);
16677
+ const ctrl = resolve5(req, res, true);
16760
16678
  if (!ctrl) return;
16761
16679
  try {
16762
16680
  if (!ctrl.validateExtensionMutationClient(req, res, {
@@ -17518,13 +17436,13 @@ async function handlePostFileWrite(req, res, deps) {
17518
17436
  req
17519
17437
  );
17520
17438
  if (originatorClientId === null) return;
17521
- const fs5 = factory.forRequest({
17439
+ const fs3 = factory.forRequest({
17522
17440
  originatorClientId,
17523
17441
  route: ROUTE2
17524
17442
  });
17525
17443
  try {
17526
- const resolved = await fs5.resolve(queryPath, "write");
17527
- const out = await fs5.writeTextAtomic(resolved, content, {
17444
+ const resolved = await fs3.resolve(queryPath, "write");
17445
+ const out = await fs3.writeTextAtomic(resolved, content, {
17528
17446
  mode,
17529
17447
  ...expectedHash ? { expectedHash } : {},
17530
17448
  ...bom !== void 0 ? { bom } : {},
@@ -17577,13 +17495,13 @@ async function handlePostFileEdit(req, res, deps) {
17577
17495
  req
17578
17496
  );
17579
17497
  if (originatorClientId === null) return;
17580
- const fs5 = factory.forRequest({
17498
+ const fs3 = factory.forRequest({
17581
17499
  originatorClientId,
17582
17500
  route: ROUTE2
17583
17501
  });
17584
17502
  try {
17585
- const resolved = await fs5.resolve(queryPath, "edit");
17586
- const out = await fs5.editAtomic(resolved, oldText, newText, {
17503
+ const resolved = await fs3.resolve(queryPath, "edit");
17504
+ const out = await fs3.editAtomic(resolved, oldText, newText, {
17587
17505
  expectedHash
17588
17506
  });
17589
17507
  applyReadHeaders(res);
@@ -17617,7 +17535,7 @@ function registerWorkspaceFileWriteRoutes(app, deps) {
17617
17535
  }
17618
17536
  __name(registerWorkspaceFileWriteRoutes, "registerWorkspaceFileWriteRoutes");
17619
17537
  function registerWorkspaceQualifiedFileWriteRoutes(app, deps) {
17620
- const resolve6 = /* @__PURE__ */ __name((req, res) => {
17538
+ const resolve5 = /* @__PURE__ */ __name((req, res) => {
17621
17539
  const runtime = resolveWorkspaceRuntimeFromParam(
17622
17540
  deps.workspaceRegistry,
17623
17541
  req,
@@ -17635,7 +17553,7 @@ function registerWorkspaceQualifiedFileWriteRoutes(app, deps) {
17635
17553
  "/workspaces/:workspace/file/write",
17636
17554
  deps.mutate({ strict: true }),
17637
17555
  (req, res) => {
17638
- if (!resolve6(req, res)) return;
17556
+ if (!resolve5(req, res)) return;
17639
17557
  void handlePostFileWrite(req, res, deps);
17640
17558
  }
17641
17559
  );
@@ -17643,7 +17561,7 @@ function registerWorkspaceQualifiedFileWriteRoutes(app, deps) {
17643
17561
  "/workspaces/:workspace/file/edit",
17644
17562
  deps.mutate({ strict: true }),
17645
17563
  (req, res) => {
17646
- if (!resolve6(req, res)) return;
17564
+ if (!resolve5(req, res)) return;
17647
17565
  void handlePostFileEdit(req, res, deps);
17648
17566
  }
17649
17567
  );
@@ -18388,7 +18306,7 @@ function daemonTelemetryMiddleware(resolveWorkspaceCwd, recordRequest) {
18388
18306
  deferredRuntimePath: deferredRuntime.path
18389
18307
  } : {}
18390
18308
  },
18391
- async (span) => await new Promise((resolve6, reject) => {
18309
+ async (span) => await new Promise((resolve5, reject) => {
18392
18310
  let done = false;
18393
18311
  const finish = /* @__PURE__ */ __name(() => {
18394
18312
  if (done) return;
@@ -18418,7 +18336,7 @@ function daemonTelemetryMiddleware(resolveWorkspaceCwd, recordRequest) {
18418
18336
  if (!successfulSse && route.route !== "GET /daemon/status" && route.route !== "POST /session/:id/heartbeat") {
18419
18337
  recordRequest?.(durationMs, res.statusCode);
18420
18338
  }
18421
- resolve6();
18339
+ resolve5();
18422
18340
  }, "finish");
18423
18341
  res.once("finish", finish);
18424
18342
  res.once("close", finish);
@@ -18593,11 +18511,21 @@ __name(registerPermissionRoutes, "registerPermissionRoutes");
18593
18511
  // packages/cli/src/serve/routes/session.ts
18594
18512
  init_esbuild_shims();
18595
18513
  import * as crypto3 from "node:crypto";
18596
- import * as fs3 from "node:fs";
18597
- import * as path10 from "node:path";
18514
+ import * as path11 from "node:path";
18598
18515
 
18599
18516
  // packages/cli/src/serve/server/prompt-deadline.ts
18600
18517
  init_esbuild_shims();
18518
+ var PromptDeadlineExceededError = class extends Error {
18519
+ static {
18520
+ __name(this, "PromptDeadlineExceededError");
18521
+ }
18522
+ deadlineMs;
18523
+ constructor(deadlineMs) {
18524
+ super(`prompt exceeded the ${deadlineMs}ms deadline`);
18525
+ this.name = "PromptDeadlineExceededError";
18526
+ this.deadlineMs = deadlineMs;
18527
+ }
18528
+ };
18601
18529
  function resolvePromptDeadlineMs(serverMs, requestMs) {
18602
18530
  if (serverMs === void 0 || !Number.isFinite(serverMs) || serverMs <= 0) {
18603
18531
  return void 0;
@@ -18707,25 +18635,6 @@ function encodeMetadataSessionCursor(last, filter, archiveState) {
18707
18635
  ).toString("base64url");
18708
18636
  }
18709
18637
  __name(encodeMetadataSessionCursor, "encodeMetadataSessionCursor");
18710
- async function enrichWorktreeSidecars(bySessionId, sessionService, archiveState = "active") {
18711
- for (const [sessionId, summary] of bySessionId) {
18712
- if (summary.worktree) continue;
18713
- const sidecar = await readWorktreeSession(
18714
- sessionService.getWorktreeSessionPathForArchiveState(
18715
- sessionId,
18716
- archiveState
18717
- )
18718
- ).catch(() => null);
18719
- if (sidecar) {
18720
- summary.worktree = {
18721
- slug: sidecar.slug,
18722
- path: sidecar.worktreePath,
18723
- branch: sidecar.worktreeBranch
18724
- };
18725
- }
18726
- }
18727
- }
18728
- __name(enrichWorktreeSidecars, "enrichWorktreeSidecars");
18729
18638
  function toSummary2(item) {
18730
18639
  return {
18731
18640
  sessionId: item.sessionId,
@@ -18871,7 +18780,6 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
18871
18780
  applyOrganization(session, snapshot.sessions.get(session.sessionId))
18872
18781
  );
18873
18782
  }
18874
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
18875
18783
  if (readOptions.mergeLive !== false && archiveState !== "archived" && isFirstPage) {
18876
18784
  try {
18877
18785
  const liveSessions = bridge.listWorkspaceSessions(workspaceCwd);
@@ -18957,7 +18865,6 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
18957
18865
  for (const session of persisted.sessions) {
18958
18866
  bySessionId.set(session.sessionId, session);
18959
18867
  }
18960
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
18961
18868
  let liveMergeFailed = false;
18962
18869
  if (readOptions.mergeLive !== false && archiveState !== "archived") {
18963
18870
  try {
@@ -19060,7 +18967,6 @@ async function listWorkspaceSessionsForResponse(bridge, workspaceCwd, options, r
19060
18967
  for (const item of persisted.items) {
19061
18968
  bySessionId.set(item.sessionId, toSummary2(item));
19062
18969
  }
19063
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
19064
18970
  if (archiveState === "archived" || readOptions.mergeLive === false) {
19065
18971
  const sessions2 = [...bySessionId.values()];
19066
18972
  const nextCursor2 = persisted.nextCursor != null ? String(persisted.nextCursor) : void 0;
@@ -19232,7 +19138,7 @@ function writeGenerationSseChunk(res, chunk) {
19232
19138
  if (writable) {
19233
19139
  return res.destroyed ? Promise.reject(new Error("Generation SSE connection destroyed")) : Promise.resolve();
19234
19140
  }
19235
- return new Promise((resolve6, reject) => {
19141
+ return new Promise((resolve5, reject) => {
19236
19142
  const cleanup = /* @__PURE__ */ __name(() => {
19237
19143
  res.off("drain", onDrain);
19238
19144
  res.off("close", onClose);
@@ -19240,7 +19146,7 @@ function writeGenerationSseChunk(res, chunk) {
19240
19146
  }, "cleanup");
19241
19147
  const onDrain = /* @__PURE__ */ __name(() => {
19242
19148
  cleanup();
19243
- resolve6();
19149
+ resolve5();
19244
19150
  }, "onDrain");
19245
19151
  const onClose = /* @__PURE__ */ __name(() => {
19246
19152
  cleanup();
@@ -19524,7 +19430,7 @@ function registerSessionRoutes(app, deps) {
19524
19430
  const workspaceParam = req.params[paramName] ?? "";
19525
19431
  const byId = workspaceRegistry.getByWorkspaceId(workspaceParam);
19526
19432
  if (byId) return byId;
19527
- if (!path10.isAbsolute(workspaceParam)) {
19433
+ if (!path11.isAbsolute(workspaceParam)) {
19528
19434
  res.status(400).json({
19529
19435
  error: `\`:${paramName}\` must decode to a workspace id or absolute path`
19530
19436
  });
@@ -19938,7 +19844,7 @@ function registerSessionRoutes(app, deps) {
19938
19844
  })), "serializeSessionErrors");
19939
19845
  const resolveWorkspaceParam = /* @__PURE__ */ __name((req, res) => {
19940
19846
  const workspaceCwd = req.params["id"] ?? "";
19941
- if (!path10.isAbsolute(workspaceCwd)) {
19847
+ if (!path11.isAbsolute(workspaceCwd)) {
19942
19848
  res.status(400).json({ error: "`:id` must decode to an absolute workspace path" });
19943
19849
  return null;
19944
19850
  }
@@ -20010,68 +19916,6 @@ function registerSessionRoutes(app, deps) {
20010
19916
  }
20011
19917
  const clientId = parseClientIdHeader(req, res);
20012
19918
  if (clientId === null) return;
20013
- let worktreeMeta;
20014
- const rawWorktree = body["worktree"];
20015
- if (rawWorktree !== void 0 && rawWorktree !== null) {
20016
- if (typeof rawWorktree !== "object" || Array.isArray(rawWorktree)) {
20017
- res.status(400).json({
20018
- error: '`worktree` must be an object (e.g. `{}` or `{"slug":"my-task"}`)',
20019
- code: "invalid_worktree"
20020
- });
20021
- return;
20022
- }
20023
- const wtReq = rawWorktree;
20024
- let wtService;
20025
- try {
20026
- wtService = new GitWorktreeService(workspaceCwd);
20027
- } catch {
20028
- res.status(500).json({
20029
- error: "Failed to initialize worktree service",
20030
- code: "worktree_init_failed"
20031
- });
20032
- return;
20033
- }
20034
- if (!await wtService.isGitRepository()) {
20035
- res.status(400).json({
20036
- error: "Worktree isolation requires a git repository",
20037
- code: "worktree_not_git_repo"
20038
- });
20039
- return;
20040
- }
20041
- const rawSlug = wtReq["slug"];
20042
- let slug;
20043
- if (rawSlug === void 0 || rawSlug === null) {
20044
- slug = GitWorktreeService.generateAutoSlug();
20045
- } else if (typeof rawSlug !== "string" || rawSlug.length === 0) {
20046
- res.status(400).json({
20047
- error: "`worktree.slug` must be a non-empty string when provided",
20048
- code: "worktree_invalid_slug"
20049
- });
20050
- return;
20051
- } else {
20052
- slug = rawSlug;
20053
- }
20054
- const slugError = GitWorktreeService.validateUserWorktreeSlug(slug);
20055
- if (slugError) {
20056
- res.status(400).json({ error: slugError, code: "worktree_invalid_slug" });
20057
- return;
20058
- }
20059
- const baseBranch = await wtService.getCurrentBranch().catch(() => void 0);
20060
- const wtResult = await wtService.createUserWorktree(slug, baseBranch);
20061
- if (!wtResult.success || !wtResult.worktree) {
20062
- res.status(500).json({
20063
- error: wtResult.error ?? "Failed to create worktree",
20064
- code: "worktree_create_failed"
20065
- });
20066
- return;
20067
- }
20068
- worktreeMeta = {
20069
- slug,
20070
- path: wtResult.worktree.path,
20071
- branch: wtResult.worktree.branch
20072
- };
20073
- sessionScope = "thread";
20074
- }
20075
19919
  try {
20076
19920
  const session = await runtime.bridge.spawnOrAttach({
20077
19921
  workspaceCwd,
@@ -20080,8 +19924,7 @@ function registerSessionRoutes(app, deps) {
20080
19924
  ...sessionScope !== void 0 ? { sessionScope } : {},
20081
19925
  ...approvalMode !== void 0 ? { approvalMode } : {},
20082
19926
  ...source.sourceType !== void 0 ? { sourceType: source.sourceType } : {},
20083
- ...source.sourceId !== void 0 ? { sourceId: source.sourceId } : {},
20084
- ...worktreeMeta ? { worktree: worktreeMeta } : {}
19927
+ ...source.sourceId !== void 0 ? { sourceId: source.sourceId } : {}
20085
19928
  });
20086
19929
  if (daemonLog) {
20087
19930
  daemonLog.info(
@@ -20108,10 +19951,6 @@ function registerSessionRoutes(app, deps) {
20108
19951
  await new SessionService(runtime.workspaceCwd).removeSession(
20109
19952
  session.sessionId
20110
19953
  );
20111
- if (worktreeMeta) {
20112
- await new GitWorktreeService(workspaceCwd).removeUserWorktree(worktreeMeta.slug, { deleteBranch: true }).catch(() => {
20113
- });
20114
- }
20115
19954
  }
20116
19955
  } catch {
20117
19956
  }
@@ -20121,73 +19960,8 @@ function registerSessionRoutes(app, deps) {
20121
19960
  }
20122
19961
  return;
20123
19962
  }
20124
- if (worktreeMeta) {
20125
- try {
20126
- const createAllowedRoots = [
20127
- path10.join(workspaceCwd, ".qwen", "worktrees")
20128
- ];
20129
- let createRepoTop = null;
20130
- try {
20131
- createRepoTop = await new GitWorktreeService(
20132
- workspaceCwd
20133
- ).getRepoTopLevel();
20134
- } catch {
20135
- }
20136
- if (createRepoTop && createRepoTop !== workspaceCwd) {
20137
- createAllowedRoots.push(
20138
- path10.join(createRepoTop, ".qwen", "worktrees")
20139
- );
20140
- }
20141
- await runtime.bridge.changeSessionCwd(session.sessionId, {
20142
- path: worktreeMeta.path,
20143
- allowedRoots: createAllowedRoots
20144
- });
20145
- await writeWorktreeSessionMarker(
20146
- worktreeMeta.path,
20147
- session.sessionId
20148
- ).catch(() => {
20149
- });
20150
- await writeWorktreeSession(
20151
- new SessionService(workspaceCwd).getWorktreeSessionPath(
20152
- session.sessionId
20153
- ),
20154
- {
20155
- slug: worktreeMeta.slug,
20156
- worktreePath: worktreeMeta.path,
20157
- worktreeBranch: worktreeMeta.branch,
20158
- originalCwd: workspaceCwd,
20159
- originalBranch: "",
20160
- originalHeadCommit: ""
20161
- }
20162
- ).catch(() => {
20163
- });
20164
- } catch (cdErr) {
20165
- if (daemonLog) {
20166
- daemonLog.warn("worktree cd failed, rolling back", {
20167
- sessionId: session.sessionId,
20168
- error: cdErr instanceof Error ? cdErr.message : String(cdErr)
20169
- });
20170
- }
20171
- const killed = await runtime.bridge.killSession(session.sessionId, { requireZeroAttaches: true }).catch(() => false);
20172
- if (killed) {
20173
- await new SessionService(workspaceCwd).removeSession(session.sessionId).catch(() => {
20174
- });
20175
- }
20176
- await new GitWorktreeService(workspaceCwd).removeUserWorktree(worktreeMeta.slug, { deleteBranch: true }).catch(() => {
20177
- });
20178
- res.status(500).json({
20179
- error: "Failed to relocate session into worktree",
20180
- code: "worktree_relocate_failed"
20181
- });
20182
- return;
20183
- }
20184
- }
20185
19963
  res.status(200).json(session);
20186
19964
  } catch (err) {
20187
- if (worktreeMeta) {
20188
- await new GitWorktreeService(workspaceCwd).removeUserWorktree(worktreeMeta.slug, { deleteBranch: true }).catch(() => {
20189
- });
20190
- }
20191
19965
  sendBridgeError2(res, err, { route: "POST /session" });
20192
19966
  }
20193
19967
  });
@@ -20273,72 +20047,6 @@ function registerSessionRoutes(app, deps) {
20273
20047
  }
20274
20048
  return;
20275
20049
  }
20276
- if (!session.worktree) {
20277
- const sidecar = await readWorktreeSession(
20278
- new SessionService(workspaceCwd).getWorktreeSessionPath(sessionId)
20279
- ).catch(() => null);
20280
- if (sidecar) {
20281
- let realTarget;
20282
- const candidateRoots = [
20283
- path10.join(workspaceCwd, ".qwen", "worktrees")
20284
- ];
20285
- try {
20286
- realTarget = fs3.realpathSync(sidecar.worktreePath);
20287
- let repoTop = null;
20288
- try {
20289
- repoTop = await new GitWorktreeService(
20290
- workspaceCwd
20291
- ).getRepoTopLevel();
20292
- } catch {
20293
- }
20294
- if (repoTop && repoTop !== workspaceCwd) {
20295
- candidateRoots.push(path10.join(repoTop, ".qwen", "worktrees"));
20296
- }
20297
- const contained = candidateRoots.some((root) => {
20298
- try {
20299
- const realRoot = fs3.realpathSync(root);
20300
- const rel = path10.relative(realRoot, realTarget);
20301
- return !rel.startsWith("..") && !path10.isAbsolute(rel);
20302
- } catch {
20303
- return false;
20304
- }
20305
- });
20306
- if (!contained) {
20307
- realTarget = void 0;
20308
- }
20309
- } catch {
20310
- realTarget = void 0;
20311
- }
20312
- if (!realTarget) {
20313
- daemonLog?.warn("worktree sidecar path failed containment", {
20314
- sessionId,
20315
- path: sidecar.worktreePath
20316
- });
20317
- } else {
20318
- const wt = {
20319
- slug: sidecar.slug,
20320
- path: realTarget,
20321
- branch: sidecar.worktreeBranch
20322
- };
20323
- try {
20324
- if (!session.hasActivePrompt) {
20325
- await runtime.bridge.changeSessionCwd(sessionId, {
20326
- path: wt.path,
20327
- allowedRoots: candidateRoots
20328
- });
20329
- }
20330
- runtime.bridge.setSessionWorktree(sessionId, wt);
20331
- session.worktree = wt;
20332
- } catch (restoreErr) {
20333
- daemonLog?.warn("worktree restore failed on load/resume", {
20334
- sessionId,
20335
- worktreePath: wt.path,
20336
- error: restoreErr instanceof Error ? restoreErr.message : String(restoreErr)
20337
- });
20338
- }
20339
- }
20340
- }
20341
- }
20342
20050
  res.status(200).json(session);
20343
20051
  } catch (err) {
20344
20052
  sendBridgeError2(res, err, {
@@ -20420,7 +20128,7 @@ function registerSessionRoutes(app, deps) {
20420
20128
  async (req, res, sessionId) => {
20421
20129
  const body = safeBody(req);
20422
20130
  const targetPath = body["path"];
20423
- if (typeof targetPath !== "string" || targetPath.length === 0 || !path10.isAbsolute(targetPath)) {
20131
+ if (typeof targetPath !== "string" || targetPath.length === 0 || !path11.isAbsolute(targetPath)) {
20424
20132
  res.status(400).json({
20425
20133
  error: "`path` is required and must be an absolute path",
20426
20134
  code: "invalid_path"
@@ -20922,6 +20630,15 @@ function registerSessionRoutes(app, deps) {
20922
20630
  promptDeadlineMs,
20923
20631
  requestDeadlineMs
20924
20632
  );
20633
+ let deadlineTimer;
20634
+ if (effectiveDeadlineMs !== void 0) {
20635
+ deadlineTimer = setTimeout(() => {
20636
+ if (!abort.signal.aborted) {
20637
+ abort.abort(new PromptDeadlineExceededError(effectiveDeadlineMs));
20638
+ }
20639
+ }, effectiveDeadlineMs);
20640
+ deadlineTimer.unref();
20641
+ }
20925
20642
  let promptPromise;
20926
20643
  try {
20927
20644
  promptPromise = ownerBridge.sendPrompt(
@@ -20934,11 +20651,11 @@ function registerSessionRoutes(app, deps) {
20934
20651
  abort.signal,
20935
20652
  {
20936
20653
  ...clientId !== void 0 ? { clientId } : {},
20937
- promptId,
20938
- ...effectiveDeadlineMs !== void 0 ? { deadlineMs: effectiveDeadlineMs } : {}
20654
+ promptId
20939
20655
  }
20940
20656
  );
20941
20657
  } catch (err) {
20658
+ if (deadlineTimer !== void 0) clearTimeout(deadlineTimer);
20942
20659
  res.off("close", onResClose);
20943
20660
  res.off("finish", onResFinish);
20944
20661
  if (daemonLog && err instanceof PromptQueueFullError) {
@@ -20983,7 +20700,9 @@ function registerSessionRoutes(app, deps) {
20983
20700
  );
20984
20701
  }
20985
20702
  }
20986
- ).catch(() => {
20703
+ ).finally(() => {
20704
+ if (deadlineTimer !== void 0) clearTimeout(deadlineTimer);
20705
+ }).catch(() => {
20987
20706
  });
20988
20707
  if (daemonLog) {
20989
20708
  daemonLog.info("prompt enqueued", { sessionId, promptId, clientId });
@@ -22856,7 +22575,7 @@ __name(registerUsageStatsRoutes, "registerUsageStatsRoutes");
22856
22575
  // packages/cli/src/serve/scheduled-task-keepalive.ts
22857
22576
  init_esbuild_shims();
22858
22577
  import * as fsSync from "node:fs";
22859
- import * as path11 from "node:path";
22578
+ import * as path12 from "node:path";
22860
22579
  var log = createDebugLogger("SCHED_KEEPALIVE");
22861
22580
  function collectBoundSessionIds(tasks) {
22862
22581
  const seen = /* @__PURE__ */ new Set();
@@ -23067,8 +22786,8 @@ function startScheduledTaskKeepalive(opts) {
23067
22786
  timer.unref?.();
23068
22787
  let bindDebounce;
23069
22788
  const cronFilePath = getCronFilePath(boundWorkspace);
23070
- const cronDir = path11.dirname(cronFilePath);
23071
- const cronFileName = path11.basename(cronFilePath);
22789
+ const cronDir = path12.dirname(cronFilePath);
22790
+ const cronFileName = path12.basename(cronFilePath);
23072
22791
  let fileWatcher;
23073
22792
  try {
23074
22793
  fsSync.mkdirSync(cronDir, { recursive: true });
@@ -23159,7 +22878,7 @@ async function rehydrateScheduledTaskSessions(deps) {
23159
22878
  }
23160
22879
  __name(rehydrateScheduledTaskSessions, "rehydrateScheduledTaskSessions");
23161
22880
  function withTimeout(p, ms, label) {
23162
- return new Promise((resolve6, reject) => {
22881
+ return new Promise((resolve5, reject) => {
23163
22882
  const timer = setTimeout(() => {
23164
22883
  reject(new Error(`${label} timed out after ${ms}ms`));
23165
22884
  }, ms);
@@ -23167,7 +22886,7 @@ function withTimeout(p, ms, label) {
23167
22886
  p.then(
23168
22887
  (v) => {
23169
22888
  clearTimeout(timer);
23170
- resolve6(v);
22889
+ resolve5(v);
23171
22890
  },
23172
22891
  (e) => {
23173
22892
  clearTimeout(timer);
@@ -23251,7 +22970,7 @@ function registerWorkspaceStatusRoutes(app, deps) {
23251
22970
  const ctx = buildWorkspaceCtx("POST /workspace/acp/preheat");
23252
22971
  const timeoutMsRaw = req.query["timeoutMs"];
23253
22972
  const timeoutMs = typeof timeoutMsRaw === "string" && timeoutMsRaw.trim() ? Number(timeoutMsRaw) : void 0;
23254
- if (timeoutMsRaw !== void 0 && (timeoutMs === void 0 || !Number.isFinite(timeoutMs) || !Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_ACP_PREHEAT_TIMEOUT_MS)) {
22973
+ if (timeoutMs !== void 0 && (!Number.isFinite(timeoutMs) || !Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > MAX_ACP_PREHEAT_TIMEOUT_MS)) {
23255
22974
  res.status(400).json({
23256
22975
  error: "`timeoutMs` must be a positive integer no greater than 60000",
23257
22976
  code: "invalid_timeout"
@@ -23585,7 +23304,6 @@ function registerCapabilitiesRoutes(app, deps) {
23585
23304
  workspaces: runtimes.map((runtime) => ({
23586
23305
  id: runtime.workspaceId,
23587
23306
  cwd: runtime.workspaceCwd,
23588
- ...runtime.displayName !== void 0 ? { displayName: runtime.displayName } : {},
23589
23307
  primary: runtime.primary,
23590
23308
  trusted: runtime.trusted,
23591
23309
  ...runtimeRemoval ? { removable: runtime.removable === true } : {}
@@ -24258,12 +23976,6 @@ init_esbuild_shims();
24258
23976
 
24259
23977
  // packages/cli/src/serve/server/error-response.ts
24260
23978
  init_esbuild_shims();
24261
- var SESSION_WRITER_ERROR_MESSAGES = {
24262
- session_writer_conflict: "This session is already open in another Qwen process.",
24263
- session_writer_lost: "Write ownership for this session was lost.",
24264
- session_transcript_changed: "The session transcript changed outside its active writer.",
24265
- session_writer_unavailable: "Session write ownership could not be verified."
24266
- };
24267
23979
  function bridgeErrorExtraContext(ctx) {
24268
23980
  const extra = {};
24269
23981
  for (const [key, value] of Object.entries(ctx ?? {})) {
@@ -24316,14 +24028,6 @@ function sendPermissionVoteError(res, err, ctx, daemonLog) {
24316
24028
  }
24317
24029
  __name(sendPermissionVoteError, "sendPermissionVoteError");
24318
24030
  function sendBridgeError(res, err, ctx, daemonLog) {
24319
- if (err instanceof SessionWriterError) {
24320
- res.status(err.httpStatus).json({
24321
- error: err.message,
24322
- code: err.errorKind,
24323
- errorKind: err.errorKind
24324
- });
24325
- return;
24326
- }
24327
24031
  if (err instanceof WorkspaceSkillNotFoundError) {
24328
24032
  res.status(404).json({
24329
24033
  error: err.message,
@@ -24636,22 +24340,6 @@ function sendBridgeError(res, err, ctx, daemonLog) {
24636
24340
  const data = err.data;
24637
24341
  if (data && typeof data === "object") {
24638
24342
  const kind = data.errorKind;
24639
- if (kind === "session_writer_conflict" || kind === "session_writer_lost" || kind === "session_transcript_changed") {
24640
- res.status(409).json({
24641
- error: SESSION_WRITER_ERROR_MESSAGES[kind],
24642
- code: kind,
24643
- errorKind: kind
24644
- });
24645
- return;
24646
- }
24647
- if (kind === "session_writer_unavailable") {
24648
- res.status(503).json({
24649
- error: SESSION_WRITER_ERROR_MESSAGES[kind],
24650
- code: kind,
24651
- errorKind: kind
24652
- });
24653
- return;
24654
- }
24655
24343
  if (kind === "mcp_budget_would_exceed") {
24656
24344
  const d = data;
24657
24345
  res.status(409).json({
@@ -24928,9 +24616,9 @@ function registerSseEventsRoutes(app, deps) {
24928
24616
  let writeChain = Promise.resolve();
24929
24617
  const trackWriterIdle = writerIdleTimeoutMs !== void 0 && writerIdleTimeoutMs > 0;
24930
24618
  let lastWriteAt = trackWriterIdle ? Date.now() : 0;
24931
- const doWrite = /* @__PURE__ */ __name((chunk) => new Promise((resolve6, reject) => {
24619
+ const doWrite = /* @__PURE__ */ __name((chunk) => new Promise((resolve5, reject) => {
24932
24620
  if (res.writableEnded) {
24933
- resolve6();
24621
+ resolve5();
24934
24622
  return;
24935
24623
  }
24936
24624
  let ok;
@@ -24942,19 +24630,19 @@ function registerSseEventsRoutes(app, deps) {
24942
24630
  }
24943
24631
  if (ok) {
24944
24632
  if (trackWriterIdle) lastWriteAt = Date.now();
24945
- resolve6();
24633
+ resolve5();
24946
24634
  return;
24947
24635
  }
24948
24636
  const onDrain = /* @__PURE__ */ __name(() => {
24949
24637
  res.off("close", onClose);
24950
24638
  res.off("error", onError);
24951
24639
  if (trackWriterIdle) lastWriteAt = Date.now();
24952
- resolve6();
24640
+ resolve5();
24953
24641
  }, "onDrain");
24954
24642
  const onClose = /* @__PURE__ */ __name(() => {
24955
24643
  res.off("drain", onDrain);
24956
24644
  res.off("error", onError);
24957
- resolve6();
24645
+ resolve5();
24958
24646
  }, "onClose");
24959
24647
  const onError = /* @__PURE__ */ __name((err) => {
24960
24648
  res.off("drain", onDrain);
@@ -25283,7 +24971,7 @@ __name(registerWorkspaceModelsRoutes, "registerWorkspaceModelsRoutes");
25283
24971
  // packages/cli/src/serve/routes/a2ui-action.ts
25284
24972
  init_esbuild_shims();
25285
24973
  import * as fsp4 from "node:fs/promises";
25286
- import * as path12 from "node:path";
24974
+ import * as path13 from "node:path";
25287
24975
  var A2UI_MIME = "application/a2ui+json";
25288
24976
  var ACTION_TOOL = "action";
25289
24977
  var CALL_TIMEOUT_MS = 15e3;
@@ -25306,7 +24994,7 @@ __name(usableServerConfig, "usableServerConfig");
25306
24994
  async function findFromSettingsFile(workspaceCwd) {
25307
24995
  try {
25308
24996
  const raw = await fsp4.readFile(
25309
- path12.join(workspaceCwd, ".qwen", "settings.json"),
24997
+ path13.join(workspaceCwd, ".qwen", "settings.json"),
25310
24998
  "utf8"
25311
24999
  );
25312
25000
  const settings = JSON.parse(raw);
@@ -25443,7 +25131,7 @@ __name(registerA2uiActionRoutes, "registerA2uiActionRoutes");
25443
25131
 
25444
25132
  // packages/cli/src/serve/server/fs-factory.ts
25445
25133
  init_esbuild_shims();
25446
- import * as path13 from "node:path";
25134
+ import * as path14 from "node:path";
25447
25135
  var IDE_WORKSPACE_PATH_ENV_VAR = "QWEN_CODE_IDE_WORKSPACE_PATH";
25448
25136
  function createDefaultFsAuditEmit() {
25449
25137
  const WARN_EVERY = 100;
@@ -25517,14 +25205,14 @@ function parseIdeWorkspacePathEnv(value) {
25517
25205
  const parsed = JSON.parse(value);
25518
25206
  if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
25519
25207
  return parsed.filter(
25520
- (workspace) => workspace.length > 0 && path13.isAbsolute(workspace)
25208
+ (workspace) => workspace.length > 0 && path14.isAbsolute(workspace)
25521
25209
  );
25522
25210
  }
25523
25211
  throw new Error("IDE workspace path JSON must be a string array");
25524
25212
  } catch {
25525
25213
  }
25526
25214
  }
25527
- return value.split(path13.delimiter).filter((workspace) => workspace.length > 0 && path13.isAbsolute(workspace));
25215
+ return value.split(path14.delimiter).filter((workspace) => workspace.length > 0 && path14.isAbsolute(workspace));
25528
25216
  }
25529
25217
  __name(parseIdeWorkspacePathEnv, "parseIdeWorkspacePathEnv");
25530
25218
  function dropNestedWorkspacesPreservingPrimary(workspaces) {
@@ -26030,8 +25718,8 @@ __name(registerWorkspaceQualifiedLifecycleRoutes, "registerWorkspaceQualifiedLif
26030
25718
  // packages/cli/src/serve/routes/workspace-management.ts
26031
25719
  init_esbuild_shims();
26032
25720
  import { readdir, stat } from "node:fs/promises";
26033
- import { realpathSync as realpathSync2 } from "node:fs";
26034
- import { basename as basename4, dirname as dirname4, isAbsolute as isAbsolute7, join as join8, resolve as resolve4, sep as sep3 } from "node:path";
25721
+ import { realpathSync } from "node:fs";
25722
+ import { basename as basename4, dirname as dirname4, isAbsolute as isAbsolute7, join as join7, resolve as resolve4, sep as sep3 } from "node:path";
26035
25723
  var MAX_PATH_SUGGESTIONS = 50;
26036
25724
  function registerWorkspaceManagementRoutes(app, deps) {
26037
25725
  const {
@@ -26062,31 +25750,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
26062
25750
  code: "daemon_shutting_down"
26063
25751
  });
26064
25752
  }, "sendSealed");
26065
- const attachRegistrationIds = /* @__PURE__ */ __name((runtime, registrationIds) => {
26066
- runtime.registrationIds ??= [];
26067
- for (const registrationId of registrationIds) {
26068
- if (!runtime.registrationIds.includes(registrationId)) {
26069
- runtime.registrationIds.push(registrationId);
26070
- }
26071
- }
26072
- }, "attachRegistrationIds");
26073
- const restorePersistedDisplayName = /* @__PURE__ */ __name(async (runtime, canonical) => {
26074
- const snapshot = await workspaceRegistrationStore.read();
26075
- const storedWorkspace = snapshot.workspaces.find(
26076
- (stored) => process.platform === "win32" ? stored.toLowerCase() === canonical.toLowerCase() : stored === canonical
26077
- );
26078
- const storedDisplayName = storedWorkspace ? snapshot.displayNames?.[workspaceRegistrationId(storedWorkspace)] : void 0;
26079
- if (storedWorkspace) {
26080
- attachRegistrationIds(runtime, [
26081
- workspaceRegistrationId(storedWorkspace)
26082
- ]);
26083
- }
26084
- if (storedDisplayName === void 0) {
26085
- delete runtime.displayName;
26086
- } else {
26087
- runtime.displayName = storedDisplayName;
26088
- }
26089
- }, "restorePersistedDisplayName");
26090
25753
  app.get(
26091
25754
  "/workspace-path-suggestions",
26092
25755
  async (req, res) => {
@@ -26114,7 +25777,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
26114
25777
  return;
26115
25778
  }
26116
25779
  const endsWithSep = prefix.endsWith("/") || process.platform === "win32" && prefix.endsWith("\\");
26117
- const dir = endsWithSep ? join8(prefix, ".") : dirname4(prefix);
25780
+ const dir = endsWithSep ? join7(prefix, ".") : dirname4(prefix);
26118
25781
  const filter = endsWithSep ? "" : basename4(prefix);
26119
25782
  const filterLower = filter.toLowerCase();
26120
25783
  const suggestions = [];
@@ -26130,7 +25793,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
26130
25793
  let isDir = entry.isDirectory();
26131
25794
  if (!isDir && entry.isSymbolicLink()) {
26132
25795
  try {
26133
- isDir = (await stat(join8(dir, entry.name))).isDirectory();
25796
+ isDir = (await stat(join7(dir, entry.name))).isDirectory();
26134
25797
  } catch {
26135
25798
  continue;
26136
25799
  }
@@ -26140,7 +25803,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
26140
25803
  truncated = true;
26141
25804
  break;
26142
25805
  }
26143
- suggestions.push({ name: entry.name, path: join8(dir, entry.name) });
25806
+ suggestions.push({ name: entry.name, path: join7(dir, entry.name) });
26144
25807
  }
26145
25808
  } catch {
26146
25809
  }
@@ -26160,20 +25823,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
26160
25823
  const body = safeBody2(req);
26161
25824
  const cwd = body["cwd"];
26162
25825
  const persist = body["persist"] ?? false;
26163
- const hasDisplayName = Object.hasOwn(body, "displayName");
26164
- let displayName;
26165
- if (hasDisplayName) {
26166
- try {
26167
- displayName = normalizeWorkspaceDisplayName(body["displayName"]);
26168
- } catch (err) {
26169
- if (!(err instanceof WorkspaceDisplayNameValidationError)) throw err;
26170
- res.status(400).json({
26171
- error: err.message,
26172
- code: "invalid_display_name"
26173
- });
26174
- return;
26175
- }
26176
- }
26177
25826
  if (typeof cwd !== "string" || cwd.trim().length === 0) {
26178
25827
  res.status(400).json({
26179
25828
  error: "`cwd` must be a non-empty string",
@@ -26202,24 +25851,23 @@ function registerWorkspaceManagementRoutes(app, deps) {
26202
25851
  });
26203
25852
  return;
26204
25853
  }
26205
- if (cwd.length > MAX_WORKSPACE_PATH_LENGTH) {
25854
+ if (!isAbsolute7(cwd)) {
26206
25855
  res.status(400).json({
26207
- error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
25856
+ error: "`cwd` must be an absolute path",
26208
25857
  code: "invalid_path"
26209
25858
  });
26210
25859
  return;
26211
25860
  }
26212
- const sandboxCwd = translateAndCheckAbsoluteWorkspacePath(cwd);
26213
- if (sandboxCwd === null) {
25861
+ if (cwd.length > MAX_WORKSPACE_PATH_LENGTH) {
26214
25862
  res.status(400).json({
26215
- error: "`cwd` must be an absolute path",
25863
+ error: `\`cwd\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
26216
25864
  code: "invalid_path"
26217
25865
  });
26218
25866
  return;
26219
25867
  }
26220
25868
  let canonical;
26221
25869
  try {
26222
- canonical = realpathSync2.native(resolve4(sandboxCwd));
25870
+ canonical = realpathSync.native(resolve4(cwd));
26223
25871
  } catch {
26224
25872
  res.status(400).json({
26225
25873
  error: "Path does not exist or is not accessible",
@@ -26294,12 +25942,11 @@ function registerWorkspaceManagementRoutes(app, deps) {
26294
25942
  operationStarted();
26295
25943
  try {
26296
25944
  const snapshot = await workspaceRegistrationStore.read();
26297
- const persistedWorkspaces = snapshot.workspaces.filter(
25945
+ const alreadyPersisted = snapshot.workspaces.some(
26298
25946
  (stored) => existingRuntime.registrationIds?.includes(
26299
25947
  workspaceRegistrationId(stored)
26300
25948
  ) === true || (process.platform === "win32" ? stored.toLowerCase() === canonical.toLowerCase() : stored === canonical)
26301
25949
  );
26302
- const alreadyPersisted = persistedWorkspaces.length > 0;
26303
25950
  if (!alreadyPersisted && snapshot.workspaces.length >= MAX_REGISTERED_WORKSPACES - 1) {
26304
25951
  res.status(409).json({
26305
25952
  error: "Workspace registration limit reached",
@@ -26307,56 +25954,22 @@ function registerWorkspaceManagementRoutes(app, deps) {
26307
25954
  });
26308
25955
  return;
26309
25956
  }
26310
- if (alreadyPersisted) {
26311
- attachRegistrationIds(
26312
- existingRuntime,
26313
- persistedWorkspaces.map(workspaceRegistrationId)
26314
- );
26315
- const storedDisplayName = persistedWorkspaces.map(
26316
- (stored) => snapshot.displayNames?.[workspaceRegistrationId(stored)]
26317
- ).find((name) => name !== void 0);
26318
- if (storedDisplayName === void 0) {
26319
- delete existingRuntime.displayName;
26320
- } else {
26321
- existingRuntime.displayName = storedDisplayName;
26322
- }
26323
- } else {
26324
- let added = false;
25957
+ if (!alreadyPersisted) {
26325
25958
  try {
26326
- const persistedDisplayName = hasDisplayName ? displayName : existingRuntime.displayName;
26327
- added = persistedDisplayName === void 0 ? await workspaceRegistrationStore.add(canonical) : await workspaceRegistrationStore.add(
26328
- canonical,
26329
- persistedDisplayName
26330
- );
25959
+ await workspaceRegistrationStore.add(canonical);
26331
25960
  } catch (err) {
26332
25961
  if (!(err instanceof WorkspaceRegistrationStoreCommittedError)) {
26333
25962
  throw err;
26334
25963
  }
26335
- added = true;
26336
25964
  try {
26337
25965
  writeStderrLine(`qwen serve: ${err.message}`);
26338
25966
  } catch {
26339
25967
  }
26340
25968
  }
26341
- if (added) {
26342
- attachRegistrationIds(existingRuntime, [
26343
- workspaceRegistrationId(canonical)
26344
- ]);
26345
- }
26346
- if (added && hasDisplayName) {
26347
- if (displayName === void 0) {
26348
- delete existingRuntime.displayName;
26349
- } else {
26350
- existingRuntime.displayName = displayName;
26351
- }
26352
- } else if (!added) {
26353
- await restorePersistedDisplayName(existingRuntime, canonical);
26354
- }
26355
25969
  }
26356
25970
  res.status(200).json({
26357
25971
  id: existingRuntime.workspaceId,
26358
25972
  cwd: existingRuntime.workspaceCwd,
26359
- ...existingRuntime.displayName !== void 0 ? { displayName: existingRuntime.displayName } : {},
26360
25973
  primary: existingRuntime.primary,
26361
25974
  trusted: existingRuntime.trusted,
26362
25975
  persisted: true
@@ -26429,18 +26042,12 @@ function registerWorkspaceManagementRoutes(app, deps) {
26429
26042
  let persistenceFailed = false;
26430
26043
  try {
26431
26044
  const runtime = await createWorkspaceRuntime(canonical);
26432
- if (!persist && displayName !== void 0) {
26433
- runtime.displayName = displayName;
26434
- }
26435
26045
  let persistedRecordAdded = false;
26436
26046
  try {
26437
26047
  if (persist) {
26438
26048
  try {
26439
26049
  try {
26440
- persistedRecordAdded = displayName === void 0 ? await workspaceRegistrationStore.add(canonical) : await workspaceRegistrationStore.add(
26441
- canonical,
26442
- displayName
26443
- );
26050
+ persistedRecordAdded = await workspaceRegistrationStore.add(canonical);
26444
26051
  } catch (err) {
26445
26052
  if (!(err instanceof WorkspaceRegistrationStoreCommittedError)) {
26446
26053
  throw err;
@@ -26451,16 +26058,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
26451
26058
  } catch {
26452
26059
  }
26453
26060
  }
26454
- if (persistedRecordAdded) {
26455
- attachRegistrationIds(runtime, [
26456
- workspaceRegistrationId(canonical)
26457
- ]);
26458
- if (displayName !== void 0) {
26459
- runtime.displayName = displayName;
26460
- }
26461
- } else {
26462
- await restorePersistedDisplayName(runtime, canonical);
26463
- }
26464
26061
  } catch (err) {
26465
26062
  persistenceFailed = true;
26466
26063
  throw err;
@@ -26504,7 +26101,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
26504
26101
  res.status(201).json({
26505
26102
  id: runtime.workspaceId,
26506
26103
  cwd: runtime.workspaceCwd,
26507
- ...runtime.displayName !== void 0 ? { displayName: runtime.displayName } : {},
26508
26104
  primary: runtime.primary,
26509
26105
  trusted: runtime.trusted,
26510
26106
  ...persist ? { persisted: true } : {}
@@ -26572,98 +26168,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
26572
26168
  });
26573
26169
  return void 0;
26574
26170
  }, "resolveManagedRuntime");
26575
- app.patch(
26576
- "/workspaces/:workspace",
26577
- mutate({ strict: true }),
26578
- async (req, res) => {
26579
- const body = safeBody2(req);
26580
- const unsupportedField = Object.keys(body).find(
26581
- (field) => field !== "displayName"
26582
- );
26583
- if (unsupportedField) {
26584
- res.status(400).json({
26585
- error: `\`${unsupportedField}\` is not an updatable workspace field`,
26586
- code: "unsupported_field"
26587
- });
26588
- return;
26589
- }
26590
- if (!Object.hasOwn(body, "displayName")) {
26591
- res.status(400).json({
26592
- error: "No updatable fields provided",
26593
- code: "empty_patch"
26594
- });
26595
- return;
26596
- }
26597
- let displayName;
26598
- try {
26599
- displayName = body["displayName"] === null ? void 0 : normalizeWorkspaceDisplayName(body["displayName"]);
26600
- } catch (err) {
26601
- if (!(err instanceof WorkspaceDisplayNameValidationError)) throw err;
26602
- res.status(400).json({
26603
- error: err.message,
26604
- code: "invalid_display_name"
26605
- });
26606
- return;
26607
- }
26608
- if (sealed) {
26609
- sendSealed(res);
26610
- return;
26611
- }
26612
- const runtime = resolveManagedRuntime(req, res);
26613
- if (!runtime) return;
26614
- if (inFlight.has(runtime.workspaceCwd)) {
26615
- res.status(409).json({
26616
- error: "Workspace registration is in progress",
26617
- code: "workspace_registration_in_progress"
26618
- });
26619
- return;
26620
- }
26621
- inFlight.set(runtime.workspaceCwd, "update");
26622
- operationStarted();
26623
- try {
26624
- if (workspaceRegistrationStore && runtime.registrationIds !== void 0 && runtime.registrationIds.length > 0) {
26625
- try {
26626
- await workspaceRegistrationStore.setDisplayNameByIds(
26627
- runtime.registrationIds,
26628
- displayName
26629
- );
26630
- } catch (err) {
26631
- if (!(err instanceof WorkspaceRegistrationStoreCommittedError)) {
26632
- throw err;
26633
- }
26634
- try {
26635
- writeStderrLine(`qwen serve: ${err.message}`);
26636
- } catch {
26637
- }
26638
- }
26639
- }
26640
- if (displayName === void 0) {
26641
- delete runtime.displayName;
26642
- } else {
26643
- runtime.displayName = displayName;
26644
- }
26645
- res.status(200).json({
26646
- id: runtime.workspaceId,
26647
- cwd: runtime.workspaceCwd,
26648
- ...runtime.displayName !== void 0 ? { displayName: runtime.displayName } : {},
26649
- primary: runtime.primary,
26650
- trusted: runtime.trusted,
26651
- ...runtimeRemoval ? { removable: runtime.removable === true } : {}
26652
- });
26653
- } catch (err) {
26654
- writeStderrLine(
26655
- `qwen serve: failed to persist workspace display name: ${err instanceof Error ? err.message : String(err)}`
26656
- );
26657
- res.status(500).json({
26658
- error: "Failed to persist workspace display name",
26659
- code: "workspace_registration_store_error"
26660
- });
26661
- } finally {
26662
- inFlight.delete(runtime.workspaceCwd);
26663
- operationFinished();
26664
- }
26665
- }
26666
- );
26667
26171
  app.delete(
26668
26172
  "/workspaces/:workspace",
26669
26173
  mutate({ strict: true }),
@@ -26899,13 +26403,11 @@ function registerWorkspaceManagementRoutes(app, deps) {
26899
26403
  schemaVersion: snapshot.schemaVersion,
26900
26404
  primaryWorkspace: snapshot.primaryWorkspace,
26901
26405
  entries: snapshot.workspaces.map((cwd) => {
26902
- const registrationId = workspaceRegistrationId(cwd);
26903
26406
  const runtime = workspaceRegistry.getByWorkspaceCwd(cwd);
26904
26407
  return {
26905
- id: registrationId,
26408
+ id: workspaceRegistrationId(cwd),
26906
26409
  cwd,
26907
- ...snapshot.displayNames?.[registrationId] !== void 0 ? { displayName: snapshot.displayNames[registrationId] } : {},
26908
- active: runtime !== void 0 || registrationIsActive(registrationId),
26410
+ active: runtime !== void 0 || registrationIsActive(workspaceRegistrationId(cwd)),
26909
26411
  persisted: true
26910
26412
  };
26911
26413
  })
@@ -26963,7 +26465,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
26963
26465
  }
26964
26466
  if (storedCwd) {
26965
26467
  try {
26966
- operationCwd = realpathSync2.native(resolve4(storedCwd));
26468
+ operationCwd = realpathSync.native(resolve4(storedCwd));
26967
26469
  } catch {
26968
26470
  operationCwd = resolve4(storedCwd);
26969
26471
  }
@@ -27003,11 +26505,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
27003
26505
  });
27004
26506
  return;
27005
26507
  }
27006
- if (runtime?.registrationIds) {
27007
- runtime.registrationIds = runtime.registrationIds.filter(
27008
- (id) => id !== registrationId
27009
- );
27010
- }
27011
26508
  res.json({
27012
26509
  removed: true,
27013
26510
  active,
@@ -27039,8 +26536,6 @@ __name(registerWorkspaceManagementRoutes, "registerWorkspaceManagementRoutes");
27039
26536
 
27040
26537
  // packages/cli/src/serve/routes/workspace-git.ts
27041
26538
  init_esbuild_shims();
27042
- import * as fs4 from "node:fs";
27043
- import * as path14 from "node:path";
27044
26539
  function registerWorkspaceGitRoutes(app, deps) {
27045
26540
  app.get("/workspace/git", async (_req, res) => {
27046
26541
  try {
@@ -27062,43 +26557,10 @@ function registerWorkspaceQualifiedGitRoutes(app, deps) {
27062
26557
  const runtime = resolveTrustedRuntime2(deps.workspaceRegistry, req, res);
27063
26558
  if (!runtime) return;
27064
26559
  const route = "GET /workspaces/:workspace/git";
27065
- const rawCwd = req.query["cwd"];
27066
- let gitCwd = runtime.workspaceCwd;
27067
- if (typeof rawCwd === "string" && rawCwd.length > 0) {
27068
- try {
27069
- const resolved = fs4.realpathSync(path14.resolve(rawCwd));
27070
- const root = fs4.realpathSync(runtime.workspaceCwd);
27071
- const rel = path14.relative(root, resolved);
27072
- if (!rel.startsWith("..") && !path14.isAbsolute(rel)) {
27073
- gitCwd = resolved;
27074
- }
27075
- } catch {
27076
- }
27077
- }
27078
26560
  try {
27079
- if (gitCwd !== runtime.workspaceCwd) {
27080
- const status = await getGitWorkingTreeStatus(gitCwd).catch(() => null);
27081
- res.status(200).json(
27082
- status ? {
27083
- v: 2,
27084
- workspaceCwd: gitCwd,
27085
- branch: status.branch ?? null,
27086
- detached: status.detached,
27087
- staged: status.staged,
27088
- unstaged: status.unstaged,
27089
- untracked: status.untracked,
27090
- conflicted: status.conflicted,
27091
- hasUpstream: status.hasUpstream,
27092
- ahead: status.ahead,
27093
- behind: status.behind,
27094
- stashCount: status.stashCount,
27095
- ...status.operation ? { operation: status.operation } : {},
27096
- computedAt: Date.now()
27097
- } : { v: 2, workspaceCwd: gitCwd, branch: null }
27098
- );
27099
- } else {
27100
- res.status(200).json(await deps.gitState.getStatus(gitCwd, runtime.bridge));
27101
- }
26561
+ res.status(200).json(
26562
+ await deps.gitState.getStatus(runtime.workspaceCwd, runtime.bridge)
26563
+ );
27102
26564
  } catch (err) {
27103
26565
  deps.sendBridgeError(res, err, { route });
27104
26566
  }
@@ -27251,163 +26713,6 @@ function registerWorkspaceQualifiedGitDiffRoutes(app, deps) {
27251
26713
  }
27252
26714
  __name(registerWorkspaceQualifiedGitDiffRoutes, "registerWorkspaceQualifiedGitDiffRoutes");
27253
26715
 
27254
- // packages/cli/src/serve/routes/workspace-git-log.ts
27255
- init_esbuild_shims();
27256
- function buildLogList(workspaceCwd, result) {
27257
- if (!result) {
27258
- return {
27259
- v: 1,
27260
- workspaceCwd,
27261
- available: false,
27262
- entries: [],
27263
- hasMore: false
27264
- };
27265
- }
27266
- return {
27267
- v: 1,
27268
- workspaceCwd,
27269
- available: true,
27270
- entries: result.entries.map((e) => ({
27271
- sha: e.sha,
27272
- shortSha: e.shortSha,
27273
- authorName: e.authorName,
27274
- authorEmail: e.authorEmail,
27275
- authorDate: e.authorDate,
27276
- subject: e.subject,
27277
- ...e.refs ? { refs: e.refs } : {},
27278
- parents: e.parents
27279
- })),
27280
- hasMore: result.hasMore
27281
- };
27282
- }
27283
- __name(buildLogList, "buildLogList");
27284
- function buildCommitDetail(workspaceCwd, result) {
27285
- if (!result) {
27286
- return { v: 1, workspaceCwd, available: false };
27287
- }
27288
- return {
27289
- v: 1,
27290
- workspaceCwd,
27291
- available: true,
27292
- sha: result.sha,
27293
- shortSha: result.shortSha,
27294
- authorName: result.authorName,
27295
- authorEmail: result.authorEmail,
27296
- authorDate: result.authorDate,
27297
- subject: result.subject,
27298
- body: result.body,
27299
- ...result.refs ? { refs: result.refs } : {},
27300
- parents: result.parents,
27301
- files: result.files.map((f) => ({
27302
- path: f.path,
27303
- added: f.added,
27304
- removed: f.removed,
27305
- isBinary: f.isBinary
27306
- })),
27307
- filesCount: result.filesCount,
27308
- linesAdded: result.linesAdded,
27309
- linesRemoved: result.linesRemoved,
27310
- hiddenCount: result.hiddenCount
27311
- };
27312
- }
27313
- __name(buildCommitDetail, "buildCommitDetail");
27314
- function parsePagination(req) {
27315
- const rawLimit = req.query["limit"];
27316
- const rawSkip = req.query["skip"];
27317
- const parsedLimit = typeof rawLimit === "string" ? parseInt(rawLimit, 10) : NaN;
27318
- const parsedSkip = typeof rawSkip === "string" ? parseInt(rawSkip, 10) : NaN;
27319
- const limit = Math.min(
27320
- Math.max(Number.isNaN(parsedLimit) ? DEFAULT_LOG_LIMIT : parsedLimit, 1),
27321
- MAX_LOG_LIMIT
27322
- );
27323
- const skip = Math.max(Number.isNaN(parsedSkip) ? 0 : parsedSkip, 0);
27324
- return { limit, skip };
27325
- }
27326
- __name(parsePagination, "parsePagination");
27327
- async function handleLogList(req, res, workspaceCwd, sendBridgeError2, route) {
27328
- try {
27329
- applyReadHeaders(res);
27330
- const { limit, skip } = parsePagination(req);
27331
- const result = await fetchGitLog(workspaceCwd, { limit, skip });
27332
- res.status(200).json(buildLogList(workspaceCwd, result));
27333
- } catch (err) {
27334
- sendBridgeError2(res, err, { route });
27335
- }
27336
- }
27337
- __name(handleLogList, "handleLogList");
27338
- async function handleCommitDetail(req, res, workspaceCwd, sendBridgeError2, route) {
27339
- const sha = req.query["sha"];
27340
- if (typeof sha !== "string" || sha.length === 0 || !/^[0-9a-f]{7,40}$/i.test(sha)) {
27341
- applyReadHeaders(res);
27342
- res.status(400).json({
27343
- errorKind: "parse_error",
27344
- error: "sha query parameter is required",
27345
- status: 400
27346
- });
27347
- return;
27348
- }
27349
- try {
27350
- applyReadHeaders(res);
27351
- const result = await fetchGitCommitDetail(workspaceCwd, sha);
27352
- res.status(200).json(buildCommitDetail(workspaceCwd, result));
27353
- } catch (err) {
27354
- sendBridgeError2(res, err, { route });
27355
- }
27356
- }
27357
- __name(handleCommitDetail, "handleCommitDetail");
27358
- function registerWorkspaceGitLogRoutes(app, deps) {
27359
- app.get("/workspace/git/log", (req, res) => {
27360
- void handleLogList(
27361
- req,
27362
- res,
27363
- deps.boundWorkspace,
27364
- deps.sendBridgeError,
27365
- "GET /workspace/git/log"
27366
- );
27367
- });
27368
- app.get("/workspace/git/log/commit", (req, res) => {
27369
- void handleCommitDetail(
27370
- req,
27371
- res,
27372
- deps.boundWorkspace,
27373
- deps.sendBridgeError,
27374
- "GET /workspace/git/log/commit"
27375
- );
27376
- });
27377
- }
27378
- __name(registerWorkspaceGitLogRoutes, "registerWorkspaceGitLogRoutes");
27379
- function resolveTrustedRuntime4(registry, req, res) {
27380
- const runtime = resolveWorkspaceRuntimeFromParam(registry, req, res);
27381
- if (!runtime) return null;
27382
- return requireTrustedWorkspaceRuntime(runtime, res) ? runtime : null;
27383
- }
27384
- __name(resolveTrustedRuntime4, "resolveTrustedRuntime");
27385
- function registerWorkspaceQualifiedGitLogRoutes(app, deps) {
27386
- app.get("/workspaces/:workspace/git/log", (req, res) => {
27387
- const runtime = resolveTrustedRuntime4(deps.workspaceRegistry, req, res);
27388
- if (!runtime) return;
27389
- void handleLogList(
27390
- req,
27391
- res,
27392
- runtime.workspaceCwd,
27393
- deps.sendBridgeError,
27394
- "GET /workspaces/:workspace/git/log"
27395
- );
27396
- });
27397
- app.get("/workspaces/:workspace/git/log/commit", (req, res) => {
27398
- const runtime = resolveTrustedRuntime4(deps.workspaceRegistry, req, res);
27399
- if (!runtime) return;
27400
- void handleCommitDetail(
27401
- req,
27402
- res,
27403
- runtime.workspaceCwd,
27404
- deps.sendBridgeError,
27405
- "GET /workspaces/:workspace/git/log/commit"
27406
- );
27407
- });
27408
- }
27409
- __name(registerWorkspaceQualifiedGitLogRoutes, "registerWorkspaceQualifiedGitLogRoutes");
27410
-
27411
26716
  // packages/cli/src/serve/workspace-git-state.ts
27412
26717
  init_esbuild_shims();
27413
26718
  var WorkspaceGitState = class {
@@ -29138,7 +28443,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
29138
28443
  maxPendingPromptsPerSession: opts.maxPendingPromptsPerSession,
29139
28444
  eventRingSize: opts.eventRingSize,
29140
28445
  compactedReplayMaxBytes: opts.compactedReplayMaxBytes,
29141
- initializeTimeoutMs: opts.initializeTimeoutMs,
29142
28446
  permissionResponseTimeoutMs: opts.permissionResponseTimeoutMs,
29143
28447
  boundWorkspace,
29144
28448
  sessionShellCommandEnabled,
@@ -29415,14 +28719,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
29415
28719
  workspaceRegistry,
29416
28720
  sendBridgeError: sendBridgeError2
29417
28721
  });
29418
- registerWorkspaceGitLogRoutes(app, {
29419
- boundWorkspace: primaryBoundWorkspace,
29420
- sendBridgeError: sendBridgeError2
29421
- });
29422
- registerWorkspaceQualifiedGitLogRoutes(app, {
29423
- workspaceRegistry,
29424
- sendBridgeError: sendBridgeError2
29425
- });
29426
28722
  mountWorkspaceMemoryRoutes(app, {
29427
28723
  bridge: primaryBridge,
29428
28724
  boundWorkspace: primaryBoundWorkspace,