@qwen-code/qwen-code 0.23.1-preview.2 → 0.23.2-nightly.20260909.2e212144d3

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 (335) hide show
  1. package/README.md +35 -15
  2. package/bundled/computer-use/SKILL.md +189 -116
  3. package/bundled/goal-draft/SKILL.md +23 -13
  4. package/bundled/qc-helper/docs/_meta.ts +1 -0
  5. package/bundled/qc-helper/docs/configuration/auth.md +1 -1
  6. package/bundled/qc-helper/docs/configuration/model-providers.md +66 -16
  7. package/bundled/qc-helper/docs/configuration/settings.md +50 -0
  8. package/bundled/qc-helper/docs/conversations-recovery.md +102 -0
  9. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  10. package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
  11. package/bundled/qc-helper/docs/features/channels/github.md +1 -9
  12. package/bundled/qc-helper/docs/features/channels/overview.md +27 -52
  13. package/bundled/qc-helper/docs/features/channels/qqbot.md +1 -2
  14. package/bundled/qc-helper/docs/features/commands.md +79 -17
  15. package/bundled/qc-helper/docs/features/computer-use.md +9 -7
  16. package/bundled/qc-helper/docs/features/cross-session-protocol.md +291 -0
  17. package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
  18. package/bundled/qc-helper/docs/features/goals.md +17 -3
  19. package/bundled/qc-helper/docs/features/sub-agents.md +8 -0
  20. package/bundled/qc-helper/docs/qwen-serve.md +80 -48
  21. package/chunks/{MaxSizedBox-IYIQ43IZ.js → MaxSizedBox-ZBGWYJZW.js} +29 -28
  22. package/chunks/{StandaloneSessionPicker-AWB2OHX6.js → StandaloneSessionPicker-NR5ACIJZ.js} +48 -47
  23. package/chunks/{acp-startup-profiler-BAL4LJTN.js → acp-startup-profiler-KEU6VAYR.js} +2 -2
  24. package/chunks/{acpAgent-ZC57OLS4.js → acpAgent-DM6XRCDQ.js} +361 -210
  25. package/chunks/{agent-GEBPAEJS.js → agent-EF3IIYE3.js} +20 -20
  26. package/chunks/{agent-headless-63ZEYAJK.js → agent-headless-5J2KFYR4.js} +20 -20
  27. package/chunks/{anthropicContentGenerator-6XDHXIII.js → anthropicContentGenerator-VIW2FG7G.js} +32 -9
  28. package/chunks/{artifact-tool-P52OKKEF.js → artifact-tool-G5LHNECG.js} +1 -1
  29. package/chunks/{askUserQuestion-3KAYLLMM.js → askUserQuestion-R3TXY77M.js} +1 -1
  30. package/chunks/{bridge-MHWO5I5T.js → bridge-LEMQM6QE.js} +32 -31
  31. package/chunks/{channel-management-service-NFRZXQFO.js → channel-management-service-TGF6XFXT.js} +4 -4
  32. package/chunks/{channel-settings-store-T7PMIHKC.js → channel-settings-store-FV365JSF.js} +40 -39
  33. package/chunks/{channel-worker-group-O2BWK5F7.js → channel-worker-group-SQ5FRWOH.js} +7 -7
  34. package/chunks/{channel-worker-manager-4WP7VJOD.js → channel-worker-manager-TU4ZNWOE.js} +7 -7
  35. package/chunks/{channel-worker-supervisor-CCUXD6J5.js → channel-worker-supervisor-EMITFMCP.js} +4 -4
  36. package/chunks/{chunk-3SH53ANB.js → chunk-22GORRNY.js} +12 -0
  37. package/chunks/{chunk-OFB36ZBA.js → chunk-2HYOOFDS.js} +10 -7
  38. package/chunks/chunk-2Z3T52OC.js +82 -0
  39. package/chunks/{chunk-LYHYXJJ3.js → chunk-34VPADLG.js} +3 -3
  40. package/chunks/{chunk-C7M445SS.js → chunk-3A2IMUDH.js} +14 -2
  41. package/chunks/{chunk-P5Z7VD23.js → chunk-3O77M472.js} +294 -87
  42. package/chunks/{chunk-4OCYWXKF.js → chunk-43EUMPKQ.js} +3 -3
  43. package/chunks/{chunk-W4LL5RZO.js → chunk-4ALNJDHL.js} +52 -13
  44. package/chunks/{chunk-VMFPZXRT.js → chunk-4DIMJKWU.js} +64 -43
  45. package/chunks/{chunk-ZRVFHLLK.js → chunk-5DQ4YTIZ.js} +1 -1
  46. package/chunks/{chunk-VYCJITND.js → chunk-5HV2HPO7.js} +1 -1
  47. package/chunks/{chunk-22QOQKG4.js → chunk-5WBA3DEF.js} +1 -1
  48. package/chunks/{chunk-3K65MUKD.js → chunk-65I7S4Z3.js} +2 -1
  49. package/chunks/{chunk-I7UNCY24.js → chunk-6GAYNM3F.js} +3 -3
  50. package/chunks/{chunk-2C3XDBGL.js → chunk-6S7YYUUH.js} +4 -4
  51. package/chunks/{chunk-Y3C5COGI.js → chunk-6VIATHL7.js} +1 -1
  52. package/chunks/{chunk-XNC2TCUO.js → chunk-76I36BEM.js} +4 -4
  53. package/chunks/{chunk-B54PFQS5.js → chunk-7CLLH5TI.js} +1 -1
  54. package/chunks/{chunk-RGAQDQ3Z.js → chunk-7IDZFJAV.js} +18 -9
  55. package/chunks/{chunk-5Z4FCEPY.js → chunk-7K4GGN3D.js} +606 -109
  56. package/chunks/{chunk-WLZRMF3C.js → chunk-7KZVXJ4U.js} +353 -11
  57. package/chunks/{chunk-REDVV5NC.js → chunk-7WCJEY3A.js} +7 -7
  58. package/chunks/{chunk-I67KJGM6.js → chunk-A7QZIGRB.js} +3 -3
  59. package/chunks/{chunk-SHX2HIE7.js → chunk-ATBLEXXV.js} +7 -2
  60. package/chunks/{chunk-RH344FKI.js → chunk-AUTUFD5X.js} +1 -1
  61. package/chunks/chunk-AXMWHKXA.js +42 -0
  62. package/chunks/{chunk-WFXD5OZH.js → chunk-AXWTG6R7.js} +2 -5
  63. package/chunks/{chunk-TSLRORQR.js → chunk-BDAVT6K2.js} +1809 -1588
  64. package/chunks/{chunk-HWZOOSEB.js → chunk-BDP3NTWD.js} +3 -3
  65. package/chunks/{chunk-RD3VPM4E.js → chunk-BZUHZCUO.js} +2 -2
  66. package/chunks/{chunk-HPE4LEWX.js → chunk-C24ZDDNY.js} +1 -1
  67. package/chunks/{chunk-R7TKFIQO.js → chunk-CALNF3Z3.js} +1 -1
  68. package/chunks/{chunk-RPFJJ33Z.js → chunk-CALTQWTZ.js} +1 -1
  69. package/chunks/{chunk-BF3RUIVP.js → chunk-CH2YDT6X.js} +36 -38
  70. package/chunks/{chunk-LD53HMPV.js → chunk-CRZBDVP2.js} +1 -0
  71. package/chunks/{chunk-GEV66YGE.js → chunk-D6AGS266.js} +1 -1
  72. package/chunks/{chunk-EPZWBYQI.js → chunk-D7DFZAK2.js} +19 -11
  73. package/chunks/{chunk-5V4B3EWA.js → chunk-DARWOZY6.js} +1 -1
  74. package/chunks/{chunk-XX4MBBFW.js → chunk-DGNRLJ6S.js} +4 -4
  75. package/chunks/{chunk-UTVIIA7N.js → chunk-DVOCOIS5.js} +1 -1
  76. package/chunks/{chunk-RQNAO42A.js → chunk-E4LXNQAK.js} +1 -1
  77. package/chunks/{chunk-EGRFCIXD.js → chunk-EATP5QCN.js} +84 -25
  78. package/chunks/{chunk-3RMVM33U.js → chunk-EDSU3VUG.js} +12 -5
  79. package/chunks/{chunk-733KQL63.js → chunk-EE5ZD4XU.js} +3 -3
  80. package/chunks/{chunk-QQGAR64U.js → chunk-EN3Q2S3J.js} +4 -4
  81. package/chunks/{chunk-PLUAIHZO.js → chunk-EOLGAQ25.js} +17 -16
  82. package/chunks/{chunk-37SOBIA3.js → chunk-ERXNTINK.js} +1 -1
  83. package/chunks/{chunk-L36LLVA5.js → chunk-EYCW6UF2.js} +7 -7
  84. package/chunks/{chunk-ZELCTN6Y.js → chunk-F23YN37B.js} +10 -0
  85. package/chunks/{chunk-FPGTNKCP.js → chunk-F3M6P6IQ.js} +199 -1
  86. package/chunks/{chunk-B44JBZBB.js → chunk-F4SAL7WM.js} +91 -3
  87. package/chunks/{chunk-F47DITLZ.js → chunk-FAWTMDX7.js} +14 -0
  88. package/chunks/{chunk-SI6Q52UI.js → chunk-FEEVHJOR.js} +3 -3
  89. package/chunks/{chunk-75UQFGFE.js → chunk-FN4KHWCL.js} +1 -1
  90. package/chunks/{chunk-WQBR7LN5.js → chunk-FRS3P7MQ.js} +15 -2
  91. package/chunks/{chunk-5JLQWQK6.js → chunk-FV4DM2M4.js} +2 -2
  92. package/chunks/{chunk-Z6DDPSGJ.js → chunk-GNY7B3CA.js} +1 -1
  93. package/chunks/{chunk-FDOGGKAA.js → chunk-GSFV5RQW.js} +2 -0
  94. package/chunks/{chunk-XBVNNDPK.js → chunk-GSYD7MYP.js} +8 -3
  95. package/chunks/{chunk-ERMAXPXA.js → chunk-HIXUUCGY.js} +187 -12
  96. package/chunks/{chunk-EJNYBDYC.js → chunk-HNLMYDQE.js} +1 -1
  97. package/chunks/{chunk-3K456UJF.js → chunk-HSO6D4KX.js} +93 -28
  98. package/chunks/{chunk-ANVC5CSK.js → chunk-HUJJFSMO.js} +10 -10
  99. package/chunks/{chunk-C4NXRR7T.js → chunk-HW4MRP4V.js} +2 -2
  100. package/chunks/{chunk-PMGWY6ZP.js → chunk-HWLLUDIA.js} +113 -18
  101. package/chunks/{chunk-RCUWMVN3.js → chunk-HZ2HUXX7.js} +1 -1
  102. package/chunks/{chunk-7PMKXGRP.js → chunk-IKK6NNS6.js} +91 -31
  103. package/chunks/{chunk-IMWCUWQT.js → chunk-J3TJH52D.js} +1 -1
  104. package/chunks/{chunk-BNWIX6BM.js → chunk-JFAGT5YG.js} +3 -3
  105. package/chunks/{chunk-RSU3I6UL.js → chunk-JGTMTJSQ.js} +1 -1
  106. package/chunks/{chunk-LTCI6ZOJ.js → chunk-JYGIJA4W.js} +1 -1
  107. package/chunks/{chunk-537SQ2AI.js → chunk-KECCLCXM.js} +146 -24
  108. package/chunks/{chunk-KAZWXVI3.js → chunk-KEPC5BOL.js} +5 -5
  109. package/chunks/{chunk-HZS3JRQW.js → chunk-L5VHJYHH.js} +40 -2
  110. package/chunks/{chunk-KTLT7VCX.js → chunk-LKBOBUA2.js} +2 -2
  111. package/chunks/{chunk-TDHVOZ65.js → chunk-LOBKNYPR.js} +2 -2
  112. package/chunks/{chunk-QW7BUOSI.js → chunk-LOVGQ3HZ.js} +26 -9
  113. package/chunks/{chunk-5FYGZ7E3.js → chunk-MUF4UGPB.js} +2 -2
  114. package/chunks/chunk-N3Z6Q7KC.js +384 -0
  115. package/chunks/{chunk-JOV46WGX.js → chunk-NB3NDQQK.js} +1 -1
  116. package/chunks/chunk-NFXXBWSE.js +463 -0
  117. package/chunks/chunk-NOO4QFXM.js +171 -0
  118. package/chunks/{chunk-PQSCGZT2.js → chunk-NPKCVSXX.js} +26 -2
  119. package/chunks/{chunk-FXYNIZPW.js → chunk-NV4YYXFT.js} +51 -10
  120. package/chunks/{chunk-FWH4736Q.js → chunk-O6BFERWN.js} +3 -3
  121. package/chunks/{chunk-UKADFFL2.js → chunk-OFVAS4AR.js} +1 -1
  122. package/chunks/{chunk-C55CR5I4.js → chunk-OVTPETDL.js} +6 -6
  123. package/chunks/chunk-PLEBBGHL.js +1401 -0
  124. package/chunks/{chunk-Z6KFLEG7.js → chunk-PSPAM24S.js} +1 -0
  125. package/chunks/{chunk-RRCNEW2A.js → chunk-PWR6BQ3U.js} +58 -4
  126. package/chunks/{chunk-SHK2SIR5.js → chunk-QA2B26PL.js} +4 -4
  127. package/chunks/{chunk-NFIDVZND.js → chunk-QB3KS3N3.js} +2 -21
  128. package/chunks/{chunk-NUQFUXOG.js → chunk-QTNCGZHQ.js} +2 -0
  129. package/chunks/{chunk-QJVZLILI.js → chunk-R7OO56VZ.js} +1 -1
  130. package/chunks/{chunk-MFCWL4LI.js → chunk-SK6VACCM.js} +936 -481
  131. package/chunks/{chunk-SD7Y2PMC.js → chunk-SM66GFKJ.js} +2 -2
  132. package/chunks/{chunk-ADJD4LZF.js → chunk-SNMUO5Z7.js} +1 -1
  133. package/chunks/{chunk-NXWYCSPL.js → chunk-SOA4HKRJ.js} +1 -1
  134. package/chunks/{chunk-IRKQ4YYX.js → chunk-SVWWF5TZ.js} +29 -1
  135. package/chunks/{chunk-YLFICBYK.js → chunk-SYKPMH2X.js} +3 -3
  136. package/chunks/{chunk-5HBA2Z7V.js → chunk-TGNNLRC3.js} +2 -3
  137. package/chunks/{chunk-AX23QSX3.js → chunk-TRQNRP2H.js} +4 -4
  138. package/chunks/{chunk-AUJOWIT5.js → chunk-UQOP2APG.js} +4 -24
  139. package/chunks/{chunk-HY3DXYZK.js → chunk-UYDQYDW2.js} +1 -1
  140. package/chunks/{chunk-IGOIYZBG.js → chunk-VAWM3A5N.js} +2 -2
  141. package/chunks/{chunk-6KYWU726.js → chunk-VJJXG73H.js} +417 -292
  142. package/chunks/{chunk-ZNI3V2XA.js → chunk-VJWJOKOQ.js} +2 -2
  143. package/chunks/{chunk-AWDF462I.js → chunk-VR6Y23FW.js} +2 -2
  144. package/chunks/{chunk-T7TP5UQL.js → chunk-VX2NR3SD.js} +21 -6
  145. package/chunks/{chunk-65GHQ4FX.js → chunk-WDVV3LRM.js} +707 -216
  146. package/chunks/{chunk-KP5QK3FB.js → chunk-WEU6O6VN.js} +397 -54
  147. package/chunks/{chunk-OHOO527W.js → chunk-WG7BL3FY.js} +52 -2
  148. package/chunks/{chunk-VU7O7CGQ.js → chunk-XDNFODER.js} +1 -1
  149. package/chunks/{chunk-YHDGABDC.js → chunk-XKBFYTCD.js} +1 -1
  150. package/chunks/{chunk-RUMSY4ES.js → chunk-Y7YHAY32.js} +28 -10
  151. package/chunks/{chunk-7IKXTGZT.js → chunk-YI2YCNSP.js} +1 -1
  152. package/chunks/{chunk-B5FF3LRF.js → chunk-YIE6REQ5.js} +29 -17
  153. package/chunks/{chunk-E4VX6LXB.js → chunk-YZTGGCEE.js} +10 -2
  154. package/chunks/{chunk-TXAEXF2B.js → chunk-ZEFWBG2C.js} +737 -1136
  155. package/chunks/{chunk-AIMZIXZM.js → chunk-ZM2TCZZ7.js} +5 -7
  156. package/chunks/{chunk-ZT3XUGSU.js → chunk-ZZ7RVOTU.js} +135 -26
  157. package/chunks/{config-utils-F4CFJ4MW.js → config-utils-SXFK3G4X.js} +33 -32
  158. package/chunks/{contextCommand-OIIGGOMU.js → contextCommand-QFPD26QO.js} +31 -30
  159. package/chunks/{core-runtime-JEHLOGMB.js → core-runtime-VXKNBODM.js} +35 -33
  160. package/chunks/{create-sub-session-MVFBE5RA.js → create-sub-session-7WSQETFR.js} +30 -29
  161. package/chunks/{daemon-LCUELM6E.js → daemon-U2456K5H.js} +2 -2
  162. package/chunks/{daemon-git-worktree-guard-5FTKLJOU.js → daemon-git-worktree-guard-I4DCSDUS.js} +29 -28
  163. package/chunks/{daemon-status-provider-P6A5MPMW.js → daemon-status-provider-5UV56RI4.js} +36 -35
  164. package/chunks/{daemon-trust-policy-ZJ3NFYUO.js → daemon-trust-policy-DKIBWTKU.js} +36 -35
  165. package/chunks/{daemon-trust-policy-monitor-6SDLEW7S.js → daemon-trust-policy-monitor-CPSD7UKT.js} +36 -35
  166. package/chunks/{deferred-core-runtime-DWOXIU5S.js → deferred-core-runtime-D2RF35BL.js} +29 -28
  167. package/chunks/{discovery-TUM3ZQ6U.js → discovery-XP4RMDUM.js} +4 -2
  168. package/chunks/{dist-P6YWBITG.js → dist-6YDUH3BB.js} +817 -152
  169. package/chunks/{dist-T4PRA5EZ.js → dist-BNQVF565.js} +2 -8
  170. package/chunks/{dist-AI25RVRA.js → dist-F34J4FZX.js} +1 -1
  171. package/chunks/{dist-3H3WODVS.js → dist-F6JLAJLE.js} +1 -1
  172. package/chunks/{dist-NXW4DUUX.js → dist-K5GHMXIG.js} +2 -2
  173. package/chunks/{dist-YNQU4CKC.js → dist-NP7QKLVG.js} +2 -2
  174. package/chunks/{dist-VCAS67N5.js → dist-UFTFGI6I.js} +1 -1
  175. package/chunks/{dist-I74QLLQS.js → dist-XLV33CLY.js} +1 -2
  176. package/chunks/{dist-XINEKB5A.js → dist-ZDNJK74R.js} +3 -7
  177. package/chunks/{edit-WPVXLL3T.js → edit-4IBADZ3O.js} +20 -20
  178. package/chunks/{enter-worktree-5A6VW6BN.js → enter-worktree-YFTKHXHZ.js} +2 -2
  179. package/chunks/{enterPlanMode-JSODW7E2.js → enterPlanMode-YN3GPQU5.js} +20 -20
  180. package/chunks/{environment-5LLJ3I3W.js → environment-E272IJMF.js} +32 -31
  181. package/chunks/{errors-IQT3YZEP.js → errors-CVAH3RWQ.js} +31 -30
  182. package/chunks/{exit-worktree-QV7E7KP6.js → exit-worktree-NF2XEMES.js} +3 -3
  183. package/chunks/{exitPlanMode-DDVFYNW4.js → exitPlanMode-24J5IHGC.js} +20 -20
  184. package/chunks/{fast-path-PAUQQEVU.js → fast-path-M5IDBMXF.js} +4 -4
  185. package/chunks/{fast-path-settings-ISEJPRYE.js → fast-path-settings-SATXY3PD.js} +3 -3
  186. package/chunks/{glob-SQ7CTZ7F.js → glob-ERBD7JYP.js} +20 -20
  187. package/chunks/{goal-tools-UWZRCLQB.js → goal-tools-245ULLQT.js} +20 -20
  188. package/chunks/{handleAutoUpdate-RUPZZTSG.js → handleAutoUpdate-JDZHHZKK.js} +32 -31
  189. package/chunks/{i18n-SF5MPWEB.js → i18n-LA4D5IXM.js} +32 -29
  190. package/chunks/{image-gen-Q3RUTVKR.js → image-gen-XP4NNIYG.js} +4 -4
  191. package/chunks/{initializer-CK4WPYZG.js → initializer-SHPTSWUZ.js} +36 -35
  192. package/chunks/{installationInfo-IRPQEYRF.js → installationInfo-QEQEPB3G.js} +29 -28
  193. package/chunks/{list-E3PS3EBJ.js → list-IBHCQWTF.js} +39 -38
  194. package/chunks/{list-agents-I5TRH3J7.js → list-agents-EDPZCGKN.js} +5 -4
  195. package/chunks/{llm-JQKBOYAF.js → llm-JAWCQLA4.js} +81 -75
  196. package/chunks/{llm-content-generator-2QWGBW42.js → llm-content-generator-GOV3A23T.js} +23 -8
  197. package/chunks/{loadedSettingsAdapter-DGXGVYZS.js → loadedSettingsAdapter-RVE2GNVU.js} +36 -35
  198. package/chunks/{loggingContentGenerator-ZYURLJKK.js → loggingContentGenerator-SSHNN5YW.js} +22 -22
  199. package/chunks/{managed-npm-update-HTHR63EA.js → managed-npm-update-BHSTITQO.js} +29 -28
  200. package/chunks/{mcp-I7G2AEWS.js → mcp-6ZZ7P2HU.js} +36 -35
  201. package/chunks/{monitor-4R76BCRZ.js → monitor-RKK6GSHG.js} +20 -20
  202. package/chunks/{nonInteractiveCli-24OQ3VP2.js → nonInteractiveCli-UQHP3G6P.js} +76 -72
  203. package/chunks/{notebook-edit-PPSH7FEX.js → notebook-edit-YM47A7WO.js} +20 -20
  204. package/chunks/{open-with-auth-D6JD6LDS.js → open-with-auth-6MVIHMXB.js} +1 -1
  205. package/chunks/{openaiContentGenerator-K7V5EO7F.js → openaiContentGenerator-FHKDWNI2.js} +11 -11
  206. package/chunks/{pidfile-TGIUY2GG.js → pidfile-SIIEJEEH.js} +32 -29
  207. package/chunks/{processUtils-3USXUQWX.js → processUtils-JF7CWBJC.js} +2 -2
  208. package/chunks/{prompt-terminal-ledger-XHVZRXJI.js → prompt-terminal-ledger-FXXHAEQU.js} +30 -29
  209. package/chunks/{qwenContentGenerator-MPBOQB64.js → qwenContentGenerator-KFJ77JP6.js} +24 -24
  210. package/chunks/{qwenOAuth2-BS5D2LYV.js → qwenOAuth2-KX6LVYQ3.js} +4 -4
  211. package/chunks/{read-file-R256LDWQ.js → read-file-S2NOCBIL.js} +4 -4
  212. package/chunks/{resumeHistoryUtils-S43LTFHD.js → resumeHistoryUtils-QHHPSQWU.js} +33 -32
  213. package/chunks/{ripGrep-L7HPZ75Y.js → ripGrep-F6TNOJUO.js} +5 -5
  214. package/chunks/{run-qwen-serve-CTFL5R6U.js → run-qwen-serve-KYBDQRDD.js} +229 -79
  215. package/chunks/{runtime-FS5TL6P7.js → runtime-3WNOFLCR.js} +43 -40
  216. package/chunks/{scheduled-tasks-QXPV3Q35.js → scheduled-tasks-RNBH56DJ.js} +34 -33
  217. package/chunks/{scheduler-EXU5HMVK.js → scheduler-ERMW7Q7B.js} +31 -30
  218. package/chunks/{send-message-GQKXGMPI.js → send-message-V5T3NMFM.js} +4 -4
  219. package/chunks/{serve-ITJC7WNN.js → serve-7NV46RMP.js} +36 -35
  220. package/chunks/{server-6JQY3PTU.js → server-6RZJR5QF.js} +1358 -932
  221. package/chunks/{session-PJDEKXD4.js → session-Z4EV7NVV.js} +107 -78
  222. package/chunks/{session-attachments-root-L37ORSST.js → session-attachments-root-SG5FC52X.js} +29 -28
  223. package/chunks/{session-pr-refresh-WIFD52YL.js → session-pr-refresh-ILC4Z3ZM.js} +33 -32
  224. package/chunks/{settings-LO6J5SAZ.js → settings-Y47SPE3X.js} +35 -34
  225. package/chunks/{shell-ANAFVYGR.js → shell-YBVCOPVO.js} +20 -20
  226. package/chunks/{skill-SHJWKSPH.js → skill-AXC63EBA.js} +4 -4
  227. package/chunks/{skill-settings-GX3XHZ5Q.js → skill-settings-AFPAYGLO.js} +35 -34
  228. package/chunks/{spawnChannel-WE42VBKM.js → spawnChannel-ZFL4J2V3.js} +29 -28
  229. package/chunks/{standalone-update-CWDIKJRP.js → standalone-update-Y2OZPLNJ.js} +31 -30
  230. package/chunks/{start-opentui-ui-BBHGFOTF.js → start-opentui-ui-G6TKT4LI.js} +2270 -1026
  231. package/chunks/{startInteractiveUI-FQX7LUYP.js → startInteractiveUI-YTNDPW7J.js} +1789 -2211
  232. package/chunks/{task-create-PMAFST2T.js → task-create-MWXJFRRM.js} +3 -3
  233. package/chunks/{task-list-R2HSY2NC.js → task-list-EYO3FE57.js} +2 -2
  234. package/chunks/{task-update-JYC57USF.js → task-update-2JJJRHMT.js} +3 -3
  235. package/chunks/{team-create-WKTPCH6D.js → team-create-BUFLGGSH.js} +20 -20
  236. package/chunks/{team-delete-CBHVBTPB.js → team-delete-IQZ6XGFI.js} +2 -2
  237. package/chunks/{team-plan-approval-Y23DL7WR.js → team-plan-approval-OUWWM42U.js} +20 -20
  238. package/chunks/{terminal-image-renderer-B646HBDW.js → terminal-image-renderer-WH2WV5ES.js} +29 -28
  239. package/chunks/{theme-manager-BNWESY26.js → theme-manager-5UDRARM2.js} +29 -28
  240. package/chunks/{tool-search-PVQ5O5Y2.js → tool-search-MCDIRPHN.js} +4 -4
  241. package/chunks/{total-session-admission-P5Z43KNW.js → total-session-admission-VL27U74Z.js} +33 -32
  242. package/chunks/{trustedFolders-FH2LT2MZ.js → trustedFolders-MSXT4VDD.js} +30 -29
  243. package/chunks/{update-relaunch-WOWTKJSN.js → update-relaunch-JKLEWVCB.js} +5 -5
  244. package/chunks/{updateCheck-3MYFMM35.js → updateCheck-ARTHAJT2.js} +31 -30
  245. package/chunks/{useAutoAcceptIndicator-Q7ZRRRKO.js → useAutoAcceptIndicator-YEAAGYVU.js} +38 -37
  246. package/chunks/{validateNonInterActiveAuth-MYEWJX3G.js → validateNonInterActiveAuth-EMRQKH5S.js} +71 -69
  247. package/chunks/{version-RO2FPO76.js → version-HFQU35WD.js} +3 -1
  248. package/chunks/{web-fetch-QAKY2LUA.js → web-fetch-QBXAO6VF.js} +7 -7
  249. package/chunks/{web-search-XA5Z4ZCD.js → web-search-2URQXA3A.js} +201 -13
  250. package/chunks/{web-shell-static-POZHGGXE.js → web-shell-static-BFDESDD4.js} +5 -4
  251. package/chunks/{workflow-QFIOCMDM.js → workflow-JDD6WDAH.js} +211 -75
  252. package/chunks/{workspace-providers-status-B2UD7RAG.js → workspace-providers-status-B4IKR6YJ.js} +38 -37
  253. package/chunks/{workspace-registration-store-VZLRTI3Q.js → workspace-registration-store-PJ3YHR45.js} +1 -2
  254. package/chunks/{workspace-registry-GYOGG6TM.js → workspace-registry-WVYJ5UGB.js} +33 -32
  255. package/chunks/{workspace-runtime-coordinator-7KRXGQ4V.js → workspace-runtime-coordinator-DXL5YVAG.js} +33 -32
  256. package/chunks/{workspace-service-DJEYGJE4.js → workspace-service-QNGAMVH7.js} +40 -39
  257. package/chunks/{workspace-skills-status-MOKNESUC.js → workspace-skills-status-BEISJIII.js} +36 -35
  258. package/chunks/{workspace-trust-reconciler-AXOSUTQW.js → workspace-trust-reconciler-ORYJF5L4.js} +40 -39
  259. package/chunks/{write-file-QOYVHAKK.js → write-file-DWLKFBTJ.js} +21 -21
  260. package/chunks/{zoom-image-UCCLGFNC.js → zoom-image-BYVIXSNQ.js} +4 -4
  261. package/cli.js +13 -13
  262. package/export-transcript-document.js +123 -119
  263. package/package.json +4 -4
  264. package/web-shell/assets/{abnfDiagram-VCTEODGH-CTstZpXw.js → abnfDiagram-VCTEODGH-C_8kzsly.js} +1 -1
  265. package/web-shell/assets/{arc-DKW0mbPo.js → arc-CDg7Zfpm.js} +1 -1
  266. package/web-shell/assets/{architectureDiagram-5GKGNRK7-DkMpJ42t.js → architectureDiagram-5GKGNRK7-DZzdCWyF.js} +1 -1
  267. package/web-shell/assets/{blockDiagram-NRAW4CY4-7Cp1_4i3.js → blockDiagram-NRAW4CY4-DI3B4gyR.js} +1 -1
  268. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BfaoSlBK.js → c4Diagram-UCG6FXSJ-CfOgwHZW.js} +1 -1
  269. package/web-shell/assets/channel-e4xwS72w.js +1 -0
  270. package/web-shell/assets/{chunk-2Q5K7J3B-_n1qzAio.js → chunk-2Q5K7J3B-B_PUth0g.js} +1 -1
  271. package/web-shell/assets/{chunk-5VM5RSS4-0cira5ZV.js → chunk-5VM5RSS4-CrKtvBIL.js} +1 -1
  272. package/web-shell/assets/{chunk-F27PBJKO-DseRXSHC.js → chunk-F27PBJKO-B4z2n8Py.js} +1 -1
  273. package/web-shell/assets/{chunk-G27WJ6UU-BehQWin0.js → chunk-G27WJ6UU-BUtrFEO8.js} +1 -1
  274. package/web-shell/assets/{chunk-JWPE2WC7-B5ftg1Bb.js → chunk-JWPE2WC7-Cqw3aXW0.js} +1 -1
  275. package/web-shell/assets/{chunk-LCL6LL3I-D7rnbVdk.js → chunk-LCL6LL3I-CZolnvls.js} +1 -1
  276. package/web-shell/assets/{chunk-POPQ4Y6H-2Bp-Orju.js → chunk-POPQ4Y6H-DivgasCa.js} +1 -1
  277. package/web-shell/assets/{chunk-SVP7TREG-CD2goGva.js → chunk-SVP7TREG--seyb1B6.js} +1 -1
  278. package/web-shell/assets/{chunk-XXDRQBXY-DzQt-Rji.js → chunk-XXDRQBXY-D7pHtuVM.js} +1 -1
  279. package/web-shell/assets/classDiagram-DTDB5LWJ-CzXfUUOt.js +1 -0
  280. package/web-shell/assets/classDiagram-v2-JRS7N3AN-CzXfUUOt.js +1 -0
  281. package/web-shell/assets/{cose-bilkent-JH36ORCC-C-BZXSUn.js → cose-bilkent-JH36ORCC-4MWaRF_3.js} +1 -1
  282. package/web-shell/assets/csv-CX7rUNeC.svg +1 -0
  283. package/web-shell/assets/{cynefin-OW5HDTMX-BTcvowe1.js → cynefin-OW5HDTMX-nhJhAjgD.js} +1 -1
  284. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BoUE6K81.js → cynefinDiagram-5FMLGOSQ-NF-PwXlq.js} +1 -1
  285. package/web-shell/assets/{dagre-3AP2YEHR-BHxy9xeB.js → dagre-3AP2YEHR-Bu0ncdWP.js} +1 -1
  286. package/web-shell/assets/{diagram-S7CK7UJ4-DMiJIvDT.js → diagram-S7CK7UJ4-CsvhFHZC.js} +1 -1
  287. package/web-shell/assets/{diagram-UQ7AKVKN-DXV09Aes.js → diagram-UQ7AKVKN-Ck61sIB3.js} +1 -1
  288. package/web-shell/assets/{diagram-VSXAHHWV-CocpRomV.js → diagram-VSXAHHWV-D0171zrb.js} +1 -1
  289. package/web-shell/assets/{diagram-VX7I27RA-DL7nqtb4.js → diagram-VX7I27RA-DvdxY4UL.js} +1 -1
  290. package/web-shell/assets/{diagram-Z3DM3KII-CPZ2Jux_.js → diagram-Z3DM3KII-CGGpseiB.js} +1 -1
  291. package/web-shell/assets/{ebnfDiagram-PWID7BFC-BX-eVNsX.js → ebnfDiagram-PWID7BFC-K8-QMvY8.js} +1 -1
  292. package/web-shell/assets/{erDiagram-SSCWMZ5O-CPy_Ir6y.js → erDiagram-SSCWMZ5O-D316nAem.js} +1 -1
  293. package/web-shell/assets/{flowDiagram-A5DVABFB-eknAOte9.js → flowDiagram-A5DVABFB-B7siy_mn.js} +1 -1
  294. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-crAxw_t7.js → ganttDiagram-EL5Y4UJY-BZQDxzTu.js} +1 -1
  295. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-M29pa3Tc.js → gitGraphDiagram-WWUBYQGX-DZynLCSV.js} +1 -1
  296. package/web-shell/assets/{index-C9R-iojE.js → index-9ie6xLTM.js} +1 -1
  297. package/web-shell/assets/index-DirkXQEg.js +2164 -0
  298. package/web-shell/assets/index-DzdST_7L.css +36 -0
  299. package/web-shell/assets/{infoDiagram-RXCK75RN-XqspXdOU.js → infoDiagram-RXCK75RN-B0gr769A.js} +1 -1
  300. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-C5KFS-7j.js → ishikawaDiagram-5VMMS53U-0pQFfjvX.js} +1 -1
  301. package/web-shell/assets/{journeyDiagram-EYS64GPL-Cc57LVRo.js → journeyDiagram-EYS64GPL-DEGtClWb.js} +1 -1
  302. package/web-shell/assets/{kanban-definition-3QL26DDD-C81OG-AI.js → kanban-definition-3QL26DDD-CnN8gPzw.js} +1 -1
  303. package/web-shell/assets/{layout-CFVu37BB.js → layout-C_70RhaT.js} +1 -1
  304. package/web-shell/assets/{linear-ChBxdtWf.js → linear-BJ2ZLmcq.js} +1 -1
  305. package/web-shell/assets/{mermaid.core-CMLfue0w.js → mermaid.core-RlY0zPNC.js} +6 -6
  306. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DFsvJThp.js → mindmap-definition-FBJOCRG2-CpVAxTNl.js} +1 -1
  307. package/web-shell/assets/{pegDiagram-XKGWAZYB-BzpRzM4F.js → pegDiagram-XKGWAZYB-DmrSv3hD.js} +1 -1
  308. package/web-shell/assets/{pieDiagram-E7YTZNPT-Cv0Kankl.js → pieDiagram-E7YTZNPT-CJmgp8KJ.js} +1 -1
  309. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-Bh2BJ3Ay.js → quadrantDiagram-AXDQQJYC-UsgOyNco.js} +1 -1
  310. package/web-shell/assets/{railroadDiagram-O6MQD6OU-y8rNDdDS.js → railroadDiagram-O6MQD6OU-DQ6gMs_W.js} +1 -1
  311. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C0m2DKJ_.js → requirementDiagram-EFPCY7ZU-DhqadamF.js} +1 -1
  312. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BzdGnSF4.js → sankeyDiagram-P5KCCOFB-R4WnURaE.js} +1 -1
  313. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DPzAVmzz.js → sequenceDiagram-WJ2MYXX4-D7BwMi_D.js} +1 -1
  314. package/web-shell/assets/{sizeCapture-X5ZJPWSS-LcHG28Zh.js → sizeCapture-X5ZJPWSS-Bqngz088.js} +1 -1
  315. package/web-shell/assets/{stateDiagram-HBIQ2CUA-C1Bzy3IT.js → stateDiagram-HBIQ2CUA-DwaXPGqn.js} +1 -1
  316. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-8GCQZAvv.js +1 -0
  317. package/web-shell/assets/{swimlanes-XN3QIQJK-Bftk8V64.js → swimlanes-XN3QIQJK-BsaLeRDY.js} +1 -1
  318. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-BoRBF2Yw.js +8 -0
  319. package/web-shell/assets/{timeline-definition-24CTP7MA-BfXHcN1A.js → timeline-definition-24CTP7MA-NJ9G-NUU.js} +1 -1
  320. package/web-shell/assets/{vennDiagram-4TSXK5OY-DRSlI9-V.js → vennDiagram-4TSXK5OY-Ca3W4rSq.js} +1 -1
  321. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CaLmqGau.js → wardleyDiagram-VM6X3IG4-OabvjC-6.js} +1 -1
  322. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-8lgUT6e8.js → xychartDiagram-S5SC5T6Z-C7rbjvpc.js} +1 -1
  323. package/web-shell/index.html +2 -2
  324. package/chunks/chunk-2LD5U7Q3.js +0 -114
  325. package/chunks/chunk-3UMWOKJC.js +0 -78
  326. package/chunks/chunk-IQAFKVXS.js +0 -22
  327. package/chunks/chunk-X35VIWWJ.js +0 -276
  328. package/chunks/chunk-ZJ2LM2SI.js +0 -198
  329. package/web-shell/assets/channel-CQx7VSAp.js +0 -1
  330. package/web-shell/assets/classDiagram-DTDB5LWJ-C-Uz8hHk.js +0 -1
  331. package/web-shell/assets/classDiagram-v2-JRS7N3AN-C-Uz8hHk.js +0 -1
  332. package/web-shell/assets/index-B4TLaxWs.js +0 -2142
  333. package/web-shell/assets/index-CCrkEbzz.css +0 -36
  334. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-LuuL5byY.js +0 -1
  335. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-COmnNq8s.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
