@qwen-code/qwen-code 0.20.1-jobbench-claude-prompt.0 → 0.20.1
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 +1 -1
- package/bundled/qc-helper/docs/features/auto-mode.md +19 -16
- package/bundled/qc-helper/docs/features/commands.md +54 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +16 -7
- package/bundled/qc-helper/docs/integration-github-action.md +10 -10
- package/bundled/qc-helper/docs/qwen-serve.md +2 -1
- package/bundled/review/DESIGN.md +2 -2
- package/bundled/review/SKILL.md +4 -4
- package/chunks/{MaxSizedBox-BGLP6FQT.js → MaxSizedBox-4WZYPSRU.js} +40 -36
- package/chunks/{StandaloneSessionPicker-K6I4ZEHD.js → StandaloneSessionPicker-PE4JAIFA.js} +58 -54
- package/chunks/{acpAgent-PKKBOEP4.js → acpAgent-BVIKGJ2C.js} +1503 -520
- package/chunks/{agent-Y7XOSZY5.js → agent-DHLFAOUV.js} +36 -32
- package/chunks/{agent-headless-NXRPEYGF.js → agent-headless-ZP5WTNXZ.js} +36 -32
- package/chunks/{anthropicContentGenerator-BWBAZGTW.js → anthropicContentGenerator-NMSS7IMV.js} +11 -11
- package/chunks/{artifact-tool-IUJ7QWCX.js → artifact-tool-56T5IMBP.js} +3 -3
- package/chunks/{askUserQuestion-IUMUUTDQ.js → askUserQuestion-E25OBIC2.js} +3 -3
- package/chunks/{bridge-DCMYGFJ2.js → bridge-XAK7JKMD.js} +41 -37
- package/chunks/{build-SSCNEHZZ.js → build-GHIZ4MSZ.js} +1 -1
- package/chunks/{ca-2SL2BXTK.js → ca-N6VVUFVB.js} +611 -201
- package/chunks/{channel-worker-group-53CMOPFT.js → channel-worker-group-LFBT7K64.js} +5 -5
- package/chunks/{channel-worker-manager-UTXILKC2.js → channel-worker-manager-3RUPERG2.js} +5 -5
- package/chunks/{channel-worker-supervisor-ZGO2W2MD.js → channel-worker-supervisor-A3KVATD3.js} +4 -4
- package/chunks/{chunk-C5L66QPF.js → chunk-27CLX4FV.js} +1 -1
- package/chunks/{chunk-2HOVDT7W.js → chunk-2LI23QA6.js} +1 -1
- package/chunks/chunk-2RFKHEXL.js +74 -0
- package/chunks/{chunk-5244PA32.js → chunk-3KQSDUK3.js} +3 -3
- package/chunks/{chunk-MEDHWB34.js → chunk-3LH5Q2AR.js} +8 -8
- package/chunks/{chunk-E6XTP5ZF.js → chunk-3SXF4GMQ.js} +1 -1
- package/chunks/chunk-43T5WDQ7.js +127 -0
- package/chunks/{chunk-6UTNZOZG.js → chunk-4BRH6FP5.js} +31 -6
- package/chunks/{chunk-NYMHN4ZK.js → chunk-4DSBFQMI.js} +2 -2
- package/chunks/{chunk-JD3MKVKL.js → chunk-4K56OJFJ.js} +1 -1
- package/chunks/{chunk-KTUQMDEP.js → chunk-4K7VDKAD.js} +1 -1
- package/chunks/{chunk-QKYTTBYW.js → chunk-4LVZNIDO.js} +1 -1
- package/chunks/{chunk-EKVLDUP4.js → chunk-52T5UHAZ.js} +2 -2
- package/chunks/{chunk-ZEOZL37W.js → chunk-57FIIFJN.js} +1 -1
- package/chunks/{chunk-SWRMKMVY.js → chunk-5EA5NVXS.js} +1 -1
- package/chunks/chunk-5G2SK2OO.js +20600 -0
- package/chunks/{chunk-6EFTQYW7.js → chunk-5I5BM454.js} +1 -1
- package/chunks/{chunk-GMGDLUC7.js → chunk-6IL7KRLE.js} +1 -1
- package/chunks/{chunk-26LLB6FM.js → chunk-6NHK6HS7.js} +2 -2
- package/chunks/{chunk-6UTRTWUF.js → chunk-6PRNSLMB.js} +11 -6
- package/chunks/chunk-6PVPNMXU.js +29 -0
- package/chunks/{chunk-BDBMYST4.js → chunk-6X4GWOPW.js} +1 -1
- package/chunks/{chunk-4ODB7WIB.js → chunk-6ZBPS62S.js} +1 -1
- package/chunks/{chunk-SMR34EQM.js → chunk-766HLFAG.js} +54 -33
- package/chunks/{chunk-J5CK6QYL.js → chunk-76OFFG6L.js} +137 -5
- package/chunks/{chunk-AU2GX7QQ.js → chunk-7LH6CHKG.js} +1 -1
- package/chunks/{chunk-A2F633L4.js → chunk-7NDXG4MB.js} +60 -35
- package/chunks/{chunk-QCCOKIGW.js → chunk-7SWFAKVH.js} +22 -22
- package/chunks/{chunk-AYCDXHZB.js → chunk-7Z6JQEL6.js} +1 -1
- package/chunks/{chunk-CMFMPPKV.js → chunk-AZD6KAV7.js} +3 -3
- package/chunks/{chunk-7YBZGNEC.js → chunk-BKZEHVPV.js} +176 -168
- package/chunks/{chunk-M2DASLLB.js → chunk-BWQRDISK.js} +1 -1
- package/chunks/{chunk-EELSDL62.js → chunk-BZAEENUV.js} +3 -3
- package/chunks/{chunk-DFQGFXMQ.js → chunk-CHXKGIMK.js} +1 -1
- package/chunks/{chunk-W2LKWG6I.js → chunk-D53NR4GO.js} +562 -301
- package/chunks/{chunk-P5OX37TK.js → chunk-D6ZOVZLF.js} +5 -1
- package/chunks/{chunk-NBMIC7DR.js → chunk-D7WXIW7H.js} +4 -4
- package/chunks/{chunk-VT3KBCIU.js → chunk-DPRMI6NU.js} +1 -1
- package/chunks/{chunk-JXWFXSLN.js → chunk-DRIXALGM.js} +2 -2
- package/chunks/{chunk-5SCI6E3E.js → chunk-E4IMU4Y5.js} +1 -1
- package/chunks/{chunk-EMMNRTQX.js → chunk-EC2ET5ZZ.js} +1 -1
- package/chunks/{chunk-NNDKJNCC.js → chunk-EFIOE2EH.js} +3 -3
- package/chunks/{chunk-7H2JMOPS.js → chunk-EWXXMRMP.js} +3 -3
- package/chunks/{chunk-NEEB7UEN.js → chunk-FFFM6NJV.js} +1 -2
- package/chunks/{chunk-3PG4G7SK.js → chunk-G6LRTI62.js} +4 -4
- package/chunks/{chunk-RTEHQUAD.js → chunk-GEB2CGUV.js} +11024 -7988
- package/chunks/{chunk-OONJNQ42.js → chunk-GPSKDNEE.js} +3 -3
- package/chunks/{chunk-FNGK2Z5B.js → chunk-H4AR2JQF.js} +3 -3
- package/chunks/chunk-HTR4WV6U.js +327 -0
- package/chunks/chunk-IS2SBY6T.js +2256 -0
- package/chunks/{chunk-G45X5TRN.js → chunk-JCW2R7WC.js} +1 -72
- package/chunks/{chunk-4E33SVWA.js → chunk-JHFVJQRO.js} +1 -1
- package/chunks/{chunk-BL7EEZ4Y.js → chunk-JIBBZH37.js} +27 -23
- package/chunks/{chunk-UJEZQ562.js → chunk-JJEFX6U5.js} +3 -3
- package/chunks/{chunk-UTBTCPKF.js → chunk-JKFHJK5U.js} +4 -4
- package/chunks/{chunk-XSSAJZXG.js → chunk-JO7FGOSY.js} +5 -5
- package/chunks/{chunk-CAKC64KX.js → chunk-JTUAAVUT.js} +2 -2
- package/chunks/{chunk-MAQQGNQ5.js → chunk-JYS55H6Z.js} +66 -7
- package/chunks/{chunk-D742634K.js → chunk-KDPIV6WC.js} +29 -2
- package/chunks/{chunk-EIAK6Q2B.js → chunk-KHOVYUHX.js} +2 -2
- package/chunks/{chunk-OLMETXLX.js → chunk-KQQ757OQ.js} +2 -2
- package/chunks/{chunk-7AB5URLY.js → chunk-KSZZBDVD.js} +165 -48
- package/chunks/chunk-KWK7UE6L.js +6194 -0
- package/chunks/{chunk-OOCI5VVU.js → chunk-LIZRAKPB.js} +1 -1
- package/chunks/{chunk-2T2FG7OX.js → chunk-LPMBFOWH.js} +73 -68
- package/chunks/{chunk-UNIQ7KNW.js → chunk-LYEKAAEH.js} +5 -5
- package/chunks/chunk-M7WBGLYP.js +151 -0
- package/chunks/{chunk-LB7ZIQ6C.js → chunk-MTSYH4MB.js} +3 -3
- package/chunks/{chunk-7YK65ZFC.js → chunk-N5ARKAVE.js} +8 -8
- package/chunks/chunk-NABLFI57.js +82 -0
- package/chunks/{chunk-PXVAFBEI.js → chunk-NNFK277W.js} +1 -1
- package/chunks/{chunk-467G3SV5.js → chunk-NPQDJGKU.js} +1 -1
- package/chunks/chunk-OQ5SYCPE.js +10017 -0
- package/chunks/{chunk-C27BYUX6.js → chunk-OQB4EXO4.js} +14 -11
- package/chunks/{chunk-WCPQTUDI.js → chunk-OUDZVU7H.js} +242 -1607
- package/chunks/{chunk-C44MIZ2K.js → chunk-PBED7USE.js} +1 -1
- package/chunks/{chunk-C5Z652G4.js → chunk-PIHKWN7M.js} +1 -1
- package/chunks/{chunk-NL37SKPP.js → chunk-PPIHLGNE.js} +2 -2
- package/chunks/{chunk-ORDXX5SE.js → chunk-PSVSP2OS.js} +6 -6
- package/chunks/{chunk-SKQD5RCT.js → chunk-Q2V2ADXF.js} +7 -7
- package/chunks/{chunk-JDI67JFB.js → chunk-Q2YKNMLS.js} +3 -3
- package/chunks/{chunk-L4PEDXOX.js → chunk-Q3GGJDYN.js} +5 -5
- package/chunks/{chunk-PBATSWUQ.js → chunk-QBUDF33N.js} +1 -1
- package/chunks/{chunk-OMH3276Y.js → chunk-QD6BRERJ.js} +7 -7
- package/chunks/{chunk-Y2ENGUD6.js → chunk-QKTHJXCS.js} +1 -1
- package/chunks/{chunk-BVLROR2T.js → chunk-QLJUC7TG.js} +1 -1
- package/chunks/{chunk-UEY4AYUL.js → chunk-QNLNLENL.js} +2 -2
- package/chunks/{chunk-2F7HITKF.js → chunk-QSJ6JIF5.js} +4 -4
- package/chunks/{chunk-2R7OXGYM.js → chunk-QUHJRRUA.js} +126 -30
- package/chunks/{chunk-WJYCCJ3Q.js → chunk-R3BCL5XW.js} +10 -4
- package/chunks/{chunk-YXBZOR3D.js → chunk-R7MPKABX.js} +307 -86
- package/chunks/{chunk-RFIAR4YL.js → chunk-RV4C2ZFG.js} +1 -1
- package/chunks/{chunk-NIJEXGV6.js → chunk-RVLZCXEE.js} +79 -10
- package/chunks/{chunk-NRPP5TOB.js → chunk-RYSMKY43.js} +4 -4
- package/chunks/{chunk-XBAYQWDL.js → chunk-S3YQCNJE.js} +3 -3
- package/chunks/{chunk-3P4TUBON.js → chunk-SP32MK6J.js} +2 -2
- package/chunks/{chunk-JNWZQ27S.js → chunk-SP5WRGVG.js} +3 -3
- package/chunks/{chunk-FSL5W5TI.js → chunk-T2L47JJK.js} +3 -3
- package/chunks/{chunk-TB6UDU4T.js → chunk-THJNPLI4.js} +16 -16
- package/chunks/{chunk-3XZIXCJY.js → chunk-TPR35HHZ.js} +6 -6
- package/chunks/{chunk-L4BZXQR3.js → chunk-TXRKCFWS.js} +6 -6
- package/chunks/chunk-U7ZFW55U.js +2098 -0
- package/chunks/{chunk-W7H223ZZ.js → chunk-UGYMA4EI.js} +1 -1
- package/chunks/{chunk-X6YQWCIJ.js → chunk-UH3WSE5L.js} +13 -1
- package/chunks/{chunk-R3VWUU2E.js → chunk-VYPFXUCB.js} +1 -1
- package/chunks/{chunk-IMVIN5UC.js → chunk-WCFTQD7H.js} +11 -11
- package/chunks/chunk-WHGVTP7Q.js +1049 -0
- package/chunks/{chunk-PC2QR5QO.js → chunk-WML6JOGQ.js} +31 -19
- package/chunks/{chunk-D2VIDMVM.js → chunk-X6N25LXS.js} +2 -2
- package/chunks/{chunk-YHRBVZ53.js → chunk-X7XWGRDT.js} +4 -4
- package/chunks/chunk-XHATNRQA.js +1500 -0
- package/chunks/{chunk-2RDNKVZ2.js → chunk-Y2DAH52F.js} +7 -6
- package/chunks/{chunk-S35ZDXOS.js → chunk-YM3SZTH4.js} +2 -1
- package/chunks/{chunk-GKY2OJ7R.js → chunk-ZHERRXZJ.js} +1 -1
- package/chunks/{computer-use-KQVQD3IW.js → computer-use-MV4K6WJM.js} +41 -37
- package/chunks/{config-utils-6FXFJUYB.js → config-utils-WYUQ7II4.js} +3 -3
- package/chunks/{contextCommand-IOC5HY6R.js → contextCommand-TQD36VNX.js} +38 -34
- package/chunks/{create-sub-session-X5RVIHCK.js → create-sub-session-AZ77LBL3.js} +3 -3
- package/chunks/{create-sub-session-IOAGEN3O.js → create-sub-session-JOW4BKMC.js} +36 -32
- package/chunks/{cron-create-AC5FFLN7.js → cron-create-KTWJM7QT.js} +5 -5
- package/chunks/{cron-delete-JEB3FAHA.js → cron-delete-2P3I5ULL.js} +5 -5
- package/chunks/{cron-list-NBYPCNIB.js → cron-list-PXDPGEDQ.js} +5 -5
- package/chunks/{daemon-RG2MAI6T.js → daemon-KLPTQIE4.js} +138 -81
- package/chunks/daemon-status-provider-TII4SMCZ.js +81 -0
- package/chunks/{de-I7ZIYXZC.js → de-4IBXM7CN.js} +5 -1
- package/chunks/{dist-2BHAYBKP.js → dist-HMU6CYS4.js} +2 -2
- package/chunks/{dist-AU7NQQRP.js → dist-OAV7LJGJ.js} +1 -1
- package/chunks/{dist-FUTEXY6A.js → dist-OMW6WDEO.js} +1 -1
- package/chunks/{dist-2MIU4UUH.js → dist-PJLG2XYX.js} +1 -1
- package/chunks/{dist-53PZYC5B.js → dist-UIFWIFRO.js} +2 -2
- package/chunks/{dist-WGTQO7F2.js → dist-XRYV6TJP.js} +65 -25
- package/chunks/{earlyInputCapture-7AA4D4RF.js → earlyInputCapture-2V57RG6H.js} +37 -33
- package/chunks/{edit-RQXZUTEU.js → edit-TTUH7PWR.js} +43 -41
- package/chunks/{en-XE34GKAA.js → en-USMCCJAJ.js} +5 -1
- package/chunks/{enter-worktree-BPYKHGTX.js → enter-worktree-D4IVCXYB.js} +41 -37
- package/chunks/{enterPlanMode-VJ3KR5HM.js → enterPlanMode-WRUJTVYN.js} +47 -38
- package/chunks/{environment-PZYHWWG5.js → environment-SEPKXB2C.js} +38 -34
- package/chunks/{errors-NZ6JOKJB.js → errors-YSVGBLBU.js} +38 -34
- package/chunks/{exit-worktree-TZNABJPX.js → exit-worktree-MZ4JSSP6.js} +41 -37
- package/chunks/{exitPlanMode-RZMERKLI.js → exitPlanMode-HAZLSSOJ.js} +41 -37
- package/chunks/{fast-path-F5UWH7GI.js → fast-path-EVBVIE2U.js} +4 -3
- package/chunks/{fast-path-settings-DAOVFADC.js → fast-path-settings-XB3CPUJT.js} +2 -2
- package/chunks/{fr-X7KDVZIY.js → fr-WVHEBDDB.js} +5 -1
- package/chunks/{gemini-2QJRGIKD.js → gemini-APQ76464.js} +100 -95
- package/chunks/{geminiContentGenerator-Q7IAYVM4.js → geminiContentGenerator-LB4MA2LI.js} +5 -5
- package/chunks/{getMachineId-bsd-EXV7SWPA.js → getMachineId-bsd-QFVLPUPT.js} +1 -1
- package/chunks/{getMachineId-darwin-IUOMFXU3.js → getMachineId-darwin-DGMQQE2E.js} +1 -1
- package/chunks/{getMachineId-linux-K7XJYFHL.js → getMachineId-linux-R4Z6CSWC.js} +1 -1
- package/chunks/{getMachineId-unsupported-EA5FDRJ6.js → getMachineId-unsupported-Z3SBVBUV.js} +1 -1
- package/chunks/{getMachineId-win-KBA6RAI5.js → getMachineId-win-SCK5UFDT.js} +1 -1
- package/chunks/{glob-MP7IPPNS.js → glob-LABYMYKG.js} +43 -39
- package/chunks/{grep-OHN54Z7A.js → grep-HKIKJCAS.js} +43 -39
- package/chunks/{handleAutoUpdate-EGCO46FV.js → handleAutoUpdate-RWAAL2UM.js} +40 -36
- package/chunks/{i18n-4LK42EK5.js → i18n-ZUVDAJIJ.js} +37 -33
- package/chunks/{initializer-DAL5QAZU.js → initializer-7YUHIC36.js} +43 -39
- package/chunks/{installationInfo-HOKGVMMQ.js → installationInfo-DVEOMWDE.js} +39 -33
- package/chunks/{ja-2ICT3KXF.js → ja-KY4ROZTE.js} +5 -1
- package/chunks/{keychain-token-storage-DWRJMNH3.js → keychain-token-storage-6ACJDYIB.js} +3 -3
- package/chunks/list-WHCZSIR2.js +82 -0
- package/chunks/{loadedSettingsAdapter-I42UOUE7.js → loadedSettingsAdapter-YCWN6AK3.js} +42 -38
- package/chunks/{loop-wakeup-HMHCT5GU.js → loop-wakeup-RNMRVA66.js} +6 -6
- package/chunks/{ls-IW5HYDG4.js → ls-J2ZI5XYK.js} +5 -5
- package/chunks/{lsp-4RL52YIZ.js → lsp-UMS3NUB5.js} +3 -3
- package/chunks/managed-npm-update-PG3463CJ.js +333 -0
- package/chunks/{mcp-62XOYOXZ.js → mcp-VLHDCKAN.js} +42 -38
- package/chunks/{monitor-YIHFTVM7.js → monitor-GG4F4YM6.js} +41 -37
- package/chunks/nonInteractiveCli-UYXYV4YX.js +133 -0
- package/chunks/{notebook-edit-XK4J36D3.js → notebook-edit-US4VLN6Q.js} +44 -42
- package/chunks/{openaiContentGenerator-OEIKDARY.js → openaiContentGenerator-CVEDTMDB.js} +20 -18
- package/chunks/{pidfile-2XVZMMKS.js → pidfile-QQ45OIOY.js} +37 -33
- package/chunks/{processUtils-SYFMMDPV.js → processUtils-3WMHLQE5.js} +2 -2
- package/chunks/{pt-JJ4XPIBP.js → pt-OK455PLH.js} +5 -1
- package/chunks/{qwenContentGenerator-LTTPUWV3.js → qwenContentGenerator-Y2GRNYZQ.js} +42 -38
- package/chunks/{qwenOAuth2-U3X6UBDP.js → qwenOAuth2-J2X6E5VO.js} +18 -16
- package/chunks/{read-file-P6IEAOBS.js → read-file-C7Z266CU.js} +13 -11
- package/chunks/{read-mcp-resource-OIBCNIX7.js → read-mcp-resource-F6HYMDUY.js} +3 -3
- package/chunks/{record-artifact-HDMK4LHG.js → record-artifact-7GCFLDD7.js} +3 -3
- package/chunks/{resumeHistoryUtils-WMJ5TUPF.js → resumeHistoryUtils-KBQWX77U.js} +43 -39
- package/chunks/{ripGrep-US5HKBSM.js → ripGrep-RW26MTQ3.js} +36 -32
- package/chunks/{ru-STR4KTW7.js → ru-7SPDGMGD.js} +5 -1
- package/chunks/{run-qwen-serve-MIFJODT4.js → run-qwen-serve-MXFMOMEL.js} +104 -82
- package/chunks/{runtime-SK5QH53T.js → runtime-APNO3V6D.js} +48 -42
- package/chunks/{scheduler-4TIUONHH.js → scheduler-L6FYCGVO.js} +36 -32
- package/chunks/sdk-exporters-grpc-ETLH47EP.js +23214 -0
- package/chunks/sdk-exporters-http-IDGLRBGP.js +563 -0
- package/chunks/sdk-impl-5ESZBGJQ.js +9186 -0
- package/chunks/{send-message-WXVVK4DB.js → send-message-PYIJ2PZL.js} +6 -4
- package/chunks/{serve-F6VZULAL.js → serve-6QBXDVWT.js} +42 -38
- package/chunks/{server-UJEZDWGO.js → server-5TJJEMVQ.js} +1006 -305
- package/chunks/{session-PFCYZOZJ.js → session-BWEUHKQB.js} +92 -176
- package/chunks/{settings-7UHALRNO.js → settings-O7IUQNRR.js} +45 -41
- package/chunks/{shell-DY7EASPT.js → shell-R5L4NQYY.js} +36 -32
- package/chunks/{skill-DOZBVXRT.js → skill-ITEOSNW6.js} +24 -20
- package/chunks/{spawnChannel-HT7EQ4SL.js → spawnChannel-E7NTWSGW.js} +38 -34
- package/chunks/{src-VJO75DQQ.js → src-FFXGUTNL.js} +303 -237
- package/chunks/{standalone-update-5ERAJGLE.js → standalone-update-JCJOXW4P.js} +38 -34
- package/chunks/{startInteractiveUI-HYMIOBH7.js → startInteractiveUI-IJSBLZFO.js} +1057 -864
- package/chunks/{syntheticOutput-HCUFXSIA.js → syntheticOutput-H7RTI5KL.js} +4 -4
- package/chunks/{task-create-RIY5JTFC.js → task-create-7474AJJD.js} +10 -8
- package/chunks/{task-list-XBUCV3CO.js → task-list-633HGOIB.js} +6 -6
- package/chunks/{task-stop-QDFCCYR5.js → task-stop-MNUGHPIA.js} +3 -3
- package/chunks/{task-update-7PXKJQOI.js → task-update-66GQB5LI.js} +10 -8
- package/chunks/{team-create-NF3FCZE2.js → team-create-OVSZTJZO.js} +44 -40
- package/chunks/{team-delete-TNSSE2S5.js → team-delete-BB3CG3QF.js} +6 -6
- package/chunks/{team-plan-approval-P5U7U4NW.js → team-plan-approval-SLEVDLT5.js} +41 -37
- package/chunks/{theme-manager-WD73RXOX.js → theme-manager-V6ZQISHM.js} +37 -33
- package/chunks/{todoWrite-OMAIGB6V.js → todoWrite-KRAUN54W.js} +5 -5
- package/chunks/{tool-search-TDMA733L.js → tool-search-KYIF6C6E.js} +21 -17
- package/chunks/{total-session-admission-H3XZPCNC.js → total-session-admission-EU77XTL7.js} +42 -38
- package/chunks/{tree-sitter-VJEPTDMU.js → tree-sitter-4D7QS7F6.js} +1 -1
- package/chunks/{tree-sitter-bash-WFKBO43W.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
- package/chunks/{trustedFolders-NEFWXHU2.js → trustedFolders-DDEF3ADH.js} +37 -33
- package/chunks/{update-relaunch-T2XQQC4W.js → update-relaunch-XEZTDP6K.js} +17 -17
- package/chunks/updateCheck-KZ5LZ545.js +89 -0
- package/chunks/{useAutoAcceptIndicator-5FLFR3BY.js → useAutoAcceptIndicator-47EZERGQ.js} +47 -43
- package/chunks/{validateNonInterActiveAuth-Z23SJ4D4.js → validateNonInterActiveAuth-J2DM4LWZ.js} +79 -75
- package/chunks/{version-PLKW23RX.js → version-PN7WYXHP.js} +1 -1
- package/chunks/{web-fetch-QNI3EEXN.js → web-fetch-WRI5QRFR.js} +100 -42
- package/chunks/{web-search-DLYTQBNN.js → web-search-2HCXNAVX.js} +111 -60
- package/chunks/{workflow-A3WFSQKU.js → workflow-U5XBPGQZ.js} +48 -43
- package/chunks/{workspace-providers-status-6K34OJLQ.js → workspace-providers-status-2T54GIJZ.js} +45 -41
- package/chunks/{workspace-registration-store-6FPLTQG3.js → workspace-registration-store-F3V4KBIW.js} +8 -2
- package/chunks/{workspace-registry-JZRIJXJS.js → workspace-registry-U6QVZ5BU.js} +42 -38
- package/chunks/{workspace-service-PQDLBZV3.js → workspace-service-734D36QD.js} +49 -45
- package/chunks/{workspace-skills-status-RKCPZVT2.js → workspace-skills-status-5ABUKOAQ.js} +43 -39
- package/chunks/write-file-CIH4I4CS.js +66 -0
- package/chunks/{zh-TW-4RR3YHNN.js → zh-TW-BM47YBFH.js} +5 -1
- package/chunks/{zh-6ANG2HTL.js → zh-WY5DWYZD.js} +5 -1
- package/cli-entry.js +164 -12
- package/cli.js +18 -11
- package/locales/ca.js +772 -203
- package/locales/de.js +8 -2
- package/locales/en.js +8 -2
- package/locales/fr.js +8 -2
- package/locales/ja.js +8 -2
- package/locales/pt.js +8 -2
- package/locales/ru.js +8 -2
- package/locales/zh-TW.js +8 -2
- package/locales/zh.js +8 -2
- package/package.json +3 -3
- package/web-shell/assets/{arc-Buk1besA.js → arc-ByltRugA.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1aUKYDC.js → architectureDiagram-3BPJPVTR-CCRTto5d.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CRTdg3Zx.js → blockDiagram-GPEHLZMM-Jfy36u1L.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DFdRMp5g.js → c4Diagram-AAUBKEIU-4d5FfEZ0.js} +1 -1
- package/web-shell/assets/channel-4N2UIFcG.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-4rYQdkEI.js → chunk-2J33WTMH-BPwxCEro.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-Coi-pQJy.js → chunk-4BX2VUAB-jY7ZmJWY.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BtBjz02t.js → chunk-55IACEB6-C98HgCsS.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CGYOWorl.js → chunk-727SXJPM-cDu-ge-q.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CH5AKhqx.js → chunk-AQP2D5EJ-BKdJwxXK.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cd50-w85.js → chunk-FMBD7UC4-DnuxqwMu.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-C2wF3KCK.js → chunk-ND2GUHAM-C4fZNPv0.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-pCeRTaWi.js → chunk-QZHKN3VN-Cf4XWOmz.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Q4dYOtsh.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Q4dYOtsh.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-B-_fAB6D.js → cose-bilkent-S5V4N54A-C82mFiqj.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-ChSPNHpL.js → dagre-BM42HDAG-Df8KACER.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BX7cFOF3.js → diagram-2AECGRRQ-EzNs7s_2.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BQUTW92n.js → diagram-5GNKFQAL-BRLNvreg.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BkYPh3e4.js → diagram-KO2AKTUF-2HLYHRjC.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-Cl6jsNyx.js → diagram-LMA3HP47-DeH0NzSp.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DRWoHz8n.js → diagram-OG6HWLK6-k5Gn47-G.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CGvFcZco.js → erDiagram-TEJ5UH35-gPHFo79f.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-vms6oVdv.js → flowDiagram-I6XJVG4X-DYBOiTRW.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-ukT_sfmi.js → ganttDiagram-6RSMTGT7-cxjAuic9.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js → gitGraphDiagram-PVQCEYII-3nPqpmCP.js} +1 -1
- package/web-shell/assets/index-B7jzUZ_s.css +5 -0
- package/web-shell/assets/{index-wFXp7W68.js → index-Cl8d-1bK.js} +1 -1
- package/web-shell/assets/index-gE8OWwj_.js +1197 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-DHJdSi7x.js → infoDiagram-5YYISTIA-Dph21pR5.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DOvd2Wph.js → ishikawaDiagram-YF4QCWOH-Cjg1hSaG.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-CH_urMCT.js → journeyDiagram-JHISSGLW-CR-IzvnU.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-FKiBdgbH.js → kanban-definition-UN3LZRKU-BYmuybuC.js} +1 -1
- package/web-shell/assets/{linear-0ZVQFVKf.js → linear-CngEEoy8.js} +1 -1
- package/web-shell/assets/{mermaid.core-DJ05ZZIK.js → mermaid.core-G6fbZRPf.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BPuUhkUm.js → mindmap-definition-RKZ34NQL-BtnqnUwJ.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-yLFKcXyG.js → pieDiagram-4H26LBE5-XTq6UHIA.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-irWqc1pE.js → quadrantDiagram-W4KKPZXB-D1J5PrsS.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-B_4uMoIV.js → requirementDiagram-4Y6WPE33-CLcBUy3t.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ciA4GPwk.js → sankeyDiagram-5OEKKPKP-iwKV02_6.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CRdZvy0U.js → sequenceDiagram-3UESZ5HK-7NFYQcEX.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-DaYIkCCn.js → stateDiagram-AJRCARHV-Bvm4Wih6.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-xXU_zO2Z.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-oBUKv6iH.js → timeline-definition-PNZ67QCA-B4FZFE9O.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-CGW9Sdmb.js → vennDiagram-CIIHVFJN-CvMBpmtL.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CvwKJOCm.js → wardley-L42UT6IY-E3ag2327.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-Ipc260sN.js → wardleyDiagram-YWT4CUSO-BEXWlgxC.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-D6-CM7pK.js → xychartDiagram-2RQKCTM6-CICK05gI.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-6YS6TQB3.js +0 -45
- package/chunks/chunk-ETD6K42I.js +0 -358
- package/chunks/chunk-HAL7YT4M.js +0 -74639
- package/chunks/chunk-W7FJ3N32.js +0 -49
- package/chunks/daemon-status-provider-DYDVT4S5.js +0 -77
- package/chunks/list-M5NNXMQQ.js +0 -78
- package/chunks/nonInteractiveCli-Z73R2B3B.js +0 -129
- package/chunks/updateCheck-G5JYMVJZ.js +0 -73
- package/chunks/write-file-LHZENZ2A.js +0 -599
- package/web-shell/assets/channel-04R0vLbG.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +0 -1
- package/web-shell/assets/index-DgkKrjw3.js +0 -1187
- package/web-shell/assets/index-Rv6mOAN9.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +0 -1
- package/chunks/{chunk-PEJWA3QQ.js → chunk-QZJY47IE.js} +5 -5
|
@@ -20,9 +20,6 @@ import {
|
|
|
20
20
|
MID_TURN_QUEUE_DRAIN_METHOD,
|
|
21
21
|
TODO_STOP_GUARD_QUEUE_RELEASE_METHOD
|
|
22
22
|
} from "./chunk-QR6U5QPP.js";
|
|
23
|
-
import {
|
|
24
|
-
defaultSpawnChannelFactory
|
|
25
|
-
} from "./chunk-4E33SVWA.js";
|
|
26
23
|
import {
|
|
27
24
|
BranchWhilePromptActiveError,
|
|
28
25
|
CancelSentinelCollisionError,
|
|
@@ -34,6 +31,7 @@ import {
|
|
|
34
31
|
InvalidSessionScopeError,
|
|
35
32
|
MCP_RESTART_SERVER_DEADLINE_MS,
|
|
36
33
|
PermissionForbiddenError,
|
|
34
|
+
PromptDeadlineExceededError,
|
|
37
35
|
PromptQueueFullError,
|
|
38
36
|
RestoreInProgressError,
|
|
39
37
|
SessionBusyError,
|
|
@@ -43,7 +41,10 @@ import {
|
|
|
43
41
|
SessionShellDisabledError,
|
|
44
42
|
WorkspaceMismatchError,
|
|
45
43
|
isNotCurrentlyGeneratingCancelError
|
|
46
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UH3WSE5L.js";
|
|
45
|
+
import {
|
|
46
|
+
defaultSpawnChannelFactory
|
|
47
|
+
} from "./chunk-JHFVJQRO.js";
|
|
47
48
|
import {
|
|
48
49
|
BridgeChannelClosedError,
|
|
49
50
|
BridgeTimeoutError,
|
|
@@ -52,15 +53,16 @@ import {
|
|
|
52
53
|
STATUS_SCHEMA_VERSION,
|
|
53
54
|
createIdleWorkspaceExtensionsStatus,
|
|
54
55
|
createIdleWorkspaceHooksStatus
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import {
|
|
57
|
-
canonicalizeWorkspace
|
|
58
|
-
} from "./chunk-W7FJ3N32.js";
|
|
56
|
+
} from "./chunk-BWQRDISK.js";
|
|
59
57
|
import {
|
|
60
58
|
ClientSideConnection,
|
|
61
59
|
PROTOCOL_VERSION,
|
|
62
60
|
RequestError
|
|
63
61
|
} from "./chunk-UDXSXLER.js";
|
|
62
|
+
import {
|
|
63
|
+
canonicalizeWorkspace,
|
|
64
|
+
translateAndCheckAbsoluteWorkspacePath
|
|
65
|
+
} from "./chunk-2RFKHEXL.js";
|
|
64
66
|
import {
|
|
65
67
|
SESSION_ARTIFACT_PERSISTENCE_VERSION,
|
|
66
68
|
ShellExecutionService,
|
|
@@ -72,11 +74,11 @@ import {
|
|
|
72
74
|
metadataBudgetBytes,
|
|
73
75
|
normalizeSnapshotPayload,
|
|
74
76
|
stableSessionArtifactId
|
|
75
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-GEB2CGUV.js";
|
|
76
78
|
import {
|
|
77
79
|
DAEMON_TRACEPARENT_META_KEY,
|
|
78
80
|
DAEMON_TRACESTATE_META_KEY
|
|
79
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-5G2SK2OO.js";
|
|
80
82
|
import {
|
|
81
83
|
init_esbuild_shims
|
|
82
84
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -5040,6 +5042,12 @@ function isRecord3(value) {
|
|
|
5040
5042
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5041
5043
|
}
|
|
5042
5044
|
__name(isRecord3, "isRecord");
|
|
5045
|
+
function isDefinitiveAcpRequestError(error) {
|
|
5046
|
+
if (error instanceof RequestError) return true;
|
|
5047
|
+
if (!isRecord3(error)) return false;
|
|
5048
|
+
return typeof error["code"] === "number" && Number.isInteger(error["code"]) && typeof error["message"] === "string";
|
|
5049
|
+
}
|
|
5050
|
+
__name(isDefinitiveAcpRequestError, "isDefinitiveAcpRequestError");
|
|
5043
5051
|
function getCanonicalModelId(response, fallback) {
|
|
5044
5052
|
if (!isRecord3(response) || !isRecord3(response["_meta"])) return fallback;
|
|
5045
5053
|
const modelSwitch = response["_meta"]["qwenModelSwitch"];
|
|
@@ -5399,6 +5407,57 @@ function broadcastTurnError(entry, sessionId, err, promptId, originatorClientId)
|
|
|
5399
5407
|
}
|
|
5400
5408
|
}
|
|
5401
5409
|
__name(broadcastTurnError, "broadcastTurnError");
|
|
5410
|
+
function publishPromptTerminal(entry, pendingEntry, terminal) {
|
|
5411
|
+
if (pendingEntry.terminalPublished) {
|
|
5412
|
+
writeStderrLine(
|
|
5413
|
+
`publishPromptTerminal: suppressed duplicate ${terminal.kind} terminal for prompt ${pendingEntry.promptId} (session ${entry.sessionId})`
|
|
5414
|
+
);
|
|
5415
|
+
return;
|
|
5416
|
+
}
|
|
5417
|
+
pendingEntry.terminalPublished = true;
|
|
5418
|
+
const originatorClientId = pendingEntry.originatorClientId;
|
|
5419
|
+
if (terminal.kind === "complete") {
|
|
5420
|
+
broadcastTurnComplete(
|
|
5421
|
+
entry,
|
|
5422
|
+
entry.sessionId,
|
|
5423
|
+
terminal.result,
|
|
5424
|
+
pendingEntry.promptId,
|
|
5425
|
+
originatorClientId
|
|
5426
|
+
);
|
|
5427
|
+
} else if (terminal.kind === "cancelled") {
|
|
5428
|
+
broadcastTurnComplete(
|
|
5429
|
+
entry,
|
|
5430
|
+
entry.sessionId,
|
|
5431
|
+
{ stopReason: "cancelled" },
|
|
5432
|
+
pendingEntry.promptId,
|
|
5433
|
+
originatorClientId
|
|
5434
|
+
);
|
|
5435
|
+
} else {
|
|
5436
|
+
broadcastTurnError(
|
|
5437
|
+
entry,
|
|
5438
|
+
entry.sessionId,
|
|
5439
|
+
terminal.err,
|
|
5440
|
+
pendingEntry.promptId,
|
|
5441
|
+
originatorClientId
|
|
5442
|
+
);
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
__name(publishPromptTerminal, "publishPromptTerminal");
|
|
5446
|
+
function flushPromptTerminals(entry, code, message) {
|
|
5447
|
+
for (const pending of [...entry.pendingPromptList]) {
|
|
5448
|
+
publishPromptTerminal(entry, pending, {
|
|
5449
|
+
kind: "error",
|
|
5450
|
+
err: { code, message }
|
|
5451
|
+
});
|
|
5452
|
+
try {
|
|
5453
|
+
pending.abortController.abort(
|
|
5454
|
+
new DOMException("Prompt aborted", "AbortError")
|
|
5455
|
+
);
|
|
5456
|
+
} catch {
|
|
5457
|
+
}
|
|
5458
|
+
}
|
|
5459
|
+
}
|
|
5460
|
+
__name(flushPromptTerminals, "flushPromptTerminals");
|
|
5402
5461
|
function hasControlCharacter2(value) {
|
|
5403
5462
|
for (let i = 0; i < value.length; i += 1) {
|
|
5404
5463
|
const code = value.charCodeAt(i);
|
|
@@ -5558,6 +5617,18 @@ function createAcpSessionBridge(opts) {
|
|
|
5558
5617
|
lastActivityTimestamp = Date.now();
|
|
5559
5618
|
}
|
|
5560
5619
|
__name(touchActivity, "touchActivity");
|
|
5620
|
+
function settleActivePromptState(entry, promptId) {
|
|
5621
|
+
if (entry.activePromptId !== promptId) return;
|
|
5622
|
+
delete entry.activePromptId;
|
|
5623
|
+
delete entry.activePromptOriginatorClientId;
|
|
5624
|
+
if (entry.promptActive) {
|
|
5625
|
+
entry.promptActive = false;
|
|
5626
|
+
activePromptCounter--;
|
|
5627
|
+
entry.sessionLastSeenAt = Date.now();
|
|
5628
|
+
touchActivity();
|
|
5629
|
+
}
|
|
5630
|
+
}
|
|
5631
|
+
__name(settleActivePromptState, "settleActivePromptState");
|
|
5561
5632
|
function resolvePositiveFiniteMs(raw, fallback) {
|
|
5562
5633
|
if (raw === void 0) return fallback;
|
|
5563
5634
|
return raw > 0 && Number.isFinite(raw) ? Math.min(raw, 2147483647) : 0;
|
|
@@ -5674,7 +5745,7 @@ function createAcpSessionBridge(opts) {
|
|
|
5674
5745
|
if (shuttingDown) return;
|
|
5675
5746
|
const now = Date.now();
|
|
5676
5747
|
for (const [id, entry] of byId) {
|
|
5677
|
-
if (entry.
|
|
5748
|
+
if (entry.pendingPromptCount > 0) continue;
|
|
5678
5749
|
if (entry.events.subscriberCount > 0) continue;
|
|
5679
5750
|
const lastActive = entry.sessionLastSeenAt ?? Date.parse(entry.createdAt);
|
|
5680
5751
|
const idle = now - lastActive;
|
|
@@ -5731,7 +5802,8 @@ function createAcpSessionBridge(opts) {
|
|
|
5731
5802
|
pendingInteractionCount: entry.pendingInteractions.size,
|
|
5732
5803
|
hasTurnError: entry.turnError !== void 0,
|
|
5733
5804
|
...entry.turnError !== void 0 ? { turnError: entry.turnError } : {},
|
|
5734
|
-
pendingInteractions: [...entry.pendingInteractions.values()]
|
|
5805
|
+
pendingInteractions: [...entry.pendingInteractions.values()],
|
|
5806
|
+
...entry.worktree ? { worktree: entry.worktree } : {}
|
|
5735
5807
|
};
|
|
5736
5808
|
}, "toSessionSummary");
|
|
5737
5809
|
const permissionConsensusQuorum = opts.permissionConsensusQuorum;
|
|
@@ -5793,13 +5865,30 @@ function createAcpSessionBridge(opts) {
|
|
|
5793
5865
|
entry.clientIds.set(clientId, count - 1);
|
|
5794
5866
|
}
|
|
5795
5867
|
}, "unregisterClient");
|
|
5868
|
+
const recordAttachRef = /* @__PURE__ */ __name((entry, clientId) => {
|
|
5869
|
+
entry.attachRefs.set(clientId, (entry.attachRefs.get(clientId) ?? 0) + 1);
|
|
5870
|
+
}, "recordAttachRef");
|
|
5871
|
+
const releaseAttachRef = /* @__PURE__ */ __name((entry, clientId) => {
|
|
5872
|
+
const refs = entry.attachRefs.get(clientId);
|
|
5873
|
+
if (refs === void 0 || refs <= 0) return false;
|
|
5874
|
+
if (refs === 1) {
|
|
5875
|
+
entry.attachRefs.delete(clientId);
|
|
5876
|
+
} else {
|
|
5877
|
+
entry.attachRefs.set(clientId, refs - 1);
|
|
5878
|
+
}
|
|
5879
|
+
return true;
|
|
5880
|
+
}, "releaseAttachRef");
|
|
5796
5881
|
const rollbackAttachRegistration = /* @__PURE__ */ __name(async (entry, clientId, attachCountDelta = 1) => {
|
|
5797
|
-
|
|
5882
|
+
const released = releaseAttachRef(entry, clientId) ? 1 : 0;
|
|
5883
|
+
entry.attachCount = Math.max(
|
|
5884
|
+
0,
|
|
5885
|
+
entry.attachCount - (released + (attachCountDelta - 1))
|
|
5886
|
+
);
|
|
5798
5887
|
unregisterClient(entry, clientId);
|
|
5799
5888
|
if (entry.spawnOwnerWantedKill && entry.attachCount === 0 && entry.events.subscriberCount === 0) {
|
|
5800
5889
|
await bridgeApi.killSession(entry.sessionId).catch(() => {
|
|
5801
5890
|
});
|
|
5802
|
-
} else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 &&
|
|
5891
|
+
} else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0) {
|
|
5803
5892
|
await closeSessionImpl(entry.sessionId, void 0, {
|
|
5804
5893
|
reason: "last_client_detached"
|
|
5805
5894
|
}).catch((err) => {
|
|
@@ -5968,6 +6057,11 @@ function createAcpSessionBridge(opts) {
|
|
|
5968
6057
|
const sessEntry = byId.get(sid);
|
|
5969
6058
|
if (!sessEntry) continue;
|
|
5970
6059
|
cancelPendingForSession(sid);
|
|
6060
|
+
flushPromptTerminals(
|
|
6061
|
+
sessEntry,
|
|
6062
|
+
"channel_closed",
|
|
6063
|
+
"agent channel exited before the prompt completed"
|
|
6064
|
+
);
|
|
5971
6065
|
try {
|
|
5972
6066
|
sessEntry.events.publish({
|
|
5973
6067
|
type: "session_died",
|
|
@@ -6062,7 +6156,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6062
6156
|
}
|
|
6063
6157
|
}
|
|
6064
6158
|
__name(ensureChannel, "ensureChannel");
|
|
6065
|
-
async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId) {
|
|
6159
|
+
async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId, worktree) {
|
|
6066
6160
|
const channelPath = channelInfo && !channelInfo.isDying ? "reused" : inFlightChannelSpawn ? "joined" : "spawned_on_request";
|
|
6067
6161
|
const ci = await telemetry.withSpan(
|
|
6068
6162
|
"channel.wait",
|
|
@@ -6123,7 +6217,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6123
6217
|
newSessionResp.sessionId,
|
|
6124
6218
|
boundWorkspace,
|
|
6125
6219
|
void 0,
|
|
6126
|
-
{ parentSessionId, sourceType, sourceId }
|
|
6220
|
+
{ parentSessionId, sourceType, sourceId, worktree }
|
|
6127
6221
|
);
|
|
6128
6222
|
initializedSessionId = entry.sessionId;
|
|
6129
6223
|
sessionRegistered = true;
|
|
@@ -6237,7 +6331,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6237
6331
|
...entry.sourceType ? { sourceType: entry.sourceType } : {},
|
|
6238
6332
|
...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {},
|
|
6239
6333
|
...entry.sourceType ? { sourcePersisted: sourcePersisted === true } : {},
|
|
6240
|
-
...entry.parentSessionId ? { parentSessionPersisted: parentSessionPersisted === true } : {}
|
|
6334
|
+
...entry.parentSessionId ? { parentSessionPersisted: parentSessionPersisted === true } : {},
|
|
6335
|
+
...entry.worktree ? { worktree: entry.worktree } : {}
|
|
6241
6336
|
};
|
|
6242
6337
|
} finally {
|
|
6243
6338
|
ci.sessionSpawnsInFlight = Math.max(0, ci.sessionSpawnsInFlight - 1);
|
|
@@ -6447,10 +6542,11 @@ function createAcpSessionBridge(opts) {
|
|
|
6447
6542
|
}
|
|
6448
6543
|
return entry.transportClosedReject;
|
|
6449
6544
|
}, "getTransportClosedReject");
|
|
6450
|
-
const resolveWorkspaceKey = /* @__PURE__ */ __name((
|
|
6451
|
-
|
|
6545
|
+
const resolveWorkspaceKey = /* @__PURE__ */ __name((rawWorkspaceCwd) => {
|
|
6546
|
+
const workspaceCwd = translateAndCheckAbsoluteWorkspacePath(rawWorkspaceCwd);
|
|
6547
|
+
if (workspaceCwd === null) {
|
|
6452
6548
|
throw new Error(
|
|
6453
|
-
`workspaceCwd must be an absolute path; got "${
|
|
6549
|
+
`workspaceCwd must be an absolute path; got "${rawWorkspaceCwd}"`
|
|
6454
6550
|
);
|
|
6455
6551
|
}
|
|
6456
6552
|
const workspaceKey = workspaceCwd === boundWorkspace ? boundWorkspace : canonicalizeWorkspace(workspaceCwd);
|
|
@@ -6689,12 +6785,18 @@ function createAcpSessionBridge(opts) {
|
|
|
6689
6785
|
return;
|
|
6690
6786
|
}
|
|
6691
6787
|
try {
|
|
6788
|
+
const closeRequest = entry.connection.extMethod(
|
|
6789
|
+
SERVE_CONTROL_EXT_METHODS.sessionClose,
|
|
6790
|
+
{
|
|
6791
|
+
sessionId: entry.sessionId,
|
|
6792
|
+
drainTimeoutMs: Math.max(1, Math.floor(initTimeoutMs * 0.8)),
|
|
6793
|
+
...opts2?.requireFlush === true ? { requireFlush: true } : {}
|
|
6794
|
+
}
|
|
6795
|
+
);
|
|
6796
|
+
const observedCloseRequest = opts2?.timeoutMs ? withTimeout(closeRequest, opts2.timeoutMs, label) : closeRequest;
|
|
6692
6797
|
await Promise.race([
|
|
6693
|
-
withTimeout(
|
|
6694
|
-
|
|
6695
|
-
sessionId: entry.sessionId,
|
|
6696
|
-
...opts2?.requireFlush === true ? { requireFlush: true } : {}
|
|
6697
|
-
}),
|
|
6798
|
+
opts2?.throwOnFailure === true ? observedCloseRequest : withTimeout(
|
|
6799
|
+
observedCloseRequest,
|
|
6698
6800
|
initTimeoutMs,
|
|
6699
6801
|
SERVE_CONTROL_EXT_METHODS.sessionClose
|
|
6700
6802
|
),
|
|
@@ -6850,6 +6952,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6850
6952
|
...options.parentSessionId ? { parentSessionId: options.parentSessionId } : {},
|
|
6851
6953
|
...options.sourceType ? { sourceType: options.sourceType } : {},
|
|
6852
6954
|
...options.sourceId !== void 0 ? { sourceId: options.sourceId } : {},
|
|
6955
|
+
...options.worktree ? { worktree: options.worktree } : {},
|
|
6853
6956
|
channel: ci.channel,
|
|
6854
6957
|
connection: ci.connection,
|
|
6855
6958
|
events,
|
|
@@ -6859,6 +6962,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6859
6962
|
persistence: createSessionArtifactPersistence(ci.connection, sessionId)
|
|
6860
6963
|
}),
|
|
6861
6964
|
recordingDegraded: false,
|
|
6965
|
+
closing: false,
|
|
6862
6966
|
promptQueue: Promise.resolve(),
|
|
6863
6967
|
pendingPromptCount: 0,
|
|
6864
6968
|
pendingPromptList: [],
|
|
@@ -6872,6 +6976,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6872
6976
|
clientIds: /* @__PURE__ */ new Map(),
|
|
6873
6977
|
clientLastSeenAt: /* @__PURE__ */ new Map(),
|
|
6874
6978
|
attachCount: 0,
|
|
6979
|
+
attachRefs: /* @__PURE__ */ new Map(),
|
|
6875
6980
|
spawnOwnerWantedKill: false,
|
|
6876
6981
|
promptActive: false,
|
|
6877
6982
|
retryAllowed: false
|
|
@@ -7074,8 +7179,15 @@ function createAcpSessionBridge(opts) {
|
|
|
7074
7179
|
const historyReplay = action === "load" ? req.historyReplay ?? "stream" : "stream";
|
|
7075
7180
|
const existing = byId.get(req.sessionId);
|
|
7076
7181
|
if (existing) {
|
|
7182
|
+
if (existing.closing) {
|
|
7183
|
+
throw new SessionNotFoundError(
|
|
7184
|
+
req.sessionId,
|
|
7185
|
+
"The session is closing; retry after close completes"
|
|
7186
|
+
);
|
|
7187
|
+
}
|
|
7077
7188
|
existing.attachCount++;
|
|
7078
7189
|
const clientId = registerClient(existing, req.clientId);
|
|
7190
|
+
recordAttachRef(existing, clientId);
|
|
7079
7191
|
if (req.approvalMode) {
|
|
7080
7192
|
await applyApprovalModeForAttach(existing, req.approvalMode, clientId);
|
|
7081
7193
|
}
|
|
@@ -7120,6 +7232,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7120
7232
|
);
|
|
7121
7233
|
}
|
|
7122
7234
|
const clientId = registerClient(entry, req.clientId);
|
|
7235
|
+
recordAttachRef(entry, clientId);
|
|
7123
7236
|
if (req.approvalMode) {
|
|
7124
7237
|
await applyApprovalModeForAttach(entry, req.approvalMode, clientId);
|
|
7125
7238
|
}
|
|
@@ -7241,6 +7354,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7241
7354
|
restoreEvents.close();
|
|
7242
7355
|
racedEntry.attachCount += 1 + coalesceState.count;
|
|
7243
7356
|
const clientId2 = registerClient(racedEntry, req.clientId);
|
|
7357
|
+
recordAttachRef(racedEntry, clientId2);
|
|
7244
7358
|
if (req.approvalMode) {
|
|
7245
7359
|
try {
|
|
7246
7360
|
await applyApprovalMode(
|
|
@@ -7387,10 +7501,17 @@ function createAcpSessionBridge(opts) {
|
|
|
7387
7501
|
async function closeSessionImpl(sessionId, context, closeOpts) {
|
|
7388
7502
|
const entry = byId.get(sessionId);
|
|
7389
7503
|
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
7504
|
+
if (entry.closing) {
|
|
7505
|
+
throw new SessionNotFoundError(
|
|
7506
|
+
sessionId,
|
|
7507
|
+
"The session is already closing"
|
|
7508
|
+
);
|
|
7509
|
+
}
|
|
7390
7510
|
let originatorClientId;
|
|
7391
7511
|
if (context?.clientId !== void 0) {
|
|
7392
7512
|
originatorClientId = resolveTrustedClientId(entry, context.clientId);
|
|
7393
7513
|
}
|
|
7514
|
+
entry.closing = true;
|
|
7394
7515
|
const reason = closeOpts?.reason ?? "client_close";
|
|
7395
7516
|
writeStderrLine(
|
|
7396
7517
|
`qwen serve: closing session ${JSON.stringify(sessionId)} (reason: ${reason})` + (originatorClientId ? ` by client ${JSON.stringify(originatorClientId)}` : "")
|
|
@@ -7400,26 +7521,37 @@ function createAcpSessionBridge(opts) {
|
|
|
7400
7521
|
"session.id": sessionId,
|
|
7401
7522
|
"session.close.reason": reason
|
|
7402
7523
|
});
|
|
7403
|
-
if (defaultEntry === entry) defaultEntry = void 0;
|
|
7404
7524
|
const ci = channelInfoForEntry(entry);
|
|
7405
7525
|
if (!ci) {
|
|
7406
7526
|
writeStderrLine(
|
|
7407
7527
|
`qwen serve: closeSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
|
|
7408
7528
|
);
|
|
7409
7529
|
}
|
|
7410
|
-
|
|
7411
|
-
|
|
7530
|
+
try {
|
|
7531
|
+
permissionMediator.forgetSession(sessionId);
|
|
7532
|
+
entry.pendingPermissionIds.clear();
|
|
7533
|
+
entry.pendingInteractions.clear();
|
|
7412
7534
|
await notifyAgentSessionClose(entry, ci, "closeSession", {
|
|
7413
7535
|
throwOnFailure: true,
|
|
7414
|
-
requireFlush: true
|
|
7536
|
+
requireFlush: closeOpts?.requireAgentClose === true
|
|
7415
7537
|
});
|
|
7538
|
+
} catch (error) {
|
|
7539
|
+
if (isDefinitiveAcpRequestError(error)) {
|
|
7540
|
+
entry.closing = false;
|
|
7541
|
+
} else if (ci) {
|
|
7542
|
+
await killChannelWithLog(
|
|
7543
|
+
ci,
|
|
7544
|
+
`recover unknown close outcome for session ${JSON.stringify(sessionId)}`
|
|
7545
|
+
);
|
|
7546
|
+
} else {
|
|
7547
|
+
entry.closing = false;
|
|
7548
|
+
}
|
|
7549
|
+
throw error;
|
|
7416
7550
|
}
|
|
7551
|
+
if (defaultEntry === entry) defaultEntry = void 0;
|
|
7417
7552
|
if (ci && ci.channel === entry.channel) {
|
|
7418
7553
|
ci.sessionIds.delete(sessionId);
|
|
7419
7554
|
}
|
|
7420
|
-
permissionMediator.forgetSession(sessionId);
|
|
7421
|
-
entry.pendingPermissionIds.clear();
|
|
7422
|
-
entry.pendingInteractions.clear();
|
|
7423
7555
|
if (entry.promptActive) {
|
|
7424
7556
|
entry.promptActive = false;
|
|
7425
7557
|
activePromptCounter--;
|
|
@@ -7434,6 +7566,11 @@ function createAcpSessionBridge(opts) {
|
|
|
7434
7566
|
reason
|
|
7435
7567
|
});
|
|
7436
7568
|
ci?.client.markSessionClosed(sessionId);
|
|
7569
|
+
flushPromptTerminals(
|
|
7570
|
+
entry,
|
|
7571
|
+
"session_closed",
|
|
7572
|
+
"session closed before the prompt completed"
|
|
7573
|
+
);
|
|
7437
7574
|
try {
|
|
7438
7575
|
entry.events.publish({
|
|
7439
7576
|
type: "session_closed",
|
|
@@ -7451,9 +7588,6 @@ function createAcpSessionBridge(opts) {
|
|
|
7451
7588
|
} catch {
|
|
7452
7589
|
}
|
|
7453
7590
|
entry.events.close();
|
|
7454
|
-
if (!requireAgentClose) {
|
|
7455
|
-
await notifyAgentSessionClose(entry, ci, "closeSession");
|
|
7456
|
-
}
|
|
7457
7591
|
try {
|
|
7458
7592
|
await telemetry.withSpan(
|
|
7459
7593
|
"session.close.cancel_active_prompt",
|
|
@@ -7568,8 +7702,15 @@ function createAcpSessionBridge(opts) {
|
|
|
7568
7702
|
if (effectiveScope === "single") {
|
|
7569
7703
|
const existing = defaultEntry;
|
|
7570
7704
|
if (existing) {
|
|
7705
|
+
if (existing.closing) {
|
|
7706
|
+
throw new SessionNotFoundError(
|
|
7707
|
+
existing.sessionId,
|
|
7708
|
+
"The session is closing; retry after close completes"
|
|
7709
|
+
);
|
|
7710
|
+
}
|
|
7571
7711
|
existing.attachCount++;
|
|
7572
7712
|
const clientId = registerClient(existing, req.clientId);
|
|
7713
|
+
recordAttachRef(existing, clientId);
|
|
7573
7714
|
if (req.modelServiceId) {
|
|
7574
7715
|
await applyModelServiceId(
|
|
7575
7716
|
existing,
|
|
@@ -7609,6 +7750,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7609
7750
|
);
|
|
7610
7751
|
}
|
|
7611
7752
|
const clientId = registerClient(attachedEntry, req.clientId);
|
|
7753
|
+
recordAttachRef(attachedEntry, clientId);
|
|
7612
7754
|
if (req.modelServiceId) {
|
|
7613
7755
|
await applyModelServiceId(
|
|
7614
7756
|
attachedEntry,
|
|
@@ -7654,7 +7796,8 @@ function createAcpSessionBridge(opts) {
|
|
|
7654
7796
|
releaseAdmissionOnce,
|
|
7655
7797
|
req.parentSessionId,
|
|
7656
7798
|
source.sourceType,
|
|
7657
|
-
source.sourceId
|
|
7799
|
+
source.sourceId,
|
|
7800
|
+
req.worktree
|
|
7658
7801
|
);
|
|
7659
7802
|
const tracker = effectiveScope === "single" ? workspaceKey : `${workspaceKey}#${randomUUID2()}`;
|
|
7660
7803
|
inFlightSpawns.set(tracker, promise);
|
|
@@ -7676,6 +7819,14 @@ function createAcpSessionBridge(opts) {
|
|
|
7676
7819
|
const queuedAt = Date.now();
|
|
7677
7820
|
const entry = byId.get(sessionId);
|
|
7678
7821
|
if (!entry) return Promise.reject(new SessionNotFoundError(sessionId));
|
|
7822
|
+
if (entry.closing) {
|
|
7823
|
+
return Promise.reject(
|
|
7824
|
+
new SessionNotFoundError(
|
|
7825
|
+
sessionId,
|
|
7826
|
+
"The session is closing; retry after close completes"
|
|
7827
|
+
)
|
|
7828
|
+
);
|
|
7829
|
+
}
|
|
7679
7830
|
const originatorClientId = resolveTrustedClientId(
|
|
7680
7831
|
entry,
|
|
7681
7832
|
context?.clientId
|
|
@@ -7720,6 +7871,37 @@ function createAcpSessionBridge(opts) {
|
|
|
7720
7871
|
state: isQueued ? "queued" : "running"
|
|
7721
7872
|
};
|
|
7722
7873
|
entry.pendingPromptList.push(pendingEntry);
|
|
7874
|
+
const deadlineMs = context?.deadlineMs;
|
|
7875
|
+
const hasDeadline = typeof deadlineMs === "number" && Number.isFinite(deadlineMs) && deadlineMs > 0;
|
|
7876
|
+
let deadlineReject;
|
|
7877
|
+
let deadlinePromise;
|
|
7878
|
+
let deadlineTimer;
|
|
7879
|
+
if (hasDeadline) {
|
|
7880
|
+
deadlinePromise = new Promise((_resolve, reject) => {
|
|
7881
|
+
deadlineReject = reject;
|
|
7882
|
+
});
|
|
7883
|
+
deadlinePromise.catch(() => {
|
|
7884
|
+
});
|
|
7885
|
+
const onDeadline = /* @__PURE__ */ __name(() => {
|
|
7886
|
+
if (pendingEntry.terminalPublished) return;
|
|
7887
|
+
const deadlineErr = new PromptDeadlineExceededError(deadlineMs);
|
|
7888
|
+
writeStderrLine(
|
|
7889
|
+
`sendPrompt: prompt ${promptId} exceeded ${deadlineMs}ms deadline for session ${sessionId}; agent may still be executing`
|
|
7890
|
+
);
|
|
7891
|
+
publishPromptTerminal(entry, pendingEntry, {
|
|
7892
|
+
kind: "error",
|
|
7893
|
+
err: {
|
|
7894
|
+
code: "prompt_deadline_exceeded",
|
|
7895
|
+
message: deadlineErr.message
|
|
7896
|
+
}
|
|
7897
|
+
});
|
|
7898
|
+
settleActivePromptState(entry, pendingEntry.promptId);
|
|
7899
|
+
deadlineReject?.(deadlineErr);
|
|
7900
|
+
pendingAbort.abort(deadlineErr);
|
|
7901
|
+
}, "onDeadline");
|
|
7902
|
+
deadlineTimer = setTimeout(onDeadline, deadlineMs);
|
|
7903
|
+
deadlineTimer.unref();
|
|
7904
|
+
}
|
|
7723
7905
|
if (isQueued) {
|
|
7724
7906
|
pendingAbort.signal.addEventListener(
|
|
7725
7907
|
"abort",
|
|
@@ -7837,35 +8019,17 @@ function createAcpSessionBridge(opts) {
|
|
|
7837
8019
|
);
|
|
7838
8020
|
}
|
|
7839
8021
|
} catch (echoErr) {
|
|
7840
|
-
|
|
7841
|
-
delete entry.activePromptOriginatorClientId;
|
|
7842
|
-
if (entry.promptActive) {
|
|
7843
|
-
entry.promptActive = false;
|
|
7844
|
-
activePromptCounter--;
|
|
7845
|
-
touchActivity();
|
|
7846
|
-
}
|
|
8022
|
+
settleActivePromptState(entry, pendingEntry.promptId);
|
|
7847
8023
|
throw echoErr;
|
|
7848
8024
|
}
|
|
7849
8025
|
const promptPromise = entry.connection.prompt(promptRequest).finally(() => {
|
|
7850
|
-
|
|
7851
|
-
entry.promptActive = false;
|
|
7852
|
-
activePromptCounter--;
|
|
7853
|
-
entry.sessionLastSeenAt = Date.now();
|
|
7854
|
-
touchActivity();
|
|
7855
|
-
}
|
|
7856
|
-
delete entry.activePromptId;
|
|
7857
|
-
delete entry.activePromptOriginatorClientId;
|
|
7858
|
-
if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && byId.has(sessionId)) {
|
|
7859
|
-
void closeSessionImpl(sessionId, void 0, {
|
|
7860
|
-
reason: "last_client_detached"
|
|
7861
|
-
}).catch((err) => {
|
|
7862
|
-
writeStderrLine(
|
|
7863
|
-
`qwen serve: deferred close-on-prompt-complete failed for ${JSON.stringify(sessionId)}: ${err instanceof Error ? err.stack ?? err.message : String(err)}`
|
|
7864
|
-
);
|
|
7865
|
-
});
|
|
7866
|
-
}
|
|
8026
|
+
settleActivePromptState(entry, pendingEntry.promptId);
|
|
7867
8027
|
});
|
|
7868
|
-
const racedPromise = Promise.race([
|
|
8028
|
+
const racedPromise = deadlinePromise ? Promise.race([
|
|
8029
|
+
promptPromise,
|
|
8030
|
+
getTransportClosedReject(entry),
|
|
8031
|
+
deadlinePromise
|
|
8032
|
+
]) : Promise.race([
|
|
7869
8033
|
promptPromise,
|
|
7870
8034
|
getTransportClosedReject(entry)
|
|
7871
8035
|
]);
|
|
@@ -7873,6 +8037,9 @@ function createAcpSessionBridge(opts) {
|
|
|
7873
8037
|
() => {
|
|
7874
8038
|
},
|
|
7875
8039
|
(err) => {
|
|
8040
|
+
if (err instanceof PromptDeadlineExceededError) {
|
|
8041
|
+
return;
|
|
8042
|
+
}
|
|
7876
8043
|
if (err instanceof DOMException && err.name === "AbortError" && pendingEntry.state === "queued") {
|
|
7877
8044
|
writeStderrLine(
|
|
7878
8045
|
`sendPrompt: queued prompt removed before agent forward for session ${sessionId}`
|
|
@@ -7935,23 +8102,17 @@ function createAcpSessionBridge(opts) {
|
|
|
7935
8102
|
);
|
|
7936
8103
|
result.then(
|
|
7937
8104
|
(promptResult) => {
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
pendingEntry.promptId,
|
|
7943
|
-
originatorClientId
|
|
7944
|
-
);
|
|
8105
|
+
publishPromptTerminal(entry, pendingEntry, {
|
|
8106
|
+
kind: "complete",
|
|
8107
|
+
result: promptResult
|
|
8108
|
+
});
|
|
7945
8109
|
},
|
|
7946
8110
|
(err) => {
|
|
7947
|
-
if (err instanceof DOMException && err.name === "AbortError")
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
pendingEntry.promptId,
|
|
7953
|
-
originatorClientId
|
|
7954
|
-
);
|
|
8111
|
+
if (err instanceof DOMException && err.name === "AbortError") {
|
|
8112
|
+
publishPromptTerminal(entry, pendingEntry, { kind: "cancelled" });
|
|
8113
|
+
return;
|
|
8114
|
+
}
|
|
8115
|
+
publishPromptTerminal(entry, pendingEntry, { kind: "error", err });
|
|
7955
8116
|
}
|
|
7956
8117
|
);
|
|
7957
8118
|
entry.promptQueue = result.then(
|
|
@@ -7959,6 +8120,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7959
8120
|
() => void 0
|
|
7960
8121
|
);
|
|
7961
8122
|
result.finally(() => {
|
|
8123
|
+
if (deadlineTimer !== void 0) clearTimeout(deadlineTimer);
|
|
7962
8124
|
const listIdx = entry.pendingPromptList.indexOf(pendingEntry);
|
|
7963
8125
|
if (listIdx !== -1) {
|
|
7964
8126
|
entry.pendingPromptList.splice(listIdx, 1);
|
|
@@ -7985,6 +8147,15 @@ function createAcpSessionBridge(opts) {
|
|
|
7985
8147
|
);
|
|
7986
8148
|
entry.midTurnMessageQueue.length = 0;
|
|
7987
8149
|
}
|
|
8150
|
+
if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0 && byId.get(sessionId) === entry) {
|
|
8151
|
+
void closeSessionImpl(sessionId, void 0, {
|
|
8152
|
+
reason: "last_client_detached"
|
|
8153
|
+
}).catch((err) => {
|
|
8154
|
+
writeStderrLine(
|
|
8155
|
+
`qwen serve: deferred close-on-prompt-complete failed for ${JSON.stringify(sessionId)}: ${err instanceof Error ? err.stack ?? err.message : String(err)}`
|
|
8156
|
+
);
|
|
8157
|
+
});
|
|
8158
|
+
}
|
|
7988
8159
|
}).catch(() => {
|
|
7989
8160
|
});
|
|
7990
8161
|
return result;
|
|
@@ -8260,7 +8431,8 @@ function createAcpSessionBridge(opts) {
|
|
|
8260
8431
|
SERVE_CONTROL_EXT_METHODS.sessionCd,
|
|
8261
8432
|
{
|
|
8262
8433
|
sessionId,
|
|
8263
|
-
path: req.path
|
|
8434
|
+
path: req.path,
|
|
8435
|
+
...req.allowedRoots ? { allowedRoots: req.allowedRoots } : {}
|
|
8264
8436
|
}
|
|
8265
8437
|
);
|
|
8266
8438
|
const extResult = raw;
|
|
@@ -8296,6 +8468,12 @@ function createAcpSessionBridge(opts) {
|
|
|
8296
8468
|
);
|
|
8297
8469
|
return { sessionId, ...result };
|
|
8298
8470
|
},
|
|
8471
|
+
setSessionWorktree(sessionId, worktree) {
|
|
8472
|
+
const entry = byId.get(sessionId);
|
|
8473
|
+
if (entry) {
|
|
8474
|
+
entry.worktree = worktree;
|
|
8475
|
+
}
|
|
8476
|
+
},
|
|
8299
8477
|
async closeSession(sessionId, context, closeOpts) {
|
|
8300
8478
|
return closeSessionImpl(sessionId, context, closeOpts);
|
|
8301
8479
|
},
|
|
@@ -9126,6 +9304,9 @@ function createAcpSessionBridge(opts) {
|
|
|
9126
9304
|
});
|
|
9127
9305
|
} catch {
|
|
9128
9306
|
}
|
|
9307
|
+
if (target.state === "queued") {
|
|
9308
|
+
publishPromptTerminal(entry, target, { kind: "cancelled" });
|
|
9309
|
+
}
|
|
9129
9310
|
return { removed: true };
|
|
9130
9311
|
},
|
|
9131
9312
|
enqueueMidTurnMessage(sessionId, message, context) {
|
|
@@ -9373,6 +9554,9 @@ function createAcpSessionBridge(opts) {
|
|
|
9373
9554
|
async rewindSession(sessionId, req, context) {
|
|
9374
9555
|
const entry = byId.get(sessionId);
|
|
9375
9556
|
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
9557
|
+
if (entry.closing) {
|
|
9558
|
+
throw new SessionNotFoundError(sessionId, "The session is closing");
|
|
9559
|
+
}
|
|
9376
9560
|
const info = channelInfoForEntry(entry);
|
|
9377
9561
|
if (!info || info.isDying) throw new SessionNotFoundError(sessionId);
|
|
9378
9562
|
const originatorClientId = resolveTrustedClientId(
|
|
@@ -9684,9 +9868,41 @@ function createAcpSessionBridge(opts) {
|
|
|
9684
9868
|
entry.spawnOwnerWantedKill = true;
|
|
9685
9869
|
return false;
|
|
9686
9870
|
}
|
|
9871
|
+
if (entry.closing) {
|
|
9872
|
+
const closingChannel = channelInfoForEntry(entry);
|
|
9873
|
+
if (!closingChannel) return false;
|
|
9874
|
+
await killChannelWithLog(
|
|
9875
|
+
closingChannel,
|
|
9876
|
+
`force kill closing session ${JSON.stringify(sessionId)}`
|
|
9877
|
+
);
|
|
9878
|
+
return true;
|
|
9879
|
+
}
|
|
9880
|
+
entry.closing = true;
|
|
9881
|
+
const ci = channelInfoForEntry(entry);
|
|
9882
|
+
if (!ci) {
|
|
9883
|
+
writeStderrLine(
|
|
9884
|
+
`qwen serve: killSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
|
|
9885
|
+
);
|
|
9886
|
+
}
|
|
9687
9887
|
permissionMediator.forgetSession(sessionId);
|
|
9688
9888
|
entry.pendingPermissionIds.clear();
|
|
9689
9889
|
entry.pendingInteractions.clear();
|
|
9890
|
+
try {
|
|
9891
|
+
await notifyAgentSessionClose(entry, ci, "killSession", {
|
|
9892
|
+
throwOnFailure: true,
|
|
9893
|
+
timeoutMs: initTimeoutMs
|
|
9894
|
+
});
|
|
9895
|
+
} catch (error) {
|
|
9896
|
+
if (ci) {
|
|
9897
|
+
await killChannelWithLog(
|
|
9898
|
+
ci,
|
|
9899
|
+
`force kill session ${JSON.stringify(sessionId)}`
|
|
9900
|
+
);
|
|
9901
|
+
return true;
|
|
9902
|
+
}
|
|
9903
|
+
entry.closing = false;
|
|
9904
|
+
throw error;
|
|
9905
|
+
}
|
|
9690
9906
|
if (entry.promptActive) {
|
|
9691
9907
|
entry.promptActive = false;
|
|
9692
9908
|
activePromptCounter--;
|
|
@@ -9701,17 +9917,15 @@ function createAcpSessionBridge(opts) {
|
|
|
9701
9917
|
workspaceCwd: entry.workspaceCwd,
|
|
9702
9918
|
reason: "killed"
|
|
9703
9919
|
});
|
|
9704
|
-
const ci = channelInfoForEntry(entry);
|
|
9705
|
-
if (!ci) {
|
|
9706
|
-
writeStderrLine(
|
|
9707
|
-
`qwen serve: killSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
|
|
9708
|
-
);
|
|
9709
|
-
}
|
|
9710
9920
|
if (ci && ci.channel === entry.channel) {
|
|
9711
9921
|
ci.sessionIds.delete(sessionId);
|
|
9712
9922
|
}
|
|
9713
|
-
await notifyAgentSessionClose(entry, ci, "killSession");
|
|
9714
9923
|
ci?.client.markSessionClosed(sessionId);
|
|
9924
|
+
flushPromptTerminals(
|
|
9925
|
+
entry,
|
|
9926
|
+
"session_killed",
|
|
9927
|
+
"session killed before the prompt completed"
|
|
9928
|
+
);
|
|
9715
9929
|
try {
|
|
9716
9930
|
entry.events.publish({
|
|
9717
9931
|
type: "session_died",
|
|
@@ -9731,12 +9945,14 @@ function createAcpSessionBridge(opts) {
|
|
|
9731
9945
|
async detachClient(sessionId, clientId) {
|
|
9732
9946
|
const entry = byId.get(sessionId);
|
|
9733
9947
|
if (!entry) return;
|
|
9734
|
-
if (
|
|
9948
|
+
if (clientId !== void 0 && releaseAttachRef(entry, clientId)) {
|
|
9949
|
+
if (entry.attachCount > 0) entry.attachCount--;
|
|
9950
|
+
}
|
|
9735
9951
|
unregisterClient(entry, clientId);
|
|
9736
9952
|
if (entry.spawnOwnerWantedKill && entry.attachCount === 0 && entry.events.subscriberCount === 0) {
|
|
9737
9953
|
await this.killSession(sessionId).catch(() => {
|
|
9738
9954
|
});
|
|
9739
|
-
} else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 &&
|
|
9955
|
+
} else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0) {
|
|
9740
9956
|
await closeSessionImpl(sessionId, void 0, {
|
|
9741
9957
|
reason: "last_client_detached"
|
|
9742
9958
|
}).catch((err) => {
|
|
@@ -9800,6 +10016,11 @@ function createAcpSessionBridge(opts) {
|
|
|
9800
10016
|
workspaceCwd: e.workspaceCwd,
|
|
9801
10017
|
reason: shutdownReason
|
|
9802
10018
|
});
|
|
10019
|
+
flushPromptTerminals(
|
|
10020
|
+
e,
|
|
10021
|
+
"daemon_shutdown",
|
|
10022
|
+
"daemon shut down before the prompt completed"
|
|
10023
|
+
);
|
|
9803
10024
|
try {
|
|
9804
10025
|
e.events.publish({
|
|
9805
10026
|
type: "session_died",
|