@qwen-code/qwen-code 0.19.4 → 0.19.5-nightly.20260703.b16baf1ff
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/qc-helper/docs/configuration/settings.md +22 -6
- package/bundled/qc-helper/docs/features/commands.md +41 -34
- package/bundled/qc-helper/docs/features/headless.md +19 -18
- package/bundled/qc-helper/docs/qwen-serve.md +34 -0
- package/bundled/qc-helper/docs/support/troubleshooting.md +5 -0
- package/chunks/{MaxSizedBox-ERTNFI22.js → MaxSizedBox-42KZ5OFE.js} +12 -11
- package/chunks/{StandaloneSessionPicker-Y5NGRLRY.js → StandaloneSessionPicker-G4VTICMM.js} +23 -22
- package/chunks/{acpAgent-UMN6OYTR.js → acpAgent-6O25PA3M.js} +82 -78
- package/chunks/{agent-56DZU4ZU.js → agent-SNVTRNV7.js} +9 -8
- package/chunks/{agent-headless-SR7N2IJG.js → agent-headless-LNKVTSBX.js} +9 -8
- package/chunks/{anthropicContentGenerator-5OZFO6WQ.js → anthropicContentGenerator-WL3LJOUB.js} +99 -23
- package/chunks/{artifact-tool-JVZMHA4B.js → artifact-tool-W76WC2JX.js} +1 -1
- package/chunks/{askUserQuestion-CMJZ2F3D.js → askUserQuestion-J3P6TH3V.js} +1 -1
- package/chunks/{bridge-AUHNFOUS.js → bridge-AZZAYKI2.js} +15 -13
- package/chunks/{ca-RYOETBUW.js → ca-HCMB2I54.js} +1 -0
- package/chunks/channel-worker-supervisor-C2J3TIOV.js +665 -0
- package/chunks/{chunk-W2ZOAX7F.js → chunk-26UO4PLG.js} +3 -3
- package/chunks/chunk-2Z43HUXT.js +99 -0
- package/chunks/{chunk-VKGG724L.js → chunk-3GCPLNVF.js} +11 -10
- package/chunks/chunk-3RW4AZJV.js +5063 -0
- package/chunks/{chunk-6AQR7732.js → chunk-46IAL3RB.js} +1 -1
- package/chunks/{chunk-QAFQLTXG.js → chunk-4JWM2UGC.js} +1 -1
- package/chunks/{chunk-C2IHHGBZ.js → chunk-4PGQKUIV.js} +10 -10
- package/chunks/{chunk-PPFWEV7G.js → chunk-4RQIB5UZ.js} +62 -62
- package/chunks/{chunk-L7VH7HQA.js → chunk-4UEWG5AS.js} +29 -4
- package/chunks/{chunk-J3F7X3LW.js → chunk-5B2WNM6V.js} +1 -1
- package/chunks/{chunk-XCUFHOAD.js → chunk-6NHUWPNL.js} +1 -1
- package/chunks/{chunk-HI55Z6PR.js → chunk-7DMQRPC7.js} +401 -58
- package/chunks/{chunk-Q7VHIRDD.js → chunk-7K4G2H2H.js} +1 -1
- package/chunks/{chunk-W6X4FGWX.js → chunk-7XS7CMSU.js} +1 -1
- package/chunks/{chunk-SFN4TEHY.js → chunk-APTOAKV5.js} +4 -4
- package/chunks/{chunk-BNJLLAQ7.js → chunk-AYUVPH6L.js} +1 -1
- package/chunks/chunk-BPFJQGY7.js +193 -0
- package/chunks/{chunk-CUGEBAKG.js → chunk-C47IJLUT.js} +1 -1
- package/chunks/chunk-CXBG27SF.js +35 -0
- package/chunks/{chunk-UQFP2FEF.js → chunk-DG573EOO.js} +1 -1
- package/chunks/{chunk-ND25GXEU.js → chunk-DLJKEPXB.js} +14 -6
- package/chunks/{chunk-MNDTD5E5.js → chunk-DNJ2KHWN.js} +4 -4
- package/chunks/{chunk-KKQWC6WS.js → chunk-DNV4FSN5.js} +1 -1
- package/chunks/chunk-DOYHOG47.js +949 -0
- package/chunks/chunk-E2K45AJ7.js +5448 -0
- package/chunks/{chunk-75X2VLSH.js → chunk-F26BNXI2.js} +26 -5
- package/chunks/{chunk-6TLY5W3B.js → chunk-FB6LGUF4.js} +127 -23
- package/chunks/{chunk-UT5JU5DJ.js → chunk-FEPEMQR4.js} +42 -15
- package/chunks/{chunk-2X2JUE47.js → chunk-FKHE7ZNF.js} +2 -2
- package/chunks/{chunk-YBDZ63KI.js → chunk-FVRLDQ7T.js} +8 -4
- package/chunks/{chunk-DQ74W65K.js → chunk-HCLTQ3PV.js} +47 -20
- package/chunks/{chunk-BQNJBEUA.js → chunk-KFO6YNQT.js} +16 -2
- package/chunks/{chunk-UQYOMM6J.js → chunk-L4CYPEA7.js} +10 -10
- package/chunks/{chunk-MEQWZGK5.js → chunk-L7OJ3ZO3.js} +1 -1
- package/chunks/chunk-LOEYAC6N.js +86 -0
- package/chunks/{chunk-4VZH35PN.js → chunk-MTNTVOJR.js} +2 -0
- package/chunks/{chunk-6CIIP6OE.js → chunk-O2EZ4VRP.js} +3 -3
- package/chunks/{chunk-ZJP5T7IA.js → chunk-ODPWORQZ.js} +1 -1
- package/chunks/{chunk-TTFNVEO5.js → chunk-P5GH4DTN.js} +3 -3
- package/chunks/{chunk-7KPI4LAI.js → chunk-QURP4S5U.js} +3 -3
- package/chunks/{chunk-UANCYOOQ.js → chunk-R6RI2HIC.js} +1 -1
- package/chunks/{chunk-FYKX6XOT.js → chunk-RBLDOR7U.js} +1 -1
- package/chunks/{chunk-EDAGQADF.js → chunk-S6RLAIUR.js} +2 -0
- package/chunks/chunk-SIUQ3YYX.js +78 -0
- package/chunks/{chunk-GICCHL2Q.js → chunk-STP6AYKH.js} +1 -1
- package/chunks/{chunk-HJDF3ZVU.js → chunk-UEGNXWAX.js} +6 -6
- package/chunks/{chunk-PIYV6COW.js → chunk-UTWYG2WA.js} +1 -1
- package/chunks/{chunk-QMIND2AS.js → chunk-UY2TCIZS.js} +15 -1
- package/chunks/{chunk-CG7SVARK.js → chunk-VDIZBM46.js} +2 -2
- package/chunks/{chunk-73H73ASU.js → chunk-VJSWLYUL.js} +1 -1
- package/chunks/{chunk-FNLXLI4I.js → chunk-WMLQKZ64.js} +2 -2
- package/chunks/{chunk-KVPFPC4J.js → chunk-WSAAEPPQ.js} +14 -14
- package/chunks/{chunk-BFG6OZN7.js → chunk-WWOVV2PW.js} +3742 -2737
- package/chunks/{chunk-MKHC4BYZ.js → chunk-XAVV2JAM.js} +21 -5
- package/chunks/{chunk-ZXCVPMIK.js → chunk-XR7W5VRL.js} +167 -54
- package/chunks/{chunk-CS5XYDBO.js → chunk-XS7IHJ63.js} +5 -5
- package/chunks/{chunk-B7KGXIPZ.js → chunk-YCU7QV7Q.js} +11 -4
- package/chunks/{chunk-OJCECIJA.js → chunk-YHTNWGRR.js} +5 -4
- package/chunks/{chunk-7VPC7D7O.js → chunk-YLQSGKAN.js} +2 -2
- package/chunks/{chunk-OAFUMTWW.js → chunk-Z75MFQFL.js} +2 -2
- package/chunks/{chunk-HRZB5CSC.js → chunk-ZRHHQFV4.js} +1 -1
- package/chunks/{computer-use-VWN5HH6A.js → computer-use-UHZAYYGO.js} +9 -8
- package/chunks/{contextCommand-DFFG5KDJ.js → contextCommand-X4WOJ2L4.js} +11 -10
- package/chunks/{cron-create-CSSWJ67I.js → cron-create-6YTCOX6P.js} +1 -1
- package/chunks/{cron-delete-E56CFQ7A.js → cron-delete-E3NIFSUK.js} +1 -1
- package/chunks/{cron-list-BKSINY6Y.js → cron-list-Q64MNQNE.js} +1 -1
- package/chunks/{daemon-5T6IHWJV.js → daemon-EEB2RYOL.js} +23 -0
- package/chunks/{daemon-status-provider-V5UY7O7J.js → daemon-status-provider-YXWNGOAF.js} +18 -16
- package/chunks/{de-HB5NJXGB.js → de-PLLFDERI.js} +1 -0
- package/chunks/{dist-TAVAGZU6.js → dist-AP5V4WYU.js} +54 -14
- package/chunks/{dist-XBOVZ3R5.js → dist-IZP2VV4C.js} +156 -57
- package/chunks/{dist-B7SSDVWT.js → dist-SNXOUPYS.js} +201 -7
- package/chunks/{dist-2HDL5SHQ.js → dist-X4ZDE726.js} +43 -8
- package/chunks/{dist-BL3SL665.js → dist-Z57Q4YF5.js} +1 -1
- package/chunks/{earlyInputCapture-VVYU4FDO.js → earlyInputCapture-3HUGMAFL.js} +9 -8
- package/chunks/{edit-F35PTMBA.js → edit-QDKRNFZK.js} +14 -17
- package/chunks/{en-FZREZFPO.js → en-M4EBUBNU.js} +2 -0
- package/chunks/{enter-worktree-3DIW7EGJ.js → enter-worktree-ODWIPMOP.js} +9 -8
- package/chunks/{enterPlanMode-QNXT77KP.js → enterPlanMode-XROL6G5C.js} +11 -10
- package/chunks/{errors-M53YG76R.js → errors-RCPBWFTG.js} +11 -10
- package/chunks/{exit-worktree-BSDWNWHZ.js → exit-worktree-BIU7P4TR.js} +9 -8
- package/chunks/{exitPlanMode-EL7AY327.js → exitPlanMode-LWZHZ7CF.js} +107 -12
- package/chunks/{fast-path-DUCSMUFW.js → fast-path-7S4NR2WI.js} +6 -4
- package/chunks/{fast-path-settings-UQLRFDQP.js → fast-path-settings-RCRXH2JG.js} +2 -2
- package/chunks/{fr-XY3NQFCM.js → fr-MBMNQSQ6.js} +1 -0
- package/chunks/{gemini-F3IERB37.js → gemini-W7CZCFFV.js} +75 -67
- package/chunks/{geminiContentGenerator-6OULAKFQ.js → geminiContentGenerator-MWZWJAWR.js} +39 -3
- package/chunks/{glob-ZMLFTD4T.js → glob-GZ4LUOQT.js} +9 -8
- package/chunks/{grep-H5X66EI7.js → grep-BZ34WAQJ.js} +9 -8
- package/chunks/{initializer-LEOT2OLH.js → initializer-W4EUD3H7.js} +14 -13
- package/chunks/{ja-J7YAG7SA.js → ja-HFV5QCHR.js} +1 -0
- package/chunks/{list-M3DKXML6.js → list-S325XJ2Y.js} +16 -15
- package/chunks/{loadedSettingsAdapter-OKMQFGGG.js → loadedSettingsAdapter-QP3XBMQI.js} +14 -13
- package/chunks/{loop-wakeup-FPBAVVPR.js → loop-wakeup-G2EHBRGR.js} +2 -2
- package/chunks/{ls-UGWQXPTY.js → ls-IDHUVSAG.js} +1 -1
- package/chunks/{lsp-24WV7NXB.js → lsp-FSRYXGFT.js} +1 -1
- package/chunks/mcp-LRKXM6OS.js +66 -0
- package/chunks/{monitor-ARL5P45R.js → monitor-7C33CWA5.js} +11 -10
- package/chunks/{nonInteractiveCli-NUVLF3YR.js → nonInteractiveCli-FPZS7ROR.js} +46 -43
- package/chunks/{notebook-edit-ANTZ2DDY.js → notebook-edit-ZXQ25NWU.js} +14 -16
- package/chunks/{openaiContentGenerator-TFGMKGHN.js → openaiContentGenerator-FUQ7GNK6.js} +4 -4
- package/chunks/{pidfile-AWTL4C63.js → pidfile-NPZV5ZIA.js} +10 -9
- package/chunks/{pt-6RTAA6SS.js → pt-2THT3YHA.js} +1 -0
- package/chunks/{qwenContentGenerator-6QWAYTWS.js → qwenContentGenerator-LNEWYA52.js} +10 -9
- package/chunks/{read-file-EJY73XQ3.js → read-file-G6GBNSM3.js} +3 -3
- package/chunks/{read-mcp-resource-NCBTPP7X.js → read-mcp-resource-PIJF24RO.js} +1 -1
- package/chunks/{ripGrep-HC4SA6CQ.js → ripGrep-IGOC7PVL.js} +9 -8
- package/chunks/{ru-AUBGJ2C4.js → ru-Z67YJHBG.js} +1 -0
- package/chunks/{run-qwen-serve-AGLZ642J.js → run-qwen-serve-AAA53KS4.js} +131 -38
- package/chunks/{scheduler-TURO7NGY.js → scheduler-SPGJ7ILO.js} +9 -8
- package/chunks/{send-message-3S2NYS3O.js → send-message-33PYFMCT.js} +15 -1
- package/chunks/{serve-5DAMOIDW.js → serve-37UIHUYP.js} +15 -14
- package/chunks/{server-4AGEK2HC.js → server-MFMOYMEB.js} +187 -173
- package/chunks/{session-7ZOQUC4Y.js → session-XRY2CG4Z.js} +47 -44
- package/chunks/{settings-DR4V6L5Y.js → settings-X5GXXGKH.js} +13 -12
- package/chunks/{shell-H5WFKUXH.js → shell-E5HOWJMT.js} +9 -8
- package/chunks/{skill-ANHU5ZCR.js → skill-FELDZMWO.js} +3 -3
- package/chunks/{spawnChannel-VN5LJV7Z.js → spawnChannel-XLTVHAT6.js} +12 -10
- package/chunks/{src-OVZLTVVM.js → src-ZWPLTWTV.js} +21 -10
- package/chunks/{startInteractiveUI-OA22V32P.js → startInteractiveUI-GO6J3SJ7.js} +2609 -2458
- package/chunks/{syntheticOutput-SV7GBHZ5.js → syntheticOutput-YOSWIHDJ.js} +2 -2
- package/chunks/{task-create-W2H2UJCH.js → task-create-NHS2NGB3.js} +3 -2
- package/chunks/{task-list-THBOPV4G.js → task-list-5UIB564R.js} +1 -1
- package/chunks/{task-stop-33FVCNCJ.js → task-stop-HGXZ2VZ3.js} +1 -1
- package/chunks/{task-update-LVFQLXEI.js → task-update-IYYWUILG.js} +34 -2
- package/chunks/{team-create-OYL5CAQO.js → team-create-WWMKZ3UO.js} +9 -8
- package/chunks/{team-delete-NTUQ25UY.js → team-delete-FEKJCU4P.js} +1 -1
- package/chunks/team-plan-approval-CUNEZJOV.js +202 -0
- package/chunks/{theme-manager-XCMPF2SI.js → theme-manager-LRBEA5ID.js} +9 -8
- package/chunks/{todoWrite-SEPO2RI3.js → todoWrite-TKMVZ2HT.js} +1 -1
- package/chunks/{tool-search-YXW55X6Z.js → tool-search-L57ZRBJF.js} +8 -6
- package/chunks/{trustedFolders-TEPGM5YL.js → trustedFolders-DYAOFXN2.js} +10 -9
- package/chunks/{validateNonInterActiveAuth-OQIS7WUE.js → validateNonInterActiveAuth-AB4C2FLG.js} +43 -40
- package/chunks/version-2A66AIB2.js +10 -0
- package/chunks/{web-fetch-OE7LHURA.js → web-fetch-J4PIW36Q.js} +2 -2
- package/chunks/{workflow-RTUWORAP.js → workflow-H7YLGTBI.js} +12 -11
- package/chunks/{workspace-providers-status-DM2XANVB.js → workspace-providers-status-UUIBOTKI.js} +16 -15
- package/chunks/{workspace-service-VKBI2KZD.js → workspace-service-FATHYK5C.js} +21 -20
- package/chunks/workspace-skills-status-KIC3KYPR.js +62 -0
- package/chunks/{write-file-WGALQ53L.js → write-file-ETGUMYAK.js} +14 -18
- package/chunks/yargs-B64EYTCF.js +10 -0
- package/chunks/{zh-V3B4TFWL.js → zh-SLZNSSZB.js} +2 -0
- package/chunks/{zh-TW-6GIKXEAN.js → zh-TW-P53C2SL5.js} +2 -0
- package/cli-entry.js +81 -8
- package/cli.js +348 -55
- package/locales/ca.js +2 -0
- package/locales/de.js +2 -0
- package/locales/en.js +3 -0
- package/locales/fr.js +2 -0
- package/locales/ja.js +2 -0
- package/locales/pt.js +2 -0
- package/locales/ru.js +2 -0
- package/locales/zh-TW.js +3 -0
- package/locales/zh.js +3 -0
- package/node_modules/@qwen-code/audio-capture/package.json +1 -1
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
- package/package.json +6 -15
- package/web-shell/assets/{arc-Det5Ccum.js → arc-QjIJgYzv.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-DqNWVFpl.js → architectureDiagram-3BPJPVTR-DJkZ9KoB.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CYl7tYBi.js → blockDiagram-GPEHLZMM-BlNeekUB.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DaAEi0NQ.js → c4Diagram-AAUBKEIU-B6FDrE3D.js} +1 -1
- package/web-shell/assets/channel-M6R-XOoS.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-Df2CDEE2.js → chunk-2J33WTMH-CZO5-3og.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DNBFcyL2.js → chunk-4BX2VUAB-CZ2VJPFe.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BKjF-0HI.js → chunk-55IACEB6-3zVP6pGF.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-DYwAwfIM.js → chunk-727SXJPM-omuP8Zhh.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C6FswLqy.js → chunk-AQP2D5EJ-BK6Ivmyv.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-DRWAcZSY.js → chunk-FMBD7UC4-NLjjxV0s.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-AoL16mNR.js → chunk-ND2GUHAM-Dc0JTV8t.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-a8PtLMck.js → chunk-QZHKN3VN-ZYp-8jN-.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-B7rcL2Jc.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B7rcL2Jc.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-C4Aeu5qf.js → cose-bilkent-S5V4N54A-BNu1jqy7.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-BOulamjo.js → dagre-BM42HDAG-0AHvPm2v.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-D1wt2ykO.js → diagram-2AECGRRQ-BJsDQdp0.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BRseus-O.js → diagram-5GNKFQAL-C1gNnoxj.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-XSMkNzpZ.js → diagram-KO2AKTUF-FmgehSoq.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-21KNLqoi.js → diagram-LMA3HP47-i7_13R2F.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DnUI8F5G.js → diagram-OG6HWLK6-DkUUR1x-.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BVSOMuM2.js → erDiagram-TEJ5UH35-BcwJzw0n.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-fYtDPJsW.js → flowDiagram-I6XJVG4X-CCPgwkQS.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-CmRXosW_.js → ganttDiagram-6RSMTGT7-C3g0sliF.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DPrmySxO.js → gitGraphDiagram-PVQCEYII-DLt4J_oG.js} +1 -1
- package/web-shell/assets/index-9qfvU0_r.css +5 -0
- package/web-shell/assets/index-DasTT8n6.js +717 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-x3VbEuCV.js → infoDiagram-5YYISTIA-DMO0nW8F.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-SmitHRMC.js → ishikawaDiagram-YF4QCWOH-qSN9LjC5.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-BxvA551S.js → journeyDiagram-JHISSGLW-CQZH-jC2.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-DNHC16jY.js → kanban-definition-UN3LZRKU-Cu6qk5En.js} +1 -1
- package/web-shell/assets/{linear-CQ6irBL9.js → linear-Dpp4BWJF.js} +1 -1
- package/web-shell/assets/{mermaid.core-DtB6NO1e.js → mermaid.core-DDAcmZsz.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-QKMAgV2v.js → mindmap-definition-RKZ34NQL-G3JXxnUU.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-bvb6dGn6.js → pieDiagram-4H26LBE5-ABQwHraX.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DLgdlG4D.js → quadrantDiagram-W4KKPZXB-BUWZV-ho.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-2M9YH4GF.js → requirementDiagram-4Y6WPE33-XHg5n00A.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-DzwfclTH.js → sankeyDiagram-5OEKKPKP-Bwzw0RtM.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BvPmTuy2.js → sequenceDiagram-3UESZ5HK-CGYLtnFV.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-BjwUmrJF.js → stateDiagram-AJRCARHV-BG1UhKch.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CSG8MpoN.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-CXzS6qqz.js → timeline-definition-PNZ67QCA-B_tY-Dyz.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-yRSolF5B.js → vennDiagram-CIIHVFJN-Crp_Rw_L.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-ClLJjHPG.js → wardley-L42UT6IY-DR27pFXX.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-VIa6t2p2.js → wardleyDiagram-YWT4CUSO-BM_CRFgm.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CtmrkezW.js → xychartDiagram-2RQKCTM6-DO2Z2lWl.js} +1 -1
- package/web-shell/index.html +28 -3
- package/chunks/channel-worker-supervisor-A74FV522.js +0 -308
- package/chunks/chunk-MVZXZWGT.js +0 -11323
- package/chunks/chunk-S5EQPDTM.js +0 -91
- package/patches/chrome-devtools-mcp+1.4.0.patch +0 -31
- package/postinstall.js +0 -50
- package/web-shell/assets/channel-Bm0bFauD.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK--NgUfb55.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2--NgUfb55.js +0 -1
- package/web-shell/assets/index-BpKnmyFV.js +0 -717
- package/web-shell/assets/index-fLrtxpOG.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-C4L8zXeL.js +0 -1
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
} from "./chunk-3HX5LZ6R.js";
|
|
11
11
|
import "./chunk-7RYW5LQV.js";
|
|
12
12
|
import {
|
|
13
|
-
ChannelBase
|
|
14
|
-
|
|
13
|
+
ChannelBase,
|
|
14
|
+
isTerminalTaskLifecycleType
|
|
15
|
+
} from "./chunk-7DMQRPC7.js";
|
|
15
16
|
import "./chunk-UFC57OYT.js";
|
|
16
17
|
import "./chunk-K5PGHDBN.js";
|
|
17
18
|
import {
|
|
@@ -92566,7 +92567,11 @@ function splitByTables(text) {
|
|
|
92566
92567
|
__name(splitByTables, "splitByTables");
|
|
92567
92568
|
function buildCardContent(markdown, options) {
|
|
92568
92569
|
const elements = [];
|
|
92569
|
-
const
|
|
92570
|
+
const statusLabel = options?.statusLabel ?? (options?.isStreaming ? "\u751F\u6210\u4E2D..." : void 0);
|
|
92571
|
+
const contentMd = statusLabel ? `${markdown}
|
|
92572
|
+
|
|
92573
|
+
---
|
|
92574
|
+
*${statusLabel}*` : markdown;
|
|
92570
92575
|
const threshold = options?.collapsibleThreshold || 500;
|
|
92571
92576
|
if (options?.collapsible && !options?.isStreaming && markdown.length > threshold) {
|
|
92572
92577
|
const previewEnd = markdown.indexOf("\n", 200);
|
|
@@ -92588,9 +92593,13 @@ function buildCardContent(markdown, options) {
|
|
|
92588
92593
|
}
|
|
92589
92594
|
const preview = markdown.slice(0, splitAt);
|
|
92590
92595
|
const rest = markdown.slice(splitAt);
|
|
92596
|
+
const previewContent = statusLabel ? `${preview}
|
|
92597
|
+
|
|
92598
|
+
---
|
|
92599
|
+
*${statusLabel}*` : preview;
|
|
92591
92600
|
elements.push({
|
|
92592
92601
|
tag: "markdown",
|
|
92593
|
-
content:
|
|
92602
|
+
content: previewContent
|
|
92594
92603
|
});
|
|
92595
92604
|
elements.push({
|
|
92596
92605
|
tag: "collapsible_panel",
|
|
@@ -92765,6 +92774,28 @@ __name(downloadMedia, "downloadMedia");
|
|
|
92765
92774
|
// packages/channels/feishu/dist/FeishuAdapter.js
|
|
92766
92775
|
var DEDUP_TTL_MS = 5 * 60 * 1e3;
|
|
92767
92776
|
var CARD_UPDATE_INTERVAL_MS = 1500;
|
|
92777
|
+
var FEISHU_RUNNING_STATUS_LABEL = "\u8FD0\u884C\u4E2D...";
|
|
92778
|
+
var FEISHU_STOPPED_STATUS_LABEL = "\u5DF2\u505C\u6B62\u751F\u6210";
|
|
92779
|
+
var FEISHU_STOP_FAILED_STATUS_LABEL = "\u505C\u6B62\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";
|
|
92780
|
+
var FEISHU_TRUNCATED_STATUS_LABEL = "\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD";
|
|
92781
|
+
var FEISHU_TERMINAL_STATUS_LABELS = {
|
|
92782
|
+
completed: "\u5DF2\u5B8C\u6210",
|
|
92783
|
+
cancelled: "\u5DF2\u53D6\u6D88",
|
|
92784
|
+
failed: "\u5DF2\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"
|
|
92785
|
+
};
|
|
92786
|
+
var FEISHU_STATUS_STRINGS = [
|
|
92787
|
+
"\u751F\u6210\u4E2D...",
|
|
92788
|
+
FEISHU_RUNNING_STATUS_LABEL,
|
|
92789
|
+
FEISHU_TERMINAL_STATUS_LABELS.completed,
|
|
92790
|
+
FEISHU_TERMINAL_STATUS_LABELS.cancelled,
|
|
92791
|
+
FEISHU_TERMINAL_STATUS_LABELS.failed,
|
|
92792
|
+
FEISHU_STOPPED_STATUS_LABEL,
|
|
92793
|
+
FEISHU_STOP_FAILED_STATUS_LABEL,
|
|
92794
|
+
FEISHU_TRUNCATED_STATUS_LABEL
|
|
92795
|
+
];
|
|
92796
|
+
var escapeRegExp = /* @__PURE__ */ __name((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escapeRegExp");
|
|
92797
|
+
var FEISHU_STATUS_LABELS = `(?:${FEISHU_STATUS_STRINGS.map(escapeRegExp).join("|")})`;
|
|
92798
|
+
var FEISHU_STATUS_BLOCK_RE = new RegExp(`(?:^|\\n)---\\n\\*${FEISHU_STATUS_LABELS}\\*(?=\\n|$)`, "g");
|
|
92768
92799
|
var BASE_URL2 = "https://open.feishu.cn/open-apis";
|
|
92769
92800
|
var FEISHU_ID_RE2 = /^[a-zA-Z0-9_.:-]+$/;
|
|
92770
92801
|
var FeishuChannel = class extends ChannelBase {
|
|
@@ -93119,7 +93150,7 @@ var FeishuChannel = class extends ChannelBase {
|
|
|
93119
93150
|
}
|
|
93120
93151
|
}
|
|
93121
93152
|
let text = lines.join("\n").trim();
|
|
93122
|
-
text = text.replace(
|
|
93153
|
+
text = text.replace(FEISHU_STATUS_BLOCK_RE, "");
|
|
93123
93154
|
text = text.replace(/^好的,<at[^>]*><\/at>\s*\n*/, "");
|
|
93124
93155
|
return text.trim() || void 0;
|
|
93125
93156
|
}
|
|
@@ -93239,6 +93270,7 @@ var FeishuChannel = class extends ChannelBase {
|
|
|
93239
93270
|
title: cardTitle,
|
|
93240
93271
|
showStopButton: true,
|
|
93241
93272
|
isStreaming: true,
|
|
93273
|
+
statusLabel: this.statusLabelFor(),
|
|
93242
93274
|
collapsible: this.collapsible,
|
|
93243
93275
|
collapsibleThreshold: this.collapsibleThreshold
|
|
93244
93276
|
});
|
|
@@ -93274,7 +93306,7 @@ var FeishuChannel = class extends ChannelBase {
|
|
|
93274
93306
|
return { messageId: "", success: false };
|
|
93275
93307
|
}
|
|
93276
93308
|
}
|
|
93277
|
-
async updateCard(messageId, text, finished = false, inboundMsgId) {
|
|
93309
|
+
async updateCard(messageId, text, finished = false, inboundMsgId, statusLabel) {
|
|
93278
93310
|
const token = await this.getTenantAccessToken();
|
|
93279
93311
|
if (!token)
|
|
93280
93312
|
return false;
|
|
@@ -93283,6 +93315,7 @@ var FeishuChannel = class extends ChannelBase {
|
|
|
93283
93315
|
title: cardTitle,
|
|
93284
93316
|
showStopButton: !finished,
|
|
93285
93317
|
isStreaming: !finished,
|
|
93318
|
+
statusLabel: statusLabel ?? (!finished ? this.statusLabelFor() : void 0),
|
|
93286
93319
|
collapsible: this.collapsible,
|
|
93287
93320
|
collapsibleThreshold: this.collapsibleThreshold
|
|
93288
93321
|
});
|
|
@@ -93399,10 +93432,7 @@ ${cs.accumulatedText}` : cs.accumulatedText;
|
|
|
93399
93432
|
}
|
|
93400
93433
|
if (result.success) {
|
|
93401
93434
|
const prefix = cs.atPrefix || this.msgToSenderName.get(inboundMsgId) || "";
|
|
93402
|
-
|
|
93403
|
-
|
|
93404
|
-
*\u5DF2\u505C\u6B62\u751F\u6210*` : "*\u5DF2\u505C\u6B62\u751F\u6210*";
|
|
93405
|
-
this.updateCard(result.messageId, stopText, true, inboundMsgId).catch(() => {
|
|
93435
|
+
this.updateCard(result.messageId, prefix, true, inboundMsgId, this.stopLabelFor(cs.terminalStatus, cs.userStopped ?? false)).catch(() => {
|
|
93406
93436
|
});
|
|
93407
93437
|
}
|
|
93408
93438
|
cs.creating = false;
|
|
@@ -93461,6 +93491,62 @@ ${cs.accumulatedText}` : cs.accumulatedText;
|
|
|
93461
93491
|
}, delay);
|
|
93462
93492
|
}
|
|
93463
93493
|
}
|
|
93494
|
+
isKnownInboundMessageId(messageId) {
|
|
93495
|
+
return this.msgToQuestion.has(messageId) || this.msgToSenderName.has(messageId) || this.msgToSenderId.has(messageId) || this.cardSessions.has(messageId) || this.stoppedMessages.has(messageId);
|
|
93496
|
+
}
|
|
93497
|
+
knownInboundMessageId(sessionId, messageId) {
|
|
93498
|
+
if (messageId && this.isKnownInboundMessageId(messageId)) {
|
|
93499
|
+
return messageId;
|
|
93500
|
+
}
|
|
93501
|
+
const mapped = this.sessionToInboundMsg.get(sessionId);
|
|
93502
|
+
return mapped && this.isKnownInboundMessageId(mapped) ? mapped : void 0;
|
|
93503
|
+
}
|
|
93504
|
+
statusLabelFor(terminalStatus) {
|
|
93505
|
+
return terminalStatus === void 0 ? FEISHU_RUNNING_STATUS_LABEL : FEISHU_TERMINAL_STATUS_LABELS[terminalStatus];
|
|
93506
|
+
}
|
|
93507
|
+
stopLabelFor(terminalStatus, userInitiated = false) {
|
|
93508
|
+
if (userInitiated || terminalStatus === void 0) {
|
|
93509
|
+
return FEISHU_STOPPED_STATUS_LABEL;
|
|
93510
|
+
}
|
|
93511
|
+
return this.statusLabelFor(terminalStatus);
|
|
93512
|
+
}
|
|
93513
|
+
async finalizeStoppedCardUpdate(inboundMsgId, cardState, chatId) {
|
|
93514
|
+
if (!cardState || !cardState.stopped && !this.stoppedMessages.has(inboundMsgId)) {
|
|
93515
|
+
return false;
|
|
93516
|
+
}
|
|
93517
|
+
if (cardState.created && cardState.messageId) {
|
|
93518
|
+
const prefix = cardState.atPrefix || this.msgToSenderName.get(inboundMsgId) || "";
|
|
93519
|
+
const stopLabel = `*${this.stopLabelFor(cardState.terminalStatus, this.stoppedMessages.has(inboundMsgId))}*`;
|
|
93520
|
+
const contentPart = cardState.accumulatedText.trim() ? cardState.accumulatedText + "\n\n---\n" + stopLabel : stopLabel;
|
|
93521
|
+
const finalText = prefix ? `${prefix}
|
|
93522
|
+
|
|
93523
|
+
${contentPart}` : contentPart;
|
|
93524
|
+
const updated = await this.updateCard(cardState.messageId, finalText, true, inboundMsgId);
|
|
93525
|
+
if (!updated) {
|
|
93526
|
+
await this.deleteCard(cardState.messageId);
|
|
93527
|
+
await this.sendMessage(chatId, finalText);
|
|
93528
|
+
}
|
|
93529
|
+
}
|
|
93530
|
+
this.cleanupCard(inboundMsgId);
|
|
93531
|
+
this.stoppedMessages.delete(inboundMsgId);
|
|
93532
|
+
return true;
|
|
93533
|
+
}
|
|
93534
|
+
onTaskLifecycle(event) {
|
|
93535
|
+
if (!isTerminalTaskLifecycleType(event.type)) {
|
|
93536
|
+
return;
|
|
93537
|
+
}
|
|
93538
|
+
const inboundMsgId = this.knownInboundMessageId(event.sessionId, event.messageId);
|
|
93539
|
+
if (!inboundMsgId)
|
|
93540
|
+
return;
|
|
93541
|
+
const cardState = this.cardSessions.get(inboundMsgId);
|
|
93542
|
+
if (!cardState)
|
|
93543
|
+
return;
|
|
93544
|
+
if (cardState.terminalStatus && cardState.terminalStatus !== event.type) {
|
|
93545
|
+
process.stderr.write(`[Feishu:${this.name}] conflicting terminal event ${event.type} after ${cardState.terminalStatus} for inbound=${inboundMsgId}
|
|
93546
|
+
`);
|
|
93547
|
+
}
|
|
93548
|
+
cardState.terminalStatus ??= event.type;
|
|
93549
|
+
}
|
|
93464
93550
|
async onResponseComplete(chatId, fullText, sessionId) {
|
|
93465
93551
|
const inboundMsgId = this.sessionToInboundMsg.get(sessionId);
|
|
93466
93552
|
if (!inboundMsgId) {
|
|
@@ -93481,14 +93567,19 @@ ${cs.accumulatedText}` : cs.accumulatedText;
|
|
|
93481
93567
|
let displayText = atSender ? `${atSender}
|
|
93482
93568
|
|
|
93483
93569
|
${fullText}` : fullText;
|
|
93570
|
+
const completedLabel = this.statusLabelFor("completed");
|
|
93571
|
+
const completedSuffix = `
|
|
93572
|
+
|
|
93573
|
+
---
|
|
93574
|
+
*${completedLabel}*`;
|
|
93484
93575
|
const MAX_FINAL_CARD_CHARS = 2e4;
|
|
93485
|
-
if (displayText.length > MAX_FINAL_CARD_CHARS) {
|
|
93576
|
+
if (displayText.length + completedSuffix.length > MAX_FINAL_CARD_CHARS) {
|
|
93486
93577
|
const prefix = atSender ? `${atSender}
|
|
93487
93578
|
|
|
93488
93579
|
` : "";
|
|
93489
93580
|
const suffix = "\n\n_(\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\u65E9\u671F\u5185\u5BB9)_";
|
|
93490
93581
|
const fenceReserve = 4;
|
|
93491
|
-
const maxBody = MAX_FINAL_CARD_CHARS - prefix.length - suffix.length - fenceReserve;
|
|
93582
|
+
const maxBody = MAX_FINAL_CARD_CHARS - prefix.length - suffix.length - completedSuffix.length - fenceReserve;
|
|
93492
93583
|
displayText = prefix + fullText.slice(-maxBody) + suffix;
|
|
93493
93584
|
if (this.countFences(displayText) % 2 === 1) {
|
|
93494
93585
|
displayText = "```\n" + displayText;
|
|
@@ -93527,15 +93618,24 @@ ${fullText}` : fullText;
|
|
|
93527
93618
|
return;
|
|
93528
93619
|
}
|
|
93529
93620
|
if (cardState?.created) {
|
|
93530
|
-
const updated = await this.updateCard(cardState.messageId, displayText, true, inboundMsgId);
|
|
93621
|
+
const updated = await this.updateCard(cardState.messageId, displayText, true, inboundMsgId, completedLabel);
|
|
93622
|
+
if (await this.finalizeStoppedCardUpdate(inboundMsgId, cardState, chatId)) {
|
|
93623
|
+
return;
|
|
93624
|
+
}
|
|
93531
93625
|
if (!updated) {
|
|
93532
93626
|
const noTableText = this.stripTables(displayText, "(\u8868\u683C\u5185\u5BB9\u8BF7\u67E5\u770B\u539F\u6587)");
|
|
93533
|
-
const retried = await this.updateCard(cardState.messageId, noTableText, true, inboundMsgId);
|
|
93627
|
+
const retried = await this.updateCard(cardState.messageId, noTableText, true, inboundMsgId, completedLabel);
|
|
93628
|
+
if (await this.finalizeStoppedCardUpdate(inboundMsgId, cardState, chatId)) {
|
|
93629
|
+
return;
|
|
93630
|
+
}
|
|
93534
93631
|
if (!retried) {
|
|
93535
93632
|
let truncated = displayText.slice(0, 2e3);
|
|
93536
93633
|
if (this.countFences(truncated) % 2 === 1)
|
|
93537
93634
|
truncated += "\n```";
|
|
93538
|
-
const lastResort = await this.updateCard(cardState.messageId, truncated + "\n\n---\n*\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD*", true, inboundMsgId);
|
|
93635
|
+
const lastResort = await this.updateCard(cardState.messageId, truncated + "\n\n---\n*\u5185\u5BB9\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD*", true, inboundMsgId, completedLabel);
|
|
93636
|
+
if (await this.finalizeStoppedCardUpdate(inboundMsgId, cardState, chatId)) {
|
|
93637
|
+
return;
|
|
93638
|
+
}
|
|
93539
93639
|
if (!lastResort) {
|
|
93540
93640
|
await this.deleteCard(cardState.messageId);
|
|
93541
93641
|
this.cleanupCard(inboundMsgId);
|
|
@@ -93551,7 +93651,10 @@ ${fullText}` : fullText);
|
|
|
93551
93651
|
}
|
|
93552
93652
|
const result = await this.createStreamingCard(chatId, displayText, void 0, inboundMsgId);
|
|
93553
93653
|
if (result.success) {
|
|
93554
|
-
const finalized = await this.updateCard(result.messageId, displayText, true, inboundMsgId);
|
|
93654
|
+
const finalized = await this.updateCard(result.messageId, displayText, true, inboundMsgId, completedLabel);
|
|
93655
|
+
if (await this.finalizeStoppedCardUpdate(inboundMsgId, cardState, chatId)) {
|
|
93656
|
+
return;
|
|
93657
|
+
}
|
|
93555
93658
|
if (finalized) {
|
|
93556
93659
|
this.cleanupCard(inboundMsgId);
|
|
93557
93660
|
return;
|
|
@@ -93564,14 +93667,15 @@ ${fullText}` : fullText);
|
|
|
93564
93667
|
${fullText}` : fullText);
|
|
93565
93668
|
}
|
|
93566
93669
|
onPromptStart(chatId, sessionId, messageId) {
|
|
93567
|
-
|
|
93568
|
-
|
|
93569
|
-
this.
|
|
93670
|
+
const inboundMsgId = messageId && this.isKnownInboundMessageId(messageId) ? messageId : void 0;
|
|
93671
|
+
if (inboundMsgId) {
|
|
93672
|
+
this.sessionToInboundMsg.set(sessionId, inboundMsgId);
|
|
93673
|
+
this.addReaction(inboundMsgId, "OnIt").catch(() => {
|
|
93570
93674
|
});
|
|
93571
93675
|
if (this.config.blockStreaming === "on")
|
|
93572
93676
|
return;
|
|
93573
|
-
if (!this.cardSessions.has(
|
|
93574
|
-
const atSender = this.msgToSenderName.get(
|
|
93677
|
+
if (!this.cardSessions.has(inboundMsgId)) {
|
|
93678
|
+
const atSender = this.msgToSenderName.get(inboundMsgId) || "";
|
|
93575
93679
|
const placeholderText = atSender ? `${atSender}\uFF0C\u601D\u8003\u4E2D...` : "\u601D\u8003\u4E2D...";
|
|
93576
93680
|
const cardState = {
|
|
93577
93681
|
messageId: "",
|
|
@@ -93581,9 +93685,9 @@ ${fullText}` : fullText);
|
|
|
93581
93685
|
accumulatedText: "",
|
|
93582
93686
|
lastUpdateAt: Date.now()
|
|
93583
93687
|
};
|
|
93584
|
-
this.cardSessions.set(
|
|
93585
|
-
this.createStreamingCard(chatId, placeholderText, void 0,
|
|
93586
|
-
if (cardState.stopped || this.stoppedMessages.has(
|
|
93688
|
+
this.cardSessions.set(inboundMsgId, cardState);
|
|
93689
|
+
this.createStreamingCard(chatId, placeholderText, void 0, inboundMsgId).then((result) => {
|
|
93690
|
+
if (cardState.stopped || this.stoppedMessages.has(inboundMsgId)) {
|
|
93587
93691
|
if (cardState.abandoned) {
|
|
93588
93692
|
if (result.success) {
|
|
93589
93693
|
this.deleteCard(result.messageId).catch((err) => {
|
|
@@ -93595,15 +93699,12 @@ ${fullText}` : fullText);
|
|
|
93595
93699
|
return;
|
|
93596
93700
|
}
|
|
93597
93701
|
if (result.success) {
|
|
93598
|
-
const prefix = cardState.atPrefix || this.msgToSenderName.get(
|
|
93599
|
-
|
|
93600
|
-
|
|
93601
|
-
*\u5DF2\u505C\u6B62\u751F\u6210*` : "*\u5DF2\u505C\u6B62\u751F\u6210*";
|
|
93602
|
-
this.updateCard(result.messageId, stopText, true, messageId).catch(() => {
|
|
93702
|
+
const prefix = cardState.atPrefix || this.msgToSenderName.get(inboundMsgId) || "";
|
|
93703
|
+
this.updateCard(result.messageId, prefix, true, inboundMsgId, this.stopLabelFor(cardState.terminalStatus, cardState.userStopped ?? false)).catch(() => {
|
|
93603
93704
|
});
|
|
93604
93705
|
}
|
|
93605
93706
|
cardState.creating = false;
|
|
93606
|
-
this.cleanupCard(
|
|
93707
|
+
this.cleanupCard(inboundMsgId);
|
|
93607
93708
|
return;
|
|
93608
93709
|
}
|
|
93609
93710
|
if (result.success) {
|
|
@@ -93618,18 +93719,16 @@ ${fullText}` : fullText);
|
|
|
93618
93719
|
process.stderr.write(`[Feishu:${this.name}] Processing card error: ${err}
|
|
93619
93720
|
`);
|
|
93620
93721
|
cardState.creating = false;
|
|
93621
|
-
this.cleanupCard(
|
|
93722
|
+
this.cleanupCard(inboundMsgId);
|
|
93622
93723
|
});
|
|
93623
93724
|
}
|
|
93624
93725
|
}
|
|
93625
93726
|
}
|
|
93626
93727
|
async onPromptEnd(_chatId, sessionId, messageId) {
|
|
93627
|
-
|
|
93628
|
-
this.removeReaction(messageId, "OnIt").catch(() => {
|
|
93629
|
-
});
|
|
93630
|
-
}
|
|
93631
|
-
const inboundMsgId = messageId || this.sessionToInboundMsg.get(sessionId);
|
|
93728
|
+
const inboundMsgId = this.knownInboundMessageId(sessionId, messageId);
|
|
93632
93729
|
if (inboundMsgId) {
|
|
93730
|
+
this.removeReaction(inboundMsgId, "OnIt").catch(() => {
|
|
93731
|
+
});
|
|
93633
93732
|
const cs = this.cardSessions.get(inboundMsgId);
|
|
93634
93733
|
if (cs && !cs.stopped && !cs.completed) {
|
|
93635
93734
|
if (cs.creating) {
|
|
@@ -93637,13 +93736,12 @@ ${fullText}` : fullText);
|
|
|
93637
93736
|
} else if (cs.created) {
|
|
93638
93737
|
cs.stopped = true;
|
|
93639
93738
|
const atPrefix = this.msgToSenderName.get(inboundMsgId) || "";
|
|
93640
|
-
const
|
|
93641
|
-
const
|
|
93739
|
+
const terminalStatus = cs.terminalStatus ?? (cs.cancelling ? "cancelled" : "failed");
|
|
93740
|
+
const terminalLabel = this.stopLabelFor(terminalStatus, cs.userStopped ?? false);
|
|
93741
|
+
const text = cs.accumulatedText ? atPrefix ? `${atPrefix}
|
|
93642
93742
|
|
|
93643
|
-
${cs.accumulatedText}` : cs.accumulatedText
|
|
93644
|
-
|
|
93645
|
-
` : "") + errorLabel;
|
|
93646
|
-
await this.updateCard(cs.messageId, text, true, inboundMsgId).catch(() => {
|
|
93743
|
+
${cs.accumulatedText}` : cs.accumulatedText : atPrefix || "";
|
|
93744
|
+
await this.updateCard(cs.messageId, text, true, inboundMsgId, terminalLabel).catch(() => {
|
|
93647
93745
|
});
|
|
93648
93746
|
this.cleanupCard(inboundMsgId);
|
|
93649
93747
|
} else {
|
|
@@ -93656,9 +93754,10 @@ ${cs.accumulatedText}` : cs.accumulatedText;
|
|
|
93656
93754
|
});
|
|
93657
93755
|
} else {
|
|
93658
93756
|
const atPrefix = this.msgToSenderName.get(inboundMsgId) || "";
|
|
93757
|
+
const fallbackLabel = cs.terminalStatus ? this.statusLabelFor(cs.terminalStatus) : "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5";
|
|
93659
93758
|
const errorText = atPrefix ? `${atPrefix}
|
|
93660
93759
|
|
|
93661
|
-
|
|
93760
|
+
*${fallbackLabel}*` : `*${fallbackLabel}*`;
|
|
93662
93761
|
this.sendMessage(_chatId, errorText).catch(() => {
|
|
93663
93762
|
});
|
|
93664
93763
|
process.stderr.write(`[Feishu:${this.name}] onPromptEnd: no card and no accumulated text for inbound=${inboundMsgId}, sent error fallback
|
|
@@ -93780,34 +93879,34 @@ ${cs.accumulatedText}` : cs.accumulatedText;
|
|
|
93780
93879
|
}
|
|
93781
93880
|
const inboundId = targetInboundMsgId;
|
|
93782
93881
|
const handleStop = /* @__PURE__ */ __name(async () => {
|
|
93783
|
-
|
|
93784
|
-
|
|
93785
|
-
|
|
93786
|
-
cancelSucceeded = false;
|
|
93787
|
-
process.stderr.write(`[Feishu:${this.name}] cancelSession failed for msg=${inboundId}: ${err instanceof Error ? err.message : err}
|
|
93788
|
-
`);
|
|
93789
|
-
});
|
|
93790
|
-
}
|
|
93882
|
+
const wasUserStop = !cardState.terminalStatus;
|
|
93883
|
+
cardState.userStopped = wasUserStop;
|
|
93884
|
+
const cancelSucceeded = sessionId ? await this.requestActivePromptCancellation(sessionId, "cancel_command") : true;
|
|
93791
93885
|
if (cancelSucceeded) {
|
|
93792
93886
|
cardState.stopped = true;
|
|
93793
93887
|
cardState.cancelling = false;
|
|
93794
93888
|
this.stoppedMessages.add(inboundId);
|
|
93795
93889
|
} else {
|
|
93796
93890
|
cardState.cancelling = false;
|
|
93891
|
+
cardState.userStopped = false;
|
|
93797
93892
|
}
|
|
93798
93893
|
if (cardState.finalizing)
|
|
93799
93894
|
return;
|
|
93800
93895
|
if (cardState.created && cardState.messageId) {
|
|
93801
93896
|
const prefix = cardState.atPrefix || this.msgToSenderName.get(inboundId) || "";
|
|
93802
|
-
const stopLabel = cancelSucceeded ?
|
|
93803
|
-
const contentPart = cardState.accumulatedText.trim() ? cardState.accumulatedText
|
|
93804
|
-
const finalText = prefix ? `${prefix}
|
|
93897
|
+
const stopLabel = cancelSucceeded ? this.stopLabelFor(cardState.terminalStatus, wasUserStop) : FEISHU_STOP_FAILED_STATUS_LABEL;
|
|
93898
|
+
const contentPart = cardState.accumulatedText.trim() ? cardState.accumulatedText : "";
|
|
93899
|
+
const finalText = prefix ? contentPart ? `${prefix}
|
|
93805
93900
|
|
|
93806
|
-
${contentPart}` : contentPart;
|
|
93807
|
-
const updated = await this.updateCard(cardState.messageId, finalText, cancelSucceeded, inboundId);
|
|
93901
|
+
${contentPart}` : prefix : contentPart;
|
|
93902
|
+
const updated = await this.updateCard(cardState.messageId, finalText, cancelSucceeded, inboundId, stopLabel);
|
|
93808
93903
|
if (!updated && cancelSucceeded && chatId) {
|
|
93809
93904
|
await this.deleteCard(cardState.messageId);
|
|
93810
|
-
await this.sendMessage(chatId, finalText
|
|
93905
|
+
await this.sendMessage(chatId, finalText ? `${finalText}
|
|
93906
|
+
|
|
93907
|
+
---
|
|
93908
|
+
*${stopLabel}*` : `---
|
|
93909
|
+
*${stopLabel}*`);
|
|
93811
93910
|
}
|
|
93812
93911
|
}
|
|
93813
93912
|
}, "handleStop");
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
import "./chunk-7RYW5LQV.js";
|
|
9
9
|
import {
|
|
10
10
|
ChannelBase,
|
|
11
|
+
isTerminalTaskLifecycleType,
|
|
11
12
|
sanitizeLogText,
|
|
12
13
|
sanitizeSenderName
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7DMQRPC7.js";
|
|
14
15
|
import "./chunk-UFC57OYT.js";
|
|
15
16
|
import "./chunk-K5PGHDBN.js";
|
|
16
17
|
import "./chunk-UWCTAVOD.js";
|
|
@@ -4488,6 +4489,10 @@ var ACK_REACTION_NAME = "\u{1F440}";
|
|
|
4488
4489
|
var ACK_EMOTION_ID = "2659900";
|
|
4489
4490
|
var ACK_EMOTION_BG_ID = "im_bg_1";
|
|
4490
4491
|
var EMOTION_API = "https://api.dingtalk.com/v1.0/robot/emotion";
|
|
4492
|
+
var GROUP_MSG_API = "https://api.dingtalk.com/v1.0/robot/groupMessages/send";
|
|
4493
|
+
var GROUP_MSG_KEY = "sampleMarkdown";
|
|
4494
|
+
var TOKEN_API = "https://oapi.dingtalk.com/gettoken";
|
|
4495
|
+
var PROACTIVE_FETCH_TIMEOUT_MS = 15e3;
|
|
4491
4496
|
var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
4492
4497
|
static {
|
|
4493
4498
|
__name(this, "DingtalkChannel");
|
|
@@ -4497,6 +4502,20 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
4497
4502
|
dedupTimer;
|
|
4498
4503
|
/** Map conversationId → latest sessionWebhook URL for sending replies. */
|
|
4499
4504
|
webhooks = /* @__PURE__ */ new Map();
|
|
4505
|
+
activeReactionKeys = /* @__PURE__ */ new Set();
|
|
4506
|
+
/** sessionId → reaction keys, so a dead session's reactions can be recalled. */
|
|
4507
|
+
sessionReactionKeys = /* @__PURE__ */ new Map();
|
|
4508
|
+
/**
|
|
4509
|
+
* Real inbound message ids (insertion-ordered, size-capped). Unlike the
|
|
4510
|
+
* TTL-swept seenMessages dedup map, entries survive long queue waits, so a
|
|
4511
|
+
* turn that starts minutes after its message arrived still gets a reaction.
|
|
4512
|
+
*/
|
|
4513
|
+
inboundMessageIds = /* @__PURE__ */ new Set();
|
|
4514
|
+
/**
|
|
4515
|
+
* Token cache for proactive sends. The stream SDK only refreshes its token
|
|
4516
|
+
* on (re)connect, so a long-lived socket serves a stale one after ~2h.
|
|
4517
|
+
*/
|
|
4518
|
+
proactiveToken;
|
|
4500
4519
|
constructor(name, config, bridge, options) {
|
|
4501
4520
|
super(name, config, bridge, options);
|
|
4502
4521
|
if (!config.clientId || !config.clientSecret) {
|
|
@@ -4645,6 +4664,98 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
4645
4664
|
}
|
|
4646
4665
|
}
|
|
4647
4666
|
}
|
|
4667
|
+
supportsProactiveSend() {
|
|
4668
|
+
return true;
|
|
4669
|
+
}
|
|
4670
|
+
/**
|
|
4671
|
+
* The group-message API needs a real openConversationId — reject DMs
|
|
4672
|
+
* (a different API) and webhook-URL fallback chatIds.
|
|
4673
|
+
*/
|
|
4674
|
+
supportsProactiveTarget(target) {
|
|
4675
|
+
return target.isGroup === true && target.threadId === void 0 && this.isConversationId(target.chatId);
|
|
4676
|
+
}
|
|
4677
|
+
/**
|
|
4678
|
+
* Single-shot cold send: a failed chunk aborts the remainder (already-sent
|
|
4679
|
+
* chunks are not recalled) and the error surfaces in the loop's lastError.
|
|
4680
|
+
*/
|
|
4681
|
+
async pushProactive(target, text) {
|
|
4682
|
+
if (!text.trim())
|
|
4683
|
+
return;
|
|
4684
|
+
const chunks = normalizeDingTalkMarkdown(text);
|
|
4685
|
+
const title = extractTitle(text);
|
|
4686
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
4687
|
+
await this.sendProactiveChunk(target.chatId, i === 0 ? title : `${title} (cont.)`, chunks[i], `chunk ${i + 1}/${chunks.length}`);
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
async getProactiveToken() {
|
|
4691
|
+
const cached = this.proactiveToken;
|
|
4692
|
+
if (cached && Date.now() < cached.expiresAt)
|
|
4693
|
+
return cached.token;
|
|
4694
|
+
const url2 = `${TOKEN_API}?appkey=${encodeURIComponent(this.config.clientId)}&appsecret=${encodeURIComponent(this.config.clientSecret)}`;
|
|
4695
|
+
let data;
|
|
4696
|
+
try {
|
|
4697
|
+
const resp = await fetch(url2, {
|
|
4698
|
+
signal: AbortSignal.timeout(PROACTIVE_FETCH_TIMEOUT_MS)
|
|
4699
|
+
});
|
|
4700
|
+
data = await resp.json();
|
|
4701
|
+
} catch (err) {
|
|
4702
|
+
process.stderr.write(`[DingTalk:${this.name}] proactive send failed: token fetch error ${err}
|
|
4703
|
+
`);
|
|
4704
|
+
throw new Error("DingTalk proactive send failed: could not fetch access token");
|
|
4705
|
+
}
|
|
4706
|
+
if (!data.access_token) {
|
|
4707
|
+
const errmsg = sanitizeLogText(String(data.errmsg ?? ""), 200);
|
|
4708
|
+
process.stderr.write(`[DingTalk:${this.name}] proactive send failed: gettoken errcode=${data.errcode} ${errmsg}
|
|
4709
|
+
`);
|
|
4710
|
+
throw new Error(`DingTalk proactive send failed: gettoken errcode=${data.errcode}${errmsg ? ` ${errmsg}` : ""}`);
|
|
4711
|
+
}
|
|
4712
|
+
this.proactiveToken = {
|
|
4713
|
+
token: data.access_token,
|
|
4714
|
+
// Refresh a minute early so a fire mid-expiry doesn't race the TTL.
|
|
4715
|
+
expiresAt: Date.now() + Math.max(60, (data.expires_in ?? 7200) - 60) * 1e3
|
|
4716
|
+
};
|
|
4717
|
+
return data.access_token;
|
|
4718
|
+
}
|
|
4719
|
+
async sendProactiveChunk(conversationId, title, text, chunkLabel) {
|
|
4720
|
+
for (let attempt = 0; ; attempt++) {
|
|
4721
|
+
const token = await this.getProactiveToken();
|
|
4722
|
+
let resp;
|
|
4723
|
+
try {
|
|
4724
|
+
resp = await fetch(GROUP_MSG_API, {
|
|
4725
|
+
method: "POST",
|
|
4726
|
+
headers: {
|
|
4727
|
+
"x-acs-dingtalk-access-token": token,
|
|
4728
|
+
"Content-Type": "application/json"
|
|
4729
|
+
},
|
|
4730
|
+
body: JSON.stringify({
|
|
4731
|
+
robotCode: this.config.clientId,
|
|
4732
|
+
openConversationId: conversationId,
|
|
4733
|
+
msgKey: GROUP_MSG_KEY,
|
|
4734
|
+
msgParam: JSON.stringify({ title, text })
|
|
4735
|
+
}),
|
|
4736
|
+
signal: AbortSignal.timeout(PROACTIVE_FETCH_TIMEOUT_MS)
|
|
4737
|
+
});
|
|
4738
|
+
} catch (err) {
|
|
4739
|
+
const cause = err.cause;
|
|
4740
|
+
process.stderr.write(`[DingTalk:${this.name}] proactive send error (${chunkLabel}): ${err}${cause ? ` (${cause})` : ""}
|
|
4741
|
+
`);
|
|
4742
|
+
throw new Error(`DingTalk proactive send failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
4743
|
+
}
|
|
4744
|
+
if (resp.status === 401 && attempt === 0) {
|
|
4745
|
+
this.proactiveToken = void 0;
|
|
4746
|
+
await resp.body?.cancel();
|
|
4747
|
+
continue;
|
|
4748
|
+
}
|
|
4749
|
+
if (!resp.ok) {
|
|
4750
|
+
const detail = sanitizeLogText(await resp.text().catch(() => ""), 300);
|
|
4751
|
+
process.stderr.write(`[DingTalk:${this.name}] proactive send failed (${chunkLabel}): HTTP ${resp.status} ${detail}
|
|
4752
|
+
`);
|
|
4753
|
+
throw new Error(`DingTalk proactive send failed: HTTP ${resp.status}${detail ? ` ${detail}` : ""}`);
|
|
4754
|
+
}
|
|
4755
|
+
await resp.body?.cancel();
|
|
4756
|
+
return;
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4648
4759
|
getAccessToken() {
|
|
4649
4760
|
return this.client.getConfig().access_token;
|
|
4650
4761
|
}
|
|
@@ -4694,30 +4805,112 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
4694
4805
|
if (this.dedupTimer) {
|
|
4695
4806
|
clearInterval(this.dedupTimer);
|
|
4696
4807
|
}
|
|
4808
|
+
this.activeReactionKeys.clear();
|
|
4809
|
+
this.sessionReactionKeys.clear();
|
|
4697
4810
|
this.client.disconnect();
|
|
4698
4811
|
process.stderr.write(`[DingTalk:${this.name}] Disconnected.
|
|
4699
4812
|
`);
|
|
4700
4813
|
}
|
|
4701
4814
|
/**
|
|
4702
4815
|
* The chatId passed to onPromptStart/onPromptEnd is `conversationId ||
|
|
4703
|
-
* sessionWebhook` (see message handler below). Reactions
|
|
4704
|
-
* conversation ID — skip the webhook-URL fallback case.
|
|
4816
|
+
* sessionWebhook` (see message handler below). Reactions and proactive
|
|
4817
|
+
* sends require a real conversation ID — skip the webhook-URL fallback case.
|
|
4705
4818
|
*/
|
|
4706
4819
|
isConversationId(chatId) {
|
|
4707
4820
|
return !!chatId && !/^https?:\/\//i.test(chatId);
|
|
4708
4821
|
}
|
|
4709
|
-
|
|
4822
|
+
reactionKey(messageId, conversationId) {
|
|
4823
|
+
return `${conversationId}:${messageId}`;
|
|
4824
|
+
}
|
|
4825
|
+
rememberInboundMessageId(msgId) {
|
|
4826
|
+
this.inboundMessageIds.delete(msgId);
|
|
4827
|
+
this.inboundMessageIds.add(msgId);
|
|
4828
|
+
if (this.inboundMessageIds.size > 1e3) {
|
|
4829
|
+
const oldest = this.inboundMessageIds.values().next().value;
|
|
4830
|
+
if (oldest !== void 0)
|
|
4831
|
+
this.inboundMessageIds.delete(oldest);
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4834
|
+
logReactionFailure(action, err) {
|
|
4835
|
+
process.stderr.write(`[DingTalk:${this.name}] ${action} failed: ${err instanceof Error ? err.message : err}
|
|
4836
|
+
`);
|
|
4837
|
+
}
|
|
4838
|
+
startReaction(chatId, messageId, sessionId) {
|
|
4710
4839
|
if (!messageId || !this.isConversationId(chatId))
|
|
4711
4840
|
return;
|
|
4712
|
-
this.
|
|
4841
|
+
if (!this.inboundMessageIds.has(messageId))
|
|
4842
|
+
return;
|
|
4843
|
+
const key = this.reactionKey(messageId, chatId);
|
|
4844
|
+
if (this.activeReactionKeys.has(key))
|
|
4845
|
+
return;
|
|
4846
|
+
this.activeReactionKeys.add(key);
|
|
4847
|
+
if (sessionId) {
|
|
4848
|
+
let keys = this.sessionReactionKeys.get(sessionId);
|
|
4849
|
+
if (!keys) {
|
|
4850
|
+
keys = /* @__PURE__ */ new Map();
|
|
4851
|
+
this.sessionReactionKeys.set(sessionId, keys);
|
|
4852
|
+
}
|
|
4853
|
+
keys.set(key, { messageId, chatId });
|
|
4854
|
+
}
|
|
4855
|
+
this.attachReaction(messageId, chatId).then(() => {
|
|
4856
|
+
if (!this.activeReactionKeys.has(key)) {
|
|
4857
|
+
void this.recallReaction(messageId, chatId).catch((err) => {
|
|
4858
|
+
this.logReactionFailure("late reaction recall", err);
|
|
4859
|
+
});
|
|
4860
|
+
}
|
|
4861
|
+
}).catch((err) => {
|
|
4862
|
+
this.activeReactionKeys.delete(key);
|
|
4863
|
+
this.logReactionFailure("reaction attach", err);
|
|
4713
4864
|
});
|
|
4714
4865
|
}
|
|
4715
|
-
|
|
4866
|
+
stopReaction(chatId, messageId, sessionId) {
|
|
4716
4867
|
if (!messageId || !this.isConversationId(chatId))
|
|
4717
4868
|
return;
|
|
4718
|
-
this.
|
|
4869
|
+
const key = this.reactionKey(messageId, chatId);
|
|
4870
|
+
if (sessionId) {
|
|
4871
|
+
const keys = this.sessionReactionKeys.get(sessionId);
|
|
4872
|
+
if (keys) {
|
|
4873
|
+
keys.delete(key);
|
|
4874
|
+
if (keys.size === 0)
|
|
4875
|
+
this.sessionReactionKeys.delete(sessionId);
|
|
4876
|
+
}
|
|
4877
|
+
}
|
|
4878
|
+
if (!this.activeReactionKeys.delete(key))
|
|
4879
|
+
return;
|
|
4880
|
+
this.recallReaction(messageId, chatId).catch((err) => {
|
|
4881
|
+
this.logReactionFailure("reaction recall", err);
|
|
4719
4882
|
});
|
|
4720
4883
|
}
|
|
4884
|
+
/** Recall reactions left behind when a session dies without terminal lifecycle events. */
|
|
4885
|
+
onSessionDied(sessionId) {
|
|
4886
|
+
const keys = this.sessionReactionKeys.get(sessionId);
|
|
4887
|
+
if (keys) {
|
|
4888
|
+
this.sessionReactionKeys.delete(sessionId);
|
|
4889
|
+
for (const [key, { messageId, chatId }] of keys) {
|
|
4890
|
+
if (this.activeReactionKeys.delete(key)) {
|
|
4891
|
+
void this.recallReaction(messageId, chatId).catch((err) => {
|
|
4892
|
+
this.logReactionFailure("session-death reaction recall", err);
|
|
4893
|
+
});
|
|
4894
|
+
}
|
|
4895
|
+
}
|
|
4896
|
+
}
|
|
4897
|
+
super.onSessionDied(sessionId);
|
|
4898
|
+
}
|
|
4899
|
+
onTaskLifecycle(event) {
|
|
4900
|
+
if (event.type === "started") {
|
|
4901
|
+
this.startReaction(event.chatId, event.messageId, event.sessionId);
|
|
4902
|
+
return;
|
|
4903
|
+
}
|
|
4904
|
+
if (isTerminalTaskLifecycleType(event.type)) {
|
|
4905
|
+
this.stopReaction(event.chatId, event.messageId, event.sessionId);
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
onPromptStart(chatId, sessionId, messageId) {
|
|
4909
|
+
this.startReaction(chatId, messageId, sessionId);
|
|
4910
|
+
}
|
|
4911
|
+
onPromptEnd(chatId, sessionId, messageId) {
|
|
4912
|
+
this.stopReaction(chatId, messageId, sessionId);
|
|
4913
|
+
}
|
|
4721
4914
|
/**
|
|
4722
4915
|
* Extract quoted/referenced message context from a reply.
|
|
4723
4916
|
* DingTalk provides this via text.repliedMsg (newer) or quoteMessage (legacy).
|
|
@@ -4897,6 +5090,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
4897
5090
|
}
|
|
4898
5091
|
if (msgId) {
|
|
4899
5092
|
this.seenMessages.set(msgId, Date.now());
|
|
5093
|
+
this.rememberInboundMessageId(msgId);
|
|
4900
5094
|
}
|
|
4901
5095
|
const isGroup = data.conversationType === "2";
|
|
4902
5096
|
const sessionWebhook = typeof data.sessionWebhook === "string" ? data.sessionWebhook : void 0;
|