@@ -16,9 +19,12 @@ import {
16
19
  import {
17
20
  isInternalWorkspaceRuntime
18
21
  } from "./chunk-NYWWQ437.js";
22
+ import {
23
+ conversationRuntimeUnavailableError
24
+ } from "./chunk-2Z3T52OC.js";
19
25
  import {
20
26
  CLIENT_MCP_OVER_WS_CONFIG_FLAG
21
- } from "./chunk-Z6KFLEG7.js";
27
+ } from "./chunk-PSPAM24S.js";
22
28
  import {
23
29
  parseToolWriteOriginMeta
24
30
  } from "./chunk-GELRJXE2.js";
@@ -920,78 +926,6 @@ function isDeepHealthQuery(raw) {
920
926
  }
921
927
  __name(isDeepHealthQuery, "isDeepHealthQuery");
922
928
 
923
- // packages/cli/src/serve/server/self-origin.ts
924
- init_esbuild_shims();
925
- function installSelfOriginStripMiddleware(app, getPort, bind) {
926
- let cachedStripPort = -1;
927
- let cachedSelfOrigins = /* @__PURE__ */ new Set();
928
- const boundHost = isLoopbackBind(bind) ? formatHostForAuthority(bind) : void 0;
929
- app.use((req, _res, next) => {
930
- const origin = req.headers.origin;
931
- if (origin) {
932
- const port = getPort();
933
- if (port !== cachedStripPort) {
934
- cachedStripPort = port;
935
- cachedSelfOrigins = /* @__PURE__ */ new Set([
936
- `http://127.0.0.1:${port}`,
937
- `http://localhost:${port}`,
938
- `http://[::1]:${port}`,
939
- `http://host.docker.internal:${port}`,
940
- `https://127.0.0.1:${port}`,
941
- `https://localhost:${port}`,
942
- `https://[::1]:${port}`,
943
- `https://host.docker.internal:${port}`
944
- ]);
945
- if (boundHost) {
946
- cachedSelfOrigins.add(`http://${boundHost}:${port}`);
947
- cachedSelfOrigins.add(`https://${boundHost}:${port}`);
948
- }
949
- if (port === 80) {
950
- for (const host of [
951
- "127.0.0.1",
952
- "localhost",
953
- "[::1]",
954
- "host.docker.internal"
955
- ]) {
956
- cachedSelfOrigins.add(`http://${host}`);
957
- }
958
- if (boundHost) {
959
- cachedSelfOrigins.add(`http://${boundHost}`);
960
- }
961
- } else if (port === 443) {
962
- for (const host of [
963
- "127.0.0.1",
964
- "localhost",
965
- "[::1]",
966
- "host.docker.internal"
967
- ]) {
968
- cachedSelfOrigins.add(`https://${host}`);
969
- }
970
- if (boundHost) {
971
- cachedSelfOrigins.add(`https://${boundHost}`);
972
- }
973
- }
974
- }
975
- if (cachedSelfOrigins.has(origin)) {
976
- delete req.headers.origin;
977
- }
978
- }
979
- next();
980
- });
981
- }
982
- __name(installSelfOriginStripMiddleware, "installSelfOriginStripMiddleware");
983
-
984
- // packages/cli/src/serve/acp-child-extra-args.ts
985
- init_esbuild_shims();
986
- function acpChildExtraArgs(opts) {
987
- const extraArgs = [
988
- ...opts.experimentalLsp === true ? ["--experimental-lsp"] : [],
989
- ...opts.restoreAskUserQuestion === true ? ["--restore-ask-user-question"] : []
990
- ];
991
- return extraArgs.length > 0 ? extraArgs : void 0;
992
- }
993
- __name(acpChildExtraArgs, "acpChildExtraArgs");
994
-
995
929
  // packages/cli/src/serve/local-control/credentials.ts
