@qwen-code/qwen-code 0.19.6 → 0.19.7

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 (267) hide show
  1. package/bundled/qc-helper/docs/configuration/model-providers.md +5 -1
  2. package/bundled/qc-helper/docs/configuration/settings.md +33 -1
  3. package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/features/channels/overview.md +37 -31
  5. package/bundled/qc-helper/docs/features/channels/wecom.md +111 -0
  6. package/bundled/qc-helper/docs/features/code-review.md +16 -6
  7. package/bundled/qc-helper/docs/features/commands.md +1 -1
  8. package/bundled/qc-helper/docs/features/hooks.md +6 -0
  9. package/bundled/qc-helper/docs/features/skills.md +5 -3
  10. package/bundled/qc-helper/docs/integration-github-action.md +1 -1
  11. package/bundled/review/DESIGN.md +50 -18
  12. package/bundled/review/SKILL.md +102 -12
  13. package/chunks/{MaxSizedBox-SK7CUWZQ.js → MaxSizedBox-XY5LIO5O.js} +31 -29
  14. package/chunks/{StandaloneSessionPicker-G44HGSAP.js → StandaloneSessionPicker-APISIRJZ.js} +44 -41
  15. package/chunks/{acpAgent-PKCTYWJV.js → acpAgent-MMOSC2YA.js} +769 -366
  16. package/chunks/{agent-IYMHUXWB.js → agent-TKIBLLQT.js} +24 -24
  17. package/chunks/{agent-headless-L2DAW6I5.js → agent-headless-VLX4C7KX.js} +24 -24
  18. package/chunks/{anthropicContentGenerator-H5ZOEENQ.js → anthropicContentGenerator-AKYPSZIV.js} +7 -7
  19. package/chunks/{artifact-tool-SLYPWG3C.js → artifact-tool-D233YJFH.js} +27 -8
  20. package/chunks/{askUserQuestion-OKPTECON.js → askUserQuestion-MKL5ZTMC.js} +2 -2
  21. package/chunks/{bridge-DF3IJQ5V.js → bridge-BCU73DZO.js} +34 -32
  22. package/chunks/{channel-worker-supervisor-JUYQ5Z4R.js → channel-worker-supervisor-CRCVYQIE.js} +1 -1
  23. package/chunks/{chunk-AVQDCKNF.js → chunk-22MNNNXE.js} +4 -0
  24. package/chunks/{chunk-OAYOHSGP.js → chunk-24XYI5EI.js} +4 -4
  25. package/chunks/{chunk-6BEOH4KK.js → chunk-2NPS2UDH.js} +767 -122
  26. package/chunks/chunk-332PWN27.js +19 -0
  27. package/chunks/{chunk-CLQPBI4H.js → chunk-3B26UVCX.js} +132 -26
  28. package/chunks/{chunk-G7OQ3RFJ.js → chunk-42XGFRJS.js} +3 -3
  29. package/chunks/{chunk-SL2P3JUA.js → chunk-43W4YSO6.js} +1 -12
  30. package/chunks/{chunk-JA5KWZTJ.js → chunk-44NROQYV.js} +5 -3
  31. package/chunks/{chunk-MOUXUCXQ.js → chunk-4KJ2BPIT.js} +1 -1
  32. package/chunks/chunk-4O344UEE.js +167 -0
  33. package/chunks/{chunk-ZO5EA3XJ.js → chunk-4UCTWSTP.js} +1 -1
  34. package/chunks/{chunk-SOT7OMGL.js → chunk-4ZJIPVPB.js} +2 -2
  35. package/chunks/{chunk-FPHA7WIZ.js → chunk-65CFHNSE.js} +3 -3
  36. package/chunks/{chunk-FDY3XOTM.js → chunk-6BN7NZ5Z.js} +4 -4
  37. package/chunks/{chunk-DBF3HTLT.js → chunk-7JGISHHZ.js} +4 -4
  38. package/chunks/{chunk-T42ACHFI.js → chunk-7LTB54MK.js} +1 -1
  39. package/chunks/chunk-A2X3KLC3.js +3807 -0
  40. package/chunks/{chunk-HCFSKO6K.js → chunk-ADZG46HR.js} +1 -1
  41. package/chunks/{chunk-MX7CTJHR.js → chunk-AFOLR6YL.js} +9 -9
  42. package/chunks/{chunk-EWALXUAD.js → chunk-AGHU5VRK.js} +8 -0
  43. package/chunks/{chunk-GLPV75ES.js → chunk-AHNJGLFV.js} +2 -2
  44. package/chunks/{chunk-QOKV6AO4.js → chunk-AIY5UTFI.js} +184 -147
  45. package/chunks/{chunk-57NRQM3P.js → chunk-AJBEAUIS.js} +2 -2
  46. package/chunks/chunk-ALZ75L2X.js +949 -0
  47. package/chunks/{chunk-T22H4V4R.js → chunk-B34OV7K2.js} +1 -1
  48. package/chunks/{chunk-GQBRGBLS.js → chunk-B4U2M63D.js} +9 -9
  49. package/chunks/{chunk-UTL7KABL.js → chunk-BWVQN2HV.js} +7 -7
  50. package/chunks/{chunk-YPCPZSZB.js → chunk-CCGOFQV3.js} +56 -4
  51. package/chunks/{chunk-BOAWGUY6.js → chunk-CISB3IQF.js} +121 -49
  52. package/chunks/{chunk-SRNPMG7J.js → chunk-CNSF3WO5.js} +16 -10
  53. package/chunks/{chunk-LWGLBVWA.js → chunk-CSOTA7KX.js} +1 -1
  54. package/chunks/{chunk-YSU33ACT.js → chunk-DGHJTO2K.js} +5 -13
  55. package/chunks/{chunk-NIOPRZNN.js → chunk-E7KNELIZ.js} +1 -1
  56. package/chunks/{chunk-SEZC2725.js → chunk-ER3BKOLB.js} +13 -0
  57. package/chunks/{chunk-3VJ7MT3N.js → chunk-EXPMGZZV.js} +14 -3
  58. package/chunks/{chunk-RZORUN6X.js → chunk-FEJ2FZ3U.js} +1 -1
  59. package/chunks/{chunk-OIFSBXSP.js → chunk-FRFFNYUY.js} +3 -3
  60. package/chunks/{chunk-MHQKYQDS.js → chunk-FTFXDZYI.js} +158 -3
  61. package/chunks/{chunk-DMSNJDWG.js → chunk-FV7425LN.js} +38 -3
  62. package/chunks/{chunk-ALX6BUYW.js → chunk-G7ZG7CA6.js} +186 -27
  63. package/chunks/chunk-GD236YPV.js +28 -0
  64. package/chunks/{chunk-XH7H6YG4.js → chunk-GL5TV7B5.js} +4 -107
  65. package/chunks/{chunk-JN2VJ33O.js → chunk-GMOWQOQQ.js} +966 -121
  66. package/chunks/{chunk-D5KISTLW.js → chunk-H6EMK6QK.js} +1 -1
  67. package/chunks/{chunk-MBWLP5OT.js → chunk-HJ3GX3Y3.js} +162 -40
  68. package/chunks/{chunk-KYTQOCDE.js → chunk-HW4N45EE.js} +17 -46
  69. package/chunks/{chunk-DXXNMPJH.js → chunk-I4A4K72C.js} +460 -93
  70. package/chunks/{chunk-VXGPYF7U.js → chunk-IFEWJXFS.js} +1 -1
  71. package/chunks/chunk-II73RK2S.js +158 -0
  72. package/chunks/{chunk-TENOUWY2.js → chunk-IJRL2S3D.js} +3 -3
  73. package/chunks/{chunk-C2QKQZEQ.js → chunk-IUE7YWC3.js} +3 -3
  74. package/chunks/{chunk-3UC7ZC43.js → chunk-JD33UY7E.js} +7 -7
  75. package/chunks/{chunk-7Z6UEJA4.js → chunk-JF7DFPQ5.js} +5 -2
  76. package/chunks/{chunk-IUSKVKH5.js → chunk-LEIJKM7Q.js} +1 -1
  77. package/chunks/chunk-LGFAYIKX.js +115 -0
  78. package/chunks/{chunk-N2IJLN2L.js → chunk-ME3YSROJ.js} +13 -5
  79. package/chunks/{chunk-V6NH3CUC.js → chunk-MIG5SQNL.js} +3 -3
  80. package/chunks/{chunk-MJKEQSZI.js → chunk-MJI36HER.js} +1 -1
  81. package/chunks/{chunk-YHTNWGRR.js → chunk-MZ7BABX3.js} +1 -1
  82. package/chunks/{chunk-B236XPGF.js → chunk-NQKLOAVJ.js} +29 -2
  83. package/chunks/{chunk-3X76L4UF.js → chunk-NZEGNV4V.js} +5 -5
  84. package/chunks/{chunk-O2RJARYU.js → chunk-OWVIH4HY.js} +1409 -4088
  85. package/chunks/{chunk-YTWX5TT2.js → chunk-P7I3D7FM.js} +1 -1
  86. package/chunks/{chunk-HTWHAN44.js → chunk-PC4ZXHU2.js} +1 -1
  87. package/chunks/chunk-PRDFOIZF.js +2477 -0
  88. package/chunks/{chunk-UNXGEDX2.js → chunk-PUQLHSQ2.js} +133 -25
  89. package/chunks/{chunk-5WQF27GW.js → chunk-Q6OEPOOC.js} +1 -1
  90. package/chunks/{chunk-6QVRLKTZ.js → chunk-QAKFYMJI.js} +7 -7
  91. package/chunks/{chunk-NPQWQYU6.js → chunk-QYNNN7BK.js} +1 -1
  92. package/chunks/{chunk-2INJBYLJ.js → chunk-QZF5U5KA.js} +6 -6
  93. package/chunks/{chunk-N4YJQTRL.js → chunk-RFIL6REB.js} +71 -2
  94. package/chunks/{chunk-FZ5NVRVK.js → chunk-RYFZCUJO.js} +3 -3
  95. package/chunks/{chunk-KSPVDFE4.js → chunk-SAIILPQ3.js} +0 -3
  96. package/chunks/chunk-SD4N3QJ2.js +262 -0
  97. package/chunks/{chunk-CEYA7K7C.js → chunk-STAZRKOT.js} +62 -12
  98. package/chunks/{chunk-BZHLWC6T.js → chunk-SUAKHHK7.js} +2 -2
  99. package/chunks/{chunk-ZI4MGBB5.js → chunk-TBAZMRW3.js} +1 -1
  100. package/chunks/{chunk-J6ABRKAB.js → chunk-TDGF35EN.js} +2 -2
  101. package/chunks/{chunk-TOAUDIS7.js → chunk-TLWA7TPR.js} +6 -2
  102. package/chunks/{chunk-LXFCHX4X.js → chunk-U4FRHCLA.js} +312 -25
  103. package/chunks/chunk-UIDXQNMV.js +13 -0
  104. package/chunks/{chunk-LM3YCCZJ.js → chunk-VEB3NYSO.js} +1 -1
  105. package/chunks/chunk-VQWAZSXN.js +8223 -0
  106. package/chunks/{chunk-5ES5YPED.js → chunk-VZ7HY3YU.js} +1 -1
  107. package/chunks/{chunk-QOMAHFYI.js → chunk-W7EEOR7D.js} +3 -3
  108. package/chunks/{chunk-NVFJSIAX.js → chunk-WMPVYQ4P.js} +1 -1
  109. package/chunks/{chunk-V5VTULL5.js → chunk-X265R5C6.js} +3 -3
  110. package/chunks/{chunk-LKWAVAB5.js → chunk-X2XNQQJI.js} +2 -2
  111. package/chunks/{chunk-MJKMIQMK.js → chunk-X3YGAX7V.js} +1 -1
  112. package/chunks/{chunk-OBVBTAX5.js → chunk-XISQIIT7.js} +2 -2
  113. package/chunks/{chunk-NUK2PFSU.js → chunk-XPJH4PKR.js} +1 -1
  114. package/chunks/{chunk-A34EPIUV.js → chunk-XSAFNANZ.js} +18 -15
  115. package/chunks/{chunk-WXUDZHOJ.js → chunk-YDSYD7UI.js} +10 -2
  116. package/chunks/{chunk-AGZF43UV.js → chunk-YEGT55NW.js} +7153 -4406
  117. package/chunks/{computer-use-5S3NVXRA.js → computer-use-X4KUU3NM.js} +24 -24
  118. package/chunks/{contextCommand-DPBALZFK.js → contextCommand-LAYJZF7H.js} +28 -27
  119. package/chunks/{cron-create-7JYUDTUY.js → cron-create-JSXEIPVS.js} +4 -4
  120. package/chunks/{cron-delete-YPULQQAK.js → cron-delete-OIFVEPGU.js} +4 -4
  121. package/chunks/{cron-list-HJIW5MHP.js → cron-list-D4ZX4IOE.js} +11 -7
  122. package/chunks/{daemon-7XYW4BC3.js → daemon-F3I2RXP6.js} +208 -63
  123. package/chunks/daemon-status-provider-XSAFKVDS.js +74 -0
  124. package/chunks/dist-573HNSVO.js +3217 -0
  125. package/chunks/{dist-ABQ7VWRR.js → dist-FQ5WRJPL.js} +2 -2
  126. package/chunks/{dist-JPSVN367.js → dist-IMFFBMAT.js} +6 -3792
  127. package/chunks/{dist-BV56HW3W.js → dist-OT7G2WNM.js} +250 -1
  128. package/chunks/{dist-AW5ZYMUI.js → dist-PKFTNUHO.js} +10 -11
  129. package/chunks/{dist-AAO65DPC.js → dist-YTRKAVUB.js} +1 -1
  130. package/chunks/{earlyInputCapture-GGPV4IFT.js → earlyInputCapture-AERYYGXE.js} +25 -25
  131. package/chunks/{edit-HJ7ISN4C.js → edit-WZTZDGCI.js} +25 -25
  132. package/chunks/{en-XR3S5VWY.js → en-GA2RMXY5.js} +6 -1
  133. package/chunks/{enter-worktree-2BQT675D.js → enter-worktree-DEPXBJEL.js} +24 -24
  134. package/chunks/{enterPlanMode-SJXHJ3WD.js → enterPlanMode-JFGXZHHJ.js} +24 -24
  135. package/chunks/{errors-EVGER4AZ.js → errors-GMZL4QV7.js} +26 -26
  136. package/chunks/{exit-worktree-RPDDOSPM.js → exit-worktree-Y7XBK3VV.js} +24 -24
  137. package/chunks/{exitPlanMode-BQEROAJ7.js → exitPlanMode-WQQER65F.js} +24 -24
  138. package/chunks/{fast-path-FX2ICJ2O.js → fast-path-W2U6XDNO.js} +5 -2
  139. package/chunks/{fr-MBMNQSQ6.js → fr-GWNQG4XH.js} +4 -0
  140. package/chunks/{gemini-EHUXCOUI.js → gemini-T4WX6SRW.js} +444 -256
  141. package/chunks/{geminiContentGenerator-YDUUKAM2.js → geminiContentGenerator-MKQACXEJ.js} +4 -4
  142. package/chunks/{glob-3VIGV2DL.js → glob-4KKSHZDF.js} +52 -28
  143. package/chunks/{grep-4D3S4NUC.js → grep-GHRYXSLZ.js} +24 -24
  144. package/chunks/handleAutoUpdate-HN7ZOSXY.js +65 -0
  145. package/chunks/{initializer-QZTZSSLW.js → initializer-SRN3IM42.js} +31 -29
  146. package/chunks/{ja-HFV5QCHR.js → ja-2HOTA47X.js} +4 -0
  147. package/chunks/{keychain-token-storage-GPAKRDKQ.js → keychain-token-storage-UJV5XP4Z.js} +2 -2
  148. package/chunks/{list-WQ24EAMK.js → list-INTVXUPA.js} +30 -30
  149. package/chunks/{loadedSettingsAdapter-XV74KOSR.js → loadedSettingsAdapter-QVHHQPGM.js} +28 -28
  150. package/chunks/{loop-wakeup-34YK7T7O.js → loop-wakeup-OHWEMFP5.js} +5 -5
  151. package/chunks/{ls-MPD5OJUX.js → ls-L654WOAT.js} +4 -4
  152. package/chunks/{lsp-72PWTDW7.js → lsp-M35KE54Y.js} +2 -2
  153. package/chunks/{mcp-CO3MKM7N.js → mcp-7V4T46RG.js} +28 -28
  154. package/chunks/{monitor-GB56T65A.js → monitor-464OY2UE.js} +32 -27
  155. package/chunks/nonInteractiveCli-LJEEODU2.js +116 -0
  156. package/chunks/{notebook-edit-VMXAAE3R.js → notebook-edit-BLJYCNDO.js} +25 -25
  157. package/chunks/{openaiContentGenerator-GM77FLII.js → openaiContentGenerator-PFF6HYB2.js} +12 -12
  158. package/chunks/{pidfile-HFXSHR64.js → pidfile-LIBUENIV.js} +25 -25
  159. package/chunks/{qwenContentGenerator-QSCXQIKJ.js → qwenContentGenerator-SUUHZ6CR.js} +26 -26
  160. package/chunks/{qwenOAuth2-LWLA6MQG.js → qwenOAuth2-ZV7YLMND.js} +5 -5
  161. package/chunks/{read-file-SVH6CGQY.js → read-file-L7TBQVX7.js} +8 -8
  162. package/chunks/{read-mcp-resource-OWOBJY72.js → read-mcp-resource-CNQHBSJM.js} +2 -2
  163. package/chunks/{record-artifact-URK3YUDJ.js → record-artifact-PP3LKHTS.js} +2 -2
  164. package/chunks/{ripGrep-JD5O2FLX.js → ripGrep-CKKX3GRB.js} +24 -24
  165. package/chunks/{run-qwen-serve-FADLRJUN.js → run-qwen-serve-5OKADVLE.js} +785 -35
  166. package/chunks/{scheduler-Q65SB7DJ.js → scheduler-ZRW3AIDU.js} +24 -24
  167. package/chunks/{send-message-L7OLQEKH.js → send-message-OA6MV4EU.js} +3 -3
  168. package/chunks/{serve-6ZXAMQ4M.js → serve-36WS32W6.js} +29 -29
  169. package/chunks/{server-WKDQA6XR.js → server-M372UENX.js} +2504 -439
  170. package/chunks/{session-STWOX7RA.js → session-F5KSNP2N.js} +66 -61
  171. package/chunks/{settings-LC4CCWQQ.js → settings-WFLNS3WT.js} +27 -27
  172. package/chunks/{shell-FEG3RLPW.js → shell-DEDSWN56.js} +24 -24
  173. package/chunks/{skill-XTXAMDAP.js → skill-A2TL2NPC.js} +24 -12
  174. package/chunks/{spawnChannel-B6JJPBPV.js → spawnChannel-RQHUWTCL.js} +27 -27
  175. package/chunks/{src-HITDGVRM.js → src-XKZMNHXS.js} +91 -36
  176. package/chunks/{startInteractiveUI-IT423PW4.js → startInteractiveUI-REKSTOHU.js} +6213 -14273
  177. package/chunks/{syntheticOutput-J3MLCQAR.js → syntheticOutput-F7LSDCAR.js} +3 -3
  178. package/chunks/{task-create-ELEBZ7H2.js → task-create-RPFZNB4B.js} +7 -7
  179. package/chunks/{task-list-IEUZLF3Y.js → task-list-TGGJX7EA.js} +5 -5
  180. package/chunks/{task-stop-QEZW3UDY.js → task-stop-W7NGTMYQ.js} +2 -2
  181. package/chunks/{task-update-DW36J5P5.js → task-update-5WUG5MVQ.js} +7 -7
  182. package/chunks/{team-create-DAG6SNHZ.js → team-create-TBQVWAG7.js} +24 -24
  183. package/chunks/{team-delete-SVITIMBO.js → team-delete-UHQQ2QQX.js} +5 -5
  184. package/chunks/{team-plan-approval-DRDY5OPC.js → team-plan-approval-FZPGUSHJ.js} +24 -24
  185. package/chunks/{theme-manager-N67EZC6B.js → theme-manager-DQZVNSOC.js} +25 -25
  186. package/chunks/{todoWrite-SFFQHZYY.js → todoWrite-C4ZAMSR3.js} +4 -4
  187. package/chunks/{tool-search-CMDJ5HGM.js → tool-search-FDQ3SLNJ.js} +11 -28
  188. package/chunks/{trustedFolders-JD4QX6UJ.js → trustedFolders-Z475EIHL.js} +25 -25
  189. package/chunks/updateCheck-E2ZX7RL7.js +65 -0
  190. package/chunks/{validateNonInterActiveAuth-ADDCGZ6A.js → validateNonInterActiveAuth-O4ECBHQL.js} +61 -56
  191. package/chunks/{version-VAONYVE5.js → version-CEDD6ZZR.js} +2 -1
  192. package/chunks/{web-fetch-SXAXJHIO.js → web-fetch-UYGMOHW4.js} +5 -5
  193. package/chunks/{workflow-DG2BR42M.js → workflow-CQQ4J4I6.js} +25 -25
  194. package/chunks/{workspace-providers-status-XGW5OZTD.js → workspace-providers-status-MVYXMYDG.js} +30 -30
  195. package/chunks/{workspace-service-GX3GGZLU.js → workspace-service-OMBR6ZLG.js} +35 -35
  196. package/chunks/{workspace-skills-status-LFK5WV2V.js → workspace-skills-status-IMMQ7CAY.js} +29 -29
  197. package/chunks/{write-file-UR7FXWOU.js → write-file-VWGY7AJP.js} +25 -25
  198. package/chunks/{zh-FSVJTXA4.js → zh-7XVVRTDH.js} +6 -1
  199. package/chunks/{zh-TW-66MG4LWL.js → zh-TW-DPH554OG.js} +6 -1
  200. package/cli.js +19 -11
  201. package/locales/en.js +9 -2
  202. package/locales/fr.js +6 -0
  203. package/locales/ja.js +6 -0
  204. package/locales/zh-TW.js +9 -2
  205. package/locales/zh.js +9 -2
  206. package/node_modules/@qwen-code/audio-capture/package.json +1 -1
  207. package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
  208. package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
  209. package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
  210. package/package.json +3 -3
  211. package/web-shell/assets/{arc-CUpe0ibu.js → arc-C7hjaa7g.js} +1 -1
  212. package/web-shell/assets/{architectureDiagram-3BPJPVTR-JvyrY_mK.js → architectureDiagram-3BPJPVTR-pm9KtMZY.js} +1 -1
  213. package/web-shell/assets/{blockDiagram-GPEHLZMM-CK3Y_vom.js → blockDiagram-GPEHLZMM-CApElKsU.js} +1 -1
  214. package/web-shell/assets/{c4Diagram-AAUBKEIU-DprSnyrf.js → c4Diagram-AAUBKEIU-BeDe0-9N.js} +1 -1
  215. package/web-shell/assets/channel-BNf1dW-j.js +1 -0
  216. package/web-shell/assets/{chunk-2J33WTMH-DJtRJPmu.js → chunk-2J33WTMH-DJEkmLdl.js} +1 -1
  217. package/web-shell/assets/{chunk-4BX2VUAB-ON6Q2-BG.js → chunk-4BX2VUAB-DXX8gdpe.js} +1 -1
  218. package/web-shell/assets/{chunk-55IACEB6-c60ou5HZ.js → chunk-55IACEB6-DORmk1kQ.js} +1 -1
  219. package/web-shell/assets/{chunk-727SXJPM-BamtPKxx.js → chunk-727SXJPM-DWmO4mCZ.js} +1 -1
  220. package/web-shell/assets/{chunk-AQP2D5EJ-CsVgpu-T.js → chunk-AQP2D5EJ-C7LRaYw2.js} +1 -1
  221. package/web-shell/assets/{chunk-FMBD7UC4-vZrpjAx4.js → chunk-FMBD7UC4-CCdXgyC5.js} +1 -1
  222. package/web-shell/assets/{chunk-ND2GUHAM-qxyNOd5t.js → chunk-ND2GUHAM-SyL_xvWc.js} +1 -1
  223. package/web-shell/assets/{chunk-QZHKN3VN-BvTJSM_S.js → chunk-QZHKN3VN-BzOuCKxa.js} +1 -1
  224. package/web-shell/assets/classDiagram-4FO5ZUOK-uOIGlzgi.js +1 -0
  225. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-uOIGlzgi.js +1 -0
  226. package/web-shell/assets/{cose-bilkent-S5V4N54A-1tXB4pju.js → cose-bilkent-S5V4N54A-BMPWyDKc.js} +1 -1
  227. package/web-shell/assets/{dagre-BM42HDAG-DglBzme8.js → dagre-BM42HDAG-B_GnPWik.js} +1 -1
  228. package/web-shell/assets/{diagram-2AECGRRQ-DEJpqsWz.js → diagram-2AECGRRQ-fJqMc3S_.js} +1 -1
  229. package/web-shell/assets/{diagram-5GNKFQAL-CsQ1NrMG.js → diagram-5GNKFQAL-ximV3O9D.js} +1 -1
  230. package/web-shell/assets/{diagram-KO2AKTUF-Z-3codAi.js → diagram-KO2AKTUF-2vVyjzqw.js} +1 -1
  231. package/web-shell/assets/{diagram-LMA3HP47-mBuPTA2i.js → diagram-LMA3HP47-Dckcx1sT.js} +1 -1
  232. package/web-shell/assets/{diagram-OG6HWLK6-tcA3K3s9.js → diagram-OG6HWLK6-BAVv47ga.js} +1 -1
  233. package/web-shell/assets/{erDiagram-TEJ5UH35-D9bXFRyZ.js → erDiagram-TEJ5UH35-Bn3nf5J0.js} +1 -1
  234. package/web-shell/assets/{flowDiagram-I6XJVG4X-Ck0Py04s.js → flowDiagram-I6XJVG4X-BIbGF9JT.js} +1 -1
  235. package/web-shell/assets/{ganttDiagram-6RSMTGT7-rOevCekE.js → ganttDiagram-6RSMTGT7-CDbhb3AH.js} +1 -1
  236. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CoPQaLj0.js → gitGraphDiagram-PVQCEYII-CbKG1a_w.js} +1 -1
  237. package/web-shell/assets/index-CnE2ur2L.js +779 -0
  238. package/web-shell/assets/index-hSKXrlSE.css +5 -0
  239. package/web-shell/assets/{infoDiagram-5YYISTIA-a77CUKoI.js → infoDiagram-5YYISTIA-DUFxTy8m.js} +1 -1
  240. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DlLgUAO-.js → ishikawaDiagram-YF4QCWOH-D69hrBG8.js} +1 -1
  241. package/web-shell/assets/{journeyDiagram-JHISSGLW-BXR5kVAZ.js → journeyDiagram-JHISSGLW-DsvEw51Y.js} +1 -1
  242. package/web-shell/assets/{kanban-definition-UN3LZRKU-h5CoHZg7.js → kanban-definition-UN3LZRKU-lFFjZEYd.js} +1 -1
  243. package/web-shell/assets/{linear-BkaREbyD.js → linear-Bo5bWzvo.js} +1 -1
  244. package/web-shell/assets/{mermaid.core-Bkagz0ng.js → mermaid.core-C_HKMJx5.js} +5 -5
  245. package/web-shell/assets/{mindmap-definition-RKZ34NQL-D7EMKR_5.js → mindmap-definition-RKZ34NQL-DlV-NUTs.js} +1 -1
  246. package/web-shell/assets/{pieDiagram-4H26LBE5-DAmPOjsL.js → pieDiagram-4H26LBE5-B2e6FH2a.js} +1 -1
  247. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-e4WFQkQu.js → quadrantDiagram-W4KKPZXB-D75kSk-b.js} +1 -1
  248. package/web-shell/assets/{requirementDiagram-4Y6WPE33-v1zo7OiV.js → requirementDiagram-4Y6WPE33-CQ6xakhM.js} +1 -1
  249. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-Bstm4aW_.js → sankeyDiagram-5OEKKPKP-J_XTKrcY.js} +1 -1
  250. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DzcZy6xN.js → sequenceDiagram-3UESZ5HK-D7jTcBtf.js} +1 -1
  251. package/web-shell/assets/{stateDiagram-AJRCARHV-BEJH6YbH.js → stateDiagram-AJRCARHV-CrlM_OT3.js} +1 -1
  252. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Bs4TK_84.js +1 -0
  253. package/web-shell/assets/{timeline-definition-PNZ67QCA-TI1wH-Pm.js → timeline-definition-PNZ67QCA-5oZi76Ef.js} +1 -1
  254. package/web-shell/assets/{vennDiagram-CIIHVFJN-YaH8VDMS.js → vennDiagram-CIIHVFJN-DO5YptPK.js} +1 -1
  255. package/web-shell/assets/{wardley-L42UT6IY-B80co7OP.js → wardley-L42UT6IY-4t1eJDvM.js} +1 -1
  256. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-4fHNDEMl.js → wardleyDiagram-YWT4CUSO-DKZc661S.js} +1 -1
  257. package/web-shell/assets/{xychartDiagram-2RQKCTM6-DT3q4Z3J.js → xychartDiagram-2RQKCTM6-su9hp08G.js} +1 -1
  258. package/web-shell/index.html +2 -2
  259. package/chunks/chunk-L7QPM2YD.js +0 -481
  260. package/chunks/daemon-status-provider-2EWTHT7Y.js +0 -73
  261. package/chunks/nonInteractiveCli-HNZRIM5I.js +0 -111
  262. package/web-shell/assets/channel-BAxQ2-aZ.js +0 -1
  263. package/web-shell/assets/classDiagram-4FO5ZUOK-Cvd_xhZI.js +0 -1
  264. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Cvd_xhZI.js +0 -1
  265. package/web-shell/assets/index-Cr7MYW6T.css +0 -5
  266. package/web-shell/assets/index-DCHPAUp3.js +0 -730
  267. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BopifCBI.js +0 -1
