@qwen-code/qwen-code 0.22.3-nightly.20260831.3a0c4c6108 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +30 -0
  2. package/bundled/computer-use/SKILL.md +116 -180
  3. package/bundled/goal-draft/SKILL.md +5 -1
  4. package/bundled/qc-helper/docs/configuration/model-providers.md +4 -0
  5. package/bundled/qc-helper/docs/configuration/settings.md +53 -50
  6. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  7. package/bundled/qc-helper/docs/features/channels/dingtalk.md +4 -2
  8. package/bundled/qc-helper/docs/features/channels/dws.md +6 -2
  9. package/bundled/qc-helper/docs/features/channels/overview.md +1 -0
  10. package/bundled/qc-helper/docs/features/commands.md +38 -1
  11. package/bundled/qc-helper/docs/features/computer-use.md +2 -2
  12. package/bundled/qc-helper/docs/features/goals.md +9 -3
  13. package/bundled/qc-helper/docs/features/headless.md +16 -1
  14. package/bundled/qc-helper/docs/features/hooks.md +2 -1
  15. package/bundled/qc-helper/docs/features/output-styles.md +38 -0
  16. package/bundled/qc-helper/docs/qwen-serve.md +15 -0
  17. package/bundled/review/SKILL.md +5 -5
  18. package/bundled/review/references/posting.md +2 -2
  19. package/chunks/{MaxSizedBox-IHRTWGSY.js → MaxSizedBox-B3D7545A.js} +41 -45
  20. package/chunks/{StandaloneSessionPicker-TLVWVTJ7.js → StandaloneSessionPicker-QUMO4LLQ.js} +64 -67
  21. package/chunks/{acpAgent-7I5LLPP3.js → acpAgent-2GTFCIEP.js} +771 -248
  22. package/chunks/{agent-4Z4NTJXD.js → agent-XKF5SZWU.js} +26 -30
  23. package/chunks/{agent-headless-TVUJXQWU.js → agent-headless-OC2IB55D.js} +26 -30
  24. package/chunks/{anthropicContentGenerator-VSSPG7XV.js → anthropicContentGenerator-L76MR5OR.js} +14 -14
  25. package/chunks/{artifact-tool-TEYW6I4A.js → artifact-tool-MYCL2QCS.js} +2 -3
  26. package/chunks/{askUserQuestion-PYNBWV63.js → askUserQuestion-THQZMG44.js} +2 -2
  27. package/chunks/{bridge-EVURP4NO.js → bridge-IHSBI2YJ.js} +42 -46
  28. package/chunks/{build-INBK7IXX.js → build-63BIOYWK.js} +1 -1
  29. package/chunks/{channel-management-service-IDBNYSFW.js → channel-management-service-4MTCEGJB.js} +4 -4
  30. package/chunks/{channel-settings-store-MZNXRKVI.js → channel-settings-store-BVKWAI2T.js} +50 -54
  31. package/chunks/{channel-worker-group-ZLP5SJHT.js → channel-worker-group-47F4ISUZ.js} +6 -6
  32. package/chunks/{channel-worker-manager-FG5377T2.js → channel-worker-manager-I5Y44GYR.js} +50 -9
  33. package/chunks/{channel-worker-supervisor-HDVE4ADS.js → channel-worker-supervisor-6VCLUXFE.js} +4 -4
  34. package/chunks/{chunk-3452WXOK.js → chunk-2M3EWQNG.js} +17 -0
  35. package/chunks/{chunk-HDMKCJHI.js → chunk-32LU3APX.js} +1 -1
  36. package/chunks/{chunk-BSJOBW4U.js → chunk-37JFWFCD.js} +1 -1
  37. package/chunks/{chunk-AN3KFCNH.js → chunk-3JQZVCBI.js} +2 -2
  38. package/chunks/{chunk-RGEV5AUD.js → chunk-3L724BJ5.js} +11 -8
  39. package/chunks/{chunk-GCUR24KK.js → chunk-47RYEQW5.js} +2 -2
  40. package/chunks/{chunk-CM4F4JBB.js → chunk-4BGDFKQE.js} +5 -5
  41. package/chunks/{chunk-ZBDYI7VM.js → chunk-4F7GQGXB.js} +10961 -4033
  42. package/chunks/{chunk-JMRE4WJQ.js → chunk-4HVH57J3.js} +81 -17
  43. package/chunks/{chunk-26SIKQIC.js → chunk-4LIFGNI4.js} +1 -1
  44. package/chunks/{chunk-U5RTYI7D.js → chunk-4M24B5J5.js} +13 -13
  45. package/chunks/{chunk-7XICSE62.js → chunk-4PSDSCW3.js} +3 -3
  46. package/chunks/{chunk-AYYKUUKP.js → chunk-4UANMABT.js} +73 -19
  47. package/chunks/{chunk-GS7XT345.js → chunk-54C6PIGT.js} +3 -3
  48. package/chunks/{chunk-UKB2TZAO.js → chunk-5EIOJGCR.js} +4 -4
  49. package/chunks/{chunk-64REQJJ2.js → chunk-5H5S4UY5.js} +3 -3
  50. package/chunks/chunk-5IENVM7Z.js +35 -0
  51. package/chunks/{chunk-JOWQD4LO.js → chunk-5Q5RC2WE.js} +1 -1
  52. package/chunks/{chunk-3NQCZMUB.js → chunk-5RTTI4GE.js} +73 -73
  53. package/chunks/{chunk-J4Y3QJHF.js → chunk-64QH2UC6.js} +11 -1
  54. package/chunks/{chunk-I75VKFCJ.js → chunk-65HWLGA7.js} +1 -1
  55. package/chunks/{chunk-W7KWB6AH.js → chunk-6A2D4QSO.js} +8 -5
  56. package/chunks/{chunk-OTTNXUT5.js → chunk-7IKXTGZT.js} +1 -1
  57. package/chunks/{chunk-LYSZVCCD.js → chunk-7JMGTOH7.js} +427 -129
  58. package/chunks/{chunk-YOFULAHO.js → chunk-7RB56BRJ.js} +3 -3
  59. package/chunks/{chunk-6VHIWUJP.js → chunk-ADYN7P2Y.js} +2 -2
  60. package/chunks/{chunk-7DDTI7Q3.js → chunk-AHYTURFB.js} +1 -1
  61. package/chunks/{chunk-TNMOFNT4.js → chunk-ALUYNJPM.js} +1395 -2079
  62. package/chunks/{chunk-H2A2GJGL.js → chunk-AZJLY2XZ.js} +5 -5
  63. package/chunks/{chunk-BE5FGT5Z.js → chunk-BA4WJC4L.js} +1 -1
  64. package/chunks/{chunk-H5GPPDGY.js → chunk-BFY33IB4.js} +16 -8
  65. package/chunks/{chunk-RY7DL5IF.js → chunk-BJXCYUGM.js} +1 -1
  66. package/chunks/{chunk-ND7TQQPE.js → chunk-C2VWOXHS.js} +6 -6
  67. package/chunks/{chunk-T4RMUTTT.js → chunk-C4TIXFDZ.js} +2 -2
  68. package/chunks/{chunk-B2RIIK3K.js → chunk-CVX63TFJ.js} +3 -1
  69. package/chunks/{chunk-SMJYTKTB.js → chunk-DQCKVAF5.js} +1 -1
  70. package/chunks/{chunk-RLSPPTWH.js → chunk-DSX7KQPM.js} +438 -181
  71. package/chunks/{chunk-PNIGAVY6.js → chunk-DTVQSSNM.js} +2 -2
  72. package/chunks/{chunk-67AY5D3M.js → chunk-DYTW3QVG.js} +23 -8
  73. package/chunks/{chunk-3CZGSTZX.js → chunk-EBDGRBZX.js} +22 -14
  74. package/chunks/{chunk-DJBQCO2E.js → chunk-EFTPIZIC.js} +412 -3
  75. package/chunks/{chunk-QE7DTCLX.js → chunk-EIY7SUPZ.js} +1 -1
  76. package/chunks/{chunk-6OO7QEWV.js → chunk-EVFDRBUM.js} +97 -77
  77. package/chunks/{chunk-QTMPM6RC.js → chunk-EWRW2WQC.js} +3 -3
  78. package/chunks/{chunk-IIFL7QDN.js → chunk-F33GFWPR.js} +34 -11
  79. package/chunks/{chunk-YPISTYEI.js → chunk-F47DITLZ.js} +11 -1
  80. package/chunks/{chunk-OE5AQVNB.js → chunk-F7NF2IOE.js} +6 -6
  81. package/chunks/{chunk-RT4QNQ5P.js → chunk-FD5SJOWT.js} +8 -5
  82. package/chunks/{chunk-ACZ4YRYK.js → chunk-FRICLXCZ.js} +3 -3
  83. package/chunks/{chunk-IBMUI5EV.js → chunk-FUO5V5KI.js} +11 -4
  84. package/chunks/{chunk-T3TL6S3B.js → chunk-G5PBOQWI.js} +8 -5
  85. package/chunks/{chunk-D7D3HSYQ.js → chunk-G7HBEEX7.js} +12 -7
  86. package/chunks/{chunk-FXUSWLBF.js → chunk-GH2S4GD5.js} +133 -8
  87. package/chunks/{chunk-XPDKSOVW.js → chunk-GXUTFQXK.js} +42 -44
  88. package/chunks/{chunk-OSTQZIOY.js → chunk-H43PSPYS.js} +2 -2
  89. package/chunks/{chunk-UVYKCRJZ.js → chunk-HJBHMANB.js} +11 -13
  90. package/chunks/{chunk-WLEYH7CD.js → chunk-HRPFBHW7.js} +4 -0
  91. package/chunks/{chunk-DBTMP3P4.js → chunk-I2TMJPCV.js} +1 -1
  92. package/chunks/{chunk-EU2B4P3D.js → chunk-I4NRYS6A.js} +4 -4
  93. package/chunks/{chunk-JPKTAQS3.js → chunk-I5N4EAS6.js} +1 -1
  94. package/chunks/{chunk-W4BDHLRT.js → chunk-IG4W5SJR.js} +2 -2
  95. package/chunks/{chunk-BXNKREX7.js → chunk-IPATA3T2.js} +2 -2
  96. package/chunks/{chunk-NKLP3DCK.js → chunk-IQAFKVXS.js} +1 -1
  97. package/chunks/{chunk-AYHQZBJ4.js → chunk-IRKQ4YYX.js} +3 -3
  98. package/chunks/{chunk-J3NNHTV6.js → chunk-J5TTWBZK.js} +6 -0
  99. package/chunks/{chunk-AVNATYLY.js → chunk-JJKNYRFY.js} +1 -1
  100. package/chunks/{chunk-ERHAMGAA.js → chunk-JR42V4UY.js} +1 -1
  101. package/chunks/{chunk-NT7LXVV5.js → chunk-JUARRUMA.js} +362 -1084
  102. package/chunks/{chunk-OKMDOATP.js → chunk-KEVYJSI4.js} +11 -11
  103. package/chunks/{chunk-AF3QB6OL.js → chunk-KGV55H53.js} +1 -1
  104. package/chunks/{chunk-SDCHI64N.js → chunk-KM3XVTMO.js} +10 -4
  105. package/chunks/{chunk-ERRJA23L.js → chunk-KMU3ZHH4.js} +1 -1
  106. package/chunks/chunk-KOGW3YWJ.js +2054 -0
  107. package/chunks/{chunk-6NWPR2EB.js → chunk-L26ONV2Y.js} +5 -5
  108. package/chunks/chunk-L34XSHIZ.js +28 -0
  109. package/chunks/{chunk-UXEW7TQS.js → chunk-LB3WQQJK.js} +1 -1
  110. package/chunks/{chunk-YNG7XAJU.js → chunk-LEPCWS5A.js} +1 -1
  111. package/chunks/{chunk-XLENZQXH.js → chunk-LHBNR6EU.js} +2 -2
  112. package/chunks/{chunk-AKNQMSL2.js → chunk-LOBDDFYK.js} +4 -28
  113. package/chunks/{chunk-L6CUJZDG.js → chunk-LU77UT4D.js} +2 -2
  114. package/chunks/{chunk-3EGEBDTW.js → chunk-M4KFODIP.js} +1 -1
  115. package/chunks/{chunk-JLSZT354.js → chunk-M4LBBSVP.js} +2 -0
  116. package/chunks/{chunk-YOMKOM7E.js → chunk-MP6YZ4RK.js} +6580 -5992
  117. package/chunks/chunk-N2TNM3QB.js +9 -0
  118. package/chunks/{chunk-GDXSXL3H.js → chunk-NFIDVZND.js} +1 -1
  119. package/chunks/{chunk-NT5XIL5H.js → chunk-NQ4L2CMD.js} +51 -6
  120. package/chunks/{chunk-OQYXJK2V.js → chunk-NRL5CUZT.js} +1 -1
  121. package/chunks/{chunk-FIWZOMBF.js → chunk-NSUKQ4DN.js} +6 -0
  122. package/chunks/chunk-NUHOLAQ6.js +59 -0
  123. package/chunks/{chunk-BBYTY46C.js → chunk-NVVJTUSL.js} +266 -105
  124. package/chunks/{chunk-CAZADEU7.js → chunk-NXKOVOM5.js} +9 -9
  125. package/chunks/{chunk-5Q372OFJ.js → chunk-O4KNCAX4.js} +57 -10
  126. package/chunks/{chunk-GOXKNSDZ.js → chunk-O5CD7T4T.js} +40 -9
  127. package/chunks/{chunk-XIQ5HQ2F.js → chunk-OBTWL6ZW.js} +1 -1
  128. package/chunks/{chunk-5MK45KZ3.js → chunk-OHOO527W.js} +1 -1
  129. package/chunks/{chunk-CETB5XY4.js → chunk-ORFIYTI2.js} +1 -1
  130. package/chunks/{chunk-7E7UCJHS.js → chunk-OSHQMOBS.js} +18 -17
  131. package/chunks/{chunk-YDQ4OCDK.js → chunk-OSSTATJF.js} +89 -1
  132. package/chunks/chunk-P6UIF2OW.js +400 -0
  133. package/chunks/{chunk-V4HN35IF.js → chunk-PCRBLMIN.js} +16 -2
  134. package/chunks/{chunk-L2OKAIUK.js → chunk-QI27MKNQ.js} +23 -15
  135. package/chunks/{chunk-FHPYRXRH.js → chunk-QJGYU5PG.js} +1 -1
  136. package/chunks/{chunk-IVUWTA2D.js → chunk-QJVZLILI.js} +1 -1
  137. package/chunks/{chunk-TBJ3SNS3.js → chunk-QKDNS6FU.js} +1 -1
  138. package/chunks/{chunk-YKADANK6.js → chunk-QQD2GART.js} +10 -3
  139. package/chunks/{chunk-ED7DD7MV.js → chunk-RAFQIHN2.js} +1 -1
  140. package/chunks/{chunk-TV7BJ7TX.js → chunk-RJUVTJEZ.js} +1 -1
  141. package/chunks/{chunk-RVCGAHC7.js → chunk-RM4WT2XB.js} +4 -4
  142. package/chunks/{chunk-6YXNJXQW.js → chunk-RN3YGDCA.js} +3 -3
  143. package/chunks/{chunk-SMRDCANI.js → chunk-S6H3ELPG.js} +1 -1
  144. package/chunks/{chunk-MBZ5ORJB.js → chunk-SI7WDR3U.js} +281 -2
  145. package/chunks/{chunk-5FGWVPCM.js → chunk-SRF4KTAG.js} +4 -4
  146. package/chunks/{chunk-LFAR7CPW.js → chunk-STCVJXQB.js} +23 -23
  147. package/chunks/{chunk-JDIO45X7.js → chunk-SULZPKTA.js} +1 -1
  148. package/chunks/{chunk-KUDI54QQ.js → chunk-SX2QIMJV.js} +5 -5
  149. package/chunks/{chunk-VYSZUQGU.js → chunk-TJYRTS4S.js} +2 -2
  150. package/chunks/{chunk-JOTYTYYW.js → chunk-TMKTOTMQ.js} +3 -3
  151. package/chunks/{chunk-FPMQT2YY.js → chunk-TQHPVKO6.js} +4 -4
  152. package/chunks/{chunk-GN422P4J.js → chunk-TSZSGQ3N.js} +1 -1
  153. package/chunks/{chunk-IXEZHTDR.js → chunk-U4DJ5XB3.js} +292 -38
  154. package/chunks/{chunk-MZ5A5PQW.js → chunk-UAKRDON5.js} +4 -4
  155. package/chunks/{chunk-NGKLMNWN.js → chunk-UM2FFKXN.js} +2 -2
  156. package/chunks/{chunk-5ICKESC3.js → chunk-UPFRILIL.js} +2 -2
  157. package/chunks/{chunk-RAEEQEC5.js → chunk-UUASLXHW.js} +54 -5
  158. package/chunks/chunk-V5U2NZNJ.js +29 -0
  159. package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
  160. package/chunks/{chunk-ZYPJ7HVZ.js → chunk-VBWD6C27.js} +1 -1
  161. package/chunks/{chunk-MJBHSZEJ.js → chunk-VNAYZAFX.js} +3 -3
  162. package/chunks/chunk-VPSIC437.js +780 -0
  163. package/chunks/{chunk-AAX236AR.js → chunk-VWTSRH6C.js} +52 -11
  164. package/chunks/{chunk-PDXYZBBQ.js → chunk-VYIUNFEA.js} +2 -2
  165. package/chunks/{chunk-BY24DZ4J.js → chunk-WP4AX3XD.js} +5 -7
  166. package/chunks/{chunk-X7C7KFWA.js → chunk-XLXAZLDR.js} +1 -1
  167. package/chunks/{chunk-ZQ3FKEWA.js → chunk-YPWZTR7F.js} +3 -3
  168. package/chunks/{chunk-IXHV5MIC.js → chunk-ZDFQGHZH.js} +1 -1
  169. package/chunks/chunk-ZJ2LM2SI.js +198 -0
  170. package/chunks/{chunk-PWR2NQBS.js → chunk-ZKFTS3OV.js} +3 -3
  171. package/chunks/{chunk-HMJ2P3SV.js → chunk-ZL4HFSL6.js} +91 -29
  172. package/chunks/{chunk-ID33ZRWH.js → chunk-ZTPGUFQV.js} +28 -6
  173. package/chunks/chunk-bdqvmfwv-ZTSOWAFE.js +17446 -0
  174. package/chunks/{config-utils-NNUPVGEC.js → config-utils-LVSYDLHZ.js} +42 -46
  175. package/chunks/{contextCommand-S3TPCDM5.js → contextCommand-TZD7UAJK.js} +40 -44
  176. package/chunks/{core-runtime-NASPCSQX.js → core-runtime-B4UKKIAQ.js} +42 -46
  177. package/chunks/{create-sub-session-36TNCHCP.js → create-sub-session-LUPWEUHR.js} +2 -2
  178. package/chunks/{create-sub-session-DS4BJLYZ.js → create-sub-session-NJ24B4US.js} +41 -44
  179. package/chunks/{cron-create-QXHTYUTO.js → cron-create-CRSPET3H.js} +1 -1
  180. package/chunks/{cron-delete-WV2BM42M.js → cron-delete-DB77SZTU.js} +1 -1
  181. package/chunks/{cron-list-7KVNBLZ7.js → cron-list-U2JNYWV6.js} +1 -1
  182. package/chunks/{daemon-UCVUHPJD.js → daemon-RKDGBFLK.js} +385 -19
  183. package/chunks/{daemon-git-worktree-guard-ATXVQPS3.js → daemon-git-worktree-guard-O2HPOBAB.js} +40 -44
  184. package/chunks/{daemon-status-provider-UI3GBTMO.js → daemon-status-provider-GRRVCJFW.js} +47 -51
  185. package/chunks/{daemon-trust-policy-SUCBJ2CA.js → daemon-trust-policy-YJL442BK.js} +46 -50
  186. package/chunks/{daemon-trust-policy-monitor-3LM5RQNS.js → daemon-trust-policy-monitor-JL7F4Y4Q.js} +46 -50
  187. package/chunks/{deferred-core-runtime-SCOJLVYG.js → deferred-core-runtime-S32AYVZI.js} +39 -43
  188. package/chunks/{devtools-JCG4K2NZ.js → devtools-VDRJYPZF.js} +1 -1
  189. package/chunks/{discovery-X2NV535U.js → discovery-TUM3ZQ6U.js} +2 -2
  190. package/chunks/{display-image-Z4VBQDEJ.js → display-image-73C7XNRK.js} +3 -3
  191. package/chunks/{dist-7WDZYMWV.js → dist-62OZ7QXB.js} +2 -2
  192. package/chunks/{dist-FLJLHASF.js → dist-EDHQIBYD.js} +7 -7
  193. package/chunks/{dist-S3BKCTWF.js → dist-GT64AAUR.js} +1 -1
  194. package/chunks/{dist-GPSRNVVP.js → dist-JVXT4VUJ.js} +2 -2
  195. package/chunks/{dist-LY66XNUL.js → dist-L6URO6CK.js} +3 -3
  196. package/chunks/{dist-5423MG3D.js → dist-LXFYIJNG.js} +734 -128
  197. package/chunks/{dist-SDKHGH5O.js → dist-PDGNRVPY.js} +4 -4
  198. package/chunks/{dist-WAUO5OMN.js → dist-QAF5DO3Y.js} +363 -73
  199. package/chunks/{dist-WIVVPE7M.js → dist-ZCJLKQSP.js} +1 -1
  200. package/chunks/{earlyInputCapture-INWJ2STR.js → earlyInputCapture-BBPCIVZG.js} +38 -42
  201. package/chunks/{edit-B7ZRRGAE.js → edit-SUGXY63Y.js} +26 -30
  202. package/chunks/{en-E4AYTX6H.js → en-2RATMNX7.js} +2 -0
  203. package/chunks/{enter-worktree-SPZHEETQ.js → enter-worktree-B6USKSIK.js} +5 -5
  204. package/chunks/{enterPlanMode-S554IKJ2.js → enterPlanMode-MDX4RVVL.js} +26 -30
  205. package/chunks/{environment-25ADH4Y6.js → environment-VN6RXDVN.js} +41 -45
  206. package/chunks/{errors-G2I6LFTW.js → errors-UEY36PIT.js} +40 -44
  207. package/chunks/{exit-worktree-AWUXAMAM.js → exit-worktree-DLQ73SJH.js} +8 -6
  208. package/chunks/{exitPlanMode-ZFH4OYPM.js → exitPlanMode-EPHIEDAA.js} +26 -30
  209. package/chunks/{fast-path-WZHVZ2ER.js → fast-path-Y73R42LV.js} +3 -3
  210. package/chunks/{fast-path-settings-NILM6QZL.js → fast-path-settings-MFUR3IWK.js} +3 -3
  211. package/chunks/{glob-UOVDMBUP.js → glob-DMGH7EZN.js} +27 -31
  212. package/chunks/goal-tools-3RF3PXCL.js +99 -0
  213. package/chunks/{grep-LHYJ5V2N.js → grep-AJVLCVXC.js} +2 -2
  214. package/chunks/{handleAutoUpdate-4MZ45DZY.js → handleAutoUpdate-HVWQT2AU.js} +42 -46
  215. package/chunks/{i18n-KWUEI4DS.js → i18n-5OR7NTRZ.js} +39 -43
  216. package/chunks/{image-gen-YZDVO5YS.js → image-gen-VOIDOHOB.js} +1 -1
  217. package/chunks/{initializer-2NBROGMG.js → initializer-JE5RQSOE.js} +46 -50
  218. package/chunks/{installationInfo-YKUSY3ZB.js → installationInfo-KO3CCSCK.js} +38 -42
  219. package/chunks/{list-W2WV3COM.js → list-3IORSFIY.js} +49 -53
  220. package/chunks/{list-agents-PMVMHNY7.js → list-agents-SBMONIUK.js} +3 -3
  221. package/chunks/{llm-NPPHLIJI.js → llm-K26SUDVK.js} +155 -99
  222. package/chunks/{llm-content-generator-YK3WN6XW.js → llm-content-generator-TT6EAUD4.js} +5 -6
  223. package/chunks/{loadedSettingsAdapter-2P7DFWUR.js → loadedSettingsAdapter-KLLFZF3M.js} +46 -50
  224. package/chunks/{loggingContentGenerator-QYYYGU6V.js → loggingContentGenerator-EYQBA4M4.js} +43 -47
  225. package/chunks/{loop-wakeup-EBM4F5MZ.js → loop-wakeup-QA6SHCZT.js} +2 -2
  226. package/chunks/{ls-F6TRX3DD.js → ls-HEJNCEYO.js} +1 -1
  227. package/chunks/{lsp-QYTOS2FI.js → lsp-WOQKNZP6.js} +1 -1
  228. package/chunks/{managed-npm-update-UMC4NBWW.js → managed-npm-update-HIJTODQT.js} +38 -42
  229. package/chunks/{mcp-OFI6XDP2.js → mcp-A2UEHETW.js} +46 -50
  230. package/chunks/{monitor-QX3BM3JY.js → monitor-DKNZQAB2.js} +28 -32
  231. package/chunks/{node-QKLNSZMX.js → node-UETAYMMO.js} +3 -3
  232. package/chunks/{nonInteractiveCli-NVRMD5MN.js → nonInteractiveCli-YA47F2F4.js} +86 -89
  233. package/chunks/{notebook-edit-AAILDPSV.js → notebook-edit-MGHTRL2D.js} +26 -30
  234. package/chunks/{openaiContentGenerator-53PB3CMN.js → openaiContentGenerator-ZJIEQ3ZJ.js} +15 -17
  235. package/chunks/{pidfile-5ACKG2LI.js → pidfile-ETHAZNMY.js} +38 -42
  236. package/chunks/{processUtils-2BCDO3DZ.js → processUtils-UY3SAJJZ.js} +2 -2
  237. package/chunks/{prompt-terminal-ledger-3RKW73A2.js → prompt-terminal-ledger-GZ747VYE.js} +39 -43
  238. package/chunks/{qwenContentGenerator-N4LLWDPH.js → qwenContentGenerator-VI4KATRY.js} +39 -43
  239. package/chunks/{read-file-DPAKXHYE.js → read-file-P7F4P7LV.js} +6 -8
  240. package/chunks/{read-mcp-resource-R4NO75DW.js → read-mcp-resource-GLAGB6R7.js} +1 -1
  241. package/chunks/{record-artifact-2EAYLAL5.js → record-artifact-SWVR7NSU.js} +3 -3
  242. package/chunks/renderer-selection-M4UN63VJ.js +99 -0
  243. package/chunks/{report-findings-Y4MSHDS3.js → report-findings-AL5YW3KI.js} +4 -4
  244. package/chunks/{request-shutdown-DWRMGTMB.js → request-shutdown-5YK4IZ54.js} +5 -5
  245. package/chunks/{resumeHistoryUtils-3JQORXAK.js → resumeHistoryUtils-DPZKFW24.js} +44 -48
  246. package/chunks/{ripGrep-AHF5QCI7.js → ripGrep-C7LJKUPZ.js} +9 -11
  247. package/chunks/{run-qwen-serve-3LKV7KDC.js → run-qwen-serve-OGTEEUR2.js} +132 -81
  248. package/chunks/{runtime-66F4W3IA.js → runtime-LNBLEMZS.js} +51 -55
  249. package/chunks/{scheduled-tasks-2NVKS5Q2.js → scheduled-tasks-FLDYZQOF.js} +44 -48
  250. package/chunks/{scheduler-JNV7T3ZO.js → scheduler-73YXGUGW.js} +40 -44
  251. package/chunks/{sdk-exporters-grpc-G5IT4XS4.js → sdk-exporters-grpc-MXTVSE3C.js} +2 -2
  252. package/chunks/{sdk-exporters-http-MFIWD23D.js → sdk-exporters-http-3JO5TJNU.js} +3 -3
  253. package/chunks/{sdk-impl-2RXJ4Q6X.js → sdk-impl-HZAUUTHJ.js} +5 -5
  254. package/chunks/{send-message-WPZRCJOB.js → send-message-JC7NJTY6.js} +7 -7
  255. package/chunks/{serve-GP2UNRP7.js → serve-3UR2H4CV.js} +46 -50
  256. package/chunks/{server-7W6C3SOW.js → server-AOYZVVOM.js} +1736 -502
  257. package/chunks/{session-PZLBAQGG.js → session-UAWFNFGI.js} +90 -93
  258. package/chunks/session-attachments-root-ZCGXQQTR.js +104 -0
  259. package/chunks/{session-pr-refresh-OIVL3U3Z.js → session-pr-refresh-CT2INROL.js} +131 -65
  260. package/chunks/{settings-ZOHIQWYK.js → settings-BHRGDASJ.js} +45 -49
  261. package/chunks/{shell-FWZT6IUR.js → shell-YHOGC7TO.js} +26 -30
  262. package/chunks/{skill-RTQC2YGA.js → skill-ZGBKNCHQ.js} +71 -49
  263. package/chunks/{skill-settings-AKMIXFSJ.js → skill-settings-AKSP665O.js} +45 -49
  264. package/chunks/{spawnChannel-ZP23JL6O.js → spawnChannel-N25MBB6F.js} +40 -44
  265. package/chunks/{standalone-update-P2Q5H4ZU.js → standalone-update-XGPWJDRN.js} +40 -44
  266. package/chunks/start-opentui-ui-FZ4USOU7.js +55342 -0
  267. package/chunks/{startInteractiveUI-NSA6QPQZ.js → startInteractiveUI-E2WQJUOA.js} +2920 -4542
  268. package/chunks/{syntheticOutput-5URSQLIS.js → syntheticOutput-HJNZSEHN.js} +2 -2
  269. package/chunks/{task-create-3EXVDG3G.js → task-create-6RSD54S5.js} +7 -7
  270. package/chunks/{task-list-PIBYNSE7.js → task-list-IQSACPOM.js} +31 -7
  271. package/chunks/{task-stop-IV3BYWJC.js → task-stop-HE2LRQNW.js} +1 -1
  272. package/chunks/{task-update-H5BPDS5Y.js → task-update-XAJ2NYOA.js} +7 -7
  273. package/chunks/{team-create-53T42W37.js → team-create-SOKMYSQU.js} +28 -32
  274. package/chunks/{team-delete-X3WPELS6.js → team-delete-NGNNKGMG.js} +1 -1
  275. package/chunks/{team-plan-approval-D45ZC5OE.js → team-plan-approval-U7ZWXYAY.js} +26 -30
  276. package/chunks/{terminal-image-renderer-FCRUWT6C.js → terminal-image-renderer-KKM4OBLO.js} +40 -44
  277. package/chunks/{theme-manager-MHNPEDP7.js → theme-manager-GQHF3A7T.js} +38 -42
  278. package/chunks/{todoWrite-A5IOZZ3P.js → todoWrite-5UTVUXHA.js} +36 -6
  279. package/chunks/{tool-search-6RPBGGUX.js → tool-search-IAI2RVWT.js} +10 -12
  280. package/chunks/{total-session-admission-MGV56XDK.js → total-session-admission-G4CGCSTG.js} +43 -47
  281. package/chunks/{trustedFolders-QJYEFMTU.js → trustedFolders-D2I3FDPB.js} +39 -43
  282. package/chunks/{update-relaunch-ZDMQX63C.js → update-relaunch-5RWKZAL3.js} +5 -5
  283. package/chunks/{updateCheck-4QZWCGP6.js → updateCheck-ZXOQDFEI.js} +42 -46
  284. package/chunks/{useAutoAcceptIndicator-DLIQN256.js → useAutoAcceptIndicator-6EK4QGAH.js} +49 -53
  285. package/chunks/{validateNonInterActiveAuth-HGTG7AEK.js → validateNonInterActiveAuth-QPFEKATS.js} +82 -86
  286. package/chunks/{version-CPAZMC4B.js → version-JKNG7YDH.js} +1 -1
  287. package/chunks/{web-fetch-N4K5M3M4.js → web-fetch-X3AHIIHW.js} +8 -11
  288. package/chunks/{web-search-4VZKM5SF.js → web-search-K2FMOGS5.js} +6 -7
  289. package/chunks/{web-shell-static-PW7OEDQO.js → web-shell-static-POZHGGXE.js} +4 -4
  290. package/chunks/{workflow-2ALQKTHG.js → workflow-TOLPAK5G.js} +38 -38
  291. package/chunks/{workspace-providers-status-5JM4CB6R.js → workspace-providers-status-PCJK3RC7.js} +50 -54
  292. package/chunks/{workspace-registration-store-RNMFVCH7.js → workspace-registration-store-KQWVVW4Y.js} +1 -1
  293. package/chunks/{workspace-registry-6EULAPZC.js → workspace-registry-YNIOB6HJ.js} +43 -47
  294. package/chunks/{workspace-runtime-coordinator-IRI2DRCJ.js → workspace-runtime-coordinator-WG2RNEN7.js} +43 -47
  295. package/chunks/{workspace-service-SETHN4WE.js → workspace-service-G4ZNBOFH.js} +51 -55
  296. package/chunks/{workspace-skills-status-4D4EUEQU.js → workspace-skills-status-FMTPPMWC.js} +47 -51
  297. package/chunks/{workspace-trust-reconciler-4LR3CDL4.js → workspace-trust-reconciler-IBDFQBQS.js} +53 -57
  298. package/chunks/wrapper-JH3IFHT2.js +35 -0
  299. package/chunks/{write-file-45GWPSOI.js → write-file-YTLFY2S5.js} +28 -32
  300. package/chunks/{zh-2BQ7P6OD.js → zh-25DF7OGK.js} +2 -0
  301. package/chunks/{zh-TW-UFXRZTXX.js → zh-TW-5EDMZVGK.js} +2 -0
  302. package/chunks/{zoom-image-K6IQUKRC.js → zoom-image-IFXSN74N.js} +6 -8
  303. package/cli.js +17 -13
  304. package/locales/en.js +3 -0
  305. package/locales/zh-TW.js +3 -0
  306. package/locales/zh.js +3 -0
  307. package/package.json +3 -3
  308. package/web-shell/assets/{abnfDiagram-VCTEODGH-C80OZcPP.js → abnfDiagram-VCTEODGH-Cxf7xE_Z.js} +1 -1
  309. package/web-shell/assets/{arc-AUqStYgf.js → arc-ESi1eNkE.js} +1 -1
  310. package/web-shell/assets/{architectureDiagram-5GKGNRK7-CQYOdYla.js → architectureDiagram-5GKGNRK7-D9l7-bDo.js} +1 -1
  311. package/web-shell/assets/{blockDiagram-NRAW4CY4-lYKlFysy.js → blockDiagram-NRAW4CY4-Bc8DEasw.js} +1 -1
  312. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BoS23iIp.js → c4Diagram-UCG6FXSJ-Dimb2Hmh.js} +1 -1
  313. package/web-shell/assets/channel-B7ohGDil.js +1 -0
  314. package/web-shell/assets/{chunk-2Q5K7J3B-DLLooL1E.js → chunk-2Q5K7J3B-jVDmOpAQ.js} +1 -1
  315. package/web-shell/assets/{chunk-5VM5RSS4-kPfJxScY.js → chunk-5VM5RSS4-DbG_SwdB.js} +1 -1
  316. package/web-shell/assets/{chunk-F27PBJKO-CVGFBqkD.js → chunk-F27PBJKO-QEc4cY1v.js} +1 -1
  317. package/web-shell/assets/{chunk-G27WJ6UU-CnM_kOVV.js → chunk-G27WJ6UU-iJ36lQ3X.js} +1 -1
  318. package/web-shell/assets/{chunk-JWPE2WC7-Cj-ajOkT.js → chunk-JWPE2WC7-DuArnVtF.js} +1 -1
  319. package/web-shell/assets/{chunk-LCL6LL3I-8L5c-wFo.js → chunk-LCL6LL3I-DxOf1zwL.js} +1 -1
  320. package/web-shell/assets/{chunk-POPQ4Y6H-DsXTxpvL.js → chunk-POPQ4Y6H-lVLu9Ild.js} +1 -1
  321. package/web-shell/assets/{chunk-SVP7TREG-DU5GE1_z.js → chunk-SVP7TREG-C6XYlIer.js} +1 -1
  322. package/web-shell/assets/{chunk-XXDRQBXY-D2IIWZKt.js → chunk-XXDRQBXY-CiG2j2Ji.js} +1 -1
  323. package/web-shell/assets/classDiagram-DTDB5LWJ-DdFpqpfD.js +1 -0
  324. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DdFpqpfD.js +1 -0
  325. package/web-shell/assets/{cose-bilkent-JH36ORCC-CF_txUJr.js → cose-bilkent-JH36ORCC-DGVHMMVm.js} +1 -1
  326. package/web-shell/assets/{cynefin-OW5HDTMX-DEZ-My-Z.js → cynefin-OW5HDTMX-D6cgpCnH.js} +1 -1
  327. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BV7EKUS6.js → cynefinDiagram-5FMLGOSQ-BKv4Z-UX.js} +1 -1
  328. package/web-shell/assets/{dagre-3AP2YEHR-JGIX0G4H.js → dagre-3AP2YEHR-B4ABMIG-.js} +1 -1
  329. package/web-shell/assets/{diagram-S7CK7UJ4-DdUY7q6A.js → diagram-S7CK7UJ4-DgCkp_Lm.js} +1 -1
  330. package/web-shell/assets/{diagram-UQ7AKVKN-fhzRZ19v.js → diagram-UQ7AKVKN-FG0FNokz.js} +1 -1
  331. package/web-shell/assets/{diagram-VSXAHHWV-BOgOex6q.js → diagram-VSXAHHWV-JgkP9qg-.js} +1 -1
  332. package/web-shell/assets/{diagram-VX7I27RA-C0NknIz6.js → diagram-VX7I27RA-ADh2x83l.js} +1 -1
  333. package/web-shell/assets/{diagram-Z3DM3KII-C__3mUBX.js → diagram-Z3DM3KII-yXqoYF1J.js} +1 -1
  334. package/web-shell/assets/{ebnfDiagram-PWID7BFC-BvPhqycH.js → ebnfDiagram-PWID7BFC-Duk83Ek_.js} +1 -1
  335. package/web-shell/assets/{erDiagram-SSCWMZ5O-BqzoNoL9.js → erDiagram-SSCWMZ5O-DMdvxySG.js} +1 -1
  336. package/web-shell/assets/{flowDiagram-A5DVABFB-CJKOre47.js → flowDiagram-A5DVABFB-DHjVgSji.js} +1 -1
  337. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C5xZjrp0.js → ganttDiagram-EL5Y4UJY-DMM9DkCE.js} +1 -1
  338. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-C0EjwuPK.js → gitGraphDiagram-WWUBYQGX-t_ug9vO8.js} +1 -1
  339. package/web-shell/assets/index-BGZRqbRo.css +36 -0
  340. package/web-shell/assets/index-DRri_6_x.js +2067 -0
  341. package/web-shell/assets/{index-C5M93syE.js → index-zqvnpGHv.js} +1 -1
  342. package/web-shell/assets/{infoDiagram-RXCK75RN-BUwzsYOs.js → infoDiagram-RXCK75RN-eT1fANNm.js} +1 -1
  343. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-EDJ_DH3V.js → ishikawaDiagram-5VMMS53U-k3evzZNn.js} +1 -1
  344. package/web-shell/assets/{journeyDiagram-EYS64GPL-BnfcOsS0.js → journeyDiagram-EYS64GPL-CGim3EAi.js} +1 -1
  345. package/web-shell/assets/{kanban-definition-3QL26DDD-D_ofTVGu.js → kanban-definition-3QL26DDD-WHfJo-22.js} +1 -1
  346. package/web-shell/assets/{layout-CBuQFdfZ.js → layout-DkqIaFlJ.js} +1 -1
  347. package/web-shell/assets/{linear-DRIHtmGv.js → linear-Bdkd3mCz.js} +1 -1
  348. package/web-shell/assets/{mermaid.core-CmR5wZH6.js → mermaid.core-CGw0LkT_.js} +6 -6
  349. package/web-shell/assets/{mindmap-definition-FBJOCRG2-BV374olC.js → mindmap-definition-FBJOCRG2-C9V4rBvo.js} +1 -1
  350. package/web-shell/assets/{pegDiagram-XKGWAZYB-Bpy1SplK.js → pegDiagram-XKGWAZYB-CwoI2T5G.js} +1 -1
  351. package/web-shell/assets/{pieDiagram-E7YTZNPT-CeZx4hR2.js → pieDiagram-E7YTZNPT-DaTmBmPG.js} +1 -1
  352. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-COYKs14h.js → quadrantDiagram-AXDQQJYC-plh6MyGI.js} +1 -1
  353. package/web-shell/assets/{railroadDiagram-O6MQD6OU-5g2pOeTs.js → railroadDiagram-O6MQD6OU-D_b-S0iK.js} +1 -1
  354. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Yn8uPGtF.js → requirementDiagram-EFPCY7ZU-zUzTN7VE.js} +1 -1
  355. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CTayAGq6.js → sankeyDiagram-P5KCCOFB-m6AhoD0l.js} +1 -1
  356. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-BFWDKzUU.js → sequenceDiagram-WJ2MYXX4-Cwhzsine.js} +1 -1
  357. package/web-shell/assets/{sizeCapture-X5ZJPWSS-CtErUbj4.js → sizeCapture-X5ZJPWSS-CcZuKIae.js} +1 -1
  358. package/web-shell/assets/{stateDiagram-HBIQ2CUA-Co3HFzOd.js → stateDiagram-HBIQ2CUA-CFoiJwD_.js} +1 -1
  359. package/web-shell/assets/stateDiagram-v2-4QOOHH4V--H8HdEmk.js +1 -0
  360. package/web-shell/assets/{swimlanes-XN3QIQJK-CDZuxzOj.js → swimlanes-XN3QIQJK-CgS9hcaV.js} +1 -1
  361. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ShE9OIgf.js +8 -0
  362. package/web-shell/assets/{timeline-definition-24CTP7MA-UcNHj8At.js → timeline-definition-24CTP7MA-Dzzc05t9.js} +1 -1
  363. package/web-shell/assets/{vennDiagram-4TSXK5OY-JKR9pVFG.js → vennDiagram-4TSXK5OY-DemK0f7Y.js} +1 -1
  364. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-C4SU-yIW.js → wardleyDiagram-VM6X3IG4-CquLxtMr.js} +1 -1
  365. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-D_yoWGZ4.js → xychartDiagram-S5SC5T6Z-BTBKTM5g.js} +1 -1
  366. package/web-shell/index.html +2 -2
  367. package/chunks/chunk-4P7PPAHN.js +0 -3097
  368. package/chunks/chunk-7J6OTNGO.js +0 -424
  369. package/chunks/chunk-LMMHS3RS.js +0 -135
  370. package/chunks/chunk-MZYWNU66.js +0 -149
  371. package/chunks/chunk-T4EFG2P5.js +0 -113
  372. package/chunks/chunk-XZA32HII.js +0 -19
  373. package/chunks/goal-tools-7TNK5ZHC.js +0 -411
  374. package/web-shell/assets/channel-B0ovOJeK.js +0 -1
  375. package/web-shell/assets/classDiagram-DTDB5LWJ-DMll2-6_.js +0 -1
  376. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DMll2-6_.js +0 -1
  377. package/web-shell/assets/index-B_IPzA0h.js +0 -2020
  378. package/web-shell/assets/index-D1OKGQlM.css +0 -36
  379. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C3gdRjPm.js +0 -1
  380. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-C34TGCPZ.js +0 -8
  381. /package/chunks/{chunk-FOGQO4FG.js → chunk-JA5CBKRP.js} +0 -0