996
930
  init_esbuild_shims();
997
931
  import { createHash, timingSafeEqual } from "node:crypto";
@@ -1091,11 +1025,203 @@ function listenerIdentityOfSocket(socket) {
1091
1025
  }
1092
1026
  __name(listenerIdentityOfSocket, "listenerIdentityOfSocket");
1093
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
+
1094
1215
  // packages/cli/src/serve/auth.ts
1095
1216
  init_esbuild_shims();
1217
+ function markPreAuthReject(res) {
1218
+ (res.locals ??= {})[ACCESS_LOG_REJECT_LOCAL] = true;
1219
+ }
1220
+ __name(markPreAuthReject, "markPreAuthReject");
1096
1221
  var denyBrowserOriginCors = /* @__PURE__ */ __name((req, res, next) => {
1097
1222
  if (req.headers.origin) {
1098
1223
  res.setHeader("Vary", "Origin");
1224
+ markPreAuthReject(res);
1099
1225
  res.status(403).json({ error: "Request denied by CORS policy" });
1100
1226
  return;
1101
1227
  }
@@ -1198,6 +1324,7 @@ function allowOriginCors(patterns) {
1198
1324
  }
1199
1325
  if (origin === "null") {
1200
1326
  res.setHeader("Vary", "Origin");
1327
+ markPreAuthReject(res);
1201
1328
  res.status(403).json({ error: "Request denied by CORS policy" });
1202
1329
  return;
1203
1330
  }
@@ -1217,6 +1344,7 @@ function allowOriginCors(patterns) {
1217
1344
  return;
1218
1345
  }
1219
1346
  res.setHeader("Vary", "Origin");
1347
+ markPreAuthReject(res);
1220
1348
  res.status(403).json({ error: "Request denied by CORS policy" });
1221
1349
  };
1222
1350
  }
