@qwen-code/qwen-code 0.23.2-preview.0 → 0.23.2

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 (282) hide show
  1. package/bundled/qc-helper/docs/configuration/auth.md +1 -1
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +19 -15
  3. package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
  4. package/bundled/qc-helper/docs/features/channels/github.md +1 -9
  5. package/bundled/qc-helper/docs/features/channels/overview.md +26 -51
  6. package/bundled/qc-helper/docs/features/channels/qqbot.md +1 -2
  7. package/bundled/qc-helper/docs/features/commands.md +48 -9
  8. package/bundled/qc-helper/docs/features/goals.md +2 -0
  9. package/bundled/qc-helper/docs/features/sub-agents.md +8 -0
  10. package/bundled/qc-helper/docs/qwen-serve.md +62 -48
  11. package/chunks/{MaxSizedBox-ZZJT3PJF.js → MaxSizedBox-4C3BKKKY.js} +17 -16
  12. package/chunks/{StandaloneSessionPicker-DIOSZTMX.js → StandaloneSessionPicker-TXVF65YW.js} +32 -31
  13. package/chunks/{acpAgent-62JUP5A7.js → acpAgent-H5XBKGB4.js} +301 -166
  14. package/chunks/{agent-NLPEQQDZ.js → agent-T5LEFJIU.js} +10 -10
  15. package/chunks/{agent-headless-Y2GR5F2Q.js → agent-headless-VZKSRH36.js} +10 -10
  16. package/chunks/{anthropicContentGenerator-I7LQZH26.js → anthropicContentGenerator-PRJWWVYJ.js} +2 -2
  17. package/chunks/{artifact-tool-P52OKKEF.js → artifact-tool-G5LHNECG.js} +1 -1
  18. package/chunks/{bridge-Q66BD62H.js → bridge-AOX5IY44.js} +18 -17
  19. package/chunks/{channel-management-service-TRTLQTSV.js → channel-management-service-MWQGHPAS.js} +4 -4
  20. package/chunks/{channel-settings-store-R5STFWUW.js → channel-settings-store-XZCGDGHW.js} +26 -25
  21. package/chunks/{channel-worker-group-PIYPVCTF.js → channel-worker-group-SQ5FRWOH.js} +5 -5
  22. package/chunks/{channel-worker-manager-FQHEDTD2.js → channel-worker-manager-TU4ZNWOE.js} +5 -5
  23. package/chunks/{channel-worker-supervisor-XJPZZ3VK.js → channel-worker-supervisor-EMITFMCP.js} +4 -4
  24. package/chunks/{chunk-3SH53ANB.js → chunk-22GORRNY.js} +12 -0
  25. package/chunks/{chunk-7L35FKPF.js → chunk-2BMXHB6N.js} +2 -2
  26. package/chunks/chunk-2WC3Y7YY.js +1033 -0
  27. package/chunks/{chunk-WZ4YULVF.js → chunk-3OAXF3UK.js} +210 -80
  28. package/chunks/{chunk-W673V2H3.js → chunk-46MMBZHI.js} +3 -3
  29. package/chunks/{chunk-6GRDHIVI.js → chunk-4I3WFI3U.js} +4 -4
  30. package/chunks/{chunk-QXXBW2G4.js → chunk-4JNHNVAZ.js} +3 -3
  31. package/chunks/{chunk-R2266LQ5.js → chunk-4WMGYG3F.js} +2 -2
  32. package/chunks/{chunk-Y6ZWXM44.js → chunk-5BH2AIEY.js} +1 -1
  33. package/chunks/{chunk-EA4NFWVG.js → chunk-5OZUKLL7.js} +3 -3
  34. package/chunks/{chunk-RX3FYFCN.js → chunk-67XTVRVB.js} +1 -1
  35. package/chunks/{chunk-MA5OUNN6.js → chunk-6G4V7SE4.js} +1 -1
  36. package/chunks/{chunk-B54PFQS5.js → chunk-7CLLH5TI.js} +1 -1
  37. package/chunks/{chunk-7GZCCHJL.js → chunk-7LTCFO6T.js} +3 -3
  38. package/chunks/{chunk-33MLFMCL.js → chunk-7NDZKE2M.js} +2 -2
  39. package/chunks/{chunk-5WC2ECUK.js → chunk-7PD7ZMX5.js} +17 -4
  40. package/chunks/{chunk-ZUNWKOAP.js → chunk-7SVM3RP2.js} +4 -24
  41. package/chunks/{chunk-5GD7LYOH.js → chunk-A7EFXK7P.js} +1 -1
  42. package/chunks/{chunk-RDV4NLI3.js → chunk-AO2VMS72.js} +2 -2
  43. package/chunks/{chunk-XAXTQURR.js → chunk-APXIW2TF.js} +3 -3
  44. package/chunks/{chunk-3BTHHXXE.js → chunk-AUTUFD5X.js} +1 -1
  45. package/chunks/{chunk-VH764G6B.js → chunk-B25JYXZE.js} +2 -2
  46. package/chunks/{chunk-MMMA36MN.js → chunk-BK7D2JR6.js} +3 -3
  47. package/chunks/{chunk-RPFJJ33Z.js → chunk-CALTQWTZ.js} +1 -1
  48. package/chunks/{chunk-EUXF6URV.js → chunk-CCBTNJB4.js} +16 -18
  49. package/chunks/{chunk-BF3RUIVP.js → chunk-CH2YDT6X.js} +36 -38
  50. package/chunks/{chunk-L6ZME3W7.js → chunk-CMWU6P4D.js} +1 -1
  51. package/chunks/{chunk-QJAFSFYA.js → chunk-CWVZBIZJ.js} +1 -1
  52. package/chunks/{chunk-JDPBJIKI.js → chunk-DAI65CMX.js} +1 -1
  53. package/chunks/{chunk-GM44O6F7.js → chunk-DARWOZY6.js} +1 -1
  54. package/chunks/{chunk-J4ECGDA3.js → chunk-ELD3OBPU.js} +3 -3
  55. package/chunks/{chunk-ZELCTN6Y.js → chunk-F23YN37B.js} +10 -0
  56. package/chunks/{chunk-OIPUQE3S.js → chunk-F2NYVASI.js} +14 -1
  57. package/chunks/{chunk-ODBNTMZW.js → chunk-FAJPLSYF.js} +36 -29
  58. package/chunks/{chunk-GXIHBIHC.js → chunk-FGHPZGOP.js} +29 -24
  59. package/chunks/{chunk-TK4XHPKW.js → chunk-G37O7YO6.js} +2 -2
  60. package/chunks/{chunk-4JKLPTV6.js → chunk-G3ZUMSFS.js} +12 -5
  61. package/chunks/{chunk-743XE7N7.js → chunk-G5VOXCRX.js} +1 -1
  62. package/chunks/{chunk-BL6B2QS2.js → chunk-GOEVQADN.js} +618 -1122
  63. package/chunks/{chunk-XI7RST4D.js → chunk-GOKAOSCN.js} +1 -1
  64. package/chunks/{chunk-FDOGGKAA.js → chunk-GSFV5RQW.js} +2 -0
  65. package/chunks/{chunk-43CI6YWJ.js → chunk-HJ5UJQQL.js} +1384 -1245
  66. package/chunks/{chunk-LUVXLLMS.js → chunk-IR6JKBAP.js} +1 -1
  67. package/chunks/{chunk-CPJRFFPH.js → chunk-IRGDIDGJ.js} +558 -158
  68. package/chunks/{chunk-DCPRCDSR.js → chunk-IWABUX6T.js} +1 -1
  69. package/chunks/{chunk-DTB5BXRG.js → chunk-JO77FGNZ.js} +16 -15
  70. package/chunks/{chunk-45ROPFQY.js → chunk-JYGIJA4W.js} +1 -1
  71. package/chunks/{chunk-M6YLOETP.js → chunk-KCF2436G.js} +1 -1
  72. package/chunks/{chunk-CABDNUJ4.js → chunk-KEPC5BOL.js} +5 -5
  73. package/chunks/{chunk-RN6V5HKE.js → chunk-KFECPHLV.js} +3 -3
  74. package/chunks/{chunk-WIRYFL2L.js → chunk-LEAOJ43M.js} +17 -15
  75. package/chunks/{chunk-IUJLW6ZI.js → chunk-LUNC5KCL.js} +3 -3
  76. package/chunks/{chunk-WZS3X663.js → chunk-LWX4WDFF.js} +2 -5
  77. package/chunks/{chunk-ISPBBKJN.js → chunk-MV5DTLJV.js} +7 -2
  78. package/chunks/chunk-NFXXBWSE.js +463 -0
  79. package/chunks/{chunk-PQSCGZT2.js → chunk-NPKCVSXX.js} +26 -2
  80. package/chunks/{chunk-7RXOEUFF.js → chunk-NX7ZTXFF.js} +1 -1
  81. package/chunks/{chunk-G5QLLD53.js → chunk-OXR34GCD.js} +14 -2
  82. package/chunks/{chunk-VHPG7BH6.js → chunk-PDN7FJZV.js} +1 -1
  83. package/chunks/{chunk-UHUT4IDM.js → chunk-PFKGV6PO.js} +9 -9
  84. package/chunks/{chunk-NFIDVZND.js → chunk-QB3KS3N3.js} +2 -21
  85. package/chunks/{chunk-QLM7D7W3.js → chunk-QFJZAY7W.js} +7 -7
  86. package/chunks/{chunk-NVS4Z6GT.js → chunk-QHLHE2OT.js} +1 -1
  87. package/chunks/{chunk-B44JBZBB.js → chunk-QQK4L3UU.js} +1 -1
  88. package/chunks/{chunk-63ACHB2H.js → chunk-QTB4VP4K.js} +50 -18
  89. package/chunks/{chunk-4BLTSTF6.js → chunk-R3JIDRUL.js} +4 -4
  90. package/chunks/{chunk-VEQBVJYH.js → chunk-R457KFV7.js} +3 -3
  91. package/chunks/{chunk-CG2PDIGD.js → chunk-RM244SCQ.js} +1 -1
  92. package/chunks/{chunk-W7PXLIZJ.js → chunk-RNAJVXUG.js} +5 -5
  93. package/chunks/{chunk-VF6D6EGV.js → chunk-S5QR6CB5.js} +52 -6
  94. package/chunks/{chunk-IRKQ4YYX.js → chunk-SVWWF5TZ.js} +29 -1
  95. package/chunks/{chunk-5HBA2Z7V.js → chunk-TGNNLRC3.js} +2 -3
  96. package/chunks/{chunk-ORREXWOM.js → chunk-TODNHE76.js} +3 -3
  97. package/chunks/{chunk-W3ONSAYO.js → chunk-TOOOLHVS.js} +2 -2
  98. package/chunks/{chunk-EHTKOO6W.js → chunk-TRQNRP2H.js} +2 -2
  99. package/chunks/{chunk-PQWM4SX2.js → chunk-U6REWGVR.js} +2 -2
  100. package/chunks/{chunk-UXDVUFKU.js → chunk-ULZECEIP.js} +2 -2
  101. package/chunks/{chunk-6YEOCHSE.js → chunk-VBLAI2HA.js} +101 -0
  102. package/chunks/{chunk-M73KHGNR.js → chunk-VJJXG73H.js} +404 -226
  103. package/chunks/{chunk-Q2F43WTJ.js → chunk-WBU2PIZ5.js} +23 -6
  104. package/chunks/{chunk-UULHYZ4W.js → chunk-WDN64MVT.js} +74 -15
  105. package/chunks/{chunk-XVTCSVBK.js → chunk-WDVV3LRM.js} +193 -169
  106. package/chunks/{chunk-LBKYQ33T.js → chunk-WK7P62DV.js} +16 -10
  107. package/chunks/{chunk-ULY4ISY2.js → chunk-WXD7INFV.js} +19 -4
  108. package/chunks/{chunk-ZIPYCXQP.js → chunk-WXPPUPHM.js} +1 -1
  109. package/chunks/{chunk-5Z4FCEPY.js → chunk-X7LFJF5D.js} +600 -46
  110. package/chunks/{chunk-YHDGABDC.js → chunk-XKBFYTCD.js} +1 -1
  111. package/chunks/{chunk-MWEF5MUK.js → chunk-XSOXPG2L.js} +8 -8
  112. package/chunks/{chunk-5VZFJTL2.js → chunk-YLOHCA6I.js} +2 -2
  113. package/chunks/{chunk-LN3WBOKU.js → chunk-YQGW3M6Z.js} +2 -2
  114. package/chunks/{chunk-2OR32P5M.js → chunk-ZN5TKAVR.js} +125 -10
  115. package/chunks/{chunk-XBLG564H.js → chunk-ZP5XDLSA.js} +10 -10
  116. package/chunks/{config-utils-37FHWPTP.js → config-utils-GPLIABL2.js} +21 -20
  117. package/chunks/{contextCommand-R4JUBV5N.js → contextCommand-NCUQUDBY.js} +18 -17
  118. package/chunks/{core-runtime-6U4OXU5C.js → core-runtime-WKYKWVYU.js} +23 -21
  119. package/chunks/{create-sub-session-LLUYAGZN.js → create-sub-session-PPLXB3JJ.js} +17 -16
  120. package/chunks/{daemon-UI6SQSBV.js → daemon-2CKIAO3I.js} +2 -2
  121. package/chunks/{daemon-git-worktree-guard-O2UTNFJC.js → daemon-git-worktree-guard-73ZWOLKL.js} +17 -16
  122. package/chunks/{daemon-status-provider-7GMAKSTX.js → daemon-status-provider-OK7VONJG.js} +22 -21
  123. package/chunks/{daemon-trust-policy-VNP76VMO.js → daemon-trust-policy-CAUCREG2.js} +22 -21
  124. package/chunks/{daemon-trust-policy-monitor-TD5O3BZA.js → daemon-trust-policy-monitor-3Y36OOEQ.js} +22 -21
  125. package/chunks/{deferred-core-runtime-NJM63YJS.js → deferred-core-runtime-Q7WFWYD3.js} +17 -16
  126. package/chunks/{dist-STAGIFNB.js → dist-6YDUH3BB.js} +388 -102
  127. package/chunks/{dist-XJ25G6OH.js → dist-BNQVF565.js} +2 -8
  128. package/chunks/{dist-NQ2636VT.js → dist-F34J4FZX.js} +1 -1
  129. package/chunks/{dist-OR2ZQTXZ.js → dist-F6JLAJLE.js} +1 -1
  130. package/chunks/{dist-WZTUKIDR.js → dist-NP7QKLVG.js} +2 -2
  131. package/chunks/{dist-M4CBX53H.js → dist-UFTFGI6I.js} +1 -1
  132. package/chunks/{dist-5I4HLUTO.js → dist-XLV33CLY.js} +1 -2
  133. package/chunks/{dist-24TCWK5H.js → dist-Y5KC3IHW.js} +1 -2
  134. package/chunks/{dist-FDISN4AK.js → dist-ZDNJK74R.js} +3 -7
  135. package/chunks/{edit-GL7OA6RV.js → edit-YJD6IETK.js} +10 -10
  136. package/chunks/{enterPlanMode-VC4BCSZE.js → enterPlanMode-EFPVTWIH.js} +10 -10
  137. package/chunks/{environment-BI6IBAZJ.js → environment-HP3AXFTB.js} +19 -18
  138. package/chunks/{errors-D6G2ZM2R.js → errors-22ON46G7.js} +19 -18
  139. package/chunks/{exitPlanMode-DX446CA6.js → exitPlanMode-MOQUNCBH.js} +10 -10
  140. package/chunks/{fast-path-MAYDLJIP.js → fast-path-2X7BPMXX.js} +3 -3
  141. package/chunks/{glob-TVKRFY36.js → glob-Y7ACIB3P.js} +10 -10
  142. package/chunks/{goal-tools-CA6YANRN.js → goal-tools-DABMICUC.js} +10 -10
  143. package/chunks/{handleAutoUpdate-AW4ZAHON.js → handleAutoUpdate-MCAMHYDI.js} +19 -18
  144. package/chunks/{i18n-IH5CRAY7.js → i18n-C3GDCALP.js} +17 -16
  145. package/chunks/{initializer-UBR37ZNM.js → initializer-4URDQL2G.js} +22 -21
  146. package/chunks/{installationInfo-Y52756EC.js → installationInfo-LBOL6SBV.js} +17 -16
  147. package/chunks/{list-7V5JDZPO.js → list-JOGBAC2R.js} +25 -24
  148. package/chunks/{list-agents-I5TRH3J7.js → list-agents-2CXPGJUE.js} +3 -3
  149. package/chunks/{llm-QDB6JVF5.js → llm-2KPNSAVY.js} +65 -59
  150. package/chunks/{llm-content-generator-EO6MZCEO.js → llm-content-generator-GR3FOHLB.js} +2 -2
  151. package/chunks/{loadedSettingsAdapter-I3YQKMC4.js → loadedSettingsAdapter-DVKROEJD.js} +22 -21
  152. package/chunks/{loggingContentGenerator-MNXYUGDG.js → loggingContentGenerator-P4K6K5W4.js} +12 -12
  153. package/chunks/{managed-npm-update-EA3EXPTO.js → managed-npm-update-VWBKHNIN.js} +17 -16
  154. package/chunks/{mcp-QTAJ544Y.js → mcp-6YYNSYLK.js} +22 -21
  155. package/chunks/{monitor-6FQKQOTP.js → monitor-A255TNZR.js} +10 -10
  156. package/chunks/{nonInteractiveCli-MRCTZL5X.js → nonInteractiveCli-LXGIKQAT.js} +55 -54
  157. package/chunks/{notebook-edit-BQQCKI7K.js → notebook-edit-5UYHS2DM.js} +10 -10
  158. package/chunks/{open-with-auth-D6JD6LDS.js → open-with-auth-6MVIHMXB.js} +1 -1
  159. package/chunks/{openaiContentGenerator-TTSKXNVH.js → openaiContentGenerator-A6MAMEO5.js} +7 -7
  160. package/chunks/{pidfile-KPIS6RIT.js → pidfile-B7DZC4TP.js} +20 -17
  161. package/chunks/{processUtils-ZCASPKK4.js → processUtils-BPZ2MCZS.js} +2 -2
  162. package/chunks/{prompt-terminal-ledger-D6HM6TV7.js → prompt-terminal-ledger-FYYTAOXS.js} +18 -17
  163. package/chunks/{qwenContentGenerator-GGZEFLBD.js → qwenContentGenerator-4IOJFD4S.js} +13 -13
  164. package/chunks/{read-file-VE5GDFLP.js → read-file-A4H4O3VQ.js} +2 -2
  165. package/chunks/{resumeHistoryUtils-HSSGMYDC.js → resumeHistoryUtils-YQQ43E4N.js} +19 -18
  166. package/chunks/{ripGrep-SEJE7AA6.js → ripGrep-W32NWFTA.js} +3 -3
  167. package/chunks/{run-qwen-serve-OJYVH7N6.js → run-qwen-serve-WBSWWIRV.js} +216 -64
  168. package/chunks/{runtime-KGMQQFJD.js → runtime-VRVBX2E5.js} +29 -26
  169. package/chunks/{scheduled-tasks-7H5HWHYD.js → scheduled-tasks-D65KJDA3.js} +20 -19
  170. package/chunks/{scheduler-BE42AKDG.js → scheduler-M2YPN7Z7.js} +19 -18
  171. package/chunks/{send-message-AWKUDJBH.js → send-message-76BKWKFZ.js} +3 -3
  172. package/chunks/{serve-KZVKYMSL.js → serve-BE3H2P6P.js} +22 -21
  173. package/chunks/{server-PJRALPJQ.js → server-FLY5JERG.js} +84 -148
  174. package/chunks/{session-IHITXU2S.js → session-JVN62R5K.js} +85 -57
  175. package/chunks/{session-attachments-root-GQ2TUI3Y.js → session-attachments-root-7ACGLHXA.js} +17 -16
  176. package/chunks/{session-pr-refresh-H43LULTE.js → session-pr-refresh-TQS57SDK.js} +19 -18
  177. package/chunks/{settings-RKEQQDFC.js → settings-D44YMZFT.js} +21 -20
  178. package/chunks/{shell-6PJ444U5.js → shell-3VE6I4V5.js} +10 -10
  179. package/chunks/{skill-Q3UP7B5V.js → skill-FHEGRRZU.js} +2 -2
  180. package/chunks/{skill-settings-LZR5YRRW.js → skill-settings-VHEJMBFL.js} +21 -20
  181. package/chunks/{spawnChannel-WM3DT2BF.js → spawnChannel-T6MX2ZDN.js} +17 -16
  182. package/chunks/{standalone-update-E5474IBI.js → standalone-update-QUGHFMCS.js} +18 -17
  183. package/chunks/{start-opentui-ui-WLWZNQ2I.js → start-opentui-ui-IHIIZ2LE.js} +438 -203
  184. package/chunks/{startInteractiveUI-FBQSGWGO.js → startInteractiveUI-LR7K2ARZ.js} +1171 -1234
  185. package/chunks/{task-create-PMAFST2T.js → task-create-MWXJFRRM.js} +3 -3
  186. package/chunks/{task-list-R2HSY2NC.js → task-list-EYO3FE57.js} +2 -2
  187. package/chunks/{task-update-JYC57USF.js → task-update-2JJJRHMT.js} +3 -3
  188. package/chunks/{team-create-VIGUFUT4.js → team-create-GY3VFY47.js} +10 -10
  189. package/chunks/{team-delete-CBHVBTPB.js → team-delete-IQZ6XGFI.js} +2 -2
  190. package/chunks/{team-plan-approval-HQVZA3MD.js → team-plan-approval-BQPGZOT5.js} +10 -10
  191. package/chunks/{terminal-image-renderer-LUKNCOVM.js → terminal-image-renderer-YNYW5CQG.js} +17 -16
  192. package/chunks/{theme-manager-LOENKYLY.js → theme-manager-U6CIK3GM.js} +17 -16
  193. package/chunks/{tool-search-ZIFAQCE2.js → tool-search-XI3QWD5I.js} +2 -2
  194. package/chunks/{total-session-admission-FUUJH3QH.js → total-session-admission-3SNSJJ32.js} +18 -17
  195. package/chunks/{trustedFolders-C76KYROP.js → trustedFolders-OVAQKNV5.js} +18 -17
  196. package/chunks/{update-relaunch-4G2SRXKX.js → update-relaunch-XV5O74E3.js} +5 -5
  197. package/chunks/{updateCheck-EIZIO7HI.js → updateCheck-CHUYWD6L.js} +17 -16
  198. package/chunks/{useAutoAcceptIndicator-EAA6KSY4.js → useAutoAcceptIndicator-VKSVIXZC.js} +23 -22
  199. package/chunks/{validateNonInterActiveAuth-BRX22QCN.js → validateNonInterActiveAuth-ZNUTD3E5.js} +53 -52
  200. package/chunks/{version-E56RU7PR.js → version-EK7VAGSI.js} +3 -1
  201. package/chunks/{web-fetch-AAUCD7RM.js → web-fetch-24KZO763.js} +2 -2
  202. package/chunks/{web-search-HFUQF44Q.js → web-search-CRNXKZ2X.js} +184 -7
  203. package/chunks/{web-shell-static-POZHGGXE.js → web-shell-static-BFDESDD4.js} +5 -4
  204. package/chunks/{workflow-3MABM53N.js → workflow-HD5NYMW5.js} +201 -65
  205. package/chunks/{workspace-providers-status-2FRLBZ5I.js → workspace-providers-status-MAM42IZS.js} +24 -23
  206. package/chunks/{workspace-registration-store-YL7HLYYI.js → workspace-registration-store-HKLJEDQX.js} +1 -2
  207. package/chunks/{workspace-registry-BNRP2ELW.js → workspace-registry-7RDDOBLN.js} +18 -17
  208. package/chunks/{workspace-runtime-coordinator-WKGF7VHS.js → workspace-runtime-coordinator-LEPDPXJO.js} +18 -17
  209. package/chunks/{workspace-service-4MYO72MM.js → workspace-service-5IFDCNN3.js} +23 -22
  210. package/chunks/{workspace-skills-status-SU66TJLZ.js → workspace-skills-status-FJ3HNH4H.js} +22 -21
  211. package/chunks/{workspace-trust-reconciler-D5QT7WQB.js → workspace-trust-reconciler-PQFHIWLR.js} +23 -22
  212. package/chunks/{write-file-NVPQE2AZ.js → write-file-ERG67ZFX.js} +11 -11
  213. package/chunks/{zoom-image-RJHC66WG.js → zoom-image-WQYEC3SR.js} +2 -2
  214. package/cli.js +12 -12
  215. package/export-transcript-document.js +82 -82
  216. package/package.json +4 -4
  217. package/web-shell/assets/{abnfDiagram-VCTEODGH-DHc6plZn.js → abnfDiagram-VCTEODGH-BRLgQbnT.js} +1 -1
  218. package/web-shell/assets/{arc-BQ9m8TDV.js → arc-qAF9_XsR.js} +1 -1
  219. package/web-shell/assets/{architectureDiagram-5GKGNRK7-D5ap3oVB.js → architectureDiagram-5GKGNRK7-BorUttEz.js} +1 -1
  220. package/web-shell/assets/{blockDiagram-NRAW4CY4-BIbnyNph.js → blockDiagram-NRAW4CY4-Bj0qZVxu.js} +1 -1
  221. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BRsdx_iG.js → c4Diagram-UCG6FXSJ-BTqJis32.js} +1 -1
  222. package/web-shell/assets/channel-COIuCrVH.js +1 -0
  223. package/web-shell/assets/{chunk-2Q5K7J3B-3lf1fNlx.js → chunk-2Q5K7J3B-RrQ5X8m-.js} +1 -1
  224. package/web-shell/assets/{chunk-5VM5RSS4-DP8VNRc4.js → chunk-5VM5RSS4-uUjDl8wO.js} +1 -1
  225. package/web-shell/assets/{chunk-F27PBJKO-DrohDmZ6.js → chunk-F27PBJKO-C3JhpyzI.js} +1 -1
  226. package/web-shell/assets/{chunk-G27WJ6UU-UZ2QhSx6.js → chunk-G27WJ6UU-C8ZNFs7F.js} +1 -1
  227. package/web-shell/assets/{chunk-JWPE2WC7-BIMHVcZK.js → chunk-JWPE2WC7-DNpXtEOs.js} +1 -1
  228. package/web-shell/assets/{chunk-LCL6LL3I-izRxdSDd.js → chunk-LCL6LL3I-DagA2ZLw.js} +1 -1
  229. package/web-shell/assets/{chunk-POPQ4Y6H-CXADD4PP.js → chunk-POPQ4Y6H-R23uH7Xm.js} +1 -1
  230. package/web-shell/assets/{chunk-SVP7TREG-B96d8Y_1.js → chunk-SVP7TREG-Qz9RN_BR.js} +1 -1
  231. package/web-shell/assets/{chunk-XXDRQBXY-CF2sVQpv.js → chunk-XXDRQBXY-jYb1_hni.js} +1 -1
  232. package/web-shell/assets/classDiagram-DTDB5LWJ-DoX6OYqu.js +1 -0
  233. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DoX6OYqu.js +1 -0
  234. package/web-shell/assets/{cose-bilkent-JH36ORCC-CT6tXVAS.js → cose-bilkent-JH36ORCC-Cv2OunpE.js} +1 -1
  235. package/web-shell/assets/{cynefin-OW5HDTMX-X1NS4vtV.js → cynefin-OW5HDTMX-LH42KFJx.js} +1 -1
  236. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-DNsKNOT4.js → cynefinDiagram-5FMLGOSQ-Dha4_OoR.js} +1 -1
  237. package/web-shell/assets/{dagre-3AP2YEHR-9-AHKqsb.js → dagre-3AP2YEHR-Br5lnUKD.js} +1 -1
  238. package/web-shell/assets/{diagram-S7CK7UJ4-Bjgms7j6.js → diagram-S7CK7UJ4-dpKq2bBX.js} +1 -1
  239. package/web-shell/assets/{diagram-UQ7AKVKN-h6bCprbE.js → diagram-UQ7AKVKN-BAgHWpXr.js} +1 -1
  240. package/web-shell/assets/{diagram-VSXAHHWV-4SbQXVLt.js → diagram-VSXAHHWV-GRRzpyE2.js} +1 -1
  241. package/web-shell/assets/{diagram-VX7I27RA-B5gPCzzB.js → diagram-VX7I27RA-BNFiaYpG.js} +1 -1
  242. package/web-shell/assets/{diagram-Z3DM3KII-DFJXIA3A.js → diagram-Z3DM3KII-BisZzB_h.js} +1 -1
  243. package/web-shell/assets/{ebnfDiagram-PWID7BFC-FwyaU7VY.js → ebnfDiagram-PWID7BFC-B1xbwycf.js} +1 -1
  244. package/web-shell/assets/{erDiagram-SSCWMZ5O-8vJQh2te.js → erDiagram-SSCWMZ5O-CQMzbGE5.js} +1 -1
  245. package/web-shell/assets/{flowDiagram-A5DVABFB-BzA_1gMN.js → flowDiagram-A5DVABFB-CZ_Zondl.js} +1 -1
  246. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-Co-ABbVX.js → ganttDiagram-EL5Y4UJY-BTh2ShxS.js} +1 -1
  247. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-DW_FcyrX.js → gitGraphDiagram-WWUBYQGX-oHOB-Uxt.js} +1 -1
  248. package/web-shell/assets/{index-Bu-rZoJ-.js → index-CI1ysIEv.js} +478 -474
  249. package/web-shell/assets/index-CpxXGH-8.css +36 -0
  250. package/web-shell/assets/{index-BbMXfhNG.js → index-DWoFMu5x.js} +1 -1
  251. package/web-shell/assets/{infoDiagram-RXCK75RN-BEgfhUFN.js → infoDiagram-RXCK75RN-C0QpudbG.js} +1 -1
  252. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-DCsMxQmc.js → ishikawaDiagram-5VMMS53U-a6B741uT.js} +1 -1
  253. package/web-shell/assets/{journeyDiagram-EYS64GPL-DyIEYoHz.js → journeyDiagram-EYS64GPL-Dbht9ICp.js} +1 -1
  254. package/web-shell/assets/{kanban-definition-3QL26DDD-CkxjqCNr.js → kanban-definition-3QL26DDD-D4OFR8-h.js} +1 -1
  255. package/web-shell/assets/{layout-BEWc0Al9.js → layout-Dvdh5jRH.js} +1 -1
  256. package/web-shell/assets/{linear-CNuNxirL.js → linear-Dvc6KIW2.js} +1 -1
  257. package/web-shell/assets/{mermaid.core-DZBre674.js → mermaid.core-CB36RfIb.js} +6 -6
  258. package/web-shell/assets/{mindmap-definition-FBJOCRG2-CpafFz_F.js → mindmap-definition-FBJOCRG2-Fmqo1CjP.js} +1 -1
  259. package/web-shell/assets/{pegDiagram-XKGWAZYB-DfZqk_dq.js → pegDiagram-XKGWAZYB-CCxYBoA4.js} +1 -1
  260. package/web-shell/assets/{pieDiagram-E7YTZNPT-S0UWXlgC.js → pieDiagram-E7YTZNPT-BVHKQFzt.js} +1 -1
  261. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-dd37_Ohj.js → quadrantDiagram-AXDQQJYC-l95IznwR.js} +1 -1
  262. package/web-shell/assets/{railroadDiagram-O6MQD6OU-CH8NJZ7u.js → railroadDiagram-O6MQD6OU-BlLdRdXp.js} +1 -1
  263. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-CFdqWYih.js → requirementDiagram-EFPCY7ZU-BkDLBR5w.js} +1 -1
  264. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CsddcEGD.js → sankeyDiagram-P5KCCOFB-jAIqRp65.js} +1 -1
  265. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-BZ270mGw.js → sequenceDiagram-WJ2MYXX4-f-soZYPr.js} +1 -1
  266. package/web-shell/assets/{sizeCapture-X5ZJPWSS-CGaS4DBV.js → sizeCapture-X5ZJPWSS-BzOuAfB2.js} +1 -1
  267. package/web-shell/assets/{stateDiagram-HBIQ2CUA-COpIzMu6.js → stateDiagram-HBIQ2CUA-BPLSs12r.js} +1 -1
  268. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-IRul-LaT.js +1 -0
  269. package/web-shell/assets/{swimlanes-XN3QIQJK-CMF889m3.js → swimlanes-XN3QIQJK-D-9E_RIR.js} +1 -1
  270. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-D6lgKepA.js +8 -0
  271. package/web-shell/assets/{timeline-definition-24CTP7MA-BelnxYz5.js → timeline-definition-24CTP7MA-CT56K-gV.js} +1 -1
  272. package/web-shell/assets/{vennDiagram-4TSXK5OY-CU-NRqIB.js → vennDiagram-4TSXK5OY-B-vi4IyO.js} +1 -1
  273. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CDNKqWh-.js → wardleyDiagram-VM6X3IG4-C9O7Ju98.js} +1 -1
  274. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-CLqguL5D.js → xychartDiagram-S5SC5T6Z-6d8w3jg2.js} +1 -1
  275. package/web-shell/index.html +2 -2
  276. package/chunks/chunk-X35VIWWJ.js +0 -276
  277. package/web-shell/assets/channel-uMMdTrYk.js +0 -1
  278. package/web-shell/assets/classDiagram-DTDB5LWJ-DcY-26Ig.js +0 -1
  279. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DcY-26Ig.js +0 -1
  280. package/web-shell/assets/index-CsPwZ1ut.css +0 -36
  281. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-D6qEVAji.js +0 -1
  282. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-mem5Jj4m.js +0 -8