@@ -3,14 +3,14 @@
3
3
  import {
4
4
  require_axios,
5
5
  require_ws
6
- } from "./chunk-AVNATYLY.js";
7
- import "./chunk-XIQ5HQ2F.js";
6
+ } from "./chunk-JJKNYRFY.js";
7
+ import "./chunk-OBTWL6ZW.js";
8
8
  import "./chunk-K6KS3LTN.js";
9
- import "./chunk-7E7UCJHS.js";
9
+ import "./chunk-OSHQMOBS.js";
10
10
  import {
11
11
  ChannelBase,
12
12
  sanitizeLogText
13
- } from "./chunk-IXEZHTDR.js";
13
+ } from "./chunk-U4DJ5XB3.js";
14
14
  import "./chunk-IW6RQPQB.js";
15
15
  import "./chunk-CQ35AJ4Z.js";
16
16
  import "./chunk-DMTGGOSA.js";
@@ -5,7 +5,7 @@ import {
5
5
  isTerminalTaskLifecycleType,
6
6
  sanitizeLogText,
7
7
  truncateCodePoints
8
- } from "./chunk-IXEZHTDR.js";
8
+ } from "./chunk-U4DJ5XB3.js";
9
9
  import "./chunk-IW6RQPQB.js";
10
10
  import "./chunk-CQ35AJ4Z.js";
