@qwen-code/qwen-code 0.23.5-dev.codemode-responses.20260915.f024b37689 → 0.23.5-preview.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.
- package/bundled/computer-use/SKILL.md +24 -3
- package/bundled/qc-helper/docs/configuration/model-providers.md +43 -0
- package/bundled/qc-helper/docs/configuration/settings.md +10 -9
- package/bundled/qc-helper/docs/extension/agent-plugins.md +1 -0
- package/bundled/qc-helper/docs/extension/introduction.md +49 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +39 -4
- package/bundled/qc-helper/docs/features/channels/overview.md +12 -0
- package/bundled/qc-helper/docs/features/commands.md +57 -52
- package/bundled/qc-helper/docs/features/computer-use.md +1 -1
- package/bundled/qc-helper/docs/features/goals.md +8 -0
- package/bundled/qc-helper/docs/features/hooks.md +16 -0
- package/bundled/qc-helper/docs/qwen-serve.md +3 -1
- package/bundled/workflow-authoring/SKILL.md +48 -22
- package/chunks/{MaxSizedBox-BFMIFJWT.js → MaxSizedBox-FCF6M53W.js} +40 -43
- package/chunks/{StandaloneSessionPicker-4ZH7MOVG.js → StandaloneSessionPicker-V635V72I.js} +60 -63
- package/chunks/{acp-startup-profiler-RUQNTNU5.js → acp-startup-profiler-MOOU37VM.js} +2 -2
- package/chunks/{acp-subagent-executor-AHMVA4P3.js → acp-subagent-executor-TND6W2O5.js} +46 -47
- package/chunks/{acpAgent-UMAJ3XR3.js → acpAgent-3DPWZTNC.js} +954 -322
- package/chunks/{agent-CXB2CCQN.js → agent-KIHGINKN.js} +27 -30
- package/chunks/{agent-headless-7D5ZC736.js → agent-headless-EJ4QOUSM.js} +27 -30
- package/chunks/{anthropicContentGenerator-H5YPXIDE.js → anthropicContentGenerator-4FGOM5LK.js} +46 -64
- package/chunks/{artifact-tool-MFGORTWZ.js → artifact-tool-MUTNH4NI.js} +1 -1
- package/chunks/{askUserQuestion-WS4GUT7C.js → askUserQuestion-AKIRLVB5.js} +1 -1
- package/chunks/bareMode-QWKZPLPX.js +14 -0
- package/chunks/{bridge-A2WKX6IK.js → bridge-MUX5YJZT.js} +46 -49
- package/chunks/{ca-GZ4FDJU2.js → ca-WC3A5B3Q.js} +12 -1
- package/chunks/{channel-management-service-AFVIT4VH.js → channel-management-service-RRILWSXX.js} +4 -4
- package/chunks/{channel-settings-store-AXJIN7HG.js → channel-settings-store-7CBIRZER.js} +51 -54
- package/chunks/{channel-worker-group-JR6JOELM.js → channel-worker-group-3DUJFZJR.js} +8 -8
- package/chunks/{channel-worker-manager-AVKJEZFL.js → channel-worker-manager-E5UW2VLA.js} +8 -8
- package/chunks/{channel-worker-supervisor-OOYY7BAQ.js → channel-worker-supervisor-VN33GSEC.js} +5 -5
- package/chunks/{chunk-2YMRRI2C.js → chunk-2C5TR6HN.js} +82 -9
- package/chunks/{chunk-YDFOHRS5.js → chunk-2GP6BQ2J.js} +1 -1
- package/chunks/{chunk-RN6BU77T.js → chunk-347O2YZJ.js} +158 -290
- package/chunks/{chunk-LTINUI3O.js → chunk-36NRLIR6.js} +10 -8
- package/chunks/{chunk-AXZMWAJV.js → chunk-36SDZ2Q4.js} +8 -0
- package/chunks/{chunk-QR4Q425T.js → chunk-3BZI5GDP.js} +1 -1
- package/chunks/{chunk-C3YMBSLR.js → chunk-3HTUE6ZR.js} +3 -3
- package/chunks/{chunk-QS5Q5F42.js → chunk-3LLEB5CU.js} +2 -2
- package/chunks/{chunk-FPPG5Y3W.js → chunk-3UGMLA4V.js} +10 -8
- package/chunks/{chunk-66N6C4EH.js → chunk-3WILPKTJ.js} +2 -2
- package/chunks/{chunk-SROLVJFY.js → chunk-3WWPEFMX.js} +1 -1
- package/chunks/{chunk-ZKIAGIGH.js → chunk-3XBUCOWS.js} +1 -1
- package/chunks/{chunk-6RQFMGN2.js → chunk-43Y26NPF.js} +3 -3
- package/chunks/{chunk-INGBUYL6.js → chunk-4FLUQWJ4.js} +1 -1
- package/chunks/{chunk-S77FFY67.js → chunk-4JFLRHNE.js} +1 -1
- package/chunks/{chunk-MJHLKWGJ.js → chunk-4QPVZA5J.js} +70 -23
- package/chunks/{chunk-XX5HQLCZ.js → chunk-6OTF7TTE.js} +32 -1
- package/chunks/{chunk-4Y2I3CI3.js → chunk-6USYH3EU.js} +99 -6
- package/chunks/{chunk-Q3TFRP5G.js → chunk-7D4CV7JH.js} +102 -9
- package/chunks/{chunk-EWJTAP3Y.js → chunk-7O5PYQ3M.js} +20 -1
- package/chunks/chunk-ADN5KESB.js +28 -0
- package/chunks/chunk-AKRSSKUT.js +229 -0
- package/chunks/{chunk-54YUXX7X.js → chunk-AQP3H22J.js} +1 -1
- package/chunks/{chunk-EQWKIA72.js → chunk-AUX2FL5T.js} +24 -7
- package/chunks/{chunk-YGFJ6BRT.js → chunk-AZCTY64Z.js} +1 -1
- package/chunks/{chunk-QLX4D55R.js → chunk-B5TJK7B3.js} +1 -1
- package/chunks/{chunk-HXMDDII6.js → chunk-B6RMK4ED.js} +4 -4
- package/chunks/{chunk-UCKM6KCJ.js → chunk-BHG3H6OZ.js} +1 -1
- package/chunks/{chunk-JLF2AQAL.js → chunk-BHVF3R6B.js} +7 -5
- package/chunks/{chunk-HFJSQ4GL.js → chunk-BTICBRPL.js} +1 -1
- package/chunks/{chunk-KZCK5JUN.js → chunk-C3T6HPNM.js} +1 -1
- package/chunks/{chunk-FCLMJS6N.js → chunk-CDDP4ONL.js} +164 -27
- package/chunks/{chunk-Y3ZXDBUL.js → chunk-CQPM66MG.js} +4 -4
- package/chunks/{chunk-WKVZES7O.js → chunk-CXONOVBN.js} +1 -1
- package/chunks/{chunk-TYBRGFYL.js → chunk-CXY6BICQ.js} +501 -479
- package/chunks/{chunk-W23HOFDK.js → chunk-D3KVGQUV.js} +1 -1
- package/chunks/{chunk-LMJSPC55.js → chunk-D7JMO2GP.js} +3 -7
- package/chunks/{chunk-CXXAZ2LZ.js → chunk-DC4ZNGH4.js} +1 -1
- package/chunks/{chunk-FMLBBXHB.js → chunk-DRAX5YAI.js} +2 -2
- package/chunks/{chunk-DOTF2PF2.js → chunk-DRD6VBNH.js} +1 -1
- package/chunks/chunk-DX6JTDMR.js +105 -0
- package/chunks/{chunk-MNRK6MIH.js → chunk-E2VSBAFA.js} +53 -11
- package/chunks/{chunk-QJKR2P2K.js → chunk-EIBECN2J.js} +3 -3
- package/chunks/{chunk-LWWRJRCD.js → chunk-ESBYWATJ.js} +1 -1
- package/chunks/{chunk-3544ZEGZ.js → chunk-FASYATAZ.js} +5 -7
- package/chunks/{chunk-6YUS5JCV.js → chunk-FBY32737.js} +4 -4
- package/chunks/{chunk-LBWIJ5T7.js → chunk-FCPJXKDG.js} +10 -7
- package/chunks/{chunk-FX6GJIPZ.js → chunk-FEDFZBGR.js} +3 -3
- package/chunks/{chunk-DQ4LBRZN.js → chunk-FIJODK52.js} +3 -3
- package/chunks/{chunk-HVSRWLOW.js → chunk-FX6PZBOV.js} +3 -3
- package/chunks/{chunk-L6DIANLD.js → chunk-G45B3INR.js} +1 -1
- package/chunks/{chunk-EYLUKEYW.js → chunk-GI7SLDOI.js} +2 -2
- package/chunks/chunk-GJKP6XOB.js +1092 -0
- package/chunks/{chunk-I6YJZGHS.js → chunk-GSAOVDTH.js} +9 -9
- package/chunks/{chunk-XK4UQSIR.js → chunk-H6L4NEAT.js} +1 -1
- package/chunks/{chunk-GMCEFKNR.js → chunk-HNFKYKHH.js} +103 -22
- package/chunks/{chunk-6XDB3FR4.js → chunk-HX4WXX3H.js} +301 -138
- package/chunks/{chunk-HG46TTAG.js → chunk-HXUI5D4H.js} +1 -1
- package/chunks/{chunk-QI4WBHPF.js → chunk-HYHSMTRA.js} +4 -4
- package/chunks/{chunk-ZUKC5J6Q.js → chunk-IKBEIDOH.js} +14 -14
- package/chunks/{chunk-LCAJ63TF.js → chunk-INN5ORKX.js} +1 -1
- package/chunks/{chunk-GNV2SFO7.js → chunk-IVFTLUZD.js} +26 -1
- package/chunks/{chunk-GNKSR3FU.js → chunk-IXO2OCIP.js} +2 -2
- package/chunks/{chunk-SNT634Q6.js → chunk-K4XMAIRX.js} +30 -33
- package/chunks/{chunk-WBP64MZR.js → chunk-KAYC5FBN.js} +5269 -2785
- package/chunks/chunk-KEM7MWS7.js +3541 -0
- package/chunks/{chunk-ADQUK6WA.js → chunk-KVC7HZWK.js} +1 -1
- package/chunks/{chunk-UQXURNLM.js → chunk-KVQ3QL4K.js} +3 -3
- package/chunks/{chunk-7U5G6JXI.js → chunk-KWYTSSTJ.js} +105 -6
- package/chunks/{chunk-Q4G2YPI4.js → chunk-L2A5VBDL.js} +3019 -2352
- package/chunks/{chunk-WD6YQI5M.js → chunk-L3SNMEDW.js} +1 -1
- package/chunks/{chunk-BYUAT5OC.js → chunk-L7TJUPNR.js} +19 -3
- package/chunks/{chunk-ABNX6E6K.js → chunk-LFKXIOGC.js} +1 -1
- package/chunks/{chunk-GFAK6DYU.js → chunk-LO2UWNO5.js} +2 -2
- package/chunks/{chunk-67ZDP7UX.js → chunk-M22WLKLI.js} +5 -5
- package/chunks/{chunk-54B2LTKP.js → chunk-M23GFJ5B.js} +24 -5
- package/chunks/{chunk-VGY2RGXL.js → chunk-M4U2LTD2.js} +1 -1
- package/chunks/{chunk-ZNI3YJHS.js → chunk-MFDKHGTD.js} +1 -1
- package/chunks/{chunk-R7OO56VZ.js → chunk-MMRGG6R4.js} +1 -1
- package/chunks/{chunk-E6IR653O.js → chunk-MO4XID7S.js} +1 -1
- package/chunks/{chunk-NJ4ZNDVP.js → chunk-NKTMUPHJ.js} +3 -6
- package/chunks/{chunk-4DTFTPTU.js → chunk-NQ272MQG.js} +1 -1
- package/chunks/{chunk-DWKFTUGI.js → chunk-OALXNGUA.js} +6 -6
- package/chunks/{chunk-FBDHP23D.js → chunk-OSG23MR3.js} +1 -1
- package/chunks/{chunk-NJ2OFVUX.js → chunk-P42KMMU6.js} +860 -1
- package/chunks/{chunk-5KJ54DY3.js → chunk-PF7GAP6K.js} +60 -58
- package/chunks/{chunk-MQRLLBMQ.js → chunk-PPJSG2PU.js} +2 -2
- package/chunks/{chunk-EPVEPTI3.js → chunk-PZRXWQUA.js} +753 -18
- package/chunks/{chunk-VI5UVPOB.js → chunk-Q54O3EIA.js} +30 -28
- package/chunks/{chunk-QTUQV33C.js → chunk-QGEISOJ2.js} +4 -4
- package/chunks/{chunk-XKRYQOHS.js → chunk-QHSOINX6.js} +2 -2
- package/chunks/{chunk-Z6Q7I37O.js → chunk-QIPLWW6Q.js} +1 -1
- package/chunks/chunk-QMENOK5T.js +1246 -0
- package/chunks/chunk-QT6Z2IBF.js +347 -0
- package/chunks/{chunk-TBSCTWKF.js → chunk-RN6A53UJ.js} +25 -0
- package/chunks/{chunk-E7ZTAOJZ.js → chunk-RRI764F7.js} +21 -19
- package/chunks/{chunk-YI2YCNSP.js → chunk-SENYKRII.js} +1 -1
- package/chunks/chunk-SFHX5G2S.js +2796 -0
- package/chunks/chunk-SK3RZOPS.js +34 -0
- package/chunks/{chunk-SKYOAH4Z.js → chunk-SOLRBF7L.js} +13 -9
- package/chunks/{chunk-5WLF44DS.js → chunk-SSWTA7CH.js} +12 -12
- package/chunks/{chunk-IAS753HG.js → chunk-SYMXYRM5.js} +11 -2
- package/chunks/{chunk-FGROOEKM.js → chunk-TDKUXSJO.js} +34 -6
- package/chunks/{chunk-ZJ7JQUGY.js → chunk-TKF4JINY.js} +1 -1
- package/chunks/{chunk-ZOQ6HC7U.js → chunk-TPY6HW55.js} +4 -4
- package/chunks/{chunk-EDB556X7.js → chunk-TRZ22SG5.js} +1 -1
- package/chunks/{chunk-FHSOZSBO.js → chunk-TXTCM3TC.js} +4 -4
- package/chunks/{chunk-5ODRE7E5.js → chunk-U4AASWUQ.js} +28 -12
- package/chunks/{chunk-PPE7VUMD.js → chunk-UQGRJTDK.js} +2 -2
- package/chunks/{chunk-JO67LVXW.js → chunk-UZSB57EV.js} +6 -8
- package/chunks/{chunk-UY4OCBX4.js → chunk-V4JJAVHQ.js} +2 -2
- package/chunks/chunk-VEXUA6DX.js +1026 -0
- package/chunks/{chunk-ME4JBHSB.js → chunk-VQDWCQOE.js} +2 -0
- package/chunks/{chunk-ZC75SULX.js → chunk-VU3XMZ5I.js} +23 -4
- package/chunks/{chunk-A2UYI473.js → chunk-WL36KHUQ.js} +6 -6
- package/chunks/{chunk-IWOJ2FHG.js → chunk-WNQIJTOP.js} +8 -8
- package/chunks/{chunk-IANIY25T.js → chunk-WSJI6ODG.js} +99 -30
- package/chunks/{chunk-3CKAOJ4L.js → chunk-WZWTY7SG.js} +6 -6
- package/chunks/{chunk-EKMJR7M3.js → chunk-X7AYIXC7.js} +1 -1
- package/chunks/{chunk-IBRQG2MP.js → chunk-XAJZFGD2.js} +11 -11
- package/chunks/{chunk-VRQZESKP.js → chunk-XICCGDWF.js} +2 -2
- package/chunks/{chunk-L5R4D5T4.js → chunk-Y2KJC55Y.js} +12 -7
- package/chunks/{chunk-2S2WIGCM.js → chunk-Y4NNIGYO.js} +1 -1
- package/chunks/{chunk-J7LBAKDH.js → chunk-YL3UJML3.js} +7 -7
- package/chunks/{chunk-GSS4SZNG.js → chunk-YP2K3WOS.js} +40 -56
- package/chunks/{chunk-ZZUXUBEB.js → chunk-YQQ2U7AS.js} +8 -5
- package/chunks/{chunk-FAWTMDX7.js → chunk-YXHY6BKS.js} +15 -0
- package/chunks/{chunk-FIP5QS2U.js → chunk-YZXSDPOQ.js} +140 -39
- package/chunks/{chunk-WATHOB6X.js → chunk-ZFHKUQZ4.js} +3 -3
- package/chunks/{chunk-R5OA3ONY.js → chunk-ZMYKNKET.js} +6 -6
- package/chunks/{codex-subagent-executor-LANZAZPH.js → codex-subagent-executor-AEAIQZDC.js} +48 -49
- package/chunks/{config-utils-CRK2LQPA.js → config-utils-KX2YS725.js} +43 -46
- package/chunks/{contextCommand-GY5X3LIY.js → contextCommand-RV6Y5LNJ.js} +41 -44
- package/chunks/{core-runtime-IJIV2LHP.js → core-runtime-ZI4RTOJQ.js} +45 -48
- package/chunks/{create-sub-session-MNIVRHGB.js → create-sub-session-BBWFQARJ.js} +46 -48
- package/chunks/{daemon-NJB4PWZ7.js → daemon-INCM4VBX.js} +3 -1
- package/chunks/{daemon-git-worktree-guard-W6Z2BGDH.js → daemon-git-worktree-guard-KECEMV6A.js} +39 -42
- package/chunks/{daemon-status-provider-TJF3APU3.js → daemon-status-provider-NULJNAEV.js} +53 -56
- package/chunks/{daemon-trust-policy-6INCISDU.js → daemon-trust-policy-S4KWGPV3.js} +47 -50
- package/chunks/{daemon-trust-policy-monitor-JRTAQG54.js → daemon-trust-policy-monitor-546N5ZVL.js} +47 -50
- package/chunks/{de-VGY3VNBU.js → de-6AVKPTXQ.js} +11 -0
- package/chunks/{deferred-core-runtime-2JRTPTNM.js → deferred-core-runtime-T23ZT443.js} +39 -42
- package/chunks/{dist-NIOJXMGY.js → dist-4P3ZJYGI.js} +1 -1
- package/chunks/{dist-VDLSBCLM.js → dist-7MGRENQ5.js} +1 -1
- package/chunks/{dist-SE4J6Z4O.js → dist-BNW423XT.js} +326 -77
- package/chunks/{dist-TFGETXFN.js → dist-CESMUYGN.js} +4 -4
- package/chunks/{dist-MPUZZOG5.js → dist-DBBOFWSC.js} +1 -1
- package/chunks/{dist-T6DDPDLQ.js → dist-G5UMXIGF.js} +1 -1
- package/chunks/{dist-PA7WPFVE.js → dist-UXVNLQHG.js} +3 -3
- package/chunks/{dist-GUB7QRYA.js → dist-VA4LREAQ.js} +2 -2
- package/chunks/{dist-2QYIVNS6.js → dist-XDRTR4QP.js} +1 -1
- package/chunks/{edit-JDIXXCYB.js → edit-CMSQB7NP.js} +27 -30
- package/chunks/{en-E5ZO5TZW.js → en-56QLKXS2.js} +23 -1
- package/chunks/{enter-worktree-CAARFWBI.js → enter-worktree-DA6A4XC5.js} +3 -3
- package/chunks/{enterPlanMode-YTNTBZBN.js → enterPlanMode-UDPMNESD.js} +27 -30
- package/chunks/{environment-UAI5L52V.js → environment-TSQJUTPV.js} +42 -45
- package/chunks/{errors-J4UCDCW5.js → errors-RIVYJS6T.js} +41 -44
- package/chunks/{exit-worktree-JXGGUOBP.js → exit-worktree-4H6Z2VQI.js} +3 -3
- package/chunks/{exitPlanMode-YMWJ2EO7.js → exitPlanMode-BYBBFN2T.js} +27 -30
- package/chunks/{fast-path-MBAN7TK3.js → fast-path-F2CYDDZ4.js} +4 -4
- package/chunks/{fast-path-settings-XDYX7X5Z.js → fast-path-settings-N2VGRGDJ.js} +2 -2
- package/chunks/{fr-UAZJJH5N.js → fr-EBUDHJL3.js} +11 -0
- package/chunks/{glob-YEM24E3Z.js → glob-Z2JMJKKN.js} +27 -30
- package/chunks/{goal-tools-LJIVH5T6.js → goal-tools-HXVVLGCV.js} +27 -30
- package/chunks/{handleAutoUpdate-DYCSYDYL.js → handleAutoUpdate-FZP45KOR.js} +43 -46
- package/chunks/{i18n-PTAV7SN3.js → i18n-OTB62AKW.js} +40 -43
- package/chunks/{image-gen-5G2TQ3DY.js → image-gen-HIAZCB5T.js} +6 -7
- package/chunks/{initializer-MPXTKQA4.js → initializer-4JXZEC4B.js} +47 -50
- package/chunks/{installationInfo-U5EFA3OL.js → installationInfo-2IJV5QKC.js} +39 -42
- package/chunks/{ja-2RITCMAJ.js → ja-NCDT4CGV.js} +11 -0
- package/chunks/{list-YOE25QUI.js → list-KQSQ4A5G.js} +50 -53
- package/chunks/{llm-ZZ2WNQMC.js → llm-LSUBOJAR.js} +154 -974
- package/chunks/{llm-content-generator-CG2HRJZC.js → llm-content-generator-MLIONRXE.js} +17 -12
- package/chunks/{loadedSettingsAdapter-NPGWGURF.js → loadedSettingsAdapter-TZTTNRHI.js} +47 -50
- package/chunks/{loggingContentGenerator-TUL6SJVL.js → loggingContentGenerator-TUPEXFMM.js} +31 -34
- package/chunks/{loop-wakeup-VG6CGBQA.js → loop-wakeup-ZBVRI6VH.js} +1 -1
- package/chunks/{managed-npm-update-YUDSCJP3.js → managed-npm-update-WEA5XMFZ.js} +40 -43
- package/chunks/{mcp-EX3GDQVO.js → mcp-TFDTUPIA.js} +47 -50
- package/chunks/{model-configuration-6DEKTXJI.js → model-configuration-ZCAKKIOF.js} +48 -51
- package/chunks/{modelConfigUtils-4NA2MHEE.js → modelConfigUtils-J3ZPW7ZK.js} +41 -44
- package/chunks/{monitor-PPUGNAWR.js → monitor-CI7YE7MT.js} +29 -32
- package/chunks/{nonInteractiveCli-6TW2XYP5.js → nonInteractiveCli-GPT3TVOK.js} +96 -98
- package/chunks/{notebook-edit-4MUXHZHT.js → notebook-edit-3WCVRNGL.js} +27 -30
- package/chunks/{openaiContentGenerator-5J73W5XZ.js → openaiContentGenerator-OGILGUZE.js} +12 -17
- package/chunks/{openaiResponsesContentGenerator-AWRYZLJU.js → openaiResponsesContentGenerator-NXOXUPFM.js} +45 -13
- package/chunks/{pidfile-M7WELKBB.js → pidfile-GBTBIGHF.js} +39 -42
- package/chunks/{process-registry-X6ZCASEN.js → process-registry-7LAPI3ZB.js} +1 -1
- package/chunks/{processUtils-SPRINFNY.js → processUtils-O4II3RYH.js} +2 -2
- package/chunks/{prompt-terminal-ledger-25BRD7FX.js → prompt-terminal-ledger-ILIXZI3E.js} +40 -43
- package/chunks/{pt-5ZF7ZQUV.js → pt-FYYFWYUC.js} +11 -0
- package/chunks/{qwenContentGenerator-H5AAKXPC.js → qwenContentGenerator-I4LRYADV.js} +33 -36
- package/chunks/{qwenOAuth2-WIEUEFEY.js → qwenOAuth2-3J66TOT5.js} +6 -7
- package/chunks/{read-file-ILGEFPB3.js → read-file-G4XKW2CS.js} +5 -9
- package/chunks/{record-artifact-PXMNP7GZ.js → record-artifact-L3CFJOMA.js} +2 -2
- package/chunks/{report-findings-W6GR7SYZ.js → report-findings-LY5HQY4K.js} +3 -3
- package/chunks/{resumeHistoryUtils-RB52QOCH.js → resumeHistoryUtils-YPJU4XFE.js} +44 -47
- package/chunks/{ripGrep-O6QAFHQK.js → ripGrep-AAKMALLM.js} +7 -11
- package/chunks/{ru-7BNZFQKG.js → ru-RHEB3RNS.js} +11 -0
- package/chunks/{run-qwen-serve-5NO3TKUL.js → run-qwen-serve-ZVEKGS7Y.js} +177 -98
- package/chunks/{runtime-G2YUYMSZ.js → runtime-SJCRYNPA.js} +52 -55
- package/chunks/safe-mode-KLGUG54M.js +11 -0
- package/chunks/sandbox-UIXL423Z.js +146 -0
- package/chunks/sandboxConfig-CY343YNJ.js +114 -0
- package/chunks/{scheduled-tasks-HDHV3URA.js → scheduled-tasks-5UGBEVNZ.js} +50 -53
- package/chunks/{scheduler-6MDJX2ZK.js → scheduler-GCZYLZ2P.js} +41 -44
- package/chunks/{sdk-exporters-http-3R2TRQHE.js → sdk-exporters-http-DR4G663K.js} +1 -1
- package/chunks/{sdk-impl-4WF3VZ2F.js → sdk-impl-SJR26MQF.js} +3 -3
- package/chunks/{send-message-UMJKN27Q.js → send-message-DN76MXDX.js} +6 -6
- package/chunks/{serve-Z2EJQYKB.js → serve-2XXQLVK2.js} +48 -51
- package/chunks/{server-JTNBK3LH.js → server-UHMKPCAZ.js} +408 -211
- package/chunks/{session-5YK2BXH4.js → session-ZLUK7E4P.js} +108 -108
- package/chunks/{session-attachments-root-QO3VFJS6.js → session-attachments-root-DHQM5IEZ.js} +39 -42
- package/chunks/{session-pr-refresh-OTK3HCJZ.js → session-pr-refresh-3OMTQWCZ.js} +48 -51
- package/chunks/{settings-2VKLACYV.js → settings-P4DHIIUP.js} +50 -53
- package/chunks/{shell-64NAVGMS.js → shell-IMFUVQQ5.js} +27 -30
- package/chunks/{skill-R3ALMLLM.js → skill-NB5RJGZW.js} +7 -11
- package/chunks/{skill-settings-HZ34TUMP.js → skill-settings-IXG5CTQO.js} +47 -50
- package/chunks/{spawnChannel-XGFWHEIK.js → spawnChannel-Q3YALTCJ.js} +44 -45
- package/chunks/{standalone-update-R32Y3XRR.js → standalone-update-H5OJ7MM7.js} +41 -44
- package/chunks/{start-opentui-ui-YGJOUE2H.js → start-opentui-ui-JKAIWGF7.js} +733 -386
- package/chunks/{startInteractiveUI-5ZEVKSFF.js → startInteractiveUI-YRPOT6GH.js} +370 -337
- package/chunks/task-create-75HVPEAH.js +1 -1
- package/chunks/{team-create-GCVUXJLE.js → team-create-2XTBYRJF.js} +31 -34
- package/chunks/{team-plan-approval-NOL62FJD.js → team-plan-approval-CFNWW7ZQ.js} +27 -30
- package/chunks/{terminal-image-renderer-WG5TLPGC.js → terminal-image-renderer-UDPJPGPQ.js} +39 -42
- package/chunks/{theme-manager-HDS4YFPW.js → theme-manager-SK57EKMO.js} +39 -42
- package/chunks/{tool-search-HMT5GYUR.js → tool-search-ZHTJU2MV.js} +5 -9
- package/chunks/{total-session-admission-Y5RCHEXO.js → total-session-admission-UUZBDQCG.js} +47 -50
- package/chunks/{tree-sitter-LSORDVZ3.js → tree-sitter-4D7QS7F6.js} +1 -1
- package/chunks/{tree-sitter-bash-UARELQ6C.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
- package/chunks/{trustedFolders-3Y2WCXMR.js → trustedFolders-4LDBLNTS.js} +40 -43
- package/chunks/{update-relaunch-MTJ32SLF.js → update-relaunch-LI7GRP36.js} +5 -5
- package/chunks/{updateCheck-YFX3VY6O.js → updateCheck-PKSSORPO.js} +43 -46
- package/chunks/{useAutoAcceptIndicator-FCHNQPMD.js → useAutoAcceptIndicator-I32UEQPI.js} +50 -53
- package/chunks/{validateNonInterActiveAuth-HUFQKCGG.js → validateNonInterActiveAuth-YFPCYYNL.js} +93 -95
- package/chunks/{version-S5TGWCA3.js → version-4MTL4JVU.js} +1 -1
- package/chunks/{web-fetch-23M7BYHB.js → web-fetch-O6RG6ISB.js} +9 -13
- package/chunks/{web-search-F5PNIQUA.js → web-search-JHAXVEMD.js} +9 -14
- package/chunks/{web-shell-static-T7UGLVE4.js → web-shell-static-FFWCUUZS.js} +8 -4
- package/chunks/{workflow-BLJLID2C.js → workflow-O7L6VDYU.js} +396 -113
- package/chunks/{workspace-providers-status-UH7KLZDT.js → workspace-providers-status-WRX6CJM4.js} +53 -56
- package/chunks/{workspace-registration-store-3SA3V7BA.js → workspace-registration-store-7G4E7YPY.js} +1 -1
- package/chunks/{workspace-registry-C6C6EKQ5.js → workspace-registry-SXIMGT4D.js} +47 -50
- package/chunks/{workspace-runtime-coordinator-RAI6XDJB.js → workspace-runtime-coordinator-7DOEHXYT.js} +47 -50
- package/chunks/{workspace-service-H7UTJYJU.js → workspace-service-HDXOZMYC.js} +53 -56
- package/chunks/{workspace-skills-status-FPVC7XXK.js → workspace-skills-status-VN4L37CA.js} +50 -53
- package/chunks/{workspace-trust-reconciler-JS7A6UIF.js → workspace-trust-reconciler-XEBW5FUL.js} +57 -60
- package/chunks/{write-file-GQGG7NBQ.js → write-file-LKX4ETIO.js} +29 -32
- package/chunks/{zh-V2EYTYJP.js → zh-F76MZTL3.js} +23 -1
- package/chunks/{zh-TW-7PRVUGLW.js → zh-TW-S3YTQ4DS.js} +23 -1
- package/chunks/{zoom-image-EC43KL4H.js → zoom-image-RDPRTP4B.js} +5 -9
- package/cli.js +19 -15
- package/export-transcript-document.css +1 -1
- package/export-transcript-document.js +151 -150
- package/locales/ca.js +19 -2
- package/locales/de.js +18 -0
- package/locales/en.js +33 -2
- package/locales/fr.js +18 -0
- package/locales/ja.js +18 -0
- package/locales/pt.js +18 -0
- package/locales/ru.js +18 -0
- package/locales/zh-TW.js +33 -2
- package/locales/zh.js +33 -2
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-BtpzKw3A.js → abnfDiagram-VCTEODGH-RxykUDmi.js} +1 -1
- package/web-shell/assets/{arc-CQiVKZJP.js → arc-CZpgGCJC.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-ekIPBb2d.js → architectureDiagram-5GKGNRK7-BHSMzNDT.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-BrRWkWri.js → blockDiagram-NRAW4CY4-Bn4mF9SZ.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-qYS8CYZ3.js → c4Diagram-UCG6FXSJ-CBM-Bj6t.js} +1 -1
- package/web-shell/assets/channel-DFYs_LlK.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-ZasyyEZm.js → chunk-2Q5K7J3B-D5Fin58O.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-C_IzCGeA.js → chunk-5VM5RSS4-CY05weF7.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-C25NZOyD.js → chunk-F27PBJKO-3neZnj5Y.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-XPOHNSGX.js → chunk-G27WJ6UU-Cd7EU4BE.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-BQBh0Xni.js → chunk-JWPE2WC7-DwK1mqFw.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-CoShjpX7.js → chunk-LCL6LL3I-Sl7vY22C.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-BwRmCDSz.js → chunk-POPQ4Y6H-BXNzpbVg.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DSzE5-Mw.js → chunk-SVP7TREG-DjjButcp.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-BQSQv30h.js → chunk-XXDRQBXY-DNOiCjOJ.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-XVUVTHVo.js → cose-bilkent-JH36ORCC-BUnker7a.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-CrsKx4lQ.js → cynefin-OW5HDTMX-DcUgdWE5.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BPeZEuHw.js → cynefinDiagram-5FMLGOSQ-CvDKsZsL.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-D31cQ2Qs.js → dagre-3AP2YEHR-jpCmUbr1.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-zyiG097Q.js → diagram-S7CK7UJ4-DBe_bKE5.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-Br3vtfsy.js → diagram-UQ7AKVKN-oXvPpDgs.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-Bxkhjx4u.js → diagram-VSXAHHWV-BD7-_SGh.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-BQH8QiDk.js → diagram-VX7I27RA-DOJL0wub.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-B_aQ1cw0.js → diagram-Z3DM3KII-DRIiodDD.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-B9N7BRQE.js → ebnfDiagram-PWID7BFC-Db31Ulmb.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-Cx6Hb1Re.js → erDiagram-SSCWMZ5O-CVHhwI2_.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-DTuLP7GU.js → flowDiagram-A5DVABFB-DWOFy1FK.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-DYS3d-sL.js → ganttDiagram-EL5Y4UJY-C0sxQtPd.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-Cp0EGx04.js → gitGraphDiagram-WWUBYQGX-CNituBYC.js} +1 -1
- package/web-shell/assets/index-B15NlwB8.js +2213 -0
- package/web-shell/assets/index-BSrS0tQ6.css +36 -0
- package/web-shell/assets/{index-45-LkPDB.js → index-gm9tLk7h.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-9--kukiT.js → infoDiagram-RXCK75RN-CxhJYtIR.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CGBdsDLD.js → ishikawaDiagram-5VMMS53U-By2mchUy.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-DeXhcscd.js → journeyDiagram-EYS64GPL-CVH-OweI.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-CFdvsU3b.js → kanban-definition-3QL26DDD-Cc9dQXLy.js} +1 -1
- package/web-shell/assets/knowledge-Dg9788h4.svg +1 -0
- package/web-shell/assets/{layout-DAnwQ3KB.js → layout-C_60ysHw.js} +1 -1
- package/web-shell/assets/{linear-CTo7v7Nh.js → linear-BvAVfqwu.js} +1 -1
- package/web-shell/assets/{mermaid.core-jggSxF1i.js → mermaid.core-C3CoBKAc.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-DzIepvlJ.js → mindmap-definition-FBJOCRG2-Cuu8Q8LM.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-BFGS9GJv.js → pegDiagram-XKGWAZYB-DmAeyDO2.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-B2UUcNIT.js → pieDiagram-E7YTZNPT-B7vbB_xv.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BgM6htrX.js → quadrantDiagram-AXDQQJYC-BqOBkRR7.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-Dk9cS7N-.js → railroadDiagram-O6MQD6OU-sI06lZIu.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C9oRg7xi.js → requirementDiagram-EFPCY7ZU-Bg13d10S.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-B-_c7GzI.js → sankeyDiagram-P5KCCOFB-WFOzZHrR.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-R0M-347u.js → sequenceDiagram-WJ2MYXX4-CCdRbA4E.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-Df0f8UAW.js → sizeCapture-X5ZJPWSS-BH5F3bGg.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-CsUEfAA-.js → stateDiagram-HBIQ2CUA-NwS2X3QB.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-9OGHVSrx.js → swimlanes-XN3QIQJK-Bm38pM28.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-DAfGqS2B.js → timeline-definition-24CTP7MA-Do-agLSo.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-CKATpwHi.js → vennDiagram-4TSXK5OY-aggLfZzl.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CQHdhTrm.js → wardleyDiagram-VM6X3IG4-D5JR3mXX.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-5k9NLqlY.js → xychartDiagram-S5SC5T6Z-DhtLDuXs.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-4OQSG35W.js +0 -1416
- package/chunks/chunk-7MIBD3LG.js +0 -137
- package/chunks/chunk-ARDHE6MM.js +0 -235
- package/chunks/chunk-C75BXMPM.js +0 -169
- package/chunks/chunk-ERU3SDXT.js +0 -27
- package/chunks/chunk-FPGTNKCP.js +0 -251
- package/chunks/chunk-JIJ65YKA.js +0 -2812
- package/chunks/chunk-JL6APGBX.js +0 -43
- package/chunks/chunk-SGXJQP5Q.js +0 -4172
- package/chunks/chunk-TPEV2QHG.js +0 -514
- package/chunks/chunk-YVWS4SLL.js +0 -137
- package/web-shell/assets/channel-DSQQnOZj.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-V94ta08R.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-V94ta08R.js +0 -1
- package/web-shell/assets/index-H8um-iEl.js +0 -2207
- package/web-shell/assets/index-n6N-2a3v.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CnSuTPJ2.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bb7TcWQw.js +0 -8
- package/chunks/{chunk-QZW6WRB7.js → chunk-5NUKK2DT.js} +2 -2
- package/chunks/{chunk-JS73NNWF.js → chunk-FUSEMYFX.js} +0 -0
- package/chunks/{chunk-SVWWF5TZ.js → chunk-WVURIAEE.js} +3 -3
- package/chunks/{task-update-RI7QNVDP.js → task-update-3LSYQDRW.js} +4 -4
|
@@ -8,13 +8,16 @@ import {
|
|
|
8
8
|
import "./chunk-K6KS3LTN.js";
|
|
9
9
|
import "./chunk-OSHQMOBS.js";
|
|
10
10
|
import {
|
|
11
|
+
BackgroundOutputCoordinator,
|
|
11
12
|
ChannelBase,
|
|
13
|
+
ChannelOutputTurn,
|
|
12
14
|
isTerminalTaskLifecycleType,
|
|
15
|
+
parseChannelOutputMode,
|
|
13
16
|
sanitizeLogText,
|
|
14
17
|
sanitizePromptText,
|
|
15
18
|
sanitizeSenderName,
|
|
16
19
|
truncateUtf16Units
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PZRXWQUA.js";
|
|
18
21
|
import "./chunk-IJOS26LH.js";
|
|
19
22
|
import "./chunk-CQ35AJ4Z.js";
|
|
20
23
|
import "./chunk-DMTGGOSA.js";
|
|
@@ -6690,10 +6693,10 @@ var STATUS_CARD_TEMPLATE_ID = "675cde2f-f526-40cb-b828-f5b2b57b8b77.schema";
|
|
|
6690
6693
|
var QUESTION_CARD_TEMPLATE_ID = "c2a6355b-9724-4f7e-9653-d33fcb3311bb.schema";
|
|
6691
6694
|
var DINGTALK_API = "https://api.dingtalk.com";
|
|
6692
6695
|
var CARD_FETCH_TIMEOUT_MS = 1e4;
|
|
6693
|
-
function
|
|
6696
|
+
function isRetryableDingtalkStatus(status) {
|
|
6694
6697
|
return status === 408 || status === 425 || status === 429 || status >= 500 && status <= 599;
|
|
6695
6698
|
}
|
|
6696
|
-
__name(
|
|
6699
|
+
__name(isRetryableDingtalkStatus, "isRetryableDingtalkStatus");
|
|
6697
6700
|
var DingtalkCardRequestError = class extends Error {
|
|
6698
6701
|
static {
|
|
6699
6702
|
__name(this, "DingtalkCardRequestError");
|
|
@@ -6800,7 +6803,7 @@ var DingtalkInteractiveCardClient = class {
|
|
|
6800
6803
|
}
|
|
6801
6804
|
if (!response.ok) {
|
|
6802
6805
|
const detail = (await response.text().catch(() => "")).slice(0, 300);
|
|
6803
|
-
throw new DingtalkCardRequestError(`DingTalk Card OpenAPI ${method} ${path} failed${templateId ? ` for ${templateId}` : ""}: HTTP ${response.status}${detail ? ` ${detail}` : ""}`,
|
|
6806
|
+
throw new DingtalkCardRequestError(`DingTalk Card OpenAPI ${method} ${path} failed${templateId ? ` for ${templateId}` : ""}: HTTP ${response.status}${detail ? ` ${detail}` : ""}`, isRetryableDingtalkStatus(response.status));
|
|
6804
6807
|
}
|
|
6805
6808
|
return response.json().catch(() => void 0);
|
|
6806
6809
|
}
|
|
@@ -6976,6 +6979,17 @@ function isChinesePresentationLanguage(language) {
|
|
|
6976
6979
|
return normalized === "zh" || normalized === "zh-cn";
|
|
6977
6980
|
}
|
|
6978
6981
|
__name(isChinesePresentationLanguage, "isChinesePresentationLanguage");
|
|
6982
|
+
function partialOutputLabel(language) {
|
|
6983
|
+
return isChinesePresentationLanguage(language) ? "\uFF08\u90E8\u5206\uFF09" : "(partial)";
|
|
6984
|
+
}
|
|
6985
|
+
__name(partialOutputLabel, "partialOutputLabel");
|
|
6986
|
+
function markPartialOutput(text, language) {
|
|
6987
|
+
const label = partialOutputLabel(language);
|
|
6988
|
+
return !text.trim() || text.startsWith(label) ? text : `${label}
|
|
6989
|
+
|
|
6990
|
+
${text}`;
|
|
6991
|
+
}
|
|
6992
|
+
__name(markPartialOutput, "markPartialOutput");
|
|
6979
6993
|
function presentationPhaseLabel(phase, language) {
|
|
6980
6994
|
return (isChinesePresentationLanguage(language) ? DINGTALK_ZH_PRESENTATION_PHASE_LABELS : DINGTALK_PRESENTATION_PHASE_LABELS)[phase];
|
|
6981
6995
|
}
|
|
@@ -7074,6 +7088,38 @@ var StatusCardController = class {
|
|
|
7074
7088
|
constructor(options) {
|
|
7075
7089
|
this.options = options;
|
|
7076
7090
|
}
|
|
7091
|
+
async deliverCompletedResult(target, text, sourceLabel, result = { status: "completed" }) {
|
|
7092
|
+
const content = sourceLabel ? `${escapeDingTalkMarkdown(sourceLabel)}
|
|
7093
|
+
|
|
7094
|
+
${text}` : text;
|
|
7095
|
+
if (this.disposed || !text.trim() || content.length > CONTENT_LIMIT) {
|
|
7096
|
+
return false;
|
|
7097
|
+
}
|
|
7098
|
+
const state = result.status === "failed" ? "Failed" : result.status === "stopped" ? "Stopped" : result.status === "cancelled" ? "Cancelled" : result.partial || result.status !== "completed" ? "Partial" : "Completed";
|
|
7099
|
+
try {
|
|
7100
|
+
await this.options.client.createAndDeliver({
|
|
7101
|
+
templateId: STATUS_CARD_TEMPLATE_ID,
|
|
7102
|
+
outTrackId: `qwen-result-${randomUUID2()}`,
|
|
7103
|
+
target,
|
|
7104
|
+
cardParamMap: this.terminalCardParams(content, [this.statusStateLabel(state), this.options.model?.trim()].filter(Boolean).join(" \xB7 "))
|
|
7105
|
+
});
|
|
7106
|
+
return true;
|
|
7107
|
+
} catch (error) {
|
|
7108
|
+
this.options.onError?.("completed result card", error);
|
|
7109
|
+
return false;
|
|
7110
|
+
}
|
|
7111
|
+
}
|
|
7112
|
+
terminalCardParams(content, statusLine) {
|
|
7113
|
+
return {
|
|
7114
|
+
blockList: JSON.stringify([{ type: 0, markdown: content }]),
|
|
7115
|
+
content,
|
|
7116
|
+
copy_content: content,
|
|
7117
|
+
flowStatus: 3,
|
|
7118
|
+
statusLine,
|
|
7119
|
+
hasAction: "false",
|
|
7120
|
+
stop_action: "false"
|
|
7121
|
+
};
|
|
7122
|
+
}
|
|
7077
7123
|
ensure(segment, target) {
|
|
7078
7124
|
if (this.disposed)
|
|
7079
7125
|
return;
|
|
@@ -7226,8 +7272,8 @@ var StatusCardController = class {
|
|
|
7226
7272
|
});
|
|
7227
7273
|
return record;
|
|
7228
7274
|
}
|
|
7229
|
-
complete(segmentId, text, retainedContent) {
|
|
7230
|
-
return this.finalize(segmentId, boundContent(text), "Completed", false, retainedContent);
|
|
7275
|
+
complete(segmentId, text, retainedContent, partial = false) {
|
|
7276
|
+
return this.finalize(segmentId, boundContent(text), partial ? "Partial" : "Completed", false, retainedContent);
|
|
7231
7277
|
}
|
|
7232
7278
|
updateRunPhase(runId, phase) {
|
|
7233
7279
|
if (this.disposed)
|
|
@@ -7465,20 +7511,7 @@ var StatusCardController = class {
|
|
|
7465
7511
|
try {
|
|
7466
7512
|
await this.options.client.updateInstance({
|
|
7467
7513
|
outTrackId: record.outTrackId,
|
|
7468
|
-
cardParamMap:
|
|
7469
|
-
blockList: JSON.stringify([
|
|
7470
|
-
{
|
|
7471
|
-
type: 0,
|
|
7472
|
-
markdown: intent.content
|
|
7473
|
-
}
|
|
7474
|
-
]),
|
|
7475
|
-
content: intent.content,
|
|
7476
|
-
copy_content: intent.content,
|
|
7477
|
-
flowStatus: 3,
|
|
7478
|
-
statusLine: intent.statusLine,
|
|
7479
|
-
hasAction: "false",
|
|
7480
|
-
stop_action: "false"
|
|
7481
|
-
}
|
|
7514
|
+
cardParamMap: this.terminalCardParams(intent.content, intent.statusLine)
|
|
7482
7515
|
});
|
|
7483
7516
|
record.content = "";
|
|
7484
7517
|
this.removeRecord(record);
|
|
@@ -7592,7 +7625,8 @@ var StatusCardController = class {
|
|
|
7592
7625
|
Completed: "\u5DF2\u5B8C\u6210",
|
|
7593
7626
|
Failed: "\u5DF2\u5931\u8D25",
|
|
7594
7627
|
Stopped: "\u5DF2\u7EC8\u6B62",
|
|
7595
|
-
Cancelled: "\u5DF2\u53D6\u6D88"
|
|
7628
|
+
Cancelled: "\u5DF2\u53D6\u6D88",
|
|
7629
|
+
Partial: "\u90E8\u5206\u7ED3\u679C"
|
|
7596
7630
|
}[state] ?? state;
|
|
7597
7631
|
}
|
|
7598
7632
|
async updateRunningStatus(record) {
|
|
@@ -8299,7 +8333,7 @@ var DingtalkInteractionPresenter = class {
|
|
|
8299
8333
|
constructor(options) {
|
|
8300
8334
|
this.options = options;
|
|
8301
8335
|
}
|
|
8302
|
-
registerRun(runId, ownerId, target, sessionId = "", sender, sourceLabel) {
|
|
8336
|
+
registerRun(runId, ownerId, target, sessionId = "", sender, sourceLabel, sendFallback) {
|
|
8303
8337
|
this.runs.set(runId, {
|
|
8304
8338
|
runId,
|
|
8305
8339
|
ownerId,
|
|
@@ -8319,8 +8353,10 @@ var DingtalkInteractionPresenter = class {
|
|
|
8319
8353
|
sourceLabel
|
|
8320
8354
|
},
|
|
8321
8355
|
projectionChain: Promise.resolve(),
|
|
8356
|
+
output: new ChannelOutputTurn(this.options.outputMode),
|
|
8322
8357
|
...target.isGroup && sender ? formatSenderPrefixes(sender) : {},
|
|
8323
8358
|
...sourceLabel ? { sourceLabel } : {},
|
|
8359
|
+
...sendFallback ? { sendFallback } : {},
|
|
8324
8360
|
terminal: false
|
|
8325
8361
|
});
|
|
8326
8362
|
}
|
|
@@ -8352,14 +8388,20 @@ var DingtalkInteractionPresenter = class {
|
|
|
8352
8388
|
const presentation = existing ?? {
|
|
8353
8389
|
run,
|
|
8354
8390
|
context: segment,
|
|
8355
|
-
content: ""
|
|
8391
|
+
content: "",
|
|
8392
|
+
preview: "",
|
|
8393
|
+
visible: false
|
|
8356
8394
|
};
|
|
8357
|
-
presentation.content
|
|
8395
|
+
presentation.content += chunk;
|
|
8396
|
+
presentation.preview = this.boundContent(presentation.preview + chunk);
|
|
8397
|
+
presentation.visible ||= chunk.trim().length > 0;
|
|
8358
8398
|
this.segments.set(segment.segmentId, presentation);
|
|
8359
8399
|
run.activeSegmentId = segment.segmentId;
|
|
8360
|
-
|
|
8400
|
+
if (!run.output.shouldPreview(presentation.visible ? "visible" : ""))
|
|
8401
|
+
return;
|
|
8361
8402
|
void this.enqueue(run, () => {
|
|
8362
|
-
|
|
8403
|
+
const statusContext = this.ensureStatusContext(run, segment);
|
|
8404
|
+
this.options.statusCards?.replace(statusContext, this.cardTarget(statusContext.target), this.withSourcePrefix(run, presentation.preview));
|
|
8363
8405
|
});
|
|
8364
8406
|
}
|
|
8365
8407
|
closeOutput(segmentId, text, reason, segment) {
|
|
@@ -8379,52 +8421,46 @@ var DingtalkInteractionPresenter = class {
|
|
|
8379
8421
|
run.activeSegmentId = void 0;
|
|
8380
8422
|
}
|
|
8381
8423
|
return this.enqueue(run, async () => {
|
|
8424
|
+
const decision = run.output.close(text || presentation.content, reason);
|
|
8425
|
+
if (decision.kind === "skip")
|
|
8426
|
+
return true;
|
|
8382
8427
|
const statusCards = this.options.statusCards;
|
|
8383
8428
|
const statusContext = this.ensureStatusContext(run, presentation.context);
|
|
8384
|
-
if (
|
|
8429
|
+
if (decision.kind === "failed") {
|
|
8385
8430
|
statusCards?.ensure(statusContext, this.cardTarget(statusContext.target));
|
|
8386
8431
|
statusCards?.fail(statusContext.segmentId, this.withSenderPrefix(run, "\u672C\u6B21\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"));
|
|
8387
8432
|
await this.redeliverCardDeliveredContent(run);
|
|
8388
8433
|
return statusCards !== void 0;
|
|
8389
8434
|
}
|
|
8390
|
-
if (
|
|
8435
|
+
if (decision.kind === "cancelled") {
|
|
8391
8436
|
return statusCards !== void 0;
|
|
8392
8437
|
}
|
|
8393
|
-
if (
|
|
8438
|
+
if (decision.kind === "preview") {
|
|
8394
8439
|
const deliveredViaCard = statusCards !== void 0 && await statusCards.isCardLive(statusContext.segmentId) && await statusCards.flushPending(statusContext.segmentId);
|
|
8395
8440
|
if (deliveredViaCard) {
|
|
8396
8441
|
run.cardDelivered = {
|
|
8397
|
-
text: stripPartialImageMarker(text
|
|
8442
|
+
text: stripPartialImageMarker(decision.text),
|
|
8398
8443
|
chatId: presentation.context.target.chatId,
|
|
8399
8444
|
sessionId: presentation.context.sessionId
|
|
8400
8445
|
};
|
|
8401
|
-
return true;
|
|
8402
8446
|
}
|
|
8403
|
-
|
|
8404
|
-
if (!fallbackText2 || !this.options.sendFallback)
|
|
8405
|
-
return false;
|
|
8406
|
-
await this.sendFallback(run, presentation.context.target.chatId, fallbackText2, presentation.context.sessionId);
|
|
8407
|
-
statusCards?.abandon(statusContext.segmentId);
|
|
8447
|
+
run.lastOutputContext = presentation.context;
|
|
8408
8448
|
return true;
|
|
8409
8449
|
}
|
|
8410
|
-
if (
|
|
8411
|
-
|
|
8412
|
-
run.statusContext = void 0;
|
|
8413
|
-
if (completed2)
|
|
8414
|
-
return true;
|
|
8415
|
-
const fallbackText2 = stripPartialImageMarker(text || presentation.content);
|
|
8416
|
-
if (!fallbackText2 || !this.options.sendFallback)
|
|
8417
|
-
return false;
|
|
8418
|
-
await this.sendFallback(run, presentation.context.target.chatId, fallbackText2, presentation.context.sessionId);
|
|
8419
|
-
statusCards?.abandon(statusContext.segmentId);
|
|
8420
|
-
return true;
|
|
8450
|
+
if (!decision.rotate) {
|
|
8451
|
+
statusCards?.ensure(statusContext, this.cardTarget(statusContext.target));
|
|
8421
8452
|
}
|
|
8422
|
-
|
|
8423
|
-
const
|
|
8453
|
+
let output = this.options.prepareOutput ? await this.options.prepareOutput(presentation.context.target.chatId, decision.text) : decision.text;
|
|
8454
|
+
const partial = segment?.partial ?? presentation.context.partial;
|
|
8455
|
+
if (partial)
|
|
8456
|
+
output = markPartialOutput(output, this.options.language);
|
|
8457
|
+
const completed = statusCards !== void 0 && await statusCards.complete(statusContext.segmentId, this.withSenderPrefix(run, output), void 0, partial);
|
|
8458
|
+
if (decision.rotate)
|
|
8459
|
+
run.statusContext = void 0;
|
|
8424
8460
|
if (completed)
|
|
8425
8461
|
return true;
|
|
8426
|
-
const fallbackText = stripPartialImageMarker(
|
|
8427
|
-
if (!fallbackText || !this.options.sendFallback)
|
|
8462
|
+
const fallbackText = stripPartialImageMarker(output);
|
|
8463
|
+
if (!fallbackText || !(run.sendFallback ?? this.options.sendFallback))
|
|
8428
8464
|
return false;
|
|
8429
8465
|
await this.sendFallback(run, presentation.context.target.chatId, fallbackText, presentation.context.sessionId);
|
|
8430
8466
|
statusCards?.abandon(statusContext.segmentId);
|
|
@@ -8480,6 +8516,7 @@ var DingtalkInteractionPresenter = class {
|
|
|
8480
8516
|
}
|
|
8481
8517
|
const copy = this.terminalCopy();
|
|
8482
8518
|
const finalization = this.enqueue(run, async () => {
|
|
8519
|
+
const finalOutput = run.output.finish(terminal);
|
|
8483
8520
|
if (terminal === "failed") {
|
|
8484
8521
|
const statusContext = this.ensureStatusContext(run);
|
|
8485
8522
|
this.options.statusCards?.ensure(statusContext, this.cardTarget(statusContext.target));
|
|
@@ -8495,7 +8532,12 @@ var DingtalkInteractionPresenter = class {
|
|
|
8495
8532
|
} else {
|
|
8496
8533
|
const statusContext = run.statusContext;
|
|
8497
8534
|
if (statusContext) {
|
|
8498
|
-
|
|
8535
|
+
const context = run.lastOutputContext ?? run.baseContext;
|
|
8536
|
+
const output = finalOutput && this.options.prepareOutput ? await this.options.prepareOutput(context.target.chatId, finalOutput) : finalOutput;
|
|
8537
|
+
const completed = await this.options.statusCards?.complete(statusContext.segmentId, output ? this.withSenderPrefix(run, output) : "", (retained) => retained ? this.withSenderPrefix(run, this.withoutRenderedSourcePrefix(run, retained)) : retained);
|
|
8538
|
+
if (!completed && output) {
|
|
8539
|
+
await this.sendFallback(run, context.target.chatId, stripPartialImageMarker(output), context.sessionId);
|
|
8540
|
+
}
|
|
8499
8541
|
}
|
|
8500
8542
|
}
|
|
8501
8543
|
});
|
|
@@ -8535,7 +8577,7 @@ var DingtalkInteractionPresenter = class {
|
|
|
8535
8577
|
*/
|
|
8536
8578
|
async redeliverCardDeliveredContent(run) {
|
|
8537
8579
|
const delivered = run.cardDelivered;
|
|
8538
|
-
if (!delivered || !this.options.sendFallback)
|
|
8580
|
+
if (!delivered || !(run.sendFallback ?? this.options.sendFallback))
|
|
8539
8581
|
return;
|
|
8540
8582
|
run.cardDelivered = void 0;
|
|
8541
8583
|
await this.sendFallback(run, delivered.chatId, delivered.text, delivered.sessionId);
|
|
@@ -8580,13 +8622,14 @@ var DingtalkInteractionPresenter = class {
|
|
|
8580
8622
|
${this.boundContent(content, Math.max(0, CONTENT_LIMIT - sourceLabel.length - 2))}`;
|
|
8581
8623
|
}
|
|
8582
8624
|
async sendFallback(run, chatId, text, sessionId) {
|
|
8583
|
-
|
|
8625
|
+
const sendFallback = run.sendFallback ?? this.options.sendFallback;
|
|
8626
|
+
if (!sendFallback)
|
|
8584
8627
|
return;
|
|
8585
8628
|
if (run.sourceLabel) {
|
|
8586
|
-
await
|
|
8629
|
+
await sendFallback(chatId, text, sessionId, run.sourceLabel);
|
|
8587
8630
|
return;
|
|
8588
8631
|
}
|
|
8589
|
-
await
|
|
8632
|
+
await sendFallback(chatId, text, sessionId);
|
|
8590
8633
|
}
|
|
8591
8634
|
withoutExistingSenderPrefix(run, content) {
|
|
8592
8635
|
const prefixes = /* @__PURE__ */ new Set([run.senderPrefix, run.senderRawPrefix]);
|
|
@@ -9044,6 +9087,34 @@ async function withConnectLoggingSuppressed(connect) {
|
|
|
9044
9087
|
}
|
|
9045
9088
|
}
|
|
9046
9089
|
__name(withConnectLoggingSuppressed, "withConnectLoggingSuppressed");
|
|
9090
|
+
var ProactiveTextDeliveryError = class extends Error {
|
|
9091
|
+
static {
|
|
9092
|
+
__name(this, "ProactiveTextDeliveryError");
|
|
9093
|
+
}
|
|
9094
|
+
plan;
|
|
9095
|
+
retryable;
|
|
9096
|
+
constructor(plan, cause) {
|
|
9097
|
+
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
|
9098
|
+
this.plan = plan;
|
|
9099
|
+
if (cause instanceof DingtalkCardRequestError) {
|
|
9100
|
+
this.retryable = cause.retryable;
|
|
9101
|
+
}
|
|
9102
|
+
}
|
|
9103
|
+
};
|
|
9104
|
+
var ReplyTextDeliveryError = class extends Error {
|
|
9105
|
+
static {
|
|
9106
|
+
__name(this, "ReplyTextDeliveryError");
|
|
9107
|
+
}
|
|
9108
|
+
plan;
|
|
9109
|
+
retryable;
|
|
9110
|
+
constructor(plan, cause) {
|
|
9111
|
+
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
|
9112
|
+
this.plan = plan;
|
|
9113
|
+
if (cause instanceof DingtalkCardRequestError) {
|
|
9114
|
+
this.retryable = cause.retryable;
|
|
9115
|
+
}
|
|
9116
|
+
}
|
|
9117
|
+
};
|
|
9047
9118
|
var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
9048
9119
|
static {
|
|
9049
9120
|
__name(this, "DingtalkChannel");
|
|
@@ -9064,7 +9135,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9064
9135
|
reactionStates = /* @__PURE__ */ new Map();
|
|
9065
9136
|
/** sessionId → reaction keys, so a dead session's reactions can be recalled. */
|
|
9066
9137
|
sessionReactionKeys = /* @__PURE__ */ new Map();
|
|
9067
|
-
/** Settles
|
|
9138
|
+
/** Settles after background output and reaction cleanup finish on disconnect. */
|
|
9068
9139
|
disconnectDrain;
|
|
9069
9140
|
/**
|
|
9070
9141
|
* Real inbound message ids (insertion-ordered, size-capped). Unlike the
|
|
@@ -9078,6 +9149,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9078
9149
|
*/
|
|
9079
9150
|
proactiveToken;
|
|
9080
9151
|
interactiveCardConfig;
|
|
9152
|
+
outputMode;
|
|
9081
9153
|
interactiveCardClient;
|
|
9082
9154
|
statusCardController;
|
|
9083
9155
|
questionCardController;
|
|
@@ -9090,6 +9162,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9090
9162
|
// boundary, input requested) mints a fresh segment UUID but the projection
|
|
9091
9163
|
// state must survive it, or a marker split across the reset leaks.
|
|
9092
9164
|
fileProjectors = /* @__PURE__ */ new Map();
|
|
9165
|
+
backgroundOutputCoordinator;
|
|
9093
9166
|
constructor(name, config, bridge, options) {
|
|
9094
9167
|
super(name, config, bridge, options);
|
|
9095
9168
|
this.atSender = config["atSender"] === true;
|
|
@@ -9108,6 +9181,16 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9108
9181
|
this.config.instructions += FILE_INSTRUCTIONS;
|
|
9109
9182
|
}
|
|
9110
9183
|
this.interactiveCardConfig = parseDingtalkInteractiveCardConfig(config.interactiveCards);
|
|
9184
|
+
this.outputMode = parseChannelOutputMode(name, config.outputMode, true);
|
|
9185
|
+
this.backgroundOutputCoordinator = new BackgroundOutputCoordinator({
|
|
9186
|
+
outputMode: this.outputMode,
|
|
9187
|
+
getTarget: /* @__PURE__ */ __name((sessionId) => this.router.getTarget(sessionId), "getTarget"),
|
|
9188
|
+
getSourceLabel: /* @__PURE__ */ __name((sessionId) => this.getBackgroundResponseSourceLabel(sessionId), "getSourceLabel"),
|
|
9189
|
+
resolveDelivery: /* @__PURE__ */ __name((sessionId) => this.resolveBackgroundResponseDelivery(sessionId), "resolveDelivery"),
|
|
9190
|
+
createDelivery: /* @__PURE__ */ __name((sessionId, target) => this.createBackgroundOutputDelivery(sessionId, target), "createDelivery"),
|
|
9191
|
+
isRetryableError: /* @__PURE__ */ __name((error) => !((error instanceof ProactiveTextDeliveryError || error instanceof ReplyTextDeliveryError || error instanceof DingtalkCardRequestError) && error.retryable === false), "isRetryableError"),
|
|
9192
|
+
log: /* @__PURE__ */ __name((message) => process.stderr.write(`[DingTalk:${this.name}] ${message}`), "log")
|
|
9193
|
+
});
|
|
9111
9194
|
if (!config.clientId || !config.clientSecret) {
|
|
9112
9195
|
throw new Error(`Channel "${name}" requires clientId and clientSecret for DingTalk.`);
|
|
9113
9196
|
}
|
|
@@ -9163,16 +9246,16 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9163
9246
|
}, "onError")
|
|
9164
9247
|
});
|
|
9165
9248
|
}
|
|
9166
|
-
if (this.statusCardController || this.questionCardController || this.permissionCardController) {
|
|
9167
|
-
this.interactionPresenter = new DingtalkInteractionPresenter({
|
|
9168
|
-
statusCards: this.statusCardController,
|
|
9169
|
-
questionCards: this.questionCardController,
|
|
9170
|
-
permissionCards: this.permissionCardController,
|
|
9171
|
-
...options?.displayLanguage ? { language: options.displayLanguage } : {},
|
|
9172
|
-
sendFallback: /* @__PURE__ */ __name((chatId, text, sessionId, sourceLabel) => this.sendFallbackReply(chatId, text, sessionId, sourceLabel), "sendFallback")
|
|
9173
|
-
});
|
|
9174
|
-
}
|
|
9175
9249
|
}
|
|
9250
|
+
this.interactionPresenter = new DingtalkInteractionPresenter({
|
|
9251
|
+
outputMode: this.outputMode,
|
|
9252
|
+
prepareOutput: /* @__PURE__ */ __name((chatId, text) => this.prepareReplyOutput(chatId, text), "prepareOutput"),
|
|
9253
|
+
statusCards: this.statusCardController,
|
|
9254
|
+
questionCards: this.questionCardController,
|
|
9255
|
+
permissionCards: this.permissionCardController,
|
|
9256
|
+
...options?.displayLanguage ? { language: options.displayLanguage } : {},
|
|
9257
|
+
sendFallback: /* @__PURE__ */ __name((chatId, text, sessionId, sourceLabel) => this.sendFallbackReply(chatId, text, sessionId, sourceLabel), "sendFallback")
|
|
9258
|
+
});
|
|
9176
9259
|
if (useConnectionManager) {
|
|
9177
9260
|
this.connectionManager = new DingtalkConnectionManager({
|
|
9178
9261
|
initialClient: this.client,
|
|
@@ -9519,18 +9602,25 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9519
9602
|
}
|
|
9520
9603
|
return replaceImageMarkers(text, markers, replacements);
|
|
9521
9604
|
}
|
|
9522
|
-
async sendReply(chatId, text, atUserId, sourceLabel, prepared = false) {
|
|
9605
|
+
async sendReply(chatId, text, atUserId, sourceLabel, prepared = false, failOnHttpError = false) {
|
|
9523
9606
|
const webhook = this.webhooks.get(chatId);
|
|
9524
9607
|
if (!webhook) {
|
|
9525
9608
|
process.stderr.write(`[DingTalk:${this.name}] No webhook for chatId ${chatId}, cannot send.
|
|
9526
9609
|
`);
|
|
9610
|
+
if (failOnHttpError) {
|
|
9611
|
+
throw new Error("DingTalk session webhook unavailable");
|
|
9612
|
+
}
|
|
9527
9613
|
return;
|
|
9528
9614
|
}
|
|
9529
9615
|
const outgoingText = prepared ? text : await this.prepareReplyOutput(chatId, text);
|
|
9530
9616
|
if (!outgoingText.trim())
|
|
9531
9617
|
return;
|
|
9532
9618
|
const plan = this.createReplyTextDelivery(outgoingText, atUserId, sourceLabel);
|
|
9533
|
-
|
|
9619
|
+
try {
|
|
9620
|
+
await this.deliverReplyText(chatId, plan, failOnHttpError);
|
|
9621
|
+
} catch (error) {
|
|
9622
|
+
throw new ReplyTextDeliveryError(plan, error);
|
|
9623
|
+
}
|
|
9534
9624
|
}
|
|
9535
9625
|
createReplyTextDelivery(outgoingText, atUserId, sourceLabel) {
|
|
9536
9626
|
const mentionPrefix = atUserId ? `@${atUserId}
|
|
@@ -9551,9 +9641,12 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9551
9641
|
...atUserId ? { atUserId } : {}
|
|
9552
9642
|
};
|
|
9553
9643
|
}
|
|
9554
|
-
async deliverReplyText(chatId, plan) {
|
|
9644
|
+
async deliverReplyText(chatId, plan, failOnHttpError = false) {
|
|
9555
9645
|
const webhook = this.webhooks.get(chatId);
|
|
9556
9646
|
if (!webhook) {
|
|
9647
|
+
if (failOnHttpError) {
|
|
9648
|
+
throw new Error("DingTalk session webhook unavailable");
|
|
9649
|
+
}
|
|
9557
9650
|
return;
|
|
9558
9651
|
}
|
|
9559
9652
|
while (plan.nextChunk < plan.chunks.length) {
|
|
@@ -9593,6 +9686,19 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9593
9686
|
const detail = await resp.text().catch(() => "");
|
|
9594
9687
|
process.stderr.write(`[DingTalk:${this.name}] sendMessage failed: HTTP ${resp.status} ${detail}
|
|
9595
9688
|
`);
|
|
9689
|
+
if (failOnHttpError) {
|
|
9690
|
+
throw new DingtalkCardRequestError(`DingTalk reply send failed: HTTP ${resp.status} ${detail}`, isRetryableDingtalkStatus(resp.status));
|
|
9691
|
+
}
|
|
9692
|
+
} else if (failOnHttpError) {
|
|
9693
|
+
const payload = await resp.clone().json().catch(() => void 0);
|
|
9694
|
+
const response = payload && typeof payload === "object" ? payload : void 0;
|
|
9695
|
+
const value = response?.["errcode"] ?? response?.["code"];
|
|
9696
|
+
if (value !== void 0 && String(value) !== "0") {
|
|
9697
|
+
const detail = sanitizeLogText(String(response?.["errmsg"] ?? response?.["message"] ?? value), 300);
|
|
9698
|
+
process.stderr.write(`[DingTalk:${this.name}] sendMessage failed: ${detail}
|
|
9699
|
+
`);
|
|
9700
|
+
throw new Error(`DingTalk reply send failed: ${detail}`);
|
|
9701
|
+
}
|
|
9596
9702
|
}
|
|
9597
9703
|
plan.nextChunk++;
|
|
9598
9704
|
}
|
|
@@ -9627,7 +9733,11 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9627
9733
|
const plan = await this.createProactiveTextDelivery(target, text, sourceLabel);
|
|
9628
9734
|
if (!plan)
|
|
9629
9735
|
return;
|
|
9630
|
-
|
|
9736
|
+
try {
|
|
9737
|
+
await this.deliverProactiveText(target, plan);
|
|
9738
|
+
} catch (error) {
|
|
9739
|
+
throw new ProactiveTextDeliveryError(plan, error);
|
|
9740
|
+
}
|
|
9631
9741
|
}
|
|
9632
9742
|
async createProactiveTextDelivery(target, text, sourceLabel) {
|
|
9633
9743
|
const outgoingText = await this.prepareFileOutput(text, (file, mediaId) => this.sendProactiveFile(target, file, mediaId));
|
|
@@ -9746,7 +9856,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9746
9856
|
const detail = sanitizeLogText(await resp.text().catch(() => ""), 300);
|
|
9747
9857
|
process.stderr.write(`[DingTalk:${this.name}] proactive send failed (${targetKind}, ${chunkLabel}): HTTP ${resp.status} ${detail}
|
|
9748
9858
|
`);
|
|
9749
|
-
throw new
|
|
9859
|
+
throw new DingtalkCardRequestError(`DingTalk proactive send failed: HTTP ${resp.status}${detail ? ` ${detail}` : ""}`, isRetryableDingtalkStatus(resp.status));
|
|
9750
9860
|
}
|
|
9751
9861
|
if (target.isGroup === true) {
|
|
9752
9862
|
if (msgKey !== PROACTIVE_FILE_MSG_KEY) {
|
|
@@ -9861,7 +9971,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9861
9971
|
for (const state of reactionStates) {
|
|
9862
9972
|
this.finishReaction(state.chatId, state.messageId, state.sessionId);
|
|
9863
9973
|
}
|
|
9864
|
-
this.
|
|
9974
|
+
const backgroundDrain = this.backgroundOutputCoordinator.drain();
|
|
9865
9975
|
this.activeReactionKeys.clear();
|
|
9866
9976
|
this.sessionReactionKeys.clear();
|
|
9867
9977
|
this.reactionStates.clear();
|
|
@@ -9872,7 +9982,12 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9872
9982
|
}
|
|
9873
9983
|
process.stderr.write(`[DingTalk:${this.name}] Disconnected.
|
|
9874
9984
|
`);
|
|
9875
|
-
this.disconnectDrain = Promise.allSettled(
|
|
9985
|
+
this.disconnectDrain = Promise.allSettled([
|
|
9986
|
+
backgroundDrain,
|
|
9987
|
+
...reactionStates.map((state) => state.tail)
|
|
9988
|
+
]).then(() => {
|
|
9989
|
+
this.statusCardController?.dispose();
|
|
9990
|
+
});
|
|
9876
9991
|
}
|
|
9877
9992
|
waitForDisconnect() {
|
|
9878
9993
|
return this.disconnectDrain ?? Promise.resolve();
|
|
@@ -10110,6 +10225,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10110
10225
|
}
|
|
10111
10226
|
}
|
|
10112
10227
|
this.sessionMentionTargets.delete(sessionId);
|
|
10228
|
+
this.backgroundOutputCoordinator.drain(sessionId);
|
|
10113
10229
|
const cardRunId = this.cardRunBySession.get(sessionId);
|
|
10114
10230
|
if (cardRunId) {
|
|
10115
10231
|
this.cardRunBySession.delete(sessionId);
|
|
@@ -10133,6 +10249,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10133
10249
|
* the sessions on a fresh bridge.
|
|
10134
10250
|
*/
|
|
10135
10251
|
onBridgeDisconnected() {
|
|
10252
|
+
void this.backgroundOutputCoordinator.drain();
|
|
10136
10253
|
for (const [sessionId, keys] of this.sessionReactionKeys) {
|
|
10137
10254
|
this.sessionReactionKeys.delete(sessionId);
|
|
10138
10255
|
for (const { messageId, chatId } of keys.values()) {
|
|
@@ -10145,6 +10262,9 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10145
10262
|
this.cardRuns.delete(runId);
|
|
10146
10263
|
}
|
|
10147
10264
|
}
|
|
10265
|
+
onSessionRetiring(sessionId) {
|
|
10266
|
+
this.backgroundOutputCoordinator.drain(sessionId);
|
|
10267
|
+
}
|
|
10148
10268
|
onTaskLifecycle(event) {
|
|
10149
10269
|
if (event.type === "started") {
|
|
10150
10270
|
this.startReaction(event.chatId, event.messageId, event.sessionId);
|
|
@@ -10155,7 +10275,8 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10155
10275
|
this.cardRuns.set(event.runId, inboundOwner);
|
|
10156
10276
|
this.cardRunBySession.set(event.sessionId, event.runId);
|
|
10157
10277
|
const sourceLabel = this.getResponseSourceLabel(event.sessionId);
|
|
10158
|
-
this.
|
|
10278
|
+
const atUserId = this.atSender && event.messageId ? this.mentionTargets.get(event.messageId) : void 0;
|
|
10279
|
+
this.interactionPresenter?.registerRun(event.runId, event.owner.id, inboundOwner.target, event.sessionId, inboundOwner.sender, sourceLabel, (chatId, text, _sessionId, label) => this.sendReply(chatId, text, atUserId, label));
|
|
10159
10280
|
this.interactionPresenter?.startStatusCard(event.runId);
|
|
10160
10281
|
}
|
|
10161
10282
|
return;
|
|
@@ -10281,11 +10402,138 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10281
10402
|
this.sessionMentionTargets.delete(sessionId);
|
|
10282
10403
|
this.stopReaction(chatId, messageId, sessionId);
|
|
10283
10404
|
}
|
|
10284
|
-
async
|
|
10405
|
+
async dispatchBackgroundResponse(sessionId, text, context) {
|
|
10406
|
+
const target = this.router.getTarget(sessionId);
|
|
10407
|
+
if (!target || target.channelName !== this.name) {
|
|
10408
|
+
return super.dispatchBackgroundResponse(sessionId, text, context);
|
|
10409
|
+
}
|
|
10410
|
+
if (await this.backgroundOutputCoordinator.dispatch(sessionId, text, context)) {
|
|
10411
|
+
return;
|
|
10412
|
+
}
|
|
10413
|
+
if (!text.trim())
|
|
10414
|
+
return;
|
|
10415
|
+
const delivery = await this.resolveBackgroundResponseDelivery(sessionId);
|
|
10416
|
+
if (!delivery || this.router.getTarget(sessionId) !== delivery.target)
|
|
10417
|
+
return;
|
|
10418
|
+
await this.deliverBackgroundResponseToTarget(sessionId, text, delivery, false, context);
|
|
10419
|
+
}
|
|
10420
|
+
createBackgroundOutputDelivery(sessionId, target) {
|
|
10421
|
+
let proactivePlan;
|
|
10422
|
+
let replyPlan;
|
|
10423
|
+
let preparedReplyBody;
|
|
10424
|
+
let composedHeader;
|
|
10425
|
+
let composedTurnComplete = false;
|
|
10426
|
+
return async (output) => {
|
|
10427
|
+
const header = this.formatBackgroundOutputHeader(output);
|
|
10428
|
+
const body = [header, output.text].filter(Boolean).join("\n\n");
|
|
10429
|
+
const plan = proactivePlan ?? replyPlan;
|
|
10430
|
+
if (!plan || plan.nextChunk === 0) {
|
|
10431
|
+
const replaceHeader = /* @__PURE__ */ __name((text) => {
|
|
10432
|
+
if (composedHeader === void 0 || composedHeader === header) {
|
|
10433
|
+
return text;
|
|
10434
|
+
}
|
|
10435
|
+
const separator = output.text ? "\n\n" : "";
|
|
10436
|
+
const previous = composedHeader ? `${composedHeader}${separator}` : "";
|
|
10437
|
+
const next = header ? `${header}${separator}` : "";
|
|
10438
|
+
return text.startsWith(previous) ? `${next}${text.slice(previous.length)}` : text;
|
|
10439
|
+
}, "replaceHeader");
|
|
10440
|
+
if (plan) {
|
|
10441
|
+
plan.title = extractTitle(body);
|
|
10442
|
+
const prefix = (replyPlan?.atUserId ? `@${replyPlan.atUserId}
|
|
10443
|
+
|
|
10444
|
+
` : "") + (target.sourceLabel ? `${escapeDingTalkMarkdown(target.sourceLabel)}
|
|
10445
|
+
|
|
10446
|
+
` : "");
|
|
10447
|
+
plan.chunks[0] = prefix + replaceHeader(plan.chunks[0].slice(prefix.length));
|
|
10448
|
+
}
|
|
10449
|
+
if (preparedReplyBody) {
|
|
10450
|
+
preparedReplyBody = replaceHeader(preparedReplyBody);
|
|
10451
|
+
}
|
|
10452
|
+
composedHeader = header;
|
|
10453
|
+
composedTurnComplete = output.turnComplete;
|
|
10454
|
+
}
|
|
10455
|
+
try {
|
|
10456
|
+
if (proactivePlan) {
|
|
10457
|
+
await this.deliverProactiveText(target.target, proactivePlan);
|
|
10458
|
+
} else if (replyPlan) {
|
|
10459
|
+
await this.deliverReplyText(target.target.chatId, replyPlan, true);
|
|
10460
|
+
} else {
|
|
10461
|
+
if (this.statusCardController || !this.supportsProactiveSend() || !this.supportsProactiveTarget(target.target)) {
|
|
10462
|
+
preparedReplyBody ??= await this.prepareBackgroundOutput(target.target, body);
|
|
10463
|
+
}
|
|
10464
|
+
await this.deliverBackgroundResponseToTarget(sessionId, preparedReplyBody ?? body, target, preparedReplyBody !== void 0, output);
|
|
10465
|
+
}
|
|
10466
|
+
return { turnComplete: composedTurnComplete };
|
|
10467
|
+
} catch (error) {
|
|
10468
|
+
if (error instanceof ProactiveTextDeliveryError) {
|
|
10469
|
+
proactivePlan = error.plan;
|
|
10470
|
+
} else if (error instanceof ReplyTextDeliveryError) {
|
|
10471
|
+
replyPlan = error.plan;
|
|
10472
|
+
}
|
|
10473
|
+
throw error;
|
|
10474
|
+
}
|
|
10475
|
+
};
|
|
10476
|
+
}
|
|
10477
|
+
formatBackgroundOutputHeader(delivery) {
|
|
10478
|
+
const chinese = isChinesePresentationLanguage(this.displayLanguage);
|
|
10479
|
+
const partialLabel = partialOutputLabel(this.displayLanguage);
|
|
10480
|
+
const icon = delivery.status === "completed" ? "\u2705" : delivery.status === "failed" ? "\u274C" : "\u23F9\uFE0F";
|
|
10481
|
+
if (delivery.kind === "agent") {
|
|
10482
|
+
if (delivery.text)
|
|
10483
|
+
return delivery.partial ? partialLabel : "";
|
|
10484
|
+
const status = delivery.status === "completed" ? chinese ? "\u5DF2\u5B8C\u6210" : "completed" : delivery.status === "failed" ? chinese ? "\u5931\u8D25" : "failed" : chinese ? "\u5DF2\u505C\u6B62" : "stopped";
|
|
10485
|
+
return chinese ? `${icon} \u540E\u53F0\u4EFB\u52A1${status}` : `${icon} Background task ${status}`;
|
|
10486
|
+
}
|
|
10487
|
+
const label = this.formatBackgroundTaskLabel(delivery.label);
|
|
10488
|
+
const kind = {
|
|
10489
|
+
shell: "Shell",
|
|
10490
|
+
monitor: "Monitor",
|
|
10491
|
+
workflow: "Workflow"
|
|
10492
|
+
}[delivery.kind];
|
|
10493
|
+
return `## ${icon} ${kind} \xB7 ${label}${delivery.partial ? `${chinese ? "" : " "}${partialLabel}` : ""}`;
|
|
10494
|
+
}
|
|
10495
|
+
formatBackgroundTaskLabel(label) {
|
|
10496
|
+
const normalized = label?.replace(new RegExp("\\p{Cc}+", "gu"), " ").replace(/\s+/g, " ").trim();
|
|
10497
|
+
return escapeDingTalkMarkdown(normalized || (isChinesePresentationLanguage(this.displayLanguage) ? "\u540E\u53F0\u4EFB\u52A1" : "Background task"));
|
|
10498
|
+
}
|
|
10499
|
+
prepareBackgroundOutput(target, text) {
|
|
10500
|
+
return this.supportsProactiveSend() && this.supportsProactiveTarget(target) ? this.prepareFileOutput(text, (file, mediaId) => this.sendProactiveFile(target, file, mediaId)) : this.prepareReplyOutput(target.chatId, text);
|
|
10501
|
+
}
|
|
10502
|
+
async deliverBackgroundResponseToTarget(sessionId, text, delivery, prepared = false, result) {
|
|
10503
|
+
const { target, sourceLabel } = delivery;
|
|
10504
|
+
if (this.statusCardController && this.supportsProactiveDeliveryTarget(target) && (target.isGroup === true || this.isStableTargetId(target.senderId))) {
|
|
10505
|
+
if (!prepared) {
|
|
10506
|
+
text = await this.prepareBackgroundOutput(target, text);
|
|
10507
|
+
prepared = true;
|
|
10508
|
+
}
|
|
10509
|
+
if (await this.statusCardController.deliverCompletedResult({
|
|
10510
|
+
chatId: target.isGroup ? target.chatId : target.senderId,
|
|
10511
|
+
isGroup: target.isGroup === true
|
|
10512
|
+
}, text, sourceLabel, result)) {
|
|
10513
|
+
return;
|
|
10514
|
+
}
|
|
10515
|
+
}
|
|
10516
|
+
if (this.supportsProactiveSend() && this.supportsProactiveTarget(target)) {
|
|
10517
|
+
return super.deliverBackgroundResponseToTarget(sessionId, text, delivery);
|
|
10518
|
+
}
|
|
10519
|
+
await this.deliverBackgroundReply(target.chatId, text, sessionId, sourceLabel, prepared, true);
|
|
10520
|
+
}
|
|
10521
|
+
/**
|
|
10522
|
+
* Body-identical to the base implementation — this override exists only to
|
|
10523
|
+
* widen the signature, which the base seam does not declare. The background
|
|
10524
|
+
* output delivery passes `prepared` so the body it already projected isn't
|
|
10525
|
+
* projected a second time (that would re-upload its files), and
|
|
10526
|
+
* `failOnHttpError` so a failed send throws instead of being swallowed,
|
|
10527
|
+
* letting the flush capture the delivery plan for the next retry.
|
|
10528
|
+
*/
|
|
10529
|
+
async deliverBackgroundReply(chatId, text, sessionId, sourceLabel, prepared = false, failOnHttpError = false) {
|
|
10530
|
+
await this.sendResponseMessage(chatId, text, sessionId, sourceLabel, prepared, failOnHttpError);
|
|
10531
|
+
}
|
|
10532
|
+
async sendResponseMessage(chatId, text, sessionId, sourceLabel, prepared = false, failOnHttpError = false) {
|
|
10285
10533
|
const atUserId = this.atSender ? this.sessionMentionTargets.get(sessionId) : void 0;
|
|
10286
10534
|
if (atUserId)
|
|
10287
10535
|
this.sessionMentionTargets.delete(sessionId);
|
|
10288
|
-
await this.sendReply(chatId, text, atUserId, sourceLabel ?? this.getResponseSourceLabel(sessionId), prepared);
|
|
10536
|
+
await this.sendReply(chatId, text, atUserId, sourceLabel ?? this.getResponseSourceLabel(sessionId), prepared, failOnHttpError);
|
|
10289
10537
|
}
|
|
10290
10538
|
async sendFallbackReply(chatId, text, sessionId, sourceLabel) {
|
|
10291
10539
|
const atUserId = this.atSender ? this.sessionMentionTargets.get(sessionId) : void 0;
|
|
@@ -10301,7 +10549,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10301
10549
|
return;
|
|
10302
10550
|
}
|
|
10303
10551
|
}
|
|
10304
|
-
await this.sendResponseMessage(chatId, outgoingText, sessionId, segment?.sourceLabel, true);
|
|
10552
|
+
await this.sendResponseMessage(chatId, segment?.partial ? markPartialOutput(outgoingText, this.displayLanguage) : outgoingText, sessionId, segment?.sourceLabel, true);
|
|
10305
10553
|
}
|
|
10306
10554
|
onOutputSegmentEnd(_chatId, _sessionId, segment, reason) {
|
|
10307
10555
|
if (reason === "completed" || reason === "failed" || reason === "cancelled") {
|
|
@@ -10727,6 +10975,7 @@ var plugin = {
|
|
|
10727
10975
|
channelType: "dingtalk",
|
|
10728
10976
|
displayName: "DingTalk",
|
|
10729
10977
|
requiredConfigFields: ["clientId", "clientSecret"],
|
|
10978
|
+
supportsOutputMode: true,
|
|
10730
10979
|
management: {
|
|
10731
10980
|
fields: [
|
|
10732
10981
|
{
|