@qwen-code/qwen-code 0.22.3-nightly.20260831.3a0c4c6108 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/bundled/computer-use/SKILL.md +116 -180
- package/bundled/goal-draft/SKILL.md +5 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +4 -0
- package/bundled/qc-helper/docs/configuration/settings.md +53 -50
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +4 -2
- package/bundled/qc-helper/docs/features/channels/dws.md +6 -2
- package/bundled/qc-helper/docs/features/channels/overview.md +1 -0
- package/bundled/qc-helper/docs/features/commands.md +38 -1
- package/bundled/qc-helper/docs/features/computer-use.md +2 -2
- package/bundled/qc-helper/docs/features/goals.md +9 -3
- package/bundled/qc-helper/docs/features/headless.md +16 -1
- package/bundled/qc-helper/docs/features/hooks.md +2 -1
- package/bundled/qc-helper/docs/features/output-styles.md +38 -0
- package/bundled/qc-helper/docs/qwen-serve.md +15 -0
- package/bundled/review/SKILL.md +5 -5
- package/bundled/review/references/posting.md +2 -2
- package/chunks/{MaxSizedBox-IHRTWGSY.js → MaxSizedBox-B3D7545A.js} +41 -45
- package/chunks/{StandaloneSessionPicker-TLVWVTJ7.js → StandaloneSessionPicker-QUMO4LLQ.js} +64 -67
- package/chunks/{acpAgent-7I5LLPP3.js → acpAgent-2GTFCIEP.js} +771 -248
- package/chunks/{agent-4Z4NTJXD.js → agent-XKF5SZWU.js} +26 -30
- package/chunks/{agent-headless-TVUJXQWU.js → agent-headless-OC2IB55D.js} +26 -30
- package/chunks/{anthropicContentGenerator-VSSPG7XV.js → anthropicContentGenerator-L76MR5OR.js} +14 -14
- package/chunks/{artifact-tool-TEYW6I4A.js → artifact-tool-MYCL2QCS.js} +2 -3
- package/chunks/{askUserQuestion-PYNBWV63.js → askUserQuestion-THQZMG44.js} +2 -2
- package/chunks/{bridge-EVURP4NO.js → bridge-IHSBI2YJ.js} +42 -46
- package/chunks/{build-INBK7IXX.js → build-63BIOYWK.js} +1 -1
- package/chunks/{channel-management-service-IDBNYSFW.js → channel-management-service-4MTCEGJB.js} +4 -4
- package/chunks/{channel-settings-store-MZNXRKVI.js → channel-settings-store-BVKWAI2T.js} +50 -54
- package/chunks/{channel-worker-group-ZLP5SJHT.js → channel-worker-group-47F4ISUZ.js} +6 -6
- package/chunks/{channel-worker-manager-FG5377T2.js → channel-worker-manager-I5Y44GYR.js} +50 -9
- package/chunks/{channel-worker-supervisor-HDVE4ADS.js → channel-worker-supervisor-6VCLUXFE.js} +4 -4
- package/chunks/{chunk-3452WXOK.js → chunk-2M3EWQNG.js} +17 -0
- package/chunks/{chunk-HDMKCJHI.js → chunk-32LU3APX.js} +1 -1
- package/chunks/{chunk-BSJOBW4U.js → chunk-37JFWFCD.js} +1 -1
- package/chunks/{chunk-AN3KFCNH.js → chunk-3JQZVCBI.js} +2 -2
- package/chunks/{chunk-RGEV5AUD.js → chunk-3L724BJ5.js} +11 -8
- package/chunks/{chunk-GCUR24KK.js → chunk-47RYEQW5.js} +2 -2
- package/chunks/{chunk-CM4F4JBB.js → chunk-4BGDFKQE.js} +5 -5
- package/chunks/{chunk-ZBDYI7VM.js → chunk-4F7GQGXB.js} +10961 -4033
- package/chunks/{chunk-JMRE4WJQ.js → chunk-4HVH57J3.js} +81 -17
- package/chunks/{chunk-26SIKQIC.js → chunk-4LIFGNI4.js} +1 -1
- package/chunks/{chunk-U5RTYI7D.js → chunk-4M24B5J5.js} +13 -13
- package/chunks/{chunk-7XICSE62.js → chunk-4PSDSCW3.js} +3 -3
- package/chunks/{chunk-AYYKUUKP.js → chunk-4UANMABT.js} +73 -19
- package/chunks/{chunk-GS7XT345.js → chunk-54C6PIGT.js} +3 -3
- package/chunks/{chunk-UKB2TZAO.js → chunk-5EIOJGCR.js} +4 -4
- package/chunks/{chunk-64REQJJ2.js → chunk-5H5S4UY5.js} +3 -3
- package/chunks/chunk-5IENVM7Z.js +35 -0
- package/chunks/{chunk-JOWQD4LO.js → chunk-5Q5RC2WE.js} +1 -1
- package/chunks/{chunk-3NQCZMUB.js → chunk-5RTTI4GE.js} +73 -73
- package/chunks/{chunk-J4Y3QJHF.js → chunk-64QH2UC6.js} +11 -1
- package/chunks/{chunk-I75VKFCJ.js → chunk-65HWLGA7.js} +1 -1
- package/chunks/{chunk-W7KWB6AH.js → chunk-6A2D4QSO.js} +8 -5
- package/chunks/{chunk-OTTNXUT5.js → chunk-7IKXTGZT.js} +1 -1
- package/chunks/{chunk-LYSZVCCD.js → chunk-7JMGTOH7.js} +427 -129
- package/chunks/{chunk-YOFULAHO.js → chunk-7RB56BRJ.js} +3 -3
- package/chunks/{chunk-6VHIWUJP.js → chunk-ADYN7P2Y.js} +2 -2
- package/chunks/{chunk-7DDTI7Q3.js → chunk-AHYTURFB.js} +1 -1
- package/chunks/{chunk-TNMOFNT4.js → chunk-ALUYNJPM.js} +1395 -2079
- package/chunks/{chunk-H2A2GJGL.js → chunk-AZJLY2XZ.js} +5 -5
- package/chunks/{chunk-BE5FGT5Z.js → chunk-BA4WJC4L.js} +1 -1
- package/chunks/{chunk-H5GPPDGY.js → chunk-BFY33IB4.js} +16 -8
- package/chunks/{chunk-RY7DL5IF.js → chunk-BJXCYUGM.js} +1 -1
- package/chunks/{chunk-ND7TQQPE.js → chunk-C2VWOXHS.js} +6 -6
- package/chunks/{chunk-T4RMUTTT.js → chunk-C4TIXFDZ.js} +2 -2
- package/chunks/{chunk-B2RIIK3K.js → chunk-CVX63TFJ.js} +3 -1
- package/chunks/{chunk-SMJYTKTB.js → chunk-DQCKVAF5.js} +1 -1
- package/chunks/{chunk-RLSPPTWH.js → chunk-DSX7KQPM.js} +438 -181
- package/chunks/{chunk-PNIGAVY6.js → chunk-DTVQSSNM.js} +2 -2
- package/chunks/{chunk-67AY5D3M.js → chunk-DYTW3QVG.js} +23 -8
- package/chunks/{chunk-3CZGSTZX.js → chunk-EBDGRBZX.js} +22 -14
- package/chunks/{chunk-DJBQCO2E.js → chunk-EFTPIZIC.js} +412 -3
- package/chunks/{chunk-QE7DTCLX.js → chunk-EIY7SUPZ.js} +1 -1
- package/chunks/{chunk-6OO7QEWV.js → chunk-EVFDRBUM.js} +97 -77
- package/chunks/{chunk-QTMPM6RC.js → chunk-EWRW2WQC.js} +3 -3
- package/chunks/{chunk-IIFL7QDN.js → chunk-F33GFWPR.js} +34 -11
- package/chunks/{chunk-YPISTYEI.js → chunk-F47DITLZ.js} +11 -1
- package/chunks/{chunk-OE5AQVNB.js → chunk-F7NF2IOE.js} +6 -6
- package/chunks/{chunk-RT4QNQ5P.js → chunk-FD5SJOWT.js} +8 -5
- package/chunks/{chunk-ACZ4YRYK.js → chunk-FRICLXCZ.js} +3 -3
- package/chunks/{chunk-IBMUI5EV.js → chunk-FUO5V5KI.js} +11 -4
- package/chunks/{chunk-T3TL6S3B.js → chunk-G5PBOQWI.js} +8 -5
- package/chunks/{chunk-D7D3HSYQ.js → chunk-G7HBEEX7.js} +12 -7
- package/chunks/{chunk-FXUSWLBF.js → chunk-GH2S4GD5.js} +133 -8
- package/chunks/{chunk-XPDKSOVW.js → chunk-GXUTFQXK.js} +42 -44
- package/chunks/{chunk-OSTQZIOY.js → chunk-H43PSPYS.js} +2 -2
- package/chunks/{chunk-UVYKCRJZ.js → chunk-HJBHMANB.js} +11 -13
- package/chunks/{chunk-WLEYH7CD.js → chunk-HRPFBHW7.js} +4 -0
- package/chunks/{chunk-DBTMP3P4.js → chunk-I2TMJPCV.js} +1 -1
- package/chunks/{chunk-EU2B4P3D.js → chunk-I4NRYS6A.js} +4 -4
- package/chunks/{chunk-JPKTAQS3.js → chunk-I5N4EAS6.js} +1 -1
- package/chunks/{chunk-W4BDHLRT.js → chunk-IG4W5SJR.js} +2 -2
- package/chunks/{chunk-BXNKREX7.js → chunk-IPATA3T2.js} +2 -2
- package/chunks/{chunk-NKLP3DCK.js → chunk-IQAFKVXS.js} +1 -1
- package/chunks/{chunk-AYHQZBJ4.js → chunk-IRKQ4YYX.js} +3 -3
- package/chunks/{chunk-J3NNHTV6.js → chunk-J5TTWBZK.js} +6 -0
- package/chunks/{chunk-AVNATYLY.js → chunk-JJKNYRFY.js} +1 -1
- package/chunks/{chunk-ERHAMGAA.js → chunk-JR42V4UY.js} +1 -1
- package/chunks/{chunk-NT7LXVV5.js → chunk-JUARRUMA.js} +362 -1084
- package/chunks/{chunk-OKMDOATP.js → chunk-KEVYJSI4.js} +11 -11
- package/chunks/{chunk-AF3QB6OL.js → chunk-KGV55H53.js} +1 -1
- package/chunks/{chunk-SDCHI64N.js → chunk-KM3XVTMO.js} +10 -4
- package/chunks/{chunk-ERRJA23L.js → chunk-KMU3ZHH4.js} +1 -1
- package/chunks/chunk-KOGW3YWJ.js +2054 -0
- package/chunks/{chunk-6NWPR2EB.js → chunk-L26ONV2Y.js} +5 -5
- package/chunks/chunk-L34XSHIZ.js +28 -0
- package/chunks/{chunk-UXEW7TQS.js → chunk-LB3WQQJK.js} +1 -1
- package/chunks/{chunk-YNG7XAJU.js → chunk-LEPCWS5A.js} +1 -1
- package/chunks/{chunk-XLENZQXH.js → chunk-LHBNR6EU.js} +2 -2
- package/chunks/{chunk-AKNQMSL2.js → chunk-LOBDDFYK.js} +4 -28
- package/chunks/{chunk-L6CUJZDG.js → chunk-LU77UT4D.js} +2 -2
- package/chunks/{chunk-3EGEBDTW.js → chunk-M4KFODIP.js} +1 -1
- package/chunks/{chunk-JLSZT354.js → chunk-M4LBBSVP.js} +2 -0
- package/chunks/{chunk-YOMKOM7E.js → chunk-MP6YZ4RK.js} +6580 -5992
- package/chunks/chunk-N2TNM3QB.js +9 -0
- package/chunks/{chunk-GDXSXL3H.js → chunk-NFIDVZND.js} +1 -1
- package/chunks/{chunk-NT5XIL5H.js → chunk-NQ4L2CMD.js} +51 -6
- package/chunks/{chunk-OQYXJK2V.js → chunk-NRL5CUZT.js} +1 -1
- package/chunks/{chunk-FIWZOMBF.js → chunk-NSUKQ4DN.js} +6 -0
- package/chunks/chunk-NUHOLAQ6.js +59 -0
- package/chunks/{chunk-BBYTY46C.js → chunk-NVVJTUSL.js} +266 -105
- package/chunks/{chunk-CAZADEU7.js → chunk-NXKOVOM5.js} +9 -9
- package/chunks/{chunk-5Q372OFJ.js → chunk-O4KNCAX4.js} +57 -10
- package/chunks/{chunk-GOXKNSDZ.js → chunk-O5CD7T4T.js} +40 -9
- package/chunks/{chunk-XIQ5HQ2F.js → chunk-OBTWL6ZW.js} +1 -1
- package/chunks/{chunk-5MK45KZ3.js → chunk-OHOO527W.js} +1 -1
- package/chunks/{chunk-CETB5XY4.js → chunk-ORFIYTI2.js} +1 -1
- package/chunks/{chunk-7E7UCJHS.js → chunk-OSHQMOBS.js} +18 -17
- package/chunks/{chunk-YDQ4OCDK.js → chunk-OSSTATJF.js} +89 -1
- package/chunks/chunk-P6UIF2OW.js +400 -0
- package/chunks/{chunk-V4HN35IF.js → chunk-PCRBLMIN.js} +16 -2
- package/chunks/{chunk-L2OKAIUK.js → chunk-QI27MKNQ.js} +23 -15
- package/chunks/{chunk-FHPYRXRH.js → chunk-QJGYU5PG.js} +1 -1
- package/chunks/{chunk-IVUWTA2D.js → chunk-QJVZLILI.js} +1 -1
- package/chunks/{chunk-TBJ3SNS3.js → chunk-QKDNS6FU.js} +1 -1
- package/chunks/{chunk-YKADANK6.js → chunk-QQD2GART.js} +10 -3
- package/chunks/{chunk-ED7DD7MV.js → chunk-RAFQIHN2.js} +1 -1
- package/chunks/{chunk-TV7BJ7TX.js → chunk-RJUVTJEZ.js} +1 -1
- package/chunks/{chunk-RVCGAHC7.js → chunk-RM4WT2XB.js} +4 -4
- package/chunks/{chunk-6YXNJXQW.js → chunk-RN3YGDCA.js} +3 -3
- package/chunks/{chunk-SMRDCANI.js → chunk-S6H3ELPG.js} +1 -1
- package/chunks/{chunk-MBZ5ORJB.js → chunk-SI7WDR3U.js} +281 -2
- package/chunks/{chunk-5FGWVPCM.js → chunk-SRF4KTAG.js} +4 -4
- package/chunks/{chunk-LFAR7CPW.js → chunk-STCVJXQB.js} +23 -23
- package/chunks/{chunk-JDIO45X7.js → chunk-SULZPKTA.js} +1 -1
- package/chunks/{chunk-KUDI54QQ.js → chunk-SX2QIMJV.js} +5 -5
- package/chunks/{chunk-VYSZUQGU.js → chunk-TJYRTS4S.js} +2 -2
- package/chunks/{chunk-JOTYTYYW.js → chunk-TMKTOTMQ.js} +3 -3
- package/chunks/{chunk-FPMQT2YY.js → chunk-TQHPVKO6.js} +4 -4
- package/chunks/{chunk-GN422P4J.js → chunk-TSZSGQ3N.js} +1 -1
- package/chunks/{chunk-IXEZHTDR.js → chunk-U4DJ5XB3.js} +292 -38
- package/chunks/{chunk-MZ5A5PQW.js → chunk-UAKRDON5.js} +4 -4
- package/chunks/{chunk-NGKLMNWN.js → chunk-UM2FFKXN.js} +2 -2
- package/chunks/{chunk-5ICKESC3.js → chunk-UPFRILIL.js} +2 -2
- package/chunks/{chunk-RAEEQEC5.js → chunk-UUASLXHW.js} +54 -5
- package/chunks/chunk-V5U2NZNJ.js +29 -0
- package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
- package/chunks/{chunk-ZYPJ7HVZ.js → chunk-VBWD6C27.js} +1 -1
- package/chunks/{chunk-MJBHSZEJ.js → chunk-VNAYZAFX.js} +3 -3
- package/chunks/chunk-VPSIC437.js +780 -0
- package/chunks/{chunk-AAX236AR.js → chunk-VWTSRH6C.js} +52 -11
- package/chunks/{chunk-PDXYZBBQ.js → chunk-VYIUNFEA.js} +2 -2
- package/chunks/{chunk-BY24DZ4J.js → chunk-WP4AX3XD.js} +5 -7
- package/chunks/{chunk-X7C7KFWA.js → chunk-XLXAZLDR.js} +1 -1
- package/chunks/{chunk-ZQ3FKEWA.js → chunk-YPWZTR7F.js} +3 -3
- package/chunks/{chunk-IXHV5MIC.js → chunk-ZDFQGHZH.js} +1 -1
- package/chunks/chunk-ZJ2LM2SI.js +198 -0
- package/chunks/{chunk-PWR2NQBS.js → chunk-ZKFTS3OV.js} +3 -3
- package/chunks/{chunk-HMJ2P3SV.js → chunk-ZL4HFSL6.js} +91 -29
- package/chunks/{chunk-ID33ZRWH.js → chunk-ZTPGUFQV.js} +28 -6
- package/chunks/chunk-bdqvmfwv-ZTSOWAFE.js +17446 -0
- package/chunks/{config-utils-NNUPVGEC.js → config-utils-LVSYDLHZ.js} +42 -46
- package/chunks/{contextCommand-S3TPCDM5.js → contextCommand-TZD7UAJK.js} +40 -44
- package/chunks/{core-runtime-NASPCSQX.js → core-runtime-B4UKKIAQ.js} +42 -46
- package/chunks/{create-sub-session-36TNCHCP.js → create-sub-session-LUPWEUHR.js} +2 -2
- package/chunks/{create-sub-session-DS4BJLYZ.js → create-sub-session-NJ24B4US.js} +41 -44
- package/chunks/{cron-create-QXHTYUTO.js → cron-create-CRSPET3H.js} +1 -1
- package/chunks/{cron-delete-WV2BM42M.js → cron-delete-DB77SZTU.js} +1 -1
- package/chunks/{cron-list-7KVNBLZ7.js → cron-list-U2JNYWV6.js} +1 -1
- package/chunks/{daemon-UCVUHPJD.js → daemon-RKDGBFLK.js} +385 -19
- package/chunks/{daemon-git-worktree-guard-ATXVQPS3.js → daemon-git-worktree-guard-O2HPOBAB.js} +40 -44
- package/chunks/{daemon-status-provider-UI3GBTMO.js → daemon-status-provider-GRRVCJFW.js} +47 -51
- package/chunks/{daemon-trust-policy-SUCBJ2CA.js → daemon-trust-policy-YJL442BK.js} +46 -50
- package/chunks/{daemon-trust-policy-monitor-3LM5RQNS.js → daemon-trust-policy-monitor-JL7F4Y4Q.js} +46 -50
- package/chunks/{deferred-core-runtime-SCOJLVYG.js → deferred-core-runtime-S32AYVZI.js} +39 -43
- package/chunks/{devtools-JCG4K2NZ.js → devtools-VDRJYPZF.js} +1 -1
- package/chunks/{discovery-X2NV535U.js → discovery-TUM3ZQ6U.js} +2 -2
- package/chunks/{display-image-Z4VBQDEJ.js → display-image-73C7XNRK.js} +3 -3
- package/chunks/{dist-7WDZYMWV.js → dist-62OZ7QXB.js} +2 -2
- package/chunks/{dist-FLJLHASF.js → dist-EDHQIBYD.js} +7 -7
- package/chunks/{dist-S3BKCTWF.js → dist-GT64AAUR.js} +1 -1
- package/chunks/{dist-GPSRNVVP.js → dist-JVXT4VUJ.js} +2 -2
- package/chunks/{dist-LY66XNUL.js → dist-L6URO6CK.js} +3 -3
- package/chunks/{dist-5423MG3D.js → dist-LXFYIJNG.js} +734 -128
- package/chunks/{dist-SDKHGH5O.js → dist-PDGNRVPY.js} +4 -4
- package/chunks/{dist-WAUO5OMN.js → dist-QAF5DO3Y.js} +363 -73
- package/chunks/{dist-WIVVPE7M.js → dist-ZCJLKQSP.js} +1 -1
- package/chunks/{earlyInputCapture-INWJ2STR.js → earlyInputCapture-BBPCIVZG.js} +38 -42
- package/chunks/{edit-B7ZRRGAE.js → edit-SUGXY63Y.js} +26 -30
- package/chunks/{en-E4AYTX6H.js → en-2RATMNX7.js} +2 -0
- package/chunks/{enter-worktree-SPZHEETQ.js → enter-worktree-B6USKSIK.js} +5 -5
- package/chunks/{enterPlanMode-S554IKJ2.js → enterPlanMode-MDX4RVVL.js} +26 -30
- package/chunks/{environment-25ADH4Y6.js → environment-VN6RXDVN.js} +41 -45
- package/chunks/{errors-G2I6LFTW.js → errors-UEY36PIT.js} +40 -44
- package/chunks/{exit-worktree-AWUXAMAM.js → exit-worktree-DLQ73SJH.js} +8 -6
- package/chunks/{exitPlanMode-ZFH4OYPM.js → exitPlanMode-EPHIEDAA.js} +26 -30
- package/chunks/{fast-path-WZHVZ2ER.js → fast-path-Y73R42LV.js} +3 -3
- package/chunks/{fast-path-settings-NILM6QZL.js → fast-path-settings-MFUR3IWK.js} +3 -3
- package/chunks/{glob-UOVDMBUP.js → glob-DMGH7EZN.js} +27 -31
- package/chunks/goal-tools-3RF3PXCL.js +99 -0
- package/chunks/{grep-LHYJ5V2N.js → grep-AJVLCVXC.js} +2 -2
- package/chunks/{handleAutoUpdate-4MZ45DZY.js → handleAutoUpdate-HVWQT2AU.js} +42 -46
- package/chunks/{i18n-KWUEI4DS.js → i18n-5OR7NTRZ.js} +39 -43
- package/chunks/{image-gen-YZDVO5YS.js → image-gen-VOIDOHOB.js} +1 -1
- package/chunks/{initializer-2NBROGMG.js → initializer-JE5RQSOE.js} +46 -50
- package/chunks/{installationInfo-YKUSY3ZB.js → installationInfo-KO3CCSCK.js} +38 -42
- package/chunks/{list-W2WV3COM.js → list-3IORSFIY.js} +49 -53
- package/chunks/{list-agents-PMVMHNY7.js → list-agents-SBMONIUK.js} +3 -3
- package/chunks/{llm-NPPHLIJI.js → llm-K26SUDVK.js} +155 -99
- package/chunks/{llm-content-generator-YK3WN6XW.js → llm-content-generator-TT6EAUD4.js} +5 -6
- package/chunks/{loadedSettingsAdapter-2P7DFWUR.js → loadedSettingsAdapter-KLLFZF3M.js} +46 -50
- package/chunks/{loggingContentGenerator-QYYYGU6V.js → loggingContentGenerator-EYQBA4M4.js} +43 -47
- package/chunks/{loop-wakeup-EBM4F5MZ.js → loop-wakeup-QA6SHCZT.js} +2 -2
- package/chunks/{ls-F6TRX3DD.js → ls-HEJNCEYO.js} +1 -1
- package/chunks/{lsp-QYTOS2FI.js → lsp-WOQKNZP6.js} +1 -1
- package/chunks/{managed-npm-update-UMC4NBWW.js → managed-npm-update-HIJTODQT.js} +38 -42
- package/chunks/{mcp-OFI6XDP2.js → mcp-A2UEHETW.js} +46 -50
- package/chunks/{monitor-QX3BM3JY.js → monitor-DKNZQAB2.js} +28 -32
- package/chunks/{node-QKLNSZMX.js → node-UETAYMMO.js} +3 -3
- package/chunks/{nonInteractiveCli-NVRMD5MN.js → nonInteractiveCli-YA47F2F4.js} +86 -89
- package/chunks/{notebook-edit-AAILDPSV.js → notebook-edit-MGHTRL2D.js} +26 -30
- package/chunks/{openaiContentGenerator-53PB3CMN.js → openaiContentGenerator-ZJIEQ3ZJ.js} +15 -17
- package/chunks/{pidfile-5ACKG2LI.js → pidfile-ETHAZNMY.js} +38 -42
- package/chunks/{processUtils-2BCDO3DZ.js → processUtils-UY3SAJJZ.js} +2 -2
- package/chunks/{prompt-terminal-ledger-3RKW73A2.js → prompt-terminal-ledger-GZ747VYE.js} +39 -43
- package/chunks/{qwenContentGenerator-N4LLWDPH.js → qwenContentGenerator-VI4KATRY.js} +39 -43
- package/chunks/{read-file-DPAKXHYE.js → read-file-P7F4P7LV.js} +6 -8
- package/chunks/{read-mcp-resource-R4NO75DW.js → read-mcp-resource-GLAGB6R7.js} +1 -1
- package/chunks/{record-artifact-2EAYLAL5.js → record-artifact-SWVR7NSU.js} +3 -3
- package/chunks/renderer-selection-M4UN63VJ.js +99 -0
- package/chunks/{report-findings-Y4MSHDS3.js → report-findings-AL5YW3KI.js} +4 -4
- package/chunks/{request-shutdown-DWRMGTMB.js → request-shutdown-5YK4IZ54.js} +5 -5
- package/chunks/{resumeHistoryUtils-3JQORXAK.js → resumeHistoryUtils-DPZKFW24.js} +44 -48
- package/chunks/{ripGrep-AHF5QCI7.js → ripGrep-C7LJKUPZ.js} +9 -11
- package/chunks/{run-qwen-serve-3LKV7KDC.js → run-qwen-serve-OGTEEUR2.js} +132 -81
- package/chunks/{runtime-66F4W3IA.js → runtime-LNBLEMZS.js} +51 -55
- package/chunks/{scheduled-tasks-2NVKS5Q2.js → scheduled-tasks-FLDYZQOF.js} +44 -48
- package/chunks/{scheduler-JNV7T3ZO.js → scheduler-73YXGUGW.js} +40 -44
- package/chunks/{sdk-exporters-grpc-G5IT4XS4.js → sdk-exporters-grpc-MXTVSE3C.js} +2 -2
- package/chunks/{sdk-exporters-http-MFIWD23D.js → sdk-exporters-http-3JO5TJNU.js} +3 -3
- package/chunks/{sdk-impl-2RXJ4Q6X.js → sdk-impl-HZAUUTHJ.js} +5 -5
- package/chunks/{send-message-WPZRCJOB.js → send-message-JC7NJTY6.js} +7 -7
- package/chunks/{serve-GP2UNRP7.js → serve-3UR2H4CV.js} +46 -50
- package/chunks/{server-7W6C3SOW.js → server-AOYZVVOM.js} +1736 -502
- package/chunks/{session-PZLBAQGG.js → session-UAWFNFGI.js} +90 -93
- package/chunks/session-attachments-root-ZCGXQQTR.js +104 -0
- package/chunks/{session-pr-refresh-OIVL3U3Z.js → session-pr-refresh-CT2INROL.js} +131 -65
- package/chunks/{settings-ZOHIQWYK.js → settings-BHRGDASJ.js} +45 -49
- package/chunks/{shell-FWZT6IUR.js → shell-YHOGC7TO.js} +26 -30
- package/chunks/{skill-RTQC2YGA.js → skill-ZGBKNCHQ.js} +71 -49
- package/chunks/{skill-settings-AKMIXFSJ.js → skill-settings-AKSP665O.js} +45 -49
- package/chunks/{spawnChannel-ZP23JL6O.js → spawnChannel-N25MBB6F.js} +40 -44
- package/chunks/{standalone-update-P2Q5H4ZU.js → standalone-update-XGPWJDRN.js} +40 -44
- package/chunks/start-opentui-ui-FZ4USOU7.js +55342 -0
- package/chunks/{startInteractiveUI-NSA6QPQZ.js → startInteractiveUI-E2WQJUOA.js} +2920 -4542
- package/chunks/{syntheticOutput-5URSQLIS.js → syntheticOutput-HJNZSEHN.js} +2 -2
- package/chunks/{task-create-3EXVDG3G.js → task-create-6RSD54S5.js} +7 -7
- package/chunks/{task-list-PIBYNSE7.js → task-list-IQSACPOM.js} +31 -7
- package/chunks/{task-stop-IV3BYWJC.js → task-stop-HE2LRQNW.js} +1 -1
- package/chunks/{task-update-H5BPDS5Y.js → task-update-XAJ2NYOA.js} +7 -7
- package/chunks/{team-create-53T42W37.js → team-create-SOKMYSQU.js} +28 -32
- package/chunks/{team-delete-X3WPELS6.js → team-delete-NGNNKGMG.js} +1 -1
- package/chunks/{team-plan-approval-D45ZC5OE.js → team-plan-approval-U7ZWXYAY.js} +26 -30
- package/chunks/{terminal-image-renderer-FCRUWT6C.js → terminal-image-renderer-KKM4OBLO.js} +40 -44
- package/chunks/{theme-manager-MHNPEDP7.js → theme-manager-GQHF3A7T.js} +38 -42
- package/chunks/{todoWrite-A5IOZZ3P.js → todoWrite-5UTVUXHA.js} +36 -6
- package/chunks/{tool-search-6RPBGGUX.js → tool-search-IAI2RVWT.js} +10 -12
- package/chunks/{total-session-admission-MGV56XDK.js → total-session-admission-G4CGCSTG.js} +43 -47
- package/chunks/{trustedFolders-QJYEFMTU.js → trustedFolders-D2I3FDPB.js} +39 -43
- package/chunks/{update-relaunch-ZDMQX63C.js → update-relaunch-5RWKZAL3.js} +5 -5
- package/chunks/{updateCheck-4QZWCGP6.js → updateCheck-ZXOQDFEI.js} +42 -46
- package/chunks/{useAutoAcceptIndicator-DLIQN256.js → useAutoAcceptIndicator-6EK4QGAH.js} +49 -53
- package/chunks/{validateNonInterActiveAuth-HGTG7AEK.js → validateNonInterActiveAuth-QPFEKATS.js} +82 -86
- package/chunks/{version-CPAZMC4B.js → version-JKNG7YDH.js} +1 -1
- package/chunks/{web-fetch-N4K5M3M4.js → web-fetch-X3AHIIHW.js} +8 -11
- package/chunks/{web-search-4VZKM5SF.js → web-search-K2FMOGS5.js} +6 -7
- package/chunks/{web-shell-static-PW7OEDQO.js → web-shell-static-POZHGGXE.js} +4 -4
- package/chunks/{workflow-2ALQKTHG.js → workflow-TOLPAK5G.js} +38 -38
- package/chunks/{workspace-providers-status-5JM4CB6R.js → workspace-providers-status-PCJK3RC7.js} +50 -54
- package/chunks/{workspace-registration-store-RNMFVCH7.js → workspace-registration-store-KQWVVW4Y.js} +1 -1
- package/chunks/{workspace-registry-6EULAPZC.js → workspace-registry-YNIOB6HJ.js} +43 -47
- package/chunks/{workspace-runtime-coordinator-IRI2DRCJ.js → workspace-runtime-coordinator-WG2RNEN7.js} +43 -47
- package/chunks/{workspace-service-SETHN4WE.js → workspace-service-G4ZNBOFH.js} +51 -55
- package/chunks/{workspace-skills-status-4D4EUEQU.js → workspace-skills-status-FMTPPMWC.js} +47 -51
- package/chunks/{workspace-trust-reconciler-4LR3CDL4.js → workspace-trust-reconciler-IBDFQBQS.js} +53 -57
- package/chunks/wrapper-JH3IFHT2.js +35 -0
- package/chunks/{write-file-45GWPSOI.js → write-file-YTLFY2S5.js} +28 -32
- package/chunks/{zh-2BQ7P6OD.js → zh-25DF7OGK.js} +2 -0
- package/chunks/{zh-TW-UFXRZTXX.js → zh-TW-5EDMZVGK.js} +2 -0
- package/chunks/{zoom-image-K6IQUKRC.js → zoom-image-IFXSN74N.js} +6 -8
- package/cli.js +17 -13
- package/locales/en.js +3 -0
- package/locales/zh-TW.js +3 -0
- package/locales/zh.js +3 -0
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-C80OZcPP.js → abnfDiagram-VCTEODGH-Cxf7xE_Z.js} +1 -1
- package/web-shell/assets/{arc-AUqStYgf.js → arc-ESi1eNkE.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-CQYOdYla.js → architectureDiagram-5GKGNRK7-D9l7-bDo.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-lYKlFysy.js → blockDiagram-NRAW4CY4-Bc8DEasw.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BoS23iIp.js → c4Diagram-UCG6FXSJ-Dimb2Hmh.js} +1 -1
- package/web-shell/assets/channel-B7ohGDil.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-DLLooL1E.js → chunk-2Q5K7J3B-jVDmOpAQ.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-kPfJxScY.js → chunk-5VM5RSS4-DbG_SwdB.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-CVGFBqkD.js → chunk-F27PBJKO-QEc4cY1v.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-CnM_kOVV.js → chunk-G27WJ6UU-iJ36lQ3X.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-Cj-ajOkT.js → chunk-JWPE2WC7-DuArnVtF.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-8L5c-wFo.js → chunk-LCL6LL3I-DxOf1zwL.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-DsXTxpvL.js → chunk-POPQ4Y6H-lVLu9Ild.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DU5GE1_z.js → chunk-SVP7TREG-C6XYlIer.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-D2IIWZKt.js → chunk-XXDRQBXY-CiG2j2Ji.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DdFpqpfD.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DdFpqpfD.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-CF_txUJr.js → cose-bilkent-JH36ORCC-DGVHMMVm.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-DEZ-My-Z.js → cynefin-OW5HDTMX-D6cgpCnH.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BV7EKUS6.js → cynefinDiagram-5FMLGOSQ-BKv4Z-UX.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-JGIX0G4H.js → dagre-3AP2YEHR-B4ABMIG-.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-DdUY7q6A.js → diagram-S7CK7UJ4-DgCkp_Lm.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-fhzRZ19v.js → diagram-UQ7AKVKN-FG0FNokz.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-BOgOex6q.js → diagram-VSXAHHWV-JgkP9qg-.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-C0NknIz6.js → diagram-VX7I27RA-ADh2x83l.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-C__3mUBX.js → diagram-Z3DM3KII-yXqoYF1J.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-BvPhqycH.js → ebnfDiagram-PWID7BFC-Duk83Ek_.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-BqzoNoL9.js → erDiagram-SSCWMZ5O-DMdvxySG.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-CJKOre47.js → flowDiagram-A5DVABFB-DHjVgSji.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-C5xZjrp0.js → ganttDiagram-EL5Y4UJY-DMM9DkCE.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-C0EjwuPK.js → gitGraphDiagram-WWUBYQGX-t_ug9vO8.js} +1 -1
- package/web-shell/assets/index-BGZRqbRo.css +36 -0
- package/web-shell/assets/index-DRri_6_x.js +2067 -0
- package/web-shell/assets/{index-C5M93syE.js → index-zqvnpGHv.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-BUwzsYOs.js → infoDiagram-RXCK75RN-eT1fANNm.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-EDJ_DH3V.js → ishikawaDiagram-5VMMS53U-k3evzZNn.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-BnfcOsS0.js → journeyDiagram-EYS64GPL-CGim3EAi.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-D_ofTVGu.js → kanban-definition-3QL26DDD-WHfJo-22.js} +1 -1
- package/web-shell/assets/{layout-CBuQFdfZ.js → layout-DkqIaFlJ.js} +1 -1
- package/web-shell/assets/{linear-DRIHtmGv.js → linear-Bdkd3mCz.js} +1 -1
- package/web-shell/assets/{mermaid.core-CmR5wZH6.js → mermaid.core-CGw0LkT_.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-BV374olC.js → mindmap-definition-FBJOCRG2-C9V4rBvo.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-Bpy1SplK.js → pegDiagram-XKGWAZYB-CwoI2T5G.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-CeZx4hR2.js → pieDiagram-E7YTZNPT-DaTmBmPG.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-COYKs14h.js → quadrantDiagram-AXDQQJYC-plh6MyGI.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-5g2pOeTs.js → railroadDiagram-O6MQD6OU-D_b-S0iK.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-Yn8uPGtF.js → requirementDiagram-EFPCY7ZU-zUzTN7VE.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CTayAGq6.js → sankeyDiagram-P5KCCOFB-m6AhoD0l.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-BFWDKzUU.js → sequenceDiagram-WJ2MYXX4-Cwhzsine.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-CtErUbj4.js → sizeCapture-X5ZJPWSS-CcZuKIae.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-Co3HFzOd.js → stateDiagram-HBIQ2CUA-CFoiJwD_.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V--H8HdEmk.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-CDZuxzOj.js → swimlanes-XN3QIQJK-CgS9hcaV.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ShE9OIgf.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-UcNHj8At.js → timeline-definition-24CTP7MA-Dzzc05t9.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-JKR9pVFG.js → vennDiagram-4TSXK5OY-DemK0f7Y.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-C4SU-yIW.js → wardleyDiagram-VM6X3IG4-CquLxtMr.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-D_yoWGZ4.js → xychartDiagram-S5SC5T6Z-BTBKTM5g.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-4P7PPAHN.js +0 -3097
- package/chunks/chunk-7J6OTNGO.js +0 -424
- package/chunks/chunk-LMMHS3RS.js +0 -135
- package/chunks/chunk-MZYWNU66.js +0 -149
- package/chunks/chunk-T4EFG2P5.js +0 -113
- package/chunks/chunk-XZA32HII.js +0 -19
- package/chunks/goal-tools-7TNK5ZHC.js +0 -411
- package/web-shell/assets/channel-B0ovOJeK.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DMll2-6_.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DMll2-6_.js +0 -1
- package/web-shell/assets/index-B_IPzA0h.js +0 -2020
- package/web-shell/assets/index-D1OKGQlM.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C3gdRjPm.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-C34TGCPZ.js +0 -8
- /package/chunks/{chunk-FOGQO4FG.js → chunk-JA5CBKRP.js} +0 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
deriveWebSocketBase,
|
|
5
|
+
openQwenAsrRealtimeStream,
|
|
6
|
+
openVoiceStream,
|
|
7
|
+
openVoiceStreamWithRetry
|
|
8
|
+
} from "./chunk-XLXAZLDR.js";
|
|
3
9
|
import {
|
|
4
10
|
GENERATION_MAX_PROMPT_BYTES,
|
|
5
11
|
MAX_REMEMBER_CONTENT_BYTES,
|
|
@@ -14,13 +20,7 @@ import {
|
|
|
14
20
|
shouldSuppressRememberErrorDetails,
|
|
15
21
|
workspaceMemoryFailureCode,
|
|
16
22
|
workspaceMemoryFailureDiagnostics
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
deriveWebSocketBase,
|
|
20
|
-
openQwenAsrRealtimeStream,
|
|
21
|
-
openVoiceStream,
|
|
22
|
-
openVoiceStreamWithRetry
|
|
23
|
-
} from "./chunk-X7C7KFWA.js";
|
|
23
|
+
} from "./chunk-WP4AX3XD.js";
|
|
24
24
|
import {
|
|
25
25
|
SetupGithubError,
|
|
26
26
|
collectSessionData,
|
|
@@ -32,15 +32,15 @@ import {
|
|
|
32
32
|
toJson,
|
|
33
33
|
toJsonl,
|
|
34
34
|
toMarkdown
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QI27MKNQ.js";
|
|
36
36
|
import {
|
|
37
37
|
OBSERVED_CONTACT_MAX_FRESH_WITHIN_SECONDS,
|
|
38
38
|
ObservedChannelContactStore
|
|
39
39
|
} from "./chunk-XEAAO654.js";
|
|
40
|
+
import "./chunk-NRL5CUZT.js";
|
|
40
41
|
import {
|
|
41
42
|
escapeAnsiCtrlCodes
|
|
42
43
|
} from "./chunk-47ECGEJC.js";
|
|
43
|
-
import "./chunk-OQYXJK2V.js";
|
|
44
44
|
import "./chunk-2MIN6GRR.js";
|
|
45
45
|
import "./chunk-QHTIBUWB.js";
|
|
46
46
|
import "./chunk-TXASDT2M.js";
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
ConversationRuntimeOwnershipError,
|
|
57
57
|
CredentialStore,
|
|
58
58
|
DeviceFlowRegistry,
|
|
59
|
+
LocalPathOpenUnavailableError,
|
|
59
60
|
MAX_CONCURRENT_VOICE_SESSIONS,
|
|
60
61
|
MutableOriginAllowlist,
|
|
61
62
|
NativeDirectoryPickerUnavailableError,
|
|
@@ -91,11 +92,15 @@ import {
|
|
|
91
92
|
installServeAppLifecycle,
|
|
92
93
|
isBrowserAutomationMcpAvailable,
|
|
93
94
|
isDeepHealthQuery,
|
|
95
|
+
isLocalPathOpenAvailable,
|
|
96
|
+
isLocalTerminalAvailable,
|
|
94
97
|
isNativeDirectoryPickerAvailable,
|
|
95
98
|
isScratchRootCompatible,
|
|
96
99
|
isTrustedLoopbackMode,
|
|
97
100
|
listenerIdentityOf,
|
|
98
101
|
listenerIdentityOfSocket,
|
|
102
|
+
openPathLocally,
|
|
103
|
+
openTerminalLocally,
|
|
99
104
|
parseAllowOriginPatterns,
|
|
100
105
|
parseDaemonStatusDetail,
|
|
101
106
|
pickNativeDirectory,
|
|
@@ -108,7 +113,7 @@ import {
|
|
|
108
113
|
singleTokenCredentials,
|
|
109
114
|
tagListener,
|
|
110
115
|
unsafeRevealSecret
|
|
111
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-SI7WDR3U.js";
|
|
112
117
|
import "./chunk-VGHZT6JR.js";
|
|
113
118
|
import {
|
|
114
119
|
ConversationDirectoryIdentityError,
|
|
@@ -119,7 +124,9 @@ import {
|
|
|
119
124
|
} from "./chunk-PB7JBAHF.js";
|
|
120
125
|
import "./chunk-UXEO7E3V.js";
|
|
121
126
|
import {
|
|
122
|
-
|
|
127
|
+
assertValidChannelSecretUpdates
|
|
128
|
+
} from "./chunk-7RB56BRJ.js";
|
|
129
|
+
import {
|
|
123
130
|
AONE_MAX_MR_VIEW_CALLS_PER_RUN,
|
|
124
131
|
DaemonDrainingError,
|
|
125
132
|
InvalidCursorError,
|
|
@@ -144,8 +151,9 @@ import {
|
|
|
144
151
|
resolveAoneWorkspaceRepo,
|
|
145
152
|
resolveSessionIdForRestore,
|
|
146
153
|
runWithWorkspaceRuntimeStorage,
|
|
154
|
+
searchWorkspaceSessionsForResponse,
|
|
147
155
|
unarchiveDaemonSessions
|
|
148
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-EVFDRBUM.js";
|
|
149
157
|
import {
|
|
150
158
|
LIVE_SESSION_SOURCE_PREFIX,
|
|
151
159
|
isCompatibleLiveSessionSource,
|
|
@@ -181,16 +189,23 @@ import {
|
|
|
181
189
|
STANDALONE_SESSION_SOURCE_TYPE,
|
|
182
190
|
isReservedStandaloneSessionSourceType
|
|
183
191
|
} from "./chunk-N4QWUPDM.js";
|
|
192
|
+
import {
|
|
193
|
+
evaluateDaemonWorkspaceTrust,
|
|
194
|
+
readDaemonTrustPolicySnapshot
|
|
195
|
+
} from "./chunk-YPWZTR7F.js";
|
|
184
196
|
import {
|
|
185
197
|
readRecentPromptTerminals,
|
|
186
198
|
reconcileDanglingPromptTerminals,
|
|
187
199
|
withPromptTerminals
|
|
188
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-UPFRILIL.js";
|
|
189
201
|
import {
|
|
190
202
|
WorkspaceGenerationClosedError,
|
|
191
203
|
createSingleWorkspaceRegistry,
|
|
192
204
|
createWorkspaceSessionOwnerIndex
|
|
193
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-QJVZLILI.js";
|
|
206
|
+
import {
|
|
207
|
+
sessionAttachmentsRoots
|
|
208
|
+
} from "./chunk-NUHOLAQ6.js";
|
|
194
209
|
import {
|
|
195
210
|
getWorkspaceRouteContext,
|
|
196
211
|
isGenerationClosedError,
|
|
@@ -213,11 +228,11 @@ import {
|
|
|
213
228
|
sendUntrustedWorkspaceResponse,
|
|
214
229
|
sendWorkspaceRuntimeUnavailable,
|
|
215
230
|
setWorkspaceRouteContext
|
|
216
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-3L724BJ5.js";
|
|
217
232
|
import {
|
|
218
233
|
normalizeChannelDelivery,
|
|
219
234
|
parseChannelDelivery
|
|
220
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-DTVQSSNM.js";
|
|
221
236
|
import {
|
|
222
237
|
isValidSessionId,
|
|
223
238
|
normalizeSessionIdForLookup,
|
|
@@ -229,9 +244,10 @@ import {
|
|
|
229
244
|
import {
|
|
230
245
|
WorkspaceRuntimeInitializationError,
|
|
231
246
|
WorkspaceRuntimeStillStartingError,
|
|
247
|
+
getWorkspaceRuntimeCoordinator,
|
|
232
248
|
getWorkspaceRuntimeCoordinatorIfSupported,
|
|
233
249
|
supportsWorkspaceRuntimeLifecycle
|
|
234
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-P6UIF2OW.js";
|
|
235
251
|
import {
|
|
236
252
|
EMPTY_WORKSPACE_VOICE_UPDATE_ERROR,
|
|
237
253
|
MAX_WORKSPACE_SKILL_NAME_LENGTH,
|
|
@@ -245,14 +261,14 @@ import {
|
|
|
245
261
|
validateWorkspaceSkillName,
|
|
246
262
|
validateWorkspaceVoiceState,
|
|
247
263
|
voiceSettingsScopeToWire
|
|
248
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-4M24B5J5.js";
|
|
249
265
|
import {
|
|
250
266
|
PermissionRulesValidationError,
|
|
251
267
|
buildPermissionSettings,
|
|
252
268
|
isPermissionRuleType,
|
|
253
269
|
normalizePermissionRules,
|
|
254
270
|
readPermissionRuleSet
|
|
255
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-I5N4EAS6.js";
|
|
256
272
|
import {
|
|
257
273
|
assertVoiceBaseUrlNetworkAllowed,
|
|
258
274
|
isStreamingVoiceModel,
|
|
@@ -260,37 +276,36 @@ import {
|
|
|
260
276
|
resolveVoiceTranscriptionConfig,
|
|
261
277
|
sanitizeVoiceErrorMessage,
|
|
262
278
|
transcribeVoiceAudio
|
|
263
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-LEPCWS5A.js";
|
|
264
280
|
import {
|
|
265
281
|
isVoiceEnabled,
|
|
266
282
|
isVoiceMode,
|
|
267
283
|
readVoiceModel
|
|
268
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-BA4WJC4L.js";
|
|
269
285
|
import "./chunk-QAK5475D.js";
|
|
270
286
|
import {
|
|
271
287
|
createTotalSessionAdmissionController
|
|
272
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-7IKXTGZT.js";
|
|
273
289
|
import "./chunk-OIBUG24X.js";
|
|
274
290
|
import {
|
|
275
291
|
MAX_SESSION_RESTORE_TIMEOUT_MS,
|
|
276
292
|
resolveSessionRestoreTimeoutMs,
|
|
277
293
|
restoreRetryAfterSeconds
|
|
278
294
|
} from "./chunk-4JRM2BSM.js";
|
|
279
|
-
import {
|
|
280
|
-
assertValidChannelSecretUpdates
|
|
281
|
-
} from "./chunk-YOFULAHO.js";
|
|
282
295
|
import {
|
|
283
296
|
createDaemonStatusProvider
|
|
284
|
-
} from "./chunk-
|
|
285
|
-
import "./chunk-
|
|
286
|
-
import "./chunk-
|
|
297
|
+
} from "./chunk-RM4WT2XB.js";
|
|
298
|
+
import "./chunk-RN3YGDCA.js";
|
|
299
|
+
import "./chunk-3JQZVCBI.js";
|
|
287
300
|
import "./chunk-JS73NNWF.js";
|
|
288
301
|
import {
|
|
289
302
|
SessionArtifactAuthorizationError,
|
|
290
303
|
SessionArtifactValidationError,
|
|
291
304
|
createAcpSessionBridge,
|
|
305
|
+
extractErrorCode,
|
|
306
|
+
extractErrorMessage,
|
|
292
307
|
parseSessionSource
|
|
293
|
-
} from "./chunk-
|
|
308
|
+
} from "./chunk-DSX7KQPM.js";
|
|
294
309
|
import {
|
|
295
310
|
EVENT_SCHEMA_VERSION,
|
|
296
311
|
EventBus,
|
|
@@ -298,21 +313,35 @@ import {
|
|
|
298
313
|
} from "./chunk-7U5G6JXI.js";
|
|
299
314
|
import "./chunk-WCCLLK7X.js";
|
|
300
315
|
import "./chunk-OCPBI7J5.js";
|
|
316
|
+
import {
|
|
317
|
+
createSpawnChannelFactory
|
|
318
|
+
} from "./chunk-4HVH57J3.js";
|
|
301
319
|
import {
|
|
302
320
|
createWorkspaceProvidersStatusProvider
|
|
303
|
-
} from "./chunk-
|
|
304
|
-
import
|
|
321
|
+
} from "./chunk-EBDGRBZX.js";
|
|
322
|
+
import {
|
|
323
|
+
PERSIST_REASONING_SELECTION_META_KEY,
|
|
324
|
+
REASONING_SELECTION_PERSISTED_META_KEY
|
|
325
|
+
} from "./chunk-ZJ2LM2SI.js";
|
|
305
326
|
import {
|
|
306
327
|
getAuthTypeFromEnv,
|
|
307
328
|
resolveCliGenerationConfig
|
|
308
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-6A2D4QSO.js";
|
|
309
330
|
import {
|
|
310
331
|
snapshotProcessEnv
|
|
311
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-KMU3ZHH4.js";
|
|
312
333
|
import {
|
|
313
334
|
createWorkspaceSkillsStatusProvider
|
|
314
|
-
} from "./chunk-
|
|
335
|
+
} from "./chunk-4BGDFKQE.js";
|
|
315
336
|
import "./chunk-BHTYRHJF.js";
|
|
337
|
+
import {
|
|
338
|
+
BridgeTimeoutError,
|
|
339
|
+
SERVE_CONTROL_EXT_METHODS,
|
|
340
|
+
STATUS_SCHEMA_VERSION,
|
|
341
|
+
SessionRestoreTimeoutError,
|
|
342
|
+
createIdleWorkspaceMemoryStatus,
|
|
343
|
+
mapDomainErrorToErrorKind
|
|
344
|
+
} from "./chunk-64QH2UC6.js";
|
|
316
345
|
import {
|
|
317
346
|
resolveSkillSettings
|
|
318
347
|
} from "./chunk-HWVUSYSN.js";
|
|
@@ -325,54 +354,40 @@ import {
|
|
|
325
354
|
isServeDebugMode,
|
|
326
355
|
mountWebShellAssets,
|
|
327
356
|
mountWebShellSpaFallback
|
|
328
|
-
} from "./chunk-
|
|
357
|
+
} from "./chunk-NFIDVZND.js";
|
|
329
358
|
import {
|
|
330
359
|
require_express
|
|
331
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-IRKQ4YYX.js";
|
|
332
361
|
import "./chunk-FBX2SDQ4.js";
|
|
333
362
|
import {
|
|
334
363
|
formatHostForAuthority,
|
|
335
364
|
isLoopbackBind
|
|
336
365
|
} from "./chunk-DMEUXLSS.js";
|
|
337
|
-
import {
|
|
338
|
-
evaluateDaemonWorkspaceTrust,
|
|
339
|
-
readDaemonTrustPolicySnapshot
|
|
340
|
-
} from "./chunk-ZQ3FKEWA.js";
|
|
341
366
|
import {
|
|
342
367
|
daemonObservedContactsPath,
|
|
343
368
|
loadChannelsConfig
|
|
344
|
-
} from "./chunk-
|
|
345
|
-
import "./chunk-
|
|
369
|
+
} from "./chunk-F7NF2IOE.js";
|
|
370
|
+
import "./chunk-AZJLY2XZ.js";
|
|
346
371
|
import "./chunk-57OAHC2Y.js";
|
|
347
372
|
import {
|
|
348
373
|
parseChannelWebhookConfigLenient
|
|
349
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-PCRBLMIN.js";
|
|
350
375
|
import {
|
|
351
376
|
supportedChannelCatalog
|
|
352
|
-
} from "./chunk-
|
|
353
|
-
import "./chunk-
|
|
377
|
+
} from "./chunk-NXKOVOM5.js";
|
|
378
|
+
import "./chunk-TSZSGQ3N.js";
|
|
354
379
|
import "./chunk-V6WHFGST.js";
|
|
355
380
|
import {
|
|
356
381
|
getStableLiveDiscoveryBaseDir
|
|
357
|
-
} from "./chunk-
|
|
382
|
+
} from "./chunk-OHOO527W.js";
|
|
358
383
|
import {
|
|
359
384
|
LIVE_HOST_BUNDLE_ID,
|
|
360
385
|
LIVE_HOST_PROTOCOL_VERSION,
|
|
361
386
|
LIVE_INPUT_AUDIO_EPOCH_BYTES
|
|
362
|
-
} from "./chunk-
|
|
363
|
-
import
|
|
364
|
-
createSpawnChannelFactory
|
|
365
|
-
} from "./chunk-JMRE4WJQ.js";
|
|
366
|
-
import {
|
|
367
|
-
BridgeTimeoutError,
|
|
368
|
-
STATUS_SCHEMA_VERSION,
|
|
369
|
-
SessionRestoreTimeoutError,
|
|
370
|
-
createIdleWorkspaceMemoryStatus,
|
|
371
|
-
mapDomainErrorToErrorKind
|
|
372
|
-
} from "./chunk-J4Y3QJHF.js";
|
|
387
|
+
} from "./chunk-IQAFKVXS.js";
|
|
388
|
+
import "./chunk-ZL4HFSL6.js";
|
|
373
389
|
import "./chunk-K6KS3LTN.js";
|
|
374
|
-
import "./chunk-
|
|
375
|
-
import "./chunk-7E7UCJHS.js";
|
|
390
|
+
import "./chunk-OSHQMOBS.js";
|
|
376
391
|
import {
|
|
377
392
|
MAX_REGISTERED_WORKSPACES,
|
|
378
393
|
WorkspaceDisplayNameValidationError,
|
|
@@ -380,7 +395,7 @@ import {
|
|
|
380
395
|
WorkspaceRegistrationStoreLimitError,
|
|
381
396
|
normalizeWorkspaceDisplayName,
|
|
382
397
|
workspaceRegistrationId
|
|
383
|
-
} from "./chunk-
|
|
398
|
+
} from "./chunk-BJXCYUGM.js";
|
|
384
399
|
import {
|
|
385
400
|
CHANNEL_PROMPT_META_KEY,
|
|
386
401
|
DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
|
|
@@ -397,6 +412,7 @@ import {
|
|
|
397
412
|
InvalidRewindTargetError,
|
|
398
413
|
InvalidSessionMetadataError,
|
|
399
414
|
InvalidSessionScopeError,
|
|
415
|
+
McpAuthenticationInProgressError,
|
|
400
416
|
McpServerNotFoundError,
|
|
401
417
|
McpServerRestartFailedError,
|
|
402
418
|
PermissionForbiddenError,
|
|
@@ -421,7 +437,7 @@ import {
|
|
|
421
437
|
WorkspaceInitRaceError,
|
|
422
438
|
WorkspaceInitSymlinkError,
|
|
423
439
|
WorkspaceMismatchError
|
|
424
|
-
} from "./chunk-
|
|
440
|
+
} from "./chunk-F47DITLZ.js";
|
|
425
441
|
import {
|
|
426
442
|
MAX_WORKSPACE_PATH_LENGTH,
|
|
427
443
|
canonicalizeWorkspace,
|
|
@@ -444,7 +460,7 @@ import {
|
|
|
444
460
|
} from "./chunk-GYTKQYDB.js";
|
|
445
461
|
import {
|
|
446
462
|
normalizeWorkerDiagnostic
|
|
447
|
-
} from "./chunk-
|
|
463
|
+
} from "./chunk-M4KFODIP.js";
|
|
448
464
|
import {
|
|
449
465
|
normalizeServeChannelSelection
|
|
450
466
|
} from "./chunk-ALMR3E6Q.js";
|
|
@@ -457,11 +473,11 @@ import "./chunk-3VUENPWF.js";
|
|
|
457
473
|
import {
|
|
458
474
|
redactLogCredentials
|
|
459
475
|
} from "./chunk-M5GB774H.js";
|
|
460
|
-
import "./chunk-5HBA2Z7V.js";
|
|
461
476
|
import {
|
|
462
477
|
sanitizeLogText
|
|
463
|
-
} from "./chunk-
|
|
478
|
+
} from "./chunk-U4DJ5XB3.js";
|
|
464
479
|
import "./chunk-IW6RQPQB.js";
|
|
480
|
+
import "./chunk-5HBA2Z7V.js";
|
|
465
481
|
import {
|
|
466
482
|
WORKSPACE_RESTRICTED_SETTING_KEYS,
|
|
467
483
|
getDialogSettingKeys,
|
|
@@ -471,27 +487,31 @@ import {
|
|
|
471
487
|
getSettingDefinition,
|
|
472
488
|
getWritableScopes,
|
|
473
489
|
loadSettings,
|
|
490
|
+
resolveOutputLanguageOrPreserveAuto,
|
|
491
|
+
updateOutputLanguageFile,
|
|
474
492
|
validateSettingValue
|
|
475
|
-
} from "./chunk-
|
|
476
|
-
import "./chunk-
|
|
493
|
+
} from "./chunk-VWTSRH6C.js";
|
|
494
|
+
import "./chunk-NQ4L2CMD.js";
|
|
477
495
|
import "./chunk-RKUWKYED.js";
|
|
478
|
-
import "./chunk-
|
|
496
|
+
import "./chunk-O5CD7T4T.js";
|
|
479
497
|
import "./chunk-IDS7MSUP.js";
|
|
480
498
|
import {
|
|
481
499
|
detectSystemLanguage,
|
|
482
|
-
|
|
483
|
-
|
|
500
|
+
getCurrentLanguage,
|
|
501
|
+
resolveLanguageSetting,
|
|
502
|
+
setLanguageAsync
|
|
503
|
+
} from "./chunk-I4NRYS6A.js";
|
|
484
504
|
import {
|
|
485
505
|
SUPPORTED_LANGUAGES,
|
|
486
506
|
resolveSupportedLanguage
|
|
487
507
|
} from "./chunk-5EJZE3FP.js";
|
|
488
|
-
import "./chunk-
|
|
489
|
-
import "./chunk-
|
|
490
|
-
import "./chunk-
|
|
508
|
+
import "./chunk-C4TIXFDZ.js";
|
|
509
|
+
import "./chunk-2M3EWQNG.js";
|
|
510
|
+
import "./chunk-VBWD6C27.js";
|
|
491
511
|
import "./chunk-W3N5XAZ6.js";
|
|
492
512
|
import {
|
|
493
513
|
getWorkspaceTrustStatus
|
|
494
|
-
} from "./chunk-
|
|
514
|
+
} from "./chunk-65HWLGA7.js";
|
|
495
515
|
import "./chunk-NPQ5ZKRP.js";
|
|
496
516
|
import {
|
|
497
517
|
isWithinRoot as isWithinRoot2
|
|
@@ -500,45 +520,30 @@ import {
|
|
|
500
520
|
ALL_PROVIDERS,
|
|
501
521
|
BTW_MAX_INPUT_LENGTH,
|
|
502
522
|
ClientMcpRegistrar,
|
|
503
|
-
GITHUB_PR_ERROR_MESSAGE_MAX,
|
|
504
523
|
IMAGE_CAPABILITY,
|
|
505
524
|
WebTerminalRegistry,
|
|
506
525
|
WorkspaceMemoryFileTooLargeError,
|
|
507
526
|
WorkspaceMemoryWriteTimeoutError,
|
|
508
527
|
buildUsageDashboard,
|
|
509
|
-
createGitHubPullRequest,
|
|
510
|
-
fetchGitBranches,
|
|
511
|
-
fetchGitHubPullRequests,
|
|
512
|
-
getDefaultBranch,
|
|
513
|
-
gitCheckout,
|
|
514
|
-
gitCommit,
|
|
515
|
-
gitCreateBranch,
|
|
516
|
-
gitEnv,
|
|
517
|
-
gitPull,
|
|
518
|
-
gitPush,
|
|
519
|
-
isValidCheckoutRef,
|
|
520
|
-
isValidRefName,
|
|
521
528
|
loadIgnoreRules,
|
|
522
|
-
resolveBranchName,
|
|
523
529
|
shouldShowStep,
|
|
524
|
-
watchRepoBranch,
|
|
525
530
|
writeWorkspaceContextFile
|
|
526
|
-
} from "./chunk-
|
|
527
|
-
import "./chunk-
|
|
528
|
-
import "./chunk-
|
|
531
|
+
} from "./chunk-JUARRUMA.js";
|
|
532
|
+
import "./chunk-I2TMJPCV.js";
|
|
533
|
+
import "./chunk-JR42V4UY.js";
|
|
529
534
|
import "./chunk-LJZSMWOH.js";
|
|
530
|
-
import "./chunk-6NWPR2EB.js";
|
|
531
|
-
import "./chunk-GCUR24KK.js";
|
|
532
|
-
import "./chunk-W4BDHLRT.js";
|
|
533
535
|
import {
|
|
534
536
|
readWorktreeSession,
|
|
535
537
|
writeWorktreeSession
|
|
536
|
-
} from "./chunk-
|
|
537
|
-
import "./chunk-
|
|
538
|
-
import "./chunk-
|
|
538
|
+
} from "./chunk-RAFQIHN2.js";
|
|
539
|
+
import "./chunk-L26ONV2Y.js";
|
|
540
|
+
import "./chunk-47RYEQW5.js";
|
|
541
|
+
import "./chunk-IG4W5SJR.js";
|
|
542
|
+
import "./chunk-ZPJWUGCS.js";
|
|
543
|
+
import "./chunk-4UANMABT.js";
|
|
544
|
+
import "./chunk-ZKFTS3OV.js";
|
|
539
545
|
import "./chunk-ENYUKMFK.js";
|
|
540
546
|
import "./chunk-UKYXYWI2.js";
|
|
541
|
-
import "./chunk-ZPJWUGCS.js";
|
|
542
547
|
import {
|
|
543
548
|
QwenOAuth2Client,
|
|
544
549
|
QwenOAuthPollError,
|
|
@@ -548,14 +553,17 @@ import {
|
|
|
548
553
|
isDeviceTokenPending,
|
|
549
554
|
isDeviceTokenSuccess
|
|
550
555
|
} from "./chunk-3AKCBZVW.js";
|
|
551
|
-
import "./chunk-
|
|
556
|
+
import "./chunk-SULZPKTA.js";
|
|
557
|
+
import "./chunk-VNOVK4I7.js";
|
|
552
558
|
import {
|
|
553
559
|
BuiltinAgentRegistry,
|
|
554
560
|
Client,
|
|
555
561
|
DEFAULT_LOG_LIMIT,
|
|
556
562
|
ExtensionManager,
|
|
557
563
|
ExtensionNotUpdatableError,
|
|
564
|
+
GITHUB_PR_ERROR_MESSAGE_MAX,
|
|
558
565
|
GROUP_COLOR_OPTIONS,
|
|
566
|
+
GitPullFailure,
|
|
559
567
|
InvalidSessionTranscriptCursorError,
|
|
560
568
|
MAX_LOG_LIMIT,
|
|
561
569
|
ModelsConfig,
|
|
@@ -588,37 +596,62 @@ import {
|
|
|
588
596
|
SubagentManager,
|
|
589
597
|
TrustGateError,
|
|
590
598
|
canonicalSessionPrUrl,
|
|
599
|
+
createGitHubPullRequest,
|
|
591
600
|
detectLineEnding,
|
|
592
601
|
encodeTextFileContentAsync,
|
|
602
|
+
fetchAttributionRepoKeys,
|
|
603
|
+
fetchGitBranches,
|
|
593
604
|
fetchGitCommitDetail,
|
|
594
605
|
fetchGitDiff,
|
|
595
606
|
fetchGitDiffHunksForFile,
|
|
607
|
+
fetchGitHubPullRequests,
|
|
596
608
|
fetchGitLog,
|
|
609
|
+
fetchRemoteWebUrl,
|
|
610
|
+
getDefaultBranch,
|
|
597
611
|
getGitWorkingTreeStatus,
|
|
598
612
|
getSubagentSessionDir,
|
|
613
|
+
gitCheckout,
|
|
614
|
+
gitCommit,
|
|
615
|
+
gitCreateBranch,
|
|
616
|
+
gitPull,
|
|
617
|
+
gitPush,
|
|
599
618
|
isSupportedArchiveUrl,
|
|
619
|
+
isValidCheckoutRef,
|
|
620
|
+
isValidRefName,
|
|
621
|
+
isValidSessionPrUrl,
|
|
600
622
|
loadUsageHistoryWithLive,
|
|
623
|
+
matchesAnyServerPattern,
|
|
624
|
+
parseGoalControlRequest,
|
|
601
625
|
parseInstallSource,
|
|
602
626
|
partToString,
|
|
603
627
|
readAgentMeta,
|
|
604
628
|
readSessionPrs,
|
|
605
629
|
replaceSessionPrs,
|
|
630
|
+
repoKeyFromWebUrl,
|
|
631
|
+
resolveBranchName,
|
|
606
632
|
resolveProviderProtocol,
|
|
633
|
+
sessionPrSourceAuthority,
|
|
607
634
|
sleepInhibitor,
|
|
608
635
|
stripTerminalControlSequences,
|
|
609
|
-
|
|
610
|
-
|
|
636
|
+
toSessionPrInfo,
|
|
637
|
+
upsertSessionPr,
|
|
638
|
+
watchRepoBranch
|
|
639
|
+
} from "./chunk-4F7GQGXB.js";
|
|
611
640
|
import "./chunk-GOFAQQZA.js";
|
|
612
641
|
import "./chunk-5M6IDOMF.js";
|
|
613
642
|
import "./chunk-6HUXPLB5.js";
|
|
614
643
|
import "./chunk-TWPJO254.js";
|
|
615
644
|
import "./chunk-CQ35AJ4Z.js";
|
|
616
|
-
import "./chunk-
|
|
645
|
+
import "./chunk-NSUKQ4DN.js";
|
|
646
|
+
import "./chunk-DQCKVAF5.js";
|
|
617
647
|
import "./chunk-AI35S34R.js";
|
|
618
|
-
import
|
|
648
|
+
import {
|
|
649
|
+
GitWorktreeService,
|
|
650
|
+
writeWorktreeSessionMarker
|
|
651
|
+
} from "./chunk-KM3XVTMO.js";
|
|
619
652
|
import "./chunk-6PVPNMXU.js";
|
|
620
653
|
import "./chunk-OKTNXDVO.js";
|
|
621
|
-
import "./chunk-
|
|
654
|
+
import "./chunk-EFTPIZIC.js";
|
|
622
655
|
import "./chunk-IRH27ZC2.js";
|
|
623
656
|
import "./chunk-QHWCP53L.js";
|
|
624
657
|
import {
|
|
@@ -627,44 +660,45 @@ import {
|
|
|
627
660
|
taskHasLegacyCondition,
|
|
628
661
|
updateCronTasks
|
|
629
662
|
} from "./chunk-UJ4DUYIH.js";
|
|
663
|
+
import {
|
|
664
|
+
glob
|
|
665
|
+
} from "./chunk-QJNDUTOL.js";
|
|
630
666
|
import "./chunk-O6GEWCJA.js";
|
|
631
|
-
import "./chunk-
|
|
667
|
+
import "./chunk-OSSTATJF.js";
|
|
632
668
|
import {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
import "./chunk-B2RIIK3K.js";
|
|
669
|
+
findGitRoot
|
|
670
|
+
} from "./chunk-ZHO2CW6D.js";
|
|
671
|
+
import "./chunk-CVX63TFJ.js";
|
|
637
672
|
import "./chunk-373DQUVA.js";
|
|
638
673
|
import {
|
|
639
674
|
recordDaemonBridgeError,
|
|
640
675
|
recordDaemonHttpRequest,
|
|
641
676
|
validateSkillName
|
|
642
|
-
} from "./chunk-
|
|
677
|
+
} from "./chunk-H43PSPYS.js";
|
|
643
678
|
import "./chunk-U6D2PPMN.js";
|
|
644
|
-
import "./chunk-
|
|
645
|
-
import
|
|
646
|
-
glob
|
|
647
|
-
} from "./chunk-QJNDUTOL.js";
|
|
648
|
-
import {
|
|
649
|
-
findGitRoot
|
|
650
|
-
} from "./chunk-ZHO2CW6D.js";
|
|
651
|
-
import "./chunk-AF3QB6OL.js";
|
|
679
|
+
import "./chunk-VYIUNFEA.js";
|
|
680
|
+
import "./chunk-KGV55H53.js";
|
|
652
681
|
import "./chunk-7TBU7PU2.js";
|
|
653
682
|
import "./chunk-E4JNFXNI.js";
|
|
654
|
-
import {
|
|
655
|
-
parseGoalControlRequest
|
|
656
|
-
} from "./chunk-4P7PPAHN.js";
|
|
657
|
-
import "./chunk-7J6OTNGO.js";
|
|
658
683
|
import "./chunk-CHEIIBT3.js";
|
|
659
|
-
import "./chunk-
|
|
684
|
+
import "./chunk-TJYRTS4S.js";
|
|
660
685
|
import {
|
|
661
686
|
APPROVAL_MODES
|
|
662
687
|
} from "./chunk-JX6XHPTX.js";
|
|
663
688
|
import "./chunk-MLXTMF7H.js";
|
|
689
|
+
import "./chunk-PQEISIKS.js";
|
|
690
|
+
import "./chunk-FD5SJOWT.js";
|
|
691
|
+
import "./chunk-4LIFGNI4.js";
|
|
692
|
+
import "./chunk-S6LOFUVP.js";
|
|
664
693
|
import "./chunk-NAVJD2PQ.js";
|
|
665
694
|
import "./chunk-KFN2IZYR.js";
|
|
666
695
|
import "./chunk-GB4UKWY5.js";
|
|
667
696
|
import "./chunk-QHMLYMMS.js";
|
|
697
|
+
import "./chunk-CFKIH3D3.js";
|
|
698
|
+
import "./chunk-2LD5U7Q3.js";
|
|
699
|
+
import "./chunk-DJ2GSRLV.js";
|
|
700
|
+
import "./chunk-S2T7H5MI.js";
|
|
701
|
+
import "./chunk-LKODFJRD.js";
|
|
668
702
|
import {
|
|
669
703
|
addDaemonRequestAttribute,
|
|
670
704
|
captureDaemonTelemetryContext,
|
|
@@ -676,22 +710,12 @@ import {
|
|
|
676
710
|
recordDaemonHttpResponse,
|
|
677
711
|
runWithDaemonTelemetryContext,
|
|
678
712
|
withDaemonRequestSpan
|
|
679
|
-
} from "./chunk-
|
|
713
|
+
} from "./chunk-LB3WQQJK.js";
|
|
680
714
|
import "./chunk-XWRJCPHC.js";
|
|
681
|
-
import "./chunk-VNOVK4I7.js";
|
|
682
|
-
import "./chunk-PQEISIKS.js";
|
|
683
|
-
import "./chunk-RT4QNQ5P.js";
|
|
684
|
-
import "./chunk-26SIKQIC.js";
|
|
685
|
-
import "./chunk-S6LOFUVP.js";
|
|
686
|
-
import "./chunk-CFKIH3D3.js";
|
|
687
|
-
import "./chunk-2LD5U7Q3.js";
|
|
688
|
-
import "./chunk-DJ2GSRLV.js";
|
|
689
|
-
import "./chunk-S2T7H5MI.js";
|
|
690
|
-
import "./chunk-LKODFJRD.js";
|
|
691
715
|
import {
|
|
692
716
|
parseLineTolerant,
|
|
693
717
|
read
|
|
694
|
-
} from "./chunk-
|
|
718
|
+
} from "./chunk-GH2S4GD5.js";
|
|
695
719
|
import "./chunk-XBVNNDPK.js";
|
|
696
720
|
import "./chunk-VGC4I5JJ.js";
|
|
697
721
|
import {
|
|
@@ -702,14 +726,12 @@ import {
|
|
|
702
726
|
getAllMemoryFilenames,
|
|
703
727
|
isUtf8CompatibleEncoding,
|
|
704
728
|
isWithinRoot
|
|
705
|
-
} from "./chunk-
|
|
729
|
+
} from "./chunk-DYTW3QVG.js";
|
|
706
730
|
import "./chunk-HT5S5TRQ.js";
|
|
707
|
-
import "./chunk-LMMHS3RS.js";
|
|
708
731
|
import "./chunk-WZAD4ZNJ.js";
|
|
709
732
|
import "./chunk-FPGTNKCP.js";
|
|
710
733
|
import "./chunk-EIJT2PQ6.js";
|
|
711
|
-
import "./chunk-
|
|
712
|
-
import "./chunk-XZA32HII.js";
|
|
734
|
+
import "./chunk-BFY33IB4.js";
|
|
713
735
|
import "./chunk-KHP66DFN.js";
|
|
714
736
|
import "./chunk-22UH7VTP.js";
|
|
715
737
|
import "./chunk-HHJLM3WQ.js";
|
|
@@ -717,19 +739,19 @@ import {
|
|
|
717
739
|
isTelemetrySdkInitialized,
|
|
718
740
|
redactUrlCredentials,
|
|
719
741
|
stripAnsiAndControl
|
|
720
|
-
} from "./chunk-
|
|
742
|
+
} from "./chunk-QKDNS6FU.js";
|
|
721
743
|
import "./chunk-74TONY4F.js";
|
|
722
|
-
import "./chunk-
|
|
744
|
+
import "./chunk-ZDFQGHZH.js";
|
|
723
745
|
import {
|
|
724
746
|
SubagentError,
|
|
725
747
|
SubagentErrorCode
|
|
726
|
-
} from "./chunk-
|
|
727
|
-
import "./chunk-
|
|
748
|
+
} from "./chunk-G7HBEEX7.js";
|
|
749
|
+
import "./chunk-QQD2GART.js";
|
|
728
750
|
import {
|
|
729
751
|
escapeXml
|
|
730
752
|
} from "./chunk-AQ37AY7B.js";
|
|
731
753
|
import "./chunk-ODZF64DM.js";
|
|
732
|
-
import "./chunk-
|
|
754
|
+
import "./chunk-7JMGTOH7.js";
|
|
733
755
|
import {
|
|
734
756
|
FatalConfigError,
|
|
735
757
|
Storage,
|
|
@@ -745,13 +767,13 @@ import {
|
|
|
745
767
|
import "./chunk-75DOP5OR.js";
|
|
746
768
|
import "./chunk-DMTGGOSA.js";
|
|
747
769
|
import "./chunk-YQ3U5MUC.js";
|
|
770
|
+
import "./chunk-AMDSOFFV.js";
|
|
748
771
|
import {
|
|
749
772
|
import_websocket,
|
|
750
773
|
import_websocket_server,
|
|
751
774
|
wrapper_default
|
|
752
|
-
} from "./chunk-
|
|
775
|
+
} from "./chunk-J5TTWBZK.js";
|
|
753
776
|
import "./chunk-RVIGZBIT.js";
|
|
754
|
-
import "./chunk-AMDSOFFV.js";
|
|
755
777
|
import "./chunk-TBWQLLFO.js";
|
|
756
778
|
import {
|
|
757
779
|
init_esbuild_shims
|
|
@@ -6535,7 +6557,7 @@ var FileConversationRuntimeOwnership = class {
|
|
|
6535
6557
|
await this.commitRecord(identity, void 0);
|
|
6536
6558
|
}
|
|
6537
6559
|
}, "commitOwner");
|
|
6538
|
-
const liveDiscovery = await import("./discovery-
|
|
6560
|
+
const liveDiscovery = await import("./discovery-TUM3ZQ6U.js");
|
|
6539
6561
|
const handoff = await liveDiscovery.handoffLiveDiscoveryOwner(
|
|
6540
6562
|
this.stableBaseDir,
|
|
6541
6563
|
this.current,
|
|
@@ -7312,6 +7334,7 @@ function toStandaloneSummary(item, workspaceCwd, canonicalSessionId, isArchived,
|
|
|
7312
7334
|
createdAt: item.startTime,
|
|
7313
7335
|
updatedAt: new Date(item.mtime).toISOString(),
|
|
7314
7336
|
...displayName ? { displayName } : {},
|
|
7337
|
+
...item.customTitle && item.titleSource ? { titleSource: item.titleSource } : {},
|
|
7315
7338
|
sourceType: STANDALONE_SESSION_SOURCE_TYPE,
|
|
7316
7339
|
context: { kind: "standalone" },
|
|
7317
7340
|
...source.metadata.parentSessionId !== void 0 ? {
|
|
@@ -7376,6 +7399,35 @@ var StandaloneSessionService = class {
|
|
|
7376
7399
|
directoryStates = /* @__PURE__ */ new Map();
|
|
7377
7400
|
reconciliations = /* @__PURE__ */ new WeakMap();
|
|
7378
7401
|
terminal = false;
|
|
7402
|
+
async getOptions() {
|
|
7403
|
+
const runtime = await this.options.ensureRuntime();
|
|
7404
|
+
return this.options.runRuntimeActivity(runtime, async () => {
|
|
7405
|
+
this.options.assertRuntimeCurrent(runtime);
|
|
7406
|
+
await this.options.workspace.assertExactRoot(runtime.workspaceCwd);
|
|
7407
|
+
this.options.assertRuntimeCurrent(runtime);
|
|
7408
|
+
const status = await runtime.workspaceService.getWorkspaceProvidersStatus(
|
|
7409
|
+
{
|
|
7410
|
+
route: "GET /standalone/session-options",
|
|
7411
|
+
workspaceCwd: runtime.workspaceCwd
|
|
7412
|
+
}
|
|
7413
|
+
);
|
|
7414
|
+
this.options.assertRuntimeCurrent(runtime);
|
|
7415
|
+
if (status.workspaceCwd !== runtime.workspaceCwd) {
|
|
7416
|
+
throw new ConversationRuntimeOwnershipError(
|
|
7417
|
+
"conversation_runtime_ownership_compromised",
|
|
7418
|
+
false
|
|
7419
|
+
);
|
|
7420
|
+
}
|
|
7421
|
+
return {
|
|
7422
|
+
v: status.v,
|
|
7423
|
+
initialized: status.initialized,
|
|
7424
|
+
...status.current !== void 0 ? { current: status.current } : {},
|
|
7425
|
+
...status.approvalMode !== void 0 ? { approvalMode: status.approvalMode } : {},
|
|
7426
|
+
providers: status.providers,
|
|
7427
|
+
...status.errors !== void 0 ? { errors: status.errors } : {}
|
|
7428
|
+
};
|
|
7429
|
+
});
|
|
7430
|
+
}
|
|
7379
7431
|
freezeForTerminalQuarantine(runtime) {
|
|
7380
7432
|
this.terminal = true;
|
|
7381
7433
|
for (const entry of this.creating.values()) {
|
|
@@ -13887,13 +13939,11 @@ var AcpDispatcher = class {
|
|
|
13887
13939
|
{
|
|
13888
13940
|
number: boundPr["number"],
|
|
13889
13941
|
url: boundPr["url"],
|
|
13942
|
+
source: "create",
|
|
13890
13943
|
...boundState === "open" || boundState === "merged" || boundState === "closed" ? { state: boundState } : {}
|
|
13891
13944
|
}
|
|
13892
|
-
)).map(
|
|
13893
|
-
|
|
13894
|
-
url,
|
|
13895
|
-
...state ? { state } : {}
|
|
13896
|
-
}));
|
|
13945
|
+
)).map(toSessionPrInfo);
|
|
13946
|
+
this.bridge.setSessionPrs?.(sessionId, persistedPrs);
|
|
13897
13947
|
result = { ...result, prs: persistedPrs };
|
|
13898
13948
|
}
|
|
13899
13949
|
} finally {
|
|
@@ -23168,7 +23218,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
|
|
|
23168
23218
|
generationPoller.unref();
|
|
23169
23219
|
app.locals.stopExtensionGenerationReconciler = () => clearInterval(generationPoller);
|
|
23170
23220
|
}
|
|
23171
|
-
const
|
|
23221
|
+
const registerFor4 = /* @__PURE__ */ __name((base, resolve7) => {
|
|
23172
23222
|
app.get(base, async (req, res) => {
|
|
23173
23223
|
const assertGenerationOpen = deps.captureGenerationAssertion?.();
|
|
23174
23224
|
const ctrl = resolve7(req, res, false);
|
|
@@ -23936,7 +23986,7 @@ function registerWorkspaceExtensionRoutes(app, deps) {
|
|
|
23936
23986
|
}
|
|
23937
23987
|
});
|
|
23938
23988
|
}, "registerFor");
|
|
23939
|
-
|
|
23989
|
+
registerFor4("/workspace/extensions", (_req, res, requireTrust) => {
|
|
23940
23990
|
try {
|
|
23941
23991
|
deps.captureGenerationAssertion?.()?.();
|
|
23942
23992
|
} catch (error2) {
|
|
@@ -26225,6 +26275,9 @@ function resolveDaemonTelemetryRoute(req) {
|
|
|
26225
26275
|
if (req.method === "POST" && path19 === "/workspace/reload") {
|
|
26226
26276
|
return { route: "POST /workspace/reload" };
|
|
26227
26277
|
}
|
|
26278
|
+
if (req.method === "POST" && path19 === "/language") {
|
|
26279
|
+
return { route: "POST /language" };
|
|
26280
|
+
}
|
|
26228
26281
|
const mcpRestart = path19.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
|
|
26229
26282
|
if (mcpRestart?.[1] && req.method === "POST") {
|
|
26230
26283
|
return { route: "POST /workspace/mcp/:server/restart" };
|
|
@@ -26621,6 +26674,7 @@ init_esbuild_shims();
|
|
|
26621
26674
|
import * as crypto3 from "node:crypto";
|
|
26622
26675
|
import * as fs7 from "node:fs";
|
|
26623
26676
|
import * as path12 from "node:path";
|
|
26677
|
+
import { inspect } from "node:util";
|
|
26624
26678
|
var import_express4 = __toESM(require_express(), 1);
|
|
26625
26679
|
|
|
26626
26680
|
// packages/cli/src/serve/server/prompt-deadline.ts
|
|
@@ -27608,6 +27662,16 @@ function sendSessionOrganizationError(res, err) {
|
|
|
27608
27662
|
return true;
|
|
27609
27663
|
}
|
|
27610
27664
|
__name(sendSessionOrganizationError, "sendSessionOrganizationError");
|
|
27665
|
+
function describePromptTurnFailure(err) {
|
|
27666
|
+
const detail = extractErrorMessage(err);
|
|
27667
|
+
if (err instanceof Error) {
|
|
27668
|
+
return `[${err.name}] ${detail}`;
|
|
27669
|
+
}
|
|
27670
|
+
const code = extractErrorCode(err);
|
|
27671
|
+
const rendered = typeof err === "object" && err !== null && (detail === "" || detail === String(err)) ? inspect(err, { depth: 2, breakLength: Infinity }) : detail;
|
|
27672
|
+
return code === void 0 ? rendered : `[code ${code}] ${rendered}`;
|
|
27673
|
+
}
|
|
27674
|
+
__name(describePromptTurnFailure, "describePromptTurnFailure");
|
|
27611
27675
|
function parseTranscriptLimitQuery(rawLimit, res) {
|
|
27612
27676
|
if (rawLimit === void 0) return void 0;
|
|
27613
27677
|
if (typeof rawLimit !== "string" || rawLimit.trim() === "") {
|
|
@@ -29040,7 +29104,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
29040
29104
|
// characters would let a caller forge log lines.
|
|
29041
29105
|
hasControlCharacter(url) || state !== void 0 && state !== "open" && state !== "merged" && state !== "closed") {
|
|
29042
29106
|
res.status(400).json({
|
|
29043
|
-
error: `\`pr\` must be an object with a positive integer \`number\` and an http(s) \`url\` of at most ${SESSION_PR_URL_MAX_LENGTH} characters, without control characters, and an optional \`state\` of \`open\`, \`merged\`, or \`closed\``,
|
|
29107
|
+
error: `\`pr\` must be an object with a positive integer \`number\` and an http(s) \`url\` of at most ${SESSION_PR_URL_MAX_LENGTH} characters, without control characters, and an optional \`state\` that is one of \`open\`, \`merged\`, or \`closed\``,
|
|
29044
29108
|
code: "invalid_metadata",
|
|
29045
29109
|
field: "pr"
|
|
29046
29110
|
});
|
|
@@ -29711,7 +29775,10 @@ function registerSessionRoutes(app, deps) {
|
|
|
29711
29775
|
daemonLog
|
|
29712
29776
|
);
|
|
29713
29777
|
}
|
|
29714
|
-
sendBridgeError2(res, err, {
|
|
29778
|
+
sendBridgeError2(res, err, {
|
|
29779
|
+
route: "POST /session",
|
|
29780
|
+
...branchMeta || worktreeMeta ? {} : { initPrecedesMutations: true }
|
|
29781
|
+
});
|
|
29715
29782
|
} finally {
|
|
29716
29783
|
sessionIdReservation?.release();
|
|
29717
29784
|
}
|
|
@@ -31358,9 +31425,8 @@ function registerSessionRoutes(app, deps) {
|
|
|
31358
31425
|
},
|
|
31359
31426
|
(err) => {
|
|
31360
31427
|
if (daemonLog) {
|
|
31361
|
-
const errName = err instanceof Error ? err.name : void 0;
|
|
31362
31428
|
daemonLog.warn(
|
|
31363
|
-
`prompt turn failed: ${
|
|
31429
|
+
`prompt turn failed: ${describePromptTurnFailure(err)}`,
|
|
31364
31430
|
{ sessionId, promptId, clientId }
|
|
31365
31431
|
);
|
|
31366
31432
|
}
|
|
@@ -31844,12 +31910,9 @@ function registerSessionRoutes(app, deps) {
|
|
|
31844
31910
|
if (pr) {
|
|
31845
31911
|
const persistedPrs = (await upsertSessionPr(
|
|
31846
31912
|
service.getPrSessionPathForArchiveState(sessionId, "active"),
|
|
31847
|
-
pr
|
|
31848
|
-
)).map(
|
|
31849
|
-
|
|
31850
|
-
url,
|
|
31851
|
-
...state ? { state } : {}
|
|
31852
|
-
}));
|
|
31913
|
+
{ ...pr, source: "create" }
|
|
31914
|
+
)).map(toSessionPrInfo);
|
|
31915
|
+
runtime.bridge.setSessionPrs?.(sessionId, persistedPrs);
|
|
31853
31916
|
effective = { ...effective, prs: persistedPrs };
|
|
31854
31917
|
}
|
|
31855
31918
|
} finally {
|
|
@@ -31969,13 +32032,10 @@ function registerSessionRoutes(app, deps) {
|
|
|
31969
32032
|
sessionId,
|
|
31970
32033
|
"active"
|
|
31971
32034
|
),
|
|
31972
|
-
pr
|
|
31973
|
-
)).map(
|
|
31974
|
-
number,
|
|
31975
|
-
url,
|
|
31976
|
-
...state ? { state } : {}
|
|
31977
|
-
}));
|
|
32035
|
+
{ ...pr, source: "create" }
|
|
32036
|
+
)).map(toSessionPrInfo);
|
|
31978
32037
|
assertRuntimeGenerationOpen?.();
|
|
32038
|
+
runtime.bridge.setSessionPrs?.(sessionId, persistedPrs);
|
|
31979
32039
|
effective = { ...effective, prs: persistedPrs };
|
|
31980
32040
|
}
|
|
31981
32041
|
} catch (err) {
|
|
@@ -31992,14 +32052,10 @@ function registerSessionRoutes(app, deps) {
|
|
|
31992
32052
|
if (pr) {
|
|
31993
32053
|
const persisted = await upsertSessionPr(
|
|
31994
32054
|
service.getPrSessionPathForArchiveState(sessionId, location),
|
|
31995
|
-
pr
|
|
32055
|
+
{ ...pr, source: "create" }
|
|
31996
32056
|
);
|
|
31997
32057
|
assertRuntimeGenerationOpen?.();
|
|
31998
|
-
effective.prs = persisted.map(
|
|
31999
|
-
number,
|
|
32000
|
-
url,
|
|
32001
|
-
...state ? { state } : {}
|
|
32002
|
-
}));
|
|
32058
|
+
effective.prs = persisted.map(toSessionPrInfo);
|
|
32003
32059
|
}
|
|
32004
32060
|
if (displayName !== void 0) {
|
|
32005
32061
|
const renamed = await service.renameSession(
|
|
@@ -32496,6 +32552,103 @@ function registerSessionRoutes(app, deps) {
|
|
|
32496
32552
|
"/workspaces/:workspace/sessions",
|
|
32497
32553
|
listWorkspaceSessionsHandler("workspace")
|
|
32498
32554
|
);
|
|
32555
|
+
const SESSION_SEARCH_QUERY_MAX_LENGTH = 200;
|
|
32556
|
+
const SESSION_SEARCH_MAX_RESULTS_LIMIT = 50;
|
|
32557
|
+
const searchWorkspaceSessionsHandler = /* @__PURE__ */ __name((paramName) => async (req, res) => {
|
|
32558
|
+
const route = paramName === "workspace" ? "GET /workspaces/:workspace/sessions/search" : "GET /workspace/:id/sessions/search";
|
|
32559
|
+
const liveRuntime = await resolveLiveCatalogRuntime(req, res, paramName);
|
|
32560
|
+
if (liveRuntime === null) return;
|
|
32561
|
+
const runtime = liveRuntime ?? resolveRuntimeForCatalogRoute(req, res, paramName, route);
|
|
32562
|
+
if (runtime === null) return;
|
|
32563
|
+
const key = runtime.workspaceCwd;
|
|
32564
|
+
try {
|
|
32565
|
+
const rawQuery = req.query["q"];
|
|
32566
|
+
const trimmedQuery = typeof rawQuery === "string" ? rawQuery.trim() : "";
|
|
32567
|
+
if (trimmedQuery.length === 0 || trimmedQuery.length > SESSION_SEARCH_QUERY_MAX_LENGTH) {
|
|
32568
|
+
res.status(400).json({
|
|
32569
|
+
error: `\`q\` must be a non-empty string of at most ${SESSION_SEARCH_QUERY_MAX_LENGTH} characters`,
|
|
32570
|
+
code: "invalid_search_query"
|
|
32571
|
+
});
|
|
32572
|
+
return;
|
|
32573
|
+
}
|
|
32574
|
+
let maxResults;
|
|
32575
|
+
const rawMaxResults = req.query["maxResults"];
|
|
32576
|
+
if (rawMaxResults !== void 0) {
|
|
32577
|
+
const parsed = typeof rawMaxResults === "string" && /^\d+$/.test(rawMaxResults) ? Number.parseInt(rawMaxResults, 10) : Number.NaN;
|
|
32578
|
+
if (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > SESSION_SEARCH_MAX_RESULTS_LIMIT) {
|
|
32579
|
+
res.status(400).json({
|
|
32580
|
+
error: `\`maxResults\` must be an integer between 1 and ${SESSION_SEARCH_MAX_RESULTS_LIMIT}`,
|
|
32581
|
+
code: "invalid_search_max_results"
|
|
32582
|
+
});
|
|
32583
|
+
return;
|
|
32584
|
+
}
|
|
32585
|
+
maxResults = parsed;
|
|
32586
|
+
}
|
|
32587
|
+
const controller = new AbortController();
|
|
32588
|
+
const onRequestAborted = /* @__PURE__ */ __name(() => {
|
|
32589
|
+
controller.abort(new DOMException("Request aborted", "AbortError"));
|
|
32590
|
+
}, "onRequestAborted");
|
|
32591
|
+
const onResponseClosed = /* @__PURE__ */ __name(() => {
|
|
32592
|
+
if (!res.writableEnded) {
|
|
32593
|
+
controller.abort(new DOMException("Response closed", "AbortError"));
|
|
32594
|
+
}
|
|
32595
|
+
}, "onResponseClosed");
|
|
32596
|
+
req.once("aborted", onRequestAborted);
|
|
32597
|
+
res.once("close", onResponseClosed);
|
|
32598
|
+
if (req.aborted || res.destroyed) onRequestAborted();
|
|
32599
|
+
try {
|
|
32600
|
+
const search = /* @__PURE__ */ __name(() => runWorkspaceInspectionWithLogPolicy(
|
|
32601
|
+
runtime,
|
|
32602
|
+
() => searchWorkspaceSessionsForResponse(
|
|
32603
|
+
key,
|
|
32604
|
+
trimmedQuery,
|
|
32605
|
+
{ ...maxResults !== void 0 ? { maxResults } : {} },
|
|
32606
|
+
{
|
|
32607
|
+
runtimeBaseDir: runtime.sessionRuntimeBaseDir,
|
|
32608
|
+
signal: controller.signal
|
|
32609
|
+
}
|
|
32610
|
+
)
|
|
32611
|
+
), "search");
|
|
32612
|
+
const result = liveRuntime && deps.conversationRuntimeActivity ? await deps.conversationRuntimeActivity.run(search) : await search();
|
|
32613
|
+
controller.signal.throwIfAborted();
|
|
32614
|
+
if (res.destroyed) return;
|
|
32615
|
+
res.status(200).json({ results: result.results });
|
|
32616
|
+
} catch (err) {
|
|
32617
|
+
if (controller.signal.aborted || res.destroyed) {
|
|
32618
|
+
return;
|
|
32619
|
+
}
|
|
32620
|
+
throw err;
|
|
32621
|
+
} finally {
|
|
32622
|
+
req.off("aborted", onRequestAborted);
|
|
32623
|
+
res.off("close", onResponseClosed);
|
|
32624
|
+
}
|
|
32625
|
+
} catch (err) {
|
|
32626
|
+
if (err && typeof err === "object" && err.code === "daemon_draining") {
|
|
32627
|
+
res.status(503).json({
|
|
32628
|
+
error: "The daemon is draining and no longer accepts work.",
|
|
32629
|
+
code: "daemon_draining"
|
|
32630
|
+
});
|
|
32631
|
+
return;
|
|
32632
|
+
}
|
|
32633
|
+
writeStderrLine(
|
|
32634
|
+
`qwen serve: failed to search sessions for workspace ${safeLogValue(
|
|
32635
|
+
key
|
|
32636
|
+
)}: ${safeLogValue(err instanceof Error ? err.message : String(err))}`
|
|
32637
|
+
);
|
|
32638
|
+
res.status(500).json({
|
|
32639
|
+
error: "Failed to search sessions",
|
|
32640
|
+
code: "session_search_failed"
|
|
32641
|
+
});
|
|
32642
|
+
}
|
|
32643
|
+
}, "searchWorkspaceSessionsHandler");
|
|
32644
|
+
app.get(
|
|
32645
|
+
"/workspace/:id/sessions/search",
|
|
32646
|
+
searchWorkspaceSessionsHandler("id")
|
|
32647
|
+
);
|
|
32648
|
+
app.get(
|
|
32649
|
+
"/workspaces/:workspace/sessions/search",
|
|
32650
|
+
searchWorkspaceSessionsHandler("workspace")
|
|
32651
|
+
);
|
|
32499
32652
|
const lastExposedCatalogVersions = /* @__PURE__ */ new WeakMap();
|
|
32500
32653
|
app.get("/workspaces/:workspace/sessions/live-state", async (req, res) => {
|
|
32501
32654
|
const route = "GET /workspaces/:workspace/sessions/live-state";
|
|
@@ -32597,6 +32750,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
32597
32750
|
const body = safeBody(req);
|
|
32598
32751
|
const configId = body["configId"];
|
|
32599
32752
|
const value = body["value"];
|
|
32753
|
+
const persist = body["persist"];
|
|
32600
32754
|
if (configId !== "reasoning_effort") {
|
|
32601
32755
|
res.status(400).json({
|
|
32602
32756
|
error: "`configId` must be reasoning_effort"
|
|
@@ -32609,11 +32763,29 @@ function registerSessionRoutes(app, deps) {
|
|
|
32609
32763
|
});
|
|
32610
32764
|
return;
|
|
32611
32765
|
}
|
|
32766
|
+
if (persist !== void 0 && typeof persist !== "boolean") {
|
|
32767
|
+
res.status(400).json({
|
|
32768
|
+
error: "`persist` must be a boolean when provided"
|
|
32769
|
+
});
|
|
32770
|
+
return;
|
|
32771
|
+
}
|
|
32612
32772
|
const response = await runtime.bridge.setSessionConfigOption(
|
|
32613
32773
|
sessionId,
|
|
32614
|
-
{
|
|
32774
|
+
{
|
|
32775
|
+
sessionId,
|
|
32776
|
+
configId,
|
|
32777
|
+
value,
|
|
32778
|
+
...persist === true ? {
|
|
32779
|
+
_meta: {
|
|
32780
|
+
[PERSIST_REASONING_SELECTION_META_KEY]: true
|
|
32781
|
+
}
|
|
32782
|
+
} : {}
|
|
32783
|
+
}
|
|
32615
32784
|
);
|
|
32616
|
-
res.status(200).json(
|
|
32785
|
+
res.status(200).json({
|
|
32786
|
+
configOptions: response.configOptions,
|
|
32787
|
+
persisted: response._meta?.[REASONING_SELECTION_PERSISTED_META_KEY] === true
|
|
32788
|
+
});
|
|
32617
32789
|
}
|
|
32618
32790
|
)
|
|
32619
32791
|
);
|
|
@@ -33091,97 +33263,71 @@ __name(registerSessionRoutes, "registerSessionRoutes");
|
|
|
33091
33263
|
|
|
33092
33264
|
// packages/cli/src/serve/routes/session-pr-backfill.ts
|
|
33093
33265
|
init_esbuild_shims();
|
|
33094
|
-
import { execSync } from "node:child_process";
|
|
33095
33266
|
import { existsSync } from "node:fs";
|
|
33096
33267
|
import * as fs8 from "node:fs/promises";
|
|
33097
33268
|
import * as path13 from "node:path";
|
|
33098
|
-
var SLUG_PR_PATTERN = /^pr-(\d{
|
|
33099
|
-
var BRANCH_PR_PATTERN = /^worktree-pr-(\d{
|
|
33269
|
+
var SLUG_PR_PATTERN = /^pr-([1-9]\d{0,8})$/;
|
|
33270
|
+
var BRANCH_PR_PATTERN = /^worktree-pr-([1-9]\d{0,8})$/;
|
|
33100
33271
|
function parsePrNumberFromWorktree(slug, branch) {
|
|
33101
33272
|
const slugMatch = SLUG_PR_PATTERN.exec(slug ?? "");
|
|
33102
|
-
if (slugMatch)
|
|
33103
|
-
const number = Number(slugMatch[1]);
|
|
33104
|
-
return number > 0 ? number : void 0;
|
|
33105
|
-
}
|
|
33273
|
+
if (slugMatch) return Number(slugMatch[1]);
|
|
33106
33274
|
const branchMatch = BRANCH_PR_PATTERN.exec(branch ?? "");
|
|
33107
|
-
if (branchMatch)
|
|
33108
|
-
const number = Number(branchMatch[1]);
|
|
33109
|
-
return number > 0 ? number : void 0;
|
|
33110
|
-
}
|
|
33275
|
+
if (branchMatch) return Number(branchMatch[1]);
|
|
33111
33276
|
return void 0;
|
|
33112
33277
|
}
|
|
33113
33278
|
__name(parsePrNumberFromWorktree, "parsePrNumberFromWorktree");
|
|
33114
|
-
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
|
|
33119
|
-
|
|
33120
|
-
|
|
33121
|
-
|
|
33122
|
-
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
|
|
33127
|
-
|
|
33128
|
-
|
|
33129
|
-
} catch {
|
|
33130
|
-
return void 0;
|
|
33131
|
-
}
|
|
33132
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
|
|
33133
|
-
const pathname = url.pathname.replace(/\.git\/?$/, "");
|
|
33134
|
-
if (!pathname || pathname === "/") return void 0;
|
|
33135
|
-
const host = sshDerived ? url.hostname : url.host;
|
|
33136
|
-
return `${url.protocol}//${host}${pathname}`.replace(/\/$/, "");
|
|
33137
|
-
}
|
|
33138
|
-
__name(normalizeRemoteToWebUrl, "normalizeRemoteToWebUrl");
|
|
33139
|
-
function getRemoteWebUrl(cwd) {
|
|
33140
|
-
try {
|
|
33141
|
-
const remote = execSync("git remote get-url origin", {
|
|
33142
|
-
cwd,
|
|
33143
|
-
encoding: "utf8",
|
|
33144
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
33145
|
-
// Sanitize like every sibling git/gh call in this path: without an
|
|
33146
|
-
// env option the spawn inherits the daemon's raw process.env, and an
|
|
33147
|
-
// inherited GIT_DIR/GIT_WORK_TREE/GIT_CONFIG_* would resolve origin
|
|
33148
|
-
// against a different repository despite the cwd.
|
|
33149
|
-
env: gitEnv()
|
|
33150
|
-
}).trim();
|
|
33151
|
-
return normalizeRemoteToWebUrl(remote);
|
|
33152
|
-
} catch {
|
|
33153
|
-
return void 0;
|
|
33154
|
-
}
|
|
33155
|
-
}
|
|
33156
|
-
__name(getRemoteWebUrl, "getRemoteWebUrl");
|
|
33157
|
-
var MAX_DISTINCT_BRANCHES = 64;
|
|
33158
|
-
async function collectTranscriptBranches(filePath) {
|
|
33159
|
-
let raw;
|
|
33160
|
-
try {
|
|
33161
|
-
raw = await fs8.readFile(filePath, "utf8");
|
|
33162
|
-
} catch {
|
|
33163
|
-
return [];
|
|
33164
|
-
}
|
|
33165
|
-
const branches = /* @__PURE__ */ new Set();
|
|
33279
|
+
var REVIEW_COMMAND_PATTERN = /^\s*\/review(?:[ \t]+#?(\d{1,9})(?![\w./-])|[ \t]+[^\n"\\]*?(https?:\/\/[A-Za-z0-9][^\s"'<>)]*\/pull\/(\d{1,9})(?!\d)))/;
|
|
33280
|
+
function collectReviewedPrNumbers(raw) {
|
|
33281
|
+
const mentions = [];
|
|
33282
|
+
const mentionByNumber = /* @__PURE__ */ new Map();
|
|
33283
|
+
const noteMention = /* @__PURE__ */ __name((number, bare) => {
|
|
33284
|
+
const known = mentionByNumber.get(number);
|
|
33285
|
+
if (known) {
|
|
33286
|
+
if (bare) known.bare = true;
|
|
33287
|
+
return;
|
|
33288
|
+
}
|
|
33289
|
+
const mention = { number, bare };
|
|
33290
|
+
mentionByNumber.set(number, mention);
|
|
33291
|
+
mentions.push(mention);
|
|
33292
|
+
}, "noteMention");
|
|
33293
|
+
const urlForms = [];
|
|
33166
33294
|
for (const line of raw.split("\n")) {
|
|
33167
|
-
if (!line) continue;
|
|
33295
|
+
if (!line.includes("/review")) continue;
|
|
33168
33296
|
let record;
|
|
33169
33297
|
try {
|
|
33170
33298
|
record = JSON.parse(line);
|
|
33171
33299
|
} catch {
|
|
33172
33300
|
continue;
|
|
33173
33301
|
}
|
|
33174
|
-
|
|
33175
|
-
|
|
33176
|
-
|
|
33177
|
-
|
|
33178
|
-
|
|
33302
|
+
let prompt;
|
|
33303
|
+
if (record.type === "system" && record.subtype === "slash_command" && record.systemPayload?.phase === "invocation" && typeof record.systemPayload.rawCommand === "string") {
|
|
33304
|
+
prompt = record.systemPayload.rawCommand;
|
|
33305
|
+
} else if (record.type === "user") {
|
|
33306
|
+
const firstPart = record.message?.parts?.[0];
|
|
33307
|
+
if (typeof firstPart?.text === "string" && !firstPart.functionResponse) {
|
|
33308
|
+
prompt = firstPart.text;
|
|
33309
|
+
}
|
|
33310
|
+
}
|
|
33311
|
+
if (prompt === void 0) continue;
|
|
33312
|
+
const match = REVIEW_COMMAND_PATTERN.exec(prompt);
|
|
33313
|
+
if (!match) continue;
|
|
33314
|
+
const bareNumber = match[1];
|
|
33315
|
+
if (bareNumber !== void 0) {
|
|
33316
|
+
if (Number(bareNumber) > 0) noteMention(Number(bareNumber), true);
|
|
33317
|
+
continue;
|
|
33318
|
+
}
|
|
33319
|
+
const url = match[2];
|
|
33320
|
+
const urlNumber = match[3];
|
|
33321
|
+
if (url === void 0 || urlNumber === void 0) continue;
|
|
33322
|
+
if (Number(urlNumber) > 0) {
|
|
33323
|
+
noteMention(Number(urlNumber), false);
|
|
33324
|
+
urlForms.push({ number: Number(urlNumber), url });
|
|
33179
33325
|
}
|
|
33180
33326
|
}
|
|
33181
|
-
return
|
|
33327
|
+
return { mentions, reviewedUrlForms: urlForms };
|
|
33182
33328
|
}
|
|
33183
|
-
__name(
|
|
33184
|
-
async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGitHubPullRequests, options = {}) {
|
|
33329
|
+
__name(collectReviewedPrNumbers, "collectReviewedPrNumbers");
|
|
33330
|
+
async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGitHubPullRequests, fetchRepoKeys = fetchAttributionRepoKeys, options = {}) {
|
|
33185
33331
|
const assertGenerationOpen = /* @__PURE__ */ __name(() => runtime.generationGuard?.assertOpen(), "assertGenerationOpen");
|
|
33186
33332
|
const result = {
|
|
33187
33333
|
workspaceCwd: runtime.workspaceCwd,
|
|
@@ -33193,10 +33339,20 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33193
33339
|
unresolved: 0
|
|
33194
33340
|
};
|
|
33195
33341
|
const sessionService = createWorkspaceRuntimeSessionService(runtime);
|
|
33342
|
+
const remote = await fetchRemoteWebUrl(
|
|
33343
|
+
runtime.workspaceCwd,
|
|
33344
|
+
runtime.env.effectiveEnv
|
|
33345
|
+
);
|
|
33346
|
+
const workspaceRepoKey = remote ? repoKeyFromWebUrl(remote) : void 0;
|
|
33347
|
+
const aoneRepo = await resolveAoneWorkspaceRepo(
|
|
33348
|
+
runtime.workspaceCwd,
|
|
33349
|
+
runtime.env.effectiveEnv
|
|
33350
|
+
);
|
|
33196
33351
|
const candidates = [];
|
|
33197
33352
|
for (const archiveState of ["active", "archived"]) {
|
|
33198
33353
|
const sessionIds = await sessionService.listAllProjectSessionIds(archiveState);
|
|
33199
33354
|
for (const sessionId of sessionIds) {
|
|
33355
|
+
if (!isValidSessionId(sessionId)) continue;
|
|
33200
33356
|
result.scanned += 1;
|
|
33201
33357
|
const dir = path13.dirname(
|
|
33202
33358
|
sessionService.getWorktreeSessionPathForArchiveState(
|
|
@@ -33212,75 +33368,51 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33212
33368
|
} catch {
|
|
33213
33369
|
worktree = null;
|
|
33214
33370
|
}
|
|
33215
|
-
|
|
33216
|
-
|
|
33217
|
-
|
|
33218
|
-
|
|
33219
|
-
|
|
33371
|
+
let transcriptRaw;
|
|
33372
|
+
try {
|
|
33373
|
+
transcriptRaw = await fs8.readFile(
|
|
33374
|
+
path13.join(dir, `${sessionId}.jsonl`),
|
|
33375
|
+
"utf8"
|
|
33376
|
+
);
|
|
33377
|
+
} catch {
|
|
33378
|
+
transcriptRaw = "";
|
|
33379
|
+
}
|
|
33380
|
+
const reviewed = collectReviewedPrNumbers(transcriptRaw);
|
|
33220
33381
|
const conventionNumber = worktree ? parsePrNumberFromWorktree(worktree.slug, worktree.worktreeBranch) : void 0;
|
|
33221
|
-
|
|
33382
|
+
const hasSidecar = aoneRepo !== void 0 && existsSync(
|
|
33383
|
+
sessionService.getPrSessionPathForArchiveState(
|
|
33384
|
+
sessionId,
|
|
33385
|
+
archiveState
|
|
33386
|
+
)
|
|
33387
|
+
);
|
|
33388
|
+
if (conventionNumber === void 0 && reviewed.mentions.length === 0 && !hasSidecar) {
|
|
33222
33389
|
continue;
|
|
33223
33390
|
}
|
|
33224
33391
|
candidates.push({
|
|
33225
33392
|
sessionId,
|
|
33226
33393
|
archiveState,
|
|
33227
|
-
transcriptPath,
|
|
33394
|
+
transcriptPath: path13.join(dir, `${sessionId}.jsonl`),
|
|
33228
33395
|
conventionNumber,
|
|
33229
|
-
|
|
33396
|
+
mentions: reviewed.mentions,
|
|
33397
|
+
reviewedUrlForms: reviewed.reviewedUrlForms
|
|
33230
33398
|
});
|
|
33231
33399
|
}
|
|
33232
33400
|
}
|
|
33233
33401
|
if (candidates.length === 0) return result;
|
|
33234
33402
|
assertGenerationOpen();
|
|
33235
33403
|
const numberToUrl = /* @__PURE__ */ new Map();
|
|
33236
|
-
const
|
|
33237
|
-
const
|
|
33238
|
-
let
|
|
33404
|
+
const pageUrlByNumber = /* @__PURE__ */ new Map();
|
|
33405
|
+
const pageStateByNumber = /* @__PURE__ */ new Map();
|
|
33406
|
+
let pageRepoKey;
|
|
33407
|
+
let pageMapTrusted = false;
|
|
33408
|
+
let resolveAoneUrl;
|
|
33239
33409
|
let isLegacyFabricated;
|
|
33240
|
-
const aoneBackend = options.aoneBackend ?? defaultAoneMrBackend;
|
|
33241
|
-
const aoneRepo = await resolveAoneWorkspaceRepo(
|
|
33242
|
-
runtime.workspaceCwd,
|
|
33243
|
-
runtime.env.effectiveEnv
|
|
33244
|
-
);
|
|
33245
33410
|
if (aoneRepo) {
|
|
33246
33411
|
result.platform = "aone";
|
|
33247
|
-
|
|
33248
|
-
try {
|
|
33249
|
-
const listed = [
|
|
33250
|
-
...await aoneBackend.list(
|
|
33251
|
-
aoneRepo.repoPath,
|
|
33252
|
-
"opened",
|
|
33253
|
-
AONE_BACKFILL_PAGES_PER_STATE
|
|
33254
|
-
),
|
|
33255
|
-
...await aoneBackend.list(
|
|
33256
|
-
aoneRepo.repoPath,
|
|
33257
|
-
"merged",
|
|
33258
|
-
AONE_BACKFILL_PAGES_PER_STATE
|
|
33259
|
-
)
|
|
33260
|
-
];
|
|
33261
|
-
result.aoneAvailable = true;
|
|
33262
|
-
let defaultBranch;
|
|
33263
|
-
let headBranchMapping = false;
|
|
33264
|
-
if (candidates.some((candidate) => candidate.branches.length > 0)) {
|
|
33265
|
-
const defaultRef = await getDefaultBranch(runtime.workspaceCwd);
|
|
33266
|
-
if (defaultRef) {
|
|
33267
|
-
defaultBranch = defaultRef.slice(defaultRef.indexOf("/") + 1);
|
|
33268
|
-
headBranchMapping = true;
|
|
33269
|
-
}
|
|
33270
|
-
}
|
|
33271
|
-
for (const mr of listed) {
|
|
33272
|
-
numberToState.set(mr.number, mr.state);
|
|
33273
|
-
if (!headBranchMapping) continue;
|
|
33274
|
-
const mapped = branchToNumber.get(mr.headRefName);
|
|
33275
|
-
if (mr.headRefName && mr.headRefName !== defaultBranch && (mapped === void 0 || mr.number > mapped)) {
|
|
33276
|
-
branchToNumber.set(mr.headRefName, mr.number);
|
|
33277
|
-
}
|
|
33278
|
-
}
|
|
33279
|
-
} catch {
|
|
33280
|
-
}
|
|
33412
|
+
const aoneBackend = options.aoneBackend ?? defaultAoneMrBackend;
|
|
33281
33413
|
const viewCache = /* @__PURE__ */ new Map();
|
|
33282
33414
|
let viewCalls = 0;
|
|
33283
|
-
|
|
33415
|
+
resolveAoneUrl = /* @__PURE__ */ __name(async (number) => {
|
|
33284
33416
|
if (viewCache.has(number)) return viewCache.get(number);
|
|
33285
33417
|
let url;
|
|
33286
33418
|
if (viewCalls < AONE_MAX_MR_VIEW_CALLS_PER_RUN) {
|
|
@@ -33288,78 +33420,112 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33288
33420
|
try {
|
|
33289
33421
|
const view = await aoneBackend.view(aoneRepo.repoPath, number);
|
|
33290
33422
|
url = view.url;
|
|
33291
|
-
numberToState.set(number, view.state);
|
|
33292
33423
|
numberToUrl.set(number, url);
|
|
33424
|
+
pageUrlByNumber.set(number, url);
|
|
33425
|
+
pageStateByNumber.set(number, view.state);
|
|
33293
33426
|
} catch {
|
|
33294
33427
|
url = void 0;
|
|
33295
33428
|
}
|
|
33296
33429
|
}
|
|
33297
33430
|
viewCache.set(number, url);
|
|
33298
33431
|
return url;
|
|
33299
|
-
}, "
|
|
33300
|
-
|
|
33301
|
-
|
|
33302
|
-
isLegacyFabricated = /* @__PURE__ */ __name((url, number) => {
|
|
33303
|
-
if (!legacyPullResolved) {
|
|
33304
|
-
legacyPullRoot = getRemoteWebUrl(runtime.workspaceCwd);
|
|
33305
|
-
legacyPullResolved = true;
|
|
33306
|
-
}
|
|
33307
|
-
return legacyPullRoot !== void 0 && canonicalSessionPrUrl(url) === canonicalSessionPrUrl(`${legacyPullRoot}/pull/${number}`);
|
|
33308
|
-
}, "isLegacyFabricated");
|
|
33432
|
+
}, "resolveAoneUrl");
|
|
33433
|
+
pageMapTrusted = true;
|
|
33434
|
+
isLegacyFabricated = /* @__PURE__ */ __name((url, number) => remote !== void 0 && canonicalSessionPrUrl(url) === canonicalSessionPrUrl(`${remote}/pull/${number}`), "isLegacyFabricated");
|
|
33309
33435
|
} else {
|
|
33310
33436
|
result.platform = "github";
|
|
33311
|
-
|
|
33312
|
-
|
|
33313
|
-
|
|
33314
|
-
|
|
33315
|
-
|
|
33316
|
-
|
|
33317
|
-
|
|
33318
|
-
|
|
33319
|
-
|
|
33320
|
-
|
|
33321
|
-
|
|
33322
|
-
|
|
33323
|
-
|
|
33324
|
-
|
|
33325
|
-
|
|
33326
|
-
}
|
|
33327
|
-
for (const pr of prs.pullRequests) {
|
|
33328
|
-
numberToUrl.set(pr.number, pr.url);
|
|
33329
|
-
numberToState.set(pr.number, pr.state === "draft" ? "open" : pr.state);
|
|
33330
|
-
if (!headBranchMapping) continue;
|
|
33331
|
-
const mapped = branchToNumber.get(pr.headRefName);
|
|
33332
|
-
if (pr.headRefName && pr.headRefName !== defaultBranch && (mapped === void 0 || pr.number > mapped)) {
|
|
33333
|
-
branchToNumber.set(pr.headRefName, pr.number);
|
|
33334
|
-
}
|
|
33437
|
+
}
|
|
33438
|
+
const prs = aoneRepo ? void 0 : await fetchPullRequests(runtime.workspaceCwd, runtime.env.effectiveEnv, {
|
|
33439
|
+
state: "all",
|
|
33440
|
+
limit: 500,
|
|
33441
|
+
slim: true
|
|
33442
|
+
});
|
|
33443
|
+
if (prs) result.ghAvailable = prs.kind === "ok";
|
|
33444
|
+
if (prs?.kind === "ok") {
|
|
33445
|
+
for (const pr of prs.pullRequests) {
|
|
33446
|
+
const state = pr.state === "draft" ? "open" : pr.state;
|
|
33447
|
+
pageUrlByNumber.set(pr.number, pr.url);
|
|
33448
|
+
pageStateByNumber.set(pr.number, state);
|
|
33449
|
+
pageRepoKey ??= repoKeyFromWebUrl(pr.url);
|
|
33450
|
+
if (workspaceRepoKey === void 0 || repoKeyFromWebUrl(pr.url) !== workspaceRepoKey) {
|
|
33451
|
+
continue;
|
|
33335
33452
|
}
|
|
33453
|
+
numberToUrl.set(pr.number, pr.url);
|
|
33336
33454
|
}
|
|
33337
|
-
|
|
33338
|
-
|
|
33339
|
-
|
|
33340
|
-
|
|
33341
|
-
|
|
33342
|
-
|
|
33343
|
-
|
|
33455
|
+
if (pageRepoKey !== void 0) {
|
|
33456
|
+
if (workspaceRepoKey !== void 0 && pageRepoKey === workspaceRepoKey) {
|
|
33457
|
+
pageMapTrusted = true;
|
|
33458
|
+
} else {
|
|
33459
|
+
const { resolved, parent } = await fetchRepoKeys(
|
|
33460
|
+
runtime.workspaceCwd,
|
|
33461
|
+
runtime.env.effectiveEnv
|
|
33462
|
+
);
|
|
33463
|
+
pageMapTrusted = workspaceRepoKey !== void 0 && resolved === workspaceRepoKey && parent === pageRepoKey;
|
|
33344
33464
|
}
|
|
33345
|
-
|
|
33346
|
-
|
|
33465
|
+
}
|
|
33466
|
+
}
|
|
33467
|
+
const allowedRepoKeys = /* @__PURE__ */ new Set();
|
|
33468
|
+
if (workspaceRepoKey !== void 0) allowedRepoKeys.add(workspaceRepoKey);
|
|
33469
|
+
if (pageRepoKey !== void 0) allowedRepoKeys.add(pageRepoKey);
|
|
33470
|
+
const sameRepoKeys = /* @__PURE__ */ new Set();
|
|
33471
|
+
if (workspaceRepoKey !== void 0) sameRepoKeys.add(workspaceRepoKey);
|
|
33472
|
+
if (pageMapTrusted && pageRepoKey !== void 0) {
|
|
33473
|
+
sameRepoKeys.add(pageRepoKey);
|
|
33347
33474
|
}
|
|
33348
33475
|
for (const candidate of candidates) {
|
|
33349
|
-
|
|
33476
|
+
const formUrlByNumber = new Map(
|
|
33477
|
+
candidate.reviewedUrlForms.filter((form) => {
|
|
33478
|
+
if (!isValidSessionPrUrl(form.url)) return false;
|
|
33479
|
+
if (isLegacyFabricated) {
|
|
33480
|
+
return isLegacyFabricated(form.url, form.number);
|
|
33481
|
+
}
|
|
33482
|
+
const repoKey = repoKeyFromWebUrl(form.url);
|
|
33483
|
+
return repoKey !== void 0 && allowedRepoKeys.has(repoKey);
|
|
33484
|
+
}).map((form) => [form.number, form.url])
|
|
33485
|
+
);
|
|
33486
|
+
const numbers = [];
|
|
33487
|
+
for (const mention of candidate.mentions) {
|
|
33488
|
+
if (mention.bare || formUrlByNumber.has(mention.number)) {
|
|
33489
|
+
numbers.push(mention.number);
|
|
33490
|
+
}
|
|
33491
|
+
}
|
|
33492
|
+
const namedAsOwn = new Set(
|
|
33493
|
+
candidate.mentions.filter((mention) => mention.bare).map((mention) => mention.number)
|
|
33494
|
+
);
|
|
33350
33495
|
if (candidate.conventionNumber !== void 0) {
|
|
33351
|
-
|
|
33496
|
+
namedAsOwn.add(candidate.conventionNumber);
|
|
33497
|
+
}
|
|
33498
|
+
const lendableFormUrl = /* @__PURE__ */ __name((number) => {
|
|
33499
|
+
if (resolveAoneUrl) return void 0;
|
|
33500
|
+
const url = formUrlByNumber.get(number);
|
|
33501
|
+
if (url === void 0 || !namedAsOwn.has(number)) return url;
|
|
33502
|
+
const key = repoKeyFromWebUrl(url);
|
|
33503
|
+
return key !== void 0 && sameRepoKeys.has(key) ? url : void 0;
|
|
33504
|
+
}, "lendableFormUrl");
|
|
33505
|
+
if (candidate.conventionNumber !== void 0) {
|
|
33506
|
+
const conventionNumber = candidate.conventionNumber;
|
|
33507
|
+
const rest = numbers.filter((n) => n !== conventionNumber);
|
|
33508
|
+
numbers.length = 0;
|
|
33509
|
+
numbers.push(...rest, conventionNumber);
|
|
33352
33510
|
}
|
|
33353
|
-
|
|
33354
|
-
|
|
33355
|
-
|
|
33356
|
-
|
|
33511
|
+
if (numbers.length === 0 && !isLegacyFabricated) continue;
|
|
33512
|
+
let archiveState = candidate.archiveState;
|
|
33513
|
+
try {
|
|
33514
|
+
const location = await sessionService.getSessionLocation(
|
|
33515
|
+
candidate.sessionId
|
|
33516
|
+
);
|
|
33517
|
+
if (location === "active" || location === "archived") {
|
|
33518
|
+
archiveState = location;
|
|
33357
33519
|
}
|
|
33520
|
+
} catch {
|
|
33358
33521
|
}
|
|
33359
|
-
if (numbers.length === 0 && !isLegacyFabricated) continue;
|
|
33360
33522
|
const prPath = sessionService.getPrSessionPathForArchiveState(
|
|
33361
33523
|
candidate.sessionId,
|
|
33362
|
-
|
|
33524
|
+
archiveState
|
|
33525
|
+
);
|
|
33526
|
+
const transcriptPath = path13.join(
|
|
33527
|
+
path13.dirname(prPath),
|
|
33528
|
+
`${candidate.sessionId}.jsonl`
|
|
33363
33529
|
);
|
|
33364
33530
|
const snapshotAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
33365
33531
|
let existing;
|
|
@@ -33369,39 +33535,41 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33369
33535
|
existing = null;
|
|
33370
33536
|
}
|
|
33371
33537
|
const repairs = /* @__PURE__ */ new Map();
|
|
33372
|
-
if (isLegacyFabricated && existing) {
|
|
33538
|
+
if (isLegacyFabricated && resolveAoneUrl && existing) {
|
|
33373
33539
|
for (const entry of existing) {
|
|
33374
33540
|
if (!isLegacyFabricated(entry.url, entry.number)) continue;
|
|
33375
|
-
const url = await
|
|
33541
|
+
const url = await resolveAoneUrl(entry.number);
|
|
33376
33542
|
if (url === void 0) continue;
|
|
33377
33543
|
repairs.set(entry.number, {
|
|
33378
33544
|
url,
|
|
33379
|
-
state:
|
|
33545
|
+
state: pageStateByNumber.get(entry.number)
|
|
33380
33546
|
});
|
|
33381
33547
|
}
|
|
33382
33548
|
}
|
|
33383
33549
|
if (numbers.length === 0 && repairs.size === 0) continue;
|
|
33384
|
-
if (candidate.conventionNumber !== void 0) {
|
|
33385
|
-
numbers = [...numbers.slice(1), candidate.conventionNumber];
|
|
33386
|
-
}
|
|
33387
33550
|
const existingNumbers = new Set((existing ?? []).map((pr) => pr.number));
|
|
33388
33551
|
const urls = /* @__PURE__ */ new Map();
|
|
33389
33552
|
const states = /* @__PURE__ */ new Map();
|
|
33390
33553
|
for (const number of numbers) {
|
|
33391
33554
|
if (existingNumbers.has(number)) continue;
|
|
33392
33555
|
let url = numberToUrl.get(number);
|
|
33393
|
-
if (url === void 0)
|
|
33394
|
-
|
|
33395
|
-
|
|
33396
|
-
number === candidate.conventionNumber
|
|
33397
|
-
);
|
|
33556
|
+
if (url === void 0) url = lendableFormUrl(number);
|
|
33557
|
+
if (url === void 0 && pageMapTrusted) {
|
|
33558
|
+
url = pageUrlByNumber.get(number);
|
|
33398
33559
|
}
|
|
33399
33560
|
if (url === void 0) {
|
|
33561
|
+
if (resolveAoneUrl) {
|
|
33562
|
+
url = await resolveAoneUrl(number);
|
|
33563
|
+
} else if (remote !== void 0) {
|
|
33564
|
+
url = `${remote}/pull/${number}`;
|
|
33565
|
+
}
|
|
33566
|
+
}
|
|
33567
|
+
if (url === void 0 || !isValidSessionPrUrl(url)) {
|
|
33400
33568
|
result.unresolved += 1;
|
|
33401
33569
|
continue;
|
|
33402
33570
|
}
|
|
33403
33571
|
urls.set(number, url);
|
|
33404
|
-
const state =
|
|
33572
|
+
const state = pageMapTrusted && pageUrlByNumber.get(number) === url ? pageStateByNumber.get(number) : void 0;
|
|
33405
33573
|
if (state !== void 0) states.set(number, state);
|
|
33406
33574
|
}
|
|
33407
33575
|
const droppable = new Set(
|
|
@@ -33415,19 +33583,18 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33415
33583
|
const commit = /* @__PURE__ */ __name(async () => {
|
|
33416
33584
|
const persisted = await replaceSessionPrs(prPath, (fresh) => {
|
|
33417
33585
|
assertGenerationOpen();
|
|
33418
|
-
if (!existsSync(
|
|
33586
|
+
if (!existsSync(transcriptPath)) return null;
|
|
33419
33587
|
const base = repairs.size === 0 ? fresh : fresh.map((entry) => {
|
|
33420
33588
|
const repair = repairs.get(entry.number);
|
|
33421
33589
|
return repair && isLegacyFabricated?.(entry.url, entry.number) ? {
|
|
33422
|
-
|
|
33590
|
+
...entry,
|
|
33423
33591
|
url: repair.url,
|
|
33424
|
-
createdAt: entry.createdAt,
|
|
33425
33592
|
...repair.state !== void 0 ? { state: repair.state } : {}
|
|
33426
33593
|
} : entry;
|
|
33427
33594
|
});
|
|
33428
33595
|
const freshNumbers = new Set(base.map((entry) => entry.number));
|
|
33429
33596
|
const plannedFor = /* @__PURE__ */ __name((entry) => {
|
|
33430
|
-
const resolved = numberToUrl.get(entry.number);
|
|
33597
|
+
const resolved = numberToUrl.get(entry.number) ?? urls.get(entry.number);
|
|
33431
33598
|
const samePr = aoneRepo ? resolved !== void 0 && canonicalSessionPrUrl(entry.url) === canonicalSessionPrUrl(resolved) || isAoneDetailUrlForRepo(aoneRepo.repoPath, entry.number, entry.url) : resolved === void 0 || canonicalSessionPrUrl(entry.url) === canonicalSessionPrUrl(resolved);
|
|
33432
33599
|
return droppable.has(entry.number) && existingNumbers.has(entry.number) && entry.createdAt < snapshotAt && samePr;
|
|
33433
33600
|
}, "plannedFor");
|
|
@@ -33442,37 +33609,58 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33442
33609
|
);
|
|
33443
33610
|
if (plan.length > slots) {
|
|
33444
33611
|
result.overLimit += plan.length - slots;
|
|
33445
|
-
const
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33449
|
-
const
|
|
33450
|
-
|
|
33451
|
-
|
|
33452
|
-
|
|
33453
|
-
|
|
33454
|
-
|
|
33455
|
-
|
|
33456
|
-
}
|
|
33612
|
+
const heldSource = new Map(
|
|
33613
|
+
base.map((entry) => [entry.number, entry.source])
|
|
33614
|
+
);
|
|
33615
|
+
const rank = /* @__PURE__ */ __name((number) => {
|
|
33616
|
+
const stamp = sessionPrSourceAuthority(
|
|
33617
|
+
number === candidate.conventionNumber ? "worktree" : "review"
|
|
33618
|
+
);
|
|
33619
|
+
return heldSource.has(number) ? Math.max(
|
|
33620
|
+
stamp,
|
|
33621
|
+
sessionPrSourceAuthority(heldSource.get(number))
|
|
33622
|
+
) : stamp;
|
|
33623
|
+
}, "rank");
|
|
33624
|
+
const evicted = new Set(
|
|
33625
|
+
plan.map((_, index) => index).sort((a, b) => rank(plan[a]) - rank(plan[b]) || a - b).slice(0, plan.length - slots)
|
|
33626
|
+
);
|
|
33627
|
+
plan = plan.filter((_, index) => !evicted.has(index));
|
|
33457
33628
|
}
|
|
33458
33629
|
const planSet = new Set(plan);
|
|
33459
33630
|
result.alreadyBound += plan.filter(
|
|
33460
33631
|
(number) => freshNumbers.has(number)
|
|
33461
33632
|
).length;
|
|
33462
|
-
const
|
|
33463
|
-
|
|
33464
|
-
|
|
33633
|
+
const attested = /* @__PURE__ */ __name((entry) => {
|
|
33634
|
+
if (aoneRepo) {
|
|
33635
|
+
return isAoneDetailUrlForRepo(
|
|
33636
|
+
aoneRepo.repoPath,
|
|
33637
|
+
entry.number,
|
|
33638
|
+
entry.url
|
|
33639
|
+
);
|
|
33640
|
+
}
|
|
33641
|
+
const canonical = canonicalSessionPrUrl(entry.url);
|
|
33642
|
+
const resolved = numberToUrl.get(entry.number);
|
|
33643
|
+
const pageUrl = pageUrlByNumber.get(entry.number);
|
|
33644
|
+
return resolved !== void 0 && canonical === canonicalSessionPrUrl(resolved) || pageMapTrusted && pageUrl !== void 0 && canonical === canonicalSessionPrUrl(pageUrl) || remote !== void 0 && canonical === canonicalSessionPrUrl(`${remote}/pull/${entry.number}`);
|
|
33645
|
+
}, "attested");
|
|
33646
|
+
const kept = base.filter((entry) => planSet.has(entry.number) || !plannedFor(entry)).map((entry) => {
|
|
33647
|
+
if (!planSet.has(entry.number) || !attested(entry)) return entry;
|
|
33648
|
+
const stamp = entry.number === candidate.conventionNumber ? "worktree" : "review";
|
|
33649
|
+
return sessionPrSourceAuthority(stamp) > sessionPrSourceAuthority(entry.source) ? { ...entry, source: stamp } : entry;
|
|
33650
|
+
});
|
|
33465
33651
|
const additions = [];
|
|
33466
33652
|
for (const number of plan) {
|
|
33467
33653
|
if (freshNumbers.has(number)) continue;
|
|
33468
33654
|
const url = urls.get(number);
|
|
33469
33655
|
if (url === void 0) continue;
|
|
33470
33656
|
const state = states.get(number);
|
|
33657
|
+
const source = number === candidate.conventionNumber ? "worktree" : "review";
|
|
33471
33658
|
additions.push({
|
|
33472
33659
|
number,
|
|
33473
33660
|
url,
|
|
33474
33661
|
createdAt,
|
|
33475
|
-
...state !== void 0 ? { state } : {}
|
|
33662
|
+
...state !== void 0 ? { state } : {},
|
|
33663
|
+
source
|
|
33476
33664
|
});
|
|
33477
33665
|
}
|
|
33478
33666
|
added = additions.length;
|
|
@@ -33486,11 +33674,7 @@ async function backfillWorkspaceSessionPrs(runtime, fetchPullRequests = fetchGit
|
|
|
33486
33674
|
assertGenerationOpen();
|
|
33487
33675
|
runtime.bridge.setSessionPrs?.(
|
|
33488
33676
|
candidate.sessionId,
|
|
33489
|
-
fresh.map(
|
|
33490
|
-
number,
|
|
33491
|
-
url,
|
|
33492
|
-
...state ? { state } : {}
|
|
33493
|
-
}))
|
|
33677
|
+
fresh.map(toSessionPrInfo)
|
|
33494
33678
|
);
|
|
33495
33679
|
return null;
|
|
33496
33680
|
});
|
|
@@ -33531,9 +33715,14 @@ function registerSessionPrBackfillRoutes(app, deps) {
|
|
|
33531
33715
|
continue;
|
|
33532
33716
|
}
|
|
33533
33717
|
try {
|
|
33534
|
-
const result = await backfillWorkspaceSessionPrs(
|
|
33535
|
-
|
|
33536
|
-
|
|
33718
|
+
const result = await backfillWorkspaceSessionPrs(
|
|
33719
|
+
runtime,
|
|
33720
|
+
void 0,
|
|
33721
|
+
void 0,
|
|
33722
|
+
{
|
|
33723
|
+
archiveCoordinator: deps.archiveCoordinator
|
|
33724
|
+
}
|
|
33725
|
+
);
|
|
33537
33726
|
if (result.written > 0) {
|
|
33538
33727
|
runtime.generationGuard?.assertOpen();
|
|
33539
33728
|
invalidateWorkspaceSessionListCache({
|
|
@@ -33726,6 +33915,16 @@ function registerStandaloneSessionRoutes(app, deps) {
|
|
|
33726
33915
|
});
|
|
33727
33916
|
}
|
|
33728
33917
|
}, "handle");
|
|
33918
|
+
app.get(
|
|
33919
|
+
"/standalone/session-options",
|
|
33920
|
+
(req, res) => handle("GET /standalone/session-options", req, res, async () => {
|
|
33921
|
+
if (Object.keys(req.query).length > 0) {
|
|
33922
|
+
sendInvalidRequest(res, "The request query contains unknown fields.");
|
|
33923
|
+
return;
|
|
33924
|
+
}
|
|
33925
|
+
res.status(200).json(await deps.service.getOptions());
|
|
33926
|
+
})
|
|
33927
|
+
);
|
|
33729
33928
|
app.post(
|
|
33730
33929
|
"/standalone/sessions",
|
|
33731
33930
|
deps.mutate({ strict: true }),
|
|
@@ -34256,7 +34455,8 @@ async function bindAndNameSessions(bridge, boundWorkspace, tasks, renamed, spawn
|
|
|
34256
34455
|
spawnedSessionId = sessionId;
|
|
34257
34456
|
try {
|
|
34258
34457
|
bridge.updateSessionMetadata(sessionId, {
|
|
34259
|
-
displayName: scheduledTaskSessionName(task.prompt)
|
|
34458
|
+
displayName: scheduledTaskSessionName(task.prompt),
|
|
34459
|
+
titleSource: "auto"
|
|
34260
34460
|
});
|
|
34261
34461
|
renamed.add(sessionId);
|
|
34262
34462
|
} catch {
|
|
@@ -34295,7 +34495,8 @@ async function bindAndNameSessions(bridge, boundWorkspace, tasks, renamed, spawn
|
|
|
34295
34495
|
const sessionId = task.sessionId;
|
|
34296
34496
|
try {
|
|
34297
34497
|
bridge.updateSessionMetadata(sessionId, {
|
|
34298
|
-
displayName: scheduledTaskSessionName(task.prompt)
|
|
34498
|
+
displayName: scheduledTaskSessionName(task.prompt),
|
|
34499
|
+
titleSource: "auto"
|
|
34299
34500
|
});
|
|
34300
34501
|
renamed.add(sessionId);
|
|
34301
34502
|
} catch (err) {
|
|
@@ -35047,6 +35248,8 @@ function createServeFeatures(deps) {
|
|
|
35047
35248
|
workspaceRuntimeRemovalAvailable,
|
|
35048
35249
|
nativeDirectoryPickerAvailable,
|
|
35049
35250
|
workspaceRuntimeAvailable,
|
|
35251
|
+
localPathOpenAvailable,
|
|
35252
|
+
localTerminalOpenAvailable,
|
|
35050
35253
|
workspaceTrustHotReloadAvailable
|
|
35051
35254
|
} = deps;
|
|
35052
35255
|
const getEnv = deps.getEnv ?? (() => deps.env ?? process.env);
|
|
@@ -35093,6 +35296,8 @@ function createServeFeatures(deps) {
|
|
|
35093
35296
|
workspaceRuntimeRemovalAvailable,
|
|
35094
35297
|
nativeDirectoryPickerAvailable,
|
|
35095
35298
|
workspaceRuntimeAvailable: workspaceRuntimeAvailable(),
|
|
35299
|
+
localPathOpenAvailable,
|
|
35300
|
+
localTerminalOpenAvailable,
|
|
35096
35301
|
workspaceTrustHotReloadAvailable,
|
|
35097
35302
|
acpHttpEnabled: currentAcpHttpEnabled,
|
|
35098
35303
|
realtimeVoiceEnabled: realtimeVoiceEnabled(),
|
|
@@ -35616,6 +35821,53 @@ async function withMcpServerMutationLock(workspace, scope, operation) {
|
|
|
35616
35821
|
}
|
|
35617
35822
|
}
|
|
35618
35823
|
__name(withMcpServerMutationLock, "withMcpServerMutationLock");
|
|
35824
|
+
var sessionWorkflowWriteQueues = /* @__PURE__ */ new Map();
|
|
35825
|
+
async function withSessionWorkflowWriteLock(workspace, operation) {
|
|
35826
|
+
const previous = sessionWorkflowWriteQueues.get(workspace) ?? Promise.resolve();
|
|
35827
|
+
const run2 = previous.catch(() => void 0).then(operation);
|
|
35828
|
+
const tail = run2.then(
|
|
35829
|
+
() => void 0,
|
|
35830
|
+
() => void 0
|
|
35831
|
+
);
|
|
35832
|
+
sessionWorkflowWriteQueues.set(workspace, tail);
|
|
35833
|
+
try {
|
|
35834
|
+
return await run2;
|
|
35835
|
+
} finally {
|
|
35836
|
+
if (sessionWorkflowWriteQueues.get(workspace) === tail) {
|
|
35837
|
+
sessionWorkflowWriteQueues.delete(workspace);
|
|
35838
|
+
}
|
|
35839
|
+
}
|
|
35840
|
+
}
|
|
35841
|
+
__name(withSessionWorkflowWriteLock, "withSessionWorkflowWriteLock");
|
|
35842
|
+
function readEffectiveSessionWorkflow(boundWorkspace, workspaceTrusted) {
|
|
35843
|
+
const loaded = loadSettings(boundWorkspace, {
|
|
35844
|
+
skipLoadEnvironment: true,
|
|
35845
|
+
skipWorkspaceSettings: !workspaceTrusted,
|
|
35846
|
+
workspaceTrusted
|
|
35847
|
+
});
|
|
35848
|
+
return getNestedProperty(
|
|
35849
|
+
loaded.merged,
|
|
35850
|
+
"experimental.sessionWorkflow"
|
|
35851
|
+
) === true;
|
|
35852
|
+
}
|
|
35853
|
+
__name(readEffectiveSessionWorkflow, "readEffectiveSessionWorkflow");
|
|
35854
|
+
async function updateLiveSessionWorkflow(update, enabled, workspace, res) {
|
|
35855
|
+
try {
|
|
35856
|
+
await update(enabled);
|
|
35857
|
+
return true;
|
|
35858
|
+
} catch (err) {
|
|
35859
|
+
if (err instanceof SessionNotFoundError) return true;
|
|
35860
|
+
writeStderrLine(
|
|
35861
|
+
`qwen serve: failed to update the live Session Workflow setting for ${workspace}: ${err instanceof Error ? err.message : String(err)}`
|
|
35862
|
+
);
|
|
35863
|
+
res.status(500).json({
|
|
35864
|
+
error: "Failed to update the live Session Workflow setting",
|
|
35865
|
+
code: "runtime_update_error"
|
|
35866
|
+
});
|
|
35867
|
+
return false;
|
|
35868
|
+
}
|
|
35869
|
+
}
|
|
35870
|
+
__name(updateLiveSessionWorkflow, "updateLiveSessionWorkflow");
|
|
35619
35871
|
function registerWorkspaceSettingsRoutes(app, deps) {
|
|
35620
35872
|
const {
|
|
35621
35873
|
boundWorkspace,
|
|
@@ -35741,60 +35993,92 @@ function registerWorkspaceSettingsRoutes(app, deps) {
|
|
|
35741
35993
|
return;
|
|
35742
35994
|
}
|
|
35743
35995
|
let publicValue = value;
|
|
35744
|
-
|
|
35745
|
-
|
|
35746
|
-
const
|
|
35747
|
-
|
|
35748
|
-
settingScope,
|
|
35749
|
-
key,
|
|
35750
|
-
value,
|
|
35751
|
-
mcpServerMutation,
|
|
35752
|
-
deps.isWorkspaceTrusted?.() ?? true
|
|
35753
|
-
);
|
|
35754
|
-
publicValue = prepared.publicValue;
|
|
35755
|
-
if (deps.captureGenerationAssertion) {
|
|
35756
|
-
await persistSetting(
|
|
35996
|
+
const persistAndPushSessionWorkflow = /* @__PURE__ */ __name(async () => {
|
|
35997
|
+
try {
|
|
35998
|
+
const persist = /* @__PURE__ */ __name(async () => {
|
|
35999
|
+
const prepared = prepareSettingWrite(
|
|
35757
36000
|
boundWorkspace,
|
|
35758
36001
|
settingScope,
|
|
35759
36002
|
key,
|
|
35760
|
-
|
|
35761
|
-
|
|
36003
|
+
value,
|
|
36004
|
+
mcpServerMutation,
|
|
36005
|
+
deps.isWorkspaceTrusted?.() ?? true
|
|
35762
36006
|
);
|
|
35763
|
-
|
|
35764
|
-
|
|
36007
|
+
publicValue = prepared.publicValue;
|
|
36008
|
+
if (deps.captureGenerationAssertion) {
|
|
36009
|
+
await persistSetting(
|
|
36010
|
+
boundWorkspace,
|
|
36011
|
+
settingScope,
|
|
36012
|
+
key,
|
|
36013
|
+
prepared.persistedValue,
|
|
36014
|
+
assertGenerationOpen
|
|
36015
|
+
);
|
|
36016
|
+
} else {
|
|
36017
|
+
await persistSetting(
|
|
36018
|
+
boundWorkspace,
|
|
36019
|
+
settingScope,
|
|
36020
|
+
key,
|
|
36021
|
+
prepared.persistedValue
|
|
36022
|
+
);
|
|
36023
|
+
}
|
|
36024
|
+
}, "persist");
|
|
36025
|
+
if (mcpServerMutation) {
|
|
36026
|
+
await withMcpServerMutationLock(
|
|
35765
36027
|
boundWorkspace,
|
|
35766
36028
|
settingScope,
|
|
35767
|
-
|
|
35768
|
-
prepared.persistedValue
|
|
36029
|
+
persist
|
|
35769
36030
|
);
|
|
36031
|
+
} else {
|
|
36032
|
+
await persist();
|
|
35770
36033
|
}
|
|
35771
|
-
}
|
|
35772
|
-
|
|
35773
|
-
|
|
36034
|
+
} catch (err) {
|
|
36035
|
+
if (sendGenerationClosedError(res, err)) return "unchanged_failure";
|
|
36036
|
+
writeStderrLine(
|
|
36037
|
+
`qwen serve: POST /workspace/settings persist error (key=${key}, scope=${scope}, workspace=${boundWorkspace}): ${err instanceof Error ? err.message : String(err)}`
|
|
36038
|
+
);
|
|
36039
|
+
res.status(500).json({
|
|
36040
|
+
error: "Failed to persist setting",
|
|
36041
|
+
code: "persist_error"
|
|
36042
|
+
});
|
|
36043
|
+
return "unchanged_failure";
|
|
36044
|
+
}
|
|
36045
|
+
try {
|
|
36046
|
+
assertGenerationOpen();
|
|
36047
|
+
} catch (err) {
|
|
36048
|
+
if (sendGenerationClosedError(res, err)) return "unchanged_failure";
|
|
36049
|
+
throw err;
|
|
36050
|
+
}
|
|
36051
|
+
if (key === "experimental.sessionWorkflow") {
|
|
36052
|
+
const livePushSucceeded = await updateLiveSessionWorkflow(
|
|
36053
|
+
deps.updateSessionWorkflow,
|
|
36054
|
+
readEffectiveSessionWorkflow(
|
|
36055
|
+
boundWorkspace,
|
|
36056
|
+
deps.isWorkspaceTrusted?.() ?? true
|
|
36057
|
+
),
|
|
35774
36058
|
boundWorkspace,
|
|
35775
|
-
|
|
35776
|
-
persist
|
|
36059
|
+
res
|
|
35777
36060
|
);
|
|
35778
|
-
|
|
35779
|
-
|
|
36061
|
+
if (settingScope === "User" /* User */) {
|
|
36062
|
+
await deps.updateSiblingSessionWorkflows?.();
|
|
36063
|
+
}
|
|
36064
|
+
if (!livePushSucceeded) {
|
|
36065
|
+
return "disk_changed_push_failed";
|
|
36066
|
+
}
|
|
36067
|
+
try {
|
|
36068
|
+
assertGenerationOpen();
|
|
36069
|
+
} catch (err) {
|
|
36070
|
+
if (sendGenerationClosedError(res, err))
|
|
36071
|
+
return "unchanged_failure";
|
|
36072
|
+
throw err;
|
|
36073
|
+
}
|
|
35780
36074
|
}
|
|
35781
|
-
|
|
35782
|
-
|
|
35783
|
-
|
|
35784
|
-
|
|
35785
|
-
|
|
35786
|
-
|
|
35787
|
-
|
|
35788
|
-
code: "persist_error"
|
|
35789
|
-
});
|
|
35790
|
-
return;
|
|
35791
|
-
}
|
|
35792
|
-
try {
|
|
35793
|
-
assertGenerationOpen();
|
|
35794
|
-
} catch (err) {
|
|
35795
|
-
if (sendGenerationClosedError(res, err)) return;
|
|
35796
|
-
throw err;
|
|
35797
|
-
}
|
|
36075
|
+
return "ok";
|
|
36076
|
+
}, "persistAndPushSessionWorkflow");
|
|
36077
|
+
const writeOutcome = key === "experimental.sessionWorkflow" ? await withSessionWorkflowWriteLock(
|
|
36078
|
+
boundWorkspace,
|
|
36079
|
+
persistAndPushSessionWorkflow
|
|
36080
|
+
) : await persistAndPushSessionWorkflow();
|
|
36081
|
+
if (writeOutcome === "unchanged_failure") return;
|
|
35798
36082
|
try {
|
|
35799
36083
|
broadcastSettingsChanged(key, publicValue, scope, clientId);
|
|
35800
36084
|
} catch (err) {
|
|
@@ -35802,6 +36086,7 @@ function registerWorkspaceSettingsRoutes(app, deps) {
|
|
|
35802
36086
|
`qwen serve: POST /workspace/settings broadcast error (key=${key}, scope=${scope}): ${err instanceof Error ? err.message : String(err)}`
|
|
35803
36087
|
);
|
|
35804
36088
|
}
|
|
36089
|
+
if (writeOutcome !== "ok") return;
|
|
35805
36090
|
res.status(200).json({
|
|
35806
36091
|
key,
|
|
35807
36092
|
scope,
|
|
@@ -35929,57 +36214,90 @@ function registerWorkspaceQualifiedSettingsRoutes(app, deps) {
|
|
|
35929
36214
|
return;
|
|
35930
36215
|
}
|
|
35931
36216
|
let publicValue = value;
|
|
35932
|
-
|
|
35933
|
-
|
|
35934
|
-
const
|
|
35935
|
-
|
|
35936
|
-
|
|
35937
|
-
|
|
35938
|
-
|
|
35939
|
-
|
|
35940
|
-
|
|
35941
|
-
|
|
35942
|
-
|
|
35943
|
-
|
|
35944
|
-
|
|
35945
|
-
|
|
35946
|
-
|
|
35947
|
-
|
|
35948
|
-
|
|
36217
|
+
const persistAndPushSessionWorkflow = /* @__PURE__ */ __name(async () => {
|
|
36218
|
+
try {
|
|
36219
|
+
const persist = /* @__PURE__ */ __name(async () => {
|
|
36220
|
+
const prepared = prepareSettingWrite(
|
|
36221
|
+
runtime.workspaceCwd,
|
|
36222
|
+
settingScope,
|
|
36223
|
+
key,
|
|
36224
|
+
value,
|
|
36225
|
+
mcpServerMutation,
|
|
36226
|
+
true
|
|
36227
|
+
);
|
|
36228
|
+
publicValue = prepared.publicValue;
|
|
36229
|
+
await deps.persistSetting(
|
|
36230
|
+
runtime.workspaceCwd,
|
|
36231
|
+
settingScope,
|
|
36232
|
+
key,
|
|
36233
|
+
prepared.persistedValue,
|
|
36234
|
+
assertGenerationOpen
|
|
36235
|
+
);
|
|
36236
|
+
}, "persist");
|
|
36237
|
+
if (mcpServerMutation) {
|
|
36238
|
+
await withMcpServerMutationLock(
|
|
36239
|
+
runtime.workspaceCwd,
|
|
36240
|
+
settingScope,
|
|
36241
|
+
persist
|
|
36242
|
+
);
|
|
36243
|
+
} else {
|
|
36244
|
+
await persist();
|
|
36245
|
+
}
|
|
36246
|
+
} catch (err) {
|
|
36247
|
+
if (sendGenerationClosedError(res, err)) return "unchanged_failure";
|
|
36248
|
+
writeStderrLine(
|
|
36249
|
+
`qwen serve: POST /workspaces/:workspace/settings persist error (key=${key}, scope=${scope}, workspace=${runtime.workspaceCwd}): ${err instanceof Error ? err.message : String(err)}`
|
|
35949
36250
|
);
|
|
35950
|
-
|
|
35951
|
-
|
|
35952
|
-
|
|
36251
|
+
res.status(500).json({
|
|
36252
|
+
error: "Failed to persist setting",
|
|
36253
|
+
code: "persist_error"
|
|
36254
|
+
});
|
|
36255
|
+
return "unchanged_failure";
|
|
36256
|
+
}
|
|
36257
|
+
try {
|
|
36258
|
+
assertGenerationOpen();
|
|
36259
|
+
} catch (err) {
|
|
36260
|
+
if (sendGenerationClosedError(res, err)) return "unchanged_failure";
|
|
36261
|
+
throw err;
|
|
36262
|
+
}
|
|
36263
|
+
if (key === "experimental.sessionWorkflow") {
|
|
36264
|
+
if (!await updateLiveSessionWorkflow(
|
|
36265
|
+
(enabled) => runtime.bridge.invokeWorkspaceCommand(
|
|
36266
|
+
SERVE_CONTROL_EXT_METHODS.workspaceSessionWorkflow,
|
|
36267
|
+
{ enabled }
|
|
36268
|
+
),
|
|
36269
|
+
// Push the post-write effective value, not the raw write: a
|
|
36270
|
+
// system-scope (fleet) settings file shadows a workspace write in
|
|
36271
|
+
// mergeSettings, so even on this workspace-only route the written
|
|
36272
|
+
// value is not necessarily the effective one.
|
|
36273
|
+
readEffectiveSessionWorkflow(runtime.workspaceCwd, true),
|
|
35953
36274
|
runtime.workspaceCwd,
|
|
35954
|
-
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
35958
|
-
|
|
36275
|
+
res
|
|
36276
|
+
)) {
|
|
36277
|
+
return "disk_changed_push_failed";
|
|
36278
|
+
}
|
|
36279
|
+
try {
|
|
36280
|
+
assertGenerationOpen();
|
|
36281
|
+
} catch (err) {
|
|
36282
|
+
if (sendGenerationClosedError(res, err))
|
|
36283
|
+
return "unchanged_failure";
|
|
36284
|
+
throw err;
|
|
36285
|
+
}
|
|
35959
36286
|
}
|
|
35960
|
-
|
|
35961
|
-
|
|
35962
|
-
|
|
35963
|
-
|
|
35964
|
-
|
|
35965
|
-
|
|
35966
|
-
|
|
35967
|
-
code: "persist_error"
|
|
35968
|
-
});
|
|
35969
|
-
return;
|
|
35970
|
-
}
|
|
35971
|
-
try {
|
|
35972
|
-
assertGenerationOpen();
|
|
35973
|
-
} catch (err) {
|
|
35974
|
-
if (sendGenerationClosedError(res, err)) return;
|
|
35975
|
-
throw err;
|
|
35976
|
-
}
|
|
36287
|
+
return "ok";
|
|
36288
|
+
}, "persistAndPushSessionWorkflow");
|
|
36289
|
+
const writeOutcome = key === "experimental.sessionWorkflow" ? await withSessionWorkflowWriteLock(
|
|
36290
|
+
runtime.workspaceCwd,
|
|
36291
|
+
persistAndPushSessionWorkflow
|
|
36292
|
+
) : await persistAndPushSessionWorkflow();
|
|
36293
|
+
if (writeOutcome === "unchanged_failure") return;
|
|
35977
36294
|
deps.invalidateServeFeaturesCache();
|
|
35978
36295
|
runtime.bridge.publishWorkspaceEvent({
|
|
35979
36296
|
type: "settings_changed",
|
|
35980
36297
|
data: { key, value: publicValue, scope },
|
|
35981
36298
|
...clientId ? { originatorClientId: clientId } : {}
|
|
35982
36299
|
});
|
|
36300
|
+
if (writeOutcome !== "ok") return;
|
|
35983
36301
|
res.status(200).json({
|
|
35984
36302
|
key,
|
|
35985
36303
|
scope,
|
|
@@ -35991,6 +36309,115 @@ function registerWorkspaceQualifiedSettingsRoutes(app, deps) {
|
|
|
35991
36309
|
}
|
|
35992
36310
|
__name(registerWorkspaceQualifiedSettingsRoutes, "registerWorkspaceQualifiedSettingsRoutes");
|
|
35993
36311
|
|
|
36312
|
+
// packages/cli/src/serve/routes/user-language.ts
|
|
36313
|
+
init_esbuild_shims();
|
|
36314
|
+
function registerUserLanguageRoutes(app, deps) {
|
|
36315
|
+
app.post("/language", deps.mutate(), async (req, res) => {
|
|
36316
|
+
const body = deps.safeBody(req);
|
|
36317
|
+
const language = body["language"];
|
|
36318
|
+
const syncOutputLanguage = body["syncOutputLanguage"];
|
|
36319
|
+
if (typeof language !== "string" || !deps.languageCodes.includes(language)) {
|
|
36320
|
+
res.status(400).json({
|
|
36321
|
+
error: "`language` is required and must be one of: " + deps.languageCodes.join(", "),
|
|
36322
|
+
code: "invalid_language",
|
|
36323
|
+
allowed: deps.languageCodes
|
|
36324
|
+
});
|
|
36325
|
+
return;
|
|
36326
|
+
}
|
|
36327
|
+
if (syncOutputLanguage !== void 0 && typeof syncOutputLanguage !== "boolean") {
|
|
36328
|
+
res.status(400).json({
|
|
36329
|
+
error: "`syncOutputLanguage` must be a boolean when provided",
|
|
36330
|
+
code: "invalid_sync_flag"
|
|
36331
|
+
});
|
|
36332
|
+
return;
|
|
36333
|
+
}
|
|
36334
|
+
const clientId = deps.parseAndValidateClientId(req, res);
|
|
36335
|
+
if (clientId === null) return;
|
|
36336
|
+
let outputLanguage = null;
|
|
36337
|
+
try {
|
|
36338
|
+
await deps.persistSetting(
|
|
36339
|
+
deps.boundWorkspace,
|
|
36340
|
+
"User" /* User */,
|
|
36341
|
+
"general.language",
|
|
36342
|
+
language
|
|
36343
|
+
);
|
|
36344
|
+
if (syncOutputLanguage === true) {
|
|
36345
|
+
const settingValue = resolveOutputLanguageOrPreserveAuto(language);
|
|
36346
|
+
updateOutputLanguageFile(settingValue);
|
|
36347
|
+
await deps.persistSetting(
|
|
36348
|
+
deps.boundWorkspace,
|
|
36349
|
+
"User" /* User */,
|
|
36350
|
+
"general.outputLanguage",
|
|
36351
|
+
settingValue
|
|
36352
|
+
);
|
|
36353
|
+
outputLanguage = settingValue;
|
|
36354
|
+
}
|
|
36355
|
+
} catch (err) {
|
|
36356
|
+
writeStderrLine(
|
|
36357
|
+
`qwen serve: POST /language persist error: ${err instanceof Error ? err.message : String(err)}`
|
|
36358
|
+
);
|
|
36359
|
+
res.status(500).json({
|
|
36360
|
+
error: "Failed to persist language settings",
|
|
36361
|
+
code: "persist_error"
|
|
36362
|
+
});
|
|
36363
|
+
return;
|
|
36364
|
+
}
|
|
36365
|
+
try {
|
|
36366
|
+
await setLanguageAsync(language);
|
|
36367
|
+
} catch (err) {
|
|
36368
|
+
writeStderrLine(
|
|
36369
|
+
`qwen serve: POST /language daemon i18n switch failed: ${err instanceof Error ? err.message : String(err)}`
|
|
36370
|
+
);
|
|
36371
|
+
}
|
|
36372
|
+
const resolvedLanguage = getCurrentLanguage();
|
|
36373
|
+
const sync = syncOutputLanguage === true;
|
|
36374
|
+
const runtimes = deps.workspaceRegistry.list().filter((r) => r.trusted);
|
|
36375
|
+
const results = await Promise.allSettled(
|
|
36376
|
+
runtimes.map(
|
|
36377
|
+
(runtime) => runtime.bridge.setUserLanguage({
|
|
36378
|
+
language,
|
|
36379
|
+
syncOutputLanguage: sync
|
|
36380
|
+
})
|
|
36381
|
+
)
|
|
36382
|
+
);
|
|
36383
|
+
let refreshedRuntimes = 0;
|
|
36384
|
+
let sessions = 0;
|
|
36385
|
+
let failed = 0;
|
|
36386
|
+
results.forEach((result, index) => {
|
|
36387
|
+
if (result.status === "fulfilled") {
|
|
36388
|
+
refreshedRuntimes += 1;
|
|
36389
|
+
sessions += result.value.sessions;
|
|
36390
|
+
failed += result.value.failed;
|
|
36391
|
+
return;
|
|
36392
|
+
}
|
|
36393
|
+
if (result.reason instanceof SessionNotFoundError) return;
|
|
36394
|
+
failed += 1;
|
|
36395
|
+
writeStderrLine(
|
|
36396
|
+
`qwen serve: POST /language fan-out failed for workspace ${runtimes[index]?.workspaceCwd}: ${result.reason instanceof Error ? result.reason.message : String(result.reason)}`
|
|
36397
|
+
);
|
|
36398
|
+
});
|
|
36399
|
+
for (const runtime of deps.workspaceRegistry.list()) {
|
|
36400
|
+
try {
|
|
36401
|
+
runtime.bridge.publishWorkspaceEvent({
|
|
36402
|
+
type: "language_changed",
|
|
36403
|
+
data: { language: resolvedLanguage, outputLanguage, userLevel: true },
|
|
36404
|
+
...clientId ? { originatorClientId: clientId } : {}
|
|
36405
|
+
});
|
|
36406
|
+
} catch (err) {
|
|
36407
|
+
writeStderrLine(
|
|
36408
|
+
`qwen serve: POST /language event publish failed for workspace ${runtime.workspaceCwd}: ${err instanceof Error ? err.message : String(err)}`
|
|
36409
|
+
);
|
|
36410
|
+
}
|
|
36411
|
+
}
|
|
36412
|
+
res.status(200).json({
|
|
36413
|
+
language: resolvedLanguage,
|
|
36414
|
+
outputLanguage,
|
|
36415
|
+
refresh: { runtimes: refreshedRuntimes, sessions, failed }
|
|
36416
|
+
});
|
|
36417
|
+
});
|
|
36418
|
+
}
|
|
36419
|
+
__name(registerUserLanguageRoutes, "registerUserLanguageRoutes");
|
|
36420
|
+
|
|
35994
36421
|
// packages/cli/src/serve/routes/sse-events.ts
|
|
35995
36422
|
init_esbuild_shims();
|
|
35996
36423
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
@@ -36047,7 +36474,7 @@ var SESSION_WRITER_ERROR_MESSAGES = {
|
|
|
36047
36474
|
function bridgeErrorExtraContext(ctx) {
|
|
36048
36475
|
const extra = {};
|
|
36049
36476
|
for (const [key, value] of Object.entries(ctx ?? {})) {
|
|
36050
|
-
if (key === "route" || key === "sessionId" || value === void 0) {
|
|
36477
|
+
if (key === "route" || key === "sessionId" || key === "initPrecedesMutations" || value === void 0) {
|
|
36051
36478
|
continue;
|
|
36052
36479
|
}
|
|
36053
36480
|
extra[key] = value;
|
|
@@ -36115,6 +36542,30 @@ function sendPermissionVoteError(res, err, ctx, daemonLog) {
|
|
|
36115
36542
|
}
|
|
36116
36543
|
__name(sendPermissionVoteError, "sendPermissionVoteError");
|
|
36117
36544
|
function sendBridgeError(res, err, ctx, daemonLog) {
|
|
36545
|
+
if (err instanceof BridgeTimeoutError && err.label === "initialize") {
|
|
36546
|
+
recordExpectedBridgeError(err, ctx, daemonLog);
|
|
36547
|
+
if (ctx?.initPrecedesMutations === true) {
|
|
36548
|
+
res.set("Retry-After", "5");
|
|
36549
|
+
res.status(504).json({
|
|
36550
|
+
error: err.message,
|
|
36551
|
+
code: "init_timeout",
|
|
36552
|
+
errorKind: "init_timeout",
|
|
36553
|
+
retryable: true,
|
|
36554
|
+
sideEffectPossible: false,
|
|
36555
|
+
phase: "channel.initialize",
|
|
36556
|
+
timeoutMs: err.timeoutMs
|
|
36557
|
+
});
|
|
36558
|
+
return;
|
|
36559
|
+
}
|
|
36560
|
+
res.status(504).json({
|
|
36561
|
+
error: err.message,
|
|
36562
|
+
code: "init_timeout",
|
|
36563
|
+
errorKind: "init_timeout",
|
|
36564
|
+
phase: "channel.initialize",
|
|
36565
|
+
timeoutMs: err.timeoutMs
|
|
36566
|
+
});
|
|
36567
|
+
return;
|
|
36568
|
+
}
|
|
36118
36569
|
if (err instanceof SessionRestoreTimeoutError) {
|
|
36119
36570
|
recordExpectedBridgeError(err, ctx, daemonLog);
|
|
36120
36571
|
res.set("Retry-After", String(restoreRetryAfterSeconds(err.timeoutMs)));
|
|
@@ -36301,6 +36752,13 @@ function sendBridgeError(res, err, ctx, daemonLog) {
|
|
|
36301
36752
|
});
|
|
36302
36753
|
return;
|
|
36303
36754
|
}
|
|
36755
|
+
if (err instanceof McpAuthenticationInProgressError) {
|
|
36756
|
+
res.status(409).json({
|
|
36757
|
+
error: err.message,
|
|
36758
|
+
code: "mcp_authentication_in_progress"
|
|
36759
|
+
});
|
|
36760
|
+
return;
|
|
36761
|
+
}
|
|
36304
36762
|
if (err instanceof McpServerNotFoundError) {
|
|
36305
36763
|
res.status(404).json({
|
|
36306
36764
|
error: err.message,
|
|
@@ -38490,6 +38948,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38490
38948
|
});
|
|
38491
38949
|
}, "isReservedWorkspacePath");
|
|
38492
38950
|
const inFlight = /* @__PURE__ */ new Map();
|
|
38951
|
+
const internalAdditionsInFlight = /* @__PURE__ */ new Set();
|
|
38493
38952
|
let sealed = false;
|
|
38494
38953
|
let activeOperations = 0;
|
|
38495
38954
|
let pendingScratchCreations = 0;
|
|
@@ -38536,10 +38995,12 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38536
38995
|
}, "restorePersistedDisplayName");
|
|
38537
38996
|
const projectedWorkspaceCount = /* @__PURE__ */ __name(() => {
|
|
38538
38997
|
const cwdSet = new Set(
|
|
38539
|
-
workspaceRegistry.listManaged().map((runtime) => runtime.workspaceCwd)
|
|
38998
|
+
workspaceRegistry.listManaged().filter((runtime) => !isInternalWorkspaceRuntime(runtime)).map((runtime) => runtime.workspaceCwd)
|
|
38540
38999
|
);
|
|
38541
39000
|
for (const [cwd, operation] of inFlight) {
|
|
38542
|
-
if (operation === "addition"
|
|
39001
|
+
if (operation === "addition" && !internalAdditionsInFlight.has(cwd)) {
|
|
39002
|
+
cwdSet.add(cwd);
|
|
39003
|
+
}
|
|
38543
39004
|
}
|
|
38544
39005
|
return cwdSet.size + pendingScratchCreations;
|
|
38545
39006
|
}, "projectedWorkspaceCount");
|
|
@@ -38569,7 +39030,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38569
39030
|
if (nestingConflict) {
|
|
38570
39031
|
throw new Error("Workspace path nests with an existing workspace");
|
|
38571
39032
|
}
|
|
38572
|
-
if (projectedWorkspaceCount() >= MAX_REGISTERED_WORKSPACES) {
|
|
39033
|
+
if (provenance !== "live-conversation" && projectedWorkspaceCount() >= MAX_REGISTERED_WORKSPACES) {
|
|
38573
39034
|
throw new Error("Workspace registration limit reached");
|
|
38574
39035
|
}
|
|
38575
39036
|
}, "assertOwnedRuntimeAdmission");
|
|
@@ -38579,6 +39040,9 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38579
39040
|
}
|
|
38580
39041
|
assertOwnedRuntimeAdmission(canonicalCwd, provenance);
|
|
38581
39042
|
inFlight.set(canonicalCwd, "addition");
|
|
39043
|
+
if (provenance === "live-conversation") {
|
|
39044
|
+
internalAdditionsInFlight.add(canonicalCwd);
|
|
39045
|
+
}
|
|
38582
39046
|
operationStarted();
|
|
38583
39047
|
let runtime;
|
|
38584
39048
|
let registered = false;
|
|
@@ -38601,7 +39065,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38601
39065
|
if (nestingConflict) {
|
|
38602
39066
|
throw new Error("Workspace path nests with an existing workspace");
|
|
38603
39067
|
}
|
|
38604
|
-
if (projectedWorkspaceCount() >= MAX_REGISTERED_WORKSPACES) {
|
|
39068
|
+
if (provenance !== "live-conversation" && projectedWorkspaceCount() >= MAX_REGISTERED_WORKSPACES) {
|
|
38605
39069
|
throw new Error("Workspace registration limit reached");
|
|
38606
39070
|
}
|
|
38607
39071
|
workspaceRegistry.add(runtime);
|
|
@@ -38633,6 +39097,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
38633
39097
|
});
|
|
38634
39098
|
}
|
|
38635
39099
|
inFlight.delete(canonicalCwd);
|
|
39100
|
+
internalAdditionsInFlight.delete(canonicalCwd);
|
|
38636
39101
|
operationFinished();
|
|
38637
39102
|
}
|
|
38638
39103
|
}, "publishOwnedRuntime");
|
|
@@ -40278,6 +40743,19 @@ __name(registerWorkspaceQualifiedGitLogRoutes, "registerWorkspaceQualifiedGitLog
|
|
|
40278
40743
|
// packages/cli/src/serve/routes/workspace-git-branches.ts
|
|
40279
40744
|
init_esbuild_shims();
|
|
40280
40745
|
var GIT_ERROR_MESSAGE_MAX = 512;
|
|
40746
|
+
function redactGitPaths(detail, cwd) {
|
|
40747
|
+
const gitRoot = findGitRoot(cwd);
|
|
40748
|
+
let message = detail.split(cwd).join("<workspace>");
|
|
40749
|
+
if (gitRoot && gitRoot !== cwd) {
|
|
40750
|
+
message = message.split(gitRoot).join("<workspace>");
|
|
40751
|
+
}
|
|
40752
|
+
return message;
|
|
40753
|
+
}
|
|
40754
|
+
__name(redactGitPaths, "redactGitPaths");
|
|
40755
|
+
function redactGitMessage(detail, cwd) {
|
|
40756
|
+
return redactGitPaths(detail, cwd).slice(0, GIT_ERROR_MESSAGE_MAX);
|
|
40757
|
+
}
|
|
40758
|
+
__name(redactGitMessage, "redactGitMessage");
|
|
40281
40759
|
function sendGitError(res, err, route, sendBridgeError2, cwd) {
|
|
40282
40760
|
let detail;
|
|
40283
40761
|
if (err && typeof err === "object" && ("stdout" in err || "stderr" in err)) {
|
|
@@ -40287,12 +40765,7 @@ ${e.stderr ?? ""}`;
|
|
|
40287
40765
|
} else {
|
|
40288
40766
|
detail = err instanceof Error ? err.message : String(err);
|
|
40289
40767
|
}
|
|
40290
|
-
const
|
|
40291
|
-
let message = detail.split(cwd).join("<workspace>");
|
|
40292
|
-
if (gitRoot && gitRoot !== cwd) {
|
|
40293
|
-
message = message.split(gitRoot).join("<workspace>");
|
|
40294
|
-
}
|
|
40295
|
-
message = message.slice(0, GIT_ERROR_MESSAGE_MAX);
|
|
40768
|
+
const message = redactGitMessage(detail, cwd);
|
|
40296
40769
|
if (/not a git repository/i.test(message) || /invalid reference/i.test(message)) {
|
|
40297
40770
|
res.status(404).json({ error: "not_a_git_repository", message });
|
|
40298
40771
|
return;
|
|
@@ -40425,12 +40898,40 @@ async function handlePull(req, res, cwd, sendBridgeError2, route, env) {
|
|
|
40425
40898
|
});
|
|
40426
40899
|
return;
|
|
40427
40900
|
}
|
|
40901
|
+
if (body["stash"] !== void 0 && typeof body["stash"] !== "boolean") {
|
|
40902
|
+
res.status(400).json({ error: "invalid_stash", message: "stash must be a boolean" });
|
|
40903
|
+
return;
|
|
40904
|
+
}
|
|
40905
|
+
if (body["force"] !== void 0 && typeof body["force"] !== "boolean") {
|
|
40906
|
+
res.status(400).json({ error: "invalid_force", message: "force must be a boolean" });
|
|
40907
|
+
return;
|
|
40908
|
+
}
|
|
40428
40909
|
const rebase = body["rebase"] === true;
|
|
40429
40910
|
const fetchOnly = body["fetchOnly"] === true;
|
|
40911
|
+
const stash = body["stash"] === true;
|
|
40912
|
+
const force = body["force"] === true;
|
|
40913
|
+
if (stash && force) {
|
|
40914
|
+
res.status(400).json({
|
|
40915
|
+
error: "invalid_stash_force",
|
|
40916
|
+
message: "stash and force are mutually exclusive"
|
|
40917
|
+
});
|
|
40918
|
+
return;
|
|
40919
|
+
}
|
|
40920
|
+
if (fetchOnly && (stash || force)) {
|
|
40921
|
+
res.status(400).json({
|
|
40922
|
+
error: "invalid_fetch_only_combination",
|
|
40923
|
+
message: "fetchOnly cannot be combined with stash or force"
|
|
40924
|
+
});
|
|
40925
|
+
return;
|
|
40926
|
+
}
|
|
40430
40927
|
try {
|
|
40431
|
-
const result = await gitPull(cwd, { rebase, fetchOnly }, env);
|
|
40432
|
-
res.status(200).json(result);
|
|
40928
|
+
const result = await gitPull(cwd, { rebase, fetchOnly, stash, force }, env);
|
|
40929
|
+
res.status(200).json({ ...result, output: redactGitPaths(result.output, cwd) });
|
|
40433
40930
|
} catch (err) {
|
|
40931
|
+
if (err instanceof GitPullFailure) {
|
|
40932
|
+
res.status(409).json({ error: err.code, message: redactGitMessage(err.message, cwd) });
|
|
40933
|
+
return;
|
|
40934
|
+
}
|
|
40434
40935
|
sendGitError(res, err, route, sendBridgeError2, cwd);
|
|
40435
40936
|
}
|
|
40436
40937
|
}
|
|
@@ -40968,6 +41469,46 @@ function registerWorkspaceQualifiedGitHubPrsRoutes(app, deps) {
|
|
|
40968
41469
|
}
|
|
40969
41470
|
__name(registerWorkspaceQualifiedGitHubPrsRoutes, "registerWorkspaceQualifiedGitHubPrsRoutes");
|
|
40970
41471
|
|
|
41472
|
+
// packages/cli/src/serve/routes/workspace-local-open.ts
|
|
41473
|
+
init_esbuild_shims();
|
|
41474
|
+
function registerWorkspaceLocalOpenRoutes(app, deps) {
|
|
41475
|
+
const openLocally = deps.openPathLocally ?? openPathLocally;
|
|
41476
|
+
const openTerminal = deps.openTerminalLocally ?? openTerminalLocally;
|
|
41477
|
+
app.post(
|
|
41478
|
+
"/workspaces/:workspace/open",
|
|
41479
|
+
deps.mutate(),
|
|
41480
|
+
async (req, res) => {
|
|
41481
|
+
const runtime = resolveTrustedRuntime(deps.workspaceRegistry, req, res);
|
|
41482
|
+
if (!runtime) return;
|
|
41483
|
+
const target = safeBody(req)["target"] === "terminal" ? "terminal" : "folder";
|
|
41484
|
+
try {
|
|
41485
|
+
if (target === "terminal") {
|
|
41486
|
+
await openTerminal(runtime.workspaceCwd);
|
|
41487
|
+
} else {
|
|
41488
|
+
await openLocally(runtime.workspaceCwd);
|
|
41489
|
+
}
|
|
41490
|
+
res.status(200).json({ kind: "workspace-local-open", opened: true, target });
|
|
41491
|
+
} catch (error2) {
|
|
41492
|
+
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
41493
|
+
if (error2 instanceof LocalPathOpenUnavailableError) {
|
|
41494
|
+
writeStderrLine(`qwen serve: local path open unavailable: ${detail}`);
|
|
41495
|
+
res.status(501).json({
|
|
41496
|
+
error: "Local path open is unavailable",
|
|
41497
|
+
code: "local_path_open_unavailable"
|
|
41498
|
+
});
|
|
41499
|
+
return;
|
|
41500
|
+
}
|
|
41501
|
+
writeStderrLine(`qwen serve: local path open failed: ${detail}`);
|
|
41502
|
+
res.status(500).json({
|
|
41503
|
+
error: "Failed to open workspace locally",
|
|
41504
|
+
code: "local_path_open_failed"
|
|
41505
|
+
});
|
|
41506
|
+
}
|
|
41507
|
+
}
|
|
41508
|
+
);
|
|
41509
|
+
}
|
|
41510
|
+
__name(registerWorkspaceLocalOpenRoutes, "registerWorkspaceLocalOpenRoutes");
|
|
41511
|
+
|
|
40971
41512
|
// packages/cli/src/serve/workspace-git-state.ts
|
|
40972
41513
|
init_esbuild_shims();
|
|
40973
41514
|
var BACKGROUND_REFRESH_THROTTLE_MS = 2e3;
|
|
@@ -41675,6 +42216,583 @@ function registerWorkspaceQualifiedMcpControlRoutes(app, deps) {
|
|
|
41675
42216
|
}
|
|
41676
42217
|
__name(registerWorkspaceQualifiedMcpControlRoutes, "registerWorkspaceQualifiedMcpControlRoutes");
|
|
41677
42218
|
|
|
42219
|
+
// packages/cli/src/serve/routes/workspace-mcp-config.ts
|
|
42220
|
+
init_esbuild_shims();
|
|
42221
|
+
function asRecord4(value) {
|
|
42222
|
+
return value && typeof value === "object" && !Array.isArray(value) ? redactMcpServersSetting(value) : {};
|
|
42223
|
+
}
|
|
42224
|
+
__name(asRecord4, "asRecord");
|
|
42225
|
+
function buildMcpConfigStatus(workspaceCwd) {
|
|
42226
|
+
const settings = loadSettings(workspaceCwd, {
|
|
42227
|
+
skipLoadEnvironment: true
|
|
42228
|
+
});
|
|
42229
|
+
const effective = asRecord4(settings.merged.mcpServers);
|
|
42230
|
+
const user = asRecord4(settings.user.settings.mcpServers);
|
|
42231
|
+
const workspace = asRecord4(settings.workspace.settings.mcpServers);
|
|
42232
|
+
return {
|
|
42233
|
+
v: 1,
|
|
42234
|
+
effective,
|
|
42235
|
+
user,
|
|
42236
|
+
workspace
|
|
42237
|
+
};
|
|
42238
|
+
}
|
|
42239
|
+
__name(buildMcpConfigStatus, "buildMcpConfigStatus");
|
|
42240
|
+
function affectedRuntimes(registry, target, scope) {
|
|
42241
|
+
return scope === "user" ? registry.listManaged().filter((runtime) => runtime.trusted) : target.runtime ? [target.runtime] : [];
|
|
42242
|
+
}
|
|
42243
|
+
__name(affectedRuntimes, "affectedRuntimes");
|
|
42244
|
+
function scheduleMcpConfiguration(runtimes) {
|
|
42245
|
+
let reconciling = false;
|
|
42246
|
+
for (const runtime of runtimes) {
|
|
42247
|
+
try {
|
|
42248
|
+
if (getWorkspaceRuntimeCoordinator(runtime).reconcileMcpConfiguration() === "reconciling") {
|
|
42249
|
+
reconciling = true;
|
|
42250
|
+
}
|
|
42251
|
+
} catch {
|
|
42252
|
+
}
|
|
42253
|
+
}
|
|
42254
|
+
return reconciling ? "reconciling" : "deferred";
|
|
42255
|
+
}
|
|
42256
|
+
__name(scheduleMcpConfiguration, "scheduleMcpConfiguration");
|
|
42257
|
+
function runManagementOperation(target, operation) {
|
|
42258
|
+
return target.runtime ? getWorkspaceRuntimeCoordinator(target.runtime).runManagementOperation(
|
|
42259
|
+
operation
|
|
42260
|
+
) : operation();
|
|
42261
|
+
}
|
|
42262
|
+
__name(runManagementOperation, "runManagementOperation");
|
|
42263
|
+
function registerFor2(app, base, scope, resolveReadTarget, resolveMutationTarget, deps) {
|
|
42264
|
+
const settingScope = scope === "user" ? "User" /* User */ : "Workspace" /* Workspace */;
|
|
42265
|
+
app.get(`${base}/config/mcp/servers`, (req, res) => {
|
|
42266
|
+
const target = resolveReadTarget(req, res);
|
|
42267
|
+
if (!target) return;
|
|
42268
|
+
try {
|
|
42269
|
+
res.status(200).json(buildMcpConfigStatus(target.workspaceCwd));
|
|
42270
|
+
} catch (error2) {
|
|
42271
|
+
deps.sendBridgeError(res, error2, {
|
|
42272
|
+
route: `GET ${base}/config/mcp/servers`
|
|
42273
|
+
});
|
|
42274
|
+
}
|
|
42275
|
+
});
|
|
42276
|
+
app.put(
|
|
42277
|
+
`${base}/config/mcp/servers/:name`,
|
|
42278
|
+
deps.mutate({ strict: true }),
|
|
42279
|
+
async (req, res) => {
|
|
42280
|
+
const target = resolveMutationTarget(req, res);
|
|
42281
|
+
if (!target) return;
|
|
42282
|
+
const name = req.params["name"];
|
|
42283
|
+
if (!validateMcpRuntimeServerName(name, res)) return;
|
|
42284
|
+
const body = deps.safeBody(req);
|
|
42285
|
+
if (body["scope"] !== scope) {
|
|
42286
|
+
res.status(400).json({
|
|
42287
|
+
error: `scope must be ${scope}`,
|
|
42288
|
+
code: "invalid_scope"
|
|
42289
|
+
});
|
|
42290
|
+
return;
|
|
42291
|
+
}
|
|
42292
|
+
const config = body["config"];
|
|
42293
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
42294
|
+
res.status(400).json({
|
|
42295
|
+
error: "config is required and must be an object",
|
|
42296
|
+
code: "invalid_mcp_server_config"
|
|
42297
|
+
});
|
|
42298
|
+
return;
|
|
42299
|
+
}
|
|
42300
|
+
try {
|
|
42301
|
+
const result = await runManagementOperation(target, async () => {
|
|
42302
|
+
let publicValue;
|
|
42303
|
+
await withMcpServerMutationLock(
|
|
42304
|
+
target.workspaceCwd,
|
|
42305
|
+
settingScope,
|
|
42306
|
+
async () => {
|
|
42307
|
+
const prepared = prepareSettingWrite(
|
|
42308
|
+
target.workspaceCwd,
|
|
42309
|
+
settingScope,
|
|
42310
|
+
"mcpServers",
|
|
42311
|
+
config,
|
|
42312
|
+
{ operation: "set", name }
|
|
42313
|
+
);
|
|
42314
|
+
const definition = getSettingDefinition("mcpServers");
|
|
42315
|
+
const validationError = definition ? validateSettingValue(definition, prepared.persistedValue) : void 0;
|
|
42316
|
+
if (validationError) {
|
|
42317
|
+
const error2 = new Error(validationError);
|
|
42318
|
+
error2.code = "invalid_mcp_server_config";
|
|
42319
|
+
throw error2;
|
|
42320
|
+
}
|
|
42321
|
+
await deps.persistSetting(
|
|
42322
|
+
target.workspaceCwd,
|
|
42323
|
+
settingScope,
|
|
42324
|
+
"mcpServers",
|
|
42325
|
+
prepared.persistedValue,
|
|
42326
|
+
target.runtime?.generationGuard?.assertOpen
|
|
42327
|
+
);
|
|
42328
|
+
publicValue = prepared.publicValue;
|
|
42329
|
+
}
|
|
42330
|
+
);
|
|
42331
|
+
const servers = asRecord4(publicValue);
|
|
42332
|
+
return {
|
|
42333
|
+
config: servers[name],
|
|
42334
|
+
publicValue,
|
|
42335
|
+
activation: scheduleMcpConfiguration(
|
|
42336
|
+
affectedRuntimes(deps.workspaceRegistry, target, scope)
|
|
42337
|
+
)
|
|
42338
|
+
};
|
|
42339
|
+
});
|
|
42340
|
+
publishConfiguration(
|
|
42341
|
+
target,
|
|
42342
|
+
scope,
|
|
42343
|
+
"mcpServers",
|
|
42344
|
+
result.publicValue,
|
|
42345
|
+
deps
|
|
42346
|
+
);
|
|
42347
|
+
res.status(200).json({
|
|
42348
|
+
name,
|
|
42349
|
+
scope,
|
|
42350
|
+
config: result.config,
|
|
42351
|
+
activation: result.activation
|
|
42352
|
+
});
|
|
42353
|
+
} catch (error2) {
|
|
42354
|
+
if (error2 instanceof Error && error2.code === "invalid_mcp_server_config") {
|
|
42355
|
+
res.status(400).json({
|
|
42356
|
+
error: error2.message,
|
|
42357
|
+
code: "invalid_mcp_server_config"
|
|
42358
|
+
});
|
|
42359
|
+
return;
|
|
42360
|
+
}
|
|
42361
|
+
deps.sendBridgeError(res, error2, {
|
|
42362
|
+
route: `PUT ${base}/config/mcp/servers/:name`
|
|
42363
|
+
});
|
|
42364
|
+
}
|
|
42365
|
+
}
|
|
42366
|
+
);
|
|
42367
|
+
app.delete(
|
|
42368
|
+
`${base}/config/mcp/servers/:name`,
|
|
42369
|
+
deps.mutate({ strict: true }),
|
|
42370
|
+
async (req, res) => {
|
|
42371
|
+
const target = resolveMutationTarget(req, res);
|
|
42372
|
+
if (!target) return;
|
|
42373
|
+
const name = req.params["name"];
|
|
42374
|
+
if (!validateMcpRuntimeServerName(name, res)) return;
|
|
42375
|
+
if (req.query["scope"] !== scope) {
|
|
42376
|
+
res.status(400).json({
|
|
42377
|
+
error: `scope must be ${scope}`,
|
|
42378
|
+
code: "invalid_scope"
|
|
42379
|
+
});
|
|
42380
|
+
return;
|
|
42381
|
+
}
|
|
42382
|
+
try {
|
|
42383
|
+
const result = await runManagementOperation(target, async () => {
|
|
42384
|
+
let publicValue;
|
|
42385
|
+
await withMcpServerMutationLock(
|
|
42386
|
+
target.workspaceCwd,
|
|
42387
|
+
settingScope,
|
|
42388
|
+
async () => {
|
|
42389
|
+
const prepared = prepareSettingWrite(
|
|
42390
|
+
target.workspaceCwd,
|
|
42391
|
+
settingScope,
|
|
42392
|
+
"mcpServers",
|
|
42393
|
+
{},
|
|
42394
|
+
{ operation: "remove", name }
|
|
42395
|
+
);
|
|
42396
|
+
await deps.persistSetting(
|
|
42397
|
+
target.workspaceCwd,
|
|
42398
|
+
settingScope,
|
|
42399
|
+
"mcpServers",
|
|
42400
|
+
prepared.persistedValue,
|
|
42401
|
+
target.runtime?.generationGuard?.assertOpen
|
|
42402
|
+
);
|
|
42403
|
+
publicValue = prepared.publicValue;
|
|
42404
|
+
}
|
|
42405
|
+
);
|
|
42406
|
+
return {
|
|
42407
|
+
publicValue,
|
|
42408
|
+
activation: scheduleMcpConfiguration(
|
|
42409
|
+
affectedRuntimes(deps.workspaceRegistry, target, scope)
|
|
42410
|
+
)
|
|
42411
|
+
};
|
|
42412
|
+
});
|
|
42413
|
+
publishConfiguration(
|
|
42414
|
+
target,
|
|
42415
|
+
scope,
|
|
42416
|
+
"mcpServers",
|
|
42417
|
+
result.publicValue,
|
|
42418
|
+
deps
|
|
42419
|
+
);
|
|
42420
|
+
res.status(200).json({ name, scope, activation: result.activation });
|
|
42421
|
+
} catch (error2) {
|
|
42422
|
+
deps.sendBridgeError(res, error2, {
|
|
42423
|
+
route: `DELETE ${base}/config/mcp/servers/:name`
|
|
42424
|
+
});
|
|
42425
|
+
}
|
|
42426
|
+
}
|
|
42427
|
+
);
|
|
42428
|
+
for (const action of ["enable", "disable"]) {
|
|
42429
|
+
app.post(
|
|
42430
|
+
`${base}/config/mcp/:server/${action}`,
|
|
42431
|
+
deps.mutate({ strict: true }),
|
|
42432
|
+
async (req, res) => {
|
|
42433
|
+
const target = resolveMutationTarget(req, res);
|
|
42434
|
+
if (!target) return;
|
|
42435
|
+
const serverName = req.params["server"];
|
|
42436
|
+
if (!validateMcpRuntimeServerName(serverName, res)) return;
|
|
42437
|
+
try {
|
|
42438
|
+
const result = await runManagementOperation(target, async () => {
|
|
42439
|
+
let changed = false;
|
|
42440
|
+
let next = [];
|
|
42441
|
+
let blocking = [];
|
|
42442
|
+
await withMcpServerMutationLock(
|
|
42443
|
+
target.workspaceCwd,
|
|
42444
|
+
settingScope,
|
|
42445
|
+
async () => {
|
|
42446
|
+
const settings = loadSettings(target.workspaceCwd, {
|
|
42447
|
+
skipLoadEnvironment: true
|
|
42448
|
+
});
|
|
42449
|
+
const existing = settings.forScope(settingScope).settings.mcp?.excluded ?? [];
|
|
42450
|
+
if (action === "enable") {
|
|
42451
|
+
const blockingScopes = [
|
|
42452
|
+
"SystemDefaults" /* SystemDefaults */,
|
|
42453
|
+
"System" /* System */,
|
|
42454
|
+
"User" /* User */,
|
|
42455
|
+
...settingScope === "Workspace" /* Workspace */ ? ["Workspace" /* Workspace */] : []
|
|
42456
|
+
];
|
|
42457
|
+
blocking = blockingScopes.flatMap(
|
|
42458
|
+
(candidateScope) => (settings.forScope(candidateScope).settings.mcp?.excluded ?? []).filter(
|
|
42459
|
+
(pattern) => matchesAnyServerPattern(serverName, [pattern]) && (candidateScope !== settingScope || pattern !== serverName)
|
|
42460
|
+
)
|
|
42461
|
+
);
|
|
42462
|
+
if (blocking.length > 0) return;
|
|
42463
|
+
}
|
|
42464
|
+
next = action === "enable" ? existing.filter((pattern) => pattern !== serverName) : existing.includes(serverName) ? existing : [...existing, serverName];
|
|
42465
|
+
changed = next.length !== existing.length;
|
|
42466
|
+
if (changed) {
|
|
42467
|
+
await deps.persistSetting(
|
|
42468
|
+
target.workspaceCwd,
|
|
42469
|
+
settingScope,
|
|
42470
|
+
"mcp.excluded",
|
|
42471
|
+
next,
|
|
42472
|
+
target.runtime?.generationGuard?.assertOpen
|
|
42473
|
+
);
|
|
42474
|
+
}
|
|
42475
|
+
}
|
|
42476
|
+
);
|
|
42477
|
+
if (blocking.length > 0) {
|
|
42478
|
+
res.status(409).json({
|
|
42479
|
+
error: `MCP server is excluded by pattern: ${blocking.join(", ")}`,
|
|
42480
|
+
code: "mcp_excluded_by_pattern",
|
|
42481
|
+
patterns: blocking
|
|
42482
|
+
});
|
|
42483
|
+
return null;
|
|
42484
|
+
}
|
|
42485
|
+
return {
|
|
42486
|
+
changed,
|
|
42487
|
+
value: next,
|
|
42488
|
+
activation: changed ? scheduleMcpConfiguration(
|
|
42489
|
+
affectedRuntimes(deps.workspaceRegistry, target, scope)
|
|
42490
|
+
) : "applied"
|
|
42491
|
+
};
|
|
42492
|
+
});
|
|
42493
|
+
if (!result) return;
|
|
42494
|
+
if (result.changed) {
|
|
42495
|
+
publishConfiguration(
|
|
42496
|
+
target,
|
|
42497
|
+
scope,
|
|
42498
|
+
"mcp.excluded",
|
|
42499
|
+
result.value,
|
|
42500
|
+
deps
|
|
42501
|
+
);
|
|
42502
|
+
}
|
|
42503
|
+
res.status(200).json({
|
|
42504
|
+
serverName,
|
|
42505
|
+
action,
|
|
42506
|
+
ok: true,
|
|
42507
|
+
changed: result.changed,
|
|
42508
|
+
activation: result.activation
|
|
42509
|
+
});
|
|
42510
|
+
} catch (error2) {
|
|
42511
|
+
deps.sendBridgeError(res, error2, {
|
|
42512
|
+
route: `POST ${base}/config/mcp/:server/${action}`
|
|
42513
|
+
});
|
|
42514
|
+
}
|
|
42515
|
+
}
|
|
42516
|
+
);
|
|
42517
|
+
}
|
|
42518
|
+
}
|
|
42519
|
+
__name(registerFor2, "registerFor");
|
|
42520
|
+
function publishConfiguration(target, scope, key, value, deps) {
|
|
42521
|
+
deps.invalidateServeFeaturesCache();
|
|
42522
|
+
if (scope === "user") {
|
|
42523
|
+
try {
|
|
42524
|
+
deps.broadcastSettingsChanged(key, value, scope, void 0);
|
|
42525
|
+
} catch {
|
|
42526
|
+
}
|
|
42527
|
+
for (const candidate of deps.workspaceRegistry.listManaged()) {
|
|
42528
|
+
if (candidate.workspaceCwd === target.workspaceCwd) continue;
|
|
42529
|
+
try {
|
|
42530
|
+
candidate.bridge.publishWorkspaceEvent({
|
|
42531
|
+
type: "settings_changed",
|
|
42532
|
+
data: { key, value, scope }
|
|
42533
|
+
});
|
|
42534
|
+
} catch {
|
|
42535
|
+
}
|
|
42536
|
+
}
|
|
42537
|
+
return;
|
|
42538
|
+
}
|
|
42539
|
+
try {
|
|
42540
|
+
target.runtime?.bridge.publishWorkspaceEvent({
|
|
42541
|
+
type: "settings_changed",
|
|
42542
|
+
data: { key, value, scope }
|
|
42543
|
+
});
|
|
42544
|
+
} catch {
|
|
42545
|
+
}
|
|
42546
|
+
}
|
|
42547
|
+
__name(publishConfiguration, "publishConfiguration");
|
|
42548
|
+
function registerWorkspaceMcpConfigRoutes(app, deps) {
|
|
42549
|
+
registerFor2(
|
|
42550
|
+
app,
|
|
42551
|
+
"/workspace",
|
|
42552
|
+
"user",
|
|
42553
|
+
() => ({ workspaceCwd: deps.workspaceRegistry.primaryEntry.workspaceCwd }),
|
|
42554
|
+
() => ({ workspaceCwd: deps.workspaceRegistry.primaryEntry.workspaceCwd }),
|
|
42555
|
+
deps
|
|
42556
|
+
);
|
|
42557
|
+
registerFor2(
|
|
42558
|
+
app,
|
|
42559
|
+
"/workspaces/:workspace",
|
|
42560
|
+
"workspace",
|
|
42561
|
+
(req, res) => {
|
|
42562
|
+
const entry = resolveWorkspaceEntryFromParam(
|
|
42563
|
+
deps.workspaceRegistry,
|
|
42564
|
+
req,
|
|
42565
|
+
res
|
|
42566
|
+
);
|
|
42567
|
+
return entry ? { workspaceCwd: entry.workspaceCwd } : null;
|
|
42568
|
+
},
|
|
42569
|
+
(req, res) => {
|
|
42570
|
+
const runtime = resolveWorkspaceRuntimeFromParam(
|
|
42571
|
+
deps.workspaceRegistry,
|
|
42572
|
+
req,
|
|
42573
|
+
res
|
|
42574
|
+
);
|
|
42575
|
+
return runtime && requireTrustedWorkspaceRuntime(runtime, res) ? { workspaceCwd: runtime.workspaceCwd, runtime } : null;
|
|
42576
|
+
},
|
|
42577
|
+
deps
|
|
42578
|
+
);
|
|
42579
|
+
}
|
|
42580
|
+
__name(registerWorkspaceMcpConfigRoutes, "registerWorkspaceMcpConfigRoutes");
|
|
42581
|
+
|
|
42582
|
+
// packages/cli/src/serve/routes/workspace-runtime-mcp.ts
|
|
42583
|
+
init_esbuild_shims();
|
|
42584
|
+
function validateRuntimeServerName(name, res) {
|
|
42585
|
+
if (typeof name === "string" && name.length > 0 && name.length <= MAX_SERVER_NAME_LENGTH && name !== "__proto__" && name !== "constructor" && name !== "prototype")
|
|
42586
|
+
return true;
|
|
42587
|
+
res.status(400).json({
|
|
42588
|
+
error: name === "__proto__" || name === "constructor" || name === "prototype" ? "Server name must not be a reserved JS property name" : typeof name === "string" && name.length > 0 ? `Server name exceeds ${MAX_SERVER_NAME_LENGTH}-character limit` : "Server name is required and must be a non-empty string",
|
|
42589
|
+
code: "invalid_server_name"
|
|
42590
|
+
});
|
|
42591
|
+
return false;
|
|
42592
|
+
}
|
|
42593
|
+
__name(validateRuntimeServerName, "validateRuntimeServerName");
|
|
42594
|
+
function requireRuntimeCoordinator2(runtime, res) {
|
|
42595
|
+
const coordinator = getWorkspaceRuntimeCoordinatorIfSupported(runtime);
|
|
42596
|
+
if (coordinator) return coordinator;
|
|
42597
|
+
res.status(501).json({
|
|
42598
|
+
error: "Workspace runtime lifecycle is not supported",
|
|
42599
|
+
code: "workspace_runtime_not_supported"
|
|
42600
|
+
});
|
|
42601
|
+
return void 0;
|
|
42602
|
+
}
|
|
42603
|
+
__name(requireRuntimeCoordinator2, "requireRuntimeCoordinator");
|
|
42604
|
+
function parseReloadOptions(body, res) {
|
|
42605
|
+
const forceReconnectAll = body["forceReconnectAll"];
|
|
42606
|
+
const forceReconnectWhich = body["forceReconnectWhich"];
|
|
42607
|
+
if (forceReconnectAll !== void 0 && typeof forceReconnectAll !== "boolean") {
|
|
42608
|
+
res.status(400).json({
|
|
42609
|
+
error: "`forceReconnectAll` must be a boolean",
|
|
42610
|
+
code: "invalid_force_reconnect_all_flag"
|
|
42611
|
+
});
|
|
42612
|
+
return null;
|
|
42613
|
+
}
|
|
42614
|
+
if (forceReconnectWhich !== void 0 && (!Array.isArray(forceReconnectWhich) || forceReconnectWhich.some(
|
|
42615
|
+
(name) => typeof name !== "string" || name.length === 0
|
|
42616
|
+
))) {
|
|
42617
|
+
res.status(400).json({
|
|
42618
|
+
error: "`forceReconnectWhich` must be an array of server names",
|
|
42619
|
+
code: "invalid_force_reconnect_which"
|
|
42620
|
+
});
|
|
42621
|
+
return null;
|
|
42622
|
+
}
|
|
42623
|
+
if (forceReconnectAll === true && forceReconnectWhich !== void 0) {
|
|
42624
|
+
res.status(400).json({
|
|
42625
|
+
error: "Reconnect options cannot be combined",
|
|
42626
|
+
code: "conflicting_force_reconnect_options"
|
|
42627
|
+
});
|
|
42628
|
+
return null;
|
|
42629
|
+
}
|
|
42630
|
+
return {
|
|
42631
|
+
...forceReconnectAll === void 0 ? {} : { forceReconnectAll },
|
|
42632
|
+
...forceReconnectWhich === void 0 ? {} : { forceReconnectWhich }
|
|
42633
|
+
};
|
|
42634
|
+
}
|
|
42635
|
+
__name(parseReloadOptions, "parseReloadOptions");
|
|
42636
|
+
function parseEntryIndex(req, res) {
|
|
42637
|
+
const raw = req.query["entryIndex"];
|
|
42638
|
+
if (raw === void 0 || raw === "*") return void 0;
|
|
42639
|
+
const value = typeof raw === "string" ? Number.parseInt(raw, 10) : NaN;
|
|
42640
|
+
if (!Number.isInteger(value) || value < 0 || String(value) !== raw) {
|
|
42641
|
+
res.status(400).json({
|
|
42642
|
+
error: '`entryIndex` must be a non-negative integer or "*"',
|
|
42643
|
+
code: "invalid_entry_index"
|
|
42644
|
+
});
|
|
42645
|
+
return null;
|
|
42646
|
+
}
|
|
42647
|
+
return value;
|
|
42648
|
+
}
|
|
42649
|
+
__name(parseEntryIndex, "parseEntryIndex");
|
|
42650
|
+
function registerFor3(app, base, resolveRuntime, deps) {
|
|
42651
|
+
app.get(`${base}/runtime/mcp`, async (req, res) => {
|
|
42652
|
+
const runtime = resolveRuntime(req, res);
|
|
42653
|
+
if (!runtime) return;
|
|
42654
|
+
const route = `GET ${base}/runtime/mcp`;
|
|
42655
|
+
try {
|
|
42656
|
+
res.status(200).json(
|
|
42657
|
+
await runtime.workspaceService.getWorkspaceMcpStatus(
|
|
42658
|
+
createBuildWorkspaceCtx(runtime.workspaceCwd)(route)
|
|
42659
|
+
)
|
|
42660
|
+
);
|
|
42661
|
+
} catch (error2) {
|
|
42662
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42663
|
+
}
|
|
42664
|
+
});
|
|
42665
|
+
app.get(`${base}/runtime/mcp/:server/tools`, async (req, res) => {
|
|
42666
|
+
const runtime = resolveRuntime(req, res);
|
|
42667
|
+
if (!runtime) return;
|
|
42668
|
+
const serverName = req.params["server"];
|
|
42669
|
+
if (!validateRuntimeServerName(serverName, res)) return;
|
|
42670
|
+
const route = `GET ${base}/runtime/mcp/:server/tools`;
|
|
42671
|
+
try {
|
|
42672
|
+
res.status(200).json(await runtime.bridge.getWorkspaceMcpToolsStatus(serverName));
|
|
42673
|
+
} catch (error2) {
|
|
42674
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42675
|
+
}
|
|
42676
|
+
});
|
|
42677
|
+
app.get(`${base}/runtime/mcp/:server/resources`, async (req, res) => {
|
|
42678
|
+
const runtime = resolveRuntime(req, res);
|
|
42679
|
+
if (!runtime) return;
|
|
42680
|
+
const serverName = req.params["server"];
|
|
42681
|
+
if (!validateRuntimeServerName(serverName, res)) return;
|
|
42682
|
+
const route = `GET ${base}/runtime/mcp/:server/resources`;
|
|
42683
|
+
try {
|
|
42684
|
+
res.status(200).json(await runtime.bridge.getWorkspaceMcpResourcesStatus(serverName));
|
|
42685
|
+
} catch (error2) {
|
|
42686
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42687
|
+
}
|
|
42688
|
+
});
|
|
42689
|
+
app.post(
|
|
42690
|
+
`${base}/runtime/mcp/reload`,
|
|
42691
|
+
deps.mutate({ strict: true }),
|
|
42692
|
+
async (req, res) => {
|
|
42693
|
+
const runtime = resolveRuntime(req, res);
|
|
42694
|
+
if (!runtime) return;
|
|
42695
|
+
const coordinator = requireRuntimeCoordinator2(runtime, res);
|
|
42696
|
+
if (!coordinator) return;
|
|
42697
|
+
const options = parseReloadOptions(deps.safeBody(req), res);
|
|
42698
|
+
if (!options) return;
|
|
42699
|
+
const route = `POST ${base}/runtime/mcp/reload`;
|
|
42700
|
+
try {
|
|
42701
|
+
const result = await coordinator.runMcpRuntimeMutation(
|
|
42702
|
+
() => runtime.bridge.reloadWorkspaceMcp(options)
|
|
42703
|
+
);
|
|
42704
|
+
runtime.generationGuard?.assertOpen();
|
|
42705
|
+
res.status(200).json(result);
|
|
42706
|
+
} catch (error2) {
|
|
42707
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42708
|
+
}
|
|
42709
|
+
}
|
|
42710
|
+
);
|
|
42711
|
+
app.post(
|
|
42712
|
+
`${base}/runtime/mcp/:server/restart`,
|
|
42713
|
+
deps.mutate({ strict: true }),
|
|
42714
|
+
async (req, res) => {
|
|
42715
|
+
const runtime = resolveRuntime(req, res);
|
|
42716
|
+
if (!runtime) return;
|
|
42717
|
+
const coordinator = requireRuntimeCoordinator2(runtime, res);
|
|
42718
|
+
if (!coordinator) return;
|
|
42719
|
+
const serverName = req.params["server"];
|
|
42720
|
+
if (!validateRuntimeServerName(serverName, res)) return;
|
|
42721
|
+
const entryIndex = parseEntryIndex(req, res);
|
|
42722
|
+
if (entryIndex === null) return;
|
|
42723
|
+
const route = `POST ${base}/runtime/mcp/:server/restart`;
|
|
42724
|
+
try {
|
|
42725
|
+
const result = await coordinator.runMcpRuntimeMutation(
|
|
42726
|
+
() => runtime.workspaceService.restartMcpServer(
|
|
42727
|
+
createBuildWorkspaceCtx(runtime.workspaceCwd)(route),
|
|
42728
|
+
serverName,
|
|
42729
|
+
entryIndex === void 0 ? void 0 : { entryIndex }
|
|
42730
|
+
)
|
|
42731
|
+
);
|
|
42732
|
+
runtime.generationGuard?.assertOpen();
|
|
42733
|
+
res.status(200).json(result);
|
|
42734
|
+
} catch (error2) {
|
|
42735
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42736
|
+
}
|
|
42737
|
+
}
|
|
42738
|
+
);
|
|
42739
|
+
for (const action of ["approve", "authenticate", "clear-auth"]) {
|
|
42740
|
+
app.post(
|
|
42741
|
+
`${base}/runtime/mcp/:server/${action}`,
|
|
42742
|
+
deps.mutate({ strict: true }),
|
|
42743
|
+
async (req, res) => {
|
|
42744
|
+
const runtime = resolveRuntime(req, res);
|
|
42745
|
+
if (!runtime) return;
|
|
42746
|
+
const coordinator = requireRuntimeCoordinator2(runtime, res);
|
|
42747
|
+
if (!coordinator) return;
|
|
42748
|
+
const serverName = req.params["server"];
|
|
42749
|
+
if (!validateRuntimeServerName(serverName, res)) return;
|
|
42750
|
+
const route = `POST ${base}/runtime/mcp/:server/${action}`;
|
|
42751
|
+
try {
|
|
42752
|
+
const result = await coordinator.runMcpRuntimeMutation(
|
|
42753
|
+
() => runtime.bridge.manageMcpServer(serverName, action, void 0)
|
|
42754
|
+
);
|
|
42755
|
+
runtime.generationGuard?.assertOpen();
|
|
42756
|
+
res.status(200).json(result);
|
|
42757
|
+
} catch (error2) {
|
|
42758
|
+
deps.sendBridgeError(res, error2, { route });
|
|
42759
|
+
}
|
|
42760
|
+
}
|
|
42761
|
+
);
|
|
42762
|
+
}
|
|
42763
|
+
}
|
|
42764
|
+
__name(registerFor3, "registerFor");
|
|
42765
|
+
function registerWorkspaceRuntimeMcpRoutes(app, deps) {
|
|
42766
|
+
registerFor3(
|
|
42767
|
+
app,
|
|
42768
|
+
"/workspace",
|
|
42769
|
+
(_req, res) => {
|
|
42770
|
+
const entry = deps.workspaceRegistry.primaryEntry;
|
|
42771
|
+
const runtime = entry.state === "active" ? entry.current?.runtime : void 0;
|
|
42772
|
+
if (!runtime) {
|
|
42773
|
+
sendWorkspaceRuntimeUnavailable(res, entry);
|
|
42774
|
+
return null;
|
|
42775
|
+
}
|
|
42776
|
+
return requireTrustedWorkspaceRuntime(runtime, res) ? runtime : null;
|
|
42777
|
+
},
|
|
42778
|
+
deps
|
|
42779
|
+
);
|
|
42780
|
+
registerFor3(
|
|
42781
|
+
app,
|
|
42782
|
+
"/workspaces/:workspace",
|
|
42783
|
+
(req, res) => {
|
|
42784
|
+
const runtime = resolveWorkspaceRuntimeFromParam(
|
|
42785
|
+
deps.workspaceRegistry,
|
|
42786
|
+
req,
|
|
42787
|
+
res
|
|
42788
|
+
);
|
|
42789
|
+
return runtime && requireTrustedWorkspaceRuntime(runtime, res) ? runtime : null;
|
|
42790
|
+
},
|
|
42791
|
+
deps
|
|
42792
|
+
);
|
|
42793
|
+
}
|
|
42794
|
+
__name(registerWorkspaceRuntimeMcpRoutes, "registerWorkspaceRuntimeMcpRoutes");
|
|
42795
|
+
|
|
41678
42796
|
// packages/cli/src/serve/routes/workspace-channel-control.ts
|
|
41679
42797
|
init_esbuild_shims();
|
|
41680
42798
|
function parseSelection(body, res) {
|
|
@@ -43412,6 +44530,12 @@ function parseHostMessage(text) {
|
|
|
43412
44530
|
};
|
|
43413
44531
|
}
|
|
43414
44532
|
}
|
|
44533
|
+
if (value["type"] === "host.playback_started" && typeof value["epoch"] === "number") {
|
|
44534
|
+
return { type: "host.playback_started", epoch: value["epoch"] };
|
|
44535
|
+
}
|
|
44536
|
+
if (value["type"] === "host.playback_completed" && typeof value["epoch"] === "number") {
|
|
44537
|
+
return { type: "host.playback_completed", epoch: value["epoch"] };
|
|
44538
|
+
}
|
|
43415
44539
|
return void 0;
|
|
43416
44540
|
}
|
|
43417
44541
|
__name(parseHostMessage, "parseHostMessage");
|
|
@@ -43961,6 +45085,9 @@ var LiveHostCoordinator = class {
|
|
|
43961
45085
|
this.handleShortcutResult(message);
|
|
43962
45086
|
return;
|
|
43963
45087
|
}
|
|
45088
|
+
if (message.type === "host.playback_started" || message.type === "host.playback_completed") {
|
|
45089
|
+
return;
|
|
45090
|
+
}
|
|
43964
45091
|
this.handleAction(message);
|
|
43965
45092
|
}
|
|
43966
45093
|
handleShortcutResult(message) {
|
|
@@ -46915,6 +48042,9 @@ var LiveHostInstaller = class {
|
|
|
46915
48042
|
return operation;
|
|
46916
48043
|
}
|
|
46917
48044
|
async launch() {
|
|
48045
|
+
if (this.platform !== "darwin") {
|
|
48046
|
+
return this.setError("Qwen Live Host is available only on macOS.", false);
|
|
48047
|
+
}
|
|
46918
48048
|
if (this.operation) return await this.operation;
|
|
46919
48049
|
try {
|
|
46920
48050
|
const installed = await this.inspectInstalled();
|
|
@@ -47581,7 +48711,7 @@ var LiveSessionCoordinator = class {
|
|
|
47581
48711
|
try {
|
|
47582
48712
|
context.runtime?.bridge.updateSessionMetadata(
|
|
47583
48713
|
context.coordinator.sessionId,
|
|
47584
|
-
{ displayName: "Voice chat" }
|
|
48714
|
+
{ displayName: "Voice chat", titleSource: "auto" }
|
|
47585
48715
|
);
|
|
47586
48716
|
} catch {
|
|
47587
48717
|
}
|
|
@@ -50132,6 +51262,8 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
50132
51262
|
(runtime) => supportsWorkspaceRuntimeLifecycle(runtime.bridge)
|
|
50133
51263
|
);
|
|
50134
51264
|
}, "workspaceRuntimeAvailable"),
|
|
51265
|
+
localPathOpenAvailable: deps.localPathOpenAvailable ?? isLocalPathOpenAvailable(),
|
|
51266
|
+
localTerminalOpenAvailable: deps.localTerminalOpenAvailable ?? isLocalTerminalAvailable(),
|
|
50135
51267
|
workspaceTrustHotReloadAvailable: deps.workspaceTrustHotReloadAvailable === true,
|
|
50136
51268
|
isPrimaryWorkspaceTrusted: /* @__PURE__ */ __name(() => isPrimaryWorkspaceTrusted(), "isPrimaryWorkspaceTrusted"),
|
|
50137
51269
|
...deps.workspaceTrustHotReloadAvailable === true ? {
|
|
@@ -50153,11 +51285,13 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
50153
51285
|
}) : void 0;
|
|
50154
51286
|
const defaultSessionOwnerIndex = !injectedWorkspaceRegistry ? createWorkspaceSessionOwnerIndex() : void 0;
|
|
50155
51287
|
const acpChildArgs = acpChildExtraArgs(opts);
|
|
51288
|
+
const attachmentsRoots = sessionAttachmentsRoots(
|
|
51289
|
+
boundWorkspace,
|
|
51290
|
+
Storage.getRuntimeBaseDir()
|
|
51291
|
+
);
|
|
50156
51292
|
const bridge = injectedWorkspaceRegistry?.primary.bridge ?? deps.bridge ?? createAcpSessionBridge({
|
|
50157
|
-
sessionAttachmentsRoot:
|
|
50158
|
-
|
|
50159
|
-
"attachments"
|
|
50160
|
-
),
|
|
51293
|
+
sessionAttachmentsRoot: attachmentsRoots.root,
|
|
51294
|
+
sessionAttachmentsFallbackRoot: attachmentsRoots.fallback,
|
|
50161
51295
|
maxSessions: opts.maxSessions,
|
|
50162
51296
|
...totalSessionAdmission ? { freshSessionAdmission: totalSessionAdmission.admit } : {},
|
|
50163
51297
|
...defaultSessionOwnerIndex ? {
|
|
@@ -50443,6 +51577,7 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
50443
51577
|
let liveBindingPromise;
|
|
50444
51578
|
let liveRuntimeBootPromise;
|
|
50445
51579
|
let liveRuntimeBootResult;
|
|
51580
|
+
let liveRuntimeBootWarned = false;
|
|
50446
51581
|
let liveAppshotChannelPromise;
|
|
50447
51582
|
let liveCoordinatorSealed = false;
|
|
50448
51583
|
const clearLiveRuntimeHandlers = /* @__PURE__ */ __name((runtime) => {
|
|
@@ -50520,10 +51655,30 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
50520
51655
|
liveBindingPromise = pending;
|
|
50521
51656
|
return pending;
|
|
50522
51657
|
}, "ensureLiveConversationRuntime");
|
|
51658
|
+
const describeConversationBootError = /* @__PURE__ */ __name((error2) => {
|
|
51659
|
+
const messages = [];
|
|
51660
|
+
const seen = /* @__PURE__ */ new Set();
|
|
51661
|
+
let current = error2;
|
|
51662
|
+
while (current instanceof Error && !seen.has(current) && messages.length < 8) {
|
|
51663
|
+
seen.add(current);
|
|
51664
|
+
messages.push(current.message);
|
|
51665
|
+
current = current.cause;
|
|
51666
|
+
}
|
|
51667
|
+
return messages.length > 0 ? messages.join(" <- ") : String(error2);
|
|
51668
|
+
}, "describeConversationBootError");
|
|
50523
51669
|
const startConversationRuntimeBoot = /* @__PURE__ */ __name(() => {
|
|
50524
51670
|
if (liveRuntimeBootPromise) return liveRuntimeBootPromise;
|
|
50525
51671
|
const pending = ensureLiveConversationRuntime().then((runtime) => {
|
|
50526
51672
|
liveRuntimeBootResult = runtime;
|
|
51673
|
+
liveRuntimeBootWarned = false;
|
|
51674
|
+
}).catch((error2) => {
|
|
51675
|
+
if (!liveRuntimeBootWarned) {
|
|
51676
|
+
liveRuntimeBootWarned = true;
|
|
51677
|
+
writeStderrLineSafe(
|
|
51678
|
+
`qwen serve: Conversations runtime boot failed: ${describeConversationBootError(error2)}`
|
|
51679
|
+
);
|
|
51680
|
+
}
|
|
51681
|
+
throw error2;
|
|
50527
51682
|
}).finally(() => {
|
|
50528
51683
|
if (liveRuntimeBootPromise === pending) {
|
|
50529
51684
|
liveRuntimeBootPromise = void 0;
|
|
@@ -51047,6 +52202,10 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
51047
52202
|
gitState: workspaceGitState,
|
|
51048
52203
|
sendBridgeError: sendBridgeError2
|
|
51049
52204
|
});
|
|
52205
|
+
registerWorkspaceLocalOpenRoutes(app, {
|
|
52206
|
+
workspaceRegistry,
|
|
52207
|
+
mutate
|
|
52208
|
+
});
|
|
51050
52209
|
registerWorkspaceGitDiffRoutes(app, {
|
|
51051
52210
|
boundWorkspace: primaryBoundWorkspace,
|
|
51052
52211
|
sendBridgeError: sendBridgeError2,
|
|
@@ -51286,11 +52445,28 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
51286
52445
|
app.locals.workspaceRuntimeRemoval = deps.workspaceRuntimeRemoval;
|
|
51287
52446
|
const broadcastSettingsChanged = /* @__PURE__ */ __name((key, value, scope, clientId) => {
|
|
51288
52447
|
invalidateServeFeaturesCache();
|
|
51289
|
-
|
|
52448
|
+
const event = {
|
|
51290
52449
|
type: "settings_changed",
|
|
51291
|
-
data: { key, value, scope }
|
|
51292
|
-
|
|
51293
|
-
|
|
52450
|
+
data: { key, value, scope }
|
|
52451
|
+
};
|
|
52452
|
+
const publish = /* @__PURE__ */ __name((bridge2, workspace2, originatorClientId) => {
|
|
52453
|
+
try {
|
|
52454
|
+
bridge2.publishWorkspaceEvent({
|
|
52455
|
+
...event,
|
|
52456
|
+
...originatorClientId ? { originatorClientId } : {}
|
|
52457
|
+
});
|
|
52458
|
+
} catch (err) {
|
|
52459
|
+
writeStderrLine(
|
|
52460
|
+
`qwen serve: settings_changed broadcast to workspace ${workspace2} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
52461
|
+
);
|
|
52462
|
+
}
|
|
52463
|
+
}, "publish");
|
|
52464
|
+
publish(primaryBridge, primaryBoundWorkspace, clientId);
|
|
52465
|
+
if (scope !== "user") return;
|
|
52466
|
+
for (const runtime of workspaceRegistry.listAll()) {
|
|
52467
|
+
if (runtime.primary) continue;
|
|
52468
|
+
publish(runtime.bridge, runtime.workspaceCwd);
|
|
52469
|
+
}
|
|
51294
52470
|
}, "broadcastSettingsChanged");
|
|
51295
52471
|
if (deps.persistSetting) {
|
|
51296
52472
|
const persistSetting = deps.persistSetting;
|
|
@@ -51303,6 +52479,33 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
51303
52479
|
persistSetting: /* @__PURE__ */ __name(async (...args) => {
|
|
51304
52480
|
await persistSetting(...args);
|
|
51305
52481
|
}, "persistSetting"),
|
|
52482
|
+
updateSessionWorkflow: /* @__PURE__ */ __name((enabled) => primaryBridge.invokeWorkspaceCommand(
|
|
52483
|
+
SERVE_CONTROL_EXT_METHODS.workspaceSessionWorkflow,
|
|
52484
|
+
{ enabled }
|
|
52485
|
+
), "updateSessionWorkflow"),
|
|
52486
|
+
updateSiblingSessionWorkflows: /* @__PURE__ */ __name(async () => {
|
|
52487
|
+
for (const runtime of workspaceRegistry.listAll()) {
|
|
52488
|
+
if (runtime.primary) continue;
|
|
52489
|
+
try {
|
|
52490
|
+
await withSessionWorkflowWriteLock(
|
|
52491
|
+
runtime.workspaceCwd,
|
|
52492
|
+
() => runtime.bridge.invokeWorkspaceCommand(
|
|
52493
|
+
SERVE_CONTROL_EXT_METHODS.workspaceSessionWorkflow,
|
|
52494
|
+
{
|
|
52495
|
+
enabled: readEffectiveSessionWorkflow(
|
|
52496
|
+
runtime.workspaceCwd,
|
|
52497
|
+
runtime.trusted
|
|
52498
|
+
)
|
|
52499
|
+
}
|
|
52500
|
+
)
|
|
52501
|
+
);
|
|
52502
|
+
} catch (err) {
|
|
52503
|
+
writeStderrLine(
|
|
52504
|
+
`qwen serve: Session Workflow push to sibling workspace ${runtime.workspaceCwd} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
52505
|
+
);
|
|
52506
|
+
}
|
|
52507
|
+
}
|
|
52508
|
+
}, "updateSiblingSessionWorkflows"),
|
|
51306
52509
|
broadcastSettingsChanged,
|
|
51307
52510
|
parseAndValidateClientId: /* @__PURE__ */ __name((req, res) => parseAndValidateWorkspaceClientId(req, res, primaryBridge), "parseAndValidateClientId"),
|
|
51308
52511
|
includeLiveVoice: liveVoiceSurfaceAvailable
|
|
@@ -51316,6 +52519,31 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
51316
52519
|
}, "persistSetting"),
|
|
51317
52520
|
invalidateServeFeaturesCache
|
|
51318
52521
|
});
|
|
52522
|
+
registerUserLanguageRoutes(app, {
|
|
52523
|
+
boundWorkspace: primaryBoundWorkspace,
|
|
52524
|
+
mutate,
|
|
52525
|
+
safeBody,
|
|
52526
|
+
languageCodes,
|
|
52527
|
+
persistSetting: /* @__PURE__ */ __name(async (...args) => {
|
|
52528
|
+
await persistSetting(...args);
|
|
52529
|
+
}, "persistSetting"),
|
|
52530
|
+
workspaceRegistry,
|
|
52531
|
+
parseAndValidateClientId: /* @__PURE__ */ __name((req, res) => parseAndValidateWorkspaceClientId(req, res, [
|
|
52532
|
+
primaryBridge,
|
|
52533
|
+
...workspaceRegistry.list().map((runtime) => runtime.bridge)
|
|
52534
|
+
]), "parseAndValidateClientId")
|
|
52535
|
+
});
|
|
52536
|
+
registerWorkspaceMcpConfigRoutes(app, {
|
|
52537
|
+
workspaceRegistry,
|
|
52538
|
+
mutate,
|
|
52539
|
+
safeBody,
|
|
52540
|
+
persistSetting: /* @__PURE__ */ __name(async (...args) => {
|
|
52541
|
+
await persistSetting(...args);
|
|
52542
|
+
}, "persistSetting"),
|
|
52543
|
+
sendBridgeError: sendBridgeError2,
|
|
52544
|
+
invalidateServeFeaturesCache,
|
|
52545
|
+
broadcastSettingsChanged
|
|
52546
|
+
});
|
|
51319
52547
|
}
|
|
51320
52548
|
registerWorkspacePermissionsRoutes(app, {
|
|
51321
52549
|
boundWorkspace: primaryBoundWorkspace,
|
|
@@ -51448,6 +52676,12 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
51448
52676
|
safeBody,
|
|
51449
52677
|
sendBridgeError: sendBridgeError2
|
|
51450
52678
|
});
|
|
52679
|
+
registerWorkspaceRuntimeMcpRoutes(app, {
|
|
52680
|
+
workspaceRegistry,
|
|
52681
|
+
mutate,
|
|
52682
|
+
safeBody,
|
|
52683
|
+
sendBridgeError: sendBridgeError2
|
|
52684
|
+
});
|
|
51451
52685
|
const channelWorkerControl = deps.getChannelWorkerControl ?? (deps.getChannelWorkerSnapshot ? () => {
|
|
51452
52686
|
const workers = deps.getChannelWorkerSnapshots?.() ?? [];
|
|
51453
52687
|
const primary = deps.getChannelWorkerSnapshot();
|