@@ -40,6 +40,11 @@ function ndJsonStream(output, input, hooks) {
40
40
  try {
41
41
  await writer.write(frame);
42
42
  callHook(hooks?.onMessageSent, payload.byteLength);
43
+ callHook(hooks?.onMessageObserved, {
44
+ direction: "sent",
45
+ bytes: payload.byteLength,
46
+ message
47
+ });
43
48
  } finally {
44
49
  writer.releaseLock();
45
50
  }
@@ -83,7 +88,13 @@ function handleLine(lineBytes, controller, textDecoder, hooks) {
83
88
  try {
84
89
  const message = JSON.parse(trimmedLine);
85
90
  controller.enqueue(message);
86
- callHook(hooks?.onMessageReceived, jsonPayloadByteLength(lineBytes));
91
+ const bytes = jsonPayloadByteLength(lineBytes);
92
+ callHook(hooks?.onMessageReceived, bytes);
93
+ callHook(hooks?.onMessageObserved, {
94
+ direction: "received",
95
+ bytes,
96
+ message
97
+ });
87
98
  } catch (err) {
88
99
  console.error("Failed to parse JSON message:", trimmedLine, err);
89
100
  }
@@ -93,9 +104,9 @@ function jsonPayloadByteLength(lineBytes) {
93
104
  return lineBytes[lineBytes.byteLength - 1] === 13 ? lineBytes.byteLength - 1 : lineBytes.byteLength;
94
105
  }
95
106
  __name(jsonPayloadByteLength, "jsonPayloadByteLength");
96
- function callHook(hook, bytes) {
107
+ function callHook(hook, value) {
97
108
  try {
98
- hook?.(bytes);
109
+ hook?.(value);
99
110
  } catch {
100
111
  }
101
112
  }
@@ -5,7 +5,7 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-MJKMIQMK.js";
8
+ } from "./chunk-X3YGAX7V.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -6,16 +6,16 @@ import {
6
6
  import {
7
7
  JsonFormatter,
8
8
  parseAndFormatApiError
9
- } from "./chunk-AGZF43UV.js";
9
+ } from "./chunk-YEGT55NW.js";
10
10
  import {
11
11
  FatalBudgetExceededError,
12
12
  FatalCancellationError,
13
13
  FatalTurnLimitedError,
14
14
  createDebugLogger
15
- } from "./chunk-AVQDCKNF.js";
15
+ } from "./chunk-22MNNNXE.js";
16
16
  import {
17
17
  runExitCleanup
18
- } from "./chunk-ZO5EA3XJ.js";
18
+ } from "./chunk-4UCTWSTP.js";
19
19
  import {
20
20
  init_esbuild_shims
21
21
  } from "./chunk-A4BMJM77.js";