@@ -9,6 +9,9 @@ import {
9
9
  CLIENT_ID_RE,
10
10
  MAX_CLIENT_ID_LENGTH
11
11
  } from "./chunk-LAUEEBDL.js";
12
+ import {
13
+ isPreAuthWebShellRequest
14
+ } from "./chunk-SVWWF5TZ.js";
12
15
  import {
13
16
  formatHostForAuthority,
14
17
  isLoopbackBind
@@ -923,78 +926,6 @@ function isDeepHealthQuery(raw) {
923
926
  }
924
927
  __name(isDeepHealthQuery, "isDeepHealthQuery");
925
928
 
926
- // packages/cli/src/serve/server/self-origin.ts
927
- init_esbuild_shims();
928
- function installSelfOriginStripMiddleware(app, getPort, bind) {
929
- let cachedStripPort = -1;
930
- let cachedSelfOrigins = /* @__PURE__ */ new Set();
931
- const boundHost = isLoopbackBind(bind) ? formatHostForAuthority(bind) : void 0;
932
- app.use((req, _res, next) => {
933
- const origin = req.headers.origin;
934
- if (origin) {
935
- const port = getPort();
936
- if (port !== cachedStripPort) {
937
- cachedStripPort = port;
938
- cachedSelfOrigins = /* @__PURE__ */ new Set([
939
- `http://127.0.0.1:${port}`,
940
- `http://localhost:${port}`,
941
- `http://[::1]:${port}`,
942
- `http://host.docker.internal:${port}`,
943
- `https://127.0.0.1:${port}`,
944
- `https://localhost:${port}`,
945
- `https://[::1]:${port}`,
946
- `https://host.docker.internal:${port}`
947
- ]);
948
- if (boundHost) {
949
- cachedSelfOrigins.add(`http://${boundHost}:${port}`);
950
- cachedSelfOrigins.add(`https://${boundHost}:${port}`);
951
- }
952
- if (port === 80) {
953
- for (const host of [
954
- "127.0.0.1",
955
- "localhost",
956
- "[::1]",
957
- "host.docker.internal"
958
- ]) {
959
- cachedSelfOrigins.add(`http://${host}`);
960
- }
961
- if (boundHost) {
962
- cachedSelfOrigins.add(`http://${boundHost}`);
963
- }
964
- } else if (port === 443) {
965
- for (const host of [
966
- "127.0.0.1",
967
- "localhost",
968
- "[::1]",
969
- "host.docker.internal"
970
- ]) {
971
- cachedSelfOrigins.add(`https://${host}`);
972
- }
973
- if (boundHost) {
974
- cachedSelfOrigins.add(`https://${boundHost}`);
975
- }
976
- }
977
- }
978
- if (cachedSelfOrigins.has(origin)) {
979
- delete req.headers.origin;
980
- }
981
- }
982
- next();
983
- });
984
- }
985
- __name(installSelfOriginStripMiddleware, "installSelfOriginStripMiddleware");
986
-
987
- // packages/cli/src/serve/acp-child-extra-args.ts
988
- init_esbuild_shims();
989
- function acpChildExtraArgs(opts) {
990
- const extraArgs = [
991
- ...opts.experimentalLsp === true ? ["--experimental-lsp"] : [],
992
- ...opts.restoreAskUserQuestion === true ? ["--restore-ask-user-question"] : []
993
- ];
994
- return extraArgs.length > 0 ? extraArgs : void 0;
995
- }
996
- __name(acpChildExtraArgs, "acpChildExtraArgs");
997
-
998
929
  // packages/cli/src/serve/local-control/credentials.ts
999
930
  init_esbuild_shims();
1000
931
  import { createHash, timingSafeEqual } from "node:crypto";
@@ -1094,11 +1025,203 @@ function listenerIdentityOfSocket(socket) {
1094
1025
  }
1095
1026
  __name(listenerIdentityOfSocket, "listenerIdentityOfSocket");
1096
1027
 
1028
+ // packages/cli/src/serve/server/access-log.ts
1029
+ init_esbuild_shims();
1030
+ init_esm();
1031
+ import { performance } from "node:perf_hooks";
1032
+
1033
+ // packages/cli/src/serve/server/telemetry-context.ts
1034
+ init_esbuild_shims();
1035
+ var daemonTelemetryResponseContext = Symbol(
1036
+ "daemonTelemetryResponseContext"
1037
+ );
1038
+ var daemonInboundTraceIdContext = Symbol(
1039
+ "daemonInboundTraceIdContext"
1040
+ );
1041
+ function getDaemonTelemetryInboundTraceId(res) {
1042
+ try {
1043
+ return res[daemonInboundTraceIdContext];
1044
+ } catch {
1045
+ return void 0;
1046
+ }
1047
+ }
1048
+ __name(getDaemonTelemetryInboundTraceId, "getDaemonTelemetryInboundTraceId");
1049
+
1050
+ // packages/cli/src/serve/server/access-log.ts
1051
+ var SESSION_ID_RE = /\/session\/([^/]+)/;
1052
+ var ACCESS_LOG_BURST = 60;
1053
+ var ACCESS_LOG_REFILL_PER_SECOND = 2;
1054
+ var ACCESS_LOG_REJECT_BURST = 30;
1055
+ var ACCESS_LOG_REJECT_REFILL_PER_SECOND = 1;
1056
+ var ROUTE_MAX_BYTES = 2 * 1024;
1057
+ var SESSION_ID_MAX_BYTES = 256;
1058
+ var CLIENT_ID_MAX_BYTES = 256;
1059
+ var ACCESS_LOG_CONTROLLER_LOCAL = "accessLogController";
1060
+ var ACCESS_LOG_REJECT_LOCAL = "accessLogPreAuthReject";
1061
+ function emptySuppressedCounts() {
1062
+ return {
1063
+ suppressed: 0,
1064
+ status2xx: 0,
1065
+ status3xx: 0,
1066
+ status4xx: 0,
1067
+ status5xx: 0,
1068
+ statusOther: 0
1069
+ };
1070
+ }
1071
+ __name(emptySuppressedCounts, "emptySuppressedCounts");
1072
+ function countSuppressed(counts, status) {
1073
+ counts.suppressed += 1;
1074
+ if (status >= 200 && status < 300) counts.status2xx += 1;
1075
+ else if (status >= 300 && status < 400) counts.status3xx += 1;
1076
+ else if (status >= 400 && status < 500) counts.status4xx += 1;
1077
+ else if (status >= 500 && status < 600) counts.status5xx += 1;
1078
+ else counts.statusOther += 1;
1079
+ }
1080
+ __name(countSuppressed, "countSuppressed");
1081
+ function firstRawHeader(rawHeaders, targetName) {
1082
+ for (let i = 0; i + 1 < rawHeaders.length; i += 2) {
1083
+ if (rawHeaders[i]?.toLowerCase() === targetName) return rawHeaders[i + 1];
1084
+ }
1085
+ return void 0;
1086
+ }
1087
+ __name(firstRawHeader, "firstRawHeader");
1088
+ function truncateUtf8(value, maxBytes) {
1089
+ const bytes = Buffer.from(value, "utf8");
1090
+ if (bytes.length <= maxBytes) return { value };
1091
+ let end = maxBytes;
1092
+ while (end > 0 && (bytes[end] & 192) === 128) end -= 1;
1093
+ return {
1094
+ value: bytes.subarray(0, end).toString("utf8"),
1095
+ originalBytes: bytes.length
1096
+ };
1097
+ }
1098
+ __name(truncateUtf8, "truncateUtf8");
1099
+ function installAccessLogMiddleware(app, daemonLog, monotonicNow = () => performance.now()) {
1100
+ let sealed = false;
1101
+ let tokens = ACCESS_LOG_BURST;
1102
+ let refillBaseline = monotonicNow();
1103
+ let rejectTokens = ACCESS_LOG_REJECT_BURST;
1104
+ let rejectRefillBaseline = refillBaseline;
1105
+ const suppressed = emptySuppressedCounts();
1106
+ const suppressedRejects = emptySuppressedCounts();
1107
+ const refill = /* @__PURE__ */ __name(() => {
1108
+ const now = Math.max(monotonicNow(), refillBaseline);
1109
+ tokens = Math.min(
1110
+ ACCESS_LOG_BURST,
1111
+ tokens + (now - refillBaseline) / 1e3 * ACCESS_LOG_REFILL_PER_SECOND
1112
+ );
1113
+ refillBaseline = now;
1114
+ }, "refill");
1115
+ const refillReject = /* @__PURE__ */ __name(() => {
1116
+ const now = Math.max(monotonicNow(), rejectRefillBaseline);
1117
+ rejectTokens = Math.min(
1118
+ ACCESS_LOG_REJECT_BURST,
1119
+ rejectTokens + (now - rejectRefillBaseline) / 1e3 * ACCESS_LOG_REJECT_REFILL_PER_SECOND
1120
+ );
1121
+ rejectRefillBaseline = now;
1122
+ }, "refillReject");
1123
+ const flushSuppressed = /* @__PURE__ */ __name((counts) => {
1124
+ if (!daemonLog || counts.suppressed === 0) return false;
1125
+ context.with(ROOT_CONTEXT, () => {
1126
+ daemonLog.warn("access logs suppressed", { ...counts });
1127
+ });
1128
+ Object.assign(counts, emptySuppressedCounts());
1129
+ return true;
1130
+ }, "flushSuppressed");
1131
+ const controller = {
1132
+ sealAndFlushSuppressed: /* @__PURE__ */ __name(() => {
1133
+ if (sealed) return;
1134
+ sealed = true;
1135
+ try {
1136
+ flushSuppressed(suppressed);
1137
+ flushSuppressed(suppressedRejects);
1138
+ } catch {
1139
+ }
1140
+ }, "sealAndFlushSuppressed")
1141
+ };
1142
+ app.locals[ACCESS_LOG_CONTROLLER_LOCAL] = controller;
1143
+ if (!daemonLog) return controller;
1144
+ app.use((req, res, next) => {
1145
+ const { method, path: reqPath } = req;
1146
+ if (method === "GET" && reqPath === "/health" || method === "POST" && reqPath.endsWith("/heartbeat")) {
1147
+ return next();
1148
+ }
1149
+ const startMs = monotonicNow();
1150
+ res.on("finish", () => {
1151
+ try {
1152
+ if (sealed) return;
1153
+ const status = res.statusCode;
1154
+ if (method === "GET" && reqPath.endsWith("/events") && status === 200) {
1155
+ return;
1156
+ }
1157
+ refill();
1158
+ refillReject();
1159
+ const isPreAuthReject = Boolean(
1160
+ res.locals?.[ACCESS_LOG_REJECT_LOCAL]
1161
+ );
1162
+ if (isPreAuthReject) {
1163
+ if (suppressedRejects.suppressed > 0 && rejectTokens >= 1) {
1164
+ rejectTokens -= 1;
1165
+ flushSuppressed(suppressedRejects);
1166
+ }
1167
+ if (rejectTokens < 1) {
1168
+ countSuppressed(suppressedRejects, status);
1169
+ return;
1170
+ }
1171
+ rejectTokens -= 1;
1172
+ } else {
1173
+ if (suppressed.suppressed > 0 && tokens >= 1) {
1174
+ tokens -= 1;
1175
+ flushSuppressed(suppressed);
1176
+ }
1177
+ if (tokens < 1) {
1178
+ countSuppressed(suppressed, status);
1179
+ return;
1180
+ }
1181
+ tokens -= 1;
1182
+ }
1183
+ const route = truncateUtf8(`${method} ${reqPath}`, ROUTE_MAX_BYTES);
1184
+ const sessionMatch = reqPath.match(SESSION_ID_RE);
1185
+ const sessionId = sessionMatch?.[1] ? truncateUtf8(sessionMatch[1], SESSION_ID_MAX_BYTES) : void 0;
1186
+ const rawClientId = firstRawHeader(req.rawHeaders, "x-qwen-client-id");
1187
+ const clientId = rawClientId ? truncateUtf8(rawClientId, CLIENT_ID_MAX_BYTES) : void 0;
1188
+ const inboundTraceId = getDaemonTelemetryInboundTraceId(res);
1189
+ const ctx = {
1190
+ route: route.value,
1191
+ ...route.originalBytes ? { routeOriginalBytes: route.originalBytes } : {},
1192
+ ...sessionId ? {
1193
+ sessionId: sessionId.value,
1194
+ ...sessionId.originalBytes ? { sessionIdOriginalBytes: sessionId.originalBytes } : {}
1195
+ } : {},
1196
+ ...clientId ? {
1197
+ clientId: clientId.value,
1198
+ ...clientId.originalBytes ? { clientIdOriginalBytes: clientId.originalBytes } : {}
1199
+ } : {},
1200
+ ...inboundTraceId ? { traceId: inboundTraceId } : {},
1201
+ status,
1202
+ durationMs: Math.max(0, Math.round(monotonicNow() - startMs))
1203
+ };
1204
+ if (status >= 400) daemonLog.warn("request completed", ctx);
1205
+ else daemonLog.info("request completed", ctx);
1206
+ } catch {
1207
+ }
1208
+ });
1209
+ next();
1210
+ });
1211
+ return controller;
1212
+ }
1213
+ __name(installAccessLogMiddleware, "installAccessLogMiddleware");
1214
+
1097
1215
  // packages/cli/src/serve/auth.ts
1098
1216
  init_esbuild_shims();
1217
+ function markPreAuthReject(res) {
1218
+ (res.locals ??= {})[ACCESS_LOG_REJECT_LOCAL] = true;
1219
+ }
1220
+ __name(markPreAuthReject, "markPreAuthReject");
1099
1221
  var denyBrowserOriginCors = /* @__PURE__ */ __name((req, res, next) => {
1100
1222
  if (req.headers.origin) {
1101
1223
  res.setHeader("Vary", "Origin");
1224
+ markPreAuthReject(res);
1102
1225
  res.status(403).json({ error: "Request denied by CORS policy" });
1103
1226
  return;
1104
1227
  }
@@ -1201,6 +1324,7 @@ function allowOriginCors(patterns) {
1201
1324
  }
1202
1325
  if (origin === "null") {
1203
1326
  res.setHeader("Vary", "Origin");
1327
+ markPreAuthReject(res);
1204
1328
  res.status(403).json({ error: "Request denied by CORS policy" });
1205
1329
  return;
1206
1330
  }
@@ -1220,6 +1344,7 @@ function allowOriginCors(patterns) {
1220
1344
  return;
1221
1345
  }
1222
1346
  res.setHeader("Vary", "Origin");
1347
+ markPreAuthReject(res);
1223
1348
  res.status(403).json({ error: "Request denied by CORS policy" });
1224
1349
  };
1225
1350
  }
@@ -1235,6 +1360,7 @@ function hostAllowlist(bind, getPort) {
1235
1360
  const host = (req.headers.host || "").toLowerCase();
1236
1361
  const browserHost = listener.origin === void 0 ? void 0 : new URL(listener.origin).host.toLowerCase();
1237
1362
  if (listener.authority === void 0 || host !== listener.authority && host !== browserHost) {
1363
+ markPreAuthReject(res);
1238
1364
  res.status(403).json({ error: "Invalid Host header" });
1239
1365
  return;
1240
1366
  }
@@ -1272,6 +1398,7 @@ function buildPrimaryHostGate(bind, getPort) {
1272
1398
  const port = getPort();
1273
1399
  const host = (req.headers.host || "").toLowerCase();
1274
1400
  if (!allowedFor(port).has(host)) {
1401
+ markPreAuthReject(res);
1275
1402
  res.status(403).json({ error: "Invalid Host header" });
1276
1403
  return;
1277
1404
  }
@@ -1353,6 +1480,119 @@ function createMutationGate(deps) {
1353
1480
  }
1354
1481
  __name(createMutationGate, "createMutationGate");
1355
1482
 
1483
+ // packages/cli/src/serve/server/self-origin.ts
1484
+ init_esbuild_shims();
1485
+ import { TLSSocket } from "node:tls";
1486
+ function installRemoteSelfOriginMiddleware(app, bind, token) {
1487
+ if (isLoopbackBind(bind) || !token) return;
1488
+ const authenticate = bearerAuth(token);
1489
+ app.use((req, res, next) => {
1490
+ const origin = req.headers.origin;
1491
+ const host = req.headers.host;
1492
+ if (!origin || !host || listenerIdentityOf(req).kind !== "primary") {
1493
+ next();
1494
+ return;
1495
+ }
1496
+ const scheme = req.socket instanceof TLSSocket && req.socket.encrypted ? "https" : "http";
1497
+ let authority = host.toLowerCase();
1498
+ if (scheme === "http" && authority.endsWith(":80"))
1499
+ authority = authority.slice(0, -3);
1500
+ else if (scheme === "https" && authority.endsWith(":443"))
1501
+ authority = authority.slice(0, -4);
1502
+ if (origin !== `${scheme}://${authority}`) {
1503
+ next();
1504
+ return;
1505
+ }
1506
+ try {
1507
+ if (new URL(origin).origin !== origin) {
1508
+ next();
1509
+ return;
1510
+ }
1511
+ } catch {
1512
+ next();
1513
+ return;
1514
+ }
1515
+ (res.locals ??= {})[ACCESS_LOG_REJECT_LOCAL] = true;
1516
+ const allow = /* @__PURE__ */ __name(() => {
1517
+ delete res.locals[ACCESS_LOG_REJECT_LOCAL];
1518
+ delete req.headers.origin;
1519
+ next();
1520
+ }, "allow");
1521
+ if (isPreAuthWebShellRequest(req)) allow();
1522
+ else authenticate(req, res, allow);
1523
+ });
1524
+ }
1525
+ __name(installRemoteSelfOriginMiddleware, "installRemoteSelfOriginMiddleware");
1526
+ function installSelfOriginStripMiddleware(app, getPort, bind) {
1527
+ let cachedStripPort = -1;
1528
+ let cachedSelfOrigins = /* @__PURE__ */ new Set();
1529
+ const boundHost = isLoopbackBind(bind) ? formatHostForAuthority(bind) : void 0;
1530
+ app.use((req, _res, next) => {
1531
+ const origin = req.headers.origin;
1532
+ if (origin) {
1533
+ const port = getPort();
1534
+ if (port !== cachedStripPort) {
1535
+ cachedStripPort = port;
1536
+ cachedSelfOrigins = /* @__PURE__ */ new Set([
1537
+ `http://127.0.0.1:${port}`,
1538
+ `http://localhost:${port}`,
1539
+ `http://[::1]:${port}`,
1540
+ `http://host.docker.internal:${port}`,
1541
+ `https://127.0.0.1:${port}`,
1542
+ `https://localhost:${port}`,
1543
+ `https://[::1]:${port}`,
1544
+ `https://host.docker.internal:${port}`
1545
+ ]);
1546
+ if (boundHost) {
1547
+ cachedSelfOrigins.add(`http://${boundHost}:${port}`);
1548
+ cachedSelfOrigins.add(`https://${boundHost}:${port}`);
1549
+ }
1550
+ if (port === 80) {
1551
+ for (const host of [
1552
+ "127.0.0.1",
1553
+ "localhost",
1554
+ "[::1]",
1555
+ "host.docker.internal"
1556
+ ]) {
1557
+ cachedSelfOrigins.add(`http://${host}`);
1558
+ }
1559
+ if (boundHost) {
1560
+ cachedSelfOrigins.add(`http://${boundHost}`);
1561
+ }
1562
+ } else if (port === 443) {
1563
+ for (const host of [
1564
+ "127.0.0.1",
1565
+ "localhost",
1566
+ "[::1]",
1567
+ "host.docker.internal"
1568
+ ]) {
1569
+ cachedSelfOrigins.add(`https://${host}`);
1570
+ }
1571
+ if (boundHost) {
1572
+ cachedSelfOrigins.add(`https://${boundHost}`);
1573
+ }
1574
+ }
1575
+ }
1576
+ if (cachedSelfOrigins.has(origin)) {
1577
+ delete req.headers.origin;
1578
+ }
1579
+ }
1580
+ next();
1581
+ });
1582
+ }
1583
+ __name(installSelfOriginStripMiddleware, "installSelfOriginStripMiddleware");
1584
+
1585
+ // packages/cli/src/serve/acp-child-extra-args.ts
1586
+ init_esbuild_shims();
1587
+ function acpChildExtraArgs(opts) {
1588
+ const extraArgs = [
1589
+ ...opts.experimentalLsp === true ? ["--experimental-lsp"] : [],
1590
+ ...opts.restoreAskUserQuestion === true ? ["--restore-ask-user-question"] : []
1591
+ ];
1592
+ return extraArgs.length > 0 ? extraArgs : void 0;
1593
+ }
1594
+ __name(acpChildExtraArgs, "acpChildExtraArgs");
1595
+
1356
1596
  // packages/cli/src/serve/acp-http/client-mcp-sender-registry.ts
1357
1597
  init_esbuild_shims();
1358
1598
  var ClientMcpSenderRegistry = class {
@@ -4312,161 +4552,92 @@ var WorkspaceVoiceCoordinator = class {
4312
4552
  }
4313
4553
  };
4314
4554
 
4315
- // packages/cli/src/serve/server/access-log.ts
4316
- init_esbuild_shims();
4317
- init_esm();
4318
- import { performance } from "node:perf_hooks";
4319
-
4320
- // packages/cli/src/serve/server/telemetry-context.ts
4555
+ // packages/cli/src/serve/local-control/lan-interfaces.ts
4321
4556
  init_esbuild_shims();
4322
- var daemonTelemetryResponseContext = Symbol(
4323
- "daemonTelemetryResponseContext"
4324
- );
4325
- var daemonInboundTraceIdContext = Symbol(
4326
- "daemonInboundTraceIdContext"
4327
- );
4328
- function getDaemonTelemetryInboundTraceId(res) {
4329
- try {
4330
- return res[daemonInboundTraceIdContext];
4331
- } catch {
4332
- return void 0;
4557
+ import { networkInterfaces } from "node:os";
4558
+ function isLanIpv4(address) {
4559
+ const octets = address.split(".").map((part) => Number(part));
4560
+ if (octets.length !== 4 || octets.some((o) => !Number.isInteger(o))) {
4561
+ return false;
4333
4562
  }
4563
+ const [a, b] = octets;
4564
+ if (a === 10) return true;
4565
+ if (a === 172 && b >= 16 && b <= 31) return true;
4566
+ if (a === 192 && b === 168) return true;
4567
+ if (a === 169 && b === 254) return true;
4568
+ return false;
4334
4569
  }
4335
- __name(getDaemonTelemetryInboundTraceId, "getDaemonTelemetryInboundTraceId");
4336
-
4337
- // packages/cli/src/serve/server/access-log.ts
4338
- var SESSION_ID_RE = /\/session\/([^/]+)/;
4339
- var ACCESS_LOG_BURST = 60;
4340
- var ACCESS_LOG_REFILL_PER_SECOND = 2;
4341
- var ROUTE_MAX_BYTES = 2 * 1024;
4342
- var SESSION_ID_MAX_BYTES = 256;
4343
- var CLIENT_ID_MAX_BYTES = 256;
4344
- var ACCESS_LOG_CONTROLLER_LOCAL = "accessLogController";
4345
- function emptySuppressedCounts() {
4346
- return {
4347
- suppressed: 0,
4348
- status2xx: 0,
4349
- status3xx: 0,
4350
- status4xx: 0,
4351
- status5xx: 0,
4352
- statusOther: 0
4353
- };
4354
- }
4355
- __name(emptySuppressedCounts, "emptySuppressedCounts");
4356
- function countSuppressed(counts, status) {
4357
- counts.suppressed += 1;
4358
- if (status >= 200 && status < 300) counts.status2xx += 1;
4359
- else if (status >= 300 && status < 400) counts.status3xx += 1;
4360
- else if (status >= 400 && status < 500) counts.status4xx += 1;
4361
- else if (status >= 500 && status < 600) counts.status5xx += 1;
4362
- else counts.statusOther += 1;
4570
+ __name(isLanIpv4, "isLanIpv4");
4571
+ function isSoftwareNetwork(interfaceName) {
4572
+ if (/vpn/i.test(interfaceName)) return true;
4573
+ return /(^|[\s_.-])(utun|tun|tap|ppp|ipsec|wg|wireguard|tailscale|zerotier|zt[a-z0-9]*|hamachi|nordlynx|proton|wintun|docker|veth[0-9a-f]+|vmnet|vboxnet|vethernet|virtualbox|host[- ]only|podman|cni|lxcbr|lxdbr|flannel|virbr|br-[0-9a-f]+|bridge\d|anyconnect|globalprotect|pulse[\s-]secure|forticlient|fortinet|ivanti|cisco[\s_-]secure|citrix|sonicwall|cloudflare)(\d|[\s_.-]|$)/i.test(
4574
+ interfaceName
4575
+ );
4363
4576
  }
4364
- __name(countSuppressed, "countSuppressed");
4365
- function firstRawHeader(rawHeaders, targetName) {
4366
- for (let i = 0; i + 1 < rawHeaders.length; i += 2) {
4367
- if (rawHeaders[i]?.toLowerCase() === targetName) return rawHeaders[i + 1];
4577
+ __name(isSoftwareNetwork, "isSoftwareNetwork");
4578
+ function listLanCandidates(interfaces = networkInterfaces()) {
4579
+ const candidates = [];
4580
+ for (const [interfaceName, addresses] of Object.entries(interfaces).sort()) {
4581
+ if (isSoftwareNetwork(interfaceName)) continue;
4582
+ for (const address of addresses ?? []) {
4583
+ if (address.family !== "IPv4" || address.internal) continue;
4584
+ if (!isLanIpv4(address.address)) continue;
4585
+ candidates.push({ interfaceName, address: address.address });
4586
+ }
4368
4587
  }
4369
- return void 0;
4588
+ return candidates;
4370
4589
  }
4371
- __name(firstRawHeader, "firstRawHeader");
4372
- function truncateUtf8(value, maxBytes) {
4373
- const bytes = Buffer.from(value, "utf8");
4374
- if (bytes.length <= maxBytes) return { value };
4375
- let end = maxBytes;
4376
- while (end > 0 && (bytes[end] & 192) === 128) end -= 1;
4377
- return {
4378
- value: bytes.subarray(0, end).toString("utf8"),
4379
- originalBytes: bytes.length
4380
- };
4381
- }
4382
- __name(truncateUtf8, "truncateUtf8");
4383
- function installAccessLogMiddleware(app, daemonLog, monotonicNow = () => performance.now()) {
4384
- let sealed = false;
4385
- let tokens = ACCESS_LOG_BURST;
4386
- let refillBaseline = monotonicNow();
4387
- let suppressed = emptySuppressedCounts();
4388
- const refill = /* @__PURE__ */ __name(() => {
4389
- const now = Math.max(monotonicNow(), refillBaseline);
4390
- tokens = Math.min(
4391
- ACCESS_LOG_BURST,
4392
- tokens + (now - refillBaseline) / 1e3 * ACCESS_LOG_REFILL_PER_SECOND
4590
+ __name(listLanCandidates, "listLanCandidates");
4591
+ var NoLanInterfaceError = class extends Error {
4592
+ static {
4593
+ __name(this, "NoLanInterfaceError");
4594
+ }
4595
+ code = "no_lan_interface";
4596
+ constructor() {
4597
+ super(
4598
+ "No private IPv4 address is available. Local Control needs the host to be on a local network (Wi-Fi or Ethernet)."
4393
4599
  );
4394
- refillBaseline = now;
4395
- }, "refill");
4396
- const flushSuppressed = /* @__PURE__ */ __name(() => {
4397
- if (!daemonLog || suppressed.suppressed === 0) return false;
4398
- context.with(ROOT_CONTEXT, () => {
4399
- daemonLog.warn("access logs suppressed", suppressed);
4400
- });
4401
- suppressed = emptySuppressedCounts();
4402
- return true;
4403
- }, "flushSuppressed");
4404
- const controller = {
4405
- sealAndFlushSuppressed: /* @__PURE__ */ __name(() => {
4406
- if (sealed) return;
4407
- sealed = true;
4408
- try {
4409
- flushSuppressed();
4410
- } catch {
4411
- }
4412
- }, "sealAndFlushSuppressed")
4413
- };
4414
- app.locals[ACCESS_LOG_CONTROLLER_LOCAL] = controller;
4415
- if (!daemonLog) return controller;
4416
- app.use((req, res, next) => {
4417
- const { method, path: reqPath } = req;
4418
- if (method === "GET" && reqPath === "/health" || method === "POST" && reqPath.endsWith("/heartbeat")) {
4419
- return next();
4420
- }
4421
- const startMs = monotonicNow();
4422
- res.on("finish", () => {
4423
- try {
4424
- if (sealed) return;
4425
- const status = res.statusCode;
4426
- if (method === "GET" && reqPath.endsWith("/events") && status === 200) {
4427
- return;
4428
- }
4429
- refill();
4430
- if (suppressed.suppressed > 0 && tokens >= 1) {
4431
- tokens -= 1;
4432
- flushSuppressed();
4433
- }
4434
- if (tokens < 1) {
4435
- countSuppressed(suppressed, status);
4436
- return;
4437
- }
4438
- tokens -= 1;
4439
- const route = truncateUtf8(`${method} ${reqPath}`, ROUTE_MAX_BYTES);
4440
- const sessionMatch = reqPath.match(SESSION_ID_RE);
4441
- const sessionId = sessionMatch?.[1] ? truncateUtf8(sessionMatch[1], SESSION_ID_MAX_BYTES) : void 0;
4442
- const rawClientId = firstRawHeader(req.rawHeaders, "x-qwen-client-id");
4443
- const clientId = rawClientId ? truncateUtf8(rawClientId, CLIENT_ID_MAX_BYTES) : void 0;
4444
- const inboundTraceId = getDaemonTelemetryInboundTraceId(res);
4445
- const ctx = {
4446
- route: route.value,
4447
- ...route.originalBytes ? { routeOriginalBytes: route.originalBytes } : {},
4448
- ...sessionId ? {
4449
- sessionId: sessionId.value,
4450
- ...sessionId.originalBytes ? { sessionIdOriginalBytes: sessionId.originalBytes } : {}
4451
- } : {},
4452
- ...clientId ? {
4453
- clientId: clientId.value,
4454
- ...clientId.originalBytes ? { clientIdOriginalBytes: clientId.originalBytes } : {}
4455
- } : {},
4456
- ...inboundTraceId ? { traceId: inboundTraceId } : {},
4457
- status,
4458
- durationMs: Math.max(0, Math.round(monotonicNow() - startMs))
4459
- };
4460
- if (status >= 400) daemonLog.warn("request completed", ctx);
4461
- else daemonLog.info("request completed", ctx);
4462
- } catch {
4463
- }
4464
- });
4465
- next();
4466
- });
4467
- return controller;
4600
+ this.name = "NoLanInterfaceError";
4601
+ }
4602
+ };
4603
+ var AmbiguousLanInterfaceError = class extends Error {
4604
+ static {
4605
+ __name(this, "AmbiguousLanInterfaceError");
4606
+ }
4607
+ code = "ambiguous_lan_interface";
4608
+ candidates;
4609
+ constructor(candidates) {
4610
+ super(
4611
+ "Multiple local networks are available; choose which one to expose: " + candidates.map((c) => `${c.interfaceName} (${c.address})`).join(", ")
4612
+ );
4613
+ this.name = "AmbiguousLanInterfaceError";
4614
+ this.candidates = candidates;
4615
+ }
4616
+ };
4617
+ var UnknownLanInterfaceError = class extends Error {
4618
+ static {
4619
+ __name(this, "UnknownLanInterfaceError");
4620
+ }
4621
+ code = "unknown_lan_interface";
4622
+ constructor(requested) {
4623
+ super(
4624
+ `${requested} is not a private IPv4 address on this host right now. The network may have changed since the list was fetched.`
4625
+ );
4626
+ this.name = "UnknownLanInterfaceError";
4627
+ }
4628
+ };
4629
+ function selectLanAddress(preferredAddress, interfaces = networkInterfaces()) {
4630
+ const candidates = listLanCandidates(interfaces);
4631
+ if (candidates.length === 0) throw new NoLanInterfaceError();
4632
+ if (preferredAddress !== void 0) {
4633
+ const match = candidates.find((c) => c.address === preferredAddress);
4634
+ if (!match) throw new UnknownLanInterfaceError(preferredAddress);
4635
+ return match;
4636
+ }
4637
+ if (candidates.length > 1) throw new AmbiguousLanInterfaceError(candidates);
4638
+ return candidates[0];
4468
4639
  }
4469
- __name(installAccessLogMiddleware, "installAccessLogMiddleware");
4640
+ __name(selectLanAddress, "selectLanAddress");
4470
4641
 
4471
4642
  export {
4472
4643
  sanitizeForStderr,
@@ -4481,13 +4652,15 @@ export {
4481
4652
  createBridgeFileSystemAdapter,
4482
4653
  PathMutexRegistry,
4483
4654
  isDeepHealthQuery,
4484
- installSelfOriginStripMiddleware,
4485
- acpChildExtraArgs,
4486
4655
  CredentialStore,
4487
4656
  singleTokenCredentials,
4488
4657
  tagListener,
4489
4658
  listenerIdentityOf,
4490
4659
  listenerIdentityOfSocket,
4660
+ daemonTelemetryResponseContext,
4661
+ daemonInboundTraceIdContext,
4662
+ ACCESS_LOG_CONTROLLER_LOCAL,
4663
+ installAccessLogMiddleware,
4491
4664
  denyBrowserOriginCors,
4492
4665
  parseAllowOriginPatterns,
4493
4666
  findNonLoopbackHttpOrigin,
@@ -4498,6 +4671,15 @@ export {
4498
4671
  isTrustedLoopbackMode,
4499
4672
  requestHasOperatorAuthority,
4500
4673
  createMutationGate,
4674
+ installRemoteSelfOriginMiddleware,
4675
+ installSelfOriginStripMiddleware,
4676
+ isSoftwareNetwork,
4677
+ listLanCandidates,
4678
+ NoLanInterfaceError,
4679
+ AmbiguousLanInterfaceError,
4680
+ UnknownLanInterfaceError,
4681
+ selectLanAddress,
4682
+ acpChildExtraArgs,
4501
4683
  ClientMcpSenderRegistry,
4502
4684
  createClientMcpServerProvider,
4503
4685
  SERVE_CAPABILITY_REGISTRY,
@@ -4539,11 +4721,7 @@ export {
4539
4721
  isBrowserAutomationMcpAvailable,
4540
4722
  MAX_CONCURRENT_VOICE_SESSIONS,
4541
4723
  VoiceLeaseAbortError,
4542
- WorkspaceVoiceCoordinator,
4543
- daemonTelemetryResponseContext,
4544
- daemonInboundTraceIdContext,
4545
- ACCESS_LOG_CONTROLLER_LOCAL,
4546
- installAccessLogMiddleware
4724
+ WorkspaceVoiceCoordinator
4547
4725
  };
4548
4726
  /**
4549
4727
  * @license