@@ -1232,6 +1360,7 @@ function hostAllowlist(bind, getPort) {
1232
1360
  const host = (req.headers.host || "").toLowerCase();
1233
1361
  const browserHost = listener.origin === void 0 ? void 0 : new URL(listener.origin).host.toLowerCase();
1234
1362
  if (listener.authority === void 0 || host !== listener.authority && host !== browserHost) {
1363
+ markPreAuthReject(res);
1235
1364
  res.status(403).json({ error: "Invalid Host header" });
1236
1365
  return;
1237
1366
  }
@@ -1269,6 +1398,7 @@ function buildPrimaryHostGate(bind, getPort) {
1269
1398
  const port = getPort();
1270
1399
  const host = (req.headers.host || "").toLowerCase();
1271
1400
  if (!allowedFor(port).has(host)) {
1401
+ markPreAuthReject(res);
1272
1402
  res.status(403).json({ error: "Invalid Host header" });
1273
1403
  return;
1274
1404
  }
@@ -1350,6 +1480,119 @@ function createMutationGate(deps) {
1350
1480
  }
1351
1481
  __name(createMutationGate, "createMutationGate");
1352
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
+
1353
1596
  // packages/cli/src/serve/acp-http/client-mcp-sender-registry.ts
1354
1597
  init_esbuild_shims();
1355
1598
  var ClientMcpSenderRegistry = class {
@@ -1783,6 +2026,10 @@ var SERVE_CAPABILITY_REGISTRY = {
1783
2026
  workspace_skill_settings_toggle: { since: "v1" },
1784
2027
  workspace_skill_settings_batch_toggle: { since: "v1" },
1785
2028
  extension_batch_activation_v2: { since: "v1" },
2029
+ // Extension activation commits do not refresh active sessions. Clients that
2030
+ // need immediate runtime application must submit the independent refresh
2031
+ // operation after the activation operation commits.
2032
+ extension_activation_explicit_refresh: { since: "v1" },
1786
2033
  workspace_skill_manage: { since: "v1" },
1787
2034
  workspace_settings: { since: "v1" },
1788
2035
  // `GET /workspace/permissions` is always available when this tag is
@@ -2024,6 +2271,11 @@ var SERVE_CAPABILITY_REGISTRY = {
2024
2271
  // Worktree-backed session create/load responses are durably persisted and
2025
2272
  // carry per-response `persisted-v1` attestation.
2026
2273
  session_worktree_persistence_v1: { since: "v1" },
2274
+ // Worktree ownership transfer: `POST /session/:id/worktree-reset` moves a
2275
+ // session's checkout ownership to a fresh replacement session, and the
2276
+ // restore surface reports the superseded / interrupted / missing-marker
2277
+ // classifications as typed 409s.
2278
+ session_worktree_reset_v1: { since: "v1" },
2027
2279
  // Workspace-qualified ACP transport (issue #6378 Phase 4):
2028
2280
  // `/workspaces/:workspace/acp` mounts a per-runtime ACP dispatcher (HTTP +
2029
2281
  // WebSocket) for each registered workspace, with per-runtime device-flow and
@@ -2702,58 +2954,6 @@ async function createManagedScratchDirectory(root) {
2702
2954
  }
2703
2955
  __name(createManagedScratchDirectory, "createManagedScratchDirectory");
2704
2956
 
2705
- // packages/cli/src/serve/conversations/conversation-runtime-errors.ts
2706
- init_esbuild_shims();
2707
- var DEFAULT_MESSAGES = {
2708
- conversation_runtime_in_use: "The Conversations runtime is owned by another daemon.",
2709
- conversation_runtime_unavailable: "The Conversations runtime is temporarily unavailable.",
2710
- conversation_root_compromised: "The Conversations root could not be verified.",
2711
- conversation_runtime_ownership_compromised: "The Conversations runtime ownership state could not be verified."
2712
- };
2713
- var ConversationRuntimeOwnershipError = class extends Error {
2714
- constructor(code, retryable, options) {
2715
- super(DEFAULT_MESSAGES[code], options);
2716
- this.code = code;
2717
- this.retryable = retryable;
2718
- this.name = "ConversationRuntimeOwnershipError";
2719
- }
2720
- static {
2721
- __name(this, "ConversationRuntimeOwnershipError");
2722
- }
2723
- status = 503;
2724
- };
2725
- function conversationRuntimeInUseError() {
2726
- return new ConversationRuntimeOwnershipError(
2727
- "conversation_runtime_in_use",
2728
- true
2729
- );
2730
- }
2731
- __name(conversationRuntimeInUseError, "conversationRuntimeInUseError");
2732
- function conversationRuntimeUnavailableError(cause) {
2733
- return new ConversationRuntimeOwnershipError(
2734
- "conversation_runtime_unavailable",
2735
- true,
2736
- { cause }
2737
- );
2738
- }
2739
- __name(conversationRuntimeUnavailableError, "conversationRuntimeUnavailableError");
2740
- function conversationRuntimeOwnershipCompromisedError(cause) {
2741
- return new ConversationRuntimeOwnershipError(
2742
- "conversation_runtime_ownership_compromised",
2743
- false,
2744
- { cause }
2745
- );
2746
- }
2747
- __name(conversationRuntimeOwnershipCompromisedError, "conversationRuntimeOwnershipCompromisedError");
2748
- function conversationRootCompromisedError(cause) {
2749
- return new ConversationRuntimeOwnershipError(
2750
- "conversation_root_compromised",
2751
- false,
2752
- { cause }
2753
- );
2754
- }
2755
- __name(conversationRootCompromisedError, "conversationRootCompromisedError");
2756
-
2757
2957
  // packages/cli/src/serve/serve-app-lifecycle.ts
2758
2958
  init_esbuild_shims();
2759
2959
  var SERVE_APP_LIFECYCLE = Symbol("qwen.serveAppLifecycle");
@@ -2781,7 +2981,6 @@ var ServeAppLifecycleController = class {
2781
2981
  listenerClosed = false;
2782
2982
  sealed = false;
2783
2983
  closePending;
2784
- ownership;
2785
2984
  appDrain;
2786
2985
  hostDrain;
2787
2986
  bootStarter;
@@ -2837,12 +3036,6 @@ var ServeAppLifecycleController = class {
2837
3036
  });
2838
3037
  return pending;
2839
3038
  }
2840
- setOwnership(ownership) {
2841
- if (this.ownership) {
2842
- throw new Error("Serve app lifecycle ownership is already configured.");
2843
- }
2844
- this.ownership = ownership;
2845
- }
2846
3039
  setAppDrain(drain) {
2847
3040
  this.appDrain = drain;
2848
3041
  }
@@ -2926,7 +3119,6 @@ var ServeAppLifecycleController = class {
2926
3119
  if (errors.length > 1) {
2927
3120
  throw new AggregateError(errors, "Serve app shutdown is incomplete.");
2928
3121
  }
2929
- await this.ownership?.release();
2930
3122
  }
2931
3123
  startDrain(drain) {
2932
3124
  if (!drain) return void 0;
@@ -4360,161 +4552,92 @@ var WorkspaceVoiceCoordinator = class {
4360
4552
  }
4361
4553
  };
4362
4554
 
4363
- // packages/cli/src/serve/server/access-log.ts
4364
- init_esbuild_shims();
4365
- init_esm();
4366
- import { performance } from "node:perf_hooks";
4367
-
4368
- // packages/cli/src/serve/server/telemetry-context.ts
4555
+ // packages/cli/src/serve/local-control/lan-interfaces.ts
4369
4556
  init_esbuild_shims();
4370
- var daemonTelemetryResponseContext = Symbol(
4371
- "daemonTelemetryResponseContext"
4372
- );
4373
- var daemonInboundTraceIdContext = Symbol(
4374
- "daemonInboundTraceIdContext"
4375
- );
4376
- function getDaemonTelemetryInboundTraceId(res) {
4377
- try {
4378
- return res[daemonInboundTraceIdContext];
4379
- } catch {
4380
- 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;
4381
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;
4382
4569
  }
4383
- __name(getDaemonTelemetryInboundTraceId, "getDaemonTelemetryInboundTraceId");
4384
-
4385
- // packages/cli/src/serve/server/access-log.ts
4386
- var SESSION_ID_RE = /\/session\/([^/]+)/;
4387
- var ACCESS_LOG_BURST = 60;
4388
- var ACCESS_LOG_REFILL_PER_SECOND = 2;
4389
- var ROUTE_MAX_BYTES = 2 * 1024;
4390
- var SESSION_ID_MAX_BYTES = 256;
4391
- var CLIENT_ID_MAX_BYTES = 256;
4392
- var ACCESS_LOG_CONTROLLER_LOCAL = "accessLogController";
4393
- function emptySuppressedCounts() {
4394
- return {
4395
- suppressed: 0,
4396
- status2xx: 0,
4397
- status3xx: 0,
4398
- status4xx: 0,
4399
- status5xx: 0,
4400
- statusOther: 0
4401
- };
4402
- }
4403
- __name(emptySuppressedCounts, "emptySuppressedCounts");
4404
- function countSuppressed(counts, status) {
4405
- counts.suppressed += 1;
4406
- if (status >= 200 && status < 300) counts.status2xx += 1;
4407
- else if (status >= 300 && status < 400) counts.status3xx += 1;
4408
- else if (status >= 400 && status < 500) counts.status4xx += 1;
4409
- else if (status >= 500 && status < 600) counts.status5xx += 1;
4410
- 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
+ );
4411
4576
  }
4412
- __name(countSuppressed, "countSuppressed");
4413
- function firstRawHeader(rawHeaders, targetName) {
4414
- for (let i = 0; i + 1 < rawHeaders.length; i += 2) {
4415
- 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
+ }
4416
4587
  }
4417
- return void 0;
4418
- }
4419
- __name(firstRawHeader, "firstRawHeader");
4420
- function truncateUtf8(value, maxBytes) {
4421
- const bytes = Buffer.from(value, "utf8");
4422
- if (bytes.length <= maxBytes) return { value };
4423
- let end = maxBytes;
4424
- while (end > 0 && (bytes[end] & 192) === 128) end -= 1;
4425
- return {
4426
- value: bytes.subarray(0, end).toString("utf8"),
4427
- originalBytes: bytes.length
4428
- };
4588
+ return candidates;
4429
4589
  }
4430
- __name(truncateUtf8, "truncateUtf8");
4431
- function installAccessLogMiddleware(app, daemonLog, monotonicNow = () => performance.now()) {
4432
- let sealed = false;
4433
- let tokens = ACCESS_LOG_BURST;
4434
- let refillBaseline = monotonicNow();
4435
- let suppressed = emptySuppressedCounts();
4436
- const refill = /* @__PURE__ */ __name(() => {
4437
- const now = Math.max(monotonicNow(), refillBaseline);
4438
- tokens = Math.min(
4439
- ACCESS_LOG_BURST,
4440
- 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)."
4441
4599
  );
4442
- refillBaseline = now;
4443
- }, "refill");
4444
- const flushSuppressed = /* @__PURE__ */ __name(() => {
4445
- if (!daemonLog || suppressed.suppressed === 0) return false;
4446
- context.with(ROOT_CONTEXT, () => {
4447
- daemonLog.warn("access logs suppressed", suppressed);
4448
- });
4449
- suppressed = emptySuppressedCounts();
4450
- return true;
4451
- }, "flushSuppressed");
4452
- const controller = {
4453
- sealAndFlushSuppressed: /* @__PURE__ */ __name(() => {
4454
- if (sealed) return;
4455
- sealed = true;
4456
- try {
4457
- flushSuppressed();
4458
- } catch {
4459
- }
4460
- }, "sealAndFlushSuppressed")
4461
- };
4462
- app.locals[ACCESS_LOG_CONTROLLER_LOCAL] = controller;
4463
- if (!daemonLog) return controller;
4464
- app.use((req, res, next) => {
4465
- const { method, path: reqPath } = req;
4466
- if (method === "GET" && reqPath === "/health" || method === "POST" && reqPath.endsWith("/heartbeat")) {
4467
- return next();
4468
- }
4469
- const startMs = monotonicNow();
4470
- res.on("finish", () => {
4471
- try {
4472
- if (sealed) return;
4473
- const status = res.statusCode;
4474
- if (method === "GET" && reqPath.endsWith("/events") && status === 200) {
4475
- return;
4476
- }
4477
- refill();
4478
- if (suppressed.suppressed > 0 && tokens >= 1) {
4479
- tokens -= 1;
4480
- flushSuppressed();
4481
- }
4482
- if (tokens < 1) {
4483
- countSuppressed(suppressed, status);
4484
- return;
4485
- }
4486
- tokens -= 1;
4487
- const route = truncateUtf8(`${method} ${reqPath}`, ROUTE_MAX_BYTES);
4488
- const sessionMatch = reqPath.match(SESSION_ID_RE);
4489
- const sessionId = sessionMatch?.[1] ? truncateUtf8(sessionMatch[1], SESSION_ID_MAX_BYTES) : void 0;
4490
- const rawClientId = firstRawHeader(req.rawHeaders, "x-qwen-client-id");
4491
- const clientId = rawClientId ? truncateUtf8(rawClientId, CLIENT_ID_MAX_BYTES) : void 0;
4492
- const inboundTraceId = getDaemonTelemetryInboundTraceId(res);
4493
- const ctx = {
4494
- route: route.value,
4495
- ...route.originalBytes ? { routeOriginalBytes: route.originalBytes } : {},
4496
- ...sessionId ? {
4497
- sessionId: sessionId.value,
4498
- ...sessionId.originalBytes ? { sessionIdOriginalBytes: sessionId.originalBytes } : {}
4499
- } : {},
4500
- ...clientId ? {
4501
- clientId: clientId.value,
4502
- ...clientId.originalBytes ? { clientIdOriginalBytes: clientId.originalBytes } : {}
4503
- } : {},
4504
- ...inboundTraceId ? { traceId: inboundTraceId } : {},
4505
- status,
4506
- durationMs: Math.max(0, Math.round(monotonicNow() - startMs))
4507
- };
4508
- if (status >= 400) daemonLog.warn("request completed", ctx);
4509
- else daemonLog.info("request completed", ctx);
4510
- } catch {
4511
- }
4512
- });
4513
- next();
4514
- });
4515
- 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];
4516
4639
  }
4517
- __name(installAccessLogMiddleware, "installAccessLogMiddleware");
4640
+ __name(selectLanAddress, "selectLanAddress");
4518
4641
 
4519
4642
  export {
4520
4643
  sanitizeForStderr,
@@ -4529,13 +4652,15 @@ export {
4529
4652
  createBridgeFileSystemAdapter,
4530
4653
  PathMutexRegistry,
4531
4654
  isDeepHealthQuery,
4532
- installSelfOriginStripMiddleware,
4533
- acpChildExtraArgs,
4534
4655
  CredentialStore,
4535
4656
  singleTokenCredentials,
4536
4657
  tagListener,
4537
4658
  listenerIdentityOf,
4538
4659
  listenerIdentityOfSocket,
4660
+ daemonTelemetryResponseContext,
4661
+ daemonInboundTraceIdContext,
4662
+ ACCESS_LOG_CONTROLLER_LOCAL,
4663
+ installAccessLogMiddleware,
4539
4664
  denyBrowserOriginCors,
4540
4665
  parseAllowOriginPatterns,
4541
4666
  findNonLoopbackHttpOrigin,
@@ -4546,6 +4671,15 @@ export {
4546
4671
  isTrustedLoopbackMode,
4547
4672
  requestHasOperatorAuthority,
4548
4673
  createMutationGate,
4674
+ installRemoteSelfOriginMiddleware,
4675
+ installSelfOriginStripMiddleware,
4676
+ isSoftwareNetwork,
4677
+ listLanCandidates,
4678
+ NoLanInterfaceError,
4679
+ AmbiguousLanInterfaceError,
4680
+ UnknownLanInterfaceError,
4681
+ selectLanAddress,
4682
+ acpChildExtraArgs,
4549
4683
  ClientMcpSenderRegistry,
4550
4684
  createClientMcpServerProvider,
4551
4685
  SERVE_CAPABILITY_REGISTRY,
@@ -4564,11 +4698,6 @@ export {
4564
4698
  isScratchRootCompatible,
4565
4699
  prepareManagedScratchRoot,
4566
4700
  createManagedScratchDirectory,
4567
- ConversationRuntimeOwnershipError,
4568
- conversationRuntimeInUseError,
4569
- conversationRuntimeUnavailableError,
4570
- conversationRuntimeOwnershipCompromisedError,
4571
- conversationRootCompromisedError,
4572
4701
  ServeAppLifecycleController,
4573
4702
  installServeAppLifecycle,
4574
4703
  createRateLimiter,
@@ -4592,11 +4721,7 @@ export {
4592
4721
  isBrowserAutomationMcpAvailable,
4593
4722
  MAX_CONCURRENT_VOICE_SESSIONS,
4594
4723
  VoiceLeaseAbortError,
4595
- WorkspaceVoiceCoordinator,
4596
- daemonTelemetryResponseContext,
4597
- daemonInboundTraceIdContext,
4598
- ACCESS_LOG_CONTROLLER_LOCAL,
4599
- installAccessLogMiddleware
4724
+ WorkspaceVoiceCoordinator
4600
4725
  };
4601
4726
  /**
4602
4727
  * @license