@@ -2,16 +2,19 @@
2
2
  "use strict";
3
3
  import {
4
4
  getEffectiveSupportedModes
5
- } from "./chunk-GQBRGBLS.js";
5
+ } from "./chunk-B4U2M63D.js";
6
6
  import {
7
7
  require_jsx_runtime
8
- } from "./chunk-YSU33ACT.js";
8
+ } from "./chunk-DGHJTO2K.js";
9
9
  import {
10
10
  require_react
11
11
  } from "./chunk-KYMBIKIW.js";
12
+ import {
13
+ getCachedStringWidth
14
+ } from "./chunk-GL5TV7B5.js";
12
15
  import {
13
16
  uiTelemetryService
14
- } from "./chunk-JN2VJ33O.js";
17
+ } from "./chunk-GMOWQOQQ.js";
15
18
  import {
16
19
  init_esbuild_shims
17
20
  } from "./chunk-A4BMJM77.js";
@@ -370,6 +373,153 @@ function getCommandSubcommandNames(command) {
370
373
  }
371
374
  __name(getCommandSubcommandNames, "getCommandSubcommandNames");
372
375
 
376
+ // packages/cli/src/ui/utils/pending-rendered-height.ts
377
+ init_esbuild_shims();
378
+ var TABLE_CHROME_ROWS = 5;
379
+ var TABLE_ROW_RE = /^\s*\|(.+)\|\s*$/;
380
+ var TABLE_SEPARATOR_RE = /^(?=.*\|)\s*\|?\s*(:?-+:?)\s*(\|\s*(:?-+:?)\s*)*\|?\s*$/;
381
+ var CODE_FENCE_RE = /^ *(`{3,}|~{3,}) *([^`]*)$/;
382
+ var INLINE_MATH_MAX_CHARS = 1024;
383
+ var TABLE_INLINE_MATH_SPAN_RE = new RegExp(
384
+ String.raw`(?<![\w$])\$(?![\s\d$])(?=[^$\n]{1,${INLINE_MATH_MAX_CHARS}}\S\$)[^$\n]{1,${INLINE_MATH_MAX_CHARS}}\$(?![\w$])`,
385
+ "y"
386
+ );
387
+ function readTableInlineMathSpan(row, index) {
388
+ TABLE_INLINE_MATH_SPAN_RE.lastIndex = index;
389
+ return TABLE_INLINE_MATH_SPAN_RE.exec(row)?.[0] ?? null;
390
+ }
391
+ __name(readTableInlineMathSpan, "readTableInlineMathSpan");
392
+ function splitMarkdownTableRow(row) {
393
+ const cells = [];
394
+ let current = "";
395
+ let activeCodeFenceLength = 0;
396
+ for (let index = 0; index < row.length; index++) {
397
+ const char = row[index];
398
+ if (char === "\\") {
399
+ const next = row[index + 1];
400
+ if (next === "|") {
401
+ current += "|";
402
+ index += 1;
403
+ continue;
404
+ }
405
+ current += char;
406
+ continue;
407
+ }
408
+ if (char === "`") {
409
+ let runLength = 1;
410
+ while (row[index + runLength] === "`") {
411
+ runLength += 1;
412
+ }
413
+ if (activeCodeFenceLength === 0) {
414
+ activeCodeFenceLength = runLength;
415
+ } else if (runLength === activeCodeFenceLength) {
416
+ activeCodeFenceLength = 0;
417
+ }
418
+ current += "`".repeat(runLength);
419
+ index += runLength - 1;
420
+ continue;
421
+ }
422
+ if (char === "$" && activeCodeFenceLength === 0) {
423
+ const mathSpan = readTableInlineMathSpan(row, index);
424
+ if (mathSpan) {
425
+ current += mathSpan;
426
+ index += mathSpan.length - 1;
427
+ continue;
428
+ }
429
+ }
430
+ if (char === "|" && activeCodeFenceLength === 0) {
431
+ cells.push(current.trim());
432
+ current = "";
433
+ continue;
434
+ }
435
+ current += char;
436
+ }
437
+ cells.push(current.trim());
438
+ return cells;
439
+ }
440
+ __name(splitMarkdownTableRow, "splitMarkdownTableRow");
441
+ function estimateWrappedRows(line, width) {
442
+ if (width <= 0) return 1;
443
+ return Math.max(1, Math.ceil(getCachedStringWidth(line) / width));
444
+ }
445
+ __name(estimateWrappedRows, "estimateWrappedRows");
446
+ function isTableStart(lines, i) {
447
+ const header = lines[i];
448
+ if (header === void 0 || i + 1 >= lines.length) return false;
449
+ const headerMatch = TABLE_ROW_RE.exec(header);
450
+ if (!headerMatch) return false;
451
+ const separator = lines[i + 1];
452
+ if (!TABLE_SEPARATOR_RE.test(separator)) return false;
453
+ const headerCols = splitMarkdownTableRow(headerMatch[1]).length;
454
+ const sepCols = splitMarkdownTableRow(separator).filter(
455
+ (cell) => cell.length > 0
456
+ ).length;
457
+ return headerCols === sepCols;
458
+ }
459
+ __name(isTableStart, "isTableStart");
460
+ function fitPendingSlice(allLines, contentWidth, budget, tableClampRows) {
461
+ let rendered = 0;
462
+ let kept = allLines.length;
463
+ let codeFence = "";
464
+ for (let i = 0; i < allLines.length; ) {
465
+ const line = allLines[i];
466
+ const fenceMatch = CODE_FENCE_RE.exec(line);
467
+ if (codeFence) {
468
+ if (fenceMatch && fenceMatch[1].startsWith(codeFence[0]) && fenceMatch[1].length >= codeFence.length) {
469
+ codeFence = "";
470
+ }
471
+ rendered += estimateWrappedRows(line, contentWidth);
472
+ if (rendered > budget) {
473
+ kept = i;
474
+ break;
475
+ }
476
+ i++;
477
+ continue;
478
+ }
479
+ if (fenceMatch) {
480
+ codeFence = fenceMatch[1];
481
+ rendered += estimateWrappedRows(line, contentWidth);
482
+ if (rendered > budget) {
483
+ kept = i;
484
+ break;
485
+ }
486
+ i++;
487
+ continue;
488
+ }
489
+ if (isTableStart(allLines, i)) {
490
+ let j = i + 2;
491
+ while (j < allLines.length && TABLE_ROW_RE.test(allLines[j])) j++;
492
+ const dataRows = j - (i + 2);
493
+ const colCount = splitMarkdownTableRow(
494
+ TABLE_ROW_RE.exec(allLines[i])[1]
495
+ ).length;
496
+ const minHorizontalWidth = Math.max(24, 6 * colCount + 5);
497
+ const usesVertical = contentWidth < minHorizontalWidth;
498
+ const rows = usesVertical ? dataRows * colCount + Math.max(0, dataRows - 1) + 2 : 2 * dataRows + TABLE_CHROME_ROWS;
499
+ const cost = Math.min(rows, tableClampRows);
500
+ if (rendered + cost > budget && i > 0) {
501
+ kept = i;
502
+ break;
503
+ }
504
+ rendered += cost;
505
+ i = j;
506
+ if (rendered >= budget) {
507
+ kept = j;
508
+ break;
509
+ }
510
+ } else {
511
+ rendered += estimateWrappedRows(line, contentWidth);
512
+ if (rendered > budget) {
513
+ kept = i;
514
+ break;
515
+ }
516
+ i++;
517
+ }
518
+ }
519
+ return { keptLines: kept, clipped: kept < allLines.length };
520
+ }
521
+ __name(fitPendingSlice, "fitPendingSlice");
522
+
373
523
  // packages/cli/src/ui/constants.ts
