@qwen-code/qwen-code 0.23.2-preview.0 → 0.23.2
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/auth.md +1 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +19 -15
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
- package/bundled/qc-helper/docs/features/channels/github.md +1 -9
- package/bundled/qc-helper/docs/features/channels/overview.md +26 -51
- package/bundled/qc-helper/docs/features/channels/qqbot.md +1 -2
- package/bundled/qc-helper/docs/features/commands.md +48 -9
- package/bundled/qc-helper/docs/features/goals.md +2 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +8 -0
- package/bundled/qc-helper/docs/qwen-serve.md +62 -48
- package/chunks/{MaxSizedBox-ZZJT3PJF.js → MaxSizedBox-4C3BKKKY.js} +17 -16
- package/chunks/{StandaloneSessionPicker-DIOSZTMX.js → StandaloneSessionPicker-TXVF65YW.js} +32 -31
- package/chunks/{acpAgent-62JUP5A7.js → acpAgent-H5XBKGB4.js} +301 -166
- package/chunks/{agent-NLPEQQDZ.js → agent-T5LEFJIU.js} +10 -10
- package/chunks/{agent-headless-Y2GR5F2Q.js → agent-headless-VZKSRH36.js} +10 -10
- package/chunks/{anthropicContentGenerator-I7LQZH26.js → anthropicContentGenerator-PRJWWVYJ.js} +2 -2
- package/chunks/{artifact-tool-P52OKKEF.js → artifact-tool-G5LHNECG.js} +1 -1
- package/chunks/{bridge-Q66BD62H.js → bridge-AOX5IY44.js} +18 -17
- package/chunks/{channel-management-service-TRTLQTSV.js → channel-management-service-MWQGHPAS.js} +4 -4
- package/chunks/{channel-settings-store-R5STFWUW.js → channel-settings-store-XZCGDGHW.js} +26 -25
- package/chunks/{channel-worker-group-PIYPVCTF.js → channel-worker-group-SQ5FRWOH.js} +5 -5
- package/chunks/{channel-worker-manager-FQHEDTD2.js → channel-worker-manager-TU4ZNWOE.js} +5 -5
- package/chunks/{channel-worker-supervisor-XJPZZ3VK.js → channel-worker-supervisor-EMITFMCP.js} +4 -4
- package/chunks/{chunk-3SH53ANB.js → chunk-22GORRNY.js} +12 -0
- package/chunks/{chunk-7L35FKPF.js → chunk-2BMXHB6N.js} +2 -2
- package/chunks/chunk-2WC3Y7YY.js +1033 -0
- package/chunks/{chunk-WZ4YULVF.js → chunk-3OAXF3UK.js} +210 -80
- package/chunks/{chunk-W673V2H3.js → chunk-46MMBZHI.js} +3 -3
- package/chunks/{chunk-6GRDHIVI.js → chunk-4I3WFI3U.js} +4 -4
- package/chunks/{chunk-QXXBW2G4.js → chunk-4JNHNVAZ.js} +3 -3
- package/chunks/{chunk-R2266LQ5.js → chunk-4WMGYG3F.js} +2 -2
- package/chunks/{chunk-Y6ZWXM44.js → chunk-5BH2AIEY.js} +1 -1
- package/chunks/{chunk-EA4NFWVG.js → chunk-5OZUKLL7.js} +3 -3
- package/chunks/{chunk-RX3FYFCN.js → chunk-67XTVRVB.js} +1 -1
- package/chunks/{chunk-MA5OUNN6.js → chunk-6G4V7SE4.js} +1 -1
- package/chunks/{chunk-B54PFQS5.js → chunk-7CLLH5TI.js} +1 -1
- package/chunks/{chunk-7GZCCHJL.js → chunk-7LTCFO6T.js} +3 -3
- package/chunks/{chunk-33MLFMCL.js → chunk-7NDZKE2M.js} +2 -2
- package/chunks/{chunk-5WC2ECUK.js → chunk-7PD7ZMX5.js} +17 -4
- package/chunks/{chunk-ZUNWKOAP.js → chunk-7SVM3RP2.js} +4 -24
- package/chunks/{chunk-5GD7LYOH.js → chunk-A7EFXK7P.js} +1 -1
- package/chunks/{chunk-RDV4NLI3.js → chunk-AO2VMS72.js} +2 -2
- package/chunks/{chunk-XAXTQURR.js → chunk-APXIW2TF.js} +3 -3
- package/chunks/{chunk-3BTHHXXE.js → chunk-AUTUFD5X.js} +1 -1
- package/chunks/{chunk-VH764G6B.js → chunk-B25JYXZE.js} +2 -2
- package/chunks/{chunk-MMMA36MN.js → chunk-BK7D2JR6.js} +3 -3
- package/chunks/{chunk-RPFJJ33Z.js → chunk-CALTQWTZ.js} +1 -1
- package/chunks/{chunk-EUXF6URV.js → chunk-CCBTNJB4.js} +16 -18
- package/chunks/{chunk-BF3RUIVP.js → chunk-CH2YDT6X.js} +36 -38
- package/chunks/{chunk-L6ZME3W7.js → chunk-CMWU6P4D.js} +1 -1
- package/chunks/{chunk-QJAFSFYA.js → chunk-CWVZBIZJ.js} +1 -1
- package/chunks/{chunk-JDPBJIKI.js → chunk-DAI65CMX.js} +1 -1
- package/chunks/{chunk-GM44O6F7.js → chunk-DARWOZY6.js} +1 -1
- package/chunks/{chunk-J4ECGDA3.js → chunk-ELD3OBPU.js} +3 -3
- package/chunks/{chunk-ZELCTN6Y.js → chunk-F23YN37B.js} +10 -0
- package/chunks/{chunk-OIPUQE3S.js → chunk-F2NYVASI.js} +14 -1
- package/chunks/{chunk-ODBNTMZW.js → chunk-FAJPLSYF.js} +36 -29
- package/chunks/{chunk-GXIHBIHC.js → chunk-FGHPZGOP.js} +29 -24
- package/chunks/{chunk-TK4XHPKW.js → chunk-G37O7YO6.js} +2 -2
- package/chunks/{chunk-4JKLPTV6.js → chunk-G3ZUMSFS.js} +12 -5
- package/chunks/{chunk-743XE7N7.js → chunk-G5VOXCRX.js} +1 -1
- package/chunks/{chunk-BL6B2QS2.js → chunk-GOEVQADN.js} +618 -1122
- package/chunks/{chunk-XI7RST4D.js → chunk-GOKAOSCN.js} +1 -1
- package/chunks/{chunk-FDOGGKAA.js → chunk-GSFV5RQW.js} +2 -0
- package/chunks/{chunk-43CI6YWJ.js → chunk-HJ5UJQQL.js} +1384 -1245
- package/chunks/{chunk-LUVXLLMS.js → chunk-IR6JKBAP.js} +1 -1
- package/chunks/{chunk-CPJRFFPH.js → chunk-IRGDIDGJ.js} +558 -158
- package/chunks/{chunk-DCPRCDSR.js → chunk-IWABUX6T.js} +1 -1
- package/chunks/{chunk-DTB5BXRG.js → chunk-JO77FGNZ.js} +16 -15
- package/chunks/{chunk-45ROPFQY.js → chunk-JYGIJA4W.js} +1 -1
- package/chunks/{chunk-M6YLOETP.js → chunk-KCF2436G.js} +1 -1
- package/chunks/{chunk-CABDNUJ4.js → chunk-KEPC5BOL.js} +5 -5
- package/chunks/{chunk-RN6V5HKE.js → chunk-KFECPHLV.js} +3 -3
- package/chunks/{chunk-WIRYFL2L.js → chunk-LEAOJ43M.js} +17 -15
- package/chunks/{chunk-IUJLW6ZI.js → chunk-LUNC5KCL.js} +3 -3
- package/chunks/{chunk-WZS3X663.js → chunk-LWX4WDFF.js} +2 -5
- package/chunks/{chunk-ISPBBKJN.js → chunk-MV5DTLJV.js} +7 -2
- package/chunks/chunk-NFXXBWSE.js +463 -0
- package/chunks/{chunk-PQSCGZT2.js → chunk-NPKCVSXX.js} +26 -2
- package/chunks/{chunk-7RXOEUFF.js → chunk-NX7ZTXFF.js} +1 -1
- package/chunks/{chunk-G5QLLD53.js → chunk-OXR34GCD.js} +14 -2
- package/chunks/{chunk-VHPG7BH6.js → chunk-PDN7FJZV.js} +1 -1
- package/chunks/{chunk-UHUT4IDM.js → chunk-PFKGV6PO.js} +9 -9
- package/chunks/{chunk-NFIDVZND.js → chunk-QB3KS3N3.js} +2 -21
- package/chunks/{chunk-QLM7D7W3.js → chunk-QFJZAY7W.js} +7 -7
- package/chunks/{chunk-NVS4Z6GT.js → chunk-QHLHE2OT.js} +1 -1
- package/chunks/{chunk-B44JBZBB.js → chunk-QQK4L3UU.js} +1 -1
- package/chunks/{chunk-63ACHB2H.js → chunk-QTB4VP4K.js} +50 -18
- package/chunks/{chunk-4BLTSTF6.js → chunk-R3JIDRUL.js} +4 -4
- package/chunks/{chunk-VEQBVJYH.js → chunk-R457KFV7.js} +3 -3
- package/chunks/{chunk-CG2PDIGD.js → chunk-RM244SCQ.js} +1 -1
- package/chunks/{chunk-W7PXLIZJ.js → chunk-RNAJVXUG.js} +5 -5
- package/chunks/{chunk-VF6D6EGV.js → chunk-S5QR6CB5.js} +52 -6
- package/chunks/{chunk-IRKQ4YYX.js → chunk-SVWWF5TZ.js} +29 -1
- package/chunks/{chunk-5HBA2Z7V.js → chunk-TGNNLRC3.js} +2 -3
- package/chunks/{chunk-ORREXWOM.js → chunk-TODNHE76.js} +3 -3
- package/chunks/{chunk-W3ONSAYO.js → chunk-TOOOLHVS.js} +2 -2
- package/chunks/{chunk-EHTKOO6W.js → chunk-TRQNRP2H.js} +2 -2
- package/chunks/{chunk-PQWM4SX2.js → chunk-U6REWGVR.js} +2 -2
- package/chunks/{chunk-UXDVUFKU.js → chunk-ULZECEIP.js} +2 -2
- package/chunks/{chunk-6YEOCHSE.js → chunk-VBLAI2HA.js} +101 -0
- package/chunks/{chunk-M73KHGNR.js → chunk-VJJXG73H.js} +404 -226
- package/chunks/{chunk-Q2F43WTJ.js → chunk-WBU2PIZ5.js} +23 -6
- package/chunks/{chunk-UULHYZ4W.js → chunk-WDN64MVT.js} +74 -15
- package/chunks/{chunk-XVTCSVBK.js → chunk-WDVV3LRM.js} +193 -169
- package/chunks/{chunk-LBKYQ33T.js → chunk-WK7P62DV.js} +16 -10
- package/chunks/{chunk-ULY4ISY2.js → chunk-WXD7INFV.js} +19 -4
- package/chunks/{chunk-ZIPYCXQP.js → chunk-WXPPUPHM.js} +1 -1
- package/chunks/{chunk-5Z4FCEPY.js → chunk-X7LFJF5D.js} +600 -46
- package/chunks/{chunk-YHDGABDC.js → chunk-XKBFYTCD.js} +1 -1
- package/chunks/{chunk-MWEF5MUK.js → chunk-XSOXPG2L.js} +8 -8
- package/chunks/{chunk-5VZFJTL2.js → chunk-YLOHCA6I.js} +2 -2
- package/chunks/{chunk-LN3WBOKU.js → chunk-YQGW3M6Z.js} +2 -2
- package/chunks/{chunk-2OR32P5M.js → chunk-ZN5TKAVR.js} +125 -10
- package/chunks/{chunk-XBLG564H.js → chunk-ZP5XDLSA.js} +10 -10
- package/chunks/{config-utils-37FHWPTP.js → config-utils-GPLIABL2.js} +21 -20
- package/chunks/{contextCommand-R4JUBV5N.js → contextCommand-NCUQUDBY.js} +18 -17
- package/chunks/{core-runtime-6U4OXU5C.js → core-runtime-WKYKWVYU.js} +23 -21
- package/chunks/{create-sub-session-LLUYAGZN.js → create-sub-session-PPLXB3JJ.js} +17 -16
- package/chunks/{daemon-UI6SQSBV.js → daemon-2CKIAO3I.js} +2 -2
- package/chunks/{daemon-git-worktree-guard-O2UTNFJC.js → daemon-git-worktree-guard-73ZWOLKL.js} +17 -16
- package/chunks/{daemon-status-provider-7GMAKSTX.js → daemon-status-provider-OK7VONJG.js} +22 -21
- package/chunks/{daemon-trust-policy-VNP76VMO.js → daemon-trust-policy-CAUCREG2.js} +22 -21
- package/chunks/{daemon-trust-policy-monitor-TD5O3BZA.js → daemon-trust-policy-monitor-3Y36OOEQ.js} +22 -21
- package/chunks/{deferred-core-runtime-NJM63YJS.js → deferred-core-runtime-Q7WFWYD3.js} +17 -16
- package/chunks/{dist-STAGIFNB.js → dist-6YDUH3BB.js} +388 -102
- package/chunks/{dist-XJ25G6OH.js → dist-BNQVF565.js} +2 -8
- package/chunks/{dist-NQ2636VT.js → dist-F34J4FZX.js} +1 -1
- package/chunks/{dist-OR2ZQTXZ.js → dist-F6JLAJLE.js} +1 -1
- package/chunks/{dist-WZTUKIDR.js → dist-NP7QKLVG.js} +2 -2
- package/chunks/{dist-M4CBX53H.js → dist-UFTFGI6I.js} +1 -1
- package/chunks/{dist-5I4HLUTO.js → dist-XLV33CLY.js} +1 -2
- package/chunks/{dist-24TCWK5H.js → dist-Y5KC3IHW.js} +1 -2
- package/chunks/{dist-FDISN4AK.js → dist-ZDNJK74R.js} +3 -7
- package/chunks/{edit-GL7OA6RV.js → edit-YJD6IETK.js} +10 -10
- package/chunks/{enterPlanMode-VC4BCSZE.js → enterPlanMode-EFPVTWIH.js} +10 -10
- package/chunks/{environment-BI6IBAZJ.js → environment-HP3AXFTB.js} +19 -18
- package/chunks/{errors-D6G2ZM2R.js → errors-22ON46G7.js} +19 -18
- package/chunks/{exitPlanMode-DX446CA6.js → exitPlanMode-MOQUNCBH.js} +10 -10
- package/chunks/{fast-path-MAYDLJIP.js → fast-path-2X7BPMXX.js} +3 -3
- package/chunks/{glob-TVKRFY36.js → glob-Y7ACIB3P.js} +10 -10
- package/chunks/{goal-tools-CA6YANRN.js → goal-tools-DABMICUC.js} +10 -10
- package/chunks/{handleAutoUpdate-AW4ZAHON.js → handleAutoUpdate-MCAMHYDI.js} +19 -18
- package/chunks/{i18n-IH5CRAY7.js → i18n-C3GDCALP.js} +17 -16
- package/chunks/{initializer-UBR37ZNM.js → initializer-4URDQL2G.js} +22 -21
- package/chunks/{installationInfo-Y52756EC.js → installationInfo-LBOL6SBV.js} +17 -16
- package/chunks/{list-7V5JDZPO.js → list-JOGBAC2R.js} +25 -24
- package/chunks/{list-agents-I5TRH3J7.js → list-agents-2CXPGJUE.js} +3 -3
- package/chunks/{llm-QDB6JVF5.js → llm-2KPNSAVY.js} +65 -59
- package/chunks/{llm-content-generator-EO6MZCEO.js → llm-content-generator-GR3FOHLB.js} +2 -2
- package/chunks/{loadedSettingsAdapter-I3YQKMC4.js → loadedSettingsAdapter-DVKROEJD.js} +22 -21
- package/chunks/{loggingContentGenerator-MNXYUGDG.js → loggingContentGenerator-P4K6K5W4.js} +12 -12
- package/chunks/{managed-npm-update-EA3EXPTO.js → managed-npm-update-VWBKHNIN.js} +17 -16
- package/chunks/{mcp-QTAJ544Y.js → mcp-6YYNSYLK.js} +22 -21
- package/chunks/{monitor-6FQKQOTP.js → monitor-A255TNZR.js} +10 -10
- package/chunks/{nonInteractiveCli-MRCTZL5X.js → nonInteractiveCli-LXGIKQAT.js} +55 -54
- package/chunks/{notebook-edit-BQQCKI7K.js → notebook-edit-5UYHS2DM.js} +10 -10
- package/chunks/{open-with-auth-D6JD6LDS.js → open-with-auth-6MVIHMXB.js} +1 -1
- package/chunks/{openaiContentGenerator-TTSKXNVH.js → openaiContentGenerator-A6MAMEO5.js} +7 -7
- package/chunks/{pidfile-KPIS6RIT.js → pidfile-B7DZC4TP.js} +20 -17
- package/chunks/{processUtils-ZCASPKK4.js → processUtils-BPZ2MCZS.js} +2 -2
- package/chunks/{prompt-terminal-ledger-D6HM6TV7.js → prompt-terminal-ledger-FYYTAOXS.js} +18 -17
- package/chunks/{qwenContentGenerator-GGZEFLBD.js → qwenContentGenerator-4IOJFD4S.js} +13 -13
- package/chunks/{read-file-VE5GDFLP.js → read-file-A4H4O3VQ.js} +2 -2
- package/chunks/{resumeHistoryUtils-HSSGMYDC.js → resumeHistoryUtils-YQQ43E4N.js} +19 -18
- package/chunks/{ripGrep-SEJE7AA6.js → ripGrep-W32NWFTA.js} +3 -3
- package/chunks/{run-qwen-serve-OJYVH7N6.js → run-qwen-serve-WBSWWIRV.js} +216 -64
- package/chunks/{runtime-KGMQQFJD.js → runtime-VRVBX2E5.js} +29 -26
- package/chunks/{scheduled-tasks-7H5HWHYD.js → scheduled-tasks-D65KJDA3.js} +20 -19
- package/chunks/{scheduler-BE42AKDG.js → scheduler-M2YPN7Z7.js} +19 -18
- package/chunks/{send-message-AWKUDJBH.js → send-message-76BKWKFZ.js} +3 -3
- package/chunks/{serve-KZVKYMSL.js → serve-BE3H2P6P.js} +22 -21
- package/chunks/{server-PJRALPJQ.js → server-FLY5JERG.js} +84 -148
- package/chunks/{session-IHITXU2S.js → session-JVN62R5K.js} +85 -57
- package/chunks/{session-attachments-root-GQ2TUI3Y.js → session-attachments-root-7ACGLHXA.js} +17 -16
- package/chunks/{session-pr-refresh-H43LULTE.js → session-pr-refresh-TQS57SDK.js} +19 -18
- package/chunks/{settings-RKEQQDFC.js → settings-D44YMZFT.js} +21 -20
- package/chunks/{shell-6PJ444U5.js → shell-3VE6I4V5.js} +10 -10
- package/chunks/{skill-Q3UP7B5V.js → skill-FHEGRRZU.js} +2 -2
- package/chunks/{skill-settings-LZR5YRRW.js → skill-settings-VHEJMBFL.js} +21 -20
- package/chunks/{spawnChannel-WM3DT2BF.js → spawnChannel-T6MX2ZDN.js} +17 -16
- package/chunks/{standalone-update-E5474IBI.js → standalone-update-QUGHFMCS.js} +18 -17
- package/chunks/{start-opentui-ui-WLWZNQ2I.js → start-opentui-ui-IHIIZ2LE.js} +438 -203
- package/chunks/{startInteractiveUI-FBQSGWGO.js → startInteractiveUI-LR7K2ARZ.js} +1171 -1234
- package/chunks/{task-create-PMAFST2T.js → task-create-MWXJFRRM.js} +3 -3
- package/chunks/{task-list-R2HSY2NC.js → task-list-EYO3FE57.js} +2 -2
- package/chunks/{task-update-JYC57USF.js → task-update-2JJJRHMT.js} +3 -3
- package/chunks/{team-create-VIGUFUT4.js → team-create-GY3VFY47.js} +10 -10
- package/chunks/{team-delete-CBHVBTPB.js → team-delete-IQZ6XGFI.js} +2 -2
- package/chunks/{team-plan-approval-HQVZA3MD.js → team-plan-approval-BQPGZOT5.js} +10 -10
- package/chunks/{terminal-image-renderer-LUKNCOVM.js → terminal-image-renderer-YNYW5CQG.js} +17 -16
- package/chunks/{theme-manager-LOENKYLY.js → theme-manager-U6CIK3GM.js} +17 -16
- package/chunks/{tool-search-ZIFAQCE2.js → tool-search-XI3QWD5I.js} +2 -2
- package/chunks/{total-session-admission-FUUJH3QH.js → total-session-admission-3SNSJJ32.js} +18 -17
- package/chunks/{trustedFolders-C76KYROP.js → trustedFolders-OVAQKNV5.js} +18 -17
- package/chunks/{update-relaunch-4G2SRXKX.js → update-relaunch-XV5O74E3.js} +5 -5
- package/chunks/{updateCheck-EIZIO7HI.js → updateCheck-CHUYWD6L.js} +17 -16
- package/chunks/{useAutoAcceptIndicator-EAA6KSY4.js → useAutoAcceptIndicator-VKSVIXZC.js} +23 -22
- package/chunks/{validateNonInterActiveAuth-BRX22QCN.js → validateNonInterActiveAuth-ZNUTD3E5.js} +53 -52
- package/chunks/{version-E56RU7PR.js → version-EK7VAGSI.js} +3 -1
- package/chunks/{web-fetch-AAUCD7RM.js → web-fetch-24KZO763.js} +2 -2
- package/chunks/{web-search-HFUQF44Q.js → web-search-CRNXKZ2X.js} +184 -7
- package/chunks/{web-shell-static-POZHGGXE.js → web-shell-static-BFDESDD4.js} +5 -4
- package/chunks/{workflow-3MABM53N.js → workflow-HD5NYMW5.js} +201 -65
- package/chunks/{workspace-providers-status-2FRLBZ5I.js → workspace-providers-status-MAM42IZS.js} +24 -23
- package/chunks/{workspace-registration-store-YL7HLYYI.js → workspace-registration-store-HKLJEDQX.js} +1 -2
- package/chunks/{workspace-registry-BNRP2ELW.js → workspace-registry-7RDDOBLN.js} +18 -17
- package/chunks/{workspace-runtime-coordinator-WKGF7VHS.js → workspace-runtime-coordinator-LEPDPXJO.js} +18 -17
- package/chunks/{workspace-service-4MYO72MM.js → workspace-service-5IFDCNN3.js} +23 -22
- package/chunks/{workspace-skills-status-SU66TJLZ.js → workspace-skills-status-FJ3HNH4H.js} +22 -21
- package/chunks/{workspace-trust-reconciler-D5QT7WQB.js → workspace-trust-reconciler-PQFHIWLR.js} +23 -22
- package/chunks/{write-file-NVPQE2AZ.js → write-file-ERG67ZFX.js} +11 -11
- package/chunks/{zoom-image-RJHC66WG.js → zoom-image-WQYEC3SR.js} +2 -2
- package/cli.js +12 -12
- package/export-transcript-document.js +82 -82
- package/package.json +4 -4
- package/web-shell/assets/{abnfDiagram-VCTEODGH-DHc6plZn.js → abnfDiagram-VCTEODGH-BRLgQbnT.js} +1 -1
- package/web-shell/assets/{arc-BQ9m8TDV.js → arc-qAF9_XsR.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-D5ap3oVB.js → architectureDiagram-5GKGNRK7-BorUttEz.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-BIbnyNph.js → blockDiagram-NRAW4CY4-Bj0qZVxu.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BRsdx_iG.js → c4Diagram-UCG6FXSJ-BTqJis32.js} +1 -1
- package/web-shell/assets/channel-COIuCrVH.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-3lf1fNlx.js → chunk-2Q5K7J3B-RrQ5X8m-.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-DP8VNRc4.js → chunk-5VM5RSS4-uUjDl8wO.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-DrohDmZ6.js → chunk-F27PBJKO-C3JhpyzI.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-UZ2QhSx6.js → chunk-G27WJ6UU-C8ZNFs7F.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-BIMHVcZK.js → chunk-JWPE2WC7-DNpXtEOs.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-izRxdSDd.js → chunk-LCL6LL3I-DagA2ZLw.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-CXADD4PP.js → chunk-POPQ4Y6H-R23uH7Xm.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-B96d8Y_1.js → chunk-SVP7TREG-Qz9RN_BR.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-CF2sVQpv.js → chunk-XXDRQBXY-jYb1_hni.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DoX6OYqu.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DoX6OYqu.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-CT6tXVAS.js → cose-bilkent-JH36ORCC-Cv2OunpE.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-X1NS4vtV.js → cynefin-OW5HDTMX-LH42KFJx.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-DNsKNOT4.js → cynefinDiagram-5FMLGOSQ-Dha4_OoR.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-9-AHKqsb.js → dagre-3AP2YEHR-Br5lnUKD.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-Bjgms7j6.js → diagram-S7CK7UJ4-dpKq2bBX.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-h6bCprbE.js → diagram-UQ7AKVKN-BAgHWpXr.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-4SbQXVLt.js → diagram-VSXAHHWV-GRRzpyE2.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-B5gPCzzB.js → diagram-VX7I27RA-BNFiaYpG.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-DFJXIA3A.js → diagram-Z3DM3KII-BisZzB_h.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-FwyaU7VY.js → ebnfDiagram-PWID7BFC-B1xbwycf.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-8vJQh2te.js → erDiagram-SSCWMZ5O-CQMzbGE5.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-BzA_1gMN.js → flowDiagram-A5DVABFB-CZ_Zondl.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-Co-ABbVX.js → ganttDiagram-EL5Y4UJY-BTh2ShxS.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-DW_FcyrX.js → gitGraphDiagram-WWUBYQGX-oHOB-Uxt.js} +1 -1
- package/web-shell/assets/{index-Bu-rZoJ-.js → index-CI1ysIEv.js} +478 -474
- package/web-shell/assets/index-CpxXGH-8.css +36 -0
- package/web-shell/assets/{index-BbMXfhNG.js → index-DWoFMu5x.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-BEgfhUFN.js → infoDiagram-RXCK75RN-C0QpudbG.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-DCsMxQmc.js → ishikawaDiagram-5VMMS53U-a6B741uT.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-DyIEYoHz.js → journeyDiagram-EYS64GPL-Dbht9ICp.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-CkxjqCNr.js → kanban-definition-3QL26DDD-D4OFR8-h.js} +1 -1
- package/web-shell/assets/{layout-BEWc0Al9.js → layout-Dvdh5jRH.js} +1 -1
- package/web-shell/assets/{linear-CNuNxirL.js → linear-Dvc6KIW2.js} +1 -1
- package/web-shell/assets/{mermaid.core-DZBre674.js → mermaid.core-CB36RfIb.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-CpafFz_F.js → mindmap-definition-FBJOCRG2-Fmqo1CjP.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-DfZqk_dq.js → pegDiagram-XKGWAZYB-CCxYBoA4.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-S0UWXlgC.js → pieDiagram-E7YTZNPT-BVHKQFzt.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-dd37_Ohj.js → quadrantDiagram-AXDQQJYC-l95IznwR.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-CH8NJZ7u.js → railroadDiagram-O6MQD6OU-BlLdRdXp.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-CFdqWYih.js → requirementDiagram-EFPCY7ZU-BkDLBR5w.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CsddcEGD.js → sankeyDiagram-P5KCCOFB-jAIqRp65.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-BZ270mGw.js → sequenceDiagram-WJ2MYXX4-f-soZYPr.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-CGaS4DBV.js → sizeCapture-X5ZJPWSS-BzOuAfB2.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-COpIzMu6.js → stateDiagram-HBIQ2CUA-BPLSs12r.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-IRul-LaT.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-CMF889m3.js → swimlanes-XN3QIQJK-D-9E_RIR.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-D6lgKepA.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-BelnxYz5.js → timeline-definition-24CTP7MA-CT56K-gV.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-CU-NRqIB.js → vennDiagram-4TSXK5OY-B-vi4IyO.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CDNKqWh-.js → wardleyDiagram-VM6X3IG4-C9O7Ju98.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-CLqguL5D.js → xychartDiagram-S5SC5T6Z-6d8w3jg2.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-X35VIWWJ.js +0 -276
- package/web-shell/assets/channel-uMMdTrYk.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DcY-26Ig.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DcY-26Ig.js +0 -1
- package/web-shell/assets/index-CsPwZ1ut.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-D6qEVAji.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-mem5Jj4m.js +0 -8
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
sanitizePromptText,
|
|
15
15
|
sanitizeSenderName,
|
|
16
16
|
truncateUtf16Units
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WDVV3LRM.js";
|
|
18
18
|
import "./chunk-IW6RQPQB.js";
|
|
19
19
|
import "./chunk-CQ35AJ4Z.js";
|
|
20
20
|
import "./chunk-DMTGGOSA.js";
|
|
@@ -38,7 +38,7 @@ init_esbuild_shims();
|
|
|
38
38
|
// packages/channels/dingtalk/dist/DingtalkAdapter.js
|
|
39
39
|
init_esbuild_shims();
|
|
40
40
|
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
41
|
-
import { randomUUID as
|
|
41
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
42
42
|
import { basename as basename3, join } from "node:path";
|
|
43
43
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
44
44
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
@@ -6279,11 +6279,6 @@ function projectFileText(text) {
|
|
|
6279
6279
|
return projector.result(safe);
|
|
6280
6280
|
}
|
|
6281
6281
|
__name(projectFileText, "projectFileText");
|
|
6282
|
-
function withFileUnavailableNotice(text) {
|
|
6283
|
-
const safe = text.trimEnd();
|
|
6284
|
-
return `${safe}${safe ? "\n" : ""}${FILE_UNAVAILABLE_NOTICE}`;
|
|
6285
|
-
}
|
|
6286
|
-
__name(withFileUnavailableNotice, "withFileUnavailableNotice");
|
|
6287
6282
|
function safeFileName(filePath) {
|
|
6288
6283
|
return basename2(filePath).replace(/[\p{Cc}\p{Cf}[\]]+/gu, "_").slice(0, 200) || "file";
|
|
6289
6284
|
}
|
|
@@ -6853,16 +6848,24 @@ function parseDingtalkInteractiveCardConfig(value) {
|
|
|
6853
6848
|
const root = asRecord(value) ?? {};
|
|
6854
6849
|
const status = asRecord(root["statusCard"]);
|
|
6855
6850
|
const question = asRecord(root["questionCard"]);
|
|
6851
|
+
const permission = asRecord(root["permissionCard"]);
|
|
6856
6852
|
if (root["statusCard"] !== void 0 && !status) {
|
|
6857
6853
|
throw new Error("DingTalk interactiveCards.statusCard must be an object.");
|
|
6858
6854
|
}
|
|
6859
6855
|
if (root["questionCard"] !== void 0 && !question) {
|
|
6860
6856
|
throw new Error("DingTalk interactiveCards.questionCard must be an object.");
|
|
6861
6857
|
}
|
|
6862
|
-
|
|
6863
|
-
|
|
6858
|
+
if (root["permissionCard"] !== void 0 && !permission) {
|
|
6859
|
+
throw new Error("DingTalk interactiveCards.permissionCard must be an object.");
|
|
6860
|
+
}
|
|
6861
|
+
const questionTimeoutMs = question?.["timeoutMs"] === void 0 ? DEFAULT_QUESTION_TIMEOUT_MS : question["timeoutMs"];
|
|
6862
|
+
if (typeof questionTimeoutMs !== "number" || !Number.isFinite(questionTimeoutMs) || questionTimeoutMs <= DINGTALK_INTERACTIVE_CARD_TIMEOUT_EXCLUSIVE_MINIMUM) {
|
|
6864
6863
|
throw new Error("DingTalk interactiveCards.questionCard.timeoutMs must be a finite positive number.");
|
|
6865
6864
|
}
|
|
6865
|
+
const permissionTimeoutMs = permission?.["timeoutMs"] === void 0 ? DEFAULT_QUESTION_TIMEOUT_MS : permission["timeoutMs"];
|
|
6866
|
+
if (typeof permissionTimeoutMs !== "number" || !Number.isFinite(permissionTimeoutMs) || permissionTimeoutMs <= DINGTALK_INTERACTIVE_CARD_TIMEOUT_EXCLUSIVE_MINIMUM) {
|
|
6867
|
+
throw new Error("DingTalk interactiveCards.permissionCard.timeoutMs must be a finite positive number.");
|
|
6868
|
+
}
|
|
6866
6869
|
return {
|
|
6867
6870
|
enabled: optionalBoolean(root["enabled"], "enabled", configured),
|
|
6868
6871
|
statusCard: {
|
|
@@ -6870,7 +6873,11 @@ function parseDingtalkInteractiveCardConfig(value) {
|
|
|
6870
6873
|
},
|
|
6871
6874
|
questionCard: {
|
|
6872
6875
|
enabled: optionalBoolean(question?.["enabled"], "questionCard.enabled", true),
|
|
6873
|
-
timeoutMs: Math.min(
|
|
6876
|
+
timeoutMs: Math.min(questionTimeoutMs, DINGTALK_INTERACTIVE_CARD_TIMEOUT_MAXIMUM_MS)
|
|
6877
|
+
},
|
|
6878
|
+
permissionCard: {
|
|
6879
|
+
enabled: optionalBoolean(permission?.["enabled"], "permissionCard.enabled", true),
|
|
6880
|
+
timeoutMs: Math.min(permissionTimeoutMs, DINGTALK_INTERACTIVE_CARD_TIMEOUT_MAXIMUM_MS)
|
|
6874
6881
|
}
|
|
6875
6882
|
};
|
|
6876
6883
|
}
|
|
@@ -7981,9 +7988,294 @@ ${text}`;
|
|
|
7981
7988
|
}
|
|
7982
7989
|
};
|
|
7983
7990
|
|
|
7984
|
-
// packages/channels/dingtalk/dist/
|
|
7991
|
+
// packages/channels/dingtalk/dist/permission-card-controller.js
|
|
7985
7992
|
init_esbuild_shims();
|
|
7986
7993
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
7994
|
+
var DECISION_FIELD = "permission_decision";
|
|
7995
|
+
var PERMISSION_CARD_COPY = {
|
|
7996
|
+
en: {
|
|
7997
|
+
title: "Permission required",
|
|
7998
|
+
submit: "Submit",
|
|
7999
|
+
choose: "Choose how to continue",
|
|
8000
|
+
approved: { description: "Permission approved.", button: "Approved" },
|
|
8001
|
+
denied: { description: "Permission denied.", button: "Denied" },
|
|
8002
|
+
expired: {
|
|
8003
|
+
description: "This permission request is no longer available.",
|
|
8004
|
+
button: "Expired"
|
|
8005
|
+
},
|
|
8006
|
+
cancelled: {
|
|
8007
|
+
description: "Permission request cancelled.",
|
|
8008
|
+
button: "Cancelled"
|
|
8009
|
+
}
|
|
8010
|
+
},
|
|
8011
|
+
zh: {
|
|
8012
|
+
title: "\u9700\u8981\u6388\u6743",
|
|
8013
|
+
submit: "\u63D0\u4EA4",
|
|
8014
|
+
choose: "\u8BF7\u9009\u62E9\u540E\u7EED\u64CD\u4F5C",
|
|
8015
|
+
approved: { description: "\u5DF2\u6388\u6743\u3002", button: "\u5DF2\u6388\u6743" },
|
|
8016
|
+
denied: { description: "\u5DF2\u62D2\u7EDD\u6388\u6743\u3002", button: "\u5DF2\u62D2\u7EDD" },
|
|
8017
|
+
expired: { description: "\u6B64\u6388\u6743\u8BF7\u6C42\u5DF2\u5931\u6548\u3002", button: "\u5DF2\u5931\u6548" },
|
|
8018
|
+
cancelled: { description: "\u6388\u6743\u8BF7\u6C42\u5DF2\u53D6\u6D88\u3002", button: "\u5DF2\u53D6\u6D88" }
|
|
8019
|
+
}
|
|
8020
|
+
};
|
|
8021
|
+
var PermissionCardController = class {
|
|
8022
|
+
static {
|
|
8023
|
+
__name(this, "PermissionCardController");
|
|
8024
|
+
}
|
|
8025
|
+
options;
|
|
8026
|
+
byRequest = /* @__PURE__ */ new Map();
|
|
8027
|
+
byOutTrack = /* @__PURE__ */ new Map();
|
|
8028
|
+
pendingByRun = /* @__PURE__ */ new Map();
|
|
8029
|
+
constructor(options) {
|
|
8030
|
+
this.options = options;
|
|
8031
|
+
}
|
|
8032
|
+
async present(context, target) {
|
|
8033
|
+
const previous = this.byRequest.get(context.requestId);
|
|
8034
|
+
if (previous) {
|
|
8035
|
+
this.reserveTerminalProjection(previous);
|
|
8036
|
+
await this.finalize(previous, "expired");
|
|
8037
|
+
}
|
|
8038
|
+
const record = {
|
|
8039
|
+
context,
|
|
8040
|
+
target,
|
|
8041
|
+
outTrackId: `qwen-permission-${randomUUID4()}`,
|
|
8042
|
+
state: "reserved",
|
|
8043
|
+
delivered: false,
|
|
8044
|
+
forbiddenActors: /* @__PURE__ */ new Set()
|
|
8045
|
+
};
|
|
8046
|
+
this.byRequest.set(context.requestId, record);
|
|
8047
|
+
this.byOutTrack.set(record.outTrackId, record);
|
|
8048
|
+
const unsubscribe = context.onSettled((reason) => {
|
|
8049
|
+
if (record.state === "claimed")
|
|
8050
|
+
return;
|
|
8051
|
+
if (record.state === "pending")
|
|
8052
|
+
this.reserveTerminalProjection(record);
|
|
8053
|
+
void this.finalize(record, reason === "resolved_outside_presenter" ? "expired" : "cancelled");
|
|
8054
|
+
});
|
|
8055
|
+
record.unsubscribe = unsubscribe;
|
|
8056
|
+
if (record.state === "terminal")
|
|
8057
|
+
unsubscribe();
|
|
8058
|
+
try {
|
|
8059
|
+
await this.options.client.createAndDeliver({
|
|
8060
|
+
templateId: QUESTION_CARD_TEMPLATE_ID,
|
|
8061
|
+
outTrackId: record.outTrackId,
|
|
8062
|
+
target,
|
|
8063
|
+
cardParamMap: this.cardData(context)
|
|
8064
|
+
});
|
|
8065
|
+
record.delivered = true;
|
|
8066
|
+
} catch (error) {
|
|
8067
|
+
this.options.onError?.("permission card creation", error);
|
|
8068
|
+
if (record.state === "terminal")
|
|
8069
|
+
return { kind: "presented" };
|
|
8070
|
+
this.discard(record);
|
|
8071
|
+
return { kind: "unsupported" };
|
|
8072
|
+
}
|
|
8073
|
+
if (record.state !== "reserved") {
|
|
8074
|
+
await this.projectTerminal(record);
|
|
8075
|
+
return { kind: "presented" };
|
|
8076
|
+
}
|
|
8077
|
+
record.state = "pending";
|
|
8078
|
+
const pending = this.pendingByRun.get(context.runId) ?? /* @__PURE__ */ new Set();
|
|
8079
|
+
pending.add(context.requestId);
|
|
8080
|
+
this.pendingByRun.set(context.runId, pending);
|
|
8081
|
+
record.timer = setTimeout(() => {
|
|
8082
|
+
void this.expire(record);
|
|
8083
|
+
}, this.options.timeoutMs);
|
|
8084
|
+
record.timer.unref?.();
|
|
8085
|
+
return { kind: "presented" };
|
|
8086
|
+
}
|
|
8087
|
+
claim(callback) {
|
|
8088
|
+
const record = this.byOutTrack.get(callback.outTrackId);
|
|
8089
|
+
if (!record || record.state !== "pending") {
|
|
8090
|
+
return { kind: "ignored", actorId: callback.actorId };
|
|
8091
|
+
}
|
|
8092
|
+
if (record.context.owner.id !== callback.actorId) {
|
|
8093
|
+
if (record.forbiddenActors.has(callback.actorId)) {
|
|
8094
|
+
return { kind: "ignored" };
|
|
8095
|
+
}
|
|
8096
|
+
record.forbiddenActors.add(callback.actorId);
|
|
8097
|
+
return {
|
|
8098
|
+
kind: "forbidden",
|
|
8099
|
+
actorId: callback.actorId,
|
|
8100
|
+
target: record.target
|
|
8101
|
+
};
|
|
8102
|
+
}
|
|
8103
|
+
if (callback.hasBusinessPayload === false || !callback.isCancel && callback.actionId !== "cancel" && callback.actionId !== "submit" && callback.actionId !== record.context.requestId) {
|
|
8104
|
+
return { kind: "ignored", actorId: callback.actorId };
|
|
8105
|
+
}
|
|
8106
|
+
if (callback.isCancel || callback.actionId === "cancel") {
|
|
8107
|
+
this.reserveTerminalProjection(record);
|
|
8108
|
+
record.state = "claimed";
|
|
8109
|
+
return {
|
|
8110
|
+
kind: "accepted",
|
|
8111
|
+
execute: /* @__PURE__ */ __name(() => this.respond(record, "deny", "cancelled"), "execute")
|
|
8112
|
+
};
|
|
8113
|
+
}
|
|
8114
|
+
const decision = this.parseDecision(record, callback.formData);
|
|
8115
|
+
if (!decision)
|
|
8116
|
+
return { kind: "ignored", actorId: callback.actorId };
|
|
8117
|
+
this.reserveTerminalProjection(record);
|
|
8118
|
+
record.state = "claimed";
|
|
8119
|
+
return {
|
|
8120
|
+
kind: "accepted",
|
|
8121
|
+
execute: /* @__PURE__ */ __name(() => this.respond(record, decision), "execute")
|
|
8122
|
+
};
|
|
8123
|
+
}
|
|
8124
|
+
cancelRun(runId) {
|
|
8125
|
+
const requestIds = [...this.pendingByRun.get(runId) ?? []];
|
|
8126
|
+
for (const requestId of requestIds) {
|
|
8127
|
+
const record = this.byRequest.get(requestId);
|
|
8128
|
+
if (record) {
|
|
8129
|
+
this.reserveTerminalProjection(record);
|
|
8130
|
+
void this.finalize(record, "cancelled");
|
|
8131
|
+
}
|
|
8132
|
+
}
|
|
8133
|
+
}
|
|
8134
|
+
async respond(record, decision, terminalState) {
|
|
8135
|
+
try {
|
|
8136
|
+
const accepted = await record.context.respond(decision);
|
|
8137
|
+
await this.finalize(record, accepted ? terminalState ?? (decision === "deny" ? "denied" : "approved") : "expired");
|
|
8138
|
+
} catch (error) {
|
|
8139
|
+
this.options.onError?.("permission response", error);
|
|
8140
|
+
await this.finalize(record, "expired");
|
|
8141
|
+
}
|
|
8142
|
+
}
|
|
8143
|
+
async expire(record) {
|
|
8144
|
+
if (record.state !== "pending")
|
|
8145
|
+
return;
|
|
8146
|
+
this.reserveTerminalProjection(record);
|
|
8147
|
+
record.state = "claimed";
|
|
8148
|
+
const response = record.context.respond("deny").catch((error) => {
|
|
8149
|
+
this.options.onError?.("expired permission cancellation", error);
|
|
8150
|
+
});
|
|
8151
|
+
await this.finalize(record, "expired");
|
|
8152
|
+
await response;
|
|
8153
|
+
}
|
|
8154
|
+
async finalize(record, terminalState) {
|
|
8155
|
+
if (record.state === "terminal")
|
|
8156
|
+
return;
|
|
8157
|
+
record.state = "terminal";
|
|
8158
|
+
record.terminalState = terminalState;
|
|
8159
|
+
this.removeRecord(record);
|
|
8160
|
+
if (!record.delivered)
|
|
8161
|
+
return;
|
|
8162
|
+
const finishTerminalProjection = record.finishTerminalProjection;
|
|
8163
|
+
record.finishTerminalProjection = void 0;
|
|
8164
|
+
if (finishTerminalProjection) {
|
|
8165
|
+
await finishTerminalProjection(() => this.projectTerminal(record));
|
|
8166
|
+
} else {
|
|
8167
|
+
await this.projectTerminal(record);
|
|
8168
|
+
}
|
|
8169
|
+
}
|
|
8170
|
+
discard(record) {
|
|
8171
|
+
if (record.state === "terminal")
|
|
8172
|
+
return;
|
|
8173
|
+
record.state = "terminal";
|
|
8174
|
+
this.removeRecord(record);
|
|
8175
|
+
}
|
|
8176
|
+
removeRecord(record) {
|
|
8177
|
+
if (record.timer)
|
|
8178
|
+
clearTimeout(record.timer);
|
|
8179
|
+
record.timer = void 0;
|
|
8180
|
+
record.unsubscribe?.();
|
|
8181
|
+
record.unsubscribe = void 0;
|
|
8182
|
+
this.byRequest.delete(record.context.requestId);
|
|
8183
|
+
this.byOutTrack.delete(record.outTrackId);
|
|
8184
|
+
const pending = this.pendingByRun.get(record.context.runId);
|
|
8185
|
+
pending?.delete(record.context.requestId);
|
|
8186
|
+
if (pending?.size === 0)
|
|
8187
|
+
this.pendingByRun.delete(record.context.runId);
|
|
8188
|
+
}
|
|
8189
|
+
reserveTerminalProjection(record) {
|
|
8190
|
+
record.finishTerminalProjection ??= this.options.reserveRunProjection?.(record.context.runId);
|
|
8191
|
+
}
|
|
8192
|
+
async projectTerminal(record) {
|
|
8193
|
+
if (!record.terminalState)
|
|
8194
|
+
return;
|
|
8195
|
+
const copy = PERMISSION_CARD_COPY[this.options.locale ?? "en"];
|
|
8196
|
+
const cardParamMap = {
|
|
8197
|
+
approved: {
|
|
8198
|
+
card_status: "approved",
|
|
8199
|
+
question_desc: copy.approved.description,
|
|
8200
|
+
form_btn_text: copy.approved.button
|
|
8201
|
+
},
|
|
8202
|
+
denied: {
|
|
8203
|
+
card_status: "denied",
|
|
8204
|
+
question_desc: copy.denied.description,
|
|
8205
|
+
form_btn_text: copy.denied.button
|
|
8206
|
+
},
|
|
8207
|
+
expired: {
|
|
8208
|
+
card_status: "expired",
|
|
8209
|
+
question_desc: copy.expired.description,
|
|
8210
|
+
form_btn_text: copy.expired.button
|
|
8211
|
+
},
|
|
8212
|
+
cancelled: {
|
|
8213
|
+
card_status: "cancelled",
|
|
8214
|
+
question_desc: copy.cancelled.description,
|
|
8215
|
+
form_btn_text: copy.cancelled.button
|
|
8216
|
+
}
|
|
8217
|
+
};
|
|
8218
|
+
try {
|
|
8219
|
+
await this.options.client.updateInstance({
|
|
8220
|
+
outTrackId: record.outTrackId,
|
|
8221
|
+
cardParamMap: cardParamMap[record.terminalState]
|
|
8222
|
+
});
|
|
8223
|
+
} catch (error) {
|
|
8224
|
+
this.options.onError?.("permission card finalization", error);
|
|
8225
|
+
}
|
|
8226
|
+
}
|
|
8227
|
+
parseDecision(record, formData) {
|
|
8228
|
+
if (Object.keys(formData).length !== 1 || !Object.prototype.hasOwnProperty.call(formData, DECISION_FIELD)) {
|
|
8229
|
+
return void 0;
|
|
8230
|
+
}
|
|
8231
|
+
const values = this.readValues(formData[DECISION_FIELD]);
|
|
8232
|
+
if (values.length !== 1)
|
|
8233
|
+
return void 0;
|
|
8234
|
+
const decision = values[0];
|
|
8235
|
+
return record.context.decisions.some((candidate) => candidate.kind === decision) ? decision : void 0;
|
|
8236
|
+
}
|
|
8237
|
+
readValues(value) {
|
|
8238
|
+
if (typeof value === "string")
|
|
8239
|
+
return value.trim() ? [value.trim()] : [];
|
|
8240
|
+
if (Array.isArray(value)) {
|
|
8241
|
+
return value.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean);
|
|
8242
|
+
}
|
|
8243
|
+
if (value !== null && typeof value === "object") {
|
|
8244
|
+
return this.readValues(value["value"]);
|
|
8245
|
+
}
|
|
8246
|
+
return [];
|
|
8247
|
+
}
|
|
8248
|
+
cardData(context) {
|
|
8249
|
+
const copy = PERMISSION_CARD_COPY[this.options.locale ?? "en"];
|
|
8250
|
+
return {
|
|
8251
|
+
question_id: context.requestId,
|
|
8252
|
+
question_title: copy.title,
|
|
8253
|
+
question_desc: context.title,
|
|
8254
|
+
card_status: "pending",
|
|
8255
|
+
form_btn_text: copy.submit,
|
|
8256
|
+
selected_text: "",
|
|
8257
|
+
selected_values: "[]",
|
|
8258
|
+
form: {
|
|
8259
|
+
fields: [
|
|
8260
|
+
{
|
|
8261
|
+
name: DECISION_FIELD,
|
|
8262
|
+
label: copy.choose,
|
|
8263
|
+
type: "CHECKBOX_GROUP",
|
|
8264
|
+
required: true,
|
|
8265
|
+
options: context.decisions.map((decision) => ({
|
|
8266
|
+
value: decision.kind,
|
|
8267
|
+
text: decision.label
|
|
8268
|
+
}))
|
|
8269
|
+
}
|
|
8270
|
+
]
|
|
8271
|
+
}
|
|
8272
|
+
};
|
|
8273
|
+
}
|
|
8274
|
+
};
|
|
8275
|
+
|
|
8276
|
+
// packages/channels/dingtalk/dist/interaction-presenter.js
|
|
8277
|
+
init_esbuild_shims();
|
|
8278
|
+
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
7987
8279
|
function escapeSenderMarkdownText(text) {
|
|
7988
8280
|
return text.replace(/([\\`*_[\]{}()#+.!|>~-])/gu, "\\$1");
|
|
7989
8281
|
}
|
|
@@ -8149,6 +8441,16 @@ var DingtalkInteractionPresenter = class {
|
|
|
8149
8441
|
return Promise.resolve({ kind: "unsupported" });
|
|
8150
8442
|
return questionCards.present(context, this.cardTarget(context.target));
|
|
8151
8443
|
}
|
|
8444
|
+
presentPermission(context) {
|
|
8445
|
+
const run = this.runs.get(context.runId);
|
|
8446
|
+
if (!run || run.terminal || run.ownerId !== context.owner.id || run.target.chatId !== context.target.chatId || run.target.isGroup !== context.target.isGroup) {
|
|
8447
|
+
return Promise.resolve({ kind: "unsupported" });
|
|
8448
|
+
}
|
|
8449
|
+
const permissionCards = this.options.permissionCards;
|
|
8450
|
+
if (!permissionCards)
|
|
8451
|
+
return Promise.resolve({ kind: "unsupported" });
|
|
8452
|
+
return permissionCards.present(context, this.cardTarget(context.target));
|
|
8453
|
+
}
|
|
8152
8454
|
terminalCopy() {
|
|
8153
8455
|
if (this.options.language !== void 0 && !isChinesePresentationLanguage(this.options.language)) {
|
|
8154
8456
|
return {
|
|
@@ -8168,6 +8470,7 @@ var DingtalkInteractionPresenter = class {
|
|
|
8168
8470
|
if (!run || run.terminal)
|
|
8169
8471
|
return;
|
|
8170
8472
|
this.options.questionCards?.cancelRun(runId, terminal === "cancelled" && (detail === "cancel_command" || detail === "clear") ? "cancelled" : "expired");
|
|
8473
|
+
this.options.permissionCards?.cancelRun(runId);
|
|
8171
8474
|
run.terminal = true;
|
|
8172
8475
|
const activeSegmentId = run.activeSegmentId;
|
|
8173
8476
|
run.activeSegmentId = void 0;
|
|
@@ -8323,7 +8626,7 @@ ${this.boundContent(content, Math.max(0, CONTENT_LIMIT - sourceLabel.length - 2)
|
|
|
8323
8626
|
ensureStatusContext(run, segment) {
|
|
8324
8627
|
if (run.statusContext)
|
|
8325
8628
|
return run.statusContext;
|
|
8326
|
-
run.statusContext = segment ? { ...segment } : { ...run.baseContext, segmentId: `${run.runId}:${
|
|
8629
|
+
run.statusContext = segment ? { ...segment } : { ...run.baseContext, segmentId: `${run.runId}:${randomUUID5()}` };
|
|
8327
8630
|
return run.statusContext;
|
|
8328
8631
|
}
|
|
8329
8632
|
cardTarget(target) {
|
|
@@ -8802,6 +9105,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8802
9105
|
interactiveCardClient;
|
|
8803
9106
|
statusCardController;
|
|
8804
9107
|
questionCardController;
|
|
9108
|
+
permissionCardController;
|
|
8805
9109
|
interactionPresenter;
|
|
8806
9110
|
inboundCardOwners = /* @__PURE__ */ new Map();
|
|
8807
9111
|
cardRunBySession = /* @__PURE__ */ new Map();
|
|
@@ -8810,14 +9114,6 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8810
9114
|
// boundary, input requested) mints a fresh segment UUID but the projection
|
|
8811
9115
|
// state must survive it, or a marker split across the reset leaks.
|
|
8812
9116
|
fileProjectors = /* @__PURE__ */ new Map();
|
|
8813
|
-
blockFileProjectors = /* @__PURE__ */ new Map();
|
|
8814
|
-
// Sessions armed for block projection by onPromptStart and disarmed when
|
|
8815
|
-
// the turn settles (or the session dies). A block send that finds NO
|
|
8816
|
-
// projector state is only legitimate as a turn's FIRST block, which always
|
|
8817
|
-
// lands while armed: late sends from an evicted (/clear) or dead session
|
|
8818
|
-
// must be dropped, because recreating state would post the tail of a
|
|
8819
|
-
// force-split [FILE: ...] marker verbatim.
|
|
8820
|
-
blockProjectionArmed = /* @__PURE__ */ new Set();
|
|
8821
9117
|
backgroundResponseAggregations = /* @__PURE__ */ new Map();
|
|
8822
9118
|
detachedBackgroundResponseAggregations = /* @__PURE__ */ new Set();
|
|
8823
9119
|
pendingBackgroundResponseTerminals = /* @__PURE__ */ new Map();
|
|
@@ -8836,7 +9132,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8836
9132
|
} else if (!this.config.instructions.includes("[IMAGE:")) {
|
|
8837
9133
|
this.config.instructions += IMAGE_INSTRUCTIONS;
|
|
8838
9134
|
}
|
|
8839
|
-
if (
|
|
9135
|
+
if (!this.config.instructions.includes("[FILE:")) {
|
|
8840
9136
|
this.config.instructions += FILE_INSTRUCTIONS;
|
|
8841
9137
|
}
|
|
8842
9138
|
this.interactiveCardConfig = parseDingtalkInteractiveCardConfig(config.interactiveCards);
|
|
@@ -8864,7 +9160,7 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8864
9160
|
}
|
|
8865
9161
|
}, "invalidateAccessToken")
|
|
8866
9162
|
});
|
|
8867
|
-
if (this.interactiveCardConfig.statusCard.enabled
|
|
9163
|
+
if (this.interactiveCardConfig.statusCard.enabled) {
|
|
8868
9164
|
this.statusCardController = new StatusCardController({
|
|
8869
9165
|
client: this.interactiveCardClient,
|
|
8870
9166
|
cancelRun: /* @__PURE__ */ __name((sessionId, runId) => this.requestPromptRunCancellation(sessionId, runId), "cancelRun"),
|
|
@@ -8888,14 +9184,25 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8888
9184
|
}, "onError")
|
|
8889
9185
|
});
|
|
8890
9186
|
}
|
|
8891
|
-
if (this.
|
|
9187
|
+
if (this.interactiveCardConfig.permissionCard.enabled) {
|
|
9188
|
+
this.permissionCardController = new PermissionCardController({
|
|
9189
|
+
client: this.interactiveCardClient,
|
|
9190
|
+
timeoutMs: this.interactiveCardConfig.permissionCard.timeoutMs,
|
|
9191
|
+
locale: this.locale,
|
|
9192
|
+
reserveRunProjection: /* @__PURE__ */ __name((runId) => this.interactionPresenter?.reserveProjection(runId), "reserveRunProjection"),
|
|
9193
|
+
onError: /* @__PURE__ */ __name((operation, error) => {
|
|
9194
|
+
process.stderr.write(`[DingTalk:${this.name}] ${operation} failed: ${sanitizeLogText(String(error), 300)}
|
|
9195
|
+
`);
|
|
9196
|
+
}, "onError")
|
|
9197
|
+
});
|
|
9198
|
+
}
|
|
9199
|
+
if (this.statusCardController || this.questionCardController || this.permissionCardController) {
|
|
8892
9200
|
this.interactionPresenter = new DingtalkInteractionPresenter({
|
|
8893
9201
|
statusCards: this.statusCardController,
|
|
8894
9202
|
questionCards: this.questionCardController,
|
|
9203
|
+
permissionCards: this.permissionCardController,
|
|
8895
9204
|
...options?.displayLanguage ? { language: options.displayLanguage } : {},
|
|
8896
|
-
|
|
8897
|
-
sendFallback: /* @__PURE__ */ __name((chatId, text, sessionId, sourceLabel) => this.sendFallbackReply(chatId, text, sessionId, sourceLabel), "sendFallback")
|
|
8898
|
-
} : {}
|
|
9205
|
+
sendFallback: /* @__PURE__ */ __name((chatId, text, sessionId, sourceLabel) => this.sendFallbackReply(chatId, text, sessionId, sourceLabel), "sendFallback")
|
|
8899
9206
|
});
|
|
8900
9207
|
}
|
|
8901
9208
|
}
|
|
@@ -8979,7 +9286,11 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
8979
9286
|
if (callback.actionId === "btn_stop") {
|
|
8980
9287
|
return this.statusCardController?.claimStop(callback.outTrackId, callback.actorId) ?? { kind: "ignored", actorId: callback.actorId };
|
|
8981
9288
|
}
|
|
8982
|
-
|
|
9289
|
+
const permissionResult = this.permissionCardController?.claim(callback);
|
|
9290
|
+
if (permissionResult && permissionResult.kind !== "ignored") {
|
|
9291
|
+
return permissionResult;
|
|
9292
|
+
}
|
|
9293
|
+
return this.questionCardController?.claim(callback) ?? permissionResult ?? {
|
|
8983
9294
|
kind: "ignored",
|
|
8984
9295
|
actorId: callback.actorId
|
|
8985
9296
|
};
|
|
@@ -9191,9 +9502,6 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9191
9502
|
process.stderr.write(`[DingTalk:${this.name}] file markers projected (final=${projection.markerCount}, streamed=${streamedMarkers})
|
|
9192
9503
|
`);
|
|
9193
9504
|
}
|
|
9194
|
-
if (this.config.blockStreaming === "on" && (projection.markerCount > 0 || streamedMarkers > 0)) {
|
|
9195
|
-
return this.prepareOutgoingText(withFileUnavailableNotice(projection.text));
|
|
9196
|
-
}
|
|
9197
9505
|
const notices = [];
|
|
9198
9506
|
if (projection.invalidMarkers > 0) {
|
|
9199
9507
|
notices.push("[File delivery failed: invalid marker]");
|
|
@@ -9432,20 +9740,29 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9432
9740
|
return data.access_token;
|
|
9433
9741
|
}
|
|
9434
9742
|
sendCardInteractionFeedback(actorId, target) {
|
|
9743
|
+
const copy = this.locale === "zh" ? {
|
|
9744
|
+
title: "\u5361\u7247\u64CD\u4F5C",
|
|
9745
|
+
group: "\u4EC5\u4EFB\u52A1\u53D1\u8D77\u4EBA\u53EF\u4EE5\u64CD\u4F5C\u8FD9\u5F20\u5361\u7247\uFF0C\u672C\u6B21\u64CD\u4F5C\u672A\u751F\u6548\u3002",
|
|
9746
|
+
direct: "\u4F60\u65E0\u6743\u64CD\u4F5C\u8FD9\u5F20\u5361\u7247\uFF0C\u4EC5\u4EFB\u52A1\u53D1\u8D77\u4EBA\u53EF\u4EE5\u63D0\u4EA4\u6216\u505C\u6B62\u3002"
|
|
9747
|
+
} : {
|
|
9748
|
+
title: "Card interaction",
|
|
9749
|
+
group: "Only the task initiator can operate this card. This action had no effect.",
|
|
9750
|
+
direct: "You cannot operate this card. Only the task initiator can submit or stop it."
|
|
9751
|
+
};
|
|
9435
9752
|
if (target?.isGroup) {
|
|
9436
9753
|
return this.sendProactiveChunk({
|
|
9437
9754
|
channelName: this.name,
|
|
9438
9755
|
senderId: actorId,
|
|
9439
9756
|
chatId: target.chatId,
|
|
9440
9757
|
isGroup: true
|
|
9441
|
-
},
|
|
9758
|
+
}, copy.title, copy.group, "card interaction feedback");
|
|
9442
9759
|
}
|
|
9443
9760
|
return this.sendProactiveChunk({
|
|
9444
9761
|
channelName: this.name,
|
|
9445
9762
|
senderId: actorId,
|
|
9446
9763
|
chatId: actorId,
|
|
9447
9764
|
isGroup: false
|
|
9448
|
-
},
|
|
9765
|
+
}, copy.title, copy.direct, "card interaction feedback");
|
|
9449
9766
|
}
|
|
9450
9767
|
async sendProactiveChunk(target, title, text, chunkLabel) {
|
|
9451
9768
|
return this.sendProactivePayload(target, PROACTIVE_MSG_KEY, { title, text }, chunkLabel);
|
|
@@ -9841,8 +10158,6 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9841
10158
|
}
|
|
9842
10159
|
/** Recall reactions left behind when a session dies without terminal lifecycle events. */
|
|
9843
10160
|
onSessionDied(sessionId) {
|
|
9844
|
-
this.blockProjectionArmed.delete(sessionId);
|
|
9845
|
-
this.blockFileProjectors.delete(sessionId);
|
|
9846
10161
|
for (const [runId, state] of this.fileProjectors) {
|
|
9847
10162
|
if (state.sessionId === sessionId)
|
|
9848
10163
|
this.fileProjectors.delete(runId);
|
|
@@ -9966,7 +10281,6 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
9966
10281
|
}
|
|
9967
10282
|
}
|
|
9968
10283
|
onPromptStart(chatId, sessionId, messageId) {
|
|
9969
|
-
this.blockProjectionArmed.add(sessionId);
|
|
9970
10284
|
if (messageId) {
|
|
9971
10285
|
this.bufferedMentionTargets.delete(messageId);
|
|
9972
10286
|
this.untrackBufferedMentionTarget(sessionId, messageId);
|
|
@@ -10029,35 +10343,9 @@ var DingtalkChannel = class _DingtalkChannel extends ChannelBase {
|
|
|
10029
10343
|
this.bufferedMentionTargetsBySession.delete(sessionId);
|
|
10030
10344
|
}
|
|
10031
10345
|
onPromptEnd(chatId, sessionId, messageId) {
|
|
10032
|
-
this.settleBlockFileProjector(chatId, sessionId);
|
|
10033
10346
|
this.sessionMentionTargets.delete(sessionId);
|
|
10034
10347
|
this.stopReaction(chatId, messageId, sessionId);
|
|
10035
10348
|
}
|
|
10036
|
-
/**
|
|
10037
|
-
* Turn end is the only point where the block projector's held state can be
|
|
10038
|
-
* settled: ChannelBase drains the turn's queued block sends before calling
|
|
10039
|
-
* onPromptEnd, so everything already appended belongs to this turn. Flush
|
|
10040
|
-
* the held candidate bytes (a trailing `[FILE:` prefix the stream never
|
|
10041
|
-
* completed) before deleting the entry — a later delete-without-settle
|
|
10042
|
-
* would silently drop them from the delivered answer. Also disarm the
|
|
10043
|
-
* session: /clear eviction and session death settle WITHOUT draining the
|
|
10044
|
-
* turn's send chain, and any block that lands afterwards must be dropped
|
|
10045
|
-
* rather than recreating projector state.
|
|
10046
|
-
*/
|
|
10047
|
-
settleBlockFileProjector(chatId, sessionId) {
|
|
10048
|
-
this.blockProjectionArmed.delete(sessionId);
|
|
10049
|
-
const state = this.blockFileProjectors.get(sessionId);
|
|
10050
|
-
if (!state)
|
|
10051
|
-
return;
|
|
10052
|
-
this.blockFileProjectors.delete(sessionId);
|
|
10053
|
-
const tail = state.projector.complete();
|
|
10054
|
-
if (!tail.trim())
|
|
10055
|
-
return;
|
|
10056
|
-
void this.sendReply(chatId, tail, void 0, this.getResponseSourceLabel(sessionId)).catch((err) => {
|
|
10057
|
-
process.stderr.write(`[DingTalk:${this.name}] projector tail delivery failed for session ${sessionId}: ${err instanceof Error ? err.message : String(err)}
|
|
10058
|
-
`);
|
|
10059
|
-
});
|
|
10060
|
-
}
|
|
10061
10349
|
/** Deliver every Agent segment immediately unless aggregation is enabled. */
|
|
10062
10350
|
async dispatchBackgroundResponse(sessionId, text, context) {
|
|
10063
10351
|
const target = this.router.getTarget(sessionId);
|
|
@@ -10610,51 +10898,21 @@ ${text}`;
|
|
|
10610
10898
|
return escapeDingTalkMarkdown(normalized || "\u540E\u53F0\u4EFB\u52A1");
|
|
10611
10899
|
}
|
|
10612
10900
|
/**
|
|
10613
|
-
*
|
|
10614
|
-
* the
|
|
10615
|
-
*
|
|
10901
|
+
* Body-identical to the base implementation — this override exists only to
|
|
10902
|
+
* widen the signature, which the base seam does not declare. The background
|
|
10903
|
+
* aggregation flush passes `prepared` so the body it already projected isn't
|
|
10904
|
+
* projected a second time (that would re-upload its files), and
|
|
10905
|
+
* `failOnHttpError` so a failed send throws instead of being swallowed,
|
|
10906
|
+
* letting the flush capture the delivery plan for the next retry.
|
|
10616
10907
|
*/
|
|
10617
10908
|
async deliverBackgroundReply(chatId, text, sessionId, sourceLabel, prepared = false, failOnHttpError = false) {
|
|
10618
|
-
|
|
10619
|
-
return this.sendResponseMessage(chatId, text, sessionId, sourceLabel, prepared, failOnHttpError);
|
|
10620
|
-
}
|
|
10621
|
-
await this.sendReply(chatId, text, void 0, sourceLabel, prepared, failOnHttpError);
|
|
10909
|
+
await this.sendResponseMessage(chatId, text, sessionId, sourceLabel, prepared, failOnHttpError);
|
|
10622
10910
|
}
|
|
10623
10911
|
async sendResponseMessage(chatId, text, sessionId, sourceLabel, prepared = false, failOnHttpError = false) {
|
|
10624
|
-
|
|
10625
|
-
let consumesMention = true;
|
|
10626
|
-
if (this.config.blockStreaming === "on") {
|
|
10627
|
-
const projected = this.projectBlockStreamChunk(text, sessionId);
|
|
10628
|
-
if (!projected.text.trim())
|
|
10629
|
-
return;
|
|
10630
|
-
outgoingText = projected.text;
|
|
10631
|
-
consumesMention = projected.hasContent;
|
|
10632
|
-
}
|
|
10633
|
-
const atUserId = consumesMention && this.atSender ? this.sessionMentionTargets.get(sessionId) : void 0;
|
|
10912
|
+
const atUserId = this.atSender ? this.sessionMentionTargets.get(sessionId) : void 0;
|
|
10634
10913
|
if (atUserId)
|
|
10635
10914
|
this.sessionMentionTargets.delete(sessionId);
|
|
10636
|
-
await this.sendReply(chatId,
|
|
10637
|
-
}
|
|
10638
|
-
projectBlockStreamChunk(text, sessionId) {
|
|
10639
|
-
let state = this.blockFileProjectors.get(sessionId);
|
|
10640
|
-
if (!state) {
|
|
10641
|
-
if (!this.blockProjectionArmed.has(sessionId)) {
|
|
10642
|
-
return { text: "", hasContent: false };
|
|
10643
|
-
}
|
|
10644
|
-
state = { projector: new OutboundFileProjector(), reportedMarkers: 0 };
|
|
10645
|
-
this.blockFileProjectors.set(sessionId, state);
|
|
10646
|
-
}
|
|
10647
|
-
const safe = state.projector.append(text);
|
|
10648
|
-
const hasContent = safe.trim().length > 0;
|
|
10649
|
-
const result = state.projector.result(safe);
|
|
10650
|
-
let outgoingText = safe;
|
|
10651
|
-
if (result.markerCount > state.reportedMarkers) {
|
|
10652
|
-
outgoingText = withFileUnavailableNotice(safe);
|
|
10653
|
-
state.reportedMarkers = result.markerCount;
|
|
10654
|
-
process.stderr.write(`[DingTalk:${this.name}] file markers redacted in block stream (session ${sessionId}, markers=${result.markerCount})
|
|
10655
|
-
`);
|
|
10656
|
-
}
|
|
10657
|
-
return { text: outgoingText, hasContent };
|
|
10915
|
+
await this.sendReply(chatId, text, atUserId, sourceLabel ?? this.getResponseSourceLabel(sessionId), prepared, failOnHttpError);
|
|
10658
10916
|
}
|
|
10659
10917
|
async sendFallbackReply(chatId, text, sessionId, sourceLabel) {
|
|
10660
10918
|
const atUserId = this.atSender ? this.sessionMentionTargets.get(sessionId) : void 0;
|
|
@@ -10708,6 +10966,16 @@ ${text}`;
|
|
|
10708
10966
|
}
|
|
10709
10967
|
return this.interactionPresenter.presentInput(context);
|
|
10710
10968
|
}
|
|
10969
|
+
async presentPermissionRequest(context) {
|
|
10970
|
+
const run = this.cardRuns.get(context.runId);
|
|
10971
|
+
if (!run || run.ownerId !== context.owner.id) {
|
|
10972
|
+
return { kind: "unsupported" };
|
|
10973
|
+
}
|
|
10974
|
+
if (!this.permissionCardController || !this.interactionPresenter) {
|
|
10975
|
+
return { kind: "unsupported" };
|
|
10976
|
+
}
|
|
10977
|
+
return this.interactionPresenter.presentPermission(context);
|
|
10978
|
+
}
|
|
10711
10979
|
/**
|
|
10712
10980
|
* Extract quoted/referenced message context from a reply.
|
|
10713
10981
|
* DingTalk provides this via text.repliedMsg (newer) or quoteMessage (legacy).
|
|
@@ -10946,7 +11214,7 @@ ${text}`;
|
|
|
10946
11214
|
let filePath;
|
|
10947
11215
|
let safeName;
|
|
10948
11216
|
try {
|
|
10949
|
-
dir = join(tmpdir3(), "channel-files",
|
|
11217
|
+
dir = join(tmpdir3(), "channel-files", randomUUID6());
|
|
10950
11218
|
mkdirSync(dir, { recursive: true });
|
|
10951
11219
|
safeName = basename3(typeof fileName === "string" ? fileName : "") || `dingtalk_${mediaType}_${Date.now()}.${GENERATED_MEDIA_EXT[media.mimeType] ?? "bin"}`;
|
|
10952
11220
|
filePath = join(dir, safeName);
|
|
@@ -11053,7 +11321,7 @@ ${text}`;
|
|
|
11053
11321
|
}
|
|
11054
11322
|
}) : this.handleInbound(envelope);
|
|
11055
11323
|
processMessage.catch((err) => {
|
|
11056
|
-
const reference =
|
|
11324
|
+
const reference = randomUUID6().slice(0, 8);
|
|
11057
11325
|
let errorSummary = "Unknown error";
|
|
11058
11326
|
try {
|
|
11059
11327
|
errorSummary = err instanceof Error ? `${err.name}: ${err.message}` : String(err);
|
|
@@ -11140,6 +11408,24 @@ var plugin = {
|
|
|
11140
11408
|
exclusiveMinimum: DINGTALK_INTERACTIVE_CARD_TIMEOUT_EXCLUSIVE_MINIMUM
|
|
11141
11409
|
}
|
|
11142
11410
|
]
|
|
11411
|
+
},
|
|
11412
|
+
{
|
|
11413
|
+
key: "permissionCard",
|
|
11414
|
+
label: "Permission Card",
|
|
11415
|
+
kind: "object",
|
|
11416
|
+
properties: [
|
|
11417
|
+
{
|
|
11418
|
+
key: "enabled",
|
|
11419
|
+
label: "Enabled",
|
|
11420
|
+
kind: "boolean"
|
|
11421
|
+
},
|
|
11422
|
+
{
|
|
11423
|
+
key: "timeoutMs",
|
|
11424
|
+
label: "Timeout (ms)",
|
|
11425
|
+
kind: "number",
|
|
11426
|
+
exclusiveMinimum: DINGTALK_INTERACTIVE_CARD_TIMEOUT_EXCLUSIVE_MINIMUM
|
|
11427
|
+
}
|
|
11428
|
+
]
|
|
11143
11429
|
}
|
|
11144
11430
|
]
|
|
11145
11431
|
}
|