gerege-cli 0.26.5 → 0.26.7
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 +8 -8
- package/chunks/{MaxSizedBox-VMVLMS4X.js → MaxSizedBox-LSNOJEKM.js} +1 -1
- package/chunks/{StandaloneSessionPicker-UNORCVYY.js → StandaloneSessionPicker-KSYGPMEV.js} +1 -1
- package/chunks/{acp-subagent-executor-623ZUTJT.js → acp-subagent-executor-NSW2MFUI.js} +1 -1
- package/chunks/{acpAgent-MTTDTK2C.js → acpAgent-3DTOHTDM.js} +3 -3
- package/chunks/{advisor-ANUGICJ5.js → advisor-7JGQPS7X.js} +1 -1
- package/chunks/{agent-GNCQDICJ.js → agent-PNKQJGDO.js} +1 -1
- package/chunks/{agent-headless-OPUXAXQM.js → agent-headless-7D33X7QQ.js} +1 -1
- package/chunks/{agent-host-client-K6GRPTFD.js → agent-host-client-3R2MAUVE.js} +1 -1
- package/chunks/{agent-host-connections-MF3YBZU2.js → agent-host-connections-2D7DECAE.js} +1 -1
- package/chunks/{anthropicContentGenerator-OK4PFE5Y.js → anthropicContentGenerator-MGTJJGEQ.js} +1 -1
- package/chunks/{autofix-pr-MABTGEHZ.js → autofix-pr-OIHHZSPQ.js} +1 -1
- package/chunks/{batch-V2NJT3M5.js → batch-6UDAMPAA.js} +1 -1
- package/chunks/{bridge-BJQ627CX.js → bridge-QXVXPNJ6.js} +1 -1
- package/chunks/{channel-settings-store-4JMCI4UR.js → channel-settings-store-P4W4R5SJ.js} +1 -1
- package/chunks/{chunk-ZN57TOVA.js → chunk-2DU2WMTL.js} +1 -1
- package/chunks/{chunk-ISGF3BVD.js → chunk-2J2BQ3PL.js} +2 -2
- package/chunks/{chunk-TQTIEK2W.js → chunk-2LMSDH6P.js} +1 -1
- package/chunks/{chunk-EIILQ6KT.js → chunk-3EZ5GCUT.js} +1 -1
- package/chunks/{chunk-UY2ET2AL.js → chunk-3ICJI5KW.js} +1 -1
- package/chunks/{chunk-VDRE7U3P.js → chunk-4A663FE6.js} +5 -5
- package/chunks/{chunk-2IGE2K5V.js → chunk-4AKTP4MM.js} +1 -1
- package/chunks/{chunk-NO26JN24.js → chunk-4LC4INFI.js} +1 -1
- package/chunks/{chunk-CKZRJP4F.js → chunk-4ME3BUJK.js} +1 -1
- package/chunks/{chunk-3XBJYUWP.js → chunk-4QOVM2LL.js} +1 -1
- package/chunks/{chunk-ZYTG6R7S.js → chunk-4VR4DUUD.js} +1 -1
- package/chunks/{chunk-DE53B2R7.js → chunk-4W27Z3OL.js} +1 -1
- package/chunks/{chunk-QOYRDEXR.js → chunk-53IB4U4E.js} +1 -1
- package/chunks/{chunk-CCOUFBOY.js → chunk-5R2JIZID.js} +1 -1
- package/chunks/{chunk-MPAR4JBP.js → chunk-5TWAP4OG.js} +1 -1
- package/chunks/{chunk-3NQESE5K.js → chunk-6JAXAFX7.js} +1 -1
- package/chunks/{chunk-POA4NX4N.js → chunk-6WV5RKYB.js} +1 -1
- package/chunks/{chunk-KN27BFXM.js → chunk-6YFNUVJR.js} +1 -1
- package/chunks/{chunk-2X3UF2CF.js → chunk-7HFFTOAD.js} +1 -1
- package/chunks/{chunk-KDYUZBZC.js → chunk-ATTJQLQV.js} +1 -1
- package/chunks/{chunk-USJFJZ23.js → chunk-BGELKSQ4.js} +1 -1
- package/chunks/{chunk-X4BFEDWU.js → chunk-BIPPD7W6.js} +1 -1
- package/chunks/{chunk-DEMXCA3K.js → chunk-BVV7UXES.js} +1 -1
- package/chunks/{chunk-2VCDJ6UF.js → chunk-BY46PCWY.js} +1 -1
- package/chunks/{chunk-CXGGC4NO.js → chunk-CDKBM72V.js} +1 -1
- package/chunks/{chunk-5WLKN3GD.js → chunk-CK3OKTTL.js} +1 -1
- package/chunks/{chunk-FHBGTZ4K.js → chunk-DEJ47KJE.js} +1 -1
- package/chunks/{chunk-DTTC4ZKY.js → chunk-DQQN2HOP.js} +1 -1
- package/chunks/{chunk-PN62SUYK.js → chunk-DTX2OVQW.js} +1 -1
- package/chunks/{chunk-IBYFSHBB.js → chunk-DVUKYOCJ.js} +1 -1
- package/chunks/{chunk-Q5E5SOY2.js → chunk-E3KWSRJN.js} +1 -1
- package/chunks/{chunk-IDUGQMTP.js → chunk-EEPNACXJ.js} +1 -1
- package/chunks/{chunk-E5YRAQXM.js → chunk-EKRUF347.js} +1 -1
- package/chunks/{chunk-HSYBIGMS.js → chunk-F5SLLEJY.js} +1 -1
- package/chunks/{chunk-5ZQWQ3RK.js → chunk-F7622ZRQ.js} +1 -1
- package/chunks/{chunk-KKBOCRPF.js → chunk-FKUDVIME.js} +1 -1
- package/chunks/{chunk-62NLMVVT.js → chunk-FRVXSKL4.js} +1 -1
- package/chunks/{chunk-FIM7MM25.js → chunk-FTF2NFLB.js} +1 -1
- package/chunks/{chunk-OHXQYU6S.js → chunk-G4MWPXNY.js} +1 -1
- package/chunks/{chunk-SELRSZFK.js → chunk-GA35LMSX.js} +1 -1
- package/chunks/{chunk-SMYBY353.js → chunk-H34KVVI4.js} +1 -1
- package/chunks/{chunk-NGOIJH7K.js → chunk-H5EXNXGW.js} +1 -1
- package/chunks/{chunk-UBXLQ6TP.js → chunk-HJLRKM3W.js} +1 -1
- package/chunks/{chunk-CAPG7UVH.js → chunk-HVP4UF2Q.js} +1 -1
- package/chunks/{chunk-H57IX45A.js → chunk-HXTYFGSQ.js} +1 -1
- package/chunks/{chunk-55RVKT4O.js → chunk-IIHUDJX7.js} +1 -1
- package/chunks/{chunk-XFLLE2J3.js → chunk-IQMKQKKD.js} +2 -2
- package/chunks/{chunk-SQQORHMS.js → chunk-ISQMHOCC.js} +1 -1
- package/chunks/{chunk-YLAI26PX.js → chunk-IY7M5HKF.js} +1 -1
- package/chunks/{chunk-FDUXQAGW.js → chunk-IZXHCHJD.js} +1 -1
- package/chunks/{chunk-ZOBX6C7E.js → chunk-JHC22BZH.js} +1 -1
- package/chunks/{chunk-26ISBUM7.js → chunk-K7GN4CMV.js} +6 -6
- package/chunks/{chunk-4GC5HJZO.js → chunk-L7LO3YRT.js} +1 -1
- package/chunks/{chunk-ZSVSRF4C.js → chunk-LT3J74BZ.js} +1 -1
- package/chunks/{chunk-2PY7R7GG.js → chunk-LY4XTBL4.js} +1 -1
- package/chunks/{chunk-7IERHQ63.js → chunk-LYFRGP42.js} +1 -1
- package/chunks/{chunk-FPZPCZFS.js → chunk-MDCA4I63.js} +1 -1
- package/chunks/{chunk-2LLPGSUK.js → chunk-MS2XCBPP.js} +1 -1
- package/chunks/{chunk-3Y6LSWEW.js → chunk-MXZXQUVP.js} +1 -1
- package/chunks/{chunk-IH2PFVWO.js → chunk-N4ZQC5HB.js} +1 -1
- package/chunks/{chunk-MTW3A3KT.js → chunk-N6EFYQ7M.js} +1 -1
- package/chunks/{chunk-AQWHCRKY.js → chunk-NHPKD7LY.js} +1 -1
- package/chunks/{chunk-ABJGFEES.js → chunk-NO7VTKRL.js} +1 -1
- package/chunks/{chunk-CNFA5UUM.js → chunk-NPAENNRO.js} +1 -1
- package/chunks/{chunk-IA4K4PGK.js → chunk-NYBYDW6R.js} +1 -1
- package/chunks/{chunk-FNB3DPQZ.js → chunk-O3TUZQP4.js} +1 -1
- package/chunks/{chunk-RVJJFDF3.js → chunk-OZFZBGZG.js} +1 -1
- package/chunks/{chunk-B6D3KTUK.js → chunk-P2MZZMCS.js} +1 -1
- package/chunks/{chunk-GSOBASYW.js → chunk-PMBI46K4.js} +1 -1
- package/chunks/{chunk-WI4UMN3Q.js → chunk-Q5RRVBTY.js} +1 -1
- package/chunks/{chunk-5UZT4SXG.js → chunk-QHYSRPQR.js} +1 -1
- package/chunks/{chunk-2NOMOJWE.js → chunk-QONPET6Y.js} +2 -2
- package/chunks/{chunk-MOPJNP5I.js → chunk-QSPXKBUX.js} +1 -1
- package/chunks/{chunk-C56YJIEI.js → chunk-QTKPC24L.js} +1 -1
- package/chunks/{chunk-6X73W4TL.js → chunk-QTVSPQZQ.js} +1 -1
- package/chunks/{chunk-ADZI3OFT.js → chunk-QVHDM6N7.js} +1 -1
- package/chunks/{chunk-NVSKOSFG.js → chunk-RT6J7PV4.js} +1 -1
- package/chunks/{chunk-7MTBINFX.js → chunk-RULGA7WE.js} +2 -2
- package/chunks/{chunk-AMTFJVDD.js → chunk-SAVYMUU3.js} +1 -1
- package/chunks/{chunk-Z5XENA4A.js → chunk-T3CQ72HC.js} +8 -7
- package/chunks/{chunk-OPYGNTZP.js → chunk-U5YOAOU3.js} +1 -1
- package/chunks/{chunk-HFV6CQWE.js → chunk-ULLW2AYD.js} +1 -1
- package/chunks/{chunk-KGJ47CI5.js → chunk-UM5KBBYP.js} +1 -1
- package/chunks/{chunk-F26LTWDZ.js → chunk-UVMLWDRU.js} +1 -1
- package/chunks/{chunk-BRPJ5EHA.js → chunk-VK7LOUOJ.js} +1 -1
- package/chunks/{chunk-4EQWJTJR.js → chunk-VUNHJ74J.js} +1 -1
- package/chunks/{chunk-WB34KMOT.js → chunk-W2CV36HT.js} +1 -1
- package/chunks/{chunk-ADTFKUH2.js → chunk-WCI33URB.js} +1 -1
- package/chunks/{chunk-4TYTJQWR.js → chunk-WEPC42YR.js} +1 -1
- package/chunks/{chunk-YGHM5CDT.js → chunk-WF7Q3ZSQ.js} +1 -1
- package/chunks/{chunk-UJYOILZR.js → chunk-WK666FGZ.js} +3 -3
- package/chunks/{chunk-3WQPUP5U.js → chunk-WMLYHZZX.js} +1 -1
- package/chunks/{chunk-OCBJCZC2.js → chunk-WSI4G7XC.js} +1 -1
- package/chunks/{chunk-Q6QS5JTK.js → chunk-WXK7Z45R.js} +1 -1
- package/chunks/{chunk-6NI33TVK.js → chunk-X2TY7VTY.js} +1 -1
- package/chunks/{chunk-BBOJUFMW.js → chunk-YWK3E4WJ.js} +1 -1
- package/chunks/{chunk-FNXO5KWB.js → chunk-YY4GWNTU.js} +2 -2
- package/chunks/{chunk-FLJLUMQF.js → chunk-ZFOEVHWG.js} +1 -1
- package/chunks/{codex-subagent-executor-EK3A2WBH.js → codex-subagent-executor-GPTKVP7H.js} +1 -1
- package/chunks/{config-utils-DLOK7OLM.js → config-utils-6B5FHBSF.js} +1 -1
- package/chunks/{contextCommand-AVCUCHQC.js → contextCommand-FGRDE3GA.js} +1 -1
- package/chunks/{core-runtime-QSS4ZTG6.js → core-runtime-OFEHSKDB.js} +1 -1
- package/chunks/{create-sub-session-PNF7QDKC.js → create-sub-session-D2KEWVHQ.js} +1 -1
- package/chunks/{cron-create-C6JOFIU4.js → cron-create-RFGGKTL7.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-5XZAZ7D2.js → daemon-git-worktree-guard-AV752IOZ.js} +1 -1
- package/chunks/{daemon-status-provider-MRNELSNJ.js → daemon-status-provider-GHQBRDMC.js} +1 -1
- package/chunks/{daemon-trust-policy-26CMW3WY.js → daemon-trust-policy-24ENJNTQ.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-3DWO6NQY.js → daemon-trust-policy-monitor-NMSQAGWV.js} +1 -1
- package/chunks/{deferred-core-runtime-DEC3N46T.js → deferred-core-runtime-5BAMFFOI.js} +1 -1
- package/chunks/{edit-3HMQPCHN.js → edit-XCECLEH3.js} +1 -1
- package/chunks/{enterPlanMode-QHJF4JXZ.js → enterPlanMode-SEN2PMRM.js} +1 -1
- package/chunks/{environment-NGIBJWOT.js → environment-CCPQJYKS.js} +1 -1
- package/chunks/{errors-MSTGCVGJ.js → errors-Y6HHUTGK.js} +1 -1
- package/chunks/{execution-tool-VR4TGOI4.js → execution-tool-HADWGMIG.js} +1 -1
- package/chunks/{execution-worker-EJH7HIE2.js → execution-worker-GZS7WOQL.js} +1 -1
- package/chunks/{exitPlanMode-P25OHQJ6.js → exitPlanMode-76B5HDLT.js} +1 -1
- package/chunks/{fast-path-II433ZDP.js → fast-path-OEV7LQYV.js} +1 -1
- package/chunks/{glob-4Q6DCT3F.js → glob-NLWCQRMS.js} +1 -1
- package/chunks/{goal-tools-FFMAJW6V.js → goal-tools-43XV33BT.js} +1 -1
- package/chunks/{handleAutoUpdate-QNM26NZK.js → handleAutoUpdate-JDQWGSSP.js} +1 -1
- package/chunks/{i18n-L5URVOBB.js → i18n-JW6BVEGF.js} +1 -1
- package/chunks/{initializer-NQ2NECYP.js → initializer-UT6JLZ3O.js} +1 -1
- package/chunks/{installationInfo-BCTXASUM.js → installationInfo-LKWDV3S2.js} +1 -1
- package/chunks/{interactive-mod-session-PPTBI37E.js → interactive-mod-session-2KWKYVPC.js} +1 -1
- package/chunks/{list-7TE5TUZJ.js → list-BKINK3S2.js} +1 -1
- package/chunks/{llm-BWWKUBBZ.js → llm-3RWXAVM2.js} +4 -4
- package/chunks/{llm-content-generator-QOTGPBYC.js → llm-content-generator-MDRBSH73.js} +1 -1
- package/chunks/{loadedSettingsAdapter-THAGI5M2.js → loadedSettingsAdapter-WWJUKWUN.js} +1 -1
- package/chunks/{local-7BTAGV4J.js → local-TT4FLCTR.js} +1 -1
- package/chunks/{local-execution-environment-S3OR4KSC.js → local-execution-environment-OBA6VWYL.js} +1 -1
- package/chunks/{loggingContentGenerator-AXJ5E5RS.js → loggingContentGenerator-CK7IKYQH.js} +1 -1
- package/chunks/{loop-wakeup-AJTLMLRX.js → loop-wakeup-4MSRX3DY.js} +1 -1
- package/chunks/{manage-memory-JHTUVMDJ.js → manage-memory-PX5PZJKZ.js} +1 -1
- package/chunks/{managed-execution-engine-U6GNJ4U4.js → managed-execution-engine-WMAUR3ZK.js} +1 -1
- package/chunks/{managed-local-serve-P4ZXVRBU.js → managed-local-serve-X7REHGB4.js} +1 -1
- package/chunks/{managed-npm-update-UDUILNR5.js → managed-npm-update-6HUVAJH7.js} +1 -1
- package/chunks/{managed-runtime-attestation-worker-P34ZBNRG.js → managed-runtime-attestation-worker-F4AT53M5.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-CLMYNPH5.js → managed-runtime-bootstrap-3BP5JRJX.js} +1 -1
- package/chunks/{managed-runtime-session-worker-7H7AZJBV.js → managed-runtime-session-worker-2PO7J5UK.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-5KEMC7FD.js → managed-runtime-ssh-worker-4N7EMRSV.js} +1 -1
- package/chunks/{managed-session-authority-CFUZ45HT.js → managed-session-authority-MYOYTUM2.js} +1 -1
- package/chunks/{mcp-YMG4RVMC.js → mcp-5OTEMZ7P.js} +1 -1
- package/chunks/{memory-7STURUXK.js → memory-TNW7RSAV.js} +1 -1
- package/chunks/mn-JMS6SWTO.js +8 -0
- package/chunks/{model-call-collection-WBWTO3EG.js → model-call-collection-KNTWFZQS.js} +1 -1
- package/chunks/{model-configuration-6KCZZSZD.js → model-configuration-U5C5P5UQ.js} +1 -1
- package/chunks/{modelConfigUtils-Z2EKFSPN.js → modelConfigUtils-R4KFI2WK.js} +1 -1
- package/chunks/{monitor-U5E33JO6.js → monitor-RD2PFK42.js} +1 -1
- package/chunks/{nonInteractiveCli-BVCL5I5R.js → nonInteractiveCli-QQ72HZSH.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-B4EUOMYF.js → nonInteractiveToolExecutor-QPQYR6IS.js} +1 -1
- package/chunks/{notebook-edit-MXKD5J2C.js → notebook-edit-YLRN3UZT.js} +1 -1
- package/chunks/{omni-I5YECZBW.js → omni-CUJ52EW5.js} +1 -1
- package/chunks/{openaiContentGenerator-Q5SINFJJ.js → openaiContentGenerator-6B5MAU54.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-R3XCZLZY.js → openaiResponsesContentGenerator-I245I3R7.js} +1 -1
- package/chunks/{pidfile-UOGUNUTK.js → pidfile-P2HIGAUA.js} +1 -1
- package/chunks/{processUtils-QGQGZHBA.js → processUtils-JSKN5UGS.js} +1 -1
- package/chunks/{prompt-terminal-ledger-L57JMVSR.js → prompt-terminal-ledger-F5TSXVGU.js} +1 -1
- package/chunks/{qwenContentGenerator-UKZ237LC.js → qwenContentGenerator-IEDZONWG.js} +1 -1
- package/chunks/{reactive-degrade-3OM3HWVA.js → reactive-degrade-FYZBJCF6.js} +1 -1
- package/chunks/{read-file-63ZLWMOW.js → read-file-VNZNSD6X.js} +1 -1
- package/chunks/{resumeHistoryUtils-R5YQS4YQ.js → resumeHistoryUtils-IDPE6N2N.js} +1 -1
- package/chunks/{review-AT6OWVDO.js → review-TBJRZWTD.js} +1 -1
- package/chunks/{ripGrep-7KBZGTPV.js → ripGrep-4W5B5FOE.js} +1 -1
- package/chunks/{run-qwen-serve-CLBG7W6F.js → run-qwen-serve-44X262G5.js} +1 -1
- package/chunks/{runtime-R3QIGB7U.js → runtime-6H6LKD73.js} +1 -1
- package/chunks/{sandboxConfig-PM3ZRQYV.js → sandboxConfig-SQXDRGVN.js} +1 -1
- package/chunks/{scheduled-tasks-PUMNN5XV.js → scheduled-tasks-62IZKHJG.js} +1 -1
- package/chunks/{scheduler-KTPM226B.js → scheduler-QUCXJYRL.js} +1 -1
- package/chunks/{search-memory-7I5MGDNV.js → search-memory-TC2Z34QN.js} +1 -1
- package/chunks/{send-message-J526AEBI.js → send-message-TFZX7KI7.js} +1 -1
- package/chunks/{serve-KLTMPK4W.js → serve-WSICDFGG.js} +1 -1
- package/chunks/{server-VLRNY6KG.js → server-GYYVTNGY.js} +3 -3
- package/chunks/{session-2EB57NXY.js → session-KF3O23ZJ.js} +1 -1
- package/chunks/{session-attachments-root-I7TESMWL.js → session-attachments-root-7HFUSONH.js} +1 -1
- package/chunks/{session-execution-engine-selector-5FAMSPSO.js → session-execution-engine-selector-NVILT6BR.js} +1 -1
- package/chunks/{session-pr-refresh-JCPVQPNJ.js → session-pr-refresh-3KDFTDEV.js} +1 -1
- package/chunks/{sessionService-YRW2IFPR.js → sessionService-XRTFLPDW.js} +1 -1
- package/chunks/{settings-KO2Q47JP.js → settings-QPPK6WXE.js} +1 -1
- package/chunks/{shell-OLZVNTQZ.js → shell-WYQDZWL7.js} +1 -1
- package/chunks/{skill-XW2AQS7M.js → skill-FYPT6AU7.js} +1 -1
- package/chunks/{skill-settings-TKAVQ4XP.js → skill-settings-OGFI5KZF.js} +1 -1
- package/chunks/{spawnChannel-MBGCTK2J.js → spawnChannel-ANOOVPG7.js} +1 -1
- package/chunks/{standalone-update-A3YLLIAN.js → standalone-update-45WTDY4E.js} +1 -1
- package/chunks/{start-opentui-ui-G5ROAR4V.js → start-opentui-ui-TL5WK33V.js} +1 -1
- package/chunks/{startInteractiveUI-PZQR4U53.js → startInteractiveUI-N2IREVBM.js} +1 -1
- package/chunks/{team-create-S5ZY2UMF.js → team-create-R77PRZ5U.js} +1 -1
- package/chunks/{team-plan-approval-KX6RXEST.js → team-plan-approval-6DCRKB5I.js} +1 -1
- package/chunks/{terminal-image-renderer-SCJREXE6.js → terminal-image-renderer-TB7EX2WW.js} +1 -1
- package/chunks/{theme-manager-DZSM4EBR.js → theme-manager-RQDXJGVR.js} +1 -1
- package/chunks/{tool-call-UK56SWCT.js → tool-call-LVB4NCDT.js} +1 -1
- package/chunks/{tool-result-media-JLLSLGFL.js → tool-result-media-LRBB2KS6.js} +1 -1
- package/chunks/{tool-search-OWPFLVV5.js → tool-search-OG73QAQZ.js} +1 -1
- package/chunks/{total-session-admission-NQU4ACKH.js → total-session-admission-A4CUF6AD.js} +1 -1
- package/chunks/{trustedFolders-N7GXFYSF.js → trustedFolders-LSGOYTU2.js} +1 -1
- package/chunks/{update-relaunch-5SPXXHM2.js → update-relaunch-OGC6BZO7.js} +1 -1
- package/chunks/{updateCheck-VXUIX2XG.js → updateCheck-7J3GXTER.js} +1 -1
- package/chunks/{upload-config-OWLL4SRQ.js → upload-config-ML5XEJIF.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-OUYRR56F.js → useAutoAcceptIndicator-6DH6GQ2X.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-PSVJO5HK.js → validateNonInterActiveAuth-KJDAGZCM.js} +1 -1
- package/chunks/{version-C26S7UAW.js → version-7JN2YXL2.js} +1 -1
- package/chunks/{web-fetch-AYOYV7R4.js → web-fetch-42ZR4FEZ.js} +1 -1
- package/chunks/{web-search-DAREKD3Z.js → web-search-74NLPMZJ.js} +1 -1
- package/chunks/{workflow-WBGPKVO6.js → workflow-WNPHX42I.js} +1 -1
- package/chunks/{workflow-ancestor-trust-GEEB53TB.js → workflow-ancestor-trust-HGF6G7LQ.js} +1 -1
- package/chunks/{workspace-agents-IMAQME4W.js → workspace-agents-3YFBFAK3.js} +1 -1
- package/chunks/{workspace-providers-status-VALHVEU2.js → workspace-providers-status-EPJI6KRV.js} +1 -1
- package/chunks/{workspace-recovery-worker-AIAVRDGU.js → workspace-recovery-worker-T3FK5YOD.js} +1 -1
- package/chunks/{workspace-registration-store-FXEGZG3L.js → workspace-registration-store-VEXYBDMA.js} +1 -1
- package/chunks/{workspace-registry-GYFFHWCD.js → workspace-registry-NRZYTP2X.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-VZ462TLU.js → workspace-runtime-coordinator-USNSTP2V.js} +1 -1
- package/chunks/{workspace-service-5DIZM4IZ.js → workspace-service-USATWO56.js} +1 -1
- package/chunks/{workspace-skills-status-DOOBVL5N.js → workspace-skills-status-M5JTSFDL.js} +1 -1
- package/chunks/{workspace-trust-reconciler-LOICVUVW.js → workspace-trust-reconciler-ZUZ2O5WC.js} +1 -1
- package/chunks/{write-file-EJNMAHQD.js → write-file-UMJVKE4S.js} +1 -1
- package/chunks/{zoom-image-S3OARMYP.js → zoom-image-76XYHQ3Z.js} +1 -1
- package/cli.js +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/gerege.mjs +64 -15
- package/locales/mn.js +2702 -3774
- package/package.json +3 -3
- package/chunks/mn-YH2OTBWJ.js +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{resolveSupportedLanguage}from"./chunk-U7HZUZKP.js";import{resolveBundleDir}from"./chunk-4NPYOXJO.js";import{writeStderrLine}from"./chunk-M4ECEHLX.js";import{Storage}from"./chunk-EPODBRBP.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__glob,__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs";import*as path from"node:path";import{pathToFileURL}from"node:url";init_esbuild_shims();function getTranslationModuleExport(module){return Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module}__name(getTranslationModuleExport,"getTranslationModuleExport");function isTranslationDict(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)&&Object.keys(value).length>0}__name(isTranslationDict,"isTranslationDict");init_esbuild_shims();var MUST_TRANSLATE_KEYS=["Instruction files","Auto memory","View or change the language setting","List background tasks (text dump \u2014 interactive dialog opens via the footer pill)","Delete a previous session","Run installation and environment diagnostics","Browse dynamic model catalogs and choose which models stay enabled locally","Generate a one-line session recap now","Rename the current conversation. --auto lets the fast model pick a title.","Rewind conversation to a previous turn","Spawn a background agent that inherits the full conversation","Please provide a directive. Usage: /fork <directive>","Cannot fork while a response or tool call is in progress. Wait for it to finish or resolve the pending tool call.","Cannot fork before the first conversation turn.","The agent tool is unavailable; cannot fork.","Failed to launch fork: {{error}}","User launched a background fork via /fork: {{directive}}","Forked into a background agent. It inherits this conversation and runs without blocking \u2014 track it in the background tasks panel; it reports back when done.","Processing summary...","Project summary generated and saved successfully!","Saved to: {{filePath}}","Stopped because","Set UI language","Usage: /language ui [{{options}}]","Invalid language. Available: {{options}}","To request additional UI language packs, please open an issue on GitHub.","Open MCP management dialog","Manage MCP servers","Open the skills panel (browse, search, toggle, pick).","Manage Skills","Skills configuration saved.","Space toggle \xB7 Enter pick (fill input) \xB7 Esc save & exit \xB7 workspace scope","Tools","prompts","tools","Ask a quick side question without affecting the main conversation","Get a second opinion on the current conversation from a reviewer model","Consulting advisor...","Advisor review failed: {{error}}","No conversation context available for /advisor","Focus too long (max {{max}} chars)","Another operation is in progress, wait for it to complete before running /advisor","No response received.","No model configured.","Manage Arena sessions","Start an Arena session with multiple models competing on the same task","Stop the current Arena session","Show the current Arena session status","Select a model result and merge its diff into the current workspace","Switch to plan mode or exit plan mode","Exited plan mode. Previous approval mode restored.","Enabled plan mode. The agent will analyze and plan without executing tools.",'Already in plan mode. Use "/plan exit" to exit plan mode.','Not in plan mode. Use "/plan" to enter plan mode first.',"Open the memory manager.","Save a durable memory to the memory system.",'Show context window usage breakdown. Use "/context detail" for per-item breakdown.',"Show per-item context usage breakdown.","Manage extensions","Manage installed extensions","Install an extension from a git repo or local path","Disable an extension","Enable an extension","Uninstall an extension","Manage extension settings","Lists installed extensions.","Updates all extensions or a named extension to the latest version.","Open extensions page in your browser","Manage Extensions","Extension Details","View Extension","Update Extension","Disable Extension","Enable Extension","Uninstall Extension","Select Scope","User Scope","Workspace Scope","No extensions found.","Toggle this help display","Toggle shell mode","Open command menu","Add file context","Accept suggestion / Autocomplete","Reverse search history","Lock release warning","Metadata write warning","Subsequent dreams may be skipped as locked until the next session's staleness sweep cleans the file.","The scheduler gate did not see this dream's timestamp; the next dream cycle may re-fire sooner than usual.","Press ? again to close","? for shortcuts",'Invalid approval mode "{{arg}}". Valid modes: {{modes}}','Approval mode set to "{{mode}}"',"auto_mode.entry_notice","Set up Qwen Code's status line UI","Cached (included in Input): {{tokens}}","By source:","Unclosed quote in arguments.","Token usage export path must be within the project working directory.","Failed to load token usage stats: {{error}}","Failed to export token usage stats: {{error}}","Note: generation timing (TTFT/TPS) belongs to generation metrics.","Cannot resolve export path within the working directory.","Export target does not exist: {{path}}","Could not create a temporary export file.","Activity","Efficiency","Today","Cache Hit Rate","Tool Success","Avg Latency","Generation Metrics","Latest Request","Generation Time","Average TTFT","Session TPS","Tool Leaderboard","Code Impact","streak","best","Token Trend","In/Out","Unset","Update requires sudo. Please run:","Standalone install detected. Please rerun the standalone installer to update:"];var globImport_locales_js=__glob({"./locales/ca.js":()=>import("./ca-AY2LODT4.js"),"./locales/de.js":()=>import("./de-RUEJN3DX.js"),"./locales/en.js":()=>import("./en-B2LSQ6X3.js"),"./locales/fr.js":()=>import("./fr-CUGMO3PJ.js"),"./locales/ja.js":()=>import("./ja-EPE2LFM4.js"),"./locales/mn.js":()=>import("./mn-YH2OTBWJ.js"),"./locales/pt.js":()=>import("./pt-VUQHDGUA.js"),"./locales/ru.js":()=>import("./ru-67D7IXZZ.js"),"./locales/zh-TW.js":()=>import("./zh-TW-NW3SGSBD.js"),"./locales/zh.js":()=>import("./zh-4DCOSRJR.js")});var currentLanguage="en";var translations={};var translationCache={};var loadingPromises={};var getBuiltinLocalesDir=__name(()=>path.join(resolveBundleDir(import.meta.url),"locales"),"getBuiltinLocalesDir");var getUserLocalesDir=__name(()=>path.join(Storage.getGlobalQwenDir(),"locales"),"getUserLocalesDir");function getUserLocalesDirectory(){return getUserLocalesDir()}__name(getUserLocalesDirectory,"getUserLocalesDirectory");var getLocalePath=__name((lang,useUserDir=false)=>{const baseDir=useUserDir?getUserLocalesDir():getBuiltinLocalesDir();return path.join(baseDir,`${lang}.js`)},"getLocalePath");function detectSystemLanguage(){const envLang=process.env["QWEN_CODE_LANG"]||process.env["LANG"];if(envLang){const resolved=resolveSupportedLanguage(envLang);if(resolved){return resolved}}try{const locale=Intl.DateTimeFormat().resolvedOptions().locale;const resolved=resolveSupportedLanguage(locale);if(resolved){return resolved}}catch{}return"en"}__name(detectSystemLanguage,"detectSystemLanguage");async function tryImportTranslations(moduleSpecifier){try{const module=await import(moduleSpecifier);const result=getTranslationModuleExport(module);if(isTranslationDict(result)){return{translations:result}}return{error:new Error("Module loaded but result is empty or invalid")}}catch(error){return{error:error instanceof Error?error:new Error(String(error))}}}__name(tryImportTranslations,"tryImportTranslations");async function tryImportBundledTranslations(lang){try{const module=await globImport_locales_js(`./locales/${lang}.js`);const result=getTranslationModuleExport(module);if(isTranslationDict(result)){return{translations:result}}return{error:new Error("Module loaded but result is empty or invalid")}}catch(error){return{error:error instanceof Error?error:new Error(String(error))}}}__name(tryImportBundledTranslations,"tryImportBundledTranslations");async function loadTranslationsAsync(lang){if(translationCache[lang]){return translationCache[lang]}const existingPromise=loadingPromises[lang];if(existingPromise){return existingPromise}const loadPromise=(async()=>{const userJsPath=getLocalePath(lang,true);if(fs.existsSync(getUserLocalesDir())&&fs.existsSync(userJsPath)){const userResult=await tryImportTranslations(pathToFileURL(userJsPath).href);if(userResult.translations){translationCache[lang]=userResult.translations;return userResult.translations}writeStderrLine(`Failed to load translations from user directory for ${lang}: ${userResult.error.message}`)}const builtinJsPath=getLocalePath(lang,false);const builtinModuleSpecifiers=[];if(fs.existsSync(getBuiltinLocalesDir())&&fs.existsSync(builtinJsPath)){builtinModuleSpecifiers.push(pathToFileURL(builtinJsPath).href)}let lastBuiltinError;for(const moduleSpecifier of builtinModuleSpecifiers){const builtinResult=await tryImportTranslations(moduleSpecifier);if(builtinResult.translations){translationCache[lang]=builtinResult.translations;return builtinResult.translations}lastBuiltinError=builtinResult.error}const bundledBuiltinResult=await tryImportBundledTranslations(lang);if(bundledBuiltinResult.translations){translationCache[lang]=bundledBuiltinResult.translations;return bundledBuiltinResult.translations}lastBuiltinError=bundledBuiltinResult.error;if(lastBuiltinError){writeStderrLine(`Failed to load JS translations for ${lang}: ${lastBuiltinError.message}`)}translationCache[lang]={};return{}})();loadingPromises[lang]=loadPromise;loadPromise.finally(()=>{delete loadingPromises[lang]});return loadPromise}__name(loadTranslationsAsync,"loadTranslationsAsync");function loadTranslations(lang){return translationCache[lang]||{}}__name(loadTranslations,"loadTranslations");function interpolate(template,params){if(!params)return template;return template.replace(/\{\{(\w+)\}\}/g,(match,key)=>params[key]??match)}__name(interpolate,"interpolate");function resolveLanguage(lang){if(lang==="auto"){return detectSystemLanguage()}return resolveSupportedLanguage(lang)??lang}__name(resolveLanguage,"resolveLanguage");function setLanguage(lang){const resolvedLang=resolveLanguage(lang);currentLanguage=resolvedLang;const loaded=loadTranslations(resolvedLang);translations=loaded;if(Object.keys(loaded).length===0){const userJsPath=getLocalePath(resolvedLang,true);const builtinJsPath=getLocalePath(resolvedLang,false);if(fs.existsSync(userJsPath)||fs.existsSync(builtinJsPath)){writeStderrLine(`Language file for ${resolvedLang} requires async loading. Use setLanguageAsync() instead, or call initializeI18n() first.`)}}}__name(setLanguage,"setLanguage");async function setLanguageAsync(lang){currentLanguage=resolveLanguage(lang);translations=await loadTranslationsAsync(currentLanguage)}__name(setLanguageAsync,"setLanguageAsync");function getCurrentLanguage(){return currentLanguage}__name(getCurrentLanguage,"getCurrentLanguage");function t(key,params){const translation=translations[key]??key;if(Array.isArray(translation)){return key}return interpolate(translation,params)}__name(t,"t");function localizeToolDisplayName(displayName){const key=`toolDisplayName.${displayName}`;const translated=t(key);return translated===key?displayName:translated}__name(localizeToolDisplayName,"localizeToolDisplayName");function ta(key){const translation=translations[key];if(Array.isArray(translation)){return translation}return[]}__name(ta,"ta");async function initializeI18n(lang){await setLanguageAsync(lang??"auto")}__name(initializeI18n,"initializeI18n");function resolveLanguageSetting(settingsLanguage){return process.env["QWEN_CODE_LANG"]||settingsLanguage||"mn"}__name(resolveLanguageSetting,"resolveLanguageSetting");export{MUST_TRANSLATE_KEYS,getUserLocalesDirectory,detectSystemLanguage,resolveLanguage,setLanguage,setLanguageAsync,getCurrentLanguage,t,localizeToolDisplayName,ta,initializeI18n,resolveLanguageSetting};
|
|
3
|
+
import{resolveSupportedLanguage}from"./chunk-U7HZUZKP.js";import{resolveBundleDir}from"./chunk-4NPYOXJO.js";import{writeStderrLine}from"./chunk-M4ECEHLX.js";import{Storage}from"./chunk-EPODBRBP.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__glob,__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs";import*as path from"node:path";import{pathToFileURL}from"node:url";init_esbuild_shims();function getTranslationModuleExport(module){return Object.prototype.hasOwnProperty.call(module,"default")?module["default"]:module}__name(getTranslationModuleExport,"getTranslationModuleExport");function isTranslationDict(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)&&Object.keys(value).length>0}__name(isTranslationDict,"isTranslationDict");init_esbuild_shims();var MUST_TRANSLATE_KEYS=["Instruction files","Auto memory","View or change the language setting","List background tasks (text dump \u2014 interactive dialog opens via the footer pill)","Delete a previous session","Run installation and environment diagnostics","Browse dynamic model catalogs and choose which models stay enabled locally","Generate a one-line session recap now","Rename the current conversation. --auto lets the fast model pick a title.","Rewind conversation to a previous turn","Spawn a background agent that inherits the full conversation","Please provide a directive. Usage: /fork <directive>","Cannot fork while a response or tool call is in progress. Wait for it to finish or resolve the pending tool call.","Cannot fork before the first conversation turn.","The agent tool is unavailable; cannot fork.","Failed to launch fork: {{error}}","User launched a background fork via /fork: {{directive}}","Forked into a background agent. It inherits this conversation and runs without blocking \u2014 track it in the background tasks panel; it reports back when done.","Processing summary...","Project summary generated and saved successfully!","Saved to: {{filePath}}","Stopped because","Set UI language","Usage: /language ui [{{options}}]","Invalid language. Available: {{options}}","To request additional UI language packs, please open an issue on GitHub.","Open MCP management dialog","Manage MCP servers","Open the skills panel (browse, search, toggle, pick).","Manage Skills","Skills configuration saved.","Space toggle \xB7 Enter pick (fill input) \xB7 Esc save & exit \xB7 workspace scope","Tools","prompts","tools","Ask a quick side question without affecting the main conversation","Get a second opinion on the current conversation from a reviewer model","Consulting advisor...","Advisor review failed: {{error}}","No conversation context available for /advisor","Focus too long (max {{max}} chars)","Another operation is in progress, wait for it to complete before running /advisor","No response received.","No model configured.","Manage Arena sessions","Start an Arena session with multiple models competing on the same task","Stop the current Arena session","Show the current Arena session status","Select a model result and merge its diff into the current workspace","Switch to plan mode or exit plan mode","Exited plan mode. Previous approval mode restored.","Enabled plan mode. The agent will analyze and plan without executing tools.",'Already in plan mode. Use "/plan exit" to exit plan mode.','Not in plan mode. Use "/plan" to enter plan mode first.',"Open the memory manager.","Save a durable memory to the memory system.",'Show context window usage breakdown. Use "/context detail" for per-item breakdown.',"Show per-item context usage breakdown.","Manage extensions","Manage installed extensions","Install an extension from a git repo or local path","Disable an extension","Enable an extension","Uninstall an extension","Manage extension settings","Lists installed extensions.","Updates all extensions or a named extension to the latest version.","Open extensions page in your browser","Manage Extensions","Extension Details","View Extension","Update Extension","Disable Extension","Enable Extension","Uninstall Extension","Select Scope","User Scope","Workspace Scope","No extensions found.","Toggle this help display","Toggle shell mode","Open command menu","Add file context","Accept suggestion / Autocomplete","Reverse search history","Lock release warning","Metadata write warning","Subsequent dreams may be skipped as locked until the next session's staleness sweep cleans the file.","The scheduler gate did not see this dream's timestamp; the next dream cycle may re-fire sooner than usual.","Press ? again to close","? for shortcuts",'Invalid approval mode "{{arg}}". Valid modes: {{modes}}','Approval mode set to "{{mode}}"',"auto_mode.entry_notice","Set up Qwen Code's status line UI","Cached (included in Input): {{tokens}}","By source:","Unclosed quote in arguments.","Token usage export path must be within the project working directory.","Failed to load token usage stats: {{error}}","Failed to export token usage stats: {{error}}","Note: generation timing (TTFT/TPS) belongs to generation metrics.","Cannot resolve export path within the working directory.","Export target does not exist: {{path}}","Could not create a temporary export file.","Activity","Efficiency","Today","Cache Hit Rate","Tool Success","Avg Latency","Generation Metrics","Latest Request","Generation Time","Average TTFT","Session TPS","Tool Leaderboard","Code Impact","streak","best","Token Trend","In/Out","Unset","Update requires sudo. Please run:","Standalone install detected. Please rerun the standalone installer to update:"];var globImport_locales_js=__glob({"./locales/ca.js":()=>import("./ca-AY2LODT4.js"),"./locales/de.js":()=>import("./de-RUEJN3DX.js"),"./locales/en.js":()=>import("./en-B2LSQ6X3.js"),"./locales/fr.js":()=>import("./fr-CUGMO3PJ.js"),"./locales/ja.js":()=>import("./ja-EPE2LFM4.js"),"./locales/mn.js":()=>import("./mn-JMS6SWTO.js"),"./locales/pt.js":()=>import("./pt-VUQHDGUA.js"),"./locales/ru.js":()=>import("./ru-67D7IXZZ.js"),"./locales/zh-TW.js":()=>import("./zh-TW-NW3SGSBD.js"),"./locales/zh.js":()=>import("./zh-4DCOSRJR.js")});var currentLanguage="en";var translations={};var translationCache={};var loadingPromises={};var getBuiltinLocalesDir=__name(()=>path.join(resolveBundleDir(import.meta.url),"locales"),"getBuiltinLocalesDir");var getUserLocalesDir=__name(()=>path.join(Storage.getGlobalQwenDir(),"locales"),"getUserLocalesDir");function getUserLocalesDirectory(){return getUserLocalesDir()}__name(getUserLocalesDirectory,"getUserLocalesDirectory");var getLocalePath=__name((lang,useUserDir=false)=>{const baseDir=useUserDir?getUserLocalesDir():getBuiltinLocalesDir();return path.join(baseDir,`${lang}.js`)},"getLocalePath");function detectSystemLanguage(){const envLang=process.env["QWEN_CODE_LANG"]||process.env["LANG"];if(envLang){const resolved=resolveSupportedLanguage(envLang);if(resolved){return resolved}}try{const locale=Intl.DateTimeFormat().resolvedOptions().locale;const resolved=resolveSupportedLanguage(locale);if(resolved){return resolved}}catch{}return"en"}__name(detectSystemLanguage,"detectSystemLanguage");async function tryImportTranslations(moduleSpecifier){try{const module=await import(moduleSpecifier);const result=getTranslationModuleExport(module);if(isTranslationDict(result)){return{translations:result}}return{error:new Error("Module loaded but result is empty or invalid")}}catch(error){return{error:error instanceof Error?error:new Error(String(error))}}}__name(tryImportTranslations,"tryImportTranslations");async function tryImportBundledTranslations(lang){try{const module=await globImport_locales_js(`./locales/${lang}.js`);const result=getTranslationModuleExport(module);if(isTranslationDict(result)){return{translations:result}}return{error:new Error("Module loaded but result is empty or invalid")}}catch(error){return{error:error instanceof Error?error:new Error(String(error))}}}__name(tryImportBundledTranslations,"tryImportBundledTranslations");async function loadTranslationsAsync(lang){if(translationCache[lang]){return translationCache[lang]}const existingPromise=loadingPromises[lang];if(existingPromise){return existingPromise}const loadPromise=(async()=>{const userJsPath=getLocalePath(lang,true);if(fs.existsSync(getUserLocalesDir())&&fs.existsSync(userJsPath)){const userResult=await tryImportTranslations(pathToFileURL(userJsPath).href);if(userResult.translations){translationCache[lang]=userResult.translations;return userResult.translations}writeStderrLine(`Failed to load translations from user directory for ${lang}: ${userResult.error.message}`)}const builtinJsPath=getLocalePath(lang,false);const builtinModuleSpecifiers=[];if(fs.existsSync(getBuiltinLocalesDir())&&fs.existsSync(builtinJsPath)){builtinModuleSpecifiers.push(pathToFileURL(builtinJsPath).href)}let lastBuiltinError;for(const moduleSpecifier of builtinModuleSpecifiers){const builtinResult=await tryImportTranslations(moduleSpecifier);if(builtinResult.translations){translationCache[lang]=builtinResult.translations;return builtinResult.translations}lastBuiltinError=builtinResult.error}const bundledBuiltinResult=await tryImportBundledTranslations(lang);if(bundledBuiltinResult.translations){translationCache[lang]=bundledBuiltinResult.translations;return bundledBuiltinResult.translations}lastBuiltinError=bundledBuiltinResult.error;if(lastBuiltinError){writeStderrLine(`Failed to load JS translations for ${lang}: ${lastBuiltinError.message}`)}translationCache[lang]={};return{}})();loadingPromises[lang]=loadPromise;loadPromise.finally(()=>{delete loadingPromises[lang]});return loadPromise}__name(loadTranslationsAsync,"loadTranslationsAsync");function loadTranslations(lang){return translationCache[lang]||{}}__name(loadTranslations,"loadTranslations");function interpolate(template,params){if(!params)return template;return template.replace(/\{\{(\w+)\}\}/g,(match,key)=>params[key]??match)}__name(interpolate,"interpolate");function resolveLanguage(lang){if(lang==="auto"){return detectSystemLanguage()}return resolveSupportedLanguage(lang)??lang}__name(resolveLanguage,"resolveLanguage");function setLanguage(lang){const resolvedLang=resolveLanguage(lang);currentLanguage=resolvedLang;const loaded=loadTranslations(resolvedLang);translations=loaded;if(Object.keys(loaded).length===0){const userJsPath=getLocalePath(resolvedLang,true);const builtinJsPath=getLocalePath(resolvedLang,false);if(fs.existsSync(userJsPath)||fs.existsSync(builtinJsPath)){writeStderrLine(`Language file for ${resolvedLang} requires async loading. Use setLanguageAsync() instead, or call initializeI18n() first.`)}}}__name(setLanguage,"setLanguage");async function setLanguageAsync(lang){currentLanguage=resolveLanguage(lang);translations=await loadTranslationsAsync(currentLanguage)}__name(setLanguageAsync,"setLanguageAsync");function getCurrentLanguage(){return currentLanguage}__name(getCurrentLanguage,"getCurrentLanguage");function t(key,params){const translation=translations[key]??key;if(Array.isArray(translation)){return key}return interpolate(translation,params)}__name(t,"t");function localizeToolDisplayName(displayName){const key=`toolDisplayName.${displayName}`;const translated=t(key);return translated===key?displayName:translated}__name(localizeToolDisplayName,"localizeToolDisplayName");function ta(key){const translation=translations[key];if(Array.isArray(translation)){return translation}return[]}__name(ta,"ta");async function initializeI18n(lang){await setLanguageAsync(lang??"auto")}__name(initializeI18n,"initializeI18n");function resolveLanguageSetting(settingsLanguage){return process.env["QWEN_CODE_LANG"]||settingsLanguage||"mn"}__name(resolveLanguageSetting,"resolveLanguageSetting");export{MUST_TRANSLATE_KEYS,getUserLocalesDirectory,detectSystemLanguage,resolveLanguage,setLanguage,setLanguageAsync,getCurrentLanguage,t,localizeToolDisplayName,ta,initializeI18n,resolveLanguageSetting};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{MAX_WORKSPACE_PATH_LENGTH,canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{getGlobalQwenDirLite}from"./chunk-PTHIQ7ZN.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{isUnverifiableIdentityError,openNoFollow}from"./chunk-QXQGUM3Y.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{createHash}from"node:crypto";import*as fs from"node:fs/promises";import*as os from"node:os";import*as path from"node:path";init_esbuild_shims();var MAX_REGISTERED_WORKSPACES=256;var MAX_CONFIGURED_REGISTERED_WORKSPACES=256;var QWEN_SERVE_MAX_WORKSPACES_ENV="QWEN_SERVE_MAX_WORKSPACES";function resolveMaxRegisteredWorkspaces(configured,env){const raw=env[QWEN_SERVE_MAX_WORKSPACES_ENV];const value=configured??(raw===void 0?MAX_REGISTERED_WORKSPACES:/^\d+$/.test(raw.trim())?Number(raw.trim()):Number.NaN);if(!Number.isSafeInteger(value)||value<1||value>MAX_CONFIGURED_REGISTERED_WORKSPACES){const source=configured===void 0?`${QWEN_SERVE_MAX_WORKSPACES_ENV}=${JSON.stringify(raw)}`:`maxRegisteredWorkspaces option ${String(configured)}`;throw new TypeError(`Invalid ${source}: must be an integer from 1 to ${MAX_CONFIGURED_REGISTERED_WORKSPACES}.`)}return value}__name(resolveMaxRegisteredWorkspaces,"resolveMaxRegisteredWorkspaces");var DuplicateWorkspaceInputError=class extends Error{static{__name(this,"DuplicateWorkspaceInputError")}constructor(workspace){super(`Duplicate --workspace value resolves to ${JSON.stringify(workspace)}. Pass distinct --workspace values.`);this.name="DuplicateWorkspaceInputError"}};var NestedWorkspaceInputError=class extends Error{static{__name(this,"NestedWorkspaceInputError")}constructor(parent,child){super(`Nested --workspace values are not supported yet: ${JSON.stringify(child)} is inside ${JSON.stringify(parent)}. Pass non-nested --workspace values.`);this.name="NestedWorkspaceInputError"}};var MissingWorkspaceInputError=class extends Error{static{__name(this,"MissingWorkspaceInputError")}constructor(){super("--workspace requires a value.");this.name="MissingWorkspaceInputError"}};function normalizeWorkspaceInputs(workspace){if(Array.isArray(workspace)){if(workspace.length===0){throw new MissingWorkspaceInputError}return workspace.map(value=>String(value))}if(workspace===void 0)return[process.cwd()];return[String(workspace)]}__name(normalizeWorkspaceInputs,"normalizeWorkspaceInputs");function isNestedWorkspace(parent,child){return parent!==child&&isWithinRoot(child,parent)}__name(isNestedWorkspace,"isNestedWorkspace");function rejectDuplicateOrNestedWorkspaceInputs(workspaces){if(workspaces.length<=1)return;let canonicalWorkspaces;try{canonicalWorkspaces=workspaces.map(workspace=>canonicalizeWorkspace(workspace))}catch{return}const seen=new Set;for(const workspace of canonicalWorkspaces){if(seen.has(workspace)){throw new DuplicateWorkspaceInputError(workspace)}seen.add(workspace)}for(let i=0;i<canonicalWorkspaces.length;i++){for(let j=i+1;j<canonicalWorkspaces.length;j++){const first=canonicalWorkspaces[i];const second=canonicalWorkspaces[j];if(isNestedWorkspace(first,second)){throw new NestedWorkspaceInputError(first,second)}if(isNestedWorkspace(second,first)){throw new NestedWorkspaceInputError(second,first)}}}}__name(rejectDuplicateOrNestedWorkspaceInputs,"rejectDuplicateOrNestedWorkspaceInputs");function resolveWorkspaceInputs(workspace){const workspaces=normalizeWorkspaceInputs(workspace);rejectDuplicateOrNestedWorkspaceInputs(workspaces);return workspaces}__name(resolveWorkspaceInputs,"resolveWorkspaceInputs");var SCHEMA_VERSION=1;var MAX_SECONDARY_WORKSPACES=MAX_CONFIGURED_REGISTERED_WORKSPACES-1;var MAX_STORE_BYTES=8*1024*1024;var MAX_WORKSPACE_DISPLAY_NAME_LENGTH=256;var LOCK_OPTIONS={realpath:false,stale:1e4,update:2e3,retries:{retries:120,minTimeout:10,maxTimeout:100,factor:1.2,randomize:true}};var WorkspaceDisplayNameValidationError=class extends Error{static{__name(this,"WorkspaceDisplayNameValidationError")}constructor(message){super(message);this.name="WorkspaceDisplayNameValidationError"}};function containsDisplayNameControlCharacter(value){for(const character of value){const codePoint=character.codePointAt(0);if(codePoint<=31||codePoint===127)return true}return false}__name(containsDisplayNameControlCharacter,"containsDisplayNameControlCharacter");function normalizeWorkspaceDisplayName(value){if(typeof value!=="string"){throw new WorkspaceDisplayNameValidationError("Workspace display name must be a string")}const trimmed=value.trim();if(trimmed.length>MAX_WORKSPACE_DISPLAY_NAME_LENGTH){throw new WorkspaceDisplayNameValidationError(`Workspace display name exceeds ${MAX_WORKSPACE_DISPLAY_NAME_LENGTH} characters`)}if(containsDisplayNameControlCharacter(trimmed)){throw new WorkspaceDisplayNameValidationError("Workspace display name contains control characters")}return trimmed.length===0?void 0:trimmed}__name(normalizeWorkspaceDisplayName,"normalizeWorkspaceDisplayName");var WorkspaceRegistrationStoreError=class extends Error{static{__name(this,"WorkspaceRegistrationStoreError")}constructor(message){super(message);this.name="WorkspaceRegistrationStoreError"}};var WorkspaceRegistrationStoreLimitError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreLimitError")}};var WorkspaceRegistrationStoreTooLargeError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreTooLargeError")}};var WorkspaceRegistrationStoreCommittedError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreCommittedError")}};function normalizedScopePath(primaryWorkspace){return os.platform()==="win32"?primaryWorkspace.toLowerCase():primaryWorkspace}__name(normalizedScopePath,"normalizedScopePath");function workspaceRegistrationScopeHash(primaryWorkspace){return createHash("sha256").update(normalizedScopePath(primaryWorkspace)).digest("hex")}__name(workspaceRegistrationScopeHash,"workspaceRegistrationScopeHash");function workspaceRegistrationId(workspace){return createHash("sha256").update(workspace).digest("hex").slice(0,16)}__name(workspaceRegistrationId,"workspaceRegistrationId");function getWorkspaceRegistrationStorePath(primaryWorkspace,qwenHome=getGlobalQwenDirLite()){return path.join(qwenHome,"daemon","workspaces",`${workspaceRegistrationScopeHash(primaryWorkspace)}.json`)}__name(getWorkspaceRegistrationStorePath,"getWorkspaceRegistrationStorePath");function emptySnapshot(primaryWorkspace){return{schemaVersion:SCHEMA_VERSION,primaryWorkspace,workspaces:[]}}__name(emptySnapshot,"emptySnapshot");function validateWorkspacePath(value,label){if(typeof value!=="string"||!path.isAbsolute(value)){throw new WorkspaceRegistrationStoreError(`${label} must be an absolute path`)}if(value.includes("\0")||value.length>MAX_WORKSPACE_PATH_LENGTH){throw new WorkspaceRegistrationStoreError(`${label} is invalid`)}return value}__name(validateWorkspacePath,"validateWorkspacePath");function validateStoredDisplayName(value,label){let displayName;try{displayName=normalizeWorkspaceDisplayName(value)}catch(err){throw new WorkspaceRegistrationStoreError(`${label} is invalid: ${err instanceof Error?err.message:String(err)}`)}if(displayName===void 0){throw new WorkspaceRegistrationStoreError(`${label} must not be empty`)}return displayName}__name(validateStoredDisplayName,"validateStoredDisplayName");function setSnapshotDisplayName(snapshot,registrationId,displayName){if(displayName===void 0){if(!snapshot.displayNames||!Object.hasOwn(snapshot.displayNames,registrationId)){return false}delete snapshot.displayNames[registrationId];if(Object.keys(snapshot.displayNames).length===0){delete snapshot.displayNames}return true}if(snapshot.displayNames?.[registrationId]===displayName)return false;snapshot.displayNames??={};snapshot.displayNames[registrationId]=displayName;return true}__name(setSnapshotDisplayName,"setSnapshotDisplayName");function parseSnapshot(raw,primaryWorkspace){let value;try{value=JSON.parse(raw)}catch{throw new WorkspaceRegistrationStoreError("Workspace registration store contains malformed JSON")}if(typeof value!=="object"||value===null||Array.isArray(value)){throw new WorkspaceRegistrationStoreError("Workspace registration store root must be an object")}const record=value;if(record["schemaVersion"]!==SCHEMA_VERSION){throw new WorkspaceRegistrationStoreError(`Unsupported workspace registration schema ${String(record["schemaVersion"])}`)}const storedPrimary=validateWorkspacePath(record["primaryWorkspace"],"primaryWorkspace");if(normalizedScopePath(storedPrimary)!==normalizedScopePath(primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Workspace registration store primary does not match this daemon")}if(!Array.isArray(record["workspaces"])){throw new WorkspaceRegistrationStoreError("Workspace registration store workspaces must be an array")}if(record["workspaces"].length>MAX_SECONDARY_WORKSPACES){throw new WorkspaceRegistrationStoreError(`Workspace registration store exceeds ${MAX_SECONDARY_WORKSPACES} entries`)}const seen=new Set;const workspaces=record["workspaces"].map((entry,index)=>{const workspace=validateWorkspacePath(entry,`workspaces[${index}]`);const normalizedWorkspace=normalizedScopePath(workspace);if(normalizedWorkspace===normalizedScopePath(primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Primary workspace cannot be stored as a secondary registration")}if(seen.has(normalizedWorkspace)){throw new WorkspaceRegistrationStoreError("Workspace registration store contains duplicate paths")}seen.add(normalizedWorkspace);return workspace});const rawDisplayNames=record["displayNames"];let displayNames;if(rawDisplayNames!==void 0){if(typeof rawDisplayNames!=="object"||rawDisplayNames===null||Array.isArray(rawDisplayNames)){throw new WorkspaceRegistrationStoreError("Workspace registration store displayNames must be an object")}const registrationIds=new Set(workspaces.map(workspaceRegistrationId));for(const[registrationId,value2]of Object.entries(rawDisplayNames)){if(!registrationIds.has(registrationId)){throw new WorkspaceRegistrationStoreError(`Workspace registration store displayNames contains unknown registration id ${JSON.stringify(registrationId)}`)}displayNames??={};displayNames[registrationId]=validateStoredDisplayName(value2,`displayNames[${JSON.stringify(registrationId)}]`)}}return{schemaVersion:SCHEMA_VERSION,primaryWorkspace,workspaces,...displayNames?{displayNames}:{}}}__name(parseSnapshot,"parseSnapshot");var updateChains=new Map;async function withInProcessLock(filePath,work){const previous=updateChains.get(filePath)??Promise.resolve();const next=previous.then(work,work);const settled=next.catch(()=>void 0).finally(()=>{if(updateChains.get(filePath)===settled)updateChains.delete(filePath)});updateChains.set(filePath,settled);return next}__name(withInProcessLock,"withInProcessLock");function compromisedLockError(){return new WorkspaceRegistrationStoreError("Workspace registration store lock was compromised")}__name(compromisedLockError,"compromisedLockError");async function acquireFileLock(filePath){await fs.mkdir(path.dirname(filePath),{recursive:true,mode:448});let compromised=false;const release=await import_proper_lockfile.default.lock(filePath,{...LOCK_OPTIONS,onCompromised:__name(()=>{compromised=true},"onCompromised")});return{assertOwned:__name(()=>{if(compromised)throw compromisedLockError()},"assertOwned"),release:__name(async()=>{try{await release()}catch(err){if(!compromised)throw err}if(compromised)throw compromisedLockError()},"release")}}__name(acquireFileLock,"acquireFileLock");var WorkspaceRegistrationStore=class{constructor(primaryWorkspace,qwenHome){this.primaryWorkspace=primaryWorkspace;validateWorkspacePath(primaryWorkspace,"primaryWorkspace");this.filePath=getWorkspaceRegistrationStorePath(primaryWorkspace,qwenHome)}static{__name(this,"WorkspaceRegistrationStore")}filePath;async read(){try{const entry=await fs.lstat(this.filePath);if(entry.isSymbolicLink()||!entry.isFile()){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}}catch(err){if(err.code==="ENOENT"){return emptySnapshot(this.primaryWorkspace)}throw err}let file;try{file=await openNoFollow(this.filePath)}catch(err){if(err.code==="ENOENT"){return emptySnapshot(this.primaryWorkspace)}if(isUnverifiableIdentityError(err)){throw new WorkspaceRegistrationStoreError("Workspace registration store identity could not be verified")}if(err.code==="ELOOP"){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}throw err}try{const stat=await file.stat();if(!stat.isFile()){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}if(stat.size>MAX_STORE_BYTES){throw new WorkspaceRegistrationStoreTooLargeError(`Workspace registration store exceeds ${MAX_STORE_BYTES} bytes`)}let buffer=Buffer.alloc(Math.max(1,Math.min(stat.size+1,MAX_STORE_BYTES+1)));let totalBytesRead=0;for(;;){if(totalBytesRead===buffer.length){if(totalBytesRead>MAX_STORE_BYTES)break;const grown=Buffer.alloc(Math.min(MAX_STORE_BYTES+1,Math.max(buffer.length*2,totalBytesRead+1)));buffer.copy(grown,0,0,totalBytesRead);buffer=grown}const{bytesRead}=await file.read(buffer,totalBytesRead,buffer.length-totalBytesRead,totalBytesRead);if(bytesRead===0)break;totalBytesRead+=bytesRead}if(totalBytesRead>MAX_STORE_BYTES){throw new WorkspaceRegistrationStoreTooLargeError(`Workspace registration store exceeds ${MAX_STORE_BYTES} bytes`)}return parseSnapshot(buffer.toString("utf8",0,totalBytesRead),this.primaryWorkspace)}finally{await file.close()}}async add(workspace,displayName,maxRegisteredWorkspaces=MAX_REGISTERED_WORKSPACES){const maxSecondaries=resolveMaxRegisteredWorkspaces(maxRegisteredWorkspaces,{})-1;validateWorkspacePath(workspace,"workspace");const normalizedDisplayName=displayName===void 0?void 0:normalizeWorkspaceDisplayName(displayName);if(normalizedScopePath(workspace)===normalizedScopePath(this.primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Primary workspace cannot be stored as a secondary registration")}return this.update(snapshot=>{const normalizedWorkspace=normalizedScopePath(workspace);if(snapshot.workspaces.some(stored=>normalizedScopePath(stored)===normalizedWorkspace)){return false}if(snapshot.workspaces.length>=maxSecondaries){throw new WorkspaceRegistrationStoreLimitError(`Workspace registration store limit of ${maxSecondaries} reached`)}snapshot.workspaces.push(workspace);if(normalizedDisplayName!==void 0){snapshot.displayNames??={};snapshot.displayNames[workspaceRegistrationId(workspace)]=normalizedDisplayName}return true})}async removeById(id){return await this.removeByIds([id])>0}async setDisplayNameByIds(ids,displayName){const normalizedDisplayName=displayName===void 0?void 0:normalizeWorkspaceDisplayName(displayName);const requested=new Set(ids);if(requested.size===0)return 0;let matched=0;await this.update(snapshot=>{let changed=false;for(const workspace of snapshot.workspaces){const registrationId=workspaceRegistrationId(workspace);if(!requested.has(registrationId))continue;matched++;changed=setSnapshotDisplayName(snapshot,registrationId,normalizedDisplayName)||changed}return changed});return matched}async removeByIds(ids){const requested=new Set(ids);if(requested.size===0)return 0;let removed=0;await this.update(snapshot=>{const removedIds=new Set;const retained=snapshot.workspaces.filter(workspace=>{const registrationId=workspaceRegistrationId(workspace);if(!requested.has(registrationId))return true;removed++;removedIds.add(registrationId);return false});if(removed===0)return false;snapshot.workspaces.splice(0,snapshot.workspaces.length,...retained);for(const registrationId of removedIds){setSnapshotDisplayName(snapshot,registrationId,void 0)}return true});return removed}async update(mutate){const{atomicWriteFile}=await import("./deferred-core-runtime-DEC3N46T.js");return withInProcessLock(this.filePath,async()=>{const lock=await acquireFileLock(this.filePath);let committed=false;let changed=false;let workError;try{const snapshot=await this.read();lock.assertOwned();changed=mutate(snapshot);if(changed){const serialized=`${JSON.stringify(snapshot,null,2)}
|
|
3
|
+
import{MAX_WORKSPACE_PATH_LENGTH,canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{getGlobalQwenDirLite}from"./chunk-PTHIQ7ZN.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{isUnverifiableIdentityError,openNoFollow}from"./chunk-QXQGUM3Y.js";import{require_proper_lockfile}from"./chunk-YIW3H46P.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{createHash}from"node:crypto";import*as fs from"node:fs/promises";import*as os from"node:os";import*as path from"node:path";init_esbuild_shims();var MAX_REGISTERED_WORKSPACES=256;var MAX_CONFIGURED_REGISTERED_WORKSPACES=256;var QWEN_SERVE_MAX_WORKSPACES_ENV="QWEN_SERVE_MAX_WORKSPACES";function resolveMaxRegisteredWorkspaces(configured,env){const raw=env[QWEN_SERVE_MAX_WORKSPACES_ENV];const value=configured??(raw===void 0?MAX_REGISTERED_WORKSPACES:/^\d+$/.test(raw.trim())?Number(raw.trim()):Number.NaN);if(!Number.isSafeInteger(value)||value<1||value>MAX_CONFIGURED_REGISTERED_WORKSPACES){const source=configured===void 0?`${QWEN_SERVE_MAX_WORKSPACES_ENV}=${JSON.stringify(raw)}`:`maxRegisteredWorkspaces option ${String(configured)}`;throw new TypeError(`Invalid ${source}: must be an integer from 1 to ${MAX_CONFIGURED_REGISTERED_WORKSPACES}.`)}return value}__name(resolveMaxRegisteredWorkspaces,"resolveMaxRegisteredWorkspaces");var DuplicateWorkspaceInputError=class extends Error{static{__name(this,"DuplicateWorkspaceInputError")}constructor(workspace){super(`Duplicate --workspace value resolves to ${JSON.stringify(workspace)}. Pass distinct --workspace values.`);this.name="DuplicateWorkspaceInputError"}};var NestedWorkspaceInputError=class extends Error{static{__name(this,"NestedWorkspaceInputError")}constructor(parent,child){super(`Nested --workspace values are not supported yet: ${JSON.stringify(child)} is inside ${JSON.stringify(parent)}. Pass non-nested --workspace values.`);this.name="NestedWorkspaceInputError"}};var MissingWorkspaceInputError=class extends Error{static{__name(this,"MissingWorkspaceInputError")}constructor(){super("--workspace requires a value.");this.name="MissingWorkspaceInputError"}};function normalizeWorkspaceInputs(workspace){if(Array.isArray(workspace)){if(workspace.length===0){throw new MissingWorkspaceInputError}return workspace.map(value=>String(value))}if(workspace===void 0)return[process.cwd()];return[String(workspace)]}__name(normalizeWorkspaceInputs,"normalizeWorkspaceInputs");function isNestedWorkspace(parent,child){return parent!==child&&isWithinRoot(child,parent)}__name(isNestedWorkspace,"isNestedWorkspace");function rejectDuplicateOrNestedWorkspaceInputs(workspaces){if(workspaces.length<=1)return;let canonicalWorkspaces;try{canonicalWorkspaces=workspaces.map(workspace=>canonicalizeWorkspace(workspace))}catch{return}const seen=new Set;for(const workspace of canonicalWorkspaces){if(seen.has(workspace)){throw new DuplicateWorkspaceInputError(workspace)}seen.add(workspace)}for(let i=0;i<canonicalWorkspaces.length;i++){for(let j=i+1;j<canonicalWorkspaces.length;j++){const first=canonicalWorkspaces[i];const second=canonicalWorkspaces[j];if(isNestedWorkspace(first,second)){throw new NestedWorkspaceInputError(first,second)}if(isNestedWorkspace(second,first)){throw new NestedWorkspaceInputError(second,first)}}}}__name(rejectDuplicateOrNestedWorkspaceInputs,"rejectDuplicateOrNestedWorkspaceInputs");function resolveWorkspaceInputs(workspace){const workspaces=normalizeWorkspaceInputs(workspace);rejectDuplicateOrNestedWorkspaceInputs(workspaces);return workspaces}__name(resolveWorkspaceInputs,"resolveWorkspaceInputs");var SCHEMA_VERSION=1;var MAX_SECONDARY_WORKSPACES=MAX_CONFIGURED_REGISTERED_WORKSPACES-1;var MAX_STORE_BYTES=8*1024*1024;var MAX_WORKSPACE_DISPLAY_NAME_LENGTH=256;var LOCK_OPTIONS={realpath:false,stale:1e4,update:2e3,retries:{retries:120,minTimeout:10,maxTimeout:100,factor:1.2,randomize:true}};var WorkspaceDisplayNameValidationError=class extends Error{static{__name(this,"WorkspaceDisplayNameValidationError")}constructor(message){super(message);this.name="WorkspaceDisplayNameValidationError"}};function containsDisplayNameControlCharacter(value){for(const character of value){const codePoint=character.codePointAt(0);if(codePoint<=31||codePoint===127)return true}return false}__name(containsDisplayNameControlCharacter,"containsDisplayNameControlCharacter");function normalizeWorkspaceDisplayName(value){if(typeof value!=="string"){throw new WorkspaceDisplayNameValidationError("Workspace display name must be a string")}const trimmed=value.trim();if(trimmed.length>MAX_WORKSPACE_DISPLAY_NAME_LENGTH){throw new WorkspaceDisplayNameValidationError(`Workspace display name exceeds ${MAX_WORKSPACE_DISPLAY_NAME_LENGTH} characters`)}if(containsDisplayNameControlCharacter(trimmed)){throw new WorkspaceDisplayNameValidationError("Workspace display name contains control characters")}return trimmed.length===0?void 0:trimmed}__name(normalizeWorkspaceDisplayName,"normalizeWorkspaceDisplayName");var WorkspaceRegistrationStoreError=class extends Error{static{__name(this,"WorkspaceRegistrationStoreError")}constructor(message){super(message);this.name="WorkspaceRegistrationStoreError"}};var WorkspaceRegistrationStoreLimitError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreLimitError")}};var WorkspaceRegistrationStoreTooLargeError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreTooLargeError")}};var WorkspaceRegistrationStoreCommittedError=class extends WorkspaceRegistrationStoreError{static{__name(this,"WorkspaceRegistrationStoreCommittedError")}};function normalizedScopePath(primaryWorkspace){return os.platform()==="win32"?primaryWorkspace.toLowerCase():primaryWorkspace}__name(normalizedScopePath,"normalizedScopePath");function workspaceRegistrationScopeHash(primaryWorkspace){return createHash("sha256").update(normalizedScopePath(primaryWorkspace)).digest("hex")}__name(workspaceRegistrationScopeHash,"workspaceRegistrationScopeHash");function workspaceRegistrationId(workspace){return createHash("sha256").update(workspace).digest("hex").slice(0,16)}__name(workspaceRegistrationId,"workspaceRegistrationId");function getWorkspaceRegistrationStorePath(primaryWorkspace,qwenHome=getGlobalQwenDirLite()){return path.join(qwenHome,"daemon","workspaces",`${workspaceRegistrationScopeHash(primaryWorkspace)}.json`)}__name(getWorkspaceRegistrationStorePath,"getWorkspaceRegistrationStorePath");function emptySnapshot(primaryWorkspace){return{schemaVersion:SCHEMA_VERSION,primaryWorkspace,workspaces:[]}}__name(emptySnapshot,"emptySnapshot");function validateWorkspacePath(value,label){if(typeof value!=="string"||!path.isAbsolute(value)){throw new WorkspaceRegistrationStoreError(`${label} must be an absolute path`)}if(value.includes("\0")||value.length>MAX_WORKSPACE_PATH_LENGTH){throw new WorkspaceRegistrationStoreError(`${label} is invalid`)}return value}__name(validateWorkspacePath,"validateWorkspacePath");function validateStoredDisplayName(value,label){let displayName;try{displayName=normalizeWorkspaceDisplayName(value)}catch(err){throw new WorkspaceRegistrationStoreError(`${label} is invalid: ${err instanceof Error?err.message:String(err)}`)}if(displayName===void 0){throw new WorkspaceRegistrationStoreError(`${label} must not be empty`)}return displayName}__name(validateStoredDisplayName,"validateStoredDisplayName");function setSnapshotDisplayName(snapshot,registrationId,displayName){if(displayName===void 0){if(!snapshot.displayNames||!Object.hasOwn(snapshot.displayNames,registrationId)){return false}delete snapshot.displayNames[registrationId];if(Object.keys(snapshot.displayNames).length===0){delete snapshot.displayNames}return true}if(snapshot.displayNames?.[registrationId]===displayName)return false;snapshot.displayNames??={};snapshot.displayNames[registrationId]=displayName;return true}__name(setSnapshotDisplayName,"setSnapshotDisplayName");function parseSnapshot(raw,primaryWorkspace){let value;try{value=JSON.parse(raw)}catch{throw new WorkspaceRegistrationStoreError("Workspace registration store contains malformed JSON")}if(typeof value!=="object"||value===null||Array.isArray(value)){throw new WorkspaceRegistrationStoreError("Workspace registration store root must be an object")}const record=value;if(record["schemaVersion"]!==SCHEMA_VERSION){throw new WorkspaceRegistrationStoreError(`Unsupported workspace registration schema ${String(record["schemaVersion"])}`)}const storedPrimary=validateWorkspacePath(record["primaryWorkspace"],"primaryWorkspace");if(normalizedScopePath(storedPrimary)!==normalizedScopePath(primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Workspace registration store primary does not match this daemon")}if(!Array.isArray(record["workspaces"])){throw new WorkspaceRegistrationStoreError("Workspace registration store workspaces must be an array")}if(record["workspaces"].length>MAX_SECONDARY_WORKSPACES){throw new WorkspaceRegistrationStoreError(`Workspace registration store exceeds ${MAX_SECONDARY_WORKSPACES} entries`)}const seen=new Set;const workspaces=record["workspaces"].map((entry,index)=>{const workspace=validateWorkspacePath(entry,`workspaces[${index}]`);const normalizedWorkspace=normalizedScopePath(workspace);if(normalizedWorkspace===normalizedScopePath(primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Primary workspace cannot be stored as a secondary registration")}if(seen.has(normalizedWorkspace)){throw new WorkspaceRegistrationStoreError("Workspace registration store contains duplicate paths")}seen.add(normalizedWorkspace);return workspace});const rawDisplayNames=record["displayNames"];let displayNames;if(rawDisplayNames!==void 0){if(typeof rawDisplayNames!=="object"||rawDisplayNames===null||Array.isArray(rawDisplayNames)){throw new WorkspaceRegistrationStoreError("Workspace registration store displayNames must be an object")}const registrationIds=new Set(workspaces.map(workspaceRegistrationId));for(const[registrationId,value2]of Object.entries(rawDisplayNames)){if(!registrationIds.has(registrationId)){throw new WorkspaceRegistrationStoreError(`Workspace registration store displayNames contains unknown registration id ${JSON.stringify(registrationId)}`)}displayNames??={};displayNames[registrationId]=validateStoredDisplayName(value2,`displayNames[${JSON.stringify(registrationId)}]`)}}return{schemaVersion:SCHEMA_VERSION,primaryWorkspace,workspaces,...displayNames?{displayNames}:{}}}__name(parseSnapshot,"parseSnapshot");var updateChains=new Map;async function withInProcessLock(filePath,work){const previous=updateChains.get(filePath)??Promise.resolve();const next=previous.then(work,work);const settled=next.catch(()=>void 0).finally(()=>{if(updateChains.get(filePath)===settled)updateChains.delete(filePath)});updateChains.set(filePath,settled);return next}__name(withInProcessLock,"withInProcessLock");function compromisedLockError(){return new WorkspaceRegistrationStoreError("Workspace registration store lock was compromised")}__name(compromisedLockError,"compromisedLockError");async function acquireFileLock(filePath){await fs.mkdir(path.dirname(filePath),{recursive:true,mode:448});let compromised=false;const release=await import_proper_lockfile.default.lock(filePath,{...LOCK_OPTIONS,onCompromised:__name(()=>{compromised=true},"onCompromised")});return{assertOwned:__name(()=>{if(compromised)throw compromisedLockError()},"assertOwned"),release:__name(async()=>{try{await release()}catch(err){if(!compromised)throw err}if(compromised)throw compromisedLockError()},"release")}}__name(acquireFileLock,"acquireFileLock");var WorkspaceRegistrationStore=class{constructor(primaryWorkspace,qwenHome){this.primaryWorkspace=primaryWorkspace;validateWorkspacePath(primaryWorkspace,"primaryWorkspace");this.filePath=getWorkspaceRegistrationStorePath(primaryWorkspace,qwenHome)}static{__name(this,"WorkspaceRegistrationStore")}filePath;async read(){try{const entry=await fs.lstat(this.filePath);if(entry.isSymbolicLink()||!entry.isFile()){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}}catch(err){if(err.code==="ENOENT"){return emptySnapshot(this.primaryWorkspace)}throw err}let file;try{file=await openNoFollow(this.filePath)}catch(err){if(err.code==="ENOENT"){return emptySnapshot(this.primaryWorkspace)}if(isUnverifiableIdentityError(err)){throw new WorkspaceRegistrationStoreError("Workspace registration store identity could not be verified")}if(err.code==="ELOOP"){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}throw err}try{const stat=await file.stat();if(!stat.isFile()){throw new WorkspaceRegistrationStoreError("Workspace registration store must be a regular file")}if(stat.size>MAX_STORE_BYTES){throw new WorkspaceRegistrationStoreTooLargeError(`Workspace registration store exceeds ${MAX_STORE_BYTES} bytes`)}let buffer=Buffer.alloc(Math.max(1,Math.min(stat.size+1,MAX_STORE_BYTES+1)));let totalBytesRead=0;for(;;){if(totalBytesRead===buffer.length){if(totalBytesRead>MAX_STORE_BYTES)break;const grown=Buffer.alloc(Math.min(MAX_STORE_BYTES+1,Math.max(buffer.length*2,totalBytesRead+1)));buffer.copy(grown,0,0,totalBytesRead);buffer=grown}const{bytesRead}=await file.read(buffer,totalBytesRead,buffer.length-totalBytesRead,totalBytesRead);if(bytesRead===0)break;totalBytesRead+=bytesRead}if(totalBytesRead>MAX_STORE_BYTES){throw new WorkspaceRegistrationStoreTooLargeError(`Workspace registration store exceeds ${MAX_STORE_BYTES} bytes`)}return parseSnapshot(buffer.toString("utf8",0,totalBytesRead),this.primaryWorkspace)}finally{await file.close()}}async add(workspace,displayName,maxRegisteredWorkspaces=MAX_REGISTERED_WORKSPACES){const maxSecondaries=resolveMaxRegisteredWorkspaces(maxRegisteredWorkspaces,{})-1;validateWorkspacePath(workspace,"workspace");const normalizedDisplayName=displayName===void 0?void 0:normalizeWorkspaceDisplayName(displayName);if(normalizedScopePath(workspace)===normalizedScopePath(this.primaryWorkspace)){throw new WorkspaceRegistrationStoreError("Primary workspace cannot be stored as a secondary registration")}return this.update(snapshot=>{const normalizedWorkspace=normalizedScopePath(workspace);if(snapshot.workspaces.some(stored=>normalizedScopePath(stored)===normalizedWorkspace)){return false}if(snapshot.workspaces.length>=maxSecondaries){throw new WorkspaceRegistrationStoreLimitError(`Workspace registration store limit of ${maxSecondaries} reached`)}snapshot.workspaces.push(workspace);if(normalizedDisplayName!==void 0){snapshot.displayNames??={};snapshot.displayNames[workspaceRegistrationId(workspace)]=normalizedDisplayName}return true})}async removeById(id){return await this.removeByIds([id])>0}async setDisplayNameByIds(ids,displayName){const normalizedDisplayName=displayName===void 0?void 0:normalizeWorkspaceDisplayName(displayName);const requested=new Set(ids);if(requested.size===0)return 0;let matched=0;await this.update(snapshot=>{let changed=false;for(const workspace of snapshot.workspaces){const registrationId=workspaceRegistrationId(workspace);if(!requested.has(registrationId))continue;matched++;changed=setSnapshotDisplayName(snapshot,registrationId,normalizedDisplayName)||changed}return changed});return matched}async removeByIds(ids){const requested=new Set(ids);if(requested.size===0)return 0;let removed=0;await this.update(snapshot=>{const removedIds=new Set;const retained=snapshot.workspaces.filter(workspace=>{const registrationId=workspaceRegistrationId(workspace);if(!requested.has(registrationId))return true;removed++;removedIds.add(registrationId);return false});if(removed===0)return false;snapshot.workspaces.splice(0,snapshot.workspaces.length,...retained);for(const registrationId of removedIds){setSnapshotDisplayName(snapshot,registrationId,void 0)}return true});return removed}async update(mutate){const{atomicWriteFile}=await import("./deferred-core-runtime-5BAMFFOI.js");return withInProcessLock(this.filePath,async()=>{const lock=await acquireFileLock(this.filePath);let committed=false;let changed=false;let workError;try{const snapshot=await this.read();lock.assertOwned();changed=mutate(snapshot);if(changed){const serialized=`${JSON.stringify(snapshot,null,2)}
|
|
4
4
|
`;if(Buffer.byteLength(serialized,"utf8")>MAX_STORE_BYTES){throw new WorkspaceRegistrationStoreTooLargeError(`Workspace registration store exceeds ${MAX_STORE_BYTES} bytes`)}lock.assertOwned();await atomicWriteFile(this.filePath,serialized,{mode:384,forceMode:true,noFollow:true});committed=true}}catch(err){workError=err}let releaseError;try{await lock.release()}catch(err){releaseError=committed?new WorkspaceRegistrationStoreCommittedError(`Workspace registration update committed but lock release failed: ${err instanceof Error?err.message:String(err)}`):err}if(workError instanceof Error&&releaseError!==void 0&&workError.cause===void 0){workError.cause=releaseError}if(workError!==void 0)throw workError;if(releaseError!==void 0)throw releaseError;return changed})}};export{MAX_REGISTERED_WORKSPACES,resolveMaxRegisteredWorkspaces,resolveWorkspaceInputs,MAX_WORKSPACE_DISPLAY_NAME_LENGTH,WorkspaceDisplayNameValidationError,normalizeWorkspaceDisplayName,WorkspaceRegistrationStoreError,WorkspaceRegistrationStoreLimitError,WorkspaceRegistrationStoreTooLargeError,WorkspaceRegistrationStoreCommittedError,workspaceRegistrationScopeHash,workspaceRegistrationId,getWorkspaceRegistrationStorePath,WorkspaceRegistrationStore};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{publicProviderBaseUrl}from"./chunk-GT4TCQ3R.js";import{getWritableScopes}from"./chunk-
|
|
3
|
+
import{publicProviderBaseUrl}from"./chunk-GT4TCQ3R.js";import{getWritableScopes}from"./chunk-Q5RRVBTY.js";import{isImageGenerationCapable,tryResolveModelProtocol}from"./chunk-ET2Z7ZGF.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{createHash}from"node:crypto";function modelKey(scope,provider,model,authType){return createHash("sha256").update(JSON.stringify([scope,provider,model.id,model.baseUrl??"",authType])).digest("hex")}__name(modelKey,"modelKey");function modelEntries(loaded){const seenProviders=new Set;return["System",...getWritableScopes(loaded),"SystemDefaults"].flatMap(scope=>{const providers=loaded.forScope(scope).settings.modelProviders??{};return Object.entries(providers).flatMap(([provider,models])=>{if(seenProviders.has(provider))return[];seenProviders.add(provider);if(!Array.isArray(models))return[];return models.flatMap((model,index)=>{if(!model||typeof model!=="object"||typeof model.id!=="string"||!model.id||model.baseUrl!==void 0&&typeof model.baseUrl!=="string")return[];const authType=tryResolveModelProtocol(provider,model,loaded.merged.providerProtocol);if(!authType||authType==="qwen-oauth")return[];return[{scope,provider,authType,model,index,key:modelKey(scope,provider,model,authType)}]})})})}__name(modelEntries,"modelEntries");function findModelConfiguration(loaded,key){const matches=modelEntries(loaded).filter(entry=>entry.key===key);return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0]:void 0}__name(findModelConfiguration,"findModelConfiguration");function findModelConfigurationForDeletion(loaded,target){const candidates=modelEntries(loaded).filter(entry=>entry.authType===target.authType&&entry.model.id===target.modelId);const exact=candidates.filter(entry=>(entry.model.baseUrl??void 0)===target.baseUrl);const matches=target.baseUrl!==void 0&&exact.length?exact:candidates;if(matches.length===0)return void 0;return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0]:"ambiguous"}__name(findModelConfigurationForDeletion,"findModelConfigurationForDeletion");function getModelConfigurationKey(loaded,authType,modelId,baseUrl){const matches=modelEntries(loaded).filter(entry=>entry.authType===authType&&entry.model.id===modelId&&(entry.model.baseUrl??"")===(baseUrl??""));return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0].key:void 0}__name(getModelConfigurationKey,"getModelConfigurationKey");function isConversationModelConfiguration(model){return!model.imageOnly&&!model.voiceOnly&&!model.fastOnly&&!model.visionOnly&&!model.realtimeOnly}__name(isConversationModelConfiguration,"isConversationModelConfiguration");function isImageModelConfiguration(model){if(!isImageGenerationCapable(model)||model.fastOnly||model.voiceOnly||model.realtimeOnly||!model.baseUrl||typeof model.envKey!=="string"||!model.envKey.trim())return false;try{const url=new URL(model.baseUrl);return url.protocol==="https:"&&!url.username&&!url.password&&!url.search&&!url.hash}catch{return false}}__name(isImageModelConfiguration,"isImageModelConfiguration");function listModelConfigurations(loaded){const entries=modelEntries(loaded);const routeKey=__name(entry=>JSON.stringify([entry.authType,entry.model.id,entry.model.baseUrl??""]),"routeKey");const counts=new Map;for(const entry of entries){const route=routeKey(entry);counts.set(route,(counts.get(route)??0)+1)}const writableScopes=getWritableScopes(loaded);return entries.filter(entry=>writableScopes.includes(entry.scope)).map(entry=>{const{model,authType,key}=entry;const uniqueRoute=counts.get(routeKey(entry))===1;let imageModel;let advisorModel;if(uniqueRoute&&isConversationModelConfiguration(model)){if(!model.baseUrl)advisorModel=`${authType}:${model.id}\0`;else{try{const url=new URL(model.baseUrl);if(["https:","http:"].includes(url.protocol)&&!url.username&&!url.password&&!url.search&&!url.hash)advisorModel=`${authType}:${model.id}\0${model.baseUrl}`}catch{}}}if(uniqueRoute&&isImageModelConfiguration(model)){imageModel=`${authType}:${model.id}\0${model.baseUrl}`}return{key,authType,modelId:model.id,name:model.name,baseUrl:model.baseUrl?publicProviderBaseUrl(model.baseUrl):void 0,envKey:typeof model.envKey==="string"?model.envKey:void 0,contextWindowSize:typeof model.generationConfig?.contextWindowSize==="number"&&Number.isInteger(model.generationConfig.contextWindowSize)&&model.generationConfig.contextWindowSize>0?model.generationConfig.contextWindowSize:void 0,canEditContextWindow:uniqueRoute,purpose:model.imageOnly===true?"image":model.voiceOnly===true?"voice":model.realtimeOnly===true?"realtime":"chat",...imageModel?{imageModel}:{},...advisorModel?{advisorModel}:{}}})}__name(listModelConfigurations,"listModelConfigurations");function updateModelContextWindow(loaded,key,contextWindowSize,assertGenerationOpen){const match=findModelConfiguration(loaded,key);if(!match)return void 0;if(getModelConfigurationKey(loaded,match.authType,match.model.id,match.model.baseUrl)!==key)return void 0;const{scope,provider,index}=match;const providers=loaded.forScope(scope).originalSettings.modelProviders??{};const model=providers[provider][index];const generationConfig={...model.generationConfig};if(contextWindowSize===null)delete generationConfig.contextWindowSize;else generationConfig.contextWindowSize=contextWindowSize;const updated={...model,generationConfig};if(Object.keys(generationConfig).length===0)delete updated.generationConfig;loaded.setValue(scope,"modelProviders",{...providers,[provider]:providers[provider].map((entry,i)=>i===index?updated:entry)},assertGenerationOpen,{throwOnWriteFailure:true});return scope==="Workspace"?"workspace":"user"}__name(updateModelContextWindow,"updateModelContextWindow");export{findModelConfiguration,findModelConfigurationForDeletion,getModelConfigurationKey,isConversationModelConfiguration,isImageModelConfiguration,listModelConfigurations,updateModelContextWindow};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{captureRuntimeFileVersion,writeRuntimeFile}from"./chunk-
|
|
3
|
+
import{captureRuntimeFileVersion,writeRuntimeFile}from"./chunk-WXK7Z45R.js";import{checkTeamMemorySecrets,checkWorkspaceTeamMemorySecrets}from"./chunk-UJP2MPBI.js";import{buildWorkspaceArtifactCandidate,formatRecordArtifactReminder}from"./chunk-AKWYMQKU.js";import{CommitAttributionService,FileEncoding,checkPriorRead,createPatchSmart,detectLineEnding,getDiffStat,needsUtf8Bom}from"./chunk-T3CQ72HC.js";import{backgroundFixHolding}from"./chunk-YVD4O5ZB.js";import{getCurrentAgentId}from"./chunk-YZFNBUKG.js";import{FileOperationEvent,ReadFileTool,getLanguageFromFilePath,logFileOperation}from"./chunk-ZWPSBU7K.js";import{isAnyAutoMemPath,isTeamAutoMemPath}from"./chunk-KVA6DHHF.js";import{fileExists,getSpecificMimeType}from"./chunk-Y6HHV4LC.js";import{safeLiteralReplace}from"./chunk-DBRQGEEI.js";import{BaseDeclarativeTool,StructuredToolError}from"./chunk-O5EKX7LG.js";import{ToolDisplayNames,ToolNames}from"./chunk-SBZFGYYS.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{makeRelative,shortenPath,unescapePath}from"./chunk-OKN3Z5C5.js";import{getErrorMessage,isNodeError}from"./chunk-XYB7GC5U.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs";import*as path from"node:path";init_esbuild_shims();var UNICODE_EQUIVALENT_MAP={"\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xA0":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2007":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u202F":" ","\u205F":" ","\u3000":" "};function normalizeBasicCharacters(text){if(text===""){return text}let normalized="";for(const char of text){normalized+=UNICODE_EQUIVALENT_MAP[char]??char}return normalized}__name(normalizeBasicCharacters,"normalizeBasicCharacters");var LINE_COMPARISON_PASSES=[value=>value,value=>value.trimEnd()];function normalizeLineForComparison(value){return normalizeBasicCharacters(value).trimEnd()}__name(normalizeLineForComparison,"normalizeLineForComparison");function seekSequenceWithTransform(lines,pattern,transform){if(pattern.length===0){return 0}if(pattern.length>lines.length){return null}outer:for(let i=0;i<=lines.length-pattern.length;i++){for(let p=0;p<pattern.length;p++){if(transform(lines[i+p])!==transform(pattern[p])){continue outer}}return i}return null}__name(seekSequenceWithTransform,"seekSequenceWithTransform");function buildLineIndex(text){const lines=text.split("\n");const offsets=new Array(lines.length+1);let cursor=0;for(let i=0;i<lines.length;i++){offsets[i]=cursor;cursor+=lines[i].length;if(i<lines.length-1){cursor+=1}}offsets[lines.length]=text.length;return{lines,offsets}}__name(buildLineIndex,"buildLineIndex");function sliceFromLines(text,offsets,lines,startLine,lineCount,includeTrailingNewline){if(lineCount===0){return includeTrailingNewline?"\n":""}const startIndex=offsets[startLine]??0;const lastLineIndex=startLine+lineCount-1;const lastLineStart=offsets[lastLineIndex]??0;let endIndex=lastLineStart+(lines[lastLineIndex]?.length??0);if(includeTrailingNewline){const nextLineStart=offsets[startLine+lineCount];if(nextLineStart!==void 0){endIndex=nextLineStart}else if(text.endsWith("\n")){endIndex=text.length}}return text.slice(startIndex,endIndex)}__name(sliceFromLines,"sliceFromLines");function findLineBasedMatch(haystack,needle){const{lines,offsets}=buildLineIndex(haystack);const patternLines=needle.split("\n");const endsWithNewline=needle.endsWith("\n");if(patternLines.length===0){return null}const attemptMatch=__name(candidate=>{for(const pass of LINE_COMPARISON_PASSES){const idx=seekSequenceWithTransform(lines,candidate,pass);if(idx!==null){return idx}}return seekSequenceWithTransform(lines,candidate,normalizeLineForComparison)},"attemptMatch");let matchIndex=attemptMatch(patternLines);if(matchIndex!==null){return{slice:sliceFromLines(haystack,offsets,lines,matchIndex,patternLines.length-(endsWithNewline?1:0),endsWithNewline),removedTrailingFinalEmptyLine:false,lineBasedMatch:true}}if(patternLines.at(-1)===""){const trimmedPattern=patternLines.slice(0,-1);if(trimmedPattern.length===0){return null}matchIndex=attemptMatch(trimmedPattern);if(matchIndex!==null){return{slice:sliceFromLines(haystack,offsets,lines,matchIndex,trimmedPattern.length,false),removedTrailingFinalEmptyLine:true,lineBasedMatch:true}}}return null}__name(findLineBasedMatch,"findLineBasedMatch");function findMatchedSlice(haystack,needle){if(needle===""){return null}const literalIndex=haystack.indexOf(needle);if(literalIndex!==-1){return{slice:haystack.slice(literalIndex,literalIndex+needle.length),removedTrailingFinalEmptyLine:false}}const normalizedHaystack=normalizeBasicCharacters(haystack);const normalizedNeedleChars=normalizeBasicCharacters(needle);const normalizedIndex=normalizedHaystack.indexOf(normalizedNeedleChars);if(normalizedIndex!==-1){return{slice:haystack.slice(normalizedIndex,normalizedIndex+needle.length),removedTrailingFinalEmptyLine:false}}return findLineBasedMatch(haystack,needle)}__name(findMatchedSlice,"findMatchedSlice");function removeTrailingNewline(text){if(text.endsWith("\r\n")){return text.slice(0,-2)}if(text.endsWith("\n")||text.endsWith("\r")){return text.slice(0,-1)}return text}__name(removeTrailingNewline,"removeTrailingNewline");function adjustNewStringForTrailingLine(newString,removedTrailingLine){return removedTrailingLine?removeTrailingNewline(newString):newString}__name(adjustNewStringForTrailingLine,"adjustNewStringForTrailingLine");function normalizeEditStrings(fileContent,oldString,newString){if(fileContent===null||oldString===""){return{oldString,newString}}const canonicalOriginal=findMatchedSlice(fileContent,oldString);if(canonicalOriginal!==null){return{oldString:canonicalOriginal.slice,newString:adjustNewStringForTrailingLine(newString,canonicalOriginal.removedTrailingFinalEmptyLine),...canonicalOriginal.lineBasedMatch?{lineBasedMatch:true}:{}}}return{oldString,newString}}__name(normalizeEditStrings,"normalizeEditStrings");function maybeAugmentOldStringForDeletion(fileContent,oldString,newString,lineBasedMatch=false){if(fileContent===null||oldString===""||newString!==""||oldString.endsWith("\n")){return oldString}const candidate=`${oldString}
|
|
4
4
|
`;const hasCandidate=lineBasedMatch?findLineBasedMatchOffsets(fileContent,candidate).length>0:fileContent.includes(candidate);return hasCandidate?candidate:oldString}__name(maybeAugmentOldStringForDeletion,"maybeAugmentOldStringForDeletion");function countOccurrences(source,substr){if(substr===""){return 0}let count=0;let index=source.indexOf(substr);while(index!==-1){count++;index=source.indexOf(substr,index+substr.length)}return count}__name(countOccurrences,"countOccurrences");function findLineBasedMatchOffsets(source,substr){const offsets=[];if(substr===""){return offsets}let index=source.indexOf(substr);while(index!==-1){const end=index+substr.length;const startsLine=index===0||source[index-1]==="\n";const endsLine=substr.endsWith("\n")||end===source.length||source[end]==="\n";if(startsLine&&endsLine){offsets.push(index);index=source.indexOf(substr,end)}else{index=source.indexOf(substr,index+1)}}return offsets}__name(findLineBasedMatchOffsets,"findLineBasedMatchOffsets");var SNIPPET_CONTEXT_LINES=4;var SNIPPET_MAX_LINES=1e3;function extractEditSnippet(oldContent,newContent){const newLines=newContent.split("\n");const totalLines=newLines.length;if(oldContent===null){return{startLine:1,endLine:totalLines,totalLines,content:newContent}}if(oldContent===newContent||!newContent){return null}const oldLines=oldContent.split("\n");let firstDiffLine=0;const minLength=Math.min(oldLines.length,newLines.length);while(firstDiffLine<minLength){if(oldLines[firstDiffLine]!==newLines[firstDiffLine]){break}firstDiffLine++}let oldEndIndex=oldLines.length-1;let newEndIndex=newLines.length-1;while(oldEndIndex>=firstDiffLine&&newEndIndex>=firstDiffLine){if(oldLines[oldEndIndex]!==newLines[newEndIndex]){break}oldEndIndex--;newEndIndex--}const changeStart=firstDiffLine+1;const changeEnd=newEndIndex+1;if(changeEnd-changeStart>SNIPPET_MAX_LINES){return null}const snippetStart=Math.max(1,changeStart-SNIPPET_CONTEXT_LINES);const snippetEnd=Math.min(totalLines,changeEnd+SNIPPET_CONTEXT_LINES);const snippetLines=newLines.slice(snippetStart-1,snippetEnd);return{startLine:snippetStart,endLine:snippetEnd,totalLines,content:snippetLines.join("\n")}}__name(extractEditSnippet,"extractEditSnippet");var debugLogger=createDebugLogger("EDIT_PRIOR_READ");function applyReplacement(currentContent,oldString,newString,isNewFile,matchOffsets){if(isNewFile){return newString}if(currentContent===null){return oldString===""?newString:""}if(oldString===""&&!isNewFile){return currentContent}if(matchOffsets!==void 0){const pieces=[];let cursor=0;for(const offset of matchOffsets){pieces.push(currentContent.slice(cursor,offset),newString);cursor=offset+oldString.length}pieces.push(currentContent.slice(cursor));return pieces.join("")}return safeLiteralReplace(currentContent,oldString,newString)}__name(applyReplacement,"applyReplacement");var EditToolInvocation=class{constructor(config,params){this.config=config;this.params=params}static{__name(this,"EditToolInvocation")}toolLocations(){return[{path:this.params.file_path}]}async calculateEdit(params,original,signal){const observation=original??await this.config.getFileSystemService().textFileIo?.inspect(params.file_path,signal);const sandboxFileVersion=captureRuntimeFileVersion(this.config,params.file_path);const replaceAll=params.replace_all??false;let currentContent=null;let fileExists2=observation?observation.kind==="file":await fileExists(params.file_path);let isNewFile=false;let finalNewString=params.new_string;let finalOldString=params.old_string;let occurrences=0;let error=void 0;let useBOM=false;let detectedEncoding="utf-8";let detectedLineEnding="lf";if(!this.config.getFileReadCacheDisabled()){const decision=await checkPriorRead(this.config.getFileReadCache(),params.file_path,"editing");if(!decision.ok){return{currentContent:null,newContent:"",occurrences:0,error:{display:decision.displayMessage,raw:decision.rawMessage,type:decision.type},isNewFile:false,encoding:"utf-8",bom:false,lineEnding:"lf"}}}if(fileExists2){try{const fileInfo=observation?.kind==="file"?observation.response:await this.config.getFileSystemService().readTextFile({path:params.file_path});if(fileInfo._meta?.bom!==void 0){useBOM=fileInfo._meta.bom}else{useBOM=fileInfo.content.length>0&&fileInfo.content.codePointAt(0)===65279}detectedEncoding=fileInfo._meta?.encoding||"utf-8";detectedLineEnding=detectLineEnding(fileInfo.content);currentContent=fileInfo.content.replace(/\r\n/g,"\n");fileExists2=true}catch(err){if(!isNodeError(err)||err.code!=="ENOENT"){throw err}fileExists2=false}}if(fileExists2&&!this.config.getFileReadCacheDisabled()){const postDecision=await checkPriorRead(this.config.getFileReadCache(),params.file_path,"editing",{expectExisting:true});if(!postDecision.ok){debugLogger.warn("post-read TOCTOU rejection",{path:params.file_path,reason:postDecision.type});return{currentContent:null,newContent:"",occurrences:0,error:{display:postDecision.displayMessage,raw:postDecision.rawMessage,type:postDecision.type},isNewFile:false,encoding:"utf-8",bom:false,lineEnding:"lf"}}}const normalizedStrings=normalizeEditStrings(currentContent,finalOldString,finalNewString);finalOldString=normalizedStrings.oldString;finalNewString=normalizedStrings.newString;let matchOffsets;if(finalOldString===""&&!fileExists2){isNewFile=true}else if(!fileExists2){error={display:`File not found. Cannot apply edit. Use an empty old_string to create a new file.`,raw:`File not found: ${params.file_path}`,type:"file_not_found"}}else if(currentContent!==null){finalOldString=maybeAugmentOldStringForDeletion(currentContent,finalOldString,finalNewString,normalizedStrings.lineBasedMatch);if(normalizedStrings.lineBasedMatch){matchOffsets=findLineBasedMatchOffsets(currentContent,finalOldString)}occurrences=matchOffsets?.length??countOccurrences(currentContent,finalOldString);if(params.old_string===""){error={display:`Failed to edit. Attempted to create a file that already exists.`,raw:`File already exists, cannot create: ${params.file_path}`,type:"attempt_to_create_existing_file"}}else if(occurrences===0){error={display:`Failed to edit, could not find the string to replace.`,raw:`Failed to edit, 0 occurrences found for old_string in ${params.file_path}. No edits made. The exact text in old_string was not found. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${ReadFileTool.Name} tool to verify.`,type:"edit_no_occurrence_found"}}else if(!replaceAll&&occurrences>1){error={display:`Failed to edit because the text matches multiple locations. Provide more context or set replace_all to true.`,raw:`Failed to edit. Found ${occurrences} occurrences for old_string in ${params.file_path} but replace_all was not enabled.`,type:"edit_expected_occurrence_mismatch"}}else if(finalOldString===finalNewString){error={display:`No changes to apply. The old_string and new_string are identical.`,raw:`No changes to apply. The old_string and new_string are identical in file: ${params.file_path}`,type:"edit_no_change"}}}else{error={display:`Failed to read content of file.`,raw:`Failed to read content of existing file: ${params.file_path}`,type:"read_content_failure"}}const newContent=!error?applyReplacement(currentContent,finalOldString,finalNewString,isNewFile,matchOffsets):currentContent??"";if(!error&&fileExists2&¤tContent===newContent){error={display:"No changes to apply. The new content is identical to the current content.",raw:`No changes to apply. The new content is identical to the current content in file: ${params.file_path}`,type:"edit_no_change"}}if(!error){const teamMemoryError=(this.config.getFileSystemService().textFileIo?checkWorkspaceTeamMemorySecrets:checkTeamMemorySecrets)(params.file_path,newContent,this.config.getProjectRoot());if(teamMemoryError){const preExisting=currentContent!==null&&(this.config.getFileSystemService().textFileIo?checkWorkspaceTeamMemorySecrets:checkTeamMemorySecrets)(params.file_path,currentContent,this.config.getProjectRoot())!==null;const message=preExisting?`${teamMemoryError} Note: the secret already exists in the current file content, so removing it from your edit alone is not enough \u2014 delete the committed secret from the file.`:teamMemoryError;error={display:message,raw:message,type:"invalid_tool_params"}}}return{currentContent,newContent,sandboxFileVersion,occurrences,error,isNewFile,bom:useBOM,encoding:detectedEncoding,lineEnding:detectedLineEnding}}requiresUserInteraction(){return backgroundFixHolding(this.params.file_path,getCurrentAgentId())!==void 0}async getDefaultPermission(){if(this.config.getFileSystemService().textFileIo)return"ask";const projectRoot=this.config.getProjectRoot();const filePath=path.resolve(this.params.file_path);if(isTeamAutoMemPath(filePath,projectRoot)){return"ask"}if(isAnyAutoMemPath(filePath,projectRoot)){return"allow"}return"ask"}async getConfirmationDetails(abortSignal){let editData;try{editData=await this.calculateEdit(this.params,void 0,abortSignal)}catch(error){if(abortSignal.aborted){throw error}const errorMsg=isNodeError(error)&&error.code==="EISDIR"?`Target is a directory, not a file: ${this.params.file_path} (${error.code})`:getErrorMessage(error);throw new Error(`Error preparing edit: ${errorMsg}`)}if(editData.error){throw new StructuredToolError(editData.error.raw,editData.error.type)}const fileName=path.basename(this.params.file_path);const fileDiff=createPatchSmart(fileName,editData.currentContent??"",editData.newContent,"Current","Proposed");const confirmationDetails={type:"edit",title:`Confirm Edit: ${shortenPath(makeRelative(this.params.file_path,this.config.getTargetDir()))}`,fileName,filePath:this.params.file_path,fileDiff,originalContent:editData.currentContent,newContent:editData.newContent,onConfirm:__name(async outcome=>{if(outcome==="proceed_always"){this.config.setApprovalMode("auto-edit")}},"onConfirm")};return confirmationDetails}getDescription(){const relativePath=makeRelative(this.params.file_path,this.config.getTargetDir());if(this.params.old_string===""){return`Create ${shortenPath(relativePath)}`}if(this.params.old_string===this.params.new_string){return`No file changes to ${shortenPath(relativePath)}`}return shortenPath(relativePath)}async execute(signal){try{const io=this.config.getFileSystemService().textFileIo;return io?await io.withMutation(this.params.file_path,signal,mutation=>this.executeObserved(signal,mutation)):await this.executeObserved(signal)}catch(error){if(signal.aborted)throw error;return this.writeFailure(error)}}async executeObserved(signal,mutation){let editData;try{editData=await this.calculateEdit(this.params,mutation?.original,signal)}catch(error){if(signal.aborted){throw error}const errorMsg=getErrorMessage(error);return{llmContent:`Error preparing edit: ${errorMsg}`,returnDisplay:`Error preparing edit: ${errorMsg}`,error:{message:errorMsg,type:"edit_preparation_failure"}}}if(editData.error){return{llmContent:editData.error.raw,returnDisplay:`Error: ${editData.error.display}`,error:{message:editData.error.raw,type:editData.error.type}}}try{try{await this.config.getFileHistoryService().trackEdit(this.params.file_path)}catch{}if(!this.config.getFileReadCacheDisabled()){const writeDecision=await checkPriorRead(this.config.getFileReadCache(),this.params.file_path,"editing",{expectExisting:!editData.isNewFile});if(!writeDecision.ok){debugLogger.warn("pre-write TOCTOU rejection",{path:this.params.file_path,reason:writeDecision.type});return{llmContent:writeDecision.rawMessage,returnDisplay:`Error: ${writeDecision.displayMessage}`,error:{message:writeDecision.rawMessage,type:writeDecision.type}}}}if(!mutation&&!this.config.getShellExecutionSandbox?.()){this.ensureParentDirectoriesExist(this.params.file_path)}let committedStats;const write=__name(async params=>{if(mutation)committedStats=await mutation.write(params);else await writeRuntimeFile(this.config,params,editData.sandboxFileVersion,signal)},"write");if(editData.isNewFile){const userEncoding=this.config.getDefaultFileEncoding();let useBOM=false;if(userEncoding===FileEncoding.UTF8_BOM){useBOM=true}else if(userEncoding===void 0){useBOM=needsUtf8Bom(this.params.file_path)}await write({path:this.params.file_path,content:editData.newContent,toolWriteOrigin:"edit",_meta:{bom:useBOM}})}else{await write({path:this.params.file_path,content:editData.newContent,toolWriteOrigin:"edit",_meta:{bom:editData.bom,encoding:editData.encoding,lineEnding:editData.lineEnding}})}if(!mutation&&!this.params.modified_by_user){CommitAttributionService.getInstance().recordEdit(this.params.file_path,editData.currentContent,editData.newContent)}let postWriteSizeBytes;try{if(mutation&&!committedStats)throw new Error("Scoped file write returned no committed stats.");const postWriteStats=mutation?committedStats:fs.statSync(this.params.file_path);postWriteSizeBytes=postWriteStats.size;this.config.getFileReadCache().recordWrite(this.params.file_path,postWriteStats)}catch(error){if(mutation)throw error}const fileName=path.basename(this.params.file_path);const originallyProposedContent=this.params.ai_proposed_content||editData.newContent;const diffStat=getDiffStat(fileName,editData.currentContent??"",originallyProposedContent,editData.newContent);const fileDiff=createPatchSmart(fileName,editData.currentContent??"",editData.newContent,"Current","Proposed");const displayResult={fileDiff,fileName,filePath:this.params.file_path,originalContent:editData.currentContent,newContent:editData.newContent,diffStat};const mimetype=getSpecificMimeType(this.params.file_path);const programmingLanguage=getLanguageFromFilePath(this.params.file_path);const extension=path.extname(this.params.file_path);const operation=editData.isNewFile?"create":"update";logFileOperation(this.config,new FileOperationEvent(EditTool.Name,operation,editData.newContent.split("\n").length,mimetype,extension,programmingLanguage));const llmSuccessMessageParts=[editData.isNewFile?`Created new file: ${this.params.file_path} with provided content.`:`The file: ${this.params.file_path} has been updated.`];const artifact=buildWorkspaceArtifactCandidate(this.config,this.params.file_path,{recordAsArtifact:this.params.record_as_artifact,sizeBytes:postWriteSizeBytes});if(artifact&&!artifact.updateOnly){llmSuccessMessageParts.push(formatRecordArtifactReminder(artifact.workspacePath))}const snippetResult=extractEditSnippet(editData.currentContent,editData.newContent);if(snippetResult){const snippetText=`Showing lines ${snippetResult.startLine}-${snippetResult.endLine} of ${snippetResult.totalLines} from the edited file:
|
|
5
5
|
|
|
6
6
|
---
|