374
524
  init_esbuild_shims();
375
525
  var EstimatedArtWidth = 59;
@@ -388,6 +538,11 @@ var TOOL_STATUS = {
388
538
  };
389
539
 
390
540
  export {
541
+ TABLE_ROW_RE,
542
+ TABLE_SEPARATOR_RE,
543
+ CODE_FENCE_RE,
544
+ splitMarkdownTableRow,
545
+ fitPendingSlice,
391
546
  SHELL_COMMAND_NAME,
392
547
  SHELL_NAME,
393
548
  TOOL_STATUS,
@@ -5,11 +5,11 @@ import {
5
5
  } from "./chunk-OMX7CUOE.js";
6
6
  import {
7
7
  atomicWriteJSON
8
- } from "./chunk-T42ACHFI.js";
8
+ } from "./chunk-7LTB54MK.js";
9
9
  import {
10
10
  Storage,
11
11
  getProjectHash
12
- } from "./chunk-AVQDCKNF.js";
12
+ } from "./chunk-22MNNNXE.js";
13
13
  import {
14
14
  init_esbuild_shims
15
15
  } from "./chunk-A4BMJM77.js";
@@ -21,6 +21,22 @@ import {
21
21
  init_esbuild_shims();
22
22
  import * as fs from "node:fs/promises";
23
23
  import * as path from "node:path";
24
+ var MAX_TASK_RUNS = 20;
25
+ function appendCronRun(runs, entry) {
26
+ const base = Array.isArray(runs) ? runs : [];
27
+ const next = [...base, entry];
28
+ return next.length > MAX_TASK_RUNS ? next.slice(next.length - MAX_TASK_RUNS) : next;
29
+ }
30
+ __name(appendCronRun, "appendCronRun");
31
+ function generateCronTaskId() {
32
+ const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
33
+ let id = "";
34
+ for (let i = 0; i < 8; i++) {
35
+ id += chars[Math.floor(Math.random() * chars.length)];
36
+ }
37
+ return id;
38
+ }
39
+ __name(generateCronTaskId, "generateCronTaskId");
24
40
  var TASKS_FILENAME = "scheduled_tasks.json";
25
41
  var CRON_TASKS_DISPLAY_PATH = `~/.qwen/tmp/<project-hash>/${TASKS_FILENAME}`;
26
42
  var UPDATE_LOCK_RETRY_MS = 15;
@@ -164,14 +180,33 @@ function isFiniteTimestamp(value) {
164
180
  return typeof value === "number" && Number.isFinite(value);
165
181
  }
166
182
  __name(isFiniteTimestamp, "isFiniteTimestamp");
183
+ function isValidRuns(value) {
184
+ if (!Array.isArray(value)) return false;
185
+ return value.every((entry) => {
186
+ if (typeof entry !== "object" || entry === null) return false;
187
+ const run = entry;
188
+ return isFiniteTimestamp(run["at"]) && (run["kind"] === void 0 || typeof run["kind"] === "string") && (run["sessionId"] === void 0 || typeof run["sessionId"] === "string");
189
+ });
190
+ }
191
+ __name(isValidRuns, "isValidRuns");
167
192
  function isValidTask(value) {
168
193
  if (typeof value !== "object" || value === null) return false;
169
194
  const obj = value;
170
- return typeof obj["id"] === "string" && typeof obj["cron"] === "string" && typeof obj["prompt"] === "string" && typeof obj["recurring"] === "boolean" && isFiniteTimestamp(obj["createdAt"]) && (obj["lastFiredAt"] === null || isFiniteTimestamp(obj["lastFiredAt"]));
195
+ return typeof obj["id"] === "string" && typeof obj["cron"] === "string" && typeof obj["prompt"] === "string" && typeof obj["recurring"] === "boolean" && isFiniteTimestamp(obj["createdAt"]) && (obj["lastFiredAt"] === null || isFiniteTimestamp(obj["lastFiredAt"])) && // Optional fields (added for the management UI): absent is valid and
196
+ // means "unnamed" / "enabled". Present-but-wrong-type routes through
197
+ // the same fix-or-delete contract as any other corrupt field rather
198
+ // than being silently coerced or dropped.
199
+ (obj["name"] === void 0 || typeof obj["name"] === "string") && (obj["enabled"] === void 0 || typeof obj["enabled"] === "boolean") && (obj["disabledByArchive"] === void 0 || typeof obj["disabledByArchive"] === "boolean") && // A bound sessionId must be a NON-EMPTY string: an empty string would pass
200
+ // a bare `typeof` check but the scheduler's truthy `task.sessionId` guard
201
+ // would treat it as unbound, so a "bound" task would silently run unbound.
202
+ (obj["sessionId"] === void 0 || typeof obj["sessionId"] === "string" && obj["sessionId"].length > 0) && (obj["runs"] === void 0 || isValidRuns(obj["runs"]));
171
203
  }
172
204
  __name(isValidTask, "isValidTask");
173
205
 
174
206
  export {
207
+ MAX_TASK_RUNS,
208
+ appendCronRun,
209
+ generateCronTaskId,
175
210
  CRON_TASKS_DISPLAY_PATH,
176
211
  getCronFilePath,
177
212
  readCronTasks,
@@ -11,6 +11,7 @@ import {
11
11
  init_esbuild_shims();
12
12
  var EVENT_SCHEMA_VERSION = 1;
13
13
  var DEFAULT_MAX_QUEUED = 256;
14
+ var DEFAULT_MAX_QUEUED_BYTES = 2 * 1024 * 1024;
14
15
  var DEFAULT_RING_SIZE = 8e3;
15
16
  var WARN_THRESHOLD_RATIO = 0.75;
16
17
  var WARN_RESET_RATIO = 0.375;
@@ -20,6 +21,55 @@ function getServerTimestamp(meta) {
20
21
  return typeof existing === "number" && Number.isFinite(existing) ? existing : Date.now();
21
22
  }
22
23
  __name(getServerTimestamp, "getServerTimestamp");
24
+ function normalizeMaxQueuedBytes(value) {
25
+ if (value === void 0) return DEFAULT_MAX_QUEUED_BYTES;
26
+ if (!Number.isSafeInteger(value) || value < 1) {
27
+ throw new TypeError("maxQueuedBytes must be a positive safe integer");
28
+ }
29
+ return value;
30
+ }
31
+ __name(normalizeMaxQueuedBytes, "normalizeMaxQueuedBytes");
32
+ function serializedByteLength(event) {
33
+ try {
34
+ const serialized = JSON.stringify(event);
35
+ if (serialized === void 0) return 0;
36
+ return Buffer.byteLength(serialized, "utf8");
37
+ } catch {
38
+ logEventSizingFailed(event.type);
39
+ return 0;
40
+ }
41
+ }
42
+ __name(serializedByteLength, "serializedByteLength");
43
+ function logEventSizingFailed(type) {
44
+ try {
45
+ process.stderr.write(
46
+ `qwen serve: EventBus event sizing failed ${JSON.stringify({ type })}
47
+ `
48
+ );
49
+ } catch {
50
+ }
51
+ }
52
+ __name(logEventSizingFailed, "logEventSizingFailed");
53
+ function logSubscriberEvicted(data) {
54
+ try {
55
+ process.stderr.write(
56
+ `qwen serve: EventBus subscriber evicted ${JSON.stringify(data)}
57
+ `
58
+ );
59
+ } catch {
60
+ }
61
+ }
62
+ __name(logSubscriberEvicted, "logSubscriberEvicted");
63
+ function logSlowClientWarning(data) {
64
+ try {
65
+ process.stderr.write(
66
+ `qwen serve: EventBus slow_client_warning ${JSON.stringify(data)}
67
+ `
68
+ );
69
+ } catch {
70
+ }
71
+ }
72
+ __name(logSlowClientWarning, "logSlowClientWarning");
23
73
  var SubscriberLimitExceededError = class extends Error {
24
74
  static {
25
75
  __name(this, "SubscriberLimitExceededError");
@@ -32,10 +82,11 @@ var SubscriberLimitExceededError = class extends Error {
32
82
  }
33
83
  };
34
84
  var EventBus = class {
35
- constructor(ringSize = DEFAULT_RING_SIZE, maxSubscribers = DEFAULT_MAX_SUBSCRIBERS, compactionEngine) {
85
+ constructor(ringSize = DEFAULT_RING_SIZE, maxSubscribers = DEFAULT_MAX_SUBSCRIBERS, compactionEngine, opts = {}) {
36
86
  this.ringSize = ringSize;
37
87
  this.maxSubscribers = maxSubscribers;
38
88
  this.compactionEngine = compactionEngine;
89
+ this.maxQueuedBytes = normalizeMaxQueuedBytes(opts.maxQueuedBytes);
39
90
  }
40
91
  static {
41
92
  __name(this, "EventBus");
@@ -43,6 +94,7 @@ var EventBus = class {
43
94
  nextId = 1;
44
95
  ring = [];
45
96
  subs = /* @__PURE__ */ new Set();
97
+ maxQueuedBytes;
46
98
  closed = false;
47
99
  snapshotReplay() {
48
100
  return this.compactionEngine?.snapshot();
@@ -55,6 +107,30 @@ var EventBus = class {
55
107
  get subscriberCount() {
56
108
  return this.subs.size;
57
109
  }
110
+ seedReplayEvents(inputs) {
111
+ if (this.closed) return [];
112
+ if (inputs.length === 0) return [];
113
+ const events = [];
114
+ for (const input of inputs) {
115
+ const existingMeta = input._meta;
116
+ const event = {
117
+ id: this.nextId++,
118
+ v: EVENT_SCHEMA_VERSION,
119
+ ...input,
120
+ _meta: {
121
+ ...existingMeta ?? {},
122
+ serverTimestamp: getServerTimestamp(existingMeta)
123
+ }
124
+ };
125
+ events.push(event);
126
+ try {
127
+ this.compactionEngine?.ingest(event);
128
+ } catch {
129
+ }
130
+ }
131
+ this.ring.length = 0;
132
+ return events;
133
+ }
58
134
  /**
59
135
  * Publish an event to the bus. Returns the constructed `BridgeEvent`
60
136
  * (with `id` + `v` assigned) on success, or `undefined` when the
@@ -87,38 +163,64 @@ var EventBus = class {
87
163
  } catch {
88
164
  }
89
165
  if (this.ring.length > this.ringSize) this.ring.shift();
166
+ let eventBytes;
167
+ const getEventBytes = /* @__PURE__ */ __name(() => {
168
+ eventBytes ??= serializedByteLength(event);
169
+ return eventBytes;
170
+ }, "getEventBytes");
90
171
  for (const sub of Array.from(this.subs)) {
91
172
  if (sub.evicted) continue;
92
- if (!sub.queue.push(event)) {
173
+ const pushResult = sub.queue.push(event, getEventBytes);
174
+ if (!pushResult.ok) {
93
175
  sub.evicted = true;
176
+ const evictionData = {
177
+ reason: pushResult.reason,
178
+ droppedAfter: event.id,
179
+ queueSize: pushResult.liveSize,
180
+ maxQueued: sub.maxQueued,
181
+ queuedBytes: pushResult.liveBytes,
182
+ maxQueuedBytes: sub.maxQueuedBytes,
183
+ ...pushResult.reason === "queue_bytes_overflow" ? { eventBytes: pushResult.eventBytes } : {}
184
+ };
185
+ logSubscriberEvicted(evictionData);
94
186
  const evictionFrame = {
95
187
  v: EVENT_SCHEMA_VERSION,
96
188
  type: "client_evicted",
97
- data: { reason: "queue_overflow", droppedAfter: event.id }
189
+ data: evictionData
98
190
  };
99
191
  sub.queue.forcePush(evictionFrame);
100
192
  sub.queue.close();
101
193
  sub.dispose();
102
194
  continue;
103
195
  }
104
- const liveSize = sub.queue.size;
105
- if (!sub.warned && liveSize >= sub.warnThreshold) {
196
+ const liveSize = pushResult.liveSize;
197
+ const liveBytes = pushResult.liveBytes;
198
+ if (sub.warned && liveSize <= sub.warnResetThreshold && liveBytes <= sub.warnBytesResetThreshold) {
199
+ sub.warned = false;
200
+ }
201
+ const frameThresholdReached = liveSize >= sub.warnThreshold;
202
+ const byteThresholdReached = liveBytes >= sub.warnBytesThreshold;
203
+ if (!sub.warned && (frameThresholdReached || byteThresholdReached)) {
106
204
  sub.warned = true;
205
+ const threshold = frameThresholdReached && byteThresholdReached ? "frames_and_bytes" : byteThresholdReached ? "bytes" : "frames";
206
+ const warningData = {
207
+ queueSize: liveSize,
208
+ maxQueued: sub.maxQueued,
209
+ // `event.id` is always defined here — the just-published
210
+ // `event` is constructed at the top of `publish()` with
211
+ // `id: this.nextId++`. No `??` fallback needed.
212
+ lastEventId: event.id,
213
+ queuedBytes: liveBytes,
214
+ maxQueuedBytes: sub.maxQueuedBytes,
215
+ threshold
216
+ };
217
+ logSlowClientWarning(warningData);
107
218
  const warningFrame = {
108
219
  v: EVENT_SCHEMA_VERSION,
109
220
  type: "slow_client_warning",
110
- data: {
111
- queueSize: liveSize,
112
- maxQueued: sub.maxQueued,
113
- // `event.id` is always defined here — the just-published
114
- // `event` is constructed at the top of `publish()` with
115
- // `id: this.nextId++`. No `??` fallback needed.
116
- lastEventId: event.id
117
- }
221
+ data: warningData
118
222
  };
119
223
  sub.queue.forcePush(warningFrame);
120
- } else if (sub.warned && liveSize <= sub.warnResetThreshold) {
121
- sub.warned = false;
122
224
  }
123
225
  }
124
226
  return event;
@@ -145,13 +247,19 @@ var EventBus = class {
145
247
  throw new SubscriberLimitExceededError(this.maxSubscribers);
146
248
  }
147
249
  const maxQueued = opts.maxQueued ?? DEFAULT_MAX_QUEUED;
148
- const queue = new BoundedAsyncQueue(maxQueued);
250
+ const queue = new BoundedAsyncQueue(
251
+ maxQueued,
252
+ this.maxQueuedBytes
253
+ );
149
254
  const sub = {
150
255
  queue,
151
256
  evicted: false,
152
257
  maxQueued,
153
258
  warnThreshold: WARN_THRESHOLD_RATIO * maxQueued,
154
259
  warnResetThreshold: WARN_RESET_RATIO * maxQueued,
260
+ maxQueuedBytes: this.maxQueuedBytes,
261
+ warnBytesThreshold: WARN_THRESHOLD_RATIO * this.maxQueuedBytes,
262
+ warnBytesResetThreshold: WARN_RESET_RATIO * this.maxQueuedBytes,
155
263
  warned: false,
156
264
  dispose: /* @__PURE__ */ __name(() => {
157
265
  }, "dispose")
@@ -174,7 +282,17 @@ var EventBus = class {
174
282
  });
175
283
  } else {
176
284
  const earliestInRing = this.ring[0]?.id;
177
- if (earliestInRing !== void 0 && earliestInRing > opts.lastEventId + 1) {
285
+ if (earliestInRing === void 0 && opts.lastEventId < this.nextId - 1) {
286
+ queue.forcePush({
287
+ v: EVENT_SCHEMA_VERSION,
288
+ type: "state_resync_required",
289
+ data: {
290
+ reason: "seeded_replay_not_in_ring",
291
+ lastDeliveredId: opts.lastEventId,
292
+ earliestAvailableId: this.nextId
293
+ }
294
+ });
295
+ } else if (earliestInRing !== void 0 && earliestInRing > opts.lastEventId + 1) {
178
296
  queue.forcePush({
179
297
  v: EVENT_SCHEMA_VERSION,
180
298
  type: "state_resync_required",
@@ -268,8 +386,9 @@ function emptyAsyncIterable() {
268
386
  }
269
387
  __name(emptyAsyncIterable, "emptyAsyncIterable");
270
388
  var BoundedAsyncQueue = class {
271
- constructor(maxSize) {
389
+ constructor(maxSize, maxBytes) {
272
390
  this.maxSize = maxSize;
391
+ this.maxBytes = maxBytes;
273
392
  }
274
393
  static {
275
394
  __name(this, "BoundedAsyncQueue");
@@ -286,6 +405,7 @@ var BoundedAsyncQueue = class {
286
405
  * no matter where in the queue the forced entries are.
287
406
  */
288
407
  liveCount = 0;
408
+ liveBytes = 0;
289
409
  /**
290
410
  * Number of LIVE (non-force-pushed) items currently waiting in the
291
411
  * buffer. Backpressure decisions in `EventBus.publish()` (the
@@ -294,18 +414,53 @@ var BoundedAsyncQueue = class {
294
414
  get size() {
295
415
  return this.liveCount;
296
416
  }
297
- /** Returns true if accepted, false if dropped due to overflow. */
298
- push(value) {
299
- if (this.closed) return false;
417
+ get bytes() {
418
+ return this.liveBytes;
419
+ }
420
+ push(value, getBytes) {
421
+ if (this.closed) {
422
+ return {
423
+ ok: false,
424
+ reason: "queue_overflow",
425
+ liveSize: this.liveCount,
426
+ liveBytes: this.liveBytes
427
+ };
428
+ }
300
429
  const r = this.resolvers.shift();
301
430
  if (r) {
302
431
  r({ value, done: false });
303
- return true;
432
+ return {
433
+ ok: true,
434
+ liveSize: this.liveCount,
435
+ liveBytes: this.liveBytes
436
+ };
437
+ }
438
+ if (this.liveCount >= this.maxSize) {
439
+ return {
440
+ ok: false,
441
+ reason: "queue_overflow",
442
+ liveSize: this.liveCount,
443
+ liveBytes: this.liveBytes
444
+ };
304
445
  }
305
- if (this.liveCount >= this.maxSize) return false;
306
- this.buf.push({ value, forced: false });
446
+ const bytes = getBytes();
447
+ if (this.liveCount > 0 && this.liveBytes + bytes > this.maxBytes) {
448
+ return {
449
+ ok: false,
450
+ reason: "queue_bytes_overflow",
451
+ liveSize: this.liveCount,
452
+ liveBytes: this.liveBytes,
453
+ eventBytes: bytes
454
+ };
455
+ }
456
+ this.buf.push({ value, forced: false, bytes });
307
457
  this.liveCount += 1;
308
- return true;
458
+ this.liveBytes += bytes;
459
+ return {
460
+ ok: true,
461
+ liveSize: this.liveCount,
462
+ liveBytes: this.liveBytes
463
+ };
309
464
  }
310
465
  /** Bypasses the size cap. Used for replay frames, eviction terminal,
311
466
  * and slow-client warnings. */
@@ -316,7 +471,7 @@ var BoundedAsyncQueue = class {
316
471
  r({ value, done: false });
317
472
  return;
318
473
  }
319
- this.buf.push({ value, forced: true });
474
+ this.buf.push({ value, forced: true, bytes: 0 });
320
475
  }
321
476
  /**
322
477
  * Mark the queue closed. By default `next()` continues to drain
@@ -338,6 +493,7 @@ var BoundedAsyncQueue = class {
338
493
  if (opts.drain === false) {
339
494
  this.buf.length = 0;
340
495
  this.liveCount = 0;
496
+ this.liveBytes = 0;
341
497
  }
342
498
  while (this.resolvers.length > 0) {
343
499
  this.resolvers.shift()({
@@ -349,7 +505,10 @@ var BoundedAsyncQueue = class {
349
505
  next() {
350
506
  if (this.buf.length > 0) {
351
507
  const entry = this.buf.shift();
352
- if (!entry.forced) this.liveCount -= 1;
508
+ if (!entry.forced) {
509
+ this.liveCount -= 1;
510
+ this.liveBytes -= entry.bytes;
511
+ }
353
512
  return Promise.resolve({ value: entry.value, done: false });
354
513
  }
355
514
  if (this.closed) {
@@ -0,0 +1,28 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ getPackageJson
5
+ } from "./chunk-43W4YSO6.js";
6
+ import {
7
+ init_esbuild_shims
8
+ } from "./chunk-A4BMJM77.js";
9
+ import {
10
+ __name
11
+ } from "./chunk-J2S4EL5Y.js";
12
+
13
+ // packages/cli/src/utils/version.ts
14
+ init_esbuild_shims();
15
+ async function getCliVersion() {
16
+ const pkgJson = await getPackageJson();
17
+ return "0.19.7";
18
+ }
19
+ __name(getCliVersion, "getCliVersion");
20
+
21
+ export {
22
+ getCliVersion
23
+ };
24
+ /**
25
+ * @license
26
+ * Copyright 2025 Google LLC
27
+ * SPDX-License-Identifier: Apache-2.0
28
+ */