11
11
  import {
@@ -765,7 +765,27 @@ var DwsClient = class {
765
765
  if (source.kind === "group") {
766
766
  args.push("--group", source.conversationId);
767
767
  }
768
- return this.eventStarter(this.executable, args, async (line) => onMessage(parseDwsImEvent(line)), onError);
768
+ return this.eventStarter(this.executable, args, (line) => {
769
+ const message = parseDwsImEvent(line);
770
+ const result = onMessage(message);
771
+ if (!result || !("admitted" in result))
772
+ return result;
773
+ if (source.kind !== "direct")
774
+ return result.completed;
775
+ const reportError = /* @__PURE__ */ __name((error) => {
776
+ try {
777
+ onError(error instanceof Error ? error : new Error(String(error)));
778
+ } catch {
779
+ return;
780
+ }
781
+ }, "reportError");
782
+ const admissionSucceeded = result.admitted.then(() => true, () => false);
783
+ void result.completed.catch(async (error) => {
784
+ if (await admissionSucceeded)
785
+ reportError(error);
786
+ });
787
+ return result.admitted;
788
+ }, onError);
769
789
  }
770
790
  async sendImMessage(target, content, idempotencyKey) {
771
791
  const targetArgs = target.kind === "group" ? ["--group", target.conversationId] : ["--open-dingtalk-id", target.openDingTalkId];
@@ -1056,6 +1076,7 @@ var MAX_DOCUMENT_CONTEXT_CHARS = 12e3;
1056
1076
  var MAX_TODO_CONTEXT_CHARS = 12e3;
1057
1077
  var MAX_COMMENT_CHARS = 4e3;
1058
1078
  var MAX_PROCESSED_ITEMS = 5e3;
1079
+ var MAX_DIRECT_REPLAY_DISPATCHES = 16;
1059
1080
  var MAX_INBOUND_ATTEMPTS = 5;
1060
1081
  var MAX_IM_TARGETS = 1e3;
1061
1082
  var MAX_TODO_STATES = 1e3;
@@ -1065,7 +1086,7 @@ var EVENT_RESTART_DELAY_MS = 2e3;
1065
1086
  var EVENT_RESTART_MAX_DELAY_MS = 5 * 6e4;
1066
1087
  var NO_REPLY_SENTINEL = "[NO_REPLY]";
1067
1088
  var NO_REPLY_SENTINEL_PATTERN = /^\[NO_REPLY\][.!]?$/i;
1068
- var ACK_REACTION_NAME = "\u6697\u4E2D\u89C2\u5BDF";
1089
+ var DEFAULT_START_REACTION = "\u{1F914}";
1069
1090
  var MAX_INBOUND_REACTION_TARGETS = 1e3;
1070
1091
  var NOTIFICATION_HISTORY_OVERLAP_MS = 5e3;
1071
1092
  var NOTIFICATION_POLL_INTERVAL_MS = 5e3;
@@ -1317,12 +1338,23 @@ var DwsChannel = class extends PollingChannelBase {
1317
1338
  userInstructions;
1318
1339
  client;
1319
1340
  imStates;
1341
+ startReactionName;
1342
+ endReactionName;
1320
1343
  watchTodos;
1321
1344
  inboundReactionTargets = /* @__PURE__ */ new Map();
1322
- activeReactionKeys = /* @__PURE__ */ new Set();
1345
+ activeReactions = /* @__PURE__ */ new Map();
1323
1346
  sessionReactionKeys = /* @__PURE__ */ new Map();
1347
+ reactionOperations = /* @__PURE__ */ new Map();
1348
+ endReactionKeys = /* @__PURE__ */ new Set();
1324
1349
  notifiedSenderPairingNotifications = /* @__PURE__ */ new Set();
1325
1350
  processingMessages = /* @__PURE__ */ new Map();
1351
+ queuedDirectMessages = /* @__PURE__ */ new Map();
1352
+ // Replay-started direct dispatches only. The cap must not be consumed by
1353
+ // live or followup traffic, whose queue entries outlive their turn.
1354
+ replayDirectDispatches = /* @__PURE__ */ new Map();
1355
+ directConversationTails = /* @__PURE__ */ new Map();
1356
+ directMessageStartResolvers = /* @__PURE__ */ new Map();
1357
+ pendingMessageCapacityWaiters = /* @__PURE__ */ new Set();
1326
1358
  pollAbortController = new AbortController();
1327
1359
  lifecycleGeneration = 0;
1328
1360
  connectionStartedAt = 0;
@@ -1331,6 +1363,8 @@ var DwsChannel = class extends PollingChannelBase {
1331
1363
  notificationWatermarkPulledBack = false;
1332
1364
  constructor(name, config, bridge, options, client) {
1333
1365
  const profile = configuredString(config.profile, "profile");
1366
+ const startReactionName = configuredString(config.startReaction, "startReaction") ?? DEFAULT_START_REACTION;
1367
+ const endReactionName = configuredString(config.endReaction, "endReaction");
1334
1368
  const watchTodos = configuredBoolean(config.watchTodos, "watchTodos");
1335
1369
  if (profile?.includes(",")) {
1336
1370
  throw new Error("DWS channel profile must select exactly one login profile.");
@@ -1358,6 +1392,8 @@ var DwsChannel = class extends PollingChannelBase {
1358
1392
  source,
1359
1393
  restartAttempts: 0
1360
1394
  }));
1395
+ this.startReactionName = startReactionName;
1396
+ this.endReactionName = endReactionName;
1361
1397
  this.watchTodos = watchTodos;
1362
1398
  }
1363
1399
  createInitialCursor() {
@@ -1497,15 +1533,19 @@ var DwsChannel = class extends PollingChannelBase {
1497
1533
  this.pollAbortController.abort();
1498
1534
  this.lastTodoPollAt = 0;
1499
1535
  this.todoTargets.clear();
1500
- for (const reactions of this.sessionReactionKeys.values()) {
1501
- for (const [key, { conversationId, messageId }] of reactions) {
1502
- if (!this.activeReactionKeys.delete(key))
1503
- continue;
1504
- void this.client.removeImReaction(conversationId, messageId, ACK_REACTION_NAME).catch((error) => this.logReactionFailure("disconnect reaction removal", error));
1505
- }
1536
+ for (const key of [...this.activeReactions.keys()]) {
1537
+ this.cleanupReaction(key, "disconnect reaction removal");
1506
1538
  }
1507
- this.activeReactionKeys.clear();
1508
1539
  this.sessionReactionKeys.clear();
1540
+ this.queuedDirectMessages.clear();
1541
+ this.replayDirectDispatches.clear();
1542
+ for (const resolve of this.directMessageStartResolvers.values())
1543
+ resolve();
1544
+ this.directMessageStartResolvers.clear();
1545
+ this.directConversationTails.clear();
1546
+ for (const resolve of this.pendingMessageCapacityWaiters)
1547
+ resolve();
1548
+ this.pendingMessageCapacityWaiters.clear();
1509
1549
  this.stopPollLoop();
1510
1550
  for (const state of this.imStates) {
1511
1551
  if (state.retryTimer)
@@ -1702,7 +1742,7 @@ Ask the bot operator to approve you with:
1702
1742
  for (const message of mentions.messages) {
1703
1743
  if (signal.aborted || !this.connected)
1704
1744
  return;
1705
- await this.handleImMessage({ kind: "at" }, message, true);
1745
+ await this.receiveImMessage({ kind: "at" }, message, true);
1706
1746
  }
1707
1747
  if (mentions.nextCursor) {
1708
1748
  this.cursor.mentionCheckpoint = {
@@ -1737,15 +1777,10 @@ Ask the bot operator to approve you with:
1737
1777
  }
1738
1778
  if (this.hasPendingMessage(key))
1739
1779
  continue;
1740
- try {
1741
- await this.handleImMessage({ kind: "direct" }, message, true);
1742
- } catch (error) {
1743
- if (!this.hasPendingMessage(key))
1744
- throw error;
1745
- process2.stderr.write(`[Channel:${this.name}] direct-message dispatch failed mid-window; the message is parked for retry: ${sanitizeLogText(error instanceof Error ? error.message : String(error), 300)}
1746
- `);
1747
- }
1780
+ await this.receiveDirectMessage(message, true).admitted;
1748
1781
  }
1782
+ if (signal.aborted || !this.connected)
1783
+ return;
1749
1784
  if (this.notificationWatermarkPulledBack) {
1750
1785
  this.cursor.notificationCheckpoint = void 0;
1751
1786
  } else if (page.nextCursor) {
@@ -1892,7 +1927,7 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
1892
1927
  const subscription = await this.client.subscribeToIm(state.source, (message) => {
1893
1928
  state.lastError = void 0;
1894
1929
  state.restartAttempts = 0;
1895
- return this.handleImMessage(state.source, message);
1930
+ return state.source.kind === "direct" ? this.receiveDirectMessage(message) : this.receiveImMessage(state.source, message);
1896
1931
  }, (error) => {
1897
1932
  if (error instanceof DwsEventProcessError)
1898
1933
  state.lastError = error;
@@ -1982,35 +2017,120 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
1982
2017
  process2.stderr.write(`[Channel:${this.name}] DWS ${sanitizeLogText(sourceLabel(source), 120)} stream error: ${sanitizeLogText(error.message, 300)}
1983
2018
  `);
1984
2019
  }
1985
- async handleImMessage(source, message, fromHistory = false) {
2020
+ async receiveImMessage(source, message, fromHistory = false) {
1986
2021
  if (!this.connected)
1987
2022
  return;
1988
- if (this.isSelfMessage(message)) {
2023
+ if (this.markSelfMessageProcessed(message))
2024
+ return;
2025
+ if (this.isStaleLiveMessage(message, fromHistory) && message.eventTime !== void 0) {
1989
2026
  this.markProcessedMessage(messageKey(message));
1990
2027
  this.saveCursor();
1991
2028
  return;
1992
2029
  }
1993
- if (!fromHistory && message.eventTime !== void 0 && message.eventTime < this.connectionStartedAt - 5e3) {
1994
- if (source.kind !== "direct") {
1995
- this.markProcessedMessage(messageKey(message));
1996
- this.saveCursor();
1997
- return;
1998
- }
2030
+ if (source.kind === "group-all" && (this.config.groups[message.conversationId]?.requireMention ?? this.config.groups["*"]?.requireMention ?? true)) {
2031
+ return;
2032
+ }
2033
+ if ((source.kind === "group" || source.kind === "group-all") && this.config.groupPolicy === "pairing" && !this.groupGate.isGroupApproved(message.conversationId)) {
2034
+ return;
2035
+ }
2036
+ await this.dispatchImMessage(source, message, messageKey(message));
2037
+ }
2038
+ receiveDirectMessage(message, fromHistory = false, reportFailure = fromHistory) {
2039
+ const admission = this.admitReceivedDirectMessage(message, fromHistory, reportFailure);
2040
+ const completed = admission.then(({ completion }) => completion);
2041
+ void completed.catch(() => void 0);
2042
+ return {
2043
+ admitted: admission.then(() => void 0),
2044
+ completed
2045
+ };
2046
+ }
2047
+ async admitReceivedDirectMessage(message, fromHistory, reportFailure) {
2048
+ if (!this.connected)
2049
+ return { completion: Promise.resolve() };
2050
+ const key = messageKey(message);
2051
+ if (this.markSelfMessageProcessed(message)) {
2052
+ return { completion: Promise.resolve() };
2053
+ }
2054
+ if (this.isStaleLiveMessage(message, fromHistory) && message.eventTime !== void 0) {
1999
2055
  this.cursor.notificationWatermark = Math.min(this.cursor.notificationWatermark ?? this.connectionStartedAt, message.eventTime);
2000
2056
  this.notificationWatermarkPulledBack = true;
2001
2057
  this.cursor.notificationCheckpoint = void 0;
2002
2058
  process2.stderr.write(`[Channel:${this.name}] parked a stale direct message for history polling and pulled the watermark back to ${message.eventTime}: ${sanitizeLogText(message.messageId, 120)}
2003
2059
  `);
2004
2060
  this.saveCursor();
2005
- return;
2061
+ return { completion: Promise.resolve() };
2006
2062
  }
2007
- if (source.kind === "group-all" && (this.config.groups[message.conversationId]?.requireMention ?? this.config.groups["*"]?.requireMention ?? true)) {
2008
- return;
2063
+ return this.admitDirectMessage({ kind: "direct" }, message, key, reportFailure);
2064
+ }
2065
+ markSelfMessageProcessed(message) {
2066
+ if (!this.isSelfMessage(message))
2067
+ return false;
2068
+ this.markProcessedMessage(messageKey(message));
2069
+ this.saveCursor();
2070
+ return true;
2071
+ }
2072
+ isStaleLiveMessage(message, fromHistory) {
2073
+ return !fromHistory && message.eventTime !== void 0 && message.eventTime < this.connectionStartedAt - 5e3;
2074
+ }
2075
+ async admitDirectMessage(source, message, key, reportFailure) {
2076
+ if (this.cursor.processedMessages.includes(key)) {
2077
+ this.removePersistedPendingMessage(key);
2078
+ return { completion: Promise.resolve() };
2009
2079
  }
2010
- if ((source.kind === "group" || source.kind === "group-all") && this.config.groupPolicy === "pairing" && !this.groupGate.isGroupApproved(message.conversationId)) {
2011
- return;
2080
+ if (!this.hasPendingMessage(key)) {
2081
+ if (!await this.rememberPendingMessage(source, message)) {
2082
+ return { completion: Promise.resolve() };
2083
+ }
2012
2084
  }
2013
- const key = messageKey(message);
2085
+ return {
2086
+ completion: this.scheduleDirectMessage(source, message, key, reportFailure)
2087
+ };
2088
+ }
2089
+ scheduleDirectMessage(source, message, key, reportFailure) {
2090
+ const queued = this.queuedDirectMessages.get(key);
2091
+ if (queued)
2092
+ return queued;
2093
+ if (this.cursor.processedMessages.includes(key)) {
2094
+ this.removePersistedPendingMessage(key);
2095
+ return Promise.resolve();
2096
+ }
2097
+ const generation = this.lifecycleGeneration;
2098
+ const dispatch = /* @__PURE__ */ __name(async () => {
2099
+ try {
2100
+ if (!this.connected || generation !== this.lifecycleGeneration)
2101
+ return;
2102
+ await this.dispatchImMessage(source, message, key);
2103
+ } finally {
2104
+ if (this.queuedDirectMessages.get(key) === task) {
2105
+ this.queuedDirectMessages.delete(key);
2106
+ }
2107
+ }
2108
+ }, "dispatch");
2109
+ let resolveStarted;
2110
+ const started = new Promise((resolve) => {
2111
+ resolveStarted = resolve;
2112
+ });
2113
+ const previous = this.directConversationTails.get(message.conversationId);
2114
+ const predecessor = reportFailure || this.config.dispatchMode === "followup" ? previous?.completed : previous?.started;
2115
+ const task = predecessor ? predecessor.catch(() => void 0).then(dispatch) : Promise.resolve().then(dispatch);
2116
+ const tail = { started, completed: task };
2117
+ this.queuedDirectMessages.set(key, task);
2118
+ this.directMessageStartResolvers.set(key, resolveStarted);
2119
+ this.directConversationTails.set(message.conversationId, tail);
2120
+ void task.finally(() => {
2121
+ this.releaseDirectMessageStart(message.conversationId, message.messageId);
2122
+ if (this.directConversationTails.get(message.conversationId) === tail) {
2123
+ this.directConversationTails.delete(message.conversationId);
2124
+ }
2125
+ }).catch(() => void 0);
2126
+ if (reportFailure) {
2127
+ void task.catch((error) => {
2128
+ this.logImError(source, error instanceof Error ? error : new Error(String(error)));
2129
+ });
2130
+ }
2131
+ return task;
2132
+ }
2133
+ async dispatchImMessage(source, message, key) {
2014
2134
  let waitedOnInFlight = false;
2015
2135
  let inFlightError;
2016
2136
  while (true) {
@@ -2028,6 +2148,9 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
2028
2148
  this.processingMessages.set(key, task);
2029
2149
  try {
2030
2150
  await task;
2151
+ if (this.cursor.processedMessages.includes(key) && this.hasPendingMessage(key)) {
2152
+ this.removePersistedPendingMessage(key);
2153
+ }
2031
2154
  } finally {
2032
2155
  if (this.processingMessages.get(key) === task) {
2033
2156
  this.processingMessages.delete(key);
@@ -2072,7 +2195,7 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
2072
2195
  await this.handleInbound(envelope);
2073
2196
  } catch (error) {
2074
2197
  if (source.kind !== "at") {
2075
- this.rememberPendingMessage(source, message);
2198
+ await this.rememberFailedMessage(source, message);
2076
2199
  }
2077
2200
  if (this.recordInboundFailure(key, error, () => {
2078
2201
  this.markProcessedMessage(key);
@@ -2128,24 +2251,63 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
2128
2251
  return;
2129
2252
  this.cursor.inboundFailures = failures.filter((failure) => failure.key !== key);
2130
2253
  }
2131
- rememberPendingMessage(source, message) {
2254
+ async rememberPendingMessage(source, message) {
2132
2255
  const key = messageKey(message);
2133
2256
  if (this.hasPendingMessage(key))
2134
- return;
2257
+ return true;
2258
+ if (!this.connected)
2259
+ return false;
2260
+ if ((this.cursor.pendingMessages?.length ?? 0) >= MAX_PROCESSED_ITEMS) {
2261
+ throw new Error("DWS pending-message capacity is exhausted; retry later.");
2262
+ }
2263
+ if (this.hasPendingMessage(key))
2264
+ return true;
2135
2265
  const pending = this.cursor.pendingMessages ?? [];
2136
- while (pending.length >= MAX_PROCESSED_ITEMS) {
2137
- const dropped = pending.shift();
2138
- if (!dropped)
2139
- break;
2140
- this.clearInboundFailure(messageKey(dropped.message));
2141
- process2.stderr.write(`[Channel:${this.name}] dropping the oldest pending DWS message because the retry queue reached ${MAX_PROCESSED_ITEMS}.
2142
- `);
2266
+ pending.push({ source, message });
2267
+ this.cursor.pendingMessages = pending;
2268
+ try {
2269
+ this.saveCursor();
2270
+ } catch (error) {
2271
+ this.removePendingMessage(key);
2272
+ throw error;
2143
2273
  }
2274
+ return true;
2275
+ }
2276
+ async rememberFailedMessage(source, message) {
2277
+ const key = messageKey(message);
2278
+ if (this.hasPendingMessage(key))
2279
+ return;
2280
+ const generation = this.lifecycleGeneration;
2281
+ while (this.connected && generation === this.lifecycleGeneration && (this.cursor.pendingMessages?.length ?? 0) >= MAX_PROCESSED_ITEMS) {
2282
+ await new Promise((resolve) => {
2283
+ this.pendingMessageCapacityWaiters.add(resolve);
2284
+ });
2285
+ }
2286
+ if (this.hasPendingMessage(key))
2287
+ return;
2288
+ const pending = this.cursor.pendingMessages ?? [];
2144
2289
  pending.push({ source, message });
2145
2290
  this.cursor.pendingMessages = pending;
2291
+ try {
2292
+ this.saveCursor();
2293
+ } catch {
2294
+ return;
2295
+ }
2296
+ }
2297
+ removePersistedPendingMessage(key) {
2298
+ if (this.removePendingMessage(key))
2299
+ this.saveCursor();
2146
2300
  }
2147
2301
  removePendingMessage(key) {
2148
- this.cursor.pendingMessages = (this.cursor.pendingMessages ?? []).filter((pending) => messageKey(pending.message) !== key);
2302
+ const pending = this.cursor.pendingMessages ?? [];
2303
+ const remaining = pending.filter((item) => messageKey(item.message) !== key);
2304
+ this.cursor.pendingMessages = remaining;
2305
+ if (remaining.length === pending.length)
2306
+ return false;
2307
+ for (const resolve of this.pendingMessageCapacityWaiters)
2308
+ resolve();
2309
+ this.pendingMessageCapacityWaiters.clear();
2310
+ return true;
2149
2311
  }
2150
2312
  async processDocumentNotification(message, key, notification) {
2151
2313
  const notificationKey = documentNotificationKey(notification);
@@ -2157,12 +2319,15 @@ ${truncateCodePoints(JSON.stringify(detail.data), MAX_TODO_CONTEXT_CHARS)}`
2157
2319
  const inFlight = this.processingMessages.get(notificationKey);
2158
2320
  if (inFlight) {
2159
2321
  await inFlight;
2160
- if (this.cursor.processedMessages.includes(notificationKey) || this.hasPendingDocumentNotification(notificationKey) && !this.gate.isAllowed(message.senderId)) {
2322
+ if (this.cursor.processedMessages.includes(notificationKey) || this.hasPendingDocumentNotification(notificationKey, message.senderId) && !this.gate.isAllowed(message.senderId)) {
2161
2323
  this.markProcessedMessage(key);
2162
- } else {
2163
- this.rememberPendingDocumentNotification(message, notification);
2324
+ this.saveCursor();
2325
+ return;
2164
2326
  }
2165
- this.saveCursor();
2327
+ if (this.processingMessages.get(notificationKey) === inFlight) {
2328
+ this.processingMessages.delete(notificationKey);
2329
+ }
2330
+ await this.processDocumentNotification(message, key, notification);
2166
2331
  return;
2167
2332
  }
2168
2333
  const task = (async () => {
@@ -2237,8 +2402,23 @@ ${context}` : "Document Markdown was unavailable; answer from the comment only."
2237
2402
  if (signal.aborted || !this.connected)
2238
2403
  return;
2239
2404
  const key = messageKey(pending.message);
2405
+ if (pending.source.kind === "direct") {
2406
+ if (this.queuedDirectMessages.has(key))
2407
+ continue;
2408
+ if (this.replayDirectDispatches.size >= MAX_DIRECT_REPLAY_DISPATCHES) {
2409
+ continue;
2410
+ }
2411
+ const dispatched = this.scheduleDirectMessage(pending.source, pending.message, key, true);
2412
+ this.replayDirectDispatches.set(key, dispatched);
2413
+ void dispatched.finally(() => {
2414
+ if (this.replayDirectDispatches.get(key) === dispatched) {
2415
+ this.replayDirectDispatches.delete(key);
2416
+ }
2417
+ }).catch(() => void 0);
2418
+ continue;
2419
+ }
2240
2420
  try {
2241
- await this.handleImMessage(pending.source, pending.message, true);
2421
+ await this.receiveImMessage(pending.source, pending.message, true);
2242
2422
  this.removePendingMessage(key);
2243
2423
  this.saveCursor();
2244
2424
  } catch (error) {
@@ -2287,8 +2467,8 @@ ${context}` : "Document Markdown was unavailable; answer from the comment only."
2287
2467
  hasPendingMessage(key) {
2288
2468
  return (this.cursor.pendingMessages ?? []).some((pending) => messageKey(pending.message) === key);
2289
2469
  }
2290
- hasPendingDocumentNotification(notificationKey) {
2291
- return (this.cursor.pendingDocumentNotifications ?? []).some((pending) => documentNotificationKey(pending) === notificationKey);
2470
+ hasPendingDocumentNotification(notificationKey, senderId) {
2471
+ return (this.cursor.pendingDocumentNotifications ?? []).some((pending) => documentNotificationKey(pending) === notificationKey && (senderId === void 0 || pending.senderId === senderId));
2292
2472
  }
2293
2473
  rememberPendingDocumentNotification(message, notification) {
2294
2474
  const key = documentNotificationKey(notification);
@@ -2330,6 +2510,14 @@ ${context}` : "Document Markdown was unavailable; answer from the comment only."
2330
2510
  reactionKey(conversationId, messageId) {
2331
2511
  return `${conversationId}\0${messageId}`;
2332
2512
  }
2513
+ releaseDirectMessageStart(conversationId, messageId) {
2514
+ const key = `${conversationId}\0${messageId}`;
2515
+ const resolve = this.directMessageStartResolvers.get(key);
2516
+ if (!resolve)
2517
+ return;
2518
+ this.directMessageStartResolvers.delete(key);
2519
+ resolve();
2520
+ }
2333
2521
  rememberInboundReactionTarget(chatId, messageId, conversationId = chatId) {
2334
2522
  const key = this.reactionKey(chatId, messageId);
2335
2523
  this.inboundReactionTargets.delete(key);
@@ -2352,6 +2540,47 @@ ${context}` : "Document Markdown was unavailable; answer from the comment only."
2352
2540
  if (reactions.size === 0)
2353
2541
  this.sessionReactionKeys.delete(sessionId);
2354
2542
  }
2543
+ releaseActiveReaction(key) {
2544
+ const reaction = this.activeReactions.get(key);
2545
+ if (!reaction)
2546
+ return void 0;
2547
+ this.activeReactions.delete(key);
2548
+ this.untrackSessionReaction(reaction.sessionId, key);
2549
+ return reaction;
2550
+ }
2551
+ enqueueReactionOperation(key, operation) {
2552
+ const previous = this.reactionOperations.get(key) ?? Promise.resolve();
2553
+ const next = previous.catch(() => void 0).then(() => operation(() => this.reactionOperations.get(key) === next)).catch((error) => this.logReactionFailure("reaction transition", error)).finally(() => {
2554
+ if (this.reactionOperations.get(key) === next) {
2555
+ this.reactionOperations.delete(key);
2556
+ }
2557
+ });
2558
+ this.reactionOperations.set(key, next);
2559
+ }
2560
+ rememberEndReaction(key) {
2561
+ this.endReactionKeys.delete(key);
2562
+ this.endReactionKeys.add(key);
2563
+ if (this.endReactionKeys.size > MAX_INBOUND_REACTION_TARGETS) {
2564
+ const oldest = this.endReactionKeys.values().next().value;
2565
+ if (oldest !== void 0)
2566
+ this.endReactionKeys.delete(oldest);
2567
+ }
2568
+ }
2569
+ async removeStartedReaction(reaction, action) {
2570
+ if (!reaction.added)
2571
+ return;
2572
+ try {
2573
+ await this.client.removeImReaction(reaction.target.conversationId, reaction.target.messageId, this.startReactionName);
2574
+ } catch (error) {
2575
+ this.logReactionFailure(action, error);
2576
+ }
2577
+ }
2578
+ cleanupReaction(key, action) {
2579
+ const reaction = this.releaseActiveReaction(key);
2580
+ if (!reaction)
2581
+ return;
2582
+ this.enqueueReactionOperation(key, () => this.removeStartedReaction(reaction, action));
2583
+ }
2355
2584
  startReaction(conversationId, messageId, sessionId) {
2356
2585
  if (!messageId)
2357
2586
  return;
@@ -2359,54 +2588,97 @@ ${context}` : "Document Markdown was unavailable; answer from the comment only."
2359
2588
  if (!target)
2360
2589
  return;
2361
2590
  const key = this.reactionKey(target.conversationId, target.messageId);
2362
- if (this.activeReactionKeys.has(key))
2591
+ if (this.activeReactions.has(key))
2363
2592
  return;
2364
- this.activeReactionKeys.add(key);
2365
2593
  let reactions = this.sessionReactionKeys.get(sessionId);
2366
2594
  if (!reactions) {
2367
- reactions = /* @__PURE__ */ new Map();
2595
+ reactions = /* @__PURE__ */ new Set();
2368
2596
  this.sessionReactionKeys.set(sessionId, reactions);
2369
2597
  }
2370
- reactions.set(key, target);
2371
- void this.client.addImReaction(target.conversationId, target.messageId, ACK_REACTION_NAME).then(() => {
2372
- if (!this.activeReactionKeys.has(key)) {
2373
- void this.client.removeImReaction(target.conversationId, target.messageId, ACK_REACTION_NAME).catch((error) => this.logReactionFailure("late reaction removal", error));
2598
+ reactions.add(key);
2599
+ const reaction = {
2600
+ target,
2601
+ sessionId,
2602
+ added: false
2603
+ };
2604
+ this.activeReactions.set(key, reaction);
2605
+ this.enqueueReactionOperation(key, async () => {
2606
+ if (this.activeReactions.get(key) !== reaction)
2607
+ return;
2608
+ if (this.endReactionName && this.endReactionKeys.has(key)) {
2609
+ try {
2610
+ await this.client.removeImReaction(target.conversationId, target.messageId, this.endReactionName);
2611
+ this.endReactionKeys.delete(key);
2612
+ if (this.endReactionName === this.startReactionName) {
2613
+ reaction.added = false;
2614
+ }
2615
+ } catch (error) {
2616
+ this.logReactionFailure("previous end reaction removal", error);
2617
+ }
2618
+ }
2619
+ if (this.activeReactions.get(key) !== reaction)
2620
+ return;
2621
+ if (reaction.added)
2622
+ return;
2623
+ try {
2624
+ await this.client.addImReaction(target.conversationId, target.messageId, this.startReactionName);
2625
+ reaction.added = true;
2626
+ } catch (error) {
2627
+ this.logReactionFailure("start reaction add", error);
2374
2628
  }
2375
- }).catch((error) => {
2376
- this.activeReactionKeys.delete(key);
2377
- this.untrackSessionReaction(sessionId, key);
2378
- this.logReactionFailure("reaction add", error);
2379
2629
  });
2380
2630
  }
2381
- stopReaction(conversationId, messageId, sessionId) {
2631
+ finishReaction(conversationId, messageId, sessionId) {
2382
2632
  if (!messageId)
2383
2633
  return;
2384
2634
  const target = this.inboundReactionTargets.get(this.reactionKey(conversationId, messageId));
2385
2635
  if (!target)
2386
2636
  return;
2387
2637
  const key = this.reactionKey(target.conversationId, target.messageId);
2388
- this.untrackSessionReaction(sessionId, key);
2389
- if (!this.activeReactionKeys.delete(key))
2638
+ const active = this.activeReactions.get(key);
2639
+ if (!active || active.sessionId !== sessionId)
2640
+ return;
2641
+ const reaction = this.releaseActiveReaction(key);
2642
+ if (!reaction)
2390
2643
  return;
2391
- void this.client.removeImReaction(target.conversationId, target.messageId, ACK_REACTION_NAME).catch((error) => this.logReactionFailure("reaction removal", error));
2644
+ const generation = this.lifecycleGeneration;
2645
+ this.enqueueReactionOperation(key, async (isLatest) => {
2646
+ const replacement = this.activeReactions.get(key);
2647
+ if (replacement) {
2648
+ if (reaction.added)
2649
+ replacement.added = true;
2650
+ return;
2651
+ }
2652
+ await this.removeStartedReaction(reaction, "start reaction removal");
2653
+ if (!isLatest() || this.activeReactions.has(key) || !this.endReactionName || this.endReactionKeys.has(key) || !this.connected || generation !== this.lifecycleGeneration) {
2654
+ return;
2655
+ }
2656
+ try {
2657
+ await this.client.addImReaction(reaction.target.conversationId, reaction.target.messageId, this.endReactionName);
2658
+ this.rememberEndReaction(key);
2659
+ } catch (error) {
2660
+ this.logReactionFailure("end reaction add", error);
2661
+ }
2662
+ });
2392
2663
  }
2393
2664
  onTaskLifecycle(event) {
2394
2665
  if (event.type === "started") {
2666
+ if (event.messageId) {
2667
+ this.releaseDirectMessageStart(event.chatId, event.messageId);
2668
+ }
2395
2669
  this.startReaction(event.chatId, event.messageId, event.sessionId);
2396
2670
  return;
2397
2671
  }
2398
2672
  if (isTerminalTaskLifecycleType(event.type)) {
2399
- this.stopReaction(event.chatId, event.messageId, event.sessionId);
2673
+ this.finishReaction(event.chatId, event.messageId, event.sessionId);
2400
2674
  }
2401
2675
  }
2402
2676
  onSessionDied(sessionId) {
2403
2677
  const reactions = this.sessionReactionKeys.get(sessionId);
2404
2678
  if (reactions) {
2405
2679
  this.sessionReactionKeys.delete(sessionId);
2406
- for (const [key, { messageId, conversationId }] of reactions) {
2407
- if (!this.activeReactionKeys.delete(key))
2408
- continue;
2409
- void this.client.removeImReaction(conversationId, messageId, ACK_REACTION_NAME).catch((error) => this.logReactionFailure("session-death reaction removal", error));
2680
+ for (const key of reactions) {
2681
+ this.cleanupReaction(key, "session-death reaction removal");
2410
2682
  }
2411
2683
  }
2412
2684
  super.onSessionDied(sessionId);
@@ -2503,6 +2775,19 @@ var plugin = {
2503
2775
  label: "Watch Native Todos",
2504
2776
  kind: "boolean",
2505
2777
  description: "Poll pending todos assigned to this DWS account and run newly assigned or changed tasks"
2778
+ },
2779
+ {
2780
+ key: "startReaction",
2781
+ label: "Start Reaction",
2782
+ kind: "string",
2783
+ default: DEFAULT_START_REACTION,
2784
+ description: `DingTalk reaction emoji or name added while a task is running. Leave empty to use ${DEFAULT_START_REACTION}`
2785
+ },
2786
+ {
2787
+ key: "endReaction",
2788
+ label: "End Reaction",
2789
+ kind: "string",
2790
+ description: "DingTalk reaction emoji or name added after a task ends. Leave empty to disable it"
2506
2791
  }
2507
2792
  ],
2508
2793
  validateConfig: /* @__PURE__ */ __name((config) => {
@@ -2515,6 +2800,11 @@ var plugin = {
2515
2800
  if (config["watchTodos"] !== void 0 && typeof config["watchTodos"] !== "boolean") {
2516
2801
  return "DWS watchTodos must be a boolean.";
2517
2802
  }
2803
+ for (const field of ["startReaction", "endReaction"]) {
2804
+ if (config[field] !== void 0 && typeof config[field] !== "string") {
2805
+ return `DWS ${field} must be a string.`;
2806
+ }
2807
+ }
2518
2808
  return void 0;
2519
2809
  }, "validateConfig")
2520
2810
  },
@@ -8,7 +8,7 @@ import {
8
8
  sanitizeLogText,
9
9
  sanitizePromptText,
10
10
  truncateCodePoints
11
- } from "./chunk-IXEZHTDR.js";
11
+ } from "./chunk-U4DJ5XB3.js";
12
12
  import "./chunk-IW6RQPQB.js";
13
13
  import "./chunk-CQ35AJ4Z.js";
14
14
  import {